@digdir/designsystemet-react 0.0.0-test-20250711123754 → 0.0.0-test-20250714130823
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/dialog/dialog.js +3 -2
- package/dist/cjs/components/field/field-observer.js +6 -4
- package/dist/esm/components/dialog/dialog.js +3 -2
- package/dist/esm/components/field/field-observer.js +6 -4
- package/dist/types/colors.d.ts +23 -1
- package/dist/types/colors.d.ts.map +1 -1
- package/dist/types/components/Combobox/Combobox.d.ts +2 -2
- package/dist/types/components/alert/alert.d.ts +1 -1
- package/dist/types/components/alert/alert.d.ts.map +1 -1
- package/dist/types/components/badge/index.d.ts +1 -1
- package/dist/types/components/button/button.d.ts +3 -3
- package/dist/types/components/button/button.d.ts.map +1 -1
- package/dist/types/components/dialog/dialog-trigger.d.ts +1 -1
- package/dist/types/components/dialog/dialog.d.ts.map +1 -1
- package/dist/types/components/dialog/index.d.ts +1 -1
- package/dist/types/components/field/field-counter.d.ts +1 -1
- package/dist/types/components/field/field-observer.d.ts.map +1 -1
- package/dist/types/components/field/index.d.ts +1 -1
- package/dist/types/components/popover/index.d.ts +1 -1
- package/dist/types/components/search/index.d.ts +1 -1
- package/dist/types/components/search/search-button.d.ts +1 -1
- package/dist/types/components/validation-message/validation-message.d.ts +1 -1
- package/dist/types/components/validation-message/validation-message.d.ts.map +1 -1
- package/dist/types/types.d.ts +1 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utilities/roving-focus/use-roving-focus.d.ts +2 -2
- package/package.json +2 -3
|
@@ -73,8 +73,9 @@ const Dialog = react.forwardRef(function Dialog({ asChild, children, className,
|
|
|
73
73
|
/* handle closing */
|
|
74
74
|
react.useEffect(() => {
|
|
75
75
|
const handleClose = (event) => onClose?.(event);
|
|
76
|
-
dialogRef.current
|
|
77
|
-
|
|
76
|
+
const currentRef = dialogRef.current;
|
|
77
|
+
currentRef?.addEventListener('close', handleClose);
|
|
78
|
+
return () => currentRef?.removeEventListener('close', handleClose);
|
|
78
79
|
}, [onClose]);
|
|
79
80
|
return (jsxRuntime.jsxs(Component, { className: cl('ds-dialog', className), ref: mergedRefs, "data-modal": modal, ...rest, children: [closeButton !== false && (jsxRuntime.jsx("form", { method: 'dialog', children: jsxRuntime.jsx(button.Button, { "aria-label": closeButton, autoFocus: true, "data-color": 'neutral', icon: true, name: 'close', type: 'submit', variant: 'tertiary' }) })), children] }));
|
|
80
81
|
});
|
|
@@ -62,10 +62,12 @@ function fieldObserver(fieldElement) {
|
|
|
62
62
|
}
|
|
63
63
|
if (!value)
|
|
64
64
|
setAttr(el, isLabel(el) ? 'for' : 'id', id); // Ensure we have a value
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
+
}
|
|
69
71
|
}
|
|
70
72
|
setAttr(input, 'id', inputId);
|
|
71
73
|
setAttr(input, 'aria-describedby', describedbyIds.join(' ').trim());
|
|
@@ -71,8 +71,9 @@ const Dialog = forwardRef(function Dialog({ asChild, children, className, closeB
|
|
|
71
71
|
/* handle closing */
|
|
72
72
|
useEffect(() => {
|
|
73
73
|
const handleClose = (event) => onClose?.(event);
|
|
74
|
-
dialogRef.current
|
|
75
|
-
|
|
74
|
+
const currentRef = dialogRef.current;
|
|
75
|
+
currentRef?.addEventListener('close', handleClose);
|
|
76
|
+
return () => currentRef?.removeEventListener('close', handleClose);
|
|
76
77
|
}, [onClose]);
|
|
77
78
|
return (jsxs(Component, { className: cl('ds-dialog', className), ref: mergedRefs, "data-modal": modal, ...rest, children: [closeButton !== false && (jsx("form", { method: 'dialog', children: jsx(Button, { "aria-label": closeButton, autoFocus: true, "data-color": 'neutral', icon: true, name: 'close', type: 'submit', variant: 'tertiary' }) })), children] }));
|
|
78
79
|
});
|
|
@@ -60,10 +60,12 @@ function fieldObserver(fieldElement) {
|
|
|
60
60
|
}
|
|
61
61
|
if (!value)
|
|
62
62
|
setAttr(el, isLabel(el) ? 'for' : 'id', id); // Ensure we have a value
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
+
}
|
|
67
69
|
}
|
|
68
70
|
setAttr(input, 'id', inputId);
|
|
69
71
|
setAttr(input, 'aria-describedby', describedbyIds.join(' ').trim());
|
package/dist/types/colors.d.ts
CHANGED
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
declare const emptyObjectSymbol: unique symbol;
|
|
2
|
+
type EmptyObject = {
|
|
3
|
+
[emptyObjectSymbol]?: never;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Base interface for available colors in Designsystemet.
|
|
7
|
+
* The CLI will generate augmentations of this interface to allow
|
|
8
|
+
* type safety of custom color names.
|
|
9
|
+
*/
|
|
10
|
+
export interface MainAndSupportColors {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* If {@link MainAndSupportColors} has been extended to include color names, return T,
|
|
14
|
+
* otherwise return the arbitrary string type.
|
|
15
|
+
*/
|
|
16
|
+
type ColorWithFallback<T> = MainAndSupportColors extends EmptyObject ? string : T;
|
|
17
|
+
export type SeverityInfo = 'info';
|
|
18
|
+
export type SeveritySuccess = 'success';
|
|
19
|
+
export type SeverityWarning = 'warning';
|
|
20
|
+
export type SeverityDanger = 'danger';
|
|
21
|
+
export type SeverityColors = SeverityInfo | SeveritySuccess | SeverityWarning | SeverityDanger;
|
|
22
|
+
export type Color = ColorWithFallback<'neutral' | keyof MainAndSupportColors>;
|
|
23
|
+
export {};
|
|
2
24
|
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,iBAAiB,EAAE,OAAO,MAAM,CAAC;AAC/C,KAAK,WAAW,GAAG;IAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEnD;;;;GAIG;AAGH,MAAM,WAAW,oBAAoB;CAAG;AAExC;;;GAGG;AACH,KAAK,iBAAiB,CAAC,CAAC,IAAI,oBAAoB,SAAS,WAAW,GAChE,MAAM,GACN,CAAC,CAAC;AAEN,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC;AACxC,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC;AACxC,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;AACtC,MAAM,MAAM,cAAc,GACtB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,cAAc,CAAC;AAEnB,MAAM,MAAM,KAAK,GAAG,iBAAiB,CAAC,SAAS,GAAG,MAAM,oBAAoB,CAAC,CAAC"}
|
|
@@ -206,7 +206,7 @@ export declare const ComboboxComponent: React.ForwardRefExoticComponent<{
|
|
|
206
206
|
description?: ReactNode;
|
|
207
207
|
id?: string;
|
|
208
208
|
readOnly?: boolean;
|
|
209
|
-
size?: import("
|
|
209
|
+
size?: import("../..").Size;
|
|
210
210
|
} & Pick<React.HTMLAttributes<HTMLElement>, "aria-describedby"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
211
211
|
export declare const Combobox: React.ForwardRefExoticComponent<{
|
|
212
212
|
/**
|
|
@@ -312,6 +312,6 @@ export declare const Combobox: React.ForwardRefExoticComponent<{
|
|
|
312
312
|
description?: ReactNode;
|
|
313
313
|
id?: string;
|
|
314
314
|
readOnly?: boolean;
|
|
315
|
-
size?: import("
|
|
315
|
+
size?: import("../..").Size;
|
|
316
316
|
} & Pick<React.HTMLAttributes<HTMLElement>, "aria-describedby"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
317
317
|
//# sourceMappingURL=Combobox.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SeverityColors } from '@digdir/designsystemet-react/colors';
|
|
2
1
|
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { SeverityColors } from '../../colors';
|
|
3
3
|
import type { DefaultProps } from '../../types';
|
|
4
4
|
import type { MergeRight } from '../../utilities';
|
|
5
5
|
export type AlertProps = MergeRight<DefaultProps & HTMLAttributes<HTMLDivElement>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/alert/alert.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/alert/alert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,UAAU,GAAG,UAAU,CACjC,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,EAC7C;IACE;;;;OAIG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC;CAC/B,CACF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,KAAK;IAfd;;;;OAIG;mBACY,cAAc;wCAsB/B,CAAC"}
|
|
@@ -9,7 +9,7 @@ declare const Badge: React.ForwardRefExoticComponent<Omit<import("../../types").
|
|
|
9
9
|
count?: number;
|
|
10
10
|
maxCount?: number;
|
|
11
11
|
variant?: "base" | "tinted";
|
|
12
|
-
'data-color'?: import("
|
|
12
|
+
'data-color'?: import("../../colors").Color | import("../../colors").SeverityColors;
|
|
13
13
|
children?: never;
|
|
14
14
|
} & React.RefAttributes<HTMLSpanElement>> & {
|
|
15
15
|
Position: React.ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & React.HTMLAttributes<HTMLSpanElement>, "placement" | "overlap"> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Color,
|
|
1
|
+
import type { Color, SeverityDanger } from '@digdir/designsystemet-react/colors';
|
|
2
2
|
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
import type { DefaultProps } from '../../types';
|
|
4
4
|
import type { MergeRight } from '../../utilities';
|
|
@@ -11,7 +11,7 @@ export type ButtonProps = MergeRight<DefaultProps & ButtonHTMLAttributes<HTMLBut
|
|
|
11
11
|
/**
|
|
12
12
|
* Change the color scheme of the button
|
|
13
13
|
*/
|
|
14
|
-
'data-color'?: Color |
|
|
14
|
+
'data-color'?: Color | SeverityDanger;
|
|
15
15
|
/**
|
|
16
16
|
* Toggle icon only styling, pass icon as children
|
|
17
17
|
* @default false
|
|
@@ -50,7 +50,7 @@ export declare const Button: React.ForwardRefExoticComponent<Omit<DefaultProps &
|
|
|
50
50
|
/**
|
|
51
51
|
* Change the color scheme of the button
|
|
52
52
|
*/
|
|
53
|
-
'data-color'?: Color |
|
|
53
|
+
'data-color'?: Color | SeverityDanger;
|
|
54
54
|
/**
|
|
55
55
|
* Toggle icon only styling, pass icon as children
|
|
56
56
|
* @default false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK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M,CAAC,CAAC;CACxD,CACF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM;IAxCf;;;OAGG;cACO,SAAS,GAAG,WAAW,GAAG,UAAU;IAC9C;;OAEG;mBACY,KAAK,GAAG,cAAc;IACrC;;;OAGG;WACI,OAAO;IACd;;;;;OAKG;cACO,OAAO,GAAG,SAAS;IAC7B;;;OAGG;cACO,OAAO;IACjB;;;OAGG;WACI,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC;2CAgDzD,CAAC"}
|
|
@@ -14,7 +14,7 @@ export type DialogTriggerProps = ComponentPropsWithRef<typeof Button>;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<Omit<import("../../types").DefaultProps & React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "data-color" | "variant" | "icon" | "loading" | "asChild"> & {
|
|
16
16
|
variant?: "primary" | "secondary" | "tertiary";
|
|
17
|
-
'data-color'?: import("
|
|
17
|
+
'data-color'?: import("../../colors").Color | import("../../colors").SeverityDanger;
|
|
18
18
|
icon?: boolean;
|
|
19
19
|
loading?: boolean | React.ReactNode;
|
|
20
20
|
asChild?: boolean;
|
|
@@ -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;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,c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ACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM;IA1Df;;;OAGG;kBACW,MAAM,GAAG,KAAK;IAC5B;;;;OAIG;eACQ,MAAM,GAAG,cAAc,GAAG,KAAK;IAC1C;;;;;;OAMG;YACK,OAAO;IACf;;OAEG;WACI,OAAO;IACd;;OAEG;cACO,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;IAChC;;;OAGG;cACO,OAAO;2CAqHpB,CAAC"}
|
|
@@ -31,7 +31,7 @@ declare const Dialog: React.ForwardRefExoticComponent<Omit<import("../../types")
|
|
|
31
31
|
};
|
|
32
32
|
Trigger: React.ForwardRefExoticComponent<Omit<Omit<import("../../types").DefaultProps & React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "data-color" | "variant" | "icon" | "loading" | "asChild"> & {
|
|
33
33
|
variant?: "primary" | "secondary" | "tertiary";
|
|
34
|
-
'data-color'?: import("
|
|
34
|
+
'data-color'?: import("../../colors").Color | import("../../colors").SeverityDanger;
|
|
35
35
|
icon?: boolean;
|
|
36
36
|
loading?: boolean | React.ReactNode;
|
|
37
37
|
asChild?: boolean;
|
|
@@ -52,7 +52,7 @@ export declare const FieldCounter: React.ForwardRefExoticComponent<{
|
|
|
52
52
|
**/
|
|
53
53
|
limit: number;
|
|
54
54
|
} & Omit<Omit<import("../../types").DefaultProps, "data-color"> & React.HTMLAttributes<HTMLParagraphElement>, "data-color" | "asChild"> & {
|
|
55
|
-
'data-color'?: import("
|
|
55
|
+
'data-color'?: import("../../colors").SeverityColors;
|
|
56
56
|
asChild?: boolean;
|
|
57
57
|
} & React.RefAttributes<HTMLParagraphElement>>;
|
|
58
58
|
//# sourceMappingURL=field-counter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -24,7 +24,7 @@ declare const Field: React.ForwardRefExoticComponent<{
|
|
|
24
24
|
under?: string;
|
|
25
25
|
limit: number;
|
|
26
26
|
} & Omit<Omit<import("../../types").DefaultProps, "data-color"> & React.HTMLAttributes<HTMLParagraphElement>, "data-color" | "asChild"> & {
|
|
27
|
-
'data-color'?: import("
|
|
27
|
+
'data-color'?: import("../../colors").SeverityColors;
|
|
28
28
|
asChild?: boolean;
|
|
29
29
|
} & React.RefAttributes<HTMLParagraphElement>>;
|
|
30
30
|
};
|
|
@@ -16,7 +16,7 @@ declare const Popover: React.ForwardRefExoticComponent<Omit<import("../../types"
|
|
|
16
16
|
placement?: import("@floating-ui/dom").Placement;
|
|
17
17
|
open?: boolean;
|
|
18
18
|
variant?: "default" | "tinted";
|
|
19
|
-
'data-color'?: import("
|
|
19
|
+
'data-color'?: import("../../colors").Color | import("../../colors").SeverityColors;
|
|
20
20
|
onOpen?: () => void;
|
|
21
21
|
onClose?: () => void;
|
|
22
22
|
autoPlacement?: boolean;
|
|
@@ -23,7 +23,7 @@ declare const Search: React.ForwardRefExoticComponent<import("../../types").Defa
|
|
|
23
23
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
24
24
|
Button: React.ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "data-color" | "variant" | "icon" | "loading" | "asChild"> & {
|
|
25
25
|
variant?: "primary" | "secondary" | "tertiary";
|
|
26
|
-
'data-color'?: import("
|
|
26
|
+
'data-color'?: import("../../colors").Color | import("../../colors").SeverityDanger;
|
|
27
27
|
icon?: boolean;
|
|
28
28
|
loading?: boolean | React.ReactNode;
|
|
29
29
|
asChild?: boolean;
|
|
@@ -24,7 +24,7 @@ export type SearchButtonProps = MergeRight<ButtonProps, {
|
|
|
24
24
|
*/
|
|
25
25
|
export declare const SearchButton: React.ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "data-color" | "variant" | "icon" | "loading" | "asChild"> & {
|
|
26
26
|
variant?: "primary" | "secondary" | "tertiary";
|
|
27
|
-
'data-color'?: import("
|
|
27
|
+
'data-color'?: import("../../colors").Color | import("../../colors").SeverityDanger;
|
|
28
28
|
icon?: boolean;
|
|
29
29
|
loading?: boolean | ReactNode;
|
|
30
30
|
asChild?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SeverityColors } from '@digdir/designsystemet-react/colors';
|
|
2
1
|
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { SeverityColors } from '../../colors';
|
|
3
3
|
import type { DefaultProps } from '../../types';
|
|
4
4
|
import type { MergeRight } from '../../utilities';
|
|
5
5
|
export type ValidationMessageProps = MergeRight<Omit<DefaultProps, 'data-color'> & HTMLAttributes<HTMLParagraphElement>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-message.d.ts","sourceRoot":"","sources":["../../../src/components/validation-message/validation-message.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation-message.d.ts","sourceRoot":"","sources":["../../../src/components/validation-message/validation-message.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,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;8CAwBnB,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Size } from '@digdir/designsystemet/types';
|
|
2
1
|
import type { ReactNode } from 'react';
|
|
3
2
|
import type { Color } from './colors';
|
|
4
|
-
export type
|
|
3
|
+
export type Size = 'sm' | 'md' | 'lg';
|
|
5
4
|
export type DefaultProps = {
|
|
6
5
|
/**
|
|
7
6
|
* 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,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,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"}
|
|
@@ -65,8 +65,8 @@ export declare const useRovingFocus: (value: string) => {
|
|
|
65
65
|
exportparts?: string | undefined;
|
|
66
66
|
part?: string | undefined;
|
|
67
67
|
popovertarget?: string;
|
|
68
|
-
'data-size'?: import("
|
|
69
|
-
'data-color'?: import("
|
|
68
|
+
'data-size'?: import("../..").Size | (string & {});
|
|
69
|
+
'data-color'?: import("../../colors").Color | (string & {});
|
|
70
70
|
"aria-activedescendant"?: string | undefined;
|
|
71
71
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
72
72
|
"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": "0.0.0-test-
|
|
4
|
+
"version": "0.0.0-test-20250714130823",
|
|
5
5
|
"description": "React components for Designsystemet",
|
|
6
6
|
"author": "Designsystemet team",
|
|
7
7
|
"repository": {
|
|
@@ -67,8 +67,7 @@
|
|
|
67
67
|
"storybook": "^9.0.15",
|
|
68
68
|
"tsx": "4.20.3",
|
|
69
69
|
"typescript": "^5.8.3",
|
|
70
|
-
"@digdir/designsystemet": "^0.0.0-test-
|
|
71
|
-
"@digdir/designsystemet-css": "^0.0.0-test-20250711123754"
|
|
70
|
+
"@digdir/designsystemet-css": "^0.0.0-test-20250714130823"
|
|
72
71
|
},
|
|
73
72
|
"scripts": {
|
|
74
73
|
"build": "pnpm run clean && tsc -b tsconfig.lib.json --emitDeclarationOnly false && rollup -c --bundleConfigAsCjs",
|