@proyecto-viviana/solidaria 0.4.2 → 0.6.0-rc.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 (1377) hide show
  1. package/LICENSE-APACHE-2.0 +201 -0
  2. package/NOTICE +91 -0
  3. package/dist/_chunk/DragManager.js +71 -25
  4. package/dist/_chunk/DragManager.js.map +1 -1
  5. package/dist/_chunk/DragManager.jsx +71 -25
  6. package/dist/_chunk/DragManager.jsx.map +1 -1
  7. package/dist/_chunk/FocusScope.js +281 -66
  8. package/dist/_chunk/FocusScope.js.map +1 -1
  9. package/dist/_chunk/FocusScope.jsx +274 -55
  10. package/dist/_chunk/FocusScope.jsx.map +1 -1
  11. package/dist/_chunk/actiongroup.js +43 -19
  12. package/dist/_chunk/actiongroup.js.map +1 -1
  13. package/dist/_chunk/actiongroup.jsx +43 -19
  14. package/dist/_chunk/actiongroup.jsx.map +1 -1
  15. package/dist/_chunk/announce.js +19 -6
  16. package/dist/_chunk/announce.js.map +1 -1
  17. package/dist/_chunk/announce.jsx +19 -6
  18. package/dist/_chunk/announce.jsx.map +1 -1
  19. package/dist/_chunk/ariaHideOutside.js +212 -10
  20. package/dist/_chunk/ariaHideOutside.js.map +1 -1
  21. package/dist/_chunk/ariaHideOutside.jsx +212 -10
  22. package/dist/_chunk/ariaHideOutside.jsx.map +1 -1
  23. package/dist/_chunk/autocomplete.js +26 -7
  24. package/dist/_chunk/autocomplete.js.map +1 -1
  25. package/dist/_chunk/autocomplete.jsx +26 -7
  26. package/dist/_chunk/autocomplete.jsx.map +1 -1
  27. package/dist/_chunk/breadcrumbs.js +17 -2
  28. package/dist/_chunk/breadcrumbs.js.map +1 -1
  29. package/dist/_chunk/breadcrumbs.jsx +17 -2
  30. package/dist/_chunk/breadcrumbs.jsx.map +1 -1
  31. package/dist/_chunk/button.js +53 -20
  32. package/dist/_chunk/button.js.map +1 -1
  33. package/dist/_chunk/button.jsx +53 -20
  34. package/dist/_chunk/button.jsx.map +1 -1
  35. package/dist/_chunk/calendar.js +341 -56
  36. package/dist/_chunk/calendar.js.map +1 -1
  37. package/dist/_chunk/calendar.jsx +341 -56
  38. package/dist/_chunk/calendar.jsx.map +1 -1
  39. package/dist/_chunk/checkbox.js +69 -26
  40. package/dist/_chunk/checkbox.js.map +1 -1
  41. package/dist/_chunk/checkbox.jsx +69 -26
  42. package/dist/_chunk/checkbox.jsx.map +1 -1
  43. package/dist/_chunk/color.js +307 -48
  44. package/dist/_chunk/color.js.map +1 -1
  45. package/dist/_chunk/color.jsx +307 -48
  46. package/dist/_chunk/color.jsx.map +1 -1
  47. package/dist/_chunk/combobox.js +193 -103
  48. package/dist/_chunk/combobox.js.map +1 -1
  49. package/dist/_chunk/combobox.jsx +193 -103
  50. package/dist/_chunk/combobox.jsx.map +1 -1
  51. package/dist/_chunk/constants.js +12 -0
  52. package/dist/_chunk/constants.js.map +1 -1
  53. package/dist/_chunk/constants.jsx +12 -0
  54. package/dist/_chunk/constants.jsx.map +1 -1
  55. package/dist/_chunk/createCollator.js +12 -0
  56. package/dist/_chunk/createCollator.js.map +1 -1
  57. package/dist/_chunk/createCollator.jsx +12 -0
  58. package/dist/_chunk/createCollator.jsx.map +1 -1
  59. package/dist/_chunk/createCollectionRowInteraction.js +50 -13
  60. package/dist/_chunk/createCollectionRowInteraction.js.map +1 -1
  61. package/dist/_chunk/createCollectionRowInteraction.jsx +50 -13
  62. package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -1
  63. package/dist/_chunk/createField.js +35 -25
  64. package/dist/_chunk/createField.js.map +1 -1
  65. package/dist/_chunk/createField.jsx +35 -25
  66. package/dist/_chunk/createField.jsx.map +1 -1
  67. package/dist/_chunk/createFocus.js +18 -5
  68. package/dist/_chunk/createFocus.js.map +1 -1
  69. package/dist/_chunk/createFocus.jsx +18 -5
  70. package/dist/_chunk/createFocus.jsx.map +1 -1
  71. package/dist/_chunk/createFocusRing.js +16 -7
  72. package/dist/_chunk/createFocusRing.js.map +1 -1
  73. package/dist/_chunk/createFocusRing.jsx +16 -7
  74. package/dist/_chunk/createFocusRing.jsx.map +1 -1
  75. package/dist/_chunk/createFocusWithin.js +16 -4
  76. package/dist/_chunk/createFocusWithin.js.map +1 -1
  77. package/dist/_chunk/createFocusWithin.jsx +16 -4
  78. package/dist/_chunk/createFocusWithin.jsx.map +1 -1
  79. package/dist/_chunk/createFocusable.js +39 -53
  80. package/dist/_chunk/createFocusable.js.map +1 -1
  81. package/dist/_chunk/createFocusable.jsx +39 -53
  82. package/dist/_chunk/createFocusable.jsx.map +1 -1
  83. package/dist/_chunk/createFormReset.js +24 -12
  84. package/dist/_chunk/createFormReset.js.map +1 -1
  85. package/dist/_chunk/createFormReset.jsx +24 -12
  86. package/dist/_chunk/createFormReset.jsx.map +1 -1
  87. package/dist/_chunk/createFormValidation.js +41 -17
  88. package/dist/_chunk/createFormValidation.js.map +1 -1
  89. package/dist/_chunk/createFormValidation.jsx +41 -17
  90. package/dist/_chunk/createFormValidation.jsx.map +1 -1
  91. package/dist/_chunk/createHover.js +56 -42
  92. package/dist/_chunk/createHover.js.map +1 -1
  93. package/dist/_chunk/createHover.jsx +56 -42
  94. package/dist/_chunk/createHover.jsx.map +1 -1
  95. package/dist/_chunk/createKeyboard.js +205 -0
  96. package/dist/_chunk/createKeyboard.js.map +1 -0
  97. package/dist/_chunk/createKeyboard.jsx +205 -0
  98. package/dist/_chunk/createKeyboard.jsx.map +1 -0
  99. package/dist/_chunk/createLabel.js +17 -4
  100. package/dist/_chunk/createLabel.js.map +1 -1
  101. package/dist/_chunk/createLabel.jsx +17 -4
  102. package/dist/_chunk/createLabel.jsx.map +1 -1
  103. package/dist/_chunk/createLabels.js +14 -2
  104. package/dist/_chunk/createLabels.js.map +1 -1
  105. package/dist/_chunk/createLabels.jsx +14 -2
  106. package/dist/_chunk/createLabels.jsx.map +1 -1
  107. package/dist/_chunk/createLandmark.js +19 -3
  108. package/dist/_chunk/createLandmark.js.map +1 -1
  109. package/dist/_chunk/createLandmark.jsx +19 -3
  110. package/dist/_chunk/createLandmark.jsx.map +1 -1
  111. package/dist/_chunk/createLongPress.js +105 -0
  112. package/dist/_chunk/createLongPress.js.map +1 -0
  113. package/dist/_chunk/createLongPress.jsx +105 -0
  114. package/dist/_chunk/createLongPress.jsx.map +1 -0
  115. package/dist/_chunk/createOverlay.js +220 -111
  116. package/dist/_chunk/createOverlay.js.map +1 -1
  117. package/dist/_chunk/createOverlay.jsx +220 -111
  118. package/dist/_chunk/createOverlay.jsx.map +1 -1
  119. package/dist/_chunk/createOverlayTrigger.js +58 -0
  120. package/dist/_chunk/createOverlayTrigger.js.map +1 -0
  121. package/dist/_chunk/createOverlayTrigger.jsx +58 -0
  122. package/dist/_chunk/createOverlayTrigger.jsx.map +1 -0
  123. package/dist/_chunk/createPress.js +38 -28
  124. package/dist/_chunk/createPress.js.map +1 -1
  125. package/dist/_chunk/createPress.jsx +38 -28
  126. package/dist/_chunk/createPress.jsx.map +1 -1
  127. package/dist/_chunk/createProgressBar.js +17 -4
  128. package/dist/_chunk/createProgressBar.js.map +1 -1
  129. package/dist/_chunk/createProgressBar.jsx +17 -4
  130. package/dist/_chunk/createProgressBar.jsx.map +1 -1
  131. package/dist/_chunk/createSelectableItem.js +58 -20
  132. package/dist/_chunk/createSelectableItem.js.map +1 -1
  133. package/dist/_chunk/createSelectableItem.jsx +58 -20
  134. package/dist/_chunk/createSelectableItem.jsx.map +1 -1
  135. package/dist/_chunk/createSelectableList.js +776 -0
  136. package/dist/_chunk/createSelectableList.js.map +1 -0
  137. package/dist/_chunk/createSelectableList.jsx +776 -0
  138. package/dist/_chunk/createSelectableList.jsx.map +1 -0
  139. package/dist/_chunk/createStringFormatter.js +350 -5
  140. package/dist/_chunk/createStringFormatter.js.map +1 -1
  141. package/dist/_chunk/createStringFormatter.jsx +350 -5
  142. package/dist/_chunk/createStringFormatter.jsx.map +1 -1
  143. package/dist/_chunk/createToggle.js +68 -19
  144. package/dist/_chunk/createToggle.js.map +1 -1
  145. package/dist/_chunk/createToggle.jsx +68 -19
  146. package/dist/_chunk/createToggle.jsx.map +1 -1
  147. package/dist/_chunk/createTypeSelect.js +15 -3
  148. package/dist/_chunk/createTypeSelect.js.map +1 -1
  149. package/dist/_chunk/createTypeSelect.jsx +15 -3
  150. package/dist/_chunk/createTypeSelect.jsx.map +1 -1
  151. package/dist/_chunk/{visually-hidden.js → createVisuallyHidden.js} +16 -4
  152. package/dist/_chunk/createVisuallyHidden.js.map +1 -0
  153. package/dist/_chunk/{visually-hidden.jsx → createVisuallyHidden.jsx} +16 -4
  154. package/dist/_chunk/createVisuallyHidden.jsx.map +1 -0
  155. package/dist/_chunk/datepicker.js +687 -602
  156. package/dist/_chunk/datepicker.js.map +1 -1
  157. package/dist/_chunk/datepicker.jsx +687 -602
  158. package/dist/_chunk/datepicker.jsx.map +1 -1
  159. package/dist/_chunk/dialog.js +49 -19
  160. package/dist/_chunk/dialog.js.map +1 -1
  161. package/dist/_chunk/dialog.jsx +49 -19
  162. package/dist/_chunk/dialog.jsx.map +1 -1
  163. package/dist/_chunk/disclosure.js +48 -28
  164. package/dist/_chunk/disclosure.js.map +1 -1
  165. package/dist/_chunk/disclosure.jsx +48 -28
  166. package/dist/_chunk/disclosure.jsx.map +1 -1
  167. package/dist/_chunk/dnd.js +1340 -1172
  168. package/dist/_chunk/dnd.js.map +1 -1
  169. package/dist/_chunk/dnd.jsx +1340 -1172
  170. package/dist/_chunk/dnd.jsx.map +1 -1
  171. package/dist/_chunk/dom.js +1200 -0
  172. package/dist/_chunk/dom.js.map +1 -0
  173. package/dist/_chunk/dom.jsx +1200 -0
  174. package/dist/_chunk/dom.jsx.map +1 -0
  175. package/dist/_chunk/env.js +1 -57
  176. package/dist/_chunk/env.js.map +1 -1
  177. package/dist/_chunk/env.jsx +1 -57
  178. package/dist/_chunk/env.jsx.map +1 -1
  179. package/dist/_chunk/filterDOMProps.js +32 -7
  180. package/dist/_chunk/filterDOMProps.js.map +1 -1
  181. package/dist/_chunk/filterDOMProps.jsx +32 -7
  182. package/dist/_chunk/filterDOMProps.jsx.map +1 -1
  183. package/dist/_chunk/focus.js +570 -338
  184. package/dist/_chunk/focus.js.map +1 -1
  185. package/dist/_chunk/focus.jsx +570 -338
  186. package/dist/_chunk/focus.jsx.map +1 -1
  187. package/dist/_chunk/grid.js +62 -8
  188. package/dist/_chunk/grid.js.map +1 -1
  189. package/dist/_chunk/grid.jsx +62 -8
  190. package/dist/_chunk/grid.jsx.map +1 -1
  191. package/dist/_chunk/gridlist.js +192 -53
  192. package/dist/_chunk/gridlist.js.map +1 -1
  193. package/dist/_chunk/gridlist.jsx +192 -53
  194. package/dist/_chunk/gridlist.jsx.map +1 -1
  195. package/dist/_chunk/i18n.js +68 -1
  196. package/dist/_chunk/i18n.js.map +1 -1
  197. package/dist/_chunk/i18n.jsx +68 -1
  198. package/dist/_chunk/i18n.jsx.map +1 -1
  199. package/dist/_chunk/interactions.js +38 -102
  200. package/dist/_chunk/interactions.js.map +1 -1
  201. package/dist/_chunk/interactions.jsx +38 -100
  202. package/dist/_chunk/interactions.jsx.map +1 -1
  203. package/dist/_chunk/intl.js +280 -0
  204. package/dist/_chunk/intl.js.map +1 -0
  205. package/dist/_chunk/intl.jsx +280 -0
  206. package/dist/_chunk/intl.jsx.map +1 -0
  207. package/dist/_chunk/link.js +15 -4
  208. package/dist/_chunk/link.js.map +1 -1
  209. package/dist/_chunk/link.jsx +15 -4
  210. package/dist/_chunk/link.jsx.map +1 -1
  211. package/dist/_chunk/listbox.js +99 -175
  212. package/dist/_chunk/listbox.js.map +1 -1
  213. package/dist/_chunk/listbox.jsx +99 -175
  214. package/dist/_chunk/listbox.jsx.map +1 -1
  215. package/dist/_chunk/locale.js +58 -12
  216. package/dist/_chunk/locale.js.map +1 -1
  217. package/dist/_chunk/locale.jsx +57 -11
  218. package/dist/_chunk/locale.jsx.map +1 -1
  219. package/dist/_chunk/menu.js +298 -57
  220. package/dist/_chunk/menu.js.map +1 -1
  221. package/dist/_chunk/menu.jsx +298 -57
  222. package/dist/_chunk/menu.jsx.map +1 -1
  223. package/dist/_chunk/mergeProps.js +216 -0
  224. package/dist/_chunk/mergeProps.js.map +1 -0
  225. package/dist/_chunk/mergeProps.jsx +216 -0
  226. package/dist/_chunk/mergeProps.jsx.map +1 -0
  227. package/dist/_chunk/meter.js +16 -4
  228. package/dist/_chunk/meter.js.map +1 -1
  229. package/dist/_chunk/meter.jsx +16 -4
  230. package/dist/_chunk/meter.jsx.map +1 -1
  231. package/dist/_chunk/numberfield.js +167 -22
  232. package/dist/_chunk/numberfield.js.map +1 -1
  233. package/dist/_chunk/numberfield.jsx +167 -22
  234. package/dist/_chunk/numberfield.jsx.map +1 -1
  235. package/dist/_chunk/overlays.js +87 -74
  236. package/dist/_chunk/overlays.js.map +1 -1
  237. package/dist/_chunk/overlays.jsx +71 -57
  238. package/dist/_chunk/overlays.jsx.map +1 -1
  239. package/dist/_chunk/owner.js +23 -0
  240. package/dist/_chunk/owner.js.map +1 -0
  241. package/dist/_chunk/owner.jsx +23 -0
  242. package/dist/_chunk/owner.jsx.map +1 -0
  243. package/dist/_chunk/popover.js +180 -42
  244. package/dist/_chunk/popover.js.map +1 -1
  245. package/dist/_chunk/popover.jsx +180 -42
  246. package/dist/_chunk/popover.jsx.map +1 -1
  247. package/dist/_chunk/radio.js +92 -32
  248. package/dist/_chunk/radio.js.map +1 -1
  249. package/dist/_chunk/radio.jsx +92 -32
  250. package/dist/_chunk/radio.jsx.map +1 -1
  251. package/dist/_chunk/reactivity.js.map +1 -1
  252. package/dist/_chunk/reactivity.jsx.map +1 -1
  253. package/dist/_chunk/refs.js +41 -0
  254. package/dist/_chunk/refs.js.map +1 -0
  255. package/dist/_chunk/refs.jsx +41 -0
  256. package/dist/_chunk/refs.jsx.map +1 -0
  257. package/dist/_chunk/searchfield.js +69 -3
  258. package/dist/_chunk/searchfield.js.map +1 -1
  259. package/dist/_chunk/searchfield.jsx +69 -3
  260. package/dist/_chunk/searchfield.jsx.map +1 -1
  261. package/dist/_chunk/select.js +226 -80
  262. package/dist/_chunk/select.js.map +1 -1
  263. package/dist/_chunk/select.jsx +162 -70
  264. package/dist/_chunk/select.jsx.map +1 -1
  265. package/dist/_chunk/selection.js +20 -638
  266. package/dist/_chunk/selection.js.map +1 -1
  267. package/dist/_chunk/selection.jsx +20 -638
  268. package/dist/_chunk/selection.jsx.map +1 -1
  269. package/dist/_chunk/separator.js +12 -0
  270. package/dist/_chunk/separator.js.map +1 -1
  271. package/dist/_chunk/separator.jsx +12 -0
  272. package/dist/_chunk/separator.jsx.map +1 -1
  273. package/dist/_chunk/slider.js +25 -16
  274. package/dist/_chunk/slider.js.map +1 -1
  275. package/dist/_chunk/slider.jsx +25 -16
  276. package/dist/_chunk/slider.jsx.map +1 -1
  277. package/dist/_chunk/spinbutton.js +52 -42
  278. package/dist/_chunk/spinbutton.js.map +1 -1
  279. package/dist/_chunk/spinbutton.jsx +52 -42
  280. package/dist/_chunk/spinbutton.jsx.map +1 -1
  281. package/dist/_chunk/steplist.js +14 -1
  282. package/dist/_chunk/steplist.js.map +1 -1
  283. package/dist/_chunk/steplist.jsx +14 -1
  284. package/dist/_chunk/steplist.jsx.map +1 -1
  285. package/dist/_chunk/switch.js +21 -3
  286. package/dist/_chunk/switch.js.map +1 -1
  287. package/dist/_chunk/switch.jsx +21 -3
  288. package/dist/_chunk/switch.jsx.map +1 -1
  289. package/dist/_chunk/table.js +666 -88
  290. package/dist/_chunk/table.js.map +1 -1
  291. package/dist/_chunk/table.jsx +666 -88
  292. package/dist/_chunk/table.jsx.map +1 -1
  293. package/dist/_chunk/tabs.js +115 -17
  294. package/dist/_chunk/tabs.js.map +1 -1
  295. package/dist/_chunk/tabs.jsx +115 -17
  296. package/dist/_chunk/tabs.jsx.map +1 -1
  297. package/dist/_chunk/tag.js +240 -39
  298. package/dist/_chunk/tag.js.map +1 -1
  299. package/dist/_chunk/tag.jsx +240 -39
  300. package/dist/_chunk/tag.jsx.map +1 -1
  301. package/dist/_chunk/textfield.js +83 -12
  302. package/dist/_chunk/textfield.js.map +1 -1
  303. package/dist/_chunk/textfield.jsx +83 -12
  304. package/dist/_chunk/textfield.jsx.map +1 -1
  305. package/dist/_chunk/toast.js +61 -28
  306. package/dist/_chunk/toast.js.map +1 -1
  307. package/dist/_chunk/toast.jsx +61 -28
  308. package/dist/_chunk/toast.jsx.map +1 -1
  309. package/dist/_chunk/tokenfield.js +567 -0
  310. package/dist/_chunk/tokenfield.js.map +1 -0
  311. package/dist/_chunk/tokenfield.jsx +567 -0
  312. package/dist/_chunk/tokenfield.jsx.map +1 -0
  313. package/dist/_chunk/toolbar.js +25 -8
  314. package/dist/_chunk/toolbar.js.map +1 -1
  315. package/dist/_chunk/toolbar.jsx +25 -8
  316. package/dist/_chunk/toolbar.jsx.map +1 -1
  317. package/dist/_chunk/tooltip.js +379 -6
  318. package/dist/_chunk/tooltip.js.map +1 -1
  319. package/dist/_chunk/tooltip.jsx +379 -6
  320. package/dist/_chunk/tooltip.jsx.map +1 -1
  321. package/dist/_chunk/tree.js +280 -69
  322. package/dist/_chunk/tree.js.map +1 -1
  323. package/dist/_chunk/tree.jsx +280 -69
  324. package/dist/_chunk/tree.jsx.map +1 -1
  325. package/dist/_chunk/utils.js +192 -150
  326. package/dist/_chunk/utils.js.map +1 -1
  327. package/dist/_chunk/utils.jsx +192 -150
  328. package/dist/_chunk/utils.jsx.map +1 -1
  329. package/dist/_chunk/virtualFocus.js +54 -0
  330. package/dist/_chunk/virtualFocus.js.map +1 -0
  331. package/dist/_chunk/virtualFocus.jsx +54 -0
  332. package/dist/_chunk/virtualFocus.jsx.map +1 -0
  333. package/dist/_chunk/virtualizer.js +202 -0
  334. package/dist/_chunk/virtualizer.js.map +1 -0
  335. package/dist/_chunk/virtualizer.jsx +202 -0
  336. package/dist/_chunk/virtualizer.jsx.map +1 -0
  337. package/dist/actiongroup/createActionGroup.d.ts +2 -1
  338. package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
  339. package/dist/autocomplete/createAutocomplete.d.ts +1 -9
  340. package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
  341. package/dist/autocomplete/intl/index.d.ts +13 -0
  342. package/dist/autocomplete/intl/index.d.ts.map +1 -0
  343. package/dist/breadcrumbs/createBreadcrumbs.d.ts +3 -1
  344. package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
  345. package/dist/breadcrumbs/intl/index.d.ts +13 -0
  346. package/dist/breadcrumbs/intl/index.d.ts.map +1 -0
  347. package/dist/button/createButton.d.ts.map +1 -1
  348. package/dist/button/createToggleButton.d.ts.map +1 -1
  349. package/dist/button/createToggleButtonGroup.d.ts +1 -1
  350. package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
  351. package/dist/button/types.d.ts +14 -0
  352. package/dist/button/types.d.ts.map +1 -1
  353. package/dist/calendar/createCalendar.d.ts +1 -7
  354. package/dist/calendar/createCalendar.d.ts.map +1 -1
  355. package/dist/calendar/createCalendarCell.d.ts +0 -6
  356. package/dist/calendar/createCalendarCell.d.ts.map +1 -1
  357. package/dist/calendar/createCalendarGrid.d.ts +1 -7
  358. package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
  359. package/dist/calendar/createCalendarMonthPicker.d.ts +0 -8
  360. package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -1
  361. package/dist/calendar/createCalendarYearPicker.d.ts +0 -8
  362. package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -1
  363. package/dist/calendar/createRangeCalendar.d.ts +13 -7
  364. package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
  365. package/dist/calendar/createRangeCalendarCell.d.ts +2 -6
  366. package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
  367. package/dist/calendar/intl/index.d.ts.map +1 -1
  368. package/dist/calendar/utils.d.ts.map +1 -1
  369. package/dist/checkbox/createCheckbox.d.ts +2 -1
  370. package/dist/checkbox/createCheckbox.d.ts.map +1 -1
  371. package/dist/checkbox/createCheckboxGroup.d.ts +1 -9
  372. package/dist/checkbox/createCheckboxGroup.d.ts.map +1 -1
  373. package/dist/checkbox/createCheckboxGroupItem.d.ts +0 -8
  374. package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
  375. package/dist/collections/index.d.ts +1 -1
  376. package/dist/collections/index.d.ts.map +1 -1
  377. package/dist/collections/index.js +18 -2
  378. package/dist/collections/index.js.map +1 -1
  379. package/dist/collections/index.jsx +18 -2
  380. package/dist/collections/index.jsx.map +1 -1
  381. package/dist/color/createColorArea.d.ts +2 -7
  382. package/dist/color/createColorArea.d.ts.map +1 -1
  383. package/dist/color/createColorField.d.ts +2 -7
  384. package/dist/color/createColorField.d.ts.map +1 -1
  385. package/dist/color/createColorSlider.d.ts +1 -6
  386. package/dist/color/createColorSlider.d.ts.map +1 -1
  387. package/dist/color/createColorSwatch.d.ts +1 -6
  388. package/dist/color/createColorSwatch.d.ts.map +1 -1
  389. package/dist/color/createColorWheel.d.ts +1 -6
  390. package/dist/color/createColorWheel.d.ts.map +1 -1
  391. package/dist/color/intl/index.d.ts.map +1 -1
  392. package/dist/color/types.d.ts +47 -1
  393. package/dist/color/types.d.ts.map +1 -1
  394. package/dist/combobox/createComboBox.d.ts +17 -8
  395. package/dist/combobox/createComboBox.d.ts.map +1 -1
  396. package/dist/combobox/intl/generated-locales.d.ts +3 -0
  397. package/dist/combobox/intl/generated-locales.d.ts.map +1 -1
  398. package/dist/combobox/intl/index.d.ts +3 -2
  399. package/dist/combobox/intl/index.d.ts.map +1 -1
  400. package/dist/datepicker/createDateField.d.ts +0 -10
  401. package/dist/datepicker/createDateField.d.ts.map +1 -1
  402. package/dist/datepicker/createDatePicker.d.ts +0 -16
  403. package/dist/datepicker/createDatePicker.d.ts.map +1 -1
  404. package/dist/datepicker/createDatePickerGroup.d.ts +1 -1
  405. package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
  406. package/dist/datepicker/createDateRangePicker.d.ts +0 -21
  407. package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
  408. package/dist/datepicker/createDateSegment.d.ts +0 -9
  409. package/dist/datepicker/createDateSegment.d.ts.map +1 -1
  410. package/dist/datepicker/createDisplayNames.d.ts +1 -9
  411. package/dist/datepicker/createDisplayNames.d.ts.map +1 -1
  412. package/dist/datepicker/createTimeField.d.ts.map +1 -1
  413. package/dist/datepicker/intl.d.ts.map +1 -1
  414. package/dist/dialog/createDialog.d.ts +2 -4
  415. package/dist/dialog/createDialog.d.ts.map +1 -1
  416. package/dist/dialog/types.d.ts +14 -0
  417. package/dist/dialog/types.d.ts.map +1 -1
  418. package/dist/disclosure/createDisclosure.d.ts +1 -8
  419. package/dist/disclosure/createDisclosure.d.ts.map +1 -1
  420. package/dist/disclosure/createDisclosureGroup.d.ts +3 -4
  421. package/dist/disclosure/createDisclosureGroup.d.ts.map +1 -1
  422. package/dist/dnd/DragManager.d.ts +1 -16
  423. package/dist/dnd/DragManager.d.ts.map +1 -1
  424. package/dist/dnd/DropTargetKeyboardNavigation.d.ts +2 -2
  425. package/dist/dnd/createDrag.d.ts +1 -7
  426. package/dist/dnd/createDrag.d.ts.map +1 -1
  427. package/dist/dnd/createDraggableCollection.d.ts +1 -7
  428. package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
  429. package/dist/dnd/createDraggableItem.d.ts +2 -7
  430. package/dist/dnd/createDraggableItem.d.ts.map +1 -1
  431. package/dist/dnd/createDrop.d.ts +1 -7
  432. package/dist/dnd/createDrop.d.ts.map +1 -1
  433. package/dist/dnd/createDropIndicator.d.ts +27 -0
  434. package/dist/dnd/createDropIndicator.d.ts.map +1 -0
  435. package/dist/dnd/createDroppableCollection.d.ts +6 -8
  436. package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
  437. package/dist/dnd/createDroppableItem.d.ts +12 -10
  438. package/dist/dnd/createDroppableItem.d.ts.map +1 -1
  439. package/dist/dnd/index.d.ts +3 -1
  440. package/dist/dnd/index.d.ts.map +1 -1
  441. package/dist/dnd/index.js +2 -2
  442. package/dist/dnd/index.jsx +2 -2
  443. package/dist/dnd/intl/index.d.ts +6 -4
  444. package/dist/dnd/intl/index.d.ts.map +1 -1
  445. package/dist/dnd/types.d.ts +20 -1
  446. package/dist/dnd/types.d.ts.map +1 -1
  447. package/dist/dnd/utils.d.ts +4 -0
  448. package/dist/dnd/utils.d.ts.map +1 -1
  449. package/dist/focus/FocusScope.d.ts +9 -5
  450. package/dist/focus/FocusScope.d.ts.map +1 -1
  451. package/dist/focus/createAutoFocus.d.ts +3 -0
  452. package/dist/focus/createAutoFocus.d.ts.map +1 -1
  453. package/dist/focus/createFocusRestore.d.ts +3 -0
  454. package/dist/focus/createFocusRestore.d.ts.map +1 -1
  455. package/dist/focus/createHasTabbableChild.d.ts +13 -0
  456. package/dist/focus/createHasTabbableChild.d.ts.map +1 -0
  457. package/dist/focus/createVirtualFocus.d.ts +4 -1
  458. package/dist/focus/createVirtualFocus.d.ts.map +1 -1
  459. package/dist/focus/index.js +3 -2
  460. package/dist/focus/index.jsx +3 -2
  461. package/dist/focus/virtualFocus.d.ts +1 -1
  462. package/dist/form/createFormReset.d.ts +1 -7
  463. package/dist/form/createFormReset.d.ts.map +1 -1
  464. package/dist/form/createFormValidation.d.ts +1 -9
  465. package/dist/form/createFormValidation.d.ts.map +1 -1
  466. package/dist/grid/GridKeyboardDelegate.d.ts.map +1 -1
  467. package/dist/grid/createGrid.d.ts +1 -5
  468. package/dist/grid/createGrid.d.ts.map +1 -1
  469. package/dist/grid/createGridCell.d.ts +1 -5
  470. package/dist/grid/createGridCell.d.ts.map +1 -1
  471. package/dist/grid/createGridRow.d.ts +1 -5
  472. package/dist/grid/createGridRow.d.ts.map +1 -1
  473. package/dist/grid/index.d.ts +2 -2
  474. package/dist/grid/intl/index.d.ts +18 -0
  475. package/dist/grid/intl/index.d.ts.map +1 -0
  476. package/dist/grid/types.d.ts +25 -2
  477. package/dist/grid/types.d.ts.map +1 -1
  478. package/dist/gridlist/createGridList.d.ts +3 -5
  479. package/dist/gridlist/createGridList.d.ts.map +1 -1
  480. package/dist/gridlist/createGridListItem.d.ts +1 -5
  481. package/dist/gridlist/createGridListItem.d.ts.map +1 -1
  482. package/dist/gridlist/createGridListSection.d.ts +0 -4
  483. package/dist/gridlist/createGridListSection.d.ts.map +1 -1
  484. package/dist/gridlist/createGridListSelectionCheckbox.d.ts +1 -5
  485. package/dist/gridlist/createGridListSelectionCheckbox.d.ts.map +1 -1
  486. package/dist/gridlist/intl/index.d.ts +14 -0
  487. package/dist/gridlist/intl/index.d.ts.map +1 -0
  488. package/dist/gridlist/types.d.ts +56 -2
  489. package/dist/gridlist/types.d.ts.map +1 -1
  490. package/dist/i18n/compileIcu.d.ts +24 -0
  491. package/dist/i18n/compileIcu.d.ts.map +1 -0
  492. package/dist/i18n/createCollator.d.ts +0 -7
  493. package/dist/i18n/createCollator.d.ts.map +1 -1
  494. package/dist/i18n/createDateFormatter.d.ts +0 -7
  495. package/dist/i18n/createDateFormatter.d.ts.map +1 -1
  496. package/dist/i18n/createFilter.d.ts +0 -7
  497. package/dist/i18n/createFilter.d.ts.map +1 -1
  498. package/dist/i18n/createListFormatter.d.ts +9 -0
  499. package/dist/i18n/createListFormatter.d.ts.map +1 -0
  500. package/dist/i18n/createNumberFormatter.d.ts +0 -7
  501. package/dist/i18n/createNumberFormatter.d.ts.map +1 -1
  502. package/dist/i18n/createStringFormatter.d.ts +14 -4
  503. package/dist/i18n/createStringFormatter.d.ts.map +1 -1
  504. package/dist/i18n/index.d.ts +1 -0
  505. package/dist/i18n/index.d.ts.map +1 -1
  506. package/dist/i18n/index.js +2 -2
  507. package/dist/i18n/index.jsx +2 -2
  508. package/dist/i18n/locale.d.ts +2 -8
  509. package/dist/i18n/locale.d.ts.map +1 -1
  510. package/dist/i18n/utils.d.ts +0 -7
  511. package/dist/i18n/utils.d.ts.map +1 -1
  512. package/dist/index.d.ts +10 -7
  513. package/dist/index.d.ts.map +1 -1
  514. package/dist/index.js +27 -21
  515. package/dist/index.jsx +27 -21
  516. package/dist/interactions/FocusableProvider.d.ts +3 -2
  517. package/dist/interactions/FocusableProvider.d.ts.map +1 -1
  518. package/dist/interactions/PressEvent.d.ts +2 -1
  519. package/dist/interactions/PressEvent.d.ts.map +1 -1
  520. package/dist/interactions/createContextMenu.d.ts +24 -0
  521. package/dist/interactions/createContextMenu.d.ts.map +1 -0
  522. package/dist/interactions/createFocus.d.ts +3 -2
  523. package/dist/interactions/createFocus.d.ts.map +1 -1
  524. package/dist/interactions/createFocusRing.d.ts +2 -1
  525. package/dist/interactions/createFocusRing.d.ts.map +1 -1
  526. package/dist/interactions/createFocusWithin.d.ts +1 -6
  527. package/dist/interactions/createFocusWithin.d.ts.map +1 -1
  528. package/dist/interactions/createFocusable.d.ts +2 -6
  529. package/dist/interactions/createFocusable.d.ts.map +1 -1
  530. package/dist/interactions/createHover.d.ts +3 -10
  531. package/dist/interactions/createHover.d.ts.map +1 -1
  532. package/dist/interactions/createInteractionModality.d.ts +12 -10
  533. package/dist/interactions/createInteractionModality.d.ts.map +1 -1
  534. package/dist/interactions/createKeyboard.d.ts +12 -3
  535. package/dist/interactions/createKeyboard.d.ts.map +1 -1
  536. package/dist/interactions/createKeyboardShortcutHandler.d.ts +24 -0
  537. package/dist/interactions/createKeyboardShortcutHandler.d.ts.map +1 -0
  538. package/dist/interactions/createLongPress.d.ts +4 -7
  539. package/dist/interactions/createLongPress.d.ts.map +1 -1
  540. package/dist/interactions/createMove.d.ts +1 -6
  541. package/dist/interactions/createMove.d.ts.map +1 -1
  542. package/dist/interactions/createPress.d.ts +2 -7
  543. package/dist/interactions/createPress.d.ts.map +1 -1
  544. package/dist/interactions/index.d.ts +1 -1
  545. package/dist/interactions/index.d.ts.map +1 -1
  546. package/dist/interactions/index.js +5 -3
  547. package/dist/interactions/index.jsx +5 -3
  548. package/dist/label/createField.d.ts +7 -1
  549. package/dist/label/createField.d.ts.map +1 -1
  550. package/dist/label/createLabel.d.ts +1 -1
  551. package/dist/label/createLabel.d.ts.map +1 -1
  552. package/dist/label/createLabels.d.ts +0 -7
  553. package/dist/label/createLabels.d.ts.map +1 -1
  554. package/dist/landmark/createLandmark.d.ts +4 -1
  555. package/dist/landmark/createLandmark.d.ts.map +1 -1
  556. package/dist/link/createLink.d.ts +1 -1
  557. package/dist/link/createLink.d.ts.map +1 -1
  558. package/dist/listbox/createListBox.d.ts +8 -7
  559. package/dist/listbox/createListBox.d.ts.map +1 -1
  560. package/dist/listbox/createOption.d.ts +7 -1
  561. package/dist/listbox/createOption.d.ts.map +1 -1
  562. package/dist/live-announcer/announce.d.ts +2 -13
  563. package/dist/live-announcer/announce.d.ts.map +1 -1
  564. package/dist/menu/createMenu.d.ts +3 -7
  565. package/dist/menu/createMenu.d.ts.map +1 -1
  566. package/dist/menu/createMenuItem.d.ts +2 -1
  567. package/dist/menu/createMenuItem.d.ts.map +1 -1
  568. package/dist/menu/createMenuTrigger.d.ts +24 -20
  569. package/dist/menu/createMenuTrigger.d.ts.map +1 -1
  570. package/dist/menu/index.d.ts +1 -1
  571. package/dist/menu/index.d.ts.map +1 -1
  572. package/dist/menu/intl/index.d.ts +4 -0
  573. package/dist/menu/intl/index.d.ts.map +1 -0
  574. package/dist/meter/createMeter.d.ts +2 -1
  575. package/dist/meter/createMeter.d.ts.map +1 -1
  576. package/dist/numberfield/createNumberField.d.ts +29 -6
  577. package/dist/numberfield/createNumberField.d.ts.map +1 -1
  578. package/dist/overlays/ariaHideOutside.d.ts +0 -4
  579. package/dist/overlays/ariaHideOutside.d.ts.map +1 -1
  580. package/dist/overlays/createInteractOutside.d.ts +2 -5
  581. package/dist/overlays/createInteractOutside.d.ts.map +1 -1
  582. package/dist/overlays/createModal.d.ts +3 -6
  583. package/dist/overlays/createModal.d.ts.map +1 -1
  584. package/dist/overlays/createOverlay.d.ts +1 -5
  585. package/dist/overlays/createOverlay.d.ts.map +1 -1
  586. package/dist/overlays/createOverlayTrigger.d.ts +2 -6
  587. package/dist/overlays/createOverlayTrigger.d.ts.map +1 -1
  588. package/dist/overlays/createPreventScroll.d.ts +0 -4
  589. package/dist/overlays/createPreventScroll.d.ts.map +1 -1
  590. package/dist/overlays/index.d.ts +1 -0
  591. package/dist/overlays/index.d.ts.map +1 -1
  592. package/dist/overlays/index.js +3 -2
  593. package/dist/overlays/index.jsx +3 -2
  594. package/dist/overlays/intl/index.d.ts +13 -0
  595. package/dist/overlays/intl/index.d.ts.map +1 -0
  596. package/dist/popover/calculatePosition.d.ts +1 -1
  597. package/dist/popover/calculatePosition.d.ts.map +1 -1
  598. package/dist/popover/createOverlayPosition.d.ts +1 -7
  599. package/dist/popover/createOverlayPosition.d.ts.map +1 -1
  600. package/dist/popover/createPopover.d.ts +6 -7
  601. package/dist/popover/createPopover.d.ts.map +1 -1
  602. package/dist/progress/createProgressBar.d.ts +2 -10
  603. package/dist/progress/createProgressBar.d.ts.map +1 -1
  604. package/dist/radio/createRadio.d.ts +8 -1
  605. package/dist/radio/createRadio.d.ts.map +1 -1
  606. package/dist/radio/createRadioGroup.d.ts +1 -9
  607. package/dist/radio/createRadioGroup.d.ts.map +1 -1
  608. package/dist/searchfield/createSearchField.d.ts +1 -1
  609. package/dist/searchfield/createSearchField.d.ts.map +1 -1
  610. package/dist/searchfield/intl/index.d.ts +13 -0
  611. package/dist/searchfield/intl/index.d.ts.map +1 -0
  612. package/dist/select/createHiddenSelect.d.ts +3 -10
  613. package/dist/select/createHiddenSelect.d.ts.map +1 -1
  614. package/dist/select/createSelect.d.ts +10 -6
  615. package/dist/select/createSelect.d.ts.map +1 -1
  616. package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -1
  617. package/dist/selection/ListKeyboardDelegate.d.ts +2 -1
  618. package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -1
  619. package/dist/selection/constants.d.ts.map +1 -1
  620. package/dist/selection/createCollectionRowInteraction.d.ts +12 -1
  621. package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -1
  622. package/dist/selection/createScrollIntoViewOnFocus.d.ts +0 -11
  623. package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -1
  624. package/dist/selection/createSelectableCollection.d.ts +1 -23
  625. package/dist/selection/createSelectableCollection.d.ts.map +1 -1
  626. package/dist/selection/createSelectableItem.d.ts +2 -29
  627. package/dist/selection/createSelectableItem.d.ts.map +1 -1
  628. package/dist/selection/createSelectableList.d.ts +4 -17
  629. package/dist/selection/createSelectableList.d.ts.map +1 -1
  630. package/dist/selection/createTypeSelect.d.ts +2 -8
  631. package/dist/selection/createTypeSelect.d.ts.map +1 -1
  632. package/dist/selection/index.js +3 -2
  633. package/dist/selection/index.jsx +3 -2
  634. package/dist/selection/selectItem.d.ts.map +1 -1
  635. package/dist/selection/utils.d.ts +1 -1
  636. package/dist/selection/utils.d.ts.map +1 -1
  637. package/dist/separator/createSeparator.d.ts +3 -1
  638. package/dist/separator/createSeparator.d.ts.map +1 -1
  639. package/dist/slider/createSlider.d.ts +1 -6
  640. package/dist/slider/createSlider.d.ts.map +1 -1
  641. package/dist/spinbutton/createSpinButton.d.ts +0 -9
  642. package/dist/spinbutton/createSpinButton.d.ts.map +1 -1
  643. package/dist/spinbutton/index.d.ts +2 -2
  644. package/dist/spinbutton/index.d.ts.map +1 -1
  645. package/dist/spinbutton/intl.d.ts.map +1 -1
  646. package/dist/ssr/index.d.ts +3 -9
  647. package/dist/ssr/index.d.ts.map +1 -1
  648. package/dist/ssr/index.js +47 -26
  649. package/dist/ssr/index.js.map +1 -1
  650. package/dist/ssr/index.jsx +47 -26
  651. package/dist/ssr/index.jsx.map +1 -1
  652. package/dist/steplist/createStepList.d.ts +1 -1
  653. package/dist/steplist/createStepList.d.ts.map +1 -1
  654. package/dist/switch/createSwitch.d.ts +2 -1
  655. package/dist/switch/createSwitch.d.ts.map +1 -1
  656. package/dist/table/createTable.d.ts +1 -5
  657. package/dist/table/createTable.d.ts.map +1 -1
  658. package/dist/table/createTableCell.d.ts +1 -5
  659. package/dist/table/createTableCell.d.ts.map +1 -1
  660. package/dist/table/createTableColumnHeader.d.ts +1 -5
  661. package/dist/table/createTableColumnHeader.d.ts.map +1 -1
  662. package/dist/table/createTableColumnResize.d.ts +2 -8
  663. package/dist/table/createTableColumnResize.d.ts.map +1 -1
  664. package/dist/table/createTableHeaderRow.d.ts +1 -5
  665. package/dist/table/createTableHeaderRow.d.ts.map +1 -1
  666. package/dist/table/createTableRow.d.ts +1 -5
  667. package/dist/table/createTableRow.d.ts.map +1 -1
  668. package/dist/table/createTableRowGroup.d.ts +1 -5
  669. package/dist/table/createTableRowGroup.d.ts.map +1 -1
  670. package/dist/table/createTableSelectAllCheckbox.d.ts +1 -5
  671. package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -1
  672. package/dist/table/createTableSelectionCheckbox.d.ts +1 -5
  673. package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
  674. package/dist/table/index.d.ts +2 -2
  675. package/dist/table/intl/index.d.ts +23 -0
  676. package/dist/table/intl/index.d.ts.map +1 -0
  677. package/dist/table/types.d.ts +44 -2
  678. package/dist/table/types.d.ts.map +1 -1
  679. package/dist/table/utils.d.ts.map +1 -1
  680. package/dist/tabs/createTabs.d.ts +5 -9
  681. package/dist/tabs/createTabs.d.ts.map +1 -1
  682. package/dist/tag/createTag.d.ts +4 -8
  683. package/dist/tag/createTag.d.ts.map +1 -1
  684. package/dist/tag/createTagGroup.d.ts +0 -9
  685. package/dist/tag/createTagGroup.d.ts.map +1 -1
  686. package/dist/tag/intl/index.d.ts +14 -0
  687. package/dist/tag/intl/index.d.ts.map +1 -0
  688. package/dist/textfield/createTextField.d.ts +6 -8
  689. package/dist/textfield/createTextField.d.ts.map +1 -1
  690. package/dist/toast/createToast.d.ts +1 -8
  691. package/dist/toast/createToast.d.ts.map +1 -1
  692. package/dist/toast/createToastRegion.d.ts +7 -18
  693. package/dist/toast/createToastRegion.d.ts.map +1 -1
  694. package/dist/toast/intl/index.d.ts +14 -0
  695. package/dist/toast/intl/index.d.ts.map +1 -0
  696. package/dist/toggle/createToggle.d.ts +8 -1
  697. package/dist/toggle/createToggle.d.ts.map +1 -1
  698. package/dist/tokenfield/createToken.d.ts +15 -0
  699. package/dist/tokenfield/createToken.d.ts.map +1 -0
  700. package/dist/tokenfield/createTokenField.d.ts +52 -0
  701. package/dist/tokenfield/createTokenField.d.ts.map +1 -0
  702. package/dist/tokenfield/index.d.ts +3 -0
  703. package/dist/tokenfield/index.d.ts.map +1 -0
  704. package/dist/tokenfield/index.js +2 -0
  705. package/dist/tokenfield/index.jsx +2 -0
  706. package/dist/toolbar/createToolbar.d.ts +1 -1
  707. package/dist/toolbar/createToolbar.d.ts.map +1 -1
  708. package/dist/tooltip/createPreviewTrigger.d.ts +23 -0
  709. package/dist/tooltip/createPreviewTrigger.d.ts.map +1 -0
  710. package/dist/tooltip/createSafeArea.d.ts +20 -0
  711. package/dist/tooltip/createSafeArea.d.ts.map +1 -0
  712. package/dist/tooltip/createTooltip.d.ts +1 -1
  713. package/dist/tooltip/createTooltip.d.ts.map +1 -1
  714. package/dist/tooltip/createTooltipTrigger.d.ts +1 -9
  715. package/dist/tooltip/createTooltipTrigger.d.ts.map +1 -1
  716. package/dist/tooltip/index.d.ts +2 -0
  717. package/dist/tooltip/index.d.ts.map +1 -1
  718. package/dist/tooltip/index.js +2 -2
  719. package/dist/tooltip/index.jsx +2 -2
  720. package/dist/tooltip/intl/index.d.ts +4 -0
  721. package/dist/tooltip/intl/index.d.ts.map +1 -0
  722. package/dist/tree/createTree.d.ts +1 -5
  723. package/dist/tree/createTree.d.ts.map +1 -1
  724. package/dist/tree/createTreeItem.d.ts +1 -5
  725. package/dist/tree/createTreeItem.d.ts.map +1 -1
  726. package/dist/tree/createTreeSelectionCheckbox.d.ts +1 -5
  727. package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
  728. package/dist/tree/intl/index.d.ts +14 -0
  729. package/dist/tree/intl/index.d.ts.map +1 -0
  730. package/dist/tree/types.d.ts +35 -2
  731. package/dist/tree/types.d.ts.map +1 -1
  732. package/dist/utils/ShadowTreeWalker.d.ts +30 -0
  733. package/dist/utils/ShadowTreeWalker.d.ts.map +1 -0
  734. package/dist/utils/animation.d.ts +1 -29
  735. package/dist/utils/animation.d.ts.map +1 -1
  736. package/dist/utils/capture.d.ts +14 -0
  737. package/dist/utils/capture.d.ts.map +1 -0
  738. package/dist/utils/createDescription.d.ts +1 -25
  739. package/dist/utils/createDescription.d.ts.map +1 -1
  740. package/dist/utils/dom.d.ts +45 -11
  741. package/dist/utils/dom.d.ts.map +1 -1
  742. package/dist/utils/domAttrs.d.ts +16 -0
  743. package/dist/utils/domAttrs.d.ts.map +1 -0
  744. package/dist/utils/env.d.ts +2 -0
  745. package/dist/utils/env.d.ts.map +1 -1
  746. package/dist/utils/events.d.ts +0 -4
  747. package/dist/utils/events.d.ts.map +1 -1
  748. package/dist/utils/filterDOMProps.d.ts +0 -6
  749. package/dist/utils/filterDOMProps.d.ts.map +1 -1
  750. package/dist/utils/focus.d.ts +19 -6
  751. package/dist/utils/focus.d.ts.map +1 -1
  752. package/dist/utils/geometry.d.ts +1 -1
  753. package/dist/utils/geometry.d.ts.map +1 -1
  754. package/dist/utils/getMetaValue.d.ts +13 -0
  755. package/dist/utils/getMetaValue.d.ts.map +1 -0
  756. package/dist/utils/getNonce.d.ts +9 -0
  757. package/dist/utils/getNonce.d.ts.map +1 -0
  758. package/dist/utils/globalListeners.d.ts +0 -6
  759. package/dist/utils/globalListeners.d.ts.map +1 -1
  760. package/dist/utils/index.d.ts +6 -1
  761. package/dist/utils/index.d.ts.map +1 -1
  762. package/dist/utils/index.js +7 -4
  763. package/dist/utils/index.jsx +7 -4
  764. package/dist/utils/keyboard.d.ts +0 -4
  765. package/dist/utils/keyboard.d.ts.map +1 -1
  766. package/dist/utils/mergeProps.d.ts +5 -2
  767. package/dist/utils/mergeProps.d.ts.map +1 -1
  768. package/dist/utils/owner.d.ts +14 -0
  769. package/dist/utils/owner.d.ts.map +1 -0
  770. package/dist/utils/platform.d.ts +0 -4
  771. package/dist/utils/platform.d.ts.map +1 -1
  772. package/dist/utils/reactivity.d.ts +2 -0
  773. package/dist/utils/reactivity.d.ts.map +1 -1
  774. package/dist/utils/refs.d.ts +20 -0
  775. package/dist/utils/refs.d.ts.map +1 -0
  776. package/dist/utils/runAfterTransition.d.ts +2 -0
  777. package/dist/utils/runAfterTransition.d.ts.map +1 -0
  778. package/dist/utils/scrollIntoView.d.ts +0 -4
  779. package/dist/utils/scrollIntoView.d.ts.map +1 -1
  780. package/dist/utils/splitProps.d.ts +17 -0
  781. package/dist/utils/splitProps.d.ts.map +1 -0
  782. package/dist/utils/textSelection.d.ts +0 -8
  783. package/dist/utils/textSelection.d.ts.map +1 -1
  784. package/dist/virtualizer/ScrollView.d.ts +38 -0
  785. package/dist/virtualizer/ScrollView.d.ts.map +1 -0
  786. package/dist/virtualizer/index.d.ts +3 -0
  787. package/dist/virtualizer/index.d.ts.map +1 -0
  788. package/dist/virtualizer/index.js +2 -0
  789. package/dist/virtualizer/index.jsx +2 -0
  790. package/dist/virtualizer/utils.d.ts +10 -0
  791. package/dist/virtualizer/utils.d.ts.map +1 -0
  792. package/dist/visually-hidden/createVisuallyHidden.d.ts +2 -9
  793. package/dist/visually-hidden/createVisuallyHidden.d.ts.map +1 -1
  794. package/dist/visually-hidden/index.js +1 -1
  795. package/dist/visually-hidden/index.jsx +1 -1
  796. package/package.json +30 -11
  797. package/src/actiongroup/createActionGroup.ts +49 -27
  798. package/src/autocomplete/createAutocomplete.ts +32 -5
  799. package/src/autocomplete/intl/ar-AE.json +3 -0
  800. package/src/autocomplete/intl/bg-BG.json +3 -0
  801. package/src/autocomplete/intl/cs-CZ.json +3 -0
  802. package/src/autocomplete/intl/da-DK.json +3 -0
  803. package/src/autocomplete/intl/de-DE.json +3 -0
  804. package/src/autocomplete/intl/el-GR.json +3 -0
  805. package/src/autocomplete/intl/en-US.json +3 -0
  806. package/src/autocomplete/intl/es-ES.json +3 -0
  807. package/src/autocomplete/intl/et-EE.json +3 -0
  808. package/src/autocomplete/intl/fi-FI.json +3 -0
  809. package/src/autocomplete/intl/fr-FR.json +3 -0
  810. package/src/autocomplete/intl/he-IL.json +3 -0
  811. package/src/autocomplete/intl/hr-HR.json +3 -0
  812. package/src/autocomplete/intl/hu-HU.json +3 -0
  813. package/src/autocomplete/intl/index.ts +122 -0
  814. package/src/autocomplete/intl/it-IT.json +3 -0
  815. package/src/autocomplete/intl/ja-JP.json +3 -0
  816. package/src/autocomplete/intl/ko-KR.json +3 -0
  817. package/src/autocomplete/intl/lt-LT.json +3 -0
  818. package/src/autocomplete/intl/lv-LV.json +3 -0
  819. package/src/autocomplete/intl/nb-NO.json +3 -0
  820. package/src/autocomplete/intl/nl-NL.json +3 -0
  821. package/src/autocomplete/intl/pl-PL.json +3 -0
  822. package/src/autocomplete/intl/pt-BR.json +3 -0
  823. package/src/autocomplete/intl/pt-PT.json +3 -0
  824. package/src/autocomplete/intl/ro-RO.json +3 -0
  825. package/src/autocomplete/intl/ru-RU.json +3 -0
  826. package/src/autocomplete/intl/sk-SK.json +3 -0
  827. package/src/autocomplete/intl/sl-SI.json +3 -0
  828. package/src/autocomplete/intl/sr-SP.json +3 -0
  829. package/src/autocomplete/intl/sv-SE.json +3 -0
  830. package/src/autocomplete/intl/tr-TR.json +3 -0
  831. package/src/autocomplete/intl/uk-UA.json +3 -0
  832. package/src/autocomplete/intl/zh-CN.json +3 -0
  833. package/src/autocomplete/intl/zh-TW.json +3 -0
  834. package/src/breadcrumbs/createBreadcrumbs.ts +18 -1
  835. package/src/breadcrumbs/intl/ar-AE.json +3 -0
  836. package/src/breadcrumbs/intl/bg-BG.json +3 -0
  837. package/src/breadcrumbs/intl/cs-CZ.json +3 -0
  838. package/src/breadcrumbs/intl/da-DK.json +3 -0
  839. package/src/breadcrumbs/intl/de-DE.json +3 -0
  840. package/src/breadcrumbs/intl/el-GR.json +3 -0
  841. package/src/breadcrumbs/intl/en-US.json +3 -0
  842. package/src/breadcrumbs/intl/es-ES.json +3 -0
  843. package/src/breadcrumbs/intl/et-EE.json +3 -0
  844. package/src/breadcrumbs/intl/fi-FI.json +3 -0
  845. package/src/breadcrumbs/intl/fr-FR.json +3 -0
  846. package/src/breadcrumbs/intl/he-IL.json +3 -0
  847. package/src/breadcrumbs/intl/hr-HR.json +3 -0
  848. package/src/breadcrumbs/intl/hu-HU.json +3 -0
  849. package/src/breadcrumbs/intl/index.ts +122 -0
  850. package/src/breadcrumbs/intl/it-IT.json +3 -0
  851. package/src/breadcrumbs/intl/ja-JP.json +3 -0
  852. package/src/breadcrumbs/intl/ko-KR.json +3 -0
  853. package/src/breadcrumbs/intl/lt-LT.json +3 -0
  854. package/src/breadcrumbs/intl/lv-LV.json +3 -0
  855. package/src/breadcrumbs/intl/nb-NO.json +3 -0
  856. package/src/breadcrumbs/intl/nl-NL.json +3 -0
  857. package/src/breadcrumbs/intl/pl-PL.json +3 -0
  858. package/src/breadcrumbs/intl/pt-BR.json +3 -0
  859. package/src/breadcrumbs/intl/pt-PT.json +3 -0
  860. package/src/breadcrumbs/intl/ro-RO.json +3 -0
  861. package/src/breadcrumbs/intl/ru-RU.json +3 -0
  862. package/src/breadcrumbs/intl/sk-SK.json +3 -0
  863. package/src/breadcrumbs/intl/sl-SI.json +3 -0
  864. package/src/breadcrumbs/intl/sr-SP.json +3 -0
  865. package/src/breadcrumbs/intl/sv-SE.json +3 -0
  866. package/src/breadcrumbs/intl/tr-TR.json +3 -0
  867. package/src/breadcrumbs/intl/uk-UA.json +3 -0
  868. package/src/breadcrumbs/intl/zh-CN.json +3 -0
  869. package/src/breadcrumbs/intl/zh-TW.json +3 -0
  870. package/src/button/createButton.ts +15 -1
  871. package/src/button/createToggleButton.ts +18 -5
  872. package/src/button/createToggleButtonGroup.ts +23 -8
  873. package/src/button/types.ts +16 -0
  874. package/src/calendar/createCalendar.ts +22 -3
  875. package/src/calendar/createCalendarCell.ts +104 -15
  876. package/src/calendar/createCalendarGrid.ts +37 -13
  877. package/src/calendar/createCalendarMonthPicker.ts +14 -0
  878. package/src/calendar/createCalendarYearPicker.ts +14 -0
  879. package/src/calendar/createRangeCalendar.ts +124 -1
  880. package/src/calendar/createRangeCalendarCell.ts +179 -40
  881. package/src/calendar/intl/index.ts +37 -0
  882. package/src/calendar/utils.ts +14 -0
  883. package/src/checkbox/createCheckbox.ts +32 -17
  884. package/src/checkbox/createCheckboxGroup.ts +31 -13
  885. package/src/checkbox/createCheckboxGroupItem.ts +15 -1
  886. package/src/collections/index.ts +21 -3
  887. package/src/color/createColorArea.ts +226 -29
  888. package/src/color/createColorField.ts +98 -22
  889. package/src/color/createColorSlider.ts +24 -3
  890. package/src/color/createColorSwatch.ts +18 -1
  891. package/src/color/createColorWheel.ts +27 -5
  892. package/src/color/intl/index.ts +35 -0
  893. package/src/color/types.ts +47 -1
  894. package/src/combobox/createComboBox.ts +303 -152
  895. package/src/combobox/intl/generated-locales.ts +38 -1
  896. package/src/combobox/intl/index.ts +38 -2
  897. package/src/datepicker/createDateField.ts +38 -22
  898. package/src/datepicker/createDatePicker.ts +14 -0
  899. package/src/datepicker/createDatePickerGroup.ts +24 -12
  900. package/src/datepicker/createDateRangePicker.ts +14 -0
  901. package/src/datepicker/createDateSegment.ts +110 -46
  902. package/src/datepicker/createDisplayNames.ts +16 -1
  903. package/src/datepicker/createTimeField.ts +15 -5
  904. package/src/datepicker/intl.ts +623 -544
  905. package/src/dialog/createDialog.ts +57 -30
  906. package/src/dialog/types.ts +14 -0
  907. package/src/disclosure/createDisclosure.ts +28 -6
  908. package/src/disclosure/createDisclosureGroup.ts +3 -4
  909. package/src/dnd/DragManager.ts +60 -9
  910. package/src/dnd/DropTargetKeyboardNavigation.ts +8 -6
  911. package/src/dnd/createDrag.ts +18 -1
  912. package/src/dnd/createDraggableCollection.ts +96 -32
  913. package/src/dnd/createDraggableItem.ts +73 -31
  914. package/src/dnd/createDrop.ts +18 -1
  915. package/src/dnd/createDropIndicator.ts +92 -0
  916. package/src/dnd/createDroppableCollection.ts +113 -48
  917. package/src/dnd/createDroppableItem.ts +161 -13
  918. package/src/dnd/index.ts +3 -0
  919. package/src/dnd/intl/index.ts +77 -66
  920. package/src/dnd/types.ts +20 -1
  921. package/src/dnd/utils.ts +19 -0
  922. package/src/focus/FocusScope.tsx +542 -157
  923. package/src/focus/createAutoFocus.ts +94 -68
  924. package/src/focus/createFocusRestore.ts +16 -12
  925. package/src/focus/createHasTabbableChild.ts +78 -0
  926. package/src/focus/createVirtualFocus.ts +21 -5
  927. package/src/focus/virtualFocus.ts +1 -1
  928. package/src/form/createFormReset.ts +40 -17
  929. package/src/form/createFormValidation.ts +128 -86
  930. package/src/grid/GridKeyboardDelegate.ts +14 -0
  931. package/src/grid/createGrid.ts +17 -2
  932. package/src/grid/createGridCell.ts +17 -2
  933. package/src/grid/createGridRow.ts +17 -2
  934. package/src/grid/index.ts +2 -2
  935. package/src/grid/intl/ar-AE.json +8 -0
  936. package/src/grid/intl/bg-BG.json +8 -0
  937. package/src/grid/intl/cs-CZ.json +8 -0
  938. package/src/grid/intl/da-DK.json +8 -0
  939. package/src/grid/intl/de-DE.json +8 -0
  940. package/src/grid/intl/el-GR.json +8 -0
  941. package/src/grid/intl/en-US.json +8 -0
  942. package/src/grid/intl/es-ES.json +8 -0
  943. package/src/grid/intl/et-EE.json +8 -0
  944. package/src/grid/intl/fi-FI.json +8 -0
  945. package/src/grid/intl/fr-FR.json +8 -0
  946. package/src/grid/intl/he-IL.json +8 -0
  947. package/src/grid/intl/hr-HR.json +8 -0
  948. package/src/grid/intl/hu-HU.json +8 -0
  949. package/src/grid/intl/index.ts +127 -0
  950. package/src/grid/intl/it-IT.json +8 -0
  951. package/src/grid/intl/ja-JP.json +8 -0
  952. package/src/grid/intl/ko-KR.json +8 -0
  953. package/src/grid/intl/lt-LT.json +8 -0
  954. package/src/grid/intl/lv-LV.json +8 -0
  955. package/src/grid/intl/nb-NO.json +8 -0
  956. package/src/grid/intl/nl-NL.json +8 -0
  957. package/src/grid/intl/pl-PL.json +8 -0
  958. package/src/grid/intl/pt-BR.json +8 -0
  959. package/src/grid/intl/pt-PT.json +8 -0
  960. package/src/grid/intl/ro-RO.json +8 -0
  961. package/src/grid/intl/ru-RU.json +8 -0
  962. package/src/grid/intl/sk-SK.json +8 -0
  963. package/src/grid/intl/sl-SI.json +8 -0
  964. package/src/grid/intl/sr-SP.json +8 -0
  965. package/src/grid/intl/sv-SE.json +8 -0
  966. package/src/grid/intl/tr-TR.json +8 -0
  967. package/src/grid/intl/uk-UA.json +8 -0
  968. package/src/grid/intl/zh-CN.json +8 -0
  969. package/src/grid/intl/zh-TW.json +8 -0
  970. package/src/grid/types.ts +25 -2
  971. package/src/gridlist/createGridList.ts +172 -42
  972. package/src/gridlist/createGridListItem.ts +51 -13
  973. package/src/gridlist/createGridListSection.ts +14 -0
  974. package/src/gridlist/createGridListSelectionCheckbox.ts +31 -4
  975. package/src/gridlist/intl/ar-AE.json +4 -0
  976. package/src/gridlist/intl/bg-BG.json +4 -0
  977. package/src/gridlist/intl/cs-CZ.json +4 -0
  978. package/src/gridlist/intl/da-DK.json +4 -0
  979. package/src/gridlist/intl/de-DE.json +4 -0
  980. package/src/gridlist/intl/el-GR.json +4 -0
  981. package/src/gridlist/intl/en-US.json +4 -0
  982. package/src/gridlist/intl/es-ES.json +4 -0
  983. package/src/gridlist/intl/et-EE.json +4 -0
  984. package/src/gridlist/intl/fi-FI.json +4 -0
  985. package/src/gridlist/intl/fr-FR.json +4 -0
  986. package/src/gridlist/intl/he-IL.json +4 -0
  987. package/src/gridlist/intl/hr-HR.json +4 -0
  988. package/src/gridlist/intl/hu-HU.json +4 -0
  989. package/src/gridlist/intl/index.ts +123 -0
  990. package/src/gridlist/intl/it-IT.json +4 -0
  991. package/src/gridlist/intl/ja-JP.json +4 -0
  992. package/src/gridlist/intl/ko-KR.json +4 -0
  993. package/src/gridlist/intl/lt-LT.json +4 -0
  994. package/src/gridlist/intl/lv-LV.json +4 -0
  995. package/src/gridlist/intl/nb-NO.json +4 -0
  996. package/src/gridlist/intl/nl-NL.json +4 -0
  997. package/src/gridlist/intl/pl-PL.json +4 -0
  998. package/src/gridlist/intl/pt-BR.json +4 -0
  999. package/src/gridlist/intl/pt-PT.json +4 -0
  1000. package/src/gridlist/intl/ro-RO.json +4 -0
  1001. package/src/gridlist/intl/ru-RU.json +4 -0
  1002. package/src/gridlist/intl/sk-SK.json +4 -0
  1003. package/src/gridlist/intl/sl-SI.json +4 -0
  1004. package/src/gridlist/intl/sr-SP.json +4 -0
  1005. package/src/gridlist/intl/sv-SE.json +4 -0
  1006. package/src/gridlist/intl/tr-TR.json +4 -0
  1007. package/src/gridlist/intl/uk-UA.json +4 -0
  1008. package/src/gridlist/intl/zh-CN.json +4 -0
  1009. package/src/gridlist/intl/zh-TW.json +4 -0
  1010. package/src/gridlist/types.ts +54 -2
  1011. package/src/i18n/compileIcu.ts +440 -0
  1012. package/src/i18n/createCollator.ts +14 -0
  1013. package/src/i18n/createDateFormatter.ts +14 -0
  1014. package/src/i18n/createFilter.ts +14 -0
  1015. package/src/i18n/createListFormatter.ts +38 -0
  1016. package/src/i18n/createNumberFormatter.ts +14 -0
  1017. package/src/i18n/createStringFormatter.ts +64 -8
  1018. package/src/i18n/index.ts +3 -0
  1019. package/src/i18n/locale.tsx +60 -19
  1020. package/src/i18n/utils.ts +14 -0
  1021. package/src/index.ts +49 -1
  1022. package/src/interactions/FocusableProvider.tsx +28 -11
  1023. package/src/interactions/PressEvent.ts +16 -1
  1024. package/src/interactions/createContextMenu.ts +108 -0
  1025. package/src/interactions/createFocus.ts +26 -6
  1026. package/src/interactions/createFocusRing.ts +28 -13
  1027. package/src/interactions/createFocusWithin.ts +23 -3
  1028. package/src/interactions/createFocusable.ts +45 -28
  1029. package/src/interactions/createHover.ts +102 -81
  1030. package/src/interactions/createInteractionModality.ts +135 -45
  1031. package/src/interactions/createKeyboard.ts +85 -9
  1032. package/src/interactions/createKeyboardShortcutHandler.ts +157 -0
  1033. package/src/interactions/createLongPress.ts +31 -9
  1034. package/src/interactions/createMove.ts +24 -3
  1035. package/src/interactions/createPress.ts +85 -41
  1036. package/src/interactions/index.ts +1 -0
  1037. package/src/label/createField.ts +58 -63
  1038. package/src/label/createLabel.ts +21 -4
  1039. package/src/label/createLabels.ts +25 -1
  1040. package/src/landmark/createLandmark.ts +27 -4
  1041. package/src/link/createLink.ts +20 -12
  1042. package/src/listbox/createListBox.ts +86 -310
  1043. package/src/listbox/createOption.ts +50 -14
  1044. package/src/live-announcer/announce.ts +21 -6
  1045. package/src/menu/createMenu.ts +92 -5
  1046. package/src/menu/createMenuItem.ts +40 -23
  1047. package/src/menu/createMenuTrigger.ts +179 -51
  1048. package/src/menu/index.ts +2 -0
  1049. package/src/menu/intl/index.ts +130 -0
  1050. package/src/meter/createMeter.ts +20 -5
  1051. package/src/numberfield/createNumberField.ts +254 -14
  1052. package/src/overlays/ariaHideOutside.ts +76 -11
  1053. package/src/overlays/createInteractOutside.ts +74 -47
  1054. package/src/overlays/createModal.tsx +42 -27
  1055. package/src/overlays/createOverlay.ts +107 -66
  1056. package/src/overlays/createOverlayTrigger.ts +21 -6
  1057. package/src/overlays/createPreventScroll.ts +92 -62
  1058. package/src/overlays/index.ts +2 -0
  1059. package/src/overlays/intl/ar-AE.json +3 -0
  1060. package/src/overlays/intl/bg-BG.json +3 -0
  1061. package/src/overlays/intl/cs-CZ.json +3 -0
  1062. package/src/overlays/intl/da-DK.json +3 -0
  1063. package/src/overlays/intl/de-DE.json +3 -0
  1064. package/src/overlays/intl/el-GR.json +3 -0
  1065. package/src/overlays/intl/en-US.json +3 -0
  1066. package/src/overlays/intl/es-ES.json +3 -0
  1067. package/src/overlays/intl/et-EE.json +3 -0
  1068. package/src/overlays/intl/fi-FI.json +3 -0
  1069. package/src/overlays/intl/fr-FR.json +3 -0
  1070. package/src/overlays/intl/he-IL.json +3 -0
  1071. package/src/overlays/intl/hr-HR.json +3 -0
  1072. package/src/overlays/intl/hu-HU.json +3 -0
  1073. package/src/overlays/intl/index.ts +122 -0
  1074. package/src/overlays/intl/it-IT.json +3 -0
  1075. package/src/overlays/intl/ja-JP.json +3 -0
  1076. package/src/overlays/intl/ko-KR.json +3 -0
  1077. package/src/overlays/intl/lt-LT.json +3 -0
  1078. package/src/overlays/intl/lv-LV.json +3 -0
  1079. package/src/overlays/intl/nb-NO.json +3 -0
  1080. package/src/overlays/intl/nl-NL.json +3 -0
  1081. package/src/overlays/intl/pl-PL.json +3 -0
  1082. package/src/overlays/intl/pt-BR.json +3 -0
  1083. package/src/overlays/intl/pt-PT.json +3 -0
  1084. package/src/overlays/intl/ro-RO.json +3 -0
  1085. package/src/overlays/intl/ru-RU.json +3 -0
  1086. package/src/overlays/intl/sk-SK.json +3 -0
  1087. package/src/overlays/intl/sl-SI.json +3 -0
  1088. package/src/overlays/intl/sr-SP.json +3 -0
  1089. package/src/overlays/intl/sv-SE.json +3 -0
  1090. package/src/overlays/intl/tr-TR.json +3 -0
  1091. package/src/overlays/intl/uk-UA.json +3 -0
  1092. package/src/overlays/intl/zh-CN.json +3 -0
  1093. package/src/overlays/intl/zh-TW.json +3 -0
  1094. package/src/popover/calculatePosition.ts +21 -3
  1095. package/src/popover/createOverlayPosition.ts +149 -41
  1096. package/src/popover/createPopover.ts +88 -23
  1097. package/src/progress/createProgressBar.ts +19 -4
  1098. package/src/radio/createRadio.ts +80 -25
  1099. package/src/radio/createRadioGroup.ts +47 -13
  1100. package/src/searchfield/createSearchField.ts +31 -2
  1101. package/src/searchfield/intl/ar-AE.json +3 -0
  1102. package/src/searchfield/intl/bg-BG.json +3 -0
  1103. package/src/searchfield/intl/cs-CZ.json +3 -0
  1104. package/src/searchfield/intl/da-DK.json +3 -0
  1105. package/src/searchfield/intl/de-DE.json +3 -0
  1106. package/src/searchfield/intl/el-GR.json +3 -0
  1107. package/src/searchfield/intl/en-US.json +3 -0
  1108. package/src/searchfield/intl/es-ES.json +3 -0
  1109. package/src/searchfield/intl/et-EE.json +3 -0
  1110. package/src/searchfield/intl/fi-FI.json +3 -0
  1111. package/src/searchfield/intl/fr-FR.json +3 -0
  1112. package/src/searchfield/intl/he-IL.json +3 -0
  1113. package/src/searchfield/intl/hr-HR.json +3 -0
  1114. package/src/searchfield/intl/hu-HU.json +3 -0
  1115. package/src/searchfield/intl/index.ts +122 -0
  1116. package/src/searchfield/intl/it-IT.json +3 -0
  1117. package/src/searchfield/intl/ja-JP.json +3 -0
  1118. package/src/searchfield/intl/ko-KR.json +3 -0
  1119. package/src/searchfield/intl/lt-LT.json +3 -0
  1120. package/src/searchfield/intl/lv-LV.json +3 -0
  1121. package/src/searchfield/intl/nb-NO.json +3 -0
  1122. package/src/searchfield/intl/nl-NL.json +3 -0
  1123. package/src/searchfield/intl/pl-PL.json +3 -0
  1124. package/src/searchfield/intl/pt-BR.json +3 -0
  1125. package/src/searchfield/intl/pt-PT.json +3 -0
  1126. package/src/searchfield/intl/ro-RO.json +3 -0
  1127. package/src/searchfield/intl/ru-RU.json +3 -0
  1128. package/src/searchfield/intl/sk-SK.json +3 -0
  1129. package/src/searchfield/intl/sl-SI.json +3 -0
  1130. package/src/searchfield/intl/sr-SP.json +3 -0
  1131. package/src/searchfield/intl/sv-SE.json +3 -0
  1132. package/src/searchfield/intl/tr-TR.json +3 -0
  1133. package/src/searchfield/intl/uk-UA.json +3 -0
  1134. package/src/searchfield/intl/zh-CN.json +3 -0
  1135. package/src/searchfield/intl/zh-TW.json +3 -0
  1136. package/src/select/createHiddenSelect.tsx +166 -69
  1137. package/src/select/createSelect.ts +80 -34
  1138. package/src/selection/DOMLayoutDelegate.ts +14 -0
  1139. package/src/selection/ListKeyboardDelegate.ts +16 -1
  1140. package/src/selection/constants.ts +14 -0
  1141. package/src/selection/createCollectionRowInteraction.ts +75 -6
  1142. package/src/selection/createScrollIntoViewOnFocus.ts +23 -8
  1143. package/src/selection/createSelectableCollection.ts +352 -226
  1144. package/src/selection/createSelectableItem.ts +51 -12
  1145. package/src/selection/createSelectableList.ts +21 -1
  1146. package/src/selection/createTypeSelect.ts +21 -5
  1147. package/src/selection/selectItem.ts +14 -0
  1148. package/src/selection/utils.ts +15 -1
  1149. package/src/separator/createSeparator.ts +17 -1
  1150. package/src/slider/createSlider.ts +24 -18
  1151. package/src/spinbutton/createSpinButton.ts +16 -2
  1152. package/src/spinbutton/index.ts +2 -10
  1153. package/src/spinbutton/intl.ts +70 -34
  1154. package/src/ssr/index.tsx +79 -48
  1155. package/src/steplist/createStepList.ts +17 -2
  1156. package/src/switch/createSwitch.ts +25 -4
  1157. package/src/table/createTable.ts +104 -52
  1158. package/src/table/createTableCell.ts +17 -2
  1159. package/src/table/createTableColumnHeader.ts +21 -3
  1160. package/src/table/createTableColumnResize.ts +19 -3
  1161. package/src/table/createTableHeaderRow.ts +17 -2
  1162. package/src/table/createTableRow.ts +29 -22
  1163. package/src/table/createTableRowGroup.ts +18 -3
  1164. package/src/table/createTableSelectAllCheckbox.ts +30 -14
  1165. package/src/table/createTableSelectionCheckbox.ts +21 -3
  1166. package/src/table/index.ts +2 -2
  1167. package/src/table/intl/ar-AE.json +13 -0
  1168. package/src/table/intl/bg-BG.json +13 -0
  1169. package/src/table/intl/cs-CZ.json +13 -0
  1170. package/src/table/intl/da-DK.json +13 -0
  1171. package/src/table/intl/de-DE.json +13 -0
  1172. package/src/table/intl/el-GR.json +13 -0
  1173. package/src/table/intl/en-US.json +13 -0
  1174. package/src/table/intl/es-ES.json +13 -0
  1175. package/src/table/intl/et-EE.json +13 -0
  1176. package/src/table/intl/fi-FI.json +13 -0
  1177. package/src/table/intl/fr-FR.json +13 -0
  1178. package/src/table/intl/he-IL.json +13 -0
  1179. package/src/table/intl/hr-HR.json +13 -0
  1180. package/src/table/intl/hu-HU.json +13 -0
  1181. package/src/table/intl/index.ts +132 -0
  1182. package/src/table/intl/it-IT.json +13 -0
  1183. package/src/table/intl/ja-JP.json +13 -0
  1184. package/src/table/intl/ko-KR.json +13 -0
  1185. package/src/table/intl/lt-LT.json +13 -0
  1186. package/src/table/intl/lv-LV.json +13 -0
  1187. package/src/table/intl/nb-NO.json +13 -0
  1188. package/src/table/intl/nl-NL.json +13 -0
  1189. package/src/table/intl/pl-PL.json +13 -0
  1190. package/src/table/intl/pt-BR.json +13 -0
  1191. package/src/table/intl/pt-PT.json +13 -0
  1192. package/src/table/intl/ro-RO.json +13 -0
  1193. package/src/table/intl/ru-RU.json +13 -0
  1194. package/src/table/intl/sk-SK.json +13 -0
  1195. package/src/table/intl/sl-SI.json +13 -0
  1196. package/src/table/intl/sr-SP.json +13 -0
  1197. package/src/table/intl/sv-SE.json +13 -0
  1198. package/src/table/intl/tr-TR.json +13 -0
  1199. package/src/table/intl/uk-UA.json +13 -0
  1200. package/src/table/intl/zh-CN.json +13 -0
  1201. package/src/table/intl/zh-TW.json +13 -0
  1202. package/src/table/types.ts +44 -2
  1203. package/src/table/utils.ts +15 -6
  1204. package/src/tabs/createTabs.ts +104 -37
  1205. package/src/tag/createTag.ts +118 -37
  1206. package/src/tag/createTagGroup.ts +20 -12
  1207. package/src/tag/intl/ar-AE.json +4 -0
  1208. package/src/tag/intl/bg-BG.json +4 -0
  1209. package/src/tag/intl/cs-CZ.json +4 -0
  1210. package/src/tag/intl/da-DK.json +4 -0
  1211. package/src/tag/intl/de-DE.json +4 -0
  1212. package/src/tag/intl/el-GR.json +4 -0
  1213. package/src/tag/intl/en-US.json +4 -0
  1214. package/src/tag/intl/es-ES.json +4 -0
  1215. package/src/tag/intl/et-EE.json +4 -0
  1216. package/src/tag/intl/fi-FI.json +4 -0
  1217. package/src/tag/intl/fr-FR.json +4 -0
  1218. package/src/tag/intl/he-IL.json +4 -0
  1219. package/src/tag/intl/hr-HR.json +4 -0
  1220. package/src/tag/intl/hu-HU.json +4 -0
  1221. package/src/tag/intl/index.ts +123 -0
  1222. package/src/tag/intl/it-IT.json +4 -0
  1223. package/src/tag/intl/ja-JP.json +4 -0
  1224. package/src/tag/intl/ko-KR.json +4 -0
  1225. package/src/tag/intl/lt-LT.json +4 -0
  1226. package/src/tag/intl/lv-LV.json +4 -0
  1227. package/src/tag/intl/nb-NO.json +4 -0
  1228. package/src/tag/intl/nl-NL.json +4 -0
  1229. package/src/tag/intl/pl-PL.json +4 -0
  1230. package/src/tag/intl/pt-BR.json +4 -0
  1231. package/src/tag/intl/pt-PT.json +4 -0
  1232. package/src/tag/intl/ro-RO.json +4 -0
  1233. package/src/tag/intl/ru-RU.json +4 -0
  1234. package/src/tag/intl/sk-SK.json +4 -0
  1235. package/src/tag/intl/sl-SI.json +4 -0
  1236. package/src/tag/intl/sr-SP.json +4 -0
  1237. package/src/tag/intl/sv-SE.json +4 -0
  1238. package/src/tag/intl/tr-TR.json +4 -0
  1239. package/src/tag/intl/uk-UA.json +4 -0
  1240. package/src/tag/intl/zh-CN.json +4 -0
  1241. package/src/tag/intl/zh-TW.json +4 -0
  1242. package/src/textfield/createTextField.ts +104 -14
  1243. package/src/toast/createToast.ts +39 -6
  1244. package/src/toast/createToastRegion.ts +28 -15
  1245. package/src/toast/intl/ar-AE.json +4 -0
  1246. package/src/toast/intl/bg-BG.json +4 -0
  1247. package/src/toast/intl/cs-CZ.json +4 -0
  1248. package/src/toast/intl/da-DK.json +4 -0
  1249. package/src/toast/intl/de-DE.json +4 -0
  1250. package/src/toast/intl/el-GR.json +4 -0
  1251. package/src/toast/intl/en-US.json +4 -0
  1252. package/src/toast/intl/es-ES.json +4 -0
  1253. package/src/toast/intl/et-EE.json +4 -0
  1254. package/src/toast/intl/fi-FI.json +4 -0
  1255. package/src/toast/intl/fr-FR.json +4 -0
  1256. package/src/toast/intl/he-IL.json +4 -0
  1257. package/src/toast/intl/hr-HR.json +4 -0
  1258. package/src/toast/intl/hu-HU.json +4 -0
  1259. package/src/toast/intl/index.ts +123 -0
  1260. package/src/toast/intl/it-IT.json +4 -0
  1261. package/src/toast/intl/ja-JP.json +4 -0
  1262. package/src/toast/intl/ko-KR.json +4 -0
  1263. package/src/toast/intl/lt-LT.json +4 -0
  1264. package/src/toast/intl/lv-LV.json +4 -0
  1265. package/src/toast/intl/nb-NO.json +4 -0
  1266. package/src/toast/intl/nl-NL.json +4 -0
  1267. package/src/toast/intl/pl-PL.json +4 -0
  1268. package/src/toast/intl/pt-BR.json +4 -0
  1269. package/src/toast/intl/pt-PT.json +4 -0
  1270. package/src/toast/intl/ro-RO.json +4 -0
  1271. package/src/toast/intl/ru-RU.json +4 -0
  1272. package/src/toast/intl/sk-SK.json +4 -0
  1273. package/src/toast/intl/sl-SI.json +4 -0
  1274. package/src/toast/intl/sr-SP.json +4 -0
  1275. package/src/toast/intl/sv-SE.json +4 -0
  1276. package/src/toast/intl/tr-TR.json +4 -0
  1277. package/src/toast/intl/uk-UA.json +4 -0
  1278. package/src/toast/intl/zh-CN.json +4 -0
  1279. package/src/toast/intl/zh-TW.json +4 -0
  1280. package/src/toggle/createToggle.ts +96 -15
  1281. package/src/tokenfield/createToken.ts +82 -0
  1282. package/src/tokenfield/createTokenField.ts +859 -0
  1283. package/src/tokenfield/index.ts +10 -0
  1284. package/src/toolbar/createToolbar.ts +26 -5
  1285. package/src/tooltip/createPreviewTrigger.ts +301 -0
  1286. package/src/tooltip/createSafeArea.ts +165 -0
  1287. package/src/tooltip/createTooltip.ts +15 -1
  1288. package/src/tooltip/createTooltipTrigger.ts +24 -3
  1289. package/src/tooltip/index.ts +7 -0
  1290. package/src/tooltip/intl/index.ts +76 -0
  1291. package/src/tree/createTree.ts +66 -50
  1292. package/src/tree/createTreeItem.ts +85 -21
  1293. package/src/tree/createTreeSelectionCheckbox.ts +29 -28
  1294. package/src/tree/intl/ar-AE.json +4 -0
  1295. package/src/tree/intl/bg-BG.json +4 -0
  1296. package/src/tree/intl/cs-CZ.json +4 -0
  1297. package/src/tree/intl/da-DK.json +4 -0
  1298. package/src/tree/intl/de-DE.json +4 -0
  1299. package/src/tree/intl/el-GR.json +4 -0
  1300. package/src/tree/intl/en-US.json +4 -0
  1301. package/src/tree/intl/es-ES.json +4 -0
  1302. package/src/tree/intl/et-EE.json +4 -0
  1303. package/src/tree/intl/fi-FI.json +4 -0
  1304. package/src/tree/intl/fr-FR.json +4 -0
  1305. package/src/tree/intl/he-IL.json +4 -0
  1306. package/src/tree/intl/hr-HR.json +4 -0
  1307. package/src/tree/intl/hu-HU.json +4 -0
  1308. package/src/tree/intl/index.ts +123 -0
  1309. package/src/tree/intl/it-IT.json +4 -0
  1310. package/src/tree/intl/ja-JP.json +4 -0
  1311. package/src/tree/intl/ko-KR.json +4 -0
  1312. package/src/tree/intl/lt-LT.json +4 -0
  1313. package/src/tree/intl/lv-LV.json +4 -0
  1314. package/src/tree/intl/nb-NO.json +4 -0
  1315. package/src/tree/intl/nl-NL.json +4 -0
  1316. package/src/tree/intl/pl-PL.json +4 -0
  1317. package/src/tree/intl/pt-BR.json +4 -0
  1318. package/src/tree/intl/pt-PT.json +4 -0
  1319. package/src/tree/intl/ro-RO.json +4 -0
  1320. package/src/tree/intl/ru-RU.json +4 -0
  1321. package/src/tree/intl/sk-SK.json +4 -0
  1322. package/src/tree/intl/sl-SI.json +4 -0
  1323. package/src/tree/intl/sr-SP.json +4 -0
  1324. package/src/tree/intl/sv-SE.json +4 -0
  1325. package/src/tree/intl/tr-TR.json +4 -0
  1326. package/src/tree/intl/uk-UA.json +4 -0
  1327. package/src/tree/intl/zh-CN.json +4 -0
  1328. package/src/tree/intl/zh-TW.json +4 -0
  1329. package/src/tree/types.ts +35 -2
  1330. package/src/utils/ShadowTreeWalker.ts +249 -0
  1331. package/src/utils/animation.ts +106 -85
  1332. package/src/utils/capture.ts +51 -0
  1333. package/src/utils/createDescription.ts +31 -8
  1334. package/src/utils/dom.ts +314 -33
  1335. package/src/utils/domAttrs.ts +84 -0
  1336. package/src/utils/env.ts +2 -0
  1337. package/src/utils/events.ts +39 -3
  1338. package/src/utils/filterDOMProps.ts +34 -2
  1339. package/src/utils/focus.ts +186 -32
  1340. package/src/utils/geometry.ts +15 -1
  1341. package/src/utils/getMetaValue.ts +57 -0
  1342. package/src/utils/getNonce.ts +40 -0
  1343. package/src/utils/globalListeners.ts +16 -3
  1344. package/src/utils/index.ts +14 -0
  1345. package/src/utils/keyboard.ts +15 -1
  1346. package/src/utils/mergeProps.ts +149 -16
  1347. package/src/utils/owner.ts +26 -0
  1348. package/src/utils/platform.ts +15 -1
  1349. package/src/utils/reactivity.ts +2 -0
  1350. package/src/utils/refs.ts +53 -0
  1351. package/src/utils/runAfterTransition.ts +117 -0
  1352. package/src/utils/scrollIntoView.ts +14 -0
  1353. package/src/utils/splitProps.ts +70 -0
  1354. package/src/utils/textSelection.ts +15 -1
  1355. package/src/virtualizer/ScrollView.ts +210 -0
  1356. package/src/virtualizer/index.ts +2 -0
  1357. package/src/virtualizer/utils.ts +100 -0
  1358. package/src/visually-hidden/createVisuallyHidden.ts +20 -4
  1359. package/dist/_chunk/createInteractionModality.js +0 -268
  1360. package/dist/_chunk/createInteractionModality.js.map +0 -1
  1361. package/dist/_chunk/createInteractionModality.jsx +0 -268
  1362. package/dist/_chunk/createInteractionModality.jsx.map +0 -1
  1363. package/dist/_chunk/focus2.js +0 -631
  1364. package/dist/_chunk/focus2.js.map +0 -1
  1365. package/dist/_chunk/focus2.jsx +0 -631
  1366. package/dist/_chunk/focus2.jsx.map +0 -1
  1367. package/dist/_chunk/visually-hidden.js.map +0 -1
  1368. package/dist/_chunk/visually-hidden.jsx.map +0 -1
  1369. package/dist/checkbox/createCheckboxGroupState.d.ts +0 -71
  1370. package/dist/checkbox/createCheckboxGroupState.d.ts.map +0 -1
  1371. package/dist/radio/createRadioGroupState.d.ts +0 -77
  1372. package/dist/radio/createRadioGroupState.d.ts.map +0 -1
  1373. package/dist/toggle/createToggleState.d.ts +0 -34
  1374. package/dist/toggle/createToggleState.d.ts.map +0 -1
  1375. package/src/checkbox/createCheckboxGroupState.ts +0 -174
  1376. package/src/radio/createRadioGroupState.ts +0 -177
  1377. package/src/toggle/createToggleState.ts +0 -86
@@ -1,11 +1,25 @@
1
- import { g as isTabbable, i as getActiveElement, o as getFocusableTreeWalker, p as isFocusable, s as getOwnerDocument, t as focusSafely } from "./focus.jsx";
2
- import { createContext, createEffect, createSignal, onCleanup, onMount, useContext } from "solid-js";
3
- import { isServer } from "solid-js/web";
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/focus/FocusScope.tsx
13
+ import { n as useContextOptional, t as onOwnedCleanup } from "./owner.jsx";
14
+ import { D as runAfterPaint, T as focusWithoutScrolling, a as getOwnerDocument, f as isFocusable, h as isTabbable, i as getFocusableTreeWalker, n as getActiveElement, w as focusSafely } from "./dom.jsx";
15
+ import { createContext, createEffect, createSignal, onSettled } from "solid-js";
16
+ import { isServer } from "@solidjs/web";
4
17
  //#region src/focus/FocusScope.tsx
5
18
  /**
6
19
  * FocusScope component for managing focus containment, restoration, and auto-focus.
7
- * Based on @react-aria/focus FocusScope.
20
+ * Ported from packages/react-aria/src/focus/FocusScope.tsx.
8
21
  */
22
+ const RESTORE_FOCUS_EVENT = "react-aria-focus-scope-restore";
9
23
  /**
10
24
  * Walks a TreeWalker to its final (deepest-last) node, mirroring the `last`
11
25
  * helper in @react-aria/focus.
@@ -101,7 +115,7 @@ const FocusScopeContext = createContext(null);
101
115
  * a FocusScope, e.g. in response to user events like keyboard navigation.
102
116
  */
103
117
  function useFocusManager() {
104
- return useContext(FocusScopeContext)?.focusManager;
118
+ return useContextOptional(FocusScopeContext)?.focusManager;
105
119
  }
106
120
  /**
107
121
  * Gets all focusable elements within a scope.
@@ -127,14 +141,45 @@ function isElementInScope(element, scope) {
127
141
  return scope.some((node) => node.contains(element));
128
142
  }
129
143
  /**
130
- * A registry of the live FocusScopes and their parent/child relationships,
131
- * mirroring @react-aria/focus's `focusScopeTree`. The DOM tree alone can't
132
- * express scope nesting because a child scope (e.g. a menu opened from inside a
133
- * modal popover) is rendered in a portal, outside its parent scope's subtree.
134
- * The tree records that nesting so containment can recognize a portaled
135
- * descendant scope as "inside".
144
+ * Auto-focus target for a scope. Mirrors @react-aria/focus `getFirstInScope`:
145
+ * prefer a tabbable node, then fall back to the first focusable node (e.g. a
146
+ * `tabIndex={-1}` overlay root) when nothing is tabbable yet.
147
+ */
148
+ function firstInScope(scope) {
149
+ return getFocusableElements(scope, true)[0] ?? getFocusableElements(scope, false)[0] ?? null;
150
+ }
151
+ function focusFirstInScope(scope) {
152
+ const target = firstInScope(scope);
153
+ if (target) focusSafely(target);
154
+ }
155
+ function restoreFocusToElement(node) {
156
+ if (node.dispatchEvent(new CustomEvent(RESTORE_FOCUS_EVENT, {
157
+ bubbles: true,
158
+ cancelable: true
159
+ }))) focusWithoutScrolling(node);
160
+ }
161
+ /**
162
+ * Collects the element siblings between FocusScope sentinels. React's
163
+ * FocusScope re-runs this in `useLayoutEffect` on every render; Solid only
164
+ * re-runs the component body once, so callers must re-collect when the DOM
165
+ * between the sentinels changes (portaled overlay children, delayed collections).
136
166
  */
137
- var FocusScopeTree = class {
167
+ function collectScopeElements(start, end) {
168
+ if (!start || !end) return [];
169
+ const nodes = [];
170
+ let node = start.nextSibling;
171
+ while (node && node !== end) {
172
+ if (node.nodeType === Node.ELEMENT_NODE) nodes.push(node);
173
+ node = node.nextSibling;
174
+ }
175
+ return nodes;
176
+ }
177
+ function sameElements(a, b) {
178
+ if (a.length !== b.length) return false;
179
+ for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
180
+ return true;
181
+ }
182
+ const focusScopeTree = new class FocusScopeTree {
138
183
  root;
139
184
  fastMap = /* @__PURE__ */ new Map();
140
185
  constructor() {
@@ -148,13 +193,14 @@ var FocusScopeTree = class {
148
193
  getTreeNode(scopeRef) {
149
194
  return this.fastMap.get(scopeRef);
150
195
  }
151
- addTreeNode(scopeRef, parent) {
196
+ addTreeNode(scopeRef, parent, nodeToRestore) {
152
197
  const parentNode = this.fastMap.get(parent) ?? this.root;
153
198
  const node = {
154
199
  scopeRef,
155
200
  parent: parentNode,
156
201
  children: /* @__PURE__ */ new Set()
157
202
  };
203
+ if (nodeToRestore) node.nodeToRestore = nodeToRestore;
158
204
  parentNode.children.add(node);
159
205
  this.fastMap.set(scopeRef, node);
160
206
  }
@@ -172,12 +218,31 @@ var FocusScopeTree = class {
172
218
  }
173
219
  this.fastMap.delete(scopeRef);
174
220
  }
221
+ clone() {
222
+ const newTree = new FocusScopeTree();
223
+ for (const node of this.traverse()) newTree.addTreeNode(node.scopeRef, node.parent?.scopeRef ?? null, node.nodeToRestore);
224
+ return newTree;
225
+ }
175
226
  *traverse(node = this.root) {
176
227
  if (node.scopeRef != null) yield node;
177
228
  for (const child of node.children) yield* this.traverse(child);
178
229
  }
179
- };
180
- const focusScopeTree = new FocusScopeTree();
230
+ }();
231
+ /**
232
+ * The scope that currently holds focus. Mirrors @react-aria/focus's
233
+ * module-level `activeScope`: focus moving into a child scope makes the child
234
+ * active, moving out to an ancestor does not.
235
+ */
236
+ let activeScope = null;
237
+ /** Whether `ancestor` is above `scope` in the focus-scope tree. */
238
+ function isAncestorScope(ancestor, scope) {
239
+ let parent = focusScopeTree.getTreeNode(scope)?.parent;
240
+ while (parent) {
241
+ if (parent.scopeRef === ancestor) return true;
242
+ parent = parent.parent;
243
+ }
244
+ return false;
245
+ }
181
246
  /**
182
247
  * Whether the element is inside `scope` or any of its descendant scopes.
183
248
  *
@@ -187,10 +252,23 @@ const focusScopeTree = new FocusScopeTree();
187
252
  * counts as "inside". Mirrors @react-aria/focus's `isElementInChildScope`.
188
253
  */
189
254
  function isElementInChildScope(element, scope = null) {
190
- if (element instanceof Element && element.closest("[data-react-aria-top-layer]")) return true;
255
+ if (element instanceof Element && element.closest("[data-solidaria-top-layer]")) return true;
191
256
  for (const node of focusScopeTree.traverse(focusScopeTree.getTreeNode(scope))) if (node.scopeRef && isElementInScope(element, node.scopeRef())) return true;
192
257
  return false;
193
258
  }
259
+ /** Whether the element is inside any registered focus scope. */
260
+ function isElementInAnyScope(element) {
261
+ return isElementInChildScope(element);
262
+ }
263
+ /**
264
+ * Whether the element is inside the active scope or any of its descendant
265
+ * scopes. `createOverlay` uses it to leave an overlay open when focus moves
266
+ * into a child scope (a menu inside a dialog). Mirrors @react-aria/focus's
267
+ * `isElementInChildOfActiveScope`.
268
+ */
269
+ function isElementInChildOfActiveScope(element) {
270
+ return isElementInChildScope(element, activeScope);
271
+ }
194
272
  /**
195
273
  * A FocusScope manages focus for its descendants. It supports containing focus inside
196
274
  * the scope, restoring focus to the previously focused element on unmount, and auto
@@ -199,16 +277,20 @@ function isElementInChildScope(element, scope = null) {
199
277
  * to user events.
200
278
  */
201
279
  const FocusScope = (props) => {
202
- if (isServer) return <>{props.children}</>;
203
- let startRef;
204
- let endRef;
205
- const [scopeElements, setScopeElements] = createSignal([]);
206
- const parentScopeRef = useContext(FocusScopeContext)?.scopeRef ?? null;
280
+ const [startEl, setStartEl] = createSignal(null, { ownedWrite: true });
281
+ const [endEl, setEndEl] = createSignal(null, { ownedWrite: true });
282
+ const [scopeElements, setScopeElements] = createSignal([], { ownedWrite: true });
283
+ const syncScopeElements = () => {
284
+ const next = collectScopeElements(startEl(), endEl());
285
+ if (!sameElements(next, scopeElements())) setScopeElements(next);
286
+ };
287
+ const parentScopeRef = useContextOptional(FocusScopeContext)?.scopeRef ?? null;
207
288
  let nodeToRestore = null;
208
289
  const getRestorableElement = (element, doc) => {
209
290
  if (!element || element === doc.body || element === doc.documentElement) return null;
210
291
  return element;
211
292
  };
293
+ if (props.restoreFocus && !isServer) nodeToRestore = getRestorableElement(getActiveElement(document), document);
212
294
  const focusManager = {
213
295
  focusNext(opts = {}) {
214
296
  const scope = scopeElements();
@@ -219,8 +301,10 @@ const FocusScope = (props) => {
219
301
  const current = from || getActiveElement(doc);
220
302
  if (!current || elements.length === 0) return null;
221
303
  let nextIndex = elements.indexOf(current) + 1;
222
- if (nextIndex >= elements.length) if (wrap) nextIndex = 0;
223
- else return null;
304
+ if (nextIndex >= elements.length) {
305
+ if (wrap) nextIndex = 0;
306
+ else return null;
307
+ }
224
308
  const nextElement = elements[nextIndex];
225
309
  if (nextElement) {
226
310
  focusSafely(nextElement);
@@ -237,8 +321,10 @@ const FocusScope = (props) => {
237
321
  const current = from || getActiveElement(doc);
238
322
  if (!current || elements.length === 0) return null;
239
323
  let prevIndex = elements.indexOf(current) - 1;
240
- if (prevIndex < 0) if (wrap) prevIndex = elements.length - 1;
241
- else return null;
324
+ if (prevIndex < 0) {
325
+ if (wrap) prevIndex = elements.length - 1;
326
+ else return null;
327
+ }
242
328
  const prevElement = elements[prevIndex];
243
329
  if (prevElement) {
244
330
  focusSafely(prevElement);
@@ -270,33 +356,122 @@ const FocusScope = (props) => {
270
356
  return null;
271
357
  }
272
358
  };
273
- onMount(() => {});
274
- onMount(() => {
275
- focusScopeTree.addTreeNode(scopeElements, parentScopeRef);
359
+ createEffect(() => {
360
+ return {
361
+ start: startEl(),
362
+ end: endEl()
363
+ };
364
+ }, ({ start, end }) => {
365
+ if (!start || !end) return;
366
+ syncScopeElements();
367
+ const parent = start.parentNode;
368
+ if (!parent) return;
369
+ const observer = new MutationObserver(() => {
370
+ syncScopeElements();
371
+ });
372
+ observer.observe(parent, { childList: true });
373
+ return () => observer.disconnect();
276
374
  });
277
- onCleanup(() => {
375
+ onSettled(() => {
376
+ let parentScope = parentScopeRef;
377
+ if (focusScopeTree.getTreeNode(parentScope) && activeScope && !isAncestorScope(activeScope, parentScope) && focusScopeTree.getTreeNode(activeScope)) parentScope = activeScope;
378
+ focusScopeTree.addTreeNode(scopeElements, parentScope, nodeToRestore ?? void 0);
379
+ });
380
+ let didActivateOnMount = false;
381
+ createEffect(scopeElements, (scope) => {
382
+ if (didActivateOnMount || scope.length === 0) return;
383
+ didActivateOnMount = true;
384
+ const activeElement = getActiveElement(getOwnerDocument(scope[0]));
385
+ if (!activeElement || !isElementInScope(activeElement, scope)) return;
386
+ let bottomMost = null;
387
+ for (const node of focusScopeTree.traverse()) if (node.scopeRef && isElementInScope(activeElement, node.scopeRef())) bottomMost = node;
388
+ if (bottomMost && bottomMost === focusScopeTree.getTreeNode(scopeElements)) activeScope = bottomMost.scopeRef;
389
+ });
390
+ onOwnedCleanup(() => {
391
+ const parentScope = focusScopeTree.getTreeNode(scopeElements)?.parent?.scopeRef ?? null;
392
+ if ((scopeElements === activeScope || isAncestorScope(scopeElements, activeScope)) && (!parentScope || focusScopeTree.getTreeNode(parentScope))) activeScope = parentScope;
278
393
  focusScopeTree.removeTreeNode(scopeElements);
279
394
  });
280
- onMount(() => {
395
+ onSettled(() => {
281
396
  if (!props.restoreFocus) return;
282
- const scopeDoc = document;
397
+ const persistRestoreTarget = (element) => {
398
+ if (element) nodeToRestore = element;
399
+ const treeNode = focusScopeTree.getTreeNode(scopeElements);
400
+ if (treeNode && nodeToRestore) treeNode.nodeToRestore = nodeToRestore;
401
+ };
402
+ if (nodeToRestore && nodeToRestore.isConnected) {
403
+ persistRestoreTarget(nodeToRestore);
404
+ return;
405
+ }
406
+ const scopeDoc = startEl() ? getOwnerDocument(startEl()) : document;
283
407
  const scopeActive = getActiveElement(scopeDoc);
284
408
  const topActive = getActiveElement(document);
285
- if (scopeDoc !== document && document.activeElement instanceof HTMLIFrameElement && document.activeElement.contentDocument === scopeDoc && scopeActive && scopeActive !== scopeDoc.body) {
286
- nodeToRestore = getRestorableElement(scopeActive, scopeDoc);
409
+ const scope = scopeElements();
410
+ if (scopeDoc !== document && document.activeElement instanceof HTMLIFrameElement && document.activeElement.contentDocument === scopeDoc && scopeActive && scopeActive !== scopeDoc.body && !isElementInScope(scopeActive, scope)) {
411
+ persistRestoreTarget(getRestorableElement(scopeActive, scopeDoc));
287
412
  return;
288
413
  }
289
- nodeToRestore = getRestorableElement(topActive, document);
414
+ const candidate = getRestorableElement(topActive, document);
415
+ if (candidate && !isElementInScope(candidate, scope)) persistRestoreTarget(candidate);
290
416
  });
417
+ let autoFocusStarted = false;
418
+ let cancelAutoFocus;
291
419
  createEffect(() => {
292
- if (!props.autoFocus) return;
420
+ const autoFocus = !!props.autoFocus;
293
421
  const scope = scopeElements();
294
- if (scope.length === 0) return;
295
- if (!isElementInScope(getActiveElement(getOwnerDocument(scope[0])), scope)) focusManager.focusFirst();
422
+ return {
423
+ autoFocus,
424
+ ready: scope.length > 0 && !!firstInScope(scope),
425
+ scope
426
+ };
427
+ }, ({ autoFocus, ready, scope }) => {
428
+ if (!autoFocus || autoFocusStarted || !ready) return;
429
+ autoFocusStarted = true;
430
+ const doc = getOwnerDocument(scope[0]);
431
+ cancelAutoFocus = runAfterPaint(() => {
432
+ cancelAutoFocus = void 0;
433
+ const currentScope = scopeElements();
434
+ if (currentScope.length === 0) return;
435
+ activeScope = scopeElements;
436
+ if (!isElementInScope(getActiveElement(doc), currentScope)) focusFirstInScope(currentScope);
437
+ }, doc);
438
+ });
439
+ onOwnedCleanup(() => {
440
+ cancelAutoFocus?.();
296
441
  });
297
442
  createEffect(() => {
298
- if (!props.contain) return;
299
- const scope = scopeElements();
443
+ return {
444
+ contain: !!props.contain,
445
+ restore: !!props.restoreFocus,
446
+ scope: scopeElements()
447
+ };
448
+ }, ({ contain, restore, scope }) => {
449
+ if (contain || scope.length === 0) return;
450
+ const doc = getOwnerDocument(scope[0]);
451
+ const onFocus = (e) => {
452
+ const target = e.target;
453
+ if (restore) {
454
+ if ((!activeScope || isAncestorScope(activeScope, scopeElements)) && isElementInScope(getActiveElement(doc), scopeElements())) activeScope = scopeElements;
455
+ return;
456
+ }
457
+ if (isElementInScope(target, scopeElements())) activeScope = scopeElements;
458
+ else if (!isElementInAnyScope(target)) activeScope = null;
459
+ };
460
+ const onFocusListener = onFocus;
461
+ doc.addEventListener("focusin", onFocus, false);
462
+ for (const element of scope) element.addEventListener("focusin", onFocusListener, false);
463
+ return () => {
464
+ doc.removeEventListener("focusin", onFocus, false);
465
+ for (const element of scope) element.removeEventListener("focusin", onFocusListener, false);
466
+ };
467
+ });
468
+ createEffect(() => {
469
+ return {
470
+ contain: !!props.contain,
471
+ scope: scopeElements()
472
+ };
473
+ }, ({ contain, scope }) => {
474
+ if (!contain) return;
300
475
  if (scope.length === 0) return;
301
476
  const doc = getOwnerDocument(scope[0]);
302
477
  let focusedNode = null;
@@ -320,8 +495,11 @@ const FocusScope = (props) => {
320
495
  const onFocusIn = (e) => {
321
496
  const scope = scopeElements();
322
497
  const target = e.target;
323
- if (isElementInScope(target, scope)) focusedNode = target;
324
- else if (isElementInChildScope(target, scopeElements)) focusedNode = target;
498
+ if (isElementInScope(target, scope)) {
499
+ if (!activeScope || isAncestorScope(activeScope, scopeElements)) activeScope = scopeElements;
500
+ focusedNode = target;
501
+ } else if (isElementInChildScope(target, scopeElements)) focusedNode = target;
502
+ else if (target === doc.body || target === doc.documentElement) return;
325
503
  else if (focusedNode) focusSafely(focusedNode);
326
504
  else focusManager.focusFirst();
327
505
  };
@@ -345,31 +523,72 @@ const FocusScope = (props) => {
345
523
  doc.addEventListener("keydown", onKeyDown, true);
346
524
  doc.addEventListener("focusin", onFocusIn, true);
347
525
  doc.addEventListener("focusout", onFocusOut, true);
348
- onCleanup(() => {
526
+ return () => {
349
527
  doc.removeEventListener("keydown", onKeyDown, true);
350
528
  doc.removeEventListener("focusin", onFocusIn, true);
351
529
  doc.removeEventListener("focusout", onFocusOut, true);
352
530
  if (restoreRaf != null) (doc.defaultView ?? window).cancelAnimationFrame(restoreRaf);
353
- });
531
+ };
354
532
  });
355
- onCleanup(() => {
356
- if (props.restoreFocus && nodeToRestore && nodeToRestore.focus) {
357
- const doc = getOwnerDocument(nodeToRestore);
358
- (doc.defaultView ?? window).requestAnimationFrame(() => {
359
- if (nodeToRestore && doc.body.contains(nodeToRestore)) nodeToRestore.focus();
360
- });
361
- }
533
+ onOwnedCleanup(() => {
534
+ if (!props.restoreFocus) return;
535
+ const saved = focusScopeTree.getTreeNode(scopeElements)?.nodeToRestore ?? nodeToRestore;
536
+ if (!saved) return;
537
+ const scope = scopeElements();
538
+ const scopeDoc = getOwnerDocument(scope[0] ?? startEl() ?? saved);
539
+ const clonedTree = focusScopeTree.clone();
540
+ const win = scopeDoc.defaultView ?? window;
541
+ const restoreToParentScope = () => {
542
+ if (parentScopeRef) {
543
+ const first = firstInScope(parentScopeRef());
544
+ if (first) {
545
+ restoreFocusToElement(first);
546
+ return true;
547
+ }
548
+ }
549
+ let node = clonedTree.getTreeNode(scopeElements)?.parent ?? null;
550
+ while (node) {
551
+ if (node.scopeRef && focusScopeTree.getTreeNode(node.scopeRef)) {
552
+ const first = firstInScope(node.scopeRef());
553
+ if (first) {
554
+ restoreFocusToElement(first);
555
+ return true;
556
+ }
557
+ }
558
+ node = node.parent;
559
+ }
560
+ return false;
561
+ };
562
+ const tryRestore = () => {
563
+ const active = scopeDoc.activeElement;
564
+ if (active && active !== scopeDoc.body && active !== scopeDoc.documentElement && active.isConnected) return;
565
+ if (saved && saved.isConnected) {
566
+ restoreFocusToElement(saved);
567
+ return;
568
+ }
569
+ let node = clonedTree.getTreeNode(scopeElements);
570
+ while (node) {
571
+ if (node.nodeToRestore && node.nodeToRestore.isConnected && node.scopeRef !== scopeElements) {
572
+ restoreFocusToElement(node.nodeToRestore);
573
+ return;
574
+ }
575
+ node = node.parent;
576
+ }
577
+ restoreToParentScope();
578
+ };
579
+ tryRestore();
580
+ win.requestAnimationFrame(tryRestore);
362
581
  });
363
- return <FocusScopeContext.Provider value={{
582
+ return <FocusScopeContext value={{
364
583
  focusManager,
365
584
  scopeRef: scopeElements
366
585
  }}>
367
- <span data-focus-scope-start hidden ref={startRef} />
586
+ <span data-focus-scope-start hidden ref={(el) => setStartEl(el ?? null)} />
368
587
  {props.children}
369
- <span data-focus-scope-end hidden ref={endRef} />
370
- </FocusScopeContext.Provider>;
588
+ <span data-focus-scope-end hidden ref={(el) => setEndEl(el ?? null)} />
589
+ </FocusScopeContext>;
371
590
  };
372
591
  //#endregion
373
- export { createFocusManager as n, useFocusManager as r, FocusScope as t };
592
+ export { useFocusManager as i, createFocusManager as n, isElementInChildOfActiveScope as r, FocusScope as t };
374
593
 
375
594
  //# sourceMappingURL=FocusScope.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusScope.jsx","names":[],"sources":["../../src/focus/FocusScope.tsx"],"sourcesContent":["/**\n * FocusScope component for managing focus containment, restoration, and auto-focus.\n * Based on @react-aria/focus FocusScope.\n */\n\nimport {\n createContext,\n useContext,\n createEffect,\n onCleanup,\n type JSX,\n type Accessor,\n type ParentComponent,\n createSignal,\n onMount,\n} from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport {\n getOwnerDocument,\n isFocusable,\n isTabbable,\n getFocusableTreeWalker,\n getActiveElement,\n} from \"../utils\";\nimport { focusSafely } from \"../utils/focus\";\n\nexport interface FocusScopeProps {\n /** The contents of the focus scope. */\n children: JSX.Element;\n /**\n * Whether to contain focus inside the scope, so users cannot\n * move focus outside, for example in a modal dialog.\n */\n contain?: boolean;\n /**\n * Whether to restore focus back to the element that was focused\n * when the focus scope mounted, after the focus scope unmounts.\n */\n restoreFocus?: boolean;\n /** Whether to auto focus the first focusable element in the focus scope on mount. */\n autoFocus?: boolean;\n}\n\nexport interface FocusManagerOptions {\n /** The element to start searching from. The currently focused element by default. */\n from?: Element;\n /** Whether to only include tabbable elements, or all focusable elements. */\n tabbable?: boolean;\n /** Whether focus should wrap around when it reaches the end of the scope. */\n wrap?: boolean;\n /** A callback that determines whether the given element is focused. */\n accept?: (node: Element) => boolean;\n}\n\nexport interface FocusManager {\n /** Moves focus to the next focusable or tabbable element in the focus scope. */\n focusNext(opts?: FocusManagerOptions): HTMLElement | null;\n /** Moves focus to the previous focusable or tabbable element in the focus scope. */\n focusPrevious(opts?: FocusManagerOptions): HTMLElement | null;\n /** Moves focus to the first focusable or tabbable element in the focus scope. */\n focusFirst(opts?: FocusManagerOptions): HTMLElement | null;\n /** Moves focus to the last focusable or tabbable element in the focus scope. */\n focusLast(opts?: FocusManagerOptions): HTMLElement | null;\n}\n\ninterface FocusScopeContextValue {\n focusManager: FocusManager;\n scopeRef: Accessor<Element[]>;\n}\n\n/**\n * Walks a TreeWalker to its final (deepest-last) node, mirroring the `last`\n * helper in @react-aria/focus.\n */\nfunction lastFocusable(walker: TreeWalker): HTMLElement | null {\n let next: HTMLElement | undefined;\n let last: Node | null;\n do {\n last = walker.lastChild();\n if (last) {\n next = last as HTMLElement;\n }\n } while (last);\n return next ?? null;\n}\n\n/**\n * Creates a FocusManager rooted at the given ref element, independent of any\n * FocusScope. Mirrors @react-aria/focus's `createFocusManager`: it walks the\n * focusable tree with `getFocusableTreeWalker` so segment/spinbutton navigation\n * inside a date field group behaves exactly like upstream.\n */\nexport function createFocusManager(\n ref: () => HTMLElement | null | undefined,\n defaultOptions: FocusManagerOptions = {},\n): FocusManager {\n return {\n focusNext(opts: FocusManagerOptions = {}) {\n const root = ref();\n if (!root) return null;\n const {\n from,\n tabbable = defaultOptions.tabbable,\n wrap = defaultOptions.wrap,\n accept = defaultOptions.accept,\n } = opts;\n const node = from || getActiveElement(getOwnerDocument(root));\n const walker = getFocusableTreeWalker(root, { tabbable, accept });\n if (node && root.contains(node)) {\n walker.currentNode = node;\n }\n let nextNode = walker.nextNode() as HTMLElement | null;\n if (!nextNode && wrap) {\n walker.currentNode = root;\n nextNode = walker.nextNode() as HTMLElement | null;\n }\n if (nextNode) {\n focusSafely(nextNode);\n }\n return nextNode;\n },\n\n focusPrevious(opts: FocusManagerOptions = {}) {\n const root = ref();\n if (!root) return null;\n const {\n from,\n tabbable = defaultOptions.tabbable,\n wrap = defaultOptions.wrap,\n accept = defaultOptions.accept,\n } = opts;\n const node = from || getActiveElement(getOwnerDocument(root));\n const walker = getFocusableTreeWalker(root, { tabbable, accept });\n if (node && root.contains(node)) {\n walker.currentNode = node;\n } else {\n const next = lastFocusable(walker);\n if (next) {\n focusSafely(next);\n }\n return next;\n }\n let previousNode = walker.previousNode() as HTMLElement | null;\n if (!previousNode && wrap) {\n walker.currentNode = root;\n const lastNode = lastFocusable(walker);\n if (!lastNode) {\n return null;\n }\n previousNode = lastNode;\n }\n if (previousNode) {\n focusSafely(previousNode);\n }\n return previousNode;\n },\n\n focusFirst(opts: FocusManagerOptions = {}) {\n const root = ref();\n if (!root) return null;\n const { tabbable = defaultOptions.tabbable, accept = defaultOptions.accept } = opts;\n const walker = getFocusableTreeWalker(root, { tabbable, accept });\n const nextNode = walker.nextNode() as HTMLElement | null;\n if (nextNode) {\n focusSafely(nextNode);\n }\n return nextNode;\n },\n\n focusLast(opts: FocusManagerOptions = {}) {\n const root = ref();\n if (!root) return null;\n const { tabbable = defaultOptions.tabbable, accept = defaultOptions.accept } = opts;\n const walker = getFocusableTreeWalker(root, { tabbable, accept });\n const next = lastFocusable(walker);\n if (next) {\n focusSafely(next);\n }\n return next;\n },\n };\n}\n\nconst FocusScopeContext = createContext<FocusScopeContextValue | null>(null);\n\n/**\n * Returns a FocusManager interface for the parent FocusScope.\n * A FocusManager can be used to programmatically move focus within\n * a FocusScope, e.g. in response to user events like keyboard navigation.\n */\nexport function useFocusManager(): FocusManager | undefined {\n return useContext(FocusScopeContext)?.focusManager;\n}\n\n/**\n * Gets all focusable elements within a scope.\n */\nfunction getFocusableElements(scope: Element[], tabbable = false): HTMLElement[] {\n const elements: HTMLElement[] = [];\n const filter = tabbable ? isTabbable : isFocusable;\n\n for (const scopeElement of scope) {\n // Check the element itself\n if (filter(scopeElement)) {\n elements.push(scopeElement as HTMLElement);\n }\n\n // Check all descendants\n const descendants = scopeElement.querySelectorAll(\"*\");\n for (let i = 0; i < descendants.length; i++) {\n const el = descendants[i];\n if (filter(el)) {\n elements.push(el as HTMLElement);\n }\n }\n }\n\n return elements;\n}\n\n/**\n * Checks if an element is within a scope.\n */\nfunction isElementInScope(element: Element | null, scope: Element[]): boolean {\n if (!element) return false;\n return scope.some((node) => node.contains(element));\n}\n\n/**\n * A scope is identified by its (stable) scope-elements accessor; `null` is the\n * tree root. Mirrors @react-aria/focus's `ScopeRef`.\n */\ntype ScopeRef = Accessor<Element[]> | null;\n\ninterface FocusScopeTreeNode {\n scopeRef: ScopeRef;\n parent: FocusScopeTreeNode | null;\n children: Set<FocusScopeTreeNode>;\n}\n\n/**\n * A registry of the live FocusScopes and their parent/child relationships,\n * mirroring @react-aria/focus's `focusScopeTree`. The DOM tree alone can't\n * express scope nesting because a child scope (e.g. a menu opened from inside a\n * modal popover) is rendered in a portal, outside its parent scope's subtree.\n * The tree records that nesting so containment can recognize a portaled\n * descendant scope as \"inside\".\n */\nclass FocusScopeTree {\n root: FocusScopeTreeNode;\n private fastMap = new Map<ScopeRef, FocusScopeTreeNode>();\n\n constructor() {\n this.root = { scopeRef: null, parent: null, children: new Set() };\n this.fastMap.set(null, this.root);\n }\n\n getTreeNode(scopeRef: ScopeRef): FocusScopeTreeNode | undefined {\n return this.fastMap.get(scopeRef);\n }\n\n addTreeNode(scopeRef: ScopeRef, parent: ScopeRef): void {\n const parentNode = this.fastMap.get(parent) ?? this.root;\n const node: FocusScopeTreeNode = { scopeRef, parent: parentNode, children: new Set() };\n parentNode.children.add(node);\n this.fastMap.set(scopeRef, node);\n }\n\n removeTreeNode(scopeRef: ScopeRef): void {\n // never remove the root\n if (scopeRef === null) return;\n const node = this.fastMap.get(scopeRef);\n if (!node) return;\n const parentNode = node.parent;\n if (parentNode) {\n parentNode.children.delete(node);\n // Re-parent any children so a mid-tree unmount doesn't orphan descendants.\n for (const child of node.children) {\n child.parent = parentNode;\n parentNode.children.add(child);\n }\n }\n this.fastMap.delete(scopeRef);\n }\n\n // Pre-order depth-first; skips the null-scoped root, like upstream.\n *traverse(node: FocusScopeTreeNode = this.root): Generator<FocusScopeTreeNode> {\n if (node.scopeRef != null) {\n yield node;\n }\n for (const child of node.children) {\n yield* this.traverse(child);\n }\n }\n}\n\nconst focusScopeTree = new FocusScopeTree();\n\n/**\n * Whether the element is inside `scope` or any of its descendant scopes.\n *\n * `isElementInScope`'s `node.contains` already covers descendant scopes that\n * are DOM children, but not those rendered in a portal. Walking the scope\n * subtree closes that gap so focus moving into a portaled child scope still\n * counts as \"inside\". Mirrors @react-aria/focus's `isElementInChildScope`.\n */\nfunction isElementInChildScope(element: Element, scope: ScopeRef = null): boolean {\n // Always allow focus to move into a top-layer element (e.g. toasts).\n if (element instanceof Element && element.closest(\"[data-react-aria-top-layer]\")) {\n return true;\n }\n\n for (const node of focusScopeTree.traverse(focusScopeTree.getTreeNode(scope))) {\n if (node.scopeRef && isElementInScope(element, node.scopeRef())) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * A FocusScope manages focus for its descendants. It supports containing focus inside\n * the scope, restoring focus to the previously focused element on unmount, and auto\n * focusing children on mount. It also acts as a container for a programmatic focus\n * management interface that can be used to move focus forward and back in response\n * to user events.\n */\nexport const FocusScope: ParentComponent<FocusScopeProps> = (props) => {\n if (isServer) {\n return <>{props.children}</>;\n }\n\n let startRef: HTMLSpanElement | undefined;\n let endRef: HTMLSpanElement | undefined;\n const [scopeElements, setScopeElements] = createSignal<Element[]>([]);\n\n // The nearest enclosing FocusScope (through context, which Solid propagates\n // across portals) is this scope's parent in the focus-scope tree. Read it\n // before we shadow the context with our own provider below.\n const parentScopeRef = useContext(FocusScopeContext)?.scopeRef ?? null;\n\n // Store the element that was focused when the scope mounted\n let nodeToRestore: Element | null = null;\n\n const getRestorableElement = (element: Element | null, doc: Document): Element | null => {\n if (!element || element === doc.body || element === doc.documentElement) {\n return null;\n }\n return element;\n };\n\n // Create focus manager\n const focusManager: FocusManager = {\n focusNext(opts = {}) {\n const scope = scopeElements();\n if (scope.length === 0) return null;\n\n const { from, tabbable = true, wrap = false, accept } = opts;\n const elements = getFocusableElements(scope, tabbable).filter((el) => !accept || accept(el));\n const doc = getOwnerDocument(scope[0]);\n const current = from || getActiveElement(doc);\n\n if (!current || elements.length === 0) return null;\n\n const currentIndex = elements.indexOf(current as HTMLElement);\n let nextIndex = currentIndex + 1;\n\n if (nextIndex >= elements.length) {\n if (wrap) {\n nextIndex = 0;\n } else {\n return null;\n }\n }\n\n const nextElement = elements[nextIndex];\n if (nextElement) {\n focusSafely(nextElement);\n return nextElement;\n }\n\n return null;\n },\n\n focusPrevious(opts = {}) {\n const scope = scopeElements();\n if (scope.length === 0) return null;\n\n const { from, tabbable = true, wrap = false, accept } = opts;\n const elements = getFocusableElements(scope, tabbable).filter((el) => !accept || accept(el));\n const doc = getOwnerDocument(scope[0]);\n const current = from || getActiveElement(doc);\n\n if (!current || elements.length === 0) return null;\n\n const currentIndex = elements.indexOf(current as HTMLElement);\n let prevIndex = currentIndex - 1;\n\n if (prevIndex < 0) {\n if (wrap) {\n prevIndex = elements.length - 1;\n } else {\n return null;\n }\n }\n\n const prevElement = elements[prevIndex];\n if (prevElement) {\n focusSafely(prevElement);\n return prevElement;\n }\n\n return null;\n },\n\n focusFirst(opts = {}) {\n const scope = scopeElements();\n if (scope.length === 0) return null;\n\n const { tabbable = true, accept } = opts;\n const elements = getFocusableElements(scope, tabbable).filter((el) => !accept || accept(el));\n\n if (elements.length > 0) {\n focusSafely(elements[0]);\n return elements[0];\n }\n\n return null;\n },\n\n focusLast(opts = {}) {\n const scope = scopeElements();\n if (scope.length === 0) return null;\n\n const { tabbable = true, accept } = opts;\n const elements = getFocusableElements(scope, tabbable).filter((el) => !accept || accept(el));\n\n if (elements.length > 0) {\n const lastElement = elements[elements.length - 1];\n focusSafely(lastElement);\n return lastElement;\n }\n\n return null;\n },\n };\n\n // Collect scope elements after render\n onMount(() => {\n if (!startRef || !endRef) return;\n\n const nodes: Element[] = [];\n let node = startRef.nextSibling;\n while (node && node !== endRef) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n nodes.push(node as Element);\n }\n node = node.nextSibling;\n }\n setScopeElements(nodes);\n });\n\n // Register this scope in the focus-scope tree so containment can recognize a\n // portaled descendant scope as \"inside\" it. The scope-elements accessor is a\n // stable identity, so it works as the tree key even before it's populated.\n onMount(() => {\n focusScopeTree.addTreeNode(scopeElements, parentScopeRef);\n });\n onCleanup(() => {\n focusScopeTree.removeTreeNode(scopeElements);\n });\n\n // Save the currently focused element for restoration (must happen before autoFocus/contain effects run).\n onMount(() => {\n if (!props.restoreFocus) return;\n\n // Focus can be in the main document, or inside this iframe's document.\n const scopeDoc = startRef ? getOwnerDocument(startRef) : document;\n const scopeActive = getActiveElement(scopeDoc);\n const topActive = getActiveElement(document);\n\n // If the scope is in an iframe and that iframe is currently focused, prefer the iframe document's active element.\n if (\n scopeDoc !== document &&\n document.activeElement instanceof HTMLIFrameElement &&\n document.activeElement.contentDocument === scopeDoc &&\n scopeActive &&\n scopeActive !== scopeDoc.body\n ) {\n nodeToRestore = getRestorableElement(scopeActive, scopeDoc);\n return;\n }\n\n nodeToRestore = getRestorableElement(topActive, document);\n });\n\n // Auto-focus first element\n createEffect(() => {\n if (!props.autoFocus) return;\n\n const scope = scopeElements();\n if (scope.length === 0) return;\n\n const doc = getOwnerDocument(scope[0]);\n const activeElement = getActiveElement(doc);\n\n // Only auto-focus if focus is not already inside the scope\n if (!isElementInScope(activeElement, scope)) {\n focusManager.focusFirst();\n }\n });\n\n // Focus containment\n createEffect(() => {\n if (!props.contain) return;\n\n const scope = scopeElements();\n if (scope.length === 0) return;\n\n const doc = getOwnerDocument(scope[0]);\n let focusedNode: Element | null = null;\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== \"Tab\" || e.altKey || e.ctrlKey || e.metaKey) {\n return;\n }\n\n const scope = scopeElements();\n const activeElement = getActiveElement(doc);\n if (!isElementInScope(activeElement, scope)) {\n return;\n }\n\n const elements = getFocusableElements(scope, true);\n if (elements.length === 0) return;\n\n const firstElement = elements[0];\n const lastElement = elements[elements.length - 1];\n\n if (e.shiftKey && activeElement === firstElement) {\n e.preventDefault();\n focusSafely(lastElement);\n } else if (!e.shiftKey && activeElement === lastElement) {\n e.preventDefault();\n focusSafely(firstElement);\n }\n };\n\n const onFocusIn = (e: FocusEvent) => {\n const scope = scopeElements();\n const target = e.target as Element;\n\n if (isElementInScope(target, scope)) {\n focusedNode = target;\n } else if (isElementInChildScope(target, scopeElements)) {\n // Focus moved into a descendant scope — e.g. a menu opened from inside\n // this modal popover, rendered in a portal outside this scope's DOM\n // subtree. Track it but don't pull focus back, which would tear the\n // nested overlay down.\n focusedNode = target;\n } else if (focusedNode) {\n // Focus escaped the scope, bring it back\n focusSafely(focusedNode as HTMLElement);\n } else {\n // No previous focus, focus first element\n focusManager.focusFirst();\n }\n };\n\n let restoreRaf: number | null = null;\n\n const onFocusOut = (e: FocusEvent) => {\n const target = e.target as Element;\n if (!isElementInScope(target, scopeElements())) return;\n\n // Focus left an element inside the scope. Wait a frame (like upstream's\n // onBlur) so a synchronous refocus elsewhere can settle; if focus ended\n // up outside every scope (e.g. blur() to body), pull it back.\n const win = doc.defaultView ?? window;\n if (restoreRaf != null) win.cancelAnimationFrame(restoreRaf);\n restoreRaf = win.requestAnimationFrame(() => {\n restoreRaf = null;\n const scope = scopeElements();\n const activeElement = getActiveElement(doc);\n if (\n activeElement &&\n (isElementInScope(activeElement, scope) ||\n isElementInChildScope(activeElement, scopeElements))\n ) {\n return;\n }\n\n if (doc.body.contains(target)) {\n focusedNode = target;\n focusSafely(target as HTMLElement);\n } else {\n focusManager.focusFirst();\n }\n });\n };\n\n doc.addEventListener(\"keydown\", onKeyDown, true);\n doc.addEventListener(\"focusin\", onFocusIn, true);\n doc.addEventListener(\"focusout\", onFocusOut, true);\n\n onCleanup(() => {\n doc.removeEventListener(\"keydown\", onKeyDown, true);\n doc.removeEventListener(\"focusin\", onFocusIn, true);\n doc.removeEventListener(\"focusout\", onFocusOut, true);\n if (restoreRaf != null) {\n (doc.defaultView ?? window).cancelAnimationFrame(restoreRaf);\n }\n });\n });\n\n // Restore focus on unmount\n onCleanup(() => {\n if (props.restoreFocus && nodeToRestore && (nodeToRestore as HTMLElement).focus) {\n const doc = getOwnerDocument(nodeToRestore as Element);\n const win = doc.defaultView ?? window;\n\n // Use requestAnimationFrame to ensure the element is still in the DOM\n win.requestAnimationFrame(() => {\n if (nodeToRestore && doc.body.contains(nodeToRestore as Node)) {\n (nodeToRestore as HTMLElement).focus();\n }\n });\n }\n });\n\n return (\n <FocusScopeContext.Provider value={{ focusManager, scopeRef: scopeElements }}>\n <span data-focus-scope-start hidden ref={startRef} />\n {props.children}\n <span data-focus-scope-end hidden ref={endRef} />\n </FocusScopeContext.Provider>\n );\n};\n\nexport default FocusScope;\n"],"mappings":";;;;;;;;;;;;AA0EA,SAAS,cAAc,QAAwC;CAC7D,IAAI;CACJ,IAAI;CACJ,GAAG;EACD,OAAO,OAAO,UAAU;EACxB,IAAI,MACF,OAAO;CAEX,SAAS;CACT,OAAO,QAAQ;AACjB;;;;;;;AAQA,SAAgB,mBACd,KACA,iBAAsC,CAAC,GACzB;CACd,OAAO;EACL,UAAU,OAA4B,CAAC,GAAG;GACxC,MAAM,OAAO,IAAI;GACjB,IAAI,CAAC,MAAM,OAAO;GAClB,MAAM,EACJ,MACA,WAAW,eAAe,UAC1B,OAAO,eAAe,MACtB,SAAS,eAAe,WACtB;GACJ,MAAM,OAAO,QAAQ,iBAAiB,iBAAiB,IAAI,CAAC;GAC5D,MAAM,SAAS,uBAAuB,MAAM;IAAE;IAAU;GAAO,CAAC;GAChE,IAAI,QAAQ,KAAK,SAAS,IAAI,GAC5B,OAAO,cAAc;GAEvB,IAAI,WAAW,OAAO,SAAS;GAC/B,IAAI,CAAC,YAAY,MAAM;IACrB,OAAO,cAAc;IACrB,WAAW,OAAO,SAAS;GAC7B;GACA,IAAI,UACF,YAAY,QAAQ;GAEtB,OAAO;EACT;EAEA,cAAc,OAA4B,CAAC,GAAG;GAC5C,MAAM,OAAO,IAAI;GACjB,IAAI,CAAC,MAA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Y,YAAY,IAAI;GACpD,IAAI,cAAc,MAChB,CAAC,IAAI,eAAe,OAAA,CAAQ,qBAAqB,UAAU;EAE/D,CAAC;CACH,CAAC;CAGD,gBAAgB;EACd,IAAI,MAAM,gBAAgB,iBAAkB,cAA8B,OAAO;GAC/E,MAAM,MAAM,iBAAiB,aAAwB;GAIrD,CAHY,IAAI,eAAe,OAAA,CAG3B,4BAA4B;IAC9B,IAAI,iBAAiB,IAAI,KAAK,SAAS,aAAqB,GAC1D,cAA+B,MAAM;GAEzC,CAAC;EACH;CACF,CAAC;CAED,OACE,CAAC,kBAAkB,SAAS,OAAO;EAAE;EAAc,UAAU;CAAc,GAAG;MAC5E,CAAC,KAAK,uBAAuB,OAAO,KAAK,YAAY;OACpD,MAAM,SAAS;MAChB,CAAC,KAAK,qBAAqB,OAAO,KAAK,UAAU;IACnD,EAAE,kBAAkB;AAExB"}
1
+ {"version":3,"file":"FocusScope.jsx","names":[],"sources":["../../src/focus/FocusScope.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/focus/FocusScope.tsx\n\n/**\n * FocusScope component for managing focus containment, restoration, and auto-focus.\n * Ported from packages/react-aria/src/focus/FocusScope.tsx.\n */\n\nimport {\n getOwnerDocument,\n isFocusable,\n isTabbable,\n getFocusableTreeWalker,\n getActiveElement,\n useContextOptional,\n onOwnedCleanup,\n} from \"../utils\";\nimport { createContext, createEffect, createSignal, onSettled } from \"solid-js\";\nimport type { Accessor, ParentComponent } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { isServer } from \"@solidjs/web\";\nimport { focusSafely, focusWithoutScrolling, runAfterPaint } from \"../utils/focus\";\n\nconst RESTORE_FOCUS_EVENT = \"react-aria-focus-scope-restore\";\n\nexport interface FocusScopeProps {\n /** The contents of the focus scope. */\n children: JSX.Element;\n /**\n * Whether to contain focus inside the scope, so users cannot\n * move focus outside, for example in a modal dialog.\n */\n contain?: boolean;\n /**\n * Whether to restore focus back to the element that was focused\n * when the focus scope mounted, after the focus scope unmounts.\n */\n restoreFocus?: boolean;\n /** Whether to auto focus the first focusable element in the focus scope on mount. */\n autoFocus?: boolean;\n}\n\nexport interface FocusManagerOptions {\n /** The element to start searching from. The currently focused element by default. */\n from?: Element;\n /** Whether to only include tabbable elements, or all focusable elements. */\n tabbable?: boolean;\n /** Whether focus should wrap around when it reaches the end of the scope. */\n wrap?: boolean;\n /** A callback that determines whether the given element is focused. */\n accept?: (node: Element) => boolean;\n}\n\nexport interface FocusManager {\n /** Moves focus to the next focusable or tabbable element in the focus scope. */\n focusNext(opts?: FocusManagerOptions): HTMLElement | null;\n /** Moves focus to the previous focusable or tabbable element in the focus scope. */\n focusPrevious(opts?: FocusManagerOptions): HTMLElement | null;\n /** Moves focus to the first focusable or tabbable element in the focus scope. */\n focusFirst(opts?: FocusManagerOptions): HTMLElement | null;\n /** Moves focus to the last focusable or tabbable element in the focus scope. */\n focusLast(opts?: FocusManagerOptions): HTMLElement | null;\n}\n\ninterface FocusScopeContextValue {\n focusManager: FocusManager;\n scopeRef: Accessor<Element[]>;\n}\n\n/**\n * Walks a TreeWalker to its final (deepest-last) node, mirroring the `last`\n * helper in @react-aria/focus.\n */\nfunction lastFocusable(walker: TreeWalker): HTMLElement | null {\n let next: HTMLElement | undefined;\n let last: Node | null;\n do {\n last = walker.lastChild();\n if (last) {\n next = last as HTMLElement;\n }\n } while (last);\n return next ?? null;\n}\n\n/**\n * Creates a FocusManager rooted at the given ref element, independent of any\n * FocusScope. Mirrors @react-aria/focus's `createFocusManager`: it walks the\n * focusable tree with `getFocusableTreeWalker` so segment/spinbutton navigation\n * inside a date field group behaves exactly like upstream.\n */\nexport function createFocusManager(\n ref: () => HTMLElement | null | undefined,\n defaultOptions: FocusManagerOptions = {},\n): FocusManager {\n return {\n focusNext(opts: FocusManagerOptions = {}) {\n const root = ref();\n if (!root) return null;\n const {\n from,\n tabbable = defaultOptions.tabbable,\n wrap = defaultOptions.wrap,\n accept = defaultOptions.accept,\n } = opts;\n const node = from || getActiveElement(getOwnerDocument(root));\n const walker = getFocusableTreeWalker(root, { tabbable, accept });\n if (node && root.contains(node)) {\n walker.currentNode = node;\n }\n let nextNode = walker.nextNode() as HTMLElement | null;\n if (!nextNode && wrap) {\n walker.currentNode = root;\n nextNode = walker.nextNode() as HTMLElement | null;\n }\n if (nextNode) {\n focusSafely(nextNode);\n }\n return nextNode;\n },\n\n focusPrevious(opts: FocusManagerOptions = {}) {\n const root = ref();\n if (!root) return null;\n const {\n from,\n tabbable = defaultOptions.tabbable,\n wrap = defaultOptions.wrap,\n accept = defaultOptions.accept,\n } = opts;\n const node = from || getActiveElement(getOwnerDocument(root));\n const walker = getFocusableTreeWalker(root, { tabbable, accept });\n if (node && root.contains(node)) {\n walker.currentNode = node;\n } else {\n const next = lastFocusable(walker);\n if (next) {\n focusSafely(next);\n }\n return next;\n }\n let previousNode = walker.previousNode() as HTMLElement | null;\n if (!previousNode && wrap) {\n walker.currentNode = root;\n const lastNode = lastFocusable(walker);\n if (!lastNode) {\n return null;\n }\n previousNode = lastNode;\n }\n if (previousNode) {\n focusSafely(previousNode);\n }\n return previousNode;\n },\n\n focusFirst(opts: FocusManagerOptions = {}) {\n const root = ref();\n if (!root) return null;\n const { tabbable = defaultOptions.tabbable, accept = defaultOptions.accept } = opts;\n const walker = getFocusableTreeWalker(root, { tabbable, accept });\n const nextNode = walker.nextNode() as HTMLElement | null;\n if (nextNode) {\n focusSafely(nextNode);\n }\n return nextNode;\n },\n\n focusLast(opts: FocusManagerOptions = {}) {\n const root = ref();\n if (!root) return null;\n const { tabbable = defaultOptions.tabbable, accept = defaultOptions.accept } = opts;\n const walker = getFocusableTreeWalker(root, { tabbable, accept });\n const next = lastFocusable(walker);\n if (next) {\n focusSafely(next);\n }\n return next;\n },\n };\n}\n\nconst FocusScopeContext = createContext<FocusScopeContextValue | null>(null);\n\n/**\n * Returns a FocusManager interface for the parent FocusScope.\n * A FocusManager can be used to programmatically move focus within\n * a FocusScope, e.g. in response to user events like keyboard navigation.\n */\nexport function useFocusManager(): FocusManager | undefined {\n return useContextOptional(FocusScopeContext)?.focusManager;\n}\n\n/**\n * Gets all focusable elements within a scope.\n */\nfunction getFocusableElements(scope: Element[], tabbable = false): HTMLElement[] {\n const elements: HTMLElement[] = [];\n const filter = tabbable ? isTabbable : isFocusable;\n\n for (const scopeElement of scope) {\n // Check the element itself\n if (filter(scopeElement)) {\n elements.push(scopeElement as HTMLElement);\n }\n\n // Check all descendants\n const descendants = scopeElement.querySelectorAll(\"*\");\n for (let i = 0; i < descendants.length; i++) {\n const el = descendants[i];\n if (filter(el)) {\n elements.push(el as HTMLElement);\n }\n }\n }\n\n return elements;\n}\n\n/**\n * Checks if an element is within a scope.\n */\nfunction isElementInScope(element: Element | null, scope: Element[]): boolean {\n if (!element) return false;\n return scope.some((node) => node.contains(element));\n}\n\n/**\n * Auto-focus target for a scope. Mirrors @react-aria/focus `getFirstInScope`:\n * prefer a tabbable node, then fall back to the first focusable node (e.g. a\n * `tabIndex={-1}` overlay root) when nothing is tabbable yet.\n */\nfunction firstInScope(scope: Element[]): HTMLElement | null {\n return getFocusableElements(scope, true)[0] ?? getFocusableElements(scope, false)[0] ?? null;\n}\n\nfunction focusFirstInScope(scope: Element[]): void {\n const target = firstInScope(scope);\n if (target) {\n focusSafely(target);\n }\n}\n\nfunction restoreFocusToElement(node: HTMLElement): void {\n // Dispatch a custom event that parent elements can intercept to customize focus restoration.\n // Restoration must be synchronous: `focusSafely` defers under virtual modality\n // (`runAfterTransition`) and the leaving scope is gone by then.\n if (\n node.dispatchEvent(new CustomEvent(RESTORE_FOCUS_EVENT, { bubbles: true, cancelable: true }))\n ) {\n focusWithoutScrolling(node);\n }\n}\n\n/**\n * Collects the element siblings between FocusScope sentinels. React's\n * FocusScope re-runs this in `useLayoutEffect` on every render; Solid only\n * re-runs the component body once, so callers must re-collect when the DOM\n * between the sentinels changes (portaled overlay children, delayed collections).\n */\nfunction collectScopeElements(\n start: HTMLElement | null | undefined,\n end: HTMLElement | null | undefined,\n): Element[] {\n if (!start || !end) {\n return [];\n }\n\n const nodes: Element[] = [];\n let node: ChildNode | null = start.nextSibling;\n while (node && node !== end) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n nodes.push(node as Element);\n }\n node = node.nextSibling;\n }\n return nodes;\n}\n\nfunction sameElements(a: Element[], b: Element[]): boolean {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * A scope is identified by its (stable) scope-elements accessor; `null` is the\n * tree root. Mirrors @react-aria/focus's `ScopeRef`.\n */\ntype ScopeRef = Accessor<Element[]> | null;\n\ninterface FocusScopeTreeNode {\n scopeRef: ScopeRef;\n parent: FocusScopeTreeNode | null;\n children: Set<FocusScopeTreeNode>;\n nodeToRestore?: Element;\n}\n\n/**\n * A registry of the live FocusScopes and their parent/child relationships,\n * mirroring @react-aria/focus's `focusScopeTree`. The DOM tree alone can't\n * express scope nesting because a child scope (e.g. a menu opened from inside a\n * modal popover) is rendered in a portal, outside its parent scope's subtree.\n * The tree records that nesting so containment can recognize a portaled\n * descendant scope as \"inside\".\n */\nclass FocusScopeTree {\n root: FocusScopeTreeNode;\n private fastMap = new Map<ScopeRef, FocusScopeTreeNode>();\n\n constructor() {\n this.root = { scopeRef: null, parent: null, children: new Set() };\n this.fastMap.set(null, this.root);\n }\n\n getTreeNode(scopeRef: ScopeRef): FocusScopeTreeNode | undefined {\n return this.fastMap.get(scopeRef);\n }\n\n addTreeNode(scopeRef: ScopeRef, parent: ScopeRef, nodeToRestore?: Element): void {\n const parentNode = this.fastMap.get(parent) ?? this.root;\n const node: FocusScopeTreeNode = { scopeRef, parent: parentNode, children: new Set() };\n if (nodeToRestore) {\n node.nodeToRestore = nodeToRestore;\n }\n parentNode.children.add(node);\n this.fastMap.set(scopeRef, node);\n }\n\n removeTreeNode(scopeRef: ScopeRef): void {\n // never remove the root\n if (scopeRef === null) return;\n const node = this.fastMap.get(scopeRef);\n if (!node) return;\n const parentNode = node.parent;\n if (parentNode) {\n parentNode.children.delete(node);\n // Re-parent any children so a mid-tree unmount doesn't orphan descendants.\n for (const child of node.children) {\n child.parent = parentNode;\n parentNode.children.add(child);\n }\n }\n this.fastMap.delete(scopeRef);\n }\n\n clone(): FocusScopeTree {\n const newTree = new FocusScopeTree();\n for (const node of this.traverse()) {\n newTree.addTreeNode(node.scopeRef, node.parent?.scopeRef ?? null, node.nodeToRestore);\n }\n return newTree;\n }\n\n // Pre-order depth-first; skips the null-scoped root, like upstream.\n *traverse(node: FocusScopeTreeNode = this.root): Generator<FocusScopeTreeNode> {\n if (node.scopeRef != null) {\n yield node;\n }\n for (const child of node.children) {\n yield* this.traverse(child);\n }\n }\n}\n\nconst focusScopeTree = new FocusScopeTree();\n\n/**\n * The scope that currently holds focus. Mirrors @react-aria/focus's\n * module-level `activeScope`: focus moving into a child scope makes the child\n * active, moving out to an ancestor does not.\n */\nlet activeScope: ScopeRef = null;\n\n/** Whether `ancestor` is above `scope` in the focus-scope tree. */\nfunction isAncestorScope(ancestor: ScopeRef, scope: ScopeRef): boolean {\n let parent = focusScopeTree.getTreeNode(scope)?.parent;\n while (parent) {\n if (parent.scopeRef === ancestor) {\n return true;\n }\n parent = parent.parent;\n }\n return false;\n}\n\n/**\n * Whether the element is inside `scope` or any of its descendant scopes.\n *\n * `isElementInScope`'s `node.contains` already covers descendant scopes that\n * are DOM children, but not those rendered in a portal. Walking the scope\n * subtree closes that gap so focus moving into a portaled child scope still\n * counts as \"inside\". Mirrors @react-aria/focus's `isElementInChildScope`.\n */\nfunction isElementInChildScope(element: Element, scope: ScopeRef = null): boolean {\n // Always allow focus to move into a top-layer element (e.g. toasts). The\n // attribute is the one `createToastRegion` sets; upstream's name is\n // `data-react-aria-top-layer`.\n if (element instanceof Element && element.closest(\"[data-solidaria-top-layer]\")) {\n return true;\n }\n\n for (const node of focusScopeTree.traverse(focusScopeTree.getTreeNode(scope))) {\n if (node.scopeRef && isElementInScope(element, node.scopeRef())) {\n return true;\n }\n }\n\n return false;\n}\n\n/** Whether the element is inside any registered focus scope. */\nfunction isElementInAnyScope(element: Element): boolean {\n return isElementInChildScope(element);\n}\n\n/**\n * Whether the element is inside the active scope or any of its descendant\n * scopes. `createOverlay` uses it to leave an overlay open when focus moves\n * into a child scope (a menu inside a dialog). Mirrors @react-aria/focus's\n * `isElementInChildOfActiveScope`.\n */\nexport function isElementInChildOfActiveScope(element: Element): boolean {\n return isElementInChildScope(element, activeScope);\n}\n\n/**\n * A FocusScope manages focus for its descendants. It supports containing focus inside\n * the scope, restoring focus to the previously focused element on unmount, and auto\n * focusing children on mount. It also acts as a container for a programmatic focus\n * management interface that can be used to move focus forward and back in response\n * to user events.\n */\nexport const FocusScope: ParentComponent<FocusScopeProps> = (props) => {\n // Keep the provider, sentinels and lifecycle owners symmetric during SSR.\n // Server effects reserve their slots without running browser callbacks.\n const [startEl, setStartEl] = createSignal<HTMLSpanElement | null>(null, { ownedWrite: true });\n const [endEl, setEndEl] = createSignal<HTMLSpanElement | null>(null, { ownedWrite: true });\n const [scopeElements, setScopeElements] = createSignal<Element[]>([], { ownedWrite: true });\n\n const syncScopeElements = () => {\n const next = collectScopeElements(startEl(), endEl());\n if (!sameElements(next, scopeElements())) {\n setScopeElements(next);\n }\n };\n\n // The nearest enclosing FocusScope (through context, which Solid propagates\n // across portals) is this scope's parent in the focus-scope tree. Read it\n // before we shadow the context with our own provider below.\n const parentScopeRef = useContextOptional(FocusScopeContext)?.scopeRef ?? null;\n\n // Store the element that was focused when the scope mounted. Capture at\n // setup — before autoFocus/contain effects — so we don't save a child of\n // this scope after focus has already moved inside.\n let nodeToRestore: Element | null = null;\n\n const getRestorableElement = (element: Element | null, doc: Document): Element | null => {\n if (!element || element === doc.body || element === doc.documentElement) {\n return null;\n }\n return element;\n };\n\n if (props.restoreFocus && !isServer) {\n nodeToRestore = getRestorableElement(getActiveElement(document), document);\n }\n\n // Create focus manager\n const focusManager: FocusManager = {\n focusNext(opts = {}) {\n const scope = scopeElements();\n if (scope.length === 0) return null;\n\n const { from, tabbable = true, wrap = false, accept } = opts;\n const elements = getFocusableElements(scope, tabbable).filter((el) => !accept || accept(el));\n const doc = getOwnerDocument(scope[0]);\n const current = from || getActiveElement(doc);\n\n if (!current || elements.length === 0) return null;\n\n const currentIndex = elements.indexOf(current as HTMLElement);\n let nextIndex = currentIndex + 1;\n\n if (nextIndex >= elements.length) {\n if (wrap) {\n nextIndex = 0;\n } else {\n return null;\n }\n }\n\n const nextElement = elements[nextIndex];\n if (nextElement) {\n focusSafely(nextElement);\n return nextElement;\n }\n\n return null;\n },\n\n focusPrevious(opts = {}) {\n const scope = scopeElements();\n if (scope.length === 0) return null;\n\n const { from, tabbable = true, wrap = false, accept } = opts;\n const elements = getFocusableElements(scope, tabbable).filter((el) => !accept || accept(el));\n const doc = getOwnerDocument(scope[0]);\n const current = from || getActiveElement(doc);\n\n if (!current || elements.length === 0) return null;\n\n const currentIndex = elements.indexOf(current as HTMLElement);\n let prevIndex = currentIndex - 1;\n\n if (prevIndex < 0) {\n if (wrap) {\n prevIndex = elements.length - 1;\n } else {\n return null;\n }\n }\n\n const prevElement = elements[prevIndex];\n if (prevElement) {\n focusSafely(prevElement);\n return prevElement;\n }\n\n return null;\n },\n\n focusFirst(opts = {}) {\n const scope = scopeElements();\n if (scope.length === 0) return null;\n\n const { tabbable = true, accept } = opts;\n const elements = getFocusableElements(scope, tabbable).filter((el) => !accept || accept(el));\n\n if (elements.length > 0) {\n focusSafely(elements[0]);\n return elements[0];\n }\n\n return null;\n },\n\n focusLast(opts = {}) {\n const scope = scopeElements();\n if (scope.length === 0) return null;\n\n const { tabbable = true, accept } = opts;\n const elements = getFocusableElements(scope, tabbable).filter((el) => !accept || accept(el));\n\n if (elements.length > 0) {\n const lastElement = elements[elements.length - 1];\n focusSafely(lastElement);\n return lastElement;\n }\n\n return null;\n },\n };\n\n // Re-collect when sentinels mount and when siblings between them change.\n // A one-shot onMount miss (empty first paint, delayed collection) would leave\n // auto-focus and contain permanently disabled even after the overlay exists.\n createEffect(\n () => {\n const start = startEl();\n const end = endEl();\n return { start, end };\n },\n ({ start, end }) => {\n if (!start || !end) {\n return;\n }\n\n syncScopeElements();\n const parent = start.parentNode;\n if (!parent) {\n return;\n }\n\n const observer = new MutationObserver(() => {\n syncScopeElements();\n });\n observer.observe(parent, { childList: true });\n return () => observer.disconnect();\n },\n );\n\n // Register this scope in the focus-scope tree so containment can recognize a\n // portaled descendant scope as \"inside\" it. The scope-elements accessor is a\n // stable identity, so it works as the tree key even before it's populated.\n onSettled(() => {\n // If a new scope mounts outside the active scope (a dialog launched from a\n // menu), take the active scope as the parent instead of the context one.\n // Upstream `FocusScope.tsx:100-113`; only a parent that is already in the\n // tree is re-pointed, so an ancestor still mounting is left alone.\n let parentScope = parentScopeRef;\n if (\n focusScopeTree.getTreeNode(parentScope) &&\n activeScope &&\n !isAncestorScope(activeScope, parentScope) &&\n focusScopeTree.getTreeNode(activeScope)\n ) {\n parentScope = activeScope;\n }\n\n focusScopeTree.addTreeNode(scopeElements, parentScope, nodeToRestore ?? undefined);\n });\n\n // Once the tree is complete, the bottom-most scope that contains the focused\n // element becomes the active one. Upstream `FocusScope.tsx:154-173`: this is\n // what makes a scope active when focus is already inside it at mount, with\n // neither `autoFocus` to claim it nor a later `focusin` to follow. Upstream\n // can run it on mount because its nodes are collected in a layout effect;\n // ours are collected in an effect plus a MutationObserver, so the pass waits\n // for the first non-empty collection and then runs once, as upstream does.\n let didActivateOnMount = false;\n createEffect(scopeElements, (scope) => {\n if (didActivateOnMount || scope.length === 0) {\n return;\n }\n didActivateOnMount = true;\n\n const activeElement = getActiveElement(getOwnerDocument(scope[0]));\n if (!activeElement || !isElementInScope(activeElement, scope)) {\n return;\n }\n\n let bottomMost: FocusScopeTreeNode | null = null;\n for (const node of focusScopeTree.traverse()) {\n if (node.scopeRef && isElementInScope(activeElement, node.scopeRef())) {\n bottomMost = node;\n }\n }\n\n if (bottomMost && bottomMost === focusScopeTree.getTreeNode(scopeElements)) {\n activeScope = bottomMost.scopeRef;\n }\n });\n onOwnedCleanup(() => {\n // Hand the active scope back to the parent before the node goes, like\n // upstream's unmount cleanup (`FocusScope.tsx:182-190`). `removeTreeNode`\n // re-parents this node's children, so a dead `activeScope` could never be\n // an ancestor again: every later scope that activates through `contain` or\n // `restoreFocus` alone would be locked out, and `isElementInChildScope`\n // would walk from the root and call every scope on the page active.\n const parentScope = focusScopeTree.getTreeNode(scopeElements)?.parent?.scopeRef ?? null;\n if (\n (scopeElements === activeScope || isAncestorScope(scopeElements, activeScope)) &&\n (!parentScope || focusScopeTree.getTreeNode(parentScope))\n ) {\n activeScope = parentScope;\n }\n focusScopeTree.removeTreeNode(scopeElements);\n });\n\n // Persist the restore target onto the scope tree. Do not overwrite a\n // setup-time capture with whatever is focused after autoFocus.\n onSettled(() => {\n if (!props.restoreFocus) return;\n\n const persistRestoreTarget = (element: Element | null) => {\n if (element) {\n nodeToRestore = element;\n }\n const treeNode = focusScopeTree.getTreeNode(scopeElements);\n if (treeNode && nodeToRestore) {\n treeNode.nodeToRestore = nodeToRestore;\n }\n };\n\n if (nodeToRestore && nodeToRestore.isConnected) {\n persistRestoreTarget(nodeToRestore);\n return;\n }\n\n // Focus can be in the main document, or inside this iframe's document.\n const scopeDoc = startEl() ? getOwnerDocument(startEl() as Element) : document;\n const scopeActive = getActiveElement(scopeDoc);\n const topActive = getActiveElement(document);\n const scope = scopeElements();\n\n // If the scope is in an iframe and that iframe is currently focused, prefer the iframe document's active element.\n if (\n scopeDoc !== document &&\n document.activeElement instanceof HTMLIFrameElement &&\n document.activeElement.contentDocument === scopeDoc &&\n scopeActive &&\n scopeActive !== scopeDoc.body &&\n !isElementInScope(scopeActive, scope)\n ) {\n persistRestoreTarget(getRestorableElement(scopeActive, scopeDoc));\n return;\n }\n\n const candidate = getRestorableElement(topActive, document);\n if (candidate && !isElementInScope(candidate, scope)) {\n persistRestoreTarget(candidate);\n }\n });\n\n // Match @react-aria/focus `useAutoFocus`: one-shot after paint so overlay\n // auto-focus lands after `preventFocus`'s rAF capture window (and after the\n // overlay has been laid out enough to be focusable). Do not start until a\n // real target exists — otherwise a first empty/unfocusable paint would skip\n // forever after children appear.\n let autoFocusStarted = false;\n let cancelAutoFocus: (() => void) | undefined;\n createEffect(\n () => {\n const autoFocus = !!props.autoFocus;\n const scope = scopeElements();\n return {\n autoFocus,\n ready: scope.length > 0 && !!firstInScope(scope),\n scope,\n };\n },\n ({ autoFocus, ready, scope }) => {\n if (!autoFocus || autoFocusStarted || !ready) return;\n\n autoFocusStarted = true;\n const doc = getOwnerDocument(scope[0]);\n cancelAutoFocus = runAfterPaint(() => {\n cancelAutoFocus = undefined;\n const currentScope = scopeElements();\n if (currentScope.length === 0) return;\n // Upstream `useAutoFocus` makes the auto-focused scope active first.\n activeScope = scopeElements;\n const activeElement = getActiveElement(doc);\n if (!isElementInScope(activeElement, currentScope)) {\n focusFirstInScope(currentScope);\n }\n }, doc);\n },\n );\n onOwnedCleanup(() => {\n cancelAutoFocus?.();\n });\n\n // Track the active scope when containment does not already do it. Upstream\n // splits this between `useRestoreFocus` (restore without contain: a scope\n // only becomes active, never inactive) and `useActiveScopeTracker` (neither:\n // focus leaving every scope clears the active scope).\n createEffect(\n () => {\n const contain = !!props.contain;\n const restore = !!props.restoreFocus;\n const scope = scopeElements();\n return { contain, restore, scope };\n },\n ({ contain, restore, scope }) => {\n if (contain || scope.length === 0) return;\n\n const doc = getOwnerDocument(scope[0]);\n const onFocus = (e: FocusEvent) => {\n const target = e.target as Element;\n if (restore) {\n if (\n (!activeScope || isAncestorScope(activeScope, scopeElements)) &&\n isElementInScope(getActiveElement(doc), scopeElements())\n ) {\n activeScope = scopeElements;\n }\n return;\n }\n\n if (isElementInScope(target, scopeElements())) {\n activeScope = scopeElements;\n } else if (!isElementInAnyScope(target)) {\n activeScope = null;\n }\n };\n\n // `focusin` is not in TypeScript's `ElementEventMap`, so the listener is\n // registered through the `EventListener` overload, as it is on documents.\n const onFocusListener = onFocus as EventListener;\n doc.addEventListener(\"focusin\", onFocus, false);\n for (const element of scope) {\n element.addEventListener(\"focusin\", onFocusListener, false);\n }\n return () => {\n doc.removeEventListener(\"focusin\", onFocus, false);\n for (const element of scope) {\n element.removeEventListener(\"focusin\", onFocusListener, false);\n }\n };\n },\n );\n\n // Focus containment. Split createEffect so reading JSX `contain` (a compiler\n // memo getter) does not create a primitive inside createTrackedEffect.\n createEffect(\n () => {\n const contain = !!props.contain;\n const scope = scopeElements();\n return { contain, scope };\n },\n ({ contain, scope }) => {\n if (!contain) return;\n\n if (scope.length === 0) return;\n\n const doc = getOwnerDocument(scope[0]);\n let focusedNode: Element | null = null;\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== \"Tab\" || e.altKey || e.ctrlKey || e.metaKey) {\n return;\n }\n\n const scope = scopeElements();\n const activeElement = getActiveElement(doc);\n if (!isElementInScope(activeElement, scope)) {\n return;\n }\n\n const elements = getFocusableElements(scope, true);\n if (elements.length === 0) return;\n\n const firstElement = elements[0];\n const lastElement = elements[elements.length - 1];\n\n if (e.shiftKey && activeElement === firstElement) {\n e.preventDefault();\n focusSafely(lastElement);\n } else if (!e.shiftKey && activeElement === lastElement) {\n e.preventDefault();\n focusSafely(firstElement);\n }\n };\n\n const onFocusIn = (e: FocusEvent) => {\n const scope = scopeElements();\n const target = e.target as Element;\n\n if (isElementInScope(target, scope)) {\n // Focusing into a child of the active scope makes the child active;\n // moving out to an ancestor does not (upstream `useFocusContainment`).\n if (!activeScope || isAncestorScope(activeScope, scopeElements)) {\n activeScope = scopeElements;\n }\n focusedNode = target;\n } else if (isElementInChildScope(target, scopeElements)) {\n // Focus moved into a descendant scope — e.g. a menu opened from inside\n // this modal popover, rendered in a portal outside this scope's DOM\n // subtree. Track it but don't pull focus back, which would tear the\n // nested overlay down.\n focusedNode = target;\n } else if (target === doc.body || target === doc.documentElement) {\n // `element.blur()` sends focus to body and may fire focusin there.\n // RAC restores that path from focusout + rAF (`onBlur`), not from\n // this focusin. Pulling back synchronously would beat a following\n // pointermove (certified hover after the focus-visible reset) and\n // keep a stale keyboard ring.\n return;\n } else if (focusedNode) {\n // Focus escaped the scope, bring it back\n focusSafely(focusedNode as HTMLElement);\n } else {\n // No previous focus, focus first element\n focusManager.focusFirst();\n }\n };\n\n let restoreRaf: number | null = null;\n\n const onFocusOut = (e: FocusEvent) => {\n const target = e.target as Element;\n if (!isElementInScope(target, scopeElements())) return;\n\n // Focus left an element inside the scope. Wait a frame (like upstream's\n // onBlur) so a synchronous refocus elsewhere can settle; if focus ended\n // up outside every scope (e.g. blur() to body), pull it back.\n const win = doc.defaultView ?? window;\n if (restoreRaf != null) win.cancelAnimationFrame(restoreRaf);\n restoreRaf = win.requestAnimationFrame(() => {\n restoreRaf = null;\n const scope = scopeElements();\n const activeElement = getActiveElement(doc);\n if (\n activeElement &&\n (isElementInScope(activeElement, scope) ||\n isElementInChildScope(activeElement, scopeElements))\n ) {\n return;\n }\n\n if (doc.body.contains(target)) {\n focusedNode = target;\n focusSafely(target as HTMLElement);\n } else {\n focusManager.focusFirst();\n }\n });\n };\n\n doc.addEventListener(\"keydown\", onKeyDown, true);\n doc.addEventListener(\"focusin\", onFocusIn, true);\n doc.addEventListener(\"focusout\", onFocusOut, true);\n\n return () => {\n doc.removeEventListener(\"keydown\", onKeyDown, true);\n doc.removeEventListener(\"focusin\", onFocusIn, true);\n doc.removeEventListener(\"focusout\", onFocusOut, true);\n if (restoreRaf != null) {\n (doc.defaultView ?? window).cancelAnimationFrame(restoreRaf);\n }\n };\n },\n );\n\n // Restore focus on unmount. Walk ancestor scopes when nodeToRestore is gone\n // or a parent scope has nothing focusable, matching @react-aria/focus.\n onOwnedCleanup(() => {\n if (!props.restoreFocus) {\n return;\n }\n\n const treeNode = focusScopeTree.getTreeNode(scopeElements);\n const saved = (treeNode?.nodeToRestore ?? nodeToRestore) as HTMLElement | null;\n if (!saved) {\n return;\n }\n\n const scope = scopeElements();\n const scopeDoc = getOwnerDocument(scope[0] ?? startEl() ?? saved);\n const clonedTree = focusScopeTree.clone();\n const win = scopeDoc.defaultView ?? window;\n\n const restoreToParentScope = (): boolean => {\n if (parentScopeRef) {\n const first = firstInScope(parentScopeRef());\n if (first) {\n restoreFocusToElement(first);\n return true;\n }\n }\n let node: FocusScopeTreeNode | null | undefined =\n clonedTree.getTreeNode(scopeElements)?.parent ?? null;\n while (node) {\n if (node.scopeRef && focusScopeTree.getTreeNode(node.scopeRef)) {\n const first = firstInScope(node.scopeRef());\n if (first) {\n restoreFocusToElement(first);\n return true;\n }\n }\n node = node.parent;\n }\n return false;\n };\n\n const tryRestore = () => {\n // RAC FocusScope restores when the document's focus is the body after\n // unmount. Instant overlay unmount (no exit animation) can leave\n // activeElement on a detached dialog node instead of body; treat that\n // the same so DialogTrigger popovers restore the trigger (#274).\n // Do not restore while the leaving scope still holds focus — that must\n // wait a frame so \"restore after one frame\" tests stay deferred.\n const active = scopeDoc.activeElement as HTMLElement | null;\n if (\n active &&\n active !== scopeDoc.body &&\n active !== scopeDoc.documentElement &&\n active.isConnected\n ) {\n return;\n }\n\n if (saved && saved.isConnected) {\n restoreFocusToElement(saved);\n return;\n }\n\n let node: FocusScopeTreeNode | null | undefined = clonedTree.getTreeNode(scopeElements);\n while (node) {\n if (\n node.nodeToRestore &&\n node.nodeToRestore.isConnected &&\n node.scopeRef !== scopeElements\n ) {\n restoreFocusToElement(node.nodeToRestore as HTMLElement);\n return;\n }\n node = node.parent;\n }\n\n restoreToParentScope();\n };\n\n tryRestore();\n win.requestAnimationFrame(tryRestore);\n });\n\n return (\n <FocusScopeContext value={{ focusManager, scopeRef: scopeElements }}>\n <span data-focus-scope-start hidden ref={(el) => setStartEl(el ?? null)} />\n {props.children}\n <span data-focus-scope-end hidden ref={(el) => setEndEl(el ?? null)} />\n </FocusScopeContext>\n );\n};\n\nexport default FocusScope;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,sBAAsB;;;;;AAkD5B,SAAS,cAAc,QAAwC;CAC7D,IAAI;CACJ,IAAI;CACJ,GAAG;EACD,OAAO,OAAO,UAAU;EACxB,IAAI,MACF,OAAO;CAEX,SAAS;CACT,OAAO,QAAQ;AACjB;;;;;;;AAQA,SAAgB,mBACd,KACA,iBAAsC,CAAC,GACzB;CACd,OAAO;EACL,UAAU,OAA4B,CAAC,GAAG;GACxC,MAAM,OAAO,IAAI;GACjB,IAAI,CAAC,MAAM,OAAO;GAClB,MAAM,EACJ,MACA,WAAW,eAAe,UAC1B,OAAO,eAAe,MACtB,SAAS,eAAe,WACtB;GACJ,MAAM,OAAO,QAAQ,iBAAiB,iBAAiB,IAAI,CAAC;GAC5D,MAAM,SAAS,uBAAuB,MAAM;IAAE;IAAU;GAAO,CAAC;GAChE,IAAI,QAAQ,KAAK,SAAS,IAAI,GAC5B,OAAO,cAAc;GAEvB,IAAI,WAAW,OAAO,SAAS;GAC/B,IAAI,CAAC,YAAY,MAAM;IACrB,OAAO,cAAc;IACrB,WAAW,OAAO,SAAS;GAC7B;GACA,IAAI,UACF,YAAY,QAAQ;GAEtB,OAAO;EACT;EAEA,cAAc,OAA4B,CAAC,GAAG;GAC5C,MAAM,OAAO,IAAI;GACjB,IAAI,CAAC,MAAM,OAAO;GAClB,MAAM,EACJ,MACA,WAAW,eAAe,UAC1B,OAAO,eAAe,MACtB,SAAS,eAAe,WACtB;GACJ,MAAM,OAAO,QAAQ,iBAAiB,iBAAiB,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