@solexllc/usx-react 0.4.0 → 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.
- package/dist/index.cjs +329 -274
- package/dist/index.js +329 -274
- package/package.json +5 -5
- package/src/components/attribution/config.json +5 -5
- package/src/components/banner/config.json +2 -2
- package/src/components/breadcrumb/Breadcrumb.tsx +5 -6
- package/src/components/breadcrumb/config.json +11 -1
- package/src/components/button/button.html +2 -2
- package/src/components/button-group/button-group.django.html +1 -1
- package/src/components/calendar-date/calendar-date.django.html +3 -3
- package/src/components/callout/Callout.tsx +53 -0
- package/src/components/callout/callout.django.html +5 -0
- package/src/components/callout/callout.html +76 -0
- package/src/components/callout/config.json +74 -0
- package/src/components/card/Card.tsx +18 -34
- package/src/components/card/card.django.html +12 -10
- package/src/components/card/config.json +15 -40
- package/src/components/card-group/card-group.django.html +1 -1
- package/src/components/carousel/Carousel.tsx +3 -2
- package/src/components/carousel/carousel.django.html +13 -2
- package/src/components/carousel/config.json +2 -2
- package/src/components/character-count/config.json +2 -2
- package/src/components/checkbox-group/CheckboxGroup.tsx +10 -20
- package/src/components/checkbox-group/checkbox-group.django.html +10 -4
- package/src/components/checkbox-group/config.json +10 -5
- package/src/components/clickable/clickable.html +21 -39
- package/src/components/clickable/config.json +2 -2
- package/src/components/collection/Collection.tsx +5 -5
- package/src/components/collection/collection.django.html +2 -4
- package/src/components/collection/config.json +7 -6
- package/src/components/combobox/config.json +4 -4
- package/src/components/date-picker/config.json +4 -4
- package/src/components/date-range-picker/config.json +7 -7
- package/src/components/error-message/config.json +2 -2
- package/src/components/eyebrow/Eyebrow.tsx +2 -1
- package/src/components/eyebrow/config.json +2 -2
- package/src/components/fieldset/config.json +5 -5
- package/src/components/file-input/FileInput.tsx +3 -2
- package/src/components/file-input/config.json +5 -5
- package/src/components/file-list/FileList.tsx +2 -1
- package/src/components/file-list/config.json +2 -2
- package/src/components/footer/Footer.tsx +5 -5
- package/src/components/form-group/config.json +2 -2
- package/src/components/hero/Hero.tsx +8 -14
- package/src/components/hero/config.json +36 -27
- package/src/components/hero/hero.django.html +2 -2
- package/src/components/hint/config.json +2 -2
- package/src/components/in-page-nav/config.json +11 -1
- package/src/components/indicator/config.json +2 -2
- package/src/components/input/config.json +2 -2
- package/src/components/label/config.json +2 -2
- package/src/components/language-selector/config.json +2 -2
- package/src/components/layout/Layout.tsx +1 -1
- package/src/components/legend/config.json +3 -3
- package/src/components/link/config.json +2 -2
- package/src/components/memorable-date/config.json +9 -9
- package/src/components/misc-banner/MiscBanner.tsx +2 -1
- package/src/components/misc-banner/config.json +2 -2
- package/src/components/modal/config.json +2 -2
- package/src/components/page/Page.tsx +2 -1
- package/src/components/page/config.json +7 -7
- package/src/components/page/page.django.html +1 -1
- package/src/components/pagination/Pagination.tsx +2 -1
- package/src/components/pagination/container/PaginationContainer.tsx +2 -1
- package/src/components/prose/config.json +5 -1
- package/src/components/quote/Quote.tsx +58 -0
- package/src/components/quote/config.json +51 -0
- package/src/components/quote/quote.django.html +15 -0
- package/src/components/quote/quote.html +66 -0
- package/src/components/radio-buttons/config.json +3 -3
- package/src/components/range-slider/RangeSlider.tsx +2 -1
- package/src/components/range-slider/config.json +4 -4
- package/src/components/required/config.json +2 -2
- package/src/components/section/Section.tsx +6 -2
- package/src/components/section/config.json +19 -6
- package/src/components/section/section.django.html +9 -2
- package/src/components/select/config.json +2 -2
- package/src/components/site-alert/SiteAlert.tsx +5 -6
- package/src/components/skipnav/config.json +2 -2
- package/src/components/summary-box/config.json +3 -3
- package/src/components/swap/Swap.tsx +4 -3
- package/src/components/swap/config.json +4 -4
- package/src/components/switch/config.json +2 -2
- package/src/components/table/config.json +13 -3
- package/src/components/tag/config.json +2 -2
- package/src/components/tag-group/config.json +2 -2
- package/src/components/text-area/config.json +2 -2
- package/src/components/time-picker/config.json +4 -4
- package/src/components/toggle/Toggle.tsx +69 -40
- package/src/components/toggle/config.json +42 -10
- package/src/components/toggle/toggle.django.html +25 -17
- package/src/components/toggle/toggle.html +319 -85
- package/src/components/tooltip/config.json +2 -2
- package/src/components/villain/Villain.tsx +2 -1
- package/src/index.js +2 -1
- package/src/components/block/Block.tsx +0 -78
- package/src/components/block/block.django.html +0 -26
- package/src/components/block/block.html +0 -162
- package/src/components/block/config.json +0 -88
|
@@ -1,85 +1,319 @@
|
|
|
1
|
-
<
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tooltip",
|
|
3
3
|
"template": "tooltip/tooltip.django.html",
|
|
4
|
-
"version":
|
|
4
|
+
"version": 2,
|
|
5
5
|
"props": {
|
|
6
6
|
"label": {
|
|
7
7
|
"type": "slot",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"description": "The direction the tooltip appears relative to its trigger."
|
|
21
21
|
},
|
|
22
22
|
"children": {
|
|
23
|
-
"type": "
|
|
23
|
+
"type": "slot",
|
|
24
24
|
"default": null,
|
|
25
25
|
"description": "The trigger element that activates the tooltip on hover or focus."
|
|
26
26
|
},
|
|
@@ -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 =
|
|
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>
|