@solexllc/usx-react 0.9.0 → 0.10.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 (123) hide show
  1. package/README.md +6 -5
  2. package/dist/index.cjs +123 -97
  3. package/dist/index.js +124 -98
  4. package/package.json +4 -4
  5. package/src/components/accordion/Accordion.tsx +4 -1
  6. package/src/components/accordion/accordion.django.html +1 -1
  7. package/src/components/accordion/config.json +1 -0
  8. package/src/components/banner/Banner.tsx +3 -1
  9. package/src/components/banner/banner.django.html +1 -1
  10. package/src/components/banner/config.json +1 -0
  11. package/src/components/carousel/carousel.django-snapshot.html +0 -40
  12. package/src/components/carousel/carousel.react-snapshot.html +0 -38
  13. package/src/components/character-count/CharacterCount.tsx +3 -0
  14. package/src/components/character-count/character-count.django-snapshot.html +43 -0
  15. package/src/components/character-count/character-count.django.html +2 -2
  16. package/src/components/character-count/character-count.react-snapshot.html +37 -0
  17. package/src/components/character-count/config.json +9 -0
  18. package/src/components/checkbox/Checkbox.tsx +16 -17
  19. package/src/components/checkbox/checkbox.django-snapshot.html +18 -0
  20. package/src/components/checkbox/checkbox.django.html +6 -4
  21. package/src/components/checkbox/checkbox.react-snapshot.html +14 -0
  22. package/src/components/checkbox/config.json +4 -4
  23. package/src/components/checkbox-group/checkbox-group.django-snapshot.html +54 -0
  24. package/src/components/checkbox-group/checkbox-group.react-snapshot.html +45 -0
  25. package/src/components/combobox/Combobox.tsx +6 -1
  26. package/src/components/combobox/combobox.django-snapshot.html +141 -0
  27. package/src/components/combobox/combobox.django.html +2 -2
  28. package/src/components/combobox/combobox.react-snapshot.html +76 -0
  29. package/src/components/combobox/config.json +9 -0
  30. package/src/components/data-table/DataTable.tsx +4 -1
  31. package/src/components/data-table/config.json +4 -0
  32. package/src/components/data-table/data-table.django.html +1 -1
  33. package/src/components/date-picker/DatePicker.tsx +6 -1
  34. package/src/components/date-picker/config.json +9 -0
  35. package/src/components/date-picker/date-picker.django-snapshot.html +23 -0
  36. package/src/components/date-picker/date-picker.django.html +4 -4
  37. package/src/components/date-picker/date-picker.react-snapshot.html +19 -0
  38. package/src/components/date-range-picker/DateRangePicker.tsx +11 -2
  39. package/src/components/date-range-picker/config.json +14 -0
  40. package/src/components/date-range-picker/date-range-picker.django-snapshot.html +47 -0
  41. package/src/components/date-range-picker/date-range-picker.django.html +5 -5
  42. package/src/components/date-range-picker/date-range-picker.react-snapshot.html +38 -0
  43. package/src/components/drawer/Drawer.tsx +3 -1
  44. package/src/components/drawer/config.json +4 -0
  45. package/src/components/drawer/drawer.django.html +1 -1
  46. package/src/components/file-input/FileInput.tsx +7 -2
  47. package/src/components/file-input/_contents.django.html +2 -1
  48. package/src/components/file-input/config.json +4 -0
  49. package/src/components/header/Header.tsx +15 -9
  50. package/src/components/header/config.json +1 -0
  51. package/src/components/header/header.django-snapshot.html +24 -0
  52. package/src/components/header/header.django.html +8 -4
  53. package/src/components/header/header.html +20 -0
  54. package/src/components/header/header.react-snapshot.html +20 -0
  55. package/src/components/in-page-nav/InPageNav.tsx +3 -0
  56. package/src/components/in-page-nav/config.json +1 -0
  57. package/src/components/in-page-nav/in-page-nav.django.html +1 -1
  58. package/src/components/input/Input.tsx +3 -0
  59. package/src/components/input/config.json +10 -0
  60. package/src/components/input/input.django-snapshot.html +24 -0
  61. package/src/components/input/input.django.html +4 -4
  62. package/src/components/input/input.react-snapshot.html +22 -0
  63. package/src/components/language-selector/LanguageSelector.tsx +10 -5
  64. package/src/components/language-selector/config.json +1 -0
  65. package/src/components/language-selector/language-selector.django.html +2 -2
  66. package/src/components/layout/Layout.tsx +3 -1
  67. package/src/components/layout/config.json +4 -0
  68. package/src/components/layout/layout.django.html +1 -1
  69. package/src/components/memorable-date/MemorableDate.tsx +18 -3
  70. package/src/components/memorable-date/config.json +15 -0
  71. package/src/components/memorable-date/memorable-date.django-snapshot.html +82 -0
  72. package/src/components/memorable-date/memorable-date.django.html +14 -14
  73. package/src/components/memorable-date/memorable-date.react-snapshot.html +70 -0
  74. package/src/components/modal/Modal.tsx +3 -0
  75. package/src/components/modal/config.json +1 -0
  76. package/src/components/modal/modal.django.html +1 -1
  77. package/src/components/popover/Popover.tsx +3 -0
  78. package/src/components/popover/config.json +4 -0
  79. package/src/components/popover/popover.django-snapshot.html +30 -0
  80. package/src/components/popover/popover.django.html +1 -0
  81. package/src/components/radio-buttons/RadioButtons.tsx +5 -1
  82. package/src/components/radio-buttons/radio-buttons.django-snapshot.html +65 -0
  83. package/src/components/radio-buttons/radio-buttons.django.html +1 -1
  84. package/src/components/radio-buttons/radio-buttons.react-snapshot.html +53 -0
  85. package/src/components/range-slider/RangeSlider.tsx +4 -2
  86. package/src/components/range-slider/config.json +1 -0
  87. package/src/components/range-slider/range-slider.django-snapshot.html +17 -0
  88. package/src/components/range-slider/range-slider.django.html +4 -4
  89. package/src/components/range-slider/range-slider.react-snapshot.html +16 -0
  90. package/src/components/search/Search.tsx +6 -1
  91. package/src/components/search/config.json +5 -0
  92. package/src/components/search/search.django-snapshot.html +683 -563
  93. package/src/components/search/search.django.html +1 -1
  94. package/src/components/search/search.react-snapshot.html +25 -0
  95. package/src/components/select/Select.tsx +3 -1
  96. package/src/components/select/config.json +5 -0
  97. package/src/components/select/select.django-snapshot.html +15 -0
  98. package/src/components/select/select.django.html +2 -2
  99. package/src/components/select/select.react-snapshot.html +11 -0
  100. package/src/components/switch/Switch.tsx +13 -70
  101. package/src/components/switch/config.json +60 -23
  102. package/src/components/switch/switch.django-snapshot.html +507 -56
  103. package/src/components/switch/switch.django.html +23 -26
  104. package/src/components/switch/switch.html +425 -33
  105. package/src/components/switch/switch.react-snapshot.html +447 -58
  106. package/src/components/table/Table.tsx +3 -1
  107. package/src/components/table/config.json +1 -0
  108. package/src/components/table/table.django.html +1 -1
  109. package/src/components/text-area/TextArea.tsx +3 -1
  110. package/src/components/text-area/config.json +5 -0
  111. package/src/components/text-area/text-area.django-snapshot.html +18 -0
  112. package/src/components/text-area/text-area.django.html +4 -4
  113. package/src/components/text-area/text-area.react-snapshot.html +16 -0
  114. package/src/components/theme-picker/ThemePicker.tsx +3 -1
  115. package/src/components/theme-picker/config.json +14 -1
  116. package/src/components/theme-picker/theme-picker.django-snapshot.html +64 -0
  117. package/src/components/theme-picker/theme-picker.django.html +2 -2
  118. package/src/components/theme-picker/theme-picker.react-snapshot.html +52 -0
  119. package/src/components/time-picker/TimePicker.tsx +6 -1
  120. package/src/components/time-picker/config.json +9 -0
  121. package/src/components/time-picker/time-picker.django-snapshot.html +26 -0
  122. package/src/components/time-picker/time-picker.django.html +4 -4
  123. package/src/components/time-picker/time-picker.react-snapshot.html +22 -0
@@ -1,73 +1,524 @@
1
1
  <h3 class="site-preview-heading">Default</h3>
2
- <input type="checkbox" class="usx-switch usx-toggle-md" id="django-switch-1" />
2
+ <div class="usa-form-group usx-form-group">
3
+ <div class="usa-checkbox usx-checkbox usx-switch">
4
+ <input
5
+ class="usa-checkbox__input"
6
+ id="django-example-switch-1"
7
+ type="checkbox"
8
+ name="example-1"
9
+ value="example-value-1"
10
+ />
3
11
 
4
- <h3 class="site-preview-heading">XS</h3>
5
- <input type="checkbox" class="usx-switch usx-toggle-xs" id="django-switch-xs" />
12
+ <label class="usa-checkbox__label" for="django-example-switch-1"> Example Switch 1 </label>
13
+ </div>
14
+ </div>
6
15
 
7
- <h3 class="site-preview-heading">SM</h3>
8
- <input type="checkbox" class="usx-switch usx-toggle-sm" id="django-switch-sm" />
16
+ <h3 class="site-preview-heading">Checked</h3>
17
+ <div class="usa-form-group usx-form-group">
18
+ <div class="usa-checkbox usx-checkbox usx-switch">
19
+ <input
20
+ class="usa-checkbox__input"
21
+ id="django-example-switch-2"
22
+ type="checkbox"
23
+ name="example-2"
24
+ value="example-value-2"
25
+ checked
26
+ />
9
27
 
10
- <h3 class="site-preview-heading">MD</h3>
11
- <input type="checkbox" class="usx-switch usx-toggle-md" id="django-switch-md" />
28
+ <label class="usa-checkbox__label" for="django-example-switch-2"> Example Switch 2 </label>
29
+ </div>
30
+ </div>
12
31
 
13
- <h3 class="site-preview-heading">LG</h3>
14
- <input type="checkbox" class="usx-switch usx-toggle-lg" id="django-switch-lg" />
32
+ <h3 class="site-preview-heading">Tile</h3>
33
+ <div class="usa-form-group usx-form-group">
34
+ <div class="usa-checkbox usx-checkbox usx-switch">
35
+ <input
36
+ class="usa-checkbox__input usa-checkbox__input--tile"
37
+ id="django-example-switch-3"
38
+ type="checkbox"
39
+ name="example-3"
40
+ value="example-value-3"
41
+ />
15
42
 
16
- <h3 class="site-preview-heading">XL</h3>
17
- <input type="checkbox" class="usx-switch usx-toggle-xl" id="django-switch-xl" />
43
+ <label class="usa-checkbox__label" for="django-example-switch-3"> Example Switch 3 </label>
44
+ </div>
45
+ </div>
18
46
 
19
- <h3 class="site-preview-heading">Primary</h3>
20
- <input
21
- type="checkbox"
22
- class="usx-switch usx-toggle-md text-primary"
23
- id="django-switch-primary"
24
- checked
25
- />
47
+ <h3 class="site-preview-heading">Description</h3>
48
+ <div class="usa-form-group usx-form-group">
49
+ <div class="usa-checkbox usx-checkbox usx-switch">
50
+ <input
51
+ class="usa-checkbox__input"
52
+ id="django-example-switch-4"
53
+ type="checkbox"
54
+ name="example-4"
55
+ value="example-value-4"
56
+ />
26
57
 
27
- <h3 class="site-preview-heading">Success</h3>
28
- <input
29
- type="checkbox"
30
- class="usx-switch usx-toggle-md text-success"
31
- id="django-switch-success"
32
- checked
33
- />
34
-
35
- <h3 class="site-preview-heading">Warning</h3>
36
- <input
37
- type="checkbox"
38
- class="usx-switch usx-toggle-md text-warning"
39
- id="django-switch-warning"
40
- checked
41
- />
58
+ <label class="usa-checkbox__label" for="django-example-switch-4">
59
+ Example Switch 4
42
60
 
43
- <h3 class="site-preview-heading">Error</h3>
44
- <input
45
- type="checkbox"
46
- class="usx-switch usx-toggle-md text-error"
47
- id="django-switch-error"
48
- checked
49
- />
61
+ <span class="usa-checkbox__label-description">Additional details about this setting.</span>
62
+ </label>
63
+ </div>
64
+ </div>
65
+
66
+ <h3 class="site-preview-heading">Tile With Description</h3>
67
+ <div class="usa-form-group usx-form-group">
68
+ <div class="usa-checkbox usx-checkbox usx-switch">
69
+ <input
70
+ class="usa-checkbox__input usa-checkbox__input--tile"
71
+ id="django-example-switch-5"
72
+ type="checkbox"
73
+ name="example-5"
74
+ value="example-value-5"
75
+ />
76
+
77
+ <label class="usa-checkbox__label" for="django-example-switch-5">
78
+ Example Switch 5
50
79
 
51
- <h3 class="site-preview-heading">Pre Checked</h3>
52
- <input type="checkbox" class="usx-switch usx-toggle-md" id="django-switch-prechecked" checked />
80
+ <span class="usa-checkbox__label-description">Additional details about this setting.</span>
81
+ </label>
82
+ </div>
83
+ </div>
53
84
 
54
85
  <h3 class="site-preview-heading">Disabled</h3>
55
- <input type="checkbox" class="usx-switch usx-toggle-md" id="django-switch-disabled" disabled />
86
+ <div class="usa-form-group usx-form-group">
87
+ <div class="usa-checkbox usx-checkbox usx-switch">
88
+ <input
89
+ class="usa-checkbox__input"
90
+ id="django-example-switch-6"
91
+ type="checkbox"
92
+ name="example-6"
93
+ value="example-value-6"
94
+ disabled
95
+ />
96
+
97
+ <label class="usa-checkbox__label" for="django-example-switch-6"> Example Switch 6 </label>
98
+ </div>
99
+ </div>
56
100
 
57
101
  <h3 class="site-preview-heading">Disabled Checked</h3>
58
- <input
59
- type="checkbox"
60
- class="usx-switch usx-toggle-md"
61
- id="django-switch-disabled-checked"
62
- checked
63
- disabled
64
- />
102
+ <div class="usa-form-group usx-form-group">
103
+ <div class="usa-checkbox usx-checkbox usx-switch">
104
+ <input
105
+ class="usa-checkbox__input"
106
+ id="django-example-switch-7"
107
+ type="checkbox"
108
+ name="example-7"
109
+ value="example-value-7"
110
+ checked
111
+ disabled
112
+ />
113
+
114
+ <label class="usa-checkbox__label" for="django-example-switch-7"> Example Switch 7 </label>
115
+ </div>
116
+ </div>
117
+
118
+ <h3 class="site-preview-heading">Disabled Tile</h3>
119
+ <div class="usa-form-group usx-form-group">
120
+ <div class="usa-checkbox usx-checkbox usx-switch">
121
+ <input
122
+ class="usa-checkbox__input usa-checkbox__input--tile"
123
+ id="django-example-switch-8"
124
+ type="checkbox"
125
+ name="example-8"
126
+ value="example-value-8"
127
+ disabled
128
+ />
129
+
130
+ <label class="usa-checkbox__label" for="django-example-switch-8"> Example Switch 8 </label>
131
+ </div>
132
+ </div>
133
+
134
+ <h3 class="site-preview-heading">Disabled Checked Tile</h3>
135
+ <div class="usa-form-group usx-form-group">
136
+ <div class="usa-checkbox usx-checkbox usx-switch">
137
+ <input
138
+ class="usa-checkbox__input usa-checkbox__input--tile"
139
+ id="django-example-switch-9"
140
+ type="checkbox"
141
+ name="example-9"
142
+ value="example-value-9"
143
+ checked
144
+ disabled
145
+ />
146
+
147
+ <label class="usa-checkbox__label" for="django-example-switch-9"> Example Switch 9 </label>
148
+ </div>
149
+ </div>
150
+
151
+ <h3 class="site-preview-heading">Small</h3>
152
+ <div class="usa-form-group usx-form-group">
153
+ <div class="usa-checkbox usx-checkbox usx-checkbox--small usx-switch">
154
+ <input
155
+ class="usa-checkbox__input"
156
+ id="django-example-switch-10"
157
+ type="checkbox"
158
+ name="example-10"
159
+ value="example-value-10"
160
+ />
161
+
162
+ <label class="usa-checkbox__label" for="django-example-switch-10"> Example Switch 10 </label>
163
+ </div>
164
+ </div>
165
+
166
+ <h3 class="site-preview-heading">Small Tile</h3>
167
+ <div class="usa-form-group usx-form-group">
168
+ <div class="usa-checkbox usx-checkbox usx-checkbox--small usx-switch">
169
+ <input
170
+ class="usa-checkbox__input usa-checkbox__input--tile"
171
+ id="django-example-switch-11"
172
+ type="checkbox"
173
+ name="example-11"
174
+ value="example-value-11"
175
+ />
176
+
177
+ <label class="usa-checkbox__label" for="django-example-switch-11"> Example Switch 11 </label>
178
+ </div>
179
+ </div>
180
+
181
+ <h3 class="site-preview-heading">Small Disabled</h3>
182
+ <div class="usa-form-group usx-form-group">
183
+ <div class="usa-checkbox usx-checkbox usx-checkbox--small usx-switch">
184
+ <input
185
+ class="usa-checkbox__input"
186
+ id="django-example-switch-12"
187
+ type="checkbox"
188
+ name="example-12"
189
+ value="example-value-12"
190
+ disabled
191
+ />
192
+
193
+ <label class="usa-checkbox__label" for="django-example-switch-12"> Example Switch 12 </label>
194
+ </div>
195
+ </div>
196
+
197
+ <h3 class="site-preview-heading">Small Checked Disabled</h3>
198
+ <div class="usa-form-group usx-form-group">
199
+ <div class="usa-checkbox usx-checkbox usx-checkbox--small usx-switch">
200
+ <input
201
+ class="usa-checkbox__input"
202
+ id="django-example-switch-13"
203
+ type="checkbox"
204
+ name="example-13"
205
+ value="example-value-13"
206
+ checked
207
+ disabled
208
+ />
209
+
210
+ <label class="usa-checkbox__label" for="django-example-switch-13"> Example Switch 13 </label>
211
+ </div>
212
+ </div>
213
+
214
+ <h3 class="site-preview-heading">Small Tile Disabled</h3>
215
+ <div class="usa-form-group usx-form-group">
216
+ <div class="usa-checkbox usx-checkbox usx-checkbox--small usx-switch">
217
+ <input
218
+ class="usa-checkbox__input usa-checkbox__input--tile"
219
+ id="django-example-switch-14"
220
+ type="checkbox"
221
+ name="example-14"
222
+ value="example-value-14"
223
+ disabled
224
+ />
225
+
226
+ <label class="usa-checkbox__label" for="django-example-switch-14">
227
+ Example Switch 14
228
+
229
+ <span class="usa-checkbox__label-description">Additional details about this setting.</span>
230
+ </label>
231
+ </div>
232
+ </div>
233
+
234
+ <h3 class="site-preview-heading">Small Checked Tile Disabled</h3>
235
+ <div class="usa-form-group usx-form-group">
236
+ <div class="usa-checkbox usx-checkbox usx-checkbox--small usx-switch">
237
+ <input
238
+ class="usa-checkbox__input usa-checkbox__input--tile"
239
+ id="django-example-switch-15"
240
+ type="checkbox"
241
+ name="example-15"
242
+ value="example-value-15"
243
+ checked
244
+ disabled
245
+ />
246
+
247
+ <label class="usa-checkbox__label" for="django-example-switch-15">
248
+ Example Switch 15
249
+
250
+ <span class="usa-checkbox__label-description">Additional details about this setting.</span>
251
+ </label>
252
+ </div>
253
+ </div>
254
+
255
+ <h3 class="site-preview-heading">With On Change</h3>
256
+ <div class="usa-form-group usx-form-group">
257
+ <div class="usa-checkbox usx-checkbox usx-switch">
258
+ <input
259
+ class="usa-checkbox__input"
260
+ id="django-example-switch-16"
261
+ type="checkbox"
262
+ name="example-16"
263
+ value="example-value-16"
264
+ />
265
+
266
+ <label class="usa-checkbox__label" for="django-example-switch-16"> Example Switch 16 </label>
267
+ </div>
268
+ </div>
269
+
270
+ <h3 class="site-preview-heading">Required</h3>
271
+ <div class="usa-form-group usx-form-group">
272
+ <div class="usa-checkbox usx-checkbox usx-switch">
273
+ <input
274
+ class="usa-checkbox__input usa-checkbox__input--tile"
275
+ id="django-example-switch-17"
276
+ type="checkbox"
277
+ name="example-17"
278
+ value="example-value-17"
279
+ required
280
+ />
281
+
282
+ <label class="usa-checkbox__label" for="django-example-switch-17">
283
+ <abbr title="Required" class="usx-required">*</abbr> Example Switch 17
284
+
285
+ <span class="usa-checkbox__label-description">This setting is required.</span>
286
+ </label>
287
+ </div>
288
+ </div>
289
+
290
+ <h3 class="site-preview-heading">Error</h3>
291
+ <div class="usa-form-group usx-form-group usa-form-group--error">
292
+ <div class="usa-checkbox usx-checkbox usx-switch">
293
+ <input
294
+ class="usa-checkbox__input usa-checkbox__input--tile"
295
+ id="django-example-switch-18"
296
+ type="checkbox"
297
+ name="example-18"
298
+ value="example-value-18"
299
+ />
300
+
301
+ <label class="usa-checkbox__label" for="django-example-switch-18">
302
+ Example Switch 18
303
+
304
+ <span class="usa-checkbox__label-description">Please review this setting.</span>
305
+ </label>
306
+ </div>
307
+
308
+ <span class="usa-error-message usx-error-message" role="alert"
309
+ >Choose a setting before continuing.</span
310
+ >
311
+ </div>
312
+
313
+ <h3 class="site-preview-heading">Error Without Form Group</h3>
314
+ <div class="usa-checkbox usx-checkbox usx-switch">
315
+ <input
316
+ class="usa-checkbox__input usa-checkbox__input--tile"
317
+ id="django-example-switch-19"
318
+ type="checkbox"
319
+ name="example-19"
320
+ value="example-value-19"
321
+ />
322
+
323
+ <label class="usa-checkbox__label" for="django-example-switch-19">
324
+ Example Switch 19
325
+
326
+ <span class="usa-checkbox__label-description">Please review this setting.</span>
327
+ </label>
328
+ </div>
329
+
330
+ <span class="usa-error-message usx-error-message" role="alert"
331
+ >Choose a setting before continuing.</span
332
+ >
333
+
334
+ <h3 class="site-preview-heading">Success</h3>
335
+ <div class="usa-form-group usx-form-group">
336
+ <div class="usa-checkbox usx-checkbox usx-switch">
337
+ <input
338
+ class="usa-checkbox__input usa-checkbox__input--tile"
339
+ id="django-example-switch-20"
340
+ type="checkbox"
341
+ name="example-20"
342
+ value="example-value-20"
343
+ />
344
+
345
+ <label class="usa-checkbox__label" for="django-example-switch-20">
346
+ Example Switch 20
347
+
348
+ <span class="usa-checkbox__label-description">Your choice has been recorded.</span>
349
+ </label>
350
+ </div>
351
+
352
+ <span class="usa-success-message text-success" role="status">Setting saved.</span>
353
+ </div>
354
+
355
+ <h3 class="site-preview-heading">Aria Label</h3>
356
+ <div class="usa-form-group usx-form-group">
357
+ <div class="usa-checkbox usx-checkbox usx-switch">
358
+ <input
359
+ class="usa-checkbox__input"
360
+ id="django-example-switch-21"
361
+ type="checkbox"
362
+ name="example-21"
363
+ value="example-value-21"
364
+ aria-label="Email notifications"
365
+ />
366
+
367
+ <label class="usa-checkbox__label" for="django-example-switch-21"> </label>
368
+ </div>
369
+ </div>
370
+
371
+ <h3 class="site-preview-heading">Custom Class</h3>
372
+ <div class="usa-form-group usx-form-group">
373
+ <div class="usa-checkbox usx-checkbox usx-switch custom-switch">
374
+ <input
375
+ class="usa-checkbox__input"
376
+ id="django-example-switch-22"
377
+ type="checkbox"
378
+ name="example-22"
379
+ value="example-value-22"
380
+ />
381
+
382
+ <label class="usa-checkbox__label" for="django-example-switch-22"> Example Switch 22 </label>
383
+ </div>
384
+ </div>
65
385
 
66
386
  <h3 class="site-preview-heading">Indeterminate</h3>
67
- <input type="checkbox" class="usx-switch usx-toggle-md" aria-checked="mixed" />
387
+ <div class="usa-form-group usx-form-group">
388
+ <div class="usa-checkbox usx-checkbox usx-switch">
389
+ <input
390
+ class="usa-checkbox__input"
391
+ id="django-example-switch-23"
392
+ type="checkbox"
393
+ name="example-23"
394
+ value="example-value-23"
395
+ />
396
+
397
+ <label class="usa-checkbox__label" for="django-example-switch-23"> Example Switch 23 </label>
398
+ </div>
399
+ </div>
400
+
401
+ <h3 class="site-preview-heading">Color Success</h3>
402
+ <div class="usa-form-group usx-form-group">
403
+ <div class="usa-checkbox usx-checkbox usx-switch">
404
+ <input
405
+ class="usa-checkbox__input"
406
+ id="django-example-switch-24"
407
+ type="checkbox"
408
+ name="example-24"
409
+ value="example-value-24"
410
+ checked
411
+ />
412
+
413
+ <label class="usa-checkbox__label before-success" for="django-example-switch-24">
414
+ Example Switch 24
415
+ </label>
416
+ </div>
417
+ </div>
418
+
419
+ <h3 class="site-preview-heading">Color Warning</h3>
420
+ <div class="usa-form-group usx-form-group">
421
+ <div class="usa-checkbox usx-checkbox usx-switch">
422
+ <input
423
+ class="usa-checkbox__input"
424
+ id="django-example-switch-25"
425
+ type="checkbox"
426
+ name="example-25"
427
+ value="example-value-25"
428
+ checked
429
+ />
430
+
431
+ <label class="usa-checkbox__label before-warning" for="django-example-switch-25">
432
+ Example Switch 25
433
+ </label>
434
+ </div>
435
+ </div>
436
+
437
+ <h3 class="site-preview-heading">Color Error</h3>
438
+ <div class="usa-form-group usx-form-group">
439
+ <div class="usa-checkbox usx-checkbox usx-switch">
440
+ <input
441
+ class="usa-checkbox__input"
442
+ id="django-example-switch-26"
443
+ type="checkbox"
444
+ name="example-26"
445
+ value="example-value-26"
446
+ checked
447
+ />
448
+
449
+ <label class="usa-checkbox__label before-error" for="django-example-switch-26">
450
+ Example Switch 26
451
+ </label>
452
+ </div>
453
+ </div>
454
+
455
+ <h3 class="site-preview-heading">Color Secondary Tile</h3>
456
+ <div class="usa-form-group usx-form-group">
457
+ <div class="usa-checkbox usx-checkbox usx-switch">
458
+ <input
459
+ class="usa-checkbox__input usa-checkbox__input--tile"
460
+ id="django-example-switch-27"
461
+ type="checkbox"
462
+ name="example-27"
463
+ value="example-value-27"
464
+ checked
465
+ />
466
+
467
+ <label class="usa-checkbox__label before-secondary" for="django-example-switch-27">
468
+ Example Switch 27
469
+ </label>
470
+ </div>
471
+ </div>
472
+
473
+ <h3 class="site-preview-heading">Color Accent Cool</h3>
474
+ <div class="usa-form-group usx-form-group">
475
+ <div class="usa-checkbox usx-checkbox usx-switch">
476
+ <input
477
+ class="usa-checkbox__input"
478
+ id="django-example-switch-28"
479
+ type="checkbox"
480
+ name="example-28"
481
+ value="example-value-28"
482
+ checked
483
+ />
484
+
485
+ <label class="usa-checkbox__label before-accent-cool" for="django-example-switch-28">
486
+ Example Switch 28
487
+ </label>
488
+ </div>
489
+ </div>
490
+
491
+ <h3 class="site-preview-heading">Color Disabled Checked</h3>
492
+ <div class="usa-form-group usx-form-group">
493
+ <div class="usa-checkbox usx-checkbox usx-switch">
494
+ <input
495
+ class="usa-checkbox__input"
496
+ id="django-example-switch-30"
497
+ type="checkbox"
498
+ name="example-30"
499
+ value="example-value-30"
500
+ checked
501
+ disabled
502
+ />
503
+
504
+ <label class="usa-checkbox__label before-error" for="django-example-switch-30">
505
+ Example Switch 30
506
+ </label>
507
+ </div>
508
+ </div>
509
+
510
+ <h3 class="site-preview-heading">Default Checked</h3>
511
+ <div class="usa-form-group usx-form-group">
512
+ <div class="usa-checkbox usx-checkbox usx-switch">
513
+ <input
514
+ class="usa-checkbox__input"
515
+ id="django-example-switch-31"
516
+ type="checkbox"
517
+ name="example-31"
518
+ value="example-value-31"
519
+ checked
520
+ />
68
521
 
69
- <h3 class="site-preview-heading">With Label</h3>
70
- <label class="usa-label usx-switch__label">
71
- <input type="checkbox" class="usx-switch usx-toggle-md" id="django-switch-with-label" />
72
- Switch Label
73
- </label>
522
+ <label class="usa-checkbox__label" for="django-example-switch-31"> Example Switch 31 </label>
523
+ </div>
524
+ </div>
@@ -1,26 +1,23 @@
1
- {# Django template for Switch #}
2
- {% if label %}
3
- <label class="usa-label usx-switch__label">
4
- <input
5
- type="checkbox"
6
- class="usx-switch usx-toggle-{{ size|default:"md" }}{% if variant %} text-{{ variant }}{% endif %}{% if className %} {{ className }}{% endif %}"
7
- {% if id %}id="{{ id }}"{% endif %}
8
- {% if name %}name="{{ name }}"{% endif %}
9
- {% if checked %}checked{% endif %}
10
- {% if defaultChecked %}checked{% endif %}
11
- {% if indeterminate %}aria-checked="mixed"{% elif ariaChecked is not none %}aria-checked="{{ ariaChecked }}"{% endif %}
12
- {% if disabled %}disabled{% endif %}
13
- />
14
- {{ label }}
15
- </label>
16
- {% else %}
17
- <input
18
- type="checkbox"
19
- class="usx-switch usx-toggle-{{ size|default:"md" }}{% if variant %} text-{{ variant }}{% endif %}{% if className %} {{ className }}{% endif %}"
20
- {% if id %}id="{{ id }}"{% endif %}
21
- {% if name %}name="{{ name }}"{% endif %}
22
- {% if checked %}checked{% endif %}
23
- {% if defaultChecked %}checked{% endif %}
24
- {% if indeterminate %}aria-checked="mixed"{% elif ariaChecked is not none %}aria-checked="{{ ariaChecked }}"{% endif %}
25
- {% if disabled %}disabled{% endif %}
26
- />{% endif %}
1
+ {% load usx_components %}
2
+ {% fragment as switchClass %}usx-switch{% if className %} {{ className }}{% endif %}{% endfragment %}
3
+ {% fragment as switchLabelClass %}{% if color %}before-{{ color }}{% endif %}{% endfragment %}
4
+ {% checkbox
5
+ id=id
6
+ name=name
7
+ value=value
8
+ label=label
9
+ ariaLabel=ariaLabel
10
+ checked=checked
11
+ defaultChecked=defaultChecked
12
+ disabled=disabled
13
+ description=description
14
+ tile=tile
15
+ small=small
16
+ error=error
17
+ success=success
18
+ formGroup=formGroup
19
+ onChange=onChange
20
+ required=required
21
+ className=switchClass
22
+ labelClassName=switchLabelClass
23
+ %}{% endcheckbox %}