@kystverket/styrbord 1.15.3 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/designsystemet/Avatar/Avatar.d.ts +4 -0
- package/dist/src/components/designsystemet/Avatar/Avatar.stories.d.ts +1 -0
- package/dist/src/components/designsystemet/Checkbox/Checkbox.stories.d.ts +9 -9
- package/dist/src/components/designsystemet/Paragraph/Paragraph.d.ts +10 -0
- package/dist/src/components/designsystemet/Paragraph/typography.paragraph.stories.d.ts +24 -0
- package/dist/src/components/designsystemet/Text/Text.d.ts +13 -0
- package/dist/src/components/designsystemet/Text/Text.stories.d.ts +89 -0
- package/dist/src/components/kystverket/{DateTimePicker → DateAndTimePickers/DateTimePicker}/DateTimePicker.d.ts +2 -1
- package/dist/src/components/kystverket/{DateTimePicker → DateAndTimePickers/DateTimePicker}/DateTimePicker.stories.d.ts +10 -2
- package/dist/src/components/kystverket/{Datepicker → DateAndTimePickers/Datepicker}/Datepicker.d.ts +3 -2
- package/dist/src/components/kystverket/{Datepicker → DateAndTimePickers/Datepicker}/Datepicker.stories.d.ts +12 -4
- package/dist/src/components/kystverket/DateAndTimePickers/TimePicker/TimePicker.d.ts +19 -0
- package/dist/src/components/kystverket/DateAndTimePickers/TimePicker/TimePicker.stories.d.ts +42 -0
- package/dist/src/components/kystverket/FileUploader/FileUploader.stories.d.ts +1 -1
- package/dist/src/components/kystverket/Icon/icon.types.d.ts +1 -1
- package/dist/src/components/kystverket/SideSheet/Layout/SideSheetLayout.d.ts +2 -2
- package/dist/src/components/kystverket/SideSheet/SideSheet.stories.d.ts +28 -1
- package/dist/src/components/kystverket/SideSheet/SideSheet.types.d.ts +7 -16
- package/dist/src/components/kystverket/Typography/typography.accent.stories.d.ts +1 -1
- package/dist/src/components/kystverket/Typography/typography.d.ts +13 -10
- package/dist/src/components/kystverket/Typography/typography.label.stories.d.ts +1 -1
- package/dist/src/components/kystverket/Typography/typography.util.d.ts +4 -1
- package/dist/src/hooks/useBodyScrollLock.d.ts +1 -0
- package/dist/src/main.d.ts +12 -7
- package/dist/src/utils/idContext.d.ts +2 -2
- package/dist/src/utils/useMediaQuery.d.ts +14 -0
- package/dist/style.css +1 -1
- package/dist/style.js +2586 -2338
- package/dist/style.umd.cjs +7 -7
- package/package.json +1 -1
- package/dist/src/components/kystverket/Typography/typography.body.stories.d.ts +0 -12
- package/dist/src/components/kystverket/Typography/typography.paragraph.stories.d.ts +0 -15
|
@@ -17,6 +17,10 @@ export type AvatarProps = MergeRight<DsAvatarProps, (AriaLabel | AriaHidden) & {
|
|
|
17
17
|
* Tooltip text to display on hover.
|
|
18
18
|
*/
|
|
19
19
|
tooltip?: string;
|
|
20
|
+
/**
|
|
21
|
+
* When true, overlays a checkmark on the avatar with a subtle dimming effect.
|
|
22
|
+
*/
|
|
23
|
+
checked?: boolean;
|
|
20
24
|
}>;
|
|
21
25
|
export declare const Avatar: FC<AvatarProps>;
|
|
22
26
|
export {};
|
|
@@ -43,14 +43,14 @@ export declare const Disabled: {
|
|
|
43
43
|
disabled: boolean;
|
|
44
44
|
id?: string | undefined | undefined;
|
|
45
45
|
children?: React.ReactNode;
|
|
46
|
-
className?: string | undefined | undefined;
|
|
47
|
-
width?: number | string | undefined | undefined;
|
|
48
46
|
form?: string | undefined | undefined;
|
|
49
|
-
color?: string | undefined | undefined;
|
|
50
47
|
slot?: string | undefined | undefined;
|
|
51
48
|
style?: React.CSSProperties | undefined;
|
|
52
49
|
title?: string | undefined | undefined;
|
|
53
50
|
pattern?: string | undefined | undefined;
|
|
51
|
+
className?: string | undefined | undefined;
|
|
52
|
+
width?: number | string | undefined | undefined;
|
|
53
|
+
color?: string | undefined | undefined;
|
|
54
54
|
'data-color'?: import("@digdir/designsystemet-react/colors").Color | undefined;
|
|
55
55
|
'data-size'?: import("@digdir/designsystemet-react").Size | undefined;
|
|
56
56
|
defaultChecked?: boolean | undefined | undefined;
|
|
@@ -360,14 +360,14 @@ export declare const Disabled: {
|
|
|
360
360
|
disabled: boolean;
|
|
361
361
|
id?: string | undefined | undefined;
|
|
362
362
|
children?: React.ReactNode;
|
|
363
|
-
className?: string | undefined | undefined;
|
|
364
|
-
width?: number | string | undefined | undefined;
|
|
365
363
|
form?: string | undefined | undefined;
|
|
366
|
-
color?: string | undefined | undefined;
|
|
367
364
|
slot?: string | undefined | undefined;
|
|
368
365
|
style?: React.CSSProperties | undefined;
|
|
369
366
|
title?: string | undefined | undefined;
|
|
370
367
|
pattern?: string | undefined | undefined;
|
|
368
|
+
className?: string | undefined | undefined;
|
|
369
|
+
width?: number | string | undefined | undefined;
|
|
370
|
+
color?: string | undefined | undefined;
|
|
371
371
|
'data-color'?: import("@digdir/designsystemet-react/colors").Color | undefined;
|
|
372
372
|
'data-size'?: import("@digdir/designsystemet-react").Size | undefined;
|
|
373
373
|
defaultChecked?: boolean | undefined | undefined;
|
|
@@ -677,14 +677,14 @@ export declare const Disabled: {
|
|
|
677
677
|
disabled: boolean;
|
|
678
678
|
id?: string | undefined | undefined;
|
|
679
679
|
children?: React.ReactNode;
|
|
680
|
-
className?: string | undefined | undefined;
|
|
681
|
-
width?: number | string | undefined | undefined;
|
|
682
680
|
form?: string | undefined | undefined;
|
|
683
|
-
color?: string | undefined | undefined;
|
|
684
681
|
slot?: string | undefined | undefined;
|
|
685
682
|
style?: React.CSSProperties | undefined;
|
|
686
683
|
title?: string | undefined | undefined;
|
|
687
684
|
pattern?: string | undefined | undefined;
|
|
685
|
+
className?: string | undefined | undefined;
|
|
686
|
+
width?: number | string | undefined | undefined;
|
|
687
|
+
color?: string | undefined | undefined;
|
|
688
688
|
'data-color'?: import("@digdir/designsystemet-react/colors").Color | undefined;
|
|
689
689
|
'data-size'?: import("@digdir/designsystemet-react").Size | undefined;
|
|
690
690
|
defaultChecked?: boolean | undefined | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ParagraphProps as DsParagraphProps } from '@digdir/designsystemet-react';
|
|
2
|
+
export type ParagraphProps = DsParagraphProps & {
|
|
3
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
/** @deprecated Use `fontWeight="medium"` instead. */
|
|
5
|
+
strong?: boolean;
|
|
6
|
+
weight?: 'regular' | 'medium' | 'semibold';
|
|
7
|
+
'data-color-subtle'?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const Paragraph: ({ size, strong, weight, "data-color-subtle": colorSubtle, className, children, ...props }: ParagraphProps) => React.JSX.Element;
|
|
10
|
+
export default Paragraph;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ size, strong, weight, "data-color-subtle": colorSubtle, className, children, ...props }: import("~/main").ParagraphProps) => React.JSX.Element;
|
|
5
|
+
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
|
|
6
|
+
tags: string[];
|
|
7
|
+
argTypes: {
|
|
8
|
+
size: {
|
|
9
|
+
control: "select";
|
|
10
|
+
options: string[];
|
|
11
|
+
};
|
|
12
|
+
weight: {
|
|
13
|
+
control: "select";
|
|
14
|
+
options: (string | undefined)[];
|
|
15
|
+
};
|
|
16
|
+
'data-color-subtle': {
|
|
17
|
+
control: "boolean";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
export declare const Preview: Story;
|
|
24
|
+
export declare const Examples: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ParagraphProps } from '../Paragraph/Paragraph';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
export declare const colorValues: readonly ["primary", "accent", "neutral", "extra1", "extra2", "success", "danger", "info", "warning", "focus", "hav", "stein", "gress", "sol", "lyng", "himmel", "sand", "fyr", "dyphav", "skog"];
|
|
4
|
+
export declare const textWrapValues: readonly ["wrap", "balance", "pretty", "nowrap"];
|
|
5
|
+
export declare const textTransformValues: readonly ["none", "capitalize", "uppercase", "lowercase"];
|
|
6
|
+
export declare const textAlignValues: readonly ["left", "center", "right", "justify"];
|
|
7
|
+
export type TextProps = Pick<ParagraphProps, 'weight' | 'data-color-subtle' | 'data-size' | 'size'> & Omit<HTMLAttributes<HTMLSpanElement>, 'color'> & {
|
|
8
|
+
['data-color']?: (typeof colorValues)[number];
|
|
9
|
+
wrap?: (typeof textWrapValues)[number];
|
|
10
|
+
transform?: (typeof textTransformValues)[number];
|
|
11
|
+
align?: (typeof textAlignValues)[number];
|
|
12
|
+
};
|
|
13
|
+
export declare const Text: ({ weight, "data-color-subtle": colorSubtle, ["data-color"]: color, wrap, transform, align, className, style, children, ...props }: TextProps) => React.JSX.Element;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { StoryFn, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Text, TextProps } from '~/main';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
docs: {
|
|
7
|
+
description: {
|
|
8
|
+
component: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
component: ({ weight, "data-color-subtle": colorSubtle, ["data-color"]: color, wrap, transform, align, className, style, children, ...props }: TextProps) => React.JSX.Element;
|
|
13
|
+
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
|
|
14
|
+
tags: string[];
|
|
15
|
+
argTypes: {
|
|
16
|
+
'data-size': {
|
|
17
|
+
control: "select";
|
|
18
|
+
options: string[];
|
|
19
|
+
table: {
|
|
20
|
+
defaultValue: {
|
|
21
|
+
summary: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
weight: {
|
|
26
|
+
control: "select";
|
|
27
|
+
options: (string | undefined)[];
|
|
28
|
+
table: {
|
|
29
|
+
defaultValue: {
|
|
30
|
+
summary: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
"data-color": {
|
|
35
|
+
control: "select";
|
|
36
|
+
options: ("info" | "warning" | "hav" | "stein" | "gress" | "sol" | "lyng" | "himmel" | "sand" | "fyr" | "dyphav" | "skog" | "primary" | "accent" | "neutral" | "extra1" | "extra2" | "success" | "danger" | "focus" | undefined)[];
|
|
37
|
+
table: {
|
|
38
|
+
defaultValue: {
|
|
39
|
+
summary: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
'data-color-subtle': {
|
|
44
|
+
control: "boolean";
|
|
45
|
+
table: {
|
|
46
|
+
defaultValue: {
|
|
47
|
+
summary: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
wrap: {
|
|
52
|
+
control: "select";
|
|
53
|
+
options: ("wrap" | "nowrap" | "balance" | "pretty" | undefined)[];
|
|
54
|
+
table: {
|
|
55
|
+
defaultValue: {
|
|
56
|
+
summary: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
transform: {
|
|
61
|
+
control: "select";
|
|
62
|
+
options: ("none" | "capitalize" | "lowercase" | "uppercase" | undefined)[];
|
|
63
|
+
table: {
|
|
64
|
+
defaultValue: {
|
|
65
|
+
summary: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
align: {
|
|
70
|
+
control: "select";
|
|
71
|
+
options: ("center" | "justify" | "left" | "right" | undefined)[];
|
|
72
|
+
table: {
|
|
73
|
+
defaultValue: {
|
|
74
|
+
summary: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export default meta;
|
|
81
|
+
type Story = StoryObj<typeof meta>;
|
|
82
|
+
export declare const Preview: Story;
|
|
83
|
+
export declare const Sizes: StoryFn<typeof Text>;
|
|
84
|
+
export declare const Weights: StoryFn<typeof Text>;
|
|
85
|
+
export declare const Colors: StoryFn<typeof Text>;
|
|
86
|
+
export declare const TextWrap: StoryFn<typeof Text>;
|
|
87
|
+
export declare const TextTransform: StoryFn<typeof Text>;
|
|
88
|
+
export declare const TextAlign: StoryFn<typeof Text>;
|
|
89
|
+
export declare const Examples: StoryFn<typeof Text>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InputSize } from '~/
|
|
1
|
+
import { InputSize } from '~/main';
|
|
2
2
|
export interface DateTimePickerProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
optional?: boolean | string | undefined;
|
|
@@ -14,5 +14,6 @@ export interface DateTimePickerProps {
|
|
|
14
14
|
maxDate?: Date;
|
|
15
15
|
size?: InputSize;
|
|
16
16
|
disabled?: boolean;
|
|
17
|
+
readOnly?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export declare const DateTimePicker: ({ size, className, label, loading, required, optional, onChange, value, minDate, maxDate, ...props }: DateTimePickerProps) => React.JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import { DateTimePickerProps } from './DateTimePicker';
|
|
3
|
+
import { InputSize } from '~/utils/input/input';
|
|
3
4
|
declare const meta: {
|
|
4
5
|
title: string;
|
|
5
6
|
component: (props: DateTimePickerProps) => React.JSX.Element;
|
|
@@ -16,11 +17,17 @@ declare const meta: {
|
|
|
16
17
|
onChange?: ((date: Date | undefined) => void) | undefined;
|
|
17
18
|
minDate?: Date | undefined;
|
|
18
19
|
maxDate?: Date | undefined;
|
|
19
|
-
size?:
|
|
20
|
+
size?: InputSize | undefined;
|
|
20
21
|
disabled?: boolean | undefined;
|
|
22
|
+
readOnly?: boolean | undefined;
|
|
21
23
|
}>) => React.JSX.Element))[];
|
|
22
24
|
tags: string[];
|
|
23
|
-
argTypes: {
|
|
25
|
+
argTypes: {
|
|
26
|
+
size: {
|
|
27
|
+
control: "select";
|
|
28
|
+
options: InputSize[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
24
31
|
};
|
|
25
32
|
export default meta;
|
|
26
33
|
type Story = StoryObj<typeof meta>;
|
|
@@ -35,3 +42,4 @@ export declare const WithMinDate: Story;
|
|
|
35
42
|
export declare const WithMaxDate: Story;
|
|
36
43
|
export declare const WithMinAndMaxDate: Story;
|
|
37
44
|
export declare const Disabled: Story;
|
|
45
|
+
export declare const ReadOnly: Story;
|
package/dist/src/components/kystverket/{Datepicker → DateAndTimePickers/Datepicker}/Datepicker.d.ts
RENAMED
|
@@ -3,8 +3,8 @@ export interface DatepickerProps {
|
|
|
3
3
|
className?: string;
|
|
4
4
|
loading?: boolean;
|
|
5
5
|
size?: InputSize;
|
|
6
|
-
optional?: boolean | string
|
|
7
|
-
required?: boolean | string
|
|
6
|
+
optional?: boolean | string;
|
|
7
|
+
required?: boolean | string;
|
|
8
8
|
label: string;
|
|
9
9
|
description?: string;
|
|
10
10
|
error?: string;
|
|
@@ -14,5 +14,6 @@ export interface DatepickerProps {
|
|
|
14
14
|
minDate?: Date;
|
|
15
15
|
maxDate?: Date;
|
|
16
16
|
disabled?: boolean;
|
|
17
|
+
readOnly?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export declare const Datepicker: ({ size, className, label, loading, required, optional, onChange, value, minDate, maxDate, ...props }: DatepickerProps) => React.JSX.Element;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import { DatepickerProps } from './Datepicker';
|
|
3
|
+
import { InputSize } from '~/utils/input/input';
|
|
3
4
|
declare const meta: {
|
|
4
5
|
title: string;
|
|
5
6
|
component: (props: DatepickerProps) => React.JSX.Element;
|
|
6
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, {
|
|
7
8
|
className?: string | undefined;
|
|
8
9
|
loading?: boolean | undefined;
|
|
9
|
-
size?:
|
|
10
|
-
optional?: boolean | string | undefined
|
|
11
|
-
required?: boolean | string | undefined
|
|
10
|
+
size?: InputSize | undefined;
|
|
11
|
+
optional?: boolean | string | undefined;
|
|
12
|
+
required?: boolean | string | undefined;
|
|
12
13
|
label: string;
|
|
13
14
|
description?: string | undefined;
|
|
14
15
|
error?: string | undefined;
|
|
@@ -18,9 +19,15 @@ declare const meta: {
|
|
|
18
19
|
minDate?: Date | undefined;
|
|
19
20
|
maxDate?: Date | undefined;
|
|
20
21
|
disabled?: boolean | undefined;
|
|
22
|
+
readOnly?: boolean | undefined;
|
|
21
23
|
}>) => React.JSX.Element))[];
|
|
22
24
|
tags: string[];
|
|
23
|
-
argTypes: {
|
|
25
|
+
argTypes: {
|
|
26
|
+
size: {
|
|
27
|
+
control: "select";
|
|
28
|
+
options: InputSize[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
24
31
|
};
|
|
25
32
|
export default meta;
|
|
26
33
|
type Story = StoryObj<typeof meta>;
|
|
@@ -35,3 +42,4 @@ export declare const WithMinDate: Story;
|
|
|
35
42
|
export declare const WithMaxDate: Story;
|
|
36
43
|
export declare const WithMinAndMaxDate: Story;
|
|
37
44
|
export declare const Disabled: Story;
|
|
45
|
+
export declare const ReadOnly: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { InputSize } from '~/main';
|
|
2
|
+
export interface TimePickerProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
size?: InputSize;
|
|
6
|
+
optional?: boolean | string;
|
|
7
|
+
required?: boolean | string;
|
|
8
|
+
label: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
onBlur?: () => void;
|
|
12
|
+
value: Date | undefined;
|
|
13
|
+
onChange?: (date: Date | undefined) => void;
|
|
14
|
+
minTime?: Date;
|
|
15
|
+
maxTime?: Date;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
readOnly?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const TimePicker: ({ size, className, label, loading, required, optional, onChange, value, minTime, maxTime, ...props }: TimePickerProps) => React.JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { TimePickerProps } from './TimePicker';
|
|
3
|
+
import { InputSize } from '~/utils/input/input';
|
|
4
|
+
declare const meta: {
|
|
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, {
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
loading?: boolean | undefined;
|
|
10
|
+
size?: InputSize | undefined;
|
|
11
|
+
optional?: boolean | string | undefined;
|
|
12
|
+
required?: boolean | string | undefined;
|
|
13
|
+
label: string;
|
|
14
|
+
description?: string | undefined;
|
|
15
|
+
error?: string | undefined;
|
|
16
|
+
onBlur?: (() => void) | undefined;
|
|
17
|
+
value: Date | undefined;
|
|
18
|
+
onChange?: ((date: Date | undefined) => void) | undefined;
|
|
19
|
+
minTime?: Date | undefined;
|
|
20
|
+
maxTime?: Date | undefined;
|
|
21
|
+
disabled?: boolean | undefined;
|
|
22
|
+
readOnly?: boolean | undefined;
|
|
23
|
+
}>) => React.JSX.Element))[];
|
|
24
|
+
tags: string[];
|
|
25
|
+
argTypes: {
|
|
26
|
+
size: {
|
|
27
|
+
control: "select";
|
|
28
|
+
options: InputSize[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export default meta;
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
34
|
+
export declare const Default: Story;
|
|
35
|
+
export declare const WithoutDescription: Story;
|
|
36
|
+
export declare const WithValue: Story;
|
|
37
|
+
export declare const Optional: Story;
|
|
38
|
+
export declare const OptionalText: Story;
|
|
39
|
+
export declare const Required: Story;
|
|
40
|
+
export declare const WithError: Story;
|
|
41
|
+
export declare const Disabled: Story;
|
|
42
|
+
export declare const ReadOnly: Story;
|
|
@@ -6,7 +6,7 @@ declare const meta: {
|
|
|
6
6
|
component: (props: FileUploaderProps) => React.JSX.Element;
|
|
7
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, {
|
|
8
8
|
label: string;
|
|
9
|
-
description?: React.ReactNode
|
|
9
|
+
description?: string[] | React.ReactNode;
|
|
10
10
|
error?: string | null | undefined;
|
|
11
11
|
multiple?: boolean | undefined;
|
|
12
12
|
files: FileInfo[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const iconIdList: readonly ["add_box", "add_location_alt", "add_location", "add_notes", "add", "adjust", "air", "alternate_email", "anchor", "apps", "archive", "arrow_back", "arrow_downward", "arrow_forward", "arrow_right_alt", "arrow_upward", "article", "assignment", "attach_email", "attach_file", "autorenew", "backspace", "backup", "book_4", "bottom_panel_close", "bottom_panel_open", "cached", "calendar_month", "change_history", "chat_add_on", "chat_bubble", "chat", "check_circle", "check", "chevron_left", "chevron_right", "circle", "close", "cloud_alert", "cloud_done", "code_blocks", "comment", "compare_arrows", "compare", "content_copy", "conversation", "copy_all", "cycle", "dark_mode", "data_table", "delete_history", "delete", "description", "difference", "directions_boat", "directory_sync", "distance", "document_search", "domain", "download", "drafts", "edit_document", "edit_location_alt", "edit_location", "edit_square", "edit", "error", "event", "explore_nearby", "explore", "export_notes", "exposure_zero", "favorite", "file_map_stack", "file_map", "file_save", "folder_check_2", "folder_match", "folder_off", "folder_open", "folder_supervised", "folder", "format_align_center", "format_align_justify", "format_align_left", "format_align_right", "format_bold", "format_italic", "format_list_bulleted", "format_list_numbered", "format_size", "forum", "forward_to_inbox", "forward", "globe_uk", "groups", "history_off", "history_toggle_off", "history", "image", "inbox", "info_i", "info", "keep_off", "keep", "keyboard_arrow_down", "keyboard_arrow_up", "language", "layers", "left_panel_close", "left_panel_open", "light_mode", "lightbulb", "link", "location_chip", "lock", "login", "logout", "mail_shield", "mail", "manage_history", "manage_search", "map_pin_heart", "map", "mark_as_unread", "mark_chat_read", "mark_chat_unread", "mark_email_read", "mark_email_unread", "match_case", "menu_open", "menu", "mode_cool", "more_vert", "move_to_inbox", "move", "note_stack_add", "note_stack", "notification_add", "numbers", "open_in_new", "pan_zoom", "pending_actions", "person_add", "person_pin_circle", "person_pin", "person", "photo_camera", "picture_as_pdf", "pin_drop", "pin_history", "question_exchange", "radio_button_checked", "radio_button_unchecked", "redo", "reply_all", "reply", "right_panel_close", "right_panel_open", "sailing", "save", "send_and_archive", "send", "settings_input_antenna", "settings", "severe_cold", "sort", "source_environment", "splitscreen_landscape", "stacked_email", "stylus", "sync", "text_compare", "text_snippet", "timeline", "top_panel_close", "top_panel_open", "tsunami", "undo", "unknown_document", "upload", "vertical_align_bottom", "vertical_align_top", "video_library", "videocam", "view_list", "visibility", "vital_signs", "warning", "water", "waves", "zoom_in_map", "zoom_out_map"];
|
|
1
|
+
export declare const iconIdList: readonly ["add_box", "add_location_alt", "add_location", "add_notes", "add", "adjust", "air", "alternate_email", "anchor", "apps", "archive", "arrow_back", "arrow_downward", "arrow_forward", "arrow_right_alt", "arrow_upward", "article", "assignment", "attach_email", "attach_file", "autorenew", "backspace", "backup", "book_4", "bottom_panel_close", "bottom_panel_open", "cached", "calendar_month", "change_history", "chat_add_on", "chat_bubble", "chat", "check_circle", "check", "chevron_left", "chevron_right", "circle", "close", "cloud_alert", "cloud_done", "code_blocks", "comment", "compare_arrows", "compare", "content_copy", "conversation", "copy_all", "cycle", "dark_mode", "data_table", "delete_history", "delete", "description", "difference", "directions_boat", "directory_sync", "distance", "document_search", "domain", "download", "drafts", "edit_document", "edit_location_alt", "edit_location", "edit_square", "edit", "error", "event", "explore_nearby", "explore", "export_notes", "exposure_zero", "favorite", "file_map_stack", "file_map", "file_save", "folder_check_2", "folder_match", "folder_off", "folder_open", "folder_supervised", "folder", "format_align_center", "format_align_justify", "format_align_left", "format_align_right", "format_bold", "format_italic", "format_list_bulleted", "format_list_numbered", "format_size", "forum", "forward_to_inbox", "forward", "globe_uk", "groups", "history_off", "history_toggle_off", "history", "image", "inbox", "info_i", "info", "keep_off", "keep", "keyboard_arrow_down", "keyboard_arrow_up", "language", "layers", "left_panel_close", "left_panel_open", "light_mode", "lightbulb", "link", "location_chip", "lock", "login", "logout", "mail_shield", "mail", "manage_history", "manage_search", "map_pin_heart", "map", "mark_as_unread", "mark_chat_read", "mark_chat_unread", "mark_email_read", "mark_email_unread", "match_case", "menu_open", "menu", "mode_cool", "more_vert", "move_to_inbox", "move", "note_stack_add", "note_stack", "notification_add", "numbers", "open_in_new", "pan_zoom", "pending_actions", "person_add", "person_pin_circle", "person_pin", "person", "photo_camera", "picture_as_pdf", "pin_drop", "pin_history", "question_exchange", "radio_button_checked", "radio_button_unchecked", "redo", "reply_all", "reply", "right_panel_close", "right_panel_open", "sailing", "save", "schedule", "send_and_archive", "send", "settings_input_antenna", "settings", "severe_cold", "sort", "source_environment", "splitscreen_landscape", "stacked_email", "stylus", "sync", "text_compare", "text_snippet", "timeline", "top_panel_close", "top_panel_open", "tsunami", "undo", "unknown_document", "upload", "vertical_align_bottom", "vertical_align_top", "video_library", "videocam", "view_list", "visibility", "vital_signs", "warning", "water", "waves", "zoom_in_map", "zoom_out_map"];
|
|
2
2
|
export type IconId = (typeof iconIdList)[number];
|
|
@@ -3,7 +3,7 @@ import type { SideSheetLayoutProps } from '~/components/kystverket/SideSheet/Sid
|
|
|
3
3
|
export declare const SideSheetLayoutContext: React.Context<boolean>;
|
|
4
4
|
export declare function useSideSheetLayoutContext(): boolean;
|
|
5
5
|
/**
|
|
6
|
-
* Required wrapper when using `pinnable` or `
|
|
6
|
+
* Required wrapper when using `pinnable` or `defaultPinned`.
|
|
7
7
|
*
|
|
8
8
|
* Renders as a flex container so that a pinned SideSheet takes a fixed width
|
|
9
9
|
* and the remaining content fills the rest of the row.
|
|
@@ -15,4 +15,4 @@ export declare function useSideSheetLayoutContext(): boolean;
|
|
|
15
15
|
* </SideSheet.Layout>
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
export declare function SideSheetLayout({ children, className, style }: SideSheetLayoutProps): React.JSX.Element;
|
|
18
|
+
export declare function SideSheetLayout({ children, className, style }: Readonly<SideSheetLayoutProps>): React.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { StoryFn } from '@storybook/react-vite';
|
|
2
|
+
import { SideSheetButtons } from '~/components/kystverket/SideSheet/Buttons/SideSheetButtons';
|
|
2
3
|
import { SideSheet } from '~/main';
|
|
3
4
|
declare const _default: {
|
|
4
5
|
title: string;
|
|
@@ -6,7 +7,7 @@ declare const _default: {
|
|
|
6
7
|
ref?: React.Ref<HTMLElement>;
|
|
7
8
|
}) => React.JSX.Element) & {
|
|
8
9
|
Layout: typeof import("./Layout/SideSheetLayout").SideSheetLayout;
|
|
9
|
-
Buttons: typeof
|
|
10
|
+
Buttons: typeof SideSheetButtons;
|
|
10
11
|
};
|
|
11
12
|
tags: string[];
|
|
12
13
|
parameters: {
|
|
@@ -15,8 +16,33 @@ declare const _default: {
|
|
|
15
16
|
source: {
|
|
16
17
|
type: string;
|
|
17
18
|
};
|
|
19
|
+
description: {
|
|
20
|
+
component: string;
|
|
21
|
+
};
|
|
18
22
|
};
|
|
19
23
|
};
|
|
24
|
+
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
25
|
+
open?: boolean | undefined;
|
|
26
|
+
onClose?: (() => void) | undefined;
|
|
27
|
+
placement?: import("~/main").SideSheetPlacement | undefined;
|
|
28
|
+
size?: import("~/main").SideSheetSize | undefined;
|
|
29
|
+
pinnable?: boolean | undefined;
|
|
30
|
+
pinned?: boolean | undefined;
|
|
31
|
+
onPinnedChange?: ((pinned: boolean) => void) | undefined;
|
|
32
|
+
defaultPinned?: boolean | undefined;
|
|
33
|
+
backdrop?: boolean | undefined;
|
|
34
|
+
title?: React.ReactNode;
|
|
35
|
+
showCloseButton?: boolean | undefined;
|
|
36
|
+
showBackButton?: boolean | undefined;
|
|
37
|
+
onBack?: (() => void) | undefined;
|
|
38
|
+
headerAction?: React.ReactNode;
|
|
39
|
+
headerDivider?: boolean | undefined;
|
|
40
|
+
footerDivider?: boolean | undefined;
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
className?: string | undefined;
|
|
43
|
+
style?: React.CSSProperties | undefined;
|
|
44
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
45
|
+
}>) => React.JSX.Element)[];
|
|
20
46
|
};
|
|
21
47
|
export default _default;
|
|
22
48
|
export declare const Default: StoryFn<typeof SideSheet>;
|
|
@@ -32,3 +58,4 @@ export declare const PinnedWithContent: StoryFn<typeof SideSheet>;
|
|
|
32
58
|
export declare const NoBackdrop: StoryFn<typeof SideSheet>;
|
|
33
59
|
export declare const TwoSheets: StoryFn<typeof SideSheet>;
|
|
34
60
|
export declare const WithTabs: StoryFn<typeof SideSheet>;
|
|
61
|
+
export declare const WithTopbarAndFooter: StoryFn<typeof SideSheet>;
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
export type SideSheetSize = 'sm' | 'md' | 'lg' | '33%' | '40%' | '50%' | '66%';
|
|
3
3
|
export type SideSheetPlacement = 'left' | 'right';
|
|
4
|
-
/**
|
|
5
|
-
* - `overlay`: sheet slides over content (default). Can be pinned by the user via `pinnable`.
|
|
6
|
-
* - `push`: sheet starts pinned and reflowing content inside `<SideSheet.Layout>`.
|
|
7
|
-
*/
|
|
8
|
-
export type SideSheetMode = 'overlay' | 'push';
|
|
9
|
-
export type SideSheetHeadingSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
10
4
|
export interface SideSheetProps {
|
|
11
5
|
open?: boolean;
|
|
12
6
|
onClose?: () => void;
|
|
13
7
|
placement?: SideSheetPlacement;
|
|
14
8
|
size?: SideSheetSize;
|
|
15
|
-
/**
|
|
16
|
-
* overlay: sheet floats over content (default).
|
|
17
|
-
* push: sheet starts pinned/expanded, reflowing content inside `<SideSheet.Layout>`.
|
|
18
|
-
*/
|
|
19
|
-
mode?: SideSheetMode;
|
|
20
9
|
/**
|
|
21
10
|
* Show a pin button in the header that lets the user toggle overlay/push.
|
|
22
11
|
* Default: `false`.
|
|
@@ -30,8 +19,9 @@ export interface SideSheetProps {
|
|
|
30
19
|
/** Called when the user toggles the pin button. */
|
|
31
20
|
onPinnedChange?: (pinned: boolean) => void;
|
|
32
21
|
/**
|
|
33
|
-
* Default pinned state for uncontrolled usage.
|
|
34
|
-
* `false`
|
|
22
|
+
* Default pinned state for uncontrolled usage. `true` starts the sheet pinned/expanded,
|
|
23
|
+
* reflowing content inside `<SideSheet.Layout>` (push mode). Default: `false` (overlay).
|
|
24
|
+
* BEWARE: On phone it always starts unpinned regardless of this.
|
|
35
25
|
*/
|
|
36
26
|
defaultPinned?: boolean;
|
|
37
27
|
/**
|
|
@@ -39,10 +29,11 @@ export interface SideSheetProps {
|
|
|
39
29
|
* Default: `true` (only applies in overlay/non-pinned state).
|
|
40
30
|
*/
|
|
41
31
|
backdrop?: boolean;
|
|
42
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Sheet heading. pass a string, or your own `<Heading>` (e.g.
|
|
34
|
+
* `<Heading data-size="xs">Title</Heading>`) to control its size and level.
|
|
35
|
+
*/
|
|
43
36
|
title?: ReactNode;
|
|
44
|
-
/** Font size of the heading. Default: `'xs'`. */
|
|
45
|
-
headingSize?: SideSheetHeadingSize;
|
|
46
37
|
/** Show the close (×) button. Default: `true`. */
|
|
47
38
|
showCloseButton?: boolean;
|
|
48
39
|
/** Show a back (←) button in the header. Default: `false`. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ strong, size, className, children }: import("./typography").AccentTypographyProps) => React.JSX.Element;
|
|
4
|
+
component: ({ strong, weight, size, className, children }: import("./typography").AccentTypographyProps) => React.JSX.Element;
|
|
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: {};
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { TypographyWeight } from './typography.util';
|
|
3
|
+
import { ParagraphProps } from '~/components/designsystemet/Paragraph/Paragraph';
|
|
2
4
|
export interface TypographyProps {
|
|
3
5
|
className?: string;
|
|
4
6
|
children?: ReactNode | undefined;
|
|
5
7
|
}
|
|
6
|
-
export type BodyTypographyProps =
|
|
7
|
-
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
8
|
-
strong?: boolean;
|
|
9
|
-
inline?: boolean;
|
|
10
|
-
};
|
|
8
|
+
export type BodyTypographyProps = ParagraphProps;
|
|
11
9
|
export type AccentTypographyProps = TypographyProps & {
|
|
12
10
|
size?: 'sm' | 'md';
|
|
11
|
+
/** @deprecated Use `weight="medium"` instead. */
|
|
13
12
|
strong?: boolean;
|
|
13
|
+
weight?: TypographyWeight;
|
|
14
14
|
};
|
|
15
15
|
export type LabelTypographyProps = TypographyProps & {
|
|
16
16
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
17
|
+
/** @deprecated Use `weight="medium"` instead. */
|
|
17
18
|
strong?: boolean;
|
|
19
|
+
weight?: TypographyWeight;
|
|
18
20
|
inline?: boolean;
|
|
19
21
|
};
|
|
20
|
-
|
|
21
|
-
export declare const
|
|
22
|
+
/** @deprecated Replaced by Paragraph, and extended props in Text component*/
|
|
23
|
+
export declare const Body: ({ size, strong, weight, "data-color-subtle": colorSubtle, className, children, ...props }: ParagraphProps) => React.JSX.Element;
|
|
24
|
+
export declare const Accent: ({ strong, weight, size, className, children }: AccentTypographyProps) => React.JSX.Element;
|
|
22
25
|
export declare const Typography: {
|
|
23
|
-
Body: ({
|
|
24
|
-
Accent: ({ strong, size, className, children }: AccentTypographyProps) => React.JSX.Element;
|
|
25
|
-
Label: ({ strong, size, className, children, inline }: LabelTypographyProps) => React.JSX.Element;
|
|
26
|
+
Body: ({ size, strong, weight, "data-color-subtle": colorSubtle, className, children, ...props }: ParagraphProps) => React.JSX.Element;
|
|
27
|
+
Accent: ({ strong, weight, size, className, children }: AccentTypographyProps) => React.JSX.Element;
|
|
28
|
+
Label: ({ strong, weight, size, className, children, inline }: LabelTypographyProps) => React.JSX.Element;
|
|
26
29
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ strong, size, className, children, inline }: import("./typography").LabelTypographyProps) => React.JSX.Element;
|
|
4
|
+
component: ({ strong, weight, size, className, children, inline }: import("./typography").LabelTypographyProps) => React.JSX.Element;
|
|
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: {};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
export type TypographyPrefix = 'body' | 'accent' | 'label';
|
|
2
2
|
export type AllSizes = 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
3
3
|
export type TypographyColor = 'accent' | 'neutral';
|
|
4
|
+
export type TypographyWeight = 'regular' | 'medium' | 'semibold';
|
|
4
5
|
type BuildTypographyProps = {
|
|
5
6
|
type: TypographyPrefix;
|
|
6
7
|
size?: AllSizes;
|
|
8
|
+
/** @deprecated Use `weight="medium"` instead. */
|
|
7
9
|
strong?: boolean;
|
|
10
|
+
weight?: TypographyWeight;
|
|
8
11
|
inline?: boolean;
|
|
9
12
|
color?: TypographyColor;
|
|
10
13
|
margin?: boolean;
|
|
11
14
|
className?: string;
|
|
12
15
|
};
|
|
13
|
-
export declare const buildTypographyClasses: ({ type, size, strong, inline, className, }: BuildTypographyProps) => string;
|
|
16
|
+
export declare const buildTypographyClasses: ({ type, size, strong, weight, inline, className, }: BuildTypographyProps) => string;
|
|
14
17
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useBodyScrollLock(locked: boolean): void;
|