tfy-web-components 0.0.44 → 0.0.45

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 (184) hide show
  1. package/dist/{Button-BdNaawKV.js → Button-HHEfL8b9.js} +5 -4
  2. package/dist/{Button-BdNaawKV.js.map → Button-HHEfL8b9.js.map} +1 -1
  3. package/dist/CSPContext-Cldo9QDp.js +13 -0
  4. package/dist/CSPContext-Cldo9QDp.js.map +1 -0
  5. package/dist/{CompositeItem-EOSJycCk.js → CompositeItem-GNejxLcK.js} +3 -3
  6. package/dist/{CompositeItem-EOSJycCk.js.map → CompositeItem-GNejxLcK.js.map} +1 -1
  7. package/dist/{CompositeRoot-DnijP7Jm.js → CompositeRoot-7_u1HqDT.js} +9 -47
  8. package/dist/CompositeRoot-7_u1HqDT.js.map +1 -0
  9. package/dist/DropdownMenu-Crlf-J4E.js +3304 -0
  10. package/dist/DropdownMenu-Crlf-J4E.js.map +1 -0
  11. package/dist/{Input-D0UuCXLs.js → Input-BS9fWUAf.js} +3 -3
  12. package/dist/{Input-D0UuCXLs.js.map → Input-BS9fWUAf.js.map} +1 -1
  13. package/dist/{Modal-BFnf68oS.js → Modal-DaHG8mjy.js} +10 -10
  14. package/dist/{Modal-BFnf68oS.js.map → Modal-DaHG8mjy.js.map} +1 -1
  15. package/dist/Popover-A8IyEt2w.js +400 -0
  16. package/dist/Popover-A8IyEt2w.js.map +1 -0
  17. package/dist/{Popover-B6z7exNd.js → PopoverPopup-teGm7D5T.js} +25 -498
  18. package/dist/PopoverPopup-teGm7D5T.js.map +1 -0
  19. package/dist/{PrehydrationScript--08s8Mfl.js → PrehydrationScript-B3u_PP2W.js} +5 -12
  20. package/dist/PrehydrationScript-B3u_PP2W.js.map +1 -0
  21. package/dist/Select-BtX40h2K.js +2187 -0
  22. package/dist/Select-BtX40h2K.js.map +1 -0
  23. package/dist/{useValueAsRef-BfFRcMg6.js → addEventListener-D-i9O6BG.js} +8 -8
  24. package/dist/addEventListener-D-i9O6BG.js.map +1 -0
  25. package/dist/clamp-D7_nsB8C.js +30 -0
  26. package/dist/clamp-D7_nsB8C.js.map +1 -0
  27. package/dist/components/atoms/Accordion.es.js +9 -9
  28. package/dist/components/atoms/Avatar.es.js +9 -9
  29. package/dist/components/atoms/Avatar.es.js.map +1 -1
  30. package/dist/components/atoms/Badge.d.ts +5 -6
  31. package/dist/components/atoms/Badge.es.js +80 -43
  32. package/dist/components/atoms/Badge.es.js.map +1 -1
  33. package/dist/components/atoms/Button.d.ts +1 -1
  34. package/dist/components/atoms/Button.es.js +2 -2
  35. package/dist/components/atoms/ButtonGroup.es.js +1 -1
  36. package/dist/components/atoms/Combobox.d.ts +34 -0
  37. package/dist/components/atoms/Combobox.es.js +3252 -0
  38. package/dist/components/atoms/Combobox.es.js.map +1 -0
  39. package/dist/components/atoms/ContextMenu.d.ts +12 -0
  40. package/dist/components/atoms/ContextMenu.es.js +259 -0
  41. package/dist/components/atoms/ContextMenu.es.js.map +1 -0
  42. package/dist/components/atoms/DropdownMenu.d.ts +51 -0
  43. package/dist/components/atoms/DropdownMenu.es.js +31 -0
  44. package/dist/components/atoms/DropdownMenu.es.js.map +1 -0
  45. package/dist/components/atoms/IconButton.d.ts +1 -1
  46. package/dist/components/atoms/IconButton.es.js +3 -3
  47. package/dist/components/atoms/IconButton.es.js.map +1 -1
  48. package/dist/components/atoms/IconProvider.es.js +3 -1
  49. package/dist/components/atoms/IconProvider.es.js.map +1 -1
  50. package/dist/components/atoms/Modal.es.js +1 -1
  51. package/dist/components/atoms/OverflowButton.es.js +2 -2
  52. package/dist/components/atoms/PaginationDot.d.ts +14 -0
  53. package/dist/components/atoms/PaginationDot.es.js +58 -0
  54. package/dist/components/atoms/PaginationDot.es.js.map +1 -0
  55. package/dist/components/atoms/PaginationItem.d.ts +15 -0
  56. package/dist/components/atoms/PaginationItem.es.js +87 -0
  57. package/dist/components/atoms/PaginationItem.es.js.map +1 -0
  58. package/dist/components/atoms/Popover.d.ts +10 -0
  59. package/dist/components/atoms/Popover.es.js +50 -0
  60. package/dist/components/atoms/Popover.es.js.map +1 -0
  61. package/dist/components/atoms/Select.d.ts +63 -0
  62. package/dist/components/atoms/Select.es.js +23 -0
  63. package/dist/components/atoms/Select.es.js.map +1 -0
  64. package/dist/components/atoms/Switch.es.js +7 -6
  65. package/dist/components/atoms/Switch.es.js.map +1 -1
  66. package/dist/components/atoms/TabButton.es.js +14 -12
  67. package/dist/components/atoms/TabButton.es.js.map +1 -1
  68. package/dist/components/atoms/Tag.d.ts +2 -2
  69. package/dist/components/atoms/Tag.es.js +66 -33
  70. package/dist/components/atoms/Tag.es.js.map +1 -1
  71. package/dist/components/atoms/Tooltip.es.js +1153 -19
  72. package/dist/components/atoms/Tooltip.es.js.map +1 -1
  73. package/dist/components/atoms/stories/OverlayThemePanels.d.ts +8 -0
  74. package/dist/components/molecules/Alert.es.js +3 -3
  75. package/dist/components/molecules/CopyField.es.js +2 -2
  76. package/dist/components/molecules/CustomDrawer.es.js +1 -1
  77. package/dist/components/molecules/Dialog.es.js +1 -1
  78. package/dist/components/molecules/ImagesPreview.es.js +2 -2
  79. package/dist/components/molecules/Input.es.js +2 -2
  80. package/dist/components/molecules/Markdown.es.js +1 -1
  81. package/dist/components/molecules/Pagination.d.ts +58 -0
  82. package/dist/components/molecules/Pagination.es.js +272 -0
  83. package/dist/components/molecules/Pagination.es.js.map +1 -0
  84. package/dist/components/molecules/SimpleCodeEditor.es.js +3 -3
  85. package/dist/components/molecules/SimpleCodeEditor.es.js.map +1 -1
  86. package/dist/components/molecules/TagGroup.d.ts +11 -0
  87. package/dist/components/molecules/TagGroup.es.js +59 -0
  88. package/dist/components/molecules/TagGroup.es.js.map +1 -0
  89. package/dist/components/molecules/ToggleButton.es.js +2 -2
  90. package/dist/components/molecules/agent-chat/AssistantMessage.d.ts +3 -1
  91. package/dist/components/molecules/agent-chat.es.js +4 -3
  92. package/dist/components/molecules/agent-chat.es.js.map +1 -1
  93. package/dist/composite-DnShFmi7.js +551 -0
  94. package/dist/composite-DnShFmi7.js.map +1 -0
  95. package/dist/{composite-BDBV1Jsx.js → composite-IA--dSel.js} +2 -2
  96. package/dist/{composite-BDBV1Jsx.js.map → composite-IA--dSel.js.map} +1 -1
  97. package/dist/constants-BaUKmVF_.js +103 -0
  98. package/dist/constants-BaUKmVF_.js.map +1 -0
  99. package/dist/{index-B6xFUIBK.js → element-B1vbc-LG.js} +69 -111
  100. package/dist/element-B1vbc-LG.js.map +1 -0
  101. package/dist/error-nCTLdGUr.js +6 -0
  102. package/dist/{error-FX4R42W-.js.map → error-nCTLdGUr.js.map} +1 -1
  103. package/dist/index.d.ts +10 -2
  104. package/dist/index.es.js +61 -11
  105. package/dist/index.es.js.map +1 -1
  106. package/dist/{inertValue-IJM5NA30.js → inertValue-C1Ml1s55.js} +2 -2
  107. package/dist/{inertValue-IJM5NA30.js.map → inertValue-C1Ml1s55.js.map} +1 -1
  108. package/dist/isElementDisabled-lq1fKien.js +47 -0
  109. package/dist/isElementDisabled-lq1fKien.js.map +1 -0
  110. package/dist/new-components/atoms/Alert.d.ts +7 -1
  111. package/dist/new-components/atoms/Alert.es.js +23 -4
  112. package/dist/new-components/atoms/Alert.es.js.map +1 -1
  113. package/dist/new-components/atoms/Checkbox.es.js +8 -7
  114. package/dist/new-components/atoms/Checkbox.es.js.map +1 -1
  115. package/dist/new-components/atoms/EmptyState.d.ts +3 -0
  116. package/dist/new-components/atoms/EmptyState.es.js +9 -4
  117. package/dist/new-components/atoms/EmptyState.es.js.map +1 -1
  118. package/dist/new-components/atoms/Popover.es.js +3 -2
  119. package/dist/new-components/atoms/Popover.es.js.map +1 -1
  120. package/dist/new-components/atoms/Radio.es.js +13 -24
  121. package/dist/new-components/atoms/Radio.es.js.map +1 -1
  122. package/dist/new-components/atoms/SegmentedControl.es.js +7 -7
  123. package/dist/new-components/atoms/Slider.es.js +14 -43
  124. package/dist/new-components/atoms/Slider.es.js.map +1 -1
  125. package/dist/new-components/atoms/Toast.d.ts +8 -12
  126. package/dist/new-components/atoms/Toast.es.js +202 -145
  127. package/dist/new-components/atoms/Toast.es.js.map +1 -1
  128. package/dist/new-components/atoms/Toggletip.es.js +3 -2
  129. package/dist/new-components/atoms/Toggletip.es.js.map +1 -1
  130. package/dist/new-components/atoms/stories/ThemeComparison.d.ts +2 -1
  131. package/dist/serializeValue-BLvnTy3o.js +17 -0
  132. package/dist/serializeValue-BLvnTy3o.js.map +1 -0
  133. package/dist/stringifyLocale-DOx30wH1.js +13 -0
  134. package/dist/stringifyLocale-DOx30wH1.js.map +1 -0
  135. package/dist/style.css +1 -1
  136. package/dist/tokens.css +3 -0
  137. package/dist/{useAnimationFrame-DwhymJoW.js → useAnimationFrame-DqvuRtgK.js} +2 -2
  138. package/dist/{useAnimationFrame-DwhymJoW.js.map → useAnimationFrame-DqvuRtgK.js.map} +1 -1
  139. package/dist/{useAriaLabelledBy-C9SDiruE.js → useAriaLabelledBy-CP4wKTYs.js} +3 -3
  140. package/dist/{useAriaLabelledBy-C9SDiruE.js.map → useAriaLabelledBy-CP4wKTYs.js.map} +1 -1
  141. package/dist/{useBaseUiId-jtgiQp--.js → useBaseUiId-CYT1vFMG.js} +57 -37
  142. package/dist/{useBaseUiId-jtgiQp--.js.map → useBaseUiId-CYT1vFMG.js.map} +1 -1
  143. package/dist/{useButton-BalOc_EL.js → useButton-BlHadUfM.js} +4 -4
  144. package/dist/{useButton-BalOc_EL.js.map → useButton-BlHadUfM.js.map} +1 -1
  145. package/dist/{CompositeList-D4xmSZ5V.js → useCompositeListItem-DlAKWsHE.js} +59 -59
  146. package/dist/useCompositeListItem-DlAKWsHE.js.map +1 -0
  147. package/dist/{useControlled-BSyYkg5C.js → useControlled-DMDWXIzj.js} +2 -2
  148. package/dist/{useControlled-BSyYkg5C.js.map → useControlled-DMDWXIzj.js.map} +1 -1
  149. package/dist/useFocus-C__7iwl1.js +137 -0
  150. package/dist/useFocus-C__7iwl1.js.map +1 -0
  151. package/dist/{useIsoLayoutEffect-e9VA-ICd.js → useIsoLayoutEffect-D2lpsB9D.js} +8 -4
  152. package/dist/{useIsoLayoutEffect-e9VA-ICd.js.map → useIsoLayoutEffect-D2lpsB9D.js.map} +1 -1
  153. package/dist/{usePopupHandleStore-DYUo-Fyk.js → usePopupHandleStore-C_Vw7xcw.js} +1966 -2002
  154. package/dist/usePopupHandleStore-C_Vw7xcw.js.map +1 -0
  155. package/dist/{Tooltip-6R-t7wt1.js → usePositioner-BmYVsMO_.js} +17 -1403
  156. package/dist/usePositioner-BmYVsMO_.js.map +1 -0
  157. package/dist/{useOpenInteractionType-BnUZ2Eio.js → useScrollLock-By-42HSc.js} +74 -58
  158. package/dist/useScrollLock-By-42HSc.js.map +1 -0
  159. package/dist/{useLabelableId-CQqNbBk1.js → useSetFieldFocused-CcdG6FNp.js} +27 -35
  160. package/dist/useSetFieldFocused-CcdG6FNp.js.map +1 -0
  161. package/dist/{useTimeout-BXf1hDIL.js → useTimeout-D1vYJgq4.js} +3 -3
  162. package/dist/{useTimeout-BXf1hDIL.js.map → useTimeout-D1vYJgq4.js.map} +1 -1
  163. package/dist/{useTransitionStatus-C9gg_XJ-.js → useTransitionStatus-CHrs3i5F.js} +3 -3
  164. package/dist/{useTransitionStatus-C9gg_XJ-.js.map → useTransitionStatus-CHrs3i5F.js.map} +1 -1
  165. package/dist/useTriggerFocusGuards-CXAhW8P6.js +100 -0
  166. package/dist/useTriggerFocusGuards-CXAhW8P6.js.map +1 -0
  167. package/dist/useValueChanged-BnlOop8k.js +16 -0
  168. package/dist/useValueChanged-BnlOop8k.js.map +1 -0
  169. package/package.json +1 -1
  170. package/dist/CompositeList-D4xmSZ5V.js.map +0 -1
  171. package/dist/CompositeRoot-DnijP7Jm.js.map +0 -1
  172. package/dist/Popover-B6z7exNd.js.map +0 -1
  173. package/dist/PrehydrationScript--08s8Mfl.js.map +0 -1
  174. package/dist/Tooltip-6R-t7wt1.js.map +0 -1
  175. package/dist/composite-rAI4IlWK.js +0 -66
  176. package/dist/composite-rAI4IlWK.js.map +0 -1
  177. package/dist/error-FX4R42W-.js +0 -6
  178. package/dist/index-B6xFUIBK.js.map +0 -1
  179. package/dist/shadowDom-CRvvf3qf.js +0 -52
  180. package/dist/shadowDom-CRvvf3qf.js.map +0 -1
  181. package/dist/useLabelableId-CQqNbBk1.js.map +0 -1
  182. package/dist/useOpenInteractionType-BnUZ2Eio.js.map +0 -1
  183. package/dist/usePopupHandleStore-DYUo-Fyk.js.map +0 -1
  184. package/dist/useValueAsRef-BfFRcMg6.js.map +0 -1
package/dist/tokens.css CHANGED
@@ -67,6 +67,7 @@
67
67
  --avatar-background-initials: #e0e7ff;
68
68
  --avatar-background-presence-away: #d97706;
69
69
  --avatar-background-presence-offline: #71717a;
70
+ --avatar-border-ring: #ffffff;
70
71
  --tree-background-leaf: #a5b4fc;
71
72
  --code-background-base: #f0f7ff;
72
73
  --code-background-header: #eef2ff;
@@ -419,6 +420,7 @@
419
420
  --avatar-background-initials: #312e81;
420
421
  --avatar-background-presence-away: #fbbf24;
421
422
  --avatar-background-presence-offline: #a1a1aa;
423
+ --avatar-border-ring: #3f3f46;
422
424
  --tree-background-leaf: #4338ca;
423
425
  --code-background-base: #1f1f22;
424
426
  --code-background-header: #27272a;
@@ -681,6 +683,7 @@
681
683
  --color-avatar-background-initials: var(--avatar-background-initials);
682
684
  --color-avatar-background-presence-away: var(--avatar-background-presence-away);
683
685
  --color-avatar-background-presence-offline: var(--avatar-background-presence-offline);
686
+ --color-avatar-border-ring: var(--avatar-border-ring);
684
687
  --color-tree-background-leaf: var(--tree-background-leaf);
685
688
  --color-code-background-base: var(--code-background-base);
686
689
  --color-code-background-header: var(--code-background-header);
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { E as EMPTY_ARRAY, e as useRefWithInit } from "./useIsoLayoutEffect-e9VA-ICd.js";
4
+ import { E as EMPTY_ARRAY, e as useRefWithInit } from "./useIsoLayoutEffect-D2lpsB9D.js";
5
5
  import * as React from "react";
6
6
  function useOnMount(fn) {
7
7
  React.useEffect(fn, EMPTY_ARRAY);
@@ -105,4 +105,4 @@ export {
105
105
  useOnMount as a,
106
106
  useAnimationFrame as u
107
107
  };
108
- //# sourceMappingURL=useAnimationFrame-DwhymJoW.js.map
108
+ //# sourceMappingURL=useAnimationFrame-DqvuRtgK.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAnimationFrame-DwhymJoW.js","sources":["../node_modules/@base-ui/utils/useOnMount.mjs","../node_modules/@base-ui/utils/useAnimationFrame.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { EMPTY_ARRAY } from \"./empty.mjs\";\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport function useOnMount(fn) {\n // 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\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY_ARRAY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nimport { useOnMount } from \"./useOnMount.mjs\";\n/** Unlike `setTimeout`, rAF doesn't guarantee a positive integer return value, so we can't have\n * a monomorphic `uint` type with `0` meaning empty.\n * See warning note at:\n * https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame#return_value */\nconst EMPTY = null;\nlet LAST_RAF = globalThis.requestAnimationFrame;\nclass Scheduler {\n /* This implementation uses an array as a backing data-structure for frame callbacks.\n * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it\n * never calls the native `cancelAnimationFrame` if there are no frames left. This can\n * be much more efficient if there is a call pattern that alterns as\n * \"request-cancel-request-cancel-…\".\n * But in the case of \"request-request-…-cancel-cancel-…\", it leaves the final animation\n * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */\n\n callbacks = [];\n callbacksCount = 0;\n nextId = 1;\n startId = 1;\n isScheduled = false;\n tick = timestamp => {\n this.isScheduled = false;\n const currentCallbacks = this.callbacks;\n const currentCallbacksCount = this.callbacksCount;\n\n // Update these before iterating, callbacks could call `requestAnimationFrame` again.\n this.callbacks = [];\n this.callbacksCount = 0;\n this.startId = this.nextId;\n if (currentCallbacksCount > 0) {\n for (let i = 0; i < currentCallbacks.length; i += 1) {\n currentCallbacks[i]?.(timestamp);\n }\n }\n };\n request(fn) {\n const id = this.nextId;\n this.nextId += 1;\n this.callbacks.push(fn);\n this.callbacksCount += 1;\n\n /* In a test environment with fake timers, a fake `requestAnimationFrame` can be called\n * but there's no guarantee that the animation frame will actually run before the fake\n * timers are teared, which leaves `isScheduled` set, but won't run our `tick()`. */\n const didRAFChange = process.env.NODE_ENV !== 'production' && LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);\n if (!this.isScheduled || didRAFChange) {\n requestAnimationFrame(this.tick);\n this.isScheduled = true;\n }\n return id;\n }\n cancel(id) {\n const index = id - this.startId;\n if (index < 0 || index >= this.callbacks.length) {\n return;\n }\n if (this.callbacks[index] === null) {\n return;\n }\n this.callbacks[index] = null;\n this.callbacksCount -= 1;\n }\n}\nlet scheduler = new Scheduler();\n\n/**\n * Replaces the shared scheduler and drops all pending animation frame callbacks.\n *\n * For test environments only. The scheduler is process-global, so a callback scheduled in one test\n * but never run (e.g. requested under fake timers that were torn down before the frame fired) would\n * otherwise survive into a later test and run there against stale state. Call between tests to drop\n * such leftovers.\n */\nexport function resetAnimationFrameScheduler() {\n const previous = scheduler;\n scheduler = new Scheduler();\n // Continue the id sequence so `cancel()` calls from `AnimationFrame` instances created before the\n // reset cannot cancel callbacks scheduled after it.\n scheduler.nextId = previous.nextId;\n scheduler.startId = previous.nextId;\n // A frame requested before the reset may still be pending and holds the previous scheduler's\n // `tick`; empty its queue in place so that frame runs nothing when it eventually fires.\n previous.callbacks = [];\n previous.callbacksCount = 0;\n}\nexport class AnimationFrame {\n static create() {\n return new AnimationFrame();\n }\n static request(fn) {\n return scheduler.request(fn);\n }\n static cancel(id) {\n return scheduler.cancel(id);\n }\n currentId = EMPTY;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n request(fn) {\n this.cancel();\n this.currentId = scheduler.request(() => {\n this.currentId = EMPTY;\n fn();\n });\n }\n cancel = () => {\n if (this.currentId !== EMPTY) {\n scheduler.cancel(this.currentId);\n this.currentId = EMPTY;\n }\n };\n disposeEffect = () => {\n return this.cancel;\n };\n}\n\n/**\n * A `requestAnimationFrame` with automatic cleanup and guard.\n */\nexport function useAnimationFrame() {\n const timeout = useRefWithInit(AnimationFrame.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}"],"names":[],"mappings":";;;;;AAQO,SAAS,WAAW,IAAI;AAG7B,QAAM,UAAU,IAAI,WAAW;AAEjC;ACLA,MAAM,QAAQ;AACd,IAAI,WAAW,WAAW;AAC1B,MAAM,UAAU;AAAA,EAAhB;AASE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qCAAY,CAAA;AACZ,0CAAiB;AACjB,kCAAS;AACT,mCAAU;AACV,uCAAc;AACd,gCAAO,eAAa;;AAClB,WAAK,cAAc;AACnB,YAAM,mBAAmB,KAAK;AAC9B,YAAM,wBAAwB,KAAK;AAGnC,WAAK,YAAY,CAAA;AACjB,WAAK,iBAAiB;AACtB,WAAK,UAAU,KAAK;AACpB,UAAI,wBAAwB,GAAG;AAC7B,iBAAS,IAAI,GAAG,IAAI,iBAAiB,QAAQ,KAAK,GAAG;AACnD,iCAAiB,OAAjB,0CAAsB;AAAA,QACxB;AAAA,MACF;AAAA,IACF;AAAA;AAAA,EACA,QAAQ,IAAI;AACV,UAAM,KAAK,KAAK;AAChB,SAAK,UAAU;AACf,SAA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"version":3,"file":"useAnimationFrame-DqvuRtgK.js","sources":["../node_modules/@base-ui/utils/useOnMount.mjs","../node_modules/@base-ui/utils/useAnimationFrame.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { EMPTY_ARRAY } from \"./empty.mjs\";\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport function useOnMount(fn) {\n // 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\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY_ARRAY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nimport { useOnMount } from \"./useOnMount.mjs\";\n/** Unlike `setTimeout`, rAF doesn't guarantee a positive integer return value, so we can't have\n * a monomorphic `uint` type with `0` meaning empty.\n * See warning note at:\n * https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame#return_value */\nconst EMPTY = null;\nlet LAST_RAF = globalThis.requestAnimationFrame;\nclass Scheduler {\n /* This implementation uses an array as a backing data-structure for frame callbacks.\n * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it\n * never calls the native `cancelAnimationFrame` if there are no frames left. This can\n * be much more efficient if there is a call pattern that alterns as\n * \"request-cancel-request-cancel-…\".\n * But in the case of \"request-request-…-cancel-cancel-…\", it leaves the final animation\n * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */\n\n callbacks = [];\n callbacksCount = 0;\n nextId = 1;\n startId = 1;\n isScheduled = false;\n tick = timestamp => {\n this.isScheduled = false;\n const currentCallbacks = this.callbacks;\n const currentCallbacksCount = this.callbacksCount;\n\n // Update these before iterating, callbacks could call `requestAnimationFrame` again.\n this.callbacks = [];\n this.callbacksCount = 0;\n this.startId = this.nextId;\n if (currentCallbacksCount > 0) {\n for (let i = 0; i < currentCallbacks.length; i += 1) {\n currentCallbacks[i]?.(timestamp);\n }\n }\n };\n request(fn) {\n const id = this.nextId;\n this.nextId += 1;\n this.callbacks.push(fn);\n this.callbacksCount += 1;\n\n /* In a test environment with fake timers, a fake `requestAnimationFrame` can be called\n * but there's no guarantee that the animation frame will actually run before the fake\n * timers are teared, which leaves `isScheduled` set, but won't run our `tick()`. */\n const didRAFChange = process.env.NODE_ENV !== 'production' && LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);\n if (!this.isScheduled || didRAFChange) {\n requestAnimationFrame(this.tick);\n this.isScheduled = true;\n }\n return id;\n }\n cancel(id) {\n const index = id - this.startId;\n if (index < 0 || index >= this.callbacks.length) {\n return;\n }\n if (this.callbacks[index] === null) {\n return;\n }\n this.callbacks[index] = null;\n this.callbacksCount -= 1;\n }\n}\nlet scheduler = new Scheduler();\n\n/**\n * Replaces the shared scheduler and drops all pending animation frame callbacks.\n *\n * For test environments only. The scheduler is process-global, so a callback scheduled in one test\n * but never run (e.g. requested under fake timers that were torn down before the frame fired) would\n * otherwise survive into a later test and run there against stale state. Call between tests to drop\n * such leftovers.\n */\nexport function resetAnimationFrameScheduler() {\n const previous = scheduler;\n scheduler = new Scheduler();\n // Continue the id sequence so `cancel()` calls from `AnimationFrame` instances created before the\n // reset cannot cancel callbacks scheduled after it.\n scheduler.nextId = previous.nextId;\n scheduler.startId = previous.nextId;\n // A frame requested before the reset may still be pending and holds the previous scheduler's\n // `tick`; empty its queue in place so that frame runs nothing when it eventually fires.\n previous.callbacks = [];\n previous.callbacksCount = 0;\n}\nexport class AnimationFrame {\n static create() {\n return new AnimationFrame();\n }\n static request(fn) {\n return scheduler.request(fn);\n }\n static cancel(id) {\n return scheduler.cancel(id);\n }\n currentId = EMPTY;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n request(fn) {\n this.cancel();\n this.currentId = scheduler.request(() => {\n this.currentId = EMPTY;\n fn();\n });\n }\n cancel = () => {\n if (this.currentId !== EMPTY) {\n scheduler.cancel(this.currentId);\n this.currentId = EMPTY;\n }\n };\n disposeEffect = () => {\n return this.cancel;\n };\n}\n\n/**\n * A `requestAnimationFrame` with automatic cleanup and guard.\n */\nexport function useAnimationFrame() {\n const timeout = useRefWithInit(AnimationFrame.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}"],"names":[],"mappings":";;;;;AAQO,SAAS,WAAW,IAAI;AAG7B,QAAM,UAAU,IAAI,WAAW;AAEjC;ACLA,MAAM,QAAQ;AACd,IAAI,WAAW,WAAW;AAC1B,MAAM,UAAU;AAAA,EAAhB;AASE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qCAAY,CAAA;AACZ,0CAAiB;AACjB,kCAAS;AACT,mCAAU;AACV,uCAAc;AACd,gCAAO,eAAa;;AAClB,WAAK,cAAc;AACnB,YAAM,mBAAmB,KAAK;AAC9B,YAAM,wBAAwB,KAAK;AAGnC,WAAK,YAAY,CAAA;AACjB,WAAK,iBAAiB;AACtB,WAAK,UAAU,KAAK;AACpB,UAAI,wBAAwB,GAAG;AAC7B,iBAAS,IAAI,GAAG,IAAI,iBAAiB,QAAQ,KAAK,GAAG;AACnD,iCAAiB,OAAjB,0CAAsB;AAAA,QACxB;AAAA,MACF;AAAA,IACF;AAAA;AAAA,EACA,QAAQ,IAAI;AACV,UAAM,KAAK,KAAK;AAChB,SAAK,UAAU;AACf,SAAK,UAAU,KAAK,EAAE;AACtB,SAAK,kBAAkB;AAKvB,UAAM,eAAe,QAAQ,IAAI,aAAa,gBAAgB,aAAa,0BAA0B,WAAW,uBAAuB;AACvI,QAAI,CAAC,KAAK,eAAe,cAAc;AACrC,4BAAsB,KAAK,IAAI;AAC/B,WAAK,cAAc;AAAA,IACrB;AACA,WAAO;AAAA,EACT;AAAA,EACA,OAAO,IAAI;AACT,UAAM,QAAQ,KAAK,KAAK;AACxB,QAAI,QAAQ,KAAK,SAAS,KAAK,UAAU,QAAQ;AAC/C;AAAA,IACF;AACA,QAAI,KAAK,UAAU,KAAK,MAAM,MAAM;AAClC;AAAA,IACF;AACA,SAAK,UAAU,KAAK,IAAI;AACxB,SAAK,kBAAkB;AAAA,EACzB;AACF;AACA,IAAI,YAAY,IAAI,UAAS;AAsBtB,MAAM,eAAe;AAAA,EAArB;AAUL,qCAAY;AAYZ,kCAAS,MAAM;AACb,UAAI,KAAK,cAAc,OAAO;AAC5B,kBAAU,OAAO,KAAK,SAAS;AAC/B,aAAK,YAAY;AAAA,MACnB;AAAA,IACF;AACA,yCAAgB,MAAM;AACpB,aAAO,KAAK;AAAA,IACd;AAAA;AAAA,EA7BA,OAAO,SAAS;AACd,WAAO,IAAI,eAAc;AAAA,EAC3B;AAAA,EACA,OAAO,QAAQ,IAAI;AACjB,WAAO,UAAU,QAAQ,EAAE;AAAA,EAC7B;AAAA,EACA,OAAO,OAAO,IAAI;AAChB,WAAO,UAAU,OAAO,EAAE;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA,EAMA,QAAQ,IAAI;AACV,SAAK,OAAM;AACX,SAAK,YAAY,UAAU,QAAQ,MAAM;AACvC,WAAK,YAAY;AACjB,SAAE;AAAA,IACJ,CAAC;AAAA,EACH;AAUF;AAKO,SAAS,oBAAoB;AAClC,QAAM,UAAU,eAAe,eAAe,MAAM,EAAE;AACtD,aAAW,QAAQ,aAAa;AAChC,SAAO;AACT;","x_google_ignoreList":[0,1]}
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- import { u as useIsoLayoutEffect } from "./useIsoLayoutEffect-e9VA-ICd.js";
3
- import { u as useBaseUiId } from "./useBaseUiId-jtgiQp--.js";
2
+ import { u as useIsoLayoutEffect } from "./useIsoLayoutEffect-D2lpsB9D.js";
3
+ import { u as useBaseUiId } from "./useBaseUiId-CYT1vFMG.js";
4
4
  function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId, ariaLabel) {
5
5
  const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = React.useState();
6
6
  const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : void 0);
@@ -46,4 +46,4 @@ function findAssociatedLabel(labelSource) {
46
46
  export {
47
47
  useAriaLabelledBy as u
48
48
  };
49
- //# sourceMappingURL=useAriaLabelledBy-C9SDiruE.js.map
49
+ //# sourceMappingURL=useAriaLabelledBy-CP4wKTYs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAriaLabelledBy-C9SDiruE.js","sources":["../node_modules/@base-ui/react/internals/labelable-provider/useAriaLabelledBy.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../useBaseUiId.mjs\";\nexport function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId, ariaLabel) {\n const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = React.useState();\n const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : undefined);\n // A non-blank `aria-label` wins over any associated label, as it does on native inputs.\n const hasAriaLabel = Boolean(ariaLabel?.trim());\n const implicitLabelId = hasAriaLabel ? undefined : labelId;\n const ariaLabelledBy = explicitAriaLabelledBy ?? implicitLabelId ?? fallbackAriaLabelledBy;\n\n // Fallback for <span> controls labelled by wrapping/sibling native <label>.\n // Run after every commit so DOM association changes (e.g. label mount/unmount)\n // are reflected even when props/state deps are unchanged.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useIsoLayoutEffect(() => {\n const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || hasAriaLabel || !enableFallback ? undefined : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);\n if (fallbackAriaLabelledBy !== nextAriaLabelledBy) {\n setFallbackAriaLabelledBy(nextAriaLabelledBy);\n }\n });\n return ariaLabelledBy;\n}\nfunction getAriaLabelledBy(labelSource, generatedLabelId) {\n const label = findAssociatedLabel(labelSource);\n if (!label) {\n return undefined;\n }\n if (!label.id && generatedLabelId) {\n label.id = generatedLabelId;\n }\n return label.id || undefined;\n}\nfunction findAssociatedLabel(labelSource) {\n if (!labelSource) {\n return undefined;\n }\n\n // Fast path before the expensive `.labels` read.\n const parent = labelSource.parentElement;\n if (parent && parent.tagName === 'LABEL') {\n return parent;\n }\n const controlId = labelSource.id;\n if (controlId) {\n const nextSibling = labelSource.nextElementSibling;\n if (nextSibling && nextSibling.htmlFor === controlId) {\n return nextSibling;\n }\n }\n const labels = labelSource.labels;\n return labels && labels[0];\n}"],"names":[],"mappings":";;;AAKO,SAAS,kBAAkB,wBAAwB,SAAS,gBAAgB,iBAAiB,MAAM,eAAe,WAAW;AAClI,QAAM,CAAC,wBAAwB,yBAAyB,IAAI,MAAM,SAAQ;AAC1E,QAAM,mBAAmB,YAAY,gBAAgB,GAAG,aAAa,WAAW,MAAS;AAEzF,QAAM,eAAe,QAAQ,uCAAW,MAAM;AAC9C,QAAM,kBAAkB,eAAe,SAAY;AACnD,QAAM,iBAAiB,0BAA0B,mBAAmB;AAMpE,qBAAmB,MAAM;AACvB,UAAM,qBAAqB,0BAA0B,WAAW,gBAAgB,CAAC,iBAAiB,SAAY,kBAAkB,eAAe,SAAS,gBAAgB;AACxK,QAAI,2BAA2B,oBAAoB;AACjD,gCAA0B,kBAAkB;AAAA,IAC9C;AAAA,EACF,CAAC;AACD,SAAO;AACT;AACA,SAAS,kBAAkB,aAAa,kBAAkB;AACxD,QAAM,QAAQ,oBAAoB,WAAW;AAC7C,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AACA,MAAI,CAAC,MAAM,MAAM,kBAAkB;AACjC,UAAM,KAAK;AAAA,EACb;AACA,SAAO,MAAM,MAAM;AACrB;AACA,SAAS,oBAAoB,aAAa;AACxC,MAAI,CAAC,aAAa;AAChB,WAAO;AAAA,EACT;AAGA,QAAM,SAAS,YAAY;AAC3B,MAAI,UAAU,OAAO,YAAY,SAAS;AACxC,WAAO;AAAA,EACT;AACA,QAAM,YAAY,YAAY;AAC9B,MAAI,WAAW;AACb,UAAM,cAAc,YAAY;AAChC,QAAI,eAAe,YAAY,YAAY,WAAW;AACpD,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,SAAS,YAAY;AAC3B,SAAO,UAAU,OAAO,CAAC;AAC3B;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"useAriaLabelledBy-CP4wKTYs.js","sources":["../node_modules/@base-ui/react/internals/labelable-provider/useAriaLabelledBy.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../useBaseUiId.mjs\";\nexport function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId, ariaLabel) {\n const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = React.useState();\n const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : undefined);\n // A non-blank `aria-label` wins over any associated label, as it does on native inputs.\n const hasAriaLabel = Boolean(ariaLabel?.trim());\n const implicitLabelId = hasAriaLabel ? undefined : labelId;\n const ariaLabelledBy = explicitAriaLabelledBy ?? implicitLabelId ?? fallbackAriaLabelledBy;\n\n // Fallback for <span> controls labelled by wrapping/sibling native <label>.\n // Run after every commit so DOM association changes (e.g. label mount/unmount)\n // are reflected even when props/state deps are unchanged.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useIsoLayoutEffect(() => {\n const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || hasAriaLabel || !enableFallback ? undefined : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);\n if (fallbackAriaLabelledBy !== nextAriaLabelledBy) {\n setFallbackAriaLabelledBy(nextAriaLabelledBy);\n }\n });\n return ariaLabelledBy;\n}\nfunction getAriaLabelledBy(labelSource, generatedLabelId) {\n const label = findAssociatedLabel(labelSource);\n if (!label) {\n return undefined;\n }\n if (!label.id && generatedLabelId) {\n label.id = generatedLabelId;\n }\n return label.id || undefined;\n}\nfunction findAssociatedLabel(labelSource) {\n if (!labelSource) {\n return undefined;\n }\n\n // Fast path before the expensive `.labels` read.\n const parent = labelSource.parentElement;\n if (parent && parent.tagName === 'LABEL') {\n return parent;\n }\n const controlId = labelSource.id;\n if (controlId) {\n const nextSibling = labelSource.nextElementSibling;\n if (nextSibling && nextSibling.htmlFor === controlId) {\n return nextSibling;\n }\n }\n const labels = labelSource.labels;\n return labels && labels[0];\n}"],"names":[],"mappings":";;;AAKO,SAAS,kBAAkB,wBAAwB,SAAS,gBAAgB,iBAAiB,MAAM,eAAe,WAAW;AAClI,QAAM,CAAC,wBAAwB,yBAAyB,IAAI,MAAM,SAAQ;AAC1E,QAAM,mBAAmB,YAAY,gBAAgB,GAAG,aAAa,WAAW,MAAS;AAEzF,QAAM,eAAe,QAAQ,uCAAW,MAAM;AAC9C,QAAM,kBAAkB,eAAe,SAAY;AACnD,QAAM,iBAAiB,0BAA0B,mBAAmB;AAMpE,qBAAmB,MAAM;AACvB,UAAM,qBAAqB,0BAA0B,WAAW,gBAAgB,CAAC,iBAAiB,SAAY,kBAAkB,eAAe,SAAS,gBAAgB;AACxK,QAAI,2BAA2B,oBAAoB;AACjD,gCAA0B,kBAAkB;AAAA,IAC9C;AAAA,EACF,CAAC;AACD,SAAO;AACT;AACA,SAAS,kBAAkB,aAAa,kBAAkB;AACxD,QAAM,QAAQ,oBAAoB,WAAW;AAC7C,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AACA,MAAI,CAAC,MAAM,MAAM,kBAAkB;AACjC,UAAM,KAAK;AAAA,EACb;AACA,SAAO,MAAM,MAAM;AACrB;AACA,SAAS,oBAAoB,aAAa;AACxC,MAAI,CAAC,aAAa;AAChB,WAAO;AAAA,EACT;AAGA,QAAM,SAAS,YAAY;AAC3B,MAAI,UAAU,OAAO,YAAY,SAAS;AACxC,WAAO;AAAA,EACT;AACA,QAAM,YAAY,YAAY;AAC9B,MAAI,WAAW;AACb,UAAM,cAAc,YAAY;AAChC,QAAI,eAAe,YAAY,YAAY,WAAW;AACpD,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,SAAS,YAAY;AAC3B,SAAO,UAAU,OAAO,CAAC;AAC3B;","x_google_ignoreList":[0]}
@@ -1,4 +1,4 @@
1
- import { d as EMPTY_OBJECT, S as SafeReact } from "./useIsoLayoutEffect-e9VA-ICd.js";
1
+ import { d as EMPTY_OBJECT, S as SafeReact } from "./useIsoLayoutEffect-D2lpsB9D.js";
2
2
  import * as React from "react";
3
3
  function hasWindow() {
4
4
  return typeof window !== "undefined";
@@ -154,6 +154,12 @@ function getOverflowAncestors(node, list, traverseIframes) {
154
154
  function getFrameElement(win) {
155
155
  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
156
156
  }
157
+ function useForcedRerendering() {
158
+ const [, setState] = React.useState({});
159
+ return React.useCallback(() => {
160
+ setState({});
161
+ }, []);
162
+ }
157
163
  function createChangeEventDetails(reason, event, trigger, customProperties) {
158
164
  let canceled = false;
159
165
  let allowPropagation = false;
@@ -179,7 +185,7 @@ function createChangeEventDetails(reason, event, trigger, customProperties) {
179
185
  return details;
180
186
  }
181
187
  function createGenericEventDetails(reason, event, customProperties) {
182
- const custom = EMPTY_OBJECT;
188
+ const custom = customProperties ?? EMPTY_OBJECT;
183
189
  const details = {
184
190
  reason,
185
191
  event: event ?? new Event("base-ui"),
@@ -192,23 +198,27 @@ const triggerPress = "trigger-press";
192
198
  const triggerHover = "trigger-hover";
193
199
  const triggerFocus = "trigger-focus";
194
200
  const outsidePress = "outside-press";
201
+ const itemPress = "item-press";
195
202
  const closePress = "close-press";
203
+ const clearPress = "clear-press";
204
+ const chipRemovePress = "chip-remove-press";
196
205
  const trackPress = "track-press";
197
206
  const inputChange = "input-change";
207
+ const inputClear = "input-clear";
208
+ const inputPress = "input-press";
198
209
  const focusOut = "focus-out";
199
210
  const escapeKey = "escape-key";
211
+ const listNavigation = "list-navigation";
200
212
  const keyboard = "keyboard";
213
+ const pointer = "pointer";
201
214
  const drag = "drag";
215
+ const cancelOpen = "cancel-open";
216
+ const siblingOpen = "sibling-open";
202
217
  const disabled = "disabled";
203
218
  const missing = "missing";
204
219
  const initial = "initial";
205
220
  const imperativeAction = "imperative-action";
206
- function useForcedRerendering() {
207
- const [, setState] = React.useState({});
208
- return React.useCallback(() => {
209
- setState({});
210
- }, []);
211
- }
221
+ const windowResize = "window-resize";
212
222
  let globalId = 0;
213
223
  function useGlobalId(idOverride, prefix = "mui") {
214
224
  const defaultId = React.useRef(void 0);
@@ -237,20 +247,30 @@ function useBaseUiId(idOverride) {
237
247
  return useId(idOverride, "base-ui");
238
248
  }
239
249
  export {
240
- useId as A,
241
- isNode as B,
242
- outsidePress as C,
243
- triggerFocus as D,
244
- isOverflowElement as E,
245
- getOverflowAncestors as F,
246
- getDocumentElement as G,
247
- isTopLayer as H,
248
- isTableElement as I,
249
- isContainingBlock as J,
250
- getContainingBlock as K,
251
- getNodeScroll as L,
252
- isWebKit as M,
253
- getFrameElement as N,
250
+ isElement as A,
251
+ listNavigation as B,
252
+ keyboard as C,
253
+ chipRemovePress as D,
254
+ clearPress as E,
255
+ windowResize as F,
256
+ pointer as G,
257
+ siblingOpen as H,
258
+ triggerHover as I,
259
+ triggerFocus as J,
260
+ drag as K,
261
+ trackPress as L,
262
+ getNodeName as M,
263
+ isShadowRoot as N,
264
+ isNode as O,
265
+ getDocumentElement as P,
266
+ isTopLayer as Q,
267
+ isTableElement as R,
268
+ isContainingBlock as S,
269
+ getContainingBlock as T,
270
+ isOverflowElement as U,
271
+ getNodeScroll as V,
272
+ isWebKit as W,
273
+ getFrameElement as X,
254
274
  initial as a,
255
275
  getWindow as b,
256
276
  createChangeEventDetails as c,
@@ -260,22 +280,22 @@ export {
260
280
  getComputedStyle as g,
261
281
  isLastTraversableNode as h,
262
282
  isHTMLElement as i,
263
- closePress as j,
264
- focusOut as k,
265
- triggerPress as l,
283
+ useId as j,
284
+ cancelOpen as k,
285
+ createGenericEventDetails as l,
266
286
  missing as m,
267
287
  none as n,
268
- escapeKey as o,
269
- imperativeAction as p,
270
- createGenericEventDetails as q,
271
- keyboard as r,
272
- inputChange as s,
273
- triggerHover as t,
288
+ inputClear as o,
289
+ inputChange as p,
290
+ getOverflowAncestors as q,
291
+ escapeKey as r,
292
+ focusOut as s,
293
+ triggerPress as t,
274
294
  useBaseUiId as u,
275
- isElement as v,
276
- drag as w,
277
- trackPress as x,
278
- getNodeName as y,
279
- isShadowRoot as z
295
+ outsidePress as v,
296
+ itemPress as w,
297
+ inputPress as x,
298
+ imperativeAction as y,
299
+ closePress as z
280
300
  };
281
- //# sourceMappingURL=useBaseUiId-jtgiQp--.js.map
301
+ //# sourceMappingURL=useBaseUiId-CYT1vFMG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseUiId-jtgiQp--.js","sources":["../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs","../node_modules/@base-ui/react/internals/reason-parts.mjs","../node_modules/@base-ui/utils/useForcedRerendering.mjs","../node_modules/@base-ui/utils/useId.mjs","../node_modules/@base-ui/react/internals/useBaseUiId.mjs"],"sourcesContent":["function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return (node.ownerDocument || node).body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\n\n/**\n * Maps a change `reason` string to the corresponding native event type.\n */\n\n/**\n * Details of custom change events emitted by Base UI components.\n */\n\n/**\n * Details of custom generic events emitted by Base UI components.\n */\n\n/** Highlight navigation uses mouse events for hover and pointer events for leaving an item. */\n\n/**\n * Creates a Base UI event details object with the given reason and utilities\n * for preventing Base UI's internal event handling.\n */\nexport function createChangeEventDetails(reason, event, trigger, customProperties) {\n let canceled = false;\n let allowPropagation = false;\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n cancel() {\n canceled = true;\n },\n allowPropagation() {\n allowPropagation = true;\n },\n get isCanceled() {\n return canceled;\n },\n get isPropagationAllowed() {\n return allowPropagation;\n },\n trigger,\n ...custom\n };\n return details;\n}\nexport function createGenericEventDetails(reason, event, customProperties) {\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n ...custom\n };\n return details;\n}","export const none = 'none';\nexport const triggerPress = 'trigger-press';\nexport const triggerHover = 'trigger-hover';\nexport const triggerFocus = 'trigger-focus';\nexport const outsidePress = 'outside-press';\nexport const itemPress = 'item-press';\nexport const closePress = 'close-press';\nexport const linkPress = 'link-press';\nexport const clearPress = 'clear-press';\nexport const chipRemovePress = 'chip-remove-press';\nexport const trackPress = 'track-press';\nexport const incrementPress = 'increment-press';\nexport const decrementPress = 'decrement-press';\nexport const inputChange = 'input-change';\nexport const inputClear = 'input-clear';\nexport const inputBlur = 'input-blur';\nexport const inputPaste = 'input-paste';\nexport const inputPress = 'input-press';\nexport const focusOut = 'focus-out';\nexport const escapeKey = 'escape-key';\nexport const closeWatcher = 'close-watcher';\nexport const listNavigation = 'list-navigation';\nexport const keyboard = 'keyboard';\nexport const pointer = 'pointer';\nexport const drag = 'drag';\nexport const wheel = 'wheel';\nexport const scrub = 'scrub';\nexport const popupClose = 'popup-close';\nexport const cancelOpen = 'cancel-open';\nexport const siblingOpen = 'sibling-open';\nexport const disabled = 'disabled';\nexport const missing = 'missing';\nexport const initial = 'initial';\nexport const imperativeAction = 'imperative-action';\nexport const swipe = 'swipe';\nexport const windowResize = 'window-resize';","'use client';\n\nimport * as React from 'react';\n\n/**\n * Returns a function that forces a rerender.\n */\nexport function useForcedRerendering() {\n const [, setState] = React.useState({});\n return React.useCallback(() => {\n setState({});\n }, []);\n}","'use client';\n\nimport * as React from 'react';\nimport { SafeReact } from \"./safeReact.mjs\";\nimport { useForcedRerendering } from \"./useForcedRerendering.mjs\";\nlet globalId = 0;\n\n// TODO React 17: Remove `useGlobalId` once React 17 support is removed\nfunction useGlobalId(idOverride, prefix = 'mui') {\n const defaultId = React.useRef(undefined);\n const forceRerender = useForcedRerendering();\n const id = idOverride ?? defaultId.current;\n React.useEffect(() => {\n if (defaultId.current == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n defaultId.current = `${prefix}-${globalId}`;\n // Generate the fallback even while `idOverride` is set.\n // Removing the override then swaps in the existing id within the same commit.\n // Deferring generation would leave one commit with no id, breaking `htmlFor` and `aria-labelledby` links.\n // Only rerender when the fallback is the value being rendered.\n if (idOverride == null) {\n forceRerender();\n }\n }\n }, [idOverride, prefix, forceRerender]);\n return id;\n}\nconst maybeReactUseId = SafeReact.useId;\n\n/**\n *\n * @example <div id={useId()} />\n * @param {string | undefined} idOverride overrides the generated id when provided\n * @param {string | undefined} prefix prefixes the generated id when provided\n * @returns {string | undefined}\n */\nexport function useId(idOverride, prefix) {\n // React.useId() is only available from React 18.0.0.\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);\n }\n\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride, prefix);\n}","'use client';\n\nimport { useId } from '@base-ui/utils/useId';\n\n/**\n * Wraps `useId` and prefixes generated `id`s with `base-ui-`\n * @param {string | undefined} idOverride overrides the generated id when provided\n * @returns {string | undefined}\n */\nexport function useBaseUiId(idOverride) {\n return useId(idOverride, 'base-ui');\n}"],"names":[],"mappings":";;AAAA,SAAS,YAAY;AACnB,SAAO,OAAO,WAAW;AAC3B;AACA,SAAS,YAAY,MAAM;AACzB,MAAI,OAAO,IAAI,GAAG;AAChB,YAAQ,KAAK,YAAY,IAAI,YAAW;AAAA,EAC1C;AAIA,SAAO;AACT;AACA,SAAS,UAAU,MAAM;AACvB,MAAI;AACJ,UAAQ,QAAQ,SAAS,sBAAsB,KAAK,kBAAkB,OAAO,SAAS,oBAAoB,gBAAgB;AAC5H;AACA,SAAS,mBAAmB,MAAM;AAChC,MAAI;AACJ,UAAQ,QAAQ,OAAO,IAAI,IAAI,KAAK,gBAAgB,KAAK,aAAa,OAAO,aAAa,OAAO,SAAS,KAAK;AACjH;AACA,SAAS,OAAO,OAAO;AACrB,MAAI,CAAC,UAAS,GAAI;AAChB,WAAO;AAAA,EACT;AACA,SAAO,iBAAiB,QAAQ,iBAAiB,UAAU,KAAK,EAAE;AACpE;AACA,SAAS,UAAU,OAAO;AACxB,MAAI,CAAC,UAAS,GAAI;AAChB,WAAO;AAAA,EACT;AACA,SAAO,iBAAiB,WAAW,iBAAiB,UAAU,KAAK,EAAE;AACvE;AACA,SAAS,cAAc,OAAO;AAC5B,MAAI,CAAC,UAAS,GAAI;AAChB,WAAO;AAAA,EACT;AACA,SAAO,iBAAiB,eAAe,iBAAiB,UAAU,KAAK,EAAE;AAC3E;AACA,SAAS,aAAa,OAAO;AAC3B,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AAe;AAChB,MAAC,eAAe;AAEhB,MAAC,aAAa;AAId,MAAC,aAAa;AAGd,MAAC,cAAc;AAKf,MAAC,WAAW;AACZ,MAAC,YAAY;AAGb,MAAC,WAAW;AAEZ,MAAC,OAAO;AAMR,MAAC,WAAW;AACZ,MAAC,UAAU;AACX,MAAC,UAAU;AACX,MAAC,mBAAmB;AC1BzB,SAAS,uBAAuB;AACrC,QAAM,CAAA,EAAG,QAAQ,IAAI,MAAM,SAAS,CAAA,CAAE;AACtC,SAAO,MAAM,YAAY,MAAM;AAC7B,aAAS,CAAA,CAAE;AAAA,EACb,GAAG,CAAA,CAAE;AACP;ACPA,IAAI,WAAW;AAGf,SAAS,YAAY,YAAY,SAAS,OAAO;AAC/C,QAAM,YAAY,MAAM,OAAO,MAAS;AACxC,QAAM,gBAAgB,qBAAoB;AAC1C,QAAM,KAAK,cAAc,UAAU;AACnC,QAAM,UAAU,MAAM;AACpB,QAAI,UAAU,WAAW,MAAM;AAK7B,kBAAY;AACZ,gBAAU,UAAU,GAAG,MAAM,IAAI,QAAQ;AAKzC,UAAI,cAAc,MAAM;AACtB,sBAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF,GAAG,CAAC,YAAY,QAAQ,aAAa,CAAC;AACtC,SAAO;AACT;AACA,MAAM,kBAAkB,UAAU;AAS3B,SAAS,MAAM,YAAY,QAAQ;AAExC,MAAI,oBAAoB,QAAW;AACjC,UAAM,UAAU,gBAAe;AAC/B,WAAO,eAAe,SAAS,GAAG,MAAM,IAAI,OAAO,KAAK;AAAA,EAC1D;AAIA,SAAO,YAAY,YAAY,MAAM;AACvC;ACzCO,SAAS,YAAY,YAAY;AACtC,SAAO,MAAM,YAAY,SAAS;AACpC;","x_google_ignoreList":[0,1,2,3,4,5]}
1
+ {"version":3,"file":"useBaseUiId-CYT1vFMG.js","sources":["../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../node_modules/@base-ui/utils/useForcedRerendering.mjs","../node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs","../node_modules/@base-ui/react/internals/reason-parts.mjs","../node_modules/@base-ui/utils/useId.mjs","../node_modules/@base-ui/react/internals/useBaseUiId.mjs"],"sourcesContent":["function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return (node.ownerDocument || node).body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","'use client';\n\nimport * as React from 'react';\n\n/**\n * Returns a function that forces a rerender.\n */\nexport function useForcedRerendering() {\n const [, setState] = React.useState({});\n return React.useCallback(() => {\n setState({});\n }, []);\n}","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\n\n/**\n * Maps a change `reason` string to the corresponding native event type.\n */\n\n/**\n * Details of custom change events emitted by Base UI components.\n */\n\n/**\n * Details of custom generic events emitted by Base UI components.\n */\n\n/** Highlight navigation uses mouse events for hover and pointer events for leaving an item. */\n\n/**\n * Creates a Base UI event details object with the given reason and utilities\n * for preventing Base UI's internal event handling.\n */\nexport function createChangeEventDetails(reason, event, trigger, customProperties) {\n let canceled = false;\n let allowPropagation = false;\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n cancel() {\n canceled = true;\n },\n allowPropagation() {\n allowPropagation = true;\n },\n get isCanceled() {\n return canceled;\n },\n get isPropagationAllowed() {\n return allowPropagation;\n },\n trigger,\n ...custom\n };\n return details;\n}\nexport function createGenericEventDetails(reason, event, customProperties) {\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n ...custom\n };\n return details;\n}","export const none = 'none';\nexport const triggerPress = 'trigger-press';\nexport const triggerHover = 'trigger-hover';\nexport const triggerFocus = 'trigger-focus';\nexport const outsidePress = 'outside-press';\nexport const itemPress = 'item-press';\nexport const closePress = 'close-press';\nexport const linkPress = 'link-press';\nexport const clearPress = 'clear-press';\nexport const chipRemovePress = 'chip-remove-press';\nexport const trackPress = 'track-press';\nexport const incrementPress = 'increment-press';\nexport const decrementPress = 'decrement-press';\nexport const inputChange = 'input-change';\nexport const inputClear = 'input-clear';\nexport const inputBlur = 'input-blur';\nexport const inputPaste = 'input-paste';\nexport const inputPress = 'input-press';\nexport const focusOut = 'focus-out';\nexport const escapeKey = 'escape-key';\nexport const closeWatcher = 'close-watcher';\nexport const listNavigation = 'list-navigation';\nexport const keyboard = 'keyboard';\nexport const pointer = 'pointer';\nexport const drag = 'drag';\nexport const wheel = 'wheel';\nexport const scrub = 'scrub';\nexport const popupClose = 'popup-close';\nexport const cancelOpen = 'cancel-open';\nexport const siblingOpen = 'sibling-open';\nexport const disabled = 'disabled';\nexport const missing = 'missing';\nexport const initial = 'initial';\nexport const imperativeAction = 'imperative-action';\nexport const swipe = 'swipe';\nexport const windowResize = 'window-resize';","'use client';\n\nimport * as React from 'react';\nimport { SafeReact } from \"./safeReact.mjs\";\nimport { useForcedRerendering } from \"./useForcedRerendering.mjs\";\nlet globalId = 0;\n\n// TODO React 17: Remove `useGlobalId` once React 17 support is removed\nfunction useGlobalId(idOverride, prefix = 'mui') {\n const defaultId = React.useRef(undefined);\n const forceRerender = useForcedRerendering();\n const id = idOverride ?? defaultId.current;\n React.useEffect(() => {\n if (defaultId.current == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n defaultId.current = `${prefix}-${globalId}`;\n // Generate the fallback even while `idOverride` is set.\n // Removing the override then swaps in the existing id within the same commit.\n // Deferring generation would leave one commit with no id, breaking `htmlFor` and `aria-labelledby` links.\n // Only rerender when the fallback is the value being rendered.\n if (idOverride == null) {\n forceRerender();\n }\n }\n }, [idOverride, prefix, forceRerender]);\n return id;\n}\nconst maybeReactUseId = SafeReact.useId;\n\n/**\n *\n * @example <div id={useId()} />\n * @param {string | undefined} idOverride overrides the generated id when provided\n * @param {string | undefined} prefix prefixes the generated id when provided\n * @returns {string | undefined}\n */\nexport function useId(idOverride, prefix) {\n // React.useId() is only available from React 18.0.0.\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);\n }\n\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride, prefix);\n}","'use client';\n\nimport { useId } from '@base-ui/utils/useId';\n\n/**\n * Wraps `useId` and prefixes generated `id`s with `base-ui-`\n * @param {string | undefined} idOverride overrides the generated id when provided\n * @returns {string | undefined}\n */\nexport function useBaseUiId(idOverride) {\n return useId(idOverride, 'base-ui');\n}"],"names":[],"mappings":";;AAAA,SAAS,YAAY;AACnB,SAAO,OAAO,WAAW;AAC3B;AACA,SAAS,YAAY,MAAM;AACzB,MAAI,OAAO,IAAI,GAAG;AAChB,YAAQ,KAAK,YAAY,IAAI,YAAW;AAAA,EAC1C;AAIA,SAAO;AACT;AACA,SAAS,UAAU,MAAM;AACvB,MAAI;AACJ,UAAQ,QAAQ,SAAS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AGf,SAAS,YAAY,YAAY,SAAS,OAAO;AAC/C,QAAM,YAAY,MAAM,OAAO,MAAS;AACxC,QAAM,gBAAgB,qBAAoB;AAC1C,QAAM,KAAK,cAAc,UAAU;AACnC,QAAM,UAAU,MAAM;AACpB,QAAI,UAAU,WAAW,MAAM;AAK7B,kBAAY;AACZ,gBAAU,UAAU,GAAG,MAAM,IAAI,QAAQ;AAKzC,UAAI,cAAc,MAAM;AACtB,sBAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF,GAAG,CAAC,YAAY,QAAQ,aAAa,CAAC;AACtC,SAAO;AACT;AACA,MAAM,kBAAkB,UAAU;AAS3B,SAAS,MAAM,YAAY,QAAQ;AAExC,MAAI,oBAAoB,QAAW;AACjC,UAAM,UAAU,gBAAe;AAC/B,WAAO,eAAe,SAAS,GAAG,MAAM,IAAI,OAAO,KAAK;AAAA,EAC1D;AAIA,SAAO,YAAY,YAAY,MAAM;AACvC;ACzCO,SAAS,YAAY,YAAY;AACtC,SAAO,MAAM,YAAY,SAAS;AACpC;","x_google_ignoreList":[0,1,2,3,4,5]}
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
- import { b as getWindow, i as isHTMLElement } from "./useBaseUiId-jtgiQp--.js";
3
- import { f as formatErrorMessage, S as SafeReact, u as useIsoLayoutEffect, m as mergeProps, g as makeEventPreventable, a as useStableCallback } from "./useIsoLayoutEffect-e9VA-ICd.js";
4
- import { e as error } from "./error-FX4R42W-.js";
2
+ import { b as getWindow, i as isHTMLElement } from "./useBaseUiId-CYT1vFMG.js";
3
+ import { f as formatErrorMessage, S as SafeReact, u as useIsoLayoutEffect, m as mergeProps, h as makeEventPreventable, a as useStableCallback } from "./useIsoLayoutEffect-D2lpsB9D.js";
4
+ import { e as error } from "./error-nCTLdGUr.js";
5
5
  const CompositeRootContext = /* @__PURE__ */ React.createContext(void 0);
6
6
  if (process.env.NODE_ENV !== "production") CompositeRootContext.displayName = "CompositeRootContext";
7
7
  function useCompositeRootContext(optional = false) {
@@ -232,4 +232,4 @@ export {
232
232
  dispatchClickWithModifiers as d,
233
233
  useCompositeRootContext as u
234
234
  };
235
- //# sourceMappingURL=useButton-BalOc_EL.js.map
235
+ //# sourceMappingURL=useButton-BlHadUfM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useButton-BalOc_EL.js","sources":["../node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs","../node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs","../node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs","../node_modules/@base-ui/react/internals/use-button/useButton.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CompositeRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CompositeRootContext.displayName = \"CompositeRootContext\";\nexport function useCompositeRootContext(optional = false) {\n const context = React.useContext(CompositeRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.' : _formatErrorMessage(16));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport function useFocusableWhenDisabled(parameters) {\n const {\n focusableWhenDisabled,\n disabled,\n composite = false,\n tabIndex: tabIndexProp = 0,\n isNativeButton\n } = parameters;\n const isFocusableComposite = composite && focusableWhenDisabled !== false;\n const isNonFocusableComposite = composite && focusableWhenDisabled === false;\n\n // we can't explicitly assign `undefined` to any of these props because it\n // would otherwise prevent subsequently merged props from setting them\n const props = React.useMemo(() => {\n const additionalProps = {\n // allow Tabbing away from focusableWhenDisabled elements\n onKeyDown(event) {\n if (disabled && focusableWhenDisabled && event.key !== 'Tab') {\n event.preventDefault();\n }\n }\n };\n if (!composite) {\n additionalProps.tabIndex = tabIndexProp;\n if (!isNativeButton && disabled) {\n additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;\n }\n }\n if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {\n additionalProps['aria-disabled'] = disabled;\n }\n if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {\n additionalProps.disabled = disabled;\n }\n return additionalProps;\n }, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);\n return {\n props\n };\n}","import { ownerWindow } from '@base-ui/utils/owner';\n/**\n * Dispatches a constructed click on the target so it carries the source event's\n * modifier state, which `click()` always reports as unpressed. Like `click()`,\n * the untrusted click still runs native activation behavior (form submission,\n * link navigation).\n * `detail` defaults to 0 and `pointerType` to `''` (the native convention for\n * keyboard-generated clicks). When the click represents a mouse gesture, pass\n * `detail: 1` and `pointerType: 'mouse'` so consumers don't classify it as a\n * keyboard activation.\n */\nexport function dispatchClickWithModifiers(target, sourceEvent, {\n detail = 0,\n pointerType = ''\n} = {}) {\n target.dispatchEvent(new (ownerWindow(target).PointerEvent)('click', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail,\n pointerType,\n shiftKey: sourceEvent.shiftKey,\n ctrlKey: sourceEvent.ctrlKey,\n altKey: sourceEvent.altKey,\n metaKey: sourceEvent.metaKey\n }));\n}","'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { makeEventPreventable, mergeProps } from \"../../merge-props/index.mjs\";\nimport { useCompositeRootContext } from \"../composite/root/CompositeRootContext.mjs\";\nimport { useFocusableWhenDisabled } from \"../../utils/useFocusableWhenDisabled.mjs\";\nimport { dispatchClickWithModifiers } from \"../../utils/dispatchClickWithModifiers.mjs\";\nexport function useButton(parameters = {}) {\n const {\n disabled = false,\n focusableWhenDisabled,\n tabIndex = 0,\n native: isNativeButton = true,\n composite: compositeProp\n } = parameters;\n const elementRef = React.useRef(null);\n const compositeRootContext = useCompositeRootContext(true);\n const isCompositeItem = compositeProp ?? compositeRootContext !== undefined;\n const {\n props: focusableWhenDisabledProps\n } = useFocusableWhenDisabled({\n focusableWhenDisabled,\n disabled,\n composite: isCompositeItem,\n tabIndex,\n isNativeButton\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!elementRef.current) {\n return;\n }\n const isButtonTag = isButtonElement(elementRef.current);\n if (isNativeButton) {\n if (!isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a native <button> because the ' + '`nativeButton` prop is true. Rendering a non-<button> removes native button ' + 'semantics, which can impact forms and accessibility. Use a real <button> in the ' + '`render` prop, or set `nativeButton` to `false`.';\n error(`${message}${ownerStackMessage}`);\n }\n } else if (isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a non-<button> because the `nativeButton` ' + 'prop is false. Rendering a <button> keeps native behavior while Base UI applies ' + 'non-native attributes and handlers, which can add unintended extra attributes (such ' + 'as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set ' + '`nativeButton` to `true`.';\n error(`${message}${ownerStackMessage}`);\n }\n }, [isNativeButton]);\n }\n\n // handles a disabled composite button rendering another button, e.g.\n // <Toolbar.Button disabled render={<Menu.Trigger />} />\n // the `disabled` prop needs to pass through 2 `useButton`s then finally\n // delete the `disabled` attribute from DOM\n const updateDisabled = React.useCallback(() => {\n const element = elementRef.current;\n if (!isButtonElement(element)) {\n return;\n }\n if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === undefined && element.disabled) {\n element.disabled = false;\n }\n }, [disabled, focusableWhenDisabledProps.disabled, isCompositeItem]);\n useIsoLayoutEffect(updateDisabled, [updateDisabled]);\n const getButtonProps = React.useCallback((externalProps = {}) => {\n const {\n onClick: externalOnClick,\n onMouseDown: externalOnMouseDown,\n onKeyUp: externalOnKeyUp,\n onKeyDown: externalOnKeyDown,\n onPointerDown: externalOnPointerDown,\n ...otherExternalProps\n } = externalProps;\n return mergeProps({\n onClick(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnClick?.(event);\n },\n onMouseDown(event) {\n if (!disabled) {\n externalOnMouseDown?.(event);\n }\n },\n onKeyDown(event) {\n if (disabled) {\n return;\n }\n makeEventPreventable(event);\n externalOnKeyDown?.(event);\n if (event.baseUIHandlerPrevented) {\n return;\n }\n const isCurrentTarget = event.target === event.currentTarget;\n const currentTarget = event.currentTarget;\n const isButton = isButtonElement(currentTarget);\n const isLink = !isNativeButton && isValidLinkElement(currentTarget);\n const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);\n const isEnterKey = event.key === 'Enter';\n const isSpaceKey = event.key === ' ';\n const role = currentTarget.getAttribute('role');\n const isTextNavigationRole = role?.startsWith('menuitem') || role === 'option' || role === 'gridcell';\n if (isCurrentTarget && isCompositeItem && isSpaceKey) {\n if (event.defaultPrevented && isTextNavigationRole) {\n return;\n }\n event.preventDefault();\n\n // Only a native-mode item that isn't a real <button> is excluded.\n if (!isNativeButton || isButton) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n return;\n }\n\n // Keyboard accessibility for native and non-native elements.\n if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {\n // Space activates links on keyup (`role=\"button\"` semantics, matching the\n // composite path); prevent the page scroll Space would otherwise trigger.\n // Enter is left to the browser's native link activation.\n if (isCurrentTarget && isLink && isSpaceKey) {\n event.preventDefault();\n }\n return;\n }\n\n // Match native buttons: preventing the keydown's default cancels activation.\n if (event.defaultPrevented) {\n return;\n }\n event.preventDefault();\n if (isEnterKey) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n },\n onKeyUp(event) {\n if (disabled) {\n return;\n }\n\n // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed\n // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0\n makeEventPreventable(event);\n externalOnKeyUp?.(event);\n if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === ' ') {\n event.preventDefault();\n return;\n }\n if (event.baseUIHandlerPrevented) {\n return;\n }\n\n // Keyboard accessibility for non interactive elements.\n // Match native buttons: preventing the keyup's default cancels Space activation.\n // Limitation: unlike a native <button>, a prevented *keydown* cannot cancel the\n // activation — no state is kept between keydown and keyup, so we can't tell\n // whether the keydown was prevented or even happened on this element.\n if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === ' ') {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(event.currentTarget, event);\n }\n },\n onPointerDown(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnPointerDown?.(event);\n }\n }, isNativeButton ? {\n type: 'button'\n } : {\n role: 'button'\n }, focusableWhenDisabledProps, otherExternalProps);\n }, [disabled, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);\n const buttonRef = useStableCallback(element => {\n elementRef.current = element;\n updateDisabled();\n });\n return {\n getButtonProps,\n buttonRef\n };\n}\nfunction isButtonElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'BUTTON';\n}\nfunction isValidLinkElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'A' && Boolean(elem.href);\n}"],"names":["_formatErrorMessage","ownerWindow"],"mappings":";;;;AAIY,MAAC,uBAAoC,sBAAM,cAAc,MAAS;AAC9E,IAAI,QAAQ,IAAI,aAAa,aAAc,sBAAqB,cAAc;AACvE,SAAS,wBAAwB,WAAW,OAAO;AACxD,QAAM,UAAU,MAAM,WAAW,oBAAoB;AACrD,MAAI,YAAY,UAAa,CAAC,UAAU;AACtC,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,sGAAsGA,mBAAoB,EAAE,CAAC;AAAA,EACvL;AACA,SAAO;AACT;ACTO,SAA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AAM,qBAAoB;AAC1B,qCAA2B,eAAe,KAAK;AAAA,QACjD;AAAA,MACF;AAAA,MACA,QAAQ,OAAO;AACb,YAAI,UAAU;AACZ;AAAA,QACF;AAIA,6BAAqB,KAAK;AAC1B,2DAAkB;AAClB,YAAI,MAAM,WAAW,MAAM,iBAAiB,kBAAkB,mBAAmB,gBAAgB,MAAM,aAAa,KAAK,MAAM,QAAQ,KAAK;AAC1I,gBAAM,eAAc;AACpB;AAAA,QACF;AACA,YAAI,MAAM,wBAAwB;AAChC;AAAA,QACF;AAOA,YAAI,MAAM,WAAW,MAAM,iBAAiB,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,MAAM,oBAAoB,MAAM,QAAQ,KAAK;AAC/H,gBAAM,qBAAoB;AAC1B,qCAA2B,MAAM,eAAe,KAAK;AAAA,QACvD;AAAA,MACF;AAAA,MACA,cAAc,OAAO;AACnB,YAAI,UAAU;AACZ,gBAAM,eAAc;AACpB;AAAA,QACF;AACA,uEAAwB;AAAA,MAC1B;AAAA,IACN,GAAO,iBAAiB;AAAA,MAClB,MAAM;AAAA,IACZ,IAAQ;AAAA,MACF,MAAM;AAAA,IACZ,GAAO,4BAA4B,kBAAkB;AAAA,EACnD,GAAG,CAAC,UAAU,4BAA4B,iBAAiB,cAAc,CAAC;AAC1E,QAAM,YAAY,kBAAkB,aAAW;AAC7C,eAAW,UAAU;AACrB,mBAAc;AAAA,EAChB,CAAC;AACD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACJ;AACA;AACA,SAAS,gBAAgB,MAAM;AAC7B,SAAO,cAAc,IAAI,KAAK,KAAK,YAAY;AACjD;AACA,SAAS,mBAAmB,MAAM;AAChC,SAAO,cAAc,IAAI,KAAK,KAAK,YAAY,OAAO,QAAQ,KAAK,IAAI;AACzE;","x_google_ignoreList":[0,1,2,3]}
1
+ {"version":3,"file":"useButton-BlHadUfM.js","sources":["../node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs","../node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs","../node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs","../node_modules/@base-ui/react/internals/use-button/useButton.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CompositeRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CompositeRootContext.displayName = \"CompositeRootContext\";\nexport function useCompositeRootContext(optional = false) {\n const context = React.useContext(CompositeRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.' : _formatErrorMessage(16));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport function useFocusableWhenDisabled(parameters) {\n const {\n focusableWhenDisabled,\n disabled,\n composite = false,\n tabIndex: tabIndexProp = 0,\n isNativeButton\n } = parameters;\n const isFocusableComposite = composite && focusableWhenDisabled !== false;\n const isNonFocusableComposite = composite && focusableWhenDisabled === false;\n\n // we can't explicitly assign `undefined` to any of these props because it\n // would otherwise prevent subsequently merged props from setting them\n const props = React.useMemo(() => {\n const additionalProps = {\n // allow Tabbing away from focusableWhenDisabled elements\n onKeyDown(event) {\n if (disabled && focusableWhenDisabled && event.key !== 'Tab') {\n event.preventDefault();\n }\n }\n };\n if (!composite) {\n additionalProps.tabIndex = tabIndexProp;\n if (!isNativeButton && disabled) {\n additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;\n }\n }\n if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {\n additionalProps['aria-disabled'] = disabled;\n }\n if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {\n additionalProps.disabled = disabled;\n }\n return additionalProps;\n }, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);\n return {\n props\n };\n}","import { ownerWindow } from '@base-ui/utils/owner';\n/**\n * Dispatches a constructed click on the target so it carries the source event's\n * modifier state, which `click()` always reports as unpressed. Like `click()`,\n * the untrusted click still runs native activation behavior (form submission,\n * link navigation).\n * `detail` defaults to 0 and `pointerType` to `''` (the native convention for\n * keyboard-generated clicks). When the click represents a mouse gesture, pass\n * `detail: 1` and `pointerType: 'mouse'` so consumers don't classify it as a\n * keyboard activation.\n */\nexport function dispatchClickWithModifiers(target, sourceEvent, {\n detail = 0,\n pointerType = ''\n} = {}) {\n target.dispatchEvent(new (ownerWindow(target).PointerEvent)('click', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail,\n pointerType,\n shiftKey: sourceEvent.shiftKey,\n ctrlKey: sourceEvent.ctrlKey,\n altKey: sourceEvent.altKey,\n metaKey: sourceEvent.metaKey\n }));\n}","'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { makeEventPreventable, mergeProps } from \"../../merge-props/index.mjs\";\nimport { useCompositeRootContext } from \"../composite/root/CompositeRootContext.mjs\";\nimport { useFocusableWhenDisabled } from \"../../utils/useFocusableWhenDisabled.mjs\";\nimport { dispatchClickWithModifiers } from \"../../utils/dispatchClickWithModifiers.mjs\";\nexport function useButton(parameters = {}) {\n const {\n disabled = false,\n focusableWhenDisabled,\n tabIndex = 0,\n native: isNativeButton = true,\n composite: compositeProp\n } = parameters;\n const elementRef = React.useRef(null);\n const compositeRootContext = useCompositeRootContext(true);\n const isCompositeItem = compositeProp ?? compositeRootContext !== undefined;\n const {\n props: focusableWhenDisabledProps\n } = useFocusableWhenDisabled({\n focusableWhenDisabled,\n disabled,\n composite: isCompositeItem,\n tabIndex,\n isNativeButton\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!elementRef.current) {\n return;\n }\n const isButtonTag = isButtonElement(elementRef.current);\n if (isNativeButton) {\n if (!isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a native <button> because the ' + '`nativeButton` prop is true. Rendering a non-<button> removes native button ' + 'semantics, which can impact forms and accessibility. Use a real <button> in the ' + '`render` prop, or set `nativeButton` to `false`.';\n error(`${message}${ownerStackMessage}`);\n }\n } else if (isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = 'A component that acts as a button expected a non-<button> because the `nativeButton` ' + 'prop is false. Rendering a <button> keeps native behavior while Base UI applies ' + 'non-native attributes and handlers, which can add unintended extra attributes (such ' + 'as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set ' + '`nativeButton` to `true`.';\n error(`${message}${ownerStackMessage}`);\n }\n }, [isNativeButton]);\n }\n\n // handles a disabled composite button rendering another button, e.g.\n // <Toolbar.Button disabled render={<Menu.Trigger />} />\n // the `disabled` prop needs to pass through 2 `useButton`s then finally\n // delete the `disabled` attribute from DOM\n const updateDisabled = React.useCallback(() => {\n const element = elementRef.current;\n if (!isButtonElement(element)) {\n return;\n }\n if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === undefined && element.disabled) {\n element.disabled = false;\n }\n }, [disabled, focusableWhenDisabledProps.disabled, isCompositeItem]);\n useIsoLayoutEffect(updateDisabled, [updateDisabled]);\n const getButtonProps = React.useCallback((externalProps = {}) => {\n const {\n onClick: externalOnClick,\n onMouseDown: externalOnMouseDown,\n onKeyUp: externalOnKeyUp,\n onKeyDown: externalOnKeyDown,\n onPointerDown: externalOnPointerDown,\n ...otherExternalProps\n } = externalProps;\n return mergeProps({\n onClick(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnClick?.(event);\n },\n onMouseDown(event) {\n if (!disabled) {\n externalOnMouseDown?.(event);\n }\n },\n onKeyDown(event) {\n if (disabled) {\n return;\n }\n makeEventPreventable(event);\n externalOnKeyDown?.(event);\n if (event.baseUIHandlerPrevented) {\n return;\n }\n const isCurrentTarget = event.target === event.currentTarget;\n const currentTarget = event.currentTarget;\n const isButton = isButtonElement(currentTarget);\n const isLink = !isNativeButton && isValidLinkElement(currentTarget);\n const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);\n const isEnterKey = event.key === 'Enter';\n const isSpaceKey = event.key === ' ';\n const role = currentTarget.getAttribute('role');\n const isTextNavigationRole = role?.startsWith('menuitem') || role === 'option' || role === 'gridcell';\n if (isCurrentTarget && isCompositeItem && isSpaceKey) {\n if (event.defaultPrevented && isTextNavigationRole) {\n return;\n }\n event.preventDefault();\n\n // Only a native-mode item that isn't a real <button> is excluded.\n if (!isNativeButton || isButton) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n return;\n }\n\n // Keyboard accessibility for native and non-native elements.\n if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {\n // Space activates links on keyup (`role=\"button\"` semantics, matching the\n // composite path); prevent the page scroll Space would otherwise trigger.\n // Enter is left to the browser's native link activation.\n if (isCurrentTarget && isLink && isSpaceKey) {\n event.preventDefault();\n }\n return;\n }\n\n // Match native buttons: preventing the keydown's default cancels activation.\n if (event.defaultPrevented) {\n return;\n }\n event.preventDefault();\n if (isEnterKey) {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(currentTarget, event);\n }\n },\n onKeyUp(event) {\n if (disabled) {\n return;\n }\n\n // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed\n // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0\n makeEventPreventable(event);\n externalOnKeyUp?.(event);\n if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === ' ') {\n event.preventDefault();\n return;\n }\n if (event.baseUIHandlerPrevented) {\n return;\n }\n\n // Keyboard accessibility for non interactive elements.\n // Match native buttons: preventing the keyup's default cancels Space activation.\n // Limitation: unlike a native <button>, a prevented *keydown* cannot cancel the\n // activation — no state is kept between keydown and keyup, so we can't tell\n // whether the keydown was prevented or even happened on this element.\n if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === ' ') {\n event.preventBaseUIHandler();\n dispatchClickWithModifiers(event.currentTarget, event);\n }\n },\n onPointerDown(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnPointerDown?.(event);\n }\n }, isNativeButton ? {\n type: 'button'\n } : {\n role: 'button'\n }, focusableWhenDisabledProps, otherExternalProps);\n }, [disabled, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);\n const buttonRef = useStableCallback(element => {\n elementRef.current = element;\n updateDisabled();\n });\n return {\n getButtonProps,\n buttonRef\n };\n}\nfunction isButtonElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'BUTTON';\n}\nfunction isValidLinkElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'A' && Boolean(elem.href);\n}"],"names":["_formatErrorMessage","ownerWindow"],"mappings":";;;;AAIY,MAAC,uBAAoC,sBAAM,cAAc,MAAS;AAC9E,IAAI,QAAQ,IAAI,aAAa,aAAc,sBAAqB,cAAc;AACvE,SAAS,wBAAwB,WAAW,OAAO;AACxD,QAAM,UAAU,MAAM,WAAW,oBAAoB;AACrD,MAAI,YAAY,UAAa,CAAC,UAAU;AACtC,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,sGAAsGA,mBAAoB,EAAE,CAAC;AAAA,EACvL;AACA,SAAO;AACT;ACTO,SAAS,yBAAyB,YAAY;AACnD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,UAAU,eAAe;AAAA,IACzB;AAAA,EACJ,IAAM;AACJ,QAAM,uBAAuB,aAAa,0BAA0B;AACpE,QAAM,0BAA0B,aAAa,0BAA0B;AAIvE,QAAM,QAAQ,MAAM,QAAQ,MAAM;AAChC,UAAM,kBAAkB;AAAA;AAAA,MA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BAAM,eAAc;AACpB;AAAA,QACF;AACA,YAAI,MAAM,wBAAwB;AAChC;AAAA,QACF;AAOA,YAAI,MAAM,WAAW,MAAM,iBAAiB,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,MAAM,oBAAoB,MAAM,QAAQ,KAAK;AAC/H,gBAAM,qBAAoB;AAC1B,qCAA2B,MAAM,eAAe,KAAK;AAAA,QACvD;AAAA,MACF;AAAA,MACA,cAAc,OAAO;AACnB,YAAI,UAAU;AACZ,gBAAM,eAAc;AACpB;AAAA,QACF;AACA,uEAAwB;AAAA,MAC1B;AAAA,IACN,GAAO,iBAAiB;AAAA,MAClB,MAAM;AAAA,IACZ,IAAQ;AAAA,MACF,MAAM;AAAA,IACZ,GAAO,4BAA4B,kBAAkB;AAAA,EACnD,GAAG,CAAC,UAAU,4BAA4B,iBAAiB,cAAc,CAAC;AAC1E,QAAM,YAAY,kBAAkB,aAAW;AAC7C,eAAW,UAAU;AACrB,mBAAc;AAAA,EAChB,CAAC;AACD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACJ;AACA;AACA,SAAS,gBAAgB,MAAM;AAC7B,SAAO,cAAc,IAAI,KAAK,KAAK,YAAY;AACjD;AACA,SAAS,mBAAmB,MAAM;AAChC,SAAO,cAAc,IAAI,KAAK,KAAK,YAAY,OAAO,QAAQ,KAAK,IAAI;AACzE;","x_google_ignoreList":[0,1,2,3]}
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { u as useIsoLayoutEffect, a as useStableCallback, e as useRefWithInit } from "./useIsoLayoutEffect-e9VA-ICd.js";
2
+ import { a as useStableCallback, e as useRefWithInit, u as useIsoLayoutEffect } from "./useIsoLayoutEffect-D2lpsB9D.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  const CompositeListContext = /* @__PURE__ */ React.createContext({
5
5
  register: () => {
@@ -16,63 +16,6 @@ if (process.env.NODE_ENV !== "production") CompositeListContext.displayName = "C
16
16
  function useCompositeListContext() {
17
17
  return React.useContext(CompositeListContext);
18
18
  }
19
- function useCompositeListItem(params = {}) {
20
- const {
21
- guess,
22
- label,
23
- metadata,
24
- textRef,
25
- index: externalIndex
26
- } = params;
27
- const {
28
- register,
29
- unregister,
30
- subscribeMapChange,
31
- nextIndexRef
32
- } = useCompositeListContext();
33
- const indexRef = React.useRef(-1);
34
- const [internalIndex, setInternalIndex] = React.useState(externalIndex == null && guess ? () => {
35
- if (indexRef.current === -1) {
36
- const newIndex = nextIndexRef.current;
37
- nextIndexRef.current += 1;
38
- indexRef.current = newIndex;
39
- }
40
- return indexRef.current;
41
- } : -1);
42
- const index = externalIndex ?? internalIndex;
43
- const componentRef = React.useRef(null);
44
- const ref = React.useCallback((node) => {
45
- const previousNode = componentRef.current;
46
- if (previousNode) {
47
- unregister(previousNode);
48
- }
49
- componentRef.current = node;
50
- if (node) {
51
- register(node, {
52
- metadata: metadata ?? null,
53
- index: externalIndex ?? null,
54
- label,
55
- textRef
56
- });
57
- }
58
- }, [externalIndex, register, unregister, metadata, label, textRef]);
59
- useIsoLayoutEffect(() => {
60
- if (externalIndex != null) {
61
- return void 0;
62
- }
63
- return subscribeMapChange((map) => {
64
- var _a;
65
- const i = componentRef.current ? (_a = map.get(componentRef.current)) == null ? void 0 : _a.index : null;
66
- if (i != null) {
67
- setInternalIndex(i);
68
- }
69
- });
70
- }, [externalIndex, subscribeMapChange]);
71
- return {
72
- ref,
73
- index
74
- };
75
- }
76
19
  function CompositeList(props) {
77
20
  const {
78
21
  children,
@@ -284,8 +227,65 @@ function sortByDocumentPosition(a, b) {
284
227
  }
285
228
  return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
286
229
  }
230
+ function useCompositeListItem(params = {}) {
231
+ const {
232
+ guess,
233
+ label,
234
+ metadata,
235
+ textRef,
236
+ index: externalIndex
237
+ } = params;
238
+ const {
239
+ register,
240
+ unregister,
241
+ subscribeMapChange,
242
+ nextIndexRef
243
+ } = useCompositeListContext();
244
+ const indexRef = React.useRef(-1);
245
+ const [internalIndex, setInternalIndex] = React.useState(externalIndex == null && guess ? () => {
246
+ if (indexRef.current === -1) {
247
+ const newIndex = nextIndexRef.current;
248
+ nextIndexRef.current += 1;
249
+ indexRef.current = newIndex;
250
+ }
251
+ return indexRef.current;
252
+ } : -1);
253
+ const index = externalIndex ?? internalIndex;
254
+ const componentRef = React.useRef(null);
255
+ const ref = React.useCallback((node) => {
256
+ const previousNode = componentRef.current;
257
+ if (previousNode) {
258
+ unregister(previousNode);
259
+ }
260
+ componentRef.current = node;
261
+ if (node) {
262
+ register(node, {
263
+ metadata: metadata ?? null,
264
+ index: externalIndex ?? null,
265
+ label,
266
+ textRef
267
+ });
268
+ }
269
+ }, [externalIndex, register, unregister, metadata, label, textRef]);
270
+ useIsoLayoutEffect(() => {
271
+ if (externalIndex != null) {
272
+ return void 0;
273
+ }
274
+ return subscribeMapChange((map) => {
275
+ var _a;
276
+ const i = componentRef.current ? (_a = map.get(componentRef.current)) == null ? void 0 : _a.index : null;
277
+ if (i != null) {
278
+ setInternalIndex(i);
279
+ }
280
+ });
281
+ }, [externalIndex, subscribeMapChange]);
282
+ return {
283
+ ref,
284
+ index
285
+ };
286
+ }
287
287
  export {
288
288
  CompositeList as C,
289
289
  useCompositeListItem as u
290
290
  };
291
- //# sourceMappingURL=CompositeList-D4xmSZ5V.js.map
291
+ //# sourceMappingURL=useCompositeListItem-DlAKWsHE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCompositeListItem-DlAKWsHE.js","sources":["../node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs","../node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs","../node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nexport const CompositeListContext = /*#__PURE__*/React.createContext({\n register: () => {},\n unregister: () => {},\n subscribeMapChange: () => () => {},\n nextIndexRef: {\n current: 0\n }\n});\nif (process.env.NODE_ENV !== \"production\") CompositeListContext.displayName = \"CompositeListContext\";\nexport function useCompositeListContext() {\n return React.useContext(CompositeListContext);\n}","/* eslint-disable no-bitwise */\n'use client';\n\nimport * as React from 'react';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { CompositeListContext } from \"./CompositeListContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Provides context for a list of items in a composite component.\n */\nexport function CompositeList(props) {\n const {\n children,\n elementsRef,\n labelsRef,\n onMapChange: onMapChangeProp\n } = props;\n const onMapChange = useStableCallback(onMapChangeProp);\n const [, setMapTick] = React.useState(0);\n const listeners = useRefWithInit(createListeners).current;\n const map = useRefWithInit(createMap).current;\n const nextIndexRef = React.useRef(0);\n const isDirtyRef = React.useRef(true);\n const itemsRef = React.useRef(null);\n const mutationObserverRef = React.useRef(null);\n\n // Item effects can run without their parent rendering. Schedule one synchronous\n // parent update for the whole commit so refs are rebuilt before paint and while\n // the originating React event is still inside `act()` in tests.\n const scheduleMapUpdate = useStableCallback(() => {\n if (isDirtyRef.current) {\n return;\n }\n isDirtyRef.current = true;\n setMapTick(tick => tick + 1);\n });\n const register = useStableCallback((node, registration) => {\n map.set(node, registration);\n scheduleMapUpdate();\n });\n const unregister = useStableCallback(node => {\n map.delete(node);\n scheduleMapUpdate();\n });\n const syncRefs = useStableCallback(items => {\n const nextMap = new Map();\n elementsRef.current.length = 0;\n if (labelsRef) {\n labelsRef.current.length = 0;\n }\n items.forEach(item => {\n nextMap.set(item.element, {\n ...(item.registration.metadata ?? {}),\n index: item.index\n });\n elementsRef.current[item.index] = item.element;\n if (labelsRef) {\n labelsRef.current[item.index] = item.registration.label !== undefined ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent;\n }\n });\n nextIndexRef.current = elementsRef.current.length;\n return nextMap;\n });\n function observe(sortedNodes) {\n mutationObserverRef.current?.disconnect();\n mutationObserverRef.current = null;\n\n // A single item can't reorder.\n if (typeof MutationObserver !== 'function' || sortedNodes.length < 2) {\n return;\n }\n const mutationObserver = new MutationObserver(entries => {\n // Only verify the order after a move: a node that was removed and later\n // re-added within the same batch. Additions and removals alone can't\n // change the relative order of the remaining items, and items that mount\n // or unmount re-sort through `register`/`unregister`.\n if (!hasMovedNode(entries)) {\n return;\n }\n let previousConnectedNode = null;\n\n // If any connected node now appears before the previous connected node,\n // wrappers/items moved and the index map needs to be rebuilt.\n for (const node of sortedNodes) {\n if (!node.isConnected) {\n continue;\n }\n if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) {\n mutationObserver.disconnect();\n scheduleMapUpdate();\n return;\n }\n previousConnectedNode = node;\n }\n });\n mutationObserverRef.current = mutationObserver;\n\n // A reorder that changes item indexes must invert at least one adjacent pair\n // from the previous sorted order. Observing each pair's common parent catches\n // both direct item moves and ancestor wrapper moves at the boundary.\n const roots = new Set();\n for (let i = 1; i < sortedNodes.length; i += 1) {\n const root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]);\n if (root) {\n roots.add(root);\n }\n }\n roots.forEach(root => mutationObserver.observe(root, {\n childList: true\n }));\n }\n const flush = useStableCallback(() => {\n const [items, automaticNodes] = getCompositeListSnapshot(map);\n const nextMap = syncRefs(items);\n const previousItems = itemsRef.current;\n const changed = !previousItems || previousItems.length !== items.length || items.some((item, index) => {\n const previousItem = previousItems[index];\n return item.index !== previousItem.index || item.element !== previousItem.element || item.registration.index !== previousItem.registration.index || item.registration.metadata !== previousItem.registration.metadata;\n });\n observe(automaticNodes);\n itemsRef.current = items;\n isDirtyRef.current = false;\n if (!changed) {\n return;\n }\n listeners.forEach(listener => listener(nextMap));\n onMapChange(nextMap);\n });\n useIsoLayoutEffect(() => {\n // Re-copy the last committed snapshot when the ref objects change or Strict Mode replays\n // effects without reattaching callback refs.\n if (!isDirtyRef.current && itemsRef.current) {\n syncRefs(itemsRef.current);\n }\n return () => {\n elementsRef.current = [];\n if (labelsRef) {\n labelsRef.current = [];\n }\n };\n }, [elementsRef, labelsRef, syncRefs]);\n useIsoLayoutEffect(() => {\n if (isDirtyRef.current) {\n flush();\n }\n });\n useIsoLayoutEffect(() => {\n return () => {\n mutationObserverRef.current?.disconnect();\n // React 18 Strict Mode replays effects without replaying callback refs.\n // Mark the retained map dirty so the replay rebuilds refs and observation.\n isDirtyRef.current = true;\n };\n }, []);\n const subscribeMapChange = useStableCallback(fn => {\n listeners.add(fn);\n return () => {\n listeners.delete(fn);\n };\n });\n const contextValue = React.useMemo(() => ({\n register,\n unregister,\n subscribeMapChange,\n nextIndexRef\n }), [register, unregister, subscribeMapChange, nextIndexRef]);\n return /*#__PURE__*/_jsx(CompositeListContext.Provider, {\n value: contextValue,\n children: children\n });\n}\nfunction createMap() {\n return new Map();\n}\nfunction createListeners() {\n return new Set();\n}\nfunction getCompositeListSnapshot(map) {\n const reservedIndices = new Set();\n const items = [];\n const automaticItems = [];\n map.forEach((registration, node) => {\n if (!node.isConnected) {\n return;\n }\n const index = registration.index;\n const item = {\n index: index ?? -1,\n element: node,\n registration\n };\n if (index === null) {\n automaticItems.push(item);\n } else if (index >= 0) {\n reservedIndices.add(index);\n items.push(item);\n }\n });\n let nextAutomaticIndex = 0;\n automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element));\n automaticItems.forEach(item => {\n while (reservedIndices.has(nextAutomaticIndex)) {\n nextAutomaticIndex += 1;\n }\n item.index = nextAutomaticIndex;\n items.push(item);\n nextAutomaticIndex += 1;\n });\n if (reservedIndices.size > 0) {\n items.sort((a, b) => a.index - b.index);\n }\n return [items, automaticItems.map(item => item.element)];\n}\nfunction getCommonAncestor(firstNode, lastNode) {\n let ancestor = firstNode.parentElement;\n\n // The `parentElement` walk cannot cross shadow boundaries, so the native\n // `contains` is sufficient here.\n while (ancestor && !ancestor.contains(lastNode)) {\n ancestor = ancestor.parentElement;\n }\n return ancestor;\n}\nfunction hasMovedNode(entries) {\n for (const entry of entries) {\n for (let i = 0; i < entry.removedNodes.length; i += 1) {\n if (entry.removedNodes[i].isConnected) {\n return true;\n }\n }\n }\n return false;\n}\nfunction sortByDocumentPosition(a, b) {\n // Adjacent siblings are the common case for lists that are already in order, and\n // `compareDocumentPosition` scans siblings from the parent's first child, so sorting\n // a long flat list would otherwise be quadratic.\n if (a.nextElementSibling === b) {\n return -1;\n }\n if (b.nextElementSibling === a) {\n return 1;\n }\n // `DOCUMENT_POSITION_CONTAINED_BY` is always reported alongside `FOLLOWING`, and `CONTAINS`\n // alongside `PRECEDING`, so testing `FOLLOWING` alone orders siblings and nested items alike.\n return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useCompositeListContext } from \"./CompositeListContext.mjs\";\n/**\n * Used to register a list item and its index (DOM position) in the `CompositeList`.\n */\nexport function useCompositeListItem(params = {}) {\n const {\n guess,\n label,\n metadata,\n textRef,\n index: externalIndex\n } = params;\n const {\n register,\n unregister,\n subscribeMapChange,\n nextIndexRef\n } = useCompositeListContext();\n\n // Guess the index from the render order. This avoids a re-render after mount for\n // flat lists rendered in DOM order; when the guess is wrong (grouped or out-of-order\n // rendering), the commit flush corrects it before paint.\n const indexRef = React.useRef(-1);\n const [internalIndex, setInternalIndex] = React.useState(externalIndex == null && guess ? () => {\n if (indexRef.current === -1) {\n const newIndex = nextIndexRef.current;\n nextIndexRef.current += 1;\n indexRef.current = newIndex;\n }\n return indexRef.current;\n } : -1);\n const index = externalIndex ?? internalIndex;\n const componentRef = React.useRef(null);\n\n // Deliberately identity-sensitive: nested items sharing one DOM node rely on ref attachment\n // order to decide which registration wins, and republishing from an effect instead would let\n // an inner item's later update silently take ownership from the outer one.\n const ref = React.useCallback(node => {\n const previousNode = componentRef.current;\n if (previousNode) {\n unregister(previousNode);\n }\n componentRef.current = node;\n if (node) {\n register(node, {\n metadata: metadata ?? null,\n index: externalIndex ?? null,\n label,\n textRef\n });\n }\n }, [externalIndex, register, unregister, metadata, label, textRef]);\n useIsoLayoutEffect(() => {\n if (externalIndex != null) {\n return undefined;\n }\n return subscribeMapChange(map => {\n const i = componentRef.current ? map.get(componentRef.current)?.index : null;\n if (i != null) {\n setInternalIndex(i);\n }\n });\n }, [externalIndex, subscribeMapChange]);\n return {\n ref,\n index\n };\n}"],"names":["_jsx"],"mappings":";;;AAGO,MAAM,uBAAoC,sBAAM,cAAc;AAAA,EACnE,UAAU,MAAM;AAAA,EAAC;AAAA,EACjB,YAAY,MAAM;AAAA,EAAC;AAAA,EACnB,oBAAoB,MAAM,MAAM;AAAA,EAAC;AAAA,EACjC,cAAc;AAAA,IACZ,SAAS;AAAA,EACb;AACA,CAAC;AACD,IAAI,QAAQ,IAAI,aAAa,aAAc,sBAAqB,cAAc;AACvE,SAAS,0BAA0B;AACxC,SAAO,MAAM,WAAW,oBAAoB;AAC9C;ACFO,SAAS,cAAc,OAAO;AACnC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,EACjB,IAAM;AACJ,QAAM,cAAc,kBAAkB,eAAe;AACrD,QAAM,CAAA,EAAG,UAAU,IAAI,MAAM,SAAS,CAAC;AACvC,QAAM,YAAY,eAAe,eAAe,EAAE;AAClD,QAAM,MAAM,eAAe,SAAS,EAAE;AACtC,QAAM,eAAe,MAAM,OAAO,CAAC;AACnC,QAAM,aAAa,MAAM,OAAO,IAAI;AACpC,QAAM,WAAW,MAAM,OAAO,IAAI;AAClC,QAAM,sBAAsB,MAAM,OAAO,IAAI;AAK7C,QAAM,oBAAoB,kBAAkB,MAAM;AAChD,QAAI,WAAW,SAAS;AACtB;AAAA,IACF;AACA,eAAW,UAAU;AACrB,eAAW,UAAQ,OAAO,CAAC;AAAA,EAC7B,CAAC;AACD,QAAM,WAAW,kBAAkB,CAAC,MAAM,iBAAiB;AACzD,Q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