@solexllc/usx-react 0.3.1 → 0.5.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 (135) hide show
  1. package/README.md +132 -0
  2. package/dist/index.cjs +504 -450
  3. package/dist/index.js +504 -450
  4. package/package.json +6 -5
  5. package/src/assets.ts +16 -0
  6. package/src/components/alert/Alert.tsx +4 -3
  7. package/src/components/alert/alert.django.html +2 -3
  8. package/src/components/alert/config.json +15 -4
  9. package/src/components/attribution/config.json +5 -5
  10. package/src/components/banner/Banner.tsx +8 -6
  11. package/src/components/banner/banner.django.html +4 -5
  12. package/src/components/banner/config.json +7 -3
  13. package/src/components/breadcrumb/Breadcrumb.tsx +5 -6
  14. package/src/components/breadcrumb/config.json +11 -1
  15. package/src/components/button/Button.tsx +1 -1
  16. package/src/components/button/button.django.html +2 -2
  17. package/src/components/button/button.html +2 -2
  18. package/src/components/button/config.json +14 -6
  19. package/src/components/button-group/button-group.django.html +1 -1
  20. package/src/components/calendar-date/calendar-date.django.html +3 -3
  21. package/src/components/callout/Callout.tsx +53 -0
  22. package/src/components/callout/callout.django.html +5 -0
  23. package/src/components/callout/callout.html +76 -0
  24. package/src/components/callout/config.json +74 -0
  25. package/src/components/card/Card.tsx +18 -34
  26. package/src/components/card/card.django.html +12 -10
  27. package/src/components/card/config.json +15 -40
  28. package/src/components/card-group/card-group.django.html +1 -1
  29. package/src/components/carousel/Carousel.tsx +3 -2
  30. package/src/components/carousel/carousel.django.html +13 -2
  31. package/src/components/carousel/config.json +2 -2
  32. package/src/components/character-count/config.json +2 -2
  33. package/src/components/checkbox-group/CheckboxGroup.tsx +10 -20
  34. package/src/components/checkbox-group/checkbox-group.django.html +10 -4
  35. package/src/components/checkbox-group/config.json +10 -5
  36. package/src/components/clickable/clickable.html +21 -39
  37. package/src/components/clickable/config.json +2 -2
  38. package/src/components/code/Code.tsx +4 -27
  39. package/src/components/code/code.django.html +3 -9
  40. package/src/components/code/config.json +4 -0
  41. package/src/components/collection/Collection.tsx +5 -5
  42. package/src/components/collection/collection.django.html +2 -4
  43. package/src/components/collection/config.json +7 -6
  44. package/src/components/combobox/config.json +4 -4
  45. package/src/components/copy-to-clipboard/CopyToClipboard.tsx +35 -24
  46. package/src/components/copy-to-clipboard/config.json +14 -7
  47. package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +14 -14
  48. package/src/components/date-picker/config.json +4 -4
  49. package/src/components/date-range-picker/config.json +7 -7
  50. package/src/components/error-message/config.json +2 -2
  51. package/src/components/eyebrow/Eyebrow.tsx +2 -1
  52. package/src/components/eyebrow/config.json +2 -2
  53. package/src/components/fieldset/config.json +5 -5
  54. package/src/components/file-input/FileInput.tsx +3 -2
  55. package/src/components/file-input/config.json +5 -5
  56. package/src/components/file-list/FileList.tsx +2 -1
  57. package/src/components/file-list/config.json +2 -2
  58. package/src/components/footer/Footer.tsx +31 -11
  59. package/src/components/footer/config.json +4 -0
  60. package/src/components/footer/footer.django.html +10 -9
  61. package/src/components/form-group/config.json +2 -2
  62. package/src/components/header/Branding.tsx +9 -6
  63. package/src/components/header/Header.tsx +3 -1
  64. package/src/components/header/config.json +4 -0
  65. package/src/components/header/header.django.html +5 -26
  66. package/src/components/header/header.html +10 -10
  67. package/src/components/hero/Hero.tsx +8 -14
  68. package/src/components/hero/config.json +36 -27
  69. package/src/components/hero/hero.django.html +2 -2
  70. package/src/components/hint/config.json +2 -2
  71. package/src/components/icon/Icon.tsx +6 -3
  72. package/src/components/icon/config.json +12 -6
  73. package/src/components/icon/icon.django.html +6 -4
  74. package/src/components/image/Image.tsx +8 -4
  75. package/src/components/image/config.json +10 -2
  76. package/src/components/image/image.django.html +8 -6
  77. package/src/components/in-page-nav/config.json +11 -1
  78. package/src/components/indicator/config.json +2 -2
  79. package/src/components/input/config.json +2 -2
  80. package/src/components/label/config.json +2 -2
  81. package/src/components/language-selector/config.json +2 -2
  82. package/src/components/layout/Layout.tsx +1 -1
  83. package/src/components/layout/config.json +9 -9
  84. package/src/components/layout/layout.django.html +1 -1
  85. package/src/components/legend/config.json +3 -3
  86. package/src/components/link/config.json +2 -2
  87. package/src/components/memorable-date/config.json +9 -9
  88. package/src/components/misc-banner/MiscBanner.tsx +2 -1
  89. package/src/components/misc-banner/config.json +2 -2
  90. package/src/components/modal/config.json +2 -2
  91. package/src/components/page/Page.tsx +2 -1
  92. package/src/components/page/config.json +7 -7
  93. package/src/components/page/page.django.html +1 -1
  94. package/src/components/pagination/Pagination.tsx +2 -1
  95. package/src/components/pagination/container/PaginationContainer.tsx +2 -1
  96. package/src/components/prose/config.json +5 -1
  97. package/src/components/quote/Quote.tsx +58 -0
  98. package/src/components/quote/config.json +51 -0
  99. package/src/components/quote/quote.django.html +15 -0
  100. package/src/components/quote/quote.html +66 -0
  101. package/src/components/radio-buttons/config.json +3 -3
  102. package/src/components/range-slider/RangeSlider.tsx +2 -1
  103. package/src/components/range-slider/config.json +4 -4
  104. package/src/components/required/config.json +2 -2
  105. package/src/components/section/Section.tsx +6 -2
  106. package/src/components/section/config.json +19 -6
  107. package/src/components/section/section.django.html +9 -2
  108. package/src/components/select/config.json +2 -2
  109. package/src/components/site-alert/SiteAlert.tsx +5 -6
  110. package/src/components/skipnav/config.json +2 -2
  111. package/src/components/spinner/Spinner.tsx +18 -25
  112. package/src/components/spinner/config.json +4 -0
  113. package/src/components/spinner/spinner.django.html +4 -6
  114. package/src/components/summary-box/config.json +3 -3
  115. package/src/components/swap/Swap.tsx +4 -3
  116. package/src/components/swap/config.json +4 -4
  117. package/src/components/switch/config.json +2 -2
  118. package/src/components/table/config.json +13 -3
  119. package/src/components/tag/config.json +2 -2
  120. package/src/components/tag-group/config.json +2 -2
  121. package/src/components/text-area/config.json +2 -2
  122. package/src/components/time-picker/config.json +4 -4
  123. package/src/components/toggle/Toggle.tsx +69 -40
  124. package/src/components/toggle/config.json +42 -10
  125. package/src/components/toggle/toggle.django.html +25 -17
  126. package/src/components/toggle/toggle.html +319 -85
  127. package/src/components/tooltip/Tooltip.tsx +4 -2
  128. package/src/components/tooltip/config.json +9 -4
  129. package/src/components/tooltip/tooltip.django.html +1 -1
  130. package/src/components/villain/Villain.tsx +2 -1
  131. package/src/index.js +2 -1
  132. package/src/components/block/Block.tsx +0 -78
  133. package/src/components/block/block.django.html +0 -26
  134. package/src/components/block/block.html +0 -162
  135. package/src/components/block/config.json +0 -88
@@ -1,85 +1,319 @@
1
- <div class="usa-alert usa-alert--warning usx-alert usx-alert--warning">
2
- <div class="usa-alert__body usx-alert__body">
3
- <h4 class="usa-alert__heading usx-alert__heading">Accessibility Notice</h4>
4
- <p class="usa-alert__text usx-alert__text">
5
- Please note: The toggle component is undergoing maintenance for accessibility issues.
6
- </p>
7
- </div>
8
- </div>
9
-
10
-
11
- <h3 class="site-preview-heading">Default</h3>
12
- <ul class="usa-button-group usx-button-group usa-button-group--segmented usx-toggle" role="radiogroup" aria-label="alignment">
13
- <li class="usa-button-group__item usx-toggle__item">
14
- <input class="usx-toggle__input" type="radio" id="toggle-left" name="toggle-example" value="left">
15
- <label for="toggle-left" class="usa-button usx-button usa-button--outline"><span class="usx-toggle__label">Left</span></label>
16
- </li>
17
- <li class="usa-button-group__item usx-toggle__item">
18
- <input class="usx-toggle__input" type="radio" id="toggle-center" name="toggle-example" value="center" checked>
19
- <label for="toggle-center" class="usa-button usx-button usa-button--outline"><span class="usx-toggle__label">Center</span></label>
20
- </li>
21
- <li class="usa-button-group__item usx-toggle__item">
22
- <input class="usx-toggle__input" type="radio" id="toggle-right" name="toggle-example" value="right">
23
- <label for="toggle-right" class="usa-button usx-button usa-button--outline"><span class="usx-toggle__label">Right</span></label>
24
- </li>
25
- </ul>
26
-
27
- <h3 class="site-preview-heading">Icons</h3>
28
- <ul class="usa-button-group usx-button-group usa-button-group--segmented usx-toggle usx-toggle--icon" role="radiogroup" aria-label="alignment">
29
- <li class="usa-button-group__item usx-toggle__item">
30
- <input class="usx-toggle__input" type="radio" id="toggle-left-icon" name="toggle-icon-example" value="left">
31
- <label for="toggle-left-icon" class="usa-button usx-button usa-button--outline">
32
- <svg class="usa-icon usx-toggle__label" aria-hidden="true" focusable="false" role="img">
33
- <use href="./img/sprite.svg#directions_bike"></use>
34
- </svg>
35
- </label>
36
- </li>
37
- <li class="usa-button-group__item usx-toggle__item">
38
- <input class="usx-toggle__input" type="radio" id="toggle-center-icon" name="toggle-icon-example" value="center" checked>
39
- <label for="toggle-center-icon" class="usa-button usx-button usa-button--outline">
40
- <svg class="usa-icon usx-toggle__label" aria-hidden="true" focusable="false" role="img">
41
- <use href="./img/sprite.svg#directions_bus"></use>
42
- </svg>
43
- </label>
44
- </li>
45
- <li class="usa-button-group__item usx-toggle__item">
46
- <input class="usx-toggle__input" type="radio" id="toggle-right-icon" name="toggle-icon-example" value="right">
47
- <label for="toggle-right-icon" class="usa-button usx-button usa-button--outline">
48
- <svg class="usa-icon usx-toggle__label" aria-hidden="true" focusable="false" role="img">
49
- <use href="./img/sprite.svg#flight"></use>
50
- </svg>
51
- </label>
52
- </li>
53
- </ul>
54
-
55
- <h3 class="site-preview-heading">Disabled</h3>
56
- <ul class="usa-button-group usx-button-group usa-button-group--segmented usx-toggle" role="radiogroup" aria-label="alignment">
57
- <li class="usa-button-group__item usx-toggle__item">
58
- <input class="usx-toggle__input" type="radio" id="toggle-left-disabled" name="toggle-disabled-example" value="left" disabled>
59
- <label for="toggle-left-disabled" class="usa-button usx-button usa-button--outline"><span class="usx-toggle__label">Left</span></label>
60
- </li>
61
- <li class="usa-button-group__item usx-toggle__item">
62
- <input class="usx-toggle__input" type="radio" id="toggle-center-disabled" name="toggle-disabled-example" value="center" disabled>
63
- <label for="toggle-center-disabled" class="usa-button usx-button usa-button--outline"><span class="usx-toggle__label">Center</span></label>
64
- </li>
65
- <li class="usa-button-group__item usx-toggle__item">
66
- <input class="usx-toggle__input" type="radio" id="toggle-right-disabled" name="toggle-disabled-example" value="right" disabled>
67
- <label for="toggle-right-disabled" class="usa-button usx-button usa-button--outline"><span class="usx-toggle__label">Right</span></label>
68
- </li>
69
- </ul>
70
-
71
- <h3 class="site-preview-heading">Partially Disabled</h3>
72
- <ul class="usa-button-group usx-button-group usa-button-group--segmented usx-toggle" role="radiogroup" aria-label="alignment">
73
- <li class="usa-button-group__item usx-toggle__item">
74
- <input class="usx-toggle__input" type="radio" id="toggle-left-partial-disabled" name="toggle-partial-disabled-example" value="left">
75
- <label for="toggle-left-partial-disabled" class="usa-button usx-button usa-button--outline"><span class="usx-toggle__label">Left</span></label>
76
- </li>
77
- <li class="usa-button-group__item usx-toggle__item">
78
- <input class="usx-toggle__input" type="radio" id="toggle-center-partial-disabled" name="toggle-partial-disabled-example" value="center" disabled>
79
- <label for="toggle-center-partial-disabled" class="usa-button usx-button usa-button--outline"><span class="usx-toggle__label">Center</span></label>
80
- </li>
81
- <li class="usa-button-group__item usx-toggle__item">
82
- <input class="usx-toggle__input" type="radio" id="toggle-right-partial-disabled" name="toggle-partial-disabled-example" value="right">
83
- <label for="toggle-right-partial-disabled" class="usa-button usx-button usa-button--outline"><span class="usx-toggle__label">Right</span></label>
84
- </li>
85
- </ul>
1
+ <form class="padding-3">
2
+ <section class="margin-bottom-4">
3
+ <h2>Default</h2>
4
+ <ul
5
+ id="alignment"
6
+ class="usx-toggle usa-button-group"
7
+ role="radiogroup"
8
+ aria-label="Text alignment"
9
+ >
10
+ <li class="usa-button-group__item" role="presentation">
11
+ <input
12
+ class="usx-toggle__input"
13
+ type="radio"
14
+ id="alignment-option-0"
15
+ name="toggle-example"
16
+ value="left"
17
+ /><label
18
+ for="alignment-option-0"
19
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
20
+ ><span>Left</span></label
21
+ >
22
+ </li>
23
+ <li class="usa-button-group__item" role="presentation">
24
+ <input
25
+ class="usx-toggle__input"
26
+ type="radio"
27
+ id="alignment-option-1"
28
+ name="toggle-example"
29
+ checked=""
30
+ value="center"
31
+ /><label
32
+ for="alignment-option-1"
33
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
34
+ ><span>Center</span></label
35
+ >
36
+ </li>
37
+ <li class="usa-button-group__item" role="presentation">
38
+ <input
39
+ class="usx-toggle__input"
40
+ type="radio"
41
+ id="alignment-option-2"
42
+ name="toggle-example"
43
+ value="right"
44
+ /><label
45
+ for="alignment-option-2"
46
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
47
+ ><span>Right</span></label
48
+ >
49
+ </li>
50
+ </ul>
51
+ </section>
52
+ <section class="margin-bottom-4">
53
+ <h2>IconVariant</h2>
54
+ <ul
55
+ id="transport-mode"
56
+ class="usx-toggle usa-button-group usx-toggle--icon"
57
+ role="radiogroup"
58
+ aria-label="Transport mode"
59
+ >
60
+ <li class="usa-button-group__item" role="presentation">
61
+ <input
62
+ class="usx-toggle__input"
63
+ type="radio"
64
+ id="transport-mode-option-0"
65
+ name="transport-mode"
66
+ value="bike"
67
+ /><label
68
+ for="transport-mode-option-0"
69
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
70
+ title="Bike"
71
+ ><svg
72
+ class="usa-icon usa-icon--size-2 usx-toggle__icon"
73
+ aria-hidden="true"
74
+ aria-label="directions_bike icon"
75
+ focusable="false"
76
+ role="img"
77
+ >
78
+ <use href="/img/sprite.svg#directions_bike"></use></svg><span class="usa-sr-only">Bike</span></label>
79
+ </li>
80
+ <li class="usa-button-group__item" role="presentation">
81
+ <input
82
+ class="usx-toggle__input"
83
+ type="radio"
84
+ id="transport-mode-option-1"
85
+ name="transport-mode"
86
+ checked=""
87
+ value="bus"
88
+ /><label
89
+ for="transport-mode-option-1"
90
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
91
+ title="Bus"
92
+ ><svg
93
+ class="usa-icon usa-icon--size-2 usx-toggle__icon"
94
+ aria-hidden="true"
95
+ aria-label="directions_bus icon"
96
+ focusable="false"
97
+ role="img"
98
+ >
99
+ <use href="/img/sprite.svg#directions_bus"></use></svg><span class="usa-sr-only">Bus</span></label>
100
+ </li>
101
+ <li class="usa-button-group__item" role="presentation">
102
+ <input
103
+ class="usx-toggle__input"
104
+ type="radio"
105
+ id="transport-mode-option-2"
106
+ name="transport-mode"
107
+ value="flight"
108
+ /><label
109
+ for="transport-mode-option-2"
110
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
111
+ title="Flight"
112
+ ><svg
113
+ class="usa-icon usa-icon--size-2 usx-toggle__icon"
114
+ aria-hidden="true"
115
+ aria-label="flight icon"
116
+ focusable="false"
117
+ role="img"
118
+ >
119
+ <use href="/img/sprite.svg#flight"></use></svg><span class="usa-sr-only">Flight</span></label>
120
+ </li>
121
+ </ul>
122
+ </section>
123
+ <section class="margin-bottom-4">
124
+ <h2>Required</h2>
125
+ <ul
126
+ id="required-toggle"
127
+ class="usx-toggle usa-button-group"
128
+ role="radiogroup"
129
+ aria-label="Delivery method"
130
+ aria-required="true"
131
+ >
132
+ <li class="usa-button-group__item" role="presentation">
133
+ <input
134
+ class="usx-toggle__input"
135
+ type="radio"
136
+ id="required-toggle-option-0"
137
+ name="delivery"
138
+ required=""
139
+ value="Email"
140
+ /><label
141
+ for="required-toggle-option-0"
142
+ class="usa-button usx-button usa-button--primary usx-toggle__button"><span>Email</span></label>
143
+ </li>
144
+ <li class="usa-button-group__item" role="presentation">
145
+ <input
146
+ class="usx-toggle__input"
147
+ type="radio"
148
+ id="required-toggle-option-1"
149
+ name="delivery"
150
+ required=""
151
+ value="Post"
152
+ /><label
153
+ for="required-toggle-option-1"
154
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
155
+ ><span>Post</span></label
156
+ >
157
+ </li>
158
+ </ul>
159
+ </section>
160
+ <section class="margin-bottom-4">
161
+ <h2>Numeric</h2>
162
+ <ul
163
+ id="numeric-toggle"
164
+ class="usx-toggle usa-button-group"
165
+ role="radiogroup"
166
+ aria-label="Items per page"
167
+ >
168
+ <li class="usa-button-group__item" role="presentation">
169
+ <input
170
+ class="usx-toggle__input"
171
+ type="radio"
172
+ id="numeric-toggle-option-0"
173
+ name="page-size"
174
+ checked=""
175
+ value="0"
176
+ /><label
177
+ for="numeric-toggle-option-0"
178
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
179
+ ><span>0</span></label
180
+ >
181
+ </li>
182
+ <li class="usa-button-group__item" role="presentation">
183
+ <input
184
+ class="usx-toggle__input"
185
+ type="radio"
186
+ id="numeric-toggle-option-1"
187
+ name="page-size"
188
+ value="10"
189
+ /><label
190
+ for="numeric-toggle-option-1"
191
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
192
+ ><span>10</span></label
193
+ >
194
+ </li>
195
+ <li class="usa-button-group__item" role="presentation">
196
+ <input
197
+ class="usx-toggle__input"
198
+ type="radio"
199
+ id="numeric-toggle-option-2"
200
+ name="page-size"
201
+ value="25"
202
+ /><label
203
+ for="numeric-toggle-option-2"
204
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
205
+ ><span>25</span></label
206
+ >
207
+ </li>
208
+ </ul>
209
+ </section>
210
+ <section class="margin-bottom-4">
211
+ <h2>TotallyDisabled</h2>
212
+ <ul
213
+ id="disabled-toggle"
214
+ class="usx-toggle usa-button-group"
215
+ role="radiogroup"
216
+ aria-label="Unavailable choices"
217
+ aria-disabled="true"
218
+ >
219
+ <li class="usa-button-group__item" role="presentation">
220
+ <input
221
+ class="usx-toggle__input"
222
+ type="radio"
223
+ id="disabled-toggle-option-0"
224
+ name="disabled-toggle"
225
+ disabled=""
226
+ value="option1"
227
+ /><label
228
+ aria-disabled="true"
229
+ for="disabled-toggle-option-0"
230
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
231
+ ><span>Option 1</span></label
232
+ >
233
+ </li>
234
+ <li class="usa-button-group__item" role="presentation">
235
+ <input
236
+ class="usx-toggle__input"
237
+ type="radio"
238
+ id="disabled-toggle-option-1"
239
+ name="disabled-toggle"
240
+ disabled=""
241
+ value="option2"
242
+ /><label
243
+ aria-disabled="true"
244
+ for="disabled-toggle-option-1"
245
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
246
+ ><span>Option 2</span></label
247
+ >
248
+ </li>
249
+ <li class="usa-button-group__item" role="presentation">
250
+ <input
251
+ class="usx-toggle__input"
252
+ type="radio"
253
+ id="disabled-toggle-option-2"
254
+ name="disabled-toggle"
255
+ disabled=""
256
+ value="option3"
257
+ /><label
258
+ aria-disabled="true"
259
+ for="disabled-toggle-option-2"
260
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
261
+ ><span>Option 3</span></label
262
+ >
263
+ </li>
264
+ </ul>
265
+ </section>
266
+ <section class="margin-bottom-4">
267
+ <h2>PartiallyDisabled</h2>
268
+ <ul
269
+ id="partially-disabled-toggle"
270
+ class="usx-toggle usa-button-group"
271
+ role="radiogroup"
272
+ aria-label="Available choices"
273
+ >
274
+ <li class="usa-button-group__item" role="presentation">
275
+ <input
276
+ class="usx-toggle__input"
277
+ type="radio"
278
+ id="partially-disabled-toggle-option-0"
279
+ name="partially-disabled-toggle"
280
+ checked=""
281
+ value="option1"
282
+ /><label
283
+ for="partially-disabled-toggle-option-0"
284
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
285
+ ><span>Option 1</span></label
286
+ >
287
+ </li>
288
+ <li class="usa-button-group__item" role="presentation">
289
+ <input
290
+ class="usx-toggle__input"
291
+ type="radio"
292
+ id="partially-disabled-toggle-option-1"
293
+ name="partially-disabled-toggle"
294
+ disabled=""
295
+ value="option2"
296
+ /><label
297
+ aria-disabled="true"
298
+ for="partially-disabled-toggle-option-1"
299
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
300
+ ><span>Option 2</span></label
301
+ >
302
+ </li>
303
+ <li class="usa-button-group__item" role="presentation">
304
+ <input
305
+ class="usx-toggle__input"
306
+ type="radio"
307
+ id="partially-disabled-toggle-option-2"
308
+ name="partially-disabled-toggle"
309
+ value="option3"
310
+ /><label
311
+ for="partially-disabled-toggle-option-2"
312
+ class="usa-button usx-button usa-button--primary usx-toggle__button"
313
+ ><span>Option 3</span></label
314
+ >
315
+ </li>
316
+ </ul>
317
+ </section>
318
+ <button class="usa-button usx-button usa-button--primary" type="submit">Submit</button> <button class="usa-button usx-button usa-button--outline" type="reset">Reset</button>
319
+ </form>
@@ -2,10 +2,11 @@ import React from 'react';
2
2
  import classNames from 'classnames';
3
3
 
4
4
  export interface TooltipProps extends React.HTMLAttributes<HTMLSpanElement> {
5
- label: string;
5
+ label: React.ReactNode;
6
6
  position?: 'top' | 'bottom' | 'left' | 'right';
7
7
  children?: React.ReactNode;
8
8
  className?: string;
9
+ bodyClassName?: string;
9
10
  }
10
11
 
11
12
  const Tooltip: React.FC<TooltipProps> = ({
@@ -13,6 +14,7 @@ const Tooltip: React.FC<TooltipProps> = ({
13
14
  position = 'top',
14
15
  children,
15
16
  className = '',
17
+ bodyClassName = '',
16
18
  ...props
17
19
  }) => {
18
20
  const validPositions = ['top', 'bottom', 'left', 'right'] as const;
@@ -21,7 +23,7 @@ const Tooltip: React.FC<TooltipProps> = ({
21
23
  <span className={classNames('usx-tooltip', className)} {...props}>
22
24
  {children}
23
25
  <span
24
- className={`usa-tooltip__body usa-tooltip__body--${normalizedPosition}`}
26
+ className={classNames('usa-tooltip__body', `usa-tooltip__body--${normalizedPosition}`, bodyClassName)}
25
27
  role="tooltip"
26
28
  >
27
29
  {label}
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "tooltip",
3
3
  "template": "tooltip/tooltip.django.html",
4
- "version": 1,
4
+ "version": 2,
5
5
  "props": {
6
6
  "label": {
7
- "type": "string",
7
+ "type": "slot",
8
8
  "default": "Tooltip text",
9
- "description": "The text content displayed inside the tooltip body."
9
+ "description": "Content displayed inside the tooltip body. Accepts text or composed content, such as React nodes or a Django template fragment."
10
10
  },
11
11
  "position": {
12
12
  "type": "select",
@@ -20,7 +20,7 @@
20
20
  "description": "The direction the tooltip appears relative to its trigger."
21
21
  },
22
22
  "children": {
23
- "type": "string",
23
+ "type": "slot",
24
24
  "default": null,
25
25
  "description": "The trigger element that activates the tooltip on hover or focus."
26
26
  },
@@ -28,6 +28,11 @@
28
28
  "type": "string",
29
29
  "default": "",
30
30
  "description": "Additional CSS classes to apply to the tooltip wrapper."
31
+ },
32
+ "bodyClassName": {
33
+ "type": "string",
34
+ "default": "",
35
+ "description": "Additional CSS classes to apply to the tooltip body."
31
36
  }
32
37
  }
33
38
  }
@@ -1,5 +1,5 @@
1
1
  {# Django template for Tooltip #}
2
2
  <span class="usx-tooltip{% if className %} {{ className }}{% endif %}">
3
3
  {% if children %}{{ children|safe }}{% endif %}
4
- <span class="usa-tooltip__body usa-tooltip__body--{{ position|default:'top' }}" role="tooltip">{{ label|default:"Tooltip text" }}</span>
4
+ <span class="usa-tooltip__body usa-tooltip__body--{{ position|default:'top' }}{% if bodyClassName %} {{ bodyClassName }}{% endif %}" role="tooltip">{{ label|default:"Tooltip text" }}</span>
5
5
  </span>
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import ClassNames from 'classnames';
2
3
 
3
4
  export interface VillainButton {
4
5
  href: string;
@@ -23,7 +24,7 @@ const Villain: React.FC<VillainProps> = ({
23
24
  className = '',
24
25
  ...props
25
26
  }) => {
26
- const classes = ['usa-hero', className].filter(Boolean).join(' ');
27
+ const classes = ClassNames('usa-hero', className);
27
28
  return (
28
29
  <section className={classes} aria-label={ariaLabel} {...props}>
29
30
  <div className="grid-container">
package/src/index.js CHANGED
@@ -7,11 +7,11 @@ export { default as Avatar } from './components/avatar/Avatar.tsx';
7
7
  export { default as AvatarGroup } from './components/avatar-group/AvatarGroup.tsx';
8
8
  export { default as BackToTop } from './components/back-to-top/BackToTop.tsx';
9
9
  export { default as Banner } from './components/banner/Banner.tsx';
10
- export { default as Block } from './components/block/Block.tsx';
11
10
  export { default as Breadcrumb } from './components/breadcrumb/Breadcrumb.tsx';
12
11
  export { default as Button } from './components/button/Button.tsx';
13
12
  export { default as ButtonGroup } from './components/button-group/ButtonGroup.tsx';
14
13
  export { default as CalendarDate } from './components/calendar-date/CalendarDate.tsx';
14
+ export { default as Callout } from './components/callout/Callout.tsx';
15
15
  export { default as Card } from './components/card/Card.tsx';
16
16
  export { default as CardGroup } from './components/card-group/CardGroup.tsx';
17
17
  export { default as Carousel } from './components/carousel/Carousel.tsx';
@@ -55,6 +55,7 @@ export { default as Page } from './components/page/Page.tsx';
55
55
  export { default as Pagination } from './components/pagination/Pagination.tsx';
56
56
  export { default as ProcessList } from './components/process-list/ProcessList.tsx';
57
57
  export { default as Prose } from './components/prose/Prose.tsx';
58
+ export { default as Quote } from './components/quote/Quote.tsx';
58
59
  export { default as RadioButtons } from './components/radio-buttons/RadioButtons.tsx';
59
60
  export { default as RangeSlider } from './components/range-slider/RangeSlider.tsx';
60
61
  export { default as Required } from './components/required/Required.tsx';
@@ -1,78 +0,0 @@
1
- import React from 'react';
2
- import classNames from 'classnames';
3
- import Icon from '../icon/Icon';
4
- import Attribution, { AttributionProps } from '../attribution/Attribution';
5
-
6
-
7
- export type BlockProps = {
8
- variant?: null | 'callout';
9
- indent?: null | 'sm' | 'md' | 'lg' | 'xl';
10
- dedent?: boolean;
11
- big?: boolean;
12
- quote?: boolean;
13
- color?: string;
14
- contentClassName?: string;
15
- attribution?: AttributionProps | null;
16
- children?: React.ReactNode;
17
- className?: string;
18
- } & React.HTMLAttributes<HTMLDivElement>;
19
-
20
- export default function Block({
21
- variant = null,
22
- indent = null,
23
- dedent = false,
24
- big = false,
25
- quote = false,
26
- color,
27
- contentClassName = '',
28
- attribution = null,
29
- children = null,
30
- className = '',
31
- ...props
32
- }: BlockProps) {
33
- const isCallout = variant === 'callout';
34
-
35
- const classes = classNames(
36
- 'usx-block',
37
- variant && `usx-block--${variant}`,
38
- dedent && 'usx-block--dedent',
39
- indent && `usx-block--indent-${indent}`,
40
- big && 'usx-block--big',
41
- quote && !isCallout && 'display-flex flex-row',
42
- isCallout && color && `usx-border-${color}`,
43
- className,
44
- );
45
-
46
- const contentClasses = classNames(
47
- 'usx-block__content',
48
- !isCallout && color && `usx-border-${color}`,
49
- contentClassName,
50
- );
51
-
52
- const attributionNode = attribution ? (
53
- <div className="usx-block__attribution">
54
- <Attribution {...attribution} />
55
- </div>
56
- ) : null;
57
-
58
- if (quote && !isCallout) {
59
- return (
60
- <div className={classes} {...props}>
61
- <Icon name="format_quote" size={4} className="usx-block__open-quote-icon" />
62
- <div className={contentClasses}>
63
- {children}
64
- {attributionNode}
65
- </div>
66
- </div>
67
- );
68
- }
69
-
70
- return (
71
- <div className={classes} {...props}>
72
- <div className={contentClasses}>
73
- {children}
74
- </div>
75
- {attributionNode}
76
- </div>
77
- );
78
- }
@@ -1,26 +0,0 @@
1
- {# Django template for Block #}
2
- {% load components %}
3
- <div class="usx-block{% if variant %} usx-block--{{ variant }}{% endif %}{% if dedent %} usx-block--dedent{% endif %}{% if indent %} usx-block--indent-{{ indent }}{% endif %}{% if big %} usx-block--big{% endif %}{% if quote and variant != 'callout' %} display-flex flex-row{% endif %}{% if variant == 'callout' and color %} usx-border-{{ color }}{% endif %}{% if className %} {{ className }}{% endif %}">
4
- {% if quote and variant != 'callout' %}
5
- <svg class="usa-icon usa-icon--size-4 usx-block__open-quote-icon" aria-hidden="true" focusable="false" role="img">
6
- <use href="./img/sprite.svg#format_quote"></use>
7
- </svg>
8
- <div class="usx-block__content{% if color %} usx-border-{{ color }}{% endif %}{% if contentClassName %} {{ contentClassName }}{% endif %}">
9
- {{ children|safe }}
10
- {% if attribution %}
11
- <div class="usx-block__attribution">
12
- {% attribution avatar=attribution.avatar media=attribution.media primary=attribution.primary secondary=attribution.secondary className=attribution.className %}{% if attribution.children %}{{ attribution.children|safe }}{% endif %}{% endattribution %}
13
- </div>
14
- {% endif %}
15
- </div>
16
- {% else %}
17
- <div class="usx-block__content{% if variant != 'callout' and color %} usx-border-{{ color }}{% endif %}{% if contentClassName %} {{ contentClassName }}{% endif %}">
18
- {{ children|safe }}
19
- </div>
20
- {% if attribution %}
21
- <div class="usx-block__attribution">
22
- {% attribution avatar=attribution.avatar media=attribution.media primary=attribution.primary secondary=attribution.secondary className=attribution.className %}{% if attribution.children %}{{ attribution.children|safe }}{% endif %}{% endattribution %}
23
- </div>
24
- {% endif %}
25
- {% endif %}
26
- </div>