@navikt/ds-react 5.18.0 → 5.18.2
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/date/parts/DateWrapper.js +2 -2
- package/cjs/form/search/Search.js +1 -1
- package/cjs/modal/Modal.context.js +9 -0
- package/cjs/modal/Modal.js +3 -6
- package/cjs/modal/ModalHeader.js +2 -6
- package/cjs/panel/Panel.js +6 -16
- package/cjs/popover/Popover.js +2 -2
- package/cjs/tooltip/Tooltip.js +2 -2
- package/cjs/util/create-context.js +9 -5
- package/esm/date/parts/DateWrapper.js +3 -3
- package/esm/date/parts/DateWrapper.js.map +1 -1
- package/esm/form/search/Search.js +1 -1
- package/esm/modal/Modal.context.d.ts +9 -0
- package/esm/modal/Modal.context.js +6 -0
- package/esm/modal/Modal.context.js.map +1 -0
- package/esm/modal/Modal.js +3 -6
- package/esm/modal/Modal.js.map +1 -1
- package/esm/modal/ModalHeader.js +3 -7
- package/esm/modal/ModalHeader.js.map +1 -1
- package/esm/panel/Panel.d.ts +9 -16
- package/esm/panel/Panel.js +6 -16
- package/esm/panel/Panel.js.map +1 -1
- package/esm/popover/Popover.js +2 -2
- package/esm/popover/Popover.js.map +1 -1
- package/esm/tooltip/Tooltip.js +3 -3
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/esm/util/create-context.d.ts +2 -5
- package/esm/util/create-context.js +10 -6
- package/esm/util/create-context.js.map +1 -1
- package/package.json +3 -3
- package/src/accordion/accordion.stories.tsx +121 -135
- package/src/alert/alert.stories.tsx +202 -113
- package/src/button/button.stories.tsx +88 -185
- package/src/chat/chat.stories.tsx +284 -206
- package/src/date/datepicker/datepicker.stories.tsx +6 -2
- package/src/date/monthpicker/monthpicker.stories.tsx +2 -1
- package/src/date/parts/DateWrapper.tsx +3 -3
- package/src/dropdown/dropdown.stories.tsx +1 -1
- package/src/form/error-summary/error-summary.stories.tsx +1 -1
- package/src/form/search/Search.tsx +3 -3
- package/src/form/stories/confirmation-panel.stories.tsx +1 -1
- package/src/help-text/help-text.stories.tsx +2 -1
- package/src/internal-header/header.stories.tsx +2 -1
- package/src/layout/bleed/Bleed.stories.tsx +2 -1
- package/src/layout/box/Box.stories.tsx +2 -1
- package/src/layout/sidemal-test/navno-sidemal.stories.tsx +5 -1
- package/src/link/stories/link.stories.tsx +20 -22
- package/src/link-panel/link-panel.stories.tsx +1 -1
- package/src/list/list.stories.tsx +2 -1
- package/src/loader/loader.stories.tsx +1 -1
- package/src/modal/Modal.context.ts +13 -0
- package/src/modal/Modal.tsx +6 -8
- package/src/modal/ModalHeader.tsx +3 -7
- package/src/modal/modal.stories.tsx +3 -1
- package/src/panel/Panel.tsx +9 -16
- package/src/popover/Popover.tsx +2 -2
- package/src/stepper/stepper.stories.tsx +1 -1
- package/src/table/stories/{table.stories.tsx → table-1.stories.tsx} +118 -92
- package/src/table/stories/{table-expandable.stories.tsx → table-2-expandable.stories.tsx} +10 -34
- package/src/table/stories/{table-async.stories.tsx → table-3-async.stories.tsx} +5 -3
- package/src/table/stories/tests/table.stories.tsx +4 -1
- package/src/tabs/Tabs.test.tsx +109 -0
- package/src/toggle-group/ToggleGroup.test.tsx +54 -0
- package/src/tooltip/Tooltip.tsx +3 -9
- package/src/tooltip/tooltip.stories.tsx +4 -1
- package/src/typography/stories/bodylong.stories.tsx +49 -3
- package/src/typography/stories/bodyshort.stories.tsx +50 -4
- package/src/typography/stories/detail.stories.tsx +32 -3
- package/src/typography/stories/error-message.stories.tsx +34 -3
- package/src/typography/stories/heading.stories.tsx +32 -3
- package/src/typography/stories/label.stories.tsx +38 -3
- package/src/util/create-context.tsx +26 -15
- package/cjs/modal/ModalContext.js +0 -8
- package/esm/modal/ModalContext.d.ts +0 -7
- package/esm/modal/ModalContext.js +0 -3
- package/esm/modal/ModalContext.js.map +0 -1
- package/src/modal/ModalContext.ts +0 -7
- package/src/panel/panel.stories.tsx +0 -63
- package/src/typography/stories/ingress.stories.tsx +0 -50
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Meta } from "@storybook/react";
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Chat } from "../index";
|
|
3
|
+
import { Chat, VStack } from "../index";
|
|
4
4
|
import { POSITIONS, SIZES } from "./Chat";
|
|
5
5
|
|
|
6
6
|
export default {
|
|
@@ -30,9 +30,14 @@ export default {
|
|
|
30
30
|
options: SIZES,
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
|
+
parameters: {
|
|
34
|
+
chromatic: { disable: true },
|
|
35
|
+
},
|
|
33
36
|
} satisfies Meta<typeof Chat>;
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
type Story = StoryObj<typeof Chat>;
|
|
39
|
+
|
|
40
|
+
export const Controls: Story = {
|
|
36
41
|
render: (props) => {
|
|
37
42
|
return (
|
|
38
43
|
<Chat {...props}>
|
|
@@ -55,219 +60,292 @@ export const Default = {
|
|
|
55
60
|
},
|
|
56
61
|
};
|
|
57
62
|
|
|
58
|
-
export const
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
export const Size: Story = {
|
|
64
|
+
render: () => (
|
|
65
|
+
<VStack gap="4">
|
|
66
|
+
<h3>Medium</h3>
|
|
67
|
+
<Chat
|
|
68
|
+
avatar="ON"
|
|
69
|
+
name="Ola Normann"
|
|
70
|
+
timestamp="01.01.21 14:00"
|
|
71
|
+
size="medium"
|
|
72
|
+
>
|
|
73
|
+
<Chat.Bubble>
|
|
74
|
+
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
75
|
+
</Chat.Bubble>
|
|
76
|
+
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
77
|
+
<Chat.Bubble>
|
|
78
|
+
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
79
|
+
laboris labore nisi ut.
|
|
80
|
+
</Chat.Bubble>
|
|
81
|
+
</Chat>
|
|
82
|
+
<h3>Small</h3>
|
|
83
|
+
<Chat
|
|
84
|
+
avatar="ON"
|
|
85
|
+
name="Ola Normann"
|
|
86
|
+
timestamp="01.01.21 14:00"
|
|
87
|
+
size="small"
|
|
88
|
+
>
|
|
89
|
+
<Chat.Bubble>
|
|
90
|
+
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
91
|
+
</Chat.Bubble>
|
|
92
|
+
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
93
|
+
<Chat.Bubble>
|
|
94
|
+
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
95
|
+
laboris labore nisi ut.
|
|
96
|
+
</Chat.Bubble>
|
|
97
|
+
</Chat>
|
|
98
|
+
</VStack>
|
|
99
|
+
),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Variants: Story = {
|
|
103
|
+
render: () => (
|
|
104
|
+
<VStack gap="4">
|
|
105
|
+
<h3>Info</h3>
|
|
106
|
+
<Chat avatar="NAV" name="NAV" timestamp="01.01.21 14:00" variant="info">
|
|
107
|
+
<Chat.Bubble>
|
|
108
|
+
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
109
|
+
</Chat.Bubble>
|
|
110
|
+
</Chat>
|
|
111
|
+
<h3>Neutral</h3>
|
|
112
|
+
<Chat
|
|
113
|
+
avatar="KN"
|
|
114
|
+
name="Kari Nordmann"
|
|
115
|
+
timestamp="01.01.21 14:03"
|
|
116
|
+
variant="neutral"
|
|
117
|
+
position="right"
|
|
118
|
+
>
|
|
119
|
+
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
120
|
+
</Chat>
|
|
121
|
+
<h3>Subtle</h3>
|
|
122
|
+
<Chat
|
|
123
|
+
avatar="ON"
|
|
124
|
+
name="Ola Nordmann"
|
|
125
|
+
timestamp="01.01.21 14:07"
|
|
126
|
+
variant="subtle"
|
|
127
|
+
position="right"
|
|
128
|
+
>
|
|
129
|
+
<Chat.Bubble>
|
|
130
|
+
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
131
|
+
laboris labore nisi ut.
|
|
132
|
+
</Chat.Bubble>
|
|
133
|
+
</Chat>
|
|
134
|
+
</VStack>
|
|
135
|
+
),
|
|
136
|
+
};
|
|
70
137
|
|
|
71
|
-
export const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
138
|
+
export const Position: Story = {
|
|
139
|
+
render: () => (
|
|
140
|
+
<VStack gap="4">
|
|
141
|
+
<h3>Default</h3>
|
|
142
|
+
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 14:00">
|
|
143
|
+
<Chat.Bubble>
|
|
144
|
+
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
145
|
+
laboris labore nisi ut.
|
|
146
|
+
</Chat.Bubble>
|
|
147
|
+
</Chat>
|
|
148
|
+
<h3>Right</h3>
|
|
149
|
+
<Chat
|
|
150
|
+
avatar="KH"
|
|
151
|
+
name="Kari Høyli"
|
|
152
|
+
timestamp="01.01.21 14:32"
|
|
153
|
+
position="right"
|
|
154
|
+
variant="info"
|
|
155
|
+
>
|
|
156
|
+
<Chat.Bubble>
|
|
157
|
+
Reprehenderit pariatur officia exercitation laboris.
|
|
158
|
+
</Chat.Bubble>
|
|
159
|
+
<Chat.Bubble>
|
|
160
|
+
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit
|
|
161
|
+
est dolore incididunt. Occaecat cupidatat magna.
|
|
162
|
+
</Chat.Bubble>
|
|
163
|
+
</Chat>
|
|
164
|
+
<h3>Left</h3>
|
|
165
|
+
<Chat
|
|
166
|
+
position="left"
|
|
167
|
+
avatar="ON"
|
|
168
|
+
name="Ola Normann"
|
|
169
|
+
timestamp="01.01.21 15:00"
|
|
170
|
+
>
|
|
171
|
+
<Chat.Bubble>
|
|
172
|
+
Exercitation irure Lorem cupidatat culpa anim cillum esse ullamco qui
|
|
173
|
+
dolore laborum et Lorem. Labore sunt duis id Lorem voluptate commodo
|
|
174
|
+
ea esse. Dolore esse aliqua proident ea ad commodo ut dolore voluptate
|
|
175
|
+
labore sunt aute.
|
|
176
|
+
</Chat.Bubble>
|
|
177
|
+
</Chat>
|
|
178
|
+
</VStack>
|
|
179
|
+
),
|
|
180
|
+
};
|
|
91
181
|
|
|
92
|
-
export const
|
|
93
|
-
|
|
94
|
-
<
|
|
182
|
+
export const ToptextPosition: Story = {
|
|
183
|
+
render: () => (
|
|
184
|
+
<VStack gap="4">
|
|
185
|
+
<h3>Right</h3>
|
|
186
|
+
<Chat
|
|
187
|
+
avatar="ON"
|
|
188
|
+
name="Ola Normann"
|
|
189
|
+
timestamp="01.01.21 14:00"
|
|
190
|
+
toptextPosition="right"
|
|
191
|
+
>
|
|
192
|
+
<Chat.Bubble>
|
|
193
|
+
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
194
|
+
laboris labore nisi ut.
|
|
195
|
+
</Chat.Bubble>
|
|
196
|
+
</Chat>
|
|
197
|
+
<h3>Left</h3>
|
|
198
|
+
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 15:00">
|
|
199
|
+
<Chat.Bubble toptextPosition="left">
|
|
200
|
+
Exercitation irure Lorem cupidatat culpa anim cillum esse ullamco qui
|
|
201
|
+
dolore laborum et Lorem. Labore sunt duis id Lorem voluptate commodo
|
|
202
|
+
ea esse. Dolore esse aliqua proident ea ad commodo ut dolore voluptate
|
|
203
|
+
labore sunt aute.
|
|
204
|
+
</Chat.Bubble>
|
|
205
|
+
</Chat>
|
|
206
|
+
<h3>Left</h3>
|
|
207
|
+
<Chat
|
|
208
|
+
name="Kari Høyli"
|
|
209
|
+
timestamp="01.01.21 14:32"
|
|
210
|
+
position="right"
|
|
211
|
+
toptextPosition="left"
|
|
212
|
+
>
|
|
213
|
+
<Chat.Bubble>
|
|
214
|
+
Reprehenderit pariatur officia exercitation laboris.
|
|
215
|
+
</Chat.Bubble>
|
|
216
|
+
<Chat.Bubble>
|
|
217
|
+
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit
|
|
218
|
+
est dolore incididunt. Occaecat cupidatat magna.
|
|
219
|
+
</Chat.Bubble>
|
|
220
|
+
</Chat>
|
|
221
|
+
<h3>Right</h3>
|
|
222
|
+
<Chat
|
|
223
|
+
name="Kari Høyli"
|
|
224
|
+
timestamp="01.01.21 14:32"
|
|
225
|
+
position="right"
|
|
226
|
+
toptextPosition="right"
|
|
227
|
+
>
|
|
228
|
+
<Chat.Bubble>
|
|
229
|
+
Reprehenderit pariatur officia exercitation laboris.
|
|
230
|
+
</Chat.Bubble>
|
|
231
|
+
<Chat.Bubble>
|
|
232
|
+
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit
|
|
233
|
+
est dolore incididunt. Occaecat cupidatat magna.
|
|
234
|
+
</Chat.Bubble>
|
|
235
|
+
</Chat>
|
|
236
|
+
</VStack>
|
|
237
|
+
),
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export const Avatar: Story = {
|
|
241
|
+
render: () => (
|
|
242
|
+
<Chat avatar={<Illustration />}>
|
|
95
243
|
<Chat.Bubble>
|
|
96
244
|
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
97
245
|
</Chat.Bubble>
|
|
98
|
-
</Chat>
|
|
99
|
-
<Chat
|
|
100
|
-
avatar="KN"
|
|
101
|
-
name="Kari Nordmann"
|
|
102
|
-
timestamp="01.01.21 14:03"
|
|
103
|
-
variant="neutral"
|
|
104
|
-
position="right"
|
|
105
|
-
>
|
|
106
246
|
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
107
|
-
</Chat>
|
|
108
|
-
<Chat
|
|
109
|
-
avatar="ON"
|
|
110
|
-
name="Ola Nordmann"
|
|
111
|
-
timestamp="01.01.21 14:07"
|
|
112
|
-
variant="subtle"
|
|
113
|
-
position="right"
|
|
114
|
-
>
|
|
115
|
-
<Chat.Bubble>
|
|
116
|
-
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
|
|
117
|
-
labore nisi ut.
|
|
118
|
-
</Chat.Bubble>
|
|
119
|
-
</Chat>
|
|
120
|
-
</div>
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
export const Position = () => (
|
|
124
|
-
<div className="colgap">
|
|
125
|
-
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 14:00">
|
|
126
247
|
<Chat.Bubble>
|
|
127
248
|
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
|
|
128
249
|
labore nisi ut.
|
|
129
250
|
</Chat.Bubble>
|
|
130
251
|
</Chat>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
name="Kari Høyli"
|
|
134
|
-
timestamp="01.01.21 14:32"
|
|
135
|
-
position="right"
|
|
136
|
-
variant="info"
|
|
137
|
-
>
|
|
138
|
-
<Chat.Bubble>
|
|
139
|
-
Reprehenderit pariatur officia exercitation laboris.
|
|
140
|
-
</Chat.Bubble>
|
|
141
|
-
<Chat.Bubble>
|
|
142
|
-
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit est
|
|
143
|
-
dolore incididunt. Occaecat cupidatat magna.
|
|
144
|
-
</Chat.Bubble>
|
|
145
|
-
</Chat>
|
|
146
|
-
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 15:00">
|
|
147
|
-
<Chat.Bubble>
|
|
148
|
-
Exercitation irure Lorem cupidatat culpa anim cillum esse ullamco qui
|
|
149
|
-
dolore laborum et Lorem. Labore sunt duis id Lorem voluptate commodo ea
|
|
150
|
-
esse. Dolore esse aliqua proident ea ad commodo ut dolore voluptate
|
|
151
|
-
labore sunt aute.
|
|
152
|
-
</Chat.Bubble>
|
|
153
|
-
</Chat>
|
|
154
|
-
</div>
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
export const ToptextPosition = () => (
|
|
158
|
-
<div className="colgap">
|
|
159
|
-
<Chat
|
|
160
|
-
avatar="ON"
|
|
161
|
-
name="Ola Normann"
|
|
162
|
-
timestamp="01.01.21 14:00"
|
|
163
|
-
toptextPosition="right"
|
|
164
|
-
>
|
|
165
|
-
<Chat.Bubble>
|
|
166
|
-
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
|
|
167
|
-
labore nisi ut.
|
|
168
|
-
</Chat.Bubble>
|
|
169
|
-
</Chat>
|
|
170
|
-
<Chat
|
|
171
|
-
name="Kari Høyli"
|
|
172
|
-
timestamp="01.01.21 14:32"
|
|
173
|
-
position="right"
|
|
174
|
-
variant="info"
|
|
175
|
-
toptextPosition="left"
|
|
176
|
-
>
|
|
177
|
-
<Chat.Bubble>
|
|
178
|
-
Reprehenderit pariatur officia exercitation laboris.
|
|
179
|
-
</Chat.Bubble>
|
|
180
|
-
<Chat.Bubble>
|
|
181
|
-
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit est
|
|
182
|
-
dolore incididunt. Occaecat cupidatat magna.
|
|
183
|
-
</Chat.Bubble>
|
|
184
|
-
</Chat>
|
|
185
|
-
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 15:00">
|
|
186
|
-
<Chat.Bubble toptextPosition="right">
|
|
187
|
-
Exercitation irure Lorem cupidatat culpa anim cillum esse ullamco qui
|
|
188
|
-
dolore laborum et Lorem. Labore sunt duis id Lorem voluptate commodo ea
|
|
189
|
-
esse. Dolore esse aliqua proident ea ad commodo ut dolore voluptate
|
|
190
|
-
labore sunt aute.
|
|
191
|
-
</Chat.Bubble>
|
|
192
|
-
</Chat>
|
|
193
|
-
</div>
|
|
194
|
-
);
|
|
252
|
+
),
|
|
253
|
+
};
|
|
195
254
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
<
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
255
|
+
function Illustration() {
|
|
256
|
+
return (
|
|
257
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 54 93">
|
|
258
|
+
<path
|
|
259
|
+
fill="#e7e5e2"
|
|
260
|
+
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"
|
|
261
|
+
/>
|
|
262
|
+
<path
|
|
263
|
+
fill="#5c4378"
|
|
264
|
+
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"
|
|
265
|
+
/>
|
|
266
|
+
<path
|
|
267
|
+
fill="#d2242a"
|
|
268
|
+
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"
|
|
269
|
+
/>
|
|
270
|
+
<path
|
|
271
|
+
fill="#fff"
|
|
272
|
+
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"
|
|
273
|
+
/>
|
|
274
|
+
<path
|
|
275
|
+
fill="#c52d35"
|
|
276
|
+
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"
|
|
277
|
+
/>
|
|
278
|
+
<path
|
|
279
|
+
fill="#c52d35"
|
|
280
|
+
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"
|
|
281
|
+
/>
|
|
282
|
+
<path
|
|
283
|
+
fill="#c52d35"
|
|
284
|
+
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"
|
|
285
|
+
/>
|
|
286
|
+
<path
|
|
287
|
+
fill="#c52d35"
|
|
288
|
+
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"
|
|
289
|
+
/>
|
|
290
|
+
<path
|
|
291
|
+
fill="#5a1f57"
|
|
292
|
+
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"
|
|
293
|
+
/>
|
|
294
|
+
<path fill="#c2b5cf" d="M38.7 66.5h.9V64h-.9v2.5z" />
|
|
295
|
+
<path
|
|
296
|
+
fill="#e7e5e2"
|
|
297
|
+
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"
|
|
298
|
+
/>
|
|
299
|
+
<path
|
|
300
|
+
fill="#635e59"
|
|
301
|
+
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"
|
|
302
|
+
/>
|
|
303
|
+
<path
|
|
304
|
+
fill="#d1bfa3"
|
|
305
|
+
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"
|
|
306
|
+
/>
|
|
307
|
+
<path
|
|
308
|
+
fill="#593a32"
|
|
309
|
+
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"
|
|
310
|
+
/>
|
|
311
|
+
<path
|
|
312
|
+
fill="#f6b873"
|
|
313
|
+
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"
|
|
314
|
+
/>
|
|
315
|
+
<path
|
|
316
|
+
fill="#f6b873"
|
|
317
|
+
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"
|
|
318
|
+
/>
|
|
319
|
+
</svg>
|
|
320
|
+
);
|
|
321
|
+
}
|
|
208
322
|
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
<
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
/>
|
|
239
|
-
<path
|
|
240
|
-
fill="#c52d35"
|
|
241
|
-
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"
|
|
242
|
-
/>
|
|
243
|
-
<path
|
|
244
|
-
fill="#5a1f57"
|
|
245
|
-
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"
|
|
246
|
-
/>
|
|
247
|
-
<path fill="#c2b5cf" d="M38.7 66.5h.9V64h-.9v2.5z" />
|
|
248
|
-
<path
|
|
249
|
-
fill="#e7e5e2"
|
|
250
|
-
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"
|
|
251
|
-
/>
|
|
252
|
-
<path
|
|
253
|
-
fill="#635e59"
|
|
254
|
-
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"
|
|
255
|
-
/>
|
|
256
|
-
<path
|
|
257
|
-
fill="#d1bfa3"
|
|
258
|
-
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"
|
|
259
|
-
/>
|
|
260
|
-
<path
|
|
261
|
-
fill="#593a32"
|
|
262
|
-
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"
|
|
263
|
-
/>
|
|
264
|
-
<path
|
|
265
|
-
fill="#f6b873"
|
|
266
|
-
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"
|
|
267
|
-
/>
|
|
268
|
-
<path
|
|
269
|
-
fill="#f6b873"
|
|
270
|
-
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"
|
|
271
|
-
/>
|
|
272
|
-
</svg>
|
|
273
|
-
);
|
|
323
|
+
export const Chromatic: Story = {
|
|
324
|
+
render: (...props) => (
|
|
325
|
+
<div>
|
|
326
|
+
<div>
|
|
327
|
+
<h2>Size</h2>
|
|
328
|
+
{Size.render?.(...props)}
|
|
329
|
+
</div>
|
|
330
|
+
<div>
|
|
331
|
+
<h2>Variants</h2>
|
|
332
|
+
{Variants.render?.(...props)}
|
|
333
|
+
</div>
|
|
334
|
+
<div>
|
|
335
|
+
<h2>Position</h2>
|
|
336
|
+
{Position.render?.(...props)}
|
|
337
|
+
</div>
|
|
338
|
+
<div>
|
|
339
|
+
<h2>Toptext</h2>
|
|
340
|
+
{ToptextPosition.render?.(...props)}
|
|
341
|
+
</div>
|
|
342
|
+
<div>
|
|
343
|
+
<h2>Avatar</h2>
|
|
344
|
+
{Avatar.render?.(...props)}
|
|
345
|
+
</div>
|
|
346
|
+
</div>
|
|
347
|
+
),
|
|
348
|
+
parameters: {
|
|
349
|
+
chromatic: { disable: false },
|
|
350
|
+
},
|
|
351
|
+
};
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react";
|
|
3
3
|
import isSameDay from "date-fns/isSameDay";
|
|
4
4
|
import React, { useId, useState } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Button } from "../../button";
|
|
6
|
+
import { HGrid } from "../../layout/grid";
|
|
7
|
+
import { VStack } from "../../layout/stack";
|
|
8
|
+
import Modal from "../../modal/Modal";
|
|
9
|
+
import { BodyLong } from "../../typography";
|
|
10
|
+
import { useDatepicker, useRangeDatepicker } from "../hooks";
|
|
7
11
|
import DatePicker, { DatePickerProps } from "./DatePicker";
|
|
8
12
|
|
|
9
13
|
const disabledDays = [
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Meta, StoryFn } from "@storybook/react";
|
|
2
2
|
import setYear from "date-fns/setYear";
|
|
3
3
|
import React, { useId, useState } from "react";
|
|
4
|
-
import { Button
|
|
4
|
+
import { Button } from "../../button";
|
|
5
5
|
import { useMonthpicker } from "../hooks";
|
|
6
|
+
import { DateInputProps } from "../parts/DateInput";
|
|
6
7
|
import MonthPicker from "./MonthPicker";
|
|
7
8
|
import { MonthPickerProps } from "./types";
|
|
8
9
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useRef } from "react";
|
|
3
3
|
import { Button } from "../../button";
|
|
4
4
|
import { Modal } from "../../modal";
|
|
5
|
-
import {
|
|
5
|
+
import { useModalContext } from "../../modal/Modal.context";
|
|
6
6
|
import { Popover } from "../../popover";
|
|
7
7
|
import { useMedia } from "../../util/hooks";
|
|
8
8
|
import { modalCloseButtonLabel, modalLabel } from "../utils/labels";
|
|
@@ -30,7 +30,7 @@ export const DateWrapper = ({
|
|
|
30
30
|
popoverProps,
|
|
31
31
|
}: DateWrapperProps) => {
|
|
32
32
|
const modalRef = useRef<HTMLDialogElement>(null);
|
|
33
|
-
const isInModal =
|
|
33
|
+
const isInModal = useModalContext(false) !== undefined;
|
|
34
34
|
const hideModal =
|
|
35
35
|
useMedia("screen and (min-width: 768px)", true) && !isInModal;
|
|
36
36
|
|
|
@@ -66,10 +66,10 @@ export interface SearchProps
|
|
|
66
66
|
* Exposes the HTML size attribute
|
|
67
67
|
*/
|
|
68
68
|
htmlSize?: number | string;
|
|
69
|
-
|
|
69
|
+
/*
|
|
70
70
|
* Exposes role attribute
|
|
71
71
|
*/
|
|
72
|
-
role?: string
|
|
72
|
+
role?: string;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
interface SearchComponent
|
|
@@ -210,7 +210,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
|
|
|
210
210
|
value={value ?? internalValue}
|
|
211
211
|
onChange={(e) => handleChange(e.target.value)}
|
|
212
212
|
type="search"
|
|
213
|
-
role={role ??
|
|
213
|
+
role={role ?? "searchbox"}
|
|
214
214
|
className={cl(
|
|
215
215
|
className,
|
|
216
216
|
"navds-search__input",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Meta, StoryFn, StoryObj } from "@storybook/react";
|
|
2
2
|
import React, { useEffect, useRef } from "react";
|
|
3
|
-
import { BodyLong, Heading
|
|
3
|
+
import { BodyLong, Heading } from "../typography";
|
|
4
|
+
import HelpText from "./HelpText";
|
|
4
5
|
|
|
5
6
|
const meta: Meta<typeof HelpText> = {
|
|
6
7
|
title: "ds-react/HelpText",
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
MenuGridIcon,
|
|
7
7
|
} from "@navikt/aksel-icons";
|
|
8
8
|
import { BodyLong, BodyShort, Detail } from "@navikt/ds-react";
|
|
9
|
-
import { Dropdown
|
|
9
|
+
import { Dropdown } from "../dropdown";
|
|
10
|
+
import InternalHeader from "./InternalHeader";
|
|
10
11
|
|
|
11
12
|
export default {
|
|
12
13
|
title: "ds-react/InternalHeader",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Meta } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Box, HStack, VStack } from "../..";
|
|
4
3
|
import { BodyLong } from "../../typography";
|
|
4
|
+
import { Box } from "../box";
|
|
5
|
+
import { HStack, VStack } from "../stack";
|
|
5
6
|
import { Bleed } from "./Bleed";
|
|
6
7
|
|
|
7
8
|
export default {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Meta } from "@storybook/react";
|
|
2
2
|
import React, { ReactNode } from "react";
|
|
3
3
|
import { ChevronRightIcon } from "@navikt/aksel-icons";
|
|
4
|
-
import { HGrid, HStack, VStack } from "../..";
|
|
5
4
|
import { BodyLong, Detail, Heading } from "../../typography";
|
|
5
|
+
import { HGrid } from "../grid";
|
|
6
|
+
import { HStack, VStack } from "../stack";
|
|
6
7
|
import { BackgroundToken, BorderRadiiToken } from "../utilities/types";
|
|
7
8
|
import { Box } from "./Box";
|
|
8
9
|
|