@kystverket/styrbord 1.9.11 → 1.12.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.
@@ -41,6 +41,7 @@ export declare const Disabled: {
41
41
  } | {
42
42
  name: string;
43
43
  disabled: boolean;
44
+ id?: string | undefined | undefined;
44
45
  children?: React.ReactNode;
45
46
  className?: string | undefined | undefined;
46
47
  width?: number | string | undefined | undefined;
@@ -65,7 +66,6 @@ export declare const Disabled: {
65
66
  draggable?: (boolean | "true" | "false") | undefined;
66
67
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
67
68
  hidden?: boolean | undefined | undefined;
68
- id?: string | undefined | undefined;
69
69
  lang?: string | undefined | undefined;
70
70
  nonce?: string | undefined | undefined;
71
71
  spellCheck?: (boolean | "true" | "false") | undefined;
@@ -358,6 +358,7 @@ export declare const Disabled: {
358
358
  } | {
359
359
  name: string;
360
360
  disabled: boolean;
361
+ id?: string | undefined | undefined;
361
362
  children?: React.ReactNode;
362
363
  className?: string | undefined | undefined;
363
364
  width?: number | string | undefined | undefined;
@@ -382,7 +383,6 @@ export declare const Disabled: {
382
383
  draggable?: (boolean | "true" | "false") | undefined;
383
384
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
384
385
  hidden?: boolean | undefined | undefined;
385
- id?: string | undefined | undefined;
386
386
  lang?: string | undefined | undefined;
387
387
  nonce?: string | undefined | undefined;
388
388
  spellCheck?: (boolean | "true" | "false") | undefined;
@@ -675,6 +675,7 @@ export declare const Disabled: {
675
675
  } | {
676
676
  name: string;
677
677
  disabled: boolean;
678
+ id?: string | undefined | undefined;
678
679
  children?: React.ReactNode;
679
680
  className?: string | undefined | undefined;
680
681
  width?: number | string | undefined | undefined;
@@ -699,7 +700,6 @@ export declare const Disabled: {
699
700
  draggable?: (boolean | "true" | "false") | undefined;
700
701
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
701
702
  hidden?: boolean | undefined | undefined;
702
- id?: string | undefined | undefined;
703
703
  lang?: string | undefined | undefined;
704
704
  nonce?: string | undefined | undefined;
705
705
  spellCheck?: (boolean | "true" | "false") | undefined;
@@ -0,0 +1,14 @@
1
+ import { ChipButtonProps, ChipRemovableProps, ChipCheckboxProps, ChipRadioProps } from '@digdir/designsystemet-react';
2
+ import { FC } from 'react';
3
+ export declare const ChipButton: FC<ChipButtonProps & {
4
+ ref?: React.Ref<HTMLButtonElement>;
5
+ }>;
6
+ export declare const ChipRemovable: FC<ChipRemovableProps & {
7
+ ref?: React.Ref<HTMLButtonElement>;
8
+ }>;
9
+ export declare const ChipCheckbox: FC<ChipCheckboxProps & {
10
+ ref?: React.Ref<HTMLLabelElement>;
11
+ }>;
12
+ export declare const ChipRadio: FC<ChipRadioProps & {
13
+ ref?: React.Ref<HTMLLabelElement>;
14
+ }>;
@@ -0,0 +1,36 @@
1
+ import { ChipButton, ChipCheckbox, ChipRadio, ChipRemovable } from './Chip';
2
+ type Chip = {
3
+ /**
4
+ * Chip.Button used for interaction
5
+ *
6
+ * @example
7
+ * <Chip.Button>Click me</Chip.Button>
8
+ */
9
+ Button: typeof ChipButton;
10
+ /**
11
+ * Chip.Checkbox used for multiselection
12
+ *
13
+ * @example
14
+ * <Chip.Checkbox name="language" value="nynorsk">Nynorsk</Chip.Checkbox>
15
+ * <Chip.Checkbox name="language" value="bokmål">Bokmål</Chip.Checkbox>
16
+ */
17
+ Checkbox: typeof ChipCheckbox;
18
+ /**
19
+ * Chip.Radio used for single selection
20
+ *
21
+ * @example
22
+ * <Chip.Radio name="language" value="nynorsk">Nynorsk</Chip.Radio>
23
+ * <Chip.Radio name="language" value="bokmål">Bokmål</Chip.Radio>
24
+ */
25
+ Radio: typeof ChipRadio;
26
+ /**
27
+ * Chip.Removable used for interaction
28
+ *
29
+ * @example
30
+ * <Chip.Removable>Click to remove me</Chip.Removable>
31
+ */
32
+ Removable: typeof ChipRemovable;
33
+ };
34
+ declare const ChipComponent: Chip;
35
+ export type { ChipButtonProps, ChipCheckboxProps, ChipRadioProps, ChipRemovableProps, } from '@digdir/designsystemet-react';
36
+ export { ChipButton, ChipCheckbox, ChipComponent as Chip, ChipRadio, ChipRemovable };
@@ -0,0 +1,33 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ type ColorScheme = 'light' | 'dark';
3
+ type StoryArgs = {
4
+ colorScheme: ColorScheme;
5
+ };
6
+ declare const meta: {
7
+ title: string;
8
+ tags: string[];
9
+ component: ({ colorScheme }: StoryArgs) => React.JSX.Element;
10
+ args: {
11
+ colorScheme: "light";
12
+ };
13
+ argTypes: {
14
+ colorScheme: {
15
+ options: ColorScheme[];
16
+ control: {
17
+ type: "inline-radio";
18
+ };
19
+ description: string;
20
+ };
21
+ };
22
+ parameters: {
23
+ docs: {
24
+ description: {
25
+ component: string;
26
+ };
27
+ };
28
+ };
29
+ render: (args: StoryArgs) => React.JSX.Element;
30
+ };
31
+ export default meta;
32
+ type Story = StoryObj<typeof meta>;
33
+ export declare const AllColors: Story;
@@ -1,2 +1,2 @@
1
- export declare const iconIdList: readonly ["add", "add_box", "add_location", "add_location_alt", "adjust", "anchor", "apps", "archive", "arrow_back", "arrow_forward", "arrow_right_alt", "article", "calendar_month", "change_history", "chat", "check", "check_circle", "chevron_left", "chevron_right", "circle", "close", "cloud_alert", "cloud_done", "code_blocks", "content_copy", "data_table", "delete", "description", "directions_boat", "distance", "domain", "download", "edit", "edit_document", "edit_location", "edit_location_alt", "edit_square", "error", "event", "explore", "explore_nearby", "export_notes", "favorite", "file_map", "file_save", "folder_open", "format_align_center", "format_align_left", "format_align_right", "forward", "globe_uk", "groups", "image", "inbox", "info", "info_i", "keep", "keep_off", "keyboard_arrow_down", "keyboard_arrow_up", "language", "layers", "lightbulb", "link", "location_chip", "lock", "login", "logout", "mail", "map", "map_pin_heart", "menu", "mode_cool", "more_vert", "move", "numbers", "open_in_new", "pan_zoom", "pending_actions", "person", "person_add", "person_pin", "person_pin_circle", "photo_camera", "picture_as_pdf", "pin_drop", "radio_button_checked", "radio_button_unchecked", "sailing", "save", "send", "settings", "settings_input_antenna", "severe_cold", "source_environment", "stylus", "text_snippet", "timeline", "upload", "video_library", "videocam", "view_list", "warning", "zoom_in_map", "zoom_out_map", "format_italic", "format_bold", "format_list_bulleted", "format_list_numbered", "format_align_justify", "undo", "redo", "visibility", "left_panel_close", "left_panel_open", "right_panel_close", "right_panel_open"];
1
+ export declare const iconIdList: readonly ["add", "add_box", "add_location", "add_location_alt", "adjust", "alternate_email", "anchor", "apps", "archive", "arrow_back", "arrow_forward", "arrow_right_alt", "article", "calendar_month", "change_history", "chat", "check", "check_circle", "chevron_left", "chevron_right", "circle", "close", "cloud_alert", "cloud_done", "code_blocks", "content_copy", "data_table", "delete", "description", "directions_boat", "distance", "domain", "download", "edit", "edit_document", "edit_location", "edit_location_alt", "edit_square", "error", "event", "explore", "explore_nearby", "export_notes", "favorite", "file_map", "file_save", "folder_open", "format_align_center", "format_align_left", "format_align_right", "forward", "globe_uk", "groups", "image", "inbox", "info", "info_i", "keep", "keep_off", "keyboard_arrow_down", "keyboard_arrow_up", "language", "layers", "lightbulb", "link", "location_chip", "lock", "login", "logout", "mail", "map", "map_pin_heart", "match_case", "menu", "mode_cool", "more_vert", "move", "numbers", "open_in_new", "pan_zoom", "pending_actions", "person", "person_add", "person_pin", "person_pin_circle", "photo_camera", "picture_as_pdf", "pin_drop", "radio_button_checked", "radio_button_unchecked", "sailing", "save", "send", "settings", "settings_input_antenna", "severe_cold", "source_environment", "stylus", "text_snippet", "timeline", "upload", "video_library", "videocam", "view_list", "warning", "zoom_in_map", "zoom_out_map", "format_italic", "format_bold", "format_list_bulleted", "format_list_numbered", "format_align_justify", "undo", "redo", "visibility", "left_panel_close", "left_panel_open", "right_panel_close", "right_panel_open"];
2
2
  export type IconId = (typeof iconIdList)[number];
@@ -7,9 +7,9 @@ type ToolbarProps = {
7
7
  isBulletListActive: boolean;
8
8
  isOrderedListActive: boolean;
9
9
  isLinkActive: boolean;
10
- canUploadImage?: boolean;
11
10
  selectedFormat: BlockType;
12
11
  linkPopoverTarget?: string;
12
+ canUploadImage?: boolean;
13
13
  onBold: () => void;
14
14
  onItalic: () => void;
15
15
  onBulletList: () => void;
@@ -20,5 +20,5 @@ type ToolbarProps = {
20
20
  onLink: () => void;
21
21
  onImageUpload?: () => void;
22
22
  };
23
- export declare const Toolbar: ({ disabled, isBoldActive, isItalicActive, isBulletListActive, isOrderedListActive, isLinkActive, canUploadImage, selectedFormat, linkPopoverTarget, onBulletList, onOrderedList, onBold, onItalic, onUndo, onRedo, onFormatChange, onLink, onImageUpload, }: ToolbarProps) => React.JSX.Element;
23
+ export declare const Toolbar: ({ disabled, isBoldActive, isItalicActive, isBulletListActive, isOrderedListActive, isLinkActive, selectedFormat, linkPopoverTarget, canUploadImage, onBulletList, onOrderedList, onBold, onItalic, onUndo, onRedo, onFormatChange, onLink, onImageUpload, }: ToolbarProps) => React.JSX.Element;
24
24
  export {};
@@ -2,16 +2,16 @@ import type { StoryObj } from '@storybook/react-vite';
2
2
  import { type BlockType } from './toolbar';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ disabled, isBoldActive, isItalicActive, isBulletListActive, isOrderedListActive, isLinkActive, canUploadImage, selectedFormat, linkPopoverTarget, onBulletList, onOrderedList, onBold, onItalic, onUndo, onRedo, onFormatChange, onLink, onImageUpload, }: {
5
+ component: ({ disabled, isBoldActive, isItalicActive, isBulletListActive, isOrderedListActive, isLinkActive, selectedFormat, linkPopoverTarget, canUploadImage, onBulletList, onOrderedList, onBold, onItalic, onUndo, onRedo, onFormatChange, onLink, onImageUpload, }: {
6
6
  disabled?: boolean;
7
7
  isBoldActive: boolean;
8
8
  isItalicActive: boolean;
9
9
  isBulletListActive: boolean;
10
10
  isOrderedListActive: boolean;
11
11
  isLinkActive: boolean;
12
- canUploadImage?: boolean;
13
12
  selectedFormat: BlockType;
14
13
  linkPopoverTarget?: string;
14
+ canUploadImage?: boolean;
15
15
  onBold: () => void;
16
16
  onItalic: () => void;
17
17
  onBulletList: () => void;
@@ -49,6 +49,9 @@ declare const meta: {
49
49
  onLink: {
50
50
  action: string;
51
51
  };
52
+ onImageUpload: {
53
+ action: string;
54
+ };
52
55
  };
53
56
  };
54
57
  export default meta;
@@ -14,6 +14,7 @@ declare const meta: {
14
14
  optional?: boolean | string | undefined;
15
15
  required?: boolean | string | undefined;
16
16
  error?: string | undefined;
17
+ bottomToolbar?: React.ReactNode;
17
18
  onImageUpload?: import("./richTextArea.types").OnImageUploadFn | undefined;
18
19
  onImageRemove?: ((ref: string) => Promise<void>) | undefined;
19
20
  }>) => React.JSX.Element))[];
@@ -24,6 +25,7 @@ type Story = StoryObj<typeof meta>;
24
25
  export declare const Default: Story;
25
26
  export declare const Disabled: Story;
26
27
  export declare const WithError: Story;
28
+ export declare const WithBottomToolbar: Story;
27
29
  /**
28
30
  * Demonstrates stable image references in markdown.
29
31
  *
@@ -1,4 +1,5 @@
1
1
  import type { CmdKey } from '@milkdown/core';
2
+ import type { ReactNode } from 'react';
2
3
  export type RichTextAreaProps = {
3
4
  value: string | null | undefined;
4
5
  onChange: (markdown: string) => void;
@@ -10,6 +11,8 @@ export type RichTextAreaProps = {
10
11
  optional?: boolean | string;
11
12
  required?: boolean | string;
12
13
  error?: string;
14
+ /** Used for the bottomToolbar */
15
+ bottomToolbar?: ReactNode;
13
16
  /** Optional upload handler that returns a display src and optional stable image ref. */
14
17
  onImageUpload?: OnImageUploadFn;
15
18
  /** Optional remove handler for deleting persisted images by stable ref. */
@@ -0,0 +1,8 @@
1
+ import type { StoryFn } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ tags: string[];
5
+ };
6
+ export default meta;
7
+ export declare const Overview: StoryFn;
8
+ export declare const Lookup: StoryFn;
@@ -0,0 +1,79 @@
1
+ export interface AisShipType {
2
+ readonly id: string;
3
+ readonly label: string;
4
+ readonly aisCodes: readonly string[];
5
+ readonly color: string;
6
+ readonly borderColor: string;
7
+ }
8
+ export declare const AIS_SHIP_TYPES: readonly [{
9
+ readonly id: "passasjer";
10
+ readonly label: "Passasjer";
11
+ readonly aisCodes: readonly ["40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69"];
12
+ readonly color: "#085382";
13
+ readonly borderColor: "#022C55";
14
+ }, {
15
+ readonly id: "fritidsbat";
16
+ readonly label: "Fritidsbåt";
17
+ readonly aisCodes: readonly ["37"];
18
+ readonly color: "#83A9C0";
19
+ readonly borderColor: "#085382";
20
+ }, {
21
+ readonly id: "seilbat";
22
+ readonly label: "Seilbåt";
23
+ readonly aisCodes: readonly ["36"];
24
+ readonly color: "#83A9C0";
25
+ readonly borderColor: "#085382";
26
+ }, {
27
+ readonly id: "frakt";
28
+ readonly label: "Frakt";
29
+ readonly aisCodes: readonly ["33", "34", "53", "54", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79"];
30
+ readonly color: "#58A752";
31
+ readonly borderColor: "#0C6F06";
32
+ }, {
33
+ readonly id: "tank";
34
+ readonly label: "Tank";
35
+ readonly aisCodes: readonly ["80", "81", "82", "83", "84", "85", "86", "87", "88", "89"];
36
+ readonly color: "#535E62";
37
+ readonly borderColor: "#19191A";
38
+ }, {
39
+ readonly id: "fiske";
40
+ readonly label: "Fiske";
41
+ readonly aisCodes: readonly ["30"];
42
+ readonly color: "#F48B68";
43
+ readonly borderColor: "#EC481E";
44
+ }, {
45
+ readonly id: "tau";
46
+ readonly label: "Tau";
47
+ readonly aisCodes: readonly ["31", "32", "52"];
48
+ readonly color: "#FFD666";
49
+ readonly borderColor: "#CC9600";
50
+ }, {
51
+ readonly id: "militaer";
52
+ readonly label: "Militær";
53
+ readonly aisCodes: readonly ["35"];
54
+ readonly color: "#5D6533";
55
+ readonly borderColor: "#013200";
56
+ }, {
57
+ readonly id: "redning";
58
+ readonly label: "Redning";
59
+ readonly aisCodes: readonly ["51", "55", "58"];
60
+ readonly color: "#FFEA00";
61
+ readonly borderColor: "#19191A";
62
+ }, {
63
+ readonly id: "los";
64
+ readonly label: "Los";
65
+ readonly aisCodes: readonly ["50"];
66
+ readonly color: "#FF701A";
67
+ readonly borderColor: "#820000";
68
+ }, {
69
+ readonly id: "ukjent";
70
+ readonly label: "Ukjent";
71
+ readonly aisCodes: readonly ["20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "56", "57", "59", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99"];
72
+ readonly color: "#CCCCCC";
73
+ readonly borderColor: "#404040";
74
+ }];
75
+ export type AisShipTypeEntry = (typeof AIS_SHIP_TYPES)[number];
76
+ export type AisShipTypeId = AisShipTypeEntry['id'];
77
+ export type AisCode = AisShipTypeEntry['aisCodes'][number];
78
+ export declare function getShipTypeByAisCode(code: string | number): AisShipTypeEntry | undefined;
79
+ export declare function getShipTypeById(id: AisShipTypeId): AisShipTypeEntry | undefined;
@@ -1,6 +1,8 @@
1
1
  import './css/index.scss';
2
2
  import '@material-symbols/font-400/outlined.css';
3
3
  export type { SupportedLanguage, ScreenSize } from './utils/types';
4
+ export { AIS_SHIP_TYPES, getShipTypeByAisCode, getShipTypeById } from './data/ais/shipTypes';
5
+ export type { AisShipType, AisShipTypeEntry, AisShipTypeId, AisCode } from './data/ais/shipTypes';
4
6
  export { default as DeprecatedErrorLabel, type ErrorLabelProps as DeprecatedErrorLabelProps, } from './components/deprecated/ErrorLabel/errorLabel';
5
7
  export { default as DeprecatedInputLabel, type InputLabelProps as DeprecatedInputLabelProps, } from './components/deprecated/InputLabel/inputLabel';
6
8
  export { Details as DeprecatedDetails, type DetailsProps as DeprecatedDetailsProps, } from './components/deprecated/Details/Details';
@@ -85,6 +87,8 @@ export { SideSheet, type SideSheetProps } from './components/kystverket/SideShee
85
87
  export type { SideSheetSize, SideSheetPlacement, SideSheetMode, SideSheetHeadingSize, SideSheetLayoutProps, } from './components/kystverket/SideSheet/SideSheet.types';
86
88
  export { Suggestion } from './components/designsystemet/Suggestion/Suggestion';
87
89
  export type { SuggestionProps } from './components/designsystemet/Suggestion/Suggestion';
90
+ export type { ChipButtonProps, ChipCheckboxProps, ChipRadioProps, ChipRemovableProps, } from './components/designsystemet/Chip';
91
+ export { Chip, ChipButton, ChipCheckbox, ChipRadio, ChipRemovable } from './components/designsystemet/Chip';
88
92
  export { RovingFocusItem, RovingFocusRoot, omit, useCheckboxGroup, useDebounceCallback, useIsomorphicLayoutEffect, useMediaQuery, usePagination, useRadioGroup, useSynchronizedAnimation, } from '@digdir/designsystemet-react';
89
93
  export type { Size, UseRadioGroupProps, UseCheckboxGroupProps, UsePaginationProps, MergeRight, LabelRequired, } from '@digdir/designsystemet-react';
90
94
  export type { BadgePositionProps, BadgeProps } from '@digdir/designsystemet-react';
@@ -97,8 +101,6 @@ export type { CardBlockProps, CardProps } from '@digdir/designsystemet-react';
97
101
  export { Card, CardBlock } from '@digdir/designsystemet-react';
98
102
  export type { CheckboxProps } from '@digdir/designsystemet-react';
99
103
  export { Checkbox } from '@digdir/designsystemet-react';
100
- export type { ChipButtonProps, ChipCheckboxProps, ChipRadioProps, ChipRemovableProps, } from '@digdir/designsystemet-react';
101
- export { Chip, ChipButton, ChipCheckbox, ChipRadio, ChipRemovable } from '@digdir/designsystemet-react';
102
104
  export type { DetailsContentProps, DetailsProps, DetailsSummaryProps } from '@digdir/designsystemet-react';
103
105
  export { Details, DetailsContent, DetailsSummary } from '@digdir/designsystemet-react';
104
106
  export type { DialogBlockProps, DialogTriggerContextProps, DialogTriggerProps } from '@digdir/designsystemet-react';