@kystverket/styrbord 1.20.0 → 2.0.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 (54) hide show
  1. package/README.md +5 -3
  2. package/dist/src/components/designsystemet/Avatar/Avatar.d.ts +10 -2
  3. package/dist/src/components/designsystemet/Avatar/Avatar.helpers.d.ts +10 -0
  4. package/dist/src/components/designsystemet/Avatar/Avatar.stories.d.ts +1 -0
  5. package/dist/src/components/designsystemet/Button/Button.d.ts +23 -2
  6. package/dist/src/components/designsystemet/Button/Button.stories.d.ts +3 -0
  7. package/dist/src/components/designsystemet/Checkbox/Checkbox.stories.d.ts +15 -15
  8. package/dist/src/components/designsystemet/Chip/Chip.stories.d.ts +5 -13
  9. package/dist/src/components/designsystemet/Details/Details.stories.d.ts +2 -1
  10. package/dist/src/components/designsystemet/Dialog/Dialog.d.ts +2 -2
  11. package/dist/src/components/designsystemet/Dialog/Dialog.stories.d.ts +2 -2
  12. package/dist/src/components/designsystemet/NumberInput/NumberInput.d.ts +2 -2
  13. package/dist/src/components/designsystemet/Paragraph/typography.paragraph.stories.d.ts +6 -9
  14. package/dist/src/components/designsystemet/Tag/Tag.d.ts +3 -4
  15. package/dist/src/components/designsystemet/Tag/Tag.stories.d.ts +1 -1
  16. package/dist/src/components/designsystemet/TextArea/TextArea.d.ts +2 -2
  17. package/dist/src/components/designsystemet/TextArea/TextArea.stories.d.ts +1 -1
  18. package/dist/src/components/designsystemet/TextInput/TextInput.d.ts +2 -2
  19. package/dist/src/components/designsystemet/TextInput/TextInput.stories.d.ts +1 -1
  20. package/dist/src/components/kystverket/Alert/alert.d.ts +4 -4
  21. package/dist/src/components/kystverket/Alert/alert.stories.d.ts +2 -1
  22. package/dist/src/components/kystverket/Box/box.d.ts +10 -0
  23. package/dist/src/components/kystverket/ClickableCard/ClickableCard.stories.d.ts +10 -9
  24. package/dist/src/components/kystverket/ClickableCard/ClickableCard.types.d.ts +5 -6
  25. package/dist/src/components/kystverket/DateAndTimePickers/DateTimePicker/DateTimePicker.d.ts +2 -2
  26. package/dist/src/components/kystverket/DateAndTimePickers/DateTimePicker/DateTimePicker.stories.d.ts +2 -2
  27. package/dist/src/components/kystverket/DateAndTimePickers/Datepicker/Datepicker.d.ts +2 -2
  28. package/dist/src/components/kystverket/DateAndTimePickers/Datepicker/Datepicker.stories.d.ts +2 -2
  29. package/dist/src/components/kystverket/DateAndTimePickers/TimePicker/TimePicker.d.ts +2 -2
  30. package/dist/src/components/kystverket/DateAndTimePickers/TimePicker/TimePicker.stories.d.ts +2 -2
  31. package/dist/src/components/kystverket/Header/Header.d.ts +1 -1
  32. package/dist/src/components/kystverket/Image/svgImage.d.ts +2 -3
  33. package/dist/src/components/kystverket/PageHeading/PageHeading.d.ts +5 -5
  34. package/dist/src/components/kystverket/RichTextArea/richTextArea.stories.d.ts +1 -0
  35. package/dist/src/components/kystverket/SlotDialog/SlotDialog.d.ts +2 -2
  36. package/dist/src/components/kystverket/SlotDialog/SlotDialog.stories.d.ts +1 -1
  37. package/dist/src/components/kystverket/Stepper/stepper.d.ts +1 -1
  38. package/dist/src/components/kystverket/Surface/Surface.d.ts +28 -0
  39. package/dist/src/components/kystverket/Surface/Surface.stories.d.ts +80 -0
  40. package/dist/src/components/kystverket/Surface/Surface.types.d.ts +43 -0
  41. package/dist/src/components/kystverket/Typography/typography.accent.stories.d.ts +1 -1
  42. package/dist/src/components/kystverket/Typography/typography.d.ts +0 -5
  43. package/dist/src/components/kystverket/Typography/typography.label.stories.d.ts +1 -1
  44. package/dist/src/main.d.ts +13 -10
  45. package/dist/src/utils/input/input.d.ts +1 -1
  46. package/dist/style.css +1 -1
  47. package/dist/style.js +2639 -2460
  48. package/dist/style.umd.cjs +7 -7
  49. package/package.json +3 -1
  50. package/dist/src/components/designsystemet/Chip/Chip.d.ts +0 -14
  51. package/dist/src/components/designsystemet/Chip/index.d.ts +0 -36
  52. package/dist/src/components/designsystemet/Paragraph/Paragraph.d.ts +0 -10
  53. package/dist/src/components/designsystemet/Text/Text.d.ts +0 -13
  54. package/dist/src/components/designsystemet/Text/Text.stories.d.ts +0 -89
package/README.md CHANGED
@@ -17,9 +17,11 @@ Alle komponentene og typene i Designsystemet er tilgjengelig i Styrbord med føl
17
17
 
18
18
  ## Versjonering
19
19
 
20
- - Major følger major-versjon til Designsystemet.
21
- - Minor inkrementeres ved en eller flere knekkende endringer, eller ny versjon av Designsystemet.
22
- - Patch inkrementeres ved alle endringer, store eller små, som ikke knekker noe eksisterende.
20
+ - Prosjektet følger semantisk versjonering (`major.minor.patch`).
21
+ - Major inkrementeres ved knekkende endringer.
22
+ - Minor inkrementeres ved ny funksjonalitet bakoverkompatibelt.
23
+ - Patch inkrementeres ved feilrettinger og mindre forbedringer.
24
+ - Versjon 2.0.0 finnes bare på GitHub Packages. På npmjs var versjonsnummeret allerede brukt, så første 2.x-versjon der er 2.0.1.
23
25
 
24
26
  ## Bruk
25
27
 
@@ -1,5 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { AvatarProps as DsAvatarProps, MergeRight } from '@digdir/designsystemet-react';
3
+ import { DataColor, DataColorVariant } from '~/main';
4
+ export type AvatarBoringVariant = 'marble' | 'beam' | 'pixel' | 'sunset' | 'ring' | 'bauhaus' | 'geometric' | 'abstract';
3
5
  type AriaLabel = {
4
6
  /**
5
7
  * The name of the person the avatar represents.
@@ -10,9 +12,10 @@ type AriaHidden = Partial<AriaLabel> & {
10
12
  'aria-hidden': true | 'true';
11
13
  };
12
14
  export type AvatarProps = MergeRight<DsAvatarProps, (AriaLabel | AriaHidden) & {
15
+ 'data-color'?: DataColor;
16
+ 'data-color-variant'?: DataColorVariant;
13
17
  'data-size'?: '2xs' | '3xs' | DsAvatarProps['data-size'];
14
- 'data-color-variant'?: 'base' | 'surface-tinted';
15
- border?: 'solid' | 'dashed' | 'dotted' | 'double' | 'none';
18
+ 'border-style'?: 'solid' | 'dashed' | 'dotted' | 'double' | 'none';
16
19
  /**
17
20
  * Tooltip text to display on hover.
18
21
  */
@@ -21,6 +24,11 @@ export type AvatarProps = MergeRight<DsAvatarProps, (AriaLabel | AriaHidden) & {
21
24
  * When true, overlays a checkmark on the avatar with a subtle dimming effect.
22
25
  */
23
26
  checked?: boolean;
27
+ /**
28
+ * Renders a generated [boring avatar](https://boringavatars.com) in Kystverket's colors,
29
+ * seeded from `aria-label`. Ignored when `children` is set.
30
+ */
31
+ auto?: true | 'solid' | AvatarBoringVariant;
24
32
  }>;
25
33
  export declare const Avatar: FC<AvatarProps>;
26
34
  export {};
@@ -0,0 +1,10 @@
1
+ import { AvatarBoringVariant } from './Avatar';
2
+ /**
3
+ * Kystverket's avatar palette. boring-avatars needs hex strings (some variants compute
4
+ * contrast from them), so these are resolved token values rather than CSS variables.
5
+ */
6
+ export declare const boringColors: string[];
7
+ export declare const sizeClasses: (size: string) => string;
8
+ export declare const borderStyleClasses: (borderStyle: string | undefined) => string | undefined;
9
+ export declare const autoSolidStyles: (ariaLabel?: string) => Record<string, string>;
10
+ export declare const determineAutoMode: (auto: true | undefined | "solid" | AvatarBoringVariant, ariaLabel?: string) => AvatarBoringVariant | "solid";
@@ -14,4 +14,5 @@ export declare const WithImage: Story;
14
14
  export declare const InDropdown: Story;
15
15
  export declare const WithTooltip: Story;
16
16
  export declare const Checked: Story;
17
+ export declare const Boring: Story;
17
18
  export declare const AsLink: Story;
@@ -1,13 +1,34 @@
1
1
  import { ButtonProps as DsButtonProps } from '@digdir/designsystemet-react';
2
2
  import { FC } from 'react';
3
+ import { DataColor } from '~/main';
3
4
  export type ButtonProps = {
5
+ /**
6
+ * Visual style of the button.
7
+ *
8
+ * Styrbord deliberately and permanently names these differently from Designsystemet. The
9
+ * upstream names (`primary`/`secondary`/`tertiary`) read as emphasis levels and collide with
10
+ * `data-color="primary"`, which is a colour family — two unrelated things spelled the same way.
11
+ * Styrbord names the shape instead, which also leaves room for `subtle` and `dashed`, neither of
12
+ * which Designsystemet has.
13
+ *
14
+ * | Styrbord | Designsystemet |
15
+ * | ----------- | ---------------------- |
16
+ * | `filled` | `primary` |
17
+ * | `outline` | `secondary` |
18
+ * | `ghost` | `tertiary` |
19
+ * | `subtle` | `primary` + extra CSS |
20
+ * | `dashed` | `secondary` + extra CSS|
21
+ *
22
+ * Consequence of the divergence: the upstream `variant` prop is not forwarded, so Designsystemet
23
+ * examples need translating through the table above. Use this list, not theirs.
24
+ */
4
25
  variant?: 'filled' | 'subtle' | 'outline' | 'ghost' | 'dashed';
5
- color?: 'primary' | 'neutral' | 'danger';
26
+ color?: DataColor;
6
27
  size?: 'sm' | 'md' | 'lg';
7
28
  disabled?: boolean;
8
29
  text?: string;
9
30
  href?: string;
10
31
  target?: string;
11
32
  tooltip?: string;
12
- } & Omit<DsButtonProps, 'variant' | 'data-color' | 'data-size' | 'disabled'>;
33
+ } & Omit<DsButtonProps, 'variant' | 'data-size' | 'disabled'>;
13
34
  export declare const Button: FC<ButtonProps>;
@@ -23,6 +23,9 @@ export declare const Ghost: Story;
23
23
  export declare const Dashed: Story;
24
24
  export declare const Neutral: Story;
25
25
  export declare const Danger: Story;
26
+ export declare const DangerDashed: Story;
27
+ export declare const Lyng: Story;
28
+ export declare const LyngDashed: Story;
26
29
  export declare const LinkTo: Story;
27
30
  export declare const Small: Story;
28
31
  export declare const Medium: Story;
@@ -48,11 +48,7 @@ export declare const Disabled: {
48
48
  style?: React.CSSProperties | undefined;
49
49
  title?: string | undefined | undefined;
50
50
  pattern?: string | undefined | undefined;
51
- className?: string | undefined | undefined;
52
- width?: number | string | undefined | undefined;
53
51
  color?: string | undefined | undefined;
54
- 'data-size'?: (import("@digdir/designsystemet-types").Size | (string & {})) | undefined;
55
- 'data-color'?: (import("@digdir/designsystemet-types").Color | import("@digdir/designsystemet-types").SeverityColors | (string & {})) | undefined;
56
52
  defaultChecked?: boolean | undefined | undefined;
57
53
  defaultValue?: string | number | readonly string[] | undefined;
58
54
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -60,6 +56,7 @@ export declare const Disabled: {
60
56
  accessKey?: string | undefined | undefined;
61
57
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
62
58
  autoFocus?: boolean | undefined | undefined;
59
+ className?: string | undefined | undefined;
63
60
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
64
61
  contextMenu?: string | undefined | undefined;
65
62
  dir?: string | undefined | undefined;
@@ -323,6 +320,9 @@ export declare const Disabled: {
323
320
  onTransitionRunCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
324
321
  onTransitionStart?: React.TransitionEventHandler<HTMLInputElement> | undefined;
325
322
  onTransitionStartCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
323
+ width?: number | string | undefined | undefined;
324
+ 'data-color'?: (import("@digdir/designsystemet-types").Color | import("@digdir/designsystemet-types").SeverityColors | (string & {})) | undefined;
325
+ 'data-size'?: (import("@digdir/designsystemet-types").Size | (string & {})) | undefined;
326
326
  required?: boolean | undefined | undefined;
327
327
  height?: number | string | undefined | undefined;
328
328
  max?: number | string | undefined | undefined;
@@ -335,6 +335,7 @@ export declare const Disabled: {
335
335
  formMethod?: string | undefined | undefined;
336
336
  formNoValidate?: boolean | undefined | undefined;
337
337
  formTarget?: string | undefined | undefined;
338
+ multiple?: boolean | undefined | undefined;
338
339
  alt?: string | undefined | undefined;
339
340
  accept?: string | undefined | undefined;
340
341
  autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
@@ -342,7 +343,6 @@ export declare const Disabled: {
342
343
  checked?: boolean | undefined | undefined;
343
344
  maxLength?: number | undefined | undefined;
344
345
  minLength?: number | undefined | undefined;
345
- multiple?: boolean | undefined | undefined;
346
346
  placeholder?: string | undefined | undefined;
347
347
  readOnly?: boolean | undefined;
348
348
  'data-indeterminate'?: boolean | undefined;
@@ -366,11 +366,7 @@ export declare const Disabled: {
366
366
  style?: React.CSSProperties | undefined;
367
367
  title?: string | undefined | undefined;
368
368
  pattern?: string | undefined | undefined;
369
- className?: string | undefined | undefined;
370
- width?: number | string | undefined | undefined;
371
369
  color?: string | undefined | undefined;
372
- 'data-size'?: (import("@digdir/designsystemet-types").Size | (string & {})) | undefined;
373
- 'data-color'?: (import("@digdir/designsystemet-types").Color | import("@digdir/designsystemet-types").SeverityColors | (string & {})) | undefined;
374
370
  defaultChecked?: boolean | undefined | undefined;
375
371
  defaultValue?: string | number | readonly string[] | undefined;
376
372
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -378,6 +374,7 @@ export declare const Disabled: {
378
374
  accessKey?: string | undefined | undefined;
379
375
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
380
376
  autoFocus?: boolean | undefined | undefined;
377
+ className?: string | undefined | undefined;
381
378
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
382
379
  contextMenu?: string | undefined | undefined;
383
380
  dir?: string | undefined | undefined;
@@ -641,6 +638,9 @@ export declare const Disabled: {
641
638
  onTransitionRunCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
642
639
  onTransitionStart?: React.TransitionEventHandler<HTMLInputElement> | undefined;
643
640
  onTransitionStartCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
641
+ width?: number | string | undefined | undefined;
642
+ 'data-color'?: (import("@digdir/designsystemet-types").Color | import("@digdir/designsystemet-types").SeverityColors | (string & {})) | undefined;
643
+ 'data-size'?: (import("@digdir/designsystemet-types").Size | (string & {})) | undefined;
644
644
  required?: boolean | undefined | undefined;
645
645
  height?: number | string | undefined | undefined;
646
646
  max?: number | string | undefined | undefined;
@@ -653,6 +653,7 @@ export declare const Disabled: {
653
653
  formMethod?: string | undefined | undefined;
654
654
  formNoValidate?: boolean | undefined | undefined;
655
655
  formTarget?: string | undefined | undefined;
656
+ multiple?: boolean | undefined | undefined;
656
657
  alt?: string | undefined | undefined;
657
658
  accept?: string | undefined | undefined;
658
659
  autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
@@ -660,7 +661,6 @@ export declare const Disabled: {
660
661
  checked?: boolean | undefined | undefined;
661
662
  maxLength?: number | undefined | undefined;
662
663
  minLength?: number | undefined | undefined;
663
- multiple?: boolean | undefined | undefined;
664
664
  placeholder?: string | undefined | undefined;
665
665
  readOnly?: boolean | undefined;
666
666
  'data-indeterminate'?: boolean | undefined;
@@ -684,11 +684,7 @@ export declare const Disabled: {
684
684
  style?: React.CSSProperties | undefined;
685
685
  title?: string | undefined | undefined;
686
686
  pattern?: string | undefined | undefined;
687
- className?: string | undefined | undefined;
688
- width?: number | string | undefined | undefined;
689
687
  color?: string | undefined | undefined;
690
- 'data-size'?: (import("@digdir/designsystemet-types").Size | (string & {})) | undefined;
691
- 'data-color'?: (import("@digdir/designsystemet-types").Color | import("@digdir/designsystemet-types").SeverityColors | (string & {})) | undefined;
692
688
  defaultChecked?: boolean | undefined | undefined;
693
689
  defaultValue?: string | number | readonly string[] | undefined;
694
690
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -696,6 +692,7 @@ export declare const Disabled: {
696
692
  accessKey?: string | undefined | undefined;
697
693
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
698
694
  autoFocus?: boolean | undefined | undefined;
695
+ className?: string | undefined | undefined;
699
696
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
700
697
  contextMenu?: string | undefined | undefined;
701
698
  dir?: string | undefined | undefined;
@@ -959,6 +956,9 @@ export declare const Disabled: {
959
956
  onTransitionRunCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
960
957
  onTransitionStart?: React.TransitionEventHandler<HTMLInputElement> | undefined;
961
958
  onTransitionStartCapture?: React.TransitionEventHandler<HTMLInputElement> | undefined;
959
+ width?: number | string | undefined | undefined;
960
+ 'data-color'?: (import("@digdir/designsystemet-types").Color | import("@digdir/designsystemet-types").SeverityColors | (string & {})) | undefined;
961
+ 'data-size'?: (import("@digdir/designsystemet-types").Size | (string & {})) | undefined;
962
962
  required?: boolean | undefined | undefined;
963
963
  height?: number | string | undefined | undefined;
964
964
  max?: number | string | undefined | undefined;
@@ -971,6 +971,7 @@ export declare const Disabled: {
971
971
  formMethod?: string | undefined | undefined;
972
972
  formNoValidate?: boolean | undefined | undefined;
973
973
  formTarget?: string | undefined | undefined;
974
+ multiple?: boolean | undefined | undefined;
974
975
  alt?: string | undefined | undefined;
975
976
  accept?: string | undefined | undefined;
976
977
  autoComplete?: React.HTMLInputAutoCompleteAttribute | undefined;
@@ -978,7 +979,6 @@ export declare const Disabled: {
978
979
  checked?: boolean | undefined | undefined;
979
980
  maxLength?: number | undefined | undefined;
980
981
  minLength?: number | undefined | undefined;
981
- multiple?: boolean | undefined | undefined;
982
982
  placeholder?: string | undefined | undefined;
983
983
  readOnly?: boolean | undefined;
984
984
  'data-indeterminate'?: boolean | undefined;
@@ -11,15 +11,13 @@ type ChipStoryArgs = {
11
11
  type ChipColor = NonNullable<ChipButtonProps['data-color']>;
12
12
  declare const meta: {
13
13
  title: string;
14
- component: React.FC<Omit<import("@digdir/designsystemet-react").DefaultProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type">, keyof {
14
+ component: React.ForwardRefExoticComponent<Omit<import("@digdir/designsystemet-react").DefaultProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type">, keyof {
15
15
  asChild?: boolean;
16
16
  'data-wrap'?: "nowrap" | "wrap";
17
17
  }> & {
18
18
  asChild?: boolean;
19
19
  'data-wrap'?: "nowrap" | "wrap";
20
- } & {
21
- ref?: React.Ref<HTMLLabelElement>;
22
- }>;
20
+ } & React.RefAttributes<HTMLLabelElement>>;
23
21
  tags: string[];
24
22
  parameters: {
25
23
  customStyles: {
@@ -48,9 +46,7 @@ export declare const Checkbox: {
48
46
  }> & {
49
47
  asChild?: boolean;
50
48
  'data-wrap'?: "nowrap" | "wrap";
51
- } & {
52
- ref?: React.Ref<HTMLLabelElement>;
53
- }) => React.JSX.Element;
49
+ } & React.RefAttributes<HTMLLabelElement>) => React.JSX.Element;
54
50
  };
55
51
  export declare const Removable: {
56
52
  render: (args: Omit<import("@digdir/designsystemet-react").DefaultProps & React.ButtonHTMLAttributes<HTMLButtonElement>, keyof {
@@ -59,9 +55,7 @@ export declare const Removable: {
59
55
  }> & {
60
56
  asChild?: boolean;
61
57
  'data-wrap'?: "nowrap" | "wrap";
62
- } & {
63
- ref?: React.Ref<HTMLButtonElement>;
64
- }) => React.JSX.Element;
58
+ } & React.RefAttributes<HTMLButtonElement>) => React.JSX.Element;
65
59
  args: {
66
60
  'aria-label': string;
67
61
  };
@@ -73,9 +67,7 @@ export declare const Button: {
73
67
  }> & {
74
68
  asChild?: boolean;
75
69
  'data-wrap'?: "nowrap" | "wrap";
76
- } & {
77
- ref?: React.Ref<HTMLButtonElement>;
78
- }) => React.JSX.Element;
70
+ } & React.RefAttributes<HTMLButtonElement>) => React.JSX.Element;
79
71
  parameters: {
80
72
  customStyles: {
81
73
  flexWrap: string;
@@ -1,5 +1,5 @@
1
1
  import type { StoryObj } from '@storybook/react-vite';
2
- import { DetailsProps } from '@digdir/designsystemet-react';
2
+ import { DetailsProps } from '~/main';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  component: React.ForwardRefExoticComponent<DetailsProps & React.RefAttributes<HTMLDetailsElement>> & {
@@ -23,3 +23,4 @@ export default meta;
23
23
  type Story = StoryObj<typeof meta>;
24
24
  export declare const Default: Story;
25
25
  export declare const InCard: Story;
26
+ export declare const WithColors: Story;
@@ -1,7 +1,7 @@
1
1
  import { DialogBlock, DialogTrigger, DialogTriggerContext, type DialogProps as DSDialogProps } from '@digdir/designsystemet-react';
2
2
  export type DialogSize = 'sm' | 'md' | 'lg';
3
3
  export type DialogProps = DSDialogProps & {
4
- size?: DialogSize;
4
+ 'max-width'?: DialogSize;
5
5
  };
6
6
  declare const DialogRoot: React.ForwardRefExoticComponent<Omit<import("@digdir/designsystemet-react").DefaultProps & React.DialogHTMLAttributes<HTMLDialogElement>, "asChild" | "open" | "onClose" | "placement" | "closeButton" | "closedby" | "modal"> & {
7
7
  closeButton?: string | false;
@@ -12,7 +12,7 @@ declare const DialogRoot: React.ForwardRefExoticComponent<Omit<import("@digdir/d
12
12
  onClose?: (event: Event) => void;
13
13
  asChild?: boolean;
14
14
  } & {
15
- size?: DialogSize;
15
+ 'max-width'?: DialogSize;
16
16
  } & React.RefAttributes<HTMLDialogElement>>;
17
17
  type DialogComponent = typeof DialogRoot & {
18
18
  TriggerContext: typeof DialogTriggerContext;
@@ -11,13 +11,13 @@ declare const _default: {
11
11
  onClose?: (event: Event) => void;
12
12
  asChild?: boolean;
13
13
  } & {
14
- size?: import("~/main").DialogSize;
14
+ 'max-width'?: import("~/main").DialogSize;
15
15
  } & React.RefAttributes<HTMLDialogElement>> & {
16
16
  TriggerContext: {
17
17
  (rest: import("@digdir/designsystemet-react").DialogTriggerContextProps): import("react").JSX.Element;
18
18
  displayName: string;
19
19
  };
20
- Trigger: React.ForwardRefExoticComponent<Omit<Omit<import("@digdir/designsystemet-react").DefaultProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "command" | "commandfor" | "commandFor">, "asChild" | "loading" | "variant" | "type" | "icon" | "command" | "commandfor" | "commandFor"> & {
20
+ Trigger: React.ForwardRefExoticComponent<Omit<Omit<import("@digdir/designsystemet-react").DefaultProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "command" | "commandfor" | "commandFor">, "asChild" | "loading" | "type" | "variant" | "icon" | "command" | "commandfor" | "commandFor"> & {
21
21
  variant?: "primary" | "secondary" | "tertiary";
22
22
  icon?: boolean;
23
23
  loading?: boolean | import("react").ReactNode;
@@ -18,7 +18,7 @@ export interface NumberInputProps {
18
18
  min?: number;
19
19
  max?: number;
20
20
  align?: 'left' | 'right';
21
- size?: InputSize;
21
+ width?: InputSize;
22
22
  id?: string;
23
23
  }
24
- export declare const NumberInput: ({ size, inputMode, className, align, ...props }: NumberInputProps) => React.JSX.Element;
24
+ export declare const NumberInput: ({ width, inputMode, className, align, ...props }: NumberInputProps) => React.JSX.Element;
@@ -1,21 +1,18 @@
1
1
  import type { StoryObj } from '@storybook/react-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ size, strong, weight, "data-color-subtle": colorSubtle, className, children, ...props }: import("~/main").ParagraphProps) => React.JSX.Element;
4
+ component: React.ForwardRefExoticComponent<{
5
+ 'data-size'?: "xs" | "sm" | "md" | "lg" | "xl";
6
+ variant?: "long" | "default" | "short";
7
+ asChild?: boolean;
8
+ } & React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
5
9
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
6
10
  tags: string[];
7
11
  argTypes: {
8
- size: {
12
+ 'data-size': {
9
13
  control: "select";
10
14
  options: string[];
11
15
  };
12
- weight: {
13
- control: "select";
14
- options: (string | undefined)[];
15
- };
16
- 'data-color-subtle': {
17
- control: "boolean";
18
- };
19
16
  };
20
17
  };
21
18
  export default meta;
@@ -1,10 +1,9 @@
1
1
  import { TagProps as DsTagProps } from '@digdir/designsystemet-react';
2
2
  import { IconId } from '~/components/kystverket/Icon/icon.types';
3
3
  export type TagProps = DsTagProps & {
4
- bordered?: boolean;
5
- rounded?: boolean;
4
+ radius?: 'sm' | 'md' | 'lg' | 'full';
6
5
  icon?: IconId;
7
- plainBackground?: boolean;
6
+ 'data-color-transparent'?: boolean;
8
7
  };
9
- declare const Tag: ({ bordered, rounded, plainBackground, icon, children, className, ...props }: TagProps) => React.JSX.Element;
8
+ declare const Tag: ({ radius, icon, children, className, ...props }: TagProps) => React.JSX.Element;
10
9
  export default Tag;
@@ -3,7 +3,7 @@ import type { StoryFn, StoryObj } from '@storybook/react-vite';
3
3
  type Story = StoryObj<typeof Tag>;
4
4
  declare const _default: {
5
5
  title: string;
6
- component: ({ bordered, rounded, plainBackground, icon, children, className, ...props }: TagProps) => React.JSX.Element;
6
+ component: ({ radius, icon, children, className, ...props }: TagProps) => React.JSX.Element;
7
7
  tags: string[];
8
8
  parameters: {
9
9
  customStyles: {
@@ -16,7 +16,7 @@ export interface TextAreaProps {
16
16
  inputMode?: 'email' | 'tel' | 'search' | 'text' | 'none' | 'url' | 'numeric' | 'decimal';
17
17
  maxLength?: number;
18
18
  minHeight?: 'sm' | 'md' | 'lg';
19
- size?: InputSize;
19
+ width?: InputSize;
20
20
  id?: string;
21
21
  }
22
- export declare const TextArea: ({ size, className, label, required, optional, onChange, value, maxLength, minHeight, error, ...props }: TextAreaProps) => React.JSX.Element;
22
+ export declare const TextArea: ({ width, className, label, required, optional, onChange, value, maxLength, minHeight, error, ...props }: TextAreaProps) => React.JSX.Element;
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react-vite';
2
2
  import { TextAreaProps } from './TextArea';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ size, className, label, required, optional, onChange, value, maxLength, minHeight, error, ...props }: TextAreaProps) => React.JSX.Element;
5
+ component: ({ width, className, label, required, optional, onChange, value, maxLength, minHeight, error, ...props }: TextAreaProps) => React.JSX.Element;
6
6
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
7
7
  tags: string[];
8
8
  argTypes: {};
@@ -19,7 +19,7 @@ export interface TextInputProps {
19
19
  suffix?: string;
20
20
  id?: string;
21
21
  type?: 'email' | 'hidden' | 'password' | 'tel' | 'text' | 'time' | 'url';
22
- size?: InputSize;
22
+ width?: InputSize;
23
23
  autoComplete?: HTMLInputAutoCompleteAttribute;
24
24
  }
25
- export declare const TextInput: ({ size, type, className, label, loading, required, optional, onChange, value, ...props }: TextInputProps) => React.JSX.Element;
25
+ export declare const TextInput: ({ width, type, className, label, loading, required, optional, onChange, value, ...props }: TextInputProps) => React.JSX.Element;
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react-vite';
2
2
  import { TextInputProps } from './TextInput';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ size, type, className, label, loading, required, optional, onChange, value, ...props }: TextInputProps) => React.JSX.Element;
5
+ component: ({ width, type, className, label, loading, required, optional, onChange, value, ...props }: TextInputProps) => React.JSX.Element;
6
6
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
7
7
  tags: string[];
8
8
  argTypes: {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
+ import { DataColor } from '~/main';
2
3
  import { AlertProps as DsAlertProps } from '@digdir/designsystemet-react';
3
4
  export type AlertProps = DsAlertProps & {
4
- level?: 'info' | 'success' | 'warning' | 'error';
5
5
  title?: string;
6
6
  text?: string;
7
7
  children?: React.ReactNode;
@@ -10,8 +10,8 @@ export type AlertProps = DsAlertProps & {
10
10
  className?: string;
11
11
  role?: 'status';
12
12
  onDismiss?: () => void;
13
- bordered?: boolean;
14
- rounded?: boolean;
13
+ 'border-style'?: 'none' | 'solid';
14
+ 'data-color'?: DataColor;
15
15
  };
16
- declare const Alert: ({ level, title, "data-size": dataSize, text, width, className, bordered, rounded, ...props }: AlertProps) => React.JSX.Element;
16
+ declare const Alert: ({ title, "data-size": dataSize, text, width, className, "border-style": borderStyle, ...props }: AlertProps) => React.JSX.Element;
17
17
  export default Alert;
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react-vite';
2
2
  import { AlertProps } from './alert';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ level, title, "data-size": dataSize, text, width, className, bordered, rounded, ...props }: AlertProps) => React.JSX.Element;
5
+ component: ({ title, "data-size": dataSize, text, width, className, "border-style": borderStyle, ...props }: AlertProps) => React.JSX.Element;
6
6
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
7
7
  tags: string[];
8
8
  argTypes: {};
@@ -27,3 +27,4 @@ export declare const LargeSizeWithDismiss: Story;
27
27
  export declare const DefaultKort: Story;
28
28
  export declare const WithErrorDismiss: Story;
29
29
  export declare const WithoutBorderAndRoundedCorners: Story;
30
+ export declare const Lyng: Story;
@@ -31,6 +31,16 @@ type HorizontalBoxProps = BaseBoxProps & {
31
31
  horizontal: true | ScreenSize;
32
32
  justify?: 'start' | 'center' | 'end' | 'between' | 'stretch';
33
33
  };
34
+ /** @deprecated Use `SurfaceProps`. `Box` will be removed in a future major version. */
34
35
  export type BoxProps = (VerticalBoxProps | HorizontalBoxProps) & SpacingProps & BorderRadiusProps & BorderWidthProps & BoxStyleProps;
36
+ /**
37
+ * **Replaced by `Surface`.** `Box` will be removed in a future major version — use `Surface` for all new code.
38
+ *
39
+ * Spacing on `Box` is in pixels; on `Surface` it is a step on the Designsystemet size scale, so divide by 4:
40
+ * `gap={16}` → `gap={4}`, `p={24}` → `p={6}`. `color="danger"` becomes
41
+ * `data-color="danger" data-color-variant="subtle"`.
42
+ *
43
+ * @deprecated Use `Surface`. `Box` will be removed in a future major version.
44
+ */
35
45
  declare const Box: ({ className, radius, width, gap, wrap, align, grow, shrink, basis, show, hide, container, children, ...props }: BoxProps) => React.JSX.Element;
36
46
  export default Box;
@@ -5,14 +5,14 @@ declare const meta: {
5
5
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
6
6
  tags: string[];
7
7
  argTypes: {
8
- variant: {
9
- options: ("default" | "tinted")[];
8
+ 'data-color-variant': {
9
+ options: ("base" | "tinted")[];
10
10
  control: {
11
11
  type: "radio";
12
12
  };
13
13
  };
14
- color: {
15
- options: ("main" | "neutral")[];
14
+ 'data-color': {
15
+ options: ("info" | "warning" | "lyng" | "hav" | "stein" | "gress" | "sol" | "himmel" | "sand" | "fyr" | "dyphav" | "skog" | "primary" | "accent" | "neutral" | "extra1" | "extra2" | "success" | "danger" | "focus")[];
16
16
  control: {
17
17
  type: "radio";
18
18
  };
@@ -23,15 +23,15 @@ declare const meta: {
23
23
  type: "select";
24
24
  };
25
25
  };
26
- headingSize: {
27
- options: string[];
26
+ icon: {
28
27
  control: {
29
- type: "select";
28
+ type: "text";
30
29
  };
31
30
  };
32
- icon: {
31
+ 'data-size': {
32
+ options: string[];
33
33
  control: {
34
- type: "text";
34
+ type: "radio";
35
35
  };
36
36
  };
37
37
  };
@@ -39,6 +39,7 @@ declare const meta: {
39
39
  export default meta;
40
40
  type Story = StoryObj<typeof meta>;
41
41
  export declare const Default: Story;
42
+ export declare const Sizes: StoryFn;
42
43
  export declare const ColorVariants: StoryFn;
43
44
  export declare const Eksempel: StoryFn;
44
45
  export declare const AsLink: Story;
@@ -1,18 +1,17 @@
1
+ import { DataColor, DataColorVariant } from '~/main';
1
2
  import type { IconId } from '../Icon/icon.types';
2
- export type ClickableCardColor = 'neutral' | 'main';
3
- export type ClickableCardVariant = 'default' | 'tinted';
4
3
  export type ClickableCardHeadingSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
5
4
  type ClickableCardBaseProps = {
6
5
  heading: string;
7
6
  description?: string;
8
7
  children?: React.ReactNode;
9
- variant?: ClickableCardVariant;
10
- color?: ClickableCardColor;
8
+ 'data-size'?: 'sm' | 'md' | 'lg';
9
+ 'data-color-variant'?: DataColorVariant;
10
+ 'data-color'?: DataColor;
11
11
  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
12
- headingSize?: ClickableCardHeadingSize;
13
12
  icon?: IconId;
14
13
  chevron?: boolean;
15
- showBorder?: boolean;
14
+ 'border-style'?: 'none' | 'solid';
16
15
  className?: string;
17
16
  'aria-label'?: string;
18
17
  };
@@ -12,8 +12,8 @@ export interface DateTimePickerProps {
12
12
  onChange?: (date: Date | undefined) => void;
13
13
  minDate?: Date;
14
14
  maxDate?: Date;
15
- size?: InputSize;
15
+ width?: InputSize;
16
16
  disabled?: boolean;
17
17
  readOnly?: boolean;
18
18
  }
19
- export declare const DateTimePicker: ({ size, className, label, loading, required, optional, onChange, value, minDate, maxDate, ...props }: DateTimePickerProps) => React.JSX.Element;
19
+ export declare const DateTimePicker: ({ width, className, label, loading, required, optional, onChange, value, minDate, maxDate, ...props }: DateTimePickerProps) => React.JSX.Element;
@@ -17,13 +17,13 @@ declare const meta: {
17
17
  onChange?: ((date: Date | undefined) => void) | undefined;
18
18
  minDate?: Date | undefined;
19
19
  maxDate?: Date | undefined;
20
- size?: InputSize | undefined;
20
+ width?: InputSize | undefined;
21
21
  disabled?: boolean | undefined;
22
22
  readOnly?: boolean | undefined;
23
23
  }>) => React.JSX.Element))[];
24
24
  tags: string[];
25
25
  argTypes: {
26
- size: {
26
+ width: {
27
27
  control: "select";
28
28
  options: InputSize[];
29
29
  };
@@ -2,7 +2,7 @@ import { InputSize } from '~/main';
2
2
  export interface DatepickerProps {
3
3
  className?: string;
4
4
  loading?: boolean;
5
- size?: InputSize;
5
+ width?: InputSize;
6
6
  optional?: boolean | string;
7
7
  required?: boolean | string;
8
8
  label: string;
@@ -16,4 +16,4 @@ export interface DatepickerProps {
16
16
  disabled?: boolean;
17
17
  readOnly?: boolean;
18
18
  }
19
- export declare const Datepicker: ({ size, className, label, loading, required, optional, onChange, value, minDate, maxDate, ...props }: DatepickerProps) => React.JSX.Element;
19
+ export declare const Datepicker: ({ width, className, label, loading, required, optional, onChange, value, minDate, maxDate, ...props }: DatepickerProps) => React.JSX.Element;