@solexllc/usx-react 0.8.0 → 0.9.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 (58) hide show
  1. package/README.md +15 -0
  2. package/dist/index.cjs +3173 -3238
  3. package/dist/index.js +3174 -3239
  4. package/package.json +4 -4
  5. package/src/components/checkbox/Checkbox.tsx +9 -4
  6. package/src/components/checkbox/checkbox.django.html +2 -2
  7. package/src/components/checkbox/config.json +9 -0
  8. package/src/components/data-table/DataTable.tsx +177 -0
  9. package/src/components/data-table/README.md +42 -0
  10. package/src/components/data-table/TableBody.tsx +123 -0
  11. package/src/components/{table → data-table}/TableCell.tsx +6 -3
  12. package/src/components/data-table/TableContext.tsx +49 -0
  13. package/src/components/{table → data-table}/TableFoot.tsx +8 -7
  14. package/src/components/data-table/TableGroup.tsx +62 -0
  15. package/src/components/data-table/TableHead.tsx +126 -0
  16. package/src/components/data-table/TableRow.tsx +24 -0
  17. package/src/components/data-table/cells.ts +49 -0
  18. package/src/components/data-table/columns.ts +15 -0
  19. package/src/components/data-table/config.json +375 -0
  20. package/src/components/data-table/data-table.django-snapshot.html +13560 -0
  21. package/src/components/data-table/data-table.django.html +13 -0
  22. package/src/components/data-table/data-table.html +34 -0
  23. package/src/components/data-table/data-table.react-snapshot.html +12033 -0
  24. package/src/components/{table → data-table}/table-body.django.html +12 -12
  25. package/src/components/{table → data-table}/table-foot.django.html +6 -6
  26. package/src/components/data-table/table-group.django.html +24 -0
  27. package/src/components/data-table/table-head.django.html +21 -0
  28. package/src/components/data-table/table-row.django.html +57 -0
  29. package/src/components/{table → data-table}/types.ts +48 -5
  30. package/src/components/pagination/Pagination.tsx +7 -1
  31. package/src/components/pagination/config.json +8 -0
  32. package/src/components/pagination/navigation/PaginationNavigation.tsx +10 -0
  33. package/src/components/pagination/step-options/PaginationStepOptions.tsx +3 -0
  34. package/src/components/radio-buttons/RadioButtons.tsx +37 -27
  35. package/src/components/radio-buttons/config.json +19 -1
  36. package/src/components/radio-buttons/radio-buttons.django-snapshot.html +28 -60
  37. package/src/components/radio-buttons/radio-buttons.django.html +16 -28
  38. package/src/components/table/Table.tsx +64 -334
  39. package/src/components/table/config.json +21 -339
  40. package/src/components/table/table.django-snapshot.html +712 -1482
  41. package/src/components/table/table.django.html +14 -59
  42. package/src/components/table/table.html +7 -2364
  43. package/src/components/table/table.react-snapshot.html +711 -2085
  44. package/src/index.js +1 -0
  45. package/src/components/table/TableBody.tsx +0 -256
  46. package/src/components/table/TableContext.tsx +0 -87
  47. package/src/components/table/TableGroup.tsx +0 -69
  48. package/src/components/table/TableHead.tsx +0 -139
  49. package/src/components/table/TableRow.tsx +0 -56
  50. package/src/components/table/hooks/useRowDetails.ts +0 -34
  51. package/src/components/table/hooks/useTableGroups.ts +0 -61
  52. package/src/components/table/hooks/useTableSelect.ts +0 -82
  53. package/src/components/table/hooks/useTableSort.ts +0 -60
  54. package/src/components/table/table-group.django.html +0 -40
  55. package/src/components/table/table-head.django.html +0 -85
  56. package/src/components/table/table-row.django.html +0 -98
  57. package/src/components/table/table_helper.py +0 -298
  58. /package/src/components/{table → data-table}/table-detail-row.django.html +0 -0
@@ -48,7 +48,7 @@
48
48
  type="radio"
49
49
  name="historical-figures"
50
50
  value="george-washington-carver"
51
- disabled="disabled"
51
+ disabled
52
52
  />
53
53
 
54
54
  <label class="usa-radio__label" for="django-historical-figures-3">
@@ -84,7 +84,7 @@
84
84
  type="radio"
85
85
  name="historical-figures-with-default"
86
86
  value="frederick-douglass"
87
- checked="checked"
87
+ checked
88
88
  />
89
89
 
90
90
  <label class="usa-radio__label" for="django-historical-figures-with-default-1">
@@ -113,7 +113,7 @@
113
113
  type="radio"
114
114
  name="historical-figures-with-default"
115
115
  value="george-washington-carver"
116
- disabled="disabled"
116
+ disabled
117
117
  />
118
118
 
119
119
  <label class="usa-radio__label" for="django-historical-figures-with-default-3">
@@ -138,9 +138,7 @@
138
138
  />
139
139
 
140
140
  <label class="usa-radio__label" for="django-historical-figures-with-descriptions-0">
141
- Sojourner Truth
142
-
143
- <span class="usa-checkbox__label-description"
141
+ Sojourner Truth<span class="usa-checkbox__label-description"
144
142
  >A prominent abolitionist and women&#x27;s rights activist.</span
145
143
  >
146
144
  </label>
@@ -156,9 +154,7 @@
156
154
  />
157
155
 
158
156
  <label class="usa-radio__label" for="django-historical-figures-with-descriptions-1">
159
- Frederick Douglass
160
-
161
- <span class="usa-checkbox__label-description"
157
+ Frederick Douglass<span class="usa-checkbox__label-description"
162
158
  >A former enslaved person who became a national leader of the abolitionist movement.</span
163
159
  >
164
160
  </label>
@@ -174,9 +170,7 @@
174
170
  />
175
171
 
176
172
  <label class="usa-radio__label" for="django-historical-figures-with-descriptions-2">
177
- Booker T. Washington
178
-
179
- <span class="usa-checkbox__label-description"
173
+ Booker T. Washington<span class="usa-checkbox__label-description"
180
174
  >An influential African American educator, author, orator, and advisor to multiple
181
175
  presidents of the United States.</span
182
176
  >
@@ -190,13 +184,11 @@
190
184
  type="radio"
191
185
  name="historical-figures-with-descriptions"
192
186
  value="george-washington-carver"
193
- disabled="disabled"
187
+ disabled
194
188
  />
195
189
 
196
190
  <label class="usa-radio__label" for="django-historical-figures-with-descriptions-3">
197
- George Washington Carver
198
-
199
- <span class="usa-checkbox__label-description"
191
+ George Washington Carver<span class="usa-checkbox__label-description"
200
192
  >An American agricultural scientist and inventor who promoted alternative crops to cotton
201
193
  and methods to prevent soil depletion.</span
202
194
  >
@@ -253,7 +245,7 @@
253
245
  type="radio"
254
246
  name="tile-options"
255
247
  value="george-washington-carver"
256
- disabled="disabled"
248
+ disabled
257
249
  />
258
250
 
259
251
  <label class="usa-radio__label" for="django-tile-options-3"> George Washington Carver </label>
@@ -276,9 +268,7 @@
276
268
  />
277
269
 
278
270
  <label class="usa-radio__label" for="django-tile-options-with-descriptions-0">
279
- Sojourner Truth
280
-
281
- <span class="usa-checkbox__label-description"
271
+ Sojourner Truth<span class="usa-checkbox__label-description"
282
272
  >A prominent abolitionist and women&#x27;s rights activist.</span
283
273
  >
284
274
  </label>
@@ -294,9 +284,7 @@
294
284
  />
295
285
 
296
286
  <label class="usa-radio__label" for="django-tile-options-with-descriptions-1">
297
- Frederick Douglass
298
-
299
- <span class="usa-checkbox__label-description"
287
+ Frederick Douglass<span class="usa-checkbox__label-description"
300
288
  >A former enslaved person who became a national leader of the abolitionist movement.</span
301
289
  >
302
290
  </label>
@@ -312,9 +300,7 @@
312
300
  />
313
301
 
314
302
  <label class="usa-radio__label" for="django-tile-options-with-descriptions-2">
315
- Booker T. Washington
316
-
317
- <span class="usa-checkbox__label-description"
303
+ Booker T. Washington<span class="usa-checkbox__label-description"
318
304
  >An influential African American educator, author, orator, and advisor to multiple
319
305
  presidents of the United States.</span
320
306
  >
@@ -328,13 +314,11 @@
328
314
  type="radio"
329
315
  name="tile-options-with-descriptions"
330
316
  value="george-washington-carver"
331
- disabled="disabled"
317
+ disabled
332
318
  />
333
319
 
334
320
  <label class="usa-radio__label" for="django-tile-options-with-descriptions-3">
335
- George Washington Carver
336
-
337
- <span class="usa-checkbox__label-description"
321
+ George Washington Carver<span class="usa-checkbox__label-description"
338
322
  >An American agricultural scientist and inventor who promoted alternative crops to cotton
339
323
  and methods to prevent soil depletion.</span
340
324
  >
@@ -391,7 +375,7 @@
391
375
  type="radio"
392
376
  name="small-options"
393
377
  value="george-washington-carver"
394
- disabled="disabled"
378
+ disabled
395
379
  />
396
380
 
397
381
  <label class="usa-radio__label" for="django-small-options-3">
@@ -451,7 +435,7 @@
451
435
  type="radio"
452
436
  name="small-tile-options"
453
437
  value="george-washington-carver"
454
- disabled="disabled"
438
+ disabled
455
439
  />
456
440
 
457
441
  <label class="usa-radio__label" for="django-small-tile-options-3">
@@ -476,9 +460,7 @@
476
460
  />
477
461
 
478
462
  <label class="usa-radio__label" for="django-small-tile-options-with-descriptions-0">
479
- Sojourner Truth
480
-
481
- <span class="usa-checkbox__label-description"
463
+ Sojourner Truth<span class="usa-checkbox__label-description"
482
464
  >A prominent abolitionist and women&#x27;s rights activist.</span
483
465
  >
484
466
  </label>
@@ -494,9 +476,7 @@
494
476
  />
495
477
 
496
478
  <label class="usa-radio__label" for="django-small-tile-options-with-descriptions-1">
497
- Frederick Douglass
498
-
499
- <span class="usa-checkbox__label-description"
479
+ Frederick Douglass<span class="usa-checkbox__label-description"
500
480
  >A former enslaved person who became a national leader of the abolitionist movement.</span
501
481
  >
502
482
  </label>
@@ -512,9 +492,7 @@
512
492
  />
513
493
 
514
494
  <label class="usa-radio__label" for="django-small-tile-options-with-descriptions-2">
515
- Booker T. Washington
516
-
517
- <span class="usa-checkbox__label-description"
495
+ Booker T. Washington<span class="usa-checkbox__label-description"
518
496
  >An influential African American educator, author, orator, and advisor to multiple
519
497
  presidents of the United States.</span
520
498
  >
@@ -528,13 +506,11 @@
528
506
  type="radio"
529
507
  name="small-tile-options-with-descriptions"
530
508
  value="george-washington-carver"
531
- disabled="disabled"
509
+ disabled
532
510
  />
533
511
 
534
512
  <label class="usa-radio__label" for="django-small-tile-options-with-descriptions-3">
535
- George Washington Carver
536
-
537
- <span class="usa-checkbox__label-description"
513
+ George Washington Carver<span class="usa-checkbox__label-description"
538
514
  >An American agricultural scientist and inventor who promoted alternative crops to cotton
539
515
  and methods to prevent soil depletion.</span
540
516
  >
@@ -558,9 +534,7 @@
558
534
  />
559
535
 
560
536
  <label class="usa-radio__label" for="django-custom-class-options-0">
561
- Sojourner Truth
562
-
563
- <span class="usa-checkbox__label-description"
537
+ Sojourner Truth<span class="usa-checkbox__label-description"
564
538
  >A prominent abolitionist and women&#x27;s rights activist.</span
565
539
  >
566
540
  </label>
@@ -576,9 +550,7 @@
576
550
  />
577
551
 
578
552
  <label class="usa-radio__label" for="django-custom-class-options-1">
579
- Frederick Douglass
580
-
581
- <span class="usa-checkbox__label-description"
553
+ Frederick Douglass<span class="usa-checkbox__label-description"
582
554
  >A former enslaved person who became a national leader of the abolitionist movement.</span
583
555
  >
584
556
  </label>
@@ -594,9 +566,7 @@
594
566
  />
595
567
 
596
568
  <label class="usa-radio__label" for="django-custom-class-options-2">
597
- Booker T. Washington
598
-
599
- <span class="usa-checkbox__label-description"
569
+ Booker T. Washington<span class="usa-checkbox__label-description"
600
570
  >An influential African American educator, author, orator, and advisor to multiple
601
571
  presidents of the United States.</span
602
572
  >
@@ -610,13 +580,11 @@
610
580
  type="radio"
611
581
  name="custom-class-options"
612
582
  value="george-washington-carver"
613
- disabled="disabled"
583
+ disabled
614
584
  />
615
585
 
616
586
  <label class="usa-radio__label" for="django-custom-class-options-3">
617
- George Washington Carver
618
-
619
- <span class="usa-checkbox__label-description"
587
+ George Washington Carver<span class="usa-checkbox__label-description"
620
588
  >An American agricultural scientist and inventor who promoted alternative crops to cotton
621
589
  and methods to prevent soil depletion.</span
622
590
  >
@@ -681,7 +649,7 @@
681
649
  type="radio"
682
650
  name="historical-figures-hint"
683
651
  value="george-washington-carver"
684
- disabled="disabled"
652
+ disabled
685
653
  />
686
654
 
687
655
  <label class="usa-radio__label" for="django-historical-figures-hint-3">
@@ -749,7 +717,7 @@
749
717
  type="radio"
750
718
  name="historical-figures-error"
751
719
  value="george-washington-carver"
752
- disabled="disabled"
720
+ disabled
753
721
  />
754
722
 
755
723
  <label class="usa-radio__label" for="django-historical-figures-error-3">
@@ -1,36 +1,24 @@
1
1
  {# Django template for RadioButtons #}
2
2
  {% load usx_components %}
3
-
4
- {% with groupName=name|default:"radio-group" %}
5
- {% form_group error=error %}
6
- {% fieldset legend=legend|default:"Select one option" required=required hint=hint error=error id=id %}
3
+ {% with groupName=name|default:'radio-group' %}
4
+ {% fragment as radioOptions %}
7
5
  {% for opt in options %}
8
- {% with index=forloop.counter0|stringformat:"s" %}
6
+ {% with index=forloop.counter0|stringformat:'s' %}
9
7
  {% with baseId=id|default:groupName %}
10
- {% with generatedId=baseId|add:"-"|add:index %}
8
+ {% with generatedId=baseId|add:'-'|add:index %}
11
9
  {% with optionId=opt.id|default:generatedId %}
12
- <div class="usa-radio usx-radio {% if small %}usx-radio--small{% endif %} {{ className }}">
13
- <input
14
- class="usa-radio__input{% if tile %} usa-radio__input--tile{% endif %}"
15
- id="{{ optionId }}"
16
- type="radio"
17
- name="{{ groupName }}"
18
- value="{{ opt.value }}"
19
- {% if defaultValue == opt.value or opt.checked %}checked="checked"{% endif %}
20
- {% if opt.disabled %}disabled="disabled"{% endif %}
21
- />
22
- {% label htmlFor=optionId className="usa-radio__label" classOverride=True %}{{ opt.label }}
23
- {% if opt.description %}
24
- <span class="usa-checkbox__label-description">{{ opt.description }}</span>
25
- {% endif %}
26
- {% endlabel %}
10
+ <div class="usa-radio usx-radio{% if small %} usx-radio--small{% endif %}{% if className %} {{ className }}{% endif %}">
11
+ <input class="usa-radio__input{% if tile %} usa-radio__input--tile{% endif %}" id="{{ optionId }}" type="radio" name="{{ groupName }}" value="{{ opt.value }}"{% if opt.ariaLabel %} aria-label="{{ opt.ariaLabel }}"{% endif %}{% if defaultValue == opt.value or opt.checked %} checked{% endif %}{% if opt.disabled %} disabled{% endif %}>
12
+ {% label htmlFor=optionId className='usa-radio__label' classOverride=True %}{{ opt.label }}{% if opt.description %}<span class="usa-checkbox__label-description">{{ opt.description }}</span>{% endif %}{% endlabel %}
27
13
  </div>
28
- {% endwith %}
29
- {% endwith %}
30
- {% endwith %}
31
- {% endwith %}
14
+ {% endwith %}{% endwith %}{% endwith %}{% endwith %}
32
15
  {% endfor %}
33
- {% endfieldset %}
34
- {% endform_group %}
16
+ {% endfragment %}
17
+ {% if fieldset == False %}
18
+ {{ radioOptions }}
19
+ {% elif formGroup == False %}
20
+ {% fieldset legend=legend|default:'Select one option' required=required hint=hint error=error id=id %}{{ radioOptions }}{% endfieldset %}
21
+ {% else %}
22
+ {% form_group error=error %}{% fieldset legend=legend|default:'Select one option' required=required hint=hint error=error id=id %}{{ radioOptions }}{% endfieldset %}{% endform_group %}
23
+ {% endif %}
35
24
  {% endwith %}
36
-