@solexllc/usx-react 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -0
- package/dist/index.cjs +576 -442
- package/dist/index.js +576 -442
- package/package.json +5 -5
- package/src/components/attribution/config.json +5 -5
- package/src/components/banner/config.json +2 -2
- package/src/components/breadcrumb/Breadcrumb.tsx +5 -6
- package/src/components/breadcrumb/config.json +11 -1
- package/src/components/button/button.html +2 -2
- package/src/components/button-group/button-group.django.html +1 -1
- package/src/components/calendar-date/calendar-date.django.html +3 -3
- package/src/components/callout/Callout.tsx +53 -0
- package/src/components/callout/callout.django.html +5 -0
- package/src/components/callout/callout.html +76 -0
- package/src/components/callout/config.json +74 -0
- package/src/components/card/Card.tsx +18 -34
- package/src/components/card/card.django.html +12 -10
- package/src/components/card/config.json +15 -40
- package/src/components/card-group/card-group.django.html +1 -1
- package/src/components/carousel/Carousel.tsx +3 -2
- package/src/components/carousel/carousel.django.html +13 -2
- package/src/components/carousel/config.json +2 -2
- package/src/components/character-count/config.json +2 -2
- package/src/components/checkbox-group/CheckboxGroup.tsx +10 -20
- package/src/components/checkbox-group/checkbox-group.django.html +10 -4
- package/src/components/checkbox-group/config.json +10 -5
- package/src/components/clickable/clickable.html +21 -39
- package/src/components/clickable/config.json +2 -2
- package/src/components/collection/Collection.tsx +5 -5
- package/src/components/collection/collection.django.html +2 -4
- package/src/components/collection/config.json +7 -6
- package/src/components/combobox/config.json +4 -4
- package/src/components/container/Container.tsx +108 -0
- package/src/components/container/_layout-classes.django.html +12 -0
- package/src/components/container/config.json +288 -0
- package/src/components/container/container.django.html +13 -0
- package/src/components/container/container.html +125 -0
- package/src/components/date-picker/config.json +4 -4
- package/src/components/date-range-picker/config.json +7 -7
- package/src/components/error-message/config.json +2 -2
- package/src/components/eyebrow/Eyebrow.tsx +2 -1
- package/src/components/eyebrow/config.json +2 -2
- package/src/components/fieldset/config.json +5 -5
- package/src/components/file-input/FileInput.tsx +3 -2
- package/src/components/file-input/config.json +5 -5
- package/src/components/file-list/FileList.tsx +2 -1
- package/src/components/file-list/config.json +2 -2
- package/src/components/footer/Footer.tsx +5 -5
- package/src/components/form-group/config.json +2 -2
- package/src/components/hero/Hero.tsx +8 -14
- package/src/components/hero/config.json +36 -27
- package/src/components/hero/hero.django.html +2 -2
- package/src/components/hint/config.json +2 -2
- package/src/components/in-page-nav/config.json +11 -1
- package/src/components/indicator/config.json +2 -2
- package/src/components/input/config.json +2 -2
- package/src/components/label/config.json +2 -2
- package/src/components/language-selector/config.json +2 -2
- package/src/components/layout/Layout.tsx +1 -1
- package/src/components/legend/config.json +3 -3
- package/src/components/link/config.json +2 -2
- package/src/components/memorable-date/config.json +9 -9
- package/src/components/misc-banner/MiscBanner.tsx +2 -1
- package/src/components/misc-banner/config.json +2 -2
- package/src/components/modal/config.json +2 -2
- package/src/components/page/Page.tsx +2 -1
- package/src/components/page/config.json +7 -7
- package/src/components/page/page.django.html +1 -1
- package/src/components/pagination/Pagination.tsx +2 -1
- package/src/components/pagination/container/PaginationContainer.tsx +2 -1
- package/src/components/prose/config.json +5 -1
- package/src/components/quote/Quote.tsx +58 -0
- package/src/components/quote/config.json +51 -0
- package/src/components/quote/quote.django.html +15 -0
- package/src/components/quote/quote.html +66 -0
- package/src/components/radio-buttons/config.json +3 -3
- package/src/components/range-slider/RangeSlider.tsx +2 -1
- package/src/components/range-slider/config.json +4 -4
- package/src/components/required/config.json +2 -2
- package/src/components/section/Section.tsx +6 -2
- package/src/components/section/config.json +19 -6
- package/src/components/section/section.django.html +9 -2
- package/src/components/select/config.json +2 -2
- package/src/components/site-alert/SiteAlert.tsx +5 -6
- package/src/components/skipnav/config.json +2 -2
- package/src/components/summary-box/config.json +3 -3
- package/src/components/swap/Swap.tsx +4 -3
- package/src/components/swap/config.json +4 -4
- package/src/components/switch/config.json +2 -2
- package/src/components/table/config.json +13 -3
- package/src/components/tag/config.json +2 -2
- package/src/components/tag-group/config.json +2 -2
- package/src/components/text-area/config.json +2 -2
- package/src/components/time-picker/config.json +4 -4
- package/src/components/toggle/Toggle.tsx +69 -40
- package/src/components/toggle/config.json +42 -10
- package/src/components/toggle/toggle.django.html +25 -17
- package/src/components/toggle/toggle.html +319 -85
- package/src/components/tooltip/config.json +2 -2
- package/src/components/villain/Villain.tsx +2 -1
- package/src/index.js +3 -1
- package/src/components/block/Block.tsx +0 -78
- package/src/components/block/block.django.html +0 -26
- package/src/components/block/block.html +0 -162
- package/src/components/block/config.json +0 -88
package/dist/index.cjs
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
(function(module2) {
|
|
19
19
|
(function() {
|
|
20
20
|
var hasOwn = {}.hasOwnProperty;
|
|
21
|
-
function
|
|
21
|
+
function classNames() {
|
|
22
22
|
var classes = "";
|
|
23
23
|
for (var i = 0; i < arguments.length; i++) {
|
|
24
24
|
var arg = arguments[i];
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
return "";
|
|
37
37
|
}
|
|
38
38
|
if (Array.isArray(arg)) {
|
|
39
|
-
return
|
|
39
|
+
return classNames.apply(null, arg);
|
|
40
40
|
}
|
|
41
41
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
42
42
|
return arg.toString();
|
|
@@ -59,17 +59,17 @@
|
|
|
59
59
|
return value + newClass;
|
|
60
60
|
}
|
|
61
61
|
if (module2.exports) {
|
|
62
|
-
|
|
63
|
-
module2.exports =
|
|
62
|
+
classNames.default = classNames;
|
|
63
|
+
module2.exports = classNames;
|
|
64
64
|
} else {
|
|
65
|
-
window.classNames =
|
|
65
|
+
window.classNames = classNames;
|
|
66
66
|
}
|
|
67
67
|
})();
|
|
68
68
|
})(classnames);
|
|
69
69
|
return classnames.exports;
|
|
70
70
|
}
|
|
71
71
|
var classnamesExports = requireClassnames();
|
|
72
|
-
const
|
|
72
|
+
const ClassNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
73
73
|
function AccordionItem({
|
|
74
74
|
title,
|
|
75
75
|
id,
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
headingLevel = "h3",
|
|
81
81
|
handleToggle
|
|
82
82
|
}) {
|
|
83
|
-
const headingClasses =
|
|
84
|
-
const contentClasses =
|
|
83
|
+
const headingClasses = ClassNames("usa-accordion__heading", headingClassName);
|
|
84
|
+
const contentClasses = ClassNames(
|
|
85
85
|
"usa-accordion__content",
|
|
86
86
|
"usa-prose",
|
|
87
87
|
contentClassName
|
|
@@ -123,9 +123,9 @@
|
|
|
123
123
|
className = "",
|
|
124
124
|
headingClassName = "",
|
|
125
125
|
contentClassName = "",
|
|
126
|
-
...
|
|
126
|
+
...props2
|
|
127
127
|
}) {
|
|
128
|
-
const accordionClasses =
|
|
128
|
+
const accordionClasses = ClassNames(
|
|
129
129
|
"usa-accordion",
|
|
130
130
|
"usx-accordion",
|
|
131
131
|
bordered && "usa-accordion--bordered",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
id,
|
|
139
139
|
className: accordionClasses,
|
|
140
140
|
"data-allow-multiple": multiselectable ? true : void 0,
|
|
141
|
-
...
|
|
141
|
+
...props2,
|
|
142
142
|
children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
143
143
|
AccordionItem,
|
|
144
144
|
{
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
staticBaseUrl,
|
|
170
170
|
staticUrlPrefix,
|
|
171
171
|
className = "",
|
|
172
|
-
...
|
|
172
|
+
...props2
|
|
173
173
|
}) {
|
|
174
174
|
const spritePrefix = staticUrlPrefix ?? getAssetUrl(`img/${source === "usx" ? "usx-sprite.svg" : "sprite.svg"}#`, staticBaseUrl);
|
|
175
175
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"aria-label": alt,
|
|
181
181
|
focusable: "false",
|
|
182
182
|
role: "img",
|
|
183
|
-
...
|
|
183
|
+
...props2,
|
|
184
184
|
children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: spritePrefix + name })
|
|
185
185
|
}
|
|
186
186
|
);
|
|
@@ -198,10 +198,10 @@
|
|
|
198
198
|
onDismiss = void 0,
|
|
199
199
|
staticBaseUrl,
|
|
200
200
|
children = null,
|
|
201
|
-
...
|
|
201
|
+
...props2
|
|
202
202
|
}) {
|
|
203
203
|
const normalizedVariant = variant && ["info", "warning", "success", "error", "emergency"].includes(variant) ? variant : null;
|
|
204
|
-
const classes =
|
|
204
|
+
const classes = ClassNames(
|
|
205
205
|
"usa-alert",
|
|
206
206
|
"usx-alert",
|
|
207
207
|
normalizedVariant ? `usa-alert--${normalizedVariant}` : "",
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
} else if (resolvedRole === "region") {
|
|
221
221
|
accessibilityProps["aria-label"] = heading || `${normalizedVariant} alert`;
|
|
222
222
|
}
|
|
223
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...accessibilityProps, ...
|
|
223
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...accessibilityProps, ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-alert__body", children: [
|
|
224
224
|
!slim && heading ? /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-alert__heading", children: heading }) : null,
|
|
225
225
|
children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-alert__text", children }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "usa-alert__text", children: text }),
|
|
226
226
|
onDismiss && /* @__PURE__ */ jsxRuntime.jsx("button", { className: "usx-alert__dismiss", "aria-label": "Dismiss alert", onClick: onDismiss, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "close", size: 3, staticBaseUrl }) })
|
|
@@ -244,25 +244,25 @@
|
|
|
244
244
|
className = "",
|
|
245
245
|
imageClassName = "",
|
|
246
246
|
contentClassName = "",
|
|
247
|
-
...
|
|
247
|
+
...props2
|
|
248
248
|
}) {
|
|
249
249
|
const isInitialsVariant = variant === "initials";
|
|
250
250
|
const isIconVariant = variant === "icon";
|
|
251
|
-
const wrapperClasses =
|
|
251
|
+
const wrapperClasses = ClassNames(
|
|
252
252
|
"usx-avatar",
|
|
253
253
|
className
|
|
254
254
|
);
|
|
255
|
-
const imgClasses =
|
|
255
|
+
const imgClasses = ClassNames(
|
|
256
256
|
"usx-avatar__img",
|
|
257
257
|
shape ? shapeClassMap[shape] : null,
|
|
258
258
|
imageClassName
|
|
259
259
|
);
|
|
260
|
-
const contentClasses =
|
|
260
|
+
const contentClasses = ClassNames(
|
|
261
261
|
"usx-avatar__content",
|
|
262
262
|
shape ? shapeClassMap[shape] : "usx-circle",
|
|
263
263
|
contentClassName
|
|
264
264
|
);
|
|
265
|
-
const avatarContent = isInitialsVariant ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: contentClasses, children: value }) : isIconVariant ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: contentClasses, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: value, alt: alt || `${value} icon` }) }) : /* @__PURE__ */ jsxRuntime.jsx("img", { className: imgClasses, src: src || void 0, alt: alt || void 0, role: "img", ...
|
|
265
|
+
const avatarContent = isInitialsVariant ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: contentClasses, children: value }) : isIconVariant ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: contentClasses, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: value, alt: alt || `${value} icon` }) }) : /* @__PURE__ */ jsxRuntime.jsx("img", { className: imgClasses, src: src || void 0, alt: alt || void 0, role: "img", ...props2 });
|
|
266
266
|
const avatar = /* @__PURE__ */ jsxRuntime.jsx("a", { href, className: wrapperClasses, "aria-label": isInitialsVariant || isIconVariant ? alt || void 0 : void 0, children: avatarContent });
|
|
267
267
|
if (tooltip) {
|
|
268
268
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "usx-tooltip", children: [
|
|
@@ -279,9 +279,9 @@
|
|
|
279
279
|
secondary,
|
|
280
280
|
children = null,
|
|
281
281
|
className = "",
|
|
282
|
-
...
|
|
282
|
+
...props2
|
|
283
283
|
}) {
|
|
284
|
-
const classes =
|
|
284
|
+
const classes = ClassNames("usx-attribution", className);
|
|
285
285
|
const mediaContent = avatarProps ? /* @__PURE__ */ jsxRuntime.jsx(Avatar, { ...avatarProps }) : media;
|
|
286
286
|
const content = children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
287
287
|
mediaContent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-attribution__media", children: mediaContent }),
|
|
@@ -290,16 +290,16 @@
|
|
|
290
290
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-attribution__secondary", children: secondary })
|
|
291
291
|
] })
|
|
292
292
|
] });
|
|
293
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
293
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: content });
|
|
294
294
|
}
|
|
295
|
-
function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, className = "", ...
|
|
296
|
-
const classes =
|
|
295
|
+
function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, className = "", ...props2 }) {
|
|
296
|
+
const classes = ClassNames(
|
|
297
297
|
"usx-avatar-group",
|
|
298
298
|
overlap && "usa-avatar-group--overlap",
|
|
299
299
|
stacked && "usa-avatar-group--stacked",
|
|
300
300
|
className
|
|
301
301
|
);
|
|
302
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
302
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: avatarProps.map((avatar, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
303
303
|
Avatar,
|
|
304
304
|
{
|
|
305
305
|
href: avatar.href,
|
|
@@ -323,25 +323,25 @@
|
|
|
323
323
|
iconSize = 2,
|
|
324
324
|
className = "",
|
|
325
325
|
onClick = void 0,
|
|
326
|
-
...
|
|
326
|
+
...props2
|
|
327
327
|
}) {
|
|
328
|
-
const icon = /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "arrow_upward", size: iconSize, className:
|
|
328
|
+
const icon = /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "arrow_upward", size: iconSize, className: ClassNames(
|
|
329
329
|
iconPosition === "left" ? "margin-right-05" : "margin-left-05"
|
|
330
330
|
) });
|
|
331
331
|
if (href) {
|
|
332
|
-
const linkClasses =
|
|
332
|
+
const linkClasses = ClassNames(
|
|
333
333
|
"usx-link",
|
|
334
334
|
"usx-no-visited",
|
|
335
335
|
"flex-align-center",
|
|
336
336
|
className
|
|
337
337
|
);
|
|
338
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("a", { className: linkClasses, href, ...
|
|
338
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("a", { className: linkClasses, href, ...props2, children: [
|
|
339
339
|
iconPosition === "left" && icon,
|
|
340
340
|
label,
|
|
341
341
|
iconPosition === "right" && icon
|
|
342
342
|
] });
|
|
343
343
|
}
|
|
344
|
-
const buttonClasses =
|
|
344
|
+
const buttonClasses = ClassNames(
|
|
345
345
|
"usa-button",
|
|
346
346
|
"usx-button",
|
|
347
347
|
variant === "primary" && "usa-button--primary",
|
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
type: "button",
|
|
355
355
|
className: buttonClasses,
|
|
356
356
|
onClick: onClick || (() => window.scrollTo({ top: 0, behavior: "smooth" })),
|
|
357
|
-
...
|
|
357
|
+
...props2,
|
|
358
358
|
children: [
|
|
359
359
|
iconPosition === "left" && icon,
|
|
360
360
|
label,
|
|
@@ -386,14 +386,14 @@
|
|
|
386
386
|
" website. Share sensitive information only on official, secure websites."
|
|
387
387
|
] }),
|
|
388
388
|
className = "",
|
|
389
|
-
...
|
|
389
|
+
...props2
|
|
390
390
|
}) {
|
|
391
|
-
const classes =
|
|
391
|
+
const classes = ClassNames(
|
|
392
392
|
"usa-banner",
|
|
393
393
|
"usx-banner",
|
|
394
394
|
className
|
|
395
395
|
);
|
|
396
|
-
return /* @__PURE__ */ jsxRuntime.jsx("section", { id, className: classes, "aria-label": ariaLabel, ...
|
|
396
|
+
return /* @__PURE__ */ jsxRuntime.jsx("section", { id, className: classes, "aria-label": ariaLabel, ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { id: `${id}-accordion`, className: "usa-accordion", children: [
|
|
397
397
|
/* @__PURE__ */ jsxRuntime.jsx("header", { className: "usa-banner__header", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-banner__inner", children: [
|
|
398
398
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-col-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
399
399
|
"img",
|
|
@@ -472,50 +472,6 @@
|
|
|
472
472
|
)
|
|
473
473
|
] }) });
|
|
474
474
|
}
|
|
475
|
-
function Block({
|
|
476
|
-
variant = null,
|
|
477
|
-
indent = null,
|
|
478
|
-
dedent = false,
|
|
479
|
-
big = false,
|
|
480
|
-
quote = false,
|
|
481
|
-
color,
|
|
482
|
-
contentClassName = "",
|
|
483
|
-
attribution = null,
|
|
484
|
-
children = null,
|
|
485
|
-
className = "",
|
|
486
|
-
...props
|
|
487
|
-
}) {
|
|
488
|
-
const isCallout = variant === "callout";
|
|
489
|
-
const classes = classNames(
|
|
490
|
-
"usx-block",
|
|
491
|
-
variant && `usx-block--${variant}`,
|
|
492
|
-
dedent && "usx-block--dedent",
|
|
493
|
-
indent && `usx-block--indent-${indent}`,
|
|
494
|
-
big && "usx-block--big",
|
|
495
|
-
quote && !isCallout && "display-flex flex-row",
|
|
496
|
-
isCallout && color && `usx-border-${color}`,
|
|
497
|
-
className
|
|
498
|
-
);
|
|
499
|
-
const contentClasses = classNames(
|
|
500
|
-
"usx-block__content",
|
|
501
|
-
!isCallout && color && `usx-border-${color}`,
|
|
502
|
-
contentClassName
|
|
503
|
-
);
|
|
504
|
-
const attributionNode = attribution ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-block__attribution", children: /* @__PURE__ */ jsxRuntime.jsx(Attribution, { ...attribution }) }) : null;
|
|
505
|
-
if (quote && !isCallout) {
|
|
506
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props, children: [
|
|
507
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "format_quote", size: 4, className: "usx-block__open-quote-icon" }),
|
|
508
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: contentClasses, children: [
|
|
509
|
-
children,
|
|
510
|
-
attributionNode
|
|
511
|
-
] })
|
|
512
|
-
] });
|
|
513
|
-
}
|
|
514
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props, children: [
|
|
515
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: contentClasses, children }),
|
|
516
|
-
attributionNode
|
|
517
|
-
] });
|
|
518
|
-
}
|
|
519
475
|
function Breadcrumb({
|
|
520
476
|
items = null,
|
|
521
477
|
wrap = false,
|
|
@@ -524,27 +480,27 @@
|
|
|
524
480
|
ariaLabel = "Breadcrumbs",
|
|
525
481
|
className = "",
|
|
526
482
|
children = null,
|
|
527
|
-
...
|
|
483
|
+
...props2
|
|
528
484
|
}) {
|
|
529
485
|
if (!items || items.length === 0) {
|
|
530
|
-
const classes =
|
|
531
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
486
|
+
const classes = ClassNames("usx-breadcrumb", className);
|
|
487
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: children || "Breadcrumb" });
|
|
532
488
|
}
|
|
533
|
-
const navClasses =
|
|
489
|
+
const navClasses = ClassNames(
|
|
534
490
|
"usa-breadcrumb",
|
|
535
491
|
"usx-breadcrumb",
|
|
536
492
|
wrap ? "usa-breadcrumb--wrap" : null,
|
|
537
493
|
truncate ? "usa-breadcrumb--truncate" : null,
|
|
538
494
|
className
|
|
539
|
-
|
|
540
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: navClasses, "aria-label": ariaLabel, ...
|
|
495
|
+
);
|
|
496
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: navClasses, "aria-label": ariaLabel, ...props2, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
541
497
|
"ol",
|
|
542
498
|
{
|
|
543
499
|
className: "usa-breadcrumb__list",
|
|
544
500
|
...rdfa ? { vocab: "http://schema.org/", typeof: "BreadcrumbList" } : {},
|
|
545
501
|
children: items.map((item, idx) => {
|
|
546
502
|
const isCurrent = !!item.current;
|
|
547
|
-
const liClass =
|
|
503
|
+
const liClass = ClassNames("usa-breadcrumb__list-item", isCurrent ? "usa-current" : null);
|
|
548
504
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
549
505
|
"li",
|
|
550
506
|
{
|
|
@@ -574,11 +530,11 @@
|
|
|
574
530
|
title = "Required",
|
|
575
531
|
children = null,
|
|
576
532
|
className = "",
|
|
577
|
-
...
|
|
533
|
+
...props2
|
|
578
534
|
}) => {
|
|
579
|
-
const classes =
|
|
535
|
+
const classes = ClassNames("usx-required", className);
|
|
580
536
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
581
|
-
/* @__PURE__ */ jsxRuntime.jsx("abbr", { title, className: classes, ...
|
|
537
|
+
/* @__PURE__ */ jsxRuntime.jsx("abbr", { title, className: classes, ...props2, children: "*" }),
|
|
582
538
|
" ",
|
|
583
539
|
children ? children : ""
|
|
584
540
|
] });
|
|
@@ -591,9 +547,9 @@
|
|
|
591
547
|
screenReaderOnly = false,
|
|
592
548
|
className = "",
|
|
593
549
|
classOverride = false,
|
|
594
|
-
...
|
|
550
|
+
...props2
|
|
595
551
|
}) {
|
|
596
|
-
const classes =
|
|
552
|
+
const classes = ClassNames(
|
|
597
553
|
"usa-label",
|
|
598
554
|
"usx-label",
|
|
599
555
|
{ "usa-sr-only": screenReaderOnly, "usa-label--error": !!error },
|
|
@@ -604,7 +560,7 @@
|
|
|
604
560
|
{
|
|
605
561
|
className: classOverride ? className : classes,
|
|
606
562
|
...htmlFor ? { htmlFor } : {},
|
|
607
|
-
...
|
|
563
|
+
...props2,
|
|
608
564
|
children: [
|
|
609
565
|
required && /* @__PURE__ */ jsxRuntime.jsx(Required, {}),
|
|
610
566
|
children
|
|
@@ -620,9 +576,9 @@
|
|
|
620
576
|
staticUrlPrefix,
|
|
621
577
|
staticBaseUrl,
|
|
622
578
|
className = "",
|
|
623
|
-
...
|
|
579
|
+
...props2
|
|
624
580
|
}) => {
|
|
625
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { role: "status", "aria-live": "polite", className: `usx-spinner ${className}`, ...
|
|
581
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { role: "status", "aria-live": "polite", className: `usx-spinner ${className}`, ...props2, children: [
|
|
626
582
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
627
583
|
Icon,
|
|
628
584
|
{
|
|
@@ -653,7 +609,7 @@
|
|
|
653
609
|
className = "",
|
|
654
610
|
children = "",
|
|
655
611
|
extraAttributes = {},
|
|
656
|
-
...
|
|
612
|
+
...props2
|
|
657
613
|
}) {
|
|
658
614
|
const leftIcons = iconProps.filter((icon) => (icon.position ?? "left") === "left");
|
|
659
615
|
const rightIcons = iconProps.filter((icon) => icon.position === "right");
|
|
@@ -671,7 +627,7 @@
|
|
|
671
627
|
outline: "usa-button--outline",
|
|
672
628
|
unstyled: "usa-button--unstyled"
|
|
673
629
|
};
|
|
674
|
-
const classes =
|
|
630
|
+
const classes = ClassNames(
|
|
675
631
|
"usa-button",
|
|
676
632
|
"usx-button",
|
|
677
633
|
variant && variantClasses[variant],
|
|
@@ -684,7 +640,7 @@
|
|
|
684
640
|
const {
|
|
685
641
|
// Remove unused variables
|
|
686
642
|
...anchorProps
|
|
687
|
-
} =
|
|
643
|
+
} = props2;
|
|
688
644
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
689
645
|
"a",
|
|
690
646
|
{
|
|
@@ -705,7 +661,7 @@
|
|
|
705
661
|
const {
|
|
706
662
|
// Remove unused variables
|
|
707
663
|
...buttonProps
|
|
708
|
-
} =
|
|
664
|
+
} = props2;
|
|
709
665
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
710
666
|
"button",
|
|
711
667
|
{
|
|
@@ -728,14 +684,14 @@
|
|
|
728
684
|
buttonProps = [],
|
|
729
685
|
segmented = false,
|
|
730
686
|
className = "",
|
|
731
|
-
...
|
|
687
|
+
...props2
|
|
732
688
|
}) {
|
|
733
|
-
const classes =
|
|
689
|
+
const classes = ClassNames(
|
|
734
690
|
"usa-button-group usx-button-group",
|
|
735
691
|
segmented && "usa-button-group--segmented",
|
|
736
692
|
className
|
|
737
693
|
);
|
|
738
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...
|
|
694
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props2, children: buttonProps.map(({ itemClassName, ...item }, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: ClassNames("usa-button-group__item", itemClassName), children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ...item, children: item.children }) }, index)) });
|
|
739
695
|
}
|
|
740
696
|
function CalendarDate({
|
|
741
697
|
datetime,
|
|
@@ -744,15 +700,15 @@
|
|
|
744
700
|
const date = new Date(datetime);
|
|
745
701
|
const month = date.toLocaleString("en-US", { month: "short", timeZone: "UTC" }).toUpperCase();
|
|
746
702
|
const day = date.toLocaleString("en-US", { day: "numeric", timeZone: "UTC" });
|
|
747
|
-
const dateClasses =
|
|
703
|
+
const dateClasses = ClassNames(
|
|
748
704
|
{ "usa-collection__calendar-date": underCollection },
|
|
749
705
|
"usx-calendar-date"
|
|
750
706
|
);
|
|
751
|
-
const monthClasses =
|
|
707
|
+
const monthClasses = ClassNames(
|
|
752
708
|
{ "usa-collection__calendar-date-month": underCollection },
|
|
753
709
|
"usx-calendar-date-month"
|
|
754
710
|
);
|
|
755
|
-
const dayClasses =
|
|
711
|
+
const dayClasses = ClassNames(
|
|
756
712
|
{ "usa-collection__calendar-date-day": underCollection },
|
|
757
713
|
"usx-calendar-date-day"
|
|
758
714
|
);
|
|
@@ -761,6 +717,40 @@
|
|
|
761
717
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: dayClasses, children: day })
|
|
762
718
|
] }) });
|
|
763
719
|
}
|
|
720
|
+
function Callout({
|
|
721
|
+
className,
|
|
722
|
+
strokeColor,
|
|
723
|
+
indent,
|
|
724
|
+
dedent,
|
|
725
|
+
big,
|
|
726
|
+
orientation = "horizontal",
|
|
727
|
+
children,
|
|
728
|
+
content,
|
|
729
|
+
backgroundColor,
|
|
730
|
+
textColor,
|
|
731
|
+
element = "div",
|
|
732
|
+
...props2
|
|
733
|
+
}) {
|
|
734
|
+
const Element = element;
|
|
735
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
736
|
+
Element,
|
|
737
|
+
{
|
|
738
|
+
className: ClassNames(
|
|
739
|
+
"usx-callout",
|
|
740
|
+
orientation === "vertical" && "usx-callout--vertical",
|
|
741
|
+
strokeColor && `border-${strokeColor}`,
|
|
742
|
+
indent && `usx-callout--indent-${indent}`,
|
|
743
|
+
dedent && "usx-callout--dedent",
|
|
744
|
+
(big ?? orientation === "horizontal") && "usx-callout--big",
|
|
745
|
+
backgroundColor && `bg-${backgroundColor}`,
|
|
746
|
+
textColor && `text-${textColor}`,
|
|
747
|
+
className
|
|
748
|
+
),
|
|
749
|
+
...props2,
|
|
750
|
+
children: children ?? content
|
|
751
|
+
}
|
|
752
|
+
);
|
|
753
|
+
}
|
|
764
754
|
const Tag = ({
|
|
765
755
|
id,
|
|
766
756
|
big = false,
|
|
@@ -774,10 +764,10 @@
|
|
|
774
764
|
},
|
|
775
765
|
className = "",
|
|
776
766
|
children,
|
|
777
|
-
...
|
|
767
|
+
...props2
|
|
778
768
|
}) => {
|
|
779
769
|
const [isVisible, setIsVisible] = React.useState(!isDismissed);
|
|
780
|
-
const classes =
|
|
770
|
+
const classes = ClassNames(
|
|
781
771
|
"usa-tag",
|
|
782
772
|
"usx-tag",
|
|
783
773
|
{ "usa-tag--big": big },
|
|
@@ -796,7 +786,7 @@
|
|
|
796
786
|
if (!isVisible) {
|
|
797
787
|
return null;
|
|
798
788
|
}
|
|
799
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { id, className: classes, ...
|
|
789
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { id, className: classes, ...props2, children: [
|
|
800
790
|
icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: big ? 3 : 2 }),
|
|
801
791
|
" ",
|
|
802
792
|
children || value,
|
|
@@ -826,9 +816,9 @@
|
|
|
826
816
|
staticBaseUrl,
|
|
827
817
|
srcSet,
|
|
828
818
|
className = "",
|
|
829
|
-
...
|
|
819
|
+
...props2
|
|
830
820
|
}) {
|
|
831
|
-
const classes =
|
|
821
|
+
const classes = ClassNames(
|
|
832
822
|
"usx-image",
|
|
833
823
|
{
|
|
834
824
|
"usx-image--rounded": rounded,
|
|
@@ -842,7 +832,7 @@
|
|
|
842
832
|
if (maxHeight) style.maxHeight = maxHeight;
|
|
843
833
|
if (maxHeight && !maxWidth) style.width = "auto";
|
|
844
834
|
if (maxWidth && !maxHeight) style.height = "auto";
|
|
845
|
-
const captionClasses =
|
|
835
|
+
const captionClasses = ClassNames(
|
|
846
836
|
"usx-image--caption",
|
|
847
837
|
{ "usa-sr-only": hideCaption }
|
|
848
838
|
);
|
|
@@ -858,8 +848,8 @@
|
|
|
858
848
|
},
|
|
859
849
|
i
|
|
860
850
|
)),
|
|
861
|
-
/* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src.fallback, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...
|
|
862
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...
|
|
851
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src.fallback, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props2 })
|
|
852
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props2 });
|
|
863
853
|
if (caption) {
|
|
864
854
|
return /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: classes, style, children: [
|
|
865
855
|
imgElement,
|
|
@@ -887,7 +877,7 @@
|
|
|
887
877
|
children = null,
|
|
888
878
|
...rest
|
|
889
879
|
}) {
|
|
890
|
-
const cls =
|
|
880
|
+
const cls = ClassNames("usx-carousel__slide", className);
|
|
891
881
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
892
882
|
"section",
|
|
893
883
|
{
|
|
@@ -910,11 +900,12 @@
|
|
|
910
900
|
showDots = true,
|
|
911
901
|
children = null,
|
|
912
902
|
slideIds = [],
|
|
913
|
-
...
|
|
903
|
+
...props2
|
|
914
904
|
}) {
|
|
915
|
-
|
|
905
|
+
var _a;
|
|
906
|
+
const classes = ClassNames("usx-carousel", className);
|
|
916
907
|
const childArray = React.Children.toArray(children).filter(Boolean);
|
|
917
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...
|
|
908
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props2, role: "region", "aria-roledescription": "carousel", "aria-label": ariaLabel, children: [
|
|
918
909
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-carousel__viewport", tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-carousel__track", children: childArray.length > 0 ? childArray : slides.length > 0 ? slides.map((slide, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
919
910
|
Slide,
|
|
920
911
|
{
|
|
@@ -927,7 +918,7 @@
|
|
|
927
918
|
i
|
|
928
919
|
)) : /* @__PURE__ */ jsxRuntime.jsx("p", { children: /* @__PURE__ */ jsxRuntime.jsx("em", { children: "No slides available." }) }) }) }),
|
|
929
920
|
showDots && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-carousel__dots", "aria-label": "Slide navigation", children: [
|
|
930
|
-
slides == null ? void 0 :
|
|
921
|
+
(_a = childArray.length > 0 ? childArray : slides) == null ? void 0 : _a.map((_, i) => /* @__PURE__ */ jsxRuntime.jsx("a", { href: `#${id}-slide-${i + 1}`, "aria-label": `Go to slide ${i + 1}`, tabIndex: -1 }, i)),
|
|
931
922
|
childArray.length > 0 && slideIds.length === childArray.length && slideIds.map((slideId, i) => /* @__PURE__ */ jsxRuntime.jsx("a", { href: slideId, "aria-label": `Go to slide ${i + 1}`, tabIndex: -1 }, i))
|
|
932
923
|
] })
|
|
933
924
|
] });
|
|
@@ -935,9 +926,9 @@
|
|
|
935
926
|
function Card({
|
|
936
927
|
title,
|
|
937
928
|
description,
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
929
|
+
tagProps,
|
|
930
|
+
buttonProps,
|
|
931
|
+
imageProps,
|
|
941
932
|
headerFirst = false,
|
|
942
933
|
flag = false,
|
|
943
934
|
mediaRight = false,
|
|
@@ -947,9 +938,9 @@
|
|
|
947
938
|
children,
|
|
948
939
|
className = "",
|
|
949
940
|
tag: RootTag = "div",
|
|
950
|
-
...
|
|
941
|
+
...props2
|
|
951
942
|
}) {
|
|
952
|
-
const cardClasses =
|
|
943
|
+
const cardClasses = ClassNames(
|
|
953
944
|
"usa-card",
|
|
954
945
|
"usx-card",
|
|
955
946
|
{
|
|
@@ -959,66 +950,66 @@
|
|
|
959
950
|
},
|
|
960
951
|
className
|
|
961
952
|
);
|
|
962
|
-
const mediaClasses =
|
|
953
|
+
const mediaClasses = ClassNames(
|
|
963
954
|
"usa-card__media",
|
|
964
955
|
{
|
|
965
956
|
"usa-card__media--inset": mediaInset,
|
|
966
957
|
"usa-card__media--exdent": mediaExdent
|
|
967
958
|
}
|
|
968
959
|
);
|
|
969
|
-
const hasStructuredContent = title || description ||
|
|
960
|
+
const hasStructuredContent = title || description || tagProps || buttonProps || imageProps;
|
|
970
961
|
const shouldRenderStructured = hasStructuredContent && !children;
|
|
971
|
-
const hasImages =
|
|
972
|
-
const useCarousel =
|
|
962
|
+
const hasImages = imageProps && imageProps.length > 0;
|
|
963
|
+
const useCarousel = imageProps && imageProps.length > 1;
|
|
973
964
|
const media = useCarousel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
974
965
|
Carousel,
|
|
975
966
|
{
|
|
976
|
-
id: `${
|
|
967
|
+
id: `${props2.id || "card"}-carousel`,
|
|
977
968
|
showDots: showCarouselDots,
|
|
978
969
|
className: "usx-card__carousel",
|
|
979
|
-
slides:
|
|
980
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(Image, {
|
|
970
|
+
slides: imageProps == null ? void 0 : imageProps.map((img, index) => ({
|
|
971
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(Image, { hideCaption: true, ...img }, index)
|
|
981
972
|
}))
|
|
982
973
|
}
|
|
983
|
-
) : hasImages ? /* @__PURE__ */ jsxRuntime.jsx(Image, { ...
|
|
984
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RootTag, { className: cardClasses, ...
|
|
974
|
+
) : hasImages ? /* @__PURE__ */ jsxRuntime.jsx(Image, { hideCaption: true, ...imageProps[0], className: ClassNames("usa-card__img", imageProps[0].className) }) : null;
|
|
975
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RootTag, { className: cardClasses, ...props2, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-card__container", children: shouldRenderStructured ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
985
976
|
title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-card__header", children: /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-card__heading", children: title }) }),
|
|
986
977
|
media && /* @__PURE__ */ jsxRuntime.jsx("div", { className: mediaClasses, children: media }),
|
|
987
978
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-card__body", children: [
|
|
988
|
-
|
|
979
|
+
tagProps && tagProps.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-tag-group", children: tagProps.map((tag, index) => /* @__PURE__ */ jsxRuntime.jsx(Tag, { ...tag }, index)) }),
|
|
989
980
|
description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: description }) : description)
|
|
990
981
|
] }),
|
|
991
|
-
|
|
982
|
+
buttonProps && buttonProps.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-card__footer", children: /* @__PURE__ */ jsxRuntime.jsx(ButtonGroup, { buttonProps, className: "flex-wrap" }) })
|
|
992
983
|
] }) : children || "Card" }) });
|
|
993
984
|
}
|
|
994
|
-
function CardGroup({ cardProps = [], className = "", ...
|
|
995
|
-
const classes =
|
|
985
|
+
function CardGroup({ cardProps = [], className = "", ...props2 }) {
|
|
986
|
+
const classes = ClassNames(
|
|
996
987
|
"usa-card-group",
|
|
997
988
|
"usx-card-group",
|
|
998
989
|
className
|
|
999
990
|
);
|
|
1000
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...
|
|
991
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props2, children: cardProps.map((card, index) => /* @__PURE__ */ jsxRuntime.jsx(Card, { ...card, tag: "li" }, index)) });
|
|
1001
992
|
}
|
|
1002
993
|
function Hint({
|
|
1003
994
|
id,
|
|
1004
995
|
children = null,
|
|
1005
996
|
className = "",
|
|
1006
|
-
...
|
|
997
|
+
...props2
|
|
1007
998
|
}) {
|
|
1008
|
-
const classes =
|
|
1009
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...id ? { id } : {}, ...
|
|
999
|
+
const classes = ClassNames("usa-hint", "usx-hint", className);
|
|
1000
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...id ? { id } : {}, ...props2, children });
|
|
1010
1001
|
}
|
|
1011
1002
|
function ErrorMessage({
|
|
1012
1003
|
id,
|
|
1013
1004
|
children = null,
|
|
1014
1005
|
className = "",
|
|
1015
|
-
...
|
|
1006
|
+
...props2
|
|
1016
1007
|
}) {
|
|
1017
|
-
const classes =
|
|
1018
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, role: "alert", ...id ? { id } : {}, ...
|
|
1008
|
+
const classes = ClassNames("usa-error-message", "usx-error-message", className);
|
|
1009
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, role: "alert", ...id ? { id } : {}, ...props2, children });
|
|
1019
1010
|
}
|
|
1020
|
-
function FormGroup({ children = null, className = "", error = false, ...
|
|
1021
|
-
const classes =
|
|
1011
|
+
function FormGroup({ children = null, className = "", error = false, ...props2 }) {
|
|
1012
|
+
const classes = ClassNames(
|
|
1022
1013
|
"usa-form-group",
|
|
1023
1014
|
"usx-form-group",
|
|
1024
1015
|
{
|
|
@@ -1026,7 +1017,7 @@
|
|
|
1026
1017
|
},
|
|
1027
1018
|
className
|
|
1028
1019
|
);
|
|
1029
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
1020
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children });
|
|
1030
1021
|
}
|
|
1031
1022
|
function Input({
|
|
1032
1023
|
label,
|
|
@@ -1040,7 +1031,7 @@
|
|
|
1040
1031
|
screenReaderOnlyLabel = false,
|
|
1041
1032
|
formGroup = true,
|
|
1042
1033
|
className = "",
|
|
1043
|
-
...
|
|
1034
|
+
...props2
|
|
1044
1035
|
}) {
|
|
1045
1036
|
const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
|
|
1046
1037
|
const hintId = hint ? `${inputId}-hint` : void 0;
|
|
@@ -1049,7 +1040,7 @@
|
|
|
1049
1040
|
const inputClasses = "usa-input usx-input";
|
|
1050
1041
|
const inputErrorClasses = "usa-input--error";
|
|
1051
1042
|
const inputSuccessClasses = "usa-input--success";
|
|
1052
|
-
const combinedInputClasses =
|
|
1043
|
+
const combinedInputClasses = ClassNames(
|
|
1053
1044
|
inputClasses,
|
|
1054
1045
|
hasError ? inputErrorClasses : hasSuccess ? inputSuccessClasses : null,
|
|
1055
1046
|
className
|
|
@@ -1065,7 +1056,7 @@
|
|
|
1065
1056
|
required,
|
|
1066
1057
|
"aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
|
|
1067
1058
|
"aria-invalid": hasError ? true : void 0,
|
|
1068
|
-
...
|
|
1059
|
+
...props2
|
|
1069
1060
|
};
|
|
1070
1061
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1071
1062
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: inputId, screenReaderOnly: screenReaderOnlyLabel, required, error: hasError, children: label }),
|
|
@@ -1088,12 +1079,12 @@
|
|
|
1088
1079
|
success = null,
|
|
1089
1080
|
formGroup = true,
|
|
1090
1081
|
className = "",
|
|
1091
|
-
...
|
|
1082
|
+
...props2
|
|
1092
1083
|
}) => {
|
|
1093
1084
|
const textAreaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;
|
|
1094
1085
|
const hasError = !!error;
|
|
1095
1086
|
const hasSuccess = !!success;
|
|
1096
|
-
const classes =
|
|
1087
|
+
const classes = ClassNames(
|
|
1097
1088
|
"usa-textarea",
|
|
1098
1089
|
"usx-textarea",
|
|
1099
1090
|
hasError ? "usa-input--error" : hasSuccess ? "usa-input--success" : null,
|
|
@@ -1118,7 +1109,7 @@
|
|
|
1118
1109
|
...required ? { required: true } : {},
|
|
1119
1110
|
"aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
|
|
1120
1111
|
"aria-invalid": hasError ? "true" : void 0,
|
|
1121
|
-
...
|
|
1112
|
+
...props2
|
|
1122
1113
|
}
|
|
1123
1114
|
)
|
|
1124
1115
|
] });
|
|
@@ -1137,14 +1128,14 @@
|
|
|
1137
1128
|
placeholder = "",
|
|
1138
1129
|
textArea = false,
|
|
1139
1130
|
className = "",
|
|
1140
|
-
...
|
|
1131
|
+
...props2
|
|
1141
1132
|
}) {
|
|
1142
1133
|
const fieldId = id || `character-count-${Math.random().toString(36).substr(2, 9)}`;
|
|
1143
1134
|
const infoId = `${fieldId}-info`;
|
|
1144
1135
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
1145
1136
|
const errorId = error ? `${fieldId}-error` : void 0;
|
|
1146
1137
|
const successId = !error && success ? `${fieldId}-success` : void 0;
|
|
1147
|
-
const outerClasses =
|
|
1138
|
+
const outerClasses = ClassNames("usa-character-count", "usx-character-count", className);
|
|
1148
1139
|
const fieldProps = {
|
|
1149
1140
|
id: fieldId,
|
|
1150
1141
|
label,
|
|
@@ -1159,7 +1150,7 @@
|
|
|
1159
1150
|
formGroup: true,
|
|
1160
1151
|
className: "usa-character-count__field",
|
|
1161
1152
|
"aria-describedby": [infoId, hintId, errorId, successId].filter(Boolean).join(" "),
|
|
1162
|
-
...
|
|
1153
|
+
...props2
|
|
1163
1154
|
};
|
|
1164
1155
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: outerClasses, children: [
|
|
1165
1156
|
textArea ? /* @__PURE__ */ jsxRuntime.jsx(TextArea, { ...fieldProps }) : /* @__PURE__ */ jsxRuntime.jsx(Input, { ...fieldProps }),
|
|
@@ -1186,22 +1177,22 @@
|
|
|
1186
1177
|
className = "",
|
|
1187
1178
|
onChange,
|
|
1188
1179
|
required = false,
|
|
1189
|
-
...
|
|
1180
|
+
...props2
|
|
1190
1181
|
}) {
|
|
1191
1182
|
const hasError = !!error;
|
|
1192
1183
|
const hasSuccess = !!success;
|
|
1193
|
-
const divClasses =
|
|
1184
|
+
const divClasses = ClassNames(
|
|
1194
1185
|
"usa-checkbox",
|
|
1195
1186
|
"usx-checkbox",
|
|
1196
1187
|
{ "usx-checkbox--small": small },
|
|
1197
1188
|
className
|
|
1198
1189
|
);
|
|
1199
|
-
const inputClasses =
|
|
1190
|
+
const inputClasses = ClassNames(
|
|
1200
1191
|
"usa-checkbox__input",
|
|
1201
1192
|
{ "usa-checkbox__input--tile": tile }
|
|
1202
1193
|
);
|
|
1203
1194
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1204
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: divClasses, ...
|
|
1195
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: divClasses, ...props2, children: [
|
|
1205
1196
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1206
1197
|
"input",
|
|
1207
1198
|
{
|
|
@@ -1231,15 +1222,15 @@
|
|
|
1231
1222
|
large = false,
|
|
1232
1223
|
children = null,
|
|
1233
1224
|
className = "",
|
|
1234
|
-
...
|
|
1225
|
+
...props2
|
|
1235
1226
|
}) {
|
|
1236
|
-
const classes =
|
|
1227
|
+
const classes = ClassNames(
|
|
1237
1228
|
"usa-legend",
|
|
1238
1229
|
"usx-legend",
|
|
1239
1230
|
{ "usa-legend--large": large },
|
|
1240
1231
|
className
|
|
1241
1232
|
);
|
|
1242
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("legend", { className: classes, ...
|
|
1233
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("legend", { className: classes, ...props2, children: [
|
|
1243
1234
|
required && /* @__PURE__ */ jsxRuntime.jsx(Required, {}),
|
|
1244
1235
|
children || text
|
|
1245
1236
|
] });
|
|
@@ -1255,14 +1246,14 @@
|
|
|
1255
1246
|
errorId,
|
|
1256
1247
|
children = null,
|
|
1257
1248
|
className = "",
|
|
1258
|
-
...
|
|
1249
|
+
...props2
|
|
1259
1250
|
}) {
|
|
1260
|
-
const classes =
|
|
1251
|
+
const classes = ClassNames(
|
|
1261
1252
|
"usa-fieldset",
|
|
1262
1253
|
"usx-fieldset",
|
|
1263
1254
|
className
|
|
1264
1255
|
);
|
|
1265
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: classes, ...disabled ? { disabled: true } : {}, ...
|
|
1256
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: classes, ...disabled ? { disabled: true } : {}, ...props2, children: [
|
|
1266
1257
|
legend && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1267
1258
|
Legend,
|
|
1268
1259
|
{
|
|
@@ -1285,25 +1276,22 @@
|
|
|
1285
1276
|
hint = null,
|
|
1286
1277
|
error = null,
|
|
1287
1278
|
name = "checkbox-group",
|
|
1288
|
-
|
|
1279
|
+
id: groupId,
|
|
1280
|
+
checkboxProps = [],
|
|
1289
1281
|
className = "",
|
|
1290
|
-
...
|
|
1282
|
+
...props2
|
|
1291
1283
|
}) => {
|
|
1292
|
-
const classes =
|
|
1293
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsxRuntime.jsx(Fieldset, { legend, required, hint, error, className: classes, ...
|
|
1294
|
-
const id = opt.id || `${name}-${idx}`;
|
|
1284
|
+
const classes = ClassNames("usa-checkbox-group", "usx-checkbox-group", className);
|
|
1285
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsxRuntime.jsx(Fieldset, { id: groupId, legend, required, hint, error, className: classes, ...props2, children: checkboxProps.map((opt, idx) => {
|
|
1286
|
+
const id = opt.id || `${groupId || name}-${idx}`;
|
|
1295
1287
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1296
1288
|
Checkbox,
|
|
1297
1289
|
{
|
|
1298
|
-
id,
|
|
1299
1290
|
name,
|
|
1300
|
-
value: opt.value,
|
|
1301
|
-
label: opt.label,
|
|
1302
|
-
description: opt.description,
|
|
1303
|
-
checked: !!opt.checked,
|
|
1304
|
-
disabled: !!opt.disabled,
|
|
1305
1291
|
tile,
|
|
1306
|
-
small
|
|
1292
|
+
small,
|
|
1293
|
+
...opt,
|
|
1294
|
+
id
|
|
1307
1295
|
},
|
|
1308
1296
|
id
|
|
1309
1297
|
);
|
|
@@ -1317,7 +1305,7 @@
|
|
|
1317
1305
|
bgColorChange = false,
|
|
1318
1306
|
...rest
|
|
1319
1307
|
}) {
|
|
1320
|
-
const classes =
|
|
1308
|
+
const classes = ClassNames(
|
|
1321
1309
|
"usx-clickable__link",
|
|
1322
1310
|
colorChange && "usx-clickable__color-on-hover",
|
|
1323
1311
|
bgColorChange && "usx-clickable__bg-color-on-hover",
|
|
@@ -1326,13 +1314,13 @@
|
|
|
1326
1314
|
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, ...rest, children });
|
|
1327
1315
|
}
|
|
1328
1316
|
function ClickableColorChange({ children, className, as: Tag2 = "span", ...rest }) {
|
|
1329
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className:
|
|
1317
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: ClassNames("usx-clickable__color-on-hover", className), ...rest, children });
|
|
1330
1318
|
}
|
|
1331
1319
|
function ClickableBgColorChange({ children, className, as: Tag2 = "span", ...rest }) {
|
|
1332
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className:
|
|
1320
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: ClassNames("usx-clickable__bg-color-on-hover", className), ...rest, children });
|
|
1333
1321
|
}
|
|
1334
1322
|
function Clickable({ className, children, ...rest }) {
|
|
1335
|
-
const classes =
|
|
1323
|
+
const classes = ClassNames("usx-clickable", className);
|
|
1336
1324
|
if ("href" in rest && rest.href !== void 0) {
|
|
1337
1325
|
return /* @__PURE__ */ jsxRuntime.jsx("a", { className: classes, ...rest, children });
|
|
1338
1326
|
}
|
|
@@ -1347,16 +1335,16 @@
|
|
|
1347
1335
|
children,
|
|
1348
1336
|
className = "",
|
|
1349
1337
|
bodyClassName = "",
|
|
1350
|
-
...
|
|
1338
|
+
...props2
|
|
1351
1339
|
}) => {
|
|
1352
1340
|
const validPositions = ["top", "bottom", "left", "right"];
|
|
1353
1341
|
const normalizedPosition = validPositions.includes(position) ? position : "top";
|
|
1354
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
1342
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: ClassNames("usx-tooltip", className), ...props2, children: [
|
|
1355
1343
|
children,
|
|
1356
1344
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1357
1345
|
"span",
|
|
1358
1346
|
{
|
|
1359
|
-
className:
|
|
1347
|
+
className: ClassNames("usa-tooltip__body", `usa-tooltip__body--${normalizedPosition}`, bodyClassName),
|
|
1360
1348
|
role: "tooltip",
|
|
1361
1349
|
children: label
|
|
1362
1350
|
}
|
|
@@ -1379,7 +1367,7 @@
|
|
|
1379
1367
|
Button,
|
|
1380
1368
|
{
|
|
1381
1369
|
ghost: true,
|
|
1382
|
-
className:
|
|
1370
|
+
className: ClassNames("usx-copy", className),
|
|
1383
1371
|
onClick: () => copyTextToClipboard(copyText),
|
|
1384
1372
|
type: "button",
|
|
1385
1373
|
children: [
|
|
@@ -1404,7 +1392,7 @@
|
|
|
1404
1392
|
);
|
|
1405
1393
|
}
|
|
1406
1394
|
function Code({ lines = [], allowHtml = false, copyText = null, staticBaseUrl, className = "" }) {
|
|
1407
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
1395
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usx-mockup-code", className), children: [
|
|
1408
1396
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-mockup-code__content", children: lines.map((line, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1409
1397
|
"pre",
|
|
1410
1398
|
{
|
|
@@ -1417,10 +1405,10 @@
|
|
|
1417
1405
|
copyText && /* @__PURE__ */ jsxRuntime.jsx(CopyToClipboard, { copyText, staticBaseUrl, tooltipProps: { label: "Copy", copiedTooltip: "Copied", position: "left" } })
|
|
1418
1406
|
] });
|
|
1419
1407
|
}
|
|
1420
|
-
function CollectionItem({ href, heading, description, imgSrc, imgAlt = "",
|
|
1408
|
+
function CollectionItem({ href, heading, description, imgSrc, imgAlt = "", calendarDateProps, meta, tags }) {
|
|
1421
1409
|
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "usa-collection__item", children: [
|
|
1422
1410
|
imgSrc && /* @__PURE__ */ jsxRuntime.jsx("img", { className: "usa-collection__img", src: imgSrc, alt: imgAlt }),
|
|
1423
|
-
|
|
1411
|
+
calendarDateProps && /* @__PURE__ */ jsxRuntime.jsx(CalendarDate, { underCollection: true, ...calendarDateProps }),
|
|
1424
1412
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-collection__body", children: [
|
|
1425
1413
|
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-collection__heading", children: /* @__PURE__ */ jsxRuntime.jsx("a", { className: "usa-link usx-link", href, children: heading }) }),
|
|
1426
1414
|
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "usa-collection__description", children: description }),
|
|
@@ -1430,7 +1418,7 @@
|
|
|
1430
1418
|
tags && tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "usa-collection__meta", "aria-label": "Topics", children: tags.map((tag, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1431
1419
|
"li",
|
|
1432
1420
|
{
|
|
1433
|
-
className:
|
|
1421
|
+
className: ClassNames(
|
|
1434
1422
|
"usa-collection__meta-item",
|
|
1435
1423
|
"usa-tag usx-tag",
|
|
1436
1424
|
typeof tag === "object" && tag.isNew && "usa-tag--new"
|
|
@@ -1442,14 +1430,14 @@
|
|
|
1442
1430
|
] })
|
|
1443
1431
|
] });
|
|
1444
1432
|
}
|
|
1445
|
-
function Collection({ items = [], condensed = false, className = "", ...
|
|
1446
|
-
const classes =
|
|
1433
|
+
function Collection({ items = [], condensed = false, className = "", ...props2 }) {
|
|
1434
|
+
const classes = ClassNames(
|
|
1447
1435
|
"usa-collection",
|
|
1448
1436
|
"usx-collection",
|
|
1449
1437
|
condensed && "usa-collection--condensed",
|
|
1450
1438
|
className
|
|
1451
1439
|
);
|
|
1452
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...
|
|
1440
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props2, children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(CollectionItem, { ...item }, i)) });
|
|
1453
1441
|
}
|
|
1454
1442
|
function Combobox({
|
|
1455
1443
|
id,
|
|
@@ -1466,7 +1454,7 @@
|
|
|
1466
1454
|
onSelect,
|
|
1467
1455
|
formGroup = true,
|
|
1468
1456
|
className = "",
|
|
1469
|
-
...
|
|
1457
|
+
...props2
|
|
1470
1458
|
}) {
|
|
1471
1459
|
const labelId = `${id}-label`;
|
|
1472
1460
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
@@ -1487,7 +1475,7 @@
|
|
|
1487
1475
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1488
1476
|
"div",
|
|
1489
1477
|
{
|
|
1490
|
-
className:
|
|
1478
|
+
className: ClassNames(
|
|
1491
1479
|
"usa-combo-box",
|
|
1492
1480
|
"usx-combo-box",
|
|
1493
1481
|
{ "usx-combo-box--error": !!error },
|
|
@@ -1499,13 +1487,13 @@
|
|
|
1499
1487
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1500
1488
|
"select",
|
|
1501
1489
|
{
|
|
1502
|
-
className:
|
|
1490
|
+
className: ClassNames("usa-select", "usx-select"),
|
|
1503
1491
|
id,
|
|
1504
1492
|
name,
|
|
1505
1493
|
disabled,
|
|
1506
1494
|
required,
|
|
1507
1495
|
onChange: handleChange,
|
|
1508
|
-
...
|
|
1496
|
+
...props2,
|
|
1509
1497
|
children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt.value, children: opt.label }, opt.value))
|
|
1510
1498
|
}
|
|
1511
1499
|
)
|
|
@@ -1514,6 +1502,84 @@
|
|
|
1514
1502
|
] });
|
|
1515
1503
|
return formGroup ? /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: content }) : content;
|
|
1516
1504
|
}
|
|
1505
|
+
const props = { "element": { "type": "select", "description": "Root HTML element. Use a heading or accessible label for named sections and navigation; list roots require list-item children.", "options": ["div", "section", "article", "aside", "nav", "ul", "ol", "li"], "default": "div" }, "gridContainer": { "type": "select", "description": "Opt-in centered USWDS page-width container with side padding. Default uses the USX themed grid-container; named sizes use USWDS widths. Usually wrap a gridRow inside this container rather than combining them.", "options": ["default", "card", "card-lg", "mobile", "mobile-lg", "tablet", "tablet-lg", "desktop", "desktop-lg", "widescreen"] }, "gridRow": { "type": "boolean", "description": "Use a wrapping USWDS grid row. Nest Containers with column settings as direct children. Omitted leaves the container unstyled.", "default": false }, "display": { "type": "select", "description": "Display mode. Choose flex or inline-flex to enable direction, wrap, alignment, and gap. Flow-root contains floated children; none hides the container and its descendants.", "options": ["block", "flex", "inline", "inline-block", "inline-flex", "none", "flow-root"] }, "direction": { "type": "select", "description": "Direction of flex children. Requires display flex or inline-flex (or gridRow). Reverse directions change visual order only, not reading or keyboard order.", "options": ["row", "column", "row-reverse", "column-reverse"] }, "wrap": { "type": "select", "description": "Whether flex children wrap onto new lines. Set wrap for a flexible toolbar; omitted uses normal CSS behavior.", "options": ["wrap", "nowrap", "wrap-reverse"] }, "justify": { "type": "select", "description": "Distribute children along the main flex axis.", "options": ["start", "end", "center", "space-between", "space-around", "space-evenly"] }, "align": { "type": "select", "description": "Align children across the flex axis.", "options": ["start", "end", "center", "stretch", "baseline"] }, "alignSelf": { "type": "select", "description": "Override this container’s alignment as a child of a flex parent. Auto restores parent alignment.", "options": ["auto", "start", "end", "center", "stretch", "baseline"] }, "flex": { "type": "select", "description": "Size this container as a flex child: auto uses its content size, fill shares available space, none keeps its size. Use column instead when this is a USWDS grid column.", "options": ["auto", "fill", "none"] }, "gap": { "type": "select", "description": "Space between flex children using USWDS spacing tokens (1 = 8px, 05 = 4px). Use gutters instead on gridRow: CSS gap adds to percentage column widths.", "options": ["0", "2px", "05", "1", "2", "3", "4", "5", "6"] }, "column": { "type": "select", "description": "Width of this container inside a gridRow: 1–12 columns, auto for content width, or fill for equal shares. Set 12 at the base to stack on small screens, then override at larger breakpoints.", "options": ["auto", "fill", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] }, "offset": { "type": "select", "description": "Offset this grid column by 1–12 columns. Use none to reset an earlier offset.", "options": ["none", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] }, "gutters": { "type": "select", "description": "Horizontal USWDS grid gutters; requires gridRow. Use 2 with a desktop override of 4 for standard responsive spacing; 0 removes gutters. Rows use negative margins, so nest them in a gridContainer or another padded parent.", "options": ["sm", "md", "lg", "0", "2px", "05", "1", "2", "3", "4", "5", "6"] }, "float": { "type": "select", "description": "Float this container so surrounding content wraps around it. Float has no effect on flex children; use a flow-root parent to contain floats.", "options": ["none", "left", "right"] }, "responsive": { "type": "object", "description": "Mobile-first overrides keyed by mobileLg, tablet, and desktop. Omitted fields keep the smaller-screen setting; use explicit values (none, 0, row, etc.) to reset. Breakpoints match precompiled USWDS and do not follow USX page-layout theme breakpoints.", "properties": { "mobileLg": { "type": "object", "description": "Layout overrides at 30em / 480px and wider (pixel equivalent assumes 16px browser default).", "component": "container", "omit": ["element", "gridContainer", "gridRow", "responsive", "children", "content", "className", "id", "role", "ariaLabel", "ariaLabelledby"] }, "tablet": { "type": "object", "description": "Layout overrides at 40em / 640px and wider (pixel equivalent assumes 16px browser default).", "component": "container", "omit": ["element", "gridContainer", "gridRow", "responsive", "children", "content", "className", "id", "role", "ariaLabel", "ariaLabelledby"] }, "desktop": { "type": "object", "description": "Layout overrides at 64em / 1024px and wider (pixel equivalent assumes 16px browser default).", "component": "container", "omit": ["element", "gridContainer", "gridRow", "responsive", "children", "content", "className", "id", "role", "ariaLabel", "ariaLabelledby"] } } }, "children": { "type": "slot", "description": "Grouped content rendered directly, with no child wrappers or reordering. Takes precedence over content unless null or undefined." }, "content": { "type": "slot", "description": "Fallback grouped content when children is null or undefined." }, "className": { "type": "string", "description": "Additional CSS classes for spacing, decoration, or layouts beyond these controls." }, "id": { "type": "string", "description": "HTML identifier for links and accessible references." }, "role": { "type": "string", "description": "Optional ARIA role; prefer an appropriate semantic element." }, "ariaLabel": { "type": "string", "description": "Accessible name when a visible label is not available." }, "ariaLabelledby": { "type": "string", "description": "ID of the visible heading or label that names this container." } };
|
|
1506
|
+
const config = {
|
|
1507
|
+
props
|
|
1508
|
+
};
|
|
1509
|
+
const breakpoints = [["mobileLg", "mobile-lg"], ["tablet", "tablet"], ["desktop", "desktop"]];
|
|
1510
|
+
const layoutKeys = [
|
|
1511
|
+
"display",
|
|
1512
|
+
"direction",
|
|
1513
|
+
"wrap",
|
|
1514
|
+
"justify",
|
|
1515
|
+
"align",
|
|
1516
|
+
"alignSelf",
|
|
1517
|
+
"flex",
|
|
1518
|
+
"gap",
|
|
1519
|
+
"column",
|
|
1520
|
+
"offset",
|
|
1521
|
+
"gutters",
|
|
1522
|
+
"float"
|
|
1523
|
+
];
|
|
1524
|
+
function layoutClasses(layout, prefix = "") {
|
|
1525
|
+
if (!layout || typeof layout !== "object" || Array.isArray(layout)) return [];
|
|
1526
|
+
return layoutKeys.flatMap((key) => {
|
|
1527
|
+
const value = layout[key];
|
|
1528
|
+
if (typeof value !== "string" || !config.props[key].options.includes(value)) return [];
|
|
1529
|
+
let className;
|
|
1530
|
+
if (key === "column") className = `grid-col-${value}`;
|
|
1531
|
+
else if (key === "offset") className = `grid-offset-${value}`;
|
|
1532
|
+
else if (key === "gutters") className = `grid-gap-${value}`;
|
|
1533
|
+
else className = `usx-container--${key === "alignSelf" ? "align-self" : key}-${value}`;
|
|
1534
|
+
return [`${prefix}${className}`];
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
function Container({
|
|
1538
|
+
element = "div",
|
|
1539
|
+
gridContainer,
|
|
1540
|
+
gridRow = false,
|
|
1541
|
+
display,
|
|
1542
|
+
direction,
|
|
1543
|
+
wrap,
|
|
1544
|
+
justify,
|
|
1545
|
+
align,
|
|
1546
|
+
alignSelf,
|
|
1547
|
+
flex,
|
|
1548
|
+
gap,
|
|
1549
|
+
column,
|
|
1550
|
+
offset,
|
|
1551
|
+
gutters,
|
|
1552
|
+
float,
|
|
1553
|
+
responsive,
|
|
1554
|
+
children,
|
|
1555
|
+
content,
|
|
1556
|
+
className = "",
|
|
1557
|
+
id,
|
|
1558
|
+
role,
|
|
1559
|
+
ariaLabel,
|
|
1560
|
+
ariaLabelledby
|
|
1561
|
+
}) {
|
|
1562
|
+
const Element = config.props.element.options.includes(element) ? element : "div";
|
|
1563
|
+
const classes = ClassNames(
|
|
1564
|
+
"usx-container",
|
|
1565
|
+
gridContainer && config.props.gridContainer.options.includes(gridContainer) ? gridContainer === "default" ? "grid-container" : `grid-container-${gridContainer}` : null,
|
|
1566
|
+
{ "grid-row": gridRow === true },
|
|
1567
|
+
layoutClasses({ display, direction, wrap, justify, align, alignSelf, flex, gap, column, offset, gutters, float }),
|
|
1568
|
+
breakpoints.map(([key, prefix]) => layoutClasses((responsive == null ? void 0 : responsive[key]) ?? {}, `${prefix}:`)),
|
|
1569
|
+
typeof className === "string" ? className : void 0
|
|
1570
|
+
);
|
|
1571
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1572
|
+
Element,
|
|
1573
|
+
{
|
|
1574
|
+
className: classes,
|
|
1575
|
+
id: typeof id === "string" ? id : void 0,
|
|
1576
|
+
role: typeof role === "string" ? role : void 0,
|
|
1577
|
+
"aria-label": typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
1578
|
+
"aria-labelledby": typeof ariaLabelledby === "string" ? ariaLabelledby : void 0,
|
|
1579
|
+
children: children ?? content
|
|
1580
|
+
}
|
|
1581
|
+
);
|
|
1582
|
+
}
|
|
1517
1583
|
function DatePicker({
|
|
1518
1584
|
id = "date-picker",
|
|
1519
1585
|
name,
|
|
@@ -1528,7 +1594,7 @@
|
|
|
1528
1594
|
rangeDate = null,
|
|
1529
1595
|
formGroup = true,
|
|
1530
1596
|
className = "",
|
|
1531
|
-
...
|
|
1597
|
+
...props2
|
|
1532
1598
|
}) {
|
|
1533
1599
|
const labelId = `${id}-label`;
|
|
1534
1600
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
@@ -1541,7 +1607,7 @@
|
|
|
1541
1607
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1542
1608
|
"div",
|
|
1543
1609
|
{
|
|
1544
|
-
className:
|
|
1610
|
+
className: ClassNames("usa-date-picker", "usx-date-picker", className),
|
|
1545
1611
|
...defaultValue ? { "data-default-value": defaultValue } : {},
|
|
1546
1612
|
...minDate ? { "data-min-date": minDate } : {},
|
|
1547
1613
|
...maxDate ? { "data-max-date": maxDate } : {},
|
|
@@ -1549,7 +1615,7 @@
|
|
|
1549
1615
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1550
1616
|
"input",
|
|
1551
1617
|
{
|
|
1552
|
-
className:
|
|
1618
|
+
className: ClassNames(
|
|
1553
1619
|
"usa-input",
|
|
1554
1620
|
"usx-input",
|
|
1555
1621
|
{ "usa-input--error": !!error }
|
|
@@ -1560,7 +1626,7 @@
|
|
|
1560
1626
|
"aria-describedby": describedBy,
|
|
1561
1627
|
disabled,
|
|
1562
1628
|
required,
|
|
1563
|
-
...
|
|
1629
|
+
...props2
|
|
1564
1630
|
}
|
|
1565
1631
|
)
|
|
1566
1632
|
}
|
|
@@ -1598,7 +1664,7 @@
|
|
|
1598
1664
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1599
1665
|
"div",
|
|
1600
1666
|
{
|
|
1601
|
-
className:
|
|
1667
|
+
className: ClassNames("usa-date-range-picker", "usx-date-range-picker", className),
|
|
1602
1668
|
...minDate ? { "data-min-date": minDate } : {},
|
|
1603
1669
|
...maxDate ? { "data-max-date": maxDate } : {},
|
|
1604
1670
|
children: [
|
|
@@ -1654,9 +1720,9 @@
|
|
|
1654
1720
|
}
|
|
1655
1721
|
);
|
|
1656
1722
|
}
|
|
1657
|
-
function Eyebrow({ children = null, className = "", ...
|
|
1658
|
-
const classes =
|
|
1659
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...
|
|
1723
|
+
function Eyebrow({ children = null, className = "", ...props2 }) {
|
|
1724
|
+
const classes = ClassNames("usx-eyebrow", className);
|
|
1725
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...props2, children });
|
|
1660
1726
|
}
|
|
1661
1727
|
function Link({
|
|
1662
1728
|
href = "javascript:void(0);",
|
|
@@ -1666,9 +1732,9 @@
|
|
|
1666
1732
|
alt = false,
|
|
1667
1733
|
newTab = false,
|
|
1668
1734
|
className = "",
|
|
1669
|
-
...
|
|
1735
|
+
...props2
|
|
1670
1736
|
}) {
|
|
1671
|
-
const classes =
|
|
1737
|
+
const classes = ClassNames(
|
|
1672
1738
|
"usa-link",
|
|
1673
1739
|
"usx-link",
|
|
1674
1740
|
visited && "usx-link--visited",
|
|
@@ -1683,7 +1749,7 @@
|
|
|
1683
1749
|
className: classes,
|
|
1684
1750
|
target: newTab || external ? "_blank" : void 0,
|
|
1685
1751
|
rel: newTab || external ? "noreferrer noopener" : void 0,
|
|
1686
|
-
...
|
|
1752
|
+
...props2,
|
|
1687
1753
|
children
|
|
1688
1754
|
}
|
|
1689
1755
|
);
|
|
@@ -1705,7 +1771,7 @@
|
|
|
1705
1771
|
function FileList({ files, hint = "Selected files", onRemove = null, disabled = false, className = "" }) {
|
|
1706
1772
|
if (!files || files.length === 0) return null;
|
|
1707
1773
|
const lastEntry = getEntryDisplay(files[files.length - 1]);
|
|
1708
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
1774
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usx-file-input__list", "margin-top-1", className), children: [
|
|
1709
1775
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-sr-only", "aria-live": "polite", children: `You have selected the file: ${lastEntry.name}.` }),
|
|
1710
1776
|
hint && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-hint usx-hint usx-file-input__list-heading", children: hint }),
|
|
1711
1777
|
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "usx-file-input__file-list", children: files.map((entry) => {
|
|
@@ -1758,7 +1824,7 @@
|
|
|
1758
1824
|
onFilesChange = null,
|
|
1759
1825
|
defaultFiles = [],
|
|
1760
1826
|
formGroup = true,
|
|
1761
|
-
...
|
|
1827
|
+
...props2
|
|
1762
1828
|
}) {
|
|
1763
1829
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
1764
1830
|
const errorId = error ? `${id}-error` : void 0;
|
|
@@ -1798,7 +1864,7 @@
|
|
|
1798
1864
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1799
1865
|
"input",
|
|
1800
1866
|
{
|
|
1801
|
-
className:
|
|
1867
|
+
className: ClassNames("usa-file-input", "usx-file-input", className),
|
|
1802
1868
|
id,
|
|
1803
1869
|
type: "file",
|
|
1804
1870
|
name: name || id,
|
|
@@ -1808,7 +1874,7 @@
|
|
|
1808
1874
|
disabled,
|
|
1809
1875
|
required,
|
|
1810
1876
|
...invalidFileTypeMessage ? { "data-errormessage": invalidFileTypeMessage } : {},
|
|
1811
|
-
...
|
|
1877
|
+
...props2
|
|
1812
1878
|
}
|
|
1813
1879
|
)
|
|
1814
1880
|
] });
|
|
@@ -1821,7 +1887,7 @@
|
|
|
1821
1887
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-file-input__add-only", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1822
1888
|
"input",
|
|
1823
1889
|
{
|
|
1824
|
-
className:
|
|
1890
|
+
className: ClassNames("usa-file-input", "usx-file-input", className),
|
|
1825
1891
|
id,
|
|
1826
1892
|
type: "file",
|
|
1827
1893
|
name: name || id,
|
|
@@ -1831,7 +1897,7 @@
|
|
|
1831
1897
|
disabled,
|
|
1832
1898
|
required: required && managedFiles.length === 0,
|
|
1833
1899
|
...invalidFileTypeMessage ? { "data-errormessage": invalidFileTypeMessage } : {},
|
|
1834
|
-
...
|
|
1900
|
+
...props2,
|
|
1835
1901
|
onChange: addFiles
|
|
1836
1902
|
}
|
|
1837
1903
|
) }),
|
|
@@ -1839,8 +1905,8 @@
|
|
|
1839
1905
|
] });
|
|
1840
1906
|
return formGroup ? /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: content }) : content;
|
|
1841
1907
|
}
|
|
1842
|
-
function BrandingContent({ config, projectUrl, staticBaseUrl }) {
|
|
1843
|
-
const { title, symbol, symbolInverse, logo, logoInverse, alt } =
|
|
1908
|
+
function BrandingContent({ config: config2, projectUrl, staticBaseUrl }) {
|
|
1909
|
+
const { title, symbol, symbolInverse, logo, logoInverse, alt } = config2;
|
|
1844
1910
|
const label = alt ?? title ?? "";
|
|
1845
1911
|
if (logo) {
|
|
1846
1912
|
const Wrapper = projectUrl ? "a" : "div";
|
|
@@ -1878,17 +1944,17 @@
|
|
|
1878
1944
|
title && (projectUrl ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: projectUrl, className: "usx-logo__title", children: title }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-logo__title", children: title }))
|
|
1879
1945
|
] });
|
|
1880
1946
|
}
|
|
1881
|
-
function Branding({ branding, projectUrl = "/", staticBaseUrl, className = "", ...
|
|
1947
|
+
function Branding({ branding, projectUrl = "/", staticBaseUrl, className = "", ...props2 }) {
|
|
1882
1948
|
if (!branding) return null;
|
|
1883
|
-
const classes =
|
|
1949
|
+
const classes = ClassNames(
|
|
1884
1950
|
"usa-logo",
|
|
1885
1951
|
"usx-logo",
|
|
1886
1952
|
className
|
|
1887
1953
|
);
|
|
1888
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
1954
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: /* @__PURE__ */ jsxRuntime.jsx(BrandingContent, { config: branding, projectUrl, staticBaseUrl }) });
|
|
1889
1955
|
}
|
|
1890
1956
|
function FooterReturnToTop({ label = "Return to top", href = "#", className = "" }) {
|
|
1891
|
-
const classes =
|
|
1957
|
+
const classes = ClassNames(
|
|
1892
1958
|
"grid-container",
|
|
1893
1959
|
"usa-footer__return-to-top",
|
|
1894
1960
|
"usx-footer__return-to-top",
|
|
@@ -1900,7 +1966,7 @@
|
|
|
1900
1966
|
] }) });
|
|
1901
1967
|
}
|
|
1902
1968
|
function FooterNavColumn({ heading, links = [], className = "" }) {
|
|
1903
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className:
|
|
1969
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: ClassNames("usa-footer__primary-content usa-footer__primary-content--collapsible usx-footer__nav-column", className), children: [
|
|
1904
1970
|
heading && /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-footer__primary-link", children: heading }),
|
|
1905
1971
|
links.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "usa-list usa-list--unstyled", children: links.map((link, i) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "usa-footer__secondary-link", children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: link.href, "aria-label": link.ariaLabel || void 0, children: link.text }) }, i)) })
|
|
1906
1972
|
] });
|
|
@@ -1914,7 +1980,7 @@
|
|
|
1914
1980
|
onSubmit = null,
|
|
1915
1981
|
className = ""
|
|
1916
1982
|
}) {
|
|
1917
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
1983
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usa-sign-up usx-footer__sign-up", className), children: [
|
|
1918
1984
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "usa-sign-up__heading", children: heading }),
|
|
1919
1985
|
/* @__PURE__ */ jsxRuntime.jsxs("form", { className: "usa-form", action: action || void 0, onSubmit: onSubmit || void 0, children: [
|
|
1920
1986
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1933,7 +1999,7 @@
|
|
|
1933
1999
|
}
|
|
1934
2000
|
function FooterSocialLinks({ links = [], staticBaseUrl, className = "" }) {
|
|
1935
2001
|
if (!links.length) return null;
|
|
1936
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2002
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ClassNames("usa-footer__social-links grid-row grid-gap-1 usx-footer__social-links", className), children: links.map((link, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-col-auto", children: /* @__PURE__ */ jsxRuntime.jsx("a", { className: "usa-social-link", href: link.href, "aria-label": link.alt, children: /* @__PURE__ */ jsxRuntime.jsx("img", { className: "usa-social-link__icon", src: getAssetUrl(link.icon, staticBaseUrl), alt: link.alt }) }) }, i)) });
|
|
1937
2003
|
}
|
|
1938
2004
|
function normalizeContactLink(value, scheme) {
|
|
1939
2005
|
var _a;
|
|
@@ -1955,7 +2021,7 @@
|
|
|
1955
2021
|
...links
|
|
1956
2022
|
].filter(Boolean);
|
|
1957
2023
|
if (!heading && allLinks.length === 0) return null;
|
|
1958
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("address", { className:
|
|
2024
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("address", { className: ClassNames("usa-footer__address usx-footer__contact", className), children: [
|
|
1959
2025
|
heading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "usa-footer__contact-heading", children: heading }),
|
|
1960
2026
|
allLinks.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__contact-info grid-row grid-gap", children: allLinks.map((link, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-col-auto", children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: link.href, children: link.text }) }, i)) })
|
|
1961
2027
|
] });
|
|
@@ -1980,10 +2046,10 @@
|
|
|
1980
2046
|
primaryChildren = null,
|
|
1981
2047
|
secondaryChildren = null,
|
|
1982
2048
|
className = "",
|
|
1983
|
-
...
|
|
2049
|
+
...props2
|
|
1984
2050
|
}) {
|
|
1985
2051
|
const variantClass = variant === "big" ? "usa-footer--big" : variant === "slim" ? "usa-footer--slim" : "";
|
|
1986
|
-
const classes =
|
|
2052
|
+
const classes = ClassNames("usa-footer", variantClass, "usx-footer", className);
|
|
1987
2053
|
const returnToTopEl = returnToTop ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1988
2054
|
FooterReturnToTop,
|
|
1989
2055
|
{
|
|
@@ -2009,7 +2075,7 @@
|
|
|
2009
2075
|
contactEl
|
|
2010
2076
|
] }) : null;
|
|
2011
2077
|
if (variant === "big") {
|
|
2012
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...
|
|
2078
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...props2, children: [
|
|
2013
2079
|
returnToTopEl,
|
|
2014
2080
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__primary-section", children: primaryChildren ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-container", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid-row grid-gap", children: [
|
|
2015
2081
|
navColumns.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tablet:grid-col-8", children: /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "usa-footer__nav", "aria-label": navAriaLabel, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-row grid-gap-4", children: navColumns.map((col, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mobile-lg:grid-col-6 desktop:grid-col-3", children: /* @__PURE__ */ jsxRuntime.jsx(FooterNavColumn, { heading: col.heading, links: col.links }) }, i)) }) }) }),
|
|
@@ -2027,7 +2093,7 @@
|
|
|
2027
2093
|
normalizeContactLink(contactEmail, "mailto:"),
|
|
2028
2094
|
...contactLinks
|
|
2029
2095
|
].filter(Boolean);
|
|
2030
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...
|
|
2096
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...props2, children: [
|
|
2031
2097
|
returnToTopEl,
|
|
2032
2098
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__primary-section", children: primaryChildren ?? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-footer__primary-container grid-row", children: [
|
|
2033
2099
|
navLinks.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mobile-lg:grid-col-8", children: /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "usa-footer__nav", "aria-label": navAriaLabel, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "grid-row grid-gap", children: navLinks.map((link, i) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "mobile-lg:grid-col-6 desktop:grid-col-auto usa-footer__primary-content", children: /* @__PURE__ */ jsxRuntime.jsx("a", { className: "usa-footer__primary-link", href: link.href, "aria-label": link.ariaLabel || void 0, children: link.text }) }, i)) }) }) }),
|
|
@@ -2036,7 +2102,7 @@
|
|
|
2036
2102
|
(brandingEl || secondaryChildren) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__secondary-section", children: secondaryChildren ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-container", children: brandingEl }) })
|
|
2037
2103
|
] });
|
|
2038
2104
|
}
|
|
2039
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...
|
|
2105
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...props2, children: [
|
|
2040
2106
|
returnToTopEl,
|
|
2041
2107
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__primary-section", children: primaryChildren ?? (navLinks.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "usa-footer__nav", "aria-label": navAriaLabel, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "grid-row grid-gap", children: navLinks.map((link, i) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "mobile-lg:grid-col-4 desktop:grid-col-auto usa-footer__primary-content", children: /* @__PURE__ */ jsxRuntime.jsx("a", { className: "usa-footer__primary-link", href: link.href, "aria-label": link.ariaLabel || void 0, children: link.text }) }, i)) }) })) }),
|
|
2042
2108
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__secondary-section", children: secondaryChildren ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-container", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid-row grid-gap", children: [
|
|
@@ -2068,13 +2134,13 @@
|
|
|
2068
2134
|
onSubmit(query);
|
|
2069
2135
|
}
|
|
2070
2136
|
};
|
|
2071
|
-
const iconClasses =
|
|
2137
|
+
const iconClasses = ClassNames(
|
|
2072
2138
|
"usa-search__submit-icon",
|
|
2073
2139
|
{
|
|
2074
2140
|
"display-inline-block": iconOnly
|
|
2075
2141
|
}
|
|
2076
2142
|
);
|
|
2077
|
-
const formClasses =
|
|
2143
|
+
const formClasses = ClassNames(
|
|
2078
2144
|
"usa-search",
|
|
2079
2145
|
{
|
|
2080
2146
|
"usa-search--small": iconOnly && !big,
|
|
@@ -2127,7 +2193,7 @@
|
|
|
2127
2193
|
headerId = "header",
|
|
2128
2194
|
renderSearchDirectly = false
|
|
2129
2195
|
}) {
|
|
2130
|
-
const navClasses =
|
|
2196
|
+
const navClasses = ClassNames("usa-nav__primary", "usa-accordion");
|
|
2131
2197
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2132
2198
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "usa-nav__close", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "close" }) }),
|
|
2133
2199
|
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: navClasses, children: navSections.map((section, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "usa-nav__primary-item", children: section.href ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2216,9 +2282,9 @@
|
|
|
2216
2282
|
className = "",
|
|
2217
2283
|
utilityContent = null,
|
|
2218
2284
|
navEndContent = null,
|
|
2219
|
-
...
|
|
2285
|
+
...props2
|
|
2220
2286
|
}) {
|
|
2221
|
-
const headerClasses =
|
|
2287
|
+
const headerClasses = ClassNames(
|
|
2222
2288
|
"usa-header",
|
|
2223
2289
|
"usx-header",
|
|
2224
2290
|
{ "usa-header--basic": !extended },
|
|
@@ -2226,7 +2292,7 @@
|
|
|
2226
2292
|
{ "usa-header--extended": extended },
|
|
2227
2293
|
className
|
|
2228
2294
|
);
|
|
2229
|
-
const navClasses =
|
|
2295
|
+
const navClasses = ClassNames(
|
|
2230
2296
|
"usa-nav",
|
|
2231
2297
|
"usx-nav",
|
|
2232
2298
|
{ "usx-nav--sticky": stickyNav }
|
|
@@ -2237,7 +2303,7 @@
|
|
|
2237
2303
|
] });
|
|
2238
2304
|
if (extended) {
|
|
2239
2305
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2240
|
-
/* @__PURE__ */ jsxRuntime.jsx("header", { className: headerClasses, ...
|
|
2306
|
+
/* @__PURE__ */ jsxRuntime.jsx("header", { className: headerClasses, ...props2, children: navbar }),
|
|
2241
2307
|
/* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Primary navigation", className: navClasses, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-nav__inner", children: [
|
|
2242
2308
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2243
2309
|
PrimaryNav,
|
|
@@ -2269,7 +2335,7 @@
|
|
|
2269
2335
|
] }) })
|
|
2270
2336
|
] });
|
|
2271
2337
|
}
|
|
2272
|
-
return /* @__PURE__ */ jsxRuntime.jsx("header", { className: headerClasses, ...
|
|
2338
|
+
return /* @__PURE__ */ jsxRuntime.jsx("header", { className: headerClasses, ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-nav-container", children: [
|
|
2273
2339
|
navbar,
|
|
2274
2340
|
/* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Primary navigation", className: navClasses, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2275
2341
|
PrimaryNav,
|
|
@@ -2290,7 +2356,7 @@
|
|
|
2290
2356
|
title = "",
|
|
2291
2357
|
callout = "",
|
|
2292
2358
|
paragraph = "",
|
|
2293
|
-
|
|
2359
|
+
buttonProps = null,
|
|
2294
2360
|
searchProps = null,
|
|
2295
2361
|
backgroundImage = "",
|
|
2296
2362
|
backgroundPosition,
|
|
@@ -2304,12 +2370,12 @@
|
|
|
2304
2370
|
ariaLabel = "Introduction",
|
|
2305
2371
|
className = "",
|
|
2306
2372
|
style,
|
|
2307
|
-
...
|
|
2373
|
+
...props2
|
|
2308
2374
|
}) {
|
|
2309
2375
|
const Heading = headingLevel;
|
|
2310
2376
|
const secondaryHeadings = { h1: "h2", h2: "h3", h3: "h4", h4: "h5", h5: "h6" };
|
|
2311
2377
|
const SecondaryHeading = secondaryHeadings[headingLevel];
|
|
2312
|
-
const classes =
|
|
2378
|
+
const classes = ClassNames(
|
|
2313
2379
|
"usx-hero",
|
|
2314
2380
|
overlay && "usx-hero--has-overlay",
|
|
2315
2381
|
overlayOpacity !== void 0 && "usx-hero--custom-overlay",
|
|
@@ -2317,14 +2383,14 @@
|
|
|
2317
2383
|
!boxed && "usx-hero--unboxed",
|
|
2318
2384
|
secondaryContent && "usx-hero--split",
|
|
2319
2385
|
className
|
|
2320
|
-
|
|
2386
|
+
);
|
|
2321
2387
|
const heroStyle = {
|
|
2322
2388
|
...backgroundImage ? { backgroundImage: `url('${backgroundImage}')` } : {},
|
|
2323
2389
|
...backgroundPosition ? { backgroundPosition } : {},
|
|
2324
2390
|
...overlayOpacity !== void 0 ? { "--hero-overlay-opacity": Math.min(1, Math.max(0, overlayOpacity)) } : {},
|
|
2325
2391
|
...style
|
|
2326
2392
|
};
|
|
2327
|
-
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: classes, "aria-label": ariaLabel, style: heroStyle, ...
|
|
2393
|
+
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: classes, "aria-label": ariaLabel, style: heroStyle, ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-hero__inner", children: [
|
|
2328
2394
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-hero__callout", style: calloutMaxWidth ? { maxWidth: calloutMaxWidth } : void 0, children: [
|
|
2329
2395
|
/* @__PURE__ */ jsxRuntime.jsxs(Heading, { className: "usx-hero__heading", children: [
|
|
2330
2396
|
callout && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-hero__heading--alt", children: callout }),
|
|
@@ -2332,7 +2398,7 @@
|
|
|
2332
2398
|
] }),
|
|
2333
2399
|
paragraph && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "usx-hero__paragraph", children: paragraph }),
|
|
2334
2400
|
searchProps && /* @__PURE__ */ jsxRuntime.jsx(Search, { ...searchProps }),
|
|
2335
|
-
!searchProps &&
|
|
2401
|
+
!searchProps && buttonProps && /* @__PURE__ */ jsxRuntime.jsx(Button, { ...buttonProps })
|
|
2336
2402
|
] }),
|
|
2337
2403
|
secondaryContent && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-hero__secondary", children: [
|
|
2338
2404
|
secondaryContent.title && /* @__PURE__ */ jsxRuntime.jsx(SecondaryHeading, { className: "usx-hero__secondary-heading", children: secondaryContent.title }),
|
|
@@ -2347,16 +2413,16 @@
|
|
|
2347
2413
|
}
|
|
2348
2414
|
return content;
|
|
2349
2415
|
}
|
|
2350
|
-
function IconList({ items = [], primary = false, size = null, className = "", ...
|
|
2351
|
-
const classes =
|
|
2416
|
+
function IconList({ items = [], primary = false, size = null, className = "", ...props2 }) {
|
|
2417
|
+
const classes = ClassNames(
|
|
2352
2418
|
"usa-icon-list",
|
|
2353
2419
|
"usx-icon-list",
|
|
2354
2420
|
primary && "usa-icon-list--primary",
|
|
2355
2421
|
size === "lg" && "usa-icon-list--size-lg",
|
|
2356
2422
|
className
|
|
2357
2423
|
);
|
|
2358
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...
|
|
2359
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2424
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props2, children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: ClassNames("usa-icon-list__item", item.itemClassName), children: [
|
|
2425
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: ClassNames("usa-icon-list__icon", item.iconColor && `text-${item.iconColor}`, item.iconClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2360
2426
|
Icon,
|
|
2361
2427
|
{
|
|
2362
2428
|
name: item.iconName,
|
|
@@ -2365,7 +2431,7 @@
|
|
|
2365
2431
|
className: item.iconClassName
|
|
2366
2432
|
}
|
|
2367
2433
|
) }),
|
|
2368
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2434
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usa-icon-list__content", item.contentClassName), children: [
|
|
2369
2435
|
item.title ? /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-icon-list__title", children: item.title }) : null,
|
|
2370
2436
|
renderContent$1(item.content)
|
|
2371
2437
|
] })
|
|
@@ -2446,7 +2512,7 @@
|
|
|
2446
2512
|
overlapAvatars = false,
|
|
2447
2513
|
className = ""
|
|
2448
2514
|
}) {
|
|
2449
|
-
const classes =
|
|
2515
|
+
const classes = ClassNames("usa-identifier", "usx-identifier", className);
|
|
2450
2516
|
const labels = {
|
|
2451
2517
|
masthead: language === "es" ? "Identificador de la agencia," : "Agency identifier,",
|
|
2452
2518
|
description: language === "es" ? "Descripcion de la agencia," : "Agency description,",
|
|
@@ -2460,7 +2526,7 @@
|
|
|
2460
2526
|
avatarProps.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2461
2527
|
"div",
|
|
2462
2528
|
{
|
|
2463
|
-
className:
|
|
2529
|
+
className: ClassNames(
|
|
2464
2530
|
"usa-identifier__logos",
|
|
2465
2531
|
"usx-avatar-group",
|
|
2466
2532
|
overlapAvatars && "usa-avatar-group--overlap"
|
|
@@ -2471,8 +2537,8 @@
|
|
|
2471
2537
|
...avatar,
|
|
2472
2538
|
key: `${avatar.alt}-${index}`,
|
|
2473
2539
|
shape: avatar.shape || logoShape,
|
|
2474
|
-
className:
|
|
2475
|
-
imageClassName:
|
|
2540
|
+
className: ClassNames("usa-identifier__logo", avatar.className),
|
|
2541
|
+
imageClassName: ClassNames("usa-identifier__logo-img", avatar.imageClassName)
|
|
2476
2542
|
}
|
|
2477
2543
|
))
|
|
2478
2544
|
}
|
|
@@ -2504,7 +2570,7 @@
|
|
|
2504
2570
|
children = null,
|
|
2505
2571
|
className = "",
|
|
2506
2572
|
contentClassName = "",
|
|
2507
|
-
...
|
|
2573
|
+
...props2
|
|
2508
2574
|
}) {
|
|
2509
2575
|
const contentId = `${id}-content`;
|
|
2510
2576
|
const resolvedSelector = mainContentSelector || `#${contentId}`;
|
|
@@ -2513,7 +2579,7 @@
|
|
|
2513
2579
|
"aside",
|
|
2514
2580
|
{
|
|
2515
2581
|
id,
|
|
2516
|
-
className:
|
|
2582
|
+
className: ClassNames("usa-in-page-nav", "usx-in-page-nav", className),
|
|
2517
2583
|
"data-heading-elements": headingElements,
|
|
2518
2584
|
"data-main-content-selector": resolvedSelector,
|
|
2519
2585
|
"data-title-heading-level": titleHeadingLevel,
|
|
@@ -2522,27 +2588,27 @@
|
|
|
2522
2588
|
"data-root-margin": rootMargin,
|
|
2523
2589
|
"data-threshold": threshold,
|
|
2524
2590
|
"data-minimum-heading-count": minimumHeadingCount,
|
|
2525
|
-
...
|
|
2591
|
+
...props2
|
|
2526
2592
|
}
|
|
2527
2593
|
),
|
|
2528
2594
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2529
2595
|
"div",
|
|
2530
2596
|
{
|
|
2531
2597
|
id: contentId,
|
|
2532
|
-
className:
|
|
2598
|
+
className: ClassNames("usx-in-page-nav__content", "usa-prose", contentClassName),
|
|
2533
2599
|
...children ? {} : { dangerouslySetInnerHTML: { __html: content } },
|
|
2534
2600
|
children: children || null
|
|
2535
2601
|
}
|
|
2536
2602
|
)
|
|
2537
2603
|
] });
|
|
2538
2604
|
}
|
|
2539
|
-
function Indicator({ items = [], children = null, className = "", ...
|
|
2540
|
-
const classes =
|
|
2541
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...
|
|
2605
|
+
function Indicator({ items = [], children = null, className = "", ...props2 }) {
|
|
2606
|
+
const classes = ClassNames("usx-indicator", className);
|
|
2607
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props2, children: [
|
|
2542
2608
|
items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2543
2609
|
"span",
|
|
2544
2610
|
{
|
|
2545
|
-
className:
|
|
2611
|
+
className: ClassNames("usx-indicator-item", item.className),
|
|
2546
2612
|
style: item.style,
|
|
2547
2613
|
children: item.label
|
|
2548
2614
|
},
|
|
@@ -2579,11 +2645,11 @@
|
|
|
2579
2645
|
className,
|
|
2580
2646
|
navAriaLabel
|
|
2581
2647
|
}) {
|
|
2582
|
-
const containerClasses =
|
|
2648
|
+
const containerClasses = ClassNames(
|
|
2583
2649
|
"usa-language-container",
|
|
2584
2650
|
small && "usa-language--small"
|
|
2585
2651
|
);
|
|
2586
|
-
const buttonClasses =
|
|
2652
|
+
const buttonClasses = ClassNames(
|
|
2587
2653
|
"usa-button",
|
|
2588
2654
|
"usx-button",
|
|
2589
2655
|
unstyled ? "usa-button--unstyled" : "usa-button--primary",
|
|
@@ -2624,10 +2690,10 @@
|
|
|
2624
2690
|
navAriaLabel = "Language selection",
|
|
2625
2691
|
className = "",
|
|
2626
2692
|
onSelect = null,
|
|
2627
|
-
...
|
|
2693
|
+
...props2
|
|
2628
2694
|
}) {
|
|
2629
2695
|
const resolvedVariant = variant || (languages.length > 2 ? "menu" : "two");
|
|
2630
|
-
const classes =
|
|
2696
|
+
const classes = ClassNames("usx-language-selector", className);
|
|
2631
2697
|
if (!languages || languages.length === 0) {
|
|
2632
2698
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, children: "LanguageSelector" });
|
|
2633
2699
|
}
|
|
@@ -2640,7 +2706,7 @@
|
|
|
2640
2706
|
onSelect,
|
|
2641
2707
|
className: classes,
|
|
2642
2708
|
navAriaLabel,
|
|
2643
|
-
...
|
|
2709
|
+
...props2
|
|
2644
2710
|
}
|
|
2645
2711
|
);
|
|
2646
2712
|
}
|
|
@@ -2655,13 +2721,13 @@
|
|
|
2655
2721
|
onSelect,
|
|
2656
2722
|
className: classes,
|
|
2657
2723
|
navAriaLabel,
|
|
2658
|
-
...
|
|
2724
|
+
...props2
|
|
2659
2725
|
}
|
|
2660
2726
|
);
|
|
2661
2727
|
}
|
|
2662
|
-
function SingleColumnLayout({ children, expandButton = null, className = "", ...
|
|
2663
|
-
const classes =
|
|
2664
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...
|
|
2728
|
+
function SingleColumnLayout({ children, expandButton = null, className = "", ...props2 }) {
|
|
2729
|
+
const classes = ClassNames("usx-layout__single-column", className);
|
|
2730
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props2, children: [
|
|
2665
2731
|
expandButton,
|
|
2666
2732
|
children
|
|
2667
2733
|
] });
|
|
@@ -2674,33 +2740,33 @@
|
|
|
2674
2740
|
expandButton = null,
|
|
2675
2741
|
children,
|
|
2676
2742
|
className = "",
|
|
2677
|
-
...
|
|
2743
|
+
...props2
|
|
2678
2744
|
}) {
|
|
2679
2745
|
const contentModifier = rightSidebar && !leftSidebar ? "left" : leftSidebar && !rightSidebar ? "right" : null;
|
|
2680
|
-
const contentClasses =
|
|
2746
|
+
const contentClasses = ClassNames(
|
|
2681
2747
|
"usx-layout__content",
|
|
2682
2748
|
{
|
|
2683
2749
|
"usx-layout__content--left": contentModifier === "left",
|
|
2684
2750
|
"usx-layout__content--right": contentModifier === "right"
|
|
2685
2751
|
}
|
|
2686
2752
|
);
|
|
2687
|
-
const containerClasses =
|
|
2753
|
+
const containerClasses = ClassNames(
|
|
2688
2754
|
"usx-layout__grid-container",
|
|
2689
2755
|
className
|
|
2690
2756
|
);
|
|
2691
|
-
const leftSidebarClasses =
|
|
2757
|
+
const leftSidebarClasses = ClassNames(
|
|
2692
2758
|
"usx-layout__sidebar--left",
|
|
2693
2759
|
{
|
|
2694
2760
|
"usx-layout__sidebar--expanded": expandLeftSidebar
|
|
2695
2761
|
}
|
|
2696
2762
|
);
|
|
2697
|
-
const rightSidebarClasses =
|
|
2763
|
+
const rightSidebarClasses = ClassNames(
|
|
2698
2764
|
"usx-layout__sidebar--right",
|
|
2699
2765
|
{
|
|
2700
2766
|
"usx-layout__sidebar--expanded": expandRightSidebar
|
|
2701
2767
|
}
|
|
2702
2768
|
);
|
|
2703
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: containerClasses, ...
|
|
2769
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: containerClasses, ...props2, children: [
|
|
2704
2770
|
leftSidebar && /* @__PURE__ */ jsxRuntime.jsx("aside", { className: leftSidebarClasses, children: leftSidebar }),
|
|
2705
2771
|
/* @__PURE__ */ jsxRuntime.jsxs("main", { className: contentClasses, children: [
|
|
2706
2772
|
expandButton,
|
|
@@ -2719,10 +2785,10 @@
|
|
|
2719
2785
|
expandRightSidebar,
|
|
2720
2786
|
expandable = false,
|
|
2721
2787
|
className = "",
|
|
2722
|
-
...
|
|
2788
|
+
...props2
|
|
2723
2789
|
}) {
|
|
2724
2790
|
const [expanded, setExpanded] = React.useState(false);
|
|
2725
|
-
const classes =
|
|
2791
|
+
const classes = ClassNames(
|
|
2726
2792
|
"usx-layout",
|
|
2727
2793
|
{ "usx-expanded": expandable && expanded },
|
|
2728
2794
|
className
|
|
@@ -2743,7 +2809,7 @@
|
|
|
2743
2809
|
]
|
|
2744
2810
|
}
|
|
2745
2811
|
) : null;
|
|
2746
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
2812
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: variant === "single-column" ? /* @__PURE__ */ jsxRuntime.jsx(SingleColumnLayout, { expandButton, children: children || content }) : variant === "grid" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2747
2813
|
GridLayout,
|
|
2748
2814
|
{
|
|
2749
2815
|
leftSidebar,
|
|
@@ -2770,7 +2836,7 @@
|
|
|
2770
2836
|
const childUnstyled = objectItem && typeof item.unstyled === "boolean" ? item.unstyled : parentOptions.unstyled;
|
|
2771
2837
|
const childClassName = objectItem && typeof item.className === "string" ? item.className : "";
|
|
2772
2838
|
const ChildTag = childOrdered ? "ol" : "ul";
|
|
2773
|
-
const childClasses =
|
|
2839
|
+
const childClasses = ClassNames(
|
|
2774
2840
|
"usa-list",
|
|
2775
2841
|
"usx-list",
|
|
2776
2842
|
childUnstyled && "usa-list--unstyled",
|
|
@@ -2782,15 +2848,15 @@
|
|
|
2782
2848
|
] }, index);
|
|
2783
2849
|
});
|
|
2784
2850
|
}
|
|
2785
|
-
function List({ items = [], ordered = false, unstyled = false, className = "", ...
|
|
2786
|
-
const classes =
|
|
2851
|
+
function List({ items = [], ordered = false, unstyled = false, className = "", ...props2 }) {
|
|
2852
|
+
const classes = ClassNames(
|
|
2787
2853
|
"usa-list",
|
|
2788
2854
|
"usx-list",
|
|
2789
2855
|
unstyled && "usa-list--unstyled",
|
|
2790
2856
|
className
|
|
2791
2857
|
);
|
|
2792
2858
|
const Tag2 = ordered ? "ol" : "ul";
|
|
2793
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, ...
|
|
2859
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, ...props2, children: renderItems(items, { ordered, unstyled }) });
|
|
2794
2860
|
}
|
|
2795
2861
|
function Select({
|
|
2796
2862
|
label,
|
|
@@ -2806,7 +2872,7 @@
|
|
|
2806
2872
|
required = false,
|
|
2807
2873
|
formGroup = true,
|
|
2808
2874
|
className = "",
|
|
2809
|
-
...
|
|
2875
|
+
...props2
|
|
2810
2876
|
}) {
|
|
2811
2877
|
const selectId = id || `select-${Math.random().toString(36).substr(2, 9)}`;
|
|
2812
2878
|
const hintId = hint ? `${selectId}-hint` : void 0;
|
|
@@ -2816,7 +2882,7 @@
|
|
|
2816
2882
|
const selectClasses = "usa-select usx-select";
|
|
2817
2883
|
const selectErrorClasses = "usa-input--error";
|
|
2818
2884
|
const selectSuccessClasses = "usa-input--success";
|
|
2819
|
-
const combinedSelectClasses =
|
|
2885
|
+
const combinedSelectClasses = ClassNames(
|
|
2820
2886
|
selectClasses,
|
|
2821
2887
|
hasError && selectErrorClasses,
|
|
2822
2888
|
hasSuccess && selectSuccessClasses,
|
|
@@ -2833,7 +2899,7 @@
|
|
|
2833
2899
|
defaultValue,
|
|
2834
2900
|
"aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
|
|
2835
2901
|
"aria-invalid": hasError ? true : void 0,
|
|
2836
|
-
...
|
|
2902
|
+
...props2
|
|
2837
2903
|
};
|
|
2838
2904
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2839
2905
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: selectId, required, error: hasError, children: label }),
|
|
@@ -2976,11 +3042,11 @@
|
|
|
2976
3042
|
importantLinkHref,
|
|
2977
3043
|
importantLinkIcon = "undo",
|
|
2978
3044
|
showReturnLink = true,
|
|
2979
|
-
...
|
|
3045
|
+
...props2
|
|
2980
3046
|
}) {
|
|
2981
3047
|
const menuId = React.useId();
|
|
2982
3048
|
const toggleId = React.useId();
|
|
2983
|
-
const classes =
|
|
3049
|
+
const classes = ClassNames("usx-misc-banner", `bg-${tone}`, className);
|
|
2984
3050
|
const mobileLinks = [];
|
|
2985
3051
|
const hasLearnMoreLink = showLearnMore && Boolean(casualLinkText);
|
|
2986
3052
|
const hasReturnLink = showReturnLink && Boolean(importantLinkText);
|
|
@@ -3032,7 +3098,7 @@
|
|
|
3032
3098
|
/* @__PURE__ */ jsxRuntime.jsx("div", { id: menuId, className: "usx-misc-banner__dropdown-content", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "usa-list", children: mobileLinks.map((link) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "usa-list__item", children: /* @__PURE__ */ jsxRuntime.jsx("a", { className: "usa-link usx-misc-banner__link", href: link.href, children: link.text }) }, `${link.href}-${link.text}`)) }) })
|
|
3033
3099
|
] }) : null
|
|
3034
3100
|
] });
|
|
3035
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
3101
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-misc-banner__content grid-container", children: content }) });
|
|
3036
3102
|
}
|
|
3037
3103
|
const validElements = ["div", "article", "section", "main"];
|
|
3038
3104
|
const Prose = ({
|
|
@@ -3040,14 +3106,14 @@
|
|
|
3040
3106
|
content,
|
|
3041
3107
|
children,
|
|
3042
3108
|
className = "",
|
|
3043
|
-
...
|
|
3109
|
+
...props2
|
|
3044
3110
|
}) => {
|
|
3045
3111
|
const Element = validElements.includes(containerElement) ? containerElement : "div";
|
|
3046
3112
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3047
3113
|
Element,
|
|
3048
3114
|
{
|
|
3049
3115
|
className: `usa-prose usx-prose ${className}`,
|
|
3050
|
-
...
|
|
3116
|
+
...props2,
|
|
3051
3117
|
...content ? { dangerouslySetInnerHTML: { __html: content } } : {},
|
|
3052
3118
|
children: children ? children : null
|
|
3053
3119
|
}
|
|
@@ -3065,9 +3131,9 @@
|
|
|
3065
3131
|
forceAction = false,
|
|
3066
3132
|
className = "",
|
|
3067
3133
|
children,
|
|
3068
|
-
...
|
|
3134
|
+
...props2
|
|
3069
3135
|
}) {
|
|
3070
|
-
const classes =
|
|
3136
|
+
const classes = ClassNames("usa-modal", "usx-modal", {
|
|
3071
3137
|
"usa-modal--lg": size === "lg",
|
|
3072
3138
|
"usx-modal--lg-collapsed": size === "lg-collapsed"
|
|
3073
3139
|
}, className);
|
|
@@ -3079,7 +3145,7 @@
|
|
|
3079
3145
|
"aria-labelledby": `${id}-heading`,
|
|
3080
3146
|
"aria-describedby": `${id}-description`,
|
|
3081
3147
|
...forceAction ? { "data-force-action": true } : {},
|
|
3082
|
-
...
|
|
3148
|
+
...props2,
|
|
3083
3149
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-modal__content", children: [
|
|
3084
3150
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-modal__main", children: [
|
|
3085
3151
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "usa-modal__heading", id: `${id}-heading`, children: heading }),
|
|
@@ -3108,12 +3174,12 @@
|
|
|
3108
3174
|
children = null,
|
|
3109
3175
|
content = null,
|
|
3110
3176
|
className = "",
|
|
3111
|
-
...
|
|
3177
|
+
...props2
|
|
3112
3178
|
}) {
|
|
3113
|
-
const classes =
|
|
3179
|
+
const classes = ClassNames("usx-page", className);
|
|
3114
3180
|
const pageContent = children || content;
|
|
3115
3181
|
const Element = element;
|
|
3116
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Element, { id, className: classes, ...
|
|
3182
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Element, { id, className: classes, ...props2, children: [
|
|
3117
3183
|
/* @__PURE__ */ jsxRuntime.jsxs("h1", { className: "usx-page__title", children: [
|
|
3118
3184
|
eyebrow ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-eyebrow", children: eyebrow }) : null,
|
|
3119
3185
|
title
|
|
@@ -3199,7 +3265,7 @@
|
|
|
3199
3265
|
lastClickTime.current = e.timeStamp;
|
|
3200
3266
|
if (!isLastPage) onPageChange((prev) => unbounded ? prev + 1 : Math.min(prev + 1, totalPages));
|
|
3201
3267
|
};
|
|
3202
|
-
const navClasses =
|
|
3268
|
+
const navClasses = ClassNames(
|
|
3203
3269
|
"usa-pagination",
|
|
3204
3270
|
"usx-pagination__nav",
|
|
3205
3271
|
{ "usx-pagination__arrows-only": arrowsOnly },
|
|
@@ -3209,7 +3275,7 @@
|
|
|
3209
3275
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3210
3276
|
"li",
|
|
3211
3277
|
{
|
|
3212
|
-
className:
|
|
3278
|
+
className: ClassNames(
|
|
3213
3279
|
"usa-pagination__item",
|
|
3214
3280
|
"usa-pagination__arrow"
|
|
3215
3281
|
),
|
|
@@ -3217,7 +3283,7 @@
|
|
|
3217
3283
|
"a",
|
|
3218
3284
|
{
|
|
3219
3285
|
href: "#",
|
|
3220
|
-
className:
|
|
3286
|
+
className: ClassNames(
|
|
3221
3287
|
"usa-pagination__link",
|
|
3222
3288
|
"usa-pagination__previous-page",
|
|
3223
3289
|
isFirstPage && "display-none",
|
|
@@ -3232,7 +3298,7 @@
|
|
|
3232
3298
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3233
3299
|
"span",
|
|
3234
3300
|
{
|
|
3235
|
-
className:
|
|
3301
|
+
className: ClassNames(
|
|
3236
3302
|
"usa-pagination__link-text",
|
|
3237
3303
|
hideLinkText && "usa-sr-only"
|
|
3238
3304
|
),
|
|
@@ -3261,7 +3327,7 @@
|
|
|
3261
3327
|
"a",
|
|
3262
3328
|
{
|
|
3263
3329
|
href: "#",
|
|
3264
|
-
className:
|
|
3330
|
+
className: ClassNames(
|
|
3265
3331
|
"usa-pagination__button",
|
|
3266
3332
|
isCurrent && "usa-current"
|
|
3267
3333
|
),
|
|
@@ -3275,7 +3341,7 @@
|
|
|
3275
3341
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3276
3342
|
"li",
|
|
3277
3343
|
{
|
|
3278
|
-
className:
|
|
3344
|
+
className: ClassNames(
|
|
3279
3345
|
"usa-pagination__item",
|
|
3280
3346
|
"usa-pagination__arrow"
|
|
3281
3347
|
),
|
|
@@ -3283,7 +3349,7 @@
|
|
|
3283
3349
|
"a",
|
|
3284
3350
|
{
|
|
3285
3351
|
href: "#",
|
|
3286
|
-
className:
|
|
3352
|
+
className: ClassNames(
|
|
3287
3353
|
"usa-pagination__link",
|
|
3288
3354
|
"usa-pagination__next-page",
|
|
3289
3355
|
isLastPage && "display-none",
|
|
@@ -3297,7 +3363,7 @@
|
|
|
3297
3363
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3298
3364
|
"span",
|
|
3299
3365
|
{
|
|
3300
|
-
className:
|
|
3366
|
+
className: ClassNames(
|
|
3301
3367
|
"usa-pagination__link-text",
|
|
3302
3368
|
hideLinkText && "usa-sr-only"
|
|
3303
3369
|
),
|
|
@@ -3320,7 +3386,7 @@
|
|
|
3320
3386
|
id = "pagination-step-options",
|
|
3321
3387
|
className = ""
|
|
3322
3388
|
}) {
|
|
3323
|
-
const classes =
|
|
3389
|
+
const classes = ClassNames(
|
|
3324
3390
|
"usx-pagination__step-options",
|
|
3325
3391
|
className
|
|
3326
3392
|
);
|
|
@@ -3348,7 +3414,7 @@
|
|
|
3348
3414
|
}) {
|
|
3349
3415
|
const firstItem = (currentPage - 1) * pageSize + 1;
|
|
3350
3416
|
const lastItem = Math.min(currentPage * pageSize, totalItems);
|
|
3351
|
-
const classes =
|
|
3417
|
+
const classes = ClassNames(
|
|
3352
3418
|
"usa-label",
|
|
3353
3419
|
"usx-label",
|
|
3354
3420
|
"usx-pagination__summary",
|
|
@@ -3372,10 +3438,10 @@
|
|
|
3372
3438
|
navigation,
|
|
3373
3439
|
stepOptions,
|
|
3374
3440
|
className = "",
|
|
3375
|
-
...
|
|
3441
|
+
...props2
|
|
3376
3442
|
}) {
|
|
3377
|
-
const classes =
|
|
3378
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...
|
|
3443
|
+
const classes = ClassNames("usx-pagination__container", className);
|
|
3444
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props2, children: [
|
|
3379
3445
|
summary && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-pagination__container-summary", children: summary }),
|
|
3380
3446
|
(stepOptions || navigation) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-pagination__container-end", children: [
|
|
3381
3447
|
stepOptions && stepOptions,
|
|
@@ -3420,7 +3486,7 @@
|
|
|
3420
3486
|
onPageSizeChange == null ? void 0 : onPageSizeChange(size, newPage);
|
|
3421
3487
|
onPageChange == null ? void 0 : onPageChange(newPage, size);
|
|
3422
3488
|
};
|
|
3423
|
-
const classes =
|
|
3489
|
+
const classes = ClassNames("usx-pagination", className);
|
|
3424
3490
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3425
3491
|
PaginationContainer,
|
|
3426
3492
|
{
|
|
@@ -3463,16 +3529,50 @@
|
|
|
3463
3529
|
}
|
|
3464
3530
|
return content;
|
|
3465
3531
|
}
|
|
3466
|
-
const ProcessList = ({ items = [], className = "", ...
|
|
3467
|
-
const classes =
|
|
3468
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ol", { className: classes, ...
|
|
3532
|
+
const ProcessList = ({ items = [], className = "", ...props2 }) => {
|
|
3533
|
+
const classes = ClassNames("usa-process-list", "usx-process-list", className);
|
|
3534
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ol", { className: classes, ...props2, children: items.map((item, index) => {
|
|
3469
3535
|
const HeadingTag = item.headingTag || "h4";
|
|
3470
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className:
|
|
3471
|
-
/* @__PURE__ */ jsxRuntime.jsx(HeadingTag, { className:
|
|
3472
|
-
item.body && (typeof item.body === "string" || item.bodyClassName ? /* @__PURE__ */ jsxRuntime.jsx("p", { className:
|
|
3536
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: ClassNames("usa-process-list__item", item.className), children: [
|
|
3537
|
+
/* @__PURE__ */ jsxRuntime.jsx(HeadingTag, { className: ClassNames("usa-process-list__heading", item.headingClassName), children: item.heading }),
|
|
3538
|
+
item.body && (typeof item.body === "string" || item.bodyClassName ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: ClassNames(item.bodyClassName), children: renderContent(item.body) }) : renderContent(item.body))
|
|
3473
3539
|
] }, index);
|
|
3474
3540
|
}) });
|
|
3475
3541
|
};
|
|
3542
|
+
function Quote({
|
|
3543
|
+
calloutProps,
|
|
3544
|
+
attributionProps,
|
|
3545
|
+
children,
|
|
3546
|
+
content,
|
|
3547
|
+
sourceLinkProps,
|
|
3548
|
+
sourceTitle,
|
|
3549
|
+
className,
|
|
3550
|
+
blockquoteClassName,
|
|
3551
|
+
...props2
|
|
3552
|
+
}) {
|
|
3553
|
+
const isVertical = (calloutProps == null ? void 0 : calloutProps.orientation) === "vertical";
|
|
3554
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usx-quote", isVertical && "usx-quote--vertical", className), ...props2, children: [
|
|
3555
|
+
!isVertical && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "format_quote", size: 4, className: "usx-quote__icon" }),
|
|
3556
|
+
/* @__PURE__ */ jsxRuntime.jsx(Callout, { ...calloutProps, element: "div", children: /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: "usx-quote__body", children: [
|
|
3557
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3558
|
+
"blockquote",
|
|
3559
|
+
{
|
|
3560
|
+
className: ClassNames("usx-quote__content", blockquoteClassName),
|
|
3561
|
+
cite: sourceLinkProps == null ? void 0 : sourceLinkProps.href,
|
|
3562
|
+
children: [
|
|
3563
|
+
isVertical && "❝",
|
|
3564
|
+
children ?? content,
|
|
3565
|
+
isVertical && "❞"
|
|
3566
|
+
]
|
|
3567
|
+
}
|
|
3568
|
+
),
|
|
3569
|
+
(attributionProps || sourceTitle) && /* @__PURE__ */ jsxRuntime.jsxs("figcaption", { className: "usx-quote__attribution", children: [
|
|
3570
|
+
attributionProps && /* @__PURE__ */ jsxRuntime.jsx(Attribution, { ...attributionProps }),
|
|
3571
|
+
sourceTitle && /* @__PURE__ */ jsxRuntime.jsx("cite", { children: sourceLinkProps ? /* @__PURE__ */ jsxRuntime.jsx(Link, { ...sourceLinkProps, children: sourceTitle }) : sourceTitle })
|
|
3572
|
+
] })
|
|
3573
|
+
] }) })
|
|
3574
|
+
] });
|
|
3575
|
+
}
|
|
3476
3576
|
const RadioButtons = ({
|
|
3477
3577
|
tile = false,
|
|
3478
3578
|
small = false,
|
|
@@ -3484,19 +3584,19 @@
|
|
|
3484
3584
|
options = [],
|
|
3485
3585
|
defaultValue = void 0,
|
|
3486
3586
|
className = "",
|
|
3487
|
-
...
|
|
3587
|
+
...props2
|
|
3488
3588
|
}) => {
|
|
3489
|
-
const classes =
|
|
3589
|
+
const classes = ClassNames(
|
|
3490
3590
|
"usa-radio",
|
|
3491
3591
|
"usx-radio",
|
|
3492
3592
|
{ "usx-radio--small": small },
|
|
3493
3593
|
className
|
|
3494
3594
|
);
|
|
3495
|
-
const inputClasses =
|
|
3595
|
+
const inputClasses = ClassNames(
|
|
3496
3596
|
"usa-radio__input",
|
|
3497
3597
|
{ "usa-radio__input--tile": tile }
|
|
3498
3598
|
);
|
|
3499
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsxRuntime.jsx(Fieldset, { legend, required, hint, error, ...
|
|
3599
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsxRuntime.jsx(Fieldset, { legend, required, hint, error, ...props2, children: options.map((opt, idx) => {
|
|
3500
3600
|
const id = opt.id || `${name}-${idx}`;
|
|
3501
3601
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, children: [
|
|
3502
3602
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3535,7 +3635,7 @@
|
|
|
3535
3635
|
textPreposition = null,
|
|
3536
3636
|
formGroup = true,
|
|
3537
3637
|
className = "",
|
|
3538
|
-
...
|
|
3638
|
+
...props2
|
|
3539
3639
|
}) {
|
|
3540
3640
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
3541
3641
|
const errorId = error ? `${id}-error` : void 0;
|
|
@@ -3547,7 +3647,7 @@
|
|
|
3547
3647
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3548
3648
|
"input",
|
|
3549
3649
|
{
|
|
3550
|
-
className:
|
|
3650
|
+
className: ClassNames("usa-range", "usx-range-slider", className),
|
|
3551
3651
|
id,
|
|
3552
3652
|
type: "range",
|
|
3553
3653
|
name: name || id,
|
|
@@ -3561,7 +3661,7 @@
|
|
|
3561
3661
|
"aria-describedby": describedBy,
|
|
3562
3662
|
...textUnit ? { "data-text-unit": textUnit } : {},
|
|
3563
3663
|
...textPreposition ? { "data-text-preposition": textPreposition } : {},
|
|
3564
|
-
...
|
|
3664
|
+
...props2
|
|
3565
3665
|
}
|
|
3566
3666
|
)
|
|
3567
3667
|
] });
|
|
@@ -3569,15 +3669,17 @@
|
|
|
3569
3669
|
}
|
|
3570
3670
|
const Section = ({
|
|
3571
3671
|
title = "",
|
|
3672
|
+
headingLevel = "h2",
|
|
3572
3673
|
children = null,
|
|
3573
3674
|
content = null,
|
|
3574
3675
|
className = "",
|
|
3575
|
-
...
|
|
3676
|
+
...props2
|
|
3576
3677
|
}) => {
|
|
3577
|
-
const classes =
|
|
3678
|
+
const classes = ClassNames("usx-section", className);
|
|
3578
3679
|
const sectionContent = children || content;
|
|
3579
|
-
|
|
3580
|
-
|
|
3680
|
+
const Heading = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(headingLevel) ? headingLevel : "h2";
|
|
3681
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: classes, ...props2, children: [
|
|
3682
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx(Heading, { className: "usx-section__title", children: title }) : null,
|
|
3581
3683
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-section__content", children: sectionContent })
|
|
3582
3684
|
] });
|
|
3583
3685
|
};
|
|
@@ -3602,9 +3704,9 @@
|
|
|
3602
3704
|
sticky = false,
|
|
3603
3705
|
ariaLabel = "Side navigation",
|
|
3604
3706
|
className = "",
|
|
3605
|
-
...
|
|
3707
|
+
...props2
|
|
3606
3708
|
}) => {
|
|
3607
|
-
const classes =
|
|
3709
|
+
const classes = ClassNames(
|
|
3608
3710
|
"usa-sidenav",
|
|
3609
3711
|
"usx-sidenav",
|
|
3610
3712
|
{
|
|
@@ -3612,7 +3714,7 @@
|
|
|
3612
3714
|
},
|
|
3613
3715
|
className
|
|
3614
3716
|
);
|
|
3615
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...
|
|
3717
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props2, children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(SideNavItem, { item }, i)) }) });
|
|
3616
3718
|
};
|
|
3617
3719
|
const SiteAlert = ({
|
|
3618
3720
|
className = "",
|
|
@@ -3626,11 +3728,11 @@
|
|
|
3626
3728
|
role,
|
|
3627
3729
|
ariaLabel = "Site alert",
|
|
3628
3730
|
ariaLabelledby,
|
|
3629
|
-
...
|
|
3731
|
+
...props2
|
|
3630
3732
|
}) => {
|
|
3631
3733
|
const normalizedVariant = ["info", "emergency", "maintenance", "maintenance-warning"].includes(variant) ? variant : "info";
|
|
3632
3734
|
const alertVariant = normalizedVariant === "maintenance" ? "error" : normalizedVariant === "maintenance-warning" ? "warning" : normalizedVariant;
|
|
3633
|
-
const classes =
|
|
3735
|
+
const classes = ClassNames(
|
|
3634
3736
|
"usa-site-alert",
|
|
3635
3737
|
"usx-site-alert",
|
|
3636
3738
|
(normalizedVariant === "info" || normalizedVariant === "emergency") && `usa-site-alert--${normalizedVariant}`,
|
|
@@ -3639,8 +3741,8 @@
|
|
|
3639
3741
|
noIcon && "usa-site-alert--no-icon",
|
|
3640
3742
|
onDismiss && "usa-site-alert--dismissible",
|
|
3641
3743
|
className
|
|
3642
|
-
|
|
3643
|
-
const alertClasses =
|
|
3744
|
+
);
|
|
3745
|
+
const alertClasses = ClassNames(
|
|
3644
3746
|
"usa-alert",
|
|
3645
3747
|
`usa-alert--${alertVariant}`,
|
|
3646
3748
|
"usx-alert",
|
|
@@ -3649,7 +3751,7 @@
|
|
|
3649
3751
|
slim && "usx-alert--slim",
|
|
3650
3752
|
noIcon && "usa-alert--no-icon",
|
|
3651
3753
|
noIcon && "usx-alert--no-icon"
|
|
3652
|
-
|
|
3754
|
+
);
|
|
3653
3755
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3654
3756
|
"section",
|
|
3655
3757
|
{
|
|
@@ -3657,7 +3759,7 @@
|
|
|
3657
3759
|
role,
|
|
3658
3760
|
"aria-label": ariaLabelledby ? void 0 : ariaLabel,
|
|
3659
3761
|
"aria-labelledby": ariaLabelledby,
|
|
3660
|
-
...
|
|
3762
|
+
...props2,
|
|
3661
3763
|
children: alertContent ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: alertClasses, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-alert__body usx-alert__body", children: [
|
|
3662
3764
|
alertHeading && /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-alert__heading usx-alert__heading", children: alertHeading }),
|
|
3663
3765
|
alertContent,
|
|
@@ -3701,27 +3803,27 @@
|
|
|
3701
3803
|
content,
|
|
3702
3804
|
children = null,
|
|
3703
3805
|
className = "",
|
|
3704
|
-
...
|
|
3806
|
+
...props2
|
|
3705
3807
|
}) => {
|
|
3706
|
-
const classes =
|
|
3808
|
+
const classes = ClassNames("usa-skipnav", className);
|
|
3707
3809
|
const finalHref = normalizeHref({ href, target });
|
|
3708
|
-
return /* @__PURE__ */ jsxRuntime.jsx("a", { className: classes, href: finalHref, ...
|
|
3810
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { className: classes, href: finalHref, ...props2, children: children || content || "Skip to main content" });
|
|
3709
3811
|
};
|
|
3710
3812
|
const Status = ({
|
|
3711
3813
|
color = void 0,
|
|
3712
3814
|
size = void 0,
|
|
3713
3815
|
animation = void 0,
|
|
3714
3816
|
className = "",
|
|
3715
|
-
...
|
|
3817
|
+
...props2
|
|
3716
3818
|
}) => {
|
|
3717
|
-
const classes =
|
|
3819
|
+
const classes = ClassNames(
|
|
3718
3820
|
"usx-status",
|
|
3719
3821
|
color && `text-${color}`,
|
|
3720
3822
|
size && `usx-status--${size}`,
|
|
3721
3823
|
animation && `usx-${animation}`,
|
|
3722
3824
|
className
|
|
3723
3825
|
);
|
|
3724
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...
|
|
3826
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...props2 });
|
|
3725
3827
|
};
|
|
3726
3828
|
const StepIndicator = ({
|
|
3727
3829
|
steps = [],
|
|
@@ -3729,11 +3831,11 @@
|
|
|
3729
3831
|
variant = "",
|
|
3730
3832
|
headingTag: HeadingTag = "h4",
|
|
3731
3833
|
className = "",
|
|
3732
|
-
...
|
|
3834
|
+
...props2
|
|
3733
3835
|
}) => {
|
|
3734
3836
|
var _a;
|
|
3735
3837
|
const step = Number(currentStep);
|
|
3736
|
-
const classes =
|
|
3838
|
+
const classes = ClassNames(
|
|
3737
3839
|
"usa-step-indicator",
|
|
3738
3840
|
"usx-step-indicator",
|
|
3739
3841
|
variant && `usa-step-indicator--${variant}`,
|
|
@@ -3746,13 +3848,13 @@
|
|
|
3746
3848
|
return "";
|
|
3747
3849
|
};
|
|
3748
3850
|
const currentLabel = ((_a = steps[step - 1]) == null ? void 0 : _a.label) || "";
|
|
3749
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...
|
|
3851
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props2, children: [
|
|
3750
3852
|
/* @__PURE__ */ jsxRuntime.jsx("ol", { className: "usa-step-indicator__segments", children: steps.map((s, index) => {
|
|
3751
3853
|
const status = getStatus(index);
|
|
3752
3854
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3753
3855
|
"li",
|
|
3754
3856
|
{
|
|
3755
|
-
className:
|
|
3857
|
+
className: ClassNames(
|
|
3756
3858
|
"usa-step-indicator__segment",
|
|
3757
3859
|
status === "complete" && "usa-step-indicator__segment--complete",
|
|
3758
3860
|
status === "current" && "usa-step-indicator__segment--current"
|
|
@@ -3788,9 +3890,9 @@
|
|
|
3788
3890
|
content = "",
|
|
3789
3891
|
children = null,
|
|
3790
3892
|
className = "",
|
|
3791
|
-
...
|
|
3893
|
+
...props2
|
|
3792
3894
|
}) => {
|
|
3793
|
-
const classes =
|
|
3895
|
+
const classes = ClassNames("usa-summary-box", "usx-summary-box", className);
|
|
3794
3896
|
const headingId = id;
|
|
3795
3897
|
const bodyContent = children ?? content;
|
|
3796
3898
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3799,7 +3901,7 @@
|
|
|
3799
3901
|
className: classes,
|
|
3800
3902
|
role: "region",
|
|
3801
3903
|
"aria-labelledby": headingId,
|
|
3802
|
-
...
|
|
3904
|
+
...props2,
|
|
3803
3905
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-summary-box__body", children: [
|
|
3804
3906
|
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-summary-box__heading", id: headingId, children: heading }),
|
|
3805
3907
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-summary-box__text", children: bodyContent })
|
|
@@ -3817,18 +3919,18 @@
|
|
|
3817
3919
|
inputProps = {},
|
|
3818
3920
|
onClassName = "",
|
|
3819
3921
|
offClassName = "",
|
|
3820
|
-
...
|
|
3922
|
+
...props2
|
|
3821
3923
|
}) => {
|
|
3822
3924
|
const variantClass = variant !== "default" ? `usx-swap--${variant}` : "";
|
|
3823
|
-
const classes =
|
|
3824
|
-
const onClasses =
|
|
3825
|
-
const offClasses =
|
|
3925
|
+
const classes = ClassNames("usx-swap", variantClass, className);
|
|
3926
|
+
const onClasses = ClassNames("usx-swap-on", onClassName);
|
|
3927
|
+
const offClasses = ClassNames("usx-swap-off", offClassName);
|
|
3826
3928
|
const content = children || /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3827
3929
|
includeInput ? /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", autoComplete: "off", ...inputProps }) : null,
|
|
3828
3930
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: onClasses, children: onContent }),
|
|
3829
3931
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: offClasses, children: offContent })
|
|
3830
3932
|
] });
|
|
3831
|
-
return /* @__PURE__ */ jsxRuntime.jsx("label", { className: classes, ...
|
|
3933
|
+
return /* @__PURE__ */ jsxRuntime.jsx("label", { className: classes, ...props2, children: content });
|
|
3832
3934
|
};
|
|
3833
3935
|
const Switch = ({
|
|
3834
3936
|
id,
|
|
@@ -3842,9 +3944,9 @@
|
|
|
3842
3944
|
className = "",
|
|
3843
3945
|
label,
|
|
3844
3946
|
indeterminate = false,
|
|
3845
|
-
...
|
|
3947
|
+
...props2
|
|
3846
3948
|
}) => {
|
|
3847
|
-
const classes =
|
|
3949
|
+
const classes = ClassNames(
|
|
3848
3950
|
"usx-switch",
|
|
3849
3951
|
size && `usx-toggle-${size}`,
|
|
3850
3952
|
variant && `text-${variant}`,
|
|
@@ -3866,7 +3968,7 @@
|
|
|
3866
3968
|
disabled,
|
|
3867
3969
|
"aria-checked": indeterminate ? "mixed" : typeof checked === "boolean" ? checked : void 0,
|
|
3868
3970
|
onChange,
|
|
3869
|
-
...
|
|
3971
|
+
...props2
|
|
3870
3972
|
};
|
|
3871
3973
|
const input = /* @__PURE__ */ jsxRuntime.jsx("input", { ref, ...inputProps });
|
|
3872
3974
|
if (label) {
|
|
@@ -3949,10 +4051,10 @@
|
|
|
3949
4051
|
const name = direction === "asc" ? "arrow_upward" : direction === "desc" ? "arrow_downward" : "sort_arrow";
|
|
3950
4052
|
return /* @__PURE__ */ jsxRuntime.jsx(Icon, { name, "aria-hidden": "true" });
|
|
3951
4053
|
}
|
|
3952
|
-
function TableHead({ className = "", children, ...
|
|
4054
|
+
function TableHead({ className = "", children, ...props2 }) {
|
|
3953
4055
|
const { id, columns, sortState, handleSort, selectionMode, selectionPosition, handleSelectAll, allowSelectAll, rowDetails } = useTableContext();
|
|
3954
4056
|
if (children) {
|
|
3955
|
-
return /* @__PURE__ */ jsxRuntime.jsx("thead", { className:
|
|
4057
|
+
return /* @__PURE__ */ jsxRuntime.jsx("thead", { className: ClassNames("usx-table__head", className), ...props2, children });
|
|
3956
4058
|
}
|
|
3957
4059
|
const visibleCols = columns.filter((c) => !c.hidden);
|
|
3958
4060
|
const totalDepth = getDepth(visibleCols);
|
|
@@ -3960,7 +4062,7 @@
|
|
|
3960
4062
|
const hasRowDetails = !!rowDetails;
|
|
3961
4063
|
const hasSelection = !!selectionMode;
|
|
3962
4064
|
const selectAllCell = /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", rowSpan: totalDepth, className: "usx-table__cell usx-table__cell--selection", children: selectionMode === "checkbox" && allowSelectAll && /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { id: `${id}-select-all`, onChange: handleSelectAll, ariaLabel: "Select all rows", className: "usx-table__checkbox" }) });
|
|
3963
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("thead", { className:
|
|
4065
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("thead", { className: ClassNames("usx-table__head", className), ...props2, children: [
|
|
3964
4066
|
/* @__PURE__ */ jsxRuntime.jsx("tr", { hidden: true, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-sr-only usa-table__announcement-region", "aria-live": "polite", id: `${id}-sort-announcement` }) }) }),
|
|
3965
4067
|
headerRows.map((row, rowIndex) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "usx-table__head-row", children: [
|
|
3966
4068
|
hasRowDetails && rowIndex === 0 && /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", rowSpan: totalDepth, className: "usx-table__cell usx-table__cell--detail-toggle", "aria-label": "Row details" }),
|
|
@@ -3968,7 +4070,7 @@
|
|
|
3968
4070
|
row.map(({ col, rowSpan, colSpan }) => {
|
|
3969
4071
|
const isSortable = col.sortable === true;
|
|
3970
4072
|
const sortDir = sortState.key === col.key ? sortState.direction : null;
|
|
3971
|
-
const cellClasses =
|
|
4073
|
+
const cellClasses = ClassNames(
|
|
3972
4074
|
"usx-table__cell",
|
|
3973
4075
|
col.headerAlign && `usx-table__cell--align-${col.headerAlign}`,
|
|
3974
4076
|
!col.headerAlign && col.align && `usx-table__cell--align-${col.align}`,
|
|
@@ -3989,7 +4091,7 @@
|
|
|
3989
4091
|
"button",
|
|
3990
4092
|
{
|
|
3991
4093
|
type: "button",
|
|
3992
|
-
className:
|
|
4094
|
+
className: ClassNames("usx-table__sort-button", sortDir && "usx-table__sort-button--active"),
|
|
3993
4095
|
onClick: () => handleSort(col.key),
|
|
3994
4096
|
children: [
|
|
3995
4097
|
col.header,
|
|
@@ -4012,11 +4114,11 @@
|
|
|
4012
4114
|
className = "",
|
|
4013
4115
|
onClick,
|
|
4014
4116
|
children,
|
|
4015
|
-
...
|
|
4117
|
+
...props2
|
|
4016
4118
|
}) {
|
|
4017
4119
|
const { onClickRow } = useTableContext();
|
|
4018
4120
|
const isClickable = !!(onClick || onClickRow);
|
|
4019
|
-
const classes =
|
|
4121
|
+
const classes = ClassNames(
|
|
4020
4122
|
"usx-table__row",
|
|
4021
4123
|
selected && "usx-table__row--selected",
|
|
4022
4124
|
disabled && "usx-table__row--disabled",
|
|
@@ -4036,7 +4138,7 @@
|
|
|
4036
4138
|
}
|
|
4037
4139
|
}
|
|
4038
4140
|
const interactiveProps = isClickable && !disabled ? { tabIndex: 0, onClick: handleClick, onKeyDown: handleKeyDown } : {};
|
|
4039
|
-
return /* @__PURE__ */ jsxRuntime.jsx("tr", { className: classes, ...interactiveProps, ...
|
|
4141
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tr", { className: classes, ...interactiveProps, ...props2, children });
|
|
4040
4142
|
}
|
|
4041
4143
|
function TableGroup({
|
|
4042
4144
|
label,
|
|
@@ -4046,7 +4148,7 @@
|
|
|
4046
4148
|
colSpan,
|
|
4047
4149
|
className = "",
|
|
4048
4150
|
children,
|
|
4049
|
-
...
|
|
4151
|
+
...props2
|
|
4050
4152
|
}) {
|
|
4051
4153
|
const { toggleGroup, isGroupExpanded, totalCols } = useTableContext();
|
|
4052
4154
|
const isExpanded = expandedProp !== void 0 ? expandedProp : isGroupExpanded(groupKey);
|
|
@@ -4062,7 +4164,7 @@
|
|
|
4062
4164
|
}
|
|
4063
4165
|
};
|
|
4064
4166
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4065
|
-
/* @__PURE__ */ jsxRuntime.jsx("tr", { className:
|
|
4167
|
+
/* @__PURE__ */ jsxRuntime.jsx("tr", { className: ClassNames("usx-table__group-row", className), ...props2, children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: colSpan || totalCols || 1, className: "usx-table__group-cell", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-accordion usa-accordion", children: /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-accordion__heading", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4066
4168
|
"button",
|
|
4067
4169
|
{
|
|
4068
4170
|
type: "button",
|
|
@@ -4165,7 +4267,7 @@
|
|
|
4165
4267
|
"button",
|
|
4166
4268
|
{
|
|
4167
4269
|
type: "button",
|
|
4168
|
-
className:
|
|
4270
|
+
className: ClassNames(
|
|
4169
4271
|
"usa-button usa-button--unstyled",
|
|
4170
4272
|
"usx-table__detail-toggle",
|
|
4171
4273
|
"width-full",
|
|
@@ -4178,7 +4280,7 @@
|
|
|
4178
4280
|
) }, "__detail-toggle__") : null;
|
|
4179
4281
|
const dataCells = visibleCols.map((col) => {
|
|
4180
4282
|
const Tag2 = col.primary ? "th" : "td";
|
|
4181
|
-
const cellClasses =
|
|
4283
|
+
const cellClasses = ClassNames("usx-table__cell", col.align && `usx-table__cell--align-${col.align}`, col.className);
|
|
4182
4284
|
const dataLabel = responsive === "stack" || responsive === "stack-header" ? getDataLabel(col) : void 0;
|
|
4183
4285
|
const content = col.render ? col.render(row, rowIndex) : row[col.key];
|
|
4184
4286
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4203,25 +4305,25 @@
|
|
|
4203
4305
|
hasRowDetails && isExpanded && renderDetail && /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "usx-table__detail-row", children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__detail-cell", colSpan: totalCols, children: renderDetail(row) }) })
|
|
4204
4306
|
] });
|
|
4205
4307
|
}
|
|
4206
|
-
function TableBody({ className = "", children, ...
|
|
4308
|
+
function TableBody({ className = "", children, ...props2 }) {
|
|
4207
4309
|
const { data, primaryKey, groupBy, groups, placeholder, totalCols, onMore, loading } = useTableContext();
|
|
4208
|
-
const bodyClass =
|
|
4310
|
+
const bodyClass = ClassNames("usx-table__body", className);
|
|
4209
4311
|
if (children) {
|
|
4210
|
-
return /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: bodyClass, ...
|
|
4312
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: bodyClass, ...props2, children });
|
|
4211
4313
|
}
|
|
4212
4314
|
const placeholderRow = data.length === 0 && placeholder ? /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "usx-table__placeholder-row", children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__placeholder-cell", colSpan: totalCols, children: placeholder }) }) : null;
|
|
4213
4315
|
const sentinel = onMore ? /* @__PURE__ */ jsxRuntime.jsx(OnMoreSentinel, { onMore }) : null;
|
|
4214
4316
|
const loadingRow = loading ? /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "usx-table__loading-row", "aria-live": "polite", children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__loading-cell", colSpan: totalCols, children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 3, label: "Loading more rows…" }) }) }) : null;
|
|
4215
4317
|
const renderRows = (rows) => rows.map((row, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(DataRow, { row, rowIndex }, row[primaryKey] ?? rowIndex));
|
|
4216
4318
|
if (!groupBy) {
|
|
4217
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("tbody", { className: bodyClass, ...
|
|
4319
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("tbody", { className: bodyClass, ...props2, children: [
|
|
4218
4320
|
placeholderRow,
|
|
4219
4321
|
renderRows(data),
|
|
4220
4322
|
loadingRow,
|
|
4221
4323
|
sentinel
|
|
4222
4324
|
] });
|
|
4223
4325
|
}
|
|
4224
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("tbody", { className: bodyClass, ...
|
|
4326
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("tbody", { className: bodyClass, ...props2, children: [
|
|
4225
4327
|
placeholderRow,
|
|
4226
4328
|
(groups || []).map(({ key, rows }) => /* @__PURE__ */ jsxRuntime.jsx(TableGroup, { groupKey: key, label: key, children: renderRows(rows) }, key)),
|
|
4227
4329
|
loadingRow,
|
|
@@ -4246,15 +4348,15 @@
|
|
|
4246
4348
|
return "--";
|
|
4247
4349
|
}
|
|
4248
4350
|
}
|
|
4249
|
-
function TableFoot({ className = "", children, ...
|
|
4351
|
+
function TableFoot({ className = "", children, ...props2 }) {
|
|
4250
4352
|
const { columns, data, selectionMode, rowDetails } = useTableContext();
|
|
4251
4353
|
if (children) {
|
|
4252
|
-
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className:
|
|
4354
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...props2, children });
|
|
4253
4355
|
}
|
|
4254
4356
|
const visibleCols = columns.filter((c) => !c.hidden);
|
|
4255
4357
|
const hasFooter = visibleCols.some((c) => c.footer !== void 0 || c.aggregate);
|
|
4256
4358
|
if (!hasFooter) return null;
|
|
4257
|
-
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className:
|
|
4359
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "usx-table__foot-row", children: [
|
|
4258
4360
|
!!rowDetails && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__cell" }),
|
|
4259
4361
|
!!selectionMode && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__cell usx-table__cell--selection" }),
|
|
4260
4362
|
visibleCols.map((col) => {
|
|
@@ -4264,7 +4366,7 @@
|
|
|
4264
4366
|
} else if (col.aggregate) {
|
|
4265
4367
|
content = aggregate(data, col.key, col.aggregate);
|
|
4266
4368
|
}
|
|
4267
|
-
return /* @__PURE__ */ jsxRuntime.jsx("td", { className:
|
|
4369
|
+
return /* @__PURE__ */ jsxRuntime.jsx("td", { className: ClassNames("usx-table__cell", col.align && `usx-table__cell--align-${col.align}`), children: content }, col.key);
|
|
4268
4370
|
})
|
|
4269
4371
|
] }) });
|
|
4270
4372
|
}
|
|
@@ -4278,11 +4380,11 @@
|
|
|
4278
4380
|
dataLabel,
|
|
4279
4381
|
className = "",
|
|
4280
4382
|
children,
|
|
4281
|
-
...
|
|
4383
|
+
...props2
|
|
4282
4384
|
}) {
|
|
4283
4385
|
const resolvedAlign = Tag2 === "th" ? headerAlign || align : align;
|
|
4284
|
-
const classes =
|
|
4285
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, colSpan, rowSpan, scope, "data-label": dataLabel, ...
|
|
4386
|
+
const classes = ClassNames("usx-table__cell", resolvedAlign && `usx-table__cell--align-${resolvedAlign}`, className);
|
|
4387
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, colSpan, rowSpan, scope, "data-label": dataLabel, ...props2, children });
|
|
4286
4388
|
}
|
|
4287
4389
|
function defaultCompareFn(a, b, key) {
|
|
4288
4390
|
const va = a[key];
|
|
@@ -4376,11 +4478,11 @@
|
|
|
4376
4478
|
return { selectedKeys, handleSelect, handleSelectAll, isSelected, isAllSelected, isIndeterminate };
|
|
4377
4479
|
}
|
|
4378
4480
|
function useTableGroups({ groupBy, data = [] }) {
|
|
4379
|
-
const
|
|
4380
|
-
const groupByProp = typeof groupBy === "string" ? groupBy :
|
|
4381
|
-
const expandProp =
|
|
4382
|
-
const onExpandProp =
|
|
4383
|
-
const defaultExpanded =
|
|
4481
|
+
const config2 = typeof groupBy === "object" && groupBy !== null ? groupBy : null;
|
|
4482
|
+
const groupByProp = typeof groupBy === "string" ? groupBy : config2 == null ? void 0 : config2.property;
|
|
4483
|
+
const expandProp = config2 == null ? void 0 : config2.expand;
|
|
4484
|
+
const onExpandProp = config2 == null ? void 0 : config2.onExpand;
|
|
4485
|
+
const defaultExpanded = config2 ? config2.defaultExpanded : true;
|
|
4384
4486
|
const isControlled = expandProp !== void 0 && expandProp !== null;
|
|
4385
4487
|
const [internalExpanded, setInternalExpanded] = React.useState(() => {
|
|
4386
4488
|
if (expandProp) return new Set(expandProp.map(String));
|
|
@@ -4422,9 +4524,9 @@
|
|
|
4422
4524
|
return { groups, expandedGroups, toggleGroup, isGroupExpanded };
|
|
4423
4525
|
}
|
|
4424
4526
|
function useRowDetails({ rowDetails }) {
|
|
4425
|
-
const
|
|
4426
|
-
const expandProp =
|
|
4427
|
-
const onExpandProp =
|
|
4527
|
+
const config2 = rowDetails && typeof rowDetails === "object" ? rowDetails : null;
|
|
4528
|
+
const expandProp = config2 == null ? void 0 : config2.expand;
|
|
4529
|
+
const onExpandProp = config2 == null ? void 0 : config2.onExpand;
|
|
4428
4530
|
const isControlled = expandProp !== void 0 && expandProp !== null;
|
|
4429
4531
|
const [internalExpanded, setInternalExpanded] = React.useState(() => new Set(expandProp || []));
|
|
4430
4532
|
const expandedRows = React.useMemo(
|
|
@@ -4453,7 +4555,7 @@
|
|
|
4453
4555
|
}, 0);
|
|
4454
4556
|
}
|
|
4455
4557
|
function Caption({ className = "", children, ...rest }) {
|
|
4456
|
-
return /* @__PURE__ */ jsxRuntime.jsx("caption", { className:
|
|
4558
|
+
return /* @__PURE__ */ jsxRuntime.jsx("caption", { className: ClassNames("usx-table__caption", className), ...rest, children });
|
|
4457
4559
|
}
|
|
4458
4560
|
function Table({
|
|
4459
4561
|
id: idProp,
|
|
@@ -4488,7 +4590,7 @@
|
|
|
4488
4590
|
placeholder,
|
|
4489
4591
|
className = "",
|
|
4490
4592
|
children,
|
|
4491
|
-
...
|
|
4593
|
+
...props2
|
|
4492
4594
|
}) {
|
|
4493
4595
|
const generatedId = React.useId();
|
|
4494
4596
|
const id = idProp ?? `usx-table-${generatedId}`;
|
|
@@ -4593,7 +4695,7 @@
|
|
|
4593
4695
|
loading
|
|
4594
4696
|
]
|
|
4595
4697
|
);
|
|
4596
|
-
const tableClasses =
|
|
4698
|
+
const tableClasses = ClassNames(
|
|
4597
4699
|
"usa-table",
|
|
4598
4700
|
striped && "usa-table--striped",
|
|
4599
4701
|
borderless && "usa-table--borderless",
|
|
@@ -4605,7 +4707,7 @@
|
|
|
4605
4707
|
stickyFirstColumn && "usx-table--sticky-first-col",
|
|
4606
4708
|
className
|
|
4607
4709
|
);
|
|
4608
|
-
const tableEl = /* @__PURE__ */ jsxRuntime.jsxs("table", { id: idProp, className: tableClasses, ...
|
|
4710
|
+
const tableEl = /* @__PURE__ */ jsxRuntime.jsxs("table", { id: idProp, className: tableClasses, ...props2, children: [
|
|
4609
4711
|
caption && /* @__PURE__ */ jsxRuntime.jsx(Caption, { children: caption }),
|
|
4610
4712
|
children || /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4611
4713
|
/* @__PURE__ */ jsxRuntime.jsx(TableHead, {}),
|
|
@@ -4661,17 +4763,17 @@
|
|
|
4661
4763
|
tagProps = null,
|
|
4662
4764
|
children = null,
|
|
4663
4765
|
className = "",
|
|
4664
|
-
...
|
|
4766
|
+
...props2
|
|
4665
4767
|
}) => {
|
|
4666
|
-
const classes =
|
|
4768
|
+
const classes = ClassNames(
|
|
4667
4769
|
"usx-tag-group",
|
|
4668
4770
|
className
|
|
4669
4771
|
);
|
|
4670
4772
|
const content = children ? children : Array.isArray(tagProps) ? tagProps.map((t, i) => /* @__PURE__ */ jsxRuntime.jsx(Tag, { ...t }, t.id || t.value || i)) : null;
|
|
4671
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
4773
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: content });
|
|
4672
4774
|
};
|
|
4673
4775
|
function TaskList({ tasks = [], className }) {
|
|
4674
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className:
|
|
4776
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: ClassNames("usx-task-list", className), children: tasks == null ? void 0 : tasks.map((task, i) => {
|
|
4675
4777
|
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(Clickable, { href: task.href, className: "usx-task-list__item", children: [
|
|
4676
4778
|
task.hint ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "display-flex flex-column", children: [
|
|
4677
4779
|
/* @__PURE__ */ jsxRuntime.jsx(Clickable.Link, { className: "usx-task-list__link", children: task.name }),
|
|
@@ -4703,7 +4805,7 @@
|
|
|
4703
4805
|
onChange == null ? void 0 : onChange(next);
|
|
4704
4806
|
};
|
|
4705
4807
|
const selectId = id || `theme-picker-${Math.random().toString(36).substr(2, 9)}`;
|
|
4706
|
-
const classes =
|
|
4808
|
+
const classes = ClassNames("usx-theme-picker", { "usx-theme-picker--open": open }, className);
|
|
4707
4809
|
const themeOptions = themes.map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: option.value, children: option.label }, option.value));
|
|
4708
4810
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, children: open ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-theme-picker__panel", children: [
|
|
4709
4811
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: selectId, screenReaderOnly: true, children: label }),
|
|
@@ -4762,7 +4864,7 @@
|
|
|
4762
4864
|
step = null,
|
|
4763
4865
|
formGroup = true,
|
|
4764
4866
|
className = "",
|
|
4765
|
-
...
|
|
4867
|
+
...props2
|
|
4766
4868
|
}) {
|
|
4767
4869
|
const labelId = `${id}-label`;
|
|
4768
4870
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
@@ -4775,7 +4877,7 @@
|
|
|
4775
4877
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4776
4878
|
"div",
|
|
4777
4879
|
{
|
|
4778
|
-
className:
|
|
4880
|
+
className: ClassNames(
|
|
4779
4881
|
"usa-time-picker",
|
|
4780
4882
|
"usx-time-picker",
|
|
4781
4883
|
{ "usx-combo-box--error": !!error },
|
|
@@ -4796,7 +4898,7 @@
|
|
|
4796
4898
|
disabled,
|
|
4797
4899
|
"aria-disabled": !disabled && ariaDisabled ? "true" : void 0,
|
|
4798
4900
|
required,
|
|
4799
|
-
...
|
|
4901
|
+
...props2
|
|
4800
4902
|
}
|
|
4801
4903
|
)
|
|
4802
4904
|
}
|
|
@@ -4804,53 +4906,83 @@
|
|
|
4804
4906
|
] });
|
|
4805
4907
|
return formGroup ? /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: content }) : content;
|
|
4806
4908
|
}
|
|
4807
|
-
|
|
4909
|
+
function Toggle({
|
|
4808
4910
|
options = [],
|
|
4809
4911
|
value,
|
|
4810
4912
|
defaultValue,
|
|
4811
4913
|
onChange,
|
|
4812
4914
|
name,
|
|
4813
4915
|
id,
|
|
4916
|
+
ariaLabel,
|
|
4814
4917
|
variant = "text",
|
|
4815
4918
|
disabled = false,
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4837
|
-
"input",
|
|
4838
|
-
{
|
|
4839
|
-
className: "usx-toggle__input",
|
|
4840
|
-
type: "radio",
|
|
4841
|
-
id: inputId,
|
|
4842
|
-
name: name || generatedName,
|
|
4843
|
-
value: optValue,
|
|
4844
|
-
checked: value === optValue ? true : void 0,
|
|
4845
|
-
defaultChecked: defaultValue === optValue ? true : void 0,
|
|
4846
|
-
disabled: disabled ? true : optDisabled ? true : void 0,
|
|
4847
|
-
onChange: onChange ? () => onChange(optValue) : void 0
|
|
4848
|
-
}
|
|
4919
|
+
required = false,
|
|
4920
|
+
className,
|
|
4921
|
+
"aria-label": nativeAriaLabel,
|
|
4922
|
+
"aria-labelledby": labelledBy,
|
|
4923
|
+
...props2
|
|
4924
|
+
}) {
|
|
4925
|
+
const instanceId = React.useId();
|
|
4926
|
+
const groupId = id || `toggle-${instanceId}`;
|
|
4927
|
+
const groupName = name || groupId;
|
|
4928
|
+
const controlled = value !== void 0;
|
|
4929
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4930
|
+
"ul",
|
|
4931
|
+
{
|
|
4932
|
+
...props2,
|
|
4933
|
+
id: groupId,
|
|
4934
|
+
className: ClassNames(
|
|
4935
|
+
"usx-toggle",
|
|
4936
|
+
"usa-button-group",
|
|
4937
|
+
variant === "icon" && "usx-toggle--icon",
|
|
4938
|
+
className
|
|
4849
4939
|
),
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4940
|
+
role: "radiogroup",
|
|
4941
|
+
"aria-labelledby": labelledBy,
|
|
4942
|
+
"aria-label": labelledBy ? void 0 : ariaLabel || nativeAriaLabel || name || "Choose an option",
|
|
4943
|
+
"aria-disabled": disabled || void 0,
|
|
4944
|
+
"aria-required": required || void 0,
|
|
4945
|
+
children: options.map((option, index) => {
|
|
4946
|
+
const opt = typeof option === "object" ? option : { value: option, label: option };
|
|
4947
|
+
const optionValue = opt.value ?? (typeof opt.label === "string" || typeof opt.label === "number" ? opt.label : index);
|
|
4948
|
+
const optionLabel = opt.label ?? String(optionValue);
|
|
4949
|
+
const inputId = `${groupId}-option-${index}`;
|
|
4950
|
+
const iconOnly = variant === "icon" && Boolean(opt.icon);
|
|
4951
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "usa-button-group__item", role: "presentation", children: [
|
|
4952
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4953
|
+
"input",
|
|
4954
|
+
{
|
|
4955
|
+
className: "usx-toggle__input",
|
|
4956
|
+
type: "radio",
|
|
4957
|
+
id: inputId,
|
|
4958
|
+
name: groupName,
|
|
4959
|
+
value: optionValue,
|
|
4960
|
+
...controlled ? { checked: value === optionValue } : { defaultChecked: defaultValue === optionValue },
|
|
4961
|
+
disabled: disabled || opt.disabled,
|
|
4962
|
+
required,
|
|
4963
|
+
onChange: (event) => {
|
|
4964
|
+
if (event.target.checked) onChange == null ? void 0 : onChange(optionValue);
|
|
4965
|
+
}
|
|
4966
|
+
}
|
|
4967
|
+
),
|
|
4968
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4969
|
+
"label",
|
|
4970
|
+
{
|
|
4971
|
+
htmlFor: inputId,
|
|
4972
|
+
className: "usa-button usx-button usa-button--primary usx-toggle__button",
|
|
4973
|
+
"aria-disabled": disabled || opt.disabled || void 0,
|
|
4974
|
+
title: iconOnly && (typeof optionLabel === "string" || typeof optionLabel === "number") ? String(optionLabel) : void 0,
|
|
4975
|
+
children: [
|
|
4976
|
+
opt.icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: opt.icon, className: "usx-toggle__icon", "aria-hidden": "true" }),
|
|
4977
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: iconOnly ? "usa-sr-only" : void 0, children: optionLabel })
|
|
4978
|
+
]
|
|
4979
|
+
}
|
|
4980
|
+
)
|
|
4981
|
+
] }, inputId);
|
|
4982
|
+
})
|
|
4983
|
+
}
|
|
4984
|
+
);
|
|
4985
|
+
}
|
|
4854
4986
|
const Villain = ({
|
|
4855
4987
|
title = "",
|
|
4856
4988
|
callout = "",
|
|
@@ -4858,10 +4990,10 @@
|
|
|
4858
4990
|
button = null,
|
|
4859
4991
|
ariaLabel = "Introduction",
|
|
4860
4992
|
className = "",
|
|
4861
|
-
...
|
|
4993
|
+
...props2
|
|
4862
4994
|
}) => {
|
|
4863
|
-
const classes =
|
|
4864
|
-
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: classes, "aria-label": ariaLabel, ...
|
|
4995
|
+
const classes = ClassNames("usa-hero", className);
|
|
4996
|
+
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: classes, "aria-label": ariaLabel, ...props2, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-container", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-hero__callout", children: [
|
|
4865
4997
|
/* @__PURE__ */ jsxRuntime.jsxs("h1", { className: "usa-hero__heading", children: [
|
|
4866
4998
|
callout && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-hero__heading--alt", children: callout }),
|
|
4867
4999
|
title
|
|
@@ -4877,11 +5009,11 @@
|
|
|
4877
5009
|
exports2.AvatarGroup = AvatarGroup;
|
|
4878
5010
|
exports2.BackToTop = BackToTop;
|
|
4879
5011
|
exports2.Banner = Banner;
|
|
4880
|
-
exports2.Block = Block;
|
|
4881
5012
|
exports2.Breadcrumb = Breadcrumb;
|
|
4882
5013
|
exports2.Button = Button;
|
|
4883
5014
|
exports2.ButtonGroup = ButtonGroup;
|
|
4884
5015
|
exports2.CalendarDate = CalendarDate;
|
|
5016
|
+
exports2.Callout = Callout;
|
|
4885
5017
|
exports2.Card = Card;
|
|
4886
5018
|
exports2.CardGroup = CardGroup;
|
|
4887
5019
|
exports2.Carousel = Carousel;
|
|
@@ -4892,6 +5024,7 @@
|
|
|
4892
5024
|
exports2.Code = Code;
|
|
4893
5025
|
exports2.Collection = Collection;
|
|
4894
5026
|
exports2.Combobox = Combobox;
|
|
5027
|
+
exports2.Container = Container;
|
|
4895
5028
|
exports2.CopyToClipboard = CopyToClipboard;
|
|
4896
5029
|
exports2.DatePicker = DatePicker;
|
|
4897
5030
|
exports2.DateRangePicker = DateRangePicker;
|
|
@@ -4925,6 +5058,7 @@
|
|
|
4925
5058
|
exports2.Pagination = Pagination;
|
|
4926
5059
|
exports2.ProcessList = ProcessList;
|
|
4927
5060
|
exports2.Prose = Prose;
|
|
5061
|
+
exports2.Quote = Quote;
|
|
4928
5062
|
exports2.RadioButtons = RadioButtons;
|
|
4929
5063
|
exports2.RangeSlider = RangeSlider;
|
|
4930
5064
|
exports2.Required = Required;
|