@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,86 @@
|
|
|
1
|
+
{# Django template for MemorableDate #}
|
|
2
|
+
{% load components %}
|
|
3
|
+
|
|
4
|
+
{% with base_id=id|default:"memorable-date" %}
|
|
5
|
+
{% with month_id=base_id|add:"-month" day_id=base_id|add:"-day" year_id=base_id|add:"-year" %}
|
|
6
|
+
{% with month_hint_id=month_id|add:"-hint" day_hint_id=day_id|add:"-hint" year_hint_id=year_id|add:"-hint" error_id=base_id|add:"-error" %}
|
|
7
|
+
{% form_group error=error %}
|
|
8
|
+
{% fieldset legend=legend required=required className=className error=error errorId=error_id %}
|
|
9
|
+
<span class="usa-hint usx-hint" aria-hidden="true" id="{{ base_id }}-hint">{{ groupHint|default:"Select a month. Enter 1 or 2 digits for the day and 4 digits for the year." }}</span>
|
|
10
|
+
<div class="usa-memorable-date usx-memorable-date">
|
|
11
|
+
{% form_group className="usa-form-group--month usa-form-group--select" %}
|
|
12
|
+
{% label htmlFor=month_id required=required %}{{ monthLabel|default:"Month" }}{% endlabel %}
|
|
13
|
+
<select
|
|
14
|
+
class="usa-select usx-select{% if error %} usa-input--error{% endif %}"
|
|
15
|
+
id="{{ month_id }}"
|
|
16
|
+
name="{{ monthName|default:month_id }}"
|
|
17
|
+
aria-describedby="{{ month_hint_id }}{% if error %} {{ error_id }}{% endif %}"
|
|
18
|
+
{% if error %}aria-invalid="true"{% endif %}
|
|
19
|
+
{% if disabled %}disabled{% elif ariaDisabled %}aria-disabled="true"{% endif %}
|
|
20
|
+
{% if required %}required{% endif %}
|
|
21
|
+
>
|
|
22
|
+
<option value="">- Select -</option>
|
|
23
|
+
<option value="1" {% if defaultMonth == "1" %}selected{% endif %}>January</option>
|
|
24
|
+
<option value="2" {% if defaultMonth == "2" %}selected{% endif %}>February</option>
|
|
25
|
+
<option value="3" {% if defaultMonth == "3" %}selected{% endif %}>March</option>
|
|
26
|
+
<option value="4" {% if defaultMonth == "4" %}selected{% endif %}>April</option>
|
|
27
|
+
<option value="5" {% if defaultMonth == "5" %}selected{% endif %}>May</option>
|
|
28
|
+
<option value="6" {% if defaultMonth == "6" %}selected{% endif %}>June</option>
|
|
29
|
+
<option value="7" {% if defaultMonth == "7" %}selected{% endif %}>July</option>
|
|
30
|
+
<option value="8" {% if defaultMonth == "8" %}selected{% endif %}>August</option>
|
|
31
|
+
<option value="9" {% if defaultMonth == "9" %}selected{% endif %}>September</option>
|
|
32
|
+
<option value="10" {% if defaultMonth == "10" %}selected{% endif %}>October</option>
|
|
33
|
+
<option value="11" {% if defaultMonth == "11" %}selected{% endif %}>November</option>
|
|
34
|
+
<option value="12" {% if defaultMonth == "12" %}selected{% endif %}>December</option>
|
|
35
|
+
</select>
|
|
36
|
+
{% if monthHint %}
|
|
37
|
+
<span class="usa-hint usa-sr-only" id="{{ month_hint_id }}">{{ monthHint|default:"Select a month from the dropdown." }}</span>
|
|
38
|
+
{% endif %}
|
|
39
|
+
{% endform_group %}
|
|
40
|
+
|
|
41
|
+
{% form_group className="usa-form-group--day" %}
|
|
42
|
+
{% label htmlFor=day_id required=required error=error %}{{ dayLabel|default:"Day" }}{% endlabel %}
|
|
43
|
+
<input
|
|
44
|
+
class="usa-input usx-input{% if error %} usa-input--error{% endif %}"
|
|
45
|
+
id="{{ day_id }}"
|
|
46
|
+
name="{{ dayName|default:day_id }}"
|
|
47
|
+
value="{{ defaultDay|default:'' }}"
|
|
48
|
+
maxlength="2"
|
|
49
|
+
pattern="[0-9]*"
|
|
50
|
+
inputmode="numeric"
|
|
51
|
+
aria-describedby="{{ day_hint_id }}{% if error %} {{ error_id }}{% endif %}"
|
|
52
|
+
{% if error %}aria-invalid="true"{% endif %}
|
|
53
|
+
{% if disabled %}disabled{% elif ariaDisabled %}aria-disabled="true"{% endif %}
|
|
54
|
+
{% if required %}required{% endif %}
|
|
55
|
+
/>
|
|
56
|
+
{% if dayHint %}
|
|
57
|
+
<span class="usa-hint usa-sr-only" id="{{ day_hint_id }}">{{ dayHint|default:"Enter 1 or 2 digits for the day." }}</span>
|
|
58
|
+
{% endif %}
|
|
59
|
+
{% endform_group %}
|
|
60
|
+
|
|
61
|
+
{% form_group className="usa-form-group--year" %}
|
|
62
|
+
{% label htmlFor=year_id required=required error=error %}{{ yearLabel|default:"Year" }}{% endlabel %}
|
|
63
|
+
<input
|
|
64
|
+
class="usa-input usx-input{% if error %} usa-input--error{% endif %}"
|
|
65
|
+
id="{{ year_id }}"
|
|
66
|
+
name="{{ yearName|default:year_id }}"
|
|
67
|
+
value="{{ defaultYear|default:'' }}"
|
|
68
|
+
minlength="4"
|
|
69
|
+
maxlength="4"
|
|
70
|
+
pattern="[0-9]*"
|
|
71
|
+
inputmode="numeric"
|
|
72
|
+
aria-describedby="{{ year_hint_id }}{% if error %} {{ error_id }}{% endif %}"
|
|
73
|
+
{% if error %}aria-invalid="true"{% endif %}
|
|
74
|
+
{% if disabled %}disabled{% elif ariaDisabled %}aria-disabled="true"{% endif %}
|
|
75
|
+
{% if required %}required{% endif %}
|
|
76
|
+
/>
|
|
77
|
+
{% if yearHint %}
|
|
78
|
+
<span class="usa-hint usa-sr-only" id="{{ year_hint_id }}">{{ yearHint|default:"Enter 4 digits for the year." }}</span>
|
|
79
|
+
{% endif %}
|
|
80
|
+
{% endform_group %}
|
|
81
|
+
</div>
|
|
82
|
+
{% endfieldset %}
|
|
83
|
+
{% endform_group %}
|
|
84
|
+
{% endwith %}
|
|
85
|
+
{% endwith %}
|
|
86
|
+
{% endwith %}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">Default</h3>
|
|
2
|
+
<fieldset class="usa-fieldset usx-fieldset">
|
|
3
|
+
<legend class="usa-legend usx-legend">Date of Birth</legend>
|
|
4
|
+
<span class="usa-hint" aria-hidden="true" id="memorable-date-hint">
|
|
5
|
+
Select a month. Enter 1 or 2 digits for the day and 4 digits for the year.
|
|
6
|
+
</span>
|
|
7
|
+
<div class="usa-memorable-date usx-memorable-date">
|
|
8
|
+
<div class="usa-form-group usx-form-group usa-form-group--month usa-form-group--select">
|
|
9
|
+
<label class="usa-label usx-label" for="memorable-date-month">Month</label>
|
|
10
|
+
<select class="usa-select usx-select" id="memorable-date-month" name="memorable-date-month"
|
|
11
|
+
aria-describedby="memorable-date-month-hint">
|
|
12
|
+
<option value="">- Select -</option>
|
|
13
|
+
<option value="1">January</option>
|
|
14
|
+
<option value="2">February</option>
|
|
15
|
+
<option value="3">March</option>
|
|
16
|
+
<option value="4">April</option>
|
|
17
|
+
<option value="5">May</option>
|
|
18
|
+
<option value="6">June</option>
|
|
19
|
+
<option value="7">July</option>
|
|
20
|
+
<option value="8">August</option>
|
|
21
|
+
<option value="9">September</option>
|
|
22
|
+
<option value="10">October</option>
|
|
23
|
+
<option value="11">November</option>
|
|
24
|
+
<option value="12">December</option>
|
|
25
|
+
</select>
|
|
26
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-month-hint">Select a month from the dropdown.</span>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="usa-form-group usx-form-group usa-form-group--day">
|
|
29
|
+
<label class="usa-label usx-label" for="memorable-date-day">Day</label>
|
|
30
|
+
<input class="usa-input usx-input" id="memorable-date-day" name="memorable-date-day" maxlength="2"
|
|
31
|
+
pattern="[0-9]*" inputmode="numeric" value="" aria-describedby="memorable-date-day-hint" />
|
|
32
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-day-hint">Enter 1 or 2 digits for the day.</span>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="usa-form-group usx-form-group usa-form-group--year">
|
|
35
|
+
<label class="usa-label usx-label" for="memorable-date-year">Year</label>
|
|
36
|
+
<input class="usa-input usx-input" id="memorable-date-year" name="memorable-date-year" minlength="4" maxlength="4"
|
|
37
|
+
pattern="[0-9]*" inputmode="numeric" value="" aria-describedby="memorable-date-year-hint" />
|
|
38
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-year-hint">Enter 4 digits for the year.</span>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</fieldset>
|
|
42
|
+
|
|
43
|
+
<h3 class="site-preview-heading">Disabled</h3>
|
|
44
|
+
<fieldset class="usa-fieldset usx-fieldset">
|
|
45
|
+
<legend class="usa-legend usx-legend">Date of Birth</legend>
|
|
46
|
+
<span class="usa-hint" aria-hidden="true" id="memorable-date-disabled-hint">
|
|
47
|
+
Select a month. Enter 1 or 2 digits for the day and 4 digits for the year.
|
|
48
|
+
</span>
|
|
49
|
+
<div class="usa-memorable-date usx-memorable-date">
|
|
50
|
+
<div class="usa-form-group usx-form-group usa-form-group--month usa-form-group--select">
|
|
51
|
+
<label class="usa-label usx-label" for="memorable-date-disabled-month">Month</label>
|
|
52
|
+
<select class="usa-select usx-select" id="memorable-date-disabled-month" name="memorable-date-disabled-month"
|
|
53
|
+
aria-describedby="memorable-date-disabled-month-hint" disabled>
|
|
54
|
+
<option value="">- Select -</option>
|
|
55
|
+
<option value="1">January</option>
|
|
56
|
+
<option value="2">February</option>
|
|
57
|
+
<option value="3">March</option>
|
|
58
|
+
<option value="4">April</option>
|
|
59
|
+
<option value="5">May</option>
|
|
60
|
+
<option value="6">June</option>
|
|
61
|
+
<option value="7">July</option>
|
|
62
|
+
<option value="8">August</option>
|
|
63
|
+
<option value="9">September</option>
|
|
64
|
+
<option value="10">October</option>
|
|
65
|
+
<option value="11">November</option>
|
|
66
|
+
<option value="12">December</option>
|
|
67
|
+
</select>
|
|
68
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-disabled-month-hint">Select a month from the
|
|
69
|
+
dropdown.</span>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="usa-form-group usx-form-group usa-form-group--day">
|
|
72
|
+
<label class="usa-label usx-label" for="memorable-date-disabled-day">Day</label>
|
|
73
|
+
<input class="usa-input usx-input" id="memorable-date-disabled-day" name="memorable-date-disabled-day"
|
|
74
|
+
maxlength="2" pattern="[0-9]*" inputmode="numeric" value="" aria-describedby="memorable-date-disabled-day-hint"
|
|
75
|
+
disabled />
|
|
76
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-disabled-day-hint">Enter 1 or 2 digits for the day.</span>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="usa-form-group usx-form-group usa-form-group--year">
|
|
79
|
+
<label class="usa-label usx-label" for="memorable-date-disabled-year">Year</label>
|
|
80
|
+
<input class="usa-input usx-input" id="memorable-date-disabled-year" name="memorable-date-disabled-year"
|
|
81
|
+
minlength="4" maxlength="4" pattern="[0-9]*" inputmode="numeric" value=""
|
|
82
|
+
aria-describedby="memorable-date-disabled-year-hint" disabled />
|
|
83
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-disabled-year-hint">Enter 4 digits for the year.</span>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</fieldset>
|
|
87
|
+
|
|
88
|
+
<h3 class="site-preview-heading">Aria Disabled</h3>
|
|
89
|
+
<fieldset class="usa-fieldset usx-fieldset">
|
|
90
|
+
<legend class="usa-legend usx-legend">Date of Birth</legend>
|
|
91
|
+
<span class="usa-hint" aria-hidden="true" id="memorable-date-aria-disabled-hint">
|
|
92
|
+
Select a month. Enter 1 or 2 digits for the day and 4 digits for the year.
|
|
93
|
+
</span>
|
|
94
|
+
<div class="usa-memorable-date usx-memorable-date">
|
|
95
|
+
<div class="usa-form-group usx-form-group usa-form-group--month usa-form-group--select">
|
|
96
|
+
<label class="usa-label usx-label" for="memorable-date-aria-disabled-month">Month</label>
|
|
97
|
+
<select class="usa-select usx-select" id="memorable-date-aria-disabled-month"
|
|
98
|
+
name="memorable-date-aria-disabled-month" aria-describedby="memorable-date-aria-disabled-month-hint"
|
|
99
|
+
aria-disabled="true">
|
|
100
|
+
<option value="">- Select -</option>
|
|
101
|
+
<option value="1">January</option>
|
|
102
|
+
<option value="2">February</option>
|
|
103
|
+
<option value="3">March</option>
|
|
104
|
+
<option value="4">April</option>
|
|
105
|
+
<option value="5">May</option>
|
|
106
|
+
<option value="6">June</option>
|
|
107
|
+
<option value="7">July</option>
|
|
108
|
+
<option value="8">August</option>
|
|
109
|
+
<option value="9">September</option>
|
|
110
|
+
<option value="10">October</option>
|
|
111
|
+
<option value="11">November</option>
|
|
112
|
+
<option value="12">December</option>
|
|
113
|
+
</select>
|
|
114
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-aria-disabled-month-hint">Select a month from the
|
|
115
|
+
dropdown.</span>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="usa-form-group usx-form-group usa-form-group--day">
|
|
118
|
+
<label class="usa-label usx-label" for="memorable-date-aria-disabled-day">Day</label>
|
|
119
|
+
<input class="usa-input usx-input" id="memorable-date-aria-disabled-day" name="memorable-date-aria-disabled-day"
|
|
120
|
+
maxlength="2" pattern="[0-9]*" inputmode="numeric" value=""
|
|
121
|
+
aria-describedby="memorable-date-aria-disabled-day-hint" aria-disabled="true" />
|
|
122
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-aria-disabled-day-hint">Enter 1 or 2 digits for the
|
|
123
|
+
day.</span>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="usa-form-group usx-form-group usa-form-group--year">
|
|
126
|
+
<label class="usa-label usx-label" for="memorable-date-aria-disabled-year">Year</label>
|
|
127
|
+
<input class="usa-input usx-input" id="memorable-date-aria-disabled-year" name="memorable-date-aria-disabled-year"
|
|
128
|
+
minlength="4" maxlength="4" pattern="[0-9]*" inputmode="numeric" value=""
|
|
129
|
+
aria-describedby="memorable-date-aria-disabled-year-hint" aria-disabled="true" />
|
|
130
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-aria-disabled-year-hint">Enter 4 digits for the year.</span>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</fieldset>
|
|
134
|
+
|
|
135
|
+
<h3 class="site-preview-heading">Required</h3>
|
|
136
|
+
<fieldset class="usa-fieldset usx-fieldset">
|
|
137
|
+
<legend class="usa-legend usx-legend"><abbr title="required" class="usx-required">*</abbr>Date of Birth</legend>
|
|
138
|
+
<span class="usa-hint" aria-hidden="true" id="memorable-date-required-hint">
|
|
139
|
+
Select a month. Enter 1 or 2 digits for the day and 4 digits for the year.
|
|
140
|
+
</span>
|
|
141
|
+
<div class="usa-memorable-date usx-memorable-date">
|
|
142
|
+
<div class="usa-form-group usx-form-group usa-form-group--month usa-form-group--select">
|
|
143
|
+
<label class="usa-label usx-label" for="memorable-date-required-month"><abbr title="required"
|
|
144
|
+
class="usx-required">*</abbr>Month</label>
|
|
145
|
+
<select class="usa-select usx-select" id="memorable-date-required-month" name="memorable-date-required-month"
|
|
146
|
+
aria-describedby="memorable-date-required-month-hint" required>
|
|
147
|
+
<option value="">- Select -</option>
|
|
148
|
+
<option value="1">January</option>
|
|
149
|
+
<option value="2">February</option>
|
|
150
|
+
<option value="3">March</option>
|
|
151
|
+
<option value="4">April</option>
|
|
152
|
+
<option value="5">May</option>
|
|
153
|
+
<option value="6">June</option>
|
|
154
|
+
<option value="7">July</option>
|
|
155
|
+
<option value="8">August</option>
|
|
156
|
+
<option value="9">September</option>
|
|
157
|
+
<option value="10">October</option>
|
|
158
|
+
<option value="11">November</option>
|
|
159
|
+
<option value="12">December</option>
|
|
160
|
+
</select>
|
|
161
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-required-month-hint">Select a month from the
|
|
162
|
+
dropdown.</span>
|
|
163
|
+
</div>
|
|
164
|
+
<div class="usa-form-group usx-form-group usa-form-group--day">
|
|
165
|
+
<label class="usa-label usx-label" for="memorable-date-required-day"><abbr title="required"
|
|
166
|
+
class="usx-required">*</abbr>Day</label>
|
|
167
|
+
<input class="usa-input usx-input" id="memorable-date-required-day" name="memorable-date-required-day"
|
|
168
|
+
maxlength="2" pattern="[0-9]*" inputmode="numeric" value="" aria-describedby="memorable-date-required-day-hint"
|
|
169
|
+
required />
|
|
170
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-required-day-hint">Enter 1 or 2 digits for the day.</span>
|
|
171
|
+
</div>
|
|
172
|
+
<div class="usa-form-group usx-form-group usa-form-group--year">
|
|
173
|
+
<label class="usa-label usx-label" for="memorable-date-required-year"><abbr title="required"
|
|
174
|
+
class="usx-required">*</abbr>Year</label>
|
|
175
|
+
<input class="usa-input usx-input" id="memorable-date-required-year" name="memorable-date-required-year"
|
|
176
|
+
minlength="4" maxlength="4" pattern="[0-9]*" inputmode="numeric" value=""
|
|
177
|
+
aria-describedby="memorable-date-required-year-hint" required />
|
|
178
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-required-year-hint">Enter 4 digits for the year.</span>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</fieldset>
|
|
182
|
+
|
|
183
|
+
<h3 class="site-preview-heading">With Default Values</h3>
|
|
184
|
+
<fieldset class="usa-fieldset usx-fieldset">
|
|
185
|
+
<legend class="usa-legend usx-legend">Date of Birth</legend>
|
|
186
|
+
<span class="usa-hint" aria-hidden="true" id="memorable-date-default-value-hint">
|
|
187
|
+
Select a month. Enter 1 or 2 digits for the day and 4 digits for the year.
|
|
188
|
+
</span>
|
|
189
|
+
<div class="usa-memorable-date usx-memorable-date">
|
|
190
|
+
<div class="usa-form-group usx-form-group usa-form-group--month usa-form-group--select">
|
|
191
|
+
<label class="usa-label usx-label" for="memorable-date-default-value-month">Month</label>
|
|
192
|
+
<select class="usa-select usx-select" id="memorable-date-default-value-month"
|
|
193
|
+
name="memorable-date-default-value-month" aria-describedby="memorable-date-default-value-month-hint">
|
|
194
|
+
<option value="">- Select -</option>
|
|
195
|
+
<option value="1">January</option>
|
|
196
|
+
<option value="2">February</option>
|
|
197
|
+
<option value="3">March</option>
|
|
198
|
+
<option value="4">April</option>
|
|
199
|
+
<option value="5" selected>May</option>
|
|
200
|
+
<option value="6">June</option>
|
|
201
|
+
<option value="7">July</option>
|
|
202
|
+
<option value="8">August</option>
|
|
203
|
+
<option value="9">September</option>
|
|
204
|
+
<option value="10">October</option>
|
|
205
|
+
<option value="11">November</option>
|
|
206
|
+
<option value="12">December</option>
|
|
207
|
+
</select>
|
|
208
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-default-value-month-hint">Select a month from the
|
|
209
|
+
dropdown.</span>
|
|
210
|
+
</div>
|
|
211
|
+
<div class="usa-form-group usx-form-group usa-form-group--day">
|
|
212
|
+
<label class="usa-label usx-label" for="memorable-date-default-value-day">Day</label>
|
|
213
|
+
<input class="usa-input usx-input" id="memorable-date-default-value-day" name="memorable-date-default-value-day"
|
|
214
|
+
maxlength="2" pattern="[0-9]*" inputmode="numeric" value="22"
|
|
215
|
+
aria-describedby="memorable-date-default-value-day-hint" />
|
|
216
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-default-value-day-hint">Enter 1 or 2 digits for the
|
|
217
|
+
day.</span>
|
|
218
|
+
</div>
|
|
219
|
+
<div class="usa-form-group usx-form-group usa-form-group--year">
|
|
220
|
+
<label class="usa-label usx-label" for="memorable-date-default-value-year">Year</label>
|
|
221
|
+
<input class="usa-input usx-input" id="memorable-date-default-value-year" name="memorable-date-default-value-year"
|
|
222
|
+
minlength="4" maxlength="4" pattern="[0-9]*" inputmode="numeric" value="1990"
|
|
223
|
+
aria-describedby="memorable-date-default-value-year-hint" />
|
|
224
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-default-value-year-hint">Enter 4 digits for the year.</span>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
</fieldset>
|
|
228
|
+
|
|
229
|
+
<h3 class="site-preview-heading">With Error</h3>
|
|
230
|
+
<div class="usa-form-group usx-form-group usa-form-group--error">
|
|
231
|
+
<fieldset class="usa-fieldset usx-fieldset">
|
|
232
|
+
<legend class="usa-legend usx-legend usa-label--error">Date of Birth</legend>
|
|
233
|
+
<span class="usa-hint" aria-hidden="true" id="memorable-date-error-hint">
|
|
234
|
+
Select a month. Enter 1 or 2 digits for the day and 4 digits for the year.
|
|
235
|
+
</span>
|
|
236
|
+
<div class="usa-memorable-date usx-memorable-date">
|
|
237
|
+
<div class="usa-form-group usx-form-group usa-form-group--month usa-form-group--select">
|
|
238
|
+
<label class="usa-label usx-label" for="memorable-date-error-month">Month</label>
|
|
239
|
+
<select class="usa-select usx-select usa-input--error" id="memorable-date-error-month"
|
|
240
|
+
name="memorable-date-error-month"
|
|
241
|
+
aria-describedby="memorable-date-error-month-hint memorable-date-error-error" aria-invalid="true">
|
|
242
|
+
<option value="">- Select -</option>
|
|
243
|
+
<option value="1">January</option>
|
|
244
|
+
<option value="2">February</option>
|
|
245
|
+
<option value="3">March</option>
|
|
246
|
+
<option value="4">April</option>
|
|
247
|
+
<option value="5">May</option>
|
|
248
|
+
<option value="6">June</option>
|
|
249
|
+
<option value="7">July</option>
|
|
250
|
+
<option value="8">August</option>
|
|
251
|
+
<option value="9">September</option>
|
|
252
|
+
<option value="10">October</option>
|
|
253
|
+
<option value="11">November</option>
|
|
254
|
+
<option value="12">December</option>
|
|
255
|
+
</select>
|
|
256
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-error-month-hint">Select a month from the dropdown.</span>
|
|
257
|
+
</div>
|
|
258
|
+
<div class="usa-form-group usx-form-group usa-form-group--day">
|
|
259
|
+
<label class="usa-label usx-label usa-label--error" for="memorable-date-error-day">Day</label>
|
|
260
|
+
<input class="usa-input usx-input usa-input--error" id="memorable-date-error-day"
|
|
261
|
+
name="memorable-date-error-day" maxlength="2" pattern="[0-9]*" inputmode="numeric" value="32"
|
|
262
|
+
aria-describedby="memorable-date-error-day-hint memorable-date-error-error" aria-invalid="true" />
|
|
263
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-error-day-hint">Enter 1 or 2 digits for the day.</span>
|
|
264
|
+
</div>
|
|
265
|
+
<div class="usa-form-group usx-form-group usa-form-group--year">
|
|
266
|
+
<label class="usa-label usx-label usa-label--error" for="memorable-date-error-year">Year</label>
|
|
267
|
+
<input class="usa-input usx-input usa-input--error" id="memorable-date-error-year"
|
|
268
|
+
name="memorable-date-error-year" minlength="4" maxlength="4" pattern="[0-9]*" inputmode="numeric" value="1990"
|
|
269
|
+
aria-describedby="memorable-date-error-year-hint memorable-date-error-error" aria-invalid="true" />
|
|
270
|
+
<span class="usa-hint usa-sr-only" id="memorable-date-error-year-hint">Enter 4 digits for the year.</span>
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
<span class="usa-error-message" id="memorable-date-error-error" role="alert">Enter a valid date of birth.</span>
|
|
274
|
+
</fieldset>
|
|
275
|
+
</div>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React, { ReactNode, HTMLAttributes, useId } from 'react';
|
|
2
|
+
import Icon from '../icon/Icon';
|
|
3
|
+
|
|
4
|
+
export interface MiscBannerProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
tone?: 'base' | 'primary' | 'beta' | 'dev' | 'test';
|
|
8
|
+
badgeText?: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
casualLinkText?: string;
|
|
11
|
+
casualLinkHref?: string;
|
|
12
|
+
showLearnMore?: boolean;
|
|
13
|
+
importantLinkText?: string;
|
|
14
|
+
importantLinkHref?: string;
|
|
15
|
+
importantLinkIcon?: string;
|
|
16
|
+
showReturnLink?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function MiscBanner({
|
|
20
|
+
children = null,
|
|
21
|
+
className = '',
|
|
22
|
+
tone = 'beta',
|
|
23
|
+
badgeText = 'beta',
|
|
24
|
+
message = 'Welcome to the beta website!',
|
|
25
|
+
casualLinkText,
|
|
26
|
+
casualLinkHref,
|
|
27
|
+
showLearnMore = true,
|
|
28
|
+
importantLinkText,
|
|
29
|
+
importantLinkHref,
|
|
30
|
+
importantLinkIcon = 'undo',
|
|
31
|
+
showReturnLink = true,
|
|
32
|
+
...props
|
|
33
|
+
}: MiscBannerProps) {
|
|
34
|
+
const menuId = useId();
|
|
35
|
+
const toggleId = useId();
|
|
36
|
+
const classes = ['usx-misc-banner', `bg-${tone}`, className].filter(Boolean).join(' ');
|
|
37
|
+
const mobileLinks: { href: string; text: string }[] = [];
|
|
38
|
+
const hasLearnMoreLink = showLearnMore && Boolean(casualLinkText);
|
|
39
|
+
const hasReturnLink = showReturnLink && Boolean(importantLinkText);
|
|
40
|
+
|
|
41
|
+
if (hasLearnMoreLink) {
|
|
42
|
+
mobileLinks.push({
|
|
43
|
+
href: casualLinkHref!,
|
|
44
|
+
text: casualLinkText!,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (hasReturnLink) {
|
|
49
|
+
mobileLinks.push({
|
|
50
|
+
href: importantLinkHref!,
|
|
51
|
+
text: importantLinkText!,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const content = children || (
|
|
56
|
+
<>
|
|
57
|
+
<strong className={`usx-misc-banner__badge text-${tone}`}>{badgeText}</strong>
|
|
58
|
+
<p className="usx-misc-banner__text">
|
|
59
|
+
{message}
|
|
60
|
+
{hasLearnMoreLink ? (
|
|
61
|
+
<>
|
|
62
|
+
{' '}
|
|
63
|
+
<a className="usa-link usx-misc-banner__link" href={casualLinkHref}>{casualLinkText}</a>
|
|
64
|
+
</>
|
|
65
|
+
) : null}
|
|
66
|
+
</p>
|
|
67
|
+
{hasReturnLink ? (
|
|
68
|
+
<span className="usx-misc-banner__return-text">
|
|
69
|
+
<a className="usa-link usx-misc-banner__link" href={importantLinkHref}>
|
|
70
|
+
<Icon name={importantLinkIcon} size={1} className="usx-icon--size-1" />
|
|
71
|
+
{' '}
|
|
72
|
+
{importantLinkText}
|
|
73
|
+
</a>
|
|
74
|
+
</span>
|
|
75
|
+
) : null}
|
|
76
|
+
{mobileLinks.length ? (
|
|
77
|
+
<div className="usx-misc-banner__dropdown">
|
|
78
|
+
<input
|
|
79
|
+
id={toggleId}
|
|
80
|
+
type="checkbox"
|
|
81
|
+
className="usx-misc-banner__dropdown-toggle"
|
|
82
|
+
/>
|
|
83
|
+
<label
|
|
84
|
+
className="usx-misc-banner__dropdown-button"
|
|
85
|
+
htmlFor={toggleId}
|
|
86
|
+
aria-controls={menuId}
|
|
87
|
+
aria-label="Toggle banner links"
|
|
88
|
+
>
|
|
89
|
+
<Icon name="expand_more" size={4} className="usx-icon" />
|
|
90
|
+
</label>
|
|
91
|
+
<div id={menuId} className="usx-misc-banner__dropdown-content">
|
|
92
|
+
<ul className="usa-list">
|
|
93
|
+
{mobileLinks.map((link) => (
|
|
94
|
+
<li key={`${link.href}-${link.text}`} className="usa-list__item">
|
|
95
|
+
<a className="usa-link usx-misc-banner__link" href={link.href}>{link.text}</a>
|
|
96
|
+
</li>
|
|
97
|
+
))}
|
|
98
|
+
</ul>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
) : null}
|
|
102
|
+
</>
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<div className={classes} {...props}>
|
|
107
|
+
<div className="usx-misc-banner__content grid-container">
|
|
108
|
+
{content}
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "misc-banner",
|
|
3
|
+
"template": "misc-banner/misc-banner.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"props": {
|
|
6
|
+
"children": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "Advanced override for custom inner markup"
|
|
9
|
+
},
|
|
10
|
+
"className": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Additional classes for the root banner"
|
|
13
|
+
},
|
|
14
|
+
"tone": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Banner tone and style: beta, dev, or test"
|
|
17
|
+
},
|
|
18
|
+
"badgeText": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "Badge label text"
|
|
21
|
+
},
|
|
22
|
+
"message": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "Main banner message"
|
|
25
|
+
},
|
|
26
|
+
"casualLinkText": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "Learn more link text"
|
|
29
|
+
},
|
|
30
|
+
"casualLinkHref": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "Learn more link destination"
|
|
33
|
+
},
|
|
34
|
+
"showLearnMore": {
|
|
35
|
+
"type": "boolean",
|
|
36
|
+
"description": "Show learn more link",
|
|
37
|
+
"default": false
|
|
38
|
+
},
|
|
39
|
+
"importantLinkText": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Secondary return link text"
|
|
42
|
+
},
|
|
43
|
+
"importantLinkHref": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Secondary return link destination"
|
|
46
|
+
},
|
|
47
|
+
"importantLinkIcon": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "Icon name used before return text"
|
|
50
|
+
},
|
|
51
|
+
"showReturnLink": {
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"description": "Show return link section",
|
|
54
|
+
"default": false
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{# Django template for MiscBanner #}
|
|
2
|
+
<div class="usx-misc-banner bg-{{ tone|default:'beta' }}{% if className %} {{ className }}{% endif %}">
|
|
3
|
+
<div class="usx-misc-banner__content grid-container">
|
|
4
|
+
{% if content %}
|
|
5
|
+
{{ content|safe }}
|
|
6
|
+
{% elif children %}
|
|
7
|
+
{{ children|safe }}
|
|
8
|
+
{% else %}
|
|
9
|
+
<strong class="usx-misc-banner__badge text-{{ tone|default:'beta' }}">{{ badgeText|default:tone|default:'beta' }}</strong>
|
|
10
|
+
<p class="usx-misc-banner__text">
|
|
11
|
+
{{ message|default:'Welcome to the beta website!' }}
|
|
12
|
+
{% if casualLinkText %}
|
|
13
|
+
<a class="usa-link usx-misc-banner__link" href="{{ casualLinkHref|default:'https://usx.solex.studio/' }}">{{ casualLinkText }}</a>
|
|
14
|
+
{% endif %}
|
|
15
|
+
</p>
|
|
16
|
+
{% if importantLinkText %}
|
|
17
|
+
<span class="usx-misc-banner__return-text">
|
|
18
|
+
<a class="usa-link usx-misc-banner__link" href="{{ importantLinkHref|default:'https://usx.solex.studio/' }}">
|
|
19
|
+
<svg class="usa-icon usx-icon--size-1" aria-hidden="true" focusable="false" role="img">
|
|
20
|
+
<use href="./img/sprite.svg#{{ importantLinkIcon|default:'undo' }}"></use>
|
|
21
|
+
</svg>
|
|
22
|
+
{{ importantLinkText }}
|
|
23
|
+
</a>
|
|
24
|
+
</span>
|
|
25
|
+
{% endif %}
|
|
26
|
+
{% if casualLinkText or importantLinkText %}
|
|
27
|
+
{% with dropdownBase=id|default:tone|default:'misc-banner' %}
|
|
28
|
+
<div class="usx-misc-banner__dropdown">
|
|
29
|
+
<input
|
|
30
|
+
id="{{ dropdownBase }}-dropdown-toggle"
|
|
31
|
+
type="checkbox"
|
|
32
|
+
class="usx-misc-banner__dropdown-toggle"
|
|
33
|
+
>
|
|
34
|
+
<label
|
|
35
|
+
class="usx-misc-banner__dropdown-button"
|
|
36
|
+
for="{{ dropdownBase }}-dropdown-toggle"
|
|
37
|
+
aria-controls="{{ dropdownBase }}-dropdown"
|
|
38
|
+
aria-label="Toggle banner links"
|
|
39
|
+
>
|
|
40
|
+
<svg class="usa-icon usx-icon usa-icon--size-4" aria-hidden="true" focusable="false" role="img">
|
|
41
|
+
<use href="./img/sprite.svg#expand_more"></use>
|
|
42
|
+
</svg>
|
|
43
|
+
</label>
|
|
44
|
+
<div id="{{ dropdownBase }}-dropdown" class="usx-misc-banner__dropdown-content">
|
|
45
|
+
<ul>
|
|
46
|
+
{% if casualLinkText and casualLinkHref %}
|
|
47
|
+
<li>
|
|
48
|
+
<a class="usa-link usx-misc-banner__link" href="{{ casualLinkHref }}">{{ casualLinkText }}</a>
|
|
49
|
+
</li>
|
|
50
|
+
{% endif %}
|
|
51
|
+
{% if importantLinkText and importantLinkHref %}
|
|
52
|
+
<li>
|
|
53
|
+
<a class="usa-link usx-misc-banner__link" href="{{ importantLinkHref|default:'https://usx.solex.studio/' }}">{{ importantLinkText }}</a>
|
|
54
|
+
</li>
|
|
55
|
+
{% endif %}
|
|
56
|
+
</ul>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
{% endwith %}
|
|
60
|
+
{% endif %}
|
|
61
|
+
{% endif %}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|