@nationaldesignstudio/react 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component-registry.md +1310 -127
- package/dist/components/atoms/button/button.d.ts +55 -47
- package/dist/components/atoms/button/button.figma.d.ts +1 -0
- package/dist/components/atoms/input/input.d.ts +24 -24
- package/dist/components/atoms/popover/popover.d.ts +195 -0
- package/dist/components/atoms/select/select.d.ts +24 -24
- package/dist/components/atoms/tooltip/tooltip.d.ts +161 -0
- package/dist/components/organisms/card/card.d.ts +1 -1
- package/dist/components/sections/hero/hero.d.ts +2 -2
- package/dist/components/sections/tout/tout.d.ts +3 -3
- package/dist/components/shared/floating-arrow.d.ts +34 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +11602 -8499
- package/dist/index.js.map +1 -1
- package/dist/lib/form-control.d.ts +25 -24
- package/dist/tokens.css +4797 -3940
- package/package.json +2 -1
- package/src/components/atoms/accordion/accordion.stories.tsx +1 -1
- package/src/components/atoms/accordion/accordion.tsx +2 -2
- package/src/components/atoms/button/button.figma.tsx +37 -0
- package/src/components/atoms/button/button.stories.tsx +236 -140
- package/src/components/atoms/button/button.test.tsx +289 -5
- package/src/components/atoms/button/button.tsx +37 -33
- package/src/components/atoms/button/button.visual.test.tsx +26 -76
- package/src/components/atoms/button/icon-button.stories.tsx +44 -101
- package/src/components/atoms/button/icon-button.test.tsx +26 -94
- package/src/components/atoms/button/icon-button.tsx +3 -3
- package/src/components/atoms/input/input-group.stories.tsx +4 -8
- package/src/components/atoms/input/input-group.test.tsx +14 -28
- package/src/components/atoms/input/input-group.tsx +57 -32
- package/src/components/atoms/input/input.stories.tsx +14 -18
- package/src/components/atoms/input/input.test.tsx +4 -20
- package/src/components/atoms/input/input.tsx +16 -9
- package/src/components/atoms/pager-control/pager-control.stories.tsx +6 -8
- package/src/components/atoms/pager-control/pager-control.tsx +12 -12
- package/src/components/atoms/popover/index.ts +30 -0
- package/src/components/atoms/popover/popover.stories.tsx +531 -0
- package/src/components/atoms/popover/popover.test.tsx +486 -0
- package/src/components/atoms/popover/popover.tsx +488 -0
- package/src/components/atoms/select/select.tsx +12 -8
- package/src/components/atoms/tooltip/index.ts +24 -0
- package/src/components/atoms/tooltip/tooltip.stories.tsx +348 -0
- package/src/components/atoms/tooltip/tooltip.test.tsx +363 -0
- package/src/components/atoms/tooltip/tooltip.tsx +347 -0
- package/src/components/dev-tools/dev-toolbar/dev-toolbar.stories.tsx +8 -13
- package/src/components/dev-tools/dev-toolbar/dev-toolbar.tsx +3 -3
- package/src/components/organisms/card/card.stories.tsx +19 -19
- package/src/components/organisms/card/card.tsx +1 -1
- package/src/components/organisms/card/card.visual.test.tsx +11 -11
- package/src/components/organisms/navbar/navbar.visual.test.tsx +2 -2
- package/src/components/organisms/us-gov-banner/us-gov-banner.tsx +2 -2
- package/src/components/sections/banner/banner.stories.tsx +1 -5
- package/src/components/sections/banner/banner.test.tsx +2 -2
- package/src/components/sections/banner/banner.tsx +6 -6
- package/src/components/sections/card-grid/card-grid.tsx +4 -4
- package/src/components/sections/hero/hero.stories.tsx +7 -7
- package/src/components/sections/hero/hero.tsx +10 -11
- package/src/components/sections/prose/prose.tsx +2 -2
- package/src/components/sections/river/river.test.tsx +3 -3
- package/src/components/sections/river/river.tsx +6 -12
- package/src/components/sections/tout/tout.stories.tsx +7 -31
- package/src/components/sections/tout/tout.tsx +9 -9
- package/src/components/sections/two-column-section/two-column-section.tsx +7 -9
- package/src/components/shared/floating-arrow.tsx +78 -0
- package/src/components/shared/index.ts +5 -0
- package/src/index.ts +57 -0
- package/src/lib/form-control.ts +8 -6
- package/src/stories/grid-system.stories.tsx +309 -0
- package/src/stories/{ThemeProvider.stories.tsx → theme-provider.stories.tsx} +7 -19
- package/src/stories/{TokenShowcase.stories.tsx → token-showcase.stories.tsx} +1 -1
- package/src/stories/{TokenShowcase.tsx → token-showcase.tsx} +34 -34
- package/src/styles.css +3 -3
- package/src/tests/token-resolution.test.tsx +6 -9
- package/src/theme/hooks.ts +1 -1
- package/src/theme/index.ts +1 -1
- package/src/theme/theme-provider.test.tsx +270 -0
- package/src/theme/{ThemeProvider.tsx → theme-provider.tsx} +18 -2
- package/src/stories/GridSystem.stories.tsx +0 -84
- /package/src/stories/{Introduction.mdx → introduction.mdx} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Component Registry
|
|
2
2
|
|
|
3
3
|
> Auto-generated component metadata for AI/agent consumption.
|
|
4
|
-
> Generated: 2026-01-
|
|
4
|
+
> Generated: 2026-01-16T16:52:21.427Z
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -54,7 +54,7 @@ className="w-48" // 48px width
|
|
|
54
54
|
className="h-64" // 64px height
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
**Available sizes:** 0, 2, 4, 6, 8, 10, 11, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256, 288, 320, 352, 384, 400
|
|
57
|
+
**Available sizes:** 0, 1, 2, 4, 6, 8, 10, 11, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256, 288, 320, 352, 384, 400
|
|
58
58
|
|
|
59
59
|
### Typography
|
|
60
60
|
|
|
@@ -142,86 +142,53 @@ className="font-semibold" // Font weight 600
|
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
```tsx
|
|
145
|
-
<
|
|
145
|
+
<div className="flex flex-col gap-24">
|
|
146
|
+
<div className="flex items-center gap-16">
|
|
147
|
+
<Button variant="primary">Primary</Button>
|
|
148
|
+
<Button variant="default">Default</Button>
|
|
149
|
+
<Button variant="secondary">Secondary</Button>
|
|
150
|
+
<Button variant="destructive">Destructive</Button>
|
|
151
|
+
<Button variant="outline">Outline</Button>
|
|
152
|
+
<Button variant="ghost">Ghost</Button>
|
|
153
|
+
<Button variant="link">Link</Button>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
146
156
|
```
|
|
147
157
|
|
|
148
158
|
```tsx
|
|
149
|
-
<Button variant="
|
|
159
|
+
<Button variant="primary">Primary</Button>
|
|
150
160
|
```
|
|
151
161
|
|
|
152
162
|
```tsx
|
|
153
|
-
<Button variant="
|
|
163
|
+
<Button variant="default">Default</Button>
|
|
154
164
|
```
|
|
155
165
|
|
|
156
166
|
```tsx
|
|
157
|
-
<Button variant="
|
|
167
|
+
<Button variant="secondary">Secondary</Button>
|
|
158
168
|
```
|
|
159
169
|
|
|
160
170
|
```tsx
|
|
161
|
-
<
|
|
162
|
-
<Button variant="solid" colorScheme="light">
|
|
163
|
-
Solid Light
|
|
164
|
-
</Button>
|
|
165
|
-
</DarkBackground>
|
|
171
|
+
<Button variant="destructive">Destructive</Button>
|
|
166
172
|
```
|
|
167
173
|
|
|
168
174
|
```tsx
|
|
169
|
-
<
|
|
170
|
-
<Button variant="outline" colorScheme="light">
|
|
171
|
-
Outline Light
|
|
172
|
-
</Button>
|
|
173
|
-
</DarkBackground>
|
|
175
|
+
<Button variant="outline">Outline</Button>
|
|
174
176
|
```
|
|
175
177
|
|
|
176
178
|
```tsx
|
|
177
|
-
<
|
|
178
|
-
<Button variant="ghost" colorScheme="light">
|
|
179
|
-
Ghost Light
|
|
180
|
-
</Button>
|
|
181
|
-
</DarkBackground>
|
|
179
|
+
<Button variant="ghost">Ghost</Button>
|
|
182
180
|
```
|
|
183
181
|
|
|
184
182
|
```tsx
|
|
185
|
-
<
|
|
186
|
-
<Button variant="subtle" colorScheme="light">
|
|
187
|
-
Subtle Light
|
|
188
|
-
</Button>
|
|
189
|
-
</DarkBackground>
|
|
183
|
+
<Button variant="link">Link</Button>
|
|
190
184
|
```
|
|
191
185
|
|
|
192
186
|
```tsx
|
|
193
|
-
<div className="flex
|
|
194
|
-
|
|
195
|
-
<
|
|
196
|
-
|
|
197
|
-
</h3>
|
|
198
|
-
<div className="flex gap-spacing-16">
|
|
199
|
-
<Button variant="solid">Solid</Button>
|
|
200
|
-
<Button variant="outline">Outline</Button>
|
|
201
|
-
<Button variant="ghost">Ghost</Button>
|
|
202
|
-
<Button variant="subtle">Subtle</Button>
|
|
203
|
-
</div>
|
|
187
|
+
<div className="flex items-center gap-16">
|
|
188
|
+
<Button size="sm">Small</Button>
|
|
189
|
+
<Button size="default">Default</Button>
|
|
190
|
+
<Button size="lg">Large</Button>
|
|
204
191
|
</div>
|
|
205
|
-
<DarkBackground>
|
|
206
|
-
<h3 className="mb-spacing-16 text-14 font-medium text-gray-400">
|
|
207
|
-
Light Color Scheme (for dark backgrounds)
|
|
208
|
-
</h3>
|
|
209
|
-
<div className="flex gap-spacing-16">
|
|
210
|
-
<Button variant="solid" colorScheme="light">
|
|
211
|
-
Solid
|
|
212
|
-
</Button>
|
|
213
|
-
<Button variant="outline" colorScheme="light">
|
|
214
|
-
Outline
|
|
215
|
-
</Button>
|
|
216
|
-
<Button variant="ghost" colorScheme="light">
|
|
217
|
-
Ghost
|
|
218
|
-
</Button>
|
|
219
|
-
<Button variant="subtle" colorScheme="light">
|
|
220
|
-
Subtle
|
|
221
|
-
</Button>
|
|
222
|
-
</div>
|
|
223
|
-
</DarkBackground>
|
|
224
|
-
</div>
|
|
225
192
|
```
|
|
226
193
|
|
|
227
194
|
```tsx
|
|
@@ -229,7 +196,7 @@ className="font-semibold" // Font weight 600
|
|
|
229
196
|
```
|
|
230
197
|
|
|
231
198
|
```tsx
|
|
232
|
-
<Button size="default">
|
|
199
|
+
<Button size="default">Default</Button>
|
|
233
200
|
```
|
|
234
201
|
|
|
235
202
|
```tsx
|
|
@@ -240,6 +207,115 @@ className="font-semibold" // Font weight 600
|
|
|
240
207
|
<Button disabled>Disabled</Button>
|
|
241
208
|
```
|
|
242
209
|
|
|
210
|
+
```tsx
|
|
211
|
+
<div className="flex items-center gap-16">
|
|
212
|
+
<Button variant="primary" disabled>
|
|
213
|
+
Primary
|
|
214
|
+
</Button>
|
|
215
|
+
<Button variant="default" disabled>
|
|
216
|
+
Default
|
|
217
|
+
</Button>
|
|
218
|
+
<Button variant="secondary" disabled>
|
|
219
|
+
Secondary
|
|
220
|
+
</Button>
|
|
221
|
+
<Button variant="destructive" disabled>
|
|
222
|
+
Destructive
|
|
223
|
+
</Button>
|
|
224
|
+
<Button variant="outline" disabled>
|
|
225
|
+
Outline
|
|
226
|
+
</Button>
|
|
227
|
+
<Button variant="ghost" disabled>
|
|
228
|
+
Ghost
|
|
229
|
+
</Button>
|
|
230
|
+
<Button variant="link" disabled>
|
|
231
|
+
Link
|
|
232
|
+
</Button>
|
|
233
|
+
</div>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
```tsx
|
|
237
|
+
<div className="flex flex-col gap-24">
|
|
238
|
+
<div>
|
|
239
|
+
<h3 className="mb-12 text-14 font-medium text-gray-600">Small</h3>
|
|
240
|
+
<div className="flex items-center gap-12">
|
|
241
|
+
<Button variant="primary" size="sm">
|
|
242
|
+
Primary
|
|
243
|
+
</Button>
|
|
244
|
+
<Button variant="default" size="sm">
|
|
245
|
+
Default
|
|
246
|
+
</Button>
|
|
247
|
+
<Button variant="secondary" size="sm">
|
|
248
|
+
Secondary
|
|
249
|
+
</Button>
|
|
250
|
+
<Button variant="destructive" size="sm">
|
|
251
|
+
Destructive
|
|
252
|
+
</Button>
|
|
253
|
+
<Button variant="outline" size="sm">
|
|
254
|
+
Outline
|
|
255
|
+
</Button>
|
|
256
|
+
<Button variant="ghost" size="sm">
|
|
257
|
+
Ghost
|
|
258
|
+
</Button>
|
|
259
|
+
<Button variant="link" size="sm">
|
|
260
|
+
Link
|
|
261
|
+
</Button>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
<div>
|
|
265
|
+
<h3 className="mb-12 text-14 font-medium text-gray-600">Default</h3>
|
|
266
|
+
<div className="flex items-center gap-12">
|
|
267
|
+
<Button variant="primary" size="default">
|
|
268
|
+
Primary
|
|
269
|
+
</Button>
|
|
270
|
+
<Button variant="default" size="default">
|
|
271
|
+
Default
|
|
272
|
+
</Button>
|
|
273
|
+
<Button variant="secondary" size="default">
|
|
274
|
+
Secondary
|
|
275
|
+
</Button>
|
|
276
|
+
<Button variant="destructive" size="default">
|
|
277
|
+
Destructive
|
|
278
|
+
</Button>
|
|
279
|
+
<Button variant="outline" size="default">
|
|
280
|
+
Outline
|
|
281
|
+
</Button>
|
|
282
|
+
<Button variant="ghost" size="default">
|
|
283
|
+
Ghost
|
|
284
|
+
</Button>
|
|
285
|
+
<Button variant="link" size="default">
|
|
286
|
+
Link
|
|
287
|
+
</Button>
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
<div>
|
|
291
|
+
<h3 className="mb-12 text-14 font-medium text-gray-600">Large</h3>
|
|
292
|
+
<div className="flex items-center gap-12">
|
|
293
|
+
<Button variant="primary" size="lg">
|
|
294
|
+
Primary
|
|
295
|
+
</Button>
|
|
296
|
+
<Button variant="default" size="lg">
|
|
297
|
+
Default
|
|
298
|
+
</Button>
|
|
299
|
+
<Button variant="secondary" size="lg">
|
|
300
|
+
Secondary
|
|
301
|
+
</Button>
|
|
302
|
+
<Button variant="destructive" size="lg">
|
|
303
|
+
Destructive
|
|
304
|
+
</Button>
|
|
305
|
+
<Button variant="outline" size="lg">
|
|
306
|
+
Outline
|
|
307
|
+
</Button>
|
|
308
|
+
<Button variant="ghost" size="lg">
|
|
309
|
+
Ghost
|
|
310
|
+
</Button>
|
|
311
|
+
<Button variant="link" size="lg">
|
|
312
|
+
Link
|
|
313
|
+
</Button>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
```
|
|
318
|
+
|
|
243
319
|
|
|
244
320
|
## Display
|
|
245
321
|
|
|
@@ -258,7 +334,7 @@ className="font-semibold" // Font weight 600
|
|
|
258
334
|
<CardContent>
|
|
259
335
|
<CardBody>
|
|
260
336
|
<CardEyebrow>Optional Eyebrow</CardEyebrow>
|
|
261
|
-
<div className="flex flex-col gap-
|
|
337
|
+
<div className="flex flex-col gap-6">
|
|
262
338
|
<CardTitle>Card Title</CardTitle>
|
|
263
339
|
<CardDescription>
|
|
264
340
|
Use cards when citizens need to scan items at a glance, either
|
|
@@ -267,10 +343,10 @@ className="font-semibold" // Font weight 600
|
|
|
267
343
|
</div>
|
|
268
344
|
</CardBody>
|
|
269
345
|
<CardActions>
|
|
270
|
-
<Button size="
|
|
346
|
+
<Button size="md" variant="primary">
|
|
271
347
|
Primary
|
|
272
348
|
</Button>
|
|
273
|
-
<Button size="
|
|
349
|
+
<Button size="md" variant="primary-outline">
|
|
274
350
|
Secondary
|
|
275
351
|
</Button>
|
|
276
352
|
</CardActions>
|
|
@@ -286,7 +362,7 @@ className="font-semibold" // Font weight 600
|
|
|
286
362
|
<CardContent>
|
|
287
363
|
<CardBody>
|
|
288
364
|
<CardEyebrow>Optional Eyebrow</CardEyebrow>
|
|
289
|
-
<div className="flex flex-col gap-
|
|
365
|
+
<div className="flex flex-col gap-6">
|
|
290
366
|
<CardTitle>Card Title</CardTitle>
|
|
291
367
|
<CardDescription>
|
|
292
368
|
Use cards when citizens need to scan items at a glance, either
|
|
@@ -295,10 +371,10 @@ className="font-semibold" // Font weight 600
|
|
|
295
371
|
</div>
|
|
296
372
|
</CardBody>
|
|
297
373
|
<CardActions>
|
|
298
|
-
<Button size="
|
|
374
|
+
<Button size="md" variant="primary">
|
|
299
375
|
Primary
|
|
300
376
|
</Button>
|
|
301
|
-
<Button size="
|
|
377
|
+
<Button size="md" variant="primary-outline">
|
|
302
378
|
Secondary
|
|
303
379
|
</Button>
|
|
304
380
|
</CardActions>
|
|
@@ -314,7 +390,7 @@ className="font-semibold" // Font weight 600
|
|
|
314
390
|
<CardContent>
|
|
315
391
|
<CardBody>
|
|
316
392
|
<CardEyebrow>Eyebrow</CardEyebrow>
|
|
317
|
-
<div className="flex flex-col gap-
|
|
393
|
+
<div className="flex flex-col gap-8">
|
|
318
394
|
<CardTitle>
|
|
319
395
|
Cards can support multi line headings easily.
|
|
320
396
|
</CardTitle>
|
|
@@ -325,10 +401,10 @@ className="font-semibold" // Font weight 600
|
|
|
325
401
|
</div>
|
|
326
402
|
</CardBody>
|
|
327
403
|
<CardActions>
|
|
328
|
-
<Button size="sm" variant="
|
|
404
|
+
<Button size="sm" variant="primary">
|
|
329
405
|
Primary
|
|
330
406
|
</Button>
|
|
331
|
-
<Button size="sm" variant="
|
|
407
|
+
<Button size="sm" variant="primary-outline">
|
|
332
408
|
Secondary
|
|
333
409
|
</Button>
|
|
334
410
|
</CardActions>
|
|
@@ -343,7 +419,7 @@ className="font-semibold" // Font weight 600
|
|
|
343
419
|
<CardContent>
|
|
344
420
|
<CardBody>
|
|
345
421
|
<CardEyebrow>Category</CardEyebrow>
|
|
346
|
-
<div className="flex flex-col gap-
|
|
422
|
+
<div className="flex flex-col gap-6">
|
|
347
423
|
<CardTitle>Card Without Image</CardTitle>
|
|
348
424
|
<CardDescription>
|
|
349
425
|
Cards can be used without images for text-focused content.
|
|
@@ -351,7 +427,7 @@ className="font-semibold" // Font weight 600
|
|
|
351
427
|
</div>
|
|
352
428
|
</CardBody>
|
|
353
429
|
<CardActions>
|
|
354
|
-
<Button size="
|
|
430
|
+
<Button size="md" variant="primary">
|
|
355
431
|
Learn More
|
|
356
432
|
</Button>
|
|
357
433
|
</CardActions>
|
|
@@ -366,7 +442,7 @@ className="font-semibold" // Font weight 600
|
|
|
366
442
|
<CardImage />
|
|
367
443
|
<CardContent>
|
|
368
444
|
<CardBody>
|
|
369
|
-
<div className="flex flex-col gap-
|
|
445
|
+
<div className="flex flex-col gap-6">
|
|
370
446
|
<CardTitle>Card Title</CardTitle>
|
|
371
447
|
<CardDescription>
|
|
372
448
|
The eyebrow is optional and can be omitted when not needed.
|
|
@@ -374,7 +450,7 @@ className="font-semibold" // Font weight 600
|
|
|
374
450
|
</div>
|
|
375
451
|
</CardBody>
|
|
376
452
|
<CardActions>
|
|
377
|
-
<Button size="
|
|
453
|
+
<Button size="md" variant="primary">
|
|
378
454
|
Primary
|
|
379
455
|
</Button>
|
|
380
456
|
</CardActions>
|
|
@@ -390,7 +466,7 @@ className="font-semibold" // Font weight 600
|
|
|
390
466
|
<CardContent>
|
|
391
467
|
<CardBody>
|
|
392
468
|
<CardEyebrow>Information</CardEyebrow>
|
|
393
|
-
<div className="flex flex-col gap-
|
|
469
|
+
<div className="flex flex-col gap-6">
|
|
394
470
|
<CardTitle>Informational Card</CardTitle>
|
|
395
471
|
<CardDescription>
|
|
396
472
|
Cards without actions can be used for purely informational
|
|
@@ -426,7 +502,7 @@ className="font-semibold" // Font weight 600
|
|
|
426
502
|
<CardContent>
|
|
427
503
|
<CardBody>
|
|
428
504
|
<CardEyebrow>Category {i}</CardEyebrow>
|
|
429
|
-
<div className="flex flex-col gap-
|
|
505
|
+
<div className="flex flex-col gap-6">
|
|
430
506
|
<CardTitle>Card Title {i}</CardTitle>
|
|
431
507
|
<CardDescription>
|
|
432
508
|
Brief description of the card content goes here.
|
|
@@ -434,7 +510,7 @@ className="font-semibold" // Font weight 600
|
|
|
434
510
|
</div>
|
|
435
511
|
</CardBody>
|
|
436
512
|
<CardActions>
|
|
437
|
-
<Button size="sm" variant="
|
|
513
|
+
<Button size="sm" variant="primary">
|
|
438
514
|
Action
|
|
439
515
|
</Button>
|
|
440
516
|
</CardActions>
|
|
@@ -451,7 +527,7 @@ className="font-semibold" // Font weight 600
|
|
|
451
527
|
<CardContent>
|
|
452
528
|
<CardBody>
|
|
453
529
|
<CardEyebrow>Eyebrow</CardEyebrow>
|
|
454
|
-
<div className="flex flex-col gap-
|
|
530
|
+
<div className="flex flex-col gap-6">
|
|
455
531
|
<CardTitle>Card Title</CardTitle>
|
|
456
532
|
<CardDescription>
|
|
457
533
|
Use cards when citizens need to scan items at a glance.
|
|
@@ -459,10 +535,10 @@ className="font-semibold" // Font weight 600
|
|
|
459
535
|
</div>
|
|
460
536
|
</CardBody>
|
|
461
537
|
<CardActions>
|
|
462
|
-
<Button size="
|
|
538
|
+
<Button size="md" variant="primary">
|
|
463
539
|
Primary
|
|
464
540
|
</Button>
|
|
465
|
-
<Button size="
|
|
541
|
+
<Button size="md" variant="primary-outline">
|
|
466
542
|
Secondary
|
|
467
543
|
</Button>
|
|
468
544
|
</CardActions>
|
|
@@ -577,7 +653,7 @@ className="font-semibold" // Font weight 600
|
|
|
577
653
|
```
|
|
578
654
|
|
|
579
655
|
```tsx
|
|
580
|
-
<div className="bg-bg-page p-
|
|
656
|
+
<div className="bg-bg-page p-32">
|
|
581
657
|
<Hero
|
|
582
658
|
variant="A1"
|
|
583
659
|
title="Rounded Corners"
|
|
@@ -607,7 +683,7 @@ className="font-semibold" // Font weight 600
|
|
|
607
683
|
</>
|
|
608
684
|
}
|
|
609
685
|
>
|
|
610
|
-
<p className="mt-
|
|
686
|
+
<p className="mt-16 max-w-[560px] text-20 text-text-inverted">
|
|
611
687
|
A subtitle or description can be added as children
|
|
612
688
|
</p>
|
|
613
689
|
</Hero>
|
|
@@ -624,7 +700,7 @@ className="font-semibold" // Font weight 600
|
|
|
624
700
|
<h1 className="text-64 font-medium text-text-inverted lg:text-128">
|
|
625
701
|
Custom Layout
|
|
626
702
|
</h1>
|
|
627
|
-
<p className="mt-
|
|
703
|
+
<p className="mt-16 text-20 text-text-inverted">
|
|
628
704
|
Using HeroHeader and HeroContent sub-components
|
|
629
705
|
</p>
|
|
630
706
|
</HeroContent>
|
|
@@ -1206,11 +1282,7 @@ className="font-semibold" // Font weight 600
|
|
|
1206
1282
|
<Banner
|
|
1207
1283
|
heading="Custom Styled Banner"
|
|
1208
1284
|
description="This banner has a custom background color applied via className."
|
|
1209
|
-
action={
|
|
1210
|
-
<Button variant="outline" colorScheme="light">
|
|
1211
|
-
Action
|
|
1212
|
-
</Button>
|
|
1213
|
-
}
|
|
1285
|
+
action={<Button variant="secondary-outline">Action</Button>}
|
|
1214
1286
|
className="bg-gray-1000 text-gray-50 [&_h2]:text-gray-50 [&_p]:text-gray-200"
|
|
1215
1287
|
/>
|
|
1216
1288
|
```
|
|
@@ -1813,6 +1885,159 @@ className="font-semibold" // Font weight 600
|
|
|
1813
1885
|
- `visible`: boolean
|
|
1814
1886
|
|
|
1815
1887
|
|
|
1888
|
+
### Input
|
|
1889
|
+
|
|
1890
|
+
**Import:** `import { Input } from "@nationaldesignstudio/react";`
|
|
1891
|
+
|
|
1892
|
+
**Category:** Other
|
|
1893
|
+
|
|
1894
|
+
**Props:**
|
|
1895
|
+
|
|
1896
|
+
- `error`: boolean
|
|
1897
|
+
Whether the input is in an error state
|
|
1898
|
+
|
|
1899
|
+
**Examples:**
|
|
1900
|
+
|
|
1901
|
+
```tsx
|
|
1902
|
+
<Input {...args} />
|
|
1903
|
+
```
|
|
1904
|
+
|
|
1905
|
+
```tsx
|
|
1906
|
+
<Input placeholder="Enter text..." />
|
|
1907
|
+
```
|
|
1908
|
+
|
|
1909
|
+
```tsx
|
|
1910
|
+
<Input defaultValue="Filled content" />
|
|
1911
|
+
```
|
|
1912
|
+
|
|
1913
|
+
```tsx
|
|
1914
|
+
<Input error placeholder="Invalid input" />
|
|
1915
|
+
```
|
|
1916
|
+
|
|
1917
|
+
```tsx
|
|
1918
|
+
<Input disabled placeholder="Disabled input" />
|
|
1919
|
+
```
|
|
1920
|
+
|
|
1921
|
+
```tsx
|
|
1922
|
+
<div className="flex flex-col gap-16 max-w-[320px]">
|
|
1923
|
+
<div>
|
|
1924
|
+
<p className="mb-8 text-12 text-text-muted">Default</p>
|
|
1925
|
+
<Input placeholder="Enter text..." />
|
|
1926
|
+
</div>
|
|
1927
|
+
<div>
|
|
1928
|
+
<p className="mb-8 text-12 text-text-muted">Hover (hover the input)</p>
|
|
1929
|
+
<Input placeholder="Hover me..." />
|
|
1930
|
+
</div>
|
|
1931
|
+
<div>
|
|
1932
|
+
<p className="mb-8 text-12 text-text-muted">Focus (click the input)</p>
|
|
1933
|
+
<Input placeholder="Click to focus..." />
|
|
1934
|
+
</div>
|
|
1935
|
+
<div>
|
|
1936
|
+
<p className="mb-8 text-12 text-text-muted">Filled</p>
|
|
1937
|
+
<Input defaultValue="Filled content" />
|
|
1938
|
+
</div>
|
|
1939
|
+
<div>
|
|
1940
|
+
<p className="mb-8 text-12 text-text-muted">Error</p>
|
|
1941
|
+
<Input error placeholder="Invalid input" />
|
|
1942
|
+
</div>
|
|
1943
|
+
<div>
|
|
1944
|
+
<p className="mb-8 text-12 text-text-muted">Disabled</p>
|
|
1945
|
+
<Input disabled placeholder="Disabled input" />
|
|
1946
|
+
</div>
|
|
1947
|
+
</div>
|
|
1948
|
+
```
|
|
1949
|
+
|
|
1950
|
+
```tsx
|
|
1951
|
+
<Input size="sm" placeholder="Small input" />
|
|
1952
|
+
```
|
|
1953
|
+
|
|
1954
|
+
```tsx
|
|
1955
|
+
<Input size="default" placeholder="Default input" />
|
|
1956
|
+
```
|
|
1957
|
+
|
|
1958
|
+
```tsx
|
|
1959
|
+
<Input size="lg" placeholder="Large input" />
|
|
1960
|
+
```
|
|
1961
|
+
|
|
1962
|
+
```tsx
|
|
1963
|
+
<div className="flex flex-col gap-16 max-w-[320px]">
|
|
1964
|
+
<div>
|
|
1965
|
+
<p className="mb-8 text-12 text-text-muted">Small (36px)</p>
|
|
1966
|
+
<Input size="sm" placeholder="Small input" />
|
|
1967
|
+
</div>
|
|
1968
|
+
<div>
|
|
1969
|
+
<p className="mb-8 text-12 text-text-muted">Default (48px)</p>
|
|
1970
|
+
<Input size="default" placeholder="Default input" />
|
|
1971
|
+
</div>
|
|
1972
|
+
<div>
|
|
1973
|
+
<p className="mb-8 text-12 text-text-muted">Large (56px)</p>
|
|
1974
|
+
<Input size="lg" placeholder="Large input" />
|
|
1975
|
+
</div>
|
|
1976
|
+
</div>
|
|
1977
|
+
```
|
|
1978
|
+
|
|
1979
|
+
```tsx
|
|
1980
|
+
<Input type="email" placeholder="Enter your email" />
|
|
1981
|
+
```
|
|
1982
|
+
|
|
1983
|
+
```tsx
|
|
1984
|
+
<Input type="password" placeholder="Enter your password" />
|
|
1985
|
+
```
|
|
1986
|
+
|
|
1987
|
+
```tsx
|
|
1988
|
+
<Input type="number" placeholder="Enter a number" />
|
|
1989
|
+
```
|
|
1990
|
+
|
|
1991
|
+
```tsx
|
|
1992
|
+
<Input type="search" placeholder="Search..." />
|
|
1993
|
+
```
|
|
1994
|
+
|
|
1995
|
+
```tsx
|
|
1996
|
+
<div className="flex flex-col gap-8 max-w-[320px]">
|
|
1997
|
+
<label
|
|
1998
|
+
htmlFor="email-input"
|
|
1999
|
+
className="text-14 font-medium text-text-primary"
|
|
2000
|
+
>
|
|
2001
|
+
Email Address
|
|
2002
|
+
</label>
|
|
2003
|
+
<Input id="email-input" type="email" placeholder="you@example.com" />
|
|
2004
|
+
</div>
|
|
2005
|
+
```
|
|
2006
|
+
|
|
2007
|
+
```tsx
|
|
2008
|
+
<div className="flex flex-col gap-8 max-w-[320px]">
|
|
2009
|
+
<label
|
|
2010
|
+
htmlFor="email-error"
|
|
2011
|
+
className="text-14 font-medium text-text-primary"
|
|
2012
|
+
>
|
|
2013
|
+
Email Address
|
|
2014
|
+
</label>
|
|
2015
|
+
<Input
|
|
2016
|
+
id="email-error"
|
|
2017
|
+
type="email"
|
|
2018
|
+
error
|
|
2019
|
+
placeholder="you@example.com"
|
|
2020
|
+
defaultValue="invalid-email"
|
|
2021
|
+
/>
|
|
2022
|
+
<p className="text-12 text-ui-error-color">
|
|
2023
|
+
Please enter a valid email address
|
|
2024
|
+
</p>
|
|
2025
|
+
</div>
|
|
2026
|
+
```
|
|
2027
|
+
|
|
2028
|
+
```tsx
|
|
2029
|
+
<div className="flex flex-col gap-8 max-w-[320px]">
|
|
2030
|
+
<label
|
|
2031
|
+
htmlFor="required-input"
|
|
2032
|
+
className="text-14 font-medium text-text-primary"
|
|
2033
|
+
>
|
|
2034
|
+
Full Name <span className="text-ui-error-color">*</span>
|
|
2035
|
+
</label>
|
|
2036
|
+
<Input id="required-input" required placeholder="John Doe" />
|
|
2037
|
+
</div>
|
|
2038
|
+
```
|
|
2039
|
+
|
|
2040
|
+
|
|
1816
2041
|
### NdstudioFooter
|
|
1817
2042
|
|
|
1818
2043
|
**Import:** `import { NdstudioFooter } from "@nationaldesignstudio/react";`
|
|
@@ -1907,28 +2132,26 @@ className="font-semibold" // Font weight 600
|
|
|
1907
2132
|
```
|
|
1908
2133
|
|
|
1909
2134
|
```tsx
|
|
1910
|
-
<div className="flex flex-col items-center gap-
|
|
2135
|
+
<div className="flex flex-col items-center gap-24">
|
|
1911
2136
|
<PagerControl
|
|
1912
2137
|
count={4}
|
|
1913
2138
|
activeIndex={activeIndex}
|
|
1914
2139
|
onChange={setActiveIndex}
|
|
1915
2140
|
autoPlay={false}
|
|
1916
2141
|
/>
|
|
1917
|
-
<div className="flex gap-
|
|
2142
|
+
<div className="flex gap-10">
|
|
1918
2143
|
<button
|
|
1919
2144
|
type="button"
|
|
1920
2145
|
onClick={() => setActiveIndex((prev) => Math.max(0, prev - 1))}
|
|
1921
|
-
className="rounded bg-gray-200 px-
|
|
2146
|
+
className="rounded bg-gray-200 px-12 py-6"
|
|
1922
2147
|
>
|
|
1923
2148
|
Previous
|
|
1924
2149
|
</button>
|
|
1925
|
-
<span className="px-
|
|
1926
|
-
Page {activeIndex + 1} of 4
|
|
1927
|
-
</span>
|
|
2150
|
+
<span className="px-12 py-6">Page {activeIndex + 1} of 4</span>
|
|
1928
2151
|
<button
|
|
1929
2152
|
type="button"
|
|
1930
2153
|
onClick={() => setActiveIndex((prev) => Math.min(3, prev + 1))}
|
|
1931
|
-
className="rounded bg-gray-200 px-
|
|
2154
|
+
className="rounded bg-gray-200 px-12 py-6"
|
|
1932
2155
|
>
|
|
1933
2156
|
Next
|
|
1934
2157
|
</button>
|
|
@@ -1937,7 +2160,7 @@ className="font-semibold" // Font weight 600
|
|
|
1937
2160
|
```
|
|
1938
2161
|
|
|
1939
2162
|
```tsx
|
|
1940
|
-
<div className="flex w-[400px] flex-col gap-
|
|
2163
|
+
<div className="flex w-[400px] flex-col gap-16">
|
|
1941
2164
|
<div className="relative h-[200px] overflow-hidden rounded-radius-12">
|
|
1942
2165
|
{slides.map((slide, index) => (
|
|
1943
2166
|
<div
|
|
@@ -1966,6 +2189,405 @@ className="font-semibold" // Font weight 600
|
|
|
1966
2189
|
```
|
|
1967
2190
|
|
|
1968
2191
|
|
|
2192
|
+
### Popover
|
|
2193
|
+
|
|
2194
|
+
**Import:** `import { Popover } from "@nationaldesignstudio/react";`
|
|
2195
|
+
|
|
2196
|
+
**Category:** Other
|
|
2197
|
+
|
|
2198
|
+
**Props:**
|
|
2199
|
+
|
|
2200
|
+
- `children`: React.ReactNode (required)
|
|
2201
|
+
The content to show in the popover */
|
|
2202
|
+
- `trigger`: React.ReactNode (required)
|
|
2203
|
+
The element that triggers the popover */
|
|
2204
|
+
- `title`: React.ReactNode
|
|
2205
|
+
Title for the popover (optional) */
|
|
2206
|
+
- `side`: "top" | "bottom" | "left" | "right"
|
|
2207
|
+
Side of the trigger to show the popover */
|
|
2208
|
+
Values: `top`, `bottom`, `left`, `right`
|
|
2209
|
+
- `sideOffset`: number
|
|
2210
|
+
Offset from the trigger */
|
|
2211
|
+
- `align`: "start" | "center" | "end"
|
|
2212
|
+
Alignment along the side */
|
|
2213
|
+
Values: `start`, `center`, `end`
|
|
2214
|
+
- `showArrow`: boolean
|
|
2215
|
+
Whether to show an arrow */
|
|
2216
|
+
- `showClose`: boolean
|
|
2217
|
+
Whether to show a close button */
|
|
2218
|
+
- `open`: boolean
|
|
2219
|
+
Controlled open state */
|
|
2220
|
+
- `defaultOpen`: boolean
|
|
2221
|
+
Default open state */
|
|
2222
|
+
- `onOpenChange`: (open: boolean) => void
|
|
2223
|
+
Callback when open state changes */
|
|
2224
|
+
- `className`: string
|
|
2225
|
+
Additional className for the popup */
|
|
2226
|
+
|
|
2227
|
+
**Examples:**
|
|
2228
|
+
|
|
2229
|
+
```tsx
|
|
2230
|
+
<Popover
|
|
2231
|
+
{...args}
|
|
2232
|
+
trigger={<Button>Click me</Button>}
|
|
2233
|
+
title="Popover Title"
|
|
2234
|
+
>
|
|
2235
|
+
This is the popover content. You can put any content here including text,
|
|
2236
|
+
forms, or other components.
|
|
2237
|
+
</Popover>
|
|
2238
|
+
```
|
|
2239
|
+
|
|
2240
|
+
```tsx
|
|
2241
|
+
<Popover trigger={<Button>Open Popover</Button>} title="Information">
|
|
2242
|
+
This popover provides additional context about the action.
|
|
2243
|
+
</Popover>
|
|
2244
|
+
```
|
|
2245
|
+
|
|
2246
|
+
```tsx
|
|
2247
|
+
<Popover trigger={<Button>Open Popover</Button>}>
|
|
2248
|
+
<p className="typography-body-sm-md">
|
|
2249
|
+
Simple popover content without a title.
|
|
2250
|
+
</p>
|
|
2251
|
+
</Popover>
|
|
2252
|
+
```
|
|
2253
|
+
|
|
2254
|
+
```tsx
|
|
2255
|
+
<Popover
|
|
2256
|
+
trigger={<Button>Open Popover</Button>}
|
|
2257
|
+
title="No Arrow"
|
|
2258
|
+
showArrow={false}
|
|
2259
|
+
>
|
|
2260
|
+
This popover has no arrow pointing to the trigger.
|
|
2261
|
+
</Popover>
|
|
2262
|
+
```
|
|
2263
|
+
|
|
2264
|
+
```tsx
|
|
2265
|
+
<Popover
|
|
2266
|
+
trigger={<Button>Open Popover</Button>}
|
|
2267
|
+
title="Closeable"
|
|
2268
|
+
showClose={true}
|
|
2269
|
+
>
|
|
2270
|
+
Click the X button or click outside to close.
|
|
2271
|
+
</Popover>
|
|
2272
|
+
```
|
|
2273
|
+
|
|
2274
|
+
```tsx
|
|
2275
|
+
<div className="flex flex-col items-center gap-48">
|
|
2276
|
+
<Popover
|
|
2277
|
+
trigger={<Button variant="outline">Top</Button>}
|
|
2278
|
+
side="top"
|
|
2279
|
+
title="Top Position"
|
|
2280
|
+
>
|
|
2281
|
+
Popover above the trigger
|
|
2282
|
+
</Popover>
|
|
2283
|
+
<div className="flex items-center gap-48">
|
|
2284
|
+
<Popover
|
|
2285
|
+
trigger={<Button variant="outline">Left</Button>}
|
|
2286
|
+
side="left"
|
|
2287
|
+
title="Left Position"
|
|
2288
|
+
>
|
|
2289
|
+
Popover to the left
|
|
2290
|
+
</Popover>
|
|
2291
|
+
<Popover
|
|
2292
|
+
trigger={<Button variant="outline">Right</Button>}
|
|
2293
|
+
side="right"
|
|
2294
|
+
title="Right Position"
|
|
2295
|
+
>
|
|
2296
|
+
Popover to the right
|
|
2297
|
+
</Popover>
|
|
2298
|
+
</div>
|
|
2299
|
+
<Popover
|
|
2300
|
+
trigger={<Button variant="outline">Bottom</Button>}
|
|
2301
|
+
side="bottom"
|
|
2302
|
+
title="Bottom Position"
|
|
2303
|
+
>
|
|
2304
|
+
Popover below the trigger
|
|
2305
|
+
</Popover>
|
|
2306
|
+
</div>
|
|
2307
|
+
```
|
|
2308
|
+
|
|
2309
|
+
```tsx
|
|
2310
|
+
<Popover
|
|
2311
|
+
trigger={<Button>Top Position</Button>}
|
|
2312
|
+
side="top"
|
|
2313
|
+
title="Top Popover"
|
|
2314
|
+
>
|
|
2315
|
+
This popover appears above the trigger.
|
|
2316
|
+
</Popover>
|
|
2317
|
+
```
|
|
2318
|
+
|
|
2319
|
+
```tsx
|
|
2320
|
+
<Popover
|
|
2321
|
+
trigger={<Button>Bottom Position</Button>}
|
|
2322
|
+
side="bottom"
|
|
2323
|
+
title="Bottom Popover"
|
|
2324
|
+
>
|
|
2325
|
+
This popover appears below the trigger.
|
|
2326
|
+
</Popover>
|
|
2327
|
+
```
|
|
2328
|
+
|
|
2329
|
+
```tsx
|
|
2330
|
+
<Popover
|
|
2331
|
+
trigger={<Button>Left Position</Button>}
|
|
2332
|
+
side="left"
|
|
2333
|
+
title="Left Popover"
|
|
2334
|
+
>
|
|
2335
|
+
This popover appears to the left.
|
|
2336
|
+
</Popover>
|
|
2337
|
+
```
|
|
2338
|
+
|
|
2339
|
+
```tsx
|
|
2340
|
+
<Popover
|
|
2341
|
+
trigger={<Button>Right Position</Button>}
|
|
2342
|
+
side="right"
|
|
2343
|
+
title="Right Popover"
|
|
2344
|
+
>
|
|
2345
|
+
This popover appears to the right.
|
|
2346
|
+
</Popover>
|
|
2347
|
+
```
|
|
2348
|
+
|
|
2349
|
+
```tsx
|
|
2350
|
+
<div className="flex flex-col gap-24">
|
|
2351
|
+
<div className="flex items-center gap-24">
|
|
2352
|
+
<Popover
|
|
2353
|
+
trigger={
|
|
2354
|
+
<Button variant="secondary" className="w-144">
|
|
2355
|
+
Start
|
|
2356
|
+
</Button>
|
|
2357
|
+
}
|
|
2358
|
+
side="bottom"
|
|
2359
|
+
align="start"
|
|
2360
|
+
title="Start Aligned"
|
|
2361
|
+
>
|
|
2362
|
+
Popover aligned to start
|
|
2363
|
+
</Popover>
|
|
2364
|
+
<Popover
|
|
2365
|
+
trigger={
|
|
2366
|
+
<Button variant="secondary" className="w-144">
|
|
2367
|
+
Center
|
|
2368
|
+
</Button>
|
|
2369
|
+
}
|
|
2370
|
+
side="bottom"
|
|
2371
|
+
align="center"
|
|
2372
|
+
title="Center Aligned"
|
|
2373
|
+
>
|
|
2374
|
+
Popover aligned to center
|
|
2375
|
+
</Popover>
|
|
2376
|
+
<Popover
|
|
2377
|
+
trigger={
|
|
2378
|
+
<Button variant="secondary" className="w-144">
|
|
2379
|
+
End
|
|
2380
|
+
</Button>
|
|
2381
|
+
}
|
|
2382
|
+
side="bottom"
|
|
2383
|
+
align="end"
|
|
2384
|
+
title="End Aligned"
|
|
2385
|
+
>
|
|
2386
|
+
Popover aligned to end
|
|
2387
|
+
</Popover>
|
|
2388
|
+
</div>
|
|
2389
|
+
</div>
|
|
2390
|
+
```
|
|
2391
|
+
|
|
2392
|
+
```tsx
|
|
2393
|
+
<Popover trigger={<Button>Edit Settings</Button>} showClose={true}>
|
|
2394
|
+
<div className="flex flex-col gap-spatial-component-overlay-gap">
|
|
2395
|
+
<h3 className="typography-body-md-md font-semibold">Quick Settings</h3>
|
|
2396
|
+
<div className="flex flex-col gap-8">
|
|
2397
|
+
<label className="typography-body-sm-md">
|
|
2398
|
+
Name
|
|
2399
|
+
<input
|
|
2400
|
+
type="text"
|
|
2401
|
+
placeholder="Enter name"
|
|
2402
|
+
className="mt-4 w-full rounded-surface-ui-small border border-overlay-border bg-overlay-background px-12 py-8 typography-body-sm-md focus:outline-none focus:ring-2 focus:ring-border-focus"
|
|
2403
|
+
/>
|
|
2404
|
+
</label>
|
|
2405
|
+
<label className="typography-body-sm-md">
|
|
2406
|
+
Email
|
|
2407
|
+
<input
|
|
2408
|
+
type="email"
|
|
2409
|
+
placeholder="Enter email"
|
|
2410
|
+
className="mt-4 w-full rounded-surface-ui-small border border-overlay-border bg-overlay-background px-12 py-8 typography-body-sm-md focus:outline-none focus:ring-2 focus:ring-border-focus"
|
|
2411
|
+
/>
|
|
2412
|
+
</label>
|
|
2413
|
+
</div>
|
|
2414
|
+
<div className="flex justify-end gap-8">
|
|
2415
|
+
<Button variant="secondary" size="sm">
|
|
2416
|
+
Cancel
|
|
2417
|
+
</Button>
|
|
2418
|
+
<Button size="sm">Save</Button>
|
|
2419
|
+
</div>
|
|
2420
|
+
</div>
|
|
2421
|
+
</Popover>
|
|
2422
|
+
```
|
|
2423
|
+
|
|
2424
|
+
```tsx
|
|
2425
|
+
<Popover trigger={<Button variant="outline">Options</Button>}>
|
|
2426
|
+
<div className="flex flex-col gap-4">
|
|
2427
|
+
<button
|
|
2428
|
+
type="button"
|
|
2429
|
+
className="w-full rounded-surface-ui-small px-12 py-8 text-left typography-body-sm-md hover:bg-bg-section"
|
|
2430
|
+
>
|
|
2431
|
+
Edit profile
|
|
2432
|
+
</button>
|
|
2433
|
+
<button
|
|
2434
|
+
type="button"
|
|
2435
|
+
className="w-full rounded-surface-ui-small px-12 py-8 text-left typography-body-sm-md hover:bg-bg-section"
|
|
2436
|
+
>
|
|
2437
|
+
Settings
|
|
2438
|
+
</button>
|
|
2439
|
+
<button
|
|
2440
|
+
type="button"
|
|
2441
|
+
className="w-full rounded-surface-ui-small px-12 py-8 text-left typography-body-sm-md hover:bg-bg-section"
|
|
2442
|
+
>
|
|
2443
|
+
Help & support
|
|
2444
|
+
</button>
|
|
2445
|
+
<hr className="border-overlay-border" />
|
|
2446
|
+
<button
|
|
2447
|
+
type="button"
|
|
2448
|
+
className="w-full rounded-surface-ui-small px-12 py-8 text-left typography-body-sm-md text-button-destructive-bg hover:bg-bg-section"
|
|
2449
|
+
>
|
|
2450
|
+
Sign out
|
|
2451
|
+
</button>
|
|
2452
|
+
</div>
|
|
2453
|
+
</Popover>
|
|
2454
|
+
```
|
|
2455
|
+
|
|
2456
|
+
```tsx
|
|
2457
|
+
<Popover trigger={<Button>View Profile</Button>} showClose={true}>
|
|
2458
|
+
<div className="flex gap-16">
|
|
2459
|
+
<div className="size-48 shrink-0 rounded-full bg-bg-section-secondary" />
|
|
2460
|
+
<div className="flex flex-col gap-4">
|
|
2461
|
+
<h3 className="typography-body-md-md font-semibold">Jane Smith</h3>
|
|
2462
|
+
<p className="typography-body-sm-md text-overlay-text-muted">
|
|
2463
|
+
Product Designer
|
|
2464
|
+
</p>
|
|
2465
|
+
<p className="typography-body-sm-md text-overlay-text-muted">
|
|
2466
|
+
San Francisco, CA
|
|
2467
|
+
</p>
|
|
2468
|
+
</div>
|
|
2469
|
+
</div>
|
|
2470
|
+
</Popover>
|
|
2471
|
+
```
|
|
2472
|
+
|
|
2473
|
+
```tsx
|
|
2474
|
+
<PopoverParts>
|
|
2475
|
+
<PopoverTrigger>
|
|
2476
|
+
<Button variant="primary">Custom Popover</Button>
|
|
2477
|
+
</PopoverTrigger>
|
|
2478
|
+
<PopoverPortal>
|
|
2479
|
+
<PopoverPositioner side="bottom" sideOffset={12}>
|
|
2480
|
+
<PopoverPopup>
|
|
2481
|
+
<PopoverArrow />
|
|
2482
|
+
<PopoverClose>
|
|
2483
|
+
<svg
|
|
2484
|
+
width="12"
|
|
2485
|
+
height="12"
|
|
2486
|
+
viewBox="0 0 12 12"
|
|
2487
|
+
fill="none"
|
|
2488
|
+
aria-hidden="true"
|
|
2489
|
+
>
|
|
2490
|
+
<path
|
|
2491
|
+
d="M1.5 1.5L10.5 10.5M1.5 10.5L10.5 1.5"
|
|
2492
|
+
stroke="currentColor"
|
|
2493
|
+
strokeWidth="1.5"
|
|
2494
|
+
strokeLinecap="round"
|
|
2495
|
+
/>
|
|
2496
|
+
</svg>
|
|
2497
|
+
<span className="sr-only">Close</span>
|
|
2498
|
+
</PopoverClose>
|
|
2499
|
+
<PopoverTitle>Custom Title</PopoverTitle>
|
|
2500
|
+
<PopoverDescription>
|
|
2501
|
+
Built with compound components for maximum flexibility.
|
|
2502
|
+
</PopoverDescription>
|
|
2503
|
+
</PopoverPopup>
|
|
2504
|
+
</PopoverPositioner>
|
|
2505
|
+
</PopoverPortal>
|
|
2506
|
+
</PopoverParts>
|
|
2507
|
+
```
|
|
2508
|
+
|
|
2509
|
+
```tsx
|
|
2510
|
+
<PopoverParts>
|
|
2511
|
+
<PopoverTrigger>
|
|
2512
|
+
<Button>With Backdrop</Button>
|
|
2513
|
+
</PopoverTrigger>
|
|
2514
|
+
<PopoverPortal>
|
|
2515
|
+
<PopoverBackdrop className="bg-alpha-black-20" />
|
|
2516
|
+
<PopoverPositioner side="bottom">
|
|
2517
|
+
<PopoverPopup>
|
|
2518
|
+
<PopoverArrow />
|
|
2519
|
+
<PopoverTitle>Modal-like Popover</PopoverTitle>
|
|
2520
|
+
<PopoverDescription>
|
|
2521
|
+
This popover has a backdrop that dims the background.
|
|
2522
|
+
</PopoverDescription>
|
|
2523
|
+
</PopoverPopup>
|
|
2524
|
+
</PopoverPositioner>
|
|
2525
|
+
</PopoverPortal>
|
|
2526
|
+
</PopoverParts>
|
|
2527
|
+
```
|
|
2528
|
+
|
|
2529
|
+
```tsx
|
|
2530
|
+
<div className="flex flex-col items-center gap-16">
|
|
2531
|
+
<Popover
|
|
2532
|
+
trigger={<Button>Controlled Popover</Button>}
|
|
2533
|
+
title="Controlled"
|
|
2534
|
+
open={open}
|
|
2535
|
+
onOpenChange={setOpen}
|
|
2536
|
+
>
|
|
2537
|
+
This popover is controlled externally.
|
|
2538
|
+
</Popover>
|
|
2539
|
+
<Button variant="outline" onClick={() => setOpen(!open)}>
|
|
2540
|
+
{open ? "Close popover" : "Open popover"}
|
|
2541
|
+
</Button>
|
|
2542
|
+
</div>
|
|
2543
|
+
```
|
|
2544
|
+
|
|
2545
|
+
```tsx
|
|
2546
|
+
<div className="flex items-center gap-24">
|
|
2547
|
+
<Popover trigger={<Button>Button</Button>} title="Button Trigger">
|
|
2548
|
+
Triggered by a button
|
|
2549
|
+
</Popover>
|
|
2550
|
+
<Popover
|
|
2551
|
+
trigger={
|
|
2552
|
+
<button
|
|
2553
|
+
type="button"
|
|
2554
|
+
className="flex size-36 items-center justify-center rounded-surface-ui-small bg-bg-section text-text-primary hover:bg-bg-section-secondary"
|
|
2555
|
+
>
|
|
2556
|
+
<svg
|
|
2557
|
+
className="size-20"
|
|
2558
|
+
fill="none"
|
|
2559
|
+
viewBox="0 0 24 24"
|
|
2560
|
+
stroke="currentColor"
|
|
2561
|
+
aria-hidden="true"
|
|
2562
|
+
>
|
|
2563
|
+
<path
|
|
2564
|
+
strokeLinecap="round"
|
|
2565
|
+
strokeLinejoin="round"
|
|
2566
|
+
strokeWidth={2}
|
|
2567
|
+
d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"
|
|
2568
|
+
/>
|
|
2569
|
+
</svg>
|
|
2570
|
+
<span className="sr-only">More options</span>
|
|
2571
|
+
</button>
|
|
2572
|
+
}
|
|
2573
|
+
title="Icon Trigger"
|
|
2574
|
+
>
|
|
2575
|
+
Triggered by an icon button
|
|
2576
|
+
</Popover>
|
|
2577
|
+
<Popover
|
|
2578
|
+
trigger={
|
|
2579
|
+
<span className="cursor-pointer border-b border-dashed border-fg-muted text-text-secondary">
|
|
2580
|
+
Click this text
|
|
2581
|
+
</span>
|
|
2582
|
+
}
|
|
2583
|
+
title="Text Trigger"
|
|
2584
|
+
>
|
|
2585
|
+
Triggered by text
|
|
2586
|
+
</Popover>
|
|
2587
|
+
</div>
|
|
2588
|
+
```
|
|
2589
|
+
|
|
2590
|
+
|
|
1969
2591
|
### QuoteBlock
|
|
1970
2592
|
|
|
1971
2593
|
**Import:** `import { QuoteBlock } from "@nationaldesignstudio/react";`
|
|
@@ -2031,7 +2653,7 @@ className="font-semibold" // Font weight 600
|
|
|
2031
2653
|
headline="Text Left, Media Right"
|
|
2032
2654
|
body="Variant A places the text content on the left (9 columns) and media on the right (15 columns) on desktop viewports. On mobile and tablet, they stack vertically."
|
|
2033
2655
|
primaryAction={<Button>Primary Action</Button>}
|
|
2034
|
-
secondaryAction={<Button variant="
|
|
2656
|
+
secondaryAction={<Button variant="outline">Secondary</Button>}
|
|
2035
2657
|
media={<PlaceholderImage />}
|
|
2036
2658
|
/>
|
|
2037
2659
|
```
|
|
@@ -2042,7 +2664,7 @@ className="font-semibold" // Font weight 600
|
|
|
2042
2664
|
headline="Media Left, Text Right"
|
|
2043
2665
|
body="Variant B places the media on the left (15 columns) and text content on the right (9 columns) on desktop viewports. On mobile and tablet, they stack vertically with text first."
|
|
2044
2666
|
primaryAction={<Button>Primary Action</Button>}
|
|
2045
|
-
secondaryAction={<Button variant="
|
|
2667
|
+
secondaryAction={<Button variant="outline">Secondary</Button>}
|
|
2046
2668
|
media={<PlaceholderImage />}
|
|
2047
2669
|
/>
|
|
2048
2670
|
```
|
|
@@ -2053,7 +2675,7 @@ className="font-semibold" // Font weight 600
|
|
|
2053
2675
|
headline="Desktop View"
|
|
2054
2676
|
body="On desktop (lg, 1440px), the content spans 9 columns and the media spans 15 columns in a horizontal layout."
|
|
2055
2677
|
primaryAction={<Button>Primary</Button>}
|
|
2056
|
-
secondaryAction={<Button variant="
|
|
2678
|
+
secondaryAction={<Button variant="outline">Secondary</Button>}
|
|
2057
2679
|
media={<PlaceholderImage />}
|
|
2058
2680
|
/>
|
|
2059
2681
|
```
|
|
@@ -2064,7 +2686,7 @@ className="font-semibold" // Font weight 600
|
|
|
2064
2686
|
headline="Tablet View"
|
|
2065
2687
|
body="On tablet (md, 768px), the content and media stack vertically with the text above the media."
|
|
2066
2688
|
primaryAction={<Button>Primary</Button>}
|
|
2067
|
-
secondaryAction={<Button variant="
|
|
2689
|
+
secondaryAction={<Button variant="outline">Secondary</Button>}
|
|
2068
2690
|
media={<PlaceholderImage />}
|
|
2069
2691
|
/>
|
|
2070
2692
|
```
|
|
@@ -2076,7 +2698,7 @@ className="font-semibold" // Font weight 600
|
|
|
2076
2698
|
body="On mobile (sm, 320px), content is stacked with smaller button sizing."
|
|
2077
2699
|
primaryAction={<Button size="sm">Primary</Button>}
|
|
2078
2700
|
secondaryAction={
|
|
2079
|
-
<Button size="sm" variant="
|
|
2701
|
+
<Button size="sm" variant="outline">
|
|
2080
2702
|
Secondary
|
|
2081
2703
|
</Button>
|
|
2082
2704
|
}
|
|
@@ -2090,7 +2712,7 @@ className="font-semibold" // Font weight 600
|
|
|
2090
2712
|
headline="Desktop View - Reversed"
|
|
2091
2713
|
body="Variant B reverses the layout, placing media on the left and content on the right."
|
|
2092
2714
|
primaryAction={<Button>Primary</Button>}
|
|
2093
|
-
secondaryAction={<Button variant="
|
|
2715
|
+
secondaryAction={<Button variant="outline">Secondary</Button>}
|
|
2094
2716
|
media={<PlaceholderImage />}
|
|
2095
2717
|
/>
|
|
2096
2718
|
```
|
|
@@ -2138,7 +2760,7 @@ className="font-semibold" // Font weight 600
|
|
|
2138
2760
|
headline="Real World Example"
|
|
2139
2761
|
body="Rivers work great with actual images, videos, or any media content. The media column is designed to accommodate various aspect ratios."
|
|
2140
2762
|
primaryAction={<Button>Get Started</Button>}
|
|
2141
|
-
secondaryAction={<Button variant="
|
|
2763
|
+
secondaryAction={<Button variant="outline">Learn More</Button>}
|
|
2142
2764
|
media={
|
|
2143
2765
|
<img
|
|
2144
2766
|
src="https://images.unsplash.com/photo-1551434678-e076c223a692?w=800&h=600&fit=crop"
|
|
@@ -2150,6 +2772,587 @@ className="font-semibold" // Font weight 600
|
|
|
2150
2772
|
```
|
|
2151
2773
|
|
|
2152
2774
|
|
|
2775
|
+
### Select
|
|
2776
|
+
|
|
2777
|
+
**Import:** `import { Select } from "@nationaldesignstudio/react";`
|
|
2778
|
+
|
|
2779
|
+
**Category:** Other
|
|
2780
|
+
|
|
2781
|
+
**Props:**
|
|
2782
|
+
|
|
2783
|
+
- `children`: React.ReactNode (required)
|
|
2784
|
+
|
|
2785
|
+
**Examples:**
|
|
2786
|
+
|
|
2787
|
+
```tsx
|
|
2788
|
+
<Select {...args}>
|
|
2789
|
+
<SelectTrigger placeholder="Select a state..." />
|
|
2790
|
+
<SelectPopup>
|
|
2791
|
+
{states.map((state) => (
|
|
2792
|
+
<SelectOption key={state.value} value={state.value}>
|
|
2793
|
+
{state.label}
|
|
2794
|
+
</SelectOption>
|
|
2795
|
+
))}
|
|
2796
|
+
</SelectPopup>
|
|
2797
|
+
</Select>
|
|
2798
|
+
```
|
|
2799
|
+
|
|
2800
|
+
```tsx
|
|
2801
|
+
<div className="w-[320px]">
|
|
2802
|
+
<Select>
|
|
2803
|
+
<SelectTrigger placeholder="Select option..." />
|
|
2804
|
+
<SelectPopup>
|
|
2805
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2806
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2807
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2808
|
+
</SelectPopup>
|
|
2809
|
+
</Select>
|
|
2810
|
+
</div>
|
|
2811
|
+
```
|
|
2812
|
+
|
|
2813
|
+
```tsx
|
|
2814
|
+
<div className="w-[320px]">
|
|
2815
|
+
<Select defaultValue="option2">
|
|
2816
|
+
<SelectTrigger placeholder="Select option..." />
|
|
2817
|
+
<SelectPopup>
|
|
2818
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2819
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2820
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2821
|
+
</SelectPopup>
|
|
2822
|
+
</Select>
|
|
2823
|
+
</div>
|
|
2824
|
+
```
|
|
2825
|
+
|
|
2826
|
+
```tsx
|
|
2827
|
+
<div className="w-[320px]">
|
|
2828
|
+
<Select disabled>
|
|
2829
|
+
<SelectTrigger placeholder="Select option..." />
|
|
2830
|
+
<SelectPopup>
|
|
2831
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2832
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2833
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2834
|
+
</SelectPopup>
|
|
2835
|
+
</Select>
|
|
2836
|
+
</div>
|
|
2837
|
+
```
|
|
2838
|
+
|
|
2839
|
+
```tsx
|
|
2840
|
+
<div className="w-[320px]">
|
|
2841
|
+
<Select>
|
|
2842
|
+
<SelectTrigger placeholder="Select option..." error />
|
|
2843
|
+
<SelectPopup>
|
|
2844
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2845
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2846
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2847
|
+
</SelectPopup>
|
|
2848
|
+
</Select>
|
|
2849
|
+
</div>
|
|
2850
|
+
```
|
|
2851
|
+
|
|
2852
|
+
```tsx
|
|
2853
|
+
<div className="flex flex-col gap-16 max-w-[320px]">
|
|
2854
|
+
<div>
|
|
2855
|
+
<p className="mb-8 text-12 text-text-muted">Default</p>
|
|
2856
|
+
<Select>
|
|
2857
|
+
<SelectTrigger placeholder="Select option..." />
|
|
2858
|
+
<SelectPopup>
|
|
2859
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2860
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2861
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2862
|
+
</SelectPopup>
|
|
2863
|
+
</Select>
|
|
2864
|
+
</div>
|
|
2865
|
+
<div>
|
|
2866
|
+
<p className="mb-8 text-12 text-text-muted">With Value</p>
|
|
2867
|
+
<Select defaultValue="option2">
|
|
2868
|
+
<SelectTrigger placeholder="Select option..." />
|
|
2869
|
+
<SelectPopup>
|
|
2870
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2871
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2872
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2873
|
+
</SelectPopup>
|
|
2874
|
+
</Select>
|
|
2875
|
+
</div>
|
|
2876
|
+
<div>
|
|
2877
|
+
<p className="mb-8 text-12 text-text-muted">Error</p>
|
|
2878
|
+
<Select>
|
|
2879
|
+
<SelectTrigger placeholder="Select option..." error />
|
|
2880
|
+
<SelectPopup>
|
|
2881
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2882
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2883
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2884
|
+
</SelectPopup>
|
|
2885
|
+
</Select>
|
|
2886
|
+
</div>
|
|
2887
|
+
<div>
|
|
2888
|
+
<p className="mb-8 text-12 text-text-muted">Disabled</p>
|
|
2889
|
+
<Select disabled>
|
|
2890
|
+
<SelectTrigger placeholder="Select option..." />
|
|
2891
|
+
<SelectPopup>
|
|
2892
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2893
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2894
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2895
|
+
</SelectPopup>
|
|
2896
|
+
</Select>
|
|
2897
|
+
</div>
|
|
2898
|
+
</div>
|
|
2899
|
+
```
|
|
2900
|
+
|
|
2901
|
+
```tsx
|
|
2902
|
+
<div className="w-[320px]">
|
|
2903
|
+
<Select>
|
|
2904
|
+
<SelectTrigger size="sm" placeholder="Select option..." />
|
|
2905
|
+
<SelectPopup>
|
|
2906
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2907
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2908
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2909
|
+
</SelectPopup>
|
|
2910
|
+
</Select>
|
|
2911
|
+
</div>
|
|
2912
|
+
```
|
|
2913
|
+
|
|
2914
|
+
```tsx
|
|
2915
|
+
<div className="w-[320px]">
|
|
2916
|
+
<Select>
|
|
2917
|
+
<SelectTrigger size="default" placeholder="Select option..." />
|
|
2918
|
+
<SelectPopup>
|
|
2919
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2920
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2921
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2922
|
+
</SelectPopup>
|
|
2923
|
+
</Select>
|
|
2924
|
+
</div>
|
|
2925
|
+
```
|
|
2926
|
+
|
|
2927
|
+
```tsx
|
|
2928
|
+
<div className="w-[320px]">
|
|
2929
|
+
<Select>
|
|
2930
|
+
<SelectTrigger size="lg" placeholder="Select option..." />
|
|
2931
|
+
<SelectPopup>
|
|
2932
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2933
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2934
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2935
|
+
</SelectPopup>
|
|
2936
|
+
</Select>
|
|
2937
|
+
</div>
|
|
2938
|
+
```
|
|
2939
|
+
|
|
2940
|
+
```tsx
|
|
2941
|
+
<div className="flex flex-col gap-16 max-w-[320px]">
|
|
2942
|
+
<div>
|
|
2943
|
+
<p className="mb-8 text-12 text-text-muted">Small (36px)</p>
|
|
2944
|
+
<Select>
|
|
2945
|
+
<SelectTrigger size="sm" placeholder="Select option..." />
|
|
2946
|
+
<SelectPopup>
|
|
2947
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2948
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2949
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2950
|
+
</SelectPopup>
|
|
2951
|
+
</Select>
|
|
2952
|
+
</div>
|
|
2953
|
+
<div>
|
|
2954
|
+
<p className="mb-8 text-12 text-text-muted">Default (48px)</p>
|
|
2955
|
+
<Select>
|
|
2956
|
+
<SelectTrigger size="default" placeholder="Select option..." />
|
|
2957
|
+
<SelectPopup>
|
|
2958
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2959
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2960
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2961
|
+
</SelectPopup>
|
|
2962
|
+
</Select>
|
|
2963
|
+
</div>
|
|
2964
|
+
<div>
|
|
2965
|
+
<p className="mb-8 text-12 text-text-muted">Large (56px)</p>
|
|
2966
|
+
<Select>
|
|
2967
|
+
<SelectTrigger size="lg" placeholder="Select option..." />
|
|
2968
|
+
<SelectPopup>
|
|
2969
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
2970
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
2971
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
2972
|
+
</SelectPopup>
|
|
2973
|
+
</Select>
|
|
2974
|
+
</div>
|
|
2975
|
+
</div>
|
|
2976
|
+
```
|
|
2977
|
+
|
|
2978
|
+
```tsx
|
|
2979
|
+
<div className="flex flex-col gap-8 max-w-[320px]">
|
|
2980
|
+
<label
|
|
2981
|
+
htmlFor="state-select"
|
|
2982
|
+
className="text-14 font-medium text-text-primary"
|
|
2983
|
+
>
|
|
2984
|
+
State / Territory
|
|
2985
|
+
</label>
|
|
2986
|
+
<Select>
|
|
2987
|
+
<SelectTrigger placeholder="Select a state..." />
|
|
2988
|
+
<SelectPopup>
|
|
2989
|
+
{states.map((state) => (
|
|
2990
|
+
<SelectOption key={state.value} value={state.value}>
|
|
2991
|
+
{state.label}
|
|
2992
|
+
</SelectOption>
|
|
2993
|
+
))}
|
|
2994
|
+
</SelectPopup>
|
|
2995
|
+
</Select>
|
|
2996
|
+
</div>
|
|
2997
|
+
```
|
|
2998
|
+
|
|
2999
|
+
```tsx
|
|
3000
|
+
<div className="flex flex-col gap-8 max-w-[320px]">
|
|
3001
|
+
<label
|
|
3002
|
+
htmlFor="state-error"
|
|
3003
|
+
className="text-14 font-medium text-text-primary"
|
|
3004
|
+
>
|
|
3005
|
+
State / Territory
|
|
3006
|
+
</label>
|
|
3007
|
+
<Select>
|
|
3008
|
+
<SelectTrigger placeholder="Select a state..." error />
|
|
3009
|
+
<SelectPopup>
|
|
3010
|
+
{states.map((state) => (
|
|
3011
|
+
<SelectOption key={state.value} value={state.value}>
|
|
3012
|
+
{state.label}
|
|
3013
|
+
</SelectOption>
|
|
3014
|
+
))}
|
|
3015
|
+
</SelectPopup>
|
|
3016
|
+
</Select>
|
|
3017
|
+
<p className="text-12 text-ui-error-color">Please select a state</p>
|
|
3018
|
+
</div>
|
|
3019
|
+
```
|
|
3020
|
+
|
|
3021
|
+
```tsx
|
|
3022
|
+
<div className="flex flex-col gap-8 max-w-[320px]">
|
|
3023
|
+
<label
|
|
3024
|
+
htmlFor="required-select"
|
|
3025
|
+
className="text-14 font-medium text-text-primary"
|
|
3026
|
+
>
|
|
3027
|
+
State / Territory <span className="text-ui-error-color">*</span>
|
|
3028
|
+
</label>
|
|
3029
|
+
<Select required>
|
|
3030
|
+
<SelectTrigger placeholder="Select a state..." />
|
|
3031
|
+
<SelectPopup>
|
|
3032
|
+
{states.map((state) => (
|
|
3033
|
+
<SelectOption key={state.value} value={state.value}>
|
|
3034
|
+
{state.label}
|
|
3035
|
+
</SelectOption>
|
|
3036
|
+
))}
|
|
3037
|
+
</SelectPopup>
|
|
3038
|
+
</Select>
|
|
3039
|
+
</div>
|
|
3040
|
+
```
|
|
3041
|
+
|
|
3042
|
+
```tsx
|
|
3043
|
+
<div className="w-[320px]">
|
|
3044
|
+
<Select>
|
|
3045
|
+
<SelectTrigger placeholder="Select option..." />
|
|
3046
|
+
<SelectPopup>
|
|
3047
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
3048
|
+
<SelectOption value="option2" disabled>
|
|
3049
|
+
Option 2 (Disabled)
|
|
3050
|
+
</SelectOption>
|
|
3051
|
+
<SelectOption value="option3">Option 3</SelectOption>
|
|
3052
|
+
<SelectOption value="option4" disabled>
|
|
3053
|
+
Option 4 (Disabled)
|
|
3054
|
+
</SelectOption>
|
|
3055
|
+
<SelectOption value="option5">Option 5</SelectOption>
|
|
3056
|
+
</SelectPopup>
|
|
3057
|
+
</Select>
|
|
3058
|
+
</div>
|
|
3059
|
+
```
|
|
3060
|
+
|
|
3061
|
+
```tsx
|
|
3062
|
+
<div className="w-[320px]">
|
|
3063
|
+
<Select>
|
|
3064
|
+
<SelectTrigger placeholder="Select a state..." />
|
|
3065
|
+
<SelectPopup>
|
|
3066
|
+
{states.map((state) => (
|
|
3067
|
+
<SelectOption key={state.value} value={state.value}>
|
|
3068
|
+
{state.label}
|
|
3069
|
+
</SelectOption>
|
|
3070
|
+
))}
|
|
3071
|
+
</SelectPopup>
|
|
3072
|
+
</Select>
|
|
3073
|
+
</div>
|
|
3074
|
+
```
|
|
3075
|
+
|
|
3076
|
+
```tsx
|
|
3077
|
+
<div className="flex flex-col gap-16 max-w-[500px]">
|
|
3078
|
+
<p className="text-14 text-text-muted">
|
|
3079
|
+
Select and Input share the same base styling for consistent forms
|
|
3080
|
+
</p>
|
|
3081
|
+
<div className="flex gap-12">
|
|
3082
|
+
<div className="flex-1">
|
|
3083
|
+
<p className="block mb-8 text-12 text-text-muted">Input</p>
|
|
3084
|
+
<Input placeholder="Enter text..." />
|
|
3085
|
+
</div>
|
|
3086
|
+
<div className="flex-1">
|
|
3087
|
+
<p className="block mb-8 text-12 text-text-muted">Select</p>
|
|
3088
|
+
<Select>
|
|
3089
|
+
<SelectTrigger placeholder="Select option..." />
|
|
3090
|
+
<SelectPopup>
|
|
3091
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
3092
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
3093
|
+
</SelectPopup>
|
|
3094
|
+
</Select>
|
|
3095
|
+
</div>
|
|
3096
|
+
</div>
|
|
3097
|
+
<div className="flex gap-12">
|
|
3098
|
+
<div className="flex-1">
|
|
3099
|
+
<p className="block mb-8 text-12 text-text-muted">Input (Error)</p>
|
|
3100
|
+
<Input error placeholder="Enter text..." />
|
|
3101
|
+
</div>
|
|
3102
|
+
<div className="flex-1">
|
|
3103
|
+
<p className="block mb-8 text-12 text-text-muted">Select (Error)</p>
|
|
3104
|
+
<Select>
|
|
3105
|
+
<SelectTrigger error placeholder="Select option..." />
|
|
3106
|
+
<SelectPopup>
|
|
3107
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
3108
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
3109
|
+
</SelectPopup>
|
|
3110
|
+
</Select>
|
|
3111
|
+
</div>
|
|
3112
|
+
</div>
|
|
3113
|
+
<div className="flex gap-12">
|
|
3114
|
+
<div className="flex-1">
|
|
3115
|
+
<p className="block mb-8 text-12 text-text-muted">Input (Disabled)</p>
|
|
3116
|
+
<Input disabled placeholder="Enter text..." />
|
|
3117
|
+
</div>
|
|
3118
|
+
<div className="flex-1">
|
|
3119
|
+
<p className="block mb-8 text-12 text-text-muted">
|
|
3120
|
+
Select (Disabled)
|
|
3121
|
+
</p>
|
|
3122
|
+
<Select disabled>
|
|
3123
|
+
<SelectTrigger placeholder="Select option..." />
|
|
3124
|
+
<SelectPopup>
|
|
3125
|
+
<SelectOption value="option1">Option 1</SelectOption>
|
|
3126
|
+
<SelectOption value="option2">Option 2</SelectOption>
|
|
3127
|
+
</SelectPopup>
|
|
3128
|
+
</Select>
|
|
3129
|
+
</div>
|
|
3130
|
+
</div>
|
|
3131
|
+
</div>
|
|
3132
|
+
```
|
|
3133
|
+
|
|
3134
|
+
|
|
3135
|
+
### Tooltip
|
|
3136
|
+
|
|
3137
|
+
**Import:** `import { Tooltip } from "@nationaldesignstudio/react";`
|
|
3138
|
+
|
|
3139
|
+
**Category:** Other
|
|
3140
|
+
|
|
3141
|
+
**Props:**
|
|
3142
|
+
|
|
3143
|
+
- `content`: React.ReactNode (required)
|
|
3144
|
+
The content to show in the tooltip */
|
|
3145
|
+
- `children`: React.ReactNode (required)
|
|
3146
|
+
The element that triggers the tooltip */
|
|
3147
|
+
- `side`: "top" | "bottom" | "left" | "right"
|
|
3148
|
+
Side of the trigger to show the tooltip */
|
|
3149
|
+
Values: `top`, `bottom`, `left`, `right`
|
|
3150
|
+
- `sideOffset`: number
|
|
3151
|
+
Offset from the trigger */
|
|
3152
|
+
- `align`: "start" | "center" | "end"
|
|
3153
|
+
Alignment along the side */
|
|
3154
|
+
Values: `start`, `center`, `end`
|
|
3155
|
+
- `delay`: number
|
|
3156
|
+
Delay before showing the tooltip (ms) */
|
|
3157
|
+
- `closeDelay`: number
|
|
3158
|
+
Delay before hiding the tooltip (ms) */
|
|
3159
|
+
- `showArrow`: boolean
|
|
3160
|
+
Whether to show an arrow */
|
|
3161
|
+
- `open`: boolean
|
|
3162
|
+
Controlled open state */
|
|
3163
|
+
- `defaultOpen`: boolean
|
|
3164
|
+
Default open state */
|
|
3165
|
+
- `onOpenChange`: (open: boolean) => void
|
|
3166
|
+
Callback when open state changes */
|
|
3167
|
+
- `className`: string
|
|
3168
|
+
Additional className for the popup */
|
|
3169
|
+
|
|
3170
|
+
**Examples:**
|
|
3171
|
+
|
|
3172
|
+
```tsx
|
|
3173
|
+
<Tooltip {...args} content="This is a tooltip">
|
|
3174
|
+
<Button>Hover me</Button>
|
|
3175
|
+
</Tooltip>
|
|
3176
|
+
```
|
|
3177
|
+
|
|
3178
|
+
```tsx
|
|
3179
|
+
<Tooltip content="Save your changes">
|
|
3180
|
+
<Button>Save</Button>
|
|
3181
|
+
</Tooltip>
|
|
3182
|
+
```
|
|
3183
|
+
|
|
3184
|
+
```tsx
|
|
3185
|
+
<Tooltip content="No arrow here" showArrow={false}>
|
|
3186
|
+
<Button>Hover me</Button>
|
|
3187
|
+
</Tooltip>
|
|
3188
|
+
```
|
|
3189
|
+
|
|
3190
|
+
```tsx
|
|
3191
|
+
<Tooltip content="This is a longer tooltip that provides more detailed information about the element.">
|
|
3192
|
+
<Button>Hover for details</Button>
|
|
3193
|
+
</Tooltip>
|
|
3194
|
+
```
|
|
3195
|
+
|
|
3196
|
+
```tsx
|
|
3197
|
+
<div className="flex flex-col items-center gap-48">
|
|
3198
|
+
<Tooltip content="Top tooltip" side="top">
|
|
3199
|
+
<Button variant="outline">Top</Button>
|
|
3200
|
+
</Tooltip>
|
|
3201
|
+
<div className="flex items-center gap-48">
|
|
3202
|
+
<Tooltip content="Left tooltip" side="left">
|
|
3203
|
+
<Button variant="outline">Left</Button>
|
|
3204
|
+
</Tooltip>
|
|
3205
|
+
<Tooltip content="Right tooltip" side="right">
|
|
3206
|
+
<Button variant="outline">Right</Button>
|
|
3207
|
+
</Tooltip>
|
|
3208
|
+
</div>
|
|
3209
|
+
<Tooltip content="Bottom tooltip" side="bottom">
|
|
3210
|
+
<Button variant="outline">Bottom</Button>
|
|
3211
|
+
</Tooltip>
|
|
3212
|
+
</div>
|
|
3213
|
+
```
|
|
3214
|
+
|
|
3215
|
+
```tsx
|
|
3216
|
+
<Tooltip content="Top position" side="top">
|
|
3217
|
+
<Button>Top</Button>
|
|
3218
|
+
</Tooltip>
|
|
3219
|
+
```
|
|
3220
|
+
|
|
3221
|
+
```tsx
|
|
3222
|
+
<Tooltip content="Bottom position" side="bottom">
|
|
3223
|
+
<Button>Bottom</Button>
|
|
3224
|
+
</Tooltip>
|
|
3225
|
+
```
|
|
3226
|
+
|
|
3227
|
+
```tsx
|
|
3228
|
+
<Tooltip content="Left position" side="left">
|
|
3229
|
+
<Button>Left</Button>
|
|
3230
|
+
</Tooltip>
|
|
3231
|
+
```
|
|
3232
|
+
|
|
3233
|
+
```tsx
|
|
3234
|
+
<Tooltip content="Right position" side="right">
|
|
3235
|
+
<Button>Right</Button>
|
|
3236
|
+
</Tooltip>
|
|
3237
|
+
```
|
|
3238
|
+
|
|
3239
|
+
```tsx
|
|
3240
|
+
<div className="flex flex-col gap-24">
|
|
3241
|
+
<div className="flex items-center gap-24">
|
|
3242
|
+
<Tooltip content="Aligned to start" side="bottom" align="start">
|
|
3243
|
+
<Button variant="secondary" className="w-144">
|
|
3244
|
+
Start
|
|
3245
|
+
</Button>
|
|
3246
|
+
</Tooltip>
|
|
3247
|
+
<Tooltip content="Aligned to center" side="bottom" align="center">
|
|
3248
|
+
<Button variant="secondary" className="w-144">
|
|
3249
|
+
Center
|
|
3250
|
+
</Button>
|
|
3251
|
+
</Tooltip>
|
|
3252
|
+
<Tooltip content="Aligned to end" side="bottom" align="end">
|
|
3253
|
+
<Button variant="secondary" className="w-144">
|
|
3254
|
+
End
|
|
3255
|
+
</Button>
|
|
3256
|
+
</Tooltip>
|
|
3257
|
+
</div>
|
|
3258
|
+
</div>
|
|
3259
|
+
```
|
|
3260
|
+
|
|
3261
|
+
```tsx
|
|
3262
|
+
<Tooltip content="Appears after 1 second" delay={1000}>
|
|
3263
|
+
<Button>1s delay</Button>
|
|
3264
|
+
</Tooltip>
|
|
3265
|
+
```
|
|
3266
|
+
|
|
3267
|
+
```tsx
|
|
3268
|
+
<Tooltip content="Stays visible for 500ms" closeDelay={500}>
|
|
3269
|
+
<Button>Close delay</Button>
|
|
3270
|
+
</Tooltip>
|
|
3271
|
+
```
|
|
3272
|
+
|
|
3273
|
+
```tsx
|
|
3274
|
+
<TooltipProvider delay={300} closeDelay={0}>
|
|
3275
|
+
<div className="flex items-center gap-16">
|
|
3276
|
+
<Tooltip content="First tooltip">
|
|
3277
|
+
<Button variant="outline">First</Button>
|
|
3278
|
+
</Tooltip>
|
|
3279
|
+
<Tooltip content="Second tooltip">
|
|
3280
|
+
<Button variant="outline">Second</Button>
|
|
3281
|
+
</Tooltip>
|
|
3282
|
+
<Tooltip content="Third tooltip">
|
|
3283
|
+
<Button variant="outline">Third</Button>
|
|
3284
|
+
</Tooltip>
|
|
3285
|
+
</div>
|
|
3286
|
+
</TooltipProvider>
|
|
3287
|
+
```
|
|
3288
|
+
|
|
3289
|
+
```tsx
|
|
3290
|
+
<TooltipParts>
|
|
3291
|
+
<TooltipTrigger>
|
|
3292
|
+
<Button variant="primary">Custom Tooltip</Button>
|
|
3293
|
+
</TooltipTrigger>
|
|
3294
|
+
<TooltipPortal>
|
|
3295
|
+
<TooltipPositioner side="bottom" sideOffset={12}>
|
|
3296
|
+
<TooltipPopup>
|
|
3297
|
+
<TooltipArrow />
|
|
3298
|
+
Built with compound components
|
|
3299
|
+
</TooltipPopup>
|
|
3300
|
+
</TooltipPositioner>
|
|
3301
|
+
</TooltipPortal>
|
|
3302
|
+
</TooltipParts>
|
|
3303
|
+
```
|
|
3304
|
+
|
|
3305
|
+
```tsx
|
|
3306
|
+
<div className="flex items-center gap-24">
|
|
3307
|
+
<Tooltip content="Button tooltip">
|
|
3308
|
+
<Button>Button</Button>
|
|
3309
|
+
</Tooltip>
|
|
3310
|
+
<Tooltip content="Icon tooltip">
|
|
3311
|
+
<button
|
|
3312
|
+
type="button"
|
|
3313
|
+
className="flex size-36 items-center justify-center rounded-surface-ui-small bg-bg-section text-text-primary hover:bg-bg-section-secondary"
|
|
3314
|
+
>
|
|
3315
|
+
<svg
|
|
3316
|
+
className="size-20"
|
|
3317
|
+
fill="none"
|
|
3318
|
+
viewBox="0 0 24 24"
|
|
3319
|
+
stroke="currentColor"
|
|
3320
|
+
aria-hidden="true"
|
|
3321
|
+
>
|
|
3322
|
+
<path
|
|
3323
|
+
strokeLinecap="round"
|
|
3324
|
+
strokeLinejoin="round"
|
|
3325
|
+
strokeWidth={2}
|
|
3326
|
+
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
3327
|
+
/>
|
|
3328
|
+
</svg>
|
|
3329
|
+
<span className="sr-only">Info</span>
|
|
3330
|
+
</button>
|
|
3331
|
+
</Tooltip>
|
|
3332
|
+
<Tooltip content="Text tooltip">
|
|
3333
|
+
<span className="cursor-help border-b border-dashed border-fg-muted text-text-secondary">
|
|
3334
|
+
Hover this text
|
|
3335
|
+
</span>
|
|
3336
|
+
</Tooltip>
|
|
3337
|
+
</div>
|
|
3338
|
+
```
|
|
3339
|
+
|
|
3340
|
+
```tsx
|
|
3341
|
+
<div className="flex flex-col items-center gap-16">
|
|
3342
|
+
<Tooltip
|
|
3343
|
+
content="Controlled tooltip"
|
|
3344
|
+
open={open}
|
|
3345
|
+
onOpenChange={setOpen}
|
|
3346
|
+
>
|
|
3347
|
+
<Button>Hover or click button below</Button>
|
|
3348
|
+
</Tooltip>
|
|
3349
|
+
<Button variant="outline" onClick={() => setOpen(!open)}>
|
|
3350
|
+
{open ? "Close tooltip" : "Open tooltip"}
|
|
3351
|
+
</Button>
|
|
3352
|
+
</div>
|
|
3353
|
+
```
|
|
3354
|
+
|
|
3355
|
+
|
|
2153
3356
|
### Tout
|
|
2154
3357
|
|
|
2155
3358
|
**Import:** `import { Tout } from "@nationaldesignstudio/react";`
|
|
@@ -2184,11 +3387,7 @@ className="font-semibold" // Font weight 600
|
|
|
2184
3387
|
headline="Brand-Large/Headline/Small"
|
|
2185
3388
|
body="A river pattern stacks content in a simple vertical flow: one clear heading, a short block of copy, then the next step. It's ideal for guiding citizens through a process or story, keeping focus moving straight down the page with minimal choices and well-timed calls to action."
|
|
2186
3389
|
primaryAction={<Button>Primary</Button>}
|
|
2187
|
-
secondaryAction={
|
|
2188
|
-
<Button variant="outline" colorScheme="light">
|
|
2189
|
-
Secondary
|
|
2190
|
-
</Button>
|
|
2191
|
-
}
|
|
3390
|
+
secondaryAction={<Button variant="secondary-outline">Secondary</Button>}
|
|
2192
3391
|
backgroundMedia={<PlaceholderBackground />}
|
|
2193
3392
|
/>
|
|
2194
3393
|
```
|
|
@@ -2198,11 +3397,7 @@ className="font-semibold" // Font weight 600
|
|
|
2198
3397
|
headline="Brand-Large/Headline/Small"
|
|
2199
3398
|
body="A river pattern stacks content in a simple vertical flow: one clear heading, a short block of copy, then the next step. It's ideal for guiding citizens through a process or story, keeping focus moving straight down the page with minimal choices and well-timed calls to action."
|
|
2200
3399
|
primaryAction={<Button>Primary</Button>}
|
|
2201
|
-
secondaryAction={
|
|
2202
|
-
<Button variant="outline" colorScheme="light">
|
|
2203
|
-
Secondary
|
|
2204
|
-
</Button>
|
|
2205
|
-
}
|
|
3400
|
+
secondaryAction={<Button variant="secondary-outline">Secondary</Button>}
|
|
2206
3401
|
backgroundMedia={<PlaceholderBackground />}
|
|
2207
3402
|
/>
|
|
2208
3403
|
```
|
|
@@ -2213,7 +3408,7 @@ className="font-semibold" // Font weight 600
|
|
|
2213
3408
|
body="A river pattern stacks content in a simple vertical flow: one clear heading, a short block of copy, then the next step. It's ideal for guiding citizens through a process or story, keeping focus moving straight down the page with minimal choices and well-timed calls to action."
|
|
2214
3409
|
primaryAction={<Button size="sm">Primary</Button>}
|
|
2215
3410
|
secondaryAction={
|
|
2216
|
-
<Button size="sm" variant="outline"
|
|
3411
|
+
<Button size="sm" variant="secondary-outline">
|
|
2217
3412
|
Secondary
|
|
2218
3413
|
</Button>
|
|
2219
3414
|
}
|
|
@@ -2226,11 +3421,7 @@ className="font-semibold" // Font weight 600
|
|
|
2226
3421
|
headline="Work with Purpose"
|
|
2227
3422
|
body="Join a team that's building the future of government services. We're looking for passionate individuals who want to make a difference."
|
|
2228
3423
|
primaryAction={<Button>View Careers</Button>}
|
|
2229
|
-
secondaryAction={
|
|
2230
|
-
<Button variant="outline" colorScheme="light">
|
|
2231
|
-
Learn More
|
|
2232
|
-
</Button>
|
|
2233
|
-
}
|
|
3424
|
+
secondaryAction={<Button variant="secondary-outline">Learn More</Button>}
|
|
2234
3425
|
backgroundMedia={<ImageBackground />}
|
|
2235
3426
|
/>
|
|
2236
3427
|
```
|
|
@@ -2249,11 +3440,7 @@ className="font-semibold" // Font weight 600
|
|
|
2249
3440
|
headline="Experience Innovation"
|
|
2250
3441
|
body="See how modern technology is transforming the way government serves its citizens."
|
|
2251
3442
|
primaryAction={<Button>Watch Video</Button>}
|
|
2252
|
-
secondaryAction={
|
|
2253
|
-
<Button variant="outline" colorScheme="light">
|
|
2254
|
-
Learn More
|
|
2255
|
-
</Button>
|
|
2256
|
-
}
|
|
3443
|
+
secondaryAction={<Button variant="secondary-outline">Learn More</Button>}
|
|
2257
3444
|
backgroundMedia={
|
|
2258
3445
|
<div className="absolute inset-0 bg-gray-800 flex items-center justify-center">
|
|
2259
3446
|
<span className="text-gray-400 typography-body-small">
|
|
@@ -2269,11 +3456,7 @@ className="font-semibold" // Font weight 600
|
|
|
2269
3456
|
headline="Work with Purpose"
|
|
2270
3457
|
body="Join a team that's building the future of government services. We're looking for passionate individuals who want to make a difference."
|
|
2271
3458
|
primaryAction={<Button>View Careers</Button>}
|
|
2272
|
-
secondaryAction={
|
|
2273
|
-
<Button variant="outline" colorScheme="light">
|
|
2274
|
-
Learn More
|
|
2275
|
-
</Button>
|
|
2276
|
-
}
|
|
3459
|
+
secondaryAction={<Button variant="secondary-outline">Learn More</Button>}
|
|
2277
3460
|
backgroundMedia={<ImageBackground />}
|
|
2278
3461
|
footer={<NdstudioFooter />}
|
|
2279
3462
|
/>
|
|
@@ -2580,5 +3763,5 @@ className="font-semibold" // Font weight 600
|
|
|
2580
3763
|
- **Action:** Button
|
|
2581
3764
|
- **Display:** Card, Hero, UsGovBanner
|
|
2582
3765
|
- **Navigation:** Navbar
|
|
2583
|
-
- **Other:** Accordion, Background, Banner, CardGrid, DevToolbar, FaqSection, GridOverlay, NdstudioFooter, PagerControl, QuoteBlock, River, Tout, TwoColumnSection
|
|
3766
|
+
- **Other:** Accordion, Background, Banner, CardGrid, DevToolbar, FaqSection, GridOverlay, Input, NdstudioFooter, PagerControl, Popover, QuoteBlock, River, Select, Tooltip, Tout, TwoColumnSection
|
|
2584
3767
|
- **Typography:** Prose
|