@solexllc/usx-react 0.6.0 → 0.7.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/dist/index.cjs +231 -98
- package/dist/index.js +231 -98
- package/package.json +5 -5
- package/src/components/accordion/accordion.html +596 -291
- package/src/components/alert/alert.html +112 -148
- package/src/components/attribution/attribution.html +50 -21
- package/src/components/avatar/avatar.html +86 -51
- package/src/components/breadcrumb/breadcrumb.html +45 -66
- package/src/components/button/button.html +363 -226
- package/src/components/callout/Callout.tsx +1 -2
- package/src/components/callout/callout.django.html +2 -2
- package/src/components/callout/callout.html +0 -5
- package/src/components/callout/config.json +1 -5
- package/src/components/card/Card.tsx +6 -3
- package/src/components/card/card.django.html +2 -2
- package/src/components/card/card.html +1032 -35
- package/src/components/card/config.json +6 -2
- package/src/components/card-group/card-group.html +388 -95
- package/src/components/carousel/Carousel.tsx +42 -71
- package/src/components/carousel/carousel.django.html +22 -46
- package/src/components/carousel/carousel.html +715 -32
- package/src/components/carousel/config.json +25 -12
- package/src/components/character-count/character-count.html +231 -26
- package/src/components/checkbox/checkbox.html +313 -241
- package/src/components/checkbox-group/checkbox-group.html +346 -26
- package/src/components/clickable/clickable.html +168 -83
- package/src/components/code/Code.tsx +4 -3
- package/src/components/code/code.django.html +1 -1
- package/src/components/code/config.json +4 -0
- package/src/components/collection/collection.html +203 -379
- package/src/components/combobox/combobox.html +21 -9
- package/src/components/container/container.html +2616 -80
- package/src/components/copy-to-clipboard/copy-to-clipboard.html +48 -20
- package/src/components/details/Details.tsx +69 -0
- package/src/components/details/config.json +73 -0
- package/src/components/details/details.django.html +7 -0
- package/src/components/details/details.html +186 -0
- package/src/components/error-message/error-message.html +15 -2
- package/src/components/error-page/ErrorPage.tsx +169 -0
- package/src/components/error-page/config.json +152 -0
- package/src/components/error-page/error-page.django.html +80 -0
- package/src/components/error-page/error-page.html +437 -0
- package/src/components/eyebrow/eyebrow.html +8 -4
- package/src/components/fieldset/fieldset.html +33 -7
- package/src/components/file-input/file-input.html +310 -31
- package/src/components/file-list/file-list.html +191 -7
- package/src/components/footer/footer.html +611 -232
- package/src/components/header/header.html +2553 -611
- package/src/components/hero/hero.html +300 -38
- package/src/components/hint/hint.html +7 -2
- package/src/components/identifier/identifier.html +483 -255
- package/src/components/image/Image.tsx +2 -2
- package/src/components/image/image.django.html +4 -10
- package/src/components/image/image.html +144 -29
- package/src/components/indicator/indicator.html +25 -23
- package/src/components/label/label.html +15 -16
- package/src/components/language-selector/language-selector.html +74 -25
- package/src/components/layout/layout.html +991 -21
- package/src/components/legend/legend.html +10 -9
- package/src/components/list/list.html +45 -25
- package/src/components/page/Page.tsx +15 -2
- package/src/components/page/config.json +13 -1
- package/src/components/page/page.django.html +2 -2
- package/src/components/page/page.html +29 -8
- package/src/components/pagination/pagination.html +907 -305
- package/src/components/prose/prose.html +244 -85
- package/src/components/quote/Quote.tsx +1 -1
- package/src/components/quote/config.json +1 -2
- package/src/components/quote/quote.html +2 -7
- package/src/components/radio-buttons/radio-buttons.html +623 -127
- package/src/components/required/required.html +3 -4
- package/src/components/search/search.html +336 -54
- package/src/components/section/section.html +73 -11
- package/src/components/select/select.html +112 -58
- package/src/components/skipnav/skipnav.html +40 -1
- package/src/components/spinner/spinner.html +143 -23
- package/src/components/step-indicator/step-indicator.html +26 -68
- package/src/components/swap/swap.html +99 -154
- package/src/components/table/table.html +2168 -988
- package/src/components/tag/tag.html +73 -17
- package/src/components/task-list/task-list.html +252 -15
- package/src/components/theme-picker/theme-picker.html +26 -8
- package/src/components/toggle/toggle.html +64 -5
- package/src/index.js +2 -0
package/dist/index.js
CHANGED
|
@@ -850,8 +850,8 @@ function Image({
|
|
|
850
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
|
-
imgElement,
|
|
854
|
-
/* @__PURE__ */ jsx("figcaption", { className: captionClasses,
|
|
853
|
+
href ? /* @__PURE__ */ jsx("a", { href, children: imgElement }) : imgElement,
|
|
854
|
+
/* @__PURE__ */ jsx("figcaption", { className: captionClasses, children: caption })
|
|
855
855
|
] });
|
|
856
856
|
}
|
|
857
857
|
const Element = href ? "a" : "div";
|
|
@@ -865,61 +865,48 @@ function Image({
|
|
|
865
865
|
}
|
|
866
866
|
);
|
|
867
867
|
}
|
|
868
|
-
function
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
role = "group",
|
|
872
|
-
ariaRoledescription = "slide",
|
|
873
|
-
ariaLabel,
|
|
874
|
-
tabIndex = 0,
|
|
875
|
-
children = null,
|
|
876
|
-
...rest
|
|
877
|
-
}) {
|
|
878
|
-
const cls = ClassNames("usx-carousel__slide", className);
|
|
879
|
-
return /* @__PURE__ */ jsx(
|
|
880
|
-
"section",
|
|
881
|
-
{
|
|
882
|
-
id,
|
|
883
|
-
className: cls,
|
|
884
|
-
role,
|
|
885
|
-
"aria-roledescription": ariaRoledescription,
|
|
886
|
-
"aria-label": ariaLabel,
|
|
887
|
-
tabIndex,
|
|
888
|
-
...rest,
|
|
889
|
-
children
|
|
890
|
-
}
|
|
868
|
+
function flattenChildren(children) {
|
|
869
|
+
return React.Children.toArray(children).flatMap(
|
|
870
|
+
(child) => React.isValidElement(child) && child.type === React.Fragment ? flattenChildren(child.props.children) : [child]
|
|
891
871
|
);
|
|
892
872
|
}
|
|
893
873
|
function Carousel({
|
|
894
|
-
id = "carousel-1",
|
|
895
874
|
slides = [],
|
|
896
875
|
ariaLabel = "Featured content",
|
|
897
|
-
className = "",
|
|
898
876
|
showDots = true,
|
|
899
|
-
|
|
900
|
-
|
|
877
|
+
statusClassName,
|
|
878
|
+
children,
|
|
879
|
+
className,
|
|
880
|
+
role = "region",
|
|
901
881
|
...props2
|
|
902
882
|
}) {
|
|
903
|
-
|
|
904
|
-
const
|
|
905
|
-
const
|
|
906
|
-
return /* @__PURE__ */
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
883
|
+
const childSlides = flattenChildren(children);
|
|
884
|
+
const items = childSlides.length ? childSlides.map((content) => ({ content })) : slides;
|
|
885
|
+
const count = items.length;
|
|
886
|
+
return /* @__PURE__ */ jsx(
|
|
887
|
+
"div",
|
|
888
|
+
{
|
|
889
|
+
...props2,
|
|
890
|
+
className: ClassNames("usx-carousel", className),
|
|
891
|
+
role,
|
|
892
|
+
"aria-roledescription": "carousel",
|
|
893
|
+
"aria-label": ariaLabel,
|
|
894
|
+
"data-show-dots": showDots ? void 0 : "false",
|
|
895
|
+
"data-status-class-name": statusClassName,
|
|
896
|
+
children: /* @__PURE__ */ jsx("div", { className: "usx-carousel__viewport", children: /* @__PURE__ */ jsx("div", { className: "usx-carousel__track", "aria-live": "polite", tabIndex: count > 1 ? 0 : void 0, children: count ? items.map((item, index) => /* @__PURE__ */ jsx(
|
|
897
|
+
"div",
|
|
898
|
+
{
|
|
899
|
+
className: "usx-carousel__slide",
|
|
900
|
+
role: "group",
|
|
901
|
+
"aria-roledescription": "slide",
|
|
902
|
+
"aria-label": item.label || `${index + 1} of ${count}`,
|
|
903
|
+
children: item.content
|
|
904
|
+
},
|
|
905
|
+
index
|
|
906
|
+
)) : /* @__PURE__ */ jsx("p", { children: "No slides available." }) }) })
|
|
907
|
+
},
|
|
908
|
+
`${count}-${showDots}-${statusClassName ?? ""}`
|
|
909
|
+
);
|
|
923
910
|
}
|
|
924
911
|
function Card({
|
|
925
912
|
title,
|
|
@@ -935,6 +922,7 @@ function Card({
|
|
|
935
922
|
showCarouselDots = true,
|
|
936
923
|
children,
|
|
937
924
|
className = "",
|
|
925
|
+
containerClassName = "",
|
|
938
926
|
tag: RootTag = "div",
|
|
939
927
|
...props2
|
|
940
928
|
}) {
|
|
@@ -955,14 +943,15 @@ function Card({
|
|
|
955
943
|
"usa-card__media--exdent": mediaExdent
|
|
956
944
|
}
|
|
957
945
|
);
|
|
958
|
-
const hasStructuredContent = title || description || tagProps || buttonProps || imageProps;
|
|
946
|
+
const hasStructuredContent = title || description || (tagProps == null ? void 0 : tagProps.length) || (buttonProps == null ? void 0 : buttonProps.length) || (imageProps == null ? void 0 : imageProps.length);
|
|
959
947
|
const shouldRenderStructured = hasStructuredContent && !children;
|
|
960
948
|
const hasImages = imageProps && imageProps.length > 0;
|
|
961
949
|
const useCarousel = imageProps && imageProps.length > 1;
|
|
962
950
|
const media = useCarousel ? /* @__PURE__ */ jsx(
|
|
963
951
|
Carousel,
|
|
964
952
|
{
|
|
965
|
-
|
|
953
|
+
ariaLabel: `${title || props2.id || "Card"} images`,
|
|
954
|
+
role: "group",
|
|
966
955
|
showDots: showCarouselDots,
|
|
967
956
|
className: "usx-card__carousel",
|
|
968
957
|
slides: imageProps == null ? void 0 : imageProps.map((img, index) => ({
|
|
@@ -970,7 +959,7 @@ function Card({
|
|
|
970
959
|
}))
|
|
971
960
|
}
|
|
972
961
|
) : hasImages ? /* @__PURE__ */ jsx(Image, { hideCaption: true, ...imageProps[0], className: ClassNames("usa-card__img", imageProps[0].className) }) : null;
|
|
973
|
-
return /* @__PURE__ */ jsx(RootTag, { className: cardClasses, ...props2, children: /* @__PURE__ */ jsx("div", { className: "usa-card__container", children: shouldRenderStructured ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
962
|
+
return /* @__PURE__ */ jsx(RootTag, { className: cardClasses, ...props2, children: /* @__PURE__ */ jsx("div", { className: ClassNames("usa-card__container", containerClassName), children: shouldRenderStructured ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
974
963
|
title && /* @__PURE__ */ jsx("div", { className: "usa-card__header", children: /* @__PURE__ */ jsx("h4", { className: "usa-card__heading", children: title }) }),
|
|
975
964
|
media && /* @__PURE__ */ jsx("div", { className: mediaClasses, children: media }),
|
|
976
965
|
/* @__PURE__ */ jsxs("div", { className: "usa-card__body", children: [
|
|
@@ -1389,12 +1378,12 @@ function CopyToClipboard({
|
|
|
1389
1378
|
}
|
|
1390
1379
|
);
|
|
1391
1380
|
}
|
|
1392
|
-
function Code({ lines = [], allowHtml = false, copyText = null, staticBaseUrl, className = "" }) {
|
|
1381
|
+
function Code({ lines = [], allowHtml = false, copyText = null, staticBaseUrl, className = "", contentClassName = "" }) {
|
|
1393
1382
|
return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-mockup-code", className), children: [
|
|
1394
|
-
/* @__PURE__ */ jsx("div", { className: "usx-mockup-code__content", children: lines.map((line, i) => /* @__PURE__ */ jsx(
|
|
1383
|
+
/* @__PURE__ */ jsx("div", { className: ClassNames("usx-mockup-code__content", contentClassName), children: lines.map((line, i) => /* @__PURE__ */ jsx(
|
|
1395
1384
|
"pre",
|
|
1396
1385
|
{
|
|
1397
|
-
|
|
1386
|
+
"data-prefix": line.prefix != null ? line.prefix : void 0,
|
|
1398
1387
|
className: line.className || void 0,
|
|
1399
1388
|
children: allowHtml ? /* @__PURE__ */ jsx("code", { dangerouslySetInnerHTML: { __html: line.code } }) : /* @__PURE__ */ jsx("code", { children: line.code })
|
|
1400
1389
|
},
|
|
@@ -1718,9 +1707,46 @@ function DateRangePicker({
|
|
|
1718
1707
|
}
|
|
1719
1708
|
);
|
|
1720
1709
|
}
|
|
1721
|
-
function
|
|
1722
|
-
|
|
1723
|
-
|
|
1710
|
+
function Details({
|
|
1711
|
+
summary = "Details",
|
|
1712
|
+
text = "",
|
|
1713
|
+
children = null,
|
|
1714
|
+
open = false,
|
|
1715
|
+
markerColor = void 0,
|
|
1716
|
+
underlineColor = void 0,
|
|
1717
|
+
contentBorderColor = void 0,
|
|
1718
|
+
noContentBorder = false,
|
|
1719
|
+
noSummaryUnderline = false,
|
|
1720
|
+
className = "",
|
|
1721
|
+
summaryClassName = "",
|
|
1722
|
+
summaryTextClassName = "",
|
|
1723
|
+
contentClassName = ""
|
|
1724
|
+
}) {
|
|
1725
|
+
const detailsClassName = ClassNames(
|
|
1726
|
+
"usx-details",
|
|
1727
|
+
{ "usx-details--borderless": noContentBorder },
|
|
1728
|
+
{ "usx-details--no-underline": noSummaryUnderline },
|
|
1729
|
+
className
|
|
1730
|
+
);
|
|
1731
|
+
const summaryClassNames = ClassNames(
|
|
1732
|
+
"usx-details__summary",
|
|
1733
|
+
{ [`marker-${markerColor}`]: markerColor },
|
|
1734
|
+
summaryClassName
|
|
1735
|
+
);
|
|
1736
|
+
const summaryTextClassNames = ClassNames(
|
|
1737
|
+
"usx-details__summary-text",
|
|
1738
|
+
{ [`border-${underlineColor}`]: underlineColor },
|
|
1739
|
+
summaryTextClassName
|
|
1740
|
+
);
|
|
1741
|
+
const compositeContentClassName = ClassNames(
|
|
1742
|
+
"usx-details__content",
|
|
1743
|
+
{ [`border-${contentBorderColor}`]: !noContentBorder && contentBorderColor },
|
|
1744
|
+
contentClassName
|
|
1745
|
+
);
|
|
1746
|
+
return /* @__PURE__ */ jsxs("details", { className: detailsClassName, open: open || void 0, children: [
|
|
1747
|
+
/* @__PURE__ */ jsx("summary", { className: summaryClassNames, children: /* @__PURE__ */ jsx("span", { className: summaryTextClassNames, children: summary || "Details" }) }),
|
|
1748
|
+
/* @__PURE__ */ jsx("div", { className: compositeContentClassName, children: children ?? /* @__PURE__ */ jsx("p", { className: "usx-details__text", children: text }) })
|
|
1749
|
+
] });
|
|
1724
1750
|
}
|
|
1725
1751
|
function Link({
|
|
1726
1752
|
href = "javascript:void(0);",
|
|
@@ -1752,6 +1778,151 @@ function Link({
|
|
|
1752
1778
|
}
|
|
1753
1779
|
);
|
|
1754
1780
|
}
|
|
1781
|
+
function Page({
|
|
1782
|
+
id = void 0,
|
|
1783
|
+
title = "Page title",
|
|
1784
|
+
titleId = void 0,
|
|
1785
|
+
eyebrow = null,
|
|
1786
|
+
element = "main",
|
|
1787
|
+
children = null,
|
|
1788
|
+
content = null,
|
|
1789
|
+
tabIndex = void 0,
|
|
1790
|
+
ariaLabelledby = void 0,
|
|
1791
|
+
className = "",
|
|
1792
|
+
...props2
|
|
1793
|
+
}) {
|
|
1794
|
+
const classes = ClassNames("usx-page", className);
|
|
1795
|
+
const pageContent = children || content;
|
|
1796
|
+
const Element = element;
|
|
1797
|
+
const labelledBy = ariaLabelledby || titleId || void 0;
|
|
1798
|
+
return /* @__PURE__ */ jsxs(
|
|
1799
|
+
Element,
|
|
1800
|
+
{
|
|
1801
|
+
id,
|
|
1802
|
+
className: classes,
|
|
1803
|
+
tabIndex,
|
|
1804
|
+
"aria-labelledby": labelledBy,
|
|
1805
|
+
...props2,
|
|
1806
|
+
children: [
|
|
1807
|
+
/* @__PURE__ */ jsxs("h1", { id: titleId, className: "usx-page__title", children: [
|
|
1808
|
+
eyebrow ? /* @__PURE__ */ jsx("span", { className: "usx-eyebrow", children: eyebrow }) : null,
|
|
1809
|
+
title
|
|
1810
|
+
] }),
|
|
1811
|
+
/* @__PURE__ */ jsx("div", { className: "usx-page__content", children: pageContent })
|
|
1812
|
+
]
|
|
1813
|
+
}
|
|
1814
|
+
);
|
|
1815
|
+
}
|
|
1816
|
+
const validElements = ["div", "article", "section", "main"];
|
|
1817
|
+
const Prose = ({
|
|
1818
|
+
containerElement = "div",
|
|
1819
|
+
content,
|
|
1820
|
+
children,
|
|
1821
|
+
className = "",
|
|
1822
|
+
...props2
|
|
1823
|
+
}) => {
|
|
1824
|
+
const Element = validElements.includes(containerElement) ? containerElement : "div";
|
|
1825
|
+
return /* @__PURE__ */ jsx(
|
|
1826
|
+
Element,
|
|
1827
|
+
{
|
|
1828
|
+
className: `usa-prose usx-prose ${className}`,
|
|
1829
|
+
...props2,
|
|
1830
|
+
...content ? { dangerouslySetInnerHTML: { __html: content } } : {},
|
|
1831
|
+
children: children ? children : null
|
|
1832
|
+
}
|
|
1833
|
+
);
|
|
1834
|
+
};
|
|
1835
|
+
const DEFAULT_TITLE = "We couldn’t complete your request";
|
|
1836
|
+
const DEFAULT_DESCRIPTION = "We’re sorry. Please try again later.";
|
|
1837
|
+
function ErrorPage({
|
|
1838
|
+
id = "main-content",
|
|
1839
|
+
title = DEFAULT_TITLE,
|
|
1840
|
+
description = DEFAULT_DESCRIPTION,
|
|
1841
|
+
guidance = "",
|
|
1842
|
+
actions = [],
|
|
1843
|
+
supportHeading = "",
|
|
1844
|
+
supportText = "",
|
|
1845
|
+
supportLinks = [],
|
|
1846
|
+
cats = false,
|
|
1847
|
+
catAlt = "",
|
|
1848
|
+
errorCode,
|
|
1849
|
+
errorCodeLabel = "Error code",
|
|
1850
|
+
referenceId = "",
|
|
1851
|
+
referenceLabel = "Reference ID",
|
|
1852
|
+
detailsProps = null,
|
|
1853
|
+
children = null,
|
|
1854
|
+
className = ""
|
|
1855
|
+
}) {
|
|
1856
|
+
const pageId = id || "main-content";
|
|
1857
|
+
const pageTitle = title || DEFAULT_TITLE;
|
|
1858
|
+
const pageDescription = description || DEFAULT_DESCRIPTION;
|
|
1859
|
+
const titleId = `${pageId}-title`;
|
|
1860
|
+
const supportHeadingId = `${pageId}-support-heading`;
|
|
1861
|
+
const pageActions = Array.isArray(actions) ? actions : [];
|
|
1862
|
+
const pageSupportLinks = Array.isArray(supportLinks) ? supportLinks : [];
|
|
1863
|
+
const hasSupport = Boolean(supportHeading || supportText || pageSupportLinks.length);
|
|
1864
|
+
const hasErrorCode = errorCode !== void 0 && errorCode !== null && errorCode !== "";
|
|
1865
|
+
const hasMeta = hasErrorCode || Boolean(referenceId);
|
|
1866
|
+
const catImageAlt = catAlt || `Cat illustration for HTTP error ${errorCode}`;
|
|
1867
|
+
const classes = ClassNames("usx-error-page", className);
|
|
1868
|
+
return /* @__PURE__ */ jsxs(Page, { id: pageId, title: pageTitle, titleId, className: classes, children: [
|
|
1869
|
+
/* @__PURE__ */ jsxs(Prose, { className: "usx-error-page__body", children: [
|
|
1870
|
+
/* @__PURE__ */ jsx("p", { className: "usa-intro usx-error-page__description margin-bottom-4", children: pageDescription }),
|
|
1871
|
+
cats && Boolean(errorCode) && /* @__PURE__ */ jsx(Image, { src: `https://http.cat/${errorCode}`, alt: catImageAlt }),
|
|
1872
|
+
(guidance || children) && /* @__PURE__ */ jsxs("div", { className: "usx-error-page__content", children: [
|
|
1873
|
+
guidance && /* @__PURE__ */ jsx("p", { children: guidance }),
|
|
1874
|
+
children
|
|
1875
|
+
] })
|
|
1876
|
+
] }),
|
|
1877
|
+
pageActions.length > 0 && /* @__PURE__ */ jsx(ButtonGroup, { buttonProps: pageActions, className: "usx-error-page__actions" }),
|
|
1878
|
+
/* @__PURE__ */ jsxs(Prose, { className: "usx-error-page__body", children: [
|
|
1879
|
+
hasSupport && /* @__PURE__ */ jsxs(
|
|
1880
|
+
"section",
|
|
1881
|
+
{
|
|
1882
|
+
className: "usx-error-page__support",
|
|
1883
|
+
...supportHeading ? { "aria-labelledby": supportHeadingId } : {},
|
|
1884
|
+
children: [
|
|
1885
|
+
supportHeading && /* @__PURE__ */ jsx("h2", { id: supportHeadingId, className: "usx-error-page__support-heading", children: supportHeading }),
|
|
1886
|
+
supportText && /* @__PURE__ */ jsx("p", { children: supportText }),
|
|
1887
|
+
pageSupportLinks.length > 0 && /* @__PURE__ */ jsx("ul", { className: "usx-error-page__support-links", children: pageSupportLinks.map(({ label, ...linkProps }, index) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { ...linkProps, children: label }) }, index)) })
|
|
1888
|
+
]
|
|
1889
|
+
}
|
|
1890
|
+
),
|
|
1891
|
+
hasMeta && /* @__PURE__ */ jsxs("div", { className: "usx-error-page__meta text-base font-body-2xs", children: [
|
|
1892
|
+
hasErrorCode && /* @__PURE__ */ jsxs("p", { children: [
|
|
1893
|
+
/* @__PURE__ */ jsxs("strong", { children: [
|
|
1894
|
+
errorCodeLabel || "Error code",
|
|
1895
|
+
":"
|
|
1896
|
+
] }),
|
|
1897
|
+
" ",
|
|
1898
|
+
/* @__PURE__ */ jsx("span", { className: "usx-error-page__meta-value", children: errorCode })
|
|
1899
|
+
] }),
|
|
1900
|
+
referenceId && /* @__PURE__ */ jsxs("p", { children: [
|
|
1901
|
+
/* @__PURE__ */ jsxs("strong", { children: [
|
|
1902
|
+
referenceLabel || "Reference ID",
|
|
1903
|
+
":"
|
|
1904
|
+
] }),
|
|
1905
|
+
" ",
|
|
1906
|
+
/* @__PURE__ */ jsx("span", { className: "usx-error-page__meta-value", children: referenceId })
|
|
1907
|
+
] })
|
|
1908
|
+
] }),
|
|
1909
|
+
detailsProps && /* @__PURE__ */ jsx(
|
|
1910
|
+
Details,
|
|
1911
|
+
{
|
|
1912
|
+
...detailsProps,
|
|
1913
|
+
className: ClassNames(
|
|
1914
|
+
"usx-error-page__details font-family-mono font-mono-sm",
|
|
1915
|
+
detailsProps.className
|
|
1916
|
+
)
|
|
1917
|
+
}
|
|
1918
|
+
)
|
|
1919
|
+
] })
|
|
1920
|
+
] });
|
|
1921
|
+
}
|
|
1922
|
+
function Eyebrow({ children = null, className = "", ...props2 }) {
|
|
1923
|
+
const classes = ClassNames("usx-eyebrow", className);
|
|
1924
|
+
return /* @__PURE__ */ jsx("span", { className: classes, ...props2, children });
|
|
1925
|
+
}
|
|
1755
1926
|
function formatFileSize(bytes) {
|
|
1756
1927
|
if (bytes < 1024) return `${bytes} B`;
|
|
1757
1928
|
const kb = bytes / 1024;
|
|
@@ -3098,25 +3269,6 @@ function MiscBanner({
|
|
|
3098
3269
|
] });
|
|
3099
3270
|
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: /* @__PURE__ */ jsx("div", { className: "usx-misc-banner__content grid-container", children: content }) });
|
|
3100
3271
|
}
|
|
3101
|
-
const validElements = ["div", "article", "section", "main"];
|
|
3102
|
-
const Prose = ({
|
|
3103
|
-
containerElement = "div",
|
|
3104
|
-
content,
|
|
3105
|
-
children,
|
|
3106
|
-
className = "",
|
|
3107
|
-
...props2
|
|
3108
|
-
}) => {
|
|
3109
|
-
const Element = validElements.includes(containerElement) ? containerElement : "div";
|
|
3110
|
-
return /* @__PURE__ */ jsx(
|
|
3111
|
-
Element,
|
|
3112
|
-
{
|
|
3113
|
-
className: `usa-prose usx-prose ${className}`,
|
|
3114
|
-
...props2,
|
|
3115
|
-
...content ? { dangerouslySetInnerHTML: { __html: content } } : {},
|
|
3116
|
-
children: children ? children : null
|
|
3117
|
-
}
|
|
3118
|
-
);
|
|
3119
|
-
};
|
|
3120
3272
|
function Modal({
|
|
3121
3273
|
id = "usx-modal",
|
|
3122
3274
|
heading,
|
|
@@ -3164,27 +3316,6 @@ function Modal({
|
|
|
3164
3316
|
}
|
|
3165
3317
|
);
|
|
3166
3318
|
}
|
|
3167
|
-
function Page({
|
|
3168
|
-
id = void 0,
|
|
3169
|
-
title = "Page title",
|
|
3170
|
-
eyebrow = null,
|
|
3171
|
-
element = "main",
|
|
3172
|
-
children = null,
|
|
3173
|
-
content = null,
|
|
3174
|
-
className = "",
|
|
3175
|
-
...props2
|
|
3176
|
-
}) {
|
|
3177
|
-
const classes = ClassNames("usx-page", className);
|
|
3178
|
-
const pageContent = children || content;
|
|
3179
|
-
const Element = element;
|
|
3180
|
-
return /* @__PURE__ */ jsxs(Element, { id, className: classes, ...props2, children: [
|
|
3181
|
-
/* @__PURE__ */ jsxs("h1", { className: "usx-page__title", children: [
|
|
3182
|
-
eyebrow ? /* @__PURE__ */ jsx("span", { className: "usx-eyebrow", children: eyebrow }) : null,
|
|
3183
|
-
title
|
|
3184
|
-
] }),
|
|
3185
|
-
/* @__PURE__ */ jsx("div", { className: "usx-page__content", children: pageContent })
|
|
3186
|
-
] });
|
|
3187
|
-
}
|
|
3188
3319
|
function getPageItems(currentPage, totalPages) {
|
|
3189
3320
|
const page = (p) => ({ type: "page", page: p });
|
|
3190
3321
|
const ellipsis = (key) => ({ type: "ellipsis", key });
|
|
@@ -5027,7 +5158,9 @@ export {
|
|
|
5027
5158
|
CopyToClipboard,
|
|
5028
5159
|
DatePicker,
|
|
5029
5160
|
DateRangePicker,
|
|
5161
|
+
Details,
|
|
5030
5162
|
ErrorMessage,
|
|
5163
|
+
ErrorPage,
|
|
5031
5164
|
Eyebrow,
|
|
5032
5165
|
Fieldset,
|
|
5033
5166
|
FileInput,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solexllc/usx-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "React component library for USX.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@solexllc/usx": "0.
|
|
29
|
-
"@solexllc/usx-theme": "0.
|
|
30
|
-
"@solexllc/usx-uswds-fixes": "0.1.
|
|
28
|
+
"@solexllc/usx": "0.9.0",
|
|
29
|
+
"@solexllc/usx-theme": "0.10.0",
|
|
30
|
+
"@solexllc/usx-uswds-fixes": "0.1.14",
|
|
31
31
|
"classnames": "^2.5.1",
|
|
32
32
|
"prop-types": "^15.8.1"
|
|
33
33
|
},
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "vite build",
|
|
47
|
-
"test": "pnpm build && node test/toggle-check.mjs && node test/quote-check.mjs && node test/composition-check.mjs && node test/asset-url-check.mjs && node test/container-check.mjs"
|
|
47
|
+
"test": "pnpm build && node test/toggle-check.mjs && node test/quote-check.mjs && node test/composition-check.mjs && node test/asset-url-check.mjs && node test/container-check.mjs && node test/error-page-check.mjs"
|
|
48
48
|
}
|
|
49
49
|
}
|