@solexllc/usx-react 0.11.0 → 0.12.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 +16 -0
- package/dist/Popover-BzDCTuQM.cjs +984 -0
- package/dist/Popover-LToVWsWc.js +985 -0
- package/dist/chat.cjs +1391 -0
- package/dist/chat.js +1391 -0
- package/dist/index.cjs +4428 -5290
- package/dist/index.js +58 -917
- package/package.json +7 -3
- package/src/chat.js +15 -0
- package/src/components/avatar/Avatar.tsx +54 -16
- package/src/components/avatar/avatar.django-snapshot.html +112 -0
- 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 +104 -0
- package/src/components/avatar/config.json +13 -15
- package/src/components/avatar-group/AvatarGroup.tsx +17 -15
- package/src/components/avatar-group/avatar-group.django-snapshot.html +22 -0
- package/src/components/avatar-group/avatar-group.django.html +1 -1
- package/src/components/avatar-group/avatar-group.react-snapshot.html +20 -0
- package/src/components/avatar-group/config.json +2 -2
- 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/button/Button.tsx +12 -3
- package/src/components/button/button.django-snapshot.html +18 -0
- package/src/components/button/button.django.html +3 -2
- package/src/components/button/button.react-snapshot.html +16 -0
- package/src/components/button/config.json +11 -2
- package/src/components/callout/callout.django.html +1 -1
- package/src/components/callout/config.json +7 -16
- 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 +23515 -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 +210 -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 +133 -0
- package/src/components/chat-window/chat-window.django-snapshot.html +448 -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/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/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/header/header.django-snapshot.html +0 -160
- package/src/components/header/header.django.html +2 -2
- package/src/components/hero/hero.django-snapshot.html +0 -20
- package/src/components/hero/hero.django.html +3 -3
- 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/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/popover/Popover.tsx +60 -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 +229 -7
- package/src/components/popover/popover.django.html +3 -2
- package/src/components/popover/popover.react-snapshot.html +127 -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/select/select.django-snapshot.html +7 -7
- package/src/components/select/select.react-snapshot.html +7 -7
- 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/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
|
@@ -1,107 +1,23 @@
|
|
|
1
1
|
<h3 id="back-to-top" class="site-preview-heading">Back to top</h3>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
25
|
-
</svg>
|
|
26
|
-
</button>
|
|
27
|
-
<button class="usa-button usx-button usa-button--primary usx-button--ghost width-6"
|
|
28
|
-
onclick="window.scrollTo({ top: 0, behavior: 'smooth' });">
|
|
29
|
-
<svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
|
|
30
|
-
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
31
|
-
</svg>
|
|
32
|
-
</button>
|
|
33
|
-
<button class="usa-button usx-button usa-button--primary usx-button--ghost width-7"
|
|
34
|
-
onclick="window.scrollTo({ top: 0, behavior: 'smooth' });">
|
|
35
|
-
<svg class="usa-icon usa-icon--size-4" aria-hidden="true" focusable="false" role="img">
|
|
36
|
-
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
37
|
-
</svg>
|
|
38
|
-
</button>
|
|
39
|
-
<a class="usx-link usx-no-visited" tabindex="0"
|
|
40
|
-
href="#back-to-top"
|
|
41
|
-
onclick="document.getElementById('back-to-top').scrollIntoView({ behavior: 'smooth' });"
|
|
42
|
-
>
|
|
43
|
-
Back to top
|
|
44
|
-
<svg class="usa-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
|
|
45
|
-
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
46
|
-
</svg>
|
|
47
|
-
</a>
|
|
48
|
-
<div class="bg-primary-darkest padding-1 margin-top-2">
|
|
49
|
-
<a class="usx-link text-white hover:text-accent-cool usx-no-visited" tabindex="0"
|
|
50
|
-
href="#back-to-top"
|
|
51
|
-
onclick="document.getElementById('back-to-top').scrollIntoView({ behavior: 'smooth' });"
|
|
52
|
-
>
|
|
53
|
-
Back to top
|
|
54
|
-
<svg class="usa-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
|
|
55
|
-
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
56
|
-
</svg>
|
|
57
|
-
</a>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
<div class="display-flex flex-column flex-align-end margin-left-auto">
|
|
61
|
-
<button class="usa-button usx-button usx-button--ghost" onclick="window.scrollTo({ top: 0, behavior: 'smooth' });">
|
|
62
|
-
<svg class="usa-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
|
|
63
|
-
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
64
|
-
</svg>
|
|
65
|
-
Back to top
|
|
66
|
-
</button>
|
|
67
|
-
<button class="usa-button usx-button usa-button--primary usx-button--ghost"
|
|
68
|
-
onclick="window.scrollTo({ top: 0, behavior: 'smooth' });">
|
|
69
|
-
<svg class="usa-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
|
|
70
|
-
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
71
|
-
</svg>
|
|
72
|
-
Back to top
|
|
73
|
-
</button>
|
|
74
|
-
<button class="usa-button usx-button usa-button--primary usx-button--ghost width-6"
|
|
75
|
-
onclick="window.scrollTo({ top: 0, behavior: 'smooth' });">
|
|
76
|
-
<svg class="usa-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
|
|
77
|
-
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
78
|
-
</svg>
|
|
79
|
-
</button>
|
|
80
|
-
<button class="usa-button usx-button usa-button--primary usx-button--ghost width-7"
|
|
81
|
-
onclick="window.scrollTo({ top: 0, behavior: 'smooth' });">
|
|
82
|
-
<svg class="usa-icon usa-icon--size-4" aria-hidden="true" focusable="false" role="img">
|
|
83
|
-
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
84
|
-
</svg>
|
|
85
|
-
</button>
|
|
86
|
-
<a class="usx-link usx-no-visited" tabindex="0"
|
|
87
|
-
href="#back-to-top"
|
|
88
|
-
onclick="document.getElementById('back-to-top').scrollIntoView({ behavior: 'smooth' });"
|
|
89
|
-
>
|
|
90
|
-
<svg class="usa-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
|
|
91
|
-
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
92
|
-
</svg>
|
|
93
|
-
Back to top
|
|
94
|
-
</a>
|
|
95
|
-
<div class="bg-primary-darkest padding-1 margin-top-2">
|
|
96
|
-
<a class="usx-link text-white hover:text-accent-cool usx-no-visited" tabindex="0"
|
|
97
|
-
href="#back-to-top"
|
|
98
|
-
onclick="document.getElementById('back-to-top').scrollIntoView({ behavior: 'smooth' });"
|
|
99
|
-
>
|
|
100
|
-
<svg class="usa-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
|
|
101
|
-
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
102
|
-
</svg>
|
|
103
|
-
Back to top
|
|
104
|
-
</a>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
2
|
+
<a class="usa-button usx-button usa-button--primary usx-button--ghost" href="#top">
|
|
3
|
+
Back to top
|
|
4
|
+
<svg class="usa-icon usx-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
|
|
5
|
+
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
6
|
+
</svg>
|
|
7
|
+
</a>
|
|
8
|
+
|
|
9
|
+
<!-- Optional custom destination. -->
|
|
10
|
+
<a class="usa-button usx-button usa-button--unstyled" href="#back-to-top">
|
|
11
|
+
Back to this section
|
|
12
|
+
<svg class="usa-icon usx-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
|
|
13
|
+
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
14
|
+
</svg>
|
|
15
|
+
</a>
|
|
16
|
+
|
|
17
|
+
<!-- Optional button: the host supplies its click handler. -->
|
|
18
|
+
<button type="button" class="usa-button usx-button usa-button--primary usx-button--ghost">
|
|
19
|
+
Back to top
|
|
20
|
+
<svg class="usa-icon usx-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
|
|
21
|
+
<use href="./img/sprite.svg#arrow_upward"></use>
|
|
22
|
+
</svg>
|
|
23
|
+
</button>
|
|
@@ -1,121 +1,77 @@
|
|
|
1
1
|
<h3 class="site-preview-heading">Default</h3>
|
|
2
|
-
<
|
|
3
|
-
Back to top<svg
|
|
4
|
-
class="usa-icon usx-icon usa-icon--size-2
|
|
2
|
+
<a class="usa-button usx-button usa-button--primary usx-button--ghost" href="#top"
|
|
3
|
+
>Back to top<svg
|
|
4
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
5
5
|
aria-hidden="true"
|
|
6
6
|
focusable="false"
|
|
7
7
|
role="img"
|
|
8
8
|
>
|
|
9
|
-
<use href="/img/sprite.svg#arrow_upward"></use
|
|
10
|
-
|
|
11
|
-
</button>
|
|
9
|
+
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
10
|
+
></a>
|
|
12
11
|
|
|
13
|
-
<h3 class="site-preview-heading">
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
role="img"
|
|
20
|
-
>
|
|
21
|
-
<use href="/img/sprite.svg#arrow_upward"></use>
|
|
22
|
-
</svg>
|
|
23
|
-
</button>
|
|
12
|
+
<h3 class="site-preview-heading">Icon Left</h3>
|
|
13
|
+
<a class="usa-button usx-button usa-button--primary usx-button--ghost" href="#top"
|
|
14
|
+
><svg class="usa-icon usx-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
|
|
15
|
+
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
16
|
+
>Back to top</a
|
|
17
|
+
>
|
|
24
18
|
|
|
25
19
|
<h3 class="site-preview-heading">Icon Only Small</h3>
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
<a
|
|
21
|
+
class="usa-button usx-button usa-button--primary usx-button--ghost"
|
|
22
|
+
href="#top"
|
|
29
23
|
aria-label="Back to top"
|
|
30
|
-
>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
aria-hidden="true"
|
|
34
|
-
focusable="false"
|
|
35
|
-
role="img"
|
|
36
|
-
>
|
|
37
|
-
<use href="/img/sprite.svg#arrow_upward"></use>
|
|
38
|
-
</svg>
|
|
39
|
-
</button>
|
|
24
|
+
><svg class="usa-icon usx-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
|
|
25
|
+
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
26
|
+
></a>
|
|
40
27
|
|
|
41
28
|
<h3 class="site-preview-heading">Icon Only Large</h3>
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
<a
|
|
30
|
+
class="usa-button usx-button usa-button--primary usx-button--ghost"
|
|
31
|
+
href="#top"
|
|
45
32
|
aria-label="Back to top"
|
|
46
|
-
>
|
|
47
|
-
<svg
|
|
48
|
-
class="usa-icon usx-icon usa-icon--size-4 margin-left-05"
|
|
49
|
-
aria-hidden="true"
|
|
50
|
-
focusable="false"
|
|
51
|
-
role="img"
|
|
52
|
-
>
|
|
53
|
-
<use href="/img/sprite.svg#arrow_upward"></use>
|
|
54
|
-
</svg>
|
|
55
|
-
</button>
|
|
56
|
-
|
|
57
|
-
<h3 class="site-preview-heading">Link Default</h3>
|
|
58
|
-
<a class="usx-link usx-no-visited flex-align-center" href="#back-to-top"
|
|
59
|
-
>Back to top<svg
|
|
60
|
-
class="usa-icon usx-icon usa-icon--size-2 margin-left-05"
|
|
61
|
-
aria-hidden="true"
|
|
62
|
-
focusable="false"
|
|
63
|
-
role="img"
|
|
64
|
-
>
|
|
33
|
+
><svg class="usa-icon usx-icon usa-icon--size-4" aria-hidden="true" focusable="false" role="img">
|
|
65
34
|
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
66
35
|
></a>
|
|
67
36
|
|
|
68
|
-
<h3 class="site-preview-heading">
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
class="usa-
|
|
37
|
+
<h3 class="site-preview-heading">Link On Dark</h3>
|
|
38
|
+
<div class="bg-surface-inverse padding-1">
|
|
39
|
+
<a
|
|
40
|
+
class="usa-button usx-button usa-button--primary usa-button--inverse usx-button--ghost"
|
|
41
|
+
href="#top"
|
|
42
|
+
>Back to top<svg
|
|
43
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
44
|
+
aria-hidden="true"
|
|
45
|
+
focusable="false"
|
|
46
|
+
role="img"
|
|
47
|
+
>
|
|
48
|
+
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
49
|
+
></a>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<h3 class="site-preview-heading">Custom Href</h3>
|
|
53
|
+
<a class="usa-button usx-button usa-button--primary usx-button--ghost" href="#storybook-root"
|
|
54
|
+
>Back to preview<svg
|
|
55
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
72
56
|
aria-hidden="true"
|
|
73
57
|
focusable="false"
|
|
74
58
|
role="img"
|
|
75
59
|
>
|
|
76
60
|
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
77
|
-
|
|
78
|
-
</button>
|
|
61
|
+
></a>
|
|
79
62
|
|
|
80
|
-
<h3 class="site-preview-heading">
|
|
63
|
+
<h3 class="site-preview-heading">With On Click</h3>
|
|
81
64
|
<button type="button" class="usa-button usx-button usa-button--primary usx-button--ghost">
|
|
82
|
-
<svg
|
|
83
|
-
class="usa-icon usx-icon usa-icon--size-2
|
|
65
|
+
Back to top<svg
|
|
66
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
84
67
|
aria-hidden="true"
|
|
85
68
|
focusable="false"
|
|
86
69
|
role="img"
|
|
87
70
|
>
|
|
88
|
-
<use href="/img/sprite.svg#arrow_upward"></use
|
|
89
|
-
>
|
|
71
|
+
<use href="/img/sprite.svg#arrow_upward"></use>
|
|
72
|
+
</svg>
|
|
90
73
|
</button>
|
|
91
74
|
|
|
92
|
-
<h3 class="site-preview-heading">Link Icon Left</h3>
|
|
93
|
-
<a class="usx-link usx-no-visited flex-align-center" href="#back-to-top"
|
|
94
|
-
><svg
|
|
95
|
-
class="usa-icon usx-icon usa-icon--size-2 margin-right-05"
|
|
96
|
-
aria-hidden="true"
|
|
97
|
-
focusable="false"
|
|
98
|
-
role="img"
|
|
99
|
-
>
|
|
100
|
-
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
101
|
-
>Back to top</a
|
|
102
|
-
>
|
|
103
|
-
|
|
104
|
-
<h3 class="site-preview-heading">Link On Dark</h3>
|
|
105
|
-
<div class="bg-primary-darkest padding-1">
|
|
106
|
-
<a
|
|
107
|
-
class="usx-link usx-no-visited flex-align-center text-white hover:text-accent-cool"
|
|
108
|
-
href="#back-to-top"
|
|
109
|
-
>Back to top<svg
|
|
110
|
-
class="usa-icon usx-icon usa-icon--size-2 margin-left-05"
|
|
111
|
-
aria-hidden="true"
|
|
112
|
-
focusable="false"
|
|
113
|
-
role="img"
|
|
114
|
-
>
|
|
115
|
-
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
116
|
-
></a>
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
75
|
<h3 class="site-preview-heading">All Variants</h3>
|
|
120
76
|
<div class="display-flex flex-wrap" style="gap: 2rem">
|
|
121
77
|
<div
|
|
@@ -123,65 +79,59 @@
|
|
|
123
79
|
style="gap: 0.5rem"
|
|
124
80
|
>
|
|
125
81
|
<h4>Button (icon right)</h4>
|
|
126
|
-
<
|
|
127
|
-
Back to top<svg
|
|
128
|
-
class="usa-icon usx-icon usa-icon--size-2
|
|
82
|
+
<a class="usa-button usx-button usa-button--primary usx-button--ghost" href="#top"
|
|
83
|
+
>Back to top<svg
|
|
84
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
129
85
|
aria-hidden="true"
|
|
130
86
|
focusable="false"
|
|
131
87
|
role="img"
|
|
132
88
|
>
|
|
133
|
-
<use href="/img/sprite.svg#arrow_upward"></use
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
class="usa-icon usx-icon usa-icon--size-2 margin-left-05"
|
|
89
|
+
<use href="/img/sprite.svg#arrow_upward"></use></svg></a
|
|
90
|
+
><a class="usa-button usx-button usa-button--primary" href="#top"
|
|
91
|
+
>Back to top<svg
|
|
92
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
138
93
|
aria-hidden="true"
|
|
139
94
|
focusable="false"
|
|
140
95
|
role="img"
|
|
141
96
|
>
|
|
142
|
-
<use href="/img/sprite.svg#arrow_upward"></use
|
|
143
|
-
|
|
144
|
-
><button
|
|
145
|
-
type="button"
|
|
97
|
+
<use href="/img/sprite.svg#arrow_upward"></use></svg></a
|
|
98
|
+
><a
|
|
146
99
|
class="usa-button usx-button usa-button--primary usx-button--ghost width-6"
|
|
100
|
+
href="#top"
|
|
147
101
|
aria-label="Back to top"
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
class="usa-icon usx-icon usa-icon--size-3 margin-left-05"
|
|
102
|
+
><svg
|
|
103
|
+
class="usa-icon usx-icon usa-icon--size-3"
|
|
151
104
|
aria-hidden="true"
|
|
152
105
|
focusable="false"
|
|
153
106
|
role="img"
|
|
154
107
|
>
|
|
155
|
-
<use href="/img/sprite.svg#arrow_upward"></use
|
|
156
|
-
|
|
157
|
-
><button
|
|
158
|
-
type="button"
|
|
108
|
+
<use href="/img/sprite.svg#arrow_upward"></use></svg></a
|
|
109
|
+
><a
|
|
159
110
|
class="usa-button usx-button usa-button--primary usx-button--ghost width-7"
|
|
111
|
+
href="#top"
|
|
160
112
|
aria-label="Back to top"
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
class="usa-icon usx-icon usa-icon--size-4 margin-left-05"
|
|
113
|
+
><svg
|
|
114
|
+
class="usa-icon usx-icon usa-icon--size-4"
|
|
164
115
|
aria-hidden="true"
|
|
165
116
|
focusable="false"
|
|
166
117
|
role="img"
|
|
167
118
|
>
|
|
168
|
-
<use href="/img/sprite.svg#arrow_upward"></use
|
|
169
|
-
|
|
170
|
-
><a class="usx-link usx-no-visited flex-align-center" href="#back-to-top"
|
|
119
|
+
<use href="/img/sprite.svg#arrow_upward"></use></svg></a
|
|
120
|
+
><a class="usa-button usx-button usa-button--unstyled" href="#storybook-root"
|
|
171
121
|
>Back to top<svg
|
|
172
|
-
class="usa-icon usx-icon usa-icon--size-2
|
|
122
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
173
123
|
aria-hidden="true"
|
|
174
124
|
focusable="false"
|
|
175
125
|
role="img"
|
|
176
126
|
>
|
|
177
127
|
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
178
128
|
></a>
|
|
179
|
-
<div class="bg-
|
|
129
|
+
<div class="bg-surface-inverse padding-1">
|
|
180
130
|
<a
|
|
181
|
-
class="
|
|
182
|
-
href="#
|
|
131
|
+
class="usa-button usx-button usa-button--primary usa-button--inverse usx-button--ghost"
|
|
132
|
+
href="#top"
|
|
183
133
|
>Back to top<svg
|
|
184
|
-
class="usa-icon usx-icon usa-icon--size-2
|
|
134
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
185
135
|
aria-hidden="true"
|
|
186
136
|
focusable="false"
|
|
187
137
|
role="img"
|
|
@@ -192,53 +142,49 @@
|
|
|
192
142
|
</div>
|
|
193
143
|
<div class="display-flex flex-column flex-align-end margin-left-auto" style="gap: 0.5rem">
|
|
194
144
|
<h4>Button (icon left)</h4>
|
|
195
|
-
<
|
|
196
|
-
|
|
197
|
-
class="usa-icon usx-icon usa-icon--size-2
|
|
145
|
+
<a class="usa-button usx-button usa-button--primary usx-button--ghost" href="#top"
|
|
146
|
+
><svg
|
|
147
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
198
148
|
aria-hidden="true"
|
|
199
149
|
focusable="false"
|
|
200
150
|
role="img"
|
|
201
151
|
>
|
|
202
152
|
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
203
|
-
>Back to top</
|
|
204
|
-
><
|
|
205
|
-
|
|
206
|
-
class="usa-icon usx-icon usa-icon--size-2
|
|
153
|
+
>Back to top</a
|
|
154
|
+
><a class="usa-button usx-button usa-button--primary" href="#top"
|
|
155
|
+
><svg
|
|
156
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
207
157
|
aria-hidden="true"
|
|
208
158
|
focusable="false"
|
|
209
159
|
role="img"
|
|
210
160
|
>
|
|
211
161
|
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
212
|
-
>Back to top</
|
|
213
|
-
><
|
|
214
|
-
type="button"
|
|
162
|
+
>Back to top</a
|
|
163
|
+
><a
|
|
215
164
|
class="usa-button usx-button usa-button--primary usx-button--ghost width-6"
|
|
165
|
+
href="#top"
|
|
216
166
|
aria-label="Back to top"
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
class="usa-icon usx-icon usa-icon--size-3 margin-left-05"
|
|
167
|
+
><svg
|
|
168
|
+
class="usa-icon usx-icon usa-icon--size-3"
|
|
220
169
|
aria-hidden="true"
|
|
221
170
|
focusable="false"
|
|
222
171
|
role="img"
|
|
223
172
|
>
|
|
224
|
-
<use href="/img/sprite.svg#arrow_upward"></use
|
|
225
|
-
|
|
226
|
-
><button
|
|
227
|
-
type="button"
|
|
173
|
+
<use href="/img/sprite.svg#arrow_upward"></use></svg></a
|
|
174
|
+
><a
|
|
228
175
|
class="usa-button usx-button usa-button--primary usx-button--ghost width-7"
|
|
176
|
+
href="#top"
|
|
229
177
|
aria-label="Back to top"
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
class="usa-icon usx-icon usa-icon--size-4 margin-left-05"
|
|
178
|
+
><svg
|
|
179
|
+
class="usa-icon usx-icon usa-icon--size-4"
|
|
233
180
|
aria-hidden="true"
|
|
234
181
|
focusable="false"
|
|
235
182
|
role="img"
|
|
236
183
|
>
|
|
237
|
-
<use href="/img/sprite.svg#arrow_upward"></use
|
|
238
|
-
|
|
239
|
-
><a class="usx-link usx-no-visited flex-align-center" href="#back-to-top"
|
|
184
|
+
<use href="/img/sprite.svg#arrow_upward"></use></svg></a
|
|
185
|
+
><a class="usa-button usx-button usa-button--unstyled" href="#storybook-root"
|
|
240
186
|
><svg
|
|
241
|
-
class="usa-icon usx-icon usa-icon--size-2
|
|
187
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
242
188
|
aria-hidden="true"
|
|
243
189
|
focusable="false"
|
|
244
190
|
role="img"
|
|
@@ -246,12 +192,12 @@
|
|
|
246
192
|
<use href="/img/sprite.svg#arrow_upward"></use></svg
|
|
247
193
|
>Back to top</a
|
|
248
194
|
>
|
|
249
|
-
<div class="bg-
|
|
195
|
+
<div class="bg-surface-inverse padding-1">
|
|
250
196
|
<a
|
|
251
|
-
class="
|
|
252
|
-
href="#
|
|
197
|
+
class="usa-button usx-button usa-button--primary usa-button--inverse usx-button--ghost"
|
|
198
|
+
href="#top"
|
|
253
199
|
><svg
|
|
254
|
-
class="usa-icon usx-icon usa-icon--size-2
|
|
200
|
+
class="usa-icon usx-icon usa-icon--size-2"
|
|
255
201
|
aria-hidden="true"
|
|
256
202
|
focusable="false"
|
|
257
203
|
role="img"
|
|
@@ -1,32 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "back-to-top",
|
|
3
3
|
"template": "back-to-top/back-to-top.django.html",
|
|
4
|
-
"version":
|
|
4
|
+
"version": 3,
|
|
5
5
|
"default": {
|
|
6
6
|
"label": "Back to top",
|
|
7
7
|
"iconPosition": "right",
|
|
8
|
-
"iconSize": 2
|
|
8
|
+
"iconSize": 2,
|
|
9
|
+
"href": "#top",
|
|
10
|
+
"variant": "primary",
|
|
11
|
+
"ghost": true
|
|
9
12
|
},
|
|
10
13
|
"props": {
|
|
11
14
|
"label": {
|
|
12
15
|
"type": "string",
|
|
13
|
-
"description": "The visible text label. Defaults to 'Back to top'.
|
|
16
|
+
"description": "The visible text label. Defaults to 'Back to top'. Pass null or an empty string for icon-only display.",
|
|
17
|
+
"default": "Back to top"
|
|
14
18
|
},
|
|
15
19
|
"ariaLabel": {
|
|
16
20
|
"type": "string",
|
|
17
|
-
"description": "Accessible name used when there is no visible label (icon-only display). Defaults to 'Back to top'."
|
|
21
|
+
"description": "Accessible name used when there is no visible label (icon-only display). Defaults to 'Back to top'.",
|
|
22
|
+
"default": "Back to top"
|
|
18
23
|
},
|
|
19
24
|
"href": {
|
|
20
25
|
"type": "string",
|
|
21
|
-
"description": "
|
|
26
|
+
"description": "Destination of the anchor. Defaults to #top when omitted or empty. Ignored when onClick selects a button.",
|
|
27
|
+
"default": "#top"
|
|
22
28
|
},
|
|
23
29
|
"variant": {
|
|
24
30
|
"type": "select",
|
|
25
31
|
"options": [
|
|
26
|
-
"",
|
|
27
|
-
"
|
|
32
|
+
"primary",
|
|
33
|
+
"secondary",
|
|
34
|
+
"accent-cool",
|
|
35
|
+
"accent-warm",
|
|
36
|
+
"base",
|
|
37
|
+
"outline",
|
|
38
|
+
"unstyled"
|
|
28
39
|
],
|
|
29
|
-
"description": "
|
|
40
|
+
"description": "Shared Button visual variant. Defaults to primary for both anchors and host-controlled buttons.",
|
|
41
|
+
"default": "primary"
|
|
30
42
|
},
|
|
31
43
|
"iconPosition": {
|
|
32
44
|
"type": "select",
|
|
@@ -34,7 +46,8 @@
|
|
|
34
46
|
"right",
|
|
35
47
|
"left"
|
|
36
48
|
],
|
|
37
|
-
"description": "Position of the arrow icon relative to the label text. Defaults to 'right'."
|
|
49
|
+
"description": "Position of the arrow icon relative to the label text. Defaults to 'right'.",
|
|
50
|
+
"default": "right"
|
|
38
51
|
},
|
|
39
52
|
"iconSize": {
|
|
40
53
|
"type": "select",
|
|
@@ -43,11 +56,29 @@
|
|
|
43
56
|
"3",
|
|
44
57
|
"4"
|
|
45
58
|
],
|
|
46
|
-
"description": "Size of the arrow icon. Corresponds to USWDS icon size utilities. Defaults to '2'."
|
|
59
|
+
"description": "Size of the arrow icon. Corresponds to USWDS icon size utilities. Defaults to '2'.",
|
|
60
|
+
"default": "2"
|
|
47
61
|
},
|
|
48
62
|
"className": {
|
|
49
63
|
"type": "string",
|
|
50
64
|
"description": "Additional CSS classes to apply to the component."
|
|
65
|
+
},
|
|
66
|
+
"onClick": {
|
|
67
|
+
"type": [
|
|
68
|
+
"function",
|
|
69
|
+
"boolean"
|
|
70
|
+
],
|
|
71
|
+
"description": "A host-provided React click handler renders a button instead of an anchor. Pass true to render the same button markup and attach a listener from the host (including Django). No scrolling behavior or inline JavaScript is supplied. Takes precedence over href."
|
|
72
|
+
},
|
|
73
|
+
"inverse": {
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"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.",
|
|
76
|
+
"default": false
|
|
77
|
+
},
|
|
78
|
+
"ghost": {
|
|
79
|
+
"type": "boolean",
|
|
80
|
+
"default": true,
|
|
81
|
+
"description": "Shared Button ghost styling. Enabled by default; set false for a filled or unstyled Button."
|
|
51
82
|
}
|
|
52
83
|
}
|
|
53
84
|
}
|
|
@@ -10,7 +10,14 @@ export interface ButtonIcon extends IconProps {
|
|
|
10
10
|
|
|
11
11
|
type ButtonBaseProps = {
|
|
12
12
|
label?: string;
|
|
13
|
-
variant?:
|
|
13
|
+
variant?:
|
|
14
|
+
| 'primary'
|
|
15
|
+
| 'secondary'
|
|
16
|
+
| 'accent-cool'
|
|
17
|
+
| 'accent-warm'
|
|
18
|
+
| 'base'
|
|
19
|
+
| 'outline'
|
|
20
|
+
| 'unstyled';
|
|
14
21
|
type?: 'button' | 'submit' | 'reset';
|
|
15
22
|
disabled?: boolean;
|
|
16
23
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
@@ -27,8 +34,10 @@ type ButtonBaseProps = {
|
|
|
27
34
|
extraAttributes?: Record<string, unknown>;
|
|
28
35
|
};
|
|
29
36
|
|
|
30
|
-
type AnchorButtonProps = ButtonBaseProps &
|
|
31
|
-
|
|
37
|
+
type AnchorButtonProps = ButtonBaseProps &
|
|
38
|
+
React.AnchorHTMLAttributes<HTMLAnchorElement> & { href: string };
|
|
39
|
+
export type NativeButtonProps = ButtonBaseProps &
|
|
40
|
+
React.ButtonHTMLAttributes<HTMLButtonElement> & { href?: undefined };
|
|
32
41
|
export type ButtonProps = AnchorButtonProps | NativeButtonProps;
|
|
33
42
|
|
|
34
43
|
export default function Button({
|
|
@@ -1,6 +1,24 @@
|
|
|
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
|
+
href="/liberty-island-notes.txt"
|
|
7
|
+
download="Liberty Island notes.txt"
|
|
8
|
+
class="usa-button usx-button usa-button--unstyled"
|
|
9
|
+
>
|
|
10
|
+
Download island notes
|
|
11
|
+
</a>
|
|
12
|
+
|
|
13
|
+
<h3 class="site-preview-heading">Button styled as a tag</h3>
|
|
14
|
+
<button
|
|
15
|
+
type="button"
|
|
16
|
+
class="usa-button usx-button usa-button--unstyled usa-tag usx-tag usx-tag--outline usx-tag--interactive"
|
|
17
|
+
onclick="window.alert('Topic selected')"
|
|
18
|
+
>
|
|
19
|
+
Choose topic
|
|
20
|
+
</button>
|
|
21
|
+
|
|
4
22
|
<h3 class="site-preview-heading">Default Hover</h3>
|
|
5
23
|
<button type="button" class="usa-button usx-button usa-button--hover">Hover</button>
|
|
6
24
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
{% if href %}
|
|
4
4
|
<a
|
|
5
5
|
href="{{ href }}"
|
|
6
|
+
{% if download != None and download is not False %}{% if download is True %}download{% else %}download="{{ download }}"{% endif %}{% endif %}
|
|
6
7
|
class="
|
|
7
8
|
usa-button usx-button
|
|
8
9
|
{% if variant %} usa-button--{{ variant }}{% endif %}
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
{% if ghost == True %} usx-button--ghost{% endif %}
|
|
29
30
|
{% if className %} {{ className }}{% endif %}
|
|
30
31
|
"
|
|
31
|
-
{% if disabled == True %} disabled aria-disabled="true"
|
|
32
|
+
{% if disabled == True %} disabled aria-disabled="true"{% endif %}
|
|
32
33
|
{% if extraAttributes %}{% for attr, value in extraAttributes.items %} {{ attr }}="{% if value is True %}true{% elif value is False %}false{% else %}{{ value }}{% endif %}"{% endfor %}{% endif %}
|
|
33
34
|
>
|
|
34
35
|
{% endif %}
|
|
@@ -55,4 +56,4 @@
|
|
|
55
56
|
</a>
|
|
56
57
|
{% else %}
|
|
57
58
|
</button>
|
|
58
|
-
{% endif %}
|
|
59
|
+
{% endif %}
|