@solexllc/usx-react 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -8
- package/dist/index.cjs +671 -428
- package/dist/index.js +671 -428
- package/package.json +2 -2
- package/src/components/accordion/Accordion.tsx +7 -9
- package/src/components/accordion/accordion.django-snapshot.html +515 -0
- package/src/components/accordion/accordion.django.html +9 -25
- package/src/components/accordion/accordion.html +471 -566
- package/src/components/accordion/accordion.react-snapshot.html +475 -0
- package/src/components/accordion/config.json +29 -3
- package/src/components/alert/Alert.tsx +4 -3
- package/src/components/alert/alert.django-snapshot.html +175 -0
- package/src/components/alert/alert.django.html +14 -12
- package/src/components/alert/alert.react-snapshot.html +152 -0
- package/src/components/alert/config.json +5 -8
- package/src/components/attribution/attribution.django-snapshot.html +57 -0
- package/src/components/attribution/attribution.django.html +2 -2
- package/src/components/attribution/attribution.react-snapshot.html +49 -0
- package/src/components/attribution/config.json +4 -0
- package/src/components/avatar/Avatar.tsx +6 -15
- package/src/components/avatar/avatar.django-snapshot.html +131 -0
- package/src/components/avatar/avatar.django.html +9 -10
- package/src/components/avatar/avatar.react-snapshot.html +121 -0
- package/src/components/avatar/config.json +10 -3
- package/src/components/avatar-group/AvatarGroup.tsx +3 -3
- package/src/components/avatar-group/avatar-group.django-snapshot.html +278 -0
- package/src/components/avatar-group/avatar-group.django.html +3 -3
- package/src/components/avatar-group/avatar-group.html +5 -5
- package/src/components/avatar-group/avatar-group.react-snapshot.html +226 -0
- package/src/components/back-to-top/BackToTop.tsx +7 -2
- package/src/components/back-to-top/back-to-top.django-snapshot.html +339 -0
- package/src/components/back-to-top/back-to-top.django.html +6 -4
- package/src/components/back-to-top/back-to-top.react-snapshot.html +264 -0
- package/src/components/back-to-top/config.json +9 -0
- package/src/components/banner/banner.django-snapshot.html +329 -0
- package/src/components/banner/banner.django.html +2 -2
- package/src/components/banner/banner.html +87 -185
- package/src/components/banner/banner.react-snapshot.html +317 -0
- package/src/components/banner/config.json +3 -0
- package/src/components/breadcrumb/Breadcrumb.tsx +1 -1
- package/src/components/breadcrumb/breadcrumb.django-snapshot.html +103 -0
- package/src/components/breadcrumb/breadcrumb.django.html +5 -6
- package/src/components/breadcrumb/breadcrumb.react-snapshot.html +87 -0
- package/src/components/breadcrumb/config.json +2 -8
- package/src/components/button/Button.tsx +1 -0
- package/src/components/button/button.django-snapshot.html +558 -0
- package/src/components/button/button.django.html +4 -4
- package/src/components/button/button.react-snapshot.html +574 -0
- package/src/components/button/config.json +4 -0
- package/src/components/button-group/button-group.django-snapshot.html +129 -0
- package/src/components/button-group/button-group.django.html +1 -1
- package/src/components/button-group/button-group.react-snapshot.html +115 -0
- package/src/components/button-group/config.json +16 -0
- package/src/components/calendar-date/calendar-date.django-snapshot.html +7 -0
- package/src/components/calendar-date/calendar-date.django.html +1 -1
- package/src/components/calendar-date/calendar-date.react-snapshot.html +7 -0
- package/src/components/calendar-date/config.json +3 -0
- package/src/components/callout/Callout.tsx +2 -4
- package/src/components/callout/callout.django-snapshot.html +59 -0
- package/src/components/callout/callout.django.html +1 -1
- package/src/components/callout/callout.react-snapshot.html +57 -0
- package/src/components/callout/config.json +5 -2
- package/src/components/card/Card.tsx +2 -2
- package/src/components/card/card.django-snapshot.html +1198 -0
- package/src/components/card/card.django.html +3 -3
- package/src/components/card/card.react-snapshot.html +1028 -0
- package/src/components/card/config.json +21 -4
- package/src/components/card-group/CardGroup.tsx +1 -1
- package/src/components/card-group/card-group.django-snapshot.html +514 -0
- package/src/components/card-group/card-group.django.html +2 -2
- package/src/components/card-group/card-group.react-snapshot.html +445 -0
- package/src/components/card-group/config.json +80 -2
- package/src/components/carousel/Carousel.tsx +3 -0
- package/src/components/carousel/carousel.django-snapshot.html +927 -0
- package/src/components/carousel/carousel.django.html +2 -2
- package/src/components/carousel/carousel.react-snapshot.html +762 -0
- package/src/components/carousel/config.json +18 -0
- package/src/components/character-count/CharacterCount.tsx +1 -3
- package/src/components/character-count/character-count.django-snapshot.html +402 -0
- package/src/components/character-count/character-count.django.html +1 -1
- package/src/components/character-count/character-count.react-snapshot.html +346 -0
- package/src/components/character-count/config.json +5 -0
- package/src/components/checkbox/Checkbox.tsx +7 -2
- package/src/components/checkbox/checkbox.django-snapshot.html +373 -0
- package/src/components/checkbox/checkbox.django.html +22 -3
- package/src/components/checkbox/checkbox.react-snapshot.html +313 -0
- package/src/components/checkbox/config.json +12 -1
- package/src/components/checkbox-group/CheckboxGroup.tsx +1 -0
- package/src/components/checkbox-group/checkbox-group.django-snapshot.html +372 -0
- package/src/components/checkbox-group/checkbox-group.django.html +2 -2
- package/src/components/checkbox-group/checkbox-group.react-snapshot.html +300 -0
- package/src/components/checkbox-group/config.json +24 -0
- package/src/components/clickable/clickable-bg-color-change.django.html +1 -0
- package/src/components/clickable/clickable-color-change.django.html +1 -0
- package/src/components/clickable/clickable-link.django.html +1 -0
- package/src/components/clickable/clickable.django-snapshot.html +221 -0
- package/src/components/clickable/clickable.django.html +6 -2
- package/src/components/clickable/clickable.react-snapshot.html +194 -0
- package/src/components/clickable/config.json +9 -7
- package/src/components/code/code.django-snapshot.html +375 -0
- package/src/components/code/code.django.html +1 -1
- package/src/components/code/code.html +201 -38
- package/src/components/code/code.react-snapshot.html +249 -0
- package/src/components/code/config.json +18 -0
- package/src/components/collection/collection.django-snapshot.html +238 -0
- package/src/components/collection/collection.django.html +1 -1
- package/src/components/collection/collection.react-snapshot.html +200 -0
- package/src/components/collection/config.json +49 -0
- package/src/components/combobox/Combobox.tsx +1 -0
- package/src/components/combobox/combobox.django-snapshot.html +1302 -0
- package/src/components/combobox/combobox.django.html +3 -5
- package/src/components/combobox/combobox.react-snapshot.html +714 -0
- package/src/components/combobox/config.json +269 -2
- package/src/components/container/Container.tsx +3 -3
- package/src/components/container/config.json +9 -5
- package/src/components/container/container.django-snapshot.html +2820 -0
- package/src/components/container/container.django.html +2 -2
- package/src/components/container/container.react-snapshot.html +2400 -0
- package/src/components/copy-to-clipboard/CopyToClipboard.tsx +2 -2
- package/src/components/copy-to-clipboard/config.json +8 -0
- package/src/components/copy-to-clipboard/copy-to-clipboard.django-snapshot.html +84 -0
- package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +1 -1
- package/src/components/copy-to-clipboard/copy-to-clipboard.react-snapshot.html +60 -0
- package/src/components/date-picker/date-picker.django-snapshot.html +150 -0
- package/src/components/date-picker/date-picker.django.html +1 -1
- package/src/components/date-picker/date-picker.react-snapshot.html +122 -0
- package/src/components/date-range-picker/date-range-picker.django-snapshot.html +301 -0
- package/src/components/date-range-picker/date-range-picker.django.html +1 -1
- package/src/components/date-range-picker/date-range-picker.react-snapshot.html +246 -0
- package/src/components/details/Details.tsx +8 -28
- package/src/components/details/config.json +11 -28
- package/src/components/details/details.django-snapshot.html +238 -0
- package/src/components/details/details.django.html +7 -4
- package/src/components/details/details.html +72 -43
- package/src/components/details/details.react-snapshot.html +215 -0
- package/src/components/drawer/Drawer.tsx +125 -0
- package/src/components/drawer/config.json +97 -0
- package/src/components/drawer/drawer.django-snapshot.html +1711 -0
- package/src/components/drawer/drawer.django.html +34 -0
- package/src/components/drawer/drawer.html +1031 -0
- package/src/components/drawer/drawer.react-snapshot.html +1027 -0
- package/src/components/error-message/config.json +4 -0
- package/src/components/error-message/error-message.django-snapshot.html +12 -0
- package/src/components/error-message/error-message.react-snapshot.html +12 -0
- package/src/components/error-page/config.json +3 -2
- package/src/components/error-page/error-page.django-snapshot.html +570 -0
- package/src/components/error-page/error-page.django.html +2 -2
- package/src/components/error-page/error-page.html +2 -2
- package/src/components/error-page/error-page.react-snapshot.html +467 -0
- package/src/components/eyebrow/config.json +3 -0
- package/src/components/eyebrow/eyebrow.django-snapshot.html +8 -0
- package/src/components/eyebrow/eyebrow.react-snapshot.html +8 -0
- package/src/components/fieldset/config.json +4 -0
- package/src/components/fieldset/fieldset.django-snapshot.html +50 -0
- package/src/components/fieldset/fieldset.django.html +2 -1
- package/src/components/fieldset/fieldset.react-snapshot.html +39 -0
- package/src/components/file-input/FileInput.tsx +2 -1
- package/src/components/file-input/_contents.django.html +29 -0
- package/src/components/file-input/config.json +7 -3
- package/src/components/file-input/file-input.django-snapshot.html +534 -0
- package/src/components/file-input/file-input.django.html +3 -50
- package/src/components/file-input/file-input.html +246 -286
- package/src/components/file-input/file-input.react-snapshot.html +440 -0
- package/src/components/file-list/config.json +2 -2
- package/src/components/file-list/file-list.django-snapshot.html +328 -0
- package/src/components/file-list/file-list.django.html +9 -6
- package/src/components/file-list/file-list.react-snapshot.html +276 -0
- package/src/components/footer/config.json +162 -1
- package/src/components/footer/footer.django-snapshot.html +1009 -0
- package/src/components/footer/footer.django.html +10 -7
- package/src/components/footer/footer.html +21 -21
- package/src/components/footer/footer.react-snapshot.html +796 -0
- package/src/components/form-group/config.json +3 -0
- package/src/components/form-group/form-group.django-snapshot.html +50 -0
- package/src/components/form-group/form-group.django.html +1 -1
- package/src/components/form-group/form-group.react-snapshot.html +43 -0
- package/src/components/header/Header.tsx +3 -3
- package/src/components/header/branding.django.html +14 -0
- package/src/components/header/config.json +73 -0
- package/src/components/header/header.django-snapshot.html +3395 -0
- package/src/components/header/header.django.html +9 -5
- package/src/components/header/header.html +54 -54
- package/src/components/header/header.react-snapshot.html +2675 -0
- package/src/components/hero/Hero.tsx +4 -4
- package/src/components/hero/config.json +7 -6
- package/src/components/hero/hero.django-snapshot.html +409 -0
- package/src/components/hero/hero.django.html +5 -5
- package/src/components/hero/hero.html +13 -14
- package/src/components/hero/hero.react-snapshot.html +353 -0
- package/src/components/hint/config.json +4 -0
- package/src/components/hint/hint.django-snapshot.html +7 -0
- package/src/components/hint/hint.react-snapshot.html +7 -0
- package/src/components/icon/Icon.tsx +14 -12
- package/src/components/icon/config.json +7 -15
- package/src/components/icon/icon.django-snapshot.html +69 -0
- package/src/components/icon/icon.django.html +4 -10
- package/src/components/icon/icon.html +90 -90
- package/src/components/icon/icon.react-snapshot.html +69 -0
- package/src/components/icon-list/icon-list.django-snapshot.html +244 -0
- package/src/components/icon-list/icon-list.django.html +2 -2
- package/src/components/icon-list/icon-list.react-snapshot.html +215 -0
- package/src/components/identifier/Identifier.tsx +1 -1
- package/src/components/identifier/config.json +1 -1
- package/src/components/identifier/identifier.django-snapshot.html +1129 -0
- package/src/components/identifier/identifier.django.html +3 -3
- package/src/components/identifier/identifier.html +2 -2
- package/src/components/identifier/identifier.react-snapshot.html +959 -0
- package/src/components/image/config.json +4 -0
- package/src/components/image/image.django-snapshot.html +166 -0
- package/src/components/image/image.django.html +1 -1
- package/src/components/image/image.html +4 -4
- package/src/components/image/image.react-snapshot.html +150 -0
- package/src/components/in-page-nav/InPageNav.tsx +4 -3
- package/src/components/in-page-nav/config.json +5 -11
- package/src/components/in-page-nav/in-page-nav.django-snapshot.html +228 -0
- package/src/components/in-page-nav/in-page-nav.django.html +4 -4
- package/src/components/in-page-nav/in-page-nav.react-snapshot.html +228 -0
- package/src/components/indicator/config.json +8 -0
- package/src/components/indicator/indicator.django-snapshot.html +57 -0
- package/src/components/indicator/indicator.react-snapshot.html +44 -0
- package/src/components/input/config.json +18 -1
- package/src/components/input/input.django-snapshot.html +121 -0
- package/src/components/input/input.django.html +16 -8
- package/src/components/input/input.react-snapshot.html +94 -0
- package/src/components/label/Label.tsx +4 -1
- package/src/components/label/config.json +7 -0
- package/src/components/label/label.django-snapshot.html +22 -0
- package/src/components/label/label.django.html +4 -1
- package/src/components/label/label.react-snapshot.html +22 -0
- package/src/components/language-selector/config.json +9 -13
- package/src/components/language-selector/language-selector.django-snapshot.html +183 -0
- package/src/components/language-selector/language-selector.django.html +3 -3
- package/src/components/language-selector/language-selector.react-snapshot.html +169 -0
- package/src/components/layout/Layout.tsx +12 -1
- package/src/components/layout/config.json +8 -0
- package/src/components/layout/layout.django-snapshot.html +987 -0
- package/src/components/layout/layout.django.html +2 -2
- package/src/components/layout/layout.react-snapshot.html +876 -0
- package/src/components/legend/config.json +3 -0
- package/src/components/legend/legend.django-snapshot.html +13 -0
- package/src/components/legend/legend.django.html +1 -1
- package/src/components/legend/legend.react-snapshot.html +13 -0
- package/src/components/link/Link.tsx +3 -1
- package/src/components/link/config.json +9 -1
- package/src/components/link/link.django-snapshot.html +45 -0
- package/src/components/link/link.django.html +2 -2
- package/src/components/link/link.react-snapshot.html +45 -0
- package/src/components/list/config.json +7 -0
- package/src/components/list/list.django-snapshot.html +61 -0
- package/src/components/list/list.django.html +1 -1
- package/src/components/list/list.react-snapshot.html +46 -0
- package/src/components/memorable-date/config.json +1 -2
- package/src/components/memorable-date/memorable-date.django-snapshot.html +536 -0
- package/src/components/memorable-date/memorable-date.django.html +3 -1
- package/src/components/memorable-date/memorable-date.react-snapshot.html +437 -0
- package/src/components/misc-banner/MiscBanner.tsx +16 -10
- package/src/components/misc-banner/config.json +22 -4
- package/src/components/misc-banner/misc-banner.django-snapshot.html +370 -0
- package/src/components/misc-banner/misc-banner.django.html +15 -15
- package/src/components/misc-banner/misc-banner.react-snapshot.html +332 -0
- package/src/components/modal/config.json +22 -0
- package/src/components/modal/modal.django-snapshot.html +252 -0
- package/src/components/modal/modal.django.html +5 -9
- package/src/components/modal/modal.react-snapshot.html +229 -0
- package/src/components/page/Page.tsx +2 -3
- package/src/components/page/config.json +11 -2
- package/src/components/page/page.django-snapshot.html +44 -0
- package/src/components/page/page.django.html +4 -2
- package/src/components/page/page.react-snapshot.html +44 -0
- package/src/components/pagination/Pagination.tsx +49 -55
- package/src/components/pagination/config.json +58 -9
- package/src/components/pagination/navigation/PaginationNavigation.tsx +24 -34
- package/src/components/pagination/navigation/pagination-navigation.django.html +16 -23
- package/src/components/pagination/pagination.django-snapshot.html +2078 -0
- package/src/components/pagination/pagination.django.html +14 -4
- package/src/components/pagination/pagination.react-snapshot.html +1738 -0
- package/src/components/pagination/step-options/PaginationStepOptions.tsx +2 -8
- package/src/components/pagination/step-options/pagination-step-options.django.html +1 -1
- package/src/components/popover/Popover.tsx +114 -0
- package/src/components/popover/PopoverMenu.tsx +80 -0
- package/src/components/popover/config.json +130 -0
- package/src/components/popover/popover-menu.django.html +35 -0
- package/src/components/popover/popover.django-snapshot.html +1201 -0
- package/src/components/popover/popover.django.html +11 -0
- package/src/components/popover/popover.html +1081 -0
- package/src/components/popover/popover.react-snapshot.html +1101 -0
- package/src/components/process-list/ProcessList.tsx +6 -21
- package/src/components/process-list/config.json +18 -2
- package/src/components/process-list/process-list.django-snapshot.html +90 -0
- package/src/components/process-list/process-list.django.html +2 -2
- package/src/components/process-list/process-list.react-snapshot.html +78 -0
- package/src/components/prose/Prose.tsx +3 -3
- package/src/components/prose/config.json +6 -2
- package/src/components/prose/prose.django-snapshot.html +250 -0
- package/src/components/prose/prose.django.html +3 -3
- package/src/components/prose/prose.react-snapshot.html +250 -0
- package/src/components/quote/Quote.tsx +2 -2
- package/src/components/quote/config.json +5 -2
- package/src/components/quote/quote.django-snapshot.html +348 -0
- package/src/components/quote/quote.django.html +2 -2
- package/src/components/quote/quote.react-snapshot.html +322 -0
- package/src/components/radio-buttons/RadioButtons.tsx +15 -13
- package/src/components/radio-buttons/config.json +23 -0
- package/src/components/radio-buttons/radio-buttons.django-snapshot.html +760 -0
- package/src/components/radio-buttons/radio-buttons.django.html +12 -4
- package/src/components/radio-buttons/radio-buttons.react-snapshot.html +592 -0
- package/src/components/range-slider/RangeSlider.tsx +1 -1
- package/src/components/range-slider/range-slider.django-snapshot.html +157 -0
- package/src/components/range-slider/range-slider.django.html +1 -1
- package/src/components/range-slider/range-slider.react-snapshot.html +134 -0
- package/src/components/required/config.json +6 -3
- package/src/components/required/required.django-snapshot.html +5 -0
- package/src/components/required/required.react-snapshot.html +5 -0
- package/src/components/search/Search.tsx +6 -9
- package/src/components/search/config.json +5 -3
- package/src/components/search/search.django-snapshot.html +1795 -0
- package/src/components/search/search.django.html +7 -6
- package/src/components/search/search.react-snapshot.html +393 -0
- package/src/components/section/Section.tsx +3 -3
- package/src/components/section/config.json +12 -4
- package/src/components/section/section.django-snapshot.html +87 -0
- package/src/components/section/section.django.html +6 -6
- package/src/components/section/section.react-snapshot.html +78 -0
- package/src/components/select/Select.tsx +1 -0
- package/src/components/select/config.json +18 -0
- package/src/components/select/select.django-snapshot.html +146 -0
- package/src/components/select/select.django.html +1 -1
- package/src/components/select/select.react-snapshot.html +104 -0
- package/src/components/sidenav/config.json +17 -0
- package/src/components/sidenav/sidenav.django-snapshot.html +94 -0
- package/src/components/sidenav/sidenav.django.html +2 -2
- package/src/components/sidenav/sidenav.react-snapshot.html +55 -0
- package/src/components/site-alert/SiteAlert.tsx +10 -38
- package/src/components/site-alert/config.json +10 -3
- package/src/components/site-alert/site-alert.django-snapshot.html +400 -0
- package/src/components/site-alert/site-alert.django.html +1 -1
- package/src/components/site-alert/site-alert.react-snapshot.html +332 -0
- package/src/components/skipnav/config.json +3 -0
- package/src/components/skipnav/skipnav.django-snapshot.html +40 -0
- package/src/components/skipnav/skipnav.django.html +1 -1
- package/src/components/skipnav/skipnav.react-snapshot.html +33 -0
- package/src/components/spinner/Spinner.tsx +1 -0
- package/src/components/spinner/config.json +7 -0
- package/src/components/spinner/spinner.django-snapshot.html +299 -0
- package/src/components/spinner/spinner.django.html +1 -1
- package/src/components/spinner/spinner.react-snapshot.html +302 -0
- package/src/components/status/config.json +1 -0
- package/src/components/status/status.django-snapshot.html +71 -0
- package/src/components/status/status.react-snapshot.html +71 -0
- package/src/components/step-indicator/StepIndicator.tsx +4 -4
- package/src/components/step-indicator/config.json +22 -2
- package/src/components/step-indicator/step-indicator.django-snapshot.html +224 -0
- package/src/components/step-indicator/step-indicator.django.html +3 -3
- package/src/components/step-indicator/step-indicator.react-snapshot.html +204 -0
- package/src/components/summary/Summary.tsx +54 -0
- package/src/components/summary/config.json +56 -0
- package/src/components/summary/summary.django-snapshot.html +36 -0
- package/src/components/summary/summary.django.html +11 -0
- package/src/components/summary/summary.html +17 -0
- package/src/components/summary/summary.react-snapshot.html +36 -0
- package/src/components/summary-box/config.json +5 -0
- package/src/components/summary-box/summary-box.django-snapshot.html +188 -0
- package/src/components/summary-box/summary-box.react-snapshot.html +177 -0
- package/src/components/swap/config.json +3 -3
- package/src/components/swap/swap.django-snapshot.html +110 -0
- package/src/components/swap/swap.html +1 -1
- package/src/components/swap/swap.react-snapshot.html +100 -0
- package/src/components/switch/config.json +3 -0
- package/src/components/switch/switch.django-snapshot.html +73 -0
- package/src/components/switch/switch.django.html +6 -8
- package/src/components/switch/switch.react-snapshot.html +73 -0
- package/src/components/table/Table.tsx +27 -11
- package/src/components/table/TableBody.tsx +12 -9
- package/src/components/table/config.json +46 -1
- package/src/components/table/table-detail-row.django.html +1 -1
- package/src/components/table/table-foot.django.html +1 -1
- package/src/components/table/table-head.django.html +1 -1
- package/src/components/table/table.django-snapshot.html +1970 -0
- package/src/components/table/table.react-snapshot.html +2166 -0
- package/src/components/tag/config.json +3 -0
- package/src/components/tag/tag.django-snapshot.html +109 -0
- package/src/components/tag/tag.django.html +4 -4
- package/src/components/tag/tag.react-snapshot.html +99 -0
- package/src/components/tag-group/config.json +24 -0
- package/src/components/tag-group/tag-group.django-snapshot.html +25 -0
- package/src/components/tag-group/tag-group.django.html +1 -1
- package/src/components/tag-group/tag-group.react-snapshot.html +17 -0
- package/src/components/task-list/config.json +33 -0
- package/src/components/task-list/task-list.django-snapshot.html +273 -0
- package/src/components/task-list/task-list.django.html +1 -1
- package/src/components/task-list/task-list.react-snapshot.html +252 -0
- package/src/components/text-area/TextArea.tsx +1 -1
- package/src/components/text-area/config.json +5 -0
- package/src/components/text-area/text-area.django-snapshot.html +127 -0
- package/src/components/text-area/text-area.django.html +3 -3
- package/src/components/text-area/text-area.react-snapshot.html +108 -0
- package/src/components/theme-picker/ThemePicker.tsx +45 -60
- package/src/components/theme-picker/config.json +54 -2
- package/src/components/theme-picker/theme-picker.django-snapshot.html +109 -0
- package/src/components/theme-picker/theme-picker.django.html +8 -8
- package/src/components/theme-picker/theme-picker.react-snapshot.html +94 -0
- package/src/components/time-picker/TimePicker.tsx +15 -9
- package/src/components/time-picker/config.json +2 -2
- package/src/components/time-picker/time-picker.django-snapshot.html +190 -0
- package/src/components/time-picker/time-picker.django.html +2 -2
- package/src/components/time-picker/time-picker.html +7 -7
- package/src/components/time-picker/time-picker.react-snapshot.html +157 -0
- package/src/components/toggle/_option.django.html +21 -0
- package/src/components/toggle/config.json +23 -2
- package/src/components/toggle/toggle.django-snapshot.html +419 -0
- package/src/components/toggle/toggle.django.html +10 -21
- package/src/components/toggle/toggle.html +318 -323
- package/src/components/toggle/toggle.react-snapshot.html +419 -0
- package/src/components/tooltip/Tooltip.tsx +2 -2
- package/src/components/tooltip/config.json +6 -1
- package/src/components/tooltip/tooltip.django-snapshot.html +57 -0
- package/src/components/tooltip/tooltip.django.html +1 -1
- package/src/components/tooltip/tooltip.react-snapshot.html +62 -0
- package/src/components/tree/Tree.tsx +91 -0
- package/src/components/tree/_tree-items.django.html +15 -0
- package/src/components/tree/config.json +105 -0
- package/src/components/tree/tree.django-snapshot.html +525 -0
- package/src/components/tree/tree.django.html +5 -0
- package/src/components/tree/tree.html +432 -0
- package/src/components/tree/tree.react-snapshot.html +432 -0
- package/src/components/villain/config.json +9 -0
- package/src/components/villain/villain.django-snapshot.html +44 -0
- package/src/components/villain/villain.react-snapshot.html +35 -0
- package/src/index.js +4 -0
package/dist/index.js
CHANGED
|
@@ -75,7 +75,7 @@ function AccordionItem({
|
|
|
75
75
|
expanded = false,
|
|
76
76
|
headingClassName,
|
|
77
77
|
contentClassName,
|
|
78
|
-
|
|
78
|
+
headingAs = "h3",
|
|
79
79
|
handleToggle
|
|
80
80
|
}) {
|
|
81
81
|
const headingClasses = ClassNames("usa-accordion__heading", headingClassName);
|
|
@@ -84,7 +84,7 @@ function AccordionItem({
|
|
|
84
84
|
"usa-prose",
|
|
85
85
|
contentClassName
|
|
86
86
|
);
|
|
87
|
-
const Heading =
|
|
87
|
+
const Heading = headingAs;
|
|
88
88
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
89
89
|
/* @__PURE__ */ jsx(Heading, { id: `${id}-heading`, className: headingClasses, children: /* @__PURE__ */ jsx(
|
|
90
90
|
"button",
|
|
@@ -93,7 +93,6 @@ function AccordionItem({
|
|
|
93
93
|
className: "usa-accordion__button",
|
|
94
94
|
"aria-expanded": expanded,
|
|
95
95
|
"aria-controls": `${id}-content`,
|
|
96
|
-
"data-testid": `accordionButton_${id}`,
|
|
97
96
|
onClick: handleToggle,
|
|
98
97
|
children: title
|
|
99
98
|
}
|
|
@@ -103,7 +102,6 @@ function AccordionItem({
|
|
|
103
102
|
{
|
|
104
103
|
id: `${id}-content`,
|
|
105
104
|
"aria-labelledby": `${id}-heading`,
|
|
106
|
-
"data-testid": `accordionItem_${id}`,
|
|
107
105
|
className: contentClasses,
|
|
108
106
|
hidden: !expanded,
|
|
109
107
|
children: content
|
|
@@ -116,7 +114,7 @@ function Accordion({
|
|
|
116
114
|
bordered = false,
|
|
117
115
|
items = [],
|
|
118
116
|
multiselectable = false,
|
|
119
|
-
|
|
117
|
+
headingAs = "h3",
|
|
120
118
|
iconPosition,
|
|
121
119
|
className = "",
|
|
122
120
|
headingClassName = "",
|
|
@@ -141,7 +139,7 @@ function Accordion({
|
|
|
141
139
|
AccordionItem,
|
|
142
140
|
{
|
|
143
141
|
...item,
|
|
144
|
-
|
|
142
|
+
headingAs,
|
|
145
143
|
headingClassName,
|
|
146
144
|
contentClassName
|
|
147
145
|
},
|
|
@@ -161,21 +159,28 @@ function getAssetSrcSet(srcSet, staticBaseUrl) {
|
|
|
161
159
|
function Icon({
|
|
162
160
|
name,
|
|
163
161
|
source = "uswds",
|
|
164
|
-
size
|
|
162
|
+
size,
|
|
165
163
|
color,
|
|
166
|
-
alt
|
|
164
|
+
alt,
|
|
167
165
|
staticBaseUrl,
|
|
168
166
|
staticUrlPrefix,
|
|
169
167
|
className = "",
|
|
170
168
|
...props2
|
|
171
169
|
}) {
|
|
172
170
|
const spritePrefix = staticUrlPrefix ?? getAssetUrl(`img/${source === "usx" ? "usx-sprite.svg" : "sprite.svg"}#`, staticBaseUrl);
|
|
171
|
+
const classes = ClassNames(
|
|
172
|
+
"usa-icon",
|
|
173
|
+
"usx-icon",
|
|
174
|
+
size ? size === 1 ? "usx-icon--size-1" : "usa-icon--size-" + size : "",
|
|
175
|
+
color ? "text-" + color : "",
|
|
176
|
+
className
|
|
177
|
+
);
|
|
173
178
|
return /* @__PURE__ */ jsx(
|
|
174
179
|
"svg",
|
|
175
180
|
{
|
|
176
|
-
className:
|
|
177
|
-
"aria-hidden": "true",
|
|
178
|
-
"aria-label": alt,
|
|
181
|
+
className: classes,
|
|
182
|
+
"aria-hidden": alt ? void 0 : "true",
|
|
183
|
+
"aria-label": alt || void 0,
|
|
179
184
|
focusable: "false",
|
|
180
185
|
role: "img",
|
|
181
186
|
...props2,
|
|
@@ -216,14 +221,37 @@ function Alert({
|
|
|
216
221
|
} else if (ariaLabel) {
|
|
217
222
|
accessibilityProps["aria-label"] = ariaLabel;
|
|
218
223
|
} else if (resolvedRole === "region") {
|
|
219
|
-
|
|
224
|
+
const label = heading || (normalizedVariant ? `${normalizedVariant} alert` : void 0);
|
|
225
|
+
if (label) accessibilityProps["aria-label"] = label;
|
|
220
226
|
}
|
|
221
227
|
return /* @__PURE__ */ jsx("div", { className: classes, ...accessibilityProps, ...props2, children: /* @__PURE__ */ jsxs("div", { className: "usa-alert__body", children: [
|
|
222
228
|
!slim && heading ? /* @__PURE__ */ jsx("h4", { className: "usa-alert__heading", children: heading }) : null,
|
|
223
|
-
children ? /* @__PURE__ */ jsx("div", { className: "usa-alert__text", children }) : /* @__PURE__ */ jsx("p", { className: "usa-alert__text", children: text }),
|
|
229
|
+
children ? /* @__PURE__ */ jsx("div", { className: "usa-alert__text", children }) : text ? /* @__PURE__ */ jsx("p", { className: "usa-alert__text", children: text }) : null,
|
|
224
230
|
onDismiss && /* @__PURE__ */ jsx("button", { className: "usx-alert__dismiss", "aria-label": "Dismiss alert", onClick: onDismiss, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 3, staticBaseUrl }) })
|
|
225
231
|
] }) });
|
|
226
232
|
}
|
|
233
|
+
const Tooltip = ({
|
|
234
|
+
label,
|
|
235
|
+
position = "right",
|
|
236
|
+
children,
|
|
237
|
+
className = "",
|
|
238
|
+
bodyClassName = "",
|
|
239
|
+
...props2
|
|
240
|
+
}) => {
|
|
241
|
+
const validPositions = ["top", "bottom", "left", "right"];
|
|
242
|
+
const normalizedPosition = validPositions.includes(position) ? position : "right";
|
|
243
|
+
return /* @__PURE__ */ jsxs("span", { className: ClassNames("usx-tooltip", className), ...props2, children: [
|
|
244
|
+
children,
|
|
245
|
+
/* @__PURE__ */ jsx(
|
|
246
|
+
"span",
|
|
247
|
+
{
|
|
248
|
+
className: ClassNames("usa-tooltip__body", `usa-tooltip__body--${normalizedPosition}`, bodyClassName),
|
|
249
|
+
role: "tooltip",
|
|
250
|
+
children: label
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
] });
|
|
254
|
+
};
|
|
227
255
|
const shapeClassMap = {
|
|
228
256
|
circle: "usx-circle",
|
|
229
257
|
"rounded-sm": "usx-rounded-sm",
|
|
@@ -238,7 +266,7 @@ function Avatar({
|
|
|
238
266
|
variant = "image",
|
|
239
267
|
value = null,
|
|
240
268
|
shape = null,
|
|
241
|
-
|
|
269
|
+
tooltipProps = null,
|
|
242
270
|
className = "",
|
|
243
271
|
imageClassName = "",
|
|
244
272
|
contentClassName = "",
|
|
@@ -260,15 +288,9 @@ function Avatar({
|
|
|
260
288
|
shape ? shapeClassMap[shape] : "usx-circle",
|
|
261
289
|
contentClassName
|
|
262
290
|
);
|
|
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
|
|
291
|
+
const avatarContent = isInitialsVariant ? /* @__PURE__ */ jsx("span", { className: contentClasses, children: value }) : isIconVariant ? /* @__PURE__ */ jsx("span", { className: contentClasses, children: /* @__PURE__ */ jsx(Icon, { name: value, alt: alt ? void 0 : `${value} icon` }) }) : /* @__PURE__ */ jsx("img", { className: imgClasses, src: src || void 0, alt: alt || void 0, role: "img", ...props2 });
|
|
264
292
|
const avatar = /* @__PURE__ */ jsx("a", { href, className: wrapperClasses, "aria-label": isInitialsVariant || isIconVariant ? alt || void 0 : void 0, children: avatarContent });
|
|
265
|
-
|
|
266
|
-
return /* @__PURE__ */ jsxs("span", { className: "usx-tooltip", children: [
|
|
267
|
-
avatar,
|
|
268
|
-
/* @__PURE__ */ jsx("span", { className: "usa-tooltip__body usa-tooltip__body--right", role: "tooltip", children: tooltip })
|
|
269
|
-
] });
|
|
270
|
-
}
|
|
271
|
-
return avatar;
|
|
293
|
+
return tooltipProps ? /* @__PURE__ */ jsx(Tooltip, { ...tooltipProps, children: avatar }) : avatar;
|
|
272
294
|
}
|
|
273
295
|
function Attribution({
|
|
274
296
|
avatarProps = null,
|
|
@@ -293,8 +315,8 @@ function Attribution({
|
|
|
293
315
|
function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, className = "", ...props2 }) {
|
|
294
316
|
const classes = ClassNames(
|
|
295
317
|
"usx-avatar-group",
|
|
296
|
-
overlap && "
|
|
297
|
-
stacked && "
|
|
318
|
+
overlap && "usx-avatar-group--overlap",
|
|
319
|
+
stacked && "usx-avatar-group--stacked",
|
|
298
320
|
className
|
|
299
321
|
);
|
|
300
322
|
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: avatarProps.map((avatar, index) => /* @__PURE__ */ jsx(
|
|
@@ -305,7 +327,7 @@ function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, class
|
|
|
305
327
|
alt: avatar.alt,
|
|
306
328
|
value: avatar.initials,
|
|
307
329
|
shape: avatar.shape,
|
|
308
|
-
|
|
330
|
+
tooltipProps: avatar.tooltipProps,
|
|
309
331
|
className: avatar.className,
|
|
310
332
|
imageClassName: avatar.imageClassName,
|
|
311
333
|
contentClassName: avatar.initialsClassName
|
|
@@ -315,6 +337,7 @@ function AvatarGroup({ avatarProps = [], overlap = false, stacked = false, class
|
|
|
315
337
|
}
|
|
316
338
|
function BackToTop({
|
|
317
339
|
label = "Back to top",
|
|
340
|
+
ariaLabel = "Back to top",
|
|
318
341
|
href = void 0,
|
|
319
342
|
variant = null,
|
|
320
343
|
iconPosition = "right",
|
|
@@ -323,6 +346,7 @@ function BackToTop({
|
|
|
323
346
|
onClick = void 0,
|
|
324
347
|
...props2
|
|
325
348
|
}) {
|
|
349
|
+
const accessibleName = label ? void 0 : ariaLabel;
|
|
326
350
|
const icon = /* @__PURE__ */ jsx(Icon, { name: "arrow_upward", size: iconSize, className: ClassNames(
|
|
327
351
|
iconPosition === "left" ? "margin-right-05" : "margin-left-05"
|
|
328
352
|
) });
|
|
@@ -333,7 +357,7 @@ function BackToTop({
|
|
|
333
357
|
"flex-align-center",
|
|
334
358
|
className
|
|
335
359
|
);
|
|
336
|
-
return /* @__PURE__ */ jsxs("a", { className: linkClasses, href, ...props2, children: [
|
|
360
|
+
return /* @__PURE__ */ jsxs("a", { className: linkClasses, href, "aria-label": accessibleName, ...props2, children: [
|
|
337
361
|
iconPosition === "left" && icon,
|
|
338
362
|
label,
|
|
339
363
|
iconPosition === "right" && icon
|
|
@@ -351,6 +375,7 @@ function BackToTop({
|
|
|
351
375
|
{
|
|
352
376
|
type: "button",
|
|
353
377
|
className: buttonClasses,
|
|
378
|
+
"aria-label": accessibleName,
|
|
354
379
|
onClick: onClick || (() => window.scrollTo({ top: 0, behavior: "smooth" })),
|
|
355
380
|
...props2,
|
|
356
381
|
children: [
|
|
@@ -482,7 +507,7 @@ function Breadcrumb({
|
|
|
482
507
|
}) {
|
|
483
508
|
if (!items || items.length === 0) {
|
|
484
509
|
const classes = ClassNames("usx-breadcrumb", className);
|
|
485
|
-
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children
|
|
510
|
+
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children });
|
|
486
511
|
}
|
|
487
512
|
const navClasses = ClassNames(
|
|
488
513
|
"usa-breadcrumb",
|
|
@@ -538,6 +563,7 @@ const Required = ({
|
|
|
538
563
|
] });
|
|
539
564
|
};
|
|
540
565
|
function Label({
|
|
566
|
+
id,
|
|
541
567
|
htmlFor,
|
|
542
568
|
required = false,
|
|
543
569
|
error = false,
|
|
@@ -556,8 +582,9 @@ function Label({
|
|
|
556
582
|
return /* @__PURE__ */ jsxs(
|
|
557
583
|
"label",
|
|
558
584
|
{
|
|
585
|
+
id: id || void 0,
|
|
559
586
|
className: classOverride ? className : classes,
|
|
560
|
-
|
|
587
|
+
htmlFor: htmlFor || void 0,
|
|
561
588
|
...props2,
|
|
562
589
|
children: [
|
|
563
590
|
required && /* @__PURE__ */ jsx(Required, {}),
|
|
@@ -584,7 +611,8 @@ const Spinner = ({
|
|
|
584
611
|
source: "usx",
|
|
585
612
|
size,
|
|
586
613
|
color,
|
|
587
|
-
staticBaseUrl
|
|
614
|
+
staticBaseUrl,
|
|
615
|
+
staticUrlPrefix
|
|
588
616
|
}
|
|
589
617
|
),
|
|
590
618
|
screenReaderLabel && /* @__PURE__ */ jsx(Label, { screenReaderOnly: true, children: screenReaderLabel }),
|
|
@@ -666,6 +694,7 @@ function Button({
|
|
|
666
694
|
type,
|
|
667
695
|
className: classes,
|
|
668
696
|
disabled,
|
|
697
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
669
698
|
...onClick ? { onClick } : {},
|
|
670
699
|
...buttonProps,
|
|
671
700
|
...extraAttributes,
|
|
@@ -726,10 +755,9 @@ function Callout({
|
|
|
726
755
|
content,
|
|
727
756
|
backgroundColor,
|
|
728
757
|
textColor,
|
|
729
|
-
|
|
758
|
+
as: Element = "div",
|
|
730
759
|
...props2
|
|
731
760
|
}) {
|
|
732
|
-
const Element = element;
|
|
733
761
|
return /* @__PURE__ */ jsx(
|
|
734
762
|
Element,
|
|
735
763
|
{
|
|
@@ -877,6 +905,7 @@ function Carousel({
|
|
|
877
905
|
statusClassName,
|
|
878
906
|
children,
|
|
879
907
|
className,
|
|
908
|
+
extraAttributes,
|
|
880
909
|
role = "region",
|
|
881
910
|
...props2
|
|
882
911
|
}) {
|
|
@@ -893,6 +922,7 @@ function Carousel({
|
|
|
893
922
|
"aria-label": ariaLabel,
|
|
894
923
|
"data-show-dots": showDots ? void 0 : "false",
|
|
895
924
|
"data-status-class-name": statusClassName,
|
|
925
|
+
...extraAttributes,
|
|
896
926
|
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
927
|
"div",
|
|
898
928
|
{
|
|
@@ -923,7 +953,7 @@ function Card({
|
|
|
923
953
|
children,
|
|
924
954
|
className = "",
|
|
925
955
|
containerClassName = "",
|
|
926
|
-
|
|
956
|
+
as: RootTag = "div",
|
|
927
957
|
...props2
|
|
928
958
|
}) {
|
|
929
959
|
const cardClasses = ClassNames(
|
|
@@ -975,7 +1005,7 @@ function CardGroup({ cardProps = [], className = "", ...props2 }) {
|
|
|
975
1005
|
"usx-card-group",
|
|
976
1006
|
className
|
|
977
1007
|
);
|
|
978
|
-
return /* @__PURE__ */ jsx("ul", { className: classes, ...props2, children: cardProps.map((card, index) => /* @__PURE__ */ jsx(Card, { ...card,
|
|
1008
|
+
return /* @__PURE__ */ jsx("ul", { className: classes, ...props2, children: cardProps.map((card, index) => /* @__PURE__ */ jsx(Card, { ...card, as: "li" }, index)) });
|
|
979
1009
|
}
|
|
980
1010
|
function Hint({
|
|
981
1011
|
id,
|
|
@@ -1092,7 +1122,7 @@ const TextArea = ({
|
|
|
1092
1122
|
className: classes,
|
|
1093
1123
|
placeholder,
|
|
1094
1124
|
disabled,
|
|
1095
|
-
defaultValue,
|
|
1125
|
+
defaultValue: props2.value === void 0 ? defaultValue : void 0,
|
|
1096
1126
|
...required ? { required: true } : {},
|
|
1097
1127
|
"aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
|
|
1098
1128
|
"aria-invalid": hasError ? "true" : void 0,
|
|
@@ -1121,7 +1151,6 @@ function CharacterCount({
|
|
|
1121
1151
|
const infoId = `${fieldId}-info`;
|
|
1122
1152
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
1123
1153
|
const errorId = error ? `${fieldId}-error` : void 0;
|
|
1124
|
-
const successId = !error && success ? `${fieldId}-success` : void 0;
|
|
1125
1154
|
const outerClasses = ClassNames("usa-character-count", "usx-character-count", className);
|
|
1126
1155
|
const fieldProps = {
|
|
1127
1156
|
id: fieldId,
|
|
@@ -1136,7 +1165,7 @@ function CharacterCount({
|
|
|
1136
1165
|
maxLength: max,
|
|
1137
1166
|
formGroup: true,
|
|
1138
1167
|
className: "usa-character-count__field",
|
|
1139
|
-
"aria-describedby": [infoId, hintId, errorId
|
|
1168
|
+
"aria-describedby": [infoId, hintId, errorId].filter(Boolean).join(" "),
|
|
1140
1169
|
...props2
|
|
1141
1170
|
};
|
|
1142
1171
|
return /* @__PURE__ */ jsxs("div", { className: outerClasses, children: [
|
|
@@ -1164,6 +1193,7 @@ function Checkbox({
|
|
|
1164
1193
|
className = "",
|
|
1165
1194
|
onChange,
|
|
1166
1195
|
required = false,
|
|
1196
|
+
formGroup = true,
|
|
1167
1197
|
...props2
|
|
1168
1198
|
}) {
|
|
1169
1199
|
const hasError = !!error;
|
|
@@ -1178,7 +1208,7 @@ function Checkbox({
|
|
|
1178
1208
|
"usa-checkbox__input",
|
|
1179
1209
|
{ "usa-checkbox__input--tile": tile }
|
|
1180
1210
|
);
|
|
1181
|
-
|
|
1211
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1182
1212
|
/* @__PURE__ */ jsxs("div", { className: divClasses, ...props2, children: [
|
|
1183
1213
|
/* @__PURE__ */ jsx(
|
|
1184
1214
|
"input",
|
|
@@ -1188,7 +1218,7 @@ function Checkbox({
|
|
|
1188
1218
|
type: "checkbox",
|
|
1189
1219
|
name,
|
|
1190
1220
|
value,
|
|
1191
|
-
"aria-label": ariaLabel,
|
|
1221
|
+
"aria-label": ariaLabel || void 0,
|
|
1192
1222
|
defaultChecked: checked,
|
|
1193
1223
|
disabled,
|
|
1194
1224
|
required,
|
|
@@ -1202,6 +1232,7 @@ function Checkbox({
|
|
|
1202
1232
|
] }),
|
|
1203
1233
|
hasError ? /* @__PURE__ */ jsx(ErrorMessage, { children: error }) : hasSuccess ? /* @__PURE__ */ jsx("span", { className: "usa-success-message text-success", role: "status", children: success }) : null
|
|
1204
1234
|
] });
|
|
1235
|
+
return formGroup ? /* @__PURE__ */ jsx(FormGroup, { error: hasError, children: content }) : content;
|
|
1205
1236
|
}
|
|
1206
1237
|
function Legend({
|
|
1207
1238
|
text,
|
|
@@ -1278,7 +1309,8 @@ const CheckboxGroup = ({
|
|
|
1278
1309
|
tile,
|
|
1279
1310
|
small,
|
|
1280
1311
|
...opt,
|
|
1281
|
-
id
|
|
1312
|
+
id,
|
|
1313
|
+
formGroup: false
|
|
1282
1314
|
},
|
|
1283
1315
|
id
|
|
1284
1316
|
);
|
|
@@ -1316,28 +1348,6 @@ function Clickable({ className, children, ...rest }) {
|
|
|
1316
1348
|
Clickable.Link = ClickableLink;
|
|
1317
1349
|
Clickable.ColorChange = ClickableColorChange;
|
|
1318
1350
|
Clickable.BgColorChange = ClickableBgColorChange;
|
|
1319
|
-
const Tooltip = ({
|
|
1320
|
-
label,
|
|
1321
|
-
position = "top",
|
|
1322
|
-
children,
|
|
1323
|
-
className = "",
|
|
1324
|
-
bodyClassName = "",
|
|
1325
|
-
...props2
|
|
1326
|
-
}) => {
|
|
1327
|
-
const validPositions = ["top", "bottom", "left", "right"];
|
|
1328
|
-
const normalizedPosition = validPositions.includes(position) ? position : "top";
|
|
1329
|
-
return /* @__PURE__ */ jsxs("span", { className: ClassNames("usx-tooltip", className), ...props2, children: [
|
|
1330
|
-
children,
|
|
1331
|
-
/* @__PURE__ */ jsx(
|
|
1332
|
-
"span",
|
|
1333
|
-
{
|
|
1334
|
-
className: ClassNames("usa-tooltip__body", `usa-tooltip__body--${normalizedPosition}`, bodyClassName),
|
|
1335
|
-
role: "tooltip",
|
|
1336
|
-
children: label
|
|
1337
|
-
}
|
|
1338
|
-
)
|
|
1339
|
-
] });
|
|
1340
|
-
};
|
|
1341
1351
|
function copyTextToClipboard(text) {
|
|
1342
1352
|
if (window.navigator.clipboard) {
|
|
1343
1353
|
return window.navigator.clipboard.writeText(text);
|
|
@@ -1358,8 +1368,8 @@ function CopyToClipboard({
|
|
|
1358
1368
|
onClick: () => copyTextToClipboard(copyText),
|
|
1359
1369
|
type: "button",
|
|
1360
1370
|
children: [
|
|
1361
|
-
/* @__PURE__ */ jsx(Icon, { name: "content_copy",
|
|
1362
|
-
/* @__PURE__ */ jsx(Icon, { name: "check",
|
|
1371
|
+
/* @__PURE__ */ jsx(Icon, { name: "content_copy", className: "usx-copy__copy", staticBaseUrl }),
|
|
1372
|
+
/* @__PURE__ */ jsx(Icon, { name: "check", className: "usx-copy__check", staticBaseUrl }),
|
|
1363
1373
|
label && /* @__PURE__ */ jsx("span", { className: "margin-left-1", children: label })
|
|
1364
1374
|
]
|
|
1365
1375
|
}
|
|
@@ -1479,6 +1489,7 @@ function Combobox({
|
|
|
1479
1489
|
name,
|
|
1480
1490
|
disabled,
|
|
1481
1491
|
required,
|
|
1492
|
+
"aria-describedby": [hintId, errorId].filter(Boolean).join(" ") || void 0,
|
|
1482
1493
|
onChange: handleChange,
|
|
1483
1494
|
...props2,
|
|
1484
1495
|
children: options.map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value))
|
|
@@ -1489,7 +1500,7 @@ function Combobox({
|
|
|
1489
1500
|
] });
|
|
1490
1501
|
return formGroup ? /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: content }) : content;
|
|
1491
1502
|
}
|
|
1492
|
-
const props = { "
|
|
1503
|
+
const props = { "as": { "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": ["as", "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": ["as", "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": ["as", "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." } };
|
|
1493
1504
|
const config = {
|
|
1494
1505
|
props
|
|
1495
1506
|
};
|
|
@@ -1522,7 +1533,7 @@ function layoutClasses(layout, prefix = "") {
|
|
|
1522
1533
|
});
|
|
1523
1534
|
}
|
|
1524
1535
|
function Container({
|
|
1525
|
-
|
|
1536
|
+
as = "div",
|
|
1526
1537
|
gridContainer,
|
|
1527
1538
|
gridRow = false,
|
|
1528
1539
|
display,
|
|
@@ -1546,7 +1557,7 @@ function Container({
|
|
|
1546
1557
|
ariaLabel,
|
|
1547
1558
|
ariaLabelledby
|
|
1548
1559
|
}) {
|
|
1549
|
-
const Element = config.props.
|
|
1560
|
+
const Element = config.props.as.options.includes(as) ? as : "div";
|
|
1550
1561
|
const classes = ClassNames(
|
|
1551
1562
|
"usx-container",
|
|
1552
1563
|
gridContainer && config.props.gridContainer.options.includes(gridContainer) ? gridContainer === "default" ? "grid-container" : `grid-container-${gridContainer}` : null,
|
|
@@ -1707,49 +1718,140 @@ function DateRangePicker({
|
|
|
1707
1718
|
}
|
|
1708
1719
|
);
|
|
1709
1720
|
}
|
|
1721
|
+
function Summary({
|
|
1722
|
+
label = "Details",
|
|
1723
|
+
children,
|
|
1724
|
+
ariaLabel,
|
|
1725
|
+
className = "",
|
|
1726
|
+
textClassName = "",
|
|
1727
|
+
markerColor = void 0,
|
|
1728
|
+
underlineColor = void 0,
|
|
1729
|
+
noUnderline = false,
|
|
1730
|
+
noMarker = false,
|
|
1731
|
+
unstyled = false
|
|
1732
|
+
}) {
|
|
1733
|
+
if (unstyled) {
|
|
1734
|
+
return /* @__PURE__ */ jsx("summary", { className: className || void 0, "aria-label": ariaLabel, children: children ?? label });
|
|
1735
|
+
}
|
|
1736
|
+
const summaryClassNames = ClassNames(
|
|
1737
|
+
"usx-summary",
|
|
1738
|
+
{ [`marker-${markerColor}`]: markerColor && !noMarker },
|
|
1739
|
+
{ "usx-summary--no-marker": noMarker },
|
|
1740
|
+
{ "usx-summary--no-underline": noUnderline },
|
|
1741
|
+
className
|
|
1742
|
+
);
|
|
1743
|
+
const summaryTextClassNames = ClassNames(
|
|
1744
|
+
"usx-summary-text",
|
|
1745
|
+
{ [`underline-${underlineColor}`]: !noUnderline && underlineColor },
|
|
1746
|
+
textClassName
|
|
1747
|
+
);
|
|
1748
|
+
return /* @__PURE__ */ jsx("summary", { className: summaryClassNames, "aria-label": ariaLabel, children: /* @__PURE__ */ jsx("span", { className: summaryTextClassNames, children: children ?? (label || "Details") }) });
|
|
1749
|
+
}
|
|
1710
1750
|
function Details({
|
|
1711
|
-
|
|
1751
|
+
summaryProps = {},
|
|
1712
1752
|
text = "",
|
|
1713
1753
|
children = null,
|
|
1714
1754
|
open = false,
|
|
1715
|
-
|
|
1716
|
-
underlineColor = void 0,
|
|
1755
|
+
name,
|
|
1717
1756
|
contentBorderColor = void 0,
|
|
1718
1757
|
noContentBorder = false,
|
|
1719
|
-
noSummaryUnderline = false,
|
|
1720
1758
|
className = "",
|
|
1721
|
-
summaryClassName = "",
|
|
1722
|
-
summaryTextClassName = "",
|
|
1723
1759
|
contentClassName = ""
|
|
1724
1760
|
}) {
|
|
1725
1761
|
const detailsClassName = ClassNames(
|
|
1726
1762
|
"usx-details",
|
|
1727
1763
|
{ "usx-details--borderless": noContentBorder },
|
|
1728
|
-
{ "usx-details--no-underline": noSummaryUnderline },
|
|
1729
1764
|
className
|
|
1730
1765
|
);
|
|
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
1766
|
const compositeContentClassName = ClassNames(
|
|
1742
1767
|
"usx-details__content",
|
|
1743
1768
|
{ [`border-${contentBorderColor}`]: !noContentBorder && contentBorderColor },
|
|
1744
1769
|
contentClassName
|
|
1745
1770
|
);
|
|
1746
|
-
return /* @__PURE__ */ jsxs("details", { className: detailsClassName, open: open || void 0, children: [
|
|
1747
|
-
/* @__PURE__ */ jsx(
|
|
1771
|
+
return /* @__PURE__ */ jsxs("details", { className: detailsClassName, open: open || void 0, name, children: [
|
|
1772
|
+
/* @__PURE__ */ jsx(Summary, { ...summaryProps }),
|
|
1748
1773
|
/* @__PURE__ */ jsx("div", { className: compositeContentClassName, children: children ?? /* @__PURE__ */ jsx("p", { className: "usx-details__text", children: text }) })
|
|
1749
1774
|
] });
|
|
1750
1775
|
}
|
|
1776
|
+
function Drawer({
|
|
1777
|
+
id,
|
|
1778
|
+
label,
|
|
1779
|
+
heading,
|
|
1780
|
+
children,
|
|
1781
|
+
trigger,
|
|
1782
|
+
triggerAriaLabel,
|
|
1783
|
+
side = "inline-end",
|
|
1784
|
+
size = "default",
|
|
1785
|
+
description,
|
|
1786
|
+
footer,
|
|
1787
|
+
rounded = false,
|
|
1788
|
+
actionRequired = false,
|
|
1789
|
+
closeLabel = "Close",
|
|
1790
|
+
focusHeading = true,
|
|
1791
|
+
disabled = false,
|
|
1792
|
+
className,
|
|
1793
|
+
triggerClassName,
|
|
1794
|
+
panelClassName,
|
|
1795
|
+
...props2
|
|
1796
|
+
}) {
|
|
1797
|
+
const opener = { commandfor: id, command: "show-modal" };
|
|
1798
|
+
const closer = { commandfor: id, command: "close" };
|
|
1799
|
+
const dismissal = {
|
|
1800
|
+
closedby: actionRequired ? "none" : void 0
|
|
1801
|
+
};
|
|
1802
|
+
return /* @__PURE__ */ jsxs("div", { ...props2, className: ClassNames("usx-drawer", className), children: [
|
|
1803
|
+
/* @__PURE__ */ jsx(
|
|
1804
|
+
"button",
|
|
1805
|
+
{
|
|
1806
|
+
type: "button",
|
|
1807
|
+
className: triggerClassName || void 0,
|
|
1808
|
+
"aria-haspopup": "dialog",
|
|
1809
|
+
"aria-controls": id,
|
|
1810
|
+
"aria-label": triggerAriaLabel,
|
|
1811
|
+
disabled,
|
|
1812
|
+
...opener,
|
|
1813
|
+
children: trigger ?? label
|
|
1814
|
+
}
|
|
1815
|
+
),
|
|
1816
|
+
/* @__PURE__ */ jsxs(
|
|
1817
|
+
"dialog",
|
|
1818
|
+
{
|
|
1819
|
+
id,
|
|
1820
|
+
className: ClassNames(
|
|
1821
|
+
"usx-drawer__panel",
|
|
1822
|
+
{ "usx-drawer__panel--rounded": rounded },
|
|
1823
|
+
panelClassName
|
|
1824
|
+
),
|
|
1825
|
+
"data-side": side,
|
|
1826
|
+
"data-size": size,
|
|
1827
|
+
...dismissal,
|
|
1828
|
+
"aria-labelledby": `${id}-heading`,
|
|
1829
|
+
"aria-describedby": description ? `${id}-description` : void 0,
|
|
1830
|
+
children: [
|
|
1831
|
+
!actionRequired && /* @__PURE__ */ jsx("button", { type: "button", className: "usx-drawer__close", ...closer, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 3, alt: closeLabel }) }),
|
|
1832
|
+
/* @__PURE__ */ jsxs("header", { className: "usx-drawer__header", children: [
|
|
1833
|
+
/* @__PURE__ */ jsx(
|
|
1834
|
+
"h2",
|
|
1835
|
+
{
|
|
1836
|
+
id: `${id}-heading`,
|
|
1837
|
+
className: "usx-drawer__heading",
|
|
1838
|
+
tabIndex: focusHeading ? -1 : void 0,
|
|
1839
|
+
autoFocus: focusHeading,
|
|
1840
|
+
children: heading
|
|
1841
|
+
}
|
|
1842
|
+
),
|
|
1843
|
+
description && /* @__PURE__ */ jsx("p", { id: `${id}-description`, className: "usx-drawer__description", children: description })
|
|
1844
|
+
] }),
|
|
1845
|
+
/* @__PURE__ */ jsx("div", { className: "usx-drawer__body", children }),
|
|
1846
|
+
footer && /* @__PURE__ */ jsx("footer", { className: "usx-drawer__footer", children: footer })
|
|
1847
|
+
]
|
|
1848
|
+
}
|
|
1849
|
+
)
|
|
1850
|
+
] });
|
|
1851
|
+
}
|
|
1751
1852
|
function Link({
|
|
1752
1853
|
href = "javascript:void(0);",
|
|
1854
|
+
text,
|
|
1753
1855
|
children,
|
|
1754
1856
|
visited = false,
|
|
1755
1857
|
external = false,
|
|
@@ -1774,7 +1876,7 @@ function Link({
|
|
|
1774
1876
|
target: newTab || external ? "_blank" : void 0,
|
|
1775
1877
|
rel: newTab || external ? "noreferrer noopener" : void 0,
|
|
1776
1878
|
...props2,
|
|
1777
|
-
children
|
|
1879
|
+
children: children ?? text
|
|
1778
1880
|
}
|
|
1779
1881
|
);
|
|
1780
1882
|
}
|
|
@@ -1783,7 +1885,7 @@ function Page({
|
|
|
1783
1885
|
title = "Page title",
|
|
1784
1886
|
titleId = void 0,
|
|
1785
1887
|
eyebrow = null,
|
|
1786
|
-
|
|
1888
|
+
as: Element = "main",
|
|
1787
1889
|
children = null,
|
|
1788
1890
|
content = null,
|
|
1789
1891
|
tabIndex = void 0,
|
|
@@ -1793,7 +1895,6 @@ function Page({
|
|
|
1793
1895
|
}) {
|
|
1794
1896
|
const classes = ClassNames("usx-page", className);
|
|
1795
1897
|
const pageContent = children || content;
|
|
1796
|
-
const Element = element;
|
|
1797
1898
|
const labelledBy = ariaLabelledby || titleId || void 0;
|
|
1798
1899
|
return /* @__PURE__ */ jsxs(
|
|
1799
1900
|
Element,
|
|
@@ -1815,13 +1916,13 @@ function Page({
|
|
|
1815
1916
|
}
|
|
1816
1917
|
const validElements = ["div", "article", "section", "main"];
|
|
1817
1918
|
const Prose = ({
|
|
1818
|
-
|
|
1919
|
+
as = "div",
|
|
1819
1920
|
content,
|
|
1820
1921
|
children,
|
|
1821
1922
|
className = "",
|
|
1822
1923
|
...props2
|
|
1823
1924
|
}) => {
|
|
1824
|
-
const Element = validElements.includes(
|
|
1925
|
+
const Element = validElements.includes(as) ? as : "div";
|
|
1825
1926
|
return /* @__PURE__ */ jsx(
|
|
1826
1927
|
Element,
|
|
1827
1928
|
{
|
|
@@ -2053,9 +2154,12 @@ function FileInput({
|
|
|
2053
2154
|
commonLabel,
|
|
2054
2155
|
commonHint,
|
|
2055
2156
|
commonError,
|
|
2056
|
-
/* @__PURE__ */ jsx("div", { className: "usx-file-input__add-only", children: /* @__PURE__ */ jsx(
|
|
2157
|
+
/* @__PURE__ */ jsx("div", { className: "usx-file-input__add-only", "data-usx-file-list-hint": typeof fileListHint === "string" && fileListHint ? fileListHint : "Selected files", children: /* @__PURE__ */ jsx(
|
|
2057
2158
|
"input",
|
|
2058
2159
|
{
|
|
2160
|
+
ref: (node) => {
|
|
2161
|
+
if (node) node.usxReactManaged = true;
|
|
2162
|
+
},
|
|
2059
2163
|
className: ClassNames("usa-file-input", "usx-file-input", className),
|
|
2060
2164
|
id,
|
|
2061
2165
|
type: "file",
|
|
@@ -2303,12 +2407,9 @@ function Search({
|
|
|
2303
2407
|
onSubmit(query);
|
|
2304
2408
|
}
|
|
2305
2409
|
};
|
|
2306
|
-
const iconClasses = ClassNames(
|
|
2307
|
-
"
|
|
2308
|
-
|
|
2309
|
-
"display-inline-block": iconOnly
|
|
2310
|
-
}
|
|
2311
|
-
);
|
|
2410
|
+
const iconClasses = ClassNames("usa-search__submit-icon", {
|
|
2411
|
+
"display-inline-block": iconOnly
|
|
2412
|
+
});
|
|
2312
2413
|
const formClasses = ClassNames(
|
|
2313
2414
|
"usa-search",
|
|
2314
2415
|
{
|
|
@@ -2333,7 +2434,7 @@ function Search({
|
|
|
2333
2434
|
id,
|
|
2334
2435
|
label,
|
|
2335
2436
|
screenReaderOnlyLabel: true,
|
|
2336
|
-
placeholder,
|
|
2437
|
+
placeholder: placeholder ?? "",
|
|
2337
2438
|
defaultValue,
|
|
2338
2439
|
type: "search",
|
|
2339
2440
|
name: searchKey,
|
|
@@ -2342,7 +2443,7 @@ function Search({
|
|
|
2342
2443
|
),
|
|
2343
2444
|
/* @__PURE__ */ jsxs(Button, { variant: buttonVariant, type: "submit", children: [
|
|
2344
2445
|
!iconOnly && /* @__PURE__ */ jsx("span", { className: "usa-search__submit-text", children: label }),
|
|
2345
|
-
/* @__PURE__ */ jsx(Icon, { name: icon, className: iconClasses,
|
|
2446
|
+
/* @__PURE__ */ jsx(Icon, { name: icon, className: iconClasses, alt: iconOnly ? label : void 0 })
|
|
2346
2447
|
] })
|
|
2347
2448
|
]
|
|
2348
2449
|
}
|
|
@@ -2364,7 +2465,7 @@ function PrimaryNav({
|
|
|
2364
2465
|
}) {
|
|
2365
2466
|
const navClasses = ClassNames("usa-nav__primary", "usa-accordion");
|
|
2366
2467
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2367
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: "usa-nav__close", children: /* @__PURE__ */ jsx(Icon, { name: "close" }) }),
|
|
2468
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "usa-nav__close", children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 3 }) }),
|
|
2368
2469
|
/* @__PURE__ */ jsx("ul", { className: navClasses, children: navSections.map((section, index) => /* @__PURE__ */ jsx("li", { className: "usa-nav__primary-item", children: section.href ? /* @__PURE__ */ jsxs(
|
|
2369
2470
|
"a",
|
|
2370
2471
|
{
|
|
@@ -2472,7 +2573,7 @@ function Header({
|
|
|
2472
2573
|
] });
|
|
2473
2574
|
if (extended) {
|
|
2474
2575
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2475
|
-
/* @__PURE__ */ jsx("header", { className: headerClasses, ...props2, children: navbar }),
|
|
2576
|
+
/* @__PURE__ */ jsx("header", { id, className: headerClasses, ...props2, children: navbar }),
|
|
2476
2577
|
/* @__PURE__ */ jsx("nav", { "aria-label": "Primary navigation", className: navClasses, children: /* @__PURE__ */ jsxs("div", { className: "usa-nav__inner", children: [
|
|
2477
2578
|
/* @__PURE__ */ jsx(
|
|
2478
2579
|
PrimaryNav,
|
|
@@ -2504,7 +2605,7 @@ function Header({
|
|
|
2504
2605
|
] }) })
|
|
2505
2606
|
] });
|
|
2506
2607
|
}
|
|
2507
|
-
return /* @__PURE__ */ jsx("header", { className: headerClasses, ...props2, children: /* @__PURE__ */ jsxs("div", { className: "usa-nav-container", children: [
|
|
2608
|
+
return /* @__PURE__ */ jsx("header", { id, className: headerClasses, ...props2, children: /* @__PURE__ */ jsxs("div", { className: "usa-nav-container", children: [
|
|
2508
2609
|
navbar,
|
|
2509
2610
|
/* @__PURE__ */ jsx("nav", { "aria-label": "Primary navigation", className: navClasses, children: /* @__PURE__ */ jsx(
|
|
2510
2611
|
PrimaryNav,
|
|
@@ -2532,7 +2633,7 @@ function Hero({
|
|
|
2532
2633
|
contentPosition = "left",
|
|
2533
2634
|
boxed = true,
|
|
2534
2635
|
calloutMaxWidth,
|
|
2535
|
-
|
|
2636
|
+
headingAs = "h1",
|
|
2536
2637
|
secondaryContent = null,
|
|
2537
2638
|
overlay = true,
|
|
2538
2639
|
overlayOpacity,
|
|
@@ -2541,9 +2642,9 @@ function Hero({
|
|
|
2541
2642
|
style,
|
|
2542
2643
|
...props2
|
|
2543
2644
|
}) {
|
|
2544
|
-
const Heading =
|
|
2645
|
+
const Heading = headingAs;
|
|
2545
2646
|
const secondaryHeadings = { h1: "h2", h2: "h3", h3: "h4", h4: "h5", h5: "h6" };
|
|
2546
|
-
const SecondaryHeading = secondaryHeadings[
|
|
2647
|
+
const SecondaryHeading = secondaryHeadings[headingAs];
|
|
2547
2648
|
const classes = ClassNames(
|
|
2548
2649
|
"usx-hero",
|
|
2549
2650
|
overlay && "usx-hero--has-overlay",
|
|
@@ -2576,7 +2677,7 @@ function Hero({
|
|
|
2576
2677
|
] })
|
|
2577
2678
|
] }) });
|
|
2578
2679
|
}
|
|
2579
|
-
function renderContent
|
|
2680
|
+
function renderContent(content) {
|
|
2580
2681
|
if (typeof content === "string") {
|
|
2581
2682
|
return /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: content } });
|
|
2582
2683
|
}
|
|
@@ -2602,7 +2703,7 @@ function IconList({ items = [], primary = false, size = null, className = "", ..
|
|
|
2602
2703
|
) }),
|
|
2603
2704
|
/* @__PURE__ */ jsxs("div", { className: ClassNames("usa-icon-list__content", item.contentClassName), children: [
|
|
2604
2705
|
item.title ? /* @__PURE__ */ jsx("h4", { className: "usa-icon-list__title", children: item.title }) : null,
|
|
2605
|
-
renderContent
|
|
2706
|
+
renderContent(item.content)
|
|
2606
2707
|
] })
|
|
2607
2708
|
] }, index)) });
|
|
2608
2709
|
}
|
|
@@ -2698,7 +2799,7 @@ function Identifier({
|
|
|
2698
2799
|
className: ClassNames(
|
|
2699
2800
|
"usa-identifier__logos",
|
|
2700
2801
|
"usx-avatar-group",
|
|
2701
|
-
overlapAvatars && "
|
|
2802
|
+
overlapAvatars && "usx-avatar-group--overlap"
|
|
2702
2803
|
),
|
|
2703
2804
|
children: avatarProps.map((avatar, index) => /* @__PURE__ */ createElement(
|
|
2704
2805
|
Avatar,
|
|
@@ -2729,7 +2830,7 @@ function InPageNav({
|
|
|
2729
2830
|
id = "in-page-nav",
|
|
2730
2831
|
headingElements = "h2 h3",
|
|
2731
2832
|
mainContentSelector = null,
|
|
2732
|
-
|
|
2833
|
+
titleAs = "h4",
|
|
2733
2834
|
titleText = "On this page",
|
|
2734
2835
|
scrollOffset = 0,
|
|
2735
2836
|
rootMargin = "0px 0px 0px 0px",
|
|
@@ -2751,7 +2852,7 @@ function InPageNav({
|
|
|
2751
2852
|
className: ClassNames("usa-in-page-nav", "usx-in-page-nav", className),
|
|
2752
2853
|
"data-heading-elements": headingElements,
|
|
2753
2854
|
"data-main-content-selector": resolvedSelector,
|
|
2754
|
-
"data-title-heading-level":
|
|
2855
|
+
"data-title-heading-level": titleAs,
|
|
2755
2856
|
"data-title-text": titleText,
|
|
2756
2857
|
"data-scroll-offset": scrollOffset,
|
|
2757
2858
|
"data-root-margin": rootMargin,
|
|
@@ -2953,6 +3054,7 @@ function Layout({
|
|
|
2953
3054
|
expandLeftSidebar,
|
|
2954
3055
|
expandRightSidebar,
|
|
2955
3056
|
expandable = false,
|
|
3057
|
+
onToggleExpanded,
|
|
2956
3058
|
className = "",
|
|
2957
3059
|
...props2
|
|
2958
3060
|
}) {
|
|
@@ -2962,6 +3064,11 @@ function Layout({
|
|
|
2962
3064
|
{ "usx-expanded": expandable && expanded },
|
|
2963
3065
|
className
|
|
2964
3066
|
);
|
|
3067
|
+
const toggleExpanded = (event) => {
|
|
3068
|
+
event.preventDefault();
|
|
3069
|
+
setExpanded(!expanded);
|
|
3070
|
+
onToggleExpanded == null ? void 0 : onToggleExpanded(!expanded);
|
|
3071
|
+
};
|
|
2965
3072
|
const expandButton = expandable ? /* @__PURE__ */ jsxs(
|
|
2966
3073
|
Button,
|
|
2967
3074
|
{
|
|
@@ -2970,8 +3077,9 @@ function Layout({
|
|
|
2970
3077
|
type: "button",
|
|
2971
3078
|
"aria-label": expanded ? "Contract" : "Expand",
|
|
2972
3079
|
"aria-expanded": expanded,
|
|
3080
|
+
"data-usx-layout-toggle": true,
|
|
2973
3081
|
className: "usx-layout__expand-button",
|
|
2974
|
-
onClick:
|
|
3082
|
+
onClick: toggleExpanded,
|
|
2975
3083
|
children: [
|
|
2976
3084
|
/* @__PURE__ */ jsx(Icon, { source: "usx", name: "expand", size: 3, className: "usx-layout__expand-icon usx-layout__expand-icon--expand" }),
|
|
2977
3085
|
/* @__PURE__ */ jsx(Icon, { source: "usx", name: "contract", size: 3, className: "usx-layout__expand-icon usx-layout__expand-icon--contract" })
|
|
@@ -3065,6 +3173,7 @@ function Select({
|
|
|
3065
3173
|
name,
|
|
3066
3174
|
className: combinedSelectClasses,
|
|
3067
3175
|
disabled,
|
|
3176
|
+
required: required || void 0,
|
|
3068
3177
|
defaultValue,
|
|
3069
3178
|
"aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
|
|
3070
3179
|
"aria-invalid": hasError ? true : void 0,
|
|
@@ -3201,8 +3310,8 @@ function MemorableDate({
|
|
|
3201
3310
|
function MiscBanner({
|
|
3202
3311
|
children = null,
|
|
3203
3312
|
className = "",
|
|
3204
|
-
|
|
3205
|
-
badgeText
|
|
3313
|
+
color = "beta",
|
|
3314
|
+
badgeText,
|
|
3206
3315
|
message = "Welcome to the beta website!",
|
|
3207
3316
|
casualLinkText,
|
|
3208
3317
|
casualLinkHref,
|
|
@@ -3211,11 +3320,15 @@ function MiscBanner({
|
|
|
3211
3320
|
importantLinkHref,
|
|
3212
3321
|
importantLinkIcon = "undo",
|
|
3213
3322
|
showReturnLink = true,
|
|
3323
|
+
id,
|
|
3214
3324
|
...props2
|
|
3215
3325
|
}) {
|
|
3216
|
-
const
|
|
3217
|
-
const
|
|
3218
|
-
const
|
|
3326
|
+
const instanceId = useId();
|
|
3327
|
+
const baseId = id || instanceId;
|
|
3328
|
+
const bannerColor = color || "beta";
|
|
3329
|
+
const toggleId = `${baseId}-dropdown-toggle`;
|
|
3330
|
+
const menuId = `${baseId}-dropdown`;
|
|
3331
|
+
const classes = ClassNames("usx-misc-banner", `bg-${bannerColor}`, className);
|
|
3219
3332
|
const mobileLinks = [];
|
|
3220
3333
|
const hasLearnMoreLink = showLearnMore && Boolean(casualLinkText);
|
|
3221
3334
|
const hasReturnLink = showReturnLink && Boolean(importantLinkText);
|
|
@@ -3232,7 +3345,7 @@ function MiscBanner({
|
|
|
3232
3345
|
});
|
|
3233
3346
|
}
|
|
3234
3347
|
const content = children || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3235
|
-
/* @__PURE__ */ jsx("strong", { className: `usx-misc-banner__badge text-${
|
|
3348
|
+
badgeText ? /* @__PURE__ */ jsx("strong", { className: `usx-misc-banner__badge text-${bannerColor}`, children: badgeText }) : null,
|
|
3236
3349
|
/* @__PURE__ */ jsxs("p", { className: "usx-misc-banner__text", children: [
|
|
3237
3350
|
message,
|
|
3238
3351
|
hasLearnMoreLink ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -3241,7 +3354,7 @@ function MiscBanner({
|
|
|
3241
3354
|
] }) : null
|
|
3242
3355
|
] }),
|
|
3243
3356
|
hasReturnLink ? /* @__PURE__ */ jsx("span", { className: "usx-misc-banner__return-text", children: /* @__PURE__ */ jsxs("a", { className: "usa-link usx-misc-banner__link", href: importantLinkHref, children: [
|
|
3244
|
-
/* @__PURE__ */ jsx(Icon, { name: importantLinkIcon, size: 1
|
|
3357
|
+
/* @__PURE__ */ jsx(Icon, { name: importantLinkIcon, size: 1 }),
|
|
3245
3358
|
" ",
|
|
3246
3359
|
importantLinkText
|
|
3247
3360
|
] }) }) : null,
|
|
@@ -3261,13 +3374,13 @@ function MiscBanner({
|
|
|
3261
3374
|
htmlFor: toggleId,
|
|
3262
3375
|
"aria-controls": menuId,
|
|
3263
3376
|
"aria-label": "Toggle banner links",
|
|
3264
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "expand_more", size: 4
|
|
3377
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "expand_more", size: 4 })
|
|
3265
3378
|
}
|
|
3266
3379
|
),
|
|
3267
3380
|
/* @__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}`)) }) })
|
|
3268
3381
|
] }) : null
|
|
3269
3382
|
] });
|
|
3270
|
-
return /* @__PURE__ */ jsx("div", { className: classes, ...props2, children: /* @__PURE__ */ jsx("div", { className: "usx-misc-banner__content grid-container", children: content }) });
|
|
3383
|
+
return /* @__PURE__ */ jsx("div", { id, className: classes, ...props2, children: /* @__PURE__ */ jsx("div", { className: "usx-misc-banner__content grid-container", children: content }) });
|
|
3271
3384
|
}
|
|
3272
3385
|
function Modal({
|
|
3273
3386
|
id = "usx-modal",
|
|
@@ -3364,153 +3477,147 @@ function getUnboundedPageItems(currentPage) {
|
|
|
3364
3477
|
function PaginationNavigation({
|
|
3365
3478
|
currentPage,
|
|
3366
3479
|
totalPages,
|
|
3367
|
-
|
|
3480
|
+
pageSize = 10,
|
|
3481
|
+
totalItems,
|
|
3368
3482
|
ariaLabel = "Pagination",
|
|
3369
3483
|
prevLabel = "Previous",
|
|
3370
3484
|
nextLabel = "Next",
|
|
3371
3485
|
hideLinkText = false,
|
|
3372
3486
|
arrowsOnly = false,
|
|
3487
|
+
pageUrlPrefix,
|
|
3373
3488
|
className = ""
|
|
3374
3489
|
}) {
|
|
3375
3490
|
const unbounded = totalPages === void 0 || totalPages === null;
|
|
3376
3491
|
const items = unbounded ? getUnboundedPageItems(currentPage) : getPageItems(currentPage, totalPages);
|
|
3377
3492
|
const isFirstPage = currentPage === 1;
|
|
3378
3493
|
const isLastPage = !unbounded && currentPage === totalPages;
|
|
3379
|
-
const
|
|
3380
|
-
const handlePage = (page) => (e) => {
|
|
3381
|
-
e.preventDefault();
|
|
3382
|
-
if (e.detail > 1) return;
|
|
3383
|
-
if (page !== currentPage) onPageChange(page);
|
|
3384
|
-
};
|
|
3385
|
-
const handlePrev = (e) => {
|
|
3386
|
-
e.preventDefault();
|
|
3387
|
-
if (e.timeStamp - lastClickTime.current < 50) return;
|
|
3388
|
-
lastClickTime.current = e.timeStamp;
|
|
3389
|
-
if (!isFirstPage) onPageChange((prev) => Math.max(prev - 1, 1));
|
|
3390
|
-
};
|
|
3391
|
-
const handleNext = (e) => {
|
|
3392
|
-
e.preventDefault();
|
|
3393
|
-
if (e.timeStamp - lastClickTime.current < 50) return;
|
|
3394
|
-
lastClickTime.current = e.timeStamp;
|
|
3395
|
-
if (!isLastPage) onPageChange((prev) => unbounded ? prev + 1 : Math.min(prev + 1, totalPages));
|
|
3396
|
-
};
|
|
3494
|
+
const hrefFor = (page) => pageUrlPrefix ? `${pageUrlPrefix}${page}` : "#";
|
|
3397
3495
|
const navClasses = ClassNames(
|
|
3398
3496
|
"usa-pagination",
|
|
3399
3497
|
"usx-pagination__nav",
|
|
3400
3498
|
{ "usx-pagination__arrows-only": arrowsOnly },
|
|
3401
3499
|
className
|
|
3402
3500
|
);
|
|
3403
|
-
return /* @__PURE__ */ jsx(
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3501
|
+
return /* @__PURE__ */ jsx(
|
|
3502
|
+
"nav",
|
|
3503
|
+
{
|
|
3504
|
+
"aria-label": ariaLabel,
|
|
3505
|
+
className: navClasses,
|
|
3506
|
+
"data-usx-pagination-current-page": currentPage,
|
|
3507
|
+
"data-usx-pagination-page-size": pageSize,
|
|
3508
|
+
"data-usx-pagination-total-items": totalItems ?? "",
|
|
3509
|
+
children: /* @__PURE__ */ jsxs("ul", { className: "usa-pagination__list", children: [
|
|
3510
|
+
/* @__PURE__ */ jsx(
|
|
3511
|
+
"li",
|
|
3413
3512
|
{
|
|
3414
|
-
href: "#",
|
|
3415
3513
|
className: ClassNames(
|
|
3416
|
-
"usa-
|
|
3417
|
-
"usa-
|
|
3418
|
-
isFirstPage && "display-none",
|
|
3419
|
-
hideLinkText && "padding-1 margin-0"
|
|
3514
|
+
"usa-pagination__item",
|
|
3515
|
+
"usa-pagination__arrow"
|
|
3420
3516
|
),
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3517
|
+
children: /* @__PURE__ */ jsxs(
|
|
3518
|
+
"a",
|
|
3519
|
+
{
|
|
3520
|
+
href: isFirstPage ? "#" : hrefFor(currentPage - 1),
|
|
3521
|
+
"data-usx-pagination-page": currentPage - 1,
|
|
3522
|
+
className: ClassNames(
|
|
3523
|
+
"usa-pagination__link",
|
|
3524
|
+
"usa-pagination__previous-page",
|
|
3525
|
+
isFirstPage && "display-none",
|
|
3526
|
+
hideLinkText && "padding-1 margin-0"
|
|
3527
|
+
),
|
|
3528
|
+
"aria-label": `${prevLabel} page`,
|
|
3529
|
+
"aria-disabled": isFirstPage ? "true" : void 0,
|
|
3530
|
+
tabIndex: isFirstPage ? -1 : void 0,
|
|
3531
|
+
children: [
|
|
3532
|
+
/* @__PURE__ */ jsx(Icon, { name: "navigate_before" }),
|
|
3533
|
+
/* @__PURE__ */ jsx(
|
|
3534
|
+
"span",
|
|
3535
|
+
{
|
|
3536
|
+
className: ClassNames(
|
|
3537
|
+
"usa-pagination__link-text",
|
|
3538
|
+
hideLinkText && "usa-sr-only"
|
|
3539
|
+
),
|
|
3540
|
+
children: prevLabel
|
|
3541
|
+
}
|
|
3542
|
+
)
|
|
3543
|
+
]
|
|
3544
|
+
}
|
|
3545
|
+
)
|
|
3438
3546
|
}
|
|
3439
|
-
)
|
|
3440
|
-
}
|
|
3441
|
-
),
|
|
3442
|
-
!arrowsOnly && items.map((item, index) => {
|
|
3443
|
-
if (item.type === "ellipsis") {
|
|
3444
|
-
return /* @__PURE__ */ jsx(
|
|
3445
|
-
"li",
|
|
3446
|
-
{
|
|
3447
|
-
className: "usa-pagination__item usa-pagination__overflow",
|
|
3448
|
-
"aria-hidden": "true",
|
|
3449
|
-
children: /* @__PURE__ */ jsx("span", { children: "…" })
|
|
3450
|
-
},
|
|
3451
|
-
item.key || `ellipsis-${index}`
|
|
3452
|
-
);
|
|
3453
|
-
}
|
|
3454
|
-
const isCurrent = item.page === currentPage;
|
|
3455
|
-
return /* @__PURE__ */ jsx("li", { className: "usa-pagination__item usa-pagination__page-no", children: /* @__PURE__ */ jsx(
|
|
3456
|
-
"a",
|
|
3457
|
-
{
|
|
3458
|
-
href: "#",
|
|
3459
|
-
className: ClassNames(
|
|
3460
|
-
"usa-pagination__button",
|
|
3461
|
-
isCurrent && "usa-current"
|
|
3462
|
-
),
|
|
3463
|
-
"aria-label": `Page ${item.page}`,
|
|
3464
|
-
"aria-current": isCurrent ? "page" : void 0,
|
|
3465
|
-
onClick: handlePage(item.page),
|
|
3466
|
-
children: item.page
|
|
3467
|
-
}
|
|
3468
|
-
) }, item.page);
|
|
3469
|
-
}),
|
|
3470
|
-
/* @__PURE__ */ jsx(
|
|
3471
|
-
"li",
|
|
3472
|
-
{
|
|
3473
|
-
className: ClassNames(
|
|
3474
|
-
"usa-pagination__item",
|
|
3475
|
-
"usa-pagination__arrow"
|
|
3476
3547
|
),
|
|
3477
|
-
|
|
3478
|
-
"
|
|
3548
|
+
!arrowsOnly && items.map((item, index) => {
|
|
3549
|
+
if (item.type === "ellipsis") {
|
|
3550
|
+
return /* @__PURE__ */ jsx(
|
|
3551
|
+
"li",
|
|
3552
|
+
{
|
|
3553
|
+
className: "usa-pagination__item usa-pagination__overflow",
|
|
3554
|
+
"aria-hidden": "true",
|
|
3555
|
+
children: /* @__PURE__ */ jsx("span", { children: "…" })
|
|
3556
|
+
},
|
|
3557
|
+
item.key || `ellipsis-${index}`
|
|
3558
|
+
);
|
|
3559
|
+
}
|
|
3560
|
+
const isCurrent = item.page === currentPage;
|
|
3561
|
+
return /* @__PURE__ */ jsx("li", { className: "usa-pagination__item usa-pagination__page-no", children: /* @__PURE__ */ jsx(
|
|
3562
|
+
"a",
|
|
3563
|
+
{
|
|
3564
|
+
href: hrefFor(item.page),
|
|
3565
|
+
"data-usx-pagination-page": item.page,
|
|
3566
|
+
className: ClassNames(
|
|
3567
|
+
"usa-pagination__button",
|
|
3568
|
+
isCurrent && "usa-current"
|
|
3569
|
+
),
|
|
3570
|
+
"aria-label": `Page ${item.page}`,
|
|
3571
|
+
"aria-current": isCurrent ? "page" : void 0,
|
|
3572
|
+
children: item.page
|
|
3573
|
+
}
|
|
3574
|
+
) }, item.page);
|
|
3575
|
+
}),
|
|
3576
|
+
/* @__PURE__ */ jsx(
|
|
3577
|
+
"li",
|
|
3479
3578
|
{
|
|
3480
|
-
href: "#",
|
|
3481
3579
|
className: ClassNames(
|
|
3482
|
-
"usa-
|
|
3483
|
-
"usa-
|
|
3484
|
-
isLastPage && "display-none",
|
|
3485
|
-
hideLinkText && "padding-1 margin-0"
|
|
3580
|
+
"usa-pagination__item",
|
|
3581
|
+
"usa-pagination__arrow"
|
|
3486
3582
|
),
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3583
|
+
children: /* @__PURE__ */ jsxs(
|
|
3584
|
+
"a",
|
|
3585
|
+
{
|
|
3586
|
+
href: isLastPage ? "#" : hrefFor(currentPage + 1),
|
|
3587
|
+
"data-usx-pagination-page": currentPage + 1,
|
|
3588
|
+
className: ClassNames(
|
|
3589
|
+
"usa-pagination__link",
|
|
3590
|
+
"usa-pagination__next-page",
|
|
3591
|
+
isLastPage && "display-none",
|
|
3592
|
+
hideLinkText && "padding-1 margin-0"
|
|
3593
|
+
),
|
|
3594
|
+
"aria-label": `${nextLabel} page`,
|
|
3595
|
+
"aria-disabled": isLastPage ? "true" : void 0,
|
|
3596
|
+
tabIndex: isLastPage ? -1 : void 0,
|
|
3597
|
+
children: [
|
|
3598
|
+
/* @__PURE__ */ jsx(
|
|
3599
|
+
"span",
|
|
3600
|
+
{
|
|
3601
|
+
className: ClassNames(
|
|
3602
|
+
"usa-pagination__link-text",
|
|
3603
|
+
hideLinkText && "usa-sr-only"
|
|
3604
|
+
),
|
|
3605
|
+
children: nextLabel
|
|
3606
|
+
}
|
|
3498
3607
|
),
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
]
|
|
3608
|
+
/* @__PURE__ */ jsx(Icon, { name: "navigate_next" })
|
|
3609
|
+
]
|
|
3610
|
+
}
|
|
3611
|
+
)
|
|
3504
3612
|
}
|
|
3505
3613
|
)
|
|
3506
|
-
}
|
|
3507
|
-
|
|
3508
|
-
|
|
3614
|
+
] })
|
|
3615
|
+
}
|
|
3616
|
+
);
|
|
3509
3617
|
}
|
|
3510
3618
|
function PaginationStepOptions({
|
|
3511
3619
|
pageSize,
|
|
3512
3620
|
pageSizeOptions = [10, 25, 50, 100],
|
|
3513
|
-
onPageSizeChange,
|
|
3514
3621
|
label = "Items per page",
|
|
3515
3622
|
id = "pagination-step-options",
|
|
3516
3623
|
className = ""
|
|
@@ -3519,19 +3626,16 @@ function PaginationStepOptions({
|
|
|
3519
3626
|
"usx-pagination__step-options",
|
|
3520
3627
|
className
|
|
3521
3628
|
);
|
|
3522
|
-
const handleChange = (e) => {
|
|
3523
|
-
onPageSizeChange(Number(e.target.value));
|
|
3524
|
-
};
|
|
3525
3629
|
return /* @__PURE__ */ jsx("div", { className: classes, children: /* @__PURE__ */ jsx(
|
|
3526
3630
|
Select,
|
|
3527
3631
|
{
|
|
3528
3632
|
id,
|
|
3529
3633
|
label,
|
|
3530
|
-
|
|
3531
|
-
onChange: handleChange,
|
|
3634
|
+
defaultValue: String(pageSize),
|
|
3532
3635
|
formGroup: false,
|
|
3533
3636
|
options: pageSizeOptions.map((size) => ({ value: String(size), label: String(size) }))
|
|
3534
|
-
}
|
|
3637
|
+
},
|
|
3638
|
+
pageSize
|
|
3535
3639
|
) });
|
|
3536
3640
|
}
|
|
3537
3641
|
function PaginationSummary({
|
|
@@ -3579,13 +3683,15 @@ function PaginationContainer({
|
|
|
3579
3683
|
] });
|
|
3580
3684
|
}
|
|
3581
3685
|
function Pagination({
|
|
3686
|
+
renderPart,
|
|
3582
3687
|
initialPage = 1,
|
|
3583
3688
|
initialPageSize = 10,
|
|
3689
|
+
currentPage: page,
|
|
3690
|
+
pageSize: size,
|
|
3584
3691
|
pageSizeOptions = [10, 25, 50, 100],
|
|
3692
|
+
stepOptionsId,
|
|
3585
3693
|
totalItems,
|
|
3586
3694
|
unbounded = false,
|
|
3587
|
-
onPageChange,
|
|
3588
|
-
onPageSizeChange,
|
|
3589
3695
|
ariaLabel = "Pagination",
|
|
3590
3696
|
prevLabel = "Previous",
|
|
3591
3697
|
nextLabel = "Next",
|
|
@@ -3594,77 +3700,166 @@ function Pagination({
|
|
|
3594
3700
|
showSummary = true,
|
|
3595
3701
|
hideLinkText = true,
|
|
3596
3702
|
arrowsOnly = false,
|
|
3703
|
+
pageUrlPrefix,
|
|
3597
3704
|
className = ""
|
|
3598
3705
|
}) {
|
|
3599
|
-
const
|
|
3600
|
-
const
|
|
3706
|
+
const currentPage = page ?? initialPage;
|
|
3707
|
+
const pageSize = size ?? initialPageSize;
|
|
3601
3708
|
const totalPages = totalItems !== void 0 && !unbounded ? Math.ceil(totalItems / pageSize) : void 0;
|
|
3602
3709
|
const displaySummary = showSummary !== void 0 ? showSummary : totalItems !== void 0;
|
|
3603
|
-
const handlePageChange = (pageOrFn) => {
|
|
3604
|
-
setCurrentPage((prev) => {
|
|
3605
|
-
const next = typeof pageOrFn === "function" ? pageOrFn(prev) : pageOrFn;
|
|
3606
|
-
onPageChange == null ? void 0 : onPageChange(next, pageSize);
|
|
3607
|
-
return next;
|
|
3608
|
-
});
|
|
3609
|
-
};
|
|
3610
|
-
const handlePageSizeChange = (size) => {
|
|
3611
|
-
const newTotalPages = totalItems ? Math.ceil(totalItems / size) : void 0;
|
|
3612
|
-
const newPage = newTotalPages ? Math.min(currentPage, newTotalPages) : 1;
|
|
3613
|
-
setPageSize(size);
|
|
3614
|
-
setCurrentPage(newPage);
|
|
3615
|
-
onPageSizeChange == null ? void 0 : onPageSizeChange(size, newPage);
|
|
3616
|
-
onPageChange == null ? void 0 : onPageChange(newPage, size);
|
|
3617
|
-
};
|
|
3618
3710
|
const classes = ClassNames("usx-pagination", className);
|
|
3711
|
+
const navigation = /* @__PURE__ */ jsx(
|
|
3712
|
+
PaginationNavigation,
|
|
3713
|
+
{
|
|
3714
|
+
currentPage,
|
|
3715
|
+
totalPages,
|
|
3716
|
+
pageSize,
|
|
3717
|
+
totalItems,
|
|
3718
|
+
ariaLabel,
|
|
3719
|
+
prevLabel,
|
|
3720
|
+
nextLabel,
|
|
3721
|
+
hideLinkText,
|
|
3722
|
+
arrowsOnly,
|
|
3723
|
+
pageUrlPrefix
|
|
3724
|
+
}
|
|
3725
|
+
);
|
|
3726
|
+
const stepOptions = /* @__PURE__ */ jsx(
|
|
3727
|
+
PaginationStepOptions,
|
|
3728
|
+
{
|
|
3729
|
+
pageSize,
|
|
3730
|
+
pageSizeOptions,
|
|
3731
|
+
id: stepOptionsId
|
|
3732
|
+
}
|
|
3733
|
+
);
|
|
3734
|
+
const summary = typeof totalItems === "number" ? /* @__PURE__ */ jsx(
|
|
3735
|
+
PaginationSummary,
|
|
3736
|
+
{
|
|
3737
|
+
currentPage,
|
|
3738
|
+
pageSize,
|
|
3739
|
+
totalItems,
|
|
3740
|
+
itemLabel
|
|
3741
|
+
}
|
|
3742
|
+
) : null;
|
|
3743
|
+
if (renderPart === "navigation") return navigation;
|
|
3744
|
+
if (renderPart === "step-options") return stepOptions;
|
|
3745
|
+
if (renderPart === "summary") return summary;
|
|
3619
3746
|
return /* @__PURE__ */ jsx("div", { className: classes, children: /* @__PURE__ */ jsx(
|
|
3620
3747
|
PaginationContainer,
|
|
3621
3748
|
{
|
|
3622
|
-
summary: displaySummary
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3749
|
+
summary: displaySummary ? summary : null,
|
|
3750
|
+
navigation,
|
|
3751
|
+
stepOptions: showStepOptions ? stepOptions : null
|
|
3752
|
+
}
|
|
3753
|
+
) });
|
|
3754
|
+
}
|
|
3755
|
+
function PopoverMenu({ items, prefix, panelShape, className, ...props2 }) {
|
|
3756
|
+
const generatedPrefix = React.useId();
|
|
3757
|
+
const base = prefix ?? generatedPrefix;
|
|
3758
|
+
return /* @__PURE__ */ jsx("ul", { ...props2, className: ClassNames("usx-popover__menu", className), children: items.map((item, index) => {
|
|
3759
|
+
const id = item.id ?? `${base}-${index}`;
|
|
3760
|
+
return /* @__PURE__ */ jsxs("li", { children: [
|
|
3761
|
+
item.type === "details" && /* @__PURE__ */ jsx(
|
|
3762
|
+
Popover,
|
|
3633
3763
|
{
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3764
|
+
id,
|
|
3765
|
+
summaryProps: {
|
|
3766
|
+
...item.summaryProps,
|
|
3767
|
+
className: ClassNames(item.summaryProps.className, "usx-popover__menu-item")
|
|
3768
|
+
},
|
|
3769
|
+
name: base,
|
|
3770
|
+
side: "right",
|
|
3771
|
+
panelShape,
|
|
3772
|
+
menuItems: item.items
|
|
3642
3773
|
}
|
|
3643
3774
|
),
|
|
3644
|
-
|
|
3645
|
-
|
|
3775
|
+
item.type === "link" && /* @__PURE__ */ jsx(
|
|
3776
|
+
Link,
|
|
3646
3777
|
{
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3778
|
+
href: item.href,
|
|
3779
|
+
text: item.text,
|
|
3780
|
+
className: "usx-no-visited usx-popover__menu-item"
|
|
3650
3781
|
}
|
|
3651
|
-
)
|
|
3652
|
-
|
|
3653
|
-
|
|
3782
|
+
),
|
|
3783
|
+
item.type === "text" && /* @__PURE__ */ jsx("span", { className: "usx-popover__menu-item", children: item.text })
|
|
3784
|
+
] }, id);
|
|
3785
|
+
}) });
|
|
3654
3786
|
}
|
|
3655
|
-
function
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3787
|
+
function Popover({
|
|
3788
|
+
id,
|
|
3789
|
+
side = "bottom",
|
|
3790
|
+
align = "start",
|
|
3791
|
+
panelShape = "rounded",
|
|
3792
|
+
defaultOpen = false,
|
|
3793
|
+
menuItems,
|
|
3794
|
+
showClose = false,
|
|
3795
|
+
closeLabel = "Close",
|
|
3796
|
+
panelHeading,
|
|
3797
|
+
headingAs = "h2",
|
|
3798
|
+
scrollable = false,
|
|
3799
|
+
className,
|
|
3800
|
+
summaryProps,
|
|
3801
|
+
panelClassName,
|
|
3802
|
+
contentClassName,
|
|
3803
|
+
children,
|
|
3804
|
+
...props2
|
|
3805
|
+
}) {
|
|
3806
|
+
const [initiallyOpen] = React.useState(defaultOpen);
|
|
3807
|
+
const composedSummaryProps = { ...summaryProps, label: (summaryProps == null ? void 0 : summaryProps.label) ?? "Open panel" };
|
|
3808
|
+
const Heading = headingAs;
|
|
3809
|
+
return /* @__PURE__ */ jsxs(
|
|
3810
|
+
"details",
|
|
3811
|
+
{
|
|
3812
|
+
...props2,
|
|
3813
|
+
className: ClassNames("usx-popover", className),
|
|
3814
|
+
open: initiallyOpen || void 0,
|
|
3815
|
+
"data-side": side,
|
|
3816
|
+
"data-align": align,
|
|
3817
|
+
children: [
|
|
3818
|
+
/* @__PURE__ */ jsx(Summary, { unstyled: true, ...composedSummaryProps }),
|
|
3819
|
+
/* @__PURE__ */ jsxs(
|
|
3820
|
+
"div",
|
|
3821
|
+
{
|
|
3822
|
+
id,
|
|
3823
|
+
className: ClassNames("usx-popover__panel", {
|
|
3824
|
+
"usx-popover__panel--square": panelShape === "square"
|
|
3825
|
+
}, panelClassName),
|
|
3826
|
+
children: [
|
|
3827
|
+
panelHeading && /* @__PURE__ */ jsx(Heading, { className: "usx-popover__panel-heading", children: panelHeading }),
|
|
3828
|
+
menuItems && /* @__PURE__ */ jsx(PopoverMenu, { items: menuItems, prefix: id, panelShape }),
|
|
3829
|
+
children && /* @__PURE__ */ jsx(
|
|
3830
|
+
"div",
|
|
3831
|
+
{
|
|
3832
|
+
className: ClassNames(
|
|
3833
|
+
"usx-popover__panel-content",
|
|
3834
|
+
{ "usx-popover__scroll": scrollable },
|
|
3835
|
+
contentClassName
|
|
3836
|
+
),
|
|
3837
|
+
children
|
|
3838
|
+
}
|
|
3839
|
+
),
|
|
3840
|
+
showClose && /* @__PURE__ */ jsx(
|
|
3841
|
+
Button,
|
|
3842
|
+
{
|
|
3843
|
+
variant: "unstyled",
|
|
3844
|
+
className: "usx-popover__panel-close",
|
|
3845
|
+
"data-usx-popover-close": id,
|
|
3846
|
+
children: closeLabel
|
|
3847
|
+
}
|
|
3848
|
+
)
|
|
3849
|
+
]
|
|
3850
|
+
}
|
|
3851
|
+
)
|
|
3852
|
+
]
|
|
3853
|
+
}
|
|
3854
|
+
);
|
|
3660
3855
|
}
|
|
3661
3856
|
const ProcessList = ({ items = [], className = "", ...props2 }) => {
|
|
3662
3857
|
const classes = ClassNames("usa-process-list", "usx-process-list", className);
|
|
3663
3858
|
return /* @__PURE__ */ jsx("ol", { className: classes, ...props2, children: items.map((item, index) => {
|
|
3664
|
-
const
|
|
3859
|
+
const Heading = item.headingAs || "h4";
|
|
3665
3860
|
return /* @__PURE__ */ jsxs("li", { className: ClassNames("usa-process-list__item", item.className), children: [
|
|
3666
|
-
/* @__PURE__ */ jsx(
|
|
3667
|
-
item.body && (
|
|
3861
|
+
/* @__PURE__ */ jsx(Heading, { className: ClassNames("usa-process-list__heading", item.headingClassName), children: item.heading }),
|
|
3862
|
+
item.body && (item.bodyClassName ? /* @__PURE__ */ jsx("div", { className: item.bodyClassName, children: item.body }) : item.body)
|
|
3668
3863
|
] }, index);
|
|
3669
3864
|
}) });
|
|
3670
3865
|
};
|
|
@@ -3682,7 +3877,7 @@ function Quote({
|
|
|
3682
3877
|
const isVertical = (calloutProps == null ? void 0 : calloutProps.orientation) === "vertical";
|
|
3683
3878
|
return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-quote", isVertical && "usx-quote--vertical", className), ...props2, children: [
|
|
3684
3879
|
!isVertical && /* @__PURE__ */ jsx(Icon, { name: "format_quote", size: 4, className: "usx-quote__icon" }),
|
|
3685
|
-
/* @__PURE__ */ jsx(Callout, { ...calloutProps,
|
|
3880
|
+
/* @__PURE__ */ jsx(Callout, { ...calloutProps, as: "div", children: /* @__PURE__ */ jsxs("figure", { className: "usx-quote__body", children: [
|
|
3686
3881
|
/* @__PURE__ */ jsxs(
|
|
3687
3882
|
"blockquote",
|
|
3688
3883
|
{
|
|
@@ -3710,42 +3905,46 @@ const RadioButtons = ({
|
|
|
3710
3905
|
hint = null,
|
|
3711
3906
|
error = null,
|
|
3712
3907
|
name = "radio-group",
|
|
3908
|
+
id: groupId,
|
|
3713
3909
|
options = [],
|
|
3714
3910
|
defaultValue = void 0,
|
|
3715
3911
|
className = "",
|
|
3716
3912
|
...props2
|
|
3717
3913
|
}) => {
|
|
3718
|
-
const classes = ClassNames(
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3914
|
+
const classes = ClassNames("usa-radio", "usx-radio", { "usx-radio--small": small }, className);
|
|
3915
|
+
const inputClasses = ClassNames("usa-radio__input", { "usa-radio__input--tile": tile });
|
|
3916
|
+
return /* @__PURE__ */ jsx(FormGroup, { error: !!error, children: /* @__PURE__ */ jsx(
|
|
3917
|
+
Fieldset,
|
|
3918
|
+
{
|
|
3919
|
+
id: groupId,
|
|
3920
|
+
legend,
|
|
3921
|
+
required,
|
|
3922
|
+
hint,
|
|
3923
|
+
error,
|
|
3924
|
+
...props2,
|
|
3925
|
+
children: options.map((opt, idx) => {
|
|
3926
|
+
const id = opt.id || `${groupId || name}-${idx}`;
|
|
3927
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, children: [
|
|
3928
|
+
/* @__PURE__ */ jsx(
|
|
3929
|
+
"input",
|
|
3930
|
+
{
|
|
3931
|
+
className: inputClasses,
|
|
3932
|
+
id,
|
|
3933
|
+
type: "radio",
|
|
3934
|
+
name,
|
|
3935
|
+
value: opt.value,
|
|
3936
|
+
defaultChecked: defaultValue === opt.value || !!opt.checked,
|
|
3937
|
+
disabled: !!opt.disabled
|
|
3938
|
+
}
|
|
3939
|
+
),
|
|
3940
|
+
/* @__PURE__ */ jsxs(Label, { className: "usa-radio__label", classOverride: true, htmlFor: id, children: [
|
|
3941
|
+
opt.label,
|
|
3942
|
+
opt.description ? /* @__PURE__ */ jsx("span", { className: "usa-checkbox__label-description", children: opt.description }) : null
|
|
3943
|
+
] })
|
|
3944
|
+
] }, id);
|
|
3945
|
+
})
|
|
3946
|
+
}
|
|
3947
|
+
) });
|
|
3749
3948
|
};
|
|
3750
3949
|
function RangeSlider({
|
|
3751
3950
|
id = "range-slider",
|
|
@@ -3761,7 +3960,7 @@ function RangeSlider({
|
|
|
3761
3960
|
value,
|
|
3762
3961
|
defaultValue,
|
|
3763
3962
|
textUnit = null,
|
|
3764
|
-
textPreposition =
|
|
3963
|
+
textPreposition = "of",
|
|
3765
3964
|
formGroup = true,
|
|
3766
3965
|
className = "",
|
|
3767
3966
|
...props2
|
|
@@ -3798,7 +3997,7 @@ function RangeSlider({
|
|
|
3798
3997
|
}
|
|
3799
3998
|
const Section = ({
|
|
3800
3999
|
title = "",
|
|
3801
|
-
|
|
4000
|
+
headingAs = "h2",
|
|
3802
4001
|
children = null,
|
|
3803
4002
|
content = null,
|
|
3804
4003
|
className = "",
|
|
@@ -3806,7 +4005,7 @@ const Section = ({
|
|
|
3806
4005
|
}) => {
|
|
3807
4006
|
const classes = ClassNames("usx-section", className);
|
|
3808
4007
|
const sectionContent = children || content;
|
|
3809
|
-
const Heading = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(
|
|
4008
|
+
const Heading = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(headingAs) ? headingAs : "h2";
|
|
3810
4009
|
return /* @__PURE__ */ jsxs("section", { className: classes, ...props2, children: [
|
|
3811
4010
|
title ? /* @__PURE__ */ jsx(Heading, { className: "usx-section__title", children: title }) : null,
|
|
3812
4011
|
/* @__PURE__ */ jsx("div", { className: "usx-section__content", children: sectionContent })
|
|
@@ -3871,16 +4070,6 @@ const SiteAlert = ({
|
|
|
3871
4070
|
onDismiss && "usa-site-alert--dismissible",
|
|
3872
4071
|
className
|
|
3873
4072
|
);
|
|
3874
|
-
const alertClasses = ClassNames(
|
|
3875
|
-
"usa-alert",
|
|
3876
|
-
`usa-alert--${alertVariant}`,
|
|
3877
|
-
"usx-alert",
|
|
3878
|
-
`usx-alert--${alertVariant}`,
|
|
3879
|
-
slim && "usa-alert--slim",
|
|
3880
|
-
slim && "usx-alert--slim",
|
|
3881
|
-
noIcon && "usa-alert--no-icon",
|
|
3882
|
-
noIcon && "usx-alert--no-icon"
|
|
3883
|
-
);
|
|
3884
4073
|
return /* @__PURE__ */ jsx(
|
|
3885
4074
|
"section",
|
|
3886
4075
|
{
|
|
@@ -3889,19 +4078,7 @@ const SiteAlert = ({
|
|
|
3889
4078
|
"aria-label": ariaLabelledby ? void 0 : ariaLabel,
|
|
3890
4079
|
"aria-labelledby": ariaLabelledby,
|
|
3891
4080
|
...props2,
|
|
3892
|
-
children:
|
|
3893
|
-
alertHeading && /* @__PURE__ */ jsx("h4", { className: "usa-alert__heading usx-alert__heading", children: alertHeading }),
|
|
3894
|
-
alertContent,
|
|
3895
|
-
onDismiss && /* @__PURE__ */ jsx(
|
|
3896
|
-
"button",
|
|
3897
|
-
{
|
|
3898
|
-
className: "usx-alert__dismiss",
|
|
3899
|
-
"aria-label": "Close alert",
|
|
3900
|
-
onClick: onDismiss,
|
|
3901
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 3, "aria-hidden": "true", focusable: "false" })
|
|
3902
|
-
}
|
|
3903
|
-
)
|
|
3904
|
-
] }) }) : /* @__PURE__ */ jsx(
|
|
4081
|
+
children: /* @__PURE__ */ jsx(
|
|
3905
4082
|
Alert,
|
|
3906
4083
|
{
|
|
3907
4084
|
heading: alertHeading,
|
|
@@ -3909,7 +4086,8 @@ const SiteAlert = ({
|
|
|
3909
4086
|
variant: alertVariant,
|
|
3910
4087
|
slim,
|
|
3911
4088
|
noIcon,
|
|
3912
|
-
onDismiss
|
|
4089
|
+
onDismiss,
|
|
4090
|
+
children: alertContent
|
|
3913
4091
|
}
|
|
3914
4092
|
)
|
|
3915
4093
|
}
|
|
@@ -3958,7 +4136,7 @@ const StepIndicator = ({
|
|
|
3958
4136
|
steps = [],
|
|
3959
4137
|
currentStep = 1,
|
|
3960
4138
|
variant = "",
|
|
3961
|
-
|
|
4139
|
+
headingAs: Heading = "h4",
|
|
3962
4140
|
className = "",
|
|
3963
4141
|
...props2
|
|
3964
4142
|
}) => {
|
|
@@ -3998,7 +4176,7 @@ const StepIndicator = ({
|
|
|
3998
4176
|
index
|
|
3999
4177
|
);
|
|
4000
4178
|
}) }),
|
|
4001
|
-
/* @__PURE__ */ jsx("div", { className: "usa-step-indicator__header", children: /* @__PURE__ */ jsxs(
|
|
4179
|
+
/* @__PURE__ */ jsx("div", { className: "usa-step-indicator__header", children: /* @__PURE__ */ jsxs(Heading, { className: "usa-step-indicator__heading", children: [
|
|
4002
4180
|
/* @__PURE__ */ jsxs("span", { className: "usa-step-indicator__heading-counter", children: [
|
|
4003
4181
|
/* @__PURE__ */ jsx("span", { className: "usa-sr-only", children: "Step" }),
|
|
4004
4182
|
" ",
|
|
@@ -4393,18 +4571,22 @@ function DataRow({ row, rowIndex }) {
|
|
|
4393
4571
|
selected ? "checked" : "unchecked"
|
|
4394
4572
|
) }, "__selection__");
|
|
4395
4573
|
const detailToggleCell = hasRowDetails ? /* @__PURE__ */ jsx("td", { className: "usx-table__cell usx-table__cell--detail-toggle", onClick: handleToggleDetail, children: /* @__PURE__ */ jsx(
|
|
4396
|
-
|
|
4574
|
+
Button,
|
|
4397
4575
|
{
|
|
4398
|
-
|
|
4576
|
+
variant: "inverse",
|
|
4577
|
+
ghost: true,
|
|
4399
4578
|
className: ClassNames(
|
|
4400
|
-
"
|
|
4401
|
-
"usx-table__detail-toggle",
|
|
4402
|
-
"width-full",
|
|
4403
|
-
isExpanded && "usx-table__detail-toggle--expanded"
|
|
4579
|
+
"usx-table__detail-toggle"
|
|
4404
4580
|
),
|
|
4405
4581
|
"aria-expanded": isExpanded,
|
|
4406
4582
|
"aria-label": expandLabel ? typeof expandLabel === "function" ? expandLabel(row) : expandLabel : `${isExpanded ? "Collapse" : "Expand"} row details`,
|
|
4407
|
-
|
|
4583
|
+
iconProps: [
|
|
4584
|
+
{
|
|
4585
|
+
name: isExpanded ? "expand_less" : "expand_more",
|
|
4586
|
+
"aria-hidden": "true",
|
|
4587
|
+
size: 3
|
|
4588
|
+
}
|
|
4589
|
+
]
|
|
4408
4590
|
}
|
|
4409
4591
|
) }, "__detail-toggle__") : null;
|
|
4410
4592
|
const dataCells = visibleCols.map((col) => {
|
|
@@ -4857,25 +5039,44 @@ function Table({
|
|
|
4857
5039
|
return /* @__PURE__ */ jsxs(TableContext.Provider, { value: contextValue, children: [
|
|
4858
5040
|
wrapped,
|
|
4859
5041
|
isPaginated && /* @__PURE__ */ jsx(
|
|
4860
|
-
|
|
5042
|
+
"div",
|
|
4861
5043
|
{
|
|
4862
|
-
|
|
4863
|
-
initialPageSize: pageSize,
|
|
4864
|
-
totalItems,
|
|
4865
|
-
onPageChange: (page) => {
|
|
5044
|
+
onClick: (event) => {
|
|
4866
5045
|
var _a;
|
|
5046
|
+
const link = event.target.closest("[data-usx-pagination-page]");
|
|
5047
|
+
if (!link || link.getAttribute("aria-disabled") === "true") return;
|
|
5048
|
+
event.preventDefault();
|
|
5049
|
+
const page = Number(link.dataset.usxPaginationPage);
|
|
5050
|
+
if (!Number.isInteger(page) || page < 1 || page === currentPage) return;
|
|
4867
5051
|
setCurrentPage(page);
|
|
4868
5052
|
if (isServerSide) (_a = paginateConfig.onPageChange) == null ? void 0 : _a.call(paginateConfig, page, pageSize);
|
|
4869
5053
|
},
|
|
4870
|
-
|
|
5054
|
+
onChange: (event) => {
|
|
5055
|
+
var _a;
|
|
5056
|
+
const target = event.target;
|
|
5057
|
+
if (!(target instanceof HTMLSelectElement)) return;
|
|
5058
|
+
const select = target;
|
|
5059
|
+
if (!select.matches(".usx-pagination__step-options select")) return;
|
|
5060
|
+
const size = Number(select.value);
|
|
5061
|
+
if (!Number.isInteger(size) || size < 1) return;
|
|
5062
|
+
const page = Math.min(currentPage, Math.max(1, Math.ceil(totalItems / size)));
|
|
4871
5063
|
setPageSize(size);
|
|
4872
5064
|
setCurrentPage(page);
|
|
5065
|
+
if (isServerSide) (_a = paginateConfig.onPageChange) == null ? void 0 : _a.call(paginateConfig, page, size);
|
|
4873
5066
|
},
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
5067
|
+
children: /* @__PURE__ */ jsx(
|
|
5068
|
+
Pagination,
|
|
5069
|
+
{
|
|
5070
|
+
currentPage,
|
|
5071
|
+
pageSize,
|
|
5072
|
+
totalItems,
|
|
5073
|
+
...paginateConfig.pageSizeOptions ? { pageSizeOptions: paginateConfig.pageSizeOptions } : {},
|
|
5074
|
+
...paginateConfig.showStepOptions !== void 0 ? { showStepOptions: paginateConfig.showStepOptions } : {},
|
|
5075
|
+
...paginateConfig.showSummary !== void 0 ? { showSummary: paginateConfig.showSummary } : {}
|
|
5076
|
+
},
|
|
5077
|
+
`${sortState.key}-${sortState.direction}`
|
|
5078
|
+
)
|
|
5079
|
+
}
|
|
4879
5080
|
)
|
|
4880
5081
|
] });
|
|
4881
5082
|
}
|
|
@@ -4923,60 +5124,62 @@ function ThemePicker({
|
|
|
4923
5124
|
className = ""
|
|
4924
5125
|
}) {
|
|
4925
5126
|
var _a;
|
|
4926
|
-
const
|
|
4927
|
-
const
|
|
4928
|
-
|
|
4929
|
-
const handleChange = (e) => {
|
|
4930
|
-
const next = e.target.value;
|
|
4931
|
-
if (value === void 0) {
|
|
4932
|
-
setActiveTheme(next);
|
|
4933
|
-
}
|
|
4934
|
-
onChange == null ? void 0 : onChange(next);
|
|
4935
|
-
};
|
|
4936
|
-
const selectId = id || `theme-picker-${Math.random().toString(36).substr(2, 9)}`;
|
|
4937
|
-
const classes = ClassNames("usx-theme-picker", { "usx-theme-picker--open": open }, className);
|
|
4938
|
-
const themeOptions = themes.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: option.label }, option.value));
|
|
4939
|
-
return /* @__PURE__ */ jsx("div", { className: classes, children: open ? /* @__PURE__ */ jsxs("div", { className: "usx-theme-picker__panel", children: [
|
|
4940
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: selectId, screenReaderOnly: true, children: label }),
|
|
4941
|
-
/* @__PURE__ */ jsx(
|
|
4942
|
-
"select",
|
|
4943
|
-
{
|
|
4944
|
-
id: selectId,
|
|
4945
|
-
name,
|
|
4946
|
-
className: "usa-select usx-select",
|
|
4947
|
-
value: currentValue,
|
|
4948
|
-
onChange: handleChange,
|
|
4949
|
-
children: themeOptions
|
|
4950
|
-
}
|
|
4951
|
-
),
|
|
5127
|
+
const selectId = id || "theme-picker";
|
|
5128
|
+
const selection = value !== void 0 ? { value } : { defaultValue: defaultValue ?? ((_a = themes[0]) == null ? void 0 : _a.value) };
|
|
5129
|
+
return /* @__PURE__ */ jsxs("div", { className: ClassNames("usx-theme-picker", className), children: [
|
|
4952
5130
|
/* @__PURE__ */ jsx(
|
|
4953
5131
|
"button",
|
|
4954
5132
|
{
|
|
4955
5133
|
type: "button",
|
|
4956
|
-
className: "usa-button usx-button
|
|
4957
|
-
"aria-label":
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
{
|
|
4962
|
-
name: "close"
|
|
4963
|
-
}
|
|
4964
|
-
)
|
|
5134
|
+
className: "usa-button usx-button usx-button--ghost usx-theme-picker__trigger",
|
|
5135
|
+
"aria-label": label,
|
|
5136
|
+
"aria-expanded": "false",
|
|
5137
|
+
"aria-controls": `${selectId}-panel`,
|
|
5138
|
+
children: /* @__PURE__ */ jsx(PaletteIcon, {})
|
|
4965
5139
|
}
|
|
4966
|
-
)
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
5140
|
+
),
|
|
5141
|
+
/* @__PURE__ */ jsxs("div", { id: `${selectId}-panel`, className: "usx-theme-picker__panel", children: [
|
|
5142
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: selectId, screenReaderOnly: true, children: label }),
|
|
5143
|
+
/* @__PURE__ */ jsx(
|
|
5144
|
+
"select",
|
|
5145
|
+
{
|
|
5146
|
+
id: selectId,
|
|
5147
|
+
name,
|
|
5148
|
+
className: "usa-select usx-select",
|
|
5149
|
+
...selection,
|
|
5150
|
+
onChange: (event) => onChange == null ? void 0 : onChange(event.target.value),
|
|
5151
|
+
children: themes.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: option.label }, option.value))
|
|
5152
|
+
}
|
|
5153
|
+
),
|
|
5154
|
+
/* @__PURE__ */ jsx(
|
|
5155
|
+
"button",
|
|
5156
|
+
{
|
|
5157
|
+
type: "button",
|
|
5158
|
+
className: "usa-button usx-button usa-button--primary usx-theme-picker__toggle",
|
|
5159
|
+
"aria-label": "Confirm theme",
|
|
5160
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "close", className: "usx-theme-picker__icon" })
|
|
5161
|
+
}
|
|
5162
|
+
)
|
|
5163
|
+
] })
|
|
5164
|
+
] });
|
|
4977
5165
|
}
|
|
4978
5166
|
function PaletteIcon() {
|
|
4979
|
-
return /* @__PURE__ */ jsx(
|
|
5167
|
+
return /* @__PURE__ */ jsx(
|
|
5168
|
+
"svg",
|
|
5169
|
+
{
|
|
5170
|
+
className: "usa-icon usx-theme-picker__icon",
|
|
5171
|
+
"aria-hidden": "true",
|
|
5172
|
+
focusable: "false",
|
|
5173
|
+
viewBox: "0 0 24 24",
|
|
5174
|
+
children: /* @__PURE__ */ jsx(
|
|
5175
|
+
"path",
|
|
5176
|
+
{
|
|
5177
|
+
fill: "currentColor",
|
|
5178
|
+
d: "M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12zm3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"
|
|
5179
|
+
}
|
|
5180
|
+
)
|
|
5181
|
+
}
|
|
5182
|
+
);
|
|
4980
5183
|
}
|
|
4981
5184
|
function TimePicker({
|
|
4982
5185
|
id = "appointment-time",
|
|
@@ -4999,6 +5202,17 @@ function TimePicker({
|
|
|
4999
5202
|
const hintId = hint ? `${id}-hint` : void 0;
|
|
5000
5203
|
const errorId = error ? `${id}-error` : void 0;
|
|
5001
5204
|
const describedBy = [label ? labelId : void 0, hintId, errorId].filter(Boolean).join(" ") || void 0;
|
|
5205
|
+
const containerClasses = ClassNames(
|
|
5206
|
+
"usa-time-picker",
|
|
5207
|
+
"usx-time-picker",
|
|
5208
|
+
{ "usx-combo-box--error": !!error },
|
|
5209
|
+
className
|
|
5210
|
+
);
|
|
5211
|
+
const inputClasses = ClassNames(
|
|
5212
|
+
"usa-input",
|
|
5213
|
+
"usx-input",
|
|
5214
|
+
{ "usa-input--error": !!error }
|
|
5215
|
+
);
|
|
5002
5216
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5003
5217
|
label && /* @__PURE__ */ jsx(Label, { id: labelId, htmlFor: id, required, error: !!error, children: label }),
|
|
5004
5218
|
hint && /* @__PURE__ */ jsx(Hint, { id: hintId, children: hint }),
|
|
@@ -5006,19 +5220,14 @@ function TimePicker({
|
|
|
5006
5220
|
/* @__PURE__ */ jsx(
|
|
5007
5221
|
"div",
|
|
5008
5222
|
{
|
|
5009
|
-
className:
|
|
5010
|
-
"usa-time-picker",
|
|
5011
|
-
"usx-time-picker",
|
|
5012
|
-
{ "usx-combo-box--error": !!error },
|
|
5013
|
-
className
|
|
5014
|
-
),
|
|
5223
|
+
className: containerClasses,
|
|
5015
5224
|
...minTime ? { "data-min-time": minTime } : {},
|
|
5016
5225
|
...maxTime ? { "data-max-time": maxTime } : {},
|
|
5017
5226
|
...step ? { "data-step": step } : {},
|
|
5018
5227
|
children: /* @__PURE__ */ jsx(
|
|
5019
5228
|
"input",
|
|
5020
5229
|
{
|
|
5021
|
-
className:
|
|
5230
|
+
className: inputClasses,
|
|
5022
5231
|
id,
|
|
5023
5232
|
name: name || id,
|
|
5024
5233
|
type: "text",
|
|
@@ -5112,6 +5321,36 @@ function Toggle({
|
|
|
5112
5321
|
}
|
|
5113
5322
|
);
|
|
5114
5323
|
}
|
|
5324
|
+
function Tree({ items, variant = "default", className, ...props2 }) {
|
|
5325
|
+
const treeClassNames = ClassNames(
|
|
5326
|
+
"usx-tree",
|
|
5327
|
+
{ [`usx-tree--${variant}`]: variant !== "default" },
|
|
5328
|
+
className
|
|
5329
|
+
);
|
|
5330
|
+
return /* @__PURE__ */ jsx("ul", { ...props2, className: treeClassNames, children: items.map((item, index) => {
|
|
5331
|
+
switch (item.type) {
|
|
5332
|
+
case "link": {
|
|
5333
|
+
const { type, ...linkProps } = item;
|
|
5334
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { ...linkProps }) }, index);
|
|
5335
|
+
}
|
|
5336
|
+
case "details": {
|
|
5337
|
+
const { type, items: nestedItems, className: detailsClassName, ...detailsProps } = item;
|
|
5338
|
+
return /* @__PURE__ */ jsx("li", { children: nestedItems ? /* @__PURE__ */ jsx(
|
|
5339
|
+
Details,
|
|
5340
|
+
{
|
|
5341
|
+
...detailsProps,
|
|
5342
|
+
className: ClassNames("usx-tree__branch", detailsClassName),
|
|
5343
|
+
children: /* @__PURE__ */ jsx(Tree, { items: nestedItems, variant })
|
|
5344
|
+
}
|
|
5345
|
+
) : /* @__PURE__ */ jsx(Details, { ...detailsProps, className: detailsClassName }) }, index);
|
|
5346
|
+
}
|
|
5347
|
+
case "text":
|
|
5348
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("span", { className: "usx-tree__label", children: item.text }) }, index);
|
|
5349
|
+
default:
|
|
5350
|
+
return null;
|
|
5351
|
+
}
|
|
5352
|
+
}) });
|
|
5353
|
+
}
|
|
5115
5354
|
const Villain = ({
|
|
5116
5355
|
title = "",
|
|
5117
5356
|
callout = "",
|
|
@@ -5159,6 +5398,7 @@ export {
|
|
|
5159
5398
|
DatePicker,
|
|
5160
5399
|
DateRangePicker,
|
|
5161
5400
|
Details,
|
|
5401
|
+
Drawer,
|
|
5162
5402
|
ErrorMessage,
|
|
5163
5403
|
ErrorPage,
|
|
5164
5404
|
Eyebrow,
|
|
@@ -5188,6 +5428,7 @@ export {
|
|
|
5188
5428
|
Modal,
|
|
5189
5429
|
Page,
|
|
5190
5430
|
Pagination,
|
|
5431
|
+
Popover,
|
|
5191
5432
|
ProcessList,
|
|
5192
5433
|
Prose,
|
|
5193
5434
|
Quote,
|
|
@@ -5203,6 +5444,7 @@ export {
|
|
|
5203
5444
|
Spinner,
|
|
5204
5445
|
Status,
|
|
5205
5446
|
StepIndicator,
|
|
5447
|
+
Summary,
|
|
5206
5448
|
SummaryBox,
|
|
5207
5449
|
Swap,
|
|
5208
5450
|
Switch,
|
|
@@ -5215,5 +5457,6 @@ export {
|
|
|
5215
5457
|
TimePicker,
|
|
5216
5458
|
Toggle,
|
|
5217
5459
|
Tooltip,
|
|
5460
|
+
Tree,
|
|
5218
5461
|
Villain
|
|
5219
5462
|
};
|