@homebound/beam 2.226.0 → 2.227.1

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 (232) hide show
  1. package/dist/Css.d.ts +9 -9
  2. package/dist/components/Accordion.d.ts +1 -1
  3. package/dist/components/Accordion.js +4 -4
  4. package/dist/components/AccordionList.js +1 -1
  5. package/dist/components/AutoSaveIndicator.js +5 -5
  6. package/dist/components/Avatar.d.ts +1 -1
  7. package/dist/components/Avatar.js +2 -2
  8. package/dist/components/AvatarButton.js +1 -1
  9. package/dist/components/BeamContext.js +1 -1
  10. package/dist/components/Button.d.ts +2 -2
  11. package/dist/components/Button.js +1 -1
  12. package/dist/components/ButtonDatePicker.js +2 -2
  13. package/dist/components/ButtonGroup.d.ts +2 -2
  14. package/dist/components/ButtonGroup.js +6 -6
  15. package/dist/components/ButtonMenu.d.ts +5 -5
  16. package/dist/components/ButtonMenu.js +1 -1
  17. package/dist/components/ButtonModal.js +1 -1
  18. package/dist/components/Chip.d.ts +1 -1
  19. package/dist/components/Chip.js +2 -2
  20. package/dist/components/Chips.d.ts +1 -1
  21. package/dist/components/Chips.js +3 -3
  22. package/dist/components/Copy.js +2 -2
  23. package/dist/components/CssReset.js +1 -1
  24. package/dist/components/Filters/BooleanFilter.d.ts +1 -1
  25. package/dist/components/Filters/BooleanFilter.js +2 -2
  26. package/dist/components/Filters/DateFilter.d.ts +2 -2
  27. package/dist/components/Filters/DateFilter.js +2 -2
  28. package/dist/components/Filters/DateRangeFilter.d.ts +2 -2
  29. package/dist/components/Filters/DateRangeFilter.js +2 -2
  30. package/dist/components/Filters/FilterModal.js +4 -4
  31. package/dist/components/Filters/Filters.d.ts +4 -2
  32. package/dist/components/Filters/Filters.js +12 -13
  33. package/dist/components/Filters/MultiFilter.d.ts +1 -1
  34. package/dist/components/Filters/MultiFilter.js +4 -4
  35. package/dist/components/Filters/NumberRangeFilter.d.ts +2 -2
  36. package/dist/components/Filters/NumberRangeFilter.js +5 -5
  37. package/dist/components/Filters/SingleFilter.d.ts +1 -1
  38. package/dist/components/Filters/SingleFilter.js +1 -1
  39. package/dist/components/Filters/ToggleFilter.d.ts +1 -1
  40. package/dist/components/Filters/ToggleFilter.js +2 -2
  41. package/dist/components/Filters/index.js +5 -1
  42. package/dist/components/Filters/testDomain.d.ts +9 -9
  43. package/dist/components/Filters/types.d.ts +2 -2
  44. package/dist/components/HbLoadingSpinner.js +9 -5
  45. package/dist/components/HelperText.js +1 -1
  46. package/dist/components/Icon.d.ts +1 -1
  47. package/dist/components/Icon.js +97 -97
  48. package/dist/components/IconButton.js +1 -1
  49. package/dist/components/Label.js +3 -3
  50. package/dist/components/Layout/PreventBrowserScroll.js +1 -1
  51. package/dist/components/Layout/RightPaneLayout/RightPaneContext.d.ts +1 -1
  52. package/dist/components/Layout/RightPaneLayout/RightPaneContext.js +6 -2
  53. package/dist/components/Layout/RightPaneLayout/RightPaneLayout.js +3 -3
  54. package/dist/components/Layout/RightPaneLayout/index.js +5 -1
  55. package/dist/components/Layout/ScrollableContent.js +3 -3
  56. package/dist/components/Layout/ScrollableParent.js +2 -2
  57. package/dist/components/Layout/index.js +5 -1
  58. package/dist/components/Loader.js +1 -1
  59. package/dist/components/LoadingSkeleton.d.ts +2 -2
  60. package/dist/components/LoadingSkeleton.js +1 -1
  61. package/dist/components/Modal/Modal.d.ts +3 -3
  62. package/dist/components/Modal/Modal.js +5 -5
  63. package/dist/components/Modal/OpenModal.js +2 -2
  64. package/dist/components/Modal/TestModalContent.js +3 -3
  65. package/dist/components/Modal/index.js +5 -1
  66. package/dist/components/NavLink.d.ts +1 -1
  67. package/dist/components/NavLink.js +2 -2
  68. package/dist/components/PresentationContext.d.ts +2 -2
  69. package/dist/components/PresentationContext.js +1 -1
  70. package/dist/components/Snackbar/Snackbar.d.ts +1 -1
  71. package/dist/components/Snackbar/Snackbar.js +1 -1
  72. package/dist/components/Snackbar/SnackbarContext.d.ts +1 -1
  73. package/dist/components/Snackbar/SnackbarContext.js +1 -1
  74. package/dist/components/Snackbar/SnackbarNotice.d.ts +1 -1
  75. package/dist/components/Snackbar/SnackbarNotice.js +1 -1
  76. package/dist/components/Stepper.js +11 -11
  77. package/dist/components/SuperDrawer/ConfirmCloseModal.js +2 -2
  78. package/dist/components/SuperDrawer/SuperDrawer.js +3 -3
  79. package/dist/components/SuperDrawer/SuperDrawerContent.js +3 -3
  80. package/dist/components/SuperDrawer/components/SuperDrawerHeader.js +2 -2
  81. package/dist/components/SuperDrawer/index.js +5 -1
  82. package/dist/components/SuperDrawer/useSuperDrawer.d.ts +1 -1
  83. package/dist/components/SuperDrawer/useSuperDrawer.js +2 -2
  84. package/dist/components/Table/GridTable.d.ts +1 -1
  85. package/dist/components/Table/GridTable.js +33 -29
  86. package/dist/components/Table/GridTableApi.d.ts +1 -1
  87. package/dist/components/Table/TableActions.d.ts +1 -1
  88. package/dist/components/Table/TableActions.js +1 -1
  89. package/dist/components/Table/TableStyles.d.ts +1 -1
  90. package/dist/components/Table/components/CollapseToggle.js +1 -1
  91. package/dist/components/Table/components/EditColumnsButton.js +2 -2
  92. package/dist/components/Table/components/ExpandableHeader.js +2 -2
  93. package/dist/components/Table/components/Row.d.ts +2 -2
  94. package/dist/components/Table/components/Row.js +7 -3
  95. package/dist/components/Table/components/SelectToggle.js +1 -1
  96. package/dist/components/Table/components/SortHeader.js +3 -3
  97. package/dist/components/Table/components/cell.d.ts +2 -2
  98. package/dist/components/Table/components/cell.js +6 -6
  99. package/dist/components/Table/index.js +5 -1
  100. package/dist/components/Table/types.d.ts +13 -13
  101. package/dist/components/Table/utils/TableState.d.ts +4 -4
  102. package/dist/components/Table/utils/columns.js +2 -2
  103. package/dist/components/Table/utils/simpleHelpers.d.ts +1 -1
  104. package/dist/components/Table/utils/utils.js +5 -5
  105. package/dist/components/Tabs.d.ts +1 -1
  106. package/dist/components/Tabs.js +7 -7
  107. package/dist/components/Tag.d.ts +2 -2
  108. package/dist/components/Tag.js +1 -1
  109. package/dist/components/Toast/Toast.d.ts +1 -1
  110. package/dist/components/Toast/Toast.js +1 -1
  111. package/dist/components/Toast/ToastContext.d.ts +1 -1
  112. package/dist/components/Toast/ToastContext.js +1 -1
  113. package/dist/components/ToggleChip.d.ts +1 -1
  114. package/dist/components/ToggleChip.js +2 -2
  115. package/dist/components/ToggleChips.d.ts +1 -1
  116. package/dist/components/ToggleChips.js +1 -1
  117. package/dist/components/Tooltip.d.ts +1 -1
  118. package/dist/components/Tooltip.js +9 -5
  119. package/dist/components/index.js +5 -1
  120. package/dist/components/internal/CompoundField.js +6 -6
  121. package/dist/components/internal/ContextualModal.js +1 -1
  122. package/dist/components/internal/DatePicker/DatePicker.js +2 -2
  123. package/dist/components/internal/DatePicker/DatePickerOverlay.js +1 -1
  124. package/dist/components/internal/DatePicker/DateRangePicker.js +2 -2
  125. package/dist/components/internal/DatePicker/Day.js +6 -6
  126. package/dist/components/internal/DatePicker/Header.js +2 -2
  127. package/dist/components/internal/DatePicker/WeekHeader.js +1 -1
  128. package/dist/components/internal/DatePicker/index.js +5 -1
  129. package/dist/components/internal/Menu.js +3 -3
  130. package/dist/components/internal/MenuItem.js +6 -6
  131. package/dist/components/internal/MenuSection.js +1 -1
  132. package/dist/components/internal/OverlayTrigger.js +1 -1
  133. package/dist/components/internal/Popover.js +1 -1
  134. package/dist/components/internal/index.js +5 -1
  135. package/dist/components/testData.d.ts +1 -1
  136. package/dist/components/testData.js +5 -5
  137. package/dist/forms/BoundCheckboxField.d.ts +1 -1
  138. package/dist/forms/BoundCheckboxField.js +3 -3
  139. package/dist/forms/BoundCheckboxGroupField.d.ts +1 -1
  140. package/dist/forms/BoundCheckboxGroupField.js +2 -2
  141. package/dist/forms/BoundChipSelectField.js +3 -3
  142. package/dist/forms/BoundDateField.d.ts +1 -1
  143. package/dist/forms/BoundDateField.js +2 -2
  144. package/dist/forms/BoundDateRangeField.d.ts +1 -1
  145. package/dist/forms/BoundDateRangeField.js +2 -2
  146. package/dist/forms/BoundMultiSelectField.d.ts +1 -1
  147. package/dist/forms/BoundMultiSelectField.js +3 -3
  148. package/dist/forms/BoundNumberField.d.ts +1 -1
  149. package/dist/forms/BoundNumberField.js +2 -2
  150. package/dist/forms/BoundRadioGroupField.d.ts +1 -1
  151. package/dist/forms/BoundRadioGroupField.js +2 -2
  152. package/dist/forms/BoundRichTextField.d.ts +1 -1
  153. package/dist/forms/BoundRichTextField.js +2 -2
  154. package/dist/forms/BoundSelectAndTextField.d.ts +2 -2
  155. package/dist/forms/BoundSelectAndTextField.js +1 -1
  156. package/dist/forms/BoundSelectField.d.ts +1 -1
  157. package/dist/forms/BoundSelectField.js +3 -3
  158. package/dist/forms/BoundSwitchField.d.ts +1 -1
  159. package/dist/forms/BoundSwitchField.js +3 -3
  160. package/dist/forms/BoundTextAreaField.d.ts +1 -1
  161. package/dist/forms/BoundTextAreaField.js +2 -2
  162. package/dist/forms/BoundTextField.d.ts +1 -1
  163. package/dist/forms/BoundTextField.js +2 -2
  164. package/dist/forms/BoundToggleChipGroupField.d.ts +1 -1
  165. package/dist/forms/BoundToggleChipGroupField.js +1 -1
  166. package/dist/forms/FormHeading.js +2 -2
  167. package/dist/forms/FormLines.d.ts +1 -1
  168. package/dist/forms/FormLines.js +5 -5
  169. package/dist/forms/FormStateApp.js +5 -5
  170. package/dist/forms/StaticField.js +1 -1
  171. package/dist/forms/StepperFormApp.js +10 -10
  172. package/dist/forms/index.js +5 -1
  173. package/dist/hooks/index.js +5 -1
  174. package/dist/hooks/useBreakpoint.d.ts +1 -1
  175. package/dist/hooks/useQueryState.d.ts +1 -1
  176. package/dist/hooks/useSessionStorage.d.ts +1 -1
  177. package/dist/index.js +5 -1
  178. package/dist/inputs/Checkbox.js +1 -1
  179. package/dist/inputs/CheckboxBase.js +6 -6
  180. package/dist/inputs/CheckboxGroup.js +2 -2
  181. package/dist/inputs/ChipSelectField.d.ts +2 -2
  182. package/dist/inputs/ChipSelectField.js +14 -14
  183. package/dist/inputs/ChipTextField.js +3 -3
  184. package/dist/inputs/DateFields/DateField.js +1 -1
  185. package/dist/inputs/DateFields/DateField.mock.js +2 -2
  186. package/dist/inputs/DateFields/DateFieldBase.js +7 -7
  187. package/dist/inputs/DateFields/DateRangeField.js +1 -1
  188. package/dist/inputs/DateFields/index.js +5 -1
  189. package/dist/inputs/DateFields/utils.d.ts +2 -2
  190. package/dist/inputs/ErrorMessage.js +2 -2
  191. package/dist/inputs/MultiSelectField.js +2 -2
  192. package/dist/inputs/MultiSelectField.mock.js +4 -4
  193. package/dist/inputs/NumberField.d.ts +1 -1
  194. package/dist/inputs/NumberField.js +4 -4
  195. package/dist/inputs/RadioGroupField.js +3 -3
  196. package/dist/inputs/RichTextField.js +3 -3
  197. package/dist/inputs/RichTextField.mock.js +2 -2
  198. package/dist/inputs/SelectField.js +2 -2
  199. package/dist/inputs/SelectField.mock.js +4 -4
  200. package/dist/inputs/Switch.js +5 -5
  201. package/dist/inputs/SwitchGroup.d.ts +1 -1
  202. package/dist/inputs/SwitchGroup.js +1 -1
  203. package/dist/inputs/TextAreaField.js +1 -1
  204. package/dist/inputs/TextField.d.ts +1 -1
  205. package/dist/inputs/TextField.js +1 -1
  206. package/dist/inputs/TextFieldBase.js +10 -10
  207. package/dist/inputs/ToggleButton.js +1 -1
  208. package/dist/inputs/ToggleChipGroup.d.ts +1 -1
  209. package/dist/inputs/ToggleChipGroup.js +3 -3
  210. package/dist/inputs/Value.d.ts +1 -1
  211. package/dist/inputs/index.js +5 -1
  212. package/dist/inputs/internal/ListBox.js +3 -3
  213. package/dist/inputs/internal/ListBoxChip.js +1 -1
  214. package/dist/inputs/internal/ListBoxSection.js +1 -1
  215. package/dist/inputs/internal/ListBoxToggleChip.js +2 -2
  216. package/dist/inputs/internal/LoadingDots.js +2 -2
  217. package/dist/inputs/internal/MenuSearchField.js +1 -1
  218. package/dist/inputs/internal/Option.js +3 -3
  219. package/dist/inputs/internal/SelectFieldBase.d.ts +1 -1
  220. package/dist/inputs/internal/SelectFieldBase.js +2 -2
  221. package/dist/inputs/internal/SelectFieldInput.js +4 -4
  222. package/dist/inputs/internal/VirtualizedOptions.js +2 -2
  223. package/dist/interfaces.d.ts +1 -1
  224. package/dist/types.d.ts +4 -4
  225. package/dist/utils/getInteractiveElement.js +2 -2
  226. package/dist/utils/index.d.ts +2 -2
  227. package/dist/utils/index.js +5 -1
  228. package/dist/utils/rtl.js +1 -1
  229. package/dist/utils/sb.d.ts +2 -2
  230. package/dist/utils/sb.js +4 -4
  231. package/dist/utils/useTestIds.d.ts +1 -1
  232. package/package.json +4 -4
@@ -1,3 +1,3 @@
1
- declare type UseSessionStorage<T> = [T, (value: T) => void];
1
+ type UseSessionStorage<T> = [T, (value: T) => void];
2
2
  export declare function useSessionStorage<T>(key: string, defaultValue: T): UseSessionStorage<T>;
3
3
  export {};
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -16,6 +16,6 @@ function Checkbox(props) {
16
16
  const ref = (0, react_1.useRef)(null);
17
17
  const toggleState = (0, react_stately_1.useToggleState)(ariaProps);
18
18
  const { inputProps } = (0, react_aria_1.useCheckbox)(checkboxProps, toggleState, ref);
19
- return ((0, jsx_runtime_1.jsx)(CheckboxBase_1.CheckboxBase, Object.assign({ ariaProps: ariaProps, isDisabled: isDisabled, isIndeterminate: isIndeterminate, isSelected: isSelected, inputProps: inputProps, label: label }, otherProps), void 0));
19
+ return ((0, jsx_runtime_1.jsx)(CheckboxBase_1.CheckboxBase, { ariaProps: ariaProps, isDisabled: isDisabled, isIndeterminate: isIndeterminate, isSelected: isSelected, inputProps: inputProps, label: label, ...otherProps }));
20
20
  }
21
21
  exports.Checkbox = Checkbox;
@@ -16,14 +16,14 @@ function CheckboxBase(props) {
16
16
  const { hoverProps, isHovered } = (0, react_aria_1.useHover)({ isDisabled });
17
17
  const tid = (0, utils_1.useTestIds)(props, (0, defaultTestId_1.defaultTestId)(label));
18
18
  const markIcon = isIndeterminate ? dashSmall : isSelected ? checkmarkSmall : "";
19
- return ((0, jsx_runtime_1.jsxs)("label", Object.assign({ css: Css_1.Css.df.cursorPointer.relative
19
+ return ((0, jsx_runtime_1.jsxs)("label", { css: Css_1.Css.df.cursorPointer.relative
20
20
  // Prevents accidental checkbox clicks due to label width being longer
21
21
  // than the content.
22
22
  .w("max-content")
23
23
  .maxw((0, Css_1.px)(320))
24
24
  .if(description !== undefined)
25
25
  .maxw((0, Css_1.px)(344))
26
- .if(isDisabled).cursorNotAllowed.$, "aria-label": label }, { children: [(0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", Object.assign({ ref: ref }, (0, react_aria_1.mergeProps)(inputProps, focusProps), tid), void 0) }, void 0), (0, jsx_runtime_1.jsx)("span", Object.assign({}, hoverProps, { css: {
26
+ .if(isDisabled).cursorNotAllowed.$, "aria-label": label, children: [(0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", { ref: ref, ...(0, react_aria_1.mergeProps)(inputProps, focusProps), ...tid }) }), (0, jsx_runtime_1.jsx)("span", { ...hoverProps, css: {
27
27
  ...baseStyles,
28
28
  ...(((isSelected && !isDisabled) || isIndeterminate) && filledBoxStyles),
29
29
  ...(((isSelected && !isDisabled) || isIndeterminate) && isHovered && filledBoxHoverStyles),
@@ -32,10 +32,10 @@ function CheckboxBase(props) {
32
32
  ...(isFocusVisible && focusRingStyles),
33
33
  ...(isHovered && hoverBorderStyles),
34
34
  ...markStyles,
35
- }, "aria-hidden": "true" }, { children: markIcon }), void 0), !checkboxOnly && (
35
+ }, "aria-hidden": "true", children: markIcon }), !checkboxOnly && (
36
36
  // Use a mtPx(-2) to better align the label with the checkbox.
37
37
  // Not using align-items: center as the checkbox would align with all content below, where we really want it to stay only aligned with the label
38
- (0, jsx_runtime_1.jsxs)("div", Object.assign({ css: Css_1.Css.ml1.mtPx(-2).$ }, { children: [label && (0, jsx_runtime_1.jsx)("div", Object.assign({ css: { ...labelStyles, ...(isDisabled && disabledColor) } }, { children: label }), void 0), description && (0, jsx_runtime_1.jsx)("div", Object.assign({ css: { ...descStyles, ...(isDisabled && disabledColor) } }, { children: description }), void 0), errorMsg && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, Object.assign({ errorMsg: errorMsg }, tid.errorMsg), void 0), helperText && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, Object.assign({ helperText: helperText }, tid.helperText), void 0)] }), void 0))] }), void 0));
38
+ (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.ml1.mtPx(-2).$, children: [label && (0, jsx_runtime_1.jsx)("div", { css: { ...labelStyles, ...(isDisabled && disabledColor) }, children: label }), description && (0, jsx_runtime_1.jsx)("div", { css: { ...descStyles, ...(isDisabled && disabledColor) }, children: description }), errorMsg && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { errorMsg: errorMsg, ...tid.errorMsg }), helperText && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, { helperText: helperText, ...tid.helperText })] }))] }));
39
39
  }
40
40
  exports.CheckboxBase = CheckboxBase;
41
41
  const baseStyles = Css_1.Css.hPx(16).mw((0, Css_1.px)(16)).relative.ba.bGray300.br4.bgWhite.transition.$;
@@ -49,5 +49,5 @@ const hoverBorderStyles = Css_1.Css.bLightBlue900.$;
49
49
  const markStyles = { svg: Css_1.Css.absolute.topPx(-1).leftPx(-1).$ };
50
50
  const labelStyles = Css_1.Css.smMd.$;
51
51
  const descStyles = Css_1.Css.sm.gray700.$;
52
- const checkmarkSmall = ((0, jsx_runtime_1.jsx)("svg", Object.assign({ width: "16", height: "16" }, { children: (0, jsx_runtime_1.jsx)("path", { d: "M6.66669 10.3907L4.47135 8.19533L3.52869 9.138L6.66669 12.276L13.138 5.80467L12.1954 4.862L6.66669 10.3907Z", fill: Css_1.Palette.White }, void 0) }), void 0));
53
- const dashSmall = ((0, jsx_runtime_1.jsx)("svg", Object.assign({ width: "16", height: "16" }, { children: (0, jsx_runtime_1.jsx)("rect", { x: "4", y: "7.5", width: "8", height: "1.35", fill: Css_1.Palette.White }, void 0) }), void 0));
52
+ const checkmarkSmall = ((0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", children: (0, jsx_runtime_1.jsx)("path", { d: "M6.66669 10.3907L4.47135 8.19533L3.52869 9.138L6.66669 12.276L13.138 5.80467L12.1954 4.862L6.66669 10.3907Z", fill: Css_1.Palette.White }) }));
53
+ const dashSmall = ((0, jsx_runtime_1.jsx)("svg", { width: "16", height: "16", children: (0, jsx_runtime_1.jsx)("rect", { x: "4", y: "7.5", width: "8", height: "1.35", fill: Css_1.Palette.White }) }));
@@ -16,7 +16,7 @@ function CheckboxGroup(props) {
16
16
  const state = (0, react_stately_1.useCheckboxGroupState)({ ...props, value: values });
17
17
  const { groupProps, labelProps } = (0, react_aria_1.useCheckboxGroup)(props, state);
18
18
  const tid = (0, utils_1.useTestIds)(props);
19
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, groupProps, { onBlur: onBlur, onFocus: onFocus }, tid, { children: [!hideLabel && (0, jsx_runtime_1.jsx)(Label_1.Label, Object.assign({ label: label }, labelProps, tid.label), void 0), (0, jsx_runtime_1.jsx)("div", Object.assign({ css: Css_1.Css.dg.gtc(`repeat(${columns}, auto)`).gap2.$ }, { children: options.map((option) => ((0, jsx_runtime_1.jsx)(CheckboxGroupItem, Object.assign({}, option, { groupState: state, selected: state.value.includes(option.value) }), option.value))) }), void 0), errorMsg && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, Object.assign({ errorMsg: errorMsg }, tid.errorMsg), void 0), helperText && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, Object.assign({ helperText: helperText }, tid.helperText), void 0)] }), void 0));
19
+ return ((0, jsx_runtime_1.jsxs)("div", { ...groupProps, onBlur: onBlur, onFocus: onFocus, ...tid, children: [!hideLabel && (0, jsx_runtime_1.jsx)(Label_1.Label, { label: label, ...labelProps, ...tid.label }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.dg.gtc(`repeat(${columns}, auto)`).gap2.$, children: options.map((option) => ((0, jsx_runtime_1.jsx)(CheckboxGroupItem, { ...option, groupState: state, selected: state.value.includes(option.value) }, option.value))) }), errorMsg && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { errorMsg: errorMsg, ...tid.errorMsg }), helperText && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, { helperText: helperText, ...tid.helperText })] }));
20
20
  }
21
21
  exports.CheckboxGroup = CheckboxGroup;
22
22
  function CheckboxGroupItem(props) {
@@ -25,5 +25,5 @@ function CheckboxGroupItem(props) {
25
25
  const checkboxProps = { ...ariaProps, "aria-label": label };
26
26
  const ref = (0, react_1.useRef)(null);
27
27
  const { inputProps } = (0, react_aria_1.useCheckboxGroupItem)(checkboxProps, groupState, ref);
28
- return ((0, jsx_runtime_1.jsx)(CheckboxBase_1.CheckboxBase, Object.assign({ ariaProps: ariaProps, description: description, isDisabled: isDisabled, isIndeterminate: isIndeterminate, isSelected: isSelected, inputProps: inputProps, label: label }, otherProps), void 0));
28
+ return ((0, jsx_runtime_1.jsx)(CheckboxBase_1.CheckboxBase, { ariaProps: ariaProps, description: description, isDisabled: isDisabled, isIndeterminate: isIndeterminate, isSelected: isSelected, inputProps: inputProps, label: label, ...otherProps }));
29
29
  }
@@ -18,13 +18,13 @@ export interface ChipSelectFieldProps<O, V extends Value> {
18
18
  export declare function ChipSelectField<O, V extends Value>(props: ChipSelectFieldProps<O, V>): JSX.Element;
19
19
  export declare function ChipSelectField<O extends HasIdAndName<V>, V extends Value>(props: Optional<ChipSelectFieldProps<O, V>, "getOptionValue" | "getOptionLabel">): JSX.Element;
20
20
  export declare const persistentItemPrefix = "persistentItem:";
21
- declare type PersistentItem = {
21
+ type PersistentItem = {
22
22
  id: string;
23
23
  name: string;
24
24
  };
25
25
  export declare function isPersistentItem<T extends PersistentItem>(opt: any): opt is PersistentItem;
26
26
  export declare function isPersistentKey(key: Key): boolean;
27
- declare type ListBoxSection<O> = {
27
+ type ListBoxSection<O> = {
28
28
  title: string;
29
29
  options: O[];
30
30
  isPersistent?: boolean;
@@ -83,16 +83,16 @@ function ChipSelectField(props) {
83
83
  }, [options]);
84
84
  const selectChildren = (0, react_1.useMemo)(() => listData.items.map((s) => {
85
85
  if (isListBoxSection(s)) {
86
- return ((0, jsx_runtime_1.jsx)(react_stately_1.Section, Object.assign({ title: s.title, items: s.options }, { children: (item) => {
86
+ return ((0, jsx_runtime_1.jsx)(react_stately_1.Section, { title: s.title, items: s.options, children: (item) => {
87
87
  if (isPersistentItem(item)) {
88
- return ((0, jsx_runtime_1.jsx)(react_stately_1.Item, Object.assign({ textValue: item.name }, { children: item.name }), item.id));
88
+ return ((0, jsx_runtime_1.jsx)(react_stately_1.Item, { textValue: item.name, children: item.name }, item.id));
89
89
  }
90
90
  const label = getOptionLabel(item);
91
- return ((0, jsx_runtime_1.jsx)(react_stately_1.Item, Object.assign({ textValue: label }, { children: (0, jsx_runtime_1.jsx)(ListBoxChip_1.ListBoxChip, { label: label }, void 0) }), getOptionValue(item)));
92
- } }), (0, change_case_1.camelCase)(s.title)));
91
+ return ((0, jsx_runtime_1.jsx)(react_stately_1.Item, { textValue: label, children: (0, jsx_runtime_1.jsx)(ListBoxChip_1.ListBoxChip, { label: label }) }, getOptionValue(item)));
92
+ } }, (0, change_case_1.camelCase)(s.title)));
93
93
  }
94
94
  const label = getOptionLabel(s);
95
- return ((0, jsx_runtime_1.jsx)(react_stately_1.Item, Object.assign({ textValue: label }, { children: (0, jsx_runtime_1.jsx)(ListBoxChip_1.ListBoxChip, { label: label }, void 0) }), getOptionValue(s)));
95
+ return ((0, jsx_runtime_1.jsx)(react_stately_1.Item, { textValue: label, children: (0, jsx_runtime_1.jsx)(ListBoxChip_1.ListBoxChip, { label: label }) }, getOptionValue(s)));
96
96
  }), [listData.items, getOptionLabel, getOptionValue]);
97
97
  const selectHookProps = {
98
98
  label,
@@ -150,30 +150,30 @@ function ChipSelectField(props) {
150
150
  };
151
151
  // State management for the "Create new" flow with ChipTextField.
152
152
  const [showInput, setShowInput] = (0, react_1.useState)(false);
153
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showInput && onCreateNew && ((0, jsx_runtime_1.jsx)(CreateNewField, Object.assign({ onBlur: () => setShowInput(false), onEnter: async (value) => {
153
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showInput && onCreateNew && ((0, jsx_runtime_1.jsx)(CreateNewField, { onBlur: () => setShowInput(false), onEnter: async (value) => {
154
154
  await onCreateNew(value);
155
155
  setShowInput(false);
156
- } }, tid.createNewField), void 0)), (0, components_1.maybeTooltip)({
156
+ }, ...tid.createNewField })), (0, components_1.maybeTooltip)({
157
157
  title: (0, components_1.resolveTooltip)(disabled),
158
158
  placement: "top",
159
- children: ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: wrapperRef, css: {
159
+ children: ((0, jsx_runtime_1.jsxs)("div", { ref: wrapperRef, css: {
160
160
  ...chipStyles,
161
161
  ...Css_1.Css.dif.relative.p0.mwPx(32).if(!value).bgGray200.$,
162
162
  ...(visualFocus ? Css_1.Css.bshFocus.$ : {}),
163
163
  ...(showInput ? Css_1.Css.dn.$ : {}),
164
- } }, { children: [(0, jsx_runtime_1.jsx)(Label_1.Label, Object.assign({ label: label, labelProps: labelProps, hidden: true }, tid.label), void 0), (0, jsx_runtime_1.jsx)("button", Object.assign({}, (0, react_aria_1.mergeProps)(focusProps, buttonProps), { ref: buttonRef, css: {
164
+ }, children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { label: label, labelProps: labelProps, hidden: true, ...tid.label }), (0, jsx_runtime_1.jsx)("button", { ...(0, react_aria_1.mergeProps)(focusProps, buttonProps), ref: buttonRef, css: {
165
165
  ...Css_1.Css.tl.br16.pxPx(10).pyPx(2).outline0.if(showClearButton).prPx(4).borderRadius("16px 0 0 16px").$,
166
166
  ...(isDisabled ? Css_1.Css.cursorNotAllowed.gray700.$ : {}),
167
167
  "&:hover:not(:disabled)": Css_1.Css.bgGray400.if(!value).bgGray300.$,
168
- }, title: state.selectedItem ? state.selectedItem.textValue : placeholder }, tid, { children: (0, jsx_runtime_1.jsx)("span", Object.assign({}, valueProps, { css: Css_1.Css.lineClamp1.breakAll.$ }, { children: state.selectedItem ? state.selectedItem.textValue : placeholder }), void 0) }), void 0), showClearButton && ((0, jsx_runtime_1.jsx)("button", Object.assign({}, clearFocusProps, { css: {
168
+ }, title: state.selectedItem ? state.selectedItem.textValue : placeholder, ...tid, children: (0, jsx_runtime_1.jsx)("span", { ...valueProps, css: Css_1.Css.lineClamp1.breakAll.$, children: state.selectedItem ? state.selectedItem.textValue : placeholder }) }), showClearButton && ((0, jsx_runtime_1.jsx)("button", { ...clearFocusProps, css: {
169
169
  ...Css_1.Css.prPx(4).borderRadius("0 16px 16px 0").outline0.$,
170
170
  "&:hover": Css_1.Css.bgGray400.$,
171
171
  ...(isClearFocused ? Css_1.Css.boxShadow(`0px 0px 0px 2px rgba(3,105,161,1)`).$ : {}),
172
172
  }, onClick: () => {
173
173
  onSelect(undefined, undefined);
174
174
  setIsClearFocused(false);
175
- }, "aria-label": "Remove" }, tid.clearButton, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "x", inc: typeScale === "xs" ? 2 : undefined }, void 0) }), void 0))] }), void 0)),
176
- }), state.isOpen && ((0, jsx_runtime_1.jsx)(internal_1.Popover, Object.assign({ triggerRef: buttonRef, popoverRef: popoverRef, positionProps: overlayProps, onClose: state.close, isOpen: state.isOpen, shouldCloseOnBlur: true }, { children: (0, jsx_runtime_1.jsx)(ListBox_1.ListBox, Object.assign({}, menuProps, { listBoxRef: listBoxRef, state: state, getOptionLabel: getOptionLabel, getOptionValue: getOptionValue, positionProps: overlayProps }), void 0) }), void 0))] }, void 0));
175
+ }, "aria-label": "Remove", ...tid.clearButton, children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "x", inc: typeScale === "xs" ? 2 : undefined }) }))] })),
176
+ }), state.isOpen && ((0, jsx_runtime_1.jsx)(internal_1.Popover, { triggerRef: buttonRef, popoverRef: popoverRef, positionProps: overlayProps, onClose: state.close, isOpen: state.isOpen, shouldCloseOnBlur: true, children: (0, jsx_runtime_1.jsx)(ListBox_1.ListBox, { ...menuProps, listBoxRef: listBoxRef, state: state, getOptionLabel: getOptionLabel, getOptionValue: getOptionValue, positionProps: overlayProps }) }))] }));
177
177
  }
178
178
  exports.ChipSelectField = ChipSelectField;
179
179
  exports.persistentItemPrefix = "persistentItem:";
@@ -190,7 +190,7 @@ function isPersistentKey(key) {
190
190
  }
191
191
  exports.isPersistentKey = isPersistentKey;
192
192
  function isListBoxSection(obj) {
193
- return typeof obj === "object" && "options" in obj;
193
+ return obj && typeof obj === "object" && "options" in obj;
194
194
  }
195
195
  exports.isListBoxSection = isListBoxSection;
196
196
  // Wrapper for the ChipTextField used in the "Create New" flow on ChipSelectField
@@ -198,5 +198,5 @@ function CreateNewField(props) {
198
198
  const { onBlur, onEnter } = props;
199
199
  const [value, setValue] = (0, react_1.useState)("Add new");
200
200
  const tid = (0, utils_1.useTestIds)(props);
201
- return ((0, jsx_runtime_1.jsx)(ChipTextField_1.ChipTextField, Object.assign({ autoFocus: true, label: "Add new", value: value, onChange: setValue, onEnter: () => onEnter(value), onBlur: onBlur }, tid), void 0));
201
+ return ((0, jsx_runtime_1.jsx)(ChipTextField_1.ChipTextField, { autoFocus: true, label: "Add new", value: value, onChange: setValue, onEnter: () => onEnter(value), onBlur: onBlur, ...tid }));
202
202
  }
@@ -40,7 +40,7 @@ function ChipTextField(props) {
40
40
  autoFocus && ((_a = fieldRef.current) === null || _a === void 0 ? void 0 : _a.focus());
41
41
  }, []);
42
42
  // React doesn't like contentEditable because it takes the children of the node out of React's scope. This is fine in this case as it is just a text value and we are managing it.
43
- return ((0, jsx_runtime_1.jsx)("span", Object.assign({ ref: fieldRef, contentEditable: true, suppressContentEditableWarning: true, "aria-required": required, "aria-label": label, onKeyDown: (e) => {
43
+ return ((0, jsx_runtime_1.jsx)("span", { ref: fieldRef, contentEditable: true, suppressContentEditableWarning: true, "aria-required": required, "aria-label": label, onKeyDown: (e) => {
44
44
  if (e.key === "Enter") {
45
45
  e.preventDefault();
46
46
  (0, utils_1.maybeCall)(onEnter);
@@ -54,9 +54,9 @@ function ChipTextField(props) {
54
54
  const target = e.target;
55
55
  target.textContent = (_b = (_a = target.textContent) === null || _a === void 0 ? void 0 : _a.replace(/[\n\r]/g, " ")) !== null && _b !== void 0 ? _b : "";
56
56
  onChange((_c = target.textContent) !== null && _c !== void 0 ? _c : "");
57
- } }, focusProps, { css: {
57
+ }, ...focusProps, css: {
58
58
  ...Css_1.Css[typeScale].dib.br16.pl1.pxPx(10).pyPx(2).gray900.bgGray300.outline0.mwPx(32).$,
59
59
  ...(isFocused ? Css_1.Css.bshFocus.$ : {}),
60
- } }, tid, { children: valueRef.current }), void 0));
60
+ }, ...tid, children: valueRef.current }));
61
61
  }
62
62
  exports.ChipTextField = ChipTextField;
@@ -4,6 +4,6 @@ exports.DateField = void 0;
4
4
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
5
  const DateFieldBase_1 = require("./DateFieldBase");
6
6
  function DateField(props) {
7
- return (0, jsx_runtime_1.jsx)(DateFieldBase_1.DateFieldBase, Object.assign({}, props, { mode: "single" }), void 0);
7
+ return (0, jsx_runtime_1.jsx)(DateFieldBase_1.DateFieldBase, { ...props, mode: "single" });
8
8
  }
9
9
  exports.DateField = DateField;
@@ -10,10 +10,10 @@ function DateField(props) {
10
10
  const { onChange = () => { }, errorMsg, onBlur, onFocus } = props;
11
11
  const [value, setValue] = (0, react_1.useState)(props.value ? (0, date_fns_1.format)(props.value, "MM/dd/yy") : "");
12
12
  const tid = (0, utils_1.useTestIds)(props, "date");
13
- return ((0, jsx_runtime_1.jsx)("input", Object.assign({}, tid, { "data-error": !!errorMsg, value: value, onChange: (e) => {
13
+ return ((0, jsx_runtime_1.jsx)("input", { ...tid, "data-error": !!errorMsg, value: value, onChange: (e) => {
14
14
  const { value } = e.target;
15
15
  setValue(value);
16
16
  onChange((0, date_fns_1.parse)(value, "MM/dd/yy", new Date()));
17
- }, onBlur: () => (0, utils_1.maybeCall)(onBlur), onFocus: () => (0, utils_1.maybeCall)(onFocus), disabled: !!props.disabled, readOnly: !!props.readOnly, "data-disabled-days": JSON.stringify(props.disabledDays) }), void 0));
17
+ }, onBlur: () => (0, utils_1.maybeCall)(onBlur), onFocus: () => (0, utils_1.maybeCall)(onFocus), disabled: !!props.disabled, readOnly: !!props.readOnly, "data-disabled-days": JSON.stringify(props.disabledDays) }));
18
18
  }
19
19
  exports.DateField = DateField;
@@ -157,10 +157,10 @@ function DateFieldBase(props) {
157
157
  const clearButton = ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: inputValue !== "" && !state.isOpen && ((0, jsx_runtime_1.jsx)(components_1.IconButton, { icon: "xCircle", color: Css_1.Palette.Gray700, onClick: () => {
158
158
  setInputValue("");
159
159
  onChange(undefined);
160
- } }, void 0)) }, void 0));
161
- const calendarButton = ((0, jsx_runtime_1.jsx)("button", Object.assign({ ref: buttonRef }, buttonProps, { disabled: isDisabled, css: Css_1.Css.if(isDisabled).cursorNotAllowed.$, tabIndex: -1 }, tid.calendarButton, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "calendar", color: isDisabled ? Css_1.Palette.Gray400 : Css_1.Palette.Gray700 }, void 0) }), void 0));
162
- const EndFieldButtons = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isRangeFilterField && clearButton, !hideCalendarIcon && calendarButton] }, void 0));
163
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, Object.assign({}, textFieldProps, { errorMsg: errorMsg, helperText: helperText, required: required, labelProps: labelProps, inputProps: { ...inputProps, size: inputSize }, inputRef: inputRef, inputWrapRef: inputWrapRef, inlineLabel: inlineLabel, onChange: (v) => {
160
+ } })) }));
161
+ const calendarButton = ((0, jsx_runtime_1.jsx)("button", { ref: buttonRef, ...buttonProps, disabled: isDisabled, css: Css_1.Css.if(isDisabled).cursorNotAllowed.$, tabIndex: -1, ...tid.calendarButton, children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "calendar", color: isDisabled ? Css_1.Palette.Gray400 : Css_1.Palette.Gray700 }) }));
162
+ const EndFieldButtons = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isRangeFilterField && clearButton, !hideCalendarIcon && calendarButton] }));
163
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, { ...textFieldProps, errorMsg: errorMsg, helperText: helperText, required: required, labelProps: labelProps, inputProps: { ...inputProps, size: inputSize }, inputRef: inputRef, inputWrapRef: inputWrapRef, inlineLabel: inlineLabel, onChange: (v) => {
164
164
  // hide the calendar if the user is manually entering the date
165
165
  state.close();
166
166
  if (v) {
@@ -173,17 +173,17 @@ function DateFieldBase(props) {
173
173
  else if (v === undefined) {
174
174
  setInputValue("");
175
175
  }
176
- }, endAdornment: !iconLeft && EndFieldButtons, startAdornment: !hideCalendarIcon && iconLeft && calendarButton, tooltip: (0, components_1.resolveTooltip)(disabled, undefined, readOnly) }, others), void 0), state.isOpen && ((0, jsx_runtime_1.jsx)(internal_1.Popover, Object.assign({ triggerRef: inputWrapRef, popoverRef: overlayRef, positionProps: positionProps, onClose: state.close, isOpen: state.isOpen }, { children: (0, jsx_runtime_1.jsx)(DatePickerOverlay_1.DatePickerOverlay, Object.assign({ overlayProps: overlayProps }, { children: isRangeMode ? ((0, jsx_runtime_1.jsx)(internal_1.DateRangePicker, Object.assign({ range: wipValue, disabledDays: disabledDays, onSelect: (dr) => {
176
+ }, endAdornment: !iconLeft && EndFieldButtons, startAdornment: !hideCalendarIcon && iconLeft && calendarButton, tooltip: (0, components_1.resolveTooltip)(disabled, undefined, readOnly), ...others }), state.isOpen && ((0, jsx_runtime_1.jsx)(internal_1.Popover, { triggerRef: inputWrapRef, popoverRef: overlayRef, positionProps: positionProps, onClose: state.close, isOpen: state.isOpen, children: (0, jsx_runtime_1.jsx)(DatePickerOverlay_1.DatePickerOverlay, { overlayProps: overlayProps, children: isRangeMode ? ((0, jsx_runtime_1.jsx)(internal_1.DateRangePicker, { range: wipValue, disabledDays: disabledDays, onSelect: (dr) => {
177
177
  var _a;
178
178
  // Note: Do not close date range picker on select to allow the user to select multiple dates at a time
179
179
  setInputValue((_a = (0, utils_1.formatDateRange)(dr, utils_1.dateFormats.short)) !== null && _a !== void 0 ? _a : "");
180
180
  onChange(dr);
181
- }, useYearPicker: isRangeFilterField }, tid.datePicker), void 0)) : ((0, jsx_runtime_1.jsx)(internal_1.DatePicker, Object.assign({ value: wipValue, disabledDays: disabledDays, onSelect: (d) => {
181
+ }, useYearPicker: isRangeFilterField, ...tid.datePicker })) : ((0, jsx_runtime_1.jsx)(internal_1.DatePicker, { value: wipValue, disabledDays: disabledDays, onSelect: (d) => {
182
182
  var _a;
183
183
  setInputValue((_a = (0, utils_1.formatDate)(d, utils_1.dateFormats.short)) !== null && _a !== void 0 ? _a : "");
184
184
  onChange(d);
185
185
  state.close();
186
- } }, tid.datePicker), void 0)) }), void 0) }), void 0))] }, void 0));
186
+ }, ...tid.datePicker })) }) }))] }));
187
187
  }
188
188
  exports.DateFieldBase = DateFieldBase;
189
189
  function isParsedDateValid(d) {
@@ -4,6 +4,6 @@ exports.DateRangeField = void 0;
4
4
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
5
  const DateFieldBase_1 = require("./DateFieldBase");
6
6
  function DateRangeField(props) {
7
- return (0, jsx_runtime_1.jsx)(DateFieldBase_1.DateFieldBase, Object.assign({}, props, { mode: "range" }), void 0);
7
+ return (0, jsx_runtime_1.jsx)(DateFieldBase_1.DateFieldBase, { ...props, mode: "range" });
8
8
  }
9
9
  exports.DateRangeField = DateRangeField;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,6 +1,6 @@
1
1
  import { DateRange } from "../../types";
2
- export declare type DateFieldModeTuple = readonly ["range", DateRange] | readonly ["single", Date];
3
- export declare type DateFieldMode = "single" | "range";
2
+ export type DateFieldModeTuple = readonly ["range", DateRange] | readonly ["single", Date];
3
+ export type DateFieldMode = "single" | "range";
4
4
  export declare const dateFormats: {
5
5
  short: string;
6
6
  medium: string;
@@ -12,7 +12,7 @@ const Css_1 = require("../Css");
12
12
  */
13
13
  function ErrorMessage(props) {
14
14
  const { id, errorMsg, contrast = false, hidden = false, ...others } = props;
15
- const errorEl = errorMsg ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: Css_1.Css.red600.sm.df.mtPx(4).if(contrast).red400.$ }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ css: Css_1.Css.fs0.$ }, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "error" }, void 0) }), void 0), (0, jsx_runtime_1.jsx)("span", Object.assign({ id: id, css: Css_1.Css.ml1.mtPx(2).$ }, others, { children: errorMsg }), void 0)] }), void 0)) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}, void 0));
16
- return hidden ? (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: errorEl }, void 0) : errorEl;
15
+ const errorEl = errorMsg ? ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.red600.sm.df.mtPx(4).if(contrast).red400.$, children: [(0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.fs0.$, children: (0, jsx_runtime_1.jsx)(components_1.Icon, { icon: "error" }) }), (0, jsx_runtime_1.jsx)("span", { id: id, css: Css_1.Css.ml1.mtPx(2).$, ...others, children: errorMsg })] })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}));
16
+ return hidden ? (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: errorEl }) : errorEl;
17
17
  }
18
18
  exports.ErrorMessage = ErrorMessage;
@@ -7,7 +7,7 @@ function MultiSelectField(props) {
7
7
  const { getOptionValue = (opt) => opt.id, // if unset, assume O implements HasId
8
8
  getOptionLabel = (opt) => opt.name, // if unset, assume O implements HasName
9
9
  options, onSelect, values, ...otherProps } = props;
10
- return ((0, jsx_runtime_1.jsx)(SelectFieldBase_1.SelectFieldBase, Object.assign({ multiselect: true }, otherProps, { options: options, getOptionLabel: getOptionLabel, getOptionValue: getOptionValue, values: values, onSelect: (values) => {
10
+ return ((0, jsx_runtime_1.jsx)(SelectFieldBase_1.SelectFieldBase, { multiselect: true, ...otherProps, options: options, getOptionLabel: getOptionLabel, getOptionValue: getOptionValue, values: values, onSelect: (values) => {
11
11
  const [selectedValues, selectedOptions] = options
12
12
  .filter((o) => values.includes(getOptionValue(o)))
13
13
  .reduce((acc, o) => {
@@ -16,6 +16,6 @@ function MultiSelectField(props) {
16
16
  return acc;
17
17
  }, [[], []]);
18
18
  onSelect(selectedValues, selectedOptions);
19
- } }), void 0));
19
+ } }));
20
20
  }
21
21
  exports.MultiSelectField = MultiSelectField;
@@ -10,7 +10,7 @@ function MultiSelectField(props) {
10
10
  getOptionLabel = (o) => o.name, // if unset, assume O implements HasName
11
11
  values, options, onSelect, readOnly = false, errorMsg, onFocus, onBlur, disabled, label, disabledOptions = [], helperText, } = props;
12
12
  const tid = (0, utils_1.useTestIds)(props, (0, defaultTestId_1.defaultTestId)(label));
13
- return ((0, jsx_runtime_1.jsxs)("label", Object.assign({}, tid.label, { children: [label, (0, jsx_runtime_1.jsxs)("select", Object.assign({}, tid, {
13
+ return ((0, jsx_runtime_1.jsxs)("label", { ...tid.label, children: [label, (0, jsx_runtime_1.jsxs)("select", { ...tid,
14
14
  // We're cheating and assume the values are strings...what we should really do is either:
15
15
  // a) use beam's valueToKey mapping to string-encode any Value, or
16
16
  // b) instead of using `values` directly, use the index of each value's `option` in `options`
@@ -38,8 +38,8 @@ function MultiSelectField(props) {
38
38
  onBlur();
39
39
  },
40
40
  // Read Only does not apply to `select` fields, instead we'll add in disabled for tests to verify.
41
- disabled: !!(readOnly || disabled), "data-error": !!errorMsg, "data-errormsg": errorMsg, "data-readonly": readOnly }, { children: [(0, jsx_runtime_1.jsx)("option", { disabled: true, value: "" }, void 0), options.map((option, i) => {
42
- return ((0, jsx_runtime_1.jsx)("option", Object.assign({ value: getOptionValue(option), disabled: disabledOptions.includes(getOptionValue(option)) }, { children: getOptionLabel(option) }), i));
43
- })] }), void 0), helperText && (0, jsx_runtime_1.jsx)("div", Object.assign({}, tid.helperText, { children: helperText }), void 0)] }), void 0));
41
+ disabled: !!(readOnly || disabled), "data-error": !!errorMsg, "data-errormsg": errorMsg, "data-readonly": readOnly, children: [(0, jsx_runtime_1.jsx)("option", { disabled: true, value: "" }), options.map((option, i) => {
42
+ return ((0, jsx_runtime_1.jsx)("option", { value: getOptionValue(option), disabled: disabledOptions.includes(getOptionValue(option)), children: getOptionLabel(option) }, i));
43
+ })] }), helperText && (0, jsx_runtime_1.jsx)("div", { ...tid.helperText, children: helperText })] }));
44
44
  }
45
45
  exports.MultiSelectField = MultiSelectField;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import { Xss } from "../Css";
3
- export declare type NumberFieldType = "cents" | "dollars" | "percent" | "basisPoints" | "days";
3
+ export type NumberFieldType = "cents" | "dollars" | "percent" | "basisPoints" | "days";
4
4
  export interface NumberFieldProps {
5
5
  label: string;
6
6
  /** If set, the label will be defined as 'aria-label` on the input element */
@@ -26,7 +26,7 @@ function NumberField(props) {
26
26
  ...(numIntegerDigits !== undefined && { minimumIntegerDigits: numIntegerDigits }),
27
27
  useGrouping,
28
28
  signDisplay,
29
- }), [truncate, numIntegerDigits, useGrouping, signDisplay]);
29
+ }), [truncate, numIntegerDigits, useGrouping, signDisplay, numFractionDigits]);
30
30
  const { locale } = (0, react_aria_1.useLocale)();
31
31
  // If formatOptions isn't memo'd, a useEffect in useNumberStateField will cause jank,
32
32
  // see: https://github.com/adobe/react-spectrum/issues/1893.
@@ -46,7 +46,7 @@ function NumberField(props) {
46
46
  ? { style: "unit", unit: "day", unitDisplay: "long", maximumFractionDigits: 0 }
47
47
  : {};
48
48
  return { ...defaultFormatOptions, ...typeFormat };
49
- }, [type, numberFormatOptions]);
49
+ }, [type, numberFormatOptions, defaultFormatOptions, numFractionDigits]);
50
50
  const numberParser = (0, react_1.useMemo)(() => new number_1.NumberParser(locale, formatOptions), [locale, formatOptions]);
51
51
  const valueRef = (0, react_1.useRef)({ wip: false });
52
52
  // We can use this for both useNumberFieldState + useNumberField
@@ -86,14 +86,14 @@ function NumberField(props) {
86
86
  if (readOnly && !inputRef.current) {
87
87
  inputRef.current = document.createElement("input");
88
88
  }
89
- return ((0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, Object.assign({ xss: { ...alignment, ...xss }, groupProps: groupProps, labelProps: labelProps, label: label, required: required, inputProps: (0, react_aria_1.mergeProps)(inputProps, {
89
+ return ((0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, { xss: { ...alignment, ...xss }, groupProps: groupProps, labelProps: labelProps, label: label, required: required, inputProps: (0, react_aria_1.mergeProps)(inputProps, {
90
90
  size: sizeToContent ? String((_a = inputProps.value) !== null && _a !== void 0 ? _a : "").length || 1 : undefined,
91
91
  }),
92
92
  // This is called on each DOM change, to push the latest value into the field
93
93
  onChange: (rawInputValue) => {
94
94
  const parsedValue = numberParser.parse(rawInputValue || "");
95
95
  onChange(formatValue(parsedValue, factor, numFractionDigits, numIntegerDigits));
96
- }, inputRef: inputRef, onBlur: onBlur, onFocus: onFocus, errorMsg: errorMsg, helperText: helperText, tooltip: (0, components_1.resolveTooltip)(disabled, undefined, readOnly) }, otherProps), void 0));
96
+ }, inputRef: inputRef, onBlur: onBlur, onFocus: onFocus, errorMsg: errorMsg, helperText: helperText, tooltip: (0, components_1.resolveTooltip)(disabled, undefined, readOnly), ...otherProps }));
97
97
  }
98
98
  exports.NumberField = NumberField;
99
99
  function formatValue(value, factor, numFractionDigits, numIntegerDigits) {
@@ -38,7 +38,7 @@ function RadioGroupField(props) {
38
38
  const anyDescriptions = options.some((o) => !!o.description);
39
39
  return (
40
40
  // width of `max-content` is used to limit invisible label clicking
41
- (0, jsx_runtime_1.jsxs)("div", Object.assign({ css: Css_1.Css.w("max-content").maxw(anyDescriptions ? "344px" : "320px").$ }, { children: [(0, jsx_runtime_1.jsx)(Label_1.Label, Object.assign({ label: label }, labelProps, tid.label, { hidden: hideLabel }), void 0), (0, jsx_runtime_1.jsx)("div", Object.assign({}, radioGroupProps, { children: options.map((option) => ((0, jsx_runtime_1.jsx)(Radio, Object.assign({ parentId: name, option: option, state: state }, otherProps, tid[option.value]), option.value))) }), void 0), errorMsg && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, Object.assign({ errorMsg: errorMsg }, tid.errorMsg), void 0), helperText && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, { helperText: helperText }, void 0)] }), void 0));
41
+ (0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.w("max-content").maxw(anyDescriptions ? "344px" : "320px").$, children: [(0, jsx_runtime_1.jsx)(Label_1.Label, { label: label, ...labelProps, ...tid.label, hidden: hideLabel }), (0, jsx_runtime_1.jsx)("div", { ...radioGroupProps, children: options.map((option) => ((0, jsx_runtime_1.jsx)(Radio, { parentId: name, option: option, state: state, ...otherProps, ...tid[option.value] }, option.value))) }), errorMsg && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { errorMsg: errorMsg, ...tid.errorMsg }), helperText && (0, jsx_runtime_1.jsx)(HelperText_1.HelperText, { helperText: helperText })] }));
42
42
  }
43
43
  exports.RadioGroupField = RadioGroupField;
44
44
  // Not meant to be standalone, but its own component so it can use hooks
@@ -51,7 +51,7 @@ function Radio(props) {
51
51
  const { inputProps } = (0, react_aria_1.useRadio)({ value, "aria-labelledby": labelId }, state, ref);
52
52
  const { focusProps, isFocusVisible } = (0, react_aria_1.useFocusRing)();
53
53
  const { hoverProps, isHovered } = (0, react_aria_1.useHover)({ isDisabled: disabled });
54
- return ((0, jsx_runtime_1.jsxs)("label", Object.assign({ css: Css_1.Css.df.cursorPointer.mb1.if(disabled).add("cursor", "initial").$ }, hoverProps, { children: [(0, jsx_runtime_1.jsx)("input", Object.assign({ type: "radio", ref: ref, css: {
54
+ return ((0, jsx_runtime_1.jsxs)("label", { css: Css_1.Css.df.cursorPointer.mb1.if(disabled).add("cursor", "initial").$, ...hoverProps, children: [(0, jsx_runtime_1.jsx)("input", { type: "radio", ref: ref, css: {
55
55
  ...exports.radioReset,
56
56
  ...exports.radioDefault,
57
57
  ...(!disabled && state.selectedValue === value ? exports.radioChecked : exports.radioUnchecked),
@@ -60,7 +60,7 @@ function Radio(props) {
60
60
  ...(isFocusVisible ? exports.radioFocus : {}),
61
61
  // Nudge down so the center of the circle lines up with the label text
62
62
  ...Css_1.Css.mtPx(2).mr1.$,
63
- }, disabled: disabled, "aria-labelledby": labelId }, inputProps, focusProps, others), void 0), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ id: labelId, css: Css_1.Css.smMd.gray800.if(disabled).gray400.$ }, (description ? { "aria-describedby": descriptionId } : {}), { children: label }), void 0), description && ((0, jsx_runtime_1.jsx)("div", Object.assign({ id: descriptionId, css: Css_1.Css.sm.gray700.if(disabled).gray400.$ }, { children: description }), void 0))] }, void 0)] }), void 0));
63
+ }, disabled: disabled, "aria-labelledby": labelId, ...inputProps, ...focusProps, ...others }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { id: labelId, css: Css_1.Css.smMd.gray800.if(disabled).gray400.$, ...(description ? { "aria-describedby": descriptionId } : {}), children: label }), description && ((0, jsx_runtime_1.jsx)("div", { id: descriptionId, css: Css_1.Css.sm.gray700.if(disabled).gray400.$, children: description }))] })] }));
64
64
  }
65
65
  const whiteCircle = "data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='4'/%3e%3c/svg%3e";
66
66
  // Didn't put these in radioReset yet, are they needed?
@@ -95,16 +95,16 @@ function RichTextField(props) {
95
95
  }, [value, readOnly, editor]);
96
96
  const { placeholder, autoFocus } = props;
97
97
  if (!readOnly) {
98
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: Css_1.Css.w100.maxw("550px").$ }, { children: [label && (0, jsx_runtime_1.jsx)(Label_1.Label, { labelProps: {}, label: label }, void 0), (0, jsx_runtime_1.jsxs)("div", Object.assign({ css: { ...Css_1.Css.br4.bgWhite.$, ...trixCssOverrides } }, { children: [(0, jsx_runtime_1.jsx)("input", { type: "hidden", id: `input-${id}`, value: value }, void 0), (0, react_2.createElement)("trix-editor", {
98
+ return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.w100.maxw("550px").$, children: [label && (0, jsx_runtime_1.jsx)(Label_1.Label, { labelProps: {}, label: label }), (0, jsx_runtime_1.jsxs)("div", { css: { ...Css_1.Css.br4.bgWhite.$, ...trixCssOverrides }, children: [(0, jsx_runtime_1.jsx)("input", { type: "hidden", id: `input-${id}`, value: value }), (0, react_2.createElement)("trix-editor", {
99
99
  id: id,
100
100
  input: `input-${id}`,
101
101
  // Autofocus attribute is case sensitive since this is standard HTML
102
102
  ...(autoFocus ? { autofocus: true } : {}),
103
103
  ...(placeholder ? { placeholder } : {}),
104
- })] }), void 0), (0, jsx_runtime_1.jsx)(react_1.Global, { styles: [tributeOverrides] }, void 0)] }), void 0));
104
+ })] }), (0, jsx_runtime_1.jsx)(react_1.Global, { styles: [tributeOverrides] })] }));
105
105
  }
106
106
  else {
107
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ css: Css_1.Css.w100.maxw("550px").$ }, { children: [label && (0, jsx_runtime_1.jsx)(Label_1.Label, { label: label }, void 0), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mh("120px").bgWhite.sm.gray900.bn.p1.br4.bGray300.ba.$, dangerouslySetInnerHTML: { __html: dompurify_1.default.sanitize(value) || placeholder || "" }, "data-readonly": "true" }, void 0)] }), void 0));
107
+ return ((0, jsx_runtime_1.jsxs)("div", { css: Css_1.Css.w100.maxw("550px").$, children: [label && (0, jsx_runtime_1.jsx)(Label_1.Label, { label: label }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.mh("120px").bgWhite.sm.gray900.bn.p1.br4.bGray300.ba.$, dangerouslySetInnerHTML: { __html: dompurify_1.default.sanitize(value) || placeholder || "" }, "data-readonly": "true" })] }));
108
108
  }
109
109
  }
110
110
  exports.RichTextField = RichTextField;
@@ -10,11 +10,11 @@ function RichTextField(props) {
10
10
  const { onBlur = () => { }, onFocus = () => { }, readOnly } = props;
11
11
  const [value, setValue] = (0, react_1.useState)(props.value || "");
12
12
  const tid = (0, utils_1.useTestIds)(props, defaultTestId(props.label || "richTextField"));
13
- return ((0, jsx_runtime_1.jsx)("input", Object.assign({ type: "text", value: value, onChange: (e) => {
13
+ return ((0, jsx_runtime_1.jsx)("input", { type: "text", value: value, onChange: (e) => {
14
14
  const { value } = e.target;
15
15
  setValue(value);
16
16
  props.onChange(value, value, props.mergeTags || []);
17
- }, onBlur: onBlur, onFocus: onFocus, readOnly: readOnly }, tid), void 0));
17
+ }, onBlur: onBlur, onFocus: onFocus, readOnly: readOnly, ...tid }));
18
18
  }
19
19
  exports.RichTextField = RichTextField;
20
20
  function defaultTestId(label) {
@@ -7,11 +7,11 @@ function SelectField(props) {
7
7
  const { getOptionValue = (opt) => opt.id, // if unset, assume O implements HasId
8
8
  getOptionLabel = (opt) => opt.name, // if unset, assume O implements HasName
9
9
  options, onSelect, value, ...otherProps } = props;
10
- return ((0, jsx_runtime_1.jsx)(SelectFieldBase_1.SelectFieldBase, Object.assign({}, otherProps, { options: options, getOptionLabel: getOptionLabel, getOptionValue: getOptionValue, values: [value], onSelect: (values, options) => {
10
+ return ((0, jsx_runtime_1.jsx)(SelectFieldBase_1.SelectFieldBase, { ...otherProps, options: options, getOptionLabel: getOptionLabel, getOptionValue: getOptionValue, values: [value], onSelect: (values, options) => {
11
11
  if (values.length > 0 && options.length > 0) {
12
12
  const option = options[0];
13
13
  onSelect(values[0], option === SelectFieldBase_1.unsetOption ? undefined : option);
14
14
  }
15
- } }), void 0));
15
+ } }));
16
16
  }
17
17
  exports.SelectField = SelectField;
@@ -18,7 +18,7 @@ function SelectField(props) {
18
18
  setOptions(maybeOptions);
19
19
  }
20
20
  }, [maybeOptions]);
21
- return ((0, jsx_runtime_1.jsxs)("label", Object.assign({}, tid.label, { children: [label, (0, jsx_runtime_1.jsxs)("select", Object.assign({}, tid, { value:
21
+ return ((0, jsx_runtime_1.jsxs)("label", { ...tid.label, children: [label, (0, jsx_runtime_1.jsxs)("select", { ...tid, value:
22
22
  // @ts-ignore - allow `value` to be seen as a string
23
23
  value !== undefined && value !== "" && currentOption ? getOptionValue(currentOption) : "", onChange: (e) => {
24
24
  const option = options.find((o) => `${getOptionValue(o)}` === e.target.value) || options[0];
@@ -35,8 +35,8 @@ function SelectField(props) {
35
35
  onBlur();
36
36
  },
37
37
  // Read Only does not apply to `select` fields, instead we'll add in disabled for tests to verify.
38
- disabled: !!(disabled || readOnly), "data-error": !!errorMsg, "data-errormsg": errorMsg, "data-readonly": readOnly }, { children: [(0, jsx_runtime_1.jsx)("option", { disabled: true, value: "" }, void 0), options.map((option, i) => {
39
- return ((0, jsx_runtime_1.jsx)("option", Object.assign({ value: `${getOptionValue(option)}`, disabled: disabledOptions.includes(getOptionValue(option)) }, { children: getOptionLabel(option) }), i));
40
- })] }), void 0), helperText && (0, jsx_runtime_1.jsx)("div", Object.assign({}, tid.helperText, { children: helperText }), void 0)] }), void 0));
38
+ disabled: !!(disabled || readOnly), "data-error": !!errorMsg, "data-errormsg": errorMsg, "data-readonly": readOnly, children: [(0, jsx_runtime_1.jsx)("option", { disabled: true, value: "" }), options.map((option, i) => {
39
+ return ((0, jsx_runtime_1.jsx)("option", { value: `${getOptionValue(option)}`, disabled: disabledOptions.includes(getOptionValue(option)), children: getOptionLabel(option) }, i));
40
+ })] }), helperText && (0, jsx_runtime_1.jsx)("div", { ...tid.helperText, children: helperText })] }));
41
41
  }
42
42
  exports.SelectField = SelectField;
@@ -22,27 +22,27 @@ function Switch(props) {
22
22
  return (0, components_1.maybeTooltip)({
23
23
  title: tooltip,
24
24
  placement: "top",
25
- children: ((0, jsx_runtime_1.jsxs)("label", Object.assign({}, hoverProps, { css: {
25
+ children: ((0, jsx_runtime_1.jsxs)("label", { ...hoverProps, css: {
26
26
  ...Css_1.Css.relative.cursorPointer.df.w("max-content").smMd.selectNone.$,
27
27
  ...(labelStyle === "form" && Css_1.Css.fdc.$),
28
28
  ...(labelStyle === "inline" && Css_1.Css.gap2.aic.$),
29
29
  ...(labelStyle === "filter" && Css_1.Css.jcsb.gap1.aic.w("auto").sm.$),
30
30
  ...(isDisabled && Css_1.Css.cursorNotAllowed.gray400.$),
31
- }, "aria-label": label }, { children: [!hideLabel && labelStyle === "form" && (0, jsx_runtime_1.jsx)(Label_1.Label, { label: label }, void 0), !hideLabel && labelStyle === "filter" && (0, jsx_runtime_1.jsx)("span", { children: label }, void 0), (0, jsx_runtime_1.jsx)("div", Object.assign({ "aria-hidden": "true", css: {
31
+ }, "aria-label": label, children: [!hideLabel && labelStyle === "form" && (0, jsx_runtime_1.jsx)(Label_1.Label, { label: label }), !hideLabel && labelStyle === "filter" && (0, jsx_runtime_1.jsx)("span", { children: label }), (0, jsx_runtime_1.jsx)("div", { "aria-hidden": "true", css: {
32
32
  ...Css_1.Css.wPx(40).hPx(toggleHeight(compact)).bgGray200.br12.relative.transition.$,
33
33
  ...(isHovered && exports.switchHoverStyles),
34
34
  ...(isKeyboardFocus && exports.switchFocusStyles),
35
35
  ...(isDisabled && Css_1.Css.bgGray300.$),
36
36
  ...(isSelected && Css_1.Css.bgLightBlue700.$),
37
37
  ...(isSelected && isHovered && exports.switchSelectedHoverStyles),
38
- } }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ css: {
38
+ }, children: (0, jsx_runtime_1.jsx)("div", { css: {
39
39
  ...switchCircleDefaultStyles(compact),
40
40
  ...(isDisabled && Css_1.Css.bgGray100.$),
41
41
  ...(isSelected && switchCircleSelectedStyles(compact)),
42
- } }, { children: withIcon && ((0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: isSelected ? "check" : "x", color: isSelected ? Css_1.Palette.LightBlue700 : Css_1.Palette.Gray400 }, void 0)) }), void 0) }), void 0), !hideLabel && labelStyle === "inline" && ((0, jsx_runtime_1.jsx)("span", Object.assign({ css: {
42
+ }, children: withIcon && ((0, jsx_runtime_1.jsx)(Icon_1.Icon, { icon: isSelected ? "check" : "x", color: isSelected ? Css_1.Palette.LightBlue700 : Css_1.Palette.Gray400 })) }) }), !hideLabel && labelStyle === "inline" && ((0, jsx_runtime_1.jsx)("span", { css: {
43
43
  // LineHeight is conditionally applied to handle compact version text alignment
44
44
  ...Css_1.Css.if(compact).add("lineHeight", "1").$,
45
- } }, { children: label }), void 0)), (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", Object.assign({ ref: ref }, inputProps, focusProps), void 0) }, void 0)] }), void 0)),
45
+ }, children: label })), (0, jsx_runtime_1.jsx)(react_aria_1.VisuallyHidden, { children: (0, jsx_runtime_1.jsx)("input", { ref: ref, ...inputProps, ...focusProps }) })] })),
46
46
  });
47
47
  }
48
48
  exports.Switch = Switch;
@@ -1,4 +1,4 @@
1
- declare type GroupItem = {
1
+ type GroupItem = {
2
2
  label: string;
3
3
  value: string;
4
4
  };
@@ -19,6 +19,6 @@ function SwitchGroup(props) {
19
19
  const groupState = (0, utils_1.toGroupState)(values, onChange);
20
20
  const { groupProps, labelProps } = (0, react_aria_1.useCheckboxGroup)({ ...props, "aria-label": label }, groupState);
21
21
  const { isSelected, addValue, removeValue } = groupState;
22
- return ((0, jsx_runtime_1.jsxs)("fieldset", Object.assign({}, groupProps, { children: [(0, jsx_runtime_1.jsx)("legend", Object.assign({}, labelProps, { css: Css_1.Css.sm.gray500.mb1.$ }, { children: label }), void 0), (0, jsx_runtime_1.jsx)("div", Object.assign({ css: Css_1.Css.df.fdc.gap2.$ }, { children: options.map(({ label, value }) => ((0, jsx_runtime_1.jsx)(Switch_1.Switch, { compact: compact, label: label, onChange: (isSelected) => (isSelected ? addValue(value) : removeValue(value)), selected: isSelected(value), withIcon: withIcon }, value))) }), void 0)] }), void 0));
22
+ return ((0, jsx_runtime_1.jsxs)("fieldset", { ...groupProps, children: [(0, jsx_runtime_1.jsx)("legend", { ...labelProps, css: Css_1.Css.sm.gray500.mb1.$, children: label }), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.df.fdc.gap2.$, children: options.map(({ label, value }) => ((0, jsx_runtime_1.jsx)(Switch_1.Switch, { compact: compact, label: label, onChange: (isSelected) => (isSelected ? addValue(value) : removeValue(value)), selected: isSelected(value), withIcon: withIcon }, value))) })] }));
23
23
  }
24
24
  exports.SwitchGroup = SwitchGroup;
@@ -63,6 +63,6 @@ function TextAreaField(props) {
63
63
  }
64
64
  : {}),
65
65
  }, inputRef);
66
- return ((0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, Object.assign({}, (0, react_aria_1.mergeProps)(otherProps, { onBlur, onFocus }), { multiline: true, labelProps: labelProps, inputProps: inputProps, inputRef: inputRef, inputWrapRef: inputWrapRef, textAreaMinHeight: preventNewLines ? 0 : undefined, tooltip: (0, components_1.resolveTooltip)(disabled, undefined, readOnly) }), void 0));
66
+ return ((0, jsx_runtime_1.jsx)(TextFieldBase_1.TextFieldBase, { ...(0, react_aria_1.mergeProps)(otherProps, { onBlur, onFocus }), multiline: true, labelProps: labelProps, inputProps: inputProps, inputRef: inputRef, inputWrapRef: inputWrapRef, textAreaMinHeight: preventNewLines ? 0 : undefined, tooltip: (0, components_1.resolveTooltip)(disabled, undefined, readOnly) }));
67
67
  }
68
68
  exports.TextAreaField = TextAreaField;