@navikt/ds-react 6.5.0 → 6.6.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.
Files changed (153) hide show
  1. package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +2 -4
  2. package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
  3. package/cjs/form/combobox/Input/Input.js +6 -1
  4. package/cjs/form/combobox/Input/Input.js.map +1 -1
  5. package/cjs/form/form-summary/FormSummary.d.ts +82 -0
  6. package/cjs/form/form-summary/FormSummary.js +81 -0
  7. package/cjs/form/form-summary/FormSummary.js.map +1 -0
  8. package/cjs/form/form-summary/FormSummaryAnswer.d.ts +11 -0
  9. package/cjs/form/form-summary/FormSummaryAnswer.js +25 -0
  10. package/cjs/form/form-summary/FormSummaryAnswer.js.map +1 -0
  11. package/cjs/form/form-summary/FormSummaryAnswers.d.ts +9 -0
  12. package/cjs/form/form-summary/FormSummaryAnswers.js +48 -0
  13. package/cjs/form/form-summary/FormSummaryAnswers.js.map +1 -0
  14. package/cjs/form/form-summary/FormSummaryEditLink.d.ts +17 -0
  15. package/cjs/form/form-summary/FormSummaryEditLink.js +49 -0
  16. package/cjs/form/form-summary/FormSummaryEditLink.js.map +1 -0
  17. package/cjs/form/form-summary/FormSummaryHeader.d.ts +9 -0
  18. package/cjs/form/form-summary/FormSummaryHeader.js +48 -0
  19. package/cjs/form/form-summary/FormSummaryHeader.js.map +1 -0
  20. package/cjs/form/form-summary/FormSummaryHeading.d.ts +14 -0
  21. package/cjs/form/form-summary/FormSummaryHeading.js +31 -0
  22. package/cjs/form/form-summary/FormSummaryHeading.js.map +1 -0
  23. package/cjs/form/form-summary/FormSummaryLabel.d.ts +6 -0
  24. package/cjs/form/form-summary/FormSummaryLabel.js +45 -0
  25. package/cjs/form/form-summary/FormSummaryLabel.js.map +1 -0
  26. package/cjs/form/form-summary/FormSummaryValue.d.ts +6 -0
  27. package/cjs/form/form-summary/FormSummaryValue.js +49 -0
  28. package/cjs/form/form-summary/FormSummaryValue.js.map +1 -0
  29. package/cjs/form/form-summary/index.d.ts +8 -0
  30. package/cjs/form/form-summary/index.js +24 -0
  31. package/cjs/form/form-summary/index.js.map +1 -0
  32. package/cjs/index.d.ts +3 -2
  33. package/cjs/index.js +5 -3
  34. package/cjs/index.js.map +1 -1
  35. package/cjs/util/hooks/descendants/descendant.js +10 -1
  36. package/cjs/util/hooks/descendants/descendant.js.map +1 -1
  37. package/cjs/util/hooks/descendants/useDescendant.js +0 -5
  38. package/cjs/util/hooks/descendants/useDescendant.js.map +1 -1
  39. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js +2 -4
  40. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
  41. package/esm/form/combobox/Input/Input.js +6 -1
  42. package/esm/form/combobox/Input/Input.js.map +1 -1
  43. package/esm/form/form-summary/FormSummary.d.ts +82 -0
  44. package/esm/form/form-summary/FormSummary.js +52 -0
  45. package/esm/form/form-summary/FormSummary.js.map +1 -0
  46. package/esm/form/form-summary/FormSummaryAnswer.d.ts +11 -0
  47. package/esm/form/form-summary/FormSummaryAnswer.js +19 -0
  48. package/esm/form/form-summary/FormSummaryAnswer.js.map +1 -0
  49. package/esm/form/form-summary/FormSummaryAnswers.d.ts +9 -0
  50. package/esm/form/form-summary/FormSummaryAnswers.js +19 -0
  51. package/esm/form/form-summary/FormSummaryAnswers.js.map +1 -0
  52. package/esm/form/form-summary/FormSummaryEditLink.d.ts +17 -0
  53. package/esm/form/form-summary/FormSummaryEditLink.js +20 -0
  54. package/esm/form/form-summary/FormSummaryEditLink.js.map +1 -0
  55. package/esm/form/form-summary/FormSummaryHeader.d.ts +9 -0
  56. package/esm/form/form-summary/FormSummaryHeader.js +19 -0
  57. package/esm/form/form-summary/FormSummaryHeader.js.map +1 -0
  58. package/esm/form/form-summary/FormSummaryHeading.d.ts +14 -0
  59. package/esm/form/form-summary/FormSummaryHeading.js +5 -0
  60. package/esm/form/form-summary/FormSummaryHeading.js.map +1 -0
  61. package/esm/form/form-summary/FormSummaryLabel.d.ts +6 -0
  62. package/esm/form/form-summary/FormSummaryLabel.js +19 -0
  63. package/esm/form/form-summary/FormSummaryLabel.js.map +1 -0
  64. package/esm/form/form-summary/FormSummaryValue.d.ts +6 -0
  65. package/esm/form/form-summary/FormSummaryValue.js +20 -0
  66. package/esm/form/form-summary/FormSummaryValue.js.map +1 -0
  67. package/esm/form/form-summary/index.d.ts +8 -0
  68. package/esm/form/form-summary/index.js +10 -0
  69. package/esm/form/form-summary/index.js.map +1 -0
  70. package/esm/index.d.ts +3 -2
  71. package/esm/index.js +2 -1
  72. package/esm/index.js.map +1 -1
  73. package/esm/util/hooks/descendants/descendant.js +10 -1
  74. package/esm/util/hooks/descendants/descendant.js.map +1 -1
  75. package/esm/util/hooks/descendants/useDescendant.js +0 -5
  76. package/esm/util/hooks/descendants/useDescendant.js.map +1 -1
  77. package/package.json +15 -4
  78. package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +9 -1
  79. package/src/form/combobox/Input/Input.tsx +5 -0
  80. package/src/form/form-summary/FormSummary.tsx +106 -0
  81. package/src/form/form-summary/FormSummaryAnswer.tsx +27 -0
  82. package/src/form/form-summary/FormSummaryAnswers.tsx +25 -0
  83. package/src/form/form-summary/FormSummaryEditLink.tsx +35 -0
  84. package/src/form/form-summary/FormSummaryHeader.tsx +25 -0
  85. package/src/form/form-summary/FormSummaryHeading.tsx +23 -0
  86. package/src/form/form-summary/FormSummaryLabel.tsx +17 -0
  87. package/src/form/form-summary/FormSummaryValue.tsx +24 -0
  88. package/src/form/form-summary/index.ts +30 -0
  89. package/src/index.ts +16 -15
  90. package/src/util/hooks/descendants/descendant.ts +15 -1
  91. package/src/util/hooks/descendants/useDescendant.tsx +0 -5
  92. package/src/accordion/accordion.stories.tsx +0 -286
  93. package/src/alert/alert.stories.tsx +0 -306
  94. package/src/button/button.stories.tsx +0 -185
  95. package/src/chat/chat.stories.tsx +0 -341
  96. package/src/chips/chips.stories.tsx +0 -260
  97. package/src/copybutton/copy-button.stories.tsx +0 -261
  98. package/src/date/datepicker/datepicker.stories.tsx +0 -614
  99. package/src/date/monthpicker/monthpicker.stories.tsx +0 -221
  100. package/src/dropdown/dropdown.stories.tsx +0 -124
  101. package/src/expansion-card/expansion-card.stories.tsx +0 -282
  102. package/src/form/checkbox/checkbox.stories.tsx +0 -281
  103. package/src/form/combobox/combobox.stories.tsx +0 -626
  104. package/src/form/confirmation-panel/confirmation-panel.stories.tsx +0 -128
  105. package/src/form/error-summary/error-summary.stories.tsx +0 -81
  106. package/src/form/fieldset/fieldset.stories.tsx +0 -157
  107. package/src/form/file-upload/file-upload-dropzone.stories.tsx +0 -123
  108. package/src/form/file-upload/file-upload-item.stories.tsx +0 -148
  109. package/src/form/file-upload/file-upload.stories.tsx +0 -248
  110. package/src/form/radio/radio.stories.tsx +0 -230
  111. package/src/form/search/search.stories.tsx +0 -238
  112. package/src/form/select/select.stories.tsx +0 -172
  113. package/src/form/switch/switch.stories.tsx +0 -171
  114. package/src/form/textarea/textarea.stories.tsx +0 -254
  115. package/src/form/textfield/text-field.stories.tsx +0 -143
  116. package/src/guide-panel/guidepanel.stories.tsx +0 -90
  117. package/src/help-text/help-text.stories.tsx +0 -91
  118. package/src/internal-header/header.stories.tsx +0 -229
  119. package/src/layout/bleed/Bleed.stories.tsx +0 -395
  120. package/src/layout/box/Box.stories.tsx +0 -380
  121. package/src/layout/grid/h-grid.stories.tsx +0 -122
  122. package/src/layout/page/Page.stories.tsx +0 -271
  123. package/src/layout/responsive/hide.stories.tsx +0 -80
  124. package/src/layout/responsive/show.stories.tsx +0 -80
  125. package/src/layout/sidemal-test/navno-sidemal.stories.tsx +0 -69
  126. package/src/layout/stack/stack.stories.tsx +0 -183
  127. package/src/link/stories/link.stories.tsx +0 -304
  128. package/src/link-panel/link-panel.stories.tsx +0 -59
  129. package/src/list/list.stories.tsx +0 -280
  130. package/src/loader/loader.stories.tsx +0 -82
  131. package/src/modal/modal.stories.tsx +0 -391
  132. package/src/pagination/pagination.stories.tsx +0 -110
  133. package/src/popover/popover.stories.tsx +0 -113
  134. package/src/portal/Portal.stories.tsx +0 -102
  135. package/src/read-more/readmore.stories.tsx +0 -91
  136. package/src/skeleton/skeleton.stories.tsx +0 -130
  137. package/src/stepper/stepper.stories.tsx +0 -200
  138. package/src/table/stories/table-1.stories.tsx +0 -292
  139. package/src/table/stories/table-2-expandable.stories.tsx +0 -298
  140. package/src/table/stories/table-3-async.stories.tsx +0 -179
  141. package/src/table/stories/tests/table.stories.tsx +0 -102
  142. package/src/tabs/Tabs.stories.tsx +0 -311
  143. package/src/tag/tag.stories.tsx +0 -126
  144. package/src/timeline/timeline.stories.tsx +0 -445
  145. package/src/toggle-group/ToggleGroup.stories.tsx +0 -198
  146. package/src/tooltip/tooltip.stories.tsx +0 -101
  147. package/src/typography/stories/bodylong.stories.tsx +0 -209
  148. package/src/typography/stories/bodyshort.stories.tsx +0 -208
  149. package/src/typography/stories/detail.stories.tsx +0 -115
  150. package/src/typography/stories/error-message.stories.tsx +0 -122
  151. package/src/typography/stories/heading.stories.tsx +0 -169
  152. package/src/typography/stories/label.stories.tsx +0 -131
  153. package/src/util/hooks/descendants/descendant.stories.tsx +0 -147
@@ -1,380 +0,0 @@
1
- import type { Meta } from "@storybook/react";
2
- import React, { ReactNode } from "react";
3
- import { ChevronRightIcon } from "@navikt/aksel-icons";
4
- import { BodyLong, Detail, Heading } from "../../typography";
5
- import { HGrid } from "../grid";
6
- import { HStack, VStack } from "../stack";
7
- import { BackgroundToken, BorderRadiiToken } from "../utilities/types";
8
- import { Box } from "./Box";
9
-
10
- const meta: Meta<typeof Box> = {
11
- title: "ds-react/Primitives/Box",
12
- component: Box,
13
- };
14
- export default meta;
15
-
16
- export const Default = () => (
17
- <Box>
18
- <BodyLong>
19
- This is inside a box. Deserunt veniam eu fugiat ad est occaecat aliqua
20
- nisi aliquip. Aute amet occaecat ex aliqua irure elit labore pariatur.
21
- Proident pariatur proident pariatur magna consequat velit id commodo quis
22
- sunt tempor ullamco aliquip pariatur.
23
- </BodyLong>
24
- </Box>
25
- );
26
-
27
- const Card = ({
28
- background,
29
- borderRadius = "xlarge",
30
- children,
31
- }: {
32
- background?: BackgroundToken;
33
- borderRadius?: BorderRadiiToken;
34
- children: ReactNode;
35
- }) => (
36
- <Box
37
- padding="4"
38
- background={background}
39
- borderColor="border-subtle"
40
- borderRadius={borderRadius}
41
- shadow="xsmall"
42
- >
43
- <div style={{ width: "20rem" }}>{children}</div>
44
- </Box>
45
- );
46
-
47
- export const AsCard = () => (
48
- <HStack gap="4" justify="center">
49
- <Card>
50
- <h1>Card one</h1>
51
- <BodyLong>
52
- This is inside a box. Deserunt veniam eu fugiat ad est occaecat aliqua
53
- nisi aliquip. Aute amet occaecat ex aliqua irure elit labore
54
- </BodyLong>
55
- </Card>
56
- <Card>
57
- <h1>Card two</h1>
58
- <BodyLong>
59
- This is inside a box. Deserunt veniam eu fugiat ad est occaecat aliqua
60
- nisi aliquip. Aute amet occaecat ex aliqua irure elit labore
61
- </BodyLong>
62
- </Card>
63
- <Card>
64
- <h1>Card three</h1>
65
- <BodyLong>
66
- This is inside a box. Deserunt veniam eu fugiat ad est occaecat aliqua
67
- nisi aliquip. Aute amet occaecat ex aliqua irure elit labore
68
- </BodyLong>
69
- </Card>
70
- </HStack>
71
- );
72
-
73
- export const ThemingDemo = () => {
74
- const LinkCard = () => {
75
- return (
76
- <>
77
- <style>
78
- {`
79
- .link-card {
80
- color: var(--navds-color-text-primary);
81
- text-decoration: none;
82
- }
83
- .link-card:hover {
84
- border-color: var(--a-border-action);
85
- box-shadow: var(--a-shadow-small);
86
- }
87
- .link-card:hover .navds-heading {
88
- color: var(--a-text-action);
89
- text-decoration: underline;
90
- }
91
- .link-card:hover .link-card__chevron,
92
- .link-card:focus-within .link-card__chevron {
93
- transform: translateX(4px);
94
- }
95
- .link-card__chevron {
96
- flex-shrink: 0;
97
- font-size: 1.5rem;
98
- transition: transform 200ms;
99
- }
100
- `}
101
- </style>
102
- <Box
103
- as="a"
104
- href="#"
105
- className="link-card"
106
- borderRadius="small"
107
- borderColor="border-default"
108
- borderWidth="1"
109
- padding="4"
110
- onClick={() => alert("Clicked!")}
111
- >
112
- <HStack gap="4" align="center">
113
- <VStack gap="2">
114
- <Heading size="medium">
115
- LinkCard som bruker Box, HStack og VStack
116
- </Heading>
117
- <BodyLong>This truly is inside a box!</BodyLong>
118
- </VStack>
119
- <ChevronRightIcon fontSize={24} className="link-card__chevron" />
120
- </HStack>
121
- </Box>
122
- </>
123
- );
124
- };
125
-
126
- const ChatBubble = () => {
127
- return (
128
- <>
129
- <Box
130
- background="surface-neutral-subtle"
131
- shadow="xsmall"
132
- padding="4"
133
- borderRadius="xlarge xlarge xlarge 0"
134
- >
135
- <VStack gap="2">
136
- <Detail>BOX • 01.01.21 14:00</Detail>
137
- <BodyLong>
138
- Hei! Dette er en chatbobble som bruker Box som base!
139
- </BodyLong>
140
- </VStack>
141
- </Box>
142
- </>
143
- );
144
- };
145
-
146
- const PricePill = () => {
147
- return (
148
- <>
149
- <style>
150
- {`
151
- .old-price {
152
- text-decoration: line-through;
153
- }
154
- `}
155
- </style>
156
- <HStack>
157
- <Box
158
- background="surface-success-subtle"
159
- shadow="xsmall"
160
- padding="4"
161
- borderRadius="full 0 0 full"
162
- >
163
- <VStack align="center">
164
- <Detail>Episk ny pris</Detail>
165
- <Heading size="medium">889.99 kr</Heading>
166
- </VStack>
167
- </Box>
168
- <Box
169
- background="surface-danger-subtle"
170
- shadow="xsmall"
171
- padding="4"
172
- borderRadius="0 full full 0"
173
- >
174
- <VStack align="center">
175
- <Detail>Førpris</Detail>
176
- <Heading className="old-price" size="medium">
177
- 399.99 kr
178
- </Heading>
179
- </VStack>
180
- </Box>
181
- </HStack>
182
- </>
183
- );
184
- };
185
-
186
- return (
187
- <VStack gap="8">
188
- <Card>Dette er et Card som bruker Box som base</Card>
189
- <LinkCard />
190
- <ChatBubble />
191
- <PricePill />
192
- </VStack>
193
- );
194
- };
195
-
196
- export const PaddingBreakpoints = {
197
- render: () => (
198
- <div>
199
- <Box
200
- padding={{ xs: "2", sm: "3", md: "4", lg: "5", xl: "6", "2xl": "8" }}
201
- background="surface-neutral"
202
- >
203
- <Box background="surface-alt-3-subtle">
204
- This is inside a box. Deserunt veniam eu fugiat ad est occaecat aliqua
205
- nisi aliquip. Aute amet occaecat ex aliqua irure elit labore pariatur.
206
- Proident pariatur proident pariatur magna consequat velit id commodo
207
- quis sunt tempor ullamco aliquip pariatur.
208
- </Box>
209
- </Box>
210
- </div>
211
- ),
212
- };
213
-
214
- export const PaddingBreakpointsInherit1 = {
215
- render: () => (
216
- <div>
217
- <Box
218
- padding={{ xs: "2" }}
219
- paddingInline={{ md: "24 0" }}
220
- background="surface-neutral"
221
- >
222
- <Box background="surface-alt-3-subtle">
223
- This is inside a box. Deserunt veniam eu fugiat ad est occaecat aliqua
224
- nisi aliquip. Aute amet occaecat ex aliqua irure elit labore pariatur.
225
- Proident pariatur proident pariatur magna consequat velit id commodo
226
- quis sunt tempor ullamco aliquip pariatur.
227
- </Box>
228
- </Box>
229
- </div>
230
- ),
231
- };
232
- export const PaddingBreakpointsInherit2 = () => (
233
- <div>
234
- <Box
235
- padding={{ xs: "2", sm: "3" }}
236
- paddingInline={{ sm: "4 0", md: "24 0" }}
237
- background="surface-neutral"
238
- >
239
- <Box background="surface-alt-3-subtle">
240
- This is inside a box. Deserunt veniam eu fugiat ad est occaecat aliqua
241
- nisi aliquip. Aute amet occaecat ex aliqua irure elit labore pariatur.
242
- Proident pariatur proident pariatur magna consequat velit id commodo
243
- quis sunt tempor ullamco aliquip pariatur.
244
- </Box>
245
- </Box>
246
- </div>
247
- );
248
-
249
- export const Padding = () => (
250
- <VStack align="center" gap="2">
251
- <Box padding="20" background="surface-alt-3-subtle">
252
- <BodyLong>Padding all around</BodyLong>
253
- </Box>
254
- <Box padding="1" paddingBlock="20 0" background="surface-alt-3-subtle">
255
- <BodyLong>Padding to the North</BodyLong>
256
- </Box>
257
- <Box padding="1" paddingInline="0 20" background="surface-alt-3-subtle">
258
- <BodyLong>Padding to the East</BodyLong>
259
- </Box>
260
- <Box padding="1" paddingBlock="0 20" background="surface-alt-3-subtle">
261
- <BodyLong>Padding to the South</BodyLong>
262
- </Box>
263
- <Box padding="1" paddingInline="20 0" background="surface-alt-3-subtle">
264
- <BodyLong>Padding to the West</BodyLong>
265
- </Box>
266
- </VStack>
267
- );
268
-
269
- export const BoxInBox = () => (
270
- <div>
271
- <Box
272
- padding={{ xs: "2", sm: "3" }}
273
- paddingInline={{ sm: "4 1" }}
274
- background="surface-alt-1-moderate"
275
- shadow="small"
276
- borderWidth="2"
277
- borderColor="border-alt-3"
278
- borderRadius="large"
279
- >
280
- <Box padding="8" paddingInline={{ sm: "12" }} background="bg-default">
281
- <Box background="surface-alt-3-subtle">
282
- CSS variables on a Box should not be inherited by children.
283
- </Box>
284
- </Box>
285
- </Box>
286
- </div>
287
- );
288
-
289
- export const WithHGrid = () => {
290
- return (
291
- <Box background="bg-subtle" padding="10">
292
- <HGrid
293
- gap="6"
294
- columns={{ xs: "repeat(auto-fit, minmax(10rem, 1fr))", md: 4 }}
295
- >
296
- <Box padding="4" background="bg-default">
297
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
298
- </Box>
299
- <Box padding="4" background="bg-default">
300
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
301
- </Box>
302
- <Box padding="4" background="bg-default">
303
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
304
- </Box>
305
- <Box padding="4" background="bg-default">
306
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
307
- </Box>
308
- </HGrid>
309
- </Box>
310
- );
311
- };
312
-
313
- export const BorderWidth = () => (
314
- <VStack gap="4">
315
- <Box
316
- background="bg-subtle"
317
- padding="10"
318
- borderWidth="2"
319
- borderColor="border-strong"
320
- >
321
- Box
322
- </Box>
323
- <Box
324
- background="bg-subtle"
325
- padding="10"
326
- borderWidth="1 2 3 4"
327
- borderColor="border-strong"
328
- >
329
- Box
330
- </Box>
331
- <Box
332
- background="bg-subtle"
333
- padding="10"
334
- borderWidth="5 2 4 1"
335
- borderColor="border-strong"
336
- borderRadius="large"
337
- >
338
- Box
339
- </Box>
340
- </VStack>
341
- );
342
-
343
- export const BorderRadius = () => (
344
- <VStack gap="4">
345
- <Box
346
- background="bg-subtle"
347
- padding="10"
348
- borderWidth="2"
349
- borderColor="border-strong"
350
- borderRadius="small medium large xlarge"
351
- >
352
- Box
353
- </Box>
354
- <Box
355
- background="bg-subtle"
356
- padding="10"
357
- borderWidth="2"
358
- borderColor="border-strong"
359
- borderRadius={{
360
- xs: "small medium large xlarge",
361
- md: "medium small large full",
362
- lg: "xlarge large",
363
- }}
364
- >
365
- Box
366
- </Box>
367
- </VStack>
368
- );
369
-
370
- export const PaddingDemo = () => (
371
- <VStack gap="4">
372
- <Box
373
- background="bg-subtle"
374
- padding="0"
375
- paddingInline={{ xs: "20", lg: "10" }}
376
- >
377
- Box
378
- </Box>
379
- </VStack>
380
- );
@@ -1,122 +0,0 @@
1
- import React from "react";
2
- import { HGrid } from ".";
3
- import { VStack } from "../stack";
4
-
5
- const columnsVariants = {
6
- Number: "columnNumber",
7
- String: "columnString",
8
- Object: "columnObject",
9
- };
10
-
11
- export default {
12
- title: "ds-react/Primitives/HGrid",
13
- component: HGrid,
14
- parameters: {
15
- layout: "fullscreen",
16
- },
17
- argTypes: {
18
- columnsType: {
19
- defaultValue: Object.keys(columnsVariants)[0],
20
- options: Object.keys(columnsVariants),
21
- control: { type: "radio" },
22
- },
23
- },
24
- };
25
-
26
- /* const getColumnsProp = () */
27
-
28
- export const Default = {
29
- render: (props) => (
30
- <HGrid
31
- gap={props?.gap ?? 4}
32
- columns={props[columnsVariants[props.columnsType]]}
33
- >
34
- <Placeholder text="1" />
35
- <Placeholder text="2" />
36
- <Placeholder text="3" />
37
- <Placeholder text="4" />
38
- </HGrid>
39
- ),
40
- args: {
41
- columnNumber: 4,
42
- columnObject: { xs: 1, md: 4 },
43
- columnString: "repeat(3, minmax(0, 1fr))",
44
- gap: "4",
45
- },
46
- };
47
-
48
- export const Gap = {
49
- render: () => (
50
- <HGrid gap="6">
51
- <Placeholder text="1" />
52
- <Placeholder text="2" />
53
- <Placeholder text="3" />
54
- <Placeholder text="4" />
55
- </HGrid>
56
- ),
57
- };
58
-
59
- export const DynamicGap = {
60
- render: () => (
61
- <HGrid gap={{ xs: "2", md: "8" }}>
62
- <Placeholder text="1" />
63
- <Placeholder text="2" />
64
- <Placeholder text="3" />
65
- <Placeholder text="4" />
66
- </HGrid>
67
- ),
68
- };
69
-
70
- export const Columns = {
71
- render: () => (
72
- <HGrid gap="4" columns={2}>
73
- <Placeholder text="1" />
74
- <Placeholder text="2" />
75
- <Placeholder text="3" />
76
- <Placeholder text="4" />
77
- </HGrid>
78
- ),
79
- };
80
-
81
- export const DynamicColumns = {
82
- render: () => (
83
- <HGrid gap="4" columns={{ sm: "1fr 5fr", md: "2fr 2fr" }}>
84
- <Placeholder text="1" />
85
- <Placeholder text="2" />
86
- </HGrid>
87
- ),
88
- };
89
-
90
- export const AlignItems = {
91
- render: () => (
92
- <VStack gap="8">
93
- <HGrid gap="4" columns={2} align="start">
94
- <Placeholder text="start" height="8rem" />
95
- <Placeholder text="auto" height="auto" />
96
- </HGrid>
97
- <HGrid gap="4" columns={2} align="center">
98
- <Placeholder text="center" height="8rem" />
99
- <Placeholder text="auto" height="auto" />
100
- </HGrid>
101
- <HGrid gap="4" columns={2} align="end">
102
- <Placeholder text="end" height="8rem" />
103
- <Placeholder text="auto" height="auto" />
104
- </HGrid>
105
- </VStack>
106
- ),
107
- };
108
-
109
- function Placeholder({ text, height }: { text: string; height?: string }) {
110
- return (
111
- <div
112
- style={{
113
- background: "var(--a-deepblue-900)",
114
- height: height ?? "5rem",
115
- width: "auto",
116
- color: "white",
117
- }}
118
- >
119
- {text}
120
- </div>
121
- );
122
- }