@solexllc/usx-react 0.11.0 → 1.0.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 +31 -0
- package/dist/Popover-Bg4-2-cU.cjs +987 -0
- package/dist/Popover-CqHczzNE.js +988 -0
- package/dist/chat.cjs +1396 -0
- package/dist/chat.js +1396 -0
- package/dist/index.cjs +4412 -5247
- package/dist/index.js +140 -972
- package/package.json +9 -5
- package/src/chat.js +15 -0
- package/src/components/accordion/Accordion.tsx +9 -57
- package/src/components/accordion/accordion.django.html +10 -20
- package/src/components/accordion/config.json +8 -2
- package/src/components/accordion-item/AccordionItem.tsx +54 -0
- package/src/components/accordion-item/accordion-item.django.html +19 -0
- package/src/components/accordion-item/accordion-item.html +8 -0
- package/src/components/accordion-item/config.json +55 -0
- package/src/components/alert/alert.django-snapshot.html +4 -4
- package/src/components/avatar/Avatar.tsx +54 -16
- package/src/components/avatar/avatar.django-snapshot.html +118 -2
- package/src/components/avatar/avatar.django.html +2 -2
- package/src/components/avatar/avatar.html +25 -0
- package/src/components/avatar/avatar.react-snapshot.html +110 -3
- package/src/components/avatar/config.json +17 -17
- package/src/components/avatar-group/AvatarGroup.tsx +17 -15
- package/src/components/avatar-group/avatar-group.django-snapshot.html +196 -174
- package/src/components/avatar-group/avatar-group.django.html +1 -1
- package/src/components/avatar-group/avatar-group.react-snapshot.html +216 -165
- package/src/components/avatar-group/config.json +14 -8
- package/src/components/back-to-top/BackToTop.tsx +21 -57
- package/src/components/back-to-top/back-to-top.django-snapshot.html +101 -202
- package/src/components/back-to-top/back-to-top.django.html +11 -38
- package/src/components/back-to-top/back-to-top.html +22 -106
- package/src/components/back-to-top/back-to-top.react-snapshot.html +94 -148
- package/src/components/back-to-top/config.json +41 -10
- package/src/components/banner/banner.django-snapshot.html +2 -2
- package/src/components/button/Button.tsx +15 -3
- package/src/components/button/button.django-snapshot.html +82 -0
- package/src/components/button/button.django.html +5 -2
- package/src/components/button/button.react-snapshot.html +80 -0
- package/src/components/button/config.json +17 -3
- package/src/components/callout/callout.django.html +1 -1
- package/src/components/callout/config.json +7 -16
- package/src/components/card/card.django-snapshot.html +43 -0
- package/src/components/card/card.react-snapshot.html +36 -0
- package/src/components/character-count/CharacterCount.tsx +2 -0
- package/src/components/character-count/character-count.react-snapshot.html +7 -0
- package/src/components/chat/Chat.tsx +575 -0
- package/src/components/chat/README.md +174 -0
- package/src/components/chat/avatarProps.ts +32 -0
- package/src/components/chat/chat.django-snapshot.html +23579 -0
- package/src/components/chat/chat.django.html +75 -0
- package/src/components/chat/chat.html +116 -0
- package/src/components/chat/chat.react-snapshot.html +16895 -0
- package/src/components/chat/config.json +1241 -0
- package/src/components/chat-attachment/ChatAttachment.tsx +39 -0
- package/src/components/chat-attachment/chat-attachment.django.html +24 -0
- package/src/components/chat-attachment/chat-attachment.html +10 -0
- package/src/components/chat-attachment/config.json +27 -0
- package/src/components/chat-attachments/ChatAttachments.tsx +17 -0
- package/src/components/chat-attachments/chat-attachments.django-snapshot.html +58 -0
- package/src/components/chat-attachments/chat-attachments.django.html +10 -0
- package/src/components/chat-attachments/chat-attachments.html +14 -0
- package/src/components/chat-attachments/chat-attachments.react-snapshot.html +46 -0
- package/src/components/chat-attachments/config.json +25 -0
- package/src/components/chat-bubble/ChatBubble.tsx +39 -0
- package/src/components/chat-bubble/ChatFormattedText.tsx +138 -0
- package/src/components/chat-bubble/chat-bubble.django-snapshot.html +128 -0
- package/src/components/chat-bubble/chat-bubble.django.html +19 -0
- package/src/components/chat-bubble/chat-bubble.html +1 -0
- package/src/components/chat-bubble/chat-bubble.react-snapshot.html +118 -0
- package/src/components/chat-bubble/config.json +70 -0
- package/src/components/chat-composer/ChatComposer.tsx +213 -0
- package/src/components/chat-composer/README.md +15 -0
- package/src/components/chat-composer/chat-composer.django-snapshot.html +575 -0
- package/src/components/chat-composer/chat-composer.django.html +77 -0
- package/src/components/chat-composer/chat-composer.html +44 -0
- package/src/components/chat-composer/chat-composer.react-snapshot.html +519 -0
- package/src/components/chat-composer/chat-formatting.django.html +59 -0
- package/src/components/chat-composer/config.json +137 -0
- package/src/components/chat-context/ChatContext.tsx +46 -0
- package/src/components/chat-context/chat-context.django-snapshot.html +35 -0
- package/src/components/chat-context/chat-context.django.html +20 -0
- package/src/components/chat-context/chat-context.html +9 -0
- package/src/components/chat-context/chat-context.react-snapshot.html +30 -0
- package/src/components/chat-context/config.json +36 -0
- package/src/components/chat-controls/ChatControls.tsx +67 -0
- package/src/components/chat-controls/chat-controls.django-snapshot.html +114 -0
- package/src/components/chat-controls/chat-controls.django.html +36 -0
- package/src/components/chat-controls/chat-controls.html +11 -0
- package/src/components/chat-controls/chat-controls.react-snapshot.html +107 -0
- package/src/components/chat-controls/config.json +67 -0
- package/src/components/chat-directory/ChatDirectory.tsx +168 -0
- package/src/components/chat-directory/chat-directory.django-snapshot.html +546 -0
- package/src/components/chat-directory/chat-directory.django.html +14 -0
- package/src/components/chat-directory/chat-directory.html +4 -0
- package/src/components/chat-directory/chat-directory.react-snapshot.html +471 -0
- package/src/components/chat-directory/config.json +242 -0
- package/src/components/chat-directory-item/ChatDirectoryItem.tsx +150 -0
- package/src/components/chat-directory-item/chat-directory-item.django-snapshot.html +281 -0
- package/src/components/chat-directory-item/chat-directory-item.django.html +38 -0
- package/src/components/chat-directory-item/chat-directory-item.html +9 -0
- package/src/components/chat-directory-item/chat-directory-item.react-snapshot.html +249 -0
- package/src/components/chat-directory-item/config.json +103 -0
- package/src/components/chat-history/ChatHistory.tsx +30 -0
- package/src/components/chat-history/chat-history.django-snapshot.html +113 -0
- package/src/components/chat-history/chat-history.django.html +20 -0
- package/src/components/chat-history/chat-history.html +9 -0
- package/src/components/chat-history/chat-history.react-snapshot.html +111 -0
- package/src/components/chat-history/config.json +24 -0
- package/src/components/chat-message/ChatMessage.tsx +148 -0
- package/src/components/chat-message/chat-message.django-snapshot.html +758 -0
- package/src/components/chat-message/chat-message.django.html +56 -0
- package/src/components/chat-message/chat-message.html +12 -0
- package/src/components/chat-message/chat-message.react-snapshot.html +627 -0
- package/src/components/chat-message/config.json +278 -0
- package/src/components/chat-message-actions/ChatMessageActions.tsx +133 -0
- package/src/components/chat-message-actions/chat-message-actions.django-snapshot.html +345 -0
- package/src/components/chat-message-actions/chat-message-actions.django.html +29 -0
- package/src/components/chat-message-actions/chat-message-actions.html +53 -0
- package/src/components/chat-message-actions/chat-message-actions.react-snapshot.html +295 -0
- package/src/components/chat-message-actions/config.json +121 -0
- package/src/components/chat-window/ChatWindow.tsx +135 -0
- package/src/components/chat-window/chat-window.django-snapshot.html +450 -0
- package/src/components/chat-window/chat-window.django.html +39 -0
- package/src/components/chat-window/chat-window.html +26 -0
- package/src/components/chat-window/chat-window.react-snapshot.html +286 -0
- package/src/components/chat-window/config.json +123 -0
- package/src/components/checkbox/checkbox.django-snapshot.html +2 -2
- package/src/components/clickable/Clickable.tsx +19 -5
- package/src/components/clickable/clickable.django-snapshot.html +11 -2
- package/src/components/clickable/clickable.django.html +2 -0
- package/src/components/clickable/clickable.react-snapshot.html +10 -2
- package/src/components/clickable/config.json +4 -0
- package/src/components/code/code.django-snapshot.html +25 -18
- package/src/components/code/code.react-snapshot.html +41 -4
- package/src/components/copy-to-clipboard/CopyToClipboard.tsx +2 -7
- package/src/components/copy-to-clipboard/copy-to-clipboard.django-snapshot.html +6 -4
- package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +3 -2
- package/src/components/copy-to-clipboard/copy-to-clipboard.react-snapshot.html +14 -2
- package/src/components/data-table/data-table.django-snapshot.html +4 -5
- package/src/components/data-table/data-table.react-snapshot.html +4 -4
- package/src/components/drawer/drawer.django-snapshot.html +53 -30
- package/src/components/error-page/error-page.django-snapshot.html +20 -7
- package/src/components/fieldset/fieldset.django-snapshot.html +1 -6
- package/src/components/file-list/FileList.tsx +3 -2
- package/src/components/file-list/config.json +5 -0
- package/src/components/file-list/file-list.django-snapshot.html +63 -0
- package/src/components/file-list/file-list.django.html +1 -1
- package/src/components/file-list/file-list.react-snapshot.html +53 -0
- package/src/components/footer/footer.django-snapshot.html +0 -3
- package/src/components/form-group/form-group.django-snapshot.html +0 -2
- package/src/components/header/header.django-snapshot.html +3 -163
- package/src/components/header/header.django.html +2 -2
- package/src/components/header/header.html +1 -1
- package/src/components/header/header.react-snapshot.html +3 -3
- package/src/components/hero/hero.django-snapshot.html +0 -20
- package/src/components/hero/hero.django.html +3 -3
- package/src/components/identifier/config.json +4 -2
- package/src/components/identifier/identifier.django-snapshot.html +13 -16
- package/src/components/identifier/identifier.react-snapshot.html +13 -15
- package/src/components/image/image.django-snapshot.html +6 -6
- package/src/components/image/image.django.html +4 -4
- package/src/components/input/Input.tsx +1 -1
- package/src/components/input/config.json +2 -3
- package/src/components/input/input.django-snapshot.html +4 -21
- package/src/components/input/input.django.html +2 -2
- package/src/components/layout/layout.django-snapshot.html +2 -0
- package/src/components/link/Link.tsx +7 -4
- package/src/components/link/config.json +2 -3
- package/src/components/link/link.django-snapshot.html +8 -0
- package/src/components/link/link.django.html +2 -2
- package/src/components/link/link.html +4 -1
- package/src/components/link/link.react-snapshot.html +8 -0
- package/src/components/memorable-date/memorable-date.django-snapshot.html +0 -8
- package/src/components/memorable-date/memorable-date.django.html +2 -2
- package/src/components/misc-banner/misc-banner.django-snapshot.html +12 -12
- package/src/components/misc-banner/misc-banner.django.html +4 -2
- package/src/components/modal/Modal.tsx +4 -3
- package/src/components/modal/config.json +3 -2
- package/src/components/modal/modal.django-snapshot.html +70 -14
- package/src/components/modal/modal.django.html +7 -9
- package/src/components/modal/modal.html +4 -4
- package/src/components/modal/modal.react-snapshot.html +64 -4
- package/src/components/page/Page.tsx +10 -7
- package/src/components/page/page.django-snapshot.html +5 -8
- package/src/components/page/page.django.html +2 -2
- package/src/components/page/page.html +1 -2
- package/src/components/page/page.react-snapshot.html +5 -8
- package/src/components/pagination/navigation/PaginationNavigation.tsx +2 -0
- package/src/components/pagination/navigation/pagination-navigation.django.html +2 -0
- package/src/components/pagination/pagination.django-snapshot.html +62 -0
- package/src/components/pagination/pagination.django.html +3 -1
- package/src/components/pagination/pagination.html +46 -0
- package/src/components/pagination/pagination.react-snapshot.html +48 -0
- package/src/components/pagination/summary/PaginationSummary.tsx +1 -1
- package/src/components/pagination/summary/pagination-summary.django.html +1 -1
- package/src/components/popover/Popover.tsx +61 -9
- package/src/components/popover/PopoverMenu.tsx +33 -15
- package/src/components/popover/config.json +88 -14
- package/src/components/popover/popover-menu.django.html +13 -2
- package/src/components/popover/popover.django-snapshot.html +265 -7
- package/src/components/popover/popover.django.html +3 -2
- package/src/components/popover/popover.react-snapshot.html +154 -4
- package/src/components/process-list/config.json +41 -3
- package/src/components/quote/Quote.tsx +9 -2
- package/src/components/search/Search.tsx +1 -1
- package/src/components/search/config.json +3 -4
- package/src/components/search/search.django-snapshot.html +262 -1684
- package/src/components/search/search.django.html +1 -20
- package/src/components/section/Section.tsx +3 -1
- package/src/components/select/select.django-snapshot.html +7 -7
- package/src/components/select/select.react-snapshot.html +7 -7
- package/src/components/site-alert/site-alert.django-snapshot.html +8 -8
- package/src/components/summary/Summary.tsx +4 -2
- package/src/components/summary/config.json +4 -0
- package/src/components/summary/summary.django.html +4 -4
- package/src/components/swap/Swap.tsx +35 -3
- package/src/components/swap/config.json +28 -1
- package/src/components/swap/swap.django-snapshot.html +29 -7
- package/src/components/swap/swap.django.html +15 -1
- package/src/components/swap/swap.react-snapshot.html +34 -4
- package/src/components/table/Table.tsx +58 -25
- package/src/components/table/config.json +61 -13
- package/src/components/tag/Tag.tsx +40 -7
- package/src/components/tag/config.json +18 -2
- package/src/components/tag/tag.django-snapshot.html +16 -1
- package/src/components/tag/tag.django.html +12 -6
- package/src/components/tag/tag.html +4 -0
- package/src/components/tag/tag.react-snapshot.html +16 -1
- package/src/components/tag-group/TagGroup.tsx +6 -9
- package/src/components/tag-group/config.json +4 -0
- package/src/components/tag-group/tag-group.django.html +1 -1
- package/src/components/theme-picker/ThemePicker.tsx +48 -42
- package/src/components/theme-picker/config.json +27 -29
- package/src/components/theme-picker/theme-picker-select.django.html +1 -1
- package/src/components/theme-picker/theme-picker.django-snapshot.html +283 -78
- package/src/components/theme-picker/theme-picker.django.html +24 -11
- package/src/components/theme-picker/theme-picker.html +155 -54
- package/src/components/theme-picker/theme-picker.react-snapshot.html +265 -67
- package/src/index.js +1 -0
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
<h3 class="site-preview-heading">Default</h3>
|
|
2
2
|
<button type="button" class="usa-button usx-button usa-button--primary">Default</button>
|
|
3
3
|
|
|
4
|
+
<h3 class="site-preview-heading">Download action</h3>
|
|
5
|
+
<a
|
|
6
|
+
class="usa-button usx-button usa-button--unstyled"
|
|
7
|
+
href="/liberty-island-notes.txt"
|
|
8
|
+
download="Liberty Island notes.txt"
|
|
9
|
+
>Download island notes</a
|
|
10
|
+
>
|
|
11
|
+
|
|
12
|
+
<h3 class="site-preview-heading">Button styled as a tag</h3>
|
|
13
|
+
<button
|
|
14
|
+
type="button"
|
|
15
|
+
class="usa-button usx-button usa-button--unstyled usa-tag usx-tag usx-tag--outline usx-tag--interactive"
|
|
16
|
+
>
|
|
17
|
+
Choose topic
|
|
18
|
+
</button>
|
|
19
|
+
|
|
4
20
|
<h3 class="site-preview-heading">All Variants</h3>
|
|
5
21
|
<h3>Primary</h3>
|
|
6
22
|
<button type="button" class="usa-button usx-button usa-button--primary">Default</button>
|
|
@@ -468,6 +484,70 @@
|
|
|
468
484
|
Unstyled button
|
|
469
485
|
</button>
|
|
470
486
|
|
|
487
|
+
<h3 class="site-preview-heading">Tight</h3>
|
|
488
|
+
<button type="button" class="usa-button usx-button usa-button--primary usx-button--tight">
|
|
489
|
+
Tight
|
|
490
|
+
</button>
|
|
491
|
+
|
|
492
|
+
<h3 class="site-preview-heading">Big Tight</h3>
|
|
493
|
+
<button
|
|
494
|
+
type="button"
|
|
495
|
+
class="usa-button usx-button usa-button--primary usa-button--big usx-button--tight"
|
|
496
|
+
>
|
|
497
|
+
Big tight
|
|
498
|
+
</button>
|
|
499
|
+
|
|
500
|
+
<h3 class="site-preview-heading">Icon Only</h3>
|
|
501
|
+
<button type="button" class="usa-button usx-button usa-button--primary" aria-label="Search">
|
|
502
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
503
|
+
<use href="/img/sprite.svg#search"></use>
|
|
504
|
+
</svg>
|
|
505
|
+
</button>
|
|
506
|
+
|
|
507
|
+
<h3 class="site-preview-heading">Icon Only Tight</h3>
|
|
508
|
+
<button
|
|
509
|
+
type="button"
|
|
510
|
+
class="usa-button usx-button usa-button--primary usx-button--tight"
|
|
511
|
+
aria-label="Search"
|
|
512
|
+
>
|
|
513
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
514
|
+
<use href="/img/sprite.svg#search"></use>
|
|
515
|
+
</svg>
|
|
516
|
+
</button>
|
|
517
|
+
|
|
518
|
+
<h3 class="site-preview-heading">Icon Only Big</h3>
|
|
519
|
+
<button
|
|
520
|
+
type="button"
|
|
521
|
+
class="usa-button usx-button usa-button--primary usa-button--big"
|
|
522
|
+
aria-label="Search"
|
|
523
|
+
>
|
|
524
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
525
|
+
<use href="/img/sprite.svg#search"></use>
|
|
526
|
+
</svg>
|
|
527
|
+
</button>
|
|
528
|
+
|
|
529
|
+
<h3 class="site-preview-heading">Icon Only Big Tight</h3>
|
|
530
|
+
<button
|
|
531
|
+
type="button"
|
|
532
|
+
class="usa-button usx-button usa-button--primary usa-button--big usx-button--tight"
|
|
533
|
+
aria-label="Search"
|
|
534
|
+
>
|
|
535
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
536
|
+
<use href="/img/sprite.svg#search"></use>
|
|
537
|
+
</svg>
|
|
538
|
+
</button>
|
|
539
|
+
|
|
540
|
+
<h3 class="site-preview-heading">Icon Only Ghost</h3>
|
|
541
|
+
<button
|
|
542
|
+
type="button"
|
|
543
|
+
class="usa-button usx-button usa-button--primary usx-button--ghost"
|
|
544
|
+
aria-label="Search"
|
|
545
|
+
>
|
|
546
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
547
|
+
<use href="/img/sprite.svg#search"></use>
|
|
548
|
+
</svg>
|
|
549
|
+
</button>
|
|
550
|
+
|
|
471
551
|
<h3 class="site-preview-heading">Multiple Icons</h3>
|
|
472
552
|
<button type="button" class="usa-button usx-button usa-button--primary">
|
|
473
553
|
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "button",
|
|
3
3
|
"template": "button/button.django.html",
|
|
4
|
-
"version":
|
|
4
|
+
"version": 3,
|
|
5
5
|
"default": {
|
|
6
6
|
"label": "Default",
|
|
7
7
|
"variant": "primary"
|
|
@@ -56,6 +56,11 @@
|
|
|
56
56
|
"description": "A boolean that determines whether the button should be displayed in a larger size, making it more prominent and easier to interact with.",
|
|
57
57
|
"default": false
|
|
58
58
|
},
|
|
59
|
+
"tighten": {
|
|
60
|
+
"type": "boolean",
|
|
61
|
+
"description": "Use 0.75rem padding, or 1rem when big is true.",
|
|
62
|
+
"default": false
|
|
63
|
+
},
|
|
59
64
|
"inverse": {
|
|
60
65
|
"type": "boolean",
|
|
61
66
|
"description": "A boolean that determines whether the button should be displayed with an inverse color scheme, which can be used to create contrast against a darker background.",
|
|
@@ -81,7 +86,10 @@
|
|
|
81
86
|
"properties": {
|
|
82
87
|
"position": {
|
|
83
88
|
"type": "select",
|
|
84
|
-
"options": [
|
|
89
|
+
"options": [
|
|
90
|
+
"left",
|
|
91
|
+
"right"
|
|
92
|
+
],
|
|
85
93
|
"default": "left",
|
|
86
94
|
"description": "Which side of the button label to render this icon on."
|
|
87
95
|
}
|
|
@@ -96,7 +104,9 @@
|
|
|
96
104
|
"type": "object",
|
|
97
105
|
"description": "Inline styles as a React CSSProperties object.",
|
|
98
106
|
"renderers": {
|
|
99
|
-
"react": {
|
|
107
|
+
"react": {
|
|
108
|
+
"type": "object"
|
|
109
|
+
},
|
|
100
110
|
"django": {
|
|
101
111
|
"supported": false,
|
|
102
112
|
"description": "The Django template does not render this prop."
|
|
@@ -110,6 +120,10 @@
|
|
|
110
120
|
"extraAttributes": {
|
|
111
121
|
"type": "object",
|
|
112
122
|
"description": "An object containing any additional HTML attributes to be spread onto the button element, providing flexibility for custom use cases or integrations."
|
|
123
|
+
},
|
|
124
|
+
"download": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"description": "Optional suggested filename for an anchor Button with href. Has no effect on native buttons."
|
|
113
127
|
}
|
|
114
128
|
}
|
|
115
129
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{% with tag=as|default:'div' %}
|
|
2
|
-
<{% if tag == 'section' or tag == 'aside' or tag == 'p' %}{{ tag }}{% else %}div{% endif %} class="usx-callout{% if orientation == 'vertical' %} usx-callout--vertical{% endif %}{% if strokeColor %} border-{{ strokeColor }}{% endif %}{% if indent %} usx-callout--indent-{{ indent }}{% endif %}{% if dedent %} usx-callout--dedent{% endif %}{% if big or orientation|default:'horizontal' == 'horizontal' %}{% if big is not False %} usx-callout--big{% endif %}{% endif %}{% if backgroundColor %} bg-{{ backgroundColor }}{% endif %}{% if textColor %} text-{{ textColor }}{% endif %}{% if className %} {{ className }}{% endif %}">
|
|
2
|
+
<{% if tag == 'section' or tag == 'aside' or tag == 'p' %}{{ tag }}{% else %}div{% endif %} class="usx-callout{% if orientation == 'vertical' %} usx-callout--vertical{% endif %}{% if strokeColor %} border-{{ strokeColor }}{% endif %}{% if indent %} usx-callout--indent-{{ indent }}{% endif %}{% if dedent %} usx-callout--dedent{% endif %}{% if big or orientation|default:'horizontal' == 'horizontal' %}{% if big is not False %} usx-callout--big{% endif %}{% endif %}{% if backgroundColor %} bg-{{ backgroundColor }}{% endif %}{% if textColor %} text-{{ textColor }}{% endif %}{% if className %} {{ className }}{% endif %}"{% for attr, value in extraAttributes.items %} {{ attr }}="{% if value is True %}true{% elif value is False %}false{% else %}{{ value }}{% endif %}"{% endfor %}>
|
|
3
3
|
{% if children != None %}{{ children|safe }}{% elif content != None %}{{ content|safe }}{% endif %}
|
|
4
4
|
</{% if tag == 'section' or tag == 'aside' or tag == 'p' %}{{ tag }}{% else %}div{% endif %}>
|
|
5
5
|
{% endwith %}
|
|
@@ -17,12 +17,7 @@
|
|
|
17
17
|
"indent": {
|
|
18
18
|
"type": "select",
|
|
19
19
|
"description": "Left indentation.",
|
|
20
|
-
"options": [
|
|
21
|
-
"sm",
|
|
22
|
-
"md",
|
|
23
|
-
"lg",
|
|
24
|
-
"xl"
|
|
25
|
-
]
|
|
20
|
+
"options": ["sm", "md", "lg", "xl"]
|
|
26
21
|
},
|
|
27
22
|
"dedent": {
|
|
28
23
|
"type": "boolean",
|
|
@@ -36,10 +31,7 @@
|
|
|
36
31
|
"orientation": {
|
|
37
32
|
"type": "select",
|
|
38
33
|
"description": "Horizontal uses a left border; vertical uses a top border.",
|
|
39
|
-
"options": [
|
|
40
|
-
"horizontal",
|
|
41
|
-
"vertical"
|
|
42
|
-
],
|
|
34
|
+
"options": ["horizontal", "vertical"],
|
|
43
35
|
"default": "horizontal"
|
|
44
36
|
},
|
|
45
37
|
"children": {
|
|
@@ -61,13 +53,12 @@
|
|
|
61
53
|
"as": {
|
|
62
54
|
"type": "select",
|
|
63
55
|
"description": "Root HTML element.",
|
|
64
|
-
"options": [
|
|
65
|
-
"div",
|
|
66
|
-
"section",
|
|
67
|
-
"aside",
|
|
68
|
-
"p"
|
|
69
|
-
],
|
|
56
|
+
"options": ["div", "section", "aside", "p"],
|
|
70
57
|
"default": "div"
|
|
58
|
+
},
|
|
59
|
+
"extraAttributes": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"description": "Additional HTML attributes on the root element, including ARIA attributes."
|
|
71
62
|
}
|
|
72
63
|
}
|
|
73
64
|
}
|
|
@@ -67,6 +67,49 @@
|
|
|
67
67
|
</div>
|
|
68
68
|
</div>
|
|
69
69
|
|
|
70
|
+
<h3 class="site-preview-heading">Tall Image With Max Height</h3>
|
|
71
|
+
<div class="usa-card usx-card tablet:grid-col-8 widescreen:grid-col-6">
|
|
72
|
+
<div class="usa-card__container">
|
|
73
|
+
<div class="usa-card__header">
|
|
74
|
+
<h4 class="usa-card__heading">Card Title</h4>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div class="usa-card__media">
|
|
78
|
+
<figure class="usx-image usa-card__img" style="max-height: 150px; width: auto">
|
|
79
|
+
<img
|
|
80
|
+
src="https://picsum.photos/400/600?random=19"
|
|
81
|
+
alt="Tall placeholder image for card"
|
|
82
|
+
style="max-height: 150px; width: auto"
|
|
83
|
+
/>
|
|
84
|
+
|
|
85
|
+
<figcaption class="usx-image--caption usa-sr-only">
|
|
86
|
+
Tall image with a 150px maximum height.
|
|
87
|
+
</figcaption>
|
|
88
|
+
</figure>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="usa-card__body">
|
|
92
|
+
<p>This is the main content of the card. It can contain text, links, or other elements.</p>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<div class="usa-card__footer">
|
|
96
|
+
<ul class="usa-button-group usx-button-group flex-wrap">
|
|
97
|
+
<li class="usa-button-group__item">
|
|
98
|
+
<button type="button" class="usa-button usx-button usa-button--primary">
|
|
99
|
+
Learn More
|
|
100
|
+
</button>
|
|
101
|
+
</li>
|
|
102
|
+
|
|
103
|
+
<li class="usa-button-group__item">
|
|
104
|
+
<button type="button" class="usa-button usx-button usa-button--secondary">
|
|
105
|
+
View Details
|
|
106
|
+
</button>
|
|
107
|
+
</li>
|
|
108
|
+
</ul>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
70
113
|
<h3 class="site-preview-heading">With Tags</h3>
|
|
71
114
|
<div class="usa-card usx-card tablet:grid-col-8 widescreen:grid-col-6">
|
|
72
115
|
<div class="usa-card__container">
|
|
@@ -55,6 +55,42 @@
|
|
|
55
55
|
</div>
|
|
56
56
|
</div>
|
|
57
57
|
|
|
58
|
+
<h3 class="site-preview-heading">Tall Image With Max Height</h3>
|
|
59
|
+
<div class="usa-card usx-card tablet:grid-col-8 widescreen:grid-col-6">
|
|
60
|
+
<div class="usa-card__container">
|
|
61
|
+
<div class="usa-card__header"><h4 class="usa-card__heading">Card Title</h4></div>
|
|
62
|
+
<div class="usa-card__media">
|
|
63
|
+
<figure class="usx-image usa-card__img" style="max-height: 150px; width: auto">
|
|
64
|
+
<img
|
|
65
|
+
src="https://picsum.photos/400/600?random=19"
|
|
66
|
+
alt="Tall placeholder image for card"
|
|
67
|
+
style="max-height: 150px; width: auto"
|
|
68
|
+
/>
|
|
69
|
+
<figcaption class="usx-image--caption usa-sr-only">
|
|
70
|
+
Tall image with a 150px maximum height.
|
|
71
|
+
</figcaption>
|
|
72
|
+
</figure>
|
|
73
|
+
</div>
|
|
74
|
+
<div class="usa-card__body">
|
|
75
|
+
<p>This is the main content of the card. It can contain text, links, or other elements.</p>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="usa-card__footer">
|
|
78
|
+
<ul class="usa-button-group usx-button-group flex-wrap">
|
|
79
|
+
<li class="usa-button-group__item">
|
|
80
|
+
<button type="button" class="usa-button usx-button usa-button--primary">
|
|
81
|
+
Learn More
|
|
82
|
+
</button>
|
|
83
|
+
</li>
|
|
84
|
+
<li class="usa-button-group__item">
|
|
85
|
+
<button type="button" class="usa-button usx-button usa-button--secondary">
|
|
86
|
+
View Details
|
|
87
|
+
</button>
|
|
88
|
+
</li>
|
|
89
|
+
</ul>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
58
94
|
<h3 class="site-preview-heading">With Tags</h3>
|
|
59
95
|
<div class="usa-card usx-card tablet:grid-col-8 widescreen:grid-col-6">
|
|
60
96
|
<div class="usa-card__container">
|
|
@@ -40,6 +40,7 @@ export default function CharacterCount({
|
|
|
40
40
|
textArea = false,
|
|
41
41
|
className = '',
|
|
42
42
|
extraAttributes,
|
|
43
|
+
defaultValue = '',
|
|
43
44
|
...props
|
|
44
45
|
}: CharacterCountProps) {
|
|
45
46
|
const fieldId = id || `character-count-${Math.random().toString(36).substr(2, 9)}`;
|
|
@@ -63,6 +64,7 @@ export default function CharacterCount({
|
|
|
63
64
|
formGroup: true,
|
|
64
65
|
className: 'usa-character-count__field',
|
|
65
66
|
'aria-describedby': [infoId, hintId, errorId].filter(Boolean).join(' '),
|
|
67
|
+
defaultValue,
|
|
66
68
|
...props,
|
|
67
69
|
...extraAttributes,
|
|
68
70
|
};
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
placeholder=""
|
|
9
9
|
aria-describedby="react-cc-1-info"
|
|
10
10
|
maxlength="25"
|
|
11
|
+
value=""
|
|
11
12
|
/>
|
|
12
13
|
</div>
|
|
13
14
|
<span id="react-cc-1-info" class="usa-character-count__message"
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
placeholder="Enter text here"
|
|
43
44
|
aria-describedby="react-cc-17-info"
|
|
44
45
|
maxlength="25"
|
|
46
|
+
value=""
|
|
45
47
|
/>
|
|
46
48
|
</div>
|
|
47
49
|
<span id="react-cc-17-info" class="usa-character-count__message"
|
|
@@ -77,6 +79,7 @@
|
|
|
77
79
|
placeholder=""
|
|
78
80
|
aria-describedby="react-cc-3-info react-cc-3-hint"
|
|
79
81
|
maxlength="25"
|
|
82
|
+
value=""
|
|
80
83
|
/>
|
|
81
84
|
</div>
|
|
82
85
|
<span id="react-cc-3-info" class="usa-character-count__message"
|
|
@@ -114,6 +117,7 @@
|
|
|
114
117
|
required=""
|
|
115
118
|
aria-describedby="react-cc-6-info"
|
|
116
119
|
maxlength="25"
|
|
120
|
+
value=""
|
|
117
121
|
/>
|
|
118
122
|
</div>
|
|
119
123
|
<span id="react-cc-6-info" class="usa-character-count__message"
|
|
@@ -150,6 +154,7 @@
|
|
|
150
154
|
placeholder=""
|
|
151
155
|
aria-describedby="react-cc-7-info"
|
|
152
156
|
maxlength="25"
|
|
157
|
+
value=""
|
|
153
158
|
/>
|
|
154
159
|
</div>
|
|
155
160
|
<span id="react-cc-7-info" class="usa-character-count__message"
|
|
@@ -187,6 +192,7 @@
|
|
|
187
192
|
aria-describedby="react-cc-9-info react-cc-9-error"
|
|
188
193
|
aria-invalid="true"
|
|
189
194
|
maxlength="25"
|
|
195
|
+
value=""
|
|
190
196
|
/>
|
|
191
197
|
</div>
|
|
192
198
|
<span id="react-cc-9-info" class="usa-character-count__message"
|
|
@@ -226,6 +232,7 @@
|
|
|
226
232
|
disabled=""
|
|
227
233
|
aria-describedby="react-cc-12-info"
|
|
228
234
|
maxlength="25"
|
|
235
|
+
value=""
|
|
229
236
|
/>
|
|
230
237
|
</div>
|
|
231
238
|
<span id="react-cc-12-info" class="usa-character-count__message"
|