@base-ui/react 1.3.0 → 1.4.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 (1092) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/accordion/header/AccordionHeader.js +1 -0
  3. package/accordion/item/AccordionItem.js +1 -0
  4. package/accordion/panel/AccordionPanel.js +2 -1
  5. package/accordion/root/AccordionRoot.d.ts +1 -1
  6. package/accordion/root/AccordionRoot.js +1 -0
  7. package/accordion/trigger/AccordionTrigger.js +2 -1
  8. package/alert-dialog/index.d.ts +9 -1
  9. package/alert-dialog/root/AlertDialogRoot.d.ts +1 -1
  10. package/alert-dialog/root/AlertDialogRoot.js +22 -20
  11. package/autocomplete/clear/AutocompleteClearDataAttributes.d.ts +1 -0
  12. package/autocomplete/clear/AutocompleteClearDataAttributes.js +12 -0
  13. package/autocomplete/index.d.ts +8 -5
  14. package/autocomplete/index.parts.d.ts +3 -3
  15. package/autocomplete/index.parts.js +6 -6
  16. package/autocomplete/input-group/AutocompleteInputGroup.d.ts +41 -0
  17. package/autocomplete/input-group/AutocompleteInputGroup.js +15 -0
  18. package/autocomplete/input-group/AutocompleteInputGroupDataAttributes.d.ts +51 -0
  19. package/autocomplete/input-group/AutocompleteInputGroupDataAttributes.js +58 -0
  20. package/autocomplete/item/AutocompleteItem.d.ts +48 -0
  21. package/autocomplete/item/AutocompleteItem.js +15 -0
  22. package/autocomplete/item/AutocompleteItemDataAttributes.d.ts +10 -0
  23. package/autocomplete/item/AutocompleteItemDataAttributes.js +18 -0
  24. package/autocomplete/trigger/AutocompleteTrigger.d.ts +43 -0
  25. package/autocomplete/trigger/AutocompleteTrigger.js +15 -0
  26. package/autocomplete/trigger/AutocompleteTriggerDataAttributes.d.ts +55 -0
  27. package/autocomplete/trigger/AutocompleteTriggerDataAttributes.js +63 -0
  28. package/avatar/fallback/AvatarFallback.js +1 -0
  29. package/avatar/image/AvatarImage.js +1 -0
  30. package/avatar/image/useImageLoadingStatus.js +5 -0
  31. package/avatar/root/AvatarRoot.js +1 -0
  32. package/button/Button.js +1 -0
  33. package/calendar/day-button/CalendarDayButton.d.ts +47 -0
  34. package/calendar/day-button/CalendarDayButton.js +130 -0
  35. package/calendar/day-button/CalendarDayButtonDataAttributes.d.ts +22 -0
  36. package/calendar/day-button/CalendarDayButtonDataAttributes.js +29 -0
  37. package/calendar/day-grid/CalendarDayGrid.d.ts +15 -0
  38. package/calendar/day-grid/CalendarDayGrid.js +32 -0
  39. package/calendar/day-grid-body/CalendarDayGridBody.d.ts +16 -0
  40. package/calendar/day-grid-body/CalendarDayGridBody.js +53 -0
  41. package/calendar/day-grid-body/SharedCalendarDayGridBodyContext.d.ts +14 -0
  42. package/calendar/day-grid-body/SharedCalendarDayGridBodyContext.js +21 -0
  43. package/calendar/day-grid-body/useSharedCalendarDayGridBody.d.ts +45 -0
  44. package/calendar/day-grid-body/useSharedCalendarDayGridBody.js +285 -0
  45. package/calendar/day-grid-cell/CalendarDayGridCell.d.ts +16 -0
  46. package/calendar/day-grid-cell/CalendarDayGridCell.js +46 -0
  47. package/calendar/day-grid-cell/SharedCalendarDayGridCellContext.d.ts +22 -0
  48. package/calendar/day-grid-cell/SharedCalendarDayGridCellContext.js +21 -0
  49. package/calendar/day-grid-cell/useSharedCalendarDayGridCell.d.ts +17 -0
  50. package/calendar/day-grid-cell/useSharedCalendarDayGridCell.js +40 -0
  51. package/calendar/day-grid-header/CalendarDayGridHeader.d.ts +15 -0
  52. package/calendar/day-grid-header/CalendarDayGridHeader.js +32 -0
  53. package/calendar/day-grid-header-cell/CalendarDayGridHeaderCell.d.ts +25 -0
  54. package/calendar/day-grid-header-cell/CalendarDayGridHeaderCell.js +41 -0
  55. package/calendar/day-grid-header-row/CalendarDayGridHeaderRow.d.ts +22 -0
  56. package/calendar/day-grid-header-row/CalendarDayGridHeaderRow.js +47 -0
  57. package/calendar/day-grid-row/CalendarDayGridRow.d.ts +26 -0
  58. package/calendar/day-grid-row/CalendarDayGridRow.js +46 -0
  59. package/calendar/decrement-month/CalendarDecrementMonth.d.ts +20 -0
  60. package/calendar/decrement-month/CalendarDecrementMonth.js +80 -0
  61. package/calendar/decrement-month/CalendarDecrementMonthDataAttributes.d.ts +6 -0
  62. package/calendar/decrement-month/CalendarDecrementMonthDataAttributes.js +13 -0
  63. package/calendar/increment-month/CalendarIncrementMonth.d.ts +20 -0
  64. package/calendar/increment-month/CalendarIncrementMonth.js +79 -0
  65. package/calendar/increment-month/CalendarIncrementMonthDataAttributes.d.ts +6 -0
  66. package/calendar/increment-month/CalendarIncrementMonthDataAttributes.js +13 -0
  67. package/calendar/index.d.ts +14 -0
  68. package/calendar/index.js +9 -0
  69. package/calendar/index.parts.d.ts +15 -0
  70. package/calendar/index.parts.js +110 -0
  71. package/calendar/root/CalendarRoot.d.ts +36 -0
  72. package/calendar/root/CalendarRoot.js +147 -0
  73. package/calendar/root/CalendarRootDataAttributes.d.ts +23 -0
  74. package/calendar/root/CalendarRootDataAttributes.js +30 -0
  75. package/calendar/root/SharedCalendarRootContext.d.ts +5 -0
  76. package/calendar/root/SharedCalendarRootContext.js +21 -0
  77. package/calendar/store/SharedCalendarState.d.ts +78 -0
  78. package/calendar/store/SharedCalendarState.js +5 -0
  79. package/calendar/store/SharedCalendarStore.d.ts +144 -0
  80. package/calendar/store/SharedCalendarStore.js +144 -0
  81. package/calendar/store/index.d.ts +3 -0
  82. package/calendar/store/index.js +38 -0
  83. package/calendar/store/selectors.d.ts +104 -0
  84. package/calendar/store/selectors.js +198 -0
  85. package/calendar/use-context/CalendarContext.d.ts +6 -0
  86. package/calendar/use-context/CalendarContext.js +20 -0
  87. package/calendar/use-day-list/getDayList.d.ts +9 -0
  88. package/calendar/use-day-list/getDayList.js +40 -0
  89. package/calendar/use-day-list/useCalendarDayList.d.ts +12 -0
  90. package/calendar/use-day-list/useCalendarDayList.js +14 -0
  91. package/calendar/use-week-list/getWeekList.d.ts +9 -0
  92. package/calendar/use-week-list/getWeekList.js +40 -0
  93. package/calendar/use-week-list/useCalendarWeekList.d.ts +17 -0
  94. package/calendar/use-week-list/useCalendarWeekList.js +14 -0
  95. package/calendar/utils/computeMonthDayGrid.d.ts +6 -0
  96. package/calendar/utils/computeMonthDayGrid.js +22 -0
  97. package/calendar/utils/useCalendarMonthButton.d.ts +31 -0
  98. package/calendar/utils/useCalendarMonthButton.js +53 -0
  99. package/calendar/viewport/CalendarViewport.d.ts +30 -0
  100. package/calendar/viewport/CalendarViewport.js +171 -0
  101. package/calendar/viewport/CalendarViewportDataAttributes.d.ts +23 -0
  102. package/calendar/viewport/CalendarViewportDataAttributes.js +31 -0
  103. package/checkbox/indicator/CheckboxIndicator.js +1 -0
  104. package/checkbox/root/CheckboxRoot.d.ts +5 -0
  105. package/checkbox/root/CheckboxRoot.js +15 -10
  106. package/checkbox-group/CheckboxGroup.js +13 -10
  107. package/collapsible/panel/CollapsiblePanel.d.ts +1 -1
  108. package/collapsible/panel/CollapsiblePanel.js +2 -1
  109. package/collapsible/panel/useCollapsiblePanel.d.ts +4 -2
  110. package/collapsible/panel/useCollapsiblePanel.js +2 -4
  111. package/collapsible/root/CollapsibleRoot.js +1 -0
  112. package/collapsible/root/useCollapsibleRoot.d.ts +4 -2
  113. package/collapsible/root/useCollapsibleRoot.js +5 -4
  114. package/collapsible/trigger/CollapsibleTrigger.js +1 -0
  115. package/combobox/arrow/ComboboxArrow.d.ts +2 -0
  116. package/combobox/arrow/ComboboxArrow.js +3 -0
  117. package/combobox/backdrop/ComboboxBackdrop.d.ts +2 -0
  118. package/combobox/backdrop/ComboboxBackdrop.js +3 -0
  119. package/combobox/chip/ComboboxChip.d.ts +2 -0
  120. package/combobox/chip/ComboboxChip.js +4 -11
  121. package/combobox/chip-remove/ComboboxChipRemove.d.ts +2 -0
  122. package/combobox/chip-remove/ComboboxChipRemove.js +6 -0
  123. package/combobox/chips/ComboboxChips.d.ts +3 -1
  124. package/combobox/chips/ComboboxChips.js +9 -1
  125. package/combobox/clear/ComboboxClear.d.ts +2 -0
  126. package/combobox/clear/ComboboxClear.js +3 -0
  127. package/combobox/collection/ComboboxCollection.d.ts +2 -0
  128. package/combobox/collection/ComboboxCollection.js +2 -0
  129. package/combobox/empty/ComboboxEmpty.d.ts +6 -0
  130. package/combobox/empty/ComboboxEmpty.js +10 -1
  131. package/combobox/group/ComboboxGroup.d.ts +2 -0
  132. package/combobox/group/ComboboxGroup.js +3 -0
  133. package/combobox/group-label/ComboboxGroupLabel.d.ts +2 -0
  134. package/combobox/group-label/ComboboxGroupLabel.js +3 -0
  135. package/combobox/icon/ComboboxIcon.d.ts +2 -0
  136. package/combobox/icon/ComboboxIcon.js +3 -0
  137. package/combobox/input/ComboboxInput.d.ts +2 -0
  138. package/combobox/input/ComboboxInput.js +11 -4
  139. package/combobox/input-group/ComboboxInputGroup.d.ts +3 -1
  140. package/combobox/input-group/ComboboxInputGroup.js +13 -4
  141. package/combobox/item/ComboboxItem.d.ts +2 -0
  142. package/combobox/item/ComboboxItem.js +8 -0
  143. package/combobox/item-indicator/ComboboxItemIndicator.d.ts +2 -0
  144. package/combobox/item-indicator/ComboboxItemIndicator.js +3 -0
  145. package/combobox/label/ComboboxLabel.js +1 -0
  146. package/combobox/list/ComboboxList.d.ts +2 -0
  147. package/combobox/list/ComboboxList.js +8 -9
  148. package/combobox/popup/ComboboxPopup.d.ts +2 -0
  149. package/combobox/popup/ComboboxPopup.js +3 -0
  150. package/combobox/portal/ComboboxPortal.d.ts +2 -0
  151. package/combobox/portal/ComboboxPortal.js +2 -0
  152. package/combobox/positioner/ComboboxPositioner.d.ts +2 -0
  153. package/combobox/positioner/ComboboxPositioner.js +15 -33
  154. package/combobox/positioner/ComboboxPositionerContext.d.ts +2 -10
  155. package/combobox/root/AriaCombobox.d.ts +5 -0
  156. package/combobox/root/AriaCombobox.js +33 -20
  157. package/combobox/root/utils/useFilter.d.ts +9 -0
  158. package/combobox/row/ComboboxRow.d.ts +2 -0
  159. package/combobox/row/ComboboxRow.js +3 -0
  160. package/combobox/status/ComboboxStatus.d.ts +6 -0
  161. package/combobox/status/ComboboxStatus.js +12 -1
  162. package/combobox/store.d.ts +2 -14
  163. package/combobox/store.js +1 -14
  164. package/combobox/trigger/ComboboxTrigger.d.ts +2 -0
  165. package/combobox/trigger/ComboboxTrigger.js +4 -1
  166. package/combobox/utils/handleInputPress.d.ts +5 -0
  167. package/combobox/utils/handleInputPress.js +28 -0
  168. package/combobox/utils/useInitialLiveRegionTextMutation.d.ts +3 -0
  169. package/combobox/utils/useInitialLiveRegionTextMutation.js +61 -0
  170. package/composite/composite.d.ts +2 -0
  171. package/composite/composite.js +3 -1
  172. package/composite/item/CompositeItem.d.ts +1 -1
  173. package/composite/item/CompositeItem.js +1 -0
  174. package/composite/root/CompositeRoot.d.ts +4 -2
  175. package/composite/root/CompositeRoot.js +3 -0
  176. package/composite/root/useCompositeRoot.d.ts +1 -0
  177. package/composite/root/useCompositeRoot.js +30 -15
  178. package/context-menu/index.d.ts +1 -1
  179. package/context-menu/root/ContextMenuRoot.d.ts +3 -1
  180. package/context-menu/root/ContextMenuRoot.js +1 -1
  181. package/context-menu/trigger/ContextMenuTrigger.js +4 -5
  182. package/dialog/backdrop/DialogBackdrop.js +1 -0
  183. package/dialog/close/DialogClose.js +1 -0
  184. package/dialog/description/DialogDescription.js +1 -0
  185. package/dialog/popup/DialogPopup.js +1 -0
  186. package/dialog/root/DialogRoot.d.ts +3 -2
  187. package/dialog/root/DialogRoot.js +24 -18
  188. package/dialog/root/useDialogRoot.d.ts +1 -0
  189. package/dialog/root/useDialogRoot.js +13 -9
  190. package/dialog/store/DialogStore.d.ts +4 -1
  191. package/dialog/store/DialogStore.js +11 -7
  192. package/dialog/title/DialogTitle.js +1 -0
  193. package/dialog/trigger/DialogTrigger.js +1 -0
  194. package/dialog/viewport/DialogViewport.js +1 -0
  195. package/drawer/backdrop/DrawerBackdrop.js +1 -0
  196. package/drawer/content/DrawerContent.js +1 -0
  197. package/drawer/indent/DrawerIndent.js +1 -0
  198. package/drawer/indent-background/DrawerIndentBackground.js +1 -0
  199. package/drawer/popup/DrawerPopup.js +17 -3
  200. package/drawer/root/DrawerRoot.d.ts +1 -1
  201. package/drawer/root/DrawerRoot.js +19 -14
  202. package/drawer/root/DrawerRootContext.d.ts +4 -4
  203. package/drawer/swipe-area/DrawerSwipeArea.js +17 -12
  204. package/drawer/viewport/DrawerViewport.js +34 -22
  205. package/esm/accordion/header/AccordionHeader.js +1 -0
  206. package/esm/accordion/item/AccordionItem.js +1 -0
  207. package/esm/accordion/panel/AccordionPanel.js +2 -1
  208. package/esm/accordion/root/AccordionRoot.d.ts +1 -1
  209. package/esm/accordion/root/AccordionRoot.js +1 -0
  210. package/esm/accordion/trigger/AccordionTrigger.js +2 -1
  211. package/esm/alert-dialog/index.d.ts +9 -1
  212. package/esm/alert-dialog/root/AlertDialogRoot.d.ts +1 -1
  213. package/esm/alert-dialog/root/AlertDialogRoot.js +22 -20
  214. package/esm/autocomplete/clear/AutocompleteClearDataAttributes.d.ts +1 -0
  215. package/esm/autocomplete/clear/AutocompleteClearDataAttributes.js +1 -0
  216. package/esm/autocomplete/index.d.ts +8 -5
  217. package/esm/autocomplete/index.parts.d.ts +3 -3
  218. package/esm/autocomplete/index.parts.js +3 -3
  219. package/esm/autocomplete/input-group/AutocompleteInputGroup.d.ts +41 -0
  220. package/esm/autocomplete/input-group/AutocompleteInputGroup.js +10 -0
  221. package/esm/autocomplete/input-group/AutocompleteInputGroupDataAttributes.d.ts +51 -0
  222. package/esm/autocomplete/input-group/AutocompleteInputGroupDataAttributes.js +52 -0
  223. package/esm/autocomplete/item/AutocompleteItem.d.ts +48 -0
  224. package/esm/autocomplete/item/AutocompleteItem.js +10 -0
  225. package/esm/autocomplete/item/AutocompleteItemDataAttributes.d.ts +10 -0
  226. package/esm/autocomplete/item/AutocompleteItemDataAttributes.js +12 -0
  227. package/esm/autocomplete/trigger/AutocompleteTrigger.d.ts +43 -0
  228. package/esm/autocomplete/trigger/AutocompleteTrigger.js +10 -0
  229. package/esm/autocomplete/trigger/AutocompleteTriggerDataAttributes.d.ts +55 -0
  230. package/esm/autocomplete/trigger/AutocompleteTriggerDataAttributes.js +57 -0
  231. package/esm/avatar/fallback/AvatarFallback.js +1 -0
  232. package/esm/avatar/image/AvatarImage.js +1 -0
  233. package/esm/avatar/image/useImageLoadingStatus.js +5 -0
  234. package/esm/avatar/root/AvatarRoot.js +1 -0
  235. package/esm/button/Button.js +1 -0
  236. package/esm/calendar/day-button/CalendarDayButton.d.ts +47 -0
  237. package/esm/calendar/day-button/CalendarDayButton.js +124 -0
  238. package/esm/calendar/day-button/CalendarDayButtonDataAttributes.d.ts +22 -0
  239. package/esm/calendar/day-button/CalendarDayButtonDataAttributes.js +23 -0
  240. package/esm/calendar/day-grid/CalendarDayGrid.d.ts +15 -0
  241. package/esm/calendar/day-grid/CalendarDayGrid.js +27 -0
  242. package/esm/calendar/day-grid-body/CalendarDayGridBody.d.ts +16 -0
  243. package/esm/calendar/day-grid-body/CalendarDayGridBody.js +48 -0
  244. package/esm/calendar/day-grid-body/SharedCalendarDayGridBodyContext.d.ts +14 -0
  245. package/esm/calendar/day-grid-body/SharedCalendarDayGridBodyContext.js +13 -0
  246. package/esm/calendar/day-grid-body/useSharedCalendarDayGridBody.d.ts +45 -0
  247. package/esm/calendar/day-grid-body/useSharedCalendarDayGridBody.js +279 -0
  248. package/esm/calendar/day-grid-cell/CalendarDayGridCell.d.ts +16 -0
  249. package/esm/calendar/day-grid-cell/CalendarDayGridCell.js +40 -0
  250. package/esm/calendar/day-grid-cell/SharedCalendarDayGridCellContext.d.ts +22 -0
  251. package/esm/calendar/day-grid-cell/SharedCalendarDayGridCellContext.js +13 -0
  252. package/esm/calendar/day-grid-cell/useSharedCalendarDayGridCell.d.ts +17 -0
  253. package/esm/calendar/day-grid-cell/useSharedCalendarDayGridCell.js +33 -0
  254. package/esm/calendar/day-grid-header/CalendarDayGridHeader.d.ts +15 -0
  255. package/esm/calendar/day-grid-header/CalendarDayGridHeader.js +27 -0
  256. package/esm/calendar/day-grid-header-cell/CalendarDayGridHeaderCell.d.ts +25 -0
  257. package/esm/calendar/day-grid-header-cell/CalendarDayGridHeaderCell.js +35 -0
  258. package/esm/calendar/day-grid-header-row/CalendarDayGridHeaderRow.d.ts +22 -0
  259. package/esm/calendar/day-grid-header-row/CalendarDayGridHeaderRow.js +42 -0
  260. package/esm/calendar/day-grid-row/CalendarDayGridRow.d.ts +26 -0
  261. package/esm/calendar/day-grid-row/CalendarDayGridRow.js +41 -0
  262. package/esm/calendar/decrement-month/CalendarDecrementMonth.d.ts +20 -0
  263. package/esm/calendar/decrement-month/CalendarDecrementMonth.js +75 -0
  264. package/esm/calendar/decrement-month/CalendarDecrementMonthDataAttributes.d.ts +6 -0
  265. package/esm/calendar/decrement-month/CalendarDecrementMonthDataAttributes.js +7 -0
  266. package/esm/calendar/increment-month/CalendarIncrementMonth.d.ts +20 -0
  267. package/esm/calendar/increment-month/CalendarIncrementMonth.js +74 -0
  268. package/esm/calendar/increment-month/CalendarIncrementMonthDataAttributes.d.ts +6 -0
  269. package/esm/calendar/increment-month/CalendarIncrementMonthDataAttributes.js +7 -0
  270. package/esm/calendar/index.d.ts +14 -0
  271. package/esm/calendar/index.js +1 -0
  272. package/esm/calendar/index.parts.d.ts +15 -0
  273. package/esm/calendar/index.parts.js +21 -0
  274. package/esm/calendar/root/CalendarRoot.d.ts +36 -0
  275. package/esm/calendar/root/CalendarRoot.js +141 -0
  276. package/esm/calendar/root/CalendarRootDataAttributes.d.ts +23 -0
  277. package/esm/calendar/root/CalendarRootDataAttributes.js +24 -0
  278. package/esm/calendar/root/SharedCalendarRootContext.d.ts +5 -0
  279. package/esm/calendar/root/SharedCalendarRootContext.js +13 -0
  280. package/esm/calendar/store/SharedCalendarState.d.ts +78 -0
  281. package/esm/calendar/store/SharedCalendarState.js +1 -0
  282. package/esm/calendar/store/SharedCalendarStore.d.ts +144 -0
  283. package/esm/calendar/store/SharedCalendarStore.js +137 -0
  284. package/esm/calendar/store/index.d.ts +3 -0
  285. package/esm/calendar/store/index.js +3 -0
  286. package/esm/calendar/store/selectors.d.ts +104 -0
  287. package/esm/calendar/store/selectors.js +192 -0
  288. package/esm/calendar/use-context/CalendarContext.d.ts +6 -0
  289. package/esm/calendar/use-context/CalendarContext.js +14 -0
  290. package/esm/calendar/use-day-list/getDayList.d.ts +9 -0
  291. package/esm/calendar/use-day-list/getDayList.js +34 -0
  292. package/esm/calendar/use-day-list/useCalendarDayList.d.ts +12 -0
  293. package/esm/calendar/use-day-list/useCalendarDayList.js +7 -0
  294. package/esm/calendar/use-week-list/getWeekList.d.ts +9 -0
  295. package/esm/calendar/use-week-list/getWeekList.js +34 -0
  296. package/esm/calendar/use-week-list/useCalendarWeekList.d.ts +17 -0
  297. package/esm/calendar/use-week-list/useCalendarWeekList.js +7 -0
  298. package/esm/calendar/utils/computeMonthDayGrid.d.ts +6 -0
  299. package/esm/calendar/utils/computeMonthDayGrid.js +17 -0
  300. package/esm/calendar/utils/useCalendarMonthButton.d.ts +31 -0
  301. package/esm/calendar/utils/useCalendarMonthButton.js +47 -0
  302. package/esm/calendar/viewport/CalendarViewport.d.ts +30 -0
  303. package/esm/calendar/viewport/CalendarViewport.js +165 -0
  304. package/esm/calendar/viewport/CalendarViewportDataAttributes.d.ts +23 -0
  305. package/esm/calendar/viewport/CalendarViewportDataAttributes.js +25 -0
  306. package/esm/checkbox/indicator/CheckboxIndicator.js +1 -0
  307. package/esm/checkbox/root/CheckboxRoot.d.ts +5 -0
  308. package/esm/checkbox/root/CheckboxRoot.js +15 -10
  309. package/esm/checkbox-group/CheckboxGroup.js +13 -10
  310. package/esm/collapsible/panel/CollapsiblePanel.d.ts +1 -1
  311. package/esm/collapsible/panel/CollapsiblePanel.js +2 -1
  312. package/esm/collapsible/panel/useCollapsiblePanel.d.ts +4 -2
  313. package/esm/collapsible/panel/useCollapsiblePanel.js +2 -4
  314. package/esm/collapsible/root/CollapsibleRoot.js +1 -0
  315. package/esm/collapsible/root/useCollapsibleRoot.d.ts +4 -2
  316. package/esm/collapsible/root/useCollapsibleRoot.js +5 -4
  317. package/esm/collapsible/trigger/CollapsibleTrigger.js +1 -0
  318. package/esm/combobox/arrow/ComboboxArrow.d.ts +2 -0
  319. package/esm/combobox/arrow/ComboboxArrow.js +3 -0
  320. package/esm/combobox/backdrop/ComboboxBackdrop.d.ts +2 -0
  321. package/esm/combobox/backdrop/ComboboxBackdrop.js +3 -0
  322. package/esm/combobox/chip/ComboboxChip.d.ts +2 -0
  323. package/esm/combobox/chip/ComboboxChip.js +4 -11
  324. package/esm/combobox/chip-remove/ComboboxChipRemove.d.ts +2 -0
  325. package/esm/combobox/chip-remove/ComboboxChipRemove.js +6 -0
  326. package/esm/combobox/chips/ComboboxChips.d.ts +3 -1
  327. package/esm/combobox/chips/ComboboxChips.js +9 -1
  328. package/esm/combobox/clear/ComboboxClear.d.ts +2 -0
  329. package/esm/combobox/clear/ComboboxClear.js +3 -0
  330. package/esm/combobox/collection/ComboboxCollection.d.ts +2 -0
  331. package/esm/combobox/collection/ComboboxCollection.js +2 -0
  332. package/esm/combobox/empty/ComboboxEmpty.d.ts +6 -0
  333. package/esm/combobox/empty/ComboboxEmpty.js +10 -1
  334. package/esm/combobox/group/ComboboxGroup.d.ts +2 -0
  335. package/esm/combobox/group/ComboboxGroup.js +3 -0
  336. package/esm/combobox/group-label/ComboboxGroupLabel.d.ts +2 -0
  337. package/esm/combobox/group-label/ComboboxGroupLabel.js +3 -0
  338. package/esm/combobox/icon/ComboboxIcon.d.ts +2 -0
  339. package/esm/combobox/icon/ComboboxIcon.js +3 -0
  340. package/esm/combobox/input/ComboboxInput.d.ts +2 -0
  341. package/esm/combobox/input/ComboboxInput.js +11 -4
  342. package/esm/combobox/input-group/ComboboxInputGroup.d.ts +3 -1
  343. package/esm/combobox/input-group/ComboboxInputGroup.js +13 -4
  344. package/esm/combobox/item/ComboboxItem.d.ts +2 -0
  345. package/esm/combobox/item/ComboboxItem.js +8 -0
  346. package/esm/combobox/item-indicator/ComboboxItemIndicator.d.ts +2 -0
  347. package/esm/combobox/item-indicator/ComboboxItemIndicator.js +3 -0
  348. package/esm/combobox/label/ComboboxLabel.js +1 -0
  349. package/esm/combobox/list/ComboboxList.d.ts +2 -0
  350. package/esm/combobox/list/ComboboxList.js +8 -9
  351. package/esm/combobox/popup/ComboboxPopup.d.ts +2 -0
  352. package/esm/combobox/popup/ComboboxPopup.js +3 -0
  353. package/esm/combobox/portal/ComboboxPortal.d.ts +2 -0
  354. package/esm/combobox/portal/ComboboxPortal.js +2 -0
  355. package/esm/combobox/positioner/ComboboxPositioner.d.ts +2 -0
  356. package/esm/combobox/positioner/ComboboxPositioner.js +15 -33
  357. package/esm/combobox/positioner/ComboboxPositionerContext.d.ts +2 -10
  358. package/esm/combobox/root/AriaCombobox.d.ts +5 -0
  359. package/esm/combobox/root/AriaCombobox.js +33 -20
  360. package/esm/combobox/root/utils/useFilter.d.ts +9 -0
  361. package/esm/combobox/row/ComboboxRow.d.ts +2 -0
  362. package/esm/combobox/row/ComboboxRow.js +3 -0
  363. package/esm/combobox/status/ComboboxStatus.d.ts +6 -0
  364. package/esm/combobox/status/ComboboxStatus.js +12 -1
  365. package/esm/combobox/store.d.ts +2 -14
  366. package/esm/combobox/store.js +1 -14
  367. package/esm/combobox/trigger/ComboboxTrigger.d.ts +2 -0
  368. package/esm/combobox/trigger/ComboboxTrigger.js +4 -1
  369. package/esm/combobox/utils/handleInputPress.d.ts +5 -0
  370. package/esm/combobox/utils/handleInputPress.js +22 -0
  371. package/esm/combobox/utils/useInitialLiveRegionTextMutation.d.ts +3 -0
  372. package/esm/combobox/utils/useInitialLiveRegionTextMutation.js +55 -0
  373. package/esm/composite/composite.d.ts +2 -0
  374. package/esm/composite/composite.js +2 -0
  375. package/esm/composite/item/CompositeItem.d.ts +1 -1
  376. package/esm/composite/item/CompositeItem.js +1 -0
  377. package/esm/composite/root/CompositeRoot.d.ts +4 -2
  378. package/esm/composite/root/CompositeRoot.js +3 -0
  379. package/esm/composite/root/useCompositeRoot.d.ts +1 -0
  380. package/esm/composite/root/useCompositeRoot.js +30 -15
  381. package/esm/context-menu/index.d.ts +1 -1
  382. package/esm/context-menu/root/ContextMenuRoot.d.ts +3 -1
  383. package/esm/context-menu/root/ContextMenuRoot.js +1 -1
  384. package/esm/context-menu/trigger/ContextMenuTrigger.js +4 -5
  385. package/esm/dialog/backdrop/DialogBackdrop.js +1 -0
  386. package/esm/dialog/close/DialogClose.js +1 -0
  387. package/esm/dialog/description/DialogDescription.js +1 -0
  388. package/esm/dialog/popup/DialogPopup.js +1 -0
  389. package/esm/dialog/root/DialogRoot.d.ts +3 -2
  390. package/esm/dialog/root/DialogRoot.js +23 -18
  391. package/esm/dialog/root/useDialogRoot.d.ts +1 -0
  392. package/esm/dialog/root/useDialogRoot.js +13 -9
  393. package/esm/dialog/store/DialogStore.d.ts +4 -1
  394. package/esm/dialog/store/DialogStore.js +11 -7
  395. package/esm/dialog/title/DialogTitle.js +1 -0
  396. package/esm/dialog/trigger/DialogTrigger.js +1 -0
  397. package/esm/dialog/viewport/DialogViewport.js +1 -0
  398. package/esm/drawer/backdrop/DrawerBackdrop.js +1 -0
  399. package/esm/drawer/content/DrawerContent.js +1 -0
  400. package/esm/drawer/indent/DrawerIndent.js +1 -0
  401. package/esm/drawer/indent-background/DrawerIndentBackground.js +1 -0
  402. package/esm/drawer/popup/DrawerPopup.js +17 -3
  403. package/esm/drawer/root/DrawerRoot.d.ts +1 -1
  404. package/esm/drawer/root/DrawerRoot.js +19 -14
  405. package/esm/drawer/root/DrawerRootContext.d.ts +4 -4
  406. package/esm/drawer/swipe-area/DrawerSwipeArea.js +17 -12
  407. package/esm/drawer/viewport/DrawerViewport.js +35 -23
  408. package/esm/field/control/FieldControl.js +6 -6
  409. package/esm/field/description/FieldDescription.js +1 -0
  410. package/esm/field/error/FieldError.d.ts +1 -1
  411. package/esm/field/error/FieldError.js +8 -5
  412. package/esm/field/item/FieldItem.js +1 -0
  413. package/esm/field/label/FieldLabel.d.ts +1 -1
  414. package/esm/field/label/FieldLabel.js +1 -0
  415. package/esm/field/root/FieldRoot.js +12 -1
  416. package/esm/field/root/FieldRootContext.d.ts +2 -0
  417. package/esm/field/root/FieldRootContext.js +1 -0
  418. package/esm/field/root/useFieldControlRegistration.d.ts +17 -0
  419. package/esm/field/root/useFieldControlRegistration.js +125 -0
  420. package/esm/field/root/useRegisterFieldControl.d.ts +5 -0
  421. package/esm/field/root/useRegisterFieldControl.js +35 -0
  422. package/esm/field/validity/FieldValidity.d.ts +1 -1
  423. package/esm/field/validity/FieldValidity.js +1 -1
  424. package/esm/fieldset/legend/FieldsetLegend.js +1 -0
  425. package/esm/fieldset/root/FieldsetRoot.js +1 -0
  426. package/esm/floating-ui-react/components/FloatingFocusManager.js +47 -79
  427. package/esm/floating-ui-react/components/FloatingPortal.js +17 -11
  428. package/esm/floating-ui-react/components/FloatingRootStore.d.ts +18 -2
  429. package/esm/floating-ui-react/components/FloatingRootStore.js +34 -17
  430. package/esm/floating-ui-react/hooks/useClick.js +5 -3
  431. package/esm/floating-ui-react/hooks/useClientPoint.js +6 -5
  432. package/esm/floating-ui-react/hooks/useDismiss.js +26 -63
  433. package/esm/floating-ui-react/hooks/useFloating.js +4 -3
  434. package/esm/floating-ui-react/hooks/useFloatingRootContext.js +3 -3
  435. package/esm/floating-ui-react/hooks/useFocus.js +5 -14
  436. package/esm/floating-ui-react/hooks/useHover.d.ts +1 -1
  437. package/esm/floating-ui-react/hooks/useHover.js +8 -46
  438. package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +5 -0
  439. package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js +15 -15
  440. package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +3 -3
  441. package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js +15 -8
  442. package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +1 -0
  443. package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +64 -26
  444. package/esm/floating-ui-react/hooks/useHoverShared.js +1 -1
  445. package/esm/floating-ui-react/hooks/useListNavigation.d.ts +4 -4
  446. package/esm/floating-ui-react/hooks/useListNavigation.js +32 -28
  447. package/esm/floating-ui-react/hooks/useRole.js +1 -1
  448. package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.d.ts +0 -4
  449. package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js +3 -4
  450. package/esm/floating-ui-react/hooks/useTypeahead.js +3 -1
  451. package/esm/floating-ui-react/safePolygon.js +1 -0
  452. package/esm/floating-ui-react/utils/composite.d.ts +6 -4
  453. package/esm/floating-ui-react/utils/composite.js +55 -24
  454. package/esm/floating-ui-react/utils/element.d.ts +3 -3
  455. package/esm/floating-ui-react/utils/element.js +6 -42
  456. package/esm/floating-ui-react/utils/enqueueFocus.d.ts +3 -2
  457. package/esm/floating-ui-react/utils/enqueueFocus.js +10 -2
  458. package/esm/floating-ui-react/utils/getEmptyRootContext.js +2 -1
  459. package/esm/floating-ui-react/utils/nodes.js +2 -2
  460. package/esm/floating-ui-react/utils/shadowDom.d.ts +3 -0
  461. package/esm/floating-ui-react/utils/shadowDom.js +40 -0
  462. package/esm/floating-ui-react/utils/tabbable.d.ts +4 -5
  463. package/esm/floating-ui-react/utils/tabbable.js +126 -13
  464. package/esm/form/Form.js +1 -0
  465. package/esm/index.d.ts +1 -0
  466. package/esm/index.js +6 -1
  467. package/esm/input/Input.d.ts +1 -1
  468. package/esm/labelable-provider/useLabel.js +0 -1
  469. package/esm/localization-provider/LocalizationContext.d.ts +10 -0
  470. package/esm/localization-provider/LocalizationContext.js +16 -0
  471. package/esm/localization-provider/LocalizationProvider.d.ts +20 -0
  472. package/esm/localization-provider/LocalizationProvider.js +37 -0
  473. package/esm/localization-provider/index.d.ts +2 -0
  474. package/esm/localization-provider/index.js +2 -0
  475. package/esm/menu/arrow/MenuArrow.js +1 -0
  476. package/esm/menu/backdrop/MenuBackdrop.js +1 -0
  477. package/esm/menu/checkbox-item/MenuCheckboxItem.js +2 -1
  478. package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +1 -0
  479. package/esm/menu/group/MenuGroup.js +1 -0
  480. package/esm/menu/group-label/MenuGroupLabel.js +1 -0
  481. package/esm/menu/item/MenuItem.js +2 -1
  482. package/esm/menu/item/useMenuItem.d.ts +1 -1
  483. package/esm/menu/link-item/MenuLinkItem.js +2 -1
  484. package/esm/menu/popup/MenuPopup.js +1 -0
  485. package/esm/menu/positioner/MenuPositioner.js +15 -31
  486. package/esm/menu/positioner/MenuPositionerContext.d.ts +2 -15
  487. package/esm/menu/radio-group/MenuRadioGroup.js +1 -0
  488. package/esm/menu/radio-item/MenuRadioItem.js +2 -1
  489. package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js +1 -0
  490. package/esm/menu/root/MenuRoot.d.ts +2 -2
  491. package/esm/menu/root/MenuRoot.js +8 -17
  492. package/esm/menu/store/MenuStore.d.ts +3 -0
  493. package/esm/menu/store/MenuStore.js +2 -0
  494. package/esm/menu/submenu-root/MenuSubmenuRoot.d.ts +1 -1
  495. package/esm/menu/submenu-root/MenuSubmenuRoot.js +1 -1
  496. package/esm/menu/submenu-trigger/MenuSubmenuTrigger.js +18 -2
  497. package/esm/menu/trigger/MenuTrigger.js +11 -31
  498. package/esm/menu/viewport/MenuViewport.js +1 -0
  499. package/esm/menubar/Menubar.js +7 -11
  500. package/esm/menubar/MenubarDataAttributes.d.ts +6 -3
  501. package/esm/menubar/MenubarDataAttributes.js +9 -6
  502. package/esm/merge-props/mergeProps.d.ts +1 -1
  503. package/esm/merge-props/mergeProps.js +53 -18
  504. package/esm/meter/indicator/MeterIndicator.js +1 -0
  505. package/esm/meter/label/MeterLabel.js +1 -0
  506. package/esm/meter/root/MeterRoot.js +1 -0
  507. package/esm/meter/track/MeterTrack.js +1 -0
  508. package/esm/meter/value/MeterValue.js +1 -0
  509. package/esm/navigation-menu/arrow/NavigationMenuArrow.js +1 -0
  510. package/esm/navigation-menu/backdrop/NavigationMenuBackdrop.js +1 -0
  511. package/esm/navigation-menu/content/NavigationMenuContent.js +3 -0
  512. package/esm/navigation-menu/icon/NavigationMenuIcon.js +1 -0
  513. package/esm/navigation-menu/item/NavigationMenuItem.js +1 -0
  514. package/esm/navigation-menu/link/NavigationMenuLink.js +2 -0
  515. package/esm/navigation-menu/list/NavigationMenuList.js +10 -6
  516. package/esm/navigation-menu/popup/NavigationMenuPopup.js +1 -0
  517. package/esm/navigation-menu/positioner/NavigationMenuPositioner.js +13 -32
  518. package/esm/navigation-menu/root/NavigationMenuRoot.d.ts +9 -6
  519. package/esm/navigation-menu/root/NavigationMenuRoot.js +8 -0
  520. package/esm/navigation-menu/root/NavigationMenuRootContext.d.ts +11 -6
  521. package/esm/navigation-menu/trigger/NavigationMenuTrigger.js +66 -31
  522. package/esm/navigation-menu/viewport/NavigationMenuViewport.js +1 -0
  523. package/esm/number-field/decrement/NumberFieldDecrement.js +1 -10
  524. package/esm/number-field/group/NumberFieldGroup.js +1 -0
  525. package/esm/number-field/increment/NumberFieldIncrement.js +1 -10
  526. package/esm/number-field/input/NumberFieldInput.js +6 -10
  527. package/esm/number-field/root/NumberFieldRoot.d.ts +6 -1
  528. package/esm/number-field/root/NumberFieldRoot.js +13 -78
  529. package/esm/number-field/root/NumberFieldRootContext.d.ts +0 -6
  530. package/esm/number-field/root/useNumberFieldButton.d.ts +0 -6
  531. package/esm/number-field/root/useNumberFieldButton.js +34 -101
  532. package/esm/number-field/scrub-area/NumberFieldScrubArea.js +8 -9
  533. package/esm/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.js +1 -0
  534. package/esm/number-field/utils/constants.d.ts +0 -2
  535. package/esm/number-field/utils/constants.js +0 -2
  536. package/esm/number-field/utils/subscribeToVisualViewportResize.js +2 -4
  537. package/esm/otp-field/index.d.ts +3 -0
  538. package/esm/otp-field/index.js +1 -0
  539. package/esm/otp-field/index.parts.d.ts +3 -0
  540. package/esm/otp-field/index.parts.js +3 -0
  541. package/esm/otp-field/input/OTPFieldInput.d.ts +29 -0
  542. package/esm/otp-field/input/OTPFieldInput.js +237 -0
  543. package/esm/otp-field/input/OTPFieldInputDataAttributes.d.ts +42 -0
  544. package/esm/otp-field/input/OTPFieldInputDataAttributes.js +43 -0
  545. package/esm/otp-field/root/OTPFieldRoot.d.ts +159 -0
  546. package/esm/otp-field/root/OTPFieldRoot.js +408 -0
  547. package/esm/otp-field/root/OTPFieldRootContext.d.ts +31 -0
  548. package/esm/otp-field/root/OTPFieldRootContext.js +21 -0
  549. package/esm/otp-field/root/OTPFieldRootDataAttributes.d.ts +42 -0
  550. package/esm/otp-field/root/OTPFieldRootDataAttributes.js +43 -0
  551. package/esm/otp-field/utils/otp.d.ts +21 -0
  552. package/esm/otp-field/utils/otp.js +66 -0
  553. package/esm/otp-field/utils/stateAttributesMapping.d.ts +5 -0
  554. package/esm/otp-field/utils/stateAttributesMapping.js +11 -0
  555. package/esm/popover/arrow/PopoverArrow.js +1 -0
  556. package/esm/popover/backdrop/PopoverBackdrop.js +1 -0
  557. package/esm/popover/close/PopoverClose.js +1 -0
  558. package/esm/popover/description/PopoverDescription.js +1 -0
  559. package/esm/popover/popup/PopoverPopup.js +2 -0
  560. package/esm/popover/positioner/PopoverPositioner.js +16 -30
  561. package/esm/popover/root/PopoverRoot.d.ts +2 -2
  562. package/esm/popover/root/PopoverRoot.js +1 -5
  563. package/esm/popover/store/PopoverStore.d.ts +2 -0
  564. package/esm/popover/store/PopoverStore.js +3 -9
  565. package/esm/popover/title/PopoverTitle.js +1 -0
  566. package/esm/popover/trigger/PopoverTrigger.js +11 -33
  567. package/esm/popover/viewport/PopoverViewport.js +1 -0
  568. package/esm/preview-card/arrow/PreviewCardArrow.js +1 -0
  569. package/esm/preview-card/backdrop/PreviewCardBackdrop.js +1 -0
  570. package/esm/preview-card/index.d.ts +1 -0
  571. package/esm/preview-card/popup/PreviewCardPopup.js +1 -0
  572. package/esm/preview-card/positioner/PreviewCardPositioner.js +10 -30
  573. package/esm/preview-card/positioner/PreviewCardPositionerContext.d.ts +2 -8
  574. package/esm/preview-card/root/PreviewCardRoot.d.ts +2 -2
  575. package/esm/preview-card/root/PreviewCardRoot.js +2 -2
  576. package/esm/preview-card/store/PreviewCardStore.js +1 -0
  577. package/esm/preview-card/trigger/PreviewCardTrigger.js +3 -1
  578. package/esm/preview-card/viewport/PreviewCardViewport.js +1 -0
  579. package/esm/progress/indicator/ProgressIndicator.js +1 -0
  580. package/esm/progress/indicator/ProgressIndicatorDataAttributes.d.ts +1 -1
  581. package/esm/progress/indicator/ProgressIndicatorDataAttributes.js +1 -1
  582. package/esm/progress/label/ProgressLabel.js +1 -0
  583. package/esm/progress/label/ProgressLabelDataAttributes.d.ts +1 -1
  584. package/esm/progress/label/ProgressLabelDataAttributes.js +1 -1
  585. package/esm/progress/root/ProgressRoot.js +1 -0
  586. package/esm/progress/root/ProgressRootDataAttributes.d.ts +1 -1
  587. package/esm/progress/root/ProgressRootDataAttributes.js +1 -1
  588. package/esm/progress/track/ProgressTrack.js +1 -0
  589. package/esm/progress/track/ProgressTrackDataAttributes.d.ts +1 -1
  590. package/esm/progress/track/ProgressTrackDataAttributes.js +1 -1
  591. package/esm/progress/value/ProgressValue.js +1 -0
  592. package/esm/progress/value/ProgressValueDataAttributes.d.ts +1 -1
  593. package/esm/progress/value/ProgressValueDataAttributes.js +1 -1
  594. package/esm/radio/indicator/RadioIndicator.js +1 -0
  595. package/esm/radio/root/RadioRoot.js +7 -1
  596. package/esm/radio-group/RadioGroup.d.ts +5 -0
  597. package/esm/radio-group/RadioGroup.js +9 -7
  598. package/esm/radio-group/RadioGroupContext.d.ts +1 -0
  599. package/esm/scroll-area/content/ScrollAreaContent.js +1 -0
  600. package/esm/scroll-area/corner/ScrollAreaCorner.js +1 -0
  601. package/esm/scroll-area/root/ScrollAreaRoot.js +1 -0
  602. package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +1 -1
  603. package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js +9 -6
  604. package/esm/scroll-area/thumb/ScrollAreaThumb.js +1 -0
  605. package/esm/scroll-area/viewport/ScrollAreaViewport.js +5 -13
  606. package/esm/select/arrow/SelectArrow.js +1 -0
  607. package/esm/select/backdrop/SelectBackdrop.js +1 -0
  608. package/esm/select/group/SelectGroup.js +1 -0
  609. package/esm/select/group-label/SelectGroupLabel.js +1 -0
  610. package/esm/select/icon/SelectIcon.js +1 -0
  611. package/esm/select/item/SelectItem.js +9 -34
  612. package/esm/select/item-indicator/SelectItemIndicator.js +1 -0
  613. package/esm/select/item-text/SelectItemText.js +1 -0
  614. package/esm/select/label/SelectLabel.js +1 -0
  615. package/esm/select/list/SelectList.js +1 -0
  616. package/esm/select/popup/SelectPopup.js +140 -168
  617. package/esm/select/positioner/SelectPositioner.js +11 -24
  618. package/esm/select/root/SelectRoot.d.ts +7 -2
  619. package/esm/select/root/SelectRoot.js +37 -24
  620. package/esm/select/scroll-arrow/SelectScrollArrow.js +47 -63
  621. package/esm/select/trigger/SelectTrigger.js +1 -0
  622. package/esm/select/value/SelectValue.js +1 -0
  623. package/esm/separator/Separator.js +1 -0
  624. package/esm/separator/SeparatorDataAttributes.d.ts +7 -0
  625. package/esm/separator/SeparatorDataAttributes.js +8 -0
  626. package/esm/slider/control/SliderControl.js +17 -8
  627. package/esm/slider/indicator/SliderIndicator.js +6 -6
  628. package/esm/slider/label/SliderLabel.js +1 -0
  629. package/esm/slider/root/SliderRoot.d.ts +6 -1
  630. package/esm/slider/root/SliderRoot.js +9 -10
  631. package/esm/slider/root/SliderRootContext.d.ts +1 -0
  632. package/esm/slider/thumb/SliderThumb.js +64 -22
  633. package/esm/slider/track/SliderTrack.js +1 -0
  634. package/esm/slider/utils/roundValueToStep.d.ts +1 -0
  635. package/esm/slider/utils/roundValueToStep.js +6 -2
  636. package/esm/slider/value/SliderValue.js +1 -0
  637. package/esm/switch/root/SwitchRoot.d.ts +5 -0
  638. package/esm/switch/root/SwitchRoot.js +15 -10
  639. package/esm/switch/thumb/SwitchThumb.js +1 -0
  640. package/esm/tabs/indicator/TabsIndicator.d.ts +1 -1
  641. package/esm/tabs/indicator/TabsIndicator.js +4 -4
  642. package/esm/tabs/list/TabsList.js +3 -85
  643. package/esm/tabs/panel/TabsPanel.js +1 -0
  644. package/esm/tabs/root/TabsRoot.js +115 -22
  645. package/esm/tabs/tab/TabsTab.js +1 -0
  646. package/esm/temporal-adapter-date-fns/TemporalAdapterDateFns.d.ts +93 -0
  647. package/esm/temporal-adapter-date-fns/TemporalAdapterDateFns.js +352 -0
  648. package/esm/temporal-adapter-date-fns/index.d.ts +1 -0
  649. package/esm/temporal-adapter-date-fns/index.js +1 -0
  650. package/esm/temporal-adapter-luxon/TemporalAdapterLuxon.d.ts +89 -0
  651. package/esm/temporal-adapter-luxon/TemporalAdapterLuxon.js +327 -0
  652. package/esm/temporal-adapter-luxon/index.d.ts +1 -0
  653. package/esm/temporal-adapter-luxon/index.js +1 -0
  654. package/esm/temporal-adapter-provider/TemporalAdapterContext.d.ts +10 -0
  655. package/esm/temporal-adapter-provider/TemporalAdapterContext.js +19 -0
  656. package/esm/temporal-adapter-provider/TemporalAdapterProvider.d.ts +15 -0
  657. package/esm/temporal-adapter-provider/TemporalAdapterProvider.js +23 -0
  658. package/esm/temporal-adapter-provider/index.d.ts +1 -0
  659. package/esm/temporal-adapter-provider/index.js +1 -0
  660. package/esm/toast/action/ToastAction.js +1 -0
  661. package/esm/toast/arrow/ToastArrow.js +1 -0
  662. package/esm/toast/close/ToastClose.js +1 -0
  663. package/esm/toast/content/ToastContent.js +1 -0
  664. package/esm/toast/description/ToastDescription.js +1 -0
  665. package/esm/toast/positioner/ToastPositioner.js +11 -26
  666. package/esm/toast/positioner/ToastPositionerContext.d.ts +2 -8
  667. package/esm/toast/root/ToastRoot.js +20 -7
  668. package/esm/toast/root/ToastRootDataAttributes.js +4 -3
  669. package/esm/toast/store.d.ts +9 -2
  670. package/esm/toast/store.js +37 -12
  671. package/esm/toast/title/ToastTitle.js +1 -0
  672. package/esm/toast/useToastManager.d.ts +10 -2
  673. package/esm/toast/viewport/ToastViewport.js +36 -26
  674. package/esm/toggle/Toggle.js +2 -0
  675. package/esm/toggle-group/ToggleGroup.js +4 -1
  676. package/esm/toolbar/button/ToolbarButton.d.ts +1 -1
  677. package/esm/toolbar/button/ToolbarButton.js +2 -0
  678. package/esm/toolbar/group/ToolbarGroup.js +1 -0
  679. package/esm/toolbar/input/ToolbarInput.d.ts +1 -1
  680. package/esm/toolbar/input/ToolbarInput.js +2 -0
  681. package/esm/toolbar/link/ToolbarLink.js +2 -0
  682. package/esm/toolbar/root/ToolbarRoot.js +2 -0
  683. package/esm/tooltip/arrow/TooltipArrow.js +2 -1
  684. package/esm/tooltip/index.d.ts +1 -0
  685. package/esm/tooltip/popup/TooltipPopup.js +1 -0
  686. package/esm/tooltip/positioner/TooltipPositioner.js +10 -29
  687. package/esm/tooltip/positioner/TooltipPositionerContext.d.ts +2 -9
  688. package/esm/tooltip/root/TooltipRoot.d.ts +2 -2
  689. package/esm/tooltip/root/TooltipRoot.js +2 -2
  690. package/esm/tooltip/store/TooltipStore.js +1 -0
  691. package/esm/tooltip/trigger/TooltipTrigger.js +3 -1
  692. package/esm/tooltip/viewport/TooltipViewport.js +1 -0
  693. package/esm/types/temporal/index.d.ts +2 -0
  694. package/esm/types/temporal/index.js +2 -0
  695. package/esm/types/temporal/temporal-adapter.d.ts +371 -0
  696. package/esm/types/temporal/temporal-adapter.js +1 -0
  697. package/esm/types/temporal/temporal.d.ts +35 -0
  698. package/esm/types/temporal/temporal.js +1 -0
  699. package/esm/unstable-use-media-query/index.js +2 -6
  700. package/esm/use-render/useRender.d.ts +1 -1
  701. package/esm/utils/FloatingPortalLite.js +1 -0
  702. package/esm/utils/InternalBackdrop.js +2 -13
  703. package/esm/utils/createBaseUIEventDetails.d.ts +2 -2
  704. package/esm/utils/getPseudoElementBounds.js +4 -2
  705. package/esm/utils/popups/store.js +1 -1
  706. package/esm/utils/popups/useTriggerFocusGuards.d.ts +28 -0
  707. package/esm/utils/popups/useTriggerFocusGuards.js +55 -0
  708. package/esm/utils/reason-parts.d.ts +4 -1
  709. package/esm/utils/reason-parts.js +4 -1
  710. package/esm/{scroll-area/utils → utils}/scrollEdges.d.ts +1 -0
  711. package/esm/{scroll-area/utils → utils}/scrollEdges.js +4 -1
  712. package/esm/utils/temporal/date-helpers.d.ts +15 -0
  713. package/esm/utils/temporal/date-helpers.js +43 -0
  714. package/esm/utils/temporal/getDateManager.d.ts +5 -0
  715. package/esm/utils/temporal/getDateManager.js +19 -0
  716. package/esm/utils/temporal/getInitialReferenceDate.d.ts +27 -0
  717. package/esm/utils/temporal/getInitialReferenceDate.js +28 -0
  718. package/esm/utils/temporal/types.d.ts +65 -0
  719. package/esm/utils/temporal/types.js +1 -0
  720. package/esm/utils/temporal/validateDate.d.ts +27 -0
  721. package/esm/utils/temporal/validateDate.js +25 -0
  722. package/esm/utils/types.d.ts +11 -5
  723. package/esm/utils/useAnchorPositioning.js +10 -4
  724. package/esm/utils/useAnchoredPopupScrollLock.d.ts +6 -0
  725. package/esm/utils/useAnchoredPopupScrollLock.js +31 -0
  726. package/esm/utils/useAnimationsFinished.js +48 -51
  727. package/esm/utils/useIsHydrating.d.ts +5 -0
  728. package/esm/utils/useIsHydrating.js +19 -0
  729. package/esm/utils/usePopupViewport.js +2 -1
  730. package/esm/utils/usePositioner.d.ts +23 -0
  731. package/esm/utils/usePositioner.js +34 -0
  732. package/esm/utils/usePressAndHold.d.ts +58 -0
  733. package/esm/utils/usePressAndHold.js +192 -0
  734. package/esm/utils/useRenderElement.js +18 -3
  735. package/esm/utils/useSwipeDismiss.d.ts +1 -0
  736. package/esm/utils/useSwipeDismiss.js +4 -2
  737. package/esm/utils/useTransitionStatus.js +3 -3
  738. package/field/control/FieldControl.js +6 -6
  739. package/field/description/FieldDescription.js +1 -0
  740. package/field/error/FieldError.d.ts +1 -1
  741. package/field/error/FieldError.js +8 -5
  742. package/field/item/FieldItem.js +1 -0
  743. package/field/label/FieldLabel.d.ts +1 -1
  744. package/field/label/FieldLabel.js +1 -0
  745. package/field/root/FieldRoot.js +12 -1
  746. package/field/root/FieldRootContext.d.ts +2 -0
  747. package/field/root/FieldRootContext.js +1 -0
  748. package/field/root/useFieldControlRegistration.d.ts +17 -0
  749. package/field/root/useFieldControlRegistration.js +131 -0
  750. package/field/root/useRegisterFieldControl.d.ts +5 -0
  751. package/field/root/useRegisterFieldControl.js +41 -0
  752. package/field/validity/FieldValidity.d.ts +1 -1
  753. package/field/validity/FieldValidity.js +1 -1
  754. package/fieldset/legend/FieldsetLegend.js +1 -0
  755. package/fieldset/root/FieldsetRoot.js +1 -0
  756. package/floating-ui-react/components/FloatingFocusManager.js +72 -104
  757. package/floating-ui-react/components/FloatingPortal.js +23 -17
  758. package/floating-ui-react/components/FloatingRootStore.d.ts +18 -2
  759. package/floating-ui-react/components/FloatingRootStore.js +34 -17
  760. package/floating-ui-react/hooks/useClick.js +8 -6
  761. package/floating-ui-react/hooks/useClientPoint.js +9 -8
  762. package/floating-ui-react/hooks/useDismiss.js +42 -79
  763. package/floating-ui-react/hooks/useFloating.js +4 -3
  764. package/floating-ui-react/hooks/useFloatingRootContext.js +3 -3
  765. package/floating-ui-react/hooks/useFocus.js +12 -21
  766. package/floating-ui-react/hooks/useHover.d.ts +1 -1
  767. package/floating-ui-react/hooks/useHover.js +8 -46
  768. package/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +5 -0
  769. package/floating-ui-react/hooks/useHoverFloatingInteraction.js +19 -19
  770. package/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +3 -3
  771. package/floating-ui-react/hooks/useHoverInteractionSharedState.js +20 -9
  772. package/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +1 -0
  773. package/floating-ui-react/hooks/useHoverReferenceInteraction.js +69 -31
  774. package/floating-ui-react/hooks/useHoverShared.js +2 -2
  775. package/floating-ui-react/hooks/useListNavigation.d.ts +4 -4
  776. package/floating-ui-react/hooks/useListNavigation.js +56 -52
  777. package/floating-ui-react/hooks/useRole.js +2 -2
  778. package/floating-ui-react/hooks/useSyncedFloatingRootContext.d.ts +0 -4
  779. package/floating-ui-react/hooks/useSyncedFloatingRootContext.js +3 -4
  780. package/floating-ui-react/hooks/useTypeahead.js +8 -6
  781. package/floating-ui-react/safePolygon.js +1 -0
  782. package/floating-ui-react/utils/composite.d.ts +6 -4
  783. package/floating-ui-react/utils/composite.js +55 -24
  784. package/floating-ui-react/utils/element.d.ts +3 -3
  785. package/floating-ui-react/utils/element.js +24 -45
  786. package/floating-ui-react/utils/enqueueFocus.d.ts +3 -2
  787. package/floating-ui-react/utils/enqueueFocus.js +10 -2
  788. package/floating-ui-react/utils/getEmptyRootContext.js +2 -1
  789. package/floating-ui-react/utils/nodes.js +2 -2
  790. package/floating-ui-react/utils/shadowDom.d.ts +3 -0
  791. package/floating-ui-react/utils/shadowDom.js +48 -0
  792. package/floating-ui-react/utils/tabbable.d.ts +4 -5
  793. package/floating-ui-react/utils/tabbable.js +129 -15
  794. package/form/Form.js +1 -0
  795. package/index.d.ts +1 -0
  796. package/index.js +12 -1
  797. package/input/Input.d.ts +1 -1
  798. package/labelable-provider/useLabel.js +0 -1
  799. package/localization-provider/LocalizationContext.d.ts +10 -0
  800. package/localization-provider/LocalizationContext.js +24 -0
  801. package/localization-provider/LocalizationProvider.d.ts +20 -0
  802. package/localization-provider/LocalizationProvider.js +42 -0
  803. package/localization-provider/index.d.ts +2 -0
  804. package/localization-provider/index.js +19 -0
  805. package/menu/arrow/MenuArrow.js +1 -0
  806. package/menu/backdrop/MenuBackdrop.js +1 -0
  807. package/menu/checkbox-item/MenuCheckboxItem.js +2 -1
  808. package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +1 -0
  809. package/menu/group/MenuGroup.js +1 -0
  810. package/menu/group-label/MenuGroupLabel.js +1 -0
  811. package/menu/item/MenuItem.js +2 -1
  812. package/menu/item/useMenuItem.d.ts +1 -1
  813. package/menu/link-item/MenuLinkItem.js +2 -1
  814. package/menu/popup/MenuPopup.js +1 -0
  815. package/menu/positioner/MenuPositioner.js +15 -31
  816. package/menu/positioner/MenuPositionerContext.d.ts +2 -15
  817. package/menu/radio-group/MenuRadioGroup.js +1 -0
  818. package/menu/radio-item/MenuRadioItem.js +2 -1
  819. package/menu/radio-item-indicator/MenuRadioItemIndicator.js +1 -0
  820. package/menu/root/MenuRoot.d.ts +2 -2
  821. package/menu/root/MenuRoot.js +8 -17
  822. package/menu/store/MenuStore.d.ts +3 -0
  823. package/menu/store/MenuStore.js +2 -0
  824. package/menu/submenu-root/MenuSubmenuRoot.d.ts +1 -1
  825. package/menu/submenu-root/MenuSubmenuRoot.js +1 -1
  826. package/menu/submenu-trigger/MenuSubmenuTrigger.js +18 -2
  827. package/menu/trigger/MenuTrigger.js +10 -30
  828. package/menu/viewport/MenuViewport.js +1 -0
  829. package/menubar/Menubar.js +7 -11
  830. package/menubar/MenubarDataAttributes.d.ts +6 -3
  831. package/menubar/MenubarDataAttributes.js +10 -7
  832. package/merge-props/mergeProps.d.ts +1 -1
  833. package/merge-props/mergeProps.js +53 -18
  834. package/meter/indicator/MeterIndicator.js +1 -0
  835. package/meter/label/MeterLabel.js +1 -0
  836. package/meter/root/MeterRoot.js +1 -0
  837. package/meter/track/MeterTrack.js +1 -0
  838. package/meter/value/MeterValue.js +1 -0
  839. package/navigation-menu/arrow/NavigationMenuArrow.js +1 -0
  840. package/navigation-menu/backdrop/NavigationMenuBackdrop.js +1 -0
  841. package/navigation-menu/content/NavigationMenuContent.js +3 -0
  842. package/navigation-menu/icon/NavigationMenuIcon.js +1 -0
  843. package/navigation-menu/item/NavigationMenuItem.js +1 -0
  844. package/navigation-menu/link/NavigationMenuLink.js +2 -0
  845. package/navigation-menu/list/NavigationMenuList.js +9 -5
  846. package/navigation-menu/popup/NavigationMenuPopup.js +1 -0
  847. package/navigation-menu/positioner/NavigationMenuPositioner.js +13 -32
  848. package/navigation-menu/root/NavigationMenuRoot.d.ts +9 -6
  849. package/navigation-menu/root/NavigationMenuRoot.js +8 -0
  850. package/navigation-menu/root/NavigationMenuRootContext.d.ts +11 -6
  851. package/navigation-menu/trigger/NavigationMenuTrigger.js +66 -31
  852. package/navigation-menu/viewport/NavigationMenuViewport.js +1 -0
  853. package/number-field/decrement/NumberFieldDecrement.js +1 -10
  854. package/number-field/group/NumberFieldGroup.js +1 -0
  855. package/number-field/increment/NumberFieldIncrement.js +1 -10
  856. package/number-field/input/NumberFieldInput.js +6 -10
  857. package/number-field/root/NumberFieldRoot.d.ts +6 -1
  858. package/number-field/root/NumberFieldRoot.js +10 -75
  859. package/number-field/root/NumberFieldRootContext.d.ts +0 -6
  860. package/number-field/root/useNumberFieldButton.d.ts +0 -6
  861. package/number-field/root/useNumberFieldButton.js +32 -101
  862. package/number-field/scrub-area/NumberFieldScrubArea.js +8 -9
  863. package/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.js +1 -0
  864. package/number-field/utils/constants.d.ts +0 -2
  865. package/number-field/utils/constants.js +1 -3
  866. package/number-field/utils/subscribeToVisualViewportResize.js +2 -4
  867. package/otp-field/index.d.ts +3 -0
  868. package/otp-field/index.js +9 -0
  869. package/otp-field/index.parts.d.ts +3 -0
  870. package/otp-field/index.parts.js +26 -0
  871. package/otp-field/input/OTPFieldInput.d.ts +29 -0
  872. package/otp-field/input/OTPFieldInput.js +242 -0
  873. package/otp-field/input/OTPFieldInputDataAttributes.d.ts +42 -0
  874. package/otp-field/input/OTPFieldInputDataAttributes.js +49 -0
  875. package/otp-field/root/OTPFieldRoot.d.ts +159 -0
  876. package/otp-field/root/OTPFieldRoot.js +413 -0
  877. package/otp-field/root/OTPFieldRootContext.d.ts +31 -0
  878. package/otp-field/root/OTPFieldRootContext.js +30 -0
  879. package/otp-field/root/OTPFieldRootDataAttributes.d.ts +42 -0
  880. package/otp-field/root/OTPFieldRootDataAttributes.js +49 -0
  881. package/otp-field/utils/otp.d.ts +21 -0
  882. package/otp-field/utils/otp.js +76 -0
  883. package/otp-field/utils/stateAttributesMapping.d.ts +5 -0
  884. package/otp-field/utils/stateAttributesMapping.js +17 -0
  885. package/package.json +21 -5
  886. package/popover/arrow/PopoverArrow.js +1 -0
  887. package/popover/backdrop/PopoverBackdrop.js +1 -0
  888. package/popover/close/PopoverClose.js +1 -0
  889. package/popover/description/PopoverDescription.js +1 -0
  890. package/popover/popup/PopoverPopup.js +2 -0
  891. package/popover/positioner/PopoverPositioner.js +16 -30
  892. package/popover/root/PopoverRoot.d.ts +2 -2
  893. package/popover/root/PopoverRoot.js +1 -5
  894. package/popover/store/PopoverStore.d.ts +2 -0
  895. package/popover/store/PopoverStore.js +3 -9
  896. package/popover/title/PopoverTitle.js +1 -0
  897. package/popover/trigger/PopoverTrigger.js +11 -33
  898. package/popover/viewport/PopoverViewport.js +1 -0
  899. package/preview-card/arrow/PreviewCardArrow.js +1 -0
  900. package/preview-card/backdrop/PreviewCardBackdrop.js +1 -0
  901. package/preview-card/index.d.ts +1 -0
  902. package/preview-card/popup/PreviewCardPopup.js +1 -0
  903. package/preview-card/positioner/PreviewCardPositioner.js +10 -30
  904. package/preview-card/positioner/PreviewCardPositionerContext.d.ts +2 -8
  905. package/preview-card/root/PreviewCardRoot.d.ts +2 -2
  906. package/preview-card/root/PreviewCardRoot.js +2 -2
  907. package/preview-card/store/PreviewCardStore.js +1 -0
  908. package/preview-card/trigger/PreviewCardTrigger.js +3 -1
  909. package/preview-card/viewport/PreviewCardViewport.js +1 -0
  910. package/progress/indicator/ProgressIndicator.js +1 -0
  911. package/progress/indicator/ProgressIndicatorDataAttributes.d.ts +1 -1
  912. package/progress/indicator/ProgressIndicatorDataAttributes.js +1 -1
  913. package/progress/label/ProgressLabel.js +1 -0
  914. package/progress/label/ProgressLabelDataAttributes.d.ts +1 -1
  915. package/progress/label/ProgressLabelDataAttributes.js +1 -1
  916. package/progress/root/ProgressRoot.js +1 -0
  917. package/progress/root/ProgressRootDataAttributes.d.ts +1 -1
  918. package/progress/root/ProgressRootDataAttributes.js +1 -1
  919. package/progress/track/ProgressTrack.js +1 -0
  920. package/progress/track/ProgressTrackDataAttributes.d.ts +1 -1
  921. package/progress/track/ProgressTrackDataAttributes.js +1 -1
  922. package/progress/value/ProgressValue.js +1 -0
  923. package/progress/value/ProgressValueDataAttributes.d.ts +1 -1
  924. package/progress/value/ProgressValueDataAttributes.js +1 -1
  925. package/radio/indicator/RadioIndicator.js +1 -0
  926. package/radio/root/RadioRoot.js +7 -1
  927. package/radio-group/RadioGroup.d.ts +5 -0
  928. package/radio-group/RadioGroup.js +9 -7
  929. package/radio-group/RadioGroupContext.d.ts +1 -0
  930. package/scroll-area/content/ScrollAreaContent.js +1 -0
  931. package/scroll-area/corner/ScrollAreaCorner.js +1 -0
  932. package/scroll-area/root/ScrollAreaRoot.js +1 -0
  933. package/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +1 -1
  934. package/scroll-area/scrollbar/ScrollAreaScrollbar.js +9 -6
  935. package/scroll-area/thumb/ScrollAreaThumb.js +1 -0
  936. package/scroll-area/viewport/ScrollAreaViewport.js +5 -13
  937. package/select/arrow/SelectArrow.js +1 -0
  938. package/select/backdrop/SelectBackdrop.js +1 -0
  939. package/select/group/SelectGroup.js +1 -0
  940. package/select/group-label/SelectGroupLabel.js +1 -0
  941. package/select/icon/SelectIcon.js +1 -0
  942. package/select/item/SelectItem.js +9 -34
  943. package/select/item-indicator/SelectItemIndicator.js +1 -0
  944. package/select/item-text/SelectItemText.js +1 -0
  945. package/select/label/SelectLabel.js +1 -0
  946. package/select/list/SelectList.js +1 -0
  947. package/select/popup/SelectPopup.js +140 -168
  948. package/select/positioner/SelectPositioner.js +11 -24
  949. package/select/root/SelectRoot.d.ts +7 -2
  950. package/select/root/SelectRoot.js +36 -23
  951. package/select/scroll-arrow/SelectScrollArrow.js +47 -63
  952. package/select/trigger/SelectTrigger.js +1 -0
  953. package/select/value/SelectValue.js +1 -0
  954. package/separator/Separator.js +1 -0
  955. package/separator/SeparatorDataAttributes.d.ts +7 -0
  956. package/separator/SeparatorDataAttributes.js +14 -0
  957. package/slider/control/SliderControl.js +16 -7
  958. package/slider/indicator/SliderIndicator.js +6 -6
  959. package/slider/label/SliderLabel.js +1 -0
  960. package/slider/root/SliderRoot.d.ts +6 -1
  961. package/slider/root/SliderRoot.js +8 -9
  962. package/slider/root/SliderRootContext.d.ts +1 -0
  963. package/slider/thumb/SliderThumb.js +65 -23
  964. package/slider/track/SliderTrack.js +1 -0
  965. package/slider/utils/roundValueToStep.d.ts +1 -0
  966. package/slider/utils/roundValueToStep.js +6 -1
  967. package/slider/value/SliderValue.js +1 -0
  968. package/switch/root/SwitchRoot.d.ts +5 -0
  969. package/switch/root/SwitchRoot.js +15 -10
  970. package/switch/thumb/SwitchThumb.js +1 -0
  971. package/tabs/indicator/TabsIndicator.d.ts +1 -1
  972. package/tabs/indicator/TabsIndicator.js +4 -4
  973. package/tabs/list/TabsList.js +3 -85
  974. package/tabs/panel/TabsPanel.js +1 -0
  975. package/tabs/root/TabsRoot.js +115 -22
  976. package/tabs/tab/TabsTab.js +1 -0
  977. package/temporal-adapter-date-fns/TemporalAdapterDateFns.d.ts +93 -0
  978. package/temporal-adapter-date-fns/TemporalAdapterDateFns.js +358 -0
  979. package/temporal-adapter-date-fns/index.d.ts +1 -0
  980. package/temporal-adapter-date-fns/index.js +12 -0
  981. package/temporal-adapter-luxon/TemporalAdapterLuxon.d.ts +89 -0
  982. package/temporal-adapter-luxon/TemporalAdapterLuxon.js +333 -0
  983. package/temporal-adapter-luxon/index.d.ts +1 -0
  984. package/temporal-adapter-luxon/index.js +12 -0
  985. package/temporal-adapter-provider/TemporalAdapterContext.d.ts +10 -0
  986. package/temporal-adapter-provider/TemporalAdapterContext.js +27 -0
  987. package/temporal-adapter-provider/TemporalAdapterProvider.d.ts +15 -0
  988. package/temporal-adapter-provider/TemporalAdapterProvider.js +28 -0
  989. package/temporal-adapter-provider/index.d.ts +1 -0
  990. package/temporal-adapter-provider/index.js +12 -0
  991. package/toast/action/ToastAction.js +1 -0
  992. package/toast/arrow/ToastArrow.js +1 -0
  993. package/toast/close/ToastClose.js +1 -0
  994. package/toast/content/ToastContent.js +1 -0
  995. package/toast/description/ToastDescription.js +1 -0
  996. package/toast/positioner/ToastPositioner.js +11 -26
  997. package/toast/positioner/ToastPositionerContext.d.ts +2 -8
  998. package/toast/root/ToastRoot.js +19 -6
  999. package/toast/root/ToastRootDataAttributes.js +4 -3
  1000. package/toast/store.d.ts +9 -2
  1001. package/toast/store.js +37 -12
  1002. package/toast/title/ToastTitle.js +1 -0
  1003. package/toast/useToastManager.d.ts +10 -2
  1004. package/toast/viewport/ToastViewport.js +36 -26
  1005. package/toggle/Toggle.js +2 -0
  1006. package/toggle-group/ToggleGroup.js +4 -1
  1007. package/toolbar/button/ToolbarButton.d.ts +1 -1
  1008. package/toolbar/button/ToolbarButton.js +2 -0
  1009. package/toolbar/group/ToolbarGroup.js +1 -0
  1010. package/toolbar/input/ToolbarInput.d.ts +1 -1
  1011. package/toolbar/input/ToolbarInput.js +2 -0
  1012. package/toolbar/link/ToolbarLink.js +2 -0
  1013. package/toolbar/root/ToolbarRoot.js +2 -0
  1014. package/tooltip/arrow/TooltipArrow.js +2 -1
  1015. package/tooltip/index.d.ts +1 -0
  1016. package/tooltip/popup/TooltipPopup.js +1 -0
  1017. package/tooltip/positioner/TooltipPositioner.js +10 -29
  1018. package/tooltip/positioner/TooltipPositionerContext.d.ts +2 -9
  1019. package/tooltip/root/TooltipRoot.d.ts +2 -2
  1020. package/tooltip/root/TooltipRoot.js +2 -2
  1021. package/tooltip/store/TooltipStore.js +1 -0
  1022. package/tooltip/trigger/TooltipTrigger.js +3 -1
  1023. package/tooltip/viewport/TooltipViewport.js +1 -0
  1024. package/types/temporal/index.d.ts +2 -0
  1025. package/types/temporal/index.js +27 -0
  1026. package/types/temporal/temporal-adapter.d.ts +371 -0
  1027. package/types/temporal/temporal-adapter.js +5 -0
  1028. package/types/temporal/temporal.d.ts +35 -0
  1029. package/types/temporal/temporal.js +5 -0
  1030. package/unstable-use-media-query/index.js +2 -6
  1031. package/use-render/useRender.d.ts +1 -1
  1032. package/utils/FloatingPortalLite.js +1 -0
  1033. package/utils/InternalBackdrop.js +2 -13
  1034. package/utils/createBaseUIEventDetails.d.ts +2 -2
  1035. package/utils/getPseudoElementBounds.js +4 -2
  1036. package/utils/popups/store.js +1 -1
  1037. package/utils/popups/useTriggerFocusGuards.d.ts +28 -0
  1038. package/utils/popups/useTriggerFocusGuards.js +60 -0
  1039. package/utils/reason-parts.d.ts +4 -1
  1040. package/utils/reason-parts.js +5 -2
  1041. package/{scroll-area/utils → utils}/scrollEdges.d.ts +1 -0
  1042. package/{scroll-area/utils → utils}/scrollEdges.js +5 -1
  1043. package/utils/temporal/date-helpers.d.ts +15 -0
  1044. package/utils/temporal/date-helpers.js +54 -0
  1045. package/utils/temporal/getDateManager.d.ts +5 -0
  1046. package/utils/temporal/getDateManager.js +25 -0
  1047. package/utils/temporal/getInitialReferenceDate.d.ts +27 -0
  1048. package/utils/temporal/getInitialReferenceDate.js +34 -0
  1049. package/utils/temporal/types.d.ts +65 -0
  1050. package/utils/temporal/types.js +5 -0
  1051. package/utils/temporal/validateDate.d.ts +27 -0
  1052. package/utils/temporal/validateDate.js +31 -0
  1053. package/utils/types.d.ts +11 -5
  1054. package/utils/useAnchorPositioning.js +9 -3
  1055. package/utils/useAnchoredPopupScrollLock.d.ts +6 -0
  1056. package/utils/useAnchoredPopupScrollLock.js +36 -0
  1057. package/utils/useAnimationsFinished.js +48 -51
  1058. package/utils/useIsHydrating.d.ts +5 -0
  1059. package/utils/useIsHydrating.js +25 -0
  1060. package/utils/usePopupViewport.js +2 -1
  1061. package/utils/usePositioner.d.ts +23 -0
  1062. package/utils/usePositioner.js +39 -0
  1063. package/utils/usePressAndHold.d.ts +58 -0
  1064. package/utils/usePressAndHold.js +198 -0
  1065. package/utils/useRenderElement.js +18 -3
  1066. package/utils/useSwipeDismiss.d.ts +1 -0
  1067. package/utils/useSwipeDismiss.js +3 -1
  1068. package/utils/useTransitionStatus.js +3 -3
  1069. package/esm/field/useField.d.ts +0 -14
  1070. package/esm/field/useField.js +0 -75
  1071. package/esm/scroll-area/utils/onVisible.d.ts +0 -4
  1072. package/esm/scroll-area/utils/onVisible.js +0 -20
  1073. package/field/useField.d.ts +0 -14
  1074. package/field/useField.js +0 -81
  1075. package/scroll-area/utils/onVisible.d.ts +0 -4
  1076. package/scroll-area/utils/onVisible.js +0 -26
  1077. /package/combobox/clear/{ComboboxClearDataAtributes.d.ts → ComboboxClearDataAttributes.d.ts} +0 -0
  1078. /package/combobox/clear/{ComboboxClearDataAtributes.js → ComboboxClearDataAttributes.js} +0 -0
  1079. /package/combobox/item/{ComboboxtemDataAttributes.d.ts → ComboboxItemDataAttributes.d.ts} +0 -0
  1080. /package/combobox/item/{ComboboxtemDataAttributes.js → ComboboxItemDataAttributes.js} +0 -0
  1081. /package/esm/combobox/clear/{ComboboxClearDataAtributes.d.ts → ComboboxClearDataAttributes.d.ts} +0 -0
  1082. /package/esm/combobox/clear/{ComboboxClearDataAtributes.js → ComboboxClearDataAttributes.js} +0 -0
  1083. /package/esm/combobox/item/{ComboboxtemDataAttributes.d.ts → ComboboxItemDataAttributes.d.ts} +0 -0
  1084. /package/esm/combobox/item/{ComboboxtemDataAttributes.js → ComboboxItemDataAttributes.js} +0 -0
  1085. /package/esm/navigation-menu/link/{NavigationMenuLinikDataAttributes.d.ts → NavigationMenuLinkDataAttributes.d.ts} +0 -0
  1086. /package/esm/navigation-menu/link/{NavigationMenuLinikDataAttributes.js → NavigationMenuLinkDataAttributes.js} +0 -0
  1087. /package/esm/navigation-menu/positioner/{NavigationPositionerDataAttributes.d.ts → NavigationMenuPositionerDataAttributes.d.ts} +0 -0
  1088. /package/esm/navigation-menu/positioner/{NavigationPositionerDataAttributes.js → NavigationMenuPositionerDataAttributes.js} +0 -0
  1089. /package/navigation-menu/link/{NavigationMenuLinikDataAttributes.d.ts → NavigationMenuLinkDataAttributes.d.ts} +0 -0
  1090. /package/navigation-menu/link/{NavigationMenuLinikDataAttributes.js → NavigationMenuLinkDataAttributes.js} +0 -0
  1091. /package/navigation-menu/positioner/{NavigationPositionerDataAttributes.d.ts → NavigationMenuPositionerDataAttributes.d.ts} +0 -0
  1092. /package/navigation-menu/positioner/{NavigationPositionerDataAttributes.js → NavigationMenuPositionerDataAttributes.js} +0 -0
@@ -11,11 +11,13 @@ exports.usePortalContext = void 0;
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var ReactDOM = _interopRequireWildcard(require("react-dom"));
13
13
  var _dom = require("@floating-ui/utils/dom");
14
+ var _addEventListener = require("@base-ui/utils/addEventListener");
15
+ var _mergeCleanups = require("@base-ui/utils/mergeCleanups");
14
16
  var _useId = require("@base-ui/utils/useId");
15
17
  var _useIsoLayoutEffect = require("@base-ui/utils/useIsoLayoutEffect");
16
18
  var _useStableCallback = require("@base-ui/utils/useStableCallback");
17
19
  var _FocusGuard = require("../../utils/FocusGuard");
18
- var _utils = require("../utils");
20
+ var _tabbable = require("../utils/tabbable");
19
21
  var _createBaseUIEventDetails = require("../../utils/createBaseUIEventDetails");
20
22
  var _reasons = require("../../utils/reasons");
21
23
  var _createAttribute = require("../utils/createAttribute");
@@ -111,6 +113,7 @@ const FloatingPortal = exports.FloatingPortal = /*#__PURE__*/React.forwardRef(fu
111
113
  className,
112
114
  render,
113
115
  renderGuards,
116
+ style,
114
117
  ...elementProps
115
118
  } = componentProps;
116
119
  const {
@@ -127,6 +130,7 @@ const FloatingPortal = exports.FloatingPortal = /*#__PURE__*/React.forwardRef(fu
127
130
  const beforeInsideRef = React.useRef(null);
128
131
  const afterInsideRef = React.useRef(null);
129
132
  const [focusManagerState, setFocusManagerState] = React.useState(null);
133
+ const focusInsideDisabledRef = React.useRef(false);
130
134
  const modal = focusManagerState?.modal;
131
135
  const open = focusManagerState?.open;
132
136
  const shouldRenderGuards = typeof renderGuards === 'boolean' ? renderGuards : !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;
@@ -141,27 +145,29 @@ const FloatingPortal = exports.FloatingPortal = /*#__PURE__*/React.forwardRef(fu
141
145
  // portal has already been focused, either by tabbing into a focus trap
142
146
  // element outside or using the mouse.
143
147
  function onFocus(event) {
144
- if (portalNode && event.relatedTarget && (0, _utils.isOutsideEvent)(event)) {
145
- const focusing = event.type === 'focusin';
146
- const manageFocus = focusing ? _utils.enableFocusInside : _utils.disableFocusInside;
147
- manageFocus(portalNode);
148
+ if (portalNode && event.relatedTarget && (0, _tabbable.isOutsideEvent)(event)) {
149
+ if (event.type === 'focusin') {
150
+ if (focusInsideDisabledRef.current) {
151
+ (0, _tabbable.enableFocusInside)(portalNode);
152
+ focusInsideDisabledRef.current = false;
153
+ }
154
+ } else {
155
+ (0, _tabbable.disableFocusInside)(portalNode);
156
+ focusInsideDisabledRef.current = true;
157
+ }
148
158
  }
149
159
  }
150
160
 
151
161
  // Listen to the event on the capture phase so they run before the focus
152
162
  // trap elements onFocus prop is called.
153
- portalNode.addEventListener('focusin', onFocus, true);
154
- portalNode.addEventListener('focusout', onFocus, true);
155
- return () => {
156
- portalNode.removeEventListener('focusin', onFocus, true);
157
- portalNode.removeEventListener('focusout', onFocus, true);
158
- };
163
+ return (0, _mergeCleanups.mergeCleanups)((0, _addEventListener.addEventListener)(portalNode, 'focusin', onFocus, true), (0, _addEventListener.addEventListener)(portalNode, 'focusout', onFocus, true));
159
164
  }, [portalNode, modal]);
160
165
  React.useEffect(() => {
161
- if (!portalNode || open) {
166
+ if (!portalNode || open !== false) {
162
167
  return;
163
168
  }
164
- (0, _utils.enableFocusInside)(portalNode);
169
+ (0, _tabbable.enableFocusInside)(portalNode);
170
+ focusInsideDisabledRef.current = false;
165
171
  }, [open, portalNode]);
166
172
  const portalContextValue = React.useMemo(() => ({
167
173
  beforeOutsideRef,
@@ -178,11 +184,11 @@ const FloatingPortal = exports.FloatingPortal = /*#__PURE__*/React.forwardRef(fu
178
184
  "data-type": "outside",
179
185
  ref: beforeOutsideRef,
180
186
  onFocus: event => {
181
- if ((0, _utils.isOutsideEvent)(event, portalNode)) {
187
+ if ((0, _tabbable.isOutsideEvent)(event, portalNode)) {
182
188
  beforeInsideRef.current?.focus();
183
189
  } else {
184
190
  const domReference = focusManagerState ? focusManagerState.domReference : null;
185
- const prevTabbable = (0, _utils.getPreviousTabbable)(domReference);
191
+ const prevTabbable = (0, _tabbable.getPreviousTabbable)(domReference);
186
192
  prevTabbable?.focus();
187
193
  }
188
194
  }
@@ -193,11 +199,11 @@ const FloatingPortal = exports.FloatingPortal = /*#__PURE__*/React.forwardRef(fu
193
199
  "data-type": "outside",
194
200
  ref: afterOutsideRef,
195
201
  onFocus: event => {
196
- if ((0, _utils.isOutsideEvent)(event, portalNode)) {
202
+ if ((0, _tabbable.isOutsideEvent)(event, portalNode)) {
197
203
  afterInsideRef.current?.focus();
198
204
  } else {
199
205
  const domReference = focusManagerState ? focusManagerState.domReference : null;
200
- const nextTabbable = (0, _utils.getNextTabbable)(domReference);
206
+ const nextTabbable = (0, _tabbable.getNextTabbable)(domReference);
201
207
  nextTabbable?.focus();
202
208
  if (focusManagerState?.closeOnFocusOut) {
203
209
  focusManagerState?.onOpenChange(false, (0, _createBaseUIEventDetails.createChangeEventDetails)(_reasons.REASONS.focusOut, event.nativeEvent));
@@ -3,8 +3,10 @@ import { ReactStore } from '@base-ui/utils/store';
3
3
  import type { FloatingEvents, ContextData, ReferenceType } from "../types.js";
4
4
  import { type BaseUIChangeEventDetails } from "../../utils/createBaseUIEventDetails.js";
5
5
  import { type PopupTriggerMap } from "../../utils/popups/index.js";
6
+ import type { TransitionStatus } from "../../utils/useTransitionStatus.js";
6
7
  export interface FloatingRootState {
7
8
  open: boolean;
9
+ transitionStatus: TransitionStatus | undefined;
8
10
  domReferenceElement: Element | null;
9
11
  referenceElement: ReferenceType | null;
10
12
  floatingElement: HTMLElement | null;
@@ -19,11 +21,11 @@ export interface FloatingRootStoreContext {
19
21
  readonly dataRef: React.RefObject<ContextData>;
20
22
  readonly events: FloatingEvents;
21
23
  nested: boolean;
22
- noEmit: boolean;
23
24
  readonly triggerElements: PopupTriggerMap;
24
25
  }
25
26
  declare const selectors: {
26
27
  open: (state: FloatingRootState) => boolean;
28
+ transitionStatus: (state: FloatingRootState) => TransitionStatus;
27
29
  domReferenceElement: (state: FloatingRootState) => Element | null;
28
30
  referenceElement: (state: FloatingRootState) => ReferenceType | null;
29
31
  floatingElement: (state: FloatingRootState) => HTMLElement | null;
@@ -31,16 +33,30 @@ declare const selectors: {
31
33
  };
32
34
  interface FloatingRootStoreOptions {
33
35
  open: boolean;
36
+ transitionStatus: TransitionStatus | undefined;
34
37
  referenceElement: ReferenceType | null;
35
38
  floatingElement: HTMLElement | null;
36
39
  triggerElements: PopupTriggerMap;
37
40
  floatingId: string | undefined;
41
+ /**
42
+ * When true, `setOpen` only forwards to `onOpenChange`.
43
+ * The popup store owns `dispatchOpenChange(...)` in this mode.
44
+ */
45
+ syncOnly: boolean;
38
46
  nested: boolean;
39
- noEmit: boolean;
40
47
  onOpenChange: ((open: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void) | undefined;
41
48
  }
42
49
  export declare class FloatingRootStore extends ReactStore<Readonly<FloatingRootState>, FloatingRootStoreContext, typeof selectors> {
50
+ private readonly syncOnly;
43
51
  constructor(options: FloatingRootStoreOptions);
52
+ /**
53
+ * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
54
+ */
55
+ syncOpenEvent: (newOpen: boolean, event: Event | undefined) => void;
56
+ /**
57
+ * Runs the root-owned side effects for an open state change.
58
+ */
59
+ dispatchOpenChange: (newOpen: boolean, eventDetails: BaseUIChangeEventDetails<string>) => void;
44
60
  /**
45
61
  * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
46
62
  *
@@ -9,6 +9,7 @@ var _createEventEmitter = require("../utils/createEventEmitter");
9
9
  var _utils = require("../utils");
10
10
  const selectors = {
11
11
  open: (0, _store.createSelector)(state => state.open),
12
+ transitionStatus: (0, _store.createSelector)(state => state.transitionStatus),
12
13
  domReferenceElement: (0, _store.createSelector)(state => state.domReferenceElement),
13
14
  referenceElement: (0, _store.createSelector)(state => state.positionReference ?? state.referenceElement),
14
15
  floatingElement: (0, _store.createSelector)(state => state.floatingElement),
@@ -17,8 +18,8 @@ const selectors = {
17
18
  class FloatingRootStore extends _store.ReactStore {
18
19
  constructor(options) {
19
20
  const {
21
+ syncOnly,
20
22
  nested,
21
- noEmit,
22
23
  onOpenChange,
23
24
  triggerElements,
24
25
  ...initialState
@@ -34,11 +35,38 @@ class FloatingRootStore extends _store.ReactStore {
34
35
  },
35
36
  events: (0, _createEventEmitter.createEventEmitter)(),
36
37
  nested,
37
- noEmit,
38
38
  triggerElements
39
39
  }, selectors);
40
+ this.syncOnly = syncOnly;
40
41
  }
41
42
 
43
+ /**
44
+ * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
45
+ */
46
+ syncOpenEvent = (newOpen, event) => {
47
+ if (!newOpen || !this.state.open ||
48
+ // Prevent a pending hover-open from overwriting a click-open event, while allowing
49
+ // click events to upgrade a hover-open.
50
+ event != null && (0, _utils.isClickLikeEvent)(event)) {
51
+ this.context.dataRef.current.openEvent = newOpen ? event : undefined;
52
+ }
53
+ };
54
+
55
+ /**
56
+ * Runs the root-owned side effects for an open state change.
57
+ */
58
+ dispatchOpenChange = (newOpen, eventDetails) => {
59
+ this.syncOpenEvent(newOpen, eventDetails.event);
60
+ const details = {
61
+ open: newOpen,
62
+ reason: eventDetails.reason,
63
+ nativeEvent: eventDetails.event,
64
+ nested: this.context.nested,
65
+ triggerElement: eventDetails.trigger
66
+ };
67
+ this.context.events.emit('openchange', details);
68
+ };
69
+
42
70
  /**
43
71
  * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
44
72
  *
@@ -46,22 +74,11 @@ class FloatingRootStore extends _store.ReactStore {
46
74
  * @param eventDetails Details about the event that triggered the open state change.
47
75
  */
48
76
  setOpen = (newOpen, eventDetails) => {
49
- if (!newOpen || !this.state.open ||
50
- // Prevent a pending hover-open from overwriting a click-open event, while allowing
51
- // click events to upgrade a hover-open.
52
- (0, _utils.isClickLikeEvent)(eventDetails.event)) {
53
- this.context.dataRef.current.openEvent = newOpen ? eventDetails.event : undefined;
54
- }
55
- if (!this.context.noEmit) {
56
- const details = {
57
- open: newOpen,
58
- reason: eventDetails.reason,
59
- nativeEvent: eventDetails.event,
60
- nested: this.context.nested,
61
- triggerElement: eventDetails.trigger
62
- };
63
- this.context.events.emit('openchange', details);
77
+ if (this.syncOnly) {
78
+ this.context.onOpenChange?.(newOpen, eventDetails);
79
+ return;
64
80
  }
81
+ this.dispatchOpenChange(newOpen, eventDetails);
65
82
  this.context.onOpenChange?.(newOpen, eventDetails);
66
83
  };
67
84
  }
@@ -10,7 +10,8 @@ var React = _interopRequireWildcard(require("react"));
10
10
  var _useAnimationFrame = require("@base-ui/utils/useAnimationFrame");
11
11
  var _useTimeout = require("@base-ui/utils/useTimeout");
12
12
  var _constants = require("../../utils/constants");
13
- var _utils = require("../utils");
13
+ var _element = require("../utils/element");
14
+ var _event = require("../utils/event");
14
15
  var _createBaseUIEventDetails = require("../../utils/createBaseUIEventDetails");
15
16
  var _reasons = require("../../utils/reasons");
16
17
  /**
@@ -43,7 +44,7 @@ function useClick(context, props = {}) {
43
44
 
44
45
  // Ignore all buttons except for the "main" button.
45
46
  // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
46
- if (event.button !== 0 || eventOption === 'click' || (0, _utils.isMouseLikePointerType)(pointerType, true) && ignoreMouse) {
47
+ if (event.button !== 0 || eventOption === 'click' || (0, _event.isMouseLikePointerType)(pointerType, true) && ignoreMouse) {
47
48
  return;
48
49
  }
49
50
  const openEvent = dataRef.current.openEvent;
@@ -53,8 +54,9 @@ function useClick(context, props = {}) {
53
54
 
54
55
  // Animations sometimes won't run on a typeable element if using a rAF.
55
56
  // Focus is always set on these elements. For touch, we may delay opening.
56
- if ((0, _utils.isTypeableElement)(nativeEvent.target)) {
57
- const details = (0, _createBaseUIEventDetails.createChangeEventDetails)(reason, nativeEvent, nativeEvent.target);
57
+ const target = (0, _element.getTarget)(nativeEvent);
58
+ if ((0, _element.isTypeableElement)(target)) {
59
+ const details = (0, _createBaseUIEventDetails.createChangeEventDetails)(reason, nativeEvent, target);
58
60
  if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {
59
61
  touchOpenTimeout.start(touchOpenDelay, () => {
60
62
  store.setOpen(true, details);
@@ -91,13 +93,13 @@ function useClick(context, props = {}) {
91
93
  pointerTypeRef.current = undefined;
92
94
  return;
93
95
  }
94
- if ((0, _utils.isMouseLikePointerType)(pointerType, true) && ignoreMouse) {
96
+ if ((0, _event.isMouseLikePointerType)(pointerType, true) && ignoreMouse) {
95
97
  return;
96
98
  }
97
99
  const open = store.select('open');
98
100
  const openEvent = dataRef.current.openEvent;
99
101
  const hasClickedOnInactiveTrigger = store.select('domReferenceElement') !== event.currentTarget;
100
- const nextOpen = open && hasClickedOnInactiveTrigger || !(open && toggle && (openEvent && stickIfOpen ? (0, _utils.isClickLikeEvent)(openEvent) : true));
102
+ const nextOpen = open && hasClickedOnInactiveTrigger || !(open && toggle && (openEvent && stickIfOpen ? (0, _event.isClickLikeEvent)(openEvent) : true));
101
103
  const details = (0, _createBaseUIEventDetails.createChangeEventDetails)(reason, event.nativeEvent, event.currentTarget);
102
104
  if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {
103
105
  touchOpenTimeout.start(touchOpenDelay, () => {
@@ -8,8 +8,10 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.useClientPoint = useClientPoint;
9
9
  var React = _interopRequireWildcard(require("react"));
10
10
  var _dom = require("@floating-ui/utils/dom");
11
+ var _addEventListener = require("@base-ui/utils/addEventListener");
11
12
  var _useStableCallback = require("@base-ui/utils/useStableCallback");
12
- var _utils = require("../utils");
13
+ var _element = require("../utils/element");
14
+ var _event = require("../utils/event");
13
15
  function createVirtualElement(domElement, data) {
14
16
  let offsetX = null;
15
17
  let offsetY = null;
@@ -119,28 +121,27 @@ function useClientPoint(context, props = {}) {
119
121
  // mouse even if the floating element is transitioning out. On touch
120
122
  // devices, this is undesirable because the floating element will move to
121
123
  // the dismissal touch point.
122
- const openCheck = (0, _utils.isMouseLikePointerType)(pointerType) ? floating : open;
124
+ const openCheck = (0, _event.isMouseLikePointerType)(pointerType) ? floating : open;
123
125
  const addListener = React.useCallback(() => {
124
126
  if (!openCheck || !enabled) {
125
127
  return undefined;
126
128
  }
127
129
  const win = (0, _dom.getWindow)(floating);
128
130
  function handleMouseMove(event) {
129
- const target = (0, _utils.getTarget)(event);
130
- if (!(0, _utils.contains)(floating, target)) {
131
+ const target = (0, _element.getTarget)(event);
132
+ if (!(0, _element.contains)(floating, target)) {
131
133
  setReference(event.clientX, event.clientY);
132
134
  } else {
133
- win.removeEventListener('mousemove', handleMouseMove);
135
+ cleanupListenerRef.current?.();
134
136
  cleanupListenerRef.current = null;
135
137
  }
136
138
  }
137
139
  if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {
138
- win.addEventListener('mousemove', handleMouseMove);
139
140
  const cleanup = () => {
140
- win.removeEventListener('mousemove', handleMouseMove);
141
+ cleanupListenerRef.current?.();
141
142
  cleanupListenerRef.current = null;
142
143
  };
143
- cleanupListenerRef.current = cleanup;
144
+ cleanupListenerRef.current = (0, _addEventListener.addEventListener)(win, 'mousemove', handleMouseMove);
144
145
  return cleanup;
145
146
  }
146
147
  store.set('positionReference', domReference);
@@ -9,10 +9,14 @@ exports.normalizeProp = normalizeProp;
9
9
  exports.useDismiss = useDismiss;
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _dom = require("@floating-ui/utils/dom");
12
+ var _addEventListener = require("@base-ui/utils/addEventListener");
13
+ var _mergeCleanups = require("@base-ui/utils/mergeCleanups");
12
14
  var _useTimeout = require("@base-ui/utils/useTimeout");
13
15
  var _useStableCallback = require("@base-ui/utils/useStableCallback");
14
16
  var _owner = require("@base-ui/utils/owner");
15
- var _utils = require("../utils");
17
+ var _element = require("../utils/element");
18
+ var _event = require("../utils/event");
19
+ var _nodes = require("../utils/nodes");
16
20
  var _FloatingTree = require("../components/FloatingTree");
17
21
  var _createBaseUIEventDetails = require("../../utils/createBaseUIEventDetails");
18
22
  var _reasons = require("../../utils/reasons");
@@ -88,7 +92,7 @@ function useDismiss(context, props = {}) {
88
92
  return;
89
93
  }
90
94
  const nodeId = dataRef.current.floatingContext?.nodeId;
91
- const children = tree ? (0, _utils.getNodeChildren)(tree.nodesRef.current, nodeId) : [];
95
+ const children = tree ? (0, _nodes.getNodeChildren)(tree.nodesRef.current, nodeId) : [];
92
96
  if (!escapeKeyBubbles) {
93
97
  if (children.length > 0) {
94
98
  let shouldDismiss = true;
@@ -102,7 +106,7 @@ function useDismiss(context, props = {}) {
102
106
  }
103
107
  }
104
108
  }
105
- const native = (0, _utils.isReactEvent)(event) ? event.nativeEvent : event;
109
+ const native = (0, _event.isReactEvent)(event) ? event.nativeEvent : event;
106
110
  const eventDetails = (0, _createBaseUIEventDetails.createChangeEventDetails)(_reasons.REASONS.escapeKey, native);
107
111
  store.setOpen(false, eventDetails);
108
112
  if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {
@@ -164,8 +168,8 @@ function useDismiss(context, props = {}) {
164
168
  }
165
169
  function isEventWithinFloatingTree(event) {
166
170
  const nodeId = dataRef.current.floatingContext?.nodeId;
167
- const targetIsInsideChildren = tree && (0, _utils.getNodeChildren)(tree.nodesRef.current, nodeId).some(node => (0, _utils.isEventTargetWithin)(event, node.context?.elements.floating));
168
- return (0, _utils.isEventTargetWithin)(event, store.select('floatingElement')) || (0, _utils.isEventTargetWithin)(event, store.select('domReferenceElement')) || targetIsInsideChildren;
171
+ const targetIsInsideChildren = tree && (0, _nodes.getNodeChildren)(tree.nodesRef.current, nodeId).some(node => (0, _element.isEventTargetWithin)(event, node.context?.elements.floating));
172
+ return (0, _element.isEventTargetWithin)(event, store.select('floatingElement')) || (0, _element.isEventTargetWithin)(event, store.select('domReferenceElement')) || targetIsInsideChildren;
169
173
  }
170
174
  function closeOnPressOutside(event) {
171
175
  if (shouldIgnoreEvent(event)) {
@@ -176,17 +180,14 @@ function useDismiss(context, props = {}) {
176
180
  clearInsideReactTree();
177
181
  return;
178
182
  }
179
- const target = (0, _utils.getTarget)(event);
183
+ const target = (0, _element.getTarget)(event);
180
184
  const inertSelector = `[${(0, _createAttribute.createAttribute)('inert')}]`;
181
- let markers = Array.from((0, _owner.ownerDocument)(store.select('floatingElement')).querySelectorAll(inertSelector));
182
185
  const targetRoot = (0, _dom.isElement)(target) ? target.getRootNode() : null;
183
- if ((0, _dom.isShadowRoot)(targetRoot)) {
184
- markers = markers.concat(Array.from(targetRoot.querySelectorAll(inertSelector)));
185
- }
186
+ const markers = Array.from(((0, _dom.isShadowRoot)(targetRoot) ? targetRoot : (0, _owner.ownerDocument)(store.select('floatingElement'))).querySelectorAll(inertSelector));
186
187
  const triggers = store.context.triggerElements;
187
188
 
188
189
  // If another trigger is clicked, don't close the floating element.
189
- if (target && (triggers.hasElement(target) || triggers.hasMatchingElement(trigger => (0, _utils.contains)(trigger, target)))) {
190
+ if (target && (triggers.hasElement(target) || triggers.hasMatchingElement(trigger => (0, _element.contains)(trigger, target)))) {
190
191
  return;
191
192
  }
192
193
  let targetRootAncestor = (0, _dom.isElement)(target) ? target : null;
@@ -200,12 +201,12 @@ function useDismiss(context, props = {}) {
200
201
 
201
202
  // Check if the click occurred on a third-party element injected after the
202
203
  // floating element rendered.
203
- if (markers.length && (0, _dom.isElement)(target) && !(0, _utils.isRootElement)(target) &&
204
+ if (markers.length && (0, _dom.isElement)(target) && !(0, _element.isRootElement)(target) &&
204
205
  // Clicked on a direct ancestor (e.g. FloatingOverlay).
205
- !(0, _utils.contains)(target, store.select('floatingElement')) &&
206
+ !(0, _element.contains)(target, store.select('floatingElement')) &&
206
207
  // If the target root element contains none of the markers, then the
207
208
  // element was injected after the floating element rendered.
208
- markers.every(marker => !(0, _utils.contains)(targetRootAncestor, marker))) {
209
+ markers.every(marker => !(0, _element.contains)(targetRootAncestor, marker))) {
209
210
  return;
210
211
  }
211
212
 
@@ -248,7 +249,7 @@ function useDismiss(context, props = {}) {
248
249
  return;
249
250
  }
250
251
  const nodeId = dataRef.current.floatingContext?.nodeId;
251
- const children = tree ? (0, _utils.getNodeChildren)(tree.nodesRef.current, nodeId) : [];
252
+ const children = tree ? (0, _nodes.getNodeChildren)(tree.nodesRef.current, nodeId) : [];
252
253
  if (children.length > 0) {
253
254
  let shouldDismiss = true;
254
255
  children.forEach(child => {
@@ -264,13 +265,13 @@ function useDismiss(context, props = {}) {
264
265
  clearInsideReactTree();
265
266
  }
266
267
  function handlePointerDown(event) {
267
- if (getOutsidePressEvent() !== 'sloppy' || event.pointerType === 'touch' || !store.select('open') || !enabled || (0, _utils.isEventTargetWithin)(event, store.select('floatingElement')) || (0, _utils.isEventTargetWithin)(event, store.select('domReferenceElement'))) {
268
+ if (getOutsidePressEvent() !== 'sloppy' || event.pointerType === 'touch' || !store.select('open') || !enabled || (0, _element.isEventTargetWithin)(event, store.select('floatingElement')) || (0, _element.isEventTargetWithin)(event, store.select('domReferenceElement'))) {
268
269
  return;
269
270
  }
270
271
  closeOnPressOutside(event);
271
272
  }
272
273
  function handleTouchStart(event) {
273
- if (getOutsidePressEvent() !== 'sloppy' || !store.select('open') || !enabled || (0, _utils.isEventTargetWithin)(event, store.select('floatingElement')) || (0, _utils.isEventTargetWithin)(event, store.select('domReferenceElement'))) {
274
+ if (getOutsidePressEvent() !== 'sloppy' || !store.select('open') || !enabled || (0, _element.isEventTargetWithin)(event, store.select('floatingElement')) || (0, _element.isEventTargetWithin)(event, store.select('domReferenceElement'))) {
274
275
  return;
275
276
  }
276
277
  const touch = event.touches[0];
@@ -290,14 +291,19 @@ function useDismiss(context, props = {}) {
290
291
  });
291
292
  }
292
293
  }
294
+ function addTargetEventListenerOnce(event, listener) {
295
+ const target = (0, _element.getTarget)(event);
296
+ if (!target) {
297
+ return;
298
+ }
299
+ const unsubscribe = (0, _addEventListener.addEventListener)(target, event.type, () => {
300
+ listener(event);
301
+ unsubscribe();
302
+ });
303
+ }
293
304
  function handleTouchStartCapture(event) {
294
305
  currentPointerTypeRef.current = 'touch';
295
- const target = (0, _utils.getTarget)(event);
296
- function callback() {
297
- handleTouchStart(event);
298
- target?.removeEventListener(event.type, callback);
299
- }
300
- target?.addEventListener(event.type, callback);
306
+ addTargetEventListenerOnce(event, handleTouchStart);
301
307
  }
302
308
  function closeOnPressOutsideCapture(event) {
303
309
  cancelDismissOnEndTimeout.clear();
@@ -307,16 +313,13 @@ function useDismiss(context, props = {}) {
307
313
  if (event.type === 'mousedown' && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {
308
314
  return;
309
315
  }
310
- const target = (0, _utils.getTarget)(event);
311
- function callback() {
312
- if (event.type === 'pointerdown') {
313
- handlePointerDown(event);
316
+ addTargetEventListenerOnce(event, targetEvent => {
317
+ if (targetEvent.type === 'pointerdown') {
318
+ handlePointerDown(targetEvent);
314
319
  } else {
315
- closeOnPressOutside(event);
320
+ closeOnPressOutside(targetEvent);
316
321
  }
317
- target?.removeEventListener(event.type, callback);
318
- }
319
- target?.addEventListener(event.type, callback);
322
+ });
320
323
  }
321
324
  function handlePressEndCapture(event) {
322
325
  if (!pressStartedInsideRef.current) {
@@ -355,7 +358,7 @@ function useDismiss(context, props = {}) {
355
358
  clearInsideReactTree();
356
359
  }
357
360
  function handleTouchMove(event) {
358
- if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || (0, _utils.isEventTargetWithin)(event, store.select('floatingElement')) || (0, _utils.isEventTargetWithin)(event, store.select('domReferenceElement'))) {
361
+ if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || (0, _element.isEventTargetWithin)(event, store.select('floatingElement')) || (0, _element.isEventTargetWithin)(event, store.select('domReferenceElement'))) {
359
362
  return;
360
363
  }
361
364
  const touch = event.touches[0];
@@ -375,15 +378,10 @@ function useDismiss(context, props = {}) {
375
378
  }
376
379
  }
377
380
  function handleTouchMoveCapture(event) {
378
- const target = (0, _utils.getTarget)(event);
379
- function callback() {
380
- handleTouchMove(event);
381
- target?.removeEventListener(event.type, callback);
382
- }
383
- target?.addEventListener(event.type, callback);
381
+ addTargetEventListenerOnce(event, handleTouchMove);
384
382
  }
385
383
  function handleTouchEnd(event) {
386
- if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || (0, _utils.isEventTargetWithin)(event, store.select('floatingElement')) || (0, _utils.isEventTargetWithin)(event, store.select('domReferenceElement'))) {
384
+ if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || (0, _element.isEventTargetWithin)(event, store.select('floatingElement')) || (0, _element.isEventTargetWithin)(event, store.select('domReferenceElement'))) {
387
385
  return;
388
386
  }
389
387
  if (touchStateRef.current.dismissOnTouchEnd) {
@@ -393,47 +391,12 @@ function useDismiss(context, props = {}) {
393
391
  touchStateRef.current = null;
394
392
  }
395
393
  function handleTouchEndCapture(event) {
396
- const target = (0, _utils.getTarget)(event);
397
- function callback() {
398
- handleTouchEnd(event);
399
- target?.removeEventListener(event.type, callback);
400
- }
401
- target?.addEventListener(event.type, callback);
394
+ addTargetEventListenerOnce(event, handleTouchEnd);
402
395
  }
403
396
  const doc = (0, _owner.ownerDocument)(floatingElement);
404
- if (escapeKey) {
405
- doc.addEventListener('keydown', closeOnEscapeKeyDown);
406
- doc.addEventListener('compositionstart', handleCompositionStart);
407
- doc.addEventListener('compositionend', handleCompositionEnd);
408
- }
409
- if (outsidePressEnabled) {
410
- doc.addEventListener('click', closeOnPressOutsideCapture, true);
411
- doc.addEventListener('pointerdown', closeOnPressOutsideCapture, true);
412
- doc.addEventListener('pointerup', handlePressEndCapture, true);
413
- doc.addEventListener('pointercancel', handlePressEndCapture, true);
414
- doc.addEventListener('mousedown', closeOnPressOutsideCapture, true);
415
- doc.addEventListener('mouseup', handlePressEndCapture, true);
416
- doc.addEventListener('touchstart', handleTouchStartCapture, true);
417
- doc.addEventListener('touchmove', handleTouchMoveCapture, true);
418
- doc.addEventListener('touchend', handleTouchEndCapture, true);
419
- }
397
+ const unsubscribe = (0, _mergeCleanups.mergeCleanups)(escapeKey && (0, _mergeCleanups.mergeCleanups)((0, _addEventListener.addEventListener)(doc, 'keydown', closeOnEscapeKeyDown), (0, _addEventListener.addEventListener)(doc, 'compositionstart', handleCompositionStart), (0, _addEventListener.addEventListener)(doc, 'compositionend', handleCompositionEnd)), outsidePressEnabled && (0, _mergeCleanups.mergeCleanups)((0, _addEventListener.addEventListener)(doc, 'click', closeOnPressOutsideCapture, true), (0, _addEventListener.addEventListener)(doc, 'pointerdown', closeOnPressOutsideCapture, true), (0, _addEventListener.addEventListener)(doc, 'pointerup', handlePressEndCapture, true), (0, _addEventListener.addEventListener)(doc, 'pointercancel', handlePressEndCapture, true), (0, _addEventListener.addEventListener)(doc, 'mousedown', closeOnPressOutsideCapture, true), (0, _addEventListener.addEventListener)(doc, 'mouseup', handlePressEndCapture, true), (0, _addEventListener.addEventListener)(doc, 'touchstart', handleTouchStartCapture, true), (0, _addEventListener.addEventListener)(doc, 'touchmove', handleTouchMoveCapture, true), (0, _addEventListener.addEventListener)(doc, 'touchend', handleTouchEndCapture, true)));
420
398
  return () => {
421
- if (escapeKey) {
422
- doc.removeEventListener('keydown', closeOnEscapeKeyDown);
423
- doc.removeEventListener('compositionstart', handleCompositionStart);
424
- doc.removeEventListener('compositionend', handleCompositionEnd);
425
- }
426
- if (outsidePressEnabled) {
427
- doc.removeEventListener('click', closeOnPressOutsideCapture, true);
428
- doc.removeEventListener('pointerdown', closeOnPressOutsideCapture, true);
429
- doc.removeEventListener('pointerup', handlePressEndCapture, true);
430
- doc.removeEventListener('pointercancel', handlePressEndCapture, true);
431
- doc.removeEventListener('mousedown', closeOnPressOutsideCapture, true);
432
- doc.removeEventListener('mouseup', handlePressEndCapture, true);
433
- doc.removeEventListener('touchstart', handleTouchStartCapture, true);
434
- doc.removeEventListener('touchmove', handleTouchMoveCapture, true);
435
- doc.removeEventListener('touchend', handleTouchEndCapture, true);
436
- }
399
+ unsubscribe();
437
400
  compositionTimeout.clear();
438
401
  preventedPressSuppressionTimeout.clear();
439
402
  resetPressStartState();
@@ -462,10 +425,10 @@ function useDismiss(context, props = {}) {
462
425
  if (!open || !enabled || event.button !== 0) {
463
426
  return;
464
427
  }
465
- const target = (0, _utils.getTarget)(event.nativeEvent);
428
+ const target = (0, _element.getTarget)(event.nativeEvent);
466
429
  // Only treat presses that start within the floating DOM subtree as inside.
467
430
  // This avoids suppressing parent dismissal when interacting with nested portals.
468
- if (!(0, _utils.contains)(store.select('floatingElement'), target)) {
431
+ if (!(0, _element.contains)(store.select('floatingElement'), target)) {
469
432
  return;
470
433
  }
471
434
  if (!pressStartedInsideRef.current) {
@@ -56,10 +56,11 @@ function useFloating(options = {}) {
56
56
  setPositionReferenceRaw(computedPositionReference);
57
57
  position.refs.setReference(computedPositionReference);
58
58
  }, [position.refs]);
59
- const [localDomReference, setLocalDomReference] = React.useState(null);
59
+ const [localDomReference, setLocalDomReference] = React.useState(undefined);
60
60
  const [localFloatingElement, setLocalFloatingElement] = React.useState(null);
61
- rootContext.useSyncedValue('referenceElement', localDomReference);
62
- rootContext.useSyncedValue('domReferenceElement', (0, _dom.isElement)(localDomReference) ? localDomReference : null);
61
+ rootContext.useSyncedValue('referenceElement', localDomReference ?? null);
62
+ const localDomReferenceElement = (0, _dom.isElement)(localDomReference) ? localDomReference : null;
63
+ rootContext.useSyncedValue('domReferenceElement', localDomReference === undefined ? rootContextElements.domReference : localDomReferenceElement);
63
64
  rootContext.useSyncedValue('floatingElement', localFloatingElement);
64
65
  const setReference = React.useCallback(node => {
65
66
  if ((0, _dom.isElement)(node) || node === null) {
@@ -28,13 +28,14 @@ function useFloatingRootContext(options) {
28
28
  }
29
29
  const store = (0, _useRefWithInit.useRefWithInit)(() => new _FloatingRootStore.FloatingRootStore({
30
30
  open,
31
+ transitionStatus: undefined,
31
32
  onOpenChange,
32
33
  referenceElement: elements.reference ?? null,
33
34
  floatingElement: elements.floating ?? null,
34
35
  triggerElements: new _popups.PopupTriggerMap(),
35
36
  floatingId,
36
- nested,
37
- noEmit: false
37
+ syncOnly: false,
38
+ nested
38
39
  })).current;
39
40
  (0, _useIsoLayoutEffect.useIsoLayoutEffect)(() => {
40
41
  const valuesToSync = {
@@ -54,6 +55,5 @@ function useFloatingRootContext(options) {
54
55
  }, [open, floatingId, elements.reference, elements.floating, store]);
55
56
  store.context.onOpenChange = onOpenChange;
56
57
  store.context.nested = nested;
57
- store.context.noEmit = false;
58
58
  return store;
59
59
  }