@solexllc/usx-react 0.5.0 → 0.6.1
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.js
CHANGED
|
@@ -121,7 +121,7 @@ function Accordion({
|
|
|
121
121
|
className = "",
|
|
122
122
|
headingClassName = "",
|
|
123
123
|
contentClassName = "",
|
|
124
|
-
...
|
|
124
|
+
...props2
|
|
125
125
|
}) {
|
|
126
126
|
const accordionClasses = ClassNames(
|
|
127
127
|
"usa-accordion",
|
|
@@ -136,7 +136,7 @@ function Accordion({
|
|
|
136
136
|
id,
|
|
137
137
|
className: accordionClasses,
|
|
138
138
|
"data-allow-multiple": multiselectable ? true : void 0,
|
|
139
|
-
...
|
|
139
|
+
...props2,
|
|
140
140
|
children: items.map((item) => /* @__PURE__ */ jsx(
|
|
141
141
|
AccordionItem,
|
|
142
142
|
{
|
|
@@ -167,7 +167,7 @@ function Icon({
|
|
|
167
167
|
staticBaseUrl,
|
|
168
168
|
staticUrlPrefix,
|
|
169
169
|
className = "",
|
|
170
|
-
...
|
|
170
|
+
...props2
|
|
171
171
|
}) {
|
|
172
172
|
const spritePrefix = staticUrlPrefix ?? getAssetUrl(`img/${source === "usx" ? "usx-sprite.svg" : "sprite.svg"}#`, staticBaseUrl);
|
|
173
173
|
return /* @__PURE__ */ jsx(
|
|
@@ -178,7 +178,7 @@ function Icon({
|
|
|
178
178
|
"aria-label": alt,
|
|
179
179
|
focusable: "false",
|
|
180
180
|
role: "img",
|
|
181
|
-
...
|
|
181
|
+
...props2,
|
|
182
182
|
children: /* @__PURE__ */ jsx("use", { href: spritePrefix + name })
|
|
183
183
|
}
|
|
184
184
|
);
|
|
@@ -196,7 +196,7 @@ function Alert({
|
|
|
196
196
|
onDismiss = void 0,
|
|
197
197
|
staticBaseUrl,
|
|
198
198
|
children = null,
|
|
199
|
-
...
|
|
199
|
+
...props2
|
|
200
200
|
}) {
|
|
201
201
|
const normalizedVariant = variant && ["info", "warning", "success", "error", "emergency"].includes(variant) ? variant : null;
|
|
202
202
|
const classes = ClassNames(
|
|
@@ -218,7 +218,7 @@ function Alert({
|
|
|
218
218
|
} else if (resolvedRole === "region") {
|
|
219
219
|
accessibilityProps["aria-label"] = heading || `${normalizedVariant} alert`;
|
|
220
220
|
}
|
|
221
|
-
return /* @__PURE__ */ jsx("div", { className: classes, ...accessibilityProps, ...
|
|
221
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...accessibilityProps, ...props2, children: /* @__PURE__ */ jsxs("div", { className: "usa-alert__body", children: [
|
|
222
222
|
!slim && heading ? /* @__PURE__ */ jsx("h4", { className: "usa-alert__heading", children: heading }) : null,
|
|
223
223
|
children ? /* @__PURE__ */ jsx("div", { className: "usa-alert__text", children }) : /* @__PURE__ */ jsx("p", { className: "usa-alert__text", children: text }),
|
|
224
224
|
onDismiss && /* @__PURE__ */ jsx("button", { className: "usx-alert__dismiss", "aria-label": "Dismiss alert", onClick: onDismiss, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 3, staticBaseUrl }) })
|
|
@@ -242,7 +242,7 @@ function Avatar({
|
|
|
242
242
|
className = "",
|
|
243
243
|
imageClassName = "",
|
|
244
244
|
contentClassName = "",
|
|
245
|
-
...
|
|
245
|
+
...props2
|
|
246
246
|
}) {
|
|
247
247
|
const isInitialsVariant = variant === "initials";
|
|
248
248
|
const isIconVariant = variant === "icon";
|
|
@@ -260,7 +260,7 @@ function Avatar({
|
|
|
260
260
|
shape ? shapeClassMap[shape] : "usx-circle",
|
|
261
261
|
contentClassName
|
|
262
262
|
);
|
|
263
|
-
const avatarContent = isInitialsVariant ? /* @__PURE__ */ jsx("span", { className: contentClasses, children: value }) : isIconVariant ? /* @__PURE__ */ jsx("span", { className: contentClasses, children: /* @__PURE__ */ jsx(Icon, { name: value, alt: alt || `${value} icon` }) }) : /* @__PURE__ */ jsx("img", { className: imgClasses, src: src || void 0, alt: alt || void 0, role: "img", ...
|
|
263
|
+
const avatarContent = isInitialsVariant ? /* @__PURE__ */ jsx("span", { className: contentClasses, children: value }) : isIconVariant ? /* @__PURE__ */ jsx("span", { className: contentClasses, children: /* @__PURE__ */ jsx(Icon, { name: value, alt: alt || `${value} icon` }) }) : /* @__PURE__ */ jsx("img", { className: imgClasses, src: src || void 0, alt: alt || void 0, role: "img", ...props2 });
|
|
264
264
|
const avatar = /* @__PURE__ */ jsx("a", { href, className: wrapperClasses, "aria-label": isInitialsVariant || isIconVariant ? alt || void 0 : void 0, children: avatarContent });
|
|
265
265
|
if (tooltip) {
|
|
266
266
|
return /* @__PURE__ */ jsxs("span", { className: "usx-tooltip", children: [
|
|
@@ -277,7 +277,7 @@ function Attribution({
|
|
|
277
277
|
secondary,
|
|
278
278
|
children = null,
|
|
279
279
|
className = "",
|
|
280
|
-
...
|
|
280
|
+
...props2
|
|
281
281
|
}) {
|
|
282
282
|
const classes = ClassNames("usx-attribution", className);
|
|
283
283
|
const mediaContent = avatarProps ? /* @__PURE__ */ jsx(Avatar, { ...avatarProps }) : media;
|
|
@@ -288,16 +288,16 @@ function Attribution({
|
|
|
288
288
|
/* @__PURE__ */ jsx("span", { className: "usx-attribution__secondary", children: secondary })
|
|
289
289
|
] })
|
|
290
290
|
] });
|
|
291
|
-
return /* @__PURE__ */ jsx("div", { className: classes, ...
|
|
291
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: content });
|
|
292
292
|
}
|
|
293
|
-
function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, className = "", ...
|
|
293
|
+
function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, className = "", ...props2 }) {
|
|
294
294
|
const classes = ClassNames(
|
|
295
295
|
"usx-avatar-group",
|
|
296
296
|
overlap && "usa-avatar-group--overlap",
|
|
297
297
|
stacked && "usa-avatar-group--stacked",
|
|
298
298
|
className
|
|
299
299
|
);
|
|
300
|
-
return /* @__PURE__ */ jsx("div", { className: classes, ...
|
|
300
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: avatarProps.map((avatar, index) => /* @__PURE__ */ jsx(
|
|
301
301
|
Avatar,
|
|
302
302
|
{
|
|
303
303
|
href: avatar.href,
|
|
@@ -321,7 +321,7 @@ function BackToTop({
|
|
|
321
321
|
iconSize = 2,
|
|
322
322
|
className = "",
|
|
323
323
|
onClick = void 0,
|
|
324
|
-
...
|
|
324
|
+
...props2
|
|
325
325
|
}) {
|
|
326
326
|
const icon = /* @__PURE__ */ jsx(Icon, { name: "arrow_upward", size: iconSize, className: ClassNames(
|
|
327
327
|
iconPosition === "left" ? "margin-right-05" : "margin-left-05"
|
|
@@ -333,7 +333,7 @@ function BackToTop({
|
|
|
333
333
|
"flex-align-center",
|
|
334
334
|
className
|
|
335
335
|
);
|
|
336
|
-
return /* @__PURE__ */ jsxs("a", { className: linkClasses, href, ...
|
|
336
|
+
return /* @__PURE__ */ jsxs("a", { className: linkClasses, href, ...props2, children: [
|
|
337
337
|
iconPosition === "left" && icon,
|
|
338
338
|
label,
|
|
339
339
|
iconPosition === "right" && icon
|
|
@@ -352,7 +352,7 @@ function BackToTop({
|
|
|
352
352
|
type: "button",
|
|
353
353
|
className: buttonClasses,
|
|
354
354
|
onClick: onClick || (() => window.scrollTo({ top: 0, behavior: "smooth" })),
|
|
355
|
-
...
|
|
355
|
+
...props2,
|
|
356
356
|
children: [
|
|
357
357
|
iconPosition === "left" && icon,
|
|
358
358
|
label,
|
|
@@ -384,14 +384,14 @@ function Banner({
|
|
|
384
384
|
" website. Share sensitive information only on official, secure websites."
|
|
385
385
|
] }),
|
|
386
386
|
className = "",
|
|
387
|
-
...
|
|
387
|
+
...props2
|
|
388
388
|
}) {
|
|
389
389
|
const classes = ClassNames(
|
|
390
390
|
"usa-banner",
|
|
391
391
|
"usx-banner",
|
|
392
392
|
className
|
|
393
393
|
);
|
|
394
|
-
return /* @__PURE__ */ jsx("section", { id, className: classes, "aria-label": ariaLabel, ...
|
|
394
|
+
return /* @__PURE__ */ jsx("section", { id, className: classes, "aria-label": ariaLabel, ...props2, children: /* @__PURE__ */ jsxs("div", { id: `${id}-accordion`, className: "usa-accordion", children: [
|
|
395
395
|
/* @__PURE__ */ jsx("header", { className: "usa-banner__header", children: /* @__PURE__ */ jsxs("div", { className: "usa-banner__inner", children: [
|
|
396
396
|
/* @__PURE__ */ jsx("div", { className: "grid-col-auto", children: /* @__PURE__ */ jsx(
|
|
397
397
|
"img",
|
|
@@ -478,11 +478,11 @@ function Breadcrumb({
|
|
|
478
478
|
ariaLabel = "Breadcrumbs",
|
|
479
479
|
className = "",
|
|
480
480
|
children = null,
|
|
481
|
-
...
|
|
481
|
+
...props2
|
|
482
482
|
}) {
|
|
483
483
|
if (!items || items.length === 0) {
|
|
484
484
|
const classes = ClassNames("usx-breadcrumb", className);
|
|
485
|
-
return /* @__PURE__ */ jsx("div", { className: classes, ...
|
|
485
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: children || "Breadcrumb" });
|
|
486
486
|
}
|
|
487
487
|
const navClasses = ClassNames(
|
|
488
488
|
"usa-breadcrumb",
|
|
@@ -491,7 +491,7 @@ function Breadcrumb({
|
|
|
491
491
|
truncate ? "usa-breadcrumb--truncate" : null,
|
|
492
492
|
className
|
|
493
493
|
);
|
|
494
|
-
return /* @__PURE__ */ jsx("nav", { className: navClasses, "aria-label": ariaLabel, ...
|
|
494
|
+
return /* @__PURE__ */ jsx("nav", { className: navClasses, "aria-label": ariaLabel, ...props2, children: /* @__PURE__ */ jsx(
|
|
495
495
|
"ol",
|
|
496
496
|
{
|
|
497
497
|
className: "usa-breadcrumb__list",
|
|
@@ -528,11 +528,11 @@ const Required = ({
|
|
|
528
528
|
title = "Required",
|
|
529
529
|
children = null,
|
|
530
530
|
className = "",
|
|
531
|
-
...
|
|
531
|
+
...props2
|
|
532
532
|
}) => {
|
|
533
533
|
const classes = ClassNames("usx-required", className);
|
|
534
534
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
535
|
-
/* @__PURE__ */ jsx("abbr", { title, className: classes, ...
|
|
535
|
+
/* @__PURE__ */ jsx("abbr", { title, className: classes, ...props2, children: "*" }),
|
|
536
536
|
" ",
|
|
537
537
|
children ? children : ""
|
|
538
538
|
] });
|
|
@@ -545,7 +545,7 @@ function Label({
|
|
|
545
545
|
screenReaderOnly = false,
|
|
546
546
|
className = "",
|
|
547
547
|
classOverride = false,
|
|
548
|
-
...
|
|
548
|
+
...props2
|
|
549
549
|
}) {
|
|
550
550
|
const classes = ClassNames(
|
|
551
551
|
"usa-label",
|
|
@@ -558,7 +558,7 @@ function Label({
|
|
|
558
558
|
{
|
|
559
559
|
className: classOverride ? className : classes,
|
|
560
560
|
...htmlFor ? { htmlFor } : {},
|
|
561
|
-
...
|
|
561
|
+
...props2,
|
|
562
562
|
children: [
|
|
563
563
|
required && /* @__PURE__ */ jsx(Required, {}),
|
|
564
564
|
children
|
|
@@ -574,9 +574,9 @@ const Spinner = ({
|
|
|
574
574
|
staticUrlPrefix,
|
|
575
575
|
staticBaseUrl,
|
|
576
576
|
className = "",
|
|
577
|
-
...
|
|
577
|
+
...props2
|
|
578
578
|
}) => {
|
|
579
|
-
return /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", className: `usx-spinner ${className}`, ...
|
|
579
|
+
return /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", className: `usx-spinner ${className}`, ...props2, children: [
|
|
580
580
|
/* @__PURE__ */ jsx(
|
|
581
581
|
Icon,
|
|
582
582
|
{
|
|
@@ -607,7 +607,7 @@ function Button({
|
|
|
607
607
|
className = "",
|
|
608
608
|
children = "",
|
|
609
609
|
extraAttributes = {},
|
|
610
|
-
...
|
|
610
|
+
...props2
|
|
611
611
|
}) {
|
|
612
612
|
const leftIcons = iconProps.filter((icon) => (icon.position ?? "left") === "left");
|
|
613
613
|
const rightIcons = iconProps.filter((icon) => icon.position === "right");
|
|
@@ -638,7 +638,7 @@ function Button({
|
|
|
638
638
|
const {
|
|
639
639
|
// Remove unused variables
|
|
640
640
|
...anchorProps
|
|
641
|
-
} =
|
|
641
|
+
} = props2;
|
|
642
642
|
return /* @__PURE__ */ jsxs(
|
|
643
643
|
"a",
|
|
644
644
|
{
|
|
@@ -659,7 +659,7 @@ function Button({
|
|
|
659
659
|
const {
|
|
660
660
|
// Remove unused variables
|
|
661
661
|
...buttonProps
|
|
662
|
-
} =
|
|
662
|
+
} = props2;
|
|
663
663
|
return /* @__PURE__ */ jsxs(
|
|
664
664
|
"button",
|
|
665
665
|
{
|
|
@@ -682,14 +682,14 @@ function ButtonGroup({
|
|
|
682
682
|
buttonProps = [],
|
|
683
683
|
segmented = false,
|
|
684
684
|
className = "",
|
|
685
|
-
...
|
|
685
|
+
...props2
|
|
686
686
|
}) {
|
|
687
687
|
const classes = ClassNames(
|
|
688
688
|
"usa-button-group usx-button-group",
|
|
689
689
|
segmented && "usa-button-group--segmented",
|
|
690
690
|
className
|
|
691
691
|
);
|
|
692
|
-
return /* @__PURE__ */ jsx("ul", { className: classes, ...
|
|
692
|
+
return /* @__PURE__ */ jsx("ul", { className: classes, ...props2, children: buttonProps.map(({ itemClassName, ...item }, index) => /* @__PURE__ */ jsx("li", { className: ClassNames("usa-button-group__item", itemClassName), children: /* @__PURE__ */ jsx(Button, { ...item, children: item.children }) }, index)) });
|
|
693
693
|
}
|
|
694
694
|
function CalendarDate({
|
|
695
695
|
datetime,
|
|
@@ -727,7 +727,7 @@ function Callout({
|
|
|
727
727
|
backgroundColor,
|
|
728
728
|
textColor,
|
|
729
729
|
element = "div",
|
|
730
|
-
...
|
|
730
|
+
...props2
|
|
731
731
|
}) {
|
|
732
732
|
const Element = element;
|
|
733
733
|
return /* @__PURE__ */ jsx(
|
|
@@ -736,7 +736,7 @@ function Callout({
|
|
|
736
736
|
className: ClassNames(
|
|
737
737
|
"usx-callout",
|
|
738
738
|
orientation === "vertical" && "usx-callout--vertical",
|
|
739
|
-
strokeColor && `
|
|
739
|
+
strokeColor && `border-${strokeColor}`,
|
|
740
740
|
indent && `usx-callout--indent-${indent}`,
|
|
741
741
|
dedent && "usx-callout--dedent",
|
|
742
742
|
(big ?? orientation === "horizontal") && "usx-callout--big",
|
|
@@ -744,7 +744,7 @@ function Callout({
|
|
|
744
744
|
textColor && `text-${textColor}`,
|
|
745
745
|
className
|
|
746
746
|
),
|
|
747
|
-
...
|
|
747
|
+
...props2,
|
|
748
748
|
children: children ?? content
|
|
749
749
|
}
|
|
750
750
|
);
|
|
@@ -762,7 +762,7 @@ const Tag = ({
|
|
|
762
762
|
},
|
|
763
763
|
className = "",
|
|
764
764
|
children,
|
|
765
|
-
...
|
|
765
|
+
...props2
|
|
766
766
|
}) => {
|
|
767
767
|
const [isVisible, setIsVisible] = useState(!isDismissed);
|
|
768
768
|
const classes = ClassNames(
|
|
@@ -784,7 +784,7 @@ const Tag = ({
|
|
|
784
784
|
if (!isVisible) {
|
|
785
785
|
return null;
|
|
786
786
|
}
|
|
787
|
-
return /* @__PURE__ */ jsxs("span", { id, className: classes, ...
|
|
787
|
+
return /* @__PURE__ */ jsxs("span", { id, className: classes, ...props2, children: [
|
|
788
788
|
icon && /* @__PURE__ */ jsx(Icon, { name: icon, size: big ? 3 : 2 }),
|
|
789
789
|
" ",
|
|
790
790
|
children || value,
|
|
@@ -814,7 +814,7 @@ function Image({
|
|
|
814
814
|
staticBaseUrl,
|
|
815
815
|
srcSet,
|
|
816
816
|
className = "",
|
|
817
|
-
...
|
|
817
|
+
...props2
|
|
818
818
|
}) {
|
|
819
819
|
const classes = ClassNames(
|
|
820
820
|
"usx-image",
|
|
@@ -846,8 +846,8 @@ function Image({
|
|
|
846
846
|
},
|
|
847
847
|
i
|
|
848
848
|
)),
|
|
849
|
-
/* @__PURE__ */ jsx("img", { src: getAssetUrl(src.fallback, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...
|
|
850
|
-
] }) : /* @__PURE__ */ jsx("img", { src: getAssetUrl(src, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...
|
|
849
|
+
/* @__PURE__ */ jsx("img", { src: getAssetUrl(src.fallback, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props2 })
|
|
850
|
+
] }) : /* @__PURE__ */ jsx("img", { src: getAssetUrl(src, staticBaseUrl), srcSet: srcSet ? getAssetSrcSet(srcSet, staticBaseUrl) : void 0, alt, style, ...props2 });
|
|
851
851
|
if (caption) {
|
|
852
852
|
return /* @__PURE__ */ jsxs("figure", { className: classes, style, children: [
|
|
853
853
|
imgElement,
|
|
@@ -898,12 +898,12 @@ function Carousel({
|
|
|
898
898
|
showDots = true,
|
|
899
899
|
children = null,
|
|
900
900
|
slideIds = [],
|
|
901
|
-
...
|
|
901
|
+
...props2
|
|
902
902
|
}) {
|
|
903
903
|
var _a;
|
|
904
904
|
const classes = ClassNames("usx-carousel", className);
|
|
905
905
|
const childArray = React.Children.toArray(children).filter(Boolean);
|
|
906
|
-
return /* @__PURE__ */ jsxs("div", { className: classes, ...
|
|
906
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, ...props2, role: "region", "aria-roledescription": "carousel", "aria-label": ariaLabel, children: [
|
|
907
907
|
/* @__PURE__ */ jsx("div", { className: "usx-carousel__viewport", tabIndex: -1, children: /* @__PURE__ */ jsx("div", { className: "usx-carousel__track", children: childArray.length > 0 ? childArray : slides.length > 0 ? slides.map((slide, i) => /* @__PURE__ */ jsx(
|
|
908
908
|
Slide,
|
|
909
909
|
{
|
|
@@ -936,7 +936,7 @@ function Card({
|
|
|
936
936
|
children,
|
|
937
937
|
className = "",
|
|
938
938
|
tag: RootTag = "div",
|
|
939
|
-
...
|
|
939
|
+
...props2
|
|
940
940
|
}) {
|
|
941
941
|
const cardClasses = ClassNames(
|
|
942
942
|
"usa-card",
|
|
@@ -962,7 +962,7 @@ function Card({
|
|
|
962
962
|
const media = useCarousel ? /* @__PURE__ */ jsx(
|
|
963
963
|
Carousel,
|
|
964
964
|
{
|
|
965
|
-
id: `${
|
|
965
|
+
id: `${props2.id || "card"}-carousel`,
|
|
966
966
|
showDots: showCarouselDots,
|
|
967
967
|
className: "usx-card__carousel",
|
|
968
968
|
slides: imageProps == null ? void 0 : imageProps.map((img, index) => ({
|
|
@@ -970,7 +970,7 @@ function Card({
|
|
|
970
970
|
}))
|
|
971
971
|
}
|
|
972
972
|
) : hasImages ? /* @__PURE__ */ jsx(Image, { hideCaption: true, ...imageProps[0], className: ClassNames("usa-card__img", imageProps[0].className) }) : null;
|
|
973
|
-
return /* @__PURE__ */ jsx(RootTag, { className: cardClasses, ...
|
|
973
|
+
return /* @__PURE__ */ jsx(RootTag, { className: cardClasses, ...props2, children: /* @__PURE__ */ jsx("div", { className: "usa-card__container", children: shouldRenderStructured ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
974
974
|
title && /* @__PURE__ */ jsx("div", { className: "usa-card__header", children: /* @__PURE__ */ jsx("h4", { className: "usa-card__heading", children: title }) }),
|
|
975
975
|
media && /* @__PURE__ */ jsx("div", { className: mediaClasses, children: media }),
|
|
976
976
|
/* @__PURE__ */ jsxs("div", { className: "usa-card__body", children: [
|
|
@@ -980,33 +980,33 @@ function Card({
|
|
|
980
980
|
buttonProps && buttonProps.length > 0 && /* @__PURE__ */ jsx("div", { className: "usa-card__footer", children: /* @__PURE__ */ jsx(ButtonGroup, { buttonProps, className: "flex-wrap" }) })
|
|
981
981
|
] }) : children || "Card" }) });
|
|
982
982
|
}
|
|
983
|
-
function CardGroup({ cardProps = [], className = "", ...
|
|
983
|
+
function CardGroup({ cardProps = [], className = "", ...props2 }) {
|
|
984
984
|
const classes = ClassNames(
|
|
985
985
|
"usa-card-group",
|
|
986
986
|
"usx-card-group",
|
|
987
987
|
className
|
|
988
988
|
);
|
|
989
|
-
return /* @__PURE__ */ jsx("ul", { className: classes, ...
|
|
989
|
+
return /* @__PURE__ */ jsx("ul", { className: classes, ...props2, children: cardProps.map((card, index) => /* @__PURE__ */ jsx(Card, { ...card, tag: "li" }, index)) });
|
|
990
990
|
}
|
|
991
991
|
function Hint({
|
|
992
992
|
id,
|
|
993
993
|
children = null,
|
|
994
994
|
className = "",
|
|
995
|
-
...
|
|
995
|
+
...props2
|
|
996
996
|
}) {
|
|
997
997
|
const classes = ClassNames("usa-hint", "usx-hint", className);
|
|
998
|
-
return /* @__PURE__ */ jsx("span", { className: classes, ...id ? { id } : {}, ...
|
|
998
|
+
return /* @__PURE__ */ jsx("span", { className: classes, ...id ? { id } : {}, ...props2, children });
|
|
999
999
|
}
|
|
1000
1000
|
function ErrorMessage({
|
|
1001
1001
|
id,
|
|
1002
1002
|
children = null,
|
|
1003
1003
|
className = "",
|
|
1004
|
-
...
|
|
1004
|
+
...props2
|
|
1005
1005
|
}) {
|
|
1006
1006
|
const classes = ClassNames("usa-error-message", "usx-error-message", className);
|
|
1007
|
-
return /* @__PURE__ */ jsx("span", { className: classes, role: "alert", ...id ? { id } : {}, ...
|
|
1007
|
+
return /* @__PURE__ */ jsx("span", { className: classes, role: "alert", ...id ? { id } : {}, ...props2, children });
|
|
1008
1008
|
}
|
|
1009
|
-
function FormGroup({ children = null, className = "", error = false, ...
|
|
1009
|
+
function FormGroup({ children = null, className = "", error = false, ...props2 }) {
|
|
1010
1010
|
const classes = ClassNames(
|
|
1011
1011
|
"usa-form-group",
|
|
1012
1012
|
"usx-form-group",
|
|
@@ -1015,7 +1015,7 @@ function FormGroup({ children = null, className = "", error = false, ...props })
|
|
|
1015
1015
|
},
|
|
1016
1016
|
className
|
|
1017
1017
|
);
|
|
1018
|
-
return /* @__PURE__ */ jsx("div", { className: classes, ...
|
|
1018
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children });
|
|
1019
1019
|
}
|
|
1020
1020
|
function Input({
|
|
1021
1021
|
label,
|
|
@@ -1029,7 +1029,7 @@ function Input({
|
|
|
1029
1029
|
screenReaderOnlyLabel = false,
|
|
1030
1030
|
formGroup = true,
|
|
1031
1031
|
className = "",
|
|
1032
|
-
...
|
|
1032
|
+
...props2
|
|
1033
1033
|
}) {
|
|
1034
1034
|
const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
|
|
1035
1035
|
const hintId = hint ? `${inputId}-hint` : void 0;
|
|
@@ -1054,7 +1054,7 @@ function Input({
|
|
|
1054
1054
|
required,
|
|
1055
1055
|
"aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
|
|
1056
1056
|
"aria-invalid": hasError ? true : void 0,
|
|
1057
|
-
...
|
|
1057
|
+
...props2
|
|
1058
1058
|
};
|
|
1059
1059
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1060
1060
|
/* @__PURE__ */ jsx(Label, { htmlFor: inputId, screenReaderOnly: screenReaderOnlyLabel, required, error: hasError, children: label }),
|
|
@@ -1077,7 +1077,7 @@ const TextArea = ({
|
|
|
1077
1077
|
success = null,
|
|
1078
1078
|
formGroup = true,
|
|
1079
1079
|
className = "",
|
|
1080
|
-
...
|
|
1080
|
+
...props2
|
|
1081
1081
|
}) => {
|
|
1082
1082
|
const textAreaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;
|
|
1083
1083
|
const hasError = !!error;
|
|
@@ -1107,7 +1107,7 @@ const TextArea = ({
|
|
|
1107
1107
|
...required ? { required: true } : {},
|
|
1108
1108
|
"aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
|
|
1109
1109
|
"aria-invalid": hasError ? "true" : void 0,
|
|
1110
|
-
...
|
|
1110
|
+
...props2
|
|
1111
1111
|
}
|
|
1112
1112
|
)
|
|
1113
1113
|
] });
|
|
@@ -1126,7 +1126,7 @@ function CharacterCount({
|
|
|
1126
1126
|
placeholder = "",
|
|
1127
1127
|
textArea = false,
|
|
1128
1128
|
className = "",
|
|
1129
|
-
...
|
|
1129
|
+
...props2
|
|
1130
1130
|
}) {
|
|
1131
1131
|
const fieldId = id || `character-count-${Math.random().toString(36).substr(2, 9)}`;
|
|
1132
1132
|
const infoId = `${fieldId}-info`;
|
|
@@ -1148,7 +1148,7 @@ function CharacterCount({
|
|
|
1148
1148
|
formGroup: true,
|
|
1149
1149
|
className: "usa-character-count__field",
|
|
1150
1150
|
"aria-describedby": [infoId, hintId, errorId, successId].filter(Boolean).join(" "),
|
|
1151
|
-
...
|
|
1151
|
+
...props2
|
|
1152
1152
|
};
|
|
1153
1153
|
return /* @__PURE__ */ jsxs("div", { className: outerClasses, children: [
|
|
1154
1154
|
textArea ? /* @__PURE__ */ jsx(TextArea, { ...fieldProps }) : /* @__PURE__ */ jsx(Input, { ...fieldProps }),
|
|
@@ -1175,7 +1175,7 @@ function Checkbox({
|
|
|
1175
1175
|
className = "",
|
|
1176
1176
|
onChange,
|
|
1177
1177
|
required = false,
|
|
1178
|
-
...
|
|
1178
|
+
...props2
|
|
1179
1179
|
}) {
|
|
1180
1180
|
const hasError = !!error;
|
|
1181
1181
|
const hasSuccess = !!success;
|
|
@@ -1190,7 +1190,7 @@ function Checkbox({
|
|
|
1190
1190
|
{ "usa-checkbox__input--tile": tile }
|
|
1191
1191
|
);
|
|
1192
1192
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1193
|
-
/* @__PURE__ */ jsxs("div", { className: divClasses, ...
|
|
1193
|
+
/* @__PURE__ */ jsxs("div", { className: divClasses, ...props2, children: [
|
|
1194
1194
|
/* @__PURE__ */ jsx(
|
|
1195
1195
|
"input",
|
|
1196
1196
|
{
|
|
@@ -1220,7 +1220,7 @@ function Legend({
|
|
|
1220
1220
|
large = false,
|
|
1221
1221
|
children = null,
|
|
1222
1222
|
className = "",
|
|
1223
|
-
...
|
|
1223
|
+
...props2
|
|
1224
1224
|
}) {
|
|
1225
1225
|
const classes = ClassNames(
|
|
1226
1226
|
"usa-legend",
|
|
@@ -1228,7 +1228,7 @@ function Legend({
|
|
|
1228
1228
|
{ "usa-legend--large": large },
|
|
1229
1229
|
className
|
|
1230
1230
|
);
|
|
1231
|
-
return /* @__PURE__ */ jsxs("legend", { className: classes, ...
|
|
1231
|
+
return /* @__PURE__ */ jsxs("legend", { className: classes, ...props2, children: [
|
|
1232
1232
|
required && /* @__PURE__ */ jsx(Required, {}),
|
|
1233
1233
|
children || text
|
|
1234
1234
|
] });
|
|
@@ -1244,14 +1244,14 @@ function Fieldset({
|
|
|
1244
1244
|
errorId,
|
|
1245
1245
|
children = null,
|
|
1246
1246
|
className = "",
|
|
1247
|
-
...
|
|
1247
|
+
...props2
|
|
1248
1248
|
}) {
|
|
1249
1249
|
const classes = ClassNames(
|
|
1250
1250
|
"usa-fieldset",
|
|
1251
1251
|
"usx-fieldset",
|
|
1252
1252
|
className
|
|
1253
1253
|
);
|
|
1254
|
-
return /* @__PURE__ */ jsxs("fieldset", { className: classes, ...disabled ? { disabled: true } : {}, ...
|
|
1254
|
+
return /* @__PURE__ */ jsxs("fieldset", { className: classes, ...disabled ? { disabled: true } : {}, ...props2, children: [
|
|
1255
1255
|
legend && /* @__PURE__ */ jsx(
|
|
1256
1256
|
Legend,
|
|
1257
1257
|
{
|
|
@@ -1277,10 +1277,10 @@ const CheckboxGroup = ({
|
|
|
1277
1277
|
id: groupId,
|
|
1278
1278
|
checkboxProps = [],
|
|
1279
1279
|
className = "",
|
|
1280
|
-
...
|
|
1280
|
+
...props2
|
|
1281
1281
|
}) => {
|
|
1282
1282
|
const classes = ClassNames("usa-checkbox-group", "usx-checkbox-group", className);
|
|
1283
|
-
return /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsx(Fieldset, { id: groupId, legend, required, hint, error, className: classes, ...
|
|
1283
|
+
return /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsx(Fieldset, { id: groupId, legend, required, hint, error, className: classes, ...props2, children: checkboxProps.map((opt, idx) => {
|
|
1284
1284
|
const id = opt.id || `${groupId || name}-${idx}`;
|
|
1285
1285
|
return /* @__PURE__ */ jsx(
|
|
1286
1286
|
Checkbox,
|
|
@@ -1333,11 +1333,11 @@ const Tooltip = ({
|
|
|
1333
1333
|
children,
|
|
1334
1334
|
className = "",
|
|
1335
1335
|
bodyClassName = "",
|
|
1336
|
-
...
|
|
1336
|
+
...props2
|
|
1337
1337
|
}) => {
|
|
1338
1338
|
const validPositions = ["top", "bottom", "left", "right"];
|
|
1339
1339
|
const normalizedPosition = validPositions.includes(position) ? position : "top";
|
|
1340
|
-
return /* @__PURE__ */ jsxs("span", { className: ClassNames("usx-tooltip", className), ...
|
|
1340
|
+
return /* @__PURE__ */ jsxs("span", { className: ClassNames("usx-tooltip", className), ...props2, children: [
|
|
1341
1341
|
children,
|
|
1342
1342
|
/* @__PURE__ */ jsx(
|
|
1343
1343
|
"span",
|
|
@@ -1428,14 +1428,14 @@ function CollectionItem({ href, heading, description, imgSrc, imgAlt = "", calen
|
|
|
1428
1428
|
] })
|
|
1429
1429
|
] });
|
|
1430
1430
|
}
|
|
1431
|
-
function Collection({ items = [], condensed = false, className = "", ...
|
|
1431
|
+
function Collection({ items = [], condensed = false, className = "", ...props2 }) {
|
|
1432
1432
|
const classes = ClassNames(
|
|
1433
1433
|
"usa-collection",
|
|
1434
1434
|
"usx-collection",
|
|
1435
1435
|
condensed && "usa-collection--condensed",
|
|
1436
1436
|
className
|
|
1437
1437
|
);
|
|
1438
|
-
return /* @__PURE__ */ jsx("ul", { className: classes, ...
|
|
1438
|
+
return /* @__PURE__ */ jsx("ul", { className: classes, ...props2, children: items.map((item, i) => /* @__PURE__ */ jsx(CollectionItem, { ...item }, i)) });
|
|
1439
1439
|
}
|
|
1440
1440
|
function Combobox({
|
|
1441
1441
|
id,
|
|
@@ -1452,7 +1452,7 @@ function Combobox({
|
|
|
1452
1452
|
onSelect,
|
|
1453
1453
|
formGroup = true,
|
|
1454
1454
|
className = "",
|
|
1455
|
-
...
|
|
1455
|
+
...props2
|
|
1456
1456
|
}) {
|
|
1457
1457
|
const labelId = `${id}-label`;
|
|
1458
1458
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
@@ -1491,7 +1491,7 @@ function Combobox({
|
|
|
1491
1491
|
disabled,
|
|
1492
1492
|
required,
|
|
1493
1493
|
onChange: handleChange,
|
|
1494
|
-
...
|
|
1494
|
+
...props2,
|
|
1495
1495
|
children: options.map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value))
|
|
1496
1496
|
}
|
|
1497
1497
|
)
|
|
@@ -1500,6 +1500,84 @@ function Combobox({
|
|
|
1500
1500
|
] });
|
|
1501
1501
|
return formGroup ? /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: content }) : content;
|
|
1502
1502
|
}
|
|
1503
|
+
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." } };
|
|
1504
|
+
const config = {
|
|
1505
|
+
props
|
|
1506
|
+
};
|
|
1507
|
+
const breakpoints = [["mobileLg", "mobile-lg"], ["tablet", "tablet"], ["desktop", "desktop"]];
|
|
1508
|
+
const layoutKeys = [
|
|
1509
|
+
"display",
|
|
1510
|
+
"direction",
|
|
1511
|
+
"wrap",
|
|
1512
|
+
"justify",
|
|
1513
|
+
"align",
|
|
1514
|
+
"alignSelf",
|
|
1515
|
+
"flex",
|
|
1516
|
+
"gap",
|
|
1517
|
+
"column",
|
|
1518
|
+
"offset",
|
|
1519
|
+
"gutters",
|
|
1520
|
+
"float"
|
|
1521
|
+
];
|
|
1522
|
+
function layoutClasses(layout, prefix = "") {
|
|
1523
|
+
if (!layout || typeof layout !== "object" || Array.isArray(layout)) return [];
|
|
1524
|
+
return layoutKeys.flatMap((key) => {
|
|
1525
|
+
const value = layout[key];
|
|
1526
|
+
if (typeof value !== "string" || !config.props[key].options.includes(value)) return [];
|
|
1527
|
+
let className;
|
|
1528
|
+
if (key === "column") className = `grid-col-${value}`;
|
|
1529
|
+
else if (key === "offset") className = `grid-offset-${value}`;
|
|
1530
|
+
else if (key === "gutters") className = `grid-gap-${value}`;
|
|
1531
|
+
else className = `usx-container--${key === "alignSelf" ? "align-self" : key}-${value}`;
|
|
1532
|
+
return [`${prefix}${className}`];
|
|
1533
|
+
});
|
|
1534
|
+
}
|
|
1535
|
+
function Container({
|
|
1536
|
+
element = "div",
|
|
1537
|
+
gridContainer,
|
|
1538
|
+
gridRow = false,
|
|
1539
|
+
display,
|
|
1540
|
+
direction,
|
|
1541
|
+
wrap,
|
|
1542
|
+
justify,
|
|
1543
|
+
align,
|
|
1544
|
+
alignSelf,
|
|
1545
|
+
flex,
|
|
1546
|
+
gap,
|
|
1547
|
+
column,
|
|
1548
|
+
offset,
|
|
1549
|
+
gutters,
|
|
1550
|
+
float,
|
|
1551
|
+
responsive,
|
|
1552
|
+
children,
|
|
1553
|
+
content,
|
|
1554
|
+
className = "",
|
|
1555
|
+
id,
|
|
1556
|
+
role,
|
|
1557
|
+
ariaLabel,
|
|
1558
|
+
ariaLabelledby
|
|
1559
|
+
}) {
|
|
1560
|
+
const Element = config.props.element.options.includes(element) ? element : "div";
|
|
1561
|
+
const classes = ClassNames(
|
|
1562
|
+
"usx-container",
|
|
1563
|
+
gridContainer && config.props.gridContainer.options.includes(gridContainer) ? gridContainer === "default" ? "grid-container" : `grid-container-${gridContainer}` : null,
|
|
1564
|
+
{ "grid-row": gridRow === true },
|
|
1565
|
+
layoutClasses({ display, direction, wrap, justify, align, alignSelf, flex, gap, column, offset, gutters, float }),
|
|
1566
|
+
breakpoints.map(([key, prefix]) => layoutClasses((responsive == null ? void 0 : responsive[key]) ?? {}, `${prefix}:`)),
|
|
1567
|
+
typeof className === "string" ? className : void 0
|
|
1568
|
+
);
|
|
1569
|
+
return /* @__PURE__ */ jsx(
|
|
1570
|
+
Element,
|
|
1571
|
+
{
|
|
1572
|
+
className: classes,
|
|
1573
|
+
id: typeof id === "string" ? id : void 0,
|
|
1574
|
+
role: typeof role === "string" ? role : void 0,
|
|
1575
|
+
"aria-label": typeof ariaLabel === "string" ? ariaLabel : void 0,
|
|
1576
|
+
"aria-labelledby": typeof ariaLabelledby === "string" ? ariaLabelledby : void 0,
|
|
1577
|
+
children: children ?? content
|
|
1578
|
+
}
|
|
1579
|
+
);
|
|
1580
|
+
}
|
|
1503
1581
|
function DatePicker({
|
|
1504
1582
|
id = "date-picker",
|
|
1505
1583
|
name,
|
|
@@ -1514,7 +1592,7 @@ function DatePicker({
|
|
|
1514
1592
|
rangeDate = null,
|
|
1515
1593
|
formGroup = true,
|
|
1516
1594
|
className = "",
|
|
1517
|
-
...
|
|
1595
|
+
...props2
|
|
1518
1596
|
}) {
|
|
1519
1597
|
const labelId = `${id}-label`;
|
|
1520
1598
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
@@ -1546,7 +1624,7 @@ function DatePicker({
|
|
|
1546
1624
|
"aria-describedby": describedBy,
|
|
1547
1625
|
disabled,
|
|
1548
1626
|
required,
|
|
1549
|
-
...
|
|
1627
|
+
...props2
|
|
1550
1628
|
}
|
|
1551
1629
|
)
|
|
1552
1630
|
}
|
|
@@ -1640,9 +1718,9 @@ function DateRangePicker({
|
|
|
1640
1718
|
}
|
|
1641
1719
|
);
|
|
1642
1720
|
}
|
|
1643
|
-
function Eyebrow({ children = null, className = "", ...
|
|
1721
|
+
function Eyebrow({ children = null, className = "", ...props2 }) {
|
|
1644
1722
|
const classes = ClassNames("usx-eyebrow", className);
|
|
1645
|
-
return /* @__PURE__ */ jsx("span", { className: classes, ...
|
|
1723
|
+
return /* @__PURE__ */ jsx("span", { className: classes, ...props2, children });
|
|
1646
1724
|
}
|
|
1647
1725
|
function Link({
|
|
1648
1726
|
href = "javascript:void(0);",
|
|
@@ -1652,7 +1730,7 @@ function Link({
|
|
|
1652
1730
|
alt = false,
|
|
1653
1731
|
newTab = false,
|
|
1654
1732
|
className = "",
|
|
1655
|
-
...
|
|
1733
|
+
...props2
|
|
1656
1734
|
}) {
|
|
1657
1735
|
const classes = ClassNames(
|
|
1658
1736
|
"usa-link",
|
|
@@ -1669,7 +1747,7 @@ function Link({
|
|
|
1669
1747
|
className: classes,
|
|
1670
1748
|
target: newTab || external ? "_blank" : void 0,
|
|
1671
1749
|
rel: newTab || external ? "noreferrer noopener" : void 0,
|
|
1672
|
-
...
|
|
1750
|
+
...props2,
|
|
1673
1751
|
children
|
|
1674
1752
|
}
|
|
1675
1753
|
);
|
|
@@ -1744,7 +1822,7 @@ function FileInput({
|
|
|
1744
1822
|
onFilesChange = null,
|
|
1745
1823
|
defaultFiles = [],
|
|
1746
1824
|
formGroup = true,
|
|
1747
|
-
...
|
|
1825
|
+
...props2
|
|
1748
1826
|
}) {
|
|
1749
1827
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
1750
1828
|
const errorId = error ? `${id}-error` : void 0;
|
|
@@ -1794,7 +1872,7 @@ function FileInput({
|
|
|
1794
1872
|
disabled,
|
|
1795
1873
|
required,
|
|
1796
1874
|
...invalidFileTypeMessage ? { "data-errormessage": invalidFileTypeMessage } : {},
|
|
1797
|
-
...
|
|
1875
|
+
...props2
|
|
1798
1876
|
}
|
|
1799
1877
|
)
|
|
1800
1878
|
] });
|
|
@@ -1817,7 +1895,7 @@ function FileInput({
|
|
|
1817
1895
|
disabled,
|
|
1818
1896
|
required: required && managedFiles.length === 0,
|
|
1819
1897
|
...invalidFileTypeMessage ? { "data-errormessage": invalidFileTypeMessage } : {},
|
|
1820
|
-
...
|
|
1898
|
+
...props2,
|
|
1821
1899
|
onChange: addFiles
|
|
1822
1900
|
}
|
|
1823
1901
|
) }),
|
|
@@ -1825,8 +1903,8 @@ function FileInput({
|
|
|
1825
1903
|
] });
|
|
1826
1904
|
return formGroup ? /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: content }) : content;
|
|
1827
1905
|
}
|
|
1828
|
-
function BrandingContent({ config, projectUrl, staticBaseUrl }) {
|
|
1829
|
-
const { title, symbol, symbolInverse, logo, logoInverse, alt } =
|
|
1906
|
+
function BrandingContent({ config: config2, projectUrl, staticBaseUrl }) {
|
|
1907
|
+
const { title, symbol, symbolInverse, logo, logoInverse, alt } = config2;
|
|
1830
1908
|
const label = alt ?? title ?? "";
|
|
1831
1909
|
if (logo) {
|
|
1832
1910
|
const Wrapper = projectUrl ? "a" : "div";
|
|
@@ -1864,14 +1942,14 @@ function BrandingContent({ config, projectUrl, staticBaseUrl }) {
|
|
|
1864
1942
|
title && (projectUrl ? /* @__PURE__ */ jsx("a", { href: projectUrl, className: "usx-logo__title", children: title }) : /* @__PURE__ */ jsx("span", { className: "usx-logo__title", children: title }))
|
|
1865
1943
|
] });
|
|
1866
1944
|
}
|
|
1867
|
-
function Branding({ branding, projectUrl = "/", staticBaseUrl, className = "", ...
|
|
1945
|
+
function Branding({ branding, projectUrl = "/", staticBaseUrl, className = "", ...props2 }) {
|
|
1868
1946
|
if (!branding) return null;
|
|
1869
1947
|
const classes = ClassNames(
|
|
1870
1948
|
"usa-logo",
|
|
1871
1949
|
"usx-logo",
|
|
1872
1950
|
className
|
|
1873
1951
|
);
|
|
1874
|
-
return /* @__PURE__ */ jsx("div", { className: classes, ...
|
|
1952
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: /* @__PURE__ */ jsx(BrandingContent, { config: branding, projectUrl, staticBaseUrl }) });
|
|
1875
1953
|
}
|
|
1876
1954
|
function FooterReturnToTop({ label = "Return to top", href = "#", className = "" }) {
|
|
1877
1955
|
const classes = ClassNames(
|
|
@@ -1966,7 +2044,7 @@ function Footer({
|
|
|
1966
2044
|
primaryChildren = null,
|
|
1967
2045
|
secondaryChildren = null,
|
|
1968
2046
|
className = "",
|
|
1969
|
-
...
|
|
2047
|
+
...props2
|
|
1970
2048
|
}) {
|
|
1971
2049
|
const variantClass = variant === "big" ? "usa-footer--big" : variant === "slim" ? "usa-footer--slim" : "";
|
|
1972
2050
|
const classes = ClassNames("usa-footer", variantClass, "usx-footer", className);
|
|
@@ -1995,7 +2073,7 @@ function Footer({
|
|
|
1995
2073
|
contactEl
|
|
1996
2074
|
] }) : null;
|
|
1997
2075
|
if (variant === "big") {
|
|
1998
|
-
return /* @__PURE__ */ jsxs("footer", { className: classes, ...
|
|
2076
|
+
return /* @__PURE__ */ jsxs("footer", { className: classes, ...props2, children: [
|
|
1999
2077
|
returnToTopEl,
|
|
2000
2078
|
/* @__PURE__ */ jsx("div", { className: "usa-footer__primary-section", children: primaryChildren ?? /* @__PURE__ */ jsx("div", { className: "grid-container", children: /* @__PURE__ */ jsxs("div", { className: "grid-row grid-gap", children: [
|
|
2001
2079
|
navColumns.length > 0 && /* @__PURE__ */ jsx("div", { className: "tablet:grid-col-8", children: /* @__PURE__ */ jsx("nav", { className: "usa-footer__nav", "aria-label": navAriaLabel, children: /* @__PURE__ */ jsx("div", { className: "grid-row grid-gap-4", children: navColumns.map((col, i) => /* @__PURE__ */ jsx("div", { className: "mobile-lg:grid-col-6 desktop:grid-col-3", children: /* @__PURE__ */ jsx(FooterNavColumn, { heading: col.heading, links: col.links }) }, i)) }) }) }),
|
|
@@ -2013,7 +2091,7 @@ function Footer({
|
|
|
2013
2091
|
normalizeContactLink(contactEmail, "mailto:"),
|
|
2014
2092
|
...contactLinks
|
|
2015
2093
|
].filter(Boolean);
|
|
2016
|
-
return /* @__PURE__ */ jsxs("footer", { className: classes, ...
|
|
2094
|
+
return /* @__PURE__ */ jsxs("footer", { className: classes, ...props2, children: [
|
|
2017
2095
|
returnToTopEl,
|
|
2018
2096
|
/* @__PURE__ */ jsx("div", { className: "usa-footer__primary-section", children: primaryChildren ?? /* @__PURE__ */ jsxs("div", { className: "usa-footer__primary-container grid-row", children: [
|
|
2019
2097
|
navLinks.length > 0 && /* @__PURE__ */ jsx("div", { className: "mobile-lg:grid-col-8", children: /* @__PURE__ */ jsx("nav", { className: "usa-footer__nav", "aria-label": navAriaLabel, children: /* @__PURE__ */ jsx("ul", { className: "grid-row grid-gap", children: navLinks.map((link, i) => /* @__PURE__ */ jsx("li", { className: "mobile-lg:grid-col-6 desktop:grid-col-auto usa-footer__primary-content", children: /* @__PURE__ */ jsx("a", { className: "usa-footer__primary-link", href: link.href, "aria-label": link.ariaLabel || void 0, children: link.text }) }, i)) }) }) }),
|
|
@@ -2022,7 +2100,7 @@ function Footer({
|
|
|
2022
2100
|
(brandingEl || secondaryChildren) && /* @__PURE__ */ jsx("div", { className: "usa-footer__secondary-section", children: secondaryChildren ?? /* @__PURE__ */ jsx("div", { className: "grid-container", children: brandingEl }) })
|
|
2023
2101
|
] });
|
|
2024
2102
|
}
|
|
2025
|
-
return /* @__PURE__ */ jsxs("footer", { className: classes, ...
|
|
2103
|
+
return /* @__PURE__ */ jsxs("footer", { className: classes, ...props2, children: [
|
|
2026
2104
|
returnToTopEl,
|
|
2027
2105
|
/* @__PURE__ */ jsx("div", { className: "usa-footer__primary-section", children: primaryChildren ?? (navLinks.length > 0 && /* @__PURE__ */ jsx("nav", { className: "usa-footer__nav", "aria-label": navAriaLabel, children: /* @__PURE__ */ jsx("ul", { className: "grid-row grid-gap", children: navLinks.map((link, i) => /* @__PURE__ */ jsx("li", { className: "mobile-lg:grid-col-4 desktop:grid-col-auto usa-footer__primary-content", children: /* @__PURE__ */ jsx("a", { className: "usa-footer__primary-link", href: link.href, "aria-label": link.ariaLabel || void 0, children: link.text }) }, i)) }) })) }),
|
|
2028
2106
|
/* @__PURE__ */ jsx("div", { className: "usa-footer__secondary-section", children: secondaryChildren ?? /* @__PURE__ */ jsx("div", { className: "grid-container", children: /* @__PURE__ */ jsxs("div", { className: "grid-row grid-gap", children: [
|
|
@@ -2202,7 +2280,7 @@ function Header({
|
|
|
2202
2280
|
className = "",
|
|
2203
2281
|
utilityContent = null,
|
|
2204
2282
|
navEndContent = null,
|
|
2205
|
-
...
|
|
2283
|
+
...props2
|
|
2206
2284
|
}) {
|
|
2207
2285
|
const headerClasses = ClassNames(
|
|
2208
2286
|
"usa-header",
|
|
@@ -2223,7 +2301,7 @@ function Header({
|
|
|
2223
2301
|
] });
|
|
2224
2302
|
if (extended) {
|
|
2225
2303
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2226
|
-
/* @__PURE__ */ jsx("header", { className: headerClasses, ...
|
|
2304
|
+
/* @__PURE__ */ jsx("header", { className: headerClasses, ...props2, children: navbar }),
|
|
2227
2305
|
/* @__PURE__ */ jsx("nav", { "aria-label": "Primary navigation", className: navClasses, children: /* @__PURE__ */ jsxs("div", { className: "usa-nav__inner", children: [
|
|
2228
2306
|
/* @__PURE__ */ jsx(
|
|
2229
2307
|
PrimaryNav,
|
|
@@ -2255,7 +2333,7 @@ function Header({
|
|
|
2255
2333
|
] }) })
|
|
2256
2334
|
] });
|
|
2257
2335
|
}
|
|
2258
|
-
return /* @__PURE__ */ jsx("header", { className: headerClasses, ...
|
|
2336
|
+
return /* @__PURE__ */ jsx("header", { className: headerClasses, ...props2, children: /* @__PURE__ */ jsxs("div", { className: "usa-nav-container", children: [
|
|
2259
2337
|
navbar,
|
|
2260
2338
|
/* @__PURE__ */ jsx("nav", { "aria-label": "Primary navigation", className: navClasses, children: /* @__PURE__ */ jsx(
|
|
2261
2339
|
PrimaryNav,
|
|
@@ -2290,7 +2368,7 @@ function Hero({
|
|
|
2290
2368
|
ariaLabel = "Introduction",
|
|
2291
2369
|
className = "",
|
|
2292
2370
|
style,
|
|
2293
|
-
...
|
|
2371
|
+
...props2
|
|
2294
2372
|
}) {
|
|
2295
2373
|
const Heading = headingLevel;
|
|
2296
2374
|
const secondaryHeadings = { h1: "h2", h2: "h3", h3: "h4", h4: "h5", h5: "h6" };
|
|
@@ -2310,7 +2388,7 @@ function Hero({
|
|
|
2310
2388
|
...overlayOpacity !== void 0 ? { "--hero-overlay-opacity": Math.min(1, Math.max(0, overlayOpacity)) } : {},
|
|
2311
2389
|
...style
|
|
2312
2390
|
};
|
|
2313
|
-
return /* @__PURE__ */ jsx("section", { className: classes, "aria-label": ariaLabel, style: heroStyle, ...
|
|
2391
|
+
return /* @__PURE__ */ jsx("section", { className: classes, "aria-label": ariaLabel, style: heroStyle, ...props2, children: /* @__PURE__ */ jsxs("div", { className: "usx-hero__inner", children: [
|
|
2314
2392
|
/* @__PURE__ */ jsxs("div", { className: "usx-hero__callout", style: calloutMaxWidth ? { maxWidth: calloutMaxWidth } : void 0, children: [
|
|
2315
2393
|
/* @__PURE__ */ jsxs(Heading, { className: "usx-hero__heading", children: [
|
|
2316
2394
|
callout && /* @__PURE__ */ jsx("span", { className: "usx-hero__heading--alt", children: callout }),
|
|
@@ -2333,7 +2411,7 @@ function renderContent$1(content) {
|
|
|
2333
2411
|
}
|
|
2334
2412
|
return content;
|
|
2335
2413
|
}
|
|
2336
|
-
function IconList({ items = [], primary = false, size = null, className = "", ...
|
|
2414
|
+
function IconList({ items = [], primary = false, size = null, className = "", ...props2 }) {
|
|
2337
2415
|
const classes = ClassNames(
|
|
2338
2416
|
"usa-icon-list",
|
|
2339
2417
|
"usx-icon-list",
|
|
@@ -2341,7 +2419,7 @@ function IconList({ items = [], primary = false, size = null, className = "", ..
|
|
|
2341
2419
|
size === "lg" && "usa-icon-list--size-lg",
|
|
2342
2420
|
className
|
|
2343
2421
|
);
|
|
2344
|
-
return /* @__PURE__ */ jsx("ul", { className: classes, ...
|
|
2422
|
+
return /* @__PURE__ */ jsx("ul", { className: classes, ...props2, children: items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: ClassNames("usa-icon-list__item", item.itemClassName), children: [
|
|
2345
2423
|
/* @__PURE__ */ jsx("div", { className: ClassNames("usa-icon-list__icon", item.iconColor && `text-${item.iconColor}`, item.iconClassName), children: /* @__PURE__ */ jsx(
|
|
2346
2424
|
Icon,
|
|
2347
2425
|
{
|
|
@@ -2490,7 +2568,7 @@ function InPageNav({
|
|
|
2490
2568
|
children = null,
|
|
2491
2569
|
className = "",
|
|
2492
2570
|
contentClassName = "",
|
|
2493
|
-
...
|
|
2571
|
+
...props2
|
|
2494
2572
|
}) {
|
|
2495
2573
|
const contentId = `${id}-content`;
|
|
2496
2574
|
const resolvedSelector = mainContentSelector || `#${contentId}`;
|
|
@@ -2508,7 +2586,7 @@ function InPageNav({
|
|
|
2508
2586
|
"data-root-margin": rootMargin,
|
|
2509
2587
|
"data-threshold": threshold,
|
|
2510
2588
|
"data-minimum-heading-count": minimumHeadingCount,
|
|
2511
|
-
...
|
|
2589
|
+
...props2
|
|
2512
2590
|
}
|
|
2513
2591
|
),
|
|
2514
2592
|
/* @__PURE__ */ jsx(
|
|
@@ -2522,9 +2600,9 @@ function InPageNav({
|
|
|
2522
2600
|
)
|
|
2523
2601
|
] });
|
|
2524
2602
|
}
|
|
2525
|
-
function Indicator({ items = [], children = null, className = "", ...
|
|
2603
|
+
function Indicator({ items = [], children = null, className = "", ...props2 }) {
|
|
2526
2604
|
const classes = ClassNames("usx-indicator", className);
|
|
2527
|
-
return /* @__PURE__ */ jsxs("div", { className: classes, ...
|
|
2605
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, ...props2, children: [
|
|
2528
2606
|
items.map((item, index) => /* @__PURE__ */ jsx(
|
|
2529
2607
|
"span",
|
|
2530
2608
|
{
|
|
@@ -2610,7 +2688,7 @@ function LanguageSelector({
|
|
|
2610
2688
|
navAriaLabel = "Language selection",
|
|
2611
2689
|
className = "",
|
|
2612
2690
|
onSelect = null,
|
|
2613
|
-
...
|
|
2691
|
+
...props2
|
|
2614
2692
|
}) {
|
|
2615
2693
|
const resolvedVariant = variant || (languages.length > 2 ? "menu" : "two");
|
|
2616
2694
|
const classes = ClassNames("usx-language-selector", className);
|
|
@@ -2626,7 +2704,7 @@ function LanguageSelector({
|
|
|
2626
2704
|
onSelect,
|
|
2627
2705
|
className: classes,
|
|
2628
2706
|
navAriaLabel,
|
|
2629
|
-
...
|
|
2707
|
+
...props2
|
|
2630
2708
|
}
|
|
2631
2709
|
);
|
|
2632
2710
|
}
|
|
@@ -2641,13 +2719,13 @@ function LanguageSelector({
|
|
|
2641
2719
|
onSelect,
|
|
2642
2720
|
className: classes,
|
|
2643
2721
|
navAriaLabel,
|
|
2644
|
-
...
|
|
2722
|
+
...props2
|
|
2645
2723
|
}
|
|
2646
2724
|
);
|
|
2647
2725
|
}
|
|
2648
|
-
function SingleColumnLayout({ children, expandButton = null, className = "", ...
|
|
2726
|
+
function SingleColumnLayout({ children, expandButton = null, className = "", ...props2 }) {
|
|
2649
2727
|
const classes = ClassNames("usx-layout__single-column", className);
|
|
2650
|
-
return /* @__PURE__ */ jsxs("div", { className: classes, ...
|
|
2728
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, ...props2, children: [
|
|
2651
2729
|
expandButton,
|
|
2652
2730
|
children
|
|
2653
2731
|
] });
|
|
@@ -2660,7 +2738,7 @@ function GridLayout({
|
|
|
2660
2738
|
expandButton = null,
|
|
2661
2739
|
children,
|
|
2662
2740
|
className = "",
|
|
2663
|
-
...
|
|
2741
|
+
...props2
|
|
2664
2742
|
}) {
|
|
2665
2743
|
const contentModifier = rightSidebar && !leftSidebar ? "left" : leftSidebar && !rightSidebar ? "right" : null;
|
|
2666
2744
|
const contentClasses = ClassNames(
|
|
@@ -2686,7 +2764,7 @@ function GridLayout({
|
|
|
2686
2764
|
"usx-layout__sidebar--expanded": expandRightSidebar
|
|
2687
2765
|
}
|
|
2688
2766
|
);
|
|
2689
|
-
return /* @__PURE__ */ jsxs("div", { className: containerClasses, ...
|
|
2767
|
+
return /* @__PURE__ */ jsxs("div", { className: containerClasses, ...props2, children: [
|
|
2690
2768
|
leftSidebar && /* @__PURE__ */ jsx("aside", { className: leftSidebarClasses, children: leftSidebar }),
|
|
2691
2769
|
/* @__PURE__ */ jsxs("main", { className: contentClasses, children: [
|
|
2692
2770
|
expandButton,
|
|
@@ -2705,7 +2783,7 @@ function Layout({
|
|
|
2705
2783
|
expandRightSidebar,
|
|
2706
2784
|
expandable = false,
|
|
2707
2785
|
className = "",
|
|
2708
|
-
...
|
|
2786
|
+
...props2
|
|
2709
2787
|
}) {
|
|
2710
2788
|
const [expanded, setExpanded] = useState(false);
|
|
2711
2789
|
const classes = ClassNames(
|
|
@@ -2729,7 +2807,7 @@ function Layout({
|
|
|
2729
2807
|
]
|
|
2730
2808
|
}
|
|
2731
2809
|
) : null;
|
|
2732
|
-
return /* @__PURE__ */ jsx("div", { className: classes, ...
|
|
2810
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: variant === "single-column" ? /* @__PURE__ */ jsx(SingleColumnLayout, { expandButton, children: children || content }) : variant === "grid" ? /* @__PURE__ */ jsx(
|
|
2733
2811
|
GridLayout,
|
|
2734
2812
|
{
|
|
2735
2813
|
leftSidebar,
|
|
@@ -2768,7 +2846,7 @@ function renderItems(items = [], parentOptions = {}) {
|
|
|
2768
2846
|
] }, index);
|
|
2769
2847
|
});
|
|
2770
2848
|
}
|
|
2771
|
-
function List({ items = [], ordered = false, unstyled = false, className = "", ...
|
|
2849
|
+
function List({ items = [], ordered = false, unstyled = false, className = "", ...props2 }) {
|
|
2772
2850
|
const classes = ClassNames(
|
|
2773
2851
|
"usa-list",
|
|
2774
2852
|
"usx-list",
|
|
@@ -2776,7 +2854,7 @@ function List({ items = [], ordered = false, unstyled = false, className = "", .
|
|
|
2776
2854
|
className
|
|
2777
2855
|
);
|
|
2778
2856
|
const Tag2 = ordered ? "ol" : "ul";
|
|
2779
|
-
return /* @__PURE__ */ jsx(Tag2, { className: classes, ...
|
|
2857
|
+
return /* @__PURE__ */ jsx(Tag2, { className: classes, ...props2, children: renderItems(items, { ordered, unstyled }) });
|
|
2780
2858
|
}
|
|
2781
2859
|
function Select({
|
|
2782
2860
|
label,
|
|
@@ -2792,7 +2870,7 @@ function Select({
|
|
|
2792
2870
|
required = false,
|
|
2793
2871
|
formGroup = true,
|
|
2794
2872
|
className = "",
|
|
2795
|
-
...
|
|
2873
|
+
...props2
|
|
2796
2874
|
}) {
|
|
2797
2875
|
const selectId = id || `select-${Math.random().toString(36).substr(2, 9)}`;
|
|
2798
2876
|
const hintId = hint ? `${selectId}-hint` : void 0;
|
|
@@ -2819,7 +2897,7 @@ function Select({
|
|
|
2819
2897
|
defaultValue,
|
|
2820
2898
|
"aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
|
|
2821
2899
|
"aria-invalid": hasError ? true : void 0,
|
|
2822
|
-
...
|
|
2900
|
+
...props2
|
|
2823
2901
|
};
|
|
2824
2902
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2825
2903
|
/* @__PURE__ */ jsx(Label, { htmlFor: selectId, required, error: hasError, children: label }),
|
|
@@ -2962,7 +3040,7 @@ function MiscBanner({
|
|
|
2962
3040
|
importantLinkHref,
|
|
2963
3041
|
importantLinkIcon = "undo",
|
|
2964
3042
|
showReturnLink = true,
|
|
2965
|
-
...
|
|
3043
|
+
...props2
|
|
2966
3044
|
}) {
|
|
2967
3045
|
const menuId = useId();
|
|
2968
3046
|
const toggleId = useId();
|
|
@@ -3018,7 +3096,7 @@ function MiscBanner({
|
|
|
3018
3096
|
/* @__PURE__ */ jsx("div", { id: menuId, className: "usx-misc-banner__dropdown-content", children: /* @__PURE__ */ jsx("ul", { className: "usa-list", children: mobileLinks.map((link) => /* @__PURE__ */ jsx("li", { className: "usa-list__item", children: /* @__PURE__ */ jsx("a", { className: "usa-link usx-misc-banner__link", href: link.href, children: link.text }) }, `${link.href}-${link.text}`)) }) })
|
|
3019
3097
|
] }) : null
|
|
3020
3098
|
] });
|
|
3021
|
-
return /* @__PURE__ */ jsx("div", { className: classes, ...
|
|
3099
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: /* @__PURE__ */ jsx("div", { className: "usx-misc-banner__content grid-container", children: content }) });
|
|
3022
3100
|
}
|
|
3023
3101
|
const validElements = ["div", "article", "section", "main"];
|
|
3024
3102
|
const Prose = ({
|
|
@@ -3026,14 +3104,14 @@ const Prose = ({
|
|
|
3026
3104
|
content,
|
|
3027
3105
|
children,
|
|
3028
3106
|
className = "",
|
|
3029
|
-
...
|
|
3107
|
+
...props2
|
|
3030
3108
|
}) => {
|
|
3031
3109
|
const Element = validElements.includes(containerElement) ? containerElement : "div";
|
|
3032
3110
|
return /* @__PURE__ */ jsx(
|
|
3033
3111
|
Element,
|
|
3034
3112
|
{
|
|
3035
3113
|
className: `usa-prose usx-prose ${className}`,
|
|
3036
|
-
...
|
|
3114
|
+
...props2,
|
|
3037
3115
|
...content ? { dangerouslySetInnerHTML: { __html: content } } : {},
|
|
3038
3116
|
children: children ? children : null
|
|
3039
3117
|
}
|
|
@@ -3051,7 +3129,7 @@ function Modal({
|
|
|
3051
3129
|
forceAction = false,
|
|
3052
3130
|
className = "",
|
|
3053
3131
|
children,
|
|
3054
|
-
...
|
|
3132
|
+
...props2
|
|
3055
3133
|
}) {
|
|
3056
3134
|
const classes = ClassNames("usa-modal", "usx-modal", {
|
|
3057
3135
|
"usa-modal--lg": size === "lg",
|
|
@@ -3065,7 +3143,7 @@ function Modal({
|
|
|
3065
3143
|
"aria-labelledby": `${id}-heading`,
|
|
3066
3144
|
"aria-describedby": `${id}-description`,
|
|
3067
3145
|
...forceAction ? { "data-force-action": true } : {},
|
|
3068
|
-
...
|
|
3146
|
+
...props2,
|
|
3069
3147
|
children: /* @__PURE__ */ jsxs("div", { className: "usa-modal__content", children: [
|
|
3070
3148
|
/* @__PURE__ */ jsxs("div", { className: "usa-modal__main", children: [
|
|
3071
3149
|
/* @__PURE__ */ jsx("h2", { className: "usa-modal__heading", id: `${id}-heading`, children: heading }),
|
|
@@ -3094,12 +3172,12 @@ function Page({
|
|
|
3094
3172
|
children = null,
|
|
3095
3173
|
content = null,
|
|
3096
3174
|
className = "",
|
|
3097
|
-
...
|
|
3175
|
+
...props2
|
|
3098
3176
|
}) {
|
|
3099
3177
|
const classes = ClassNames("usx-page", className);
|
|
3100
3178
|
const pageContent = children || content;
|
|
3101
3179
|
const Element = element;
|
|
3102
|
-
return /* @__PURE__ */ jsxs(Element, { id, className: classes, ...
|
|
3180
|
+
return /* @__PURE__ */ jsxs(Element, { id, className: classes, ...props2, children: [
|
|
3103
3181
|
/* @__PURE__ */ jsxs("h1", { className: "usx-page__title", children: [
|
|
3104
3182
|
eyebrow ? /* @__PURE__ */ jsx("span", { className: "usx-eyebrow", children: eyebrow }) : null,
|
|
3105
3183
|
title
|
|
@@ -3358,10 +3436,10 @@ function PaginationContainer({
|
|
|
3358
3436
|
navigation,
|
|
3359
3437
|
stepOptions,
|
|
3360
3438
|
className = "",
|
|
3361
|
-
...
|
|
3439
|
+
...props2
|
|
3362
3440
|
}) {
|
|
3363
3441
|
const classes = ClassNames("usx-pagination__container", className);
|
|
3364
|
-
return /* @__PURE__ */ jsxs("div", { className: classes, ...
|
|
3442
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, ...props2, children: [
|
|
3365
3443
|
summary && /* @__PURE__ */ jsx("div", { className: "usx-pagination__container-summary", children: summary }),
|
|
3366
3444
|
(stepOptions || navigation) && /* @__PURE__ */ jsxs("div", { className: "usx-pagination__container-end", children: [
|
|
3367
3445
|
stepOptions && stepOptions,
|
|
@@ -3449,9 +3527,9 @@ function renderContent(content) {
|
|
|
3449
3527
|
}
|
|
3450
3528
|
return content;
|
|
3451
3529
|
}
|
|
3452
|
-
const ProcessList = ({ items = [], className = "", ...
|
|
3530
|
+
const ProcessList = ({ items = [], className = "", ...props2 }) => {
|
|
3453
3531
|
const classes = ClassNames("usa-process-list", "usx-process-list", className);
|
|
3454
|
-
return /* @__PURE__ */ jsx("ol", { className: classes, ...
|
|
3532
|
+
return /* @__PURE__ */ jsx("ol", { className: classes, ...props2, children: items.map((item, index) => {
|
|
3455
3533
|
const HeadingTag = item.headingTag || "h4";
|
|
3456
3534
|
return /* @__PURE__ */ jsxs("li", { className: ClassNames("usa-process-list__item", item.className), children: [
|
|
3457
3535
|
/* @__PURE__ */ jsx(HeadingTag, { className: ClassNames("usa-process-list__heading", item.headingClassName), children: item.heading }),
|
|
@@ -3468,10 +3546,10 @@ function Quote({
|
|
|
3468
3546
|
sourceTitle,
|
|
3469
3547
|
className,
|
|
3470
3548
|
blockquoteClassName,
|
|
3471
|
-
...
|
|
3549
|
+
...props2
|
|
3472
3550
|
}) {
|
|
3473
3551
|
const isVertical = (calloutProps == null ? void 0 : calloutProps.orientation) === "vertical";
|
|
3474
|
-
return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-quote", isVertical && "usx-quote--vertical", className), ...
|
|
3552
|
+
return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-quote", isVertical && "usx-quote--vertical", className), ...props2, children: [
|
|
3475
3553
|
!isVertical && /* @__PURE__ */ jsx(Icon, { name: "format_quote", size: 4, className: "usx-quote__icon" }),
|
|
3476
3554
|
/* @__PURE__ */ jsx(Callout, { ...calloutProps, element: "div", children: /* @__PURE__ */ jsxs("figure", { className: "usx-quote__body", children: [
|
|
3477
3555
|
/* @__PURE__ */ jsxs(
|
|
@@ -3504,7 +3582,7 @@ const RadioButtons = ({
|
|
|
3504
3582
|
options = [],
|
|
3505
3583
|
defaultValue = void 0,
|
|
3506
3584
|
className = "",
|
|
3507
|
-
...
|
|
3585
|
+
...props2
|
|
3508
3586
|
}) => {
|
|
3509
3587
|
const classes = ClassNames(
|
|
3510
3588
|
"usa-radio",
|
|
@@ -3516,7 +3594,7 @@ const RadioButtons = ({
|
|
|
3516
3594
|
"usa-radio__input",
|
|
3517
3595
|
{ "usa-radio__input--tile": tile }
|
|
3518
3596
|
);
|
|
3519
|
-
return /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsx(Fieldset, { legend, required, hint, error, ...
|
|
3597
|
+
return /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsx(Fieldset, { legend, required, hint, error, ...props2, children: options.map((opt, idx) => {
|
|
3520
3598
|
const id = opt.id || `${name}-${idx}`;
|
|
3521
3599
|
return /* @__PURE__ */ jsxs("div", { className: classes, children: [
|
|
3522
3600
|
/* @__PURE__ */ jsx(
|
|
@@ -3555,7 +3633,7 @@ function RangeSlider({
|
|
|
3555
3633
|
textPreposition = null,
|
|
3556
3634
|
formGroup = true,
|
|
3557
3635
|
className = "",
|
|
3558
|
-
...
|
|
3636
|
+
...props2
|
|
3559
3637
|
}) {
|
|
3560
3638
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
3561
3639
|
const errorId = error ? `${id}-error` : void 0;
|
|
@@ -3581,7 +3659,7 @@ function RangeSlider({
|
|
|
3581
3659
|
"aria-describedby": describedBy,
|
|
3582
3660
|
...textUnit ? { "data-text-unit": textUnit } : {},
|
|
3583
3661
|
...textPreposition ? { "data-text-preposition": textPreposition } : {},
|
|
3584
|
-
...
|
|
3662
|
+
...props2
|
|
3585
3663
|
}
|
|
3586
3664
|
)
|
|
3587
3665
|
] });
|
|
@@ -3593,12 +3671,12 @@ const Section = ({
|
|
|
3593
3671
|
children = null,
|
|
3594
3672
|
content = null,
|
|
3595
3673
|
className = "",
|
|
3596
|
-
...
|
|
3674
|
+
...props2
|
|
3597
3675
|
}) => {
|
|
3598
3676
|
const classes = ClassNames("usx-section", className);
|
|
3599
3677
|
const sectionContent = children || content;
|
|
3600
3678
|
const Heading = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(headingLevel) ? headingLevel : "h2";
|
|
3601
|
-
return /* @__PURE__ */ jsxs("section", { className: classes, ...
|
|
3679
|
+
return /* @__PURE__ */ jsxs("section", { className: classes, ...props2, children: [
|
|
3602
3680
|
title ? /* @__PURE__ */ jsx(Heading, { className: "usx-section__title", children: title }) : null,
|
|
3603
3681
|
/* @__PURE__ */ jsx("div", { className: "usx-section__content", children: sectionContent })
|
|
3604
3682
|
] });
|
|
@@ -3624,7 +3702,7 @@ const SideNav = ({
|
|
|
3624
3702
|
sticky = false,
|
|
3625
3703
|
ariaLabel = "Side navigation",
|
|
3626
3704
|
className = "",
|
|
3627
|
-
...
|
|
3705
|
+
...props2
|
|
3628
3706
|
}) => {
|
|
3629
3707
|
const classes = ClassNames(
|
|
3630
3708
|
"usa-sidenav",
|
|
@@ -3634,7 +3712,7 @@ const SideNav = ({
|
|
|
3634
3712
|
},
|
|
3635
3713
|
className
|
|
3636
3714
|
);
|
|
3637
|
-
return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsx("ul", { className: classes, ...
|
|
3715
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsx("ul", { className: classes, ...props2, children: items.map((item, i) => /* @__PURE__ */ jsx(SideNavItem, { item }, i)) }) });
|
|
3638
3716
|
};
|
|
3639
3717
|
const SiteAlert = ({
|
|
3640
3718
|
className = "",
|
|
@@ -3648,7 +3726,7 @@ const SiteAlert = ({
|
|
|
3648
3726
|
role,
|
|
3649
3727
|
ariaLabel = "Site alert",
|
|
3650
3728
|
ariaLabelledby,
|
|
3651
|
-
...
|
|
3729
|
+
...props2
|
|
3652
3730
|
}) => {
|
|
3653
3731
|
const normalizedVariant = ["info", "emergency", "maintenance", "maintenance-warning"].includes(variant) ? variant : "info";
|
|
3654
3732
|
const alertVariant = normalizedVariant === "maintenance" ? "error" : normalizedVariant === "maintenance-warning" ? "warning" : normalizedVariant;
|
|
@@ -3679,7 +3757,7 @@ const SiteAlert = ({
|
|
|
3679
3757
|
role,
|
|
3680
3758
|
"aria-label": ariaLabelledby ? void 0 : ariaLabel,
|
|
3681
3759
|
"aria-labelledby": ariaLabelledby,
|
|
3682
|
-
...
|
|
3760
|
+
...props2,
|
|
3683
3761
|
children: alertContent ? /* @__PURE__ */ jsx("div", { className: alertClasses, children: /* @__PURE__ */ jsxs("div", { className: "usa-alert__body usx-alert__body", children: [
|
|
3684
3762
|
alertHeading && /* @__PURE__ */ jsx("h4", { className: "usa-alert__heading usx-alert__heading", children: alertHeading }),
|
|
3685
3763
|
alertContent,
|
|
@@ -3723,18 +3801,18 @@ const Skipnav = ({
|
|
|
3723
3801
|
content,
|
|
3724
3802
|
children = null,
|
|
3725
3803
|
className = "",
|
|
3726
|
-
...
|
|
3804
|
+
...props2
|
|
3727
3805
|
}) => {
|
|
3728
3806
|
const classes = ClassNames("usa-skipnav", className);
|
|
3729
3807
|
const finalHref = normalizeHref({ href, target });
|
|
3730
|
-
return /* @__PURE__ */ jsx("a", { className: classes, href: finalHref, ...
|
|
3808
|
+
return /* @__PURE__ */ jsx("a", { className: classes, href: finalHref, ...props2, children: children || content || "Skip to main content" });
|
|
3731
3809
|
};
|
|
3732
3810
|
const Status = ({
|
|
3733
3811
|
color = void 0,
|
|
3734
3812
|
size = void 0,
|
|
3735
3813
|
animation = void 0,
|
|
3736
3814
|
className = "",
|
|
3737
|
-
...
|
|
3815
|
+
...props2
|
|
3738
3816
|
}) => {
|
|
3739
3817
|
const classes = ClassNames(
|
|
3740
3818
|
"usx-status",
|
|
@@ -3743,7 +3821,7 @@ const Status = ({
|
|
|
3743
3821
|
animation && `usx-${animation}`,
|
|
3744
3822
|
className
|
|
3745
3823
|
);
|
|
3746
|
-
return /* @__PURE__ */ jsx("span", { className: classes, ...
|
|
3824
|
+
return /* @__PURE__ */ jsx("span", { className: classes, ...props2 });
|
|
3747
3825
|
};
|
|
3748
3826
|
const StepIndicator = ({
|
|
3749
3827
|
steps = [],
|
|
@@ -3751,7 +3829,7 @@ const StepIndicator = ({
|
|
|
3751
3829
|
variant = "",
|
|
3752
3830
|
headingTag: HeadingTag = "h4",
|
|
3753
3831
|
className = "",
|
|
3754
|
-
...
|
|
3832
|
+
...props2
|
|
3755
3833
|
}) => {
|
|
3756
3834
|
var _a;
|
|
3757
3835
|
const step = Number(currentStep);
|
|
@@ -3768,7 +3846,7 @@ const StepIndicator = ({
|
|
|
3768
3846
|
return "";
|
|
3769
3847
|
};
|
|
3770
3848
|
const currentLabel = ((_a = steps[step - 1]) == null ? void 0 : _a.label) || "";
|
|
3771
|
-
return /* @__PURE__ */ jsxs("div", { className: classes, ...
|
|
3849
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, ...props2, children: [
|
|
3772
3850
|
/* @__PURE__ */ jsx("ol", { className: "usa-step-indicator__segments", children: steps.map((s, index) => {
|
|
3773
3851
|
const status = getStatus(index);
|
|
3774
3852
|
return /* @__PURE__ */ jsx(
|
|
@@ -3810,7 +3888,7 @@ const SummaryBox = ({
|
|
|
3810
3888
|
content = "",
|
|
3811
3889
|
children = null,
|
|
3812
3890
|
className = "",
|
|
3813
|
-
...
|
|
3891
|
+
...props2
|
|
3814
3892
|
}) => {
|
|
3815
3893
|
const classes = ClassNames("usa-summary-box", "usx-summary-box", className);
|
|
3816
3894
|
const headingId = id;
|
|
@@ -3821,7 +3899,7 @@ const SummaryBox = ({
|
|
|
3821
3899
|
className: classes,
|
|
3822
3900
|
role: "region",
|
|
3823
3901
|
"aria-labelledby": headingId,
|
|
3824
|
-
...
|
|
3902
|
+
...props2,
|
|
3825
3903
|
children: /* @__PURE__ */ jsxs("div", { className: "usa-summary-box__body", children: [
|
|
3826
3904
|
/* @__PURE__ */ jsx("h4", { className: "usa-summary-box__heading", id: headingId, children: heading }),
|
|
3827
3905
|
/* @__PURE__ */ jsx("div", { className: "usa-summary-box__text", children: bodyContent })
|
|
@@ -3839,7 +3917,7 @@ const Swap = ({
|
|
|
3839
3917
|
inputProps = {},
|
|
3840
3918
|
onClassName = "",
|
|
3841
3919
|
offClassName = "",
|
|
3842
|
-
...
|
|
3920
|
+
...props2
|
|
3843
3921
|
}) => {
|
|
3844
3922
|
const variantClass = variant !== "default" ? `usx-swap--${variant}` : "";
|
|
3845
3923
|
const classes = ClassNames("usx-swap", variantClass, className);
|
|
@@ -3850,7 +3928,7 @@ const Swap = ({
|
|
|
3850
3928
|
/* @__PURE__ */ jsx("span", { className: onClasses, children: onContent }),
|
|
3851
3929
|
/* @__PURE__ */ jsx("span", { className: offClasses, children: offContent })
|
|
3852
3930
|
] });
|
|
3853
|
-
return /* @__PURE__ */ jsx("label", { className: classes, ...
|
|
3931
|
+
return /* @__PURE__ */ jsx("label", { className: classes, ...props2, children: content });
|
|
3854
3932
|
};
|
|
3855
3933
|
const Switch = ({
|
|
3856
3934
|
id,
|
|
@@ -3864,7 +3942,7 @@ const Switch = ({
|
|
|
3864
3942
|
className = "",
|
|
3865
3943
|
label,
|
|
3866
3944
|
indeterminate = false,
|
|
3867
|
-
...
|
|
3945
|
+
...props2
|
|
3868
3946
|
}) => {
|
|
3869
3947
|
const classes = ClassNames(
|
|
3870
3948
|
"usx-switch",
|
|
@@ -3888,7 +3966,7 @@ const Switch = ({
|
|
|
3888
3966
|
disabled,
|
|
3889
3967
|
"aria-checked": indeterminate ? "mixed" : typeof checked === "boolean" ? checked : void 0,
|
|
3890
3968
|
onChange,
|
|
3891
|
-
...
|
|
3969
|
+
...props2
|
|
3892
3970
|
};
|
|
3893
3971
|
const input = /* @__PURE__ */ jsx("input", { ref, ...inputProps });
|
|
3894
3972
|
if (label) {
|
|
@@ -3971,10 +4049,10 @@ function SortIcon({ direction }) {
|
|
|
3971
4049
|
const name = direction === "asc" ? "arrow_upward" : direction === "desc" ? "arrow_downward" : "sort_arrow";
|
|
3972
4050
|
return /* @__PURE__ */ jsx(Icon, { name, "aria-hidden": "true" });
|
|
3973
4051
|
}
|
|
3974
|
-
function TableHead({ className = "", children, ...
|
|
4052
|
+
function TableHead({ className = "", children, ...props2 }) {
|
|
3975
4053
|
const { id, columns, sortState, handleSort, selectionMode, selectionPosition, handleSelectAll, allowSelectAll, rowDetails } = useTableContext();
|
|
3976
4054
|
if (children) {
|
|
3977
|
-
return /* @__PURE__ */ jsx("thead", { className: ClassNames("usx-table__head", className), ...
|
|
4055
|
+
return /* @__PURE__ */ jsx("thead", { className: ClassNames("usx-table__head", className), ...props2, children });
|
|
3978
4056
|
}
|
|
3979
4057
|
const visibleCols = columns.filter((c) => !c.hidden);
|
|
3980
4058
|
const totalDepth = getDepth(visibleCols);
|
|
@@ -3982,7 +4060,7 @@ function TableHead({ className = "", children, ...props }) {
|
|
|
3982
4060
|
const hasRowDetails = !!rowDetails;
|
|
3983
4061
|
const hasSelection = !!selectionMode;
|
|
3984
4062
|
const selectAllCell = /* @__PURE__ */ jsx("th", { scope: "col", rowSpan: totalDepth, className: "usx-table__cell usx-table__cell--selection", children: selectionMode === "checkbox" && allowSelectAll && /* @__PURE__ */ jsx(Checkbox, { id: `${id}-select-all`, onChange: handleSelectAll, ariaLabel: "Select all rows", className: "usx-table__checkbox" }) });
|
|
3985
|
-
return /* @__PURE__ */ jsxs("thead", { className: ClassNames("usx-table__head", className), ...
|
|
4063
|
+
return /* @__PURE__ */ jsxs("thead", { className: ClassNames("usx-table__head", className), ...props2, children: [
|
|
3986
4064
|
/* @__PURE__ */ jsx("tr", { hidden: true, "aria-hidden": "true", children: /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("span", { className: "usa-sr-only usa-table__announcement-region", "aria-live": "polite", id: `${id}-sort-announcement` }) }) }),
|
|
3987
4065
|
headerRows.map((row, rowIndex) => /* @__PURE__ */ jsxs("tr", { className: "usx-table__head-row", children: [
|
|
3988
4066
|
hasRowDetails && rowIndex === 0 && /* @__PURE__ */ jsx("th", { scope: "col", rowSpan: totalDepth, className: "usx-table__cell usx-table__cell--detail-toggle", "aria-label": "Row details" }),
|
|
@@ -4034,7 +4112,7 @@ function TableRow({
|
|
|
4034
4112
|
className = "",
|
|
4035
4113
|
onClick,
|
|
4036
4114
|
children,
|
|
4037
|
-
...
|
|
4115
|
+
...props2
|
|
4038
4116
|
}) {
|
|
4039
4117
|
const { onClickRow } = useTableContext();
|
|
4040
4118
|
const isClickable = !!(onClick || onClickRow);
|
|
@@ -4058,7 +4136,7 @@ function TableRow({
|
|
|
4058
4136
|
}
|
|
4059
4137
|
}
|
|
4060
4138
|
const interactiveProps = isClickable && !disabled ? { tabIndex: 0, onClick: handleClick, onKeyDown: handleKeyDown } : {};
|
|
4061
|
-
return /* @__PURE__ */ jsx("tr", { className: classes, ...interactiveProps, ...
|
|
4139
|
+
return /* @__PURE__ */ jsx("tr", { className: classes, ...interactiveProps, ...props2, children });
|
|
4062
4140
|
}
|
|
4063
4141
|
function TableGroup({
|
|
4064
4142
|
label,
|
|
@@ -4068,7 +4146,7 @@ function TableGroup({
|
|
|
4068
4146
|
colSpan,
|
|
4069
4147
|
className = "",
|
|
4070
4148
|
children,
|
|
4071
|
-
...
|
|
4149
|
+
...props2
|
|
4072
4150
|
}) {
|
|
4073
4151
|
const { toggleGroup, isGroupExpanded, totalCols } = useTableContext();
|
|
4074
4152
|
const isExpanded = expandedProp !== void 0 ? expandedProp : isGroupExpanded(groupKey);
|
|
@@ -4084,7 +4162,7 @@ function TableGroup({
|
|
|
4084
4162
|
}
|
|
4085
4163
|
};
|
|
4086
4164
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4087
|
-
/* @__PURE__ */ jsx("tr", { className: ClassNames("usx-table__group-row", className), ...
|
|
4165
|
+
/* @__PURE__ */ jsx("tr", { className: ClassNames("usx-table__group-row", className), ...props2, children: /* @__PURE__ */ jsx("td", { colSpan: colSpan || totalCols || 1, className: "usx-table__group-cell", children: /* @__PURE__ */ jsx("div", { className: "usx-accordion usa-accordion", children: /* @__PURE__ */ jsx("h4", { className: "usa-accordion__heading", children: /* @__PURE__ */ jsx(
|
|
4088
4166
|
"button",
|
|
4089
4167
|
{
|
|
4090
4168
|
type: "button",
|
|
@@ -4225,25 +4303,25 @@ function DataRow({ row, rowIndex }) {
|
|
|
4225
4303
|
hasRowDetails && isExpanded && renderDetail && /* @__PURE__ */ jsx("tr", { className: "usx-table__detail-row", children: /* @__PURE__ */ jsx("td", { className: "usx-table__detail-cell", colSpan: totalCols, children: renderDetail(row) }) })
|
|
4226
4304
|
] });
|
|
4227
4305
|
}
|
|
4228
|
-
function TableBody({ className = "", children, ...
|
|
4306
|
+
function TableBody({ className = "", children, ...props2 }) {
|
|
4229
4307
|
const { data, primaryKey, groupBy, groups, placeholder, totalCols, onMore, loading } = useTableContext();
|
|
4230
4308
|
const bodyClass = ClassNames("usx-table__body", className);
|
|
4231
4309
|
if (children) {
|
|
4232
|
-
return /* @__PURE__ */ jsx("tbody", { className: bodyClass, ...
|
|
4310
|
+
return /* @__PURE__ */ jsx("tbody", { className: bodyClass, ...props2, children });
|
|
4233
4311
|
}
|
|
4234
4312
|
const placeholderRow = data.length === 0 && placeholder ? /* @__PURE__ */ jsx("tr", { className: "usx-table__placeholder-row", children: /* @__PURE__ */ jsx("td", { className: "usx-table__placeholder-cell", colSpan: totalCols, children: placeholder }) }) : null;
|
|
4235
4313
|
const sentinel = onMore ? /* @__PURE__ */ jsx(OnMoreSentinel, { onMore }) : null;
|
|
4236
4314
|
const loadingRow = loading ? /* @__PURE__ */ jsx("tr", { className: "usx-table__loading-row", "aria-live": "polite", children: /* @__PURE__ */ jsx("td", { className: "usx-table__loading-cell", colSpan: totalCols, children: /* @__PURE__ */ jsx(Spinner, { size: 3, label: "Loading more rows…" }) }) }) : null;
|
|
4237
4315
|
const renderRows = (rows) => rows.map((row, rowIndex) => /* @__PURE__ */ jsx(DataRow, { row, rowIndex }, row[primaryKey] ?? rowIndex));
|
|
4238
4316
|
if (!groupBy) {
|
|
4239
|
-
return /* @__PURE__ */ jsxs("tbody", { className: bodyClass, ...
|
|
4317
|
+
return /* @__PURE__ */ jsxs("tbody", { className: bodyClass, ...props2, children: [
|
|
4240
4318
|
placeholderRow,
|
|
4241
4319
|
renderRows(data),
|
|
4242
4320
|
loadingRow,
|
|
4243
4321
|
sentinel
|
|
4244
4322
|
] });
|
|
4245
4323
|
}
|
|
4246
|
-
return /* @__PURE__ */ jsxs("tbody", { className: bodyClass, ...
|
|
4324
|
+
return /* @__PURE__ */ jsxs("tbody", { className: bodyClass, ...props2, children: [
|
|
4247
4325
|
placeholderRow,
|
|
4248
4326
|
(groups || []).map(({ key, rows }) => /* @__PURE__ */ jsx(TableGroup, { groupKey: key, label: key, children: renderRows(rows) }, key)),
|
|
4249
4327
|
loadingRow,
|
|
@@ -4268,15 +4346,15 @@ function aggregate(data, key, type) {
|
|
|
4268
4346
|
return "--";
|
|
4269
4347
|
}
|
|
4270
4348
|
}
|
|
4271
|
-
function TableFoot({ className = "", children, ...
|
|
4349
|
+
function TableFoot({ className = "", children, ...props2 }) {
|
|
4272
4350
|
const { columns, data, selectionMode, rowDetails } = useTableContext();
|
|
4273
4351
|
if (children) {
|
|
4274
|
-
return /* @__PURE__ */ jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...
|
|
4352
|
+
return /* @__PURE__ */ jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...props2, children });
|
|
4275
4353
|
}
|
|
4276
4354
|
const visibleCols = columns.filter((c) => !c.hidden);
|
|
4277
4355
|
const hasFooter = visibleCols.some((c) => c.footer !== void 0 || c.aggregate);
|
|
4278
4356
|
if (!hasFooter) return null;
|
|
4279
|
-
return /* @__PURE__ */ jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...
|
|
4357
|
+
return /* @__PURE__ */ jsx("tfoot", { className: ClassNames("usx-table__foot", className), ...props2, children: /* @__PURE__ */ jsxs("tr", { className: "usx-table__foot-row", children: [
|
|
4280
4358
|
!!rowDetails && /* @__PURE__ */ jsx("td", { className: "usx-table__cell" }),
|
|
4281
4359
|
!!selectionMode && /* @__PURE__ */ jsx("td", { className: "usx-table__cell usx-table__cell--selection" }),
|
|
4282
4360
|
visibleCols.map((col) => {
|
|
@@ -4300,11 +4378,11 @@ function TableCell({
|
|
|
4300
4378
|
dataLabel,
|
|
4301
4379
|
className = "",
|
|
4302
4380
|
children,
|
|
4303
|
-
...
|
|
4381
|
+
...props2
|
|
4304
4382
|
}) {
|
|
4305
4383
|
const resolvedAlign = Tag2 === "th" ? headerAlign || align : align;
|
|
4306
4384
|
const classes = ClassNames("usx-table__cell", resolvedAlign && `usx-table__cell--align-${resolvedAlign}`, className);
|
|
4307
|
-
return /* @__PURE__ */ jsx(Tag2, { className: classes, colSpan, rowSpan, scope, "data-label": dataLabel, ...
|
|
4385
|
+
return /* @__PURE__ */ jsx(Tag2, { className: classes, colSpan, rowSpan, scope, "data-label": dataLabel, ...props2, children });
|
|
4308
4386
|
}
|
|
4309
4387
|
function defaultCompareFn(a, b, key) {
|
|
4310
4388
|
const va = a[key];
|
|
@@ -4398,11 +4476,11 @@ function useTableSelect({
|
|
|
4398
4476
|
return { selectedKeys, handleSelect, handleSelectAll, isSelected, isAllSelected, isIndeterminate };
|
|
4399
4477
|
}
|
|
4400
4478
|
function useTableGroups({ groupBy, data = [] }) {
|
|
4401
|
-
const
|
|
4402
|
-
const groupByProp = typeof groupBy === "string" ? groupBy :
|
|
4403
|
-
const expandProp =
|
|
4404
|
-
const onExpandProp =
|
|
4405
|
-
const defaultExpanded =
|
|
4479
|
+
const config2 = typeof groupBy === "object" && groupBy !== null ? groupBy : null;
|
|
4480
|
+
const groupByProp = typeof groupBy === "string" ? groupBy : config2 == null ? void 0 : config2.property;
|
|
4481
|
+
const expandProp = config2 == null ? void 0 : config2.expand;
|
|
4482
|
+
const onExpandProp = config2 == null ? void 0 : config2.onExpand;
|
|
4483
|
+
const defaultExpanded = config2 ? config2.defaultExpanded : true;
|
|
4406
4484
|
const isControlled = expandProp !== void 0 && expandProp !== null;
|
|
4407
4485
|
const [internalExpanded, setInternalExpanded] = useState(() => {
|
|
4408
4486
|
if (expandProp) return new Set(expandProp.map(String));
|
|
@@ -4444,9 +4522,9 @@ function useTableGroups({ groupBy, data = [] }) {
|
|
|
4444
4522
|
return { groups, expandedGroups, toggleGroup, isGroupExpanded };
|
|
4445
4523
|
}
|
|
4446
4524
|
function useRowDetails({ rowDetails }) {
|
|
4447
|
-
const
|
|
4448
|
-
const expandProp =
|
|
4449
|
-
const onExpandProp =
|
|
4525
|
+
const config2 = rowDetails && typeof rowDetails === "object" ? rowDetails : null;
|
|
4526
|
+
const expandProp = config2 == null ? void 0 : config2.expand;
|
|
4527
|
+
const onExpandProp = config2 == null ? void 0 : config2.onExpand;
|
|
4450
4528
|
const isControlled = expandProp !== void 0 && expandProp !== null;
|
|
4451
4529
|
const [internalExpanded, setInternalExpanded] = useState(() => new Set(expandProp || []));
|
|
4452
4530
|
const expandedRows = useMemo(
|
|
@@ -4510,7 +4588,7 @@ function Table({
|
|
|
4510
4588
|
placeholder,
|
|
4511
4589
|
className = "",
|
|
4512
4590
|
children,
|
|
4513
|
-
...
|
|
4591
|
+
...props2
|
|
4514
4592
|
}) {
|
|
4515
4593
|
const generatedId = useId();
|
|
4516
4594
|
const id = idProp ?? `usx-table-${generatedId}`;
|
|
@@ -4627,7 +4705,7 @@ function Table({
|
|
|
4627
4705
|
stickyFirstColumn && "usx-table--sticky-first-col",
|
|
4628
4706
|
className
|
|
4629
4707
|
);
|
|
4630
|
-
const tableEl = /* @__PURE__ */ jsxs("table", { id: idProp, className: tableClasses, ...
|
|
4708
|
+
const tableEl = /* @__PURE__ */ jsxs("table", { id: idProp, className: tableClasses, ...props2, children: [
|
|
4631
4709
|
caption && /* @__PURE__ */ jsx(Caption, { children: caption }),
|
|
4632
4710
|
children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4633
4711
|
/* @__PURE__ */ jsx(TableHead, {}),
|
|
@@ -4683,14 +4761,14 @@ const TagGroup = ({
|
|
|
4683
4761
|
tagProps = null,
|
|
4684
4762
|
children = null,
|
|
4685
4763
|
className = "",
|
|
4686
|
-
...
|
|
4764
|
+
...props2
|
|
4687
4765
|
}) => {
|
|
4688
4766
|
const classes = ClassNames(
|
|
4689
4767
|
"usx-tag-group",
|
|
4690
4768
|
className
|
|
4691
4769
|
);
|
|
4692
4770
|
const content = children ? children : Array.isArray(tagProps) ? tagProps.map((t, i) => /* @__PURE__ */ jsx(Tag, { ...t }, t.id || t.value || i)) : null;
|
|
4693
|
-
return /* @__PURE__ */ jsx("div", { className: classes, ...
|
|
4771
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: content });
|
|
4694
4772
|
};
|
|
4695
4773
|
function TaskList({ tasks = [], className }) {
|
|
4696
4774
|
return /* @__PURE__ */ jsx("ul", { className: ClassNames("usx-task-list", className), children: tasks == null ? void 0 : tasks.map((task, i) => {
|
|
@@ -4784,7 +4862,7 @@ function TimePicker({
|
|
|
4784
4862
|
step = null,
|
|
4785
4863
|
formGroup = true,
|
|
4786
4864
|
className = "",
|
|
4787
|
-
...
|
|
4865
|
+
...props2
|
|
4788
4866
|
}) {
|
|
4789
4867
|
const labelId = `${id}-label`;
|
|
4790
4868
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
@@ -4818,7 +4896,7 @@ function TimePicker({
|
|
|
4818
4896
|
disabled,
|
|
4819
4897
|
"aria-disabled": !disabled && ariaDisabled ? "true" : void 0,
|
|
4820
4898
|
required,
|
|
4821
|
-
...
|
|
4899
|
+
...props2
|
|
4822
4900
|
}
|
|
4823
4901
|
)
|
|
4824
4902
|
}
|
|
@@ -4840,7 +4918,7 @@ function Toggle({
|
|
|
4840
4918
|
className,
|
|
4841
4919
|
"aria-label": nativeAriaLabel,
|
|
4842
4920
|
"aria-labelledby": labelledBy,
|
|
4843
|
-
...
|
|
4921
|
+
...props2
|
|
4844
4922
|
}) {
|
|
4845
4923
|
const instanceId = useId();
|
|
4846
4924
|
const groupId = id || `toggle-${instanceId}`;
|
|
@@ -4849,7 +4927,7 @@ function Toggle({
|
|
|
4849
4927
|
return /* @__PURE__ */ jsx(
|
|
4850
4928
|
"ul",
|
|
4851
4929
|
{
|
|
4852
|
-
...
|
|
4930
|
+
...props2,
|
|
4853
4931
|
id: groupId,
|
|
4854
4932
|
className: ClassNames(
|
|
4855
4933
|
"usx-toggle",
|
|
@@ -4910,10 +4988,10 @@ const Villain = ({
|
|
|
4910
4988
|
button = null,
|
|
4911
4989
|
ariaLabel = "Introduction",
|
|
4912
4990
|
className = "",
|
|
4913
|
-
...
|
|
4991
|
+
...props2
|
|
4914
4992
|
}) => {
|
|
4915
4993
|
const classes = ClassNames("usa-hero", className);
|
|
4916
|
-
return /* @__PURE__ */ jsx("section", { className: classes, "aria-label": ariaLabel, ...
|
|
4994
|
+
return /* @__PURE__ */ jsx("section", { className: classes, "aria-label": ariaLabel, ...props2, children: /* @__PURE__ */ jsx("div", { className: "grid-container", children: /* @__PURE__ */ jsxs("div", { className: "usa-hero__callout", children: [
|
|
4917
4995
|
/* @__PURE__ */ jsxs("h1", { className: "usa-hero__heading", children: [
|
|
4918
4996
|
callout && /* @__PURE__ */ jsx("span", { className: "usa-hero__heading--alt", children: callout }),
|
|
4919
4997
|
title
|
|
@@ -4945,6 +5023,7 @@ export {
|
|
|
4945
5023
|
Code,
|
|
4946
5024
|
Collection,
|
|
4947
5025
|
Combobox,
|
|
5026
|
+
Container,
|
|
4948
5027
|
CopyToClipboard,
|
|
4949
5028
|
DatePicker,
|
|
4950
5029
|
DateRangePicker,
|