@jobber/components 6.86.2 → 6.86.3

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 (79) hide show
  1. package/dist/Autocomplete/index.cjs +12 -13
  2. package/dist/Autocomplete/index.mjs +16 -17
  3. package/dist/Banner-cjs.js +1 -1
  4. package/dist/Banner-es.js +1 -1
  5. package/dist/Chip-cjs.js +2 -2
  6. package/dist/Chip-es.js +3 -3
  7. package/dist/Combobox-cjs.js +1 -1
  8. package/dist/Combobox-es.js +2 -2
  9. package/dist/ComboboxContent-cjs.js +2 -2
  10. package/dist/ComboboxContent-es.js +5 -5
  11. package/dist/ComboboxLoadMore-cjs.js +1 -1
  12. package/dist/ComboboxLoadMore-es.js +2 -2
  13. package/dist/ConfirmationModal-cjs.js +1 -1
  14. package/dist/ConfirmationModal-es.js +2 -2
  15. package/dist/ContentBlock-cjs.js +1 -1
  16. package/dist/ContentBlock-es.js +2 -2
  17. package/dist/DataListActionsMenu-cjs.js +4 -4
  18. package/dist/DataListActionsMenu-es.js +8 -8
  19. package/dist/DataListHeaderTile-cjs.js +1 -1
  20. package/dist/DataListHeaderTile-es.js +2 -2
  21. package/dist/DataListLoadMore-cjs.js +1 -1
  22. package/dist/DataListLoadMore-es.js +2 -2
  23. package/dist/DataListOverflowFade-cjs.js +2 -2
  24. package/dist/DataListOverflowFade-es.js +3 -3
  25. package/dist/DataListSearch-cjs.js +1 -1
  26. package/dist/DataListSearch-es.js +2 -2
  27. package/dist/DataListSortingOptions-cjs.js +2 -2
  28. package/dist/DataListSortingOptions-es.js +4 -4
  29. package/dist/DataTable/test-utilities/index.cjs +1 -1
  30. package/dist/DataTable/test-utilities/index.mjs +1 -1
  31. package/dist/DataTable-cjs.js +3 -3
  32. package/dist/DataTable-es.js +4 -4
  33. package/dist/DatePicker-cjs.js +1 -1
  34. package/dist/DatePicker-es.js +2 -2
  35. package/dist/Disclosure-cjs.js +2 -2
  36. package/dist/Disclosure-es.js +3 -3
  37. package/dist/FormField-cjs.js +5 -1
  38. package/dist/FormField-es.js +5 -1
  39. package/dist/InputText/InputText.d.ts +2 -2
  40. package/dist/InputText/index.cjs +2 -2
  41. package/dist/InputText/index.mjs +3 -3
  42. package/dist/LightBox-cjs.js +67 -51
  43. package/dist/LightBox-es.js +73 -57
  44. package/dist/Menu-cjs.js +11 -6
  45. package/dist/Menu-es.js +16 -11
  46. package/dist/Modal/index.cjs +3 -3
  47. package/dist/Modal/index.mjs +7 -7
  48. package/dist/Page-cjs.js +4 -4
  49. package/dist/Page-es.js +5 -5
  50. package/dist/Popover-cjs.js +1 -1
  51. package/dist/Popover-es.js +3 -3
  52. package/dist/SideDrawer-cjs.js +6 -6
  53. package/dist/SideDrawer-es.js +10 -10
  54. package/dist/Tooltip-cjs.js +2 -2
  55. package/dist/Tooltip-es.js +5 -5
  56. package/dist/floating-ui.react-es.js +1 -1
  57. package/dist/index.cjs +6 -7
  58. package/dist/index.mjs +6 -7
  59. package/dist/throttle-cjs.js +1 -0
  60. package/dist/throttle-es.js +1 -1
  61. package/dist/useDebounce-cjs.js +4383 -70
  62. package/dist/useDebounce-es.js +4384 -72
  63. package/dist/useFocusTrap-cjs.js +8 -3
  64. package/dist/useFocusTrap-es.js +9 -4
  65. package/dist/useInView-cjs.js +10 -5
  66. package/dist/useInView-es.js +11 -6
  67. package/dist/useIsMounted-cjs.js +19 -4
  68. package/dist/useIsMounted-es.js +20 -5
  69. package/dist/useOnKeyDown-cjs.js +7 -2
  70. package/dist/useOnKeyDown-es.js +8 -3
  71. package/dist/useRefocusOnActivator-cjs.js +7 -2
  72. package/dist/useRefocusOnActivator-es.js +8 -3
  73. package/dist/useResizeObserver-cjs.js +92 -64
  74. package/dist/useResizeObserver-es.js +94 -65
  75. package/dist/useSafeLayoutEffect-cjs.js +8 -3
  76. package/dist/useSafeLayoutEffect-es.js +10 -5
  77. package/dist/useScrollToActive-cjs.js +9 -4
  78. package/dist/useScrollToActive-es.js +11 -6
  79. package/package.json +4 -4
@@ -2,8 +2,8 @@
2
2
 
3
3
  var helpers = require('../../helpers-cjs.js');
4
4
  require('../../useResizeObserver-cjs.js');
5
- require('react');
6
5
  require('../../_commonjsHelpers-cjs.js');
6
+ require('react');
7
7
  require('../../throttle-cjs.js');
8
8
  require('../../debounce-cjs.js');
9
9
  require('../../isObjectLike-cjs.js');
@@ -1,7 +1,7 @@
1
1
  export { m as mockContainerWidth } from '../../helpers-es.js';
2
2
  import '../../useResizeObserver-es.js';
3
- import 'react';
4
3
  import '../../_commonjsHelpers-es.js';
4
+ import 'react';
5
5
  import '../../throttle-es.js';
6
6
  import '../../debounce-es.js';
7
7
  import '../../isObjectLike-es.js';
@@ -177,7 +177,7 @@ function Header({ table, stickyHeader, sorting, onRowClick, }) {
177
177
  }
178
178
 
179
179
  function DataTable({ data, columns, pagination, sorting, height, stickyHeader, pinFirstColumn, onRowClick, emptyState, loading = false, }) {
180
- const [ref, { exactWidth }] = useResizeObserver.useResizeObserver();
180
+ const [ref, { exactWidth }] = useResizeObserver.useResizeObserver.useResizeObserver();
181
181
  const tableSettings = createTableSettings(data, columns, {
182
182
  pagination,
183
183
  sorting,
@@ -193,10 +193,10 @@ function DataTable({ data, columns, pagination, sorting, height, stickyHeader, p
193
193
  React.createElement(Body, { table: table, onRowClick: onRowClick, emptyState: emptyState, loading: loading }),
194
194
  table.getRowModel().rows.length &&
195
195
  exactWidth &&
196
- exactWidth > useResizeObserver.Breakpoints.small ? (React.createElement(Footer, { table: table, viewType: "desktop" })) : null)),
196
+ exactWidth > useResizeObserver.useResizeObserver.Breakpoints.small ? (React.createElement(Footer, { table: table, viewType: "desktop" })) : null)),
197
197
  table.getRowModel().rows.length &&
198
198
  exactWidth &&
199
- exactWidth <= useResizeObserver.Breakpoints.small ? (React.createElement(Footer, { table: table })) : null,
199
+ exactWidth <= useResizeObserver.useResizeObserver.Breakpoints.small ? (React.createElement(Footer, { table: table })) : null,
200
200
  pagination && (React.createElement(Pagination, { table: table, itemsPerPage: pagination.itemsPerPage, totalItems: pagination.manualPagination
201
201
  ? pagination.totalItems
202
202
  : table.getCoreRowModel().rows.length, loading: loading, onPageChange: () => { var _a; return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0); } }))));
@@ -1,7 +1,7 @@
1
1
  import { flexRender, getCoreRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
2
2
  import classnames from 'classnames';
3
3
  import React__default, { useCallback, useMemo } from 'react';
4
- import { u as useResizeObserver, B as Breakpoints } from './useResizeObserver-es.js';
4
+ import { u as useResizeObserver } from './useResizeObserver-es.js';
5
5
  import { G as Glimmer } from './Glimmer-es.js';
6
6
  import { _ as __rest } from './tslib.es6-es.js';
7
7
  import { Select, Option as SelectOption } from './Select/index.mjs';
@@ -175,7 +175,7 @@ function Header({ table, stickyHeader, sorting, onRowClick, }) {
175
175
  }
176
176
 
177
177
  function DataTable({ data, columns, pagination, sorting, height, stickyHeader, pinFirstColumn, onRowClick, emptyState, loading = false, }) {
178
- const [ref, { exactWidth }] = useResizeObserver();
178
+ const [ref, { exactWidth }] = useResizeObserver.useResizeObserver();
179
179
  const tableSettings = createTableSettings(data, columns, {
180
180
  pagination,
181
181
  sorting,
@@ -191,10 +191,10 @@ function DataTable({ data, columns, pagination, sorting, height, stickyHeader, p
191
191
  React__default.createElement(Body, { table: table, onRowClick: onRowClick, emptyState: emptyState, loading: loading }),
192
192
  table.getRowModel().rows.length &&
193
193
  exactWidth &&
194
- exactWidth > Breakpoints.small ? (React__default.createElement(Footer, { table: table, viewType: "desktop" })) : null)),
194
+ exactWidth > useResizeObserver.Breakpoints.small ? (React__default.createElement(Footer, { table: table, viewType: "desktop" })) : null)),
195
195
  table.getRowModel().rows.length &&
196
196
  exactWidth &&
197
- exactWidth <= Breakpoints.small ? (React__default.createElement(Footer, { table: table })) : null,
197
+ exactWidth <= useResizeObserver.Breakpoints.small ? (React__default.createElement(Footer, { table: table })) : null,
198
198
  pagination && (React__default.createElement(Pagination, { table: table, itemsPerPage: pagination.itemsPerPage, totalItems: pagination.manualPagination
199
199
  ? pagination.totalItems
200
200
  : table.getCoreRowModel().rows.length, loading: loading, onPageChange: () => { var _a; return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0); } }))));
@@ -9779,7 +9779,7 @@ function DatePicker({ onChange, onMonthChange, activator, inline, selected, read
9779
9779
  });
9780
9780
  const { pickerRef } = useEscapeKeyToCloseDatePicker(open, ref);
9781
9781
  if (smartAutofocus) {
9782
- useRefocusOnActivator.useRefocusOnActivator(open);
9782
+ useRefocusOnActivator.useRefocusOnActivator_2(open);
9783
9783
  React.useEffect(focusOnSelectedDate, [open]);
9784
9784
  }
9785
9785
  return (React.createElement("div", { className: wrapperClassName, ref: ref, "data-elevation": "elevated" },
@@ -5,7 +5,7 @@ import './index-es.js';
5
5
  import * as ReactDOM from 'react-dom';
6
6
  import ReactDOM__default from 'react-dom';
7
7
  import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
8
- import { u as useRefocusOnActivator } from './useRefocusOnActivator-es.js';
8
+ import { u as useRefocusOnActivator_2 } from './useRefocusOnActivator-es.js';
9
9
  import { T as Typography } from './Typography-es.js';
10
10
  import { B as Button } from './Button-es.js';
11
11
  import { o as omit } from './omit-es.js';
@@ -9759,7 +9759,7 @@ function DatePicker({ onChange, onMonthChange, activator, inline, selected, read
9759
9759
  });
9760
9760
  const { pickerRef } = useEscapeKeyToCloseDatePicker(open, ref);
9761
9761
  if (smartAutofocus) {
9762
- useRefocusOnActivator(open);
9762
+ useRefocusOnActivator_2(open);
9763
9763
  useEffect(focusOnSelectedDate, [open]);
9764
9764
  }
9765
9765
  return (React__default.createElement("div", { className: wrapperClassName, ref: ref, "data-elevation": "elevated" },
@@ -12,8 +12,8 @@ function Disclosure({ children, title, defaultOpen = false, onToggle, open, UNSA
12
12
  var _a, _b, _c, _d;
13
13
  const [internalOpen, setInternalOpen] = React.useState(defaultOpen || open || false);
14
14
  const isOpen = open !== undefined ? open : internalOpen;
15
- const [titleRef, { exactWidth }] = useResizeObserver.useResizeObserver();
16
- const isBelowBreakpoint = exactWidth && exactWidth < useResizeObserver.Breakpoints.small;
15
+ const [titleRef, { exactWidth }] = useResizeObserver.useResizeObserver.useResizeObserver();
16
+ const isBelowBreakpoint = exactWidth && exactWidth < useResizeObserver.useResizeObserver.Breakpoints.small;
17
17
  const isTitleString = typeof title === "string";
18
18
  const containerClassNames = classnames(styles.details, UNSAFE_className.container);
19
19
  const summaryClassNames = classnames(styles.summary, UNSAFE_className.summary);
@@ -1,6 +1,6 @@
1
1
  import React__default, { useState } from 'react';
2
2
  import classnames from 'classnames';
3
- import { u as useResizeObserver, B as Breakpoints } from './useResizeObserver-es.js';
3
+ import { u as useResizeObserver } from './useResizeObserver-es.js';
4
4
  import { I as Icon } from './Icon-es.js';
5
5
  import { T as Typography } from './Typography-es.js';
6
6
 
@@ -10,8 +10,8 @@ function Disclosure({ children, title, defaultOpen = false, onToggle, open, UNSA
10
10
  var _a, _b, _c, _d;
11
11
  const [internalOpen, setInternalOpen] = useState(defaultOpen || open || false);
12
12
  const isOpen = open !== undefined ? open : internalOpen;
13
- const [titleRef, { exactWidth }] = useResizeObserver();
14
- const isBelowBreakpoint = exactWidth && exactWidth < Breakpoints.small;
13
+ const [titleRef, { exactWidth }] = useResizeObserver.useResizeObserver();
14
+ const isBelowBreakpoint = exactWidth && exactWidth < useResizeObserver.Breakpoints.small;
15
15
  const isTitleString = typeof title === "string";
16
16
  const containerClassNames = classnames(styles.details, UNSAFE_className.container);
17
17
  const summaryClassNames = classnames(styles.summary, UNSAFE_className.summary);
@@ -13,6 +13,10 @@ var Spinner = require('./Spinner-cjs.js');
13
13
  var tslib_es6 = require('./tslib.es6-cjs.js');
14
14
  var reactHookForm = require('react-hook-form');
15
15
 
16
+ var useShowClear$1 = {};
17
+
18
+ Object.defineProperty(useShowClear$1, "__esModule", { value: true });
19
+ var useShowClear_2 = useShowClear$1.useShowClear = useShowClear;
16
20
  function useShowClear({ clearable, multiline, focused, hasValue, readonly, disabled = false, }) {
17
21
  if (multiline && clearable !== "never") {
18
22
  throw new Error("Multiline inputs can not be clearable");
@@ -184,7 +188,7 @@ function FormFieldWrapper({ align, description, descriptionIdentifier, placehold
184
188
  showMiniLabel,
185
189
  });
186
190
  const { focused } = useFormFieldFocus.useFormFieldFocus({ wrapperRef });
187
- const showClear = useShowClear({
191
+ const showClear = useShowClear_2({
188
192
  clearable,
189
193
  multiline: type === "textarea",
190
194
  focused,
@@ -11,6 +11,10 @@ import { S as Spinner } from './Spinner-es.js';
11
11
  import { _ as __rest } from './tslib.es6-es.js';
12
12
  import { useFormContext, useForm, useController } from 'react-hook-form';
13
13
 
14
+ var useShowClear$1 = {};
15
+
16
+ Object.defineProperty(useShowClear$1, "__esModule", { value: true });
17
+ var useShowClear_2 = useShowClear$1.useShowClear = useShowClear;
14
18
  function useShowClear({ clearable, multiline, focused, hasValue, readonly, disabled = false, }) {
15
19
  if (multiline && clearable !== "never") {
16
20
  throw new Error("Multiline inputs can not be clearable");
@@ -182,7 +186,7 @@ function FormFieldWrapper({ align, description, descriptionIdentifier, placehold
182
186
  showMiniLabel,
183
187
  });
184
188
  const { focused } = useFormFieldFocus({ wrapperRef });
185
- const showClear = useShowClear({
189
+ const showClear = useShowClear_2({
186
190
  clearable,
187
191
  multiline: type === "textarea",
188
192
  focused,
@@ -17,7 +17,7 @@ export declare const InputText: React.ForwardRefExoticComponent<({
17
17
  readonly placeholder?: string | undefined;
18
18
  readonly size?: ("small" | "large") | undefined;
19
19
  readonly value?: (string | number | Date) | undefined;
20
- readonly clearable?: import("@jobber/hooks").Clearable | undefined;
20
+ readonly clearable?: import("@jobber/hooks/dist").Clearable | undefined;
21
21
  version?: 1 | undefined;
22
22
  onFocus?: ((event?: React.FocusEvent) => void) | undefined;
23
23
  onBlur?: ((event?: React.FocusEvent) => void) | undefined;
@@ -51,7 +51,7 @@ export declare const InputText: React.ForwardRefExoticComponent<({
51
51
  readonly placeholder?: string | undefined;
52
52
  readonly size?: ("small" | "large") | undefined;
53
53
  readonly value?: (string | number | Date) | undefined;
54
- readonly clearable?: import("@jobber/hooks").Clearable | undefined;
54
+ readonly clearable?: import("@jobber/hooks/dist").Clearable | undefined;
55
55
  version?: 1 | undefined;
56
56
  onFocus?: ((event?: React.FocusEvent) => void) | undefined;
57
57
  onBlur?: ((event?: React.FocusEvent) => void) | undefined;
@@ -34,7 +34,7 @@ require('../_setToString-cjs.js');
34
34
  */
35
35
  function useTextAreaResize({ rows, value, inputRef, wrapperRef, }) {
36
36
  const rowRange = getRowRange(rows);
37
- useSafeLayoutEffect.useSafeLayoutEffect(() => {
37
+ useSafeLayoutEffect.useSafeLayoutEffect_1(() => {
38
38
  if (inputRef &&
39
39
  inputRef.current instanceof HTMLTextAreaElement &&
40
40
  wrapperRef &&
@@ -45,7 +45,7 @@ function useTextAreaResize({ rows, value, inputRef, wrapperRef, }) {
45
45
  // When the consumer passes a new controlled value, we need to recheck the size.
46
46
  // The timeout ensures the DOM has a enough time to render the new text before
47
47
  // we access the height.
48
- useSafeLayoutEffect.useSafeLayoutEffect(() => {
48
+ useSafeLayoutEffect.useSafeLayoutEffect_1(() => {
49
49
  setTimeout(() => {
50
50
  if (inputRef &&
51
51
  inputRef.current instanceof HTMLTextAreaElement &&
@@ -1,5 +1,5 @@
1
1
  import React__default, { forwardRef, useRef, useImperativeHandle, useId } from 'react';
2
- import { u as useSafeLayoutEffect } from '../useSafeLayoutEffect-es.js';
2
+ import { u as useSafeLayoutEffect_1 } from '../useSafeLayoutEffect-es.js';
3
3
  import { k as FormField, s as styles, j as useFormFieldWrapperStyles, b as useAtlantisFormFieldName, f as FormFieldWrapper, l as FormFieldPostFix, m as mergeRefs } from '../FormField-es.js';
4
4
  import 'classnames';
5
5
  import { _ as __rest } from '../tslib.es6-es.js';
@@ -32,7 +32,7 @@ import '../_setToString-es.js';
32
32
  */
33
33
  function useTextAreaResize({ rows, value, inputRef, wrapperRef, }) {
34
34
  const rowRange = getRowRange(rows);
35
- useSafeLayoutEffect(() => {
35
+ useSafeLayoutEffect_1(() => {
36
36
  if (inputRef &&
37
37
  inputRef.current instanceof HTMLTextAreaElement &&
38
38
  wrapperRef &&
@@ -43,7 +43,7 @@ function useTextAreaResize({ rows, value, inputRef, wrapperRef, }) {
43
43
  // When the consumer passes a new controlled value, we need to recheck the size.
44
44
  // The timeout ensures the DOM has a enough time to render the new text before
45
45
  // we access the height.
46
- useSafeLayoutEffect(() => {
46
+ useSafeLayoutEffect_1(() => {
47
47
  setTimeout(() => {
48
48
  if (inputRef &&
49
49
  inputRef.current instanceof HTMLTextAreaElement &&
@@ -15,47 +15,63 @@ var Button = require('./Button-cjs.js');
15
15
  var Heading = require('./Heading-cjs.js');
16
16
  var AtlantisThemeContext = require('./AtlantisThemeContext-cjs.js');
17
17
 
18
- const mediaQueryStore = {
19
- subscribe(onChange, query) {
20
- const matchMedia = window.matchMedia(query);
21
- matchMedia.addEventListener("change", onChange);
22
- return () => {
23
- matchMedia.removeEventListener("change", onChange);
24
- };
25
- },
26
- getSnapshot(query) {
27
- return () => window.matchMedia(query).matches;
28
- },
29
- };
30
- function useMediaQuery(query) {
31
- const subscribeMediaQuery = React.useCallback((onChange) => mediaQueryStore.subscribe(onChange, query), [query]);
32
- const matches = React.useSyncExternalStore(subscribeMediaQuery, mediaQueryStore.getSnapshot(query), () => true);
33
- return matches;
34
- }
18
+ var useBreakpoints = {};
35
19
 
36
- const BREAKPOINT_SIZES = { sm: 490, md: 768, lg: 1080, xl: 1440 };
37
- /**
38
- * Hook equivalent of CSS media queries with our
39
- * [supported breakpoints](https://atlantis.getjobber.com/design/breakpoints).
40
- */
41
- function useBreakpoints() {
42
- const { sm, md, lg, xl } = BREAKPOINT_SIZES;
43
- const extraSmallOnly = useMediaQuery(`(max-width: ${sm - 1}px)`);
44
- const smallAndUp = useMediaQuery(`(min-width: ${sm}px)`);
45
- const mediumAndUp = useMediaQuery(`(min-width: ${md}px)`);
46
- const largeAndUp = useMediaQuery(`(min-width: ${lg}px)`);
47
- const extraLargeAndUp = useMediaQuery(`(min-width: ${xl}px)`);
48
- return {
49
- smallAndUp,
50
- mediumAndUp,
51
- largeAndUp,
52
- extraLargeAndUp,
53
- extraSmallOnly,
54
- smallOnly: smallAndUp && !mediumAndUp,
55
- mediumOnly: mediumAndUp && !largeAndUp,
56
- largeOnly: largeAndUp && !extraLargeAndUp,
57
- };
58
- }
20
+ var useMediaQuery = {};
21
+
22
+ (function (exports) {
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.mediaQueryStore = void 0;
25
+ exports.useMediaQuery = useMediaQuery;
26
+ const react_1 = React;
27
+ exports.mediaQueryStore = {
28
+ subscribe(onChange, query) {
29
+ const matchMedia = window.matchMedia(query);
30
+ matchMedia.addEventListener("change", onChange);
31
+ return () => {
32
+ matchMedia.removeEventListener("change", onChange);
33
+ };
34
+ },
35
+ getSnapshot(query) {
36
+ return () => window.matchMedia(query).matches;
37
+ },
38
+ };
39
+ function useMediaQuery(query) {
40
+ const subscribeMediaQuery = (0, react_1.useCallback)((onChange) => exports.mediaQueryStore.subscribe(onChange, query), [query]);
41
+ const matches = (0, react_1.useSyncExternalStore)(subscribeMediaQuery, exports.mediaQueryStore.getSnapshot(query), () => true);
42
+ return matches;
43
+ }
44
+ } (useMediaQuery));
45
+
46
+ (function (exports) {
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.BREAKPOINT_SIZES = void 0;
49
+ exports.useBreakpoints = useBreakpoints;
50
+ const useMediaQuery_1 = useMediaQuery;
51
+ exports.BREAKPOINT_SIZES = { sm: 490, md: 768, lg: 1080, xl: 1440 };
52
+ /**
53
+ * Hook equivalent of CSS media queries with our
54
+ * [supported breakpoints](https://atlantis.getjobber.com/design/breakpoints).
55
+ */
56
+ function useBreakpoints() {
57
+ const { sm, md, lg, xl } = exports.BREAKPOINT_SIZES;
58
+ const extraSmallOnly = (0, useMediaQuery_1.useMediaQuery)(`(max-width: ${sm - 1}px)`);
59
+ const smallAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${sm}px)`);
60
+ const mediumAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${md}px)`);
61
+ const largeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${lg}px)`);
62
+ const extraLargeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${xl}px)`);
63
+ return {
64
+ smallAndUp,
65
+ mediumAndUp,
66
+ largeAndUp,
67
+ extraLargeAndUp,
68
+ extraSmallOnly,
69
+ smallOnly: smallAndUp && !mediumAndUp,
70
+ mediumOnly: mediumAndUp && !largeAndUp,
71
+ largeOnly: largeAndUp && !extraLargeAndUp,
72
+ };
73
+ }
74
+ } (useBreakpoints));
59
75
 
60
76
  var styles = {"backgroundImage":"i9Tw1T65W-k-","next":"Q8amcRaTGf0-","prev":"W9FVb24yJrk-","buttonHidden":"nsN0TPWsBXI-","buttonVisible":"dkLYp7AD2jE-","lightboxWrapper":"_5p2iAj4JfoE-","toolbar":"rMK4cKdOxFw-","closeButton":"_0m6vb11DgiA-","slideNumber":"kCc68gGuTgg-","image":"yYFVVScosfQ-","imageArea":"UskuwLHR6fg-","captionWrapper":"OGjhge-r-U4-","title":"tZU2g-NYdIs-","blurOverlay":"GKIdLTmvcvQ-","thumbnailBar":"_3TfQLQEE3GQ-","thumbnailImage":"eBMzUOlcfQ4-","thumbnail":"eapm2zruLn8-","selected":"PeLn2u-QB0k-","spinning":"_8tDoqjgfLcw-"};
61
77
 
@@ -90,21 +106,21 @@ function LightBox({ boxSizing = "content-box", open, images, imageIndex = 0, onR
90
106
  const [currentImageIndex, setCurrentImageIndex] = React.useState(imageIndex);
91
107
  const [direction, setDirection] = React.useState(0);
92
108
  const [mouseIsStationary, setMouseIsStationary] = React.useState(true);
93
- const lightboxRef = useFocusTrap.useFocusTrap(open);
109
+ const lightboxRef = useFocusTrap.useFocusTrap_2(open);
94
110
  const selectedThumbnailRef = React.useRef(null);
95
- const debouncedHandleNext = useDebounce.useDebounce(handleMoveNext, BUTTON_DEBOUNCE_DELAY);
96
- const debouncedHandlePrevious = useDebounce.useDebounce(handleMovePrevious, BUTTON_DEBOUNCE_DELAY);
97
- const mounted = useIsMounted.useIsMounted();
111
+ const debouncedHandleNext = useDebounce.useDebounce_2(handleMoveNext, BUTTON_DEBOUNCE_DELAY);
112
+ const debouncedHandlePrevious = useDebounce.useDebounce_2(handleMovePrevious, BUTTON_DEBOUNCE_DELAY);
113
+ const mounted = useIsMounted.useIsMounted_2();
98
114
  const prevOpen = React.useRef(open);
99
- useRefocusOnActivator.useRefocusOnActivator(open);
100
- const handleMouseMovement = useDebounce.useDebounce(() => {
115
+ useRefocusOnActivator.useRefocusOnActivator_2(open);
116
+ const handleMouseMovement = useDebounce.useDebounce_2(() => {
101
117
  setMouseIsStationary(true);
102
118
  }, MOVEMENT_DEBOUNCE_DELAY);
103
- useOnKeyDown.useOnKeyDown(handleRequestClose, "Escape");
104
- useOnKeyDown.useOnKeyDown(debouncedHandlePrevious, {
119
+ useOnKeyDown.useOnKeyDown_2(handleRequestClose, "Escape");
120
+ useOnKeyDown.useOnKeyDown_2(debouncedHandlePrevious, {
105
121
  key: "ArrowLeft",
106
122
  });
107
- useOnKeyDown.useOnKeyDown(debouncedHandleNext, {
123
+ useOnKeyDown.useOnKeyDown_2(debouncedHandleNext, {
108
124
  key: "ArrowRight",
109
125
  });
110
126
  React.useEffect(() => {
@@ -192,12 +208,12 @@ function LightBox({ boxSizing = "content-box", open, images, imageIndex = 0, onR
192
208
  }
193
209
  }
194
210
  function PreviousButton({ onClick, hideButton }) {
195
- const { mediumAndUp } = useBreakpoints();
211
+ const { mediumAndUp } = useBreakpoints.useBreakpoints();
196
212
  return (React.createElement("div", { className: `${styles.prev} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
197
213
  React.createElement(Button.Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowLeft", ariaLabel: "Previous image", onClick: onClick })));
198
214
  }
199
215
  function NextButton({ onClick, hideButton }) {
200
- const { mediumAndUp } = useBreakpoints();
216
+ const { mediumAndUp } = useBreakpoints.useBreakpoints();
201
217
  return (React.createElement("div", { className: `${styles.next} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
202
218
  React.createElement(Button.Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowRight", ariaLabel: "Next image", onClick: onClick })));
203
219
  }
@@ -1,59 +1,75 @@
1
- import React__default, { useCallback, useSyncExternalStore, useState, useRef, useEffect } from 'react';
1
+ import React__default, { useState, useRef, useEffect } from 'react';
2
2
  import { AnimatePresence, motion } from 'framer-motion';
3
3
  import ReactDOM__default from 'react-dom';
4
- import { u as useRefocusOnActivator } from './useRefocusOnActivator-es.js';
5
- import { u as useOnKeyDown } from './useOnKeyDown-es.js';
6
- import { u as useFocusTrap } from './useFocusTrap-es.js';
7
- import { u as useIsMounted } from './useIsMounted-es.js';
4
+ import { u as useRefocusOnActivator_2 } from './useRefocusOnActivator-es.js';
5
+ import { u as useOnKeyDown_2 } from './useOnKeyDown-es.js';
6
+ import { u as useFocusTrap_2 } from './useFocusTrap-es.js';
7
+ import { u as useIsMounted_2 } from './useIsMounted-es.js';
8
8
  import classnames from 'classnames';
9
- import { u as useDebounce } from './useDebounce-es.js';
9
+ import { u as useDebounce_2 } from './useDebounce-es.js';
10
10
  import { B as ButtonDismiss } from './ButtonDismiss-es.js';
11
11
  import { T as Text } from './Text-es.js';
12
12
  import { B as Button } from './Button-es.js';
13
13
  import { H as Heading } from './Heading-es.js';
14
14
  import { A as AtlantisThemeContextProvider } from './AtlantisThemeContext-es.js';
15
15
 
16
- const mediaQueryStore = {
17
- subscribe(onChange, query) {
18
- const matchMedia = window.matchMedia(query);
19
- matchMedia.addEventListener("change", onChange);
20
- return () => {
21
- matchMedia.removeEventListener("change", onChange);
22
- };
23
- },
24
- getSnapshot(query) {
25
- return () => window.matchMedia(query).matches;
26
- },
27
- };
28
- function useMediaQuery(query) {
29
- const subscribeMediaQuery = useCallback((onChange) => mediaQueryStore.subscribe(onChange, query), [query]);
30
- const matches = useSyncExternalStore(subscribeMediaQuery, mediaQueryStore.getSnapshot(query), () => true);
31
- return matches;
32
- }
16
+ var useBreakpoints = {};
33
17
 
34
- const BREAKPOINT_SIZES = { sm: 490, md: 768, lg: 1080, xl: 1440 };
35
- /**
36
- * Hook equivalent of CSS media queries with our
37
- * [supported breakpoints](https://atlantis.getjobber.com/design/breakpoints).
38
- */
39
- function useBreakpoints() {
40
- const { sm, md, lg, xl } = BREAKPOINT_SIZES;
41
- const extraSmallOnly = useMediaQuery(`(max-width: ${sm - 1}px)`);
42
- const smallAndUp = useMediaQuery(`(min-width: ${sm}px)`);
43
- const mediumAndUp = useMediaQuery(`(min-width: ${md}px)`);
44
- const largeAndUp = useMediaQuery(`(min-width: ${lg}px)`);
45
- const extraLargeAndUp = useMediaQuery(`(min-width: ${xl}px)`);
46
- return {
47
- smallAndUp,
48
- mediumAndUp,
49
- largeAndUp,
50
- extraLargeAndUp,
51
- extraSmallOnly,
52
- smallOnly: smallAndUp && !mediumAndUp,
53
- mediumOnly: mediumAndUp && !largeAndUp,
54
- largeOnly: largeAndUp && !extraLargeAndUp,
55
- };
56
- }
18
+ var useMediaQuery = {};
19
+
20
+ (function (exports) {
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.mediaQueryStore = void 0;
23
+ exports.useMediaQuery = useMediaQuery;
24
+ const react_1 = React__default;
25
+ exports.mediaQueryStore = {
26
+ subscribe(onChange, query) {
27
+ const matchMedia = window.matchMedia(query);
28
+ matchMedia.addEventListener("change", onChange);
29
+ return () => {
30
+ matchMedia.removeEventListener("change", onChange);
31
+ };
32
+ },
33
+ getSnapshot(query) {
34
+ return () => window.matchMedia(query).matches;
35
+ },
36
+ };
37
+ function useMediaQuery(query) {
38
+ const subscribeMediaQuery = (0, react_1.useCallback)((onChange) => exports.mediaQueryStore.subscribe(onChange, query), [query]);
39
+ const matches = (0, react_1.useSyncExternalStore)(subscribeMediaQuery, exports.mediaQueryStore.getSnapshot(query), () => true);
40
+ return matches;
41
+ }
42
+ } (useMediaQuery));
43
+
44
+ (function (exports) {
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.BREAKPOINT_SIZES = void 0;
47
+ exports.useBreakpoints = useBreakpoints;
48
+ const useMediaQuery_1 = useMediaQuery;
49
+ exports.BREAKPOINT_SIZES = { sm: 490, md: 768, lg: 1080, xl: 1440 };
50
+ /**
51
+ * Hook equivalent of CSS media queries with our
52
+ * [supported breakpoints](https://atlantis.getjobber.com/design/breakpoints).
53
+ */
54
+ function useBreakpoints() {
55
+ const { sm, md, lg, xl } = exports.BREAKPOINT_SIZES;
56
+ const extraSmallOnly = (0, useMediaQuery_1.useMediaQuery)(`(max-width: ${sm - 1}px)`);
57
+ const smallAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${sm}px)`);
58
+ const mediumAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${md}px)`);
59
+ const largeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${lg}px)`);
60
+ const extraLargeAndUp = (0, useMediaQuery_1.useMediaQuery)(`(min-width: ${xl}px)`);
61
+ return {
62
+ smallAndUp,
63
+ mediumAndUp,
64
+ largeAndUp,
65
+ extraLargeAndUp,
66
+ extraSmallOnly,
67
+ smallOnly: smallAndUp && !mediumAndUp,
68
+ mediumOnly: mediumAndUp && !largeAndUp,
69
+ largeOnly: largeAndUp && !extraLargeAndUp,
70
+ };
71
+ }
72
+ } (useBreakpoints));
57
73
 
58
74
  var styles = {"backgroundImage":"i9Tw1T65W-k-","next":"Q8amcRaTGf0-","prev":"W9FVb24yJrk-","buttonHidden":"nsN0TPWsBXI-","buttonVisible":"dkLYp7AD2jE-","lightboxWrapper":"_5p2iAj4JfoE-","toolbar":"rMK4cKdOxFw-","closeButton":"_0m6vb11DgiA-","slideNumber":"kCc68gGuTgg-","image":"yYFVVScosfQ-","imageArea":"UskuwLHR6fg-","captionWrapper":"OGjhge-r-U4-","title":"tZU2g-NYdIs-","blurOverlay":"GKIdLTmvcvQ-","thumbnailBar":"_3TfQLQEE3GQ-","thumbnailImage":"eBMzUOlcfQ4-","thumbnail":"eapm2zruLn8-","selected":"PeLn2u-QB0k-","spinning":"_8tDoqjgfLcw-"};
59
75
 
@@ -88,21 +104,21 @@ function LightBox({ boxSizing = "content-box", open, images, imageIndex = 0, onR
88
104
  const [currentImageIndex, setCurrentImageIndex] = useState(imageIndex);
89
105
  const [direction, setDirection] = useState(0);
90
106
  const [mouseIsStationary, setMouseIsStationary] = useState(true);
91
- const lightboxRef = useFocusTrap(open);
107
+ const lightboxRef = useFocusTrap_2(open);
92
108
  const selectedThumbnailRef = useRef(null);
93
- const debouncedHandleNext = useDebounce(handleMoveNext, BUTTON_DEBOUNCE_DELAY);
94
- const debouncedHandlePrevious = useDebounce(handleMovePrevious, BUTTON_DEBOUNCE_DELAY);
95
- const mounted = useIsMounted();
109
+ const debouncedHandleNext = useDebounce_2(handleMoveNext, BUTTON_DEBOUNCE_DELAY);
110
+ const debouncedHandlePrevious = useDebounce_2(handleMovePrevious, BUTTON_DEBOUNCE_DELAY);
111
+ const mounted = useIsMounted_2();
96
112
  const prevOpen = useRef(open);
97
- useRefocusOnActivator(open);
98
- const handleMouseMovement = useDebounce(() => {
113
+ useRefocusOnActivator_2(open);
114
+ const handleMouseMovement = useDebounce_2(() => {
99
115
  setMouseIsStationary(true);
100
116
  }, MOVEMENT_DEBOUNCE_DELAY);
101
- useOnKeyDown(handleRequestClose, "Escape");
102
- useOnKeyDown(debouncedHandlePrevious, {
117
+ useOnKeyDown_2(handleRequestClose, "Escape");
118
+ useOnKeyDown_2(debouncedHandlePrevious, {
103
119
  key: "ArrowLeft",
104
120
  });
105
- useOnKeyDown(debouncedHandleNext, {
121
+ useOnKeyDown_2(debouncedHandleNext, {
106
122
  key: "ArrowRight",
107
123
  });
108
124
  useEffect(() => {
@@ -190,12 +206,12 @@ function LightBox({ boxSizing = "content-box", open, images, imageIndex = 0, onR
190
206
  }
191
207
  }
192
208
  function PreviousButton({ onClick, hideButton }) {
193
- const { mediumAndUp } = useBreakpoints();
209
+ const { mediumAndUp } = useBreakpoints.useBreakpoints();
194
210
  return (React__default.createElement("div", { className: `${styles.prev} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
195
211
  React__default.createElement(Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowLeft", ariaLabel: "Previous image", onClick: onClick })));
196
212
  }
197
213
  function NextButton({ onClick, hideButton }) {
198
- const { mediumAndUp } = useBreakpoints();
214
+ const { mediumAndUp } = useBreakpoints.useBreakpoints();
199
215
  return (React__default.createElement("div", { className: `${styles.next} ${hideButton ? styles.buttonHidden : styles.buttonVisible}` },
200
216
  React__default.createElement(Button, { size: mediumAndUp ? "large" : "small", variation: "subtle", type: "secondary", icon: "arrowRight", ariaLabel: "Next image", onClick: onClick })));
201
217
  }
package/dist/Menu-cjs.js CHANGED
@@ -13,6 +13,11 @@ var Icon = require('./Icon-cjs.js');
13
13
  var useFormFieldFocus = require('./useFormFieldFocus-cjs.js');
14
14
  var maxHeight = require('./maxHeight-cjs.js');
15
15
 
16
+ var useWindowDimensions$1 = {};
17
+
18
+ Object.defineProperty(useWindowDimensions$1, "__esModule", { value: true });
19
+ var useWindowDimensions_2 = useWindowDimensions$1.useWindowDimensions = useWindowDimensions;
20
+ const react_1 = React;
16
21
  function getWindowDimensions() {
17
22
  if (!(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document)) {
18
23
  return {
@@ -27,8 +32,8 @@ function getWindowDimensions() {
27
32
  };
28
33
  }
29
34
  function useWindowDimensions() {
30
- const [windowDimensions, setWindowDimensions] = React.useState(getWindowDimensions());
31
- React.useEffect(() => {
35
+ const [windowDimensions, setWindowDimensions] = (0, react_1.useState)(getWindowDimensions());
36
+ (0, react_1.useEffect)(() => {
32
37
  function handleResize() {
33
38
  setWindowDimensions(getWindowDimensions());
34
39
  }
@@ -60,7 +65,7 @@ function Menu({ activator, items, UNSAFE_className, UNSAFE_style, }) {
60
65
  var _a;
61
66
  const [visible, setVisible] = React.useState(false);
62
67
  const [referenceElement, setReferenceElement] = React.useState(null);
63
- const { width } = useWindowDimensions();
68
+ const { width } = useWindowDimensions_2();
64
69
  const buttonID = React.useId();
65
70
  const menuID = React.useId();
66
71
  const fullWidth = ((_a = activator === null || activator === void 0 ? void 0 : activator.props) === null || _a === void 0 ? void 0 : _a.fullWidth) || false;
@@ -68,8 +73,8 @@ function Menu({ activator, items, UNSAFE_className, UNSAFE_style, }) {
68
73
  [styles.fullWidth]: fullWidth,
69
74
  });
70
75
  // useRefocusOnActivator must come before useFocusTrap for them both to work
71
- useRefocusOnActivator.useRefocusOnActivator(visible);
72
- const menuRef = useFocusTrap.useFocusTrap(visible);
76
+ useRefocusOnActivator.useRefocusOnActivator_2(visible);
77
+ const menuRef = useFocusTrap.useFocusTrap_2(visible);
73
78
  const { refs, floatingStyles, context } = floatingUi_react.useFloating({
74
79
  open: visible,
75
80
  onOpenChange: setVisible,
@@ -164,7 +169,7 @@ function Action({ label, sectionLabel, icon, iconColor, destructive, UNSAFE_styl
164
169
  label)));
165
170
  }
166
171
  function MenuPortal({ children }) {
167
- const mounted = useIsMounted.useIsMounted();
172
+ const mounted = useIsMounted.useIsMounted_2();
168
173
  if (!(mounted === null || mounted === void 0 ? void 0 : mounted.current)) {
169
174
  return null;
170
175
  }