@jobber/components 8.21.1 → 8.23.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 (93) hide show
  1. package/Dialog.d.ts +1 -0
  2. package/Dialog.js +17 -0
  3. package/dist/BottomSheet-cjs.js +34 -7
  4. package/dist/BottomSheet-es.js +34 -8
  5. package/dist/CSPContext-cjs.js +69 -0
  6. package/dist/CSPContext-es.js +46 -0
  7. package/dist/Card/index.cjs +3 -0
  8. package/dist/Card/index.mjs +3 -0
  9. package/dist/ComboboxChipRemove-cjs.js +54 -211
  10. package/dist/ComboboxChipRemove-es.js +8 -164
  11. package/dist/DataDump/index.cjs +3 -0
  12. package/dist/DataDump/index.mjs +3 -0
  13. package/dist/Dialog/Dialog.d.ts +3 -0
  14. package/dist/Dialog/Dialog.types.d.ts +205 -0
  15. package/dist/Dialog/DialogBottomSheet.d.ts +28 -0
  16. package/dist/Dialog/DialogModal.d.ts +20 -0
  17. package/dist/Dialog/constants.d.ts +1 -0
  18. package/dist/Dialog/dialogComposableShared.d.ts +53 -0
  19. package/dist/Dialog/dialogReturnFocus.d.ts +43 -0
  20. package/dist/Dialog/index.cjs +33 -0
  21. package/dist/Dialog/index.d.ts +4 -0
  22. package/dist/Dialog/index.mjs +25 -0
  23. package/dist/DrawerDescription-cjs.js +410 -0
  24. package/dist/DrawerDescription-es.js +383 -0
  25. package/dist/DrawerTitle-cjs.js +116 -0
  26. package/dist/DrawerTitle-es.js +92 -0
  27. package/dist/InputNumberExperimental-cjs.js +24 -23
  28. package/dist/InputNumberExperimental-es.js +3 -2
  29. package/dist/InternalBackdrop-es.js +3 -3
  30. package/dist/Menu/index.cjs +3 -0
  31. package/dist/Menu/index.mjs +3 -0
  32. package/dist/Menu-cjs.js +6 -4
  33. package/dist/Menu-es.js +6 -4
  34. package/dist/MenuSubmenuTrigger-cjs.js +53 -103
  35. package/dist/MenuSubmenuTrigger-es.js +55 -103
  36. package/dist/NumberFieldInput-cjs.js +9 -9
  37. package/dist/NumberFieldInput-es.js +3 -3
  38. package/dist/Page/index.cjs +3 -0
  39. package/dist/Page/index.mjs +3 -0
  40. package/dist/ScrollAreaViewport-cjs.js +921 -960
  41. package/dist/ScrollAreaViewport-es.js +917 -958
  42. package/dist/SelectGroupLabel-cjs.js +1924 -0
  43. package/dist/SelectGroupLabel-es.js +1888 -0
  44. package/dist/SelectPrimitive-cjs.js +112 -0
  45. package/dist/SelectPrimitive-es.js +110 -0
  46. package/dist/ToolbarRootContext-cjs.js +35 -0
  47. package/dist/ToolbarRootContext-es.js +14 -0
  48. package/dist/dialogReturnFocus-cjs.js +427 -0
  49. package/dist/dialogReturnFocus-es.js +423 -0
  50. package/dist/docs/SelectPrimitive/SelectPrimitive.md +326 -0
  51. package/dist/docs/index.md +1 -0
  52. package/dist/floating-ui.react-dom-cjs.js +1 -0
  53. package/dist/floating-ui.react-dom-es.js +2 -2
  54. package/dist/floating-ui.utils.dom-es.js +1 -1
  55. package/dist/index.cjs +15 -7
  56. package/dist/index.d.mts +1 -0
  57. package/dist/index.d.ts +1 -0
  58. package/dist/index.mjs +12 -7
  59. package/dist/primitives/BottomSheet/BottomSheet.d.ts +19 -1
  60. package/dist/primitives/BottomSheet/BottomSheet.types.d.ts +8 -0
  61. package/dist/primitives/BottomSheet/index.cjs +2 -0
  62. package/dist/primitives/BottomSheet/index.d.ts +1 -1
  63. package/dist/primitives/BottomSheet/index.mjs +2 -1
  64. package/dist/primitives/ComboboxPrimitive/index.cjs +3 -1
  65. package/dist/primitives/ComboboxPrimitive/index.mjs +3 -1
  66. package/dist/primitives/InputNumberExperimental/index.cjs +2 -1
  67. package/dist/primitives/InputNumberExperimental/index.mjs +2 -1
  68. package/dist/primitives/SelectPrimitive/SelectPrimitive.d.ts +63 -0
  69. package/dist/primitives/SelectPrimitive/index.cjs +29 -0
  70. package/dist/primitives/SelectPrimitive/index.d.ts +2 -0
  71. package/dist/primitives/SelectPrimitive/index.mjs +23 -0
  72. package/dist/primitives/SelectPrimitive/types.d.ts +16 -0
  73. package/dist/primitives/index.cjs +9 -1
  74. package/dist/primitives/index.d.ts +1 -0
  75. package/dist/primitives/index.mjs +8 -2
  76. package/dist/primitives/mergeClassName.d.ts +12 -0
  77. package/dist/resolveAriaLabelledBy-cjs.js +195 -0
  78. package/dist/resolveAriaLabelledBy-es.js +162 -0
  79. package/dist/styles.css +685 -0
  80. package/dist/unstyledPrimitives/index.cjs +434 -259
  81. package/dist/unstyledPrimitives/index.d.ts +2 -0
  82. package/dist/unstyledPrimitives/index.mjs +425 -252
  83. package/dist/useButton-cjs.js +2 -0
  84. package/dist/useButton-es.js +3 -2
  85. package/dist/useCompositeListItem-es.js +4 -4
  86. package/dist/useLabel-cjs.js +3 -329
  87. package/dist/useLabel-es.js +4 -299
  88. package/dist/useLabelableId-cjs.js +332 -0
  89. package/dist/useLabelableId-es.js +300 -0
  90. package/dist/useRenderElement-cjs.js +3 -0
  91. package/dist/useRenderElement-es.js +4 -1
  92. package/dist/utils/meta/meta.json +11 -1
  93. package/package.json +2 -2
@@ -1,19 +1,26 @@
1
1
  import * as React from 'react';
2
- import { a as useStableCallback, ar as pointer, u as useBaseUiId, d as useIsoLayoutEffect, t as transitionStatusMapping, n as createChangeEventDetails, Q as imperativeAction, o as ownerDocument, m as contains, g as getTarget, b as useTimeout, as as swipe, ac as useAnimationFrame, al as TransitionStatusDataAttributes, a4 as triggerHover, B as useControlled, a6 as itemPress, c as useTransitionStatus, f as useOpenChangeComplete, a8 as useAnimationsFinished, ao as isFirefox, at as scrub, K as createGenericEventDetails, V as isWebKit } from '../useButton-es.js';
3
- import { A as useCoreFilter, B as AriaCombobox, D as stringifyAsLabel, E as useComboboxInputValueContext, l as ComboboxArrow, i as ComboboxBackdrop, x as ComboboxClear, v as ComboboxCollection, w as ComboboxEmpty, n as ComboboxGroup, o as ComboboxGroupLabel, m as ComboboxIcon, c as ComboboxInput, d as ComboboxInputGroup, p as ComboboxItem, f as ComboboxList, k as ComboboxPopup, h as ComboboxPortal, j as ComboboxPositioner, u as ComboboxRow, g as ComboboxStatus, e as ComboboxTrigger, z as useFilteredItems, s as ComboboxChip, t as ComboboxChipRemove, r as ComboboxChips, q as ComboboxItemIndicator, a as ComboboxLabel, C as ComboboxRoot, b as ComboboxValue, y as useComboboxFilter } from '../ComboboxChipRemove-es.js';
2
+ import { b as useStableCallback, as as pointer, a as useIsoLayoutEffect, o as ownerDocument, r as contains, g as getTarget, h as useTimeout, u as useBaseUiId, d as createChangeEventDetails, at as swipe, W as useAnimationFrame, aq as TransitionStatusDataAttributes, E as useControlled, Z as itemPress, k as useTransitionStatus, f as useOpenChangeComplete, ab as useAnimationsFinished, af as isFirefox, au as scrub, N as createGenericEventDetails, X as isWebKit, t as transitionStatusMapping } from '../useButton-es.js';
3
+ import { A as useCoreFilter, B as AriaCombobox, D as useComboboxInputValueContext, l as ComboboxArrow, i as ComboboxBackdrop, x as ComboboxClear, v as ComboboxCollection, w as ComboboxEmpty, n as ComboboxGroup, o as ComboboxGroupLabel, m as ComboboxIcon, c as ComboboxInput, d as ComboboxInputGroup, p as ComboboxItem, f as ComboboxList, k as ComboboxPopup, h as ComboboxPortal, j as ComboboxPositioner, u as ComboboxRow, g as ComboboxStatus, e as ComboboxTrigger, z as useFilteredItems, s as ComboboxChip, t as ComboboxChipRemove, r as ComboboxChips, q as ComboboxItemIndicator, a as ComboboxLabel, C as ComboboxRoot, b as ComboboxValue, y as useComboboxFilter } from '../ComboboxChipRemove-es.js';
4
+ import { i as stringifyAsLabel, k as getDefaultLabelId } from '../resolveAriaLabelledBy-es.js';
4
5
  import { jsx, jsxs } from 'react/jsx-runtime';
5
6
  import { S as Separator } from '../Separator-es.js';
6
- import { u as useDialogRootContext, n as useDrawerProviderContext, o as DrawerBackdropCssVars, q as DrawerPopupCssVars, r as DrawerProviderContext, s as useDialogPortalContext, t as DialogStore, v as useDrawerRootContext, m as useTriggerRegistration, w as DrawerPopupDataAttributes, x as useDrawerSnapPoints, y as DrawerViewportContext, z as DRAWER_CONTENT_ATTRIBUTE, c as DrawerBackdrop, f as DrawerContent, d as DrawerPopup, b as DrawerPortal, a as DrawerRoot, D as DrawerTrigger, A as useScrollAreaRootContext, B as getOffset, E as ScrollAreaRootCssVars, F as scrollAreaStateAttributesMapping, G as useScrollAreaViewportContext, S as ScrollAreaRoot, e as ScrollAreaViewport } from '../ScrollAreaViewport-es.js';
7
- import { a as DrawerClose, D as DrawerTitle, u as useMenuRootContext, o as useMenuPositionerContext, p as useContextMenuRootContext, q as useMenuItem, R as REGULAR_ITEM, r as itemMapping, s as MenuStore, l as MenuGroup, n as MenuGroupLabel, c as MenuItem, b as MenuLinkItem, j as MenuPopup, h as MenuPortal, i as MenuPositioner, k as MenuRadioGroup, d as MenuRadioItem, e as MenuRadioItemIndicator, g as MenuRoot, m as MenuSubmenuRoot, f as MenuSubmenuTrigger, M as MenuTrigger } from '../MenuSubmenuTrigger-es.js';
7
+ import { a as DialogBackdrop, d as DialogDescription, f as DialogHandle, c as DialogPopup, b as DialogViewport, e as createDialogHandle, D as DrawerDescription } from '../DrawerDescription-es.js';
8
+ import { c as DialogClose, b as DialogTitle, a as DrawerClose, D as DrawerTitle } from '../DrawerTitle-es.js';
9
+ import { i as DialogPortal, g as DialogRoot, h as DialogTrigger, t as useDrawerProviderContext, v as DrawerBackdropCssVars, w as DrawerPopupCssVars, x as DrawerProviderContext, u as useDialogRootContext, y as useDrawerRootContext, s as useTriggerRegistration, z as DrawerPopupDataAttributes, A as useDrawerSnapPoints, B as DrawerViewportContext, C as DRAWER_CONTENT_ATTRIBUTE, c as DrawerBackdrop, f as DrawerContent, d as DrawerPopup, b as DrawerPortal, a as DrawerRoot, D as DrawerTrigger, E as useScrollAreaRootContext, F as getOffset, G as ScrollAreaRootCssVars, H as scrollAreaStateAttributesMapping, I as useScrollAreaViewportContext, S as ScrollAreaRoot, e as ScrollAreaViewport } from '../ScrollAreaViewport-es.js';
8
10
  import { u as useRenderElement, m as mergeProps, f as formatErrorMessage, N as NOOP, E as EMPTY_OBJECT } from '../useRenderElement-es.js';
9
- import { a as isHTMLElement, f as getComputedStyle, b as isElement, k as getWindow } from '../floating-ui.utils.dom-es.js';
11
+ import { a as isHTMLElement, f as getComputedStyle, b as isElement, o as getWindow } from '../floating-ui.utils.dom-es.js';
10
12
  import { c as clamp } from '../clamp-es.js';
11
- import { C as CommonPopupDataAttributes, p as popupStateMapping, $ as BASE_UI_SWIPE_IGNORE_SELECTOR, m as useDirection, r as inertValue } from '../InternalBackdrop-es.js';
13
+ import { C as CommonPopupDataAttributes, $ as BASE_UI_SWIPE_IGNORE_SELECTOR, p as popupStateMapping, n as useDirection, A as inertValue, r as useStore, G as triggerOpenStateMapping } from '../InternalBackdrop-es.js';
12
14
  import * as ReactDOM from 'react-dom';
13
- import { u as useCompositeListItem } from '../useCompositeListItem-es.js';
15
+ import { u as useMenuRootContext, o as useMenuPositionerContext, p as useMenuItem, R as REGULAR_ITEM, q as itemMapping, r as MenuStore, h as MenuBackdrop, l as MenuGroup, n as MenuGroupLabel, b as MenuItem, a as MenuLinkItem, j as MenuPopup, g as MenuPortal, i as MenuPositioner, k as MenuRadioGroup, c as MenuRadioItem, d as MenuRadioItemIndicator, f as MenuRoot, m as MenuSubmenuRoot, e as MenuSubmenuTrigger, M as MenuTrigger } from '../MenuSubmenuTrigger-es.js';
16
+ import { e as useCompositeListItem } from '../useCompositeListItem-es.js';
14
17
  import { y as round } from '../index.esm-es.js';
15
18
  import { u as useNumberFieldRootContext, D as DEFAULT_STEP, s as stateAttributesMapping$6, d as NumberFieldDecrement, a as NumberFieldGroup, c as NumberFieldIncrement, b as NumberFieldInput, N as NumberFieldRoot } from '../NumberFieldInput-es.js';
16
- import '../useLabel-es.js';
19
+ import { u as useSelectRootContext, s as selectors, l as useSelectPositionerContext, j as SelectGroup, k as SelectGroupLabel, g as SelectItem, i as SelectItemIndicator, h as SelectItemText, f as SelectList, e as SelectPopup, a as SelectPortal, d as SelectPositioner, S as SelectRoot, b as SelectTrigger, c as SelectValue } from '../SelectGroupLabel-es.js';
20
+ import { b as useFieldRootContext, f as fieldValidityMapping } from '../useLabelableId-es.js';
21
+ import { u as useLabel } from '../useLabel-es.js';
22
+ import '../CSPContext-es.js';
23
+ import '../ToolbarRootContext-es.js';
17
24
  import '../floating-ui.react-dom-es.js';
18
25
 
19
26
  function AutocompleteRoot(props) {
@@ -125,7 +132,7 @@ function AutocompleteValue(props) {
125
132
  });
126
133
  }
127
134
 
128
- var index_parts$5 = /*#__PURE__*/Object.freeze({
135
+ var index_parts$7 = /*#__PURE__*/Object.freeze({
129
136
  __proto__: null,
130
137
  Arrow: ComboboxArrow,
131
138
  Backdrop: ComboboxBackdrop,
@@ -152,40 +159,20 @@ var index_parts$5 = /*#__PURE__*/Object.freeze({
152
159
  useFilteredItems: useFilteredItems
153
160
  });
154
161
 
155
- /**
156
- * A paragraph with additional information about the dialog.
157
- * Renders a `<p>` element.
158
- *
159
- * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
160
- */
161
- const DialogDescription = /*#__PURE__*/React.forwardRef(function DialogDescription(componentProps, forwardedRef) {
162
- const {
163
- render,
164
- className,
165
- id: idProp,
166
- ...elementProps
167
- } = componentProps;
168
- const {
169
- store
170
- } = useDialogRootContext();
171
- const id = useBaseUiId(idProp);
172
- store.useSyncedValueWithCleanup('descriptionElementId', id);
173
- return useRenderElement('p', componentProps, {
174
- ref: forwardedRef,
175
- props: [{
176
- id
177
- }, elementProps]
178
- });
162
+ var index_parts$6 = /*#__PURE__*/Object.freeze({
163
+ __proto__: null,
164
+ Backdrop: DialogBackdrop,
165
+ Close: DialogClose,
166
+ Description: DialogDescription,
167
+ Handle: DialogHandle,
168
+ Popup: DialogPopup,
169
+ Portal: DialogPortal,
170
+ Root: DialogRoot,
171
+ Title: DialogTitle,
172
+ Trigger: DialogTrigger,
173
+ Viewport: DialogViewport,
174
+ createHandle: createDialogHandle
179
175
  });
180
- if (process.env.NODE_ENV !== "production") DialogDescription.displayName = "DialogDescription";
181
-
182
- /**
183
- * A paragraph with additional information about the drawer.
184
- * Renders a `<p>` element.
185
- *
186
- * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
187
- */
188
- const DrawerDescription = DialogDescription;
189
176
 
190
177
  const stateAttributesMapping$5 = {
191
178
  active(value) {
@@ -384,160 +371,6 @@ function createVisualStateStore() {
384
371
  };
385
372
  }
386
373
 
387
- let DialogViewportDataAttributes = function (DialogViewportDataAttributes) {
388
- /**
389
- * Present when the dialog is open.
390
- */
391
- DialogViewportDataAttributes[DialogViewportDataAttributes["open"] = CommonPopupDataAttributes.open] = "open";
392
- /**
393
- * Present when the dialog is closed.
394
- */
395
- DialogViewportDataAttributes[DialogViewportDataAttributes["closed"] = CommonPopupDataAttributes.closed] = "closed";
396
- /**
397
- * Present when the dialog is animating in.
398
- */
399
- DialogViewportDataAttributes[DialogViewportDataAttributes["startingStyle"] = CommonPopupDataAttributes.startingStyle] = "startingStyle";
400
- /**
401
- * Present when the dialog is animating out.
402
- */
403
- DialogViewportDataAttributes[DialogViewportDataAttributes["endingStyle"] = CommonPopupDataAttributes.endingStyle] = "endingStyle";
404
- /**
405
- * Present when the dialog is nested within another dialog.
406
- */
407
- DialogViewportDataAttributes["nested"] = "data-nested";
408
- /**
409
- * Present when the dialog has other open dialogs nested within it.
410
- */
411
- DialogViewportDataAttributes["nestedDialogOpen"] = "data-nested-dialog-open";
412
- return DialogViewportDataAttributes;
413
- }({});
414
-
415
- const stateAttributesMapping$3 = {
416
- ...popupStateMapping,
417
- ...transitionStatusMapping,
418
- nested(value) {
419
- return value ? {
420
- [DialogViewportDataAttributes.nested]: ''
421
- } : null;
422
- },
423
- nestedDialogOpen(value) {
424
- return value ? {
425
- [DialogViewportDataAttributes.nestedDialogOpen]: ''
426
- } : null;
427
- }
428
- };
429
-
430
- /**
431
- * A positioning container for the dialog popup that can be made scrollable.
432
- * Renders a `<div>` element.
433
- *
434
- * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
435
- */
436
- const DialogViewport = /*#__PURE__*/React.forwardRef(function DialogViewport(componentProps, forwardedRef) {
437
- const {
438
- className,
439
- render,
440
- children,
441
- ...elementProps
442
- } = componentProps;
443
- const keepMounted = useDialogPortalContext();
444
- const {
445
- store
446
- } = useDialogRootContext();
447
- const open = store.useState('open');
448
- const nested = store.useState('nested');
449
- const transitionStatus = store.useState('transitionStatus');
450
- const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');
451
- const mounted = store.useState('mounted');
452
- const nestedDialogOpen = nestedOpenDialogCount > 0;
453
- const state = {
454
- open,
455
- nested,
456
- transitionStatus,
457
- nestedDialogOpen
458
- };
459
- const shouldRender = keepMounted || mounted;
460
- return useRenderElement('div', componentProps, {
461
- enabled: shouldRender,
462
- state,
463
- ref: [forwardedRef, store.useStateSetter('viewportElement')],
464
- stateAttributesMapping: stateAttributesMapping$3,
465
- props: [{
466
- role: 'presentation',
467
- hidden: !mounted,
468
- style: {
469
- pointerEvents: !open ? 'none' : undefined
470
- },
471
- children
472
- }, elementProps]
473
- });
474
- });
475
- if (process.env.NODE_ENV !== "production") DialogViewport.displayName = "DialogViewport";
476
-
477
- /**
478
- * A handle to control a Dialog imperatively and to associate detached triggers with it.
479
- */
480
- class DialogHandle {
481
- /**
482
- * Internal store holding the dialog state.
483
- * @internal
484
- */
485
-
486
- constructor(store) {
487
- this.store = store ?? new DialogStore();
488
- }
489
-
490
- /**
491
- * Opens the dialog and associates it with the trigger with the given id.
492
- * The trigger, if provided, must be a Dialog.Trigger component with this handle passed as a prop.
493
- *
494
- * This method should only be called in an event handler or an effect (not during rendering).
495
- *
496
- * @param triggerId ID of the trigger to associate with the dialog. If null, the dialog will open without a trigger association.
497
- */
498
- open(triggerId) {
499
- const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) : undefined;
500
- if (process.env.NODE_ENV !== 'production') {
501
- if (triggerId && !triggerElement) {
502
- console.warn(`Base UI: DialogHandle.open: No trigger found with id "${triggerId}". The dialog will open, but the trigger will not be associated with the dialog.`);
503
- }
504
- }
505
- this.store.setOpen(true, createChangeEventDetails(imperativeAction, undefined, triggerElement));
506
- }
507
-
508
- /**
509
- * Opens the dialog and sets the payload.
510
- * Does not associate the dialog with any trigger.
511
- *
512
- * @param payload Payload to set when opening the dialog.
513
- */
514
- openWithPayload(payload) {
515
- this.store.set('payload', payload);
516
- this.store.setOpen(true, createChangeEventDetails(imperativeAction, undefined, undefined));
517
- }
518
-
519
- /**
520
- * Closes the dialog.
521
- */
522
- close() {
523
- this.store.setOpen(false, createChangeEventDetails(imperativeAction, undefined, undefined));
524
- }
525
-
526
- /**
527
- * Indicates whether the dialog is currently open.
528
- */
529
- get isOpen() {
530
- return this.store.state.open;
531
- }
532
- }
533
-
534
- /**
535
- * Creates a new handle to connect a Dialog.Root with detached Dialog.Trigger components.
536
- */
537
- function createDialogHandle() {
538
- return new DialogHandle();
539
- }
540
-
541
374
  function isScrollable(element, axis) {
542
375
  const style = getComputedStyle(element);
543
376
  if (axis === 'vertical') {
@@ -1550,7 +1383,7 @@ const SWIPE_AREA_SWIPING_HOOK = {
1550
1383
  const SWIPE_AREA_DISABLED_HOOK = {
1551
1384
  [DrawerSwipeAreaDataAttributes.disabled]: ''
1552
1385
  };
1553
- const stateAttributesMapping$2 = {
1386
+ const stateAttributesMapping$3 = {
1554
1387
  open(value) {
1555
1388
  return value ? SWIPE_AREA_OPEN_HOOK : SWIPE_AREA_CLOSED_HOOK;
1556
1389
  },
@@ -1855,7 +1688,7 @@ const DrawerSwipeArea = /*#__PURE__*/React.forwardRef(function DrawerSwipeArea(c
1855
1688
  return useRenderElement('div', componentProps, {
1856
1689
  state,
1857
1690
  ref: [forwardedRef, swipeAreaRef, registerTrigger],
1858
- stateAttributesMapping: stateAttributesMapping$2,
1691
+ stateAttributesMapping: stateAttributesMapping$3,
1859
1692
  props: [{
1860
1693
  role: 'presentation',
1861
1694
  'aria-hidden': true,
@@ -2859,7 +2692,7 @@ function shouldDismissFromStartEdge(direction, axis) {
2859
2692
  return null;
2860
2693
  }
2861
2694
 
2862
- var index_parts$4 = /*#__PURE__*/Object.freeze({
2695
+ var index_parts$5 = /*#__PURE__*/Object.freeze({
2863
2696
  __proto__: null,
2864
2697
  Backdrop: DrawerBackdrop,
2865
2698
  Close: DrawerClose,
@@ -2921,52 +2754,6 @@ const MenuArrow = /*#__PURE__*/React.forwardRef(function MenuArrow(componentProp
2921
2754
  });
2922
2755
  if (process.env.NODE_ENV !== "production") MenuArrow.displayName = "MenuArrow";
2923
2756
 
2924
- const stateAttributesMapping$1 = {
2925
- ...popupStateMapping,
2926
- ...transitionStatusMapping
2927
- };
2928
-
2929
- /**
2930
- * An overlay displayed beneath the menu popup.
2931
- * Renders a `<div>` element.
2932
- *
2933
- * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
2934
- */
2935
- const MenuBackdrop = /*#__PURE__*/React.forwardRef(function MenuBackdrop(componentProps, forwardedRef) {
2936
- const {
2937
- className,
2938
- render,
2939
- ...elementProps
2940
- } = componentProps;
2941
- const {
2942
- store
2943
- } = useMenuRootContext();
2944
- const open = store.useState('open');
2945
- const mounted = store.useState('mounted');
2946
- const transitionStatus = store.useState('transitionStatus');
2947
- const lastOpenChangeReason = store.useState('lastOpenChangeReason');
2948
- const contextMenuContext = useContextMenuRootContext();
2949
- const state = {
2950
- open,
2951
- transitionStatus
2952
- };
2953
- return useRenderElement('div', componentProps, {
2954
- ref: contextMenuContext?.backdropRef ? [forwardedRef, contextMenuContext.backdropRef] : forwardedRef,
2955
- state,
2956
- stateAttributesMapping: stateAttributesMapping$1,
2957
- props: [{
2958
- role: 'presentation',
2959
- hidden: !mounted,
2960
- style: {
2961
- pointerEvents: lastOpenChangeReason === triggerHover ? 'none' : undefined,
2962
- userSelect: 'none',
2963
- WebkitUserSelect: 'none'
2964
- }
2965
- }, elementProps]
2966
- });
2967
- });
2968
- if (process.env.NODE_ENV !== "production") MenuBackdrop.displayName = "MenuBackdrop";
2969
-
2970
2757
  const MenuCheckboxItemContext = /*#__PURE__*/React.createContext(undefined);
2971
2758
  if (process.env.NODE_ENV !== "production") MenuCheckboxItemContext.displayName = "MenuCheckboxItemContext";
2972
2759
  function useMenuCheckboxItemContext() {
@@ -3572,7 +3359,7 @@ let MenuViewportCssVars = /*#__PURE__*/function (MenuViewportCssVars) {
3572
3359
  return MenuViewportCssVars;
3573
3360
  }({});
3574
3361
 
3575
- const stateAttributesMapping = {
3362
+ const stateAttributesMapping$2 = {
3576
3363
  activationDirection: value => value ? {
3577
3364
  'data-activation-direction': value
3578
3365
  } : null
@@ -3620,7 +3407,7 @@ const MenuViewport = /*#__PURE__*/React.forwardRef(function MenuViewport(compone
3620
3407
  props: [elementProps, {
3621
3408
  children: childrenToRender
3622
3409
  }],
3623
- stateAttributesMapping
3410
+ stateAttributesMapping: stateAttributesMapping$2
3624
3411
  });
3625
3412
  });
3626
3413
  if (process.env.NODE_ENV !== "production") MenuViewport.displayName = "MenuViewport";
@@ -3671,7 +3458,7 @@ function createMenuHandle() {
3671
3458
  return new MenuHandle();
3672
3459
  }
3673
3460
 
3674
- var index_parts$3 = /*#__PURE__*/Object.freeze({
3461
+ var index_parts$4 = /*#__PURE__*/Object.freeze({
3675
3462
  __proto__: null,
3676
3463
  Arrow: MenuArrow,
3677
3464
  Backdrop: MenuBackdrop,
@@ -4055,7 +3842,7 @@ const ScrollAreaCorner = /*#__PURE__*/React.forwardRef(function ScrollAreaCorner
4055
3842
  });
4056
3843
  if (process.env.NODE_ENV !== "production") ScrollAreaCorner.displayName = "ScrollAreaCorner";
4057
3844
 
4058
- var index_parts$2 = /*#__PURE__*/Object.freeze({
3845
+ var index_parts$3 = /*#__PURE__*/Object.freeze({
4059
3846
  __proto__: null,
4060
3847
  Content: ScrollAreaContent,
4061
3848
  Corner: ScrollAreaCorner,
@@ -4065,7 +3852,7 @@ var index_parts$2 = /*#__PURE__*/Object.freeze({
4065
3852
  Viewport: ScrollAreaViewport
4066
3853
  });
4067
3854
 
4068
- var index_parts$1 = /*#__PURE__*/Object.freeze({
3855
+ var index_parts$2 = /*#__PURE__*/Object.freeze({
4069
3856
  __proto__: null,
4070
3857
  Arrow: ComboboxArrow,
4071
3858
  Backdrop: ComboboxBackdrop,
@@ -4452,7 +4239,7 @@ const NumberFieldScrubAreaCursor = /*#__PURE__*/React.forwardRef(function Number
4452
4239
  });
4453
4240
  if (process.env.NODE_ENV !== "production") NumberFieldScrubAreaCursor.displayName = "NumberFieldScrubAreaCursor";
4454
4241
 
4455
- var index_parts = /*#__PURE__*/Object.freeze({
4242
+ var index_parts$1 = /*#__PURE__*/Object.freeze({
4456
4243
  __proto__: null,
4457
4244
  Decrement: NumberFieldDecrement,
4458
4245
  Group: NumberFieldGroup,
@@ -4463,6 +4250,392 @@ var index_parts = /*#__PURE__*/Object.freeze({
4463
4250
  ScrubAreaCursor: NumberFieldScrubAreaCursor
4464
4251
  });
4465
4252
 
4253
+ /**
4254
+ * An accessible label that is automatically associated with the select trigger.
4255
+ * Renders a `<div>` element.
4256
+ *
4257
+ * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
4258
+ */
4259
+ const SelectLabel = /*#__PURE__*/React.forwardRef(function SelectLabel(componentProps, forwardedRef) {
4260
+ const {
4261
+ render,
4262
+ className,
4263
+ ...elementProps
4264
+ } = componentProps;
4265
+ // Keep label id derived from the root and ignore runtime `id` overrides from untyped consumers.
4266
+ const elementPropsWithoutId = elementProps;
4267
+ delete elementPropsWithoutId.id;
4268
+ const fieldRootContext = useFieldRootContext();
4269
+ const {
4270
+ store
4271
+ } = useSelectRootContext();
4272
+ const triggerElement = useStore(store, selectors.triggerElement);
4273
+ const rootId = useStore(store, selectors.id);
4274
+ const defaultLabelId = getDefaultLabelId(rootId);
4275
+ const labelProps = useLabel({
4276
+ id: defaultLabelId,
4277
+ fallbackControlId: triggerElement?.id ?? rootId,
4278
+ setLabelId(nextLabelId) {
4279
+ store.set('labelId', nextLabelId);
4280
+ }
4281
+ });
4282
+ return useRenderElement('div', componentProps, {
4283
+ ref: forwardedRef,
4284
+ state: fieldRootContext.state,
4285
+ props: [labelProps, elementProps],
4286
+ stateAttributesMapping: fieldValidityMapping
4287
+ });
4288
+ });
4289
+ if (process.env.NODE_ENV !== "production") SelectLabel.displayName = "SelectLabel";
4290
+
4291
+ /**
4292
+ * An icon that indicates that the trigger button opens a select popup.
4293
+ * Renders a `<span>` element.
4294
+ *
4295
+ * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
4296
+ */
4297
+ const SelectIcon = /*#__PURE__*/React.forwardRef(function SelectIcon(componentProps, forwardedRef) {
4298
+ const {
4299
+ className,
4300
+ render,
4301
+ ...elementProps
4302
+ } = componentProps;
4303
+ const {
4304
+ store
4305
+ } = useSelectRootContext();
4306
+ const open = useStore(store, selectors.open);
4307
+ const state = {
4308
+ open
4309
+ };
4310
+ const element = useRenderElement('span', componentProps, {
4311
+ state,
4312
+ ref: forwardedRef,
4313
+ props: [{
4314
+ 'aria-hidden': true,
4315
+ children: '▼'
4316
+ }, elementProps],
4317
+ stateAttributesMapping: triggerOpenStateMapping
4318
+ });
4319
+ return element;
4320
+ });
4321
+ if (process.env.NODE_ENV !== "production") SelectIcon.displayName = "SelectIcon";
4322
+
4323
+ const stateAttributesMapping$1 = {
4324
+ ...popupStateMapping,
4325
+ ...transitionStatusMapping
4326
+ };
4327
+
4328
+ /**
4329
+ * An overlay displayed beneath the menu popup.
4330
+ * Renders a `<div>` element.
4331
+ *
4332
+ * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
4333
+ */
4334
+ const SelectBackdrop = /*#__PURE__*/React.forwardRef(function SelectBackdrop(componentProps, forwardedRef) {
4335
+ const {
4336
+ className,
4337
+ render,
4338
+ ...elementProps
4339
+ } = componentProps;
4340
+ const {
4341
+ store
4342
+ } = useSelectRootContext();
4343
+ const open = useStore(store, selectors.open);
4344
+ const mounted = useStore(store, selectors.mounted);
4345
+ const transitionStatus = useStore(store, selectors.transitionStatus);
4346
+ const state = {
4347
+ open,
4348
+ transitionStatus
4349
+ };
4350
+ const element = useRenderElement('div', componentProps, {
4351
+ state,
4352
+ ref: forwardedRef,
4353
+ props: [{
4354
+ role: 'presentation',
4355
+ hidden: !mounted,
4356
+ style: {
4357
+ userSelect: 'none',
4358
+ WebkitUserSelect: 'none'
4359
+ }
4360
+ }, elementProps],
4361
+ stateAttributesMapping: stateAttributesMapping$1
4362
+ });
4363
+ return element;
4364
+ });
4365
+ if (process.env.NODE_ENV !== "production") SelectBackdrop.displayName = "SelectBackdrop";
4366
+
4367
+ const stateAttributesMapping = {
4368
+ ...popupStateMapping,
4369
+ ...transitionStatusMapping
4370
+ };
4371
+
4372
+ /**
4373
+ * Displays an element positioned against the select popup anchor.
4374
+ * Renders a `<div>` element.
4375
+ *
4376
+ * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
4377
+ */
4378
+ const SelectArrow = /*#__PURE__*/React.forwardRef(function SelectArrow(componentProps, forwardedRef) {
4379
+ const {
4380
+ className,
4381
+ render,
4382
+ ...elementProps
4383
+ } = componentProps;
4384
+ const {
4385
+ store
4386
+ } = useSelectRootContext();
4387
+ const {
4388
+ side,
4389
+ align,
4390
+ arrowRef,
4391
+ arrowStyles,
4392
+ arrowUncentered,
4393
+ alignItemWithTriggerActive
4394
+ } = useSelectPositionerContext();
4395
+ const open = useStore(store, selectors.open, true);
4396
+ const state = {
4397
+ open,
4398
+ side,
4399
+ align,
4400
+ uncentered: arrowUncentered
4401
+ };
4402
+ const element = useRenderElement('div', componentProps, {
4403
+ state,
4404
+ ref: [arrowRef, forwardedRef],
4405
+ props: [{
4406
+ style: arrowStyles,
4407
+ 'aria-hidden': true
4408
+ }, elementProps],
4409
+ stateAttributesMapping
4410
+ });
4411
+ if (alignItemWithTriggerActive) {
4412
+ return null;
4413
+ }
4414
+ return element;
4415
+ });
4416
+ if (process.env.NODE_ENV !== "production") SelectArrow.displayName = "SelectArrow";
4417
+
4418
+ /**
4419
+ * @internal
4420
+ */
4421
+ const SelectScrollArrow = /*#__PURE__*/React.forwardRef(function SelectScrollArrow(componentProps, forwardedRef) {
4422
+ const {
4423
+ render,
4424
+ className,
4425
+ direction,
4426
+ keepMounted = false,
4427
+ ...elementProps
4428
+ } = componentProps;
4429
+ const {
4430
+ store,
4431
+ popupRef,
4432
+ listRef,
4433
+ handleScrollArrowVisibility,
4434
+ scrollArrowsMountedCountRef
4435
+ } = useSelectRootContext();
4436
+ const {
4437
+ side,
4438
+ scrollDownArrowRef,
4439
+ scrollUpArrowRef
4440
+ } = useSelectPositionerContext();
4441
+ const visibleSelector = direction === 'up' ? selectors.scrollUpArrowVisible : selectors.scrollDownArrowVisible;
4442
+ const stateVisible = useStore(store, visibleSelector);
4443
+ const openMethod = useStore(store, selectors.openMethod);
4444
+
4445
+ // Scroll arrows are disabled for touch modality as they are a hover-only element.
4446
+ const visible = stateVisible && openMethod !== 'touch';
4447
+ const timeout = useTimeout();
4448
+ const scrollArrowRef = direction === 'up' ? scrollUpArrowRef : scrollDownArrowRef;
4449
+ const {
4450
+ transitionStatus,
4451
+ setMounted
4452
+ } = useTransitionStatus(visible);
4453
+ useIsoLayoutEffect(() => {
4454
+ scrollArrowsMountedCountRef.current += 1;
4455
+ if (!store.state.hasScrollArrows) {
4456
+ store.set('hasScrollArrows', true);
4457
+ }
4458
+ return () => {
4459
+ scrollArrowsMountedCountRef.current = Math.max(0, scrollArrowsMountedCountRef.current - 1);
4460
+ if (scrollArrowsMountedCountRef.current === 0 && store.state.hasScrollArrows) {
4461
+ store.set('hasScrollArrows', false);
4462
+ }
4463
+ };
4464
+ }, [store, scrollArrowsMountedCountRef]);
4465
+ useOpenChangeComplete({
4466
+ open: visible,
4467
+ ref: scrollArrowRef,
4468
+ onComplete() {
4469
+ if (!visible) {
4470
+ setMounted(false);
4471
+ }
4472
+ }
4473
+ });
4474
+ const state = {
4475
+ direction,
4476
+ visible,
4477
+ side,
4478
+ transitionStatus
4479
+ };
4480
+ const defaultProps = {
4481
+ 'aria-hidden': true,
4482
+ children: direction === 'up' ? '▲' : '▼',
4483
+ style: {
4484
+ position: 'absolute'
4485
+ },
4486
+ onMouseMove(event) {
4487
+ if (event.movementX === 0 && event.movementY === 0 || timeout.isStarted()) {
4488
+ return;
4489
+ }
4490
+ store.set('activeIndex', null);
4491
+ function scrollNextItem() {
4492
+ const scroller = store.state.listElement ?? popupRef.current;
4493
+ if (!scroller) {
4494
+ return;
4495
+ }
4496
+ store.set('activeIndex', null);
4497
+ handleScrollArrowVisibility();
4498
+ const isScrolledToTop = scroller.scrollTop === 0;
4499
+ const isScrolledToBottom = Math.round(scroller.scrollTop + scroller.clientHeight) >= scroller.scrollHeight;
4500
+ const list = listRef.current;
4501
+
4502
+ // Fallback when there are no items registered yet.
4503
+ if (list.length === 0) {
4504
+ if (direction === 'up') {
4505
+ store.set('scrollUpArrowVisible', !isScrolledToTop);
4506
+ } else {
4507
+ store.set('scrollDownArrowVisible', !isScrolledToBottom);
4508
+ }
4509
+ }
4510
+ if (direction === 'up' && isScrolledToTop || direction === 'down' && isScrolledToBottom) {
4511
+ timeout.clear();
4512
+ return;
4513
+ }
4514
+ if ((store.state.listElement || popupRef.current) && listRef.current && listRef.current.length > 0) {
4515
+ const items = listRef.current;
4516
+ const scrollArrowHeight = scrollArrowRef.current?.offsetHeight || 0;
4517
+ if (direction === 'up') {
4518
+ let firstVisibleIndex = 0;
4519
+ const scrollTop = scroller.scrollTop + scrollArrowHeight;
4520
+ for (let i = 0; i < items.length; i += 1) {
4521
+ const item = items[i];
4522
+ if (item) {
4523
+ const itemTop = item.offsetTop;
4524
+ if (itemTop >= scrollTop) {
4525
+ firstVisibleIndex = i;
4526
+ break;
4527
+ }
4528
+ }
4529
+ }
4530
+ const targetIndex = Math.max(0, firstVisibleIndex - 1);
4531
+ if (targetIndex < firstVisibleIndex) {
4532
+ const targetItem = items[targetIndex];
4533
+ if (targetItem) {
4534
+ scroller.scrollTop = Math.max(0, targetItem.offsetTop - scrollArrowHeight);
4535
+ }
4536
+ } else {
4537
+ // Already at the first item; ensure we reach the absolute top to account for group labels.
4538
+ scroller.scrollTop = 0;
4539
+ }
4540
+ } else {
4541
+ let lastVisibleIndex = items.length - 1;
4542
+ const scrollBottom = scroller.scrollTop + scroller.clientHeight - scrollArrowHeight;
4543
+ for (let i = 0; i < items.length; i += 1) {
4544
+ const item = items[i];
4545
+ if (item) {
4546
+ const itemBottom = item.offsetTop + item.offsetHeight;
4547
+ if (itemBottom > scrollBottom) {
4548
+ lastVisibleIndex = Math.max(0, i - 1);
4549
+ break;
4550
+ }
4551
+ }
4552
+ }
4553
+ const targetIndex = Math.min(items.length - 1, lastVisibleIndex + 1);
4554
+ if (targetIndex > lastVisibleIndex) {
4555
+ const targetItem = items[targetIndex];
4556
+ if (targetItem) {
4557
+ scroller.scrollTop = targetItem.offsetTop + targetItem.offsetHeight - scroller.clientHeight + scrollArrowHeight;
4558
+ }
4559
+ } else {
4560
+ // Already at the last item; ensure we reach the true bottom.
4561
+ scroller.scrollTop = scroller.scrollHeight - scroller.clientHeight;
4562
+ }
4563
+ }
4564
+ }
4565
+ timeout.start(40, scrollNextItem);
4566
+ }
4567
+ timeout.start(40, scrollNextItem);
4568
+ },
4569
+ onMouseLeave() {
4570
+ timeout.clear();
4571
+ }
4572
+ };
4573
+ const element = useRenderElement('div', componentProps, {
4574
+ ref: [forwardedRef, scrollArrowRef],
4575
+ state,
4576
+ props: [defaultProps, elementProps]
4577
+ });
4578
+ const shouldRender = visible || keepMounted;
4579
+ if (!shouldRender) {
4580
+ return null;
4581
+ }
4582
+ return element;
4583
+ });
4584
+ if (process.env.NODE_ENV !== "production") SelectScrollArrow.displayName = "SelectScrollArrow";
4585
+
4586
+ /**
4587
+ * An element that scrolls the select popup down when hovered. Does not render when using touch input.
4588
+ * Renders a `<div>` element.
4589
+ *
4590
+ * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
4591
+ */
4592
+ const SelectScrollDownArrow = /*#__PURE__*/React.forwardRef(function SelectScrollDownArrow(props, forwardedRef) {
4593
+ return /*#__PURE__*/jsx(SelectScrollArrow, {
4594
+ ...props,
4595
+ ref: forwardedRef,
4596
+ direction: "down"
4597
+ });
4598
+ });
4599
+ if (process.env.NODE_ENV !== "production") SelectScrollDownArrow.displayName = "SelectScrollDownArrow";
4600
+
4601
+ /**
4602
+ * An element that scrolls the select popup up when hovered. Does not render when using touch input.
4603
+ * Renders a `<div>` element.
4604
+ *
4605
+ * Documentation: [Base UI Select](https://base-ui.com/react/components/select)
4606
+ */
4607
+ const SelectScrollUpArrow = /*#__PURE__*/React.forwardRef(function SelectScrollUpArrow(props, forwardedRef) {
4608
+ return /*#__PURE__*/jsx(SelectScrollArrow, {
4609
+ ...props,
4610
+ ref: forwardedRef,
4611
+ direction: "up"
4612
+ });
4613
+ });
4614
+ if (process.env.NODE_ENV !== "production") SelectScrollUpArrow.displayName = "SelectScrollUpArrow";
4615
+
4616
+ var index_parts = /*#__PURE__*/Object.freeze({
4617
+ __proto__: null,
4618
+ Arrow: SelectArrow,
4619
+ Backdrop: SelectBackdrop,
4620
+ Group: SelectGroup,
4621
+ GroupLabel: SelectGroupLabel,
4622
+ Icon: SelectIcon,
4623
+ Item: SelectItem,
4624
+ ItemIndicator: SelectItemIndicator,
4625
+ ItemText: SelectItemText,
4626
+ Label: SelectLabel,
4627
+ List: SelectList,
4628
+ Popup: SelectPopup,
4629
+ Portal: SelectPortal,
4630
+ Positioner: SelectPositioner,
4631
+ Root: SelectRoot,
4632
+ ScrollDownArrow: SelectScrollDownArrow,
4633
+ ScrollUpArrow: SelectScrollUpArrow,
4634
+ Separator: Separator,
4635
+ Trigger: SelectTrigger,
4636
+ Value: SelectValue
4637
+ });
4638
+
4466
4639
  /**
4467
4640
  * Renders a Base UI element.
4468
4641
  *
@@ -4472,4 +4645,4 @@ function useRender(params) {
4472
4645
  return useRenderElement(params.defaultTagName ?? 'div', params, params);
4473
4646
  }
4474
4647
 
4475
- export { index_parts$5 as Autocomplete, index_parts$1 as Combobox, index_parts$4 as Drawer, index_parts$3 as Menu, index_parts as NumberField, index_parts$2 as ScrollArea, Separator, useRender };
4648
+ export { index_parts$7 as Autocomplete, index_parts$2 as Combobox, index_parts$6 as Dialog, index_parts$5 as Drawer, index_parts$4 as Menu, index_parts$1 as NumberField, index_parts$3 as ScrollArea, index_parts as Select, Separator, useRender };