@jobber/components 8.22.0 → 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 (72) hide show
  1. package/dist/CSPContext-cjs.js +69 -0
  2. package/dist/CSPContext-es.js +46 -0
  3. package/dist/Card/index.cjs +2 -0
  4. package/dist/Card/index.mjs +2 -0
  5. package/dist/ComboboxChipRemove-cjs.js +54 -211
  6. package/dist/ComboboxChipRemove-es.js +8 -164
  7. package/dist/DataDump/index.cjs +2 -0
  8. package/dist/DataDump/index.mjs +2 -0
  9. package/dist/Dialog/index.cjs +1 -0
  10. package/dist/Dialog/index.mjs +1 -0
  11. package/dist/DrawerDescription-cjs.js +2 -1
  12. package/dist/DrawerDescription-es.js +3 -2
  13. package/dist/DrawerTitle-es.js +1 -1
  14. package/dist/InputNumberExperimental-cjs.js +24 -23
  15. package/dist/InputNumberExperimental-es.js +3 -2
  16. package/dist/InternalBackdrop-es.js +3 -3
  17. package/dist/Menu/index.cjs +2 -0
  18. package/dist/Menu/index.mjs +2 -0
  19. package/dist/Menu-cjs.js +1 -1
  20. package/dist/Menu-es.js +1 -1
  21. package/dist/MenuSubmenuTrigger-cjs.js +5 -13
  22. package/dist/MenuSubmenuTrigger-es.js +8 -16
  23. package/dist/NumberFieldInput-cjs.js +9 -9
  24. package/dist/NumberFieldInput-es.js +3 -3
  25. package/dist/Page/index.cjs +2 -0
  26. package/dist/Page/index.mjs +2 -0
  27. package/dist/ScrollAreaViewport-cjs.js +5 -47
  28. package/dist/ScrollAreaViewport-es.js +5 -46
  29. package/dist/SelectGroupLabel-cjs.js +1924 -0
  30. package/dist/SelectGroupLabel-es.js +1888 -0
  31. package/dist/SelectPrimitive-cjs.js +112 -0
  32. package/dist/SelectPrimitive-es.js +110 -0
  33. package/dist/ToolbarRootContext-cjs.js +35 -0
  34. package/dist/ToolbarRootContext-es.js +14 -0
  35. package/dist/docs/SelectPrimitive/SelectPrimitive.md +326 -0
  36. package/dist/docs/index.md +1 -0
  37. package/dist/floating-ui.react-dom-cjs.js +1 -0
  38. package/dist/floating-ui.react-dom-es.js +2 -2
  39. package/dist/floating-ui.utils.dom-es.js +1 -1
  40. package/dist/index.cjs +2 -0
  41. package/dist/index.mjs +2 -0
  42. package/dist/primitives/BottomSheet/index.cjs +1 -0
  43. package/dist/primitives/BottomSheet/index.mjs +1 -0
  44. package/dist/primitives/ComboboxPrimitive/index.cjs +3 -1
  45. package/dist/primitives/ComboboxPrimitive/index.mjs +3 -1
  46. package/dist/primitives/InputNumberExperimental/index.cjs +2 -1
  47. package/dist/primitives/InputNumberExperimental/index.mjs +2 -1
  48. package/dist/primitives/SelectPrimitive/SelectPrimitive.d.ts +63 -0
  49. package/dist/primitives/SelectPrimitive/index.cjs +29 -0
  50. package/dist/primitives/SelectPrimitive/index.d.ts +2 -0
  51. package/dist/primitives/SelectPrimitive/index.mjs +23 -0
  52. package/dist/primitives/SelectPrimitive/types.d.ts +16 -0
  53. package/dist/primitives/index.cjs +8 -1
  54. package/dist/primitives/index.d.ts +1 -0
  55. package/dist/primitives/index.mjs +7 -1
  56. package/dist/primitives/mergeClassName.d.ts +12 -0
  57. package/dist/resolveAriaLabelledBy-cjs.js +195 -0
  58. package/dist/resolveAriaLabelledBy-es.js +162 -0
  59. package/dist/styles.css +325 -0
  60. package/dist/unstyledPrimitives/index.cjs +416 -24
  61. package/dist/unstyledPrimitives/index.d.ts +1 -0
  62. package/dist/unstyledPrimitives/index.mjs +417 -26
  63. package/dist/useButton-cjs.js +2 -0
  64. package/dist/useButton-es.js +3 -2
  65. package/dist/useCompositeListItem-es.js +3 -3
  66. package/dist/useLabel-cjs.js +3 -329
  67. package/dist/useLabel-es.js +4 -299
  68. package/dist/useLabelableId-cjs.js +332 -0
  69. package/dist/useLabelableId-es.js +300 -0
  70. package/dist/useRenderElement-cjs.js +3 -0
  71. package/dist/useRenderElement-es.js +4 -1
  72. package/package.json +2 -2
@@ -1,21 +1,26 @@
1
1
  import * as React from 'react';
2
- import { e as useStableCallback, a9 as pointer, j as useIsoLayoutEffect, o as ownerDocument, r as contains, k as getTarget, f as useTimeout, b as useBaseUiId, c as createChangeEventDetails, aa as swipe, ab as useAnimationFrame, ac as TransitionStatusDataAttributes, E as useControlled, a3 as itemPress, h as useTransitionStatus, d as useOpenChangeComplete, a5 as useAnimationsFinished, ad as isFirefox, ae as scrub, N as createGenericEventDetails, af 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
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';
7
8
  import { c as DialogClose, b as DialogTitle, a as DrawerClose, D as DrawerTitle } from '../DrawerTitle-es.js';
8
- 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, E as DRAWER_CONTENT_ATTRIBUTE, c as DrawerBackdrop, f as DrawerContent, d as DrawerPopup, b as DrawerPortal, a as DrawerRoot, D as DrawerTrigger, F as useScrollAreaRootContext, G as getOffset, H as ScrollAreaRootCssVars, I as scrollAreaStateAttributesMapping, J as useScrollAreaViewportContext, S as ScrollAreaRoot, e as ScrollAreaViewport } from '../ScrollAreaViewport-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';
9
10
  import { u as useRenderElement, m as mergeProps, f as formatErrorMessage, N as NOOP, E as EMPTY_OBJECT } from '../useRenderElement-es.js';
10
- 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';
11
12
  import { c as clamp } from '../clamp-es.js';
12
- import { C as CommonPopupDataAttributes, Y as BASE_UI_SWIPE_IGNORE_SELECTOR, p as popupStateMapping, n as useDirection, t 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';
13
14
  import * as ReactDOM from 'react-dom';
14
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';
15
- import { u as useCompositeListItem } from '../useCompositeListItem-es.js';
16
+ import { e as useCompositeListItem } from '../useCompositeListItem-es.js';
16
17
  import { y as round } from '../index.esm-es.js';
17
- import { u as useNumberFieldRootContext, D as DEFAULT_STEP, s as stateAttributesMapping$4, d as NumberFieldDecrement, a as NumberFieldGroup, c as NumberFieldIncrement, b as NumberFieldInput, N as NumberFieldRoot } from '../NumberFieldInput-es.js';
18
- import '../useLabel-es.js';
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';
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';
19
24
  import '../floating-ui.react-dom-es.js';
20
25
 
21
26
  function AutocompleteRoot(props) {
@@ -127,7 +132,7 @@ function AutocompleteValue(props) {
127
132
  });
128
133
  }
129
134
 
130
- var index_parts$6 = /*#__PURE__*/Object.freeze({
135
+ var index_parts$7 = /*#__PURE__*/Object.freeze({
131
136
  __proto__: null,
132
137
  Arrow: ComboboxArrow,
133
138
  Backdrop: ComboboxBackdrop,
@@ -154,7 +159,7 @@ var index_parts$6 = /*#__PURE__*/Object.freeze({
154
159
  useFilteredItems: useFilteredItems
155
160
  });
156
161
 
157
- var index_parts$5 = /*#__PURE__*/Object.freeze({
162
+ var index_parts$6 = /*#__PURE__*/Object.freeze({
158
163
  __proto__: null,
159
164
  Backdrop: DialogBackdrop,
160
165
  Close: DialogClose,
@@ -169,7 +174,7 @@ var index_parts$5 = /*#__PURE__*/Object.freeze({
169
174
  createHandle: createDialogHandle
170
175
  });
171
176
 
172
- const stateAttributesMapping$3 = {
177
+ const stateAttributesMapping$5 = {
173
178
  active(value) {
174
179
  if (value) {
175
180
  return {
@@ -239,12 +244,12 @@ const DrawerIndent = /*#__PURE__*/React.forwardRef(function DrawerIndent(compone
239
244
  [DrawerBackdropCssVars.swipeProgress]: '0'
240
245
  }
241
246
  }, elementProps],
242
- stateAttributesMapping: stateAttributesMapping$3
247
+ stateAttributesMapping: stateAttributesMapping$5
243
248
  });
244
249
  });
245
250
  if (process.env.NODE_ENV !== "production") DrawerIndent.displayName = "DrawerIndent";
246
251
 
247
- const stateAttributesMapping$2 = {
252
+ const stateAttributesMapping$4 = {
248
253
  active(value) {
249
254
  if (value) {
250
255
  return {
@@ -278,7 +283,7 @@ const DrawerIndentBackground = /*#__PURE__*/React.forwardRef(function DrawerInde
278
283
  ref: forwardedRef,
279
284
  state,
280
285
  props: elementProps,
281
- stateAttributesMapping: stateAttributesMapping$2
286
+ stateAttributesMapping: stateAttributesMapping$4
282
287
  });
283
288
  });
284
289
  if (process.env.NODE_ENV !== "production") DrawerIndentBackground.displayName = "DrawerIndentBackground";
@@ -1378,7 +1383,7 @@ const SWIPE_AREA_SWIPING_HOOK = {
1378
1383
  const SWIPE_AREA_DISABLED_HOOK = {
1379
1384
  [DrawerSwipeAreaDataAttributes.disabled]: ''
1380
1385
  };
1381
- const stateAttributesMapping$1 = {
1386
+ const stateAttributesMapping$3 = {
1382
1387
  open(value) {
1383
1388
  return value ? SWIPE_AREA_OPEN_HOOK : SWIPE_AREA_CLOSED_HOOK;
1384
1389
  },
@@ -1683,7 +1688,7 @@ const DrawerSwipeArea = /*#__PURE__*/React.forwardRef(function DrawerSwipeArea(c
1683
1688
  return useRenderElement('div', componentProps, {
1684
1689
  state,
1685
1690
  ref: [forwardedRef, swipeAreaRef, registerTrigger],
1686
- stateAttributesMapping: stateAttributesMapping$1,
1691
+ stateAttributesMapping: stateAttributesMapping$3,
1687
1692
  props: [{
1688
1693
  role: 'presentation',
1689
1694
  'aria-hidden': true,
@@ -2687,7 +2692,7 @@ function shouldDismissFromStartEdge(direction, axis) {
2687
2692
  return null;
2688
2693
  }
2689
2694
 
2690
- var index_parts$4 = /*#__PURE__*/Object.freeze({
2695
+ var index_parts$5 = /*#__PURE__*/Object.freeze({
2691
2696
  __proto__: null,
2692
2697
  Backdrop: DrawerBackdrop,
2693
2698
  Close: DrawerClose,
@@ -3354,7 +3359,7 @@ let MenuViewportCssVars = /*#__PURE__*/function (MenuViewportCssVars) {
3354
3359
  return MenuViewportCssVars;
3355
3360
  }({});
3356
3361
 
3357
- const stateAttributesMapping = {
3362
+ const stateAttributesMapping$2 = {
3358
3363
  activationDirection: value => value ? {
3359
3364
  'data-activation-direction': value
3360
3365
  } : null
@@ -3402,7 +3407,7 @@ const MenuViewport = /*#__PURE__*/React.forwardRef(function MenuViewport(compone
3402
3407
  props: [elementProps, {
3403
3408
  children: childrenToRender
3404
3409
  }],
3405
- stateAttributesMapping
3410
+ stateAttributesMapping: stateAttributesMapping$2
3406
3411
  });
3407
3412
  });
3408
3413
  if (process.env.NODE_ENV !== "production") MenuViewport.displayName = "MenuViewport";
@@ -3453,7 +3458,7 @@ function createMenuHandle() {
3453
3458
  return new MenuHandle();
3454
3459
  }
3455
3460
 
3456
- var index_parts$3 = /*#__PURE__*/Object.freeze({
3461
+ var index_parts$4 = /*#__PURE__*/Object.freeze({
3457
3462
  __proto__: null,
3458
3463
  Arrow: MenuArrow,
3459
3464
  Backdrop: MenuBackdrop,
@@ -3837,7 +3842,7 @@ const ScrollAreaCorner = /*#__PURE__*/React.forwardRef(function ScrollAreaCorner
3837
3842
  });
3838
3843
  if (process.env.NODE_ENV !== "production") ScrollAreaCorner.displayName = "ScrollAreaCorner";
3839
3844
 
3840
- var index_parts$2 = /*#__PURE__*/Object.freeze({
3845
+ var index_parts$3 = /*#__PURE__*/Object.freeze({
3841
3846
  __proto__: null,
3842
3847
  Content: ScrollAreaContent,
3843
3848
  Corner: ScrollAreaCorner,
@@ -3847,7 +3852,7 @@ var index_parts$2 = /*#__PURE__*/Object.freeze({
3847
3852
  Viewport: ScrollAreaViewport
3848
3853
  });
3849
3854
 
3850
- var index_parts$1 = /*#__PURE__*/Object.freeze({
3855
+ var index_parts$2 = /*#__PURE__*/Object.freeze({
3851
3856
  __proto__: null,
3852
3857
  Arrow: ComboboxArrow,
3853
3858
  Backdrop: ComboboxBackdrop,
@@ -4170,7 +4175,7 @@ const NumberFieldScrubArea = /*#__PURE__*/React.forwardRef(function NumberFieldS
4170
4175
  ref: [forwardedRef, scrubAreaRef],
4171
4176
  state,
4172
4177
  props: [defaultProps, elementProps],
4173
- stateAttributesMapping: stateAttributesMapping$4
4178
+ stateAttributesMapping: stateAttributesMapping$6
4174
4179
  });
4175
4180
  const contextValue = React.useMemo(() => ({
4176
4181
  isScrubbing,
@@ -4228,13 +4233,13 @@ const NumberFieldScrubAreaCursor = /*#__PURE__*/React.forwardRef(function Number
4228
4233
  pointerEvents: 'none'
4229
4234
  }
4230
4235
  }, elementProps],
4231
- stateAttributesMapping: stateAttributesMapping$4
4236
+ stateAttributesMapping: stateAttributesMapping$6
4232
4237
  });
4233
4238
  return element && /*#__PURE__*/ReactDOM.createPortal(element, ownerDocument(domElement).body);
4234
4239
  });
4235
4240
  if (process.env.NODE_ENV !== "production") NumberFieldScrubAreaCursor.displayName = "NumberFieldScrubAreaCursor";
4236
4241
 
4237
- var index_parts = /*#__PURE__*/Object.freeze({
4242
+ var index_parts$1 = /*#__PURE__*/Object.freeze({
4238
4243
  __proto__: null,
4239
4244
  Decrement: NumberFieldDecrement,
4240
4245
  Group: NumberFieldGroup,
@@ -4245,6 +4250,392 @@ var index_parts = /*#__PURE__*/Object.freeze({
4245
4250
  ScrubAreaCursor: NumberFieldScrubAreaCursor
4246
4251
  });
4247
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
+
4248
4639
  /**
4249
4640
  * Renders a Base UI element.
4250
4641
  *
@@ -4254,4 +4645,4 @@ function useRender(params) {
4254
4645
  return useRenderElement(params.defaultTagName ?? 'div', params, params);
4255
4646
  }
4256
4647
 
4257
- export { index_parts$6 as Autocomplete, index_parts$1 as Combobox, index_parts$5 as Dialog, 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 };
@@ -545,6 +545,7 @@ const cancelOpen = 'cancel-open';
545
545
  const siblingOpen = 'sibling-open';
546
546
  const imperativeAction = 'imperative-action';
547
547
  const swipe = 'swipe';
548
+ const windowResize = 'window-resize';
548
549
 
549
550
  /**
550
551
  * Maps a change `reason` string to the corresponding native event type.
@@ -1194,3 +1195,4 @@ exports.useValueAsRef = useValueAsRef;
1194
1195
  exports.useValueChanged = useValueChanged;
1195
1196
  exports.visuallyHidden = visuallyHidden;
1196
1197
  exports.visuallyHiddenInput = visuallyHiddenInput;
1198
+ exports.windowResize = windowResize;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { a as useRefWithInit, E as EMPTY_OBJECT, f as formatErrorMessage, m as mergeProps, c as makeEventPreventable } from './useRenderElement-es.js';
2
+ import { a as useRefWithInit, E as EMPTY_OBJECT, f as formatErrorMessage, m as mergeProps, d as makeEventPreventable } from './useRenderElement-es.js';
3
3
  import { i as isShadowRoot, b as isElement, a as isHTMLElement } from './floating-ui.utils.dom-es.js';
4
4
  import * as ReactDOM from 'react-dom';
5
5
 
@@ -523,6 +523,7 @@ const cancelOpen = 'cancel-open';
523
523
  const siblingOpen = 'sibling-open';
524
524
  const imperativeAction = 'imperative-action';
525
525
  const swipe = 'swipe';
526
+ const windowResize = 'window-resize';
526
527
 
527
528
  /**
528
529
  * Maps a change `reason` string to the corresponding native event type.
@@ -1088,4 +1089,4 @@ function isValidLinkElement(elem) {
1088
1089
  return Boolean(elem?.tagName === 'A' && elem?.href);
1089
1090
  }
1090
1091
 
1091
- export { triggerPress as $, ARROW_DOWN as A, isVirtualPointerEvent as B, ARROW_UP as C, useOnMount as D, useControlled as E, isIOS as F, none as G, visuallyHiddenInput as H, visuallyHidden as I, inputChange as J, inputClear as K, inputBlur as L, inputPaste as M, createGenericEventDetails as N, incrementPress as O, decrementPress as P, useValueChanged as Q, keyboard as R, SafeReact as S, Timeout as T, isMouseLikePointerType as U, isTypeableElement as V, matchesFocusVisible as W, isTargetInsideEnabledTrigger as X, triggerFocus as Y, isMac as Z, isSafari as _, closePress as a, escapeKey as a0, TYPEABLE_SELECTOR as a1, triggerHover as a2, itemPress as a3, outsidePress as a4, useAnimationsFinished as a5, siblingOpen as a6, useCompositeRootContext as a7, cancelOpen as a8, pointer as a9, swipe as aa, useAnimationFrame as ab, TransitionStatusDataAttributes as ac, isFirefox as ad, scrub as ae, isWebKit as af, isAndroid as ag, closeWatcher as ah, resolveRef as ai, isClickLikeEvent as aj, isReactEvent as ak, isEventTargetWithin as al, isRootElement as am, FOCUSABLE_ATTRIBUTE as an, ACTIVE_KEY as ao, SELECTED_KEY as ap, AnimationFrame as aq, inputPress as ar, clearPress as as, chipRemovePress as at, useBaseUiId as b, createChangeEventDetails as c, useOpenChangeComplete as d, useStableCallback as e, useTimeout as f, error as g, useTransitionStatus as h, imperativeAction as i, useIsoLayoutEffect as j, getTarget as k, useId as l, getFloatingFocusElement as m, useValueAsRef as n, ownerDocument as o, isTypeableCombobox as p, activeElement as q, contains as r, stopEvent as s, transitionStatusMapping as t, useButton as u, listNavigation as v, ARROW_LEFT as w, ARROW_RIGHT as x, focusOut as y, isVirtualClick as z };
1092
+ export { closeWatcher as $, ARROW_DOWN as A, isVirtualPointerEvent as B, ARROW_UP as C, useOnMount as D, useControlled as E, isIOS as F, none as G, visuallyHiddenInput as H, visuallyHidden as I, inputChange as J, inputClear as K, inputBlur as L, inputPaste as M, createGenericEventDetails as N, incrementPress as O, decrementPress as P, useValueChanged as Q, keyboard as R, SafeReact as S, Timeout as T, outsidePress as U, cancelOpen as V, useAnimationFrame as W, isWebKit as X, windowResize as Y, itemPress as Z, isAndroid as _, useIsoLayoutEffect as a, isMouseLikePointerType as a0, isTypeableElement as a1, matchesFocusVisible as a2, isTargetInsideEnabledTrigger as a3, triggerFocus as a4, isMac as a5, isSafari as a6, triggerPress as a7, escapeKey as a8, TYPEABLE_SELECTOR as a9, triggerHover as aa, useAnimationsFinished as ab, siblingOpen as ac, useCompositeRootContext as ad, inputPress as ae, isFirefox as af, clearPress as ag, chipRemovePress as ah, resolveRef as ai, isClickLikeEvent as aj, isReactEvent as ak, isEventTargetWithin as al, isRootElement as am, FOCUSABLE_ATTRIBUTE as an, ACTIVE_KEY as ao, SELECTED_KEY as ap, TransitionStatusDataAttributes as aq, AnimationFrame as ar, pointer as as, swipe as at, scrub as au, useStableCallback as b, useButton as c, createChangeEventDetails as d, closePress as e, useOpenChangeComplete as f, getTarget as g, useTimeout as h, imperativeAction as i, error as j, useTransitionStatus as k, useId as l, getFloatingFocusElement as m, useValueAsRef as n, ownerDocument as o, isTypeableCombobox as p, activeElement as q, contains as r, stopEvent as s, transitionStatusMapping as t, useBaseUiId as u, listNavigation as v, ARROW_LEFT as w, ARROW_RIGHT as x, focusOut as y, isVirtualClick as z };
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { b as isElement, a as isHTMLElement, k as getWindow } from './floating-ui.utils.dom-es.js';
3
- import { l as useId, j as useIsoLayoutEffect, m as getFloatingFocusElement, n as useValueAsRef, p as isTypeableCombobox, e as useStableCallback, q as activeElement, o as ownerDocument, r as contains, s as stopEvent, c as createChangeEventDetails, v as listNavigation, A as ARROW_DOWN, w as ARROW_LEFT, x as ARROW_RIGHT, k as getTarget, y as focusOut, z as isVirtualClick, B as isVirtualPointerEvent, C as ARROW_UP, f as useTimeout } from './useButton-es.js';
2
+ import { b as isElement, a as isHTMLElement, o as getWindow } from './floating-ui.utils.dom-es.js';
3
+ import { l as useId, a as useIsoLayoutEffect, m as getFloatingFocusElement, n as useValueAsRef, p as isTypeableCombobox, b as useStableCallback, q as activeElement, o as ownerDocument, r as contains, s as stopEvent, d as createChangeEventDetails, v as listNavigation, A as ARROW_DOWN, w as ARROW_LEFT, x as ARROW_RIGHT, g as getTarget, y as focusOut, z as isVirtualClick, B as isVirtualPointerEvent, C as ARROW_UP, h as useTimeout } from './useButton-es.js';
4
4
  import { u as useFloatingParentNodeId, a as FloatingRootStore, P as PopupTriggerMap, b as useFloatingTree, i as isIndexOutOfListBounds, g as getMinListIndex, c as getMaxListIndex, d as createGridCellMap, e as isListIndexDisabled, f as getGridNavigatedIndex, h as getGridCellIndices, j as getGridCellIndexOfCorner, k as findNonDisabledListIndex, l as enqueueFocus, m as isElementVisible, n as useDirection, D as DISABLED_TRANSITIONS_STYLE } from './InternalBackdrop-es.js';
5
5
  import { a as useRefWithInit, E as EMPTY_OBJECT } from './useRenderElement-es.js';
6
6
  import { jsx } from 'react/jsx-runtime';
@@ -1759,4 +1759,4 @@ function useCompositeListItem(params = {}) {
1759
1759
  }), [index, ref]);
1760
1760
  }
1761
1761
 
1762
- export { CompositeList as C, IndexGuessBehavior as I, useAnchorPositioning as a, adaptiveOrigin as b, useListNavigation as c, useTypeahead as d, getPseudoElementBounds as e, useFloatingRootContext as f, getDisabledMountTransitionStyles as g, useCompositeListItem as u };
1762
+ export { CompositeList as C, IndexGuessBehavior as I, useListNavigation as a, useTypeahead as b, useAnchorPositioning as c, getDisabledMountTransitionStyles as d, useCompositeListItem as e, adaptiveOrigin as f, getPseudoElementBounds as g, useFloatingRootContext as u };