react-aria 3.50.0 → 3.51.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 (1178) hide show
  1. package/dist/exports/index.cjs +15 -0
  2. package/dist/exports/index.cjs.map +1 -1
  3. package/dist/exports/index.js +9 -1
  4. package/dist/exports/index.js.map +1 -1
  5. package/dist/exports/index.mjs +9 -1
  6. package/dist/exports/index.mjs.map +1 -1
  7. package/dist/exports/private/utils/domHelpers.cjs +1 -0
  8. package/dist/exports/private/utils/domHelpers.cjs.map +1 -1
  9. package/dist/exports/private/utils/domHelpers.js +2 -2
  10. package/dist/exports/private/utils/domHelpers.js.map +1 -1
  11. package/dist/exports/private/utils/domHelpers.mjs +2 -2
  12. package/dist/exports/private/utils/domHelpers.mjs.map +1 -1
  13. package/dist/exports/private/utils/platform.cjs +1 -0
  14. package/dist/exports/private/utils/platform.cjs.map +1 -1
  15. package/dist/exports/private/utils/platform.js +2 -2
  16. package/dist/exports/private/utils/platform.js.map +1 -1
  17. package/dist/exports/private/utils/platform.mjs +2 -2
  18. package/dist/exports/private/utils/platform.mjs.map +1 -1
  19. package/dist/exports/private/utils/shadowdom/DOMFunctions.cjs +1 -0
  20. package/dist/exports/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
  21. package/dist/exports/private/utils/shadowdom/DOMFunctions.js +2 -2
  22. package/dist/exports/private/utils/shadowdom/DOMFunctions.js.map +1 -1
  23. package/dist/exports/private/utils/shadowdom/DOMFunctions.mjs +2 -2
  24. package/dist/exports/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
  25. package/dist/exports/useContextMenu.cjs +22 -0
  26. package/dist/exports/useContextMenu.cjs.map +1 -0
  27. package/dist/exports/useContextMenu.js +17 -0
  28. package/dist/exports/useContextMenu.js.map +1 -0
  29. package/dist/exports/useContextMenu.mjs +17 -0
  30. package/dist/exports/useContextMenu.mjs.map +1 -0
  31. package/dist/exports/usePreviewTrigger.cjs +22 -0
  32. package/dist/exports/usePreviewTrigger.cjs.map +1 -0
  33. package/dist/exports/usePreviewTrigger.js +17 -0
  34. package/dist/exports/usePreviewTrigger.js.map +1 -0
  35. package/dist/exports/usePreviewTrigger.mjs +17 -0
  36. package/dist/exports/usePreviewTrigger.mjs.map +1 -0
  37. package/dist/exports/useTokenField.cjs +27 -0
  38. package/dist/exports/useTokenField.cjs.map +1 -0
  39. package/dist/exports/useTokenField.js +19 -0
  40. package/dist/exports/useTokenField.js.map +1 -0
  41. package/dist/exports/useTokenField.mjs +19 -0
  42. package/dist/exports/useTokenField.mjs.map +1 -0
  43. package/dist/private/actiongroup/useActionGroup.cjs +24 -19
  44. package/dist/private/actiongroup/useActionGroup.cjs.map +1 -1
  45. package/dist/private/actiongroup/useActionGroup.js +24 -19
  46. package/dist/private/actiongroup/useActionGroup.js.map +1 -1
  47. package/dist/private/actiongroup/useActionGroup.mjs +24 -19
  48. package/dist/private/actiongroup/useActionGroup.mjs.map +1 -1
  49. package/dist/private/autocomplete/useAutocomplete.cjs +2 -1
  50. package/dist/private/autocomplete/useAutocomplete.cjs.map +1 -1
  51. package/dist/private/autocomplete/useAutocomplete.js +2 -1
  52. package/dist/private/autocomplete/useAutocomplete.js.map +1 -1
  53. package/dist/private/autocomplete/useAutocomplete.mjs +2 -1
  54. package/dist/private/autocomplete/useAutocomplete.mjs.map +1 -1
  55. package/dist/private/breadcrumbs/useBreadcrumbItem.cjs +2 -0
  56. package/dist/private/breadcrumbs/useBreadcrumbItem.cjs.map +1 -1
  57. package/dist/private/breadcrumbs/useBreadcrumbItem.js +2 -0
  58. package/dist/private/breadcrumbs/useBreadcrumbItem.js.map +1 -1
  59. package/dist/private/breadcrumbs/useBreadcrumbItem.mjs +2 -0
  60. package/dist/private/breadcrumbs/useBreadcrumbItem.mjs.map +1 -1
  61. package/dist/private/button/useButton.cjs +2 -1
  62. package/dist/private/button/useButton.cjs.map +1 -1
  63. package/dist/private/button/useButton.js +2 -1
  64. package/dist/private/button/useButton.js.map +1 -1
  65. package/dist/private/button/useButton.mjs +2 -1
  66. package/dist/private/button/useButton.mjs.map +1 -1
  67. package/dist/private/button/useToggleButtonGroup.cjs +3 -0
  68. package/dist/private/button/useToggleButtonGroup.cjs.map +1 -1
  69. package/dist/private/button/useToggleButtonGroup.js +3 -0
  70. package/dist/private/button/useToggleButtonGroup.js.map +1 -1
  71. package/dist/private/button/useToggleButtonGroup.mjs +3 -0
  72. package/dist/private/button/useToggleButtonGroup.mjs.map +1 -1
  73. package/dist/private/calendar/useCalendarCell.cjs +3 -0
  74. package/dist/private/calendar/useCalendarCell.cjs.map +1 -1
  75. package/dist/private/calendar/useCalendarCell.js +3 -0
  76. package/dist/private/calendar/useCalendarCell.js.map +1 -1
  77. package/dist/private/calendar/useCalendarCell.mjs +3 -0
  78. package/dist/private/calendar/useCalendarCell.mjs.map +1 -1
  79. package/dist/private/calendar/useCalendarGrid.cjs +47 -52
  80. package/dist/private/calendar/useCalendarGrid.cjs.map +1 -1
  81. package/dist/private/calendar/useCalendarGrid.js +47 -52
  82. package/dist/private/calendar/useCalendarGrid.js.map +1 -1
  83. package/dist/private/calendar/useCalendarGrid.mjs +47 -52
  84. package/dist/private/calendar/useCalendarGrid.mjs.map +1 -1
  85. package/dist/private/calendar/useRangeCalendar.cjs +1 -0
  86. package/dist/private/calendar/useRangeCalendar.cjs.map +1 -1
  87. package/dist/private/calendar/useRangeCalendar.js +1 -0
  88. package/dist/private/calendar/useRangeCalendar.js.map +1 -1
  89. package/dist/private/calendar/useRangeCalendar.mjs +1 -0
  90. package/dist/private/calendar/useRangeCalendar.mjs.map +1 -1
  91. package/dist/private/collections/CollectionBuilder.cjs +8 -3
  92. package/dist/private/collections/CollectionBuilder.cjs.map +1 -1
  93. package/dist/private/collections/CollectionBuilder.js +8 -3
  94. package/dist/private/collections/CollectionBuilder.js.map +1 -1
  95. package/dist/private/collections/CollectionBuilder.mjs +8 -3
  96. package/dist/private/collections/CollectionBuilder.mjs.map +1 -1
  97. package/dist/private/collections/Document.cjs +4 -0
  98. package/dist/private/collections/Document.cjs.map +1 -1
  99. package/dist/private/collections/Document.js +4 -0
  100. package/dist/private/collections/Document.js.map +1 -1
  101. package/dist/private/collections/Document.mjs +4 -0
  102. package/dist/private/collections/Document.mjs.map +1 -1
  103. package/dist/private/collections/Hidden.cjs +1 -0
  104. package/dist/private/collections/Hidden.cjs.map +1 -1
  105. package/dist/private/collections/Hidden.js +1 -0
  106. package/dist/private/collections/Hidden.js.map +1 -1
  107. package/dist/private/collections/Hidden.mjs +1 -0
  108. package/dist/private/collections/Hidden.mjs.map +1 -1
  109. package/dist/private/collections/useCachedChildren.cjs +1 -0
  110. package/dist/private/collections/useCachedChildren.cjs.map +1 -1
  111. package/dist/private/collections/useCachedChildren.js +1 -0
  112. package/dist/private/collections/useCachedChildren.js.map +1 -1
  113. package/dist/private/collections/useCachedChildren.mjs +1 -0
  114. package/dist/private/collections/useCachedChildren.mjs.map +1 -1
  115. package/dist/private/color/useColorArea.cjs +31 -34
  116. package/dist/private/color/useColorArea.cjs.map +1 -1
  117. package/dist/private/color/useColorArea.js +31 -34
  118. package/dist/private/color/useColorArea.js.map +1 -1
  119. package/dist/private/color/useColorArea.mjs +31 -34
  120. package/dist/private/color/useColorArea.mjs.map +1 -1
  121. package/dist/private/color/useColorSlider.cjs +4 -2
  122. package/dist/private/color/useColorSlider.cjs.map +1 -1
  123. package/dist/private/color/useColorSlider.js +4 -2
  124. package/dist/private/color/useColorSlider.js.map +1 -1
  125. package/dist/private/color/useColorSlider.mjs +4 -2
  126. package/dist/private/color/useColorSlider.mjs.map +1 -1
  127. package/dist/private/color/useColorWheel.cjs +16 -23
  128. package/dist/private/color/useColorWheel.cjs.map +1 -1
  129. package/dist/private/color/useColorWheel.js +16 -23
  130. package/dist/private/color/useColorWheel.js.map +1 -1
  131. package/dist/private/color/useColorWheel.mjs +16 -23
  132. package/dist/private/color/useColorWheel.mjs.map +1 -1
  133. package/dist/private/combobox/useComboBox.cjs +92 -29
  134. package/dist/private/combobox/useComboBox.cjs.map +1 -1
  135. package/dist/private/combobox/useComboBox.js +93 -29
  136. package/dist/private/combobox/useComboBox.js.map +1 -1
  137. package/dist/private/combobox/useComboBox.mjs +92 -29
  138. package/dist/private/combobox/useComboBox.mjs.map +1 -1
  139. package/dist/private/datepicker/useDateField.cjs +3 -6
  140. package/dist/private/datepicker/useDateField.cjs.map +1 -1
  141. package/dist/private/datepicker/useDateField.js +3 -6
  142. package/dist/private/datepicker/useDateField.js.map +1 -1
  143. package/dist/private/datepicker/useDateField.mjs +3 -6
  144. package/dist/private/datepicker/useDateField.mjs.map +1 -1
  145. package/dist/private/datepicker/useDatePickerGroup.cjs +48 -27
  146. package/dist/private/datepicker/useDatePickerGroup.cjs.map +1 -1
  147. package/dist/private/datepicker/useDatePickerGroup.js +49 -28
  148. package/dist/private/datepicker/useDatePickerGroup.js.map +1 -1
  149. package/dist/private/datepicker/useDatePickerGroup.mjs +49 -28
  150. package/dist/private/datepicker/useDatePickerGroup.mjs.map +1 -1
  151. package/dist/private/datepicker/useDateSegment.cjs +21 -16
  152. package/dist/private/datepicker/useDateSegment.cjs.map +1 -1
  153. package/dist/private/datepicker/useDateSegment.js +22 -17
  154. package/dist/private/datepicker/useDateSegment.js.map +1 -1
  155. package/dist/private/datepicker/useDateSegment.mjs +22 -17
  156. package/dist/private/datepicker/useDateSegment.mjs.map +1 -1
  157. package/dist/private/dialog/useDialog.cjs +8 -1
  158. package/dist/private/dialog/useDialog.cjs.map +1 -1
  159. package/dist/private/dialog/useDialog.js +10 -1
  160. package/dist/private/dialog/useDialog.js.map +1 -1
  161. package/dist/private/dialog/useDialog.mjs +8 -1
  162. package/dist/private/dialog/useDialog.mjs.map +1 -1
  163. package/dist/private/dnd/DragManager.cjs +3 -1
  164. package/dist/private/dnd/DragManager.cjs.map +1 -1
  165. package/dist/private/dnd/DragManager.js +3 -1
  166. package/dist/private/dnd/DragManager.js.map +1 -1
  167. package/dist/private/dnd/DragManager.mjs +3 -1
  168. package/dist/private/dnd/DragManager.mjs.map +1 -1
  169. package/dist/private/dnd/useAutoScroll.cjs +3 -1
  170. package/dist/private/dnd/useAutoScroll.cjs.map +1 -1
  171. package/dist/private/dnd/useAutoScroll.js +3 -1
  172. package/dist/private/dnd/useAutoScroll.js.map +1 -1
  173. package/dist/private/dnd/useAutoScroll.mjs +3 -1
  174. package/dist/private/dnd/useAutoScroll.mjs.map +1 -1
  175. package/dist/private/dnd/useDrag.cjs +4 -1
  176. package/dist/private/dnd/useDrag.cjs.map +1 -1
  177. package/dist/private/dnd/useDrag.js +4 -1
  178. package/dist/private/dnd/useDrag.js.map +1 -1
  179. package/dist/private/dnd/useDrag.mjs +4 -1
  180. package/dist/private/dnd/useDrag.mjs.map +1 -1
  181. package/dist/private/dnd/useDraggableItem.cjs +4 -0
  182. package/dist/private/dnd/useDraggableItem.cjs.map +1 -1
  183. package/dist/private/dnd/useDraggableItem.js +4 -0
  184. package/dist/private/dnd/useDraggableItem.js.map +1 -1
  185. package/dist/private/dnd/useDraggableItem.mjs +4 -0
  186. package/dist/private/dnd/useDraggableItem.mjs.map +1 -1
  187. package/dist/private/dnd/useDroppableCollection.cjs +4 -0
  188. package/dist/private/dnd/useDroppableCollection.cjs.map +1 -1
  189. package/dist/private/dnd/useDroppableCollection.js +4 -0
  190. package/dist/private/dnd/useDroppableCollection.js.map +1 -1
  191. package/dist/private/dnd/useDroppableCollection.mjs +4 -0
  192. package/dist/private/dnd/useDroppableCollection.mjs.map +1 -1
  193. package/dist/private/focus/FocusScope.cjs +5 -3
  194. package/dist/private/focus/FocusScope.cjs.map +1 -1
  195. package/dist/private/focus/FocusScope.js +5 -4
  196. package/dist/private/focus/FocusScope.js.map +1 -1
  197. package/dist/private/focus/FocusScope.mjs +5 -3
  198. package/dist/private/focus/FocusScope.mjs.map +1 -1
  199. package/dist/private/focus/useFocusRing.cjs +2 -1
  200. package/dist/private/focus/useFocusRing.cjs.map +1 -1
  201. package/dist/private/focus/useFocusRing.js +2 -1
  202. package/dist/private/focus/useFocusRing.js.map +1 -1
  203. package/dist/private/focus/useFocusRing.mjs +2 -1
  204. package/dist/private/focus/useFocusRing.mjs.map +1 -1
  205. package/dist/private/form/useFormValidation.cjs +6 -0
  206. package/dist/private/form/useFormValidation.cjs.map +1 -1
  207. package/dist/private/form/useFormValidation.js +6 -0
  208. package/dist/private/form/useFormValidation.js.map +1 -1
  209. package/dist/private/form/useFormValidation.mjs +6 -0
  210. package/dist/private/form/useFormValidation.mjs.map +1 -1
  211. package/dist/private/grid/useGrid.cjs +3 -2
  212. package/dist/private/grid/useGrid.cjs.map +1 -1
  213. package/dist/private/grid/useGrid.js +3 -2
  214. package/dist/private/grid/useGrid.js.map +1 -1
  215. package/dist/private/grid/useGrid.mjs +3 -2
  216. package/dist/private/grid/useGrid.mjs.map +1 -1
  217. package/dist/private/grid/useGridCell.cjs +44 -8
  218. package/dist/private/grid/useGridCell.cjs.map +1 -1
  219. package/dist/private/grid/useGridCell.js +44 -8
  220. package/dist/private/grid/useGridCell.js.map +1 -1
  221. package/dist/private/grid/useGridCell.mjs +44 -8
  222. package/dist/private/grid/useGridCell.mjs.map +1 -1
  223. package/dist/private/grid/utils.cjs.map +1 -1
  224. package/dist/private/grid/utils.js.map +1 -1
  225. package/dist/private/grid/utils.mjs.map +1 -1
  226. package/dist/private/gridlist/useGridListItem.cjs +38 -30
  227. package/dist/private/gridlist/useGridListItem.cjs.map +1 -1
  228. package/dist/private/gridlist/useGridListItem.js +38 -30
  229. package/dist/private/gridlist/useGridListItem.js.map +1 -1
  230. package/dist/private/gridlist/useGridListItem.mjs +38 -30
  231. package/dist/private/gridlist/useGridListItem.mjs.map +1 -1
  232. package/dist/private/interactions/PressResponder.cjs +1 -0
  233. package/dist/private/interactions/PressResponder.cjs.map +1 -1
  234. package/dist/private/interactions/PressResponder.js +1 -0
  235. package/dist/private/interactions/PressResponder.js.map +1 -1
  236. package/dist/private/interactions/PressResponder.mjs +1 -0
  237. package/dist/private/interactions/PressResponder.mjs.map +1 -1
  238. package/dist/private/interactions/Pressable.cjs +1 -0
  239. package/dist/private/interactions/Pressable.cjs.map +1 -1
  240. package/dist/private/interactions/Pressable.js +1 -0
  241. package/dist/private/interactions/Pressable.js.map +1 -1
  242. package/dist/private/interactions/Pressable.mjs +1 -0
  243. package/dist/private/interactions/Pressable.mjs.map +1 -1
  244. package/dist/private/interactions/createEventHandler.cjs +3 -2
  245. package/dist/private/interactions/createEventHandler.cjs.map +1 -1
  246. package/dist/private/interactions/createEventHandler.js +3 -2
  247. package/dist/private/interactions/createEventHandler.js.map +1 -1
  248. package/dist/private/interactions/createEventHandler.mjs +3 -2
  249. package/dist/private/interactions/createEventHandler.mjs.map +1 -1
  250. package/dist/private/interactions/createKeyboardShortcutHandler.cjs +130 -0
  251. package/dist/private/interactions/createKeyboardShortcutHandler.cjs.map +1 -0
  252. package/dist/private/interactions/createKeyboardShortcutHandler.js +125 -0
  253. package/dist/private/interactions/createKeyboardShortcutHandler.js.map +1 -0
  254. package/dist/private/interactions/createKeyboardShortcutHandler.mjs +125 -0
  255. package/dist/private/interactions/createKeyboardShortcutHandler.mjs.map +1 -0
  256. package/dist/private/interactions/textSelection.cjs +2 -2
  257. package/dist/private/interactions/textSelection.cjs.map +1 -1
  258. package/dist/private/interactions/textSelection.js +3 -3
  259. package/dist/private/interactions/textSelection.js.map +1 -1
  260. package/dist/private/interactions/textSelection.mjs +3 -3
  261. package/dist/private/interactions/textSelection.mjs.map +1 -1
  262. package/dist/private/interactions/useContextMenu.cjs +104 -0
  263. package/dist/private/interactions/useContextMenu.cjs.map +1 -0
  264. package/dist/private/interactions/useContextMenu.js +99 -0
  265. package/dist/private/interactions/useContextMenu.js.map +1 -0
  266. package/dist/private/interactions/useContextMenu.mjs +99 -0
  267. package/dist/private/interactions/useContextMenu.mjs.map +1 -0
  268. package/dist/private/interactions/useFocusVisible.cjs +2 -2
  269. package/dist/private/interactions/useFocusVisible.cjs.map +1 -1
  270. package/dist/private/interactions/useFocusVisible.js +2 -2
  271. package/dist/private/interactions/useFocusVisible.js.map +1 -1
  272. package/dist/private/interactions/useFocusVisible.mjs +2 -2
  273. package/dist/private/interactions/useFocusVisible.mjs.map +1 -1
  274. package/dist/private/interactions/useFocusable.cjs +1 -0
  275. package/dist/private/interactions/useFocusable.cjs.map +1 -1
  276. package/dist/private/interactions/useFocusable.js +1 -0
  277. package/dist/private/interactions/useFocusable.js.map +1 -1
  278. package/dist/private/interactions/useFocusable.mjs +1 -0
  279. package/dist/private/interactions/useFocusable.mjs.map +1 -1
  280. package/dist/private/interactions/useHover.cjs +2 -1
  281. package/dist/private/interactions/useHover.cjs.map +1 -1
  282. package/dist/private/interactions/useHover.js +2 -1
  283. package/dist/private/interactions/useHover.js.map +1 -1
  284. package/dist/private/interactions/useHover.mjs +2 -1
  285. package/dist/private/interactions/useHover.mjs.map +1 -1
  286. package/dist/private/interactions/useKeyboard.cjs +46 -2
  287. package/dist/private/interactions/useKeyboard.cjs.map +1 -1
  288. package/dist/private/interactions/useKeyboard.js +48 -2
  289. package/dist/private/interactions/useKeyboard.js.map +1 -1
  290. package/dist/private/interactions/useKeyboard.mjs +46 -2
  291. package/dist/private/interactions/useKeyboard.mjs.map +1 -1
  292. package/dist/private/interactions/useLongPress.cjs +22 -22
  293. package/dist/private/interactions/useLongPress.cjs.map +1 -1
  294. package/dist/private/interactions/useLongPress.js +22 -22
  295. package/dist/private/interactions/useLongPress.js.map +1 -1
  296. package/dist/private/interactions/useLongPress.mjs +22 -22
  297. package/dist/private/interactions/useLongPress.mjs.map +1 -1
  298. package/dist/private/interactions/useMove.cjs +1 -8
  299. package/dist/private/interactions/useMove.cjs.map +1 -1
  300. package/dist/private/interactions/useMove.js +1 -8
  301. package/dist/private/interactions/useMove.js.map +1 -1
  302. package/dist/private/interactions/useMove.mjs +1 -8
  303. package/dist/private/interactions/useMove.mjs.map +1 -1
  304. package/dist/private/interactions/usePress.cjs +18 -33
  305. package/dist/private/interactions/usePress.cjs.map +1 -1
  306. package/dist/private/interactions/usePress.js +18 -33
  307. package/dist/private/interactions/usePress.js.map +1 -1
  308. package/dist/private/interactions/usePress.mjs +18 -33
  309. package/dist/private/interactions/usePress.mjs.map +1 -1
  310. package/dist/private/interactions/utils.cjs +10 -10
  311. package/dist/private/interactions/utils.cjs.map +1 -1
  312. package/dist/private/interactions/utils.js +10 -10
  313. package/dist/private/interactions/utils.js.map +1 -1
  314. package/dist/private/interactions/utils.mjs +10 -10
  315. package/dist/private/interactions/utils.mjs.map +1 -1
  316. package/dist/private/intl/combobox/fi-FI.cjs +5 -5
  317. package/dist/private/intl/combobox/fi-FI.cjs.map +1 -1
  318. package/dist/private/intl/combobox/fi-FI.js +5 -5
  319. package/dist/private/intl/combobox/fi-FI.js.map +1 -1
  320. package/dist/private/intl/combobox/fi-FI.mjs +5 -5
  321. package/dist/private/intl/combobox/fi-FI.mjs.map +1 -1
  322. package/dist/private/intl/previewtrigger/ar-AE.cjs +6 -0
  323. package/dist/private/intl/previewtrigger/ar-AE.cjs.map +1 -0
  324. package/dist/private/intl/previewtrigger/ar-AE.js +8 -0
  325. package/dist/private/intl/previewtrigger/ar-AE.js.map +1 -0
  326. package/dist/private/intl/previewtrigger/ar-AE.mjs +8 -0
  327. package/dist/private/intl/previewtrigger/ar-AE.mjs.map +1 -0
  328. package/dist/private/intl/previewtrigger/bg-BG.cjs +6 -0
  329. package/dist/private/intl/previewtrigger/bg-BG.cjs.map +1 -0
  330. package/dist/private/intl/previewtrigger/bg-BG.js +8 -0
  331. package/dist/private/intl/previewtrigger/bg-BG.js.map +1 -0
  332. package/dist/private/intl/previewtrigger/bg-BG.mjs +8 -0
  333. package/dist/private/intl/previewtrigger/bg-BG.mjs.map +1 -0
  334. package/dist/private/intl/previewtrigger/cs-CZ.cjs +6 -0
  335. package/dist/private/intl/previewtrigger/cs-CZ.cjs.map +1 -0
  336. package/dist/private/intl/previewtrigger/cs-CZ.js +8 -0
  337. package/dist/private/intl/previewtrigger/cs-CZ.js.map +1 -0
  338. package/dist/private/intl/previewtrigger/cs-CZ.mjs +8 -0
  339. package/dist/private/intl/previewtrigger/cs-CZ.mjs.map +1 -0
  340. package/dist/private/intl/previewtrigger/da-DK.cjs +6 -0
  341. package/dist/private/intl/previewtrigger/da-DK.cjs.map +1 -0
  342. package/dist/private/intl/previewtrigger/da-DK.js +8 -0
  343. package/dist/private/intl/previewtrigger/da-DK.js.map +1 -0
  344. package/dist/private/intl/previewtrigger/da-DK.mjs +8 -0
  345. package/dist/private/intl/previewtrigger/da-DK.mjs.map +1 -0
  346. package/dist/private/intl/previewtrigger/de-DE.cjs +6 -0
  347. package/dist/private/intl/previewtrigger/de-DE.cjs.map +1 -0
  348. package/dist/private/intl/previewtrigger/de-DE.js +8 -0
  349. package/dist/private/intl/previewtrigger/de-DE.js.map +1 -0
  350. package/dist/private/intl/previewtrigger/de-DE.mjs +8 -0
  351. package/dist/private/intl/previewtrigger/de-DE.mjs.map +1 -0
  352. package/dist/private/intl/previewtrigger/el-GR.cjs +6 -0
  353. package/dist/private/intl/previewtrigger/el-GR.cjs.map +1 -0
  354. package/dist/private/intl/previewtrigger/el-GR.js +8 -0
  355. package/dist/private/intl/previewtrigger/el-GR.js.map +1 -0
  356. package/dist/private/intl/previewtrigger/el-GR.mjs +8 -0
  357. package/dist/private/intl/previewtrigger/el-GR.mjs.map +1 -0
  358. package/dist/private/intl/previewtrigger/en-US.cjs +6 -0
  359. package/dist/private/intl/previewtrigger/en-US.cjs.map +1 -0
  360. package/dist/private/intl/previewtrigger/en-US.js +8 -0
  361. package/dist/private/intl/previewtrigger/en-US.js.map +1 -0
  362. package/dist/private/intl/previewtrigger/en-US.mjs +8 -0
  363. package/dist/private/intl/previewtrigger/en-US.mjs.map +1 -0
  364. package/dist/private/intl/previewtrigger/es-ES.cjs +6 -0
  365. package/dist/private/intl/previewtrigger/es-ES.cjs.map +1 -0
  366. package/dist/private/intl/previewtrigger/es-ES.js +8 -0
  367. package/dist/private/intl/previewtrigger/es-ES.js.map +1 -0
  368. package/dist/private/intl/previewtrigger/es-ES.mjs +8 -0
  369. package/dist/private/intl/previewtrigger/es-ES.mjs.map +1 -0
  370. package/dist/private/intl/previewtrigger/et-EE.cjs +6 -0
  371. package/dist/private/intl/previewtrigger/et-EE.cjs.map +1 -0
  372. package/dist/private/intl/previewtrigger/et-EE.js +8 -0
  373. package/dist/private/intl/previewtrigger/et-EE.js.map +1 -0
  374. package/dist/private/intl/previewtrigger/et-EE.mjs +8 -0
  375. package/dist/private/intl/previewtrigger/et-EE.mjs.map +1 -0
  376. package/dist/private/intl/previewtrigger/fi-FI.cjs +6 -0
  377. package/dist/private/intl/previewtrigger/fi-FI.cjs.map +1 -0
  378. package/dist/private/intl/previewtrigger/fi-FI.js +8 -0
  379. package/dist/private/intl/previewtrigger/fi-FI.js.map +1 -0
  380. package/dist/private/intl/previewtrigger/fi-FI.mjs +8 -0
  381. package/dist/private/intl/previewtrigger/fi-FI.mjs.map +1 -0
  382. package/dist/private/intl/previewtrigger/fr-FR.cjs +6 -0
  383. package/dist/private/intl/previewtrigger/fr-FR.cjs.map +1 -0
  384. package/dist/private/intl/previewtrigger/fr-FR.js +8 -0
  385. package/dist/private/intl/previewtrigger/fr-FR.js.map +1 -0
  386. package/dist/private/intl/previewtrigger/fr-FR.mjs +8 -0
  387. package/dist/private/intl/previewtrigger/fr-FR.mjs.map +1 -0
  388. package/dist/private/intl/previewtrigger/he-IL.cjs +6 -0
  389. package/dist/private/intl/previewtrigger/he-IL.cjs.map +1 -0
  390. package/dist/private/intl/previewtrigger/he-IL.js +8 -0
  391. package/dist/private/intl/previewtrigger/he-IL.js.map +1 -0
  392. package/dist/private/intl/previewtrigger/he-IL.mjs +8 -0
  393. package/dist/private/intl/previewtrigger/he-IL.mjs.map +1 -0
  394. package/dist/private/intl/previewtrigger/hr-HR.cjs +6 -0
  395. package/dist/private/intl/previewtrigger/hr-HR.cjs.map +1 -0
  396. package/dist/private/intl/previewtrigger/hr-HR.js +8 -0
  397. package/dist/private/intl/previewtrigger/hr-HR.js.map +1 -0
  398. package/dist/private/intl/previewtrigger/hr-HR.mjs +8 -0
  399. package/dist/private/intl/previewtrigger/hr-HR.mjs.map +1 -0
  400. package/dist/private/intl/previewtrigger/hu-HU.cjs +6 -0
  401. package/dist/private/intl/previewtrigger/hu-HU.cjs.map +1 -0
  402. package/dist/private/intl/previewtrigger/hu-HU.js +8 -0
  403. package/dist/private/intl/previewtrigger/hu-HU.js.map +1 -0
  404. package/dist/private/intl/previewtrigger/hu-HU.mjs +8 -0
  405. package/dist/private/intl/previewtrigger/hu-HU.mjs.map +1 -0
  406. package/dist/private/intl/previewtrigger/it-IT.cjs +6 -0
  407. package/dist/private/intl/previewtrigger/it-IT.cjs.map +1 -0
  408. package/dist/private/intl/previewtrigger/it-IT.js +8 -0
  409. package/dist/private/intl/previewtrigger/it-IT.js.map +1 -0
  410. package/dist/private/intl/previewtrigger/it-IT.mjs +8 -0
  411. package/dist/private/intl/previewtrigger/it-IT.mjs.map +1 -0
  412. package/dist/private/intl/previewtrigger/ja-JP.cjs +6 -0
  413. package/dist/private/intl/previewtrigger/ja-JP.cjs.map +1 -0
  414. package/dist/private/intl/previewtrigger/ja-JP.js +8 -0
  415. package/dist/private/intl/previewtrigger/ja-JP.js.map +1 -0
  416. package/dist/private/intl/previewtrigger/ja-JP.mjs +8 -0
  417. package/dist/private/intl/previewtrigger/ja-JP.mjs.map +1 -0
  418. package/dist/private/intl/previewtrigger/ko-KR.cjs +6 -0
  419. package/dist/private/intl/previewtrigger/ko-KR.cjs.map +1 -0
  420. package/dist/private/intl/previewtrigger/ko-KR.js +8 -0
  421. package/dist/private/intl/previewtrigger/ko-KR.js.map +1 -0
  422. package/dist/private/intl/previewtrigger/ko-KR.mjs +8 -0
  423. package/dist/private/intl/previewtrigger/ko-KR.mjs.map +1 -0
  424. package/dist/private/intl/previewtrigger/lt-LT.cjs +6 -0
  425. package/dist/private/intl/previewtrigger/lt-LT.cjs.map +1 -0
  426. package/dist/private/intl/previewtrigger/lt-LT.js +8 -0
  427. package/dist/private/intl/previewtrigger/lt-LT.js.map +1 -0
  428. package/dist/private/intl/previewtrigger/lt-LT.mjs +8 -0
  429. package/dist/private/intl/previewtrigger/lt-LT.mjs.map +1 -0
  430. package/dist/private/intl/previewtrigger/lv-LV.cjs +6 -0
  431. package/dist/private/intl/previewtrigger/lv-LV.cjs.map +1 -0
  432. package/dist/private/intl/previewtrigger/lv-LV.js +8 -0
  433. package/dist/private/intl/previewtrigger/lv-LV.js.map +1 -0
  434. package/dist/private/intl/previewtrigger/lv-LV.mjs +8 -0
  435. package/dist/private/intl/previewtrigger/lv-LV.mjs.map +1 -0
  436. package/dist/private/intl/previewtrigger/nb-NO.cjs +6 -0
  437. package/dist/private/intl/previewtrigger/nb-NO.cjs.map +1 -0
  438. package/dist/private/intl/previewtrigger/nb-NO.js +8 -0
  439. package/dist/private/intl/previewtrigger/nb-NO.js.map +1 -0
  440. package/dist/private/intl/previewtrigger/nb-NO.mjs +8 -0
  441. package/dist/private/intl/previewtrigger/nb-NO.mjs.map +1 -0
  442. package/dist/private/intl/previewtrigger/nl-NL.cjs +6 -0
  443. package/dist/private/intl/previewtrigger/nl-NL.cjs.map +1 -0
  444. package/dist/private/intl/previewtrigger/nl-NL.js +8 -0
  445. package/dist/private/intl/previewtrigger/nl-NL.js.map +1 -0
  446. package/dist/private/intl/previewtrigger/nl-NL.mjs +8 -0
  447. package/dist/private/intl/previewtrigger/nl-NL.mjs.map +1 -0
  448. package/dist/private/intl/previewtrigger/pl-PL.cjs +6 -0
  449. package/dist/private/intl/previewtrigger/pl-PL.cjs.map +1 -0
  450. package/dist/private/intl/previewtrigger/pl-PL.js +8 -0
  451. package/dist/private/intl/previewtrigger/pl-PL.js.map +1 -0
  452. package/dist/private/intl/previewtrigger/pl-PL.mjs +8 -0
  453. package/dist/private/intl/previewtrigger/pl-PL.mjs.map +1 -0
  454. package/dist/private/intl/previewtrigger/pt-BR.cjs +6 -0
  455. package/dist/private/intl/previewtrigger/pt-BR.cjs.map +1 -0
  456. package/dist/private/intl/previewtrigger/pt-BR.js +8 -0
  457. package/dist/private/intl/previewtrigger/pt-BR.js.map +1 -0
  458. package/dist/private/intl/previewtrigger/pt-BR.mjs +8 -0
  459. package/dist/private/intl/previewtrigger/pt-BR.mjs.map +1 -0
  460. package/dist/private/intl/previewtrigger/pt-PT.cjs +6 -0
  461. package/dist/private/intl/previewtrigger/pt-PT.cjs.map +1 -0
  462. package/dist/private/intl/previewtrigger/pt-PT.js +8 -0
  463. package/dist/private/intl/previewtrigger/pt-PT.js.map +1 -0
  464. package/dist/private/intl/previewtrigger/pt-PT.mjs +8 -0
  465. package/dist/private/intl/previewtrigger/pt-PT.mjs.map +1 -0
  466. package/dist/private/intl/previewtrigger/ro-RO.cjs +6 -0
  467. package/dist/private/intl/previewtrigger/ro-RO.cjs.map +1 -0
  468. package/dist/private/intl/previewtrigger/ro-RO.js +8 -0
  469. package/dist/private/intl/previewtrigger/ro-RO.js.map +1 -0
  470. package/dist/private/intl/previewtrigger/ro-RO.mjs +8 -0
  471. package/dist/private/intl/previewtrigger/ro-RO.mjs.map +1 -0
  472. package/dist/private/intl/previewtrigger/ru-RU.cjs +6 -0
  473. package/dist/private/intl/previewtrigger/ru-RU.cjs.map +1 -0
  474. package/dist/private/intl/previewtrigger/ru-RU.js +8 -0
  475. package/dist/private/intl/previewtrigger/ru-RU.js.map +1 -0
  476. package/dist/private/intl/previewtrigger/ru-RU.mjs +8 -0
  477. package/dist/private/intl/previewtrigger/ru-RU.mjs.map +1 -0
  478. package/dist/private/intl/previewtrigger/sk-SK.cjs +6 -0
  479. package/dist/private/intl/previewtrigger/sk-SK.cjs.map +1 -0
  480. package/dist/private/intl/previewtrigger/sk-SK.js +8 -0
  481. package/dist/private/intl/previewtrigger/sk-SK.js.map +1 -0
  482. package/dist/private/intl/previewtrigger/sk-SK.mjs +8 -0
  483. package/dist/private/intl/previewtrigger/sk-SK.mjs.map +1 -0
  484. package/dist/private/intl/previewtrigger/sl-SI.cjs +6 -0
  485. package/dist/private/intl/previewtrigger/sl-SI.cjs.map +1 -0
  486. package/dist/private/intl/previewtrigger/sl-SI.js +8 -0
  487. package/dist/private/intl/previewtrigger/sl-SI.js.map +1 -0
  488. package/dist/private/intl/previewtrigger/sl-SI.mjs +8 -0
  489. package/dist/private/intl/previewtrigger/sl-SI.mjs.map +1 -0
  490. package/dist/private/intl/previewtrigger/sr-SP.cjs +6 -0
  491. package/dist/private/intl/previewtrigger/sr-SP.cjs.map +1 -0
  492. package/dist/private/intl/previewtrigger/sr-SP.js +8 -0
  493. package/dist/private/intl/previewtrigger/sr-SP.js.map +1 -0
  494. package/dist/private/intl/previewtrigger/sr-SP.mjs +8 -0
  495. package/dist/private/intl/previewtrigger/sr-SP.mjs.map +1 -0
  496. package/dist/private/intl/previewtrigger/sv-SE.cjs +6 -0
  497. package/dist/private/intl/previewtrigger/sv-SE.cjs.map +1 -0
  498. package/dist/private/intl/previewtrigger/sv-SE.js +8 -0
  499. package/dist/private/intl/previewtrigger/sv-SE.js.map +1 -0
  500. package/dist/private/intl/previewtrigger/sv-SE.mjs +8 -0
  501. package/dist/private/intl/previewtrigger/sv-SE.mjs.map +1 -0
  502. package/dist/private/intl/previewtrigger/tr-TR.cjs +6 -0
  503. package/dist/private/intl/previewtrigger/tr-TR.cjs.map +1 -0
  504. package/dist/private/intl/previewtrigger/tr-TR.js +8 -0
  505. package/dist/private/intl/previewtrigger/tr-TR.js.map +1 -0
  506. package/dist/private/intl/previewtrigger/tr-TR.mjs +8 -0
  507. package/dist/private/intl/previewtrigger/tr-TR.mjs.map +1 -0
  508. package/dist/private/intl/previewtrigger/uk-UA.cjs +6 -0
  509. package/dist/private/intl/previewtrigger/uk-UA.cjs.map +1 -0
  510. package/dist/private/intl/previewtrigger/uk-UA.js +8 -0
  511. package/dist/private/intl/previewtrigger/uk-UA.js.map +1 -0
  512. package/dist/private/intl/previewtrigger/uk-UA.mjs +8 -0
  513. package/dist/private/intl/previewtrigger/uk-UA.mjs.map +1 -0
  514. package/dist/private/intl/previewtrigger/zh-CN.cjs +6 -0
  515. package/dist/private/intl/previewtrigger/zh-CN.cjs.map +1 -0
  516. package/dist/private/intl/previewtrigger/zh-CN.js +8 -0
  517. package/dist/private/intl/previewtrigger/zh-CN.js.map +1 -0
  518. package/dist/private/intl/previewtrigger/zh-CN.mjs +8 -0
  519. package/dist/private/intl/previewtrigger/zh-CN.mjs.map +1 -0
  520. package/dist/private/intl/previewtrigger/zh-TW.cjs +6 -0
  521. package/dist/private/intl/previewtrigger/zh-TW.cjs.map +1 -0
  522. package/dist/private/intl/previewtrigger/zh-TW.js +8 -0
  523. package/dist/private/intl/previewtrigger/zh-TW.js.map +1 -0
  524. package/dist/private/intl/previewtrigger/zh-TW.mjs +8 -0
  525. package/dist/private/intl/previewtrigger/zh-TW.mjs.map +1 -0
  526. package/dist/private/intl/table/ar-AE.cjs +3 -3
  527. package/dist/private/intl/table/ar-AE.cjs.map +1 -1
  528. package/dist/private/intl/table/ar-AE.js +3 -3
  529. package/dist/private/intl/table/ar-AE.js.map +1 -1
  530. package/dist/private/intl/table/ar-AE.mjs +3 -3
  531. package/dist/private/intl/table/ar-AE.mjs.map +1 -1
  532. package/dist/private/intl/table/bg-BG.cjs +3 -3
  533. package/dist/private/intl/table/bg-BG.cjs.map +1 -1
  534. package/dist/private/intl/table/bg-BG.js +3 -3
  535. package/dist/private/intl/table/bg-BG.js.map +1 -1
  536. package/dist/private/intl/table/bg-BG.mjs +3 -3
  537. package/dist/private/intl/table/bg-BG.mjs.map +1 -1
  538. package/dist/private/intl/table/cs-CZ.cjs +3 -3
  539. package/dist/private/intl/table/cs-CZ.cjs.map +1 -1
  540. package/dist/private/intl/table/cs-CZ.js +3 -3
  541. package/dist/private/intl/table/cs-CZ.js.map +1 -1
  542. package/dist/private/intl/table/cs-CZ.mjs +3 -3
  543. package/dist/private/intl/table/cs-CZ.mjs.map +1 -1
  544. package/dist/private/intl/table/da-DK.cjs +3 -3
  545. package/dist/private/intl/table/da-DK.cjs.map +1 -1
  546. package/dist/private/intl/table/da-DK.js +3 -3
  547. package/dist/private/intl/table/da-DK.js.map +1 -1
  548. package/dist/private/intl/table/da-DK.mjs +3 -3
  549. package/dist/private/intl/table/da-DK.mjs.map +1 -1
  550. package/dist/private/intl/table/de-DE.cjs +3 -3
  551. package/dist/private/intl/table/de-DE.cjs.map +1 -1
  552. package/dist/private/intl/table/de-DE.js +3 -3
  553. package/dist/private/intl/table/de-DE.js.map +1 -1
  554. package/dist/private/intl/table/de-DE.mjs +3 -3
  555. package/dist/private/intl/table/de-DE.mjs.map +1 -1
  556. package/dist/private/intl/table/el-GR.cjs +3 -3
  557. package/dist/private/intl/table/el-GR.cjs.map +1 -1
  558. package/dist/private/intl/table/el-GR.js +3 -3
  559. package/dist/private/intl/table/el-GR.js.map +1 -1
  560. package/dist/private/intl/table/el-GR.mjs +3 -3
  561. package/dist/private/intl/table/el-GR.mjs.map +1 -1
  562. package/dist/private/intl/table/es-ES.cjs +3 -3
  563. package/dist/private/intl/table/es-ES.cjs.map +1 -1
  564. package/dist/private/intl/table/es-ES.js +3 -3
  565. package/dist/private/intl/table/es-ES.js.map +1 -1
  566. package/dist/private/intl/table/es-ES.mjs +3 -3
  567. package/dist/private/intl/table/es-ES.mjs.map +1 -1
  568. package/dist/private/intl/table/et-EE.cjs +3 -3
  569. package/dist/private/intl/table/et-EE.cjs.map +1 -1
  570. package/dist/private/intl/table/et-EE.js +3 -3
  571. package/dist/private/intl/table/et-EE.js.map +1 -1
  572. package/dist/private/intl/table/et-EE.mjs +3 -3
  573. package/dist/private/intl/table/et-EE.mjs.map +1 -1
  574. package/dist/private/intl/table/fi-FI.cjs +3 -3
  575. package/dist/private/intl/table/fi-FI.cjs.map +1 -1
  576. package/dist/private/intl/table/fi-FI.js +3 -3
  577. package/dist/private/intl/table/fi-FI.js.map +1 -1
  578. package/dist/private/intl/table/fi-FI.mjs +3 -3
  579. package/dist/private/intl/table/fi-FI.mjs.map +1 -1
  580. package/dist/private/intl/table/fr-FR.cjs +3 -3
  581. package/dist/private/intl/table/fr-FR.cjs.map +1 -1
  582. package/dist/private/intl/table/fr-FR.js +3 -3
  583. package/dist/private/intl/table/fr-FR.js.map +1 -1
  584. package/dist/private/intl/table/fr-FR.mjs +3 -3
  585. package/dist/private/intl/table/fr-FR.mjs.map +1 -1
  586. package/dist/private/intl/table/he-IL.cjs +3 -3
  587. package/dist/private/intl/table/he-IL.cjs.map +1 -1
  588. package/dist/private/intl/table/he-IL.js +3 -3
  589. package/dist/private/intl/table/he-IL.js.map +1 -1
  590. package/dist/private/intl/table/he-IL.mjs +3 -3
  591. package/dist/private/intl/table/he-IL.mjs.map +1 -1
  592. package/dist/private/intl/table/hr-HR.cjs +3 -3
  593. package/dist/private/intl/table/hr-HR.cjs.map +1 -1
  594. package/dist/private/intl/table/hr-HR.js +3 -3
  595. package/dist/private/intl/table/hr-HR.js.map +1 -1
  596. package/dist/private/intl/table/hr-HR.mjs +3 -3
  597. package/dist/private/intl/table/hr-HR.mjs.map +1 -1
  598. package/dist/private/intl/table/hu-HU.cjs +3 -3
  599. package/dist/private/intl/table/hu-HU.cjs.map +1 -1
  600. package/dist/private/intl/table/hu-HU.js +3 -3
  601. package/dist/private/intl/table/hu-HU.js.map +1 -1
  602. package/dist/private/intl/table/hu-HU.mjs +3 -3
  603. package/dist/private/intl/table/hu-HU.mjs.map +1 -1
  604. package/dist/private/intl/table/it-IT.cjs +3 -3
  605. package/dist/private/intl/table/it-IT.cjs.map +1 -1
  606. package/dist/private/intl/table/it-IT.js +3 -3
  607. package/dist/private/intl/table/it-IT.js.map +1 -1
  608. package/dist/private/intl/table/it-IT.mjs +3 -3
  609. package/dist/private/intl/table/it-IT.mjs.map +1 -1
  610. package/dist/private/intl/table/ja-JP.cjs +3 -3
  611. package/dist/private/intl/table/ja-JP.cjs.map +1 -1
  612. package/dist/private/intl/table/ja-JP.js +3 -3
  613. package/dist/private/intl/table/ja-JP.js.map +1 -1
  614. package/dist/private/intl/table/ja-JP.mjs +3 -3
  615. package/dist/private/intl/table/ja-JP.mjs.map +1 -1
  616. package/dist/private/intl/table/ko-KR.cjs +3 -3
  617. package/dist/private/intl/table/ko-KR.cjs.map +1 -1
  618. package/dist/private/intl/table/ko-KR.js +3 -3
  619. package/dist/private/intl/table/ko-KR.js.map +1 -1
  620. package/dist/private/intl/table/ko-KR.mjs +3 -3
  621. package/dist/private/intl/table/ko-KR.mjs.map +1 -1
  622. package/dist/private/intl/table/lt-LT.cjs +3 -3
  623. package/dist/private/intl/table/lt-LT.cjs.map +1 -1
  624. package/dist/private/intl/table/lt-LT.js +3 -3
  625. package/dist/private/intl/table/lt-LT.js.map +1 -1
  626. package/dist/private/intl/table/lt-LT.mjs +3 -3
  627. package/dist/private/intl/table/lt-LT.mjs.map +1 -1
  628. package/dist/private/intl/table/lv-LV.cjs +3 -3
  629. package/dist/private/intl/table/lv-LV.cjs.map +1 -1
  630. package/dist/private/intl/table/lv-LV.js +3 -3
  631. package/dist/private/intl/table/lv-LV.js.map +1 -1
  632. package/dist/private/intl/table/lv-LV.mjs +3 -3
  633. package/dist/private/intl/table/lv-LV.mjs.map +1 -1
  634. package/dist/private/intl/table/nb-NO.cjs +3 -3
  635. package/dist/private/intl/table/nb-NO.cjs.map +1 -1
  636. package/dist/private/intl/table/nb-NO.js +3 -3
  637. package/dist/private/intl/table/nb-NO.js.map +1 -1
  638. package/dist/private/intl/table/nb-NO.mjs +3 -3
  639. package/dist/private/intl/table/nb-NO.mjs.map +1 -1
  640. package/dist/private/intl/table/nl-NL.cjs +3 -3
  641. package/dist/private/intl/table/nl-NL.cjs.map +1 -1
  642. package/dist/private/intl/table/nl-NL.js +3 -3
  643. package/dist/private/intl/table/nl-NL.js.map +1 -1
  644. package/dist/private/intl/table/nl-NL.mjs +3 -3
  645. package/dist/private/intl/table/nl-NL.mjs.map +1 -1
  646. package/dist/private/intl/table/pl-PL.cjs +3 -3
  647. package/dist/private/intl/table/pl-PL.cjs.map +1 -1
  648. package/dist/private/intl/table/pl-PL.js +3 -3
  649. package/dist/private/intl/table/pl-PL.js.map +1 -1
  650. package/dist/private/intl/table/pl-PL.mjs +3 -3
  651. package/dist/private/intl/table/pl-PL.mjs.map +1 -1
  652. package/dist/private/intl/table/pt-BR.cjs +3 -3
  653. package/dist/private/intl/table/pt-BR.cjs.map +1 -1
  654. package/dist/private/intl/table/pt-BR.js +3 -3
  655. package/dist/private/intl/table/pt-BR.js.map +1 -1
  656. package/dist/private/intl/table/pt-BR.mjs +3 -3
  657. package/dist/private/intl/table/pt-BR.mjs.map +1 -1
  658. package/dist/private/intl/table/pt-PT.cjs +3 -3
  659. package/dist/private/intl/table/pt-PT.cjs.map +1 -1
  660. package/dist/private/intl/table/pt-PT.js +3 -3
  661. package/dist/private/intl/table/pt-PT.js.map +1 -1
  662. package/dist/private/intl/table/pt-PT.mjs +3 -3
  663. package/dist/private/intl/table/pt-PT.mjs.map +1 -1
  664. package/dist/private/intl/table/ro-RO.cjs +3 -3
  665. package/dist/private/intl/table/ro-RO.cjs.map +1 -1
  666. package/dist/private/intl/table/ro-RO.js +3 -3
  667. package/dist/private/intl/table/ro-RO.js.map +1 -1
  668. package/dist/private/intl/table/ro-RO.mjs +3 -3
  669. package/dist/private/intl/table/ro-RO.mjs.map +1 -1
  670. package/dist/private/intl/table/ru-RU.cjs +3 -3
  671. package/dist/private/intl/table/ru-RU.cjs.map +1 -1
  672. package/dist/private/intl/table/ru-RU.js +3 -3
  673. package/dist/private/intl/table/ru-RU.js.map +1 -1
  674. package/dist/private/intl/table/ru-RU.mjs +3 -3
  675. package/dist/private/intl/table/ru-RU.mjs.map +1 -1
  676. package/dist/private/intl/table/sk-SK.cjs +3 -3
  677. package/dist/private/intl/table/sk-SK.cjs.map +1 -1
  678. package/dist/private/intl/table/sk-SK.js +3 -3
  679. package/dist/private/intl/table/sk-SK.js.map +1 -1
  680. package/dist/private/intl/table/sk-SK.mjs +3 -3
  681. package/dist/private/intl/table/sk-SK.mjs.map +1 -1
  682. package/dist/private/intl/table/sl-SI.cjs +3 -3
  683. package/dist/private/intl/table/sl-SI.cjs.map +1 -1
  684. package/dist/private/intl/table/sl-SI.js +3 -3
  685. package/dist/private/intl/table/sl-SI.js.map +1 -1
  686. package/dist/private/intl/table/sl-SI.mjs +3 -3
  687. package/dist/private/intl/table/sl-SI.mjs.map +1 -1
  688. package/dist/private/intl/table/sr-SP.cjs +3 -3
  689. package/dist/private/intl/table/sr-SP.cjs.map +1 -1
  690. package/dist/private/intl/table/sr-SP.js +3 -3
  691. package/dist/private/intl/table/sr-SP.js.map +1 -1
  692. package/dist/private/intl/table/sr-SP.mjs +3 -3
  693. package/dist/private/intl/table/sr-SP.mjs.map +1 -1
  694. package/dist/private/intl/table/sv-SE.cjs +3 -3
  695. package/dist/private/intl/table/sv-SE.cjs.map +1 -1
  696. package/dist/private/intl/table/sv-SE.js +3 -3
  697. package/dist/private/intl/table/sv-SE.js.map +1 -1
  698. package/dist/private/intl/table/sv-SE.mjs +3 -3
  699. package/dist/private/intl/table/sv-SE.mjs.map +1 -1
  700. package/dist/private/intl/table/tr-TR.cjs +3 -3
  701. package/dist/private/intl/table/tr-TR.cjs.map +1 -1
  702. package/dist/private/intl/table/tr-TR.js +3 -3
  703. package/dist/private/intl/table/tr-TR.js.map +1 -1
  704. package/dist/private/intl/table/tr-TR.mjs +3 -3
  705. package/dist/private/intl/table/tr-TR.mjs.map +1 -1
  706. package/dist/private/intl/table/uk-UA.cjs +3 -3
  707. package/dist/private/intl/table/uk-UA.cjs.map +1 -1
  708. package/dist/private/intl/table/uk-UA.js +3 -3
  709. package/dist/private/intl/table/uk-UA.js.map +1 -1
  710. package/dist/private/intl/table/uk-UA.mjs +3 -3
  711. package/dist/private/intl/table/uk-UA.mjs.map +1 -1
  712. package/dist/private/intl/table/zh-CN.cjs +4 -4
  713. package/dist/private/intl/table/zh-CN.cjs.map +1 -1
  714. package/dist/private/intl/table/zh-CN.js +4 -4
  715. package/dist/private/intl/table/zh-CN.js.map +1 -1
  716. package/dist/private/intl/table/zh-CN.mjs +4 -4
  717. package/dist/private/intl/table/zh-CN.mjs.map +1 -1
  718. package/dist/private/intl/table/zh-TW.cjs +3 -3
  719. package/dist/private/intl/table/zh-TW.cjs.map +1 -1
  720. package/dist/private/intl/table/zh-TW.js +3 -3
  721. package/dist/private/intl/table/zh-TW.js.map +1 -1
  722. package/dist/private/intl/table/zh-TW.mjs +3 -3
  723. package/dist/private/intl/table/zh-TW.mjs.map +1 -1
  724. package/dist/private/intl/tree/es-ES.cjs +1 -1
  725. package/dist/private/intl/tree/es-ES.cjs.map +1 -1
  726. package/dist/private/intl/tree/es-ES.js +1 -1
  727. package/dist/private/intl/tree/es-ES.js.map +1 -1
  728. package/dist/private/intl/tree/es-ES.mjs +1 -1
  729. package/dist/private/intl/tree/es-ES.mjs.map +1 -1
  730. package/dist/private/link/useLink.cjs +2 -1
  731. package/dist/private/link/useLink.cjs.map +1 -1
  732. package/dist/private/link/useLink.js +2 -1
  733. package/dist/private/link/useLink.js.map +1 -1
  734. package/dist/private/link/useLink.mjs +2 -1
  735. package/dist/private/link/useLink.mjs.map +1 -1
  736. package/dist/private/menu/useMenuItem.cjs +33 -33
  737. package/dist/private/menu/useMenuItem.cjs.map +1 -1
  738. package/dist/private/menu/useMenuItem.js +33 -33
  739. package/dist/private/menu/useMenuItem.js.map +1 -1
  740. package/dist/private/menu/useMenuItem.mjs +33 -33
  741. package/dist/private/menu/useMenuItem.mjs.map +1 -1
  742. package/dist/private/menu/useMenuTrigger.cjs +96 -30
  743. package/dist/private/menu/useMenuTrigger.cjs.map +1 -1
  744. package/dist/private/menu/useMenuTrigger.js +96 -30
  745. package/dist/private/menu/useMenuTrigger.js.map +1 -1
  746. package/dist/private/menu/useMenuTrigger.mjs +96 -30
  747. package/dist/private/menu/useMenuTrigger.mjs.map +1 -1
  748. package/dist/private/menu/useSubmenuTrigger.cjs +44 -36
  749. package/dist/private/menu/useSubmenuTrigger.cjs.map +1 -1
  750. package/dist/private/menu/useSubmenuTrigger.js +44 -36
  751. package/dist/private/menu/useSubmenuTrigger.js.map +1 -1
  752. package/dist/private/menu/useSubmenuTrigger.mjs +44 -36
  753. package/dist/private/menu/useSubmenuTrigger.mjs.map +1 -1
  754. package/dist/private/numberfield/useNumberField.cjs +24 -19
  755. package/dist/private/numberfield/useNumberField.cjs.map +1 -1
  756. package/dist/private/numberfield/useNumberField.js +24 -19
  757. package/dist/private/numberfield/useNumberField.js.map +1 -1
  758. package/dist/private/numberfield/useNumberField.mjs +24 -19
  759. package/dist/private/numberfield/useNumberField.mjs.map +1 -1
  760. package/dist/private/overlays/Overlay.cjs +5 -1
  761. package/dist/private/overlays/Overlay.cjs.map +1 -1
  762. package/dist/private/overlays/Overlay.js +5 -1
  763. package/dist/private/overlays/Overlay.js.map +1 -1
  764. package/dist/private/overlays/Overlay.mjs +5 -1
  765. package/dist/private/overlays/Overlay.mjs.map +1 -1
  766. package/dist/private/overlays/ariaHideOutside.cjs +12 -8
  767. package/dist/private/overlays/ariaHideOutside.cjs.map +1 -1
  768. package/dist/private/overlays/ariaHideOutside.js +13 -9
  769. package/dist/private/overlays/ariaHideOutside.js.map +1 -1
  770. package/dist/private/overlays/ariaHideOutside.mjs +13 -9
  771. package/dist/private/overlays/ariaHideOutside.mjs.map +1 -1
  772. package/dist/private/overlays/useCloseOnScroll.cjs +3 -4
  773. package/dist/private/overlays/useCloseOnScroll.cjs.map +1 -1
  774. package/dist/private/overlays/useCloseOnScroll.js +4 -5
  775. package/dist/private/overlays/useCloseOnScroll.js.map +1 -1
  776. package/dist/private/overlays/useCloseOnScroll.mjs +4 -5
  777. package/dist/private/overlays/useCloseOnScroll.mjs.map +1 -1
  778. package/dist/private/overlays/useOverlay.cjs +13 -7
  779. package/dist/private/overlays/useOverlay.cjs.map +1 -1
  780. package/dist/private/overlays/useOverlay.js +13 -7
  781. package/dist/private/overlays/useOverlay.js.map +1 -1
  782. package/dist/private/overlays/useOverlay.mjs +13 -7
  783. package/dist/private/overlays/useOverlay.mjs.map +1 -1
  784. package/dist/private/overlays/useOverlayPosition.cjs +6 -0
  785. package/dist/private/overlays/useOverlayPosition.cjs.map +1 -1
  786. package/dist/private/overlays/useOverlayPosition.js +6 -0
  787. package/dist/private/overlays/useOverlayPosition.js.map +1 -1
  788. package/dist/private/overlays/useOverlayPosition.mjs +6 -0
  789. package/dist/private/overlays/useOverlayPosition.mjs.map +1 -1
  790. package/dist/private/overlays/usePopover.cjs +6 -2
  791. package/dist/private/overlays/usePopover.cjs.map +1 -1
  792. package/dist/private/overlays/usePopover.js +7 -2
  793. package/dist/private/overlays/usePopover.js.map +1 -1
  794. package/dist/private/overlays/usePopover.mjs +6 -2
  795. package/dist/private/overlays/usePopover.mjs.map +1 -1
  796. package/dist/private/overlays/usePreventScroll.cjs +2 -5
  797. package/dist/private/overlays/usePreventScroll.cjs.map +1 -1
  798. package/dist/private/overlays/usePreventScroll.js +3 -6
  799. package/dist/private/overlays/usePreventScroll.js.map +1 -1
  800. package/dist/private/overlays/usePreventScroll.mjs +3 -6
  801. package/dist/private/overlays/usePreventScroll.mjs.map +1 -1
  802. package/dist/private/progress/useProgressBar.cjs +2 -1
  803. package/dist/private/progress/useProgressBar.cjs.map +1 -1
  804. package/dist/private/progress/useProgressBar.js +2 -1
  805. package/dist/private/progress/useProgressBar.js.map +1 -1
  806. package/dist/private/progress/useProgressBar.mjs +2 -1
  807. package/dist/private/progress/useProgressBar.mjs.map +1 -1
  808. package/dist/private/radio/useRadioGroup.cjs +26 -23
  809. package/dist/private/radio/useRadioGroup.cjs.map +1 -1
  810. package/dist/private/radio/useRadioGroup.js +26 -23
  811. package/dist/private/radio/useRadioGroup.js.map +1 -1
  812. package/dist/private/radio/useRadioGroup.mjs +26 -23
  813. package/dist/private/radio/useRadioGroup.mjs.map +1 -1
  814. package/dist/private/searchfield/useSearchField.cjs +28 -22
  815. package/dist/private/searchfield/useSearchField.cjs.map +1 -1
  816. package/dist/private/searchfield/useSearchField.js +28 -22
  817. package/dist/private/searchfield/useSearchField.js.map +1 -1
  818. package/dist/private/searchfield/useSearchField.mjs +28 -22
  819. package/dist/private/searchfield/useSearchField.mjs.map +1 -1
  820. package/dist/private/select/useSelect.cjs +21 -23
  821. package/dist/private/select/useSelect.cjs.map +1 -1
  822. package/dist/private/select/useSelect.js +23 -25
  823. package/dist/private/select/useSelect.js.map +1 -1
  824. package/dist/private/select/useSelect.mjs +21 -23
  825. package/dist/private/select/useSelect.mjs.map +1 -1
  826. package/dist/private/selection/useSelectableCollection.cjs +203 -146
  827. package/dist/private/selection/useSelectableCollection.cjs.map +1 -1
  828. package/dist/private/selection/useSelectableCollection.js +207 -150
  829. package/dist/private/selection/useSelectableCollection.js.map +1 -1
  830. package/dist/private/selection/useSelectableCollection.mjs +203 -146
  831. package/dist/private/selection/useSelectableCollection.mjs.map +1 -1
  832. package/dist/private/selection/useSelectableItem.cjs +58 -13
  833. package/dist/private/selection/useSelectableItem.cjs.map +1 -1
  834. package/dist/private/selection/useSelectableItem.js +58 -13
  835. package/dist/private/selection/useSelectableItem.js.map +1 -1
  836. package/dist/private/selection/useSelectableItem.mjs +58 -13
  837. package/dist/private/selection/useSelectableItem.mjs.map +1 -1
  838. package/dist/private/slider/useSlider.cjs.map +1 -1
  839. package/dist/private/slider/useSlider.js.map +1 -1
  840. package/dist/private/slider/useSlider.mjs.map +1 -1
  841. package/dist/private/slider/useSliderThumb.cjs +28 -26
  842. package/dist/private/slider/useSliderThumb.cjs.map +1 -1
  843. package/dist/private/slider/useSliderThumb.js +28 -26
  844. package/dist/private/slider/useSliderThumb.js.map +1 -1
  845. package/dist/private/slider/useSliderThumb.mjs +28 -26
  846. package/dist/private/slider/useSliderThumb.mjs.map +1 -1
  847. package/dist/private/spinbutton/useSpinButton.cjs +49 -34
  848. package/dist/private/spinbutton/useSpinButton.cjs.map +1 -1
  849. package/dist/private/spinbutton/useSpinButton.js +49 -34
  850. package/dist/private/spinbutton/useSpinButton.js.map +1 -1
  851. package/dist/private/spinbutton/useSpinButton.mjs +49 -34
  852. package/dist/private/spinbutton/useSpinButton.mjs.map +1 -1
  853. package/dist/private/ssr/SSRProvider.cjs +12 -3
  854. package/dist/private/ssr/SSRProvider.cjs.map +1 -1
  855. package/dist/private/ssr/SSRProvider.js +12 -3
  856. package/dist/private/ssr/SSRProvider.js.map +1 -1
  857. package/dist/private/ssr/SSRProvider.mjs +12 -3
  858. package/dist/private/ssr/SSRProvider.mjs.map +1 -1
  859. package/dist/private/steplist/useStepListItem.cjs +0 -9
  860. package/dist/private/steplist/useStepListItem.cjs.map +1 -1
  861. package/dist/private/steplist/useStepListItem.js +0 -10
  862. package/dist/private/steplist/useStepListItem.js.map +1 -1
  863. package/dist/private/steplist/useStepListItem.mjs +0 -9
  864. package/dist/private/steplist/useStepListItem.mjs.map +1 -1
  865. package/dist/private/table/useTable.cjs +4 -2
  866. package/dist/private/table/useTable.cjs.map +1 -1
  867. package/dist/private/table/useTable.js +4 -2
  868. package/dist/private/table/useTable.js.map +1 -1
  869. package/dist/private/table/useTable.mjs +4 -2
  870. package/dist/private/table/useTable.mjs.map +1 -1
  871. package/dist/private/table/useTableCell.cjs +2 -0
  872. package/dist/private/table/useTableCell.cjs.map +1 -1
  873. package/dist/private/table/useTableCell.js +2 -0
  874. package/dist/private/table/useTableCell.js.map +1 -1
  875. package/dist/private/table/useTableCell.mjs +2 -0
  876. package/dist/private/table/useTableCell.mjs.map +1 -1
  877. package/dist/private/table/useTableColumnHeader.cjs +2 -3
  878. package/dist/private/table/useTableColumnHeader.cjs.map +1 -1
  879. package/dist/private/table/useTableColumnHeader.js +2 -3
  880. package/dist/private/table/useTableColumnHeader.js.map +1 -1
  881. package/dist/private/table/useTableColumnHeader.mjs +2 -3
  882. package/dist/private/table/useTableColumnHeader.mjs.map +1 -1
  883. package/dist/private/table/useTableColumnResize.cjs +32 -14
  884. package/dist/private/table/useTableColumnResize.cjs.map +1 -1
  885. package/dist/private/table/useTableColumnResize.js +33 -15
  886. package/dist/private/table/useTableColumnResize.js.map +1 -1
  887. package/dist/private/table/useTableColumnResize.mjs +33 -15
  888. package/dist/private/table/useTableColumnResize.mjs.map +1 -1
  889. package/dist/private/table/useTableRow.cjs +4 -2
  890. package/dist/private/table/useTableRow.cjs.map +1 -1
  891. package/dist/private/table/useTableRow.js +4 -2
  892. package/dist/private/table/useTableRow.js.map +1 -1
  893. package/dist/private/table/useTableRow.mjs +4 -2
  894. package/dist/private/table/useTableRow.mjs.map +1 -1
  895. package/dist/private/tag/useTag.cjs +21 -11
  896. package/dist/private/tag/useTag.cjs.map +1 -1
  897. package/dist/private/tag/useTag.js +21 -11
  898. package/dist/private/tag/useTag.js.map +1 -1
  899. package/dist/private/tag/useTag.mjs +21 -11
  900. package/dist/private/tag/useTag.mjs.map +1 -1
  901. package/dist/private/textfield/useFormattedTextField.cjs +1 -0
  902. package/dist/private/textfield/useFormattedTextField.cjs.map +1 -1
  903. package/dist/private/textfield/useFormattedTextField.js +1 -0
  904. package/dist/private/textfield/useFormattedTextField.js.map +1 -1
  905. package/dist/private/textfield/useFormattedTextField.mjs +1 -0
  906. package/dist/private/textfield/useFormattedTextField.mjs.map +1 -1
  907. package/dist/private/toast/useToastRegion.cjs +5 -0
  908. package/dist/private/toast/useToastRegion.cjs.map +1 -1
  909. package/dist/private/toast/useToastRegion.js +5 -0
  910. package/dist/private/toast/useToastRegion.js.map +1 -1
  911. package/dist/private/toast/useToastRegion.mjs +5 -0
  912. package/dist/private/toast/useToastRegion.mjs.map +1 -1
  913. package/dist/private/toggle/useToggle.cjs +1 -0
  914. package/dist/private/toggle/useToggle.cjs.map +1 -1
  915. package/dist/private/toggle/useToggle.js +1 -0
  916. package/dist/private/toggle/useToggle.js.map +1 -1
  917. package/dist/private/toggle/useToggle.mjs +1 -0
  918. package/dist/private/toggle/useToggle.mjs.map +1 -1
  919. package/dist/private/tokenfield/useToken.cjs +46 -0
  920. package/dist/private/tokenfield/useToken.cjs.map +1 -0
  921. package/dist/private/tokenfield/useToken.js +41 -0
  922. package/dist/private/tokenfield/useToken.js.map +1 -0
  923. package/dist/private/tokenfield/useToken.mjs +41 -0
  924. package/dist/private/tokenfield/useToken.mjs.map +1 -0
  925. package/dist/private/tokenfield/useTokenField.cjs +587 -0
  926. package/dist/private/tokenfield/useTokenField.cjs.map +1 -0
  927. package/dist/private/tokenfield/useTokenField.js +590 -0
  928. package/dist/private/tokenfield/useTokenField.js.map +1 -0
  929. package/dist/private/tokenfield/useTokenField.mjs +579 -0
  930. package/dist/private/tokenfield/useTokenField.mjs.map +1 -0
  931. package/dist/private/toolbar/useToolbar.cjs +1 -0
  932. package/dist/private/toolbar/useToolbar.cjs.map +1 -1
  933. package/dist/private/toolbar/useToolbar.js +1 -0
  934. package/dist/private/toolbar/useToolbar.js.map +1 -1
  935. package/dist/private/toolbar/useToolbar.mjs +1 -0
  936. package/dist/private/toolbar/useToolbar.mjs.map +1 -1
  937. package/dist/private/tooltip/intlStrings.cjs +108 -0
  938. package/dist/private/tooltip/intlStrings.cjs.map +1 -0
  939. package/dist/private/tooltip/intlStrings.js +110 -0
  940. package/dist/private/tooltip/intlStrings.js.map +1 -0
  941. package/dist/private/tooltip/intlStrings.mjs +110 -0
  942. package/dist/private/tooltip/intlStrings.mjs.map +1 -0
  943. package/dist/private/tooltip/usePreviewTrigger.cjs +212 -0
  944. package/dist/private/tooltip/usePreviewTrigger.cjs.map +1 -0
  945. package/dist/private/tooltip/usePreviewTrigger.js +208 -0
  946. package/dist/private/tooltip/usePreviewTrigger.js.map +1 -0
  947. package/dist/private/tooltip/usePreviewTrigger.mjs +207 -0
  948. package/dist/private/tooltip/usePreviewTrigger.mjs.map +1 -0
  949. package/dist/private/tooltip/useSafeArea.cjs +134 -0
  950. package/dist/private/tooltip/useSafeArea.cjs.map +1 -0
  951. package/dist/private/tooltip/useSafeArea.js +130 -0
  952. package/dist/private/tooltip/useSafeArea.js.map +1 -0
  953. package/dist/private/tooltip/useSafeArea.mjs +129 -0
  954. package/dist/private/tooltip/useSafeArea.mjs.map +1 -0
  955. package/dist/private/tooltip/useTooltipTrigger.cjs +1 -0
  956. package/dist/private/tooltip/useTooltipTrigger.cjs.map +1 -1
  957. package/dist/private/tooltip/useTooltipTrigger.js +1 -0
  958. package/dist/private/tooltip/useTooltipTrigger.js.map +1 -1
  959. package/dist/private/tooltip/useTooltipTrigger.mjs +1 -0
  960. package/dist/private/tooltip/useTooltipTrigger.mjs.map +1 -1
  961. package/dist/private/tree/useTree.cjs +1 -0
  962. package/dist/private/tree/useTree.cjs.map +1 -1
  963. package/dist/private/tree/useTree.js +1 -0
  964. package/dist/private/tree/useTree.js.map +1 -1
  965. package/dist/private/tree/useTree.mjs +1 -0
  966. package/dist/private/tree/useTree.mjs.map +1 -1
  967. package/dist/private/utils/domHelpers.cjs +43 -12
  968. package/dist/private/utils/domHelpers.cjs.map +1 -1
  969. package/dist/private/utils/domHelpers.js +45 -14
  970. package/dist/private/utils/domHelpers.js.map +1 -1
  971. package/dist/private/utils/domHelpers.mjs +43 -13
  972. package/dist/private/utils/domHelpers.mjs.map +1 -1
  973. package/dist/private/utils/isVirtualEvent.cjs +1 -1
  974. package/dist/private/utils/isVirtualEvent.cjs.map +1 -1
  975. package/dist/private/utils/isVirtualEvent.js +1 -1
  976. package/dist/private/utils/isVirtualEvent.js.map +1 -1
  977. package/dist/private/utils/isVirtualEvent.mjs +1 -1
  978. package/dist/private/utils/isVirtualEvent.mjs.map +1 -1
  979. package/dist/private/utils/openLink.cjs +4 -2
  980. package/dist/private/utils/openLink.cjs.map +1 -1
  981. package/dist/private/utils/openLink.js +4 -2
  982. package/dist/private/utils/openLink.js.map +1 -1
  983. package/dist/private/utils/openLink.mjs +4 -2
  984. package/dist/private/utils/openLink.mjs.map +1 -1
  985. package/dist/private/utils/platform.cjs +8 -4
  986. package/dist/private/utils/platform.cjs.map +1 -1
  987. package/dist/private/utils/platform.js +7 -4
  988. package/dist/private/utils/platform.js.map +1 -1
  989. package/dist/private/utils/platform.mjs +7 -4
  990. package/dist/private/utils/platform.mjs.map +1 -1
  991. package/dist/private/utils/scrollIntoView.cjs +3 -3
  992. package/dist/private/utils/scrollIntoView.cjs.map +1 -1
  993. package/dist/private/utils/scrollIntoView.js +4 -4
  994. package/dist/private/utils/scrollIntoView.js.map +1 -1
  995. package/dist/private/utils/scrollIntoView.mjs +4 -4
  996. package/dist/private/utils/scrollIntoView.mjs.map +1 -1
  997. package/dist/private/utils/shadowdom/DOMFunctions.cjs +28 -1
  998. package/dist/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
  999. package/dist/private/utils/shadowdom/DOMFunctions.js +30 -2
  1000. package/dist/private/utils/shadowdom/DOMFunctions.js.map +1 -1
  1001. package/dist/private/utils/shadowdom/DOMFunctions.mjs +28 -2
  1002. package/dist/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
  1003. package/dist/private/utils/useDeepMemo.cjs +4 -1
  1004. package/dist/private/utils/useDeepMemo.cjs.map +1 -1
  1005. package/dist/private/utils/useDeepMemo.js +4 -1
  1006. package/dist/private/utils/useDeepMemo.js.map +1 -1
  1007. package/dist/private/utils/useDeepMemo.mjs +4 -1
  1008. package/dist/private/utils/useDeepMemo.mjs.map +1 -1
  1009. package/dist/private/utils/useDrag1D.cjs +2 -0
  1010. package/dist/private/utils/useDrag1D.cjs.map +1 -1
  1011. package/dist/private/utils/useDrag1D.js +2 -0
  1012. package/dist/private/utils/useDrag1D.js.map +1 -1
  1013. package/dist/private/utils/useDrag1D.mjs +2 -0
  1014. package/dist/private/utils/useDrag1D.mjs.map +1 -1
  1015. package/dist/private/utils/useFormReset.cjs +4 -0
  1016. package/dist/private/utils/useFormReset.cjs.map +1 -1
  1017. package/dist/private/utils/useFormReset.js +4 -0
  1018. package/dist/private/utils/useFormReset.js.map +1 -1
  1019. package/dist/private/utils/useFormReset.mjs +4 -0
  1020. package/dist/private/utils/useFormReset.mjs.map +1 -1
  1021. package/dist/private/utils/useId.cjs +23 -4
  1022. package/dist/private/utils/useId.cjs.map +1 -1
  1023. package/dist/private/utils/useId.js +23 -4
  1024. package/dist/private/utils/useId.js.map +1 -1
  1025. package/dist/private/utils/useId.mjs +23 -4
  1026. package/dist/private/utils/useId.mjs.map +1 -1
  1027. package/dist/private/utils/useLoadMoreSentinel.cjs +7 -3
  1028. package/dist/private/utils/useLoadMoreSentinel.cjs.map +1 -1
  1029. package/dist/private/utils/useLoadMoreSentinel.js +7 -3
  1030. package/dist/private/utils/useLoadMoreSentinel.js.map +1 -1
  1031. package/dist/private/utils/useLoadMoreSentinel.mjs +7 -3
  1032. package/dist/private/utils/useLoadMoreSentinel.mjs.map +1 -1
  1033. package/dist/private/utils/useObjectRef.cjs +3 -1
  1034. package/dist/private/utils/useObjectRef.cjs.map +1 -1
  1035. package/dist/private/utils/useObjectRef.js +3 -1
  1036. package/dist/private/utils/useObjectRef.js.map +1 -1
  1037. package/dist/private/utils/useObjectRef.mjs +3 -1
  1038. package/dist/private/utils/useObjectRef.mjs.map +1 -1
  1039. package/dist/private/utils/useSyncRef.cjs +2 -0
  1040. package/dist/private/utils/useSyncRef.cjs.map +1 -1
  1041. package/dist/private/utils/useSyncRef.js +2 -0
  1042. package/dist/private/utils/useSyncRef.js.map +1 -1
  1043. package/dist/private/utils/useSyncRef.mjs +2 -0
  1044. package/dist/private/utils/useSyncRef.mjs.map +1 -1
  1045. package/dist/private/utils/useViewportSize.cjs +3 -3
  1046. package/dist/private/utils/useViewportSize.cjs.map +1 -1
  1047. package/dist/private/utils/useViewportSize.js +4 -4
  1048. package/dist/private/utils/useViewportSize.js.map +1 -1
  1049. package/dist/private/utils/useViewportSize.mjs +4 -4
  1050. package/dist/private/utils/useViewportSize.mjs.map +1 -1
  1051. package/dist/private/virtualizer/ScrollView.cjs +7 -4
  1052. package/dist/private/virtualizer/ScrollView.cjs.map +1 -1
  1053. package/dist/private/virtualizer/ScrollView.js +8 -5
  1054. package/dist/private/virtualizer/ScrollView.js.map +1 -1
  1055. package/dist/private/virtualizer/ScrollView.mjs +8 -5
  1056. package/dist/private/virtualizer/ScrollView.mjs.map +1 -1
  1057. package/dist/private/virtualizer/VirtualizerItem.cjs +3 -2
  1058. package/dist/private/virtualizer/VirtualizerItem.cjs.map +1 -1
  1059. package/dist/private/virtualizer/VirtualizerItem.js +3 -2
  1060. package/dist/private/virtualizer/VirtualizerItem.js.map +1 -1
  1061. package/dist/private/virtualizer/VirtualizerItem.mjs +3 -2
  1062. package/dist/private/virtualizer/VirtualizerItem.mjs.map +1 -1
  1063. package/dist/private/virtualizer/useVirtualizerItem.cjs +35 -2
  1064. package/dist/private/virtualizer/useVirtualizerItem.cjs.map +1 -1
  1065. package/dist/private/virtualizer/useVirtualizerItem.js +36 -3
  1066. package/dist/private/virtualizer/useVirtualizerItem.js.map +1 -1
  1067. package/dist/private/virtualizer/useVirtualizerItem.mjs +36 -3
  1068. package/dist/private/virtualizer/useVirtualizerItem.mjs.map +1 -1
  1069. package/dist/private/visually-hidden/VisuallyHidden.cjs +2 -1
  1070. package/dist/private/visually-hidden/VisuallyHidden.cjs.map +1 -1
  1071. package/dist/private/visually-hidden/VisuallyHidden.js +2 -1
  1072. package/dist/private/visually-hidden/VisuallyHidden.js.map +1 -1
  1073. package/dist/private/visually-hidden/VisuallyHidden.mjs +2 -1
  1074. package/dist/private/visually-hidden/VisuallyHidden.mjs.map +1 -1
  1075. package/dist/types/exports/index.d.ts +9 -0
  1076. package/dist/types/exports/private/utils/domHelpers.d.ts +1 -1
  1077. package/dist/types/exports/private/utils/platform.d.ts +1 -1
  1078. package/dist/types/exports/private/utils/shadowdom/DOMFunctions.d.ts +1 -1
  1079. package/dist/types/exports/useContextMenu.d.ts +2 -0
  1080. package/dist/types/exports/usePreviewTrigger.d.ts +2 -0
  1081. package/dist/types/exports/useTokenField.d.ts +4 -0
  1082. package/dist/types/src/button/useToggleButtonGroup.d.ts +8 -0
  1083. package/dist/types/src/combobox/useComboBox.d.ts +7 -1
  1084. package/dist/types/src/dialog/useDialog.d.ts +2 -0
  1085. package/dist/types/src/grid/useGrid.d.ts +7 -0
  1086. package/dist/types/src/grid/useGridCell.d.ts +8 -1
  1087. package/dist/types/src/grid/utils.d.ts +1 -0
  1088. package/dist/types/src/gridlist/useGridListItem.d.ts +13 -0
  1089. package/dist/types/src/interactions/createKeyboardShortcutHandler.d.ts +56 -0
  1090. package/dist/types/src/interactions/useContextMenu.d.ts +21 -0
  1091. package/dist/types/src/interactions/useKeyboard.d.ts +7 -0
  1092. package/dist/types/src/interactions/useLongPress.d.ts +2 -0
  1093. package/dist/types/src/overlays/usePopover.d.ts +2 -1
  1094. package/dist/types/src/table/useTableCell.d.ts +12 -0
  1095. package/dist/types/src/table/useTableColumnHeader.d.ts +12 -0
  1096. package/dist/types/src/table/useTableColumnResize.d.ts +5 -0
  1097. package/dist/types/src/tokenfield/useToken.d.ts +14 -0
  1098. package/dist/types/src/tokenfield/useTokenField.d.ts +57 -0
  1099. package/dist/types/src/tooltip/usePreviewTrigger.d.ts +27 -0
  1100. package/dist/types/src/tooltip/useSafeArea.d.ts +26 -0
  1101. package/dist/types/src/utils/domHelpers.d.ts +20 -5
  1102. package/dist/types/src/utils/platform.d.ts +1 -0
  1103. package/dist/types/src/utils/shadowdom/DOMFunctions.d.ts +11 -0
  1104. package/dist/types/src/utils/useLoadMoreSentinel.d.ts +7 -0
  1105. package/dist/types/src/virtualizer/VirtualizerItem.d.ts +1 -0
  1106. package/dist/types/src/virtualizer/useVirtualizerItem.d.ts +1 -0
  1107. package/i18n/ar-AE.js +1 -1
  1108. package/i18n/ar-AE.mjs +1 -1
  1109. package/i18n/bg-BG.js +1 -1
  1110. package/i18n/bg-BG.mjs +1 -1
  1111. package/i18n/cs-CZ.js +1 -1
  1112. package/i18n/cs-CZ.mjs +1 -1
  1113. package/i18n/da-DK.js +1 -1
  1114. package/i18n/da-DK.mjs +1 -1
  1115. package/i18n/de-DE.js +1 -1
  1116. package/i18n/de-DE.mjs +1 -1
  1117. package/i18n/el-GR.js +1 -1
  1118. package/i18n/el-GR.mjs +1 -1
  1119. package/i18n/en-US.js +1 -1
  1120. package/i18n/en-US.mjs +1 -1
  1121. package/i18n/es-ES.js +1 -1
  1122. package/i18n/es-ES.mjs +1 -1
  1123. package/i18n/et-EE.js +1 -1
  1124. package/i18n/et-EE.mjs +1 -1
  1125. package/i18n/fi-FI.js +1 -1
  1126. package/i18n/fi-FI.mjs +1 -1
  1127. package/i18n/fr-FR.js +1 -1
  1128. package/i18n/fr-FR.mjs +1 -1
  1129. package/i18n/he-IL.js +1 -1
  1130. package/i18n/he-IL.mjs +1 -1
  1131. package/i18n/hr-HR.js +1 -1
  1132. package/i18n/hr-HR.mjs +1 -1
  1133. package/i18n/hu-HU.js +1 -1
  1134. package/i18n/hu-HU.mjs +1 -1
  1135. package/i18n/it-IT.js +1 -1
  1136. package/i18n/it-IT.mjs +1 -1
  1137. package/i18n/ja-JP.js +1 -1
  1138. package/i18n/ja-JP.mjs +1 -1
  1139. package/i18n/ko-KR.js +1 -1
  1140. package/i18n/ko-KR.mjs +1 -1
  1141. package/i18n/lt-LT.js +1 -1
  1142. package/i18n/lt-LT.mjs +1 -1
  1143. package/i18n/lv-LV.js +1 -1
  1144. package/i18n/lv-LV.mjs +1 -1
  1145. package/i18n/nb-NO.js +1 -1
  1146. package/i18n/nb-NO.mjs +1 -1
  1147. package/i18n/nl-NL.js +1 -1
  1148. package/i18n/nl-NL.mjs +1 -1
  1149. package/i18n/pl-PL.js +1 -1
  1150. package/i18n/pl-PL.mjs +1 -1
  1151. package/i18n/pt-BR.js +1 -1
  1152. package/i18n/pt-BR.mjs +1 -1
  1153. package/i18n/pt-PT.js +1 -1
  1154. package/i18n/pt-PT.mjs +1 -1
  1155. package/i18n/ro-RO.js +1 -1
  1156. package/i18n/ro-RO.mjs +1 -1
  1157. package/i18n/ru-RU.js +1 -1
  1158. package/i18n/ru-RU.mjs +1 -1
  1159. package/i18n/sk-SK.js +1 -1
  1160. package/i18n/sk-SK.mjs +1 -1
  1161. package/i18n/sl-SI.js +1 -1
  1162. package/i18n/sl-SI.mjs +1 -1
  1163. package/i18n/sr-SP.js +1 -1
  1164. package/i18n/sr-SP.mjs +1 -1
  1165. package/i18n/sv-SE.js +1 -1
  1166. package/i18n/sv-SE.mjs +1 -1
  1167. package/i18n/tr-TR.js +1 -1
  1168. package/i18n/tr-TR.mjs +1 -1
  1169. package/i18n/uk-UA.js +1 -1
  1170. package/i18n/uk-UA.mjs +1 -1
  1171. package/i18n/zh-CN.js +1 -1
  1172. package/i18n/zh-CN.mjs +1 -1
  1173. package/i18n/zh-TW.js +1 -1
  1174. package/i18n/zh-TW.mjs +1 -1
  1175. package/package.json +6 -6
  1176. package/useContextMenu/package.json +5 -0
  1177. package/usePreviewTrigger/package.json +5 -0
  1178. package/useTokenField/package.json +5 -0
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,kEAAkE;AAClE,2DAA2D;AAC3D,yDAAyD;AACzD,kHAAkH;;;;;;;;;AA6BlH,IAAI,wCAAmC;AACvC,IAAI,2CAAkC;AAC/B,MAAM,4CAAiB,IAAI;AAI3B,IAAI,4CAA2D,IAAI,OAGrE,yFAAyF;AAC9F,IAAI,4CAAsB;AAC1B,IAAI,iDAA2B;AAE/B,sEAAsE;AACtE,MAAM,iDAA2B;IAC/B,KAAK;IACL,QAAQ;AACV;AAEA,SAAS,4CAAsB,QAAkB,EAAE,CAAe;IAChE,KAAK,IAAI,WAAW,0CAClB,QAAQ,UAAU;AAEtB;AAEA;;;CAGC,GACD,SAAS,iCAAW,CAAgB;IAClC,gFAAgF;IAChF,OAAO,CACL,CAAA,EAAE,OAAO,IACR,CAAC,CAAA,GAAA,yCAAI,OAAO,EAAE,MAAM,IACrB,EAAE,OAAO,IACT,EAAE,GAAG,KAAK,aACV,EAAE,GAAG,KAAK,WACV,EAAE,GAAG,KAAK,MAAK;AAEnB;AAEA,SAAS,0CAAoB,CAAgB;IAC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AAAD;AAEnC;AAKO,SAAS,0CAAgB,QAA2B,CAAC,CAAC;IAC3D,IAAI,eAAC,WAAW,aAAE,SAAS,EAAC,GAAG;IAC/B,IAAI,CAAC,qBAAqB,gBAAgB,GAAG,CAAA,GAAA,eAAO,EAAE,aAAa;IACnE,0CACE,CAAA;QACE,gBAAgB;IAClB,GACA;QAAC;KAAY,EACb;qBAAC;IAAW;IAGd,OAAO;QAAC,gBAAgB;IAAmB;AAC7C;AAKO,SAAS,0CACd,EAAuB,EACvB,IAAwB,EACxB,IAAiD;IAEjD;IAEA,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,MAAM,YAAY,OACpB;QAEF,IAAI,UAAU,CAAC,UAAoB;YACjC,0GAA0G;YAC1G,IAAI,CAAC,2CAAqB,CAAC,CAAC,MAAM,aAAa,UAAU,IACvD;YAEF,GAAG;QACL;QACA,0CAAe,GAAG,CAAC;QACnB,OAAO;YACL,0CAAe,MAAM,CAAC;QACxB;IACA,uDAAuD;IACzD,GAAG;AACL","sources":["packages/react-aria/src/interactions/useFocusVisible.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {getActiveElement, getEventTarget} from '../utils/shadowdom/DOMFunctions';\n\nimport {getOwnerDocument, getOwnerWindow} from '../utils/domHelpers';\nimport {ignoreFocusEvent} from './utils';\nimport {isMac} from '../utils/platform';\nimport {isVirtualClick} from '../utils/isVirtualEvent';\nimport {openLink} from '../utils/openLink';\nimport {PointerType} from '@react-types/shared';\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '../ssr/SSRProvider';\n\nexport type Modality = 'keyboard' | 'pointer' | 'virtual';\ntype HandlerEvent = PointerEvent | MouseEvent | KeyboardEvent | FocusEvent | null;\ntype Handler = (modality: Modality, e: HandlerEvent) => void;\nexport type FocusVisibleHandler = (isFocusVisible: boolean) => void;\nexport interface FocusVisibleProps {\n /** Whether the element is a text input. */\n isTextInput?: boolean;\n /** Whether the element will be auto focused. */\n autoFocus?: boolean;\n}\n\nexport interface FocusVisibleResult {\n /** Whether keyboard focus is visible globally. */\n isFocusVisible: boolean;\n}\n\nlet currentModality: null | Modality = null;\nlet currentPointerType: PointerType = 'keyboard';\nexport const changeHandlers = new Set<Handler>();\ninterface GlobalListenerData {\n focus: () => void;\n}\nexport let hasSetupGlobalListeners: Map<Window, GlobalListenerData> = new Map<\n Window,\n GlobalListenerData\n>(); // We use a map here to support setting event listeners across multiple document objects.\nlet hasEventBeforeFocus = false;\nlet hasBlurredWindowRecently = false;\n\n// Only Tab or Esc keys will make focus visible on text input elements\nconst FOCUS_VISIBLE_INPUT_KEYS = {\n Tab: true,\n Escape: true\n};\n\nfunction triggerChangeHandlers(modality: Modality, e: HandlerEvent) {\n for (let handler of changeHandlers) {\n handler(modality, e);\n }\n}\n\n/**\n * Helper function to determine if a KeyboardEvent is unmodified and could make keyboard focus\n * styles visible.\n */\nfunction isValidKey(e: KeyboardEvent) {\n // Control and Shift keys trigger when navigating back to the tab with keyboard.\n return !(\n e.metaKey ||\n (!isMac() && e.altKey) ||\n e.ctrlKey ||\n e.key === 'Control' ||\n e.key === 'Shift' ||\n e.key === 'Meta'\n );\n}\n\nfunction handleKeyboardEvent(e: KeyboardEvent) {\n hasEventBeforeFocus = true;\n if (!(openLink as any).isOpening && isValidKey(e)) {\n currentModality = 'keyboard';\n currentPointerType = 'keyboard';\n triggerChangeHandlers('keyboard', e);\n }\n}\n\nfunction handlePointerEvent(e: PointerEvent | MouseEvent) {\n currentModality = 'pointer';\n currentPointerType = 'pointerType' in e ? (e.pointerType as PointerType) : 'mouse';\n if (e.type === 'mousedown' || e.type === 'pointerdown') {\n hasEventBeforeFocus = true;\n triggerChangeHandlers('pointer', e);\n }\n}\n\nfunction handleClickEvent(e: MouseEvent) {\n if (!(openLink as any).isOpening && isVirtualClick(e)) {\n hasEventBeforeFocus = true;\n currentModality = 'virtual';\n currentPointerType = 'virtual';\n }\n}\n\nfunction handleFocusEvent(e: FocusEvent) {\n // Firefox fires two extra focus events when the user first clicks into an iframe:\n // first on the window, then on the document. We ignore these events so they don't\n // cause keyboard focus rings to appear.\n let ownerWindow = getOwnerWindow(getEventTarget(e) as Element);\n let ownerDocument = getOwnerDocument(getEventTarget(e) as Element);\n if (\n getEventTarget(e) === ownerWindow ||\n getEventTarget(e) === ownerDocument ||\n ignoreFocusEvent ||\n !e.isTrusted\n ) {\n return;\n }\n\n // If a focus event occurs without a preceding keyboard or pointer event, switch to virtual modality.\n // This occurs, for example, when navigating a form with the next/previous buttons on iOS.\n if (!hasEventBeforeFocus && !hasBlurredWindowRecently) {\n currentModality = 'virtual';\n currentPointerType = 'virtual';\n triggerChangeHandlers('virtual', e);\n }\n\n hasEventBeforeFocus = false;\n hasBlurredWindowRecently = false;\n}\n\nfunction handleWindowBlur() {\n if (ignoreFocusEvent) {\n return;\n }\n\n // When the window is blurred, reset state. This is necessary when tabbing out of the window,\n // for example, since a subsequent focus event won't be fired.\n hasEventBeforeFocus = false;\n hasBlurredWindowRecently = true;\n}\n\n/**\n * Setup global event listeners to control when keyboard focus style should be visible.\n */\nfunction setupGlobalFocusEvents(element?: HTMLElement | null) {\n // eslint-disable-next-line no-restricted-globals\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n return;\n }\n\n const windowObject = getOwnerWindow(element);\n const documentObject = getOwnerDocument(element);\n\n if (hasSetupGlobalListeners.get(windowObject)) {\n return;\n }\n\n // Programmatic focus() calls shouldn't affect the current input modality.\n // However, we need to detect other cases when a focus event occurs without\n // a preceding user event (e.g. screen reader focus). Overriding the focus\n // method on HTMLElement.prototype is a bit hacky, but works.\n // defineProperty (not assignment) so this works even if `focus` is currently\n // a getter-only accessor — e.g. when @testing-library/user-event's setup()\n // has instrumented it. Plain assignment throws in that case.\n let focus = windowObject.HTMLElement.prototype.focus;\n Reflect.defineProperty(windowObject.HTMLElement.prototype, 'focus', {\n configurable: true,\n writable: true,\n value: function () {\n hasEventBeforeFocus = true;\n focus.apply(this, arguments as unknown as [options?: FocusOptions | undefined]);\n }\n });\n\n documentObject.addEventListener('keydown', handleKeyboardEvent, true);\n documentObject.addEventListener('keyup', handleKeyboardEvent, true);\n documentObject.addEventListener('click', handleClickEvent, true);\n\n // Register focus events on the window so they are sure to happen\n // before React's event listeners (registered on the document).\n windowObject.addEventListener('focus', handleFocusEvent, true);\n windowObject.addEventListener('blur', handleWindowBlur, false);\n\n if (typeof PointerEvent !== 'undefined') {\n documentObject.addEventListener('pointerdown', handlePointerEvent, true);\n documentObject.addEventListener('pointermove', handlePointerEvent, true);\n documentObject.addEventListener('pointerup', handlePointerEvent, true);\n } else if (process.env.NODE_ENV === 'test') {\n documentObject.addEventListener('mousedown', handlePointerEvent, true);\n documentObject.addEventListener('mousemove', handlePointerEvent, true);\n documentObject.addEventListener('mouseup', handlePointerEvent, true);\n }\n\n // Add unmount handler\n windowObject.addEventListener(\n 'beforeunload',\n () => {\n tearDownWindowFocusTracking(element);\n },\n {once: true}\n );\n\n hasSetupGlobalListeners.set(windowObject, {focus});\n}\n\nconst tearDownWindowFocusTracking = (element, loadListener?: () => void) => {\n const windowObject = getOwnerWindow(element);\n const documentObject = getOwnerDocument(element);\n if (loadListener) {\n documentObject.removeEventListener('DOMContentLoaded', loadListener);\n }\n if (!hasSetupGlobalListeners.has(windowObject)) {\n return;\n }\n Reflect.defineProperty(windowObject.HTMLElement.prototype, 'focus', {\n configurable: true,\n writable: true,\n value: hasSetupGlobalListeners.get(windowObject)!.focus\n });\n\n documentObject.removeEventListener('keydown', handleKeyboardEvent, true);\n documentObject.removeEventListener('keyup', handleKeyboardEvent, true);\n documentObject.removeEventListener('click', handleClickEvent, true);\n\n windowObject.removeEventListener('focus', handleFocusEvent, true);\n windowObject.removeEventListener('blur', handleWindowBlur, false);\n\n if (typeof PointerEvent !== 'undefined') {\n documentObject.removeEventListener('pointerdown', handlePointerEvent, true);\n documentObject.removeEventListener('pointermove', handlePointerEvent, true);\n documentObject.removeEventListener('pointerup', handlePointerEvent, true);\n } else if (process.env.NODE_ENV === 'test') {\n documentObject.removeEventListener('mousedown', handlePointerEvent, true);\n documentObject.removeEventListener('mousemove', handlePointerEvent, true);\n documentObject.removeEventListener('mouseup', handlePointerEvent, true);\n }\n\n hasSetupGlobalListeners.delete(windowObject);\n};\n\n/**\n * EXPERIMENTAL\n * Adds a window (i.e. iframe) to the list of windows that are being tracked for focus visible.\n *\n * Sometimes apps render portions of their tree into an iframe. In this case, we cannot accurately\n * track if the focus is visible because we cannot see interactions inside the iframe. If you have\n * this in your application's architecture, then this function will attach event listeners inside\n * the iframe. You should call `addWindowFocusTracking` with an element from inside the window you\n * wish to add. We'll retrieve the relevant elements based on that. Note, you do not need to call\n * this for the default window, as we call it for you.\n *\n * When you are ready to stop listening, but you do not wish to unmount the iframe, you may call the\n * cleanup function returned by `addWindowFocusTracking`. Otherwise, when you unmount the iframe,\n * all listeners and state will be cleaned up automatically for you.\n *\n * @param element @default document.body - The element provided will be used to get the window to\n * add.\n * @returns A function to remove the event listeners and cleanup the state.\n */\nexport function addWindowFocusTracking(element?: HTMLElement | null): () => void {\n const documentObject = getOwnerDocument(element);\n let loadListener;\n if (documentObject.readyState !== 'loading') {\n setupGlobalFocusEvents(element);\n } else {\n loadListener = () => {\n setupGlobalFocusEvents(element);\n };\n documentObject.addEventListener('DOMContentLoaded', loadListener);\n }\n\n return () => tearDownWindowFocusTracking(element, loadListener);\n}\n\n// Server-side rendering does not have the document object defined\n// eslint-disable-next-line no-restricted-globals\nif (typeof document !== 'undefined') {\n addWindowFocusTracking();\n}\n\n/**\n * If true, keyboard focus is visible.\n */\nexport function isFocusVisible(): boolean {\n return currentModality !== 'pointer';\n}\n\nexport function getInteractionModality(): Modality | null {\n return currentModality;\n}\n\nexport function setInteractionModality(modality: Modality): void {\n currentModality = modality;\n currentPointerType = modality === 'pointer' ? 'mouse' : modality;\n triggerChangeHandlers(modality, null);\n}\n\n/** @private */\nexport function getPointerType(): PointerType {\n return currentPointerType;\n}\n\n/**\n * Keeps state of the current modality.\n */\nexport function useInteractionModality(): Modality | null {\n setupGlobalFocusEvents();\n\n let [modality, setModality] = useState(currentModality);\n useEffect(() => {\n let handler = () => {\n setModality(currentModality);\n };\n\n changeHandlers.add(handler);\n return () => {\n changeHandlers.delete(handler);\n };\n }, []);\n\n return useIsSSR() ? null : modality;\n}\n\nconst nonTextInputTypes = new Set([\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset'\n]);\n\n/**\n * If this is attached to text input component, return if the event is a focus event (Tab/Escape\n * keys pressed) so that focus visible style can be properly set.\n */\nfunction isKeyboardFocusEvent(isTextInput: boolean, modality: Modality, e: HandlerEvent) {\n let eventTarget = e ? (getEventTarget(e) as Element) : undefined;\n let document = getOwnerDocument(eventTarget);\n let ownerWindow = getOwnerWindow(eventTarget);\n const IHTMLInputElement =\n typeof ownerWindow !== 'undefined' ? ownerWindow.HTMLInputElement : HTMLInputElement;\n const IHTMLTextAreaElement =\n typeof ownerWindow !== 'undefined' ? ownerWindow.HTMLTextAreaElement : HTMLTextAreaElement;\n const IHTMLElement = typeof ownerWindow !== 'undefined' ? ownerWindow.HTMLElement : HTMLElement;\n const IKeyboardEvent =\n typeof ownerWindow !== 'undefined' ? ownerWindow.KeyboardEvent : KeyboardEvent;\n\n // For keyboard events that occur on a non-input element that will move focus into input element (aka ArrowLeft going from Datepicker button to the main input group)\n // we need to rely on the user passing isTextInput into here. This way we can skip toggling focus visiblity for said input element\n let activeElement = getActiveElement(document);\n isTextInput =\n isTextInput ||\n (activeElement instanceof IHTMLInputElement && !nonTextInputTypes.has(activeElement.type)) ||\n activeElement instanceof IHTMLTextAreaElement ||\n (activeElement instanceof IHTMLElement && activeElement.isContentEditable);\n return !(\n isTextInput &&\n modality === 'keyboard' &&\n e instanceof IKeyboardEvent &&\n !FOCUS_VISIBLE_INPUT_KEYS[e.key]\n );\n}\n\n/**\n * Manages focus visible state for the page, and subscribes individual components for updates.\n */\nexport function useFocusVisible(props: FocusVisibleProps = {}): FocusVisibleResult {\n let {isTextInput, autoFocus} = props;\n let [isFocusVisibleState, setFocusVisible] = useState(autoFocus || isFocusVisible());\n useFocusVisibleListener(\n isFocusVisible => {\n setFocusVisible(isFocusVisible);\n },\n [isTextInput],\n {isTextInput}\n );\n\n return {isFocusVisible: isFocusVisibleState};\n}\n\n/**\n * Listens for trigger change and reports if focus is visible (i.e., modality is not pointer).\n */\nexport function useFocusVisibleListener(\n fn: FocusVisibleHandler,\n deps: ReadonlyArray<any>,\n opts?: {enabled?: boolean; isTextInput?: boolean}\n): void {\n setupGlobalFocusEvents();\n\n useEffect(() => {\n if (opts?.enabled === false) {\n return;\n }\n let handler = (modality: Modality, e: HandlerEvent) => {\n // We want to early return for any keyboard events that occur inside text inputs EXCEPT for Tab and Escape\n if (!isKeyboardFocusEvent(!!opts?.isTextInput, modality, e)) {\n return;\n }\n fn(isFocusVisible());\n };\n changeHandlers.add(handler);\n return () => {\n changeHandlers.delete(handler);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n}\n"],"names":[],"version":3,"file":"useFocusVisible.mjs.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,kEAAkE;AAClE,2DAA2D;AAC3D,yDAAyD;AACzD,kHAAkH;;;;;;;;;AA6BlH,IAAI,wCAAmC;AACvC,IAAI,2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* Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {getActiveElement, getEventTarget} from '../utils/shadowdom/DOMFunctions';\n\nimport {getOwnerDocument, getOwnerWindow} from '../utils/domHelpers';\nimport {ignoreFocusEvent} from './utils';\nimport {isMac} from '../utils/platform';\nimport {isVirtualClick} from '../utils/isVirtualEvent';\nimport {openLink} from '../utils/openLink';\nimport {PointerType} from '@react-types/shared';\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '../ssr/SSRProvider';\n\nexport type Modality = 'keyboard' | 'pointer' | 'virtual';\ntype HandlerEvent = PointerEvent | MouseEvent | KeyboardEvent | FocusEvent | null;\ntype Handler = (modality: Modality, e: HandlerEvent) => void;\nexport type FocusVisibleHandler = (isFocusVisible: boolean) => void;\nexport interface FocusVisibleProps {\n /** Whether the element is a text input. */\n isTextInput?: boolean;\n /** Whether the element will be auto focused. */\n autoFocus?: boolean;\n}\n\nexport interface FocusVisibleResult {\n /** Whether keyboard focus is visible globally. */\n isFocusVisible: boolean;\n}\n\nlet currentModality: null | Modality = null;\nlet currentPointerType: PointerType = 'keyboard';\nexport const changeHandlers = new Set<Handler>();\ninterface GlobalListenerData {\n focus: () => void;\n}\nexport let hasSetupGlobalListeners: Map<Window, GlobalListenerData> = new Map<\n Window,\n GlobalListenerData\n>(); // We use a map here to support setting event listeners across multiple document objects.\nlet hasEventBeforeFocus = false;\nlet hasBlurredWindowRecently = false;\n\n// Only Tab or Esc keys will make focus visible on text input elements\nconst FOCUS_VISIBLE_INPUT_KEYS = {\n Tab: true,\n Escape: true\n};\n\nfunction triggerChangeHandlers(modality: Modality, e: HandlerEvent) {\n for (let handler of changeHandlers) {\n handler(modality, e);\n }\n}\n\n/**\n * Helper function to determine if a KeyboardEvent is unmodified and could make keyboard focus\n * styles visible.\n */\nfunction isValidKey(e: KeyboardEvent) {\n // Control and Shift keys trigger when navigating back to the tab with keyboard.\n return !(\n e.metaKey ||\n (!isMac() && e.altKey) ||\n e.ctrlKey ||\n e.key === 'Control' ||\n e.key === 'Shift' ||\n e.key === 'Meta'\n );\n}\n\nfunction handleKeyboardEvent(e: KeyboardEvent) {\n hasEventBeforeFocus = true;\n if (!(openLink as any).isOpening && isValidKey(e)) {\n currentModality = 'keyboard';\n currentPointerType = 'keyboard';\n triggerChangeHandlers('keyboard', e);\n }\n}\n\nfunction handlePointerEvent(e: PointerEvent | MouseEvent) {\n currentModality = 'pointer';\n currentPointerType = 'pointerType' in e ? (e.pointerType as PointerType) : 'mouse';\n if (e.type === 'mousedown' || e.type === 'pointerdown') {\n hasEventBeforeFocus = true;\n triggerChangeHandlers('pointer', e);\n }\n}\n\nfunction handleClickEvent(e: MouseEvent) {\n if (!(openLink as any).isOpening && isVirtualClick(e)) {\n hasEventBeforeFocus = true;\n currentModality = 'virtual';\n currentPointerType = 'virtual';\n }\n}\n\nfunction handleFocusEvent(e: FocusEvent) {\n // Firefox fires two extra focus events when the user first clicks into an iframe:\n // first on the window, then on the document. We ignore these events so they don't\n // cause keyboard focus rings to appear.\n let ownerWindow = getOwnerWindow(getEventTarget(e));\n let ownerDocument = getOwnerDocument(getEventTarget(e));\n if (\n getEventTarget(e) === ownerWindow ||\n getEventTarget(e) === ownerDocument ||\n ignoreFocusEvent ||\n !e.isTrusted\n ) {\n return;\n }\n\n // If a focus event occurs without a preceding keyboard or pointer event, switch to virtual modality.\n // This occurs, for example, when navigating a form with the next/previous buttons on iOS.\n if (!hasEventBeforeFocus && !hasBlurredWindowRecently) {\n currentModality = 'virtual';\n currentPointerType = 'virtual';\n triggerChangeHandlers('virtual', e);\n }\n\n hasEventBeforeFocus = false;\n hasBlurredWindowRecently = false;\n}\n\nfunction handleWindowBlur() {\n if (ignoreFocusEvent) {\n return;\n }\n\n // When the window is blurred, reset state. This is necessary when tabbing out of the window,\n // for example, since a subsequent focus event won't be fired.\n hasEventBeforeFocus = false;\n hasBlurredWindowRecently = true;\n}\n\n/**\n * Setup global event listeners to control when keyboard focus style should be visible.\n */\nfunction setupGlobalFocusEvents(element?: HTMLElement | null) {\n // eslint-disable-next-line no-restricted-globals\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n return;\n }\n\n const windowObject = getOwnerWindow(element);\n const documentObject = getOwnerDocument(element);\n\n if (hasSetupGlobalListeners.get(windowObject)) {\n return;\n }\n\n // Programmatic focus() calls shouldn't affect the current input modality.\n // However, we need to detect other cases when a focus event occurs without\n // a preceding user event (e.g. screen reader focus). Overriding the focus\n // method on HTMLElement.prototype is a bit hacky, but works.\n // defineProperty (not assignment) so this works even if `focus` is currently\n // a getter-only accessor — e.g. when @testing-library/user-event's setup()\n // has instrumented it. Plain assignment throws in that case.\n let focus = windowObject.HTMLElement.prototype.focus;\n Reflect.defineProperty(windowObject.HTMLElement.prototype, 'focus', {\n configurable: true,\n writable: true,\n value: function () {\n hasEventBeforeFocus = true;\n focus.apply(this, arguments as unknown as [options?: FocusOptions | undefined]);\n }\n });\n\n documentObject.addEventListener('keydown', handleKeyboardEvent, true);\n documentObject.addEventListener('keyup', handleKeyboardEvent, true);\n documentObject.addEventListener('click', handleClickEvent, true);\n\n // Register focus events on the window so they are sure to happen\n // before React's event listeners (registered on the document).\n windowObject.addEventListener('focus', handleFocusEvent, true);\n windowObject.addEventListener('blur', handleWindowBlur, false);\n\n if (typeof PointerEvent !== 'undefined') {\n documentObject.addEventListener('pointerdown', handlePointerEvent, true);\n documentObject.addEventListener('pointermove', handlePointerEvent, true);\n documentObject.addEventListener('pointerup', handlePointerEvent, true);\n } else if (process.env.NODE_ENV === 'test') {\n documentObject.addEventListener('mousedown', handlePointerEvent, true);\n documentObject.addEventListener('mousemove', handlePointerEvent, true);\n documentObject.addEventListener('mouseup', handlePointerEvent, true);\n }\n\n // Add unmount handler\n windowObject.addEventListener(\n 'beforeunload',\n () => {\n tearDownWindowFocusTracking(element);\n },\n {once: true}\n );\n\n hasSetupGlobalListeners.set(windowObject, {focus});\n}\n\nconst tearDownWindowFocusTracking = (element, loadListener?: () => void) => {\n const windowObject = getOwnerWindow(element);\n const documentObject = getOwnerDocument(element);\n if (loadListener) {\n documentObject.removeEventListener('DOMContentLoaded', loadListener);\n }\n if (!hasSetupGlobalListeners.has(windowObject)) {\n return;\n }\n Reflect.defineProperty(windowObject.HTMLElement.prototype, 'focus', {\n configurable: true,\n writable: true,\n value: hasSetupGlobalListeners.get(windowObject)!.focus\n });\n\n documentObject.removeEventListener('keydown', handleKeyboardEvent, true);\n documentObject.removeEventListener('keyup', handleKeyboardEvent, true);\n documentObject.removeEventListener('click', handleClickEvent, true);\n\n windowObject.removeEventListener('focus', handleFocusEvent, true);\n windowObject.removeEventListener('blur', handleWindowBlur, false);\n\n if (typeof PointerEvent !== 'undefined') {\n documentObject.removeEventListener('pointerdown', handlePointerEvent, true);\n documentObject.removeEventListener('pointermove', handlePointerEvent, true);\n documentObject.removeEventListener('pointerup', handlePointerEvent, true);\n } else if (process.env.NODE_ENV === 'test') {\n documentObject.removeEventListener('mousedown', handlePointerEvent, true);\n documentObject.removeEventListener('mousemove', handlePointerEvent, true);\n documentObject.removeEventListener('mouseup', handlePointerEvent, true);\n }\n\n hasSetupGlobalListeners.delete(windowObject);\n};\n\n/**\n * EXPERIMENTAL\n * Adds a window (i.e. iframe) to the list of windows that are being tracked for focus visible.\n *\n * Sometimes apps render portions of their tree into an iframe. In this case, we cannot accurately\n * track if the focus is visible because we cannot see interactions inside the iframe. If you have\n * this in your application's architecture, then this function will attach event listeners inside\n * the iframe. You should call `addWindowFocusTracking` with an element from inside the window you\n * wish to add. We'll retrieve the relevant elements based on that. Note, you do not need to call\n * this for the default window, as we call it for you.\n *\n * When you are ready to stop listening, but you do not wish to unmount the iframe, you may call the\n * cleanup function returned by `addWindowFocusTracking`. Otherwise, when you unmount the iframe,\n * all listeners and state will be cleaned up automatically for you.\n *\n * @param element @default document.body - The element provided will be used to get the window to\n * add.\n * @returns A function to remove the event listeners and cleanup the state.\n */\nexport function addWindowFocusTracking(element?: HTMLElement | null): () => void {\n const documentObject = getOwnerDocument(element);\n let loadListener;\n if (documentObject.readyState !== 'loading') {\n setupGlobalFocusEvents(element);\n } else {\n loadListener = () => {\n setupGlobalFocusEvents(element);\n };\n documentObject.addEventListener('DOMContentLoaded', loadListener);\n }\n\n return () => tearDownWindowFocusTracking(element, loadListener);\n}\n\n// Server-side rendering does not have the document object defined\n// eslint-disable-next-line no-restricted-globals\nif (typeof document !== 'undefined') {\n addWindowFocusTracking();\n}\n\n/**\n * If true, keyboard focus is visible.\n */\nexport function isFocusVisible(): boolean {\n return currentModality !== 'pointer';\n}\n\nexport function getInteractionModality(): Modality | null {\n return currentModality;\n}\n\nexport function setInteractionModality(modality: Modality): void {\n currentModality = modality;\n currentPointerType = modality === 'pointer' ? 'mouse' : modality;\n triggerChangeHandlers(modality, null);\n}\n\n/** @private */\nexport function getPointerType(): PointerType {\n return currentPointerType;\n}\n\n/**\n * Keeps state of the current modality.\n */\nexport function useInteractionModality(): Modality | null {\n setupGlobalFocusEvents();\n\n let [modality, setModality] = useState(currentModality);\n useEffect(() => {\n let handler = () => {\n setModality(currentModality);\n };\n\n changeHandlers.add(handler);\n return () => {\n changeHandlers.delete(handler);\n };\n }, []);\n\n return useIsSSR() ? null : modality;\n}\n\nconst nonTextInputTypes = new Set([\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset'\n]);\n\n/**\n * If this is attached to text input component, return if the event is a focus event (Tab/Escape\n * keys pressed) so that focus visible style can be properly set.\n */\nfunction isKeyboardFocusEvent(isTextInput: boolean, modality: Modality, e: HandlerEvent) {\n let eventTarget = e ? (getEventTarget(e) as Element) : undefined;\n let ownerDocument = getOwnerDocument(eventTarget);\n let ownerWindow = getOwnerWindow(eventTarget);\n const IHTMLInputElement =\n typeof ownerWindow !== 'undefined' ? ownerWindow.HTMLInputElement : HTMLInputElement;\n const IHTMLTextAreaElement =\n typeof ownerWindow !== 'undefined' ? ownerWindow.HTMLTextAreaElement : HTMLTextAreaElement;\n const IHTMLElement = typeof ownerWindow !== 'undefined' ? ownerWindow.HTMLElement : HTMLElement;\n const IKeyboardEvent =\n typeof ownerWindow !== 'undefined' ? ownerWindow.KeyboardEvent : KeyboardEvent;\n\n // For keyboard events that occur on a non-input element that will move focus into input element (aka ArrowLeft going from Datepicker button to the main input group)\n // we need to rely on the user passing isTextInput into here. This way we can skip toggling focus visiblity for said input element\n let activeElement = getActiveElement(ownerDocument);\n isTextInput =\n isTextInput ||\n (activeElement instanceof IHTMLInputElement && !nonTextInputTypes.has(activeElement.type)) ||\n activeElement instanceof IHTMLTextAreaElement ||\n (activeElement instanceof IHTMLElement && activeElement.isContentEditable);\n return !(\n isTextInput &&\n modality === 'keyboard' &&\n e instanceof IKeyboardEvent &&\n !FOCUS_VISIBLE_INPUT_KEYS[e.key]\n );\n}\n\n/**\n * Manages focus visible state for the page, and subscribes individual components for updates.\n */\nexport function useFocusVisible(props: FocusVisibleProps = {}): FocusVisibleResult {\n let {isTextInput, autoFocus} = props;\n let [isFocusVisibleState, setFocusVisible] = useState(autoFocus || isFocusVisible());\n useFocusVisibleListener(\n isFocusVisible => {\n setFocusVisible(isFocusVisible);\n },\n [isTextInput],\n {isTextInput}\n );\n\n return {isFocusVisible: isFocusVisibleState};\n}\n\n/**\n * Listens for trigger change and reports if focus is visible (i.e., modality is not pointer).\n */\nexport function useFocusVisibleListener(\n fn: FocusVisibleHandler,\n deps: ReadonlyArray<any>,\n opts?: {enabled?: boolean; isTextInput?: boolean}\n): void {\n setupGlobalFocusEvents();\n\n useEffect(() => {\n if (opts?.enabled === false) {\n return;\n }\n let handler = (modality: Modality, e: HandlerEvent) => {\n // We want to early return for any keyboard events that occur inside text inputs EXCEPT for Tab and Escape\n if (!isKeyboardFocusEvent(!!opts?.isTextInput, modality, e)) {\n return;\n }\n fn(isFocusVisible());\n };\n changeHandlers.add(handler);\n return () => {\n changeHandlers.delete(handler);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n}\n"],"names":[],"version":3,"file":"useFocusVisible.mjs.map"}
@@ -115,6 +115,7 @@ const $cfe896014413cb8c$export$35a3bebf7ef2d934 = /*#__PURE__*/ (0, $36KMZ$react
115
115
  return /*#__PURE__*/ (0, ($parcel$interopDefault($36KMZ$react))).cloneElement(child, {
116
116
  ...(0, $89b39774f3b79dbb$exports.mergeProps)(focusableProps, child.props),
117
117
  // @ts-ignore
118
+ // oxlint-disable-next-line react/react-compiler
118
119
  ref: (0, $8b3af019b8cf786c$exports.mergeRefs)(childRef, ref)
119
120
  });
120
121
  });
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA8CM,IAAI,0DACT,CAAA,GAAA,sCAAI,EAAE,aAAa,CAA+B;AAEpD,SAAS,0CAAoB,GAAuC;IAClE,IAAI,UAAU,CAAA,GAAA,uBAAS,EAAE,8CAAqB,CAAC;IAC/C,CAAA,GAAA,oCAAS,EAAE,SAAS;IAEpB,2BAA2B;IAC3B,IAAI,EAAC,KAAK,CAAC,EAAE,GAAG,YAAW,GAAG;IAC9B,OAAO;AACT;AAKO,MAAM,yDAET,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,kBAC5B,KAA6B,EAC7B,GAAmC;IAEnC,IAAI,YAAC,QAAQ,EAAE,GAAG,YAAW,GAAG;IAChC,IAAI,SAAS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AACF","sources":["packages/react-aria/src/interactions/useFocusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n DOMAttributes,\n FocusableDOMProps,\n FocusableElement,\n FocusableProps,\n RefObject\n} from '@react-types/shared';\nimport {focusSafely} from './focusSafely';\nimport {getOwnerWindow} from '../utils/domHelpers';\nimport {isFocusable} from '../utils/isFocusable';\nimport {mergeProps} from '../utils/mergeProps';\nimport {mergeRefs} from '../utils/mergeRefs';\nimport React, {\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {useFocus} from './useFocus';\nimport {useKeyboard} from './useKeyboard';\nimport {useObjectRef} from '../utils/useObjectRef';\nimport {useSyncRef} from '../utils/useSyncRef';\n\nexport interface FocusableOptions<T = FocusableElement>\n extends FocusableProps<T>, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface FocusableProviderProps extends DOMAttributes {\n /** The child element to provide DOM props to. */\n children?: ReactNode;\n}\n\ninterface FocusableContextValue extends FocusableProviderProps {\n ref?: MutableRefObject<FocusableElement | null>;\n}\n\n// Exported for @react-aria/collections, which forwards this context.\n/** @private */\nexport let FocusableContext: React.Context<FocusableContextValue | null> =\n React.createContext<FocusableContextValue | null>(null);\n\nfunction useFocusableContext(ref: RefObject<FocusableElement | null>): FocusableContextValue {\n let context = useContext(FocusableContext) || {};\n useSyncRef(context, ref);\n\n // eslint-disable-next-line\n let {ref: _, ...otherProps} = context;\n return otherProps;\n}\n\n/**\n * Provides DOM props to the nearest focusable child.\n */\nexport const FocusableProvider: React.ForwardRefExoticComponent<\n FocusableProviderProps & React.RefAttributes<FocusableElement>\n> = React.forwardRef(function FocusableProvider(\n props: FocusableProviderProps,\n ref: ForwardedRef<FocusableElement>\n) {\n let {children, ...otherProps} = props;\n let objRef = useObjectRef(ref);\n let context = {\n ...otherProps,\n ref: objRef\n };\n\n return <FocusableContext.Provider value={context}>{children}</FocusableContext.Provider>;\n});\n\nexport interface FocusableAria {\n /** Props for the focusable element. */\n focusableProps: DOMAttributes;\n}\n\n/**\n * Used to make an element focusable and capable of auto focus.\n */\nexport function useFocusable<T extends FocusableElement = FocusableElement>(\n props: FocusableOptions<T>,\n domRef: RefObject<FocusableElement | null>\n): FocusableAria {\n let {focusProps} = useFocus(props);\n let {keyboardProps} = useKeyboard(props);\n let interactions = mergeProps(focusProps, keyboardProps);\n let domProps = useFocusableContext(domRef);\n let interactionProps = props.isDisabled ? {} : domProps;\n let autoFocusRef = useRef(props.autoFocus);\n\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n focusSafely(domRef.current);\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n // Always set a tabIndex so that Safari allows focusing native buttons and inputs.\n let tabIndex: number | undefined = props.excludeFromTabOrder ? -1 : 0;\n if (props.isDisabled) {\n tabIndex = undefined;\n }\n\n return {\n focusableProps: mergeProps(\n {\n ...interactions,\n tabIndex\n },\n interactionProps\n )\n };\n}\n\nexport interface FocusableComponentProps extends FocusableOptions {\n children: ReactElement<DOMAttributes, string>;\n}\n\nexport const Focusable: React.ForwardRefExoticComponent<\n FocusableComponentProps & React.RefAttributes<FocusableElement>\n> = forwardRef(\n ({children, ...props}: FocusableComponentProps, ref: ForwardedRef<FocusableElement>) => {\n ref = useObjectRef(ref);\n let {focusableProps} = useFocusable(props, ref);\n let child = React.Children.only(children);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n\n let el = ref.current;\n if (!el || !(el instanceof getOwnerWindow(el).Element)) {\n console.error('<Focusable> child must forward its ref to a DOM element.');\n return;\n }\n\n if (!props.isDisabled && !isFocusable(el)) {\n console.warn(\n '<Focusable> child must be focusable. Please ensure the tabIndex prop is passed through.'\n );\n return;\n }\n\n if (\n el.localName !== 'button' &&\n el.localName !== 'input' &&\n el.localName !== 'select' &&\n el.localName !== 'textarea' &&\n el.localName !== 'a' &&\n el.localName !== 'area' &&\n el.localName !== 'summary' &&\n el.localName !== 'img' &&\n el.localName !== 'svg'\n ) {\n let role = el.getAttribute('role');\n if (!role) {\n console.warn('<Focusable> child must have an interactive ARIA role.');\n } else if (\n // https://w3c.github.io/aria/#widget_roles\n role !== 'application' &&\n role !== 'button' &&\n role !== 'checkbox' &&\n role !== 'combobox' &&\n role !== 'gridcell' &&\n role !== 'link' &&\n role !== 'menuitem' &&\n role !== 'menuitemcheckbox' &&\n role !== 'menuitemradio' &&\n role !== 'option' &&\n role !== 'radio' &&\n role !== 'searchbox' &&\n role !== 'separator' &&\n role !== 'slider' &&\n role !== 'spinbutton' &&\n role !== 'switch' &&\n role !== 'tab' &&\n role !== 'tabpanel' &&\n role !== 'textbox' &&\n role !== 'treeitem' &&\n // aria-describedby is also announced on these roles\n role !== 'img' &&\n role !== 'meter' &&\n role !== 'progressbar'\n ) {\n console.warn(`<Focusable> child must have an interactive ARIA role. Got \"${role}\".`);\n }\n }\n }, [ref, props.isDisabled]);\n\n // @ts-ignore\n let childRef = parseInt(React.version, 10) < 19 ? child.ref : child.props.ref;\n\n return React.cloneElement(child, {\n ...mergeProps(focusableProps, child.props),\n // @ts-ignore\n ref: mergeRefs(childRef, ref)\n });\n }\n);\n"],"names":[],"version":3,"file":"useFocusable.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA8CM,IAAI,0DACT,CAAA,GAAA,sCAAI,EAAE,aAAa,CAA+B;AAEpD,SAAS,0CAAoB,GAAuC;IAClE,IA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AK,MAAM,UAAU;KAAC;IAE1B,aAAa;IACb,IAAI,WAAW,SAAS,CAAA,GAAA,sCAAI,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG;IAE7E,qBAAO,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,OAAO;QAC/B,GAAG,CAAA,GAAA,oCAAS,EAAE,gBAAgB,MAAM,KAAK,CAAC;QAC1C,aAAa;QACb,gDAAgD;QAChD,KAAK,CAAA,GAAA,mCAAQ,EAAE,UAAU;IAC3B;AACF","sources":["packages/react-aria/src/interactions/useFocusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n DOMAttributes,\n FocusableDOMProps,\n FocusableElement,\n FocusableProps,\n RefObject\n} from '@react-types/shared';\nimport {focusSafely} from './focusSafely';\nimport {getOwnerWindow} from '../utils/domHelpers';\nimport {isFocusable} from '../utils/isFocusable';\nimport {mergeProps} from '../utils/mergeProps';\nimport {mergeRefs} from '../utils/mergeRefs';\nimport React, {\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {useFocus} from './useFocus';\nimport {useKeyboard} from './useKeyboard';\nimport {useObjectRef} from '../utils/useObjectRef';\nimport {useSyncRef} from '../utils/useSyncRef';\n\nexport interface FocusableOptions<T = FocusableElement>\n extends FocusableProps<T>, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface FocusableProviderProps extends DOMAttributes {\n /** The child element to provide DOM props to. */\n children?: ReactNode;\n}\n\ninterface FocusableContextValue extends FocusableProviderProps {\n ref?: MutableRefObject<FocusableElement | null>;\n}\n\n// Exported for @react-aria/collections, which forwards this context.\n/** @private */\nexport let FocusableContext: React.Context<FocusableContextValue | null> =\n React.createContext<FocusableContextValue | null>(null);\n\nfunction useFocusableContext(ref: RefObject<FocusableElement | null>): FocusableContextValue {\n let context = useContext(FocusableContext) || {};\n useSyncRef(context, ref);\n\n // eslint-disable-next-line\n let {ref: _, ...otherProps} = context;\n return otherProps;\n}\n\n/**\n * Provides DOM props to the nearest focusable child.\n */\nexport const FocusableProvider: React.ForwardRefExoticComponent<\n FocusableProviderProps & React.RefAttributes<FocusableElement>\n> = React.forwardRef(function FocusableProvider(\n props: FocusableProviderProps,\n ref: ForwardedRef<FocusableElement>\n) {\n let {children, ...otherProps} = props;\n let objRef = useObjectRef(ref);\n let context = {\n ...otherProps,\n ref: objRef\n };\n\n return <FocusableContext.Provider value={context}>{children}</FocusableContext.Provider>;\n});\n\nexport interface FocusableAria {\n /** Props for the focusable element. */\n focusableProps: DOMAttributes;\n}\n\n/**\n * Used to make an element focusable and capable of auto focus.\n */\nexport function useFocusable<T extends FocusableElement = FocusableElement>(\n props: FocusableOptions<T>,\n domRef: RefObject<FocusableElement | null>\n): FocusableAria {\n let {focusProps} = useFocus(props);\n let {keyboardProps} = useKeyboard(props);\n let interactions = mergeProps(focusProps, keyboardProps);\n let domProps = useFocusableContext(domRef);\n let interactionProps = props.isDisabled ? {} : domProps;\n let autoFocusRef = useRef(props.autoFocus);\n\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n focusSafely(domRef.current);\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n // Always set a tabIndex so that Safari allows focusing native buttons and inputs.\n let tabIndex: number | undefined = props.excludeFromTabOrder ? -1 : 0;\n if (props.isDisabled) {\n tabIndex = undefined;\n }\n\n return {\n focusableProps: mergeProps(\n {\n ...interactions,\n tabIndex\n },\n interactionProps\n )\n };\n}\n\nexport interface FocusableComponentProps extends FocusableOptions {\n children: ReactElement<DOMAttributes, string>;\n}\n\nexport const Focusable: React.ForwardRefExoticComponent<\n FocusableComponentProps & React.RefAttributes<FocusableElement>\n> = forwardRef(\n ({children, ...props}: FocusableComponentProps, ref: ForwardedRef<FocusableElement>) => {\n ref = useObjectRef(ref);\n let {focusableProps} = useFocusable(props, ref);\n let child = React.Children.only(children);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n\n let el = ref.current;\n if (!el || !(el instanceof getOwnerWindow(el).Element)) {\n console.error('<Focusable> child must forward its ref to a DOM element.');\n return;\n }\n\n if (!props.isDisabled && !isFocusable(el)) {\n console.warn(\n '<Focusable> child must be focusable. Please ensure the tabIndex prop is passed through.'\n );\n return;\n }\n\n if (\n el.localName !== 'button' &&\n el.localName !== 'input' &&\n el.localName !== 'select' &&\n el.localName !== 'textarea' &&\n el.localName !== 'a' &&\n el.localName !== 'area' &&\n el.localName !== 'summary' &&\n el.localName !== 'img' &&\n el.localName !== 'svg'\n ) {\n let role = el.getAttribute('role');\n if (!role) {\n console.warn('<Focusable> child must have an interactive ARIA role.');\n } else if (\n // https://w3c.github.io/aria/#widget_roles\n role !== 'application' &&\n role !== 'button' &&\n role !== 'checkbox' &&\n role !== 'combobox' &&\n role !== 'gridcell' &&\n role !== 'link' &&\n role !== 'menuitem' &&\n role !== 'menuitemcheckbox' &&\n role !== 'menuitemradio' &&\n role !== 'option' &&\n role !== 'radio' &&\n role !== 'searchbox' &&\n role !== 'separator' &&\n role !== 'slider' &&\n role !== 'spinbutton' &&\n role !== 'switch' &&\n role !== 'tab' &&\n role !== 'tabpanel' &&\n role !== 'textbox' &&\n role !== 'treeitem' &&\n // aria-describedby is also announced on these roles\n role !== 'img' &&\n role !== 'meter' &&\n role !== 'progressbar'\n ) {\n console.warn(`<Focusable> child must have an interactive ARIA role. Got \"${role}\".`);\n }\n }\n }, [ref, props.isDisabled]);\n\n // @ts-ignore\n let childRef = parseInt(React.version, 10) < 19 ? child.ref : child.props.ref;\n\n return React.cloneElement(child, {\n ...mergeProps(focusableProps, child.props),\n // @ts-ignore\n // oxlint-disable-next-line react/react-compiler\n ref: mergeRefs(childRef, ref)\n });\n }\n);\n"],"names":[],"version":3,"file":"useFocusable.cjs.map"}
@@ -102,6 +102,7 @@ const $088f27a386bc4a8f$export$35a3bebf7ef2d934 = /*#__PURE__*/ (0, $b6Mdn$forwa
102
102
  return /*#__PURE__*/ (0, $b6Mdn$react).cloneElement(child, {
103
103
  ...(0, $64c36edd757dfa16$export$9d1611c77c2fe928)(focusableProps, child.props),
104
104
  // @ts-ignore
105
+ // oxlint-disable-next-line react/react-compiler
105
106
  ref: (0, $d49e67a55e1d0418$export$c9058316764c140e)(childRef, ref)
106
107
  });
107
108
  });
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA8CM,IAAI,0DACT,CAAA,GAAA,YAAI,EAAE,aAAa,CAA+B;AAEpD,SAAS,0CAAoB,GAAuC;IAClE,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE,8CAAqB,CAAC;IAC/C,CAAA,GAAA,yCAAS,EAAE,SAAS;IAEpB,2BAA2B;IAC3B,IAAI,EAAC,KAAK,CAAC,EAAE,GAAG,YAAW,GAAG;IAC9B,OAAO;AACT;AAKO,MAAM,yDAET,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,kBAC5B,KAA6B,EAC7B,GAAmC;IAEnC,IAAI,YAAC,QAAQ,EAAE,GAAG,YAAW,GAAG;IAChC,IAAI,SAAS,CAAA,GAAA,yCAAW,EAAE;IAC1B,IAAI,UAAU;QACZ,GAAG,UAAU;QACb,KAAK;IACP;IAEA,qBAAO,gCAAC,0CAAiB,QAAQ;QAAC,OAAO;OAAU;AACrD;AAUO,SAAS,0CACd,KAA0B,EAC1B,MAA0C;IAE1C,IAAI,cAAC,UAAU,EAAC,GAAG,C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E,GAAG,SAAS,KAAK,YACjB,GAAG,SAAS,KAAK,WACjB,GAAG,SAAS,KAAK,YACjB,GAAG,SAAS,KAAK,cACjB,GAAG,SAAS,KAAK,OACjB,GAAG,SAAS,KAAK,UACjB,GAAG,SAAS,KAAK,aACjB,GAAG,SAAS,KAAK,SACjB,GAAG,SAAS,KAAK,OACjB;YACA,IAAI,OAAO,GAAG,YAAY,CAAC;YAC3B,IAAI,CAAC,MACH,QAAQ,IAAI,CAAC;iBACR,IACL,2CAA2C;YAC3C,SAAS,iBACT,SAAS,YACT,SAAS,cACT,SAAS,cACT,SAAS,cACT,SAAS,UACT,SAAS,cACT,SAAS,sBACT,SAAS,mBACT,SAAS,YACT,SAAS,WACT,SAAS,eACT,SAAS,eACT,SAAS,YACT,SAAS,gBACT,SAAS,YACT,SAAS,SACT,SAAS,cACT,SAAS,aACT,SAAS,cACT,oDAAoD;YACpD,SAAS,SACT,SAAS,WACT,SAAS,eAET,QAAQ,IAAI,CAAC,CAAC,2DAA2D,EAAE,KAAK,EAAE,CAAC;QAEvF;IACF,GAAG;QAAC;QAAK,MAAM,UAAU;KAAC;IAE1B,aAAa;IACb,IAAI,WAAW,SAAS,CAAA,GAAA,YAAI,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG;IAE7E,qBAAO,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,OAAO;QAC/B,GAAG,CAAA,GAAA,yCAAS,EAAE,gBAAgB,MAAM,KAAK,CAAC;QAC1C,aAAa;QACb,KAAK,CAAA,GAAA,yCAAQ,EAAE,UAAU;IAC3B;AACF","sources":["packages/react-aria/src/interactions/useFocusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n DOMAttributes,\n FocusableDOMProps,\n FocusableElement,\n FocusableProps,\n RefObject\n} from '@react-types/shared';\nimport {focusSafely} from './focusSafely';\nimport {getOwnerWindow} from '../utils/domHelpers';\nimport {isFocusable} from '../utils/isFocusable';\nimport {mergeProps} from '../utils/mergeProps';\nimport {mergeRefs} from '../utils/mergeRefs';\nimport React, {\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {useFocus} from './useFocus';\nimport {useKeyboard} from './useKeyboard';\nimport {useObjectRef} from '../utils/useObjectRef';\nimport {useSyncRef} from '../utils/useSyncRef';\n\nexport interface FocusableOptions<T = FocusableElement>\n extends FocusableProps<T>, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface FocusableProviderProps extends DOMAttributes {\n /** The child element to provide DOM props to. */\n children?: ReactNode;\n}\n\ninterface FocusableContextValue extends FocusableProviderProps {\n ref?: MutableRefObject<FocusableElement | null>;\n}\n\n// Exported for @react-aria/collections, which forwards this context.\n/** @private */\nexport let FocusableContext: React.Context<FocusableContextValue | null> =\n React.createContext<FocusableContextValue | null>(null);\n\nfunction useFocusableContext(ref: RefObject<FocusableElement | null>): FocusableContextValue {\n let context = useContext(FocusableContext) || {};\n useSyncRef(context, ref);\n\n // eslint-disable-next-line\n let {ref: _, ...otherProps} = context;\n return otherProps;\n}\n\n/**\n * Provides DOM props to the nearest focusable child.\n */\nexport const FocusableProvider: React.ForwardRefExoticComponent<\n FocusableProviderProps & React.RefAttributes<FocusableElement>\n> = React.forwardRef(function FocusableProvider(\n props: FocusableProviderProps,\n ref: ForwardedRef<FocusableElement>\n) {\n let {children, ...otherProps} = props;\n let objRef = useObjectRef(ref);\n let context = {\n ...otherProps,\n ref: objRef\n };\n\n return <FocusableContext.Provider value={context}>{children}</FocusableContext.Provider>;\n});\n\nexport interface FocusableAria {\n /** Props for the focusable element. */\n focusableProps: DOMAttributes;\n}\n\n/**\n * Used to make an element focusable and capable of auto focus.\n */\nexport function useFocusable<T extends FocusableElement = FocusableElement>(\n props: FocusableOptions<T>,\n domRef: RefObject<FocusableElement | null>\n): FocusableAria {\n let {focusProps} = useFocus(props);\n let {keyboardProps} = useKeyboard(props);\n let interactions = mergeProps(focusProps, keyboardProps);\n let domProps = useFocusableContext(domRef);\n let interactionProps = props.isDisabled ? {} : domProps;\n let autoFocusRef = useRef(props.autoFocus);\n\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n focusSafely(domRef.current);\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n // Always set a tabIndex so that Safari allows focusing native buttons and inputs.\n let tabIndex: number | undefined = props.excludeFromTabOrder ? -1 : 0;\n if (props.isDisabled) {\n tabIndex = undefined;\n }\n\n return {\n focusableProps: mergeProps(\n {\n ...interactions,\n tabIndex\n },\n interactionProps\n )\n };\n}\n\nexport interface FocusableComponentProps extends FocusableOptions {\n children: ReactElement<DOMAttributes, string>;\n}\n\nexport const Focusable: React.ForwardRefExoticComponent<\n FocusableComponentProps & React.RefAttributes<FocusableElement>\n> = forwardRef(\n ({children, ...props}: FocusableComponentProps, ref: ForwardedRef<FocusableElement>) => {\n ref = useObjectRef(ref);\n let {focusableProps} = useFocusable(props, ref);\n let child = React.Children.only(children);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n\n let el = ref.current;\n if (!el || !(el instanceof getOwnerWindow(el).Element)) {\n console.error('<Focusable> child must forward its ref to a DOM element.');\n return;\n }\n\n if (!props.isDisabled && !isFocusable(el)) {\n console.warn(\n '<Focusable> child must be focusable. Please ensure the tabIndex prop is passed through.'\n );\n return;\n }\n\n if (\n el.localName !== 'button' &&\n el.localName !== 'input' &&\n el.localName !== 'select' &&\n el.localName !== 'textarea' &&\n el.localName !== 'a' &&\n el.localName !== 'area' &&\n el.localName !== 'summary' &&\n el.localName !== 'img' &&\n el.localName !== 'svg'\n ) {\n let role = el.getAttribute('role');\n if (!role) {\n console.warn('<Focusable> child must have an interactive ARIA role.');\n } else if (\n // https://w3c.github.io/aria/#widget_roles\n role !== 'application' &&\n role !== 'button' &&\n role !== 'checkbox' &&\n role !== 'combobox' &&\n role !== 'gridcell' &&\n role !== 'link' &&\n role !== 'menuitem' &&\n role !== 'menuitemcheckbox' &&\n role !== 'menuitemradio' &&\n role !== 'option' &&\n role !== 'radio' &&\n role !== 'searchbox' &&\n role !== 'separator' &&\n role !== 'slider' &&\n role !== 'spinbutton' &&\n role !== 'switch' &&\n role !== 'tab' &&\n role !== 'tabpanel' &&\n role !== 'textbox' &&\n role !== 'treeitem' &&\n // aria-describedby is also announced on these roles\n role !== 'img' &&\n role !== 'meter' &&\n role !== 'progressbar'\n ) {\n console.warn(`<Focusable> child must have an interactive ARIA role. Got \"${role}\".`);\n }\n }\n }, [ref, props.isDisabled]);\n\n // @ts-ignore\n let childRef = parseInt(React.version, 10) < 19 ? child.ref : child.props.ref;\n\n return React.cloneElement(child, {\n ...mergeProps(focusableProps, child.props),\n // @ts-ignore\n ref: mergeRefs(childRef, ref)\n });\n }\n);\n"],"names":[],"version":3,"file":"useFocusable.js.map"}
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA8CM,IAAI,0DACT,CAAA,GAAA,YAAI,EAAE,aAAa,CAA+B;AAEpD,SAAS,0CAAoB,GAAuC;IAClE,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE,8CAAqB,CAAC;IAC/C,CAAA,GAAA,yCAAS,EAAE,SAAS;IAEpB,2BAA2B;IAC3B,IAAI,EAAC,KAAK,CAAC,EAAE,GAAG,YAAW,GAAG;IAC9B,OAAO;AACT;AAKO,MAAM,yDAET,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,kBAC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AAgB,MAAM,KAAK,CAAC;QAC1C,aAAa;QACb,gDAAgD;QAChD,KAAK,CAAA,GAAA,yCAAQ,EAAE,UAAU;IAC3B;AACF","sources":["packages/react-aria/src/interactions/useFocusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n DOMAttributes,\n FocusableDOMProps,\n FocusableElement,\n FocusableProps,\n RefObject\n} from '@react-types/shared';\nimport {focusSafely} from './focusSafely';\nimport {getOwnerWindow} from '../utils/domHelpers';\nimport {isFocusable} from '../utils/isFocusable';\nimport {mergeProps} from '../utils/mergeProps';\nimport {mergeRefs} from '../utils/mergeRefs';\nimport React, {\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {useFocus} from './useFocus';\nimport {useKeyboard} from './useKeyboard';\nimport {useObjectRef} from '../utils/useObjectRef';\nimport {useSyncRef} from '../utils/useSyncRef';\n\nexport interface FocusableOptions<T = FocusableElement>\n extends FocusableProps<T>, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface FocusableProviderProps extends DOMAttributes {\n /** The child element to provide DOM props to. */\n children?: ReactNode;\n}\n\ninterface FocusableContextValue extends FocusableProviderProps {\n ref?: MutableRefObject<FocusableElement | null>;\n}\n\n// Exported for @react-aria/collections, which forwards this context.\n/** @private */\nexport let FocusableContext: React.Context<FocusableContextValue | null> =\n React.createContext<FocusableContextValue | null>(null);\n\nfunction useFocusableContext(ref: RefObject<FocusableElement | null>): FocusableContextValue {\n let context = useContext(FocusableContext) || {};\n useSyncRef(context, ref);\n\n // eslint-disable-next-line\n let {ref: _, ...otherProps} = context;\n return otherProps;\n}\n\n/**\n * Provides DOM props to the nearest focusable child.\n */\nexport const FocusableProvider: React.ForwardRefExoticComponent<\n FocusableProviderProps & React.RefAttributes<FocusableElement>\n> = React.forwardRef(function FocusableProvider(\n props: FocusableProviderProps,\n ref: ForwardedRef<FocusableElement>\n) {\n let {children, ...otherProps} = props;\n let objRef = useObjectRef(ref);\n let context = {\n ...otherProps,\n ref: objRef\n };\n\n return <FocusableContext.Provider value={context}>{children}</FocusableContext.Provider>;\n});\n\nexport interface FocusableAria {\n /** Props for the focusable element. */\n focusableProps: DOMAttributes;\n}\n\n/**\n * Used to make an element focusable and capable of auto focus.\n */\nexport function useFocusable<T extends FocusableElement = FocusableElement>(\n props: FocusableOptions<T>,\n domRef: RefObject<FocusableElement | null>\n): FocusableAria {\n let {focusProps} = useFocus(props);\n let {keyboardProps} = useKeyboard(props);\n let interactions = mergeProps(focusProps, keyboardProps);\n let domProps = useFocusableContext(domRef);\n let interactionProps = props.isDisabled ? {} : domProps;\n let autoFocusRef = useRef(props.autoFocus);\n\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n focusSafely(domRef.current);\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n // Always set a tabIndex so that Safari allows focusing native buttons and inputs.\n let tabIndex: number | undefined = props.excludeFromTabOrder ? -1 : 0;\n if (props.isDisabled) {\n tabIndex = undefined;\n }\n\n return {\n focusableProps: mergeProps(\n {\n ...interactions,\n tabIndex\n },\n interactionProps\n )\n };\n}\n\nexport interface FocusableComponentProps extends FocusableOptions {\n children: ReactElement<DOMAttributes, string>;\n}\n\nexport const Focusable: React.ForwardRefExoticComponent<\n FocusableComponentProps & React.RefAttributes<FocusableElement>\n> = forwardRef(\n ({children, ...props}: FocusableComponentProps, ref: ForwardedRef<FocusableElement>) => {\n ref = useObjectRef(ref);\n let {focusableProps} = useFocusable(props, ref);\n let child = React.Children.only(children);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n\n let el = ref.current;\n if (!el || !(el instanceof getOwnerWindow(el).Element)) {\n console.error('<Focusable> child must forward its ref to a DOM element.');\n return;\n }\n\n if (!props.isDisabled && !isFocusable(el)) {\n console.warn(\n '<Focusable> child must be focusable. Please ensure the tabIndex prop is passed through.'\n );\n return;\n }\n\n if (\n el.localName !== 'button' &&\n el.localName !== 'input' &&\n el.localName !== 'select' &&\n el.localName !== 'textarea' &&\n el.localName !== 'a' &&\n el.localName !== 'area' &&\n el.localName !== 'summary' &&\n el.localName !== 'img' &&\n el.localName !== 'svg'\n ) {\n let role = el.getAttribute('role');\n if (!role) {\n console.warn('<Focusable> child must have an interactive ARIA role.');\n } else if (\n // https://w3c.github.io/aria/#widget_roles\n role !== 'application' &&\n role !== 'button' &&\n role !== 'checkbox' &&\n role !== 'combobox' &&\n role !== 'gridcell' &&\n role !== 'link' &&\n role !== 'menuitem' &&\n role !== 'menuitemcheckbox' &&\n role !== 'menuitemradio' &&\n role !== 'option' &&\n role !== 'radio' &&\n role !== 'searchbox' &&\n role !== 'separator' &&\n role !== 'slider' &&\n role !== 'spinbutton' &&\n role !== 'switch' &&\n role !== 'tab' &&\n role !== 'tabpanel' &&\n role !== 'textbox' &&\n role !== 'treeitem' &&\n // aria-describedby is also announced on these roles\n role !== 'img' &&\n role !== 'meter' &&\n role !== 'progressbar'\n ) {\n console.warn(`<Focusable> child must have an interactive ARIA role. Got \"${role}\".`);\n }\n }\n }, [ref, props.isDisabled]);\n\n // @ts-ignore\n let childRef = parseInt(React.version, 10) < 19 ? child.ref : child.props.ref;\n\n return React.cloneElement(child, {\n ...mergeProps(focusableProps, child.props),\n // @ts-ignore\n // oxlint-disable-next-line react/react-compiler\n ref: mergeRefs(childRef, ref)\n });\n }\n);\n"],"names":[],"version":3,"file":"useFocusable.js.map"}
@@ -102,6 +102,7 @@ const $d1116acdf220c2da$export$35a3bebf7ef2d934 = /*#__PURE__*/ (0, $fKWKs$forwa
102
102
  return /*#__PURE__*/ (0, $fKWKs$react).cloneElement(child, {
103
103
  ...(0, $bbaa08b3cd72f041$export$9d1611c77c2fe928)(focusableProps, child.props),
104
104
  // @ts-ignore
105
+ // oxlint-disable-next-line react/react-compiler
105
106
  ref: (0, $4064df0d6f9620e1$export$c9058316764c140e)(childRef, ref)
106
107
  });
107
108
  });
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA8CM,IAAI,0DACT,CAAA,GAAA,YAAI,EAAE,aAAa,CAA+B;AAEpD,SAAS,0CAAoB,GAAuC;IAClE,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE,8CAAqB,CAAC;IAC/C,CAAA,GAAA,yCAAS,EAAE,SAAS;IAEpB,2BAA2B;IAC3B,IAAI,EAAC,KAAK,CAAC,EAAE,GAAG,YAAW,GAAG;IAC9B,OAAO;AACT;AAKO,MAAM,yDAET,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,kBAC5B,KAA6B,EAC7B,GAAmC;IAEnC,IAAI,YAAC,QAAQ,EAAE,GAAG,YAAW,GAAG;IAChC,IAAI,SAAS,CAAA,GAAA,yCAAW,EAAE;IAC1B,IAAI,UAAU;QACZ,GAAG,UAAU;QACb,KAAK;IACP;IAEA,qBAAO,gCAAC,0CAAiB,QAAQ;QAAC,OAAO;OAAU;AACrD;AAUO,SAAS,0CACd,KAA0B,EAC1B,MAA0C;IAE1C,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAO,EAAE;IAC5B,IAAI,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,yCAAU,EAAE;IAClC,IAAI,eAAe,CAAA,GAAA,yCAAS,EAAE,YAAY;IAC1C,IAAI,WAAW,0CAAoB;IACnC,IAAI,mBAAmB,MAAM,UAAU,GAAG,CAAC,IAAI;IAC/C,IAAI,eAAe,CAAA,GAAA,aAAK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C;YAC3B,IAAI,CAAC,MACH,QAAQ,IAAI,CAAC;iBACR,IACL,2CAA2C;YAC3C,SAAS,iBACT,SAAS,YACT,SAAS,cACT,SAAS,cACT,SAAS,cACT,SAAS,UACT,SAAS,cACT,SAAS,sBACT,SAAS,mBACT,SAAS,YACT,SAAS,WACT,SAAS,eACT,SAAS,eACT,SAAS,YACT,SAAS,gBACT,SAAS,YACT,SAAS,SACT,SAAS,cACT,SAAS,aACT,SAAS,cACT,oDAAoD;YACpD,SAAS,SACT,SAAS,WACT,SAAS,eAET,QAAQ,IAAI,CAAC,CAAC,2DAA2D,EAAE,KAAK,EAAE,CAAC;QAEvF;IACF,GAAG;QAAC;QAAK,MAAM,UAAU;KAAC;IAE1B,aAAa;IACb,IAAI,WAAW,SAAS,CAAA,GAAA,YAAI,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG;IAE7E,qBAAO,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,OAAO;QAC/B,GAAG,CAAA,GAAA,yCAAS,EAAE,gBAAgB,MAAM,KAAK,CAAC;QAC1C,aAAa;QACb,KAAK,CAAA,GAAA,yCAAQ,EAAE,UAAU;IAC3B;AACF","sources":["packages/react-aria/src/interactions/useFocusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n DOMAttributes,\n FocusableDOMProps,\n FocusableElement,\n FocusableProps,\n RefObject\n} from '@react-types/shared';\nimport {focusSafely} from './focusSafely';\nimport {getOwnerWindow} from '../utils/domHelpers';\nimport {isFocusable} from '../utils/isFocusable';\nimport {mergeProps} from '../utils/mergeProps';\nimport {mergeRefs} from '../utils/mergeRefs';\nimport React, {\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {useFocus} from './useFocus';\nimport {useKeyboard} from './useKeyboard';\nimport {useObjectRef} from '../utils/useObjectRef';\nimport {useSyncRef} from '../utils/useSyncRef';\n\nexport interface FocusableOptions<T = FocusableElement>\n extends FocusableProps<T>, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface FocusableProviderProps extends DOMAttributes {\n /** The child element to provide DOM props to. */\n children?: ReactNode;\n}\n\ninterface FocusableContextValue extends FocusableProviderProps {\n ref?: MutableRefObject<FocusableElement | null>;\n}\n\n// Exported for @react-aria/collections, which forwards this context.\n/** @private */\nexport let FocusableContext: React.Context<FocusableContextValue | null> =\n React.createContext<FocusableContextValue | null>(null);\n\nfunction useFocusableContext(ref: RefObject<FocusableElement | null>): FocusableContextValue {\n let context = useContext(FocusableContext) || {};\n useSyncRef(context, ref);\n\n // eslint-disable-next-line\n let {ref: _, ...otherProps} = context;\n return otherProps;\n}\n\n/**\n * Provides DOM props to the nearest focusable child.\n */\nexport const FocusableProvider: React.ForwardRefExoticComponent<\n FocusableProviderProps & React.RefAttributes<FocusableElement>\n> = React.forwardRef(function FocusableProvider(\n props: FocusableProviderProps,\n ref: ForwardedRef<FocusableElement>\n) {\n let {children, ...otherProps} = props;\n let objRef = useObjectRef(ref);\n let context = {\n ...otherProps,\n ref: objRef\n };\n\n return <FocusableContext.Provider value={context}>{children}</FocusableContext.Provider>;\n});\n\nexport interface FocusableAria {\n /** Props for the focusable element. */\n focusableProps: DOMAttributes;\n}\n\n/**\n * Used to make an element focusable and capable of auto focus.\n */\nexport function useFocusable<T extends FocusableElement = FocusableElement>(\n props: FocusableOptions<T>,\n domRef: RefObject<FocusableElement | null>\n): FocusableAria {\n let {focusProps} = useFocus(props);\n let {keyboardProps} = useKeyboard(props);\n let interactions = mergeProps(focusProps, keyboardProps);\n let domProps = useFocusableContext(domRef);\n let interactionProps = props.isDisabled ? {} : domProps;\n let autoFocusRef = useRef(props.autoFocus);\n\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n focusSafely(domRef.current);\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n // Always set a tabIndex so that Safari allows focusing native buttons and inputs.\n let tabIndex: number | undefined = props.excludeFromTabOrder ? -1 : 0;\n if (props.isDisabled) {\n tabIndex = undefined;\n }\n\n return {\n focusableProps: mergeProps(\n {\n ...interactions,\n tabIndex\n },\n interactionProps\n )\n };\n}\n\nexport interface FocusableComponentProps extends FocusableOptions {\n children: ReactElement<DOMAttributes, string>;\n}\n\nexport const Focusable: React.ForwardRefExoticComponent<\n FocusableComponentProps & React.RefAttributes<FocusableElement>\n> = forwardRef(\n ({children, ...props}: FocusableComponentProps, ref: ForwardedRef<FocusableElement>) => {\n ref = useObjectRef(ref);\n let {focusableProps} = useFocusable(props, ref);\n let child = React.Children.only(children);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n\n let el = ref.current;\n if (!el || !(el instanceof getOwnerWindow(el).Element)) {\n console.error('<Focusable> child must forward its ref to a DOM element.');\n return;\n }\n\n if (!props.isDisabled && !isFocusable(el)) {\n console.warn(\n '<Focusable> child must be focusable. Please ensure the tabIndex prop is passed through.'\n );\n return;\n }\n\n if (\n el.localName !== 'button' &&\n el.localName !== 'input' &&\n el.localName !== 'select' &&\n el.localName !== 'textarea' &&\n el.localName !== 'a' &&\n el.localName !== 'area' &&\n el.localName !== 'summary' &&\n el.localName !== 'img' &&\n el.localName !== 'svg'\n ) {\n let role = el.getAttribute('role');\n if (!role) {\n console.warn('<Focusable> child must have an interactive ARIA role.');\n } else if (\n // https://w3c.github.io/aria/#widget_roles\n role !== 'application' &&\n role !== 'button' &&\n role !== 'checkbox' &&\n role !== 'combobox' &&\n role !== 'gridcell' &&\n role !== 'link' &&\n role !== 'menuitem' &&\n role !== 'menuitemcheckbox' &&\n role !== 'menuitemradio' &&\n role !== 'option' &&\n role !== 'radio' &&\n role !== 'searchbox' &&\n role !== 'separator' &&\n role !== 'slider' &&\n role !== 'spinbutton' &&\n role !== 'switch' &&\n role !== 'tab' &&\n role !== 'tabpanel' &&\n role !== 'textbox' &&\n role !== 'treeitem' &&\n // aria-describedby is also announced on these roles\n role !== 'img' &&\n role !== 'meter' &&\n role !== 'progressbar'\n ) {\n console.warn(`<Focusable> child must have an interactive ARIA role. Got \"${role}\".`);\n }\n }\n }, [ref, props.isDisabled]);\n\n // @ts-ignore\n let childRef = parseInt(React.version, 10) < 19 ? child.ref : child.props.ref;\n\n return React.cloneElement(child, {\n ...mergeProps(focusableProps, child.props),\n // @ts-ignore\n ref: mergeRefs(childRef, ref)\n });\n }\n);\n"],"names":[],"version":3,"file":"useFocusable.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA8CM,IAAI,0DACT,CAAA,GAAA,YAAI,EAAE,aAAa,CAA+B;AAEpD,SAAS,0CAAoB,GAAuC;IAClE,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE,8CAAqB,CAAC;IAC/C,CAAA,GAAA,yCAAS,EAAE,SAAS;IAEpB,2BAA2B;IAC3B,IAAI,EAAC,KAAK,CAAC,EAAE,GAAG,YAAW,GAAG;IAC9B,OAAO;AACT;AAKO,MAAM,yDAET,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,kBAC5B,KAA6B,EAC7B,GAAmC;IAEnC,IAAI,YAAC,QAAQ,EAAE,GAAG,YAAW,GAAG;IAChC,IAAI,SAAS,CAAA,GAAA,yCAAW,EAAE;IAC1B,IAAI,UAAU;QACZ,GAAG,UAAU;QACb,KAAK;IACP;IAEA,qBAAO,gCAAC,0CAAiB,QAAQ;QAAC,OAAO;OAAU;AACrD;AAUO,SAAS,0CACd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CAAU,EAAE,KAAK;YACzC,QAAQ,IAAI,CACV;YAEF;QACF;QAEA,IACE,GAAG,SAAS,KAAK,YACjB,GAAG,SAAS,KAAK,WACjB,GAAG,SAAS,KAAK,YACjB,GAAG,SAAS,KAAK,cACjB,GAAG,SAAS,KAAK,OACjB,GAAG,SAAS,KAAK,UACjB,GAAG,SAAS,KAAK,aACjB,GAAG,SAAS,KAAK,SACjB,GAAG,SAAS,KAAK,OACjB;YACA,IAAI,OAAO,GAAG,YAAY,CAAC;YAC3B,IAAI,CAAC,MACH,QAAQ,IAAI,CAAC;iBACR,IACL,2CAA2C;YAC3C,SAAS,iBACT,SAAS,YACT,SAAS,cACT,SAAS,cACT,SAAS,cACT,SAAS,UACT,SAAS,cACT,SAAS,sBACT,SAAS,mBACT,SAAS,YACT,SAAS,WACT,SAAS,eACT,SAAS,eACT,SAAS,YACT,SAAS,gBACT,SAAS,YACT,SAAS,SACT,SAAS,cACT,SAAS,aACT,SAAS,cACT,oDAAoD;YACpD,SAAS,SACT,SAAS,WACT,SAAS,eAET,QAAQ,IAAI,CAAC,CAAC,2DAA2D,EAAE,KAAK,EAAE,CAAC;QAEvF;IACF,GAAG;QAAC;QAAK,MAAM,UAAU;KAAC;IAE1B,aAAa;IACb,IAAI,WAAW,SAAS,CAAA,GAAA,YAAI,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG;IAE7E,qBAAO,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,OAAO;QAC/B,GAAG,CAAA,GAAA,yCAAS,EAAE,gBAAgB,MAAM,KAAK,CAAC;QAC1C,aAAa;QACb,gDAAgD;QAChD,KAAK,CAAA,GAAA,yCAAQ,EAAE,UAAU;IAC3B;AACF","sources":["packages/react-aria/src/interactions/useFocusable.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n DOMAttributes,\n FocusableDOMProps,\n FocusableElement,\n FocusableProps,\n RefObject\n} from '@react-types/shared';\nimport {focusSafely} from './focusSafely';\nimport {getOwnerWindow} from '../utils/domHelpers';\nimport {isFocusable} from '../utils/isFocusable';\nimport {mergeProps} from '../utils/mergeProps';\nimport {mergeRefs} from '../utils/mergeRefs';\nimport React, {\n ForwardedRef,\n forwardRef,\n MutableRefObject,\n ReactElement,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react';\nimport {useFocus} from './useFocus';\nimport {useKeyboard} from './useKeyboard';\nimport {useObjectRef} from '../utils/useObjectRef';\nimport {useSyncRef} from '../utils/useSyncRef';\n\nexport interface FocusableOptions<T = FocusableElement>\n extends FocusableProps<T>, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface FocusableProviderProps extends DOMAttributes {\n /** The child element to provide DOM props to. */\n children?: ReactNode;\n}\n\ninterface FocusableContextValue extends FocusableProviderProps {\n ref?: MutableRefObject<FocusableElement | null>;\n}\n\n// Exported for @react-aria/collections, which forwards this context.\n/** @private */\nexport let FocusableContext: React.Context<FocusableContextValue | null> =\n React.createContext<FocusableContextValue | null>(null);\n\nfunction useFocusableContext(ref: RefObject<FocusableElement | null>): FocusableContextValue {\n let context = useContext(FocusableContext) || {};\n useSyncRef(context, ref);\n\n // eslint-disable-next-line\n let {ref: _, ...otherProps} = context;\n return otherProps;\n}\n\n/**\n * Provides DOM props to the nearest focusable child.\n */\nexport const FocusableProvider: React.ForwardRefExoticComponent<\n FocusableProviderProps & React.RefAttributes<FocusableElement>\n> = React.forwardRef(function FocusableProvider(\n props: FocusableProviderProps,\n ref: ForwardedRef<FocusableElement>\n) {\n let {children, ...otherProps} = props;\n let objRef = useObjectRef(ref);\n let context = {\n ...otherProps,\n ref: objRef\n };\n\n return <FocusableContext.Provider value={context}>{children}</FocusableContext.Provider>;\n});\n\nexport interface FocusableAria {\n /** Props for the focusable element. */\n focusableProps: DOMAttributes;\n}\n\n/**\n * Used to make an element focusable and capable of auto focus.\n */\nexport function useFocusable<T extends FocusableElement = FocusableElement>(\n props: FocusableOptions<T>,\n domRef: RefObject<FocusableElement | null>\n): FocusableAria {\n let {focusProps} = useFocus(props);\n let {keyboardProps} = useKeyboard(props);\n let interactions = mergeProps(focusProps, keyboardProps);\n let domProps = useFocusableContext(domRef);\n let interactionProps = props.isDisabled ? {} : domProps;\n let autoFocusRef = useRef(props.autoFocus);\n\n useEffect(() => {\n if (autoFocusRef.current && domRef.current) {\n focusSafely(domRef.current);\n }\n autoFocusRef.current = false;\n }, [domRef]);\n\n // Always set a tabIndex so that Safari allows focusing native buttons and inputs.\n let tabIndex: number | undefined = props.excludeFromTabOrder ? -1 : 0;\n if (props.isDisabled) {\n tabIndex = undefined;\n }\n\n return {\n focusableProps: mergeProps(\n {\n ...interactions,\n tabIndex\n },\n interactionProps\n )\n };\n}\n\nexport interface FocusableComponentProps extends FocusableOptions {\n children: ReactElement<DOMAttributes, string>;\n}\n\nexport const Focusable: React.ForwardRefExoticComponent<\n FocusableComponentProps & React.RefAttributes<FocusableElement>\n> = forwardRef(\n ({children, ...props}: FocusableComponentProps, ref: ForwardedRef<FocusableElement>) => {\n ref = useObjectRef(ref);\n let {focusableProps} = useFocusable(props, ref);\n let child = React.Children.only(children);\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return;\n }\n\n let el = ref.current;\n if (!el || !(el instanceof getOwnerWindow(el).Element)) {\n console.error('<Focusable> child must forward its ref to a DOM element.');\n return;\n }\n\n if (!props.isDisabled && !isFocusable(el)) {\n console.warn(\n '<Focusable> child must be focusable. Please ensure the tabIndex prop is passed through.'\n );\n return;\n }\n\n if (\n el.localName !== 'button' &&\n el.localName !== 'input' &&\n el.localName !== 'select' &&\n el.localName !== 'textarea' &&\n el.localName !== 'a' &&\n el.localName !== 'area' &&\n el.localName !== 'summary' &&\n el.localName !== 'img' &&\n el.localName !== 'svg'\n ) {\n let role = el.getAttribute('role');\n if (!role) {\n console.warn('<Focusable> child must have an interactive ARIA role.');\n } else if (\n // https://w3c.github.io/aria/#widget_roles\n role !== 'application' &&\n role !== 'button' &&\n role !== 'checkbox' &&\n role !== 'combobox' &&\n role !== 'gridcell' &&\n role !== 'link' &&\n role !== 'menuitem' &&\n role !== 'menuitemcheckbox' &&\n role !== 'menuitemradio' &&\n role !== 'option' &&\n role !== 'radio' &&\n role !== 'searchbox' &&\n role !== 'separator' &&\n role !== 'slider' &&\n role !== 'spinbutton' &&\n role !== 'switch' &&\n role !== 'tab' &&\n role !== 'tabpanel' &&\n role !== 'textbox' &&\n role !== 'treeitem' &&\n // aria-describedby is also announced on these roles\n role !== 'img' &&\n role !== 'meter' &&\n role !== 'progressbar'\n ) {\n console.warn(`<Focusable> child must have an interactive ARIA role. Got \"${role}\".`);\n }\n }\n }, [ref, props.isDisabled]);\n\n // @ts-ignore\n let childRef = parseInt(React.version, 10) < 19 ? child.ref : child.props.ref;\n\n return React.cloneElement(child, {\n ...mergeProps(focusableProps, child.props),\n // @ts-ignore\n // oxlint-disable-next-line react/react-compiler\n ref: mergeRefs(childRef, ref)\n });\n }\n);\n"],"names":[],"version":3,"file":"useFocusable.mjs.map"}
@@ -83,7 +83,8 @@ function $eb87b11bb9010ec1$export$ae780daf29e6d456(props) {
83
83
  // However, a pointerover event will be fired on the new target the mouse is over.
84
84
  // In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.
85
85
  addGlobalListener((0, $49582955cc364b1c$exports.getOwnerDocument)((0, $da02ee888921bc9e$exports.getEventTarget)(event)), 'pointerover', (e)=>{
86
- if (state.isHovered && state.target && !(0, $da02ee888921bc9e$exports.nodeContains)(state.target, (0, $da02ee888921bc9e$exports.getEventTarget)(e))) triggerHoverEnd(e, e.pointerType);
86
+ if (state.isHovered && state.target && !(0, $da02ee888921bc9e$exports.nodeContains)(state.target, (0, $da02ee888921bc9e$exports.getEventTarget)(e))) // oxlint-disable-next-line react/react-compiler
87
+ triggerHoverEnd(e, e.pointerType);
87
88
  }, {
88
89
  capture: true
89
90
  });
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,kEAAkE;AAClE,2DAA2D;AAC3D,yDAAyD;AACzD,kHAAkH;;;;;AAmBlH,oGAAoG;AACpG,iFAAiF;AACjF,sDAAsD;AACtD,IAAI,wDAAkC;AACtC,IAAI,mCAAa;AAEjB,SAAS;IACP,wDAAkC;IAElC,wFAAwF;IACxF,sFAAsF;IACtF,wFAAwF;IACxF,oEAAoE;IACpE,WAAW;QACT,wDAAkC;IACpC,GAAG;AACL;AAEA,SAAS,+CAAyB,CAAe;IAC/C,IAAI,EAAE,WAAW,KAAK,SACpB;AAEJ;AAEA,SAAS;IACP,IAAI,gBAAgB,CAAA,GAAA,0CAAe,EAAE;IACrC,IAAI,OAAO,kBAAkB,aAC3B;IAGF,IAAI,qCAAe,GAAG;QACpB,IAAI,OAAO,iBAAiB,aAC1B,cAAc,gBAAgB,CAAC,aAAa;aACvC,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,QAClC,cAAc,gBAAgB,CAAC,YAAY;IAE/C;IAEA;IACA,OAAO;QACL;QACA,IAAI,mCAAa,GACf;QAGF,IAAI,OAAO,iBAAiB,aAC1B,cAAc,mBAAmB,CAAC,aAAa;aAC1C,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,QAClC,cAAc,mBAAmB,CAAC,YAAY;IAElD;AACF;AAMO,SAAS,0CAAS,KAAiB;IACxC,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,cAAE,UAAU,EAAC,GAAG;IAE5D,IAAI,CAAC,WAAW,W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AEA,IAAI,YACF,WAAW;gBACT,MAAM;wBACN;6BACA;YACF;YAGF,IAAI,eACF,cAAc;YAGhB,WAAW;QACb;QAEA,IAAI,aAA4B,CAAC;QAEjC,IAAI,OAAO,iBAAiB,aAAa;YACvC,WAAW,cAAc,GAAG,CAAA;gBAC1B,IAAI,yDAAmC,EAAE,WAAW,KAAK,SACvD;gBAGF,kBAAkB,GAAG,EAAE,WAAW;YACpC;YAEA,WAAW,cAAc,GAAG,CAAA;gBAC1B,IAAI,CAAC,cAAc,CAAA,GAAA,sCAAW,EAAE,EAAE,aAAa,EAAE,CAAA,GAAA,wCAAa,EAAE,KAC9D,gBAAgB,GAAG,EAAE,WAAW;YAEpC;QACF,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,QAAQ;YAC1C,WAAW,YAAY,GAAG;gBACxB,MAAM,yBAAyB,GAAG;YACpC;YAEA,WAAW,YAAY,GAAG,CAAA;gBACxB,IAAI,CAAC,MAAM,yBAAyB,IAAI,CAAC,uDACvC,kBAAkB,GAAG;gBAGvB,MAAM,yBAAyB,GAAG;YACpC;YAEA,WAAW,YAAY,GAAG,CAAA;gBACxB,IAAI,CAAC,cAAc,CAAA,GAAA,sCAAW,EAAE,EAAE,aAAa,EAAE,CAAA,GAAA,wCAAa,EAAE,KAC9D,gBAAgB,GAAG;YAEvB;QACF;QACA,OAAO;wBAAC;6BAAY;QAAe;IACrC,GAAG;QACD;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,CAAA,GAAA,sBAAQ,EAAE;QACR,iEAAiE;QACjE,qFAAqF;QACrF,IAAI,YACF,gBAAgB;YAAC,eAAe,MAAM,MAAM;QAAA,GAAG,MAAM,WAAW;IAElE,uDAAuD;IACzD,GAAG;QAAC;KAAW;IAEf,OAAO;oBACL;mBACA;IACF;AACF","sources":["packages/react-aria/src/interactions/useHover.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {DOMAttributes, HoverEvents} from '@react-types/shared';\nimport {getEventTarget, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {getOwnerDocument} from '../utils/domHelpers';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {useGlobalListeners} from '../utils/useGlobalListeners';\n\nexport interface HoverProps extends HoverEvents {\n /** Whether the hover events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface HoverResult {\n /** Props to spread on the target element. */\n hoverProps: DOMAttributes;\n isHovered: boolean;\n}\n\n// iOS fires onPointerEnter twice: once with pointerType=\"touch\" and again with pointerType=\"mouse\".\n// We want to ignore these emulated events so they do not trigger hover behavior.\n// See https://bugs.webkit.org/show_bug.cgi?id=214609.\nlet globalIgnoreEmulatedMouseEvents = false;\nlet hoverCount = 0;\n\nfunction setGlobalIgnoreEmulatedMouseEvents() {\n globalIgnoreEmulatedMouseEvents = true;\n\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => {\n globalIgnoreEmulatedMouseEvents = false;\n }, 500);\n}\n\nfunction handleGlobalPointerEvent(e: PointerEvent) {\n if (e.pointerType === 'touch') {\n setGlobalIgnoreEmulatedMouseEvents();\n }\n}\n\nfunction setupGlobalTouchEvents() {\n let ownerDocument = getOwnerDocument(null);\n if (typeof ownerDocument === 'undefined') {\n return;\n }\n\n if (hoverCount === 0) {\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.addEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.addEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n }\n\n hoverCount++;\n return () => {\n hoverCount--;\n if (hoverCount > 0) {\n return;\n }\n\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.removeEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.removeEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n };\n}\n\n/**\n * Handles pointer hover interactions for an element. Normalizes behavior\n * across browsers and platforms, and ignores emulated mouse events on touch devices.\n */\nexport function useHover(props: HoverProps): HoverResult {\n let {onHoverStart, onHoverChange, onHoverEnd, isDisabled} = props;\n\n let [isHovered, setHovered] = useState(false);\n let state = useRef({\n isHovered: false,\n ignoreEmulatedMouseEvents: false,\n pointerType: '',\n target: null\n }).current;\n\n useEffect(setupGlobalTouchEvents, []);\n let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\n\n let {hoverProps, triggerHoverEnd} = useMemo(() => {\n let triggerHoverStart = (event, pointerType) => {\n state.pointerType = pointerType;\n if (\n isDisabled ||\n pointerType === 'touch' ||\n state.isHovered ||\n !nodeContains(event.currentTarget, getEventTarget(event) as Element)\n ) {\n return;\n }\n\n state.isHovered = true;\n let target = event.currentTarget;\n state.target = target;\n\n // When an element that is hovered over is removed, no pointerleave event is fired by the browser,\n // even though the originally hovered target may have shrunk in size so it is no longer hovered.\n // However, a pointerover event will be fired on the new target the mouse is over.\n // In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.\n addGlobalListener(\n getOwnerDocument(getEventTarget(event) as Element),\n 'pointerover',\n e => {\n if (\n state.isHovered &&\n state.target &&\n !nodeContains(state.target, getEventTarget(e) as Element)\n ) {\n triggerHoverEnd(e, e.pointerType);\n }\n },\n {capture: true}\n );\n\n if (onHoverStart) {\n onHoverStart({\n type: 'hoverstart',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(true);\n }\n\n setHovered(true);\n };\n\n let triggerHoverEnd = (event, pointerType) => {\n let target = state.target;\n state.pointerType = '';\n state.target = null;\n\n if (pointerType === 'touch' || !state.isHovered || !target) {\n return;\n }\n\n state.isHovered = false;\n removeAllGlobalListeners();\n\n if (onHoverEnd) {\n onHoverEnd({\n type: 'hoverend',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(false);\n }\n\n setHovered(false);\n };\n\n let hoverProps: DOMAttributes = {};\n\n if (typeof PointerEvent !== 'undefined') {\n hoverProps.onPointerEnter = e => {\n if (globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') {\n return;\n }\n\n triggerHoverStart(e, e.pointerType);\n };\n\n hoverProps.onPointerLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, e.pointerType);\n }\n };\n } else if (process.env.NODE_ENV === 'test') {\n hoverProps.onTouchStart = () => {\n state.ignoreEmulatedMouseEvents = true;\n };\n\n hoverProps.onMouseEnter = e => {\n if (!state.ignoreEmulatedMouseEvents && !globalIgnoreEmulatedMouseEvents) {\n triggerHoverStart(e, 'mouse');\n }\n\n state.ignoreEmulatedMouseEvents = false;\n };\n\n hoverProps.onMouseLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, 'mouse');\n }\n };\n }\n return {hoverProps, triggerHoverEnd};\n }, [\n onHoverStart,\n onHoverChange,\n onHoverEnd,\n isDisabled,\n state,\n addGlobalListener,\n removeAllGlobalListeners\n ]);\n\n useEffect(() => {\n // Call the triggerHoverEnd as soon as isDisabled changes to true\n // Safe to call triggerHoverEnd, it will early return if we aren't currently hovering\n if (isDisabled) {\n triggerHoverEnd({currentTarget: state.target}, state.pointerType);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDisabled]);\n\n return {\n hoverProps,\n isHovered\n };\n}\n"],"names":[],"version":3,"file":"useHover.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,kEAAkE;AAClE,2DAA2D;AAC3D,yDAAyD;AACzD,kHAAkH;;;;;AAmBlH,oGAAoG;AACpG,iFAAiF;AACjF,sDAAsD;AACtD,IAAI,wDAAkC;AACtC,IAAI,mCAAa;AAEjB,SAAS;IACP,wDAAkC;IAElC,wFAAwF;IACxF,sFAAsF;IACtF,wFAAwF;IACxF,oEAAoE;IACpE,WAAW;QACT,wDAAkC;IACpC,GAAG;AACL;AAEA,SAAS,+CAAyB,CAAe;IAC/C,IAAI,EAAE,WAAW,KAAK,SACpB;AAEJ;AAEA,SAAS;IACP,IAAI,gBAAgB,CAAA,GAAA,0CAAe,EAAE;IACrC,IAAI,OAAO,kBAAkB,aAC3B;IAGF,IAAI,qCAAe,GAAG;QACpB,IAAI,OAAO,iBAAiB,aAC1B,cAAc,gBAAgB,CAAC,aAAa;aACvC,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,QAClC,cAAc,gBAAgB,CAAC,YAAY;IAE/C;IAEA;IACA,OAAO;QACL;QACA,IAAI,mCAAa,GACf;QAGF,IAAI,OAAO,iBAAiB,aAC1B,cAAc,mBAAmB,CAAC,aAAa;aAC1C,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,QAClC,cAAc,mBAAmB,CAAC,YAAY;IAElD;AACF;AAMO,SAAS,0CAAS,KAAiB;IACxC,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,cAAE,UAAU,EAAC,GAAG;IAE5D,IAAI,CAAC,WAAW,WAAW,GAAG,CAAA,GAAA,qBAAO,EAAE;IACvC,IAAI,QAAQ,CAAA,GAAA,mBAAK,EAAE;QACjB,WAAW;QACX,2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AW;QACb;QAEA,IAAI,aAA4B,CAAC;QAEjC,IAAI,OAAO,iBAAiB,aAAa;YACvC,WAAW,cAAc,GAAG,CAAA;gBAC1B,IAAI,yDAAmC,EAAE,WAAW,KAAK,SACvD;gBAGF,kBAAkB,GAAG,EAAE,WAAW;YACpC;YAEA,WAAW,cAAc,GAAG,CAAA;gBAC1B,IAAI,CAAC,cAAc,CAAA,GAAA,sCAAW,EAAE,EAAE,aAAa,EAAE,CAAA,GAAA,wCAAa,EAAE,KAC9D,gBAAgB,GAAG,EAAE,WAAW;YAEpC;QACF,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,QAAQ;YAC1C,WAAW,YAAY,GAAG;gBACxB,MAAM,yBAAyB,GAAG;YACpC;YAEA,WAAW,YAAY,GAAG,CAAA;gBACxB,IAAI,CAAC,MAAM,yBAAyB,IAAI,CAAC,uDACvC,kBAAkB,GAAG;gBAGvB,MAAM,yBAAyB,GAAG;YACpC;YAEA,WAAW,YAAY,GAAG,CAAA;gBACxB,IAAI,CAAC,cAAc,CAAA,GAAA,sCAAW,EAAE,EAAE,aAAa,EAAE,CAAA,GAAA,wCAAa,EAAE,KAC9D,gBAAgB,GAAG;YAEvB;QACF;QACA,OAAO;wBAAC;6BAAY;QAAe;IACrC,GAAG;QACD;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,CAAA,GAAA,sBAAQ,EAAE;QACR,iEAAiE;QACjE,qFAAqF;QACrF,IAAI,YACF,gBAAgB;YAAC,eAAe,MAAM,MAAM;QAAA,GAAG,MAAM,WAAW;IAElE,uDAAuD;IACzD,GAAG;QAAC;KAAW;IAEf,OAAO;oBACL;mBACA;IACF;AACF","sources":["packages/react-aria/src/interactions/useHover.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {DOMAttributes, HoverEvents} from '@react-types/shared';\nimport {getEventTarget, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {getOwnerDocument} from '../utils/domHelpers';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {useGlobalListeners} from '../utils/useGlobalListeners';\n\nexport interface HoverProps extends HoverEvents {\n /** Whether the hover events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface HoverResult {\n /** Props to spread on the target element. */\n hoverProps: DOMAttributes;\n isHovered: boolean;\n}\n\n// iOS fires onPointerEnter twice: once with pointerType=\"touch\" and again with pointerType=\"mouse\".\n// We want to ignore these emulated events so they do not trigger hover behavior.\n// See https://bugs.webkit.org/show_bug.cgi?id=214609.\nlet globalIgnoreEmulatedMouseEvents = false;\nlet hoverCount = 0;\n\nfunction setGlobalIgnoreEmulatedMouseEvents() {\n globalIgnoreEmulatedMouseEvents = true;\n\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => {\n globalIgnoreEmulatedMouseEvents = false;\n }, 500);\n}\n\nfunction handleGlobalPointerEvent(e: PointerEvent) {\n if (e.pointerType === 'touch') {\n setGlobalIgnoreEmulatedMouseEvents();\n }\n}\n\nfunction setupGlobalTouchEvents() {\n let ownerDocument = getOwnerDocument(null);\n if (typeof ownerDocument === 'undefined') {\n return;\n }\n\n if (hoverCount === 0) {\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.addEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.addEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n }\n\n hoverCount++;\n return () => {\n hoverCount--;\n if (hoverCount > 0) {\n return;\n }\n\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.removeEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.removeEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n };\n}\n\n/**\n * Handles pointer hover interactions for an element. Normalizes behavior\n * across browsers and platforms, and ignores emulated mouse events on touch devices.\n */\nexport function useHover(props: HoverProps): HoverResult {\n let {onHoverStart, onHoverChange, onHoverEnd, isDisabled} = props;\n\n let [isHovered, setHovered] = useState(false);\n let state = useRef({\n isHovered: false,\n ignoreEmulatedMouseEvents: false,\n pointerType: '',\n target: null\n }).current;\n\n useEffect(setupGlobalTouchEvents, []);\n let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\n\n let {hoverProps, triggerHoverEnd} = useMemo(() => {\n let triggerHoverStart = (event, pointerType) => {\n state.pointerType = pointerType;\n if (\n isDisabled ||\n pointerType === 'touch' ||\n state.isHovered ||\n !nodeContains(event.currentTarget, getEventTarget(event) as Element)\n ) {\n return;\n }\n\n state.isHovered = true;\n let target = event.currentTarget;\n state.target = target;\n\n // When an element that is hovered over is removed, no pointerleave event is fired by the browser,\n // even though the originally hovered target may have shrunk in size so it is no longer hovered.\n // However, a pointerover event will be fired on the new target the mouse is over.\n // In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.\n addGlobalListener(\n getOwnerDocument(getEventTarget(event) as Element),\n 'pointerover',\n e => {\n if (\n state.isHovered &&\n state.target &&\n !nodeContains(state.target, getEventTarget(e) as Element)\n ) {\n // oxlint-disable-next-line react/react-compiler\n triggerHoverEnd(e, e.pointerType);\n }\n },\n {capture: true}\n );\n\n if (onHoverStart) {\n onHoverStart({\n type: 'hoverstart',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(true);\n }\n\n setHovered(true);\n };\n\n let triggerHoverEnd = (event, pointerType) => {\n let target = state.target;\n state.pointerType = '';\n state.target = null;\n\n if (pointerType === 'touch' || !state.isHovered || !target) {\n return;\n }\n\n state.isHovered = false;\n removeAllGlobalListeners();\n\n if (onHoverEnd) {\n onHoverEnd({\n type: 'hoverend',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(false);\n }\n\n setHovered(false);\n };\n\n let hoverProps: DOMAttributes = {};\n\n if (typeof PointerEvent !== 'undefined') {\n hoverProps.onPointerEnter = e => {\n if (globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') {\n return;\n }\n\n triggerHoverStart(e, e.pointerType);\n };\n\n hoverProps.onPointerLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, e.pointerType);\n }\n };\n } else if (process.env.NODE_ENV === 'test') {\n hoverProps.onTouchStart = () => {\n state.ignoreEmulatedMouseEvents = true;\n };\n\n hoverProps.onMouseEnter = e => {\n if (!state.ignoreEmulatedMouseEvents && !globalIgnoreEmulatedMouseEvents) {\n triggerHoverStart(e, 'mouse');\n }\n\n state.ignoreEmulatedMouseEvents = false;\n };\n\n hoverProps.onMouseLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, 'mouse');\n }\n };\n }\n return {hoverProps, triggerHoverEnd};\n }, [\n onHoverStart,\n onHoverChange,\n onHoverEnd,\n isDisabled,\n state,\n addGlobalListener,\n removeAllGlobalListeners\n ]);\n\n useEffect(() => {\n // Call the triggerHoverEnd as soon as isDisabled changes to true\n // Safe to call triggerHoverEnd, it will early return if we aren't currently hovering\n if (isDisabled) {\n triggerHoverEnd({currentTarget: state.target}, state.pointerType);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDisabled]);\n\n return {\n hoverProps,\n isHovered\n };\n}\n"],"names":[],"version":3,"file":"useHover.cjs.map"}
@@ -77,7 +77,8 @@ function $f7f05710dfc01c4c$export$ae780daf29e6d456(props) {
77
77
  // However, a pointerover event will be fired on the new target the mouse is over.
78
78
  // In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.
79
79
  addGlobalListener((0, $cc3c3666b64debad$export$b204af158042fbac)((0, $d8ac7ed472840322$export$e58f029f0fbfdb29)(event)), 'pointerover', (e)=>{
80
- if (state.isHovered && state.target && !(0, $d8ac7ed472840322$export$4282f70798064fe0)(state.target, (0, $d8ac7ed472840322$export$e58f029f0fbfdb29)(e))) triggerHoverEnd(e, e.pointerType);
80
+ if (state.isHovered && state.target && !(0, $d8ac7ed472840322$export$4282f70798064fe0)(state.target, (0, $d8ac7ed472840322$export$e58f029f0fbfdb29)(e))) // oxlint-disable-next-line react/react-compiler
81
+ triggerHoverEnd(e, e.pointerType);
81
82
  }, {
82
83
  capture: true
83
84
  });
@@ -1 +1 @@
1
- {"mappings":";;;;;AAAA;;;;;;;;;;CAUC,GAED,kEAAkE;AAClE,2DAA2D;AAC3D,yDAAyD;AACzD,kHAAkH;;;;;AAmBlH,oGAAoG;AACpG,iFAAiF;AACjF,sDAAsD;AACtD,IAAI,wDAAkC;AACtC,IAAI,mCAAa;AAEjB,SAAS;IACP,wDAAkC;IAElC,wFAAwF;IACxF,sFAAsF;IACtF,wFAAwF;IACxF,oEAAoE;IACpE,WAAW;QACT,wDAAkC;IACpC,GAAG;AACL;AAEA,SAAS,+CAAyB,CAAe;IAC/C,IAAI,EAAE,WAAW,KAAK,SACpB;AAEJ;AAEA,SAAS;IACP,IAAI,gBAAgB,CAAA,GAAA,yCAAe,EAAE;IACrC,IAAI,OAAO,kBAAkB,aAC3B;IAGF,IAAI,qCAAe,GAAG;QACpB,IAAI,OAAO,iBAAiB,aAC1B,cAAc,gBAAgB,CAAC,a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;YAEvB;QACF;QACA,OAAO;wBAAC;6BAAY;QAAe;IACrC,GAAG;QACD;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,CAAA,GAAA,gBAAQ,EAAE;QACR,iEAAiE;QACjE,qFAAqF;QACrF,IAAI,YACF,gBAAgB;YAAC,eAAe,MAAM,MAAM;QAAA,GAAG,MAAM,WAAW;IAElE,uDAAuD;IACzD,GAAG;QAAC;KAAW;IAEf,OAAO;oBACL;mBACA;IACF;AACF","sources":["packages/react-aria/src/interactions/useHover.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {DOMAttributes, HoverEvents} from '@react-types/shared';\nimport {getEventTarget, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {getOwnerDocument} from '../utils/domHelpers';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {useGlobalListeners} from '../utils/useGlobalListeners';\n\nexport interface HoverProps extends HoverEvents {\n /** Whether the hover events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface HoverResult {\n /** Props to spread on the target element. */\n hoverProps: DOMAttributes;\n isHovered: boolean;\n}\n\n// iOS fires onPointerEnter twice: once with pointerType=\"touch\" and again with pointerType=\"mouse\".\n// We want to ignore these emulated events so they do not trigger hover behavior.\n// See https://bugs.webkit.org/show_bug.cgi?id=214609.\nlet globalIgnoreEmulatedMouseEvents = false;\nlet hoverCount = 0;\n\nfunction setGlobalIgnoreEmulatedMouseEvents() {\n globalIgnoreEmulatedMouseEvents = true;\n\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => {\n globalIgnoreEmulatedMouseEvents = false;\n }, 500);\n}\n\nfunction handleGlobalPointerEvent(e: PointerEvent) {\n if (e.pointerType === 'touch') {\n setGlobalIgnoreEmulatedMouseEvents();\n }\n}\n\nfunction setupGlobalTouchEvents() {\n let ownerDocument = getOwnerDocument(null);\n if (typeof ownerDocument === 'undefined') {\n return;\n }\n\n if (hoverCount === 0) {\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.addEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.addEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n }\n\n hoverCount++;\n return () => {\n hoverCount--;\n if (hoverCount > 0) {\n return;\n }\n\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.removeEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.removeEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n };\n}\n\n/**\n * Handles pointer hover interactions for an element. Normalizes behavior\n * across browsers and platforms, and ignores emulated mouse events on touch devices.\n */\nexport function useHover(props: HoverProps): HoverResult {\n let {onHoverStart, onHoverChange, onHoverEnd, isDisabled} = props;\n\n let [isHovered, setHovered] = useState(false);\n let state = useRef({\n isHovered: false,\n ignoreEmulatedMouseEvents: false,\n pointerType: '',\n target: null\n }).current;\n\n useEffect(setupGlobalTouchEvents, []);\n let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\n\n let {hoverProps, triggerHoverEnd} = useMemo(() => {\n let triggerHoverStart = (event, pointerType) => {\n state.pointerType = pointerType;\n if (\n isDisabled ||\n pointerType === 'touch' ||\n state.isHovered ||\n !nodeContains(event.currentTarget, getEventTarget(event) as Element)\n ) {\n return;\n }\n\n state.isHovered = true;\n let target = event.currentTarget;\n state.target = target;\n\n // When an element that is hovered over is removed, no pointerleave event is fired by the browser,\n // even though the originally hovered target may have shrunk in size so it is no longer hovered.\n // However, a pointerover event will be fired on the new target the mouse is over.\n // In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.\n addGlobalListener(\n getOwnerDocument(getEventTarget(event) as Element),\n 'pointerover',\n e => {\n if (\n state.isHovered &&\n state.target &&\n !nodeContains(state.target, getEventTarget(e) as Element)\n ) {\n triggerHoverEnd(e, e.pointerType);\n }\n },\n {capture: true}\n );\n\n if (onHoverStart) {\n onHoverStart({\n type: 'hoverstart',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(true);\n }\n\n setHovered(true);\n };\n\n let triggerHoverEnd = (event, pointerType) => {\n let target = state.target;\n state.pointerType = '';\n state.target = null;\n\n if (pointerType === 'touch' || !state.isHovered || !target) {\n return;\n }\n\n state.isHovered = false;\n removeAllGlobalListeners();\n\n if (onHoverEnd) {\n onHoverEnd({\n type: 'hoverend',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(false);\n }\n\n setHovered(false);\n };\n\n let hoverProps: DOMAttributes = {};\n\n if (typeof PointerEvent !== 'undefined') {\n hoverProps.onPointerEnter = e => {\n if (globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') {\n return;\n }\n\n triggerHoverStart(e, e.pointerType);\n };\n\n hoverProps.onPointerLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, e.pointerType);\n }\n };\n } else if (process.env.NODE_ENV === 'test') {\n hoverProps.onTouchStart = () => {\n state.ignoreEmulatedMouseEvents = true;\n };\n\n hoverProps.onMouseEnter = e => {\n if (!state.ignoreEmulatedMouseEvents && !globalIgnoreEmulatedMouseEvents) {\n triggerHoverStart(e, 'mouse');\n }\n\n state.ignoreEmulatedMouseEvents = false;\n };\n\n hoverProps.onMouseLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, 'mouse');\n }\n };\n }\n return {hoverProps, triggerHoverEnd};\n }, [\n onHoverStart,\n onHoverChange,\n onHoverEnd,\n isDisabled,\n state,\n addGlobalListener,\n removeAllGlobalListeners\n ]);\n\n useEffect(() => {\n // Call the triggerHoverEnd as soon as isDisabled changes to true\n // Safe to call triggerHoverEnd, it will early return if we aren't currently hovering\n if (isDisabled) {\n triggerHoverEnd({currentTarget: state.target}, state.pointerType);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDisabled]);\n\n return {\n hoverProps,\n isHovered\n };\n}\n"],"names":[],"version":3,"file":"useHover.js.map"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC,GAED,kEAAkE;AAClE,2DAA2D;AAC3D,yDAAyD;AACzD,kHAAkH;;;;;AAmBlH,oGAAoG;AACpG,iFAAiF;AACjF,sDAAsD;AACtD,IAAI,wDAAkC;AACtC,IAAI,mCAAa;AAEjB,SAAS;IACP,wDAAkC;IAElC,wFAAwF;IACxF,sFAAsF;IACtF,wFAAwF;IACxF,oEAAoE;IACpE,WAAW;QACT,wDAAkC;IACpC,GAAG;AACL;AAEA,SAAS,+CAAyB,CAAe;IAC/C,IAAI,EAAE,WAAW,KAAK,SACpB;AAEJ;AAEA,SAAS;IACP,IAAI,gBAAgB,CAAA,GAAA,yCAAe,EAAE;IACrC,IAAI,OAAO,kBAAkB,aAC3B;IAGF,IAAI,qCAAe,GAAG;QACpB,IAAI,OAAO,iBAAiB,aAC1B,cAAc,gBAAgB,CAAC,aAAa;aACvC,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,QAClC,cAAc,gBAAgB,CAAC,YAAY;IAE/C;IAEA;IACA,OAAO;QACL;Q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AED,CAAA,GAAA,gBAAQ,EAAE;QACR,iEAAiE;QACjE,qFAAqF;QACrF,IAAI,YACF,gBAAgB;YAAC,eAAe,MAAM,MAAM;QAAA,GAAG,MAAM,WAAW;IAElE,uDAAuD;IACzD,GAAG;QAAC;KAAW;IAEf,OAAO;oBACL;mBACA;IACF;AACF","sources":["packages/react-aria/src/interactions/useHover.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {DOMAttributes, HoverEvents} from '@react-types/shared';\nimport {getEventTarget, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {getOwnerDocument} from '../utils/domHelpers';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {useGlobalListeners} from '../utils/useGlobalListeners';\n\nexport interface HoverProps extends HoverEvents {\n /** Whether the hover events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface HoverResult {\n /** Props to spread on the target element. */\n hoverProps: DOMAttributes;\n isHovered: boolean;\n}\n\n// iOS fires onPointerEnter twice: once with pointerType=\"touch\" and again with pointerType=\"mouse\".\n// We want to ignore these emulated events so they do not trigger hover behavior.\n// See https://bugs.webkit.org/show_bug.cgi?id=214609.\nlet globalIgnoreEmulatedMouseEvents = false;\nlet hoverCount = 0;\n\nfunction setGlobalIgnoreEmulatedMouseEvents() {\n globalIgnoreEmulatedMouseEvents = true;\n\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => {\n globalIgnoreEmulatedMouseEvents = false;\n }, 500);\n}\n\nfunction handleGlobalPointerEvent(e: PointerEvent) {\n if (e.pointerType === 'touch') {\n setGlobalIgnoreEmulatedMouseEvents();\n }\n}\n\nfunction setupGlobalTouchEvents() {\n let ownerDocument = getOwnerDocument(null);\n if (typeof ownerDocument === 'undefined') {\n return;\n }\n\n if (hoverCount === 0) {\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.addEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.addEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n }\n\n hoverCount++;\n return () => {\n hoverCount--;\n if (hoverCount > 0) {\n return;\n }\n\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.removeEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.removeEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n };\n}\n\n/**\n * Handles pointer hover interactions for an element. Normalizes behavior\n * across browsers and platforms, and ignores emulated mouse events on touch devices.\n */\nexport function useHover(props: HoverProps): HoverResult {\n let {onHoverStart, onHoverChange, onHoverEnd, isDisabled} = props;\n\n let [isHovered, setHovered] = useState(false);\n let state = useRef({\n isHovered: false,\n ignoreEmulatedMouseEvents: false,\n pointerType: '',\n target: null\n }).current;\n\n useEffect(setupGlobalTouchEvents, []);\n let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\n\n let {hoverProps, triggerHoverEnd} = useMemo(() => {\n let triggerHoverStart = (event, pointerType) => {\n state.pointerType = pointerType;\n if (\n isDisabled ||\n pointerType === 'touch' ||\n state.isHovered ||\n !nodeContains(event.currentTarget, getEventTarget(event) as Element)\n ) {\n return;\n }\n\n state.isHovered = true;\n let target = event.currentTarget;\n state.target = target;\n\n // When an element that is hovered over is removed, no pointerleave event is fired by the browser,\n // even though the originally hovered target may have shrunk in size so it is no longer hovered.\n // However, a pointerover event will be fired on the new target the mouse is over.\n // In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.\n addGlobalListener(\n getOwnerDocument(getEventTarget(event) as Element),\n 'pointerover',\n e => {\n if (\n state.isHovered &&\n state.target &&\n !nodeContains(state.target, getEventTarget(e) as Element)\n ) {\n // oxlint-disable-next-line react/react-compiler\n triggerHoverEnd(e, e.pointerType);\n }\n },\n {capture: true}\n );\n\n if (onHoverStart) {\n onHoverStart({\n type: 'hoverstart',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(true);\n }\n\n setHovered(true);\n };\n\n let triggerHoverEnd = (event, pointerType) => {\n let target = state.target;\n state.pointerType = '';\n state.target = null;\n\n if (pointerType === 'touch' || !state.isHovered || !target) {\n return;\n }\n\n state.isHovered = false;\n removeAllGlobalListeners();\n\n if (onHoverEnd) {\n onHoverEnd({\n type: 'hoverend',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(false);\n }\n\n setHovered(false);\n };\n\n let hoverProps: DOMAttributes = {};\n\n if (typeof PointerEvent !== 'undefined') {\n hoverProps.onPointerEnter = e => {\n if (globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') {\n return;\n }\n\n triggerHoverStart(e, e.pointerType);\n };\n\n hoverProps.onPointerLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, e.pointerType);\n }\n };\n } else if (process.env.NODE_ENV === 'test') {\n hoverProps.onTouchStart = () => {\n state.ignoreEmulatedMouseEvents = true;\n };\n\n hoverProps.onMouseEnter = e => {\n if (!state.ignoreEmulatedMouseEvents && !globalIgnoreEmulatedMouseEvents) {\n triggerHoverStart(e, 'mouse');\n }\n\n state.ignoreEmulatedMouseEvents = false;\n };\n\n hoverProps.onMouseLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, 'mouse');\n }\n };\n }\n return {hoverProps, triggerHoverEnd};\n }, [\n onHoverStart,\n onHoverChange,\n onHoverEnd,\n isDisabled,\n state,\n addGlobalListener,\n removeAllGlobalListeners\n ]);\n\n useEffect(() => {\n // Call the triggerHoverEnd as soon as isDisabled changes to true\n // Safe to call triggerHoverEnd, it will early return if we aren't currently hovering\n if (isDisabled) {\n triggerHoverEnd({currentTarget: state.target}, state.pointerType);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDisabled]);\n\n return {\n hoverProps,\n isHovered\n };\n}\n"],"names":[],"version":3,"file":"useHover.js.map"}
@@ -77,7 +77,8 @@ function $e969f22b6713ca4a$export$ae780daf29e6d456(props) {
77
77
  // However, a pointerover event will be fired on the new target the mouse is over.
78
78
  // In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.
79
79
  addGlobalListener((0, $d447af545b77c9f1$export$b204af158042fbac)((0, $23f2114a1b82827e$export$e58f029f0fbfdb29)(event)), 'pointerover', (e)=>{
80
- if (state.isHovered && state.target && !(0, $23f2114a1b82827e$export$4282f70798064fe0)(state.target, (0, $23f2114a1b82827e$export$e58f029f0fbfdb29)(e))) triggerHoverEnd(e, e.pointerType);
80
+ if (state.isHovered && state.target && !(0, $23f2114a1b82827e$export$4282f70798064fe0)(state.target, (0, $23f2114a1b82827e$export$e58f029f0fbfdb29)(e))) // oxlint-disable-next-line react/react-compiler
81
+ triggerHoverEnd(e, e.pointerType);
81
82
  }, {
82
83
  capture: true
83
84
  });
@@ -1 +1 @@
1
- {"mappings":";;;;;AAAA;;;;;;;;;;CAUC,GAED,kEAAkE;AAClE,2DAA2D;AAC3D,yDAAyD;AACzD,kHAAkH;;;;;AAmBlH,oGAAoG;AACpG,iFAAiF;AACjF,sDAAsD;AACtD,IAAI,wDAAk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F,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,QAAQ;YAC1C,WAAW,YAAY,GAAG;gBACxB,MAAM,yBAAyB,GAAG;YACpC;YAEA,WAAW,YAAY,GAAG,CAAA;gBACxB,IAAI,CAAC,MAAM,yBAAyB,IAAI,CAAC,uDACvC,kBAAkB,GAAG;gBAGvB,MAAM,yBAAyB,GAAG;YACpC;YAEA,WAAW,YAAY,GAAG,CAAA;gBACxB,IAAI,CAAC,cAAc,CAAA,GAAA,yCAAW,EAAE,EAAE,aAAa,EAAE,CAAA,GAAA,yCAAa,EAAE,KAC9D,gBAAgB,GAAG;YAEvB;QACF;QACA,OAAO;wBAAC;6BAAY;QAAe;IACrC,GAAG;QACD;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,CAAA,GAAA,gBAAQ,EAAE;QACR,iEAAiE;QACjE,qFAAqF;QACrF,IAAI,YACF,gBAAgB;YAAC,eAAe,MAAM,MAAM;QAAA,GAAG,MAAM,WAAW;IAElE,uDAAuD;IACzD,GAAG;QAAC;KAAW;IAEf,OAAO;oBACL;mBACA;IACF;AACF","sources":["packages/react-aria/src/interactions/useHover.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {DOMAttributes, HoverEvents} from '@react-types/shared';\nimport {getEventTarget, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {getOwnerDocument} from '../utils/domHelpers';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {useGlobalListeners} from '../utils/useGlobalListeners';\n\nexport interface HoverProps extends HoverEvents {\n /** Whether the hover events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface HoverResult {\n /** Props to spread on the target element. */\n hoverProps: DOMAttributes;\n isHovered: boolean;\n}\n\n// iOS fires onPointerEnter twice: once with pointerType=\"touch\" and again with pointerType=\"mouse\".\n// We want to ignore these emulated events so they do not trigger hover behavior.\n// See https://bugs.webkit.org/show_bug.cgi?id=214609.\nlet globalIgnoreEmulatedMouseEvents = false;\nlet hoverCount = 0;\n\nfunction setGlobalIgnoreEmulatedMouseEvents() {\n globalIgnoreEmulatedMouseEvents = true;\n\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => {\n globalIgnoreEmulatedMouseEvents = false;\n }, 500);\n}\n\nfunction handleGlobalPointerEvent(e: PointerEvent) {\n if (e.pointerType === 'touch') {\n setGlobalIgnoreEmulatedMouseEvents();\n }\n}\n\nfunction setupGlobalTouchEvents() {\n let ownerDocument = getOwnerDocument(null);\n if (typeof ownerDocument === 'undefined') {\n return;\n }\n\n if (hoverCount === 0) {\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.addEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.addEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n }\n\n hoverCount++;\n return () => {\n hoverCount--;\n if (hoverCount > 0) {\n return;\n }\n\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.removeEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.removeEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n };\n}\n\n/**\n * Handles pointer hover interactions for an element. Normalizes behavior\n * across browsers and platforms, and ignores emulated mouse events on touch devices.\n */\nexport function useHover(props: HoverProps): HoverResult {\n let {onHoverStart, onHoverChange, onHoverEnd, isDisabled} = props;\n\n let [isHovered, setHovered] = useState(false);\n let state = useRef({\n isHovered: false,\n ignoreEmulatedMouseEvents: false,\n pointerType: '',\n target: null\n }).current;\n\n useEffect(setupGlobalTouchEvents, []);\n let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\n\n let {hoverProps, triggerHoverEnd} = useMemo(() => {\n let triggerHoverStart = (event, pointerType) => {\n state.pointerType = pointerType;\n if (\n isDisabled ||\n pointerType === 'touch' ||\n state.isHovered ||\n !nodeContains(event.currentTarget, getEventTarget(event) as Element)\n ) {\n return;\n }\n\n state.isHovered = true;\n let target = event.currentTarget;\n state.target = target;\n\n // When an element that is hovered over is removed, no pointerleave event is fired by the browser,\n // even though the originally hovered target may have shrunk in size so it is no longer hovered.\n // However, a pointerover event will be fired on the new target the mouse is over.\n // In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.\n addGlobalListener(\n getOwnerDocument(getEventTarget(event) as Element),\n 'pointerover',\n e => {\n if (\n state.isHovered &&\n state.target &&\n !nodeContains(state.target, getEventTarget(e) as Element)\n ) {\n triggerHoverEnd(e, e.pointerType);\n }\n },\n {capture: true}\n );\n\n if (onHoverStart) {\n onHoverStart({\n type: 'hoverstart',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(true);\n }\n\n setHovered(true);\n };\n\n let triggerHoverEnd = (event, pointerType) => {\n let target = state.target;\n state.pointerType = '';\n state.target = null;\n\n if (pointerType === 'touch' || !state.isHovered || !target) {\n return;\n }\n\n state.isHovered = false;\n removeAllGlobalListeners();\n\n if (onHoverEnd) {\n onHoverEnd({\n type: 'hoverend',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(false);\n }\n\n setHovered(false);\n };\n\n let hoverProps: DOMAttributes = {};\n\n if (typeof PointerEvent !== 'undefined') {\n hoverProps.onPointerEnter = e => {\n if (globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') {\n return;\n }\n\n triggerHoverStart(e, e.pointerType);\n };\n\n hoverProps.onPointerLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, e.pointerType);\n }\n };\n } else if (process.env.NODE_ENV === 'test') {\n hoverProps.onTouchStart = () => {\n state.ignoreEmulatedMouseEvents = true;\n };\n\n hoverProps.onMouseEnter = e => {\n if (!state.ignoreEmulatedMouseEvents && !globalIgnoreEmulatedMouseEvents) {\n triggerHoverStart(e, 'mouse');\n }\n\n state.ignoreEmulatedMouseEvents = false;\n };\n\n hoverProps.onMouseLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, 'mouse');\n }\n };\n }\n return {hoverProps, triggerHoverEnd};\n }, [\n onHoverStart,\n onHoverChange,\n onHoverEnd,\n isDisabled,\n state,\n addGlobalListener,\n removeAllGlobalListeners\n ]);\n\n useEffect(() => {\n // Call the triggerHoverEnd as soon as isDisabled changes to true\n // Safe to call triggerHoverEnd, it will early return if we aren't currently hovering\n if (isDisabled) {\n triggerHoverEnd({currentTarget: state.target}, state.pointerType);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDisabled]);\n\n return {\n hoverProps,\n isHovered\n };\n}\n"],"names":[],"version":3,"file":"useHover.mjs.map"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC,GAED,kEAAkE;AAClE,2DAA2D;AAC3D,yDAAyD;AACzD,kHAAkH;;;;;AAmBlH,oGAAoG;AACpG,iFAAiF;AACjF,sDAAsD;AACtD,IAAI,wDAAkC;AACtC,IAAI,mCAAa;AAEjB,SAAS;IACP,wDAAkC;IAElC,wFAAwF;IACxF,sFAAsF;IACtF,wFAAwF;IACxF,oEAAoE;IACp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BAAyB,GAAG;YACpC;YAEA,WAAW,YAAY,GAAG,CAAA;gBACxB,IAAI,CAAC,MAAM,yBAAyB,IAAI,CAAC,uDACvC,kBAAkB,GAAG;gBAGvB,MAAM,yBAAyB,GAAG;YACpC;YAEA,WAAW,YAAY,GAAG,CAAA;gBACxB,IAAI,CAAC,cAAc,CAAA,GAAA,yCAAW,EAAE,EAAE,aAAa,EAAE,CAAA,GAAA,yCAAa,EAAE,KAC9D,gBAAgB,GAAG;YAEvB;QACF;QACA,OAAO;wBAAC;6BAAY;QAAe;IACrC,GAAG;QACD;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,CAAA,GAAA,gBAAQ,EAAE;QACR,iEAAiE;QACjE,qFAAqF;QACrF,IAAI,YACF,gBAAgB;YAAC,eAAe,MAAM,MAAM;QAAA,GAAG,MAAM,WAAW;IAElE,uDAAuD;IACzD,GAAG;QAAC;KAAW;IAEf,OAAO;oBACL;mBACA;IACF;AACF","sources":["packages/react-aria/src/interactions/useHover.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {DOMAttributes, HoverEvents} from '@react-types/shared';\nimport {getEventTarget, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {getOwnerDocument} from '../utils/domHelpers';\nimport {useEffect, useMemo, useRef, useState} from 'react';\nimport {useGlobalListeners} from '../utils/useGlobalListeners';\n\nexport interface HoverProps extends HoverEvents {\n /** Whether the hover events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface HoverResult {\n /** Props to spread on the target element. */\n hoverProps: DOMAttributes;\n isHovered: boolean;\n}\n\n// iOS fires onPointerEnter twice: once with pointerType=\"touch\" and again with pointerType=\"mouse\".\n// We want to ignore these emulated events so they do not trigger hover behavior.\n// See https://bugs.webkit.org/show_bug.cgi?id=214609.\nlet globalIgnoreEmulatedMouseEvents = false;\nlet hoverCount = 0;\n\nfunction setGlobalIgnoreEmulatedMouseEvents() {\n globalIgnoreEmulatedMouseEvents = true;\n\n // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter\n // with pointerType=\"mouse\" immediately after onPointerUp and before onFocus. On other\n // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in\n // the distant future because a user previously touched the element.\n setTimeout(() => {\n globalIgnoreEmulatedMouseEvents = false;\n }, 500);\n}\n\nfunction handleGlobalPointerEvent(e: PointerEvent) {\n if (e.pointerType === 'touch') {\n setGlobalIgnoreEmulatedMouseEvents();\n }\n}\n\nfunction setupGlobalTouchEvents() {\n let ownerDocument = getOwnerDocument(null);\n if (typeof ownerDocument === 'undefined') {\n return;\n }\n\n if (hoverCount === 0) {\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.addEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.addEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n }\n\n hoverCount++;\n return () => {\n hoverCount--;\n if (hoverCount > 0) {\n return;\n }\n\n if (typeof PointerEvent !== 'undefined') {\n ownerDocument.removeEventListener('pointerup', handleGlobalPointerEvent);\n } else if (process.env.NODE_ENV === 'test') {\n ownerDocument.removeEventListener('touchend', setGlobalIgnoreEmulatedMouseEvents);\n }\n };\n}\n\n/**\n * Handles pointer hover interactions for an element. Normalizes behavior\n * across browsers and platforms, and ignores emulated mouse events on touch devices.\n */\nexport function useHover(props: HoverProps): HoverResult {\n let {onHoverStart, onHoverChange, onHoverEnd, isDisabled} = props;\n\n let [isHovered, setHovered] = useState(false);\n let state = useRef({\n isHovered: false,\n ignoreEmulatedMouseEvents: false,\n pointerType: '',\n target: null\n }).current;\n\n useEffect(setupGlobalTouchEvents, []);\n let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\n\n let {hoverProps, triggerHoverEnd} = useMemo(() => {\n let triggerHoverStart = (event, pointerType) => {\n state.pointerType = pointerType;\n if (\n isDisabled ||\n pointerType === 'touch' ||\n state.isHovered ||\n !nodeContains(event.currentTarget, getEventTarget(event) as Element)\n ) {\n return;\n }\n\n state.isHovered = true;\n let target = event.currentTarget;\n state.target = target;\n\n // When an element that is hovered over is removed, no pointerleave event is fired by the browser,\n // even though the originally hovered target may have shrunk in size so it is no longer hovered.\n // However, a pointerover event will be fired on the new target the mouse is over.\n // In Chrome this happens immediately. In Safari and Firefox, it happens upon moving the mouse one pixel.\n addGlobalListener(\n getOwnerDocument(getEventTarget(event) as Element),\n 'pointerover',\n e => {\n if (\n state.isHovered &&\n state.target &&\n !nodeContains(state.target, getEventTarget(e) as Element)\n ) {\n // oxlint-disable-next-line react/react-compiler\n triggerHoverEnd(e, e.pointerType);\n }\n },\n {capture: true}\n );\n\n if (onHoverStart) {\n onHoverStart({\n type: 'hoverstart',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(true);\n }\n\n setHovered(true);\n };\n\n let triggerHoverEnd = (event, pointerType) => {\n let target = state.target;\n state.pointerType = '';\n state.target = null;\n\n if (pointerType === 'touch' || !state.isHovered || !target) {\n return;\n }\n\n state.isHovered = false;\n removeAllGlobalListeners();\n\n if (onHoverEnd) {\n onHoverEnd({\n type: 'hoverend',\n target,\n pointerType\n });\n }\n\n if (onHoverChange) {\n onHoverChange(false);\n }\n\n setHovered(false);\n };\n\n let hoverProps: DOMAttributes = {};\n\n if (typeof PointerEvent !== 'undefined') {\n hoverProps.onPointerEnter = e => {\n if (globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') {\n return;\n }\n\n triggerHoverStart(e, e.pointerType);\n };\n\n hoverProps.onPointerLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, e.pointerType);\n }\n };\n } else if (process.env.NODE_ENV === 'test') {\n hoverProps.onTouchStart = () => {\n state.ignoreEmulatedMouseEvents = true;\n };\n\n hoverProps.onMouseEnter = e => {\n if (!state.ignoreEmulatedMouseEvents && !globalIgnoreEmulatedMouseEvents) {\n triggerHoverStart(e, 'mouse');\n }\n\n state.ignoreEmulatedMouseEvents = false;\n };\n\n hoverProps.onMouseLeave = e => {\n if (!isDisabled && nodeContains(e.currentTarget, getEventTarget(e) as Element)) {\n triggerHoverEnd(e, 'mouse');\n }\n };\n }\n return {hoverProps, triggerHoverEnd};\n }, [\n onHoverStart,\n onHoverChange,\n onHoverEnd,\n isDisabled,\n state,\n addGlobalListener,\n removeAllGlobalListeners\n ]);\n\n useEffect(() => {\n // Call the triggerHoverEnd as soon as isDisabled changes to true\n // Safe to call triggerHoverEnd, it will early return if we aren't currently hovering\n if (isDisabled) {\n triggerHoverEnd({currentTarget: state.target}, state.pointerType);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isDisabled]);\n\n return {\n hoverProps,\n isHovered\n };\n}\n"],"names":[],"version":3,"file":"useHover.mjs.map"}
@@ -1,4 +1,7 @@
1
+ var $2f95486cfdaa743c$exports = require("../utils/chain.cjs");
1
2
  var $4a9c68c547fcab16$exports = require("./createEventHandler.cjs");
3
+ var $108d3311901ff4af$exports = require("./createKeyboardShortcutHandler.cjs");
4
+ var $da02ee888921bc9e$exports = require("../utils/shadowdom/DOMFunctions.cjs");
2
5
 
3
6
 
4
7
  function $parcel$export(e, n, v, s) {
@@ -17,11 +20,52 @@ $parcel$export(module.exports, "useKeyboard", function () { return $6d2f10bb8b35
17
20
  * OF ANY KIND, either express or implied. See the License for the specific language
18
21
  * governing permissions and limitations under the License.
19
22
  */
23
+
24
+
25
+
20
26
  function $6d2f10bb8b359da5$export$8f71654801c2f7cd(props) {
27
+ let { shortcuts: shortcuts, allowRepeats: allowRepeats = false, allowComposing: allowComposing = false } = props;
28
+ let onKeyDown;
29
+ let onKeyUp;
30
+ if (shortcuts) {
31
+ let shortcutHandler = (0, $108d3311901ff4af$exports.createKeyboardShortcutHandler)(shortcuts);
32
+ let shortcutOnKeyDown = (0, $4a9c68c547fcab16$exports.createEventHandler)((e)=>{
33
+ // If keyboard event didn't originate from a child of the current target,
34
+ // then it's a React event coming through a portal. We should ignore it.
35
+ if (!(0, $da02ee888921bc9e$exports.nodeContains)(e.currentTarget, (0, $da02ee888921bc9e$exports.getEventTarget)(e))) {
36
+ e.continuePropagation();
37
+ return;
38
+ }
39
+ if (e.nativeEvent?.repeat && !allowRepeats || e.nativeEvent?.isComposing && !allowComposing) {
40
+ e.continuePropagation();
41
+ return;
42
+ }
43
+ shortcutHandler(e);
44
+ });
45
+ let shortcutOnKeyUp = (0, $4a9c68c547fcab16$exports.createEventHandler)((e)=>{
46
+ // If keyboard event didn't originate from a child of the current target,
47
+ // then it's a React event coming through a portal. We should ignore it.
48
+ if (!(0, $da02ee888921bc9e$exports.nodeContains)(e.currentTarget, (0, $da02ee888921bc9e$exports.getEventTarget)(e))) {
49
+ e.continuePropagation();
50
+ return;
51
+ }
52
+ if (e.nativeEvent?.repeat && !allowRepeats || e.nativeEvent?.isComposing && !allowComposing) {
53
+ e.continuePropagation();
54
+ return;
55
+ }
56
+ // implement shortcut handler on keyup, what should the map be called? or should it be another syntax on shortcuts?
57
+ e.continuePropagation();
58
+ });
59
+ onKeyDown = props.onKeyDown ? (0, $2f95486cfdaa743c$exports.chain)(props.onKeyDown, shortcutOnKeyDown) : shortcutOnKeyDown;
60
+ onKeyUp = props.onKeyUp ? (0, $2f95486cfdaa743c$exports.chain)(props.onKeyUp, shortcutOnKeyUp) : shortcutOnKeyUp;
61
+ } else {
62
+ onKeyDown = (0, $4a9c68c547fcab16$exports.createEventHandler)(props.onKeyDown);
63
+ onKeyUp = (0, $4a9c68c547fcab16$exports.createEventHandler)(props.onKeyUp);
64
+ }
21
65
  return {
22
66
  keyboardProps: props.isDisabled ? {} : {
23
- onKeyDown: (0, $4a9c68c547fcab16$exports.createEventHandler)(props.onKeyDown),
24
- onKeyUp: (0, $4a9c68c547fcab16$exports.createEventHandler)(props.onKeyUp)
67
+ onKeyDown: onKeyDown,
68
+ onKeyUp: onKeyUp
25
69
  }
26
70
  };
27
71
  }
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAkBM,SAAS,0CAAY,KAAoB;IAC9C,OAAO;QACL,eAAe,MAAM,UAAU,GAC3B,CAAC,IACD;YACE,WAAW,CAAA,GAAA,4CAAiB,EAAE,MAAM,SAAS;YAC7C,SAAS,CAAA,GAAA,4CAAiB,EAAE,MAAM,OAAO;QAC3C;IACN;AACF","sources":["packages/react-aria/src/interactions/useKeyboard.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {createEventHandler} from './createEventHandler';\nimport {DOMAttributes, KeyboardEvents} from '@react-types/shared';\n\nexport interface KeyboardProps extends KeyboardEvents {\n /** Whether the keyboard events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface KeyboardResult {\n /** Props to spread onto the target element. */\n keyboardProps: DOMAttributes;\n}\n\n/**\n * Handles keyboard interactions for a focusable element.\n */\nexport function useKeyboard(props: KeyboardProps): KeyboardResult {\n return {\n keyboardProps: props.isDisabled\n ? {}\n : {\n onKeyDown: createEventHandler(props.onKeyDown),\n onKeyUp: createEventHandler(props.onKeyUp)\n }\n };\n}\n"],"names":[],"version":3,"file":"useKeyboard.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA+BM,SAAS,0CAAY,KAAoB;IAC9C,IAAI,aAAC,SAAS,gBAAE,eAAe,uBAAO,iBAAiB,OAAM,GAAG;IAChE,IAAI;IACJ,IAAI;IACJ,IAAI,WAAW;QACb,IAAI,kBAAkB,CAAA,GAAA,uDAA4B,EAAE;QACpD,IAAI,oBAAoB,CAAA,GAAA,4CAAiB,EAA2B,CAAA;YAClE,yEAAyE;YACzE,wEAAwE;YACxE,IAAI,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,aAAa,EAAE,CAAA,GAAA,wCAAa,EAAE,KAAK;gBACrD,EAAE,mBAAmB;gBACrB;YACF;YACA,IACE,AAAC,EAAE,WAAW,EAAE,UAAU,CAAC,gBAC1B,EAAE,WAAW,EAAE,eAAe,CAAC,gBAChC;gBACA,EAAE,mBAAmB;gBACrB;YACF;YAEA,gBAAgB;QAClB;QACA,IAAI,kBAAkB,CAAA,GAAA,4CAAiB,EAA2B,CAAA;YAChE,yEAAyE;YACzE,wEAAwE;YACxE,IAAI,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,aAAa,EAAE,CAAA,GAAA,wCAAa,EAAE,KAAK;gBACrD,EAAE,mBAAmB;gBACrB;YACF;YACA,IACE,AAAC,EAAE,WAAW,EAAE,UAAU,CAAC,gBAC1B,EAAE,WAAW,EAAE,eAAe,CAAC,gBAChC;gBACA,EAAE,mBAAmB;gBACrB;YACF;YACA,mHAAmH;YACnH,EAAE,mBAAmB;QACvB;QACA,YAAY,MAAM,SAAS,GAAG,CAAA,GAAA,+BAAI,EAAE,MAAM,SAAS,EAAE,qBAAqB;QAC1E,UAAU,MAAM,OAAO,GAAG,CAAA,GAAA,+BAAI,EAAE,MAAM,OAAO,EAAE,mBAAmB;IACpE,OAAO;QACL,YAAY,CAAA,GAAA,4CAAiB,EAAE,MAAM,SAAS;QAC9C,UAAU,CAAA,GAAA,4CAAiB,EAAE,MAAM,OAAO;IAC5C;IACA,OAAO;QACL,eAAe,MAAM,UAAU,GAC3B,CAAC,IACD;uBACE;qBACA;QACF;IACN;AACF","sources":["packages/react-aria/src/interactions/useKeyboard.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain} from '../utils/chain';\nimport {createEventHandler} from './createEventHandler';\nimport {\n createKeyboardShortcutHandler,\n KeyboardShortcutBindings\n} from './createKeyboardShortcutHandler';\nimport {DOMAttributes, KeyboardEvents} from '@react-types/shared';\nimport {getEventTarget, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {KeyboardEvent as ReactKeyboardEvent} from 'react';\n\nexport interface KeyboardProps extends KeyboardEvents {\n /** Whether the keyboard events should be disabled. */\n isDisabled?: boolean;\n /** Keyboard shortcuts to handle. */\n shortcuts?: KeyboardShortcutBindings;\n /** Whether to allow repeating keys. Only affects shortcuts. */\n allowRepeats?: boolean;\n /** Whether to allow composing keys. Only affects shortcuts. */\n allowComposing?: boolean;\n}\n\nexport interface KeyboardResult {\n /** Props to spread onto the target element. */\n keyboardProps: DOMAttributes;\n}\n\n/**\n * Handles keyboard interactions for a focusable element.\n */\nexport function useKeyboard(props: KeyboardProps): KeyboardResult {\n let {shortcuts, allowRepeats = false, allowComposing = false} = props;\n let onKeyDown;\n let onKeyUp;\n if (shortcuts) {\n let shortcutHandler = createKeyboardShortcutHandler(shortcuts);\n let shortcutOnKeyDown = createEventHandler<ReactKeyboardEvent<any>>(e => {\n // If keyboard event didn't originate from a child of the current target,\n // then it's a React event coming through a portal. We should ignore it.\n if (!nodeContains(e.currentTarget, getEventTarget(e))) {\n e.continuePropagation();\n return;\n }\n if (\n (e.nativeEvent?.repeat && !allowRepeats) ||\n (e.nativeEvent?.isComposing && !allowComposing)\n ) {\n e.continuePropagation();\n return;\n }\n\n shortcutHandler(e);\n });\n let shortcutOnKeyUp = createEventHandler<ReactKeyboardEvent<any>>(e => {\n // If keyboard event didn't originate from a child of the current target,\n // then it's a React event coming through a portal. We should ignore it.\n if (!nodeContains(e.currentTarget, getEventTarget(e))) {\n e.continuePropagation();\n return;\n }\n if (\n (e.nativeEvent?.repeat && !allowRepeats) ||\n (e.nativeEvent?.isComposing && !allowComposing)\n ) {\n e.continuePropagation();\n return;\n }\n // implement shortcut handler on keyup, what should the map be called? or should it be another syntax on shortcuts?\n e.continuePropagation();\n });\n onKeyDown = props.onKeyDown ? chain(props.onKeyDown, shortcutOnKeyDown) : shortcutOnKeyDown;\n onKeyUp = props.onKeyUp ? chain(props.onKeyUp, shortcutOnKeyUp) : shortcutOnKeyUp;\n } else {\n onKeyDown = createEventHandler(props.onKeyDown);\n onKeyUp = createEventHandler(props.onKeyUp);\n }\n return {\n keyboardProps: props.isDisabled\n ? {}\n : {\n onKeyDown,\n onKeyUp\n }\n };\n}\n"],"names":[],"version":3,"file":"useKeyboard.cjs.map"}