@digdir/designsystemet-react 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Combobox/Combobox.js +1 -0
- package/dist/cjs/components/Combobox/Option/useComboboxOption.js +1 -0
- package/dist/cjs/components/Combobox/useComboboxKeyboard.js +1 -0
- package/dist/cjs/components/avatar/avatar.js +2 -2
- package/dist/cjs/components/breadcrumbs/breadcrumbs-link.js +2 -1
- package/dist/cjs/components/breadcrumbs/breadcrumbs-list.js +1 -11
- package/dist/cjs/components/breadcrumbs/breadcrumbs.js +2 -1
- package/dist/cjs/components/button/button.js +8 -3
- package/dist/cjs/components/card/card.js +17 -9
- package/dist/cjs/components/details/details-summary.js +3 -3
- package/dist/cjs/components/details/details.js +2 -2
- package/dist/cjs/components/dialog/dialog-trigger-context.js +5 -6
- package/dist/cjs/components/dialog/dialog-trigger.js +3 -8
- package/dist/cjs/components/dialog/dialog.js +25 -55
- package/dist/cjs/components/error-summary/error-summary-heading.js +2 -8
- package/dist/cjs/components/error-summary/error-summary.js +4 -9
- package/dist/cjs/components/field/field-counter.js +6 -41
- package/dist/cjs/components/field/field-description.js +2 -1
- package/dist/cjs/components/field/field.js +6 -4
- package/dist/cjs/components/label/label.js +2 -1
- package/dist/cjs/components/pagination/pagination-button.js +5 -3
- package/dist/cjs/components/pagination/pagination.js +7 -3
- package/dist/cjs/components/popover/popover-trigger.js +6 -10
- package/dist/cjs/components/popover/popover.js +15 -62
- package/dist/cjs/components/select/select.js +2 -12
- package/dist/cjs/components/skeleton/skeleton.js +1 -0
- package/dist/cjs/components/spinner/spinner.js +1 -0
- package/dist/cjs/components/suggestion/suggestion-clear.js +4 -2
- package/dist/cjs/components/suggestion/suggestion-empty.js +3 -1
- package/dist/cjs/components/suggestion/suggestion-input.js +4 -3
- package/dist/cjs/components/suggestion/suggestion-list.js +5 -41
- package/dist/cjs/components/suggestion/suggestion-option.js +3 -1
- package/dist/cjs/components/suggestion/suggestion.js +9 -9
- package/dist/cjs/components/tabs/tabs-list.js +4 -7
- package/dist/cjs/components/tabs/tabs-panel.js +5 -28
- package/dist/cjs/components/tabs/tabs-tab.js +11 -9
- package/dist/cjs/components/tabs/tabs.js +16 -6
- package/dist/cjs/components/toggle-group/index.js +1 -1
- package/dist/cjs/components/toggle-group/toggle-group-item.js +8 -6
- package/dist/cjs/components/toggle-group/toggle-group.js +6 -6
- package/dist/cjs/components/tooltip/tooltip.js +6 -147
- package/dist/cjs/components/validation-message/validation-message.js +2 -1
- package/dist/cjs/index.js +39 -38
- package/dist/cjs/utilities/hooks/use-pagination/use-pagination.js +13 -25
- package/dist/cjs/utilities/index.js +17 -0
- package/dist/cjs/utilities/roving-focus/roving-focus-item.js +2 -0
- package/dist/cjs/utilities/roving-focus/roving-focus-root.js +4 -0
- package/dist/cjs/utilities/roving-focus/use-roving-focus.js +3 -1
- package/dist/esm/components/Combobox/Combobox.js +1 -0
- package/dist/esm/components/Combobox/Option/useComboboxOption.js +1 -0
- package/dist/esm/components/Combobox/useComboboxKeyboard.js +1 -0
- package/dist/esm/components/avatar/avatar.js +2 -2
- package/dist/esm/components/breadcrumbs/breadcrumbs-link.js +2 -1
- package/dist/esm/components/breadcrumbs/breadcrumbs-list.js +2 -12
- package/dist/esm/components/breadcrumbs/breadcrumbs.js +2 -1
- package/dist/esm/components/button/button.js +9 -4
- package/dist/esm/components/card/card.js +18 -10
- package/dist/esm/components/details/details-summary.js +3 -3
- package/dist/esm/components/details/details.js +2 -2
- package/dist/esm/components/dialog/dialog-trigger-context.js +6 -7
- package/dist/esm/components/dialog/dialog-trigger.js +3 -8
- package/dist/esm/components/dialog/dialog.js +26 -56
- package/dist/esm/components/error-summary/error-summary-heading.js +3 -9
- package/dist/esm/components/error-summary/error-summary.js +6 -10
- package/dist/esm/components/field/field-counter.js +8 -43
- package/dist/esm/components/field/field-description.js +2 -1
- package/dist/esm/components/field/field.js +7 -5
- package/dist/esm/components/label/label.js +2 -1
- package/dist/esm/components/pagination/pagination-button.js +5 -3
- package/dist/esm/components/pagination/pagination.js +7 -3
- package/dist/esm/components/popover/popover-trigger.js +6 -10
- package/dist/esm/components/popover/popover.js +15 -62
- package/dist/esm/components/select/select.js +2 -12
- package/dist/esm/components/skeleton/skeleton.js +1 -0
- package/dist/esm/components/spinner/spinner.js +1 -0
- package/dist/esm/components/suggestion/suggestion-clear.js +4 -2
- package/dist/esm/components/suggestion/suggestion-empty.js +3 -1
- package/dist/esm/components/suggestion/suggestion-input.js +4 -3
- package/dist/esm/components/suggestion/suggestion-list.js +5 -41
- package/dist/esm/components/suggestion/suggestion-option.js +3 -1
- package/dist/esm/components/suggestion/suggestion.js +9 -9
- package/dist/esm/components/tabs/tabs-list.js +5 -8
- package/dist/esm/components/tabs/tabs-panel.js +6 -29
- package/dist/esm/components/tabs/tabs-tab.js +12 -10
- package/dist/esm/components/tabs/tabs.js +17 -7
- package/dist/esm/components/toggle-group/index.js +1 -1
- package/dist/esm/components/toggle-group/toggle-group-item.js +10 -8
- package/dist/esm/components/toggle-group/toggle-group.js +7 -7
- package/dist/esm/components/tooltip/tooltip.js +8 -149
- package/dist/esm/components/validation-message/validation-message.js +2 -1
- package/dist/esm/index.js +8 -7
- package/dist/esm/utilities/hooks/use-pagination/use-pagination.js +13 -25
- package/dist/esm/utilities/index.js +11 -0
- package/dist/esm/utilities/roving-focus/roving-focus-item.js +2 -0
- package/dist/esm/utilities/roving-focus/roving-focus-root.js +4 -0
- package/dist/esm/utilities/roving-focus/use-roving-focus.js +3 -1
- package/dist/react-types.d.ts +8 -0
- package/dist/types/components/avatar/avatar.d.ts +12 -7
- package/dist/types/components/avatar/avatar.d.ts.map +1 -1
- package/dist/types/components/breadcrumbs/breadcrumbs-link.d.ts.map +1 -1
- package/dist/types/components/breadcrumbs/breadcrumbs-list.d.ts.map +1 -1
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +5 -3
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/button/button.d.ts.map +1 -1
- package/dist/types/components/card/card.d.ts.map +1 -1
- package/dist/types/components/details/details-summary.d.ts.map +1 -1
- package/dist/types/components/details/details.d.ts +1 -1
- package/dist/types/components/details/details.d.ts.map +1 -1
- package/dist/types/components/dialog/dialog-trigger-context.d.ts +10 -3
- package/dist/types/components/dialog/dialog-trigger-context.d.ts.map +1 -1
- package/dist/types/components/dialog/dialog-trigger.d.ts +1 -1
- package/dist/types/components/dialog/dialog-trigger.d.ts.map +1 -1
- package/dist/types/components/dialog/dialog.d.ts +3 -3
- package/dist/types/components/dialog/dialog.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +1 -2
- package/dist/types/components/dropdown/dropdown.d.ts.map +1 -1
- package/dist/types/components/error-summary/error-summary-heading.d.ts.map +1 -1
- package/dist/types/components/error-summary/error-summary.d.ts +6 -6
- package/dist/types/components/error-summary/error-summary.d.ts.map +1 -1
- package/dist/types/components/field/field-counter.d.ts +2 -8
- package/dist/types/components/field/field-counter.d.ts.map +1 -1
- package/dist/types/components/field/field-description.d.ts.map +1 -1
- package/dist/types/components/field/field.d.ts +6 -2
- package/dist/types/components/field/field.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/components/input/input.d.ts +13 -1
- package/dist/types/components/input/input.d.ts.map +1 -1
- package/dist/types/components/label/label.d.ts.map +1 -1
- package/dist/types/components/pagination/pagination-button.d.ts +13 -4
- package/dist/types/components/pagination/pagination-button.d.ts.map +1 -1
- package/dist/types/components/pagination/pagination.d.ts +27 -5
- package/dist/types/components/pagination/pagination.d.ts.map +1 -1
- package/dist/types/components/popover/popover-trigger.d.ts.map +1 -1
- package/dist/types/components/popover/popover.d.ts +2 -14
- package/dist/types/components/popover/popover.d.ts.map +1 -1
- package/dist/types/components/search/search-button.d.ts +1 -1
- package/dist/types/components/select/select.d.ts +2 -0
- package/dist/types/components/select/select.d.ts.map +1 -1
- package/dist/types/components/suggestion/suggestion-clear.d.ts +7 -5
- package/dist/types/components/suggestion/suggestion-clear.d.ts.map +1 -1
- package/dist/types/components/suggestion/suggestion-empty.d.ts +1 -0
- package/dist/types/components/suggestion/suggestion-empty.d.ts.map +1 -1
- package/dist/types/components/suggestion/suggestion-input.d.ts +2 -1
- package/dist/types/components/suggestion/suggestion-input.d.ts.map +1 -1
- package/dist/types/components/suggestion/suggestion-list.d.ts +1 -1
- package/dist/types/components/suggestion/suggestion-list.d.ts.map +1 -1
- package/dist/types/components/suggestion/suggestion-option.d.ts +1 -0
- package/dist/types/components/suggestion/suggestion-option.d.ts.map +1 -1
- package/dist/types/components/suggestion/suggestion.d.ts +5 -6
- package/dist/types/components/suggestion/suggestion.d.ts.map +1 -1
- package/dist/types/components/tabs/tabs-list.d.ts +4 -2
- package/dist/types/components/tabs/tabs-list.d.ts.map +1 -1
- package/dist/types/components/tabs/tabs-panel.d.ts +4 -2
- package/dist/types/components/tabs/tabs-panel.d.ts.map +1 -1
- package/dist/types/components/tabs/tabs-tab.d.ts +4 -2
- package/dist/types/components/tabs/tabs-tab.d.ts.map +1 -1
- package/dist/types/components/tabs/tabs.d.ts +6 -6
- package/dist/types/components/tabs/tabs.d.ts.map +1 -1
- package/dist/types/components/textfield/textfield.d.ts.map +1 -1
- package/dist/types/components/toggle-group/index.d.ts +1 -1
- package/dist/types/components/toggle-group/toggle-group-item.d.ts +12 -3
- package/dist/types/components/toggle-group/toggle-group-item.d.ts.map +1 -1
- package/dist/types/components/toggle-group/toggle-group.d.ts +12 -4
- package/dist/types/components/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/types/components/tooltip/tooltip.d.ts +10 -3
- package/dist/types/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/types/components/validation-message/validation-message.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utilities/hooks/use-pagination/use-pagination.d.ts +1 -1
- package/dist/types/utilities/hooks/use-pagination/use-pagination.d.ts.map +1 -1
- package/dist/types/utilities/index.d.ts +6 -0
- package/dist/types/utilities/index.d.ts.map +1 -1
- package/dist/types/utilities/roving-focus/roving-focus-item.d.ts +1 -0
- package/dist/types/utilities/roving-focus/roving-focus-item.d.ts.map +1 -1
- package/dist/types/utilities/roving-focus/roving-focus-root.d.ts +1 -0
- package/dist/types/utilities/roving-focus/roving-focus-root.d.ts.map +1 -1
- package/dist/types/utilities/roving-focus/use-roving-focus.d.ts +14 -12
- package/dist/types/utilities/roving-focus/use-roving-focus.d.ts.map +1 -1
- package/package.json +16 -19
- package/dist/cjs/components/field/field-observer.js +0 -112
- package/dist/cjs/components/toggle-group/use-toggle-groupitem.js +0 -34
- package/dist/esm/components/field/field-observer.js +0 -107
- package/dist/esm/components/toggle-group/use-toggle-groupitem.js +0 -32
- package/dist/types/components/field/field-observer.d.ts +0 -5
- package/dist/types/components/field/field-observer.d.ts.map +0 -1
- package/dist/types/components/toggle-group/use-toggle-groupitem.d.ts +0 -12
- package/dist/types/components/toggle-group/use-toggle-groupitem.d.ts.map +0 -1
|
@@ -9,7 +9,7 @@ export type ToggleGroupContextProps = {
|
|
|
9
9
|
name?: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const ToggleGroupContext: import("react").Context<ToggleGroupContextProps>;
|
|
12
|
-
export type ToggleGroupProps = MergeRight<DefaultProps & Omit<HTMLAttributes<
|
|
12
|
+
export type ToggleGroupProps = MergeRight<DefaultProps & Omit<HTMLAttributes<HTMLFieldSetElement>, 'value' | 'onChange'>, {
|
|
13
13
|
/**
|
|
14
14
|
* Specify which variant to use
|
|
15
15
|
* @default 'primary'
|
|
@@ -31,18 +31,22 @@ export type ToggleGroupProps = MergeRight<DefaultProps & Omit<HTMLAttributes<HTM
|
|
|
31
31
|
* Form element name
|
|
32
32
|
*/
|
|
33
33
|
name?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Toggle group label for accessibility
|
|
36
|
+
*/
|
|
37
|
+
'data-toggle-group'?: string;
|
|
34
38
|
}>;
|
|
35
39
|
/**
|
|
36
40
|
* Display a group of buttons that can be toggled between.
|
|
37
41
|
*
|
|
38
42
|
* @example
|
|
39
|
-
* <ToggleGroup onChange={(value) => console.log(value)}>
|
|
43
|
+
* <ToggleGroup data-toggle-group="Label" onChange={(value) => console.log(value)}>
|
|
40
44
|
* <ToggleGroup.Item value='1'>Toggle 1</ToggleGroup.Item>
|
|
41
45
|
* <ToggleGroup.Item value='2'>Toggle 2</ToggleGroup.Item>
|
|
42
46
|
* <ToggleGroup.Item value='3'>Toggle 3</ToggleGroup.Item>
|
|
43
47
|
* </ToggleGroup>
|
|
44
48
|
*/
|
|
45
|
-
export declare const ToggleGroup: import("react").ForwardRefExoticComponent<Omit<DefaultProps & Omit<HTMLAttributes<
|
|
49
|
+
export declare const ToggleGroup: import("react").ForwardRefExoticComponent<Omit<DefaultProps & Omit<HTMLAttributes<HTMLFieldSetElement>, "value" | "onChange">, "defaultValue" | "name" | "value" | "onChange" | "variant" | "data-toggle-group"> & {
|
|
46
50
|
/**
|
|
47
51
|
* Specify which variant to use
|
|
48
52
|
* @default 'primary'
|
|
@@ -64,5 +68,9 @@ export declare const ToggleGroup: import("react").ForwardRefExoticComponent<Omit
|
|
|
64
68
|
* Form element name
|
|
65
69
|
*/
|
|
66
70
|
name?: string;
|
|
67
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Toggle group label for accessibility
|
|
73
|
+
*/
|
|
74
|
+
'data-toggle-group'?: string;
|
|
75
|
+
} & import("react").RefAttributes<HTMLFieldSetElement>>;
|
|
68
76
|
//# sourceMappingURL=toggle-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-group/toggle-group.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-group/toggle-group.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,kBAAkB,kDAA6C,CAAC;AAE7E,MAAM,MAAM,gBAAgB,GAAG,UAAU,CACvC,YAAY,GACV,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,EACjE;IACE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CACF,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW;IAtCpB;;;OAGG;cACO,SAAS,GAAG,WAAW;IACjC;;OAEG;YACK,MAAM;IACd;;OAEG;mBACY,MAAM;IACrB;;OAEG;eACQ,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;IAClC;;OAEG;WACI,MAAM;IACb;;OAEG;0BACmB,MAAM;uDAiE/B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import '@digdir/designsystemet-web';
|
|
1
2
|
import type { HTMLAttributes, ReactElement, RefAttributes } from 'react';
|
|
2
|
-
import type { DefaultProps } from '../../types';
|
|
3
|
+
import type { DefaultProps, Placement } from '../../types';
|
|
3
4
|
import type { MergeRight } from '../../utilities';
|
|
4
5
|
export type TooltipProps = MergeRight<Omit<DefaultProps, 'data-color'> & HTMLAttributes<HTMLDivElement>, {
|
|
5
6
|
/**
|
|
@@ -17,7 +18,7 @@ export type TooltipProps = MergeRight<Omit<DefaultProps, 'data-color'> & HTMLAtt
|
|
|
17
18
|
* Placement of the tooltip on the trigger.
|
|
18
19
|
* @default 'top'
|
|
19
20
|
*/
|
|
20
|
-
placement?:
|
|
21
|
+
placement?: Placement;
|
|
21
22
|
/**
|
|
22
23
|
* Whether to enable auto placement.
|
|
23
24
|
* @default true
|
|
@@ -26,6 +27,9 @@ export type TooltipProps = MergeRight<Omit<DefaultProps, 'data-color'> & HTMLAtt
|
|
|
26
27
|
/**
|
|
27
28
|
* Whether the tooltip is open or not.
|
|
28
29
|
* This overrides the internal state of the tooltip.
|
|
30
|
+
*
|
|
31
|
+
* @deprecated This should not be used on Tooltip. Use a Popover instead
|
|
32
|
+
* @TODO Look at this prop
|
|
29
33
|
*/
|
|
30
34
|
open?: boolean;
|
|
31
35
|
/**
|
|
@@ -63,7 +67,7 @@ export declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<Omi
|
|
|
63
67
|
* Placement of the tooltip on the trigger.
|
|
64
68
|
* @default 'top'
|
|
65
69
|
*/
|
|
66
|
-
placement?:
|
|
70
|
+
placement?: Placement;
|
|
67
71
|
/**
|
|
68
72
|
* Whether to enable auto placement.
|
|
69
73
|
* @default true
|
|
@@ -72,6 +76,9 @@ export declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<Omi
|
|
|
72
76
|
/**
|
|
73
77
|
* Whether the tooltip is open or not.
|
|
74
78
|
* This overrides the internal state of the tooltip.
|
|
79
|
+
*
|
|
80
|
+
* @deprecated This should not be used on Tooltip. Use a Popover instead
|
|
81
|
+
* @TODO Look at this prop
|
|
75
82
|
*/
|
|
76
83
|
open?: boolean;
|
|
77
84
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,UAAU,CACnC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,cAAc,CAAC,cAAc,CAAC,EACjE;IACE;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC;IAC/D;;QAEI;IACJ,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC;CACrC,CACF,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO;IAlDhB;;;;;OAKG;cACO,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,GAAG,MAAM;IAC9D;;QAEI;aACK,MAAM;IACf;;;OAGG;gBACS,SAAS;IACrB;;;OAGG;oBACa,OAAO;IACvB;;;;;;OAMG;WACI,OAAO;IACd;;;OAGG;WACI,aAAa,GAAG,YAAY;kCAsCtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-message.d.ts","sourceRoot":"","sources":["../../../src/components/validation-message/validation-message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAC7C,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,cAAc,CAAC,oBAAoB,CAAC,EACvE;IACE;;;OAGG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;IAnB1B;;;OAGG;mBACY,cAAc;IAC7B;;;OAGG;cACO,OAAO;
|
|
1
|
+
{"version":3,"file":"validation-message.d.ts","sourceRoot":"","sources":["../../../src/components/validation-message/validation-message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAC7C,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,cAAc,CAAC,oBAAoB,CAAC,EACvE;IACE;;;OAGG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;IAnB1B;;;OAGG;mBACY,cAAc;IAC7B;;;OAGG;cACO,OAAO;wDAyBnB,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Size } from '@digdir/designsystemet-types';
|
|
2
|
+
import type { Placement as FloatingUIPlacement } from '@floating-ui/dom';
|
|
2
3
|
import type { ReactNode } from 'react';
|
|
3
4
|
import type { Color } from './colors';
|
|
5
|
+
export type Placement = FloatingUIPlacement | 'none';
|
|
4
6
|
export type DefaultProps = {
|
|
5
7
|
/**
|
|
6
8
|
* Changes size for descendant Designsystemet components. Select from predefined sizes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GACrB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAClE;IAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACrE;IAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG,mBAAmB,GAAG,MAAM,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GACrB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAClE;IAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACrE;IAAE,YAAY,CAAC,EAAE,KAAK,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC"}
|
|
@@ -54,7 +54,7 @@ export type UsePaginationProps = {
|
|
|
54
54
|
* </Pagination.Item>
|
|
55
55
|
* </Pagination>
|
|
56
56
|
**/
|
|
57
|
-
export declare const usePagination: ({ currentPage, setCurrentPage, onChange, totalPages, showPages, }: UsePaginationProps) => {
|
|
57
|
+
export declare const usePagination: ({ currentPage: current, setCurrentPage, onChange, totalPages: total, showPages: show, }: UsePaginationProps) => {
|
|
58
58
|
/** Number of steps */
|
|
59
59
|
pages: {
|
|
60
60
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["../../../../src/utilities/hooks/use-pagination/use-pagination.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["../../../../src/utilities/hooks/use-pagination/use-pagination.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4BI;AACJ,eAAO,MAAM,aAAa,GAAI,yFAM3B,kBAAkB;IAUf,sBAAsB;;QAEpB;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;qBAMU,qBAAqB,GAAG,IAAI;;IAE3C,8EAA8E;qBAKzE,qBAAqB;IAC1B,0EAA0E;qBAKrE,qBAAqB;IAC1B,gEAAgE;;IAEhE,4DAA4D;;CAGtC,CAAC"}
|
|
@@ -4,4 +4,10 @@ export { getNextFocusableValue, getPrevFocusableValue, RovingFocusItem, } from '
|
|
|
4
4
|
export { RovingFocusRoot } from './roving-focus/roving-focus-root';
|
|
5
5
|
export { useRovingFocus } from './roving-focus/use-roving-focus';
|
|
6
6
|
export type { MergeRight } from './types';
|
|
7
|
+
declare global {
|
|
8
|
+
interface Window {
|
|
9
|
+
dsWarnings?: boolean;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export declare const warn: (message: string, ...args: Parameters<typeof console.warn>) => true | void;
|
|
7
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,aAAa,EACb,wBAAwB,GACzB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,aAAa,EACb,wBAAwB,GACzB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB;CACF;AACD,eAAO,MAAM,IAAI,GACf,SAAS,MAAM,EACf,GAAG,MAAM,UAAU,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,gBAIW,CAAC"}
|
|
@@ -4,6 +4,7 @@ import type { RovingFocusElement } from './roving-focus-root';
|
|
|
4
4
|
export declare function getNextFocusableValue(items: RovingFocusElement[], value: string): RovingFocusElement | undefined;
|
|
5
5
|
/** Get the previous focusable RovingFocusItem */
|
|
6
6
|
export declare function getPrevFocusableValue(items: RovingFocusElement[], value: string): RovingFocusElement | undefined;
|
|
7
|
+
/** @deprecated RovingFocusItem is deprecated.*/
|
|
7
8
|
export declare const RovingFocusItem: import("react").ForwardRefExoticComponent<{
|
|
8
9
|
/** The value of the `RovingFocusItem` used to determine which item should have focus. */
|
|
9
10
|
value?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roving-focus-item.d.ts","sourceRoot":"","sources":["../../../src/utilities/roving-focus/roving-focus-item.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAa9D,6CAA6C;AAC7C,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,kBAAkB,EAAE,EAC3B,KAAK,EAAE,MAAM,GACZ,kBAAkB,GAAG,SAAS,CAGhC;AAED,iDAAiD;AACjD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,kBAAkB,EAAE,EAC3B,KAAK,EAAE,MAAM,GACZ,kBAAkB,GAAG,SAAS,CAGhC;AAED,eAAO,MAAM,eAAe;
|
|
1
|
+
{"version":3,"file":"roving-focus-item.d.ts","sourceRoot":"","sources":["../../../src/utilities/roving-focus/roving-focus-item.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAa9D,6CAA6C;AAC7C,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,kBAAkB,EAAE,EAC3B,KAAK,EAAE,MAAM,GACZ,kBAAkB,GAAG,SAAS,CAGhC;AAED,iDAAiD;AACjD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,kBAAkB,EAAE,EAC3B,KAAK,EAAE,MAAM,GACZ,kBAAkB,GAAG,SAAS,CAGhC;AAED,gDAAgD;AAChD,eAAO,MAAM,eAAe;IA5B1B,yFAAyF;YACjF,MAAM;IACd;;;OAGG;cACO,OAAO;6EAyFlB,CAAC"}
|
|
@@ -12,6 +12,7 @@ export type RovingFocusProps = {
|
|
|
12
12
|
orientation: 'vertical' | 'horizontal' | 'ambiguous';
|
|
13
13
|
};
|
|
14
14
|
export declare const RovingFocusContext: import("react").Context<RovingFocusProps>;
|
|
15
|
+
/** @deprecated RovingFocusRoot is deprecated. */
|
|
15
16
|
export declare const RovingFocusRoot: import("react").ForwardRefExoticComponent<{
|
|
16
17
|
/** The children of the `RovingFocusRoot`. The children should get their roving-relevant props from the `useRovingFocus` hook. */
|
|
17
18
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roving-focus-root.d.ts","sourceRoot":"","sources":["../../../src/utilities/roving-focus/roving-focus-root.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,cAAc,EACd,gBAAgB,EAChB,SAAS,EACV,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"roving-focus-root.d.ts","sourceRoot":"","sources":["../../../src/utilities/roving-focus/roving-focus-root.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,cAAc,EACd,gBAAgB,EAChB,SAAS,EACV,MAAM,OAAO,CAAC;AAwBf,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IACrD,eAAe,EAAE,MAAM,kBAAkB,EAAE,CAAC;IAC5C,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,EAAE,UAAU,GAAG,YAAY,GAAG,WAAW,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,kBAAkB,2CAW7B,CAAC;AAEH,iDAAiD;AACjD,eAAO,MAAM,eAAe;IA9C1B,iIAAiI;cACvH,SAAS;IACnB,iGAAiG;kBACnF,MAAM;IACpB;;;OAGG;cACO,OAAO;IACjB;;;;;OAKG;kBACW,UAAU,GAAG,YAAY,GAAG,WAAW;6EAwHtD,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
@deprecated useRovingFocus is deprecated.
|
|
4
|
+
Handles props for `RovingFocus` in context with `RovingFocusRoot` */
|
|
3
5
|
export declare const useRovingFocus: (value: string) => {
|
|
4
6
|
getOrderedItems: () => import("./roving-focus-root").RovingFocusElement[];
|
|
5
7
|
isFocusable: boolean;
|
|
@@ -140,18 +142,18 @@ export declare const useRovingFocus: (value: string) => {
|
|
|
140
142
|
onFocusCapture?: import("react").FocusEventHandler<T> | undefined;
|
|
141
143
|
onBlur?: import("react").FocusEventHandler<T> | undefined;
|
|
142
144
|
onBlurCapture?: import("react").FocusEventHandler<T> | undefined;
|
|
143
|
-
onChange?: import("react").
|
|
144
|
-
onChangeCapture?: import("react").
|
|
145
|
+
onChange?: import("react").ChangeEventHandler<T, Element> | undefined;
|
|
146
|
+
onChangeCapture?: import("react").ChangeEventHandler<T, Element> | undefined;
|
|
145
147
|
onBeforeInput?: import("react").InputEventHandler<T> | undefined;
|
|
146
|
-
onBeforeInputCapture?: import("react").
|
|
147
|
-
onInput?: import("react").
|
|
148
|
-
onInputCapture?: import("react").
|
|
149
|
-
onReset?: import("react").
|
|
150
|
-
onResetCapture?: import("react").
|
|
151
|
-
onSubmit?: import("react").
|
|
152
|
-
onSubmitCapture?: import("react").
|
|
153
|
-
onInvalid?: import("react").
|
|
154
|
-
onInvalidCapture?: import("react").
|
|
148
|
+
onBeforeInputCapture?: import("react").InputEventHandler<T> | undefined;
|
|
149
|
+
onInput?: import("react").InputEventHandler<T> | undefined;
|
|
150
|
+
onInputCapture?: import("react").InputEventHandler<T> | undefined;
|
|
151
|
+
onReset?: import("react").ReactEventHandler<T> | undefined;
|
|
152
|
+
onResetCapture?: import("react").ReactEventHandler<T> | undefined;
|
|
153
|
+
onSubmit?: import("react").SubmitEventHandler<T> | undefined;
|
|
154
|
+
onSubmitCapture?: import("react").SubmitEventHandler<T> | undefined;
|
|
155
|
+
onInvalid?: import("react").ReactEventHandler<T> | undefined;
|
|
156
|
+
onInvalidCapture?: import("react").ReactEventHandler<T> | undefined;
|
|
155
157
|
onLoad?: import("react").ReactEventHandler<T> | undefined;
|
|
156
158
|
onLoadCapture?: import("react").ReactEventHandler<T> | undefined;
|
|
157
159
|
onError?: import("react").ReactEventHandler<T> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-roving-focus.d.ts","sourceRoot":"","sources":["../../../src/utilities/roving-focus/use-roving-focus.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C
|
|
1
|
+
{"version":3,"file":"use-roving-focus.d.ts","sourceRoot":"","sources":["../../../src/utilities/roving-focus/use-roving-focus.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C;;oEAEoE;AACpE,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM;;;;qBAcvB,CAAC,SAAS,WAAW,SAAS,cAAc,CAAC,CAAC,CAAC;uBAE/C,WAAW,GAAG,IAAI;uBAOlB,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;qBAOxB,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digdir/designsystemet-react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.12.0",
|
|
5
5
|
"description": "React components for Designsystemet",
|
|
6
6
|
"author": "Designsystemet team",
|
|
7
7
|
"repository": {
|
|
@@ -35,38 +35,35 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@floating-ui/dom": "^1.7.
|
|
38
|
+
"@floating-ui/dom": "^1.7.5",
|
|
39
39
|
"@floating-ui/react": "0.26.23",
|
|
40
|
-
"@navikt/aksel-icons": "^
|
|
40
|
+
"@navikt/aksel-icons": "^8.4.1",
|
|
41
41
|
"@radix-ui/react-slot": "^1.2.4",
|
|
42
42
|
"@tanstack/react-virtual": "^3.13.18",
|
|
43
|
-
"@u-elements/u-combobox": "^1.0.5",
|
|
44
|
-
"@u-elements/u-datalist": "^1.0.14",
|
|
45
|
-
"@u-elements/u-details": "^0.1.5",
|
|
46
43
|
"clsx": "^2.1.1",
|
|
47
|
-
"@digdir/designsystemet-types": "^1.
|
|
44
|
+
"@digdir/designsystemet-types": "^1.12.0",
|
|
45
|
+
"@digdir/designsystemet-web": "^1.12.0"
|
|
48
46
|
},
|
|
49
47
|
"devDependencies": {
|
|
50
48
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
51
49
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
52
|
-
"@storybook/addon-docs": "^10.
|
|
53
|
-
"@storybook/addon-vitest": "^10.
|
|
54
|
-
"@storybook/react-vite": "^10.
|
|
50
|
+
"@storybook/addon-docs": "^10.2.8",
|
|
51
|
+
"@storybook/addon-vitest": "^10.2.8",
|
|
52
|
+
"@storybook/react-vite": "^10.2.8",
|
|
55
53
|
"@testing-library/jest-dom": "^6.9.1",
|
|
56
|
-
"@testing-library/react": "^16.3.
|
|
54
|
+
"@testing-library/react": "^16.3.2",
|
|
57
55
|
"@testing-library/user-event": "^14.6.1",
|
|
58
|
-
"@types/react": "^19.2.
|
|
56
|
+
"@types/react": "^19.2.14",
|
|
59
57
|
"@types/react-dom": "^19.2.3",
|
|
60
|
-
"react": "^19.2.
|
|
61
|
-
"react-dom": "^19.2.
|
|
62
|
-
"rimraf": "^6.1.
|
|
63
|
-
"rollup": "^4.
|
|
58
|
+
"react": "^19.2.4",
|
|
59
|
+
"react-dom": "^19.2.4",
|
|
60
|
+
"rimraf": "^6.1.3",
|
|
61
|
+
"rollup": "^4.57.1",
|
|
64
62
|
"rollup-plugin-copy": "^3.5.0",
|
|
65
|
-
"storybook": "^10.
|
|
63
|
+
"storybook": "^10.2.8",
|
|
66
64
|
"tsx": "4.21.0",
|
|
67
65
|
"typescript": "^5.9.3",
|
|
68
|
-
"@digdir/designsystemet": "^1.
|
|
69
|
-
"@digdir/designsystemet-css": "^1.11.0"
|
|
66
|
+
"@digdir/designsystemet-css": "^1.12.0"
|
|
70
67
|
},
|
|
71
68
|
"scripts": {
|
|
72
69
|
"build": "pnpm run clean && tsc -b tsconfig.lib.json --emitDeclarationOnly false && rollup -c --bundleConfigAsCjs",
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
function fieldObserver(fieldElement) {
|
|
5
|
-
if (!fieldElement)
|
|
6
|
-
return;
|
|
7
|
-
const elements = new Map();
|
|
8
|
-
const typeCounter = new Map(); // Track count for each data-field type
|
|
9
|
-
const uuid = `:${Date.now().toString(36)}${Math.random().toString(36).slice(2, 5)}`;
|
|
10
|
-
let input = null;
|
|
11
|
-
let describedby = '';
|
|
12
|
-
const process = (mutations) => {
|
|
13
|
-
const changed = [];
|
|
14
|
-
const removed = [];
|
|
15
|
-
// Merge MutationRecords
|
|
16
|
-
for (const mutation of mutations) {
|
|
17
|
-
if (mutation.attributeName)
|
|
18
|
-
changed.push(mutation.target ?? fieldElement);
|
|
19
|
-
changed.push(...(mutation.addedNodes || []));
|
|
20
|
-
removed.push(...(mutation.removedNodes || []));
|
|
21
|
-
}
|
|
22
|
-
// Register elements
|
|
23
|
-
for (const el of changed) {
|
|
24
|
-
if (!isElement(el))
|
|
25
|
-
continue;
|
|
26
|
-
if (isLabel(el))
|
|
27
|
-
elements.set(el, el.htmlFor);
|
|
28
|
-
else if (el.hasAttribute('data-field'))
|
|
29
|
-
elements.set(el, el.id);
|
|
30
|
-
else if (isInputLike(el) && !el.hidden) {
|
|
31
|
-
input = el;
|
|
32
|
-
describedby = el.getAttribute('aria-describedby') || '';
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// Reset removed elements
|
|
36
|
-
for (const el of removed) {
|
|
37
|
-
if (!isElement(el))
|
|
38
|
-
continue;
|
|
39
|
-
if (input === el)
|
|
40
|
-
input = null;
|
|
41
|
-
if (elements.has(el)) {
|
|
42
|
-
setAttr(el, isLabel(el) ? 'for' : 'id', elements.get(el));
|
|
43
|
-
elements.delete(el);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// Connect elements
|
|
47
|
-
const describedbyIds = describedby ? describedby.split(' ') : []; // Keep original aria-describedby
|
|
48
|
-
const inputId = input?.id || uuid;
|
|
49
|
-
// Reset type counters since we reprocess all elements
|
|
50
|
-
typeCounter.clear();
|
|
51
|
-
for (const [el, value] of elements) {
|
|
52
|
-
const descriptionType = el.getAttribute('data-field');
|
|
53
|
-
let id;
|
|
54
|
-
if (descriptionType) {
|
|
55
|
-
// Increment type counter for this type
|
|
56
|
-
const count = (typeCounter.get(descriptionType) || 0) + 1;
|
|
57
|
-
typeCounter.set(descriptionType, count);
|
|
58
|
-
id = `${inputId}:${descriptionType}:${count}`;
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
id = inputId;
|
|
62
|
-
}
|
|
63
|
-
if (!value)
|
|
64
|
-
setAttr(el, isLabel(el) ? 'for' : 'id', id); // Ensure we have a value
|
|
65
|
-
if (!describedbyIds.includes(el.id)) {
|
|
66
|
-
if (descriptionType === 'validation')
|
|
67
|
-
describedbyIds.unshift(el.id); // Validations to the front
|
|
68
|
-
else if (descriptionType)
|
|
69
|
-
describedbyIds.push(el.id); // Other descriptions to the back
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
setAttr(input, 'id', inputId);
|
|
73
|
-
setAttr(input, 'aria-describedby', describedbyIds.join(' ').trim());
|
|
74
|
-
};
|
|
75
|
-
const observer = createOptimizedMutationObserver(process);
|
|
76
|
-
observer.observe(fieldElement, {
|
|
77
|
-
attributeFilter: ['id', 'for', 'aria-describedby'],
|
|
78
|
-
attributes: true,
|
|
79
|
-
childList: true,
|
|
80
|
-
subtree: true,
|
|
81
|
-
});
|
|
82
|
-
process([{ addedNodes: fieldElement.querySelectorAll('*') }]); // Initial setup
|
|
83
|
-
observer.takeRecords(); // Clear initial setup queue
|
|
84
|
-
return () => observer.disconnect();
|
|
85
|
-
}
|
|
86
|
-
// Utilities
|
|
87
|
-
const isElement = (node) => node instanceof Element;
|
|
88
|
-
const isLabel = (node) => node instanceof HTMLLabelElement;
|
|
89
|
-
const isInputLike = (node) => node instanceof HTMLElement &&
|
|
90
|
-
'validity' in node &&
|
|
91
|
-
!(node instanceof HTMLButtonElement); // Matches input, textarea, select and form accosiated custom elements
|
|
92
|
-
const setAttr = (el, name, value) => value ? el?.setAttribute(name, value) : el?.removeAttribute(name);
|
|
93
|
-
// Speed up MutationObserver by debouncing, clearing internal queue after changes and only running when page is visible
|
|
94
|
-
function createOptimizedMutationObserver(callback) {
|
|
95
|
-
const queue = [];
|
|
96
|
-
const observer = new MutationObserver((mutations) => {
|
|
97
|
-
if (!queue.length)
|
|
98
|
-
requestAnimationFrame(process);
|
|
99
|
-
queue.push(...mutations);
|
|
100
|
-
});
|
|
101
|
-
const process = () => {
|
|
102
|
-
callback(queue, observer);
|
|
103
|
-
queue.length = 0; // Reset queue
|
|
104
|
-
observer.takeRecords(); // Clear queue due to DOM changes in callback
|
|
105
|
-
};
|
|
106
|
-
return observer;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
exports.fieldObserver = fieldObserver;
|
|
110
|
-
exports.isElement = isElement;
|
|
111
|
-
exports.isInputLike = isInputLike;
|
|
112
|
-
exports.isLabel = isLabel;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var react = require('react');
|
|
5
|
-
var toggleGroup = require('./toggle-group.js');
|
|
6
|
-
|
|
7
|
-
/** Handles props for `ToggleGroup.Item` in context with `ToggleGroup` and `RovingFocus` */
|
|
8
|
-
const useToggleGroupItem = (props) => {
|
|
9
|
-
const { ...rest } = props;
|
|
10
|
-
const genValue = react.useId();
|
|
11
|
-
const toggleGroup$1 = react.useContext(toggleGroup.ToggleGroupContext);
|
|
12
|
-
const value = props.value ?? genValue;
|
|
13
|
-
const active = toggleGroup$1.value === value;
|
|
14
|
-
const variant = toggleGroup$1.variant;
|
|
15
|
-
const buttonId = `togglegroup-item-${react.useId()}`;
|
|
16
|
-
return {
|
|
17
|
-
...rest,
|
|
18
|
-
active: active,
|
|
19
|
-
value,
|
|
20
|
-
variant,
|
|
21
|
-
buttonProps: {
|
|
22
|
-
id: buttonId,
|
|
23
|
-
'aria-checked': active,
|
|
24
|
-
'aria-current': active,
|
|
25
|
-
role: 'radio',
|
|
26
|
-
name: toggleGroup$1.name,
|
|
27
|
-
onClick: () => {
|
|
28
|
-
toggleGroup$1.onChange?.(value);
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.useToggleGroupItem = useToggleGroupItem;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
function fieldObserver(fieldElement) {
|
|
3
|
-
if (!fieldElement)
|
|
4
|
-
return;
|
|
5
|
-
const elements = new Map();
|
|
6
|
-
const typeCounter = new Map(); // Track count for each data-field type
|
|
7
|
-
const uuid = `:${Date.now().toString(36)}${Math.random().toString(36).slice(2, 5)}`;
|
|
8
|
-
let input = null;
|
|
9
|
-
let describedby = '';
|
|
10
|
-
const process = (mutations) => {
|
|
11
|
-
const changed = [];
|
|
12
|
-
const removed = [];
|
|
13
|
-
// Merge MutationRecords
|
|
14
|
-
for (const mutation of mutations) {
|
|
15
|
-
if (mutation.attributeName)
|
|
16
|
-
changed.push(mutation.target ?? fieldElement);
|
|
17
|
-
changed.push(...(mutation.addedNodes || []));
|
|
18
|
-
removed.push(...(mutation.removedNodes || []));
|
|
19
|
-
}
|
|
20
|
-
// Register elements
|
|
21
|
-
for (const el of changed) {
|
|
22
|
-
if (!isElement(el))
|
|
23
|
-
continue;
|
|
24
|
-
if (isLabel(el))
|
|
25
|
-
elements.set(el, el.htmlFor);
|
|
26
|
-
else if (el.hasAttribute('data-field'))
|
|
27
|
-
elements.set(el, el.id);
|
|
28
|
-
else if (isInputLike(el) && !el.hidden) {
|
|
29
|
-
input = el;
|
|
30
|
-
describedby = el.getAttribute('aria-describedby') || '';
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
// Reset removed elements
|
|
34
|
-
for (const el of removed) {
|
|
35
|
-
if (!isElement(el))
|
|
36
|
-
continue;
|
|
37
|
-
if (input === el)
|
|
38
|
-
input = null;
|
|
39
|
-
if (elements.has(el)) {
|
|
40
|
-
setAttr(el, isLabel(el) ? 'for' : 'id', elements.get(el));
|
|
41
|
-
elements.delete(el);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// Connect elements
|
|
45
|
-
const describedbyIds = describedby ? describedby.split(' ') : []; // Keep original aria-describedby
|
|
46
|
-
const inputId = input?.id || uuid;
|
|
47
|
-
// Reset type counters since we reprocess all elements
|
|
48
|
-
typeCounter.clear();
|
|
49
|
-
for (const [el, value] of elements) {
|
|
50
|
-
const descriptionType = el.getAttribute('data-field');
|
|
51
|
-
let id;
|
|
52
|
-
if (descriptionType) {
|
|
53
|
-
// Increment type counter for this type
|
|
54
|
-
const count = (typeCounter.get(descriptionType) || 0) + 1;
|
|
55
|
-
typeCounter.set(descriptionType, count);
|
|
56
|
-
id = `${inputId}:${descriptionType}:${count}`;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
id = inputId;
|
|
60
|
-
}
|
|
61
|
-
if (!value)
|
|
62
|
-
setAttr(el, isLabel(el) ? 'for' : 'id', id); // Ensure we have a value
|
|
63
|
-
if (!describedbyIds.includes(el.id)) {
|
|
64
|
-
if (descriptionType === 'validation')
|
|
65
|
-
describedbyIds.unshift(el.id); // Validations to the front
|
|
66
|
-
else if (descriptionType)
|
|
67
|
-
describedbyIds.push(el.id); // Other descriptions to the back
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
setAttr(input, 'id', inputId);
|
|
71
|
-
setAttr(input, 'aria-describedby', describedbyIds.join(' ').trim());
|
|
72
|
-
};
|
|
73
|
-
const observer = createOptimizedMutationObserver(process);
|
|
74
|
-
observer.observe(fieldElement, {
|
|
75
|
-
attributeFilter: ['id', 'for', 'aria-describedby'],
|
|
76
|
-
attributes: true,
|
|
77
|
-
childList: true,
|
|
78
|
-
subtree: true,
|
|
79
|
-
});
|
|
80
|
-
process([{ addedNodes: fieldElement.querySelectorAll('*') }]); // Initial setup
|
|
81
|
-
observer.takeRecords(); // Clear initial setup queue
|
|
82
|
-
return () => observer.disconnect();
|
|
83
|
-
}
|
|
84
|
-
// Utilities
|
|
85
|
-
const isElement = (node) => node instanceof Element;
|
|
86
|
-
const isLabel = (node) => node instanceof HTMLLabelElement;
|
|
87
|
-
const isInputLike = (node) => node instanceof HTMLElement &&
|
|
88
|
-
'validity' in node &&
|
|
89
|
-
!(node instanceof HTMLButtonElement); // Matches input, textarea, select and form accosiated custom elements
|
|
90
|
-
const setAttr = (el, name, value) => value ? el?.setAttribute(name, value) : el?.removeAttribute(name);
|
|
91
|
-
// Speed up MutationObserver by debouncing, clearing internal queue after changes and only running when page is visible
|
|
92
|
-
function createOptimizedMutationObserver(callback) {
|
|
93
|
-
const queue = [];
|
|
94
|
-
const observer = new MutationObserver((mutations) => {
|
|
95
|
-
if (!queue.length)
|
|
96
|
-
requestAnimationFrame(process);
|
|
97
|
-
queue.push(...mutations);
|
|
98
|
-
});
|
|
99
|
-
const process = () => {
|
|
100
|
-
callback(queue, observer);
|
|
101
|
-
queue.length = 0; // Reset queue
|
|
102
|
-
observer.takeRecords(); // Clear queue due to DOM changes in callback
|
|
103
|
-
};
|
|
104
|
-
return observer;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export { fieldObserver, isElement, isInputLike, isLabel };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { useId, useContext } from 'react';
|
|
3
|
-
import { ToggleGroupContext } from './toggle-group.js';
|
|
4
|
-
|
|
5
|
-
/** Handles props for `ToggleGroup.Item` in context with `ToggleGroup` and `RovingFocus` */
|
|
6
|
-
const useToggleGroupItem = (props) => {
|
|
7
|
-
const { ...rest } = props;
|
|
8
|
-
const genValue = useId();
|
|
9
|
-
const toggleGroup = useContext(ToggleGroupContext);
|
|
10
|
-
const value = props.value ?? genValue;
|
|
11
|
-
const active = toggleGroup.value === value;
|
|
12
|
-
const variant = toggleGroup.variant;
|
|
13
|
-
const buttonId = `togglegroup-item-${useId()}`;
|
|
14
|
-
return {
|
|
15
|
-
...rest,
|
|
16
|
-
active: active,
|
|
17
|
-
value,
|
|
18
|
-
variant,
|
|
19
|
-
buttonProps: {
|
|
20
|
-
id: buttonId,
|
|
21
|
-
'aria-checked': active,
|
|
22
|
-
'aria-current': active,
|
|
23
|
-
role: 'radio',
|
|
24
|
-
name: toggleGroup.name,
|
|
25
|
-
onClick: () => {
|
|
26
|
-
toggleGroup.onChange?.(value);
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export { useToggleGroupItem };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function fieldObserver(fieldElement: HTMLElement | null): (() => void) | undefined;
|
|
2
|
-
export declare const isElement: (node: Node) => node is Element;
|
|
3
|
-
export declare const isLabel: (node: Node) => node is HTMLLabelElement;
|
|
4
|
-
export declare const isInputLike: (node: unknown) => node is HTMLInputElement;
|
|
5
|
-
//# sourceMappingURL=field-observer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-observer.d.ts","sourceRoot":"","sources":["../../../src/components/field/field-observer.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,YAAY,EAAE,WAAW,GAAG,IAAI,4BAsF7D;AAGD,eAAO,MAAM,SAAS,GAAI,MAAM,IAAI,oBAA4B,CAAC;AACjE,eAAO,MAAM,OAAO,GAAI,MAAM,IAAI,6BAAqC,CAAC;AACxE,eAAO,MAAM,WAAW,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,gBAGd,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ButtonProps } from '../button/button';
|
|
2
|
-
import type { ToggleGroupItemProps } from './toggle-group-item';
|
|
3
|
-
type UseToggleGroupItem = (props: ToggleGroupItemProps) => {
|
|
4
|
-
active: boolean;
|
|
5
|
-
variant?: 'primary' | 'secondary';
|
|
6
|
-
value: string;
|
|
7
|
-
buttonProps?: Pick<ButtonProps, 'id' | 'onClick' | 'role' | 'aria-checked' | 'aria-current' | 'name'>;
|
|
8
|
-
};
|
|
9
|
-
/** Handles props for `ToggleGroup.Item` in context with `ToggleGroup` and `RovingFocus` */
|
|
10
|
-
export declare const useToggleGroupItem: UseToggleGroupItem;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=use-toggle-groupitem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-toggle-groupitem.d.ts","sourceRoot":"","sources":["../../../src/components/toggle-group/use-toggle-groupitem.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,KAAK,kBAAkB,GAAG,CAAC,KAAK,EAAE,oBAAoB,KAAK;IACzD,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,IAAI,CAChB,WAAW,EACX,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,cAAc,GAAG,cAAc,GAAG,MAAM,CACrE,CAAC;CACH,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,kBAAkB,EAAE,kBA2BhC,CAAC"}
|