@jobber/components 8.26.3 → 8.27.1

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 (65) hide show
  1. package/Select.d.ts +1 -0
  2. package/Select.js +17 -0
  3. package/dist/BottomSheet-cjs.js +8 -7
  4. package/dist/BottomSheet-es.js +9 -8
  5. package/dist/ComboboxChipRemove-cjs.js +2 -1
  6. package/dist/ComboboxChipRemove-es.js +4 -3
  7. package/dist/DrawerDescription-cjs.js +4 -97
  8. package/dist/DrawerDescription-es.js +6 -98
  9. package/dist/FieldDescription-cjs.js +880 -0
  10. package/dist/FieldDescription-es.js +856 -0
  11. package/dist/InputNumberExperimental-cjs.js +5 -875
  12. package/dist/InputNumberExperimental-es.js +2 -854
  13. package/dist/MenuSubmenuTrigger-es.js +4 -4
  14. package/dist/Modal/index.cjs +12 -2
  15. package/dist/Modal/index.mjs +13 -3
  16. package/dist/NumberFieldInput-cjs.js +2 -2
  17. package/dist/NumberFieldInput-es.js +1 -1
  18. package/dist/ScrollAreaViewport-cjs.js +2122 -12
  19. package/dist/ScrollAreaViewport-es.js +2118 -13
  20. package/dist/Select/Select.d.ts +31 -0
  21. package/dist/Select/Select.types.d.ts +145 -0
  22. package/dist/Select/SelectBottomSheet.d.ts +4 -0
  23. package/dist/Select/SelectDropdown.d.ts +4 -0
  24. package/dist/Select/index.cjs +41 -0
  25. package/dist/Select/index.d.ts +2 -0
  26. package/dist/Select/index.mjs +35 -0
  27. package/dist/Select-cjs.js +231 -0
  28. package/dist/Select-es.js +229 -0
  29. package/dist/SelectPrimitive-cjs.js +20 -3
  30. package/dist/SelectPrimitive-es.js +20 -3
  31. package/dist/dialogReturnFocus-cjs.js +8 -5
  32. package/dist/dialogReturnFocus-es.js +9 -6
  33. package/dist/docs/Dialog/Dialog.md +74 -21
  34. package/dist/docs/Select/Select.md +428 -0
  35. package/dist/docs/SelectPrimitive/SelectPrimitive.md +14 -1
  36. package/dist/docs/index.md +1 -0
  37. package/dist/floating-ui.react-dom-es.js +1 -1
  38. package/dist/floating-ui.react-es.js +1 -1
  39. package/dist/floating-ui.utils.dom-es.js +1 -1
  40. package/dist/index.cjs +9 -0
  41. package/dist/index.d.mts +1 -0
  42. package/dist/index.d.ts +1 -0
  43. package/dist/index.mjs +8 -0
  44. package/dist/primitives/ComboboxPrimitive/index.cjs +1 -0
  45. package/dist/primitives/ComboboxPrimitive/index.mjs +1 -0
  46. package/dist/primitives/HelperText/HelperText.d.ts +2 -1
  47. package/dist/primitives/InputNumberExperimental/index.cjs +3 -1
  48. package/dist/primitives/InputNumberExperimental/index.mjs +3 -1
  49. package/dist/primitives/SelectPrimitive/SelectPrimitive.d.ts +11 -0
  50. package/dist/primitives/SelectPrimitive/index.d.ts +1 -1
  51. package/dist/primitives/SelectPrimitive/types.d.ts +15 -0
  52. package/dist/primitives/index.cjs +2 -0
  53. package/dist/primitives/index.mjs +2 -0
  54. package/dist/stringifyLocale-cjs.js +13 -0
  55. package/dist/stringifyLocale-es.js +11 -0
  56. package/dist/styles.css +300 -10
  57. package/dist/unstyledPrimitives/index.cjs +219 -2230
  58. package/dist/unstyledPrimitives/index.mjs +225 -2236
  59. package/dist/useButton-es.js +2 -2
  60. package/dist/useCompositeListItem-es.js +1 -1
  61. package/dist/useLabel-cjs.js +0 -11
  62. package/dist/useLabel-es.js +2 -12
  63. package/dist/useScrollLock-es.js +3 -3
  64. package/dist/utils/meta/meta.json +5 -0
  65. package/package.json +7 -2
@@ -1,13 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { a as useRefWithInit, f as formatErrorMessage, u as useRenderElement, m as mergeProps, c as useMergedRefs, E as EMPTY_OBJECT, b as EMPTY_ARRAY, w as warn } from './useRenderElement-es.js';
3
- import { X as mergeCleanups, Y as isTypeableElement, Z as matchesFocusVisible, _ as isTargetInsideEnabledTrigger, $ as createAttribute, J as webkit, d as useFloatingTree, u as useFloatingParentNodeId, a0 as isInteractiveElement, a1 as getNodeChildren, p as popupStateMapping, a as FloatingFocusManager, E as FloatingPortal, a2 as POPUP_COLLISION_AVOIDANCE, I as InternalBackdrop, G as inertValue, a3 as FloatingNode, H as DROPDOWN_COLLISION_AVOIDANCE, t as createSelector, R as ReactStore, P as PopupTriggerMap, a4 as FloatingTreeStore, a5 as fastComponent, a6 as useInitialOpenSync, a7 as useFloatingNodeId, v as useOpenInteractionType, L as useImplicitActiveTrigger, M as useOpenStateTransitions, a8 as attachPreventUnmountOnClose, O as setPopupOpenState, a9 as useSyncedFloatingRootContext, y as useDismiss, r as useDirection, aa as TYPEAHEAD_RESET_MS, F as FOCUSABLE_POPUP_PROPS, N as usePopupInteractionProps, ab as FloatingTree, ac as getTabbableBeforeElement, ad as isOutsideEvent, ae as getTabbableAfterElement, af as getNextTabbable, ag as fastComponentRef, T as useTriggerDataForwarding, x as useClick, B as pressableTriggerOpenStateMapping, ah as FocusGuard, ai as PATIENT_CLICK_THRESHOLD, aj as useTriggerRegistration, W as triggerOpenStateMapping } from './useScrollLock-es.js';
4
- import { Y as isMouseLikePointerType, h as useTimeout, B as addEventListener, g as getTarget, d as createChangeEventDetails, Z as triggerFocus, p as activeElement, o as ownerDocument, q as contains, _ as mac, $ as triggerPress, a0 as escapeKey, L as useOnMount, T as Timeout, b as useStableCallback, a as useIsoLayoutEffect, a1 as triggerHover, m as useValueAsRef, t as transitionStatusMapping, V as itemPress, c as useButton, u as useBaseUiId, f as useOpenChangeComplete, Q as outsidePress, a2 as useAnimationsFinished, a3 as siblingOpen, z as useControlled, k as useTransitionStatus, l as useId, v as focusOut, r as listNavigation, i as imperativeAction, a4 as useCompositeRootContext, R as cancelOpen, S as SafeReact } from './useButton-es.js';
3
+ import { K as mergeCleanups, L as isTypeableElement, M as matchesFocusVisible, N as isTargetInsideEnabledTrigger, O as createAttribute, J as webkit, d as useFloatingTree, u as useFloatingParentNodeId, Q as isInteractiveElement, R as getNodeChildren, p as popupStateMapping, a as FloatingFocusManager, E as FloatingPortal, T as POPUP_COLLISION_AVOIDANCE, I as InternalBackdrop, G as inertValue, U as FloatingNode, H as DROPDOWN_COLLISION_AVOIDANCE, t as createSelector, V as ReactStore, P as PopupTriggerMap, W as FloatingTreeStore, X as fastComponent, Y as useInitialOpenSync, Z as useFloatingNodeId, v as useOpenInteractionType, _ as useImplicitActiveTrigger, $ as useOpenStateTransitions, a0 as attachPreventUnmountOnClose, a1 as setPopupOpenState, a2 as useSyncedFloatingRootContext, y as useDismiss, r as useDirection, a3 as TYPEAHEAD_RESET_MS, F as FOCUSABLE_POPUP_PROPS, a4 as usePopupInteractionProps, a5 as FloatingTree, a6 as getTabbableBeforeElement, a7 as isOutsideEvent, a8 as getTabbableAfterElement, a9 as getNextTabbable, aa as fastComponentRef, ab as useTriggerDataForwarding, x as useClick, B as pressableTriggerOpenStateMapping, ac as FocusGuard, ad as PATIENT_CLICK_THRESHOLD, ae as useTriggerRegistration, af as triggerOpenStateMapping } from './useScrollLock-es.js';
4
+ import { W as isMouseLikePointerType, h as useTimeout, B as addEventListener, g as getTarget, d as createChangeEventDetails, X as triggerFocus, p as activeElement, o as ownerDocument, q as contains, Y as mac, Z as triggerPress, _ as escapeKey, L as useOnMount, T as Timeout, b as useStableCallback, a as useIsoLayoutEffect, $ as triggerHover, m as useValueAsRef, t as transitionStatusMapping, V as itemPress, c as useButton, u as useBaseUiId, f as useOpenChangeComplete, Q as outsidePress, a0 as useAnimationsFinished, a1 as siblingOpen, z as useControlled, k as useTransitionStatus, l as useId, v as focusOut, r as listNavigation, i as imperativeAction, a2 as useCompositeRootContext, R as cancelOpen, S as SafeReact } from './useButton-es.js';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
6
6
  import { h as useCompositeListItem, f as getDisabledMountTransitionStyles, d as useAnchorPositioning, i as adaptiveOrigin, c as useAnchoredPopupScrollLock, e as usePositioner, C as CompositeList, a as useListNavigation, b as useTypeahead, g as getPseudoElementBounds } from './useCompositeListItem-es.js';
7
7
  import { u as useToolbarRootContext, i as isElementDisabled } from './isElementDisabled-es.js';
8
8
  import { C as COMPOSITE_KEYS } from './scrollEdges-es.js';
9
- import { o as getWindow, b as isElement, a as isHTMLElement, d as isLastTraversableNode, e as getParentNode } from './floating-ui.utils.dom-es.js';
10
- import { p as popupStoreSelectors, l as createInitialPopupStoreState } from './ScrollAreaViewport-es.js';
9
+ import { o as getWindow, b as isElement, i as isHTMLElement, d as isLastTraversableNode, e as getParentNode } from './floating-ui.utils.dom-es.js';
10
+ import { p as popupStoreSelectors, n as createInitialPopupStoreState } from './ScrollAreaViewport-es.js';
11
11
  import * as ReactDOM from 'react-dom';
12
12
 
13
13
  function resolveValue(value, pointerType) {
@@ -42,8 +42,7 @@ function ModalLegacy({ open = false, title, size, dismissible = true, children,
42
42
  const containerClassName = classnames(styles$1.container, size === "fullScreen" && styles$1.containerFullScreen);
43
43
  jobberHooks.useRefocusOnActivator(open);
44
44
  const modalRef = jobberHooks.useFocusTrap(open);
45
- jobberHooks.useOnKeyDown(handleRequestClose, "Escape");
46
- const template = (React.createElement(framerMotion.AnimatePresence, null, open && (React.createElement("div", { ref: modalRef, role: "dialog", className: containerClassName, tabIndex: 0, "aria-modal": "true", "aria-labelledby": title ? MODAL_HEADER_ID : undefined, "aria-label": ariaLabel },
45
+ const template = (React.createElement(framerMotion.AnimatePresence, null, open && (React.createElement("div", { ref: modalRef, role: "dialog", className: containerClassName, tabIndex: 0, "aria-modal": "true", "aria-labelledby": title ? MODAL_HEADER_ID : undefined, "aria-label": ariaLabel, onKeyDown: handleKeyDown },
47
46
  React.createElement(framerMotion.motion.div, { key: styles$1.overlay, className: styles$1.overlay, onClick: onRequestClose, initial: { opacity: 0 }, animate: { opacity: 0.8 }, exit: { opacity: 0 }, transition: { duration: 0.2 } }),
48
47
  React.createElement(framerMotion.motion.div, { key: styles$1.modal, className: modalClassName, initial: { scale: 0.9, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.9, opacity: 0 }, transition: {
49
48
  duration: 0.2,
@@ -60,6 +59,17 @@ function ModalLegacy({ open = false, title, size, dismissible = true, children,
60
59
  onRequestClose();
61
60
  }
62
61
  }
62
+ function handleKeyDown(event) {
63
+ if (event.key === "Escape") {
64
+ // Stop the Escape from bubbling to outer overlays (e.g. a Base UI Dialog
65
+ // this Modal is nested within, whose dismissal listens at the document
66
+ // level). Without this, one Escape closes both layers; instead only the
67
+ // top-most layer — this Modal — should close. Mirrors SideDrawer's
68
+ // Escape containment.
69
+ event.stopPropagation();
70
+ handleRequestClose();
71
+ }
72
+ }
63
73
  }
64
74
  function Header({ title, dismissible, onRequestClose }) {
65
75
  return (React.createElement("div", { className: styles$1.header, "data-testid": "modal-header" },
@@ -2,7 +2,7 @@ import React__default, { useRef, useEffect, createContext, useContext } from 're
2
2
  import ReactDOM__default from 'react-dom';
3
3
  import classnames from 'classnames';
4
4
  import { AnimatePresence, motion } from 'framer-motion';
5
- import { useRefocusOnActivator, useFocusTrap, useOnKeyDown } from '@jobber/hooks';
5
+ import { useRefocusOnActivator, useFocusTrap } from '@jobber/hooks';
6
6
  import { H as Heading } from '../Heading-es.js';
7
7
  import { B as Button } from '../Button-es.js';
8
8
  import { B as ButtonDismiss } from '../ButtonDismiss-es.js';
@@ -40,8 +40,7 @@ function ModalLegacy({ open = false, title, size, dismissible = true, children,
40
40
  const containerClassName = classnames(styles$1.container, size === "fullScreen" && styles$1.containerFullScreen);
41
41
  useRefocusOnActivator(open);
42
42
  const modalRef = useFocusTrap(open);
43
- useOnKeyDown(handleRequestClose, "Escape");
44
- const template = (React__default.createElement(AnimatePresence, null, open && (React__default.createElement("div", { ref: modalRef, role: "dialog", className: containerClassName, tabIndex: 0, "aria-modal": "true", "aria-labelledby": title ? MODAL_HEADER_ID : undefined, "aria-label": ariaLabel },
43
+ const template = (React__default.createElement(AnimatePresence, null, open && (React__default.createElement("div", { ref: modalRef, role: "dialog", className: containerClassName, tabIndex: 0, "aria-modal": "true", "aria-labelledby": title ? MODAL_HEADER_ID : undefined, "aria-label": ariaLabel, onKeyDown: handleKeyDown },
45
44
  React__default.createElement(motion.div, { key: styles$1.overlay, className: styles$1.overlay, onClick: onRequestClose, initial: { opacity: 0 }, animate: { opacity: 0.8 }, exit: { opacity: 0 }, transition: { duration: 0.2 } }),
46
45
  React__default.createElement(motion.div, { key: styles$1.modal, className: modalClassName, initial: { scale: 0.9, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.9, opacity: 0 }, transition: {
47
46
  duration: 0.2,
@@ -58,6 +57,17 @@ function ModalLegacy({ open = false, title, size, dismissible = true, children,
58
57
  onRequestClose();
59
58
  }
60
59
  }
60
+ function handleKeyDown(event) {
61
+ if (event.key === "Escape") {
62
+ // Stop the Escape from bubbling to outer overlays (e.g. a Base UI Dialog
63
+ // this Modal is nested within, whose dismissal listens at the document
64
+ // level). Without this, one Escape closes both layers; instead only the
65
+ // top-most layer — this Modal — should close. Mirrors SideDrawer's
66
+ // Escape containment.
67
+ event.stopPropagation();
68
+ handleRequestClose();
69
+ }
70
+ }
61
71
  }
62
72
  function Header({ title, dismissible, onRequestClose }) {
63
73
  return (React__default.createElement("div", { className: styles$1.header, "data-testid": "modal-header" },
@@ -6,7 +6,7 @@ var useRenderElement = require('./useRenderElement-cjs.js');
6
6
  var useLabelableId = require('./useLabelableId-cjs.js');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  var floatingUi_utils_dom = require('./floating-ui.utils.dom-cjs.js');
9
- var useLabel = require('./useLabel-cjs.js');
9
+ var stringifyLocale = require('./stringifyLocale-cjs.js');
10
10
  var clamp = require('./clamp-cjs.js');
11
11
 
12
12
  function _interopNamespaceDefault(e) {
@@ -41,7 +41,7 @@ function useForcedRerendering() {
41
41
  const cache = new Map();
42
42
  function getFormatter(locale, options) {
43
43
  const optionsString = JSON.stringify({
44
- locale: useLabel.stringifyLocale(locale),
44
+ locale: stringifyLocale.stringifyLocale(locale),
45
45
  options
46
46
  });
47
47
  const cachedFormatter = cache.get(optionsString);
@@ -4,7 +4,7 @@ import { f as formatErrorMessage, c as useMergedRefs, u as useRenderElement, a a
4
4
  import { f as fieldValidityMapping, b as useFieldRootContext, a as useFormContext, c as useLabelableId, u as useLabelableContext, d as useRegisterFieldControl } from './useLabelableId-es.js';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
  import { o as getWindow } from './floating-ui.utils.dom-es.js';
7
- import { s as stringifyLocale } from './useLabel-es.js';
7
+ import { s as stringifyLocale } from './stringifyLocale-es.js';
8
8
  import { c as clamp } from './clamp-es.js';
9
9
 
10
10
  /**