@jobber/components 6.101.5-JOB-140604-4c8f8f2.41 → 6.101.5-JOB-140604-4487daa.55

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 (177) hide show
  1. package/dist/Autocomplete/Autocomplete.types.d.ts +11 -51
  2. package/dist/Autocomplete/components/MenuList.d.ts +3 -2
  3. package/dist/Autocomplete/components/PersistentRegion.d.ts +3 -2
  4. package/dist/Autocomplete/hooks/useAutocompleteListNav.d.ts +3 -2
  5. package/dist/Autocomplete/index.cjs +95 -51
  6. package/dist/Autocomplete/index.mjs +97 -53
  7. package/dist/Autocomplete/tests/Autocomplete.setup.d.ts +14 -1
  8. package/dist/Autocomplete/useAutocomplete.d.ts +4 -3
  9. package/dist/Autocomplete/utils/interactionUtils.d.ts +14 -0
  10. package/dist/Card-cjs.js +1 -1
  11. package/dist/Card-es.js +1 -1
  12. package/dist/Checkbox/Checkbox.rebuilt.d.ts +2 -2
  13. package/dist/Checkbox/Checkbox.types.d.ts +24 -18
  14. package/dist/Checkbox/index.cjs +9 -2
  15. package/dist/Checkbox/index.mjs +9 -2
  16. package/dist/Chip/Chip.d.ts +1 -2
  17. package/dist/Chip/hooks/useChildComponent.d.ts +4 -3
  18. package/dist/Chip/index.cjs +1 -1
  19. package/dist/Chip-cjs.js +5 -4
  20. package/dist/Chip-es.js +5 -4
  21. package/dist/ChipDismissible-cjs.js +4 -4
  22. package/dist/ChipDismissible-es.js +5 -5
  23. package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -2
  24. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -2
  25. package/dist/Chips/InternalChipDismissible/hooks/useInView.d.ts +1 -1
  26. package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissibleInput.d.ts +1 -1
  27. package/dist/Chips/InternalChipDismissible/hooks/useScrollToActive.d.ts +1 -1
  28. package/dist/Chips/InternalChipDismissible/index.cjs +2 -2
  29. package/dist/Chips/InternalChipDismissible/index.mjs +2 -2
  30. package/dist/Chips/index.cjs +2 -2
  31. package/dist/Chips/index.mjs +2 -2
  32. package/dist/Combobox/Combobox.d.ts +2 -1
  33. package/dist/Combobox/Combobox.types.d.ts +2 -2
  34. package/dist/Combobox/ComboboxProvider.d.ts +3 -3
  35. package/dist/Combobox/components/ComboboxActivator/ComboboxActivator.d.ts +1 -1
  36. package/dist/Combobox/components/ComboboxContent/ComboboxContent.d.ts +2 -1
  37. package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/ComboboxContentHeader.d.ts +2 -1
  38. package/dist/Combobox/components/ComboboxContent/ComboboxContentList/ComboboxContentList.d.ts +2 -1
  39. package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/ComboboxContentSearch.d.ts +2 -1
  40. package/dist/Combobox/hooks/useCombobox.d.ts +1 -1
  41. package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +2 -2
  42. package/dist/Combobox/hooks/useComboboxContent.d.ts +2 -1
  43. package/dist/Combobox/hooks/useMakeComboboxHandlers.d.ts +1 -1
  44. package/dist/ComboboxActivator-cjs.js +2 -2
  45. package/dist/ComboboxActivator-es.js +3 -3
  46. package/dist/ComboboxTrigger-cjs.js +1 -1
  47. package/dist/ComboboxTrigger-es.js +2 -2
  48. package/dist/DataList/DataList.types.d.ts +2 -2
  49. package/dist/DataList/DataList.utils.d.ts +2 -2
  50. package/dist/DataList/components/DataListHeader/index.cjs +1 -0
  51. package/dist/DataList/components/DataListHeader/index.mjs +1 -0
  52. package/dist/DataList/components/DataListHeaderTile/components/DataListSortingOptions.d.ts +2 -2
  53. package/dist/DataList/components/DataListItem/DataListItemInternal.d.ts +2 -2
  54. package/dist/DataList/components/DataListItem/index.cjs +1 -0
  55. package/dist/DataList/components/DataListItem/index.mjs +1 -0
  56. package/dist/DataList/components/DataListItems/index.cjs +1 -0
  57. package/dist/DataList/components/DataListItems/index.mjs +1 -0
  58. package/dist/DataList/components/DataListLayout/index.cjs +1 -0
  59. package/dist/DataList/components/DataListLayout/index.mjs +1 -0
  60. package/dist/DataList/components/DataListSearch/index.cjs +2 -12
  61. package/dist/DataList/components/DataListSearch/index.mjs +2 -12
  62. package/dist/DataList/hooks/useGetItemActions.d.ts +1 -1
  63. package/dist/DataList/index.cjs +1 -8
  64. package/dist/DataList/index.mjs +1 -8
  65. package/dist/DataListActions-cjs.js +4 -2
  66. package/dist/DataListActions-es.js +4 -2
  67. package/dist/DataListItem-cjs.js +8 -7
  68. package/dist/DataListItem-es.js +9 -8
  69. package/dist/DataListSort-cjs.js +1 -1
  70. package/dist/DataListSort-es.js +2 -2
  71. package/dist/DataTable/SortIcon.d.ts +2 -1
  72. package/dist/DataTable/components/DataTableSortableHeader.d.ts +1 -1
  73. package/dist/DataTable/index.cjs +3 -2
  74. package/dist/DataTable/index.mjs +3 -2
  75. package/dist/DatePicker/DatePicker.d.ts +5 -1
  76. package/dist/DatePicker/index.cjs +2 -2
  77. package/dist/DatePicker/index.mjs +2 -2
  78. package/dist/DatePicker/useFocusOnSelectedDate.d.ts +1 -2
  79. package/dist/DatePicker-cjs.js +4 -2
  80. package/dist/DatePicker-es.js +5 -3
  81. package/dist/FormField/FormFieldAffix.d.ts +2 -2
  82. package/dist/FormField/FormFieldTypes.d.ts +3 -5
  83. package/dist/FormField/FormFieldWrapper.d.ts +5 -1
  84. package/dist/FormField/hooks/useFormFieldFocus.d.ts +1 -1
  85. package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +9 -4
  86. package/dist/FormField-cjs.js +35 -31
  87. package/dist/FormField-es.js +35 -31
  88. package/dist/InputDate/InputDate.types.d.ts +12 -7
  89. package/dist/InputDate/index.cjs +35 -12
  90. package/dist/InputDate/index.mjs +35 -12
  91. package/dist/InputDate/useInputDateActivatorActions.d.ts +4 -8
  92. package/dist/InputEmail/InputEmail.types.d.ts +10 -20
  93. package/dist/InputEmail/hooks/useInputEmailActions.d.ts +10 -4
  94. package/dist/InputEmail/index.cjs +43 -60
  95. package/dist/InputEmail/index.mjs +44 -61
  96. package/dist/InputFile-cjs.js +5 -2
  97. package/dist/InputFile-es.js +5 -2
  98. package/dist/InputGroup-cjs.js +5 -2
  99. package/dist/InputGroup-es.js +5 -2
  100. package/dist/InputNumber/InputNumber.rebuilt.types.d.ts +7 -15
  101. package/dist/InputNumber/index.cjs +7 -5
  102. package/dist/InputNumber/index.mjs +7 -5
  103. package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +12 -28
  104. package/dist/InputPhoneNumber/hooks/useInputPhoneActions.d.ts +9 -4
  105. package/dist/InputPhoneNumber/index.cjs +37 -36
  106. package/dist/InputPhoneNumber/index.mjs +38 -37
  107. package/dist/InputText/InputText.d.ts +2 -2
  108. package/dist/InputText/InputText.types.d.ts +30 -25
  109. package/dist/InputText/index.cjs +54 -62
  110. package/dist/InputText/index.mjs +55 -63
  111. package/dist/InputText/useInputTextActions.d.ts +11 -5
  112. package/dist/InputText/useTextAreaResize.d.ts +2 -2
  113. package/dist/InputTime/InputTime.rebuilt.d.ts +1 -1
  114. package/dist/InputTime/InputTime.types.d.ts +13 -4
  115. package/dist/InputTime/hooks/useInputTimeActions.d.ts +21 -0
  116. package/dist/InputTime/index.cjs +90 -30
  117. package/dist/InputTime/index.mjs +93 -33
  118. package/dist/InternalChipDismissible-cjs.js +3 -3
  119. package/dist/InternalChipDismissible-es.js +4 -4
  120. package/dist/List/index.cjs +2 -2
  121. package/dist/List/index.mjs +2 -2
  122. package/dist/Menu/Menu.d.ts +2 -4
  123. package/dist/Menu/Menu.types.d.ts +21 -5
  124. package/dist/Menu-cjs.js +9 -9
  125. package/dist/Menu-es.js +9 -9
  126. package/dist/Modal/Modal.types.d.ts +3 -3
  127. package/dist/Modal/ModalContext.rebuilt.d.ts +2 -2
  128. package/dist/MultiSelect/DropDownMenu.d.ts +1 -1
  129. package/dist/MultiSelect/index.cjs +1 -0
  130. package/dist/MultiSelect/index.mjs +1 -0
  131. package/dist/MultiSelect-cjs.js +13 -7
  132. package/dist/MultiSelect-es.js +13 -7
  133. package/dist/RadioGroup/RadioGroup.d.ts +2 -1
  134. package/dist/RadioGroup/RadioOption.d.ts +1 -1
  135. package/dist/RecurringSelect/index.cjs +3 -2
  136. package/dist/RecurringSelect/index.mjs +3 -2
  137. package/dist/Select/Select.types.d.ts +7 -3
  138. package/dist/Select/hooks/useSelectActions.d.ts +5 -5
  139. package/dist/Select/index.cjs +27 -42
  140. package/dist/Select/index.mjs +29 -44
  141. package/dist/StatusLabel/StatusLabel.d.ts +2 -1
  142. package/dist/Tabs/hooks/useTabsOverflow.d.ts +2 -2
  143. package/dist/Tabs-cjs.js +4 -2
  144. package/dist/Tabs-es.js +5 -3
  145. package/dist/Tooltip/useTooltipPositioning.d.ts +1 -1
  146. package/dist/_baseEach-cjs.js +12 -12
  147. package/dist/_baseEach-es.js +1 -1
  148. package/dist/_baseFlatten-cjs.js +2 -2
  149. package/dist/_baseFlatten-es.js +1 -1
  150. package/dist/{_baseGet-cjs.js → _getAllKeys-cjs.js} +181 -181
  151. package/dist/{_baseGet-es.js → _getAllKeys-es.js} +182 -182
  152. package/dist/debounce-es.js +1 -1
  153. package/dist/filterDataAttributes-cjs.js +26 -0
  154. package/dist/filterDataAttributes-es.js +24 -0
  155. package/dist/floating-ui.react-cjs.js +115 -0
  156. package/dist/floating-ui.react-es.js +115 -1
  157. package/dist/helpers-cjs.js +1 -1
  158. package/dist/helpers-es.js +1 -1
  159. package/dist/index.cjs +4 -3
  160. package/dist/index.mjs +3 -2
  161. package/dist/omit-cjs.js +14 -14
  162. package/dist/omit-es.js +1 -1
  163. package/dist/sharedHelpers/filterDataAttributes.d.ts +17 -0
  164. package/dist/sharedHelpers/types.d.ts +231 -0
  165. package/dist/showToast-cjs.js +2 -2
  166. package/dist/showToast-es.js +2 -2
  167. package/dist/styles.css +32 -23
  168. package/dist/useChildComponent-cjs.js +1 -1
  169. package/dist/useChildComponent-es.js +1 -1
  170. package/dist/useScrollToActive-cjs.js +3 -3
  171. package/dist/useScrollToActive-es.js +2 -2
  172. package/dist/utils/mergeRefs.d.ts +2 -2
  173. package/package.json +3 -3
  174. package/dist/InputEmail/hooks/useInputEmailFormField.d.ts +0 -32
  175. package/dist/InputPhoneNumber/hooks/useInputPhoneFormField.d.ts +0 -71
  176. package/dist/InputText/useInputTextFormField.d.ts +0 -352
  177. package/dist/Select/hooks/useSelectFormField.d.ts +0 -34
@@ -8,13 +8,13 @@ import { F as FloatingPortal } from './floating-ui.react-es.js';
8
8
  import { T as Text } from './Text-es.js';
9
9
  import { B as Button } from './Button-es.js';
10
10
  import { S as Spinner } from './Spinner-es.js';
11
- import { C as ChipNamespace, I as InternalChipButton } from './Chip-es.js';
11
+ import { C as Chip, I as InternalChipButton } from './Chip-es.js';
12
12
  import './tslib.es6-es.js';
13
13
 
14
14
  function InternalChip({ label, active = false, disabled = false, invalid = false, prefix, suffix, tabIndex, ariaLabel, onClick, onKeyDown, }) {
15
- return (React__default.createElement(ChipNamespace, { disabled: disabled, invalid: invalid, onKeyDown: onKeyDown, testID: "ATL-InternalChip", ariaLabel: ariaLabel, tabIndex: tabIndex, variation: active ? "base" : "subtle", role: tabIndex !== undefined ? "option" : undefined, onClick: onClick ? (_, ev) => onClick(ev) : undefined, label: label },
16
- prefix && React__default.createElement(ChipNamespace.Prefix, null, prefix),
17
- suffix && React__default.createElement(ChipNamespace.Suffix, null, suffix)));
15
+ return (React__default.createElement(Chip, { disabled: disabled, invalid: invalid, onKeyDown: onKeyDown, testID: "ATL-InternalChip", ariaLabel: ariaLabel, tabIndex: tabIndex, variation: active ? "base" : "subtle", role: tabIndex !== undefined ? "option" : undefined, onClick: onClick ? (_, ev) => onClick(ev) : undefined, label: label },
16
+ prefix && React__default.createElement(Chip.Prefix, null, prefix),
17
+ suffix && React__default.createElement(Chip.Suffix, null, suffix)));
18
18
  }
19
19
 
20
20
  var styles = {"wrapper":"XRnU90M2-fs-","input":"Dq-yFHd1zK0-","menu":"F7CpurjKzBI-","menuListOption":"_9SAK31TqNDY-","loadingIndicator":"s5vFJVv0t0Q-","activeOption":"_8d0w-JzgzS4-","spinning":"hDJGLX6kE-U-"};
@@ -8,9 +8,9 @@ require('../identity-cjs.js');
8
8
  require('../isTypedArray-cjs.js');
9
9
  require('../isObjectLike-cjs.js');
10
10
  require('../_commonjsHelpers-cjs.js');
11
- require('../_baseGet-cjs.js');
12
- require('../_getTag-cjs.js');
11
+ require('../_getAllKeys-cjs.js');
13
12
  require('../isSymbol-cjs.js');
13
+ require('../_getTag-cjs.js');
14
14
  require('../_baseFor-cjs.js');
15
15
  require('../_baseAssignValue-cjs.js');
16
16
  require('../Typography-cjs.js');
@@ -6,9 +6,9 @@ import '../identity-es.js';
6
6
  import '../isTypedArray-es.js';
7
7
  import '../isObjectLike-es.js';
8
8
  import '../_commonjsHelpers-es.js';
9
- import '../_baseGet-es.js';
10
- import '../_getTag-es.js';
9
+ import '../_getAllKeys-es.js';
11
10
  import '../isSymbol-es.js';
11
+ import '../_getTag-es.js';
12
12
  import '../_baseFor-es.js';
13
13
  import '../_baseAssignValue-es.js';
14
14
  import '../Typography-es.js';
@@ -1,6 +1,6 @@
1
1
  import type { ReactElement } from "react";
2
2
  import React from "react";
3
- import type { MenuComposableProps, MenuContentComposableProps, MenuHeaderComposableProps, MenuItemComposableProps, MenuItemIconComposableProps, MenuLegacyProps, MenuSectionComposableProps, MenuSeparatorComposableProps, MenuTriggerComposableProps } from "./Menu.types";
3
+ import type { MenuComposableProps, MenuContentComposableProps, MenuHeaderComposableProps, MenuItemComposableProps, MenuItemIconComposableProps, MenuItemLabelComposableProps, MenuLegacyProps, MenuSectionComposableProps, MenuSeparatorComposableProps, MenuTriggerComposableProps } from "./Menu.types";
4
4
  export declare function Menu(props: MenuLegacyProps): ReactElement;
5
5
  export declare function Menu(props: MenuComposableProps): ReactElement;
6
6
  export declare namespace Menu {
@@ -20,9 +20,7 @@ declare function MenuSeparatorComposable({ UNSAFE_style, UNSAFE_className, }: Me
20
20
  declare function MenuSectionComposable({ children, UNSAFE_style, UNSAFE_className, ariaLabel, }: MenuSectionComposableProps): React.JSX.Element;
21
21
  declare function MenuHeaderComposable(props: MenuHeaderComposableProps): React.JSX.Element;
22
22
  declare function MenuItemIconComposable(props: MenuItemIconComposableProps): React.JSX.Element;
23
- declare function MenuItemLabelComposable(props: {
24
- readonly children: string;
25
- }): React.JSX.Element;
23
+ declare function MenuItemLabelComposable(props: MenuItemLabelComposableProps): React.JSX.Element;
26
24
  declare function MenuHeaderLabel(props: {
27
25
  readonly children: React.ReactNode;
28
26
  }): React.JSX.Element;
@@ -1,12 +1,18 @@
1
1
  import type { IconColorNames, IconNames } from "@jobber/design";
2
2
  import type React from "react";
3
- import type { CSSProperties, ReactElement, ReactNode } from "react";
3
+ import type { CSSProperties, ComponentProps, ReactElement, ReactNode } from "react";
4
+ import type { Pressable as AriaPressable } from "react-aria-components";
4
5
  import type { IconProps } from "../Icon";
6
+ type PressableChild = ComponentProps<typeof AriaPressable>["children"];
5
7
  export interface MenuLegacyProps extends MenuBaseProps {
6
8
  /**
7
9
  * Custom menu activator. If this is not provided a default [… More] will be used.
8
10
  */
9
- readonly activator?: ReactElement;
11
+ readonly activator?: ReactElement<{
12
+ fullWidth?: boolean;
13
+ onClick?: (event?: React.MouseEvent) => void;
14
+ [key: string]: unknown;
15
+ }>;
10
16
  /**
11
17
  * Collection of action items.
12
18
  */
@@ -128,11 +134,12 @@ export interface MenuSectionComposableProps extends UnsafeProps {
128
134
  export interface MenuHeaderComposableProps extends UnsafeProps {
129
135
  readonly children: ReactNode;
130
136
  }
137
+ type MenuItemVariants = "destructive";
131
138
  export interface MenuItemComposableProps extends UnsafeProps {
132
139
  /**
133
- * Apply destructive styling to the item label and icon.
140
+ * Visual style variations for the MenuItem default content.
134
141
  */
135
- readonly destructive?: boolean;
142
+ readonly variation?: MenuItemVariants;
136
143
  /**
137
144
  * Item content.
138
145
  */
@@ -172,7 +179,7 @@ export interface MenuTriggerComposableProps {
172
179
  * If you want to access the open event, use the onOpenChange on the Menu component.
173
180
  * If it does not have an interactive role, or a focus style it will have issues.
174
181
  */
175
- readonly children: ReactNode;
182
+ readonly children: PressableChild;
176
183
  }
177
184
  export interface MenuSeparatorComposableProps extends UnsafeProps {
178
185
  }
@@ -180,4 +187,13 @@ export type AnimationState = "unmounted" | "hidden" | "visible";
180
187
  export interface MenuMobileUnderlayProps {
181
188
  readonly animation: AnimationState;
182
189
  }
190
+ export interface MenuItemLabelComposableProps {
191
+ /**
192
+ * Item label content.
193
+ * This is rendered inside a Typography (span) component, so you MUST supply either
194
+ * a string or a fragment/utility component that renders down to a raw string (e.g.
195
+ * translation helpers).
196
+ */
197
+ readonly children: React.ReactNode;
198
+ }
183
199
  export {};
package/dist/Menu-cjs.js CHANGED
@@ -87,7 +87,7 @@ const composeOverlayVariation = {
87
87
  hidden: { opacity: 0 },
88
88
  visible: { opacity: 1 },
89
89
  };
90
- const variation = {
90
+ const animationVariation = {
91
91
  overlayStartStop: { opacity: 0 },
92
92
  startOrStop: (placement) => {
93
93
  let y = Y_TRANSLATION_DESKTOP;
@@ -206,14 +206,14 @@ function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
206
206
  })),
207
207
  React.createElement(MenuPortal, null,
208
208
  React.createElement(framerMotion.AnimatePresence, null, visible && (React.createElement(React.Fragment, null,
209
- React.createElement(framerMotion.motion.div, { className: styles.overlay, onClick: toggle(), variants: variation, initial: "overlayStartStop", animate: "done", exit: "overlayStartStop", transition: Object.assign({}, OVERLAY_ANIMATION_CONFIG) }),
209
+ React.createElement(framerMotion.motion.div, { className: styles.overlay, onClick: toggle(), variants: animationVariation, initial: "overlayStartStop", animate: "done", exit: "overlayStartStop", transition: Object.assign({}, OVERLAY_ANIMATION_CONFIG) }),
210
210
  React.createElement("div", Object.assign({ ref: refs.setFloating, className: styles.floatingContainer }, getFloatingProps({
211
211
  onKeyDown: event => {
212
212
  if (event.key === "Tab") {
213
213
  event.preventDefault();
214
214
  }
215
215
  },
216
- }), positionAttributes, useFormFieldFocus.formFieldFocusAttribute), items.length > 0 && (React.createElement(framerMotion.motion.div, { className: classnames(styles.menu, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.menu), role: "menu", "data-elevation": "elevated", "aria-labelledby": buttonID, id: menuID, onClick: hide, variants: variation, initial: "startOrStop", animate: "done", exit: "startOrStop", custom: context === null || context === void 0 ? void 0 : context.placement, transition: Object.assign({}, MENU_ANIMATION_CONFIG), style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.menu }, renderedSections)))))))));
216
+ }), positionAttributes, useFormFieldFocus.formFieldFocusAttribute), items.length > 0 && (React.createElement(framerMotion.motion.div, { className: classnames(styles.menu, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.menu), role: "menu", "data-elevation": "elevated", "aria-labelledby": buttonID, id: menuID, onClick: hide, variants: animationVariation, initial: "startOrStop", animate: "done", exit: "startOrStop", custom: context === null || context === void 0 ? void 0 : context.placement, transition: Object.assign({}, MENU_ANIMATION_CONFIG), style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.menu }, renderedSections)))))))));
217
217
  function toggle(callbackPassthrough) {
218
218
  return (event) => {
219
219
  setVisible(!visible);
@@ -348,14 +348,14 @@ const MenuItemComposable = React.forwardRef(function MenuItemComposable(props, r
348
348
  if (props.href) {
349
349
  const { href, target, rel, onClick } = props;
350
350
  return (React.createElement(Tree.$3674c52c6b3c5bce$export$2ce376c2cc3355c8, { ref: ref, className: className, style: UNSAFE_style, textValue: props.textValue, href: href, target: target, rel: rel, onClick: onClick },
351
- React.createElement(MenuItemContext.Provider, { value: { destructive: props.destructive } }, props.children)));
351
+ React.createElement(MenuItemContext.Provider, { value: { variation: props.variation } }, props.children)));
352
352
  }
353
353
  return (React.createElement(Tree.$3674c52c6b3c5bce$export$2ce376c2cc3355c8, { ref: ref, className: className, style: UNSAFE_style, textValue: props.textValue, onAction: () => {
354
354
  var _a;
355
355
  // Zero-arg activation for non-link items
356
356
  (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
357
357
  } },
358
- React.createElement(MenuItemContext.Provider, { value: { destructive: props.destructive } }, props.children)));
358
+ React.createElement(MenuItemContext.Provider, { value: { variation: props.variation } }, props.children)));
359
359
  });
360
360
  const MenuItemContext = React.createContext(null);
361
361
  function useMenuItemContext() {
@@ -363,14 +363,14 @@ function useMenuItemContext() {
363
363
  return ctx !== null && ctx !== void 0 ? ctx : {};
364
364
  }
365
365
  function MenuItemIconComposable(props) {
366
- const { destructive } = useMenuItemContext();
366
+ const { variation } = useMenuItemContext();
367
367
  return (React.createElement("div", { "data-menu-slot": "icon" },
368
- React.createElement(Icon.Icon, Object.assign({}, props, { color: destructive ? "destructive" : props.color }))));
368
+ React.createElement(Icon.Icon, Object.assign({}, props, { color: variation === "destructive" ? "destructive" : props.color }))));
369
369
  }
370
370
  function MenuItemLabelComposable(props) {
371
- const { destructive } = useMenuItemContext();
371
+ const { variation } = useMenuItemContext();
372
372
  return (React.createElement("div", { "data-menu-slot": "label" },
373
- React.createElement(Typography.Typography, { element: "span", fontWeight: "semiBold", textColor: destructive ? "destructive" : "text" }, props.children)));
373
+ React.createElement(Typography.Typography, { element: "span", fontWeight: "semiBold", textColor: variation === "destructive" ? "destructive" : "text" }, props.children)));
374
374
  }
375
375
  function MenuHeaderLabel(props) {
376
376
  return React.createElement(DefaultHeaderContent, null, props.children);
package/dist/Menu-es.js CHANGED
@@ -85,7 +85,7 @@ const composeOverlayVariation = {
85
85
  hidden: { opacity: 0 },
86
86
  visible: { opacity: 1 },
87
87
  };
88
- const variation = {
88
+ const animationVariation = {
89
89
  overlayStartStop: { opacity: 0 },
90
90
  startOrStop: (placement) => {
91
91
  let y = Y_TRANSLATION_DESKTOP;
@@ -204,14 +204,14 @@ function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
204
204
  })),
205
205
  React__default.createElement(MenuPortal, null,
206
206
  React__default.createElement(AnimatePresence, null, visible && (React__default.createElement(React__default.Fragment, null,
207
- React__default.createElement(motion.div, { className: styles.overlay, onClick: toggle(), variants: variation, initial: "overlayStartStop", animate: "done", exit: "overlayStartStop", transition: Object.assign({}, OVERLAY_ANIMATION_CONFIG) }),
207
+ React__default.createElement(motion.div, { className: styles.overlay, onClick: toggle(), variants: animationVariation, initial: "overlayStartStop", animate: "done", exit: "overlayStartStop", transition: Object.assign({}, OVERLAY_ANIMATION_CONFIG) }),
208
208
  React__default.createElement("div", Object.assign({ ref: refs.setFloating, className: styles.floatingContainer }, getFloatingProps({
209
209
  onKeyDown: event => {
210
210
  if (event.key === "Tab") {
211
211
  event.preventDefault();
212
212
  }
213
213
  },
214
- }), positionAttributes, formFieldFocusAttribute), items.length > 0 && (React__default.createElement(motion.div, { className: classnames(styles.menu, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.menu), role: "menu", "data-elevation": "elevated", "aria-labelledby": buttonID, id: menuID, onClick: hide, variants: variation, initial: "startOrStop", animate: "done", exit: "startOrStop", custom: context === null || context === void 0 ? void 0 : context.placement, transition: Object.assign({}, MENU_ANIMATION_CONFIG), style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.menu }, renderedSections)))))))));
214
+ }), positionAttributes, formFieldFocusAttribute), items.length > 0 && (React__default.createElement(motion.div, { className: classnames(styles.menu, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.menu), role: "menu", "data-elevation": "elevated", "aria-labelledby": buttonID, id: menuID, onClick: hide, variants: animationVariation, initial: "startOrStop", animate: "done", exit: "startOrStop", custom: context === null || context === void 0 ? void 0 : context.placement, transition: Object.assign({}, MENU_ANIMATION_CONFIG), style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.menu }, renderedSections)))))))));
215
215
  function toggle(callbackPassthrough) {
216
216
  return (event) => {
217
217
  setVisible(!visible);
@@ -346,14 +346,14 @@ const MenuItemComposable = React__default.forwardRef(function MenuItemComposable
346
346
  if (props.href) {
347
347
  const { href, target, rel, onClick } = props;
348
348
  return (React__default.createElement($3674c52c6b3c5bce$export$2ce376c2cc3355c8, { ref: ref, className: className, style: UNSAFE_style, textValue: props.textValue, href: href, target: target, rel: rel, onClick: onClick },
349
- React__default.createElement(MenuItemContext.Provider, { value: { destructive: props.destructive } }, props.children)));
349
+ React__default.createElement(MenuItemContext.Provider, { value: { variation: props.variation } }, props.children)));
350
350
  }
351
351
  return (React__default.createElement($3674c52c6b3c5bce$export$2ce376c2cc3355c8, { ref: ref, className: className, style: UNSAFE_style, textValue: props.textValue, onAction: () => {
352
352
  var _a;
353
353
  // Zero-arg activation for non-link items
354
354
  (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
355
355
  } },
356
- React__default.createElement(MenuItemContext.Provider, { value: { destructive: props.destructive } }, props.children)));
356
+ React__default.createElement(MenuItemContext.Provider, { value: { variation: props.variation } }, props.children)));
357
357
  });
358
358
  const MenuItemContext = createContext(null);
359
359
  function useMenuItemContext() {
@@ -361,14 +361,14 @@ function useMenuItemContext() {
361
361
  return ctx !== null && ctx !== void 0 ? ctx : {};
362
362
  }
363
363
  function MenuItemIconComposable(props) {
364
- const { destructive } = useMenuItemContext();
364
+ const { variation } = useMenuItemContext();
365
365
  return (React__default.createElement("div", { "data-menu-slot": "icon" },
366
- React__default.createElement(Icon, Object.assign({}, props, { color: destructive ? "destructive" : props.color }))));
366
+ React__default.createElement(Icon, Object.assign({}, props, { color: variation === "destructive" ? "destructive" : props.color }))));
367
367
  }
368
368
  function MenuItemLabelComposable(props) {
369
- const { destructive } = useMenuItemContext();
369
+ const { variation } = useMenuItemContext();
370
370
  return (React__default.createElement("div", { "data-menu-slot": "label" },
371
- React__default.createElement(Typography, { element: "span", fontWeight: "semiBold", textColor: destructive ? "destructive" : "text" }, props.children)));
371
+ React__default.createElement(Typography, { element: "span", fontWeight: "semiBold", textColor: variation === "destructive" ? "destructive" : "text" }, props.children)));
372
372
  }
373
373
  function MenuHeaderLabel(props) {
374
374
  return React__default.createElement(DefaultHeaderContent, null, props.children);
@@ -1,4 +1,4 @@
1
- import type { MutableRefObject, PropsWithChildren, ReactNode } from "react";
1
+ import type { PropsWithChildren, ReactNode, RefObject } from "react";
2
2
  import type { ExtendedRefs, FloatingContext, ReferenceType, UseInteractionsReturn } from "@floating-ui/react";
3
3
  import type { XOR } from "ts-xor";
4
4
  import type sizes from "./ModalSizes.module.css";
@@ -18,7 +18,7 @@ export interface ModalContextType {
18
18
  * Ref to specify the activator element. Useful if the activator can unmount
19
19
  * and needs to be re-mounted.
20
20
  */
21
- readonly activatorRef?: MutableRefObject<HTMLElement | null> | null;
21
+ readonly activatorRef?: RefObject<HTMLElement | null>;
22
22
  /**
23
23
  * Refs used by floating-ui to position the modal.
24
24
  */
@@ -57,7 +57,7 @@ export interface ModalContextType {
57
57
  * Tracks whether the current pointer interaction began inside the dialog.
58
58
  * Used to disambiguate outsidePress after nested overlay closes.
59
59
  */
60
- readonly startedInsideRef?: MutableRefObject<boolean>;
60
+ readonly startedInsideRef?: RefObject<boolean>;
61
61
  }
62
62
  export interface ModalActionsProps {
63
63
  /**
@@ -1,4 +1,4 @@
1
- import type { MutableRefObject } from "react";
1
+ import type { RefObject } from "react";
2
2
  import React from "react";
3
3
  import type sizes from "./ModalSizes.module.css";
4
4
  import type { ModalContextType } from "./Modal.types";
@@ -8,7 +8,7 @@ export interface ModalProviderProps {
8
8
  readonly size?: keyof typeof sizes;
9
9
  readonly open?: boolean;
10
10
  readonly onRequestClose?: () => void;
11
- readonly activatorRef?: MutableRefObject<HTMLElement | null> | null;
11
+ readonly activatorRef?: RefObject<HTMLElement | null>;
12
12
  readonly dismissible?: boolean;
13
13
  readonly modalLabelledBy?: string;
14
14
  readonly ariaLabel?: string;
@@ -1,5 +1,5 @@
1
- import type { Dispatch } from "react";
2
1
  import React from "react";
2
+ import type { Dispatch } from "react";
3
3
  import type { Options } from "./types";
4
4
  interface DropDownMenuProps {
5
5
  /**
@@ -10,6 +10,7 @@ require('../Icon-cjs.js');
10
10
  require('@jobber/design');
11
11
  require('../Text-cjs.js');
12
12
  require('../Typography-cjs.js');
13
+ require('../filterDataAttributes-cjs.js');
13
14
 
14
15
 
15
16
 
@@ -8,3 +8,4 @@ import '../Icon-es.js';
8
8
  import '@jobber/design';
9
9
  import '../Text-es.js';
10
10
  import '../Typography-es.js';
11
+ import '../filterDataAttributes-es.js';
@@ -12,7 +12,7 @@ var styles = {"dropDownMenuContainer":"zossMHCpMPU-","option":"poS49c-LqiU-","ac
12
12
 
13
13
  function DropDownMenu({ options, setOptions }) {
14
14
  const [highlightedIndex, setHighlightedIndex] = React.useState(0);
15
- const menuDiv = React.useRef();
15
+ const menuDiv = React.useRef(null);
16
16
  const handleOptionClick = React.useCallback((clickedOption) => {
17
17
  setOptions(current => current.map(option => {
18
18
  if (option.label == clickedOption.label) {
@@ -87,13 +87,17 @@ function DropDownMenu({ options, setOptions }) {
87
87
  event.preventDefault();
88
88
  const newIndex = Math.max(0, highlightedIndex - 1);
89
89
  handleOptionFocus(newIndex);
90
- scrollMenuIfItemNotInView(menuDiv.current, "up");
90
+ if (menuDiv.current) {
91
+ scrollMenuIfItemNotInView(menuDiv.current, "up");
92
+ }
91
93
  }
92
94
  function handlePressDown(event) {
93
95
  event.preventDefault();
94
96
  const newIndex = Math.min(options.length - 1, highlightedIndex + 1);
95
97
  handleOptionFocus(newIndex);
96
- scrollMenuIfItemNotInView(menuDiv.current, "down");
98
+ if (menuDiv.current) {
99
+ scrollMenuIfItemNotInView(menuDiv.current, "down");
100
+ }
97
101
  }
98
102
  }
99
103
 
@@ -101,15 +105,16 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
101
105
  const [label, setLabel] = React.useState(defaultLabel);
102
106
  const [menuVisible, setMenuVisible] = React.useState(false);
103
107
  const [focused, setFocused] = React.useState(false);
104
- const multiSelectContainer = React.useRef();
105
- const multiSelectRef = React.useRef();
108
+ const multiSelectContainer = React.useRef(null);
109
+ const multiSelectRef = React.useRef(null);
106
110
  const multiSelectClass = classnames(styles$1.multiSelect, {
107
111
  [styles$1.active]: menuVisible,
108
112
  [styles$1.large]: size === "large",
109
113
  [styles$1.small]: size === "small",
110
114
  });
111
115
  function handleMenuVisibility() {
112
- multiSelectRef.current.focus();
116
+ var _a;
117
+ (_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
113
118
  setMenuVisible(!menuVisible);
114
119
  }
115
120
  const handleClickOutside = (e) => {
@@ -119,6 +124,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
119
124
  }
120
125
  };
121
126
  function handleKeydown(event) {
127
+ var _a;
122
128
  const { key, metaKey, ctrlKey } = event;
123
129
  if (metaKey || ctrlKey)
124
130
  return;
@@ -131,7 +137,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
131
137
  break;
132
138
  }
133
139
  case "Escape": {
134
- multiSelectRef.current.focus();
140
+ (_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
135
141
  setMenuVisible(false);
136
142
  break;
137
143
  }
@@ -10,7 +10,7 @@ var styles = {"dropDownMenuContainer":"zossMHCpMPU-","option":"poS49c-LqiU-","ac
10
10
 
11
11
  function DropDownMenu({ options, setOptions }) {
12
12
  const [highlightedIndex, setHighlightedIndex] = useState(0);
13
- const menuDiv = useRef();
13
+ const menuDiv = useRef(null);
14
14
  const handleOptionClick = useCallback((clickedOption) => {
15
15
  setOptions(current => current.map(option => {
16
16
  if (option.label == clickedOption.label) {
@@ -85,13 +85,17 @@ function DropDownMenu({ options, setOptions }) {
85
85
  event.preventDefault();
86
86
  const newIndex = Math.max(0, highlightedIndex - 1);
87
87
  handleOptionFocus(newIndex);
88
- scrollMenuIfItemNotInView(menuDiv.current, "up");
88
+ if (menuDiv.current) {
89
+ scrollMenuIfItemNotInView(menuDiv.current, "up");
90
+ }
89
91
  }
90
92
  function handlePressDown(event) {
91
93
  event.preventDefault();
92
94
  const newIndex = Math.min(options.length - 1, highlightedIndex + 1);
93
95
  handleOptionFocus(newIndex);
94
- scrollMenuIfItemNotInView(menuDiv.current, "down");
96
+ if (menuDiv.current) {
97
+ scrollMenuIfItemNotInView(menuDiv.current, "down");
98
+ }
95
99
  }
96
100
  }
97
101
 
@@ -99,15 +103,16 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
99
103
  const [label, setLabel] = useState(defaultLabel);
100
104
  const [menuVisible, setMenuVisible] = useState(false);
101
105
  const [focused, setFocused] = useState(false);
102
- const multiSelectContainer = useRef();
103
- const multiSelectRef = useRef();
106
+ const multiSelectContainer = useRef(null);
107
+ const multiSelectRef = useRef(null);
104
108
  const multiSelectClass = classnames(styles$1.multiSelect, {
105
109
  [styles$1.active]: menuVisible,
106
110
  [styles$1.large]: size === "large",
107
111
  [styles$1.small]: size === "small",
108
112
  });
109
113
  function handleMenuVisibility() {
110
- multiSelectRef.current.focus();
114
+ var _a;
115
+ (_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
111
116
  setMenuVisible(!menuVisible);
112
117
  }
113
118
  const handleClickOutside = (e) => {
@@ -117,6 +122,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
117
122
  }
118
123
  };
119
124
  function handleKeydown(event) {
125
+ var _a;
120
126
  const { key, metaKey, ctrlKey } = event;
121
127
  if (metaKey || ctrlKey)
122
128
  return;
@@ -129,7 +135,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
129
135
  break;
130
136
  }
131
137
  case "Escape": {
132
- multiSelectRef.current.focus();
138
+ (_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
133
139
  setMenuVisible(false);
134
140
  break;
135
141
  }
@@ -1,7 +1,8 @@
1
1
  import type { ReactElement } from "react";
2
2
  import React from "react";
3
+ import type { RadioOptionProps } from "./RadioOption";
3
4
  export interface RadioGroupProps {
4
- readonly children: ReactElement | ReactElement[];
5
+ readonly children: ReactElement<RadioOptionProps> | ReactElement<RadioOptionProps>[];
5
6
  /**
6
7
  * Defines the default value that will be pre-selected in the radio group.
7
8
  */
@@ -33,7 +33,7 @@ interface WithRequiredChildren extends BaseRadioOptionProps {
33
33
  interface WithRequiredLabel extends BaseRadioOptionProps {
34
34
  readonly label: string;
35
35
  }
36
- type RadioOptionProps = XOR<WithRequiredChildren, WithRequiredLabel>;
36
+ export type RadioOptionProps = XOR<WithRequiredChildren, WithRequiredLabel>;
37
37
  /**
38
38
  * For rendering props only. To make updates to
39
39
  * the real RadioOption, look at InternalRadioOption
@@ -9,12 +9,12 @@ require('classnames');
9
9
  require('../Select/index.cjs');
10
10
  require('../omit-cjs.js');
11
11
  require('../_commonjsHelpers-cjs.js');
12
- require('../_baseGet-cjs.js');
12
+ require('../_getAllKeys-cjs.js');
13
13
  require('../isTypedArray-cjs.js');
14
14
  require('../isObjectLike-cjs.js');
15
+ require('../isSymbol-cjs.js');
15
16
  require('../identity-cjs.js');
16
17
  require('../_getTag-cjs.js');
17
- require('../isSymbol-cjs.js');
18
18
  require('../keysIn-cjs.js');
19
19
  require('../_baseAssignValue-cjs.js');
20
20
  require('../_baseFlatten-cjs.js');
@@ -31,6 +31,7 @@ require('../useFormFieldFocus-cjs.js');
31
31
  require('../InputValidation-cjs.js');
32
32
  require('../Spinner-cjs.js');
33
33
  require('react-hook-form');
34
+ require('../filterDataAttributes-cjs.js');
34
35
  require('../InputNumber/index.cjs');
35
36
  require('../Tree-cjs.js');
36
37
  require('react-dom');
@@ -7,12 +7,12 @@ import 'classnames';
7
7
  import '../Select/index.mjs';
8
8
  import '../omit-es.js';
9
9
  import '../_commonjsHelpers-es.js';
10
- import '../_baseGet-es.js';
10
+ import '../_getAllKeys-es.js';
11
11
  import '../isTypedArray-es.js';
12
12
  import '../isObjectLike-es.js';
13
+ import '../isSymbol-es.js';
13
14
  import '../identity-es.js';
14
15
  import '../_getTag-es.js';
15
- import '../isSymbol-es.js';
16
16
  import '../keysIn-es.js';
17
17
  import '../_baseAssignValue-es.js';
18
18
  import '../_baseFlatten-es.js';
@@ -29,6 +29,7 @@ import '../useFormFieldFocus-es.js';
29
29
  import '../InputValidation-es.js';
30
30
  import '../Spinner-es.js';
31
31
  import 'react-hook-form';
32
+ import '../filterDataAttributes-es.js';
32
33
  import '../InputNumber/index.mjs';
33
34
  import '../Tree-es.js';
34
35
  import 'react-dom';
@@ -1,4 +1,5 @@
1
1
  import type { CommonFormFieldProps, FormFieldProps } from "../FormField";
2
+ import type { FocusEvents, HTMLInputBaseProps, RebuiltInputCommonProps } from "../sharedHelpers/types";
2
3
  export interface SelectLegacyProps extends Pick<CommonFormFieldProps, "id" | "align" | "description" | "disabled" | "invalid" | "inline" | "name" | "onValidation" | "placeholder" | "size" | "value" | "onChange">, Pick<FormFieldProps, "autofocus" | "onEnter" | "onBlur" | "onFocus" | "inputRef" | "wrapperRef" | "validations" | "children" | "prefix" | "suffix" | "defaultValue" | "version"> {
3
4
  /**
4
5
  * Changes the width to roughly the same size as the maximum character length
@@ -8,12 +9,15 @@ export interface SelectLegacyProps extends Pick<CommonFormFieldProps, "id" | "al
8
9
  /**
9
10
  * Rebuilt version of the Select component without React Hook Form dependency.
10
11
  */
11
- export interface SelectRebuiltProps extends Omit<SelectLegacyProps, "defaultValue" | "version" | "onChange" | "value" | "validations" | "onValidation"> {
12
+ export interface SelectRebuiltProps extends Omit<HTMLInputBaseProps, "readOnly">, FocusEvents<HTMLSelectElement>, Omit<RebuiltInputCommonProps, "clearable" | "prefix" | "suffix" | "align">, Pick<SelectLegacyProps, "prefix" | "suffix" | "align" | "children"> {
12
13
  defaultValue?: never;
13
14
  readonly value?: string | number;
14
15
  onChange?(newValue?: string | number): void;
15
- version: 2;
16
- error?: string;
16
+ readonly inputRef?: FormFieldProps["inputRef"];
17
+ /**
18
+ * @deprecated Use `onKeyDown` or `onKeyUp` instead.
19
+ */
20
+ readonly onEnter?: FormFieldProps["onEnter"];
17
21
  /**
18
22
  * Opt-in to the customizable select UI (Chromium 123+).
19
23
  * When true, the component will apply the custom select styles
@@ -1,15 +1,15 @@
1
- import type { ChangeEvent } from "react";
1
+ import type { ChangeEvent, FocusEvent } from "react";
2
2
  interface UseSelectActionsProps {
3
3
  readonly onChange?: (newValue: string | number, event?: ChangeEvent<HTMLSelectElement>) => void;
4
- readonly onBlur?: () => void;
5
- readonly onFocus?: () => void;
4
+ readonly onBlur?: (event: FocusEvent<HTMLSelectElement>) => void;
5
+ readonly onFocus?: (event: FocusEvent<HTMLSelectElement>) => void;
6
6
  }
7
7
  /**
8
8
  * Hook with actions on the Select component.
9
9
  */
10
10
  export declare function useSelectActions({ onChange, onBlur, onFocus, }: UseSelectActionsProps): {
11
11
  handleChange: (event: ChangeEvent<HTMLSelectElement>) => void;
12
- handleBlur: () => void;
13
- handleFocus: () => void;
12
+ handleBlur: (event: FocusEvent<HTMLSelectElement>) => void;
13
+ handleFocus: (event: FocusEvent<HTMLSelectElement>) => void;
14
14
  };
15
15
  export {};