@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
package/dist/index.cjs CHANGED
@@ -121,6 +121,7 @@
121
121
  className = "",
122
122
  headingClassName = "",
123
123
  contentClassName = "",
124
+ extraAttributes,
124
125
  ...props2
125
126
  }) {
126
127
  const accordionClasses = ClassNames(
@@ -137,6 +138,7 @@
137
138
  className: accordionClasses,
138
139
  "data-allow-multiple": multiselectable ? true : void 0,
139
140
  ...props2,
141
+ ...extraAttributes,
140
142
  children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
141
143
  AccordionItem,
142
144
  {
@@ -411,6 +413,7 @@
411
413
  " website. Share sensitive information only on official, secure websites."
412
414
  ] }),
413
415
  className = "",
416
+ extraAttributes,
414
417
  ...props2
415
418
  }) {
416
419
  const classes = ClassNames(
@@ -418,7 +421,7 @@
418
421
  "usx-banner",
419
422
  className
420
423
  );
421
- return /* @__PURE__ */ jsxRuntime.jsx("section", { id, className: classes, "aria-label": ariaLabel, ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { id: `${id}-accordion`, className: "usa-accordion", children: [
424
+ return /* @__PURE__ */ jsxRuntime.jsx("section", { id, className: classes, "aria-label": ariaLabel, ...props2, ...extraAttributes, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { id: `${id}-accordion`, className: "usa-accordion", children: [
422
425
  /* @__PURE__ */ jsxRuntime.jsx("header", { className: "usa-banner__header", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-banner__inner", children: [
423
426
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-col-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
424
427
  "img",
@@ -1050,6 +1053,8 @@
1050
1053
  screenReaderOnlyLabel = false,
1051
1054
  formGroup = true,
1052
1055
  className = "",
1056
+ value,
1057
+ defaultValue,
1053
1058
  ...props2
1054
1059
  }) {
1055
1060
  const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`;
@@ -1075,6 +1080,7 @@
1075
1080
  required,
1076
1081
  "aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
1077
1082
  "aria-invalid": hasError ? true : void 0,
1083
+ ...value !== void 0 ? { value } : { defaultValue },
1078
1084
  ...props2
1079
1085
  };
1080
1086
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -1092,6 +1098,7 @@
1092
1098
  disabled = false,
1093
1099
  required = false,
1094
1100
  defaultValue = "",
1101
+ value,
1095
1102
  hint = null,
1096
1103
  screenReaderOnlyLabel = false,
1097
1104
  error = null,
@@ -1124,7 +1131,7 @@
1124
1131
  className: classes,
1125
1132
  placeholder,
1126
1133
  disabled,
1127
- defaultValue: props2.value === void 0 ? defaultValue : void 0,
1134
+ ...value !== void 0 ? { value } : { defaultValue },
1128
1135
  ...required ? { required: true } : {},
1129
1136
  "aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
1130
1137
  "aria-invalid": hasError ? "true" : void 0,
@@ -1147,6 +1154,7 @@
1147
1154
  placeholder = "",
1148
1155
  textArea = false,
1149
1156
  className = "",
1157
+ extraAttributes,
1150
1158
  ...props2
1151
1159
  }) {
1152
1160
  const fieldId = id || `character-count-${Math.random().toString(36).substr(2, 9)}`;
@@ -1168,7 +1176,8 @@
1168
1176
  formGroup: true,
1169
1177
  className: "usa-character-count__field",
1170
1178
  "aria-describedby": [infoId, hintId, errorId].filter(Boolean).join(" "),
1171
- ...props2
1179
+ ...props2,
1180
+ ...extraAttributes
1172
1181
  };
1173
1182
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: outerClasses, children: [
1174
1183
  textArea ? /* @__PURE__ */ jsxRuntime.jsx(TextArea, { ...fieldProps }) : /* @__PURE__ */ jsxRuntime.jsx(Input, { ...fieldProps }),
@@ -1186,7 +1195,7 @@
1186
1195
  label = "",
1187
1196
  ariaLabel = "",
1188
1197
  checked,
1189
- indeterminate = false,
1198
+ defaultChecked,
1190
1199
  disabled = false,
1191
1200
  description = "",
1192
1201
  tile = false,
@@ -1194,15 +1203,12 @@
1194
1203
  error,
1195
1204
  success,
1196
1205
  className = "",
1206
+ labelClassName = "",
1197
1207
  onChange,
1198
1208
  required = false,
1199
1209
  formGroup = true,
1200
1210
  ...props2
1201
1211
  }) {
1202
- const inputRef = React.useRef(null);
1203
- React.useEffect(() => {
1204
- if (inputRef.current) inputRef.current.indeterminate = indeterminate;
1205
- }, [indeterminate]);
1206
1212
  const hasError = !!error;
1207
1213
  const hasSuccess = !!success;
1208
1214
  const divClasses = ClassNames(
@@ -1211,32 +1217,37 @@
1211
1217
  { "usx-checkbox--small": small },
1212
1218
  className
1213
1219
  );
1214
- const inputClasses = ClassNames(
1215
- "usa-checkbox__input",
1216
- { "usa-checkbox__input--tile": tile }
1217
- );
1220
+ const inputClasses = ClassNames("usa-checkbox__input", { "usa-checkbox__input--tile": tile });
1218
1221
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1219
1222
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: divClasses, ...props2, children: [
1220
1223
  /* @__PURE__ */ jsxRuntime.jsx(
1221
1224
  "input",
1222
1225
  {
1223
- ref: inputRef,
1224
1226
  className: inputClasses,
1225
1227
  id,
1226
1228
  type: "checkbox",
1227
1229
  name,
1228
1230
  value,
1229
1231
  "aria-label": ariaLabel || void 0,
1230
- ...checked !== void 0 && onChange ? { checked } : { defaultChecked: checked },
1232
+ ...checked !== void 0 && onChange ? { checked } : { defaultChecked: checked ?? defaultChecked },
1231
1233
  disabled,
1232
1234
  required,
1233
1235
  ...onChange ? { onChange } : {}
1234
1236
  }
1235
1237
  ),
1236
- /* @__PURE__ */ jsxRuntime.jsxs(Label, { className: "usa-checkbox__label", classOverride: true, htmlFor: id, required, children: [
1237
- label,
1238
- description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-checkbox__label-description", children: description })
1239
- ] })
1238
+ /* @__PURE__ */ jsxRuntime.jsxs(
1239
+ Label,
1240
+ {
1241
+ className: ClassNames("usa-checkbox__label", labelClassName),
1242
+ classOverride: true,
1243
+ htmlFor: id,
1244
+ required,
1245
+ children: [
1246
+ label,
1247
+ description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-checkbox__label-description", children: description })
1248
+ ]
1249
+ }
1250
+ )
1240
1251
  ] }),
1241
1252
  hasError ? /* @__PURE__ */ jsxRuntime.jsx(ErrorMessage, { children: error }) : hasSuccess ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "usa-success-message text-success", role: "status", children: success }) : null
1242
1253
  ] });
@@ -1453,12 +1464,14 @@
1453
1464
  hint = null,
1454
1465
  placeholder,
1455
1466
  defaultValue = null,
1467
+ value,
1456
1468
  error = null,
1457
1469
  options = [],
1458
1470
  onSearch,
1459
1471
  onSelect,
1460
1472
  formGroup = true,
1461
1473
  className = "",
1474
+ extraAttributes,
1462
1475
  ...props2
1463
1476
  }) {
1464
1477
  const labelId = `${id}-label`;
@@ -1480,6 +1493,7 @@
1480
1493
  /* @__PURE__ */ jsxRuntime.jsx(
1481
1494
  "div",
1482
1495
  {
1496
+ ...extraAttributes,
1483
1497
  className: ClassNames(
1484
1498
  "usa-combo-box",
1485
1499
  "usx-combo-box",
@@ -1487,7 +1501,7 @@
1487
1501
  className
1488
1502
  ),
1489
1503
  ...placeholder ? { "data-placeholder": placeholder } : {},
1490
- ...defaultValue ? { "data-default-value": defaultValue } : {},
1504
+ ...value ?? defaultValue ? { "data-default-value": value ?? defaultValue } : {},
1491
1505
  ...onSearch ? { onInput: handleInput } : {},
1492
1506
  children: /* @__PURE__ */ jsxRuntime.jsx(
1493
1507
  "select",
@@ -1895,7 +1909,7 @@
1895
1909
  name,
1896
1910
  value: opt.value,
1897
1911
  "aria-label": opt.ariaLabel,
1898
- ...value !== void 0 && onChange ? { checked: value === opt.value } : { defaultChecked: defaultValue === opt.value || !!opt.checked },
1912
+ ...value !== void 0 && onChange ? { checked: value === opt.value } : { defaultChecked: (value ?? defaultValue) !== void 0 ? (value ?? defaultValue) === opt.value : !!opt.checked },
1899
1913
  onChange,
1900
1914
  disabled: !!opt.disabled
1901
1915
  }
@@ -2331,6 +2345,7 @@
2331
2345
  name,
2332
2346
  options = [],
2333
2347
  defaultValue,
2348
+ value,
2334
2349
  placeholder = "Select an option",
2335
2350
  error,
2336
2351
  success,
@@ -2364,7 +2379,7 @@
2364
2379
  className: combinedSelectClasses,
2365
2380
  disabled,
2366
2381
  required: required || void 0,
2367
- defaultValue,
2382
+ ...value !== void 0 ? { value } : { defaultValue },
2368
2383
  "aria-describedby": describedByParts.length ? describedByParts.join(" ") : void 0,
2369
2384
  "aria-invalid": hasError ? true : void 0,
2370
2385
  ...props2
@@ -2561,6 +2576,7 @@
2561
2576
  placeholder = "No rows to display",
2562
2577
  className = "",
2563
2578
  children,
2579
+ extraAttributes,
2564
2580
  ...props2
2565
2581
  }) {
2566
2582
  const generatedId = React.useId();
@@ -2644,6 +2660,7 @@
2644
2660
  "data-initial-sort-direction": (initialSort == null ? void 0 : initialSort.direction) || void 0,
2645
2661
  "data-total-count": pageConfig.totalCount,
2646
2662
  "data-infinite": infinite || void 0,
2663
+ ...extraAttributes,
2647
2664
  children: [
2648
2665
  searchable && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-data-table__toolbar", children: /* @__PURE__ */ jsxRuntime.jsx(Input, { id: `${id}-search`, label: "Search", formGroup: false, placeholder: searchPlaceholder }) }),
2649
2666
  scrollable || height ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -2691,11 +2708,13 @@
2691
2708
  disabled = false,
2692
2709
  required = false,
2693
2710
  defaultValue = null,
2711
+ value,
2694
2712
  minDate = null,
2695
2713
  maxDate = null,
2696
2714
  rangeDate = null,
2697
2715
  formGroup = true,
2698
2716
  className = "",
2717
+ extraAttributes,
2699
2718
  ...props2
2700
2719
  }) {
2701
2720
  const labelId = `${id}-label`;
@@ -2709,8 +2728,9 @@
2709
2728
  /* @__PURE__ */ jsxRuntime.jsx(
2710
2729
  "div",
2711
2730
  {
2731
+ ...extraAttributes,
2712
2732
  className: ClassNames("usa-date-picker", "usx-date-picker", className),
2713
- ...defaultValue ? { "data-default-value": defaultValue } : {},
2733
+ ...value ?? defaultValue ? { "data-default-value": value ?? defaultValue } : {},
2714
2734
  ...minDate ? { "data-min-date": minDate } : {},
2715
2735
  ...maxDate ? { "data-max-date": maxDate } : {},
2716
2736
  ...rangeDate ? { "data-range-date": rangeDate } : {},
@@ -2751,9 +2771,12 @@
2751
2771
  required = false,
2752
2772
  defaultStartDate = null,
2753
2773
  defaultEndDate = null,
2774
+ startDate,
2775
+ endDate,
2754
2776
  minDate = null,
2755
2777
  maxDate = null,
2756
- className = ""
2778
+ className = "",
2779
+ extraAttributes
2757
2780
  }) {
2758
2781
  const startLabelId = `${startId}-label`;
2759
2782
  const startHintId = startHint ? `${startId}-hint` : void 0;
@@ -2766,6 +2789,7 @@
2766
2789
  return /* @__PURE__ */ jsxRuntime.jsxs(
2767
2790
  "div",
2768
2791
  {
2792
+ ...extraAttributes,
2769
2793
  className: ClassNames("usa-date-range-picker", "usx-date-range-picker", className),
2770
2794
  ...minDate ? { "data-min-date": minDate } : {},
2771
2795
  ...maxDate ? { "data-max-date": maxDate } : {},
@@ -2777,8 +2801,9 @@
2777
2801
  /* @__PURE__ */ jsxRuntime.jsx(
2778
2802
  "div",
2779
2803
  {
2804
+ "data-enhanced": (extraAttributes == null ? void 0 : extraAttributes["data-enhanced"]) === "true" ? "true" : void 0,
2780
2805
  className: "usa-date-picker usx-date-picker",
2781
- ...defaultStartDate ? { "data-default-value": defaultStartDate } : {},
2806
+ ...startDate ?? defaultStartDate ? { "data-default-value": startDate ?? defaultStartDate } : {},
2782
2807
  children: /* @__PURE__ */ jsxRuntime.jsx(
2783
2808
  "input",
2784
2809
  {
@@ -2801,8 +2826,9 @@
2801
2826
  /* @__PURE__ */ jsxRuntime.jsx(
2802
2827
  "div",
2803
2828
  {
2829
+ "data-enhanced": (extraAttributes == null ? void 0 : extraAttributes["data-enhanced"]) === "true" ? "true" : void 0,
2804
2830
  className: "usa-date-picker usx-date-picker",
2805
- ...defaultEndDate ? { "data-default-value": defaultEndDate } : {},
2831
+ ...endDate ?? defaultEndDate ? { "data-default-value": endDate ?? defaultEndDate } : {},
2806
2832
  children: /* @__PURE__ */ jsxRuntime.jsx(
2807
2833
  "input",
2808
2834
  {
@@ -2896,6 +2922,7 @@
2896
2922
  className,
2897
2923
  triggerClassName,
2898
2924
  panelClassName,
2925
+ extraAttributes,
2899
2926
  ...props2
2900
2927
  }) {
2901
2928
  const opener = { commandfor: id, command: "show-modal" };
@@ -2903,7 +2930,7 @@
2903
2930
  const dismissal = {
2904
2931
  closedby: actionRequired ? "none" : void 0
2905
2932
  };
2906
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props2, className: ClassNames("usx-drawer", className), children: [
2933
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ...props2, className: ClassNames("usx-drawer", className), ...extraAttributes, children: [
2907
2934
  /* @__PURE__ */ jsxRuntime.jsx(
2908
2935
  "button",
2909
2936
  {
@@ -3198,12 +3225,14 @@
3198
3225
  onFilesChange = null,
3199
3226
  defaultFiles = [],
3200
3227
  formGroup = true,
3228
+ extraAttributes,
3201
3229
  ...props2
3202
3230
  }) {
3203
3231
  const hintId = hint ? `${id}-hint` : void 0;
3204
3232
  const errorId = error ? `${id}-error` : void 0;
3205
3233
  const describedBy = [hintId, errorId].filter(Boolean).join(" ") || void 0;
3206
3234
  const isManagedMultiple = multiple && manageIndividualFiles;
3235
+ const usxManagedDisabled = (extraAttributes == null ? void 0 : extraAttributes["usx-data-enhanced"]) === "true";
3207
3236
  const nextFileId = React.useRef(0);
3208
3237
  const [managedFiles, setManagedFiles] = React.useState(
3209
3238
  () => defaultFiles.map((entry) => ({ key: nextFileId.current++, file: null, ...entry }))
@@ -3248,7 +3277,8 @@
3248
3277
  disabled,
3249
3278
  required,
3250
3279
  ...invalidFileTypeMessage ? { "data-errormessage": invalidFileTypeMessage } : {},
3251
- ...props2
3280
+ ...props2,
3281
+ ...extraAttributes
3252
3282
  }
3253
3283
  )
3254
3284
  ] });
@@ -3258,7 +3288,7 @@
3258
3288
  commonLabel,
3259
3289
  commonHint,
3260
3290
  commonError,
3261
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-file-input__add-only", "data-usx-file-list-hint": typeof fileListHint === "string" && fileListHint ? fileListHint : "Selected files", children: /* @__PURE__ */ jsxRuntime.jsx(
3291
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usx-file-input__add-only", ...usxManagedDisabled ? { "usx-data-enhanced": "true" } : {}, "data-usx-file-list-hint": typeof fileListHint === "string" && fileListHint ? fileListHint : "Selected files", children: /* @__PURE__ */ jsxRuntime.jsx(
3262
3292
  "input",
3263
3293
  {
3264
3294
  ref: (node) => {
@@ -3275,7 +3305,8 @@
3275
3305
  required: required && managedFiles.length === 0,
3276
3306
  ...invalidFileTypeMessage ? { "data-errormessage": invalidFileTypeMessage } : {},
3277
3307
  ...props2,
3278
- onChange: addFiles
3308
+ ...extraAttributes,
3309
+ onChange: usxManagedDisabled ? void 0 : addFiles
3279
3310
  }
3280
3311
  ) }),
3281
3312
  /* @__PURE__ */ jsxRuntime.jsx(FileList, { files: managedFiles, hint: fileListHint, onRemove: removeFile, disabled })
@@ -3500,6 +3531,8 @@
3500
3531
  placeholder,
3501
3532
  action,
3502
3533
  defaultValue,
3534
+ value,
3535
+ onChange,
3503
3536
  onSubmit,
3504
3537
  className = ""
3505
3538
  }) {
@@ -3539,7 +3572,8 @@
3539
3572
  label,
3540
3573
  screenReaderOnlyLabel: true,
3541
3574
  placeholder: placeholder ?? "",
3542
- defaultValue,
3575
+ ...value !== void 0 ? { value } : { defaultValue },
3576
+ onChange,
3543
3577
  type: "search",
3544
3578
  name: searchKey,
3545
3579
  formGroup: false
@@ -3656,6 +3690,7 @@
3656
3690
  className = "",
3657
3691
  utilityContent = null,
3658
3692
  navEndContent = null,
3693
+ extraAttributes,
3659
3694
  ...props2
3660
3695
  }) {
3661
3696
  const headerClasses = ClassNames(
@@ -3671,14 +3706,15 @@
3671
3706
  "usx-nav",
3672
3707
  { "usx-nav--sticky": stickyNav }
3673
3708
  );
3709
+ const hasNavigation = navSections.length > 0 || Boolean(searchProps || utilityContent || extended && (secondaryLinks.length > 0 || navEndContent));
3674
3710
  const navbar = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-navbar", children: [
3675
3711
  /* @__PURE__ */ jsxRuntime.jsx(Branding, { branding, projectUrl, staticBaseUrl }),
3676
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "usa-menu-btn align-center", children: useMenuIcon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "menu", size: 3 }) : "Menu" })
3712
+ hasNavigation && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "usa-menu-btn align-center", children: useMenuIcon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "menu", size: 3 }) : "Menu" })
3677
3713
  ] });
3678
3714
  if (extended) {
3679
3715
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3680
- /* @__PURE__ */ jsxRuntime.jsx("header", { id, className: headerClasses, ...props2, children: navbar }),
3681
- /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Primary navigation", className: navClasses, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-nav__inner", children: [
3716
+ /* @__PURE__ */ jsxRuntime.jsx("header", { id, className: headerClasses, ...props2, ...extraAttributes, children: navbar }),
3717
+ hasNavigation && /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Primary navigation", className: navClasses, ...(extraAttributes == null ? void 0 : extraAttributes["data-enhanced"]) === "true" ? { "data-enhanced": "true" } : {}, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-nav__inner", children: [
3682
3718
  /* @__PURE__ */ jsxRuntime.jsx(
3683
3719
  PrimaryNav,
3684
3720
  {
@@ -3709,9 +3745,9 @@
3709
3745
  ] }) })
3710
3746
  ] });
3711
3747
  }
3712
- return /* @__PURE__ */ jsxRuntime.jsx("header", { id, className: headerClasses, ...props2, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-nav-container", children: [
3748
+ return /* @__PURE__ */ jsxRuntime.jsx("header", { id, className: headerClasses, ...props2, ...extraAttributes, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-nav-container", children: [
3713
3749
  navbar,
3714
- /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Primary navigation", className: navClasses, children: /* @__PURE__ */ jsxRuntime.jsx(
3750
+ hasNavigation && /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": "Primary navigation", className: navClasses, children: /* @__PURE__ */ jsxRuntime.jsx(
3715
3751
  PrimaryNav,
3716
3752
  {
3717
3753
  navSections,
@@ -3944,6 +3980,7 @@
3944
3980
  children = null,
3945
3981
  className = "",
3946
3982
  contentClassName = "",
3983
+ extraAttributes,
3947
3984
  ...props2
3948
3985
  }) {
3949
3986
  const contentId = `${id}-content`;
@@ -3962,7 +3999,8 @@
3962
3999
  "data-root-margin": rootMargin,
3963
4000
  "data-threshold": threshold,
3964
4001
  "data-minimum-heading-count": minimumHeadingCount,
3965
- ...props2
4002
+ ...props2,
4003
+ ...extraAttributes
3966
4004
  }
3967
4005
  ),
3968
4006
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -4000,14 +4038,14 @@
4000
4038
  description ? ` (${description})` : null
4001
4039
  ] });
4002
4040
  }
4003
- function TwoLanguageSelector({ target, onSelect, className, navAriaLabel }) {
4041
+ function TwoLanguageSelector({ target, onSelect, className, navAriaLabel, extraAttributes }) {
4004
4042
  const handleClick = (event) => {
4005
4043
  if (onSelect) onSelect(target, event);
4006
4044
  if (!target.href) event.preventDefault();
4007
4045
  };
4008
4046
  const Tag2 = target.href ? "a" : "button";
4009
4047
  const tagProps = target.href ? { href: target.href } : { type: "button" };
4010
- return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": navAriaLabel, className, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-language-container", children: /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: "usa-button usx-button usa-button--primary", onClick: handleClick, ...tagProps, children: /* @__PURE__ */ jsxRuntime.jsx(LanguageLabel, { code: target.code, label: target.label }) }) }) });
4048
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": navAriaLabel, className, ...extraAttributes, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "usa-language-container", children: /* @__PURE__ */ jsxRuntime.jsx(Tag2, { className: "usa-button usx-button usa-button--primary", onClick: handleClick, ...tagProps, children: /* @__PURE__ */ jsxRuntime.jsx(LanguageLabel, { code: target.code, label: target.label }) }) }) });
4011
4049
  }
4012
4050
  function MenuLanguageSelector({
4013
4051
  languages,
@@ -4017,7 +4055,8 @@
4017
4055
  id,
4018
4056
  onSelect,
4019
4057
  className,
4020
- navAriaLabel
4058
+ navAriaLabel,
4059
+ extraAttributes
4021
4060
  }) {
4022
4061
  const containerClasses = ClassNames(
4023
4062
  "usa-language-container",
@@ -4029,7 +4068,7 @@
4029
4068
  unstyled ? "usa-button--unstyled" : "usa-button--primary",
4030
4069
  "usa-language__link"
4031
4070
  );
4032
- return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": navAriaLabel, className, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: containerClasses, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "usa-language__primary usa-accordion", children: /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "usa-language__primary-item", children: [
4071
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": navAriaLabel, className, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: containerClasses, ...extraAttributes, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "usa-language__primary usa-accordion", children: /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "usa-language__primary-item", children: [
4033
4072
  /* @__PURE__ */ jsxRuntime.jsx(
4034
4073
  "button",
4035
4074
  {
@@ -4064,12 +4103,13 @@
4064
4103
  navAriaLabel = "Language selection",
4065
4104
  className = "",
4066
4105
  onSelect = null,
4106
+ extraAttributes,
4067
4107
  ...props2
4068
4108
  }) {
4069
4109
  const resolvedVariant = variant || (languages.length > 2 ? "menu" : "two");
4070
4110
  const classes = ClassNames("usx-language-selector", className);
4071
4111
  if (!languages || languages.length === 0) {
4072
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, children: "LanguageSelector" });
4112
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...extraAttributes, children: "LanguageSelector" });
4073
4113
  }
4074
4114
  if (resolvedVariant === "two") {
4075
4115
  const target = languages.find((lang) => !lang.current) || languages[1] || languages[0];
@@ -4080,6 +4120,7 @@
4080
4120
  onSelect,
4081
4121
  className: classes,
4082
4122
  navAriaLabel,
4123
+ extraAttributes,
4083
4124
  ...props2
4084
4125
  }
4085
4126
  );
@@ -4095,6 +4136,7 @@
4095
4136
  onSelect,
4096
4137
  className: classes,
4097
4138
  navAriaLabel,
4139
+ extraAttributes,
4098
4140
  ...props2
4099
4141
  }
4100
4142
  );
@@ -4160,6 +4202,7 @@
4160
4202
  expandable = false,
4161
4203
  onToggleExpanded,
4162
4204
  className = "",
4205
+ extraAttributes,
4163
4206
  ...props2
4164
4207
  }) {
4165
4208
  const [expanded, setExpanded] = React.useState(false);
@@ -4190,7 +4233,7 @@
4190
4233
  ]
4191
4234
  }
4192
4235
  ) : null;
4193
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, children: variant === "single-column" ? /* @__PURE__ */ jsxRuntime.jsx(SingleColumnLayout, { expandButton, children: children || content }) : variant === "grid" ? /* @__PURE__ */ jsxRuntime.jsx(
4236
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, ...props2, ...extraAttributes, children: variant === "single-column" ? /* @__PURE__ */ jsxRuntime.jsx(SingleColumnLayout, { expandButton, children: children || content }) : variant === "grid" ? /* @__PURE__ */ jsxRuntime.jsx(
4194
4237
  GridLayout,
4195
4238
  {
4196
4239
  leftSidebar,
@@ -4269,6 +4312,12 @@
4269
4312
  defaultMonth,
4270
4313
  defaultDay,
4271
4314
  defaultYear,
4315
+ month,
4316
+ day,
4317
+ year,
4318
+ onMonthChange,
4319
+ onDayChange,
4320
+ onYearChange,
4272
4321
  disabled = false,
4273
4322
  ariaDisabled = false,
4274
4323
  required = false,
@@ -4298,7 +4347,8 @@
4298
4347
  label: monthLabel,
4299
4348
  options: MONTH_OPTIONS,
4300
4349
  placeholder: "- Select -",
4301
- defaultValue: defaultMonth,
4350
+ ...month !== void 0 ? { value: month } : { defaultValue: defaultMonth },
4351
+ onChange: onMonthChange,
4302
4352
  required,
4303
4353
  "aria-describedby": describedBy(monthHintId),
4304
4354
  "aria-invalid": hasError || void 0,
@@ -4317,7 +4367,8 @@
4317
4367
  name: dayName || dayId,
4318
4368
  label: dayLabel,
4319
4369
  placeholder: "",
4320
- defaultValue: defaultDay,
4370
+ ...day !== void 0 ? { value: day } : { defaultValue: defaultDay },
4371
+ onChange: onDayChange,
4321
4372
  maxLength: 2,
4322
4373
  pattern: "[0-9]*",
4323
4374
  inputMode: "numeric",
@@ -4338,7 +4389,8 @@
4338
4389
  name: yearName || yearId,
4339
4390
  label: yearLabel,
4340
4391
  placeholder: "",
4341
- defaultValue: defaultYear,
4392
+ ...year !== void 0 ? { value: year } : { defaultValue: defaultYear },
4393
+ onChange: onYearChange,
4342
4394
  minLength: 4,
4343
4395
  maxLength: 4,
4344
4396
  pattern: "[0-9]*",
@@ -4442,6 +4494,7 @@
4442
4494
  forceAction = false,
4443
4495
  className = "",
4444
4496
  children,
4497
+ extraAttributes,
4445
4498
  ...props2
4446
4499
  }) {
4447
4500
  const classes = ClassNames("usa-modal", "usx-modal", {
@@ -4457,6 +4510,7 @@
4457
4510
  "aria-describedby": `${id}-description`,
4458
4511
  ...forceAction ? { "data-force-action": true } : {},
4459
4512
  ...props2,
4513
+ ...extraAttributes,
4460
4514
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-modal__content", children: [
4461
4515
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usa-modal__main", children: [
4462
4516
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "usa-modal__heading", id: `${id}-heading`, children: heading }),
@@ -4525,6 +4579,7 @@
4525
4579
  summaryProps,
4526
4580
  panelClassName,
4527
4581
  contentClassName,
4582
+ extraAttributes,
4528
4583
  children,
4529
4584
  ...props2
4530
4585
  }) {
@@ -4539,6 +4594,7 @@
4539
4594
  open: initiallyOpen || void 0,
4540
4595
  "data-side": side,
4541
4596
  "data-align": align,
4597
+ ...extraAttributes,
4542
4598
  children: [
4543
4599
  /* @__PURE__ */ jsxRuntime.jsx(Summary, { unstyled: true, ...composedSummaryProps }),
4544
4600
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4639,6 +4695,7 @@
4639
4695
  textPreposition = "of",
4640
4696
  formGroup = true,
4641
4697
  className = "",
4698
+ extraAttributes,
4642
4699
  ...props2
4643
4700
  }) {
4644
4701
  const hintId = hint ? `${id}-hint` : void 0;
@@ -4658,14 +4715,14 @@
4658
4715
  min,
4659
4716
  max,
4660
4717
  step,
4661
- value: typeof value !== "undefined" ? value : void 0,
4662
- defaultValue,
4718
+ ...value !== void 0 ? { value } : { defaultValue },
4663
4719
  disabled,
4664
4720
  required,
4665
4721
  "aria-describedby": describedBy,
4666
4722
  ...textUnit ? { "data-text-unit": textUnit } : {},
4667
4723
  ...textPreposition ? { "data-text-preposition": textPreposition } : {},
4668
- ...props2
4724
+ ...props2,
4725
+ ...extraAttributes
4669
4726
  }
4670
4727
  )
4671
4728
  ] });
@@ -4915,53 +4972,16 @@
4915
4972
  ] });
4916
4973
  return /* @__PURE__ */ jsxRuntime.jsx("label", { className: classes, ...props2, children: content });
4917
4974
  };
4918
- const Switch = ({
4919
- id,
4920
- name,
4921
- checked,
4922
- defaultChecked,
4923
- disabled = false,
4924
- onChange,
4925
- size = "md",
4926
- variant = "",
4927
- className = "",
4928
- label,
4929
- indeterminate = false,
4930
- ...props2
4931
- }) => {
4932
- const classes = ClassNames(
4933
- "usx-switch",
4934
- size && `usx-toggle-${size}`,
4935
- variant && `text-${variant}`,
4936
- className
4937
- );
4938
- const ref = React.useRef(null);
4939
- React.useEffect(() => {
4940
- if (ref.current) {
4941
- ref.current.indeterminate = Boolean(indeterminate);
4975
+ function Switch({ className, labelClassName, color, ...props2 }) {
4976
+ return /* @__PURE__ */ jsxRuntime.jsx(
4977
+ Checkbox,
4978
+ {
4979
+ ...props2,
4980
+ className: ClassNames("usx-switch", className),
4981
+ labelClassName: ClassNames(labelClassName, color && `before-${color}`)
4942
4982
  }
4943
- }, [indeterminate]);
4944
- const inputProps = {
4945
- id,
4946
- name,
4947
- type: "checkbox",
4948
- className: classes,
4949
- checked: typeof checked === "boolean" ? checked : void 0,
4950
- defaultChecked,
4951
- disabled,
4952
- "aria-checked": indeterminate ? "mixed" : typeof checked === "boolean" ? checked : void 0,
4953
- onChange,
4954
- ...props2
4955
- };
4956
- const input = /* @__PURE__ */ jsxRuntime.jsx("input", { ref, ...inputProps });
4957
- if (label) {
4958
- return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "usa-label usx-switch__label", children: [
4959
- input,
4960
- label
4961
- ] });
4962
- }
4963
- return input;
4964
- };
4983
+ );
4984
+ }
4965
4985
  function Table({
4966
4986
  columns = [],
4967
4987
  data = [],
@@ -4975,6 +4995,7 @@
4975
4995
  responsive = false,
4976
4996
  className,
4977
4997
  children,
4998
+ extraAttributes,
4978
4999
  ...props2
4979
5000
  }) {
4980
5001
  const hasSorting = !children && columns.some((column) => column.sortable);
@@ -4983,6 +5004,7 @@
4983
5004
  "table",
4984
5005
  {
4985
5006
  ...props2,
5007
+ ...extraAttributes,
4986
5008
  className: ClassNames(
4987
5009
  "usa-table",
4988
5010
  "usx-table",
@@ -5057,12 +5079,13 @@
5057
5079
  value,
5058
5080
  defaultValue,
5059
5081
  onChange,
5060
- className = ""
5082
+ className = "",
5083
+ extraAttributes
5061
5084
  }) {
5062
5085
  var _a;
5063
5086
  const selectId = id || "theme-picker";
5064
5087
  const selection = value !== void 0 ? { value } : { defaultValue: defaultValue ?? ((_a = themes[0]) == null ? void 0 : _a.value) };
5065
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usx-theme-picker", className), children: [
5088
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ClassNames("usx-theme-picker", className), ...extraAttributes, children: [
5066
5089
  /* @__PURE__ */ jsxRuntime.jsx(
5067
5090
  "button",
5068
5091
  {
@@ -5127,11 +5150,13 @@
5127
5150
  ariaDisabled = false,
5128
5151
  required = false,
5129
5152
  defaultValue = null,
5153
+ value,
5130
5154
  minTime = null,
5131
5155
  maxTime = null,
5132
5156
  step = null,
5133
5157
  formGroup = true,
5134
5158
  className = "",
5159
+ extraAttributes,
5135
5160
  ...props2
5136
5161
  }) {
5137
5162
  const labelId = `${id}-label`;
@@ -5156,6 +5181,7 @@
5156
5181
  /* @__PURE__ */ jsxRuntime.jsx(
5157
5182
  "div",
5158
5183
  {
5184
+ ...extraAttributes,
5159
5185
  className: containerClasses,
5160
5186
  ...minTime ? { "data-min-time": minTime } : {},
5161
5187
  ...maxTime ? { "data-max-time": maxTime } : {},
@@ -5168,7 +5194,7 @@
5168
5194
  name: name || id,
5169
5195
  type: "text",
5170
5196
  "aria-describedby": describedBy,
5171
- defaultValue: defaultValue || void 0,
5197
+ ...value !== void 0 ? { value } : { defaultValue: defaultValue || void 0 },
5172
5198
  disabled,
5173
5199
  "aria-disabled": !disabled && ariaDisabled ? "true" : void 0,
5174
5200
  required,