@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
@@ -16,7 +16,7 @@
16
16
  focusable="false"
17
17
  role="img"
18
18
  >
19
- <use href="./img/sprite.svg#arrow_forward"></use>
19
+ <use href="img/sprite.svg#arrow_forward"></use>
20
20
  </svg>
21
21
  Important Link
22
22
  </a>
@@ -40,7 +40,7 @@
40
40
  focusable="false"
41
41
  role="img"
42
42
  >
43
- <use href="./img/sprite.svg#expand_more"></use>
43
+ <use href="img/sprite.svg#expand_more"></use>
44
44
  </svg>
45
45
  </label>
46
46
  <div id="django-misc-banner-misc-dropdown" class="usx-misc-banner__dropdown-content">
@@ -80,7 +80,7 @@
80
80
  focusable="false"
81
81
  role="img"
82
82
  >
83
- <use href="./img/sprite.svg#arrow_forward"></use>
83
+ <use href="img/sprite.svg#arrow_forward"></use>
84
84
  </svg>
85
85
  Important Link
86
86
  </a>
@@ -104,7 +104,7 @@
104
104
  focusable="false"
105
105
  role="img"
106
106
  >
107
- <use href="./img/sprite.svg#expand_more"></use>
107
+ <use href="img/sprite.svg#expand_more"></use>
108
108
  </svg>
109
109
  </label>
110
110
  <div id="django-misc-banner-misc-dropdown" class="usx-misc-banner__dropdown-content">
@@ -144,7 +144,7 @@
144
144
  focusable="false"
145
145
  role="img"
146
146
  >
147
- <use href="./img/sprite.svg#undo"></use>
147
+ <use href="img/sprite.svg#undo"></use>
148
148
  </svg>
149
149
  Return to Classic Site
150
150
  </a>
@@ -168,7 +168,7 @@
168
168
  focusable="false"
169
169
  role="img"
170
170
  >
171
- <use href="./img/sprite.svg#expand_more"></use>
171
+ <use href="img/sprite.svg#expand_more"></use>
172
172
  </svg>
173
173
  </label>
174
174
  <div id="django-misc-banner-misc-dropdown" class="usx-misc-banner__dropdown-content">
@@ -204,7 +204,7 @@
204
204
  focusable="false"
205
205
  role="img"
206
206
  >
207
- <use href="./img/sprite.svg#trending_up"></use>
207
+ <use href="img/sprite.svg#trending_up"></use>
208
208
  </svg>
209
209
  Production Site
210
210
  </a>
@@ -228,7 +228,7 @@
228
228
  focusable="false"
229
229
  role="img"
230
230
  >
231
- <use href="./img/sprite.svg#expand_more"></use>
231
+ <use href="img/sprite.svg#expand_more"></use>
232
232
  </svg>
233
233
  </label>
234
234
  <div id="django-misc-banner-misc-dropdown" class="usx-misc-banner__dropdown-content">
@@ -258,7 +258,7 @@
258
258
  focusable="false"
259
259
  role="img"
260
260
  >
261
- <use href="./img/sprite.svg#trending_up"></use>
261
+ <use href="img/sprite.svg#trending_up"></use>
262
262
  </svg>
263
263
  Production Site
264
264
  </a>
@@ -282,7 +282,7 @@
282
282
  focusable="false"
283
283
  role="img"
284
284
  >
285
- <use href="./img/sprite.svg#expand_more"></use>
285
+ <use href="img/sprite.svg#expand_more"></use>
286
286
  </svg>
287
287
  </label>
288
288
  <div id="django-misc-banner-misc-dropdown" class="usx-misc-banner__dropdown-content">
@@ -323,7 +323,7 @@
323
323
  focusable="false"
324
324
  role="img"
325
325
  >
326
- <use href="./img/sprite.svg#arrow_forward"></use>
326
+ <use href="img/sprite.svg#arrow_forward"></use>
327
327
  </svg>
328
328
  Return to the main site
329
329
  </a>
@@ -347,7 +347,7 @@
347
347
  focusable="false"
348
348
  role="img"
349
349
  >
350
- <use href="./img/sprite.svg#expand_more"></use>
350
+ <use href="img/sprite.svg#expand_more"></use>
351
351
  </svg>
352
352
  </label>
353
353
  <div id="django-misc-banner-no-badge-dropdown" class="usx-misc-banner__dropdown-content">
@@ -1,4 +1,6 @@
1
1
  {# Django template for MiscBanner #}
2
+ {% load usx_components %}
3
+ {% asset_url 'img/sprite.svg' as spriteUrl %}
2
4
  <div {% if id %}id="{{ id }}" {% endif %}class="usx-misc-banner bg-{{ color|default:'beta' }}{% if className %} {{ className }}{% endif %}">
3
5
  <div class="usx-misc-banner__content grid-container">
4
6
  {% if content %}
@@ -17,7 +19,7 @@
17
19
  <span class="usx-misc-banner__return-text">
18
20
  <a class="usa-link usx-misc-banner__link" href="{{ importantLinkHref }}">
19
21
  <svg class="usa-icon usx-icon usx-icon--size-1" aria-hidden="true" focusable="false" role="img">
20
- <use href="./img/sprite.svg#{{ importantLinkIcon|default:'undo' }}"></use>
22
+ <use href="{{ spriteUrl }}#{{ importantLinkIcon|default:'undo' }}"></use>
21
23
  </svg>
22
24
  {{ importantLinkText }}
23
25
  </a>
@@ -38,7 +40,7 @@
38
40
  aria-label="Toggle banner links"
39
41
  >
40
42
  <svg class="usa-icon usx-icon usa-icon--size-4" aria-hidden="true" focusable="false" role="img">
41
- <use href="./img/sprite.svg#expand_more"></use>
43
+ <use href="{{ spriteUrl }}#expand_more"></use>
42
44
  </svg>
43
45
  </label>
44
46
  <div id="{{ dropdownBase }}-dropdown" class="usx-misc-banner__dropdown-content">
@@ -22,7 +22,7 @@ export default function Modal({
22
22
  description,
23
23
  actionProps = [
24
24
  { children: 'Continue', variant: 'primary', extraAttributes: { 'data-close-modal': true } },
25
- { children: 'Go back', variant: 'unstyled', className: 'padding-105 text-center', extraAttributes: { 'data-close-modal': true } },
25
+ { children: 'Go back', variant: 'unstyled', tighten: true, className: 'text-center', extraAttributes: { 'data-close-modal': true } },
26
26
  ],
27
27
  size = 'default',
28
28
  forceAction = false,
@@ -35,6 +35,7 @@ export default function Modal({
35
35
  'usa-modal--lg': size === 'lg',
36
36
  'usx-modal--lg-collapsed': size === 'lg-collapsed',
37
37
  }, className);
38
+ const hasChildren = children != null;
38
39
 
39
40
  return (
40
41
  <div
@@ -51,8 +52,8 @@ export default function Modal({
51
52
  <h2 className="usa-modal__heading" id={`${id}-heading`}>
52
53
  {heading}
53
54
  </h2>
54
- <Prose>
55
- <p id={`${id}-description`}>{children ?? description}</p>
55
+ <Prose id={hasChildren ? `${id}-description` : undefined}>
56
+ {hasChildren ? <>{children}</> : <p id={`${id}-description`}>{description}</p>}
56
57
  </Prose>
57
58
  <div className="usa-modal__footer">
58
59
  <ButtonGroup buttonProps={actionProps} />
@@ -17,7 +17,8 @@
17
17
  {
18
18
  "children": "Go back",
19
19
  "variant": "unstyled",
20
- "className": "padding-105 text-center",
20
+ "tighten": true,
21
+ "className": "text-center",
21
22
  "extraAttributes": {
22
23
  "data-close-modal": true
23
24
  }
@@ -69,7 +70,7 @@
69
70
  "children": {
70
71
  "type": "slot",
71
72
  "default": null,
72
- "description": "Inner HTML to render as the modal body, replacing the description text."
73
+ "description": "Content rendered directly inside the prose container, replacing the description paragraph. Include paragraphs or other block elements as needed; assistive technology may announce the body as a single description."
73
74
  },
74
75
  "className": {
75
76
  "type": "string",
@@ -19,13 +19,11 @@
19
19
  <h2 class="usa-modal__heading" id="django-example-modal-default-heading">
20
20
  Are you sure you want to continue?
21
21
  </h2>
22
-
23
22
  <div class="usa-prose usx-prose">
24
23
  <p id="django-example-modal-default-description">
25
24
  You have unsaved changes that will be lost.
26
25
  </p>
27
26
  </div>
28
-
29
27
  <div class="usa-modal__footer">
30
28
  <ul class="usa-button-group usx-button-group">
31
29
  <li class="usa-button-group__item">
@@ -41,7 +39,7 @@
41
39
  <li class="usa-button-group__item">
42
40
  <button
43
41
  type="button"
44
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
42
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
45
43
  data-close-modal="true"
46
44
  >
47
45
  Go back
@@ -85,11 +83,9 @@
85
83
  <h2 class="usa-modal__heading" id="django-example-modal-lg-heading">
86
84
  Are you sure you want to continue?
87
85
  </h2>
88
-
89
86
  <div class="usa-prose usx-prose">
90
87
  <p id="django-example-modal-lg-description">You have unsaved changes that will be lost.</p>
91
88
  </div>
92
-
93
89
  <div class="usa-modal__footer">
94
90
  <ul class="usa-button-group usx-button-group">
95
91
  <li class="usa-button-group__item">
@@ -105,7 +101,7 @@
105
101
  <li class="usa-button-group__item">
106
102
  <button
107
103
  type="button"
108
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
104
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
109
105
  data-close-modal="true"
110
106
  >
111
107
  Go back
@@ -149,13 +145,11 @@
149
145
  <h2 class="usa-modal__heading" id="django-example-modal-lg-collapsed-heading">
150
146
  Are you sure you want to continue?
151
147
  </h2>
152
-
153
148
  <div class="usa-prose usx-prose">
154
149
  <p id="django-example-modal-lg-collapsed-description">
155
150
  You have unsaved changes that will be lost.
156
151
  </p>
157
152
  </div>
158
-
159
153
  <div class="usa-modal__footer">
160
154
  <ul class="usa-button-group usx-button-group">
161
155
  <li class="usa-button-group__item">
@@ -171,7 +165,7 @@
171
165
  <li class="usa-button-group__item">
172
166
  <button
173
167
  type="button"
174
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
168
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
175
169
  data-close-modal="true"
176
170
  >
177
171
  Go back
@@ -216,14 +210,12 @@
216
210
  <h2 class="usa-modal__heading" id="django-example-modal-force-heading">
217
211
  Your session will end soon.
218
212
  </h2>
219
-
220
213
  <div class="usa-prose usx-prose">
221
214
  <p id="django-example-modal-force-description">
222
- You've been inactive for too long. Please choose to stay signed in or sign out. Otherwise,
223
- you'll be signed out automatically in 5 minutes.
215
+ You&#x27;ve been inactive for too long. Please choose to stay signed in or sign out.
216
+ Otherwise, you&#x27;ll be signed out automatically in 5 minutes.
224
217
  </p>
225
218
  </div>
226
-
227
219
  <div class="usa-modal__footer">
228
220
  <ul class="usa-button-group usx-button-group">
229
221
  <li class="usa-button-group__item">
@@ -239,7 +231,7 @@
239
231
  <li class="usa-button-group__item">
240
232
  <button
241
233
  type="button"
242
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
234
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
243
235
  data-close-modal="true"
244
236
  >
245
237
  Sign out
@@ -250,3 +242,67 @@
250
242
  </div>
251
243
  </div>
252
244
  </div>
245
+
246
+ <h3 class="site-preview-heading">Rich Content</h3>
247
+ <a
248
+ href="#django-example-modal-rich"
249
+ class="usa-button usx-button usa-button--outline"
250
+ aria-controls="django-example-modal-rich"
251
+ data-open-modal="true"
252
+ >
253
+ Open modal with rich content
254
+ </a>
255
+
256
+ <div
257
+ class="usa-modal usx-modal"
258
+ id="django-example-modal-rich"
259
+ aria-labelledby="django-example-modal-rich-heading"
260
+ aria-describedby="django-example-modal-rich-description"
261
+ >
262
+ <div class="usa-modal__content">
263
+ <div class="usa-modal__main">
264
+ <h2 class="usa-modal__heading" id="django-example-modal-rich-heading">Review your request</h2>
265
+ <div class="usa-prose usx-prose" id="django-example-modal-rich-description">
266
+ <p>Check the following items before continuing.</p>
267
+ <ul>
268
+ <li>Contact information</li>
269
+ <li>Supporting documents</li>
270
+ </ul>
271
+ </div>
272
+ <div class="usa-modal__footer">
273
+ <ul class="usa-button-group usx-button-group">
274
+ <li class="usa-button-group__item">
275
+ <button
276
+ type="button"
277
+ class="usa-button usx-button usa-button--primary"
278
+ data-close-modal="true"
279
+ >
280
+ Continue without saving
281
+ </button>
282
+ </li>
283
+
284
+ <li class="usa-button-group__item">
285
+ <button
286
+ type="button"
287
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
288
+ data-close-modal="true"
289
+ >
290
+ Go back
291
+ </button>
292
+ </li>
293
+ </ul>
294
+ </div>
295
+ </div>
296
+
297
+ <button
298
+ type="button"
299
+ class="usa-button usa-modal__close"
300
+ aria-label="Close this window"
301
+ data-close-modal="true"
302
+ >
303
+ <svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
304
+ <use href="img/sprite.svg#close"></use>
305
+ </svg>
306
+ </button>
307
+ </div>
308
+ </div>
@@ -12,15 +12,13 @@
12
12
  <h2 class="usa-modal__heading" id="{{ id }}-heading">
13
13
  {{ heading|default:"Are you sure you want to continue?" }}
14
14
  </h2>
15
- {% prose %}
16
- <p id="{{ id }}-description">
17
- {% if children %}
18
- {{ children|safe }}
19
- {% else %}
20
- {{ description|default:"You have unsaved changes that will be lost." }}
21
- {% endif %}
22
- </p>
23
- {% endprose %}
15
+ <div class="usa-prose usx-prose"{% if children is not None %} id="{{ id }}-description"{% endif %}>
16
+ {% if children is not None %}
17
+ {% if children and children is not True or children == 0 and children is not False %}{{ children|safe }}{% endif %}
18
+ {% else %}
19
+ <p id="{{ id }}-description">{{ description|default:"You have unsaved changes that will be lost." }}</p>
20
+ {% endif %}
21
+ </div>
24
22
  <div class="usa-modal__footer">
25
23
  {% button_group buttonProps=actionProps %}{% endbutton_group %}
26
24
  </div>
@@ -32,7 +32,7 @@
32
32
  <li class="usa-button-group__item">
33
33
  <button
34
34
  type="button"
35
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
35
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
36
36
  data-close-modal
37
37
  >
38
38
  Go back
@@ -90,7 +90,7 @@
90
90
  <li class="usa-button-group__item">
91
91
  <button
92
92
  type="button"
93
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
93
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
94
94
  data-close-modal
95
95
  >
96
96
  Go back
@@ -148,7 +148,7 @@
148
148
  <li class="usa-button-group__item">
149
149
  <button
150
150
  type="button"
151
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
151
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
152
152
  data-close-modal
153
153
  >
154
154
  Go back
@@ -208,7 +208,7 @@
208
208
  <li class="usa-button-group__item">
209
209
  <button
210
210
  type="button"
211
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
211
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
212
212
  data-close-modal
213
213
  >
214
214
  Sign out
@@ -36,7 +36,7 @@
36
36
  <li class="usa-button-group__item">
37
37
  <button
38
38
  type="button"
39
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
39
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
40
40
  data-close-modal="true"
41
41
  >
42
42
  Go back
@@ -94,7 +94,7 @@
94
94
  <li class="usa-button-group__item">
95
95
  <button
96
96
  type="button"
97
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
97
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
98
98
  data-close-modal="true"
99
99
  >
100
100
  Go back
@@ -154,7 +154,7 @@
154
154
  <li class="usa-button-group__item">
155
155
  <button
156
156
  type="button"
157
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
157
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
158
158
  data-close-modal="true"
159
159
  >
160
160
  Go back
@@ -216,7 +216,7 @@
216
216
  <li class="usa-button-group__item">
217
217
  <button
218
218
  type="button"
219
- class="usa-button usx-button usa-button--unstyled padding-105 text-center"
219
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
220
220
  data-close-modal="true"
221
221
  >
222
222
  Sign out
@@ -227,3 +227,63 @@
227
227
  </div>
228
228
  </div>
229
229
  </div>
230
+
231
+ <h3 class="site-preview-heading">Rich Content</h3>
232
+ <a
233
+ class="usa-button usx-button usa-button--outline"
234
+ href="#react-example-modal-rich"
235
+ aria-controls="react-example-modal-rich"
236
+ data-open-modal="true"
237
+ >Open modal with rich content</a
238
+ >
239
+ <div
240
+ class="usa-modal usx-modal"
241
+ id="react-example-modal-rich"
242
+ aria-labelledby="react-example-modal-rich-heading"
243
+ aria-describedby="react-example-modal-rich-description"
244
+ >
245
+ <div class="usa-modal__content">
246
+ <div class="usa-modal__main">
247
+ <h2 class="usa-modal__heading" id="react-example-modal-rich-heading">Review your request</h2>
248
+ <div class="usa-prose usx-prose" id="react-example-modal-rich-description">
249
+ <p>Check the following items before continuing.</p>
250
+ <ul>
251
+ <li>Contact information</li>
252
+ <li>Supporting documents</li>
253
+ </ul>
254
+ </div>
255
+ <div class="usa-modal__footer">
256
+ <ul class="usa-button-group usx-button-group">
257
+ <li class="usa-button-group__item">
258
+ <button
259
+ type="button"
260
+ class="usa-button usx-button usa-button--primary"
261
+ data-close-modal="true"
262
+ >
263
+ Continue without saving
264
+ </button>
265
+ </li>
266
+ <li class="usa-button-group__item">
267
+ <button
268
+ type="button"
269
+ class="usa-button usx-button usa-button--unstyled usx-button--tight text-center"
270
+ data-close-modal="true"
271
+ >
272
+ Go back
273
+ </button>
274
+ </li>
275
+ </ul>
276
+ </div>
277
+ </div>
278
+ <button
279
+ type="button"
280
+ class="usa-button usa-modal__close"
281
+ aria-label="Close this window"
282
+ data-close-modal="true"
283
+ >
284
+ <svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
285
+ <use href="/img/sprite.svg#close"></use>
286
+ </svg>
287
+ </button>
288
+ </div>
289
+ </div>
@@ -4,7 +4,7 @@ import TagGroup from '../tag-group/TagGroup';
4
4
  import type { TagProps } from '../tag/Tag';
5
5
 
6
6
  export interface PageProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title' | 'content'> {
7
- title?: React.ReactNode;
7
+ title: Exclude<React.ReactNode, null | undefined | boolean>;
8
8
  titleId?: string;
9
9
  eyebrow?: React.ReactNode;
10
10
  subtitle?: string;
@@ -18,7 +18,7 @@ export interface PageProps extends Omit<React.HTMLAttributes<HTMLElement>, 'titl
18
18
 
19
19
  export default function Page({
20
20
  id = undefined,
21
- title = 'Page title',
21
+ title,
22
22
  titleId = undefined,
23
23
  eyebrow = null,
24
24
  subtitle = undefined,
@@ -35,8 +35,9 @@ export default function Page({
35
35
  const hasSummary = Boolean(subtitle || description || tagProps?.length);
36
36
  const classes = ClassNames('usx-page', className);
37
37
  const pageContent = children || content;
38
+ const hasTitle = (Boolean(title) && typeof title !== 'boolean') || title === 0;
38
39
 
39
- const labelledBy = ariaLabelledby || titleId || undefined;
40
+ const labelledBy = ariaLabelledby || (hasTitle ? titleId : undefined);
40
41
 
41
42
  return (
42
43
  <Element
@@ -46,10 +47,12 @@ export default function Page({
46
47
  aria-labelledby={labelledBy}
47
48
  {...props}
48
49
  >
49
- <h1 id={titleId} className="usx-page__title">
50
- {eyebrow ? <span className="usx-eyebrow">{eyebrow}</span> : null}
51
- {title}
52
- </h1>
50
+ {hasTitle && (
51
+ <h1 id={titleId} className="usx-page__title">
52
+ {eyebrow && typeof eyebrow !== 'boolean' ? <span className="usx-eyebrow">{eyebrow}</span> : null}
53
+ {title}
54
+ </h1>
55
+ )}
53
56
  {hasSummary && (
54
57
  <div className="usx-page__summary">
55
58
  {subtitle && <p className="usx-page__subtitle">{subtitle}</p>}
@@ -21,10 +21,7 @@
21
21
  Teams can compose this with Header and Footer components to keep page layout and heading
22
22
  semantics consistent.
23
23
  </p>
24
- <p>
25
- Because the title is always rendered as an h1, each page has a clear top-level heading by
26
- default.
27
- </p>
24
+ <p>Provide a descriptive title to give the page a clear top-level heading.</p>
28
25
  </div>
29
26
  </main>
30
27
 
@@ -74,9 +71,9 @@
74
71
 
75
72
  <div class="usx-page__summary">
76
73
  <div class="usx-tag-group usx-page__tags">
77
- <span class="usa-tag usx-tag"> New </span>
74
+ <span class="usa-tag usx-tag bg-accent-cool"> New </span>
78
75
 
79
- <span class="usa-tag usx-tag usx-tag--outline"> Public notice </span>
76
+ <span class="usa-tag usx-tag bg-accent-warm"> Public notice </span>
80
77
  </div>
81
78
  </div>
82
79
 
@@ -95,9 +92,9 @@
95
92
  <div class="usx-page__summary">
96
93
  <p class="usx-page__subtitle">Support for local projects</p>
97
94
  <div class="usx-tag-group usx-page__tags">
98
- <span class="usa-tag usx-tag"> Open </span>
95
+ <span class="usa-tag usx-tag bg-success"> Open </span>
99
96
 
100
- <span class="usa-tag usx-tag usx-tag--outline"> Applications close June 30 </span>
97
+ <span class="usa-tag usx-tag bg-cyan"> Applications close June 30 </span>
101
98
  </div>
102
99
  <p class="usx-page__description">Find grants that help communities plan, build, and grow.</p>
103
100
  </div>
@@ -1,8 +1,8 @@
1
1
  {# Django template for Page #}
2
2
  {% load usx_components %}
3
3
  {% with pageTag=as|default:'main' %}
4
- <{% if pageTag == 'div' or pageTag == 'section' or pageTag == 'article' %}{{ pageTag }}{% else %}main{% endif %}{% if id %} id="{{ id }}"{% endif %} class="usx-page{% if className %} {{ className }}{% endif %}"{% if tabIndex or tabIndex == 0 %} tabindex="{{ tabIndex }}"{% endif %}{% if ariaLabelledby or titleId %} aria-labelledby="{% firstof ariaLabelledby titleId %}"{% endif %}>
5
- <h1{% if titleId %} id="{{ titleId }}"{% endif %} class="usx-page__title">{% if eyebrow %}<span class="usx-eyebrow">{{ eyebrow }}</span>{% endif %}{{ title|default:'Page title' }}</h1>
4
+ <{% if pageTag == 'div' or pageTag == 'section' or pageTag == 'article' %}{{ pageTag }}{% else %}main{% endif %}{% if id %} id="{{ id }}"{% endif %} class="usx-page{% if className %} {{ className }}{% endif %}"{% if tabIndex or tabIndex == 0 %} tabindex="{{ tabIndex }}"{% endif %}{% if ariaLabelledby %} aria-labelledby="{{ ariaLabelledby }}"{% elif titleId and title and title is not True or titleId and title == 0 and title is not False %} aria-labelledby="{{ titleId }}"{% endif %}>
5
+ {% if title and title is not True or title == 0 and title is not False %}<h1{% if titleId %} id="{{ titleId }}"{% endif %} class="usx-page__title">{% if eyebrow and eyebrow is not True %}<span class="usx-eyebrow">{{ eyebrow }}</span>{% endif %}{{ title }}</h1>{% endif %}
6
6
  {% if subtitle or description or tagProps %}
7
7
  <div class="usx-page__summary">
8
8
  {% if subtitle %}<p class="usx-page__subtitle">{{ subtitle }}</p>{% endif %}
@@ -20,8 +20,7 @@
20
20
  semantics consistent.
21
21
  </p>
22
22
  <p>
23
- Because the title is always rendered as an h1, each page has a clear top-level heading by
24
- default.
23
+ Provide a descriptive title to give the page a clear top-level heading.
25
24
  </p>
26
25
  </div>
27
26
  </main>
@@ -19,10 +19,7 @@
19
19
  Teams can compose this with Header and Footer components to keep page layout and heading
20
20
  semantics consistent.
21
21
  </p>
22
- <p>
23
- Because the title is always rendered as an h1, each page has a clear top-level heading by
24
- default.
25
- </p>
22
+ <p>Provide a descriptive title to give the page a clear top-level heading.</p>
26
23
  </div>
27
24
  </main>
28
25
 
@@ -66,8 +63,8 @@
66
63
  <h1 class="usx-page__title">Program updates</h1>
67
64
  <div class="usx-page__summary">
68
65
  <div class="usx-tag-group usx-page__tags">
69
- <span class="usa-tag usx-tag"> New</span
70
- ><span class="usa-tag usx-tag usx-tag--outline"> Public notice</span>
66
+ <span class="usa-tag usx-tag bg-accent-cool"> New</span
67
+ ><span class="usa-tag usx-tag bg-accent-warm"> Public notice</span>
71
68
  </div>
72
69
  </div>
73
70
  <div class="usx-page__content">
@@ -84,8 +81,8 @@
84
81
  <div class="usx-page__summary">
85
82
  <p class="usx-page__subtitle">Support for local projects</p>
86
83
  <div class="usx-tag-group usx-page__tags">
87
- <span class="usa-tag usx-tag"> Open</span
88
- ><span class="usa-tag usx-tag usx-tag--outline"> Applications close June 30</span>
84
+ <span class="usa-tag usx-tag bg-success"> Open</span
85
+ ><span class="usa-tag usx-tag bg-cyan"> Applications close June 30</span>
89
86
  </div>
90
87
  <p class="usx-page__description">Find grants that help communities plan, build, and grow.</p>
91
88
  </div>
@@ -21,6 +21,7 @@ export function getPageItems(currentPage: number, totalPages: number) {
21
21
  const page = (p: number) => ({ type: 'page' as const, page: p });
22
22
  const ellipsis = (key: string) => ({ type: 'ellipsis' as const, key });
23
23
 
24
+ if (totalPages <= 1) return [];
24
25
  if (totalPages <= 7) {
25
26
  return Array.from({ length: totalPages }, (_, i) => page(i + 1));
26
27
  }
@@ -80,6 +81,7 @@ export default function PaginationNavigation({
80
81
  onPageChange,
81
82
  }: PaginationNavigationProps) {
82
83
  const unbounded = totalPages === undefined || totalPages === null;
84
+ if (!unbounded && totalPages <= 1) return null;
83
85
  const items = unbounded
84
86
  ? getUnboundedPageItems(currentPage)
85
87
  : getPageItems(currentPage, totalPages!);