@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,45 @@
|
|
|
1
|
+
<div
|
|
2
|
+
class="
|
|
3
|
+
usa-alert
|
|
4
|
+
usa-alert--{{ variant }}
|
|
5
|
+
usx-alert usx-alert--{{ variant }}
|
|
6
|
+
{% if slim %} usa-alert--slim usx-alert--slim{% endif %}
|
|
7
|
+
{% if noIcon %} usa-alert--no-icon usx-alert--no-icon{% endif %}
|
|
8
|
+
"
|
|
9
|
+
{% if role %}
|
|
10
|
+
role="{{ role }}"
|
|
11
|
+
{% elif variant == 'error' or variant == 'emergency' %}
|
|
12
|
+
role="alert"
|
|
13
|
+
{% elif variant == 'success' %}
|
|
14
|
+
role="status"
|
|
15
|
+
{% else %}
|
|
16
|
+
role="region"
|
|
17
|
+
{% endif %}
|
|
18
|
+
{% if ariaLabelledby %}
|
|
19
|
+
aria-labelledby="{{ ariaLabelledby }}"
|
|
20
|
+
{% elif ariaLabel %}
|
|
21
|
+
aria-label="{{ ariaLabel }}"
|
|
22
|
+
{% elif variant == 'info' or variant == 'warning' %}
|
|
23
|
+
aria-label="{{ heading }}"
|
|
24
|
+
{% endif %}
|
|
25
|
+
>
|
|
26
|
+
<div class="usa-alert__body usx-alert__body">
|
|
27
|
+
{% if heading and not slim %}
|
|
28
|
+
<h4 class="usa-alert__heading usx-alert__heading">{{ heading }}</h4>
|
|
29
|
+
{% endif %}
|
|
30
|
+
{% if children %}
|
|
31
|
+
<div class="usa-alert__text usx-alert__text">
|
|
32
|
+
{{ children|safe }}
|
|
33
|
+
</div>
|
|
34
|
+
{% elif text %}
|
|
35
|
+
<p class="usa-alert__text usx-alert__text">{{ text }}</p>
|
|
36
|
+
{% endif %}
|
|
37
|
+
{% if onDismiss %}
|
|
38
|
+
<button class="usx-alert__dismiss" aria-label="Dismiss alert" onclick="{{ onDismiss }}">
|
|
39
|
+
<svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
|
|
40
|
+
<use href="./img/sprite.svg#close"></use>
|
|
41
|
+
</svg>
|
|
42
|
+
</button>
|
|
43
|
+
{% endif %}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">Standard alerts</h3>
|
|
2
|
+
|
|
3
|
+
<div class="usa-alert usa-alert--info usx-alert usx-alert--info">
|
|
4
|
+
<div class="usa-alert__body usx-alert__body">
|
|
5
|
+
<h4 class="usa-alert__heading usx-alert__heading">Informative status</h4>
|
|
6
|
+
<p class="usa-alert__text usx-alert__text">
|
|
7
|
+
Lorem ipsum dolor sit amet,
|
|
8
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
9
|
+
elit, sed do eiusmod.
|
|
10
|
+
</p>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div class="usa-alert usa-alert--warning usx-alert usx-alert--warning">
|
|
15
|
+
<div class="usa-alert__body usx-alert__body">
|
|
16
|
+
<h4 class="usa-alert__heading usx-alert__heading">Warning status</h4>
|
|
17
|
+
<p class="usa-alert__text usx-alert__text">
|
|
18
|
+
Lorem ipsum dolor sit amet,
|
|
19
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
20
|
+
elit, sed do eiusmod.
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div class="usa-alert usa-alert--success usx-alert usx-alert--success">
|
|
26
|
+
<div class="usa-alert__body usx-alert__body">
|
|
27
|
+
<h4 class="usa-alert__heading usx-alert__heading">Success status</h4>
|
|
28
|
+
<p class="usa-alert__text usx-alert__text">
|
|
29
|
+
Lorem ipsum dolor sit amet,
|
|
30
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
31
|
+
elit, sed do eiusmod.
|
|
32
|
+
</p>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="usa-alert usa-alert--error usx-alert usx-alert--error" role="alert">
|
|
37
|
+
<div class="usa-alert__body usx-alert__body">
|
|
38
|
+
<h4 class="usa-alert__heading usx-alert__heading">Error status</h4>
|
|
39
|
+
<p class="usa-alert__text usx-alert__text">
|
|
40
|
+
Lorem ipsum dolor sit amet,
|
|
41
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
42
|
+
elit, sed do eiusmod.
|
|
43
|
+
</p>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="usa-alert usa-alert--emergency usx-alert usx-alert--emergency" role="alert">
|
|
48
|
+
<div class="usa-alert__body usx-alert__body">
|
|
49
|
+
<h4 class="usa-alert__heading usx-alert__heading">Emergency status</h4>
|
|
50
|
+
<p class="usa-alert__text usx-alert__text">
|
|
51
|
+
Lorem ipsum dolor sit amet,
|
|
52
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
53
|
+
elit, sed do eiusmod.
|
|
54
|
+
</p>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<h3 class="site-preview-heading">Slim alert</h3>
|
|
59
|
+
|
|
60
|
+
<div class="usa-alert usa-alert--info usa-alert--slim usx-alert usx-alert--info usx-alert--slim">
|
|
61
|
+
<div class="usa-alert__body usx-alert__body">
|
|
62
|
+
<p class="usa-alert__text usx-alert__text">
|
|
63
|
+
Lorem ipsum dolor sit amet,
|
|
64
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
65
|
+
elit, sed do eiusmod.
|
|
66
|
+
</p>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<h3 class="site-preview-heading">Alert with no icon</h3>
|
|
71
|
+
|
|
72
|
+
<div class="usa-alert usa-alert--info usa-alert--no-icon usx-alert usx-alert--info usx-alert--no-icon">
|
|
73
|
+
<div class="usa-alert__body usx-alert__body">
|
|
74
|
+
<p class="usa-alert__text usx-alert__text">
|
|
75
|
+
Lorem ipsum dolor sit amet,
|
|
76
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
77
|
+
elit, sed do eiusmod.
|
|
78
|
+
</p>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<h3 class="site-preview-heading">Dismissible alert variants</h3>
|
|
83
|
+
<div class="usa-alert usa-alert--info usx-alert usx-alert--info" role="alert">
|
|
84
|
+
<div class="usa-alert__body usx-alert__body">
|
|
85
|
+
<h4 class="usa-alert__heading usx-alert__heading">Dismissible alert</h4>
|
|
86
|
+
<p class="usa-alert__text usx-alert__text">
|
|
87
|
+
Lorem ipsum dolor sit amet,
|
|
88
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
89
|
+
elit, sed do eiusmod.
|
|
90
|
+
</p>
|
|
91
|
+
<button class="usx-alert__dismiss" aria-label="Dismiss alert" onclick="this.closest('.usa-alert').remove();">
|
|
92
|
+
<svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
|
|
93
|
+
<use href="./img/sprite.svg#close"></use>
|
|
94
|
+
</svg>
|
|
95
|
+
</button>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div class="usa-alert usa-alert--warning usx-alert usx-alert--warning" role="alert">
|
|
100
|
+
<div class="usa-alert__body usx-alert__body">
|
|
101
|
+
<h4 class="usa-alert__heading usx-alert__heading">Dismissible warning alert</h4>
|
|
102
|
+
<p class="usa-alert__text usx-alert__text">
|
|
103
|
+
Lorem ipsum dolor sit amet,
|
|
104
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
105
|
+
elit, sed do eiusmod.
|
|
106
|
+
</p>
|
|
107
|
+
<button class="usx-alert__dismiss" aria-label="Dismiss alert" onclick="this.closest('.usa-alert').remove();">
|
|
108
|
+
<svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
|
|
109
|
+
<use href="./img/sprite.svg#close"></use>
|
|
110
|
+
</svg>
|
|
111
|
+
</button>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div class="usa-alert usa-alert--success usx-alert usx-alert--success" role="alert">
|
|
116
|
+
<div class="usa-alert__body usx-alert__body">
|
|
117
|
+
<h4 class="usa-alert__heading usx-alert__heading">Dismissible success alert</h4>
|
|
118
|
+
<p class="usa-alert__text usx-alert__text">
|
|
119
|
+
Lorem ipsum dolor sit amet,
|
|
120
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
121
|
+
elit, sed do eiusmod.
|
|
122
|
+
</p>
|
|
123
|
+
<button class="usx-alert__dismiss" aria-label="Dismiss alert" onclick="this.closest('.usa-alert').remove();">
|
|
124
|
+
<svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
|
|
125
|
+
<use href="./img/sprite.svg#close"></use>
|
|
126
|
+
</svg>
|
|
127
|
+
</button>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div class="usa-alert usa-alert--error usx-alert usx-alert--error" role="alert">
|
|
132
|
+
<div class="usa-alert__body usx-alert__body">
|
|
133
|
+
<h4 class="usa-alert__heading usx-alert__heading">Dismissible error alert</h4>
|
|
134
|
+
<p class="usa-alert__text usx-alert__text">
|
|
135
|
+
Lorem ipsum dolor sit amet,
|
|
136
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
137
|
+
elit, sed do eiusmod.
|
|
138
|
+
</p>
|
|
139
|
+
<button class="usx-alert__dismiss" aria-label="Dismiss alert" onclick="this.closest('.usa-alert').remove();">
|
|
140
|
+
<svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
|
|
141
|
+
<use href="./img/sprite.svg#close"></use>
|
|
142
|
+
</svg>
|
|
143
|
+
</button>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div class="usa-alert usa-alert--emergency usx-alert usx-alert--emergency" role="alert">
|
|
148
|
+
<div class="usa-alert__body usx-alert__body">
|
|
149
|
+
<h4 class="usa-alert__heading usx-alert__heading">Dismissible emergency alert</h4>
|
|
150
|
+
<p class="usa-alert__text usx-alert__text">
|
|
151
|
+
Lorem ipsum dolor sit amet,
|
|
152
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
153
|
+
elit, sed do eiusmod.
|
|
154
|
+
</p>
|
|
155
|
+
<button class="usx-alert__dismiss" aria-label="Dismiss alert" onclick="this.closest('.usa-alert').remove();">
|
|
156
|
+
<svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
|
|
157
|
+
<use href="./img/sprite.svg#close"></use>
|
|
158
|
+
</svg>
|
|
159
|
+
</button>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<div class="usa-alert usa-alert--info usa-alert--slim usx-alert usx-alert--info usx-alert--slim" role="alert">
|
|
164
|
+
<div class="usa-alert__body usx-alert__body">
|
|
165
|
+
<p class="usa-alert__text usx-alert__text">
|
|
166
|
+
Lorem ipsum dolor sit amet,
|
|
167
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
168
|
+
elit, sed do eiusmod.
|
|
169
|
+
</p>
|
|
170
|
+
<button class="usx-alert__dismiss" aria-label="Dismiss alert" onclick="this.closest('.usa-alert').remove();">
|
|
171
|
+
<svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
|
|
172
|
+
<use href="./img/sprite.svg#close"></use>
|
|
173
|
+
</svg>
|
|
174
|
+
</button>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<div class="usa-alert usa-alert--info usa-alert--slim usa-alert--no-icon usx-alert usx-alert--info usx-alert--no-icon"
|
|
179
|
+
role="alert">
|
|
180
|
+
<div class="usa-alert__body usx-alert__body">
|
|
181
|
+
<p class="usa-alert__text usx-alert__text">
|
|
182
|
+
Lorem ipsum dolor sit amet,
|
|
183
|
+
<a class="usa-link" href="javascript:void(0);">consectetur adipiscing</a>
|
|
184
|
+
elit, sed do eiusmod.
|
|
185
|
+
</p>
|
|
186
|
+
<button class="usx-alert__dismiss" aria-label="Dismiss alert" onclick="this.closest('.usa-alert').remove();">
|
|
187
|
+
<svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
|
|
188
|
+
<use href="./img/sprite.svg#close"></use>
|
|
189
|
+
</svg>
|
|
190
|
+
</button>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "alert",
|
|
3
|
+
"template": "alert/alert.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"props": {
|
|
6
|
+
"heading": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "The heading of the alert, which provides a brief summary of the alert's content."
|
|
9
|
+
},
|
|
10
|
+
"text": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "The main content of the alert, providing detailed information about the alert."
|
|
13
|
+
},
|
|
14
|
+
"variant": {
|
|
15
|
+
"type": "select",
|
|
16
|
+
"options": [
|
|
17
|
+
"info",
|
|
18
|
+
"success",
|
|
19
|
+
"warning",
|
|
20
|
+
"error",
|
|
21
|
+
"emergency"
|
|
22
|
+
],
|
|
23
|
+
"description": "The visual style of the alert, indicating the type of message being conveyed."
|
|
24
|
+
},
|
|
25
|
+
"slim": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"description": "A boolean that determines whether the alert should be displayed in a more compact, slim style.",
|
|
28
|
+
"default": false
|
|
29
|
+
},
|
|
30
|
+
"noIcon": {
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"description": "A boolean that determines whether the alert should be displayed without an icon.",
|
|
33
|
+
"default": false
|
|
34
|
+
},
|
|
35
|
+
"className": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "Additional CSS classes to apply to the alert component."
|
|
38
|
+
},
|
|
39
|
+
"style": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Inline styles to apply to the alert component."
|
|
42
|
+
},
|
|
43
|
+
"role": {
|
|
44
|
+
"type": "select",
|
|
45
|
+
"options": [
|
|
46
|
+
"",
|
|
47
|
+
"alert",
|
|
48
|
+
"status",
|
|
49
|
+
"region"
|
|
50
|
+
],
|
|
51
|
+
"description": "Optional ARIA role override. Defaults by variant: error/emergency -> alert, success -> status, info/warning -> region."
|
|
52
|
+
},
|
|
53
|
+
"ariaLabel": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "Accessible label used when needed (especially for role=region)."
|
|
56
|
+
},
|
|
57
|
+
"ariaLabelledby": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "ID reference to a labeling element. Takes precedence over ariaLabel."
|
|
60
|
+
},
|
|
61
|
+
"onDismiss": {
|
|
62
|
+
"type": "function",
|
|
63
|
+
"description": "Optional callback function that, if provided, makes the alert dismissible and is called when the alert is dismissed."
|
|
64
|
+
},
|
|
65
|
+
"children": {
|
|
66
|
+
"type": "slot",
|
|
67
|
+
"description": "Alert rich content (React node / HTML string). If provided, this content will be rendered instead of the `heading` and `text` props."
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import Avatar, { AvatarProps } from '../avatar/Avatar';
|
|
4
|
+
|
|
5
|
+
export interface AttributionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
avatarProps?: AvatarProps | null;
|
|
7
|
+
media?: React.ReactNode | null;
|
|
8
|
+
primary?: React.ReactNode;
|
|
9
|
+
secondary?: React.ReactNode;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function Attribution({
|
|
15
|
+
avatarProps = null,
|
|
16
|
+
media = null,
|
|
17
|
+
primary,
|
|
18
|
+
secondary,
|
|
19
|
+
children = null,
|
|
20
|
+
className = '',
|
|
21
|
+
...props
|
|
22
|
+
}: AttributionProps) {
|
|
23
|
+
const classes = classNames('usx-attribution', className);
|
|
24
|
+
const mediaContent = avatarProps ? <Avatar {...avatarProps} /> : media;
|
|
25
|
+
const content = children ?? (
|
|
26
|
+
<>
|
|
27
|
+
{mediaContent && <span className="usx-attribution__media">{mediaContent}</span>}
|
|
28
|
+
<span className="usx-attribution__content">
|
|
29
|
+
<span className="usx-attribution__primary">{primary}</span>
|
|
30
|
+
<span className="usx-attribution__secondary">{secondary}</span>
|
|
31
|
+
</span>
|
|
32
|
+
</>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div className={classes} {...props}>
|
|
37
|
+
{content}
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{# Django template for Attribution #}
|
|
2
|
+
{% load components %}
|
|
3
|
+
<div class="usx-attribution{% if className %} {{ className }}{% endif %}">
|
|
4
|
+
{% if children %}
|
|
5
|
+
{{ children|safe }}
|
|
6
|
+
{% else %}
|
|
7
|
+
{% if avatarProps or media %}
|
|
8
|
+
<span class="usx-attribution__media">
|
|
9
|
+
{% if avatarProps %}
|
|
10
|
+
{% avatar href=avatarProps.href src=avatarProps.src alt=avatarProps.alt variant=avatarProps.variant value=avatarProps.value shape=avatarProps.shape tooltip=avatarProps.tooltip className=avatarProps.className imageClassName=avatarProps.imageClassName contentClassName=avatarProps.contentClassName %}{% endavatar %}
|
|
11
|
+
{% else %}
|
|
12
|
+
{{ media|safe }}
|
|
13
|
+
{% endif %}
|
|
14
|
+
</span>
|
|
15
|
+
{% endif %}
|
|
16
|
+
<span class="usx-attribution__content">
|
|
17
|
+
<span class="usx-attribution__primary">{{ primary|safe }}</span>
|
|
18
|
+
<span class="usx-attribution__secondary">{{ secondary|safe }}</span>
|
|
19
|
+
</span>
|
|
20
|
+
{% endif %}
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">Attribution with avatar</h3>
|
|
2
|
+
<div class="usx-attribution">
|
|
3
|
+
<a href="#" class="usx-attribution__media usx-avatar" aria-label="George Washington">
|
|
4
|
+
<img
|
|
5
|
+
class="usx-avatar__img usx-circle"
|
|
6
|
+
src="./george_washington.png"
|
|
7
|
+
alt="George Washington"
|
|
8
|
+
role="img"
|
|
9
|
+
/>
|
|
10
|
+
</a>
|
|
11
|
+
<span class="usx-attribution__content">
|
|
12
|
+
<span class="usx-attribution__primary">George Washington</span>
|
|
13
|
+
<span class="usx-attribution__secondary">First President of the United States</span>
|
|
14
|
+
</span>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<h3 class="site-preview-heading">Attribution with initials</h3>
|
|
18
|
+
<div class="usx-attribution">
|
|
19
|
+
<a href="#" class="usx-attribution__media usx-avatar usx-avatar--initials" aria-label="Alex Brown">
|
|
20
|
+
<span class="usx-avatar__initials usx-circle bg-primary-lighter text-primary-darker">AB</span>
|
|
21
|
+
</a>
|
|
22
|
+
<span class="usx-attribution__content">
|
|
23
|
+
<span class="usx-attribution__primary">Alex Brown</span>
|
|
24
|
+
<span class="usx-attribution__secondary">Case manager</span>
|
|
25
|
+
</span>
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "attribution",
|
|
3
|
+
"template": "attribution/attribution.django.html",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"props": {
|
|
6
|
+
"avatarProps": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"description": "Avatar component props object. When provided, Attribution renders the Avatar component in the media slot.",
|
|
9
|
+
"component": "avatar"
|
|
10
|
+
},
|
|
11
|
+
"media": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "HTML for the left media area (avatar image or initials badge)."
|
|
14
|
+
},
|
|
15
|
+
"primary": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Primary text shown in the top-right cell."
|
|
18
|
+
},
|
|
19
|
+
"secondary": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Secondary text shown in the bottom-right cell."
|
|
22
|
+
},
|
|
23
|
+
"children": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Optional full custom markup. When provided, it overrides media/primary/secondary."
|
|
26
|
+
},
|
|
27
|
+
"className": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Additional classes"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import Icon from '../icon/Icon.jsx';
|
|
4
|
+
|
|
5
|
+
const shapeClassMap = {
|
|
6
|
+
circle: 'usx-circle',
|
|
7
|
+
'rounded-sm': 'usx-rounded-sm',
|
|
8
|
+
'rounded-md': 'usx-rounded-md',
|
|
9
|
+
'rounded-lg': 'usx-rounded-lg',
|
|
10
|
+
'rounded-xl': 'usx-rounded-xl',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export interface AvatarProps extends React.HTMLAttributes<HTMLAnchorElement> {
|
|
14
|
+
href?: string;
|
|
15
|
+
src?: string | null;
|
|
16
|
+
alt?: string | null;
|
|
17
|
+
variant?: 'image' | 'initials' | 'icon';
|
|
18
|
+
value?: string | null;
|
|
19
|
+
shape?: null | 'circle' | 'rounded-sm' | 'rounded-md' | 'rounded-lg' | 'rounded-xl';
|
|
20
|
+
tooltip?: string | null;
|
|
21
|
+
className?: string;
|
|
22
|
+
imageClassName?: string;
|
|
23
|
+
contentClassName?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default function Avatar({
|
|
27
|
+
href = '#',
|
|
28
|
+
src = null,
|
|
29
|
+
alt = null,
|
|
30
|
+
variant = 'image',
|
|
31
|
+
value = null,
|
|
32
|
+
shape = null,
|
|
33
|
+
tooltip = null,
|
|
34
|
+
className = '',
|
|
35
|
+
imageClassName = '',
|
|
36
|
+
contentClassName = '',
|
|
37
|
+
...props
|
|
38
|
+
}: AvatarProps) {
|
|
39
|
+
const isInitialsVariant = variant === 'initials';
|
|
40
|
+
const isIconVariant = variant === 'icon';
|
|
41
|
+
|
|
42
|
+
const wrapperClasses = classNames(
|
|
43
|
+
'usx-avatar',
|
|
44
|
+
className,
|
|
45
|
+
);
|
|
46
|
+
const imgClasses = classNames(
|
|
47
|
+
'usx-avatar__img',
|
|
48
|
+
shape ? shapeClassMap[shape] : null,
|
|
49
|
+
imageClassName,
|
|
50
|
+
);
|
|
51
|
+
const contentClasses = classNames(
|
|
52
|
+
'usx-avatar__content',
|
|
53
|
+
shape ? shapeClassMap[shape] : 'usx-circle',
|
|
54
|
+
contentClassName,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const avatarContent = isInitialsVariant
|
|
58
|
+
? <span className={contentClasses}>{value}</span>
|
|
59
|
+
: isIconVariant
|
|
60
|
+
? (
|
|
61
|
+
<span className={contentClasses}>
|
|
62
|
+
<Icon name={value as string} alt={alt || `${value} icon`} />
|
|
63
|
+
</span>
|
|
64
|
+
)
|
|
65
|
+
: <img className={imgClasses} src={src || undefined} alt={alt || undefined} role="img" {...props} />;
|
|
66
|
+
|
|
67
|
+
const avatar = (
|
|
68
|
+
<a href={href} className={wrapperClasses} aria-label={(isInitialsVariant || isIconVariant) ? alt || undefined : undefined}>
|
|
69
|
+
{avatarContent}
|
|
70
|
+
</a>
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
if (tooltip) {
|
|
74
|
+
return (
|
|
75
|
+
<span className="usx-tooltip">
|
|
76
|
+
{avatar}
|
|
77
|
+
<span className="usa-tooltip__body usa-tooltip__body--right" role="tooltip">{tooltip}</span>
|
|
78
|
+
</span>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
avatar
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{# Django template for Avatar #}
|
|
2
|
+
|
|
3
|
+
{% load components %}
|
|
4
|
+
|
|
5
|
+
{% if tooltip %}
|
|
6
|
+
<span class="usx-tooltip">
|
|
7
|
+
{% endif %}
|
|
8
|
+
|
|
9
|
+
<a href="{{ href|default:'#' }}" class="usx-avatar{% if className %} {{ className }}{% endif %}"{% if variant != 'image' and alt %} aria-label="{{ alt }}"{% endif %}>
|
|
10
|
+
{% if variant == 'initials' %}
|
|
11
|
+
<span class="usx-avatar__content{% if shape == 'circle' %} usx-circle{% elif shape == 'rounded-sm' %} usx-rounded-sm{% elif shape == 'rounded-md' %} usx-rounded-md{% elif shape == 'rounded-lg' %} usx-rounded-lg{% elif shape == 'rounded-xl' %} usx-rounded-xl{% else %} usx-circle{% endif %}{% if contentClassName %} {{ contentClassName }}{% endif %}">{{ value }}</span>
|
|
12
|
+
{% elif variant == 'icon' %}
|
|
13
|
+
<span class="usx-avatar__content{% if shape == 'circle' %} usx-circle{% elif shape == 'rounded-sm' %} usx-rounded-sm{% elif shape == 'rounded-md' %} usx-rounded-md{% elif shape == 'rounded-lg' %} usx-rounded-lg{% elif shape == 'rounded-xl' %} usx-rounded-xl{% else %} usx-circle{% endif %}{% if contentClassName %} {{ contentClassName }}{% endif %}">{% icon name=value %}{% endicon %}</span>
|
|
14
|
+
{% else %}
|
|
15
|
+
<img
|
|
16
|
+
class="usx-avatar__img{% if shape == 'circle' %} usx-circle{% elif shape == 'rounded-sm' %} usx-rounded-sm{% elif shape == 'rounded-md' %} usx-rounded-md{% elif shape == 'rounded-lg' %} usx-rounded-lg{% elif shape == 'rounded-xl' %} usx-rounded-xl{% endif %}{% if imageClassName %} {{ imageClassName }}{% endif %}"
|
|
17
|
+
src="{{ src }}"
|
|
18
|
+
alt="{{ alt }}"
|
|
19
|
+
role="img"
|
|
20
|
+
/>
|
|
21
|
+
{% endif %}
|
|
22
|
+
</a>
|
|
23
|
+
|
|
24
|
+
{% if tooltip %}
|
|
25
|
+
<span class="usa-tooltip__body usa-tooltip__body--right" role="tooltip">{{ tooltip }}</span>
|
|
26
|
+
</span>
|
|
27
|
+
{% endif %}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">Basic Avatar</h3>
|
|
2
|
+
<a href="https://google.com/search?q=Statue+of+Liberty" class="usx-avatar"
|
|
3
|
+
><img
|
|
4
|
+
class="usx-avatar__img"
|
|
5
|
+
src="./lady_liberty.png"
|
|
6
|
+
alt="Statue of Liberty"
|
|
7
|
+
role="img"
|
|
8
|
+
/></a>
|
|
9
|
+
|
|
10
|
+
<h3 class="site-preview-heading">Circle Avatar</h3>
|
|
11
|
+
<a href="https://google.com/search?q=Statue+of+Liberty" class="usx-avatar"
|
|
12
|
+
><img
|
|
13
|
+
class="usx-avatar__img usx-circle"
|
|
14
|
+
src="./lady_liberty.png"
|
|
15
|
+
alt="Statue of Liberty"
|
|
16
|
+
role="img"
|
|
17
|
+
/></a>
|
|
18
|
+
|
|
19
|
+
<h3 class="site-preview-heading">Medium Rounded Avatar</h3>
|
|
20
|
+
<a href="https://google.com/search?q=Statue+of+Liberty" class="usx-avatar"
|
|
21
|
+
><img
|
|
22
|
+
class="usx-avatar__img usx-rounded-md"
|
|
23
|
+
src="./lady_liberty.png"
|
|
24
|
+
alt="Statue of Liberty"
|
|
25
|
+
role="img"
|
|
26
|
+
/></a>
|
|
27
|
+
|
|
28
|
+
<h3 class="site-preview-heading">Large Rounded Avatar</h3>
|
|
29
|
+
<a href="https://google.com/search?q=Statue+of+Liberty" class="usx-avatar"
|
|
30
|
+
><img
|
|
31
|
+
class="usx-avatar__img usx-rounded-lg"
|
|
32
|
+
src="./lady_liberty.png"
|
|
33
|
+
alt="Statue of Liberty"
|
|
34
|
+
role="img"
|
|
35
|
+
/></a>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<h3 class="site-preview-heading">Avatar with Tooltip</h3>
|
|
40
|
+
<span class="usx-tooltip">
|
|
41
|
+
<a href="https://google.com/search?q=Statue+of+Liberty" class="usx-avatar"
|
|
42
|
+
><img
|
|
43
|
+
class="usx-avatar__img usx-rounded-lg"
|
|
44
|
+
src="./lady_liberty.png"
|
|
45
|
+
alt="Statue of Liberty"
|
|
46
|
+
role="img"
|
|
47
|
+
/></a>
|
|
48
|
+
<span class="usa-tooltip__body usa-tooltip__body--right" role="tooltip">Statue of Liberty</span>
|
|
49
|
+
</span>
|
|
50
|
+
|
|
51
|
+
<h3 class="site-preview-heading">Initials Avatar</h3>
|
|
52
|
+
<a href="#" class="usx-avatar usx-avatar--initials" aria-label="Alex Brown">
|
|
53
|
+
<span class="usx-avatar__initials usx-circle bg-primary-lighter text-primary-darker">AB</span>
|
|
54
|
+
</a>
|
|
55
|
+
|
|
56
|
+
<h3 class="site-preview-heading">Small Initials Avatar</h3>
|
|
57
|
+
<a href="#" class="usx-avatar usx-avatar--initials usx-avatar--size-sm" aria-label="George Washington">
|
|
58
|
+
<span class="usx-avatar__initials usx-circle bg-base-lightest text-base-darkest">GW</span>
|
|
59
|
+
</a>
|
|
60
|
+
|
|
61
|
+
<h3 class="site-preview-heading">Medium Image Avatar</h3>
|
|
62
|
+
<a href="https://google.com/search?q=Statue+of+Liberty" class="usx-avatar usx-avatar--size-md"
|
|
63
|
+
><img
|
|
64
|
+
class="usx-avatar__img"
|
|
65
|
+
src="./lady_liberty.png"
|
|
66
|
+
alt="Statue of Liberty"
|
|
67
|
+
role="img"
|
|
68
|
+
/></a>
|
|
69
|
+
|
|
70
|
+
<h3 class="site-preview-heading">Large Image Avatar</h3>
|
|
71
|
+
<a href="https://google.com/search?q=Statue+of+Liberty" class="usx-avatar usx-avatar--size-lg"
|
|
72
|
+
><img
|
|
73
|
+
class="usx-avatar__img"
|
|
74
|
+
src="./lady_liberty.png"
|
|
75
|
+
alt="Statue of Liberty"
|
|
76
|
+
role="img"
|
|
77
|
+
/></a>
|
|
78
|
+
|
|
79
|
+
<h3 class="site-preview-heading">Extra Large Image Avatar</h3>
|
|
80
|
+
<a href="https://google.com/search?q=Statue+of+Liberty" class="usx-avatar usx-avatar--size-xl"
|
|
81
|
+
><img
|
|
82
|
+
class="usx-avatar__img"
|
|
83
|
+
src="./lady_liberty.png"
|
|
84
|
+
alt="Statue of Liberty"
|
|
85
|
+
role="img"
|
|
86
|
+
/></a>
|
|
87
|
+
|
|
88
|
+
<h3 class="site-preview-heading">Medium Initials Avatar</h3>
|
|
89
|
+
<a href="#" class="usx-avatar usx-avatar--initials usx-avatar--size-md" aria-label="Alex Brown">
|
|
90
|
+
<span class="usx-avatar__initials usx-circle bg-primary-lighter text-primary-darker">AB</span>
|
|
91
|
+
</a>
|
|
92
|
+
|
|
93
|
+
<h3 class="site-preview-heading">Large Initials Avatar</h3>
|
|
94
|
+
<a href="#" class="usx-avatar usx-avatar--initials usx-avatar--size-lg" aria-label="Alex Brown">
|
|
95
|
+
<span class="usx-avatar__initials usx-circle bg-primary-lighter text-primary-darker">AB</span>
|
|
96
|
+
</a>
|
|
97
|
+
|
|
98
|
+
<h3 class="site-preview-heading">Extra Large Initials Avatar</h3>
|
|
99
|
+
<a href="#" class="usx-avatar usx-avatar--initials usx-avatar--size-xl" aria-label="Alex Brown">
|
|
100
|
+
<span class="usx-avatar__initials usx-circle bg-primary-lighter text-primary-darker">AB</span>
|
|
101
|
+
</a>
|