@solexllc/usx-react 0.12.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.
- package/README.md +15 -0
- package/dist/{Popover-BzDCTuQM.cjs → Popover-Bg4-2-cU.cjs} +3 -0
- package/dist/{Popover-LToVWsWc.js → Popover-CqHczzNE.js} +3 -0
- package/dist/chat.cjs +7 -2
- package/dist/chat.js +7 -2
- package/dist/index.cjs +83 -56
- package/dist/index.js +86 -59
- package/package.json +4 -4
- package/src/components/accordion/Accordion.tsx +9 -57
- package/src/components/accordion/accordion.django.html +10 -20
- package/src/components/accordion/config.json +8 -2
- package/src/components/accordion-item/AccordionItem.tsx +54 -0
- package/src/components/accordion-item/accordion-item.django.html +19 -0
- package/src/components/accordion-item/accordion-item.html +8 -0
- package/src/components/accordion-item/config.json +55 -0
- package/src/components/alert/alert.django-snapshot.html +4 -4
- package/src/components/avatar/avatar.django-snapshot.html +6 -2
- package/src/components/avatar/avatar.react-snapshot.html +6 -3
- package/src/components/avatar/config.json +4 -2
- package/src/components/avatar-group/avatar-group.django-snapshot.html +176 -176
- package/src/components/avatar-group/avatar-group.react-snapshot.html +198 -167
- package/src/components/avatar-group/config.json +12 -6
- package/src/components/banner/banner.django-snapshot.html +2 -2
- package/src/components/button/Button.tsx +3 -0
- package/src/components/button/button.django-snapshot.html +64 -0
- package/src/components/button/button.django.html +2 -0
- package/src/components/button/button.react-snapshot.html +64 -0
- package/src/components/button/config.json +6 -1
- package/src/components/card/card.django-snapshot.html +43 -0
- package/src/components/card/card.react-snapshot.html +36 -0
- package/src/components/chat/chat.django-snapshot.html +90 -26
- package/src/components/chat/chat.html +10 -10
- package/src/components/chat/chat.react-snapshot.html +49 -49
- package/src/components/chat-composer/ChatComposer.tsx +3 -0
- package/src/components/chat-composer/chat-composer.django-snapshot.html +10 -10
- package/src/components/chat-composer/chat-composer.django.html +2 -2
- package/src/components/chat-composer/chat-composer.html +10 -10
- package/src/components/chat-composer/chat-composer.react-snapshot.html +10 -10
- package/src/components/chat-composer/chat-formatting.django.html +8 -8
- package/src/components/chat-window/ChatWindow.tsx +3 -1
- package/src/components/chat-window/chat-window.django-snapshot.html +7 -5
- package/src/components/chat-window/chat-window.django.html +3 -3
- package/src/components/chat-window/chat-window.html +1 -1
- package/src/components/chat-window/chat-window.react-snapshot.html +7 -7
- package/src/components/checkbox/checkbox.django-snapshot.html +2 -2
- package/src/components/data-table/data-table.django-snapshot.html +4 -5
- package/src/components/data-table/data-table.react-snapshot.html +4 -4
- package/src/components/drawer/drawer.django-snapshot.html +53 -30
- package/src/components/error-page/error-page.django-snapshot.html +20 -7
- package/src/components/fieldset/fieldset.django-snapshot.html +1 -6
- package/src/components/form-group/form-group.django-snapshot.html +0 -2
- package/src/components/header/header.django-snapshot.html +3 -3
- package/src/components/header/header.html +1 -1
- package/src/components/header/header.react-snapshot.html +3 -3
- package/src/components/identifier/config.json +4 -2
- package/src/components/identifier/identifier.django-snapshot.html +13 -16
- package/src/components/identifier/identifier.react-snapshot.html +13 -15
- package/src/components/image/image.django-snapshot.html +6 -6
- package/src/components/layout/layout.django-snapshot.html +2 -0
- package/src/components/modal/Modal.tsx +4 -3
- package/src/components/modal/config.json +3 -2
- package/src/components/modal/modal.django-snapshot.html +70 -14
- package/src/components/modal/modal.django.html +7 -9
- package/src/components/modal/modal.html +4 -4
- package/src/components/modal/modal.react-snapshot.html +64 -4
- package/src/components/page/Page.tsx +10 -7
- package/src/components/page/page.django-snapshot.html +5 -8
- package/src/components/page/page.django.html +2 -2
- package/src/components/page/page.html +1 -2
- package/src/components/page/page.react-snapshot.html +5 -8
- package/src/components/pagination/navigation/PaginationNavigation.tsx +2 -0
- package/src/components/pagination/navigation/pagination-navigation.django.html +2 -0
- package/src/components/pagination/pagination.django-snapshot.html +62 -0
- package/src/components/pagination/pagination.django.html +3 -1
- package/src/components/pagination/pagination.html +46 -0
- package/src/components/pagination/pagination.react-snapshot.html +48 -0
- package/src/components/pagination/summary/PaginationSummary.tsx +1 -1
- package/src/components/pagination/summary/pagination-summary.django.html +1 -1
- package/src/components/popover/Popover.tsx +1 -0
- package/src/components/popover/popover.django-snapshot.html +37 -1
- package/src/components/popover/popover.django.html +1 -1
- package/src/components/popover/popover.react-snapshot.html +30 -3
- package/src/components/section/Section.tsx +3 -1
- package/src/components/site-alert/site-alert.django-snapshot.html +8 -8
- package/src/components/swap/Swap.tsx +35 -3
- package/src/components/swap/config.json +28 -1
- package/src/components/swap/swap.django-snapshot.html +29 -7
- package/src/components/swap/swap.django.html +15 -1
- package/src/components/swap/swap.react-snapshot.html +34 -4
- package/src/components/theme-picker/ThemePicker.tsx +48 -42
- package/src/components/theme-picker/config.json +27 -29
- package/src/components/theme-picker/theme-picker-select.django.html +1 -1
- package/src/components/theme-picker/theme-picker.django-snapshot.html +283 -78
- package/src/components/theme-picker/theme-picker.django.html +24 -11
- package/src/components/theme-picker/theme-picker.html +155 -54
- package/src/components/theme-picker/theme-picker.react-snapshot.html +265 -67
- package/src/index.js +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<h3 class="site-preview-heading">Default</h3>
|
|
2
|
-
<div class="usx-theme-picker">
|
|
2
|
+
<div class="usx-theme-picker" hidden>
|
|
3
3
|
<button
|
|
4
4
|
type="button"
|
|
5
5
|
class="usa-button usx-button usx-button--ghost usx-theme-picker__trigger"
|
|
@@ -20,27 +20,91 @@
|
|
|
20
20
|
<label class="usa-label usx-label usa-sr-only" for="django-theme-picker-1"> Theme </label>
|
|
21
21
|
|
|
22
22
|
<select id="django-theme-picker-1" class="usa-select usx-select">
|
|
23
|
-
<option value="
|
|
23
|
+
<option value="default" selected>Default</option>
|
|
24
24
|
|
|
25
|
-
<option value="
|
|
25
|
+
<option value="forest">Forest</option>
|
|
26
26
|
|
|
27
|
-
<option value="
|
|
27
|
+
<option value="sunset">Sunset</option>
|
|
28
28
|
|
|
29
|
-
<option value="
|
|
29
|
+
<option value="ocean">Ocean</option>
|
|
30
30
|
|
|
31
|
-
<option value="
|
|
31
|
+
<option value="aurora">Aurora</option>
|
|
32
32
|
|
|
33
|
-
<option value="
|
|
33
|
+
<option value="borealis">Borealis</option>
|
|
34
34
|
|
|
35
|
-
<option value="
|
|
35
|
+
<option value="midnight">Midnight</option>
|
|
36
36
|
|
|
37
|
-
<option value="
|
|
37
|
+
<option value="carbon">Carbon</option>
|
|
38
38
|
|
|
39
|
-
<option value="
|
|
39
|
+
<option value="vads">VADS</option>
|
|
40
40
|
|
|
41
|
-
<option value="
|
|
41
|
+
<option value="gov-uk">GOV.UK</option>
|
|
42
42
|
|
|
43
|
-
<option value="
|
|
43
|
+
<option value="nasa">NASA</option>
|
|
44
|
+
</select>
|
|
45
|
+
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
class="usa-button usx-button usa-button--primary usx-theme-picker__toggle"
|
|
49
|
+
aria-label="Confirm theme"
|
|
50
|
+
>
|
|
51
|
+
<svg
|
|
52
|
+
class="usa-icon usx-icon usx-theme-picker__icon"
|
|
53
|
+
aria-hidden="true"
|
|
54
|
+
focusable="false"
|
|
55
|
+
role="img"
|
|
56
|
+
>
|
|
57
|
+
<use href="img/sprite.svg#close"></use>
|
|
58
|
+
</svg>
|
|
59
|
+
</button>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<h3 class="site-preview-heading">Unenhanced</h3>
|
|
64
|
+
<div class="usx-theme-picker" usx-data-enhanced="true" hidden>
|
|
65
|
+
<button
|
|
66
|
+
type="button"
|
|
67
|
+
class="usa-button usx-button usx-button--ghost usx-theme-picker__trigger"
|
|
68
|
+
aria-label="Theme"
|
|
69
|
+
aria-expanded="false"
|
|
70
|
+
aria-controls="django-theme-picker-unenhanced-panel"
|
|
71
|
+
>
|
|
72
|
+
<svg
|
|
73
|
+
class="usa-icon usx-icon usx-theme-picker__icon"
|
|
74
|
+
aria-hidden="true"
|
|
75
|
+
focusable="false"
|
|
76
|
+
role="img"
|
|
77
|
+
>
|
|
78
|
+
<use href="img/usx-sprite.svg#color_palette"></use>
|
|
79
|
+
</svg>
|
|
80
|
+
</button>
|
|
81
|
+
<div id="django-theme-picker-unenhanced-panel" class="usx-theme-picker__panel">
|
|
82
|
+
<label class="usa-label usx-label usa-sr-only" for="django-theme-picker-unenhanced">
|
|
83
|
+
Theme
|
|
84
|
+
</label>
|
|
85
|
+
|
|
86
|
+
<select id="django-theme-picker-unenhanced" class="usa-select usx-select">
|
|
87
|
+
<option value="default" selected>Default</option>
|
|
88
|
+
|
|
89
|
+
<option value="forest">Forest</option>
|
|
90
|
+
|
|
91
|
+
<option value="sunset">Sunset</option>
|
|
92
|
+
|
|
93
|
+
<option value="ocean">Ocean</option>
|
|
94
|
+
|
|
95
|
+
<option value="aurora">Aurora</option>
|
|
96
|
+
|
|
97
|
+
<option value="borealis">Borealis</option>
|
|
98
|
+
|
|
99
|
+
<option value="midnight">Midnight</option>
|
|
100
|
+
|
|
101
|
+
<option value="carbon">Carbon</option>
|
|
102
|
+
|
|
103
|
+
<option value="vads">VADS</option>
|
|
104
|
+
|
|
105
|
+
<option value="gov-uk">GOV.UK</option>
|
|
106
|
+
|
|
107
|
+
<option value="nasa">NASA</option>
|
|
44
108
|
</select>
|
|
45
109
|
|
|
46
110
|
<button
|
|
@@ -61,7 +125,7 @@
|
|
|
61
125
|
</div>
|
|
62
126
|
|
|
63
127
|
<h3 class="site-preview-heading">Light Dark</h3>
|
|
64
|
-
<div class="usx-theme-picker">
|
|
128
|
+
<div class="usx-theme-picker" hidden>
|
|
65
129
|
<button
|
|
66
130
|
type="button"
|
|
67
131
|
class="usa-button usx-button usx-button--ghost usx-theme-picker__trigger"
|
|
@@ -82,9 +146,9 @@
|
|
|
82
146
|
<label class="usa-label usx-label usa-sr-only" for="django-theme-picker-2"> Theme </label>
|
|
83
147
|
|
|
84
148
|
<select id="django-theme-picker-2" class="usa-select usx-select">
|
|
85
|
-
<option value="
|
|
149
|
+
<option value="aurora" selected>Light</option>
|
|
86
150
|
|
|
87
|
-
<option value="
|
|
151
|
+
<option value="borealis">Dark</option>
|
|
88
152
|
</select>
|
|
89
153
|
|
|
90
154
|
<button
|
|
@@ -104,12 +168,12 @@
|
|
|
104
168
|
</div>
|
|
105
169
|
</div>
|
|
106
170
|
|
|
107
|
-
<h3 class="site-preview-heading">
|
|
108
|
-
<div class="usx-theme-picker usx-theme-picker--
|
|
109
|
-
<
|
|
110
|
-
<
|
|
111
|
-
class="usa-button usx-button usx-button--ghost usx-
|
|
112
|
-
aria-
|
|
171
|
+
<h3 class="site-preview-heading">Popover</h3>
|
|
172
|
+
<div class="usx-theme-picker usx-theme-picker--popover" hidden>
|
|
173
|
+
<details class="usx-popover usx-theme-picker__popover" data-side="bottom" data-align="start">
|
|
174
|
+
<summary
|
|
175
|
+
class="usa-button usx-button usx-button--ghost usx-button--tight margin-0"
|
|
176
|
+
aria-label="Theme"
|
|
113
177
|
>
|
|
114
178
|
<svg
|
|
115
179
|
class="usa-icon usx-icon usx-theme-picker__icon"
|
|
@@ -119,47 +183,196 @@
|
|
|
119
183
|
>
|
|
120
184
|
<use href="img/usx-sprite.svg#color_palette"></use>
|
|
121
185
|
</svg>
|
|
122
|
-
</
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
</label>
|
|
127
|
-
|
|
128
|
-
<select
|
|
129
|
-
id="django-theme-picker-ghost-select"
|
|
130
|
-
class="usa-select usx-select usx-theme-picker__select--hidden"
|
|
186
|
+
</summary>
|
|
187
|
+
<div
|
|
188
|
+
id="django-theme-picker-popover-panel"
|
|
189
|
+
class="usx-popover__panel usx-popover__panel--square"
|
|
131
190
|
>
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
191
|
+
<ul class="usx-popover__menu">
|
|
192
|
+
<li>
|
|
193
|
+
<button
|
|
194
|
+
type="button"
|
|
195
|
+
class="usx-popover__menu-item"
|
|
196
|
+
data-usx-theme-value="default"
|
|
197
|
+
aria-pressed="true"
|
|
198
|
+
>
|
|
199
|
+
Default
|
|
200
|
+
</button>
|
|
201
|
+
</li>
|
|
202
|
+
|
|
203
|
+
<li>
|
|
204
|
+
<button
|
|
205
|
+
type="button"
|
|
206
|
+
class="usx-popover__menu-item"
|
|
207
|
+
data-usx-theme-value="forest"
|
|
208
|
+
aria-pressed="false"
|
|
209
|
+
>
|
|
210
|
+
Forest
|
|
211
|
+
</button>
|
|
212
|
+
</li>
|
|
213
|
+
|
|
214
|
+
<li>
|
|
215
|
+
<button
|
|
216
|
+
type="button"
|
|
217
|
+
class="usx-popover__menu-item"
|
|
218
|
+
data-usx-theme-value="sunset"
|
|
219
|
+
aria-pressed="false"
|
|
220
|
+
>
|
|
221
|
+
Sunset
|
|
222
|
+
</button>
|
|
223
|
+
</li>
|
|
224
|
+
|
|
225
|
+
<li>
|
|
226
|
+
<button
|
|
227
|
+
type="button"
|
|
228
|
+
class="usx-popover__menu-item"
|
|
229
|
+
data-usx-theme-value="ocean"
|
|
230
|
+
aria-pressed="false"
|
|
231
|
+
>
|
|
232
|
+
Ocean
|
|
233
|
+
</button>
|
|
234
|
+
</li>
|
|
235
|
+
|
|
236
|
+
<li>
|
|
237
|
+
<button
|
|
238
|
+
type="button"
|
|
239
|
+
class="usx-popover__menu-item"
|
|
240
|
+
data-usx-theme-value="aurora"
|
|
241
|
+
aria-pressed="false"
|
|
242
|
+
>
|
|
243
|
+
Aurora
|
|
244
|
+
</button>
|
|
245
|
+
</li>
|
|
246
|
+
|
|
247
|
+
<li>
|
|
248
|
+
<button
|
|
249
|
+
type="button"
|
|
250
|
+
class="usx-popover__menu-item"
|
|
251
|
+
data-usx-theme-value="borealis"
|
|
252
|
+
aria-pressed="false"
|
|
253
|
+
>
|
|
254
|
+
Borealis
|
|
255
|
+
</button>
|
|
256
|
+
</li>
|
|
257
|
+
|
|
258
|
+
<li>
|
|
259
|
+
<button
|
|
260
|
+
type="button"
|
|
261
|
+
class="usx-popover__menu-item"
|
|
262
|
+
data-usx-theme-value="midnight"
|
|
263
|
+
aria-pressed="false"
|
|
264
|
+
>
|
|
265
|
+
Midnight
|
|
266
|
+
</button>
|
|
267
|
+
</li>
|
|
268
|
+
|
|
269
|
+
<li>
|
|
270
|
+
<button
|
|
271
|
+
type="button"
|
|
272
|
+
class="usx-popover__menu-item"
|
|
273
|
+
data-usx-theme-value="carbon"
|
|
274
|
+
aria-pressed="false"
|
|
275
|
+
>
|
|
276
|
+
Carbon
|
|
277
|
+
</button>
|
|
278
|
+
</li>
|
|
279
|
+
|
|
280
|
+
<li>
|
|
281
|
+
<button
|
|
282
|
+
type="button"
|
|
283
|
+
class="usx-popover__menu-item"
|
|
284
|
+
data-usx-theme-value="vads"
|
|
285
|
+
aria-pressed="false"
|
|
286
|
+
>
|
|
287
|
+
VADS
|
|
288
|
+
</button>
|
|
289
|
+
</li>
|
|
290
|
+
|
|
291
|
+
<li>
|
|
292
|
+
<button
|
|
293
|
+
type="button"
|
|
294
|
+
class="usx-popover__menu-item"
|
|
295
|
+
data-usx-theme-value="gov-uk"
|
|
296
|
+
aria-pressed="false"
|
|
297
|
+
>
|
|
298
|
+
GOV.UK
|
|
299
|
+
</button>
|
|
300
|
+
</li>
|
|
301
|
+
|
|
302
|
+
<li>
|
|
303
|
+
<button
|
|
304
|
+
type="button"
|
|
305
|
+
class="usx-popover__menu-item"
|
|
306
|
+
data-usx-theme-value="nasa"
|
|
307
|
+
aria-pressed="false"
|
|
308
|
+
>
|
|
309
|
+
NASA
|
|
310
|
+
</button>
|
|
311
|
+
</li>
|
|
312
|
+
</ul>
|
|
313
|
+
</div>
|
|
314
|
+
</details>
|
|
315
|
+
<input id="django-theme-picker-popover" type="hidden" value="default" name="theme" />
|
|
316
|
+
</div>
|
|
151
317
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
318
|
+
<h3 class="site-preview-heading">Popover End</h3>
|
|
319
|
+
<div class="usx-theme-picker usx-theme-picker--popover margin-left-15" hidden>
|
|
320
|
+
<details class="usx-popover usx-theme-picker__popover" data-side="bottom" data-align="end">
|
|
321
|
+
<summary
|
|
322
|
+
class="usa-button usx-button usx-button--ghost usx-button--tight margin-0"
|
|
323
|
+
aria-label="Theme"
|
|
324
|
+
>
|
|
325
|
+
<svg
|
|
326
|
+
class="usa-icon usx-icon usx-theme-picker__icon"
|
|
327
|
+
aria-hidden="true"
|
|
328
|
+
focusable="false"
|
|
329
|
+
role="img"
|
|
330
|
+
>
|
|
331
|
+
<use href="img/usx-sprite.svg#color_palette"></use>
|
|
332
|
+
</svg>
|
|
333
|
+
</summary>
|
|
334
|
+
<div
|
|
335
|
+
id="django-theme-picker-popover-end-panel"
|
|
336
|
+
class="usx-popover__panel usx-popover__panel--square"
|
|
337
|
+
>
|
|
338
|
+
<ul class="usx-popover__menu">
|
|
339
|
+
<li>
|
|
340
|
+
<button
|
|
341
|
+
type="button"
|
|
342
|
+
class="usx-popover__menu-item"
|
|
343
|
+
data-usx-theme-value="aurora"
|
|
344
|
+
aria-pressed="true"
|
|
345
|
+
>
|
|
346
|
+
Light
|
|
347
|
+
</button>
|
|
348
|
+
</li>
|
|
349
|
+
|
|
350
|
+
<li>
|
|
351
|
+
<button
|
|
352
|
+
type="button"
|
|
353
|
+
class="usx-popover__menu-item"
|
|
354
|
+
data-usx-theme-value="borealis"
|
|
355
|
+
aria-pressed="false"
|
|
356
|
+
>
|
|
357
|
+
Dark
|
|
358
|
+
</button>
|
|
359
|
+
</li>
|
|
360
|
+
</ul>
|
|
361
|
+
</div>
|
|
362
|
+
</details>
|
|
363
|
+
<input id="django-theme-picker-popover-end" type="hidden" value="aurora" name="theme" />
|
|
155
364
|
</div>
|
|
156
365
|
|
|
157
366
|
<h3 class="site-preview-heading">Swap</h3>
|
|
158
|
-
<div class="usx-theme-picker usx-theme-picker--swap">
|
|
159
|
-
<
|
|
160
|
-
|
|
367
|
+
<div class="usx-theme-picker usx-theme-picker--swap" hidden>
|
|
368
|
+
<button
|
|
369
|
+
type="button"
|
|
370
|
+
class="usx-swap usx-swap--rotate usa-button usx-button usx-swap--button usx-theme-picker__swap usx-button--ghost usx-button--tight"
|
|
371
|
+
aria-pressed="false"
|
|
372
|
+
aria-label="Dark Theme"
|
|
373
|
+
data-usx-theme-off="aurora"
|
|
374
|
+
data-usx-theme-on="borealis"
|
|
161
375
|
>
|
|
162
|
-
<input type="checkbox" autocomplete="off" aria-label="Theme: Light. Switch to Dark" />
|
|
163
376
|
<span class="usx-swap-on">
|
|
164
377
|
<svg
|
|
165
378
|
class="usa-icon usx-icon usx-theme-picker__icon"
|
|
@@ -178,20 +391,12 @@
|
|
|
178
391
|
>
|
|
179
392
|
<use href="img/usx-sprite.svg#sun"></use></svg
|
|
180
393
|
></span>
|
|
181
|
-
</
|
|
182
|
-
<
|
|
183
|
-
<label class="usa-label usx-label usa-sr-only" for="django-theme-picker-swap"> Theme </label>
|
|
184
|
-
|
|
185
|
-
<select id="django-theme-picker-swap" class="usa-select usx-select">
|
|
186
|
-
<option value="Aurora" selected>Light</option>
|
|
187
|
-
|
|
188
|
-
<option value="Borealis">Dark</option>
|
|
189
|
-
</select>
|
|
190
|
-
</div>
|
|
394
|
+
</button>
|
|
395
|
+
<input id="django-theme-picker-swap" type="hidden" value="aurora" />
|
|
191
396
|
</div>
|
|
192
397
|
|
|
193
398
|
<h3 class="site-preview-heading">With Value</h3>
|
|
194
|
-
<div class="usx-theme-picker">
|
|
399
|
+
<div class="usx-theme-picker" hidden>
|
|
195
400
|
<button
|
|
196
401
|
type="button"
|
|
197
402
|
class="usa-button usx-button usx-button--ghost usx-theme-picker__trigger"
|
|
@@ -212,27 +417,27 @@
|
|
|
212
417
|
<label class="usa-label usx-label usa-sr-only" for="django-theme-picker-value"> Theme </label>
|
|
213
418
|
|
|
214
419
|
<select id="django-theme-picker-value" class="usa-select usx-select">
|
|
215
|
-
<option value="
|
|
420
|
+
<option value="default">Default</option>
|
|
216
421
|
|
|
217
|
-
<option value="
|
|
422
|
+
<option value="forest" selected>Forest</option>
|
|
218
423
|
|
|
219
|
-
<option value="
|
|
424
|
+
<option value="sunset">Sunset</option>
|
|
220
425
|
|
|
221
|
-
<option value="
|
|
426
|
+
<option value="ocean">Ocean</option>
|
|
222
427
|
|
|
223
|
-
<option value="
|
|
428
|
+
<option value="aurora">Aurora</option>
|
|
224
429
|
|
|
225
|
-
<option value="
|
|
430
|
+
<option value="borealis">Borealis</option>
|
|
226
431
|
|
|
227
|
-
<option value="
|
|
432
|
+
<option value="midnight">Midnight</option>
|
|
228
433
|
|
|
229
|
-
<option value="
|
|
434
|
+
<option value="carbon">Carbon</option>
|
|
230
435
|
|
|
231
|
-
<option value="
|
|
436
|
+
<option value="vads">VADS</option>
|
|
232
437
|
|
|
233
|
-
<option value="
|
|
438
|
+
<option value="gov-uk">GOV.UK</option>
|
|
234
439
|
|
|
235
|
-
<option value="
|
|
440
|
+
<option value="nasa">NASA</option>
|
|
236
441
|
</select>
|
|
237
442
|
|
|
238
443
|
<button
|
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
{% load usx_components %}
|
|
2
2
|
{% firstof id "theme-picker" as field_id %}
|
|
3
3
|
{% firstof value defaultValue themes.0.value as selected_value %}
|
|
4
|
-
<div class="usx-theme-picker{% if variant and variant != 'default' %} usx-theme-picker--{{ variant }}{% endif %}{% if className %} {{ className }}{% endif %}"{% if extraAttributes %}{% for attr, attr_value in extraAttributes.items %} {{ attr }}="{% if attr_value is True %}true{% elif attr_value is False %}false{% else %}{{ attr_value }}{% endif %}"{% endfor %}{% endif %}>
|
|
4
|
+
<div class="usx-theme-picker{% if variant and variant != 'default' %} usx-theme-picker--{{ variant }}{% endif %}{% if className %} {{ className }}{% endif %}"{% if extraAttributes %}{% for attr, attr_value in extraAttributes.items %} {{ attr }}="{% if attr_value is True %}true{% elif attr_value is False %}false{% else %}{{ attr_value }}{% endif %}"{% endfor %}{% endif %} hidden>
|
|
5
5
|
{% if variant == 'swap' %}
|
|
6
|
-
<
|
|
7
|
-
|
|
6
|
+
<button
|
|
7
|
+
type="button"
|
|
8
|
+
class="usx-swap usx-swap--rotate usa-button usx-button usx-swap--button usx-theme-picker__swap usx-button--ghost usx-button--tight"
|
|
9
|
+
aria-pressed="{% if themes.1.value == selected_value %}true{% else %}false{% endif %}"
|
|
10
|
+
aria-label="{{ themes.1.label }} {{ label|default:'Theme' }}"
|
|
11
|
+
data-usx-theme-off="{{ themes.0.value }}"
|
|
12
|
+
data-usx-theme-on="{{ themes.1.value }}"
|
|
13
|
+
>
|
|
8
14
|
<span class="usx-swap-on">{% icon name="moon" source="usx" className="usx-theme-picker__icon" %}{% endicon %}</span>
|
|
9
15
|
<span class="usx-swap-off">{% icon name="sun" source="usx" className="usx-theme-picker__icon" %}{% endicon %}</span>
|
|
10
|
-
</
|
|
11
|
-
<
|
|
12
|
-
{% elif variant == '
|
|
13
|
-
<
|
|
14
|
-
<
|
|
16
|
+
</button>
|
|
17
|
+
<input id="{{ field_id }}" type="hidden" value="{{ selected_value }}"{% if name %} name="{{ name }}"{% endif %}>
|
|
18
|
+
{% elif variant == 'popover' %}
|
|
19
|
+
<details class="usx-popover usx-theme-picker__popover" data-side="bottom" data-align="{{ popoverAlign|default:'start' }}">
|
|
20
|
+
<summary class="usa-button usx-button usx-button--ghost usx-button--tight margin-0" aria-label="{{ label|default:'Theme' }}">
|
|
15
21
|
{% icon name="color_palette" source="usx" className="usx-theme-picker__icon" %}{% endicon %}
|
|
16
|
-
</
|
|
17
|
-
{
|
|
18
|
-
|
|
22
|
+
</summary>
|
|
23
|
+
<div id="{{ field_id }}-panel" class="usx-popover__panel usx-popover__panel--square">
|
|
24
|
+
<ul class="usx-popover__menu">
|
|
25
|
+
{% for theme in themes %}
|
|
26
|
+
<li><button type="button" class="usx-popover__menu-item" data-usx-theme-value="{{ theme.value }}" aria-pressed="{% if theme.value == selected_value %}true{% else %}false{% endif %}">{{ theme.label|force_escape }}</button></li>
|
|
27
|
+
{% endfor %}
|
|
28
|
+
</ul>
|
|
29
|
+
</div>
|
|
30
|
+
</details>
|
|
31
|
+
<input id="{{ field_id }}" type="hidden" value="{{ selected_value }}"{% if name %} name="{{ name }}"{% endif %}>
|
|
19
32
|
{% else %}
|
|
20
33
|
<button type="button" class="usa-button usx-button usx-button--ghost usx-theme-picker__trigger" aria-label="{{ label|default:'Theme' }}" aria-expanded="false" aria-controls="{{ field_id }}-panel">
|
|
21
34
|
{% icon name="color_palette" source="usx" className="usx-theme-picker__icon" %}{% endicon %}
|