@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,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '../button/Button';
|
|
3
|
+
import Search, { SearchProps } from '../search/Search';
|
|
4
|
+
|
|
5
|
+
export interface HeroButtonProps {
|
|
6
|
+
href?: string;
|
|
7
|
+
text: string;
|
|
8
|
+
onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface HeroProps extends React.HTMLAttributes<HTMLElement> {
|
|
12
|
+
title?: string;
|
|
13
|
+
callout?: string;
|
|
14
|
+
paragraph?: string;
|
|
15
|
+
button?: HeroButtonProps | null;
|
|
16
|
+
searchProps?: SearchProps | null;
|
|
17
|
+
backgroundImage?: string;
|
|
18
|
+
overlay?: boolean;
|
|
19
|
+
ariaLabel?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default function Hero({
|
|
24
|
+
title = '',
|
|
25
|
+
callout = '',
|
|
26
|
+
paragraph = '',
|
|
27
|
+
button = null,
|
|
28
|
+
searchProps = null,
|
|
29
|
+
backgroundImage = '',
|
|
30
|
+
overlay = true,
|
|
31
|
+
ariaLabel = 'Introduction',
|
|
32
|
+
className = '',
|
|
33
|
+
...props
|
|
34
|
+
}: HeroProps) {
|
|
35
|
+
const classes = [
|
|
36
|
+
'usx-hero',
|
|
37
|
+
overlay && 'usx-hero--has-overlay',
|
|
38
|
+
className,
|
|
39
|
+
].filter(Boolean).join(' ');
|
|
40
|
+
|
|
41
|
+
const style = backgroundImage
|
|
42
|
+
? { backgroundImage: `url('${backgroundImage}')` }
|
|
43
|
+
: undefined;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<section className={classes} aria-label={ariaLabel} style={style} {...props}>
|
|
47
|
+
<div className="usx-hero__inner">
|
|
48
|
+
<div className="usx-hero__callout">
|
|
49
|
+
<h1 className="usx-hero__heading">
|
|
50
|
+
{callout && <span className="usx-hero__heading--alt">{callout}</span>}
|
|
51
|
+
{title}
|
|
52
|
+
</h1>
|
|
53
|
+
{paragraph && <p className="usx-hero__paragraph">{paragraph}</p>}
|
|
54
|
+
{searchProps && <Search {...searchProps} />}
|
|
55
|
+
{!searchProps && button && (
|
|
56
|
+
<Button variant="primary" href={button.href} onClick={button.onClick}>
|
|
57
|
+
{button.text}
|
|
58
|
+
</Button>
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</section>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hero",
|
|
3
|
+
"template": "hero/hero.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"default": {
|
|
6
|
+
"title": "The hero heading",
|
|
7
|
+
"callout": "A callout heading",
|
|
8
|
+
"paragraph": "A short description of the hero section that provides context for the call to action.",
|
|
9
|
+
"button": {
|
|
10
|
+
"href": "#",
|
|
11
|
+
"text": "Call to action"
|
|
12
|
+
},
|
|
13
|
+
"backgroundImage": "https://designsystem.digital.gov/img/introducing-uswds-2-0/built-to-grow--alt.jpg",
|
|
14
|
+
"overlay": true
|
|
15
|
+
},
|
|
16
|
+
"props": {
|
|
17
|
+
"title": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The main heading text"
|
|
20
|
+
},
|
|
21
|
+
"callout": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Optional alternate heading span displayed above the main title"
|
|
24
|
+
},
|
|
25
|
+
"paragraph": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Optional body paragraph text"
|
|
28
|
+
},
|
|
29
|
+
"button": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"description": "Optional call-to-action button. Mutually exclusive with search.",
|
|
32
|
+
"properties": {
|
|
33
|
+
"href": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Button link URL"
|
|
36
|
+
},
|
|
37
|
+
"text": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Button label text"
|
|
40
|
+
},
|
|
41
|
+
"onClick": {
|
|
42
|
+
"type": "function",
|
|
43
|
+
"description": "Optional click handler for the button"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"searchProps": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"description": "Optional search form. When provided, renders a Search component instead of the button.",
|
|
50
|
+
"component": "search"
|
|
51
|
+
},
|
|
52
|
+
"backgroundImage": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "URL of the background image applied via inline style"
|
|
55
|
+
},
|
|
56
|
+
"overlay": {
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"default": true,
|
|
59
|
+
"description": "When true, adds a semi-transparent dark overlay over the background image to improve text legibility"
|
|
60
|
+
},
|
|
61
|
+
"ariaLabel": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "Accessible label for the section element (defaults to 'Introduction')"
|
|
64
|
+
},
|
|
65
|
+
"className": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "Additional CSS classes"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{# Django template for Hero #}
|
|
2
|
+
{% load components %}
|
|
3
|
+
<section
|
|
4
|
+
class="usx-hero{% if overlay != False %} usx-hero--has-overlay{% endif %}{% if className %} {{ className }}{% endif %}"
|
|
5
|
+
aria-label="{% if ariaLabel %}{{ ariaLabel }}{% else %}Introduction{% endif %}"
|
|
6
|
+
{% if backgroundImage %}style="background-image: url('{{ backgroundImage }}')"{% endif %}
|
|
7
|
+
>
|
|
8
|
+
<div class="usx-hero__inner">
|
|
9
|
+
<div class="usx-hero__callout">
|
|
10
|
+
<h1 class="usx-hero__heading">
|
|
11
|
+
{% if callout %}<span class="usx-hero__heading--alt">{{ callout }}</span>{% endif %}
|
|
12
|
+
{{ title }}
|
|
13
|
+
</h1>
|
|
14
|
+
{% if paragraph %}<p class="usx-hero__paragraph">{{ paragraph }}</p>{% endif %}
|
|
15
|
+
{% if searchProps %}
|
|
16
|
+
{% search id=searchProps.id ariaLabel=searchProps.ariaLabel searchKey=searchProps.searchKey label=searchProps.label icon=searchProps.icon iconOnly=searchProps.iconOnly buttonVariant=searchProps.buttonVariant big=searchProps.big action=searchProps.action placeholder=searchProps.placeholder defaultValue=searchProps.defaultValue onSubmit=searchProps.onSubmit className=searchProps.className|default:'' %}{% endsearch %}
|
|
17
|
+
{% elif button %}
|
|
18
|
+
{% button variant="primary" href=button.href %}{{ button.text }}{% endbutton %}
|
|
19
|
+
{% endif %}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</section>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">With search</h3>
|
|
2
|
+
<section class="usx-hero usx-hero--has-overlay" aria-label="Introduction" style="background-image: url('https://designsystem.digital.gov/img/introducing-uswds-2-0/built-to-grow--alt.jpg')">
|
|
3
|
+
<div class="usx-hero__inner">
|
|
4
|
+
<div class="usx-hero__callout">
|
|
5
|
+
<h1 class="usx-hero__heading">
|
|
6
|
+
<span class="usx-hero__heading--alt">A callout heading</span>
|
|
7
|
+
The hero heading
|
|
8
|
+
</h1>
|
|
9
|
+
<p class="usx-hero__paragraph">A short description of the hero section that provides context for the call to action.</p>
|
|
10
|
+
<section aria-label="Search">
|
|
11
|
+
<form class="usa-search usa-search--big" role="search">
|
|
12
|
+
<label class="usa-sr-only" for="hero-search-field">Search</label>
|
|
13
|
+
<input class="usa-input usx-input" id="hero-search-field" type="search" name="q" placeholder="Search..." />
|
|
14
|
+
<button class="usa-button usx-button usa-button--primary" type="submit">
|
|
15
|
+
<span class="usa-search__submit-text">Search</span>
|
|
16
|
+
</button>
|
|
17
|
+
</form>
|
|
18
|
+
</section>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</section>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<section class="usx-hero usx-hero--has-overlay" aria-label="Introduction">
|
|
25
|
+
<div class="usx-hero__inner">
|
|
26
|
+
<div class="usx-hero__callout">
|
|
27
|
+
<h1 class="usx-hero__heading">
|
|
28
|
+
<span class="usx-hero__heading--alt">A callout heading</span>
|
|
29
|
+
The hero heading
|
|
30
|
+
</h1>
|
|
31
|
+
<p class="usx-hero__paragraph">A short description of the hero section that provides context for the call to action.</p>
|
|
32
|
+
<a class="usa-button usx-button usa-button--primary" href="#">Call to action</a>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</section>
|
|
36
|
+
|
|
37
|
+
<h3 class="site-preview-heading">With background image</h3>
|
|
38
|
+
<section class="usx-hero usx-hero--has-overlay" aria-label="Introduction" style="background-image: url('https://designsystem.digital.gov/img/introducing-uswds-2-0/built-to-grow--alt.jpg')">
|
|
39
|
+
<div class="usx-hero__inner">
|
|
40
|
+
<div class="usx-hero__callout">
|
|
41
|
+
<h1 class="usx-hero__heading">
|
|
42
|
+
<span class="usx-hero__heading--alt">A callout heading</span>
|
|
43
|
+
The hero heading
|
|
44
|
+
</h1>
|
|
45
|
+
<p class="usx-hero__paragraph">A short description of the hero section that provides context for the call to action.</p>
|
|
46
|
+
<a class="usa-button usx-button usa-button--primary" href="#">Call to action</a>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</section>
|
|
50
|
+
|
|
51
|
+
<h3 class="site-preview-heading">Without callout</h3>
|
|
52
|
+
<section class="usx-hero usx-hero--has-overlay" aria-label="Introduction" style="background-image: url('https://designsystem.digital.gov/img/introducing-uswds-2-0/built-to-grow--alt.jpg')">
|
|
53
|
+
<div class="usx-hero__inner">
|
|
54
|
+
<div class="usx-hero__callout">
|
|
55
|
+
<h1 class="usx-hero__heading">
|
|
56
|
+
The hero heading
|
|
57
|
+
</h1>
|
|
58
|
+
<p class="usx-hero__paragraph">A short description of the hero section that provides context for the call to action.</p>
|
|
59
|
+
<a class="usa-button usx-button usa-button--primary " href="#">Call to action</a>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</section>
|
|
63
|
+
|
|
64
|
+
<h3 class="site-preview-heading">Without button</h3>
|
|
65
|
+
<section class="usx-hero usx-hero--has-overlay" aria-label="Introduction" style="background-image: url('https://designsystem.digital.gov/img/introducing-uswds-2-0/built-to-grow--alt.jpg')">
|
|
66
|
+
<div class="usx-hero__inner">
|
|
67
|
+
<div class="usx-hero__callout">
|
|
68
|
+
<h1 class="usx-hero__heading">
|
|
69
|
+
<span class="usx-hero__heading--alt">A callout heading</span>
|
|
70
|
+
The hero heading
|
|
71
|
+
</h1>
|
|
72
|
+
<p class="usx-hero__paragraph">A short description of the hero section that provides context for the call to action.</p>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</section>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import ClassNames from 'classnames';
|
|
3
|
+
|
|
4
|
+
export interface HintProps extends HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
id?: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default function Hint({
|
|
11
|
+
id,
|
|
12
|
+
children = null,
|
|
13
|
+
className = '',
|
|
14
|
+
...props
|
|
15
|
+
}: HintProps) {
|
|
16
|
+
const classes = ClassNames('usa-hint', 'usx-hint', className);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<span className={classes} {...(id ? { id } : {})} {...props}>
|
|
20
|
+
{children}
|
|
21
|
+
</span>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hint",
|
|
3
|
+
"template": "hint/hint.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"props": {
|
|
6
|
+
"id": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "Element id, referenced by the associated field's aria-describedby"
|
|
9
|
+
},
|
|
10
|
+
"children": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Inner HTML or text"
|
|
13
|
+
},
|
|
14
|
+
"className": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Additional classes"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
4
|
+
name: string;
|
|
5
|
+
source?: 'uswds' | 'usx';
|
|
6
|
+
size?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
alt?: string;
|
|
9
|
+
staticUrlPrefix?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Icon component for displaying SVG icons from a sprite.
|
|
15
|
+
*/
|
|
16
|
+
export default function Icon({
|
|
17
|
+
name,
|
|
18
|
+
source = 'uswds',
|
|
19
|
+
size = 2,
|
|
20
|
+
color,
|
|
21
|
+
alt = name + ' icon',
|
|
22
|
+
staticUrlPrefix = ((typeof window !== 'undefined' && (window as unknown as { usxBaseUrl?: string }).usxBaseUrl) || '/') +
|
|
23
|
+
'img/' + (source === 'usx' ? 'usx-sprite.svg' : 'sprite.svg') + '#',
|
|
24
|
+
className = '',
|
|
25
|
+
...props
|
|
26
|
+
}: IconProps) {
|
|
27
|
+
return (
|
|
28
|
+
<svg
|
|
29
|
+
className={
|
|
30
|
+
'usa-icon ' +
|
|
31
|
+
(size ? (size === 1 ? 'usx-icon--size-1' : 'usa-icon--size-' + size) : '') +
|
|
32
|
+
' ' +
|
|
33
|
+
(color ? 'text-' + color : '') +
|
|
34
|
+
' ' +
|
|
35
|
+
className
|
|
36
|
+
}
|
|
37
|
+
aria-hidden="true"
|
|
38
|
+
aria-label={alt}
|
|
39
|
+
focusable="false"
|
|
40
|
+
role="img"
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
<use href={staticUrlPrefix + name} />
|
|
44
|
+
</svg>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "icon",
|
|
3
|
+
"template": "icon/icon.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"props": {
|
|
6
|
+
"name": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"default": "accessibility_new",
|
|
9
|
+
"description": "The name of the icon to be displayed, which corresponds to the icon's identifier in the sprite sheet or icon library being used."
|
|
10
|
+
},
|
|
11
|
+
"source": {
|
|
12
|
+
"type": "select",
|
|
13
|
+
"options": ["uswds", "usx"],
|
|
14
|
+
"default": "uswds",
|
|
15
|
+
"description": "Which icon sprite to look up `name` in: USWDS's own icon set, or USX's custom icon set (for icons USWDS doesn't ship, e.g. spinner)."
|
|
16
|
+
},
|
|
17
|
+
"size": {
|
|
18
|
+
"type": "select",
|
|
19
|
+
"options": [
|
|
20
|
+
null,
|
|
21
|
+
1,
|
|
22
|
+
2,
|
|
23
|
+
3,
|
|
24
|
+
4,
|
|
25
|
+
5,
|
|
26
|
+
6,
|
|
27
|
+
7,
|
|
28
|
+
8,
|
|
29
|
+
9
|
|
30
|
+
],
|
|
31
|
+
"default": null,
|
|
32
|
+
"description": "The size of the icon, which can be specified as a predefined value corresponding to specific dimensions or as a custom value to allow for more flexible sizing."
|
|
33
|
+
},
|
|
34
|
+
"color": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"default": null,
|
|
37
|
+
"description": "The color of the icon, which can be specified using a color name, hex code, RGB value, or any other valid CSS color format to customize the appearance of the icon."
|
|
38
|
+
},
|
|
39
|
+
"staticUrlPrefix": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"default": "/img/sprite.svg#",
|
|
42
|
+
"description": "The URL prefix for the static assets, which is used to construct the full URL for the icon sprite sheet or icon library being used."
|
|
43
|
+
},
|
|
44
|
+
"className": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"default": "",
|
|
47
|
+
"description": "Additional CSS classes to apply to the icon component."
|
|
48
|
+
},
|
|
49
|
+
"alt": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"default": "",
|
|
52
|
+
"description": "Alternative text for the icon, used for accessibility purposes to provide a textual description of the icon's meaning or function."
|
|
53
|
+
},
|
|
54
|
+
"style": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"default": "",
|
|
57
|
+
"description": "Inline styles to apply to the icon component."
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{% load static %}
|
|
2
|
+
|
|
3
|
+
<svg
|
|
4
|
+
class="
|
|
5
|
+
usa-icon
|
|
6
|
+
{% if size %}
|
|
7
|
+
{% if size == 1 %}
|
|
8
|
+
usx-icon--size-1
|
|
9
|
+
{% else %}
|
|
10
|
+
usa-icon--size-{{ size }}
|
|
11
|
+
{% endif %}
|
|
12
|
+
{% endif %}
|
|
13
|
+
{% if className %}{{ className }}{% endif %}
|
|
14
|
+
{% if color %}text-{{ color }}{% endif %}
|
|
15
|
+
"
|
|
16
|
+
{% if style %}style="{{ style }}"{% endif %}
|
|
17
|
+
aria-hidden="true"
|
|
18
|
+
focusable="false"
|
|
19
|
+
role="img"
|
|
20
|
+
>
|
|
21
|
+
{% if source == 'usx' %}
|
|
22
|
+
<use href="{% static 'img/usx-sprite.svg' %}#{{ name }}"></use>
|
|
23
|
+
{% else %}
|
|
24
|
+
<use href="{% static 'img/sprite.svg' %}#{{ name }}"></use>
|
|
25
|
+
{% endif %}
|
|
26
|
+
</svg>
|