react-aria 3.48.0 → 3.49.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 (1208) hide show
  1. package/dist/exports/CollectionBuilder.cjs.map +1 -1
  2. package/dist/exports/CollectionBuilder.js.map +1 -1
  3. package/dist/exports/CollectionBuilder.mjs.map +1 -1
  4. package/dist/exports/index.cjs +12 -0
  5. package/dist/exports/index.cjs.map +1 -1
  6. package/dist/exports/index.js +9 -1
  7. package/dist/exports/index.js.map +1 -1
  8. package/dist/exports/index.mjs +9 -1
  9. package/dist/exports/index.mjs.map +1 -1
  10. package/dist/exports/private/actiongroup/useActionGroup.cjs.map +1 -1
  11. package/dist/exports/private/actiongroup/useActionGroup.js.map +1 -1
  12. package/dist/exports/private/actiongroup/useActionGroup.mjs.map +1 -1
  13. package/dist/exports/private/actiongroup/useActionGroupItem.cjs.map +1 -1
  14. package/dist/exports/private/actiongroup/useActionGroupItem.js.map +1 -1
  15. package/dist/exports/private/actiongroup/useActionGroupItem.mjs.map +1 -1
  16. package/dist/exports/private/autocomplete/useSearchAutocomplete.cjs.map +1 -1
  17. package/dist/exports/private/autocomplete/useSearchAutocomplete.js.map +1 -1
  18. package/dist/exports/private/autocomplete/useSearchAutocomplete.mjs.map +1 -1
  19. package/dist/exports/private/collections/BaseCollection.cjs.map +1 -1
  20. package/dist/exports/private/collections/BaseCollection.js.map +1 -1
  21. package/dist/exports/private/collections/BaseCollection.mjs.map +1 -1
  22. package/dist/exports/private/collections/useCachedChildren.cjs.map +1 -1
  23. package/dist/exports/private/collections/useCachedChildren.js.map +1 -1
  24. package/dist/exports/private/collections/useCachedChildren.mjs.map +1 -1
  25. package/dist/exports/private/focus/FocusScope.cjs.map +1 -1
  26. package/dist/exports/private/focus/FocusScope.js.map +1 -1
  27. package/dist/exports/private/focus/FocusScope.mjs.map +1 -1
  28. package/dist/exports/private/focus/virtualFocus.cjs.map +1 -1
  29. package/dist/exports/private/focus/virtualFocus.js.map +1 -1
  30. package/dist/exports/private/focus/virtualFocus.mjs.map +1 -1
  31. package/dist/exports/private/grid/GridKeyboardDelegate.cjs.map +1 -1
  32. package/dist/exports/private/grid/GridKeyboardDelegate.js.map +1 -1
  33. package/dist/exports/private/grid/GridKeyboardDelegate.mjs.map +1 -1
  34. package/dist/exports/private/grid/useGridSelectionAnnouncement.cjs.map +1 -1
  35. package/dist/exports/private/grid/useGridSelectionAnnouncement.js.map +1 -1
  36. package/dist/exports/private/grid/useGridSelectionAnnouncement.mjs.map +1 -1
  37. package/dist/exports/private/grid/useGridSelectionCheckbox.cjs.map +1 -1
  38. package/dist/exports/private/grid/useGridSelectionCheckbox.js.map +1 -1
  39. package/dist/exports/private/grid/useGridSelectionCheckbox.mjs.map +1 -1
  40. package/dist/exports/private/grid/useHighlightSelectionDescription.cjs.map +1 -1
  41. package/dist/exports/private/grid/useHighlightSelectionDescription.js.map +1 -1
  42. package/dist/exports/private/grid/useHighlightSelectionDescription.mjs.map +1 -1
  43. package/dist/exports/private/interactions/useFocusVisible.cjs.map +1 -1
  44. package/dist/exports/private/interactions/useFocusVisible.js.map +1 -1
  45. package/dist/exports/private/interactions/useFocusVisible.mjs.map +1 -1
  46. package/dist/exports/private/interactions/useFocusable.cjs.map +1 -1
  47. package/dist/exports/private/interactions/useFocusable.js.map +1 -1
  48. package/dist/exports/private/interactions/useFocusable.mjs.map +1 -1
  49. package/dist/exports/private/landmark/useLandmark.cjs.map +1 -1
  50. package/dist/exports/private/landmark/useLandmark.js.map +1 -1
  51. package/dist/exports/private/landmark/useLandmark.mjs.map +1 -1
  52. package/dist/exports/private/live-announcer/LiveAnnouncer.cjs.map +1 -1
  53. package/dist/exports/private/live-announcer/LiveAnnouncer.js.map +1 -1
  54. package/dist/exports/private/live-announcer/LiveAnnouncer.mjs.map +1 -1
  55. package/dist/exports/private/overlays/useModal.cjs.map +1 -1
  56. package/dist/exports/private/overlays/useModal.js.map +1 -1
  57. package/dist/exports/private/overlays/useModal.mjs.map +1 -1
  58. package/dist/exports/private/selection/useSelectableCollection.cjs.map +1 -1
  59. package/dist/exports/private/selection/useSelectableCollection.js.map +1 -1
  60. package/dist/exports/private/selection/useSelectableCollection.mjs.map +1 -1
  61. package/dist/exports/private/selection/useSelectableItem.cjs.map +1 -1
  62. package/dist/exports/private/selection/useSelectableItem.js.map +1 -1
  63. package/dist/exports/private/selection/useSelectableItem.mjs.map +1 -1
  64. package/dist/exports/private/selection/useSelectableList.cjs.map +1 -1
  65. package/dist/exports/private/selection/useSelectableList.js.map +1 -1
  66. package/dist/exports/private/selection/useSelectableList.mjs.map +1 -1
  67. package/dist/exports/private/selection/useTypeSelect.cjs.map +1 -1
  68. package/dist/exports/private/selection/useTypeSelect.js.map +1 -1
  69. package/dist/exports/private/selection/useTypeSelect.mjs.map +1 -1
  70. package/dist/exports/private/spinbutton/useSpinButton.cjs.map +1 -1
  71. package/dist/exports/private/spinbutton/useSpinButton.js.map +1 -1
  72. package/dist/exports/private/spinbutton/useSpinButton.mjs.map +1 -1
  73. package/dist/exports/private/steplist/useStepList.cjs.map +1 -1
  74. package/dist/exports/private/steplist/useStepList.js.map +1 -1
  75. package/dist/exports/private/steplist/useStepList.mjs.map +1 -1
  76. package/dist/exports/private/steplist/useStepListItem.cjs.map +1 -1
  77. package/dist/exports/private/steplist/useStepListItem.js.map +1 -1
  78. package/dist/exports/private/steplist/useStepListItem.mjs.map +1 -1
  79. package/dist/exports/private/utils/openLink.cjs.map +1 -1
  80. package/dist/exports/private/utils/openLink.js.map +1 -1
  81. package/dist/exports/private/utils/openLink.mjs.map +1 -1
  82. package/dist/exports/private/utils/platform.cjs.map +1 -1
  83. package/dist/exports/private/utils/platform.js.map +1 -1
  84. package/dist/exports/private/utils/platform.mjs.map +1 -1
  85. package/dist/exports/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
  86. package/dist/exports/private/utils/shadowdom/DOMFunctions.js.map +1 -1
  87. package/dist/exports/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
  88. package/dist/exports/private/utils/shadowdom/ShadowTreeWalker.cjs.map +1 -1
  89. package/dist/exports/private/utils/shadowdom/ShadowTreeWalker.js.map +1 -1
  90. package/dist/exports/private/utils/shadowdom/ShadowTreeWalker.mjs.map +1 -1
  91. package/dist/exports/private/utils/useLoadMoreSentinel.cjs.map +1 -1
  92. package/dist/exports/private/utils/useLoadMoreSentinel.js.map +1 -1
  93. package/dist/exports/private/utils/useLoadMoreSentinel.mjs.map +1 -1
  94. package/dist/exports/private/virtualizer/useVirtualizerItem.cjs.map +1 -1
  95. package/dist/exports/private/virtualizer/useVirtualizerItem.js.map +1 -1
  96. package/dist/exports/private/virtualizer/useVirtualizerItem.mjs.map +1 -1
  97. package/dist/exports/private/virtualizer/utils.cjs.map +1 -1
  98. package/dist/exports/private/virtualizer/utils.js.map +1 -1
  99. package/dist/exports/private/virtualizer/utils.mjs.map +1 -1
  100. package/dist/exports/useAutocomplete.cjs.map +1 -1
  101. package/dist/exports/useAutocomplete.js.map +1 -1
  102. package/dist/exports/useAutocomplete.mjs.map +1 -1
  103. package/dist/exports/useBreadcrumbs.cjs.map +1 -1
  104. package/dist/exports/useBreadcrumbs.js.map +1 -1
  105. package/dist/exports/useBreadcrumbs.mjs.map +1 -1
  106. package/dist/exports/useButton.cjs.map +1 -1
  107. package/dist/exports/useButton.js.map +1 -1
  108. package/dist/exports/useButton.mjs.map +1 -1
  109. package/dist/exports/useCalendar.cjs +9 -0
  110. package/dist/exports/useCalendar.cjs.map +1 -1
  111. package/dist/exports/useCalendar.js +7 -1
  112. package/dist/exports/useCalendar.js.map +1 -1
  113. package/dist/exports/useCalendar.mjs +7 -1
  114. package/dist/exports/useCalendar.mjs.map +1 -1
  115. package/dist/exports/useClipboard.cjs.map +1 -1
  116. package/dist/exports/useClipboard.js.map +1 -1
  117. package/dist/exports/useClipboard.mjs.map +1 -1
  118. package/dist/exports/useColorArea.cjs.map +1 -1
  119. package/dist/exports/useColorArea.js.map +1 -1
  120. package/dist/exports/useColorArea.mjs.map +1 -1
  121. package/dist/exports/useColorField.cjs.map +1 -1
  122. package/dist/exports/useColorField.js.map +1 -1
  123. package/dist/exports/useColorField.mjs.map +1 -1
  124. package/dist/exports/useColorSlider.cjs.map +1 -1
  125. package/dist/exports/useColorSlider.js.map +1 -1
  126. package/dist/exports/useColorSlider.mjs.map +1 -1
  127. package/dist/exports/useColorWheel.cjs.map +1 -1
  128. package/dist/exports/useColorWheel.js.map +1 -1
  129. package/dist/exports/useColorWheel.mjs.map +1 -1
  130. package/dist/exports/useComboBox.cjs.map +1 -1
  131. package/dist/exports/useComboBox.js.map +1 -1
  132. package/dist/exports/useComboBox.mjs.map +1 -1
  133. package/dist/exports/useDateField.cjs.map +1 -1
  134. package/dist/exports/useDateField.js.map +1 -1
  135. package/dist/exports/useDateField.mjs.map +1 -1
  136. package/dist/exports/useDateRangePicker.cjs.map +1 -1
  137. package/dist/exports/useDateRangePicker.js.map +1 -1
  138. package/dist/exports/useDateRangePicker.mjs.map +1 -1
  139. package/dist/exports/useDisclosure.cjs +1 -1
  140. package/dist/exports/useDisclosure.cjs.map +1 -1
  141. package/dist/exports/useDisclosure.js +1 -1
  142. package/dist/exports/useDisclosure.js.map +1 -1
  143. package/dist/exports/useDisclosure.mjs +1 -1
  144. package/dist/exports/useDisclosure.mjs.map +1 -1
  145. package/dist/exports/useDrag.cjs.map +1 -1
  146. package/dist/exports/useDrag.js.map +1 -1
  147. package/dist/exports/useDrag.mjs.map +1 -1
  148. package/dist/exports/useDraggableCollection.cjs.map +1 -1
  149. package/dist/exports/useDraggableCollection.js.map +1 -1
  150. package/dist/exports/useDraggableCollection.mjs.map +1 -1
  151. package/dist/exports/useDrop.cjs.map +1 -1
  152. package/dist/exports/useDrop.js.map +1 -1
  153. package/dist/exports/useDrop.mjs.map +1 -1
  154. package/dist/exports/useDroppableCollection.cjs.map +1 -1
  155. package/dist/exports/useDroppableCollection.js.map +1 -1
  156. package/dist/exports/useDroppableCollection.mjs.map +1 -1
  157. package/dist/exports/useFocusable.cjs.map +1 -1
  158. package/dist/exports/useFocusable.js.map +1 -1
  159. package/dist/exports/useFocusable.mjs.map +1 -1
  160. package/dist/exports/useGridList.cjs.map +1 -1
  161. package/dist/exports/useGridList.js.map +1 -1
  162. package/dist/exports/useGridList.mjs.map +1 -1
  163. package/dist/exports/useInteractOutside.cjs.map +1 -1
  164. package/dist/exports/useInteractOutside.js.map +1 -1
  165. package/dist/exports/useInteractOutside.mjs.map +1 -1
  166. package/dist/exports/useLandmark.cjs.map +1 -1
  167. package/dist/exports/useLandmark.js.map +1 -1
  168. package/dist/exports/useLandmark.mjs.map +1 -1
  169. package/dist/exports/useListBox.cjs.map +1 -1
  170. package/dist/exports/useListBox.js.map +1 -1
  171. package/dist/exports/useListBox.mjs.map +1 -1
  172. package/dist/exports/useLocalizedStringFormatter.cjs.map +1 -1
  173. package/dist/exports/useLocalizedStringFormatter.js.map +1 -1
  174. package/dist/exports/useLocalizedStringFormatter.mjs.map +1 -1
  175. package/dist/exports/useMove.cjs.map +1 -1
  176. package/dist/exports/useMove.js.map +1 -1
  177. package/dist/exports/useMove.mjs.map +1 -1
  178. package/dist/exports/useOverlayPosition.cjs.map +1 -1
  179. package/dist/exports/useOverlayPosition.js.map +1 -1
  180. package/dist/exports/useOverlayPosition.mjs.map +1 -1
  181. package/dist/exports/useProgressBar.cjs.map +1 -1
  182. package/dist/exports/useProgressBar.js.map +1 -1
  183. package/dist/exports/useProgressBar.mjs.map +1 -1
  184. package/dist/exports/useRangeCalendar.cjs +15 -0
  185. package/dist/exports/useRangeCalendar.cjs.map +1 -1
  186. package/dist/exports/useRangeCalendar.js +11 -1
  187. package/dist/exports/useRangeCalendar.js.map +1 -1
  188. package/dist/exports/useRangeCalendar.mjs +11 -1
  189. package/dist/exports/useRangeCalendar.mjs.map +1 -1
  190. package/dist/exports/useSelect.cjs.map +1 -1
  191. package/dist/exports/useSelect.js.map +1 -1
  192. package/dist/exports/useSelect.mjs.map +1 -1
  193. package/dist/exports/useSlider.cjs.map +1 -1
  194. package/dist/exports/useSlider.js.map +1 -1
  195. package/dist/exports/useSlider.mjs.map +1 -1
  196. package/dist/exports/useTable.cjs.map +1 -1
  197. package/dist/exports/useTable.js.map +1 -1
  198. package/dist/exports/useTable.mjs.map +1 -1
  199. package/dist/exports/useTimeField.cjs.map +1 -1
  200. package/dist/exports/useTimeField.js.map +1 -1
  201. package/dist/exports/useTimeField.mjs.map +1 -1
  202. package/dist/exports/useToggleButton.cjs.map +1 -1
  203. package/dist/exports/useToggleButton.js.map +1 -1
  204. package/dist/exports/useToggleButton.mjs.map +1 -1
  205. package/dist/exports/useToggleButtonGroup.cjs.map +1 -1
  206. package/dist/exports/useToggleButtonGroup.js.map +1 -1
  207. package/dist/exports/useToggleButtonGroup.mjs.map +1 -1
  208. package/dist/exports/useTree.cjs.map +1 -1
  209. package/dist/exports/useTree.js.map +1 -1
  210. package/dist/exports/useTree.mjs.map +1 -1
  211. package/dist/private/actiongroup/useActionGroup.cjs +3 -3
  212. package/dist/private/actiongroup/useActionGroup.cjs.map +1 -1
  213. package/dist/private/actiongroup/useActionGroup.js +3 -3
  214. package/dist/private/actiongroup/useActionGroup.js.map +1 -1
  215. package/dist/private/actiongroup/useActionGroup.mjs +3 -3
  216. package/dist/private/actiongroup/useActionGroup.mjs.map +1 -1
  217. package/dist/private/actiongroup/useActionGroupItem.cjs +5 -4
  218. package/dist/private/actiongroup/useActionGroupItem.cjs.map +1 -1
  219. package/dist/private/actiongroup/useActionGroupItem.js +5 -4
  220. package/dist/private/actiongroup/useActionGroupItem.js.map +1 -1
  221. package/dist/private/actiongroup/useActionGroupItem.mjs +5 -4
  222. package/dist/private/actiongroup/useActionGroupItem.mjs.map +1 -1
  223. package/dist/private/aria-modal-polyfill/ariaModalPolyfill.cjs +7 -5
  224. package/dist/private/aria-modal-polyfill/ariaModalPolyfill.cjs.map +1 -1
  225. package/dist/private/aria-modal-polyfill/ariaModalPolyfill.js +7 -5
  226. package/dist/private/aria-modal-polyfill/ariaModalPolyfill.js.map +1 -1
  227. package/dist/private/aria-modal-polyfill/ariaModalPolyfill.mjs +7 -5
  228. package/dist/private/aria-modal-polyfill/ariaModalPolyfill.mjs.map +1 -1
  229. package/dist/private/autocomplete/useAutocomplete.cjs.map +1 -1
  230. package/dist/private/autocomplete/useAutocomplete.js.map +1 -1
  231. package/dist/private/autocomplete/useAutocomplete.mjs.map +1 -1
  232. package/dist/private/autocomplete/useSearchAutocomplete.cjs.map +1 -1
  233. package/dist/private/autocomplete/useSearchAutocomplete.js.map +1 -1
  234. package/dist/private/autocomplete/useSearchAutocomplete.mjs.map +1 -1
  235. package/dist/private/breadcrumbs/useBreadcrumbItem.cjs.map +1 -1
  236. package/dist/private/breadcrumbs/useBreadcrumbItem.js.map +1 -1
  237. package/dist/private/breadcrumbs/useBreadcrumbItem.mjs.map +1 -1
  238. package/dist/private/breadcrumbs/useBreadcrumbs.cjs.map +1 -1
  239. package/dist/private/breadcrumbs/useBreadcrumbs.js.map +1 -1
  240. package/dist/private/breadcrumbs/useBreadcrumbs.mjs.map +1 -1
  241. package/dist/private/button/useButton.cjs.map +1 -1
  242. package/dist/private/button/useButton.js.map +1 -1
  243. package/dist/private/button/useButton.mjs.map +1 -1
  244. package/dist/private/button/useToggleButton.cjs.map +1 -1
  245. package/dist/private/button/useToggleButton.js.map +1 -1
  246. package/dist/private/button/useToggleButton.mjs.map +1 -1
  247. package/dist/private/button/useToggleButtonGroup.cjs.map +1 -1
  248. package/dist/private/button/useToggleButtonGroup.js.map +1 -1
  249. package/dist/private/button/useToggleButtonGroup.mjs.map +1 -1
  250. package/dist/private/calendar/useCalendar.cjs.map +1 -1
  251. package/dist/private/calendar/useCalendar.js.map +1 -1
  252. package/dist/private/calendar/useCalendar.mjs.map +1 -1
  253. package/dist/private/calendar/useCalendarBase.cjs.map +1 -1
  254. package/dist/private/calendar/useCalendarBase.js.map +1 -1
  255. package/dist/private/calendar/useCalendarBase.mjs.map +1 -1
  256. package/dist/private/calendar/useCalendarCell.cjs +10 -14
  257. package/dist/private/calendar/useCalendarCell.cjs.map +1 -1
  258. package/dist/private/calendar/useCalendarCell.js +10 -14
  259. package/dist/private/calendar/useCalendarCell.js.map +1 -1
  260. package/dist/private/calendar/useCalendarCell.mjs +10 -14
  261. package/dist/private/calendar/useCalendarCell.mjs.map +1 -1
  262. package/dist/private/calendar/useCalendarGrid.cjs +9 -5
  263. package/dist/private/calendar/useCalendarGrid.cjs.map +1 -1
  264. package/dist/private/calendar/useCalendarGrid.js +10 -6
  265. package/dist/private/calendar/useCalendarGrid.js.map +1 -1
  266. package/dist/private/calendar/useCalendarGrid.mjs +10 -6
  267. package/dist/private/calendar/useCalendarGrid.mjs.map +1 -1
  268. package/dist/private/calendar/useCalendarHeading.cjs +56 -0
  269. package/dist/private/calendar/useCalendarHeading.cjs.map +1 -0
  270. package/dist/private/calendar/useCalendarHeading.js +52 -0
  271. package/dist/private/calendar/useCalendarHeading.js.map +1 -0
  272. package/dist/private/calendar/useCalendarHeading.mjs +51 -0
  273. package/dist/private/calendar/useCalendarHeading.mjs.map +1 -0
  274. package/dist/private/calendar/useCalendarMonthPicker.cjs +66 -0
  275. package/dist/private/calendar/useCalendarMonthPicker.cjs.map +1 -0
  276. package/dist/private/calendar/useCalendarMonthPicker.js +61 -0
  277. package/dist/private/calendar/useCalendarMonthPicker.js.map +1 -0
  278. package/dist/private/calendar/useCalendarMonthPicker.mjs +61 -0
  279. package/dist/private/calendar/useCalendarMonthPicker.mjs.map +1 -0
  280. package/dist/private/calendar/useCalendarYearPicker.cjs +90 -0
  281. package/dist/private/calendar/useCalendarYearPicker.cjs.map +1 -0
  282. package/dist/private/calendar/useCalendarYearPicker.js +86 -0
  283. package/dist/private/calendar/useCalendarYearPicker.js.map +1 -0
  284. package/dist/private/calendar/useCalendarYearPicker.mjs +85 -0
  285. package/dist/private/calendar/useCalendarYearPicker.mjs.map +1 -0
  286. package/dist/private/calendar/useRangeCalendar.cjs +1 -1
  287. package/dist/private/calendar/useRangeCalendar.cjs.map +1 -1
  288. package/dist/private/calendar/useRangeCalendar.js +1 -1
  289. package/dist/private/calendar/useRangeCalendar.js.map +1 -1
  290. package/dist/private/calendar/useRangeCalendar.mjs +1 -1
  291. package/dist/private/calendar/useRangeCalendar.mjs.map +1 -1
  292. package/dist/private/calendar/utils.cjs +20 -4
  293. package/dist/private/calendar/utils.cjs.map +1 -1
  294. package/dist/private/calendar/utils.js +22 -5
  295. package/dist/private/calendar/utils.js.map +1 -1
  296. package/dist/private/calendar/utils.mjs +20 -4
  297. package/dist/private/calendar/utils.mjs.map +1 -1
  298. package/dist/private/checkbox/useCheckbox.cjs +6 -35
  299. package/dist/private/checkbox/useCheckbox.cjs.map +1 -1
  300. package/dist/private/checkbox/useCheckbox.js +6 -35
  301. package/dist/private/checkbox/useCheckbox.js.map +1 -1
  302. package/dist/private/checkbox/useCheckbox.mjs +6 -35
  303. package/dist/private/checkbox/useCheckbox.mjs.map +1 -1
  304. package/dist/private/checkbox/useCheckboxGroup.cjs.map +1 -1
  305. package/dist/private/checkbox/useCheckboxGroup.js.map +1 -1
  306. package/dist/private/checkbox/useCheckboxGroup.mjs.map +1 -1
  307. package/dist/private/checkbox/useCheckboxGroupItem.cjs +1 -1
  308. package/dist/private/checkbox/useCheckboxGroupItem.cjs.map +1 -1
  309. package/dist/private/checkbox/useCheckboxGroupItem.js +1 -1
  310. package/dist/private/checkbox/useCheckboxGroupItem.js.map +1 -1
  311. package/dist/private/checkbox/useCheckboxGroupItem.mjs +1 -1
  312. package/dist/private/checkbox/useCheckboxGroupItem.mjs.map +1 -1
  313. package/dist/private/checkbox/utils.cjs.map +1 -1
  314. package/dist/private/checkbox/utils.js.map +1 -1
  315. package/dist/private/checkbox/utils.mjs.map +1 -1
  316. package/dist/private/collections/BaseCollection.cjs +4 -4
  317. package/dist/private/collections/BaseCollection.cjs.map +1 -1
  318. package/dist/private/collections/BaseCollection.js +4 -4
  319. package/dist/private/collections/BaseCollection.js.map +1 -1
  320. package/dist/private/collections/BaseCollection.mjs +4 -4
  321. package/dist/private/collections/BaseCollection.mjs.map +1 -1
  322. package/dist/private/collections/CollectionBuilder.cjs +5 -3
  323. package/dist/private/collections/CollectionBuilder.cjs.map +1 -1
  324. package/dist/private/collections/CollectionBuilder.js +5 -3
  325. package/dist/private/collections/CollectionBuilder.js.map +1 -1
  326. package/dist/private/collections/CollectionBuilder.mjs +5 -3
  327. package/dist/private/collections/CollectionBuilder.mjs.map +1 -1
  328. package/dist/private/collections/Document.cjs.map +1 -1
  329. package/dist/private/collections/Document.js.map +1 -1
  330. package/dist/private/collections/Document.mjs.map +1 -1
  331. package/dist/private/collections/Hidden.cjs.map +1 -1
  332. package/dist/private/collections/Hidden.js.map +1 -1
  333. package/dist/private/collections/Hidden.mjs.map +1 -1
  334. package/dist/private/collections/useCachedChildren.cjs +29 -8
  335. package/dist/private/collections/useCachedChildren.cjs.map +1 -1
  336. package/dist/private/collections/useCachedChildren.js +29 -8
  337. package/dist/private/collections/useCachedChildren.js.map +1 -1
  338. package/dist/private/collections/useCachedChildren.mjs +29 -8
  339. package/dist/private/collections/useCachedChildren.mjs.map +1 -1
  340. package/dist/private/color/useColorArea.cjs.map +1 -1
  341. package/dist/private/color/useColorArea.js.map +1 -1
  342. package/dist/private/color/useColorArea.mjs.map +1 -1
  343. package/dist/private/color/useColorAreaGradient.cjs +1 -1
  344. package/dist/private/color/useColorAreaGradient.cjs.map +1 -1
  345. package/dist/private/color/useColorAreaGradient.js +1 -1
  346. package/dist/private/color/useColorAreaGradient.js.map +1 -1
  347. package/dist/private/color/useColorAreaGradient.mjs +1 -1
  348. package/dist/private/color/useColorAreaGradient.mjs.map +1 -1
  349. package/dist/private/color/useColorChannelField.cjs.map +1 -1
  350. package/dist/private/color/useColorChannelField.js.map +1 -1
  351. package/dist/private/color/useColorChannelField.mjs.map +1 -1
  352. package/dist/private/color/useColorField.cjs +1 -1
  353. package/dist/private/color/useColorField.cjs.map +1 -1
  354. package/dist/private/color/useColorField.js +1 -1
  355. package/dist/private/color/useColorField.js.map +1 -1
  356. package/dist/private/color/useColorField.mjs +1 -1
  357. package/dist/private/color/useColorField.mjs.map +1 -1
  358. package/dist/private/color/useColorSlider.cjs +2 -2
  359. package/dist/private/color/useColorSlider.cjs.map +1 -1
  360. package/dist/private/color/useColorSlider.js +2 -2
  361. package/dist/private/color/useColorSlider.js.map +1 -1
  362. package/dist/private/color/useColorSlider.mjs +2 -2
  363. package/dist/private/color/useColorSlider.mjs.map +1 -1
  364. package/dist/private/color/useColorSwatch.cjs.map +1 -1
  365. package/dist/private/color/useColorSwatch.js.map +1 -1
  366. package/dist/private/color/useColorSwatch.mjs.map +1 -1
  367. package/dist/private/color/useColorWheel.cjs.map +1 -1
  368. package/dist/private/color/useColorWheel.js.map +1 -1
  369. package/dist/private/color/useColorWheel.mjs.map +1 -1
  370. package/dist/private/combobox/useComboBox.cjs +3 -3
  371. package/dist/private/combobox/useComboBox.cjs.map +1 -1
  372. package/dist/private/combobox/useComboBox.js +3 -3
  373. package/dist/private/combobox/useComboBox.js.map +1 -1
  374. package/dist/private/combobox/useComboBox.mjs +3 -3
  375. package/dist/private/combobox/useComboBox.mjs.map +1 -1
  376. package/dist/private/datepicker/useDateField.cjs.map +1 -1
  377. package/dist/private/datepicker/useDateField.js.map +1 -1
  378. package/dist/private/datepicker/useDateField.mjs.map +1 -1
  379. package/dist/private/datepicker/useDatePicker.cjs.map +1 -1
  380. package/dist/private/datepicker/useDatePicker.js.map +1 -1
  381. package/dist/private/datepicker/useDatePicker.mjs.map +1 -1
  382. package/dist/private/datepicker/useDatePickerGroup.cjs.map +1 -1
  383. package/dist/private/datepicker/useDatePickerGroup.js.map +1 -1
  384. package/dist/private/datepicker/useDatePickerGroup.mjs.map +1 -1
  385. package/dist/private/datepicker/useDateRangePicker.cjs.map +1 -1
  386. package/dist/private/datepicker/useDateRangePicker.js.map +1 -1
  387. package/dist/private/datepicker/useDateRangePicker.mjs.map +1 -1
  388. package/dist/private/datepicker/useDateSegment.cjs +2 -2
  389. package/dist/private/datepicker/useDateSegment.cjs.map +1 -1
  390. package/dist/private/datepicker/useDateSegment.js +2 -2
  391. package/dist/private/datepicker/useDateSegment.js.map +1 -1
  392. package/dist/private/datepicker/useDateSegment.mjs +2 -2
  393. package/dist/private/datepicker/useDateSegment.mjs.map +1 -1
  394. package/dist/private/datepicker/useDisplayNames.cjs.map +1 -1
  395. package/dist/private/datepicker/useDisplayNames.js.map +1 -1
  396. package/dist/private/datepicker/useDisplayNames.mjs.map +1 -1
  397. package/dist/private/dialog/useDialog.cjs.map +1 -1
  398. package/dist/private/dialog/useDialog.js.map +1 -1
  399. package/dist/private/dialog/useDialog.mjs.map +1 -1
  400. package/dist/private/disclosure/useDisclosure.cjs.map +1 -1
  401. package/dist/private/disclosure/useDisclosure.js.map +1 -1
  402. package/dist/private/disclosure/useDisclosure.mjs.map +1 -1
  403. package/dist/private/dnd/DragManager.cjs.map +1 -1
  404. package/dist/private/dnd/DragManager.js.map +1 -1
  405. package/dist/private/dnd/DragManager.mjs.map +1 -1
  406. package/dist/private/dnd/DragPreview.cjs.map +1 -1
  407. package/dist/private/dnd/DragPreview.js.map +1 -1
  408. package/dist/private/dnd/DragPreview.mjs.map +1 -1
  409. package/dist/private/dnd/DropTargetKeyboardNavigation.cjs +16 -4
  410. package/dist/private/dnd/DropTargetKeyboardNavigation.cjs.map +1 -1
  411. package/dist/private/dnd/DropTargetKeyboardNavigation.js +16 -4
  412. package/dist/private/dnd/DropTargetKeyboardNavigation.js.map +1 -1
  413. package/dist/private/dnd/DropTargetKeyboardNavigation.mjs +16 -4
  414. package/dist/private/dnd/DropTargetKeyboardNavigation.mjs.map +1 -1
  415. package/dist/private/dnd/ListDropTargetDelegate.cjs.map +1 -1
  416. package/dist/private/dnd/ListDropTargetDelegate.js.map +1 -1
  417. package/dist/private/dnd/ListDropTargetDelegate.mjs.map +1 -1
  418. package/dist/private/dnd/constants.cjs.map +1 -1
  419. package/dist/private/dnd/constants.js.map +1 -1
  420. package/dist/private/dnd/constants.mjs.map +1 -1
  421. package/dist/private/dnd/useAutoScroll.cjs.map +1 -1
  422. package/dist/private/dnd/useAutoScroll.js.map +1 -1
  423. package/dist/private/dnd/useAutoScroll.mjs.map +1 -1
  424. package/dist/private/dnd/useClipboard.cjs.map +1 -1
  425. package/dist/private/dnd/useClipboard.js.map +1 -1
  426. package/dist/private/dnd/useClipboard.mjs.map +1 -1
  427. package/dist/private/dnd/useDrag.cjs.map +1 -1
  428. package/dist/private/dnd/useDrag.js.map +1 -1
  429. package/dist/private/dnd/useDrag.mjs.map +1 -1
  430. package/dist/private/dnd/useDraggableCollection.cjs.map +1 -1
  431. package/dist/private/dnd/useDraggableCollection.js.map +1 -1
  432. package/dist/private/dnd/useDraggableCollection.mjs.map +1 -1
  433. package/dist/private/dnd/useDraggableItem.cjs.map +1 -1
  434. package/dist/private/dnd/useDraggableItem.js.map +1 -1
  435. package/dist/private/dnd/useDraggableItem.mjs.map +1 -1
  436. package/dist/private/dnd/useDrop.cjs.map +1 -1
  437. package/dist/private/dnd/useDrop.js.map +1 -1
  438. package/dist/private/dnd/useDrop.mjs.map +1 -1
  439. package/dist/private/dnd/useDropIndicator.cjs.map +1 -1
  440. package/dist/private/dnd/useDropIndicator.js.map +1 -1
  441. package/dist/private/dnd/useDropIndicator.mjs.map +1 -1
  442. package/dist/private/dnd/useDroppableCollection.cjs.map +1 -1
  443. package/dist/private/dnd/useDroppableCollection.js.map +1 -1
  444. package/dist/private/dnd/useDroppableCollection.mjs.map +1 -1
  445. package/dist/private/dnd/useDroppableItem.cjs.map +1 -1
  446. package/dist/private/dnd/useDroppableItem.js.map +1 -1
  447. package/dist/private/dnd/useDroppableItem.mjs.map +1 -1
  448. package/dist/private/dnd/useVirtualDrop.cjs.map +1 -1
  449. package/dist/private/dnd/useVirtualDrop.js.map +1 -1
  450. package/dist/private/dnd/useVirtualDrop.mjs.map +1 -1
  451. package/dist/private/dnd/utils.cjs +1 -1
  452. package/dist/private/dnd/utils.cjs.map +1 -1
  453. package/dist/private/dnd/utils.js +1 -1
  454. package/dist/private/dnd/utils.js.map +1 -1
  455. package/dist/private/dnd/utils.mjs +1 -1
  456. package/dist/private/dnd/utils.mjs.map +1 -1
  457. package/dist/private/focus/FocusRing.cjs.map +1 -1
  458. package/dist/private/focus/FocusRing.js.map +1 -1
  459. package/dist/private/focus/FocusRing.mjs.map +1 -1
  460. package/dist/private/focus/FocusScope.cjs +4 -1
  461. package/dist/private/focus/FocusScope.cjs.map +1 -1
  462. package/dist/private/focus/FocusScope.js +4 -1
  463. package/dist/private/focus/FocusScope.js.map +1 -1
  464. package/dist/private/focus/FocusScope.mjs +4 -1
  465. package/dist/private/focus/FocusScope.mjs.map +1 -1
  466. package/dist/private/focus/useFocusRing.cjs.map +1 -1
  467. package/dist/private/focus/useFocusRing.js.map +1 -1
  468. package/dist/private/focus/useFocusRing.mjs.map +1 -1
  469. package/dist/private/focus/useHasTabbableChild.cjs.map +1 -1
  470. package/dist/private/focus/useHasTabbableChild.js.map +1 -1
  471. package/dist/private/focus/useHasTabbableChild.mjs.map +1 -1
  472. package/dist/private/form/useFormValidation.cjs.map +1 -1
  473. package/dist/private/form/useFormValidation.js.map +1 -1
  474. package/dist/private/form/useFormValidation.mjs.map +1 -1
  475. package/dist/private/grid/GridKeyboardDelegate.cjs +9 -9
  476. package/dist/private/grid/GridKeyboardDelegate.cjs.map +1 -1
  477. package/dist/private/grid/GridKeyboardDelegate.js +10 -10
  478. package/dist/private/grid/GridKeyboardDelegate.js.map +1 -1
  479. package/dist/private/grid/GridKeyboardDelegate.mjs +9 -9
  480. package/dist/private/grid/GridKeyboardDelegate.mjs.map +1 -1
  481. package/dist/private/grid/useGrid.cjs.map +1 -1
  482. package/dist/private/grid/useGrid.js.map +1 -1
  483. package/dist/private/grid/useGrid.mjs.map +1 -1
  484. package/dist/private/grid/useGridCell.cjs.map +1 -1
  485. package/dist/private/grid/useGridCell.js.map +1 -1
  486. package/dist/private/grid/useGridCell.mjs.map +1 -1
  487. package/dist/private/grid/useGridRow.cjs.map +1 -1
  488. package/dist/private/grid/useGridRow.js.map +1 -1
  489. package/dist/private/grid/useGridRow.mjs.map +1 -1
  490. package/dist/private/grid/useGridRowGroup.cjs.map +1 -1
  491. package/dist/private/grid/useGridRowGroup.js.map +1 -1
  492. package/dist/private/grid/useGridRowGroup.mjs.map +1 -1
  493. package/dist/private/grid/useGridSelectionAnnouncement.cjs.map +1 -1
  494. package/dist/private/grid/useGridSelectionAnnouncement.js.map +1 -1
  495. package/dist/private/grid/useGridSelectionAnnouncement.mjs.map +1 -1
  496. package/dist/private/grid/useGridSelectionCheckbox.cjs.map +1 -1
  497. package/dist/private/grid/useGridSelectionCheckbox.js.map +1 -1
  498. package/dist/private/grid/useGridSelectionCheckbox.mjs.map +1 -1
  499. package/dist/private/grid/useHighlightSelectionDescription.cjs.map +1 -1
  500. package/dist/private/grid/useHighlightSelectionDescription.js.map +1 -1
  501. package/dist/private/grid/useHighlightSelectionDescription.mjs.map +1 -1
  502. package/dist/private/grid/utils.cjs.map +1 -1
  503. package/dist/private/grid/utils.js.map +1 -1
  504. package/dist/private/grid/utils.mjs.map +1 -1
  505. package/dist/private/gridlist/useGridList.cjs.map +1 -1
  506. package/dist/private/gridlist/useGridList.js.map +1 -1
  507. package/dist/private/gridlist/useGridList.mjs.map +1 -1
  508. package/dist/private/gridlist/useGridListItem.cjs +5 -3
  509. package/dist/private/gridlist/useGridListItem.cjs.map +1 -1
  510. package/dist/private/gridlist/useGridListItem.js +6 -3
  511. package/dist/private/gridlist/useGridListItem.js.map +1 -1
  512. package/dist/private/gridlist/useGridListItem.mjs +5 -3
  513. package/dist/private/gridlist/useGridListItem.mjs.map +1 -1
  514. package/dist/private/gridlist/useGridListSection.cjs +3 -1
  515. package/dist/private/gridlist/useGridListSection.cjs.map +1 -1
  516. package/dist/private/gridlist/useGridListSection.js +3 -1
  517. package/dist/private/gridlist/useGridListSection.js.map +1 -1
  518. package/dist/private/gridlist/useGridListSection.mjs +3 -1
  519. package/dist/private/gridlist/useGridListSection.mjs.map +1 -1
  520. package/dist/private/gridlist/useGridListSelectionCheckbox.cjs.map +1 -1
  521. package/dist/private/gridlist/useGridListSelectionCheckbox.js.map +1 -1
  522. package/dist/private/gridlist/useGridListSelectionCheckbox.mjs.map +1 -1
  523. package/dist/private/gridlist/utils.cjs.map +1 -1
  524. package/dist/private/gridlist/utils.js.map +1 -1
  525. package/dist/private/gridlist/utils.mjs.map +1 -1
  526. package/dist/private/i18n/I18nProvider.cjs.map +1 -1
  527. package/dist/private/i18n/I18nProvider.js.map +1 -1
  528. package/dist/private/i18n/I18nProvider.mjs.map +1 -1
  529. package/dist/private/i18n/server.cjs.map +1 -1
  530. package/dist/private/i18n/server.js.map +1 -1
  531. package/dist/private/i18n/server.mjs.map +1 -1
  532. package/dist/private/i18n/useCollator.cjs.map +1 -1
  533. package/dist/private/i18n/useCollator.js.map +1 -1
  534. package/dist/private/i18n/useCollator.mjs.map +1 -1
  535. package/dist/private/i18n/useDateFormatter.cjs.map +1 -1
  536. package/dist/private/i18n/useDateFormatter.js.map +1 -1
  537. package/dist/private/i18n/useDateFormatter.mjs.map +1 -1
  538. package/dist/private/i18n/useDefaultLocale.cjs +2 -1
  539. package/dist/private/i18n/useDefaultLocale.cjs.map +1 -1
  540. package/dist/private/i18n/useDefaultLocale.js +2 -1
  541. package/dist/private/i18n/useDefaultLocale.js.map +1 -1
  542. package/dist/private/i18n/useDefaultLocale.mjs +2 -1
  543. package/dist/private/i18n/useDefaultLocale.mjs.map +1 -1
  544. package/dist/private/i18n/useFilter.cjs.map +1 -1
  545. package/dist/private/i18n/useFilter.js.map +1 -1
  546. package/dist/private/i18n/useFilter.mjs.map +1 -1
  547. package/dist/private/i18n/useListFormatter.cjs.map +1 -1
  548. package/dist/private/i18n/useListFormatter.js.map +1 -1
  549. package/dist/private/i18n/useListFormatter.mjs.map +1 -1
  550. package/dist/private/i18n/useLocalizedStringFormatter.cjs.map +1 -1
  551. package/dist/private/i18n/useLocalizedStringFormatter.js.map +1 -1
  552. package/dist/private/i18n/useLocalizedStringFormatter.mjs.map +1 -1
  553. package/dist/private/i18n/useNumberFormatter.cjs.map +1 -1
  554. package/dist/private/i18n/useNumberFormatter.js.map +1 -1
  555. package/dist/private/i18n/useNumberFormatter.mjs.map +1 -1
  556. package/dist/private/i18n/utils.cjs +2 -2
  557. package/dist/private/i18n/utils.cjs.map +1 -1
  558. package/dist/private/i18n/utils.js +2 -2
  559. package/dist/private/i18n/utils.js.map +1 -1
  560. package/dist/private/i18n/utils.mjs +2 -2
  561. package/dist/private/i18n/utils.mjs.map +1 -1
  562. package/dist/private/interactions/PressResponder.cjs.map +1 -1
  563. package/dist/private/interactions/PressResponder.js.map +1 -1
  564. package/dist/private/interactions/PressResponder.mjs.map +1 -1
  565. package/dist/private/interactions/Pressable.cjs.map +1 -1
  566. package/dist/private/interactions/Pressable.js.map +1 -1
  567. package/dist/private/interactions/Pressable.mjs.map +1 -1
  568. package/dist/private/interactions/context.cjs.map +1 -1
  569. package/dist/private/interactions/context.js.map +1 -1
  570. package/dist/private/interactions/context.mjs.map +1 -1
  571. package/dist/private/interactions/createEventHandler.cjs.map +1 -1
  572. package/dist/private/interactions/createEventHandler.js.map +1 -1
  573. package/dist/private/interactions/createEventHandler.mjs.map +1 -1
  574. package/dist/private/interactions/focusSafely.cjs.map +1 -1
  575. package/dist/private/interactions/focusSafely.js.map +1 -1
  576. package/dist/private/interactions/focusSafely.mjs.map +1 -1
  577. package/dist/private/interactions/textSelection.cjs.map +1 -1
  578. package/dist/private/interactions/textSelection.js.map +1 -1
  579. package/dist/private/interactions/textSelection.mjs.map +1 -1
  580. package/dist/private/interactions/useFocus.cjs.map +1 -1
  581. package/dist/private/interactions/useFocus.js.map +1 -1
  582. package/dist/private/interactions/useFocus.mjs.map +1 -1
  583. package/dist/private/interactions/useFocusVisible.cjs +4 -3
  584. package/dist/private/interactions/useFocusVisible.cjs.map +1 -1
  585. package/dist/private/interactions/useFocusVisible.js +4 -3
  586. package/dist/private/interactions/useFocusVisible.js.map +1 -1
  587. package/dist/private/interactions/useFocusVisible.mjs +4 -3
  588. package/dist/private/interactions/useFocusVisible.mjs.map +1 -1
  589. package/dist/private/interactions/useFocusWithin.cjs.map +1 -1
  590. package/dist/private/interactions/useFocusWithin.js.map +1 -1
  591. package/dist/private/interactions/useFocusWithin.mjs.map +1 -1
  592. package/dist/private/interactions/useFocusable.cjs.map +1 -1
  593. package/dist/private/interactions/useFocusable.js.map +1 -1
  594. package/dist/private/interactions/useFocusable.mjs.map +1 -1
  595. package/dist/private/interactions/useHover.cjs.map +1 -1
  596. package/dist/private/interactions/useHover.js.map +1 -1
  597. package/dist/private/interactions/useHover.mjs.map +1 -1
  598. package/dist/private/interactions/useInteractOutside.cjs.map +1 -1
  599. package/dist/private/interactions/useInteractOutside.js.map +1 -1
  600. package/dist/private/interactions/useInteractOutside.mjs.map +1 -1
  601. package/dist/private/interactions/useKeyboard.cjs.map +1 -1
  602. package/dist/private/interactions/useKeyboard.js.map +1 -1
  603. package/dist/private/interactions/useKeyboard.mjs.map +1 -1
  604. package/dist/private/interactions/useLongPress.cjs.map +1 -1
  605. package/dist/private/interactions/useLongPress.js.map +1 -1
  606. package/dist/private/interactions/useLongPress.mjs.map +1 -1
  607. package/dist/private/interactions/useMove.cjs.map +1 -1
  608. package/dist/private/interactions/useMove.js.map +1 -1
  609. package/dist/private/interactions/useMove.mjs.map +1 -1
  610. package/dist/private/interactions/usePress.cjs +11 -0
  611. package/dist/private/interactions/usePress.cjs.map +1 -1
  612. package/dist/private/interactions/usePress.js +12 -1
  613. package/dist/private/interactions/usePress.js.map +1 -1
  614. package/dist/private/interactions/usePress.mjs +12 -1
  615. package/dist/private/interactions/usePress.mjs.map +1 -1
  616. package/dist/private/interactions/useScrollWheel.cjs.map +1 -1
  617. package/dist/private/interactions/useScrollWheel.js.map +1 -1
  618. package/dist/private/interactions/useScrollWheel.mjs.map +1 -1
  619. package/dist/private/interactions/utils.cjs.map +1 -1
  620. package/dist/private/interactions/utils.js.map +1 -1
  621. package/dist/private/interactions/utils.mjs.map +1 -1
  622. package/dist/private/intl/tag/en-US.cjs.map +1 -1
  623. package/dist/private/intl/tag/en-US.js.map +1 -1
  624. package/dist/private/intl/tag/en-US.mjs.map +1 -1
  625. package/dist/private/label/useField.cjs.map +1 -1
  626. package/dist/private/label/useField.js.map +1 -1
  627. package/dist/private/label/useField.mjs.map +1 -1
  628. package/dist/private/label/useLabel.cjs.map +1 -1
  629. package/dist/private/label/useLabel.js.map +1 -1
  630. package/dist/private/label/useLabel.mjs.map +1 -1
  631. package/dist/private/landmark/useLandmark.cjs +2 -1
  632. package/dist/private/landmark/useLandmark.cjs.map +1 -1
  633. package/dist/private/landmark/useLandmark.js +2 -1
  634. package/dist/private/landmark/useLandmark.js.map +1 -1
  635. package/dist/private/landmark/useLandmark.mjs +2 -1
  636. package/dist/private/landmark/useLandmark.mjs.map +1 -1
  637. package/dist/private/link/useLink.cjs.map +1 -1
  638. package/dist/private/link/useLink.js.map +1 -1
  639. package/dist/private/link/useLink.mjs.map +1 -1
  640. package/dist/private/listbox/useListBox.cjs.map +1 -1
  641. package/dist/private/listbox/useListBox.js.map +1 -1
  642. package/dist/private/listbox/useListBox.mjs.map +1 -1
  643. package/dist/private/listbox/useListBoxSection.cjs.map +1 -1
  644. package/dist/private/listbox/useListBoxSection.js.map +1 -1
  645. package/dist/private/listbox/useListBoxSection.mjs.map +1 -1
  646. package/dist/private/listbox/useOption.cjs.map +1 -1
  647. package/dist/private/listbox/useOption.js.map +1 -1
  648. package/dist/private/listbox/useOption.mjs.map +1 -1
  649. package/dist/private/listbox/utils.cjs.map +1 -1
  650. package/dist/private/listbox/utils.js.map +1 -1
  651. package/dist/private/listbox/utils.mjs.map +1 -1
  652. package/dist/private/live-announcer/LiveAnnouncer.cjs +2 -2
  653. package/dist/private/live-announcer/LiveAnnouncer.cjs.map +1 -1
  654. package/dist/private/live-announcer/LiveAnnouncer.js +2 -2
  655. package/dist/private/live-announcer/LiveAnnouncer.js.map +1 -1
  656. package/dist/private/live-announcer/LiveAnnouncer.mjs +2 -2
  657. package/dist/private/live-announcer/LiveAnnouncer.mjs.map +1 -1
  658. package/dist/private/menu/useMenu.cjs.map +1 -1
  659. package/dist/private/menu/useMenu.js.map +1 -1
  660. package/dist/private/menu/useMenu.mjs.map +1 -1
  661. package/dist/private/menu/useMenuItem.cjs.map +1 -1
  662. package/dist/private/menu/useMenuItem.js.map +1 -1
  663. package/dist/private/menu/useMenuItem.mjs.map +1 -1
  664. package/dist/private/menu/useMenuSection.cjs.map +1 -1
  665. package/dist/private/menu/useMenuSection.js.map +1 -1
  666. package/dist/private/menu/useMenuSection.mjs.map +1 -1
  667. package/dist/private/menu/useMenuTrigger.cjs.map +1 -1
  668. package/dist/private/menu/useMenuTrigger.js.map +1 -1
  669. package/dist/private/menu/useMenuTrigger.mjs.map +1 -1
  670. package/dist/private/menu/useSafelyMouseToSubmenu.cjs.map +1 -1
  671. package/dist/private/menu/useSafelyMouseToSubmenu.js.map +1 -1
  672. package/dist/private/menu/useSafelyMouseToSubmenu.mjs.map +1 -1
  673. package/dist/private/menu/useSubmenuTrigger.cjs.map +1 -1
  674. package/dist/private/menu/useSubmenuTrigger.js.map +1 -1
  675. package/dist/private/menu/useSubmenuTrigger.mjs.map +1 -1
  676. package/dist/private/menu/utils.cjs.map +1 -1
  677. package/dist/private/menu/utils.js.map +1 -1
  678. package/dist/private/menu/utils.mjs.map +1 -1
  679. package/dist/private/meter/useMeter.cjs.map +1 -1
  680. package/dist/private/meter/useMeter.js.map +1 -1
  681. package/dist/private/meter/useMeter.mjs.map +1 -1
  682. package/dist/private/numberfield/useNumberField.cjs.map +1 -1
  683. package/dist/private/numberfield/useNumberField.js.map +1 -1
  684. package/dist/private/numberfield/useNumberField.mjs.map +1 -1
  685. package/dist/private/overlays/DismissButton.cjs.map +1 -1
  686. package/dist/private/overlays/DismissButton.js.map +1 -1
  687. package/dist/private/overlays/DismissButton.mjs.map +1 -1
  688. package/dist/private/overlays/Overlay.cjs.map +1 -1
  689. package/dist/private/overlays/Overlay.js.map +1 -1
  690. package/dist/private/overlays/Overlay.mjs.map +1 -1
  691. package/dist/private/overlays/PortalProvider.cjs.map +1 -1
  692. package/dist/private/overlays/PortalProvider.js.map +1 -1
  693. package/dist/private/overlays/PortalProvider.mjs.map +1 -1
  694. package/dist/private/overlays/ariaHideOutside.cjs.map +1 -1
  695. package/dist/private/overlays/ariaHideOutside.js.map +1 -1
  696. package/dist/private/overlays/ariaHideOutside.mjs.map +1 -1
  697. package/dist/private/overlays/calculatePosition.cjs +12 -13
  698. package/dist/private/overlays/calculatePosition.cjs.map +1 -1
  699. package/dist/private/overlays/calculatePosition.js +13 -14
  700. package/dist/private/overlays/calculatePosition.js.map +1 -1
  701. package/dist/private/overlays/calculatePosition.mjs +12 -13
  702. package/dist/private/overlays/calculatePosition.mjs.map +1 -1
  703. package/dist/private/overlays/useCloseOnScroll.cjs.map +1 -1
  704. package/dist/private/overlays/useCloseOnScroll.js.map +1 -1
  705. package/dist/private/overlays/useCloseOnScroll.mjs.map +1 -1
  706. package/dist/private/overlays/useModal.cjs.map +1 -1
  707. package/dist/private/overlays/useModal.js.map +1 -1
  708. package/dist/private/overlays/useModal.mjs.map +1 -1
  709. package/dist/private/overlays/useModalOverlay.cjs.map +1 -1
  710. package/dist/private/overlays/useModalOverlay.js.map +1 -1
  711. package/dist/private/overlays/useModalOverlay.mjs.map +1 -1
  712. package/dist/private/overlays/useOverlay.cjs.map +1 -1
  713. package/dist/private/overlays/useOverlay.js.map +1 -1
  714. package/dist/private/overlays/useOverlay.mjs.map +1 -1
  715. package/dist/private/overlays/useOverlayPosition.cjs.map +1 -1
  716. package/dist/private/overlays/useOverlayPosition.js.map +1 -1
  717. package/dist/private/overlays/useOverlayPosition.mjs.map +1 -1
  718. package/dist/private/overlays/useOverlayTrigger.cjs.map +1 -1
  719. package/dist/private/overlays/useOverlayTrigger.js.map +1 -1
  720. package/dist/private/overlays/useOverlayTrigger.mjs.map +1 -1
  721. package/dist/private/overlays/usePopover.cjs.map +1 -1
  722. package/dist/private/overlays/usePopover.js.map +1 -1
  723. package/dist/private/overlays/usePopover.mjs.map +1 -1
  724. package/dist/private/overlays/usePreventScroll.cjs.map +1 -1
  725. package/dist/private/overlays/usePreventScroll.js.map +1 -1
  726. package/dist/private/overlays/usePreventScroll.mjs.map +1 -1
  727. package/dist/private/progress/useProgressBar.cjs.map +1 -1
  728. package/dist/private/progress/useProgressBar.js.map +1 -1
  729. package/dist/private/progress/useProgressBar.mjs.map +1 -1
  730. package/dist/private/radio/useRadio.cjs +5 -0
  731. package/dist/private/radio/useRadio.cjs.map +1 -1
  732. package/dist/private/radio/useRadio.js +5 -0
  733. package/dist/private/radio/useRadio.js.map +1 -1
  734. package/dist/private/radio/useRadio.mjs +5 -0
  735. package/dist/private/radio/useRadio.mjs.map +1 -1
  736. package/dist/private/radio/useRadioGroup.cjs.map +1 -1
  737. package/dist/private/radio/useRadioGroup.js.map +1 -1
  738. package/dist/private/radio/useRadioGroup.mjs.map +1 -1
  739. package/dist/private/radio/utils.cjs.map +1 -1
  740. package/dist/private/radio/utils.js.map +1 -1
  741. package/dist/private/radio/utils.mjs.map +1 -1
  742. package/dist/private/searchfield/useSearchField.cjs.map +1 -1
  743. package/dist/private/searchfield/useSearchField.js.map +1 -1
  744. package/dist/private/searchfield/useSearchField.mjs.map +1 -1
  745. package/dist/private/select/HiddenSelect.cjs +2 -1
  746. package/dist/private/select/HiddenSelect.cjs.map +1 -1
  747. package/dist/private/select/HiddenSelect.js +2 -1
  748. package/dist/private/select/HiddenSelect.js.map +1 -1
  749. package/dist/private/select/HiddenSelect.mjs +2 -1
  750. package/dist/private/select/HiddenSelect.mjs.map +1 -1
  751. package/dist/private/select/useSelect.cjs +2 -2
  752. package/dist/private/select/useSelect.cjs.map +1 -1
  753. package/dist/private/select/useSelect.js +2 -2
  754. package/dist/private/select/useSelect.js.map +1 -1
  755. package/dist/private/select/useSelect.mjs +2 -2
  756. package/dist/private/select/useSelect.mjs.map +1 -1
  757. package/dist/private/selection/ListKeyboardDelegate.cjs +25 -25
  758. package/dist/private/selection/ListKeyboardDelegate.cjs.map +1 -1
  759. package/dist/private/selection/ListKeyboardDelegate.js +26 -26
  760. package/dist/private/selection/ListKeyboardDelegate.js.map +1 -1
  761. package/dist/private/selection/ListKeyboardDelegate.mjs +25 -25
  762. package/dist/private/selection/ListKeyboardDelegate.mjs.map +1 -1
  763. package/dist/private/selection/useSelectableCollection.cjs +1 -0
  764. package/dist/private/selection/useSelectableCollection.cjs.map +1 -1
  765. package/dist/private/selection/useSelectableCollection.js +1 -0
  766. package/dist/private/selection/useSelectableCollection.js.map +1 -1
  767. package/dist/private/selection/useSelectableCollection.mjs +1 -0
  768. package/dist/private/selection/useSelectableCollection.mjs.map +1 -1
  769. package/dist/private/selection/useSelectableItem.cjs.map +1 -1
  770. package/dist/private/selection/useSelectableItem.js.map +1 -1
  771. package/dist/private/selection/useSelectableItem.mjs.map +1 -1
  772. package/dist/private/selection/useSelectableList.cjs.map +1 -1
  773. package/dist/private/selection/useSelectableList.js.map +1 -1
  774. package/dist/private/selection/useSelectableList.mjs.map +1 -1
  775. package/dist/private/selection/useTypeSelect.cjs.map +1 -1
  776. package/dist/private/selection/useTypeSelect.js.map +1 -1
  777. package/dist/private/selection/useTypeSelect.mjs.map +1 -1
  778. package/dist/private/selection/utils.cjs.map +1 -1
  779. package/dist/private/selection/utils.js.map +1 -1
  780. package/dist/private/selection/utils.mjs.map +1 -1
  781. package/dist/private/separator/useSeparator.cjs.map +1 -1
  782. package/dist/private/separator/useSeparator.js.map +1 -1
  783. package/dist/private/separator/useSeparator.mjs.map +1 -1
  784. package/dist/private/slider/useSlider.cjs +4 -2
  785. package/dist/private/slider/useSlider.cjs.map +1 -1
  786. package/dist/private/slider/useSlider.js +4 -2
  787. package/dist/private/slider/useSlider.js.map +1 -1
  788. package/dist/private/slider/useSlider.mjs +4 -2
  789. package/dist/private/slider/useSlider.mjs.map +1 -1
  790. package/dist/private/slider/useSliderThumb.cjs.map +1 -1
  791. package/dist/private/slider/useSliderThumb.js.map +1 -1
  792. package/dist/private/slider/useSliderThumb.mjs.map +1 -1
  793. package/dist/private/slider/utils.cjs.map +1 -1
  794. package/dist/private/slider/utils.js.map +1 -1
  795. package/dist/private/slider/utils.mjs.map +1 -1
  796. package/dist/private/spinbutton/useSpinButton.cjs +2 -0
  797. package/dist/private/spinbutton/useSpinButton.cjs.map +1 -1
  798. package/dist/private/spinbutton/useSpinButton.js +2 -0
  799. package/dist/private/spinbutton/useSpinButton.js.map +1 -1
  800. package/dist/private/spinbutton/useSpinButton.mjs +2 -0
  801. package/dist/private/spinbutton/useSpinButton.mjs.map +1 -1
  802. package/dist/private/ssr/SSRProvider.cjs +6 -6
  803. package/dist/private/ssr/SSRProvider.cjs.map +1 -1
  804. package/dist/private/ssr/SSRProvider.js +6 -6
  805. package/dist/private/ssr/SSRProvider.js.map +1 -1
  806. package/dist/private/ssr/SSRProvider.mjs +6 -6
  807. package/dist/private/ssr/SSRProvider.mjs.map +1 -1
  808. package/dist/private/steplist/useStepList.cjs.map +1 -1
  809. package/dist/private/steplist/useStepList.js.map +1 -1
  810. package/dist/private/steplist/useStepList.mjs.map +1 -1
  811. package/dist/private/steplist/useStepListItem.cjs.map +1 -1
  812. package/dist/private/steplist/useStepListItem.js.map +1 -1
  813. package/dist/private/steplist/useStepListItem.mjs.map +1 -1
  814. package/dist/private/switch/useSwitch.cjs +2 -4
  815. package/dist/private/switch/useSwitch.cjs.map +1 -1
  816. package/dist/private/switch/useSwitch.js +2 -4
  817. package/dist/private/switch/useSwitch.js.map +1 -1
  818. package/dist/private/switch/useSwitch.mjs +2 -4
  819. package/dist/private/switch/useSwitch.mjs.map +1 -1
  820. package/dist/private/table/TableKeyboardDelegate.cjs +4 -4
  821. package/dist/private/table/TableKeyboardDelegate.cjs.map +1 -1
  822. package/dist/private/table/TableKeyboardDelegate.js +4 -4
  823. package/dist/private/table/TableKeyboardDelegate.js.map +1 -1
  824. package/dist/private/table/TableKeyboardDelegate.mjs +4 -4
  825. package/dist/private/table/TableKeyboardDelegate.mjs.map +1 -1
  826. package/dist/private/table/useTable.cjs.map +1 -1
  827. package/dist/private/table/useTable.js.map +1 -1
  828. package/dist/private/table/useTable.mjs.map +1 -1
  829. package/dist/private/table/useTableCell.cjs.map +1 -1
  830. package/dist/private/table/useTableCell.js.map +1 -1
  831. package/dist/private/table/useTableCell.mjs.map +1 -1
  832. package/dist/private/table/useTableColumnHeader.cjs.map +1 -1
  833. package/dist/private/table/useTableColumnHeader.js.map +1 -1
  834. package/dist/private/table/useTableColumnHeader.mjs.map +1 -1
  835. package/dist/private/table/useTableColumnResize.cjs +1 -1
  836. package/dist/private/table/useTableColumnResize.cjs.map +1 -1
  837. package/dist/private/table/useTableColumnResize.js +1 -1
  838. package/dist/private/table/useTableColumnResize.js.map +1 -1
  839. package/dist/private/table/useTableColumnResize.mjs +1 -1
  840. package/dist/private/table/useTableColumnResize.mjs.map +1 -1
  841. package/dist/private/table/useTableHeaderRow.cjs +2 -1
  842. package/dist/private/table/useTableHeaderRow.cjs.map +1 -1
  843. package/dist/private/table/useTableHeaderRow.js +2 -1
  844. package/dist/private/table/useTableHeaderRow.js.map +1 -1
  845. package/dist/private/table/useTableHeaderRow.mjs +2 -1
  846. package/dist/private/table/useTableHeaderRow.mjs.map +1 -1
  847. package/dist/private/table/useTableRow.cjs +2 -2
  848. package/dist/private/table/useTableRow.cjs.map +1 -1
  849. package/dist/private/table/useTableRow.js +2 -2
  850. package/dist/private/table/useTableRow.js.map +1 -1
  851. package/dist/private/table/useTableRow.mjs +2 -2
  852. package/dist/private/table/useTableRow.mjs.map +1 -1
  853. package/dist/private/table/useTableSelectionCheckbox.cjs.map +1 -1
  854. package/dist/private/table/useTableSelectionCheckbox.js.map +1 -1
  855. package/dist/private/table/useTableSelectionCheckbox.mjs.map +1 -1
  856. package/dist/private/table/utils.cjs.map +1 -1
  857. package/dist/private/table/utils.js.map +1 -1
  858. package/dist/private/table/utils.mjs.map +1 -1
  859. package/dist/private/tabs/TabsKeyboardDelegate.cjs.map +1 -1
  860. package/dist/private/tabs/TabsKeyboardDelegate.js.map +1 -1
  861. package/dist/private/tabs/TabsKeyboardDelegate.mjs.map +1 -1
  862. package/dist/private/tabs/useTab.cjs.map +1 -1
  863. package/dist/private/tabs/useTab.js.map +1 -1
  864. package/dist/private/tabs/useTab.mjs.map +1 -1
  865. package/dist/private/tabs/useTabList.cjs +10 -10
  866. package/dist/private/tabs/useTabList.cjs.map +1 -1
  867. package/dist/private/tabs/useTabList.js +10 -10
  868. package/dist/private/tabs/useTabList.js.map +1 -1
  869. package/dist/private/tabs/useTabList.mjs +10 -10
  870. package/dist/private/tabs/useTabList.mjs.map +1 -1
  871. package/dist/private/tabs/useTabPanel.cjs.map +1 -1
  872. package/dist/private/tabs/useTabPanel.js.map +1 -1
  873. package/dist/private/tabs/useTabPanel.mjs.map +1 -1
  874. package/dist/private/tabs/utils.cjs.map +1 -1
  875. package/dist/private/tabs/utils.js.map +1 -1
  876. package/dist/private/tabs/utils.mjs.map +1 -1
  877. package/dist/private/tag/useTag.cjs.map +1 -1
  878. package/dist/private/tag/useTag.js.map +1 -1
  879. package/dist/private/tag/useTag.mjs.map +1 -1
  880. package/dist/private/tag/useTagGroup.cjs.map +1 -1
  881. package/dist/private/tag/useTagGroup.js.map +1 -1
  882. package/dist/private/tag/useTagGroup.mjs.map +1 -1
  883. package/dist/private/textfield/useFormattedTextField.cjs.map +1 -1
  884. package/dist/private/textfield/useFormattedTextField.js.map +1 -1
  885. package/dist/private/textfield/useFormattedTextField.mjs.map +1 -1
  886. package/dist/private/textfield/useTextField.cjs.map +1 -1
  887. package/dist/private/textfield/useTextField.js.map +1 -1
  888. package/dist/private/textfield/useTextField.mjs.map +1 -1
  889. package/dist/private/toast/useToast.cjs +2 -1
  890. package/dist/private/toast/useToast.cjs.map +1 -1
  891. package/dist/private/toast/useToast.js +2 -1
  892. package/dist/private/toast/useToast.js.map +1 -1
  893. package/dist/private/toast/useToast.mjs +2 -1
  894. package/dist/private/toast/useToast.mjs.map +1 -1
  895. package/dist/private/toast/useToastRegion.cjs.map +1 -1
  896. package/dist/private/toast/useToastRegion.js.map +1 -1
  897. package/dist/private/toast/useToastRegion.mjs.map +1 -1
  898. package/dist/private/toggle/useToggle.cjs +70 -8
  899. package/dist/private/toggle/useToggle.cjs.map +1 -1
  900. package/dist/private/toggle/useToggle.js +70 -8
  901. package/dist/private/toggle/useToggle.js.map +1 -1
  902. package/dist/private/toggle/useToggle.mjs +70 -8
  903. package/dist/private/toggle/useToggle.mjs.map +1 -1
  904. package/dist/private/toolbar/useToolbar.cjs.map +1 -1
  905. package/dist/private/toolbar/useToolbar.js.map +1 -1
  906. package/dist/private/toolbar/useToolbar.mjs.map +1 -1
  907. package/dist/private/tooltip/useTooltip.cjs.map +1 -1
  908. package/dist/private/tooltip/useTooltip.js.map +1 -1
  909. package/dist/private/tooltip/useTooltip.mjs.map +1 -1
  910. package/dist/private/tooltip/useTooltipTrigger.cjs.map +1 -1
  911. package/dist/private/tooltip/useTooltipTrigger.js.map +1 -1
  912. package/dist/private/tooltip/useTooltipTrigger.mjs.map +1 -1
  913. package/dist/private/tree/useTree.cjs.map +1 -1
  914. package/dist/private/tree/useTree.js.map +1 -1
  915. package/dist/private/tree/useTree.mjs.map +1 -1
  916. package/dist/private/tree/useTreeItem.cjs.map +1 -1
  917. package/dist/private/tree/useTreeItem.js.map +1 -1
  918. package/dist/private/tree/useTreeItem.mjs.map +1 -1
  919. package/dist/private/utils/animation.cjs.map +1 -1
  920. package/dist/private/utils/animation.js.map +1 -1
  921. package/dist/private/utils/animation.mjs.map +1 -1
  922. package/dist/private/utils/domHelpers.cjs +2 -1
  923. package/dist/private/utils/domHelpers.cjs.map +1 -1
  924. package/dist/private/utils/domHelpers.js +2 -1
  925. package/dist/private/utils/domHelpers.js.map +1 -1
  926. package/dist/private/utils/domHelpers.mjs +2 -1
  927. package/dist/private/utils/domHelpers.mjs.map +1 -1
  928. package/dist/private/utils/filterDOMProps.cjs.map +1 -1
  929. package/dist/private/utils/filterDOMProps.js.map +1 -1
  930. package/dist/private/utils/filterDOMProps.mjs.map +1 -1
  931. package/dist/private/utils/focusWithoutScrolling.cjs.map +1 -1
  932. package/dist/private/utils/focusWithoutScrolling.js.map +1 -1
  933. package/dist/private/utils/focusWithoutScrolling.mjs.map +1 -1
  934. package/dist/private/utils/getNonce.cjs.map +1 -1
  935. package/dist/private/utils/getNonce.js.map +1 -1
  936. package/dist/private/utils/getNonce.mjs.map +1 -1
  937. package/dist/private/utils/getOffset.cjs.map +1 -1
  938. package/dist/private/utils/getOffset.js.map +1 -1
  939. package/dist/private/utils/getOffset.mjs.map +1 -1
  940. package/dist/private/utils/getScrollParent.cjs.map +1 -1
  941. package/dist/private/utils/getScrollParent.js.map +1 -1
  942. package/dist/private/utils/getScrollParent.mjs.map +1 -1
  943. package/dist/private/utils/getScrollParents.cjs +3 -2
  944. package/dist/private/utils/getScrollParents.cjs.map +1 -1
  945. package/dist/private/utils/getScrollParents.js +3 -2
  946. package/dist/private/utils/getScrollParents.js.map +1 -1
  947. package/dist/private/utils/getScrollParents.mjs +3 -2
  948. package/dist/private/utils/getScrollParents.mjs.map +1 -1
  949. package/dist/private/utils/isElementVisible.cjs.map +1 -1
  950. package/dist/private/utils/isElementVisible.js.map +1 -1
  951. package/dist/private/utils/isElementVisible.mjs.map +1 -1
  952. package/dist/private/utils/isFocusable.cjs.map +1 -1
  953. package/dist/private/utils/isFocusable.js.map +1 -1
  954. package/dist/private/utils/isFocusable.mjs.map +1 -1
  955. package/dist/private/utils/isVirtualEvent.cjs.map +1 -1
  956. package/dist/private/utils/isVirtualEvent.js.map +1 -1
  957. package/dist/private/utils/isVirtualEvent.mjs.map +1 -1
  958. package/dist/private/utils/keyboard.cjs.map +1 -1
  959. package/dist/private/utils/keyboard.js.map +1 -1
  960. package/dist/private/utils/keyboard.mjs.map +1 -1
  961. package/dist/private/utils/mergeProps.cjs.map +1 -1
  962. package/dist/private/utils/mergeProps.js.map +1 -1
  963. package/dist/private/utils/mergeProps.mjs.map +1 -1
  964. package/dist/private/utils/mergeRefs.cjs.map +1 -1
  965. package/dist/private/utils/mergeRefs.js.map +1 -1
  966. package/dist/private/utils/mergeRefs.mjs.map +1 -1
  967. package/dist/private/utils/openLink.cjs +12 -8
  968. package/dist/private/utils/openLink.cjs.map +1 -1
  969. package/dist/private/utils/openLink.js +12 -8
  970. package/dist/private/utils/openLink.js.map +1 -1
  971. package/dist/private/utils/openLink.mjs +12 -8
  972. package/dist/private/utils/openLink.mjs.map +1 -1
  973. package/dist/private/utils/platform.cjs.map +1 -1
  974. package/dist/private/utils/platform.js.map +1 -1
  975. package/dist/private/utils/platform.mjs.map +1 -1
  976. package/dist/private/utils/scrollIntoView.cjs +21 -18
  977. package/dist/private/utils/scrollIntoView.cjs.map +1 -1
  978. package/dist/private/utils/scrollIntoView.js +21 -18
  979. package/dist/private/utils/scrollIntoView.js.map +1 -1
  980. package/dist/private/utils/scrollIntoView.mjs +21 -18
  981. package/dist/private/utils/scrollIntoView.mjs.map +1 -1
  982. package/dist/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
  983. package/dist/private/utils/shadowdom/DOMFunctions.js.map +1 -1
  984. package/dist/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
  985. package/dist/private/utils/shadowdom/ShadowTreeWalker.cjs +6 -6
  986. package/dist/private/utils/shadowdom/ShadowTreeWalker.cjs.map +1 -1
  987. package/dist/private/utils/shadowdom/ShadowTreeWalker.js +6 -6
  988. package/dist/private/utils/shadowdom/ShadowTreeWalker.js.map +1 -1
  989. package/dist/private/utils/shadowdom/ShadowTreeWalker.mjs +6 -6
  990. package/dist/private/utils/shadowdom/ShadowTreeWalker.mjs.map +1 -1
  991. package/dist/private/utils/useDeepMemo.cjs +1 -1
  992. package/dist/private/utils/useDeepMemo.cjs.map +1 -1
  993. package/dist/private/utils/useDeepMemo.js +1 -1
  994. package/dist/private/utils/useDeepMemo.js.map +1 -1
  995. package/dist/private/utils/useDeepMemo.mjs +1 -1
  996. package/dist/private/utils/useDeepMemo.mjs.map +1 -1
  997. package/dist/private/utils/useDescription.cjs.map +1 -1
  998. package/dist/private/utils/useDescription.js.map +1 -1
  999. package/dist/private/utils/useDescription.mjs.map +1 -1
  1000. package/dist/private/utils/useDrag1D.cjs +1 -1
  1001. package/dist/private/utils/useDrag1D.cjs.map +1 -1
  1002. package/dist/private/utils/useDrag1D.js +1 -1
  1003. package/dist/private/utils/useDrag1D.js.map +1 -1
  1004. package/dist/private/utils/useDrag1D.mjs +1 -1
  1005. package/dist/private/utils/useDrag1D.mjs.map +1 -1
  1006. package/dist/private/utils/useFormReset.cjs.map +1 -1
  1007. package/dist/private/utils/useFormReset.js.map +1 -1
  1008. package/dist/private/utils/useFormReset.mjs.map +1 -1
  1009. package/dist/private/utils/useGlobalListeners.cjs.map +1 -1
  1010. package/dist/private/utils/useGlobalListeners.js.map +1 -1
  1011. package/dist/private/utils/useGlobalListeners.mjs.map +1 -1
  1012. package/dist/private/utils/useId.cjs.map +1 -1
  1013. package/dist/private/utils/useId.js.map +1 -1
  1014. package/dist/private/utils/useId.mjs.map +1 -1
  1015. package/dist/private/utils/useLabels.cjs.map +1 -1
  1016. package/dist/private/utils/useLabels.js.map +1 -1
  1017. package/dist/private/utils/useLabels.mjs.map +1 -1
  1018. package/dist/private/utils/useLayoutEffect.cjs.map +1 -1
  1019. package/dist/private/utils/useLayoutEffect.js.map +1 -1
  1020. package/dist/private/utils/useLayoutEffect.mjs.map +1 -1
  1021. package/dist/private/utils/useLoadMore.cjs.map +1 -1
  1022. package/dist/private/utils/useLoadMore.js.map +1 -1
  1023. package/dist/private/utils/useLoadMore.mjs.map +1 -1
  1024. package/dist/private/utils/useLoadMoreSentinel.cjs.map +1 -1
  1025. package/dist/private/utils/useLoadMoreSentinel.js.map +1 -1
  1026. package/dist/private/utils/useLoadMoreSentinel.mjs.map +1 -1
  1027. package/dist/private/utils/useObjectRef.cjs.map +1 -1
  1028. package/dist/private/utils/useObjectRef.js.map +1 -1
  1029. package/dist/private/utils/useObjectRef.mjs.map +1 -1
  1030. package/dist/private/utils/useResizeObserver.cjs.map +1 -1
  1031. package/dist/private/utils/useResizeObserver.js.map +1 -1
  1032. package/dist/private/utils/useResizeObserver.mjs.map +1 -1
  1033. package/dist/private/utils/useSlot.cjs +54 -0
  1034. package/dist/private/utils/useSlot.cjs.map +1 -0
  1035. package/dist/private/utils/useSlot.js +49 -0
  1036. package/dist/private/utils/useSlot.js.map +1 -0
  1037. package/dist/private/utils/useSlot.mjs +49 -0
  1038. package/dist/private/utils/useSlot.mjs.map +1 -0
  1039. package/dist/private/utils/useSyncRef.cjs +2 -1
  1040. package/dist/private/utils/useSyncRef.cjs.map +1 -1
  1041. package/dist/private/utils/useSyncRef.js +2 -1
  1042. package/dist/private/utils/useSyncRef.js.map +1 -1
  1043. package/dist/private/utils/useSyncRef.mjs +2 -1
  1044. package/dist/private/utils/useSyncRef.mjs.map +1 -1
  1045. package/dist/private/utils/useUpdateEffect.cjs.map +1 -1
  1046. package/dist/private/utils/useUpdateEffect.js.map +1 -1
  1047. package/dist/private/utils/useUpdateEffect.mjs.map +1 -1
  1048. package/dist/private/utils/useValueEffect.cjs.map +1 -1
  1049. package/dist/private/utils/useValueEffect.js.map +1 -1
  1050. package/dist/private/utils/useValueEffect.mjs.map +1 -1
  1051. package/dist/private/utils/useViewportSize.cjs +3 -1
  1052. package/dist/private/utils/useViewportSize.cjs.map +1 -1
  1053. package/dist/private/utils/useViewportSize.js +3 -1
  1054. package/dist/private/utils/useViewportSize.js.map +1 -1
  1055. package/dist/private/utils/useViewportSize.mjs +3 -1
  1056. package/dist/private/utils/useViewportSize.mjs.map +1 -1
  1057. package/dist/private/virtualizer/ScrollView.cjs +2 -2
  1058. package/dist/private/virtualizer/ScrollView.cjs.map +1 -1
  1059. package/dist/private/virtualizer/ScrollView.js +2 -2
  1060. package/dist/private/virtualizer/ScrollView.js.map +1 -1
  1061. package/dist/private/virtualizer/ScrollView.mjs +2 -2
  1062. package/dist/private/virtualizer/ScrollView.mjs.map +1 -1
  1063. package/dist/private/virtualizer/Virtualizer.cjs.map +1 -1
  1064. package/dist/private/virtualizer/Virtualizer.js.map +1 -1
  1065. package/dist/private/virtualizer/Virtualizer.mjs.map +1 -1
  1066. package/dist/private/virtualizer/VirtualizerItem.cjs.map +1 -1
  1067. package/dist/private/virtualizer/VirtualizerItem.js.map +1 -1
  1068. package/dist/private/virtualizer/VirtualizerItem.mjs.map +1 -1
  1069. package/dist/private/virtualizer/useVirtualizerItem.cjs.map +1 -1
  1070. package/dist/private/virtualizer/useVirtualizerItem.js.map +1 -1
  1071. package/dist/private/virtualizer/useVirtualizerItem.mjs.map +1 -1
  1072. package/dist/private/virtualizer/utils.cjs.map +1 -1
  1073. package/dist/private/virtualizer/utils.js.map +1 -1
  1074. package/dist/private/virtualizer/utils.mjs.map +1 -1
  1075. package/dist/private/visually-hidden/VisuallyHidden.cjs.map +1 -1
  1076. package/dist/private/visually-hidden/VisuallyHidden.js.map +1 -1
  1077. package/dist/private/visually-hidden/VisuallyHidden.mjs.map +1 -1
  1078. package/dist/types/exports/index.d.ts +7 -0
  1079. package/dist/types/exports/useCalendar.d.ts +6 -0
  1080. package/dist/types/exports/useRangeCalendar.d.ts +11 -0
  1081. package/dist/types/src/actiongroup/useActionGroup.d.ts +5 -1
  1082. package/dist/types/src/aria-modal-polyfill/ariaModalPolyfill.d.ts +2 -1
  1083. package/dist/types/src/autocomplete/useAutocomplete.d.ts +21 -9
  1084. package/dist/types/src/autocomplete/useSearchAutocomplete.d.ts +15 -8
  1085. package/dist/types/src/breadcrumbs/useBreadcrumbItem.d.ts +2 -0
  1086. package/dist/types/src/button/useButton.d.ts +25 -7
  1087. package/dist/types/src/button/useToggleButtonGroup.d.ts +1 -0
  1088. package/dist/types/src/calendar/useCalendar.d.ts +3 -3
  1089. package/dist/types/src/calendar/useCalendarBase.d.ts +2 -2
  1090. package/dist/types/src/calendar/useCalendarCell.d.ts +9 -8
  1091. package/dist/types/src/calendar/useCalendarGrid.d.ts +8 -4
  1092. package/dist/types/src/calendar/useCalendarHeading.d.ts +22 -0
  1093. package/dist/types/src/calendar/useCalendarMonthPicker.d.ts +22 -0
  1094. package/dist/types/src/calendar/useCalendarYearPicker.d.ts +32 -0
  1095. package/dist/types/src/calendar/useRangeCalendar.d.ts +5 -5
  1096. package/dist/types/src/calendar/utils.d.ts +3 -3
  1097. package/dist/types/src/checkbox/useCheckbox.d.ts +6 -1
  1098. package/dist/types/src/checkbox/useCheckboxGroup.d.ts +1 -0
  1099. package/dist/types/src/checkbox/useCheckboxGroupItem.d.ts +3 -2
  1100. package/dist/types/src/collections/CollectionBuilder.d.ts +8 -7
  1101. package/dist/types/src/collections/useCachedChildren.d.ts +1 -1
  1102. package/dist/types/src/color/useColorArea.d.ts +7 -4
  1103. package/dist/types/src/color/useColorChannelField.d.ts +2 -2
  1104. package/dist/types/src/combobox/useComboBox.d.ts +5 -3
  1105. package/dist/types/src/datepicker/useDateField.d.ts +2 -1
  1106. package/dist/types/src/datepicker/useDatePicker.d.ts +5 -3
  1107. package/dist/types/src/dialog/useDialog.d.ts +1 -0
  1108. package/dist/types/src/disclosure/useDisclosure.d.ts +1 -0
  1109. package/dist/types/src/dnd/ListDropTargetDelegate.d.ts +3 -0
  1110. package/dist/types/src/dnd/useDrag.d.ts +11 -4
  1111. package/dist/types/src/dnd/useDraggableCollection.d.ts +2 -2
  1112. package/dist/types/src/dnd/useDraggableItem.d.ts +7 -6
  1113. package/dist/types/src/dnd/useDrop.d.ts +5 -4
  1114. package/dist/types/src/dnd/useDroppableCollection.d.ts +2 -2
  1115. package/dist/types/src/dnd/utils.d.ts +1 -1
  1116. package/dist/types/src/focus/FocusRing.d.ts +1 -0
  1117. package/dist/types/src/focus/useFocusRing.d.ts +1 -0
  1118. package/dist/types/src/focus/useHasTabbableChild.d.ts +1 -0
  1119. package/dist/types/src/grid/GridKeyboardDelegate.d.ts +8 -4
  1120. package/dist/types/src/grid/useGrid.d.ts +12 -4
  1121. package/dist/types/src/grid/useGridCell.d.ts +11 -3
  1122. package/dist/types/src/grid/useGridRow.d.ts +7 -2
  1123. package/dist/types/src/grid/useGridSelectionAnnouncement.d.ts +3 -1
  1124. package/dist/types/src/grid/useGridSelectionCheckbox.d.ts +1 -0
  1125. package/dist/types/src/grid/useHighlightSelectionDescription.d.ts +1 -0
  1126. package/dist/types/src/gridlist/useGridList.d.ts +13 -5
  1127. package/dist/types/src/gridlist/useGridListItem.d.ts +5 -1
  1128. package/dist/types/src/gridlist/useGridListSection.d.ts +1 -0
  1129. package/dist/types/src/gridlist/useGridListSelectionCheckbox.d.ts +1 -0
  1130. package/dist/types/src/i18n/useCollator.d.ts +3 -2
  1131. package/dist/types/src/i18n/useDateFormatter.d.ts +3 -2
  1132. package/dist/types/src/i18n/useFilter.d.ts +3 -2
  1133. package/dist/types/src/i18n/useListFormatter.d.ts +3 -2
  1134. package/dist/types/src/i18n/useLocalizedStringFormatter.d.ts +3 -1
  1135. package/dist/types/src/i18n/useNumberFormatter.d.ts +3 -2
  1136. package/dist/types/src/i18n/utils.d.ts +2 -1
  1137. package/dist/types/src/interactions/createEventHandler.d.ts +2 -1
  1138. package/dist/types/src/interactions/useFocusVisible.d.ts +11 -9
  1139. package/dist/types/src/interactions/useLongPress.d.ts +3 -2
  1140. package/dist/types/src/interactions/utils.d.ts +4 -3
  1141. package/dist/types/src/label/useField.d.ts +3 -2
  1142. package/dist/types/src/label/useLabel.d.ts +2 -0
  1143. package/dist/types/src/landmark/useLandmark.d.ts +4 -1
  1144. package/dist/types/src/link/useLink.d.ts +1 -0
  1145. package/dist/types/src/listbox/useListBox.d.ts +8 -3
  1146. package/dist/types/src/listbox/useListBoxSection.d.ts +1 -0
  1147. package/dist/types/src/listbox/useOption.d.ts +7 -0
  1148. package/dist/types/src/menu/useMenu.d.ts +2 -0
  1149. package/dist/types/src/menu/useMenuItem.d.ts +10 -1
  1150. package/dist/types/src/menu/useMenuSection.d.ts +1 -0
  1151. package/dist/types/src/menu/useMenuTrigger.d.ts +1 -0
  1152. package/dist/types/src/menu/useSafelyMouseToSubmenu.d.ts +3 -2
  1153. package/dist/types/src/menu/useSubmenuTrigger.d.ts +7 -2
  1154. package/dist/types/src/numberfield/useNumberField.d.ts +11 -4
  1155. package/dist/types/src/overlays/Overlay.d.ts +1 -0
  1156. package/dist/types/src/overlays/PortalProvider.d.ts +4 -1
  1157. package/dist/types/src/overlays/ariaHideOutside.d.ts +1 -0
  1158. package/dist/types/src/overlays/calculatePosition.d.ts +2 -1
  1159. package/dist/types/src/overlays/useModal.d.ts +8 -7
  1160. package/dist/types/src/overlays/useModalOverlay.d.ts +2 -0
  1161. package/dist/types/src/overlays/useOverlay.d.ts +2 -0
  1162. package/dist/types/src/overlays/useOverlayPosition.d.ts +10 -0
  1163. package/dist/types/src/progress/useProgressBar.d.ts +5 -1
  1164. package/dist/types/src/radio/useRadio.d.ts +4 -1
  1165. package/dist/types/src/radio/useRadioGroup.d.ts +1 -0
  1166. package/dist/types/src/searchfield/useSearchField.d.ts +7 -2
  1167. package/dist/types/src/select/HiddenSelect.d.ts +2 -1
  1168. package/dist/types/src/select/useSelect.d.ts +3 -1
  1169. package/dist/types/src/selection/ListKeyboardDelegate.d.ts +18 -6
  1170. package/dist/types/src/selection/useSelectableCollection.d.ts +10 -2
  1171. package/dist/types/src/selection/useSelectableItem.d.ts +9 -7
  1172. package/dist/types/src/selection/useSelectableList.d.ts +5 -2
  1173. package/dist/types/src/separator/useSeparator.d.ts +1 -0
  1174. package/dist/types/src/slider/useSlider.d.ts +5 -4
  1175. package/dist/types/src/slider/useSliderThumb.d.ts +3 -1
  1176. package/dist/types/src/switch/useSwitch.d.ts +14 -27
  1177. package/dist/types/src/table/TableKeyboardDelegate.d.ts +6 -2
  1178. package/dist/types/src/table/useTable.d.ts +8 -4
  1179. package/dist/types/src/table/useTableCell.d.ts +7 -2
  1180. package/dist/types/src/table/useTableColumnHeader.d.ts +9 -2
  1181. package/dist/types/src/table/useTableColumnResize.d.ts +12 -6
  1182. package/dist/types/src/table/useTableHeaderRow.d.ts +1 -0
  1183. package/dist/types/src/table/useTableRow.d.ts +1 -0
  1184. package/dist/types/src/table/useTableSelectionCheckbox.d.ts +2 -0
  1185. package/dist/types/src/tabs/useTabList.d.ts +2 -0
  1186. package/dist/types/src/tabs/useTabPanel.d.ts +2 -2
  1187. package/dist/types/src/tag/useTag.d.ts +1 -0
  1188. package/dist/types/src/tag/useTagGroup.d.ts +7 -3
  1189. package/dist/types/src/textfield/useTextField.d.ts +26 -11
  1190. package/dist/types/src/toast/useToast.d.ts +2 -2
  1191. package/dist/types/src/toast/useToastRegion.d.ts +5 -3
  1192. package/dist/types/src/toggle/useToggle.d.ts +8 -3
  1193. package/dist/types/src/toolbar/useToolbar.d.ts +2 -0
  1194. package/dist/types/src/tree/useTree.d.ts +4 -2
  1195. package/dist/types/src/tree/useTreeItem.d.ts +5 -1
  1196. package/dist/types/src/utils/filterDOMProps.d.ts +1 -0
  1197. package/dist/types/src/utils/getNonce.d.ts +3 -2
  1198. package/dist/types/src/utils/isElementVisible.d.ts +1 -0
  1199. package/dist/types/src/utils/mergeProps.d.ts +3 -2
  1200. package/dist/types/src/utils/scrollIntoView.d.ts +5 -3
  1201. package/dist/types/src/utils/shadowdom/DOMFunctions.d.ts +1 -0
  1202. package/dist/types/src/utils/useId.d.ts +2 -0
  1203. package/dist/types/src/utils/useLabels.d.ts +1 -0
  1204. package/dist/types/src/utils/useLoadMore.d.ts +6 -4
  1205. package/dist/types/src/utils/useLoadMoreSentinel.d.ts +5 -3
  1206. package/dist/types/src/utils/useSlot.d.ts +8 -0
  1207. package/dist/types/src/visually-hidden/VisuallyHidden.d.ts +1 -0
  1208. package/package.json +10 -8
@@ -1 +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QAAC;KAAqB;IAEzB,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,SACF,OAAO,QAAQ,gBAAgB,CAAC;iBAAC;mBAAK;kBAAO;YAAM,OAAO,SAAS;kBAAc;QAAI;IAEzF,GAAG;QAAC;QAAS;QAAO;QAAK;QAAM;QAAO;QAAc;KAAK;IAEzD,CAAA,GAAA,gBAAQ,EAAE;YAEN;QADF,IAAI,oBACF,eAAA,IAAI,OAAO,cAAX,mCAAA,aAAa,KAAK;IAEtB,GAAG;QAAC;QAAmB;KAAI;IAE3B,OAAO;QACL,eAAe;kBACb;YACA,UAAU,oBAAoB,KAAK;YACnC,cAAc;YACd,mBAAmB;QACrB;IACF;AACF","sources":["packages/react-aria/src/landmark/useLandmark.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaLabelingProps, DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {getEventTarget, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {useCallback, useEffect, useState} from 'react';\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useSyncExternalStore} from 'use-sync-external-store/shim/index.js';\n\nexport type AriaLandmarkRole = 'main' | 'region' | 'search' | 'navigation' | 'form' | 'banner' | 'contentinfo' | 'complementary';\n\nexport interface AriaLandmarkProps extends AriaLabelingProps {\n role: AriaLandmarkRole,\n focus?: (direction: 'forward' | 'backward') => void\n}\n\nexport interface LandmarkAria {\n landmarkProps: DOMAttributes\n}\n\n// Increment this version number whenever the\n// LandmarkManagerApi or Landmark interfaces change.\nconst LANDMARK_API_VERSION = 1;\n\n// Minimal API for LandmarkManager that must continue to work between versions.\n// Changes to this interface are considered breaking. New methods/properties are\n// safe to add, but changes or removals are not allowed (same as public APIs).\ninterface LandmarkManagerApi {\n version: number,\n createLandmarkController(): LandmarkController,\n registerLandmark(landmark: Landmark): () => void\n}\n\n// Changes to this interface are considered breaking.\n// New properties MUST be optional so that registering a landmark\n// from an older version of useLandmark against a newer version of\n// LandmarkManager does not crash.\ninterface Landmark {\n ref: RefObject<FocusableElement | null>,\n role: AriaLandmarkRole,\n label?: string,\n lastFocused?: FocusableElement,\n focus: (direction: 'forward' | 'backward') => void,\n blur: () => void\n}\n\nexport interface LandmarkControllerOptions {\n /**\n * The element from which to start navigating.\n * @default document.activeElement\n */\n from?: FocusableElement\n}\n\n/** A LandmarkController allows programmatic navigation of landmarks. */\nexport interface LandmarkController {\n /** Moves focus to the next landmark. */\n focusNext(opts?: LandmarkControllerOptions): boolean,\n /** Moves focus to the previous landmark. */\n focusPrevious(opts?: LandmarkControllerOptions): boolean,\n /** Moves focus to the main landmark. */\n focusMain(): boolean,\n /** Moves focus either forward or backward in the landmark sequence. */\n navigate(direction: 'forward' | 'backward', opts?: LandmarkControllerOptions): boolean,\n /**\n * Disposes the landmark controller. When no landmarks are registered, and no\n * controllers are active, the landmark keyboard listeners are removed from the page.\n */\n dispose(): void\n}\n\n// Symbol under which the singleton landmark manager instance is attached to the document.\nconst landmarkSymbol = Symbol.for('react-aria-landmark-manager');\n\nfunction subscribe(fn: () => void) {\n document.addEventListener('react-aria-landmark-manager-change', fn);\n return () => document.removeEventListener('react-aria-landmark-manager-change', fn);\n}\n\nfunction getLandmarkManager(): LandmarkManagerApi | null {\n if (typeof document === 'undefined') {\n return null;\n }\n\n // Reuse an existing instance if it has the same or greater version.\n let instance = document[landmarkSymbol];\n if (instance && instance.version >= LANDMARK_API_VERSION) {\n return instance;\n }\n\n // Otherwise, create a new instance and dispatch an event so anything using the existing\n // instance updates and re-registers their landmarks with the new one.\n document[landmarkSymbol] = new LandmarkManager();\n document.dispatchEvent(new CustomEvent('react-aria-landmark-manager-change'));\n return document[landmarkSymbol];\n}\n\n// Subscribes a React component to the current landmark manager instance.\nfunction useLandmarkManager(): LandmarkManagerApi | null {\n return useSyncExternalStore(subscribe, getLandmarkManager, getLandmarkManager);\n}\n\nclass LandmarkManager implements LandmarkManagerApi {\n private landmarks: Array<Landmark> = [];\n private isListening = false;\n private refCount = 0;\n public version = LANDMARK_API_VERSION;\n\n constructor() {\n this.f6Handler = this.f6Handler.bind(this);\n this.focusinHandler = this.focusinHandler.bind(this);\n this.focusoutHandler = this.focusoutHandler.bind(this);\n }\n\n private setupIfNeeded() {\n if (this.isListening) {\n return;\n }\n document.addEventListener('keydown', this.f6Handler, {capture: true});\n document.addEventListener('focusin', this.focusinHandler, {capture: true});\n document.addEventListener('focusout', this.focusoutHandler, {capture: true});\n this.isListening = true;\n }\n\n private teardownIfNeeded() {\n if (!this.isListening || this.landmarks.length > 0 || this.refCount > 0) {\n return;\n }\n document.removeEventListener('keydown', this.f6Handler, {capture: true});\n document.removeEventListener('focusin', this.focusinHandler, {capture: true});\n document.removeEventListener('focusout', this.focusoutHandler, {capture: true});\n this.isListening = false;\n }\n\n private focusLandmark(landmark: FocusableElement, direction: 'forward' | 'backward') {\n this.landmarks.find(l => l.ref.current === landmark)?.focus?.(direction);\n }\n\n /**\n * Return set of landmarks with a specific role.\n */\n private getLandmarksByRole(role: AriaLandmarkRole) {\n return new Set(this.landmarks.filter(l => l.role === role));\n }\n\n /**\n * Return first landmark with a specific role.\n */\n private getLandmarkByRole(role: AriaLandmarkRole) {\n return this.landmarks.find(l => l.role === role);\n }\n\n private addLandmark(newLandmark: Landmark) {\n this.setupIfNeeded();\n if (this.landmarks.find(landmark => landmark.ref === newLandmark.ref) || !newLandmark.ref.current) {\n return;\n }\n\n if (this.landmarks.filter(landmark => landmark.role === 'main').length > 1 && process.env.NODE_ENV !== 'production') {\n console.error('Page can contain no more than one landmark with the role \"main\".');\n }\n\n if (this.landmarks.length === 0) {\n this.landmarks = [newLandmark];\n this.checkLabels(newLandmark.role);\n return;\n }\n\n\n // Binary search to insert new landmark based on position in document relative to existing landmarks.\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n let start = 0;\n let end = this.landmarks.length - 1;\n while (start <= end) {\n let mid = Math.floor((start + end) / 2);\n let comparedPosition = newLandmark.ref.current.compareDocumentPosition(this.landmarks[mid].ref.current as Node);\n let isNewAfterExisting = Boolean((comparedPosition & Node.DOCUMENT_POSITION_PRECEDING) || (comparedPosition & Node.DOCUMENT_POSITION_CONTAINS));\n\n if (isNewAfterExisting) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n\n this.landmarks.splice(start, 0, newLandmark);\n this.checkLabels(newLandmark.role);\n }\n\n private updateLandmark(landmark: Pick<Landmark, 'ref'> & Partial<Landmark>) {\n let index = this.landmarks.findIndex(l => l.ref === landmark.ref);\n if (index >= 0) {\n this.landmarks[index] = {...this.landmarks[index], ...landmark};\n this.checkLabels(this.landmarks[index].role);\n }\n }\n\n private removeLandmark(ref: RefObject<Element | null>) {\n this.landmarks = this.landmarks.filter(landmark => landmark.ref !== ref);\n this.teardownIfNeeded();\n }\n\n /**\n * Warn if there are 2+ landmarks with the same role but no label.\n * Labels for landmarks with the same role must also be unique.\n *\n * See https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/.\n */\n private checkLabels(role: AriaLandmarkRole) {\n let landmarksWithRole = this.getLandmarksByRole(role);\n if (landmarksWithRole.size > 1) {\n let duplicatesWithoutLabel = [...landmarksWithRole].filter(landmark => !landmark.label);\n if (duplicatesWithoutLabel.length > 0 && process.env.NODE_ENV !== 'production') {\n console.warn(\n `Page contains more than one landmark with the '${role}' role. If two or more landmarks on a page share the same role, all must be labeled with an aria-label or aria-labelledby attribute: `,\n duplicatesWithoutLabel.map(landmark => landmark.ref.current)\n );\n } else if (process.env.NODE_ENV !== 'production') {\n let labels = [...landmarksWithRole].map(landmark => landmark.label);\n let duplicateLabels = labels.filter((item, index) => labels.indexOf(item) !== index);\n\n duplicateLabels.forEach((label) => {\n console.warn(\n `Page contains more than one landmark with the '${role}' role and '${label}' label. If two or more landmarks on a page share the same role, they must have unique labels: `,\n [...landmarksWithRole].filter(landmark => landmark.label === label).map(landmark => landmark.ref.current)\n );\n });\n }\n }\n }\n\n /**\n * Get the landmark that is the closest parent in the DOM.\n * Returns undefined if no parent is a landmark.\n */\n private closestLandmark(element: FocusableElement) {\n let landmarkMap = new Map(this.landmarks.map(l => [l.ref.current, l]));\n let currentElement = element;\n while (currentElement && !landmarkMap.has(currentElement) && currentElement !== document.body && currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n }\n return landmarkMap.get(currentElement);\n }\n\n /**\n * Gets the next landmark, in DOM focus order, or previous if backwards is specified.\n * If last landmark, next should be the first landmark.\n * If not inside a landmark, will return first landmark.\n * Returns undefined if there are no landmarks.\n */\n private getNextLandmark(element: FocusableElement, {backward}: {backward?: boolean }) {\n let currentLandmark = this.closestLandmark(element);\n let nextLandmarkIndex = backward ? this.landmarks.length - 1 : 0;\n if (currentLandmark) {\n nextLandmarkIndex = this.landmarks.indexOf(currentLandmark) + (backward ? -1 : 1);\n }\n\n let wrapIfNeeded = () => {\n // When we reach the end of the landmark sequence, fire a custom event that can be listened for by applications.\n // If this event is canceled, we return immediately. This can be used to implement landmark navigation across iframes.\n if (nextLandmarkIndex < 0) {\n if (!element.dispatchEvent(new CustomEvent('react-aria-landmark-navigation', {detail: {direction: 'backward'}, bubbles: true, cancelable: true}))) {\n return true;\n }\n\n nextLandmarkIndex = this.landmarks.length - 1;\n } else if (nextLandmarkIndex >= this.landmarks.length) {\n if (!element.dispatchEvent(new CustomEvent('react-aria-landmark-navigation', {detail: {direction: 'forward'}, bubbles: true, cancelable: true}))) {\n return true;\n }\n\n nextLandmarkIndex = 0;\n }\n\n if (nextLandmarkIndex < 0 || nextLandmarkIndex >= this.landmarks.length) {\n return true;\n }\n\n return false;\n };\n\n if (wrapIfNeeded()) {\n return undefined;\n }\n\n // Skip over hidden landmarks.\n let i = nextLandmarkIndex;\n while (this.landmarks[nextLandmarkIndex].ref.current?.closest('[aria-hidden=true]')) {\n nextLandmarkIndex += backward ? -1 : 1;\n if (wrapIfNeeded()) {\n return undefined;\n }\n\n if (nextLandmarkIndex === i) {\n break;\n }\n }\n\n return this.landmarks[nextLandmarkIndex];\n }\n\n /**\n * Look at next landmark. If an element was previously focused inside, restore focus there.\n * If not, focus the landmark itself.\n * If no landmarks at all, or none with focusable elements, don't move focus.\n */\n private f6Handler(e: KeyboardEvent) {\n if (e.key === 'F6') {\n // If alt key pressed, focus main landmark, otherwise navigate forward or backward based on shift key.\n let handled = e.altKey ? this.focusMain() : this.navigate(getEventTarget(e) as FocusableElement, e.shiftKey);\n if (handled) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n }\n\n private focusMain() {\n let main = this.getLandmarkByRole('main');\n if (main && main.ref.current && main.ref.current.isConnected) {\n this.focusLandmark(main.ref.current, 'forward');\n return true;\n }\n\n return false;\n }\n\n private navigate(from: FocusableElement, backward: boolean) {\n let nextLandmark = this.getNextLandmark(from, {\n backward\n });\n\n if (!nextLandmark) {\n return false;\n }\n\n // If something was previously focused in the next landmark, then return focus to it\n if (nextLandmark.lastFocused) {\n let lastFocused = nextLandmark.lastFocused;\n if (nodeContains(document.body, lastFocused)) {\n lastFocused.focus();\n return true;\n }\n }\n\n // Otherwise, focus the landmark itself\n if (nextLandmark.ref.current && nextLandmark.ref.current.isConnected) {\n this.focusLandmark(nextLandmark.ref.current, backward ? 'backward' : 'forward');\n return true;\n }\n\n return false;\n }\n\n /**\n * Sets lastFocused for a landmark, if focus is moved within that landmark.\n * Lets the last focused landmark know it was blurred if something else is focused.\n */\n private focusinHandler(e: FocusEvent) {\n let currentLandmark = this.closestLandmark(getEventTarget(e) as FocusableElement);\n if (currentLandmark && currentLandmark.ref.current !== getEventTarget(e)) {\n this.updateLandmark({ref: currentLandmark.ref, lastFocused: getEventTarget(e) as FocusableElement});\n }\n let previousFocusedElement = e.relatedTarget as FocusableElement;\n if (previousFocusedElement) {\n let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);\n if (closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement) {\n closestPreviousLandmark.blur();\n }\n }\n }\n\n /**\n * Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had focus.\n */\n private focusoutHandler(e: FocusEvent) {\n let previousFocusedElement = getEventTarget(e) as FocusableElement;\n let nextFocusedElement = e.relatedTarget;\n // the === document seems to be a jest thing for focus to go there on generic blur event such as landmark.blur();\n // browsers appear to send focus instead to document.body and the relatedTarget is null when that happens\n if (!nextFocusedElement || nextFocusedElement === document) {\n let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);\n if (closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement) {\n closestPreviousLandmark.blur();\n }\n }\n }\n\n public createLandmarkController(): LandmarkController {\n let instance: LandmarkManager | null = this;\n instance.refCount++;\n instance.setupIfNeeded();\n return {\n navigate(direction, opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, direction === 'backward');\n },\n focusNext(opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, false);\n },\n focusPrevious(opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, true);\n },\n focusMain() {\n return instance!.focusMain();\n },\n dispose() {\n if (instance) {\n instance.refCount--;\n instance.teardownIfNeeded();\n instance = null;\n }\n }\n };\n }\n\n public registerLandmark(landmark: Landmark): () => void {\n if (this.landmarks.find(l => l.ref === landmark.ref)) {\n this.updateLandmark(landmark);\n } else {\n this.addLandmark(landmark);\n }\n\n return () => this.removeLandmark(landmark.ref);\n }\n}\n\n/** Creates a LandmarkController, which allows programmatic navigation of landmarks. */\nexport function UNSTABLE_createLandmarkController(): LandmarkController {\n // Get the current landmark manager and create a controller using it.\n let instance: LandmarkManagerApi | null = getLandmarkManager();\n let controller = instance?.createLandmarkController();\n\n let unsubscribe = subscribe(() => {\n // If the landmark manager changes, dispose the old\n // controller and create a new one.\n controller?.dispose();\n instance = getLandmarkManager();\n controller = instance?.createLandmarkController();\n });\n\n // Return a wrapper that proxies requests to the current controller instance.\n return {\n navigate(direction, opts) {\n return controller!.navigate(direction, opts);\n },\n focusNext(opts) {\n return controller!.focusNext(opts);\n },\n focusPrevious(opts) {\n return controller!.focusPrevious(opts);\n },\n focusMain() {\n return controller!.focusMain();\n },\n dispose() {\n controller?.dispose();\n unsubscribe();\n controller = undefined;\n instance = null;\n }\n };\n}\n\n/**\n * Provides landmark navigation in an application. Call this with a role and label to register a landmark navigable with F6.\n * @param props - Props for the landmark.\n * @param ref - Ref to the landmark.\n */\nexport function useLandmark(props: AriaLandmarkProps, ref: RefObject<FocusableElement | null>): LandmarkAria {\n const {\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n focus\n } = props;\n let manager = useLandmarkManager();\n let label = ariaLabel || ariaLabelledby;\n let [isLandmarkFocused, setIsLandmarkFocused] = useState(false);\n\n let defaultFocus = useCallback(() => {\n setIsLandmarkFocused(true);\n }, [setIsLandmarkFocused]);\n\n let blur = useCallback(() => {\n setIsLandmarkFocused(false);\n }, [setIsLandmarkFocused]);\n\n useLayoutEffect(() => {\n if (manager) {\n return manager.registerLandmark({ref, label, role, focus: focus || defaultFocus, blur});\n }\n }, [manager, label, ref, role, focus, defaultFocus, blur]);\n\n useEffect(() => {\n if (isLandmarkFocused) {\n ref.current?.focus();\n }\n }, [isLandmarkFocused, ref]);\n\n return {\n landmarkProps: {\n role,\n tabIndex: isLandmarkFocused ? -1 : undefined,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby\n }\n };\n}\n"],"names":[],"version":3,"file":"useLandmark.js.map"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AA2BD,6CAA6C;AAC7C,oDAAoD;AACpD,MAAM,6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AS;kBAAc;QAAI;IAEzF,GAAG;QAAC;QAAS;QAAO;QAAK;QAAM;QAAO;QAAc;KAAK;IAEzD,CAAA,GAAA,gBAAQ,EAAE;YAEN;QADF,IAAI,oBACF,eAAA,IAAI,OAAO,cAAX,mCAAA,aAAa,KAAK;IAEtB,GAAG;QAAC;QAAmB;KAAI;IAE3B,OAAO;QACL,eAAe;kBACb;YACA,UAAU,oBAAoB,KAAK;YACnC,cAAc;YACd,mBAAmB;QACrB;IACF;AACF","sources":["packages/react-aria/src/landmark/useLandmark.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaLabelingProps, DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {getEventTarget, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {useCallback, useEffect, useState} from 'react';\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useSyncExternalStore} from 'use-sync-external-store/shim/index.js';\n\nexport type AriaLandmarkRole =\n | 'main'\n | 'region'\n | 'search'\n | 'navigation'\n | 'form'\n | 'banner'\n | 'contentinfo'\n | 'complementary';\n\nexport interface AriaLandmarkProps extends AriaLabelingProps {\n role: AriaLandmarkRole;\n focus?: (direction: 'forward' | 'backward') => void;\n}\n\nexport interface LandmarkAria {\n landmarkProps: DOMAttributes;\n}\n\n// Increment this version number whenever the\n// LandmarkManagerApi or Landmark interfaces change.\nconst LANDMARK_API_VERSION = 1;\n\n// Minimal API for LandmarkManager that must continue to work between versions.\n// Changes to this interface are considered breaking. New methods/properties are\n// safe to add, but changes or removals are not allowed (same as public APIs).\ninterface LandmarkManagerApi {\n version: number;\n createLandmarkController(): LandmarkController;\n registerLandmark(landmark: Landmark): () => void;\n}\n\n// Changes to this interface are considered breaking.\n// New properties MUST be optional so that registering a landmark\n// from an older version of useLandmark against a newer version of\n// LandmarkManager does not crash.\ninterface Landmark {\n ref: RefObject<FocusableElement | null>;\n role: AriaLandmarkRole;\n label?: string;\n lastFocused?: FocusableElement;\n focus: (direction: 'forward' | 'backward') => void;\n blur: () => void;\n}\n\nexport interface LandmarkControllerOptions {\n /**\n * The element from which to start navigating.\n *\n * @default document.activeElement\n */\n from?: FocusableElement;\n}\n\n/** A LandmarkController allows programmatic navigation of landmarks. */\nexport interface LandmarkController {\n /** Moves focus to the next landmark. */\n focusNext(opts?: LandmarkControllerOptions): boolean;\n /** Moves focus to the previous landmark. */\n focusPrevious(opts?: LandmarkControllerOptions): boolean;\n /** Moves focus to the main landmark. */\n focusMain(): boolean;\n /** Moves focus either forward or backward in the landmark sequence. */\n navigate(direction: 'forward' | 'backward', opts?: LandmarkControllerOptions): boolean;\n /**\n * Disposes the landmark controller. When no landmarks are registered, and no\n * controllers are active, the landmark keyboard listeners are removed from the page.\n */\n dispose(): void;\n}\n\n// Symbol under which the singleton landmark manager instance is attached to the document.\nconst landmarkSymbol = Symbol.for('react-aria-landmark-manager');\n\nfunction subscribe(fn: () => void) {\n document.addEventListener('react-aria-landmark-manager-change', fn);\n return () => document.removeEventListener('react-aria-landmark-manager-change', fn);\n}\n\nfunction getLandmarkManager(): LandmarkManagerApi | null {\n if (typeof document === 'undefined') {\n return null;\n }\n\n // Reuse an existing instance if it has the same or greater version.\n let instance = document[landmarkSymbol];\n if (instance && instance.version >= LANDMARK_API_VERSION) {\n return instance;\n }\n\n // Otherwise, create a new instance and dispatch an event so anything using the existing\n // instance updates and re-registers their landmarks with the new one.\n document[landmarkSymbol] = new LandmarkManager();\n document.dispatchEvent(new CustomEvent('react-aria-landmark-manager-change'));\n return document[landmarkSymbol];\n}\n\n// Subscribes a React component to the current landmark manager instance.\nfunction useLandmarkManager(): LandmarkManagerApi | null {\n return useSyncExternalStore(subscribe, getLandmarkManager, getLandmarkManager);\n}\n\nclass LandmarkManager implements LandmarkManagerApi {\n private landmarks: Array<Landmark> = [];\n private isListening = false;\n private refCount = 0;\n public version = LANDMARK_API_VERSION;\n\n constructor() {\n this.f6Handler = this.f6Handler.bind(this);\n this.focusinHandler = this.focusinHandler.bind(this);\n this.focusoutHandler = this.focusoutHandler.bind(this);\n }\n\n private setupIfNeeded() {\n if (this.isListening) {\n return;\n }\n document.addEventListener('keydown', this.f6Handler, {capture: true});\n document.addEventListener('focusin', this.focusinHandler, {capture: true});\n document.addEventListener('focusout', this.focusoutHandler, {capture: true});\n this.isListening = true;\n }\n\n private teardownIfNeeded() {\n if (!this.isListening || this.landmarks.length > 0 || this.refCount > 0) {\n return;\n }\n document.removeEventListener('keydown', this.f6Handler, {capture: true});\n document.removeEventListener('focusin', this.focusinHandler, {capture: true});\n document.removeEventListener('focusout', this.focusoutHandler, {capture: true});\n this.isListening = false;\n }\n\n private focusLandmark(landmark: FocusableElement, direction: 'forward' | 'backward') {\n this.landmarks.find(l => l.ref.current === landmark)?.focus?.(direction);\n }\n\n /**\n * Return set of landmarks with a specific role.\n */\n private getLandmarksByRole(role: AriaLandmarkRole) {\n return new Set(this.landmarks.filter(l => l.role === role));\n }\n\n /**\n * Return first landmark with a specific role.\n */\n private getLandmarkByRole(role: AriaLandmarkRole) {\n return this.landmarks.find(l => l.role === role);\n }\n\n private addLandmark(newLandmark: Landmark) {\n this.setupIfNeeded();\n if (\n this.landmarks.find(landmark => landmark.ref === newLandmark.ref) ||\n !newLandmark.ref.current\n ) {\n return;\n }\n\n if (\n this.landmarks.filter(landmark => landmark.role === 'main').length > 1 &&\n process.env.NODE_ENV !== 'production'\n ) {\n console.error('Page can contain no more than one landmark with the role \"main\".');\n }\n\n if (this.landmarks.length === 0) {\n this.landmarks = [newLandmark];\n this.checkLabels(newLandmark.role);\n return;\n }\n\n // Binary search to insert new landmark based on position in document relative to existing landmarks.\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n let start = 0;\n let end = this.landmarks.length - 1;\n while (start <= end) {\n let mid = Math.floor((start + end) / 2);\n let comparedPosition = newLandmark.ref.current.compareDocumentPosition(\n this.landmarks[mid].ref.current as Node\n );\n let isNewAfterExisting = Boolean(\n comparedPosition & Node.DOCUMENT_POSITION_PRECEDING ||\n comparedPosition & Node.DOCUMENT_POSITION_CONTAINS\n );\n\n if (isNewAfterExisting) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n\n this.landmarks.splice(start, 0, newLandmark);\n this.checkLabels(newLandmark.role);\n }\n\n private updateLandmark(landmark: Pick<Landmark, 'ref'> & Partial<Landmark>) {\n let index = this.landmarks.findIndex(l => l.ref === landmark.ref);\n if (index >= 0) {\n this.landmarks[index] = {...this.landmarks[index], ...landmark};\n this.checkLabels(this.landmarks[index].role);\n }\n }\n\n private removeLandmark(ref: RefObject<Element | null>) {\n this.landmarks = this.landmarks.filter(landmark => landmark.ref !== ref);\n this.teardownIfNeeded();\n }\n\n /**\n * Warn if there are 2+ landmarks with the same role but no label.\n * Labels for landmarks with the same role must also be unique.\n *\n * See https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/.\n */\n private checkLabels(role: AriaLandmarkRole) {\n let landmarksWithRole = this.getLandmarksByRole(role);\n if (landmarksWithRole.size > 1) {\n let duplicatesWithoutLabel = [...landmarksWithRole].filter(landmark => !landmark.label);\n if (duplicatesWithoutLabel.length > 0 && process.env.NODE_ENV !== 'production') {\n console.warn(\n `Page contains more than one landmark with the '${role}' role. If two or more landmarks on a page share the same role, all must be labeled with an aria-label or aria-labelledby attribute: `,\n duplicatesWithoutLabel.map(landmark => landmark.ref.current)\n );\n } else if (process.env.NODE_ENV !== 'production') {\n let labels = [...landmarksWithRole].map(landmark => landmark.label);\n let duplicateLabels = labels.filter((item, index) => labels.indexOf(item) !== index);\n\n duplicateLabels.forEach(label => {\n console.warn(\n `Page contains more than one landmark with the '${role}' role and '${label}' label. If two or more landmarks on a page share the same role, they must have unique labels: `,\n [...landmarksWithRole]\n .filter(landmark => landmark.label === label)\n .map(landmark => landmark.ref.current)\n );\n });\n }\n }\n }\n\n /**\n * Get the landmark that is the closest parent in the DOM.\n * Returns undefined if no parent is a landmark.\n */\n private closestLandmark(element: FocusableElement) {\n let landmarkMap = new Map(this.landmarks.map(l => [l.ref.current, l]));\n let currentElement = element;\n while (\n currentElement &&\n !landmarkMap.has(currentElement) &&\n currentElement !== document.body &&\n currentElement.parentElement\n ) {\n currentElement = currentElement.parentElement;\n }\n return landmarkMap.get(currentElement);\n }\n\n /**\n * Gets the next landmark, in DOM focus order, or previous if backwards is specified.\n * If last landmark, next should be the first landmark.\n * If not inside a landmark, will return first landmark.\n * Returns undefined if there are no landmarks.\n */\n private getNextLandmark(element: FocusableElement, {backward}: {backward?: boolean}) {\n let currentLandmark = this.closestLandmark(element);\n let nextLandmarkIndex = backward ? this.landmarks.length - 1 : 0;\n if (currentLandmark) {\n nextLandmarkIndex = this.landmarks.indexOf(currentLandmark) + (backward ? -1 : 1);\n }\n\n let wrapIfNeeded = () => {\n // When we reach the end of the landmark sequence, fire a custom event that can be listened for by applications.\n // If this event is canceled, we return immediately. This can be used to implement landmark navigation across iframes.\n if (nextLandmarkIndex < 0) {\n if (\n !element.dispatchEvent(\n new CustomEvent('react-aria-landmark-navigation', {\n detail: {direction: 'backward'},\n bubbles: true,\n cancelable: true\n })\n )\n ) {\n return true;\n }\n\n nextLandmarkIndex = this.landmarks.length - 1;\n } else if (nextLandmarkIndex >= this.landmarks.length) {\n if (\n !element.dispatchEvent(\n new CustomEvent('react-aria-landmark-navigation', {\n detail: {direction: 'forward'},\n bubbles: true,\n cancelable: true\n })\n )\n ) {\n return true;\n }\n\n nextLandmarkIndex = 0;\n }\n\n if (nextLandmarkIndex < 0 || nextLandmarkIndex >= this.landmarks.length) {\n return true;\n }\n\n return false;\n };\n\n if (wrapIfNeeded()) {\n return undefined;\n }\n\n // Skip over hidden landmarks.\n let i = nextLandmarkIndex;\n while (this.landmarks[nextLandmarkIndex].ref.current?.closest('[aria-hidden=true]')) {\n nextLandmarkIndex += backward ? -1 : 1;\n if (wrapIfNeeded()) {\n return undefined;\n }\n\n if (nextLandmarkIndex === i) {\n break;\n }\n }\n\n return this.landmarks[nextLandmarkIndex];\n }\n\n /**\n * Look at next landmark. If an element was previously focused inside, restore focus there.\n * If not, focus the landmark itself.\n * If no landmarks at all, or none with focusable elements, don't move focus.\n */\n private f6Handler(e: KeyboardEvent) {\n if (e.key === 'F6') {\n // If alt key pressed, focus main landmark, otherwise navigate forward or backward based on shift key.\n let handled = e.altKey\n ? this.focusMain()\n : this.navigate(getEventTarget(e) as FocusableElement, e.shiftKey);\n if (handled) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n }\n\n private focusMain() {\n let main = this.getLandmarkByRole('main');\n if (main && main.ref.current && main.ref.current.isConnected) {\n this.focusLandmark(main.ref.current, 'forward');\n return true;\n }\n\n return false;\n }\n\n private navigate(from: FocusableElement, backward: boolean) {\n let nextLandmark = this.getNextLandmark(from, {\n backward\n });\n\n if (!nextLandmark) {\n return false;\n }\n\n // If something was previously focused in the next landmark, then return focus to it\n if (nextLandmark.lastFocused) {\n let lastFocused = nextLandmark.lastFocused;\n if (nodeContains(document.body, lastFocused)) {\n lastFocused.focus();\n return true;\n }\n }\n\n // Otherwise, focus the landmark itself\n if (nextLandmark.ref.current && nextLandmark.ref.current.isConnected) {\n this.focusLandmark(nextLandmark.ref.current, backward ? 'backward' : 'forward');\n return true;\n }\n\n return false;\n }\n\n /**\n * Sets lastFocused for a landmark, if focus is moved within that landmark.\n * Lets the last focused landmark know it was blurred if something else is focused.\n */\n private focusinHandler(e: FocusEvent) {\n let currentLandmark = this.closestLandmark(getEventTarget(e) as FocusableElement);\n if (currentLandmark && currentLandmark.ref.current !== getEventTarget(e)) {\n this.updateLandmark({\n ref: currentLandmark.ref,\n lastFocused: getEventTarget(e) as FocusableElement\n });\n }\n let previousFocusedElement = e.relatedTarget as FocusableElement;\n if (previousFocusedElement) {\n let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);\n if (\n closestPreviousLandmark &&\n closestPreviousLandmark.ref.current === previousFocusedElement\n ) {\n closestPreviousLandmark.blur();\n }\n }\n }\n\n /**\n * Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had\n * focus.\n */\n private focusoutHandler(e: FocusEvent) {\n let previousFocusedElement = getEventTarget(e) as FocusableElement;\n let nextFocusedElement = e.relatedTarget;\n // the === document seems to be a jest thing for focus to go there on generic blur event such as landmark.blur();\n // browsers appear to send focus instead to document.body and the relatedTarget is null when that happens\n if (!nextFocusedElement || nextFocusedElement === document) {\n let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);\n if (\n closestPreviousLandmark &&\n closestPreviousLandmark.ref.current === previousFocusedElement\n ) {\n closestPreviousLandmark.blur();\n }\n }\n }\n\n public createLandmarkController(): LandmarkController {\n let instance: LandmarkManager | null = this;\n instance.refCount++;\n instance.setupIfNeeded();\n return {\n navigate(direction, opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, direction === 'backward');\n },\n focusNext(opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, false);\n },\n focusPrevious(opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, true);\n },\n focusMain() {\n return instance!.focusMain();\n },\n dispose() {\n if (instance) {\n instance.refCount--;\n instance.teardownIfNeeded();\n instance = null;\n }\n }\n };\n }\n\n public registerLandmark(landmark: Landmark): () => void {\n if (this.landmarks.find(l => l.ref === landmark.ref)) {\n this.updateLandmark(landmark);\n } else {\n this.addLandmark(landmark);\n }\n\n return () => this.removeLandmark(landmark.ref);\n }\n}\n\n/** Creates a LandmarkController, which allows programmatic navigation of landmarks. */\nexport function UNSTABLE_createLandmarkController(): LandmarkController {\n // Get the current landmark manager and create a controller using it.\n let instance: LandmarkManagerApi | null = getLandmarkManager();\n let controller = instance?.createLandmarkController();\n\n let unsubscribe = subscribe(() => {\n // If the landmark manager changes, dispose the old\n // controller and create a new one.\n controller?.dispose();\n instance = getLandmarkManager();\n controller = instance?.createLandmarkController();\n });\n\n // Return a wrapper that proxies requests to the current controller instance.\n return {\n navigate(direction, opts) {\n return controller!.navigate(direction, opts);\n },\n focusNext(opts) {\n return controller!.focusNext(opts);\n },\n focusPrevious(opts) {\n return controller!.focusPrevious(opts);\n },\n focusMain() {\n return controller!.focusMain();\n },\n dispose() {\n controller?.dispose();\n unsubscribe();\n controller = undefined;\n instance = null;\n }\n };\n}\n\n/**\n * Provides landmark navigation in an application. Call this with a role and label to register a\n * landmark navigable with F6.\n *\n * @param props - Props for the landmark.\n * @param ref - Ref to the landmark.\n */\nexport function useLandmark(\n props: AriaLandmarkProps,\n ref: RefObject<FocusableElement | null>\n): LandmarkAria {\n const {role, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, focus} = props;\n let manager = useLandmarkManager();\n let label = ariaLabel || ariaLabelledby;\n let [isLandmarkFocused, setIsLandmarkFocused] = useState(false);\n\n let defaultFocus = useCallback(() => {\n setIsLandmarkFocused(true);\n }, [setIsLandmarkFocused]);\n\n let blur = useCallback(() => {\n setIsLandmarkFocused(false);\n }, [setIsLandmarkFocused]);\n\n useLayoutEffect(() => {\n if (manager) {\n return manager.registerLandmark({ref, label, role, focus: focus || defaultFocus, blur});\n }\n }, [manager, label, ref, role, focus, defaultFocus, blur]);\n\n useEffect(() => {\n if (isLandmarkFocused) {\n ref.current?.focus();\n }\n }, [isLandmarkFocused, ref]);\n\n return {\n landmarkProps: {\n role,\n tabIndex: isLandmarkFocused ? -1 : undefined,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby\n }\n };\n}\n"],"names":[],"version":3,"file":"useLandmark.js.map"}
@@ -268,7 +268,8 @@ class $6b88d4883d4c7fe3$var$LandmarkManager {
268
268
  }
269
269
  }
270
270
  /**
271
- * Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had focus.
271
+ * Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had
272
+ * focus.
272
273
  */ focusoutHandler(e) {
273
274
  let previousFocusedElement = (0, $23f2114a1b82827e$export$e58f029f0fbfdb29)(e);
274
275
  let nextFocusedElement = e.relatedTarget;
@@ -1 +1 @@
1
- {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAmBD,6CAA6C;AAC7C,oDAAoD;AACpD,MAAM,6CAAuB;AAiD7B,0FAA0F;AAC1F,MAAM,uCAAiB,OAAO,GAAG,CAAC;AAElC,SAAS,gCAAU,EAAc;IAC/B,SAAS,gBAAgB,CAAC,sCAAsC;IAChE,OAAO,IAAM,SAAS,mBAAmB,CAAC,sCAAsC;AAClF;AAEA,SAAS;IACP,IAAI,OAAO,aAAa,aACtB,OAAO;IAGT,oEAAoE;IACpE,IAAI,WAAW,QAAQ,CAAC,qCAAe;IACvC,IAAI,YAAY,SAAS,OAAO,IAAI,4CAClC,OAAO;IAGT,wFAAwF;IACxF,sEAAsE;IACtE,QAAQ,CAAC,qCAAe,GAAG,IAAI;IAC/B,SAAS,aAAa,CAAC,IAAI,YAAY;IACvC,OAAO,QAAQ,CAAC,qCAAe;AACjC;AAEA,yEAAyE;AACzE,SAAS;IACP,OAAO,CAAA,GAAA,2BAAmB,EAAE,iCAAW,0CAAoB;AAC7D;AAEA,MAAM;IAMJ,aAAc;aALN,YAA6B,EAAE;aAC/B,cAAc;aACd,WAAW;aACZ,UAAU;QAGf,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI;QACzC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI;QACnD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI;IACvD;IAEQ,gBAAgB;QACtB,IAAI,IAAI,CA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Ac,EAAE;QACd,IAAI,SACF,OAAO,QAAQ,gBAAgB,CAAC;iBAAC;mBAAK;kBAAO;YAAM,OAAO,SAAS;kBAAc;QAAI;IAEzF,GAAG;QAAC;QAAS;QAAO;QAAK;QAAM;QAAO;QAAc;KAAK;IAEzD,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,mBACF,IAAI,OAAO,EAAE;IAEjB,GAAG;QAAC;QAAmB;KAAI;IAE3B,OAAO;QACL,eAAe;kBACb;YACA,UAAU,oBAAoB,KAAK;YACnC,cAAc;YACd,mBAAmB;QACrB;IACF;AACF","sources":["packages/react-aria/src/landmark/useLandmark.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaLabelingProps, DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {getEventTarget, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {useCallback, useEffect, useState} from 'react';\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useSyncExternalStore} from 'use-sync-external-store/shim/index.js';\n\nexport type AriaLandmarkRole = 'main' | 'region' | 'search' | 'navigation' | 'form' | 'banner' | 'contentinfo' | 'complementary';\n\nexport interface AriaLandmarkProps extends AriaLabelingProps {\n role: AriaLandmarkRole,\n focus?: (direction: 'forward' | 'backward') => void\n}\n\nexport interface LandmarkAria {\n landmarkProps: DOMAttributes\n}\n\n// Increment this version number whenever the\n// LandmarkManagerApi or Landmark interfaces change.\nconst LANDMARK_API_VERSION = 1;\n\n// Minimal API for LandmarkManager that must continue to work between versions.\n// Changes to this interface are considered breaking. New methods/properties are\n// safe to add, but changes or removals are not allowed (same as public APIs).\ninterface LandmarkManagerApi {\n version: number,\n createLandmarkController(): LandmarkController,\n registerLandmark(landmark: Landmark): () => void\n}\n\n// Changes to this interface are considered breaking.\n// New properties MUST be optional so that registering a landmark\n// from an older version of useLandmark against a newer version of\n// LandmarkManager does not crash.\ninterface Landmark {\n ref: RefObject<FocusableElement | null>,\n role: AriaLandmarkRole,\n label?: string,\n lastFocused?: FocusableElement,\n focus: (direction: 'forward' | 'backward') => void,\n blur: () => void\n}\n\nexport interface LandmarkControllerOptions {\n /**\n * The element from which to start navigating.\n * @default document.activeElement\n */\n from?: FocusableElement\n}\n\n/** A LandmarkController allows programmatic navigation of landmarks. */\nexport interface LandmarkController {\n /** Moves focus to the next landmark. */\n focusNext(opts?: LandmarkControllerOptions): boolean,\n /** Moves focus to the previous landmark. */\n focusPrevious(opts?: LandmarkControllerOptions): boolean,\n /** Moves focus to the main landmark. */\n focusMain(): boolean,\n /** Moves focus either forward or backward in the landmark sequence. */\n navigate(direction: 'forward' | 'backward', opts?: LandmarkControllerOptions): boolean,\n /**\n * Disposes the landmark controller. When no landmarks are registered, and no\n * controllers are active, the landmark keyboard listeners are removed from the page.\n */\n dispose(): void\n}\n\n// Symbol under which the singleton landmark manager instance is attached to the document.\nconst landmarkSymbol = Symbol.for('react-aria-landmark-manager');\n\nfunction subscribe(fn: () => void) {\n document.addEventListener('react-aria-landmark-manager-change', fn);\n return () => document.removeEventListener('react-aria-landmark-manager-change', fn);\n}\n\nfunction getLandmarkManager(): LandmarkManagerApi | null {\n if (typeof document === 'undefined') {\n return null;\n }\n\n // Reuse an existing instance if it has the same or greater version.\n let instance = document[landmarkSymbol];\n if (instance && instance.version >= LANDMARK_API_VERSION) {\n return instance;\n }\n\n // Otherwise, create a new instance and dispatch an event so anything using the existing\n // instance updates and re-registers their landmarks with the new one.\n document[landmarkSymbol] = new LandmarkManager();\n document.dispatchEvent(new CustomEvent('react-aria-landmark-manager-change'));\n return document[landmarkSymbol];\n}\n\n// Subscribes a React component to the current landmark manager instance.\nfunction useLandmarkManager(): LandmarkManagerApi | null {\n return useSyncExternalStore(subscribe, getLandmarkManager, getLandmarkManager);\n}\n\nclass LandmarkManager implements LandmarkManagerApi {\n private landmarks: Array<Landmark> = [];\n private isListening = false;\n private refCount = 0;\n public version = LANDMARK_API_VERSION;\n\n constructor() {\n this.f6Handler = this.f6Handler.bind(this);\n this.focusinHandler = this.focusinHandler.bind(this);\n this.focusoutHandler = this.focusoutHandler.bind(this);\n }\n\n private setupIfNeeded() {\n if (this.isListening) {\n return;\n }\n document.addEventListener('keydown', this.f6Handler, {capture: true});\n document.addEventListener('focusin', this.focusinHandler, {capture: true});\n document.addEventListener('focusout', this.focusoutHandler, {capture: true});\n this.isListening = true;\n }\n\n private teardownIfNeeded() {\n if (!this.isListening || this.landmarks.length > 0 || this.refCount > 0) {\n return;\n }\n document.removeEventListener('keydown', this.f6Handler, {capture: true});\n document.removeEventListener('focusin', this.focusinHandler, {capture: true});\n document.removeEventListener('focusout', this.focusoutHandler, {capture: true});\n this.isListening = false;\n }\n\n private focusLandmark(landmark: FocusableElement, direction: 'forward' | 'backward') {\n this.landmarks.find(l => l.ref.current === landmark)?.focus?.(direction);\n }\n\n /**\n * Return set of landmarks with a specific role.\n */\n private getLandmarksByRole(role: AriaLandmarkRole) {\n return new Set(this.landmarks.filter(l => l.role === role));\n }\n\n /**\n * Return first landmark with a specific role.\n */\n private getLandmarkByRole(role: AriaLandmarkRole) {\n return this.landmarks.find(l => l.role === role);\n }\n\n private addLandmark(newLandmark: Landmark) {\n this.setupIfNeeded();\n if (this.landmarks.find(landmark => landmark.ref === newLandmark.ref) || !newLandmark.ref.current) {\n return;\n }\n\n if (this.landmarks.filter(landmark => landmark.role === 'main').length > 1 && process.env.NODE_ENV !== 'production') {\n console.error('Page can contain no more than one landmark with the role \"main\".');\n }\n\n if (this.landmarks.length === 0) {\n this.landmarks = [newLandmark];\n this.checkLabels(newLandmark.role);\n return;\n }\n\n\n // Binary search to insert new landmark based on position in document relative to existing landmarks.\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n let start = 0;\n let end = this.landmarks.length - 1;\n while (start <= end) {\n let mid = Math.floor((start + end) / 2);\n let comparedPosition = newLandmark.ref.current.compareDocumentPosition(this.landmarks[mid].ref.current as Node);\n let isNewAfterExisting = Boolean((comparedPosition & Node.DOCUMENT_POSITION_PRECEDING) || (comparedPosition & Node.DOCUMENT_POSITION_CONTAINS));\n\n if (isNewAfterExisting) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n\n this.landmarks.splice(start, 0, newLandmark);\n this.checkLabels(newLandmark.role);\n }\n\n private updateLandmark(landmark: Pick<Landmark, 'ref'> & Partial<Landmark>) {\n let index = this.landmarks.findIndex(l => l.ref === landmark.ref);\n if (index >= 0) {\n this.landmarks[index] = {...this.landmarks[index], ...landmark};\n this.checkLabels(this.landmarks[index].role);\n }\n }\n\n private removeLandmark(ref: RefObject<Element | null>) {\n this.landmarks = this.landmarks.filter(landmark => landmark.ref !== ref);\n this.teardownIfNeeded();\n }\n\n /**\n * Warn if there are 2+ landmarks with the same role but no label.\n * Labels for landmarks with the same role must also be unique.\n *\n * See https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/.\n */\n private checkLabels(role: AriaLandmarkRole) {\n let landmarksWithRole = this.getLandmarksByRole(role);\n if (landmarksWithRole.size > 1) {\n let duplicatesWithoutLabel = [...landmarksWithRole].filter(landmark => !landmark.label);\n if (duplicatesWithoutLabel.length > 0 && process.env.NODE_ENV !== 'production') {\n console.warn(\n `Page contains more than one landmark with the '${role}' role. If two or more landmarks on a page share the same role, all must be labeled with an aria-label or aria-labelledby attribute: `,\n duplicatesWithoutLabel.map(landmark => landmark.ref.current)\n );\n } else if (process.env.NODE_ENV !== 'production') {\n let labels = [...landmarksWithRole].map(landmark => landmark.label);\n let duplicateLabels = labels.filter((item, index) => labels.indexOf(item) !== index);\n\n duplicateLabels.forEach((label) => {\n console.warn(\n `Page contains more than one landmark with the '${role}' role and '${label}' label. If two or more landmarks on a page share the same role, they must have unique labels: `,\n [...landmarksWithRole].filter(landmark => landmark.label === label).map(landmark => landmark.ref.current)\n );\n });\n }\n }\n }\n\n /**\n * Get the landmark that is the closest parent in the DOM.\n * Returns undefined if no parent is a landmark.\n */\n private closestLandmark(element: FocusableElement) {\n let landmarkMap = new Map(this.landmarks.map(l => [l.ref.current, l]));\n let currentElement = element;\n while (currentElement && !landmarkMap.has(currentElement) && currentElement !== document.body && currentElement.parentElement) {\n currentElement = currentElement.parentElement;\n }\n return landmarkMap.get(currentElement);\n }\n\n /**\n * Gets the next landmark, in DOM focus order, or previous if backwards is specified.\n * If last landmark, next should be the first landmark.\n * If not inside a landmark, will return first landmark.\n * Returns undefined if there are no landmarks.\n */\n private getNextLandmark(element: FocusableElement, {backward}: {backward?: boolean }) {\n let currentLandmark = this.closestLandmark(element);\n let nextLandmarkIndex = backward ? this.landmarks.length - 1 : 0;\n if (currentLandmark) {\n nextLandmarkIndex = this.landmarks.indexOf(currentLandmark) + (backward ? -1 : 1);\n }\n\n let wrapIfNeeded = () => {\n // When we reach the end of the landmark sequence, fire a custom event that can be listened for by applications.\n // If this event is canceled, we return immediately. This can be used to implement landmark navigation across iframes.\n if (nextLandmarkIndex < 0) {\n if (!element.dispatchEvent(new CustomEvent('react-aria-landmark-navigation', {detail: {direction: 'backward'}, bubbles: true, cancelable: true}))) {\n return true;\n }\n\n nextLandmarkIndex = this.landmarks.length - 1;\n } else if (nextLandmarkIndex >= this.landmarks.length) {\n if (!element.dispatchEvent(new CustomEvent('react-aria-landmark-navigation', {detail: {direction: 'forward'}, bubbles: true, cancelable: true}))) {\n return true;\n }\n\n nextLandmarkIndex = 0;\n }\n\n if (nextLandmarkIndex < 0 || nextLandmarkIndex >= this.landmarks.length) {\n return true;\n }\n\n return false;\n };\n\n if (wrapIfNeeded()) {\n return undefined;\n }\n\n // Skip over hidden landmarks.\n let i = nextLandmarkIndex;\n while (this.landmarks[nextLandmarkIndex].ref.current?.closest('[aria-hidden=true]')) {\n nextLandmarkIndex += backward ? -1 : 1;\n if (wrapIfNeeded()) {\n return undefined;\n }\n\n if (nextLandmarkIndex === i) {\n break;\n }\n }\n\n return this.landmarks[nextLandmarkIndex];\n }\n\n /**\n * Look at next landmark. If an element was previously focused inside, restore focus there.\n * If not, focus the landmark itself.\n * If no landmarks at all, or none with focusable elements, don't move focus.\n */\n private f6Handler(e: KeyboardEvent) {\n if (e.key === 'F6') {\n // If alt key pressed, focus main landmark, otherwise navigate forward or backward based on shift key.\n let handled = e.altKey ? this.focusMain() : this.navigate(getEventTarget(e) as FocusableElement, e.shiftKey);\n if (handled) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n }\n\n private focusMain() {\n let main = this.getLandmarkByRole('main');\n if (main && main.ref.current && main.ref.current.isConnected) {\n this.focusLandmark(main.ref.current, 'forward');\n return true;\n }\n\n return false;\n }\n\n private navigate(from: FocusableElement, backward: boolean) {\n let nextLandmark = this.getNextLandmark(from, {\n backward\n });\n\n if (!nextLandmark) {\n return false;\n }\n\n // If something was previously focused in the next landmark, then return focus to it\n if (nextLandmark.lastFocused) {\n let lastFocused = nextLandmark.lastFocused;\n if (nodeContains(document.body, lastFocused)) {\n lastFocused.focus();\n return true;\n }\n }\n\n // Otherwise, focus the landmark itself\n if (nextLandmark.ref.current && nextLandmark.ref.current.isConnected) {\n this.focusLandmark(nextLandmark.ref.current, backward ? 'backward' : 'forward');\n return true;\n }\n\n return false;\n }\n\n /**\n * Sets lastFocused for a landmark, if focus is moved within that landmark.\n * Lets the last focused landmark know it was blurred if something else is focused.\n */\n private focusinHandler(e: FocusEvent) {\n let currentLandmark = this.closestLandmark(getEventTarget(e) as FocusableElement);\n if (currentLandmark && currentLandmark.ref.current !== getEventTarget(e)) {\n this.updateLandmark({ref: currentLandmark.ref, lastFocused: getEventTarget(e) as FocusableElement});\n }\n let previousFocusedElement = e.relatedTarget as FocusableElement;\n if (previousFocusedElement) {\n let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);\n if (closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement) {\n closestPreviousLandmark.blur();\n }\n }\n }\n\n /**\n * Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had focus.\n */\n private focusoutHandler(e: FocusEvent) {\n let previousFocusedElement = getEventTarget(e) as FocusableElement;\n let nextFocusedElement = e.relatedTarget;\n // the === document seems to be a jest thing for focus to go there on generic blur event such as landmark.blur();\n // browsers appear to send focus instead to document.body and the relatedTarget is null when that happens\n if (!nextFocusedElement || nextFocusedElement === document) {\n let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);\n if (closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement) {\n closestPreviousLandmark.blur();\n }\n }\n }\n\n public createLandmarkController(): LandmarkController {\n let instance: LandmarkManager | null = this;\n instance.refCount++;\n instance.setupIfNeeded();\n return {\n navigate(direction, opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, direction === 'backward');\n },\n focusNext(opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, false);\n },\n focusPrevious(opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, true);\n },\n focusMain() {\n return instance!.focusMain();\n },\n dispose() {\n if (instance) {\n instance.refCount--;\n instance.teardownIfNeeded();\n instance = null;\n }\n }\n };\n }\n\n public registerLandmark(landmark: Landmark): () => void {\n if (this.landmarks.find(l => l.ref === landmark.ref)) {\n this.updateLandmark(landmark);\n } else {\n this.addLandmark(landmark);\n }\n\n return () => this.removeLandmark(landmark.ref);\n }\n}\n\n/** Creates a LandmarkController, which allows programmatic navigation of landmarks. */\nexport function UNSTABLE_createLandmarkController(): LandmarkController {\n // Get the current landmark manager and create a controller using it.\n let instance: LandmarkManagerApi | null = getLandmarkManager();\n let controller = instance?.createLandmarkController();\n\n let unsubscribe = subscribe(() => {\n // If the landmark manager changes, dispose the old\n // controller and create a new one.\n controller?.dispose();\n instance = getLandmarkManager();\n controller = instance?.createLandmarkController();\n });\n\n // Return a wrapper that proxies requests to the current controller instance.\n return {\n navigate(direction, opts) {\n return controller!.navigate(direction, opts);\n },\n focusNext(opts) {\n return controller!.focusNext(opts);\n },\n focusPrevious(opts) {\n return controller!.focusPrevious(opts);\n },\n focusMain() {\n return controller!.focusMain();\n },\n dispose() {\n controller?.dispose();\n unsubscribe();\n controller = undefined;\n instance = null;\n }\n };\n}\n\n/**\n * Provides landmark navigation in an application. Call this with a role and label to register a landmark navigable with F6.\n * @param props - Props for the landmark.\n * @param ref - Ref to the landmark.\n */\nexport function useLandmark(props: AriaLandmarkProps, ref: RefObject<FocusableElement | null>): LandmarkAria {\n const {\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n focus\n } = props;\n let manager = useLandmarkManager();\n let label = ariaLabel || ariaLabelledby;\n let [isLandmarkFocused, setIsLandmarkFocused] = useState(false);\n\n let defaultFocus = useCallback(() => {\n setIsLandmarkFocused(true);\n }, [setIsLandmarkFocused]);\n\n let blur = useCallback(() => {\n setIsLandmarkFocused(false);\n }, [setIsLandmarkFocused]);\n\n useLayoutEffect(() => {\n if (manager) {\n return manager.registerLandmark({ref, label, role, focus: focus || defaultFocus, blur});\n }\n }, [manager, label, ref, role, focus, defaultFocus, blur]);\n\n useEffect(() => {\n if (isLandmarkFocused) {\n ref.current?.focus();\n }\n }, [isLandmarkFocused, ref]);\n\n return {\n landmarkProps: {\n role,\n tabIndex: isLandmarkFocused ? -1 : undefined,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby\n }\n };\n}\n"],"names":[],"version":3,"file":"useLandmark.mjs.map"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AA2BD,6CAA6C;AAC7C,oDAAoD;AACpD,MAAM,6CAAuB;AAkD7B,0FAA0F;AAC1F,MAAM,uCAAiB,OAAO,GAAG,CAAC;A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ights 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 {AriaLabelingProps, DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {getEventTarget, nodeContains} from '../utils/shadowdom/DOMFunctions';\nimport {useCallback, useEffect, useState} from 'react';\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useSyncExternalStore} from 'use-sync-external-store/shim/index.js';\n\nexport type AriaLandmarkRole =\n | 'main'\n | 'region'\n | 'search'\n | 'navigation'\n | 'form'\n | 'banner'\n | 'contentinfo'\n | 'complementary';\n\nexport interface AriaLandmarkProps extends AriaLabelingProps {\n role: AriaLandmarkRole;\n focus?: (direction: 'forward' | 'backward') => void;\n}\n\nexport interface LandmarkAria {\n landmarkProps: DOMAttributes;\n}\n\n// Increment this version number whenever the\n// LandmarkManagerApi or Landmark interfaces change.\nconst LANDMARK_API_VERSION = 1;\n\n// Minimal API for LandmarkManager that must continue to work between versions.\n// Changes to this interface are considered breaking. New methods/properties are\n// safe to add, but changes or removals are not allowed (same as public APIs).\ninterface LandmarkManagerApi {\n version: number;\n createLandmarkController(): LandmarkController;\n registerLandmark(landmark: Landmark): () => void;\n}\n\n// Changes to this interface are considered breaking.\n// New properties MUST be optional so that registering a landmark\n// from an older version of useLandmark against a newer version of\n// LandmarkManager does not crash.\ninterface Landmark {\n ref: RefObject<FocusableElement | null>;\n role: AriaLandmarkRole;\n label?: string;\n lastFocused?: FocusableElement;\n focus: (direction: 'forward' | 'backward') => void;\n blur: () => void;\n}\n\nexport interface LandmarkControllerOptions {\n /**\n * The element from which to start navigating.\n *\n * @default document.activeElement\n */\n from?: FocusableElement;\n}\n\n/** A LandmarkController allows programmatic navigation of landmarks. */\nexport interface LandmarkController {\n /** Moves focus to the next landmark. */\n focusNext(opts?: LandmarkControllerOptions): boolean;\n /** Moves focus to the previous landmark. */\n focusPrevious(opts?: LandmarkControllerOptions): boolean;\n /** Moves focus to the main landmark. */\n focusMain(): boolean;\n /** Moves focus either forward or backward in the landmark sequence. */\n navigate(direction: 'forward' | 'backward', opts?: LandmarkControllerOptions): boolean;\n /**\n * Disposes the landmark controller. When no landmarks are registered, and no\n * controllers are active, the landmark keyboard listeners are removed from the page.\n */\n dispose(): void;\n}\n\n// Symbol under which the singleton landmark manager instance is attached to the document.\nconst landmarkSymbol = Symbol.for('react-aria-landmark-manager');\n\nfunction subscribe(fn: () => void) {\n document.addEventListener('react-aria-landmark-manager-change', fn);\n return () => document.removeEventListener('react-aria-landmark-manager-change', fn);\n}\n\nfunction getLandmarkManager(): LandmarkManagerApi | null {\n if (typeof document === 'undefined') {\n return null;\n }\n\n // Reuse an existing instance if it has the same or greater version.\n let instance = document[landmarkSymbol];\n if (instance && instance.version >= LANDMARK_API_VERSION) {\n return instance;\n }\n\n // Otherwise, create a new instance and dispatch an event so anything using the existing\n // instance updates and re-registers their landmarks with the new one.\n document[landmarkSymbol] = new LandmarkManager();\n document.dispatchEvent(new CustomEvent('react-aria-landmark-manager-change'));\n return document[landmarkSymbol];\n}\n\n// Subscribes a React component to the current landmark manager instance.\nfunction useLandmarkManager(): LandmarkManagerApi | null {\n return useSyncExternalStore(subscribe, getLandmarkManager, getLandmarkManager);\n}\n\nclass LandmarkManager implements LandmarkManagerApi {\n private landmarks: Array<Landmark> = [];\n private isListening = false;\n private refCount = 0;\n public version = LANDMARK_API_VERSION;\n\n constructor() {\n this.f6Handler = this.f6Handler.bind(this);\n this.focusinHandler = this.focusinHandler.bind(this);\n this.focusoutHandler = this.focusoutHandler.bind(this);\n }\n\n private setupIfNeeded() {\n if (this.isListening) {\n return;\n }\n document.addEventListener('keydown', this.f6Handler, {capture: true});\n document.addEventListener('focusin', this.focusinHandler, {capture: true});\n document.addEventListener('focusout', this.focusoutHandler, {capture: true});\n this.isListening = true;\n }\n\n private teardownIfNeeded() {\n if (!this.isListening || this.landmarks.length > 0 || this.refCount > 0) {\n return;\n }\n document.removeEventListener('keydown', this.f6Handler, {capture: true});\n document.removeEventListener('focusin', this.focusinHandler, {capture: true});\n document.removeEventListener('focusout', this.focusoutHandler, {capture: true});\n this.isListening = false;\n }\n\n private focusLandmark(landmark: FocusableElement, direction: 'forward' | 'backward') {\n this.landmarks.find(l => l.ref.current === landmark)?.focus?.(direction);\n }\n\n /**\n * Return set of landmarks with a specific role.\n */\n private getLandmarksByRole(role: AriaLandmarkRole) {\n return new Set(this.landmarks.filter(l => l.role === role));\n }\n\n /**\n * Return first landmark with a specific role.\n */\n private getLandmarkByRole(role: AriaLandmarkRole) {\n return this.landmarks.find(l => l.role === role);\n }\n\n private addLandmark(newLandmark: Landmark) {\n this.setupIfNeeded();\n if (\n this.landmarks.find(landmark => landmark.ref === newLandmark.ref) ||\n !newLandmark.ref.current\n ) {\n return;\n }\n\n if (\n this.landmarks.filter(landmark => landmark.role === 'main').length > 1 &&\n process.env.NODE_ENV !== 'production'\n ) {\n console.error('Page can contain no more than one landmark with the role \"main\".');\n }\n\n if (this.landmarks.length === 0) {\n this.landmarks = [newLandmark];\n this.checkLabels(newLandmark.role);\n return;\n }\n\n // Binary search to insert new landmark based on position in document relative to existing landmarks.\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n let start = 0;\n let end = this.landmarks.length - 1;\n while (start <= end) {\n let mid = Math.floor((start + end) / 2);\n let comparedPosition = newLandmark.ref.current.compareDocumentPosition(\n this.landmarks[mid].ref.current as Node\n );\n let isNewAfterExisting = Boolean(\n comparedPosition & Node.DOCUMENT_POSITION_PRECEDING ||\n comparedPosition & Node.DOCUMENT_POSITION_CONTAINS\n );\n\n if (isNewAfterExisting) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n\n this.landmarks.splice(start, 0, newLandmark);\n this.checkLabels(newLandmark.role);\n }\n\n private updateLandmark(landmark: Pick<Landmark, 'ref'> & Partial<Landmark>) {\n let index = this.landmarks.findIndex(l => l.ref === landmark.ref);\n if (index >= 0) {\n this.landmarks[index] = {...this.landmarks[index], ...landmark};\n this.checkLabels(this.landmarks[index].role);\n }\n }\n\n private removeLandmark(ref: RefObject<Element | null>) {\n this.landmarks = this.landmarks.filter(landmark => landmark.ref !== ref);\n this.teardownIfNeeded();\n }\n\n /**\n * Warn if there are 2+ landmarks with the same role but no label.\n * Labels for landmarks with the same role must also be unique.\n *\n * See https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/.\n */\n private checkLabels(role: AriaLandmarkRole) {\n let landmarksWithRole = this.getLandmarksByRole(role);\n if (landmarksWithRole.size > 1) {\n let duplicatesWithoutLabel = [...landmarksWithRole].filter(landmark => !landmark.label);\n if (duplicatesWithoutLabel.length > 0 && process.env.NODE_ENV !== 'production') {\n console.warn(\n `Page contains more than one landmark with the '${role}' role. If two or more landmarks on a page share the same role, all must be labeled with an aria-label or aria-labelledby attribute: `,\n duplicatesWithoutLabel.map(landmark => landmark.ref.current)\n );\n } else if (process.env.NODE_ENV !== 'production') {\n let labels = [...landmarksWithRole].map(landmark => landmark.label);\n let duplicateLabels = labels.filter((item, index) => labels.indexOf(item) !== index);\n\n duplicateLabels.forEach(label => {\n console.warn(\n `Page contains more than one landmark with the '${role}' role and '${label}' label. If two or more landmarks on a page share the same role, they must have unique labels: `,\n [...landmarksWithRole]\n .filter(landmark => landmark.label === label)\n .map(landmark => landmark.ref.current)\n );\n });\n }\n }\n }\n\n /**\n * Get the landmark that is the closest parent in the DOM.\n * Returns undefined if no parent is a landmark.\n */\n private closestLandmark(element: FocusableElement) {\n let landmarkMap = new Map(this.landmarks.map(l => [l.ref.current, l]));\n let currentElement = element;\n while (\n currentElement &&\n !landmarkMap.has(currentElement) &&\n currentElement !== document.body &&\n currentElement.parentElement\n ) {\n currentElement = currentElement.parentElement;\n }\n return landmarkMap.get(currentElement);\n }\n\n /**\n * Gets the next landmark, in DOM focus order, or previous if backwards is specified.\n * If last landmark, next should be the first landmark.\n * If not inside a landmark, will return first landmark.\n * Returns undefined if there are no landmarks.\n */\n private getNextLandmark(element: FocusableElement, {backward}: {backward?: boolean}) {\n let currentLandmark = this.closestLandmark(element);\n let nextLandmarkIndex = backward ? this.landmarks.length - 1 : 0;\n if (currentLandmark) {\n nextLandmarkIndex = this.landmarks.indexOf(currentLandmark) + (backward ? -1 : 1);\n }\n\n let wrapIfNeeded = () => {\n // When we reach the end of the landmark sequence, fire a custom event that can be listened for by applications.\n // If this event is canceled, we return immediately. This can be used to implement landmark navigation across iframes.\n if (nextLandmarkIndex < 0) {\n if (\n !element.dispatchEvent(\n new CustomEvent('react-aria-landmark-navigation', {\n detail: {direction: 'backward'},\n bubbles: true,\n cancelable: true\n })\n )\n ) {\n return true;\n }\n\n nextLandmarkIndex = this.landmarks.length - 1;\n } else if (nextLandmarkIndex >= this.landmarks.length) {\n if (\n !element.dispatchEvent(\n new CustomEvent('react-aria-landmark-navigation', {\n detail: {direction: 'forward'},\n bubbles: true,\n cancelable: true\n })\n )\n ) {\n return true;\n }\n\n nextLandmarkIndex = 0;\n }\n\n if (nextLandmarkIndex < 0 || nextLandmarkIndex >= this.landmarks.length) {\n return true;\n }\n\n return false;\n };\n\n if (wrapIfNeeded()) {\n return undefined;\n }\n\n // Skip over hidden landmarks.\n let i = nextLandmarkIndex;\n while (this.landmarks[nextLandmarkIndex].ref.current?.closest('[aria-hidden=true]')) {\n nextLandmarkIndex += backward ? -1 : 1;\n if (wrapIfNeeded()) {\n return undefined;\n }\n\n if (nextLandmarkIndex === i) {\n break;\n }\n }\n\n return this.landmarks[nextLandmarkIndex];\n }\n\n /**\n * Look at next landmark. If an element was previously focused inside, restore focus there.\n * If not, focus the landmark itself.\n * If no landmarks at all, or none with focusable elements, don't move focus.\n */\n private f6Handler(e: KeyboardEvent) {\n if (e.key === 'F6') {\n // If alt key pressed, focus main landmark, otherwise navigate forward or backward based on shift key.\n let handled = e.altKey\n ? this.focusMain()\n : this.navigate(getEventTarget(e) as FocusableElement, e.shiftKey);\n if (handled) {\n e.preventDefault();\n e.stopPropagation();\n }\n }\n }\n\n private focusMain() {\n let main = this.getLandmarkByRole('main');\n if (main && main.ref.current && main.ref.current.isConnected) {\n this.focusLandmark(main.ref.current, 'forward');\n return true;\n }\n\n return false;\n }\n\n private navigate(from: FocusableElement, backward: boolean) {\n let nextLandmark = this.getNextLandmark(from, {\n backward\n });\n\n if (!nextLandmark) {\n return false;\n }\n\n // If something was previously focused in the next landmark, then return focus to it\n if (nextLandmark.lastFocused) {\n let lastFocused = nextLandmark.lastFocused;\n if (nodeContains(document.body, lastFocused)) {\n lastFocused.focus();\n return true;\n }\n }\n\n // Otherwise, focus the landmark itself\n if (nextLandmark.ref.current && nextLandmark.ref.current.isConnected) {\n this.focusLandmark(nextLandmark.ref.current, backward ? 'backward' : 'forward');\n return true;\n }\n\n return false;\n }\n\n /**\n * Sets lastFocused for a landmark, if focus is moved within that landmark.\n * Lets the last focused landmark know it was blurred if something else is focused.\n */\n private focusinHandler(e: FocusEvent) {\n let currentLandmark = this.closestLandmark(getEventTarget(e) as FocusableElement);\n if (currentLandmark && currentLandmark.ref.current !== getEventTarget(e)) {\n this.updateLandmark({\n ref: currentLandmark.ref,\n lastFocused: getEventTarget(e) as FocusableElement\n });\n }\n let previousFocusedElement = e.relatedTarget as FocusableElement;\n if (previousFocusedElement) {\n let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);\n if (\n closestPreviousLandmark &&\n closestPreviousLandmark.ref.current === previousFocusedElement\n ) {\n closestPreviousLandmark.blur();\n }\n }\n }\n\n /**\n * Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had\n * focus.\n */\n private focusoutHandler(e: FocusEvent) {\n let previousFocusedElement = getEventTarget(e) as FocusableElement;\n let nextFocusedElement = e.relatedTarget;\n // the === document seems to be a jest thing for focus to go there on generic blur event such as landmark.blur();\n // browsers appear to send focus instead to document.body and the relatedTarget is null when that happens\n if (!nextFocusedElement || nextFocusedElement === document) {\n let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);\n if (\n closestPreviousLandmark &&\n closestPreviousLandmark.ref.current === previousFocusedElement\n ) {\n closestPreviousLandmark.blur();\n }\n }\n }\n\n public createLandmarkController(): LandmarkController {\n let instance: LandmarkManager | null = this;\n instance.refCount++;\n instance.setupIfNeeded();\n return {\n navigate(direction, opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, direction === 'backward');\n },\n focusNext(opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, false);\n },\n focusPrevious(opts) {\n let element = opts?.from || (document!.activeElement as FocusableElement);\n return instance!.navigate(element, true);\n },\n focusMain() {\n return instance!.focusMain();\n },\n dispose() {\n if (instance) {\n instance.refCount--;\n instance.teardownIfNeeded();\n instance = null;\n }\n }\n };\n }\n\n public registerLandmark(landmark: Landmark): () => void {\n if (this.landmarks.find(l => l.ref === landmark.ref)) {\n this.updateLandmark(landmark);\n } else {\n this.addLandmark(landmark);\n }\n\n return () => this.removeLandmark(landmark.ref);\n }\n}\n\n/** Creates a LandmarkController, which allows programmatic navigation of landmarks. */\nexport function UNSTABLE_createLandmarkController(): LandmarkController {\n // Get the current landmark manager and create a controller using it.\n let instance: LandmarkManagerApi | null = getLandmarkManager();\n let controller = instance?.createLandmarkController();\n\n let unsubscribe = subscribe(() => {\n // If the landmark manager changes, dispose the old\n // controller and create a new one.\n controller?.dispose();\n instance = getLandmarkManager();\n controller = instance?.createLandmarkController();\n });\n\n // Return a wrapper that proxies requests to the current controller instance.\n return {\n navigate(direction, opts) {\n return controller!.navigate(direction, opts);\n },\n focusNext(opts) {\n return controller!.focusNext(opts);\n },\n focusPrevious(opts) {\n return controller!.focusPrevious(opts);\n },\n focusMain() {\n return controller!.focusMain();\n },\n dispose() {\n controller?.dispose();\n unsubscribe();\n controller = undefined;\n instance = null;\n }\n };\n}\n\n/**\n * Provides landmark navigation in an application. Call this with a role and label to register a\n * landmark navigable with F6.\n *\n * @param props - Props for the landmark.\n * @param ref - Ref to the landmark.\n */\nexport function useLandmark(\n props: AriaLandmarkProps,\n ref: RefObject<FocusableElement | null>\n): LandmarkAria {\n const {role, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, focus} = props;\n let manager = useLandmarkManager();\n let label = ariaLabel || ariaLabelledby;\n let [isLandmarkFocused, setIsLandmarkFocused] = useState(false);\n\n let defaultFocus = useCallback(() => {\n setIsLandmarkFocused(true);\n }, [setIsLandmarkFocused]);\n\n let blur = useCallback(() => {\n setIsLandmarkFocused(false);\n }, [setIsLandmarkFocused]);\n\n useLayoutEffect(() => {\n if (manager) {\n return manager.registerLandmark({ref, label, role, focus: focus || defaultFocus, blur});\n }\n }, [manager, label, ref, role, focus, defaultFocus, blur]);\n\n useEffect(() => {\n if (isLandmarkFocused) {\n ref.current?.focus();\n }\n }, [isLandmarkFocused, ref]);\n\n return {\n landmarkProps: {\n role,\n tabIndex: isLandmarkFocused ? -1 : undefined,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby\n }\n };\n}\n"],"names":[],"version":3,"file":"useLandmark.mjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoCM,SAAS,0CAAQ,KAAsB,EAAE,GAAuC;IACrF,IAAI,eACF,cAAc,cACd,OAAO,gBACP,YAAY,cACZ,UAAU,WACV,OAAO,cACP,UAAU,EACV,GAAG,YACJ,GAAG;IAEJ,IAAI,YAA2B,CAAC;IAChC,IAAI,gBAAgB,KAClB,YAAY;QACV,MAAM;QACN,UAAU,CAAC,aAAa,IAAI;IAC9B;IAEF,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,kCAAO,EAAE;iBAAC;sBAAS;oBAAc;iBAAY;oBAAS;aAAY;IAAG;IACnG,IAAI,WAAW,CAAA,GAAA,wCAAa,EAAE,YAAY;QAAC,WAAW;IAAI;IAC1D,IAAI,sBAAsB,CAAA,GAAA,oCAAS,EAAE,gBAAgB;IACrD,IAAI,SAAS,CAAA,GAAA,mCAAQ;IACrB,IAAI,kBAAkB,CAAA,GAAA,sCAAW,EAAE;IAEnC,OAAO;mBACL;QACA,WAAW,CAAA,GAAA,oCAAS,EAAE,UAAU,iBAAiB;YAC/C,GAAG,mBAAmB;YACtB,GAAG,SAAS;YACZ,iBAAiB,cAAc;YAC/B,gBAAgB,KAAK,CAAC,eAAe;YACrC,SAAS,CAAC;gBACR,WAAW,OAAO,GAAG;gBACrB,CAAA,GAAA,yCAAc,EAAE,GAAG,QAAQ,MAAM,IAAI,EAAE,MAAM,aAAa;YAC5D;QACF;IACF;AACF","sources":["packages/react-aria/src/link/useLink.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 {AriaLabelingProps, DOMAttributes, FocusableElement, FocusableProps, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {handleLinkClick, useLinkProps, useRouter} from '../utils/openLink';\nimport {mergeProps} from '../utils/mergeProps';\nimport React from 'react';\nimport {useFocusable} from '../interactions/useFocusable';\nimport {usePress} from '../interactions/usePress';\n\nexport interface LinkProps extends PressEvents, FocusableProps {}\n\nexport interface AriaLinkProps extends LinkProps, LinkDOMProps, AriaLabelingProps { }\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean,\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n * @default 'a'\n */\n elementType?: string\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: DOMAttributes,\n /** Whether the link is currently pressed. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<FocusableElement | null>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n onClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: DOMAttributes = {};\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({onPress, onPressStart, onPressEnd, onClick, isDisabled, ref});\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n let router = useRouter();\n let routerLinkProps = useLinkProps(props);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, routerLinkProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n 'aria-current': props['aria-current'],\n onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {\n pressProps.onClick?.(e);\n handleLinkClick(e, router, props.href, props.routerOptions);\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useLink.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA6CM,SAAS,0CAAQ,KAAsB,EAAE,GAAuC;IACrF,IAAI,eACF,cAAc,cACd,OAAO,gBACP,YAAY,cACZ,UAAU,WACV,OAAO,cACP,UAAU,EACV,GAAG,YACJ,GAAG;IAEJ,IAAI,YAA2B,CAAC;IAChC,IAAI,gBAAgB,KAClB,YAAY;QACV,MAAM;QACN,UAAU,CAAC,aAAa,IAAI;IAC9B;IAEF,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,kCAAO,EAAE;iBACrC;sBACA;oBACA;iBACA;oBACA;aACA;IACF;IACA,IAAI,WAAW,CAAA,GAAA,wCAAa,EAAE,YAAY;QAAC,WAAW;IAAI;IAC1D,IAAI,sBAAsB,CAAA,GAAA,oCAAS,EAAE,gBAAgB;IACrD,IAAI,SAAS,CAAA,GAAA,mCAAQ;IACrB,IAAI,kBAAkB,CAAA,GAAA,sCAAW,EAAE;IAEnC,OAAO;mBACL;QACA,WAAW,CAAA,GAAA,oCAAS,EAAE,UAAU,iBAAiB;YAC/C,GAAG,mBAAmB;YACtB,GAAG,SAAS;YACZ,iBAAiB,cAAc;YAC/B,gBAAgB,KAAK,CAAC,eAAe;YACrC,SAAS,CAAC;gBACR,WAAW,OAAO,GAAG;gBACrB,CAAA,GAAA,yCAAc,EAAE,GAAG,QAAQ,MAAM,IAAI,EAAE,MAAM,aAAa;YAC5D;QACF;IACF;AACF","sources":["packages/react-aria/src/link/useLink.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 {\n AriaLabelingProps,\n DOMAttributes,\n FocusableElement,\n FocusableProps,\n LinkDOMProps,\n PressEvents,\n RefObject\n} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {handleLinkClick, useLinkProps, useRouter} from '../utils/openLink';\nimport {mergeProps} from '../utils/mergeProps';\nimport React from 'react';\nimport {useFocusable} from '../interactions/useFocusable';\nimport {usePress} from '../interactions/usePress';\n\nexport interface LinkProps extends PressEvents, FocusableProps {}\n\nexport interface AriaLinkProps extends LinkProps, LinkDOMProps, AriaLabelingProps {}\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean;\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n *\n * @default 'a'\n */\n elementType?: string;\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: DOMAttributes;\n /** Whether the link is currently pressed. */\n isPressed: boolean;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<FocusableElement | null>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n onClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: DOMAttributes = {};\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({\n onPress,\n onPressStart,\n onPressEnd,\n onClick,\n isDisabled,\n ref\n });\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n let router = useRouter();\n let routerLinkProps = useLinkProps(props);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, routerLinkProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n 'aria-current': props['aria-current'],\n onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {\n pressProps.onClick?.(e);\n handleLinkClick(e, router, props.href, props.routerOptions);\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useLink.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoCM,SAAS,0CAAQ,KAAsB,EAAE,GAAuC;IACrF,IAAI,eACF,cAAc,cACd,OAAO,gBACP,YAAY,cACZ,UAAU,WACV,OAAO,cACP,UAAU,EACV,GAAG,YACJ,GAAG;IAEJ,IAAI,YAA2B,CAAC;IAChC,IAAI,gBAAgB,KAClB,YAAY;QACV,MAAM;QACN,UAAU,CAAC,aAAa,IAAI;IAC9B;IAEF,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE,OAAO;IAC3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAO,EAAE;iBAAC;sBAAS;oBAAc;iBAAY;oBAAS;aAAY;IAAG;IACnG,IAAI,WAAW,CAAA,GAAA,yCAAa,EAAE,YAAY;QAAC,WAAW;IAAI;IAC1D,IAAI,sBAAsB,CAAA,GAAA,yCAAS,EAAE,gBAAgB;IACrD,IAAI,SAAS,CAAA,GAAA,yCAAQ;IACrB,IAAI,kBAAkB,CAAA,GAAA,yCAAW,EAAE;IAEnC,OAAO;mBACL;QACA,WAAW,CAAA,GAAA,yCAAS,EAAE,UAAU,iBAAiB;YAC/C,GAAG,mBAAmB;YACtB,GAAG,SAAS;YACZ,iBAAiB,cAAc;YAC/B,gBAAgB,KAAK,CAAC,eAAe;YACrC,SAAS,CAAC;oBACR;iBAAA,sBAAA,WAAW,OAAO,cAAlB,0CAAA,yBAAA,YAAqB;gBACrB,CAAA,GAAA,yCAAc,EAAE,GAAG,QAAQ,MAAM,IAAI,EAAE,MAAM,aAAa;YAC5D;QACF;IACF;AACF","sources":["packages/react-aria/src/link/useLink.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 {AriaLabelingProps, DOMAttributes, FocusableElement, FocusableProps, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {handleLinkClick, useLinkProps, useRouter} from '../utils/openLink';\nimport {mergeProps} from '../utils/mergeProps';\nimport React from 'react';\nimport {useFocusable} from '../interactions/useFocusable';\nimport {usePress} from '../interactions/usePress';\n\nexport interface LinkProps extends PressEvents, FocusableProps {}\n\nexport interface AriaLinkProps extends LinkProps, LinkDOMProps, AriaLabelingProps { }\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean,\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n * @default 'a'\n */\n elementType?: string\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: DOMAttributes,\n /** Whether the link is currently pressed. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<FocusableElement | null>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n onClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: DOMAttributes = {};\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({onPress, onPressStart, onPressEnd, onClick, isDisabled, ref});\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n let router = useRouter();\n let routerLinkProps = useLinkProps(props);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, routerLinkProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n 'aria-current': props['aria-current'],\n onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {\n pressProps.onClick?.(e);\n handleLinkClick(e, router, props.href, props.routerOptions);\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useLink.js.map"}
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA6CM,SAAS,0CAAQ,KAAsB,EAAE,GAAuC;IACrF,IAAI,eACF,cAAc,cACd,OAAO,gBACP,YAAY,cACZ,UAAU,WACV,OAAO,cACP,UAAU,EACV,GAAG,YACJ,GAAG;IAEJ,IAAI,YAA2B,CAAC;IAChC,IAAI,gBAAgB,KAClB,YAAY;QACV,MAAM;QACN,UAAU,CAAC,aAAa,IAAI;IAC9B;IAEF,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE,OAAO;IAC3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAO,EAAE;iBACrC;sBACA;oBACA;iBACA;oBACA;aACA;IACF;IACA,IAAI,WAAW,CAAA,GAAA,yCAAa,EAAE,YAAY;QAAC,WAAW;IAAI;IAC1D,IAAI,sBAAsB,CAAA,GAAA,yCAAS,EAAE,gBAAgB;IACrD,IAAI,SAAS,CAAA,GAAA,yCAAQ;IACrB,IAAI,kBAAkB,CAAA,GAAA,yCAAW,EAAE;IAEnC,OAAO;mBACL;QACA,WAAW,CAAA,GAAA,yCAAS,EAAE,UAAU,iBAAiB;YAC/C,GAAG,mBAAmB;YACtB,GAAG,SAAS;YACZ,iBAAiB,cAAc;YAC/B,gBAAgB,KAAK,CAAC,eAAe;YACrC,SAAS,CAAC;oBACR;iBAAA,sBAAA,WAAW,OAAO,cAAlB,0CAAA,yBAAA,YAAqB;gBACrB,CAAA,GAAA,yCAAc,EAAE,GAAG,QAAQ,MAAM,IAAI,EAAE,MAAM,aAAa;YAC5D;QACF;IACF;AACF","sources":["packages/react-aria/src/link/useLink.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 {\n AriaLabelingProps,\n DOMAttributes,\n FocusableElement,\n FocusableProps,\n LinkDOMProps,\n PressEvents,\n RefObject\n} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {handleLinkClick, useLinkProps, useRouter} from '../utils/openLink';\nimport {mergeProps} from '../utils/mergeProps';\nimport React from 'react';\nimport {useFocusable} from '../interactions/useFocusable';\nimport {usePress} from '../interactions/usePress';\n\nexport interface LinkProps extends PressEvents, FocusableProps {}\n\nexport interface AriaLinkProps extends LinkProps, LinkDOMProps, AriaLabelingProps {}\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean;\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n *\n * @default 'a'\n */\n elementType?: string;\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: DOMAttributes;\n /** Whether the link is currently pressed. */\n isPressed: boolean;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<FocusableElement | null>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n onClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: DOMAttributes = {};\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({\n onPress,\n onPressStart,\n onPressEnd,\n onClick,\n isDisabled,\n ref\n });\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n let router = useRouter();\n let routerLinkProps = useLinkProps(props);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, routerLinkProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n 'aria-current': props['aria-current'],\n onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {\n pressProps.onClick?.(e);\n handleLinkClick(e, router, props.href, props.routerOptions);\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useLink.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoCM,SAAS,0CAAQ,KAAsB,EAAE,GAAuC;IACrF,IAAI,eACF,cAAc,cACd,OAAO,gBACP,YAAY,cACZ,UAAU,WACV,OAAO,cACP,UAAU,EACV,GAAG,YACJ,GAAG;IAEJ,IAAI,YAA2B,CAAC;IAChC,IAAI,gBAAgB,KAClB,YAAY;QACV,MAAM;QACN,UAAU,CAAC,aAAa,IAAI;IAC9B;IAEF,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE,OAAO;IAC3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAO,EAAE;iBAAC;sBAAS;oBAAc;iBAAY;oBAAS;aAAY;IAAG;IACnG,IAAI,WAAW,CAAA,GAAA,yCAAa,EAAE,YAAY;QAAC,WAAW;IAAI;IAC1D,IAAI,sBAAsB,CAAA,GAAA,yCAAS,EAAE,gBAAgB;IACrD,IAAI,SAAS,CAAA,GAAA,yCAAQ;IACrB,IAAI,kBAAkB,CAAA,GAAA,yCAAW,EAAE;IAEnC,OAAO;mBACL;QACA,WAAW,CAAA,GAAA,yCAAS,EAAE,UAAU,iBAAiB;YAC/C,GAAG,mBAAmB;YACtB,GAAG,SAAS;YACZ,iBAAiB,cAAc;YAC/B,gBAAgB,KAAK,CAAC,eAAe;YACrC,SAAS,CAAC;gBACR,WAAW,OAAO,GAAG;gBACrB,CAAA,GAAA,yCAAc,EAAE,GAAG,QAAQ,MAAM,IAAI,EAAE,MAAM,aAAa;YAC5D;QACF;IACF;AACF","sources":["packages/react-aria/src/link/useLink.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 {AriaLabelingProps, DOMAttributes, FocusableElement, FocusableProps, LinkDOMProps, PressEvents, RefObject} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {handleLinkClick, useLinkProps, useRouter} from '../utils/openLink';\nimport {mergeProps} from '../utils/mergeProps';\nimport React from 'react';\nimport {useFocusable} from '../interactions/useFocusable';\nimport {usePress} from '../interactions/usePress';\n\nexport interface LinkProps extends PressEvents, FocusableProps {}\n\nexport interface AriaLinkProps extends LinkProps, LinkDOMProps, AriaLabelingProps { }\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean,\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n * @default 'a'\n */\n elementType?: string\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: DOMAttributes,\n /** Whether the link is currently pressed. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<FocusableElement | null>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n onClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: DOMAttributes = {};\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({onPress, onPressStart, onPressEnd, onClick, isDisabled, ref});\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n let router = useRouter();\n let routerLinkProps = useLinkProps(props);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, routerLinkProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n 'aria-current': props['aria-current'],\n onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {\n pressProps.onClick?.(e);\n handleLinkClick(e, router, props.href, props.routerOptions);\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useLink.mjs.map"}
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA6CM,SAAS,0CAAQ,KAAsB,EAAE,GAAuC;IACrF,IAAI,eACF,cAAc,cACd,OAAO,gBACP,YAAY,cACZ,UAAU,WACV,OAAO,cACP,UAAU,EACV,GAAG,YACJ,GAAG;IAEJ,IAAI,YAA2B,CAAC;IAChC,IAAI,gBAAgB,KAClB,YAAY;QACV,MAAM;QACN,UAAU,CAAC,aAAa,IAAI;IAC9B;IAEF,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE,OAAO;IAC3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAO,EAAE;iBACrC;sBACA;oBACA;iBACA;oBACA;aACA;IACF;IACA,IAAI,WAAW,CAAA,GAAA,yCAAa,EAAE,YAAY;QAAC,WAAW;IAAI;IAC1D,IAAI,sBAAsB,CAAA,GAAA,yCAAS,EAAE,gBAAgB;IACrD,IAAI,SAAS,CAAA,GAAA,yCAAQ;IACrB,IAAI,kBAAkB,CAAA,GAAA,yCAAW,EAAE;IAEnC,OAAO;mBACL;QACA,WAAW,CAAA,GAAA,yCAAS,EAAE,UAAU,iBAAiB;YAC/C,GAAG,mBAAmB;YACtB,GAAG,SAAS;YACZ,iBAAiB,cAAc;YAC/B,gBAAgB,KAAK,CAAC,eAAe;YACrC,SAAS,CAAC;gBACR,WAAW,OAAO,GAAG;gBACrB,CAAA,GAAA,yCAAc,EAAE,GAAG,QAAQ,MAAM,IAAI,EAAE,MAAM,aAAa;YAC5D;QACF;IACF;AACF","sources":["packages/react-aria/src/link/useLink.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 {\n AriaLabelingProps,\n DOMAttributes,\n FocusableElement,\n FocusableProps,\n LinkDOMProps,\n PressEvents,\n RefObject\n} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {handleLinkClick, useLinkProps, useRouter} from '../utils/openLink';\nimport {mergeProps} from '../utils/mergeProps';\nimport React from 'react';\nimport {useFocusable} from '../interactions/useFocusable';\nimport {usePress} from '../interactions/usePress';\n\nexport interface LinkProps extends PressEvents, FocusableProps {}\n\nexport interface AriaLinkProps extends LinkProps, LinkDOMProps, AriaLabelingProps {}\n\nexport interface AriaLinkOptions extends AriaLinkProps {\n /** Whether the link is disabled. */\n isDisabled?: boolean;\n /**\n * The HTML element used to render the link, e.g. 'a', or 'span'.\n *\n * @default 'a'\n */\n elementType?: string;\n}\n\nexport interface LinkAria {\n /** Props for the link element. */\n linkProps: DOMAttributes;\n /** Whether the link is currently pressed. */\n isPressed: boolean;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a link component.\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport function useLink(props: AriaLinkOptions, ref: RefObject<FocusableElement | null>): LinkAria {\n let {\n elementType = 'a',\n onPress,\n onPressStart,\n onPressEnd,\n onClick,\n isDisabled,\n ...otherProps\n } = props;\n\n let linkProps: DOMAttributes = {};\n if (elementType !== 'a') {\n linkProps = {\n role: 'link',\n tabIndex: !isDisabled ? 0 : undefined\n };\n }\n let {focusableProps} = useFocusable(props, ref);\n let {pressProps, isPressed} = usePress({\n onPress,\n onPressStart,\n onPressEnd,\n onClick,\n isDisabled,\n ref\n });\n let domProps = filterDOMProps(otherProps, {labelable: true});\n let interactionHandlers = mergeProps(focusableProps, pressProps);\n let router = useRouter();\n let routerLinkProps = useLinkProps(props);\n\n return {\n isPressed, // Used to indicate press state for visual\n linkProps: mergeProps(domProps, routerLinkProps, {\n ...interactionHandlers,\n ...linkProps,\n 'aria-disabled': isDisabled || undefined,\n 'aria-current': props['aria-current'],\n onClick: (e: React.MouseEvent<HTMLAnchorElement>) => {\n pressProps.onClick?.(e);\n handleLinkClick(e, router, props.href, props.routerOptions);\n }\n })\n };\n}\n"],"names":[],"version":3,"file":"useLink.mjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAoGM,SAAS,0CAAc,KAA4B,EAAE,KAAmB,EAAE,GAAkC;IACjH,IAAI,WAAW,CAAA,GAAA,wCAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACrD,mFAAmF;IACnF,IAAI,oBAAoB,MAAM,iBAAiB,IAAI;IACnD,IAAI,cAAc,MAAM,WAAW,IAAI;IACvC,IAAI,eAAe,MAAM,YAAY,IAAK,CAAA,sBAAsB,YAAY,WAAW,UAAS;IAChG,IAAI,sBAAsB,YAAY,iBAAiB,UACrD,8FAA8F;IAC9F,8FAA8F;IAC9F,oCAAoC;IACpC,eAAe;IAGjB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE;QAClC,GAAG,KAAK;aACR;QACA,kBAAkB,MAAM,gBAAgB;QACxC,YAAY,MAAM,UAAU;QAC5B,cAAc,MAAM,YAAY;sBAChC;IACF;IAEA,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,wCAAa,EAAE;QACtC,eAAe,MAAM,OAAO;QAC5B,cAAc,MAAM,MAAM;QAC1B,qBAAqB,MAAM,aAAa;IAC1C;IAEA,mDAAmD;IACnD,IAAI,KAAK,CAAA,GAAA,+BAAI,EAAE,MAAM,EAAE;IACvB,CAAA,GAAA,kCAAO,EAAE,GAAG,CAAC,OAAO;YAClB;QACA,uBAAuB,MAAM,qBAAqB;QAClD,uBAAuB,MAAM,qBAAqB;QAClD,oBAAoB,MAAM,kBAAkB;QAC5C,eAAe,MAAM,aAAa;QAClC,UAAU,MAAM,QAAQ;sBACxB;QACA,aAAa;QACb,uBAAuB,KAAK,CAAC,wBAAwB;IACvD;IAEA,IAAI,cAAC,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,kCAAO,EAAE;QACtC,GAAG,KAAK;YACR;QACA,6CAA6C;QAC7C,6CAA6C;QAC7C,kBAAkB;IACpB;IAEA,OAAO;oBACL;QACA,cAAc,CAAA,GAAA,oCAAS,EAAE,UAAU,kBAAkB,MAAM,gBAAgB,CAAC,aAAa,KAAK,aAAa;YACzG,wBAAwB;QAC1B,IAAI,CAAC,GAAG;YACN,MAAM;YACN,oBAAoB;YACpB,GAAG,CAAA,GAAA,oCAAS,EAAE,YAAY,UAAU;QACtC;IACF;AACF","sources":["packages/react-aria/src/listbox/useListBox.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 {AriaLabelingProps, CollectionBase, DOMAttributes, DOMProps, FocusEvents, FocusStrategy, Key, KeyboardDelegate, LayoutDelegate, MultipleSelection, Orientation, RefObject, SelectionBehavior} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {listData} from './utils';\nimport {ListState} from 'react-stately/useListState';\nimport {mergeProps} from '../utils/mergeProps';\nimport {ReactNode} from 'react';\nimport {useFocusWithin} from '../interactions/useFocusWithin';\nimport {useId} from '../utils/useId';\nimport {useLabel} from '../label/useLabel';\nimport {useSelectableList} from '../selection/useSelectableList';\n\nexport interface ListBoxProps<T> extends CollectionBase<T>, MultipleSelection, FocusEvents {\n /** Whether to auto focus the listbox or an option. */\n autoFocus?: boolean | FocusStrategy,\n /** Whether focus should wrap around when the end/start is reached. */\n shouldFocusWrap?: boolean\n}\n\nexport interface AriaListBoxPropsBase<T> extends ListBoxProps<T>, DOMProps, AriaLabelingProps {\n /**\n * Whether pressing the escape key should clear selection in the listbox or not.\n *\n * Most experiences should not modify this option as it eliminates a keyboard user's ability to\n * easily clear selection. Only use if the escape key is being handled externally or should not\n * trigger selection clearing contextually.\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none'\n}\nexport interface AriaListBoxProps<T> extends AriaListBoxPropsBase<T> {\n /**\n * An optional visual label for the listbox.\n */\n label?: ReactNode,\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\n /** Whether options should be focused when the user hovers over them. */\n shouldFocusOnHover?: boolean,\n /**\n * Handler that is called when a user performs an action on an item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: (key: Key) => void\n}\n\nexport interface ListBoxAria {\n /** Props for the listbox element. */\n listBoxProps: DOMAttributes,\n /** Props for the listbox's visual label element (if any). */\n labelProps: DOMAttributes\n}\n\nexport interface AriaListBoxOptions<T> extends Omit<AriaListBoxProps<T>, 'children'> {\n /** Whether the listbox uses virtual scrolling. */\n isVirtualized?: boolean,\n\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n\n /**\n * A delegate object that provides layout information for items in the collection.\n * By default this uses the DOM, but this can be overridden to implement things like\n * virtualized scrolling.\n */\n layoutDelegate?: LayoutDelegate,\n\n /**\n * Whether the listbox items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean,\n\n /**\n * The behavior of links in the collection.\n * - 'action': link behaves like onAction.\n * - 'selection': link follows selection interactions (e.g. if URL drives selection).\n * - 'override': links override all other interactions (link items are not selectable).\n * @default 'override'\n */\n linkBehavior?: 'action' | 'selection' | 'override',\n\n /**\n * The primary orientation of the items. Usually this is the direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation\n}\n\n/**\n * Provides the behavior and accessibility implementation for a listbox component.\n * A listbox displays a list of options and allows a user to select one or more of them.\n * @param props - Props for the listbox.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useListBox<T>(props: AriaListBoxOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement | null>): ListBoxAria {\n let domProps = filterDOMProps(props, {labelable: true});\n // Use props instead of state here. We don't want this to change due to long press.\n let selectionBehavior = props.selectionBehavior || 'toggle';\n let orientation = props.orientation || 'vertical';\n let linkBehavior = props.linkBehavior || (selectionBehavior === 'replace' ? 'action' : 'override');\n if (selectionBehavior === 'toggle' && linkBehavior === 'action') {\n // linkBehavior=\"action\" does not work with selectionBehavior=\"toggle\" because there is no way\n // to initiate selection (checkboxes are not allowed inside a listbox). Link items will not be\n // selectable in this configuration.\n linkBehavior = 'override';\n }\n\n let {listProps} = useSelectableList({\n ...props,\n ref,\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n linkBehavior\n });\n\n let {focusWithinProps} = useFocusWithin({\n onFocusWithin: props.onFocus,\n onBlurWithin: props.onBlur,\n onFocusWithinChange: props.onFocusChange\n });\n\n // Share list id and some props with child options.\n let id = useId(props.id);\n listData.set(state, {\n id,\n shouldUseVirtualFocus: props.shouldUseVirtualFocus,\n shouldSelectOnPressUp: props.shouldSelectOnPressUp,\n shouldFocusOnHover: props.shouldFocusOnHover,\n isVirtualized: props.isVirtualized,\n onAction: props.onAction,\n linkBehavior,\n // @ts-ignore\n UNSTABLE_itemBehavior: props['UNSTABLE_itemBehavior']\n });\n\n let {labelProps, fieldProps} = useLabel({\n ...props,\n id,\n // listbox is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n return {\n labelProps,\n listBoxProps: mergeProps(domProps, focusWithinProps, state.selectionManager.selectionMode === 'multiple' ? {\n 'aria-multiselectable': 'true'\n } : {}, {\n role: 'listbox',\n 'aria-orientation': orientation,\n ...mergeProps(fieldProps, listProps)\n })\n };\n}\n"],"names":[],"version":3,"file":"useListBox.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuHM,SAAS,0CACd,KAA4B,EAC5B,KAAmB,EACnB,GAAkC;IAElC,IAAI,WAAW,CAAA,GAAA,wCAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACrD,mFAAmF;IACnF,IAAI,oBAAoB,MAAM,iBAAiB,IAAI;IACnD,IAAI,cAAc,MAAM,WAAW,IAAI;IACvC,IAAI,eACF,MAAM,YAAY,IAAK,CAAA,sBAAsB,YAAY,WAAW,UAAS;IAC/E,IAAI,sBAAsB,YAAY,iBAAiB,UACrD,8FAA8F;IAC9F,8FAA8F;IAC9F,oCAAoC;IACpC,eAAe;IAGjB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE;QAClC,GAAG,KAAK;aACR;QACA,kBAAkB,MAAM,gBAAgB;QACxC,YAAY,MAAM,UAAU;QAC5B,cAAc,MAAM,YAAY;sBAChC;IACF;IAEA,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,wCAAa,EAAE;QACtC,eAAe,MAAM,OAAO;QAC5B,cAAc,MAAM,MAAM;QAC1B,qBAAqB,MAAM,aAAa;IAC1C;IAEA,mDAAmD;IACnD,IAAI,KAAK,CAAA,GAAA,+BAAI,EAAE,MAAM,EAAE;IACvB,CAAA,GAAA,kCAAO,EAAE,GAAG,CAAC,OAAO;YAClB;QACA,uBAAuB,MAAM,qBAAqB;QAClD,uBAAuB,MAAM,qBAAqB;QAClD,oBAAoB,MAAM,kBAAkB;QAC5C,eAAe,MAAM,aAAa;QAClC,UAAU,MAAM,QAAQ;sBACxB;QACA,aAAa;QACb,uBAAuB,KAAK,CAAC,wBAAwB;IACvD;IAEA,IAAI,cAAC,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,kCAAO,EAAE;QACtC,GAAG,KAAK;YACR;QACA,6CAA6C;QAC7C,6CAA6C;QAC7C,kBAAkB;IACpB;IAEA,OAAO;oBACL;QACA,cAAc,CAAA,GAAA,oCAAS,EACrB,UACA,kBACA,MAAM,gBAAgB,CAAC,aAAa,KAAK,aACrC;YACE,wBAAwB;QAC1B,IACA,CAAC,GACL;YACE,MAAM;YACN,oBAAoB;YACpB,GAAG,CAAA,GAAA,oCAAS,EAAE,YAAY,UAAU;QACtC;IAEJ;AACF","sources":["packages/react-aria/src/listbox/useListBox.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 {\n AriaLabelingProps,\n CollectionBase,\n DOMAttributes,\n DOMProps,\n FocusEvents,\n FocusStrategy,\n Key,\n KeyboardDelegate,\n LayoutDelegate,\n MultipleSelection,\n Orientation,\n RefObject,\n SelectionBehavior\n} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {listData} from './utils';\nimport {ListState} from 'react-stately/useListState';\nimport {mergeProps} from '../utils/mergeProps';\nimport {ReactNode} from 'react';\nimport {useFocusWithin} from '../interactions/useFocusWithin';\nimport {useId} from '../utils/useId';\nimport {useLabel} from '../label/useLabel';\nimport {useSelectableList} from '../selection/useSelectableList';\n\nexport interface ListBoxProps<T> extends CollectionBase<T>, MultipleSelection, FocusEvents {\n /** Whether to auto focus the listbox or an option. */\n autoFocus?: boolean | FocusStrategy;\n /** Whether focus should wrap around when the end/start is reached. */\n shouldFocusWrap?: boolean;\n}\n\nexport interface AriaListBoxPropsBase<T> extends ListBoxProps<T>, DOMProps, AriaLabelingProps {\n /**\n * Whether pressing the escape key should clear selection in the listbox or not.\n *\n * Most experiences should not modify this option as it eliminates a keyboard user's ability to\n * easily clear selection. Only use if the escape key is being handled externally or should not\n * trigger selection clearing contextually.\n *\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none';\n}\nexport interface AriaListBoxProps<T> extends AriaListBoxPropsBase<T> {\n /**\n * An optional visual label for the listbox.\n */\n label?: ReactNode;\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior;\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean;\n /** Whether options should be focused when the user hovers over them. */\n shouldFocusOnHover?: boolean;\n /**\n * Handler that is called when a user performs an action on an item. The exact user event depends\n * on the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: (key: Key) => void;\n}\n\nexport interface ListBoxAria {\n /** Props for the listbox element. */\n listBoxProps: DOMAttributes;\n /** Props for the listbox's visual label element (if any). */\n labelProps: DOMAttributes;\n}\n\nexport interface AriaListBoxOptions<T> extends Omit<AriaListBoxProps<T>, 'children'> {\n /** Whether the listbox uses virtual scrolling. */\n isVirtualized?: boolean;\n\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate;\n\n /**\n * A delegate object that provides layout information for items in the collection.\n * By default this uses the DOM, but this can be overridden to implement things like\n * virtualized scrolling.\n */\n layoutDelegate?: LayoutDelegate;\n\n /**\n * Whether the listbox items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean;\n\n /**\n * The behavior of links in the collection.\n * - 'action': link behaves like onAction.\n * - 'selection': link follows selection interactions (e.g. if URL drives selection).\n * - 'override': links override all other interactions (link items are not selectable).\n *\n * @default 'override'\n */\n linkBehavior?: 'action' | 'selection' | 'override';\n\n /**\n * The primary orientation of the items. Usually this is the direction that the collection\n * scrolls.\n *\n * @default 'vertical'\n */\n orientation?: Orientation;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a listbox component.\n * A listbox displays a list of options and allows a user to select one or more of them.\n *\n * @param props - Props for the listbox.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useListBox<T>(\n props: AriaListBoxOptions<T>,\n state: ListState<T>,\n ref: RefObject<HTMLElement | null>\n): ListBoxAria {\n let domProps = filterDOMProps(props, {labelable: true});\n // Use props instead of state here. We don't want this to change due to long press.\n let selectionBehavior = props.selectionBehavior || 'toggle';\n let orientation = props.orientation || 'vertical';\n let linkBehavior =\n props.linkBehavior || (selectionBehavior === 'replace' ? 'action' : 'override');\n if (selectionBehavior === 'toggle' && linkBehavior === 'action') {\n // linkBehavior=\"action\" does not work with selectionBehavior=\"toggle\" because there is no way\n // to initiate selection (checkboxes are not allowed inside a listbox). Link items will not be\n // selectable in this configuration.\n linkBehavior = 'override';\n }\n\n let {listProps} = useSelectableList({\n ...props,\n ref,\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n linkBehavior\n });\n\n let {focusWithinProps} = useFocusWithin({\n onFocusWithin: props.onFocus,\n onBlurWithin: props.onBlur,\n onFocusWithinChange: props.onFocusChange\n });\n\n // Share list id and some props with child options.\n let id = useId(props.id);\n listData.set(state, {\n id,\n shouldUseVirtualFocus: props.shouldUseVirtualFocus,\n shouldSelectOnPressUp: props.shouldSelectOnPressUp,\n shouldFocusOnHover: props.shouldFocusOnHover,\n isVirtualized: props.isVirtualized,\n onAction: props.onAction,\n linkBehavior,\n // @ts-ignore\n UNSTABLE_itemBehavior: props['UNSTABLE_itemBehavior']\n });\n\n let {labelProps, fieldProps} = useLabel({\n ...props,\n id,\n // listbox is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n return {\n labelProps,\n listBoxProps: mergeProps(\n domProps,\n focusWithinProps,\n state.selectionManager.selectionMode === 'multiple'\n ? {\n 'aria-multiselectable': 'true'\n }\n : {},\n {\n role: 'listbox',\n 'aria-orientation': orientation,\n ...mergeProps(fieldProps, listProps)\n }\n )\n };\n}\n"],"names":[],"version":3,"file":"useListBox.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAoGM,SAAS,0CAAc,KAA4B,EAAE,KAAmB,EAAE,GAAkC;IACjH,IAAI,WAAW,CAAA,GAAA,yCAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACrD,mFAAmF;IACnF,IAAI,oBAAoB,MAAM,iBAAiB,IAAI;IACnD,IAAI,cAAc,MAAM,WAAW,IAAI;IACvC,IAAI,eAAe,MAAM,YAAY,IAAK,CAAA,sBAAsB,YAAY,WAAW,UAAS;IAChG,IAAI,sBAAsB,YAAY,iBAAiB,UACrD,8FAA8F;IAC9F,8FAA8F;IAC9F,oCAAoC;IACpC,eAAe;IAGjB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE;QAClC,GAAG,KAAK;aACR;QACA,kBAAkB,MAAM,gBAAgB;QACxC,YAAY,MAAM,UAAU;QAC5B,cAAc,MAAM,YAAY;sBAChC;IACF;IAEA,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,yCAAa,EAAE;QACtC,eAAe,MAAM,OAAO;QAC5B,cAAc,MAAM,MAAM;QAC1B,qBAAqB,MAAM,aAAa;IAC1C;IAEA,mDAAmD;IACnD,IAAI,KAAK,CAAA,GAAA,yCAAI,EAAE,MAAM,EAAE;IACvB,CAAA,GAAA,yCAAO,EAAE,GAAG,CAAC,OAAO;YAClB;QACA,uBAAuB,MAAM,qBAAqB;QAClD,uBAAuB,MAAM,qBAAqB;QAClD,oBAAoB,MAAM,kBAAkB;QAC5C,eAAe,MAAM,aAAa;QAClC,UAAU,MAAM,QAAQ;sBACxB;QACA,aAAa;QACb,uBAAuB,KAAK,CAAC,wBAAwB;IACvD;IAEA,IAAI,cAAC,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAO,EAAE;QACtC,GAAG,KAAK;YACR;QACA,6CAA6C;QAC7C,6CAA6C;QAC7C,kBAAkB;IACpB;IAEA,OAAO;oBACL;QACA,cAAc,CAAA,GAAA,yCAAS,EAAE,UAAU,kBAAkB,MAAM,gBAAgB,CAAC,aAAa,KAAK,aAAa;YACzG,wBAAwB;QAC1B,IAAI,CAAC,GAAG;YACN,MAAM;YACN,oBAAoB;YACpB,GAAG,CAAA,GAAA,yCAAS,EAAE,YAAY,UAAU;QACtC;IACF;AACF","sources":["packages/react-aria/src/listbox/useListBox.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 {AriaLabelingProps, CollectionBase, DOMAttributes, DOMProps, FocusEvents, FocusStrategy, Key, KeyboardDelegate, LayoutDelegate, MultipleSelection, Orientation, RefObject, SelectionBehavior} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {listData} from './utils';\nimport {ListState} from 'react-stately/useListState';\nimport {mergeProps} from '../utils/mergeProps';\nimport {ReactNode} from 'react';\nimport {useFocusWithin} from '../interactions/useFocusWithin';\nimport {useId} from '../utils/useId';\nimport {useLabel} from '../label/useLabel';\nimport {useSelectableList} from '../selection/useSelectableList';\n\nexport interface ListBoxProps<T> extends CollectionBase<T>, MultipleSelection, FocusEvents {\n /** Whether to auto focus the listbox or an option. */\n autoFocus?: boolean | FocusStrategy,\n /** Whether focus should wrap around when the end/start is reached. */\n shouldFocusWrap?: boolean\n}\n\nexport interface AriaListBoxPropsBase<T> extends ListBoxProps<T>, DOMProps, AriaLabelingProps {\n /**\n * Whether pressing the escape key should clear selection in the listbox or not.\n *\n * Most experiences should not modify this option as it eliminates a keyboard user's ability to\n * easily clear selection. Only use if the escape key is being handled externally or should not\n * trigger selection clearing contextually.\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none'\n}\nexport interface AriaListBoxProps<T> extends AriaListBoxPropsBase<T> {\n /**\n * An optional visual label for the listbox.\n */\n label?: ReactNode,\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\n /** Whether options should be focused when the user hovers over them. */\n shouldFocusOnHover?: boolean,\n /**\n * Handler that is called when a user performs an action on an item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: (key: Key) => void\n}\n\nexport interface ListBoxAria {\n /** Props for the listbox element. */\n listBoxProps: DOMAttributes,\n /** Props for the listbox's visual label element (if any). */\n labelProps: DOMAttributes\n}\n\nexport interface AriaListBoxOptions<T> extends Omit<AriaListBoxProps<T>, 'children'> {\n /** Whether the listbox uses virtual scrolling. */\n isVirtualized?: boolean,\n\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n\n /**\n * A delegate object that provides layout information for items in the collection.\n * By default this uses the DOM, but this can be overridden to implement things like\n * virtualized scrolling.\n */\n layoutDelegate?: LayoutDelegate,\n\n /**\n * Whether the listbox items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean,\n\n /**\n * The behavior of links in the collection.\n * - 'action': link behaves like onAction.\n * - 'selection': link follows selection interactions (e.g. if URL drives selection).\n * - 'override': links override all other interactions (link items are not selectable).\n * @default 'override'\n */\n linkBehavior?: 'action' | 'selection' | 'override',\n\n /**\n * The primary orientation of the items. Usually this is the direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation\n}\n\n/**\n * Provides the behavior and accessibility implementation for a listbox component.\n * A listbox displays a list of options and allows a user to select one or more of them.\n * @param props - Props for the listbox.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useListBox<T>(props: AriaListBoxOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement | null>): ListBoxAria {\n let domProps = filterDOMProps(props, {labelable: true});\n // Use props instead of state here. We don't want this to change due to long press.\n let selectionBehavior = props.selectionBehavior || 'toggle';\n let orientation = props.orientation || 'vertical';\n let linkBehavior = props.linkBehavior || (selectionBehavior === 'replace' ? 'action' : 'override');\n if (selectionBehavior === 'toggle' && linkBehavior === 'action') {\n // linkBehavior=\"action\" does not work with selectionBehavior=\"toggle\" because there is no way\n // to initiate selection (checkboxes are not allowed inside a listbox). Link items will not be\n // selectable in this configuration.\n linkBehavior = 'override';\n }\n\n let {listProps} = useSelectableList({\n ...props,\n ref,\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n linkBehavior\n });\n\n let {focusWithinProps} = useFocusWithin({\n onFocusWithin: props.onFocus,\n onBlurWithin: props.onBlur,\n onFocusWithinChange: props.onFocusChange\n });\n\n // Share list id and some props with child options.\n let id = useId(props.id);\n listData.set(state, {\n id,\n shouldUseVirtualFocus: props.shouldUseVirtualFocus,\n shouldSelectOnPressUp: props.shouldSelectOnPressUp,\n shouldFocusOnHover: props.shouldFocusOnHover,\n isVirtualized: props.isVirtualized,\n onAction: props.onAction,\n linkBehavior,\n // @ts-ignore\n UNSTABLE_itemBehavior: props['UNSTABLE_itemBehavior']\n });\n\n let {labelProps, fieldProps} = useLabel({\n ...props,\n id,\n // listbox is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n return {\n labelProps,\n listBoxProps: mergeProps(domProps, focusWithinProps, state.selectionManager.selectionMode === 'multiple' ? {\n 'aria-multiselectable': 'true'\n } : {}, {\n role: 'listbox',\n 'aria-orientation': orientation,\n ...mergeProps(fieldProps, listProps)\n })\n };\n}\n"],"names":[],"version":3,"file":"useListBox.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuHM,SAAS,0CACd,KAA4B,EAC5B,KAAmB,EACnB,GAAkC;IAElC,IAAI,WAAW,CAAA,GAAA,yCAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACrD,mFAAmF;IACnF,IAAI,oBAAoB,MAAM,iBAAiB,IAAI;IACnD,IAAI,cAAc,MAAM,WAAW,IAAI;IACvC,IAAI,eACF,MAAM,YAAY,IAAK,CAAA,sBAAsB,YAAY,WAAW,UAAS;IAC/E,IAAI,sBAAsB,YAAY,iBAAiB,UACrD,8FAA8F;IAC9F,8FAA8F;IAC9F,oCAAoC;IACpC,eAAe;IAGjB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE;QAClC,GAAG,KAAK;aACR;QACA,kBAAkB,MAAM,gBAAgB;QACxC,YAAY,MAAM,UAAU;QAC5B,cAAc,MAAM,YAAY;sBAChC;IACF;IAEA,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,yCAAa,EAAE;QACtC,eAAe,MAAM,OAAO;QAC5B,cAAc,MAAM,MAAM;QAC1B,qBAAqB,MAAM,aAAa;IAC1C;IAEA,mDAAmD;IACnD,IAAI,KAAK,CAAA,GAAA,yCAAI,EAAE,MAAM,EAAE;IACvB,CAAA,GAAA,yCAAO,EAAE,GAAG,CAAC,OAAO;YAClB;QACA,uBAAuB,MAAM,qBAAqB;QAClD,uBAAuB,MAAM,qBAAqB;QAClD,oBAAoB,MAAM,kBAAkB;QAC5C,eAAe,MAAM,aAAa;QAClC,UAAU,MAAM,QAAQ;sBACxB;QACA,aAAa;QACb,uBAAuB,KAAK,CAAC,wBAAwB;IACvD;IAEA,IAAI,cAAC,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAO,EAAE;QACtC,GAAG,KAAK;YACR;QACA,6CAA6C;QAC7C,6CAA6C;QAC7C,kBAAkB;IACpB;IAEA,OAAO;oBACL;QACA,cAAc,CAAA,GAAA,yCAAS,EACrB,UACA,kBACA,MAAM,gBAAgB,CAAC,aAAa,KAAK,aACrC;YACE,wBAAwB;QAC1B,IACA,CAAC,GACL;YACE,MAAM;YACN,oBAAoB;YACpB,GAAG,CAAA,GAAA,yCAAS,EAAE,YAAY,UAAU;QACtC;IAEJ;AACF","sources":["packages/react-aria/src/listbox/useListBox.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 {\n AriaLabelingProps,\n CollectionBase,\n DOMAttributes,\n DOMProps,\n FocusEvents,\n FocusStrategy,\n Key,\n KeyboardDelegate,\n LayoutDelegate,\n MultipleSelection,\n Orientation,\n RefObject,\n SelectionBehavior\n} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {listData} from './utils';\nimport {ListState} from 'react-stately/useListState';\nimport {mergeProps} from '../utils/mergeProps';\nimport {ReactNode} from 'react';\nimport {useFocusWithin} from '../interactions/useFocusWithin';\nimport {useId} from '../utils/useId';\nimport {useLabel} from '../label/useLabel';\nimport {useSelectableList} from '../selection/useSelectableList';\n\nexport interface ListBoxProps<T> extends CollectionBase<T>, MultipleSelection, FocusEvents {\n /** Whether to auto focus the listbox or an option. */\n autoFocus?: boolean | FocusStrategy;\n /** Whether focus should wrap around when the end/start is reached. */\n shouldFocusWrap?: boolean;\n}\n\nexport interface AriaListBoxPropsBase<T> extends ListBoxProps<T>, DOMProps, AriaLabelingProps {\n /**\n * Whether pressing the escape key should clear selection in the listbox or not.\n *\n * Most experiences should not modify this option as it eliminates a keyboard user's ability to\n * easily clear selection. Only use if the escape key is being handled externally or should not\n * trigger selection clearing contextually.\n *\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none';\n}\nexport interface AriaListBoxProps<T> extends AriaListBoxPropsBase<T> {\n /**\n * An optional visual label for the listbox.\n */\n label?: ReactNode;\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior;\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean;\n /** Whether options should be focused when the user hovers over them. */\n shouldFocusOnHover?: boolean;\n /**\n * Handler that is called when a user performs an action on an item. The exact user event depends\n * on the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: (key: Key) => void;\n}\n\nexport interface ListBoxAria {\n /** Props for the listbox element. */\n listBoxProps: DOMAttributes;\n /** Props for the listbox's visual label element (if any). */\n labelProps: DOMAttributes;\n}\n\nexport interface AriaListBoxOptions<T> extends Omit<AriaListBoxProps<T>, 'children'> {\n /** Whether the listbox uses virtual scrolling. */\n isVirtualized?: boolean;\n\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate;\n\n /**\n * A delegate object that provides layout information for items in the collection.\n * By default this uses the DOM, but this can be overridden to implement things like\n * virtualized scrolling.\n */\n layoutDelegate?: LayoutDelegate;\n\n /**\n * Whether the listbox items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean;\n\n /**\n * The behavior of links in the collection.\n * - 'action': link behaves like onAction.\n * - 'selection': link follows selection interactions (e.g. if URL drives selection).\n * - 'override': links override all other interactions (link items are not selectable).\n *\n * @default 'override'\n */\n linkBehavior?: 'action' | 'selection' | 'override';\n\n /**\n * The primary orientation of the items. Usually this is the direction that the collection\n * scrolls.\n *\n * @default 'vertical'\n */\n orientation?: Orientation;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a listbox component.\n * A listbox displays a list of options and allows a user to select one or more of them.\n *\n * @param props - Props for the listbox.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useListBox<T>(\n props: AriaListBoxOptions<T>,\n state: ListState<T>,\n ref: RefObject<HTMLElement | null>\n): ListBoxAria {\n let domProps = filterDOMProps(props, {labelable: true});\n // Use props instead of state here. We don't want this to change due to long press.\n let selectionBehavior = props.selectionBehavior || 'toggle';\n let orientation = props.orientation || 'vertical';\n let linkBehavior =\n props.linkBehavior || (selectionBehavior === 'replace' ? 'action' : 'override');\n if (selectionBehavior === 'toggle' && linkBehavior === 'action') {\n // linkBehavior=\"action\" does not work with selectionBehavior=\"toggle\" because there is no way\n // to initiate selection (checkboxes are not allowed inside a listbox). Link items will not be\n // selectable in this configuration.\n linkBehavior = 'override';\n }\n\n let {listProps} = useSelectableList({\n ...props,\n ref,\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n linkBehavior\n });\n\n let {focusWithinProps} = useFocusWithin({\n onFocusWithin: props.onFocus,\n onBlurWithin: props.onBlur,\n onFocusWithinChange: props.onFocusChange\n });\n\n // Share list id and some props with child options.\n let id = useId(props.id);\n listData.set(state, {\n id,\n shouldUseVirtualFocus: props.shouldUseVirtualFocus,\n shouldSelectOnPressUp: props.shouldSelectOnPressUp,\n shouldFocusOnHover: props.shouldFocusOnHover,\n isVirtualized: props.isVirtualized,\n onAction: props.onAction,\n linkBehavior,\n // @ts-ignore\n UNSTABLE_itemBehavior: props['UNSTABLE_itemBehavior']\n });\n\n let {labelProps, fieldProps} = useLabel({\n ...props,\n id,\n // listbox is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n return {\n labelProps,\n listBoxProps: mergeProps(\n domProps,\n focusWithinProps,\n state.selectionManager.selectionMode === 'multiple'\n ? {\n 'aria-multiselectable': 'true'\n }\n : {},\n {\n role: 'listbox',\n 'aria-orientation': orientation,\n ...mergeProps(fieldProps, listProps)\n }\n )\n };\n}\n"],"names":[],"version":3,"file":"useListBox.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAoGM,SAAS,0CAAc,KAA4B,EAAE,KAAmB,EAAE,GAAkC;IACjH,IAAI,WAAW,CAAA,GAAA,yCAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACrD,mFAAmF;IACnF,IAAI,oBAAoB,MAAM,iBAAiB,IAAI;IACnD,IAAI,cAAc,MAAM,WAAW,IAAI;IACvC,IAAI,eAAe,MAAM,YAAY,IAAK,CAAA,sBAAsB,YAAY,WAAW,UAAS;IAChG,IAAI,sBAAsB,YAAY,iBAAiB,UACrD,8FAA8F;IAC9F,8FAA8F;IAC9F,oCAAoC;IACpC,eAAe;IAGjB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE;QAClC,GAAG,KAAK;aACR;QACA,kBAAkB,MAAM,gBAAgB;QACxC,YAAY,MAAM,UAAU;QAC5B,cAAc,MAAM,YAAY;sBAChC;IACF;IAEA,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,yCAAa,EAAE;QACtC,eAAe,MAAM,OAAO;QAC5B,cAAc,MAAM,MAAM;QAC1B,qBAAqB,MAAM,aAAa;IAC1C;IAEA,mDAAmD;IACnD,IAAI,KAAK,CAAA,GAAA,yCAAI,EAAE,MAAM,EAAE;IACvB,CAAA,GAAA,yCAAO,EAAE,GAAG,CAAC,OAAO;YAClB;QACA,uBAAuB,MAAM,qBAAqB;QAClD,uBAAuB,MAAM,qBAAqB;QAClD,oBAAoB,MAAM,kBAAkB;QAC5C,eAAe,MAAM,aAAa;QAClC,UAAU,MAAM,QAAQ;sBACxB;QACA,aAAa;QACb,uBAAuB,KAAK,CAAC,wBAAwB;IACvD;IAEA,IAAI,cAAC,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAO,EAAE;QACtC,GAAG,KAAK;YACR;QACA,6CAA6C;QAC7C,6CAA6C;QAC7C,kBAAkB;IACpB;IAEA,OAAO;oBACL;QACA,cAAc,CAAA,GAAA,yCAAS,EAAE,UAAU,kBAAkB,MAAM,gBAAgB,CAAC,aAAa,KAAK,aAAa;YACzG,wBAAwB;QAC1B,IAAI,CAAC,GAAG;YACN,MAAM;YACN,oBAAoB;YACpB,GAAG,CAAA,GAAA,yCAAS,EAAE,YAAY,UAAU;QACtC;IACF;AACF","sources":["packages/react-aria/src/listbox/useListBox.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 {AriaLabelingProps, CollectionBase, DOMAttributes, DOMProps, FocusEvents, FocusStrategy, Key, KeyboardDelegate, LayoutDelegate, MultipleSelection, Orientation, RefObject, SelectionBehavior} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {listData} from './utils';\nimport {ListState} from 'react-stately/useListState';\nimport {mergeProps} from '../utils/mergeProps';\nimport {ReactNode} from 'react';\nimport {useFocusWithin} from '../interactions/useFocusWithin';\nimport {useId} from '../utils/useId';\nimport {useLabel} from '../label/useLabel';\nimport {useSelectableList} from '../selection/useSelectableList';\n\nexport interface ListBoxProps<T> extends CollectionBase<T>, MultipleSelection, FocusEvents {\n /** Whether to auto focus the listbox or an option. */\n autoFocus?: boolean | FocusStrategy,\n /** Whether focus should wrap around when the end/start is reached. */\n shouldFocusWrap?: boolean\n}\n\nexport interface AriaListBoxPropsBase<T> extends ListBoxProps<T>, DOMProps, AriaLabelingProps {\n /**\n * Whether pressing the escape key should clear selection in the listbox or not.\n *\n * Most experiences should not modify this option as it eliminates a keyboard user's ability to\n * easily clear selection. Only use if the escape key is being handled externally or should not\n * trigger selection clearing contextually.\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none'\n}\nexport interface AriaListBoxProps<T> extends AriaListBoxPropsBase<T> {\n /**\n * An optional visual label for the listbox.\n */\n label?: ReactNode,\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\n /** Whether options should be focused when the user hovers over them. */\n shouldFocusOnHover?: boolean,\n /**\n * Handler that is called when a user performs an action on an item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: (key: Key) => void\n}\n\nexport interface ListBoxAria {\n /** Props for the listbox element. */\n listBoxProps: DOMAttributes,\n /** Props for the listbox's visual label element (if any). */\n labelProps: DOMAttributes\n}\n\nexport interface AriaListBoxOptions<T> extends Omit<AriaListBoxProps<T>, 'children'> {\n /** Whether the listbox uses virtual scrolling. */\n isVirtualized?: boolean,\n\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n\n /**\n * A delegate object that provides layout information for items in the collection.\n * By default this uses the DOM, but this can be overridden to implement things like\n * virtualized scrolling.\n */\n layoutDelegate?: LayoutDelegate,\n\n /**\n * Whether the listbox items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean,\n\n /**\n * The behavior of links in the collection.\n * - 'action': link behaves like onAction.\n * - 'selection': link follows selection interactions (e.g. if URL drives selection).\n * - 'override': links override all other interactions (link items are not selectable).\n * @default 'override'\n */\n linkBehavior?: 'action' | 'selection' | 'override',\n\n /**\n * The primary orientation of the items. Usually this is the direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation\n}\n\n/**\n * Provides the behavior and accessibility implementation for a listbox component.\n * A listbox displays a list of options and allows a user to select one or more of them.\n * @param props - Props for the listbox.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useListBox<T>(props: AriaListBoxOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement | null>): ListBoxAria {\n let domProps = filterDOMProps(props, {labelable: true});\n // Use props instead of state here. We don't want this to change due to long press.\n let selectionBehavior = props.selectionBehavior || 'toggle';\n let orientation = props.orientation || 'vertical';\n let linkBehavior = props.linkBehavior || (selectionBehavior === 'replace' ? 'action' : 'override');\n if (selectionBehavior === 'toggle' && linkBehavior === 'action') {\n // linkBehavior=\"action\" does not work with selectionBehavior=\"toggle\" because there is no way\n // to initiate selection (checkboxes are not allowed inside a listbox). Link items will not be\n // selectable in this configuration.\n linkBehavior = 'override';\n }\n\n let {listProps} = useSelectableList({\n ...props,\n ref,\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n linkBehavior\n });\n\n let {focusWithinProps} = useFocusWithin({\n onFocusWithin: props.onFocus,\n onBlurWithin: props.onBlur,\n onFocusWithinChange: props.onFocusChange\n });\n\n // Share list id and some props with child options.\n let id = useId(props.id);\n listData.set(state, {\n id,\n shouldUseVirtualFocus: props.shouldUseVirtualFocus,\n shouldSelectOnPressUp: props.shouldSelectOnPressUp,\n shouldFocusOnHover: props.shouldFocusOnHover,\n isVirtualized: props.isVirtualized,\n onAction: props.onAction,\n linkBehavior,\n // @ts-ignore\n UNSTABLE_itemBehavior: props['UNSTABLE_itemBehavior']\n });\n\n let {labelProps, fieldProps} = useLabel({\n ...props,\n id,\n // listbox is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n return {\n labelProps,\n listBoxProps: mergeProps(domProps, focusWithinProps, state.selectionManager.selectionMode === 'multiple' ? {\n 'aria-multiselectable': 'true'\n } : {}, {\n role: 'listbox',\n 'aria-orientation': orientation,\n ...mergeProps(fieldProps, listProps)\n })\n };\n}\n"],"names":[],"version":3,"file":"useListBox.mjs.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuHM,SAAS,0CACd,KAA4B,EAC5B,KAAmB,EACnB,GAAkC;IAElC,IAAI,WAAW,CAAA,GAAA,yCAAa,EAAE,OAAO;QAAC,WAAW;IAAI;IACrD,mFAAmF;IACnF,IAAI,oBAAoB,MAAM,iBAAiB,IAAI;IACnD,IAAI,cAAc,MAAM,WAAW,IAAI;IACvC,IAAI,eACF,MAAM,YAAY,IAAK,CAAA,sBAAsB,YAAY,WAAW,UAAS;IAC/E,IAAI,sBAAsB,YAAY,iBAAiB,UACrD,8FAA8F;IAC9F,8FAA8F;IAC9F,oCAAoC;IACpC,eAAe;IAGjB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE;QAClC,GAAG,KAAK;aACR;QACA,kBAAkB,MAAM,gBAAgB;QACxC,YAAY,MAAM,UAAU;QAC5B,cAAc,MAAM,YAAY;sBAChC;IACF;IAEA,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,yCAAa,EAAE;QACtC,eAAe,MAAM,OAAO;QAC5B,cAAc,MAAM,MAAM;QAC1B,qBAAqB,MAAM,aAAa;IAC1C;IAEA,mDAAmD;IACnD,IAAI,KAAK,CAAA,GAAA,yCAAI,EAAE,MAAM,EAAE;IACvB,CAAA,GAAA,yCAAO,EAAE,GAAG,CAAC,OAAO;YAClB;QACA,uBAAuB,MAAM,qBAAqB;QAClD,uBAAuB,MAAM,qBAAqB;QAClD,oBAAoB,MAAM,kBAAkB;QAC5C,eAAe,MAAM,aAAa;QAClC,UAAU,MAAM,QAAQ;sBACxB;QACA,aAAa;QACb,uBAAuB,KAAK,CAAC,wBAAwB;IACvD;IAEA,IAAI,cAAC,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAO,EAAE;QACtC,GAAG,KAAK;YACR;QACA,6CAA6C;QAC7C,6CAA6C;QAC7C,kBAAkB;IACpB;IAEA,OAAO;oBACL;QACA,cAAc,CAAA,GAAA,yCAAS,EACrB,UACA,kBACA,MAAM,gBAAgB,CAAC,aAAa,KAAK,aACrC;YACE,wBAAwB;QAC1B,IACA,CAAC,GACL;YACE,MAAM;YACN,oBAAoB;YACpB,GAAG,CAAA,GAAA,yCAAS,EAAE,YAAY,UAAU;QACtC;IAEJ;AACF","sources":["packages/react-aria/src/listbox/useListBox.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 {\n AriaLabelingProps,\n CollectionBase,\n DOMAttributes,\n DOMProps,\n FocusEvents,\n FocusStrategy,\n Key,\n KeyboardDelegate,\n LayoutDelegate,\n MultipleSelection,\n Orientation,\n RefObject,\n SelectionBehavior\n} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport {listData} from './utils';\nimport {ListState} from 'react-stately/useListState';\nimport {mergeProps} from '../utils/mergeProps';\nimport {ReactNode} from 'react';\nimport {useFocusWithin} from '../interactions/useFocusWithin';\nimport {useId} from '../utils/useId';\nimport {useLabel} from '../label/useLabel';\nimport {useSelectableList} from '../selection/useSelectableList';\n\nexport interface ListBoxProps<T> extends CollectionBase<T>, MultipleSelection, FocusEvents {\n /** Whether to auto focus the listbox or an option. */\n autoFocus?: boolean | FocusStrategy;\n /** Whether focus should wrap around when the end/start is reached. */\n shouldFocusWrap?: boolean;\n}\n\nexport interface AriaListBoxPropsBase<T> extends ListBoxProps<T>, DOMProps, AriaLabelingProps {\n /**\n * Whether pressing the escape key should clear selection in the listbox or not.\n *\n * Most experiences should not modify this option as it eliminates a keyboard user's ability to\n * easily clear selection. Only use if the escape key is being handled externally or should not\n * trigger selection clearing contextually.\n *\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none';\n}\nexport interface AriaListBoxProps<T> extends AriaListBoxPropsBase<T> {\n /**\n * An optional visual label for the listbox.\n */\n label?: ReactNode;\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior;\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean;\n /** Whether options should be focused when the user hovers over them. */\n shouldFocusOnHover?: boolean;\n /**\n * Handler that is called when a user performs an action on an item. The exact user event depends\n * on the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: (key: Key) => void;\n}\n\nexport interface ListBoxAria {\n /** Props for the listbox element. */\n listBoxProps: DOMAttributes;\n /** Props for the listbox's visual label element (if any). */\n labelProps: DOMAttributes;\n}\n\nexport interface AriaListBoxOptions<T> extends Omit<AriaListBoxProps<T>, 'children'> {\n /** Whether the listbox uses virtual scrolling. */\n isVirtualized?: boolean;\n\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate;\n\n /**\n * A delegate object that provides layout information for items in the collection.\n * By default this uses the DOM, but this can be overridden to implement things like\n * virtualized scrolling.\n */\n layoutDelegate?: LayoutDelegate;\n\n /**\n * Whether the listbox items should use virtual focus instead of being focused directly.\n */\n shouldUseVirtualFocus?: boolean;\n\n /**\n * The behavior of links in the collection.\n * - 'action': link behaves like onAction.\n * - 'selection': link follows selection interactions (e.g. if URL drives selection).\n * - 'override': links override all other interactions (link items are not selectable).\n *\n * @default 'override'\n */\n linkBehavior?: 'action' | 'selection' | 'override';\n\n /**\n * The primary orientation of the items. Usually this is the direction that the collection\n * scrolls.\n *\n * @default 'vertical'\n */\n orientation?: Orientation;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a listbox component.\n * A listbox displays a list of options and allows a user to select one or more of them.\n *\n * @param props - Props for the listbox.\n * @param state - State for the listbox, as returned by `useListState`.\n */\nexport function useListBox<T>(\n props: AriaListBoxOptions<T>,\n state: ListState<T>,\n ref: RefObject<HTMLElement | null>\n): ListBoxAria {\n let domProps = filterDOMProps(props, {labelable: true});\n // Use props instead of state here. We don't want this to change due to long press.\n let selectionBehavior = props.selectionBehavior || 'toggle';\n let orientation = props.orientation || 'vertical';\n let linkBehavior =\n props.linkBehavior || (selectionBehavior === 'replace' ? 'action' : 'override');\n if (selectionBehavior === 'toggle' && linkBehavior === 'action') {\n // linkBehavior=\"action\" does not work with selectionBehavior=\"toggle\" because there is no way\n // to initiate selection (checkboxes are not allowed inside a listbox). Link items will not be\n // selectable in this configuration.\n linkBehavior = 'override';\n }\n\n let {listProps} = useSelectableList({\n ...props,\n ref,\n selectionManager: state.selectionManager,\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n linkBehavior\n });\n\n let {focusWithinProps} = useFocusWithin({\n onFocusWithin: props.onFocus,\n onBlurWithin: props.onBlur,\n onFocusWithinChange: props.onFocusChange\n });\n\n // Share list id and some props with child options.\n let id = useId(props.id);\n listData.set(state, {\n id,\n shouldUseVirtualFocus: props.shouldUseVirtualFocus,\n shouldSelectOnPressUp: props.shouldSelectOnPressUp,\n shouldFocusOnHover: props.shouldFocusOnHover,\n isVirtualized: props.isVirtualized,\n onAction: props.onAction,\n linkBehavior,\n // @ts-ignore\n UNSTABLE_itemBehavior: props['UNSTABLE_itemBehavior']\n });\n\n let {labelProps, fieldProps} = useLabel({\n ...props,\n id,\n // listbox is not an HTML input element so it\n // shouldn't be labeled by a <label> element.\n labelElementType: 'span'\n });\n\n return {\n labelProps,\n listBoxProps: mergeProps(\n domProps,\n focusWithinProps,\n state.selectionManager.selectionMode === 'multiple'\n ? {\n 'aria-multiselectable': 'true'\n }\n : {},\n {\n role: 'listbox',\n 'aria-orientation': orientation,\n ...mergeProps(fieldProps, listProps)\n }\n )\n };\n}\n"],"names":[],"version":3,"file":"useListBox.mjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AA6BM,SAAS,yCAAkB,KAA8B;IAC9D,IAAI,WAAC,OAAO,EAAE,cAAc,SAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,+BAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UAAU;YACtB,kEAAkE;YAClE,4EAA4E;YAC5E,0DAA0D;YAC1D,IAAI;YACJ,MAAM;YACN,aAAa,CAAC;gBACZ,uEAAuE;gBACvE,EAAE,cAAc;YAClB;QACF,IAAI,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF","sources":["packages/react-aria/src/listbox/useListBoxSection.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 {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '../utils/useId';\n\nexport interface AriaListBoxSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface ListBoxSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Technically, listbox cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a visual label for the nested group.\n id: headingId,\n role: 'presentation',\n onMouseDown: (e) => {\n // Prevent DOM focus from moving on mouse down when using virtual focus\n e.preventDefault();\n }\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useListBoxSection.cjs.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AA8BM,SAAS,yCAAkB,KAA8B;IAC9D,IAAI,WAAC,OAAO,EAAE,cAAc,SAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,+BAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UACV;YACE,kEAAkE;YAClE,4EAA4E;YAC5E,0DAA0D;YAC1D,IAAI;YACJ,MAAM;YACN,aAAa,CAAA;gBACX,uEAAuE;gBACvE,EAAE,cAAc;YAClB;QACF,IACA,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF","sources":["packages/react-aria/src/listbox/useListBoxSection.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 {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '../utils/useId';\n\nexport interface AriaListBoxSectionProps {\n /** The heading for the section. */\n heading?: ReactNode;\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string;\n}\n\nexport interface ListBoxSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes;\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes;\n\n /** Props for the group element. */\n groupProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n *\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading\n ? {\n // Technically, listbox cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a visual label for the nested group.\n id: headingId,\n role: 'presentation',\n onMouseDown: e => {\n // Prevent DOM focus from moving on mouse down when using virtual focus\n e.preventDefault();\n }\n }\n : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useListBoxSection.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AA6BM,SAAS,yCAAkB,KAA8B;IAC9D,IAAI,WAAC,OAAO,EAAE,cAAc,SAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,yCAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UAAU;YACtB,kEAAkE;YAClE,4EAA4E;YAC5E,0DAA0D;YAC1D,IAAI;YACJ,MAAM;YACN,aAAa,CAAC;gBACZ,uEAAuE;gBACvE,EAAE,cAAc;YAClB;QACF,IAAI,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF","sources":["packages/react-aria/src/listbox/useListBoxSection.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 {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '../utils/useId';\n\nexport interface AriaListBoxSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface ListBoxSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Technically, listbox cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a visual label for the nested group.\n id: headingId,\n role: 'presentation',\n onMouseDown: (e) => {\n // Prevent DOM focus from moving on mouse down when using virtual focus\n e.preventDefault();\n }\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useListBoxSection.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AA8BM,SAAS,yCAAkB,KAA8B;IAC9D,IAAI,WAAC,OAAO,EAAE,cAAc,SAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,yCAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UACV;YACE,kEAAkE;YAClE,4EAA4E;YAC5E,0DAA0D;YAC1D,IAAI;YACJ,MAAM;YACN,aAAa,CAAA;gBACX,uEAAuE;gBACvE,EAAE,cAAc;YAClB;QACF,IACA,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF","sources":["packages/react-aria/src/listbox/useListBoxSection.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 {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '../utils/useId';\n\nexport interface AriaListBoxSectionProps {\n /** The heading for the section. */\n heading?: ReactNode;\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string;\n}\n\nexport interface ListBoxSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes;\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes;\n\n /** Props for the group element. */\n groupProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n *\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading\n ? {\n // Technically, listbox cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a visual label for the nested group.\n id: headingId,\n role: 'presentation',\n onMouseDown: e => {\n // Prevent DOM focus from moving on mouse down when using virtual focus\n e.preventDefault();\n }\n }\n : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useListBoxSection.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AA6BM,SAAS,yCAAkB,KAA8B;IAC9D,IAAI,WAAC,OAAO,EAAE,cAAc,SAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,yCAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UAAU;YACtB,kEAAkE;YAClE,4EAA4E;YAC5E,0DAA0D;YAC1D,IAAI;YACJ,MAAM;YACN,aAAa,CAAC;gBACZ,uEAAuE;gBACvE,EAAE,cAAc;YAClB;QACF,IAAI,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF","sources":["packages/react-aria/src/listbox/useListBoxSection.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 {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '../utils/useId';\n\nexport interface AriaListBoxSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface ListBoxSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Technically, listbox cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a visual label for the nested group.\n id: headingId,\n role: 'presentation',\n onMouseDown: (e) => {\n // Prevent DOM focus from moving on mouse down when using virtual focus\n e.preventDefault();\n }\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useListBoxSection.mjs.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AA8BM,SAAS,yCAAkB,KAA8B;IAC9D,IAAI,WAAC,OAAO,EAAE,cAAc,SAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,yCAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UACV;YACE,kEAAkE;YAClE,4EAA4E;YAC5E,0DAA0D;YAC1D,IAAI;YACJ,MAAM;YACN,aAAa,CAAA;gBACX,uEAAuE;gBACvE,EAAE,cAAc;YAClB;QACF,IACA,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF","sources":["packages/react-aria/src/listbox/useListBoxSection.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 {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '../utils/useId';\n\nexport interface AriaListBoxSectionProps {\n /** The heading for the section. */\n heading?: ReactNode;\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string;\n}\n\nexport interface ListBoxSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes;\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes;\n\n /** Props for the group element. */\n groupProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n *\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading\n ? {\n // Technically, listbox cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a visual label for the nested group.\n id: headingId,\n role: 'presentation',\n onMouseDown: e => {\n // Prevent DOM focus from moving on mouse down when using virtual focus\n e.preventDefault();\n }\n }\n : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useListBoxSection.mjs.map"}