@cdt5058/json-render-uswds 0.0.1 → 0.1.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.
@@ -0,0 +1,1170 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/catalog.ts
21
+ var catalog_exports = {};
22
+ __export(catalog_exports, {
23
+ uswdsComponentDefinitions: () => uswdsComponentDefinitions
24
+ });
25
+ module.exports = __toCommonJS(catalog_exports);
26
+ var import_zod = require("zod");
27
+ var validationCheckSchema = import_zod.z.array(
28
+ import_zod.z.object({
29
+ type: import_zod.z.string(),
30
+ message: import_zod.z.string(),
31
+ args: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional()
32
+ })
33
+ ).nullable();
34
+ var validateOnSchema = import_zod.z.enum(["change", "blur", "submit"]).nullable();
35
+ var uswdsComponentDefinitions = {
36
+ // ==========================================================================
37
+ // Layout Components
38
+ // ==========================================================================
39
+ Grid: {
40
+ props: import_zod.z.object({
41
+ columns: import_zod.z.number().nullable(),
42
+ gap: import_zod.z.enum(["sm", "md", "lg"]).nullable()
43
+ }),
44
+ slots: ["default"],
45
+ description: "USWDS grid row with equal-width columns. columns: 1-12. gap: spacing between columns.",
46
+ example: { columns: 3, gap: "md" }
47
+ },
48
+ CardGroup: {
49
+ props: import_zod.z.object({
50
+ cards: import_zod.z.array(
51
+ import_zod.z.object({
52
+ title: import_zod.z.string().nullable(),
53
+ description: import_zod.z.string().nullable(),
54
+ mediaUrl: import_zod.z.string().nullable(),
55
+ mediaAlt: import_zod.z.string().nullable(),
56
+ footer: import_zod.z.string().nullable()
57
+ })
58
+ ),
59
+ flag: import_zod.z.boolean().nullable()
60
+ }),
61
+ description: "USWDS group of cards in a responsive grid. cards: [{title, description, mediaUrl?, mediaAlt?, footer?}]. flag for horizontal card layout.",
62
+ example: {
63
+ cards: [
64
+ {
65
+ title: "Card One",
66
+ description: "Description one.",
67
+ mediaUrl: null,
68
+ mediaAlt: null,
69
+ footer: null
70
+ },
71
+ {
72
+ title: "Card Two",
73
+ description: "Description two.",
74
+ mediaUrl: null,
75
+ mediaAlt: null,
76
+ footer: null
77
+ }
78
+ ]
79
+ }
80
+ },
81
+ Card: {
82
+ props: import_zod.z.object({
83
+ title: import_zod.z.string().nullable(),
84
+ description: import_zod.z.string().nullable(),
85
+ headerFirst: import_zod.z.boolean().nullable(),
86
+ mediaUrl: import_zod.z.string().nullable(),
87
+ mediaAlt: import_zod.z.string().nullable(),
88
+ flag: import_zod.z.boolean().nullable()
89
+ }),
90
+ slots: ["default"],
91
+ description: "USWDS card container. Use title/description for header, mediaUrl for an image, flag for horizontal layout.",
92
+ example: { title: "Card Title", description: "Supporting text." }
93
+ },
94
+ Divider: {
95
+ props: import_zod.z.object({}),
96
+ description: "USWDS horizontal rule divider (usa-divider)."
97
+ },
98
+ Footer: {
99
+ props: import_zod.z.object({
100
+ variant: import_zod.z.enum(["slim", "medium", "big"]).nullable(),
101
+ agencyName: import_zod.z.string(),
102
+ agencyUrl: import_zod.z.string().nullable(),
103
+ logoUrl: import_zod.z.string().nullable(),
104
+ logoAlt: import_zod.z.string().nullable(),
105
+ navGroups: import_zod.z.array(
106
+ import_zod.z.object({
107
+ heading: import_zod.z.string().nullable(),
108
+ links: import_zod.z.array(import_zod.z.object({ label: import_zod.z.string(), href: import_zod.z.string() }))
109
+ })
110
+ ).nullable(),
111
+ contactHeading: import_zod.z.string().nullable(),
112
+ contactInfo: import_zod.z.array(
113
+ import_zod.z.object({
114
+ type: import_zod.z.enum(["address", "phone", "email"]),
115
+ value: import_zod.z.string()
116
+ })
117
+ ).nullable(),
118
+ socialLinks: import_zod.z.array(
119
+ import_zod.z.object({
120
+ platform: import_zod.z.enum([
121
+ "facebook",
122
+ "twitter",
123
+ "youtube",
124
+ "instagram",
125
+ "rss",
126
+ "linkedin",
127
+ "github"
128
+ ]),
129
+ href: import_zod.z.string(),
130
+ label: import_zod.z.string()
131
+ })
132
+ ).nullable(),
133
+ returnToTop: import_zod.z.boolean().nullable()
134
+ }),
135
+ description: "USWDS site footer. variant: slim (compact), medium (default), big (multi-column nav). navGroups: [{heading?, links: [{label, href}]}]. For big variant, each group becomes a column.",
136
+ example: {
137
+ variant: "medium",
138
+ agencyName: "Agency Name",
139
+ agencyUrl: "/",
140
+ logoUrl: null,
141
+ logoAlt: null,
142
+ navGroups: [
143
+ {
144
+ heading: null,
145
+ links: [
146
+ { label: "Home", href: "/" },
147
+ { label: "About", href: "/about" },
148
+ { label: "Contact", href: "/contact" }
149
+ ]
150
+ }
151
+ ],
152
+ contactHeading: "Contact",
153
+ contactInfo: [
154
+ { type: "address", value: "1800 F Street NW, Washington, DC 20405" },
155
+ { type: "phone", value: "1-800-FED-INFO" },
156
+ { type: "email", value: "info@agency.gov" }
157
+ ],
158
+ socialLinks: null,
159
+ returnToTop: true
160
+ }
161
+ },
162
+ // ==========================================================================
163
+ // Navigation Components
164
+ // ==========================================================================
165
+ Accordion: {
166
+ props: import_zod.z.object({
167
+ items: import_zod.z.array(
168
+ import_zod.z.object({
169
+ title: import_zod.z.string(),
170
+ content: import_zod.z.string(),
171
+ expanded: import_zod.z.boolean().nullable()
172
+ })
173
+ ),
174
+ bordered: import_zod.z.boolean().nullable(),
175
+ multiselectable: import_zod.z.boolean().nullable()
176
+ }),
177
+ description: "USWDS accordion. Items as [{title, content, expanded?}]. bordered adds border styling. multiselectable allows multiple open panels.",
178
+ example: {
179
+ items: [
180
+ { title: "First item", content: "Content for first item." },
181
+ { title: "Second item", content: "Content for second item." }
182
+ ]
183
+ }
184
+ },
185
+ Pagination: {
186
+ props: import_zod.z.object({
187
+ totalPages: import_zod.z.number(),
188
+ page: import_zod.z.number().nullable(),
189
+ ariaLabel: import_zod.z.string().nullable()
190
+ }),
191
+ events: ["change"],
192
+ description: "USWDS pagination navigation. Use { $bindState } on page for current page number.",
193
+ example: { totalPages: 10, page: 1 }
194
+ },
195
+ StepIndicator: {
196
+ props: import_zod.z.object({
197
+ steps: import_zod.z.array(import_zod.z.string()),
198
+ currentStep: import_zod.z.number(),
199
+ counters: import_zod.z.enum(["default", "small"]).nullable(),
200
+ centered: import_zod.z.boolean().nullable(),
201
+ noLabels: import_zod.z.boolean().nullable()
202
+ }),
203
+ description: "USWDS step indicator for multi-step forms. steps: array of step labels. currentStep: 1-based index of active step.",
204
+ example: {
205
+ steps: ["Personal info", "Household", "Review"],
206
+ currentStep: 1
207
+ }
208
+ },
209
+ Header: {
210
+ props: import_zod.z.object({
211
+ variant: import_zod.z.enum(["basic", "extended"]).nullable(),
212
+ siteName: import_zod.z.string(),
213
+ siteUrl: import_zod.z.string().nullable(),
214
+ logoUrl: import_zod.z.string().nullable(),
215
+ logoAlt: import_zod.z.string().nullable(),
216
+ navItems: import_zod.z.array(
217
+ import_zod.z.object({
218
+ label: import_zod.z.string(),
219
+ href: import_zod.z.string(),
220
+ current: import_zod.z.boolean().nullable(),
221
+ items: import_zod.z.array(
222
+ import_zod.z.object({
223
+ label: import_zod.z.string(),
224
+ href: import_zod.z.string()
225
+ })
226
+ ).nullable()
227
+ })
228
+ ).nullable(),
229
+ showSearch: import_zod.z.boolean().nullable()
230
+ }),
231
+ description: "USWDS site header with primary navigation. variant: basic (default) or extended (taller with logo). navItems: [{label, href, current?, items?}] \u2014 items creates a dropdown. showSearch adds a search bar.",
232
+ example: {
233
+ variant: "basic",
234
+ siteName: "Agency Name",
235
+ siteUrl: "/",
236
+ logoUrl: null,
237
+ logoAlt: null,
238
+ navItems: [
239
+ { label: "Home", href: "/", current: true, items: null },
240
+ { label: "About", href: "/about", current: false, items: null },
241
+ {
242
+ label: "Topics",
243
+ href: "/topics",
244
+ current: false,
245
+ items: [
246
+ { label: "Topic One", href: "/topics/one" },
247
+ { label: "Topic Two", href: "/topics/two" }
248
+ ]
249
+ }
250
+ ],
251
+ showSearch: false
252
+ }
253
+ },
254
+ SkipNav: {
255
+ props: import_zod.z.object({
256
+ href: import_zod.z.string().nullable(),
257
+ label: import_zod.z.string().nullable()
258
+ }),
259
+ description: "USWDS skip navigation link. Renders an off-screen anchor that appears on focus, letting keyboard users jump past repeated navigation. href defaults to '#main-content'.",
260
+ example: { href: "#main-content", label: "Skip to main content" }
261
+ },
262
+ SideNav: {
263
+ props: import_zod.z.object({
264
+ items: import_zod.z.array(
265
+ import_zod.z.object({
266
+ label: import_zod.z.string(),
267
+ href: import_zod.z.string(),
268
+ current: import_zod.z.boolean().nullable(),
269
+ children: import_zod.z.array(
270
+ import_zod.z.object({
271
+ label: import_zod.z.string(),
272
+ href: import_zod.z.string(),
273
+ current: import_zod.z.boolean().nullable()
274
+ })
275
+ ).nullable()
276
+ })
277
+ ),
278
+ ariaLabel: import_zod.z.string().nullable()
279
+ }),
280
+ description: "USWDS side navigation. items: [{label, href, current?, children?}]. Mark the active page with current: true.",
281
+ example: {
282
+ ariaLabel: "Side navigation",
283
+ items: [
284
+ {
285
+ label: "Overview",
286
+ href: "/overview",
287
+ current: false,
288
+ children: null
289
+ },
290
+ {
291
+ label: "Getting started",
292
+ href: "/getting-started",
293
+ current: true,
294
+ children: [
295
+ {
296
+ label: "Installation",
297
+ href: "/getting-started/install",
298
+ current: false
299
+ },
300
+ {
301
+ label: "Configuration",
302
+ href: "/getting-started/config",
303
+ current: false
304
+ }
305
+ ]
306
+ }
307
+ ]
308
+ }
309
+ },
310
+ LanguageSelector: {
311
+ props: import_zod.z.object({
312
+ languages: import_zod.z.array(
313
+ import_zod.z.object({
314
+ label: import_zod.z.string(),
315
+ href: import_zod.z.string(),
316
+ lang: import_zod.z.string(),
317
+ localLabel: import_zod.z.string().nullable()
318
+ })
319
+ ),
320
+ currentLang: import_zod.z.string().nullable()
321
+ }),
322
+ description: "USWDS language selector. languages: [{label, href, lang, localLabel?}]. currentLang: BCP-47 code of the active language (e.g. 'en').",
323
+ example: {
324
+ currentLang: "en",
325
+ languages: [
326
+ { label: "English", href: "/en", lang: "en", localLabel: null },
327
+ { label: "Spanish", href: "/es", lang: "es", localLabel: "Espa\xF1ol" },
328
+ { label: "French", href: "/fr", lang: "fr", localLabel: "Fran\xE7ais" }
329
+ ]
330
+ }
331
+ },
332
+ Link: {
333
+ props: import_zod.z.object({
334
+ label: import_zod.z.string(),
335
+ href: import_zod.z.string(),
336
+ external: import_zod.z.boolean().nullable(),
337
+ variant: import_zod.z.enum(["default", "nav"]).nullable()
338
+ }),
339
+ events: ["press"],
340
+ description: "USWDS anchor link. external adds an external-link indicator. variant: default or nav (for navigation contexts).",
341
+ example: { label: "Learn more", href: "/about" }
342
+ },
343
+ InPageNavigation: {
344
+ props: import_zod.z.object({
345
+ items: import_zod.z.array(
346
+ import_zod.z.object({
347
+ label: import_zod.z.string(),
348
+ href: import_zod.z.string()
349
+ })
350
+ ),
351
+ heading: import_zod.z.string().nullable()
352
+ }),
353
+ description: "USWDS in-page navigation with jump links to sections. items: [{label, href}] where href is an anchor like '#section-1'.",
354
+ example: {
355
+ heading: "On this page",
356
+ items: [
357
+ { label: "Introduction", href: "#introduction" },
358
+ { label: "Requirements", href: "#requirements" },
359
+ { label: "How to apply", href: "#how-to-apply" }
360
+ ]
361
+ }
362
+ },
363
+ Breadcrumb: {
364
+ props: import_zod.z.object({
365
+ items: import_zod.z.array(
366
+ import_zod.z.object({
367
+ label: import_zod.z.string(),
368
+ href: import_zod.z.string().nullable()
369
+ })
370
+ )
371
+ }),
372
+ description: "USWDS breadcrumb navigation. items: array of {label, href?}. Last item is current page (no link).",
373
+ example: {
374
+ items: [
375
+ { label: "Home", href: "/" },
376
+ { label: "Components", href: "/components" },
377
+ { label: "Breadcrumb", href: null }
378
+ ]
379
+ }
380
+ },
381
+ // ==========================================================================
382
+ // Data Display Components
383
+ // ==========================================================================
384
+ Identifier: {
385
+ props: import_zod.z.object({
386
+ domain: import_zod.z.string(),
387
+ agencyName: import_zod.z.string(),
388
+ agencyUrl: import_zod.z.string().nullable(),
389
+ logoUrl: import_zod.z.string().nullable(),
390
+ logoAlt: import_zod.z.string().nullable(),
391
+ disclaimer: import_zod.z.string().nullable(),
392
+ links: import_zod.z.array(import_zod.z.object({ label: import_zod.z.string(), href: import_zod.z.string() })).nullable(),
393
+ showUsagov: import_zod.z.boolean().nullable()
394
+ }),
395
+ description: "USWDS agency identifier section. Shows domain, agency name, logo, required links, and USA.gov footer. Place at the bottom of .gov pages.",
396
+ example: {
397
+ domain: "agency.gov",
398
+ agencyName: "U.S. Department of Example",
399
+ agencyUrl: "/",
400
+ logoUrl: null,
401
+ logoAlt: null,
402
+ disclaimer: null,
403
+ links: [
404
+ { label: "About agency.gov", href: "/about" },
405
+ { label: "Accessibility statement", href: "/accessibility" },
406
+ { label: "Privacy policy", href: "/privacy" },
407
+ { label: "No FEAR Act data", href: "/no-fear" },
408
+ { label: "Office of the Inspector General", href: "/oig" },
409
+ { label: "Performance reports", href: "/performance" },
410
+ { label: "FOIA requests", href: "/foia" }
411
+ ],
412
+ showUsagov: true
413
+ }
414
+ },
415
+ GovBanner: {
416
+ props: import_zod.z.object({
417
+ tld: import_zod.z.enum([".gov", ".mil"]).nullable(),
418
+ expanded: import_zod.z.boolean().nullable()
419
+ }),
420
+ description: "USWDS government site banner ('An official website of the United States government'). tld: '.gov' (default) or '.mil'. expanded: show expanded explanation by default.",
421
+ example: { tld: ".gov" }
422
+ },
423
+ Collection: {
424
+ props: import_zod.z.object({
425
+ items: import_zod.z.array(
426
+ import_zod.z.object({
427
+ heading: import_zod.z.string(),
428
+ href: import_zod.z.string().nullable(),
429
+ description: import_zod.z.string().nullable(),
430
+ date: import_zod.z.string().nullable(),
431
+ dateLabel: import_zod.z.string().nullable(),
432
+ tags: import_zod.z.array(import_zod.z.string()).nullable(),
433
+ thumbnailUrl: import_zod.z.string().nullable(),
434
+ thumbnailAlt: import_zod.z.string().nullable()
435
+ })
436
+ )
437
+ }),
438
+ description: "USWDS collection list of content items. items: [{heading, href?, description?, date?, dateLabel?, tags?, thumbnailUrl?, thumbnailAlt?}].",
439
+ example: {
440
+ items: [
441
+ {
442
+ heading: "Article Title",
443
+ href: "/articles/1",
444
+ description: "A short description of the article.",
445
+ date: "2024-01-15",
446
+ dateLabel: "January 15, 2024",
447
+ tags: ["Policy", "Health"],
448
+ thumbnailUrl: null,
449
+ thumbnailAlt: null
450
+ }
451
+ ]
452
+ }
453
+ },
454
+ IconList: {
455
+ props: import_zod.z.object({
456
+ items: import_zod.z.array(
457
+ import_zod.z.object({
458
+ icon: import_zod.z.string(),
459
+ content: import_zod.z.string(),
460
+ color: import_zod.z.enum(["default", "success", "warning", "error", "info"]).nullable()
461
+ })
462
+ ),
463
+ title: import_zod.z.string().nullable(),
464
+ size: import_zod.z.enum(["sm", "lg", "xl", "2xl", "3xl"]).nullable()
465
+ }),
466
+ description: "USWDS icon list. items: [{icon, content, color?}]. icon is a USWDS icon name (e.g. 'check_circle', 'cancel', 'info'). size controls icon size.",
467
+ example: {
468
+ title: "Requirements",
469
+ items: [
470
+ {
471
+ icon: "check_circle",
472
+ content: "Requirement one is met.",
473
+ color: "success"
474
+ },
475
+ {
476
+ icon: "check_circle",
477
+ content: "Requirement two is met.",
478
+ color: "success"
479
+ },
480
+ {
481
+ icon: "cancel",
482
+ content: "Requirement three is not met.",
483
+ color: "error"
484
+ }
485
+ ]
486
+ }
487
+ },
488
+ Tooltip: {
489
+ props: import_zod.z.object({
490
+ label: import_zod.z.string(),
491
+ content: import_zod.z.string(),
492
+ position: import_zod.z.enum(["top", "bottom", "left", "right"]).nullable()
493
+ }),
494
+ description: "USWDS tooltip shown on hover. label: the visible trigger text. content: tooltip text. position: top (default), bottom, left, right.",
495
+ example: {
496
+ label: "Hover me",
497
+ content: "This is a tooltip",
498
+ position: "top"
499
+ }
500
+ },
501
+ Table: {
502
+ props: import_zod.z.object({
503
+ columns: import_zod.z.array(import_zod.z.string()),
504
+ rows: import_zod.z.array(import_zod.z.array(import_zod.z.string())),
505
+ caption: import_zod.z.string().nullable(),
506
+ borderless: import_zod.z.boolean().nullable(),
507
+ striped: import_zod.z.boolean().nullable(),
508
+ compact: import_zod.z.boolean().nullable(),
509
+ scrollable: import_zod.z.boolean().nullable()
510
+ }),
511
+ description: "USWDS data table. columns: header labels. rows: 2D array of cell strings. borderless/striped/compact for styling variants.",
512
+ example: {
513
+ columns: ["Name", "Role", "Status"],
514
+ rows: [
515
+ ["Alice", "Admin", "Active"],
516
+ ["Bob", "User", "Inactive"]
517
+ ]
518
+ }
519
+ },
520
+ Heading: {
521
+ props: import_zod.z.object({
522
+ text: import_zod.z.string(),
523
+ level: import_zod.z.enum(["h1", "h2", "h3", "h4", "h5", "h6"]).nullable()
524
+ }),
525
+ description: "USWDS heading text (h1\u2013h6) with usa-prose styling.",
526
+ example: { text: "Page Title", level: "h1" }
527
+ },
528
+ Text: {
529
+ props: import_zod.z.object({
530
+ text: import_zod.z.string(),
531
+ variant: import_zod.z.enum(["body", "lead", "small", "code"]).nullable()
532
+ }),
533
+ description: "USWDS paragraph text. variant: body (default), lead, small, code.",
534
+ example: { text: "Supporting paragraph text." }
535
+ },
536
+ Alert: {
537
+ props: import_zod.z.object({
538
+ heading: import_zod.z.string().nullable(),
539
+ message: import_zod.z.string(),
540
+ type: import_zod.z.enum(["info", "success", "warning", "error", "emergency"]).nullable(),
541
+ slim: import_zod.z.boolean().nullable(),
542
+ noIcon: import_zod.z.boolean().nullable()
543
+ }),
544
+ description: "USWDS alert banner. type: info (default), success, warning, error, emergency. slim for compact variant.",
545
+ example: {
546
+ heading: "Success",
547
+ message: "Your form has been submitted.",
548
+ type: "success"
549
+ }
550
+ },
551
+ SiteAlert: {
552
+ props: import_zod.z.object({
553
+ heading: import_zod.z.string().nullable(),
554
+ message: import_zod.z.string(),
555
+ type: import_zod.z.enum(["info", "emergency"]).nullable(),
556
+ slim: import_zod.z.boolean().nullable()
557
+ }),
558
+ description: "USWDS site-wide alert banner for important announcements. type: info (default) or emergency.",
559
+ example: {
560
+ heading: "Official website of the United States government",
561
+ message: "Here's how you know this is a government site.",
562
+ type: "info"
563
+ }
564
+ },
565
+ Tag: {
566
+ props: import_zod.z.object({
567
+ text: import_zod.z.string(),
568
+ big: import_zod.z.boolean().nullable()
569
+ }),
570
+ description: "USWDS tag/label badge. big for larger variant.",
571
+ example: { text: "New" }
572
+ },
573
+ SummaryBox: {
574
+ props: import_zod.z.object({
575
+ heading: import_zod.z.string(),
576
+ items: import_zod.z.array(import_zod.z.string())
577
+ }),
578
+ description: "USWDS summary box with a heading and bullet list of key information.",
579
+ example: {
580
+ heading: "Key information",
581
+ items: ["Item one", "Item two", "Item three"]
582
+ }
583
+ },
584
+ ProcessList: {
585
+ props: import_zod.z.object({
586
+ items: import_zod.z.array(
587
+ import_zod.z.object({
588
+ heading: import_zod.z.string(),
589
+ content: import_zod.z.string()
590
+ })
591
+ )
592
+ }),
593
+ description: "USWDS numbered process list for step-by-step instructions. items: [{heading, content}].",
594
+ example: {
595
+ items: [
596
+ { heading: "Apply", content: "Submit your application online." },
597
+ { heading: "Review", content: "We review your application." },
598
+ { heading: "Approval", content: "Receive your decision letter." }
599
+ ]
600
+ }
601
+ },
602
+ // ==========================================================================
603
+ // Form Input Components
604
+ // ==========================================================================
605
+ Button: {
606
+ props: import_zod.z.object({
607
+ label: import_zod.z.string(),
608
+ variant: import_zod.z.enum([
609
+ "default",
610
+ "secondary",
611
+ "accent-cool",
612
+ "accent-warm",
613
+ "base",
614
+ "outline",
615
+ "outline-inverse",
616
+ "big",
617
+ "unstyled"
618
+ ]).nullable(),
619
+ disabled: import_zod.z.boolean().nullable(),
620
+ type: import_zod.z.enum(["button", "submit", "reset"]).nullable()
621
+ }),
622
+ events: ["press"],
623
+ description: "USWDS button. variant: default (primary), secondary, accent-cool, accent-warm, base, outline, outline-inverse, big, unstyled.",
624
+ example: { label: "Submit", variant: "default" }
625
+ },
626
+ ButtonGroup: {
627
+ props: import_zod.z.object({
628
+ buttons: import_zod.z.array(
629
+ import_zod.z.object({
630
+ label: import_zod.z.string(),
631
+ value: import_zod.z.string(),
632
+ variant: import_zod.z.enum(["default", "secondary", "outline"]).nullable()
633
+ })
634
+ ),
635
+ segmented: import_zod.z.boolean().nullable()
636
+ }),
637
+ events: ["press"],
638
+ description: "USWDS button group. buttons: [{label, value, variant?}]. segmented renders as a connected group.",
639
+ example: {
640
+ buttons: [
641
+ { label: "Back", value: "back", variant: "outline" },
642
+ { label: "Continue", value: "continue", variant: "default" }
643
+ ]
644
+ }
645
+ },
646
+ Input: {
647
+ props: import_zod.z.object({
648
+ label: import_zod.z.string(),
649
+ name: import_zod.z.string(),
650
+ type: import_zod.z.enum(["text", "email", "password", "number", "search", "tel", "url"]).nullable(),
651
+ placeholder: import_zod.z.string().nullable(),
652
+ hint: import_zod.z.string().nullable(),
653
+ value: import_zod.z.string().nullable(),
654
+ required: import_zod.z.boolean().nullable(),
655
+ disabled: import_zod.z.boolean().nullable(),
656
+ checks: validationCheckSchema,
657
+ validateOn: validateOnSchema
658
+ }),
659
+ events: ["submit", "focus", "blur"],
660
+ description: "USWDS text input. Use { $bindState } on value for two-way binding. hint adds helper text below label. Use checks for validation.",
661
+ example: {
662
+ label: "Email address",
663
+ name: "email",
664
+ type: "email",
665
+ hint: "e.g. name@example.gov"
666
+ }
667
+ },
668
+ Textarea: {
669
+ props: import_zod.z.object({
670
+ label: import_zod.z.string(),
671
+ name: import_zod.z.string(),
672
+ placeholder: import_zod.z.string().nullable(),
673
+ hint: import_zod.z.string().nullable(),
674
+ rows: import_zod.z.number().nullable(),
675
+ value: import_zod.z.string().nullable(),
676
+ required: import_zod.z.boolean().nullable(),
677
+ checks: validationCheckSchema,
678
+ validateOn: validateOnSchema
679
+ }),
680
+ description: "USWDS multi-line textarea. Use { $bindState } on value for binding. hint adds helper text below label.",
681
+ example: { label: "Message", name: "message", rows: 4 }
682
+ },
683
+ Select: {
684
+ props: import_zod.z.object({
685
+ label: import_zod.z.string(),
686
+ name: import_zod.z.string(),
687
+ options: import_zod.z.array(
688
+ import_zod.z.union([
689
+ import_zod.z.string(),
690
+ import_zod.z.object({ label: import_zod.z.string(), value: import_zod.z.string() })
691
+ ])
692
+ ),
693
+ placeholder: import_zod.z.string().nullable(),
694
+ hint: import_zod.z.string().nullable(),
695
+ value: import_zod.z.string().nullable(),
696
+ required: import_zod.z.boolean().nullable(),
697
+ checks: validationCheckSchema,
698
+ validateOn: validateOnSchema
699
+ }),
700
+ events: ["change"],
701
+ description: "USWDS select dropdown. options: array of strings or {label, value} objects. Use { $bindState } on value for binding.",
702
+ example: {
703
+ label: "State",
704
+ name: "state",
705
+ options: ["Alabama", "Alaska", "Arizona"]
706
+ }
707
+ },
708
+ Checkbox: {
709
+ props: import_zod.z.object({
710
+ label: import_zod.z.string(),
711
+ name: import_zod.z.string(),
712
+ hint: import_zod.z.string().nullable(),
713
+ checked: import_zod.z.boolean().nullable(),
714
+ tile: import_zod.z.boolean().nullable(),
715
+ checks: validationCheckSchema,
716
+ validateOn: validateOnSchema
717
+ }),
718
+ events: ["change"],
719
+ description: "USWDS checkbox. Use { $bindState } on checked for binding. tile renders as a large tile variant.",
720
+ example: { label: "I agree to the terms", name: "terms" }
721
+ },
722
+ CheckboxGroup: {
723
+ props: import_zod.z.object({
724
+ legend: import_zod.z.string(),
725
+ name: import_zod.z.string(),
726
+ options: import_zod.z.array(
727
+ import_zod.z.object({
728
+ label: import_zod.z.string(),
729
+ value: import_zod.z.string(),
730
+ hint: import_zod.z.string().nullable()
731
+ })
732
+ ),
733
+ tile: import_zod.z.boolean().nullable(),
734
+ values: import_zod.z.array(import_zod.z.string()).nullable()
735
+ }),
736
+ events: ["change"],
737
+ description: "USWDS group of checkboxes in a fieldset. Use { $bindState } on values for selected values array.",
738
+ example: {
739
+ legend: "Select all that apply",
740
+ name: "interests",
741
+ options: [
742
+ { label: "Technology", value: "tech", hint: null },
743
+ { label: "Science", value: "science", hint: null }
744
+ ]
745
+ }
746
+ },
747
+ Radio: {
748
+ props: import_zod.z.object({
749
+ legend: import_zod.z.string(),
750
+ name: import_zod.z.string(),
751
+ options: import_zod.z.array(
752
+ import_zod.z.object({
753
+ label: import_zod.z.string(),
754
+ value: import_zod.z.string(),
755
+ hint: import_zod.z.string().nullable()
756
+ })
757
+ ),
758
+ tile: import_zod.z.boolean().nullable(),
759
+ value: import_zod.z.string().nullable(),
760
+ checks: validationCheckSchema,
761
+ validateOn: validateOnSchema
762
+ }),
763
+ events: ["change"],
764
+ description: "USWDS radio button group. Use { $bindState } on value for binding. tile renders as tile variant.",
765
+ example: {
766
+ legend: "Select an option",
767
+ name: "option",
768
+ options: [
769
+ { label: "Yes", value: "yes", hint: null },
770
+ { label: "No", value: "no", hint: null }
771
+ ]
772
+ }
773
+ },
774
+ FileInput: {
775
+ props: import_zod.z.object({
776
+ label: import_zod.z.string(),
777
+ name: import_zod.z.string(),
778
+ hint: import_zod.z.string().nullable(),
779
+ accept: import_zod.z.string().nullable(),
780
+ multiple: import_zod.z.boolean().nullable(),
781
+ required: import_zod.z.boolean().nullable()
782
+ }),
783
+ events: ["change"],
784
+ description: "USWDS file input. accept: MIME types (e.g. '.pdf,.doc'). multiple allows selecting multiple files.",
785
+ example: {
786
+ label: "Upload document",
787
+ name: "document",
788
+ hint: "Accepted formats: PDF, DOC",
789
+ accept: ".pdf,.doc,.docx"
790
+ }
791
+ },
792
+ Search: {
793
+ props: import_zod.z.object({
794
+ label: import_zod.z.string().nullable(),
795
+ placeholder: import_zod.z.string().nullable(),
796
+ value: import_zod.z.string().nullable(),
797
+ size: import_zod.z.enum(["small", "medium", "big"]).nullable()
798
+ }),
799
+ events: ["submit", "change"],
800
+ description: "USWDS search bar. Use { $bindState } on value for the input value. size: small, medium (default), big.",
801
+ example: { placeholder: "Search...", size: "medium" }
802
+ },
803
+ RangeInput: {
804
+ props: import_zod.z.object({
805
+ label: import_zod.z.string().nullable(),
806
+ name: import_zod.z.string(),
807
+ min: import_zod.z.number().nullable(),
808
+ max: import_zod.z.number().nullable(),
809
+ step: import_zod.z.number().nullable(),
810
+ value: import_zod.z.number().nullable()
811
+ }),
812
+ events: ["change"],
813
+ description: "USWDS range slider input. Use { $bindState } on value for binding.",
814
+ example: { label: "Select a value", name: "range", min: 0, max: 100 }
815
+ },
816
+ DateInputGroup: {
817
+ props: import_zod.z.object({
818
+ label: import_zod.z.string(),
819
+ name: import_zod.z.string(),
820
+ hint: import_zod.z.string().nullable(),
821
+ required: import_zod.z.boolean().nullable(),
822
+ monthValue: import_zod.z.string().nullable(),
823
+ dayValue: import_zod.z.string().nullable(),
824
+ yearValue: import_zod.z.string().nullable()
825
+ }),
826
+ events: ["change"],
827
+ description: "USWDS three-field date input (separate month, day, year inputs). Use { $bindState } on monthValue/dayValue/yearValue for individual field bindings.",
828
+ example: {
829
+ label: "Date of birth",
830
+ name: "dob",
831
+ hint: "For example: January 19 2000"
832
+ }
833
+ },
834
+ DateRangePicker: {
835
+ props: import_zod.z.object({
836
+ startLabel: import_zod.z.string(),
837
+ endLabel: import_zod.z.string(),
838
+ startName: import_zod.z.string(),
839
+ endName: import_zod.z.string(),
840
+ hint: import_zod.z.string().nullable(),
841
+ startValue: import_zod.z.string().nullable(),
842
+ endValue: import_zod.z.string().nullable(),
843
+ minDate: import_zod.z.string().nullable(),
844
+ maxDate: import_zod.z.string().nullable(),
845
+ required: import_zod.z.boolean().nullable()
846
+ }),
847
+ events: ["change"],
848
+ description: "USWDS date range picker with start and end date inputs. Values are ISO date strings (YYYY-MM-DD). Use { $bindState } on startValue/endValue.",
849
+ example: {
850
+ startLabel: "Start date",
851
+ endLabel: "End date",
852
+ startName: "start_date",
853
+ endName: "end_date",
854
+ hint: "mm/dd/yyyy"
855
+ }
856
+ },
857
+ InputMask: {
858
+ props: import_zod.z.object({
859
+ label: import_zod.z.string(),
860
+ name: import_zod.z.string(),
861
+ preset: import_zod.z.enum(["phone", "zip", "zip+4", "ssn", "custom"]).nullable(),
862
+ pattern: import_zod.z.string().nullable(),
863
+ hint: import_zod.z.string().nullable(),
864
+ value: import_zod.z.string().nullable(),
865
+ required: import_zod.z.boolean().nullable(),
866
+ checks: validationCheckSchema,
867
+ validateOn: validateOnSchema
868
+ }),
869
+ events: ["change", "blur"],
870
+ description: "USWDS input with automatic formatting mask. preset: phone '(___) ___-____', zip '_____', zip+4 '_____-____', ssn '___-__-____'. Or supply a custom pattern where '_' = digit.",
871
+ example: {
872
+ label: "Phone number",
873
+ name: "phone",
874
+ preset: "phone",
875
+ hint: "(___) ___-____"
876
+ }
877
+ },
878
+ Password: {
879
+ props: import_zod.z.object({
880
+ label: import_zod.z.string(),
881
+ name: import_zod.z.string(),
882
+ hint: import_zod.z.string().nullable(),
883
+ value: import_zod.z.string().nullable(),
884
+ required: import_zod.z.boolean().nullable(),
885
+ checks: validationCheckSchema,
886
+ validateOn: validateOnSchema
887
+ }),
888
+ events: ["change", "blur"],
889
+ description: "USWDS password input with show/hide toggle button. Use { $bindState } on value for binding. Supports validation checks.",
890
+ example: {
891
+ label: "Password",
892
+ name: "password",
893
+ hint: "Must be at least 12 characters"
894
+ }
895
+ },
896
+ ComboBox: {
897
+ props: import_zod.z.object({
898
+ label: import_zod.z.string(),
899
+ name: import_zod.z.string(),
900
+ options: import_zod.z.array(
901
+ import_zod.z.union([
902
+ import_zod.z.string(),
903
+ import_zod.z.object({ label: import_zod.z.string(), value: import_zod.z.string() })
904
+ ])
905
+ ),
906
+ placeholder: import_zod.z.string().nullable(),
907
+ hint: import_zod.z.string().nullable(),
908
+ value: import_zod.z.string().nullable(),
909
+ required: import_zod.z.boolean().nullable(),
910
+ checks: validationCheckSchema,
911
+ validateOn: validateOnSchema
912
+ }),
913
+ events: ["change"],
914
+ description: "USWDS combo box \u2014 a searchable/filterable select dropdown. options: strings or {label, value}. Use { $bindState } on value for binding.",
915
+ example: {
916
+ label: "Select a fruit",
917
+ name: "fruit",
918
+ options: ["Apple", "Banana", "Cherry", "Date", "Elderberry"],
919
+ placeholder: "- Select -"
920
+ }
921
+ },
922
+ DatePicker: {
923
+ props: import_zod.z.object({
924
+ label: import_zod.z.string(),
925
+ name: import_zod.z.string(),
926
+ hint: import_zod.z.string().nullable(),
927
+ value: import_zod.z.string().nullable(),
928
+ minDate: import_zod.z.string().nullable(),
929
+ maxDate: import_zod.z.string().nullable(),
930
+ required: import_zod.z.boolean().nullable(),
931
+ checks: validationCheckSchema,
932
+ validateOn: validateOnSchema
933
+ }),
934
+ events: ["change"],
935
+ description: "USWDS date picker. value/minDate/maxDate are ISO date strings (YYYY-MM-DD). Use { $bindState } on value for binding.",
936
+ example: {
937
+ label: "Date of birth",
938
+ name: "dob",
939
+ hint: "mm/dd/yyyy"
940
+ }
941
+ },
942
+ TimePicker: {
943
+ props: import_zod.z.object({
944
+ label: import_zod.z.string(),
945
+ name: import_zod.z.string(),
946
+ hint: import_zod.z.string().nullable(),
947
+ value: import_zod.z.string().nullable(),
948
+ minTime: import_zod.z.string().nullable(),
949
+ maxTime: import_zod.z.string().nullable(),
950
+ step: import_zod.z.number().nullable(),
951
+ required: import_zod.z.boolean().nullable()
952
+ }),
953
+ events: ["change"],
954
+ description: "USWDS time picker. value/minTime/maxTime use 'HH:MM' 24-hour format. step is in minutes (default 30). Use { $bindState } on value.",
955
+ example: {
956
+ label: "Appointment time",
957
+ name: "appt_time",
958
+ hint: "Select a time",
959
+ step: 30
960
+ }
961
+ },
962
+ CharacterCount: {
963
+ props: import_zod.z.object({
964
+ label: import_zod.z.string(),
965
+ name: import_zod.z.string(),
966
+ maxLength: import_zod.z.number(),
967
+ hint: import_zod.z.string().nullable(),
968
+ value: import_zod.z.string().nullable(),
969
+ multiline: import_zod.z.boolean().nullable(),
970
+ rows: import_zod.z.number().nullable(),
971
+ required: import_zod.z.boolean().nullable(),
972
+ checks: validationCheckSchema,
973
+ validateOn: validateOnSchema
974
+ }),
975
+ events: ["change"],
976
+ description: "USWDS input or textarea with a live character count indicator. maxLength: character limit. multiline: renders as textarea. Use { $bindState } on value.",
977
+ example: {
978
+ label: "Brief description",
979
+ name: "description",
980
+ maxLength: 150,
981
+ hint: "Enter a short summary",
982
+ multiline: true
983
+ }
984
+ },
985
+ // ==========================================================================
986
+ // Overlay / Modal Components
987
+ // ==========================================================================
988
+ Modal: {
989
+ props: import_zod.z.object({
990
+ heading: import_zod.z.string(),
991
+ description: import_zod.z.string().nullable(),
992
+ openPath: import_zod.z.string(),
993
+ large: import_zod.z.boolean().nullable()
994
+ }),
995
+ slots: ["default"],
996
+ description: "USWDS modal dialog. Set openPath to a boolean state path. Use setState to toggle open/close.",
997
+ example: {
998
+ heading: "Are you sure?",
999
+ description: "This action cannot be undone.",
1000
+ openPath: "/modal/open"
1001
+ }
1002
+ },
1003
+ // ==========================================================================
1004
+ // Additional Display Components
1005
+ // ==========================================================================
1006
+ Icon: {
1007
+ props: import_zod.z.object({
1008
+ name: import_zod.z.string(),
1009
+ size: import_zod.z.enum(["sm", "md", "lg", "xl", "2xl", "3xl"]).nullable(),
1010
+ color: import_zod.z.string().nullable(),
1011
+ ariaLabel: import_zod.z.string().nullable()
1012
+ }),
1013
+ description: "USWDS standalone SVG icon from the USWDS icon set. name: USWDS icon name (e.g. 'check', 'close', 'search', 'arrow_forward'). size: sm\u20133xl. color: a USWDS text-color utility class (e.g. 'text-primary').",
1014
+ example: { name: "check_circle", size: "lg", color: "text-green" }
1015
+ },
1016
+ InputGroup: {
1017
+ props: import_zod.z.object({
1018
+ label: import_zod.z.string(),
1019
+ name: import_zod.z.string(),
1020
+ type: import_zod.z.enum(["text", "email", "password", "number", "search", "tel", "url"]).nullable(),
1021
+ prefix: import_zod.z.string().nullable(),
1022
+ suffix: import_zod.z.string().nullable(),
1023
+ placeholder: import_zod.z.string().nullable(),
1024
+ hint: import_zod.z.string().nullable(),
1025
+ value: import_zod.z.string().nullable(),
1026
+ required: import_zod.z.boolean().nullable(),
1027
+ disabled: import_zod.z.boolean().nullable(),
1028
+ checks: validationCheckSchema,
1029
+ validateOn: validateOnSchema
1030
+ }),
1031
+ events: ["change", "blur"],
1032
+ description: "USWDS input group \u2014 a text input with an optional prefix and/or suffix add-on (e.g. currency symbol, unit label). Use { $bindState } on value for two-way binding.",
1033
+ example: {
1034
+ label: "Amount",
1035
+ name: "amount",
1036
+ prefix: "$",
1037
+ suffix: ".00",
1038
+ type: "number",
1039
+ placeholder: "0"
1040
+ }
1041
+ },
1042
+ List: {
1043
+ props: import_zod.z.object({
1044
+ items: import_zod.z.array(import_zod.z.string()),
1045
+ variant: import_zod.z.enum(["unordered", "ordered", "unstyled"]).nullable()
1046
+ }),
1047
+ description: "USWDS list. variant: unordered (default, bullet list), ordered (numbered list), unstyled (no bullets/numbers).",
1048
+ example: {
1049
+ variant: "unordered",
1050
+ items: ["First item", "Second item", "Third item"]
1051
+ }
1052
+ },
1053
+ ValidationChecklist: {
1054
+ props: import_zod.z.object({
1055
+ items: import_zod.z.array(
1056
+ import_zod.z.object({
1057
+ label: import_zod.z.string(),
1058
+ checked: import_zod.z.boolean().nullable()
1059
+ })
1060
+ ),
1061
+ heading: import_zod.z.string().nullable()
1062
+ }),
1063
+ description: "USWDS validation checklist (usa-checklist). Displays a list of password/input requirements with checked/unchecked states.",
1064
+ example: {
1065
+ heading: "Password must contain:",
1066
+ items: [
1067
+ { label: "At least 12 characters", checked: true },
1068
+ { label: "At least one uppercase letter", checked: false },
1069
+ { label: "At least one number", checked: false }
1070
+ ]
1071
+ }
1072
+ },
1073
+ Prose: {
1074
+ props: import_zod.z.object({
1075
+ element: import_zod.z.enum(["div", "article", "section", "main"]).nullable()
1076
+ }),
1077
+ slots: ["default"],
1078
+ description: "USWDS prose typography wrapper (usa-prose). Applies USWDS text styles \u2014 headings, paragraphs, lists, links, blockquotes, code blocks \u2014 to nested content. element: div (default), article, section, or main.",
1079
+ example: { element: "article" }
1080
+ },
1081
+ Hero: {
1082
+ props: import_zod.z.object({
1083
+ heading: import_zod.z.string(),
1084
+ eyebrow: import_zod.z.string().nullable(),
1085
+ body: import_zod.z.string().nullable(),
1086
+ backgroundUrl: import_zod.z.string().nullable(),
1087
+ ariaLabel: import_zod.z.string().nullable()
1088
+ }),
1089
+ description: "USWDS hero section \u2014 full-width landing page callout with optional background image. heading: headline text. eyebrow: smaller label above the headline. body: supporting paragraph. backgroundUrl: CSS background image URL (user-supplied).",
1090
+ example: {
1091
+ heading: "A tagline that explains your agency\u2019s focus",
1092
+ eyebrow: null,
1093
+ body: "Support the text about your agency with a brief, relevant sentence or two.",
1094
+ backgroundUrl: null,
1095
+ ariaLabel: "Introduction"
1096
+ }
1097
+ },
1098
+ GraphicList: {
1099
+ props: import_zod.z.object({
1100
+ heading: import_zod.z.string().nullable(),
1101
+ items: import_zod.z.array(
1102
+ import_zod.z.object({
1103
+ imageUrl: import_zod.z.string().nullable(),
1104
+ imageAlt: import_zod.z.string().nullable(),
1105
+ heading: import_zod.z.string(),
1106
+ content: import_zod.z.string()
1107
+ })
1108
+ )
1109
+ }),
1110
+ description: "USWDS graphic list \u2014 a responsive grid of image+text media blocks for showcasing values, programs, or features. items: [{imageUrl?, imageAlt?, heading, content}].",
1111
+ example: {
1112
+ heading: null,
1113
+ items: [
1114
+ {
1115
+ imageUrl: null,
1116
+ imageAlt: null,
1117
+ heading: "Graphic heading",
1118
+ content: "A short description of what this item represents."
1119
+ },
1120
+ {
1121
+ imageUrl: null,
1122
+ imageAlt: null,
1123
+ heading: "Graphic heading",
1124
+ content: "A short description of what this item represents."
1125
+ }
1126
+ ]
1127
+ }
1128
+ },
1129
+ EmbedContainer: {
1130
+ props: import_zod.z.object({
1131
+ src: import_zod.z.string(),
1132
+ title: import_zod.z.string(),
1133
+ ratio: import_zod.z.enum(["16x9", "4x3"]).nullable()
1134
+ }),
1135
+ description: "USWDS embed container \u2014 a responsive aspect-ratio wrapper for iframe embeds such as YouTube videos. ratio: 16x9 (default) or 4x3. Provide a descriptive title for accessibility.",
1136
+ example: {
1137
+ src: "https://www.youtube.com/embed/example",
1138
+ title: "An example video",
1139
+ ratio: "16x9"
1140
+ }
1141
+ },
1142
+ Form: {
1143
+ props: import_zod.z.object({
1144
+ large: import_zod.z.boolean().nullable()
1145
+ }),
1146
+ slots: ["default"],
1147
+ events: ["submit"],
1148
+ description: "USWDS form container (usa-form). Applies USWDS form layout \u2014 constrained max-width and consistent label/input spacing \u2014 to nested form elements. large: wider form variant. Wrap Input, Select, Checkbox, Radio, and other form components as children.",
1149
+ example: { large: false }
1150
+ },
1151
+ Section: {
1152
+ props: import_zod.z.object({
1153
+ title: import_zod.z.string().nullable(),
1154
+ text: import_zod.z.string().nullable(),
1155
+ variant: import_zod.z.enum(["default", "light", "dark"]).nullable()
1156
+ }),
1157
+ slots: ["default"],
1158
+ description: "USWDS page section (usa-section). Applies consistent vertical padding to a full-width page section inside a grid-container. variant: default, light (lighter background), dark (darker background). title and text are optional \u2014 use children slots for richer content.",
1159
+ example: {
1160
+ title: "Section title",
1161
+ text: "Supporting section description text.",
1162
+ variant: null
1163
+ }
1164
+ }
1165
+ };
1166
+ // Annotate the CommonJS export names for ESM import in node:
1167
+ 0 && (module.exports = {
1168
+ uswdsComponentDefinitions
1169
+ });
1170
+ //# sourceMappingURL=catalog.js.map