@solexllc/usx-react 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +132 -0
- package/dist/index.cjs +504 -450
- package/dist/index.js +504 -450
- package/package.json +6 -5
- package/src/assets.ts +16 -0
- package/src/components/alert/Alert.tsx +4 -3
- package/src/components/alert/alert.django.html +2 -3
- package/src/components/alert/config.json +15 -4
- package/src/components/attribution/config.json +5 -5
- package/src/components/banner/Banner.tsx +8 -6
- package/src/components/banner/banner.django.html +4 -5
- package/src/components/banner/config.json +7 -3
- package/src/components/breadcrumb/Breadcrumb.tsx +5 -6
- package/src/components/breadcrumb/config.json +11 -1
- package/src/components/button/Button.tsx +1 -1
- package/src/components/button/button.django.html +2 -2
- package/src/components/button/button.html +2 -2
- package/src/components/button/config.json +14 -6
- 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/code/Code.tsx +4 -27
- package/src/components/code/code.django.html +3 -9
- package/src/components/code/config.json +4 -0
- 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/copy-to-clipboard/CopyToClipboard.tsx +35 -24
- package/src/components/copy-to-clipboard/config.json +14 -7
- package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +14 -14
- 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 +31 -11
- package/src/components/footer/config.json +4 -0
- package/src/components/footer/footer.django.html +10 -9
- package/src/components/form-group/config.json +2 -2
- package/src/components/header/Branding.tsx +9 -6
- package/src/components/header/Header.tsx +3 -1
- package/src/components/header/config.json +4 -0
- package/src/components/header/header.django.html +5 -26
- package/src/components/header/header.html +10 -10
- 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/icon/Icon.tsx +6 -3
- package/src/components/icon/config.json +12 -6
- package/src/components/icon/icon.django.html +6 -4
- package/src/components/image/Image.tsx +8 -4
- package/src/components/image/config.json +10 -2
- package/src/components/image/image.django.html +8 -6
- 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/layout/config.json +9 -9
- package/src/components/layout/layout.django.html +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/spinner/Spinner.tsx +18 -25
- package/src/components/spinner/config.json +4 -0
- package/src/components/spinner/spinner.django.html +4 -6
- 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/Tooltip.tsx +4 -2
- package/src/components/tooltip/config.json +9 -4
- package/src/components/tooltip/tooltip.django.html +1 -1
- package/src/components/villain/Villain.tsx +2 -1
- package/src/index.js +2 -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
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
contentClassName = "",
|
|
126
126
|
...props
|
|
127
127
|
}) {
|
|
128
|
-
const accordionClasses =
|
|
128
|
+
const accordionClasses = ClassNames(
|
|
129
129
|
"usa-accordion",
|
|
130
130
|
"usx-accordion",
|
|
131
131
|
bordered && "usa-accordion--bordered",
|
|
@@ -152,6 +152,39 @@
|
|
|
152
152
|
}
|
|
153
153
|
);
|
|
154
154
|
}
|
|
155
|
+
function getAssetUrl(assetPath, staticBaseUrl) {
|
|
156
|
+
if (/^[a-z][a-z\d+.-]*:/i.test(assetPath)) return assetPath;
|
|
157
|
+
const base = staticBaseUrl || typeof window !== "undefined" && window.usxBaseUrl || "/";
|
|
158
|
+
return `${base.replace(/\/+$/, "")}/${assetPath.replace(/^\/+/, "")}`;
|
|
159
|
+
}
|
|
160
|
+
function getAssetSrcSet(srcSet, staticBaseUrl) {
|
|
161
|
+
return srcSet.replace(/(^\s*|,\s*)(\S*[^,\s])(?=,?(?:\s|$))/g, (_match, separator, url) => `${separator}${getAssetUrl(url, staticBaseUrl)}`);
|
|
162
|
+
}
|
|
163
|
+
function Icon({
|
|
164
|
+
name,
|
|
165
|
+
source = "uswds",
|
|
166
|
+
size = 2,
|
|
167
|
+
color,
|
|
168
|
+
alt = name + " icon",
|
|
169
|
+
staticBaseUrl,
|
|
170
|
+
staticUrlPrefix,
|
|
171
|
+
className = "",
|
|
172
|
+
...props
|
|
173
|
+
}) {
|
|
174
|
+
const spritePrefix = staticUrlPrefix ?? getAssetUrl(`img/${source === "usx" ? "usx-sprite.svg" : "sprite.svg"}#`, staticBaseUrl);
|
|
175
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
176
|
+
"svg",
|
|
177
|
+
{
|
|
178
|
+
className: "usa-icon " + (size ? size === 1 ? "usx-icon--size-1" : "usa-icon--size-" + size : "") + " " + (color ? "text-" + color : "") + " " + className,
|
|
179
|
+
"aria-hidden": "true",
|
|
180
|
+
"aria-label": alt,
|
|
181
|
+
focusable: "false",
|
|
182
|
+
role: "img",
|
|
183
|
+
...props,
|
|
184
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: spritePrefix + name })
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
155
188
|
function Alert({
|
|
156
189
|
heading,
|
|
157
190
|
text,
|
|
@@ -163,11 +196,12 @@
|
|
|
163
196
|
ariaLabel,
|
|
164
197
|
ariaLabelledby,
|
|
165
198
|
onDismiss = void 0,
|
|
199
|
+
staticBaseUrl,
|
|
166
200
|
children = null,
|
|
167
201
|
...props
|
|
168
202
|
}) {
|
|
169
203
|
const normalizedVariant = variant && ["info", "warning", "success", "error", "emergency"].includes(variant) ? variant : null;
|
|
170
|
-
const classes =
|
|
204
|
+
const classes = ClassNames(
|
|
171
205
|
"usa-alert",
|
|
172
206
|
"usx-alert",
|
|
173
207
|
normalizedVariant ? `usa-alert--${normalizedVariant}` : "",
|
|
@@ -189,32 +223,9 @@
|
|
|
189
223
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...accessibilityProps, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-alert__body", children: [
|
|
190
224
|
!slim && heading ? /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-alert__heading", children: heading }) : null,
|
|
191
225
|
children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-alert__text", children }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "usa-alert__text", children: text }),
|
|
192
|
-
onDismiss && /* @__PURE__ */ jsxRuntime.jsx("button", { className: "usx-alert__dismiss", "aria-label": "Dismiss alert", onClick: onDismiss, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
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 }) })
|
|
193
227
|
] }) });
|
|
194
228
|
}
|
|
195
|
-
function Icon({
|
|
196
|
-
name,
|
|
197
|
-
source = "uswds",
|
|
198
|
-
size = 2,
|
|
199
|
-
color,
|
|
200
|
-
alt = name + " icon",
|
|
201
|
-
staticUrlPrefix = (typeof window !== "undefined" && window.usxBaseUrl || "/") + "img/" + (source === "usx" ? "usx-sprite.svg" : "sprite.svg") + "#",
|
|
202
|
-
className = "",
|
|
203
|
-
...props
|
|
204
|
-
}) {
|
|
205
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
206
|
-
"svg",
|
|
207
|
-
{
|
|
208
|
-
className: "usa-icon " + (size ? size === 1 ? "usx-icon--size-1" : "usa-icon--size-" + size : "") + " " + (color ? "text-" + color : "") + " " + className,
|
|
209
|
-
"aria-hidden": "true",
|
|
210
|
-
"aria-label": alt,
|
|
211
|
-
focusable: "false",
|
|
212
|
-
role: "img",
|
|
213
|
-
...props,
|
|
214
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: staticUrlPrefix + name })
|
|
215
|
-
}
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
229
|
const shapeClassMap = {
|
|
219
230
|
circle: "usx-circle",
|
|
220
231
|
"rounded-sm": "usx-rounded-sm",
|
|
@@ -237,16 +248,16 @@
|
|
|
237
248
|
}) {
|
|
238
249
|
const isInitialsVariant = variant === "initials";
|
|
239
250
|
const isIconVariant = variant === "icon";
|
|
240
|
-
const wrapperClasses =
|
|
251
|
+
const wrapperClasses = ClassNames(
|
|
241
252
|
"usx-avatar",
|
|
242
253
|
className
|
|
243
254
|
);
|
|
244
|
-
const imgClasses =
|
|
255
|
+
const imgClasses = ClassNames(
|
|
245
256
|
"usx-avatar__img",
|
|
246
257
|
shape ? shapeClassMap[shape] : null,
|
|
247
258
|
imageClassName
|
|
248
259
|
);
|
|
249
|
-
const contentClasses =
|
|
260
|
+
const contentClasses = ClassNames(
|
|
250
261
|
"usx-avatar__content",
|
|
251
262
|
shape ? shapeClassMap[shape] : "usx-circle",
|
|
252
263
|
contentClassName
|
|
@@ -270,7 +281,7 @@
|
|
|
270
281
|
className = "",
|
|
271
282
|
...props
|
|
272
283
|
}) {
|
|
273
|
-
const classes =
|
|
284
|
+
const classes = ClassNames("usx-attribution", className);
|
|
274
285
|
const mediaContent = avatarProps ? /* @__PURE__ */ jsxRuntime.jsx(Avatar, { ...avatarProps }) : media;
|
|
275
286
|
const content = children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
276
287
|
mediaContent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-attribution__media", children: mediaContent }),
|
|
@@ -282,7 +293,7 @@
|
|
|
282
293
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props, children: content });
|
|
283
294
|
}
|
|
284
295
|
function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, className = "", ...props }) {
|
|
285
|
-
const classes =
|
|
296
|
+
const classes = ClassNames(
|
|
286
297
|
"usx-avatar-group",
|
|
287
298
|
overlap && "usa-avatar-group--overlap",
|
|
288
299
|
stacked && "usa-avatar-group--stacked",
|
|
@@ -314,11 +325,11 @@
|
|
|
314
325
|
onClick = void 0,
|
|
315
326
|
...props
|
|
316
327
|
}) {
|
|
317
|
-
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(
|
|
318
329
|
iconPosition === "left" ? "margin-right-05" : "margin-left-05"
|
|
319
330
|
) });
|
|
320
331
|
if (href) {
|
|
321
|
-
const linkClasses =
|
|
332
|
+
const linkClasses = ClassNames(
|
|
322
333
|
"usx-link",
|
|
323
334
|
"usx-no-visited",
|
|
324
335
|
"flex-align-center",
|
|
@@ -330,7 +341,7 @@
|
|
|
330
341
|
iconPosition === "right" && icon
|
|
331
342
|
] });
|
|
332
343
|
}
|
|
333
|
-
const buttonClasses =
|
|
344
|
+
const buttonClasses = ClassNames(
|
|
334
345
|
"usa-button",
|
|
335
346
|
"usx-button",
|
|
336
347
|
variant === "primary" && "usa-button--primary",
|
|
@@ -355,7 +366,8 @@
|
|
|
355
366
|
function Banner({
|
|
356
367
|
id = "gov-banner",
|
|
357
368
|
ariaLabel = "Official government website",
|
|
358
|
-
flagSrc
|
|
369
|
+
flagSrc,
|
|
370
|
+
staticBaseUrl,
|
|
359
371
|
tld = ".gov",
|
|
360
372
|
bannerText = "An official website of the United States government",
|
|
361
373
|
bannerActionText = "Here's how you know",
|
|
@@ -366,7 +378,7 @@
|
|
|
366
378
|
"A ",
|
|
367
379
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "lock" }),
|
|
368
380
|
" (",
|
|
369
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "lock", size: 1 }),
|
|
381
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "lock", size: 1, staticBaseUrl }),
|
|
370
382
|
") or ",
|
|
371
383
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "https://" }),
|
|
372
384
|
" means you’ve safely connected to the ",
|
|
@@ -376,8 +388,7 @@
|
|
|
376
388
|
className = "",
|
|
377
389
|
...props
|
|
378
390
|
}) {
|
|
379
|
-
const
|
|
380
|
-
const classes = classNames(
|
|
391
|
+
const classes = ClassNames(
|
|
381
392
|
"usa-banner",
|
|
382
393
|
"usx-banner",
|
|
383
394
|
className
|
|
@@ -389,7 +400,7 @@
|
|
|
389
400
|
{
|
|
390
401
|
"aria-hidden": "true",
|
|
391
402
|
className: "usa-banner__header-flag",
|
|
392
|
-
src: flagSrc,
|
|
403
|
+
src: getAssetUrl(flagSrc ?? "img/us_flag_small.png", staticBaseUrl),
|
|
393
404
|
alt: ""
|
|
394
405
|
}
|
|
395
406
|
) }),
|
|
@@ -427,7 +438,7 @@
|
|
|
427
438
|
"img",
|
|
428
439
|
{
|
|
429
440
|
className: "usa-banner__icon usa-media-block__img",
|
|
430
|
-
src:
|
|
441
|
+
src: getAssetUrl("img/icon-dot-gov.svg", staticBaseUrl),
|
|
431
442
|
role: "img",
|
|
432
443
|
alt: "",
|
|
433
444
|
"aria-hidden": "true"
|
|
@@ -444,7 +455,7 @@
|
|
|
444
455
|
"img",
|
|
445
456
|
{
|
|
446
457
|
className: "usa-banner__icon usa-media-block__img",
|
|
447
|
-
src:
|
|
458
|
+
src: getAssetUrl("img/icon-https.svg", staticBaseUrl),
|
|
448
459
|
role: "img",
|
|
449
460
|
alt: "",
|
|
450
461
|
"aria-hidden": "true"
|
|
@@ -461,50 +472,6 @@
|
|
|
461
472
|
)
|
|
462
473
|
] }) });
|
|
463
474
|
}
|
|
464
|
-
function Block({
|
|
465
|
-
variant = null,
|
|
466
|
-
indent = null,
|
|
467
|
-
dedent = false,
|
|
468
|
-
big = false,
|
|
469
|
-
quote = false,
|
|
470
|
-
color,
|
|
471
|
-
contentClassName = "",
|
|
472
|
-
attribution = null,
|
|
473
|
-
children = null,
|
|
474
|
-
className = "",
|
|
475
|
-
...props
|
|
476
|
-
}) {
|
|
477
|
-
const isCallout = variant === "callout";
|
|
478
|
-
const classes = classNames(
|
|
479
|
-
"usx-block",
|
|
480
|
-
variant && `usx-block--${variant}`,
|
|
481
|
-
dedent && "usx-block--dedent",
|
|
482
|
-
indent && `usx-block--indent-${indent}`,
|
|
483
|
-
big && "usx-block--big",
|
|
484
|
-
quote && !isCallout && "display-flex flex-row",
|
|
485
|
-
isCallout && color && `usx-border-${color}`,
|
|
486
|
-
className
|
|
487
|
-
);
|
|
488
|
-
const contentClasses = classNames(
|
|
489
|
-
"usx-block__content",
|
|
490
|
-
!isCallout && color && `usx-border-${color}`,
|
|
491
|
-
contentClassName
|
|
492
|
-
);
|
|
493
|
-
const attributionNode = attribution ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-block__attribution", children: /* @__PURE__ */ jsxRuntime.jsx(Attribution, { ...attribution }) }) : null;
|
|
494
|
-
if (quote && !isCallout) {
|
|
495
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props, children: [
|
|
496
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "format_quote", size: 4, className: "usx-block__open-quote-icon" }),
|
|
497
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: contentClasses, children: [
|
|
498
|
-
children,
|
|
499
|
-
attributionNode
|
|
500
|
-
] })
|
|
501
|
-
] });
|
|
502
|
-
}
|
|
503
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props, children: [
|
|
504
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: contentClasses, children }),
|
|
505
|
-
attributionNode
|
|
506
|
-
] });
|
|
507
|
-
}
|
|
508
475
|
function Breadcrumb({
|
|
509
476
|
items = null,
|
|
510
477
|
wrap = false,
|
|
@@ -516,16 +483,16 @@
|
|
|
516
483
|
...props
|
|
517
484
|
}) {
|
|
518
485
|
if (!items || items.length === 0) {
|
|
519
|
-
const classes =
|
|
486
|
+
const classes = ClassNames("usx-breadcrumb", className);
|
|
520
487
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props, children: children || "Breadcrumb" });
|
|
521
488
|
}
|
|
522
|
-
const navClasses =
|
|
489
|
+
const navClasses = ClassNames(
|
|
523
490
|
"usa-breadcrumb",
|
|
524
491
|
"usx-breadcrumb",
|
|
525
492
|
wrap ? "usa-breadcrumb--wrap" : null,
|
|
526
493
|
truncate ? "usa-breadcrumb--truncate" : null,
|
|
527
494
|
className
|
|
528
|
-
|
|
495
|
+
);
|
|
529
496
|
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: navClasses, "aria-label": ariaLabel, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
530
497
|
"ol",
|
|
531
498
|
{
|
|
@@ -533,7 +500,7 @@
|
|
|
533
500
|
...rdfa ? { vocab: "http://schema.org/", typeof: "BreadcrumbList" } : {},
|
|
534
501
|
children: items.map((item, idx) => {
|
|
535
502
|
const isCurrent = !!item.current;
|
|
536
|
-
const liClass =
|
|
503
|
+
const liClass = ClassNames("usa-breadcrumb__list-item", isCurrent ? "usa-current" : null);
|
|
537
504
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
538
505
|
"li",
|
|
539
506
|
{
|
|
@@ -559,33 +526,71 @@
|
|
|
559
526
|
}
|
|
560
527
|
) });
|
|
561
528
|
}
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
529
|
+
const Required = ({
|
|
530
|
+
title = "Required",
|
|
531
|
+
children = null,
|
|
532
|
+
className = "",
|
|
533
|
+
...props
|
|
534
|
+
}) => {
|
|
535
|
+
const classes = ClassNames("usx-required", className);
|
|
536
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
537
|
+
/* @__PURE__ */ jsxRuntime.jsx("abbr", { title, className: classes, ...props, children: "*" }),
|
|
538
|
+
" ",
|
|
539
|
+
children ? children : ""
|
|
540
|
+
] });
|
|
567
541
|
};
|
|
542
|
+
function Label({
|
|
543
|
+
htmlFor,
|
|
544
|
+
required = false,
|
|
545
|
+
error = false,
|
|
546
|
+
children = null,
|
|
547
|
+
screenReaderOnly = false,
|
|
548
|
+
className = "",
|
|
549
|
+
classOverride = false,
|
|
550
|
+
...props
|
|
551
|
+
}) {
|
|
552
|
+
const classes = ClassNames(
|
|
553
|
+
"usa-label",
|
|
554
|
+
"usx-label",
|
|
555
|
+
{ "usa-sr-only": screenReaderOnly, "usa-label--error": !!error },
|
|
556
|
+
className
|
|
557
|
+
);
|
|
558
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
559
|
+
"label",
|
|
560
|
+
{
|
|
561
|
+
className: classOverride ? className : classes,
|
|
562
|
+
...htmlFor ? { htmlFor } : {},
|
|
563
|
+
...props,
|
|
564
|
+
children: [
|
|
565
|
+
required && /* @__PURE__ */ jsxRuntime.jsx(Required, {}),
|
|
566
|
+
children
|
|
567
|
+
]
|
|
568
|
+
}
|
|
569
|
+
);
|
|
570
|
+
}
|
|
568
571
|
const Spinner = ({
|
|
569
572
|
size = 3,
|
|
570
|
-
color
|
|
573
|
+
color,
|
|
571
574
|
label = null,
|
|
572
575
|
screenReaderLabel = null,
|
|
573
|
-
staticUrlPrefix
|
|
576
|
+
staticUrlPrefix,
|
|
577
|
+
staticBaseUrl,
|
|
574
578
|
className = "",
|
|
575
579
|
...props
|
|
576
580
|
}) => {
|
|
577
581
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { role: "status", "aria-live": "polite", className: `usx-spinner ${className}`, ...props, children: [
|
|
578
582
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
579
|
-
|
|
583
|
+
Icon,
|
|
580
584
|
{
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
+
name: "spinner",
|
|
586
|
+
source: "usx",
|
|
587
|
+
size,
|
|
588
|
+
color,
|
|
589
|
+
staticBaseUrl
|
|
585
590
|
}
|
|
586
591
|
),
|
|
587
|
-
screenReaderLabel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
588
|
-
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
592
|
+
screenReaderLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { screenReaderOnly: true, children: screenReaderLabel }),
|
|
593
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(Label, { children: label })
|
|
589
594
|
] });
|
|
590
595
|
};
|
|
591
596
|
function Button({
|
|
@@ -622,10 +627,10 @@
|
|
|
622
627
|
outline: "usa-button--outline",
|
|
623
628
|
unstyled: "usa-button--unstyled"
|
|
624
629
|
};
|
|
625
|
-
const classes =
|
|
630
|
+
const classes = ClassNames(
|
|
626
631
|
"usa-button",
|
|
627
632
|
"usx-button",
|
|
628
|
-
variant
|
|
633
|
+
variant && variantClasses[variant],
|
|
629
634
|
big && "usa-button--big",
|
|
630
635
|
inverse && "usa-button--inverse",
|
|
631
636
|
ghost && "usx-button--ghost",
|
|
@@ -681,12 +686,12 @@
|
|
|
681
686
|
className = "",
|
|
682
687
|
...props
|
|
683
688
|
}) {
|
|
684
|
-
const classes =
|
|
689
|
+
const classes = ClassNames(
|
|
685
690
|
"usa-button-group usx-button-group",
|
|
686
691
|
segmented && "usa-button-group--segmented",
|
|
687
692
|
className
|
|
688
693
|
);
|
|
689
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props, children: buttonProps.map(({ itemClassName, ...item }, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { className:
|
|
694
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props, 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)) });
|
|
690
695
|
}
|
|
691
696
|
function CalendarDate({
|
|
692
697
|
datetime,
|
|
@@ -695,15 +700,15 @@
|
|
|
695
700
|
const date = new Date(datetime);
|
|
696
701
|
const month = date.toLocaleString("en-US", { month: "short", timeZone: "UTC" }).toUpperCase();
|
|
697
702
|
const day = date.toLocaleString("en-US", { day: "numeric", timeZone: "UTC" });
|
|
698
|
-
const dateClasses =
|
|
703
|
+
const dateClasses = ClassNames(
|
|
699
704
|
{ "usa-collection__calendar-date": underCollection },
|
|
700
705
|
"usx-calendar-date"
|
|
701
706
|
);
|
|
702
|
-
const monthClasses =
|
|
707
|
+
const monthClasses = ClassNames(
|
|
703
708
|
{ "usa-collection__calendar-date-month": underCollection },
|
|
704
709
|
"usx-calendar-date-month"
|
|
705
710
|
);
|
|
706
|
-
const dayClasses =
|
|
711
|
+
const dayClasses = ClassNames(
|
|
707
712
|
{ "usa-collection__calendar-date-day": underCollection },
|
|
708
713
|
"usx-calendar-date-day"
|
|
709
714
|
);
|
|
@@ -712,6 +717,40 @@
|
|
|
712
717
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: dayClasses, children: day })
|
|
713
718
|
] }) });
|
|
714
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
|
+
...props
|
|
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 && `usx-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
|
+
...props,
|
|
750
|
+
children: children ?? content
|
|
751
|
+
}
|
|
752
|
+
);
|
|
753
|
+
}
|
|
715
754
|
const Tag = ({
|
|
716
755
|
id,
|
|
717
756
|
big = false,
|
|
@@ -728,7 +767,7 @@
|
|
|
728
767
|
...props
|
|
729
768
|
}) => {
|
|
730
769
|
const [isVisible, setIsVisible] = React.useState(!isDismissed);
|
|
731
|
-
const classes =
|
|
770
|
+
const classes = ClassNames(
|
|
732
771
|
"usa-tag",
|
|
733
772
|
"usx-tag",
|
|
734
773
|
{ "usa-tag--big": big },
|
|
@@ -774,10 +813,12 @@
|
|
|
774
813
|
objectFit = "",
|
|
775
814
|
maxWidth,
|
|
776
815
|
maxHeight,
|
|
816
|
+
staticBaseUrl,
|
|
817
|
+
srcSet,
|
|
777
818
|
className = "",
|
|
778
819
|
...props
|
|
779
820
|
}) {
|
|
780
|
-
const classes =
|
|
821
|
+
const classes = ClassNames(
|
|
781
822
|
"usx-image",
|
|
782
823
|
{
|
|
783
824
|
"usx-image--rounded": rounded,
|
|
@@ -791,7 +832,7 @@
|
|
|
791
832
|
if (maxHeight) style.maxHeight = maxHeight;
|
|
792
833
|
if (maxHeight && !maxWidth) style.width = "auto";
|
|
793
834
|
if (maxWidth && !maxHeight) style.height = "auto";
|
|
794
|
-
const captionClasses =
|
|
835
|
+
const captionClasses = ClassNames(
|
|
795
836
|
"usx-image--caption",
|
|
796
837
|
{ "usa-sr-only": hideCaption }
|
|
797
838
|
);
|
|
@@ -801,14 +842,14 @@
|
|
|
801
842
|
"source",
|
|
802
843
|
{
|
|
803
844
|
...source.media ? { media: source.media } : {},
|
|
804
|
-
srcSet: source.srcSet,
|
|
845
|
+
srcSet: getAssetSrcSet(source.srcSet, staticBaseUrl),
|
|
805
846
|
...source.type ? { type: source.type } : {},
|
|
806
847
|
...source.sizes ? { sizes: source.sizes } : {}
|
|
807
848
|
},
|
|
808
849
|
i
|
|
809
850
|
)),
|
|
810
|
-
/* @__PURE__ */ jsxRuntime.jsx("img", { src: src.fallback, alt, style, ...props })
|
|
811
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt, style, ...props });
|
|
851
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src.fallback, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props })
|
|
852
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props });
|
|
812
853
|
if (caption) {
|
|
813
854
|
return /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: classes, style, children: [
|
|
814
855
|
imgElement,
|
|
@@ -836,7 +877,7 @@
|
|
|
836
877
|
children = null,
|
|
837
878
|
...rest
|
|
838
879
|
}) {
|
|
839
|
-
const cls =
|
|
880
|
+
const cls = ClassNames("usx-carousel__slide", className);
|
|
840
881
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
841
882
|
"section",
|
|
842
883
|
{
|
|
@@ -861,7 +902,8 @@
|
|
|
861
902
|
slideIds = [],
|
|
862
903
|
...props
|
|
863
904
|
}) {
|
|
864
|
-
|
|
905
|
+
var _a;
|
|
906
|
+
const classes = ClassNames("usx-carousel", className);
|
|
865
907
|
const childArray = React.Children.toArray(children).filter(Boolean);
|
|
866
908
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props, role: "region", "aria-roledescription": "carousel", "aria-label": ariaLabel, children: [
|
|
867
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(
|
|
@@ -876,7 +918,7 @@
|
|
|
876
918
|
i
|
|
877
919
|
)) : /* @__PURE__ */ jsxRuntime.jsx("p", { children: /* @__PURE__ */ jsxRuntime.jsx("em", { children: "No slides available." }) }) }) }),
|
|
878
920
|
showDots && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-carousel__dots", "aria-label": "Slide navigation", children: [
|
|
879
|
-
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)),
|
|
880
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))
|
|
881
923
|
] })
|
|
882
924
|
] });
|
|
@@ -884,9 +926,9 @@
|
|
|
884
926
|
function Card({
|
|
885
927
|
title,
|
|
886
928
|
description,
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
929
|
+
tagProps,
|
|
930
|
+
buttonProps,
|
|
931
|
+
imageProps,
|
|
890
932
|
headerFirst = false,
|
|
891
933
|
flag = false,
|
|
892
934
|
mediaRight = false,
|
|
@@ -898,7 +940,7 @@
|
|
|
898
940
|
tag: RootTag = "div",
|
|
899
941
|
...props
|
|
900
942
|
}) {
|
|
901
|
-
const cardClasses =
|
|
943
|
+
const cardClasses = ClassNames(
|
|
902
944
|
"usa-card",
|
|
903
945
|
"usx-card",
|
|
904
946
|
{
|
|
@@ -908,95 +950,53 @@
|
|
|
908
950
|
},
|
|
909
951
|
className
|
|
910
952
|
);
|
|
911
|
-
const mediaClasses =
|
|
953
|
+
const mediaClasses = ClassNames(
|
|
912
954
|
"usa-card__media",
|
|
913
955
|
{
|
|
914
956
|
"usa-card__media--inset": mediaInset,
|
|
915
957
|
"usa-card__media--exdent": mediaExdent
|
|
916
958
|
}
|
|
917
959
|
);
|
|
918
|
-
const hasStructuredContent = title || description ||
|
|
960
|
+
const hasStructuredContent = title || description || tagProps || buttonProps || imageProps;
|
|
919
961
|
const shouldRenderStructured = hasStructuredContent && !children;
|
|
920
|
-
const hasImages =
|
|
921
|
-
const useCarousel =
|
|
962
|
+
const hasImages = imageProps && imageProps.length > 0;
|
|
963
|
+
const useCarousel = imageProps && imageProps.length > 1;
|
|
922
964
|
const media = useCarousel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
923
965
|
Carousel,
|
|
924
966
|
{
|
|
925
967
|
id: `${props.id || "card"}-carousel`,
|
|
926
968
|
showDots: showCarouselDots,
|
|
927
969
|
className: "usx-card__carousel",
|
|
928
|
-
slides:
|
|
929
|
-
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)
|
|
930
972
|
}))
|
|
931
973
|
}
|
|
932
|
-
) : hasImages ? /* @__PURE__ */ jsxRuntime.jsx(Image, { ...
|
|
974
|
+
) : hasImages ? /* @__PURE__ */ jsxRuntime.jsx(Image, { hideCaption: true, ...imageProps[0], className: ClassNames("usa-card__img", imageProps[0].className) }) : null;
|
|
933
975
|
return /* @__PURE__ */ jsxRuntime.jsx(RootTag, { className: cardClasses, ...props, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-card__container", children: shouldRenderStructured ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
934
976
|
title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-card__header", children: /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-card__heading", children: title }) }),
|
|
935
977
|
media && /* @__PURE__ */ jsxRuntime.jsx("div", { className: mediaClasses, children: media }),
|
|
936
978
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-card__body", children: [
|
|
937
|
-
|
|
979
|
+
tagProps && tagProps.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-tag-group", children: tagProps.map((tag, index) => /* @__PURE__ */ jsxRuntime.jsx(Tag, { ...tag }, index)) }),
|
|
938
980
|
description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { children: description }) : description)
|
|
939
981
|
] }),
|
|
940
|
-
|
|
982
|
+
buttonProps && buttonProps.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-card__footer", children: /* @__PURE__ */ jsxRuntime.jsx(ButtonGroup, { buttonProps, className: "flex-wrap" }) })
|
|
941
983
|
] }) : children || "Card" }) });
|
|
942
984
|
}
|
|
943
985
|
function CardGroup({ cardProps = [], className = "", ...props }) {
|
|
944
|
-
const classes =
|
|
986
|
+
const classes = ClassNames(
|
|
945
987
|
"usa-card-group",
|
|
946
988
|
"usx-card-group",
|
|
947
989
|
className
|
|
948
990
|
);
|
|
949
991
|
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props, children: cardProps.map((card, index) => /* @__PURE__ */ jsxRuntime.jsx(Card, { ...card, tag: "li" }, index)) });
|
|
950
992
|
}
|
|
951
|
-
const Required = ({
|
|
952
|
-
title = "Required",
|
|
953
|
-
children = null,
|
|
954
|
-
className = "",
|
|
955
|
-
...props
|
|
956
|
-
}) => {
|
|
957
|
-
const classes = classNames("usx-required", className);
|
|
958
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
959
|
-
/* @__PURE__ */ jsxRuntime.jsx("abbr", { title, className: classes, ...props, children: "*" }),
|
|
960
|
-
" ",
|
|
961
|
-
children ? children : ""
|
|
962
|
-
] });
|
|
963
|
-
};
|
|
964
|
-
function Label({
|
|
965
|
-
htmlFor,
|
|
966
|
-
required = false,
|
|
967
|
-
error = false,
|
|
968
|
-
children = null,
|
|
969
|
-
screenReaderOnly = false,
|
|
970
|
-
className = "",
|
|
971
|
-
classOverride = false,
|
|
972
|
-
...props
|
|
973
|
-
}) {
|
|
974
|
-
const classes = classNames(
|
|
975
|
-
"usa-label",
|
|
976
|
-
"usx-label",
|
|
977
|
-
{ "usa-sr-only": screenReaderOnly, "usa-label--error": !!error },
|
|
978
|
-
className
|
|
979
|
-
);
|
|
980
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
981
|
-
"label",
|
|
982
|
-
{
|
|
983
|
-
className: classOverride ? className : classes,
|
|
984
|
-
...htmlFor ? { htmlFor } : {},
|
|
985
|
-
...props,
|
|
986
|
-
children: [
|
|
987
|
-
required && /* @__PURE__ */ jsxRuntime.jsx(Required, {}),
|
|
988
|
-
children
|
|
989
|
-
]
|
|
990
|
-
}
|
|
991
|
-
);
|
|
992
|
-
}
|
|
993
993
|
function Hint({
|
|
994
994
|
id,
|
|
995
995
|
children = null,
|
|
996
996
|
className = "",
|
|
997
997
|
...props
|
|
998
998
|
}) {
|
|
999
|
-
const classes =
|
|
999
|
+
const classes = ClassNames("usa-hint", "usx-hint", className);
|
|
1000
1000
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...id ? { id } : {}, ...props, children });
|
|
1001
1001
|
}
|
|
1002
1002
|
function ErrorMessage({
|
|
@@ -1005,11 +1005,11 @@
|
|
|
1005
1005
|
className = "",
|
|
1006
1006
|
...props
|
|
1007
1007
|
}) {
|
|
1008
|
-
const classes =
|
|
1008
|
+
const classes = ClassNames("usa-error-message", "usx-error-message", className);
|
|
1009
1009
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, role: "alert", ...id ? { id } : {}, ...props, children });
|
|
1010
1010
|
}
|
|
1011
1011
|
function FormGroup({ children = null, className = "", error = false, ...props }) {
|
|
1012
|
-
const classes =
|
|
1012
|
+
const classes = ClassNames(
|
|
1013
1013
|
"usa-form-group",
|
|
1014
1014
|
"usx-form-group",
|
|
1015
1015
|
{
|
|
@@ -1040,7 +1040,7 @@
|
|
|
1040
1040
|
const inputClasses = "usa-input usx-input";
|
|
1041
1041
|
const inputErrorClasses = "usa-input--error";
|
|
1042
1042
|
const inputSuccessClasses = "usa-input--success";
|
|
1043
|
-
const combinedInputClasses =
|
|
1043
|
+
const combinedInputClasses = ClassNames(
|
|
1044
1044
|
inputClasses,
|
|
1045
1045
|
hasError ? inputErrorClasses : hasSuccess ? inputSuccessClasses : null,
|
|
1046
1046
|
className
|
|
@@ -1084,7 +1084,7 @@
|
|
|
1084
1084
|
const textAreaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;
|
|
1085
1085
|
const hasError = !!error;
|
|
1086
1086
|
const hasSuccess = !!success;
|
|
1087
|
-
const classes =
|
|
1087
|
+
const classes = ClassNames(
|
|
1088
1088
|
"usa-textarea",
|
|
1089
1089
|
"usx-textarea",
|
|
1090
1090
|
hasError ? "usa-input--error" : hasSuccess ? "usa-input--success" : null,
|
|
@@ -1135,7 +1135,7 @@
|
|
|
1135
1135
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
1136
1136
|
const errorId = error ? `${fieldId}-error` : void 0;
|
|
1137
1137
|
const successId = !error && success ? `${fieldId}-success` : void 0;
|
|
1138
|
-
const outerClasses =
|
|
1138
|
+
const outerClasses = ClassNames("usa-character-count", "usx-character-count", className);
|
|
1139
1139
|
const fieldProps = {
|
|
1140
1140
|
id: fieldId,
|
|
1141
1141
|
label,
|
|
@@ -1181,13 +1181,13 @@
|
|
|
1181
1181
|
}) {
|
|
1182
1182
|
const hasError = !!error;
|
|
1183
1183
|
const hasSuccess = !!success;
|
|
1184
|
-
const divClasses =
|
|
1184
|
+
const divClasses = ClassNames(
|
|
1185
1185
|
"usa-checkbox",
|
|
1186
1186
|
"usx-checkbox",
|
|
1187
1187
|
{ "usx-checkbox--small": small },
|
|
1188
1188
|
className
|
|
1189
1189
|
);
|
|
1190
|
-
const inputClasses =
|
|
1190
|
+
const inputClasses = ClassNames(
|
|
1191
1191
|
"usa-checkbox__input",
|
|
1192
1192
|
{ "usa-checkbox__input--tile": tile }
|
|
1193
1193
|
);
|
|
@@ -1224,7 +1224,7 @@
|
|
|
1224
1224
|
className = "",
|
|
1225
1225
|
...props
|
|
1226
1226
|
}) {
|
|
1227
|
-
const classes =
|
|
1227
|
+
const classes = ClassNames(
|
|
1228
1228
|
"usa-legend",
|
|
1229
1229
|
"usx-legend",
|
|
1230
1230
|
{ "usa-legend--large": large },
|
|
@@ -1248,7 +1248,7 @@
|
|
|
1248
1248
|
className = "",
|
|
1249
1249
|
...props
|
|
1250
1250
|
}) {
|
|
1251
|
-
const classes =
|
|
1251
|
+
const classes = ClassNames(
|
|
1252
1252
|
"usa-fieldset",
|
|
1253
1253
|
"usx-fieldset",
|
|
1254
1254
|
className
|
|
@@ -1276,25 +1276,22 @@
|
|
|
1276
1276
|
hint = null,
|
|
1277
1277
|
error = null,
|
|
1278
1278
|
name = "checkbox-group",
|
|
1279
|
-
|
|
1279
|
+
id: groupId,
|
|
1280
|
+
checkboxProps = [],
|
|
1280
1281
|
className = "",
|
|
1281
1282
|
...props
|
|
1282
1283
|
}) => {
|
|
1283
|
-
const classes =
|
|
1284
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsxRuntime.jsx(Fieldset, { legend, required, hint, error, className: classes, ...props, children:
|
|
1285
|
-
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, ...props, children: checkboxProps.map((opt, idx) => {
|
|
1286
|
+
const id = opt.id || `${groupId || name}-${idx}`;
|
|
1286
1287
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1287
1288
|
Checkbox,
|
|
1288
1289
|
{
|
|
1289
|
-
id,
|
|
1290
1290
|
name,
|
|
1291
|
-
value: opt.value,
|
|
1292
|
-
label: opt.label,
|
|
1293
|
-
description: opt.description,
|
|
1294
|
-
checked: !!opt.checked,
|
|
1295
|
-
disabled: !!opt.disabled,
|
|
1296
1291
|
tile,
|
|
1297
|
-
small
|
|
1292
|
+
small,
|
|
1293
|
+
...opt,
|
|
1294
|
+
id
|
|
1298
1295
|
},
|
|
1299
1296
|
id
|
|
1300
1297
|
);
|
|
@@ -1308,7 +1305,7 @@
|
|
|
1308
1305
|
bgColorChange = false,
|
|
1309
1306
|
...rest
|
|
1310
1307
|
}) {
|
|
1311
|
-
const classes =
|
|
1308
|
+
const classes = ClassNames(
|
|
1312
1309
|
"usx-clickable__link",
|
|
1313
1310
|
colorChange && "usx-clickable__color-on-hover",
|
|
1314
1311
|
bgColorChange && "usx-clickable__bg-color-on-hover",
|
|
@@ -1317,13 +1314,13 @@
|
|
|
1317
1314
|
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, ...rest, children });
|
|
1318
1315
|
}
|
|
1319
1316
|
function ClickableColorChange({ children, className, as: Tag2 = "span", ...rest }) {
|
|
1320
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className:
|
|
1317
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: ClassNames("usx-clickable__color-on-hover", className), ...rest, children });
|
|
1321
1318
|
}
|
|
1322
1319
|
function ClickableBgColorChange({ children, className, as: Tag2 = "span", ...rest }) {
|
|
1323
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className:
|
|
1320
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: ClassNames("usx-clickable__bg-color-on-hover", className), ...rest, children });
|
|
1324
1321
|
}
|
|
1325
1322
|
function Clickable({ className, children, ...rest }) {
|
|
1326
|
-
const classes =
|
|
1323
|
+
const classes = ClassNames("usx-clickable", className);
|
|
1327
1324
|
if ("href" in rest && rest.href !== void 0) {
|
|
1328
1325
|
return /* @__PURE__ */ jsxRuntime.jsx("a", { className: classes, ...rest, children });
|
|
1329
1326
|
}
|
|
@@ -1332,25 +1329,70 @@
|
|
|
1332
1329
|
Clickable.Link = ClickableLink;
|
|
1333
1330
|
Clickable.ColorChange = ClickableColorChange;
|
|
1334
1331
|
Clickable.BgColorChange = ClickableBgColorChange;
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1332
|
+
const Tooltip = ({
|
|
1333
|
+
label,
|
|
1334
|
+
position = "top",
|
|
1335
|
+
children,
|
|
1336
|
+
className = "",
|
|
1337
|
+
bodyClassName = "",
|
|
1338
|
+
...props
|
|
1339
|
+
}) => {
|
|
1340
|
+
const validPositions = ["top", "bottom", "left", "right"];
|
|
1341
|
+
const normalizedPosition = validPositions.includes(position) ? position : "top";
|
|
1342
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: ClassNames("usx-tooltip", className), ...props, children: [
|
|
1343
|
+
children,
|
|
1344
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1345
|
+
"span",
|
|
1346
|
+
{
|
|
1347
|
+
className: ClassNames("usa-tooltip__body", `usa-tooltip__body--${normalizedPosition}`, bodyClassName),
|
|
1348
|
+
role: "tooltip",
|
|
1349
|
+
children: label
|
|
1350
|
+
}
|
|
1351
|
+
)
|
|
1352
|
+
] });
|
|
1353
|
+
};
|
|
1354
|
+
function copyTextToClipboard(text) {
|
|
1355
|
+
if (window.navigator.clipboard) {
|
|
1356
|
+
return window.navigator.clipboard.writeText(text);
|
|
1350
1357
|
}
|
|
1351
1358
|
}
|
|
1352
|
-
function
|
|
1353
|
-
|
|
1359
|
+
function CopyToClipboard({
|
|
1360
|
+
copyText = "",
|
|
1361
|
+
label = null,
|
|
1362
|
+
tooltipProps,
|
|
1363
|
+
staticBaseUrl,
|
|
1364
|
+
className = ""
|
|
1365
|
+
}) {
|
|
1366
|
+
const button = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1367
|
+
Button,
|
|
1368
|
+
{
|
|
1369
|
+
ghost: true,
|
|
1370
|
+
className: ClassNames("usx-copy", className),
|
|
1371
|
+
onClick: () => copyTextToClipboard(copyText),
|
|
1372
|
+
type: "button",
|
|
1373
|
+
children: [
|
|
1374
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "content_copy", size: 0, className: "usx-copy__copy", staticBaseUrl }),
|
|
1375
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "check", size: 0, className: "usx-copy__check", staticBaseUrl }),
|
|
1376
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "margin-left-1", children: label })
|
|
1377
|
+
]
|
|
1378
|
+
}
|
|
1379
|
+
);
|
|
1380
|
+
if (!tooltipProps) return button;
|
|
1381
|
+
const { label: tooltipLabel, copiedTooltip = "Copied", ...tooltipOptions } = tooltipProps;
|
|
1382
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1383
|
+
Tooltip,
|
|
1384
|
+
{
|
|
1385
|
+
...tooltipOptions,
|
|
1386
|
+
label: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1387
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-copy__tooltip--copy", children: tooltipLabel }),
|
|
1388
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-copy__tooltip--copied", children: copiedTooltip })
|
|
1389
|
+
] }),
|
|
1390
|
+
children: button
|
|
1391
|
+
}
|
|
1392
|
+
);
|
|
1393
|
+
}
|
|
1394
|
+
function Code({ lines = [], allowHtml = false, copyText = null, staticBaseUrl, className = "" }) {
|
|
1395
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usx-mockup-code", className), children: [
|
|
1354
1396
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-mockup-code__content", children: lines.map((line, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1355
1397
|
"pre",
|
|
1356
1398
|
{
|
|
@@ -1360,23 +1402,13 @@
|
|
|
1360
1402
|
},
|
|
1361
1403
|
i
|
|
1362
1404
|
)) }),
|
|
1363
|
-
copyText && /* @__PURE__ */ jsxRuntime.
|
|
1364
|
-
"button",
|
|
1365
|
-
{
|
|
1366
|
-
className: "usa-button usx-button usx-button--ghost usx-copy",
|
|
1367
|
-
onClick: () => usxCopy(copyText),
|
|
1368
|
-
children: [
|
|
1369
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "usa-icon usx-copy__copy", "aria-hidden": "true", focusable: "false", role: "img", children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: "./img/sprite.svg#content_copy" }) }),
|
|
1370
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "usa-icon usx-copy__check", "aria-hidden": "true", focusable: "false", role: "img", children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: "./img/sprite.svg#check" }) })
|
|
1371
|
-
]
|
|
1372
|
-
}
|
|
1373
|
-
)
|
|
1405
|
+
copyText && /* @__PURE__ */ jsxRuntime.jsx(CopyToClipboard, { copyText, staticBaseUrl, tooltipProps: { label: "Copy", copiedTooltip: "Copied", position: "left" } })
|
|
1374
1406
|
] });
|
|
1375
1407
|
}
|
|
1376
|
-
function CollectionItem({ href, heading, description, imgSrc, imgAlt = "",
|
|
1408
|
+
function CollectionItem({ href, heading, description, imgSrc, imgAlt = "", calendarDateProps, meta, tags }) {
|
|
1377
1409
|
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "usa-collection__item", children: [
|
|
1378
1410
|
imgSrc && /* @__PURE__ */ jsxRuntime.jsx("img", { className: "usa-collection__img", src: imgSrc, alt: imgAlt }),
|
|
1379
|
-
|
|
1411
|
+
calendarDateProps && /* @__PURE__ */ jsxRuntime.jsx(CalendarDate, { underCollection: true, ...calendarDateProps }),
|
|
1380
1412
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-collection__body", children: [
|
|
1381
1413
|
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-collection__heading", children: /* @__PURE__ */ jsxRuntime.jsx("a", { className: "usa-link usx-link", href, children: heading }) }),
|
|
1382
1414
|
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "usa-collection__description", children: description }),
|
|
@@ -1386,7 +1418,7 @@
|
|
|
1386
1418
|
tags && tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "usa-collection__meta", "aria-label": "Topics", children: tags.map((tag, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1387
1419
|
"li",
|
|
1388
1420
|
{
|
|
1389
|
-
className:
|
|
1421
|
+
className: ClassNames(
|
|
1390
1422
|
"usa-collection__meta-item",
|
|
1391
1423
|
"usa-tag usx-tag",
|
|
1392
1424
|
typeof tag === "object" && tag.isNew && "usa-tag--new"
|
|
@@ -1399,7 +1431,7 @@
|
|
|
1399
1431
|
] });
|
|
1400
1432
|
}
|
|
1401
1433
|
function Collection({ items = [], condensed = false, className = "", ...props }) {
|
|
1402
|
-
const classes =
|
|
1434
|
+
const classes = ClassNames(
|
|
1403
1435
|
"usa-collection",
|
|
1404
1436
|
"usx-collection",
|
|
1405
1437
|
condensed && "usa-collection--condensed",
|
|
@@ -1443,7 +1475,7 @@
|
|
|
1443
1475
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1444
1476
|
"div",
|
|
1445
1477
|
{
|
|
1446
|
-
className:
|
|
1478
|
+
className: ClassNames(
|
|
1447
1479
|
"usa-combo-box",
|
|
1448
1480
|
"usx-combo-box",
|
|
1449
1481
|
{ "usx-combo-box--error": !!error },
|
|
@@ -1455,7 +1487,7 @@
|
|
|
1455
1487
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1456
1488
|
"select",
|
|
1457
1489
|
{
|
|
1458
|
-
className:
|
|
1490
|
+
className: ClassNames("usa-select", "usx-select"),
|
|
1459
1491
|
id,
|
|
1460
1492
|
name,
|
|
1461
1493
|
disabled,
|
|
@@ -1470,38 +1502,6 @@
|
|
|
1470
1502
|
] });
|
|
1471
1503
|
return formGroup ? /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: content }) : content;
|
|
1472
1504
|
}
|
|
1473
|
-
function CopyToClipboard({
|
|
1474
|
-
copyText = "",
|
|
1475
|
-
label = null,
|
|
1476
|
-
tooltip = null,
|
|
1477
|
-
copiedTooltip = "Copied",
|
|
1478
|
-
className = ""
|
|
1479
|
-
}) {
|
|
1480
|
-
const button = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1481
|
-
"button",
|
|
1482
|
-
{
|
|
1483
|
-
className: classNames(
|
|
1484
|
-
"usa-button",
|
|
1485
|
-
"usx-button",
|
|
1486
|
-
"usx-button--ghost",
|
|
1487
|
-
"usx-copy",
|
|
1488
|
-
className
|
|
1489
|
-
),
|
|
1490
|
-
onClick: () => window.navigator.clipboard.writeText(copyText),
|
|
1491
|
-
type: "button",
|
|
1492
|
-
children: [
|
|
1493
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "usa-icon usx-copy__copy", "aria-hidden": "true", focusable: "false", role: "img", children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: "./img/sprite.svg#content_copy" }) }),
|
|
1494
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "usa-icon usx-copy__check", "aria-hidden": "true", focusable: "false", role: "img", children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: "./img/sprite.svg#check" }) }),
|
|
1495
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "margin-left-1", children: label })
|
|
1496
|
-
]
|
|
1497
|
-
}
|
|
1498
|
-
);
|
|
1499
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "usx-tooltip", children: [
|
|
1500
|
-
button,
|
|
1501
|
-
tooltip && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-tooltip__body usa-tooltip__body--right usx-copy__tooltip--copy", role: "tooltip", children: tooltip }),
|
|
1502
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-tooltip__body usa-tooltip__body--right usx-copy__tooltip--copied", role: "tooltip", children: copiedTooltip })
|
|
1503
|
-
] });
|
|
1504
|
-
}
|
|
1505
1505
|
function DatePicker({
|
|
1506
1506
|
id = "date-picker",
|
|
1507
1507
|
name,
|
|
@@ -1529,7 +1529,7 @@
|
|
|
1529
1529
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1530
1530
|
"div",
|
|
1531
1531
|
{
|
|
1532
|
-
className:
|
|
1532
|
+
className: ClassNames("usa-date-picker", "usx-date-picker", className),
|
|
1533
1533
|
...defaultValue ? { "data-default-value": defaultValue } : {},
|
|
1534
1534
|
...minDate ? { "data-min-date": minDate } : {},
|
|
1535
1535
|
...maxDate ? { "data-max-date": maxDate } : {},
|
|
@@ -1537,7 +1537,7 @@
|
|
|
1537
1537
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1538
1538
|
"input",
|
|
1539
1539
|
{
|
|
1540
|
-
className:
|
|
1540
|
+
className: ClassNames(
|
|
1541
1541
|
"usa-input",
|
|
1542
1542
|
"usx-input",
|
|
1543
1543
|
{ "usa-input--error": !!error }
|
|
@@ -1586,7 +1586,7 @@
|
|
|
1586
1586
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1587
1587
|
"div",
|
|
1588
1588
|
{
|
|
1589
|
-
className:
|
|
1589
|
+
className: ClassNames("usa-date-range-picker", "usx-date-range-picker", className),
|
|
1590
1590
|
...minDate ? { "data-min-date": minDate } : {},
|
|
1591
1591
|
...maxDate ? { "data-max-date": maxDate } : {},
|
|
1592
1592
|
children: [
|
|
@@ -1643,7 +1643,7 @@
|
|
|
1643
1643
|
);
|
|
1644
1644
|
}
|
|
1645
1645
|
function Eyebrow({ children = null, className = "", ...props }) {
|
|
1646
|
-
const classes =
|
|
1646
|
+
const classes = ClassNames("usx-eyebrow", className);
|
|
1647
1647
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...props, children });
|
|
1648
1648
|
}
|
|
1649
1649
|
function Link({
|
|
@@ -1656,7 +1656,7 @@
|
|
|
1656
1656
|
className = "",
|
|
1657
1657
|
...props
|
|
1658
1658
|
}) {
|
|
1659
|
-
const classes =
|
|
1659
|
+
const classes = ClassNames(
|
|
1660
1660
|
"usa-link",
|
|
1661
1661
|
"usx-link",
|
|
1662
1662
|
visited && "usx-link--visited",
|
|
@@ -1693,7 +1693,7 @@
|
|
|
1693
1693
|
function FileList({ files, hint = "Selected files", onRemove = null, disabled = false, className = "" }) {
|
|
1694
1694
|
if (!files || files.length === 0) return null;
|
|
1695
1695
|
const lastEntry = getEntryDisplay(files[files.length - 1]);
|
|
1696
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
1696
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usx-file-input__list", "margin-top-1", className), children: [
|
|
1697
1697
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-sr-only", "aria-live": "polite", children: `You have selected the file: ${lastEntry.name}.` }),
|
|
1698
1698
|
hint && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-hint usx-hint usx-file-input__list-heading", children: hint }),
|
|
1699
1699
|
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "usx-file-input__file-list", children: files.map((entry) => {
|
|
@@ -1786,7 +1786,7 @@
|
|
|
1786
1786
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1787
1787
|
"input",
|
|
1788
1788
|
{
|
|
1789
|
-
className:
|
|
1789
|
+
className: ClassNames("usa-file-input", "usx-file-input", className),
|
|
1790
1790
|
id,
|
|
1791
1791
|
type: "file",
|
|
1792
1792
|
name: name || id,
|
|
@@ -1809,7 +1809,7 @@
|
|
|
1809
1809
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-file-input__add-only", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1810
1810
|
"input",
|
|
1811
1811
|
{
|
|
1812
|
-
className:
|
|
1812
|
+
className: ClassNames("usa-file-input", "usx-file-input", className),
|
|
1813
1813
|
id,
|
|
1814
1814
|
type: "file",
|
|
1815
1815
|
name: name || id,
|
|
@@ -1827,7 +1827,7 @@
|
|
|
1827
1827
|
] });
|
|
1828
1828
|
return formGroup ? /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: content }) : content;
|
|
1829
1829
|
}
|
|
1830
|
-
function BrandingContent({ config, projectUrl }) {
|
|
1830
|
+
function BrandingContent({ config, projectUrl, staticBaseUrl }) {
|
|
1831
1831
|
const { title, symbol, symbolInverse, logo, logoInverse, alt } = config;
|
|
1832
1832
|
const label = alt ?? title ?? "";
|
|
1833
1833
|
if (logo) {
|
|
@@ -1838,11 +1838,12 @@
|
|
|
1838
1838
|
...projectUrl ? { href: projectUrl } : {},
|
|
1839
1839
|
className: "usx-image usx-logo__image",
|
|
1840
1840
|
children: [
|
|
1841
|
-
/* @__PURE__ */ jsxRuntime.jsx(Image, { src: logo, alt: label, className: "usx-logo__variant" }),
|
|
1841
|
+
/* @__PURE__ */ jsxRuntime.jsx(Image, { src: logo, alt: label, staticBaseUrl, className: "usx-logo__variant" }),
|
|
1842
1842
|
logoInverse && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1843
1843
|
Image,
|
|
1844
1844
|
{
|
|
1845
1845
|
src: logoInverse,
|
|
1846
|
+
staticBaseUrl,
|
|
1846
1847
|
alt: label,
|
|
1847
1848
|
className: "usx-logo__variant usx-logo__variant--inverse"
|
|
1848
1849
|
}
|
|
@@ -1852,11 +1853,11 @@
|
|
|
1852
1853
|
);
|
|
1853
1854
|
}
|
|
1854
1855
|
return /* @__PURE__ */ jsxRuntime.jsxs("em", { className: "usa-logo__text", children: [
|
|
1855
|
-
symbol && /* @__PURE__ */ jsxRuntime.jsx("img", { src: symbol, alt: "", "aria-hidden": "true", className: "usx-logo__symbol usx-logo__variant" }),
|
|
1856
|
+
symbol && /* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(symbol, staticBaseUrl), alt: "", "aria-hidden": "true", className: "usx-logo__symbol usx-logo__variant" }),
|
|
1856
1857
|
symbolInverse && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1857
1858
|
"img",
|
|
1858
1859
|
{
|
|
1859
|
-
src: symbolInverse,
|
|
1860
|
+
src: getAssetUrl(symbolInverse, staticBaseUrl),
|
|
1860
1861
|
alt: "",
|
|
1861
1862
|
"aria-hidden": "true",
|
|
1862
1863
|
className: "usx-logo__symbol usx-logo__variant usx-logo__variant--inverse"
|
|
@@ -1865,17 +1866,17 @@
|
|
|
1865
1866
|
title && (projectUrl ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: projectUrl, className: "usx-logo__title", children: title }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-logo__title", children: title }))
|
|
1866
1867
|
] });
|
|
1867
1868
|
}
|
|
1868
|
-
function Branding({ branding, projectUrl = "/", className = "", ...props }) {
|
|
1869
|
+
function Branding({ branding, projectUrl = "/", staticBaseUrl, className = "", ...props }) {
|
|
1869
1870
|
if (!branding) return null;
|
|
1870
|
-
const classes =
|
|
1871
|
+
const classes = ClassNames(
|
|
1871
1872
|
"usa-logo",
|
|
1872
1873
|
"usx-logo",
|
|
1873
1874
|
className
|
|
1874
1875
|
);
|
|
1875
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(BrandingContent, { config: branding, projectUrl }) });
|
|
1876
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(BrandingContent, { config: branding, projectUrl, staticBaseUrl }) });
|
|
1876
1877
|
}
|
|
1877
1878
|
function FooterReturnToTop({ label = "Return to top", href = "#", className = "" }) {
|
|
1878
|
-
const classes =
|
|
1879
|
+
const classes = ClassNames(
|
|
1879
1880
|
"grid-container",
|
|
1880
1881
|
"usa-footer__return-to-top",
|
|
1881
1882
|
"usx-footer__return-to-top",
|
|
@@ -1887,7 +1888,7 @@
|
|
|
1887
1888
|
] }) });
|
|
1888
1889
|
}
|
|
1889
1890
|
function FooterNavColumn({ heading, links = [], className = "" }) {
|
|
1890
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className:
|
|
1891
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: ClassNames("usa-footer__primary-content usa-footer__primary-content--collapsible usx-footer__nav-column", className), children: [
|
|
1891
1892
|
heading && /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-footer__primary-link", children: heading }),
|
|
1892
1893
|
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)) })
|
|
1893
1894
|
] });
|
|
@@ -1901,7 +1902,7 @@
|
|
|
1901
1902
|
onSubmit = null,
|
|
1902
1903
|
className = ""
|
|
1903
1904
|
}) {
|
|
1904
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
1905
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usa-sign-up usx-footer__sign-up", className), children: [
|
|
1905
1906
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "usa-sign-up__heading", children: heading }),
|
|
1906
1907
|
/* @__PURE__ */ jsxRuntime.jsxs("form", { className: "usa-form", action: action || void 0, onSubmit: onSubmit || void 0, children: [
|
|
1907
1908
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1918,9 +1919,9 @@
|
|
|
1918
1919
|
] })
|
|
1919
1920
|
] });
|
|
1920
1921
|
}
|
|
1921
|
-
function FooterSocialLinks({ links = [], className = "" }) {
|
|
1922
|
+
function FooterSocialLinks({ links = [], staticBaseUrl, className = "" }) {
|
|
1922
1923
|
if (!links.length) return null;
|
|
1923
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1924
|
+
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)) });
|
|
1924
1925
|
}
|
|
1925
1926
|
function normalizeContactLink(value, scheme) {
|
|
1926
1927
|
var _a;
|
|
@@ -1942,7 +1943,7 @@
|
|
|
1942
1943
|
...links
|
|
1943
1944
|
].filter(Boolean);
|
|
1944
1945
|
if (!heading && allLinks.length === 0) return null;
|
|
1945
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("address", { className:
|
|
1946
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("address", { className: ClassNames("usa-footer__address usx-footer__contact", className), children: [
|
|
1946
1947
|
heading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "usa-footer__contact-heading", children: heading }),
|
|
1947
1948
|
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)) })
|
|
1948
1949
|
] });
|
|
@@ -1958,6 +1959,7 @@
|
|
|
1958
1959
|
signUp = null,
|
|
1959
1960
|
branding = null,
|
|
1960
1961
|
brandingUrl = "/",
|
|
1962
|
+
staticBaseUrl,
|
|
1961
1963
|
socialLinks = [],
|
|
1962
1964
|
contactHeading = null,
|
|
1963
1965
|
contactPhone = null,
|
|
@@ -1969,7 +1971,7 @@
|
|
|
1969
1971
|
...props
|
|
1970
1972
|
}) {
|
|
1971
1973
|
const variantClass = variant === "big" ? "usa-footer--big" : variant === "slim" ? "usa-footer--slim" : "";
|
|
1972
|
-
const classes =
|
|
1974
|
+
const classes = ClassNames("usa-footer", variantClass, "usx-footer", className);
|
|
1973
1975
|
const returnToTopEl = returnToTop ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1974
1976
|
FooterReturnToTop,
|
|
1975
1977
|
{
|
|
@@ -1987,9 +1989,9 @@
|
|
|
1987
1989
|
links: contactLinks
|
|
1988
1990
|
}
|
|
1989
1991
|
) : null;
|
|
1990
|
-
const socialEl = socialLinks.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(FooterSocialLinks, { links: socialLinks }) : null;
|
|
1992
|
+
const socialEl = socialLinks.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(FooterSocialLinks, { links: socialLinks, staticBaseUrl }) : null;
|
|
1991
1993
|
const logoClassName = variant === "slim" ? "usa-footer__logo grid-row grid-gap-2 usx-footer__logo" : "usa-footer__logo grid-row mobile-lg:grid-col-6 mobile-lg:grid-gap-2 usx-footer__logo";
|
|
1992
|
-
const brandingEl = branding ? /* @__PURE__ */ jsxRuntime.jsx(Branding, { branding, projectUrl: brandingUrl, className: logoClassName }) : null;
|
|
1994
|
+
const brandingEl = branding ? /* @__PURE__ */ jsxRuntime.jsx(Branding, { branding, projectUrl: brandingUrl, staticBaseUrl, className: logoClassName }) : null;
|
|
1993
1995
|
const secondaryContactBlock = socialEl || contactEl ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-footer__contact-links mobile-lg:grid-col-6", children: [
|
|
1994
1996
|
socialEl,
|
|
1995
1997
|
contactEl
|
|
@@ -2008,11 +2010,16 @@
|
|
|
2008
2010
|
] });
|
|
2009
2011
|
}
|
|
2010
2012
|
if (variant === "slim") {
|
|
2013
|
+
const slimContactLinks = [
|
|
2014
|
+
normalizeContactLink(contactPhone, "tel:"),
|
|
2015
|
+
normalizeContactLink(contactEmail, "mailto:"),
|
|
2016
|
+
...contactLinks
|
|
2017
|
+
].filter(Boolean);
|
|
2011
2018
|
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...props, children: [
|
|
2012
2019
|
returnToTopEl,
|
|
2013
2020
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__primary-section", children: primaryChildren ?? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-footer__primary-container grid-row", children: [
|
|
2014
2021
|
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)) }) }) }),
|
|
2015
|
-
|
|
2022
|
+
slimContactLinks.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mobile-lg:grid-col-4", children: /* @__PURE__ */ jsxRuntime.jsx("address", { className: "usa-footer__address usx-footer__contact", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-row grid-gap", children: slimContactLinks.map((link, index) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-col-auto mobile-lg:grid-col-12 desktop:grid-col-auto", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__contact-info", children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: link.href, children: link.text }) }) }, index)) }) }) })
|
|
2016
2023
|
] }) }),
|
|
2017
2024
|
(brandingEl || secondaryChildren) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__secondary-section", children: secondaryChildren ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-container", children: brandingEl }) })
|
|
2018
2025
|
] });
|
|
@@ -2049,13 +2056,13 @@
|
|
|
2049
2056
|
onSubmit(query);
|
|
2050
2057
|
}
|
|
2051
2058
|
};
|
|
2052
|
-
const iconClasses =
|
|
2059
|
+
const iconClasses = ClassNames(
|
|
2053
2060
|
"usa-search__submit-icon",
|
|
2054
2061
|
{
|
|
2055
2062
|
"display-inline-block": iconOnly
|
|
2056
2063
|
}
|
|
2057
2064
|
);
|
|
2058
|
-
const formClasses =
|
|
2065
|
+
const formClasses = ClassNames(
|
|
2059
2066
|
"usa-search",
|
|
2060
2067
|
{
|
|
2061
2068
|
"usa-search--small": iconOnly && !big,
|
|
@@ -2108,7 +2115,7 @@
|
|
|
2108
2115
|
headerId = "header",
|
|
2109
2116
|
renderSearchDirectly = false
|
|
2110
2117
|
}) {
|
|
2111
|
-
const navClasses =
|
|
2118
|
+
const navClasses = ClassNames("usa-nav__primary", "usa-accordion");
|
|
2112
2119
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2113
2120
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "usa-nav__close", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "close" }) }),
|
|
2114
2121
|
/* @__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(
|
|
@@ -2185,6 +2192,7 @@
|
|
|
2185
2192
|
function Header({
|
|
2186
2193
|
id = "header",
|
|
2187
2194
|
branding,
|
|
2195
|
+
staticBaseUrl,
|
|
2188
2196
|
projectUrl = "/",
|
|
2189
2197
|
navSections = [],
|
|
2190
2198
|
secondaryLinks = [],
|
|
@@ -2198,7 +2206,7 @@
|
|
|
2198
2206
|
navEndContent = null,
|
|
2199
2207
|
...props
|
|
2200
2208
|
}) {
|
|
2201
|
-
const headerClasses =
|
|
2209
|
+
const headerClasses = ClassNames(
|
|
2202
2210
|
"usa-header",
|
|
2203
2211
|
"usx-header",
|
|
2204
2212
|
{ "usa-header--basic": !extended },
|
|
@@ -2206,13 +2214,13 @@
|
|
|
2206
2214
|
{ "usa-header--extended": extended },
|
|
2207
2215
|
className
|
|
2208
2216
|
);
|
|
2209
|
-
const navClasses =
|
|
2217
|
+
const navClasses = ClassNames(
|
|
2210
2218
|
"usa-nav",
|
|
2211
2219
|
"usx-nav",
|
|
2212
2220
|
{ "usx-nav--sticky": stickyNav }
|
|
2213
2221
|
);
|
|
2214
2222
|
const navbar = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-navbar", children: [
|
|
2215
|
-
/* @__PURE__ */ jsxRuntime.jsx(Branding, { branding, projectUrl }),
|
|
2223
|
+
/* @__PURE__ */ jsxRuntime.jsx(Branding, { branding, projectUrl, staticBaseUrl }),
|
|
2216
2224
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "usa-menu-btn align-center", children: useMenuIcon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "menu", size: 3 }) : "Menu" })
|
|
2217
2225
|
] });
|
|
2218
2226
|
if (extended) {
|
|
@@ -2270,7 +2278,7 @@
|
|
|
2270
2278
|
title = "",
|
|
2271
2279
|
callout = "",
|
|
2272
2280
|
paragraph = "",
|
|
2273
|
-
|
|
2281
|
+
buttonProps = null,
|
|
2274
2282
|
searchProps = null,
|
|
2275
2283
|
backgroundImage = "",
|
|
2276
2284
|
backgroundPosition,
|
|
@@ -2289,7 +2297,7 @@
|
|
|
2289
2297
|
const Heading = headingLevel;
|
|
2290
2298
|
const secondaryHeadings = { h1: "h2", h2: "h3", h3: "h4", h4: "h5", h5: "h6" };
|
|
2291
2299
|
const SecondaryHeading = secondaryHeadings[headingLevel];
|
|
2292
|
-
const classes =
|
|
2300
|
+
const classes = ClassNames(
|
|
2293
2301
|
"usx-hero",
|
|
2294
2302
|
overlay && "usx-hero--has-overlay",
|
|
2295
2303
|
overlayOpacity !== void 0 && "usx-hero--custom-overlay",
|
|
@@ -2297,7 +2305,7 @@
|
|
|
2297
2305
|
!boxed && "usx-hero--unboxed",
|
|
2298
2306
|
secondaryContent && "usx-hero--split",
|
|
2299
2307
|
className
|
|
2300
|
-
|
|
2308
|
+
);
|
|
2301
2309
|
const heroStyle = {
|
|
2302
2310
|
...backgroundImage ? { backgroundImage: `url('${backgroundImage}')` } : {},
|
|
2303
2311
|
...backgroundPosition ? { backgroundPosition } : {},
|
|
@@ -2312,7 +2320,7 @@
|
|
|
2312
2320
|
] }),
|
|
2313
2321
|
paragraph && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "usx-hero__paragraph", children: paragraph }),
|
|
2314
2322
|
searchProps && /* @__PURE__ */ jsxRuntime.jsx(Search, { ...searchProps }),
|
|
2315
|
-
!searchProps &&
|
|
2323
|
+
!searchProps && buttonProps && /* @__PURE__ */ jsxRuntime.jsx(Button, { ...buttonProps })
|
|
2316
2324
|
] }),
|
|
2317
2325
|
secondaryContent && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-hero__secondary", children: [
|
|
2318
2326
|
secondaryContent.title && /* @__PURE__ */ jsxRuntime.jsx(SecondaryHeading, { className: "usx-hero__secondary-heading", children: secondaryContent.title }),
|
|
@@ -2328,15 +2336,15 @@
|
|
|
2328
2336
|
return content;
|
|
2329
2337
|
}
|
|
2330
2338
|
function IconList({ items = [], primary = false, size = null, className = "", ...props }) {
|
|
2331
|
-
const classes =
|
|
2339
|
+
const classes = ClassNames(
|
|
2332
2340
|
"usa-icon-list",
|
|
2333
2341
|
"usx-icon-list",
|
|
2334
2342
|
primary && "usa-icon-list--primary",
|
|
2335
2343
|
size === "lg" && "usa-icon-list--size-lg",
|
|
2336
2344
|
className
|
|
2337
2345
|
);
|
|
2338
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props, children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className:
|
|
2339
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2346
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props, children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: ClassNames("usa-icon-list__item", item.itemClassName), children: [
|
|
2347
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: ClassNames("usa-icon-list__icon", item.iconColor && `text-${item.iconColor}`, item.iconClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2340
2348
|
Icon,
|
|
2341
2349
|
{
|
|
2342
2350
|
name: item.iconName,
|
|
@@ -2345,7 +2353,7 @@
|
|
|
2345
2353
|
className: item.iconClassName
|
|
2346
2354
|
}
|
|
2347
2355
|
) }),
|
|
2348
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2356
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usa-icon-list__content", item.contentClassName), children: [
|
|
2349
2357
|
item.title ? /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-icon-list__title", children: item.title }) : null,
|
|
2350
2358
|
renderContent$1(item.content)
|
|
2351
2359
|
] })
|
|
@@ -2426,7 +2434,7 @@
|
|
|
2426
2434
|
overlapAvatars = false,
|
|
2427
2435
|
className = ""
|
|
2428
2436
|
}) {
|
|
2429
|
-
const classes =
|
|
2437
|
+
const classes = ClassNames("usa-identifier", "usx-identifier", className);
|
|
2430
2438
|
const labels = {
|
|
2431
2439
|
masthead: language === "es" ? "Identificador de la agencia," : "Agency identifier,",
|
|
2432
2440
|
description: language === "es" ? "Descripcion de la agencia," : "Agency description,",
|
|
@@ -2440,7 +2448,7 @@
|
|
|
2440
2448
|
avatarProps.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2441
2449
|
"div",
|
|
2442
2450
|
{
|
|
2443
|
-
className:
|
|
2451
|
+
className: ClassNames(
|
|
2444
2452
|
"usa-identifier__logos",
|
|
2445
2453
|
"usx-avatar-group",
|
|
2446
2454
|
overlapAvatars && "usa-avatar-group--overlap"
|
|
@@ -2451,8 +2459,8 @@
|
|
|
2451
2459
|
...avatar,
|
|
2452
2460
|
key: `${avatar.alt}-${index}`,
|
|
2453
2461
|
shape: avatar.shape || logoShape,
|
|
2454
|
-
className:
|
|
2455
|
-
imageClassName:
|
|
2462
|
+
className: ClassNames("usa-identifier__logo", avatar.className),
|
|
2463
|
+
imageClassName: ClassNames("usa-identifier__logo-img", avatar.imageClassName)
|
|
2456
2464
|
}
|
|
2457
2465
|
))
|
|
2458
2466
|
}
|
|
@@ -2493,7 +2501,7 @@
|
|
|
2493
2501
|
"aside",
|
|
2494
2502
|
{
|
|
2495
2503
|
id,
|
|
2496
|
-
className:
|
|
2504
|
+
className: ClassNames("usa-in-page-nav", "usx-in-page-nav", className),
|
|
2497
2505
|
"data-heading-elements": headingElements,
|
|
2498
2506
|
"data-main-content-selector": resolvedSelector,
|
|
2499
2507
|
"data-title-heading-level": titleHeadingLevel,
|
|
@@ -2509,7 +2517,7 @@
|
|
|
2509
2517
|
"div",
|
|
2510
2518
|
{
|
|
2511
2519
|
id: contentId,
|
|
2512
|
-
className:
|
|
2520
|
+
className: ClassNames("usx-in-page-nav__content", "usa-prose", contentClassName),
|
|
2513
2521
|
...children ? {} : { dangerouslySetInnerHTML: { __html: content } },
|
|
2514
2522
|
children: children || null
|
|
2515
2523
|
}
|
|
@@ -2517,12 +2525,12 @@
|
|
|
2517
2525
|
] });
|
|
2518
2526
|
}
|
|
2519
2527
|
function Indicator({ items = [], children = null, className = "", ...props }) {
|
|
2520
|
-
const classes =
|
|
2528
|
+
const classes = ClassNames("usx-indicator", className);
|
|
2521
2529
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props, children: [
|
|
2522
2530
|
items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2523
2531
|
"span",
|
|
2524
2532
|
{
|
|
2525
|
-
className:
|
|
2533
|
+
className: ClassNames("usx-indicator-item", item.className),
|
|
2526
2534
|
style: item.style,
|
|
2527
2535
|
children: item.label
|
|
2528
2536
|
},
|
|
@@ -2559,11 +2567,11 @@
|
|
|
2559
2567
|
className,
|
|
2560
2568
|
navAriaLabel
|
|
2561
2569
|
}) {
|
|
2562
|
-
const containerClasses =
|
|
2570
|
+
const containerClasses = ClassNames(
|
|
2563
2571
|
"usa-language-container",
|
|
2564
2572
|
small && "usa-language--small"
|
|
2565
2573
|
);
|
|
2566
|
-
const buttonClasses =
|
|
2574
|
+
const buttonClasses = ClassNames(
|
|
2567
2575
|
"usa-button",
|
|
2568
2576
|
"usx-button",
|
|
2569
2577
|
unstyled ? "usa-button--unstyled" : "usa-button--primary",
|
|
@@ -2607,7 +2615,7 @@
|
|
|
2607
2615
|
...props
|
|
2608
2616
|
}) {
|
|
2609
2617
|
const resolvedVariant = variant || (languages.length > 2 ? "menu" : "two");
|
|
2610
|
-
const classes =
|
|
2618
|
+
const classes = ClassNames("usx-language-selector", className);
|
|
2611
2619
|
if (!languages || languages.length === 0) {
|
|
2612
2620
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, children: "LanguageSelector" });
|
|
2613
2621
|
}
|
|
@@ -2640,7 +2648,7 @@
|
|
|
2640
2648
|
);
|
|
2641
2649
|
}
|
|
2642
2650
|
function SingleColumnLayout({ children, expandButton = null, className = "", ...props }) {
|
|
2643
|
-
const classes =
|
|
2651
|
+
const classes = ClassNames("usx-layout__single-column", className);
|
|
2644
2652
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props, children: [
|
|
2645
2653
|
expandButton,
|
|
2646
2654
|
children
|
|
@@ -2657,24 +2665,24 @@
|
|
|
2657
2665
|
...props
|
|
2658
2666
|
}) {
|
|
2659
2667
|
const contentModifier = rightSidebar && !leftSidebar ? "left" : leftSidebar && !rightSidebar ? "right" : null;
|
|
2660
|
-
const contentClasses =
|
|
2668
|
+
const contentClasses = ClassNames(
|
|
2661
2669
|
"usx-layout__content",
|
|
2662
2670
|
{
|
|
2663
2671
|
"usx-layout__content--left": contentModifier === "left",
|
|
2664
2672
|
"usx-layout__content--right": contentModifier === "right"
|
|
2665
2673
|
}
|
|
2666
2674
|
);
|
|
2667
|
-
const containerClasses =
|
|
2675
|
+
const containerClasses = ClassNames(
|
|
2668
2676
|
"usx-layout__grid-container",
|
|
2669
2677
|
className
|
|
2670
2678
|
);
|
|
2671
|
-
const leftSidebarClasses =
|
|
2679
|
+
const leftSidebarClasses = ClassNames(
|
|
2672
2680
|
"usx-layout__sidebar--left",
|
|
2673
2681
|
{
|
|
2674
2682
|
"usx-layout__sidebar--expanded": expandLeftSidebar
|
|
2675
2683
|
}
|
|
2676
2684
|
);
|
|
2677
|
-
const rightSidebarClasses =
|
|
2685
|
+
const rightSidebarClasses = ClassNames(
|
|
2678
2686
|
"usx-layout__sidebar--right",
|
|
2679
2687
|
{
|
|
2680
2688
|
"usx-layout__sidebar--expanded": expandRightSidebar
|
|
@@ -2702,7 +2710,7 @@
|
|
|
2702
2710
|
...props
|
|
2703
2711
|
}) {
|
|
2704
2712
|
const [expanded, setExpanded] = React.useState(false);
|
|
2705
|
-
const classes =
|
|
2713
|
+
const classes = ClassNames(
|
|
2706
2714
|
"usx-layout",
|
|
2707
2715
|
{ "usx-expanded": expandable && expanded },
|
|
2708
2716
|
className
|
|
@@ -2750,7 +2758,7 @@
|
|
|
2750
2758
|
const childUnstyled = objectItem && typeof item.unstyled === "boolean" ? item.unstyled : parentOptions.unstyled;
|
|
2751
2759
|
const childClassName = objectItem && typeof item.className === "string" ? item.className : "";
|
|
2752
2760
|
const ChildTag = childOrdered ? "ol" : "ul";
|
|
2753
|
-
const childClasses =
|
|
2761
|
+
const childClasses = ClassNames(
|
|
2754
2762
|
"usa-list",
|
|
2755
2763
|
"usx-list",
|
|
2756
2764
|
childUnstyled && "usa-list--unstyled",
|
|
@@ -2763,7 +2771,7 @@
|
|
|
2763
2771
|
});
|
|
2764
2772
|
}
|
|
2765
2773
|
function List({ items = [], ordered = false, unstyled = false, className = "", ...props }) {
|
|
2766
|
-
const classes =
|
|
2774
|
+
const classes = ClassNames(
|
|
2767
2775
|
"usa-list",
|
|
2768
2776
|
"usx-list",
|
|
2769
2777
|
unstyled && "usa-list--unstyled",
|
|
@@ -2796,7 +2804,7 @@
|
|
|
2796
2804
|
const selectClasses = "usa-select usx-select";
|
|
2797
2805
|
const selectErrorClasses = "usa-input--error";
|
|
2798
2806
|
const selectSuccessClasses = "usa-input--success";
|
|
2799
|
-
const combinedSelectClasses =
|
|
2807
|
+
const combinedSelectClasses = ClassNames(
|
|
2800
2808
|
selectClasses,
|
|
2801
2809
|
hasError && selectErrorClasses,
|
|
2802
2810
|
hasSuccess && selectSuccessClasses,
|
|
@@ -2960,7 +2968,7 @@
|
|
|
2960
2968
|
}) {
|
|
2961
2969
|
const menuId = React.useId();
|
|
2962
2970
|
const toggleId = React.useId();
|
|
2963
|
-
const classes =
|
|
2971
|
+
const classes = ClassNames("usx-misc-banner", `bg-${tone}`, className);
|
|
2964
2972
|
const mobileLinks = [];
|
|
2965
2973
|
const hasLearnMoreLink = showLearnMore && Boolean(casualLinkText);
|
|
2966
2974
|
const hasReturnLink = showReturnLink && Boolean(importantLinkText);
|
|
@@ -3047,7 +3055,7 @@
|
|
|
3047
3055
|
children,
|
|
3048
3056
|
...props
|
|
3049
3057
|
}) {
|
|
3050
|
-
const classes =
|
|
3058
|
+
const classes = ClassNames("usa-modal", "usx-modal", {
|
|
3051
3059
|
"usa-modal--lg": size === "lg",
|
|
3052
3060
|
"usx-modal--lg-collapsed": size === "lg-collapsed"
|
|
3053
3061
|
}, className);
|
|
@@ -3090,7 +3098,7 @@
|
|
|
3090
3098
|
className = "",
|
|
3091
3099
|
...props
|
|
3092
3100
|
}) {
|
|
3093
|
-
const classes =
|
|
3101
|
+
const classes = ClassNames("usx-page", className);
|
|
3094
3102
|
const pageContent = children || content;
|
|
3095
3103
|
const Element = element;
|
|
3096
3104
|
return /* @__PURE__ */ jsxRuntime.jsxs(Element, { id, className: classes, ...props, children: [
|
|
@@ -3179,7 +3187,7 @@
|
|
|
3179
3187
|
lastClickTime.current = e.timeStamp;
|
|
3180
3188
|
if (!isLastPage) onPageChange((prev) => unbounded ? prev + 1 : Math.min(prev + 1, totalPages));
|
|
3181
3189
|
};
|
|
3182
|
-
const navClasses =
|
|
3190
|
+
const navClasses = ClassNames(
|
|
3183
3191
|
"usa-pagination",
|
|
3184
3192
|
"usx-pagination__nav",
|
|
3185
3193
|
{ "usx-pagination__arrows-only": arrowsOnly },
|
|
@@ -3189,7 +3197,7 @@
|
|
|
3189
3197
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3190
3198
|
"li",
|
|
3191
3199
|
{
|
|
3192
|
-
className:
|
|
3200
|
+
className: ClassNames(
|
|
3193
3201
|
"usa-pagination__item",
|
|
3194
3202
|
"usa-pagination__arrow"
|
|
3195
3203
|
),
|
|
@@ -3197,7 +3205,7 @@
|
|
|
3197
3205
|
"a",
|
|
3198
3206
|
{
|
|
3199
3207
|
href: "#",
|
|
3200
|
-
className:
|
|
3208
|
+
className: ClassNames(
|
|
3201
3209
|
"usa-pagination__link",
|
|
3202
3210
|
"usa-pagination__previous-page",
|
|
3203
3211
|
isFirstPage && "display-none",
|
|
@@ -3212,7 +3220,7 @@
|
|
|
3212
3220
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3213
3221
|
"span",
|
|
3214
3222
|
{
|
|
3215
|
-
className:
|
|
3223
|
+
className: ClassNames(
|
|
3216
3224
|
"usa-pagination__link-text",
|
|
3217
3225
|
hideLinkText && "usa-sr-only"
|
|
3218
3226
|
),
|
|
@@ -3241,7 +3249,7 @@
|
|
|
3241
3249
|
"a",
|
|
3242
3250
|
{
|
|
3243
3251
|
href: "#",
|
|
3244
|
-
className:
|
|
3252
|
+
className: ClassNames(
|
|
3245
3253
|
"usa-pagination__button",
|
|
3246
3254
|
isCurrent && "usa-current"
|
|
3247
3255
|
),
|
|
@@ -3255,7 +3263,7 @@
|
|
|
3255
3263
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3256
3264
|
"li",
|
|
3257
3265
|
{
|
|
3258
|
-
className:
|
|
3266
|
+
className: ClassNames(
|
|
3259
3267
|
"usa-pagination__item",
|
|
3260
3268
|
"usa-pagination__arrow"
|
|
3261
3269
|
),
|
|
@@ -3263,7 +3271,7 @@
|
|
|
3263
3271
|
"a",
|
|
3264
3272
|
{
|
|
3265
3273
|
href: "#",
|
|
3266
|
-
className:
|
|
3274
|
+
className: ClassNames(
|
|
3267
3275
|
"usa-pagination__link",
|
|
3268
3276
|
"usa-pagination__next-page",
|
|
3269
3277
|
isLastPage && "display-none",
|
|
@@ -3277,7 +3285,7 @@
|
|
|
3277
3285
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3278
3286
|
"span",
|
|
3279
3287
|
{
|
|
3280
|
-
className:
|
|
3288
|
+
className: ClassNames(
|
|
3281
3289
|
"usa-pagination__link-text",
|
|
3282
3290
|
hideLinkText && "usa-sr-only"
|
|
3283
3291
|
),
|
|
@@ -3300,7 +3308,7 @@
|
|
|
3300
3308
|
id = "pagination-step-options",
|
|
3301
3309
|
className = ""
|
|
3302
3310
|
}) {
|
|
3303
|
-
const classes =
|
|
3311
|
+
const classes = ClassNames(
|
|
3304
3312
|
"usx-pagination__step-options",
|
|
3305
3313
|
className
|
|
3306
3314
|
);
|
|
@@ -3328,7 +3336,7 @@
|
|
|
3328
3336
|
}) {
|
|
3329
3337
|
const firstItem = (currentPage - 1) * pageSize + 1;
|
|
3330
3338
|
const lastItem = Math.min(currentPage * pageSize, totalItems);
|
|
3331
|
-
const classes =
|
|
3339
|
+
const classes = ClassNames(
|
|
3332
3340
|
"usa-label",
|
|
3333
3341
|
"usx-label",
|
|
3334
3342
|
"usx-pagination__summary",
|
|
@@ -3354,7 +3362,7 @@
|
|
|
3354
3362
|
className = "",
|
|
3355
3363
|
...props
|
|
3356
3364
|
}) {
|
|
3357
|
-
const classes =
|
|
3365
|
+
const classes = ClassNames("usx-pagination__container", className);
|
|
3358
3366
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props, children: [
|
|
3359
3367
|
summary && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-pagination__container-summary", children: summary }),
|
|
3360
3368
|
(stepOptions || navigation) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-pagination__container-end", children: [
|
|
@@ -3400,7 +3408,7 @@
|
|
|
3400
3408
|
onPageSizeChange == null ? void 0 : onPageSizeChange(size, newPage);
|
|
3401
3409
|
onPageChange == null ? void 0 : onPageChange(newPage, size);
|
|
3402
3410
|
};
|
|
3403
|
-
const classes =
|
|
3411
|
+
const classes = ClassNames("usx-pagination", className);
|
|
3404
3412
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3405
3413
|
PaginationContainer,
|
|
3406
3414
|
{
|
|
@@ -3444,15 +3452,49 @@
|
|
|
3444
3452
|
return content;
|
|
3445
3453
|
}
|
|
3446
3454
|
const ProcessList = ({ items = [], className = "", ...props }) => {
|
|
3447
|
-
const classes =
|
|
3455
|
+
const classes = ClassNames("usa-process-list", "usx-process-list", className);
|
|
3448
3456
|
return /* @__PURE__ */ jsxRuntime.jsx("ol", { className: classes, ...props, children: items.map((item, index) => {
|
|
3449
3457
|
const HeadingTag = item.headingTag || "h4";
|
|
3450
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className:
|
|
3451
|
-
/* @__PURE__ */ jsxRuntime.jsx(HeadingTag, { className:
|
|
3452
|
-
item.body && (typeof item.body === "string" || item.bodyClassName ? /* @__PURE__ */ jsxRuntime.jsx("p", { className:
|
|
3458
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: ClassNames("usa-process-list__item", item.className), children: [
|
|
3459
|
+
/* @__PURE__ */ jsxRuntime.jsx(HeadingTag, { className: ClassNames("usa-process-list__heading", item.headingClassName), children: item.heading }),
|
|
3460
|
+
item.body && (typeof item.body === "string" || item.bodyClassName ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: ClassNames(item.bodyClassName), children: renderContent(item.body) }) : renderContent(item.body))
|
|
3453
3461
|
] }, index);
|
|
3454
3462
|
}) });
|
|
3455
3463
|
};
|
|
3464
|
+
function Quote({
|
|
3465
|
+
calloutProps,
|
|
3466
|
+
attributionProps,
|
|
3467
|
+
children,
|
|
3468
|
+
content,
|
|
3469
|
+
sourceLinkProps,
|
|
3470
|
+
sourceTitle,
|
|
3471
|
+
className,
|
|
3472
|
+
blockquoteClassName,
|
|
3473
|
+
...props
|
|
3474
|
+
}) {
|
|
3475
|
+
const isVertical = (calloutProps == null ? void 0 : calloutProps.orientation) === "vertical";
|
|
3476
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usx-quote", isVertical && "usx-quote--vertical", className), ...props, children: [
|
|
3477
|
+
!isVertical && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "format_quote", size: 4, className: "usx-quote__icon" }),
|
|
3478
|
+
/* @__PURE__ */ jsxRuntime.jsx(Callout, { ...calloutProps, element: "div", children: /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: "usx-quote__body", children: [
|
|
3479
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3480
|
+
"blockquote",
|
|
3481
|
+
{
|
|
3482
|
+
className: ClassNames("usx-quote__content", blockquoteClassName),
|
|
3483
|
+
cite: sourceLinkProps == null ? void 0 : sourceLinkProps.href,
|
|
3484
|
+
children: [
|
|
3485
|
+
isVertical && "❝",
|
|
3486
|
+
children ?? content,
|
|
3487
|
+
isVertical && "❞"
|
|
3488
|
+
]
|
|
3489
|
+
}
|
|
3490
|
+
),
|
|
3491
|
+
(attributionProps || sourceTitle) && /* @__PURE__ */ jsxRuntime.jsxs("figcaption", { className: "usx-quote__attribution", children: [
|
|
3492
|
+
attributionProps && /* @__PURE__ */ jsxRuntime.jsx(Attribution, { ...attributionProps }),
|
|
3493
|
+
sourceTitle && /* @__PURE__ */ jsxRuntime.jsx("cite", { children: sourceLinkProps ? /* @__PURE__ */ jsxRuntime.jsx(Link, { ...sourceLinkProps, children: sourceTitle }) : sourceTitle })
|
|
3494
|
+
] })
|
|
3495
|
+
] }) })
|
|
3496
|
+
] });
|
|
3497
|
+
}
|
|
3456
3498
|
const RadioButtons = ({
|
|
3457
3499
|
tile = false,
|
|
3458
3500
|
small = false,
|
|
@@ -3466,13 +3508,13 @@
|
|
|
3466
3508
|
className = "",
|
|
3467
3509
|
...props
|
|
3468
3510
|
}) => {
|
|
3469
|
-
const classes =
|
|
3511
|
+
const classes = ClassNames(
|
|
3470
3512
|
"usa-radio",
|
|
3471
3513
|
"usx-radio",
|
|
3472
3514
|
{ "usx-radio--small": small },
|
|
3473
3515
|
className
|
|
3474
3516
|
);
|
|
3475
|
-
const inputClasses =
|
|
3517
|
+
const inputClasses = ClassNames(
|
|
3476
3518
|
"usa-radio__input",
|
|
3477
3519
|
{ "usa-radio__input--tile": tile }
|
|
3478
3520
|
);
|
|
@@ -3527,7 +3569,7 @@
|
|
|
3527
3569
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3528
3570
|
"input",
|
|
3529
3571
|
{
|
|
3530
|
-
className:
|
|
3572
|
+
className: ClassNames("usa-range", "usx-range-slider", className),
|
|
3531
3573
|
id,
|
|
3532
3574
|
type: "range",
|
|
3533
3575
|
name: name || id,
|
|
@@ -3549,15 +3591,17 @@
|
|
|
3549
3591
|
}
|
|
3550
3592
|
const Section = ({
|
|
3551
3593
|
title = "",
|
|
3594
|
+
headingLevel = "h2",
|
|
3552
3595
|
children = null,
|
|
3553
3596
|
content = null,
|
|
3554
3597
|
className = "",
|
|
3555
3598
|
...props
|
|
3556
3599
|
}) => {
|
|
3557
|
-
const classes =
|
|
3600
|
+
const classes = ClassNames("usx-section", className);
|
|
3558
3601
|
const sectionContent = children || content;
|
|
3602
|
+
const Heading = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(headingLevel) ? headingLevel : "h2";
|
|
3559
3603
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: classes, ...props, children: [
|
|
3560
|
-
title ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3604
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx(Heading, { className: "usx-section__title", children: title }) : null,
|
|
3561
3605
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-section__content", children: sectionContent })
|
|
3562
3606
|
] });
|
|
3563
3607
|
};
|
|
@@ -3584,7 +3628,7 @@
|
|
|
3584
3628
|
className = "",
|
|
3585
3629
|
...props
|
|
3586
3630
|
}) => {
|
|
3587
|
-
const classes =
|
|
3631
|
+
const classes = ClassNames(
|
|
3588
3632
|
"usa-sidenav",
|
|
3589
3633
|
"usx-sidenav",
|
|
3590
3634
|
{
|
|
@@ -3610,7 +3654,7 @@
|
|
|
3610
3654
|
}) => {
|
|
3611
3655
|
const normalizedVariant = ["info", "emergency", "maintenance", "maintenance-warning"].includes(variant) ? variant : "info";
|
|
3612
3656
|
const alertVariant = normalizedVariant === "maintenance" ? "error" : normalizedVariant === "maintenance-warning" ? "warning" : normalizedVariant;
|
|
3613
|
-
const classes =
|
|
3657
|
+
const classes = ClassNames(
|
|
3614
3658
|
"usa-site-alert",
|
|
3615
3659
|
"usx-site-alert",
|
|
3616
3660
|
(normalizedVariant === "info" || normalizedVariant === "emergency") && `usa-site-alert--${normalizedVariant}`,
|
|
@@ -3619,8 +3663,8 @@
|
|
|
3619
3663
|
noIcon && "usa-site-alert--no-icon",
|
|
3620
3664
|
onDismiss && "usa-site-alert--dismissible",
|
|
3621
3665
|
className
|
|
3622
|
-
|
|
3623
|
-
const alertClasses =
|
|
3666
|
+
);
|
|
3667
|
+
const alertClasses = ClassNames(
|
|
3624
3668
|
"usa-alert",
|
|
3625
3669
|
`usa-alert--${alertVariant}`,
|
|
3626
3670
|
"usx-alert",
|
|
@@ -3629,7 +3673,7 @@
|
|
|
3629
3673
|
slim && "usx-alert--slim",
|
|
3630
3674
|
noIcon && "usa-alert--no-icon",
|
|
3631
3675
|
noIcon && "usx-alert--no-icon"
|
|
3632
|
-
|
|
3676
|
+
);
|
|
3633
3677
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3634
3678
|
"section",
|
|
3635
3679
|
{
|
|
@@ -3683,7 +3727,7 @@
|
|
|
3683
3727
|
className = "",
|
|
3684
3728
|
...props
|
|
3685
3729
|
}) => {
|
|
3686
|
-
const classes =
|
|
3730
|
+
const classes = ClassNames("usa-skipnav", className);
|
|
3687
3731
|
const finalHref = normalizeHref({ href, target });
|
|
3688
3732
|
return /* @__PURE__ */ jsxRuntime.jsx("a", { className: classes, href: finalHref, ...props, children: children || content || "Skip to main content" });
|
|
3689
3733
|
};
|
|
@@ -3694,7 +3738,7 @@
|
|
|
3694
3738
|
className = "",
|
|
3695
3739
|
...props
|
|
3696
3740
|
}) => {
|
|
3697
|
-
const classes =
|
|
3741
|
+
const classes = ClassNames(
|
|
3698
3742
|
"usx-status",
|
|
3699
3743
|
color && `text-${color}`,
|
|
3700
3744
|
size && `usx-status--${size}`,
|
|
@@ -3713,7 +3757,7 @@
|
|
|
3713
3757
|
}) => {
|
|
3714
3758
|
var _a;
|
|
3715
3759
|
const step = Number(currentStep);
|
|
3716
|
-
const classes =
|
|
3760
|
+
const classes = ClassNames(
|
|
3717
3761
|
"usa-step-indicator",
|
|
3718
3762
|
"usx-step-indicator",
|
|
3719
3763
|
variant && `usa-step-indicator--${variant}`,
|
|
@@ -3732,7 +3776,7 @@
|
|
|
3732
3776
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3733
3777
|
"li",
|
|
3734
3778
|
{
|
|
3735
|
-
className:
|
|
3779
|
+
className: ClassNames(
|
|
3736
3780
|
"usa-step-indicator__segment",
|
|
3737
3781
|
status === "complete" && "usa-step-indicator__segment--complete",
|
|
3738
3782
|
status === "current" && "usa-step-indicator__segment--current"
|
|
@@ -3770,7 +3814,7 @@
|
|
|
3770
3814
|
className = "",
|
|
3771
3815
|
...props
|
|
3772
3816
|
}) => {
|
|
3773
|
-
const classes =
|
|
3817
|
+
const classes = ClassNames("usa-summary-box", "usx-summary-box", className);
|
|
3774
3818
|
const headingId = id;
|
|
3775
3819
|
const bodyContent = children ?? content;
|
|
3776
3820
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3800,9 +3844,9 @@
|
|
|
3800
3844
|
...props
|
|
3801
3845
|
}) => {
|
|
3802
3846
|
const variantClass = variant !== "default" ? `usx-swap--${variant}` : "";
|
|
3803
|
-
const classes =
|
|
3804
|
-
const onClasses =
|
|
3805
|
-
const offClasses =
|
|
3847
|
+
const classes = ClassNames("usx-swap", variantClass, className);
|
|
3848
|
+
const onClasses = ClassNames("usx-swap-on", onClassName);
|
|
3849
|
+
const offClasses = ClassNames("usx-swap-off", offClassName);
|
|
3806
3850
|
const content = children || /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3807
3851
|
includeInput ? /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", autoComplete: "off", ...inputProps }) : null,
|
|
3808
3852
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: onClasses, children: onContent }),
|
|
@@ -3824,7 +3868,7 @@
|
|
|
3824
3868
|
indeterminate = false,
|
|
3825
3869
|
...props
|
|
3826
3870
|
}) => {
|
|
3827
|
-
const classes =
|
|
3871
|
+
const classes = ClassNames(
|
|
3828
3872
|
"usx-switch",
|
|
3829
3873
|
size && `usx-toggle-${size}`,
|
|
3830
3874
|
variant && `text-${variant}`,
|
|
@@ -3932,7 +3976,7 @@
|
|
|
3932
3976
|
function TableHead({ className = "", children, ...props }) {
|
|
3933
3977
|
const { id, columns, sortState, handleSort, selectionMode, selectionPosition, handleSelectAll, allowSelectAll, rowDetails } = useTableContext();
|
|
3934
3978
|
if (children) {
|
|
3935
|
-
return /* @__PURE__ */ jsxRuntime.jsx("thead", { className:
|
|
3979
|
+
return /* @__PURE__ */ jsxRuntime.jsx("thead", { className: ClassNames("usx-table__head", className), ...props, children });
|
|
3936
3980
|
}
|
|
3937
3981
|
const visibleCols = columns.filter((c) => !c.hidden);
|
|
3938
3982
|
const totalDepth = getDepth(visibleCols);
|
|
@@ -3940,7 +3984,7 @@
|
|
|
3940
3984
|
const hasRowDetails = !!rowDetails;
|
|
3941
3985
|
const hasSelection = !!selectionMode;
|
|
3942
3986
|
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" }) });
|
|
3943
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("thead", { className:
|
|
3987
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("thead", { className: ClassNames("usx-table__head", className), ...props, children: [
|
|
3944
3988
|
/* @__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` }) }) }),
|
|
3945
3989
|
headerRows.map((row, rowIndex) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "usx-table__head-row", children: [
|
|
3946
3990
|
hasRowDetails && rowIndex === 0 && /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", rowSpan: totalDepth, className: "usx-table__cell usx-table__cell--detail-toggle", "aria-label": "Row details" }),
|
|
@@ -3948,7 +3992,7 @@
|
|
|
3948
3992
|
row.map(({ col, rowSpan, colSpan }) => {
|
|
3949
3993
|
const isSortable = col.sortable === true;
|
|
3950
3994
|
const sortDir = sortState.key === col.key ? sortState.direction : null;
|
|
3951
|
-
const cellClasses =
|
|
3995
|
+
const cellClasses = ClassNames(
|
|
3952
3996
|
"usx-table__cell",
|
|
3953
3997
|
col.headerAlign && `usx-table__cell--align-${col.headerAlign}`,
|
|
3954
3998
|
!col.headerAlign && col.align && `usx-table__cell--align-${col.align}`,
|
|
@@ -3969,7 +4013,7 @@
|
|
|
3969
4013
|
"button",
|
|
3970
4014
|
{
|
|
3971
4015
|
type: "button",
|
|
3972
|
-
className:
|
|
4016
|
+
className: ClassNames("usx-table__sort-button", sortDir && "usx-table__sort-button--active"),
|
|
3973
4017
|
onClick: () => handleSort(col.key),
|
|
3974
4018
|
children: [
|
|
3975
4019
|
col.header,
|
|
@@ -3996,7 +4040,7 @@
|
|
|
3996
4040
|
}) {
|
|
3997
4041
|
const { onClickRow } = useTableContext();
|
|
3998
4042
|
const isClickable = !!(onClick || onClickRow);
|
|
3999
|
-
const classes =
|
|
4043
|
+
const classes = ClassNames(
|
|
4000
4044
|
"usx-table__row",
|
|
4001
4045
|
selected && "usx-table__row--selected",
|
|
4002
4046
|
disabled && "usx-table__row--disabled",
|
|
@@ -4042,7 +4086,7 @@
|
|
|
4042
4086
|
}
|
|
4043
4087
|
};
|
|
4044
4088
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4045
|
-
/* @__PURE__ */ jsxRuntime.jsx("tr", { className:
|
|
4089
|
+
/* @__PURE__ */ jsxRuntime.jsx("tr", { className: ClassNames("usx-table__group-row", className), ...props, 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(
|
|
4046
4090
|
"button",
|
|
4047
4091
|
{
|
|
4048
4092
|
type: "button",
|
|
@@ -4145,7 +4189,7 @@
|
|
|
4145
4189
|
"button",
|
|
4146
4190
|
{
|
|
4147
4191
|
type: "button",
|
|
4148
|
-
className:
|
|
4192
|
+
className: ClassNames(
|
|
4149
4193
|
"usa-button usa-button--unstyled",
|
|
4150
4194
|
"usx-table__detail-toggle",
|
|
4151
4195
|
"width-full",
|
|
@@ -4158,7 +4202,7 @@
|
|
|
4158
4202
|
) }, "__detail-toggle__") : null;
|
|
4159
4203
|
const dataCells = visibleCols.map((col) => {
|
|
4160
4204
|
const Tag2 = col.primary ? "th" : "td";
|
|
4161
|
-
const cellClasses =
|
|
4205
|
+
const cellClasses = ClassNames("usx-table__cell", col.align && `usx-table__cell--align-${col.align}`, col.className);
|
|
4162
4206
|
const dataLabel = responsive === "stack" || responsive === "stack-header" ? getDataLabel(col) : void 0;
|
|
4163
4207
|
const content = col.render ? col.render(row, rowIndex) : row[col.key];
|
|
4164
4208
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4185,7 +4229,7 @@
|
|
|
4185
4229
|
}
|
|
4186
4230
|
function TableBody({ className = "", children, ...props }) {
|
|
4187
4231
|
const { data, primaryKey, groupBy, groups, placeholder, totalCols, onMore, loading } = useTableContext();
|
|
4188
|
-
const bodyClass =
|
|
4232
|
+
const bodyClass = ClassNames("usx-table__body", className);
|
|
4189
4233
|
if (children) {
|
|
4190
4234
|
return /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: bodyClass, ...props, children });
|
|
4191
4235
|
}
|
|
@@ -4229,12 +4273,12 @@
|
|
|
4229
4273
|
function TableFoot({ className = "", children, ...props }) {
|
|
4230
4274
|
const { columns, data, selectionMode, rowDetails } = useTableContext();
|
|
4231
4275
|
if (children) {
|
|
4232
|
-
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className:
|
|
4276
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...props, children });
|
|
4233
4277
|
}
|
|
4234
4278
|
const visibleCols = columns.filter((c) => !c.hidden);
|
|
4235
4279
|
const hasFooter = visibleCols.some((c) => c.footer !== void 0 || c.aggregate);
|
|
4236
4280
|
if (!hasFooter) return null;
|
|
4237
|
-
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className:
|
|
4281
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "usx-table__foot-row", children: [
|
|
4238
4282
|
!!rowDetails && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__cell" }),
|
|
4239
4283
|
!!selectionMode && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__cell usx-table__cell--selection" }),
|
|
4240
4284
|
visibleCols.map((col) => {
|
|
@@ -4244,7 +4288,7 @@
|
|
|
4244
4288
|
} else if (col.aggregate) {
|
|
4245
4289
|
content = aggregate(data, col.key, col.aggregate);
|
|
4246
4290
|
}
|
|
4247
|
-
return /* @__PURE__ */ jsxRuntime.jsx("td", { className:
|
|
4291
|
+
return /* @__PURE__ */ jsxRuntime.jsx("td", { className: ClassNames("usx-table__cell", col.align && `usx-table__cell--align-${col.align}`), children: content }, col.key);
|
|
4248
4292
|
})
|
|
4249
4293
|
] }) });
|
|
4250
4294
|
}
|
|
@@ -4261,7 +4305,7 @@
|
|
|
4261
4305
|
...props
|
|
4262
4306
|
}) {
|
|
4263
4307
|
const resolvedAlign = Tag2 === "th" ? headerAlign || align : align;
|
|
4264
|
-
const classes =
|
|
4308
|
+
const classes = ClassNames("usx-table__cell", resolvedAlign && `usx-table__cell--align-${resolvedAlign}`, className);
|
|
4265
4309
|
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, colSpan, rowSpan, scope, "data-label": dataLabel, ...props, children });
|
|
4266
4310
|
}
|
|
4267
4311
|
function defaultCompareFn(a, b, key) {
|
|
@@ -4433,7 +4477,7 @@
|
|
|
4433
4477
|
}, 0);
|
|
4434
4478
|
}
|
|
4435
4479
|
function Caption({ className = "", children, ...rest }) {
|
|
4436
|
-
return /* @__PURE__ */ jsxRuntime.jsx("caption", { className:
|
|
4480
|
+
return /* @__PURE__ */ jsxRuntime.jsx("caption", { className: ClassNames("usx-table__caption", className), ...rest, children });
|
|
4437
4481
|
}
|
|
4438
4482
|
function Table({
|
|
4439
4483
|
id: idProp,
|
|
@@ -4573,7 +4617,7 @@
|
|
|
4573
4617
|
loading
|
|
4574
4618
|
]
|
|
4575
4619
|
);
|
|
4576
|
-
const tableClasses =
|
|
4620
|
+
const tableClasses = ClassNames(
|
|
4577
4621
|
"usa-table",
|
|
4578
4622
|
striped && "usa-table--striped",
|
|
4579
4623
|
borderless && "usa-table--borderless",
|
|
@@ -4643,7 +4687,7 @@
|
|
|
4643
4687
|
className = "",
|
|
4644
4688
|
...props
|
|
4645
4689
|
}) => {
|
|
4646
|
-
const classes =
|
|
4690
|
+
const classes = ClassNames(
|
|
4647
4691
|
"usx-tag-group",
|
|
4648
4692
|
className
|
|
4649
4693
|
);
|
|
@@ -4651,7 +4695,7 @@
|
|
|
4651
4695
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props, children: content });
|
|
4652
4696
|
};
|
|
4653
4697
|
function TaskList({ tasks = [], className }) {
|
|
4654
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className:
|
|
4698
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: ClassNames("usx-task-list", className), children: tasks == null ? void 0 : tasks.map((task, i) => {
|
|
4655
4699
|
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(Clickable, { href: task.href, className: "usx-task-list__item", children: [
|
|
4656
4700
|
task.hint ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "display-flex flex-column", children: [
|
|
4657
4701
|
/* @__PURE__ */ jsxRuntime.jsx(Clickable.Link, { className: "usx-task-list__link", children: task.name }),
|
|
@@ -4683,7 +4727,7 @@
|
|
|
4683
4727
|
onChange == null ? void 0 : onChange(next);
|
|
4684
4728
|
};
|
|
4685
4729
|
const selectId = id || `theme-picker-${Math.random().toString(36).substr(2, 9)}`;
|
|
4686
|
-
const classes =
|
|
4730
|
+
const classes = ClassNames("usx-theme-picker", { "usx-theme-picker--open": open }, className);
|
|
4687
4731
|
const themeOptions = themes.map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: option.value, children: option.label }, option.value));
|
|
4688
4732
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, children: open ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-theme-picker__panel", children: [
|
|
4689
4733
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: selectId, screenReaderOnly: true, children: label }),
|
|
@@ -4755,7 +4799,7 @@
|
|
|
4755
4799
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4756
4800
|
"div",
|
|
4757
4801
|
{
|
|
4758
|
-
className:
|
|
4802
|
+
className: ClassNames(
|
|
4759
4803
|
"usa-time-picker",
|
|
4760
4804
|
"usx-time-picker",
|
|
4761
4805
|
{ "usx-combo-box--error": !!error },
|
|
@@ -4784,74 +4828,83 @@
|
|
|
4784
4828
|
] });
|
|
4785
4829
|
return formGroup ? /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: content }) : content;
|
|
4786
4830
|
}
|
|
4787
|
-
|
|
4831
|
+
function Toggle({
|
|
4788
4832
|
options = [],
|
|
4789
4833
|
value,
|
|
4790
4834
|
defaultValue,
|
|
4791
4835
|
onChange,
|
|
4792
4836
|
name,
|
|
4793
4837
|
id,
|
|
4838
|
+
ariaLabel,
|
|
4794
4839
|
variant = "text",
|
|
4795
4840
|
disabled = false,
|
|
4796
|
-
|
|
4841
|
+
required = false,
|
|
4842
|
+
className,
|
|
4843
|
+
"aria-label": nativeAriaLabel,
|
|
4844
|
+
"aria-labelledby": labelledBy,
|
|
4797
4845
|
...props
|
|
4798
|
-
})
|
|
4799
|
-
const
|
|
4800
|
-
const
|
|
4801
|
-
const
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
"
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
const optDisabled = typeof opt === "object" ? !!opt.disabled : false;
|
|
4814
|
-
const inputId = `${generatedName}-${i}`;
|
|
4815
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: `usa-button-group__item usx-toggle__item${optDisabled ? " usx-toggle__item--disabled" : ""}`, children: [
|
|
4816
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4817
|
-
"input",
|
|
4818
|
-
{
|
|
4819
|
-
className: "usx-toggle__input",
|
|
4820
|
-
type: "radio",
|
|
4821
|
-
id: inputId,
|
|
4822
|
-
name: name || generatedName,
|
|
4823
|
-
value: optValue,
|
|
4824
|
-
checked: value === optValue ? true : void 0,
|
|
4825
|
-
defaultChecked: defaultValue === optValue ? true : void 0,
|
|
4826
|
-
disabled: disabled ? true : optDisabled ? true : void 0,
|
|
4827
|
-
onChange: onChange ? () => onChange(optValue) : void 0
|
|
4828
|
-
}
|
|
4846
|
+
}) {
|
|
4847
|
+
const instanceId = React.useId();
|
|
4848
|
+
const groupId = id || `toggle-${instanceId}`;
|
|
4849
|
+
const groupName = name || groupId;
|
|
4850
|
+
const controlled = value !== void 0;
|
|
4851
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4852
|
+
"ul",
|
|
4853
|
+
{
|
|
4854
|
+
...props,
|
|
4855
|
+
id: groupId,
|
|
4856
|
+
className: ClassNames(
|
|
4857
|
+
"usx-toggle",
|
|
4858
|
+
"usa-button-group",
|
|
4859
|
+
variant === "icon" && "usx-toggle--icon",
|
|
4860
|
+
className
|
|
4829
4861
|
),
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4862
|
+
role: "radiogroup",
|
|
4863
|
+
"aria-labelledby": labelledBy,
|
|
4864
|
+
"aria-label": labelledBy ? void 0 : ariaLabel || nativeAriaLabel || name || "Choose an option",
|
|
4865
|
+
"aria-disabled": disabled || void 0,
|
|
4866
|
+
"aria-required": required || void 0,
|
|
4867
|
+
children: options.map((option, index) => {
|
|
4868
|
+
const opt = typeof option === "object" ? option : { value: option, label: option };
|
|
4869
|
+
const optionValue = opt.value ?? (typeof opt.label === "string" || typeof opt.label === "number" ? opt.label : index);
|
|
4870
|
+
const optionLabel = opt.label ?? String(optionValue);
|
|
4871
|
+
const inputId = `${groupId}-option-${index}`;
|
|
4872
|
+
const iconOnly = variant === "icon" && Boolean(opt.icon);
|
|
4873
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "usa-button-group__item", role: "presentation", children: [
|
|
4874
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4875
|
+
"input",
|
|
4876
|
+
{
|
|
4877
|
+
className: "usx-toggle__input",
|
|
4878
|
+
type: "radio",
|
|
4879
|
+
id: inputId,
|
|
4880
|
+
name: groupName,
|
|
4881
|
+
value: optionValue,
|
|
4882
|
+
...controlled ? { checked: value === optionValue } : { defaultChecked: defaultValue === optionValue },
|
|
4883
|
+
disabled: disabled || opt.disabled,
|
|
4884
|
+
required,
|
|
4885
|
+
onChange: (event) => {
|
|
4886
|
+
if (event.target.checked) onChange == null ? void 0 : onChange(optionValue);
|
|
4887
|
+
}
|
|
4888
|
+
}
|
|
4889
|
+
),
|
|
4890
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4891
|
+
"label",
|
|
4892
|
+
{
|
|
4893
|
+
htmlFor: inputId,
|
|
4894
|
+
className: "usa-button usx-button usa-button--primary usx-toggle__button",
|
|
4895
|
+
"aria-disabled": disabled || opt.disabled || void 0,
|
|
4896
|
+
title: iconOnly && (typeof optionLabel === "string" || typeof optionLabel === "number") ? String(optionLabel) : void 0,
|
|
4897
|
+
children: [
|
|
4898
|
+
opt.icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: opt.icon, className: "usx-toggle__icon", "aria-hidden": "true" }),
|
|
4899
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: iconOnly ? "usa-sr-only" : void 0, children: optionLabel })
|
|
4900
|
+
]
|
|
4901
|
+
}
|
|
4902
|
+
)
|
|
4903
|
+
] }, inputId);
|
|
4904
|
+
})
|
|
4905
|
+
}
|
|
4906
|
+
);
|
|
4907
|
+
}
|
|
4855
4908
|
const Villain = ({
|
|
4856
4909
|
title = "",
|
|
4857
4910
|
callout = "",
|
|
@@ -4861,7 +4914,7 @@
|
|
|
4861
4914
|
className = "",
|
|
4862
4915
|
...props
|
|
4863
4916
|
}) => {
|
|
4864
|
-
const classes =
|
|
4917
|
+
const classes = ClassNames("usa-hero", className);
|
|
4865
4918
|
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: classes, "aria-label": ariaLabel, ...props, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-container", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-hero__callout", children: [
|
|
4866
4919
|
/* @__PURE__ */ jsxRuntime.jsxs("h1", { className: "usa-hero__heading", children: [
|
|
4867
4920
|
callout && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-hero__heading--alt", children: callout }),
|
|
@@ -4878,11 +4931,11 @@
|
|
|
4878
4931
|
exports2.AvatarGroup = AvatarGroup;
|
|
4879
4932
|
exports2.BackToTop = BackToTop;
|
|
4880
4933
|
exports2.Banner = Banner;
|
|
4881
|
-
exports2.Block = Block;
|
|
4882
4934
|
exports2.Breadcrumb = Breadcrumb;
|
|
4883
4935
|
exports2.Button = Button;
|
|
4884
4936
|
exports2.ButtonGroup = ButtonGroup;
|
|
4885
4937
|
exports2.CalendarDate = CalendarDate;
|
|
4938
|
+
exports2.Callout = Callout;
|
|
4886
4939
|
exports2.Card = Card;
|
|
4887
4940
|
exports2.CardGroup = CardGroup;
|
|
4888
4941
|
exports2.Carousel = Carousel;
|
|
@@ -4926,6 +4979,7 @@
|
|
|
4926
4979
|
exports2.Pagination = Pagination;
|
|
4927
4980
|
exports2.ProcessList = ProcessList;
|
|
4928
4981
|
exports2.Prose = Prose;
|
|
4982
|
+
exports2.Quote = Quote;
|
|
4929
4983
|
exports2.RadioButtons = RadioButtons;
|
|
4930
4984
|
exports2.RangeSlider = RangeSlider;
|
|
4931
4985
|
exports2.Required = Required;
|