@solexllc/usx-react 0.3.1 → 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.
Files changed (135) hide show
  1. package/README.md +132 -0
  2. package/dist/index.cjs +504 -450
  3. package/dist/index.js +504 -450
  4. package/package.json +6 -5
  5. package/src/assets.ts +16 -0
  6. package/src/components/alert/Alert.tsx +4 -3
  7. package/src/components/alert/alert.django.html +2 -3
  8. package/src/components/alert/config.json +15 -4
  9. package/src/components/attribution/config.json +5 -5
  10. package/src/components/banner/Banner.tsx +8 -6
  11. package/src/components/banner/banner.django.html +4 -5
  12. package/src/components/banner/config.json +7 -3
  13. package/src/components/breadcrumb/Breadcrumb.tsx +5 -6
  14. package/src/components/breadcrumb/config.json +11 -1
  15. package/src/components/button/Button.tsx +1 -1
  16. package/src/components/button/button.django.html +2 -2
  17. package/src/components/button/button.html +2 -2
  18. package/src/components/button/config.json +14 -6
  19. package/src/components/button-group/button-group.django.html +1 -1
  20. package/src/components/calendar-date/calendar-date.django.html +3 -3
  21. package/src/components/callout/Callout.tsx +53 -0
  22. package/src/components/callout/callout.django.html +5 -0
  23. package/src/components/callout/callout.html +76 -0
  24. package/src/components/callout/config.json +74 -0
  25. package/src/components/card/Card.tsx +18 -34
  26. package/src/components/card/card.django.html +12 -10
  27. package/src/components/card/config.json +15 -40
  28. package/src/components/card-group/card-group.django.html +1 -1
  29. package/src/components/carousel/Carousel.tsx +3 -2
  30. package/src/components/carousel/carousel.django.html +13 -2
  31. package/src/components/carousel/config.json +2 -2
  32. package/src/components/character-count/config.json +2 -2
  33. package/src/components/checkbox-group/CheckboxGroup.tsx +10 -20
  34. package/src/components/checkbox-group/checkbox-group.django.html +10 -4
  35. package/src/components/checkbox-group/config.json +10 -5
  36. package/src/components/clickable/clickable.html +21 -39
  37. package/src/components/clickable/config.json +2 -2
  38. package/src/components/code/Code.tsx +4 -27
  39. package/src/components/code/code.django.html +3 -9
  40. package/src/components/code/config.json +4 -0
  41. package/src/components/collection/Collection.tsx +5 -5
  42. package/src/components/collection/collection.django.html +2 -4
  43. package/src/components/collection/config.json +7 -6
  44. package/src/components/combobox/config.json +4 -4
  45. package/src/components/copy-to-clipboard/CopyToClipboard.tsx +35 -24
  46. package/src/components/copy-to-clipboard/config.json +14 -7
  47. package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +14 -14
  48. package/src/components/date-picker/config.json +4 -4
  49. package/src/components/date-range-picker/config.json +7 -7
  50. package/src/components/error-message/config.json +2 -2
  51. package/src/components/eyebrow/Eyebrow.tsx +2 -1
  52. package/src/components/eyebrow/config.json +2 -2
  53. package/src/components/fieldset/config.json +5 -5
  54. package/src/components/file-input/FileInput.tsx +3 -2
  55. package/src/components/file-input/config.json +5 -5
  56. package/src/components/file-list/FileList.tsx +2 -1
  57. package/src/components/file-list/config.json +2 -2
  58. package/src/components/footer/Footer.tsx +31 -11
  59. package/src/components/footer/config.json +4 -0
  60. package/src/components/footer/footer.django.html +10 -9
  61. package/src/components/form-group/config.json +2 -2
  62. package/src/components/header/Branding.tsx +9 -6
  63. package/src/components/header/Header.tsx +3 -1
  64. package/src/components/header/config.json +4 -0
  65. package/src/components/header/header.django.html +5 -26
  66. package/src/components/header/header.html +10 -10
  67. package/src/components/hero/Hero.tsx +8 -14
  68. package/src/components/hero/config.json +36 -27
  69. package/src/components/hero/hero.django.html +2 -2
  70. package/src/components/hint/config.json +2 -2
  71. package/src/components/icon/Icon.tsx +6 -3
  72. package/src/components/icon/config.json +12 -6
  73. package/src/components/icon/icon.django.html +6 -4
  74. package/src/components/image/Image.tsx +8 -4
  75. package/src/components/image/config.json +10 -2
  76. package/src/components/image/image.django.html +8 -6
  77. package/src/components/in-page-nav/config.json +11 -1
  78. package/src/components/indicator/config.json +2 -2
  79. package/src/components/input/config.json +2 -2
  80. package/src/components/label/config.json +2 -2
  81. package/src/components/language-selector/config.json +2 -2
  82. package/src/components/layout/Layout.tsx +1 -1
  83. package/src/components/layout/config.json +9 -9
  84. package/src/components/layout/layout.django.html +1 -1
  85. package/src/components/legend/config.json +3 -3
  86. package/src/components/link/config.json +2 -2
  87. package/src/components/memorable-date/config.json +9 -9
  88. package/src/components/misc-banner/MiscBanner.tsx +2 -1
  89. package/src/components/misc-banner/config.json +2 -2
  90. package/src/components/modal/config.json +2 -2
  91. package/src/components/page/Page.tsx +2 -1
  92. package/src/components/page/config.json +7 -7
  93. package/src/components/page/page.django.html +1 -1
  94. package/src/components/pagination/Pagination.tsx +2 -1
  95. package/src/components/pagination/container/PaginationContainer.tsx +2 -1
  96. package/src/components/prose/config.json +5 -1
  97. package/src/components/quote/Quote.tsx +58 -0
  98. package/src/components/quote/config.json +51 -0
  99. package/src/components/quote/quote.django.html +15 -0
  100. package/src/components/quote/quote.html +66 -0
  101. package/src/components/radio-buttons/config.json +3 -3
  102. package/src/components/range-slider/RangeSlider.tsx +2 -1
  103. package/src/components/range-slider/config.json +4 -4
  104. package/src/components/required/config.json +2 -2
  105. package/src/components/section/Section.tsx +6 -2
  106. package/src/components/section/config.json +19 -6
  107. package/src/components/section/section.django.html +9 -2
  108. package/src/components/select/config.json +2 -2
  109. package/src/components/site-alert/SiteAlert.tsx +5 -6
  110. package/src/components/skipnav/config.json +2 -2
  111. package/src/components/spinner/Spinner.tsx +18 -25
  112. package/src/components/spinner/config.json +4 -0
  113. package/src/components/spinner/spinner.django.html +4 -6
  114. package/src/components/summary-box/config.json +3 -3
  115. package/src/components/swap/Swap.tsx +4 -3
  116. package/src/components/swap/config.json +4 -4
  117. package/src/components/switch/config.json +2 -2
  118. package/src/components/table/config.json +13 -3
  119. package/src/components/tag/config.json +2 -2
  120. package/src/components/tag-group/config.json +2 -2
  121. package/src/components/text-area/config.json +2 -2
  122. package/src/components/time-picker/config.json +4 -4
  123. package/src/components/toggle/Toggle.tsx +69 -40
  124. package/src/components/toggle/config.json +42 -10
  125. package/src/components/toggle/toggle.django.html +25 -17
  126. package/src/components/toggle/toggle.html +319 -85
  127. package/src/components/tooltip/Tooltip.tsx +4 -2
  128. package/src/components/tooltip/config.json +9 -4
  129. package/src/components/tooltip/tooltip.django.html +1 -1
  130. package/src/components/villain/Villain.tsx +2 -1
  131. package/src/index.js +2 -1
  132. package/src/components/block/Block.tsx +0 -78
  133. package/src/components/block/block.django.html +0 -26
  134. package/src/components/block/block.html +0 -162
  135. package/src/components/block/config.json +0 -88
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ function requireClassnames() {
16
16
  (function(module) {
17
17
  (function() {
18
18
  var hasOwn = {}.hasOwnProperty;
19
- function classNames2() {
19
+ function classNames() {
20
20
  var classes = "";
21
21
  for (var i = 0; i < arguments.length; i++) {
22
22
  var arg = arguments[i];
@@ -34,7 +34,7 @@ function requireClassnames() {
34
34
  return "";
35
35
  }
36
36
  if (Array.isArray(arg)) {
37
- return classNames2.apply(null, arg);
37
+ return classNames.apply(null, arg);
38
38
  }
39
39
  if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
40
40
  return arg.toString();
@@ -57,17 +57,17 @@ function requireClassnames() {
57
57
  return value + newClass;
58
58
  }
59
59
  if (module.exports) {
60
- classNames2.default = classNames2;
61
- module.exports = classNames2;
60
+ classNames.default = classNames;
61
+ module.exports = classNames;
62
62
  } else {
63
- window.classNames = classNames2;
63
+ window.classNames = classNames;
64
64
  }
65
65
  })();
66
66
  })(classnames);
67
67
  return classnames.exports;
68
68
  }
69
69
  var classnamesExports = requireClassnames();
70
- const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
70
+ const ClassNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
71
71
  function AccordionItem({
72
72
  title,
73
73
  id,
@@ -78,8 +78,8 @@ function AccordionItem({
78
78
  headingLevel = "h3",
79
79
  handleToggle
80
80
  }) {
81
- const headingClasses = classNames("usa-accordion__heading", headingClassName);
82
- const contentClasses = classNames(
81
+ const headingClasses = ClassNames("usa-accordion__heading", headingClassName);
82
+ const contentClasses = ClassNames(
83
83
  "usa-accordion__content",
84
84
  "usa-prose",
85
85
  contentClassName
@@ -123,7 +123,7 @@ function Accordion({
123
123
  contentClassName = "",
124
124
  ...props
125
125
  }) {
126
- const accordionClasses = classNames(
126
+ const accordionClasses = ClassNames(
127
127
  "usa-accordion",
128
128
  "usx-accordion",
129
129
  bordered && "usa-accordion--bordered",
@@ -150,6 +150,39 @@ function Accordion({
150
150
  }
151
151
  );
152
152
  }
153
+ function getAssetUrl(assetPath, staticBaseUrl) {
154
+ if (/^[a-z][a-z\d+.-]*:/i.test(assetPath)) return assetPath;
155
+ const base = staticBaseUrl || typeof window !== "undefined" && window.usxBaseUrl || "/";
156
+ return `${base.replace(/\/+$/, "")}/${assetPath.replace(/^\/+/, "")}`;
157
+ }
158
+ function getAssetSrcSet(srcSet, staticBaseUrl) {
159
+ return srcSet.replace(/(^\s*|,\s*)(\S*[^,\s])(?=,?(?:\s|$))/g, (_match, separator, url) => `${separator}${getAssetUrl(url, staticBaseUrl)}`);
160
+ }
161
+ function Icon({
162
+ name,
163
+ source = "uswds",
164
+ size = 2,
165
+ color,
166
+ alt = name + " icon",
167
+ staticBaseUrl,
168
+ staticUrlPrefix,
169
+ className = "",
170
+ ...props
171
+ }) {
172
+ const spritePrefix = staticUrlPrefix ?? getAssetUrl(`img/${source === "usx" ? "usx-sprite.svg" : "sprite.svg"}#`, staticBaseUrl);
173
+ return /* @__PURE__ */ jsx(
174
+ "svg",
175
+ {
176
+ className: "usa-icon " + (size ? size === 1 ? "usx-icon--size-1" : "usa-icon--size-" + size : "") + " " + (color ? "text-" + color : "") + " " + className,
177
+ "aria-hidden": "true",
178
+ "aria-label": alt,
179
+ focusable: "false",
180
+ role: "img",
181
+ ...props,
182
+ children: /* @__PURE__ */ jsx("use", { href: spritePrefix + name })
183
+ }
184
+ );
185
+ }
153
186
  function Alert({
154
187
  heading,
155
188
  text,
@@ -161,11 +194,12 @@ function Alert({
161
194
  ariaLabel,
162
195
  ariaLabelledby,
163
196
  onDismiss = void 0,
197
+ staticBaseUrl,
164
198
  children = null,
165
199
  ...props
166
200
  }) {
167
201
  const normalizedVariant = variant && ["info", "warning", "success", "error", "emergency"].includes(variant) ? variant : null;
168
- const classes = classNames(
202
+ const classes = ClassNames(
169
203
  "usa-alert",
170
204
  "usx-alert",
171
205
  normalizedVariant ? `usa-alert--${normalizedVariant}` : "",
@@ -187,32 +221,9 @@ function Alert({
187
221
  return /* @__PURE__ */ jsx("div", { className: classes, ...accessibilityProps, ...props, children: /* @__PURE__ */ jsxs("div", { className: "usa-alert__body", children: [
188
222
  !slim && heading ? /* @__PURE__ */ jsx("h4", { className: "usa-alert__heading", children: heading }) : null,
189
223
  children ? /* @__PURE__ */ jsx("div", { className: "usa-alert__text", children }) : /* @__PURE__ */ jsx("p", { className: "usa-alert__text", children: text }),
190
- onDismiss && /* @__PURE__ */ jsx("button", { className: "usx-alert__dismiss", "aria-label": "Dismiss alert", onClick: onDismiss, children: /* @__PURE__ */ jsx("svg", { className: "usa-icon usa-icon--size-3", "aria-hidden": "true", focusable: "false", role: "img", children: /* @__PURE__ */ jsx("use", { href: "./img/sprite.svg#close" }) }) })
224
+ onDismiss && /* @__PURE__ */ jsx("button", { className: "usx-alert__dismiss", "aria-label": "Dismiss alert", onClick: onDismiss, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 3, staticBaseUrl }) })
191
225
  ] }) });
192
226
  }
193
- function Icon({
194
- name,
195
- source = "uswds",
196
- size = 2,
197
- color,
198
- alt = name + " icon",
199
- staticUrlPrefix = (typeof window !== "undefined" && window.usxBaseUrl || "/") + "img/" + (source === "usx" ? "usx-sprite.svg" : "sprite.svg") + "#",
200
- className = "",
201
- ...props
202
- }) {
203
- return /* @__PURE__ */ jsx(
204
- "svg",
205
- {
206
- className: "usa-icon " + (size ? size === 1 ? "usx-icon--size-1" : "usa-icon--size-" + size : "") + " " + (color ? "text-" + color : "") + " " + className,
207
- "aria-hidden": "true",
208
- "aria-label": alt,
209
- focusable: "false",
210
- role: "img",
211
- ...props,
212
- children: /* @__PURE__ */ jsx("use", { href: staticUrlPrefix + name })
213
- }
214
- );
215
- }
216
227
  const shapeClassMap = {
217
228
  circle: "usx-circle",
218
229
  "rounded-sm": "usx-rounded-sm",
@@ -235,16 +246,16 @@ function Avatar({
235
246
  }) {
236
247
  const isInitialsVariant = variant === "initials";
237
248
  const isIconVariant = variant === "icon";
238
- const wrapperClasses = classNames(
249
+ const wrapperClasses = ClassNames(
239
250
  "usx-avatar",
240
251
  className
241
252
  );
242
- const imgClasses = classNames(
253
+ const imgClasses = ClassNames(
243
254
  "usx-avatar__img",
244
255
  shape ? shapeClassMap[shape] : null,
245
256
  imageClassName
246
257
  );
247
- const contentClasses = classNames(
258
+ const contentClasses = ClassNames(
248
259
  "usx-avatar__content",
249
260
  shape ? shapeClassMap[shape] : "usx-circle",
250
261
  contentClassName
@@ -268,7 +279,7 @@ function Attribution({
268
279
  className = "",
269
280
  ...props
270
281
  }) {
271
- const classes = classNames("usx-attribution", className);
282
+ const classes = ClassNames("usx-attribution", className);
272
283
  const mediaContent = avatarProps ? /* @__PURE__ */ jsx(Avatar, { ...avatarProps }) : media;
273
284
  const content = children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
274
285
  mediaContent && /* @__PURE__ */ jsx("span", { className: "usx-attribution__media", children: mediaContent }),
@@ -280,7 +291,7 @@ function Attribution({
280
291
  return /* @__PURE__ */ jsx("div", { className: classes, ...props, children: content });
281
292
  }
282
293
  function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, className = "", ...props }) {
283
- const classes = classNames(
294
+ const classes = ClassNames(
284
295
  "usx-avatar-group",
285
296
  overlap && "usa-avatar-group--overlap",
286
297
  stacked && "usa-avatar-group--stacked",
@@ -312,11 +323,11 @@ function BackToTop({
312
323
  onClick = void 0,
313
324
  ...props
314
325
  }) {
315
- const icon = /* @__PURE__ */ jsx(Icon, { name: "arrow_upward", size: iconSize, className: classNames(
326
+ const icon = /* @__PURE__ */ jsx(Icon, { name: "arrow_upward", size: iconSize, className: ClassNames(
316
327
  iconPosition === "left" ? "margin-right-05" : "margin-left-05"
317
328
  ) });
318
329
  if (href) {
319
- const linkClasses = classNames(
330
+ const linkClasses = ClassNames(
320
331
  "usx-link",
321
332
  "usx-no-visited",
322
333
  "flex-align-center",
@@ -328,7 +339,7 @@ function BackToTop({
328
339
  iconPosition === "right" && icon
329
340
  ] });
330
341
  }
331
- const buttonClasses = classNames(
342
+ const buttonClasses = ClassNames(
332
343
  "usa-button",
333
344
  "usx-button",
334
345
  variant === "primary" && "usa-button--primary",
@@ -353,7 +364,8 @@ function BackToTop({
353
364
  function Banner({
354
365
  id = "gov-banner",
355
366
  ariaLabel = "Official government website",
356
- flagSrc = (typeof window !== "undefined" && window.usxBaseUrl || "/") + "img/us_flag_small.png",
367
+ flagSrc,
368
+ staticBaseUrl,
357
369
  tld = ".gov",
358
370
  bannerText = "An official website of the United States government",
359
371
  bannerActionText = "Here's how you know",
@@ -364,7 +376,7 @@ function Banner({
364
376
  "A ",
365
377
  /* @__PURE__ */ jsx("strong", { children: "lock" }),
366
378
  " (",
367
- /* @__PURE__ */ jsx(Icon, { name: "lock", size: 1 }),
379
+ /* @__PURE__ */ jsx(Icon, { name: "lock", size: 1, staticBaseUrl }),
368
380
  ") or ",
369
381
  /* @__PURE__ */ jsx("strong", { children: "https://" }),
370
382
  " means you’ve safely connected to the ",
@@ -374,8 +386,7 @@ function Banner({
374
386
  className = "",
375
387
  ...props
376
388
  }) {
377
- const assetBaseUrl = typeof window !== "undefined" && window.usxBaseUrl || "/";
378
- const classes = classNames(
389
+ const classes = ClassNames(
379
390
  "usa-banner",
380
391
  "usx-banner",
381
392
  className
@@ -387,7 +398,7 @@ function Banner({
387
398
  {
388
399
  "aria-hidden": "true",
389
400
  className: "usa-banner__header-flag",
390
- src: flagSrc,
401
+ src: getAssetUrl(flagSrc ?? "img/us_flag_small.png", staticBaseUrl),
391
402
  alt: ""
392
403
  }
393
404
  ) }),
@@ -425,7 +436,7 @@ function Banner({
425
436
  "img",
426
437
  {
427
438
  className: "usa-banner__icon usa-media-block__img",
428
- src: `${assetBaseUrl}img/icon-dot-gov.svg`,
439
+ src: getAssetUrl("img/icon-dot-gov.svg", staticBaseUrl),
429
440
  role: "img",
430
441
  alt: "",
431
442
  "aria-hidden": "true"
@@ -442,7 +453,7 @@ function Banner({
442
453
  "img",
443
454
  {
444
455
  className: "usa-banner__icon usa-media-block__img",
445
- src: `${assetBaseUrl}img/icon-https.svg`,
456
+ src: getAssetUrl("img/icon-https.svg", staticBaseUrl),
446
457
  role: "img",
447
458
  alt: "",
448
459
  "aria-hidden": "true"
@@ -459,50 +470,6 @@ function Banner({
459
470
  )
460
471
  ] }) });
461
472
  }
462
- function Block({
463
- variant = null,
464
- indent = null,
465
- dedent = false,
466
- big = false,
467
- quote = false,
468
- color,
469
- contentClassName = "",
470
- attribution = null,
471
- children = null,
472
- className = "",
473
- ...props
474
- }) {
475
- const isCallout = variant === "callout";
476
- const classes = classNames(
477
- "usx-block",
478
- variant && `usx-block--${variant}`,
479
- dedent && "usx-block--dedent",
480
- indent && `usx-block--indent-${indent}`,
481
- big && "usx-block--big",
482
- quote && !isCallout && "display-flex flex-row",
483
- isCallout && color && `usx-border-${color}`,
484
- className
485
- );
486
- const contentClasses = classNames(
487
- "usx-block__content",
488
- !isCallout && color && `usx-border-${color}`,
489
- contentClassName
490
- );
491
- const attributionNode = attribution ? /* @__PURE__ */ jsx("div", { className: "usx-block__attribution", children: /* @__PURE__ */ jsx(Attribution, { ...attribution }) }) : null;
492
- if (quote && !isCallout) {
493
- return /* @__PURE__ */ jsxs("div", { className: classes, ...props, children: [
494
- /* @__PURE__ */ jsx(Icon, { name: "format_quote", size: 4, className: "usx-block__open-quote-icon" }),
495
- /* @__PURE__ */ jsxs("div", { className: contentClasses, children: [
496
- children,
497
- attributionNode
498
- ] })
499
- ] });
500
- }
501
- return /* @__PURE__ */ jsxs("div", { className: classes, ...props, children: [
502
- /* @__PURE__ */ jsx("div", { className: contentClasses, children }),
503
- attributionNode
504
- ] });
505
- }
506
473
  function Breadcrumb({
507
474
  items = null,
508
475
  wrap = false,
@@ -514,16 +481,16 @@ function Breadcrumb({
514
481
  ...props
515
482
  }) {
516
483
  if (!items || items.length === 0) {
517
- const classes = ["usx-breadcrumb", className].filter(Boolean).join(" ");
484
+ const classes = ClassNames("usx-breadcrumb", className);
518
485
  return /* @__PURE__ */ jsx("div", { className: classes, ...props, children: children || "Breadcrumb" });
519
486
  }
520
- const navClasses = [
487
+ const navClasses = ClassNames(
521
488
  "usa-breadcrumb",
522
489
  "usx-breadcrumb",
523
490
  wrap ? "usa-breadcrumb--wrap" : null,
524
491
  truncate ? "usa-breadcrumb--truncate" : null,
525
492
  className
526
- ].filter(Boolean).join(" ");
493
+ );
527
494
  return /* @__PURE__ */ jsx("nav", { className: navClasses, "aria-label": ariaLabel, ...props, children: /* @__PURE__ */ jsx(
528
495
  "ol",
529
496
  {
@@ -531,7 +498,7 @@ function Breadcrumb({
531
498
  ...rdfa ? { vocab: "http://schema.org/", typeof: "BreadcrumbList" } : {},
532
499
  children: items.map((item, idx) => {
533
500
  const isCurrent = !!item.current;
534
- const liClass = ["usa-breadcrumb__list-item", isCurrent ? "usa-current" : null].filter(Boolean).join(" ");
501
+ const liClass = ClassNames("usa-breadcrumb__list-item", isCurrent ? "usa-current" : null);
535
502
  return /* @__PURE__ */ jsxs(
536
503
  "li",
537
504
  {
@@ -557,33 +524,71 @@ function Breadcrumb({
557
524
  }
558
525
  ) });
559
526
  }
560
- const getDefaultStaticUrlPrefix = () => {
561
- if (typeof window !== "undefined" && window.usxBaseUrl) {
562
- return window.usxBaseUrl + "img/usx-sprite.svg#";
563
- }
564
- return "/img/usx-sprite.svg#";
527
+ const Required = ({
528
+ title = "Required",
529
+ children = null,
530
+ className = "",
531
+ ...props
532
+ }) => {
533
+ const classes = ClassNames("usx-required", className);
534
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
535
+ /* @__PURE__ */ jsx("abbr", { title, className: classes, ...props, children: "*" }),
536
+ " ",
537
+ children ? children : ""
538
+ ] });
565
539
  };
540
+ function Label({
541
+ htmlFor,
542
+ required = false,
543
+ error = false,
544
+ children = null,
545
+ screenReaderOnly = false,
546
+ className = "",
547
+ classOverride = false,
548
+ ...props
549
+ }) {
550
+ const classes = ClassNames(
551
+ "usa-label",
552
+ "usx-label",
553
+ { "usa-sr-only": screenReaderOnly, "usa-label--error": !!error },
554
+ className
555
+ );
556
+ return /* @__PURE__ */ jsxs(
557
+ "label",
558
+ {
559
+ className: classOverride ? className : classes,
560
+ ...htmlFor ? { htmlFor } : {},
561
+ ...props,
562
+ children: [
563
+ required && /* @__PURE__ */ jsx(Required, {}),
564
+ children
565
+ ]
566
+ }
567
+ );
568
+ }
566
569
  const Spinner = ({
567
570
  size = 3,
568
- color = null,
571
+ color,
569
572
  label = null,
570
573
  screenReaderLabel = null,
571
- staticUrlPrefix = getDefaultStaticUrlPrefix(),
574
+ staticUrlPrefix,
575
+ staticBaseUrl,
572
576
  className = "",
573
577
  ...props
574
578
  }) => {
575
579
  return /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", className: `usx-spinner ${className}`, ...props, children: [
576
580
  /* @__PURE__ */ jsx(
577
- "svg",
581
+ Icon,
578
582
  {
579
- className: "usa-icon " + (size === 1 ? "usx-spinner--size-1" : "usa-icon--size-" + size) + (color ? " text-" + color : ""),
580
- "aria-hidden": "true",
581
- focusable: "false",
582
- children: /* @__PURE__ */ jsx("use", { href: staticUrlPrefix + "spinner" })
583
+ name: "spinner",
584
+ source: "usx",
585
+ size,
586
+ color,
587
+ staticBaseUrl
583
588
  }
584
589
  ),
585
- screenReaderLabel && /* @__PURE__ */ jsx("span", { className: "usa-sr-only", children: screenReaderLabel }),
586
- label && /* @__PURE__ */ jsx("span", { className: "usa-label usx-label", children: label })
590
+ screenReaderLabel && /* @__PURE__ */ jsx(Label, { screenReaderOnly: true, children: screenReaderLabel }),
591
+ label && /* @__PURE__ */ jsx(Label, { children: label })
587
592
  ] });
588
593
  };
589
594
  function Button({
@@ -620,10 +625,10 @@ function Button({
620
625
  outline: "usa-button--outline",
621
626
  unstyled: "usa-button--unstyled"
622
627
  };
623
- const classes = classNames(
628
+ const classes = ClassNames(
624
629
  "usa-button",
625
630
  "usx-button",
626
- variant ? variantClasses[variant] : variantClasses["primary"],
631
+ variant && variantClasses[variant],
627
632
  big && "usa-button--big",
628
633
  inverse && "usa-button--inverse",
629
634
  ghost && "usx-button--ghost",
@@ -679,12 +684,12 @@ function ButtonGroup({
679
684
  className = "",
680
685
  ...props
681
686
  }) {
682
- const classes = classNames(
687
+ const classes = ClassNames(
683
688
  "usa-button-group usx-button-group",
684
689
  segmented && "usa-button-group--segmented",
685
690
  className
686
691
  );
687
- return /* @__PURE__ */ jsx("ul", { className: classes, ...props, children: buttonProps.map(({ itemClassName, ...item }, index) => /* @__PURE__ */ jsx("li", { className: classNames("usa-button-group__item", itemClassName), children: /* @__PURE__ */ jsx(Button, { ...item, children: item.children }) }, index)) });
692
+ return /* @__PURE__ */ jsx("ul", { className: classes, ...props, children: buttonProps.map(({ itemClassName, ...item }, index) => /* @__PURE__ */ jsx("li", { className: ClassNames("usa-button-group__item", itemClassName), children: /* @__PURE__ */ jsx(Button, { ...item, children: item.children }) }, index)) });
688
693
  }
689
694
  function CalendarDate({
690
695
  datetime,
@@ -693,15 +698,15 @@ function CalendarDate({
693
698
  const date = new Date(datetime);
694
699
  const month = date.toLocaleString("en-US", { month: "short", timeZone: "UTC" }).toUpperCase();
695
700
  const day = date.toLocaleString("en-US", { day: "numeric", timeZone: "UTC" });
696
- const dateClasses = classNames(
701
+ const dateClasses = ClassNames(
697
702
  { "usa-collection__calendar-date": underCollection },
698
703
  "usx-calendar-date"
699
704
  );
700
- const monthClasses = classNames(
705
+ const monthClasses = ClassNames(
701
706
  { "usa-collection__calendar-date-month": underCollection },
702
707
  "usx-calendar-date-month"
703
708
  );
704
- const dayClasses = classNames(
709
+ const dayClasses = ClassNames(
705
710
  { "usa-collection__calendar-date-day": underCollection },
706
711
  "usx-calendar-date-day"
707
712
  );
@@ -710,6 +715,40 @@ function CalendarDate({
710
715
  /* @__PURE__ */ jsx("span", { className: dayClasses, children: day })
711
716
  ] }) });
712
717
  }
718
+ function Callout({
719
+ className,
720
+ strokeColor,
721
+ indent,
722
+ dedent,
723
+ big,
724
+ orientation = "horizontal",
725
+ children,
726
+ content,
727
+ backgroundColor,
728
+ textColor,
729
+ element = "div",
730
+ ...props
731
+ }) {
732
+ const Element = element;
733
+ return /* @__PURE__ */ jsx(
734
+ Element,
735
+ {
736
+ className: ClassNames(
737
+ "usx-callout",
738
+ orientation === "vertical" && "usx-callout--vertical",
739
+ strokeColor && `usx-border-${strokeColor}`,
740
+ indent && `usx-callout--indent-${indent}`,
741
+ dedent && "usx-callout--dedent",
742
+ (big ?? orientation === "horizontal") && "usx-callout--big",
743
+ backgroundColor && `bg-${backgroundColor}`,
744
+ textColor && `text-${textColor}`,
745
+ className
746
+ ),
747
+ ...props,
748
+ children: children ?? content
749
+ }
750
+ );
751
+ }
713
752
  const Tag = ({
714
753
  id,
715
754
  big = false,
@@ -726,7 +765,7 @@ const Tag = ({
726
765
  ...props
727
766
  }) => {
728
767
  const [isVisible, setIsVisible] = useState(!isDismissed);
729
- const classes = classNames(
768
+ const classes = ClassNames(
730
769
  "usa-tag",
731
770
  "usx-tag",
732
771
  { "usa-tag--big": big },
@@ -772,10 +811,12 @@ function Image({
772
811
  objectFit = "",
773
812
  maxWidth,
774
813
  maxHeight,
814
+ staticBaseUrl,
815
+ srcSet,
775
816
  className = "",
776
817
  ...props
777
818
  }) {
778
- const classes = classNames(
819
+ const classes = ClassNames(
779
820
  "usx-image",
780
821
  {
781
822
  "usx-image--rounded": rounded,
@@ -789,7 +830,7 @@ function Image({
789
830
  if (maxHeight) style.maxHeight = maxHeight;
790
831
  if (maxHeight && !maxWidth) style.width = "auto";
791
832
  if (maxWidth && !maxHeight) style.height = "auto";
792
- const captionClasses = classNames(
833
+ const captionClasses = ClassNames(
793
834
  "usx-image--caption",
794
835
  { "usa-sr-only": hideCaption }
795
836
  );
@@ -799,14 +840,14 @@ function Image({
799
840
  "source",
800
841
  {
801
842
  ...source.media ? { media: source.media } : {},
802
- srcSet: source.srcSet,
843
+ srcSet: getAssetSrcSet(source.srcSet, staticBaseUrl),
803
844
  ...source.type ? { type: source.type } : {},
804
845
  ...source.sizes ? { sizes: source.sizes } : {}
805
846
  },
806
847
  i
807
848
  )),
808
- /* @__PURE__ */ jsx("img", { src: src.fallback, alt, style, ...props })
809
- ] }) : /* @__PURE__ */ jsx("img", { src, alt, style, ...props });
849
+ /* @__PURE__ */ jsx("img", { src: getAssetUrl(src.fallback, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props })
850
+ ] }) : /* @__PURE__ */ jsx("img", { src: getAssetUrl(src, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props });
810
851
  if (caption) {
811
852
  return /* @__PURE__ */ jsxs("figure", { className: classes, style, children: [
812
853
  imgElement,
@@ -834,7 +875,7 @@ function Slide({
834
875
  children = null,
835
876
  ...rest
836
877
  }) {
837
- const cls = ["usx-carousel__slide", className].filter(Boolean).join(" ");
878
+ const cls = ClassNames("usx-carousel__slide", className);
838
879
  return /* @__PURE__ */ jsx(
839
880
  "section",
840
881
  {
@@ -859,7 +900,8 @@ function Carousel({
859
900
  slideIds = [],
860
901
  ...props
861
902
  }) {
862
- const classes = classNames("usx-carousel", className);
903
+ var _a;
904
+ const classes = ClassNames("usx-carousel", className);
863
905
  const childArray = React.Children.toArray(children).filter(Boolean);
864
906
  return /* @__PURE__ */ jsxs("div", { className: classes, ...props, role: "region", "aria-roledescription": "carousel", "aria-label": ariaLabel, children: [
865
907
  /* @__PURE__ */ jsx("div", { className: "usx-carousel__viewport", tabIndex: -1, children: /* @__PURE__ */ jsx("div", { className: "usx-carousel__track", children: childArray.length > 0 ? childArray : slides.length > 0 ? slides.map((slide, i) => /* @__PURE__ */ jsx(
@@ -874,7 +916,7 @@ function Carousel({
874
916
  i
875
917
  )) : /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("em", { children: "No slides available." }) }) }) }),
876
918
  showDots && /* @__PURE__ */ jsxs("div", { className: "usx-carousel__dots", "aria-label": "Slide navigation", children: [
877
- slides == null ? void 0 : slides.map((_, i) => /* @__PURE__ */ jsx("a", { href: `#${id}-slide-${i + 1}`, "aria-label": `Go to slide ${i + 1}`, tabIndex: -1 }, i)),
919
+ (_a = childArray.length > 0 ? childArray : slides) == null ? void 0 : _a.map((_, i) => /* @__PURE__ */ jsx("a", { href: `#${id}-slide-${i + 1}`, "aria-label": `Go to slide ${i + 1}`, tabIndex: -1 }, i)),
878
920
  childArray.length > 0 && slideIds.length === childArray.length && slideIds.map((slideId, i) => /* @__PURE__ */ jsx("a", { href: slideId, "aria-label": `Go to slide ${i + 1}`, tabIndex: -1 }, i))
879
921
  ] })
880
922
  ] });
@@ -882,9 +924,9 @@ function Carousel({
882
924
  function Card({
883
925
  title,
884
926
  description,
885
- tags,
886
- actions,
887
- images,
927
+ tagProps,
928
+ buttonProps,
929
+ imageProps,
888
930
  headerFirst = false,
889
931
  flag = false,
890
932
  mediaRight = false,
@@ -896,7 +938,7 @@ function Card({
896
938
  tag: RootTag = "div",
897
939
  ...props
898
940
  }) {
899
- const cardClasses = classNames(
941
+ const cardClasses = ClassNames(
900
942
  "usa-card",
901
943
  "usx-card",
902
944
  {
@@ -906,95 +948,53 @@ function Card({
906
948
  },
907
949
  className
908
950
  );
909
- const mediaClasses = classNames(
951
+ const mediaClasses = ClassNames(
910
952
  "usa-card__media",
911
953
  {
912
954
  "usa-card__media--inset": mediaInset,
913
955
  "usa-card__media--exdent": mediaExdent
914
956
  }
915
957
  );
916
- const hasStructuredContent = title || description || tags || actions || images;
958
+ const hasStructuredContent = title || description || tagProps || buttonProps || imageProps;
917
959
  const shouldRenderStructured = hasStructuredContent && !children;
918
- const hasImages = images && images.length > 0;
919
- const useCarousel = images && images.length > 1;
960
+ const hasImages = imageProps && imageProps.length > 0;
961
+ const useCarousel = imageProps && imageProps.length > 1;
920
962
  const media = useCarousel ? /* @__PURE__ */ jsx(
921
963
  Carousel,
922
964
  {
923
965
  id: `${props.id || "card"}-carousel`,
924
966
  showDots: showCarouselDots,
925
967
  className: "usx-card__carousel",
926
- slides: images == null ? void 0 : images.map((img, index) => ({
927
- content: /* @__PURE__ */ jsx(Image, { ...img, hideCaption: true }, index)
968
+ slides: imageProps == null ? void 0 : imageProps.map((img, index) => ({
969
+ content: /* @__PURE__ */ jsx(Image, { hideCaption: true, ...img }, index)
928
970
  }))
929
971
  }
930
- ) : hasImages ? /* @__PURE__ */ jsx(Image, { ...images[0], hideCaption: true, className: "usa-card__img" }) : null;
972
+ ) : hasImages ? /* @__PURE__ */ jsx(Image, { hideCaption: true, ...imageProps[0], className: ClassNames("usa-card__img", imageProps[0].className) }) : null;
931
973
  return /* @__PURE__ */ jsx(RootTag, { className: cardClasses, ...props, children: /* @__PURE__ */ jsx("div", { className: "usa-card__container", children: shouldRenderStructured ? /* @__PURE__ */ jsxs(Fragment, { children: [
932
974
  title && /* @__PURE__ */ jsx("div", { className: "usa-card__header", children: /* @__PURE__ */ jsx("h4", { className: "usa-card__heading", children: title }) }),
933
975
  media && /* @__PURE__ */ jsx("div", { className: mediaClasses, children: media }),
934
976
  /* @__PURE__ */ jsxs("div", { className: "usa-card__body", children: [
935
- tags && tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "usx-tag-group", children: tags.map((tag, index) => /* @__PURE__ */ jsx(Tag, { ...tag }, index)) }),
977
+ tagProps && tagProps.length > 0 && /* @__PURE__ */ jsx("div", { className: "usx-tag-group", children: tagProps.map((tag, index) => /* @__PURE__ */ jsx(Tag, { ...tag }, index)) }),
936
978
  description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { children: description }) : description)
937
979
  ] }),
938
- actions && actions.length > 0 && /* @__PURE__ */ jsx("div", { className: "usa-card__footer", children: /* @__PURE__ */ jsx(ButtonGroup, { buttonProps: actions, className: "flex-wrap" }) })
980
+ buttonProps && buttonProps.length > 0 && /* @__PURE__ */ jsx("div", { className: "usa-card__footer", children: /* @__PURE__ */ jsx(ButtonGroup, { buttonProps, className: "flex-wrap" }) })
939
981
  ] }) : children || "Card" }) });
940
982
  }
941
983
  function CardGroup({ cardProps = [], className = "", ...props }) {
942
- const classes = classNames(
984
+ const classes = ClassNames(
943
985
  "usa-card-group",
944
986
  "usx-card-group",
945
987
  className
946
988
  );
947
989
  return /* @__PURE__ */ jsx("ul", { className: classes, ...props, children: cardProps.map((card, index) => /* @__PURE__ */ jsx(Card, { ...card, tag: "li" }, index)) });
948
990
  }
949
- const Required = ({
950
- title = "Required",
951
- children = null,
952
- className = "",
953
- ...props
954
- }) => {
955
- const classes = classNames("usx-required", className);
956
- return /* @__PURE__ */ jsxs(Fragment, { children: [
957
- /* @__PURE__ */ jsx("abbr", { title, className: classes, ...props, children: "*" }),
958
- " ",
959
- children ? children : ""
960
- ] });
961
- };
962
- function Label({
963
- htmlFor,
964
- required = false,
965
- error = false,
966
- children = null,
967
- screenReaderOnly = false,
968
- className = "",
969
- classOverride = false,
970
- ...props
971
- }) {
972
- const classes = classNames(
973
- "usa-label",
974
- "usx-label",
975
- { "usa-sr-only": screenReaderOnly, "usa-label--error": !!error },
976
- className
977
- );
978
- return /* @__PURE__ */ jsxs(
979
- "label",
980
- {
981
- className: classOverride ? className : classes,
982
- ...htmlFor ? { htmlFor } : {},
983
- ...props,
984
- children: [
985
- required && /* @__PURE__ */ jsx(Required, {}),
986
- children
987
- ]
988
- }
989
- );
990
- }
991
991
  function Hint({
992
992
  id,
993
993
  children = null,
994
994
  className = "",
995
995
  ...props
996
996
  }) {
997
- const classes = classNames("usa-hint", "usx-hint", className);
997
+ const classes = ClassNames("usa-hint", "usx-hint", className);
998
998
  return /* @__PURE__ */ jsx("span", { className: classes, ...id ? { id } : {}, ...props, children });
999
999
  }
1000
1000
  function ErrorMessage({
@@ -1003,11 +1003,11 @@ function ErrorMessage({
1003
1003
  className = "",
1004
1004
  ...props
1005
1005
  }) {
1006
- const classes = classNames("usa-error-message", "usx-error-message", className);
1006
+ const classes = ClassNames("usa-error-message", "usx-error-message", className);
1007
1007
  return /* @__PURE__ */ jsx("span", { className: classes, role: "alert", ...id ? { id } : {}, ...props, children });
1008
1008
  }
1009
1009
  function FormGroup({ children = null, className = "", error = false, ...props }) {
1010
- const classes = classNames(
1010
+ const classes = ClassNames(
1011
1011
  "usa-form-group",
1012
1012
  "usx-form-group",
1013
1013
  {
@@ -1038,7 +1038,7 @@ function Input({
1038
1038
  const inputClasses = "usa-input usx-input";
1039
1039
  const inputErrorClasses = "usa-input--error";
1040
1040
  const inputSuccessClasses = "usa-input--success";
1041
- const combinedInputClasses = classNames(
1041
+ const combinedInputClasses = ClassNames(
1042
1042
  inputClasses,
1043
1043
  hasError ? inputErrorClasses : hasSuccess ? inputSuccessClasses : null,
1044
1044
  className
@@ -1082,7 +1082,7 @@ const TextArea = ({
1082
1082
  const textAreaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;
1083
1083
  const hasError = !!error;
1084
1084
  const hasSuccess = !!success;
1085
- const classes = classNames(
1085
+ const classes = ClassNames(
1086
1086
  "usa-textarea",
1087
1087
  "usx-textarea",
1088
1088
  hasError ? "usa-input--error" : hasSuccess ? "usa-input--success" : null,
@@ -1133,7 +1133,7 @@ function CharacterCount({
1133
1133
  const hintId = hint ? `${fieldId}-hint` : void 0;
1134
1134
  const errorId = error ? `${fieldId}-error` : void 0;
1135
1135
  const successId = !error && success ? `${fieldId}-success` : void 0;
1136
- const outerClasses = classNames("usa-character-count", "usx-character-count", className);
1136
+ const outerClasses = ClassNames("usa-character-count", "usx-character-count", className);
1137
1137
  const fieldProps = {
1138
1138
  id: fieldId,
1139
1139
  label,
@@ -1179,13 +1179,13 @@ function Checkbox({
1179
1179
  }) {
1180
1180
  const hasError = !!error;
1181
1181
  const hasSuccess = !!success;
1182
- const divClasses = classNames(
1182
+ const divClasses = ClassNames(
1183
1183
  "usa-checkbox",
1184
1184
  "usx-checkbox",
1185
1185
  { "usx-checkbox--small": small },
1186
1186
  className
1187
1187
  );
1188
- const inputClasses = classNames(
1188
+ const inputClasses = ClassNames(
1189
1189
  "usa-checkbox__input",
1190
1190
  { "usa-checkbox__input--tile": tile }
1191
1191
  );
@@ -1222,7 +1222,7 @@ function Legend({
1222
1222
  className = "",
1223
1223
  ...props
1224
1224
  }) {
1225
- const classes = classNames(
1225
+ const classes = ClassNames(
1226
1226
  "usa-legend",
1227
1227
  "usx-legend",
1228
1228
  { "usa-legend--large": large },
@@ -1246,7 +1246,7 @@ function Fieldset({
1246
1246
  className = "",
1247
1247
  ...props
1248
1248
  }) {
1249
- const classes = classNames(
1249
+ const classes = ClassNames(
1250
1250
  "usa-fieldset",
1251
1251
  "usx-fieldset",
1252
1252
  className
@@ -1274,25 +1274,22 @@ const CheckboxGroup = ({
1274
1274
  hint = null,
1275
1275
  error = null,
1276
1276
  name = "checkbox-group",
1277
- options = [],
1277
+ id: groupId,
1278
+ checkboxProps = [],
1278
1279
  className = "",
1279
1280
  ...props
1280
1281
  }) => {
1281
- const classes = classNames("usa-checkbox-group", "usx-checkbox-group", className);
1282
- return /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsx(Fieldset, { legend, required, hint, error, className: classes, ...props, children: options.map((opt, idx) => {
1283
- const id = opt.id || `${name}-${idx}`;
1282
+ const classes = ClassNames("usa-checkbox-group", "usx-checkbox-group", className);
1283
+ return /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsx(Fieldset, { id: groupId, legend, required, hint, error, className: classes, ...props, children: checkboxProps.map((opt, idx) => {
1284
+ const id = opt.id || `${groupId || name}-${idx}`;
1284
1285
  return /* @__PURE__ */ jsx(
1285
1286
  Checkbox,
1286
1287
  {
1287
- id,
1288
1288
  name,
1289
- value: opt.value,
1290
- label: opt.label,
1291
- description: opt.description,
1292
- checked: !!opt.checked,
1293
- disabled: !!opt.disabled,
1294
1289
  tile,
1295
- small
1290
+ small,
1291
+ ...opt,
1292
+ id
1296
1293
  },
1297
1294
  id
1298
1295
  );
@@ -1306,7 +1303,7 @@ function ClickableLink({
1306
1303
  bgColorChange = false,
1307
1304
  ...rest
1308
1305
  }) {
1309
- const classes = classNames(
1306
+ const classes = ClassNames(
1310
1307
  "usx-clickable__link",
1311
1308
  colorChange && "usx-clickable__color-on-hover",
1312
1309
  bgColorChange && "usx-clickable__bg-color-on-hover",
@@ -1315,13 +1312,13 @@ function ClickableLink({
1315
1312
  return /* @__PURE__ */ jsx(Tag2, { className: classes, ...rest, children });
1316
1313
  }
1317
1314
  function ClickableColorChange({ children, className, as: Tag2 = "span", ...rest }) {
1318
- return /* @__PURE__ */ jsx(Tag2, { className: classNames("usx-clickable__color-on-hover", className), ...rest, children });
1315
+ return /* @__PURE__ */ jsx(Tag2, { className: ClassNames("usx-clickable__color-on-hover", className), ...rest, children });
1319
1316
  }
1320
1317
  function ClickableBgColorChange({ children, className, as: Tag2 = "span", ...rest }) {
1321
- return /* @__PURE__ */ jsx(Tag2, { className: classNames("usx-clickable__bg-color-on-hover", className), ...rest, children });
1318
+ return /* @__PURE__ */ jsx(Tag2, { className: ClassNames("usx-clickable__bg-color-on-hover", className), ...rest, children });
1322
1319
  }
1323
1320
  function Clickable({ className, children, ...rest }) {
1324
- const classes = classNames("usx-clickable", className);
1321
+ const classes = ClassNames("usx-clickable", className);
1325
1322
  if ("href" in rest && rest.href !== void 0) {
1326
1323
  return /* @__PURE__ */ jsx("a", { className: classes, ...rest, children });
1327
1324
  }
@@ -1330,25 +1327,70 @@ function Clickable({ className, children, ...rest }) {
1330
1327
  Clickable.Link = ClickableLink;
1331
1328
  Clickable.ColorChange = ClickableColorChange;
1332
1329
  Clickable.BgColorChange = ClickableBgColorChange;
1333
- function usxCopy(text) {
1334
- if (navigator.clipboard) {
1335
- navigator.clipboard.writeText(text);
1336
- } else {
1337
- const ta = document.createElement("textarea");
1338
- ta.value = text;
1339
- ta.style.cssText = "position:fixed;opacity:0";
1340
- document.body.appendChild(ta);
1341
- ta.focus();
1342
- ta.select();
1343
- try {
1344
- document.execCommand("copy");
1345
- } catch {
1346
- }
1347
- document.body.removeChild(ta);
1330
+ const Tooltip = ({
1331
+ label,
1332
+ position = "top",
1333
+ children,
1334
+ className = "",
1335
+ bodyClassName = "",
1336
+ ...props
1337
+ }) => {
1338
+ const validPositions = ["top", "bottom", "left", "right"];
1339
+ const normalizedPosition = validPositions.includes(position) ? position : "top";
1340
+ return /* @__PURE__ */ jsxs("span", { className: ClassNames("usx-tooltip", className), ...props, children: [
1341
+ children,
1342
+ /* @__PURE__ */ jsx(
1343
+ "span",
1344
+ {
1345
+ className: ClassNames("usa-tooltip__body", `usa-tooltip__body--${normalizedPosition}`, bodyClassName),
1346
+ role: "tooltip",
1347
+ children: label
1348
+ }
1349
+ )
1350
+ ] });
1351
+ };
1352
+ function copyTextToClipboard(text) {
1353
+ if (window.navigator.clipboard) {
1354
+ return window.navigator.clipboard.writeText(text);
1348
1355
  }
1349
1356
  }
1350
- function Code({ lines = [], allowHtml = false, copyText = null, className = "" }) {
1351
- return /* @__PURE__ */ jsxs("div", { className: classNames("usx-mockup-code", className), children: [
1357
+ function CopyToClipboard({
1358
+ copyText = "",
1359
+ label = null,
1360
+ tooltipProps,
1361
+ staticBaseUrl,
1362
+ className = ""
1363
+ }) {
1364
+ const button = /* @__PURE__ */ jsxs(
1365
+ Button,
1366
+ {
1367
+ ghost: true,
1368
+ className: ClassNames("usx-copy", className),
1369
+ onClick: () => copyTextToClipboard(copyText),
1370
+ type: "button",
1371
+ children: [
1372
+ /* @__PURE__ */ jsx(Icon, { name: "content_copy", size: 0, className: "usx-copy__copy", staticBaseUrl }),
1373
+ /* @__PURE__ */ jsx(Icon, { name: "check", size: 0, className: "usx-copy__check", staticBaseUrl }),
1374
+ label && /* @__PURE__ */ jsx("span", { className: "margin-left-1", children: label })
1375
+ ]
1376
+ }
1377
+ );
1378
+ if (!tooltipProps) return button;
1379
+ const { label: tooltipLabel, copiedTooltip = "Copied", ...tooltipOptions } = tooltipProps;
1380
+ return /* @__PURE__ */ jsx(
1381
+ Tooltip,
1382
+ {
1383
+ ...tooltipOptions,
1384
+ label: /* @__PURE__ */ jsxs(Fragment, { children: [
1385
+ /* @__PURE__ */ jsx("span", { className: "usx-copy__tooltip--copy", children: tooltipLabel }),
1386
+ /* @__PURE__ */ jsx("span", { className: "usx-copy__tooltip--copied", children: copiedTooltip })
1387
+ ] }),
1388
+ children: button
1389
+ }
1390
+ );
1391
+ }
1392
+ function Code({ lines = [], allowHtml = false, copyText = null, staticBaseUrl, className = "" }) {
1393
+ return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-mockup-code", className), children: [
1352
1394
  /* @__PURE__ */ jsx("div", { className: "usx-mockup-code__content", children: lines.map((line, i) => /* @__PURE__ */ jsx(
1353
1395
  "pre",
1354
1396
  {
@@ -1358,23 +1400,13 @@ function Code({ lines = [], allowHtml = false, copyText = null, className = "" }
1358
1400
  },
1359
1401
  i
1360
1402
  )) }),
1361
- copyText && /* @__PURE__ */ jsxs(
1362
- "button",
1363
- {
1364
- className: "usa-button usx-button usx-button--ghost usx-copy",
1365
- onClick: () => usxCopy(copyText),
1366
- children: [
1367
- /* @__PURE__ */ jsx("svg", { className: "usa-icon usx-copy__copy", "aria-hidden": "true", focusable: "false", role: "img", children: /* @__PURE__ */ jsx("use", { href: "./img/sprite.svg#content_copy" }) }),
1368
- /* @__PURE__ */ jsx("svg", { className: "usa-icon usx-copy__check", "aria-hidden": "true", focusable: "false", role: "img", children: /* @__PURE__ */ jsx("use", { href: "./img/sprite.svg#check" }) })
1369
- ]
1370
- }
1371
- )
1403
+ copyText && /* @__PURE__ */ jsx(CopyToClipboard, { copyText, staticBaseUrl, tooltipProps: { label: "Copy", copiedTooltip: "Copied", position: "left" } })
1372
1404
  ] });
1373
1405
  }
1374
- function CollectionItem({ href, heading, description, imgSrc, imgAlt = "", calendarDate, meta, tags }) {
1406
+ function CollectionItem({ href, heading, description, imgSrc, imgAlt = "", calendarDateProps, meta, tags }) {
1375
1407
  return /* @__PURE__ */ jsxs("li", { className: "usa-collection__item", children: [
1376
1408
  imgSrc && /* @__PURE__ */ jsx("img", { className: "usa-collection__img", src: imgSrc, alt: imgAlt }),
1377
- calendarDate && /* @__PURE__ */ jsx(CalendarDate, { datetime: typeof calendarDate === "string" ? calendarDate : calendarDate.datetime, underCollection: true }),
1409
+ calendarDateProps && /* @__PURE__ */ jsx(CalendarDate, { underCollection: true, ...calendarDateProps }),
1378
1410
  /* @__PURE__ */ jsxs("div", { className: "usa-collection__body", children: [
1379
1411
  /* @__PURE__ */ jsx("h4", { className: "usa-collection__heading", children: /* @__PURE__ */ jsx("a", { className: "usa-link usx-link", href, children: heading }) }),
1380
1412
  description && /* @__PURE__ */ jsx("p", { className: "usa-collection__description", children: description }),
@@ -1384,7 +1416,7 @@ function CollectionItem({ href, heading, description, imgSrc, imgAlt = "", calen
1384
1416
  tags && tags.length > 0 && /* @__PURE__ */ jsx("ul", { className: "usa-collection__meta", "aria-label": "Topics", children: tags.map((tag, i) => /* @__PURE__ */ jsx(
1385
1417
  "li",
1386
1418
  {
1387
- className: classNames(
1419
+ className: ClassNames(
1388
1420
  "usa-collection__meta-item",
1389
1421
  "usa-tag usx-tag",
1390
1422
  typeof tag === "object" && tag.isNew && "usa-tag--new"
@@ -1397,7 +1429,7 @@ function CollectionItem({ href, heading, description, imgSrc, imgAlt = "", calen
1397
1429
  ] });
1398
1430
  }
1399
1431
  function Collection({ items = [], condensed = false, className = "", ...props }) {
1400
- const classes = classNames(
1432
+ const classes = ClassNames(
1401
1433
  "usa-collection",
1402
1434
  "usx-collection",
1403
1435
  condensed && "usa-collection--condensed",
@@ -1441,7 +1473,7 @@ function Combobox({
1441
1473
  /* @__PURE__ */ jsx(
1442
1474
  "div",
1443
1475
  {
1444
- className: classNames(
1476
+ className: ClassNames(
1445
1477
  "usa-combo-box",
1446
1478
  "usx-combo-box",
1447
1479
  { "usx-combo-box--error": !!error },
@@ -1453,7 +1485,7 @@ function Combobox({
1453
1485
  children: /* @__PURE__ */ jsx(
1454
1486
  "select",
1455
1487
  {
1456
- className: classNames("usa-select", "usx-select"),
1488
+ className: ClassNames("usa-select", "usx-select"),
1457
1489
  id,
1458
1490
  name,
1459
1491
  disabled,
@@ -1468,38 +1500,6 @@ function Combobox({
1468
1500
  ] });
1469
1501
  return formGroup ? /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: content }) : content;
1470
1502
  }
1471
- function CopyToClipboard({
1472
- copyText = "",
1473
- label = null,
1474
- tooltip = null,
1475
- copiedTooltip = "Copied",
1476
- className = ""
1477
- }) {
1478
- const button = /* @__PURE__ */ jsxs(
1479
- "button",
1480
- {
1481
- className: classNames(
1482
- "usa-button",
1483
- "usx-button",
1484
- "usx-button--ghost",
1485
- "usx-copy",
1486
- className
1487
- ),
1488
- onClick: () => window.navigator.clipboard.writeText(copyText),
1489
- type: "button",
1490
- children: [
1491
- /* @__PURE__ */ jsx("svg", { className: "usa-icon usx-copy__copy", "aria-hidden": "true", focusable: "false", role: "img", children: /* @__PURE__ */ jsx("use", { href: "./img/sprite.svg#content_copy" }) }),
1492
- /* @__PURE__ */ jsx("svg", { className: "usa-icon usx-copy__check", "aria-hidden": "true", focusable: "false", role: "img", children: /* @__PURE__ */ jsx("use", { href: "./img/sprite.svg#check" }) }),
1493
- label && /* @__PURE__ */ jsx("span", { className: "margin-left-1", children: label })
1494
- ]
1495
- }
1496
- );
1497
- return /* @__PURE__ */ jsxs("span", { className: "usx-tooltip", children: [
1498
- button,
1499
- tooltip && /* @__PURE__ */ jsx("span", { className: "usa-tooltip__body usa-tooltip__body--right usx-copy__tooltip--copy", role: "tooltip", children: tooltip }),
1500
- /* @__PURE__ */ jsx("span", { className: "usa-tooltip__body usa-tooltip__body--right usx-copy__tooltip--copied", role: "tooltip", children: copiedTooltip })
1501
- ] });
1502
- }
1503
1503
  function DatePicker({
1504
1504
  id = "date-picker",
1505
1505
  name,
@@ -1527,7 +1527,7 @@ function DatePicker({
1527
1527
  /* @__PURE__ */ jsx(
1528
1528
  "div",
1529
1529
  {
1530
- className: classNames("usa-date-picker", "usx-date-picker", className),
1530
+ className: ClassNames("usa-date-picker", "usx-date-picker", className),
1531
1531
  ...defaultValue ? { "data-default-value": defaultValue } : {},
1532
1532
  ...minDate ? { "data-min-date": minDate } : {},
1533
1533
  ...maxDate ? { "data-max-date": maxDate } : {},
@@ -1535,7 +1535,7 @@ function DatePicker({
1535
1535
  children: /* @__PURE__ */ jsx(
1536
1536
  "input",
1537
1537
  {
1538
- className: classNames(
1538
+ className: ClassNames(
1539
1539
  "usa-input",
1540
1540
  "usx-input",
1541
1541
  { "usa-input--error": !!error }
@@ -1584,7 +1584,7 @@ function DateRangePicker({
1584
1584
  return /* @__PURE__ */ jsxs(
1585
1585
  "div",
1586
1586
  {
1587
- className: classNames("usa-date-range-picker", "usx-date-range-picker", className),
1587
+ className: ClassNames("usa-date-range-picker", "usx-date-range-picker", className),
1588
1588
  ...minDate ? { "data-min-date": minDate } : {},
1589
1589
  ...maxDate ? { "data-max-date": maxDate } : {},
1590
1590
  children: [
@@ -1641,7 +1641,7 @@ function DateRangePicker({
1641
1641
  );
1642
1642
  }
1643
1643
  function Eyebrow({ children = null, className = "", ...props }) {
1644
- const classes = ["usx-eyebrow", className].filter(Boolean).join(" ");
1644
+ const classes = ClassNames("usx-eyebrow", className);
1645
1645
  return /* @__PURE__ */ jsx("span", { className: classes, ...props, children });
1646
1646
  }
1647
1647
  function Link({
@@ -1654,7 +1654,7 @@ function Link({
1654
1654
  className = "",
1655
1655
  ...props
1656
1656
  }) {
1657
- const classes = classNames(
1657
+ const classes = ClassNames(
1658
1658
  "usa-link",
1659
1659
  "usx-link",
1660
1660
  visited && "usx-link--visited",
@@ -1691,7 +1691,7 @@ function getEntryDisplay(entry) {
1691
1691
  function FileList({ files, hint = "Selected files", onRemove = null, disabled = false, className = "" }) {
1692
1692
  if (!files || files.length === 0) return null;
1693
1693
  const lastEntry = getEntryDisplay(files[files.length - 1]);
1694
- return /* @__PURE__ */ jsxs("div", { className: ["usx-file-input__list", "margin-top-1", className].filter(Boolean).join(" "), children: [
1694
+ return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-file-input__list", "margin-top-1", className), children: [
1695
1695
  /* @__PURE__ */ jsx("span", { className: "usa-sr-only", "aria-live": "polite", children: `You have selected the file: ${lastEntry.name}.` }),
1696
1696
  hint && /* @__PURE__ */ jsx("span", { className: "usa-hint usx-hint usx-file-input__list-heading", children: hint }),
1697
1697
  /* @__PURE__ */ jsx("ul", { className: "usx-file-input__file-list", children: files.map((entry) => {
@@ -1784,7 +1784,7 @@ function FileInput({
1784
1784
  /* @__PURE__ */ jsx(
1785
1785
  "input",
1786
1786
  {
1787
- className: ["usa-file-input", "usx-file-input", className].filter(Boolean).join(" "),
1787
+ className: ClassNames("usa-file-input", "usx-file-input", className),
1788
1788
  id,
1789
1789
  type: "file",
1790
1790
  name: name || id,
@@ -1807,7 +1807,7 @@ function FileInput({
1807
1807
  /* @__PURE__ */ jsx("div", { className: "usx-file-input__add-only", children: /* @__PURE__ */ jsx(
1808
1808
  "input",
1809
1809
  {
1810
- className: ["usa-file-input", "usx-file-input", className].filter(Boolean).join(" "),
1810
+ className: ClassNames("usa-file-input", "usx-file-input", className),
1811
1811
  id,
1812
1812
  type: "file",
1813
1813
  name: name || id,
@@ -1825,7 +1825,7 @@ function FileInput({
1825
1825
  ] });
1826
1826
  return formGroup ? /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: content }) : content;
1827
1827
  }
1828
- function BrandingContent({ config, projectUrl }) {
1828
+ function BrandingContent({ config, projectUrl, staticBaseUrl }) {
1829
1829
  const { title, symbol, symbolInverse, logo, logoInverse, alt } = config;
1830
1830
  const label = alt ?? title ?? "";
1831
1831
  if (logo) {
@@ -1836,11 +1836,12 @@ function BrandingContent({ config, projectUrl }) {
1836
1836
  ...projectUrl ? { href: projectUrl } : {},
1837
1837
  className: "usx-image usx-logo__image",
1838
1838
  children: [
1839
- /* @__PURE__ */ jsx(Image, { src: logo, alt: label, className: "usx-logo__variant" }),
1839
+ /* @__PURE__ */ jsx(Image, { src: logo, alt: label, staticBaseUrl, className: "usx-logo__variant" }),
1840
1840
  logoInverse && /* @__PURE__ */ jsx(
1841
1841
  Image,
1842
1842
  {
1843
1843
  src: logoInverse,
1844
+ staticBaseUrl,
1844
1845
  alt: label,
1845
1846
  className: "usx-logo__variant usx-logo__variant--inverse"
1846
1847
  }
@@ -1850,11 +1851,11 @@ function BrandingContent({ config, projectUrl }) {
1850
1851
  );
1851
1852
  }
1852
1853
  return /* @__PURE__ */ jsxs("em", { className: "usa-logo__text", children: [
1853
- symbol && /* @__PURE__ */ jsx("img", { src: symbol, alt: "", "aria-hidden": "true", className: "usx-logo__symbol usx-logo__variant" }),
1854
+ symbol && /* @__PURE__ */ jsx("img", { src: getAssetUrl(symbol, staticBaseUrl), alt: "", "aria-hidden": "true", className: "usx-logo__symbol usx-logo__variant" }),
1854
1855
  symbolInverse && /* @__PURE__ */ jsx(
1855
1856
  "img",
1856
1857
  {
1857
- src: symbolInverse,
1858
+ src: getAssetUrl(symbolInverse, staticBaseUrl),
1858
1859
  alt: "",
1859
1860
  "aria-hidden": "true",
1860
1861
  className: "usx-logo__symbol usx-logo__variant usx-logo__variant--inverse"
@@ -1863,17 +1864,17 @@ function BrandingContent({ config, projectUrl }) {
1863
1864
  title && (projectUrl ? /* @__PURE__ */ jsx("a", { href: projectUrl, className: "usx-logo__title", children: title }) : /* @__PURE__ */ jsx("span", { className: "usx-logo__title", children: title }))
1864
1865
  ] });
1865
1866
  }
1866
- function Branding({ branding, projectUrl = "/", className = "", ...props }) {
1867
+ function Branding({ branding, projectUrl = "/", staticBaseUrl, className = "", ...props }) {
1867
1868
  if (!branding) return null;
1868
- const classes = classNames(
1869
+ const classes = ClassNames(
1869
1870
  "usa-logo",
1870
1871
  "usx-logo",
1871
1872
  className
1872
1873
  );
1873
- return /* @__PURE__ */ jsx("div", { className: classes, ...props, children: /* @__PURE__ */ jsx(BrandingContent, { config: branding, projectUrl }) });
1874
+ return /* @__PURE__ */ jsx("div", { className: classes, ...props, children: /* @__PURE__ */ jsx(BrandingContent, { config: branding, projectUrl, staticBaseUrl }) });
1874
1875
  }
1875
1876
  function FooterReturnToTop({ label = "Return to top", href = "#", className = "" }) {
1876
- const classes = classNames(
1877
+ const classes = ClassNames(
1877
1878
  "grid-container",
1878
1879
  "usa-footer__return-to-top",
1879
1880
  "usx-footer__return-to-top",
@@ -1885,7 +1886,7 @@ function FooterReturnToTop({ label = "Return to top", href = "#", className = ""
1885
1886
  ] }) });
1886
1887
  }
1887
1888
  function FooterNavColumn({ heading, links = [], className = "" }) {
1888
- return /* @__PURE__ */ jsxs("section", { className: ["usa-footer__primary-content usa-footer__primary-content--collapsible usx-footer__nav-column", className].filter(Boolean).join(" "), children: [
1889
+ return /* @__PURE__ */ jsxs("section", { className: ClassNames("usa-footer__primary-content usa-footer__primary-content--collapsible usx-footer__nav-column", className), children: [
1889
1890
  heading && /* @__PURE__ */ jsx("h4", { className: "usa-footer__primary-link", children: heading }),
1890
1891
  links.length > 0 && /* @__PURE__ */ jsx("ul", { className: "usa-list usa-list--unstyled", children: links.map((link, i) => /* @__PURE__ */ jsx("li", { className: "usa-footer__secondary-link", children: /* @__PURE__ */ jsx("a", { href: link.href, "aria-label": link.ariaLabel || void 0, children: link.text }) }, i)) })
1891
1892
  ] });
@@ -1899,7 +1900,7 @@ function FooterSignUp({
1899
1900
  onSubmit = null,
1900
1901
  className = ""
1901
1902
  }) {
1902
- return /* @__PURE__ */ jsxs("div", { className: ["usa-sign-up usx-footer__sign-up", className].filter(Boolean).join(" "), children: [
1903
+ return /* @__PURE__ */ jsxs("div", { className: ClassNames("usa-sign-up usx-footer__sign-up", className), children: [
1903
1904
  /* @__PURE__ */ jsx("h3", { className: "usa-sign-up__heading", children: heading }),
1904
1905
  /* @__PURE__ */ jsxs("form", { className: "usa-form", action: action || void 0, onSubmit: onSubmit || void 0, children: [
1905
1906
  /* @__PURE__ */ jsx(
@@ -1916,9 +1917,9 @@ function FooterSignUp({
1916
1917
  ] })
1917
1918
  ] });
1918
1919
  }
1919
- function FooterSocialLinks({ links = [], className = "" }) {
1920
+ function FooterSocialLinks({ links = [], staticBaseUrl, className = "" }) {
1920
1921
  if (!links.length) return null;
1921
- return /* @__PURE__ */ jsx("div", { className: ["usa-footer__social-links grid-row grid-gap-1 usx-footer__social-links", className].filter(Boolean).join(" "), children: links.map((link, i) => /* @__PURE__ */ jsx("div", { className: "grid-col-auto", children: /* @__PURE__ */ jsx("a", { className: "usa-social-link", href: link.href, "aria-label": link.alt, children: /* @__PURE__ */ jsx("img", { className: "usa-social-link__icon", src: link.icon, alt: link.alt }) }) }, i)) });
1922
+ return /* @__PURE__ */ jsx("div", { className: ClassNames("usa-footer__social-links grid-row grid-gap-1 usx-footer__social-links", className), children: links.map((link, i) => /* @__PURE__ */ jsx("div", { className: "grid-col-auto", children: /* @__PURE__ */ jsx("a", { className: "usa-social-link", href: link.href, "aria-label": link.alt, children: /* @__PURE__ */ jsx("img", { className: "usa-social-link__icon", src: getAssetUrl(link.icon, staticBaseUrl), alt: link.alt }) }) }, i)) });
1922
1923
  }
1923
1924
  function normalizeContactLink(value, scheme) {
1924
1925
  var _a;
@@ -1940,7 +1941,7 @@ function FooterContact({
1940
1941
  ...links
1941
1942
  ].filter(Boolean);
1942
1943
  if (!heading && allLinks.length === 0) return null;
1943
- return /* @__PURE__ */ jsxs("address", { className: ["usa-footer__address usx-footer__contact", className].filter(Boolean).join(" "), children: [
1944
+ return /* @__PURE__ */ jsxs("address", { className: ClassNames("usa-footer__address usx-footer__contact", className), children: [
1944
1945
  heading && /* @__PURE__ */ jsx("p", { className: "usa-footer__contact-heading", children: heading }),
1945
1946
  allLinks.length > 0 && /* @__PURE__ */ jsx("div", { className: "usa-footer__contact-info grid-row grid-gap", children: allLinks.map((link, i) => /* @__PURE__ */ jsx("div", { className: "grid-col-auto", children: /* @__PURE__ */ jsx("a", { href: link.href, children: link.text }) }, i)) })
1946
1947
  ] });
@@ -1956,6 +1957,7 @@ function Footer({
1956
1957
  signUp = null,
1957
1958
  branding = null,
1958
1959
  brandingUrl = "/",
1960
+ staticBaseUrl,
1959
1961
  socialLinks = [],
1960
1962
  contactHeading = null,
1961
1963
  contactPhone = null,
@@ -1967,7 +1969,7 @@ function Footer({
1967
1969
  ...props
1968
1970
  }) {
1969
1971
  const variantClass = variant === "big" ? "usa-footer--big" : variant === "slim" ? "usa-footer--slim" : "";
1970
- const classes = ["usa-footer", variantClass, "usx-footer", className].filter(Boolean).join(" ");
1972
+ const classes = ClassNames("usa-footer", variantClass, "usx-footer", className);
1971
1973
  const returnToTopEl = returnToTop ? /* @__PURE__ */ jsx(
1972
1974
  FooterReturnToTop,
1973
1975
  {
@@ -1985,9 +1987,9 @@ function Footer({
1985
1987
  links: contactLinks
1986
1988
  }
1987
1989
  ) : null;
1988
- const socialEl = socialLinks.length > 0 ? /* @__PURE__ */ jsx(FooterSocialLinks, { links: socialLinks }) : null;
1990
+ const socialEl = socialLinks.length > 0 ? /* @__PURE__ */ jsx(FooterSocialLinks, { links: socialLinks, staticBaseUrl }) : null;
1989
1991
  const logoClassName = variant === "slim" ? "usa-footer__logo grid-row grid-gap-2 usx-footer__logo" : "usa-footer__logo grid-row mobile-lg:grid-col-6 mobile-lg:grid-gap-2 usx-footer__logo";
1990
- const brandingEl = branding ? /* @__PURE__ */ jsx(Branding, { branding, projectUrl: brandingUrl, className: logoClassName }) : null;
1992
+ const brandingEl = branding ? /* @__PURE__ */ jsx(Branding, { branding, projectUrl: brandingUrl, staticBaseUrl, className: logoClassName }) : null;
1991
1993
  const secondaryContactBlock = socialEl || contactEl ? /* @__PURE__ */ jsxs("div", { className: "usa-footer__contact-links mobile-lg:grid-col-6", children: [
1992
1994
  socialEl,
1993
1995
  contactEl
@@ -2006,11 +2008,16 @@ function Footer({
2006
2008
  ] });
2007
2009
  }
2008
2010
  if (variant === "slim") {
2011
+ const slimContactLinks = [
2012
+ normalizeContactLink(contactPhone, "tel:"),
2013
+ normalizeContactLink(contactEmail, "mailto:"),
2014
+ ...contactLinks
2015
+ ].filter(Boolean);
2009
2016
  return /* @__PURE__ */ jsxs("footer", { className: classes, ...props, children: [
2010
2017
  returnToTopEl,
2011
2018
  /* @__PURE__ */ jsx("div", { className: "usa-footer__primary-section", children: primaryChildren ?? /* @__PURE__ */ jsxs("div", { className: "usa-footer__primary-container grid-row", children: [
2012
2019
  navLinks.length > 0 && /* @__PURE__ */ jsx("div", { className: "mobile-lg:grid-col-8", children: /* @__PURE__ */ jsx("nav", { className: "usa-footer__nav", "aria-label": navAriaLabel, children: /* @__PURE__ */ jsx("ul", { className: "grid-row grid-gap", children: navLinks.map((link, i) => /* @__PURE__ */ jsx("li", { className: "mobile-lg:grid-col-6 desktop:grid-col-auto usa-footer__primary-content", children: /* @__PURE__ */ jsx("a", { className: "usa-footer__primary-link", href: link.href, "aria-label": link.ariaLabel || void 0, children: link.text }) }, i)) }) }) }),
2013
- contactEl && /* @__PURE__ */ jsx("div", { className: "mobile-lg:grid-col-4", children: contactEl })
2020
+ slimContactLinks.length > 0 && /* @__PURE__ */ jsx("div", { className: "mobile-lg:grid-col-4", children: /* @__PURE__ */ jsx("address", { className: "usa-footer__address usx-footer__contact", children: /* @__PURE__ */ jsx("div", { className: "grid-row grid-gap", children: slimContactLinks.map((link, index) => /* @__PURE__ */ jsx("div", { className: "grid-col-auto mobile-lg:grid-col-12 desktop:grid-col-auto", children: /* @__PURE__ */ jsx("div", { className: "usa-footer__contact-info", children: /* @__PURE__ */ jsx("a", { href: link.href, children: link.text }) }) }, index)) }) }) })
2014
2021
  ] }) }),
2015
2022
  (brandingEl || secondaryChildren) && /* @__PURE__ */ jsx("div", { className: "usa-footer__secondary-section", children: secondaryChildren ?? /* @__PURE__ */ jsx("div", { className: "grid-container", children: brandingEl }) })
2016
2023
  ] });
@@ -2047,13 +2054,13 @@ function Search({
2047
2054
  onSubmit(query);
2048
2055
  }
2049
2056
  };
2050
- const iconClasses = classNames(
2057
+ const iconClasses = ClassNames(
2051
2058
  "usa-search__submit-icon",
2052
2059
  {
2053
2060
  "display-inline-block": iconOnly
2054
2061
  }
2055
2062
  );
2056
- const formClasses = classNames(
2063
+ const formClasses = ClassNames(
2057
2064
  "usa-search",
2058
2065
  {
2059
2066
  "usa-search--small": iconOnly && !big,
@@ -2106,7 +2113,7 @@ function PrimaryNav({
2106
2113
  headerId = "header",
2107
2114
  renderSearchDirectly = false
2108
2115
  }) {
2109
- const navClasses = classNames("usa-nav__primary", "usa-accordion");
2116
+ const navClasses = ClassNames("usa-nav__primary", "usa-accordion");
2110
2117
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2111
2118
  /* @__PURE__ */ jsx("button", { type: "button", className: "usa-nav__close", children: /* @__PURE__ */ jsx(Icon, { name: "close" }) }),
2112
2119
  /* @__PURE__ */ jsx("ul", { className: navClasses, children: navSections.map((section, index) => /* @__PURE__ */ jsx("li", { className: "usa-nav__primary-item", children: section.href ? /* @__PURE__ */ jsxs(
@@ -2183,6 +2190,7 @@ function PrimaryNav({
2183
2190
  function Header({
2184
2191
  id = "header",
2185
2192
  branding,
2193
+ staticBaseUrl,
2186
2194
  projectUrl = "/",
2187
2195
  navSections = [],
2188
2196
  secondaryLinks = [],
@@ -2196,7 +2204,7 @@ function Header({
2196
2204
  navEndContent = null,
2197
2205
  ...props
2198
2206
  }) {
2199
- const headerClasses = classNames(
2207
+ const headerClasses = ClassNames(
2200
2208
  "usa-header",
2201
2209
  "usx-header",
2202
2210
  { "usa-header--basic": !extended },
@@ -2204,13 +2212,13 @@ function Header({
2204
2212
  { "usa-header--extended": extended },
2205
2213
  className
2206
2214
  );
2207
- const navClasses = classNames(
2215
+ const navClasses = ClassNames(
2208
2216
  "usa-nav",
2209
2217
  "usx-nav",
2210
2218
  { "usx-nav--sticky": stickyNav }
2211
2219
  );
2212
2220
  const navbar = /* @__PURE__ */ jsxs("div", { className: "usa-navbar", children: [
2213
- /* @__PURE__ */ jsx(Branding, { branding, projectUrl }),
2221
+ /* @__PURE__ */ jsx(Branding, { branding, projectUrl, staticBaseUrl }),
2214
2222
  /* @__PURE__ */ jsx("button", { type: "button", className: "usa-menu-btn align-center", children: useMenuIcon ? /* @__PURE__ */ jsx(Icon, { name: "menu", size: 3 }) : "Menu" })
2215
2223
  ] });
2216
2224
  if (extended) {
@@ -2268,7 +2276,7 @@ function Hero({
2268
2276
  title = "",
2269
2277
  callout = "",
2270
2278
  paragraph = "",
2271
- button = null,
2279
+ buttonProps = null,
2272
2280
  searchProps = null,
2273
2281
  backgroundImage = "",
2274
2282
  backgroundPosition,
@@ -2287,7 +2295,7 @@ function Hero({
2287
2295
  const Heading = headingLevel;
2288
2296
  const secondaryHeadings = { h1: "h2", h2: "h3", h3: "h4", h4: "h5", h5: "h6" };
2289
2297
  const SecondaryHeading = secondaryHeadings[headingLevel];
2290
- const classes = [
2298
+ const classes = ClassNames(
2291
2299
  "usx-hero",
2292
2300
  overlay && "usx-hero--has-overlay",
2293
2301
  overlayOpacity !== void 0 && "usx-hero--custom-overlay",
@@ -2295,7 +2303,7 @@ function Hero({
2295
2303
  !boxed && "usx-hero--unboxed",
2296
2304
  secondaryContent && "usx-hero--split",
2297
2305
  className
2298
- ].filter(Boolean).join(" ");
2306
+ );
2299
2307
  const heroStyle = {
2300
2308
  ...backgroundImage ? { backgroundImage: `url('${backgroundImage}')` } : {},
2301
2309
  ...backgroundPosition ? { backgroundPosition } : {},
@@ -2310,7 +2318,7 @@ function Hero({
2310
2318
  ] }),
2311
2319
  paragraph && /* @__PURE__ */ jsx("p", { className: "usx-hero__paragraph", children: paragraph }),
2312
2320
  searchProps && /* @__PURE__ */ jsx(Search, { ...searchProps }),
2313
- !searchProps && button && /* @__PURE__ */ jsx(Button, { variant: "primary", href: button.href, onClick: button.onClick, children: button.text })
2321
+ !searchProps && buttonProps && /* @__PURE__ */ jsx(Button, { ...buttonProps })
2314
2322
  ] }),
2315
2323
  secondaryContent && /* @__PURE__ */ jsxs("div", { className: "usx-hero__secondary", children: [
2316
2324
  secondaryContent.title && /* @__PURE__ */ jsx(SecondaryHeading, { className: "usx-hero__secondary-heading", children: secondaryContent.title }),
@@ -2326,15 +2334,15 @@ function renderContent$1(content) {
2326
2334
  return content;
2327
2335
  }
2328
2336
  function IconList({ items = [], primary = false, size = null, className = "", ...props }) {
2329
- const classes = classNames(
2337
+ const classes = ClassNames(
2330
2338
  "usa-icon-list",
2331
2339
  "usx-icon-list",
2332
2340
  primary && "usa-icon-list--primary",
2333
2341
  size === "lg" && "usa-icon-list--size-lg",
2334
2342
  className
2335
2343
  );
2336
- return /* @__PURE__ */ jsx("ul", { className: classes, ...props, children: items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: classNames("usa-icon-list__item", item.itemClassName), children: [
2337
- /* @__PURE__ */ jsx("div", { className: classNames("usa-icon-list__icon", item.iconColor && `text-${item.iconColor}`, item.iconClassName), children: /* @__PURE__ */ jsx(
2344
+ return /* @__PURE__ */ jsx("ul", { className: classes, ...props, children: items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: ClassNames("usa-icon-list__item", item.itemClassName), children: [
2345
+ /* @__PURE__ */ jsx("div", { className: ClassNames("usa-icon-list__icon", item.iconColor && `text-${item.iconColor}`, item.iconClassName), children: /* @__PURE__ */ jsx(
2338
2346
  Icon,
2339
2347
  {
2340
2348
  name: item.iconName,
@@ -2343,7 +2351,7 @@ function IconList({ items = [], primary = false, size = null, className = "", ..
2343
2351
  className: item.iconClassName
2344
2352
  }
2345
2353
  ) }),
2346
- /* @__PURE__ */ jsxs("div", { className: classNames("usa-icon-list__content", item.contentClassName), children: [
2354
+ /* @__PURE__ */ jsxs("div", { className: ClassNames("usa-icon-list__content", item.contentClassName), children: [
2347
2355
  item.title ? /* @__PURE__ */ jsx("h4", { className: "usa-icon-list__title", children: item.title }) : null,
2348
2356
  renderContent$1(item.content)
2349
2357
  ] })
@@ -2424,7 +2432,7 @@ function Identifier({
2424
2432
  overlapAvatars = false,
2425
2433
  className = ""
2426
2434
  }) {
2427
- const classes = classNames("usa-identifier", "usx-identifier", className);
2435
+ const classes = ClassNames("usa-identifier", "usx-identifier", className);
2428
2436
  const labels = {
2429
2437
  masthead: language === "es" ? "Identificador de la agencia," : "Agency identifier,",
2430
2438
  description: language === "es" ? "Descripcion de la agencia," : "Agency description,",
@@ -2438,7 +2446,7 @@ function Identifier({
2438
2446
  avatarProps.length > 0 ? /* @__PURE__ */ jsx(
2439
2447
  "div",
2440
2448
  {
2441
- className: classNames(
2449
+ className: ClassNames(
2442
2450
  "usa-identifier__logos",
2443
2451
  "usx-avatar-group",
2444
2452
  overlapAvatars && "usa-avatar-group--overlap"
@@ -2449,8 +2457,8 @@ function Identifier({
2449
2457
  ...avatar,
2450
2458
  key: `${avatar.alt}-${index}`,
2451
2459
  shape: avatar.shape || logoShape,
2452
- className: classNames("usa-identifier__logo", avatar.className),
2453
- imageClassName: classNames("usa-identifier__logo-img", avatar.imageClassName)
2460
+ className: ClassNames("usa-identifier__logo", avatar.className),
2461
+ imageClassName: ClassNames("usa-identifier__logo-img", avatar.imageClassName)
2454
2462
  }
2455
2463
  ))
2456
2464
  }
@@ -2491,7 +2499,7 @@ function InPageNav({
2491
2499
  "aside",
2492
2500
  {
2493
2501
  id,
2494
- className: classNames("usa-in-page-nav", "usx-in-page-nav", className),
2502
+ className: ClassNames("usa-in-page-nav", "usx-in-page-nav", className),
2495
2503
  "data-heading-elements": headingElements,
2496
2504
  "data-main-content-selector": resolvedSelector,
2497
2505
  "data-title-heading-level": titleHeadingLevel,
@@ -2507,7 +2515,7 @@ function InPageNav({
2507
2515
  "div",
2508
2516
  {
2509
2517
  id: contentId,
2510
- className: classNames("usx-in-page-nav__content", "usa-prose", contentClassName),
2518
+ className: ClassNames("usx-in-page-nav__content", "usa-prose", contentClassName),
2511
2519
  ...children ? {} : { dangerouslySetInnerHTML: { __html: content } },
2512
2520
  children: children || null
2513
2521
  }
@@ -2515,12 +2523,12 @@ function InPageNav({
2515
2523
  ] });
2516
2524
  }
2517
2525
  function Indicator({ items = [], children = null, className = "", ...props }) {
2518
- const classes = classNames("usx-indicator", className);
2526
+ const classes = ClassNames("usx-indicator", className);
2519
2527
  return /* @__PURE__ */ jsxs("div", { className: classes, ...props, children: [
2520
2528
  items.map((item, index) => /* @__PURE__ */ jsx(
2521
2529
  "span",
2522
2530
  {
2523
- className: classNames("usx-indicator-item", item.className),
2531
+ className: ClassNames("usx-indicator-item", item.className),
2524
2532
  style: item.style,
2525
2533
  children: item.label
2526
2534
  },
@@ -2557,11 +2565,11 @@ function MenuLanguageSelector({
2557
2565
  className,
2558
2566
  navAriaLabel
2559
2567
  }) {
2560
- const containerClasses = classNames(
2568
+ const containerClasses = ClassNames(
2561
2569
  "usa-language-container",
2562
2570
  small && "usa-language--small"
2563
2571
  );
2564
- const buttonClasses = classNames(
2572
+ const buttonClasses = ClassNames(
2565
2573
  "usa-button",
2566
2574
  "usx-button",
2567
2575
  unstyled ? "usa-button--unstyled" : "usa-button--primary",
@@ -2605,7 +2613,7 @@ function LanguageSelector({
2605
2613
  ...props
2606
2614
  }) {
2607
2615
  const resolvedVariant = variant || (languages.length > 2 ? "menu" : "two");
2608
- const classes = classNames("usx-language-selector", className);
2616
+ const classes = ClassNames("usx-language-selector", className);
2609
2617
  if (!languages || languages.length === 0) {
2610
2618
  return /* @__PURE__ */ jsx("div", { className: classes, children: "LanguageSelector" });
2611
2619
  }
@@ -2638,7 +2646,7 @@ function LanguageSelector({
2638
2646
  );
2639
2647
  }
2640
2648
  function SingleColumnLayout({ children, expandButton = null, className = "", ...props }) {
2641
- const classes = ["usx-layout__single-column", className].filter(Boolean).join(" ");
2649
+ const classes = ClassNames("usx-layout__single-column", className);
2642
2650
  return /* @__PURE__ */ jsxs("div", { className: classes, ...props, children: [
2643
2651
  expandButton,
2644
2652
  children
@@ -2655,24 +2663,24 @@ function GridLayout({
2655
2663
  ...props
2656
2664
  }) {
2657
2665
  const contentModifier = rightSidebar && !leftSidebar ? "left" : leftSidebar && !rightSidebar ? "right" : null;
2658
- const contentClasses = classNames(
2666
+ const contentClasses = ClassNames(
2659
2667
  "usx-layout__content",
2660
2668
  {
2661
2669
  "usx-layout__content--left": contentModifier === "left",
2662
2670
  "usx-layout__content--right": contentModifier === "right"
2663
2671
  }
2664
2672
  );
2665
- const containerClasses = classNames(
2673
+ const containerClasses = ClassNames(
2666
2674
  "usx-layout__grid-container",
2667
2675
  className
2668
2676
  );
2669
- const leftSidebarClasses = classNames(
2677
+ const leftSidebarClasses = ClassNames(
2670
2678
  "usx-layout__sidebar--left",
2671
2679
  {
2672
2680
  "usx-layout__sidebar--expanded": expandLeftSidebar
2673
2681
  }
2674
2682
  );
2675
- const rightSidebarClasses = classNames(
2683
+ const rightSidebarClasses = ClassNames(
2676
2684
  "usx-layout__sidebar--right",
2677
2685
  {
2678
2686
  "usx-layout__sidebar--expanded": expandRightSidebar
@@ -2700,7 +2708,7 @@ function Layout({
2700
2708
  ...props
2701
2709
  }) {
2702
2710
  const [expanded, setExpanded] = useState(false);
2703
- const classes = classNames(
2711
+ const classes = ClassNames(
2704
2712
  "usx-layout",
2705
2713
  { "usx-expanded": expandable && expanded },
2706
2714
  className
@@ -2748,7 +2756,7 @@ function renderItems(items = [], parentOptions = {}) {
2748
2756
  const childUnstyled = objectItem && typeof item.unstyled === "boolean" ? item.unstyled : parentOptions.unstyled;
2749
2757
  const childClassName = objectItem && typeof item.className === "string" ? item.className : "";
2750
2758
  const ChildTag = childOrdered ? "ol" : "ul";
2751
- const childClasses = classNames(
2759
+ const childClasses = ClassNames(
2752
2760
  "usa-list",
2753
2761
  "usx-list",
2754
2762
  childUnstyled && "usa-list--unstyled",
@@ -2761,7 +2769,7 @@ function renderItems(items = [], parentOptions = {}) {
2761
2769
  });
2762
2770
  }
2763
2771
  function List({ items = [], ordered = false, unstyled = false, className = "", ...props }) {
2764
- const classes = classNames(
2772
+ const classes = ClassNames(
2765
2773
  "usa-list",
2766
2774
  "usx-list",
2767
2775
  unstyled && "usa-list--unstyled",
@@ -2794,7 +2802,7 @@ function Select({
2794
2802
  const selectClasses = "usa-select usx-select";
2795
2803
  const selectErrorClasses = "usa-input--error";
2796
2804
  const selectSuccessClasses = "usa-input--success";
2797
- const combinedSelectClasses = classNames(
2805
+ const combinedSelectClasses = ClassNames(
2798
2806
  selectClasses,
2799
2807
  hasError && selectErrorClasses,
2800
2808
  hasSuccess && selectSuccessClasses,
@@ -2958,7 +2966,7 @@ function MiscBanner({
2958
2966
  }) {
2959
2967
  const menuId = useId();
2960
2968
  const toggleId = useId();
2961
- const classes = ["usx-misc-banner", `bg-${tone}`, className].filter(Boolean).join(" ");
2969
+ const classes = ClassNames("usx-misc-banner", `bg-${tone}`, className);
2962
2970
  const mobileLinks = [];
2963
2971
  const hasLearnMoreLink = showLearnMore && Boolean(casualLinkText);
2964
2972
  const hasReturnLink = showReturnLink && Boolean(importantLinkText);
@@ -3045,7 +3053,7 @@ function Modal({
3045
3053
  children,
3046
3054
  ...props
3047
3055
  }) {
3048
- const classes = classNames("usa-modal", "usx-modal", {
3056
+ const classes = ClassNames("usa-modal", "usx-modal", {
3049
3057
  "usa-modal--lg": size === "lg",
3050
3058
  "usx-modal--lg-collapsed": size === "lg-collapsed"
3051
3059
  }, className);
@@ -3088,7 +3096,7 @@ function Page({
3088
3096
  className = "",
3089
3097
  ...props
3090
3098
  }) {
3091
- const classes = ["usx-page", className].filter(Boolean).join(" ");
3099
+ const classes = ClassNames("usx-page", className);
3092
3100
  const pageContent = children || content;
3093
3101
  const Element = element;
3094
3102
  return /* @__PURE__ */ jsxs(Element, { id, className: classes, ...props, children: [
@@ -3177,7 +3185,7 @@ function PaginationNavigation({
3177
3185
  lastClickTime.current = e.timeStamp;
3178
3186
  if (!isLastPage) onPageChange((prev) => unbounded ? prev + 1 : Math.min(prev + 1, totalPages));
3179
3187
  };
3180
- const navClasses = classNames(
3188
+ const navClasses = ClassNames(
3181
3189
  "usa-pagination",
3182
3190
  "usx-pagination__nav",
3183
3191
  { "usx-pagination__arrows-only": arrowsOnly },
@@ -3187,7 +3195,7 @@ function PaginationNavigation({
3187
3195
  /* @__PURE__ */ jsx(
3188
3196
  "li",
3189
3197
  {
3190
- className: classNames(
3198
+ className: ClassNames(
3191
3199
  "usa-pagination__item",
3192
3200
  "usa-pagination__arrow"
3193
3201
  ),
@@ -3195,7 +3203,7 @@ function PaginationNavigation({
3195
3203
  "a",
3196
3204
  {
3197
3205
  href: "#",
3198
- className: classNames(
3206
+ className: ClassNames(
3199
3207
  "usa-pagination__link",
3200
3208
  "usa-pagination__previous-page",
3201
3209
  isFirstPage && "display-none",
@@ -3210,7 +3218,7 @@ function PaginationNavigation({
3210
3218
  /* @__PURE__ */ jsx(
3211
3219
  "span",
3212
3220
  {
3213
- className: classNames(
3221
+ className: ClassNames(
3214
3222
  "usa-pagination__link-text",
3215
3223
  hideLinkText && "usa-sr-only"
3216
3224
  ),
@@ -3239,7 +3247,7 @@ function PaginationNavigation({
3239
3247
  "a",
3240
3248
  {
3241
3249
  href: "#",
3242
- className: classNames(
3250
+ className: ClassNames(
3243
3251
  "usa-pagination__button",
3244
3252
  isCurrent && "usa-current"
3245
3253
  ),
@@ -3253,7 +3261,7 @@ function PaginationNavigation({
3253
3261
  /* @__PURE__ */ jsx(
3254
3262
  "li",
3255
3263
  {
3256
- className: classNames(
3264
+ className: ClassNames(
3257
3265
  "usa-pagination__item",
3258
3266
  "usa-pagination__arrow"
3259
3267
  ),
@@ -3261,7 +3269,7 @@ function PaginationNavigation({
3261
3269
  "a",
3262
3270
  {
3263
3271
  href: "#",
3264
- className: classNames(
3272
+ className: ClassNames(
3265
3273
  "usa-pagination__link",
3266
3274
  "usa-pagination__next-page",
3267
3275
  isLastPage && "display-none",
@@ -3275,7 +3283,7 @@ function PaginationNavigation({
3275
3283
  /* @__PURE__ */ jsx(
3276
3284
  "span",
3277
3285
  {
3278
- className: classNames(
3286
+ className: ClassNames(
3279
3287
  "usa-pagination__link-text",
3280
3288
  hideLinkText && "usa-sr-only"
3281
3289
  ),
@@ -3298,7 +3306,7 @@ function PaginationStepOptions({
3298
3306
  id = "pagination-step-options",
3299
3307
  className = ""
3300
3308
  }) {
3301
- const classes = classNames(
3309
+ const classes = ClassNames(
3302
3310
  "usx-pagination__step-options",
3303
3311
  className
3304
3312
  );
@@ -3326,7 +3334,7 @@ function PaginationSummary({
3326
3334
  }) {
3327
3335
  const firstItem = (currentPage - 1) * pageSize + 1;
3328
3336
  const lastItem = Math.min(currentPage * pageSize, totalItems);
3329
- const classes = classNames(
3337
+ const classes = ClassNames(
3330
3338
  "usa-label",
3331
3339
  "usx-label",
3332
3340
  "usx-pagination__summary",
@@ -3352,7 +3360,7 @@ function PaginationContainer({
3352
3360
  className = "",
3353
3361
  ...props
3354
3362
  }) {
3355
- const classes = ["usx-pagination__container", className].filter(Boolean).join(" ");
3363
+ const classes = ClassNames("usx-pagination__container", className);
3356
3364
  return /* @__PURE__ */ jsxs("div", { className: classes, ...props, children: [
3357
3365
  summary && /* @__PURE__ */ jsx("div", { className: "usx-pagination__container-summary", children: summary }),
3358
3366
  (stepOptions || navigation) && /* @__PURE__ */ jsxs("div", { className: "usx-pagination__container-end", children: [
@@ -3398,7 +3406,7 @@ function Pagination({
3398
3406
  onPageSizeChange == null ? void 0 : onPageSizeChange(size, newPage);
3399
3407
  onPageChange == null ? void 0 : onPageChange(newPage, size);
3400
3408
  };
3401
- const classes = ["usx-pagination", className].filter(Boolean).join(" ");
3409
+ const classes = ClassNames("usx-pagination", className);
3402
3410
  return /* @__PURE__ */ jsx("div", { className: classes, children: /* @__PURE__ */ jsx(
3403
3411
  PaginationContainer,
3404
3412
  {
@@ -3442,15 +3450,49 @@ function renderContent(content) {
3442
3450
  return content;
3443
3451
  }
3444
3452
  const ProcessList = ({ items = [], className = "", ...props }) => {
3445
- const classes = classNames("usa-process-list", "usx-process-list", className);
3453
+ const classes = ClassNames("usa-process-list", "usx-process-list", className);
3446
3454
  return /* @__PURE__ */ jsx("ol", { className: classes, ...props, children: items.map((item, index) => {
3447
3455
  const HeadingTag = item.headingTag || "h4";
3448
- return /* @__PURE__ */ jsxs("li", { className: classNames("usa-process-list__item", item.className), children: [
3449
- /* @__PURE__ */ jsx(HeadingTag, { className: classNames("usa-process-list__heading", item.headingClassName), children: item.heading }),
3450
- item.body && (typeof item.body === "string" || item.bodyClassName ? /* @__PURE__ */ jsx("p", { className: classNames(item.bodyClassName), children: renderContent(item.body) }) : renderContent(item.body))
3456
+ return /* @__PURE__ */ jsxs("li", { className: ClassNames("usa-process-list__item", item.className), children: [
3457
+ /* @__PURE__ */ jsx(HeadingTag, { className: ClassNames("usa-process-list__heading", item.headingClassName), children: item.heading }),
3458
+ item.body && (typeof item.body === "string" || item.bodyClassName ? /* @__PURE__ */ jsx("p", { className: ClassNames(item.bodyClassName), children: renderContent(item.body) }) : renderContent(item.body))
3451
3459
  ] }, index);
3452
3460
  }) });
3453
3461
  };
3462
+ function Quote({
3463
+ calloutProps,
3464
+ attributionProps,
3465
+ children,
3466
+ content,
3467
+ sourceLinkProps,
3468
+ sourceTitle,
3469
+ className,
3470
+ blockquoteClassName,
3471
+ ...props
3472
+ }) {
3473
+ const isVertical = (calloutProps == null ? void 0 : calloutProps.orientation) === "vertical";
3474
+ return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-quote", isVertical && "usx-quote--vertical", className), ...props, children: [
3475
+ !isVertical && /* @__PURE__ */ jsx(Icon, { name: "format_quote", size: 4, className: "usx-quote__icon" }),
3476
+ /* @__PURE__ */ jsx(Callout, { ...calloutProps, element: "div", children: /* @__PURE__ */ jsxs("figure", { className: "usx-quote__body", children: [
3477
+ /* @__PURE__ */ jsxs(
3478
+ "blockquote",
3479
+ {
3480
+ className: ClassNames("usx-quote__content", blockquoteClassName),
3481
+ cite: sourceLinkProps == null ? void 0 : sourceLinkProps.href,
3482
+ children: [
3483
+ isVertical && "❝",
3484
+ children ?? content,
3485
+ isVertical && "❞"
3486
+ ]
3487
+ }
3488
+ ),
3489
+ (attributionProps || sourceTitle) && /* @__PURE__ */ jsxs("figcaption", { className: "usx-quote__attribution", children: [
3490
+ attributionProps && /* @__PURE__ */ jsx(Attribution, { ...attributionProps }),
3491
+ sourceTitle && /* @__PURE__ */ jsx("cite", { children: sourceLinkProps ? /* @__PURE__ */ jsx(Link, { ...sourceLinkProps, children: sourceTitle }) : sourceTitle })
3492
+ ] })
3493
+ ] }) })
3494
+ ] });
3495
+ }
3454
3496
  const RadioButtons = ({
3455
3497
  tile = false,
3456
3498
  small = false,
@@ -3464,13 +3506,13 @@ const RadioButtons = ({
3464
3506
  className = "",
3465
3507
  ...props
3466
3508
  }) => {
3467
- const classes = classNames(
3509
+ const classes = ClassNames(
3468
3510
  "usa-radio",
3469
3511
  "usx-radio",
3470
3512
  { "usx-radio--small": small },
3471
3513
  className
3472
3514
  );
3473
- const inputClasses = classNames(
3515
+ const inputClasses = ClassNames(
3474
3516
  "usa-radio__input",
3475
3517
  { "usa-radio__input--tile": tile }
3476
3518
  );
@@ -3525,7 +3567,7 @@ function RangeSlider({
3525
3567
  /* @__PURE__ */ jsx(
3526
3568
  "input",
3527
3569
  {
3528
- className: ["usa-range", "usx-range-slider", className].filter(Boolean).join(" "),
3570
+ className: ClassNames("usa-range", "usx-range-slider", className),
3529
3571
  id,
3530
3572
  type: "range",
3531
3573
  name: name || id,
@@ -3547,15 +3589,17 @@ function RangeSlider({
3547
3589
  }
3548
3590
  const Section = ({
3549
3591
  title = "",
3592
+ headingLevel = "h2",
3550
3593
  children = null,
3551
3594
  content = null,
3552
3595
  className = "",
3553
3596
  ...props
3554
3597
  }) => {
3555
- const classes = ["usx-section", className].filter(Boolean).join(" ");
3598
+ const classes = ClassNames("usx-section", className);
3556
3599
  const sectionContent = children || content;
3600
+ const Heading = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(headingLevel) ? headingLevel : "h2";
3557
3601
  return /* @__PURE__ */ jsxs("section", { className: classes, ...props, children: [
3558
- title ? /* @__PURE__ */ jsx("h2", { className: "usx-section__title", children: title }) : null,
3602
+ title ? /* @__PURE__ */ jsx(Heading, { className: "usx-section__title", children: title }) : null,
3559
3603
  /* @__PURE__ */ jsx("div", { className: "usx-section__content", children: sectionContent })
3560
3604
  ] });
3561
3605
  };
@@ -3582,7 +3626,7 @@ const SideNav = ({
3582
3626
  className = "",
3583
3627
  ...props
3584
3628
  }) => {
3585
- const classes = classNames(
3629
+ const classes = ClassNames(
3586
3630
  "usa-sidenav",
3587
3631
  "usx-sidenav",
3588
3632
  {
@@ -3608,7 +3652,7 @@ const SiteAlert = ({
3608
3652
  }) => {
3609
3653
  const normalizedVariant = ["info", "emergency", "maintenance", "maintenance-warning"].includes(variant) ? variant : "info";
3610
3654
  const alertVariant = normalizedVariant === "maintenance" ? "error" : normalizedVariant === "maintenance-warning" ? "warning" : normalizedVariant;
3611
- const classes = [
3655
+ const classes = ClassNames(
3612
3656
  "usa-site-alert",
3613
3657
  "usx-site-alert",
3614
3658
  (normalizedVariant === "info" || normalizedVariant === "emergency") && `usa-site-alert--${normalizedVariant}`,
@@ -3617,8 +3661,8 @@ const SiteAlert = ({
3617
3661
  noIcon && "usa-site-alert--no-icon",
3618
3662
  onDismiss && "usa-site-alert--dismissible",
3619
3663
  className
3620
- ].filter(Boolean).join(" ");
3621
- const alertClasses = [
3664
+ );
3665
+ const alertClasses = ClassNames(
3622
3666
  "usa-alert",
3623
3667
  `usa-alert--${alertVariant}`,
3624
3668
  "usx-alert",
@@ -3627,7 +3671,7 @@ const SiteAlert = ({
3627
3671
  slim && "usx-alert--slim",
3628
3672
  noIcon && "usa-alert--no-icon",
3629
3673
  noIcon && "usx-alert--no-icon"
3630
- ].filter(Boolean).join(" ");
3674
+ );
3631
3675
  return /* @__PURE__ */ jsx(
3632
3676
  "section",
3633
3677
  {
@@ -3681,7 +3725,7 @@ const Skipnav = ({
3681
3725
  className = "",
3682
3726
  ...props
3683
3727
  }) => {
3684
- const classes = classNames("usa-skipnav", className);
3728
+ const classes = ClassNames("usa-skipnav", className);
3685
3729
  const finalHref = normalizeHref({ href, target });
3686
3730
  return /* @__PURE__ */ jsx("a", { className: classes, href: finalHref, ...props, children: children || content || "Skip to main content" });
3687
3731
  };
@@ -3692,7 +3736,7 @@ const Status = ({
3692
3736
  className = "",
3693
3737
  ...props
3694
3738
  }) => {
3695
- const classes = classNames(
3739
+ const classes = ClassNames(
3696
3740
  "usx-status",
3697
3741
  color && `text-${color}`,
3698
3742
  size && `usx-status--${size}`,
@@ -3711,7 +3755,7 @@ const StepIndicator = ({
3711
3755
  }) => {
3712
3756
  var _a;
3713
3757
  const step = Number(currentStep);
3714
- const classes = classNames(
3758
+ const classes = ClassNames(
3715
3759
  "usa-step-indicator",
3716
3760
  "usx-step-indicator",
3717
3761
  variant && `usa-step-indicator--${variant}`,
@@ -3730,7 +3774,7 @@ const StepIndicator = ({
3730
3774
  return /* @__PURE__ */ jsx(
3731
3775
  "li",
3732
3776
  {
3733
- className: classNames(
3777
+ className: ClassNames(
3734
3778
  "usa-step-indicator__segment",
3735
3779
  status === "complete" && "usa-step-indicator__segment--complete",
3736
3780
  status === "current" && "usa-step-indicator__segment--current"
@@ -3768,7 +3812,7 @@ const SummaryBox = ({
3768
3812
  className = "",
3769
3813
  ...props
3770
3814
  }) => {
3771
- const classes = classNames("usa-summary-box", "usx-summary-box", className);
3815
+ const classes = ClassNames("usa-summary-box", "usx-summary-box", className);
3772
3816
  const headingId = id;
3773
3817
  const bodyContent = children ?? content;
3774
3818
  return /* @__PURE__ */ jsx(
@@ -3798,9 +3842,9 @@ const Swap = ({
3798
3842
  ...props
3799
3843
  }) => {
3800
3844
  const variantClass = variant !== "default" ? `usx-swap--${variant}` : "";
3801
- const classes = ["usx-swap", variantClass, className].filter(Boolean).join(" ");
3802
- const onClasses = ["usx-swap-on", onClassName].filter(Boolean).join(" ");
3803
- const offClasses = ["usx-swap-off", offClassName].filter(Boolean).join(" ");
3845
+ const classes = ClassNames("usx-swap", variantClass, className);
3846
+ const onClasses = ClassNames("usx-swap-on", onClassName);
3847
+ const offClasses = ClassNames("usx-swap-off", offClassName);
3804
3848
  const content = children || /* @__PURE__ */ jsxs(Fragment, { children: [
3805
3849
  includeInput ? /* @__PURE__ */ jsx("input", { type: "checkbox", autoComplete: "off", ...inputProps }) : null,
3806
3850
  /* @__PURE__ */ jsx("span", { className: onClasses, children: onContent }),
@@ -3822,7 +3866,7 @@ const Switch = ({
3822
3866
  indeterminate = false,
3823
3867
  ...props
3824
3868
  }) => {
3825
- const classes = classNames(
3869
+ const classes = ClassNames(
3826
3870
  "usx-switch",
3827
3871
  size && `usx-toggle-${size}`,
3828
3872
  variant && `text-${variant}`,
@@ -3930,7 +3974,7 @@ function SortIcon({ direction }) {
3930
3974
  function TableHead({ className = "", children, ...props }) {
3931
3975
  const { id, columns, sortState, handleSort, selectionMode, selectionPosition, handleSelectAll, allowSelectAll, rowDetails } = useTableContext();
3932
3976
  if (children) {
3933
- return /* @__PURE__ */ jsx("thead", { className: classNames("usx-table__head", className), ...props, children });
3977
+ return /* @__PURE__ */ jsx("thead", { className: ClassNames("usx-table__head", className), ...props, children });
3934
3978
  }
3935
3979
  const visibleCols = columns.filter((c) => !c.hidden);
3936
3980
  const totalDepth = getDepth(visibleCols);
@@ -3938,7 +3982,7 @@ function TableHead({ className = "", children, ...props }) {
3938
3982
  const hasRowDetails = !!rowDetails;
3939
3983
  const hasSelection = !!selectionMode;
3940
3984
  const selectAllCell = /* @__PURE__ */ jsx("th", { scope: "col", rowSpan: totalDepth, className: "usx-table__cell usx-table__cell--selection", children: selectionMode === "checkbox" && allowSelectAll && /* @__PURE__ */ jsx(Checkbox, { id: `${id}-select-all`, onChange: handleSelectAll, ariaLabel: "Select all rows", className: "usx-table__checkbox" }) });
3941
- return /* @__PURE__ */ jsxs("thead", { className: classNames("usx-table__head", className), ...props, children: [
3985
+ return /* @__PURE__ */ jsxs("thead", { className: ClassNames("usx-table__head", className), ...props, children: [
3942
3986
  /* @__PURE__ */ jsx("tr", { hidden: true, "aria-hidden": "true", children: /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("span", { className: "usa-sr-only usa-table__announcement-region", "aria-live": "polite", id: `${id}-sort-announcement` }) }) }),
3943
3987
  headerRows.map((row, rowIndex) => /* @__PURE__ */ jsxs("tr", { className: "usx-table__head-row", children: [
3944
3988
  hasRowDetails && rowIndex === 0 && /* @__PURE__ */ jsx("th", { scope: "col", rowSpan: totalDepth, className: "usx-table__cell usx-table__cell--detail-toggle", "aria-label": "Row details" }),
@@ -3946,7 +3990,7 @@ function TableHead({ className = "", children, ...props }) {
3946
3990
  row.map(({ col, rowSpan, colSpan }) => {
3947
3991
  const isSortable = col.sortable === true;
3948
3992
  const sortDir = sortState.key === col.key ? sortState.direction : null;
3949
- const cellClasses = classNames(
3993
+ const cellClasses = ClassNames(
3950
3994
  "usx-table__cell",
3951
3995
  col.headerAlign && `usx-table__cell--align-${col.headerAlign}`,
3952
3996
  !col.headerAlign && col.align && `usx-table__cell--align-${col.align}`,
@@ -3967,7 +4011,7 @@ function TableHead({ className = "", children, ...props }) {
3967
4011
  "button",
3968
4012
  {
3969
4013
  type: "button",
3970
- className: classNames("usx-table__sort-button", sortDir && "usx-table__sort-button--active"),
4014
+ className: ClassNames("usx-table__sort-button", sortDir && "usx-table__sort-button--active"),
3971
4015
  onClick: () => handleSort(col.key),
3972
4016
  children: [
3973
4017
  col.header,
@@ -3994,7 +4038,7 @@ function TableRow({
3994
4038
  }) {
3995
4039
  const { onClickRow } = useTableContext();
3996
4040
  const isClickable = !!(onClick || onClickRow);
3997
- const classes = classNames(
4041
+ const classes = ClassNames(
3998
4042
  "usx-table__row",
3999
4043
  selected && "usx-table__row--selected",
4000
4044
  disabled && "usx-table__row--disabled",
@@ -4040,7 +4084,7 @@ function TableGroup({
4040
4084
  }
4041
4085
  };
4042
4086
  return /* @__PURE__ */ jsxs(Fragment, { children: [
4043
- /* @__PURE__ */ jsx("tr", { className: classNames("usx-table__group-row", className), ...props, children: /* @__PURE__ */ jsx("td", { colSpan: colSpan || totalCols || 1, className: "usx-table__group-cell", children: /* @__PURE__ */ jsx("div", { className: "usx-accordion usa-accordion", children: /* @__PURE__ */ jsx("h4", { className: "usa-accordion__heading", children: /* @__PURE__ */ jsx(
4087
+ /* @__PURE__ */ jsx("tr", { className: ClassNames("usx-table__group-row", className), ...props, children: /* @__PURE__ */ jsx("td", { colSpan: colSpan || totalCols || 1, className: "usx-table__group-cell", children: /* @__PURE__ */ jsx("div", { className: "usx-accordion usa-accordion", children: /* @__PURE__ */ jsx("h4", { className: "usa-accordion__heading", children: /* @__PURE__ */ jsx(
4044
4088
  "button",
4045
4089
  {
4046
4090
  type: "button",
@@ -4143,7 +4187,7 @@ function DataRow({ row, rowIndex }) {
4143
4187
  "button",
4144
4188
  {
4145
4189
  type: "button",
4146
- className: classNames(
4190
+ className: ClassNames(
4147
4191
  "usa-button usa-button--unstyled",
4148
4192
  "usx-table__detail-toggle",
4149
4193
  "width-full",
@@ -4156,7 +4200,7 @@ function DataRow({ row, rowIndex }) {
4156
4200
  ) }, "__detail-toggle__") : null;
4157
4201
  const dataCells = visibleCols.map((col) => {
4158
4202
  const Tag2 = col.primary ? "th" : "td";
4159
- const cellClasses = classNames("usx-table__cell", col.align && `usx-table__cell--align-${col.align}`, col.className);
4203
+ const cellClasses = ClassNames("usx-table__cell", col.align && `usx-table__cell--align-${col.align}`, col.className);
4160
4204
  const dataLabel = responsive === "stack" || responsive === "stack-header" ? getDataLabel(col) : void 0;
4161
4205
  const content = col.render ? col.render(row, rowIndex) : row[col.key];
4162
4206
  return /* @__PURE__ */ jsx(
@@ -4183,7 +4227,7 @@ function DataRow({ row, rowIndex }) {
4183
4227
  }
4184
4228
  function TableBody({ className = "", children, ...props }) {
4185
4229
  const { data, primaryKey, groupBy, groups, placeholder, totalCols, onMore, loading } = useTableContext();
4186
- const bodyClass = classNames("usx-table__body", className);
4230
+ const bodyClass = ClassNames("usx-table__body", className);
4187
4231
  if (children) {
4188
4232
  return /* @__PURE__ */ jsx("tbody", { className: bodyClass, ...props, children });
4189
4233
  }
@@ -4227,12 +4271,12 @@ function aggregate(data, key, type) {
4227
4271
  function TableFoot({ className = "", children, ...props }) {
4228
4272
  const { columns, data, selectionMode, rowDetails } = useTableContext();
4229
4273
  if (children) {
4230
- return /* @__PURE__ */ jsx("tfoot", { className: classNames("usx-table__foot", className), ...props, children });
4274
+ return /* @__PURE__ */ jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...props, children });
4231
4275
  }
4232
4276
  const visibleCols = columns.filter((c) => !c.hidden);
4233
4277
  const hasFooter = visibleCols.some((c) => c.footer !== void 0 || c.aggregate);
4234
4278
  if (!hasFooter) return null;
4235
- return /* @__PURE__ */ jsx("tfoot", { className: classNames("usx-table__foot", className), ...props, children: /* @__PURE__ */ jsxs("tr", { className: "usx-table__foot-row", children: [
4279
+ return /* @__PURE__ */ jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...props, children: /* @__PURE__ */ jsxs("tr", { className: "usx-table__foot-row", children: [
4236
4280
  !!rowDetails && /* @__PURE__ */ jsx("td", { className: "usx-table__cell" }),
4237
4281
  !!selectionMode && /* @__PURE__ */ jsx("td", { className: "usx-table__cell usx-table__cell--selection" }),
4238
4282
  visibleCols.map((col) => {
@@ -4242,7 +4286,7 @@ function TableFoot({ className = "", children, ...props }) {
4242
4286
  } else if (col.aggregate) {
4243
4287
  content = aggregate(data, col.key, col.aggregate);
4244
4288
  }
4245
- return /* @__PURE__ */ jsx("td", { className: classNames("usx-table__cell", col.align && `usx-table__cell--align-${col.align}`), children: content }, col.key);
4289
+ return /* @__PURE__ */ jsx("td", { className: ClassNames("usx-table__cell", col.align && `usx-table__cell--align-${col.align}`), children: content }, col.key);
4246
4290
  })
4247
4291
  ] }) });
4248
4292
  }
@@ -4259,7 +4303,7 @@ function TableCell({
4259
4303
  ...props
4260
4304
  }) {
4261
4305
  const resolvedAlign = Tag2 === "th" ? headerAlign || align : align;
4262
- const classes = classNames("usx-table__cell", resolvedAlign && `usx-table__cell--align-${resolvedAlign}`, className);
4306
+ const classes = ClassNames("usx-table__cell", resolvedAlign && `usx-table__cell--align-${resolvedAlign}`, className);
4263
4307
  return /* @__PURE__ */ jsx(Tag2, { className: classes, colSpan, rowSpan, scope, "data-label": dataLabel, ...props, children });
4264
4308
  }
4265
4309
  function defaultCompareFn(a, b, key) {
@@ -4431,7 +4475,7 @@ function countLeafCols(columns) {
4431
4475
  }, 0);
4432
4476
  }
4433
4477
  function Caption({ className = "", children, ...rest }) {
4434
- return /* @__PURE__ */ jsx("caption", { className: classNames("usx-table__caption", className), ...rest, children });
4478
+ return /* @__PURE__ */ jsx("caption", { className: ClassNames("usx-table__caption", className), ...rest, children });
4435
4479
  }
4436
4480
  function Table({
4437
4481
  id: idProp,
@@ -4571,7 +4615,7 @@ function Table({
4571
4615
  loading
4572
4616
  ]
4573
4617
  );
4574
- const tableClasses = classNames(
4618
+ const tableClasses = ClassNames(
4575
4619
  "usa-table",
4576
4620
  striped && "usa-table--striped",
4577
4621
  borderless && "usa-table--borderless",
@@ -4641,7 +4685,7 @@ const TagGroup = ({
4641
4685
  className = "",
4642
4686
  ...props
4643
4687
  }) => {
4644
- const classes = classNames(
4688
+ const classes = ClassNames(
4645
4689
  "usx-tag-group",
4646
4690
  className
4647
4691
  );
@@ -4649,7 +4693,7 @@ const TagGroup = ({
4649
4693
  return /* @__PURE__ */ jsx("div", { className: classes, ...props, children: content });
4650
4694
  };
4651
4695
  function TaskList({ tasks = [], className }) {
4652
- return /* @__PURE__ */ jsx("ul", { className: classNames("usx-task-list", className), children: tasks == null ? void 0 : tasks.map((task, i) => {
4696
+ return /* @__PURE__ */ jsx("ul", { className: ClassNames("usx-task-list", className), children: tasks == null ? void 0 : tasks.map((task, i) => {
4653
4697
  return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Clickable, { href: task.href, className: "usx-task-list__item", children: [
4654
4698
  task.hint ? /* @__PURE__ */ jsxs("div", { className: "display-flex flex-column", children: [
4655
4699
  /* @__PURE__ */ jsx(Clickable.Link, { className: "usx-task-list__link", children: task.name }),
@@ -4681,7 +4725,7 @@ function ThemePicker({
4681
4725
  onChange == null ? void 0 : onChange(next);
4682
4726
  };
4683
4727
  const selectId = id || `theme-picker-${Math.random().toString(36).substr(2, 9)}`;
4684
- const classes = classNames("usx-theme-picker", { "usx-theme-picker--open": open }, className);
4728
+ const classes = ClassNames("usx-theme-picker", { "usx-theme-picker--open": open }, className);
4685
4729
  const themeOptions = themes.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: option.label }, option.value));
4686
4730
  return /* @__PURE__ */ jsx("div", { className: classes, children: open ? /* @__PURE__ */ jsxs("div", { className: "usx-theme-picker__panel", children: [
4687
4731
  /* @__PURE__ */ jsx(Label, { htmlFor: selectId, screenReaderOnly: true, children: label }),
@@ -4753,7 +4797,7 @@ function TimePicker({
4753
4797
  /* @__PURE__ */ jsx(
4754
4798
  "div",
4755
4799
  {
4756
- className: classNames(
4800
+ className: ClassNames(
4757
4801
  "usa-time-picker",
4758
4802
  "usx-time-picker",
4759
4803
  { "usx-combo-box--error": !!error },
@@ -4782,74 +4826,83 @@ function TimePicker({
4782
4826
  ] });
4783
4827
  return formGroup ? /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: content }) : content;
4784
4828
  }
4785
- const Toggle = ({
4829
+ function Toggle({
4786
4830
  options = [],
4787
4831
  value,
4788
4832
  defaultValue,
4789
4833
  onChange,
4790
4834
  name,
4791
4835
  id,
4836
+ ariaLabel,
4792
4837
  variant = "text",
4793
4838
  disabled = false,
4794
- className = "",
4839
+ required = false,
4840
+ className,
4841
+ "aria-label": nativeAriaLabel,
4842
+ "aria-labelledby": labelledBy,
4795
4843
  ...props
4796
- }) => {
4797
- const idRef = useRef(id || name || `toggle-${Math.random().toString(36).substr(2, 8)}`);
4798
- const generatedName = idRef.current;
4799
- const classes = [
4800
- "usa-button-group",
4801
- "usx-button-group",
4802
- "usa-button-group--segmented",
4803
- "usx-toggle",
4804
- variant === "icon" ? "usx-toggle--icon" : "",
4805
- className
4806
- ].filter(Boolean).join(" ");
4807
- return /* @__PURE__ */ jsx("ul", { className: classes, role: "radiogroup", "aria-disabled": disabled, ...props, children: options.map((opt, i) => {
4808
- const optValue = typeof opt === "object" ? opt.value ?? opt : opt;
4809
- const optLabel = typeof opt === "object" ? opt.label ?? opt : opt;
4810
- const optIcon = typeof opt === "object" ? opt.icon : void 0;
4811
- const optDisabled = typeof opt === "object" ? !!opt.disabled : false;
4812
- const inputId = `${generatedName}-${i}`;
4813
- return /* @__PURE__ */ jsxs("li", { className: `usa-button-group__item usx-toggle__item${optDisabled ? " usx-toggle__item--disabled" : ""}`, children: [
4814
- /* @__PURE__ */ jsx(
4815
- "input",
4816
- {
4817
- className: "usx-toggle__input",
4818
- type: "radio",
4819
- id: inputId,
4820
- name: name || generatedName,
4821
- value: optValue,
4822
- checked: value === optValue ? true : void 0,
4823
- defaultChecked: defaultValue === optValue ? true : void 0,
4824
- disabled: disabled ? true : optDisabled ? true : void 0,
4825
- onChange: onChange ? () => onChange(optValue) : void 0
4826
- }
4844
+ }) {
4845
+ const instanceId = useId();
4846
+ const groupId = id || `toggle-${instanceId}`;
4847
+ const groupName = name || groupId;
4848
+ const controlled = value !== void 0;
4849
+ return /* @__PURE__ */ jsx(
4850
+ "ul",
4851
+ {
4852
+ ...props,
4853
+ id: groupId,
4854
+ className: ClassNames(
4855
+ "usx-toggle",
4856
+ "usa-button-group",
4857
+ variant === "icon" && "usx-toggle--icon",
4858
+ className
4827
4859
  ),
4828
- /* @__PURE__ */ jsx("label", { htmlFor: inputId, className: "usa-button usx-button usa-button--outline", children: variant === "icon" && optIcon ? /* @__PURE__ */ jsx(Icon, { name: optIcon, className: "usx-toggle__label", ariaHidden: true }) : /* @__PURE__ */ jsx("span", { className: "usx-toggle__label", children: optLabel }) })
4829
- ] }, inputId);
4830
- }) });
4831
- };
4832
- const Tooltip = ({
4833
- label,
4834
- position = "top",
4835
- children,
4836
- className = "",
4837
- ...props
4838
- }) => {
4839
- const validPositions = ["top", "bottom", "left", "right"];
4840
- const normalizedPosition = validPositions.includes(position) ? position : "top";
4841
- return /* @__PURE__ */ jsxs("span", { className: classNames("usx-tooltip", className), ...props, children: [
4842
- children,
4843
- /* @__PURE__ */ jsx(
4844
- "span",
4845
- {
4846
- className: `usa-tooltip__body usa-tooltip__body--${normalizedPosition}`,
4847
- role: "tooltip",
4848
- children: label
4849
- }
4850
- )
4851
- ] });
4852
- };
4860
+ role: "radiogroup",
4861
+ "aria-labelledby": labelledBy,
4862
+ "aria-label": labelledBy ? void 0 : ariaLabel || nativeAriaLabel || name || "Choose an option",
4863
+ "aria-disabled": disabled || void 0,
4864
+ "aria-required": required || void 0,
4865
+ children: options.map((option, index) => {
4866
+ const opt = typeof option === "object" ? option : { value: option, label: option };
4867
+ const optionValue = opt.value ?? (typeof opt.label === "string" || typeof opt.label === "number" ? opt.label : index);
4868
+ const optionLabel = opt.label ?? String(optionValue);
4869
+ const inputId = `${groupId}-option-${index}`;
4870
+ const iconOnly = variant === "icon" && Boolean(opt.icon);
4871
+ return /* @__PURE__ */ jsxs("li", { className: "usa-button-group__item", role: "presentation", children: [
4872
+ /* @__PURE__ */ jsx(
4873
+ "input",
4874
+ {
4875
+ className: "usx-toggle__input",
4876
+ type: "radio",
4877
+ id: inputId,
4878
+ name: groupName,
4879
+ value: optionValue,
4880
+ ...controlled ? { checked: value === optionValue } : { defaultChecked: defaultValue === optionValue },
4881
+ disabled: disabled || opt.disabled,
4882
+ required,
4883
+ onChange: (event) => {
4884
+ if (event.target.checked) onChange == null ? void 0 : onChange(optionValue);
4885
+ }
4886
+ }
4887
+ ),
4888
+ /* @__PURE__ */ jsxs(
4889
+ "label",
4890
+ {
4891
+ htmlFor: inputId,
4892
+ className: "usa-button usx-button usa-button--primary usx-toggle__button",
4893
+ "aria-disabled": disabled || opt.disabled || void 0,
4894
+ title: iconOnly && (typeof optionLabel === "string" || typeof optionLabel === "number") ? String(optionLabel) : void 0,
4895
+ children: [
4896
+ opt.icon && /* @__PURE__ */ jsx(Icon, { name: opt.icon, className: "usx-toggle__icon", "aria-hidden": "true" }),
4897
+ /* @__PURE__ */ jsx("span", { className: iconOnly ? "usa-sr-only" : void 0, children: optionLabel })
4898
+ ]
4899
+ }
4900
+ )
4901
+ ] }, inputId);
4902
+ })
4903
+ }
4904
+ );
4905
+ }
4853
4906
  const Villain = ({
4854
4907
  title = "",
4855
4908
  callout = "",
@@ -4859,7 +4912,7 @@ const Villain = ({
4859
4912
  className = "",
4860
4913
  ...props
4861
4914
  }) => {
4862
- const classes = ["usa-hero", className].filter(Boolean).join(" ");
4915
+ const classes = ClassNames("usa-hero", className);
4863
4916
  return /* @__PURE__ */ jsx("section", { className: classes, "aria-label": ariaLabel, ...props, children: /* @__PURE__ */ jsx("div", { className: "grid-container", children: /* @__PURE__ */ jsxs("div", { className: "usa-hero__callout", children: [
4864
4917
  /* @__PURE__ */ jsxs("h1", { className: "usa-hero__heading", children: [
4865
4918
  callout && /* @__PURE__ */ jsx("span", { className: "usa-hero__heading--alt", children: callout }),
@@ -4877,11 +4930,11 @@ export {
4877
4930
  AvatarGroup,
4878
4931
  BackToTop,
4879
4932
  Banner,
4880
- Block,
4881
4933
  Breadcrumb,
4882
4934
  Button,
4883
4935
  ButtonGroup,
4884
4936
  CalendarDate,
4937
+ Callout,
4885
4938
  Card,
4886
4939
  CardGroup,
4887
4940
  Carousel,
@@ -4925,6 +4978,7 @@ export {
4925
4978
  Pagination,
4926
4979
  ProcessList,
4927
4980
  Prose,
4981
+ Quote,
4928
4982
  RadioButtons,
4929
4983
  RangeSlider,
4930
4984
  Required,