Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/angry-rabbits-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@digdir/designsystemet-web": patch
---

**Suggestion:** fix to ensure input has role `combobox` (not `textbox`) on first render.
5 changes: 5 additions & 0 deletions .changeset/khaki-bobcats-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@digdir/designsystemet-css": patch
---

**Suggestion:** now uses attribute `data-activedescendant` under the hood to add focus styling on option elements
7 changes: 7 additions & 0 deletions .changeset/yellow-bars-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@digdir/designsystemet-web": patch
---

update dependencies
- @u-elements/u-combobox to 2.0.3
- @u-elements/u-datalist to 2.0.1
4 changes: 3 additions & 1 deletion packages/css/src/suggestion.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@
}
}

@composes ds-focus--inset from './base.css';
&[data-activedescendant] {
@composes ds-focus--visible--inset from './base.css';
}

@media (hover: hover) and (pointer: fine) {
&:not([data-empty]):hover {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { DSErrorSummaryElement } from '@digdir/designsystemet-web';
import type { Meta, StoryFn } from '@storybook/react-vite';
import { useEffect, useRef, useState } from 'react';
import { expect, userEvent, within } from 'storybook/test';
Expand Down Expand Up @@ -85,7 +86,7 @@ WithForm.decorators = [

export const ShowHideReact: Story = () => {
const [show, setShow] = useState(false);
const summaryRef = useRef<HTMLDivElement>(null);
const summaryRef = useRef<DSErrorSummaryElement>(null);
useEffect(() => {
if (show) {
summaryRef.current?.focus();
Expand Down
34 changes: 18 additions & 16 deletions packages/react/src/components/error-summary/error-summary.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { DSErrorSummaryElement } from '@digdir/designsystemet-web';
import { Slot } from '@radix-ui/react-slot';
import cl from 'clsx/lite';
import type { HTMLAttributes, ReactNode } from 'react';
Expand All @@ -9,7 +10,7 @@ export type ErrorSummaryProps = {
* @deprecated This is not supported anymore, as the element needs to be `ds-error-summary`
*/
asChild?: ReactNode;
} & Omit<HTMLAttributes<HTMLDivElement> & DefaultProps, 'data-color'>;
} & Omit<HTMLAttributes<DSErrorSummaryElement> & DefaultProps, 'data-color'>;

/**
* ErrorSummary component, used to display a list of errors.
Expand All @@ -27,19 +28,20 @@ export type ErrorSummaryProps = {
* </ErrorSummary.List>
* </ErrorSummary>
*/
export const ErrorSummary = forwardRef<HTMLDivElement, ErrorSummaryProps>(
function ErrorSummary({ asChild, className, ...rest }, ref) {
const Component = asChild ? Slot : 'ds-error-summary';
export const ErrorSummary = forwardRef<
DSErrorSummaryElement,
ErrorSummaryProps
>(function ErrorSummary({ asChild, className, ...rest }, ref) {
const Component = asChild ? Slot : 'ds-error-summary';

return (
<Component
{...(asChild
? { className: cl('ds-error-summary', className) }
: { class: cl('ds-error-summary', className) })}
ref={ref}
suppressHydrationWarning
{...rest}
/>
);
},
);
return (
<Component
{...(asChild
? { className: cl('ds-error-summary', className) }
: { class: cl('ds-error-summary', className) })}
ref={ref}
suppressHydrationWarning
{...rest}
/>
);
});
4 changes: 2 additions & 2 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
},
"dependencies": {
"@floating-ui/dom": "^1.7.6",
"@u-elements/u-combobox": "^1.0.7",
"@u-elements/u-datalist": "^1.1.0",
"@u-elements/u-combobox": "^2.0.3",
"@u-elements/u-datalist": "^2.0.1",
"@u-elements/u-details": "^1.0.0",
"@u-elements/u-tabs": "^1.0.1"
},
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading