@jobber/components 6.103.4 → 6.103.5

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 (64) hide show
  1. package/dist/Card-cjs.js +1 -1
  2. package/dist/Card-es.js +1 -1
  3. package/dist/Chip/Chip.d.ts +1 -2
  4. package/dist/Chip/hooks/useChildComponent.d.ts +1 -1
  5. package/dist/Chip/index.cjs +1 -1
  6. package/dist/Chip-cjs.js +5 -4
  7. package/dist/Chip-es.js +5 -4
  8. package/dist/ChipDismissible-cjs.js +4 -4
  9. package/dist/ChipDismissible-es.js +5 -5
  10. package/dist/Chips/InternalChipDismissible/hooks/useInView.d.ts +1 -1
  11. package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissibleInput.d.ts +1 -1
  12. package/dist/Chips/InternalChipDismissible/hooks/useScrollToActive.d.ts +1 -1
  13. package/dist/Combobox/Combobox.types.d.ts +2 -2
  14. package/dist/Combobox/components/ComboboxActivator/ComboboxActivator.d.ts +1 -1
  15. package/dist/Combobox/hooks/useCombobox.d.ts +1 -1
  16. package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +2 -2
  17. package/dist/Combobox/hooks/useComboboxContent.d.ts +1 -1
  18. package/dist/ComboboxActivator-cjs.js +2 -2
  19. package/dist/ComboboxActivator-es.js +3 -3
  20. package/dist/ComboboxTrigger-cjs.js +1 -1
  21. package/dist/ComboboxTrigger-es.js +2 -2
  22. package/dist/DataList/DataList.utils.d.ts +1 -1
  23. package/dist/DataList/components/DataListHeaderTile/components/DataListSortingOptions.d.ts +2 -2
  24. package/dist/DataList.utils-cjs.js +2 -0
  25. package/dist/DataList.utils-es.js +2 -0
  26. package/dist/DataListActions-cjs.js +10 -3
  27. package/dist/DataListActions-es.js +10 -3
  28. package/dist/DataListItem-cjs.js +2 -0
  29. package/dist/DataListItem-es.js +2 -0
  30. package/dist/DataListSort-cjs.js +1 -1
  31. package/dist/DataListSort-es.js +2 -2
  32. package/dist/DatePicker/useFocusOnSelectedDate.d.ts +1 -2
  33. package/dist/DatePicker-cjs.js +1 -1
  34. package/dist/DatePicker-es.js +1 -1
  35. package/dist/FormField/FormFieldAffix.d.ts +1 -1
  36. package/dist/FormField/FormFieldTypes.d.ts +3 -3
  37. package/dist/FormField/hooks/useFormFieldFocus.d.ts +1 -1
  38. package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +2 -2
  39. package/dist/FormField-cjs.js +2 -2
  40. package/dist/FormField-es.js +2 -2
  41. package/dist/InputGroup-cjs.js +1 -0
  42. package/dist/InputGroup-es.js +1 -0
  43. package/dist/InputText/InputText.d.ts +2 -2
  44. package/dist/InputText/useInputTextActions.d.ts +1 -1
  45. package/dist/InputText/useInputTextFormField.d.ts +15 -1
  46. package/dist/InputText/useTextAreaResize.d.ts +2 -2
  47. package/dist/InternalChipDismissible-cjs.js +3 -3
  48. package/dist/InternalChipDismissible-es.js +4 -4
  49. package/dist/Menu-cjs.js +2 -0
  50. package/dist/Menu-es.js +2 -0
  51. package/dist/MultiSelect-cjs.js +13 -7
  52. package/dist/MultiSelect-es.js +13 -7
  53. package/dist/RadioGroup-cjs.js +7 -1
  54. package/dist/RadioGroup-es.js +7 -1
  55. package/dist/Tabs/hooks/useTabsOverflow.d.ts +2 -2
  56. package/dist/Tabs-cjs.js +4 -2
  57. package/dist/Tabs-es.js +4 -2
  58. package/dist/Tooltip/useTooltipPositioning.d.ts +1 -1
  59. package/dist/helpers-cjs.js +1 -0
  60. package/dist/helpers-es.js +1 -0
  61. package/dist/index.cjs +1 -1
  62. package/dist/showToast-cjs.js +2 -2
  63. package/dist/showToast-es.js +2 -2
  64. package/package.json +2 -2
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,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,6 @@
1
1
  import { type ComboboxOption } from "../Combobox.types";
2
2
  interface useComboboxContent {
3
- optionsListRef: React.RefObject<HTMLUListElement>;
3
+ optionsListRef: React.RefObject<HTMLUListElement | null>;
4
4
  onClear?: () => void;
5
5
  onSelectAll?: (selection: ComboboxOption[]) => void;
6
6
  }
@@ -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
 
@@ -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(childrenArray: ReactElement[], childCount?: number): ReactElement<unknown, 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 {};
@@ -149,7 +149,9 @@ function sortBreakpoints(sizeProp) {
149
149
  function getExposedActions(childrenArray, childCount = 2) {
150
150
  const firstNChildren = childrenArray.slice(0, childCount);
151
151
  return firstNChildren.reduce((result, child, i) => {
152
+ // @ts-expect-error - TODO: fix props are type unknown
152
153
  const hasIcon = Boolean(child.props.icon);
154
+ // @ts-expect-error - TODO: fix props are type unknown
153
155
  const isAlwaysVisible = child.props.alwaysVisible; // If true, the child action will always be visible and not nested in the dropdown.
154
156
  if (isAlwaysVisible === false ||
155
157
  (isAlwaysVisible === undefined && !hasIcon)) {
@@ -147,7 +147,9 @@ function sortBreakpoints(sizeProp) {
147
147
  function getExposedActions(childrenArray, childCount = 2) {
148
148
  const firstNChildren = childrenArray.slice(0, childCount);
149
149
  return firstNChildren.reduce((result, child, i) => {
150
+ // @ts-expect-error - TODO: fix props are type unknown
150
151
  const hasIcon = Boolean(child.props.icon);
152
+ // @ts-expect-error - TODO: fix props are type unknown
151
153
  const isAlwaysVisible = child.props.alwaysVisible; // If true, the child action will always be visible and not nested in the dropdown.
152
154
  if (isAlwaysVisible === false ||
153
155
  (isAlwaysVisible === undefined && !hasIcon)) {
@@ -14,7 +14,9 @@ function DataListActions({ children, itemsToExpose = 2, }) {
14
14
  const exposedActions = DataList_utils.getExposedActions(childrenArray, itemsToExpose);
15
15
  childrenArray.splice(0, exposedActions.length);
16
16
  return (React.createElement(React.Fragment, null,
17
- exposedActions.map(({ props }) => {
17
+ exposedActions.map(({ props: actionProps }) => {
18
+ const props = actionProps;
19
+ // @ts-expect-error - TODO: fix activeItem might be undefined
18
20
  const isVisible = props.visible ? props.visible(activeItem) : true;
19
21
  const hasIconOrAlwaysVisible = props.icon || props.alwaysVisible;
20
22
  if (!isVisible || !hasIconOrAlwaysVisible) {
@@ -31,12 +33,17 @@ function DataListActions({ children, itemsToExpose = 2, }) {
31
33
  const actionLabel = getActionLabel();
32
34
  // If the action is always visible, we don't want a tooltip.
33
35
  if (props.alwaysVisible) {
34
- return (React.createElement(Button.Button, { ariaLabel: actionLabel, key: props.label, icon: props.icon, label: actionLabel, onClick: () => {
36
+ return (React.createElement(Button.Button, { ariaLabel: actionLabel,
37
+ // @ts-expect-error - TODO: fix props.label might be a function
38
+ key: props.label, icon: props.icon, label: actionLabel, onClick: () => {
35
39
  var _a;
40
+ // @ts-expect-error - TODO: fix activeItem might be undefined
36
41
  (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
37
42
  }, type: "secondary", variation: "subtle" }));
38
43
  }
39
- return (React.createElement(Tooltip.Tooltip, { key: actionLabel, message: actionLabel },
44
+ return (
45
+ // @ts-expect-error - TODO: fix actionLabel might be undefined
46
+ React.createElement(Tooltip.Tooltip, { key: actionLabel, message: actionLabel },
40
47
  React.createElement(Button.Button, { icon: props.icon, ariaLabel: actionLabel, onClick: () => {
41
48
  var _a, _b;
42
49
  if (activeItem) {
@@ -12,7 +12,9 @@ function DataListActions({ children, itemsToExpose = 2, }) {
12
12
  const exposedActions = getExposedActions(childrenArray, itemsToExpose);
13
13
  childrenArray.splice(0, exposedActions.length);
14
14
  return (React__default.createElement(React__default.Fragment, null,
15
- exposedActions.map(({ props }) => {
15
+ exposedActions.map(({ props: actionProps }) => {
16
+ const props = actionProps;
17
+ // @ts-expect-error - TODO: fix activeItem might be undefined
16
18
  const isVisible = props.visible ? props.visible(activeItem) : true;
17
19
  const hasIconOrAlwaysVisible = props.icon || props.alwaysVisible;
18
20
  if (!isVisible || !hasIconOrAlwaysVisible) {
@@ -29,12 +31,17 @@ function DataListActions({ children, itemsToExpose = 2, }) {
29
31
  const actionLabel = getActionLabel();
30
32
  // If the action is always visible, we don't want a tooltip.
31
33
  if (props.alwaysVisible) {
32
- return (React__default.createElement(Button, { ariaLabel: actionLabel, key: props.label, icon: props.icon, label: actionLabel, onClick: () => {
34
+ return (React__default.createElement(Button, { ariaLabel: actionLabel,
35
+ // @ts-expect-error - TODO: fix props.label might be a function
36
+ key: props.label, icon: props.icon, label: actionLabel, onClick: () => {
33
37
  var _a;
38
+ // @ts-expect-error - TODO: fix activeItem might be undefined
34
39
  (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
35
40
  }, type: "secondary", variation: "subtle" }));
36
41
  }
37
- return (React__default.createElement(Tooltip, { key: actionLabel, message: actionLabel },
42
+ return (
43
+ // @ts-expect-error - TODO: fix actionLabel might be undefined
44
+ React__default.createElement(Tooltip, { key: actionLabel, message: actionLabel },
38
45
  React__default.createElement(Button, { icon: props.icon, ariaLabel: actionLabel, onClick: () => {
39
46
  var _a, _b;
40
47
  if (activeItem) {
@@ -66,7 +66,9 @@ function useGetItemActions(item) {
66
66
  const disableContextMenu = (_a = itemActionComponent === null || itemActionComponent === void 0 ? void 0 : itemActionComponent.props.disableContextMenu) !== null && _a !== void 0 ? _a : false;
67
67
  const actions = React.useMemo(() => {
68
68
  return actionsArray.filter(action => {
69
+ // @ts-expect-error - TODO: fix action.props type is unknown
69
70
  if (React.isValidElement(action) && action.props.visible) {
71
+ // @ts-expect-error - TODO: fix action.props type is unknown
70
72
  return action.props.visible(item);
71
73
  }
72
74
  return true;
@@ -64,7 +64,9 @@ function useGetItemActions(item) {
64
64
  const disableContextMenu = (_a = itemActionComponent === null || itemActionComponent === void 0 ? void 0 : itemActionComponent.props.disableContextMenu) !== null && _a !== void 0 ? _a : false;
65
65
  const actions = useMemo(() => {
66
66
  return actionsArray.filter(action => {
67
+ // @ts-expect-error - TODO: fix action.props type is unknown
67
68
  if (isValidElement(action) && action.props.visible) {
69
+ // @ts-expect-error - TODO: fix action.props type is unknown
68
70
  return action.props.visible(item);
69
71
  }
70
72
  return true;
@@ -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";
@@ -3,7 +3,7 @@ import React 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
  /**
@@ -109,7 +109,7 @@ export interface CommonFormFieldProps {
109
109
  version?: 1;
110
110
  }
111
111
  export interface FormFieldProps extends CommonFormFieldProps {
112
- actionsRef?: RefObject<FieldActionsRef>;
112
+ actionsRef?: RefObject<FieldActionsRef | null>;
113
113
  /**
114
114
  * Determines if the input should be auto-focused, using the HTML attribute
115
115
  */
@@ -126,8 +126,8 @@ export interface FormFieldProps extends CommonFormFieldProps {
126
126
  * `<select>`.
127
127
  */
128
128
  readonly children?: ReactNode;
129
- inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>;
130
- wrapperRef?: RefObject<HTMLDivElement>;
129
+ inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null>;
130
+ wrapperRef?: RefObject<HTMLDivElement | null>;
131
131
  /**
132
132
  * Initial value of the input. Only use this when you need to pre-populate
133
133
  * the field with a data that is not controlled by the components state. If a
@@ -2,7 +2,7 @@ interface UseFormFieldFocus {
2
2
  focused: boolean;
3
3
  }
4
4
  interface UseFormFieldFocusProps {
5
- wrapperRef?: React.RefObject<HTMLDivElement>;
5
+ wrapperRef?: React.RefObject<HTMLDivElement | null>;
6
6
  }
7
7
  export declare const formFieldFocusAttribute: {
8
8
  "data-atl-maintain-portal-focus": string;
@@ -2,8 +2,8 @@ import type { RefObject } from "react";
2
2
  import type { FormFieldProps } from "../FormFieldTypes";
3
3
  export interface useFormFieldWrapperStylesProps extends Pick<FormFieldProps, "size" | "align" | "placeholder" | "value" | "invalid" | "max" | "maxLength" | "type" | "disabled" | "inline"> {
4
4
  readonly error?: string;
5
- suffixRef?: RefObject<HTMLDivElement>;
6
- prefixRef?: RefObject<HTMLDivElement>;
5
+ suffixRef?: RefObject<HTMLDivElement | null>;
6
+ prefixRef?: RefObject<HTMLDivElement | null>;
7
7
  showMiniLabel?: boolean;
8
8
  }
9
9
  export interface LabelPadding {
@@ -150,8 +150,8 @@ function getAffixPaddding({ value, type, prefixWidth, suffixWidth, }) {
150
150
  }
151
151
 
152
152
  function FormFieldWrapper({ align, description, descriptionIdentifier, placeholder, value, children, invalid, error, size, prefix, suffix, max, maxLength, type, disabled, inline, identifier, clearable, onClear, readonly, toolbar, toolbarVisibility = "while-editing", showMiniLabel = true, wrapperRef, }) {
153
- const prefixRef = React.useRef();
154
- const suffixRef = React.useRef();
153
+ const prefixRef = React.useRef(null);
154
+ const suffixRef = React.useRef(null);
155
155
  const { wrapperClasses, containerClasses, wrapperInlineStyle, labelStyle } = useFormFieldWrapperStyles({
156
156
  align,
157
157
  max,
@@ -148,8 +148,8 @@ function getAffixPaddding({ value, type, prefixWidth, suffixWidth, }) {
148
148
  }
149
149
 
150
150
  function FormFieldWrapper({ align, description, descriptionIdentifier, placeholder, value, children, invalid, error, size, prefix, suffix, max, maxLength, type, disabled, inline, identifier, clearable, onClear, readonly, toolbar, toolbarVisibility = "while-editing", showMiniLabel = true, wrapperRef, }) {
151
- const prefixRef = useRef();
152
- const suffixRef = useRef();
151
+ const prefixRef = useRef(null);
152
+ const suffixRef = useRef(null);
153
153
  const { wrapperClasses, containerClasses, wrapperInlineStyle, labelStyle } = useFormFieldWrapperStyles({
154
154
  align,
155
155
  max,
@@ -14,6 +14,7 @@ function InputGroup({ children, flowDirection = "vertical", }) {
14
14
  function isInvalidGroupNesting(childs) {
15
15
  return React.Children.toArray(childs).some(child => {
16
16
  if (child.type === InputGroup &&
17
+ // @ts-expect-error - TODO: fix child.props type is unknown
17
18
  child.props.flowDirection != "horizontal") {
18
19
  console.error(`ERROR: InputGroup not rendered: nesting 'flowDirection="vertical"' columns not supported.`, `https://atlantis.getjobber.com/?path=/story/components-forms-and-inputs-inputgroup-web--nested`);
19
20
  return true;
@@ -12,6 +12,7 @@ function InputGroup({ children, flowDirection = "vertical", }) {
12
12
  function isInvalidGroupNesting(childs) {
13
13
  return React__default.Children.toArray(childs).some(child => {
14
14
  if (child.type === InputGroup &&
15
+ // @ts-expect-error - TODO: fix child.props type is unknown
15
16
  child.props.flowDirection != "horizontal") {
16
17
  console.error(`ERROR: InputGroup not rendered: nesting 'flowDirection="vertical"' columns not supported.`, `https://atlantis.getjobber.com/?path=/story/components-forms-and-inputs-inputgroup-web--nested`);
17
18
  return true;
@@ -26,7 +26,7 @@ export declare const InputText: React.ForwardRefExoticComponent<({
26
26
  readonly prefix?: import("../FormField").Affix | undefined;
27
27
  readonly autofocus?: boolean | undefined;
28
28
  readonly autocomplete?: (boolean | import("../FormField").AutocompleteTypes) | undefined;
29
- inputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement> | undefined;
29
+ inputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null> | undefined;
30
30
  readonly keyboard?: ("numeric" | "decimal") | undefined;
31
31
  readonly maxLength?: number | undefined;
32
32
  readonly suffix?: import("ts-xor").XOR<import("../FormField").Affix, import("../FormField").Suffix> | undefined;
@@ -60,7 +60,7 @@ export declare const InputText: React.ForwardRefExoticComponent<({
60
60
  readonly prefix?: import("../FormField").Affix | undefined;
61
61
  readonly autofocus?: boolean | undefined;
62
62
  readonly autocomplete?: (boolean | import("../FormField").AutocompleteTypes) | undefined;
63
- inputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement> | undefined;
63
+ inputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null> | undefined;
64
64
  readonly keyboard?: ("numeric" | "decimal") | undefined;
65
65
  readonly maxLength?: number | undefined;
66
66
  readonly suffix?: import("ts-xor").XOR<import("../FormField").Affix, import("../FormField").Suffix> | undefined;
@@ -1,7 +1,7 @@
1
1
  import type { ChangeEvent, FocusEvent, KeyboardEvent } from "react";
2
2
  import type { InputTextRebuiltProps } from "./InputText.types";
3
3
  export interface useInputTextActionsProps extends Pick<InputTextRebuiltProps, "onChange" | "onEnter" | "onFocus" | "onBlur" | "onKeyDown"> {
4
- inputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement>;
4
+ inputRef?: React.RefObject<HTMLInputElement | HTMLTextAreaElement | null>;
5
5
  }
6
6
  /**
7
7
  * Combines the actions on the InputText such as onChange, onEnter, onFocus, onBlur, and onClear to forward information to the consumers of the InputText.
@@ -69,7 +69,7 @@ export declare function useInputTextFormField({ id, name, description, inline, h
69
69
  capture?: boolean | "user" | "environment" | undefined;
70
70
  checked?: boolean | undefined;
71
71
  form?: string | undefined;
72
- formAction?: string | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS] | undefined;
72
+ formAction?: string | ((formData: FormData) => void | Promise<void>) | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS] | undefined;
73
73
  formEncType?: string | undefined;
74
74
  formMethod?: string | undefined;
75
75
  formNoValidate?: boolean | undefined;
@@ -135,6 +135,10 @@ export declare function useInputTextFormField({ id, name, description, inline, h
135
135
  results?: number | undefined;
136
136
  security?: string | undefined;
137
137
  unselectable?: "on" | "off" | undefined;
138
+ popover?: "" | "auto" | "manual" | "hint" | undefined;
139
+ popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
140
+ popoverTarget?: string | undefined;
141
+ inert?: boolean | undefined;
138
142
  is?: string | undefined;
139
143
  exportparts?: string | undefined;
140
144
  part?: string | undefined;
@@ -337,6 +341,8 @@ export declare function useInputTextFormField({ id, name, description, inline, h
337
341
  onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
338
342
  onScroll?: import("react").UIEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
339
343
  onScrollCapture?: import("react").UIEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
344
+ onScrollEnd?: import("react").UIEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
345
+ onScrollEndCapture?: import("react").UIEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
340
346
  onWheel?: import("react").WheelEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
341
347
  onWheelCapture?: import("react").WheelEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
342
348
  onAnimationStart?: import("react").AnimationEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
@@ -345,8 +351,16 @@ export declare function useInputTextFormField({ id, name, description, inline, h
345
351
  onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
346
352
  onAnimationIteration?: import("react").AnimationEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
347
353
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
354
+ onToggle?: import("react").ToggleEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
355
+ onBeforeToggle?: import("react").ToggleEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
356
+ onTransitionCancel?: import("react").TransitionEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
357
+ onTransitionCancelCapture?: import("react").TransitionEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
348
358
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
349
359
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
360
+ onTransitionRun?: import("react").TransitionEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
361
+ onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
362
+ onTransitionStart?: import("react").TransitionEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
363
+ onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
350
364
  };
351
365
  descriptionIdentifier: string;
352
366
  };
@@ -6,8 +6,8 @@ import type { RowRange } from "./InputText.types";
6
6
  export declare function useTextAreaResize({ rows, value, inputRef, wrapperRef, }: {
7
7
  rows?: number | RowRange;
8
8
  value: string | number | Date | undefined;
9
- inputRef: RefObject<HTMLTextAreaElement | HTMLInputElement>;
10
- wrapperRef: RefObject<HTMLDivElement>;
9
+ inputRef: RefObject<HTMLTextAreaElement | HTMLInputElement | null>;
10
+ wrapperRef: RefObject<HTMLDivElement | null>;
11
11
  }): {
12
12
  resize: () => void;
13
13
  rowRange: RowRange;
@@ -14,9 +14,9 @@ var Chip = require('./Chip-cjs.js');
14
14
  require('./tslib.es6-cjs.js');
15
15
 
16
16
  function InternalChip({ label, active = false, disabled = false, invalid = false, prefix, suffix, tabIndex, ariaLabel, onClick, onKeyDown, }) {
17
- return (React.createElement(Chip.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 },
18
- prefix && React.createElement(Chip.ChipNamespace.Prefix, null, prefix),
19
- suffix && React.createElement(Chip.ChipNamespace.Suffix, null, suffix)));
17
+ return (React.createElement(Chip.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 },
18
+ prefix && React.createElement(Chip.Chip.Prefix, null, prefix),
19
+ suffix && React.createElement(Chip.Chip.Suffix, null, suffix)));
20
20
  }
21
21
 
22
22
  var styles = {"wrapper":"XRnU90M2-fs-","input":"Dq-yFHd1zK0-","menu":"F7CpurjKzBI-","menuListOption":"_9SAK31TqNDY-","loadingIndicator":"s5vFJVv0t0Q-","activeOption":"_8d0w-JzgzS4-","spinning":"hDJGLX6kE-U-"};
@@ -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-"};
package/dist/Menu-cjs.js CHANGED
@@ -126,6 +126,7 @@ function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
126
126
  const { width } = jobberHooks.useWindowDimensions();
127
127
  const buttonID = React.useId();
128
128
  const menuID = React.useId();
129
+ // @ts-expect-error - TODO: fix activator.props type is unknown
129
130
  const fullWidth = ((_a = activator === null || activator === void 0 ? void 0 : activator.props) === null || _a === void 0 ? void 0 : _a.fullWidth) || false;
130
131
  const wrapperClasses = classnames(styles.wrapper, {
131
132
  [styles.fullWidth]: fullWidth,
@@ -198,6 +199,7 @@ function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
198
199
  }))));
199
200
  return (React.createElement("div", { className: wrapperClasses, onClick: handleParentClick },
200
201
  React.createElement("div", Object.assign({ ref: setReferenceElement }, getReferenceProps()), React.cloneElement(activator, {
202
+ // @ts-expect-error - TODO: fix activator.props type is unknown, onClick doesn't exist in unknown type
201
203
  onClick: toggle(activator.props.onClick),
202
204
  id: buttonID,
203
205
  ariaControls: menuID,
package/dist/Menu-es.js CHANGED
@@ -124,6 +124,7 @@ function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
124
124
  const { width } = useWindowDimensions();
125
125
  const buttonID = useId();
126
126
  const menuID = useId();
127
+ // @ts-expect-error - TODO: fix activator.props type is unknown
127
128
  const fullWidth = ((_a = activator === null || activator === void 0 ? void 0 : activator.props) === null || _a === void 0 ? void 0 : _a.fullWidth) || false;
128
129
  const wrapperClasses = classnames(styles.wrapper, {
129
130
  [styles.fullWidth]: fullWidth,
@@ -196,6 +197,7 @@ function MenuLegacy({ activator, items, UNSAFE_className, UNSAFE_style, }) {
196
197
  }))));
197
198
  return (React__default.createElement("div", { className: wrapperClasses, onClick: handleParentClick },
198
199
  React__default.createElement("div", Object.assign({ ref: setReferenceElement }, getReferenceProps()), React__default.cloneElement(activator, {
200
+ // @ts-expect-error - TODO: fix activator.props type is unknown, onClick doesn't exist in unknown type
199
201
  onClick: toggle(activator.props.onClick),
200
202
  id: buttonID,
201
203
  ariaControls: menuID,
@@ -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
  }
@@ -31,7 +31,13 @@ function RadioGroup({ children, value, ariaLabel, onChange, name = React.useId()
31
31
  const className = classnames(styles.radioGroup, {
32
32
  [styles.directionHorizontal]: direction === "horizontal",
33
33
  });
34
- return (React.createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: className }, React.Children.map(children, option => (React.createElement(InternalRadioOption, Object.assign({ checked: value === option.props.value, name: name, onChange: handleChange }, option.props), option.props.children)))));
34
+ return (React.createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: className }, React.Children.map(children, option => (
35
+ // @ts-expect-error - TODO: it thinks value is missing, but it's probably coming from option.props
36
+ React.createElement(InternalRadioOption
37
+ // @ts-expect-error - TODO: fix option.props type is unknown
38
+ , Object.assign({
39
+ // @ts-expect-error - TODO: fix option.props type is unknown
40
+ checked: value === option.props.value, name: name, onChange: handleChange }, option.props), option.props.children)))));
35
41
  function handleChange(newValue) {
36
42
  if (newValue !== value) {
37
43
  onChange(newValue);
@@ -29,7 +29,13 @@ function RadioGroup({ children, value, ariaLabel, onChange, name = useId(), dire
29
29
  const className = classnames(styles.radioGroup, {
30
30
  [styles.directionHorizontal]: direction === "horizontal",
31
31
  });
32
- return (React__default.createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: className }, React__default.Children.map(children, option => (React__default.createElement(InternalRadioOption, Object.assign({ checked: value === option.props.value, name: name, onChange: handleChange }, option.props), option.props.children)))));
32
+ return (React__default.createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: className }, React__default.Children.map(children, option => (
33
+ // @ts-expect-error - TODO: it thinks value is missing, but it's probably coming from option.props
34
+ React__default.createElement(InternalRadioOption
35
+ // @ts-expect-error - TODO: fix option.props type is unknown
36
+ , Object.assign({
37
+ // @ts-expect-error - TODO: fix option.props type is unknown
38
+ checked: value === option.props.value, name: name, onChange: handleChange }, option.props), option.props.children)))));
33
39
  function handleChange(newValue) {
34
40
  if (newValue !== value) {
35
41
  onChange(newValue);
@@ -1,8 +1,8 @@
1
- import type { MutableRefObject } from "react";
1
+ import type { RefObject } from "react";
2
2
  interface UseTabsOverflow {
3
3
  overflowRight: boolean;
4
4
  overflowLeft: boolean;
5
- tabRow: MutableRefObject<HTMLUListElement>;
5
+ tabRow: RefObject<HTMLUListElement | null>;
6
6
  }
7
7
  export declare function useTabsOverflow(): UseTabsOverflow;
8
8
  export {};
package/dist/Tabs-cjs.js CHANGED
@@ -84,7 +84,7 @@ var throttle$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(throttle_
84
84
  function useTabsOverflow() {
85
85
  const [overflowRight, setOverflowRight] = React.useState(false);
86
86
  const [overflowLeft, setOverflowLeft] = React.useState(false);
87
- const tabRow = React.useRef();
87
+ const tabRow = React.useRef(null);
88
88
  const handleOverflowing = () => {
89
89
  if (tabRow.current) {
90
90
  const scrollWidth = tabRow.current.scrollWidth;
@@ -187,7 +187,9 @@ function Tabs({ children, defaultTab = 0, activeTab: controlledActiveTab, onTabC
187
187
  if (!isChildTab(child)) {
188
188
  return child;
189
189
  }
190
- const index = tabChildren.findIndex(tab => tab.props.label === child.props.label);
190
+ const index = tabChildren.findIndex(
191
+ // @ts-expect-error - TODO: fix tab.props type is unknown
192
+ tab => tab.props.label === child.props.label);
191
193
  return (React.createElement(InternalTab, { label: child.props.label, selected: activeTab === index, activateTab: activateTab(index), onClick: child.props.onClick, ref: el => {
192
194
  if (el) {
193
195
  tabRefs.current.set(index, el);
package/dist/Tabs-es.js CHANGED
@@ -82,7 +82,7 @@ var throttle$1 = /*@__PURE__*/getDefaultExportFromCjs(throttle_1);
82
82
  function useTabsOverflow() {
83
83
  const [overflowRight, setOverflowRight] = useState(false);
84
84
  const [overflowLeft, setOverflowLeft] = useState(false);
85
- const tabRow = useRef();
85
+ const tabRow = useRef(null);
86
86
  const handleOverflowing = () => {
87
87
  if (tabRow.current) {
88
88
  const scrollWidth = tabRow.current.scrollWidth;
@@ -185,7 +185,9 @@ function Tabs({ children, defaultTab = 0, activeTab: controlledActiveTab, onTabC
185
185
  if (!isChildTab(child)) {
186
186
  return child;
187
187
  }
188
- const index = tabChildren.findIndex(tab => tab.props.label === child.props.label);
188
+ const index = tabChildren.findIndex(
189
+ // @ts-expect-error - TODO: fix tab.props type is unknown
190
+ tab => tab.props.label === child.props.label);
189
191
  return (React__default.createElement(InternalTab, { label: child.props.label, selected: activeTab === index, activateTab: activateTab(index), onClick: child.props.onClick, ref: el => {
190
192
  if (el) {
191
193
  tabRefs.current.set(index, el);
@@ -11,7 +11,7 @@ export declare function useTooltipPositioning({ preferredPlacement, }: ToolTipPo
11
11
  }) | undefined;
12
12
  };
13
13
  placement: import("@floating-ui/utils").Placement;
14
- shadowRef: import("react").RefObject<HTMLSpanElement>;
14
+ shadowRef: import("react").RefObject<HTMLSpanElement | null>;
15
15
  setArrowRef: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null | undefined>>;
16
16
  setTooltipRef: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
17
17
  };
@@ -23,6 +23,7 @@ var jobberHooks__namespace = /*#__PURE__*/_interopNamespaceDefault(jobberHooks);
23
23
 
24
24
  const mockContainerWidth = (exactWidth) => {
25
25
  jest.spyOn(jobberHooks__namespace, "useResizeObserver").mockReturnValue([
26
+ // @ts-expect-error - TODO: fix this mock ref value
26
27
  { current: null },
27
28
  {
28
29
  width: 1200,
@@ -2,6 +2,7 @@ import * as jobberHooks from '@jobber/hooks';
2
2
 
3
3
  const mockContainerWidth = (exactWidth) => {
4
4
  jest.spyOn(jobberHooks, "useResizeObserver").mockReturnValue([
5
+ // @ts-expect-error - TODO: fix this mock ref value
5
6
  { current: null },
6
7
  {
7
8
  width: 1200,
package/dist/index.cjs CHANGED
@@ -219,7 +219,7 @@ exports.Cluster = Cluster.Cluster;
219
219
  exports.Container = Container.Container;
220
220
  exports.Cover = Cover.Cover;
221
221
  exports.Checkbox = Checkbox_index.Checkbox;
222
- exports.Chip = Chip.ChipNamespace;
222
+ exports.Chip = Chip.Chip;
223
223
  exports.ChipDismissible = ChipDismissible.ChipDismissible;
224
224
  exports.ChipSelectable = ChipDismissible.ChipSelectable;
225
225
  exports.Icon = Icon.Icon;
@@ -84,8 +84,8 @@ function showToast(props) {
84
84
  }
85
85
  const ToastContainer = React.forwardRef(ToastInternal);
86
86
  function ToasterOven(props) {
87
- const toastRef = React.useRef();
88
- React.useEffect(() => toastRef.current.add(props));
87
+ const toastRef = React.useRef(null);
88
+ React.useEffect(() => { var _a; return (_a = toastRef.current) === null || _a === void 0 ? void 0 : _a.add(props); });
89
89
  return React.createElement(ToastContainer, { ref: toastRef });
90
90
  }
91
91
  function ToastInternal(_, ref) {
@@ -82,8 +82,8 @@ function showToast(props) {
82
82
  }
83
83
  const ToastContainer = forwardRef(ToastInternal);
84
84
  function ToasterOven(props) {
85
- const toastRef = useRef();
86
- useEffect(() => toastRef.current.add(props));
85
+ const toastRef = useRef(null);
86
+ useEffect(() => { var _a; return (_a = toastRef.current) === null || _a === void 0 ? void 0 : _a.add(props); });
87
87
  return React__default.createElement(ToastContainer, { ref: toastRef });
88
88
  }
89
89
  function ToastInternal(_, ref) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.103.4",
3
+ "version": "6.103.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -538,5 +538,5 @@
538
538
  "> 1%",
539
539
  "IE 10"
540
540
  ],
541
- "gitHead": "89fec0b77276ec2b2fc80f4fc4ec2f6d207c1ac6"
541
+ "gitHead": "4b120bbb1789aa1b6b9a8eaf157be90d4ea15efc"
542
542
  }