@solexllc/usx-react 0.1.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 +45 -0
- package/dist/index.cjs +6017 -0
- package/dist/index.js +6015 -0
- package/package.json +48 -0
- package/src/components/accordion/Accordion.jsx +170 -0
- package/src/components/accordion/accordion.django.html +47 -0
- package/src/components/accordion/accordion.html +304 -0
- package/src/components/accordion/config.json +31 -0
- package/src/components/alert/Alert.tsx +88 -0
- package/src/components/alert/alert.django.html +45 -0
- package/src/components/alert/alert.html +192 -0
- package/src/components/alert/config.json +70 -0
- package/src/components/attribution/Attribution.tsx +40 -0
- package/src/components/attribution/attribution.django.html +21 -0
- package/src/components/attribution/attribution.html +26 -0
- package/src/components/attribution/config.json +32 -0
- package/src/components/avatar/Avatar.tsx +85 -0
- package/src/components/avatar/avatar.django.html +27 -0
- package/src/components/avatar/avatar.html +101 -0
- package/src/components/avatar/config.json +59 -0
- package/src/components/avatar-group/AvatarGroup.tsx +43 -0
- package/src/components/avatar-group/avatar-group.django.html +8 -0
- package/src/components/avatar-group/avatar-group.html +208 -0
- package/src/components/avatar-group/config.json +60 -0
- package/src/components/back-to-top/BackToTop.tsx +60 -0
- package/src/components/back-to-top/back-to-top.django.html +38 -0
- package/src/components/back-to-top/back-to-top.html +107 -0
- package/src/components/back-to-top/config.json +44 -0
- package/src/components/banner/Banner.tsx +111 -0
- package/src/components/banner/banner.django.html +80 -0
- package/src/components/banner/banner.html +411 -0
- package/src/components/banner/config.json +47 -0
- package/src/components/block/Block.tsx +78 -0
- package/src/components/block/block.django.html +26 -0
- package/src/components/block/block.html +162 -0
- package/src/components/block/config.json +88 -0
- package/src/components/breadcrumb/Breadcrumb.tsx +83 -0
- package/src/components/breadcrumb/breadcrumb.django.html +24 -0
- package/src/components/breadcrumb/breadcrumb.html +108 -0
- package/src/components/breadcrumb/config.json +74 -0
- package/src/components/button/Button.tsx +121 -0
- package/src/components/button/button.django.html +58 -0
- package/src/components/button/button.html +363 -0
- package/src/components/button/config.json +103 -0
- package/src/components/button-group/ButtonGroup.tsx +33 -0
- package/src/components/button-group/button-group.django.html +9 -0
- package/src/components/button-group/button-group.html +159 -0
- package/src/components/button-group/config.json +25 -0
- package/src/components/calendar-date/CalendarDate.tsx +40 -0
- package/src/components/calendar-date/calendar-date.django.html +8 -0
- package/src/components/calendar-date/calendar-date.html +17 -0
- package/src/components/calendar-date/config.json +17 -0
- package/src/components/card/Card.tsx +137 -0
- package/src/components/card/card.django.html +40 -0
- package/src/components/card/card.html +67 -0
- package/src/components/card/config.json +115 -0
- package/src/components/card-group/CardGroup.tsx +23 -0
- package/src/components/card-group/card-group.django.html +6 -0
- package/src/components/card-group/card-group.html +164 -0
- package/src/components/card-group/config.json +21 -0
- package/src/components/carousel/Carousel.tsx +101 -0
- package/src/components/carousel/carousel.django.html +41 -0
- package/src/components/carousel/carousel.html +64 -0
- package/src/components/carousel/config.json +38 -0
- package/src/components/character-count/CharacterCount.tsx +77 -0
- package/src/components/character-count/character-count.django.html +19 -0
- package/src/components/character-count/character-count.html +110 -0
- package/src/components/character-count/config.json +78 -0
- package/src/components/checkbox/Checkbox.tsx +90 -0
- package/src/components/checkbox/checkbox.django.html +16 -0
- package/src/components/checkbox/checkbox.html +266 -0
- package/src/components/checkbox/config.json +71 -0
- package/src/components/checkbox-group/CheckboxGroup.tsx +67 -0
- package/src/components/checkbox-group/checkbox-group.django.html +12 -0
- package/src/components/checkbox-group/checkbox-group.html +36 -0
- package/src/components/checkbox-group/config.json +50 -0
- package/src/components/clickable/Clickable.tsx +78 -0
- package/src/components/clickable/clickable.django.html +5 -0
- package/src/components/clickable/clickable.html +133 -0
- package/src/components/clickable/config.json +26 -0
- package/src/components/code/Code.tsx +60 -0
- package/src/components/code/code.django.html +21 -0
- package/src/components/code/code.html +71 -0
- package/src/components/code/config.json +40 -0
- package/src/components/collection/Collection.tsx +99 -0
- package/src/components/collection/collection.django.html +48 -0
- package/src/components/collection/collection.html +384 -0
- package/src/components/collection/config.json +60 -0
- package/src/components/combobox/Combobox.tsx +114 -0
- package/src/components/combobox/combobox.django.html +61 -0
- package/src/components/combobox/combobox.html +509 -0
- package/src/components/combobox/config.json +80 -0
- package/src/components/copy-to-clipboard/CopyToClipboard.tsx +48 -0
- package/src/components/copy-to-clipboard/config.json +30 -0
- package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +16 -0
- package/src/components/copy-to-clipboard/copy-to-clipboard.html +68 -0
- package/src/components/date-picker/DatePicker.jsx +83 -0
- package/src/components/date-picker/config.json +71 -0
- package/src/components/date-picker/date-picker.django.html +67 -0
- package/src/components/date-picker/date-picker.html +104 -0
- package/src/components/date-range-picker/DateRangePicker.jsx +113 -0
- package/src/components/date-range-picker/config.json +92 -0
- package/src/components/date-range-picker/date-range-picker.django.html +66 -0
- package/src/components/date-range-picker/date-range-picker.html +190 -0
- package/src/components/error-message/ErrorMessage.tsx +23 -0
- package/src/components/error-message/config.json +19 -0
- package/src/components/error-message/error-message.django.html +2 -0
- package/src/components/error-message/error-message.html +2 -0
- package/src/components/eyebrow/Eyebrow.tsx +15 -0
- package/src/components/eyebrow/config.json +15 -0
- package/src/components/eyebrow/eyebrow.django.html +4 -0
- package/src/components/eyebrow/eyebrow.html +4 -0
- package/src/components/fieldset/Fieldset.tsx +54 -0
- package/src/components/fieldset/config.json +47 -0
- package/src/components/fieldset/fieldset.django.html +22 -0
- package/src/components/fieldset/fieldset.html +17 -0
- package/src/components/file-input/FileInput.jsx +174 -0
- package/src/components/file-input/config.json +80 -0
- package/src/components/file-input/file-input.django.html +57 -0
- package/src/components/file-input/file-input.html +258 -0
- package/src/components/file-list/FileList.jsx +105 -0
- package/src/components/file-list/config.json +43 -0
- package/src/components/file-list/file-list.django.html +30 -0
- package/src/components/file-list/file-list.html +61 -0
- package/src/components/footer/Footer.tsx +365 -0
- package/src/components/footer/config.json +83 -0
- package/src/components/footer/footer.django.html +260 -0
- package/src/components/footer/footer.html +392 -0
- package/src/components/form-group/FormGroup.tsx +26 -0
- package/src/components/form-group/config.json +22 -0
- package/src/components/form-group/form-group.django.html +4 -0
- package/src/components/form-group/form-group.html +17 -0
- package/src/components/header/Branding.tsx +101 -0
- package/src/components/header/Header.tsx +229 -0
- package/src/components/header/HeaderBranding.jsx +4 -0
- package/src/components/header/config.json +58 -0
- package/src/components/header/header.django.html +194 -0
- package/src/components/header/header.html +823 -0
- package/src/components/hero/Hero.tsx +64 -0
- package/src/components/hero/config.json +70 -0
- package/src/components/hero/hero.django.html +22 -0
- package/src/components/hero/hero.html +75 -0
- package/src/components/hint/Hint.tsx +23 -0
- package/src/components/hint/config.json +19 -0
- package/src/components/hint/hint.django.html +2 -0
- package/src/components/hint/hint.html +2 -0
- package/src/components/icon/Icon.tsx +46 -0
- package/src/components/icon/config.json +60 -0
- package/src/components/icon/icon.django.html +26 -0
- package/src/components/icon/icon.html +289 -0
- package/src/components/icon/icons_list.json +247 -0
- package/src/components/icon-list/IconList.tsx +59 -0
- package/src/components/icon-list/config.json +86 -0
- package/src/components/icon-list/icon-list.django.html +17 -0
- package/src/components/icon-list/icon-list.html +227 -0
- package/src/components/identifier/Identifier.tsx +193 -0
- package/src/components/identifier/config.json +133 -0
- package/src/components/identifier/identifier.django.html +99 -0
- package/src/components/identifier/identifier.html +737 -0
- package/src/components/image/Image.tsx +106 -0
- package/src/components/image/config.json +64 -0
- package/src/components/image/image.django.html +62 -0
- package/src/components/image/image.html +53 -0
- package/src/components/in-page-nav/InPageNav.jsx +76 -0
- package/src/components/in-page-nav/config.json +69 -0
- package/src/components/in-page-nav/in-page-nav.django.html +28 -0
- package/src/components/in-page-nav/in-page-nav.html +183 -0
- package/src/components/indicator/Indicator.tsx +32 -0
- package/src/components/indicator/README.md +1 -0
- package/src/components/indicator/config.json +19 -0
- package/src/components/indicator/indicator.django.html +10 -0
- package/src/components/indicator/indicator.html +42 -0
- package/src/components/input/Input.tsx +85 -0
- package/src/components/input/config.json +73 -0
- package/src/components/input/input.django.html +55 -0
- package/src/components/input/input.html +59 -0
- package/src/components/label/Label.tsx +42 -0
- package/src/components/label/config.json +39 -0
- package/src/components/label/label.django.html +23 -0
- package/src/components/label/label.html +23 -0
- package/src/components/language-selector/LanguageSelector.jsx +224 -0
- package/src/components/language-selector/config.json +107 -0
- package/src/components/language-selector/language-selector.django.html +40 -0
- package/src/components/language-selector/language-selector.html +85 -0
- package/src/components/layout/Layout.tsx +131 -0
- package/src/components/layout/config.json +36 -0
- package/src/components/layout/layout.django.html +28 -0
- package/src/components/layout/layout.html +29 -0
- package/src/components/legend/Legend.tsx +34 -0
- package/src/components/legend/config.json +27 -0
- package/src/components/legend/legend.django.html +11 -0
- package/src/components/legend/legend.html +12 -0
- package/src/components/link/Link.tsx +45 -0
- package/src/components/link/config.json +39 -0
- package/src/components/link/link.django.html +8 -0
- package/src/components/link/link.html +47 -0
- package/src/components/list/List.tsx +82 -0
- package/src/components/list/_list-items.django.html +17 -0
- package/src/components/list/config.json +25 -0
- package/src/components/list/list.django.html +11 -0
- package/src/components/list/list.html +26 -0
- package/src/components/memorable-date/MemorableDate.jsx +167 -0
- package/src/components/memorable-date/config.json +104 -0
- package/src/components/memorable-date/memorable-date.django.html +86 -0
- package/src/components/memorable-date/memorable-date.html +275 -0
- package/src/components/misc-banner/MiscBanner.tsx +112 -0
- package/src/components/misc-banner/config.json +57 -0
- package/src/components/misc-banner/misc-banner.django.html +63 -0
- package/src/components/misc-banner/misc-banner.html +191 -0
- package/src/components/modal/Modal.tsx +71 -0
- package/src/components/modal/config.json +57 -0
- package/src/components/modal/modal.django.html +43 -0
- package/src/components/modal/modal.html +222 -0
- package/src/components/page/Page.jsx +34 -0
- package/src/components/page/config.json +34 -0
- package/src/components/page/page.django.html +5 -0
- package/src/components/page/page.html +23 -0
- package/src/components/pagination/Pagination.tsx +112 -0
- package/src/components/pagination/config.json +135 -0
- package/src/components/pagination/container/PaginationContainer.tsx +38 -0
- package/src/components/pagination/navigation/PaginationNavigation.tsx +219 -0
- package/src/components/pagination/navigation/pagination-navigation.django.html +64 -0
- package/src/components/pagination/pagination.django.html +48 -0
- package/src/components/pagination/pagination.html +613 -0
- package/src/components/pagination/step-options/PaginationStepOptions.tsx +43 -0
- package/src/components/pagination/step-options/pagination-step-options.django.html +7 -0
- package/src/components/pagination/summary/PaginationSummary.tsx +33 -0
- package/src/components/pagination/summary/pagination-summary.django.html +12 -0
- package/src/components/process-list/ProcessList.tsx +52 -0
- package/src/components/process-list/config.json +15 -0
- package/src/components/process-list/process-list.django.html +15 -0
- package/src/components/process-list/process-list.html +90 -0
- package/src/components/prose/Prose.tsx +32 -0
- package/src/components/prose/config.json +28 -0
- package/src/components/prose/prose.django.html +35 -0
- package/src/components/prose/prose.html +91 -0
- package/src/components/radio-buttons/RadioButtons.tsx +82 -0
- package/src/components/radio-buttons/config.json +57 -0
- package/src/components/radio-buttons/radio-buttons.django.html +28 -0
- package/src/components/radio-buttons/radio-buttons.html +189 -0
- package/src/components/range-slider/RangeSlider.jsx +84 -0
- package/src/components/range-slider/config.json +89 -0
- package/src/components/range-slider/range-slider.django.html +65 -0
- package/src/components/range-slider/range-slider.html +106 -0
- package/src/components/required/Required.tsx +25 -0
- package/src/components/required/config.json +20 -0
- package/src/components/required/required.django.html +2 -0
- package/src/components/required/required.html +6 -0
- package/src/components/search/Search.tsx +92 -0
- package/src/components/search/config.json +69 -0
- package/src/components/search/search.django.html +59 -0
- package/src/components/search/search.html +76 -0
- package/src/components/section/Section.tsx +28 -0
- package/src/components/section/config.json +27 -0
- package/src/components/section/section.django.html +5 -0
- package/src/components/section/section.html +16 -0
- package/src/components/select/Select.tsx +107 -0
- package/src/components/select/config.json +80 -0
- package/src/components/select/select.django.html +64 -0
- package/src/components/select/select.html +62 -0
- package/src/components/sidenav/SideNav.tsx +74 -0
- package/src/components/sidenav/config.json +45 -0
- package/src/components/sidenav/sidenav.django.html +29 -0
- package/src/components/sidenav/sidenav.html +84 -0
- package/src/components/site-alert/SiteAlert.tsx +101 -0
- package/src/components/site-alert/config.json +62 -0
- package/src/components/site-alert/site-alert.django.html +34 -0
- package/src/components/site-alert/site-alert.html +312 -0
- package/src/components/skipnav/Skipnav.tsx +41 -0
- package/src/components/skipnav/config.json +29 -0
- package/src/components/skipnav/skipnav.django.html +11 -0
- package/src/components/skipnav/skipnav.html +1 -0
- package/src/components/spinner/Spinner.tsx +46 -0
- package/src/components/spinner/config.json +44 -0
- package/src/components/spinner/spinner.django.html +8 -0
- package/src/components/spinner/spinner.html +219 -0
- package/src/components/status/Status.tsx +28 -0
- package/src/components/status/config.json +47 -0
- package/src/components/status/status.django.html +2 -0
- package/src/components/status/status.html +31 -0
- package/src/components/step-indicator/StepIndicator.tsx +80 -0
- package/src/components/step-indicator/config.json +54 -0
- package/src/components/step-indicator/step-indicator.django.html +29 -0
- package/src/components/step-indicator/step-indicator.html +243 -0
- package/src/components/summary-box/SummaryBox.tsx +41 -0
- package/src/components/summary-box/config.json +30 -0
- package/src/components/summary-box/summary-box.django.html +19 -0
- package/src/components/summary-box/summary-box.html +210 -0
- package/src/components/swap/Swap.tsx +47 -0
- package/src/components/swap/config.json +61 -0
- package/src/components/swap/swap.django.html +14 -0
- package/src/components/swap/swap.html +163 -0
- package/src/components/switch/Switch.tsx +73 -0
- package/src/components/switch/config.json +55 -0
- package/src/components/switch/switch.django.html +28 -0
- package/src/components/switch/switch.html +56 -0
- package/src/components/table/Table.tsx +334 -0
- package/src/components/table/TableBody.tsx +253 -0
- package/src/components/table/TableCell.tsx +37 -0
- package/src/components/table/TableContext.tsx +87 -0
- package/src/components/table/TableFoot.tsx +68 -0
- package/src/components/table/TableGroup.tsx +69 -0
- package/src/components/table/TableHead.tsx +139 -0
- package/src/components/table/TableRow.tsx +56 -0
- package/src/components/table/__pycache__/table_helper.cpython-312.pyc +0 -0
- package/src/components/table/config.json +297 -0
- package/src/components/table/hooks/useRowDetails.ts +34 -0
- package/src/components/table/hooks/useTableGroups.ts +61 -0
- package/src/components/table/hooks/useTableSelect.ts +82 -0
- package/src/components/table/hooks/useTableSort.ts +60 -0
- package/src/components/table/table-body.django.html +68 -0
- package/src/components/table/table-detail-row.django.html +14 -0
- package/src/components/table/table-foot.django.html +31 -0
- package/src/components/table/table-group.django.html +40 -0
- package/src/components/table/table-head.django.html +85 -0
- package/src/components/table/table-row.django.html +98 -0
- package/src/components/table/table.django.html +60 -0
- package/src/components/table/table.html +1186 -0
- package/src/components/table/table_helper.py +298 -0
- package/src/components/table/types.ts +68 -0
- package/src/components/tag/Tag.tsx +75 -0
- package/src/components/tag/config.json +54 -0
- package/src/components/tag/tag.django.html +39 -0
- package/src/components/tag/tag.html +45 -0
- package/src/components/tag-group/TagGroup.tsx +35 -0
- package/src/components/tag-group/config.json +24 -0
- package/src/components/tag-group/tag-group.django.html +11 -0
- package/src/components/tag-group/tag-group.html +36 -0
- package/src/components/task-list/TaskList.tsx +40 -0
- package/src/components/task-list/config.json +41 -0
- package/src/components/task-list/task-list.django.html +21 -0
- package/src/components/task-list/task-list.html +24 -0
- package/src/components/text-area/TextArea.tsx +78 -0
- package/src/components/text-area/config.json +78 -0
- package/src/components/text-area/text-area.django.html +53 -0
- package/src/components/text-area/text-area.html +59 -0
- package/src/components/theme-picker/ThemePicker.tsx +106 -0
- package/src/components/theme-picker/config.json +39 -0
- package/src/components/theme-picker/theme-picker.django.html +32 -0
- package/src/components/theme-picker/theme-picker.html +67 -0
- package/src/components/time-picker/TimePicker.jsx +87 -0
- package/src/components/time-picker/config.json +76 -0
- package/src/components/time-picker/time-picker.django.html +67 -0
- package/src/components/time-picker/time-picker.html +123 -0
- package/src/components/toggle/Toggle.tsx +80 -0
- package/src/components/toggle/config.json +69 -0
- package/src/components/toggle/toggle.django.html +19 -0
- package/src/components/toggle/toggle.html +85 -0
- package/src/components/tooltip/Tooltip.tsx +33 -0
- package/src/components/tooltip/config.json +33 -0
- package/src/components/tooltip/tooltip.django.html +5 -0
- package/src/components/tooltip/tooltip.html +57 -0
- package/src/components/villain/Villain.tsx +47 -0
- package/src/components/villain/config.json +44 -0
- package/src/components/villain/villain.django.html +19 -0
- package/src/components/villain/villain.html +39 -0
- package/src/declarations.d.ts +1 -0
- package/src/index.js +82 -0
- package/src/styles/core.scss +12 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{% load components %}
|
|
2
|
+
{# Django template for ButtonGroup #}
|
|
3
|
+
<ul class="usa-button-group usx-button-group {% if segmented %}usa-button-group--segmented{% endif %} {{ className }}">
|
|
4
|
+
{% for item in buttonProps %}
|
|
5
|
+
<li class="usa-button-group__item">
|
|
6
|
+
{% button label=item.label variant=item.variant type=item.type disabled=item.disabled onClick=item.onClick href=item.href isExternal=item.isExternal big=item.big inverse=item.inverse loading=item.loading iconProps=item.iconProps className=item.className style=item.style extraAttributes=item.extraAttributes %}{{ item.children }}{% endbutton %}
|
|
7
|
+
</li>
|
|
8
|
+
{% endfor %}
|
|
9
|
+
</ul>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">Basic Button Group</h3>
|
|
2
|
+
|
|
3
|
+
<ul class="usa-button-group usx-button-group">
|
|
4
|
+
<li class="usa-button-group__item">
|
|
5
|
+
<a href="#" class="usa-button usx-button usa-button--outline">Back</a>
|
|
6
|
+
</li>
|
|
7
|
+
<li class="usa-button-group__item">
|
|
8
|
+
<button type="button" class="usa-button usx-button usa-button--primary">Continue</button>
|
|
9
|
+
</li>
|
|
10
|
+
</ul>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<h3 class="site-preview-heading">Segmented Button Groups Variations</h3>
|
|
14
|
+
|
|
15
|
+
<ul class="usa-button-group usx-button-group usa-button-group--segmented">
|
|
16
|
+
<li class="usa-button-group__item">
|
|
17
|
+
<a href="#" class="usa-button usx-button usa-button--outline">Back</a>
|
|
18
|
+
</li>
|
|
19
|
+
<li class="usa-button-group__item">
|
|
20
|
+
<button type="button" class="usa-button usx-button usa-button--primary">Continue</button>
|
|
21
|
+
</li>
|
|
22
|
+
</ul>
|
|
23
|
+
|
|
24
|
+
<ul class="usa-button-group usx-button-group usa-button-group--segmented">
|
|
25
|
+
<li class="usa-button-group__item">
|
|
26
|
+
<button type="button" class="usa-button usx-button usa-button--primary">Map</button>
|
|
27
|
+
</li>
|
|
28
|
+
<li class="usa-button-group__item">
|
|
29
|
+
<button type="button" class="usa-button usx-button usa-button--outline">Hybrid</button>
|
|
30
|
+
</li>
|
|
31
|
+
<li class="usa-button-group__item">
|
|
32
|
+
<button type="button" class="usa-button usx-button usa-button--outline">
|
|
33
|
+
Satellite
|
|
34
|
+
</button>
|
|
35
|
+
</li>
|
|
36
|
+
</ul>
|
|
37
|
+
<ul class="usa-button-group usx-button-group usa-button-group--segmented">
|
|
38
|
+
<li class="usa-button-group__item">
|
|
39
|
+
<button type="button" class="usa-button usx-button usa-button--primary">Map</button>
|
|
40
|
+
</li>
|
|
41
|
+
<li class="usa-button-group__item">
|
|
42
|
+
<button type="button" class="usa-button usx-button usa-button--primary">Hybrid</button>
|
|
43
|
+
</li>
|
|
44
|
+
<li class="usa-button-group__item">
|
|
45
|
+
<button type="button" class="usa-button usx-button usa-button--primary">Satellite</button>
|
|
46
|
+
</li>
|
|
47
|
+
</ul>
|
|
48
|
+
<ul class="usa-button-group usx-button-group usa-button-group--segmented">
|
|
49
|
+
<li class="usa-button-group__item">
|
|
50
|
+
<button type="button" class="usa-button usx-button usa-button--accent-cool">
|
|
51
|
+
Map
|
|
52
|
+
</button>
|
|
53
|
+
</li>
|
|
54
|
+
<li class="usa-button-group__item">
|
|
55
|
+
<button type="button" class="usa-button usx-button usa-button--accent-cool">
|
|
56
|
+
Hybrid
|
|
57
|
+
</button>
|
|
58
|
+
</li>
|
|
59
|
+
<li class="usa-button-group__item">
|
|
60
|
+
<button type="button" class="usa-button usx-button usa-button--accent-cool">
|
|
61
|
+
Satellite
|
|
62
|
+
</button>
|
|
63
|
+
</li>
|
|
64
|
+
</ul>
|
|
65
|
+
<ul class="usa-button-group usx-button-group usa-button-group--segmented">
|
|
66
|
+
<li class="usa-button-group__item">
|
|
67
|
+
<button type="button" class="usa-button usx-button usa-button--accent-warm">
|
|
68
|
+
Map
|
|
69
|
+
</button>
|
|
70
|
+
</li>
|
|
71
|
+
<li class="usa-button-group__item">
|
|
72
|
+
<button type="button" class="usa-button usx-button usa-button--accent-warm">
|
|
73
|
+
Hybrid
|
|
74
|
+
</button>
|
|
75
|
+
</li>
|
|
76
|
+
<li class="usa-button-group__item">
|
|
77
|
+
<button type="button" class="usa-button usx-button usa-button--accent-warm">
|
|
78
|
+
Satellite
|
|
79
|
+
</button>
|
|
80
|
+
</li>
|
|
81
|
+
</ul>
|
|
82
|
+
<ul class="usa-button-group usx-button-group usa-button-group--segmented">
|
|
83
|
+
<li class="usa-button-group__item">
|
|
84
|
+
<button type="button" class="usa-button usx-button usa-button--base">Map</button>
|
|
85
|
+
</li>
|
|
86
|
+
<li class="usa-button-group__item">
|
|
87
|
+
<button type="button" class="usa-button usx-button usa-button--base">Hybrid</button>
|
|
88
|
+
</li>
|
|
89
|
+
<li class="usa-button-group__item">
|
|
90
|
+
<button type="button" class="usa-button usx-button usa-button--base">Satellite</button>
|
|
91
|
+
</li>
|
|
92
|
+
</ul>
|
|
93
|
+
<ul class="usa-button-group usx-button-group usa-button-group--segmented">
|
|
94
|
+
<li class="usa-button-group__item">
|
|
95
|
+
<button type="button" class="usa-button usx-button usa-button--primary usa-button--big">Map</button>
|
|
96
|
+
</li>
|
|
97
|
+
<li class="usa-button-group__item">
|
|
98
|
+
<button type="button" class="usa-button usx-button usa-button--primary usa-button--big">Hybrid</button>
|
|
99
|
+
</li>
|
|
100
|
+
<li class="usa-button-group__item">
|
|
101
|
+
<button type="button" class="usa-button usx-button usa-button--primary usa-button--big">Satellite</button>
|
|
102
|
+
</li>
|
|
103
|
+
</ul>
|
|
104
|
+
<ul class="usa-button-group usx-button-group usa-button-group--segmented">
|
|
105
|
+
<li class="usa-button-group__item">
|
|
106
|
+
<button type="button" class="usa-button usx-button usa-button--outline">Map</button>
|
|
107
|
+
</li>
|
|
108
|
+
<li class="usa-button-group__item">
|
|
109
|
+
<button type="button" class="usa-button usx-button usa-button--outline">Hybrid</button>
|
|
110
|
+
</li>
|
|
111
|
+
<li class="usa-button-group__item">
|
|
112
|
+
<button type="button" class="usa-button usx-button usa-button--outline">
|
|
113
|
+
Satellite
|
|
114
|
+
</button>
|
|
115
|
+
</li>
|
|
116
|
+
</ul>
|
|
117
|
+
<div class="bg-base-darkest padding-1" style="max-width: fit-content">
|
|
118
|
+
<ul class="usa-button-group usx-button-group usa-button-group--segmented">
|
|
119
|
+
<li class="usa-button-group__item">
|
|
120
|
+
<button
|
|
121
|
+
type="button"
|
|
122
|
+
class="usa-button usx-button usa-button--outline usa-button--inverse"
|
|
123
|
+
>
|
|
124
|
+
Map
|
|
125
|
+
</button>
|
|
126
|
+
</li>
|
|
127
|
+
<li class="usa-button-group__item">
|
|
128
|
+
<button
|
|
129
|
+
type="button"
|
|
130
|
+
class="usa-button usx-button usa-button--outline usa-button--inverse"
|
|
131
|
+
>
|
|
132
|
+
Hybrid
|
|
133
|
+
</button>
|
|
134
|
+
</li>
|
|
135
|
+
<li class="usa-button-group__item">
|
|
136
|
+
<button
|
|
137
|
+
type="button"
|
|
138
|
+
class="usa-button usx-button usa-button--outline usa-button--inverse"
|
|
139
|
+
>
|
|
140
|
+
Satellite
|
|
141
|
+
</button>
|
|
142
|
+
</li>
|
|
143
|
+
</ul>
|
|
144
|
+
</div>
|
|
145
|
+
<ul class="usa-button-group usx-button-group usa-button-group--segmented">
|
|
146
|
+
<li class="usa-button-group__item">
|
|
147
|
+
<button type="button" class="usa-button usx-button usa-button--secondary">Map</button>
|
|
148
|
+
</li>
|
|
149
|
+
<li class="usa-button-group__item">
|
|
150
|
+
<button type="button" class="usa-button usx-button usa-button--secondary">
|
|
151
|
+
Hybrid
|
|
152
|
+
</button>
|
|
153
|
+
</li>
|
|
154
|
+
<li class="usa-button-group__item">
|
|
155
|
+
<button type="button" class="usa-button usx-button usa-button--secondary">
|
|
156
|
+
Satellite
|
|
157
|
+
</button>
|
|
158
|
+
</li>
|
|
159
|
+
</ul>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "button-group",
|
|
3
|
+
"template": "button-group/button-group.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"props": {
|
|
6
|
+
"buttonProps": {
|
|
7
|
+
"type": "array",
|
|
8
|
+
"description": "Array of buttons rendered by the group.",
|
|
9
|
+
"items": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"description": "Button item.",
|
|
12
|
+
"component": "button"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"segmented": {
|
|
16
|
+
"type": "boolean",
|
|
17
|
+
"description": "Whether the button group is segmented",
|
|
18
|
+
"default": false
|
|
19
|
+
},
|
|
20
|
+
"className": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Additional classes"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ClassNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface CalendarDateProps {
|
|
5
|
+
datetime: string;
|
|
6
|
+
underCollection?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function CalendarDate({
|
|
10
|
+
datetime,
|
|
11
|
+
underCollection = false,
|
|
12
|
+
}: CalendarDateProps) {
|
|
13
|
+
const date = new Date(datetime);
|
|
14
|
+
const month = date.toLocaleString('en-US', { month: 'short', timeZone: 'UTC' }).toUpperCase();
|
|
15
|
+
const day = date.toLocaleString('en-US', { day: 'numeric', timeZone: 'UTC' });
|
|
16
|
+
|
|
17
|
+
const dateClasses = ClassNames(
|
|
18
|
+
{ 'usa-collection__calendar-date': underCollection },
|
|
19
|
+
'usx-calendar-date',
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const monthClasses = ClassNames(
|
|
23
|
+
{ 'usa-collection__calendar-date-month': underCollection },
|
|
24
|
+
'usx-calendar-date-month',
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const dayClasses = ClassNames(
|
|
28
|
+
{ 'usa-collection__calendar-date-day': underCollection },
|
|
29
|
+
'usx-calendar-date-day',
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className={dateClasses}>
|
|
34
|
+
<time dateTime={datetime}>
|
|
35
|
+
<span className={monthClasses}>{month}</span>
|
|
36
|
+
<span className={dayClasses}>{day}</span>
|
|
37
|
+
</time>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{% load components %}
|
|
2
|
+
|
|
3
|
+
<div class="{% if under_collection %}usa-collection__calendar-date{% endif %} usx-calendar-date">
|
|
4
|
+
<time datetime="{{ datetime }}">
|
|
5
|
+
<span class="{% if under_collection %}usa-collection__calendar-date-month{% endif %} usx-calendar-date-month">{{ datetime|parse_iso|date:"M"|upper }}</span>
|
|
6
|
+
<span class="{% if under_collection %}usa-collection__calendar-date-day{% endif %} usx-calendar-date-day">{{ datetime|parse_iso|date:"j" }}</span>
|
|
7
|
+
</time>
|
|
8
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">Calendar Date</h3>
|
|
2
|
+
|
|
3
|
+
<h4 class="site-preview-heading">Calendar Date as found in a collection</h4>
|
|
4
|
+
<div class="usa-collection__calendar-date usx-calendar-date">
|
|
5
|
+
<time datetime="2020-09-30T12:00:00+01:00">
|
|
6
|
+
<span class="usa-collection__calendar-date-month usx-calendar-date-month">SEP</span>
|
|
7
|
+
<span class="usa-collection__calendar-date-day usx-calendar-date-day">30</span>
|
|
8
|
+
</time>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<h4 class="site-preview-heading">Standalone Calendar Date</h4>
|
|
12
|
+
<div class="usx-calendar-date">
|
|
13
|
+
<time datetime="2020-09-30T12:00:00+01:00">
|
|
14
|
+
<span class="usx-calendar-date-month">SEP</span>
|
|
15
|
+
<span class="usx-calendar-date-day">30</span>
|
|
16
|
+
</time>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "calendar-date",
|
|
3
|
+
"template": "calendar-date/calendar-date.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"props": {
|
|
6
|
+
"datetime": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"default": null,
|
|
9
|
+
"description": "ISO 8601 datetime string. Month and day are parsed from this value."
|
|
10
|
+
},
|
|
11
|
+
"underCollection": {
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"default": false,
|
|
14
|
+
"description": "Whether the calendar date is being rendered within a collection item, which applies specific collection-related styles."
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ClassNames from 'classnames';
|
|
3
|
+
import ButtonGroup from '../button-group/ButtonGroup';
|
|
4
|
+
import Tag from '../tag/Tag';
|
|
5
|
+
import Image from '../image/Image';
|
|
6
|
+
import Carousel from '../carousel/Carousel';
|
|
7
|
+
|
|
8
|
+
export interface CardTag {
|
|
9
|
+
value: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface CardAction {
|
|
14
|
+
children: string;
|
|
15
|
+
variant?: string;
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface CardImage {
|
|
20
|
+
src: string;
|
|
21
|
+
alt: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface CardProps extends React.HTMLAttributes<HTMLElement> {
|
|
25
|
+
title?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
tags?: CardTag[];
|
|
28
|
+
actions?: CardAction[];
|
|
29
|
+
images?: CardImage[];
|
|
30
|
+
headerFirst?: boolean;
|
|
31
|
+
flag?: boolean;
|
|
32
|
+
mediaRight?: boolean;
|
|
33
|
+
mediaInset?: boolean;
|
|
34
|
+
mediaExdent?: boolean;
|
|
35
|
+
showCarouselDots?: boolean;
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
className?: string;
|
|
38
|
+
tag?: React.ElementType;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default function Card({
|
|
42
|
+
title,
|
|
43
|
+
description,
|
|
44
|
+
tags,
|
|
45
|
+
actions,
|
|
46
|
+
images,
|
|
47
|
+
headerFirst = false,
|
|
48
|
+
flag = false,
|
|
49
|
+
mediaRight = false,
|
|
50
|
+
mediaInset = false,
|
|
51
|
+
mediaExdent = false,
|
|
52
|
+
showCarouselDots = true,
|
|
53
|
+
children,
|
|
54
|
+
className = '',
|
|
55
|
+
tag: RootTag = 'div',
|
|
56
|
+
...props
|
|
57
|
+
}: CardProps) {
|
|
58
|
+
const cardClasses = ClassNames(
|
|
59
|
+
'usa-card',
|
|
60
|
+
'usx-card',
|
|
61
|
+
{
|
|
62
|
+
'usa-card--header-first': headerFirst,
|
|
63
|
+
'usa-card--flag': flag,
|
|
64
|
+
'usa-card--media-right': mediaRight,
|
|
65
|
+
},
|
|
66
|
+
className
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const mediaClasses = ClassNames(
|
|
70
|
+
'usa-card__media',
|
|
71
|
+
{
|
|
72
|
+
'usa-card__media--inset': mediaInset,
|
|
73
|
+
'usa-card__media--exdent': mediaExdent,
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const hasStructuredContent = title || description || tags || actions || images;
|
|
78
|
+
const shouldRenderStructured = hasStructuredContent && !children;
|
|
79
|
+
|
|
80
|
+
const hasImages = images && images.length > 0;
|
|
81
|
+
const useCarousel = images && images.length > 1;
|
|
82
|
+
const media = useCarousel ? (
|
|
83
|
+
<Carousel
|
|
84
|
+
id={`${props.id || 'card'}-carousel`}
|
|
85
|
+
showDots={showCarouselDots}
|
|
86
|
+
className="usx-card__carousel"
|
|
87
|
+
slides={images?.map((img, index) => (
|
|
88
|
+
<Image key={index} {...img} hideCaption={true} />
|
|
89
|
+
))}
|
|
90
|
+
/>
|
|
91
|
+
) : hasImages ? (
|
|
92
|
+
<Image {...images[0]} hideCaption={true} className="usa-card__img" />
|
|
93
|
+
) : null;
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<RootTag className={cardClasses} {...props}>
|
|
97
|
+
<div className="usa-card__container">
|
|
98
|
+
{shouldRenderStructured ? (
|
|
99
|
+
<>
|
|
100
|
+
{title && (
|
|
101
|
+
<div className="usa-card__header">
|
|
102
|
+
<h4 className="usa-card__heading">{title}</h4>
|
|
103
|
+
</div>
|
|
104
|
+
)}
|
|
105
|
+
|
|
106
|
+
{media && (
|
|
107
|
+
<div className={mediaClasses}>
|
|
108
|
+
{media}
|
|
109
|
+
</div>
|
|
110
|
+
)}
|
|
111
|
+
|
|
112
|
+
<div className="usa-card__body">
|
|
113
|
+
{tags && tags.length > 0 && (
|
|
114
|
+
<div className="usx-tag-group">
|
|
115
|
+
{tags.map((tag, index) => (
|
|
116
|
+
<Tag key={index} {...tag} />
|
|
117
|
+
))}
|
|
118
|
+
</div>
|
|
119
|
+
)}
|
|
120
|
+
{description && (
|
|
121
|
+
typeof description === 'string' ? <p>{description}</p> : description
|
|
122
|
+
)}
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
{actions && actions.length > 0 && (
|
|
126
|
+
<div className="usa-card__footer">
|
|
127
|
+
<ButtonGroup items={actions} className="flex-wrap" />
|
|
128
|
+
</div>
|
|
129
|
+
)}
|
|
130
|
+
</>
|
|
131
|
+
) : (
|
|
132
|
+
children || 'Card'
|
|
133
|
+
)}
|
|
134
|
+
</div>
|
|
135
|
+
</RootTag>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{% load components %}
|
|
2
|
+
<{% if tag %}{{ tag }}{% else %}div{% endif %} class="usa-card{% if headerFirst %} usa-card--header-first{% endif %}{% if flag %} usa-card--flag{% endif %}{% if mediaRight %} usa-card--media-right{% endif %}{% if className %} {{ className }}{% endif %}">
|
|
3
|
+
<div class="usa-card__container">
|
|
4
|
+
{% if title or description or tags or actions or images %}
|
|
5
|
+
{% if title %}
|
|
6
|
+
<div class="usa-card__header">
|
|
7
|
+
<h4 class="usa-card__heading">{{ title }}</h4>
|
|
8
|
+
</div>
|
|
9
|
+
{% endif %}
|
|
10
|
+
{% if images and images|length > 1 %}
|
|
11
|
+
<div class="usa-card__media{% if mediaInset %} usa-card__media--inset{% endif %}{% if mediaExdent %} usa-card__media--exdent{% endif %}">
|
|
12
|
+
{% carousel slides=images id=id|default:'card'|add:'-carousel' showDots=showCarouselDots|default:True className='' %}{% endcarousel %}
|
|
13
|
+
</div>
|
|
14
|
+
{% elif images and images.0 %}
|
|
15
|
+
<div class="usa-card__media{% if mediaInset %} usa-card__media--inset{% endif %}{% if mediaExdent %} usa-card__media--exdent{% endif %}">
|
|
16
|
+
{% image src=images.0.src alt=images.0.alt hideCaption=True className='usa-card__img' %}{% endimage %}
|
|
17
|
+
</div>
|
|
18
|
+
{% endif %}
|
|
19
|
+
<div class="usa-card__body">
|
|
20
|
+
{% if tags %}
|
|
21
|
+
<div class="usx-tag-group">
|
|
22
|
+
{% for tag in tags %}
|
|
23
|
+
{% tag value=tag.value color=tag.color %}{% endtag %}
|
|
24
|
+
{% endfor %}
|
|
25
|
+
</div>
|
|
26
|
+
{% endif %}
|
|
27
|
+
{% if description %}
|
|
28
|
+
<p>{{ description }}</p>
|
|
29
|
+
{% endif %}
|
|
30
|
+
</div>
|
|
31
|
+
{% if actions %}
|
|
32
|
+
<div class="usa-card__footer">
|
|
33
|
+
{% button_group items=actions %}{% endbutton_group %}
|
|
34
|
+
</div>
|
|
35
|
+
{% endif %}
|
|
36
|
+
{% else %}
|
|
37
|
+
{{ children|default:"Card" }}
|
|
38
|
+
{% endif %}
|
|
39
|
+
</div>
|
|
40
|
+
</{% if tag %}{{ tag }}{% else %}div{% endif %}>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">Default card</h3>
|
|
2
|
+
<div class="usa-card usx-card tablet:grid-col-6 widescreen:grid-col-4">
|
|
3
|
+
<div class="usa-card__container">
|
|
4
|
+
<div class="usa-card__header">
|
|
5
|
+
<h4 class="usa-card__heading">Card</h4>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="usa-card__body">
|
|
8
|
+
<p>
|
|
9
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis earum
|
|
10
|
+
tenetur quo cupiditate, eaque qui officia recusandae.
|
|
11
|
+
</p>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="usa-card__footer">
|
|
14
|
+
<button class="usa-button usx-button usa-button--primary">Visit Florida Keys</button>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<h3 class="site-preview-heading">Card with Image</h3>
|
|
20
|
+
<div class="usa-card usx-card tablet:grid-col-6 widescreen:grid-col-4">
|
|
21
|
+
<div class="usa-card__container">
|
|
22
|
+
<div class="usa-card__header">
|
|
23
|
+
<h4 class="usa-card__heading">Card with Image</h4>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="usa-card__media">
|
|
26
|
+
<div class="usa-card__img">
|
|
27
|
+
<img
|
|
28
|
+
src="https://designsystem.digital.gov/img/introducing-uswds-2-0/built-to-grow--alt.jpg"
|
|
29
|
+
alt="A placeholder image"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="usa-card__body">
|
|
34
|
+
<p>
|
|
35
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis earum
|
|
36
|
+
tenetur quo cupiditate, eaque qui officia recusandae.
|
|
37
|
+
</p>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="usa-card__footer">
|
|
40
|
+
<button class="usa-button usx-button usa-button--primary">Visit Florida Keys</button>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<h3 class="site-preview-heading">Card with Tags</h3>
|
|
46
|
+
<div class="usa-card usx-card tablet:grid-col-6 widescreen:grid-col-4">
|
|
47
|
+
<div class="usa-card__container">
|
|
48
|
+
<div class="usa-card__header">
|
|
49
|
+
<h4 class="usa-card__heading">Card with Tags</h4>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="usa-card__body">
|
|
52
|
+
<p>
|
|
53
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis earum
|
|
54
|
+
tenetur quo cupiditate, eaque qui officia recusandae.
|
|
55
|
+
</p>
|
|
56
|
+
<div class="display-flex flex-wrap margin-top-1">
|
|
57
|
+
<span class="usa-tag usx-tag usa-tag--primary margin-05">Primary</span>
|
|
58
|
+
<span class="usa-tag usx-tag usa-tag--success margin-05">Success</span>
|
|
59
|
+
<span class="usa-tag usx-tag usa-tag--warning margin-05">Warning</span>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="usa-card__footer">
|
|
63
|
+
<button class="usa-button usx-button usa-button--primary">Learn More</button>
|
|
64
|
+
<button class="usa-button usx-button usa-button--secondary margin-left-1">View Details</button>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "card",
|
|
3
|
+
"template": "card/card.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"props": {
|
|
6
|
+
"title": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "The title text displayed in the card header"
|
|
9
|
+
},
|
|
10
|
+
"description": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "The description text displayed in the card body"
|
|
13
|
+
},
|
|
14
|
+
"tags": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"description": "Array of tag objects with value and color properties",
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"description": "Card tag.",
|
|
20
|
+
"properties": {
|
|
21
|
+
"value": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Tag text"
|
|
24
|
+
},
|
|
25
|
+
"color": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Tag color variant"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"actions": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"description": "Array of action button objects",
|
|
35
|
+
"items": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"description": "Card action button.",
|
|
38
|
+
"properties": {
|
|
39
|
+
"children": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Button text"
|
|
42
|
+
},
|
|
43
|
+
"variant": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Button variant"
|
|
46
|
+
},
|
|
47
|
+
"onClick": {
|
|
48
|
+
"type": "function",
|
|
49
|
+
"description": "Click handler"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"images": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"description": "Array of image objects (currently uses first image)",
|
|
57
|
+
"items": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"description": "Card image.",
|
|
60
|
+
"properties": {
|
|
61
|
+
"src": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "Image source URL"
|
|
64
|
+
},
|
|
65
|
+
"alt": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "Alt text for the image"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"headerFirst": {
|
|
73
|
+
"type": "boolean",
|
|
74
|
+
"default": false,
|
|
75
|
+
"description": "Whether to display the header before the media section"
|
|
76
|
+
},
|
|
77
|
+
"flag": {
|
|
78
|
+
"type": "boolean",
|
|
79
|
+
"default": false,
|
|
80
|
+
"description": "Whether to use the flag layout where media and content are side-by-side"
|
|
81
|
+
},
|
|
82
|
+
"mediaRight": {
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"default": false,
|
|
85
|
+
"description": "Whether to place media on the right side in flag layout"
|
|
86
|
+
},
|
|
87
|
+
"mediaInset": {
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"default": false,
|
|
90
|
+
"description": "Whether to inset the media within the card container"
|
|
91
|
+
},
|
|
92
|
+
"mediaExdent": {
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"default": false,
|
|
95
|
+
"description": "Whether to extend the media outside the card container boundaries"
|
|
96
|
+
},
|
|
97
|
+
"showCarouselDots": {
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"default": true,
|
|
100
|
+
"description": "Whether to show navigation dots when multiple images are provided"
|
|
101
|
+
},
|
|
102
|
+
"children": {
|
|
103
|
+
"type": "slot",
|
|
104
|
+
"description": "Inner HTML or text content (alternative to structured props)"
|
|
105
|
+
},
|
|
106
|
+
"className": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"description": "Additional CSS classes"
|
|
109
|
+
},
|
|
110
|
+
"tag": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"description": "HTML tag to use for the card element (div or li)"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ClassNames from 'classnames';
|
|
3
|
+
import Card, { CardProps } from '../card/Card';
|
|
4
|
+
|
|
5
|
+
export interface CardGroupProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
6
|
+
cardProps?: CardProps[];
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default function CardGroup({ cardProps = [], className = '', ...props }: CardGroupProps) {
|
|
11
|
+
const classes = ClassNames(
|
|
12
|
+
'usa-card-group',
|
|
13
|
+
'usx-card-group',
|
|
14
|
+
className
|
|
15
|
+
);
|
|
16
|
+
return (
|
|
17
|
+
<ul className={classes} {...props}>
|
|
18
|
+
{cardProps.map((card, index) => (
|
|
19
|
+
<Card key={index} {...card} tag="li" />
|
|
20
|
+
))}
|
|
21
|
+
</ul>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{% load components %}
|
|
2
|
+
<ul class="usa-card-group usx-card-group{% if className %} {{ className }}{% endif %}">
|
|
3
|
+
{% for card in cardProps %}
|
|
4
|
+
{% card tag='li' title=card.title description=card.description footer=card.footer actions=card.actions images=card.images flag=card.flag mediaRight=card.mediaRight headerFirst=card.headerFirst className=card.className %}{% endcard %}
|
|
5
|
+
{% endfor %}
|
|
6
|
+
</ul>
|