@jobber/components 7.10.0 → 7.11.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 (106) hide show
  1. package/dist/Autocomplete/index.cjs +1 -0
  2. package/dist/Autocomplete/index.mjs +1 -0
  3. package/dist/Card/index.cjs +3 -0
  4. package/dist/Card/index.mjs +3 -0
  5. package/dist/Chip/index.cjs +1 -0
  6. package/dist/Chip/index.mjs +1 -0
  7. package/dist/Chips/InternalChipDismissible/hooks/index.cjs +1 -0
  8. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +1 -0
  9. package/dist/Chips/InternalChipDismissible/index.cjs +1 -0
  10. package/dist/Chips/InternalChipDismissible/index.mjs +1 -0
  11. package/dist/Chips/index.cjs +1 -0
  12. package/dist/Chips/index.mjs +1 -0
  13. package/dist/Combobox/components/ComboboxActivator/index.cjs +1 -0
  14. package/dist/Combobox/components/ComboboxActivator/index.mjs +1 -0
  15. package/dist/Combobox/components/ComboboxContent/index.cjs +1 -0
  16. package/dist/Combobox/components/ComboboxContent/index.mjs +1 -0
  17. package/dist/Combobox/components/ComboboxTrigger/index.cjs +1 -0
  18. package/dist/Combobox/components/ComboboxTrigger/index.mjs +1 -0
  19. package/dist/Combobox/index.cjs +1 -0
  20. package/dist/Combobox/index.mjs +1 -0
  21. package/dist/ConfirmationModal/index.cjs +1 -0
  22. package/dist/ConfirmationModal/index.mjs +1 -0
  23. package/dist/DataDump/index.cjs +3 -0
  24. package/dist/DataDump/index.mjs +3 -0
  25. package/dist/DataList/components/DataListActions/index.cjs +1 -0
  26. package/dist/DataList/components/DataListActions/index.mjs +1 -0
  27. package/dist/DataList/components/DataListBulkActions/index.cjs +1 -0
  28. package/dist/DataList/components/DataListBulkActions/index.mjs +1 -0
  29. package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +1 -0
  30. package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +1 -0
  31. package/dist/DataList/components/DataListFilters/index.cjs +1 -0
  32. package/dist/DataList/components/DataListFilters/index.mjs +1 -0
  33. package/dist/DataList/components/DataListHeader/index.cjs +1 -0
  34. package/dist/DataList/components/DataListHeader/index.mjs +1 -0
  35. package/dist/DataList/components/DataListItem/index.cjs +1 -0
  36. package/dist/DataList/components/DataListItem/index.mjs +1 -0
  37. package/dist/DataList/components/DataListItemActions/index.cjs +1 -0
  38. package/dist/DataList/components/DataListItemActions/index.mjs +1 -0
  39. package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +1 -0
  40. package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +1 -0
  41. package/dist/DataList/components/DataListItems/index.cjs +1 -0
  42. package/dist/DataList/components/DataListItems/index.mjs +1 -0
  43. package/dist/DataList/components/DataListLayout/index.cjs +1 -0
  44. package/dist/DataList/components/DataListLayout/index.mjs +1 -0
  45. package/dist/DataList/components/DataListLayoutActions/index.cjs +1 -0
  46. package/dist/DataList/components/DataListLayoutActions/index.mjs +1 -0
  47. package/dist/DataList/index.cjs +1 -0
  48. package/dist/DataList/index.mjs +1 -0
  49. package/dist/DatePicker/index.cjs +1 -0
  50. package/dist/DatePicker/index.mjs +1 -0
  51. package/dist/DrawerRoot-cjs.js +181 -968
  52. package/dist/DrawerRoot-es.js +5 -734
  53. package/dist/FormatFile/index.cjs +1 -0
  54. package/dist/FormatFile/index.mjs +1 -0
  55. package/dist/Gallery/index.cjs +1 -0
  56. package/dist/Gallery/index.mjs +1 -0
  57. package/dist/InputDate/index.cjs +1 -0
  58. package/dist/InputDate/index.mjs +1 -0
  59. package/dist/InputNumberExperimental-cjs.js +783 -0
  60. package/dist/InputNumberExperimental-es.js +763 -0
  61. package/dist/LightBox/index.cjs +1 -0
  62. package/dist/LightBox/index.mjs +1 -0
  63. package/dist/Menu/index.cjs +3 -0
  64. package/dist/Menu/index.mjs +3 -0
  65. package/dist/MenuSubmenuTrigger-cjs.js +202 -447
  66. package/dist/MenuSubmenuTrigger-es.js +7 -249
  67. package/dist/Modal/index.cjs +1 -0
  68. package/dist/Modal/index.mjs +1 -0
  69. package/dist/NumberFieldInput-cjs.js +1828 -0
  70. package/dist/NumberFieldInput-es.js +1788 -0
  71. package/dist/Page/index.cjs +3 -0
  72. package/dist/Page/index.mjs +3 -0
  73. package/dist/Popover/index.cjs +1 -0
  74. package/dist/Popover/index.mjs +1 -0
  75. package/dist/Tooltip/index.cjs +1 -0
  76. package/dist/Tooltip/index.mjs +1 -0
  77. package/dist/docs/Menu/Menu.md +197 -37
  78. package/dist/floating-ui.react-cjs.js +35 -34
  79. package/dist/floating-ui.react-dom-cjs.js +65 -64
  80. package/dist/floating-ui.react-dom-es.js +2 -1
  81. package/dist/floating-ui.react-es.js +2 -1
  82. package/dist/floating-ui.utils.dom-cjs.js +185 -0
  83. package/dist/floating-ui.utils.dom-es.js +165 -0
  84. package/dist/index.cjs +3 -0
  85. package/dist/index.esm-cjs.js +0 -183
  86. package/dist/index.esm-es.js +1 -165
  87. package/dist/index.mjs +3 -0
  88. package/dist/primitives/BottomSheet/index.cjs +3 -1
  89. package/dist/primitives/BottomSheet/index.mjs +3 -1
  90. package/dist/primitives/InputNumberExperimental/InputNumberExperimental.d.ts +20 -0
  91. package/dist/primitives/InputNumberExperimental/index.cjs +22 -0
  92. package/dist/primitives/InputNumberExperimental/index.d.ts +2 -0
  93. package/dist/primitives/InputNumberExperimental/index.mjs +16 -0
  94. package/dist/primitives/InputNumberExperimental/types.d.ts +147 -0
  95. package/dist/primitives/index.cjs +9 -1
  96. package/dist/primitives/index.d.ts +2 -0
  97. package/dist/primitives/index.mjs +8 -1
  98. package/dist/styles.css +499 -0
  99. package/dist/unstyledPrimitives/index.cjs +264 -2039
  100. package/dist/unstyledPrimitives/index.mjs +72 -1847
  101. package/dist/useBaseUiId-cjs.js +275 -0
  102. package/dist/useBaseUiId-es.js +251 -0
  103. package/dist/useValueChanged-cjs.js +820 -0
  104. package/dist/useValueChanged-es.js +736 -0
  105. package/package.json +2 -2
  106. package/rollup.config.mjs +13 -2
@@ -2,8 +2,10 @@
2
2
 
3
3
  var React = require('react');
4
4
  var useRenderElement = require('./useRenderElement-cjs.js');
5
+ var useValueChanged = require('./useValueChanged-cjs.js');
5
6
  var jsxRuntime = require('react/jsx-runtime');
6
7
  var index_esm = require('./index.esm-cjs.js');
8
+ var floatingUi_utils_dom = require('./floating-ui.utils.dom-cjs.js');
7
9
  var ReactDOM = require('react-dom');
8
10
 
9
11
  function _interopNamespaceDefault(e) {
@@ -76,35 +78,6 @@ const ownerVisuallyHidden = {
76
78
  left: 0
77
79
  };
78
80
 
79
- let TransitionStatusDataAttributes = /*#__PURE__*/function (TransitionStatusDataAttributes) {
80
- /**
81
- * Present when the component is animating in.
82
- */
83
- TransitionStatusDataAttributes["startingStyle"] = "data-starting-style";
84
- /**
85
- * Present when the component is animating out.
86
- */
87
- TransitionStatusDataAttributes["endingStyle"] = "data-ending-style";
88
- return TransitionStatusDataAttributes;
89
- }({});
90
- const STARTING_HOOK = {
91
- [TransitionStatusDataAttributes.startingStyle]: ''
92
- };
93
- const ENDING_HOOK = {
94
- [TransitionStatusDataAttributes.endingStyle]: ''
95
- };
96
- const transitionStatusMapping = {
97
- transitionStatus(value) {
98
- if (value === 'starting') {
99
- return STARTING_HOOK;
100
- }
101
- if (value === 'ending') {
102
- return ENDING_HOOK;
103
- }
104
- return null;
105
- }
106
- };
107
-
108
81
  let CommonPopupDataAttributes = function (CommonPopupDataAttributes) {
109
82
  /**
110
83
  * Present when the popup is open.
@@ -117,11 +90,11 @@ let CommonPopupDataAttributes = function (CommonPopupDataAttributes) {
117
90
  /**
118
91
  * Present when the popup is animating in.
119
92
  */
120
- CommonPopupDataAttributes[CommonPopupDataAttributes["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle";
93
+ CommonPopupDataAttributes[CommonPopupDataAttributes["startingStyle"] = useValueChanged.TransitionStatusDataAttributes.startingStyle] = "startingStyle";
121
94
  /**
122
95
  * Present when the popup is animating out.
123
96
  */
124
- CommonPopupDataAttributes[CommonPopupDataAttributes["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle";
97
+ CommonPopupDataAttributes[CommonPopupDataAttributes["endingStyle"] = useValueChanged.TransitionStatusDataAttributes.endingStyle] = "endingStyle";
125
98
  /**
126
99
  * Present when the anchor is hidden.
127
100
  */
@@ -246,7 +219,7 @@ let DrawerBackdropCssVars = /*#__PURE__*/function (DrawerBackdropCssVars) {
246
219
 
247
220
  const stateAttributesMapping$1 = {
248
221
  ...popupStateMapping,
249
- ...transitionStatusMapping
222
+ ...useValueChanged.transitionStatusMapping
250
223
  };
251
224
 
252
225
  /**
@@ -293,131 +266,6 @@ const DrawerBackdrop = /*#__PURE__*/React__namespace.forwardRef(function DrawerB
293
266
  });
294
267
  if (process.env.NODE_ENV !== "production") DrawerBackdrop.displayName = "DrawerBackdrop";
295
268
 
296
- // https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379
297
- const useInsertionEffect = React__namespace[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)];
298
- const useSafeInsertionEffect =
299
- // React 17 doesn't have useInsertionEffect.
300
- useInsertionEffect &&
301
- // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
302
- useInsertionEffect !== React__namespace.useLayoutEffect ? useInsertionEffect : fn => fn();
303
- /**
304
- * Stabilizes the function passed so it's always the same between renders.
305
- *
306
- * The function becomes non-reactive to any values it captures.
307
- * It can safely be passed as a dependency of `React.useMemo` and `React.useEffect` without re-triggering them if its captured values change.
308
- *
309
- * The function must only be called inside effects and event handlers, never during render (which throws an error).
310
- *
311
- * This hook is a more permissive version of React 19.2's `React.useEffectEvent` in that it can be passed through contexts and called in event handler props, not just effects.
312
- */
313
- function useStableCallback(callback) {
314
- const stable = useRenderElement.useRefWithInit(createStableCallback).current;
315
- stable.next = callback;
316
- useSafeInsertionEffect(stable.effect);
317
- return stable.trampoline;
318
- }
319
- function createStableCallback() {
320
- const stable = {
321
- next: undefined,
322
- callback: assertNotCalled,
323
- trampoline: (...args) => stable.callback?.(...args),
324
- effect: () => {
325
- stable.callback = stable.next;
326
- }
327
- };
328
- return stable;
329
- }
330
- function assertNotCalled() {
331
- if (process.env.NODE_ENV !== 'production') {
332
- throw /* minify-error-disabled */new Error('Base UI: Cannot call an event handler while rendering.');
333
- }
334
- }
335
-
336
- // https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379
337
- const SafeReact = {
338
- ...React__namespace
339
- };
340
-
341
- const noop = () => {};
342
- const useIsoLayoutEffect = typeof document !== 'undefined' ? React__namespace.useLayoutEffect : noop;
343
-
344
- const none = 'none';
345
- const triggerPress = 'trigger-press';
346
- const triggerHover = 'trigger-hover';
347
- const triggerFocus = 'trigger-focus';
348
- const outsidePress = 'outside-press';
349
- const itemPress = 'item-press';
350
- const closePress = 'close-press';
351
- const clearPress = 'clear-press';
352
- const chipRemovePress = 'chip-remove-press';
353
- const incrementPress = 'increment-press';
354
- const decrementPress = 'decrement-press';
355
- const inputChange = 'input-change';
356
- const inputClear = 'input-clear';
357
- const inputBlur = 'input-blur';
358
- const inputPaste = 'input-paste';
359
- const inputPress = 'input-press';
360
- const focusOut = 'focus-out';
361
- const escapeKey = 'escape-key';
362
- const closeWatcher = 'close-watcher';
363
- const listNavigation = 'list-navigation';
364
- const keyboard = 'keyboard';
365
- const scrub = 'scrub';
366
- const cancelOpen = 'cancel-open';
367
- const siblingOpen = 'sibling-open';
368
- const imperativeAction = 'imperative-action';
369
- const swipe = 'swipe';
370
-
371
- /**
372
- * Maps a change `reason` string to the corresponding native event type.
373
- */
374
-
375
- /**
376
- * Details of custom change events emitted by Base UI components.
377
- */
378
-
379
- /**
380
- * Details of custom generic events emitted by Base UI components.
381
- */
382
-
383
- /**
384
- * Creates a Base UI event details object with the given reason and utilities
385
- * for preventing Base UI's internal event handling.
386
- */
387
- function createChangeEventDetails(reason, event, trigger, customProperties) {
388
- let canceled = false;
389
- let allowPropagation = false;
390
- const custom = customProperties ?? useRenderElement.EMPTY_OBJECT;
391
- const details = {
392
- reason,
393
- event: event ?? new Event('base-ui'),
394
- cancel() {
395
- canceled = true;
396
- },
397
- allowPropagation() {
398
- allowPropagation = true;
399
- },
400
- get isCanceled() {
401
- return canceled;
402
- },
403
- get isPropagationAllowed() {
404
- return allowPropagation;
405
- },
406
- trigger,
407
- ...custom
408
- };
409
- return details;
410
- }
411
- function createGenericEventDetails(reason, event, customProperties) {
412
- const custom = customProperties ?? useRenderElement.EMPTY_OBJECT;
413
- const details = {
414
- reason,
415
- event: event ?? new Event('base-ui'),
416
- ...custom
417
- };
418
- return details;
419
- }
420
-
421
269
  const DRAWER_CONTENT_ATTRIBUTE = 'data-drawer-content';
422
270
 
423
271
  /**
@@ -442,44 +290,6 @@ const DrawerContent = /*#__PURE__*/React__namespace.forwardRef(function DrawerCo
442
290
  });
443
291
  if (process.env.NODE_ENV !== "production") DrawerContent.displayName = "DrawerContent";
444
292
 
445
- let globalId = 0;
446
-
447
- // TODO React 17: Remove `useGlobalId` once React 17 support is removed
448
- function useGlobalId(idOverride, prefix = 'mui') {
449
- const [defaultId, setDefaultId] = React__namespace.useState(idOverride);
450
- const id = idOverride || defaultId;
451
- React__namespace.useEffect(() => {
452
- if (defaultId == null) {
453
- // Fallback to this default id when possible.
454
- // Use the incrementing value for client-side rendering only.
455
- // We can't use it server-side.
456
- // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
457
- globalId += 1;
458
- setDefaultId(`${prefix}-${globalId}`);
459
- }
460
- }, [defaultId, prefix]);
461
- return id;
462
- }
463
- const maybeReactUseId = SafeReact.useId;
464
-
465
- /**
466
- *
467
- * @example <div id={useId()} />
468
- * @param idOverride
469
- * @returns {string}
470
- */
471
- function useId(idOverride, prefix) {
472
- // React.useId() is only available from React 17.0.0.
473
- if (maybeReactUseId !== undefined) {
474
- const reactId = maybeReactUseId();
475
- return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
476
- }
477
-
478
- // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
479
- // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
480
- return useGlobalId(idOverride, prefix);
481
- }
482
-
483
293
  const DrawerProviderContext = /*#__PURE__*/React__namespace.createContext(undefined);
484
294
  if (process.env.NODE_ENV !== "production") DrawerProviderContext.displayName = "DrawerProviderContext";
485
295
  function useDrawerProviderContext(optional) {
@@ -487,116 +297,6 @@ function useDrawerProviderContext(optional) {
487
297
  return context;
488
298
  }
489
299
 
490
- const EMPTY$2 = [];
491
-
492
- /**
493
- * A React.useEffect equivalent that runs once, when the component is mounted.
494
- */
495
- function useOnMount(fn) {
496
- // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- no need to put `fn` in the dependency array
497
- /* eslint-disable react-hooks/exhaustive-deps */
498
- React__namespace.useEffect(fn, EMPTY$2);
499
- /* eslint-enable react-hooks/exhaustive-deps */
500
- }
501
-
502
- const EMPTY$1 = 0;
503
- class Timeout {
504
- static create() {
505
- return new Timeout();
506
- }
507
- currentId = EMPTY$1;
508
-
509
- /**
510
- * Executes `fn` after `delay`, clearing any previously scheduled call.
511
- */
512
- start(delay, fn) {
513
- this.clear();
514
- this.currentId = setTimeout(() => {
515
- this.currentId = EMPTY$1;
516
- fn();
517
- }, delay); /* Node.js types are enabled in development */
518
- }
519
- isStarted() {
520
- return this.currentId !== EMPTY$1;
521
- }
522
- clear = () => {
523
- if (this.currentId !== EMPTY$1) {
524
- clearTimeout(this.currentId);
525
- this.currentId = EMPTY$1;
526
- }
527
- };
528
- disposeEffect = () => {
529
- return this.clear;
530
- };
531
- }
532
-
533
- /**
534
- * A `setTimeout` with automatic cleanup and guard.
535
- */
536
- function useTimeout() {
537
- const timeout = useRenderElement.useRefWithInit(Timeout.create).current;
538
- useOnMount(timeout.disposeEffect);
539
- return timeout;
540
- }
541
-
542
- const hasNavigator = typeof navigator !== 'undefined';
543
- const nav = getNavigatorData();
544
- const platform = getPlatform();
545
- const userAgent = getUserAgent();
546
- const isWebKit = typeof CSS === 'undefined' || !CSS.supports ? false : CSS.supports('-webkit-backdrop-filter:none');
547
- const isIOS =
548
- // iPads can claim to be MacIntel
549
- nav.platform === 'MacIntel' && nav.maxTouchPoints > 1 ? true : /iP(hone|ad|od)|iOS/.test(nav.platform);
550
- const isFirefox = hasNavigator && /firefox/i.test(userAgent);
551
- const isSafari = hasNavigator && /apple/i.test(navigator.vendor);
552
- const isAndroid = hasNavigator && /android/i.test(platform) || /android/i.test(userAgent);
553
- const isMac = hasNavigator && platform.toLowerCase().startsWith('mac') && !navigator.maxTouchPoints;
554
- const isJSDOM = userAgent.includes('jsdom/');
555
-
556
- // Avoid Chrome DevTools blue warning.
557
- function getNavigatorData() {
558
- if (!hasNavigator) {
559
- return {
560
- platform: '',
561
- maxTouchPoints: -1
562
- };
563
- }
564
- const uaData = navigator.userAgentData;
565
- if (uaData?.platform) {
566
- return {
567
- platform: uaData.platform,
568
- maxTouchPoints: navigator.maxTouchPoints
569
- };
570
- }
571
- return {
572
- platform: navigator.platform ?? '',
573
- maxTouchPoints: navigator.maxTouchPoints ?? -1
574
- };
575
- }
576
- function getUserAgent() {
577
- if (!hasNavigator) {
578
- return '';
579
- }
580
- const uaData = navigator.userAgentData;
581
- if (uaData && Array.isArray(uaData.brands)) {
582
- return uaData.brands.map(({
583
- brand,
584
- version
585
- }) => `${brand}/${version}`).join(' ');
586
- }
587
- return navigator.userAgent;
588
- }
589
- function getPlatform() {
590
- if (!hasNavigator) {
591
- return '';
592
- }
593
- const uaData = navigator.userAgentData;
594
- if (uaData?.platform) {
595
- return uaData.platform;
596
- }
597
- return navigator.platform ?? '';
598
- }
599
-
600
300
  const FOCUSABLE_ATTRIBUTE = 'data-base-ui-focusable';
601
301
  const ACTIVE_KEY = 'active';
602
302
  const SELECTED_KEY = 'selected';
@@ -625,7 +325,7 @@ function contains(parent, child) {
625
325
  }
626
326
 
627
327
  // then fallback to custom implementation with Shadow DOM support
628
- if (rootNode && index_esm.isShadowRoot(rootNode)) {
328
+ if (rootNode && floatingUi_utils_dom.isShadowRoot(rootNode)) {
629
329
  let next = child;
630
330
  while (next) {
631
331
  if (parent === next) {
@@ -639,7 +339,7 @@ function contains(parent, child) {
639
339
  return false;
640
340
  }
641
341
  function isTargetInsideEnabledTrigger(target, triggerElements) {
642
- if (!index_esm.isElement(target)) {
342
+ if (!floatingUi_utils_dom.isElement(target)) {
643
343
  return false;
644
344
  }
645
345
  const targetElement = target;
@@ -678,7 +378,7 @@ function isRootElement(element) {
678
378
  return element.matches('html,body');
679
379
  }
680
380
  function isTypeableElement(element) {
681
- return index_esm.isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
381
+ return floatingUi_utils_dom.isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
682
382
  }
683
383
  function isTypeableCombobox(element) {
684
384
  if (!element) {
@@ -689,7 +389,7 @@ function isTypeableCombobox(element) {
689
389
  function matchesFocusVisible(element) {
690
390
  // We don't want to block focus from working with `visibleOnly`
691
391
  // (JSDOM doesn't match `:focus-visible` when the element has `:focus`)
692
- if (!element || isJSDOM) {
392
+ if (!element || useValueChanged.isJSDOM) {
693
393
  return true;
694
394
  }
695
395
  try {
@@ -728,46 +428,6 @@ function getNodeAncestors(nodes, id) {
728
428
  return allAncestors;
729
429
  }
730
430
 
731
- function stopEvent(event) {
732
- event.preventDefault();
733
- event.stopPropagation();
734
- }
735
- function isReactEvent(event) {
736
- return 'nativeEvent' in event;
737
- }
738
-
739
- // License: https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/utils/src/isVirtualEvent.ts
740
- function isVirtualClick(event) {
741
- if (event.pointerType === '' && event.isTrusted) {
742
- return true;
743
- }
744
- if (isAndroid && event.pointerType) {
745
- return event.type === 'click' && event.buttons === 1;
746
- }
747
- return event.detail === 0 && !event.pointerType;
748
- }
749
- function isVirtualPointerEvent(event) {
750
- if (isJSDOM) {
751
- return false;
752
- }
753
- return !isAndroid && event.width === 0 && event.height === 0 || isAndroid && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' ||
754
- // iOS VoiceOver returns 0.333• for width/height.
755
- event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'touch';
756
- }
757
- function isMouseLikePointerType(pointerType, strict) {
758
- // On some Linux machines with Chromium, mouse inputs return a `pointerType`
759
- // of "pen": https://github.com/floating-ui/floating-ui/issues/2015
760
- const values = ['mouse', 'pen'];
761
- if (!strict) {
762
- values.push('', undefined);
763
- }
764
- return values.includes(pointerType);
765
- }
766
- function isClickLikeEvent(event) {
767
- const type = event.type;
768
- return type === 'click' || type === 'mousedown' || type === 'keydown' || type === 'keyup';
769
- }
770
-
771
431
  function isDifferentGridRow(index, cols, prevRow) {
772
432
  return Math.floor(index / cols) !== prevRow;
773
433
  }
@@ -914,7 +574,7 @@ function getGridNavigatedIndex(listRef, {
914
574
  return undefined;
915
575
  };
916
576
  if (stop) {
917
- stopEvent(event);
577
+ useValueChanged.stopEvent(event);
918
578
  }
919
579
  const verticalCandidate = navigateVertically(verticalDirection) ?? navigateVerticallyWithInferredRows(verticalDirection);
920
580
  if (verticalCandidate !== undefined) {
@@ -958,7 +618,7 @@ function getGridNavigatedIndex(listRef, {
958
618
  const prevRow = index_esm.floor(prevIndex / cols);
959
619
  if (event.key === (rtl ? ARROW_LEFT$1 : ARROW_RIGHT$1)) {
960
620
  if (stop) {
961
- stopEvent(event);
621
+ useValueChanged.stopEvent(event);
962
622
  }
963
623
  if (prevIndex % cols !== cols - 1) {
964
624
  nextIndex = findNonDisabledListIndex(listRef, {
@@ -983,7 +643,7 @@ function getGridNavigatedIndex(listRef, {
983
643
  }
984
644
  if (event.key === (rtl ? ARROW_RIGHT$1 : ARROW_LEFT$1)) {
985
645
  if (stop) {
986
- stopEvent(event);
646
+ useValueChanged.stopEvent(event);
987
647
  }
988
648
  if (prevIndex % cols !== 0) {
989
649
  nextIndex = findNonDisabledListIndex(listRef, {
@@ -1106,11 +766,7 @@ function isListIndexDisabled(listRef, index, disabledIndices) {
1106
766
  return !disabledIndices && (element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true');
1107
767
  }
1108
768
  function isElementVisible(element) {
1109
- return index_esm.getComputedStyle(element).display !== 'none';
1110
- }
1111
-
1112
- function ownerDocument(node) {
1113
- return node?.ownerDocument || document;
769
+ return floatingUi_utils_dom.getComputedStyle(element).display !== 'none';
1114
770
  }
1115
771
 
1116
772
  const getTabbableOptions = () => ({
@@ -1127,23 +783,23 @@ function getTabbableIn(container, dir) {
1127
783
  if (len === 0) {
1128
784
  return undefined;
1129
785
  }
1130
- const active = activeElement(ownerDocument(container));
786
+ const active = activeElement(useValueChanged.ownerDocument(container));
1131
787
  const index = list.indexOf(active);
1132
788
  // eslint-disable-next-line no-nested-ternary
1133
789
  const nextIndex = index === -1 ? dir === 1 ? 0 : len - 1 : index + dir;
1134
790
  return list[nextIndex];
1135
791
  }
1136
792
  function getNextTabbable(referenceElement) {
1137
- return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;
793
+ return getTabbableIn(useValueChanged.ownerDocument(referenceElement).body, 1) || referenceElement;
1138
794
  }
1139
795
  function getPreviousTabbable(referenceElement) {
1140
- return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;
796
+ return getTabbableIn(useValueChanged.ownerDocument(referenceElement).body, -1) || referenceElement;
1141
797
  }
1142
798
  function getTabbableNearElement(referenceElement, dir) {
1143
799
  if (!referenceElement) {
1144
800
  return null;
1145
801
  }
1146
- const list = index_esm.tabbable(ownerDocument(referenceElement).body, getTabbableOptions());
802
+ const list = index_esm.tabbable(useValueChanged.ownerDocument(referenceElement).body, getTabbableOptions());
1147
803
  const elementCount = list.length;
1148
804
  if (elementCount === 0) {
1149
805
  return null;
@@ -1186,158 +842,10 @@ function enableFocusInside(container) {
1186
842
  });
1187
843
  }
1188
844
 
1189
- /**
1190
- * Untracks the provided value by turning it into a ref to remove its reactivity.
1191
- *
1192
- * Used to access the passed value inside `React.useEffect` without causing the effect to re-run when the value changes.
1193
- */
1194
- function useValueAsRef(value) {
1195
- const latest = useRenderElement.useRefWithInit(createLatestRef, value).current;
1196
- latest.next = value;
1197
-
1198
- // eslint-disable-next-line react-hooks/exhaustive-deps
1199
- useIsoLayoutEffect(latest.effect);
1200
- return latest;
1201
- }
1202
- function createLatestRef(value) {
1203
- const latest = {
1204
- current: value,
1205
- next: value,
1206
- effect: () => {
1207
- latest.current = latest.next;
1208
- }
1209
- };
1210
- return latest;
1211
- }
1212
-
1213
- /** Unlike `setTimeout`, rAF doesn't guarantee a positive integer return value, so we can't have
1214
- * a monomorphic `uint` type with `0` meaning empty.
1215
- * See warning note at:
1216
- * https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame#return_value */
1217
- const EMPTY = null;
1218
- let LAST_RAF = globalThis.requestAnimationFrame;
1219
- class Scheduler {
1220
- /* This implementation uses an array as a backing data-structure for frame callbacks.
1221
- * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
1222
- * never calls the native `cancelAnimationFrame` if there are no frames left. This can
1223
- * be much more efficient if there is a call pattern that alterns as
1224
- * "request-cancel-request-cancel-…".
1225
- * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
1226
- * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
1227
-
1228
- callbacks = [];
1229
- callbacksCount = 0;
1230
- nextId = 1;
1231
- startId = 1;
1232
- isScheduled = false;
1233
- tick = timestamp => {
1234
- this.isScheduled = false;
1235
- const currentCallbacks = this.callbacks;
1236
- const currentCallbacksCount = this.callbacksCount;
1237
-
1238
- // Update these before iterating, callbacks could call `requestAnimationFrame` again.
1239
- this.callbacks = [];
1240
- this.callbacksCount = 0;
1241
- this.startId = this.nextId;
1242
- if (currentCallbacksCount > 0) {
1243
- for (let i = 0; i < currentCallbacks.length; i += 1) {
1244
- currentCallbacks[i]?.(timestamp);
1245
- }
1246
- }
1247
- };
1248
- request(fn) {
1249
- const id = this.nextId;
1250
- this.nextId += 1;
1251
- this.callbacks.push(fn);
1252
- this.callbacksCount += 1;
1253
-
1254
- /* In a test environment with fake timers, a fake `requestAnimationFrame` can be called
1255
- * but there's no guarantee that the animation frame will actually run before the fake
1256
- * timers are teared, which leaves `isScheduled` set, but won't run our `tick()`. */
1257
- const didRAFChange = process.env.NODE_ENV !== 'production' && LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);
1258
- if (!this.isScheduled || didRAFChange) {
1259
- requestAnimationFrame(this.tick);
1260
- this.isScheduled = true;
1261
- }
1262
- return id;
1263
- }
1264
- cancel(id) {
1265
- const index = id - this.startId;
1266
- if (index < 0 || index >= this.callbacks.length) {
1267
- return;
1268
- }
1269
- this.callbacks[index] = null;
1270
- this.callbacksCount -= 1;
1271
- }
1272
- }
1273
- const scheduler = new Scheduler();
1274
- class AnimationFrame {
1275
- static create() {
1276
- return new AnimationFrame();
1277
- }
1278
- static request(fn) {
1279
- return scheduler.request(fn);
1280
- }
1281
- static cancel(id) {
1282
- return scheduler.cancel(id);
1283
- }
1284
- currentId = EMPTY;
1285
-
1286
- /**
1287
- * Executes `fn` after `delay`, clearing any previously scheduled call.
1288
- */
1289
- request(fn) {
1290
- this.cancel();
1291
- this.currentId = scheduler.request(() => {
1292
- this.currentId = EMPTY;
1293
- fn();
1294
- });
1295
- }
1296
- cancel = () => {
1297
- if (this.currentId !== EMPTY) {
1298
- scheduler.cancel(this.currentId);
1299
- this.currentId = EMPTY;
1300
- }
1301
- };
1302
- disposeEffect = () => {
1303
- return this.cancel;
1304
- };
1305
- }
1306
-
1307
- /**
1308
- * A `requestAnimationFrame` with automatic cleanup and guard.
1309
- */
1310
- function useAnimationFrame() {
1311
- const timeout = useRenderElement.useRefWithInit(AnimationFrame.create).current;
1312
- useOnMount(timeout.disposeEffect);
1313
- return timeout;
1314
- }
1315
-
1316
- const visuallyHiddenBase = {
1317
- clipPath: 'inset(50%)',
1318
- overflow: 'hidden',
1319
- whiteSpace: 'nowrap',
1320
- border: 0,
1321
- padding: 0,
1322
- width: 1,
1323
- height: 1,
1324
- margin: -1
1325
- };
1326
- const visuallyHidden = {
1327
- ...visuallyHiddenBase,
1328
- position: 'fixed',
1329
- top: 0,
1330
- left: 0
1331
- };
1332
- const visuallyHiddenInput = {
1333
- ...visuallyHiddenBase,
1334
- position: 'absolute'
1335
- };
1336
-
1337
845
  const FocusGuard = /*#__PURE__*/React__namespace.forwardRef(function FocusGuard(props, ref) {
1338
846
  const [role, setRole] = React__namespace.useState();
1339
- useIsoLayoutEffect(() => {
1340
- if (isSafari) {
847
+ useValueChanged.useIsoLayoutEffect(() => {
848
+ if (useValueChanged.isSafari) {
1341
849
  // Unlike other screen readers such as NVDA and JAWS, the virtual cursor
1342
850
  // on VoiceOver does trigger the onFocus event, so we can use the focus
1343
851
  // trap element. On Safari, only buttons trigger the onFocus event.
@@ -1352,7 +860,7 @@ const FocusGuard = /*#__PURE__*/React__namespace.forwardRef(function FocusGuard(
1352
860
  return /*#__PURE__*/jsxRuntime.jsx("span", {
1353
861
  ...props,
1354
862
  ref: ref,
1355
- style: visuallyHidden,
863
+ style: useValueChanged.visuallyHidden,
1356
864
  "aria-hidden": role ? undefined : true,
1357
865
  ...restProps,
1358
866
  "data-base-ui-focus-guard": ""
@@ -1404,7 +912,7 @@ function unwrapHost(node) {
1404
912
  if (!node) {
1405
913
  return null;
1406
914
  }
1407
- return index_esm.isShadowRoot(node) ? node.host : unwrapHost(node.parentNode);
915
+ return floatingUi_utils_dom.isShadowRoot(node) ? node.host : unwrapHost(node.parentNode);
1408
916
  }
1409
917
  const correctElements = (parent, targets) => targets.map(target => {
1410
918
  if (parent.contains(target)) {
@@ -1434,7 +942,7 @@ const collectOutsideElements = (root, keepElements, stopElements) => {
1434
942
  return;
1435
943
  }
1436
944
  Array.from(parent.children).forEach(node => {
1437
- if (index_esm.getNodeName(node) === 'script') {
945
+ if (floatingUi_utils_dom.getNodeName(node) === 'script') {
1438
946
  return;
1439
947
  }
1440
948
  if (keepElements.has(node)) {
@@ -1534,7 +1042,7 @@ function markOthers(avoidElements, options = {}) {
1534
1042
  mark = true,
1535
1043
  markerIgnoreElements = []
1536
1044
  } = options;
1537
- const body = ownerDocument(avoidElements[0]).body;
1045
+ const body = useValueChanged.ownerDocument(avoidElements[0]).body;
1538
1046
  return applyAttributeToOthers(avoidElements, body, ariaHidden, inert, {
1539
1047
  mark,
1540
1048
  markerIgnoreElements
@@ -1552,12 +1060,12 @@ function useFloatingPortalNode(props = {}) {
1552
1060
  componentProps = useRenderElement.EMPTY_OBJECT,
1553
1061
  elementProps
1554
1062
  } = props;
1555
- const uniqueId = useId();
1063
+ const uniqueId = useValueChanged.useId();
1556
1064
  const portalContext = usePortalContext();
1557
1065
  const parentPortalNode = portalContext?.portalNode;
1558
1066
  const [containerElement, setContainerElement] = React__namespace.useState(null);
1559
1067
  const [portalNode, setPortalNode] = React__namespace.useState(null);
1560
- const setPortalNodeRef = useStableCallback(node => {
1068
+ const setPortalNodeRef = useValueChanged.useStableCallback(node => {
1561
1069
  if (node !== null) {
1562
1070
  // the useIsoLayoutEffect below watching containerProp / parentPortalNode
1563
1071
  // sets setPortalNode(null) when the container becomes null or changes.
@@ -1566,7 +1074,7 @@ function useFloatingPortalNode(props = {}) {
1566
1074
  }
1567
1075
  });
1568
1076
  const containerRef = React__namespace.useRef(null);
1569
- useIsoLayoutEffect(() => {
1077
+ useValueChanged.useIsoLayoutEffect(() => {
1570
1078
  // Wait for the container to be resolved if explicitly `null`.
1571
1079
  if (containerProp === null) {
1572
1080
  if (containerRef.current) {
@@ -1581,7 +1089,7 @@ function useFloatingPortalNode(props = {}) {
1581
1089
  if (uniqueId == null) {
1582
1090
  return;
1583
1091
  }
1584
- const resolvedContainer = (containerProp && (index_esm.isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;
1092
+ const resolvedContainer = (containerProp && (floatingUi_utils_dom.isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;
1585
1093
  if (resolvedContainer == null) {
1586
1094
  if (containerRef.current) {
1587
1095
  containerRef.current = null;
@@ -1718,7 +1226,7 @@ const FloatingPortal = /*#__PURE__*/React__namespace.forwardRef(function Floatin
1718
1226
  const nextTabbable = getNextTabbable(domReference);
1719
1227
  nextTabbable?.focus();
1720
1228
  if (focusManagerState?.closeOnFocusOut) {
1721
- focusManagerState?.onOpenChange(false, createChangeEventDetails(focusOut, event.nativeEvent));
1229
+ focusManagerState?.onOpenChange(false, useValueChanged.createChangeEventDetails(useValueChanged.focusOut, event.nativeEvent));
1722
1230
  }
1723
1231
  }
1724
1232
  }
@@ -1790,10 +1298,10 @@ const useFloatingTree = externalTree => {
1790
1298
  * @see https://floating-ui.com/docs/FloatingTree
1791
1299
  */
1792
1300
  function useFloatingNodeId(externalTree) {
1793
- const id = useId();
1301
+ const id = useValueChanged.useId();
1794
1302
  const tree = useFloatingTree(externalTree);
1795
1303
  const parentId = useFloatingParentNodeId();
1796
- useIsoLayoutEffect(() => {
1304
+ useValueChanged.useIsoLayoutEffect(() => {
1797
1305
  if (!id) {
1798
1306
  return undefined;
1799
1307
  }
@@ -1850,19 +1358,8 @@ function FloatingTree(props) {
1850
1358
  });
1851
1359
  }
1852
1360
 
1853
- /**
1854
- * If the provided argument is a ref object, returns its `current` value.
1855
- * Otherwise, returns the argument itself.
1856
- */
1857
- function resolveRef(maybeRef) {
1858
- if (maybeRef == null) {
1859
- return maybeRef;
1860
- }
1861
- return 'current' in maybeRef ? maybeRef.current : maybeRef;
1862
- }
1863
-
1864
1361
  function getEventType(event, lastInteractionType) {
1865
- const win = index_esm.getWindow(event.target);
1362
+ const win = floatingUi_utils_dom.getWindow(event.target);
1866
1363
  if (event instanceof win.KeyboardEvent) {
1867
1364
  return 'keyboard';
1868
1365
  }
@@ -1892,7 +1389,7 @@ function clearDisconnectedPreviouslyFocusedElements() {
1892
1389
  }
1893
1390
  function addPreviouslyFocusedElement(element) {
1894
1391
  clearDisconnectedPreviouslyFocusedElements();
1895
- if (element && index_esm.getNodeName(element) !== 'body') {
1392
+ if (element && floatingUi_utils_dom.getNodeName(element) !== 'body') {
1896
1393
  previouslyFocusedElements.push(new WeakRef(element));
1897
1394
  if (previouslyFocusedElements.length > LIST_LIMIT) {
1898
1395
  previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);
@@ -1972,7 +1469,7 @@ function FloatingFocusManager(props) {
1972
1469
  events,
1973
1470
  dataRef
1974
1471
  } = store.context;
1975
- const getNodeId = useStableCallback(() => dataRef.current.floatingContext?.nodeId);
1472
+ const getNodeId = useValueChanged.useStableCallback(() => dataRef.current.floatingContext?.nodeId);
1976
1473
  const ignoreInitialFocus = initialFocus === false;
1977
1474
  // If the reference is a combobox and is typeable (e.g. input/textarea),
1978
1475
  // there are different focus semantics. The guards should not be rendered, but
@@ -1981,9 +1478,9 @@ function FloatingFocusManager(props) {
1981
1478
  // start.
1982
1479
  const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;
1983
1480
  const orderRef = React__namespace.useRef(['content']);
1984
- const initialFocusRef = useValueAsRef(initialFocus);
1985
- const returnFocusRef = useValueAsRef(returnFocus);
1986
- const openInteractionTypeRef = useValueAsRef(openInteractionType);
1481
+ const initialFocusRef = useValueChanged.useValueAsRef(initialFocus);
1482
+ const returnFocusRef = useValueChanged.useValueAsRef(returnFocus);
1483
+ const openInteractionTypeRef = useValueChanged.useValueAsRef(openInteractionType);
1987
1484
  const tree = useFloatingTree(externalTree);
1988
1485
  const portalContext = usePortalContext();
1989
1486
  const preventReturnFocusRef = React__namespace.useRef(false);
@@ -1996,16 +1493,16 @@ function FloatingFocusManager(props) {
1996
1493
  const afterGuardRef = React__namespace.useRef(null);
1997
1494
  const mergedBeforeGuardRef = useRenderElement.useMergedRefs(beforeGuardRef, beforeContentFocusGuardRef, portalContext?.beforeInsideRef);
1998
1495
  const mergedAfterGuardRef = useRenderElement.useMergedRefs(afterGuardRef, portalContext?.afterInsideRef);
1999
- const blurTimeout = useTimeout();
2000
- const pointerDownTimeout = useTimeout();
2001
- const restoreFocusFrame = useAnimationFrame();
1496
+ const blurTimeout = useValueChanged.useTimeout();
1497
+ const pointerDownTimeout = useValueChanged.useTimeout();
1498
+ const restoreFocusFrame = useValueChanged.useAnimationFrame();
2002
1499
  const isInsidePortal = portalContext != null;
2003
1500
  const floatingFocusElement = getFloatingFocusElement(floating);
2004
- const getTabbableContent = useStableCallback((container = floatingFocusElement) => {
1501
+ const getTabbableContent = useValueChanged.useStableCallback((container = floatingFocusElement) => {
2005
1502
  return container ? index_esm.tabbable(container, getTabbableOptions()) : [];
2006
1503
  });
2007
- const getResolvedInsideElements = useStableCallback(() => getInsideElements?.().filter(element => element != null) ?? []);
2008
- const getTabbableElements = useStableCallback(container => {
1504
+ const getResolvedInsideElements = useValueChanged.useStableCallback(() => getInsideElements?.().filter(element => element != null) ?? []);
1505
+ const getTabbableElements = useValueChanged.useStableCallback(container => {
2009
1506
  const content = getTabbableContent(container);
2010
1507
  return orderRef.current.map(() => content).filter(Boolean).flat();
2011
1508
  });
@@ -2018,12 +1515,12 @@ function FloatingFocusManager(props) {
2018
1515
  function onKeyDown(event) {
2019
1516
  if (event.key === 'Tab') {
2020
1517
  // The focus guards have nothing to focus, so we need to stop the event.
2021
- if (contains(floatingFocusElement, activeElement(ownerDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {
2022
- stopEvent(event);
1518
+ if (contains(floatingFocusElement, activeElement(useValueChanged.ownerDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {
1519
+ useValueChanged.stopEvent(event);
2023
1520
  }
2024
1521
  }
2025
1522
  }
2026
- const doc = ownerDocument(floatingFocusElement);
1523
+ const doc = useValueChanged.ownerDocument(floatingFocusElement);
2027
1524
  doc.addEventListener('keydown', onKeyDown);
2028
1525
  return () => {
2029
1526
  doc.removeEventListener('keydown', onKeyDown);
@@ -2035,7 +1532,7 @@ function FloatingFocusManager(props) {
2035
1532
  if (disabled || !open) {
2036
1533
  return undefined;
2037
1534
  }
2038
- const doc = ownerDocument(floatingFocusElement);
1535
+ const doc = useValueChanged.ownerDocument(floatingFocusElement);
2039
1536
  function clearPointerDownOutside() {
2040
1537
  pointerDownOutsideRef.current = false;
2041
1538
  }
@@ -2069,7 +1566,7 @@ function FloatingFocusManager(props) {
2069
1566
  if (disabled || !closeOnFocusOut) {
2070
1567
  return undefined;
2071
1568
  }
2072
- const doc = ownerDocument(floatingFocusElement);
1569
+ const doc = useValueChanged.ownerDocument(floatingFocusElement);
2073
1570
 
2074
1571
  // In Safari, buttons lose focus when pressing them.
2075
1572
  function handlePointerDown() {
@@ -2094,7 +1591,7 @@ function FloatingFocusManager(props) {
2094
1591
  const nodeId = getNodeId();
2095
1592
  const triggers = store.context.triggerElements;
2096
1593
  const insideElements = getResolvedInsideElements();
2097
- const isRelatedFocusGuard = relatedTarget?.hasAttribute(createAttribute('focus-guard')) && [beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeInsideRef.current, portalContext?.afterInsideRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement)].includes(relatedTarget);
1594
+ const isRelatedFocusGuard = relatedTarget?.hasAttribute(createAttribute('focus-guard')) && [beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeInsideRef.current, portalContext?.afterInsideRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, useValueChanged.resolveRef(previousFocusableElement), useValueChanged.resolveRef(nextFocusableElement)].includes(relatedTarget);
2098
1595
  const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext?.portalNode, relatedTarget) || insideElements.some(element => element === relatedTarget || contains(element, relatedTarget)) || relatedTarget != null && triggers.hasElement(relatedTarget) || triggers.hasMatchingElement(trigger => contains(trigger, relatedTarget)) || isRelatedFocusGuard || tree && (getNodeChildren(tree.nodesRef.current, nodeId).find(node => contains(node.context?.elements.floating, relatedTarget) || contains(node.context?.elements.domReference, relatedTarget)) || getNodeAncestors(tree.nodesRef.current, nodeId).find(node => [node.context?.elements.floating, getFloatingFocusElement(node.context?.elements.floating)].includes(relatedTarget) || node.context?.elements.domReference === relatedTarget)));
2099
1596
  if (currentTarget === domReference && floatingFocusElement) {
2100
1597
  handleTabIndex(floatingFocusElement, orderRef);
@@ -2105,7 +1602,7 @@ function FloatingFocusManager(props) {
2105
1602
  if (restoreFocus && currentTarget !== domReference && !isFocusable(target) && activeElement(doc) === doc.body) {
2106
1603
  // Let `FloatingPortal` effect knows that focus is still inside the
2107
1604
  // floating tree.
2108
- if (index_esm.isHTMLElement(floatingFocusElement)) {
1605
+ if (floatingUi_utils_dom.isHTMLElement(floatingFocusElement)) {
2109
1606
  floatingFocusElement.focus();
2110
1607
  // If explicitly requested to restore focus to the popup container, do not search
2111
1608
  // for the next/previous tabbable element.
@@ -2123,7 +1620,7 @@ function FloatingFocusManager(props) {
2123
1620
  const prevTabbableIndex = tabbableIndexRef.current;
2124
1621
  const tabbableContent = getTabbableContent();
2125
1622
  const nodeToFocus = tabbableContent[prevTabbableIndex] || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;
2126
- if (index_esm.isHTMLElement(nodeToFocus)) {
1623
+ if (floatingUi_utils_dom.isHTMLElement(nodeToFocus)) {
2127
1624
  nodeToFocus.focus();
2128
1625
  }
2129
1626
  }
@@ -2146,7 +1643,7 @@ function FloatingFocusManager(props) {
2146
1643
  // Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.
2147
1644
  isUntrappedTypeableCombobox || relatedTarget !== getPreviouslyFocusedElement())) {
2148
1645
  preventReturnFocusRef.current = true;
2149
- store.setOpen(false, createChangeEventDetails(focusOut, event));
1646
+ store.setOpen(false, useValueChanged.createChangeEventDetails(useValueChanged.focusOut, event));
2150
1647
  }
2151
1648
  });
2152
1649
  }
@@ -2159,7 +1656,7 @@ function FloatingFocusManager(props) {
2159
1656
  dataRef.current.insideReactTree = false;
2160
1657
  });
2161
1658
  }
2162
- const domReferenceElement = index_esm.isHTMLElement(domReference) ? domReference : null;
1659
+ const domReferenceElement = floatingUi_utils_dom.isHTMLElement(domReference) ? domReference : null;
2163
1660
  const cleanups = [];
2164
1661
  if (!floating && !domReferenceElement) {
2165
1662
  return undefined;
@@ -2204,7 +1701,7 @@ function FloatingFocusManager(props) {
2204
1701
  const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : [];
2205
1702
  const rootAncestorComboboxDomReference = ancestors.find(node => isTypeableCombobox(node.context?.elements.domReference || null))?.context?.elements.domReference;
2206
1703
  const controlInsideElements = [floating, ...portalNodes, beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, ...getResolvedInsideElements()];
2207
- const insideElements = [...controlInsideElements, rootAncestorComboboxDomReference, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement), isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);
1704
+ const insideElements = [...controlInsideElements, rootAncestorComboboxDomReference, useValueChanged.resolveRef(previousFocusableElement), useValueChanged.resolveRef(nextFocusableElement), isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);
2208
1705
  const ariaHiddenCleanup = markOthers(insideElements, {
2209
1706
  ariaHidden: modal || isUntrappedTypeableCombobox,
2210
1707
  mark: false
@@ -2218,11 +1715,11 @@ function FloatingFocusManager(props) {
2218
1715
  }, [open, disabled, domReference, floating, modal, orderRef, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);
2219
1716
 
2220
1717
  // Focus the initial element when the floating element opens.
2221
- useIsoLayoutEffect(() => {
2222
- if (!open || disabled || !index_esm.isHTMLElement(floatingFocusElement)) {
1718
+ useValueChanged.useIsoLayoutEffect(() => {
1719
+ if (!open || disabled || !floatingUi_utils_dom.isHTMLElement(floatingFocusElement)) {
2223
1720
  return;
2224
1721
  }
2225
- const doc = ownerDocument(floatingFocusElement);
1722
+ const doc = useValueChanged.ownerDocument(floatingFocusElement);
2226
1723
  const previouslyFocusedElement = activeElement(doc);
2227
1724
 
2228
1725
  // Wait for any layout effect state setters to execute to set `tabIndex`.
@@ -2239,7 +1736,7 @@ function FloatingFocusManager(props) {
2239
1736
  if (resolvedInitialFocus === true || resolvedInitialFocus === null) {
2240
1737
  elToFocus = focusableElements[0] || floatingFocusElement;
2241
1738
  } else {
2242
- elToFocus = resolveRef(resolvedInitialFocus);
1739
+ elToFocus = useValueChanged.resolveRef(resolvedInitialFocus);
2243
1740
  }
2244
1741
  elToFocus = elToFocus || focusableElements[0] || floatingFocusElement;
2245
1742
  const focusAlreadyInsideFloatingEl = contains(floatingFocusElement, previouslyFocusedElement);
@@ -2253,11 +1750,11 @@ function FloatingFocusManager(props) {
2253
1750
  }, [disabled, open, floatingFocusElement, ignoreInitialFocus, getTabbableElements, initialFocusRef, openInteractionTypeRef]);
2254
1751
 
2255
1752
  // Track return focus targets and restore focus on unmount/close.
2256
- useIsoLayoutEffect(() => {
1753
+ useValueChanged.useIsoLayoutEffect(() => {
2257
1754
  if (disabled || !floatingFocusElement) {
2258
1755
  return undefined;
2259
1756
  }
2260
- const doc = ownerDocument(floatingFocusElement);
1757
+ const doc = useValueChanged.ownerDocument(floatingFocusElement);
2261
1758
  const previouslyFocusedElement = activeElement(doc);
2262
1759
  addPreviouslyFocusedElement(previouslyFocusedElement);
2263
1760
 
@@ -2267,15 +1764,15 @@ function FloatingFocusManager(props) {
2267
1764
  if (!details.open) {
2268
1765
  closeTypeRef.current = getEventType(details.nativeEvent, lastInteractionTypeRef.current);
2269
1766
  }
2270
- if (details.reason === triggerHover && details.nativeEvent.type === 'mouseleave') {
1767
+ if (details.reason === useValueChanged.triggerHover && details.nativeEvent.type === 'mouseleave') {
2271
1768
  preventReturnFocusRef.current = true;
2272
1769
  }
2273
- if (details.reason !== outsidePress) {
1770
+ if (details.reason !== useValueChanged.outsidePress) {
2274
1771
  return;
2275
1772
  }
2276
1773
  if (details.nested) {
2277
1774
  preventReturnFocusRef.current = false;
2278
- } else if (isVirtualClick(details.nativeEvent) || isVirtualPointerEvent(details.nativeEvent)) {
1775
+ } else if (useValueChanged.isVirtualClick(details.nativeEvent) || useValueChanged.isVirtualPointerEvent(details.nativeEvent)) {
2279
1776
  preventReturnFocusRef.current = false;
2280
1777
  } else {
2281
1778
  let isPreventScrollSupported = false;
@@ -2309,7 +1806,7 @@ function FloatingFocusManager(props) {
2309
1806
  return el && el.isConnected ? el : null;
2310
1807
  }
2311
1808
  const fallback = domReference || getPreviouslyFocusedElement();
2312
- return resolveRef(resolvedReturnFocusValue) || fallback || null;
1809
+ return useValueChanged.resolveRef(resolvedReturnFocusValue) || fallback || null;
2313
1810
  }
2314
1811
  return () => {
2315
1812
  events.off('openchange', onOpenChangeLocal);
@@ -2323,7 +1820,7 @@ function FloatingFocusManager(props) {
2323
1820
  const hasExplicitReturnFocus = typeof returnFocusRef.current !== 'boolean';
2324
1821
  if (
2325
1822
  // eslint-disable-next-line react-hooks/exhaustive-deps
2326
- returnFocusRef.current && !preventReturnFocusRef.current && index_esm.isHTMLElement(tabbableReturnElement) && (
1823
+ returnFocusRef.current && !preventReturnFocusRef.current && floatingUi_utils_dom.isHTMLElement(tabbableReturnElement) && (
2327
1824
  // If the focus moved somewhere else after mount, avoid returning focus
2328
1825
  // since it likely entered a different element which should be
2329
1826
  // respected: https://github.com/floating-ui/floating-ui/issues/2607
@@ -2340,12 +1837,12 @@ function FloatingFocusManager(props) {
2340
1837
  // Safari may randomly scroll to the bottom of the page if an input inside a popup has focus
2341
1838
  // when the popup unmounts from the DOM.
2342
1839
  // By blurring it before the popup unmounts, we can prevent this behavior.
2343
- useIsoLayoutEffect(() => {
2344
- if (!isWebKit || open || !floating) {
1840
+ useValueChanged.useIsoLayoutEffect(() => {
1841
+ if (!useValueChanged.isWebKit || open || !floating) {
2345
1842
  return;
2346
1843
  }
2347
- const activeEl = activeElement(ownerDocument(floating));
2348
- if (!index_esm.isHTMLElement(activeEl) || !isTypeableElement(activeEl)) {
1844
+ const activeEl = activeElement(useValueChanged.ownerDocument(floating));
1845
+ if (!floatingUi_utils_dom.isHTMLElement(activeEl) || !isTypeableElement(activeEl)) {
2349
1846
  return;
2350
1847
  }
2351
1848
  if (contains(floating, activeEl)) {
@@ -2354,7 +1851,7 @@ function FloatingFocusManager(props) {
2354
1851
  }, [open, floating]);
2355
1852
  // Synchronize the `context` & `modal` value to the FloatingPortal context.
2356
1853
  // It will decide whether or not it needs to render its own guards.
2357
- useIsoLayoutEffect(() => {
1854
+ useValueChanged.useIsoLayoutEffect(() => {
2358
1855
  if (disabled || !portalContext) {
2359
1856
  return undefined;
2360
1857
  }
@@ -2371,7 +1868,7 @@ function FloatingFocusManager(props) {
2371
1868
  }, [disabled, portalContext, modal, open, store, closeOnFocusOut, domReference]);
2372
1869
 
2373
1870
  // Keep the floating element tabIndex in sync and clear stale focus records.
2374
- useIsoLayoutEffect(() => {
1871
+ useValueChanged.useIsoLayoutEffect(() => {
2375
1872
  if (disabled || !floatingFocusElement) {
2376
1873
  return undefined;
2377
1874
  }
@@ -2395,7 +1892,7 @@ function FloatingFocusManager(props) {
2395
1892
  const nextTabbable = getNextTabbable(domReference);
2396
1893
  nextTabbable?.focus();
2397
1894
  } else {
2398
- resolveRef(previousFocusableElement ?? portalContext.beforeOutsideRef)?.focus();
1895
+ useValueChanged.resolveRef(previousFocusableElement ?? portalContext.beforeOutsideRef)?.focus();
2399
1896
  }
2400
1897
  }
2401
1898
  }
@@ -2413,7 +1910,7 @@ function FloatingFocusManager(props) {
2413
1910
  const prevTabbable = getPreviousTabbable(domReference);
2414
1911
  prevTabbable?.focus();
2415
1912
  } else {
2416
- resolveRef(nextFocusableElement ?? portalContext.afterOutsideRef)?.focus();
1913
+ useValueChanged.resolveRef(nextFocusableElement ?? portalContext.afterOutsideRef)?.focus();
2417
1914
  }
2418
1915
  }
2419
1916
  }
@@ -2448,7 +1945,7 @@ function useDismiss(context, props = {}) {
2448
1945
  } = store.context;
2449
1946
  const {
2450
1947
  enabled = true,
2451
- escapeKey: escapeKey$1 = true,
1948
+ escapeKey = true,
2452
1949
  outsidePress: outsidePressProp = true,
2453
1950
  outsidePressEvent = 'sloppy',
2454
1951
  referencePress = alwaysFalse,
@@ -2457,10 +1954,10 @@ function useDismiss(context, props = {}) {
2457
1954
  externalTree
2458
1955
  } = props;
2459
1956
  const tree = useFloatingTree(externalTree);
2460
- const outsidePressFn = useStableCallback(typeof outsidePressProp === 'function' ? outsidePressProp : () => false);
2461
- const outsidePress$1 = typeof outsidePressProp === 'function' ? outsidePressFn : outsidePressProp;
2462
- const outsidePressEnabled = outsidePress$1 !== false;
2463
- const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);
1957
+ const outsidePressFn = useValueChanged.useStableCallback(typeof outsidePressProp === 'function' ? outsidePressProp : () => false);
1958
+ const outsidePress = typeof outsidePressProp === 'function' ? outsidePressFn : outsidePressProp;
1959
+ const outsidePressEnabled = outsidePress !== false;
1960
+ const getOutsidePressEventProp = useValueChanged.useStableCallback(() => outsidePressEvent);
2464
1961
  const pressStartedInsideRef = React__namespace.useRef(false);
2465
1962
  const pressStartPreventedRef = React__namespace.useRef(false);
2466
1963
  // Ignore only the very next outside click after dragging from inside to outside.
@@ -2470,17 +1967,17 @@ function useDismiss(context, props = {}) {
2470
1967
  outsidePress: outsidePressBubbles
2471
1968
  } = normalizeProp(bubbles);
2472
1969
  const touchStateRef = React__namespace.useRef(null);
2473
- const cancelDismissOnEndTimeout = useTimeout();
2474
- const clearInsideReactTreeTimeout = useTimeout();
2475
- const clearInsideReactTree = useStableCallback(() => {
1970
+ const cancelDismissOnEndTimeout = useValueChanged.useTimeout();
1971
+ const clearInsideReactTreeTimeout = useValueChanged.useTimeout();
1972
+ const clearInsideReactTree = useValueChanged.useStableCallback(() => {
2476
1973
  clearInsideReactTreeTimeout.clear();
2477
1974
  dataRef.current.insideReactTree = false;
2478
1975
  });
2479
1976
  const isComposingRef = React__namespace.useRef(false);
2480
1977
  const currentPointerTypeRef = React__namespace.useRef('');
2481
- const isReferencePressEnabled = useStableCallback(referencePress);
2482
- const closeOnEscapeKeyDown = useStableCallback(event => {
2483
- if (!open || !enabled || !escapeKey$1 || event.key !== 'Escape') {
1978
+ const isReferencePressEnabled = useValueChanged.useStableCallback(referencePress);
1979
+ const closeOnEscapeKeyDown = useValueChanged.useStableCallback(event => {
1980
+ if (!open || !enabled || !escapeKey || event.key !== 'Escape') {
2484
1981
  return;
2485
1982
  }
2486
1983
 
@@ -2504,14 +2001,14 @@ function useDismiss(context, props = {}) {
2504
2001
  }
2505
2002
  }
2506
2003
  }
2507
- const native = isReactEvent(event) ? event.nativeEvent : event;
2508
- const eventDetails = createChangeEventDetails(escapeKey, native);
2004
+ const native = useValueChanged.isReactEvent(event) ? event.nativeEvent : event;
2005
+ const eventDetails = useValueChanged.createChangeEventDetails(useValueChanged.escapeKey, native);
2509
2006
  store.setOpen(false, eventDetails);
2510
2007
  if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {
2511
2008
  event.stopPropagation();
2512
2009
  }
2513
2010
  });
2514
- const markInsideReactTree = useStableCallback(() => {
2011
+ const markInsideReactTree = useValueChanged.useStableCallback(() => {
2515
2012
  dataRef.current.insideReactTree = true;
2516
2013
  clearInsideReactTreeTimeout.start(0, clearInsideReactTree);
2517
2014
  });
@@ -2521,8 +2018,8 @@ function useDismiss(context, props = {}) {
2521
2018
  }
2522
2019
  dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;
2523
2020
  dataRef.current.__outsidePressBubbles = outsidePressBubbles;
2524
- const compositionTimeout = new Timeout();
2525
- const preventedPressSuppressionTimeout = new Timeout();
2021
+ const compositionTimeout = new useValueChanged.Timeout();
2022
+ const preventedPressSuppressionTimeout = new useValueChanged.Timeout();
2526
2023
  function handleCompositionStart() {
2527
2024
  compositionTimeout.clear();
2528
2025
  isComposingRef.current = true;
@@ -2534,7 +2031,7 @@ function useDismiss(context, props = {}) {
2534
2031
  compositionTimeout.start(
2535
2032
  // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
2536
2033
  // Only apply to WebKit for the test to remain 0ms.
2537
- index_esm.isWebKit() ? 5 : 0, () => {
2034
+ floatingUi_utils_dom.isWebKit() ? 5 : 0, () => {
2538
2035
  isComposingRef.current = false;
2539
2036
  });
2540
2037
  }
@@ -2580,9 +2077,9 @@ function useDismiss(context, props = {}) {
2580
2077
  }
2581
2078
  const target = getTarget(event);
2582
2079
  const inertSelector = `[${createAttribute('inert')}]`;
2583
- let markers = Array.from(ownerDocument(store.select('floatingElement')).querySelectorAll(inertSelector));
2584
- const targetRoot = index_esm.isElement(target) ? target.getRootNode() : null;
2585
- if (index_esm.isShadowRoot(targetRoot)) {
2080
+ let markers = Array.from(useValueChanged.ownerDocument(store.select('floatingElement')).querySelectorAll(inertSelector));
2081
+ const targetRoot = floatingUi_utils_dom.isElement(target) ? target.getRootNode() : null;
2082
+ if (floatingUi_utils_dom.isShadowRoot(targetRoot)) {
2586
2083
  markers = markers.concat(Array.from(targetRoot.querySelectorAll(inertSelector)));
2587
2084
  }
2588
2085
  const triggers = store.context.triggerElements;
@@ -2591,10 +2088,10 @@ function useDismiss(context, props = {}) {
2591
2088
  if (target && (triggers.hasElement(target) || triggers.hasMatchingElement(trigger => contains(trigger, target)))) {
2592
2089
  return;
2593
2090
  }
2594
- let targetRootAncestor = index_esm.isElement(target) ? target : null;
2595
- while (targetRootAncestor && !index_esm.isLastTraversableNode(targetRootAncestor)) {
2596
- const nextParent = index_esm.getParentNode(targetRootAncestor);
2597
- if (index_esm.isLastTraversableNode(nextParent) || !index_esm.isElement(nextParent)) {
2091
+ let targetRootAncestor = floatingUi_utils_dom.isElement(target) ? target : null;
2092
+ while (targetRootAncestor && !floatingUi_utils_dom.isLastTraversableNode(targetRootAncestor)) {
2093
+ const nextParent = floatingUi_utils_dom.getParentNode(targetRootAncestor);
2094
+ if (floatingUi_utils_dom.isLastTraversableNode(nextParent) || !floatingUi_utils_dom.isElement(nextParent)) {
2598
2095
  break;
2599
2096
  }
2600
2097
  targetRootAncestor = nextParent;
@@ -2602,7 +2099,7 @@ function useDismiss(context, props = {}) {
2602
2099
 
2603
2100
  // Check if the click occurred on a third-party element injected after the
2604
2101
  // floating element rendered.
2605
- if (markers.length && index_esm.isElement(target) && !isRootElement(target) &&
2102
+ if (markers.length && floatingUi_utils_dom.isElement(target) && !isRootElement(target) &&
2606
2103
  // Clicked on a direct ancestor (e.g. FloatingOverlay).
2607
2104
  !contains(target, store.select('floatingElement')) &&
2608
2105
  // If the target root element contains none of the markers, then the
@@ -2613,9 +2110,9 @@ function useDismiss(context, props = {}) {
2613
2110
 
2614
2111
  // Check if the click occurred on the scrollbar
2615
2112
  // Skip for touch events: scrollbars don't receive touch events on most platforms
2616
- if (index_esm.isHTMLElement(target) && !('touches' in event)) {
2617
- const lastTraversableNode = index_esm.isLastTraversableNode(target);
2618
- const style = index_esm.getComputedStyle(target);
2113
+ if (floatingUi_utils_dom.isHTMLElement(target) && !('touches' in event)) {
2114
+ const lastTraversableNode = floatingUi_utils_dom.isLastTraversableNode(target);
2115
+ const style = floatingUi_utils_dom.getComputedStyle(target);
2619
2116
  const scrollRe = /auto|scroll/;
2620
2117
  const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
2621
2118
  const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);
@@ -2646,7 +2143,7 @@ function useDismiss(context, props = {}) {
2646
2143
  suppressNextOutsideClickRef.current = false;
2647
2144
  return;
2648
2145
  }
2649
- if (typeof outsidePress$1 === 'function' && !outsidePress$1(event)) {
2146
+ if (typeof outsidePress === 'function' && !outsidePress(event)) {
2650
2147
  return;
2651
2148
  }
2652
2149
  const nodeId = dataRef.current.floatingContext?.nodeId;
@@ -2662,7 +2159,7 @@ function useDismiss(context, props = {}) {
2662
2159
  return;
2663
2160
  }
2664
2161
  }
2665
- store.setOpen(false, createChangeEventDetails(outsidePress, event));
2162
+ store.setOpen(false, useValueChanged.createChangeEventDetails(useValueChanged.outsidePress, event));
2666
2163
  clearInsideReactTree();
2667
2164
  }
2668
2165
  function handlePointerDown(event) {
@@ -2749,7 +2246,7 @@ function useDismiss(context, props = {}) {
2749
2246
  }
2750
2247
 
2751
2248
  // Avoid suppressing when outsidePress explicitly ignores this target.
2752
- if (typeof outsidePress$1 === 'function' && !outsidePress$1(event)) {
2249
+ if (typeof outsidePress === 'function' && !outsidePress(event)) {
2753
2250
  return;
2754
2251
  }
2755
2252
  preventedPressSuppressionTimeout.clear();
@@ -2802,8 +2299,8 @@ function useDismiss(context, props = {}) {
2802
2299
  }
2803
2300
  target?.addEventListener(event.type, callback);
2804
2301
  }
2805
- const doc = ownerDocument(floatingElement);
2806
- if (escapeKey$1) {
2302
+ const doc = useValueChanged.ownerDocument(floatingElement);
2303
+ if (escapeKey) {
2807
2304
  doc.addEventListener('keydown', closeOnEscapeKeyDown);
2808
2305
  doc.addEventListener('compositionstart', handleCompositionStart);
2809
2306
  doc.addEventListener('compositionend', handleCompositionEnd);
@@ -2820,7 +2317,7 @@ function useDismiss(context, props = {}) {
2820
2317
  doc.addEventListener('touchend', handleTouchEndCapture, true);
2821
2318
  }
2822
2319
  return () => {
2823
- if (escapeKey$1) {
2320
+ if (escapeKey) {
2824
2321
  doc.removeEventListener('keydown', closeOnEscapeKeyDown);
2825
2322
  doc.removeEventListener('compositionstart', handleCompositionStart);
2826
2323
  doc.removeEventListener('compositionend', handleCompositionEnd);
@@ -2841,26 +2338,26 @@ function useDismiss(context, props = {}) {
2841
2338
  resetPressStartState();
2842
2339
  suppressNextOutsideClickRef.current = false;
2843
2340
  };
2844
- }, [dataRef, floatingElement, escapeKey$1, outsidePressEnabled, outsidePress$1, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, tree, store, cancelDismissOnEndTimeout]);
2845
- React__namespace.useEffect(clearInsideReactTree, [outsidePress$1, clearInsideReactTree]);
2341
+ }, [dataRef, floatingElement, escapeKey, outsidePressEnabled, outsidePress, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, tree, store, cancelDismissOnEndTimeout]);
2342
+ React__namespace.useEffect(clearInsideReactTree, [outsidePress, clearInsideReactTree]);
2846
2343
  const reference = React__namespace.useMemo(() => ({
2847
2344
  onKeyDown: closeOnEscapeKeyDown,
2848
2345
  [bubbleHandlerKeys[referencePressEvent]]: event => {
2849
2346
  if (!isReferencePressEnabled()) {
2850
2347
  return;
2851
2348
  }
2852
- store.setOpen(false, createChangeEventDetails(triggerPress, event.nativeEvent));
2349
+ store.setOpen(false, useValueChanged.createChangeEventDetails(useValueChanged.triggerPress, event.nativeEvent));
2853
2350
  },
2854
2351
  ...(referencePressEvent !== 'intentional' && {
2855
2352
  onClick(event) {
2856
2353
  if (!isReferencePressEnabled()) {
2857
2354
  return;
2858
2355
  }
2859
- store.setOpen(false, createChangeEventDetails(triggerPress, event.nativeEvent));
2356
+ store.setOpen(false, useValueChanged.createChangeEventDetails(useValueChanged.triggerPress, event.nativeEvent));
2860
2357
  }
2861
2358
  })
2862
2359
  }), [closeOnEscapeKeyDown, store, referencePressEvent, isReferencePressEnabled]);
2863
- const markPressStartedInsideReactTree = useStableCallback(event => {
2360
+ const markPressStartedInsideReactTree = useValueChanged.useStableCallback(event => {
2864
2361
  if (!open || !enabled || event.button !== 0) {
2865
2362
  return;
2866
2363
  }
@@ -2875,7 +2372,7 @@ function useDismiss(context, props = {}) {
2875
2372
  pressStartPreventedRef.current = false;
2876
2373
  }
2877
2374
  });
2878
- const markInsidePressStartPrevented = useStableCallback(event => {
2375
+ const markInsidePressStartPrevented = useValueChanged.useStableCallback(event => {
2879
2376
  if (!open || !enabled) {
2880
2377
  return;
2881
2378
  }
@@ -4101,7 +3598,7 @@ class ReactStore extends Store {
4101
3598
  */
4102
3599
  useSyncedValue(key, value) {
4103
3600
  React__namespace.useDebugValue(key);
4104
- useIsoLayoutEffect(() => {
3601
+ useValueChanged.useIsoLayoutEffect(() => {
4105
3602
  if (this.state[key] !== value) {
4106
3603
  this.set(key, value);
4107
3604
  }
@@ -4118,7 +3615,7 @@ class ReactStore extends Store {
4118
3615
  useSyncedValueWithCleanup(key, value) {
4119
3616
  // eslint-disable-next-line consistent-this
4120
3617
  const store = this;
4121
- useIsoLayoutEffect(() => {
3618
+ useValueChanged.useIsoLayoutEffect(() => {
4122
3619
  if (store.state[key] !== value) {
4123
3620
  store.set(key, value);
4124
3621
  }
@@ -4147,7 +3644,7 @@ class ReactStore extends Store {
4147
3644
  }
4148
3645
  }
4149
3646
  const dependencies = Object.values(statePart);
4150
- useIsoLayoutEffect(() => {
3647
+ useValueChanged.useIsoLayoutEffect(() => {
4151
3648
  store.update(statePart);
4152
3649
  // eslint-disable-next-line react-hooks/exhaustive-deps
4153
3650
  }, [store, ...dependencies]);
@@ -4160,7 +3657,7 @@ class ReactStore extends Store {
4160
3657
  useControlledProp(key, controlled) {
4161
3658
  React__namespace.useDebugValue(key);
4162
3659
  const isControlled = controlled !== undefined;
4163
- useIsoLayoutEffect(() => {
3660
+ useValueChanged.useIsoLayoutEffect(() => {
4164
3661
  if (isControlled && !Object.is(this.state[key], controlled)) {
4165
3662
  // Set the internal state to match the controlled value.
4166
3663
  super.setState({
@@ -4214,7 +3711,7 @@ class ReactStore extends Store {
4214
3711
  */
4215
3712
  useContextCallback(key, fn) {
4216
3713
  React__namespace.useDebugValue(key);
4217
- const stableFunction = useStableCallback(fn ?? useRenderElement.NOOP);
3714
+ const stableFunction = useValueChanged.useStableCallback(fn ?? useRenderElement.NOOP);
4218
3715
  this.context[key] = stableFunction;
4219
3716
  }
4220
3717
 
@@ -4303,7 +3800,7 @@ class FloatingRootStore extends ReactStore {
4303
3800
  if (!newOpen || !this.state.open ||
4304
3801
  // Prevent a pending hover-open from overwriting a click-open event, while allowing
4305
3802
  // click events to upgrade a hover-open.
4306
- isClickLikeEvent(eventDetails.event)) {
3803
+ useValueChanged.isClickLikeEvent(eventDetails.event)) {
4307
3804
  this.context.dataRef.current.openEvent = newOpen ? eventDetails.event : undefined;
4308
3805
  }
4309
3806
  if (!this.context.noEmit) {
@@ -4320,178 +3817,6 @@ class FloatingRootStore extends ReactStore {
4320
3817
  };
4321
3818
  }
4322
3819
 
4323
- /**
4324
- * Provides a status string for CSS animations.
4325
- * @param open - a boolean that determines if the element is open.
4326
- * @param enableIdleState - a boolean that enables the `'idle'` state between `'starting'` and `'ending'`
4327
- */
4328
- function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) {
4329
- const [transitionStatus, setTransitionStatus] = React__namespace.useState(open && enableIdleState ? 'idle' : undefined);
4330
- const [mounted, setMounted] = React__namespace.useState(open);
4331
- if (open && !mounted) {
4332
- setMounted(true);
4333
- setTransitionStatus('starting');
4334
- }
4335
- if (!open && mounted && transitionStatus !== 'ending' && !deferEndingState) {
4336
- setTransitionStatus('ending');
4337
- }
4338
- if (!open && !mounted && transitionStatus === 'ending') {
4339
- setTransitionStatus(undefined);
4340
- }
4341
- useIsoLayoutEffect(() => {
4342
- if (!open && mounted && transitionStatus !== 'ending' && deferEndingState) {
4343
- const frame = AnimationFrame.request(() => {
4344
- setTransitionStatus('ending');
4345
- });
4346
- return () => {
4347
- AnimationFrame.cancel(frame);
4348
- };
4349
- }
4350
- return undefined;
4351
- }, [open, mounted, transitionStatus, deferEndingState]);
4352
- useIsoLayoutEffect(() => {
4353
- if (!open || enableIdleState) {
4354
- return undefined;
4355
- }
4356
- const frame = AnimationFrame.request(() => {
4357
- // Avoid `flushSync` here due to Firefox.
4358
- // See https://github.com/mui/base-ui/pull/3424
4359
- setTransitionStatus(undefined);
4360
- });
4361
- return () => {
4362
- AnimationFrame.cancel(frame);
4363
- };
4364
- }, [enableIdleState, open]);
4365
- useIsoLayoutEffect(() => {
4366
- if (!open || !enableIdleState) {
4367
- return undefined;
4368
- }
4369
- if (open && mounted && transitionStatus !== 'idle') {
4370
- setTransitionStatus('starting');
4371
- }
4372
- const frame = AnimationFrame.request(() => {
4373
- setTransitionStatus('idle');
4374
- });
4375
- return () => {
4376
- AnimationFrame.cancel(frame);
4377
- };
4378
- }, [enableIdleState, open, mounted, setTransitionStatus, transitionStatus]);
4379
- return React__namespace.useMemo(() => ({
4380
- mounted,
4381
- setMounted,
4382
- transitionStatus
4383
- }), [mounted, transitionStatus]);
4384
- }
4385
-
4386
- /**
4387
- * Executes a function once all animations have finished on the provided element.
4388
- * @param elementOrRef - The element to watch for animations.
4389
- * @param waitForStartingStyleRemoved - Whether to wait for [data-starting-style] to be removed before checking for animations.
4390
- * @param treatAbortedAsFinished - Whether to treat aborted animations as finished. If `false`, and there are aborted animations,
4391
- * the function will check again if any new animations have started and wait for them to finish.
4392
- * @returns A function that takes a callback to execute once all animations have finished, and an optional AbortSignal to abort the callback
4393
- */
4394
- function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) {
4395
- const frame = useAnimationFrame();
4396
- return useStableCallback((fnToExecute,
4397
- /**
4398
- * An optional [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
4399
- * can be used to abort `fnToExecute` before all the animations have finished.
4400
- * @default null
4401
- */
4402
- signal = null) => {
4403
- frame.cancel();
4404
- function done() {
4405
- // Synchronously flush the unmounting of the component so that the browser doesn't
4406
- // paint: https://github.com/mui/base-ui/issues/979
4407
- ReactDOM__namespace.flushSync(fnToExecute);
4408
- }
4409
- const element = resolveRef(elementOrRef);
4410
- if (element == null) {
4411
- return;
4412
- }
4413
- const resolvedElement = element;
4414
- if (typeof resolvedElement.getAnimations !== 'function' || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
4415
- fnToExecute();
4416
- } else {
4417
- function execWaitForStartingStyleRemoved() {
4418
- const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;
4419
-
4420
- // If `[data-starting-style]` isn't present, fall back to waiting one more frame
4421
- // to give "open" animations a chance to be registered.
4422
- if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
4423
- frame.request(exec);
4424
- return;
4425
- }
4426
-
4427
- // Wait for `[data-starting-style]` to have been removed.
4428
- const attributeObserver = new MutationObserver(() => {
4429
- if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
4430
- attributeObserver.disconnect();
4431
- exec();
4432
- }
4433
- });
4434
- attributeObserver.observe(resolvedElement, {
4435
- attributes: true,
4436
- attributeFilter: [startingStyleAttribute]
4437
- });
4438
- signal?.addEventListener('abort', () => attributeObserver.disconnect(), {
4439
- once: true
4440
- });
4441
- }
4442
- function exec() {
4443
- Promise.all(resolvedElement.getAnimations().map(anim => anim.finished)).then(() => {
4444
- if (signal?.aborted) {
4445
- return;
4446
- }
4447
- done();
4448
- }).catch(() => {
4449
- const currentAnimations = resolvedElement.getAnimations();
4450
- if (treatAbortedAsFinished) {
4451
- if (signal?.aborted) {
4452
- return;
4453
- }
4454
- done();
4455
- } else if (currentAnimations.length > 0 && currentAnimations.some(anim => anim.pending || anim.playState !== 'finished')) {
4456
- // Sometimes animations can be aborted because a property they depend on changes while the animation plays.
4457
- // In such cases, we need to re-check if any new animations have started.
4458
- exec();
4459
- }
4460
- });
4461
- }
4462
- if (waitForStartingStyleRemoved) {
4463
- execWaitForStartingStyleRemoved();
4464
- return;
4465
- }
4466
- frame.request(exec);
4467
- }
4468
- });
4469
- }
4470
-
4471
- /**
4472
- * Calls the provided function when the CSS open/close animation or transition completes.
4473
- */
4474
- function useOpenChangeComplete(parameters) {
4475
- const {
4476
- enabled = true,
4477
- open,
4478
- ref,
4479
- onComplete: onCompleteParam
4480
- } = parameters;
4481
- const onComplete = useStableCallback(onCompleteParam);
4482
- const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false);
4483
- React__namespace.useEffect(() => {
4484
- if (!enabled) {
4485
- return undefined;
4486
- }
4487
- const abortController = new AbortController();
4488
- runOnceAnimationsFinish(onComplete, abortController.signal);
4489
- return () => {
4490
- abortController.abort();
4491
- };
4492
- }, [enabled, open, onComplete, runOnceAnimationsFinish]);
4493
- }
4494
-
4495
3820
  /**
4496
3821
  * Returns a callback ref that registers/unregisters the trigger element in the store.
4497
3822
  *
@@ -4534,7 +3859,7 @@ function useTriggerRegistration(id, store) {
4534
3859
  function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {
4535
3860
  const isMountedByThisTrigger = store.useState('isMountedByTrigger', triggerId);
4536
3861
  const baseRegisterTrigger = useTriggerRegistration(triggerId, store);
4537
- const registerTrigger = useStableCallback(element => {
3862
+ const registerTrigger = useValueChanged.useStableCallback(element => {
4538
3863
  baseRegisterTrigger(element);
4539
3864
  if (!element || !store.select('open')) {
4540
3865
  return;
@@ -4559,7 +3884,7 @@ function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpda
4559
3884
  });
4560
3885
  }
4561
3886
  });
4562
- useIsoLayoutEffect(() => {
3887
+ useValueChanged.useIsoLayoutEffect(() => {
4563
3888
  if (isMountedByThisTrigger) {
4564
3889
  store.update({
4565
3890
  activeTriggerElement: triggerElementRef.current,
@@ -4585,7 +3910,7 @@ function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpda
4585
3910
  */
4586
3911
  function useImplicitActiveTrigger(store) {
4587
3912
  const open = store.useState('open');
4588
- useIsoLayoutEffect(() => {
3913
+ useValueChanged.useIsoLayoutEffect(() => {
4589
3914
  if (open && !store.select('activeTriggerId') && store.context.triggerElements.size === 1) {
4590
3915
  const iteratorResult = store.context.triggerElements.entries().next();
4591
3916
  if (!iteratorResult.done) {
@@ -4615,12 +3940,12 @@ function useOpenStateTransitions(open, store, onUnmount) {
4615
3940
  mounted,
4616
3941
  setMounted,
4617
3942
  transitionStatus
4618
- } = useTransitionStatus(open);
3943
+ } = useValueChanged.useTransitionStatus(open);
4619
3944
  store.useSyncedValues({
4620
3945
  mounted,
4621
3946
  transitionStatus
4622
3947
  });
4623
- const forceUnmount = useStableCallback(() => {
3948
+ const forceUnmount = useValueChanged.useStableCallback(() => {
4624
3949
  setMounted(false);
4625
3950
  store.update({
4626
3951
  activeTriggerId: null,
@@ -4631,7 +3956,7 @@ function useOpenStateTransitions(open, store, onUnmount) {
4631
3956
  store.context.onOpenChangeComplete?.(false);
4632
3957
  });
4633
3958
  const preventUnmountingOnClose = store.useState('preventUnmountingOnClose');
4634
- useOpenChangeComplete({
3959
+ useValueChanged.useOpenChangeComplete({
4635
3960
  enabled: !preventUnmountingOnClose,
4636
3961
  open,
4637
3962
  ref: store.context.popupRef,
@@ -4815,7 +4140,7 @@ function useSyncedFloatingRootContext(options) {
4815
4140
  treatPopupAsFloatingElement = false,
4816
4141
  onOpenChange
4817
4142
  } = options;
4818
- const floatingId = useId();
4143
+ const floatingId = useValueChanged.useId();
4819
4144
  const nested = useFloatingParentNodeId() != null;
4820
4145
  const open = popupStore.useState('open');
4821
4146
  const referenceElement = popupStore.useState('activeTriggerElement');
@@ -4831,14 +4156,14 @@ function useSyncedFloatingRootContext(options) {
4831
4156
  nested,
4832
4157
  noEmit
4833
4158
  })).current;
4834
- useIsoLayoutEffect(() => {
4159
+ useValueChanged.useIsoLayoutEffect(() => {
4835
4160
  const valuesToSync = {
4836
4161
  open,
4837
4162
  floatingId,
4838
4163
  referenceElement,
4839
4164
  floatingElement
4840
4165
  };
4841
- if (index_esm.isElement(referenceElement)) {
4166
+ if (floatingUi_utils_dom.isElement(referenceElement)) {
4842
4167
  valuesToSync.domReferenceElement = referenceElement;
4843
4168
  }
4844
4169
  if (store.state.positionReference === store.state.referenceElement) {
@@ -4957,7 +4282,7 @@ function useRole(context, props = {}) {
4957
4282
  const {
4958
4283
  role = 'dialog'
4959
4284
  } = props;
4960
- const defaultReferenceId = useId();
4285
+ const defaultReferenceId = useValueChanged.useId();
4961
4286
  const referenceId = domReference?.id || defaultReferenceId;
4962
4287
  const floatingId = React__namespace.useMemo(() => getFloatingFocusElement(floatingElement)?.id || defaultFloatingId, [floatingElement, defaultFloatingId]);
4963
4288
  const ariaRole = componentRoleToAriaRoleMap.get(role) ?? role;
@@ -5126,10 +4451,6 @@ function useDrawerRootContext(optional) {
5126
4451
  return drawerRootContext;
5127
4452
  }
5128
4453
 
5129
- function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
5130
- return Math.max(min, Math.min(val, max));
5131
- }
5132
-
5133
4454
  function resolveSnapPointValue(snapPoint, viewportHeight, rootFontSize) {
5134
4455
  if (!Number.isFinite(viewportHeight) || viewportHeight <= 0) {
5135
4456
  return null;
@@ -5139,7 +4460,7 @@ function resolveSnapPointValue(snapPoint, viewportHeight, rootFontSize) {
5139
4460
  return null;
5140
4461
  }
5141
4462
  if (snapPoint <= 1) {
5142
- return clamp(snapPoint, 0, 1) * viewportHeight;
4463
+ return useValueChanged.clamp(snapPoint, 0, 1) * viewportHeight;
5143
4464
  }
5144
4465
  return snapPoint;
5145
4466
  }
@@ -5179,8 +4500,8 @@ function useDrawerSnapPoints() {
5179
4500
  const viewportElement = store.useState('viewportElement');
5180
4501
  const [viewportHeight, setViewportHeight] = React__namespace.useState(0);
5181
4502
  const [rootFontSize, setRootFontSize] = React__namespace.useState(16);
5182
- const measureViewportHeight = useStableCallback(() => {
5183
- const doc = ownerDocument(viewportElement);
4503
+ const measureViewportHeight = useValueChanged.useStableCallback(() => {
4504
+ const doc = useValueChanged.ownerDocument(viewportElement);
5184
4505
  const html = doc.documentElement;
5185
4506
  if (viewportElement) {
5186
4507
  setViewportHeight(viewportElement.offsetHeight);
@@ -5193,7 +4514,7 @@ function useDrawerSnapPoints() {
5193
4514
  setRootFontSize(fontSize);
5194
4515
  }
5195
4516
  });
5196
- useIsoLayoutEffect(() => {
4517
+ useValueChanged.useIsoLayoutEffect(() => {
5197
4518
  measureViewportHeight();
5198
4519
  if (!viewportElement || typeof ResizeObserver !== 'function') {
5199
4520
  return undefined;
@@ -5217,7 +4538,7 @@ function useDrawerSnapPoints() {
5217
4538
  if (resolvedHeight === null || !Number.isFinite(resolvedHeight)) {
5218
4539
  return null;
5219
4540
  }
5220
- const clampedHeight = clamp(resolvedHeight, 0, maxHeight);
4541
+ const clampedHeight = useValueChanged.clamp(resolvedHeight, 0, maxHeight);
5221
4542
  return {
5222
4543
  value,
5223
4544
  height: clampedHeight,
@@ -5257,7 +4578,7 @@ function useDrawerSnapPoints() {
5257
4578
  if (resolvedHeight === null || !Number.isFinite(resolvedHeight)) {
5258
4579
  return undefined;
5259
4580
  }
5260
- const clampedHeight = clamp(resolvedHeight, 0, maxHeight);
4581
+ const clampedHeight = useValueChanged.clamp(resolvedHeight, 0, maxHeight);
5261
4582
  return findClosestSnapPoint(clampedHeight, resolvedSnapPoints) ?? undefined;
5262
4583
  }, [activeSnapPoint, popupHeight, resolvedSnapPoints, rootFontSize, viewportHeight]);
5263
4584
  return {
@@ -5335,7 +4656,7 @@ function removeCSSVariableInheritance() {
5335
4656
  }
5336
4657
  const stateAttributesMapping = {
5337
4658
  ...popupStateMapping,
5338
- ...transitionStatusMapping,
4659
+ ...useValueChanged.transitionStatusMapping,
5339
4660
  expanded(value) {
5340
4661
  return value ? {
5341
4662
  [DrawerPopupDataAttributes.expanded]: ''
@@ -5415,7 +4736,7 @@ const DrawerPopup = /*#__PURE__*/React__namespace.forwardRef(function DrawerPopu
5415
4736
  useDialogPortalContext();
5416
4737
  const [popupHeight, setPopupHeight] = React__namespace.useState(0);
5417
4738
  const popupHeightRef = React__namespace.useRef(0);
5418
- const measureHeight = useStableCallback(() => {
4739
+ const measureHeight = useValueChanged.useStableCallback(() => {
5419
4740
  const popupElement = store.context.popupRef.current;
5420
4741
  if (!popupElement) {
5421
4742
  return;
@@ -5441,7 +4762,7 @@ const DrawerPopup = /*#__PURE__*/React__namespace.forwardRef(function DrawerPopu
5441
4762
  setPopupHeight(nextHeight);
5442
4763
  onPopupHeightChange(nextHeight);
5443
4764
  });
5444
- useIsoLayoutEffect(() => {
4765
+ useValueChanged.useIsoLayoutEffect(() => {
5445
4766
  if (!mounted) {
5446
4767
  popupHeightRef.current = 0;
5447
4768
  setPopupHeight(0);
@@ -5463,7 +4784,7 @@ const DrawerPopup = /*#__PURE__*/React__namespace.forwardRef(function DrawerPopu
5463
4784
  resizeObserver.disconnect();
5464
4785
  };
5465
4786
  }, [measureHeight, mounted, nestedDrawerOpen, onPopupHeightChange, store.context.popupRef]);
5466
- useIsoLayoutEffect(() => {
4787
+ useValueChanged.useIsoLayoutEffect(() => {
5467
4788
  const popupRef = store.context.popupRef;
5468
4789
  const syncNestedSwipeProgress = () => {
5469
4790
  const popupElement = popupRef.current;
@@ -5506,7 +4827,7 @@ const DrawerPopup = /*#__PURE__*/React__namespace.forwardRef(function DrawerPopu
5506
4827
  notifyParentHasNestedDrawer(false);
5507
4828
  };
5508
4829
  }, [notifyParentHasNestedDrawer, open, transitionStatus]);
5509
- useOpenChangeComplete({
4830
+ useValueChanged.useOpenChangeComplete({
5510
4831
  open,
5511
4832
  ref: store.context.popupRef,
5512
4833
  onComplete() {
@@ -5684,42 +5005,6 @@ if (process.env.NODE_ENV !== "production") DialogPortal.displayName = "DialogPor
5684
5005
  */
5685
5006
  const DrawerPortal = DialogPortal;
5686
5007
 
5687
- function useControlled({
5688
- controlled,
5689
- default: defaultProp,
5690
- name,
5691
- state = 'value'
5692
- }) {
5693
- // isControlled is ignored in the hook dependency lists as it should never change.
5694
- const {
5695
- current: isControlled
5696
- } = React__namespace.useRef(controlled !== undefined);
5697
- const [valueState, setValue] = React__namespace.useState(defaultProp);
5698
- const value = isControlled ? controlled : valueState;
5699
- if (process.env.NODE_ENV !== 'production') {
5700
- React__namespace.useEffect(() => {
5701
- if (isControlled !== (controlled !== undefined)) {
5702
- console.error([`Base UI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
5703
- }
5704
- }, [state, name, controlled]);
5705
- const {
5706
- current: defaultValue
5707
- } = React__namespace.useRef(defaultProp);
5708
- React__namespace.useEffect(() => {
5709
- // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is for more details.
5710
- if (!isControlled && JSON.stringify(defaultValue) !== JSON.stringify(defaultProp)) {
5711
- console.error([`Base UI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\n'));
5712
- }
5713
- }, [JSON.stringify(defaultProp)]);
5714
- }
5715
- const setValueIfUncontrolled = React__namespace.useCallback(newValue => {
5716
- if (!isControlled) {
5717
- setValue(newValue);
5718
- }
5719
- }, []);
5720
- return [value, setValueIfUncontrolled];
5721
- }
5722
-
5723
5008
  function useOnFirstRender(fn) {
5724
5009
  const ref = React__namespace.useRef(true);
5725
5010
  if (ref.current) {
@@ -5735,8 +5020,8 @@ function hasInsetScrollbars(referenceElement) {
5735
5020
  if (typeof document === 'undefined') {
5736
5021
  return false;
5737
5022
  }
5738
- const doc = ownerDocument(referenceElement);
5739
- const win = index_esm.getWindow(doc);
5023
+ const doc = useValueChanged.ownerDocument(referenceElement);
5024
+ const win = floatingUi_utils_dom.getWindow(doc);
5740
5025
  return win.innerWidth - doc.documentElement.clientWidth > 0;
5741
5026
  }
5742
5027
  function supportsStableScrollbarGutter(referenceElement) {
@@ -5744,10 +5029,10 @@ function supportsStableScrollbarGutter(referenceElement) {
5744
5029
  if (!supported || typeof document === 'undefined') {
5745
5030
  return false;
5746
5031
  }
5747
- const doc = ownerDocument(referenceElement);
5032
+ const doc = useValueChanged.ownerDocument(referenceElement);
5748
5033
  const html = doc.documentElement;
5749
5034
  const body = doc.body;
5750
- const scrollContainer = index_esm.isOverflowElement(html) ? html : body;
5035
+ const scrollContainer = floatingUi_utils_dom.isOverflowElement(html) ? html : body;
5751
5036
  const originalScrollContainerOverflowY = scrollContainer.style.overflowY;
5752
5037
  const originalHtmlStyleGutter = html.style.scrollbarGutter;
5753
5038
  html.style.scrollbarGutter = 'stable';
@@ -5760,7 +5045,7 @@ function supportsStableScrollbarGutter(referenceElement) {
5760
5045
  return before === after;
5761
5046
  }
5762
5047
  function preventScrollOverlayScrollbars(referenceElement) {
5763
- const doc = ownerDocument(referenceElement);
5048
+ const doc = useValueChanged.ownerDocument(referenceElement);
5764
5049
  const html = doc.documentElement;
5765
5050
  const body = doc.body;
5766
5051
 
@@ -5768,7 +5053,7 @@ function preventScrollOverlayScrollbars(referenceElement) {
5768
5053
  // won't have any effect.
5769
5054
  // But if <body> has an `overflow` style (like `overflow-x: hidden`), we need to lock it
5770
5055
  // instead, as sticky elements shift otherwise.
5771
- const elementToLock = index_esm.isOverflowElement(html) ? html : body;
5056
+ const elementToLock = floatingUi_utils_dom.isOverflowElement(html) ? html : body;
5772
5057
  const originalElementToLockStyles = {
5773
5058
  overflowY: elementToLock.style.overflowY,
5774
5059
  overflowX: elementToLock.style.overflowX
@@ -5782,17 +5067,17 @@ function preventScrollOverlayScrollbars(referenceElement) {
5782
5067
  };
5783
5068
  }
5784
5069
  function preventScrollInsetScrollbars(referenceElement) {
5785
- const doc = ownerDocument(referenceElement);
5070
+ const doc = useValueChanged.ownerDocument(referenceElement);
5786
5071
  const html = doc.documentElement;
5787
5072
  const body = doc.body;
5788
- const win = index_esm.getWindow(html);
5073
+ const win = floatingUi_utils_dom.getWindow(html);
5789
5074
  let scrollTop = 0;
5790
5075
  let scrollLeft = 0;
5791
5076
  let updateGutterOnly = false;
5792
- const resizeFrame = AnimationFrame.create();
5077
+ const resizeFrame = useValueChanged.AnimationFrame.create();
5793
5078
 
5794
5079
  // Pinch-zoom in Safari causes a shift. Just don't lock scroll if there's any pinch-zoom.
5795
- if (isWebKit && (win.visualViewport?.scale ?? 1) !== 1) {
5080
+ if (useValueChanged.isWebKit && (win.visualViewport?.scale ?? 1) !== 1) {
5796
5081
  return () => {};
5797
5082
  }
5798
5083
  function lockScroll() {
@@ -5833,7 +5118,7 @@ function preventScrollInsetScrollbars(referenceElement) {
5833
5118
  // with whitespace. Warn if <body> has margins?
5834
5119
  const marginY = parseFloat(bodyStyles.marginTop) + parseFloat(bodyStyles.marginBottom);
5835
5120
  const marginX = parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight);
5836
- const elementToLock = index_esm.isOverflowElement(html) ? html : body;
5121
+ const elementToLock = floatingUi_utils_dom.isOverflowElement(html) ? html : body;
5837
5122
  updateGutterOnly = supportsStableScrollbarGutter(referenceElement);
5838
5123
 
5839
5124
  /*
@@ -5902,8 +5187,8 @@ function preventScrollInsetScrollbars(referenceElement) {
5902
5187
  class ScrollLocker {
5903
5188
  lockCount = 0;
5904
5189
  restore = null;
5905
- timeoutLock = Timeout.create();
5906
- timeoutUnlock = Timeout.create();
5190
+ timeoutLock = useValueChanged.Timeout.create();
5191
+ timeoutUnlock = useValueChanged.Timeout.create();
5907
5192
  acquire(referenceElement) {
5908
5193
  this.lockCount += 1;
5909
5194
  if (this.lockCount === 1 && this.restore === null) {
@@ -5927,16 +5212,16 @@ class ScrollLocker {
5927
5212
  if (this.lockCount === 0 || this.restore !== null) {
5928
5213
  return;
5929
5214
  }
5930
- const doc = ownerDocument(referenceElement);
5215
+ const doc = useValueChanged.ownerDocument(referenceElement);
5931
5216
  const html = doc.documentElement;
5932
- const htmlOverflowY = index_esm.getWindow(html).getComputedStyle(html).overflowY;
5217
+ const htmlOverflowY = floatingUi_utils_dom.getWindow(html).getComputedStyle(html).overflowY;
5933
5218
 
5934
5219
  // If the site author already hid overflow on <html>, respect it and bail out.
5935
5220
  if (htmlOverflowY === 'hidden' || htmlOverflowY === 'clip') {
5936
5221
  this.restore = useRenderElement.NOOP;
5937
5222
  return;
5938
5223
  }
5939
- const hasOverlayScrollbars = isIOS || !hasInsetScrollbars(referenceElement);
5224
+ const hasOverlayScrollbars = useValueChanged.isIOS || !hasInsetScrollbars(referenceElement);
5940
5225
 
5941
5226
  // On iOS, scroll locking does not work if the navbar is collapsed. Due to numerous
5942
5227
  // side effects and bugs that arise on iOS, it must be researched extensively before
@@ -5956,7 +5241,7 @@ const SCROLL_LOCKER = new ScrollLocker();
5956
5241
  * @param referenceElement - Element to use as a reference for lock calculations.
5957
5242
  */
5958
5243
  function useScrollLock(enabled = true, referenceElement = null) {
5959
- useIsoLayoutEffect(() => {
5244
+ useValueChanged.useIsoLayoutEffect(() => {
5960
5245
  if (!enabled) {
5961
5246
  return undefined;
5962
5247
  }
@@ -6000,20 +5285,6 @@ function useEnhancedClickHandler(handler) {
6000
5285
  };
6001
5286
  }
6002
5287
 
6003
- function useValueChanged(value, onChange) {
6004
- const valueRef = React__namespace.useRef(value);
6005
- const onChangeCallback = useStableCallback(onChange);
6006
- useIsoLayoutEffect(() => {
6007
- if (valueRef.current === value) {
6008
- return;
6009
- }
6010
- onChangeCallback(valueRef.current);
6011
- }, [value, onChangeCallback]);
6012
- useIsoLayoutEffect(() => {
6013
- valueRef.current = value;
6014
- }, [value]);
6015
- }
6016
-
6017
5288
  /**
6018
5289
  * Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.
6019
5290
  *
@@ -6021,16 +5292,16 @@ function useValueChanged(value, onChange) {
6021
5292
  */
6022
5293
  function useOpenInteractionType(open) {
6023
5294
  const [openMethod, setOpenMethod] = React__namespace.useState(null);
6024
- const handleTriggerClick = useStableCallback((_, interactionType) => {
5295
+ const handleTriggerClick = useValueChanged.useStableCallback((_, interactionType) => {
6025
5296
  if (!open) {
6026
5297
  setOpenMethod(interactionType || (
6027
5298
  // On iOS Safari, the hitslop around touch targets means tapping outside an element's
6028
5299
  // bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`
6029
5300
  // will be "" in that case.
6030
- isIOS ? 'touch' : ''));
5301
+ useValueChanged.isIOS ? 'touch' : ''));
6031
5302
  }
6032
5303
  });
6033
- useValueChanged(open, previousOpen => {
5304
+ useValueChanged.useValueChanged(open, previousOpen => {
6034
5305
  if (previousOpen && !open) {
6035
5306
  setOpenMethod(null);
6036
5307
  }
@@ -6066,15 +5337,15 @@ function useDialogRoot(params) {
6066
5337
  const {
6067
5338
  forceUnmount
6068
5339
  } = useOpenStateTransitions(open, store);
6069
- const createDialogEventDetails = useStableCallback(reason => {
6070
- const details = createChangeEventDetails(reason);
5340
+ const createDialogEventDetails = useValueChanged.useStableCallback(reason => {
5341
+ const details = useValueChanged.createChangeEventDetails(reason);
6071
5342
  details.preventUnmountOnClose = () => {
6072
5343
  store.set('preventUnmountingOnClose', true);
6073
5344
  };
6074
5345
  return details;
6075
5346
  });
6076
5347
  const handleImperativeClose = React__namespace.useCallback(() => {
6077
- store.setOpen(false, createDialogEventDetails(imperativeAction));
5348
+ store.setOpen(false, createDialogEventDetails(useValueChanged.imperativeAction));
6078
5349
  }, [store, createDialogEventDetails]);
6079
5350
  React__namespace.useImperativeHandle(actionsRef, () => ({
6080
5351
  unmount: forceUnmount,
@@ -6346,7 +5617,7 @@ function DrawerRoot(props) {
6346
5617
  defaultSnapPoint,
6347
5618
  onSnapPointChange: onSnapPointChangeProp
6348
5619
  } = props;
6349
- const onSnapPointChange = useStableCallback(onSnapPointChangeProp);
5620
+ const onSnapPointChange = useValueChanged.useStableCallback(onSnapPointChangeProp);
6350
5621
  const parentDrawerRootContext = useDrawerRootContext(true);
6351
5622
  const notifyParentSwipeProgressChange = parentDrawerRootContext?.onNestedSwipeProgressChange;
6352
5623
  const notifyParentFrontmostHeight = parentDrawerRootContext?.onNestedFrontmostHeightChange;
@@ -6359,15 +5630,15 @@ function DrawerRoot(props) {
6359
5630
  const [nestedSwipeProgressStore] = React__namespace.useState(createNestedSwipeProgressStore);
6360
5631
  const resolvedDefaultSnapPoint = defaultSnapPoint !== undefined ? defaultSnapPoint : snapPoints?.[0] ?? null;
6361
5632
  const isSnapPointControlled = snapPointProp !== undefined;
6362
- const [activeSnapPoint, setActiveSnapPointUnwrapped] = useControlled({
5633
+ const [activeSnapPoint, setActiveSnapPointUnwrapped] = useValueChanged.useControlled({
6363
5634
  controlled: snapPointProp,
6364
5635
  default: resolvedDefaultSnapPoint,
6365
5636
  name: 'Drawer',
6366
5637
  state: 'snapPoint'
6367
5638
  });
6368
5639
  const isNestedDrawerOpenRef = React__namespace.useRef(false);
6369
- const setActiveSnapPoint = useStableCallback((nextSnapPoint, eventDetails) => {
6370
- const resolvedEventDetails = eventDetails ?? createChangeEventDetails(none);
5640
+ const setActiveSnapPoint = useValueChanged.useStableCallback((nextSnapPoint, eventDetails) => {
5641
+ const resolvedEventDetails = eventDetails ?? useValueChanged.createChangeEventDetails(useValueChanged.none);
6371
5642
  onSnapPointChange?.(nextSnapPoint, resolvedEventDetails);
6372
5643
  if (resolvedEventDetails.isCanceled) {
6373
5644
  return;
@@ -6386,13 +5657,13 @@ function DrawerRoot(props) {
6386
5657
  }
6387
5658
  return activeSnapPoint;
6388
5659
  }, [activeSnapPoint, isSnapPointControlled, resolvedDefaultSnapPoint, snapPoints]);
6389
- const onPopupHeightChange = useStableCallback(height => {
5660
+ const onPopupHeightChange = useValueChanged.useStableCallback(height => {
6390
5661
  setPopupHeight(height);
6391
5662
  if (!isNestedDrawerOpenRef.current && height > 0) {
6392
5663
  setFrontmostHeight(height);
6393
5664
  }
6394
5665
  });
6395
- const onNestedFrontmostHeightChange = useStableCallback(height => {
5666
+ const onNestedFrontmostHeightChange = useValueChanged.useStableCallback(height => {
6396
5667
  if (height > 0) {
6397
5668
  isNestedDrawerOpenRef.current = true;
6398
5669
  setFrontmostHeight(height);
@@ -6403,24 +5674,24 @@ function DrawerRoot(props) {
6403
5674
  setFrontmostHeight(popupHeight);
6404
5675
  }
6405
5676
  });
6406
- const onNestedDrawerPresenceChange = useStableCallback(present => {
5677
+ const onNestedDrawerPresenceChange = useValueChanged.useStableCallback(present => {
6407
5678
  setHasNestedDrawer(present);
6408
5679
  });
6409
- const onNestedSwipeProgressChange = useStableCallback(progress => {
5680
+ const onNestedSwipeProgressChange = useValueChanged.useStableCallback(progress => {
6410
5681
  nestedSwipeProgressStore.set(progress);
6411
5682
  notifyParentSwipeProgressChange?.(progress);
6412
5683
  });
6413
- const onNestedSwipingChange = useStableCallback(swiping => {
5684
+ const onNestedSwipingChange = useValueChanged.useStableCallback(swiping => {
6414
5685
  setNestedSwiping(swiping);
6415
5686
  notifyParentSwipingChange?.(swiping);
6416
5687
  });
6417
- const handleOpenChange = useStableCallback((nextOpen, eventDetails) => {
5688
+ const handleOpenChange = useValueChanged.useStableCallback((nextOpen, eventDetails) => {
6418
5689
  onOpenChange?.(nextOpen, eventDetails);
6419
5690
  if (eventDetails.isCanceled) {
6420
5691
  return;
6421
5692
  }
6422
5693
  if (!nextOpen && snapPoints && snapPoints.length > 0) {
6423
- setActiveSnapPoint(resolvedDefaultSnapPoint, createChangeEventDetails(eventDetails.reason, eventDetails.event, eventDetails.trigger));
5694
+ setActiveSnapPoint(resolvedDefaultSnapPoint, useValueChanged.createChangeEventDetails(eventDetails.reason, eventDetails.event, eventDetails.trigger));
6424
5695
  }
6425
5696
  });
6426
5697
  const contextValue = React__namespace.useMemo(() => ({
@@ -6490,7 +5761,7 @@ function createNestedSwipeProgressStore() {
6490
5761
  };
6491
5762
  }
6492
5763
  function DrawerProviderReporter() {
6493
- const drawerId = useId();
5764
+ const drawerId = useValueChanged.useId();
6494
5765
  const providerContext = useDrawerProviderContext();
6495
5766
  const dialogRootContext = useDialogRootContext(false);
6496
5767
  const open = dialogRootContext.store.useState('open');
@@ -6514,10 +5785,10 @@ function DrawerProviderReporter() {
6514
5785
  React__namespace.useEffect(() => {
6515
5786
  // CloseWatcher enables the Android back gesture (Chromium-only).
6516
5787
  // Keep this Android-only for now to avoid interfering with Escape/nesting semantics on desktop due to `useDismiss`.
6517
- if (!open || !isTopmost || !isAndroid) {
5788
+ if (!open || !isTopmost || !useValueChanged.isAndroid) {
6518
5789
  return undefined;
6519
5790
  }
6520
- const win = index_esm.getWindow(popupElement);
5791
+ const win = floatingUi_utils_dom.getWindow(popupElement);
6521
5792
  const CloseWatcherCtor = win.CloseWatcher;
6522
5793
  if (!CloseWatcherCtor) {
6523
5794
  return undefined;
@@ -6526,13 +5797,13 @@ function DrawerProviderReporter() {
6526
5797
  if (!dialogRootContext.store.select('open')) {
6527
5798
  return;
6528
5799
  }
6529
- dialogRootContext.store.setOpen(false, createChangeEventDetails(closeWatcher, event));
5800
+ dialogRootContext.store.setOpen(false, useValueChanged.createChangeEventDetails(useValueChanged.closeWatcher, event));
6530
5801
  }
6531
- const closeWatcher$1 = new CloseWatcherCtor();
6532
- closeWatcher$1.addEventListener('close', handleCloseWatcher);
5802
+ const closeWatcher = new CloseWatcherCtor();
5803
+ closeWatcher.addEventListener('close', handleCloseWatcher);
6533
5804
  return () => {
6534
- closeWatcher$1.removeEventListener('close', handleCloseWatcher);
6535
- closeWatcher$1.destroy();
5805
+ closeWatcher.removeEventListener('close', handleCloseWatcher);
5806
+ closeWatcher.destroy();
6536
5807
  };
6537
5808
  }, [dialogRootContext.store, isTopmost, open, popupElement]);
6538
5809
  return null;
@@ -6572,32 +5843,19 @@ exports.PATIENT_CLICK_THRESHOLD = PATIENT_CLICK_THRESHOLD;
6572
5843
  exports.POPUP_COLLISION_AVOIDANCE = POPUP_COLLISION_AVOIDANCE;
6573
5844
  exports.PopupTriggerMap = PopupTriggerMap;
6574
5845
  exports.ReactStore = ReactStore;
6575
- exports.SafeReact = SafeReact;
6576
5846
  exports.Store = Store;
6577
5847
  exports.TYPEABLE_SELECTOR = TYPEABLE_SELECTOR;
6578
5848
  exports.TYPEAHEAD_RESET_MS = TYPEAHEAD_RESET_MS;
6579
- exports.Timeout = Timeout;
6580
- exports.TransitionStatusDataAttributes = TransitionStatusDataAttributes;
6581
5849
  exports.activeElement = activeElement;
6582
- exports.cancelOpen = cancelOpen;
6583
- exports.chipRemovePress = chipRemovePress;
6584
- exports.clamp = clamp;
6585
- exports.clearPress = clearPress;
6586
- exports.closePress = closePress;
6587
5850
  exports.contains = contains;
6588
5851
  exports.createAttribute = createAttribute;
6589
- exports.createChangeEventDetails = createChangeEventDetails;
6590
- exports.createGenericEventDetails = createGenericEventDetails;
6591
5852
  exports.createGridCellMap = createGridCellMap;
6592
5853
  exports.createInitialPopupStoreState = createInitialPopupStoreState;
6593
5854
  exports.createSelector = createSelector;
6594
- exports.decrementPress = decrementPress;
6595
5855
  exports.enqueueFocus = enqueueFocus;
6596
- exports.escapeKey = escapeKey;
6597
5856
  exports.fastComponent = fastComponent;
6598
5857
  exports.fastComponentRef = fastComponentRef;
6599
5858
  exports.findNonDisabledListIndex = findNonDisabledListIndex;
6600
- exports.focusOut = focusOut;
6601
5859
  exports.getFloatingFocusElement = getFloatingFocusElement;
6602
5860
  exports.getGridCellIndexOfCorner = getGridCellIndexOfCorner;
6603
5861
  exports.getGridCellIndices = getGridCellIndices;
@@ -6609,53 +5867,19 @@ exports.getNodeChildren = getNodeChildren;
6609
5867
  exports.getTabbableAfterElement = getTabbableAfterElement;
6610
5868
  exports.getTabbableBeforeElement = getTabbableBeforeElement;
6611
5869
  exports.getTarget = getTarget;
6612
- exports.imperativeAction = imperativeAction;
6613
- exports.incrementPress = incrementPress;
6614
5870
  exports.inertValue = inertValue;
6615
- exports.inputBlur = inputBlur;
6616
- exports.inputChange = inputChange;
6617
- exports.inputClear = inputClear;
6618
- exports.inputPaste = inputPaste;
6619
- exports.inputPress = inputPress;
6620
- exports.isAndroid = isAndroid;
6621
- exports.isClickLikeEvent = isClickLikeEvent;
6622
5871
  exports.isElementVisible = isElementVisible;
6623
- exports.isFirefox = isFirefox;
6624
- exports.isIOS = isIOS;
6625
5872
  exports.isIndexOutOfListBounds = isIndexOutOfListBounds;
6626
5873
  exports.isListIndexDisabled = isListIndexDisabled;
6627
- exports.isMac = isMac;
6628
- exports.isMouseLikePointerType = isMouseLikePointerType;
6629
5874
  exports.isOutsideEvent = isOutsideEvent;
6630
- exports.isSafari = isSafari;
6631
5875
  exports.isTargetInsideEnabledTrigger = isTargetInsideEnabledTrigger;
6632
5876
  exports.isTypeableCombobox = isTypeableCombobox;
6633
5877
  exports.isTypeableElement = isTypeableElement;
6634
- exports.isVirtualClick = isVirtualClick;
6635
- exports.isVirtualPointerEvent = isVirtualPointerEvent;
6636
- exports.isWebKit = isWebKit;
6637
- exports.itemPress = itemPress;
6638
- exports.keyboard = keyboard;
6639
- exports.listNavigation = listNavigation;
6640
5878
  exports.matchesFocusVisible = matchesFocusVisible;
6641
- exports.none = none;
6642
- exports.outsidePress = outsidePress;
6643
- exports.ownerDocument = ownerDocument;
6644
5879
  exports.popupStateMapping = popupStateMapping;
6645
5880
  exports.popupStoreSelectors = popupStoreSelectors;
6646
5881
  exports.pressableTriggerOpenStateMapping = pressableTriggerOpenStateMapping;
6647
- exports.scrub = scrub;
6648
- exports.siblingOpen = siblingOpen;
6649
- exports.stopEvent = stopEvent;
6650
- exports.swipe = swipe;
6651
- exports.transitionStatusMapping = transitionStatusMapping;
6652
- exports.triggerFocus = triggerFocus;
6653
- exports.triggerHover = triggerHover;
6654
5882
  exports.triggerOpenStateMapping = triggerOpenStateMapping;
6655
- exports.triggerPress = triggerPress;
6656
- exports.useAnimationFrame = useAnimationFrame;
6657
- exports.useAnimationsFinished = useAnimationsFinished;
6658
- exports.useControlled = useControlled;
6659
5883
  exports.useDialogPortalContext = useDialogPortalContext;
6660
5884
  exports.useDialogRootContext = useDialogRootContext;
6661
5885
  exports.useDismiss = useDismiss;
@@ -6665,25 +5889,14 @@ exports.useDrawerSnapPoints = useDrawerSnapPoints;
6665
5889
  exports.useFloatingNodeId = useFloatingNodeId;
6666
5890
  exports.useFloatingParentNodeId = useFloatingParentNodeId;
6667
5891
  exports.useFloatingTree = useFloatingTree;
6668
- exports.useId = useId;
6669
5892
  exports.useImplicitActiveTrigger = useImplicitActiveTrigger;
6670
5893
  exports.useInteractions = useInteractions;
6671
- exports.useIsoLayoutEffect = useIsoLayoutEffect;
6672
5894
  exports.useOnFirstRender = useOnFirstRender;
6673
- exports.useOnMount = useOnMount;
6674
- exports.useOpenChangeComplete = useOpenChangeComplete;
6675
5895
  exports.useOpenInteractionType = useOpenInteractionType;
6676
5896
  exports.useOpenStateTransitions = useOpenStateTransitions;
6677
5897
  exports.useRole = useRole;
6678
5898
  exports.useScrollLock = useScrollLock;
6679
- exports.useStableCallback = useStableCallback;
6680
5899
  exports.useStore = useStore;
6681
5900
  exports.useSyncedFloatingRootContext = useSyncedFloatingRootContext;
6682
- exports.useTimeout = useTimeout;
6683
- exports.useTransitionStatus = useTransitionStatus;
6684
5901
  exports.useTriggerDataForwarding = useTriggerDataForwarding;
6685
5902
  exports.useTriggerRegistration = useTriggerRegistration;
6686
- exports.useValueAsRef = useValueAsRef;
6687
- exports.useValueChanged = useValueChanged;
6688
- exports.visuallyHidden = visuallyHidden;
6689
- exports.visuallyHiddenInput = visuallyHiddenInput;