@navikt/ds-react 6.5.0 → 6.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/collapsible/Collapsible.context.d.ts +48 -0
- package/cjs/collapsible/Collapsible.context.js +10 -0
- package/cjs/collapsible/Collapsible.context.js.map +1 -0
- package/cjs/collapsible/Collapsible.d.ts +48 -0
- package/cjs/collapsible/Collapsible.js +91 -0
- package/cjs/collapsible/Collapsible.js.map +1 -0
- package/cjs/collapsible/Collapsible.types.d.ts +19 -0
- package/cjs/collapsible/Collapsible.types.js +3 -0
- package/cjs/collapsible/Collapsible.types.js.map +1 -0
- package/cjs/collapsible/index.d.ts +3 -0
- package/cjs/collapsible/index.js +14 -0
- package/cjs/collapsible/index.js.map +1 -0
- package/cjs/collapsible/parts/Collapsible.Content.d.ts +10 -0
- package/cjs/collapsible/parts/Collapsible.Content.js +48 -0
- package/cjs/collapsible/parts/Collapsible.Content.js.map +1 -0
- package/cjs/collapsible/parts/Collapsible.Trigger.d.ts +10 -0
- package/cjs/collapsible/parts/Collapsible.Trigger.js +49 -0
- package/cjs/collapsible/parts/Collapsible.Trigger.js.map +1 -0
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +2 -4
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/cjs/form/combobox/Input/Input.js +6 -1
- package/cjs/form/combobox/Input/Input.js.map +1 -1
- package/cjs/form/form-summary/FormSummary.d.ts +82 -0
- package/cjs/form/form-summary/FormSummary.js +81 -0
- package/cjs/form/form-summary/FormSummary.js.map +1 -0
- package/cjs/form/form-summary/FormSummaryAnswer.d.ts +11 -0
- package/cjs/form/form-summary/FormSummaryAnswer.js +25 -0
- package/cjs/form/form-summary/FormSummaryAnswer.js.map +1 -0
- package/cjs/form/form-summary/FormSummaryAnswers.d.ts +9 -0
- package/cjs/form/form-summary/FormSummaryAnswers.js +48 -0
- package/cjs/form/form-summary/FormSummaryAnswers.js.map +1 -0
- package/cjs/form/form-summary/FormSummaryEditLink.d.ts +17 -0
- package/cjs/form/form-summary/FormSummaryEditLink.js +49 -0
- package/cjs/form/form-summary/FormSummaryEditLink.js.map +1 -0
- package/cjs/form/form-summary/FormSummaryHeader.d.ts +9 -0
- package/cjs/form/form-summary/FormSummaryHeader.js +48 -0
- package/cjs/form/form-summary/FormSummaryHeader.js.map +1 -0
- package/cjs/form/form-summary/FormSummaryHeading.d.ts +14 -0
- package/cjs/form/form-summary/FormSummaryHeading.js +31 -0
- package/cjs/form/form-summary/FormSummaryHeading.js.map +1 -0
- package/cjs/form/form-summary/FormSummaryLabel.d.ts +6 -0
- package/cjs/form/form-summary/FormSummaryLabel.js +45 -0
- package/cjs/form/form-summary/FormSummaryLabel.js.map +1 -0
- package/cjs/form/form-summary/FormSummaryValue.d.ts +6 -0
- package/cjs/form/form-summary/FormSummaryValue.js +49 -0
- package/cjs/form/form-summary/FormSummaryValue.js.map +1 -0
- package/cjs/form/form-summary/index.d.ts +8 -0
- package/cjs/form/form-summary/index.js +24 -0
- package/cjs/form/form-summary/index.js.map +1 -0
- package/cjs/index.d.ts +3 -2
- package/cjs/index.js +5 -3
- package/cjs/index.js.map +1 -1
- package/cjs/layout/stack/Spacer.js +1 -1
- package/cjs/layout/stack/Spacer.js.map +1 -1
- package/cjs/util/hooks/descendants/descendant.js +10 -1
- package/cjs/util/hooks/descendants/descendant.js.map +1 -1
- package/cjs/util/hooks/descendants/useDescendant.js +0 -5
- package/cjs/util/hooks/descendants/useDescendant.js.map +1 -1
- package/esm/collapsible/Collapsible.context.d.ts +48 -0
- package/esm/collapsible/Collapsible.context.js +6 -0
- package/esm/collapsible/Collapsible.context.js.map +1 -0
- package/esm/collapsible/Collapsible.d.ts +48 -0
- package/esm/collapsible/Collapsible.js +62 -0
- package/esm/collapsible/Collapsible.js.map +1 -0
- package/esm/collapsible/Collapsible.types.d.ts +19 -0
- package/esm/collapsible/Collapsible.types.js +2 -0
- package/esm/collapsible/Collapsible.types.js.map +1 -0
- package/esm/collapsible/index.d.ts +3 -0
- package/esm/collapsible/index.js +5 -0
- package/esm/collapsible/index.js.map +1 -0
- package/esm/collapsible/parts/Collapsible.Content.d.ts +10 -0
- package/esm/collapsible/parts/Collapsible.Content.js +22 -0
- package/esm/collapsible/parts/Collapsible.Content.js.map +1 -0
- package/esm/collapsible/parts/Collapsible.Trigger.d.ts +10 -0
- package/esm/collapsible/parts/Collapsible.Trigger.js +23 -0
- package/esm/collapsible/parts/Collapsible.Trigger.js.map +1 -0
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js +2 -4
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/esm/form/combobox/Input/Input.js +6 -1
- package/esm/form/combobox/Input/Input.js.map +1 -1
- package/esm/form/form-summary/FormSummary.d.ts +82 -0
- package/esm/form/form-summary/FormSummary.js +52 -0
- package/esm/form/form-summary/FormSummary.js.map +1 -0
- package/esm/form/form-summary/FormSummaryAnswer.d.ts +11 -0
- package/esm/form/form-summary/FormSummaryAnswer.js +19 -0
- package/esm/form/form-summary/FormSummaryAnswer.js.map +1 -0
- package/esm/form/form-summary/FormSummaryAnswers.d.ts +9 -0
- package/esm/form/form-summary/FormSummaryAnswers.js +19 -0
- package/esm/form/form-summary/FormSummaryAnswers.js.map +1 -0
- package/esm/form/form-summary/FormSummaryEditLink.d.ts +17 -0
- package/esm/form/form-summary/FormSummaryEditLink.js +20 -0
- package/esm/form/form-summary/FormSummaryEditLink.js.map +1 -0
- package/esm/form/form-summary/FormSummaryHeader.d.ts +9 -0
- package/esm/form/form-summary/FormSummaryHeader.js +19 -0
- package/esm/form/form-summary/FormSummaryHeader.js.map +1 -0
- package/esm/form/form-summary/FormSummaryHeading.d.ts +14 -0
- package/esm/form/form-summary/FormSummaryHeading.js +5 -0
- package/esm/form/form-summary/FormSummaryHeading.js.map +1 -0
- package/esm/form/form-summary/FormSummaryLabel.d.ts +6 -0
- package/esm/form/form-summary/FormSummaryLabel.js +19 -0
- package/esm/form/form-summary/FormSummaryLabel.js.map +1 -0
- package/esm/form/form-summary/FormSummaryValue.d.ts +6 -0
- package/esm/form/form-summary/FormSummaryValue.js +20 -0
- package/esm/form/form-summary/FormSummaryValue.js.map +1 -0
- package/esm/form/form-summary/index.d.ts +8 -0
- package/esm/form/form-summary/index.js +10 -0
- package/esm/form/form-summary/index.js.map +1 -0
- package/esm/index.d.ts +3 -2
- package/esm/index.js +2 -1
- package/esm/index.js.map +1 -1
- package/esm/layout/stack/Spacer.js +1 -1
- package/esm/layout/stack/Spacer.js.map +1 -1
- package/esm/util/hooks/descendants/descendant.js +10 -1
- package/esm/util/hooks/descendants/descendant.js.map +1 -1
- package/esm/util/hooks/descendants/useDescendant.js +0 -5
- package/esm/util/hooks/descendants/useDescendant.js.map +1 -1
- package/package.json +15 -4
- package/src/collapsible/Collapsible.context.tsx +32 -0
- package/src/collapsible/Collapsible.tsx +100 -0
- package/src/collapsible/Collapsible.types.ts +19 -0
- package/src/collapsible/index.ts +10 -0
- package/src/collapsible/parts/Collapsible.Content.tsx +39 -0
- package/src/collapsible/parts/Collapsible.Trigger.tsx +42 -0
- package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +9 -1
- package/src/form/combobox/Input/Input.tsx +5 -0
- package/src/form/form-summary/FormSummary.tsx +106 -0
- package/src/form/form-summary/FormSummaryAnswer.tsx +27 -0
- package/src/form/form-summary/FormSummaryAnswers.tsx +25 -0
- package/src/form/form-summary/FormSummaryEditLink.tsx +35 -0
- package/src/form/form-summary/FormSummaryHeader.tsx +25 -0
- package/src/form/form-summary/FormSummaryHeading.tsx +23 -0
- package/src/form/form-summary/FormSummaryLabel.tsx +17 -0
- package/src/form/form-summary/FormSummaryValue.tsx +24 -0
- package/src/form/form-summary/index.ts +30 -0
- package/src/index.ts +16 -15
- package/src/layout/stack/Spacer.tsx +1 -1
- package/src/util/hooks/descendants/descendant.ts +15 -1
- package/src/util/hooks/descendants/useDescendant.tsx +0 -5
- package/src/accordion/accordion.stories.tsx +0 -286
- package/src/alert/alert.stories.tsx +0 -306
- package/src/button/button.stories.tsx +0 -185
- package/src/chat/chat.stories.tsx +0 -341
- package/src/chips/chips.stories.tsx +0 -260
- package/src/copybutton/copy-button.stories.tsx +0 -261
- package/src/date/datepicker/datepicker.stories.tsx +0 -614
- package/src/date/monthpicker/monthpicker.stories.tsx +0 -221
- package/src/dropdown/dropdown.stories.tsx +0 -124
- package/src/expansion-card/expansion-card.stories.tsx +0 -282
- package/src/form/checkbox/checkbox.stories.tsx +0 -281
- package/src/form/combobox/combobox.stories.tsx +0 -626
- package/src/form/confirmation-panel/confirmation-panel.stories.tsx +0 -128
- package/src/form/error-summary/error-summary.stories.tsx +0 -81
- package/src/form/fieldset/fieldset.stories.tsx +0 -157
- package/src/form/file-upload/file-upload-dropzone.stories.tsx +0 -123
- package/src/form/file-upload/file-upload-item.stories.tsx +0 -148
- package/src/form/file-upload/file-upload.stories.tsx +0 -248
- package/src/form/radio/radio.stories.tsx +0 -230
- package/src/form/search/search.stories.tsx +0 -238
- package/src/form/select/select.stories.tsx +0 -172
- package/src/form/switch/switch.stories.tsx +0 -171
- package/src/form/textarea/textarea.stories.tsx +0 -254
- package/src/form/textfield/text-field.stories.tsx +0 -143
- package/src/guide-panel/guidepanel.stories.tsx +0 -90
- package/src/help-text/help-text.stories.tsx +0 -91
- package/src/internal-header/header.stories.tsx +0 -229
- package/src/layout/bleed/Bleed.stories.tsx +0 -395
- package/src/layout/box/Box.stories.tsx +0 -380
- package/src/layout/grid/h-grid.stories.tsx +0 -122
- package/src/layout/page/Page.stories.tsx +0 -271
- package/src/layout/responsive/hide.stories.tsx +0 -80
- package/src/layout/responsive/show.stories.tsx +0 -80
- package/src/layout/sidemal-test/navno-sidemal.stories.tsx +0 -69
- package/src/layout/stack/stack.stories.tsx +0 -183
- package/src/link/stories/link.stories.tsx +0 -304
- package/src/link-panel/link-panel.stories.tsx +0 -59
- package/src/list/list.stories.tsx +0 -280
- package/src/loader/loader.stories.tsx +0 -82
- package/src/modal/modal.stories.tsx +0 -391
- package/src/pagination/pagination.stories.tsx +0 -110
- package/src/popover/popover.stories.tsx +0 -113
- package/src/portal/Portal.stories.tsx +0 -102
- package/src/read-more/readmore.stories.tsx +0 -91
- package/src/skeleton/skeleton.stories.tsx +0 -130
- package/src/stepper/stepper.stories.tsx +0 -200
- package/src/table/stories/table-1.stories.tsx +0 -292
- package/src/table/stories/table-2-expandable.stories.tsx +0 -298
- package/src/table/stories/table-3-async.stories.tsx +0 -179
- package/src/table/stories/tests/table.stories.tsx +0 -102
- package/src/tabs/Tabs.stories.tsx +0 -311
- package/src/tag/tag.stories.tsx +0 -126
- package/src/timeline/timeline.stories.tsx +0 -445
- package/src/toggle-group/ToggleGroup.stories.tsx +0 -198
- package/src/tooltip/tooltip.stories.tsx +0 -101
- package/src/typography/stories/bodylong.stories.tsx +0 -209
- package/src/typography/stories/bodyshort.stories.tsx +0 -208
- package/src/typography/stories/detail.stories.tsx +0 -115
- package/src/typography/stories/error-message.stories.tsx +0 -122
- package/src/typography/stories/heading.stories.tsx +0 -169
- package/src/typography/stories/label.stories.tsx +0 -131
- package/src/util/hooks/descendants/descendant.stories.tsx +0 -147
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from "@storybook/react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { StarIcon as BaseStarIcon } from "@navikt/aksel-icons";
|
|
4
|
-
import { HStack, VStack } from "../layout/stack";
|
|
5
|
-
import { Button } from "./index";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: "ds-react/Button",
|
|
9
|
-
component: Button,
|
|
10
|
-
parameters: {
|
|
11
|
-
chromatic: { disable: true },
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type Story = StoryObj<typeof Button>;
|
|
16
|
-
|
|
17
|
-
const StarIcon = () => <BaseStarIcon aria-hidden />;
|
|
18
|
-
|
|
19
|
-
const variants: (
|
|
20
|
-
| "primary"
|
|
21
|
-
| "secondary"
|
|
22
|
-
| "tertiary"
|
|
23
|
-
| "primary-neutral"
|
|
24
|
-
| "secondary-neutral"
|
|
25
|
-
| "tertiary-neutral"
|
|
26
|
-
| "danger"
|
|
27
|
-
)[] = [
|
|
28
|
-
"primary",
|
|
29
|
-
"secondary",
|
|
30
|
-
"tertiary",
|
|
31
|
-
"danger",
|
|
32
|
-
"primary-neutral",
|
|
33
|
-
"secondary-neutral",
|
|
34
|
-
"tertiary-neutral",
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
export const Controls: Story = {
|
|
38
|
-
render: (props) => {
|
|
39
|
-
return (
|
|
40
|
-
<Button
|
|
41
|
-
variant={props.variant}
|
|
42
|
-
size={props.size}
|
|
43
|
-
loading={props.loading}
|
|
44
|
-
icon={props.icon ? <StarIcon /> : undefined}
|
|
45
|
-
iconPosition={props.iconPosition}
|
|
46
|
-
>
|
|
47
|
-
{props.children}
|
|
48
|
-
</Button>
|
|
49
|
-
);
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
args: {
|
|
53
|
-
icon: false,
|
|
54
|
-
loading: false,
|
|
55
|
-
iconPosition: "left",
|
|
56
|
-
children: "Button",
|
|
57
|
-
variant: "primary",
|
|
58
|
-
size: "medium",
|
|
59
|
-
},
|
|
60
|
-
argTypes: {
|
|
61
|
-
variant: {
|
|
62
|
-
control: {
|
|
63
|
-
type: "radio",
|
|
64
|
-
options: [
|
|
65
|
-
"primary",
|
|
66
|
-
"secondary",
|
|
67
|
-
"tertiary",
|
|
68
|
-
"danger",
|
|
69
|
-
"primary-neutral",
|
|
70
|
-
"secondary-neutral",
|
|
71
|
-
"tertiary-neutral",
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
size: {
|
|
76
|
-
control: {
|
|
77
|
-
type: "radio",
|
|
78
|
-
options: ["medium", "small", "xsmall"],
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
iconPosition: {
|
|
82
|
-
control: {
|
|
83
|
-
type: "radio",
|
|
84
|
-
options: ["left", "right"],
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
function ButtonGrid(props: any) {
|
|
91
|
-
return (
|
|
92
|
-
<VStack gap="2">
|
|
93
|
-
{variants.map((variant) => (
|
|
94
|
-
<HStack gap="2" key={variant}>
|
|
95
|
-
<Button variant={variant} {...props}>
|
|
96
|
-
Button
|
|
97
|
-
</Button>
|
|
98
|
-
<Button variant={variant} {...props} icon={<StarIcon />}>
|
|
99
|
-
Button
|
|
100
|
-
</Button>
|
|
101
|
-
<Button
|
|
102
|
-
variant={variant}
|
|
103
|
-
{...props}
|
|
104
|
-
icon={<StarIcon />}
|
|
105
|
-
iconPosition="right"
|
|
106
|
-
>
|
|
107
|
-
Button
|
|
108
|
-
</Button>
|
|
109
|
-
<Button variant={variant} {...props} icon={<StarIcon />} />
|
|
110
|
-
</HStack>
|
|
111
|
-
))}
|
|
112
|
-
</VStack>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export const Medium: Story = {
|
|
117
|
-
render: () => <ButtonGrid size="medium" />,
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export const Small: Story = {
|
|
121
|
-
render: () => <ButtonGrid size="small" />,
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
export const XSmall: Story = {
|
|
125
|
-
render: () => <ButtonGrid size="xsmall" />,
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export const AsLink: Story = {
|
|
129
|
-
render: () => (
|
|
130
|
-
<VStack gap="4">
|
|
131
|
-
<Button href="#" as="a">
|
|
132
|
-
Button as a-tag
|
|
133
|
-
</Button>
|
|
134
|
-
<Button href="#" as="a" disabled>
|
|
135
|
-
Disabled Button as a-tag
|
|
136
|
-
</Button>
|
|
137
|
-
</VStack>
|
|
138
|
-
),
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export const Loading: Story = {
|
|
142
|
-
render: () => <ButtonGrid loading />,
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export const LoadingAsLink: Story = {
|
|
146
|
-
render: () => <ButtonGrid loading href="#" as="a" />,
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export const Disabled: Story = {
|
|
150
|
-
render: () => <ButtonGrid disabled />,
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export const DisabledAsLink: Story = {
|
|
154
|
-
render: () => <ButtonGrid disabled href="#" as="a" />,
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const Chromatic: Story = {
|
|
158
|
-
render: () => (
|
|
159
|
-
<VStack gap="6" align="center">
|
|
160
|
-
<div>
|
|
161
|
-
<h2>Medium</h2>
|
|
162
|
-
<ButtonGrid size="medium" />
|
|
163
|
-
</div>
|
|
164
|
-
<div>
|
|
165
|
-
<h2>Small</h2>
|
|
166
|
-
<ButtonGrid size="small" />
|
|
167
|
-
</div>
|
|
168
|
-
<div>
|
|
169
|
-
<h2>XSmall</h2>
|
|
170
|
-
<ButtonGrid size="xsmall" />
|
|
171
|
-
</div>
|
|
172
|
-
<div>
|
|
173
|
-
<h2>As Link</h2>
|
|
174
|
-
<ButtonGrid as="a" href="#" />
|
|
175
|
-
</div>
|
|
176
|
-
<div>
|
|
177
|
-
<h2>Disabled</h2>
|
|
178
|
-
<ButtonGrid disabled />
|
|
179
|
-
</div>
|
|
180
|
-
</VStack>
|
|
181
|
-
),
|
|
182
|
-
parameters: {
|
|
183
|
-
chromatic: { disable: false },
|
|
184
|
-
},
|
|
185
|
-
};
|
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { VStack } from "../layout/stack";
|
|
4
|
-
import Chat, { POSITIONS, SIZES } from "./Chat";
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: "ds-react/Chat",
|
|
8
|
-
component: Chat,
|
|
9
|
-
argTypes: {
|
|
10
|
-
position: {
|
|
11
|
-
control: { type: "radio" },
|
|
12
|
-
options: POSITIONS,
|
|
13
|
-
},
|
|
14
|
-
toptextPosition: {
|
|
15
|
-
control: { type: "radio" },
|
|
16
|
-
options: POSITIONS,
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
control: { type: "radio" },
|
|
20
|
-
options: SIZES,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
parameters: {
|
|
24
|
-
chromatic: { disable: true },
|
|
25
|
-
},
|
|
26
|
-
} satisfies Meta<typeof Chat>;
|
|
27
|
-
|
|
28
|
-
type Story = StoryObj<typeof Chat>;
|
|
29
|
-
|
|
30
|
-
export const Controls: Story = {
|
|
31
|
-
render: (props) => {
|
|
32
|
-
return (
|
|
33
|
-
<Chat {...props}>
|
|
34
|
-
<Chat.Bubble>
|
|
35
|
-
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
36
|
-
</Chat.Bubble>
|
|
37
|
-
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
38
|
-
<Chat.Bubble>
|
|
39
|
-
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
40
|
-
laboris labore nisi ut.
|
|
41
|
-
</Chat.Bubble>
|
|
42
|
-
</Chat>
|
|
43
|
-
);
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
args: {
|
|
47
|
-
name: "Ola Normann",
|
|
48
|
-
timestamp: "01.01.21 14:00",
|
|
49
|
-
avatar: "ON",
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const Size: Story = {
|
|
54
|
-
render: () => (
|
|
55
|
-
<VStack gap="4">
|
|
56
|
-
<h3>Medium</h3>
|
|
57
|
-
<Chat
|
|
58
|
-
avatar="ON"
|
|
59
|
-
name="Ola Normann"
|
|
60
|
-
timestamp="01.01.21 14:00"
|
|
61
|
-
size="medium"
|
|
62
|
-
>
|
|
63
|
-
<Chat.Bubble>
|
|
64
|
-
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
65
|
-
</Chat.Bubble>
|
|
66
|
-
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
67
|
-
<Chat.Bubble>
|
|
68
|
-
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
69
|
-
laboris labore nisi ut.
|
|
70
|
-
</Chat.Bubble>
|
|
71
|
-
</Chat>
|
|
72
|
-
<h3>Small</h3>
|
|
73
|
-
<Chat
|
|
74
|
-
avatar="ON"
|
|
75
|
-
name="Ola Normann"
|
|
76
|
-
timestamp="01.01.21 14:00"
|
|
77
|
-
size="small"
|
|
78
|
-
>
|
|
79
|
-
<Chat.Bubble>
|
|
80
|
-
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
81
|
-
</Chat.Bubble>
|
|
82
|
-
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
83
|
-
<Chat.Bubble>
|
|
84
|
-
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
85
|
-
laboris labore nisi ut.
|
|
86
|
-
</Chat.Bubble>
|
|
87
|
-
</Chat>
|
|
88
|
-
</VStack>
|
|
89
|
-
),
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export const Variants: Story = {
|
|
93
|
-
render: () => (
|
|
94
|
-
<VStack gap="4">
|
|
95
|
-
<h3>Info</h3>
|
|
96
|
-
<Chat avatar="NAV" name="NAV" timestamp="01.01.21 14:00" variant="info">
|
|
97
|
-
<Chat.Bubble>
|
|
98
|
-
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
99
|
-
</Chat.Bubble>
|
|
100
|
-
</Chat>
|
|
101
|
-
<h3>Neutral</h3>
|
|
102
|
-
<Chat
|
|
103
|
-
avatar="KN"
|
|
104
|
-
name="Kari Nordmann"
|
|
105
|
-
timestamp="01.01.21 14:03"
|
|
106
|
-
variant="neutral"
|
|
107
|
-
position="right"
|
|
108
|
-
>
|
|
109
|
-
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
110
|
-
</Chat>
|
|
111
|
-
<h3>Subtle</h3>
|
|
112
|
-
<Chat
|
|
113
|
-
avatar="ON"
|
|
114
|
-
name="Ola Nordmann"
|
|
115
|
-
timestamp="01.01.21 14:07"
|
|
116
|
-
variant="subtle"
|
|
117
|
-
position="right"
|
|
118
|
-
>
|
|
119
|
-
<Chat.Bubble>
|
|
120
|
-
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
121
|
-
laboris labore nisi ut.
|
|
122
|
-
</Chat.Bubble>
|
|
123
|
-
</Chat>
|
|
124
|
-
</VStack>
|
|
125
|
-
),
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export const Position: Story = {
|
|
129
|
-
render: () => (
|
|
130
|
-
<VStack gap="4">
|
|
131
|
-
<h3>Default</h3>
|
|
132
|
-
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 14:00">
|
|
133
|
-
<Chat.Bubble>
|
|
134
|
-
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
135
|
-
laboris labore nisi ut.
|
|
136
|
-
</Chat.Bubble>
|
|
137
|
-
</Chat>
|
|
138
|
-
<h3>Right</h3>
|
|
139
|
-
<Chat
|
|
140
|
-
avatar="KH"
|
|
141
|
-
name="Kari Høyli"
|
|
142
|
-
timestamp="01.01.21 14:32"
|
|
143
|
-
position="right"
|
|
144
|
-
variant="info"
|
|
145
|
-
>
|
|
146
|
-
<Chat.Bubble>
|
|
147
|
-
Reprehenderit pariatur officia exercitation laboris.
|
|
148
|
-
</Chat.Bubble>
|
|
149
|
-
<Chat.Bubble>
|
|
150
|
-
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit
|
|
151
|
-
est dolore incididunt. Occaecat cupidatat magna.
|
|
152
|
-
</Chat.Bubble>
|
|
153
|
-
</Chat>
|
|
154
|
-
<h3>Left</h3>
|
|
155
|
-
<Chat
|
|
156
|
-
position="left"
|
|
157
|
-
avatar="ON"
|
|
158
|
-
name="Ola Normann"
|
|
159
|
-
timestamp="01.01.21 15:00"
|
|
160
|
-
>
|
|
161
|
-
<Chat.Bubble>
|
|
162
|
-
Exercitation irure Lorem cupidatat culpa anim cillum esse ullamco qui
|
|
163
|
-
dolore laborum et Lorem. Labore sunt duis id Lorem voluptate commodo
|
|
164
|
-
ea esse. Dolore esse aliqua proident ea ad commodo ut dolore voluptate
|
|
165
|
-
labore sunt aute.
|
|
166
|
-
</Chat.Bubble>
|
|
167
|
-
</Chat>
|
|
168
|
-
</VStack>
|
|
169
|
-
),
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export const ToptextPosition: Story = {
|
|
173
|
-
render: () => (
|
|
174
|
-
<VStack gap="4">
|
|
175
|
-
<h3>Right</h3>
|
|
176
|
-
<Chat
|
|
177
|
-
avatar="ON"
|
|
178
|
-
name="Ola Normann"
|
|
179
|
-
timestamp="01.01.21 14:00"
|
|
180
|
-
toptextPosition="right"
|
|
181
|
-
>
|
|
182
|
-
<Chat.Bubble>
|
|
183
|
-
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
184
|
-
laboris labore nisi ut.
|
|
185
|
-
</Chat.Bubble>
|
|
186
|
-
</Chat>
|
|
187
|
-
<h3>Left</h3>
|
|
188
|
-
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 15:00">
|
|
189
|
-
<Chat.Bubble toptextPosition="left">
|
|
190
|
-
Exercitation irure Lorem cupidatat culpa anim cillum esse ullamco qui
|
|
191
|
-
dolore laborum et Lorem. Labore sunt duis id Lorem voluptate commodo
|
|
192
|
-
ea esse. Dolore esse aliqua proident ea ad commodo ut dolore voluptate
|
|
193
|
-
labore sunt aute.
|
|
194
|
-
</Chat.Bubble>
|
|
195
|
-
</Chat>
|
|
196
|
-
<h3>Left</h3>
|
|
197
|
-
<Chat
|
|
198
|
-
name="Kari Høyli"
|
|
199
|
-
timestamp="01.01.21 14:32"
|
|
200
|
-
position="right"
|
|
201
|
-
toptextPosition="left"
|
|
202
|
-
>
|
|
203
|
-
<Chat.Bubble>
|
|
204
|
-
Reprehenderit pariatur officia exercitation laboris.
|
|
205
|
-
</Chat.Bubble>
|
|
206
|
-
<Chat.Bubble>
|
|
207
|
-
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit
|
|
208
|
-
est dolore incididunt. Occaecat cupidatat magna.
|
|
209
|
-
</Chat.Bubble>
|
|
210
|
-
</Chat>
|
|
211
|
-
<h3>Right</h3>
|
|
212
|
-
<Chat
|
|
213
|
-
name="Kari Høyli"
|
|
214
|
-
timestamp="01.01.21 14:32"
|
|
215
|
-
position="right"
|
|
216
|
-
toptextPosition="right"
|
|
217
|
-
>
|
|
218
|
-
<Chat.Bubble>
|
|
219
|
-
Reprehenderit pariatur officia exercitation laboris.
|
|
220
|
-
</Chat.Bubble>
|
|
221
|
-
<Chat.Bubble>
|
|
222
|
-
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit
|
|
223
|
-
est dolore incididunt. Occaecat cupidatat magna.
|
|
224
|
-
</Chat.Bubble>
|
|
225
|
-
</Chat>
|
|
226
|
-
</VStack>
|
|
227
|
-
),
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
export const Avatar: Story = {
|
|
231
|
-
render: () => (
|
|
232
|
-
<Chat avatar={<Illustration />}>
|
|
233
|
-
<Chat.Bubble>
|
|
234
|
-
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
235
|
-
</Chat.Bubble>
|
|
236
|
-
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
237
|
-
<Chat.Bubble>
|
|
238
|
-
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
|
|
239
|
-
labore nisi ut.
|
|
240
|
-
</Chat.Bubble>
|
|
241
|
-
</Chat>
|
|
242
|
-
),
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
function Illustration() {
|
|
246
|
-
return (
|
|
247
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 54 93">
|
|
248
|
-
<path
|
|
249
|
-
fill="#e7e5e2"
|
|
250
|
-
d="M14 50.7C15 52.3 17.9 81 26.5 81S39 51.8 39 50.3c-13.2-7.6-25 .4-25 .4z"
|
|
251
|
-
/>
|
|
252
|
-
<path
|
|
253
|
-
fill="#5c4378"
|
|
254
|
-
d="M38.7 50.2c6 2.9 15.3 10.9 15.3 18.3V93H0V68.5c0-7.1 8.5-14.8 14.5-18-.3.2-.5.3-.5.3 1 1.7 3.8 9.2 12.4 9.2C35 60 39 51.9 39 50.4c-.1-.1-.2-.2-.3-.2z"
|
|
255
|
-
/>
|
|
256
|
-
<path
|
|
257
|
-
fill="#d2242a"
|
|
258
|
-
d="M46.7 76H31.2c-.7 0-1.3-.6-1.2-1.3v-8.5c0-.7.6-1.3 1.3-1.3h15.5c.7 0 1.3.6 1.3 1.3v8.5c-.1.7-.7 1.3-1.4 1.3"
|
|
259
|
-
/>
|
|
260
|
-
<path
|
|
261
|
-
fill="#fff"
|
|
262
|
-
d="M42.9 71c0 2.1-1.7 3.8-3.8 3.8-2.1 0-3.8-1.7-3.8-3.8s1.7-3.8 3.8-3.8c2.1 0 3.8 1.7 3.8 3.8m-8.7 1.7h-.7l.8-1.9h.7l-.8 1.9zm9.3 0H43l.8-1.9h.5l-.8 1.9zm1.2 0h-.2l.8-1.9h.2l-.8 1.9z"
|
|
263
|
-
/>
|
|
264
|
-
<path
|
|
265
|
-
fill="#c52d35"
|
|
266
|
-
d="M36.2 72.7h.6s.1 0 .1-.1v-1.8s0-.1-.1-.1h-.6s-.1 0-.1.1l-.2.6v.1h.2l.1 1.2c0-.1 0 0 0 0"
|
|
267
|
-
/>
|
|
268
|
-
<path
|
|
269
|
-
fill="#c52d35"
|
|
270
|
-
d="M37.5 72.7h.6s.1 0 .1-.1v-1.8s0-.1-.1-.1h-.9s-.1 0-.1.1l-.2.6-.1.1h.5c.1 0 .2.1.2.2v1c-.1-.1-.1 0 0 0m2.6-1.9h-.6s-.1 0-.1.1v1.8s0 .1.1.1h.6s.1 0 .1-.1l.2-.6V72h-.2l-.1-1.2"
|
|
271
|
-
/>
|
|
272
|
-
<path
|
|
273
|
-
fill="#c52d35"
|
|
274
|
-
d="M37.7 72.7h.4s.1 0 .1-.1l.2-.6v-.1h-.2c0 .1-.5.8-.5.8zm3.9-1.9h.7s.1 0 0 .1l-.7 1.8H41l.6-1.9"
|
|
275
|
-
/>
|
|
276
|
-
<path
|
|
277
|
-
fill="#c52d35"
|
|
278
|
-
d="M40.8 70.8h-1c-.1 0 .3.1.3.1l.7 1.7s0 .1.1.1h.6l-.7-1.9m-1.3.6v.4s-.1-.4-.3-.4c-.3 0-.3.2-.3.3 0 .1.1.3.2.3h.5l-.3.7H39c-.2 0-.9-.3-.9-.9 0-.6.5-1 .9-1 .2-.1.5.2.5.6 0-.1 0-.1 0 0z"
|
|
279
|
-
/>
|
|
280
|
-
<path
|
|
281
|
-
fill="#5a1f57"
|
|
282
|
-
d="M39.9 66.7h-1.6c-.1 0-.2-.1-.2-.2v-.3c0-.1.1-.2.2-.2h1.6c.1 0 .2.1.2.2v.3c0 .2-.1.2-.2.2"
|
|
283
|
-
/>
|
|
284
|
-
<path fill="#c2b5cf" d="M38.7 66.5h.9V64h-.9v2.5z" />
|
|
285
|
-
<path
|
|
286
|
-
fill="#e7e5e2"
|
|
287
|
-
d="M47.2 35.3C44.7 45.6 36.6 53.1 27 53.1S9.3 45.6 6.8 35.3c-.2.1-.5.1-.8.1-1.1 0-2-.8-2-1.7v-7c0-1 .9-1.7 2-1.7h.2C7.7 13.1 16.4 4 27 4c10.6 0 19.3 9.1 20.8 21h.2c1.1 0 2 .8 2 1.7v7c0 1-.9 1.7-2 1.7-.3 0-.5 0-.8-.1z"
|
|
288
|
-
/>
|
|
289
|
-
<path
|
|
290
|
-
fill="#635e59"
|
|
291
|
-
d="M19 27.6c-1.4.1-1.9-2-1.4-3.4.1-.3.6-1.5 1.4-1.5.8 0 1.2.7 1.3.8.6 1.4.3 4-1.3 4.1m16.2 0c1.4.1 1.9-2 1.4-3.4-.1-.3-.6-1.5-1.4-1.5-.8 0-1.2.7-1.3.8-.6 1.4-.3 4 1.3 4.1"
|
|
292
|
-
/>
|
|
293
|
-
<path
|
|
294
|
-
fill="#d1bfa3"
|
|
295
|
-
d="M26.8 34.6c-.4 0-.7-.1-1-.2-.3-.1-.4-.4-.3-.7.1-.3.4-.4.7-.3.5.2 1.5.1 2.2-.4.7-.4 1.1-1 1.2-1.5.1-.4-.1-.9-.4-1.3-.2-.2-.8-.2-1.6-.1-.3 0-.5-.1-.6-.4 0-.3.1-.5.4-.6 1.2-.2 2.1 0 2.6.6.5.7.8 1.4.6 2.1-.1.8-.7 1.6-1.7 2.2-.6.3-1.4.6-2.1.6z"
|
|
296
|
-
/>
|
|
297
|
-
<path
|
|
298
|
-
fill="#593a32"
|
|
299
|
-
d="M27.1 42.1h-.3c-5.3-.2-7.3-4.1-7.4-4.3-.1-.3 0-.6.2-.7.2-.1.6 0 .7.2.1.1 1.9 3.6 6.6 3.8 4.7.2 6.4-3.7 6.4-3.7.1-.3.4-.4.7-.3.3.1.4.4.3.7-.1 0-2.1 4.3-7.2 4.3z"
|
|
300
|
-
/>
|
|
301
|
-
<path
|
|
302
|
-
fill="#f6b873"
|
|
303
|
-
d="M6.6 30.7c.1-.1.1-.2.1-.3v-2c-.1-5.6 1.8-8.1 3.4-10.1 0 0-1 4.3-.3 3.4 3.8-5 21.4-1.6 25-8.1.5 3.6-4.1 4.6-4.1 4.6 3.7.7 6.9-.8 7.7-2.5.3 1.4-.6 2.4-1.9 3.4 4.5-.9 4.6-4 4.6-4 .6 4.1 5.3 2.5 5.3 9.3v6c0 .3.2.6.5.6h.5c.3 0 .5-.3.5-.6V26c.3-15.6-8.5-26-20.6-26C15.9 0 5 10.4 5 24.1v6.3c0 .4.2.6.5.6h.6c.2 0 .3-.1.5-.3"
|
|
304
|
-
/>
|
|
305
|
-
<path
|
|
306
|
-
fill="#f6b873"
|
|
307
|
-
d="M25.9 43.4c-4.4 0-8-1.4-8-3.2s3.6-3.2 8-3.2 8 1.4 8 3.2c0 1.8-3.6 3.2-8 3.2m.8-9.4c-2.9 0-4.7.7-8.8 2.1-12.7 4.6-11.6-14-11.6-14C3.4 46 18.6 52 26.5 52c8.1 0 24.1-8.1 21-30 0 0 .4 17.1-12.9 13.8-3.7-.9-5-1.8-7.9-1.8z"
|
|
308
|
-
/>
|
|
309
|
-
</svg>
|
|
310
|
-
);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export const Chromatic: Story = {
|
|
314
|
-
render: (...props) => (
|
|
315
|
-
<div>
|
|
316
|
-
<div>
|
|
317
|
-
<h2>Size</h2>
|
|
318
|
-
{Size.render?.(...props)}
|
|
319
|
-
</div>
|
|
320
|
-
<div>
|
|
321
|
-
<h2>Variants</h2>
|
|
322
|
-
{Variants.render?.(...props)}
|
|
323
|
-
</div>
|
|
324
|
-
<div>
|
|
325
|
-
<h2>Position</h2>
|
|
326
|
-
{Position.render?.(...props)}
|
|
327
|
-
</div>
|
|
328
|
-
<div>
|
|
329
|
-
<h2>Toptext</h2>
|
|
330
|
-
{ToptextPosition.render?.(...props)}
|
|
331
|
-
</div>
|
|
332
|
-
<div>
|
|
333
|
-
<h2>Avatar</h2>
|
|
334
|
-
{Avatar.render?.(...props)}
|
|
335
|
-
</div>
|
|
336
|
-
</div>
|
|
337
|
-
),
|
|
338
|
-
parameters: {
|
|
339
|
-
chromatic: { disable: false },
|
|
340
|
-
},
|
|
341
|
-
};
|