@jobber/components 6.103.4 → 6.103.6

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 (74) hide show
  1. package/dist/Autocomplete/components/MenuList.d.ts +1 -1
  2. package/dist/Autocomplete/components/PersistentRegion.d.ts +1 -1
  3. package/dist/Autocomplete/hooks/useAutocompleteListNav.d.ts +1 -1
  4. package/dist/Autocomplete/useAutocomplete.d.ts +1 -1
  5. package/dist/Card-cjs.js +1 -1
  6. package/dist/Card-es.js +1 -1
  7. package/dist/Chip/Chip.d.ts +1 -2
  8. package/dist/Chip/hooks/useChildComponent.d.ts +1 -1
  9. package/dist/Chip/index.cjs +1 -1
  10. package/dist/Chip-cjs.js +5 -4
  11. package/dist/Chip-es.js +5 -4
  12. package/dist/ChipDismissible-cjs.js +4 -4
  13. package/dist/ChipDismissible-es.js +5 -5
  14. package/dist/Chips/InternalChipDismissible/hooks/useInView.d.ts +1 -1
  15. package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissibleInput.d.ts +1 -1
  16. package/dist/Chips/InternalChipDismissible/hooks/useScrollToActive.d.ts +1 -1
  17. package/dist/Combobox/Combobox.types.d.ts +2 -2
  18. package/dist/Combobox/ComboboxProvider.d.ts +2 -2
  19. package/dist/Combobox/components/ComboboxActivator/ComboboxActivator.d.ts +1 -1
  20. package/dist/Combobox/hooks/useCombobox.d.ts +1 -1
  21. package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +2 -2
  22. package/dist/Combobox/hooks/useComboboxContent.d.ts +2 -1
  23. package/dist/Combobox/hooks/useMakeComboboxHandlers.d.ts +1 -1
  24. package/dist/ComboboxActivator-cjs.js +2 -2
  25. package/dist/ComboboxActivator-es.js +3 -3
  26. package/dist/ComboboxTrigger-cjs.js +1 -1
  27. package/dist/ComboboxTrigger-es.js +2 -2
  28. package/dist/DataList/DataList.types.d.ts +2 -2
  29. package/dist/DataList/DataList.utils.d.ts +2 -2
  30. package/dist/DataList/components/DataListHeaderTile/components/DataListSortingOptions.d.ts +2 -2
  31. package/dist/DataList/components/DataListItem/DataListItemInternal.d.ts +1 -2
  32. package/dist/DataList/hooks/useGetItemActions.d.ts +1 -1
  33. package/dist/DataListActions-cjs.js +4 -2
  34. package/dist/DataListActions-es.js +4 -2
  35. package/dist/DataListItem-cjs.js +8 -7
  36. package/dist/DataListItem-es.js +9 -8
  37. package/dist/DataListSort-cjs.js +1 -1
  38. package/dist/DataListSort-es.js +2 -2
  39. package/dist/DatePicker/useFocusOnSelectedDate.d.ts +1 -2
  40. package/dist/DatePicker-cjs.js +1 -1
  41. package/dist/DatePicker-es.js +1 -1
  42. package/dist/FormField/FormFieldAffix.d.ts +2 -2
  43. package/dist/FormField/FormFieldTypes.d.ts +3 -3
  44. package/dist/FormField/hooks/useFormFieldFocus.d.ts +1 -1
  45. package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +2 -2
  46. package/dist/FormField-cjs.js +2 -2
  47. package/dist/FormField-es.js +2 -2
  48. package/dist/InputGroup-cjs.js +5 -2
  49. package/dist/InputGroup-es.js +5 -2
  50. package/dist/InputText/InputText.d.ts +2 -2
  51. package/dist/InputText/useInputTextActions.d.ts +1 -1
  52. package/dist/InputText/useInputTextFormField.d.ts +15 -1
  53. package/dist/InputText/useTextAreaResize.d.ts +2 -2
  54. package/dist/InternalChipDismissible-cjs.js +3 -3
  55. package/dist/InternalChipDismissible-es.js +4 -4
  56. package/dist/Menu/Menu.types.d.ts +5 -1
  57. package/dist/Modal/Modal.types.d.ts +3 -3
  58. package/dist/Modal/ModalContext.rebuilt.d.ts +2 -2
  59. package/dist/MultiSelect/DropDownMenu.d.ts +1 -1
  60. package/dist/MultiSelect-cjs.js +13 -7
  61. package/dist/MultiSelect-es.js +13 -7
  62. package/dist/RadioGroup/RadioGroup.d.ts +2 -1
  63. package/dist/RadioGroup/RadioOption.d.ts +1 -1
  64. package/dist/Tabs/hooks/useTabsOverflow.d.ts +2 -2
  65. package/dist/Tabs-cjs.js +4 -2
  66. package/dist/Tabs-es.js +4 -2
  67. package/dist/Tooltip/useTooltipPositioning.d.ts +1 -1
  68. package/dist/helpers-cjs.js +1 -1
  69. package/dist/helpers-es.js +1 -1
  70. package/dist/index.cjs +1 -1
  71. package/dist/showToast-cjs.js +2 -2
  72. package/dist/showToast-es.js +2 -2
  73. package/dist/utils/mergeRefs.d.ts +2 -2
  74. package/package.json +2 -2
@@ -6,7 +6,7 @@ interface MenuListProps<T extends OptionLike> {
6
6
  readonly activeIndex: number | null;
7
7
  readonly indexOffset?: number;
8
8
  readonly getItemProps: (userProps?: Record<string, unknown>) => Record<string, unknown>;
9
- readonly listRef: React.MutableRefObject<Array<HTMLElement | null>>;
9
+ readonly listRef: React.RefObject<Array<HTMLElement | null>>;
10
10
  readonly listboxId: string;
11
11
  readonly customRenderOption?: AutocompleteRebuiltProps<T, false>["customRenderOption"];
12
12
  readonly customRenderSection?: AutocompleteRebuiltProps<T, false>["customRenderSection"];
@@ -7,7 +7,7 @@ interface PersistentRegionProps<T extends OptionLike> {
7
7
  readonly indexOffset: number;
8
8
  readonly listboxId?: string;
9
9
  readonly getItemProps: (args?: Record<string, unknown>) => Record<string, unknown>;
10
- readonly listRef: React.MutableRefObject<Array<HTMLElement | null>>;
10
+ readonly listRef: React.RefObject<Array<HTMLElement | null>>;
11
11
  readonly customRenderHeader?: AutocompleteRebuiltProps<T, false>["customRenderHeader"];
12
12
  readonly customRenderFooter?: AutocompleteRebuiltProps<T, false>["customRenderFooter"];
13
13
  readonly className?: string;
@@ -8,7 +8,7 @@ export interface UseAutocompleteListNavReturn {
8
8
  getItemProps: UseInteractionsReturn["getItemProps"];
9
9
  activeIndex: number | null;
10
10
  setActiveIndex: (index: number | null) => void;
11
- listRef: React.MutableRefObject<Array<HTMLElement | null>>;
11
+ listRef: React.RefObject<Array<HTMLElement | null>>;
12
12
  open: boolean;
13
13
  setOpen: (open: boolean) => void;
14
14
  setReferenceElement: (el: HTMLElement | null) => void;
@@ -55,7 +55,7 @@ export declare function useAutocomplete<Value extends OptionLike, Multiple exten
55
55
  setOpen: (open: boolean) => void;
56
56
  activeIndex: number | null;
57
57
  setActiveIndex: (index: number | null) => void;
58
- listRef: React.MutableRefObject<(HTMLElement | null)[]>;
58
+ listRef: React.RefObject<(HTMLElement | null)[]>;
59
59
  onSelection: (option: Value) => void;
60
60
  onAction: (action: ActionConfig) => void;
61
61
  onInputChangeFromUser: (val: string) => void;
package/dist/Card-cjs.js CHANGED
@@ -19,7 +19,7 @@ const SPACEBAR_KEY = " ";
19
19
  * Please use `<Card onClick={onClick} />` component instead.
20
20
  */
21
21
  function CardClickable({ className, onClick, children, UNSAFE_style = {}, }) {
22
- const cardRef = React.useRef();
22
+ const cardRef = React.useRef(null);
23
23
  return (React.createElement("div", { ref: cardRef, "data-testid": "clickable-card", className: className, style: UNSAFE_style, onClick: onClick, onKeyUp: handleKeyup, onKeyDown: handleKeyDown, role: "button", tabIndex: 0 }, children));
24
24
  function isCardFocused() {
25
25
  return document.activeElement === cardRef.current;
package/dist/Card-es.js CHANGED
@@ -17,7 +17,7 @@ const SPACEBAR_KEY = " ";
17
17
  * Please use `<Card onClick={onClick} />` component instead.
18
18
  */
19
19
  function CardClickable({ className, onClick, children, UNSAFE_style = {}, }) {
20
- const cardRef = useRef();
20
+ const cardRef = useRef(null);
21
21
  return (React__default.createElement("div", { ref: cardRef, "data-testid": "clickable-card", className: className, style: UNSAFE_style, onClick: onClick, onKeyUp: handleKeyup, onKeyDown: handleKeyDown, role: "button", tabIndex: 0 }, children));
22
22
  function isCardFocused() {
23
23
  return document.activeElement === cardRef.current;
@@ -2,8 +2,7 @@ import React from "react";
2
2
  import { ChipPrefix } from "./components/ChipPrefix/Chip.Prefix";
3
3
  import { ChipSuffix } from "./components/ChipSuffix/Chip.Suffix";
4
4
  import type { ChipProps } from "./Chip.types";
5
- declare const ChipNamespace: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement | HTMLButtonElement>> & {
5
+ export declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement | HTMLButtonElement>> & {
6
6
  Prefix: typeof ChipPrefix;
7
7
  Suffix: typeof ChipSuffix;
8
8
  };
9
- export { ChipNamespace as Chip };
@@ -6,4 +6,4 @@ import React from "react";
6
6
  * @param isCorrectComponent a function that accepts a ReactElement and returns a boolean.
7
7
  * @returns The first child component that returns true on isCorrectComponent
8
8
  */
9
- export declare function useChildComponent(children: ReactNode | undefined, isCorrectComponent: (toCheck: ReactElement) => boolean): ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
9
+ export declare function useChildComponent(children: ReactNode | undefined, isCorrectComponent: (toCheck: ReactElement) => boolean): ReactElement<unknown, string | React.JSXElementConstructor<any>> | undefined;
@@ -20,6 +20,6 @@ require('../tslib.es6-cjs.js');
20
20
 
21
21
 
22
22
 
23
- exports.Chip = Chip.ChipNamespace;
23
+ exports.Chip = Chip.Chip;
24
24
  exports.ChipDismissible = ChipDismissible.ChipDismissible;
25
25
  exports.ChipSelectable = ChipDismissible.ChipSelectable;
package/dist/Chip-cjs.js CHANGED
@@ -21,14 +21,15 @@ function ChipPrefix({ children }) {
21
21
  var styles = {"wrapper":"NLNJBhRffp4-","input":"ulLzwMsQL3U-","inactive":"_3LLjp8oIxJ0-","invalid":"H7VZzUBkgjk-","disabled":"-yQxZSnxBBU-","button":"ngKOY8l4BG4-","icon":"rzbiB2nz36Q-","spinning":"X7Bx5CDPfDs-"};
22
22
 
23
23
  function InternalChipButton({ icon, invalid, disabled, label, onClick, }) {
24
- const buttonRef = React.useRef();
24
+ const buttonRef = React.useRef(null);
25
25
  return (React.createElement("div", { ref: buttonRef, className: styles.button, tabIndex: 0, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, onClick: handleClick, role: "button", "aria-label": `Remove ${label}`, "aria-hidden": disabled, "aria-disabled": disabled, "data-testid": "remove-chip-button" },
26
26
  React.createElement(Icon.Icon, { size: "small", name: icon, color: getColor() })));
27
27
  function handleKeyUp(event) {
28
+ var _a;
28
29
  if (document.activeElement === buttonRef.current &&
29
30
  (event.key === " " || event.key === "Enter")) {
30
31
  event.stopPropagation();
31
- buttonRef.current.click();
32
+ (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.click();
32
33
  }
33
34
  }
34
35
  function handleKeyDown(event) {
@@ -124,12 +125,12 @@ function getTooltipMessage(labelFullyVisible, headingFullyVisible, label, headin
124
125
  return message;
125
126
  }
126
127
  ChipComponent.displayName = "Chip";
127
- const ChipNamespace = Object.assign(ChipComponent, {
128
+ const Chip = Object.assign(ChipComponent, {
128
129
  Prefix: ChipPrefix,
129
130
  Suffix: ChipSuffix,
130
131
  });
131
132
 
132
- exports.ChipNamespace = ChipNamespace;
133
+ exports.Chip = Chip;
133
134
  exports.InternalChipButton = InternalChipButton;
134
135
  exports.styles = styles$1;
135
136
  exports.styles$1 = styles;
package/dist/Chip-es.js CHANGED
@@ -19,14 +19,15 @@ function ChipPrefix({ children }) {
19
19
  var styles = {"wrapper":"NLNJBhRffp4-","input":"ulLzwMsQL3U-","inactive":"_3LLjp8oIxJ0-","invalid":"H7VZzUBkgjk-","disabled":"-yQxZSnxBBU-","button":"ngKOY8l4BG4-","icon":"rzbiB2nz36Q-","spinning":"X7Bx5CDPfDs-"};
20
20
 
21
21
  function InternalChipButton({ icon, invalid, disabled, label, onClick, }) {
22
- const buttonRef = useRef();
22
+ const buttonRef = useRef(null);
23
23
  return (React__default.createElement("div", { ref: buttonRef, className: styles.button, tabIndex: 0, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, onClick: handleClick, role: "button", "aria-label": `Remove ${label}`, "aria-hidden": disabled, "aria-disabled": disabled, "data-testid": "remove-chip-button" },
24
24
  React__default.createElement(Icon, { size: "small", name: icon, color: getColor() })));
25
25
  function handleKeyUp(event) {
26
+ var _a;
26
27
  if (document.activeElement === buttonRef.current &&
27
28
  (event.key === " " || event.key === "Enter")) {
28
29
  event.stopPropagation();
29
- buttonRef.current.click();
30
+ (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.click();
30
31
  }
31
32
  }
32
33
  function handleKeyDown(event) {
@@ -122,9 +123,9 @@ function getTooltipMessage(labelFullyVisible, headingFullyVisible, label, headin
122
123
  return message;
123
124
  }
124
125
  ChipComponent.displayName = "Chip";
125
- const ChipNamespace = Object.assign(ChipComponent, {
126
+ const Chip = Object.assign(ChipComponent, {
126
127
  Prefix: ChipPrefix,
127
128
  Suffix: ChipSuffix,
128
129
  });
129
130
 
130
- export { ChipNamespace as C, InternalChipButton as I, styles as a, styles$1 as s };
131
+ export { Chip as C, InternalChipButton as I, styles as a, styles$1 as s };
@@ -7,14 +7,14 @@ var Chip = require('./Chip-cjs.js');
7
7
 
8
8
  function ChipSelectable(_a) {
9
9
  var { selected } = _a, rest = tslib_es6.__rest(_a, ["selected"]);
10
- return (React.createElement(Chip.ChipNamespace, Object.assign({}, rest),
11
- React.createElement(Chip.ChipNamespace.Suffix, { className: selected ? Chip.styles.selected : "" },
10
+ return (React.createElement(Chip.Chip, Object.assign({}, rest),
11
+ React.createElement(Chip.Chip.Suffix, { className: selected ? Chip.styles.selected : "" },
12
12
  React.createElement(Icon.Icon, { name: selected ? "checkmark" : "add", size: "small", color: "interactiveSubtle" }))));
13
13
  }
14
14
 
15
15
  function ChipDismissible(props) {
16
- return (React.createElement(Chip.ChipNamespace, Object.assign({}, props),
17
- React.createElement(Chip.ChipNamespace.Suffix, null,
16
+ return (React.createElement(Chip.Chip, Object.assign({}, props),
17
+ React.createElement(Chip.Chip.Suffix, null,
18
18
  React.createElement(Icon.Icon, { name: "cross", size: "small", color: "interactiveSubtle" }))));
19
19
  }
20
20
 
@@ -1,18 +1,18 @@
1
1
  import { _ as __rest } from './tslib.es6-es.js';
2
2
  import React__default from 'react';
3
3
  import { I as Icon } from './Icon-es.js';
4
- import { C as ChipNamespace, s as styles } from './Chip-es.js';
4
+ import { C as Chip, s as styles } from './Chip-es.js';
5
5
 
6
6
  function ChipSelectable(_a) {
7
7
  var { selected } = _a, rest = __rest(_a, ["selected"]);
8
- return (React__default.createElement(ChipNamespace, Object.assign({}, rest),
9
- React__default.createElement(ChipNamespace.Suffix, { className: selected ? styles.selected : "" },
8
+ return (React__default.createElement(Chip, Object.assign({}, rest),
9
+ React__default.createElement(Chip.Suffix, { className: selected ? styles.selected : "" },
10
10
  React__default.createElement(Icon, { name: selected ? "checkmark" : "add", size: "small", color: "interactiveSubtle" }))));
11
11
  }
12
12
 
13
13
  function ChipDismissible(props) {
14
- return (React__default.createElement(ChipNamespace, Object.assign({}, props),
15
- React__default.createElement(ChipNamespace.Suffix, null,
14
+ return (React__default.createElement(Chip, Object.assign({}, props),
15
+ React__default.createElement(Chip.Suffix, null,
16
16
  React__default.createElement(Icon, { name: "cross", size: "small", color: "interactiveSubtle" }))));
17
17
  }
18
18
 
@@ -1,4 +1,4 @@
1
1
  export declare function useInView<T extends Element>(): {
2
- ref: import("react").RefObject<T>;
2
+ ref: import("react").RefObject<T | null>;
3
3
  isInView: boolean;
4
4
  };
@@ -8,7 +8,7 @@ export declare function useInternalChipDismissibleInput({ options, isLoadingMore
8
8
  searchValue: string;
9
9
  shouldCancelBlur: boolean;
10
10
  menuId: string;
11
- inputRef: React.RefObject<HTMLInputElement>;
11
+ inputRef: React.RefObject<HTMLInputElement | null>;
12
12
  activeOption: ChipDismissibleInputOptionProps;
13
13
  hasAvailableOptions: boolean;
14
14
  nextOptionIndex: number;
@@ -1 +1 @@
1
- export declare function useScrollToActive(index: number): import("react").MutableRefObject<HTMLDivElement | null>;
1
+ export declare function useScrollToActive(index: number): import("react").RefObject<HTMLDivElement | null>;
@@ -165,7 +165,7 @@ export interface ComboboxContentProps {
165
165
  /**
166
166
  * Reference to the wrapping div element of all the Combobox pieces
167
167
  */
168
- readonly wrapperRef: React.RefObject<HTMLDivElement>;
168
+ readonly wrapperRef: React.RefObject<HTMLDivElement | null>;
169
169
  /**
170
170
  * Is the Combobox open
171
171
  */
@@ -235,7 +235,7 @@ export interface ComboboxListProps {
235
235
  /**
236
236
  * A ref to the list element.
237
237
  */
238
- readonly optionsListRef: React.RefObject<HTMLUListElement>;
238
+ readonly optionsListRef: React.RefObject<HTMLUListElement | null>;
239
239
  /**
240
240
  * The current search term. Used in the no results message.
241
241
  */
@@ -1,5 +1,5 @@
1
- import type { MutableRefObject } from "react";
2
1
  import React from "react";
2
+ import type { RefObject } from "react";
3
3
  import { type ComboboxOption } from "./Combobox.types";
4
4
  export interface ComboboxProviderProps {
5
5
  readonly children: React.ReactNode;
@@ -8,7 +8,7 @@ export interface ComboboxProviderProps {
8
8
  readonly open: boolean;
9
9
  readonly handleClose: () => void;
10
10
  readonly handleOpen: () => void;
11
- readonly shouldScroll: MutableRefObject<boolean>;
11
+ readonly shouldScroll: RefObject<boolean>;
12
12
  readonly searchValue: string;
13
13
  readonly label?: string;
14
14
  readonly onClear?: () => void;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import type { ComboboxActivatorProps } from "../../Combobox.types";
3
- export declare function ComboboxActivator(props: ComboboxActivatorProps): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
3
+ export declare function ComboboxActivator(props: ComboboxActivatorProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
@@ -3,7 +3,7 @@ import type React from "react";
3
3
  import type { UseMakeComboboxHandlersReturn } from "./useMakeComboboxHandlers";
4
4
  import { type ComboboxOption } from "../Combobox.types";
5
5
  type UseComboboxReturn = {
6
- wrapperRef: React.RefObject<HTMLDivElement>;
6
+ wrapperRef: React.RefObject<HTMLDivElement | null>;
7
7
  searchValue: string;
8
8
  setSearchValue: Dispatch<React.SetStateAction<string>>;
9
9
  open: boolean;
@@ -1,7 +1,7 @@
1
1
  import type { UseInteractionsReturn } from "@floating-ui/react";
2
2
  import { type ComboboxOption } from "../Combobox.types";
3
- export declare function useComboboxAccessibility(selectionCallback: (selection: ComboboxOption) => void, filteredOptions: ComboboxOption[], optionsListRef: React.RefObject<HTMLUListElement>, open: boolean, wrapperRef: React.RefObject<HTMLDivElement>): {
4
- floatingRef: React.RefObject<HTMLDivElement>;
3
+ export declare function useComboboxAccessibility(selectionCallback: (selection: ComboboxOption) => void, filteredOptions: ComboboxOption[], optionsListRef: React.RefObject<HTMLUListElement | null>, open: boolean, wrapperRef: React.RefObject<HTMLDivElement | null>): {
4
+ floatingRef: React.RefObject<HTMLDivElement | null>;
5
5
  floatingStyles: React.CSSProperties;
6
6
  floatingProps: ReturnType<UseInteractionsReturn["getFloatingProps"]>;
7
7
  nodeId?: string;
@@ -1,6 +1,7 @@
1
+ import type { RefObject } from "react";
1
2
  import { type ComboboxOption } from "../Combobox.types";
2
3
  interface useComboboxContent {
3
- optionsListRef: React.RefObject<HTMLUListElement>;
4
+ optionsListRef: RefObject<HTMLUListElement | null>;
4
5
  onClear?: () => void;
5
6
  onSelectAll?: (selection: ComboboxOption[]) => void;
6
7
  }
@@ -5,4 +5,4 @@ export interface UseMakeComboboxHandlersReturn {
5
5
  handleSelection: (selection: ComboboxOption) => void;
6
6
  handleOpen: () => void;
7
7
  }
8
- export declare function useMakeComboboxHandlers(setOpen: (open: boolean) => void, open: boolean, setSearchValue: (searchValue: string) => void, selectedOptions: ComboboxOption[], shouldScroll: React.MutableRefObject<boolean>, selectedStateSetter: (selected: ComboboxOption[]) => void, multiSelect?: boolean, onClose?: () => void, onSearch?: (searchValue: string) => void): UseMakeComboboxHandlersReturn;
8
+ export declare function useMakeComboboxHandlers(setOpen: (open: boolean) => void, open: boolean, setSearchValue: (searchValue: string) => void, selectedOptions: ComboboxOption[], shouldScroll: React.RefObject<boolean>, selectedStateSetter: (selected: ComboboxOption[]) => void, multiSelect?: boolean, onClose?: () => void, onSearch?: (searchValue: string) => void): UseMakeComboboxHandlersReturn;
@@ -22,8 +22,8 @@ function useComboboxActivatorAccessibility() {
22
22
  function ComboboxActivator(props) {
23
23
  const { handleOpen } = React.useContext(ComboboxProvider.ComboboxContext);
24
24
  const accessibilityAttributes = useComboboxActivatorAccessibility();
25
- if (typeof props.children !== "function" &&
26
- (props.children.type === Button.Button || props.children.type === Chip.ChipNamespace)) {
25
+ if (React.isValidElement(props.children) &&
26
+ (props.children.type === Button.Button || props.children.type === Chip.Chip)) {
27
27
  return React.cloneElement(props.children, {
28
28
  role: accessibilityAttributes.role,
29
29
  onClick: handleOpen,
@@ -1,7 +1,7 @@
1
1
  import React__default, { useContext } from 'react';
2
2
  import { B as Button } from './Button-es.js';
3
3
  import 'classnames';
4
- import { C as ChipNamespace } from './Chip-es.js';
4
+ import { C as Chip } from './Chip-es.js';
5
5
  import './tslib.es6-es.js';
6
6
  import '@jobber/design';
7
7
  import { a as ComboboxContext } from './ComboboxProvider-es.js';
@@ -20,8 +20,8 @@ function useComboboxActivatorAccessibility() {
20
20
  function ComboboxActivator(props) {
21
21
  const { handleOpen } = React__default.useContext(ComboboxContext);
22
22
  const accessibilityAttributes = useComboboxActivatorAccessibility();
23
- if (typeof props.children !== "function" &&
24
- (props.children.type === Button || props.children.type === ChipNamespace)) {
23
+ if (React__default.isValidElement(props.children) &&
24
+ (props.children.type === Button || props.children.type === Chip)) {
25
25
  return React__default.cloneElement(props.children, {
26
26
  role: accessibilityAttributes.role,
27
27
  onClick: handleOpen,
@@ -10,7 +10,7 @@ function ComboboxTrigger({ label = "Select", selected, activatorRef, }) {
10
10
  const { handleOpen } = React.useContext(ComboboxProvider.ComboboxContext);
11
11
  const hasSelection = selected.length;
12
12
  const selectedLabel = selected.map(option => option.label).join(", ");
13
- return (React.createElement(Chip.ChipNamespace, { variation: hasSelection ? "base" : "subtle", label: hasSelection ? selectedLabel : "", ariaLabel: label, heading: label, onClick: handleOpen, role: "combobox", ref: activatorRef }, !hasSelection && (React.createElement(Chip.ChipNamespace.Suffix, null,
13
+ return (React.createElement(Chip.Chip, { variation: hasSelection ? "base" : "subtle", label: hasSelection ? selectedLabel : "", ariaLabel: label, heading: label, onClick: handleOpen, role: "combobox", ref: activatorRef }, !hasSelection && (React.createElement(Chip.Chip.Suffix, null,
14
14
  React.createElement(Icon.Icon, { name: "add", size: "small" })))));
15
15
  }
16
16
 
@@ -1,5 +1,5 @@
1
1
  import React__default from 'react';
2
- import { C as ChipNamespace } from './Chip-es.js';
2
+ import { C as Chip } from './Chip-es.js';
3
3
  import './tslib.es6-es.js';
4
4
  import { I as Icon } from './Icon-es.js';
5
5
  import { a as ComboboxContext } from './ComboboxProvider-es.js';
@@ -8,7 +8,7 @@ function ComboboxTrigger({ label = "Select", selected, activatorRef, }) {
8
8
  const { handleOpen } = React__default.useContext(ComboboxContext);
9
9
  const hasSelection = selected.length;
10
10
  const selectedLabel = selected.map(option => option.label).join(", ");
11
- return (React__default.createElement(ChipNamespace, { variation: hasSelection ? "base" : "subtle", label: hasSelection ? selectedLabel : "", ariaLabel: label, heading: label, onClick: handleOpen, role: "combobox", ref: activatorRef }, !hasSelection && (React__default.createElement(ChipNamespace.Suffix, null,
11
+ return (React__default.createElement(Chip, { variation: hasSelection ? "base" : "subtle", label: hasSelection ? selectedLabel : "", ariaLabel: label, heading: label, onClick: handleOpen, role: "combobox", ref: activatorRef }, !hasSelection && (React__default.createElement(Chip.Suffix, null,
12
12
  React__default.createElement(Icon, { name: "add", size: "small" })))));
13
13
  }
14
14
 
@@ -1,4 +1,4 @@
1
- import { type ReactElement, type ReactNode } from "react";
1
+ import type { ReactElement, ReactNode } from "react";
2
2
  import type { IconNames } from "@jobber/design";
3
3
  import type { XOR } from "ts-xor";
4
4
  import { type Breakpoints } from "./DataList.const";
@@ -289,7 +289,7 @@ export interface DataListActionProps<T extends DataListObject> {
289
289
  /**
290
290
  * Determine if the action is visible for a given item.
291
291
  */
292
- readonly visible?: (item: T) => boolean;
292
+ readonly visible?: (item?: T) => boolean;
293
293
  /**
294
294
  * The callback function when the action is clicked.
295
295
  */
@@ -1,6 +1,6 @@
1
1
  import type { ReactElement } from "react";
2
2
  import React from "react";
3
- import type { DataListHeader, DataListItemType, DataListItemTypeFromHeader, DataListObject } from "./DataList.types";
3
+ import type { DataListActionProps, DataListHeader, DataListItemType, DataListItemTypeFromHeader, DataListObject } from "./DataList.types";
4
4
  import type { Breakpoints } from "./DataList.const";
5
5
  /**
6
6
  * Return the child component that matches the `type` provided
@@ -19,4 +19,4 @@ export declare function generateListItemElement<T extends DataListObject>(item:
19
19
  */
20
20
  export declare function generateHeaderElements<T extends DataListObject>(headers: DataListHeader<T>): DataListItemTypeFromHeader<T, DataListHeader<T>> | undefined;
21
21
  export declare function sortBreakpoints(sizeProp: Breakpoints[]): ("xs" | "sm" | "md" | "lg" | "xl")[];
22
- export declare function getExposedActions(childrenArray: ReactElement[], childCount?: number): ReactElement<any, string | React.JSXElementConstructor<any>>[];
22
+ export declare function getExposedActions<T extends DataListObject>(childrenArray: ReactElement<DataListActionProps<T>>[], childCount?: number): ReactElement<DataListActionProps<T>, string | React.JSXElementConstructor<any>>[];
@@ -5,8 +5,8 @@ interface DataListSortingOptionsProps {
5
5
  readonly selectedOption: DataListSorting | null;
6
6
  readonly onSelectChange: (selectedOption: SortableOptions) => void;
7
7
  readonly onClose: () => void;
8
- readonly optionsListRef: React.RefObject<HTMLUListElement>;
9
- readonly dataListHeaderTileRef: React.RefObject<HTMLElement>;
8
+ readonly optionsListRef: React.RefObject<HTMLUListElement | null>;
9
+ readonly dataListHeaderTileRef: React.RefObject<HTMLElement | null>;
10
10
  }
11
11
  export declare function DataListSortingOptions({ options, selectedOption, onSelectChange, onClose, optionsListRef, dataListHeaderTileRef, }: DataListSortingOptionsProps): React.JSX.Element;
12
12
  export {};
@@ -1,5 +1,4 @@
1
- import type { ReactElement } from "react";
2
- import React from "react";
1
+ import React, { type ReactElement } from "react";
3
2
  import type { DataListObject } from "@jobber/components/DataList/DataList.types";
4
3
  interface ListItemInternalProps<T extends DataListObject> {
5
4
  readonly children: ReactElement;
@@ -1,7 +1,7 @@
1
1
  import type { ReactElement } from "react";
2
2
  import type { DataListActionProps, DataListObject } from "../DataList.types";
3
3
  export declare function useGetItemActions<T extends DataListObject>(item: T): {
4
- actions: ReactElement<DataListActionProps<T>>[];
4
+ actions: ReactElement<DataListActionProps<T>, string | import("react").JSXElementConstructor<any>>[];
5
5
  hasActions: boolean;
6
6
  disableContextMenu: boolean;
7
7
  };
@@ -27,13 +27,15 @@ function DataListActions({ children, itemsToExpose = 2, }) {
27
27
  if (activeItem) {
28
28
  return props.label(activeItem);
29
29
  }
30
+ return "";
30
31
  }
31
32
  const actionLabel = getActionLabel();
32
33
  // If the action is always visible, we don't want a tooltip.
33
34
  if (props.alwaysVisible) {
34
- return (React.createElement(Button.Button, { ariaLabel: actionLabel, key: props.label, icon: props.icon, label: actionLabel, onClick: () => {
35
+ return (React.createElement(Button.Button, { ariaLabel: actionLabel, key: actionLabel, icon: props.icon, label: actionLabel, onClick: () => {
35
36
  var _a;
36
- (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
37
+ if (activeItem)
38
+ (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
37
39
  }, type: "secondary", variation: "subtle" }));
38
40
  }
39
41
  return (React.createElement(Tooltip.Tooltip, { key: actionLabel, message: actionLabel },
@@ -25,13 +25,15 @@ function DataListActions({ children, itemsToExpose = 2, }) {
25
25
  if (activeItem) {
26
26
  return props.label(activeItem);
27
27
  }
28
+ return "";
28
29
  }
29
30
  const actionLabel = getActionLabel();
30
31
  // If the action is always visible, we don't want a tooltip.
31
32
  if (props.alwaysVisible) {
32
- return (React__default.createElement(Button, { ariaLabel: actionLabel, key: props.label, icon: props.icon, label: actionLabel, onClick: () => {
33
+ return (React__default.createElement(Button, { ariaLabel: actionLabel, key: actionLabel, icon: props.icon, label: actionLabel, onClick: () => {
33
34
  var _a;
34
- (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
35
+ if (activeItem)
36
+ (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
35
37
  }, type: "secondary", variation: "subtle" }));
36
38
  }
37
39
  return (React__default.createElement(Tooltip, { key: actionLabel, message: actionLabel },
@@ -61,19 +61,20 @@ function DataListItemInternal({ children, item, }) {
61
61
  function useGetItemActions(item) {
62
62
  var _a;
63
63
  const { itemActionComponent } = DataListContext.useDataListContext();
64
- const itemActions = (itemActionComponent === null || itemActionComponent === void 0 ? void 0 : itemActionComponent.props.children) || [];
65
- const actionsArray = React.Children.toArray(itemActions);
66
64
  const disableContextMenu = (_a = itemActionComponent === null || itemActionComponent === void 0 ? void 0 : itemActionComponent.props.disableContextMenu) !== null && _a !== void 0 ? _a : false;
67
65
  const actions = React.useMemo(() => {
68
- return actionsArray.filter(action => {
69
- if (React.isValidElement(action) && action.props.visible) {
70
- return action.props.visible(item);
66
+ var _a;
67
+ const children = (_a = itemActionComponent === null || itemActionComponent === void 0 ? void 0 : itemActionComponent.props.children) !== null && _a !== void 0 ? _a : [];
68
+ const nodes = React.Children.toArray(children);
69
+ return nodes.filter((node) => {
70
+ if (React.isValidElement(node)) {
71
+ return node.props.visible ? node.props.visible(item) : true;
71
72
  }
72
- return true;
73
+ return false;
73
74
  });
74
75
  }, [itemActionComponent === null || itemActionComponent === void 0 ? void 0 : itemActionComponent.props.children, item]);
75
76
  return {
76
- actions: actions,
77
+ actions,
77
78
  hasActions: Boolean(actions.length),
78
79
  disableContextMenu,
79
80
  };
@@ -1,4 +1,4 @@
1
- import React__default, { Children, useMemo, isValidElement, useState } from 'react';
1
+ import React__default, { useMemo, Children, isValidElement, useState } from 'react';
2
2
  import { AnimatePresence } from 'framer-motion';
3
3
  import classnames from 'classnames';
4
4
  import { u as useDataListLayoutContext } from './DataListLayoutContext-es.js';
@@ -59,19 +59,20 @@ function DataListItemInternal({ children, item, }) {
59
59
  function useGetItemActions(item) {
60
60
  var _a;
61
61
  const { itemActionComponent } = useDataListContext();
62
- const itemActions = (itemActionComponent === null || itemActionComponent === void 0 ? void 0 : itemActionComponent.props.children) || [];
63
- const actionsArray = Children.toArray(itemActions);
64
62
  const disableContextMenu = (_a = itemActionComponent === null || itemActionComponent === void 0 ? void 0 : itemActionComponent.props.disableContextMenu) !== null && _a !== void 0 ? _a : false;
65
63
  const actions = useMemo(() => {
66
- return actionsArray.filter(action => {
67
- if (isValidElement(action) && action.props.visible) {
68
- return action.props.visible(item);
64
+ var _a;
65
+ const children = (_a = itemActionComponent === null || itemActionComponent === void 0 ? void 0 : itemActionComponent.props.children) !== null && _a !== void 0 ? _a : [];
66
+ const nodes = Children.toArray(children);
67
+ return nodes.filter((node) => {
68
+ if (isValidElement(node)) {
69
+ return node.props.visible ? node.props.visible(item) : true;
69
70
  }
70
- return true;
71
+ return false;
71
72
  });
72
73
  }, [itemActionComponent === null || itemActionComponent === void 0 ? void 0 : itemActionComponent.props.children, item]);
73
74
  return {
74
- actions: actions,
75
+ actions,
75
76
  hasActions: Boolean(actions.length),
76
77
  disableContextMenu,
77
78
  };
@@ -21,7 +21,7 @@ function DataListSort() {
21
21
  },
22
22
  ] },
23
23
  React.createElement(Combobox.Combobox.Activator, null,
24
- React.createElement(Chip.ChipNamespace, { heading: "Sort", label: getButtonLabel(), variation: state ? "base" : "subtle" }, !state && (React.createElement(Chip.ChipNamespace.Suffix, null,
24
+ React.createElement(Chip.Chip, { heading: "Sort", label: getButtonLabel(), variation: state ? "base" : "subtle" }, !state && (React.createElement(Chip.Chip.Suffix, null,
25
25
  React.createElement(Icon.Icon, { name: "arrowDown", size: "small" }))))),
26
26
  sortByOptions.map(({ label, value }) => (React.createElement(Combobox.Combobox.Option, { key: value, id: value, label: label })))));
27
27
  function getSortByOptions() {
@@ -2,7 +2,7 @@ import React__default from 'react';
2
2
  import { u as useDataListContext } from './DataListContext-es.js';
3
3
  import { C as Combobox } from './Combobox-es.js';
4
4
  import './ComboboxProvider-es.js';
5
- import { C as ChipNamespace } from './Chip-es.js';
5
+ import { C as Chip } from './Chip-es.js';
6
6
  import './tslib.es6-es.js';
7
7
  import { I as Icon } from './Icon-es.js';
8
8
 
@@ -19,7 +19,7 @@ function DataListSort() {
19
19
  },
20
20
  ] },
21
21
  React__default.createElement(Combobox.Activator, null,
22
- React__default.createElement(ChipNamespace, { heading: "Sort", label: getButtonLabel(), variation: state ? "base" : "subtle" }, !state && (React__default.createElement(ChipNamespace.Suffix, null,
22
+ React__default.createElement(Chip, { heading: "Sort", label: getButtonLabel(), variation: state ? "base" : "subtle" }, !state && (React__default.createElement(Chip.Suffix, null,
23
23
  React__default.createElement(Icon, { name: "arrowDown", size: "small" }))))),
24
24
  sortByOptions.map(({ label, value }) => (React__default.createElement(Combobox.Option, { key: value, id: value, label: label })))));
25
25
  function getSortByOptions() {
@@ -1,5 +1,4 @@
1
- import type { MutableRefObject } from "react";
2
1
  export declare function useFocusOnSelectedDate(): {
3
- ref: MutableRefObject<HTMLDivElement>;
2
+ ref: import("react").RefObject<HTMLDivElement | null>;
4
3
  focusOnSelectedDate: () => void;
5
4
  };
@@ -12692,7 +12692,7 @@ function InternalActivator(props, ref) {
12692
12692
  }
12693
12693
 
12694
12694
  function useFocusOnSelectedDate() {
12695
- const ref = React.useRef();
12695
+ const ref = React.useRef(null);
12696
12696
  function focusOnSelectedDate() {
12697
12697
  var _a;
12698
12698
  const selectedDateClass = ".react-datepicker__day--selected";
@@ -12690,7 +12690,7 @@ function InternalActivator(props, ref) {
12690
12690
  }
12691
12691
 
12692
12692
  function useFocusOnSelectedDate() {
12693
- const ref = useRef();
12693
+ const ref = useRef(null);
12694
12694
  function focusOnSelectedDate() {
12695
12695
  var _a;
12696
12696
  const selectedDateClass = ".react-datepicker__day--selected";
@@ -1,9 +1,9 @@
1
- import type { RefObject } from "react";
2
1
  import React from "react";
2
+ import type { RefObject } from "react";
3
3
  import type { XOR } from "ts-xor";
4
4
  import type { Affix, FormFieldProps, Suffix } from "./FormFieldTypes";
5
5
  interface AffixLabelProps extends Affix {
6
- readonly labelRef: RefObject<HTMLDivElement>;
6
+ readonly labelRef: RefObject<HTMLDivElement | null>;
7
7
  readonly variation?: "prefix" | "suffix";
8
8
  }
9
9
  /**