@digdir/designsystemet-react 1.20.1 → 1.21.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/LICENSE +1 -1
- package/dist/cjs/components/avatar/avatar.d.cts +1 -0
- package/dist/cjs/components/avatar-stack/avatar-stack.cjs +13 -15
- package/dist/cjs/components/avatar-stack/avatar-stack.d.cts +14 -6
- package/dist/cjs/components/badge/badge-position.d.cts +1 -1
- package/dist/cjs/components/badge/index.d.cts +1 -1
- package/dist/cjs/components/breadcrumbs/breadcrumbs-link.d.cts +1 -1
- package/dist/cjs/components/card/card.d.cts +1 -1
- package/dist/cjs/components/dialog/dialog.d.cts +1 -1
- package/dist/cjs/components/error-summary/error-summary-link.d.cts +1 -1
- package/dist/cjs/components/link/link.d.cts +1 -1
- package/dist/cjs/components/popover/popover.d.cts +1 -1
- package/dist/cjs/components/tabs/tabs.d.cts +1 -1
- package/dist/cjs/components/tooltip/tooltip.d.cts +1 -1
- package/dist/esm/components/avatar/avatar.d.ts +1 -0
- package/dist/esm/components/avatar-stack/avatar-stack.d.ts +14 -6
- package/dist/esm/components/avatar-stack/avatar-stack.js +15 -17
- package/dist/esm/components/badge/badge-position.d.ts +1 -1
- package/dist/esm/components/badge/index.d.ts +1 -1
- package/dist/esm/components/breadcrumbs/breadcrumbs-link.d.ts +1 -1
- package/dist/esm/components/card/card.d.ts +1 -1
- package/dist/esm/components/dialog/dialog.d.ts +1 -1
- package/dist/esm/components/error-summary/error-summary-link.d.ts +1 -1
- package/dist/esm/components/link/link.d.ts +1 -1
- package/dist/esm/components/popover/popover.d.ts +1 -1
- package/dist/esm/components/tabs/tabs.d.ts +1 -1
- package/dist/esm/components/tooltip/tooltip.d.ts +1 -1
- package/package.json +11 -11
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright Digitaliseringsdirektoratet (Digdir)
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
|
@@ -28,6 +28,7 @@ type AvatarProps = MergeRight<DefaultProps & HTMLAttributes<HTMLSpanElement>, Ar
|
|
|
28
28
|
* The shape of the avatar.
|
|
29
29
|
*
|
|
30
30
|
* @default 'circle'
|
|
31
|
+
* @deprecated Please use `style={{ '--dsc-avatar-radius': VALUE }}` instead
|
|
31
32
|
*/
|
|
32
33
|
variant?: 'circle' | 'square';
|
|
33
34
|
/**
|
|
@@ -19,23 +19,21 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
19
19
|
* <Avatar aria-label='name' initials='sm' />
|
|
20
20
|
* </EXPERIMENTAL_AvatarStack>
|
|
21
21
|
*/
|
|
22
|
-
const EXPERIMENTAL_AvatarStack = (0, react.forwardRef)(function AvatarStack({ className, gap, suffix, avatarSize, overlap,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"--dsc-avatar-stack-gap": gap !== void 0 ? `${gap}` : void 0,
|
|
26
|
-
"--dsc-avatar-stack-size": avatarSize ? `${avatarSize}` : void 0,
|
|
27
|
-
"--dsc-avatar-stack-overlap": overlap !== void 0 ? `${overlap}` : void 0,
|
|
28
|
-
"--dsc-avatar-count": expandable === "fixed" ? react.Children.count(children) : void 0
|
|
29
|
-
};
|
|
30
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
31
|
-
tabIndex: rest.tabIndex !== void 0 ? rest.tabIndex : expandable ? 0 : void 0,
|
|
32
|
-
ref,
|
|
22
|
+
const EXPERIMENTAL_AvatarStack = (0, react.forwardRef)(function AvatarStack({ className, gap, suffix, children, avatarSize, overlap, style, expandable, ...rest }, ref) {
|
|
23
|
+
if (typeof overlap === "number") overlap = `calc(var(--dsc-avatar-stack-size) / 100 * ${overlap})`;
|
|
24
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
|
|
33
25
|
className: (0, clsx_lite.default)(`ds-avatar-stack`, className),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
"data-expandable": expandable || void 0,
|
|
27
|
+
tabIndex: rest.tabIndex ?? (expandable ? 0 : void 0),
|
|
28
|
+
ref,
|
|
29
|
+
style: {
|
|
30
|
+
"--dsc-avatar-stack-gap": gap,
|
|
31
|
+
"--dsc-avatar-stack-size": avatarSize,
|
|
32
|
+
"--dsc-avatar-stack-overlap": overlap,
|
|
33
|
+
...style
|
|
34
|
+
},
|
|
37
35
|
...rest,
|
|
38
|
-
children
|
|
36
|
+
children: [children, suffix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: suffix })]
|
|
39
37
|
});
|
|
40
38
|
});
|
|
41
39
|
//#endregion
|
|
@@ -5,20 +5,24 @@ type AvatarStackProps = {
|
|
|
5
5
|
/**
|
|
6
6
|
* Adjusts gap-mask between avatars in the stack. Must be a valid css length value (px, em, rem, var(--ds-size-1) etc.)
|
|
7
7
|
* @default 2px
|
|
8
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-gap': VALUE }}` instead
|
|
8
9
|
*/
|
|
9
10
|
gap?: string;
|
|
10
11
|
/**
|
|
11
12
|
* Control the size of the avatars. Must be a valid css length value (px, em, rem, var(--ds-size-12) etc.)
|
|
12
13
|
* @default 'var(--ds-size-12)'
|
|
14
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-size': VALUE }}` instead
|
|
13
15
|
*/
|
|
14
16
|
avatarSize?: string;
|
|
15
17
|
/**
|
|
16
18
|
* A number which represents the percentage value of how much avatars should overlap.
|
|
17
19
|
* @default 50
|
|
20
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-overlap': VALUE }}` instead
|
|
18
21
|
*/
|
|
19
|
-
overlap?: number;
|
|
22
|
+
overlap?: number | string;
|
|
20
23
|
/**
|
|
21
24
|
* Text to the right of the avatars to show a number representing additional avatars not shown such as '+5'".
|
|
25
|
+
* @deprecated Please use a trailing `<li>` with text instead
|
|
22
26
|
*/
|
|
23
27
|
suffix?: string;
|
|
24
28
|
/**
|
|
@@ -26,8 +30,8 @@ type AvatarStackProps = {
|
|
|
26
30
|
* 'fixed': AvatarStack physical width does not change when avatars are expanded.
|
|
27
31
|
* @default undefined
|
|
28
32
|
*/
|
|
29
|
-
expandable?: 'fixed' |
|
|
30
|
-
} & HTMLAttributes<
|
|
33
|
+
expandable?: 'fixed' | boolean;
|
|
34
|
+
} & HTMLAttributes<HTMLUListElement>;
|
|
31
35
|
/**
|
|
32
36
|
* Use `AvatarStack` to constrain Avatars into a stack.
|
|
33
37
|
*
|
|
@@ -46,20 +50,24 @@ declare const EXPERIMENTAL_AvatarStack: import("react").ForwardRefExoticComponen
|
|
|
46
50
|
/**
|
|
47
51
|
* Adjusts gap-mask between avatars in the stack. Must be a valid css length value (px, em, rem, var(--ds-size-1) etc.)
|
|
48
52
|
* @default 2px
|
|
53
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-gap': VALUE }}` instead
|
|
49
54
|
*/
|
|
50
55
|
gap?: string;
|
|
51
56
|
/**
|
|
52
57
|
* Control the size of the avatars. Must be a valid css length value (px, em, rem, var(--ds-size-12) etc.)
|
|
53
58
|
* @default 'var(--ds-size-12)'
|
|
59
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-size': VALUE }}` instead
|
|
54
60
|
*/
|
|
55
61
|
avatarSize?: string;
|
|
56
62
|
/**
|
|
57
63
|
* A number which represents the percentage value of how much avatars should overlap.
|
|
58
64
|
* @default 50
|
|
65
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-overlap': VALUE }}` instead
|
|
59
66
|
*/
|
|
60
|
-
overlap?: number;
|
|
67
|
+
overlap?: number | string;
|
|
61
68
|
/**
|
|
62
69
|
* Text to the right of the avatars to show a number representing additional avatars not shown such as '+5'".
|
|
70
|
+
* @deprecated Please use a trailing `<li>` with text instead
|
|
63
71
|
*/
|
|
64
72
|
suffix?: string;
|
|
65
73
|
/**
|
|
@@ -67,7 +75,7 @@ declare const EXPERIMENTAL_AvatarStack: import("react").ForwardRefExoticComponen
|
|
|
67
75
|
* 'fixed': AvatarStack physical width does not change when avatars are expanded.
|
|
68
76
|
* @default undefined
|
|
69
77
|
*/
|
|
70
|
-
expandable?: "fixed" |
|
|
71
|
-
} & HTMLAttributes<
|
|
78
|
+
expandable?: "fixed" | boolean;
|
|
79
|
+
} & HTMLAttributes<HTMLUListElement> & import("react").RefAttributes<HTMLUListElement>>;
|
|
72
80
|
//#endregion
|
|
73
81
|
export { AvatarStackProps, EXPERIMENTAL_AvatarStack };
|
|
@@ -27,7 +27,7 @@ type BadgePositionProps = MergeRight<DefaultProps & HTMLAttributes<HTMLSpanEleme
|
|
|
27
27
|
* <Element />
|
|
28
28
|
* </BadgePosition>
|
|
29
29
|
*/
|
|
30
|
-
declare const BadgePosition: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLSpanElement>, "
|
|
30
|
+
declare const BadgePosition: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLSpanElement>, "placement" | "overlap"> & {
|
|
31
31
|
/**
|
|
32
32
|
* The placement of the badge
|
|
33
33
|
*
|
|
@@ -16,7 +16,7 @@ declare const Badge: import("react").ForwardRefExoticComponent<Omit<DefaultProps
|
|
|
16
16
|
variant?: "base" | "tinted";
|
|
17
17
|
children?: never;
|
|
18
18
|
} & import("react").RefAttributes<HTMLSpanElement>> & {
|
|
19
|
-
Position: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").HTMLAttributes<HTMLSpanElement>, "
|
|
19
|
+
Position: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").HTMLAttributes<HTMLSpanElement>, "placement" | "overlap"> & {
|
|
20
20
|
placement?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
21
21
|
overlap?: "circle" | "rectangle";
|
|
22
22
|
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -4,7 +4,7 @@ import { LinkProps } from "../link/link.cjs";
|
|
|
4
4
|
import "../../index.cjs";
|
|
5
5
|
//#region src/components/breadcrumbs/breadcrumbs-link.d.ts
|
|
6
6
|
type BreadcrumbsLinkProps = LinkProps;
|
|
7
|
-
declare const BreadcrumbsLink: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "
|
|
7
|
+
declare const BreadcrumbsLink: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "asChild" | "children"> & {
|
|
8
8
|
children: import("react").ReactNode;
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -29,7 +29,7 @@ type CardProps = MergeRight<DefaultProps & HTMLAttributes<HTMLDivElement>, {
|
|
|
29
29
|
* <Card.Block>Footer</Card.Block>
|
|
30
30
|
* </Card>
|
|
31
31
|
*/
|
|
32
|
-
declare const Card: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "
|
|
32
|
+
declare const Card: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "asChild" | "children" | "variant"> & {
|
|
33
33
|
/**
|
|
34
34
|
* Change the background color of the card.
|
|
35
35
|
*
|
|
@@ -71,7 +71,7 @@ type DialogProps = MergeRight<DefaultProps & DialogHTMLAttributes<HTMLDialogElem
|
|
|
71
71
|
* Content
|
|
72
72
|
* </Dialog>
|
|
73
73
|
*/
|
|
74
|
-
declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DefaultProps & DialogHTMLAttributes<HTMLDialogElement>, "asChild" | "placement" | "
|
|
74
|
+
declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DefaultProps & DialogHTMLAttributes<HTMLDialogElement>, "asChild" | "placement" | "open" | "onClose" | "closedby" | "closeButton" | "modal"> & {
|
|
75
75
|
/**
|
|
76
76
|
* Screen reader label of close button. Set false to hide the close button.
|
|
77
77
|
* @default 'Lukk dialogvindu'
|
|
@@ -14,7 +14,7 @@ type ErrorSummaryLinkProps = LinkProps;
|
|
|
14
14
|
* </ErrorSummaryItem>
|
|
15
15
|
* </ErrorSummary>
|
|
16
16
|
*/
|
|
17
|
-
declare const ErrorSummaryLink: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "
|
|
17
|
+
declare const ErrorSummaryLink: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "asChild" | "children"> & {
|
|
18
18
|
children: import("react").ReactNode;
|
|
19
19
|
asChild?: boolean;
|
|
20
20
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -21,7 +21,7 @@ type LinkProps = MergeRight<DefaultProps & AnchorHTMLAttributes<HTMLAnchorElemen
|
|
|
21
21
|
* @example
|
|
22
22
|
* <Link href='#'>Link</Link>
|
|
23
23
|
*/
|
|
24
|
-
declare const Link: import("react").ForwardRefExoticComponent<Omit<DefaultProps & AnchorHTMLAttributes<HTMLAnchorElement>, "
|
|
24
|
+
declare const Link: import("react").ForwardRefExoticComponent<Omit<DefaultProps & AnchorHTMLAttributes<HTMLAnchorElement>, "asChild" | "children"> & {
|
|
25
25
|
/**
|
|
26
26
|
* The content to display inside the link.
|
|
27
27
|
**/
|
|
@@ -62,7 +62,7 @@ type PopoverProps = MergeRight<DefaultProps & HTMLAttributes<HTMLDivElement>, {
|
|
|
62
62
|
* Content
|
|
63
63
|
* </Popover>
|
|
64
64
|
*/
|
|
65
|
-
declare const Popover: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "asChild" | "id" | "variant" | "placement" | "
|
|
65
|
+
declare const Popover: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "asChild" | "id" | "variant" | "placement" | "open" | "onOpen" | "onClose" | "autoPlacement"> & {
|
|
66
66
|
/**
|
|
67
67
|
* id to connect the trigger with the popover - required when not using Popover.Context.
|
|
68
68
|
*/
|
|
@@ -37,7 +37,7 @@ type TabsProps = MergeRight<DefaultProps & Omit<HTMLAttributes<DSTabElement>, 'o
|
|
|
37
37
|
* <Tabs.Panel value='3'>content 3</Tabs.Panel>
|
|
38
38
|
* </Tabs>
|
|
39
39
|
*/
|
|
40
|
-
declare const Tabs: import("react").ForwardRefExoticComponent<Omit<DefaultProps & Omit<HTMLAttributes<DSTabElement>, "
|
|
40
|
+
declare const Tabs: import("react").ForwardRefExoticComponent<Omit<DefaultProps & Omit<HTMLAttributes<DSTabElement>, "value" | "onChange">, "value" | "defaultValue" | "onChange"> & {
|
|
41
41
|
/**
|
|
42
42
|
* Controlled state for `Tabs` component
|
|
43
43
|
* @default undefined
|
|
@@ -54,7 +54,7 @@ type TooltipProps = MergeRight<DefaultProps & HTMLAttributes<HTMLDivElement>, {
|
|
|
54
54
|
* Hover me
|
|
55
55
|
* </Tooltip>
|
|
56
56
|
*/
|
|
57
|
-
declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "
|
|
57
|
+
declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "content" | "children" | "type" | "placement" | "open" | "autoPlacement"> & {
|
|
58
58
|
/**
|
|
59
59
|
* The element or string that triggers the tooltip.
|
|
60
60
|
*
|
|
@@ -28,6 +28,7 @@ type AvatarProps = MergeRight<DefaultProps & HTMLAttributes<HTMLSpanElement>, Ar
|
|
|
28
28
|
* The shape of the avatar.
|
|
29
29
|
*
|
|
30
30
|
* @default 'circle'
|
|
31
|
+
* @deprecated Please use `style={{ '--dsc-avatar-radius': VALUE }}` instead
|
|
31
32
|
*/
|
|
32
33
|
variant?: 'circle' | 'square';
|
|
33
34
|
/**
|
|
@@ -5,20 +5,24 @@ type AvatarStackProps = {
|
|
|
5
5
|
/**
|
|
6
6
|
* Adjusts gap-mask between avatars in the stack. Must be a valid css length value (px, em, rem, var(--ds-size-1) etc.)
|
|
7
7
|
* @default 2px
|
|
8
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-gap': VALUE }}` instead
|
|
8
9
|
*/
|
|
9
10
|
gap?: string;
|
|
10
11
|
/**
|
|
11
12
|
* Control the size of the avatars. Must be a valid css length value (px, em, rem, var(--ds-size-12) etc.)
|
|
12
13
|
* @default 'var(--ds-size-12)'
|
|
14
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-size': VALUE }}` instead
|
|
13
15
|
*/
|
|
14
16
|
avatarSize?: string;
|
|
15
17
|
/**
|
|
16
18
|
* A number which represents the percentage value of how much avatars should overlap.
|
|
17
19
|
* @default 50
|
|
20
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-overlap': VALUE }}` instead
|
|
18
21
|
*/
|
|
19
|
-
overlap?: number;
|
|
22
|
+
overlap?: number | string;
|
|
20
23
|
/**
|
|
21
24
|
* Text to the right of the avatars to show a number representing additional avatars not shown such as '+5'".
|
|
25
|
+
* @deprecated Please use a trailing `<li>` with text instead
|
|
22
26
|
*/
|
|
23
27
|
suffix?: string;
|
|
24
28
|
/**
|
|
@@ -26,8 +30,8 @@ type AvatarStackProps = {
|
|
|
26
30
|
* 'fixed': AvatarStack physical width does not change when avatars are expanded.
|
|
27
31
|
* @default undefined
|
|
28
32
|
*/
|
|
29
|
-
expandable?: 'fixed' |
|
|
30
|
-
} & HTMLAttributes<
|
|
33
|
+
expandable?: 'fixed' | boolean;
|
|
34
|
+
} & HTMLAttributes<HTMLUListElement>;
|
|
31
35
|
/**
|
|
32
36
|
* Use `AvatarStack` to constrain Avatars into a stack.
|
|
33
37
|
*
|
|
@@ -46,20 +50,24 @@ declare const EXPERIMENTAL_AvatarStack: import("react").ForwardRefExoticComponen
|
|
|
46
50
|
/**
|
|
47
51
|
* Adjusts gap-mask between avatars in the stack. Must be a valid css length value (px, em, rem, var(--ds-size-1) etc.)
|
|
48
52
|
* @default 2px
|
|
53
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-gap': VALUE }}` instead
|
|
49
54
|
*/
|
|
50
55
|
gap?: string;
|
|
51
56
|
/**
|
|
52
57
|
* Control the size of the avatars. Must be a valid css length value (px, em, rem, var(--ds-size-12) etc.)
|
|
53
58
|
* @default 'var(--ds-size-12)'
|
|
59
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-size': VALUE }}` instead
|
|
54
60
|
*/
|
|
55
61
|
avatarSize?: string;
|
|
56
62
|
/**
|
|
57
63
|
* A number which represents the percentage value of how much avatars should overlap.
|
|
58
64
|
* @default 50
|
|
65
|
+
* @deprecated Please use `style={{ '--dsc-avatar-stack-overlap': VALUE }}` instead
|
|
59
66
|
*/
|
|
60
|
-
overlap?: number;
|
|
67
|
+
overlap?: number | string;
|
|
61
68
|
/**
|
|
62
69
|
* Text to the right of the avatars to show a number representing additional avatars not shown such as '+5'".
|
|
70
|
+
* @deprecated Please use a trailing `<li>` with text instead
|
|
63
71
|
*/
|
|
64
72
|
suffix?: string;
|
|
65
73
|
/**
|
|
@@ -67,7 +75,7 @@ declare const EXPERIMENTAL_AvatarStack: import("react").ForwardRefExoticComponen
|
|
|
67
75
|
* 'fixed': AvatarStack physical width does not change when avatars are expanded.
|
|
68
76
|
* @default undefined
|
|
69
77
|
*/
|
|
70
|
-
expandable?: "fixed" |
|
|
71
|
-
} & HTMLAttributes<
|
|
78
|
+
expandable?: "fixed" | boolean;
|
|
79
|
+
} & HTMLAttributes<HTMLUListElement> & import("react").RefAttributes<HTMLUListElement>>;
|
|
72
80
|
//#endregion
|
|
73
81
|
export { AvatarStackProps, EXPERIMENTAL_AvatarStack };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import cl from "clsx/lite";
|
|
3
|
-
import {
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/avatar-stack/avatar-stack.tsx
|
|
6
6
|
/**
|
|
7
7
|
* Use `AvatarStack` to constrain Avatars into a stack.
|
|
@@ -17,23 +17,21 @@ import { jsx } from "react/jsx-runtime";
|
|
|
17
17
|
* <Avatar aria-label='name' initials='sm' />
|
|
18
18
|
* </EXPERIMENTAL_AvatarStack>
|
|
19
19
|
*/
|
|
20
|
-
const EXPERIMENTAL_AvatarStack = forwardRef(function AvatarStack({ className, gap, suffix, avatarSize, overlap,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"--dsc-avatar-stack-gap": gap !== void 0 ? `${gap}` : void 0,
|
|
24
|
-
"--dsc-avatar-stack-size": avatarSize ? `${avatarSize}` : void 0,
|
|
25
|
-
"--dsc-avatar-stack-overlap": overlap !== void 0 ? `${overlap}` : void 0,
|
|
26
|
-
"--dsc-avatar-count": expandable === "fixed" ? Children.count(children) : void 0
|
|
27
|
-
};
|
|
28
|
-
return /* @__PURE__ */ jsx("span", {
|
|
29
|
-
tabIndex: rest.tabIndex !== void 0 ? rest.tabIndex : expandable ? 0 : void 0,
|
|
30
|
-
ref,
|
|
20
|
+
const EXPERIMENTAL_AvatarStack = forwardRef(function AvatarStack({ className, gap, suffix, children, avatarSize, overlap, style, expandable, ...rest }, ref) {
|
|
21
|
+
if (typeof overlap === "number") overlap = `calc(var(--dsc-avatar-stack-size) / 100 * ${overlap})`;
|
|
22
|
+
return /* @__PURE__ */ jsxs("ul", {
|
|
31
23
|
className: cl(`ds-avatar-stack`, className),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
"data-expandable": expandable || void 0,
|
|
25
|
+
tabIndex: rest.tabIndex ?? (expandable ? 0 : void 0),
|
|
26
|
+
ref,
|
|
27
|
+
style: {
|
|
28
|
+
"--dsc-avatar-stack-gap": gap,
|
|
29
|
+
"--dsc-avatar-stack-size": avatarSize,
|
|
30
|
+
"--dsc-avatar-stack-overlap": overlap,
|
|
31
|
+
...style
|
|
32
|
+
},
|
|
35
33
|
...rest,
|
|
36
|
-
children
|
|
34
|
+
children: [children, suffix && /* @__PURE__ */ jsx("li", { children: suffix })]
|
|
37
35
|
});
|
|
38
36
|
});
|
|
39
37
|
//#endregion
|
|
@@ -27,7 +27,7 @@ type BadgePositionProps = MergeRight<DefaultProps & HTMLAttributes<HTMLSpanEleme
|
|
|
27
27
|
* <Element />
|
|
28
28
|
* </BadgePosition>
|
|
29
29
|
*/
|
|
30
|
-
declare const BadgePosition: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLSpanElement>, "
|
|
30
|
+
declare const BadgePosition: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLSpanElement>, "placement" | "overlap"> & {
|
|
31
31
|
/**
|
|
32
32
|
* The placement of the badge
|
|
33
33
|
*
|
|
@@ -16,7 +16,7 @@ declare const Badge: import("react").ForwardRefExoticComponent<Omit<DefaultProps
|
|
|
16
16
|
variant?: "base" | "tinted";
|
|
17
17
|
children?: never;
|
|
18
18
|
} & import("react").RefAttributes<HTMLSpanElement>> & {
|
|
19
|
-
Position: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").HTMLAttributes<HTMLSpanElement>, "
|
|
19
|
+
Position: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").HTMLAttributes<HTMLSpanElement>, "placement" | "overlap"> & {
|
|
20
20
|
placement?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
21
21
|
overlap?: "circle" | "rectangle";
|
|
22
22
|
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -4,7 +4,7 @@ import { LinkProps } from "../link/link.js";
|
|
|
4
4
|
import "../../index.js";
|
|
5
5
|
//#region src/components/breadcrumbs/breadcrumbs-link.d.ts
|
|
6
6
|
type BreadcrumbsLinkProps = LinkProps;
|
|
7
|
-
declare const BreadcrumbsLink: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "
|
|
7
|
+
declare const BreadcrumbsLink: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "asChild" | "children"> & {
|
|
8
8
|
children: import("react").ReactNode;
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -29,7 +29,7 @@ type CardProps = MergeRight<DefaultProps & HTMLAttributes<HTMLDivElement>, {
|
|
|
29
29
|
* <Card.Block>Footer</Card.Block>
|
|
30
30
|
* </Card>
|
|
31
31
|
*/
|
|
32
|
-
declare const Card: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "
|
|
32
|
+
declare const Card: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "asChild" | "children" | "variant"> & {
|
|
33
33
|
/**
|
|
34
34
|
* Change the background color of the card.
|
|
35
35
|
*
|
|
@@ -71,7 +71,7 @@ type DialogProps = MergeRight<DefaultProps & DialogHTMLAttributes<HTMLDialogElem
|
|
|
71
71
|
* Content
|
|
72
72
|
* </Dialog>
|
|
73
73
|
*/
|
|
74
|
-
declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DefaultProps & DialogHTMLAttributes<HTMLDialogElement>, "asChild" | "placement" | "
|
|
74
|
+
declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DefaultProps & DialogHTMLAttributes<HTMLDialogElement>, "asChild" | "placement" | "open" | "onClose" | "closedby" | "closeButton" | "modal"> & {
|
|
75
75
|
/**
|
|
76
76
|
* Screen reader label of close button. Set false to hide the close button.
|
|
77
77
|
* @default 'Lukk dialogvindu'
|
|
@@ -14,7 +14,7 @@ type ErrorSummaryLinkProps = LinkProps;
|
|
|
14
14
|
* </ErrorSummaryItem>
|
|
15
15
|
* </ErrorSummary>
|
|
16
16
|
*/
|
|
17
|
-
declare const ErrorSummaryLink: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "
|
|
17
|
+
declare const ErrorSummaryLink: import("react").ForwardRefExoticComponent<Omit<DefaultProps & import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "asChild" | "children"> & {
|
|
18
18
|
children: import("react").ReactNode;
|
|
19
19
|
asChild?: boolean;
|
|
20
20
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -21,7 +21,7 @@ type LinkProps = MergeRight<DefaultProps & AnchorHTMLAttributes<HTMLAnchorElemen
|
|
|
21
21
|
* @example
|
|
22
22
|
* <Link href='#'>Link</Link>
|
|
23
23
|
*/
|
|
24
|
-
declare const Link: import("react").ForwardRefExoticComponent<Omit<DefaultProps & AnchorHTMLAttributes<HTMLAnchorElement>, "
|
|
24
|
+
declare const Link: import("react").ForwardRefExoticComponent<Omit<DefaultProps & AnchorHTMLAttributes<HTMLAnchorElement>, "asChild" | "children"> & {
|
|
25
25
|
/**
|
|
26
26
|
* The content to display inside the link.
|
|
27
27
|
**/
|
|
@@ -62,7 +62,7 @@ type PopoverProps = MergeRight<DefaultProps & HTMLAttributes<HTMLDivElement>, {
|
|
|
62
62
|
* Content
|
|
63
63
|
* </Popover>
|
|
64
64
|
*/
|
|
65
|
-
declare const Popover: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "asChild" | "id" | "variant" | "placement" | "
|
|
65
|
+
declare const Popover: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "asChild" | "id" | "variant" | "placement" | "open" | "onOpen" | "onClose" | "autoPlacement"> & {
|
|
66
66
|
/**
|
|
67
67
|
* id to connect the trigger with the popover - required when not using Popover.Context.
|
|
68
68
|
*/
|
|
@@ -37,7 +37,7 @@ type TabsProps = MergeRight<DefaultProps & Omit<HTMLAttributes<DSTabElement>, 'o
|
|
|
37
37
|
* <Tabs.Panel value='3'>content 3</Tabs.Panel>
|
|
38
38
|
* </Tabs>
|
|
39
39
|
*/
|
|
40
|
-
declare const Tabs: import("react").ForwardRefExoticComponent<Omit<DefaultProps & Omit<HTMLAttributes<DSTabElement>, "
|
|
40
|
+
declare const Tabs: import("react").ForwardRefExoticComponent<Omit<DefaultProps & Omit<HTMLAttributes<DSTabElement>, "value" | "onChange">, "value" | "defaultValue" | "onChange"> & {
|
|
41
41
|
/**
|
|
42
42
|
* Controlled state for `Tabs` component
|
|
43
43
|
* @default undefined
|
|
@@ -54,7 +54,7 @@ type TooltipProps = MergeRight<DefaultProps & HTMLAttributes<HTMLDivElement>, {
|
|
|
54
54
|
* Hover me
|
|
55
55
|
* </Tooltip>
|
|
56
56
|
*/
|
|
57
|
-
declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "
|
|
57
|
+
declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "content" | "children" | "type" | "placement" | "open" | "autoPlacement"> & {
|
|
58
58
|
/**
|
|
59
59
|
* The element or string that triggers the tooltip.
|
|
60
60
|
*
|
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.21.0",
|
|
5
5
|
"description": "React components for Designsystemet",
|
|
6
6
|
"author": "Designsystemet team",
|
|
7
7
|
"repository": {
|
|
@@ -44,27 +44,27 @@
|
|
|
44
44
|
"@floating-ui/react": "0.26.23",
|
|
45
45
|
"@navikt/aksel-icons": "^8.16.1",
|
|
46
46
|
"@radix-ui/react-slot": "^1.3.3",
|
|
47
|
-
"@tanstack/react-virtual": "^3.14.
|
|
47
|
+
"@tanstack/react-virtual": "^3.14.10",
|
|
48
48
|
"clsx": "^2.1.1",
|
|
49
|
-
"@digdir/designsystemet-types": "1.
|
|
50
|
-
"@digdir/designsystemet-web": "1.
|
|
49
|
+
"@digdir/designsystemet-types": "1.21.0",
|
|
50
|
+
"@digdir/designsystemet-web": "1.21.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@storybook/addon-docs": "10.5.
|
|
54
|
-
"@storybook/addon-vitest": "10.5.
|
|
55
|
-
"@storybook/react-vite": "10.5.
|
|
53
|
+
"@storybook/addon-docs": "10.5.10",
|
|
54
|
+
"@storybook/addon-vitest": "10.5.10",
|
|
55
|
+
"@storybook/react-vite": "10.5.10",
|
|
56
56
|
"@testing-library/jest-dom": "7.0.1",
|
|
57
57
|
"@testing-library/react": "16.3.2",
|
|
58
|
-
"@testing-library/user-event": "14.6.
|
|
58
|
+
"@testing-library/user-event": "14.6.6",
|
|
59
59
|
"@types/react": "19.2.18",
|
|
60
|
-
"@types/react-dom": "19.2.
|
|
60
|
+
"@types/react-dom": "19.2.5",
|
|
61
61
|
"react": "19.2.8",
|
|
62
62
|
"react-dom": "19.2.8",
|
|
63
63
|
"react-dropzone": "19.3.0",
|
|
64
|
-
"storybook": "10.5.
|
|
64
|
+
"storybook": "10.5.10",
|
|
65
65
|
"tsdown": "0.22.14",
|
|
66
66
|
"typescript": "6.0.3",
|
|
67
|
-
"@digdir/designsystemet-css": "^1.
|
|
67
|
+
"@digdir/designsystemet-css": "^1.21.0"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build": "tsdown",
|