@kystverket/styrbord 2.19.0 → 2.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.
Files changed (142) hide show
  1. package/dist/docs/skjema.md +11 -5
  2. package/dist/src/components/deprecated/Card/Card.d.ts +3 -3
  3. package/dist/src/components/deprecated/Card/Card.stories.d.ts +4 -4
  4. package/dist/src/components/deprecated/Details/Details.d.ts +1 -1
  5. package/dist/src/components/deprecated/Details/Details.stories.d.ts +2 -2
  6. package/dist/src/components/deprecated/ErrorLabel/errorLabel.d.ts +1 -1
  7. package/dist/src/components/deprecated/ErrorLabel/errorLabel.stories.d.ts +2 -2
  8. package/dist/src/components/deprecated/InputLabel/inputLabel.d.ts +1 -1
  9. package/dist/src/components/deprecated/InputLabel/inputLabel.stories.d.ts +2 -2
  10. package/dist/src/components/designsystemet/Avatar/Avatar.context.d.ts +2 -2
  11. package/dist/src/components/designsystemet/AvatarStack/AvatarStack.d.ts +1 -1
  12. package/dist/src/components/designsystemet/Button/Button.stories.d.ts +2 -2
  13. package/dist/src/components/designsystemet/Card/Card.stories.d.ts +11 -4
  14. package/dist/src/components/designsystemet/CardTitle/CardTitle.d.ts +1 -1
  15. package/dist/src/components/designsystemet/Checkbox/Checkbox.stories.d.ts +527 -527
  16. package/dist/src/components/designsystemet/Chip/Chip.stories.d.ts +10 -22
  17. package/dist/src/components/designsystemet/Details/Details.stories.d.ts +2 -2
  18. package/dist/src/components/designsystemet/Dialog/Dialog.d.ts +2 -2
  19. package/dist/src/components/designsystemet/Dialog/Dialog.stories.d.ts +2 -2
  20. package/dist/src/components/designsystemet/IconButton/IconButton.stories.d.ts +2 -2
  21. package/dist/src/components/designsystemet/Link/Link.d.ts +5 -1
  22. package/dist/src/components/designsystemet/List/List.stories.d.ts +9 -2
  23. package/dist/src/components/designsystemet/NumberInput/NumberInput.d.ts +1 -1
  24. package/dist/src/components/designsystemet/NumberInput/NumberInput.stories.d.ts +2 -2
  25. package/dist/src/components/designsystemet/Paragraph/typography.paragraph.stories.d.ts +10 -3
  26. package/dist/src/components/designsystemet/Popover/Popover.stories.d.ts +2 -2
  27. package/dist/src/components/designsystemet/Select/Select.d.ts +1 -1
  28. package/dist/src/components/designsystemet/Select/Select.stories.d.ts +2 -2
  29. package/dist/src/components/designsystemet/Suggestion/Suggestion.d.ts +1 -1
  30. package/dist/src/components/designsystemet/Suggestion/Suggestion.stories.d.ts +9 -9
  31. package/dist/src/components/designsystemet/Table/Table.d.ts +9 -9
  32. package/dist/src/components/designsystemet/Tabs/Tabs.d.ts +6 -6
  33. package/dist/src/components/designsystemet/Tag/Tag.d.ts +1 -1
  34. package/dist/src/components/designsystemet/Tag/Tag.stories.d.ts +3 -1
  35. package/dist/src/components/designsystemet/TextArea/TextArea.d.ts +1 -1
  36. package/dist/src/components/designsystemet/TextArea/TextArea.stories.d.ts +2 -2
  37. package/dist/src/components/designsystemet/TextInput/TextInput.d.ts +1 -1
  38. package/dist/src/components/designsystemet/TextInput/TextInput.stories.d.ts +2 -2
  39. package/dist/src/components/kystverket/Alert/alert.stories.d.ts +2 -2
  40. package/dist/src/components/kystverket/BorderedRadioGroup/borderedRadioGroup.d.ts +1 -1
  41. package/dist/src/components/kystverket/BorderedRadioGroup/borderedRadioGroup.stories.d.ts +2 -2
  42. package/dist/src/components/kystverket/BorderedToggleGroup/borderedToggleGroup.d.ts +1 -1
  43. package/dist/src/components/kystverket/BorderedToggleGroup/borderedToggleGroup.stories.d.ts +2 -2
  44. package/dist/src/components/kystverket/Box/box.d.ts +1 -1
  45. package/dist/src/components/kystverket/Box/box.stories.d.ts +2 -2
  46. package/dist/src/components/kystverket/ClickableCard/ClickableCard.d.ts +1 -1
  47. package/dist/src/components/kystverket/ClickableCard/ClickableCard.stories.d.ts +2 -2
  48. package/dist/src/components/kystverket/ColorSchemeToggle/ColorSchemeToggle.d.ts +2 -2
  49. package/dist/src/components/kystverket/ColorSchemeToggle/ColorSchemeToggle.stories.d.ts +7 -1
  50. package/dist/src/components/kystverket/ColorSchemeToggle/ColorSchemeToggle.types.d.ts +11 -2
  51. package/dist/src/components/kystverket/ColorTokenCollections/ColorTokenCollections.stories.d.ts +2 -2
  52. package/dist/src/components/kystverket/ColorTokenCollections/Colors.stories.d.ts +2 -2
  53. package/dist/src/components/kystverket/CompactDetails/CompactDetails.d.ts +1 -1
  54. package/dist/src/components/kystverket/CompactDetails/CompactDetails.stories.d.ts +2 -2
  55. package/dist/src/components/kystverket/DateAndTimePickers/DateTimePicker/DateTimePicker.d.ts +5 -1
  56. package/dist/src/components/kystverket/DateAndTimePickers/DateTimePicker/DateTimePicker.stories.d.ts +10 -3
  57. package/dist/src/components/kystverket/DateAndTimePickers/Datepicker/Datepicker.d.ts +3 -1
  58. package/dist/src/components/kystverket/DateAndTimePickers/Datepicker/Datepicker.stories.d.ts +10 -3
  59. package/dist/src/components/kystverket/DateAndTimePickers/PickerControl/PickerControl.d.ts +29 -0
  60. package/dist/src/components/kystverket/DateAndTimePickers/PickerControl/pickerKinds.d.ts +53 -0
  61. package/dist/src/components/kystverket/DateAndTimePickers/PickerControl/usePickerText.d.ts +27 -0
  62. package/dist/src/components/kystverket/DateAndTimePickers/TimePicker/TimePicker.d.ts +12 -1
  63. package/dist/src/components/kystverket/DateAndTimePickers/TimePicker/TimePicker.stories.d.ts +10 -3
  64. package/dist/src/components/kystverket/FilePreviewer/FilePreviewer-context.d.ts +2 -2
  65. package/dist/src/components/kystverket/FilePreviewer/FilePreviewer.stories.d.ts +2 -2
  66. package/dist/src/components/kystverket/FilePreviewer/dialog/FilePreviewer-dialog.d.ts +1 -1
  67. package/dist/src/components/kystverket/FilePreviewer/panel/FilePreviewer-panel.d.ts +1 -1
  68. package/dist/src/components/kystverket/FilePreviewer/renderer/FileRenderer.d.ts +1 -1
  69. package/dist/src/components/kystverket/FilePreviewer/thumbnail/FilePreviewer-thumbnail.d.ts +1 -1
  70. package/dist/src/components/kystverket/FileUploader/FileRetriever.context.d.ts +1 -1
  71. package/dist/src/components/kystverket/FileUploader/FileUploader.context.d.ts +1 -1
  72. package/dist/src/components/kystverket/FileUploader/FileUploader.d.ts +1 -1
  73. package/dist/src/components/kystverket/FileUploader/FileUploader.stories.d.ts +4 -4
  74. package/dist/src/components/kystverket/FileUploader/existingFilesDialog/ExistingFilesDialog.d.ts +1 -1
  75. package/dist/src/components/kystverket/FileUploader/fileUploadActions/FileUploadActions.d.ts +1 -1
  76. package/dist/src/components/kystverket/FileUploader/item/FileUploaderItem.d.ts +1 -1
  77. package/dist/src/components/kystverket/Footer/Footer.d.ts +1 -1
  78. package/dist/src/components/kystverket/Footer/Footer.stories.d.ts +1 -1
  79. package/dist/src/components/kystverket/Header/Header.d.ts +2 -2
  80. package/dist/src/components/kystverket/Header/Header.stories.d.ts +1 -1
  81. package/dist/src/components/kystverket/Header/HeaderApps.d.ts +1 -1
  82. package/dist/src/components/kystverket/Header/HeaderAvatar.d.ts +1 -1
  83. package/dist/src/components/kystverket/Header/HeaderMobile.d.ts +1 -1
  84. package/dist/src/components/kystverket/Header/HeaderProfile.d.ts +1 -1
  85. package/dist/src/components/kystverket/Header/headerContext.d.ts +2 -2
  86. package/dist/src/components/kystverket/Icon/FileIcon.d.ts +1 -1
  87. package/dist/src/components/kystverket/Icon/Icon.stories.d.ts +2 -2
  88. package/dist/src/components/kystverket/Icon/icon.d.ts +1 -1
  89. package/dist/src/components/kystverket/Image/svgImage.d.ts +55 -55
  90. package/dist/src/components/kystverket/Image/svgImage.stories.d.ts +2 -2
  91. package/dist/src/components/kystverket/KyvDivider/KyvDivider.d.ts +1 -1
  92. package/dist/src/components/kystverket/KyvDivider/KyvDivider.stories.d.ts +2 -2
  93. package/dist/src/components/kystverket/KyvSpinner/KyvSpinner.stories.d.ts +2 -2
  94. package/dist/src/components/kystverket/LabelContent/labelContent.d.ts +1 -1
  95. package/dist/src/components/kystverket/LabelContent/labelContent.stories.d.ts +2 -2
  96. package/dist/src/components/kystverket/Logo/Logo.d.ts +1 -1
  97. package/dist/src/components/kystverket/Logo/Logo.stories.d.ts +1 -1
  98. package/dist/src/components/kystverket/MarkdownToReact/markdownToReact.d.ts +1 -1
  99. package/dist/src/components/kystverket/MarkdownToReact/markdownToReact.stories.d.ts +3 -3
  100. package/dist/src/components/kystverket/PageHeading/PageHeading.d.ts +1 -1
  101. package/dist/src/components/kystverket/PageHeading/PageHeading.stories.d.ts +1 -1
  102. package/dist/src/components/kystverket/RichTextArea/components/LinkEditor/linkEditor.d.ts +1 -1
  103. package/dist/src/components/kystverket/RichTextArea/components/LinkEditor/linkEditor.stories.d.ts +2 -2
  104. package/dist/src/components/kystverket/RichTextArea/components/Toolbar/toolbar.d.ts +1 -1
  105. package/dist/src/components/kystverket/RichTextArea/components/Toolbar/toolbar.stories.d.ts +3 -3
  106. package/dist/src/components/kystverket/RichTextArea/richTextArea.d.ts +1 -1
  107. package/dist/src/components/kystverket/RichTextArea/richTextArea.stories.d.ts +5 -5
  108. package/dist/src/components/kystverket/SaksbehandlingShell/ItemCard/ItemCard.d.ts +1 -1
  109. package/dist/src/components/kystverket/SaksbehandlingShell/ItemList/ItemList.d.ts +1 -1
  110. package/dist/src/components/kystverket/SaksbehandlingShell/SaksbehandlingShell.d.ts +1 -1
  111. package/dist/src/components/kystverket/SaksbehandlingShell/SaksbehandlingShell.stories.d.ts +1 -1
  112. package/dist/src/components/kystverket/SaksbehandlingShell/ShellSideSheet/ShellSideSheet.d.ts +2 -2
  113. package/dist/src/components/kystverket/SideSheet/Buttons/ButtonsContext.d.ts +2 -2
  114. package/dist/src/components/kystverket/SideSheet/Layout/SideSheetLayout.d.ts +7 -2
  115. package/dist/src/components/kystverket/SideSheet/ResizeHandle/ResizeHandle.d.ts +3 -1
  116. package/dist/src/components/kystverket/SideSheet/SideSheet.d.ts +1 -1
  117. package/dist/src/components/kystverket/SideSheet/SideSheet.stories.d.ts +9 -6
  118. package/dist/src/components/kystverket/SideSheet/SideSheet.types.d.ts +11 -0
  119. package/dist/src/components/kystverket/Skillingsbuoye/skillingsbuoye.stories.d.ts +2 -2
  120. package/dist/src/components/kystverket/SlotDialog/Buttons/ButtonsContext.d.ts +2 -2
  121. package/dist/src/components/kystverket/SlotDialog/SlotDialog.d.ts +1 -1
  122. package/dist/src/components/kystverket/SlotDialog/SlotDialog.stories.d.ts +1 -1
  123. package/dist/src/components/kystverket/SprakProvider/SprakProviderAlt.stories.d.ts +2 -2
  124. package/dist/src/components/kystverket/SprakProvider/SprakProviderLink.stories.d.ts +2 -2
  125. package/dist/src/components/kystverket/Stepper/stepper.stories.d.ts +2 -2
  126. package/dist/src/components/kystverket/Summary/summary.d.ts +1 -1
  127. package/dist/src/components/kystverket/Summary/summary.stories.d.ts +2 -2
  128. package/dist/src/components/kystverket/Surface/Surface.d.ts +2 -2
  129. package/dist/src/components/kystverket/Surface/Surface.stories.d.ts +3 -3
  130. package/dist/src/components/kystverket/Typography/typography.accent.stories.d.ts +2 -2
  131. package/dist/src/components/kystverket/Typography/typography.d.ts +3 -3
  132. package/dist/src/components/kystverket/Typography/typography.heading.stories.d.ts +10 -3
  133. package/dist/src/components/kystverket/Typography/typography.label.stories.d.ts +2 -2
  134. package/dist/src/hooks/useHorizontalDragScroll.d.ts +2 -2
  135. package/dist/src/main.d.ts +1 -1
  136. package/dist/src/translations.d.ts +1 -1
  137. package/dist/src/utils/idContext.d.ts +1 -1
  138. package/dist/storybook/styrbordDecorator.d.ts +1 -1
  139. package/dist/style.css +1 -1
  140. package/dist/style.js +3457 -3238
  141. package/dist/style.umd.cjs +12 -12
  142. package/package.json +1 -1
@@ -6,7 +6,7 @@ type StoryArgs = {
6
6
  declare const meta: {
7
7
  title: string;
8
8
  tags: string[];
9
- component: ({ colorScheme }: StoryArgs) => React.JSX.Element;
9
+ component: ({ colorScheme }: StoryArgs) => import("react").JSX.Element;
10
10
  args: {
11
11
  colorScheme: "light";
12
12
  };
@@ -26,7 +26,7 @@ declare const meta: {
26
26
  };
27
27
  };
28
28
  };
29
- render: (args: StoryArgs) => React.JSX.Element;
29
+ render: (args: StoryArgs) => import("react").JSX.Element;
30
30
  };
31
31
  export default meta;
32
32
  type Story = StoryObj<typeof meta>;
@@ -1,3 +1,3 @@
1
1
  import type { CompactDetailsProps } from './CompactDetails.types';
2
- declare const CompactDetails: ({ label, children, open, defaultOpen, onOpenChange, id, className, }: CompactDetailsProps) => React.JSX.Element;
2
+ declare const CompactDetails: ({ label, children, open, defaultOpen, onOpenChange, id, className, }: CompactDetailsProps) => import("react").JSX.Element;
3
3
  export default CompactDetails;
@@ -1,8 +1,8 @@
1
1
  import type { StoryObj } from '@storybook/react-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ label, children, open, defaultOpen, onOpenChange, id, className, }: import("~/main").CompactDetailsProps) => React.JSX.Element;
5
- decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
4
+ component: ({ label, children, open, defaultOpen, onOpenChange, id, className, }: import("~/main").CompactDetailsProps) => import("react").JSX.Element;
5
+ decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => import("react").JSX.Element)[];
6
6
  tags: string[];
7
7
  argTypes: {};
8
8
  parameters: {
@@ -7,15 +7,19 @@ export interface DateTimePickerProps {
7
7
  required?: boolean | string | undefined;
8
8
  label: string;
9
9
  description?: string;
10
+ /** Takes precedence over the built-in format and min/max messages. */
10
11
  error?: string;
11
12
  loading?: boolean;
12
13
  onBlur?: () => void;
13
14
  value: Date | undefined;
15
+ /** Called with a valid date and time, or `undefined` when the field is emptied or the typed text is invalid. */
14
16
  onChange?: (date: Date | undefined) => void;
17
+ /** Compared to the minute. */
15
18
  minDate?: Date;
19
+ /** Compared to the minute. */
16
20
  maxDate?: Date;
17
21
  width?: InputSize;
18
22
  disabled?: boolean;
19
23
  readOnly?: boolean;
20
24
  }
21
- export declare const DateTimePicker: ({ width, className, label, loading, required, optional, onChange, value, minDate, maxDate, ...props }: DateTimePickerProps) => React.JSX.Element;
25
+ export declare const DateTimePicker: ({ width, className, label, loading, required, optional, onChange, onBlur, value, minDate, maxDate, disabled, readOnly, ...props }: DateTimePickerProps) => import("react").JSX.Element;
@@ -3,8 +3,8 @@ import { DateTimePickerProps } from './DateTimePicker';
3
3
  import { InputSize } from '~/utils/input/input';
4
4
  declare const meta: {
5
5
  title: string;
6
- component: (props: DateTimePickerProps) => React.JSX.Element;
7
- decorators: (((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element) | ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
6
+ component: (props: DateTimePickerProps) => import("react").JSX.Element;
7
+ decorators: (((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => import("react").JSX.Element) | ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
8
8
  id?: string | undefined;
9
9
  className?: string | undefined;
10
10
  optional?: boolean | string | undefined | undefined;
@@ -21,8 +21,15 @@ declare const meta: {
21
21
  width?: InputSize | undefined;
22
22
  disabled?: boolean | undefined;
23
23
  readOnly?: boolean | undefined;
24
- }>) => React.JSX.Element))[];
24
+ }>) => import("react").JSX.Element))[];
25
25
  tags: string[];
26
+ parameters: {
27
+ docs: {
28
+ description: {
29
+ component: string;
30
+ };
31
+ };
32
+ };
26
33
  argTypes: {
27
34
  width: {
28
35
  control: "select";
@@ -10,13 +10,15 @@ export interface DatepickerProps {
10
10
  required?: boolean | string;
11
11
  label: string;
12
12
  description?: string;
13
+ /** Takes precedence over the built-in format and min/max messages. */
13
14
  error?: string;
14
15
  onBlur?: () => void;
15
16
  value: Date | undefined;
17
+ /** Called with a valid date, or `undefined` when the field is emptied or the typed text is invalid. */
16
18
  onChange?: (date: Date | undefined) => void;
17
19
  minDate?: Date;
18
20
  maxDate?: Date;
19
21
  disabled?: boolean;
20
22
  readOnly?: boolean;
21
23
  }
22
- export declare const Datepicker: ({ width, className, label, loading, required, optional, onChange, value, minDate, maxDate, ...props }: DatepickerProps) => React.JSX.Element;
24
+ export declare const Datepicker: ({ width, className, label, loading, required, optional, onChange, onBlur, value, minDate, maxDate, disabled, readOnly, ...props }: DatepickerProps) => import("react").JSX.Element;
@@ -3,8 +3,8 @@ import { DatepickerProps } from './Datepicker';
3
3
  import { InputSize } from '~/utils/input/input';
4
4
  declare const meta: {
5
5
  title: string;
6
- component: (props: DatepickerProps) => React.JSX.Element;
7
- decorators: (((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element) | ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
6
+ component: (props: DatepickerProps) => import("react").JSX.Element;
7
+ decorators: (((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => import("react").JSX.Element) | ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
8
8
  id?: string | undefined;
9
9
  className?: string | undefined;
10
10
  loading?: boolean | undefined;
@@ -21,8 +21,15 @@ declare const meta: {
21
21
  maxDate?: Date | undefined;
22
22
  disabled?: boolean | undefined;
23
23
  readOnly?: boolean | undefined;
24
- }>) => React.JSX.Element))[];
24
+ }>) => import("react").JSX.Element))[];
25
25
  tags: string[];
26
+ parameters: {
27
+ docs: {
28
+ description: {
29
+ component: string;
30
+ };
31
+ };
32
+ };
26
33
  argTypes: {
27
34
  width: {
28
35
  control: "select";
@@ -0,0 +1,29 @@
1
+ import type { ChangeEvent, KeyboardEvent, MouseEvent, RefObject } from 'react';
2
+ import type { PickerKind } from './pickerKinds';
3
+ export interface PickerControlProps {
4
+ kind: PickerKind;
5
+ /** Id on the text input — the field's input as far as Label and ErrorSummary go. */
6
+ id?: string;
7
+ textRef: RefObject<HTMLInputElement | null>;
8
+ nativeRef: RefObject<HTMLInputElement | null>;
9
+ text: string;
10
+ nativeValue: string;
11
+ nativeMin: string;
12
+ nativeMax: string;
13
+ placeholder: string;
14
+ openLabel: string;
15
+ disabled?: boolean;
16
+ readOnly?: boolean;
17
+ onTextKeyDown: (e: KeyboardEvent<HTMLInputElement>) => void;
18
+ onTextChange: (e: ChangeEvent<HTMLInputElement>) => void;
19
+ onTextBlur: () => void;
20
+ onNativeChange: (e: ChangeEvent<HTMLInputElement>) => void;
21
+ onOpen: (e: MouseEvent<HTMLButtonElement>) => void;
22
+ /** Just picked with the mouse; holds off the button's stale hover. */
23
+ picked: boolean;
24
+ }
25
+ /**
26
+ * Masked text input + picker button + the hidden native input the button opens. Internal to the
27
+ * pickers; get the props from `usePickerText` and render it inside a `Field` (with its `Label`).
28
+ */
29
+ export declare const PickerControl: ({ kind, ...props }: PickerControlProps) => import("react").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import type { IconId } from '~/components/kystverket/Icon/icon.types';
2
+ /**
3
+ * What differs between the date and the time text fields. Everything else — masking, caret
4
+ * handling, validation flow, the hidden native input — lives in usePickerText/PickerControl.
5
+ */
6
+ export interface PickerKind {
7
+ /** Translation namespace holding open, placeholder, invalidFormat, invalidValue, beforeMin, afterMax. */
8
+ ns: 'datepicker' | 'timePicker' | 'dateTimePicker';
9
+ /** Name of the interpolation parameter in beforeMin/afterMax. */
10
+ limitParam: 'date' | 'time';
11
+ /** Key under `ns` for "right shape, but no such date/time". */
12
+ invalidValueKey: 'invalidDate' | 'invalidTime' | 'invalidDateTime';
13
+ maxLength: number;
14
+ /** Keys that may be typed besides digits. */
15
+ allowedKey: RegExp;
16
+ /** Maps typed separators to the real one and drops anything else. */
17
+ keep: (text: string) => string;
18
+ /**
19
+ * Turns what was typed (after `keep`, trimmed) into the displayed format as far as it can, and
20
+ * returns the rest as typed. Separators are optional, so `24122026` becomes `24.12.2026`.
21
+ * `final` is true on blur; while typing it is false, and anything that more typing could still
22
+ * change (a two-digit year at the end may yet get four digits) is left alone.
23
+ */
24
+ normalize: (text: string, final: boolean) => string;
25
+ /** Strict shape check, used to tell "wrong format" from "no such date/time". */
26
+ pattern: RegExp;
27
+ /** Strict parse of the displayed format; undefined for anything else. */
28
+ parse: (text: string) => Date | undefined;
29
+ format: (value: Date | undefined) => string;
30
+ /** Negative when a < b, at this kind's granularity (day or minute of day). */
31
+ compare: (a: Date, b: Date) => number;
32
+ nativeType: 'date' | 'time' | 'datetime-local';
33
+ toNative: (value: Date | undefined) => string;
34
+ fromNative: (value: string) => Date | undefined;
35
+ /**
36
+ * Value to put in an empty native input before opening it. For datetime-local, which has no
37
+ * value until both date and time are set: Firefox's picker only sets the date, so picking from
38
+ * an empty input would never fire a change.
39
+ */
40
+ seedNative?: (text: string) => string;
41
+ icon: IconId;
42
+ /**
43
+ * `always`: the button is always shown (every browser has a native date picker).
44
+ * `native`: only where the browser has a native picker for this type — see PickerControl.module.css.
45
+ */
46
+ button: 'always' | 'native';
47
+ }
48
+ /** `dd.mm.yyyy`. Commas count as dots: the Norwegian numpad's decimal key types a comma. */
49
+ export declare const dateKind: PickerKind;
50
+ /** `hh:mm`. Dots and commas count as colons — 14.30 is how many people write a time. */
51
+ export declare const timeKind: PickerKind;
52
+ /** `dd.mm.yyyy hh:mm`, typed as one field. Commas count as dots, as for dates. */
53
+ export declare const dateTimeKind: PickerKind;
@@ -0,0 +1,27 @@
1
+ import type { PickerControlProps } from './PickerControl';
2
+ import type { PickerKind } from './pickerKinds';
3
+ interface UsePickerTextOptions {
4
+ kind: PickerKind;
5
+ /** Shown in the field. For a time, only the time of day is used. */
6
+ value: Date | undefined;
7
+ min?: Date;
8
+ max?: Date;
9
+ disabled?: boolean;
10
+ readOnly?: boolean;
11
+ /**
12
+ * A complete, valid value as the kind parses it (a date at midnight, or a time on 1 Jan 1970),
13
+ * or `undefined` when the field is emptied or turns out invalid on blur.
14
+ */
15
+ onChange: (value: Date | undefined) => void;
16
+ onBlur?: () => void;
17
+ }
18
+ /**
19
+ * State and handlers for one masked picker text field: what's typed, the built-in error, and
20
+ * the hidden native input behind the button. Render the result with `<PickerControl {...control} />`
21
+ * inside a `Field`, and show `error` (unless the app passes its own) in that Field.
22
+ */
23
+ export declare const usePickerText: ({ kind, value, min, max, disabled, readOnly, onChange, onBlur, }: UsePickerTextOptions) => {
24
+ error: string | undefined;
25
+ control: PickerControlProps;
26
+ };
27
+ export {};
@@ -9,13 +9,24 @@ export interface TimePickerProps {
9
9
  required?: boolean | string;
10
10
  label: string;
11
11
  description?: string;
12
+ /** Takes precedence over the built-in format and min/max messages. */
12
13
  error?: string;
13
14
  onBlur?: () => void;
15
+ /** Only the time of day is shown; the date part is kept when the time changes. */
14
16
  value: Date | undefined;
17
+ /**
18
+ * Called with `value`'s date (today if there is none) at the chosen time, or `undefined` when
19
+ * the field is emptied or the typed text is invalid.
20
+ */
15
21
  onChange?: (date: Date | undefined) => void;
22
+ /** Only the time of day is compared. */
16
23
  minTime?: Date;
24
+ /**
25
+ * Only the time of day is compared. A `maxTime` before `minTime` makes a range over midnight:
26
+ * 22:00 to 02:00 accepts 23:00 and 01:00.
27
+ */
17
28
  maxTime?: Date;
18
29
  disabled?: boolean;
19
30
  readOnly?: boolean;
20
31
  }
21
- export declare const TimePicker: ({ width, className, label, loading, required, optional, onChange, value, minTime, maxTime, ...props }: TimePickerProps) => React.JSX.Element;
32
+ export declare const TimePicker: ({ width, className, label, loading, required, optional, onChange, onBlur, value, minTime, maxTime, disabled, readOnly, ...props }: TimePickerProps) => import("react").JSX.Element;
@@ -3,8 +3,8 @@ import { TimePickerProps } from './TimePicker';
3
3
  import { InputSize } from '~/utils/input/input';
4
4
  declare const meta: {
5
5
  title: string;
6
- component: (props: TimePickerProps) => React.JSX.Element;
7
- decorators: (((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element) | ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
6
+ component: (props: TimePickerProps) => import("react").JSX.Element;
7
+ decorators: (((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => import("react").JSX.Element) | ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
8
8
  id?: string | undefined;
9
9
  className?: string | undefined;
10
10
  loading?: boolean | undefined;
@@ -21,8 +21,15 @@ declare const meta: {
21
21
  maxTime?: Date | undefined;
22
22
  disabled?: boolean | undefined;
23
23
  readOnly?: boolean | undefined;
24
- }>) => React.JSX.Element))[];
24
+ }>) => import("react").JSX.Element))[];
25
25
  tags: string[];
26
+ parameters: {
27
+ docs: {
28
+ description: {
29
+ component: string;
30
+ };
31
+ };
32
+ };
26
33
  argTypes: {
27
34
  width: {
28
35
  control: "select";
@@ -1,7 +1,7 @@
1
1
  import { ReactNode, Ref } from 'react';
2
2
  import { FilePreviewerDialogProps, FilePreviewRef } from './dialog/FilePreviewer-dialog';
3
3
  import { FileInfo } from './FilePreviewer.types';
4
- export declare const FPContext: React.Context<{
4
+ export declare const FPContext: import("react").Context<{
5
5
  files: FileInfo[];
6
6
  ref: Ref<FilePreviewRef> | null;
7
7
  setFiles: React.Dispatch<React.SetStateAction<FileInfo[]>>;
@@ -12,4 +12,4 @@ export interface FilePreviewerContextProps {
12
12
  files?: FileInfo[];
13
13
  animation?: FilePreviewerDialogProps['animation'];
14
14
  }
15
- export declare const FilePreviewerContext: ({ animation, children, ref, files }: FilePreviewerContextProps) => React.JSX.Element;
15
+ export declare const FilePreviewerContext: ({ animation, children, ref, files }: FilePreviewerContextProps) => import("react").JSX.Element;
@@ -2,7 +2,7 @@ import type { StoryFn } from '@storybook/react-vite';
2
2
  import { FilePreviewerDialogProps } from './dialog/FilePreviewer-dialog';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: (({ animation, children, ref, files }: import("~/main").FilePreviewerProps) => React.JSX.Element) & {
5
+ component: (({ animation, children, ref, files }: import("~/main").FilePreviewerProps) => import("react").JSX.Element) & {
6
6
  Thumbnail: typeof import("./thumbnail/FilePreviewer-thumbnail").FilePreviewerThumbnail & {
7
7
  displayName?: string;
8
8
  };
@@ -11,7 +11,7 @@ declare const meta: {
11
11
  };
12
12
  displayName?: string;
13
13
  };
14
- decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
14
+ decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => import("react").JSX.Element)[];
15
15
  tags: string[];
16
16
  args: {
17
17
  animation: "slide";
@@ -13,4 +13,4 @@ export interface FilePreviewerDialogProps {
13
13
  startIndex?: number;
14
14
  onClose?: () => void;
15
15
  }
16
- export declare const FilePreviewerDialog: ({ animation, onClose, files, startIndex }: FilePreviewerDialogProps) => React.JSX.Element;
16
+ export declare const FilePreviewerDialog: ({ animation, onClose, files, startIndex }: FilePreviewerDialogProps) => import("react").JSX.Element;
@@ -14,4 +14,4 @@ export interface FilePreviewerPanelProps {
14
14
  * panel such as `SaksbehandlingShell`'s `comparisonContent`. Unlike `FilePreviewer.Thumbnail`
15
15
  * it does not need a surrounding `<FilePreviewer>`.
16
16
  */
17
- export declare function FilePreviewerPanel({ file, emptyContent, headingLevel, className }: FilePreviewerPanelProps): React.JSX.Element;
17
+ export declare function FilePreviewerPanel({ file, emptyContent, headingLevel, className }: FilePreviewerPanelProps): import("react").JSX.Element;
@@ -4,4 +4,4 @@ export declare const FileRenderer: ({ file, className, mode, tabIndex, }: {
4
4
  mode?: "thumbnail" | "full";
5
5
  className?: string;
6
6
  tabIndex?: number;
7
- }) => React.JSX.Element | undefined;
7
+ }) => import("react").JSX.Element | undefined;
@@ -7,4 +7,4 @@ export interface FilePreviewerThumbnailProps {
7
7
  */
8
8
  index: number;
9
9
  }
10
- export declare const FilePreviewerThumbnail: ({ file, index }: FilePreviewerThumbnailProps) => React.JSX.Element | undefined;
10
+ export declare const FilePreviewerThumbnail: ({ file, index }: FilePreviewerThumbnailProps) => import("react").JSX.Element | undefined;
@@ -2,4 +2,4 @@ import type { DeriveFileInfosFromStorageIds } from '~/utils/fileInfoResolver';
2
2
  export interface FileRetrieverContextProps {
3
3
  deriveFileInfosFromStorageIds: DeriveFileInfosFromStorageIds;
4
4
  }
5
- export declare const FileRetrieverContext: React.Context<FileRetrieverContextProps | null>;
5
+ export declare const FileRetrieverContext: import("react").Context<FileRetrieverContextProps | null>;
@@ -4,4 +4,4 @@ export interface FileUploaderContextProps {
4
4
  uploadFile: (file: FormData) => Promise<UploadFileResult>;
5
5
  deleteFile: (fileId: string) => Promise<void>;
6
6
  }
7
- export declare const FileUploaderContext: React.Context<FileUploaderContextProps>;
7
+ export declare const FileUploaderContext: import("react").Context<FileUploaderContextProps>;
@@ -56,4 +56,4 @@ export interface FileUploaderProps {
56
56
  */
57
57
  fileActions?: (file: FileInfo) => FileUploaderFileAction[];
58
58
  }
59
- export declare const FileUploader: ({ id, label, maxSizeInBytes, required, optional, description, error, multiple, files, maxFiles, onChange, allowedFileTypes, withCaptureButton, existingFilesProvider, variant, allowFilePreview, uploadActions, fileActions, }: FileUploaderProps) => React.JSX.Element;
59
+ export declare const FileUploader: ({ id, label, maxSizeInBytes, required, optional, description, error, multiple, files, maxFiles, onChange, allowedFileTypes, withCaptureButton, existingFilesProvider, variant, allowFilePreview, uploadActions, fileActions, }: FileUploaderProps) => import("react").JSX.Element;
@@ -3,11 +3,11 @@ import { ExistingFilesProviderItem, FileUploaderProps } from './FileUploader';
3
3
  import { FileInfo } from './FileUploader.types';
4
4
  declare const meta: {
5
5
  title: string;
6
- component: (props: FileUploaderProps) => React.JSX.Element;
7
- decorators: (((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element) | ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
6
+ component: (props: FileUploaderProps) => import("react").JSX.Element;
7
+ decorators: (((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => import("react").JSX.Element) | ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
8
8
  id?: string | undefined;
9
9
  label: string;
10
- description?: string[] | React.ReactNode;
10
+ description?: string[] | import("react").ReactNode;
11
11
  error?: string | null | undefined;
12
12
  multiple?: boolean | undefined;
13
13
  files: FileInfo[];
@@ -23,7 +23,7 @@ declare const meta: {
23
23
  allowFilePreview?: boolean | undefined;
24
24
  uploadActions?: import("./FileUploader.types").FileUploaderAction[] | undefined;
25
25
  fileActions?: ((file: FileInfo) => import("./FileUploader.types").FileUploaderFileAction[]) | undefined;
26
- }>) => React.JSX.Element))[];
26
+ }>) => import("react").JSX.Element))[];
27
27
  tags: string[];
28
28
  argTypes: {};
29
29
  };
@@ -10,5 +10,5 @@ export interface ExistingFilesDialogHandle {
10
10
  showModal: () => Promise<void>;
11
11
  close: () => void;
12
12
  }
13
- export declare const ExistingFilesDialog: React.ForwardRefExoticComponent<ExistingFilesDialogProps & React.RefAttributes<ExistingFilesDialogHandle>>;
13
+ export declare const ExistingFilesDialog: import("react").ForwardRefExoticComponent<ExistingFilesDialogProps & import("react").RefAttributes<ExistingFilesDialogHandle>>;
14
14
  export {};
@@ -12,5 +12,5 @@ type FileUploadActionsProps = {
12
12
  describedBy: string;
13
13
  allowedFileTypes: string[];
14
14
  } & Pick<FileUploaderProps, 'variant' | 'existingFilesProvider' | 'withCaptureButton' | 'multiple' | 'uploadActions'>;
15
- export declare function FileUploadActions({ controlId, describedBy, variant, fileInputRef, onUploadFile, existingFilesProvider, fileCameraInputRef, dialogRef, allowedFileTypes, withCaptureButton, multiple, uploadActions, t, }: FileUploadActionsProps): React.JSX.Element;
15
+ export declare function FileUploadActions({ controlId, describedBy, variant, fileInputRef, onUploadFile, existingFilesProvider, fileCameraInputRef, dialogRef, allowedFileTypes, withCaptureButton, multiple, uploadActions, t, }: FileUploadActionsProps): import("react").JSX.Element;
16
16
  export {};
@@ -9,5 +9,5 @@ type FileUploaderItemProps = {
9
9
  actions?: FileUploaderFileAction[];
10
10
  };
11
11
  export declare const getPrefixIcon: (contentType: FileInfo["contentType"]) => MaterialIconProps["material"];
12
- export declare function FileUploaderItem({ file, extraInfo, t, onDeleteFile, onPreviewFile, actions }: FileUploaderItemProps): React.JSX.Element;
12
+ export declare function FileUploaderItem({ file, extraInfo, t, onDeleteFile, onPreviewFile, actions }: FileUploaderItemProps): import("react").JSX.Element;
13
13
  export {};
@@ -10,5 +10,5 @@ export type FooterProps = {
10
10
  contacts?: LinkToSite[];
11
11
  links?: LinkToSite[] | LinkToSite[][];
12
12
  };
13
- export declare function Footer({ additionalLogo, text, copyright, contacts, links }: FooterProps): React.JSX.Element;
13
+ export declare function Footer({ additionalLogo, text, copyright, contacts, links }: FooterProps): import("react").JSX.Element;
14
14
  export {};
@@ -3,7 +3,7 @@ import { Footer } from '~/components/kystverket/Footer/Footer';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  component: typeof Footer;
6
- decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
6
+ decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => import("react").JSX.Element)[];
7
7
  tags: string[];
8
8
  argTypes: {};
9
9
  };
@@ -58,6 +58,6 @@ type HeaderProfile = {
58
58
  avatarStyle?: Omit<AvatarProps, 'aria-label' | 'aria-hidden' | 'initials' | 'children' | 'data-size'>;
59
59
  };
60
60
  export declare const nameToInitials: (name?: string) => string;
61
- export declare function MainLinkItem(props: HeaderLinkItemWithOnClick): React.JSX.Element;
62
- export declare function Header({ logo: { title, variant, product, url }, links, slots, width, profile, applications, loginHandler, logoutHandler, }: Readonly<HeaderProps>): React.JSX.Element;
61
+ export declare function MainLinkItem(props: HeaderLinkItemWithOnClick): import("react").JSX.Element;
62
+ export declare function Header({ logo: { title, variant, product, url }, links, slots, width, profile, applications, loginHandler, logoutHandler, }: Readonly<HeaderProps>): import("react").JSX.Element;
63
63
  export {};
@@ -3,7 +3,7 @@ import { Header } from './Header';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  component: typeof Header;
6
- decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
6
+ decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => import("react").JSX.Element)[];
7
7
  tags: string[];
8
8
  argTypes: {
9
9
  logo: {
@@ -1,3 +1,3 @@
1
1
  import { HeaderProps } from './Header';
2
2
  export type HeaderAppsProps = Pick<HeaderProps, 'links' | 'applications'>;
3
- export declare function HeaderApps({ links, applications }: HeaderAppsProps): React.JSX.Element | null;
3
+ export declare function HeaderApps({ links, applications }: HeaderAppsProps): import("react").JSX.Element | null;
@@ -2,5 +2,5 @@ import { HeaderProps } from './Header';
2
2
  type HeaderAvatarProps = {
3
3
  profile: NonNullable<HeaderProps['profile']>;
4
4
  };
5
- export declare function HeaderAvatar({ profile }: HeaderAvatarProps): React.JSX.Element;
5
+ export declare function HeaderAvatar({ profile }: HeaderAvatarProps): import("react").JSX.Element;
6
6
  export {};
@@ -1,3 +1,3 @@
1
1
  import { HeaderProps } from './Header';
2
2
  export type HeaderMobileProps = Pick<HeaderProps, 'logoutHandler' | 'loginHandler' | 'profile' | 'slots' | 'links' | 'applications'>;
3
- export declare function HeaderMobile({ logoutHandler, loginHandler, profile, slots, links, applications }: HeaderMobileProps): React.JSX.Element | null;
3
+ export declare function HeaderMobile({ logoutHandler, loginHandler, profile, slots, links, applications }: HeaderMobileProps): import("react").JSX.Element | null;
@@ -1,3 +1,3 @@
1
1
  import { HeaderProps } from './Header';
2
2
  export type HeaderProfileProps = Pick<HeaderProps, 'links' | 'profile' | 'logoutHandler'>;
3
- export declare function HeaderProfile({ links, profile, logoutHandler }: HeaderProfileProps): React.JSX.Element | null;
3
+ export declare function HeaderProfile({ links, profile, logoutHandler }: HeaderProfileProps): import("react").JSX.Element | null;
@@ -9,8 +9,8 @@ export type HeaderLinkComponent = (props: HeaderLinkComponentProps) => React.Rea
9
9
  export interface HeaderContextProps {
10
10
  LinkComponent: HeaderLinkComponent;
11
11
  }
12
- export declare const HeaderContext: React.Context<HeaderContextProps>;
12
+ export declare const HeaderContext: import("react").Context<HeaderContextProps>;
13
13
  export interface ApplicationHeaderContextProps {
14
14
  applicationId?: string;
15
15
  }
16
- export declare const ApplicationHeaderContext: React.Context<ApplicationHeaderContextProps>;
16
+ export declare const ApplicationHeaderContext: import("react").Context<ApplicationHeaderContextProps>;
@@ -1,4 +1,4 @@
1
1
  declare const FileIcon: ({ file }: {
2
2
  file: string;
3
- }) => React.JSX.Element;
3
+ }) => import("react").JSX.Element;
4
4
  export default FileIcon;
@@ -1,8 +1,8 @@
1
1
  import type { StoryFn } from '@storybook/react-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ material, file, indicator, indicatorPosition, className, size, title, background, }: import("~/main").IconProps) => React.JSX.Element;
5
- decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
4
+ component: ({ material, file, indicator, indicatorPosition, className, size, title, background, }: import("~/main").IconProps) => import("react").JSX.Element;
5
+ decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => import("react").JSX.Element)[];
6
6
  tags: string[];
7
7
  argTypes: {};
8
8
  };
@@ -19,5 +19,5 @@ export interface FileIconProps extends IconBaseProps {
19
19
  material?: never;
20
20
  }
21
21
  export type IconProps = MaterialIconProps | FileIconProps;
22
- declare const Icon: ({ material, file, indicator, indicatorPosition, className, size, title, background, }: IconProps) => React.JSX.Element;
22
+ declare const Icon: ({ material, file, indicator, indicatorPosition, className, size, title, background, }: IconProps) => import("react").JSX.Element;
23
23
  export default Icon;