@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.
Files changed (240) hide show
  1. package/README.md +31 -0
  2. package/dist/Popover-Bg4-2-cU.cjs +987 -0
  3. package/dist/Popover-CqHczzNE.js +988 -0
  4. package/dist/chat.cjs +1396 -0
  5. package/dist/chat.js +1396 -0
  6. package/dist/index.cjs +4412 -5247
  7. package/dist/index.js +140 -972
  8. package/package.json +9 -5
  9. package/src/chat.js +15 -0
  10. package/src/components/accordion/Accordion.tsx +9 -57
  11. package/src/components/accordion/accordion.django.html +10 -20
  12. package/src/components/accordion/config.json +8 -2
  13. package/src/components/accordion-item/AccordionItem.tsx +54 -0
  14. package/src/components/accordion-item/accordion-item.django.html +19 -0
  15. package/src/components/accordion-item/accordion-item.html +8 -0
  16. package/src/components/accordion-item/config.json +55 -0
  17. package/src/components/alert/alert.django-snapshot.html +4 -4
  18. package/src/components/avatar/Avatar.tsx +54 -16
  19. package/src/components/avatar/avatar.django-snapshot.html +118 -2
  20. package/src/components/avatar/avatar.django.html +2 -2
  21. package/src/components/avatar/avatar.html +25 -0
  22. package/src/components/avatar/avatar.react-snapshot.html +110 -3
  23. package/src/components/avatar/config.json +17 -17
  24. package/src/components/avatar-group/AvatarGroup.tsx +17 -15
  25. package/src/components/avatar-group/avatar-group.django-snapshot.html +196 -174
  26. package/src/components/avatar-group/avatar-group.django.html +1 -1
  27. package/src/components/avatar-group/avatar-group.react-snapshot.html +216 -165
  28. package/src/components/avatar-group/config.json +14 -8
  29. package/src/components/back-to-top/BackToTop.tsx +21 -57
  30. package/src/components/back-to-top/back-to-top.django-snapshot.html +101 -202
  31. package/src/components/back-to-top/back-to-top.django.html +11 -38
  32. package/src/components/back-to-top/back-to-top.html +22 -106
  33. package/src/components/back-to-top/back-to-top.react-snapshot.html +94 -148
  34. package/src/components/back-to-top/config.json +41 -10
  35. package/src/components/banner/banner.django-snapshot.html +2 -2
  36. package/src/components/button/Button.tsx +15 -3
  37. package/src/components/button/button.django-snapshot.html +82 -0
  38. package/src/components/button/button.django.html +5 -2
  39. package/src/components/button/button.react-snapshot.html +80 -0
  40. package/src/components/button/config.json +17 -3
  41. package/src/components/callout/callout.django.html +1 -1
  42. package/src/components/callout/config.json +7 -16
  43. package/src/components/card/card.django-snapshot.html +43 -0
  44. package/src/components/card/card.react-snapshot.html +36 -0
  45. package/src/components/character-count/CharacterCount.tsx +2 -0
  46. package/src/components/character-count/character-count.react-snapshot.html +7 -0
  47. package/src/components/chat/Chat.tsx +575 -0
  48. package/src/components/chat/README.md +174 -0
  49. package/src/components/chat/avatarProps.ts +32 -0
  50. package/src/components/chat/chat.django-snapshot.html +23579 -0
  51. package/src/components/chat/chat.django.html +75 -0
  52. package/src/components/chat/chat.html +116 -0
  53. package/src/components/chat/chat.react-snapshot.html +16895 -0
  54. package/src/components/chat/config.json +1241 -0
  55. package/src/components/chat-attachment/ChatAttachment.tsx +39 -0
  56. package/src/components/chat-attachment/chat-attachment.django.html +24 -0
  57. package/src/components/chat-attachment/chat-attachment.html +10 -0
  58. package/src/components/chat-attachment/config.json +27 -0
  59. package/src/components/chat-attachments/ChatAttachments.tsx +17 -0
  60. package/src/components/chat-attachments/chat-attachments.django-snapshot.html +58 -0
  61. package/src/components/chat-attachments/chat-attachments.django.html +10 -0
  62. package/src/components/chat-attachments/chat-attachments.html +14 -0
  63. package/src/components/chat-attachments/chat-attachments.react-snapshot.html +46 -0
  64. package/src/components/chat-attachments/config.json +25 -0
  65. package/src/components/chat-bubble/ChatBubble.tsx +39 -0
  66. package/src/components/chat-bubble/ChatFormattedText.tsx +138 -0
  67. package/src/components/chat-bubble/chat-bubble.django-snapshot.html +128 -0
  68. package/src/components/chat-bubble/chat-bubble.django.html +19 -0
  69. package/src/components/chat-bubble/chat-bubble.html +1 -0
  70. package/src/components/chat-bubble/chat-bubble.react-snapshot.html +118 -0
  71. package/src/components/chat-bubble/config.json +70 -0
  72. package/src/components/chat-composer/ChatComposer.tsx +213 -0
  73. package/src/components/chat-composer/README.md +15 -0
  74. package/src/components/chat-composer/chat-composer.django-snapshot.html +575 -0
  75. package/src/components/chat-composer/chat-composer.django.html +77 -0
  76. package/src/components/chat-composer/chat-composer.html +44 -0
  77. package/src/components/chat-composer/chat-composer.react-snapshot.html +519 -0
  78. package/src/components/chat-composer/chat-formatting.django.html +59 -0
  79. package/src/components/chat-composer/config.json +137 -0
  80. package/src/components/chat-context/ChatContext.tsx +46 -0
  81. package/src/components/chat-context/chat-context.django-snapshot.html +35 -0
  82. package/src/components/chat-context/chat-context.django.html +20 -0
  83. package/src/components/chat-context/chat-context.html +9 -0
  84. package/src/components/chat-context/chat-context.react-snapshot.html +30 -0
  85. package/src/components/chat-context/config.json +36 -0
  86. package/src/components/chat-controls/ChatControls.tsx +67 -0
  87. package/src/components/chat-controls/chat-controls.django-snapshot.html +114 -0
  88. package/src/components/chat-controls/chat-controls.django.html +36 -0
  89. package/src/components/chat-controls/chat-controls.html +11 -0
  90. package/src/components/chat-controls/chat-controls.react-snapshot.html +107 -0
  91. package/src/components/chat-controls/config.json +67 -0
  92. package/src/components/chat-directory/ChatDirectory.tsx +168 -0
  93. package/src/components/chat-directory/chat-directory.django-snapshot.html +546 -0
  94. package/src/components/chat-directory/chat-directory.django.html +14 -0
  95. package/src/components/chat-directory/chat-directory.html +4 -0
  96. package/src/components/chat-directory/chat-directory.react-snapshot.html +471 -0
  97. package/src/components/chat-directory/config.json +242 -0
  98. package/src/components/chat-directory-item/ChatDirectoryItem.tsx +150 -0
  99. package/src/components/chat-directory-item/chat-directory-item.django-snapshot.html +281 -0
  100. package/src/components/chat-directory-item/chat-directory-item.django.html +38 -0
  101. package/src/components/chat-directory-item/chat-directory-item.html +9 -0
  102. package/src/components/chat-directory-item/chat-directory-item.react-snapshot.html +249 -0
  103. package/src/components/chat-directory-item/config.json +103 -0
  104. package/src/components/chat-history/ChatHistory.tsx +30 -0
  105. package/src/components/chat-history/chat-history.django-snapshot.html +113 -0
  106. package/src/components/chat-history/chat-history.django.html +20 -0
  107. package/src/components/chat-history/chat-history.html +9 -0
  108. package/src/components/chat-history/chat-history.react-snapshot.html +111 -0
  109. package/src/components/chat-history/config.json +24 -0
  110. package/src/components/chat-message/ChatMessage.tsx +148 -0
  111. package/src/components/chat-message/chat-message.django-snapshot.html +758 -0
  112. package/src/components/chat-message/chat-message.django.html +56 -0
  113. package/src/components/chat-message/chat-message.html +12 -0
  114. package/src/components/chat-message/chat-message.react-snapshot.html +627 -0
  115. package/src/components/chat-message/config.json +278 -0
  116. package/src/components/chat-message-actions/ChatMessageActions.tsx +133 -0
  117. package/src/components/chat-message-actions/chat-message-actions.django-snapshot.html +345 -0
  118. package/src/components/chat-message-actions/chat-message-actions.django.html +29 -0
  119. package/src/components/chat-message-actions/chat-message-actions.html +53 -0
  120. package/src/components/chat-message-actions/chat-message-actions.react-snapshot.html +295 -0
  121. package/src/components/chat-message-actions/config.json +121 -0
  122. package/src/components/chat-window/ChatWindow.tsx +135 -0
  123. package/src/components/chat-window/chat-window.django-snapshot.html +450 -0
  124. package/src/components/chat-window/chat-window.django.html +39 -0
  125. package/src/components/chat-window/chat-window.html +26 -0
  126. package/src/components/chat-window/chat-window.react-snapshot.html +286 -0
  127. package/src/components/chat-window/config.json +123 -0
  128. package/src/components/checkbox/checkbox.django-snapshot.html +2 -2
  129. package/src/components/clickable/Clickable.tsx +19 -5
  130. package/src/components/clickable/clickable.django-snapshot.html +11 -2
  131. package/src/components/clickable/clickable.django.html +2 -0
  132. package/src/components/clickable/clickable.react-snapshot.html +10 -2
  133. package/src/components/clickable/config.json +4 -0
  134. package/src/components/code/code.django-snapshot.html +25 -18
  135. package/src/components/code/code.react-snapshot.html +41 -4
  136. package/src/components/copy-to-clipboard/CopyToClipboard.tsx +2 -7
  137. package/src/components/copy-to-clipboard/copy-to-clipboard.django-snapshot.html +6 -4
  138. package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +3 -2
  139. package/src/components/copy-to-clipboard/copy-to-clipboard.react-snapshot.html +14 -2
  140. package/src/components/data-table/data-table.django-snapshot.html +4 -5
  141. package/src/components/data-table/data-table.react-snapshot.html +4 -4
  142. package/src/components/drawer/drawer.django-snapshot.html +53 -30
  143. package/src/components/error-page/error-page.django-snapshot.html +20 -7
  144. package/src/components/fieldset/fieldset.django-snapshot.html +1 -6
  145. package/src/components/file-list/FileList.tsx +3 -2
  146. package/src/components/file-list/config.json +5 -0
  147. package/src/components/file-list/file-list.django-snapshot.html +63 -0
  148. package/src/components/file-list/file-list.django.html +1 -1
  149. package/src/components/file-list/file-list.react-snapshot.html +53 -0
  150. package/src/components/footer/footer.django-snapshot.html +0 -3
  151. package/src/components/form-group/form-group.django-snapshot.html +0 -2
  152. package/src/components/header/header.django-snapshot.html +3 -163
  153. package/src/components/header/header.django.html +2 -2
  154. package/src/components/header/header.html +1 -1
  155. package/src/components/header/header.react-snapshot.html +3 -3
  156. package/src/components/hero/hero.django-snapshot.html +0 -20
  157. package/src/components/hero/hero.django.html +3 -3
  158. package/src/components/identifier/config.json +4 -2
  159. package/src/components/identifier/identifier.django-snapshot.html +13 -16
  160. package/src/components/identifier/identifier.react-snapshot.html +13 -15
  161. package/src/components/image/image.django-snapshot.html +6 -6
  162. package/src/components/image/image.django.html +4 -4
  163. package/src/components/input/Input.tsx +1 -1
  164. package/src/components/input/config.json +2 -3
  165. package/src/components/input/input.django-snapshot.html +4 -21
  166. package/src/components/input/input.django.html +2 -2
  167. package/src/components/layout/layout.django-snapshot.html +2 -0
  168. package/src/components/link/Link.tsx +7 -4
  169. package/src/components/link/config.json +2 -3
  170. package/src/components/link/link.django-snapshot.html +8 -0
  171. package/src/components/link/link.django.html +2 -2
  172. package/src/components/link/link.html +4 -1
  173. package/src/components/link/link.react-snapshot.html +8 -0
  174. package/src/components/memorable-date/memorable-date.django-snapshot.html +0 -8
  175. package/src/components/memorable-date/memorable-date.django.html +2 -2
  176. package/src/components/misc-banner/misc-banner.django-snapshot.html +12 -12
  177. package/src/components/misc-banner/misc-banner.django.html +4 -2
  178. package/src/components/modal/Modal.tsx +4 -3
  179. package/src/components/modal/config.json +3 -2
  180. package/src/components/modal/modal.django-snapshot.html +70 -14
  181. package/src/components/modal/modal.django.html +7 -9
  182. package/src/components/modal/modal.html +4 -4
  183. package/src/components/modal/modal.react-snapshot.html +64 -4
  184. package/src/components/page/Page.tsx +10 -7
  185. package/src/components/page/page.django-snapshot.html +5 -8
  186. package/src/components/page/page.django.html +2 -2
  187. package/src/components/page/page.html +1 -2
  188. package/src/components/page/page.react-snapshot.html +5 -8
  189. package/src/components/pagination/navigation/PaginationNavigation.tsx +2 -0
  190. package/src/components/pagination/navigation/pagination-navigation.django.html +2 -0
  191. package/src/components/pagination/pagination.django-snapshot.html +62 -0
  192. package/src/components/pagination/pagination.django.html +3 -1
  193. package/src/components/pagination/pagination.html +46 -0
  194. package/src/components/pagination/pagination.react-snapshot.html +48 -0
  195. package/src/components/pagination/summary/PaginationSummary.tsx +1 -1
  196. package/src/components/pagination/summary/pagination-summary.django.html +1 -1
  197. package/src/components/popover/Popover.tsx +61 -9
  198. package/src/components/popover/PopoverMenu.tsx +33 -15
  199. package/src/components/popover/config.json +88 -14
  200. package/src/components/popover/popover-menu.django.html +13 -2
  201. package/src/components/popover/popover.django-snapshot.html +265 -7
  202. package/src/components/popover/popover.django.html +3 -2
  203. package/src/components/popover/popover.react-snapshot.html +154 -4
  204. package/src/components/process-list/config.json +41 -3
  205. package/src/components/quote/Quote.tsx +9 -2
  206. package/src/components/search/Search.tsx +1 -1
  207. package/src/components/search/config.json +3 -4
  208. package/src/components/search/search.django-snapshot.html +262 -1684
  209. package/src/components/search/search.django.html +1 -20
  210. package/src/components/section/Section.tsx +3 -1
  211. package/src/components/select/select.django-snapshot.html +7 -7
  212. package/src/components/select/select.react-snapshot.html +7 -7
  213. package/src/components/site-alert/site-alert.django-snapshot.html +8 -8
  214. package/src/components/summary/Summary.tsx +4 -2
  215. package/src/components/summary/config.json +4 -0
  216. package/src/components/summary/summary.django.html +4 -4
  217. package/src/components/swap/Swap.tsx +35 -3
  218. package/src/components/swap/config.json +28 -1
  219. package/src/components/swap/swap.django-snapshot.html +29 -7
  220. package/src/components/swap/swap.django.html +15 -1
  221. package/src/components/swap/swap.react-snapshot.html +34 -4
  222. package/src/components/table/Table.tsx +58 -25
  223. package/src/components/table/config.json +61 -13
  224. package/src/components/tag/Tag.tsx +40 -7
  225. package/src/components/tag/config.json +18 -2
  226. package/src/components/tag/tag.django-snapshot.html +16 -1
  227. package/src/components/tag/tag.django.html +12 -6
  228. package/src/components/tag/tag.html +4 -0
  229. package/src/components/tag/tag.react-snapshot.html +16 -1
  230. package/src/components/tag-group/TagGroup.tsx +6 -9
  231. package/src/components/tag-group/config.json +4 -0
  232. package/src/components/tag-group/tag-group.django.html +1 -1
  233. package/src/components/theme-picker/ThemePicker.tsx +48 -42
  234. package/src/components/theme-picker/config.json +27 -29
  235. package/src/components/theme-picker/theme-picker-select.django.html +1 -1
  236. package/src/components/theme-picker/theme-picker.django-snapshot.html +283 -78
  237. package/src/components/theme-picker/theme-picker.django.html +24 -11
  238. package/src/components/theme-picker/theme-picker.html +155 -54
  239. package/src/components/theme-picker/theme-picker.react-snapshot.html +265 -67
  240. package/src/index.js +1 -0
@@ -1,156 +1,75 @@
1
1
  <h3 class="site-preview-heading">Default</h3>
2
- <button
3
- type="button"
4
- class="usa-button usx-button usx-button--ghost"
5
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
6
- >
7
- Back to top
8
-
9
- <svg
10
- class="margin-left-05 usa-icon usx-icon usa-icon--size-2"
11
- aria-hidden="true"
12
- focusable="false"
13
- role="img"
14
- >
15
- <use href="./img/sprite.svg#arrow_upward"></use>
16
- </svg>
17
- </button>
18
-
19
- <h3 class="site-preview-heading">Primary</h3>
20
- <button
21
- type="button"
22
- class="usa-button usx-button usa-button--primary usx-button--ghost"
23
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
24
- >
2
+ <a href="#top" class="usa-button usx-button usa-button--primary usx-button--ghost">
25
3
  Back to top
26
4
 
27
- <svg
28
- class="margin-left-05 usa-icon usx-icon usa-icon--size-2"
29
- aria-hidden="true"
30
- focusable="false"
31
- role="img"
32
- >
33
- <use href="./img/sprite.svg#arrow_upward"></use>
34
- </svg>
35
- </button>
36
-
37
- <h3 class="site-preview-heading">Icon Only Small</h3>
38
- <button
39
- type="button"
40
- aria-label="Back to top"
41
- class="usa-button usx-button usa-button--primary usx-button--ghost width-6"
42
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
43
- >
44
- <svg
45
- class="margin-left-05 usa-icon usx-icon usa-icon--size-3"
46
- aria-hidden="true"
47
- focusable="false"
48
- role="img"
49
- >
50
- <use href="./img/sprite.svg#arrow_upward"></use>
5
+ <svg class="usa-icon usx-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
6
+ <use href="img/sprite.svg#arrow_upward"></use>
51
7
  </svg>
52
- </button>
8
+ </a>
53
9
 
54
- <h3 class="site-preview-heading">Icon Only Large</h3>
55
- <button
56
- type="button"
57
- aria-label="Back to top"
58
- class="usa-button usx-button usa-button--primary usx-button--ghost width-7"
59
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
60
- >
61
- <svg
62
- class="margin-left-05 usa-icon usx-icon usa-icon--size-4"
63
- aria-hidden="true"
64
- focusable="false"
65
- role="img"
66
- >
67
- <use href="./img/sprite.svg#arrow_upward"></use>
10
+ <h3 class="site-preview-heading">Icon Left</h3>
11
+ <a href="#top" class="usa-button usx-button usa-button--primary usx-button--ghost">
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>
68
14
  </svg>
69
- </button>
70
15
 
71
- <h3 class="site-preview-heading">Link Default</h3>
72
- <a class="usx-link usx-no-visited flex-align-center" href="#back-to-top">
73
16
  Back to top
74
-
75
- <svg
76
- class="margin-left-05 usa-icon usx-icon usa-icon--size-2"
77
- aria-hidden="true"
78
- focusable="false"
79
- role="img"
80
- >
81
- <use href="./img/sprite.svg#arrow_upward"></use>
82
- </svg>
83
17
  </a>
84
18
 
85
- <h3 class="site-preview-heading">Default Icon Left</h3>
86
- <button
87
- type="button"
88
- class="usa-button usx-button usx-button--ghost"
89
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
19
+ <h3 class="site-preview-heading">Icon Only Small</h3>
20
+ <a
21
+ href="#top"
22
+ class="usa-button usx-button usa-button--primary usx-button--ghost"
23
+ aria-label="Back to top"
90
24
  >
91
- <svg
92
- class="margin-right-05 usa-icon usx-icon usa-icon--size-2"
93
- aria-hidden="true"
94
- focusable="false"
95
- role="img"
96
- >
97
- <use href="./img/sprite.svg#arrow_upward"></use>
25
+ <svg class="usa-icon usx-icon usa-icon--size-3" aria-hidden="true" focusable="false" role="img">
26
+ <use href="img/sprite.svg#arrow_upward"></use>
98
27
  </svg>
28
+ </a>
99
29
 
100
- Back to top
101
- </button>
102
-
103
- <h3 class="site-preview-heading">Primary Icon Left</h3>
104
- <button
105
- type="button"
30
+ <h3 class="site-preview-heading">Icon Only Large</h3>
31
+ <a
32
+ href="#top"
106
33
  class="usa-button usx-button usa-button--primary usx-button--ghost"
107
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
34
+ aria-label="Back to top"
108
35
  >
109
- <svg
110
- class="margin-right-05 usa-icon usx-icon usa-icon--size-2"
111
- aria-hidden="true"
112
- focusable="false"
113
- role="img"
114
- >
115
- <use href="./img/sprite.svg#arrow_upward"></use>
36
+ <svg class="usa-icon usx-icon usa-icon--size-4" aria-hidden="true" focusable="false" role="img">
37
+ <use href="img/sprite.svg#arrow_upward"></use>
116
38
  </svg>
117
-
118
- Back to top
119
- </button>
120
-
121
- <h3 class="site-preview-heading">Link Icon Left</h3>
122
- <a class="usx-link usx-no-visited flex-align-center" href="#back-to-top">
123
- <svg
124
- class="margin-right-05 usa-icon usx-icon usa-icon--size-2"
125
- aria-hidden="true"
126
- focusable="false"
127
- role="img"
128
- >
129
- <use href="./img/sprite.svg#arrow_upward"></use>
130
- </svg>
131
-
132
- Back to top
133
39
  </a>
134
40
 
135
41
  <h3 class="site-preview-heading">Link On Dark</h3>
136
- <div class="bg-primary-darkest padding-1">
42
+ <div class="bg-surface-inverse padding-1">
137
43
  <a
138
- class="usx-link usx-no-visited flex-align-center text-white hover:text-accent-cool"
139
- href="#back-to-top"
44
+ href="#top"
45
+ class="usa-button usx-button usa-button--primary usa-button--inverse usx-button--ghost"
140
46
  >
141
47
  Back to top
142
48
 
143
- <svg
144
- class="margin-left-05 usa-icon usx-icon usa-icon--size-2"
145
- aria-hidden="true"
146
- focusable="false"
147
- role="img"
148
- >
149
- <use href="./img/sprite.svg#arrow_upward"></use>
49
+ <svg class="usa-icon usx-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
50
+ <use href="img/sprite.svg#arrow_upward"></use>
150
51
  </svg>
151
52
  </a>
152
53
  </div>
153
54
 
55
+ <h3 class="site-preview-heading">Custom Href</h3>
56
+ <a href="#storybook-root" class="usa-button usx-button usa-button--primary usx-button--ghost">
57
+ Back to preview
58
+
59
+ <svg class="usa-icon usx-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
60
+ <use href="img/sprite.svg#arrow_upward"></use>
61
+ </svg>
62
+ </a>
63
+
64
+ <h3 class="site-preview-heading">With On Click</h3>
65
+ <button type="button" class="usa-button usx-button usa-button--primary usx-button--ghost">
66
+ Back to top
67
+
68
+ <svg class="usa-icon usx-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
69
+ <use href="img/sprite.svg#arrow_upward"></use>
70
+ </svg>
71
+ </button>
72
+
154
73
  <h3 class="site-preview-heading">All Variants</h3>
155
74
  <div class="display-flex flex-wrap" style="gap: 2rem">
156
75
  <div
@@ -158,178 +77,158 @@
158
77
  style="gap: 0.5rem"
159
78
  >
160
79
  <h4>Button (icon right)</h4>
161
- <button
162
- type="button"
163
- class="usa-button usx-button usx-button--ghost"
164
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
165
- >
80
+ <a href="#top" class="usa-button usx-button usa-button--primary usx-button--ghost">
166
81
  Back to top
167
82
 
168
83
  <svg
169
- class="margin-left-05 usa-icon usx-icon usa-icon--size-2"
84
+ class="usa-icon usx-icon usa-icon--size-2"
170
85
  aria-hidden="true"
171
86
  focusable="false"
172
87
  role="img"
173
88
  >
174
- <use href="./img/sprite.svg#arrow_upward"></use>
175
- </svg></button
176
- ><button
177
- type="button"
178
- class="usa-button usx-button usa-button--primary usx-button--ghost"
179
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
180
- >
89
+ <use href="img/sprite.svg#arrow_upward"></use>
90
+ </svg> </a
91
+ ><a href="#top" class="usa-button usx-button usa-button--primary">
181
92
  Back to top
182
93
 
183
94
  <svg
184
- class="margin-left-05 usa-icon usx-icon usa-icon--size-2"
95
+ class="usa-icon usx-icon usa-icon--size-2"
185
96
  aria-hidden="true"
186
97
  focusable="false"
187
98
  role="img"
188
99
  >
189
- <use href="./img/sprite.svg#arrow_upward"></use>
190
- </svg></button
191
- ><button
192
- type="button"
193
- aria-label="Back to top"
100
+ <use href="img/sprite.svg#arrow_upward"></use>
101
+ </svg> </a
102
+ ><a
103
+ href="#top"
194
104
  class="usa-button usx-button usa-button--primary usx-button--ghost width-6"
195
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
105
+ aria-label="Back to top"
196
106
  >
197
107
  <svg
198
- class="margin-left-05 usa-icon usx-icon usa-icon--size-3"
108
+ class="usa-icon usx-icon usa-icon--size-3"
199
109
  aria-hidden="true"
200
110
  focusable="false"
201
111
  role="img"
202
112
  >
203
- <use href="./img/sprite.svg#arrow_upward"></use>
204
- </svg></button
205
- ><button
206
- type="button"
207
- aria-label="Back to top"
113
+ <use href="img/sprite.svg#arrow_upward"></use>
114
+ </svg> </a
115
+ ><a
116
+ href="#top"
208
117
  class="usa-button usx-button usa-button--primary usx-button--ghost width-7"
209
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
118
+ aria-label="Back to top"
210
119
  >
211
120
  <svg
212
- class="margin-left-05 usa-icon usx-icon usa-icon--size-4"
121
+ class="usa-icon usx-icon usa-icon--size-4"
213
122
  aria-hidden="true"
214
123
  focusable="false"
215
124
  role="img"
216
125
  >
217
- <use href="./img/sprite.svg#arrow_upward"></use>
218
- </svg></button
219
- ><a class="usx-link usx-no-visited flex-align-center" href="#back-to-top">
126
+ <use href="img/sprite.svg#arrow_upward"></use>
127
+ </svg> </a
128
+ ><a href="#storybook-root" class="usa-button usx-button usa-button--unstyled">
220
129
  Back to top
221
130
 
222
131
  <svg
223
- class="margin-left-05 usa-icon usx-icon usa-icon--size-2"
132
+ class="usa-icon usx-icon usa-icon--size-2"
224
133
  aria-hidden="true"
225
134
  focusable="false"
226
135
  role="img"
227
136
  >
228
- <use href="./img/sprite.svg#arrow_upward"></use>
137
+ <use href="img/sprite.svg#arrow_upward"></use>
229
138
  </svg>
230
139
  </a>
231
- <div class="bg-primary-darkest padding-1">
140
+ <div class="bg-surface-inverse padding-1">
232
141
  <a
233
- class="usx-link usx-no-visited flex-align-center text-white hover:text-accent-cool"
234
- href="#back-to-top"
142
+ href="#top"
143
+ class="usa-button usx-button usa-button--primary usa-button--inverse usx-button--ghost"
235
144
  >
236
145
  Back to top
237
146
 
238
147
  <svg
239
- class="margin-left-05 usa-icon usx-icon usa-icon--size-2"
148
+ class="usa-icon usx-icon usa-icon--size-2"
240
149
  aria-hidden="true"
241
150
  focusable="false"
242
151
  role="img"
243
152
  >
244
- <use href="./img/sprite.svg#arrow_upward"></use>
153
+ <use href="img/sprite.svg#arrow_upward"></use>
245
154
  </svg>
246
155
  </a>
247
156
  </div>
248
157
  </div>
249
158
  <div class="display-flex flex-column flex-align-end margin-left-auto" style="gap: 0.5rem">
250
159
  <h4>Button (icon left)</h4>
251
- <button
252
- type="button"
253
- class="usa-button usx-button usx-button--ghost"
254
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
255
- >
160
+ <a href="#top" class="usa-button usx-button usa-button--primary usx-button--ghost">
256
161
  <svg
257
- class="margin-right-05 usa-icon usx-icon usa-icon--size-2"
162
+ class="usa-icon usx-icon usa-icon--size-2"
258
163
  aria-hidden="true"
259
164
  focusable="false"
260
165
  role="img"
261
166
  >
262
- <use href="./img/sprite.svg#arrow_upward"></use>
167
+ <use href="img/sprite.svg#arrow_upward"></use>
263
168
  </svg>
264
169
 
265
- Back to top</button
266
- ><button
267
- type="button"
268
- class="usa-button usx-button usa-button--primary usx-button--ghost"
269
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
270
- >
170
+ Back to top </a
171
+ ><a href="#top" class="usa-button usx-button usa-button--primary">
271
172
  <svg
272
- class="margin-right-05 usa-icon usx-icon usa-icon--size-2"
173
+ class="usa-icon usx-icon usa-icon--size-2"
273
174
  aria-hidden="true"
274
175
  focusable="false"
275
176
  role="img"
276
177
  >
277
- <use href="./img/sprite.svg#arrow_upward"></use>
178
+ <use href="img/sprite.svg#arrow_upward"></use>
278
179
  </svg>
279
180
 
280
- Back to top</button
281
- ><button
282
- type="button"
283
- aria-label="Back to top"
181
+ Back to top </a
182
+ ><a
183
+ href="#top"
284
184
  class="usa-button usx-button usa-button--primary usx-button--ghost width-6"
285
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
185
+ aria-label="Back to top"
286
186
  >
287
187
  <svg
288
- class="margin-left-05 usa-icon usx-icon usa-icon--size-3"
188
+ class="usa-icon usx-icon usa-icon--size-3"
289
189
  aria-hidden="true"
290
190
  focusable="false"
291
191
  role="img"
292
192
  >
293
- <use href="./img/sprite.svg#arrow_upward"></use>
294
- </svg></button
295
- ><button
296
- type="button"
297
- aria-label="Back to top"
193
+ <use href="img/sprite.svg#arrow_upward"></use>
194
+ </svg> </a
195
+ ><a
196
+ href="#top"
298
197
  class="usa-button usx-button usa-button--primary usx-button--ghost width-7"
299
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' })"
198
+ aria-label="Back to top"
300
199
  >
301
200
  <svg
302
- class="margin-left-05 usa-icon usx-icon usa-icon--size-4"
201
+ class="usa-icon usx-icon usa-icon--size-4"
303
202
  aria-hidden="true"
304
203
  focusable="false"
305
204
  role="img"
306
205
  >
307
- <use href="./img/sprite.svg#arrow_upward"></use>
308
- </svg></button
309
- ><a class="usx-link usx-no-visited flex-align-center" href="#back-to-top">
206
+ <use href="img/sprite.svg#arrow_upward"></use>
207
+ </svg> </a
208
+ ><a href="#storybook-root" class="usa-button usx-button usa-button--unstyled">
310
209
  <svg
311
- class="margin-right-05 usa-icon usx-icon usa-icon--size-2"
210
+ class="usa-icon usx-icon usa-icon--size-2"
312
211
  aria-hidden="true"
313
212
  focusable="false"
314
213
  role="img"
315
214
  >
316
- <use href="./img/sprite.svg#arrow_upward"></use>
215
+ <use href="img/sprite.svg#arrow_upward"></use>
317
216
  </svg>
318
217
 
319
218
  Back to top
320
219
  </a>
321
- <div class="bg-primary-darkest padding-1">
220
+ <div class="bg-surface-inverse padding-1">
322
221
  <a
323
- class="usx-link usx-no-visited flex-align-center text-white hover:text-accent-cool"
324
- href="#back-to-top"
222
+ href="#top"
223
+ class="usa-button usx-button usa-button--primary usa-button--inverse usx-button--ghost"
325
224
  >
326
225
  <svg
327
- class="margin-right-05 usa-icon usx-icon usa-icon--size-2"
226
+ class="usa-icon usx-icon usa-icon--size-2"
328
227
  aria-hidden="true"
329
228
  focusable="false"
330
229
  role="img"
331
230
  >
332
- <use href="./img/sprite.svg#arrow_upward"></use>
231
+ <use href="img/sprite.svg#arrow_upward"></use>
333
232
  </svg>
334
233
 
335
234
  Back to top
@@ -1,40 +1,13 @@
1
- {# Django template for BackToTop #}
2
- {% if href %}
3
- <a
4
- class="usx-link usx-no-visited flex-align-center{% if className %} {{ className }}{% endif %}"
5
- href="{{ href }}"
6
- {% if not label %}aria-label="{{ ariaLabel|default:'Back to top' }}"{% endif %}
7
- {% if tabindex %}tabindex="{{ tabindex }}"{% endif %}
8
- >
9
- {% if iconPosition == 'left' or not iconPosition %}
10
- <svg class="margin-right-05 usa-icon usx-icon usa-icon--size-{{ iconSize|default:'2' }}" aria-hidden="true" focusable="false" role="img">
11
- <use href="./img/sprite.svg#arrow_upward"></use>
12
- </svg>
13
- {% endif %}
14
- {% if label %}{{ label }}{% endif %}
15
- {% if iconPosition == 'right' %}
16
- <svg class="margin-left-05 usa-icon usx-icon usa-icon--size-{{ iconSize|default:'2' }}" aria-hidden="true" focusable="false" role="img">
17
- <use href="./img/sprite.svg#arrow_upward"></use>
18
- </svg>
19
- {% endif %}
20
- </a>
1
+ {% load usx_components %}
2
+ {% if onClick %}
3
+ {% dict as navigation %}
21
4
  {% else %}
22
- <button
23
- type="button"
24
- {% if not label %}aria-label="{{ ariaLabel|default:'Back to top' }}"{% endif %}
25
- class="usa-button usx-button{% if variant == 'primary' %} usa-button--primary{% endif %} usx-button--ghost{% if className %} {{ className }}{% endif %}"
26
- onclick="{{ onClick|default:'window.scrollTo({ top: 0, behavior: \'smooth\' });' }}"
27
- >
28
- {% if iconPosition == 'left' %}
29
- <svg class="margin-right-05 usa-icon usx-icon usa-icon--size-{{ iconSize|default:'2' }}" aria-hidden="true" focusable="false" role="img">
30
- <use href="./img/sprite.svg#arrow_upward"></use>
31
- </svg>
32
- {% endif %}
33
- {% if label %}{{ label }}{% endif %}
34
- {% if iconPosition != 'left' %}
35
- <svg class="margin-left-05 usa-icon usx-icon usa-icon--size-{{ iconSize|default:'2' }}" aria-hidden="true" focusable="false" role="img">
36
- <use href="./img/sprite.svg#arrow_upward"></use>
37
- </svg>
38
- {% endif %}
39
- </button>
5
+ {% dict href=href|default:'#top' as navigation %}
40
6
  {% endif %}
7
+ {% dict as attributes %}
8
+ {% if not label and ariaLabel != None %}
9
+ {% dict aria_label=ariaLabel as attributes %}
10
+ {% endif %}
11
+ {% dict name='arrow_upward' position=iconPosition size=iconSize as arrow %}
12
+ {% make_list arrow as icons %}
13
+ {% button props=navigation label=label variant=variant|default_if_none:'primary' ghost=ghost inverse=inverse iconProps=icons className=className extraAttributes=attributes %}{% endbutton %}
@@ -1,107 +1,23 @@
1
1
  <h3 id="back-to-top" class="site-preview-heading">Back to top</h3>
2
- <div class="display-flex flex-column flex-justify"
3
- style="height: 2000px; background-color: #8b8b8b; margin-bottom: 1rem;">
4
- <p style="padding: 1rem; color: white;">Scroll down to see the back to top button.</p>
5
- <hr style="width: 100%; color: white;" />
6
- <p style="padding: 1rem; color: white;">Keep scrolling...</p>
7
- <hr style="width: 100%; color: white;" />
8
- <p style="padding: 1rem; color: white;">Almost there...</p>
9
- <hr style="width: 100%; color: white;" />
10
- <p style="padding: 1rem; color: white;">You made it!</p>
11
- </div>
12
- <div class="display-flex flex-wrap">
13
- <div class="display-flex flex-column flex-justify-start flex-align-self-start">
14
- <button class="usa-button usx-button usx-button--ghost" onclick="window.scrollTo({ top: 0, behavior: 'smooth' });">
15
- Back to top
16
- <svg class="usa-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
17
- <use href="./img/sprite.svg#arrow_upward"></use>
18
- </svg>
19
- </button>
20
- <button class="usa-button usx-button usa-button--primary usx-button--ghost"
21
- onclick="window.scrollTo({ top: 0, behavior: 'smooth' });">
22
- Back to top
23
- <svg class="usa-icon usa-icon--size-2" aria-hidden="true" focusable="false" role="img">
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>