@postenbring/hedwig-react 0.0.87 → 0.0.89
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/badge/badge.d.ts +7 -3
- package/dist/badge/badge.d.ts.map +1 -1
- package/dist/badge/badge.js.map +1 -1
- package/dist/badge/badge.mjs +1 -1
- package/dist/badge/index.js.map +1 -1
- package/dist/badge/index.mjs +1 -1
- package/dist/blockquote/blockquote.d.ts +29 -0
- package/dist/blockquote/blockquote.d.ts.map +1 -0
- package/dist/blockquote/blockquote.js +83 -0
- package/dist/blockquote/blockquote.js.map +1 -0
- package/dist/blockquote/blockquote.mjs +8 -0
- package/dist/blockquote/index.d.ts +3 -0
- package/dist/blockquote/index.d.ts.map +1 -0
- package/dist/blockquote/index.js +85 -0
- package/dist/blockquote/index.js.map +1 -0
- package/dist/blockquote/index.mjs +9 -0
- package/dist/chunk-3H7S7C3S.mjs +37 -0
- package/dist/chunk-3H7S7C3S.mjs.map +1 -0
- package/dist/{chunk-YIERXOCG.mjs → chunk-6ZO2TMOX.mjs} +2 -2
- package/dist/{chunk-F4EAUOJX.mjs → chunk-EAFQ3XQU.mjs} +2 -2
- package/dist/{chunk-OFY2FVXB.mjs → chunk-EGW3RCXD.mjs} +2 -2
- package/dist/chunk-EGW3RCXD.mjs.map +1 -0
- package/dist/{chunk-WEQIEPMT.mjs → chunk-JQGB77SS.mjs} +1 -1
- package/dist/chunk-JQGB77SS.mjs.map +1 -0
- package/dist/chunk-JYN2QSN2.mjs +36 -0
- package/dist/chunk-JYN2QSN2.mjs.map +1 -0
- package/dist/chunk-K2CB2NLY.mjs +1 -0
- package/dist/chunk-KFDS3IPB.mjs +1 -0
- package/dist/{chunk-YLBJMVIX.mjs → chunk-M7MG7ZQT.mjs} +2 -2
- package/dist/chunk-OE6RISJS.mjs +24 -0
- package/dist/chunk-OE6RISJS.mjs.map +1 -0
- package/dist/{chunk-TCO3ZAZW.mjs → chunk-OXZOGFNV.mjs} +1 -1
- package/dist/chunk-OXZOGFNV.mjs.map +1 -0
- package/dist/{chunk-GUNPGSAS.mjs → chunk-UL2V2Z5B.mjs} +12 -12
- package/dist/chunk-UL2V2Z5B.mjs.map +1 -0
- package/dist/chunk-XAFNJELJ.mjs +1 -0
- package/dist/chunk-XAFNJELJ.mjs.map +1 -0
- package/dist/{chunk-ZYTUK4B4.mjs → chunk-YS7HBWOI.mjs} +4 -3
- package/dist/chunk-YS7HBWOI.mjs.map +1 -0
- package/dist/figure/figure.d.ts +22 -0
- package/dist/figure/figure.d.ts.map +1 -0
- package/dist/figure/figure.js +71 -0
- package/dist/figure/figure.js.map +1 -0
- package/dist/figure/figure.mjs +8 -0
- package/dist/figure/figure.mjs.map +1 -0
- package/dist/figure/index.d.ts +3 -0
- package/dist/figure/index.d.ts.map +1 -0
- package/dist/figure/index.js +73 -0
- package/dist/figure/index.js.map +1 -0
- package/dist/figure/index.mjs +9 -0
- package/dist/figure/index.mjs.map +1 -0
- package/dist/form/checkbox/checkbox.js.map +1 -1
- package/dist/form/checkbox/checkbox.mjs +2 -2
- package/dist/form/checkbox/index.js.map +1 -1
- package/dist/form/checkbox/index.mjs +2 -2
- package/dist/form/fieldset/fieldset.d.ts +2 -2
- package/dist/form/fieldset/fieldset.js.map +1 -1
- package/dist/form/fieldset/fieldset.mjs +1 -1
- package/dist/form/fieldset/index.js.map +1 -1
- package/dist/form/fieldset/index.mjs +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +13 -12
- package/dist/form/index.js.map +1 -1
- package/dist/form/index.mjs +17 -17
- package/dist/form/radio-button/index.d.ts +5 -0
- package/dist/form/radio-button/index.d.ts.map +1 -0
- package/dist/form/{radiobutton → radio-button}/index.js +17 -16
- package/dist/form/radio-button/index.js.map +1 -0
- package/dist/form/{radiobutton → radio-button}/index.mjs +6 -6
- package/dist/form/radio-button/index.mjs.map +1 -0
- package/dist/form/{radiobutton/radiobutton.d.ts → radio-button/radio-button.d.ts} +6 -6
- package/dist/form/radio-button/radio-button.d.ts.map +1 -0
- package/dist/form/{radiobutton/radiobutton.js → radio-button/radio-button.js} +17 -16
- package/dist/form/radio-button/radio-button.js.map +1 -0
- package/dist/form/radio-button/radio-button.mjs +13 -0
- package/dist/form/radio-button/radio-button.mjs.map +1 -0
- package/dist/form/{radiobutton/radiogroup.d.ts → radio-button/radio-group.d.ts} +7 -7
- package/dist/form/radio-button/radio-group.d.ts.map +1 -0
- package/dist/form/{radiobutton/radiogroup.js → radio-button/radio-group.js} +7 -6
- package/dist/form/radio-button/radio-group.js.map +1 -0
- package/dist/form/{radiobutton/radiogroup.mjs → radio-button/radio-group.mjs} +3 -3
- package/dist/form/radio-button/radio-group.mjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +554 -498
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +76 -66
- package/dist/layout/index.mjs +6 -6
- package/dist/navbar/icons.d.ts.map +1 -1
- package/dist/navbar/icons.js +16 -5
- package/dist/navbar/icons.js.map +1 -1
- package/dist/navbar/icons.mjs +1 -1
- package/dist/navbar/index.js +16 -5
- package/dist/navbar/index.js.map +1 -1
- package/dist/navbar/index.mjs +3 -3
- package/dist/navbar/navbar-expandable-menu.js +16 -5
- package/dist/navbar/navbar-expandable-menu.js.map +1 -1
- package/dist/navbar/navbar-expandable-menu.mjs +2 -2
- package/dist/navbar/navbar.js +16 -5
- package/dist/navbar/navbar.js.map +1 -1
- package/dist/navbar/navbar.mjs +3 -3
- package/dist/styled-html/index.js +1 -1
- package/dist/styled-html/index.js.map +1 -1
- package/dist/styled-html/index.mjs +1 -1
- package/dist/styled-html/styled-html.d.ts +9 -1
- package/dist/styled-html/styled-html.d.ts.map +1 -1
- package/dist/styled-html/styled-html.js +1 -1
- package/dist/styled-html/styled-html.js.map +1 -1
- package/dist/styled-html/styled-html.mjs +1 -1
- package/package.json +4 -4
- package/src/accordion/accordion.stories.tsx +8 -113
- package/src/badge/badge.stories.tsx +2 -30
- package/src/badge/badge.tsx +7 -3
- package/src/blockquote/blockquote.stories.tsx +22 -0
- package/src/blockquote/blockquote.tsx +52 -0
- package/src/blockquote/index.tsx +3 -0
- package/src/box/box.stories.tsx +14 -84
- package/src/breadcrumbs/breadcrumbs.stories.tsx +8 -22
- package/src/button/button.stories.tsx +2 -85
- package/src/card/card.stories.tsx +2 -42
- package/src/description-list/description-list.stories.tsx +6 -71
- package/src/figure/figure.stories.tsx +22 -0
- package/src/figure/figure.tsx +36 -0
- package/src/figure/index.tsx +3 -0
- package/src/form/checkbox/checkbox.stories.tsx +5 -80
- package/src/form/date-picker/date-picker.stories.tsx +8 -7
- package/src/form/error-message/error-message.stories.tsx +3 -2
- package/src/form/fieldset/fieldset.stories.tsx +2 -58
- package/src/form/fieldset/fieldset.tsx +2 -2
- package/src/form/index.tsx +1 -1
- package/src/form/input/input.stories.tsx +2 -142
- package/src/form/radio-button/index.tsx +4 -0
- package/src/form/radio-button/radio-button.stories.tsx +26 -0
- package/src/form/{radiobutton/radiobutton.tsx → radio-button/radio-button.tsx} +13 -13
- package/src/form/{radiobutton/radiogroup.stories.tsx → radio-button/radio-group.stories.tsx} +9 -9
- package/src/form/{radiobutton/radiogroup.tsx → radio-button/radio-group.tsx} +7 -6
- package/src/form/select/select.stories.tsx +2 -61
- package/src/form/textarea/textarea.stories.tsx +5 -85
- package/src/help-text/help-text.stories.tsx +20 -0
- package/src/index.ts +2 -0
- package/src/layout/container/container.stories.tsx +18 -14
- package/src/layout/grid/grid.stories.tsx +28 -0
- package/src/layout/stack/stack.stories.tsx +28 -0
- package/src/link/link.stories.tsx +8 -38
- package/src/list/link-list.stories.tsx +25 -27
- package/src/list/list.stories.tsx +11 -48
- package/src/message/message.stories.tsx +8 -65
- package/src/modal/modal.stories.tsx +2 -103
- package/src/navbar/icons.tsx +10 -3
- package/src/navbar/navbar.stories.tsx +23 -62
- package/src/show-more/show-more.stories.tsx +3 -98
- package/src/skeleton/skeleton.stories.tsx +3 -126
- package/src/step-indicator/step-indicator.stories.tsx +2 -31
- package/src/styled-html/styled-html.stories.tsx +22 -155
- package/src/styled-html/styled-html.tsx +12 -2
- package/src/table/table.stories.tsx +43 -0
- package/src/tabs/tabs.stories.tsx +8 -114
- package/src/text/text.stories.tsx +18 -83
- package/src/warning-banner/warning-banner.stories.tsx +2 -23
- package/dist/chunk-2KX7VFN2.mjs +0 -1
- package/dist/chunk-GUNPGSAS.mjs.map +0 -1
- package/dist/chunk-MOU6WBT2.mjs +0 -26
- package/dist/chunk-MOU6WBT2.mjs.map +0 -1
- package/dist/chunk-OFY2FVXB.mjs.map +0 -1
- package/dist/chunk-TCO3ZAZW.mjs.map +0 -1
- package/dist/chunk-WEQIEPMT.mjs.map +0 -1
- package/dist/chunk-ZYTUK4B4.mjs.map +0 -1
- package/dist/form/radiobutton/index.d.ts +0 -5
- package/dist/form/radiobutton/index.d.ts.map +0 -1
- package/dist/form/radiobutton/index.js.map +0 -1
- package/dist/form/radiobutton/radiobutton.d.ts.map +0 -1
- package/dist/form/radiobutton/radiobutton.js.map +0 -1
- package/dist/form/radiobutton/radiobutton.mjs +0 -13
- package/dist/form/radiobutton/radiogroup.d.ts.map +0 -1
- package/dist/form/radiobutton/radiogroup.js.map +0 -1
- package/src/form/radiobutton/index.tsx +0 -4
- package/src/form/radiobutton/radiobutton.stories.tsx +0 -93
- /package/dist/{chunk-2KX7VFN2.mjs.map → blockquote/blockquote.mjs.map} +0 -0
- /package/dist/{form/radiobutton → blockquote}/index.mjs.map +0 -0
- /package/dist/{chunk-YIERXOCG.mjs.map → chunk-6ZO2TMOX.mjs.map} +0 -0
- /package/dist/{chunk-F4EAUOJX.mjs.map → chunk-EAFQ3XQU.mjs.map} +0 -0
- /package/dist/{form/radiobutton/radiobutton.mjs.map → chunk-K2CB2NLY.mjs.map} +0 -0
- /package/dist/{form/radiobutton/radiogroup.mjs.map → chunk-KFDS3IPB.mjs.map} +0 -0
- /package/dist/{chunk-YLBJMVIX.mjs.map → chunk-M7MG7ZQT.mjs.map} +0 -0
package/src/box/box.stories.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import { useState } from "react";
|
|
4
3
|
import { Text } from "../text";
|
|
5
4
|
import { Link } from "../link";
|
|
6
5
|
import { Box } from ".";
|
|
@@ -8,20 +7,6 @@ import { Box } from ".";
|
|
|
8
7
|
const meta: Meta<typeof Box> = {
|
|
9
8
|
title: "Box",
|
|
10
9
|
component: Box,
|
|
11
|
-
args: {
|
|
12
|
-
closeable: false,
|
|
13
|
-
children: (
|
|
14
|
-
<>
|
|
15
|
-
<Text variant="h3-title" as="h2">
|
|
16
|
-
Box content
|
|
17
|
-
</Text>
|
|
18
|
-
<Text _unstableSpacing>
|
|
19
|
-
This is some body copy in a box, but you can basically add anything you want in here.
|
|
20
|
-
</Text>
|
|
21
|
-
<Link href="#a-link-for-whatever-reason">A link for whatever reason</Link>
|
|
22
|
-
</>
|
|
23
|
-
),
|
|
24
|
-
},
|
|
25
10
|
argTypes: {
|
|
26
11
|
variant: {
|
|
27
12
|
options: ["light-grey", "lighter", "white", "warning"],
|
|
@@ -35,78 +20,23 @@ const meta: Meta<typeof Box> = {
|
|
|
35
20
|
export default meta;
|
|
36
21
|
|
|
37
22
|
type Story = StoryObj<typeof Box>;
|
|
38
|
-
export const LightGreyBox: Story = {
|
|
39
|
-
args: {
|
|
40
|
-
variant: "light-grey",
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const LighterBox: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
closeable: true,
|
|
47
|
-
variant: "lighter",
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const WhiteBox: Story = {
|
|
52
|
-
args: {
|
|
53
|
-
closeable: true,
|
|
54
|
-
variant: "white",
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const WarningBox: Story = {
|
|
59
|
-
args: {
|
|
60
|
-
closeable: true,
|
|
61
|
-
variant: "warning",
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
23
|
|
|
65
|
-
export const
|
|
24
|
+
export const Preview: Story = {
|
|
25
|
+
tags: ["!dev"],
|
|
66
26
|
args: {
|
|
67
|
-
closeable:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const Custom: Story = {
|
|
75
|
-
render: function CustomBox() {
|
|
76
|
-
const [closeTimer, setCloseTimer] = useState<number | null>(null);
|
|
77
|
-
function countDownFrom(seconds: number) {
|
|
78
|
-
if (seconds > 0) {
|
|
79
|
-
setCloseTimer(seconds);
|
|
80
|
-
window.setTimeout(() => {
|
|
81
|
-
countDownFrom(seconds - 1);
|
|
82
|
-
}, 1000);
|
|
83
|
-
} else {
|
|
84
|
-
setCloseTimer(0);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Choosing to not render the box at all instead of hiding it with CSS
|
|
89
|
-
if (closeTimer === 0) {
|
|
90
|
-
// eslint-disable-next-line react/jsx-no-useless-fragment -- Typescript did not like it when I returned null in a story
|
|
91
|
-
return <></>;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<Box variant="lighter">
|
|
96
|
-
{/* Choosing to render the close button manually */}
|
|
97
|
-
<Box.CloseButton
|
|
98
|
-
onClick={() => {
|
|
99
|
-
closeTimer === null && countDownFrom(5);
|
|
100
|
-
}}
|
|
101
|
-
/>
|
|
102
|
-
<Text variant="h3-title" as="h2">
|
|
103
|
-
A customomized box
|
|
104
|
-
{closeTimer !== null && ` - closing in ${closeTimer} seconds`}
|
|
27
|
+
closeable: false,
|
|
28
|
+
children: (
|
|
29
|
+
<>
|
|
30
|
+
<Text variant="h3-title" as="h3">
|
|
31
|
+
Box content
|
|
105
32
|
</Text>
|
|
106
|
-
<Text
|
|
107
|
-
|
|
33
|
+
<Text className="hds-mt-16-20">
|
|
34
|
+
This is some body copy in a box, but you can basically add anything you want in here.
|
|
108
35
|
</Text>
|
|
109
|
-
|
|
110
|
-
|
|
36
|
+
<Text className="hds-mt-16-20">
|
|
37
|
+
<Link href="#a-link-for-whatever-reason">A link for whatever reason</Link>
|
|
38
|
+
</Text>{" "}
|
|
39
|
+
</>
|
|
40
|
+
),
|
|
111
41
|
},
|
|
112
42
|
};
|
|
@@ -6,6 +6,14 @@ import { Breadcrumbs } from ".";
|
|
|
6
6
|
const meta: Meta<typeof Breadcrumbs> = {
|
|
7
7
|
title: "Breadcrumbs",
|
|
8
8
|
component: Breadcrumbs,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Breadcrumbs>;
|
|
14
|
+
|
|
15
|
+
export const Preview: Story = {
|
|
16
|
+
tags: ["!dev"],
|
|
9
17
|
args: {
|
|
10
18
|
children: (
|
|
11
19
|
<>
|
|
@@ -26,25 +34,3 @@ const meta: Meta<typeof Breadcrumbs> = {
|
|
|
26
34
|
),
|
|
27
35
|
},
|
|
28
36
|
};
|
|
29
|
-
|
|
30
|
-
export default meta;
|
|
31
|
-
|
|
32
|
-
type Story = StoryObj<typeof Breadcrumbs>;
|
|
33
|
-
|
|
34
|
-
export const Default: Story = {};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* You should have at minimum two levels in your hierarchy to use breadcrumbs.
|
|
38
|
-
*/
|
|
39
|
-
export const TwoElements: Story = {
|
|
40
|
-
args: {
|
|
41
|
-
children: (
|
|
42
|
-
<>
|
|
43
|
-
<li>
|
|
44
|
-
<Link href="https://www.posten.no">Track letters and parcels</Link>
|
|
45
|
-
</li>
|
|
46
|
-
<li>Shipment from SOMEONE YOU KNOW</li>
|
|
47
|
-
</>
|
|
48
|
-
),
|
|
49
|
-
},
|
|
50
|
-
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import { HStack } from "../layout";
|
|
4
|
-
import type { ButtonProps } from ".";
|
|
5
3
|
import { Button } from ".";
|
|
6
4
|
|
|
7
5
|
const meta: Meta<typeof Button> = {
|
|
@@ -16,91 +14,10 @@ export default meta;
|
|
|
16
14
|
|
|
17
15
|
type Story = StoryObj<typeof Button>;
|
|
18
16
|
|
|
19
|
-
export const
|
|
17
|
+
export const Preview: Story = {
|
|
18
|
+
tags: ["!dev"],
|
|
20
19
|
args: {
|
|
21
20
|
variant: "primary",
|
|
22
21
|
children: "Primary button",
|
|
23
22
|
},
|
|
24
23
|
};
|
|
25
|
-
|
|
26
|
-
export const PrimaryOutline: Story = {
|
|
27
|
-
args: {
|
|
28
|
-
variant: "primary-outline",
|
|
29
|
-
children: "Primary outline button",
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const Secondary: Story = {
|
|
34
|
-
args: {
|
|
35
|
-
variant: "secondary",
|
|
36
|
-
children: "Secondary button",
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const SecondaryOutline: Story = {
|
|
41
|
-
args: {
|
|
42
|
-
variant: "secondary-outline",
|
|
43
|
-
children: "Secondary outline button",
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const AsALink: Story = {
|
|
48
|
-
name: "As a link",
|
|
49
|
-
render: (args) => (
|
|
50
|
-
<HStack gap="16" wrap>
|
|
51
|
-
<Button {...args} variant="primary" />
|
|
52
|
-
<Button {...args} variant="primary-outline" />
|
|
53
|
-
<Button {...args} variant="secondary" />
|
|
54
|
-
<Button {...args} variant="secondary-outline" />
|
|
55
|
-
</HStack>
|
|
56
|
-
),
|
|
57
|
-
args: {
|
|
58
|
-
children: (
|
|
59
|
-
<a href="https://www.posten.no" target="_blank" rel="noopener">
|
|
60
|
-
Link button
|
|
61
|
-
</a>
|
|
62
|
-
),
|
|
63
|
-
asChild: true,
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const createIconStory = (
|
|
68
|
-
Component: typeof Button,
|
|
69
|
-
extraArgs: Partial<ButtonProps> = {},
|
|
70
|
-
): Story => ({
|
|
71
|
-
render: (args) => (
|
|
72
|
-
<HStack gap="16" wrap align="end">
|
|
73
|
-
<Component {...args} size="small" />
|
|
74
|
-
<Component {...args} size="medium" />
|
|
75
|
-
<Component {...args} size="large" />
|
|
76
|
-
</HStack>
|
|
77
|
-
),
|
|
78
|
-
args: {
|
|
79
|
-
lang: "en",
|
|
80
|
-
"aria-label": "Choose language",
|
|
81
|
-
icon: true,
|
|
82
|
-
children: (
|
|
83
|
-
<svg
|
|
84
|
-
aria-hidden
|
|
85
|
-
fill="none"
|
|
86
|
-
height="24"
|
|
87
|
-
viewBox="0 0 24 24"
|
|
88
|
-
width="24"
|
|
89
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
90
|
-
>
|
|
91
|
-
<path
|
|
92
|
-
d="M12 19.3125C12.2602 19.3125 12.9492 19.0594 13.6734 17.6109C13.9828 16.9887 14.25 16.2328 14.4469 15.375H9.55312C9.75 16.2328 10.0172 16.9887 10.3266 17.6109C11.0508 19.0594 11.7398 19.3125 12 19.3125ZM9.27539 13.6875H14.7246C14.7809 13.1496 14.8125 12.5836 14.8125 12C14.8125 11.4164 14.7809 10.8504 14.7246 10.3125H9.27539C9.21914 10.8504 9.1875 11.4164 9.1875 12C9.1875 12.5836 9.21914 13.1496 9.27539 13.6875ZM9.55312 8.625H14.4469C14.25 7.76719 13.9828 7.01133 13.6734 6.38906C12.9492 4.94063 12.2602 4.6875 12 4.6875C11.7398 4.6875 11.0508 4.94063 10.3266 6.38906C10.0172 7.01133 9.75 7.76719 9.55312 8.625ZM16.4191 10.3125C16.4719 10.8574 16.4965 11.4234 16.4965 12C16.4965 12.5766 16.4684 13.1426 16.4191 13.6875H19.1156C19.2422 13.1461 19.3125 12.5801 19.3125 12C19.3125 11.4199 19.2457 10.8539 19.1156 10.3125H16.4227H16.4191ZM18.4863 8.625C17.734 7.18008 16.5141 6.01992 15.027 5.34141C15.5227 6.24141 15.9164 7.36289 16.173 8.625H18.4898H18.4863ZM7.82344 8.625C8.08008 7.36289 8.47383 6.24492 8.96953 5.34141C7.48242 6.01992 6.2625 7.18008 5.51016 8.625H7.82695H7.82344ZM4.88437 10.3125C4.75781 10.8539 4.6875 11.4199 4.6875 12C4.6875 12.5801 4.7543 13.1461 4.88437 13.6875H7.58086C7.52813 13.1426 7.50352 12.5766 7.50352 12C7.50352 11.4234 7.53164 10.8574 7.58086 10.3125H4.88437ZM15.027 18.6586C16.5141 17.9801 17.734 16.8199 18.4863 15.375H16.173C15.9164 16.6371 15.5227 17.7551 15.027 18.6586ZM8.97305 18.6586C8.47734 17.7586 8.08359 16.6371 7.82695 15.375H5.51016C6.2625 16.8199 7.48242 17.9801 8.96953 18.6586H8.97305ZM12 21C9.61305 21 7.32387 20.0518 5.63604 18.364C3.94821 16.6761 3 14.3869 3 12C3 9.61305 3.94821 7.32387 5.63604 5.63604C7.32387 3.94821 9.61305 3 12 3C14.3869 3 16.6761 3.94821 18.364 5.63604C20.0518 7.32387 21 9.61305 21 12C21 14.3869 20.0518 16.6761 18.364 18.364C16.6761 20.0518 14.3869 21 12 21Z"
|
|
93
|
-
fill="currentColor"
|
|
94
|
-
/>
|
|
95
|
-
</svg>
|
|
96
|
-
),
|
|
97
|
-
...extraArgs,
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
export const IconPrimary: Story = createIconStory(Button, { variant: "secondary" });
|
|
102
|
-
export const IconPrimaryOutline: Story = createIconStory(Button, { variant: "primary-outline" });
|
|
103
|
-
export const IconSecondary: Story = createIconStory(Button, { variant: "secondary" });
|
|
104
|
-
export const IconSecondaryOutline: Story = createIconStory(Button, {
|
|
105
|
-
variant: "secondary-outline",
|
|
106
|
-
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import type { ReactNode } from "react";
|
|
4
3
|
import { Card } from ".";
|
|
5
4
|
|
|
6
5
|
const meta: Meta<typeof Card> = {
|
|
@@ -12,8 +11,8 @@ export default meta;
|
|
|
12
11
|
|
|
13
12
|
type Story = StoryObj<typeof Card>;
|
|
14
13
|
|
|
15
|
-
export const
|
|
16
|
-
|
|
14
|
+
export const Preview: Story = {
|
|
15
|
+
tags: ["!dev"],
|
|
17
16
|
render: (props) => (
|
|
18
17
|
<Card {...props} as="div" style={{ maxWidth: "500px", ...props.style }}>
|
|
19
18
|
<Card.Media style={{ width: "100%" }}>
|
|
@@ -41,42 +40,3 @@ export const CardStory: Story = {
|
|
|
41
40
|
</Card>
|
|
42
41
|
),
|
|
43
42
|
};
|
|
44
|
-
|
|
45
|
-
function Link({
|
|
46
|
-
to,
|
|
47
|
-
className,
|
|
48
|
-
children,
|
|
49
|
-
}: {
|
|
50
|
-
to: string;
|
|
51
|
-
className?: string;
|
|
52
|
-
children: ReactNode;
|
|
53
|
-
}) {
|
|
54
|
-
return (
|
|
55
|
-
<a className={className} href={to}>
|
|
56
|
-
{children}
|
|
57
|
-
</a>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export const CardFullWidth: Story = {
|
|
62
|
-
render: (props) => (
|
|
63
|
-
<Card {...props} as="div">
|
|
64
|
-
<Card.Media>
|
|
65
|
-
<Card.MediaImg alt="posten-bring" src="./posten-bring.jpg" />
|
|
66
|
-
</Card.Media>
|
|
67
|
-
<Card.Body>
|
|
68
|
-
<Card.BodyHeader as="h2">
|
|
69
|
-
<Card.BodyHeaderOverline>Theme</Card.BodyHeaderOverline>
|
|
70
|
-
<Card.BodyHeaderTitle asChild>
|
|
71
|
-
<Link to="#article">Cool article</Link>
|
|
72
|
-
</Card.BodyHeaderTitle>
|
|
73
|
-
</Card.BodyHeader>
|
|
74
|
-
<Card.BodyDescription>
|
|
75
|
-
The card will take up all available space by default. It is the consumer's choice and
|
|
76
|
-
responsibility to limit the width if wanted.
|
|
77
|
-
</Card.BodyDescription>
|
|
78
|
-
<Card.BodyActionArrow />
|
|
79
|
-
</Card.Body>
|
|
80
|
-
</Card>
|
|
81
|
-
),
|
|
82
|
-
};
|
|
@@ -7,86 +7,21 @@ type Story = StoryObj<typeof DescriptionList>;
|
|
|
7
7
|
const meta: Meta<typeof DescriptionList> = {
|
|
8
8
|
title: "Description List",
|
|
9
9
|
component: DescriptionList,
|
|
10
|
-
args: {
|
|
11
|
-
children: (
|
|
12
|
-
<>
|
|
13
|
-
<dt>Vekt</dt>
|
|
14
|
-
<dd>12 kg</dd>
|
|
15
|
-
<dt>Antall kolli</dt>
|
|
16
|
-
<dd>2</dd>
|
|
17
|
-
<dt>Sendingsnummer</dt>
|
|
18
|
-
<dd>7000001</dd>
|
|
19
|
-
<dt>Avsender</dt>
|
|
20
|
-
<dd>Fjellsport</dd>
|
|
21
|
-
</>
|
|
22
|
-
),
|
|
23
|
-
},
|
|
24
10
|
};
|
|
25
11
|
|
|
26
12
|
export default meta;
|
|
27
13
|
|
|
28
|
-
export const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export const WrappedInDivs: Story = {
|
|
14
|
+
export const Preview: Story = {
|
|
15
|
+
tags: ["!dev"],
|
|
32
16
|
args: {
|
|
33
|
-
children: (
|
|
34
|
-
<>
|
|
35
|
-
<div>
|
|
36
|
-
<dt>Vekt</dt>
|
|
37
|
-
<dd>12 kg</dd>
|
|
38
|
-
</div>
|
|
39
|
-
<div>
|
|
40
|
-
<dt>Antall kolli</dt>
|
|
41
|
-
<dd>2</dd>
|
|
42
|
-
</div>
|
|
43
|
-
<div>
|
|
44
|
-
<dt>Sendingsnummer</dt>
|
|
45
|
-
<dd>7000001</dd>
|
|
46
|
-
</div>
|
|
47
|
-
<div>
|
|
48
|
-
<dt>Avsender</dt>
|
|
49
|
-
<dd>Fjellsport</dd>
|
|
50
|
-
</div>
|
|
51
|
-
</>
|
|
52
|
-
),
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const Paragraph: Story = {
|
|
57
|
-
name: "<p> tag as child",
|
|
58
|
-
args: {
|
|
59
|
-
variant: "horizontal",
|
|
60
|
-
children: (
|
|
61
|
-
<>
|
|
62
|
-
<dt>Vekt</dt>
|
|
63
|
-
<dd>12 kg</dd>
|
|
64
|
-
<dt>
|
|
65
|
-
<p>Title</p>
|
|
66
|
-
</dt>
|
|
67
|
-
<dd>
|
|
68
|
-
<p>Paragraph</p>
|
|
69
|
-
</dd>
|
|
70
|
-
</>
|
|
71
|
-
),
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const HorizontalLongContent: Story = {
|
|
76
|
-
args: {
|
|
77
|
-
variant: "horizontal",
|
|
78
17
|
children: (
|
|
79
18
|
<>
|
|
80
19
|
<dt>Vekt</dt>
|
|
81
20
|
<dd>12 kg</dd>
|
|
82
|
-
<dt>
|
|
83
|
-
|
|
84
|
-
</dt>
|
|
85
|
-
<dd>
|
|
86
|
-
<p>
|
|
87
|
-
ParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraph
|
|
88
|
-
</p>
|
|
89
|
-
</dd>
|
|
21
|
+
<dt>Antall kolli</dt>
|
|
22
|
+
<dd>2</dd>
|
|
23
|
+
<dt>Sendingsnummer</dt>
|
|
24
|
+
<dd>7000001</dd>
|
|
90
25
|
<dt>Avsender</dt>
|
|
91
26
|
<dd>Fjellsport</dd>
|
|
92
27
|
</>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { Figure } from ".";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Figure> = {
|
|
6
|
+
title: "Figure",
|
|
7
|
+
component: Figure,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
|
|
12
|
+
export const Preview: StoryObj<typeof Figure> = {
|
|
13
|
+
tags: ["!dev"],
|
|
14
|
+
args: {
|
|
15
|
+
children: (
|
|
16
|
+
<>
|
|
17
|
+
<img src="https://placedog.net/500/280" alt="A very good dog" />
|
|
18
|
+
<figcaption>Dogs are the best</figcaption>
|
|
19
|
+
</>
|
|
20
|
+
),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { clsx } from "@postenbring/hedwig-css/typed-classname";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
|
|
5
|
+
export interface FigureProps extends React.HTMLAttributes<HTMLQuoteElement> {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
10
|
+
*
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <Figure>
|
|
21
|
+
* <img src="https://placedog.net/500/280" alt="A very good dog" />
|
|
22
|
+
* <figcaption>Dogs are the best</figcaption>
|
|
23
|
+
* </Figure>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export const Figure = forwardRef<HTMLQuoteElement, FigureProps>(
|
|
27
|
+
({ children, asChild, className, ...rest }, ref) => {
|
|
28
|
+
const Component = asChild ? Slot : "figure";
|
|
29
|
+
return (
|
|
30
|
+
<Component ref={ref} className={clsx("hds-figure", className as undefined)} {...rest}>
|
|
31
|
+
{children}
|
|
32
|
+
</Component>
|
|
33
|
+
);
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
Figure.displayName = "Figure";
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import { Fieldset } from "../fieldset";
|
|
4
|
-
import { VStack } from "../../layout";
|
|
5
3
|
import { Checkbox } from "./index";
|
|
6
4
|
|
|
7
5
|
const meta: Meta<typeof Checkbox> = {
|
|
8
6
|
title: "Form/Checkbox",
|
|
9
7
|
component: Checkbox,
|
|
8
|
+
argTypes: {
|
|
9
|
+
variant: { control: "inline-radio", options: ["plain", "bounding-box"] },
|
|
10
|
+
},
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
export default meta;
|
|
13
14
|
|
|
14
15
|
type Story = StoryObj<typeof Checkbox>;
|
|
15
16
|
|
|
16
|
-
export const
|
|
17
|
-
|
|
17
|
+
export const Preview: Story = {
|
|
18
|
+
tags: ["!dev"],
|
|
18
19
|
args: {
|
|
19
20
|
title: "",
|
|
20
21
|
children: "Just a checkbox",
|
|
@@ -25,80 +26,4 @@ export const JustACheckbox: Story = {
|
|
|
25
26
|
/**/
|
|
26
27
|
},
|
|
27
28
|
},
|
|
28
|
-
argTypes: {
|
|
29
|
-
variant: { control: "inline-radio", options: ["plain", "bounding-box"] },
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const PlainCheckboxes: Story = {
|
|
34
|
-
name: "Checkboxes",
|
|
35
|
-
render: (_props) => (
|
|
36
|
-
<Fieldset legend="Checkboxes should be grouped in a Fieldset">
|
|
37
|
-
<Checkbox>This is a checkbox</Checkbox>
|
|
38
|
-
<Checkbox>This is another checkbox</Checkbox>
|
|
39
|
-
</Fieldset>
|
|
40
|
-
),
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const PlainCheckboxesWithError: Story = {
|
|
44
|
-
name: "Checkboxes with error",
|
|
45
|
-
render: (_props) => (
|
|
46
|
-
<Fieldset
|
|
47
|
-
legend="Fieldset will aid you with styling and aria when it is provided an error message"
|
|
48
|
-
errorMessage="Something is wrong"
|
|
49
|
-
>
|
|
50
|
-
<Checkbox>This is a checkbox</Checkbox>
|
|
51
|
-
<Checkbox>This is another checkbox</Checkbox>
|
|
52
|
-
</Fieldset>
|
|
53
|
-
),
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const PlainCheckboxeWithError: Story = {
|
|
57
|
-
name: "Standalone checkbox with error message",
|
|
58
|
-
args: {
|
|
59
|
-
errorMessage: "Something is wrong",
|
|
60
|
-
children: "This is a checkbox with an error message",
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export const BoundedCheckbox: Story = {
|
|
65
|
-
name: "Checkbox with bounding box",
|
|
66
|
-
render: (_props) => (
|
|
67
|
-
<VStack gap="8">
|
|
68
|
-
<Checkbox variant="bounding-box">This is a checkbox with bounding box</Checkbox>
|
|
69
|
-
<Checkbox errorMessage="Something is wrong" variant="bounding-box">
|
|
70
|
-
This is a checkbox with bounding box and error
|
|
71
|
-
</Checkbox>
|
|
72
|
-
</VStack>
|
|
73
|
-
),
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const DetailedContentCheckbox: Story = {
|
|
77
|
-
name: "Checkbox with title",
|
|
78
|
-
render: (_props) => (
|
|
79
|
-
<VStack gap="8">
|
|
80
|
-
<Checkbox title="Check this box">Detailed description if needed</Checkbox>
|
|
81
|
-
<Checkbox errorMessage="Something is wrong" title="Checkbox with error">
|
|
82
|
-
Detailed description if needed
|
|
83
|
-
</Checkbox>
|
|
84
|
-
</VStack>
|
|
85
|
-
),
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const DetailedContentCheckboxWithBoundingBox: Story = {
|
|
89
|
-
name: "Checkbox with bounding box and title",
|
|
90
|
-
render: (_props) => (
|
|
91
|
-
<VStack gap="8">
|
|
92
|
-
<Checkbox title="Check this box" variant="bounding-box">
|
|
93
|
-
Detailed description if needed
|
|
94
|
-
</Checkbox>
|
|
95
|
-
<Checkbox
|
|
96
|
-
errorMessage="Something is wrong"
|
|
97
|
-
title="Checkbox with error"
|
|
98
|
-
variant="bounding-box"
|
|
99
|
-
>
|
|
100
|
-
Detailed description if needed
|
|
101
|
-
</Checkbox>
|
|
102
|
-
</VStack>
|
|
103
|
-
),
|
|
104
29
|
};
|
|
@@ -3,25 +3,26 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
3
3
|
import { DatePicker } from ".";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof DatePicker> = {
|
|
6
|
-
title: "Form/
|
|
6
|
+
title: "Form/Date Picker",
|
|
7
7
|
component: DatePicker,
|
|
8
|
+
argTypes: {
|
|
9
|
+
variant: { control: "inline-radio", options: ["default", "white"] },
|
|
10
|
+
},
|
|
8
11
|
};
|
|
9
12
|
|
|
10
13
|
export default meta;
|
|
11
14
|
|
|
12
15
|
type Story = StoryObj<typeof DatePicker>;
|
|
13
16
|
|
|
14
|
-
export const
|
|
17
|
+
export const Preview: Story = {
|
|
18
|
+
tags: ["!dev"],
|
|
15
19
|
args: {
|
|
16
|
-
label: "
|
|
20
|
+
label: "Choose a date",
|
|
17
21
|
errorMessage: "",
|
|
18
22
|
readOnly: false,
|
|
19
23
|
variant: "default",
|
|
20
24
|
min: "2024-04-05",
|
|
21
25
|
max: "2026-04-04",
|
|
22
|
-
calendarButtonTitle: "
|
|
23
|
-
},
|
|
24
|
-
argTypes: {
|
|
25
|
-
variant: { control: "inline-radio", options: ["default", "white"] },
|
|
26
|
+
calendarButtonTitle: "Open calendar",
|
|
26
27
|
},
|
|
27
28
|
};
|
|
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|
|
3
3
|
import { ErrorMessage } from ".";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof ErrorMessage> = {
|
|
6
|
-
title: "Form/
|
|
6
|
+
title: "Form/Error Message",
|
|
7
7
|
component: ErrorMessage,
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -11,7 +11,8 @@ export default meta;
|
|
|
11
11
|
|
|
12
12
|
type Story = StoryObj<typeof ErrorMessage>;
|
|
13
13
|
|
|
14
|
-
export const
|
|
14
|
+
export const Preview: Story = {
|
|
15
|
+
tags: ["!dev"],
|
|
15
16
|
args: {
|
|
16
17
|
id: "id",
|
|
17
18
|
children: "This is an error message for use with form input components",
|