@digdir/designsystemet-react 1.7.3 → 1.9.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/README.md +2 -2
- package/dist/cjs/components/dialog/dialog.js +2 -2
- package/dist/cjs/components/popover/popover.js +5 -3
- package/dist/cjs/components/suggestion/suggestion-clear.js +1 -1
- package/dist/esm/components/dialog/dialog.js +2 -2
- package/dist/esm/components/popover/popover.js +5 -3
- package/dist/esm/components/suggestion/suggestion-clear.js +1 -1
- package/dist/react-types.d.ts +1 -1
- package/dist/types/colors.d.ts +1 -1
- package/dist/types/components/Combobox/Combobox.d.ts +2 -2
- package/dist/types/components/Combobox/useFormField/useFormField.d.ts +1 -1
- package/dist/types/components/alert/alert.d.ts +1 -1
- package/dist/types/components/avatar/avatar.d.ts +1 -1
- package/dist/types/components/badge/badge.d.ts +1 -1
- package/dist/types/components/badge/index.d.ts +1 -1
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/dialog/dialog-trigger.d.ts +1 -1
- package/dist/types/components/dialog/dialog.d.ts +17 -5
- package/dist/types/components/dialog/dialog.d.ts.map +1 -1
- package/dist/types/components/field/field-counter.d.ts +1 -1
- package/dist/types/components/popover/popover.d.ts +1 -1
- 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/suggestion/suggestion-clear.d.ts.map +1 -1
- package/dist/types/components/tag/tag.d.ts +1 -1
- package/dist/types/components/validation-message/validation-message.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/types.d.ts +1 -1
- package/dist/types/utilities/roving-focus/use-roving-focus.d.ts +3 -3
- package/package.json +15 -14
package/README.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
React implementation of the Designsystemet components
|
|
4
4
|
|
|
5
5
|
- Uses `@digdir/designsystemet-css` for styling.
|
|
6
|
-
- Uses `@digdir/designsystemet-theme` or CSS file generated from `@digdir/designsystemet tokens build` for theming.
|
|
7
|
-
- Build your own theme on https://theme.designsystemet.no/
|
|
6
|
+
- Uses `@digdir/designsystemet-css/theme` or CSS file generated from `@digdir/designsystemet tokens build` for theming.
|
|
7
|
+
- Build your own theme on https://theme.designsystemet.no/en
|
|
8
8
|
- All components support `ref`.
|
|
9
9
|
- All components support SSR.
|
|
10
10
|
- Use full component name, e.g. `CardBlock` instead of `Card.Block`
|
|
@@ -32,7 +32,7 @@ var useMergeRefs = require('../../utilities/hooks/use-merge-refs/use-merge-refs.
|
|
|
32
32
|
* Content
|
|
33
33
|
* </Dialog>
|
|
34
34
|
*/
|
|
35
|
-
const Dialog = react.forwardRef(function Dialog({ asChild, children, className, closeButton = 'Lukk dialogvindu', closedby = 'closerequest', modal = true, onClose, open, ...rest }, ref) {
|
|
35
|
+
const Dialog = react.forwardRef(function Dialog({ asChild, children, className, placement = 'center', closeButton = 'Lukk dialogvindu', closedby = 'closerequest', modal = true, onClose, open, ...rest }, ref) {
|
|
36
36
|
const contextRef = react.useContext(dialogTriggerContext.Context);
|
|
37
37
|
const dialogRef = react.useRef(null); // This local ref is used to make sure the dialog works without a DialogTriggerContext
|
|
38
38
|
const Component = asChild ? reactSlot.Slot : 'dialog';
|
|
@@ -89,7 +89,7 @@ const Dialog = react.forwardRef(function Dialog({ asChild, children, className,
|
|
|
89
89
|
currentRef?.addEventListener('close', handleClose);
|
|
90
90
|
return () => currentRef?.removeEventListener('close', handleClose);
|
|
91
91
|
}, [onClose]);
|
|
92
|
-
return (jsxRuntime.jsxs(Component, { className: cl('ds-dialog', className), ref: mergedRefs, "data-modal": modal, closedby: closedby, ...rest, children: [closeButton !== false && (jsxRuntime.jsx(button.Button, { "aria-label": closeButton, "data-color": 'neutral', icon: true, variant: 'tertiary', "data-command": 'close' })), children] }));
|
|
92
|
+
return (jsxRuntime.jsxs(Component, { className: cl('ds-dialog', className), ref: mergedRefs, "data-placement": placement, "data-modal": modal, closedby: closedby, ...rest, children: [closeButton !== false && (jsxRuntime.jsx(button.Button, { "aria-label": closeButton, "data-color": 'neutral', icon: true, variant: 'tertiary', "data-command": 'close' })), children] }));
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
exports.Dialog = Dialog;
|
|
@@ -42,13 +42,15 @@ const Popover = react.forwardRef(function Popover({ id, className, onClose, onOp
|
|
|
42
42
|
const isOutside = !isTrigger && !popover?.contains(el);
|
|
43
43
|
if (isTrigger) {
|
|
44
44
|
event.preventDefault(); // Prevent native Popover API
|
|
45
|
-
setInternalOpen((open) => !open);
|
|
46
|
-
onOpen?.();
|
|
47
45
|
}
|
|
48
|
-
if (
|
|
46
|
+
if (controlledOpen && (isTrigger || isOutside)) {
|
|
49
47
|
setInternalOpen(false);
|
|
50
48
|
onClose?.();
|
|
51
49
|
}
|
|
50
|
+
else if (!controlledOpen && isTrigger) {
|
|
51
|
+
setInternalOpen(true);
|
|
52
|
+
onOpen?.();
|
|
53
|
+
}
|
|
52
54
|
};
|
|
53
55
|
const handleKeydown = (event) => {
|
|
54
56
|
if (event.key !== 'Escape' || !controlledOpen)
|
|
@@ -17,7 +17,7 @@ var button = require('../button/button.js');
|
|
|
17
17
|
* <Suggestion.List />
|
|
18
18
|
* </Suggestion>
|
|
19
19
|
*/
|
|
20
|
-
const SuggestionClear = react.forwardRef(function SuggestionClear({ 'aria-label': label = 'Tøm',
|
|
20
|
+
const SuggestionClear = react.forwardRef(function SuggestionClear({ 'aria-label': label = 'Tøm', ...rest }, ref) {
|
|
21
21
|
return (jsxRuntime.jsx(button.Button, { "aria-label": label, asChild: true, icon: true, hidden: true, ref: ref, variant: 'tertiary', ...rest, children: jsxRuntime.jsx("del", {}) }));
|
|
22
22
|
});
|
|
23
23
|
|
|
@@ -30,7 +30,7 @@ import { useMergeRefs } from '../../utilities/hooks/use-merge-refs/use-merge-ref
|
|
|
30
30
|
* Content
|
|
31
31
|
* </Dialog>
|
|
32
32
|
*/
|
|
33
|
-
const Dialog = forwardRef(function Dialog({ asChild, children, className, closeButton = 'Lukk dialogvindu', closedby = 'closerequest', modal = true, onClose, open, ...rest }, ref) {
|
|
33
|
+
const Dialog = forwardRef(function Dialog({ asChild, children, className, placement = 'center', closeButton = 'Lukk dialogvindu', closedby = 'closerequest', modal = true, onClose, open, ...rest }, ref) {
|
|
34
34
|
const contextRef = useContext(Context);
|
|
35
35
|
const dialogRef = useRef(null); // This local ref is used to make sure the dialog works without a DialogTriggerContext
|
|
36
36
|
const Component = asChild ? Slot : 'dialog';
|
|
@@ -87,7 +87,7 @@ const Dialog = forwardRef(function Dialog({ asChild, children, className, closeB
|
|
|
87
87
|
currentRef?.addEventListener('close', handleClose);
|
|
88
88
|
return () => currentRef?.removeEventListener('close', handleClose);
|
|
89
89
|
}, [onClose]);
|
|
90
|
-
return (jsxs(Component, { className: cl('ds-dialog', className), ref: mergedRefs, "data-modal": modal, closedby: closedby, ...rest, children: [closeButton !== false && (jsx(Button, { "aria-label": closeButton, "data-color": 'neutral', icon: true, variant: 'tertiary', "data-command": 'close' })), children] }));
|
|
90
|
+
return (jsxs(Component, { className: cl('ds-dialog', className), ref: mergedRefs, "data-placement": placement, "data-modal": modal, closedby: closedby, ...rest, children: [closeButton !== false && (jsx(Button, { "aria-label": closeButton, "data-color": 'neutral', icon: true, variant: 'tertiary', "data-command": 'close' })), children] }));
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
export { Dialog };
|
|
@@ -40,13 +40,15 @@ const Popover = forwardRef(function Popover({ id, className, onClose, onOpen, op
|
|
|
40
40
|
const isOutside = !isTrigger && !popover?.contains(el);
|
|
41
41
|
if (isTrigger) {
|
|
42
42
|
event.preventDefault(); // Prevent native Popover API
|
|
43
|
-
setInternalOpen((open) => !open);
|
|
44
|
-
onOpen?.();
|
|
45
43
|
}
|
|
46
|
-
if (
|
|
44
|
+
if (controlledOpen && (isTrigger || isOutside)) {
|
|
47
45
|
setInternalOpen(false);
|
|
48
46
|
onClose?.();
|
|
49
47
|
}
|
|
48
|
+
else if (!controlledOpen && isTrigger) {
|
|
49
|
+
setInternalOpen(true);
|
|
50
|
+
onOpen?.();
|
|
51
|
+
}
|
|
50
52
|
};
|
|
51
53
|
const handleKeydown = (event) => {
|
|
52
54
|
if (event.key !== 'Escape' || !controlledOpen)
|
|
@@ -15,7 +15,7 @@ import { Button } from '../button/button.js';
|
|
|
15
15
|
* <Suggestion.List />
|
|
16
16
|
* </Suggestion>
|
|
17
17
|
*/
|
|
18
|
-
const SuggestionClear = forwardRef(function SuggestionClear({ 'aria-label': label = 'Tøm',
|
|
18
|
+
const SuggestionClear = forwardRef(function SuggestionClear({ 'aria-label': label = 'Tøm', ...rest }, ref) {
|
|
19
19
|
return (jsx(Button, { "aria-label": label, asChild: true, icon: true, hidden: true, ref: ref, variant: 'tertiary', ...rest, children: jsx("del", {}) }));
|
|
20
20
|
});
|
|
21
21
|
|
package/dist/react-types.d.ts
CHANGED
package/dist/types/colors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { Color, SeverityColors, } from '@digdir/designsystemet
|
|
1
|
+
export type { Color, SeverityColors, } from '@digdir/designsystemet-types';
|
|
2
2
|
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -206,7 +206,7 @@ export declare const ComboboxComponent: import("react").ForwardRefExoticComponen
|
|
|
206
206
|
description?: ReactNode;
|
|
207
207
|
id?: string;
|
|
208
208
|
readOnly?: boolean;
|
|
209
|
-
size?: import("packages/
|
|
209
|
+
size?: import("packages/types/dist/types").Size;
|
|
210
210
|
} & Pick<import("react").HTMLAttributes<HTMLElement>, "aria-describedby"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
211
211
|
export declare const Combobox: import("react").ForwardRefExoticComponent<{
|
|
212
212
|
/**
|
|
@@ -312,6 +312,6 @@ export declare const Combobox: import("react").ForwardRefExoticComponent<{
|
|
|
312
312
|
description?: ReactNode;
|
|
313
313
|
id?: string;
|
|
314
314
|
readOnly?: boolean;
|
|
315
|
-
size?: import("packages/
|
|
315
|
+
size?: import("packages/types/dist/types").Size;
|
|
316
316
|
} & Pick<import("react").HTMLAttributes<HTMLElement>, "aria-describedby"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
317
317
|
//# sourceMappingURL=Combobox.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SeverityColors } from '@digdir/designsystemet
|
|
1
|
+
import type { SeverityColors } from '@digdir/designsystemet-types';
|
|
2
2
|
import type { HTMLAttributes } from 'react';
|
|
3
3
|
import type { DefaultProps } from '../../types';
|
|
4
4
|
import type { MergeRight } from '../../utilities';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Size } from '@digdir/designsystemet
|
|
1
|
+
import type { Size } from '@digdir/designsystemet-types';
|
|
2
2
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
import type { DefaultProps } from '../../types';
|
|
4
4
|
import type { MergeRight } from '../../utilities';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Color, SeverityColors } from '@digdir/designsystemet
|
|
1
|
+
import type { Color, SeverityColors } from '@digdir/designsystemet-types';
|
|
2
2
|
import { type HTMLAttributes } from 'react';
|
|
3
3
|
import type { DefaultProps } from '../../types';
|
|
4
4
|
import type { MergeRight } from '../../utilities';
|
|
@@ -9,7 +9,7 @@ declare const Badge: import("react").ForwardRefExoticComponent<Omit<import("../.
|
|
|
9
9
|
count?: number;
|
|
10
10
|
maxCount?: number;
|
|
11
11
|
variant?: "base" | "tinted";
|
|
12
|
-
'data-color'?: import("packages/
|
|
12
|
+
'data-color'?: import("packages/types/dist/types").Color | import("packages/types/dist/types").SeverityColors;
|
|
13
13
|
children?: never;
|
|
14
14
|
} & import("react").RefAttributes<HTMLSpanElement>> & {
|
|
15
15
|
Position: import("react").ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & import("react").HTMLAttributes<HTMLSpanElement>, "placement" | "overlap"> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Color, SeverityColors } from '@digdir/designsystemet
|
|
1
|
+
import type { Color, SeverityColors } from '@digdir/designsystemet-types';
|
|
2
2
|
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
import type { DefaultProps } from '../../types';
|
|
4
4
|
import type { MergeRight } from '../../utilities';
|
|
@@ -14,7 +14,7 @@ export type DialogTriggerProps = ComponentPropsWithRef<typeof Button>;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const DialogTrigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("../../types").DefaultProps & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "type" | "data-color" | "variant" | "icon" | "loading" | "asChild"> & {
|
|
16
16
|
variant?: "primary" | "secondary" | "tertiary";
|
|
17
|
-
'data-color'?: import("packages/
|
|
17
|
+
'data-color'?: import("packages/types/dist/types").Color | Extract<import("packages/types/dist/types").SeverityColors, "danger">;
|
|
18
18
|
icon?: boolean;
|
|
19
19
|
loading?: boolean | import("react").ReactNode;
|
|
20
20
|
asChild?: boolean;
|
|
@@ -10,15 +10,21 @@ export type DialogProps = MergeRight<DefaultProps & DialogHTMLAttributes<HTMLDia
|
|
|
10
10
|
/**
|
|
11
11
|
* Light dismiss behavior, allowing to close on backdrop click by setting `closedby="any"`.
|
|
12
12
|
*
|
|
13
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy
|
|
13
|
+
* @see [mdn closedBy](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy)
|
|
14
14
|
*
|
|
15
15
|
* @default 'closerequest'
|
|
16
16
|
*/
|
|
17
17
|
closedby?: 'none' | 'closerequest' | 'any';
|
|
18
|
+
/**
|
|
19
|
+
* When not center, displays dialog as a "drawer" from the specified side.
|
|
20
|
+
*
|
|
21
|
+
* @default 'center'
|
|
22
|
+
*/
|
|
23
|
+
placement?: 'center' | 'left' | 'right' | 'top' | 'bottom';
|
|
18
24
|
/**
|
|
19
25
|
* Toogle modal and non-modal dialog.
|
|
20
26
|
*
|
|
21
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog#creating_a_modal_dialog
|
|
27
|
+
* @see [mdn modal dialog](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog#creating_a_modal_dialog)
|
|
22
28
|
*
|
|
23
29
|
* @default true
|
|
24
30
|
*/
|
|
@@ -62,7 +68,7 @@ export type DialogProps = MergeRight<DefaultProps & DialogHTMLAttributes<HTMLDia
|
|
|
62
68
|
* Content
|
|
63
69
|
* </Dialog>
|
|
64
70
|
*/
|
|
65
|
-
export declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DefaultProps & DialogHTMLAttributes<HTMLDialogElement>, "asChild" | "open" | "closedby" | "onClose" | "closeButton" | "modal"> & {
|
|
71
|
+
export declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DefaultProps & DialogHTMLAttributes<HTMLDialogElement>, "asChild" | "open" | "placement" | "closedby" | "onClose" | "closeButton" | "modal"> & {
|
|
66
72
|
/**
|
|
67
73
|
* Screen reader label of close button. Set false to hide the close button.
|
|
68
74
|
* @default 'Lukk dialogvindu'
|
|
@@ -71,15 +77,21 @@ export declare const Dialog: import("react").ForwardRefExoticComponent<Omit<Defa
|
|
|
71
77
|
/**
|
|
72
78
|
* Light dismiss behavior, allowing to close on backdrop click by setting `closedby="any"`.
|
|
73
79
|
*
|
|
74
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy
|
|
80
|
+
* @see [mdn closedBy](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy)
|
|
75
81
|
*
|
|
76
82
|
* @default 'closerequest'
|
|
77
83
|
*/
|
|
78
84
|
closedby?: "none" | "closerequest" | "any";
|
|
85
|
+
/**
|
|
86
|
+
* When not center, displays dialog as a "drawer" from the specified side.
|
|
87
|
+
*
|
|
88
|
+
* @default 'center'
|
|
89
|
+
*/
|
|
90
|
+
placement?: "center" | "left" | "right" | "top" | "bottom";
|
|
79
91
|
/**
|
|
80
92
|
* Toogle modal and non-modal dialog.
|
|
81
93
|
*
|
|
82
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog#creating_a_modal_dialog
|
|
94
|
+
* @see [mdn modal dialog](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog#creating_a_modal_dialog)
|
|
83
95
|
*
|
|
84
96
|
* @default true
|
|
85
97
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAKlD,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,YAAY,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,EACtD;IACE;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,KAAK,CAAC;IAC3C;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM;
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAKlD,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,YAAY,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,EACtD;IACE;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,KAAK,CAAC;IAC3C;;;;OAIG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3D;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM;IApEf;;;OAGG;kBACW,MAAM,GAAG,KAAK;IAC5B;;;;;;OAMG;eACQ,MAAM,GAAG,cAAc,GAAG,KAAK;IAC1C;;;;OAIG;gBACS,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ;IAC1D;;;;;;OAMG;YACK,OAAO;IACf;;OAEG;WACI,OAAO;IACd;;OAEG;cACO,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;IAChC;;;;;OAKG;cACO,OAAO;qDAgIpB,CAAC"}
|
|
@@ -66,7 +66,7 @@ export declare const FieldCounter: import("react").ForwardRefExoticComponent<{
|
|
|
66
66
|
**/
|
|
67
67
|
limit: number;
|
|
68
68
|
} & Omit<Omit<import("../../types").DefaultProps, "data-color"> & import("react").HTMLAttributes<HTMLParagraphElement>, "data-color" | "asChild"> & {
|
|
69
|
-
'data-color'?: import("packages/
|
|
69
|
+
'data-color'?: import("packages/types/dist/types").SeverityColors;
|
|
70
70
|
asChild?: boolean;
|
|
71
71
|
} & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
72
72
|
//# sourceMappingURL=field-counter.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Color, SeverityColors } from '@digdir/designsystemet
|
|
1
|
+
import type { Color, SeverityColors } from '@digdir/designsystemet-types';
|
|
2
2
|
import type { Placement } from '@floating-ui/dom';
|
|
3
3
|
import type { HTMLAttributes } from 'react';
|
|
4
4
|
import type { DefaultProps } from '../../types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAmB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAUnE,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;AAMlD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC,GAAG,CAAC;QAClB,UAAU,mBAAmB;YAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;KACF;IACD,UAAU,KAAK,CAAC;QAEd,UAAU,cAAc,CAAC,CAAC;YACxB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;KACF;CACF;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CACnC,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,EAC7C;IACE;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,OAAO;IA9DhB;;OAEG;SACE,MAAM;IACX;;;OAGG;gBACS,SAAS;IACrB;;;OAGG;WACI,OAAO;IACd;;;;OAIG;cACO,SAAS,GAAG,QAAQ;IAC9B;;OAEG;mBACY,KAAK,GAAG,cAAc;IACrC;;OAEG;aACM,MAAM,IAAI;IACnB;;OAEG;cACO,MAAM,IAAI;IACpB;;;OAGG;oBACa,OAAO;IACvB;;;OAGG;cACO,OAAO;
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAmB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAUnE,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;AAMlD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC,GAAG,CAAC;QAClB,UAAU,mBAAmB;YAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;KACF;IACD,UAAU,KAAK,CAAC;QAEd,UAAU,cAAc,CAAC,CAAC;YACxB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;KACF;CACF;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CACnC,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,EAC7C;IACE;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,OAAO;IA9DhB;;OAEG;SACE,MAAM;IACX;;;OAGG;gBACS,SAAS;IACrB;;;OAGG;WACI,OAAO;IACd;;;;OAIG;cACO,SAAS,GAAG,QAAQ;IAC9B;;OAEG;mBACY,KAAK,GAAG,cAAc;IACrC;;OAEG;aACM,MAAM,IAAI;IACnB;;OAEG;cACO,MAAM,IAAI;IACpB;;;OAGG;oBACa,OAAO;IACvB;;;OAGG;cACO,OAAO;kDAiIpB,CAAC"}
|
|
@@ -24,7 +24,7 @@ export type SearchButtonProps = MergeRight<ButtonProps, {
|
|
|
24
24
|
*/
|
|
25
25
|
export declare const SearchButton: import("react").ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "type" | "data-color" | "variant" | "icon" | "loading" | "asChild"> & {
|
|
26
26
|
variant?: "primary" | "secondary" | "tertiary";
|
|
27
|
-
'data-color'?: import("packages/
|
|
27
|
+
'data-color'?: import("packages/types/dist/types").Color | Extract<import("packages/types/dist/types").SeverityColors, "danger">;
|
|
28
28
|
icon?: boolean;
|
|
29
29
|
loading?: boolean | ReactNode;
|
|
30
30
|
asChild?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion-clear.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion-clear.tsx"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG5D,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,UAAU,CAAC,GAAG;IAC7E;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe;IAnB1B;;;OAGG;mBACY,MAAM;
|
|
1
|
+
{"version":3,"file":"suggestion-clear.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion-clear.tsx"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG5D,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,UAAU,CAAC,GAAG;IAC7E;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe;IAnB1B;;;OAGG;mBACY,MAAM;qDAgCrB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Color, SeverityColors } from '@digdir/designsystemet
|
|
1
|
+
import type { Color, SeverityColors } from '@digdir/designsystemet-types';
|
|
2
2
|
import type { HTMLAttributes } from 'react';
|
|
3
3
|
import type { DefaultProps } from '../../types';
|
|
4
4
|
import type { MergeRight } from '../../utilities';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SeverityColors } from '@digdir/designsystemet
|
|
1
|
+
import type { SeverityColors } from '@digdir/designsystemet-types';
|
|
2
2
|
import type { HTMLAttributes } from 'react';
|
|
3
3
|
import type { DefaultProps } from '../../types';
|
|
4
4
|
import type { MergeRight } from '../../utilities';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type {
|
|
2
|
-
/** @deprecated This export is deprecated. Use `Size` from `@digdir/designsystemet
|
|
3
|
-
Size, } from '@digdir/designsystemet
|
|
2
|
+
/** @deprecated This export is deprecated. Use `Size` from `@digdir/designsystemet-types` */
|
|
3
|
+
Size, } from '@digdir/designsystemet-types';
|
|
4
4
|
export * from './components';
|
|
5
5
|
export { omit } from './components/Combobox/omit/omit';
|
|
6
6
|
export type { LabelRequired } from './types';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -65,9 +65,9 @@ export declare const useRovingFocus: (value: string) => {
|
|
|
65
65
|
exportparts?: string | undefined;
|
|
66
66
|
part?: string | undefined;
|
|
67
67
|
popovertarget?: string;
|
|
68
|
-
'data-size'?: import("packages/
|
|
69
|
-
'data-color'?: import("packages/
|
|
70
|
-
'data-color-scheme'?: import("packages/
|
|
68
|
+
'data-size'?: import("packages/types/dist/types").Size | (string & {});
|
|
69
|
+
'data-color'?: import("packages/types/dist/types").Color | (string & {});
|
|
70
|
+
'data-color-scheme'?: import("packages/types/dist/types").ColorScheme | (string & {});
|
|
71
71
|
"aria-activedescendant"?: string | undefined;
|
|
72
72
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
73
73
|
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
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.9.0",
|
|
5
5
|
"description": "React components for Designsystemet",
|
|
6
6
|
"author": "Designsystemet team",
|
|
7
7
|
"repository": {
|
|
@@ -38,16 +38,17 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@floating-ui/dom": "^1.7.4",
|
|
40
40
|
"@floating-ui/react": "0.26.23",
|
|
41
|
-
"@navikt/aksel-icons": "^7.
|
|
41
|
+
"@navikt/aksel-icons": "^7.35.1",
|
|
42
42
|
"@radix-ui/react-slot": "^1.2.4",
|
|
43
43
|
"@tanstack/react-virtual": "^3.13.12",
|
|
44
|
-
"@u-elements/u-combobox": "^1.0.
|
|
44
|
+
"@u-elements/u-combobox": "^1.0.5",
|
|
45
45
|
"@u-elements/u-datalist": "^1.0.14",
|
|
46
46
|
"@u-elements/u-details": "^0.1.5",
|
|
47
|
-
"clsx": "^2.1.1"
|
|
47
|
+
"clsx": "^2.1.1",
|
|
48
|
+
"@digdir/designsystemet-types": "^1.9.0"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
|
-
"@rollup/plugin-commonjs": "^
|
|
51
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
51
52
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
52
53
|
"@storybook/addon-docs": "^9.1.16",
|
|
53
54
|
"@storybook/addon-vitest": "^9.1.16",
|
|
@@ -56,18 +57,18 @@
|
|
|
56
57
|
"@testing-library/jest-dom": "^6.9.1",
|
|
57
58
|
"@testing-library/react": "^16.3.0",
|
|
58
59
|
"@testing-library/user-event": "^14.6.1",
|
|
59
|
-
"@types/react": "^19.2.
|
|
60
|
-
"@types/react-dom": "^19.2.
|
|
61
|
-
"react": "^19.2.
|
|
62
|
-
"react-dom": "^19.2.
|
|
63
|
-
"rimraf": "^6.1.
|
|
64
|
-
"rollup": "^4.53.
|
|
60
|
+
"@types/react": "^19.2.7",
|
|
61
|
+
"@types/react-dom": "^19.2.3",
|
|
62
|
+
"react": "^19.2.1",
|
|
63
|
+
"react-dom": "^19.2.1",
|
|
64
|
+
"rimraf": "^6.1.2",
|
|
65
|
+
"rollup": "^4.53.3",
|
|
65
66
|
"rollup-plugin-copy": "^3.5.0",
|
|
66
67
|
"storybook": "^9.1.16",
|
|
67
|
-
"tsx": "4.
|
|
68
|
+
"tsx": "4.21.0",
|
|
68
69
|
"typescript": "^5.9.3",
|
|
69
|
-
"@digdir/designsystemet": "^1.
|
|
70
|
-
"@digdir/designsystemet-css": "^1.
|
|
70
|
+
"@digdir/designsystemet": "^1.9.0",
|
|
71
|
+
"@digdir/designsystemet-css": "^1.9.0"
|
|
71
72
|
},
|
|
72
73
|
"scripts": {
|
|
73
74
|
"build": "pnpm run clean && tsc -b tsconfig.lib.json --emitDeclarationOnly false && rollup -c --bundleConfigAsCjs",
|