@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,6 +2,11 @@
2
2
 
3
3
  var React = require('react');
4
4
 
5
+ var useFocusTrap$1 = {};
6
+
7
+ Object.defineProperty(useFocusTrap$1, "__esModule", { value: true });
8
+ var useFocusTrap_2 = useFocusTrap$1.useFocusTrap = useFocusTrap;
9
+ const react_1 = React;
5
10
  /**
6
11
  * Traps the focus within the children of the ref element.
7
12
  *
@@ -14,7 +19,7 @@ function useFocusTrap(active) {
14
19
  // There's an ongoing issue with useRef return type clashing with an element's
15
20
  // ref prop type. TLDR: Use null because useRef doesn't expect undefined.
16
21
  // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/35572
17
- const ref = React.useRef(null);
22
+ const ref = (0, react_1.useRef)(null);
18
23
  function handleKeyDown(event) {
19
24
  if (!(active && ref.current) || event.key !== "Tab") {
20
25
  return;
@@ -33,7 +38,7 @@ function useFocusTrap(active) {
33
38
  }
34
39
  }
35
40
  }
36
- React.useEffect(() => {
41
+ (0, react_1.useEffect)(() => {
37
42
  if (active && ref.current) {
38
43
  const { firstElement } = getElements(ref.current);
39
44
  firstElement.focus();
@@ -67,4 +72,4 @@ function getElements(ref) {
67
72
  return { firstElement, lastElement };
68
73
  }
69
74
 
70
- exports.useFocusTrap = useFocusTrap;
75
+ exports.useFocusTrap_2 = useFocusTrap_2;
@@ -1,5 +1,10 @@
1
- import { useRef, useEffect } from 'react';
1
+ import React__default from 'react';
2
2
 
3
+ var useFocusTrap$1 = {};
4
+
5
+ Object.defineProperty(useFocusTrap$1, "__esModule", { value: true });
6
+ var useFocusTrap_2 = useFocusTrap$1.useFocusTrap = useFocusTrap;
7
+ const react_1 = React__default;
3
8
  /**
4
9
  * Traps the focus within the children of the ref element.
5
10
  *
@@ -12,7 +17,7 @@ function useFocusTrap(active) {
12
17
  // There's an ongoing issue with useRef return type clashing with an element's
13
18
  // ref prop type. TLDR: Use null because useRef doesn't expect undefined.
14
19
  // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/35572
15
- const ref = useRef(null);
20
+ const ref = (0, react_1.useRef)(null);
16
21
  function handleKeyDown(event) {
17
22
  if (!(active && ref.current) || event.key !== "Tab") {
18
23
  return;
@@ -31,7 +36,7 @@ function useFocusTrap(active) {
31
36
  }
32
37
  }
33
38
  }
34
- useEffect(() => {
39
+ (0, react_1.useEffect)(() => {
35
40
  if (active && ref.current) {
36
41
  const { firstElement } = getElements(ref.current);
37
42
  firstElement.focus();
@@ -65,4 +70,4 @@ function getElements(ref) {
65
70
  return { firstElement, lastElement };
66
71
  }
67
72
 
68
- export { useFocusTrap as u };
73
+ export { useFocusTrap_2 as u };
@@ -2,11 +2,16 @@
2
2
 
3
3
  var React = require('react');
4
4
 
5
+ var useInView$1 = {};
6
+
7
+ Object.defineProperty(useInView$1, "__esModule", { value: true });
8
+ var useInView_2 = useInView$1.useInView = useInView;
9
+ const react_1 = React;
5
10
  function useInView() {
6
- const ref = React.useRef(null);
7
- const [isInView, setIsInView] = React.useState(false);
8
- const handleIntersection = React.useCallback(entries => setIsInView(entries[0].isIntersecting), [setIsInView]);
9
- React.useEffect(() => {
11
+ const ref = (0, react_1.useRef)(null);
12
+ const [isInView, setIsInView] = (0, react_1.useState)(false);
13
+ const handleIntersection = (0, react_1.useCallback)(entries => setIsInView(entries[0].isIntersecting), [setIsInView]);
14
+ (0, react_1.useEffect)(() => {
10
15
  if (!window.IntersectionObserver)
11
16
  return;
12
17
  const observer = new IntersectionObserver(handleIntersection);
@@ -18,4 +23,4 @@ function useInView() {
18
23
  return [ref, isInView];
19
24
  }
20
25
 
21
- exports.useInView = useInView;
26
+ exports.useInView_2 = useInView_2;
@@ -1,10 +1,15 @@
1
- import { useRef, useState, useCallback, useEffect } from 'react';
1
+ import React__default from 'react';
2
2
 
3
+ var useInView$1 = {};
4
+
5
+ Object.defineProperty(useInView$1, "__esModule", { value: true });
6
+ var useInView_2 = useInView$1.useInView = useInView;
7
+ const react_1 = React__default;
3
8
  function useInView() {
4
- const ref = useRef(null);
5
- const [isInView, setIsInView] = useState(false);
6
- const handleIntersection = useCallback(entries => setIsInView(entries[0].isIntersecting), [setIsInView]);
7
- useEffect(() => {
9
+ const ref = (0, react_1.useRef)(null);
10
+ const [isInView, setIsInView] = (0, react_1.useState)(false);
11
+ const handleIntersection = (0, react_1.useCallback)(entries => setIsInView(entries[0].isIntersecting), [setIsInView]);
12
+ (0, react_1.useEffect)(() => {
8
13
  if (!window.IntersectionObserver)
9
14
  return;
10
15
  const observer = new IntersectionObserver(handleIntersection);
@@ -16,4 +21,4 @@ function useInView() {
16
21
  return [ref, isInView];
17
22
  }
18
23
 
19
- export { useInView as u };
24
+ export { useInView_2 as u };
@@ -1,8 +1,23 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var useSafeLayoutEffect = require('./useSafeLayoutEffect-cjs.js');
4
+ var useSafeLayoutEffect$1 = require('./useSafeLayoutEffect-cjs.js');
5
5
 
6
+ var useIsMounted$1 = {};
7
+
8
+ var useSafeLayoutEffect = {};
9
+
10
+ (function (exports) {
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.useSafeLayoutEffect = void 0;
13
+ var useSafeLayoutEffect_1 = useSafeLayoutEffect$1.useSafeLayoutEffect;
14
+ Object.defineProperty(exports, "useSafeLayoutEffect", { enumerable: true, get: function () { return useSafeLayoutEffect_1.useSafeLayoutEffect; } });
15
+ } (useSafeLayoutEffect));
16
+
17
+ Object.defineProperty(useIsMounted$1, "__esModule", { value: true });
18
+ var useIsMounted_2 = useIsMounted$1.useIsMounted = useIsMounted;
19
+ const react_1 = React;
20
+ const useSafeLayoutEffect_1 = useSafeLayoutEffect;
6
21
  /**
7
22
  * If you are using this hook in order to only perform an action once after mounting (for example sending
8
23
  * analytics events), use `useOnMount` instead
@@ -23,8 +38,8 @@ var useSafeLayoutEffect = require('./useSafeLayoutEffect-cjs.js');
23
38
  * This `useLayoutEffect` hook will only be run once.
24
39
  */
25
40
  function useIsMounted() {
26
- const isMounted = React.useRef(false);
27
- useSafeLayoutEffect.useSafeLayoutEffect(() => {
41
+ const isMounted = (0, react_1.useRef)(false);
42
+ (0, useSafeLayoutEffect_1.useSafeLayoutEffect)(() => {
28
43
  isMounted.current = true;
29
44
  return () => {
30
45
  isMounted.current = false;
@@ -33,4 +48,4 @@ function useIsMounted() {
33
48
  return isMounted;
34
49
  }
35
50
 
36
- exports.useIsMounted = useIsMounted;
51
+ exports.useIsMounted_2 = useIsMounted_2;
@@ -1,6 +1,21 @@
1
- import { useRef } from 'react';
2
- import { u as useSafeLayoutEffect } from './useSafeLayoutEffect-es.js';
1
+ import React__default from 'react';
2
+ import { a as useSafeLayoutEffect$1 } from './useSafeLayoutEffect-es.js';
3
3
 
4
+ var useIsMounted$1 = {};
5
+
6
+ var useSafeLayoutEffect = {};
7
+
8
+ (function (exports) {
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.useSafeLayoutEffect = void 0;
11
+ var useSafeLayoutEffect_1 = useSafeLayoutEffect$1;
12
+ Object.defineProperty(exports, "useSafeLayoutEffect", { enumerable: true, get: function () { return useSafeLayoutEffect_1.useSafeLayoutEffect; } });
13
+ } (useSafeLayoutEffect));
14
+
15
+ Object.defineProperty(useIsMounted$1, "__esModule", { value: true });
16
+ var useIsMounted_2 = useIsMounted$1.useIsMounted = useIsMounted;
17
+ const react_1 = React__default;
18
+ const useSafeLayoutEffect_1 = useSafeLayoutEffect;
4
19
  /**
5
20
  * If you are using this hook in order to only perform an action once after mounting (for example sending
6
21
  * analytics events), use `useOnMount` instead
@@ -21,8 +36,8 @@ import { u as useSafeLayoutEffect } from './useSafeLayoutEffect-es.js';
21
36
  * This `useLayoutEffect` hook will only be run once.
22
37
  */
23
38
  function useIsMounted() {
24
- const isMounted = useRef(false);
25
- useSafeLayoutEffect(() => {
39
+ const isMounted = (0, react_1.useRef)(false);
40
+ (0, useSafeLayoutEffect_1.useSafeLayoutEffect)(() => {
26
41
  isMounted.current = true;
27
42
  return () => {
28
43
  isMounted.current = false;
@@ -31,4 +46,4 @@ function useIsMounted() {
31
46
  return isMounted;
32
47
  }
33
48
 
34
- export { useIsMounted as u };
49
+ export { useIsMounted_2 as u };
@@ -2,8 +2,13 @@
2
2
 
3
3
  var React = require('react');
4
4
 
5
+ var useOnKeyDown$1 = {};
6
+
7
+ Object.defineProperty(useOnKeyDown$1, "__esModule", { value: true });
8
+ var useOnKeyDown_2 = useOnKeyDown$1.useOnKeyDown = useOnKeyDown;
9
+ const react_1 = React;
5
10
  function useOnKeyDown(callback, keys) {
6
- React.useEffect(() => {
11
+ (0, react_1.useEffect)(() => {
7
12
  window.addEventListener("keydown", handler);
8
13
  return () => {
9
14
  window.removeEventListener("keydown", handler);
@@ -33,4 +38,4 @@ function useOnKeyDown(callback, keys) {
33
38
  }
34
39
  }
35
40
 
36
- exports.useOnKeyDown = useOnKeyDown;
41
+ exports.useOnKeyDown_2 = useOnKeyDown_2;
@@ -1,7 +1,12 @@
1
- import { useEffect } from 'react';
1
+ import React__default from 'react';
2
2
 
3
+ var useOnKeyDown$1 = {};
4
+
5
+ Object.defineProperty(useOnKeyDown$1, "__esModule", { value: true });
6
+ var useOnKeyDown_2 = useOnKeyDown$1.useOnKeyDown = useOnKeyDown;
7
+ const react_1 = React__default;
3
8
  function useOnKeyDown(callback, keys) {
4
- useEffect(() => {
9
+ (0, react_1.useEffect)(() => {
5
10
  window.addEventListener("keydown", handler);
6
11
  return () => {
7
12
  window.removeEventListener("keydown", handler);
@@ -31,4 +36,4 @@ function useOnKeyDown(callback, keys) {
31
36
  }
32
37
  }
33
38
 
34
- export { useOnKeyDown as u };
39
+ export { useOnKeyDown_2 as u };
@@ -2,6 +2,11 @@
2
2
 
3
3
  var React = require('react');
4
4
 
5
+ var useRefocusOnActivator$1 = {};
6
+
7
+ Object.defineProperty(useRefocusOnActivator$1, "__esModule", { value: true });
8
+ var useRefocusOnActivator_2 = useRefocusOnActivator$1.useRefocusOnActivator = useRefocusOnActivator;
9
+ const react_1 = React;
5
10
  /**
6
11
  * Brings back the focus to the element that opened an overlaid element once
7
12
  * said overlaid element is dismissed.
@@ -9,7 +14,7 @@ var React = require('react');
9
14
  * @param active - Determines if it should focus or not
10
15
  */
11
16
  function useRefocusOnActivator(active) {
12
- React.useEffect(() => {
17
+ (0, react_1.useEffect)(() => {
13
18
  let activator;
14
19
  if (active && !activator) {
15
20
  activator = document.activeElement;
@@ -25,4 +30,4 @@ function useRefocusOnActivator(active) {
25
30
  }, [active]);
26
31
  }
27
32
 
28
- exports.useRefocusOnActivator = useRefocusOnActivator;
33
+ exports.useRefocusOnActivator_2 = useRefocusOnActivator_2;
@@ -1,5 +1,10 @@
1
- import { useEffect } from 'react';
1
+ import React__default from 'react';
2
2
 
3
+ var useRefocusOnActivator$1 = {};
4
+
5
+ Object.defineProperty(useRefocusOnActivator$1, "__esModule", { value: true });
6
+ var useRefocusOnActivator_2 = useRefocusOnActivator$1.useRefocusOnActivator = useRefocusOnActivator;
7
+ const react_1 = React__default;
3
8
  /**
4
9
  * Brings back the focus to the element that opened an overlaid element once
5
10
  * said overlaid element is dismissed.
@@ -7,7 +12,7 @@ import { useEffect } from 'react';
7
12
  * @param active - Determines if it should focus or not
8
13
  */
9
14
  function useRefocusOnActivator(active) {
10
- useEffect(() => {
15
+ (0, react_1.useEffect)(() => {
11
16
  let activator;
12
17
  if (active && !activator) {
13
18
  activator = document.activeElement;
@@ -23,4 +28,4 @@ function useRefocusOnActivator(active) {
23
28
  }, [active]);
24
29
  }
25
30
 
26
- export { useRefocusOnActivator as u };
31
+ export { useRefocusOnActivator_2 as u };
@@ -1,9 +1,26 @@
1
1
  'use strict';
2
2
 
3
- var React = require('react');
4
3
  var _commonjsHelpers = require('./_commonjsHelpers-cjs.js');
4
+ var React = require('react');
5
5
  var throttle$1 = require('./throttle-cjs.js');
6
6
 
7
+ function _mergeNamespaces(n, m) {
8
+ m.forEach(function (e) {
9
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default' && !(k in n)) {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ });
19
+ return Object.freeze(n);
20
+ }
21
+
22
+ var useResizeObserver$2 = {};
23
+
7
24
  /**
8
25
  * A collection of shims that provide minimal functionality of the ES6 collections.
9
26
  *
@@ -1033,71 +1050,82 @@ function useResizeObserver$1(opts) {
1033
1050
 
1034
1051
  var polyfilled = useResizeObserver$1;
1035
1052
 
1036
- var useResizeObserverPackage = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(polyfilled);
1053
+ (function (exports) {
1054
+ var __importDefault = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__importDefault) || function (mod) {
1055
+ return (mod && mod.__esModule) ? mod : { "default": mod };
1056
+ };
1057
+ Object.defineProperty(exports, "__esModule", { value: true });
1058
+ exports.Breakpoints = void 0;
1059
+ exports.useResizeObserver = useResizeObserver;
1060
+ const react_1 = React;
1061
+ // Importing the polyfilled version of ResizeObserver
1062
+ // eslint-disable-next-line import/no-internal-modules
1063
+ const polyfilled_1 = __importDefault(polyfilled);
1064
+ const throttle_1 = __importDefault(throttle$1.throttle_1);
1065
+ exports.Breakpoints = {
1066
+ base: 640,
1067
+ small: 500,
1068
+ smaller: 265,
1069
+ large: 750,
1070
+ larger: 1024,
1071
+ };
1072
+ const wait = 100;
1073
+ function useResizeObserver({ widths = exports.Breakpoints, heights = exports.Breakpoints, } = {}) {
1074
+ const [exactSize, setSize] = (0, react_1.useState)({
1075
+ width: undefined,
1076
+ height: undefined,
1077
+ });
1078
+ const onResize = (0, react_1.useMemo)(() => {
1079
+ return (0, throttle_1.default)(({ width, height }) => {
1080
+ if (!width || width <= 1) {
1081
+ // Ignore invalid values. ResizeObserver is unexpectedly looping between 1 and the actual
1082
+ // width of the element. This is only happening in playwright chromium.
1083
+ // Soon we need to replace this unmaintained package with a more reliable one.
1084
+ return;
1085
+ }
1086
+ setSize({ width, height });
1087
+ }, wait);
1088
+ }, []);
1089
+ const { ref } = (0, polyfilled_1.default)({
1090
+ onResize,
1091
+ });
1092
+ const exactWidth = exactSize.width;
1093
+ const exactHeight = exactSize.height;
1094
+ const sizes = {
1095
+ width: getSize(widths, exactSize.width),
1096
+ height: getSize(heights, exactSize.height),
1097
+ exactWidth,
1098
+ exactHeight,
1099
+ };
1100
+ return [ref, sizes];
1101
+ }
1102
+ /**
1103
+ * To get the proper size we want to make sure that our value is greater
1104
+ * then the comparable, but less then the next largest number in our
1105
+ * object.
1106
+ */
1107
+ function getSize(sizes, comparable) {
1108
+ if (!comparable || !sizes) {
1109
+ return undefined;
1110
+ }
1111
+ /**
1112
+ * Sort the values of our object so that we know they are in proper
1113
+ * order to be compared by
1114
+ */
1115
+ const sortedSizes = Object.values(sizes)
1116
+ .sort((a, b) => a - b)
1117
+ .reverse();
1118
+ return (sortedSizes.find(value => value <= comparable) ||
1119
+ sortedSizes[sortedSizes.length - 1]);
1120
+ }
1121
+ } (useResizeObserver$2));
1037
1122
 
1038
- const Breakpoints = {
1039
- base: 640,
1040
- small: 500,
1041
- smaller: 265,
1042
- large: 750,
1043
- larger: 1024,
1044
- };
1045
- const wait = 100;
1046
- function useResizeObserver({ widths = Breakpoints, heights = Breakpoints, } = {}) {
1047
- const [exactSize, setSize] = React.useState({
1048
- width: undefined,
1049
- height: undefined,
1050
- });
1051
- const onResize = React.useMemo(() => {
1052
- return throttle$1.throttle(({ width, height }) => {
1053
- if (!width || width <= 1) {
1054
- // Ignore invalid values. ResizeObserver is unexpectedly looping between 1 and the actual
1055
- // width of the element. This is only happening in playwright chromium.
1056
- // Soon we need to replace this unmaintained package with a more reliable one.
1057
- return;
1058
- }
1059
- setSize({ width, height });
1060
- }, wait);
1061
- }, []);
1062
- const { ref } = useResizeObserverPackage({
1063
- onResize,
1064
- });
1065
- const exactWidth = exactSize.width;
1066
- const exactHeight = exactSize.height;
1067
- const sizes = {
1068
- width: getSize(widths, exactSize.width),
1069
- height: getSize(heights, exactSize.height),
1070
- exactWidth,
1071
- exactHeight,
1072
- };
1073
- return [ref, sizes];
1074
- }
1075
- /**
1076
- * To get the proper size we want to make sure that our value is greater
1077
- * then the comparable, but less then the next largest number in our
1078
- * object.
1079
- */
1080
- function getSize(sizes, comparable) {
1081
- if (!comparable || !sizes) {
1082
- return undefined;
1083
- }
1084
- /**
1085
- * Sort the values of our object so that we know they are in proper
1086
- * order to be compared by
1087
- */
1088
- const sortedSizes = Object.values(sizes)
1089
- .sort((a, b) => a - b)
1090
- .reverse();
1091
- return (sortedSizes.find(value => value <= comparable) ||
1092
- sortedSizes[sortedSizes.length - 1]);
1093
- }
1123
+ var useResizeObserver = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(useResizeObserver$2);
1094
1124
 
1095
- var jobberHooks = /*#__PURE__*/Object.freeze({
1125
+ var jobberHooks = /*#__PURE__*/_mergeNamespaces({
1096
1126
  __proto__: null,
1097
- Breakpoints: Breakpoints,
1098
- useResizeObserver: useResizeObserver
1099
- });
1127
+ default: useResizeObserver
1128
+ }, [useResizeObserver$2]);
1100
1129
 
1101
- exports.Breakpoints = Breakpoints;
1102
1130
  exports.jobberHooks = jobberHooks;
1103
- exports.useResizeObserver = useResizeObserver;
1131
+ exports.useResizeObserver = useResizeObserver$2;
@@ -1,6 +1,23 @@
1
- import React__default, { useState, useMemo } from 'react';
2
- import { a as getAugmentedNamespace, g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
3
- import { t as throttle$1 } from './throttle-es.js';
1
+ import { a as getAugmentedNamespace, c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
2
+ import React__default from 'react';
3
+ import { a as throttle_1 } from './throttle-es.js';
4
+
5
+ function _mergeNamespaces(n, m) {
6
+ m.forEach(function (e) {
7
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
8
+ if (k !== 'default' && !(k in n)) {
9
+ var d = Object.getOwnPropertyDescriptor(e, k);
10
+ Object.defineProperty(n, k, d.get ? d : {
11
+ enumerable: true,
12
+ get: function () { return e[k]; }
13
+ });
14
+ }
15
+ });
16
+ });
17
+ return Object.freeze(n);
18
+ }
19
+
20
+ var useResizeObserver$2 = {};
4
21
 
5
22
  /**
6
23
  * A collection of shims that provide minimal functionality of the ES6 collections.
@@ -1031,69 +1048,81 @@ function useResizeObserver$1(opts) {
1031
1048
 
1032
1049
  var polyfilled = useResizeObserver$1;
1033
1050
 
1034
- var useResizeObserverPackage = /*@__PURE__*/getDefaultExportFromCjs(polyfilled);
1051
+ (function (exports) {
1052
+ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
1053
+ return (mod && mod.__esModule) ? mod : { "default": mod };
1054
+ };
1055
+ Object.defineProperty(exports, "__esModule", { value: true });
1056
+ exports.Breakpoints = void 0;
1057
+ exports.useResizeObserver = useResizeObserver;
1058
+ const react_1 = React__default;
1059
+ // Importing the polyfilled version of ResizeObserver
1060
+ // eslint-disable-next-line import/no-internal-modules
1061
+ const polyfilled_1 = __importDefault(polyfilled);
1062
+ const throttle_1$1 = __importDefault(throttle_1);
1063
+ exports.Breakpoints = {
1064
+ base: 640,
1065
+ small: 500,
1066
+ smaller: 265,
1067
+ large: 750,
1068
+ larger: 1024,
1069
+ };
1070
+ const wait = 100;
1071
+ function useResizeObserver({ widths = exports.Breakpoints, heights = exports.Breakpoints, } = {}) {
1072
+ const [exactSize, setSize] = (0, react_1.useState)({
1073
+ width: undefined,
1074
+ height: undefined,
1075
+ });
1076
+ const onResize = (0, react_1.useMemo)(() => {
1077
+ return (0, throttle_1$1.default)(({ width, height }) => {
1078
+ if (!width || width <= 1) {
1079
+ // Ignore invalid values. ResizeObserver is unexpectedly looping between 1 and the actual
1080
+ // width of the element. This is only happening in playwright chromium.
1081
+ // Soon we need to replace this unmaintained package with a more reliable one.
1082
+ return;
1083
+ }
1084
+ setSize({ width, height });
1085
+ }, wait);
1086
+ }, []);
1087
+ const { ref } = (0, polyfilled_1.default)({
1088
+ onResize,
1089
+ });
1090
+ const exactWidth = exactSize.width;
1091
+ const exactHeight = exactSize.height;
1092
+ const sizes = {
1093
+ width: getSize(widths, exactSize.width),
1094
+ height: getSize(heights, exactSize.height),
1095
+ exactWidth,
1096
+ exactHeight,
1097
+ };
1098
+ return [ref, sizes];
1099
+ }
1100
+ /**
1101
+ * To get the proper size we want to make sure that our value is greater
1102
+ * then the comparable, but less then the next largest number in our
1103
+ * object.
1104
+ */
1105
+ function getSize(sizes, comparable) {
1106
+ if (!comparable || !sizes) {
1107
+ return undefined;
1108
+ }
1109
+ /**
1110
+ * Sort the values of our object so that we know they are in proper
1111
+ * order to be compared by
1112
+ */
1113
+ const sortedSizes = Object.values(sizes)
1114
+ .sort((a, b) => a - b)
1115
+ .reverse();
1116
+ return (sortedSizes.find(value => value <= comparable) ||
1117
+ sortedSizes[sortedSizes.length - 1]);
1118
+ }
1119
+ } (useResizeObserver$2));
1035
1120
 
1036
- const Breakpoints = {
1037
- base: 640,
1038
- small: 500,
1039
- smaller: 265,
1040
- large: 750,
1041
- larger: 1024,
1042
- };
1043
- const wait = 100;
1044
- function useResizeObserver({ widths = Breakpoints, heights = Breakpoints, } = {}) {
1045
- const [exactSize, setSize] = useState({
1046
- width: undefined,
1047
- height: undefined,
1048
- });
1049
- const onResize = useMemo(() => {
1050
- return throttle$1(({ width, height }) => {
1051
- if (!width || width <= 1) {
1052
- // Ignore invalid values. ResizeObserver is unexpectedly looping between 1 and the actual
1053
- // width of the element. This is only happening in playwright chromium.
1054
- // Soon we need to replace this unmaintained package with a more reliable one.
1055
- return;
1056
- }
1057
- setSize({ width, height });
1058
- }, wait);
1059
- }, []);
1060
- const { ref } = useResizeObserverPackage({
1061
- onResize,
1062
- });
1063
- const exactWidth = exactSize.width;
1064
- const exactHeight = exactSize.height;
1065
- const sizes = {
1066
- width: getSize(widths, exactSize.width),
1067
- height: getSize(heights, exactSize.height),
1068
- exactWidth,
1069
- exactHeight,
1070
- };
1071
- return [ref, sizes];
1072
- }
1073
- /**
1074
- * To get the proper size we want to make sure that our value is greater
1075
- * then the comparable, but less then the next largest number in our
1076
- * object.
1077
- */
1078
- function getSize(sizes, comparable) {
1079
- if (!comparable || !sizes) {
1080
- return undefined;
1081
- }
1082
- /**
1083
- * Sort the values of our object so that we know they are in proper
1084
- * order to be compared by
1085
- */
1086
- const sortedSizes = Object.values(sizes)
1087
- .sort((a, b) => a - b)
1088
- .reverse();
1089
- return (sortedSizes.find(value => value <= comparable) ||
1090
- sortedSizes[sortedSizes.length - 1]);
1091
- }
1121
+ var useResizeObserver = /*@__PURE__*/getDefaultExportFromCjs(useResizeObserver$2);
1092
1122
 
1093
- var jobberHooks = /*#__PURE__*/Object.freeze({
1123
+ var jobberHooks = /*#__PURE__*/_mergeNamespaces({
1094
1124
  __proto__: null,
1095
- Breakpoints: Breakpoints,
1096
- useResizeObserver: useResizeObserver
1097
- });
1125
+ default: useResizeObserver
1126
+ }, [useResizeObserver$2]);
1098
1127
 
1099
- export { Breakpoints as B, jobberHooks as j, useResizeObserver as u };
1128
+ export { jobberHooks as j, useResizeObserver$2 as u };
@@ -2,8 +2,13 @@
2
2
 
3
3
  var React = require('react');
4
4
 
5
- const useSafeLayoutEffect = (globalThis === null || globalThis === void 0 ? void 0 : globalThis.document)
6
- ? React.useLayoutEffect
7
- : React.useEffect;
5
+ var useSafeLayoutEffect = {};
6
+
7
+ Object.defineProperty(useSafeLayoutEffect, "__esModule", { value: true });
8
+ exports.useSafeLayoutEffect_1 = useSafeLayoutEffect.useSafeLayoutEffect = void 0;
9
+ const react_1 = React;
10
+ exports.useSafeLayoutEffect_1 = useSafeLayoutEffect.useSafeLayoutEffect = (globalThis === null || globalThis === void 0 ? void 0 : globalThis.document)
11
+ ? react_1.useLayoutEffect
12
+ : react_1.useEffect;
8
13
 
9
14
  exports.useSafeLayoutEffect = useSafeLayoutEffect;