@base-ui/react 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1068) hide show
  1. package/CHANGELOG.md +173 -0
  2. package/accordion/item/AccordionItem.d.ts +1 -1
  3. package/accordion/item/AccordionItemContext.d.ts +1 -1
  4. package/accordion/root/AccordionRoot.d.ts +9 -9
  5. package/alert-dialog/root/AlertDialogRoot.d.ts +3 -3
  6. package/alert-dialog/root/AlertDialogRoot.js +6 -4
  7. package/autocomplete/index.parts.d.ts +2 -1
  8. package/autocomplete/index.parts.js +8 -1
  9. package/autocomplete/root/AutocompleteRoot.d.ts +19 -14
  10. package/autocomplete/root/AutocompleteRoot.js +4 -6
  11. package/avatar/fallback/AvatarFallback.d.ts +7 -2
  12. package/avatar/fallback/AvatarFallback.js +34 -6
  13. package/avatar/image/AvatarImage.d.ts +7 -2
  14. package/avatar/image/AvatarImage.js +35 -6
  15. package/avatar/image/useImageLoadingStatus.d.ts +2 -2
  16. package/avatar/root/AvatarRoot.js +2 -2
  17. package/button/Button.d.ts +1 -1
  18. package/button/Button.js +2 -2
  19. package/checkbox/indicator/CheckboxIndicator.d.ts +1 -1
  20. package/checkbox/indicator/CheckboxIndicator.js +4 -4
  21. package/checkbox/root/CheckboxRoot.d.ts +13 -13
  22. package/checkbox/root/CheckboxRoot.js +31 -8
  23. package/checkbox-group/CheckboxGroup.d.ts +5 -5
  24. package/checkbox-group/CheckboxGroup.js +2 -2
  25. package/checkbox-group/useCheckboxGroupParent.d.ts +3 -3
  26. package/collapsible/panel/CollapsiblePanel.d.ts +2 -2
  27. package/collapsible/root/CollapsibleRoot.d.ts +4 -4
  28. package/collapsible/root/useCollapsibleRoot.d.ts +2 -2
  29. package/combobox/arrow/ComboboxArrow.js +2 -2
  30. package/combobox/arrow/ComboboxArrowDataAttributes.js +2 -2
  31. package/combobox/backdrop/ComboboxBackdrop.js +2 -2
  32. package/combobox/chip/ComboboxChip.js +6 -3
  33. package/combobox/chip/ComboboxChipContext.js +1 -0
  34. package/combobox/chip-remove/ComboboxChipRemove.js +28 -33
  35. package/combobox/chips/ComboboxChipsContext.js +1 -0
  36. package/combobox/clear/ComboboxClear.d.ts +2 -2
  37. package/combobox/clear/ComboboxClear.js +2 -3
  38. package/combobox/group/ComboboxGroup.d.ts +1 -1
  39. package/combobox/group/ComboboxGroupContext.d.ts +1 -1
  40. package/combobox/group/ComboboxGroupContext.js +1 -0
  41. package/combobox/icon/ComboboxIcon.d.ts +1 -1
  42. package/combobox/index.parts.d.ts +2 -1
  43. package/combobox/index.parts.js +8 -1
  44. package/combobox/input/ComboboxInput.d.ts +1 -1
  45. package/combobox/input/ComboboxInput.js +38 -8
  46. package/combobox/item/ComboboxItem.d.ts +3 -3
  47. package/combobox/item/ComboboxItem.js +15 -15
  48. package/combobox/item/ComboboxItemContext.js +1 -0
  49. package/combobox/item-indicator/ComboboxItemIndicator.d.ts +1 -1
  50. package/combobox/item-indicator/ComboboxItemIndicator.js +2 -2
  51. package/combobox/list/ComboboxList.js +2 -2
  52. package/combobox/popup/ComboboxPopup.d.ts +2 -2
  53. package/combobox/popup/ComboboxPopup.js +3 -4
  54. package/combobox/popup/ComboboxPopupDataAttributes.js +2 -2
  55. package/combobox/portal/ComboboxPortal.d.ts +1 -1
  56. package/combobox/portal/ComboboxPortalContext.js +1 -0
  57. package/combobox/positioner/ComboboxPositioner.js +5 -3
  58. package/combobox/positioner/ComboboxPositionerDataAttributes.js +2 -2
  59. package/combobox/root/AriaCombobox.d.ts +49 -44
  60. package/combobox/root/AriaCombobox.js +44 -62
  61. package/combobox/root/ComboboxRoot.d.ts +19 -14
  62. package/combobox/root/ComboboxRoot.js +3 -1
  63. package/combobox/root/ComboboxRootContext.d.ts +1 -0
  64. package/combobox/root/ComboboxRootContext.js +1 -0
  65. package/combobox/root/utils/useFilter.d.ts +2 -2
  66. package/combobox/root/utils/useFilteredItems.d.ts +4 -0
  67. package/combobox/root/utils/useFilteredItems.js +14 -0
  68. package/combobox/row/ComboboxRowContext.js +1 -0
  69. package/combobox/store.d.ts +11 -11
  70. package/combobox/store.js +3 -3
  71. package/combobox/trigger/ComboboxTrigger.d.ts +1 -1
  72. package/combobox/trigger/ComboboxTrigger.js +3 -4
  73. package/composite/item/CompositeItem.d.ts +6 -6
  74. package/composite/list/CompositeList.d.ts +3 -3
  75. package/composite/list/CompositeListContext.d.ts +1 -1
  76. package/composite/list/useCompositeListItem.d.ts +5 -5
  77. package/composite/root/CompositeRoot.d.ts +19 -19
  78. package/composite/root/useCompositeRoot.d.ts +12 -12
  79. package/context-menu/index.d.ts +1 -0
  80. package/context-menu/index.parts.d.ts +1 -0
  81. package/context-menu/index.parts.js +7 -0
  82. package/context-menu/root/ContextMenuRoot.d.ts +1 -1
  83. package/context-menu/root/ContextMenuRootContext.js +1 -0
  84. package/context-menu/trigger/ContextMenuTrigger.js +13 -3
  85. package/csp-provider/CSPContext.d.ts +2 -2
  86. package/csp-provider/CSPProvider.d.ts +2 -2
  87. package/dialog/backdrop/DialogBackdrop.d.ts +1 -1
  88. package/dialog/backdrop/DialogBackdrop.js +2 -2
  89. package/dialog/close/DialogClose.js +2 -2
  90. package/dialog/popup/DialogPopup.d.ts +2 -2
  91. package/dialog/popup/DialogPopup.js +2 -2
  92. package/dialog/portal/DialogPortal.d.ts +2 -2
  93. package/dialog/portal/DialogPortalContext.js +1 -0
  94. package/dialog/root/DialogRoot.d.ts +10 -10
  95. package/dialog/root/DialogRoot.js +17 -4
  96. package/dialog/root/useDialogRoot.d.ts +3 -3
  97. package/dialog/root/useDialogRoot.js +4 -0
  98. package/dialog/store/DialogStore.d.ts +258 -17
  99. package/dialog/store/DialogStore.js +3 -0
  100. package/dialog/trigger/DialogTrigger.d.ts +3 -3
  101. package/dialog/trigger/DialogTrigger.js +3 -3
  102. package/dialog/viewport/DialogViewport.js +5 -2
  103. package/direction-provider/DirectionProvider.d.ts +1 -1
  104. package/drawer/backdrop/DrawerBackdrop.d.ts +28 -0
  105. package/drawer/backdrop/DrawerBackdrop.js +63 -0
  106. package/drawer/backdrop/DrawerBackdropCssVars.d.ts +7 -0
  107. package/drawer/backdrop/DrawerBackdropCssVars.js +14 -0
  108. package/drawer/close/DrawerClose.d.ts +23 -0
  109. package/drawer/close/DrawerClose.js +15 -0
  110. package/drawer/content/DrawerContent.d.ts +15 -0
  111. package/drawer/content/DrawerContent.js +32 -0
  112. package/drawer/description/DrawerDescription.d.ts +18 -0
  113. package/drawer/description/DrawerDescription.js +15 -0
  114. package/drawer/indent/DrawerIndent.d.ts +20 -0
  115. package/drawer/indent/DrawerIndent.js +87 -0
  116. package/drawer/indent-background/DrawerIndentBackground.d.ts +18 -0
  117. package/drawer/indent-background/DrawerIndentBackground.js +47 -0
  118. package/drawer/index.d.ts +14 -0
  119. package/drawer/index.js +9 -0
  120. package/drawer/index.parts.d.ts +14 -0
  121. package/drawer/index.parts.js +109 -0
  122. package/drawer/popup/DrawerPopup.d.ts +69 -0
  123. package/drawer/popup/DrawerPopup.js +291 -0
  124. package/drawer/popup/DrawerPopupCssVars.d.ts +37 -0
  125. package/drawer/popup/DrawerPopupCssVars.js +44 -0
  126. package/drawer/popup/DrawerPopupDataAttributes.d.ts +27 -0
  127. package/drawer/popup/DrawerPopupDataAttributes.js +34 -0
  128. package/drawer/portal/DrawerPortal.d.ts +29 -0
  129. package/drawer/portal/DrawerPortal.js +16 -0
  130. package/drawer/provider/DrawerProvider.d.ts +16 -0
  131. package/drawer/provider/DrawerProvider.js +100 -0
  132. package/drawer/provider/DrawerProviderContext.d.ts +19 -0
  133. package/drawer/provider/DrawerProviderContext.js +21 -0
  134. package/drawer/root/DrawerRoot.d.ts +124 -0
  135. package/drawer/root/DrawerRoot.js +235 -0
  136. package/drawer/root/DrawerRootContext.d.ts +89 -0
  137. package/drawer/root/DrawerRootContext.js +21 -0
  138. package/drawer/root/useDrawerSnapPoints.d.ts +15 -0
  139. package/drawer/root/useDrawerSnapPoints.js +155 -0
  140. package/drawer/swipe-area/DrawerSwipeArea.d.ts +45 -0
  141. package/drawer/swipe-area/DrawerSwipeArea.js +385 -0
  142. package/drawer/title/DrawerTitle.d.ts +18 -0
  143. package/drawer/title/DrawerTitle.js +15 -0
  144. package/drawer/trigger/DrawerTrigger.d.ts +43 -0
  145. package/drawer/trigger/DrawerTrigger.js +15 -0
  146. package/drawer/viewport/DrawerViewport.d.ts +30 -0
  147. package/drawer/viewport/DrawerViewport.js +873 -0
  148. package/drawer/viewport/DrawerViewportContext.d.ts +11 -0
  149. package/drawer/viewport/DrawerViewportContext.js +21 -0
  150. package/esm/accordion/item/AccordionItem.d.ts +1 -1
  151. package/esm/accordion/item/AccordionItemContext.d.ts +1 -1
  152. package/esm/accordion/root/AccordionRoot.d.ts +9 -9
  153. package/esm/alert-dialog/root/AlertDialogRoot.d.ts +3 -3
  154. package/esm/alert-dialog/root/AlertDialogRoot.js +6 -4
  155. package/esm/autocomplete/index.parts.d.ts +2 -1
  156. package/esm/autocomplete/index.parts.js +2 -1
  157. package/esm/autocomplete/root/AutocompleteRoot.d.ts +19 -14
  158. package/esm/autocomplete/root/AutocompleteRoot.js +4 -6
  159. package/esm/avatar/fallback/AvatarFallback.d.ts +7 -2
  160. package/esm/avatar/fallback/AvatarFallback.js +33 -6
  161. package/esm/avatar/image/AvatarImage.d.ts +7 -2
  162. package/esm/avatar/image/AvatarImage.js +34 -6
  163. package/esm/avatar/image/useImageLoadingStatus.d.ts +2 -2
  164. package/esm/avatar/root/AvatarRoot.js +2 -2
  165. package/esm/button/Button.d.ts +1 -1
  166. package/esm/button/Button.js +2 -2
  167. package/esm/checkbox/indicator/CheckboxIndicator.d.ts +1 -1
  168. package/esm/checkbox/indicator/CheckboxIndicator.js +4 -4
  169. package/esm/checkbox/root/CheckboxRoot.d.ts +13 -13
  170. package/esm/checkbox/root/CheckboxRoot.js +31 -8
  171. package/esm/checkbox-group/CheckboxGroup.d.ts +5 -5
  172. package/esm/checkbox-group/CheckboxGroup.js +2 -2
  173. package/esm/checkbox-group/useCheckboxGroupParent.d.ts +3 -3
  174. package/esm/collapsible/panel/CollapsiblePanel.d.ts +2 -2
  175. package/esm/collapsible/root/CollapsibleRoot.d.ts +4 -4
  176. package/esm/collapsible/root/useCollapsibleRoot.d.ts +2 -2
  177. package/esm/combobox/arrow/ComboboxArrow.js +2 -2
  178. package/esm/combobox/arrow/ComboboxArrowDataAttributes.js +2 -2
  179. package/esm/combobox/backdrop/ComboboxBackdrop.js +2 -2
  180. package/esm/combobox/chip/ComboboxChip.js +6 -3
  181. package/esm/combobox/chip/ComboboxChipContext.js +2 -0
  182. package/esm/combobox/chip-remove/ComboboxChipRemove.js +28 -33
  183. package/esm/combobox/chips/ComboboxChipsContext.js +2 -0
  184. package/esm/combobox/clear/ComboboxClear.d.ts +2 -2
  185. package/esm/combobox/clear/ComboboxClear.js +2 -3
  186. package/esm/combobox/group/ComboboxGroup.d.ts +1 -1
  187. package/esm/combobox/group/ComboboxGroupContext.d.ts +1 -1
  188. package/esm/combobox/group/ComboboxGroupContext.js +2 -0
  189. package/esm/combobox/icon/ComboboxIcon.d.ts +1 -1
  190. package/esm/combobox/index.parts.d.ts +2 -1
  191. package/esm/combobox/index.parts.js +2 -1
  192. package/esm/combobox/input/ComboboxInput.d.ts +1 -1
  193. package/esm/combobox/input/ComboboxInput.js +38 -8
  194. package/esm/combobox/item/ComboboxItem.d.ts +3 -3
  195. package/esm/combobox/item/ComboboxItem.js +15 -15
  196. package/esm/combobox/item/ComboboxItemContext.js +2 -0
  197. package/esm/combobox/item-indicator/ComboboxItemIndicator.d.ts +1 -1
  198. package/esm/combobox/item-indicator/ComboboxItemIndicator.js +2 -2
  199. package/esm/combobox/list/ComboboxList.js +2 -2
  200. package/esm/combobox/popup/ComboboxPopup.d.ts +2 -2
  201. package/esm/combobox/popup/ComboboxPopup.js +3 -4
  202. package/esm/combobox/popup/ComboboxPopupDataAttributes.js +2 -2
  203. package/esm/combobox/portal/ComboboxPortal.d.ts +1 -1
  204. package/esm/combobox/portal/ComboboxPortalContext.js +2 -0
  205. package/esm/combobox/positioner/ComboboxPositioner.js +5 -3
  206. package/esm/combobox/positioner/ComboboxPositionerDataAttributes.js +2 -2
  207. package/esm/combobox/root/AriaCombobox.d.ts +49 -44
  208. package/esm/combobox/root/AriaCombobox.js +45 -63
  209. package/esm/combobox/root/ComboboxRoot.d.ts +19 -14
  210. package/esm/combobox/root/ComboboxRoot.js +3 -1
  211. package/esm/combobox/root/ComboboxRootContext.d.ts +1 -0
  212. package/esm/combobox/root/ComboboxRootContext.js +2 -0
  213. package/esm/combobox/root/utils/useFilter.d.ts +2 -2
  214. package/esm/combobox/root/utils/useFilteredItems.d.ts +4 -0
  215. package/esm/combobox/root/utils/useFilteredItems.js +9 -0
  216. package/esm/combobox/row/ComboboxRowContext.js +2 -0
  217. package/esm/combobox/store.d.ts +11 -11
  218. package/esm/combobox/store.js +3 -3
  219. package/esm/combobox/trigger/ComboboxTrigger.d.ts +1 -1
  220. package/esm/combobox/trigger/ComboboxTrigger.js +3 -4
  221. package/esm/composite/item/CompositeItem.d.ts +6 -6
  222. package/esm/composite/list/CompositeList.d.ts +3 -3
  223. package/esm/composite/list/CompositeListContext.d.ts +1 -1
  224. package/esm/composite/list/useCompositeListItem.d.ts +5 -5
  225. package/esm/composite/root/CompositeRoot.d.ts +19 -19
  226. package/esm/composite/root/useCompositeRoot.d.ts +12 -12
  227. package/esm/context-menu/index.d.ts +1 -0
  228. package/esm/context-menu/index.parts.d.ts +1 -0
  229. package/esm/context-menu/index.parts.js +1 -0
  230. package/esm/context-menu/root/ContextMenuRoot.d.ts +1 -1
  231. package/esm/context-menu/root/ContextMenuRootContext.js +2 -0
  232. package/esm/context-menu/trigger/ContextMenuTrigger.js +13 -3
  233. package/esm/csp-provider/CSPContext.d.ts +2 -2
  234. package/esm/csp-provider/CSPProvider.d.ts +2 -2
  235. package/esm/dialog/backdrop/DialogBackdrop.d.ts +1 -1
  236. package/esm/dialog/backdrop/DialogBackdrop.js +2 -2
  237. package/esm/dialog/close/DialogClose.js +2 -2
  238. package/esm/dialog/popup/DialogPopup.d.ts +2 -2
  239. package/esm/dialog/popup/DialogPopup.js +2 -2
  240. package/esm/dialog/portal/DialogPortal.d.ts +2 -2
  241. package/esm/dialog/portal/DialogPortalContext.js +2 -0
  242. package/esm/dialog/root/DialogRoot.d.ts +10 -10
  243. package/esm/dialog/root/DialogRoot.js +17 -4
  244. package/esm/dialog/root/useDialogRoot.d.ts +3 -3
  245. package/esm/dialog/root/useDialogRoot.js +4 -0
  246. package/esm/dialog/store/DialogStore.d.ts +258 -17
  247. package/esm/dialog/store/DialogStore.js +3 -0
  248. package/esm/dialog/trigger/DialogTrigger.d.ts +3 -3
  249. package/esm/dialog/trigger/DialogTrigger.js +2 -2
  250. package/esm/dialog/viewport/DialogViewport.js +5 -2
  251. package/esm/direction-provider/DirectionProvider.d.ts +1 -1
  252. package/esm/drawer/backdrop/DrawerBackdrop.d.ts +28 -0
  253. package/esm/drawer/backdrop/DrawerBackdrop.js +57 -0
  254. package/esm/drawer/backdrop/DrawerBackdropCssVars.d.ts +7 -0
  255. package/esm/drawer/backdrop/DrawerBackdropCssVars.js +8 -0
  256. package/esm/drawer/close/DrawerClose.d.ts +23 -0
  257. package/esm/drawer/close/DrawerClose.js +10 -0
  258. package/esm/drawer/content/DrawerContent.d.ts +15 -0
  259. package/esm/drawer/content/DrawerContent.js +27 -0
  260. package/esm/drawer/description/DrawerDescription.d.ts +18 -0
  261. package/esm/drawer/description/DrawerDescription.js +10 -0
  262. package/esm/drawer/indent/DrawerIndent.d.ts +20 -0
  263. package/esm/drawer/indent/DrawerIndent.js +81 -0
  264. package/esm/drawer/indent-background/DrawerIndentBackground.d.ts +18 -0
  265. package/esm/drawer/indent-background/DrawerIndentBackground.js +41 -0
  266. package/esm/drawer/index.d.ts +14 -0
  267. package/esm/drawer/index.js +1 -0
  268. package/esm/drawer/index.parts.d.ts +14 -0
  269. package/esm/drawer/index.parts.js +14 -0
  270. package/esm/drawer/popup/DrawerPopup.d.ts +69 -0
  271. package/esm/drawer/popup/DrawerPopup.js +285 -0
  272. package/esm/drawer/popup/DrawerPopupCssVars.d.ts +37 -0
  273. package/esm/drawer/popup/DrawerPopupCssVars.js +38 -0
  274. package/esm/drawer/popup/DrawerPopupDataAttributes.d.ts +27 -0
  275. package/esm/drawer/popup/DrawerPopupDataAttributes.js +28 -0
  276. package/esm/drawer/portal/DrawerPortal.d.ts +29 -0
  277. package/esm/drawer/portal/DrawerPortal.js +11 -0
  278. package/esm/drawer/provider/DrawerProvider.d.ts +16 -0
  279. package/esm/drawer/provider/DrawerProvider.js +95 -0
  280. package/esm/drawer/provider/DrawerProviderContext.d.ts +19 -0
  281. package/esm/drawer/provider/DrawerProviderContext.js +13 -0
  282. package/esm/drawer/root/DrawerRoot.d.ts +124 -0
  283. package/esm/drawer/root/DrawerRoot.js +229 -0
  284. package/esm/drawer/root/DrawerRootContext.d.ts +89 -0
  285. package/esm/drawer/root/DrawerRootContext.js +13 -0
  286. package/esm/drawer/root/useDrawerSnapPoints.d.ts +15 -0
  287. package/esm/drawer/root/useDrawerSnapPoints.js +149 -0
  288. package/esm/drawer/swipe-area/DrawerSwipeArea.d.ts +45 -0
  289. package/esm/drawer/swipe-area/DrawerSwipeArea.js +379 -0
  290. package/esm/drawer/title/DrawerTitle.d.ts +18 -0
  291. package/esm/drawer/title/DrawerTitle.js +10 -0
  292. package/esm/drawer/trigger/DrawerTrigger.d.ts +43 -0
  293. package/esm/drawer/trigger/DrawerTrigger.js +10 -0
  294. package/esm/drawer/viewport/DrawerViewport.d.ts +30 -0
  295. package/esm/drawer/viewport/DrawerViewport.js +867 -0
  296. package/esm/drawer/viewport/DrawerViewportContext.d.ts +11 -0
  297. package/esm/drawer/viewport/DrawerViewportContext.js +13 -0
  298. package/esm/field/control/FieldControl.d.ts +3 -3
  299. package/esm/field/control/FieldControl.js +22 -20
  300. package/esm/field/error/FieldError.d.ts +5 -2
  301. package/esm/field/error/FieldError.js +50 -7
  302. package/esm/field/item/FieldItem.d.ts +1 -1
  303. package/esm/field/item/FieldItemContext.js +2 -0
  304. package/esm/field/label/FieldLabel.d.ts +1 -1
  305. package/esm/field/label/FieldLabel.js +7 -2
  306. package/esm/field/root/FieldRoot.d.ts +9 -9
  307. package/esm/field/root/FieldRootContext.d.ts +1 -1
  308. package/esm/field/useField.d.ts +1 -1
  309. package/esm/field/useField.js +2 -0
  310. package/esm/field/validity/FieldValidity.d.ts +2 -0
  311. package/esm/field/validity/FieldValidity.js +11 -4
  312. package/esm/fieldset/legend/FieldsetLegend.js +2 -2
  313. package/esm/fieldset/root/FieldsetRoot.d.ts +1 -1
  314. package/esm/fieldset/root/FieldsetRoot.js +3 -3
  315. package/esm/floating-ui-react/components/FloatingDelayGroup.d.ts +2 -7
  316. package/esm/floating-ui-react/components/FloatingDelayGroup.js +2 -9
  317. package/esm/floating-ui-react/components/FloatingFocusManager.d.ts +11 -21
  318. package/esm/floating-ui-react/components/FloatingFocusManager.js +63 -76
  319. package/esm/floating-ui-react/components/FloatingPortal.d.ts +8 -9
  320. package/esm/floating-ui-react/components/FloatingPortal.js +1 -3
  321. package/esm/floating-ui-react/components/FloatingTree.d.ts +1 -1
  322. package/esm/floating-ui-react/hooks/useClick.d.ts +12 -6
  323. package/esm/floating-ui-react/hooks/useClick.js +6 -5
  324. package/esm/floating-ui-react/hooks/useClientPoint.d.ts +2 -12
  325. package/esm/floating-ui-react/hooks/useClientPoint.js +5 -16
  326. package/esm/floating-ui-react/hooks/useDismiss.d.ts +15 -15
  327. package/esm/floating-ui-react/hooks/useDismiss.js +6 -3
  328. package/esm/floating-ui-react/hooks/useFloating.js +2 -0
  329. package/esm/floating-ui-react/hooks/useFloatingRootContext.d.ts +4 -10
  330. package/esm/floating-ui-react/hooks/useFloatingRootContext.js +5 -3
  331. package/esm/floating-ui-react/hooks/useFocus.d.ts +2 -8
  332. package/esm/floating-ui-react/hooks/useFocus.js +11 -12
  333. package/esm/floating-ui-react/hooks/useHover.d.ts +7 -30
  334. package/esm/floating-ui-react/hooks/useHover.js +20 -37
  335. package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +2 -7
  336. package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js +35 -40
  337. package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +17 -14
  338. package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js +36 -30
  339. package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +7 -3
  340. package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +57 -60
  341. package/esm/floating-ui-react/hooks/useInteractions.d.ts +2 -2
  342. package/esm/floating-ui-react/hooks/useListNavigation.d.ts +19 -35
  343. package/esm/floating-ui-react/hooks/useListNavigation.js +13 -12
  344. package/esm/floating-ui-react/hooks/useRole.d.ts +1 -7
  345. package/esm/floating-ui-react/hooks/useRole.js +2 -3
  346. package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.d.ts +2 -2
  347. package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js +2 -0
  348. package/esm/floating-ui-react/hooks/useTypeahead.d.ts +6 -16
  349. package/esm/floating-ui-react/hooks/useTypeahead.js +48 -16
  350. package/esm/floating-ui-react/middleware/arrow.d.ts +1 -1
  351. package/esm/floating-ui-react/safePolygon.d.ts +3 -3
  352. package/esm/floating-ui-react/types.d.ts +14 -14
  353. package/esm/floating-ui-react/utils/composite.d.ts +5 -5
  354. package/esm/floating-ui-react/utils/composite.js +1 -2
  355. package/esm/floating-ui-react/utils/element.d.ts +2 -1
  356. package/esm/floating-ui-react/utils/element.js +16 -4
  357. package/esm/floating-ui-react/utils/enqueueFocus.d.ts +3 -3
  358. package/esm/floating-ui-react/utils/event.js +2 -4
  359. package/esm/floating-ui-react/utils/markOthers.js +2 -2
  360. package/esm/floating-ui-react/utils/tabbable.js +6 -5
  361. package/esm/form/Form.d.ts +5 -5
  362. package/esm/index.d.ts +1 -0
  363. package/esm/index.js +2 -1
  364. package/esm/input/Input.d.ts +3 -3
  365. package/esm/labelable-provider/LabelableContext.d.ts +1 -1
  366. package/esm/labelable-provider/LabelableContext.js +1 -1
  367. package/esm/labelable-provider/LabelableProvider.js +33 -3
  368. package/esm/labelable-provider/useLabelableId.d.ts +3 -2
  369. package/esm/labelable-provider/useLabelableId.js +38 -12
  370. package/esm/menu/arrow/MenuArrow.js +2 -2
  371. package/esm/menu/arrow/MenuArrowDataAttributes.js +2 -2
  372. package/esm/menu/backdrop/MenuBackdrop.js +2 -2
  373. package/esm/menu/checkbox-item/MenuCheckboxItem.d.ts +8 -8
  374. package/esm/menu/checkbox-item/MenuCheckboxItemContext.js +2 -0
  375. package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +2 -2
  376. package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +3 -3
  377. package/esm/menu/group/MenuGroupContext.js +2 -0
  378. package/esm/menu/index.d.ts +2 -1
  379. package/esm/menu/index.parts.d.ts +1 -0
  380. package/esm/menu/index.parts.js +1 -0
  381. package/esm/menu/item/MenuItem.d.ts +5 -5
  382. package/esm/menu/item/MenuItem.js +2 -2
  383. package/esm/menu/item/useMenuItem.js +12 -48
  384. package/esm/menu/item/useMenuItemCommonProps.d.ts +43 -0
  385. package/esm/menu/item/useMenuItemCommonProps.js +66 -0
  386. package/esm/menu/link-item/MenuLinkItem.d.ts +34 -0
  387. package/esm/menu/link-item/MenuLinkItem.js +55 -0
  388. package/esm/menu/link-item/MenuLinkItemDataAttributes.d.ts +6 -0
  389. package/esm/menu/link-item/MenuLinkItemDataAttributes.js +7 -0
  390. package/esm/menu/popup/MenuPopup.d.ts +3 -2
  391. package/esm/menu/popup/MenuPopup.js +2 -2
  392. package/esm/menu/popup/MenuPopupDataAttributes.js +2 -2
  393. package/esm/menu/portal/MenuPortal.d.ts +1 -1
  394. package/esm/menu/portal/MenuPortalContext.js +2 -0
  395. package/esm/menu/positioner/MenuPositioner.js +6 -12
  396. package/esm/menu/positioner/MenuPositionerDataAttributes.js +2 -2
  397. package/esm/menu/radio-group/MenuRadioGroup.d.ts +2 -2
  398. package/esm/menu/radio-group/MenuRadioGroup.js +2 -2
  399. package/esm/menu/radio-group/MenuRadioGroupContext.js +2 -0
  400. package/esm/menu/radio-item/MenuRadioItem.d.ts +5 -5
  401. package/esm/menu/radio-item/MenuRadioItemContext.js +2 -0
  402. package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +2 -2
  403. package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js +3 -3
  404. package/esm/menu/root/MenuRoot.d.ts +15 -15
  405. package/esm/menu/root/MenuRoot.js +38 -36
  406. package/esm/menu/store/MenuStore.d.ts +255 -15
  407. package/esm/menu/store/MenuStore.js +2 -11
  408. package/esm/menu/submenu-root/MenuSubmenuRoot.d.ts +2 -2
  409. package/esm/menu/submenu-root/MenuSubmenuRootContext.js +2 -0
  410. package/esm/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +22 -22
  411. package/esm/menu/submenu-trigger/MenuSubmenuTrigger.js +9 -7
  412. package/esm/menu/trigger/MenuTrigger.d.ts +10 -6
  413. package/esm/menu/trigger/MenuTrigger.js +4 -3
  414. package/esm/menubar/Menubar.d.ts +4 -4
  415. package/esm/menubar/Menubar.js +2 -2
  416. package/esm/meter/root/MeterRoot.d.ts +6 -6
  417. package/esm/meter/root/MeterRoot.js +3 -11
  418. package/esm/meter/value/MeterValue.d.ts +1 -1
  419. package/esm/navigation-menu/arrow/NavigationMenuArrow.js +2 -2
  420. package/esm/navigation-menu/arrow/NavigationMenuArrowDataAttributes.js +2 -2
  421. package/esm/navigation-menu/backdrop/NavigationMenuBackdrop.js +2 -2
  422. package/esm/navigation-menu/content/NavigationMenuContent.d.ts +8 -1
  423. package/esm/navigation-menu/content/NavigationMenuContent.js +26 -5
  424. package/esm/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
  425. package/esm/navigation-menu/icon/NavigationMenuIcon.js +2 -2
  426. package/esm/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
  427. package/esm/navigation-menu/item/NavigationMenuItemContext.js +2 -0
  428. package/esm/navigation-menu/link/NavigationMenuLink.d.ts +2 -2
  429. package/esm/navigation-menu/link/NavigationMenuLink.js +2 -2
  430. package/esm/navigation-menu/list/NavigationMenuDismissContext.js +2 -0
  431. package/esm/navigation-menu/list/NavigationMenuList.d.ts +1 -1
  432. package/esm/navigation-menu/list/NavigationMenuList.js +2 -2
  433. package/esm/navigation-menu/popup/NavigationMenuPopup.d.ts +13 -0
  434. package/esm/navigation-menu/popup/NavigationMenuPopup.js +2 -2
  435. package/esm/navigation-menu/popup/NavigationMenuPopupDataAttributes.js +2 -2
  436. package/esm/navigation-menu/portal/NavigationMenuPortal.d.ts +2 -2
  437. package/esm/navigation-menu/portal/NavigationMenuPortalContext.js +2 -0
  438. package/esm/navigation-menu/positioner/NavigationMenuPositioner.js +2 -2
  439. package/esm/navigation-menu/positioner/NavigationPositionerDataAttributes.js +2 -2
  440. package/esm/navigation-menu/root/NavigationMenuRoot.d.ts +6 -6
  441. package/esm/navigation-menu/root/NavigationMenuRoot.js +2 -2
  442. package/esm/navigation-menu/root/NavigationMenuRootContext.js +2 -0
  443. package/esm/navigation-menu/trigger/NavigationMenuTrigger.js +8 -124
  444. package/esm/navigation-menu/utils/isOutsideMenuEvent.d.ts +1 -1
  445. package/esm/navigation-menu/viewport/NavigationMenuViewport.js +21 -1
  446. package/esm/number-field/input/NumberFieldInput.js +3 -11
  447. package/esm/number-field/root/NumberFieldRoot.d.ts +27 -20
  448. package/esm/number-field/root/NumberFieldRoot.js +22 -7
  449. package/esm/number-field/root/NumberFieldRootContext.d.ts +2 -2
  450. package/esm/number-field/root/useNumberFieldButton.d.ts +3 -3
  451. package/esm/number-field/root/useNumberFieldButton.js +12 -7
  452. package/esm/number-field/scrub-area/NumberFieldScrubArea.d.ts +2 -2
  453. package/esm/number-field/scrub-area/NumberFieldScrubArea.js +16 -0
  454. package/esm/number-field/scrub-area/NumberFieldScrubAreaContext.js +2 -0
  455. package/esm/number-field/utils/stateAttributesMapping.js +3 -1
  456. package/esm/number-field/utils/subscribeToVisualViewportResize.d.ts +1 -1
  457. package/esm/number-field/utils/types.d.ts +5 -5
  458. package/esm/number-field/utils/validate.d.ts +3 -1
  459. package/esm/number-field/utils/validate.js +3 -2
  460. package/esm/popover/arrow/PopoverArrow.js +2 -2
  461. package/esm/popover/arrow/PopoverArrowDataAttributes.js +2 -2
  462. package/esm/popover/backdrop/PopoverBackdrop.js +2 -2
  463. package/esm/popover/popup/PopoverPopup.d.ts +3 -2
  464. package/esm/popover/popup/PopoverPopup.js +2 -2
  465. package/esm/popover/portal/PopoverPortal.d.ts +1 -1
  466. package/esm/popover/portal/PopoverPortal.js +1 -2
  467. package/esm/popover/portal/PopoverPortalContext.js +2 -0
  468. package/esm/popover/positioner/PopoverPositioner.js +3 -3
  469. package/esm/popover/positioner/PopoverPositionerDataAttributes.js +2 -2
  470. package/esm/popover/root/PopoverRoot.d.ts +9 -9
  471. package/esm/popover/root/PopoverRoot.js +18 -5
  472. package/esm/popover/store/PopoverStore.d.ts +255 -15
  473. package/esm/popover/trigger/PopoverTrigger.d.ts +7 -7
  474. package/esm/popover/trigger/PopoverTrigger.js +2 -2
  475. package/esm/popover/viewport/PopoverViewport.d.ts +9 -1
  476. package/esm/popover/viewport/PopoverViewport.js +19 -196
  477. package/esm/popover/viewport/PopoverViewportDataAttributes.d.ts +5 -0
  478. package/esm/popover/viewport/PopoverViewportDataAttributes.js +5 -0
  479. package/esm/preview-card/arrow/PreviewCardArrow.js +2 -2
  480. package/esm/preview-card/arrow/PreviewCardArrowDataAttributes.js +2 -2
  481. package/esm/preview-card/backdrop/PreviewCardBackdrop.js +2 -2
  482. package/esm/preview-card/popup/PreviewCardPopup.js +2 -2
  483. package/esm/preview-card/popup/PreviewCardPopupDataAttributes.js +2 -2
  484. package/esm/preview-card/portal/PreviewCardPortal.d.ts +1 -1
  485. package/esm/preview-card/portal/PreviewCardPortalContext.js +2 -0
  486. package/esm/preview-card/positioner/PreviewCardPositioner.js +2 -2
  487. package/esm/preview-card/positioner/PreviewCardPositionerContext.d.ts +1 -1
  488. package/esm/preview-card/positioner/PreviewCardPositionerDataAttributes.js +2 -2
  489. package/esm/preview-card/root/PreviewCardRoot.d.ts +8 -8
  490. package/esm/preview-card/root/PreviewCardRoot.js +17 -4
  491. package/esm/preview-card/store/PreviewCardStore.d.ts +255 -15
  492. package/esm/preview-card/trigger/PreviewCardTrigger.d.ts +4 -4
  493. package/esm/preview-card/trigger/PreviewCardTrigger.js +2 -2
  494. package/esm/preview-card/viewport/PreviewCardViewport.d.ts +6 -1
  495. package/esm/preview-card/viewport/PreviewCardViewport.js +14 -230
  496. package/esm/progress/root/ProgressRoot.d.ts +6 -6
  497. package/esm/progress/root/ProgressRoot.js +2 -13
  498. package/esm/progress/value/ProgressValue.d.ts +1 -1
  499. package/esm/radio/indicator/RadioIndicator.d.ts +1 -1
  500. package/esm/radio/indicator/RadioIndicator.js +4 -4
  501. package/esm/radio/root/RadioRoot.d.ts +37 -17
  502. package/esm/radio/root/RadioRoot.js +45 -11
  503. package/esm/radio-group/RadioGroup.d.ts +18 -12
  504. package/esm/radio-group/RadioGroup.js +69 -62
  505. package/esm/radio-group/RadioGroupContext.d.ts +9 -8
  506. package/esm/radio-group/RadioGroupContext.js +1 -13
  507. package/esm/scroll-area/root/ScrollAreaRoot.d.ts +4 -2
  508. package/esm/scroll-area/root/ScrollAreaRoot.js +2 -1
  509. package/esm/scroll-area/root/ScrollAreaRootContext.js +2 -0
  510. package/esm/scroll-area/root/ScrollAreaRootDataAttributes.d.ts +4 -0
  511. package/esm/scroll-area/root/ScrollAreaRootDataAttributes.js +4 -0
  512. package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +2 -2
  513. package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js +2 -2
  514. package/esm/scroll-area/scrollbar/ScrollAreaScrollbarContext.js +2 -0
  515. package/esm/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.d.ts +1 -1
  516. package/esm/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.js +1 -1
  517. package/esm/scroll-area/thumb/ScrollAreaThumb.d.ts +1 -1
  518. package/esm/scroll-area/thumb/ScrollAreaThumb.js +2 -2
  519. package/esm/scroll-area/utils/scrollEdges.d.ts +2 -0
  520. package/esm/scroll-area/utils/scrollEdges.js +22 -0
  521. package/esm/scroll-area/viewport/ScrollAreaViewport.js +18 -15
  522. package/esm/scroll-area/viewport/ScrollAreaViewportContext.js +2 -0
  523. package/esm/scroll-area/viewport/ScrollAreaViewportDataAttributes.d.ts +4 -0
  524. package/esm/scroll-area/viewport/ScrollAreaViewportDataAttributes.js +4 -0
  525. package/esm/select/arrow/SelectArrow.js +2 -2
  526. package/esm/select/arrow/SelectArrowDataAttributes.js +2 -2
  527. package/esm/select/backdrop/SelectBackdrop.js +2 -2
  528. package/esm/select/group/SelectGroupContext.js +2 -0
  529. package/esm/select/icon/SelectIcon.js +2 -2
  530. package/esm/select/item/SelectItem.d.ts +2 -2
  531. package/esm/select/item/SelectItem.js +13 -13
  532. package/esm/select/item/SelectItemContext.js +2 -0
  533. package/esm/select/item-indicator/SelectItemIndicator.d.ts +1 -1
  534. package/esm/select/item-indicator/SelectItemIndicator.js +2 -2
  535. package/esm/select/popup/SelectPopup.d.ts +11 -0
  536. package/esm/select/popup/SelectPopup.js +64 -35
  537. package/esm/select/popup/SelectPopupDataAttributes.js +2 -2
  538. package/esm/select/portal/SelectPortalContext.js +2 -0
  539. package/esm/select/positioner/SelectPositioner.d.ts +1 -1
  540. package/esm/select/positioner/SelectPositioner.js +14 -11
  541. package/esm/select/positioner/SelectPositionerContext.js +2 -0
  542. package/esm/select/positioner/SelectPositionerDataAttributes.js +2 -2
  543. package/esm/select/root/SelectRoot.d.ts +27 -22
  544. package/esm/select/root/SelectRoot.js +2 -0
  545. package/esm/select/root/SelectRootContext.d.ts +14 -14
  546. package/esm/select/root/SelectRootContext.js +2 -0
  547. package/esm/select/scroll-arrow/SelectScrollArrow.d.ts +1 -1
  548. package/esm/select/scroll-arrow/SelectScrollArrow.js +2 -2
  549. package/esm/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
  550. package/esm/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.js +1 -1
  551. package/esm/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
  552. package/esm/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.js +1 -1
  553. package/esm/select/store.d.ts +3 -3
  554. package/esm/select/store.js +3 -3
  555. package/esm/select/trigger/SelectTrigger.d.ts +1 -1
  556. package/esm/select/trigger/SelectTrigger.js +2 -2
  557. package/esm/select/value/SelectValue.d.ts +4 -0
  558. package/esm/select/value/SelectValue.js +2 -2
  559. package/esm/separator/Separator.d.ts +1 -1
  560. package/esm/separator/Separator.js +2 -2
  561. package/esm/slider/root/SliderRoot.d.ts +17 -17
  562. package/esm/slider/root/SliderRoot.js +3 -2
  563. package/esm/slider/root/SliderRootContext.d.ts +2 -2
  564. package/esm/slider/root/stateAttributesMapping.js +3 -1
  565. package/esm/slider/thumb/SliderThumb.d.ts +7 -7
  566. package/esm/slider/utils/getPushedThumbValues.d.ts +1 -1
  567. package/esm/slider/utils/resolveThumbCollision.d.ts +2 -2
  568. package/esm/slider/value/SliderValue.d.ts +1 -1
  569. package/esm/switch/root/SwitchRoot.d.ts +11 -11
  570. package/esm/switch/root/SwitchRoot.js +7 -1
  571. package/esm/switch/root/SwitchRootContext.js +2 -0
  572. package/esm/tabs/indicator/TabsIndicator.d.ts +1 -1
  573. package/esm/tabs/indicator/TabsIndicator.js +2 -2
  574. package/esm/tabs/list/TabsList.d.ts +2 -2
  575. package/esm/tabs/list/TabsList.js +2 -2
  576. package/esm/tabs/panel/TabsPanel.d.ts +4 -2
  577. package/esm/tabs/panel/TabsPanel.js +35 -9
  578. package/esm/tabs/root/TabsRoot.d.ts +4 -4
  579. package/esm/tabs/root/TabsRootContext.d.ts +1 -1
  580. package/esm/tabs/tab/TabsTab.d.ts +1 -1
  581. package/esm/tabs/tab/TabsTab.js +2 -2
  582. package/esm/toast/action/ToastAction.js +2 -2
  583. package/esm/toast/arrow/ToastArrow.js +2 -2
  584. package/esm/toast/arrow/ToastArrowDataAttributes.js +4 -3
  585. package/esm/toast/close/ToastClose.js +6 -8
  586. package/esm/toast/content/ToastContent.js +2 -2
  587. package/esm/toast/createToastManager.d.ts +5 -5
  588. package/esm/toast/createToastManager.js +3 -6
  589. package/esm/toast/description/ToastDescription.js +4 -6
  590. package/esm/toast/positioner/ToastPositioner.d.ts +2 -2
  591. package/esm/toast/positioner/ToastPositioner.js +6 -7
  592. package/esm/toast/positioner/ToastPositionerDataAttributes.js +2 -2
  593. package/esm/toast/provider/ToastProvider.d.ts +3 -3
  594. package/esm/toast/provider/ToastProvider.js +26 -285
  595. package/esm/toast/provider/ToastProviderContext.d.ts +4 -25
  596. package/esm/toast/provider/ToastProviderContext.js +3 -1
  597. package/esm/toast/root/ToastRoot.d.ts +1 -1
  598. package/esm/toast/root/ToastRoot.js +19 -27
  599. package/esm/toast/root/ToastRootContext.js +2 -0
  600. package/esm/toast/store.d.ts +51 -0
  601. package/esm/toast/store.js +355 -0
  602. package/esm/toast/title/ToastTitle.js +4 -6
  603. package/esm/toast/useToastManager.d.ts +20 -21
  604. package/esm/toast/useToastManager.js +8 -14
  605. package/esm/toast/viewport/ToastViewport.js +66 -92
  606. package/esm/toggle/Toggle.d.ts +10 -8
  607. package/esm/toggle/Toggle.js +13 -3
  608. package/esm/toggle-group/ToggleGroup.d.ts +22 -10
  609. package/esm/toggle-group/ToggleGroup.js +8 -5
  610. package/esm/toggle-group/ToggleGroupContext.d.ts +10 -5
  611. package/esm/toolbar/button/ToolbarButton.d.ts +2 -2
  612. package/esm/toolbar/button/ToolbarButton.js +2 -2
  613. package/esm/toolbar/group/ToolbarGroup.d.ts +1 -1
  614. package/esm/toolbar/group/ToolbarGroup.js +2 -2
  615. package/esm/toolbar/group/ToolbarGroupContext.js +2 -0
  616. package/esm/toolbar/input/ToolbarInput.d.ts +3 -3
  617. package/esm/toolbar/input/ToolbarInput.js +2 -2
  618. package/esm/toolbar/link/ToolbarLink.js +2 -2
  619. package/esm/toolbar/root/ToolbarRoot.d.ts +3 -3
  620. package/esm/toolbar/root/ToolbarRoot.js +2 -2
  621. package/esm/tooltip/arrow/TooltipArrow.d.ts +1 -0
  622. package/esm/tooltip/arrow/TooltipArrow.js +2 -2
  623. package/esm/tooltip/arrow/TooltipArrowDataAttributes.js +2 -2
  624. package/esm/tooltip/popup/TooltipPopup.js +2 -2
  625. package/esm/tooltip/popup/TooltipPopupDataAttributes.js +2 -2
  626. package/esm/tooltip/portal/TooltipPortal.d.ts +1 -1
  627. package/esm/tooltip/portal/TooltipPortalContext.js +2 -0
  628. package/esm/tooltip/positioner/TooltipPositioner.d.ts +1 -1
  629. package/esm/tooltip/positioner/TooltipPositionerContext.d.ts +1 -1
  630. package/esm/tooltip/positioner/TooltipPositionerDataAttributes.js +2 -2
  631. package/esm/tooltip/provider/TooltipProvider.d.ts +3 -3
  632. package/esm/tooltip/provider/TooltipProviderContext.js +2 -0
  633. package/esm/tooltip/root/TooltipRoot.d.ts +12 -12
  634. package/esm/tooltip/root/TooltipRoot.js +23 -11
  635. package/esm/tooltip/store/TooltipStore.d.ts +256 -16
  636. package/esm/tooltip/trigger/TooltipTrigger.d.ts +11 -4
  637. package/esm/tooltip/trigger/TooltipTrigger.js +12 -6
  638. package/esm/tooltip/trigger/TooltipTriggerDataAttributes.d.ts +4 -0
  639. package/esm/tooltip/trigger/TooltipTriggerDataAttributes.js +4 -0
  640. package/esm/tooltip/viewport/TooltipViewport.d.ts +9 -1
  641. package/esm/tooltip/viewport/TooltipViewport.js +14 -195
  642. package/esm/unstable-use-media-query/index.d.ts +5 -5
  643. package/esm/use-button/useButton.d.ts +4 -4
  644. package/esm/use-button/useButton.js +7 -2
  645. package/esm/use-render/useRender.d.ts +9 -9
  646. package/esm/utils/InternalBackdrop.d.ts +1 -1
  647. package/esm/utils/createBaseUIEventDetails.d.ts +3 -0
  648. package/esm/utils/formatNumber.d.ts +2 -1
  649. package/esm/utils/formatNumber.js +11 -0
  650. package/esm/utils/getDisabledMountTransitionStyles.d.ts +1 -1
  651. package/esm/utils/getPseudoElementBounds.js +1 -1
  652. package/esm/utils/itemEquality.d.ts +5 -5
  653. package/esm/utils/itemEquality.js +17 -17
  654. package/esm/utils/popupStateMapping.d.ts +10 -0
  655. package/esm/utils/popupStateMapping.js +10 -0
  656. package/esm/utils/popups/popupStoreUtils.js +2 -0
  657. package/esm/utils/popups/popupTriggerMap.d.ts +14 -1
  658. package/esm/utils/popups/popupTriggerMap.js +27 -9
  659. package/esm/utils/popups/store.d.ts +28 -18
  660. package/esm/utils/popups/store.js +8 -5
  661. package/esm/utils/reason-parts.d.ts +3 -0
  662. package/esm/utils/reason-parts.js +3 -0
  663. package/esm/utils/scrollable.d.ts +4 -0
  664. package/esm/utils/scrollable.js +32 -0
  665. package/esm/utils/types.d.ts +6 -6
  666. package/esm/utils/useAnchorPositioning.d.ts +26 -26
  667. package/esm/utils/useAnchorPositioning.js +19 -16
  668. package/esm/utils/useFocusableWhenDisabled.d.ts +4 -4
  669. package/esm/utils/useMixedToggleClickHandler.d.ts +1 -1
  670. package/esm/utils/useMixedToggleClickHandler.js +2 -0
  671. package/esm/utils/useOpenChangeComplete.d.ts +2 -2
  672. package/esm/utils/usePopupAutoResize.d.ts +3 -3
  673. package/esm/utils/usePopupAutoResize.js +3 -1
  674. package/esm/utils/usePopupViewport.d.ts +58 -0
  675. package/esm/utils/usePopupViewport.js +247 -0
  676. package/esm/utils/useRenderElement.d.ts +9 -9
  677. package/esm/utils/useRenderElement.js +28 -1
  678. package/esm/utils/useSwipeDismiss.d.ts +108 -0
  679. package/esm/utils/useSwipeDismiss.js +944 -0
  680. package/esm/utils/useValueChanged.js +2 -0
  681. package/field/control/FieldControl.d.ts +3 -3
  682. package/field/control/FieldControl.js +21 -20
  683. package/field/error/FieldError.d.ts +5 -2
  684. package/field/error/FieldError.js +51 -7
  685. package/field/item/FieldItem.d.ts +1 -1
  686. package/field/item/FieldItemContext.js +1 -0
  687. package/field/label/FieldLabel.d.ts +1 -1
  688. package/field/label/FieldLabel.js +7 -2
  689. package/field/root/FieldRoot.d.ts +9 -9
  690. package/field/root/FieldRootContext.d.ts +1 -1
  691. package/field/useField.d.ts +1 -1
  692. package/field/useField.js +1 -0
  693. package/field/validity/FieldValidity.d.ts +2 -0
  694. package/field/validity/FieldValidity.js +9 -3
  695. package/fieldset/legend/FieldsetLegend.js +2 -2
  696. package/fieldset/root/FieldsetRoot.d.ts +1 -1
  697. package/fieldset/root/FieldsetRoot.js +3 -3
  698. package/floating-ui-react/components/FloatingDelayGroup.d.ts +2 -7
  699. package/floating-ui-react/components/FloatingDelayGroup.js +2 -9
  700. package/floating-ui-react/components/FloatingFocusManager.d.ts +11 -21
  701. package/floating-ui-react/components/FloatingFocusManager.js +61 -74
  702. package/floating-ui-react/components/FloatingPortal.d.ts +8 -9
  703. package/floating-ui-react/components/FloatingPortal.js +1 -3
  704. package/floating-ui-react/components/FloatingTree.d.ts +1 -1
  705. package/floating-ui-react/hooks/useClick.d.ts +12 -6
  706. package/floating-ui-react/hooks/useClick.js +6 -5
  707. package/floating-ui-react/hooks/useClientPoint.d.ts +2 -12
  708. package/floating-ui-react/hooks/useClientPoint.js +4 -16
  709. package/floating-ui-react/hooks/useDismiss.d.ts +15 -15
  710. package/floating-ui-react/hooks/useDismiss.js +4 -2
  711. package/floating-ui-react/hooks/useFloating.js +1 -0
  712. package/floating-ui-react/hooks/useFloatingRootContext.d.ts +4 -10
  713. package/floating-ui-react/hooks/useFloatingRootContext.js +4 -3
  714. package/floating-ui-react/hooks/useFocus.d.ts +2 -8
  715. package/floating-ui-react/hooks/useFocus.js +9 -11
  716. package/floating-ui-react/hooks/useHover.d.ts +7 -30
  717. package/floating-ui-react/hooks/useHover.js +18 -36
  718. package/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +2 -7
  719. package/floating-ui-react/hooks/useHoverFloatingInteraction.js +33 -39
  720. package/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +17 -14
  721. package/floating-ui-react/hooks/useHoverInteractionSharedState.js +36 -30
  722. package/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +7 -3
  723. package/floating-ui-react/hooks/useHoverReferenceInteraction.js +55 -59
  724. package/floating-ui-react/hooks/useInteractions.d.ts +2 -2
  725. package/floating-ui-react/hooks/useListNavigation.d.ts +19 -35
  726. package/floating-ui-react/hooks/useListNavigation.js +11 -11
  727. package/floating-ui-react/hooks/useRole.d.ts +1 -7
  728. package/floating-ui-react/hooks/useRole.js +2 -3
  729. package/floating-ui-react/hooks/useSyncedFloatingRootContext.d.ts +2 -2
  730. package/floating-ui-react/hooks/useSyncedFloatingRootContext.js +1 -0
  731. package/floating-ui-react/hooks/useTypeahead.d.ts +6 -16
  732. package/floating-ui-react/hooks/useTypeahead.js +46 -15
  733. package/floating-ui-react/middleware/arrow.d.ts +1 -1
  734. package/floating-ui-react/safePolygon.d.ts +3 -3
  735. package/floating-ui-react/types.d.ts +14 -14
  736. package/floating-ui-react/utils/composite.d.ts +5 -5
  737. package/floating-ui-react/utils/composite.js +1 -3
  738. package/floating-ui-react/utils/element.d.ts +2 -1
  739. package/floating-ui-react/utils/element.js +16 -4
  740. package/floating-ui-react/utils/enqueueFocus.d.ts +3 -3
  741. package/floating-ui-react/utils/event.js +2 -4
  742. package/floating-ui-react/utils/markOthers.js +2 -2
  743. package/floating-ui-react/utils/tabbable.js +5 -4
  744. package/form/Form.d.ts +5 -5
  745. package/index.d.ts +1 -0
  746. package/index.js +12 -1
  747. package/input/Input.d.ts +3 -3
  748. package/labelable-provider/LabelableContext.d.ts +1 -1
  749. package/labelable-provider/LabelableContext.js +1 -1
  750. package/labelable-provider/LabelableProvider.js +33 -3
  751. package/labelable-provider/useLabelableId.d.ts +3 -2
  752. package/labelable-provider/useLabelableId.js +39 -12
  753. package/menu/arrow/MenuArrow.js +2 -2
  754. package/menu/arrow/MenuArrowDataAttributes.js +2 -2
  755. package/menu/backdrop/MenuBackdrop.js +2 -2
  756. package/menu/checkbox-item/MenuCheckboxItem.d.ts +8 -8
  757. package/menu/checkbox-item/MenuCheckboxItemContext.js +1 -0
  758. package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +2 -2
  759. package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +3 -3
  760. package/menu/group/MenuGroupContext.js +1 -0
  761. package/menu/index.d.ts +2 -1
  762. package/menu/index.parts.d.ts +1 -0
  763. package/menu/index.parts.js +7 -0
  764. package/menu/item/MenuItem.d.ts +5 -5
  765. package/menu/item/MenuItem.js +2 -2
  766. package/menu/item/useMenuItem.js +12 -48
  767. package/menu/item/useMenuItemCommonProps.d.ts +43 -0
  768. package/menu/item/useMenuItemCommonProps.js +72 -0
  769. package/menu/link-item/MenuLinkItem.d.ts +34 -0
  770. package/menu/link-item/MenuLinkItem.js +60 -0
  771. package/menu/link-item/MenuLinkItemDataAttributes.d.ts +6 -0
  772. package/menu/link-item/MenuLinkItemDataAttributes.js +13 -0
  773. package/menu/popup/MenuPopup.d.ts +3 -2
  774. package/menu/popup/MenuPopup.js +2 -2
  775. package/menu/popup/MenuPopupDataAttributes.js +2 -2
  776. package/menu/portal/MenuPortal.d.ts +1 -1
  777. package/menu/portal/MenuPortalContext.js +1 -0
  778. package/menu/positioner/MenuPositioner.js +6 -12
  779. package/menu/positioner/MenuPositionerDataAttributes.js +2 -2
  780. package/menu/radio-group/MenuRadioGroup.d.ts +2 -2
  781. package/menu/radio-group/MenuRadioGroup.js +2 -2
  782. package/menu/radio-group/MenuRadioGroupContext.js +1 -0
  783. package/menu/radio-item/MenuRadioItem.d.ts +5 -5
  784. package/menu/radio-item/MenuRadioItemContext.js +1 -0
  785. package/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +2 -2
  786. package/menu/radio-item-indicator/MenuRadioItemIndicator.js +3 -3
  787. package/menu/root/MenuRoot.d.ts +15 -15
  788. package/menu/root/MenuRoot.js +39 -37
  789. package/menu/store/MenuStore.d.ts +255 -15
  790. package/menu/store/MenuStore.js +2 -11
  791. package/menu/submenu-root/MenuSubmenuRoot.d.ts +2 -2
  792. package/menu/submenu-root/MenuSubmenuRootContext.js +1 -0
  793. package/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +22 -22
  794. package/menu/submenu-trigger/MenuSubmenuTrigger.js +10 -8
  795. package/menu/trigger/MenuTrigger.d.ts +10 -6
  796. package/menu/trigger/MenuTrigger.js +5 -4
  797. package/menubar/Menubar.d.ts +4 -4
  798. package/menubar/Menubar.js +2 -2
  799. package/meter/root/MeterRoot.d.ts +6 -6
  800. package/meter/root/MeterRoot.js +1 -10
  801. package/meter/value/MeterValue.d.ts +1 -1
  802. package/navigation-menu/arrow/NavigationMenuArrow.js +2 -2
  803. package/navigation-menu/arrow/NavigationMenuArrowDataAttributes.js +2 -2
  804. package/navigation-menu/backdrop/NavigationMenuBackdrop.js +2 -2
  805. package/navigation-menu/content/NavigationMenuContent.d.ts +8 -1
  806. package/navigation-menu/content/NavigationMenuContent.js +26 -5
  807. package/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
  808. package/navigation-menu/icon/NavigationMenuIcon.js +2 -2
  809. package/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
  810. package/navigation-menu/item/NavigationMenuItemContext.js +1 -0
  811. package/navigation-menu/link/NavigationMenuLink.d.ts +2 -2
  812. package/navigation-menu/link/NavigationMenuLink.js +2 -2
  813. package/navigation-menu/list/NavigationMenuDismissContext.js +1 -0
  814. package/navigation-menu/list/NavigationMenuList.d.ts +1 -1
  815. package/navigation-menu/list/NavigationMenuList.js +2 -2
  816. package/navigation-menu/popup/NavigationMenuPopup.d.ts +13 -0
  817. package/navigation-menu/popup/NavigationMenuPopup.js +2 -2
  818. package/navigation-menu/popup/NavigationMenuPopupDataAttributes.js +2 -2
  819. package/navigation-menu/portal/NavigationMenuPortal.d.ts +2 -2
  820. package/navigation-menu/portal/NavigationMenuPortalContext.js +1 -0
  821. package/navigation-menu/positioner/NavigationMenuPositioner.js +2 -2
  822. package/navigation-menu/positioner/NavigationPositionerDataAttributes.js +2 -2
  823. package/navigation-menu/root/NavigationMenuRoot.d.ts +6 -6
  824. package/navigation-menu/root/NavigationMenuRoot.js +2 -2
  825. package/navigation-menu/root/NavigationMenuRootContext.js +1 -0
  826. package/navigation-menu/trigger/NavigationMenuTrigger.js +7 -124
  827. package/navigation-menu/utils/isOutsideMenuEvent.d.ts +1 -1
  828. package/navigation-menu/viewport/NavigationMenuViewport.js +21 -1
  829. package/number-field/input/NumberFieldInput.js +3 -11
  830. package/number-field/root/NumberFieldRoot.d.ts +27 -20
  831. package/number-field/root/NumberFieldRoot.js +22 -7
  832. package/number-field/root/NumberFieldRootContext.d.ts +2 -2
  833. package/number-field/root/useNumberFieldButton.d.ts +3 -3
  834. package/number-field/root/useNumberFieldButton.js +12 -7
  835. package/number-field/scrub-area/NumberFieldScrubArea.d.ts +2 -2
  836. package/number-field/scrub-area/NumberFieldScrubArea.js +16 -0
  837. package/number-field/scrub-area/NumberFieldScrubAreaContext.js +1 -0
  838. package/number-field/utils/stateAttributesMapping.js +3 -1
  839. package/number-field/utils/subscribeToVisualViewportResize.d.ts +1 -1
  840. package/number-field/utils/types.d.ts +5 -5
  841. package/number-field/utils/validate.d.ts +3 -1
  842. package/number-field/utils/validate.js +3 -2
  843. package/package.json +13 -4
  844. package/popover/arrow/PopoverArrow.js +2 -2
  845. package/popover/arrow/PopoverArrowDataAttributes.js +2 -2
  846. package/popover/backdrop/PopoverBackdrop.js +2 -2
  847. package/popover/popup/PopoverPopup.d.ts +3 -2
  848. package/popover/popup/PopoverPopup.js +2 -2
  849. package/popover/portal/PopoverPortal.d.ts +1 -1
  850. package/popover/portal/PopoverPortal.js +1 -2
  851. package/popover/portal/PopoverPortalContext.js +1 -0
  852. package/popover/positioner/PopoverPositioner.js +3 -3
  853. package/popover/positioner/PopoverPositionerDataAttributes.js +2 -2
  854. package/popover/root/PopoverRoot.d.ts +9 -9
  855. package/popover/root/PopoverRoot.js +18 -5
  856. package/popover/store/PopoverStore.d.ts +255 -15
  857. package/popover/trigger/PopoverTrigger.d.ts +7 -7
  858. package/popover/trigger/PopoverTrigger.js +3 -3
  859. package/popover/viewport/PopoverViewport.d.ts +9 -1
  860. package/popover/viewport/PopoverViewport.js +19 -196
  861. package/popover/viewport/PopoverViewportDataAttributes.d.ts +5 -0
  862. package/popover/viewport/PopoverViewportDataAttributes.js +5 -0
  863. package/preview-card/arrow/PreviewCardArrow.js +2 -2
  864. package/preview-card/arrow/PreviewCardArrowDataAttributes.js +2 -2
  865. package/preview-card/backdrop/PreviewCardBackdrop.js +2 -2
  866. package/preview-card/popup/PreviewCardPopup.js +2 -2
  867. package/preview-card/popup/PreviewCardPopupDataAttributes.js +2 -2
  868. package/preview-card/portal/PreviewCardPortal.d.ts +1 -1
  869. package/preview-card/portal/PreviewCardPortalContext.js +1 -0
  870. package/preview-card/positioner/PreviewCardPositioner.js +2 -2
  871. package/preview-card/positioner/PreviewCardPositionerContext.d.ts +1 -1
  872. package/preview-card/positioner/PreviewCardPositionerDataAttributes.js +2 -2
  873. package/preview-card/root/PreviewCardRoot.d.ts +8 -8
  874. package/preview-card/root/PreviewCardRoot.js +17 -4
  875. package/preview-card/store/PreviewCardStore.d.ts +255 -15
  876. package/preview-card/trigger/PreviewCardTrigger.d.ts +4 -4
  877. package/preview-card/trigger/PreviewCardTrigger.js +3 -3
  878. package/preview-card/viewport/PreviewCardViewport.d.ts +6 -1
  879. package/preview-card/viewport/PreviewCardViewport.js +14 -230
  880. package/progress/root/ProgressRoot.d.ts +6 -6
  881. package/progress/root/ProgressRoot.js +1 -12
  882. package/progress/value/ProgressValue.d.ts +1 -1
  883. package/radio/indicator/RadioIndicator.d.ts +1 -1
  884. package/radio/indicator/RadioIndicator.js +4 -4
  885. package/radio/root/RadioRoot.d.ts +37 -17
  886. package/radio/root/RadioRoot.js +45 -11
  887. package/radio-group/RadioGroup.d.ts +18 -12
  888. package/radio-group/RadioGroup.js +68 -61
  889. package/radio-group/RadioGroupContext.d.ts +9 -8
  890. package/radio-group/RadioGroupContext.js +1 -13
  891. package/scroll-area/root/ScrollAreaRoot.d.ts +4 -2
  892. package/scroll-area/root/ScrollAreaRoot.js +2 -1
  893. package/scroll-area/root/ScrollAreaRootContext.js +1 -0
  894. package/scroll-area/root/ScrollAreaRootDataAttributes.d.ts +4 -0
  895. package/scroll-area/root/ScrollAreaRootDataAttributes.js +4 -0
  896. package/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +2 -2
  897. package/scroll-area/scrollbar/ScrollAreaScrollbar.js +2 -2
  898. package/scroll-area/scrollbar/ScrollAreaScrollbarContext.js +1 -0
  899. package/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.d.ts +1 -1
  900. package/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.js +1 -1
  901. package/scroll-area/thumb/ScrollAreaThumb.d.ts +1 -1
  902. package/scroll-area/thumb/ScrollAreaThumb.js +2 -2
  903. package/scroll-area/utils/scrollEdges.d.ts +2 -0
  904. package/scroll-area/utils/scrollEdges.js +29 -0
  905. package/scroll-area/viewport/ScrollAreaViewport.js +18 -15
  906. package/scroll-area/viewport/ScrollAreaViewportContext.js +1 -0
  907. package/scroll-area/viewport/ScrollAreaViewportDataAttributes.d.ts +4 -0
  908. package/scroll-area/viewport/ScrollAreaViewportDataAttributes.js +4 -0
  909. package/select/arrow/SelectArrow.js +2 -2
  910. package/select/arrow/SelectArrowDataAttributes.js +2 -2
  911. package/select/backdrop/SelectBackdrop.js +2 -2
  912. package/select/group/SelectGroupContext.js +1 -0
  913. package/select/icon/SelectIcon.js +2 -2
  914. package/select/item/SelectItem.d.ts +2 -2
  915. package/select/item/SelectItem.js +13 -13
  916. package/select/item/SelectItemContext.js +1 -0
  917. package/select/item-indicator/SelectItemIndicator.d.ts +1 -1
  918. package/select/item-indicator/SelectItemIndicator.js +2 -2
  919. package/select/popup/SelectPopup.d.ts +11 -0
  920. package/select/popup/SelectPopup.js +64 -35
  921. package/select/popup/SelectPopupDataAttributes.js +2 -2
  922. package/select/portal/SelectPortalContext.js +1 -0
  923. package/select/positioner/SelectPositioner.d.ts +1 -1
  924. package/select/positioner/SelectPositioner.js +13 -10
  925. package/select/positioner/SelectPositionerContext.js +1 -0
  926. package/select/positioner/SelectPositionerDataAttributes.js +2 -2
  927. package/select/root/SelectRoot.d.ts +27 -22
  928. package/select/root/SelectRoot.js +2 -0
  929. package/select/root/SelectRootContext.d.ts +14 -14
  930. package/select/root/SelectRootContext.js +1 -0
  931. package/select/scroll-arrow/SelectScrollArrow.d.ts +1 -1
  932. package/select/scroll-arrow/SelectScrollArrow.js +2 -2
  933. package/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
  934. package/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.js +1 -1
  935. package/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
  936. package/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.js +1 -1
  937. package/select/store.d.ts +3 -3
  938. package/select/store.js +3 -3
  939. package/select/trigger/SelectTrigger.d.ts +1 -1
  940. package/select/trigger/SelectTrigger.js +2 -2
  941. package/select/value/SelectValue.d.ts +4 -0
  942. package/select/value/SelectValue.js +2 -2
  943. package/separator/Separator.d.ts +1 -1
  944. package/separator/Separator.js +2 -2
  945. package/slider/root/SliderRoot.d.ts +17 -17
  946. package/slider/root/SliderRoot.js +3 -2
  947. package/slider/root/SliderRootContext.d.ts +2 -2
  948. package/slider/root/stateAttributesMapping.js +3 -1
  949. package/slider/thumb/SliderThumb.d.ts +7 -7
  950. package/slider/utils/getPushedThumbValues.d.ts +1 -1
  951. package/slider/utils/resolveThumbCollision.d.ts +2 -2
  952. package/slider/value/SliderValue.d.ts +1 -1
  953. package/switch/root/SwitchRoot.d.ts +11 -11
  954. package/switch/root/SwitchRoot.js +7 -1
  955. package/switch/root/SwitchRootContext.js +1 -0
  956. package/tabs/indicator/TabsIndicator.d.ts +1 -1
  957. package/tabs/indicator/TabsIndicator.js +2 -2
  958. package/tabs/list/TabsList.d.ts +2 -2
  959. package/tabs/list/TabsList.js +2 -2
  960. package/tabs/panel/TabsPanel.d.ts +4 -2
  961. package/tabs/panel/TabsPanel.js +37 -10
  962. package/tabs/root/TabsRoot.d.ts +4 -4
  963. package/tabs/root/TabsRootContext.d.ts +1 -1
  964. package/tabs/tab/TabsTab.d.ts +1 -1
  965. package/tabs/tab/TabsTab.js +2 -2
  966. package/toast/action/ToastAction.js +2 -2
  967. package/toast/arrow/ToastArrow.js +2 -2
  968. package/toast/arrow/ToastArrowDataAttributes.js +4 -3
  969. package/toast/close/ToastClose.js +5 -7
  970. package/toast/content/ToastContent.js +2 -2
  971. package/toast/createToastManager.d.ts +5 -5
  972. package/toast/createToastManager.js +3 -6
  973. package/toast/description/ToastDescription.js +4 -6
  974. package/toast/positioner/ToastPositioner.d.ts +2 -2
  975. package/toast/positioner/ToastPositioner.js +5 -6
  976. package/toast/positioner/ToastPositionerDataAttributes.js +2 -2
  977. package/toast/provider/ToastProvider.d.ts +3 -3
  978. package/toast/provider/ToastProvider.js +24 -284
  979. package/toast/provider/ToastProviderContext.d.ts +4 -25
  980. package/toast/provider/ToastProviderContext.js +3 -2
  981. package/toast/root/ToastRoot.d.ts +1 -1
  982. package/toast/root/ToastRoot.js +18 -26
  983. package/toast/root/ToastRootContext.js +1 -0
  984. package/toast/store.d.ts +51 -0
  985. package/toast/store.js +362 -0
  986. package/toast/title/ToastTitle.js +4 -6
  987. package/toast/useToastManager.d.ts +20 -21
  988. package/toast/useToastManager.js +8 -14
  989. package/toast/viewport/ToastViewport.js +65 -91
  990. package/toggle/Toggle.d.ts +10 -8
  991. package/toggle/Toggle.js +13 -3
  992. package/toggle-group/ToggleGroup.d.ts +22 -10
  993. package/toggle-group/ToggleGroup.js +8 -5
  994. package/toggle-group/ToggleGroupContext.d.ts +10 -5
  995. package/toolbar/button/ToolbarButton.d.ts +2 -2
  996. package/toolbar/button/ToolbarButton.js +2 -2
  997. package/toolbar/group/ToolbarGroup.d.ts +1 -1
  998. package/toolbar/group/ToolbarGroup.js +2 -2
  999. package/toolbar/group/ToolbarGroupContext.js +1 -0
  1000. package/toolbar/input/ToolbarInput.d.ts +3 -3
  1001. package/toolbar/input/ToolbarInput.js +2 -2
  1002. package/toolbar/link/ToolbarLink.js +2 -2
  1003. package/toolbar/root/ToolbarRoot.d.ts +3 -3
  1004. package/toolbar/root/ToolbarRoot.js +2 -2
  1005. package/tooltip/arrow/TooltipArrow.d.ts +1 -0
  1006. package/tooltip/arrow/TooltipArrow.js +2 -2
  1007. package/tooltip/arrow/TooltipArrowDataAttributes.js +2 -2
  1008. package/tooltip/popup/TooltipPopup.js +2 -2
  1009. package/tooltip/popup/TooltipPopupDataAttributes.js +2 -2
  1010. package/tooltip/portal/TooltipPortal.d.ts +1 -1
  1011. package/tooltip/portal/TooltipPortalContext.js +1 -0
  1012. package/tooltip/positioner/TooltipPositioner.d.ts +1 -1
  1013. package/tooltip/positioner/TooltipPositionerContext.d.ts +1 -1
  1014. package/tooltip/positioner/TooltipPositionerDataAttributes.js +2 -2
  1015. package/tooltip/provider/TooltipProvider.d.ts +3 -3
  1016. package/tooltip/provider/TooltipProviderContext.js +1 -0
  1017. package/tooltip/root/TooltipRoot.d.ts +12 -12
  1018. package/tooltip/root/TooltipRoot.js +23 -11
  1019. package/tooltip/store/TooltipStore.d.ts +256 -16
  1020. package/tooltip/trigger/TooltipTrigger.d.ts +11 -4
  1021. package/tooltip/trigger/TooltipTrigger.js +12 -6
  1022. package/tooltip/trigger/TooltipTriggerDataAttributes.d.ts +4 -0
  1023. package/tooltip/trigger/TooltipTriggerDataAttributes.js +4 -0
  1024. package/tooltip/viewport/TooltipViewport.d.ts +9 -1
  1025. package/tooltip/viewport/TooltipViewport.js +14 -195
  1026. package/unstable-use-media-query/index.d.ts +5 -5
  1027. package/use-button/useButton.d.ts +4 -4
  1028. package/use-button/useButton.js +7 -2
  1029. package/use-render/useRender.d.ts +9 -9
  1030. package/utils/InternalBackdrop.d.ts +1 -1
  1031. package/utils/createBaseUIEventDetails.d.ts +3 -0
  1032. package/utils/formatNumber.d.ts +2 -1
  1033. package/utils/formatNumber.js +12 -0
  1034. package/utils/getDisabledMountTransitionStyles.d.ts +1 -1
  1035. package/utils/getPseudoElementBounds.js +1 -1
  1036. package/utils/itemEquality.d.ts +5 -5
  1037. package/utils/itemEquality.js +18 -18
  1038. package/utils/popupStateMapping.d.ts +10 -0
  1039. package/utils/popupStateMapping.js +10 -0
  1040. package/utils/popups/popupStoreUtils.js +1 -0
  1041. package/utils/popups/popupTriggerMap.d.ts +14 -1
  1042. package/utils/popups/popupTriggerMap.js +27 -10
  1043. package/utils/popups/store.d.ts +28 -18
  1044. package/utils/popups/store.js +8 -5
  1045. package/utils/reason-parts.d.ts +3 -0
  1046. package/utils/reason-parts.js +4 -1
  1047. package/utils/scrollable.d.ts +4 -0
  1048. package/utils/scrollable.js +40 -0
  1049. package/utils/types.d.ts +6 -6
  1050. package/utils/useAnchorPositioning.d.ts +26 -26
  1051. package/utils/useAnchorPositioning.js +19 -16
  1052. package/utils/useFocusableWhenDisabled.d.ts +4 -4
  1053. package/utils/useMixedToggleClickHandler.d.ts +1 -1
  1054. package/utils/useMixedToggleClickHandler.js +1 -0
  1055. package/utils/useOpenChangeComplete.d.ts +2 -2
  1056. package/utils/usePopupAutoResize.d.ts +3 -3
  1057. package/utils/usePopupAutoResize.js +2 -1
  1058. package/utils/usePopupViewport.d.ts +58 -0
  1059. package/utils/usePopupViewport.js +253 -0
  1060. package/utils/useRenderElement.d.ts +9 -9
  1061. package/utils/useRenderElement.js +28 -1
  1062. package/utils/useSwipeDismiss.d.ts +108 -0
  1063. package/utils/useSwipeDismiss.js +952 -0
  1064. package/utils/useValueChanged.js +1 -0
  1065. package/esm/toast/viewport/ToastViewportContext.d.ts +0 -6
  1066. package/esm/toast/viewport/ToastViewportContext.js +0 -11
  1067. package/toast/viewport/ToastViewportContext.d.ts +0 -6
  1068. package/toast/viewport/ToastViewportContext.js +0 -20
@@ -0,0 +1,124 @@
1
+ import * as React from 'react';
2
+ import { type DrawerSwipeDirection, type DrawerSnapPoint } from "./DrawerRootContext.js";
3
+ import { type BaseUIChangeEventDetails } from "../../utils/createBaseUIEventDetails.js";
4
+ import { REASONS } from "../../utils/reasons.js";
5
+ import type { DialogHandle } from "../../dialog/store/DialogHandle.js";
6
+ import type { PayloadChildRenderFunction } from "../../utils/popups/index.js";
7
+ /**
8
+ * Groups all parts of the drawer.
9
+ * Doesn't render its own HTML element.
10
+ *
11
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
12
+ */
13
+ export declare function DrawerRoot<Payload = unknown>(props: DrawerRoot.Props<Payload>): import("react/jsx-runtime").JSX.Element;
14
+ export interface DrawerRootProps<Payload = unknown> {
15
+ /**
16
+ * Whether the drawer is currently open.
17
+ */
18
+ open?: boolean | undefined;
19
+ /**
20
+ * Whether the drawer is initially open.
21
+ *
22
+ * To render a controlled drawer, use the `open` prop instead.
23
+ * @default false
24
+ */
25
+ defaultOpen?: boolean | undefined;
26
+ /**
27
+ * Determines if the drawer enters a modal state when open.
28
+ * - `true`: user interaction is limited to just the drawer: focus is trapped, document page scroll is locked, and pointer interactions on outside elements are disabled.
29
+ * - `false`: user interaction with the rest of the document is allowed.
30
+ * - `'trap-focus'`: focus is trapped inside the drawer, but document page scroll is not locked and pointer interactions outside of it remain enabled.
31
+ * @default true
32
+ */
33
+ modal?: (boolean | 'trap-focus') | undefined;
34
+ /**
35
+ * Event handler called when the drawer is opened or closed.
36
+ */
37
+ onOpenChange?: ((open: boolean, eventDetails: DrawerRoot.ChangeEventDetails) => void) | undefined;
38
+ /**
39
+ * Event handler called after any animations complete when the drawer is opened or closed.
40
+ */
41
+ onOpenChangeComplete?: ((open: boolean) => void) | undefined;
42
+ /**
43
+ * Determines whether the drawer should close on outside clicks.
44
+ * @default false
45
+ */
46
+ disablePointerDismissal?: boolean | undefined;
47
+ /**
48
+ * A ref to imperative actions.
49
+ * - `unmount`: When specified, the drawer will not be unmounted when closed.
50
+ * Instead, the `unmount` function must be called to unmount the drawer manually.
51
+ * Useful when the drawer's animation is controlled by an external library.
52
+ * - `close`: Closes the drawer imperatively when called.
53
+ */
54
+ actionsRef?: React.RefObject<DrawerRoot.Actions | null> | undefined;
55
+ /**
56
+ * A handle to associate the drawer with a trigger.
57
+ * If specified, allows detached triggers to control the drawer's open state.
58
+ * Can be created with the Drawer.createHandle() method.
59
+ */
60
+ handle?: DialogHandle<Payload> | undefined;
61
+ /**
62
+ * ID of the trigger that the drawer is associated with.
63
+ * This is useful in conjunction with the `open` prop to create a controlled drawer.
64
+ * There's no need to specify this prop when the drawer is uncontrolled (i.e. when the `open` prop is not set).
65
+ */
66
+ triggerId?: (string | null) | undefined;
67
+ /**
68
+ * ID of the trigger that the drawer is associated with.
69
+ * This is useful in conjunction with the `defaultOpen` prop to create an initially open drawer.
70
+ */
71
+ defaultTriggerId?: (string | null) | undefined;
72
+ /**
73
+ * The content of the drawer.
74
+ */
75
+ children?: React.ReactNode | PayloadChildRenderFunction<Payload>;
76
+ /**
77
+ * The swipe direction used to dismiss the drawer.
78
+ * @default 'down'
79
+ */
80
+ swipeDirection?: DrawerSwipeDirection | undefined;
81
+ /**
82
+ * Snap points used to position the drawer.
83
+ * Use numbers between 0 and 1 to represent fractions of the viewport height,
84
+ * numbers greater than 1 as pixel values, or strings in `px`/`rem` units
85
+ * (for example, `'148px'` or `'30rem'`).
86
+ */
87
+ snapPoints?: DrawerSnapPoint[] | undefined;
88
+ /**
89
+ * Disables velocity-based snap skipping so drag distance determines the next snap point.
90
+ * @default false
91
+ */
92
+ snapToSequentialPoints?: boolean | undefined;
93
+ /**
94
+ * The currently active snap point. Use with `onSnapPointChange` to control the snap point.
95
+ */
96
+ snapPoint?: DrawerSnapPoint | null | undefined;
97
+ /**
98
+ * The initial snap point value when uncontrolled.
99
+ */
100
+ defaultSnapPoint?: DrawerSnapPoint | null | undefined;
101
+ /**
102
+ * Callback fired when the snap point changes.
103
+ */
104
+ onSnapPointChange?: ((snapPoint: DrawerSnapPoint | null, eventDetails: DrawerRoot.SnapPointChangeEventDetails) => void) | undefined;
105
+ }
106
+ export interface DrawerRootActions {
107
+ unmount: () => void;
108
+ close: () => void;
109
+ }
110
+ export type DrawerRootChangeEventReason = typeof REASONS.triggerPress | typeof REASONS.outsidePress | typeof REASONS.escapeKey | typeof REASONS.closeWatcher | typeof REASONS.closePress | typeof REASONS.focusOut | typeof REASONS.imperativeAction | typeof REASONS.swipe | typeof REASONS.none;
111
+ export type DrawerRootChangeEventDetails = BaseUIChangeEventDetails<DrawerRoot.ChangeEventReason> & {
112
+ preventUnmountOnClose(): void;
113
+ };
114
+ export type DrawerRootSnapPointChangeEventReason = DrawerRootChangeEventReason;
115
+ export type DrawerRootSnapPointChangeEventDetails = BaseUIChangeEventDetails<DrawerRootSnapPointChangeEventReason>;
116
+ export declare namespace DrawerRoot {
117
+ type Props<Payload = unknown> = DrawerRootProps<Payload>;
118
+ type Actions = DrawerRootActions;
119
+ type ChangeEventReason = DrawerRootChangeEventReason;
120
+ type ChangeEventDetails = DrawerRootChangeEventDetails;
121
+ type SnapPointChangeEventReason = DrawerRootSnapPointChangeEventReason;
122
+ type SnapPointChangeEventDetails = DrawerRootSnapPointChangeEventDetails;
123
+ type SnapPoint = DrawerSnapPoint;
124
+ }
@@ -0,0 +1,235 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.DrawerRoot = DrawerRoot;
9
+ var React = _interopRequireWildcard(require("react"));
10
+ var _useControlled = require("@base-ui/utils/useControlled");
11
+ var _useStableCallback = require("@base-ui/utils/useStableCallback");
12
+ var _owner = require("@base-ui/utils/owner");
13
+ var _detectBrowser = require("@base-ui/utils/detectBrowser");
14
+ var _DrawerRootContext = require("./DrawerRootContext");
15
+ var _dialog = require("../../dialog");
16
+ var _createBaseUIEventDetails = require("../../utils/createBaseUIEventDetails");
17
+ var _reasons = require("../../utils/reasons");
18
+ var _DialogRootContext = require("../../dialog/root/DialogRootContext");
19
+ var _DrawerProviderContext = require("../provider/DrawerProviderContext");
20
+ var _jsxRuntime = require("react/jsx-runtime");
21
+ var _DrawerProviderReport, _DrawerProviderReport2;
22
+ /**
23
+ * Groups all parts of the drawer.
24
+ * Doesn't render its own HTML element.
25
+ *
26
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
27
+ */
28
+ function DrawerRoot(props) {
29
+ const {
30
+ children,
31
+ open: openProp,
32
+ defaultOpen = false,
33
+ onOpenChange,
34
+ onOpenChangeComplete,
35
+ disablePointerDismissal = false,
36
+ modal = true,
37
+ actionsRef,
38
+ handle,
39
+ triggerId: triggerIdProp,
40
+ defaultTriggerId: defaultTriggerIdProp = null,
41
+ swipeDirection = 'down',
42
+ snapToSequentialPoints = false,
43
+ snapPoints,
44
+ snapPoint: snapPointProp,
45
+ defaultSnapPoint,
46
+ onSnapPointChange: onSnapPointChangeProp
47
+ } = props;
48
+ const onSnapPointChange = (0, _useStableCallback.useStableCallback)(onSnapPointChangeProp);
49
+ const parentDrawerRootContext = (0, _DrawerRootContext.useDrawerRootContext)(true);
50
+ const notifyParentSwipeProgressChange = parentDrawerRootContext?.onNestedSwipeProgressChange;
51
+ const notifyParentFrontmostHeight = parentDrawerRootContext?.onNestedFrontmostHeightChange;
52
+ const notifyParentSwipingChange = parentDrawerRootContext?.onNestedSwipingChange;
53
+ const notifyParentHasNestedDrawer = parentDrawerRootContext?.onNestedDrawerPresenceChange;
54
+ const [popupHeight, setPopupHeight] = React.useState(0);
55
+ const [frontmostHeight, setFrontmostHeight] = React.useState(0);
56
+ const [hasNestedDrawer, setHasNestedDrawer] = React.useState(false);
57
+ const [nestedSwiping, setNestedSwiping] = React.useState(false);
58
+ const [nestedSwipeProgressStore] = React.useState(createNestedSwipeProgressStore);
59
+ const resolvedDefaultSnapPoint = defaultSnapPoint !== undefined ? defaultSnapPoint : snapPoints?.[0] ?? null;
60
+ const isSnapPointControlled = snapPointProp !== undefined;
61
+ const [activeSnapPoint, setActiveSnapPointUnwrapped] = (0, _useControlled.useControlled)({
62
+ controlled: snapPointProp,
63
+ default: resolvedDefaultSnapPoint,
64
+ name: 'Drawer',
65
+ state: 'snapPoint'
66
+ });
67
+ const isNestedDrawerOpenRef = React.useRef(false);
68
+ const setActiveSnapPoint = (0, _useStableCallback.useStableCallback)((nextSnapPoint, eventDetails) => {
69
+ const resolvedEventDetails = eventDetails ?? (0, _createBaseUIEventDetails.createChangeEventDetails)(_reasons.REASONS.none);
70
+ onSnapPointChange?.(nextSnapPoint, resolvedEventDetails);
71
+ if (resolvedEventDetails.isCanceled) {
72
+ return;
73
+ }
74
+ setActiveSnapPointUnwrapped(nextSnapPoint);
75
+ });
76
+ const resolvedActiveSnapPoint = React.useMemo(() => {
77
+ if (isSnapPointControlled) {
78
+ return activeSnapPoint;
79
+ }
80
+ if (!snapPoints || snapPoints.length === 0) {
81
+ return activeSnapPoint;
82
+ }
83
+ if (activeSnapPoint === null || !snapPoints.some(snapPoint => Object.is(snapPoint, activeSnapPoint))) {
84
+ return resolvedDefaultSnapPoint;
85
+ }
86
+ return activeSnapPoint;
87
+ }, [activeSnapPoint, isSnapPointControlled, resolvedDefaultSnapPoint, snapPoints]);
88
+ const onPopupHeightChange = (0, _useStableCallback.useStableCallback)(height => {
89
+ setPopupHeight(height);
90
+ if (!isNestedDrawerOpenRef.current && height > 0) {
91
+ setFrontmostHeight(height);
92
+ }
93
+ });
94
+ const onNestedFrontmostHeightChange = (0, _useStableCallback.useStableCallback)(height => {
95
+ if (height > 0) {
96
+ isNestedDrawerOpenRef.current = true;
97
+ setFrontmostHeight(height);
98
+ return;
99
+ }
100
+ isNestedDrawerOpenRef.current = false;
101
+ if (popupHeight > 0) {
102
+ setFrontmostHeight(popupHeight);
103
+ }
104
+ });
105
+ const onNestedDrawerPresenceChange = (0, _useStableCallback.useStableCallback)(present => {
106
+ setHasNestedDrawer(present);
107
+ });
108
+ const onNestedSwipeProgressChange = (0, _useStableCallback.useStableCallback)(progress => {
109
+ nestedSwipeProgressStore.set(progress);
110
+ notifyParentSwipeProgressChange?.(progress);
111
+ });
112
+ const onNestedSwipingChange = (0, _useStableCallback.useStableCallback)(swiping => {
113
+ setNestedSwiping(swiping);
114
+ notifyParentSwipingChange?.(swiping);
115
+ });
116
+ const handleOpenChange = (0, _useStableCallback.useStableCallback)((nextOpen, eventDetails) => {
117
+ onOpenChange?.(nextOpen, eventDetails);
118
+ if (eventDetails.isCanceled) {
119
+ return;
120
+ }
121
+ if (!nextOpen && snapPoints && snapPoints.length > 0) {
122
+ setActiveSnapPoint(resolvedDefaultSnapPoint, (0, _createBaseUIEventDetails.createChangeEventDetails)(eventDetails.reason, eventDetails.event, eventDetails.trigger));
123
+ }
124
+ });
125
+ const contextValue = React.useMemo(() => ({
126
+ swipeDirection,
127
+ snapToSequentialPoints,
128
+ snapPoints,
129
+ activeSnapPoint: resolvedActiveSnapPoint,
130
+ setActiveSnapPoint,
131
+ frontmostHeight,
132
+ popupHeight,
133
+ hasNestedDrawer,
134
+ nestedSwiping,
135
+ nestedSwipeProgressStore,
136
+ onNestedDrawerPresenceChange,
137
+ onPopupHeightChange,
138
+ onNestedFrontmostHeightChange,
139
+ onNestedSwipingChange,
140
+ onNestedSwipeProgressChange,
141
+ notifyParentFrontmostHeight,
142
+ notifyParentSwipingChange,
143
+ notifyParentSwipeProgressChange,
144
+ notifyParentHasNestedDrawer
145
+ }), [resolvedActiveSnapPoint, frontmostHeight, hasNestedDrawer, nestedSwiping, nestedSwipeProgressStore, notifyParentHasNestedDrawer, notifyParentSwipeProgressChange, notifyParentSwipingChange, notifyParentFrontmostHeight, onNestedDrawerPresenceChange, onNestedFrontmostHeightChange, onNestedSwipeProgressChange, onNestedSwipingChange, onPopupHeightChange, popupHeight, setActiveSnapPoint, snapPoints, snapToSequentialPoints, swipeDirection]);
146
+ const resolvedChildren = typeof children === 'function' ? payload => /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
147
+ children: [_DrawerProviderReport || (_DrawerProviderReport = /*#__PURE__*/(0, _jsxRuntime.jsx)(DrawerProviderReporter, {})), children(payload)]
148
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
149
+ children: [_DrawerProviderReport2 || (_DrawerProviderReport2 = /*#__PURE__*/(0, _jsxRuntime.jsx)(DrawerProviderReporter, {})), children]
150
+ });
151
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DrawerRootContext.DrawerRootContext.Provider, {
152
+ value: contextValue,
153
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_dialog.Dialog.Root, {
154
+ open: openProp,
155
+ defaultOpen: defaultOpen,
156
+ onOpenChange: handleOpenChange,
157
+ onOpenChangeComplete: onOpenChangeComplete,
158
+ disablePointerDismissal: disablePointerDismissal,
159
+ modal: modal,
160
+ actionsRef: actionsRef,
161
+ handle: handle,
162
+ triggerId: triggerIdProp,
163
+ defaultTriggerId: defaultTriggerIdProp,
164
+ children: resolvedChildren
165
+ })
166
+ });
167
+ }
168
+ function createNestedSwipeProgressStore() {
169
+ let progress = 0;
170
+ const listeners = new Set();
171
+ return {
172
+ getSnapshot: () => progress,
173
+ set(nextProgress) {
174
+ const resolved = Number.isFinite(nextProgress) ? nextProgress : 0;
175
+ if (resolved === progress) {
176
+ return;
177
+ }
178
+ progress = resolved;
179
+ listeners.forEach(listener => {
180
+ listener();
181
+ });
182
+ },
183
+ subscribe(listener) {
184
+ listeners.add(listener);
185
+ return () => {
186
+ listeners.delete(listener);
187
+ };
188
+ }
189
+ };
190
+ }
191
+ function DrawerProviderReporter() {
192
+ const drawerId = React.useId();
193
+ const providerContext = (0, _DrawerProviderContext.useDrawerProviderContext)(true);
194
+ const dialogRootContext = (0, _DialogRootContext.useDialogRootContext)(false);
195
+ const open = dialogRootContext.store.useState('open');
196
+ const nestedOpenDialogCount = dialogRootContext.store.useState('nestedOpenDialogCount');
197
+ const popupElement = dialogRootContext.store.useState('popupElement');
198
+ const isTopmost = nestedOpenDialogCount === 0;
199
+ React.useEffect(() => {
200
+ if (!providerContext) {
201
+ return undefined;
202
+ }
203
+ return () => {
204
+ providerContext.removeDrawer(drawerId);
205
+ };
206
+ }, [drawerId, providerContext]);
207
+ React.useEffect(() => {
208
+ providerContext?.setDrawerOpen(drawerId, open);
209
+ }, [drawerId, open, providerContext]);
210
+ React.useEffect(() => {
211
+ // CloseWatcher enables the Android back gesture (Chromium-only).
212
+ // Keep this Android-only for now to avoid interfering with Escape/nesting semantics on desktop due to `useDismiss`.
213
+ if (!open || !isTopmost || !_detectBrowser.isAndroid) {
214
+ return undefined;
215
+ }
216
+ const win = (0, _owner.ownerWindow)(popupElement);
217
+ const CloseWatcherCtor = win.CloseWatcher;
218
+ if (!CloseWatcherCtor) {
219
+ return undefined;
220
+ }
221
+ function handleCloseWatcher(event) {
222
+ if (!dialogRootContext.store.select('open')) {
223
+ return;
224
+ }
225
+ dialogRootContext.store.setOpen(false, (0, _createBaseUIEventDetails.createChangeEventDetails)(_reasons.REASONS.closeWatcher, event));
226
+ }
227
+ const closeWatcher = new CloseWatcherCtor();
228
+ closeWatcher.addEventListener('close', handleCloseWatcher);
229
+ return () => {
230
+ closeWatcher.removeEventListener('close', handleCloseWatcher);
231
+ closeWatcher.destroy();
232
+ };
233
+ }, [dialogRootContext.store, isTopmost, open, popupElement]);
234
+ return null;
235
+ }
@@ -0,0 +1,89 @@
1
+ import * as React from 'react';
2
+ import type { SwipeDirection } from "../../utils/useSwipeDismiss.js";
3
+ import type { DrawerRootSnapPointChangeEventDetails } from "./DrawerRoot.js";
4
+ export type DrawerSwipeDirection = SwipeDirection;
5
+ export type DrawerSnapPoint = number | string;
6
+ export interface DrawerNestedSwipeProgressStore {
7
+ getSnapshot: () => number;
8
+ subscribe: (listener: () => void) => () => void;
9
+ }
10
+ export interface DrawerRootContext {
11
+ swipeDirection: DrawerSwipeDirection;
12
+ /**
13
+ * Whether snap points can be skipped based on swipe velocity.
14
+ */
15
+ snapToSequentialPoints: boolean;
16
+ /**
17
+ * Snap points used to size/position the drawer.
18
+ */
19
+ snapPoints?: DrawerSnapPoint[] | undefined;
20
+ /**
21
+ * The currently active snap point.
22
+ */
23
+ activeSnapPoint?: DrawerSnapPoint | null | undefined;
24
+ /**
25
+ * Updates the currently active snap point.
26
+ */
27
+ setActiveSnapPoint?: ((snapPoint: DrawerSnapPoint | null, eventDetails?: DrawerRootSnapPointChangeEventDetails) => void) | undefined;
28
+ /**
29
+ * The measured height of the frontmost open drawer within the current nested drawer stack.
30
+ */
31
+ frontmostHeight: number;
32
+ /**
33
+ * The measured height of the drawer popup element.
34
+ */
35
+ popupHeight: number;
36
+ /**
37
+ * Whether the current drawer has a nested drawer mounted in its stack (including while it is
38
+ * transitioning out).
39
+ */
40
+ hasNestedDrawer: boolean;
41
+ /**
42
+ * Whether a nested drawer is currently being swiped.
43
+ */
44
+ nestedSwiping: boolean;
45
+ /**
46
+ * Provides nested swipe progress without re-rendering the drawer tree.
47
+ */
48
+ nestedSwipeProgressStore: DrawerNestedSwipeProgressStore;
49
+ /**
50
+ * Called by a nested drawer to report whether it is still present (open or transitioning out).
51
+ */
52
+ onNestedDrawerPresenceChange: (present: boolean) => void;
53
+ /**
54
+ * Called by the drawer popup to report its own measured height.
55
+ */
56
+ onPopupHeightChange: (height: number) => void;
57
+ /**
58
+ * Called by a nested drawer to report the frontmost height of its own stack.
59
+ */
60
+ onNestedFrontmostHeightChange: (height: number) => void;
61
+ /**
62
+ * Called by a nested drawer to report whether it's being swiped.
63
+ */
64
+ onNestedSwipingChange: (swiping: boolean) => void;
65
+ /**
66
+ * Called by a nested drawer to report its swipe progress.
67
+ */
68
+ onNestedSwipeProgressChange: (progress: number) => void;
69
+ /**
70
+ * Provided to nested drawers so they can report their frontmost height to the parent drawer.
71
+ */
72
+ notifyParentFrontmostHeight?: ((height: number) => void) | undefined;
73
+ /**
74
+ * Provided to nested drawers so they can report swiping to the parent drawer.
75
+ */
76
+ notifyParentSwipingChange?: ((swiping: boolean) => void) | undefined;
77
+ /**
78
+ * Provided to nested drawers so they can report swipe progress to the parent drawer.
79
+ */
80
+ notifyParentSwipeProgressChange?: ((progress: number) => void) | undefined;
81
+ /**
82
+ * Provided to nested drawers so they can report whether they are still present (open or
83
+ * transitioning out) to the parent drawer.
84
+ */
85
+ notifyParentHasNestedDrawer?: ((present: boolean) => void) | undefined;
86
+ }
87
+ export declare const DrawerRootContext: React.Context<DrawerRootContext | undefined>;
88
+ export declare function useDrawerRootContext(optional?: false): DrawerRootContext;
89
+ export declare function useDrawerRootContext(optional: true): DrawerRootContext | undefined;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.DrawerRootContext = void 0;
10
+ exports.useDrawerRootContext = useDrawerRootContext;
11
+ var _formatErrorMessage2 = _interopRequireDefault(require("@base-ui/utils/formatErrorMessage"));
12
+ var React = _interopRequireWildcard(require("react"));
13
+ const DrawerRootContext = exports.DrawerRootContext = /*#__PURE__*/React.createContext(undefined);
14
+ if (process.env.NODE_ENV !== "production") DrawerRootContext.displayName = "DrawerRootContext";
15
+ function useDrawerRootContext(optional) {
16
+ const drawerRootContext = React.useContext(DrawerRootContext);
17
+ if (optional === false && drawerRootContext === undefined) {
18
+ throw new Error(process.env.NODE_ENV !== "production" ? 'Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.' : (0, _formatErrorMessage2.default)(90));
19
+ }
20
+ return drawerRootContext;
21
+ }
@@ -0,0 +1,15 @@
1
+ import type { DrawerSnapPoint } from "./DrawerRootContext.js";
2
+ export interface ResolvedDrawerSnapPoint {
3
+ value: DrawerSnapPoint;
4
+ height: number;
5
+ offset: number;
6
+ }
7
+ export declare function useDrawerSnapPoints(): {
8
+ snapPoints: DrawerSnapPoint[] | undefined;
9
+ activeSnapPoint: DrawerSnapPoint | null | undefined;
10
+ setActiveSnapPoint: ((snapPoint: DrawerSnapPoint | null, eventDetails?: import("./DrawerRoot.js").DrawerRootSnapPointChangeEventDetails) => void) | undefined;
11
+ popupHeight: number;
12
+ viewportHeight: number;
13
+ resolvedSnapPoints: ResolvedDrawerSnapPoint[];
14
+ activeSnapPointOffset: number | null;
15
+ };
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useDrawerSnapPoints = useDrawerSnapPoints;
9
+ var React = _interopRequireWildcard(require("react"));
10
+ var _useIsoLayoutEffect = require("@base-ui/utils/useIsoLayoutEffect");
11
+ var _useStableCallback = require("@base-ui/utils/useStableCallback");
12
+ var _owner = require("@base-ui/utils/owner");
13
+ var _clamp = require("../../utils/clamp");
14
+ var _DialogRootContext = require("../../dialog/root/DialogRootContext");
15
+ var _DrawerRootContext = require("./DrawerRootContext");
16
+ function resolveSnapPointValue(snapPoint, viewportHeight, rootFontSize) {
17
+ if (!Number.isFinite(viewportHeight) || viewportHeight <= 0) {
18
+ return null;
19
+ }
20
+ if (typeof snapPoint === 'number') {
21
+ if (!Number.isFinite(snapPoint)) {
22
+ return null;
23
+ }
24
+ if (snapPoint <= 1) {
25
+ return (0, _clamp.clamp)(snapPoint, 0, 1) * viewportHeight;
26
+ }
27
+ return snapPoint;
28
+ }
29
+ const trimmed = snapPoint.trim();
30
+ if (trimmed.endsWith('px')) {
31
+ const value = Number.parseFloat(trimmed);
32
+ return Number.isFinite(value) ? value : null;
33
+ }
34
+ if (trimmed.endsWith('rem')) {
35
+ const value = Number.parseFloat(trimmed);
36
+ return Number.isFinite(value) ? value * rootFontSize : null;
37
+ }
38
+ return null;
39
+ }
40
+ function findClosestSnapPoint(height, points) {
41
+ let closest = null;
42
+ let closestDistance = Infinity;
43
+ for (const point of points) {
44
+ const distance = Math.abs(point.height - height);
45
+ if (distance < closestDistance) {
46
+ closestDistance = distance;
47
+ closest = point;
48
+ }
49
+ }
50
+ return closest;
51
+ }
52
+ function useDrawerSnapPoints() {
53
+ const {
54
+ store
55
+ } = (0, _DialogRootContext.useDialogRootContext)();
56
+ const {
57
+ snapPoints,
58
+ activeSnapPoint,
59
+ setActiveSnapPoint,
60
+ popupHeight
61
+ } = (0, _DrawerRootContext.useDrawerRootContext)();
62
+ const viewportElement = store.useState('viewportElement');
63
+ const [viewportHeight, setViewportHeight] = React.useState(0);
64
+ const [rootFontSize, setRootFontSize] = React.useState(16);
65
+ const measureViewportHeight = (0, _useStableCallback.useStableCallback)(() => {
66
+ const doc = (0, _owner.ownerDocument)(viewportElement);
67
+ const html = doc.documentElement;
68
+ if (viewportElement) {
69
+ setViewportHeight(viewportElement.offsetHeight);
70
+ }
71
+ if (!viewportElement) {
72
+ setViewportHeight(html.clientHeight);
73
+ }
74
+ const fontSize = parseFloat(getComputedStyle(html).fontSize);
75
+ if (Number.isFinite(fontSize)) {
76
+ setRootFontSize(fontSize);
77
+ }
78
+ });
79
+ (0, _useIsoLayoutEffect.useIsoLayoutEffect)(() => {
80
+ measureViewportHeight();
81
+ if (!viewportElement || typeof ResizeObserver !== 'function') {
82
+ return undefined;
83
+ }
84
+ const resizeObserver = new ResizeObserver(measureViewportHeight);
85
+ resizeObserver.observe(viewportElement);
86
+ return () => {
87
+ resizeObserver.disconnect();
88
+ };
89
+ }, [measureViewportHeight, viewportElement]);
90
+ const resolvedSnapPoints = React.useMemo(() => {
91
+ if (!snapPoints || snapPoints.length === 0 || viewportHeight <= 0 || popupHeight <= 0) {
92
+ return [];
93
+ }
94
+ const maxHeight = Math.min(popupHeight, viewportHeight);
95
+ if (!Number.isFinite(maxHeight) || maxHeight <= 0) {
96
+ return [];
97
+ }
98
+ const resolved = snapPoints.map(value => {
99
+ const resolvedHeight = resolveSnapPointValue(value, viewportHeight, rootFontSize);
100
+ if (resolvedHeight === null || !Number.isFinite(resolvedHeight)) {
101
+ return null;
102
+ }
103
+ const clampedHeight = (0, _clamp.clamp)(resolvedHeight, 0, maxHeight);
104
+ return {
105
+ value,
106
+ height: clampedHeight,
107
+ offset: Math.max(0, popupHeight - clampedHeight)
108
+ };
109
+ }).filter(point => Boolean(point));
110
+ if (resolved.length <= 1) {
111
+ return resolved;
112
+ }
113
+ const deduped = [];
114
+ const seenHeights = [];
115
+ for (let index = resolved.length - 1; index >= 0; index -= 1) {
116
+ const point = resolved[index];
117
+ const isDuplicate = seenHeights.some(height => Math.abs(height - point.height) <= 1);
118
+ if (isDuplicate) {
119
+ continue;
120
+ }
121
+ seenHeights.push(point.height);
122
+ deduped.push(point);
123
+ }
124
+ deduped.reverse();
125
+ return deduped;
126
+ }, [popupHeight, rootFontSize, snapPoints, viewportHeight]);
127
+ const resolvedActiveSnapPoint = React.useMemo(() => {
128
+ if (activeSnapPoint === undefined) {
129
+ return resolvedSnapPoints[0];
130
+ }
131
+ if (activeSnapPoint === null) {
132
+ return undefined;
133
+ }
134
+ const exactMatch = resolvedSnapPoints.find(point => Object.is(point.value, activeSnapPoint));
135
+ if (exactMatch) {
136
+ return exactMatch;
137
+ }
138
+ const maxHeight = Math.min(popupHeight, viewportHeight);
139
+ const resolvedHeight = resolveSnapPointValue(activeSnapPoint, viewportHeight, rootFontSize);
140
+ if (resolvedHeight === null || !Number.isFinite(resolvedHeight)) {
141
+ return undefined;
142
+ }
143
+ const clampedHeight = (0, _clamp.clamp)(resolvedHeight, 0, maxHeight);
144
+ return findClosestSnapPoint(clampedHeight, resolvedSnapPoints) ?? undefined;
145
+ }, [activeSnapPoint, popupHeight, resolvedSnapPoints, rootFontSize, viewportHeight]);
146
+ return {
147
+ snapPoints,
148
+ activeSnapPoint,
149
+ setActiveSnapPoint,
150
+ popupHeight,
151
+ viewportHeight,
152
+ resolvedSnapPoints,
153
+ activeSnapPointOffset: resolvedActiveSnapPoint?.offset ?? null
154
+ };
155
+ }
@@ -0,0 +1,45 @@
1
+ import * as React from 'react';
2
+ import type { BaseUIComponentProps } from "../../utils/types.js";
3
+ import { type SwipeDirection } from "../../utils/useSwipeDismiss.js";
4
+ import { type DrawerSwipeDirection } from "../root/DrawerRootContext.js";
5
+ /**
6
+ * An invisible area that listens for swipe gestures to open the drawer.
7
+ * Renders a `<div>` element.
8
+ *
9
+ * Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
10
+ */
11
+ export declare const DrawerSwipeArea: React.ForwardRefExoticComponent<Omit<DrawerSwipeAreaProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ export interface DrawerSwipeAreaProps extends BaseUIComponentProps<'div', DrawerSwipeArea.State> {
13
+ /**
14
+ * Whether the swipe area is disabled.
15
+ * @default false
16
+ */
17
+ disabled?: boolean | undefined;
18
+ /**
19
+ * The swipe direction that opens the drawer.
20
+ * Defaults to the opposite of `Drawer.Root` `swipeDirection`.
21
+ */
22
+ swipeDirection?: DrawerSwipeDirection | undefined;
23
+ }
24
+ export interface DrawerSwipeAreaState {
25
+ /**
26
+ * Whether the drawer is currently open.
27
+ */
28
+ open: boolean;
29
+ /**
30
+ * Whether the swipe area is currently being swiped.
31
+ */
32
+ swiping: boolean;
33
+ /**
34
+ * The swipe direction that opens the drawer.
35
+ */
36
+ swipeDirection: SwipeDirection;
37
+ /**
38
+ * Whether the swipe area is disabled.
39
+ */
40
+ disabled: boolean;
41
+ }
42
+ export declare namespace DrawerSwipeArea {
43
+ type Props = DrawerSwipeAreaProps;
44
+ type State = DrawerSwipeAreaState;
45
+ }