@jobber/components 6.90.3 → 6.91.0

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 (214) hide show
  1. package/dist/AtlantisThemeContext-es.js +1 -1
  2. package/dist/Autocomplete/index.cjs +12 -15
  3. package/dist/Autocomplete/index.mjs +13 -16
  4. package/dist/Banner/index.cjs +1 -6
  5. package/dist/Banner/index.mjs +1 -6
  6. package/dist/Banner-cjs.js +2 -2
  7. package/dist/Banner-es.js +2 -2
  8. package/dist/Card/index.cjs +1 -4
  9. package/dist/Card/index.mjs +1 -4
  10. package/dist/Chip/index.cjs +1 -3
  11. package/dist/Chip/index.mjs +1 -3
  12. package/dist/Chip-cjs.js +3 -3
  13. package/dist/Chip-es.js +3 -3
  14. package/dist/Chips/InternalChipDismissible/hooks/index.cjs +1 -0
  15. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +1 -0
  16. package/dist/Chips/InternalChipDismissible/index.cjs +1 -3
  17. package/dist/Chips/InternalChipDismissible/index.mjs +1 -3
  18. package/dist/Chips/index.cjs +1 -3
  19. package/dist/Chips/index.mjs +1 -3
  20. package/dist/Combobox/components/ComboboxActivator/index.cjs +1 -3
  21. package/dist/Combobox/components/ComboboxActivator/index.mjs +1 -3
  22. package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.cjs +1 -1
  23. package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.mjs +1 -1
  24. package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.cjs +1 -1
  25. package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.mjs +1 -1
  26. package/dist/Combobox/components/ComboboxContent/index.cjs +1 -3
  27. package/dist/Combobox/components/ComboboxContent/index.mjs +1 -3
  28. package/dist/Combobox/components/ComboboxTrigger/index.cjs +1 -3
  29. package/dist/Combobox/components/ComboboxTrigger/index.mjs +1 -3
  30. package/dist/Combobox/index.cjs +1 -6
  31. package/dist/Combobox/index.mjs +1 -6
  32. package/dist/Combobox-cjs.js +2 -2
  33. package/dist/Combobox-es.js +2 -2
  34. package/dist/ComboboxContent-cjs.js +3 -4
  35. package/dist/ComboboxContent-es.js +4 -5
  36. package/dist/ComboboxLoadMore-cjs.js +2 -2
  37. package/dist/ComboboxLoadMore-es.js +2 -2
  38. package/dist/ConfirmationModal/index.cjs +1 -3
  39. package/dist/ConfirmationModal/index.mjs +1 -3
  40. package/dist/ConfirmationModal-cjs.js +2 -2
  41. package/dist/ConfirmationModal-es.js +2 -2
  42. package/dist/ContentBlock/index.cjs +1 -6
  43. package/dist/ContentBlock/index.mjs +1 -6
  44. package/dist/ContentBlock-cjs.js +2 -2
  45. package/dist/ContentBlock-es.js +2 -2
  46. package/dist/DataDump/index.cjs +1 -4
  47. package/dist/DataDump/index.mjs +1 -4
  48. package/dist/DataList/components/DataListActions/index.cjs +1 -5
  49. package/dist/DataList/components/DataListActions/index.mjs +1 -5
  50. package/dist/DataList/components/DataListActionsMenu/index.cjs +1 -5
  51. package/dist/DataList/components/DataListActionsMenu/index.mjs +1 -5
  52. package/dist/DataList/components/DataListBulkActions/index.cjs +1 -5
  53. package/dist/DataList/components/DataListBulkActions/index.mjs +1 -5
  54. package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +1 -6
  55. package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +1 -6
  56. package/dist/DataList/components/DataListFilters/index.cjs +1 -7
  57. package/dist/DataList/components/DataListFilters/index.mjs +1 -7
  58. package/dist/DataList/components/DataListHeader/index.cjs +1 -5
  59. package/dist/DataList/components/DataListHeader/index.mjs +1 -5
  60. package/dist/DataList/components/DataListHeaderTile/components/index.cjs +1 -2
  61. package/dist/DataList/components/DataListHeaderTile/components/index.mjs +1 -2
  62. package/dist/DataList/components/DataListHeaderTile/index.cjs +1 -3
  63. package/dist/DataList/components/DataListHeaderTile/index.mjs +1 -3
  64. package/dist/DataList/components/DataListItem/index.cjs +1 -5
  65. package/dist/DataList/components/DataListItem/index.mjs +1 -5
  66. package/dist/DataList/components/DataListItemActions/index.cjs +1 -5
  67. package/dist/DataList/components/DataListItemActions/index.mjs +1 -5
  68. package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +1 -5
  69. package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +1 -5
  70. package/dist/DataList/components/DataListItems/index.cjs +1 -5
  71. package/dist/DataList/components/DataListItems/index.mjs +1 -5
  72. package/dist/DataList/components/DataListLayout/index.cjs +1 -5
  73. package/dist/DataList/components/DataListLayout/index.mjs +1 -5
  74. package/dist/DataList/components/DataListLayoutActions/index.cjs +1 -5
  75. package/dist/DataList/components/DataListLayoutActions/index.mjs +1 -5
  76. package/dist/DataList/components/DataListLoadMore/index.cjs +1 -1
  77. package/dist/DataList/components/DataListLoadMore/index.mjs +1 -1
  78. package/dist/DataList/components/DataListOverflowFade/index.cjs +1 -1
  79. package/dist/DataList/components/DataListOverflowFade/index.mjs +1 -1
  80. package/dist/DataList/components/DataListSearch/index.cjs +1 -2
  81. package/dist/DataList/components/DataListSearch/index.mjs +1 -2
  82. package/dist/DataList/components/DataListStatusBar/index.cjs +1 -3
  83. package/dist/DataList/components/DataListStatusBar/index.mjs +1 -3
  84. package/dist/DataList/index.cjs +1 -7
  85. package/dist/DataList/index.mjs +1 -7
  86. package/dist/DataListActionsMenu-cjs.js +5 -8
  87. package/dist/DataListActionsMenu-es.js +5 -8
  88. package/dist/DataListHeaderTile-cjs.js +2 -2
  89. package/dist/DataListHeaderTile-es.js +2 -2
  90. package/dist/DataListLoadMore-cjs.js +2 -2
  91. package/dist/DataListLoadMore-es.js +2 -2
  92. package/dist/DataListOverflowFade-cjs.js +3 -3
  93. package/dist/DataListOverflowFade-es.js +3 -3
  94. package/dist/DataListSearch-cjs.js +2 -2
  95. package/dist/DataListSearch-es.js +2 -2
  96. package/dist/DataListSortingOptions-cjs.js +3 -4
  97. package/dist/DataListSortingOptions-es.js +3 -4
  98. package/dist/DataTable/index.cjs +4 -6
  99. package/dist/DataTable/index.mjs +4 -6
  100. package/dist/DataTable/test-utilities/index.cjs +1 -7
  101. package/dist/DataTable/test-utilities/index.mjs +1 -7
  102. package/dist/DataTable-cjs.js +4 -4
  103. package/dist/DataTable-es.js +4 -4
  104. package/dist/DatePicker/index.cjs +1 -1
  105. package/dist/DatePicker/index.mjs +1 -1
  106. package/dist/DatePicker-cjs.js +2 -2
  107. package/dist/DatePicker-es.js +3 -3
  108. package/dist/Disclosure/index.cjs +1 -6
  109. package/dist/Disclosure/index.mjs +1 -6
  110. package/dist/Disclosure-cjs.js +3 -3
  111. package/dist/Disclosure-es.js +3 -3
  112. package/dist/FormField/FormFieldWrapper.d.ts +1 -1
  113. package/dist/FormField/index.cjs +1 -0
  114. package/dist/FormField/index.mjs +1 -0
  115. package/dist/FormField-cjs.js +2 -21
  116. package/dist/FormField-es.js +2 -21
  117. package/dist/FormatFile/index.cjs +1 -3
  118. package/dist/FormatFile/index.mjs +1 -3
  119. package/dist/Gallery/index.cjs +1 -6
  120. package/dist/Gallery/index.mjs +1 -6
  121. package/dist/InputDate/index.cjs +1 -2
  122. package/dist/InputDate/index.mjs +1 -2
  123. package/dist/InputEmail/index.cjs +1 -0
  124. package/dist/InputEmail/index.mjs +1 -0
  125. package/dist/InputNumber/index.cjs +1 -0
  126. package/dist/InputNumber/index.mjs +1 -0
  127. package/dist/InputPassword/index.cjs +1 -0
  128. package/dist/InputPassword/index.mjs +1 -0
  129. package/dist/InputPassword-cjs.js +1 -0
  130. package/dist/InputPassword-es.js +1 -0
  131. package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +1 -1
  132. package/dist/InputPhoneNumber/index.cjs +1 -0
  133. package/dist/InputPhoneNumber/index.mjs +1 -0
  134. package/dist/InputText/InputText.d.ts +2 -2
  135. package/dist/InputText/index.cjs +3 -3
  136. package/dist/InputText/index.mjs +3 -3
  137. package/dist/InputTime/index.cjs +1 -0
  138. package/dist/InputTime/index.mjs +2 -1
  139. package/dist/InternalChipDismissible-cjs.js +1 -0
  140. package/dist/InternalChipDismissible-es.js +1 -0
  141. package/dist/LightBox/index.cjs +1 -6
  142. package/dist/LightBox/index.mjs +1 -6
  143. package/dist/LightBox-cjs.js +12 -74
  144. package/dist/LightBox-es.js +12 -74
  145. package/dist/Menu/index.cjs +1 -4
  146. package/dist/Menu/index.mjs +1 -4
  147. package/dist/Menu-cjs.js +5 -37
  148. package/dist/Menu-es.js +6 -38
  149. package/dist/Modal/Modal.rebuilt.d.ts +1 -1
  150. package/dist/Modal/index.cjs +24 -22
  151. package/dist/Modal/index.mjs +25 -23
  152. package/dist/Page/index.cjs +2 -10
  153. package/dist/Page/index.mjs +2 -10
  154. package/dist/Page-cjs.js +5 -5
  155. package/dist/Page-es.js +5 -5
  156. package/dist/Popover/index.cjs +1 -1
  157. package/dist/Popover/index.mjs +1 -1
  158. package/dist/Popover-cjs.js +2 -2
  159. package/dist/Popover-es.js +3 -3
  160. package/dist/RecurringSelect/index.cjs +1 -0
  161. package/dist/RecurringSelect/index.mjs +1 -0
  162. package/dist/Select/index.cjs +1 -0
  163. package/dist/Select/index.mjs +1 -0
  164. package/dist/SideDrawer/index.cjs +1 -5
  165. package/dist/SideDrawer/index.mjs +1 -5
  166. package/dist/SideDrawer-cjs.js +7 -10
  167. package/dist/SideDrawer-es.js +7 -10
  168. package/dist/Tabs/index.cjs +0 -1
  169. package/dist/Tabs/index.mjs +0 -1
  170. package/dist/Tabs-cjs.js +76 -2
  171. package/dist/Tabs-es.js +76 -2
  172. package/dist/Tooltip/index.cjs +1 -2
  173. package/dist/Tooltip/index.mjs +1 -2
  174. package/dist/Tooltip-cjs.js +3 -4
  175. package/dist/Tooltip-es.js +4 -5
  176. package/dist/_baseEach-es.js +1 -1
  177. package/dist/_commonjsHelpers-cjs.js +0 -26
  178. package/dist/_commonjsHelpers-es.js +1 -26
  179. package/dist/_isIterateeCall-es.js +1 -1
  180. package/dist/debounce-es.js +2 -2
  181. package/dist/floating-ui.react-cjs.js +0 -118
  182. package/dist/floating-ui.react-es.js +1 -118
  183. package/dist/helpers-cjs.js +21 -2
  184. package/dist/helpers-es.js +1 -1
  185. package/dist/index.cjs +1 -9
  186. package/dist/index.mjs +1 -9
  187. package/dist/isObjectLike-es.js +1 -1
  188. package/dist/isSymbol-es.js +1 -1
  189. package/dist/isTypedArray-es.js +1 -1
  190. package/dist/keysIn-es.js +1 -1
  191. package/dist/omit-es.js +1 -1
  192. package/dist/styles.css +8 -7
  193. package/dist/useScrollToActive-cjs.js +3 -45
  194. package/dist/useScrollToActive-es.js +5 -47
  195. package/package.json +3 -3
  196. package/rollup.config.mjs +0 -15
  197. package/dist/throttle-cjs.js +0 -80
  198. package/dist/throttle-es.js +0 -77
  199. package/dist/useDebounce-cjs.js +0 -4416
  200. package/dist/useDebounce-es.js +0 -4413
  201. package/dist/useFocusTrap-cjs.js +0 -75
  202. package/dist/useFocusTrap-es.js +0 -73
  203. package/dist/useInView-cjs.js +0 -26
  204. package/dist/useInView-es.js +0 -24
  205. package/dist/useIsMounted-cjs.js +0 -51
  206. package/dist/useIsMounted-es.js +0 -49
  207. package/dist/useOnKeyDown-cjs.js +0 -41
  208. package/dist/useOnKeyDown-es.js +0 -39
  209. package/dist/useRefocusOnActivator-cjs.js +0 -33
  210. package/dist/useRefocusOnActivator-es.js +0 -31
  211. package/dist/useResizeObserver-cjs.js +0 -1131
  212. package/dist/useResizeObserver-es.js +0 -1128
  213. package/dist/useSafeLayoutEffect-cjs.js +0 -14
  214. package/dist/useSafeLayoutEffect-es.js +0 -12
@@ -187,4 +187,4 @@ function isObjectLike(value) {
187
187
 
188
188
  var isObjectLike_1 = isObjectLike;
189
189
 
190
- export { _baseGetTag as _, isObjectLike_1 as a, _Symbol as b, _root as c, _freeGlobal as d, isObject_1 as i };
190
+ export { _baseGetTag as _, isObject_1 as a, _Symbol as b, _root as c, _freeGlobal as d, isObjectLike_1 as i };
@@ -1,4 +1,4 @@
1
- import { _ as _baseGetTag, a as isObjectLike_1 } from './isObjectLike-es.js';
1
+ import { _ as _baseGetTag, i as isObjectLike_1 } from './isObjectLike-es.js';
2
2
 
3
3
  var baseGetTag = _baseGetTag,
4
4
  isObjectLike = isObjectLike_1;
@@ -1,4 +1,4 @@
1
- import { _ as _baseGetTag, i as isObject_1, c as _root, a as isObjectLike_1, d as _freeGlobal } from './isObjectLike-es.js';
1
+ import { _ as _baseGetTag, a as isObject_1, c as _root, i as isObjectLike_1, d as _freeGlobal } from './isObjectLike-es.js';
2
2
 
3
3
  var baseGetTag$2 = _baseGetTag,
4
4
  isObject$1 = isObject_1;
package/dist/keysIn-es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as _root, i as isObject_1, _ as _baseGetTag, a as isObjectLike_1 } from './isObjectLike-es.js';
1
+ import { c as _root, a as isObject_1, _ as _baseGetTag, i as isObjectLike_1 } from './isObjectLike-es.js';
2
2
  import { d as _Uint8Array, e as eq_1, f as _arrayLikeKeys } from './identity-es.js';
3
3
  import { e as _overArg, _ as _isPrototype, b as isArrayLike_1 } from './isTypedArray-es.js';
4
4
  import { _ as _baseAssignValue } from './_baseAssignValue-es.js';
package/dist/omit-es.js CHANGED
@@ -3,7 +3,7 @@ import { k as keys_1, c as _getSymbols, _ as _arrayPush, s as stubArray_1, d as
3
3
  import { c as _Stack } from './identity-es.js';
4
4
  import { _ as _copyObject, k as keysIn_1, e as _getPrototype, f as _cloneArrayBuffer, b as _cloneTypedArray, a as _cloneBufferExports, c as _copyArray, d as _initCloneObject, g as _assignValue, i as isPlainObject_1 } from './keysIn-es.js';
5
5
  import { a as _getTag } from './_getTag-es.js';
6
- import { b as _Symbol, a as isObjectLike_1, i as isObject_1 } from './isObjectLike-es.js';
6
+ import { b as _Symbol, i as isObjectLike_1, a as isObject_1 } from './isObjectLike-es.js';
7
7
  import { l as _nodeUtilExports, k as _baseUnary, c as isBufferExports, a as isArray_1 } from './isTypedArray-es.js';
8
8
  import { _ as _baseFlatten } from './_baseFlatten-es.js';
9
9
  import { _ as _overRest, a as _setToString } from './_setToString-es.js';
package/dist/styles.css CHANGED
@@ -4630,8 +4630,6 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
4630
4630
 
4631
4631
  .cRhQeXmZobs- {
4632
4632
  display: grid;
4633
- z-index: 1001;
4634
- z-index: var(--elevation-modal);
4635
4633
  -ms-flex-align: center;
4636
4634
  align-items: center;
4637
4635
  justify-items: center;
@@ -4644,11 +4642,10 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
4644
4642
  right: 0;
4645
4643
  bottom: 0;
4646
4644
  left: 0;
4647
- z-index: 1001;
4648
- z-index: var(--elevation-modal);
4645
+ outline: none;
4649
4646
  background-color: rgba(0, 0, 0, 0.32);
4650
4647
  background-color: var(--color-overlay);
4651
- opacity: 0.8;
4648
+ will-change: opacity;
4652
4649
  }
4653
4650
 
4654
4651
  .OiqCKNmbHZ0- {
@@ -4667,12 +4664,16 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
4667
4664
  border: var(--border-base) solid var(--color-border);
4668
4665
  border-radius: 8px;
4669
4666
  border-radius: var(--radius-base);
4667
+ outline: none;
4670
4668
  background-color: rgba(255, 255, 255, 1);
4671
4669
  background-color: var(--color-surface);
4672
4670
  -ms-flex: 0 0 auto;
4673
4671
  flex: 0 0 auto;
4674
- outline-color: hsl(198, 12%, 57%);
4675
- outline-color: var(--color-focus);
4672
+ }
4673
+
4674
+ .OiqCKNmbHZ0-:focus-visible {
4675
+ box-shadow: 0px 0px 0px 2px rgba(255, 255, 255, 1), 0px 0px 0px 4px hsl(198, 12%, 57%);
4676
+ box-shadow: var(--shadow-focus);
4676
4677
  }
4677
4678
 
4678
4679
  /* Adjust `Content` and `Tab` components public padding to match the modal */
@@ -9,6 +9,7 @@ var isTypedArray = require('./isTypedArray-cjs.js');
9
9
  var isSymbol$1 = require('./isSymbol-cjs.js');
10
10
  var identity$1 = require('./identity-cjs.js');
11
11
  var _isIterateeCall = require('./_isIterateeCall-cjs.js');
12
+ var jobberHooks = require('@jobber/hooks');
12
13
  var debounce = require('./debounce-cjs.js');
13
14
  var Icon = require('./Icon-cjs.js');
14
15
  var floatingUi_react = require('./floating-ui.react-cjs.js');
@@ -248,49 +249,6 @@ var sortBy_1 = sortBy;
248
249
 
249
250
  var sortBy$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(sortBy_1);
250
251
 
251
- var useLiveAnnounce$1 = {};
252
-
253
- Object.defineProperty(useLiveAnnounce$1, "__esModule", { value: true });
254
- var useLiveAnnounce_2 = useLiveAnnounce$1.useLiveAnnounce = useLiveAnnounce;
255
- const react_1 = React;
256
- /**
257
- * Announce a message on voice over whenever you do an action. This is
258
- * especially helpful when you have an action that adds or deletes an element
259
- * from the screen.
260
- */
261
- function useLiveAnnounce() {
262
- const [announcedMessage, setAnnouncedMessage] = (0, react_1.useState)("");
263
- (0, react_1.useEffect)(() => {
264
- let target;
265
- if (announcedMessage) {
266
- target = createAnnouncedElement();
267
- setTimeout(() => target.append(announcedMessage), 100);
268
- }
269
- return () => target === null || target === void 0 ? void 0 : target.remove();
270
- }, [announcedMessage]);
271
- return {
272
- liveAnnounce: (message) => {
273
- setAnnouncedMessage(message);
274
- },
275
- };
276
- }
277
- // eslint-disable-next-line max-statements
278
- function createAnnouncedElement() {
279
- const el = document.createElement("div");
280
- el.style.position = "absolute";
281
- el.style.width = "1px";
282
- el.style.height = "1px";
283
- el.style.overflow = "hidden";
284
- el.style.clipPath = " inset(100%)";
285
- el.style.whiteSpace = " nowrap";
286
- el.style.top = "0";
287
- el.setAttribute("role", "status");
288
- el.setAttribute("aria-atomic", "true");
289
- el.setAttribute("aria-live", "assertive");
290
- document.body.appendChild(el);
291
- return el;
292
- }
293
-
294
252
  /**
295
253
  * Recursively finds a focusable element (div or button) in the specified direction
296
254
  */
@@ -316,7 +274,7 @@ function useInternalChipDismissible({ children, selected, onChange, onClick, onC
316
274
  const visibleChipOptions = chipOptions.filter(chip => selected.includes(chip.value));
317
275
  const sortedVisibleChipOptions = sortBy$1(visibleChipOptions, chip => selected.indexOf(chip.value));
318
276
  const availableChipOptions = chipOptions.filter(chip => !selected.includes(chip.value));
319
- const { liveAnnounce } = useLiveAnnounce_2();
277
+ const { liveAnnounce } = jobberHooks.useLiveAnnounce();
320
278
  const actions = {
321
279
  handleChipRemove: (value) => {
322
280
  return () => {
@@ -386,7 +344,7 @@ function useInternalChipDismissibleInput({ options, isLoadingMore = false, onCus
386
344
  const [shouldCancelEnter, setShouldCancelEnter] = React.useState(false);
387
345
  const canAddCustomOption = onCustomOptionSelect !== undefined && !isLoadingMore;
388
346
  const maxOptionIndex = allOptions.length - 1;
389
- const { liveAnnounce } = useLiveAnnounce_2();
347
+ const { liveAnnounce } = jobberHooks.useLiveAnnounce();
390
348
  React.useEffect(() => {
391
349
  setAllOptions(generateOptions(options, searchValue, canAddCustomOption));
392
350
  }, [options]);
@@ -7,9 +7,10 @@ import { b as isArrayLike_1, k as _baseUnary, a as isArray_1 } from './isTypedAr
7
7
  import { i as isSymbol_1 } from './isSymbol-es.js';
8
8
  import { i as identity_1 } from './identity-es.js';
9
9
  import { _ as _baseRest, a as _isIterateeCall } from './_isIterateeCall-es.js';
10
- import { a as debounce } from './debounce-es.js';
10
+ import { useLiveAnnounce } from '@jobber/hooks';
11
+ import { d as debounce } from './debounce-es.js';
11
12
  import { I as Icon } from './Icon-es.js';
12
- import { u as useFloating, o as offset, f as flip, e as size, b as autoUpdate } from './floating-ui.react-es.js';
13
+ import { u as useFloating, o as offset, f as flip, s as size, c as autoUpdate } from './floating-ui.react-es.js';
13
14
  import { c as calculateMaxHeight } from './maxHeight-es.js';
14
15
 
15
16
  var baseEach = _baseEach,
@@ -246,49 +247,6 @@ var sortBy_1 = sortBy;
246
247
 
247
248
  var sortBy$1 = /*@__PURE__*/getDefaultExportFromCjs(sortBy_1);
248
249
 
249
- var useLiveAnnounce$1 = {};
250
-
251
- Object.defineProperty(useLiveAnnounce$1, "__esModule", { value: true });
252
- var useLiveAnnounce_2 = useLiveAnnounce$1.useLiveAnnounce = useLiveAnnounce;
253
- const react_1 = React__default;
254
- /**
255
- * Announce a message on voice over whenever you do an action. This is
256
- * especially helpful when you have an action that adds or deletes an element
257
- * from the screen.
258
- */
259
- function useLiveAnnounce() {
260
- const [announcedMessage, setAnnouncedMessage] = (0, react_1.useState)("");
261
- (0, react_1.useEffect)(() => {
262
- let target;
263
- if (announcedMessage) {
264
- target = createAnnouncedElement();
265
- setTimeout(() => target.append(announcedMessage), 100);
266
- }
267
- return () => target === null || target === void 0 ? void 0 : target.remove();
268
- }, [announcedMessage]);
269
- return {
270
- liveAnnounce: (message) => {
271
- setAnnouncedMessage(message);
272
- },
273
- };
274
- }
275
- // eslint-disable-next-line max-statements
276
- function createAnnouncedElement() {
277
- const el = document.createElement("div");
278
- el.style.position = "absolute";
279
- el.style.width = "1px";
280
- el.style.height = "1px";
281
- el.style.overflow = "hidden";
282
- el.style.clipPath = " inset(100%)";
283
- el.style.whiteSpace = " nowrap";
284
- el.style.top = "0";
285
- el.setAttribute("role", "status");
286
- el.setAttribute("aria-atomic", "true");
287
- el.setAttribute("aria-live", "assertive");
288
- document.body.appendChild(el);
289
- return el;
290
- }
291
-
292
250
  /**
293
251
  * Recursively finds a focusable element (div or button) in the specified direction
294
252
  */
@@ -314,7 +272,7 @@ function useInternalChipDismissible({ children, selected, onChange, onClick, onC
314
272
  const visibleChipOptions = chipOptions.filter(chip => selected.includes(chip.value));
315
273
  const sortedVisibleChipOptions = sortBy$1(visibleChipOptions, chip => selected.indexOf(chip.value));
316
274
  const availableChipOptions = chipOptions.filter(chip => !selected.includes(chip.value));
317
- const { liveAnnounce } = useLiveAnnounce_2();
275
+ const { liveAnnounce } = useLiveAnnounce();
318
276
  const actions = {
319
277
  handleChipRemove: (value) => {
320
278
  return () => {
@@ -384,7 +342,7 @@ function useInternalChipDismissibleInput({ options, isLoadingMore = false, onCus
384
342
  const [shouldCancelEnter, setShouldCancelEnter] = useState(false);
385
343
  const canAddCustomOption = onCustomOptionSelect !== undefined && !isLoadingMore;
386
344
  const maxOptionIndex = allOptions.length - 1;
387
- const { liveAnnounce } = useLiveAnnounce_2();
345
+ const { liveAnnounce } = useLiveAnnounce();
388
346
  useEffect(() => {
389
347
  setAllOptions(generateOptions(options, searchValue, canAddCustomOption));
390
348
  }, [options]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.90.3",
3
+ "version": "6.91.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -473,7 +473,7 @@
473
473
  ],
474
474
  "dependencies": {
475
475
  "@floating-ui/react": "^0.27.5",
476
- "@jobber/formatters": "^0.4.2",
476
+ "@jobber/formatters": "^0.5.0",
477
477
  "@tanstack/react-table": "8.5.13",
478
478
  "@types/color": "^3.0.1",
479
479
  "@types/lodash": "^4.14.136",
@@ -541,5 +541,5 @@
541
541
  "> 1%",
542
542
  "IE 10"
543
543
  ],
544
- "gitHead": "e93994a2cb7cb82cc0e2b1e67ef2e09c98bebb1f"
544
+ "gitHead": "dfeb4b6ca90a32b9ad3ab44e5a0dd110c6a113fc"
545
545
  }
package/rollup.config.mjs CHANGED
@@ -1,6 +1,4 @@
1
1
  /* eslint-disable import/no-default-export */
2
- import { fileURLToPath } from "url";
3
- import { dirname, resolve } from "path";
4
2
  import typescript from "@rollup/plugin-typescript";
5
3
  import postcss from "rollup-plugin-postcss";
6
4
  import commonjs from "@rollup/plugin-commonjs";
@@ -12,10 +10,6 @@ import tools from "@csstools/postcss-global-data";
12
10
  import presetenv from "postcss-preset-env";
13
11
  import multiInput from "rollup-plugin-multi-input";
14
12
  import nodePolyfills from "rollup-plugin-polyfill-node";
15
- import alias from "@rollup/plugin-alias";
16
-
17
- const __filename = fileURLToPath(import.meta.url);
18
- const __dirname = dirname(__filename);
19
13
 
20
14
  /**
21
15
  * When PREBUILD_CSS is supplied, only build the main index.ts file.
@@ -31,15 +25,6 @@ export default {
31
25
  input: PREBUILD_CSS ? "src/index.ts" : `src/**/index.{ts,tsx}`,
32
26
  plugins: [
33
27
  nodePolyfills(),
34
- alias({
35
- entries: [
36
- {
37
- find: /@jobber\/hooks\/(.*)/,
38
- replacement: (_, p1) =>
39
- resolve(__dirname, `../hooks/dist/${p1}/${p1}.js`),
40
- },
41
- ],
42
- }),
43
28
  nodeResolve(),
44
29
  multiInput.default(),
45
30
  typescript({
@@ -1,80 +0,0 @@
1
- 'use strict';
2
-
3
- var _commonjsHelpers = require('./_commonjsHelpers-cjs.js');
4
- var debounce$1 = require('./debounce-cjs.js');
5
- var isObjectLike = require('./isObjectLike-cjs.js');
6
-
7
- var debounce = debounce$1.debounce_1,
8
- isObject = isObjectLike.isObject_1;
9
-
10
- /** Error message constants. */
11
- var FUNC_ERROR_TEXT = 'Expected a function';
12
-
13
- /**
14
- * Creates a throttled function that only invokes `func` at most once per
15
- * every `wait` milliseconds. The throttled function comes with a `cancel`
16
- * method to cancel delayed `func` invocations and a `flush` method to
17
- * immediately invoke them. Provide `options` to indicate whether `func`
18
- * should be invoked on the leading and/or trailing edge of the `wait`
19
- * timeout. The `func` is invoked with the last arguments provided to the
20
- * throttled function. Subsequent calls to the throttled function return the
21
- * result of the last `func` invocation.
22
- *
23
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
24
- * invoked on the trailing edge of the timeout only if the throttled function
25
- * is invoked more than once during the `wait` timeout.
26
- *
27
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
28
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
29
- *
30
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
31
- * for details over the differences between `_.throttle` and `_.debounce`.
32
- *
33
- * @static
34
- * @memberOf _
35
- * @since 0.1.0
36
- * @category Function
37
- * @param {Function} func The function to throttle.
38
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
39
- * @param {Object} [options={}] The options object.
40
- * @param {boolean} [options.leading=true]
41
- * Specify invoking on the leading edge of the timeout.
42
- * @param {boolean} [options.trailing=true]
43
- * Specify invoking on the trailing edge of the timeout.
44
- * @returns {Function} Returns the new throttled function.
45
- * @example
46
- *
47
- * // Avoid excessively updating the position while scrolling.
48
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
49
- *
50
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
51
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
52
- * jQuery(element).on('click', throttled);
53
- *
54
- * // Cancel the trailing throttled invocation.
55
- * jQuery(window).on('popstate', throttled.cancel);
56
- */
57
- function throttle(func, wait, options) {
58
- var leading = true,
59
- trailing = true;
60
-
61
- if (typeof func != 'function') {
62
- throw new TypeError(FUNC_ERROR_TEXT);
63
- }
64
- if (isObject(options)) {
65
- leading = 'leading' in options ? !!options.leading : leading;
66
- trailing = 'trailing' in options ? !!options.trailing : trailing;
67
- }
68
- return debounce(func, wait, {
69
- 'leading': leading,
70
- 'maxWait': wait,
71
- 'trailing': trailing
72
- });
73
- }
74
-
75
- var throttle_1 = throttle;
76
-
77
- var throttle$1 = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(throttle_1);
78
-
79
- exports.throttle = throttle$1;
80
- exports.throttle_1 = throttle_1;
@@ -1,77 +0,0 @@
1
- import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
2
- import { d as debounce_1 } from './debounce-es.js';
3
- import { i as isObject_1 } from './isObjectLike-es.js';
4
-
5
- var debounce = debounce_1,
6
- isObject = isObject_1;
7
-
8
- /** Error message constants. */
9
- var FUNC_ERROR_TEXT = 'Expected a function';
10
-
11
- /**
12
- * Creates a throttled function that only invokes `func` at most once per
13
- * every `wait` milliseconds. The throttled function comes with a `cancel`
14
- * method to cancel delayed `func` invocations and a `flush` method to
15
- * immediately invoke them. Provide `options` to indicate whether `func`
16
- * should be invoked on the leading and/or trailing edge of the `wait`
17
- * timeout. The `func` is invoked with the last arguments provided to the
18
- * throttled function. Subsequent calls to the throttled function return the
19
- * result of the last `func` invocation.
20
- *
21
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
22
- * invoked on the trailing edge of the timeout only if the throttled function
23
- * is invoked more than once during the `wait` timeout.
24
- *
25
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
26
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
27
- *
28
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
29
- * for details over the differences between `_.throttle` and `_.debounce`.
30
- *
31
- * @static
32
- * @memberOf _
33
- * @since 0.1.0
34
- * @category Function
35
- * @param {Function} func The function to throttle.
36
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
37
- * @param {Object} [options={}] The options object.
38
- * @param {boolean} [options.leading=true]
39
- * Specify invoking on the leading edge of the timeout.
40
- * @param {boolean} [options.trailing=true]
41
- * Specify invoking on the trailing edge of the timeout.
42
- * @returns {Function} Returns the new throttled function.
43
- * @example
44
- *
45
- * // Avoid excessively updating the position while scrolling.
46
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
47
- *
48
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
49
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
50
- * jQuery(element).on('click', throttled);
51
- *
52
- * // Cancel the trailing throttled invocation.
53
- * jQuery(window).on('popstate', throttled.cancel);
54
- */
55
- function throttle(func, wait, options) {
56
- var leading = true,
57
- trailing = true;
58
-
59
- if (typeof func != 'function') {
60
- throw new TypeError(FUNC_ERROR_TEXT);
61
- }
62
- if (isObject(options)) {
63
- leading = 'leading' in options ? !!options.leading : leading;
64
- trailing = 'trailing' in options ? !!options.trailing : trailing;
65
- }
66
- return debounce(func, wait, {
67
- 'leading': leading,
68
- 'maxWait': wait,
69
- 'trailing': trailing
70
- });
71
- }
72
-
73
- var throttle_1 = throttle;
74
-
75
- var throttle$1 = /*@__PURE__*/getDefaultExportFromCjs(throttle_1);
76
-
77
- export { throttle_1 as a, throttle$1 as t };