@digdir/designsystemet-react 1.20.1 → 1.21.1

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.
Files changed (28) hide show
  1. package/LICENSE +1 -1
  2. package/dist/cjs/components/avatar/avatar.d.cts +1 -0
  3. package/dist/cjs/components/avatar-stack/avatar-stack.cjs +13 -15
  4. package/dist/cjs/components/avatar-stack/avatar-stack.d.cts +14 -6
  5. package/dist/cjs/components/breadcrumbs/breadcrumbs-link.d.cts +1 -1
  6. package/dist/cjs/components/card/card.d.cts +1 -1
  7. package/dist/cjs/components/dialog/dialog.d.cts +1 -1
  8. package/dist/cjs/components/error-summary/error-summary-link.d.cts +1 -1
  9. package/dist/cjs/components/link/link.d.cts +1 -1
  10. package/dist/cjs/components/popover/popover.d.cts +1 -1
  11. package/dist/cjs/components/tabs/tabs.d.cts +1 -1
  12. package/dist/cjs/components/tooltip/tooltip.d.cts +1 -1
  13. package/dist/cjs/utilities/hooks/deprecated/use-isomorphic-layout-effect/use-isomorphic-layout-effect.d.cts +2 -2
  14. package/dist/cjs/utilities/hooks/use-synchronized-animation/use-synchronized-animation.d.cts +1 -1
  15. package/dist/esm/components/avatar/avatar.d.ts +1 -0
  16. package/dist/esm/components/avatar-stack/avatar-stack.d.ts +14 -6
  17. package/dist/esm/components/avatar-stack/avatar-stack.js +15 -17
  18. package/dist/esm/components/breadcrumbs/breadcrumbs-link.d.ts +1 -1
  19. package/dist/esm/components/card/card.d.ts +1 -1
  20. package/dist/esm/components/dialog/dialog.d.ts +1 -1
  21. package/dist/esm/components/error-summary/error-summary-link.d.ts +1 -1
  22. package/dist/esm/components/link/link.d.ts +1 -1
  23. package/dist/esm/components/popover/popover.d.ts +1 -1
  24. package/dist/esm/components/tabs/tabs.d.ts +1 -1
  25. package/dist/esm/components/tooltip/tooltip.d.ts +1 -1
  26. package/dist/esm/utilities/hooks/deprecated/use-isomorphic-layout-effect/use-isomorphic-layout-effect.d.ts +2 -2
  27. package/dist/esm/utilities/hooks/use-synchronized-animation/use-synchronized-animation.d.ts +1 -1
  28. package/package.json +13 -13
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2024 Digitaliseringsdirektoratet (Digdir)
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, expandable, children, ...rest }, ref) {
23
- const style = {
24
- ...rest.style || {},
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
- style,
35
- "data-expandable": expandable,
36
- "data-suffix": suffix,
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' | true;
30
- } & HTMLAttributes<HTMLSpanElement>;
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" | true;
71
- } & HTMLAttributes<HTMLSpanElement> & import("react").RefAttributes<HTMLSpanElement>>;
78
+ expandable?: "fixed" | boolean;
79
+ } & HTMLAttributes<HTMLUListElement> & import("react").RefAttributes<HTMLUListElement>>;
72
80
  //#endregion
73
81
  export { AvatarStackProps, EXPERIMENTAL_AvatarStack };
@@ -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>, "children" | "asChild"> & {
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>, "children" | "asChild" | "variant"> & {
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" | "closedby" | "onClose" | "open" | "closeButton" | "modal"> & {
74
+ declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DefaultProps & DialogHTMLAttributes<HTMLDialogElement>, "asChild" | "closedby" | "onClose" | "open" | "closeButton" | "placement" | "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>, "children" | "asChild"> & {
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>, "children" | "asChild"> & {
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" | "onClose" | "open" | "onOpen" | "autoPlacement"> & {
65
+ declare const Popover: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "asChild" | "id" | "variant" | "onClose" | "open" | "placement" | "onOpen" | "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>, "onChange" | "value">, "defaultValue" | "onChange" | "value"> & {
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>, "children" | "content" | "type" | "placement" | "open" | "autoPlacement"> & {
57
+ declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "content" | "children" | "type" | "open" | "placement" | "autoPlacement"> & {
58
58
  /**
59
59
  * The element or string that triggers the tooltip.
60
60
  *
@@ -1,6 +1,6 @@
1
1
 
2
- import { useEffect } from "react";
2
+ import { useLayoutEffect } from "react";
3
3
  //#region src/utilities/hooks/deprecated/use-isomorphic-layout-effect/use-isomorphic-layout-effect.d.ts
4
- declare const useIsomorphicLayoutEffect: typeof useEffect;
4
+ declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
5
5
  //#endregion
6
6
  export { useIsomorphicLayoutEffect };
@@ -1,5 +1,5 @@
1
1
 
2
- import { useEffect } from "react";
2
+ import { useLayoutEffect } from "react";
3
3
  //#region src/utilities/hooks/use-synchronized-animation/use-synchronized-animation.d.ts
4
4
  /**
5
5
  * Synchronizes the css animation of multiple elements with the same `animationName`.
@@ -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' | true;
30
- } & HTMLAttributes<HTMLSpanElement>;
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" | true;
71
- } & HTMLAttributes<HTMLSpanElement> & import("react").RefAttributes<HTMLSpanElement>>;
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 { Children, forwardRef } from "react";
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, expandable, children, ...rest }, ref) {
21
- const style = {
22
- ...rest.style || {},
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
- style,
33
- "data-expandable": expandable,
34
- "data-suffix": suffix,
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
@@ -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>, "children" | "asChild"> & {
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>, "children" | "asChild" | "variant"> & {
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" | "closedby" | "onClose" | "open" | "closeButton" | "modal"> & {
74
+ declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DefaultProps & DialogHTMLAttributes<HTMLDialogElement>, "asChild" | "closedby" | "onClose" | "open" | "closeButton" | "placement" | "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>, "children" | "asChild"> & {
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>, "children" | "asChild"> & {
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" | "onClose" | "open" | "onOpen" | "autoPlacement"> & {
65
+ declare const Popover: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "asChild" | "id" | "variant" | "onClose" | "open" | "placement" | "onOpen" | "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>, "onChange" | "value">, "defaultValue" | "onChange" | "value"> & {
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>, "children" | "content" | "type" | "placement" | "open" | "autoPlacement"> & {
57
+ declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<DefaultProps & HTMLAttributes<HTMLDivElement>, "content" | "children" | "type" | "open" | "placement" | "autoPlacement"> & {
58
58
  /**
59
59
  * The element or string that triggers the tooltip.
60
60
  *
@@ -1,6 +1,6 @@
1
1
 
2
- import { useEffect } from "react";
2
+ import { useLayoutEffect } from "react";
3
3
  //#region src/utilities/hooks/deprecated/use-isomorphic-layout-effect/use-isomorphic-layout-effect.d.ts
4
- declare const useIsomorphicLayoutEffect: typeof useEffect;
4
+ declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
5
5
  //#endregion
6
6
  export { useIsomorphicLayoutEffect };
@@ -1,5 +1,5 @@
1
1
 
2
- import { useEffect } from "react";
2
+ import { useLayoutEffect } from "react";
3
3
  //#region src/utilities/hooks/use-synchronized-animation/use-synchronized-animation.d.ts
4
4
  /**
5
5
  * Synchronizes the css animation of multiple elements with the same `animationName`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@digdir/designsystemet-react",
3
3
  "type": "module",
4
- "version": "1.20.1",
4
+ "version": "1.21.1",
5
5
  "description": "React components for Designsystemet",
6
6
  "author": "Designsystemet team",
7
7
  "repository": {
@@ -42,29 +42,29 @@
42
42
  "dependencies": {
43
43
  "@floating-ui/dom": "^1.8.0",
44
44
  "@floating-ui/react": "0.26.23",
45
- "@navikt/aksel-icons": "^8.16.1",
45
+ "@navikt/aksel-icons": "^8.16.2",
46
46
  "@radix-ui/react-slot": "^1.3.3",
47
- "@tanstack/react-virtual": "^3.14.9",
47
+ "@tanstack/react-virtual": "^3.14.10",
48
48
  "clsx": "^2.1.1",
49
- "@digdir/designsystemet-types": "1.20.1",
50
- "@digdir/designsystemet-web": "1.20.1"
49
+ "@digdir/designsystemet-types": "1.21.1",
50
+ "@digdir/designsystemet-web": "1.21.1"
51
51
  },
52
52
  "devDependencies": {
53
- "@storybook/addon-docs": "10.5.8",
54
- "@storybook/addon-vitest": "10.5.8",
55
- "@storybook/react-vite": "10.5.8",
53
+ "@storybook/addon-docs": "10.6.0",
54
+ "@storybook/addon-vitest": "10.6.0",
55
+ "@storybook/react-vite": "10.6.0",
56
56
  "@testing-library/jest-dom": "7.0.1",
57
- "@testing-library/react": "16.3.2",
58
- "@testing-library/user-event": "14.6.4",
57
+ "@testing-library/react": "16.3.3",
58
+ "@testing-library/user-event": "14.6.7",
59
59
  "@types/react": "19.2.18",
60
- "@types/react-dom": "19.2.4",
60
+ "@types/react-dom": "19.2.7",
61
61
  "react": "19.2.8",
62
62
  "react-dom": "19.2.8",
63
63
  "react-dropzone": "19.3.0",
64
- "storybook": "10.5.8",
64
+ "storybook": "10.6.0",
65
65
  "tsdown": "0.22.14",
66
66
  "typescript": "6.0.3",
67
- "@digdir/designsystemet-css": "^1.20.1"
67
+ "@digdir/designsystemet-css": "^1.21.1"
68
68
  },
69
69
  "scripts": {
70
70
  "build": "tsdown",