@jobber/components 9.5.3 → 9.6.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 (178) hide show
  1. package/Combobox.d.ts +1 -0
  2. package/Combobox.js +17 -0
  3. package/dist/Autocomplete/index.cjs +0 -2
  4. package/dist/Autocomplete/index.mjs +0 -2
  5. package/dist/Autocomplete-cjs.js +4 -5
  6. package/dist/Autocomplete-es.js +1 -2
  7. package/dist/Card/index.cjs +2 -2
  8. package/dist/Card/index.mjs +2 -2
  9. package/dist/Chip/index.cjs +0 -2
  10. package/dist/Chip/index.mjs +0 -2
  11. package/dist/Chips/InternalChipDismissible/hooks/index.cjs +0 -2
  12. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +0 -2
  13. package/dist/Chips/InternalChipDismissible/index.cjs +0 -2
  14. package/dist/Chips/InternalChipDismissible/index.mjs +0 -2
  15. package/dist/Chips/index.cjs +0 -2
  16. package/dist/Chips/index.mjs +0 -2
  17. package/dist/Combobox/Combobox.contentSlots.d.ts +5 -0
  18. package/dist/Combobox/Combobox.context.d.ts +34 -0
  19. package/dist/Combobox/Combobox.d.ts +69 -0
  20. package/dist/Combobox/Combobox.footer.d.ts +7 -0
  21. package/dist/Combobox/Combobox.items.d.ts +25 -0
  22. package/dist/Combobox/Combobox.responsive.d.ts +54 -0
  23. package/dist/Combobox/Combobox.selectAll.d.ts +4 -0
  24. package/dist/Combobox/Combobox.slotFactory.d.ts +7 -0
  25. package/dist/Combobox/Combobox.testUtils.d.ts +12 -0
  26. package/dist/Combobox/Combobox.types.d.ts +166 -0
  27. package/dist/Combobox/index.cjs +35 -0
  28. package/dist/Combobox/index.d.ts +2 -0
  29. package/dist/Combobox/index.mjs +29 -0
  30. package/dist/Combobox-cjs.js +675 -0
  31. package/dist/Combobox-es.js +673 -0
  32. package/dist/ComboboxPrimitive-cjs.js +88 -47
  33. package/dist/ComboboxPrimitive-es.js +39 -23
  34. package/dist/{ComboboxChipRemove-cjs.js → ComboboxSeparator-cjs.js} +501 -455
  35. package/dist/{ComboboxChipRemove-es.js → ComboboxSeparator-es.js} +500 -456
  36. package/dist/ConfirmationModal/index.cjs +0 -2
  37. package/dist/ConfirmationModal/index.mjs +0 -2
  38. package/dist/ContentBlock/index.cjs +1 -0
  39. package/dist/ContentBlock/index.mjs +1 -0
  40. package/dist/ContentBlock-cjs.js +2 -18
  41. package/dist/ContentBlock-es.js +1 -17
  42. package/dist/DataDump/index.cjs +2 -2
  43. package/dist/DataDump/index.mjs +2 -2
  44. package/dist/DataList/components/DataListActions/index.cjs +0 -2
  45. package/dist/DataList/components/DataListActions/index.mjs +0 -2
  46. package/dist/DataList/components/DataListBulkActions/index.cjs +0 -2
  47. package/dist/DataList/components/DataListBulkActions/index.mjs +0 -2
  48. package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +0 -2
  49. package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +0 -2
  50. package/dist/DataList/components/DataListFilters/index.cjs +0 -2
  51. package/dist/DataList/components/DataListFilters/index.mjs +0 -2
  52. package/dist/DataList/components/DataListHeader/index.cjs +0 -2
  53. package/dist/DataList/components/DataListHeader/index.mjs +0 -2
  54. package/dist/DataList/components/DataListItem/index.cjs +0 -2
  55. package/dist/DataList/components/DataListItem/index.mjs +0 -2
  56. package/dist/DataList/components/DataListItemActions/index.cjs +0 -2
  57. package/dist/DataList/components/DataListItemActions/index.mjs +0 -2
  58. package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +0 -2
  59. package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +0 -2
  60. package/dist/DataList/components/DataListItems/index.cjs +0 -2
  61. package/dist/DataList/components/DataListItems/index.mjs +0 -2
  62. package/dist/DataList/components/DataListLayout/index.cjs +0 -2
  63. package/dist/DataList/components/DataListLayout/index.mjs +0 -2
  64. package/dist/DataList/components/DataListLayoutActions/index.cjs +0 -2
  65. package/dist/DataList/components/DataListLayoutActions/index.mjs +0 -2
  66. package/dist/DataList/index.cjs +0 -2
  67. package/dist/DataList/index.mjs +0 -2
  68. package/dist/DatePicker/index.cjs +0 -2
  69. package/dist/DatePicker/index.mjs +0 -2
  70. package/dist/DatePicker-cjs.js +4 -5
  71. package/dist/DatePicker-es.js +1 -2
  72. package/dist/Dialog/index.cjs +2 -2
  73. package/dist/Dialog/index.mjs +2 -2
  74. package/dist/DrawerDescription-cjs.js +268 -99
  75. package/dist/DrawerDescription-es.js +270 -103
  76. package/dist/DrawerTitle-cjs.js +2 -6
  77. package/dist/DrawerTitle-es.js +3 -7
  78. package/dist/FieldDescription-cjs.js +184 -181
  79. package/dist/FieldDescription-es.js +187 -184
  80. package/dist/FilterPicker/components/FilterPickerActivator/index.cjs +0 -2
  81. package/dist/FilterPicker/components/FilterPickerActivator/index.mjs +0 -2
  82. package/dist/FilterPicker/components/FilterPickerContent/index.cjs +0 -2
  83. package/dist/FilterPicker/components/FilterPickerContent/index.mjs +0 -2
  84. package/dist/FilterPicker/components/FilterPickerTrigger/index.cjs +0 -2
  85. package/dist/FilterPicker/components/FilterPickerTrigger/index.mjs +0 -2
  86. package/dist/FilterPicker/index.cjs +0 -2
  87. package/dist/FilterPicker/index.mjs +0 -2
  88. package/dist/FilterPickerContent-cjs.js +4 -5
  89. package/dist/FilterPickerContent-es.js +1 -2
  90. package/dist/FormatFile/index.cjs +0 -2
  91. package/dist/FormatFile/index.mjs +0 -2
  92. package/dist/Gallery/index.cjs +0 -2
  93. package/dist/Gallery/index.mjs +0 -2
  94. package/dist/InputDate/index.cjs +0 -2
  95. package/dist/InputDate/index.mjs +0 -2
  96. package/dist/InputNumber/index.cjs +2 -2
  97. package/dist/InputNumber/index.mjs +2 -2
  98. package/dist/InputNumber/types.d.ts +5 -0
  99. package/dist/InputNumber-cjs.js +2 -2
  100. package/dist/InputNumber-es.js +2 -2
  101. package/dist/LightBox/index.cjs +0 -2
  102. package/dist/LightBox/index.mjs +0 -2
  103. package/dist/Menu/index.cjs +2 -2
  104. package/dist/Menu/index.mjs +2 -2
  105. package/dist/Menu-cjs.js +4 -5
  106. package/dist/Menu-es.js +1 -2
  107. package/dist/MenuSubmenuTrigger-cjs.js +206 -164
  108. package/dist/MenuSubmenuTrigger-es.js +194 -152
  109. package/dist/Modal/index.cjs +0 -2
  110. package/dist/Modal/index.mjs +1 -3
  111. package/dist/NumberFieldInput-cjs.js +187 -308
  112. package/dist/NumberFieldInput-es.js +187 -308
  113. package/dist/Page/index.cjs +2 -2
  114. package/dist/Page/index.mjs +2 -2
  115. package/dist/Popover/index.cjs +0 -2
  116. package/dist/Popover/index.mjs +0 -2
  117. package/dist/Popover-cjs.js +7 -8
  118. package/dist/Popover-es.js +1 -2
  119. package/dist/ScrollAreaViewport-cjs.js +747 -1093
  120. package/dist/ScrollAreaViewport-es.js +734 -1081
  121. package/dist/Select/index.cjs +2 -2
  122. package/dist/Select/index.mjs +2 -2
  123. package/dist/SelectGroupLabel-cjs.js +207 -306
  124. package/dist/SelectGroupLabel-es.js +203 -302
  125. package/dist/SelectPrimitive-cjs.js +11 -17
  126. package/dist/SelectPrimitive-es.js +1 -7
  127. package/dist/Tooltip/index.cjs +0 -2
  128. package/dist/Tooltip/index.mjs +0 -2
  129. package/dist/Tooltip-cjs.js +6 -7
  130. package/dist/Tooltip-es.js +1 -2
  131. package/dist/buttonRenderAdapter-cjs.js +2 -1
  132. package/dist/buttonRenderAdapter-es.js +2 -1
  133. package/dist/dialogReturnFocus-cjs.js +1 -1
  134. package/dist/dialogReturnFocus-es.js +2 -2
  135. package/dist/docs/InputNumber/InputNumber.md +2 -2
  136. package/dist/docs/SelectPrimitive/SelectPrimitive.md +1 -1
  137. package/dist/floating-ui.react-cjs.js +2557 -185
  138. package/dist/floating-ui.react-es.js +2512 -149
  139. package/dist/getMappedBreakpointWidth-cjs.js +21 -0
  140. package/dist/getMappedBreakpointWidth-es.js +18 -0
  141. package/dist/index.cjs +15 -10
  142. package/dist/index.d.mts +1 -0
  143. package/dist/index.d.ts +1 -0
  144. package/dist/index.mjs +14 -10
  145. package/dist/mergeClassName-cjs.js +12 -0
  146. package/dist/mergeClassName-es.js +10 -0
  147. package/dist/primitives/BottomSheet/index.cjs +1 -1
  148. package/dist/primitives/BottomSheet/index.mjs +1 -1
  149. package/dist/primitives/ComboboxPrimitive/ComboboxPrimitive.d.ts +2 -2
  150. package/dist/primitives/ComboboxPrimitive/index.cjs +4 -5
  151. package/dist/primitives/ComboboxPrimitive/index.mjs +4 -5
  152. package/dist/primitives/SelectPrimitive/index.cjs +1 -2
  153. package/dist/primitives/SelectPrimitive/index.mjs +1 -2
  154. package/dist/primitives/index.cjs +3 -3
  155. package/dist/primitives/index.mjs +3 -3
  156. package/dist/scrollEdges-cjs.js +1 -11
  157. package/dist/scrollEdges-es.js +1 -11
  158. package/dist/scrollable-cjs.js +58 -0
  159. package/dist/scrollable-es.js +54 -0
  160. package/dist/styles.css +759 -42
  161. package/dist/unstyledPrimitives/index.cjs +720 -478
  162. package/dist/unstyledPrimitives/index.mjs +663 -421
  163. package/dist/useCompositeListItem-cjs.js +2108 -361
  164. package/dist/useCompositeListItem-es.js +2076 -331
  165. package/dist/useLabel-cjs.js +2 -3
  166. package/dist/useLabel-es.js +2 -3
  167. package/dist/useRenderElement-cjs.js +9 -7
  168. package/dist/useRenderElement-es.js +9 -7
  169. package/dist/useScrollLock-cjs.js +819 -344
  170. package/dist/useScrollLock-es.js +732 -296
  171. package/dist/useScrollToActive-cjs.js +4 -5
  172. package/dist/useScrollToActive-es.js +1 -2
  173. package/dist/utils/meta/meta.json +43 -1
  174. package/package.json +8 -3
  175. package/dist/floating-ui.react-dom-cjs.js +0 -2103
  176. package/dist/floating-ui.react-dom-es.js +0 -2072
  177. package/dist/floating-ui.utils-cjs.js +0 -342
  178. package/dist/floating-ui.utils-es.js +0 -300
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var floatingUi_utils = require('./floating-ui.utils-cjs.js');
4
3
  var useScrollLock = require('./useScrollLock-cjs.js');
5
4
  var useCompositeListItem = require('./useCompositeListItem-cjs.js');
6
5
 
@@ -9,7 +8,7 @@ function useRegisteredLabelId(idProp, setLabelId) {
9
8
  useScrollLock.useIsoLayoutEffect(() => {
10
9
  setLabelId(id);
11
10
  return () => {
12
- setLabelId(undefined);
11
+ setLabelId(currentId => currentId === id ? undefined : currentId);
13
12
  };
14
13
  }, [id, setLabelId]);
15
14
  return id;
@@ -42,7 +41,7 @@ function useLabel(params = {}) {
42
41
  return;
43
42
  }
44
43
  const controlElement = useScrollLock.ownerDocument(event.currentTarget).getElementById(resolvedControlId);
45
- if (floatingUi_utils.isHTMLElement(controlElement)) {
44
+ if (useScrollLock.isHTMLElement(controlElement)) {
46
45
  focusElementWithVisible(controlElement);
47
46
  }
48
47
  }
@@ -1,5 +1,4 @@
1
- import { i as isHTMLElement } from './floating-ui.utils-es.js';
2
- import { u as useBaseUiId, a as useIsoLayoutEffect, b as useStableCallback, g as getTarget, o as ownerDocument } from './useScrollLock-es.js';
1
+ import { u as useBaseUiId, c as useIsoLayoutEffect, d as useStableCallback, e as getTarget, o as ownerDocument, i as isHTMLElement } from './useScrollLock-es.js';
3
2
  import { u as useLabelableContext } from './useCompositeListItem-es.js';
4
3
 
5
4
  function useRegisteredLabelId(idProp, setLabelId) {
@@ -7,7 +6,7 @@ function useRegisteredLabelId(idProp, setLabelId) {
7
6
  useIsoLayoutEffect(() => {
8
7
  setLabelId(id);
9
8
  return () => {
10
- setLabelId(undefined);
9
+ setLabelId(currentId => currentId === id ? undefined : currentId);
11
10
  };
12
11
  }, [id, setLabelId]);
13
12
  return id;
@@ -364,7 +364,9 @@ function update(forkRef, refs) {
364
364
  if (typeof cleanupCallback === 'function') {
365
365
  cleanupCallback();
366
366
  } else {
367
- ref(null);
367
+ // Legacy ref with no attach-time cleanup: detach by calling it with `null`.
368
+ // It returns nothing; React 19 cleanups are handled in the branch above.
369
+ void ref(null);
368
370
  }
369
371
  break;
370
372
  }
@@ -536,7 +538,8 @@ function useRenderElementProps(componentProps, params = {}) {
536
538
  /* eslint-disable react-hooks/rules-of-hooks */
537
539
  if (typeof document !== 'undefined') {
538
540
  if (!enabled) {
539
- useMergedRefs(null, null);
541
+ // Called only to keep the hook order stable when disabled; the merged ref is unused.
542
+ void useMergedRefs(null, null);
540
543
  } else if (Array.isArray(ref)) {
541
544
  outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
542
545
  } else {
@@ -562,9 +565,9 @@ function resolveRenderFunctionProps(props) {
562
565
  }
563
566
 
564
567
  // The symbol React uses internally for lazy components
565
- // https://github.com/facebook/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31
568
+ // https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31
566
569
  //
567
- // TODO delete once https://github.com/facebook/react/issues/32392 is fixed
570
+ // TODO delete once https://github.com/react/react/issues/32392 is fixed
568
571
  const REACT_LAZY_TYPE = Symbol.for('react.lazy');
569
572
  const COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
570
573
  const LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
@@ -579,10 +582,9 @@ function evaluateRenderProp(element, render, props, state) {
579
582
  const mergedProps = mergeProps(props, render.props);
580
583
  mergedProps.ref = props.ref;
581
584
  let newElement = render;
582
-
583
- // Workaround for https://github.com/facebook/react/issues/32392
585
+ // Workaround for https://github.com/react/react/issues/32392
584
586
  // This works because the toArray() logic unwrap lazy element type in
585
- // https://github.com/facebook/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186
587
+ // https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186
586
588
  if (newElement?.$$typeof === REACT_LAZY_TYPE) {
587
589
  const children = React__namespace.Children.toArray(render);
588
590
  newElement = children[0];
@@ -344,7 +344,9 @@ function update(forkRef, refs) {
344
344
  if (typeof cleanupCallback === 'function') {
345
345
  cleanupCallback();
346
346
  } else {
347
- ref(null);
347
+ // Legacy ref with no attach-time cleanup: detach by calling it with `null`.
348
+ // It returns nothing; React 19 cleanups are handled in the branch above.
349
+ void ref(null);
348
350
  }
349
351
  break;
350
352
  }
@@ -516,7 +518,8 @@ function useRenderElementProps(componentProps, params = {}) {
516
518
  /* eslint-disable react-hooks/rules-of-hooks */
517
519
  if (typeof document !== 'undefined') {
518
520
  if (!enabled) {
519
- useMergedRefs(null, null);
521
+ // Called only to keep the hook order stable when disabled; the merged ref is unused.
522
+ void useMergedRefs(null, null);
520
523
  } else if (Array.isArray(ref)) {
521
524
  outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
522
525
  } else {
@@ -542,9 +545,9 @@ function resolveRenderFunctionProps(props) {
542
545
  }
543
546
 
544
547
  // The symbol React uses internally for lazy components
545
- // https://github.com/facebook/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31
548
+ // https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31
546
549
  //
547
- // TODO delete once https://github.com/facebook/react/issues/32392 is fixed
550
+ // TODO delete once https://github.com/react/react/issues/32392 is fixed
548
551
  const REACT_LAZY_TYPE = Symbol.for('react.lazy');
549
552
  const COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
550
553
  const LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
@@ -559,10 +562,9 @@ function evaluateRenderProp(element, render, props, state) {
559
562
  const mergedProps = mergeProps(props, render.props);
560
563
  mergedProps.ref = props.ref;
561
564
  let newElement = render;
562
-
563
- // Workaround for https://github.com/facebook/react/issues/32392
565
+ // Workaround for https://github.com/react/react/issues/32392
564
566
  // This works because the toArray() logic unwrap lazy element type in
565
- // https://github.com/facebook/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186
567
+ // https://github.com/react/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186
566
568
  if (newElement?.$$typeof === REACT_LAZY_TYPE) {
567
569
  const children = React.Children.toArray(render);
568
570
  newElement = children[0];