@solexllc/usx-react 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -0
- package/dist/index.cjs +262 -183
- package/dist/index.js +262 -183
- package/package.json +5 -5
- package/src/components/callout/Callout.tsx +1 -1
- package/src/components/callout/callout.django.html +1 -1
- package/src/components/callout/callout.html +3 -3
- package/src/components/clickable/clickable.html +1 -1
- package/src/components/container/Container.tsx +108 -0
- package/src/components/container/_layout-classes.django.html +12 -0
- package/src/components/container/config.json +288 -0
- package/src/components/container/container.django.html +13 -0
- package/src/components/container/container.html +125 -0
- package/src/components/quote/quote.html +4 -4
- package/src/index.js +1 -0
package/dist/index.cjs
CHANGED
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
className = "",
|
|
124
124
|
headingClassName = "",
|
|
125
125
|
contentClassName = "",
|
|
126
|
-
...
|
|
126
|
+
...props2
|
|
127
127
|
}) {
|
|
128
128
|
const accordionClasses = ClassNames(
|
|
129
129
|
"usa-accordion",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
id,
|
|
139
139
|
className: accordionClasses,
|
|
140
140
|
"data-allow-multiple": multiselectable ? true : void 0,
|
|
141
|
-
...
|
|
141
|
+
...props2,
|
|
142
142
|
children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
143
143
|
AccordionItem,
|
|
144
144
|
{
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
staticBaseUrl,
|
|
170
170
|
staticUrlPrefix,
|
|
171
171
|
className = "",
|
|
172
|
-
...
|
|
172
|
+
...props2
|
|
173
173
|
}) {
|
|
174
174
|
const spritePrefix = staticUrlPrefix ?? getAssetUrl(`img/${source === "usx" ? "usx-sprite.svg" : "sprite.svg"}#`, staticBaseUrl);
|
|
175
175
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"aria-label": alt,
|
|
181
181
|
focusable: "false",
|
|
182
182
|
role: "img",
|
|
183
|
-
...
|
|
183
|
+
...props2,
|
|
184
184
|
children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: spritePrefix + name })
|
|
185
185
|
}
|
|
186
186
|
);
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
onDismiss = void 0,
|
|
199
199
|
staticBaseUrl,
|
|
200
200
|
children = null,
|
|
201
|
-
...
|
|
201
|
+
...props2
|
|
202
202
|
}) {
|
|
203
203
|
const normalizedVariant = variant && ["info", "warning", "success", "error", "emergency"].includes(variant) ? variant : null;
|
|
204
204
|
const classes = ClassNames(
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
} else if (resolvedRole === "region") {
|
|
221
221
|
accessibilityProps["aria-label"] = heading || `${normalizedVariant} alert`;
|
|
222
222
|
}
|
|
223
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...accessibilityProps, ...
|
|
223
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...accessibilityProps, ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-alert__body", children: [
|
|
224
224
|
!slim && heading ? /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-alert__heading", children: heading }) : null,
|
|
225
225
|
children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-alert__text", children }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "usa-alert__text", children: text }),
|
|
226
226
|
onDismiss && /* @__PURE__ */ jsxRuntime.jsx("button", { className: "usx-alert__dismiss", "aria-label": "Dismiss alert", onClick: onDismiss, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "close", size: 3, staticBaseUrl }) })
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
className = "",
|
|
245
245
|
imageClassName = "",
|
|
246
246
|
contentClassName = "",
|
|
247
|
-
...
|
|
247
|
+
...props2
|
|
248
248
|
}) {
|
|
249
249
|
const isInitialsVariant = variant === "initials";
|
|
250
250
|
const isIconVariant = variant === "icon";
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
shape ? shapeClassMap[shape] : "usx-circle",
|
|
263
263
|
contentClassName
|
|
264
264
|
);
|
|
265
|
-
const avatarContent = isInitialsVariant ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: contentClasses, children: value }) : isIconVariant ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: contentClasses, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: value, alt: alt || `${value} icon` }) }) : /* @__PURE__ */ jsxRuntime.jsx("img", { className: imgClasses, src: src || void 0, alt: alt || void 0, role: "img", ...
|
|
265
|
+
const avatarContent = isInitialsVariant ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: contentClasses, children: value }) : isIconVariant ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: contentClasses, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: value, alt: alt || `${value} icon` }) }) : /* @__PURE__ */ jsxRuntime.jsx("img", { className: imgClasses, src: src || void 0, alt: alt || void 0, role: "img", ...props2 });
|
|
266
266
|
const avatar = /* @__PURE__ */ jsxRuntime.jsx("a", { href, className: wrapperClasses, "aria-label": isInitialsVariant || isIconVariant ? alt || void 0 : void 0, children: avatarContent });
|
|
267
267
|
if (tooltip) {
|
|
268
268
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "usx-tooltip", children: [
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
secondary,
|
|
280
280
|
children = null,
|
|
281
281
|
className = "",
|
|
282
|
-
...
|
|
282
|
+
...props2
|
|
283
283
|
}) {
|
|
284
284
|
const classes = ClassNames("usx-attribution", className);
|
|
285
285
|
const mediaContent = avatarProps ? /* @__PURE__ */ jsxRuntime.jsx(Avatar, { ...avatarProps }) : media;
|
|
@@ -290,16 +290,16 @@
|
|
|
290
290
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-attribution__secondary", children: secondary })
|
|
291
291
|
] })
|
|
292
292
|
] });
|
|
293
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
293
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: content });
|
|
294
294
|
}
|
|
295
|
-
function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, className = "", ...
|
|
295
|
+
function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, className = "", ...props2 }) {
|
|
296
296
|
const classes = ClassNames(
|
|
297
297
|
"usx-avatar-group",
|
|
298
298
|
overlap && "usa-avatar-group--overlap",
|
|
299
299
|
stacked && "usa-avatar-group--stacked",
|
|
300
300
|
className
|
|
301
301
|
);
|
|
302
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
302
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: avatarProps.map((avatar, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
303
303
|
Avatar,
|
|
304
304
|
{
|
|
305
305
|
href: avatar.href,
|
|
@@ -323,7 +323,7 @@
|
|
|
323
323
|
iconSize = 2,
|
|
324
324
|
className = "",
|
|
325
325
|
onClick = void 0,
|
|
326
|
-
...
|
|
326
|
+
...props2
|
|
327
327
|
}) {
|
|
328
328
|
const icon = /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "arrow_upward", size: iconSize, className: ClassNames(
|
|
329
329
|
iconPosition === "left" ? "margin-right-05" : "margin-left-05"
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
"flex-align-center",
|
|
336
336
|
className
|
|
337
337
|
);
|
|
338
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("a", { className: linkClasses, href, ...
|
|
338
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("a", { className: linkClasses, href, ...props2, children: [
|
|
339
339
|
iconPosition === "left" && icon,
|
|
340
340
|
label,
|
|
341
341
|
iconPosition === "right" && icon
|
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
type: "button",
|
|
355
355
|
className: buttonClasses,
|
|
356
356
|
onClick: onClick || (() => window.scrollTo({ top: 0, behavior: "smooth" })),
|
|
357
|
-
...
|
|
357
|
+
...props2,
|
|
358
358
|
children: [
|
|
359
359
|
iconPosition === "left" && icon,
|
|
360
360
|
label,
|
|
@@ -386,14 +386,14 @@
|
|
|
386
386
|
" website. Share sensitive information only on official, secure websites."
|
|
387
387
|
] }),
|
|
388
388
|
className = "",
|
|
389
|
-
...
|
|
389
|
+
...props2
|
|
390
390
|
}) {
|
|
391
391
|
const classes = ClassNames(
|
|
392
392
|
"usa-banner",
|
|
393
393
|
"usx-banner",
|
|
394
394
|
className
|
|
395
395
|
);
|
|
396
|
-
return /* @__PURE__ */ jsxRuntime.jsx("section", { id, className: classes, "aria-label": ariaLabel, ...
|
|
396
|
+
return /* @__PURE__ */ jsxRuntime.jsx("section", { id, className: classes, "aria-label": ariaLabel, ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { id: `${id}-accordion`, className: "usa-accordion", children: [
|
|
397
397
|
/* @__PURE__ */ jsxRuntime.jsx("header", { className: "usa-banner__header", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-banner__inner", children: [
|
|
398
398
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-col-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
399
399
|
"img",
|
|
@@ -480,11 +480,11 @@
|
|
|
480
480
|
ariaLabel = "Breadcrumbs",
|
|
481
481
|
className = "",
|
|
482
482
|
children = null,
|
|
483
|
-
...
|
|
483
|
+
...props2
|
|
484
484
|
}) {
|
|
485
485
|
if (!items || items.length === 0) {
|
|
486
486
|
const classes = ClassNames("usx-breadcrumb", className);
|
|
487
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
487
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: children || "Breadcrumb" });
|
|
488
488
|
}
|
|
489
489
|
const navClasses = ClassNames(
|
|
490
490
|
"usa-breadcrumb",
|
|
@@ -493,7 +493,7 @@
|
|
|
493
493
|
truncate ? "usa-breadcrumb--truncate" : null,
|
|
494
494
|
className
|
|
495
495
|
);
|
|
496
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: navClasses, "aria-label": ariaLabel, ...
|
|
496
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: navClasses, "aria-label": ariaLabel, ...props2, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
497
497
|
"ol",
|
|
498
498
|
{
|
|
499
499
|
className: "usa-breadcrumb__list",
|
|
@@ -530,11 +530,11 @@
|
|
|
530
530
|
title = "Required",
|
|
531
531
|
children = null,
|
|
532
532
|
className = "",
|
|
533
|
-
...
|
|
533
|
+
...props2
|
|
534
534
|
}) => {
|
|
535
535
|
const classes = ClassNames("usx-required", className);
|
|
536
536
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
537
|
-
/* @__PURE__ */ jsxRuntime.jsx("abbr", { title, className: classes, ...
|
|
537
|
+
/* @__PURE__ */ jsxRuntime.jsx("abbr", { title, className: classes, ...props2, children: "*" }),
|
|
538
538
|
" ",
|
|
539
539
|
children ? children : ""
|
|
540
540
|
] });
|
|
@@ -547,7 +547,7 @@
|
|
|
547
547
|
screenReaderOnly = false,
|
|
548
548
|
className = "",
|
|
549
549
|
classOverride = false,
|
|
550
|
-
...
|
|
550
|
+
...props2
|
|
551
551
|
}) {
|
|
552
552
|
const classes = ClassNames(
|
|
553
553
|
"usa-label",
|
|
@@ -560,7 +560,7 @@
|
|
|
560
560
|
{
|
|
561
561
|
className: classOverride ? className : classes,
|
|
562
562
|
...htmlFor ? { htmlFor } : {},
|
|
563
|
-
...
|
|
563
|
+
...props2,
|
|
564
564
|
children: [
|
|
565
565
|
required && /* @__PURE__ */ jsxRuntime.jsx(Required, {}),
|
|
566
566
|
children
|
|
@@ -576,9 +576,9 @@
|
|
|
576
576
|
staticUrlPrefix,
|
|
577
577
|
staticBaseUrl,
|
|
578
578
|
className = "",
|
|
579
|
-
...
|
|
579
|
+
...props2
|
|
580
580
|
}) => {
|
|
581
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { role: "status", "aria-live": "polite", className: `usx-spinner ${className}`, ...
|
|
581
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { role: "status", "aria-live": "polite", className: `usx-spinner ${className}`, ...props2, children: [
|
|
582
582
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
583
583
|
Icon,
|
|
584
584
|
{
|
|
@@ -609,7 +609,7 @@
|
|
|
609
609
|
className = "",
|
|
610
610
|
children = "",
|
|
611
611
|
extraAttributes = {},
|
|
612
|
-
...
|
|
612
|
+
...props2
|
|
613
613
|
}) {
|
|
614
614
|
const leftIcons = iconProps.filter((icon) => (icon.position ?? "left") === "left");
|
|
615
615
|
const rightIcons = iconProps.filter((icon) => icon.position === "right");
|
|
@@ -640,7 +640,7 @@
|
|
|
640
640
|
const {
|
|
641
641
|
// Remove unused variables
|
|
642
642
|
...anchorProps
|
|
643
|
-
} =
|
|
643
|
+
} = props2;
|
|
644
644
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
645
645
|
"a",
|
|
646
646
|
{
|
|
@@ -661,7 +661,7 @@
|
|
|
661
661
|
const {
|
|
662
662
|
// Remove unused variables
|
|
663
663
|
...buttonProps
|
|
664
|
-
} =
|
|
664
|
+
} = props2;
|
|
665
665
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
666
666
|
"button",
|
|
667
667
|
{
|
|
@@ -684,14 +684,14 @@
|
|
|
684
684
|
buttonProps = [],
|
|
685
685
|
segmented = false,
|
|
686
686
|
className = "",
|
|
687
|
-
...
|
|
687
|
+
...props2
|
|
688
688
|
}) {
|
|
689
689
|
const classes = ClassNames(
|
|
690
690
|
"usa-button-group usx-button-group",
|
|
691
691
|
segmented && "usa-button-group--segmented",
|
|
692
692
|
className
|
|
693
693
|
);
|
|
694
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...
|
|
694
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props2, children: buttonProps.map(({ itemClassName, ...item }, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: ClassNames("usa-button-group__item", itemClassName), children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ...item, children: item.children }) }, index)) });
|
|
695
695
|
}
|
|
696
696
|
function CalendarDate({
|
|
697
697
|
datetime,
|
|
@@ -729,7 +729,7 @@
|
|
|
729
729
|
backgroundColor,
|
|
730
730
|
textColor,
|
|
731
731
|
element = "div",
|
|
732
|
-
...
|
|
732
|
+
...props2
|
|
733
733
|
}) {
|
|
734
734
|
const Element = element;
|
|
735
735
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -738,7 +738,7 @@
|
|
|
738
738
|
className: ClassNames(
|
|
739
739
|
"usx-callout",
|
|
740
740
|
orientation === "vertical" && "usx-callout--vertical",
|
|
741
|
-
strokeColor && `
|
|
741
|
+
strokeColor && `border-${strokeColor}`,
|
|
742
742
|
indent && `usx-callout--indent-${indent}`,
|
|
743
743
|
dedent && "usx-callout--dedent",
|
|
744
744
|
(big ?? orientation === "horizontal") && "usx-callout--big",
|
|
@@ -746,7 +746,7 @@
|
|
|
746
746
|
textColor && `text-${textColor}`,
|
|
747
747
|
className
|
|
748
748
|
),
|
|
749
|
-
...
|
|
749
|
+
...props2,
|
|
750
750
|
children: children ?? content
|
|
751
751
|
}
|
|
752
752
|
);
|
|
@@ -764,7 +764,7 @@
|
|
|
764
764
|
},
|
|
765
765
|
className = "",
|
|
766
766
|
children,
|
|
767
|
-
...
|
|
767
|
+
...props2
|
|
768
768
|
}) => {
|
|
769
769
|
const [isVisible, setIsVisible] = React.useState(!isDismissed);
|
|
770
770
|
const classes = ClassNames(
|
|
@@ -786,7 +786,7 @@
|
|
|
786
786
|
if (!isVisible) {
|
|
787
787
|
return null;
|
|
788
788
|
}
|
|
789
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { id, className: classes, ...
|
|
789
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { id, className: classes, ...props2, children: [
|
|
790
790
|
icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: big ? 3 : 2 }),
|
|
791
791
|
" ",
|
|
792
792
|
children || value,
|
|
@@ -816,7 +816,7 @@
|
|
|
816
816
|
staticBaseUrl,
|
|
817
817
|
srcSet,
|
|
818
818
|
className = "",
|
|
819
|
-
...
|
|
819
|
+
...props2
|
|
820
820
|
}) {
|
|
821
821
|
const classes = ClassNames(
|
|
822
822
|
"usx-image",
|
|
@@ -848,8 +848,8 @@
|
|
|
848
848
|
},
|
|
849
849
|
i
|
|
850
850
|
)),
|
|
851
|
-
/* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src.fallback, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...
|
|
852
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...
|
|
851
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src.fallback, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props2 })
|
|
852
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("img", { src: getAssetUrl(src, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props2 });
|
|
853
853
|
if (caption) {
|
|
854
854
|
return /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: classes, style, children: [
|
|
855
855
|
imgElement,
|
|
@@ -900,12 +900,12 @@
|
|
|
900
900
|
showDots = true,
|
|
901
901
|
children = null,
|
|
902
902
|
slideIds = [],
|
|
903
|
-
...
|
|
903
|
+
...props2
|
|
904
904
|
}) {
|
|
905
905
|
var _a;
|
|
906
906
|
const classes = ClassNames("usx-carousel", className);
|
|
907
907
|
const childArray = React.Children.toArray(children).filter(Boolean);
|
|
908
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...
|
|
908
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props2, role: "region", "aria-roledescription": "carousel", "aria-label": ariaLabel, children: [
|
|
909
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(
|
|
910
910
|
Slide,
|
|
911
911
|
{
|
|
@@ -938,7 +938,7 @@
|
|
|
938
938
|
children,
|
|
939
939
|
className = "",
|
|
940
940
|
tag: RootTag = "div",
|
|
941
|
-
...
|
|
941
|
+
...props2
|
|
942
942
|
}) {
|
|
943
943
|
const cardClasses = ClassNames(
|
|
944
944
|
"usa-card",
|
|
@@ -964,7 +964,7 @@
|
|
|
964
964
|
const media = useCarousel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
965
965
|
Carousel,
|
|
966
966
|
{
|
|
967
|
-
id: `${
|
|
967
|
+
id: `${props2.id || "card"}-carousel`,
|
|
968
968
|
showDots: showCarouselDots,
|
|
969
969
|
className: "usx-card__carousel",
|
|
970
970
|
slides: imageProps == null ? void 0 : imageProps.map((img, index) => ({
|
|
@@ -972,7 +972,7 @@
|
|
|
972
972
|
}))
|
|
973
973
|
}
|
|
974
974
|
) : hasImages ? /* @__PURE__ */ jsxRuntime.jsx(Image, { hideCaption: true, ...imageProps[0], className: ClassNames("usa-card__img", imageProps[0].className) }) : null;
|
|
975
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RootTag, { className: cardClasses, ...
|
|
975
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RootTag, { className: cardClasses, ...props2, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-card__container", children: shouldRenderStructured ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
976
976
|
title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-card__header", children: /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-card__heading", children: title }) }),
|
|
977
977
|
media && /* @__PURE__ */ jsxRuntime.jsx("div", { className: mediaClasses, children: media }),
|
|
978
978
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-card__body", children: [
|
|
@@ -982,33 +982,33 @@
|
|
|
982
982
|
buttonProps && buttonProps.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-card__footer", children: /* @__PURE__ */ jsxRuntime.jsx(ButtonGroup, { buttonProps, className: "flex-wrap" }) })
|
|
983
983
|
] }) : children || "Card" }) });
|
|
984
984
|
}
|
|
985
|
-
function CardGroup({ cardProps = [], className = "", ...
|
|
985
|
+
function CardGroup({ cardProps = [], className = "", ...props2 }) {
|
|
986
986
|
const classes = ClassNames(
|
|
987
987
|
"usa-card-group",
|
|
988
988
|
"usx-card-group",
|
|
989
989
|
className
|
|
990
990
|
);
|
|
991
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...
|
|
991
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props2, children: cardProps.map((card, index) => /* @__PURE__ */ jsxRuntime.jsx(Card, { ...card, tag: "li" }, index)) });
|
|
992
992
|
}
|
|
993
993
|
function Hint({
|
|
994
994
|
id,
|
|
995
995
|
children = null,
|
|
996
996
|
className = "",
|
|
997
|
-
...
|
|
997
|
+
...props2
|
|
998
998
|
}) {
|
|
999
999
|
const classes = ClassNames("usa-hint", "usx-hint", className);
|
|
1000
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...id ? { id } : {}, ...
|
|
1000
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...id ? { id } : {}, ...props2, children });
|
|
1001
1001
|
}
|
|
1002
1002
|
function ErrorMessage({
|
|
1003
1003
|
id,
|
|
1004
1004
|
children = null,
|
|
1005
1005
|
className = "",
|
|
1006
|
-
...
|
|
1006
|
+
...props2
|
|
1007
1007
|
}) {
|
|
1008
1008
|
const classes = ClassNames("usa-error-message", "usx-error-message", className);
|
|
1009
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, role: "alert", ...id ? { id } : {}, ...
|
|
1009
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, role: "alert", ...id ? { id } : {}, ...props2, children });
|
|
1010
1010
|
}
|
|
1011
|
-
function FormGroup({ children = null, className = "", error = false, ...
|
|
1011
|
+
function FormGroup({ children = null, className = "", error = false, ...props2 }) {
|
|
1012
1012
|
const classes = ClassNames(
|
|
1013
1013
|
"usa-form-group",
|
|
1014
1014
|
"usx-form-group",
|
|
@@ -1017,7 +1017,7 @@
|
|
|
1017
1017
|
},
|
|
1018
1018
|
className
|
|
1019
1019
|
);
|
|
1020
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
1020
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children });
|
|
1021
1021
|
}
|
|
1022
1022
|
function Input({
|
|
1023
1023
|
label,
|
|
@@ -1031,7 +1031,7 @@
|
|
|
1031
1031
|
screenReaderOnlyLabel = false,
|
|
1032
1032
|
formGroup = true,
|
|
1033
1033
|
className = "",
|
|
1034
|
-
...
|
|
1034
|
+
...props2
|
|
1035
1035
|
}) {
|
|
1036
1036
|
const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
|
|
1037
1037
|
const hintId = hint ? `${inputId}-hint` : void 0;
|
|
@@ -1056,7 +1056,7 @@
|
|
|
1056
1056
|
required,
|
|
1057
1057
|
"aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
|
|
1058
1058
|
"aria-invalid": hasError ? true : void 0,
|
|
1059
|
-
...
|
|
1059
|
+
...props2
|
|
1060
1060
|
};
|
|
1061
1061
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1062
1062
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: inputId, screenReaderOnly: screenReaderOnlyLabel, required, error: hasError, children: label }),
|
|
@@ -1079,7 +1079,7 @@
|
|
|
1079
1079
|
success = null,
|
|
1080
1080
|
formGroup = true,
|
|
1081
1081
|
className = "",
|
|
1082
|
-
...
|
|
1082
|
+
...props2
|
|
1083
1083
|
}) => {
|
|
1084
1084
|
const textAreaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;
|
|
1085
1085
|
const hasError = !!error;
|
|
@@ -1109,7 +1109,7 @@
|
|
|
1109
1109
|
...required ? { required: true } : {},
|
|
1110
1110
|
"aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
|
|
1111
1111
|
"aria-invalid": hasError ? "true" : void 0,
|
|
1112
|
-
...
|
|
1112
|
+
...props2
|
|
1113
1113
|
}
|
|
1114
1114
|
)
|
|
1115
1115
|
] });
|
|
@@ -1128,7 +1128,7 @@
|
|
|
1128
1128
|
placeholder = "",
|
|
1129
1129
|
textArea = false,
|
|
1130
1130
|
className = "",
|
|
1131
|
-
...
|
|
1131
|
+
...props2
|
|
1132
1132
|
}) {
|
|
1133
1133
|
const fieldId = id || `character-count-${Math.random().toString(36).substr(2, 9)}`;
|
|
1134
1134
|
const infoId = `${fieldId}-info`;
|
|
@@ -1150,7 +1150,7 @@
|
|
|
1150
1150
|
formGroup: true,
|
|
1151
1151
|
className: "usa-character-count__field",
|
|
1152
1152
|
"aria-describedby": [infoId, hintId, errorId, successId].filter(Boolean).join(" "),
|
|
1153
|
-
...
|
|
1153
|
+
...props2
|
|
1154
1154
|
};
|
|
1155
1155
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: outerClasses, children: [
|
|
1156
1156
|
textArea ? /* @__PURE__ */ jsxRuntime.jsx(TextArea, { ...fieldProps }) : /* @__PURE__ */ jsxRuntime.jsx(Input, { ...fieldProps }),
|
|
@@ -1177,7 +1177,7 @@
|
|
|
1177
1177
|
className = "",
|
|
1178
1178
|
onChange,
|
|
1179
1179
|
required = false,
|
|
1180
|
-
...
|
|
1180
|
+
...props2
|
|
1181
1181
|
}) {
|
|
1182
1182
|
const hasError = !!error;
|
|
1183
1183
|
const hasSuccess = !!success;
|
|
@@ -1192,7 +1192,7 @@
|
|
|
1192
1192
|
{ "usa-checkbox__input--tile": tile }
|
|
1193
1193
|
);
|
|
1194
1194
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1195
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: divClasses, ...
|
|
1195
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: divClasses, ...props2, children: [
|
|
1196
1196
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1197
1197
|
"input",
|
|
1198
1198
|
{
|
|
@@ -1222,7 +1222,7 @@
|
|
|
1222
1222
|
large = false,
|
|
1223
1223
|
children = null,
|
|
1224
1224
|
className = "",
|
|
1225
|
-
...
|
|
1225
|
+
...props2
|
|
1226
1226
|
}) {
|
|
1227
1227
|
const classes = ClassNames(
|
|
1228
1228
|
"usa-legend",
|
|
@@ -1230,7 +1230,7 @@
|
|
|
1230
1230
|
{ "usa-legend--large": large },
|
|
1231
1231
|
className
|
|
1232
1232
|
);
|
|
1233
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("legend", { className: classes, ...
|
|
1233
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("legend", { className: classes, ...props2, children: [
|
|
1234
1234
|
required && /* @__PURE__ */ jsxRuntime.jsx(Required, {}),
|
|
1235
1235
|
children || text
|
|
1236
1236
|
] });
|
|
@@ -1246,14 +1246,14 @@
|
|
|
1246
1246
|
errorId,
|
|
1247
1247
|
children = null,
|
|
1248
1248
|
className = "",
|
|
1249
|
-
...
|
|
1249
|
+
...props2
|
|
1250
1250
|
}) {
|
|
1251
1251
|
const classes = ClassNames(
|
|
1252
1252
|
"usa-fieldset",
|
|
1253
1253
|
"usx-fieldset",
|
|
1254
1254
|
className
|
|
1255
1255
|
);
|
|
1256
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: classes, ...disabled ? { disabled: true } : {}, ...
|
|
1256
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: classes, ...disabled ? { disabled: true } : {}, ...props2, children: [
|
|
1257
1257
|
legend && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1258
1258
|
Legend,
|
|
1259
1259
|
{
|
|
@@ -1279,10 +1279,10 @@
|
|
|
1279
1279
|
id: groupId,
|
|
1280
1280
|
checkboxProps = [],
|
|
1281
1281
|
className = "",
|
|
1282
|
-
...
|
|
1282
|
+
...props2
|
|
1283
1283
|
}) => {
|
|
1284
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, ...
|
|
1285
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsxRuntime.jsx(Fieldset, { id: groupId, legend, required, hint, error, className: classes, ...props2, children: checkboxProps.map((opt, idx) => {
|
|
1286
1286
|
const id = opt.id || `${groupId || name}-${idx}`;
|
|
1287
1287
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1288
1288
|
Checkbox,
|
|
@@ -1335,11 +1335,11 @@
|
|
|
1335
1335
|
children,
|
|
1336
1336
|
className = "",
|
|
1337
1337
|
bodyClassName = "",
|
|
1338
|
-
...
|
|
1338
|
+
...props2
|
|
1339
1339
|
}) => {
|
|
1340
1340
|
const validPositions = ["top", "bottom", "left", "right"];
|
|
1341
1341
|
const normalizedPosition = validPositions.includes(position) ? position : "top";
|
|
1342
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: ClassNames("usx-tooltip", className), ...
|
|
1342
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: ClassNames("usx-tooltip", className), ...props2, children: [
|
|
1343
1343
|
children,
|
|
1344
1344
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1345
1345
|
"span",
|
|
@@ -1430,14 +1430,14 @@
|
|
|
1430
1430
|
] })
|
|
1431
1431
|
] });
|
|
1432
1432
|
}
|
|
1433
|
-
function Collection({ items = [], condensed = false, className = "", ...
|
|
1433
|
+
function Collection({ items = [], condensed = false, className = "", ...props2 }) {
|
|
1434
1434
|
const classes = ClassNames(
|
|
1435
1435
|
"usa-collection",
|
|
1436
1436
|
"usx-collection",
|
|
1437
1437
|
condensed && "usa-collection--condensed",
|
|
1438
1438
|
className
|
|
1439
1439
|
);
|
|
1440
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...
|
|
1440
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props2, children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(CollectionItem, { ...item }, i)) });
|
|
1441
1441
|
}
|
|
1442
1442
|
function Combobox({
|
|
1443
1443
|
id,
|
|
@@ -1454,7 +1454,7 @@
|
|
|
1454
1454
|
onSelect,
|
|
1455
1455
|
formGroup = true,
|
|
1456
1456
|
className = "",
|
|
1457
|
-
...
|
|
1457
|
+
...props2
|
|
1458
1458
|
}) {
|
|
1459
1459
|
const labelId = `${id}-label`;
|
|
1460
1460
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
@@ -1493,7 +1493,7 @@
|
|
|
1493
1493
|
disabled,
|
|
1494
1494
|
required,
|
|
1495
1495
|
onChange: handleChange,
|
|
1496
|
-
...
|
|
1496
|
+
...props2,
|
|
1497
1497
|
children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt.value, children: opt.label }, opt.value))
|
|
1498
1498
|
}
|
|
1499
1499
|
)
|
|
@@ -1502,6 +1502,84 @@
|
|
|
1502
1502
|
] });
|
|
1503
1503
|
return formGroup ? /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: content }) : content;
|
|
1504
1504
|
}
|
|
1505
|
+
const props = { "element": { "type": "select", "description": "Root HTML element. Use a heading or accessible label for named sections and navigation; list roots require list-item children.", "options": ["div", "section", "article", "aside", "nav", "ul", "ol", "li"], "default": "div" }, "gridContainer": { "type": "select", "description": "Opt-in centered USWDS page-width container with side padding. Default uses the USX themed grid-container; named sizes use USWDS widths. Usually wrap a gridRow inside this container rather than combining them.", "options": ["default", "card", "card-lg", "mobile", "mobile-lg", "tablet", "tablet-lg", "desktop", "desktop-lg", "widescreen"] }, "gridRow": { "type": "boolean", "description": "Use a wrapping USWDS grid row. Nest Containers with column settings as direct children. Omitted leaves the container unstyled.", "default": false }, "display": { "type": "select", "description": "Display mode. Choose flex or inline-flex to enable direction, wrap, alignment, and gap. Flow-root contains floated children; none hides the container and its descendants.", "options": ["block", "flex", "inline", "inline-block", "inline-flex", "none", "flow-root"] }, "direction": { "type": "select", "description": "Direction of flex children. Requires display flex or inline-flex (or gridRow). Reverse directions change visual order only, not reading or keyboard order.", "options": ["row", "column", "row-reverse", "column-reverse"] }, "wrap": { "type": "select", "description": "Whether flex children wrap onto new lines. Set wrap for a flexible toolbar; omitted uses normal CSS behavior.", "options": ["wrap", "nowrap", "wrap-reverse"] }, "justify": { "type": "select", "description": "Distribute children along the main flex axis.", "options": ["start", "end", "center", "space-between", "space-around", "space-evenly"] }, "align": { "type": "select", "description": "Align children across the flex axis.", "options": ["start", "end", "center", "stretch", "baseline"] }, "alignSelf": { "type": "select", "description": "Override this container’s alignment as a child of a flex parent. Auto restores parent alignment.", "options": ["auto", "start", "end", "center", "stretch", "baseline"] }, "flex": { "type": "select", "description": "Size this container as a flex child: auto uses its content size, fill shares available space, none keeps its size. Use column instead when this is a USWDS grid column.", "options": ["auto", "fill", "none"] }, "gap": { "type": "select", "description": "Space between flex children using USWDS spacing tokens (1 = 8px, 05 = 4px). Use gutters instead on gridRow: CSS gap adds to percentage column widths.", "options": ["0", "2px", "05", "1", "2", "3", "4", "5", "6"] }, "column": { "type": "select", "description": "Width of this container inside a gridRow: 1–12 columns, auto for content width, or fill for equal shares. Set 12 at the base to stack on small screens, then override at larger breakpoints.", "options": ["auto", "fill", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] }, "offset": { "type": "select", "description": "Offset this grid column by 1–12 columns. Use none to reset an earlier offset.", "options": ["none", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] }, "gutters": { "type": "select", "description": "Horizontal USWDS grid gutters; requires gridRow. Use 2 with a desktop override of 4 for standard responsive spacing; 0 removes gutters. Rows use negative margins, so nest them in a gridContainer or another padded parent.", "options": ["sm", "md", "lg", "0", "2px", "05", "1", "2", "3", "4", "5", "6"] }, "float": { "type": "select", "description": "Float this container so surrounding content wraps around it. Float has no effect on flex children; use a flow-root parent to contain floats.", "options": ["none", "left", "right"] }, "responsive": { "type": "object", "description": "Mobile-first overrides keyed by mobileLg, tablet, and desktop. Omitted fields keep the smaller-screen setting; use explicit values (none, 0, row, etc.) to reset. Breakpoints match precompiled USWDS and do not follow USX page-layout theme breakpoints.", "properties": { "mobileLg": { "type": "object", "description": "Layout overrides at 30em / 480px and wider (pixel equivalent assumes 16px browser default).", "component": "container", "omit": ["element", "gridContainer", "gridRow", "responsive", "children", "content", "className", "id", "role", "ariaLabel", "ariaLabelledby"] }, "tablet": { "type": "object", "description": "Layout overrides at 40em / 640px and wider (pixel equivalent assumes 16px browser default).", "component": "container", "omit": ["element", "gridContainer", "gridRow", "responsive", "children", "content", "className", "id", "role", "ariaLabel", "ariaLabelledby"] }, "desktop": { "type": "object", "description": "Layout overrides at 64em / 1024px and wider (pixel equivalent assumes 16px browser default).", "component": "container", "omit": ["element", "gridContainer", "gridRow", "responsive", "children", "content", "className", "id", "role", "ariaLabel", "ariaLabelledby"] } } }, "children": { "type": "slot", "description": "Grouped content rendered directly, with no child wrappers or reordering. Takes precedence over content unless null or undefined." }, "content": { "type": "slot", "description": "Fallback grouped content when children is null or undefined." }, "className": { "type": "string", "description": "Additional CSS classes for spacing, decoration, or layouts beyond these controls." }, "id": { "type": "string", "description": "HTML identifier for links and accessible references." }, "role": { "type": "string", "description": "Optional ARIA role; prefer an appropriate semantic element." }, "ariaLabel": { "type": "string", "description": "Accessible name when a visible label is not available." }, "ariaLabelledby": { "type": "string", "description": "ID of the visible heading or label that names this container." } };
|
|
1506
|
+
const config = {
|
|
1507
|
+
props
|
|
1508
|
+
};
|
|
1509
|
+
const breakpoints = [["mobileLg", "mobile-lg"], ["tablet", "tablet"], ["desktop", "desktop"]];
|
|
1510
|
+
const layoutKeys = [
|
|
1511
|
+
"display",
|
|
1512
|
+
"direction",
|
|
1513
|
+
"wrap",
|
|
1514
|
+
"justify",
|
|
1515
|
+
"align",
|
|
1516
|
+
"alignSelf",
|
|
1517
|
+
"flex",
|
|
1518
|
+
"gap",
|
|
1519
|
+
"column",
|
|
1520
|
+
"offset",
|
|
1521
|
+
"gutters",
|
|
1522
|
+
"float"
|
|
1523
|
+
];
|
|
1524
|
+
function layoutClasses(layout, prefix = "") {
|
|
1525
|
+
if (!layout || typeof layout !== "object" || Array.isArray(layout)) return [];
|
|
1526
|
+
return layoutKeys.flatMap((key) => {
|
|
1527
|
+
const value = layout[key];
|
|
1528
|
+
if (typeof value !== "string" || !config.props[key].options.includes(value)) return [];
|
|
1529
|
+
let className;
|
|
1530
|
+
if (key === "column") className = `grid-col-${value}`;
|
|
1531
|
+
else if (key === "offset") className = `grid-offset-${value}`;
|
|
1532
|
+
else if (key === "gutters") className = `grid-gap-${value}`;
|
|
1533
|
+
else className = `usx-container--${key === "alignSelf" ? "align-self" : key}-${value}`;
|
|
1534
|
+
return [`${prefix}${className}`];
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
function Container({
|
|
1538
|
+
element = "div",
|
|
1539
|
+
gridContainer,
|
|
1540
|
+
gridRow = false,
|
|
1541
|
+
display,
|
|
1542
|
+
direction,
|
|
1543
|
+
wrap,
|
|
1544
|
+
justify,
|
|
1545
|
+
align,
|
|
1546
|
+
alignSelf,
|
|
1547
|
+
flex,
|
|
1548
|
+
gap,
|
|
1549
|
+
column,
|
|
1550
|
+
offset,
|
|
1551
|
+
gutters,
|
|
1552
|
+
float,
|
|
1553
|
+
responsive,
|
|
1554
|
+
children,
|
|
1555
|
+
content,
|
|
1556
|
+
className = "",
|
|
1557
|
+
id,
|
|
1558
|
+
role,
|
|
1559
|
+
ariaLabel,
|
|
1560
|
+
ariaLabelledby
|
|
1561
|
+
}) {
|
|
1562
|
+
const Element = config.props.element.options.includes(element) ? element : "div";
|
|
1563
|
+
const classes = ClassNames(
|
|
1564
|
+
"usx-container",
|
|
1565
|
+
gridContainer && config.props.gridContainer.options.includes(gridContainer) ? gridContainer === "default" ? "grid-container" : `grid-container-${gridContainer}` : null,
|
|
1566
|
+
{ "grid-row": gridRow === true },
|
|
1567
|
+
layoutClasses({ display, direction, wrap, justify, align, alignSelf, flex, gap, column, offset, gutters, float }),
|
|
1568
|
+
breakpoints.map(([key, prefix]) => layoutClasses((responsive == null ? void 0 : responsive[key]) ?? {}, `${prefix}:`)),
|
|
1569
|
+
typeof className === "string" ? className : void 0
|
|
1570
|
+
);
|
|
1571
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1572
|
+
Element,
|
|
1573
|
+
{
|
|
1574
|
+
className: classes,
|
|
1575
|
+
id: typeof id === "string" ? id : void 0,
|
|
1576
|
+
role: typeof role === "string" ? role : void 0,
|
|
1577
|
+
"aria-label": typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
1578
|
+
"aria-labelledby": typeof ariaLabelledby === "string" ? ariaLabelledby : void 0,
|
|
1579
|
+
children: children ?? content
|
|
1580
|
+
}
|
|
1581
|
+
);
|
|
1582
|
+
}
|
|
1505
1583
|
function DatePicker({
|
|
1506
1584
|
id = "date-picker",
|
|
1507
1585
|
name,
|
|
@@ -1516,7 +1594,7 @@
|
|
|
1516
1594
|
rangeDate = null,
|
|
1517
1595
|
formGroup = true,
|
|
1518
1596
|
className = "",
|
|
1519
|
-
...
|
|
1597
|
+
...props2
|
|
1520
1598
|
}) {
|
|
1521
1599
|
const labelId = `${id}-label`;
|
|
1522
1600
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
@@ -1548,7 +1626,7 @@
|
|
|
1548
1626
|
"aria-describedby": describedBy,
|
|
1549
1627
|
disabled,
|
|
1550
1628
|
required,
|
|
1551
|
-
...
|
|
1629
|
+
...props2
|
|
1552
1630
|
}
|
|
1553
1631
|
)
|
|
1554
1632
|
}
|
|
@@ -1642,9 +1720,9 @@
|
|
|
1642
1720
|
}
|
|
1643
1721
|
);
|
|
1644
1722
|
}
|
|
1645
|
-
function Eyebrow({ children = null, className = "", ...
|
|
1723
|
+
function Eyebrow({ children = null, className = "", ...props2 }) {
|
|
1646
1724
|
const classes = ClassNames("usx-eyebrow", className);
|
|
1647
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...
|
|
1725
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...props2, children });
|
|
1648
1726
|
}
|
|
1649
1727
|
function Link({
|
|
1650
1728
|
href = "javascript:void(0);",
|
|
@@ -1654,7 +1732,7 @@
|
|
|
1654
1732
|
alt = false,
|
|
1655
1733
|
newTab = false,
|
|
1656
1734
|
className = "",
|
|
1657
|
-
...
|
|
1735
|
+
...props2
|
|
1658
1736
|
}) {
|
|
1659
1737
|
const classes = ClassNames(
|
|
1660
1738
|
"usa-link",
|
|
@@ -1671,7 +1749,7 @@
|
|
|
1671
1749
|
className: classes,
|
|
1672
1750
|
target: newTab || external ? "_blank" : void 0,
|
|
1673
1751
|
rel: newTab || external ? "noreferrer noopener" : void 0,
|
|
1674
|
-
...
|
|
1752
|
+
...props2,
|
|
1675
1753
|
children
|
|
1676
1754
|
}
|
|
1677
1755
|
);
|
|
@@ -1746,7 +1824,7 @@
|
|
|
1746
1824
|
onFilesChange = null,
|
|
1747
1825
|
defaultFiles = [],
|
|
1748
1826
|
formGroup = true,
|
|
1749
|
-
...
|
|
1827
|
+
...props2
|
|
1750
1828
|
}) {
|
|
1751
1829
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
1752
1830
|
const errorId = error ? `${id}-error` : void 0;
|
|
@@ -1796,7 +1874,7 @@
|
|
|
1796
1874
|
disabled,
|
|
1797
1875
|
required,
|
|
1798
1876
|
...invalidFileTypeMessage ? { "data-errormessage": invalidFileTypeMessage } : {},
|
|
1799
|
-
...
|
|
1877
|
+
...props2
|
|
1800
1878
|
}
|
|
1801
1879
|
)
|
|
1802
1880
|
] });
|
|
@@ -1819,7 +1897,7 @@
|
|
|
1819
1897
|
disabled,
|
|
1820
1898
|
required: required && managedFiles.length === 0,
|
|
1821
1899
|
...invalidFileTypeMessage ? { "data-errormessage": invalidFileTypeMessage } : {},
|
|
1822
|
-
...
|
|
1900
|
+
...props2,
|
|
1823
1901
|
onChange: addFiles
|
|
1824
1902
|
}
|
|
1825
1903
|
) }),
|
|
@@ -1827,8 +1905,8 @@
|
|
|
1827
1905
|
] });
|
|
1828
1906
|
return formGroup ? /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: content }) : content;
|
|
1829
1907
|
}
|
|
1830
|
-
function BrandingContent({ config, projectUrl, staticBaseUrl }) {
|
|
1831
|
-
const { title, symbol, symbolInverse, logo, logoInverse, alt } =
|
|
1908
|
+
function BrandingContent({ config: config2, projectUrl, staticBaseUrl }) {
|
|
1909
|
+
const { title, symbol, symbolInverse, logo, logoInverse, alt } = config2;
|
|
1832
1910
|
const label = alt ?? title ?? "";
|
|
1833
1911
|
if (logo) {
|
|
1834
1912
|
const Wrapper = projectUrl ? "a" : "div";
|
|
@@ -1866,14 +1944,14 @@
|
|
|
1866
1944
|
title && (projectUrl ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: projectUrl, className: "usx-logo__title", children: title }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-logo__title", children: title }))
|
|
1867
1945
|
] });
|
|
1868
1946
|
}
|
|
1869
|
-
function Branding({ branding, projectUrl = "/", staticBaseUrl, className = "", ...
|
|
1947
|
+
function Branding({ branding, projectUrl = "/", staticBaseUrl, className = "", ...props2 }) {
|
|
1870
1948
|
if (!branding) return null;
|
|
1871
1949
|
const classes = ClassNames(
|
|
1872
1950
|
"usa-logo",
|
|
1873
1951
|
"usx-logo",
|
|
1874
1952
|
className
|
|
1875
1953
|
);
|
|
1876
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
1954
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: /* @__PURE__ */ jsxRuntime.jsx(BrandingContent, { config: branding, projectUrl, staticBaseUrl }) });
|
|
1877
1955
|
}
|
|
1878
1956
|
function FooterReturnToTop({ label = "Return to top", href = "#", className = "" }) {
|
|
1879
1957
|
const classes = ClassNames(
|
|
@@ -1968,7 +2046,7 @@
|
|
|
1968
2046
|
primaryChildren = null,
|
|
1969
2047
|
secondaryChildren = null,
|
|
1970
2048
|
className = "",
|
|
1971
|
-
...
|
|
2049
|
+
...props2
|
|
1972
2050
|
}) {
|
|
1973
2051
|
const variantClass = variant === "big" ? "usa-footer--big" : variant === "slim" ? "usa-footer--slim" : "";
|
|
1974
2052
|
const classes = ClassNames("usa-footer", variantClass, "usx-footer", className);
|
|
@@ -1997,7 +2075,7 @@
|
|
|
1997
2075
|
contactEl
|
|
1998
2076
|
] }) : null;
|
|
1999
2077
|
if (variant === "big") {
|
|
2000
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...
|
|
2078
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...props2, children: [
|
|
2001
2079
|
returnToTopEl,
|
|
2002
2080
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__primary-section", children: primaryChildren ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-container", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid-row grid-gap", children: [
|
|
2003
2081
|
navColumns.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tablet:grid-col-8", children: /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "usa-footer__nav", "aria-label": navAriaLabel, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-row grid-gap-4", children: navColumns.map((col, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mobile-lg:grid-col-6 desktop:grid-col-3", children: /* @__PURE__ */ jsxRuntime.jsx(FooterNavColumn, { heading: col.heading, links: col.links }) }, i)) }) }) }),
|
|
@@ -2015,7 +2093,7 @@
|
|
|
2015
2093
|
normalizeContactLink(contactEmail, "mailto:"),
|
|
2016
2094
|
...contactLinks
|
|
2017
2095
|
].filter(Boolean);
|
|
2018
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...
|
|
2096
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...props2, children: [
|
|
2019
2097
|
returnToTopEl,
|
|
2020
2098
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__primary-section", children: primaryChildren ?? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-footer__primary-container grid-row", children: [
|
|
2021
2099
|
navLinks.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mobile-lg:grid-col-8", children: /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "usa-footer__nav", "aria-label": navAriaLabel, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "grid-row grid-gap", children: navLinks.map((link, i) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "mobile-lg:grid-col-6 desktop:grid-col-auto usa-footer__primary-content", children: /* @__PURE__ */ jsxRuntime.jsx("a", { className: "usa-footer__primary-link", href: link.href, "aria-label": link.ariaLabel || void 0, children: link.text }) }, i)) }) }) }),
|
|
@@ -2024,7 +2102,7 @@
|
|
|
2024
2102
|
(brandingEl || secondaryChildren) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__secondary-section", children: secondaryChildren ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-container", children: brandingEl }) })
|
|
2025
2103
|
] });
|
|
2026
2104
|
}
|
|
2027
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...
|
|
2105
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("footer", { className: classes, ...props2, children: [
|
|
2028
2106
|
returnToTopEl,
|
|
2029
2107
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__primary-section", children: primaryChildren ?? (navLinks.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "usa-footer__nav", "aria-label": navAriaLabel, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "grid-row grid-gap", children: navLinks.map((link, i) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "mobile-lg:grid-col-4 desktop:grid-col-auto usa-footer__primary-content", children: /* @__PURE__ */ jsxRuntime.jsx("a", { className: "usa-footer__primary-link", href: link.href, "aria-label": link.ariaLabel || void 0, children: link.text }) }, i)) }) })) }),
|
|
2030
2108
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-footer__secondary-section", children: secondaryChildren ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-container", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid-row grid-gap", children: [
|
|
@@ -2204,7 +2282,7 @@
|
|
|
2204
2282
|
className = "",
|
|
2205
2283
|
utilityContent = null,
|
|
2206
2284
|
navEndContent = null,
|
|
2207
|
-
...
|
|
2285
|
+
...props2
|
|
2208
2286
|
}) {
|
|
2209
2287
|
const headerClasses = ClassNames(
|
|
2210
2288
|
"usa-header",
|
|
@@ -2225,7 +2303,7 @@
|
|
|
2225
2303
|
] });
|
|
2226
2304
|
if (extended) {
|
|
2227
2305
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2228
|
-
/* @__PURE__ */ jsxRuntime.jsx("header", { className: headerClasses, ...
|
|
2306
|
+
/* @__PURE__ */ jsxRuntime.jsx("header", { className: headerClasses, ...props2, children: navbar }),
|
|
2229
2307
|
/* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Primary navigation", className: navClasses, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-nav__inner", children: [
|
|
2230
2308
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2231
2309
|
PrimaryNav,
|
|
@@ -2257,7 +2335,7 @@
|
|
|
2257
2335
|
] }) })
|
|
2258
2336
|
] });
|
|
2259
2337
|
}
|
|
2260
|
-
return /* @__PURE__ */ jsxRuntime.jsx("header", { className: headerClasses, ...
|
|
2338
|
+
return /* @__PURE__ */ jsxRuntime.jsx("header", { className: headerClasses, ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-nav-container", children: [
|
|
2261
2339
|
navbar,
|
|
2262
2340
|
/* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Primary navigation", className: navClasses, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2263
2341
|
PrimaryNav,
|
|
@@ -2292,7 +2370,7 @@
|
|
|
2292
2370
|
ariaLabel = "Introduction",
|
|
2293
2371
|
className = "",
|
|
2294
2372
|
style,
|
|
2295
|
-
...
|
|
2373
|
+
...props2
|
|
2296
2374
|
}) {
|
|
2297
2375
|
const Heading = headingLevel;
|
|
2298
2376
|
const secondaryHeadings = { h1: "h2", h2: "h3", h3: "h4", h4: "h5", h5: "h6" };
|
|
@@ -2312,7 +2390,7 @@
|
|
|
2312
2390
|
...overlayOpacity !== void 0 ? { "--hero-overlay-opacity": Math.min(1, Math.max(0, overlayOpacity)) } : {},
|
|
2313
2391
|
...style
|
|
2314
2392
|
};
|
|
2315
|
-
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: classes, "aria-label": ariaLabel, style: heroStyle, ...
|
|
2393
|
+
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: classes, "aria-label": ariaLabel, style: heroStyle, ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-hero__inner", children: [
|
|
2316
2394
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-hero__callout", style: calloutMaxWidth ? { maxWidth: calloutMaxWidth } : void 0, children: [
|
|
2317
2395
|
/* @__PURE__ */ jsxRuntime.jsxs(Heading, { className: "usx-hero__heading", children: [
|
|
2318
2396
|
callout && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-hero__heading--alt", children: callout }),
|
|
@@ -2335,7 +2413,7 @@
|
|
|
2335
2413
|
}
|
|
2336
2414
|
return content;
|
|
2337
2415
|
}
|
|
2338
|
-
function IconList({ items = [], primary = false, size = null, className = "", ...
|
|
2416
|
+
function IconList({ items = [], primary = false, size = null, className = "", ...props2 }) {
|
|
2339
2417
|
const classes = ClassNames(
|
|
2340
2418
|
"usa-icon-list",
|
|
2341
2419
|
"usx-icon-list",
|
|
@@ -2343,7 +2421,7 @@
|
|
|
2343
2421
|
size === "lg" && "usa-icon-list--size-lg",
|
|
2344
2422
|
className
|
|
2345
2423
|
);
|
|
2346
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...
|
|
2424
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props2, children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: ClassNames("usa-icon-list__item", item.itemClassName), children: [
|
|
2347
2425
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: ClassNames("usa-icon-list__icon", item.iconColor && `text-${item.iconColor}`, item.iconClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2348
2426
|
Icon,
|
|
2349
2427
|
{
|
|
@@ -2492,7 +2570,7 @@
|
|
|
2492
2570
|
children = null,
|
|
2493
2571
|
className = "",
|
|
2494
2572
|
contentClassName = "",
|
|
2495
|
-
...
|
|
2573
|
+
...props2
|
|
2496
2574
|
}) {
|
|
2497
2575
|
const contentId = `${id}-content`;
|
|
2498
2576
|
const resolvedSelector = mainContentSelector || `#${contentId}`;
|
|
@@ -2510,7 +2588,7 @@
|
|
|
2510
2588
|
"data-root-margin": rootMargin,
|
|
2511
2589
|
"data-threshold": threshold,
|
|
2512
2590
|
"data-minimum-heading-count": minimumHeadingCount,
|
|
2513
|
-
...
|
|
2591
|
+
...props2
|
|
2514
2592
|
}
|
|
2515
2593
|
),
|
|
2516
2594
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2524,9 +2602,9 @@
|
|
|
2524
2602
|
)
|
|
2525
2603
|
] });
|
|
2526
2604
|
}
|
|
2527
|
-
function Indicator({ items = [], children = null, className = "", ...
|
|
2605
|
+
function Indicator({ items = [], children = null, className = "", ...props2 }) {
|
|
2528
2606
|
const classes = ClassNames("usx-indicator", className);
|
|
2529
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...
|
|
2607
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props2, children: [
|
|
2530
2608
|
items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2531
2609
|
"span",
|
|
2532
2610
|
{
|
|
@@ -2612,7 +2690,7 @@
|
|
|
2612
2690
|
navAriaLabel = "Language selection",
|
|
2613
2691
|
className = "",
|
|
2614
2692
|
onSelect = null,
|
|
2615
|
-
...
|
|
2693
|
+
...props2
|
|
2616
2694
|
}) {
|
|
2617
2695
|
const resolvedVariant = variant || (languages.length > 2 ? "menu" : "two");
|
|
2618
2696
|
const classes = ClassNames("usx-language-selector", className);
|
|
@@ -2628,7 +2706,7 @@
|
|
|
2628
2706
|
onSelect,
|
|
2629
2707
|
className: classes,
|
|
2630
2708
|
navAriaLabel,
|
|
2631
|
-
...
|
|
2709
|
+
...props2
|
|
2632
2710
|
}
|
|
2633
2711
|
);
|
|
2634
2712
|
}
|
|
@@ -2643,13 +2721,13 @@
|
|
|
2643
2721
|
onSelect,
|
|
2644
2722
|
className: classes,
|
|
2645
2723
|
navAriaLabel,
|
|
2646
|
-
...
|
|
2724
|
+
...props2
|
|
2647
2725
|
}
|
|
2648
2726
|
);
|
|
2649
2727
|
}
|
|
2650
|
-
function SingleColumnLayout({ children, expandButton = null, className = "", ...
|
|
2728
|
+
function SingleColumnLayout({ children, expandButton = null, className = "", ...props2 }) {
|
|
2651
2729
|
const classes = ClassNames("usx-layout__single-column", className);
|
|
2652
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...
|
|
2730
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props2, children: [
|
|
2653
2731
|
expandButton,
|
|
2654
2732
|
children
|
|
2655
2733
|
] });
|
|
@@ -2662,7 +2740,7 @@
|
|
|
2662
2740
|
expandButton = null,
|
|
2663
2741
|
children,
|
|
2664
2742
|
className = "",
|
|
2665
|
-
...
|
|
2743
|
+
...props2
|
|
2666
2744
|
}) {
|
|
2667
2745
|
const contentModifier = rightSidebar && !leftSidebar ? "left" : leftSidebar && !rightSidebar ? "right" : null;
|
|
2668
2746
|
const contentClasses = ClassNames(
|
|
@@ -2688,7 +2766,7 @@
|
|
|
2688
2766
|
"usx-layout__sidebar--expanded": expandRightSidebar
|
|
2689
2767
|
}
|
|
2690
2768
|
);
|
|
2691
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: containerClasses, ...
|
|
2769
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: containerClasses, ...props2, children: [
|
|
2692
2770
|
leftSidebar && /* @__PURE__ */ jsxRuntime.jsx("aside", { className: leftSidebarClasses, children: leftSidebar }),
|
|
2693
2771
|
/* @__PURE__ */ jsxRuntime.jsxs("main", { className: contentClasses, children: [
|
|
2694
2772
|
expandButton,
|
|
@@ -2707,7 +2785,7 @@
|
|
|
2707
2785
|
expandRightSidebar,
|
|
2708
2786
|
expandable = false,
|
|
2709
2787
|
className = "",
|
|
2710
|
-
...
|
|
2788
|
+
...props2
|
|
2711
2789
|
}) {
|
|
2712
2790
|
const [expanded, setExpanded] = React.useState(false);
|
|
2713
2791
|
const classes = ClassNames(
|
|
@@ -2731,7 +2809,7 @@
|
|
|
2731
2809
|
]
|
|
2732
2810
|
}
|
|
2733
2811
|
) : null;
|
|
2734
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
2812
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: variant === "single-column" ? /* @__PURE__ */ jsxRuntime.jsx(SingleColumnLayout, { expandButton, children: children || content }) : variant === "grid" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2735
2813
|
GridLayout,
|
|
2736
2814
|
{
|
|
2737
2815
|
leftSidebar,
|
|
@@ -2770,7 +2848,7 @@
|
|
|
2770
2848
|
] }, index);
|
|
2771
2849
|
});
|
|
2772
2850
|
}
|
|
2773
|
-
function List({ items = [], ordered = false, unstyled = false, className = "", ...
|
|
2851
|
+
function List({ items = [], ordered = false, unstyled = false, className = "", ...props2 }) {
|
|
2774
2852
|
const classes = ClassNames(
|
|
2775
2853
|
"usa-list",
|
|
2776
2854
|
"usx-list",
|
|
@@ -2778,7 +2856,7 @@
|
|
|
2778
2856
|
className
|
|
2779
2857
|
);
|
|
2780
2858
|
const Tag2 = ordered ? "ol" : "ul";
|
|
2781
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, ...
|
|
2859
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, ...props2, children: renderItems(items, { ordered, unstyled }) });
|
|
2782
2860
|
}
|
|
2783
2861
|
function Select({
|
|
2784
2862
|
label,
|
|
@@ -2794,7 +2872,7 @@
|
|
|
2794
2872
|
required = false,
|
|
2795
2873
|
formGroup = true,
|
|
2796
2874
|
className = "",
|
|
2797
|
-
...
|
|
2875
|
+
...props2
|
|
2798
2876
|
}) {
|
|
2799
2877
|
const selectId = id || `select-${Math.random().toString(36).substr(2, 9)}`;
|
|
2800
2878
|
const hintId = hint ? `${selectId}-hint` : void 0;
|
|
@@ -2821,7 +2899,7 @@
|
|
|
2821
2899
|
defaultValue,
|
|
2822
2900
|
"aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
|
|
2823
2901
|
"aria-invalid": hasError ? true : void 0,
|
|
2824
|
-
...
|
|
2902
|
+
...props2
|
|
2825
2903
|
};
|
|
2826
2904
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2827
2905
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: selectId, required, error: hasError, children: label }),
|
|
@@ -2964,7 +3042,7 @@
|
|
|
2964
3042
|
importantLinkHref,
|
|
2965
3043
|
importantLinkIcon = "undo",
|
|
2966
3044
|
showReturnLink = true,
|
|
2967
|
-
...
|
|
3045
|
+
...props2
|
|
2968
3046
|
}) {
|
|
2969
3047
|
const menuId = React.useId();
|
|
2970
3048
|
const toggleId = React.useId();
|
|
@@ -3020,7 +3098,7 @@
|
|
|
3020
3098
|
/* @__PURE__ */ jsxRuntime.jsx("div", { id: menuId, className: "usx-misc-banner__dropdown-content", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "usa-list", children: mobileLinks.map((link) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "usa-list__item", children: /* @__PURE__ */ jsxRuntime.jsx("a", { className: "usa-link usx-misc-banner__link", href: link.href, children: link.text }) }, `${link.href}-${link.text}`)) }) })
|
|
3021
3099
|
] }) : null
|
|
3022
3100
|
] });
|
|
3023
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
3101
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-misc-banner__content grid-container", children: content }) });
|
|
3024
3102
|
}
|
|
3025
3103
|
const validElements = ["div", "article", "section", "main"];
|
|
3026
3104
|
const Prose = ({
|
|
@@ -3028,14 +3106,14 @@
|
|
|
3028
3106
|
content,
|
|
3029
3107
|
children,
|
|
3030
3108
|
className = "",
|
|
3031
|
-
...
|
|
3109
|
+
...props2
|
|
3032
3110
|
}) => {
|
|
3033
3111
|
const Element = validElements.includes(containerElement) ? containerElement : "div";
|
|
3034
3112
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3035
3113
|
Element,
|
|
3036
3114
|
{
|
|
3037
3115
|
className: `usa-prose usx-prose ${className}`,
|
|
3038
|
-
...
|
|
3116
|
+
...props2,
|
|
3039
3117
|
...content ? { dangerouslySetInnerHTML: { __html: content } } : {},
|
|
3040
3118
|
children: children ? children : null
|
|
3041
3119
|
}
|
|
@@ -3053,7 +3131,7 @@
|
|
|
3053
3131
|
forceAction = false,
|
|
3054
3132
|
className = "",
|
|
3055
3133
|
children,
|
|
3056
|
-
...
|
|
3134
|
+
...props2
|
|
3057
3135
|
}) {
|
|
3058
3136
|
const classes = ClassNames("usa-modal", "usx-modal", {
|
|
3059
3137
|
"usa-modal--lg": size === "lg",
|
|
@@ -3067,7 +3145,7 @@
|
|
|
3067
3145
|
"aria-labelledby": `${id}-heading`,
|
|
3068
3146
|
"aria-describedby": `${id}-description`,
|
|
3069
3147
|
...forceAction ? { "data-force-action": true } : {},
|
|
3070
|
-
...
|
|
3148
|
+
...props2,
|
|
3071
3149
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-modal__content", children: [
|
|
3072
3150
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-modal__main", children: [
|
|
3073
3151
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "usa-modal__heading", id: `${id}-heading`, children: heading }),
|
|
@@ -3096,12 +3174,12 @@
|
|
|
3096
3174
|
children = null,
|
|
3097
3175
|
content = null,
|
|
3098
3176
|
className = "",
|
|
3099
|
-
...
|
|
3177
|
+
...props2
|
|
3100
3178
|
}) {
|
|
3101
3179
|
const classes = ClassNames("usx-page", className);
|
|
3102
3180
|
const pageContent = children || content;
|
|
3103
3181
|
const Element = element;
|
|
3104
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Element, { id, className: classes, ...
|
|
3182
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Element, { id, className: classes, ...props2, children: [
|
|
3105
3183
|
/* @__PURE__ */ jsxRuntime.jsxs("h1", { className: "usx-page__title", children: [
|
|
3106
3184
|
eyebrow ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usx-eyebrow", children: eyebrow }) : null,
|
|
3107
3185
|
title
|
|
@@ -3360,10 +3438,10 @@
|
|
|
3360
3438
|
navigation,
|
|
3361
3439
|
stepOptions,
|
|
3362
3440
|
className = "",
|
|
3363
|
-
...
|
|
3441
|
+
...props2
|
|
3364
3442
|
}) {
|
|
3365
3443
|
const classes = ClassNames("usx-pagination__container", className);
|
|
3366
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...
|
|
3444
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props2, children: [
|
|
3367
3445
|
summary && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-pagination__container-summary", children: summary }),
|
|
3368
3446
|
(stepOptions || navigation) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usx-pagination__container-end", children: [
|
|
3369
3447
|
stepOptions && stepOptions,
|
|
@@ -3451,9 +3529,9 @@
|
|
|
3451
3529
|
}
|
|
3452
3530
|
return content;
|
|
3453
3531
|
}
|
|
3454
|
-
const ProcessList = ({ items = [], className = "", ...
|
|
3532
|
+
const ProcessList = ({ items = [], className = "", ...props2 }) => {
|
|
3455
3533
|
const classes = ClassNames("usa-process-list", "usx-process-list", className);
|
|
3456
|
-
return /* @__PURE__ */ jsxRuntime.jsx("ol", { className: classes, ...
|
|
3534
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ol", { className: classes, ...props2, children: items.map((item, index) => {
|
|
3457
3535
|
const HeadingTag = item.headingTag || "h4";
|
|
3458
3536
|
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: ClassNames("usa-process-list__item", item.className), children: [
|
|
3459
3537
|
/* @__PURE__ */ jsxRuntime.jsx(HeadingTag, { className: ClassNames("usa-process-list__heading", item.headingClassName), children: item.heading }),
|
|
@@ -3470,10 +3548,10 @@
|
|
|
3470
3548
|
sourceTitle,
|
|
3471
3549
|
className,
|
|
3472
3550
|
blockquoteClassName,
|
|
3473
|
-
...
|
|
3551
|
+
...props2
|
|
3474
3552
|
}) {
|
|
3475
3553
|
const isVertical = (calloutProps == null ? void 0 : calloutProps.orientation) === "vertical";
|
|
3476
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usx-quote", isVertical && "usx-quote--vertical", className), ...
|
|
3554
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usx-quote", isVertical && "usx-quote--vertical", className), ...props2, children: [
|
|
3477
3555
|
!isVertical && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "format_quote", size: 4, className: "usx-quote__icon" }),
|
|
3478
3556
|
/* @__PURE__ */ jsxRuntime.jsx(Callout, { ...calloutProps, element: "div", children: /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: "usx-quote__body", children: [
|
|
3479
3557
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3506,7 +3584,7 @@
|
|
|
3506
3584
|
options = [],
|
|
3507
3585
|
defaultValue = void 0,
|
|
3508
3586
|
className = "",
|
|
3509
|
-
...
|
|
3587
|
+
...props2
|
|
3510
3588
|
}) => {
|
|
3511
3589
|
const classes = ClassNames(
|
|
3512
3590
|
"usa-radio",
|
|
@@ -3518,7 +3596,7 @@
|
|
|
3518
3596
|
"usa-radio__input",
|
|
3519
3597
|
{ "usa-radio__input--tile": tile }
|
|
3520
3598
|
);
|
|
3521
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsxRuntime.jsx(Fieldset, { legend, required, hint, error, ...
|
|
3599
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsxRuntime.jsx(Fieldset, { legend, required, hint, error, ...props2, children: options.map((opt, idx) => {
|
|
3522
3600
|
const id = opt.id || `${name}-${idx}`;
|
|
3523
3601
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, children: [
|
|
3524
3602
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3557,7 +3635,7 @@
|
|
|
3557
3635
|
textPreposition = null,
|
|
3558
3636
|
formGroup = true,
|
|
3559
3637
|
className = "",
|
|
3560
|
-
...
|
|
3638
|
+
...props2
|
|
3561
3639
|
}) {
|
|
3562
3640
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
3563
3641
|
const errorId = error ? `${id}-error` : void 0;
|
|
@@ -3583,7 +3661,7 @@
|
|
|
3583
3661
|
"aria-describedby": describedBy,
|
|
3584
3662
|
...textUnit ? { "data-text-unit": textUnit } : {},
|
|
3585
3663
|
...textPreposition ? { "data-text-preposition": textPreposition } : {},
|
|
3586
|
-
...
|
|
3664
|
+
...props2
|
|
3587
3665
|
}
|
|
3588
3666
|
)
|
|
3589
3667
|
] });
|
|
@@ -3595,12 +3673,12 @@
|
|
|
3595
3673
|
children = null,
|
|
3596
3674
|
content = null,
|
|
3597
3675
|
className = "",
|
|
3598
|
-
...
|
|
3676
|
+
...props2
|
|
3599
3677
|
}) => {
|
|
3600
3678
|
const classes = ClassNames("usx-section", className);
|
|
3601
3679
|
const sectionContent = children || content;
|
|
3602
3680
|
const Heading = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(headingLevel) ? headingLevel : "h2";
|
|
3603
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: classes, ...
|
|
3681
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: classes, ...props2, children: [
|
|
3604
3682
|
title ? /* @__PURE__ */ jsxRuntime.jsx(Heading, { className: "usx-section__title", children: title }) : null,
|
|
3605
3683
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-section__content", children: sectionContent })
|
|
3606
3684
|
] });
|
|
@@ -3626,7 +3704,7 @@
|
|
|
3626
3704
|
sticky = false,
|
|
3627
3705
|
ariaLabel = "Side navigation",
|
|
3628
3706
|
className = "",
|
|
3629
|
-
...
|
|
3707
|
+
...props2
|
|
3630
3708
|
}) => {
|
|
3631
3709
|
const classes = ClassNames(
|
|
3632
3710
|
"usa-sidenav",
|
|
@@ -3636,7 +3714,7 @@
|
|
|
3636
3714
|
},
|
|
3637
3715
|
className
|
|
3638
3716
|
);
|
|
3639
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...
|
|
3717
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: classes, ...props2, children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(SideNavItem, { item }, i)) }) });
|
|
3640
3718
|
};
|
|
3641
3719
|
const SiteAlert = ({
|
|
3642
3720
|
className = "",
|
|
@@ -3650,7 +3728,7 @@
|
|
|
3650
3728
|
role,
|
|
3651
3729
|
ariaLabel = "Site alert",
|
|
3652
3730
|
ariaLabelledby,
|
|
3653
|
-
...
|
|
3731
|
+
...props2
|
|
3654
3732
|
}) => {
|
|
3655
3733
|
const normalizedVariant = ["info", "emergency", "maintenance", "maintenance-warning"].includes(variant) ? variant : "info";
|
|
3656
3734
|
const alertVariant = normalizedVariant === "maintenance" ? "error" : normalizedVariant === "maintenance-warning" ? "warning" : normalizedVariant;
|
|
@@ -3681,7 +3759,7 @@
|
|
|
3681
3759
|
role,
|
|
3682
3760
|
"aria-label": ariaLabelledby ? void 0 : ariaLabel,
|
|
3683
3761
|
"aria-labelledby": ariaLabelledby,
|
|
3684
|
-
...
|
|
3762
|
+
...props2,
|
|
3685
3763
|
children: alertContent ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: alertClasses, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-alert__body usx-alert__body", children: [
|
|
3686
3764
|
alertHeading && /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-alert__heading usx-alert__heading", children: alertHeading }),
|
|
3687
3765
|
alertContent,
|
|
@@ -3725,18 +3803,18 @@
|
|
|
3725
3803
|
content,
|
|
3726
3804
|
children = null,
|
|
3727
3805
|
className = "",
|
|
3728
|
-
...
|
|
3806
|
+
...props2
|
|
3729
3807
|
}) => {
|
|
3730
3808
|
const classes = ClassNames("usa-skipnav", className);
|
|
3731
3809
|
const finalHref = normalizeHref({ href, target });
|
|
3732
|
-
return /* @__PURE__ */ jsxRuntime.jsx("a", { className: classes, href: finalHref, ...
|
|
3810
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { className: classes, href: finalHref, ...props2, children: children || content || "Skip to main content" });
|
|
3733
3811
|
};
|
|
3734
3812
|
const Status = ({
|
|
3735
3813
|
color = void 0,
|
|
3736
3814
|
size = void 0,
|
|
3737
3815
|
animation = void 0,
|
|
3738
3816
|
className = "",
|
|
3739
|
-
...
|
|
3817
|
+
...props2
|
|
3740
3818
|
}) => {
|
|
3741
3819
|
const classes = ClassNames(
|
|
3742
3820
|
"usx-status",
|
|
@@ -3745,7 +3823,7 @@
|
|
|
3745
3823
|
animation && `usx-${animation}`,
|
|
3746
3824
|
className
|
|
3747
3825
|
);
|
|
3748
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...
|
|
3826
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: classes, ...props2 });
|
|
3749
3827
|
};
|
|
3750
3828
|
const StepIndicator = ({
|
|
3751
3829
|
steps = [],
|
|
@@ -3753,7 +3831,7 @@
|
|
|
3753
3831
|
variant = "",
|
|
3754
3832
|
headingTag: HeadingTag = "h4",
|
|
3755
3833
|
className = "",
|
|
3756
|
-
...
|
|
3834
|
+
...props2
|
|
3757
3835
|
}) => {
|
|
3758
3836
|
var _a;
|
|
3759
3837
|
const step = Number(currentStep);
|
|
@@ -3770,7 +3848,7 @@
|
|
|
3770
3848
|
return "";
|
|
3771
3849
|
};
|
|
3772
3850
|
const currentLabel = ((_a = steps[step - 1]) == null ? void 0 : _a.label) || "";
|
|
3773
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...
|
|
3851
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes, ...props2, children: [
|
|
3774
3852
|
/* @__PURE__ */ jsxRuntime.jsx("ol", { className: "usa-step-indicator__segments", children: steps.map((s, index) => {
|
|
3775
3853
|
const status = getStatus(index);
|
|
3776
3854
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3812,7 +3890,7 @@
|
|
|
3812
3890
|
content = "",
|
|
3813
3891
|
children = null,
|
|
3814
3892
|
className = "",
|
|
3815
|
-
...
|
|
3893
|
+
...props2
|
|
3816
3894
|
}) => {
|
|
3817
3895
|
const classes = ClassNames("usa-summary-box", "usx-summary-box", className);
|
|
3818
3896
|
const headingId = id;
|
|
@@ -3823,7 +3901,7 @@
|
|
|
3823
3901
|
className: classes,
|
|
3824
3902
|
role: "region",
|
|
3825
3903
|
"aria-labelledby": headingId,
|
|
3826
|
-
...
|
|
3904
|
+
...props2,
|
|
3827
3905
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-summary-box__body", children: [
|
|
3828
3906
|
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-summary-box__heading", id: headingId, children: heading }),
|
|
3829
3907
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-summary-box__text", children: bodyContent })
|
|
@@ -3841,7 +3919,7 @@
|
|
|
3841
3919
|
inputProps = {},
|
|
3842
3920
|
onClassName = "",
|
|
3843
3921
|
offClassName = "",
|
|
3844
|
-
...
|
|
3922
|
+
...props2
|
|
3845
3923
|
}) => {
|
|
3846
3924
|
const variantClass = variant !== "default" ? `usx-swap--${variant}` : "";
|
|
3847
3925
|
const classes = ClassNames("usx-swap", variantClass, className);
|
|
@@ -3852,7 +3930,7 @@
|
|
|
3852
3930
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: onClasses, children: onContent }),
|
|
3853
3931
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: offClasses, children: offContent })
|
|
3854
3932
|
] });
|
|
3855
|
-
return /* @__PURE__ */ jsxRuntime.jsx("label", { className: classes, ...
|
|
3933
|
+
return /* @__PURE__ */ jsxRuntime.jsx("label", { className: classes, ...props2, children: content });
|
|
3856
3934
|
};
|
|
3857
3935
|
const Switch = ({
|
|
3858
3936
|
id,
|
|
@@ -3866,7 +3944,7 @@
|
|
|
3866
3944
|
className = "",
|
|
3867
3945
|
label,
|
|
3868
3946
|
indeterminate = false,
|
|
3869
|
-
...
|
|
3947
|
+
...props2
|
|
3870
3948
|
}) => {
|
|
3871
3949
|
const classes = ClassNames(
|
|
3872
3950
|
"usx-switch",
|
|
@@ -3890,7 +3968,7 @@
|
|
|
3890
3968
|
disabled,
|
|
3891
3969
|
"aria-checked": indeterminate ? "mixed" : typeof checked === "boolean" ? checked : void 0,
|
|
3892
3970
|
onChange,
|
|
3893
|
-
...
|
|
3971
|
+
...props2
|
|
3894
3972
|
};
|
|
3895
3973
|
const input = /* @__PURE__ */ jsxRuntime.jsx("input", { ref, ...inputProps });
|
|
3896
3974
|
if (label) {
|
|
@@ -3973,10 +4051,10 @@
|
|
|
3973
4051
|
const name = direction === "asc" ? "arrow_upward" : direction === "desc" ? "arrow_downward" : "sort_arrow";
|
|
3974
4052
|
return /* @__PURE__ */ jsxRuntime.jsx(Icon, { name, "aria-hidden": "true" });
|
|
3975
4053
|
}
|
|
3976
|
-
function TableHead({ className = "", children, ...
|
|
4054
|
+
function TableHead({ className = "", children, ...props2 }) {
|
|
3977
4055
|
const { id, columns, sortState, handleSort, selectionMode, selectionPosition, handleSelectAll, allowSelectAll, rowDetails } = useTableContext();
|
|
3978
4056
|
if (children) {
|
|
3979
|
-
return /* @__PURE__ */ jsxRuntime.jsx("thead", { className: ClassNames("usx-table__head", className), ...
|
|
4057
|
+
return /* @__PURE__ */ jsxRuntime.jsx("thead", { className: ClassNames("usx-table__head", className), ...props2, children });
|
|
3980
4058
|
}
|
|
3981
4059
|
const visibleCols = columns.filter((c) => !c.hidden);
|
|
3982
4060
|
const totalDepth = getDepth(visibleCols);
|
|
@@ -3984,7 +4062,7 @@
|
|
|
3984
4062
|
const hasRowDetails = !!rowDetails;
|
|
3985
4063
|
const hasSelection = !!selectionMode;
|
|
3986
4064
|
const selectAllCell = /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", rowSpan: totalDepth, className: "usx-table__cell usx-table__cell--selection", children: selectionMode === "checkbox" && allowSelectAll && /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { id: `${id}-select-all`, onChange: handleSelectAll, ariaLabel: "Select all rows", className: "usx-table__checkbox" }) });
|
|
3987
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("thead", { className: ClassNames("usx-table__head", className), ...
|
|
4065
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("thead", { className: ClassNames("usx-table__head", className), ...props2, children: [
|
|
3988
4066
|
/* @__PURE__ */ jsxRuntime.jsx("tr", { hidden: true, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("td", { children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-sr-only usa-table__announcement-region", "aria-live": "polite", id: `${id}-sort-announcement` }) }) }),
|
|
3989
4067
|
headerRows.map((row, rowIndex) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "usx-table__head-row", children: [
|
|
3990
4068
|
hasRowDetails && rowIndex === 0 && /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", rowSpan: totalDepth, className: "usx-table__cell usx-table__cell--detail-toggle", "aria-label": "Row details" }),
|
|
@@ -4036,7 +4114,7 @@
|
|
|
4036
4114
|
className = "",
|
|
4037
4115
|
onClick,
|
|
4038
4116
|
children,
|
|
4039
|
-
...
|
|
4117
|
+
...props2
|
|
4040
4118
|
}) {
|
|
4041
4119
|
const { onClickRow } = useTableContext();
|
|
4042
4120
|
const isClickable = !!(onClick || onClickRow);
|
|
@@ -4060,7 +4138,7 @@
|
|
|
4060
4138
|
}
|
|
4061
4139
|
}
|
|
4062
4140
|
const interactiveProps = isClickable && !disabled ? { tabIndex: 0, onClick: handleClick, onKeyDown: handleKeyDown } : {};
|
|
4063
|
-
return /* @__PURE__ */ jsxRuntime.jsx("tr", { className: classes, ...interactiveProps, ...
|
|
4141
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tr", { className: classes, ...interactiveProps, ...props2, children });
|
|
4064
4142
|
}
|
|
4065
4143
|
function TableGroup({
|
|
4066
4144
|
label,
|
|
@@ -4070,7 +4148,7 @@
|
|
|
4070
4148
|
colSpan,
|
|
4071
4149
|
className = "",
|
|
4072
4150
|
children,
|
|
4073
|
-
...
|
|
4151
|
+
...props2
|
|
4074
4152
|
}) {
|
|
4075
4153
|
const { toggleGroup, isGroupExpanded, totalCols } = useTableContext();
|
|
4076
4154
|
const isExpanded = expandedProp !== void 0 ? expandedProp : isGroupExpanded(groupKey);
|
|
@@ -4086,7 +4164,7 @@
|
|
|
4086
4164
|
}
|
|
4087
4165
|
};
|
|
4088
4166
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4089
|
-
/* @__PURE__ */ jsxRuntime.jsx("tr", { className: ClassNames("usx-table__group-row", className), ...
|
|
4167
|
+
/* @__PURE__ */ jsxRuntime.jsx("tr", { className: ClassNames("usx-table__group-row", className), ...props2, children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: colSpan || totalCols || 1, className: "usx-table__group-cell", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-accordion usa-accordion", children: /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "usa-accordion__heading", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4090
4168
|
"button",
|
|
4091
4169
|
{
|
|
4092
4170
|
type: "button",
|
|
@@ -4227,25 +4305,25 @@
|
|
|
4227
4305
|
hasRowDetails && isExpanded && renderDetail && /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "usx-table__detail-row", children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__detail-cell", colSpan: totalCols, children: renderDetail(row) }) })
|
|
4228
4306
|
] });
|
|
4229
4307
|
}
|
|
4230
|
-
function TableBody({ className = "", children, ...
|
|
4308
|
+
function TableBody({ className = "", children, ...props2 }) {
|
|
4231
4309
|
const { data, primaryKey, groupBy, groups, placeholder, totalCols, onMore, loading } = useTableContext();
|
|
4232
4310
|
const bodyClass = ClassNames("usx-table__body", className);
|
|
4233
4311
|
if (children) {
|
|
4234
|
-
return /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: bodyClass, ...
|
|
4312
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: bodyClass, ...props2, children });
|
|
4235
4313
|
}
|
|
4236
4314
|
const placeholderRow = data.length === 0 && placeholder ? /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "usx-table__placeholder-row", children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__placeholder-cell", colSpan: totalCols, children: placeholder }) }) : null;
|
|
4237
4315
|
const sentinel = onMore ? /* @__PURE__ */ jsxRuntime.jsx(OnMoreSentinel, { onMore }) : null;
|
|
4238
4316
|
const loadingRow = loading ? /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "usx-table__loading-row", "aria-live": "polite", children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__loading-cell", colSpan: totalCols, children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 3, label: "Loading more rows…" }) }) }) : null;
|
|
4239
4317
|
const renderRows = (rows) => rows.map((row, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(DataRow, { row, rowIndex }, row[primaryKey] ?? rowIndex));
|
|
4240
4318
|
if (!groupBy) {
|
|
4241
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("tbody", { className: bodyClass, ...
|
|
4319
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("tbody", { className: bodyClass, ...props2, children: [
|
|
4242
4320
|
placeholderRow,
|
|
4243
4321
|
renderRows(data),
|
|
4244
4322
|
loadingRow,
|
|
4245
4323
|
sentinel
|
|
4246
4324
|
] });
|
|
4247
4325
|
}
|
|
4248
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("tbody", { className: bodyClass, ...
|
|
4326
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("tbody", { className: bodyClass, ...props2, children: [
|
|
4249
4327
|
placeholderRow,
|
|
4250
4328
|
(groups || []).map(({ key, rows }) => /* @__PURE__ */ jsxRuntime.jsx(TableGroup, { groupKey: key, label: key, children: renderRows(rows) }, key)),
|
|
4251
4329
|
loadingRow,
|
|
@@ -4270,15 +4348,15 @@
|
|
|
4270
4348
|
return "--";
|
|
4271
4349
|
}
|
|
4272
4350
|
}
|
|
4273
|
-
function TableFoot({ className = "", children, ...
|
|
4351
|
+
function TableFoot({ className = "", children, ...props2 }) {
|
|
4274
4352
|
const { columns, data, selectionMode, rowDetails } = useTableContext();
|
|
4275
4353
|
if (children) {
|
|
4276
|
-
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...
|
|
4354
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...props2, children });
|
|
4277
4355
|
}
|
|
4278
4356
|
const visibleCols = columns.filter((c) => !c.hidden);
|
|
4279
4357
|
const hasFooter = visibleCols.some((c) => c.footer !== void 0 || c.aggregate);
|
|
4280
4358
|
if (!hasFooter) return null;
|
|
4281
|
-
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...
|
|
4359
|
+
return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "usx-table__foot-row", children: [
|
|
4282
4360
|
!!rowDetails && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__cell" }),
|
|
4283
4361
|
!!selectionMode && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "usx-table__cell usx-table__cell--selection" }),
|
|
4284
4362
|
visibleCols.map((col) => {
|
|
@@ -4302,11 +4380,11 @@
|
|
|
4302
4380
|
dataLabel,
|
|
4303
4381
|
className = "",
|
|
4304
4382
|
children,
|
|
4305
|
-
...
|
|
4383
|
+
...props2
|
|
4306
4384
|
}) {
|
|
4307
4385
|
const resolvedAlign = Tag2 === "th" ? headerAlign || align : align;
|
|
4308
4386
|
const classes = ClassNames("usx-table__cell", resolvedAlign && `usx-table__cell--align-${resolvedAlign}`, className);
|
|
4309
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, colSpan, rowSpan, scope, "data-label": dataLabel, ...
|
|
4387
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: classes, colSpan, rowSpan, scope, "data-label": dataLabel, ...props2, children });
|
|
4310
4388
|
}
|
|
4311
4389
|
function defaultCompareFn(a, b, key) {
|
|
4312
4390
|
const va = a[key];
|
|
@@ -4400,11 +4478,11 @@
|
|
|
4400
4478
|
return { selectedKeys, handleSelect, handleSelectAll, isSelected, isAllSelected, isIndeterminate };
|
|
4401
4479
|
}
|
|
4402
4480
|
function useTableGroups({ groupBy, data = [] }) {
|
|
4403
|
-
const
|
|
4404
|
-
const groupByProp = typeof groupBy === "string" ? groupBy :
|
|
4405
|
-
const expandProp =
|
|
4406
|
-
const onExpandProp =
|
|
4407
|
-
const defaultExpanded =
|
|
4481
|
+
const config2 = typeof groupBy === "object" && groupBy !== null ? groupBy : null;
|
|
4482
|
+
const groupByProp = typeof groupBy === "string" ? groupBy : config2 == null ? void 0 : config2.property;
|
|
4483
|
+
const expandProp = config2 == null ? void 0 : config2.expand;
|
|
4484
|
+
const onExpandProp = config2 == null ? void 0 : config2.onExpand;
|
|
4485
|
+
const defaultExpanded = config2 ? config2.defaultExpanded : true;
|
|
4408
4486
|
const isControlled = expandProp !== void 0 && expandProp !== null;
|
|
4409
4487
|
const [internalExpanded, setInternalExpanded] = React.useState(() => {
|
|
4410
4488
|
if (expandProp) return new Set(expandProp.map(String));
|
|
@@ -4446,9 +4524,9 @@
|
|
|
4446
4524
|
return { groups, expandedGroups, toggleGroup, isGroupExpanded };
|
|
4447
4525
|
}
|
|
4448
4526
|
function useRowDetails({ rowDetails }) {
|
|
4449
|
-
const
|
|
4450
|
-
const expandProp =
|
|
4451
|
-
const onExpandProp =
|
|
4527
|
+
const config2 = rowDetails && typeof rowDetails === "object" ? rowDetails : null;
|
|
4528
|
+
const expandProp = config2 == null ? void 0 : config2.expand;
|
|
4529
|
+
const onExpandProp = config2 == null ? void 0 : config2.onExpand;
|
|
4452
4530
|
const isControlled = expandProp !== void 0 && expandProp !== null;
|
|
4453
4531
|
const [internalExpanded, setInternalExpanded] = React.useState(() => new Set(expandProp || []));
|
|
4454
4532
|
const expandedRows = React.useMemo(
|
|
@@ -4512,7 +4590,7 @@
|
|
|
4512
4590
|
placeholder,
|
|
4513
4591
|
className = "",
|
|
4514
4592
|
children,
|
|
4515
|
-
...
|
|
4593
|
+
...props2
|
|
4516
4594
|
}) {
|
|
4517
4595
|
const generatedId = React.useId();
|
|
4518
4596
|
const id = idProp ?? `usx-table-${generatedId}`;
|
|
@@ -4629,7 +4707,7 @@
|
|
|
4629
4707
|
stickyFirstColumn && "usx-table--sticky-first-col",
|
|
4630
4708
|
className
|
|
4631
4709
|
);
|
|
4632
|
-
const tableEl = /* @__PURE__ */ jsxRuntime.jsxs("table", { id: idProp, className: tableClasses, ...
|
|
4710
|
+
const tableEl = /* @__PURE__ */ jsxRuntime.jsxs("table", { id: idProp, className: tableClasses, ...props2, children: [
|
|
4633
4711
|
caption && /* @__PURE__ */ jsxRuntime.jsx(Caption, { children: caption }),
|
|
4634
4712
|
children || /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4635
4713
|
/* @__PURE__ */ jsxRuntime.jsx(TableHead, {}),
|
|
@@ -4685,14 +4763,14 @@
|
|
|
4685
4763
|
tagProps = null,
|
|
4686
4764
|
children = null,
|
|
4687
4765
|
className = "",
|
|
4688
|
-
...
|
|
4766
|
+
...props2
|
|
4689
4767
|
}) => {
|
|
4690
4768
|
const classes = ClassNames(
|
|
4691
4769
|
"usx-tag-group",
|
|
4692
4770
|
className
|
|
4693
4771
|
);
|
|
4694
4772
|
const content = children ? children : Array.isArray(tagProps) ? tagProps.map((t, i) => /* @__PURE__ */ jsxRuntime.jsx(Tag, { ...t }, t.id || t.value || i)) : null;
|
|
4695
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...
|
|
4773
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: content });
|
|
4696
4774
|
};
|
|
4697
4775
|
function TaskList({ tasks = [], className }) {
|
|
4698
4776
|
return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: ClassNames("usx-task-list", className), children: tasks == null ? void 0 : tasks.map((task, i) => {
|
|
@@ -4786,7 +4864,7 @@
|
|
|
4786
4864
|
step = null,
|
|
4787
4865
|
formGroup = true,
|
|
4788
4866
|
className = "",
|
|
4789
|
-
...
|
|
4867
|
+
...props2
|
|
4790
4868
|
}) {
|
|
4791
4869
|
const labelId = `${id}-label`;
|
|
4792
4870
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
@@ -4820,7 +4898,7 @@
|
|
|
4820
4898
|
disabled,
|
|
4821
4899
|
"aria-disabled": !disabled && ariaDisabled ? "true" : void 0,
|
|
4822
4900
|
required,
|
|
4823
|
-
...
|
|
4901
|
+
...props2
|
|
4824
4902
|
}
|
|
4825
4903
|
)
|
|
4826
4904
|
}
|
|
@@ -4842,7 +4920,7 @@
|
|
|
4842
4920
|
className,
|
|
4843
4921
|
"aria-label": nativeAriaLabel,
|
|
4844
4922
|
"aria-labelledby": labelledBy,
|
|
4845
|
-
...
|
|
4923
|
+
...props2
|
|
4846
4924
|
}) {
|
|
4847
4925
|
const instanceId = React.useId();
|
|
4848
4926
|
const groupId = id || `toggle-${instanceId}`;
|
|
@@ -4851,7 +4929,7 @@
|
|
|
4851
4929
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4852
4930
|
"ul",
|
|
4853
4931
|
{
|
|
4854
|
-
...
|
|
4932
|
+
...props2,
|
|
4855
4933
|
id: groupId,
|
|
4856
4934
|
className: ClassNames(
|
|
4857
4935
|
"usx-toggle",
|
|
@@ -4912,10 +4990,10 @@
|
|
|
4912
4990
|
button = null,
|
|
4913
4991
|
ariaLabel = "Introduction",
|
|
4914
4992
|
className = "",
|
|
4915
|
-
...
|
|
4993
|
+
...props2
|
|
4916
4994
|
}) => {
|
|
4917
4995
|
const classes = ClassNames("usa-hero", className);
|
|
4918
|
-
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: classes, "aria-label": ariaLabel, ...
|
|
4996
|
+
return /* @__PURE__ */ jsxRuntime.jsx("section", { className: classes, "aria-label": ariaLabel, ...props2, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-container", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-hero__callout", children: [
|
|
4919
4997
|
/* @__PURE__ */ jsxRuntime.jsxs("h1", { className: "usa-hero__heading", children: [
|
|
4920
4998
|
callout && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-hero__heading--alt", children: callout }),
|
|
4921
4999
|
title
|
|
@@ -4946,6 +5024,7 @@
|
|
|
4946
5024
|
exports2.Code = Code;
|
|
4947
5025
|
exports2.Collection = Collection;
|
|
4948
5026
|
exports2.Combobox = Combobox;
|
|
5027
|
+
exports2.Container = Container;
|
|
4949
5028
|
exports2.CopyToClipboard = CopyToClipboard;
|
|
4950
5029
|
exports2.DatePicker = DatePicker;
|
|
4951
5030
|
exports2.DateRangePicker = DateRangePicker;
|