@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
@@ -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,
@@ -11,10 +11,13 @@ function InputGroup({ children, flowDirection = "vertical", }) {
11
11
  const className = classnames(styles.inputGroup, styles[flowDirection]);
12
12
  return React.createElement("div", { className: className }, children);
13
13
  }
14
+ function isInputGroupElement(node) {
15
+ return React.isValidElement(node) && node.type === InputGroup;
16
+ }
14
17
  function isInvalidGroupNesting(childs) {
15
18
  return React.Children.toArray(childs).some(child => {
16
- if (child.type === InputGroup &&
17
- child.props.flowDirection != "horizontal") {
19
+ if (isInputGroupElement(child) &&
20
+ child.props.flowDirection !== "horizontal") {
18
21
  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
22
  return true;
20
23
  }
@@ -9,10 +9,13 @@ function InputGroup({ children, flowDirection = "vertical", }) {
9
9
  const className = classnames(styles.inputGroup, styles[flowDirection]);
10
10
  return React__default.createElement("div", { className: className }, children);
11
11
  }
12
+ function isInputGroupElement(node) {
13
+ return React__default.isValidElement(node) && node.type === InputGroup;
14
+ }
12
15
  function isInvalidGroupNesting(childs) {
13
16
  return React__default.Children.toArray(childs).some(child => {
14
- if (child.type === InputGroup &&
15
- child.props.flowDirection != "horizontal") {
17
+ if (isInputGroupElement(child) &&
18
+ child.props.flowDirection !== "horizontal") {
16
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`);
17
20
  return true;
18
21
  }
@@ -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-"};
@@ -8,7 +8,11 @@ export interface MenuLegacyProps extends MenuBaseProps {
8
8
  /**
9
9
  * Custom menu activator. If this is not provided a default [… More] will be used.
10
10
  */
11
- readonly activator?: ReactElement;
11
+ readonly activator?: ReactElement<{
12
+ fullWidth?: boolean;
13
+ onClick?: (event?: React.MouseEvent) => void;
14
+ [key: string]: unknown;
15
+ }>;
12
16
  /**
13
17
  * Collection of action items.
14
18
  */
@@ -1,4 +1,4 @@
1
- import type { MutableRefObject, PropsWithChildren, ReactNode } from "react";
1
+ import type { PropsWithChildren, ReactNode, RefObject } from "react";
2
2
  import type { ExtendedRefs, FloatingContext, ReferenceType, UseInteractionsReturn } from "@floating-ui/react";
3
3
  import type { XOR } from "ts-xor";
4
4
  import type sizes from "./ModalSizes.module.css";
@@ -18,7 +18,7 @@ export interface ModalContextType {
18
18
  * Ref to specify the activator element. Useful if the activator can unmount
19
19
  * and needs to be re-mounted.
20
20
  */
21
- readonly activatorRef?: MutableRefObject<HTMLElement | null> | null;
21
+ readonly activatorRef?: RefObject<HTMLElement | null>;
22
22
  /**
23
23
  * Refs used by floating-ui to position the modal.
24
24
  */
@@ -57,7 +57,7 @@ export interface ModalContextType {
57
57
  * Tracks whether the current pointer interaction began inside the dialog.
58
58
  * Used to disambiguate outsidePress after nested overlay closes.
59
59
  */
60
- readonly startedInsideRef?: MutableRefObject<boolean>;
60
+ readonly startedInsideRef?: RefObject<boolean>;
61
61
  }
62
62
  export interface ModalActionsProps {
63
63
  /**
@@ -1,4 +1,4 @@
1
- import type { MutableRefObject } from "react";
1
+ import type { RefObject } from "react";
2
2
  import React from "react";
3
3
  import type sizes from "./ModalSizes.module.css";
4
4
  import type { ModalContextType } from "./Modal.types";
@@ -8,7 +8,7 @@ export interface ModalProviderProps {
8
8
  readonly size?: keyof typeof sizes;
9
9
  readonly open?: boolean;
10
10
  readonly onRequestClose?: () => void;
11
- readonly activatorRef?: MutableRefObject<HTMLElement | null> | null;
11
+ readonly activatorRef?: RefObject<HTMLElement | null>;
12
12
  readonly dismissible?: boolean;
13
13
  readonly modalLabelledBy?: string;
14
14
  readonly ariaLabel?: string;
@@ -1,5 +1,5 @@
1
- import type { Dispatch } from "react";
2
1
  import React from "react";
2
+ import type { Dispatch } from "react";
3
3
  import type { Options } from "./types";
4
4
  interface DropDownMenuProps {
5
5
  /**
@@ -12,7 +12,7 @@ var styles = {"dropDownMenuContainer":"zossMHCpMPU-","option":"poS49c-LqiU-","ac
12
12
 
13
13
  function DropDownMenu({ options, setOptions }) {
14
14
  const [highlightedIndex, setHighlightedIndex] = React.useState(0);
15
- const menuDiv = React.useRef();
15
+ const menuDiv = React.useRef(null);
16
16
  const handleOptionClick = React.useCallback((clickedOption) => {
17
17
  setOptions(current => current.map(option => {
18
18
  if (option.label == clickedOption.label) {
@@ -87,13 +87,17 @@ function DropDownMenu({ options, setOptions }) {
87
87
  event.preventDefault();
88
88
  const newIndex = Math.max(0, highlightedIndex - 1);
89
89
  handleOptionFocus(newIndex);
90
- scrollMenuIfItemNotInView(menuDiv.current, "up");
90
+ if (menuDiv.current) {
91
+ scrollMenuIfItemNotInView(menuDiv.current, "up");
92
+ }
91
93
  }
92
94
  function handlePressDown(event) {
93
95
  event.preventDefault();
94
96
  const newIndex = Math.min(options.length - 1, highlightedIndex + 1);
95
97
  handleOptionFocus(newIndex);
96
- scrollMenuIfItemNotInView(menuDiv.current, "down");
98
+ if (menuDiv.current) {
99
+ scrollMenuIfItemNotInView(menuDiv.current, "down");
100
+ }
97
101
  }
98
102
  }
99
103
 
@@ -101,15 +105,16 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
101
105
  const [label, setLabel] = React.useState(defaultLabel);
102
106
  const [menuVisible, setMenuVisible] = React.useState(false);
103
107
  const [focused, setFocused] = React.useState(false);
104
- const multiSelectContainer = React.useRef();
105
- const multiSelectRef = React.useRef();
108
+ const multiSelectContainer = React.useRef(null);
109
+ const multiSelectRef = React.useRef(null);
106
110
  const multiSelectClass = classnames(styles$1.multiSelect, {
107
111
  [styles$1.active]: menuVisible,
108
112
  [styles$1.large]: size === "large",
109
113
  [styles$1.small]: size === "small",
110
114
  });
111
115
  function handleMenuVisibility() {
112
- multiSelectRef.current.focus();
116
+ var _a;
117
+ (_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
113
118
  setMenuVisible(!menuVisible);
114
119
  }
115
120
  const handleClickOutside = (e) => {
@@ -119,6 +124,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
119
124
  }
120
125
  };
121
126
  function handleKeydown(event) {
127
+ var _a;
122
128
  const { key, metaKey, ctrlKey } = event;
123
129
  if (metaKey || ctrlKey)
124
130
  return;
@@ -131,7 +137,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
131
137
  break;
132
138
  }
133
139
  case "Escape": {
134
- multiSelectRef.current.focus();
140
+ (_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
135
141
  setMenuVisible(false);
136
142
  break;
137
143
  }
@@ -10,7 +10,7 @@ var styles = {"dropDownMenuContainer":"zossMHCpMPU-","option":"poS49c-LqiU-","ac
10
10
 
11
11
  function DropDownMenu({ options, setOptions }) {
12
12
  const [highlightedIndex, setHighlightedIndex] = useState(0);
13
- const menuDiv = useRef();
13
+ const menuDiv = useRef(null);
14
14
  const handleOptionClick = useCallback((clickedOption) => {
15
15
  setOptions(current => current.map(option => {
16
16
  if (option.label == clickedOption.label) {
@@ -85,13 +85,17 @@ function DropDownMenu({ options, setOptions }) {
85
85
  event.preventDefault();
86
86
  const newIndex = Math.max(0, highlightedIndex - 1);
87
87
  handleOptionFocus(newIndex);
88
- scrollMenuIfItemNotInView(menuDiv.current, "up");
88
+ if (menuDiv.current) {
89
+ scrollMenuIfItemNotInView(menuDiv.current, "up");
90
+ }
89
91
  }
90
92
  function handlePressDown(event) {
91
93
  event.preventDefault();
92
94
  const newIndex = Math.min(options.length - 1, highlightedIndex + 1);
93
95
  handleOptionFocus(newIndex);
94
- scrollMenuIfItemNotInView(menuDiv.current, "down");
96
+ if (menuDiv.current) {
97
+ scrollMenuIfItemNotInView(menuDiv.current, "down");
98
+ }
95
99
  }
96
100
  }
97
101
 
@@ -99,15 +103,16 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
99
103
  const [label, setLabel] = useState(defaultLabel);
100
104
  const [menuVisible, setMenuVisible] = useState(false);
101
105
  const [focused, setFocused] = useState(false);
102
- const multiSelectContainer = useRef();
103
- const multiSelectRef = useRef();
106
+ const multiSelectContainer = useRef(null);
107
+ const multiSelectRef = useRef(null);
104
108
  const multiSelectClass = classnames(styles$1.multiSelect, {
105
109
  [styles$1.active]: menuVisible,
106
110
  [styles$1.large]: size === "large",
107
111
  [styles$1.small]: size === "small",
108
112
  });
109
113
  function handleMenuVisibility() {
110
- multiSelectRef.current.focus();
114
+ var _a;
115
+ (_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
111
116
  setMenuVisible(!menuVisible);
112
117
  }
113
118
  const handleClickOutside = (e) => {
@@ -117,6 +122,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
117
122
  }
118
123
  };
119
124
  function handleKeydown(event) {
125
+ var _a;
120
126
  const { key, metaKey, ctrlKey } = event;
121
127
  if (metaKey || ctrlKey)
122
128
  return;
@@ -129,7 +135,7 @@ function MultiSelect({ defaultLabel, allSelectedLabel, options, onOptionsChange,
129
135
  break;
130
136
  }
131
137
  case "Escape": {
132
- multiSelectRef.current.focus();
138
+ (_a = multiSelectRef.current) === null || _a === void 0 ? void 0 : _a.focus();
133
139
  setMenuVisible(false);
134
140
  break;
135
141
  }
@@ -1,7 +1,8 @@
1
1
  import type { ReactElement } from "react";
2
2
  import React from "react";
3
+ import type { RadioOptionProps } from "./RadioOption";
3
4
  export interface RadioGroupProps {
4
- readonly children: ReactElement | ReactElement[];
5
+ readonly children: ReactElement<RadioOptionProps> | ReactElement<RadioOptionProps>[];
5
6
  /**
6
7
  * Defines the default value that will be pre-selected in the radio group.
7
8
  */
@@ -33,7 +33,7 @@ interface WithRequiredChildren extends BaseRadioOptionProps {
33
33
  interface WithRequiredLabel extends BaseRadioOptionProps {
34
34
  readonly label: string;
35
35
  }
36
- type RadioOptionProps = XOR<WithRequiredChildren, WithRequiredLabel>;
36
+ export type RadioOptionProps = XOR<WithRequiredChildren, WithRequiredLabel>;
37
37
  /**
38
38
  * For rendering props only. To make updates to
39
39
  * the real RadioOption, look at InternalRadioOption
@@ -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;
@@ -197,7 +197,9 @@ function Tabs({ children, defaultTab = 0, activeTab: controlledActiveTab, onTabC
197
197
  }
198
198
  }, tabIndex: activeTab === index ? 0 : -1 }));
199
199
  }))),
200
- React.createElement("section", { role: "tabpanel", className: styles.tabContent, "aria-label": activeTabProps === null || activeTabProps === void 0 ? void 0 : activeTabProps.label }, activeTabProps === null || activeTabProps === void 0 ? void 0 : activeTabProps.children)));
200
+ React.createElement("section", { role: "tabpanel", className: styles.tabContent, "aria-label": typeof (activeTabProps === null || activeTabProps === void 0 ? void 0 : activeTabProps.label) === "string"
201
+ ? activeTabProps.label
202
+ : undefined }, activeTabProps === null || activeTabProps === void 0 ? void 0 : activeTabProps.children)));
201
203
  }
202
204
  function Tab({ label }) {
203
205
  return React.createElement(React.Fragment, null, label);
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;
@@ -195,7 +195,9 @@ function Tabs({ children, defaultTab = 0, activeTab: controlledActiveTab, onTabC
195
195
  }
196
196
  }, tabIndex: activeTab === index ? 0 : -1 }));
197
197
  }))),
198
- React__default.createElement("section", { role: "tabpanel", className: styles.tabContent, "aria-label": activeTabProps === null || activeTabProps === void 0 ? void 0 : activeTabProps.label }, activeTabProps === null || activeTabProps === void 0 ? void 0 : activeTabProps.children)));
198
+ React__default.createElement("section", { role: "tabpanel", className: styles.tabContent, "aria-label": typeof (activeTabProps === null || activeTabProps === void 0 ? void 0 : activeTabProps.label) === "string"
199
+ ? activeTabProps.label
200
+ : undefined }, activeTabProps === null || activeTabProps === void 0 ? void 0 : activeTabProps.children)));
199
201
  }
200
202
  function Tab({ label }) {
201
203
  return React__default.createElement(React__default.Fragment, null, label);
@@ -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,7 +23,7 @@ var jobberHooks__namespace = /*#__PURE__*/_interopNamespaceDefault(jobberHooks);
23
23
 
24
24
  const mockContainerWidth = (exactWidth) => {
25
25
  jest.spyOn(jobberHooks__namespace, "useResizeObserver").mockReturnValue([
26
- { current: null },
26
+ { current: document.createElement("div") },
27
27
  {
28
28
  width: 1200,
29
29
  height: 800,
@@ -2,7 +2,7 @@ import * as jobberHooks from '@jobber/hooks';
2
2
 
3
3
  const mockContainerWidth = (exactWidth) => {
4
4
  jest.spyOn(jobberHooks, "useResizeObserver").mockReturnValue([
5
- { current: null },
5
+ { current: document.createElement("div") },
6
6
  {
7
7
  width: 1200,
8
8
  height: 800,
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) {
@@ -1,6 +1,6 @@
1
- import type { LegacyRef, MutableRefObject, RefCallback } from "react";
1
+ import type { LegacyRef, RefCallback, RefObject } from "react";
2
2
  /**
3
3
  * Given an array of refs, merge them into a single ref callback.
4
4
  * This is useful for cases where you need to pass a multiple refs to a component.
5
5
  */
6
- export declare function mergeRefs<T = unknown>(refs: Array<MutableRefObject<T> | LegacyRef<T> | undefined | null>): RefCallback<T>;
6
+ export declare function mergeRefs<T = unknown>(refs: Array<RefObject<T> | LegacyRef<T> | undefined | null>): RefCallback<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.103.4",
3
+ "version": "6.103.6",
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": "953deb18e2cf5a920ab5e23295e15aefd3865c0f"
542
542
  }