@proyecto-viviana/solidaria 0.2.8 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (976) hide show
  1. package/README.md +31 -236
  2. package/dist/_chunk/actiongroup.js +207 -0
  3. package/dist/_chunk/actiongroup.js.map +1 -0
  4. package/dist/_chunk/actiongroup.jsx +207 -0
  5. package/dist/_chunk/actiongroup.jsx.map +1 -0
  6. package/dist/_chunk/ariaHideOutside.js +122 -0
  7. package/dist/_chunk/ariaHideOutside.js.map +1 -0
  8. package/dist/_chunk/ariaHideOutside.jsx +122 -0
  9. package/dist/_chunk/ariaHideOutside.jsx.map +1 -0
  10. package/dist/_chunk/autocomplete.js +196 -0
  11. package/dist/_chunk/autocomplete.js.map +1 -0
  12. package/dist/_chunk/autocomplete.jsx +196 -0
  13. package/dist/_chunk/autocomplete.jsx.map +1 -0
  14. package/dist/_chunk/breadcrumbs.js +119 -0
  15. package/dist/_chunk/breadcrumbs.js.map +1 -0
  16. package/dist/_chunk/breadcrumbs.jsx +119 -0
  17. package/dist/_chunk/breadcrumbs.jsx.map +1 -0
  18. package/dist/_chunk/button.js +276 -0
  19. package/dist/_chunk/button.js.map +1 -0
  20. package/dist/_chunk/button.jsx +276 -0
  21. package/dist/_chunk/button.jsx.map +1 -0
  22. package/dist/_chunk/calendar.js +1036 -0
  23. package/dist/_chunk/calendar.js.map +1 -0
  24. package/dist/_chunk/calendar.jsx +1036 -0
  25. package/dist/_chunk/calendar.jsx.map +1 -0
  26. package/dist/_chunk/checkbox.js +234 -0
  27. package/dist/_chunk/checkbox.js.map +1 -0
  28. package/dist/_chunk/checkbox.jsx +234 -0
  29. package/dist/_chunk/checkbox.jsx.map +1 -0
  30. package/dist/_chunk/color.js +1174 -0
  31. package/dist/_chunk/color.js.map +1 -0
  32. package/dist/_chunk/color.jsx +1174 -0
  33. package/dist/_chunk/color.jsx.map +1 -0
  34. package/dist/_chunk/combobox.js +436 -0
  35. package/dist/_chunk/combobox.js.map +1 -0
  36. package/dist/_chunk/combobox.jsx +436 -0
  37. package/dist/_chunk/combobox.jsx.map +1 -0
  38. package/dist/_chunk/createCollator.js +229 -0
  39. package/dist/_chunk/createCollator.js.map +1 -0
  40. package/dist/_chunk/createCollator.jsx +223 -0
  41. package/dist/_chunk/createCollator.jsx.map +1 -0
  42. package/dist/_chunk/createCollectionRowInteraction.js +133 -0
  43. package/dist/_chunk/createCollectionRowInteraction.js.map +1 -0
  44. package/dist/_chunk/createCollectionRowInteraction.jsx +133 -0
  45. package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -0
  46. package/dist/_chunk/createField.js +54 -0
  47. package/dist/_chunk/createField.js.map +1 -0
  48. package/dist/_chunk/createField.jsx +54 -0
  49. package/dist/_chunk/createField.jsx.map +1 -0
  50. package/dist/_chunk/createFocus.js +101 -0
  51. package/dist/_chunk/createFocus.js.map +1 -0
  52. package/dist/_chunk/createFocus.jsx +101 -0
  53. package/dist/_chunk/createFocus.jsx.map +1 -0
  54. package/dist/_chunk/createFocusRing.js +54 -0
  55. package/dist/_chunk/createFocusRing.js.map +1 -0
  56. package/dist/_chunk/createFocusRing.jsx +54 -0
  57. package/dist/_chunk/createFocusRing.jsx.map +1 -0
  58. package/dist/_chunk/createFocusWithin.js +121 -0
  59. package/dist/_chunk/createFocusWithin.js.map +1 -0
  60. package/dist/_chunk/createFocusWithin.jsx +121 -0
  61. package/dist/_chunk/createFocusWithin.jsx.map +1 -0
  62. package/dist/_chunk/createFocusable.js +131 -0
  63. package/dist/_chunk/createFocusable.js.map +1 -0
  64. package/dist/_chunk/createFocusable.jsx +131 -0
  65. package/dist/_chunk/createFocusable.jsx.map +1 -0
  66. package/dist/_chunk/createFormValidation.js +135 -0
  67. package/dist/_chunk/createFormValidation.js.map +1 -0
  68. package/dist/_chunk/createFormValidation.jsx +135 -0
  69. package/dist/_chunk/createFormValidation.jsx.map +1 -0
  70. package/dist/_chunk/createHover.js +130 -0
  71. package/dist/_chunk/createHover.js.map +1 -0
  72. package/dist/_chunk/createHover.jsx +130 -0
  73. package/dist/_chunk/createHover.jsx.map +1 -0
  74. package/dist/_chunk/createInteractionModality.js +269 -0
  75. package/dist/_chunk/createInteractionModality.js.map +1 -0
  76. package/dist/_chunk/createInteractionModality.jsx +269 -0
  77. package/dist/_chunk/createInteractionModality.jsx.map +1 -0
  78. package/dist/_chunk/createLabel.js +46 -0
  79. package/dist/_chunk/createLabel.js.map +1 -0
  80. package/dist/_chunk/createLabel.jsx +46 -0
  81. package/dist/_chunk/createLabel.jsx.map +1 -0
  82. package/dist/_chunk/createLabels.js +31 -0
  83. package/dist/_chunk/createLabels.js.map +1 -0
  84. package/dist/_chunk/createLabels.jsx +31 -0
  85. package/dist/_chunk/createLabels.jsx.map +1 -0
  86. package/dist/_chunk/createLandmark.js +198 -0
  87. package/dist/_chunk/createLandmark.js.map +1 -0
  88. package/dist/_chunk/createLandmark.jsx +198 -0
  89. package/dist/_chunk/createLandmark.jsx.map +1 -0
  90. package/dist/_chunk/createLongPress.js +91 -0
  91. package/dist/_chunk/createLongPress.js.map +1 -0
  92. package/dist/_chunk/createLongPress.jsx +91 -0
  93. package/dist/_chunk/createLongPress.jsx.map +1 -0
  94. package/dist/_chunk/createOverlay.js +327 -0
  95. package/dist/_chunk/createOverlay.js.map +1 -0
  96. package/dist/_chunk/createOverlay.jsx +327 -0
  97. package/dist/_chunk/createOverlay.jsx.map +1 -0
  98. package/dist/_chunk/createPress.js +526 -0
  99. package/dist/_chunk/createPress.js.map +1 -0
  100. package/dist/_chunk/createPress.jsx +526 -0
  101. package/dist/_chunk/createPress.jsx.map +1 -0
  102. package/dist/_chunk/createProgressBar.js +81 -0
  103. package/dist/_chunk/createProgressBar.js.map +1 -0
  104. package/dist/_chunk/createProgressBar.jsx +81 -0
  105. package/dist/_chunk/createProgressBar.jsx.map +1 -0
  106. package/dist/_chunk/createSelectableItem.js +298 -0
  107. package/dist/_chunk/createSelectableItem.js.map +1 -0
  108. package/dist/_chunk/createSelectableItem.jsx +298 -0
  109. package/dist/_chunk/createSelectableItem.jsx.map +1 -0
  110. package/dist/_chunk/createToggle.js +158 -0
  111. package/dist/_chunk/createToggle.js.map +1 -0
  112. package/dist/_chunk/createToggle.jsx +158 -0
  113. package/dist/_chunk/createToggle.jsx.map +1 -0
  114. package/dist/_chunk/createTypeSelect.js +125 -0
  115. package/dist/_chunk/createTypeSelect.js.map +1 -0
  116. package/dist/_chunk/createTypeSelect.jsx +125 -0
  117. package/dist/_chunk/createTypeSelect.jsx.map +1 -0
  118. package/dist/_chunk/datepicker.js +1393 -0
  119. package/dist/_chunk/datepicker.js.map +1 -0
  120. package/dist/_chunk/datepicker.jsx +1393 -0
  121. package/dist/_chunk/datepicker.jsx.map +1 -0
  122. package/dist/_chunk/dialog.js +62 -0
  123. package/dist/_chunk/dialog.js.map +1 -0
  124. package/dist/_chunk/dialog.jsx +62 -0
  125. package/dist/_chunk/dialog.jsx.map +1 -0
  126. package/dist/_chunk/disclosure.js +185 -0
  127. package/dist/_chunk/disclosure.js.map +1 -0
  128. package/dist/_chunk/disclosure.jsx +185 -0
  129. package/dist/_chunk/disclosure.jsx.map +1 -0
  130. package/dist/_chunk/dnd.js +1304 -0
  131. package/dist/_chunk/dnd.js.map +1 -0
  132. package/dist/_chunk/dnd.jsx +1304 -0
  133. package/dist/_chunk/dnd.jsx.map +1 -0
  134. package/dist/_chunk/env.js +105 -0
  135. package/dist/_chunk/env.js.map +1 -0
  136. package/dist/_chunk/env.jsx +105 -0
  137. package/dist/_chunk/env.jsx.map +1 -0
  138. package/dist/_chunk/filterDOMProps.js +82 -0
  139. package/dist/_chunk/filterDOMProps.js.map +1 -0
  140. package/dist/_chunk/filterDOMProps.jsx +82 -0
  141. package/dist/_chunk/filterDOMProps.jsx.map +1 -0
  142. package/dist/_chunk/focus.js +399 -0
  143. package/dist/_chunk/focus.js.map +1 -0
  144. package/dist/_chunk/focus.jsx +399 -0
  145. package/dist/_chunk/focus.jsx.map +1 -0
  146. package/dist/_chunk/focus2.js +895 -0
  147. package/dist/_chunk/focus2.js.map +1 -0
  148. package/dist/_chunk/focus2.jsx +870 -0
  149. package/dist/_chunk/focus2.jsx.map +1 -0
  150. package/dist/_chunk/form.js +39 -0
  151. package/dist/_chunk/form.js.map +1 -0
  152. package/dist/_chunk/form.jsx +39 -0
  153. package/dist/_chunk/form.jsx.map +1 -0
  154. package/dist/_chunk/grid.js +623 -0
  155. package/dist/_chunk/grid.js.map +1 -0
  156. package/dist/_chunk/grid.jsx +623 -0
  157. package/dist/_chunk/grid.jsx.map +1 -0
  158. package/dist/_chunk/gridlist.js +364 -0
  159. package/dist/_chunk/gridlist.js.map +1 -0
  160. package/dist/_chunk/gridlist.jsx +364 -0
  161. package/dist/_chunk/gridlist.jsx.map +1 -0
  162. package/dist/_chunk/i18n.js +254 -0
  163. package/dist/_chunk/i18n.js.map +1 -0
  164. package/dist/_chunk/i18n.jsx +254 -0
  165. package/dist/_chunk/i18n.jsx.map +1 -0
  166. package/dist/_chunk/interactions.js +241 -0
  167. package/dist/_chunk/interactions.js.map +1 -0
  168. package/dist/_chunk/interactions.jsx +237 -0
  169. package/dist/_chunk/interactions.jsx.map +1 -0
  170. package/dist/_chunk/link.js +96 -0
  171. package/dist/_chunk/link.js.map +1 -0
  172. package/dist/_chunk/link.jsx +96 -0
  173. package/dist/_chunk/link.jsx.map +1 -0
  174. package/dist/_chunk/listbox.js +324 -0
  175. package/dist/_chunk/listbox.js.map +1 -0
  176. package/dist/_chunk/listbox.jsx +324 -0
  177. package/dist/_chunk/listbox.jsx.map +1 -0
  178. package/dist/_chunk/live-announcer.js +207 -0
  179. package/dist/_chunk/live-announcer.js.map +1 -0
  180. package/dist/_chunk/live-announcer.jsx +207 -0
  181. package/dist/_chunk/live-announcer.jsx.map +1 -0
  182. package/dist/_chunk/menu.js +518 -0
  183. package/dist/_chunk/menu.js.map +1 -0
  184. package/dist/_chunk/menu.jsx +518 -0
  185. package/dist/_chunk/menu.jsx.map +1 -0
  186. package/dist/_chunk/meter.js +33 -0
  187. package/dist/_chunk/meter.js.map +1 -0
  188. package/dist/_chunk/meter.jsx +33 -0
  189. package/dist/_chunk/meter.jsx.map +1 -0
  190. package/dist/_chunk/numberfield.js +258 -0
  191. package/dist/_chunk/numberfield.js.map +1 -0
  192. package/dist/_chunk/numberfield.jsx +258 -0
  193. package/dist/_chunk/numberfield.jsx.map +1 -0
  194. package/dist/_chunk/overlays.js +186 -0
  195. package/dist/_chunk/overlays.js.map +1 -0
  196. package/dist/_chunk/overlays.jsx +162 -0
  197. package/dist/_chunk/overlays.jsx.map +1 -0
  198. package/dist/_chunk/popover.js +574 -0
  199. package/dist/_chunk/popover.js.map +1 -0
  200. package/dist/_chunk/popover.jsx +574 -0
  201. package/dist/_chunk/popover.jsx.map +1 -0
  202. package/dist/_chunk/radio.js +319 -0
  203. package/dist/_chunk/radio.js.map +1 -0
  204. package/dist/_chunk/radio.jsx +319 -0
  205. package/dist/_chunk/radio.jsx.map +1 -0
  206. package/dist/_chunk/searchfield.js +209 -0
  207. package/dist/_chunk/searchfield.js.map +1 -0
  208. package/dist/_chunk/searchfield.jsx +209 -0
  209. package/dist/_chunk/searchfield.jsx.map +1 -0
  210. package/dist/_chunk/select.js +403 -0
  211. package/dist/_chunk/select.js.map +1 -0
  212. package/dist/_chunk/select.jsx +394 -0
  213. package/dist/_chunk/select.jsx.map +1 -0
  214. package/dist/_chunk/selection.js +679 -0
  215. package/dist/_chunk/selection.js.map +1 -0
  216. package/dist/_chunk/selection.jsx +679 -0
  217. package/dist/_chunk/selection.jsx.map +1 -0
  218. package/dist/_chunk/separator.js +29 -0
  219. package/dist/_chunk/separator.js.map +1 -0
  220. package/dist/_chunk/separator.jsx +29 -0
  221. package/dist/_chunk/separator.jsx.map +1 -0
  222. package/dist/_chunk/slider.js +255 -0
  223. package/dist/_chunk/slider.js.map +1 -0
  224. package/dist/_chunk/slider.jsx +255 -0
  225. package/dist/_chunk/slider.jsx.map +1 -0
  226. package/dist/_chunk/steplist.js +66 -0
  227. package/dist/_chunk/steplist.js.map +1 -0
  228. package/dist/_chunk/steplist.jsx +66 -0
  229. package/dist/_chunk/steplist.jsx.map +1 -0
  230. package/dist/_chunk/switch.js +34 -0
  231. package/dist/_chunk/switch.js.map +1 -0
  232. package/dist/_chunk/switch.jsx +34 -0
  233. package/dist/_chunk/switch.jsx.map +1 -0
  234. package/dist/_chunk/table.js +1051 -0
  235. package/dist/_chunk/table.js.map +1 -0
  236. package/dist/_chunk/table.jsx +1051 -0
  237. package/dist/_chunk/table.jsx.map +1 -0
  238. package/dist/_chunk/tabs.js +260 -0
  239. package/dist/_chunk/tabs.js.map +1 -0
  240. package/dist/_chunk/tabs.jsx +260 -0
  241. package/dist/_chunk/tabs.jsx.map +1 -0
  242. package/dist/_chunk/tag.js +286 -0
  243. package/dist/_chunk/tag.js.map +1 -0
  244. package/dist/_chunk/tag.jsx +286 -0
  245. package/dist/_chunk/tag.jsx.map +1 -0
  246. package/dist/_chunk/textfield.js +109 -0
  247. package/dist/_chunk/textfield.js.map +1 -0
  248. package/dist/_chunk/textfield.jsx +109 -0
  249. package/dist/_chunk/textfield.jsx.map +1 -0
  250. package/dist/_chunk/toast.js +250 -0
  251. package/dist/_chunk/toast.js.map +1 -0
  252. package/dist/_chunk/toast.jsx +250 -0
  253. package/dist/_chunk/toast.jsx.map +1 -0
  254. package/dist/_chunk/toolbar.js +258 -0
  255. package/dist/_chunk/toolbar.js.map +1 -0
  256. package/dist/_chunk/toolbar.jsx +258 -0
  257. package/dist/_chunk/toolbar.jsx.map +1 -0
  258. package/dist/_chunk/tooltip.js +185 -0
  259. package/dist/_chunk/tooltip.js.map +1 -0
  260. package/dist/_chunk/tooltip.jsx +185 -0
  261. package/dist/_chunk/tooltip.jsx.map +1 -0
  262. package/dist/_chunk/tree.js +424 -0
  263. package/dist/_chunk/tree.js.map +1 -0
  264. package/dist/_chunk/tree.jsx +424 -0
  265. package/dist/_chunk/tree.jsx.map +1 -0
  266. package/dist/_chunk/utils.js +665 -0
  267. package/dist/_chunk/utils.js.map +1 -0
  268. package/dist/_chunk/utils.jsx +665 -0
  269. package/dist/_chunk/utils.jsx.map +1 -0
  270. package/dist/_chunk/visually-hidden.js +92 -0
  271. package/dist/_chunk/visually-hidden.js.map +1 -0
  272. package/dist/_chunk/visually-hidden.jsx +92 -0
  273. package/dist/_chunk/visually-hidden.jsx.map +1 -0
  274. package/dist/actiongroup/createActionGroup.d.ts +5 -5
  275. package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
  276. package/dist/actiongroup/index.d.ts +1 -1
  277. package/dist/actiongroup/index.js +2 -0
  278. package/dist/actiongroup/index.jsx +2 -0
  279. package/dist/autocomplete/createAutocomplete.d.ts +12 -10
  280. package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
  281. package/dist/autocomplete/index.d.ts +1 -1
  282. package/dist/autocomplete/index.d.ts.map +1 -1
  283. package/dist/autocomplete/index.js +2 -0
  284. package/dist/autocomplete/index.jsx +2 -0
  285. package/dist/breadcrumbs/createBreadcrumbs.d.ts +9 -7
  286. package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
  287. package/dist/breadcrumbs/index.d.ts +1 -1
  288. package/dist/breadcrumbs/index.js +2 -0
  289. package/dist/breadcrumbs/index.jsx +2 -0
  290. package/dist/button/createButton.d.ts +1 -1
  291. package/dist/button/createButton.d.ts.map +1 -1
  292. package/dist/button/createToggleButton.d.ts +3 -3
  293. package/dist/button/createToggleButtonGroup.d.ts +7 -7
  294. package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
  295. package/dist/button/index.d.ts +6 -6
  296. package/dist/button/index.d.ts.map +1 -1
  297. package/dist/button/index.js +2 -0
  298. package/dist/button/index.jsx +2 -0
  299. package/dist/button/types.d.ts +18 -12
  300. package/dist/button/types.d.ts.map +1 -1
  301. package/dist/calendar/createCalendar.d.ts +15 -5
  302. package/dist/calendar/createCalendar.d.ts.map +1 -1
  303. package/dist/calendar/createCalendarCell.d.ts +6 -2
  304. package/dist/calendar/createCalendarCell.d.ts.map +1 -1
  305. package/dist/calendar/createCalendarGrid.d.ts +4 -4
  306. package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
  307. package/dist/calendar/createCalendarMonthPicker.d.ts +41 -0
  308. package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -0
  309. package/dist/calendar/createCalendarYearPicker.d.ts +49 -0
  310. package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -0
  311. package/dist/calendar/createRangeCalendar.d.ts +15 -5
  312. package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
  313. package/dist/calendar/createRangeCalendarCell.d.ts +4 -2
  314. package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
  315. package/dist/calendar/index.d.ts +7 -5
  316. package/dist/calendar/index.d.ts.map +1 -1
  317. package/dist/calendar/index.js +2 -0
  318. package/dist/calendar/index.jsx +2 -0
  319. package/dist/calendar/intl/index.d.ts +12 -0
  320. package/dist/calendar/intl/index.d.ts.map +1 -0
  321. package/dist/calendar/utils.d.ts +16 -0
  322. package/dist/calendar/utils.d.ts.map +1 -0
  323. package/dist/checkbox/createCheckbox.d.ts +10 -6
  324. package/dist/checkbox/createCheckbox.d.ts.map +1 -1
  325. package/dist/checkbox/createCheckboxGroup.d.ts +7 -7
  326. package/dist/checkbox/createCheckboxGroup.d.ts.map +1 -1
  327. package/dist/checkbox/createCheckboxGroupItem.d.ts +4 -4
  328. package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
  329. package/dist/checkbox/createCheckboxGroupState.d.ts +2 -2
  330. package/dist/checkbox/createCheckboxGroupState.d.ts.map +1 -1
  331. package/dist/checkbox/index.d.ts +8 -8
  332. package/dist/checkbox/index.d.ts.map +1 -1
  333. package/dist/checkbox/index.js +2 -0
  334. package/dist/checkbox/index.jsx +2 -0
  335. package/dist/collections/index.d.ts +3 -3
  336. package/dist/collections/index.d.ts.map +1 -1
  337. package/dist/collections/index.js +160 -0
  338. package/dist/collections/index.js.map +1 -0
  339. package/dist/collections/index.jsx +160 -0
  340. package/dist/collections/index.jsx.map +1 -0
  341. package/dist/color/createColorArea.d.ts +3 -3
  342. package/dist/color/createColorArea.d.ts.map +1 -1
  343. package/dist/color/createColorField.d.ts +4 -4
  344. package/dist/color/createColorField.d.ts.map +1 -1
  345. package/dist/color/createColorSlider.d.ts +4 -4
  346. package/dist/color/createColorSlider.d.ts.map +1 -1
  347. package/dist/color/createColorSwatch.d.ts +2 -2
  348. package/dist/color/createColorSwatch.d.ts.map +1 -1
  349. package/dist/color/createColorWheel.d.ts +3 -3
  350. package/dist/color/createColorWheel.d.ts.map +1 -1
  351. package/dist/color/index.d.ts +6 -6
  352. package/dist/color/index.js +2 -0
  353. package/dist/color/index.jsx +2 -0
  354. package/dist/color/types.d.ts +98 -16
  355. package/dist/color/types.d.ts.map +1 -1
  356. package/dist/combobox/createComboBox.d.ts +10 -7
  357. package/dist/combobox/createComboBox.d.ts.map +1 -1
  358. package/dist/combobox/index.d.ts +1 -1
  359. package/dist/combobox/index.js +2 -0
  360. package/dist/combobox/index.jsx +2 -0
  361. package/dist/combobox/intl/index.d.ts +1 -1
  362. package/dist/datepicker/createDateField.d.ts +18 -6
  363. package/dist/datepicker/createDateField.d.ts.map +1 -1
  364. package/dist/datepicker/createDatePicker.d.ts +51 -5
  365. package/dist/datepicker/createDatePicker.d.ts.map +1 -1
  366. package/dist/datepicker/createDatePickerGroup.d.ts +19 -0
  367. package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -0
  368. package/dist/datepicker/createDateRangePicker.d.ts +8 -6
  369. package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
  370. package/dist/datepicker/createDateSegment.d.ts +10 -2
  371. package/dist/datepicker/createDateSegment.d.ts.map +1 -1
  372. package/dist/datepicker/createTimeField.d.ts +11 -5
  373. package/dist/datepicker/createTimeField.d.ts.map +1 -1
  374. package/dist/datepicker/createTimeSegment.d.ts +2 -2
  375. package/dist/datepicker/createTimeSegment.d.ts.map +1 -1
  376. package/dist/datepicker/index.d.ts +7 -6
  377. package/dist/datepicker/index.d.ts.map +1 -1
  378. package/dist/datepicker/index.js +2 -0
  379. package/dist/datepicker/index.jsx +2 -0
  380. package/dist/dialog/createDialog.d.ts +5 -5
  381. package/dist/dialog/createDialog.d.ts.map +1 -1
  382. package/dist/dialog/index.d.ts +2 -2
  383. package/dist/dialog/index.d.ts.map +1 -1
  384. package/dist/dialog/index.js +2 -0
  385. package/dist/dialog/index.jsx +2 -0
  386. package/dist/dialog/types.d.ts +4 -4
  387. package/dist/disclosure/createDisclosure.d.ts +5 -2
  388. package/dist/disclosure/createDisclosure.d.ts.map +1 -1
  389. package/dist/disclosure/createDisclosureGroup.d.ts +4 -4
  390. package/dist/disclosure/createDisclosureGroup.d.ts.map +1 -1
  391. package/dist/disclosure/index.d.ts +2 -2
  392. package/dist/disclosure/index.js +2 -0
  393. package/dist/disclosure/index.jsx +2 -0
  394. package/dist/dnd/createDrag.d.ts +2 -2
  395. package/dist/dnd/createDrag.d.ts.map +1 -1
  396. package/dist/dnd/createDraggableCollection.d.ts +2 -2
  397. package/dist/dnd/createDraggableItem.d.ts +3 -3
  398. package/dist/dnd/createDraggableItem.d.ts.map +1 -1
  399. package/dist/dnd/createDrop.d.ts +2 -2
  400. package/dist/dnd/createDrop.d.ts.map +1 -1
  401. package/dist/dnd/createDroppableCollection.d.ts +26 -6
  402. package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
  403. package/dist/dnd/createDroppableItem.d.ts +3 -3
  404. package/dist/dnd/index.d.ts +12 -12
  405. package/dist/dnd/index.d.ts.map +1 -1
  406. package/dist/dnd/index.js +2 -0
  407. package/dist/dnd/index.jsx +2 -0
  408. package/dist/dnd/types.d.ts +2 -2
  409. package/dist/dnd/types.d.ts.map +1 -1
  410. package/dist/dnd/utils.d.ts +2 -2
  411. package/dist/dnd/utils.d.ts.map +1 -1
  412. package/dist/focus/FocusScope.d.ts +1 -1
  413. package/dist/focus/FocusScope.d.ts.map +1 -1
  414. package/dist/focus/createAutoFocus.d.ts.map +1 -1
  415. package/dist/focus/createFocusRestore.d.ts.map +1 -1
  416. package/dist/focus/createVirtualFocus.d.ts +4 -4
  417. package/dist/focus/createVirtualFocus.d.ts.map +1 -1
  418. package/dist/focus/index.d.ts +4 -4
  419. package/dist/focus/index.d.ts.map +1 -1
  420. package/dist/focus/index.js +2 -0
  421. package/dist/focus/index.jsx +2 -0
  422. package/dist/form/createFormReset.d.ts +1 -1
  423. package/dist/form/createFormValidation.d.ts +3 -3
  424. package/dist/form/createFormValidation.d.ts.map +1 -1
  425. package/dist/form/index.d.ts +2 -2
  426. package/dist/form/index.d.ts.map +1 -1
  427. package/dist/form/index.js +3 -0
  428. package/dist/form/index.jsx +3 -0
  429. package/dist/grid/GridKeyboardDelegate.d.ts +5 -5
  430. package/dist/grid/createGrid.d.ts +3 -3
  431. package/dist/grid/createGridCell.d.ts +3 -3
  432. package/dist/grid/createGridRow.d.ts +3 -3
  433. package/dist/grid/index.d.ts +5 -5
  434. package/dist/grid/index.js +2 -0
  435. package/dist/grid/index.jsx +2 -0
  436. package/dist/grid/types.d.ts +8 -8
  437. package/dist/gridlist/createGridList.d.ts +12 -4
  438. package/dist/gridlist/createGridList.d.ts.map +1 -1
  439. package/dist/gridlist/createGridListItem.d.ts +4 -4
  440. package/dist/gridlist/createGridListItem.d.ts.map +1 -1
  441. package/dist/gridlist/createGridListSection.d.ts +15 -0
  442. package/dist/gridlist/createGridListSection.d.ts.map +1 -0
  443. package/dist/gridlist/createGridListSelectionCheckbox.d.ts +3 -3
  444. package/dist/gridlist/createGridListSelectionCheckbox.d.ts.map +1 -1
  445. package/dist/gridlist/index.d.ts +5 -4
  446. package/dist/gridlist/index.d.ts.map +1 -1
  447. package/dist/gridlist/index.js +2 -0
  448. package/dist/gridlist/index.jsx +2 -0
  449. package/dist/gridlist/types.d.ts +61 -7
  450. package/dist/gridlist/types.d.ts.map +1 -1
  451. package/dist/i18n/createCollator.d.ts.map +1 -1
  452. package/dist/i18n/createDateFormatter.d.ts.map +1 -1
  453. package/dist/i18n/createFilter.d.ts.map +1 -1
  454. package/dist/i18n/createNumberFormatter.d.ts +1 -1
  455. package/dist/i18n/createNumberFormatter.d.ts.map +1 -1
  456. package/dist/i18n/createStringFormatter.d.ts +2 -2
  457. package/dist/i18n/createStringFormatter.d.ts.map +1 -1
  458. package/dist/i18n/index.d.ts +8 -8
  459. package/dist/i18n/index.d.ts.map +1 -1
  460. package/dist/i18n/index.js +3 -0
  461. package/dist/i18n/index.jsx +3 -0
  462. package/dist/i18n/locale.d.ts +2 -2
  463. package/dist/i18n/locale.d.ts.map +1 -1
  464. package/dist/i18n/utils.d.ts.map +1 -1
  465. package/dist/index.d.ts +56 -51
  466. package/dist/index.d.ts.map +1 -1
  467. package/dist/index.js +71 -17119
  468. package/dist/index.jsx +71 -0
  469. package/dist/interactions/FocusableProvider.d.ts +2 -2
  470. package/dist/interactions/FocusableProvider.d.ts.map +1 -1
  471. package/dist/interactions/PressEvent.d.ts +13 -2
  472. package/dist/interactions/PressEvent.d.ts.map +1 -1
  473. package/dist/interactions/createFocus.d.ts +1 -1
  474. package/dist/interactions/createFocus.d.ts.map +1 -1
  475. package/dist/interactions/createFocusRing.d.ts +1 -1
  476. package/dist/interactions/createFocusRing.d.ts.map +1 -1
  477. package/dist/interactions/createFocusWithin.d.ts +1 -1
  478. package/dist/interactions/createFocusWithin.d.ts.map +1 -1
  479. package/dist/interactions/createFocusable.d.ts +3 -3
  480. package/dist/interactions/createFocusable.d.ts.map +1 -1
  481. package/dist/interactions/createHover.d.ts +5 -5
  482. package/dist/interactions/createHover.d.ts.map +1 -1
  483. package/dist/interactions/createInteractionModality.d.ts +3 -4
  484. package/dist/interactions/createInteractionModality.d.ts.map +1 -1
  485. package/dist/interactions/createKeyboard.d.ts +1 -1
  486. package/dist/interactions/createKeyboard.d.ts.map +1 -1
  487. package/dist/interactions/createLongPress.d.ts +5 -5
  488. package/dist/interactions/createMove.d.ts +5 -5
  489. package/dist/interactions/createMove.d.ts.map +1 -1
  490. package/dist/interactions/createPress.d.ts +4 -4
  491. package/dist/interactions/createPress.d.ts.map +1 -1
  492. package/dist/interactions/index.d.ts +12 -12
  493. package/dist/interactions/index.d.ts.map +1 -1
  494. package/dist/interactions/index.js +10 -0
  495. package/dist/interactions/index.jsx +10 -0
  496. package/dist/label/createField.d.ts +4 -4
  497. package/dist/label/createField.d.ts.map +1 -1
  498. package/dist/label/createLabel.d.ts +7 -7
  499. package/dist/label/createLabel.d.ts.map +1 -1
  500. package/dist/label/createLabels.d.ts +1 -1
  501. package/dist/label/createLabels.d.ts.map +1 -1
  502. package/dist/label/index.d.ts +5 -5
  503. package/dist/label/index.js +4 -0
  504. package/dist/label/index.jsx +4 -0
  505. package/dist/landmark/createLandmark.d.ts +5 -5
  506. package/dist/landmark/createLandmark.d.ts.map +1 -1
  507. package/dist/landmark/index.d.ts +1 -1
  508. package/dist/landmark/index.js +2 -0
  509. package/dist/landmark/index.jsx +2 -0
  510. package/dist/link/createLink.d.ts +14 -8
  511. package/dist/link/createLink.d.ts.map +1 -1
  512. package/dist/link/index.d.ts +1 -1
  513. package/dist/link/index.js +2 -0
  514. package/dist/link/index.jsx +2 -0
  515. package/dist/listbox/createListBox.d.ts +48 -6
  516. package/dist/listbox/createListBox.d.ts.map +1 -1
  517. package/dist/listbox/createOption.d.ts +27 -4
  518. package/dist/listbox/createOption.d.ts.map +1 -1
  519. package/dist/listbox/index.d.ts +2 -2
  520. package/dist/listbox/index.d.ts.map +1 -1
  521. package/dist/listbox/index.js +2 -0
  522. package/dist/listbox/index.jsx +2 -0
  523. package/dist/live-announcer/announce.d.ts +2 -2
  524. package/dist/live-announcer/announce.d.ts.map +1 -1
  525. package/dist/live-announcer/index.d.ts +1 -1
  526. package/dist/live-announcer/index.js +2 -0
  527. package/dist/live-announcer/index.jsx +2 -0
  528. package/dist/menu/createMenu.d.ts +14 -11
  529. package/dist/menu/createMenu.d.ts.map +1 -1
  530. package/dist/menu/createMenuItem.d.ts +25 -5
  531. package/dist/menu/createMenuItem.d.ts.map +1 -1
  532. package/dist/menu/createMenuTrigger.d.ts +4 -4
  533. package/dist/menu/index.d.ts +3 -3
  534. package/dist/menu/index.d.ts.map +1 -1
  535. package/dist/menu/index.js +2 -0
  536. package/dist/menu/index.jsx +2 -0
  537. package/dist/meter/createMeter.d.ts +6 -6
  538. package/dist/meter/createMeter.d.ts.map +1 -1
  539. package/dist/meter/index.d.ts +1 -1
  540. package/dist/meter/index.js +2 -0
  541. package/dist/meter/index.jsx +2 -0
  542. package/dist/numberfield/createNumberField.d.ts +9 -8
  543. package/dist/numberfield/createNumberField.d.ts.map +1 -1
  544. package/dist/numberfield/index.d.ts +1 -1
  545. package/dist/numberfield/index.js +2 -0
  546. package/dist/numberfield/index.jsx +2 -0
  547. package/dist/overlays/ariaHideOutside.d.ts.map +1 -1
  548. package/dist/overlays/createModal.d.ts +3 -3
  549. package/dist/overlays/createModal.d.ts.map +1 -1
  550. package/dist/overlays/createOverlay.d.ts +1 -1
  551. package/dist/overlays/createOverlay.d.ts.map +1 -1
  552. package/dist/overlays/createOverlayTrigger.d.ts +6 -6
  553. package/dist/overlays/index.d.ts +6 -6
  554. package/dist/overlays/index.d.ts.map +1 -1
  555. package/dist/overlays/index.js +4 -0
  556. package/dist/overlays/index.jsx +4 -0
  557. package/dist/popover/calculatePosition.d.ts +6 -4
  558. package/dist/popover/calculatePosition.d.ts.map +1 -1
  559. package/dist/popover/createOverlayPosition.d.ts +11 -3
  560. package/dist/popover/createOverlayPosition.d.ts.map +1 -1
  561. package/dist/popover/createPopover.d.ts +4 -4
  562. package/dist/popover/createPopover.d.ts.map +1 -1
  563. package/dist/popover/index.d.ts +3 -3
  564. package/dist/popover/index.js +2 -0
  565. package/dist/popover/index.jsx +2 -0
  566. package/dist/progress/createProgressBar.d.ts +7 -5
  567. package/dist/progress/createProgressBar.d.ts.map +1 -1
  568. package/dist/progress/index.d.ts +1 -1
  569. package/dist/progress/index.js +2 -0
  570. package/dist/progress/index.jsx +2 -0
  571. package/dist/radio/createRadio.d.ts +9 -7
  572. package/dist/radio/createRadio.d.ts.map +1 -1
  573. package/dist/radio/createRadioGroup.d.ts +10 -10
  574. package/dist/radio/createRadioGroup.d.ts.map +1 -1
  575. package/dist/radio/createRadioGroupState.d.ts +3 -3
  576. package/dist/radio/createRadioGroupState.d.ts.map +1 -1
  577. package/dist/radio/index.d.ts +3 -3
  578. package/dist/radio/index.d.ts.map +1 -1
  579. package/dist/radio/index.js +2 -0
  580. package/dist/radio/index.jsx +2 -0
  581. package/dist/searchfield/createSearchField.d.ts +7 -7
  582. package/dist/searchfield/createSearchField.d.ts.map +1 -1
  583. package/dist/searchfield/index.d.ts +2 -2
  584. package/dist/searchfield/index.js +2 -0
  585. package/dist/searchfield/index.jsx +2 -0
  586. package/dist/select/createHiddenSelect.d.ts +4 -4
  587. package/dist/select/createHiddenSelect.d.ts.map +1 -1
  588. package/dist/select/createSelect.d.ts +14 -6
  589. package/dist/select/createSelect.d.ts.map +1 -1
  590. package/dist/select/index.d.ts +2 -2
  591. package/dist/select/index.d.ts.map +1 -1
  592. package/dist/select/index.js +2 -0
  593. package/dist/select/index.jsx +2 -0
  594. package/dist/selection/DOMLayoutDelegate.d.ts +58 -0
  595. package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -0
  596. package/dist/selection/ListKeyboardDelegate.d.ts +95 -0
  597. package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -0
  598. package/dist/selection/constants.d.ts +15 -0
  599. package/dist/selection/constants.d.ts.map +1 -0
  600. package/dist/selection/createCollectionRowInteraction.d.ts +13 -0
  601. package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -0
  602. package/dist/selection/createScrollIntoViewOnFocus.d.ts +31 -0
  603. package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -0
  604. package/dist/selection/createSelectableCollection.d.ts +69 -0
  605. package/dist/selection/createSelectableCollection.d.ts.map +1 -0
  606. package/dist/selection/createSelectableItem.d.ts +154 -0
  607. package/dist/selection/createSelectableItem.d.ts.map +1 -0
  608. package/dist/selection/createSelectableList.d.ts +43 -0
  609. package/dist/selection/createSelectableList.d.ts.map +1 -0
  610. package/dist/selection/createTypeSelect.d.ts +2 -2
  611. package/dist/selection/createTypeSelect.d.ts.map +1 -1
  612. package/dist/selection/index.d.ts +10 -1
  613. package/dist/selection/index.d.ts.map +1 -1
  614. package/dist/selection/index.js +4 -0
  615. package/dist/selection/index.jsx +4 -0
  616. package/dist/selection/selectItem.d.ts +29 -0
  617. package/dist/selection/selectItem.d.ts.map +1 -0
  618. package/dist/selection/utils.d.ts +40 -0
  619. package/dist/selection/utils.d.ts.map +1 -0
  620. package/dist/separator/createSeparator.d.ts +9 -5
  621. package/dist/separator/createSeparator.d.ts.map +1 -1
  622. package/dist/separator/index.d.ts +1 -1
  623. package/dist/separator/index.js +2 -0
  624. package/dist/separator/index.jsx +2 -0
  625. package/dist/slider/createSlider.d.ts +11 -7
  626. package/dist/slider/createSlider.d.ts.map +1 -1
  627. package/dist/slider/index.d.ts +2 -2
  628. package/dist/slider/index.js +2 -0
  629. package/dist/slider/index.jsx +2 -0
  630. package/dist/ssr/index.d.ts +18 -1
  631. package/dist/ssr/index.d.ts.map +1 -1
  632. package/dist/ssr/index.js +299 -0
  633. package/dist/ssr/index.js.map +1 -0
  634. package/dist/ssr/index.jsx +292 -0
  635. package/dist/ssr/index.jsx.map +1 -0
  636. package/dist/steplist/createStepList.d.ts +36 -0
  637. package/dist/steplist/createStepList.d.ts.map +1 -0
  638. package/dist/steplist/index.d.ts +2 -0
  639. package/dist/steplist/index.d.ts.map +1 -0
  640. package/dist/steplist/index.js +2 -0
  641. package/dist/steplist/index.jsx +2 -0
  642. package/dist/switch/createSwitch.d.ts +10 -4
  643. package/dist/switch/createSwitch.d.ts.map +1 -1
  644. package/dist/switch/index.d.ts +1 -1
  645. package/dist/switch/index.js +2 -0
  646. package/dist/switch/index.jsx +2 -0
  647. package/dist/table/createTable.d.ts +3 -3
  648. package/dist/table/createTable.d.ts.map +1 -1
  649. package/dist/table/createTableCell.d.ts +3 -3
  650. package/dist/table/createTableCell.d.ts.map +1 -1
  651. package/dist/table/createTableColumnHeader.d.ts +3 -3
  652. package/dist/table/createTableColumnHeader.d.ts.map +1 -1
  653. package/dist/table/createTableColumnResize.d.ts +41 -0
  654. package/dist/table/createTableColumnResize.d.ts.map +1 -0
  655. package/dist/table/createTableHeaderRow.d.ts +3 -3
  656. package/dist/table/createTableRow.d.ts +4 -4
  657. package/dist/table/createTableRow.d.ts.map +1 -1
  658. package/dist/table/createTableRowGroup.d.ts +2 -2
  659. package/dist/table/createTableRowGroup.d.ts.map +1 -1
  660. package/dist/table/createTableSelectAllCheckbox.d.ts +3 -3
  661. package/dist/table/createTableSelectionCheckbox.d.ts +3 -3
  662. package/dist/table/index.d.ts +11 -9
  663. package/dist/table/index.d.ts.map +1 -1
  664. package/dist/table/index.js +2 -0
  665. package/dist/table/index.jsx +2 -0
  666. package/dist/table/types.d.ts +41 -7
  667. package/dist/table/types.d.ts.map +1 -1
  668. package/dist/tabs/createTabs.d.ts +32 -28
  669. package/dist/tabs/createTabs.d.ts.map +1 -1
  670. package/dist/tabs/index.d.ts +1 -1
  671. package/dist/tabs/index.js +2 -0
  672. package/dist/tabs/index.jsx +2 -0
  673. package/dist/tag/createTag.d.ts +4 -2
  674. package/dist/tag/createTag.d.ts.map +1 -1
  675. package/dist/tag/createTagGroup.d.ts +5 -5
  676. package/dist/tag/createTagGroup.d.ts.map +1 -1
  677. package/dist/tag/index.d.ts +2 -2
  678. package/dist/tag/index.d.ts.map +1 -1
  679. package/dist/tag/index.js +2 -0
  680. package/dist/tag/index.jsx +2 -0
  681. package/dist/textfield/createTextField.d.ts +17 -11
  682. package/dist/textfield/createTextField.d.ts.map +1 -1
  683. package/dist/textfield/index.d.ts +1 -1
  684. package/dist/textfield/index.d.ts.map +1 -1
  685. package/dist/textfield/index.js +2 -0
  686. package/dist/textfield/index.jsx +2 -0
  687. package/dist/toast/createToast.d.ts +2 -2
  688. package/dist/toast/createToast.d.ts.map +1 -1
  689. package/dist/toast/createToastRegion.d.ts +5 -3
  690. package/dist/toast/createToastRegion.d.ts.map +1 -1
  691. package/dist/toast/index.d.ts +2 -2
  692. package/dist/toast/index.d.ts.map +1 -1
  693. package/dist/toast/index.js +2 -0
  694. package/dist/toast/index.jsx +2 -0
  695. package/dist/toggle/createToggle.d.ts +13 -9
  696. package/dist/toggle/createToggle.d.ts.map +1 -1
  697. package/dist/toggle/createToggleState.d.ts +2 -2
  698. package/dist/toggle/createToggleState.d.ts.map +1 -1
  699. package/dist/toggle/index.d.ts +4 -4
  700. package/dist/toggle/index.d.ts.map +1 -1
  701. package/dist/toggle/index.js +3 -0
  702. package/dist/toggle/index.jsx +3 -0
  703. package/dist/toolbar/createToolbar.d.ts +9 -9
  704. package/dist/toolbar/createToolbar.d.ts.map +1 -1
  705. package/dist/toolbar/index.d.ts +1 -1
  706. package/dist/toolbar/index.d.ts.map +1 -1
  707. package/dist/toolbar/index.js +2 -0
  708. package/dist/toolbar/index.jsx +2 -0
  709. package/dist/tooltip/createTooltip.d.ts +5 -5
  710. package/dist/tooltip/createTooltip.d.ts.map +1 -1
  711. package/dist/tooltip/createTooltipTrigger.d.ts +10 -5
  712. package/dist/tooltip/createTooltipTrigger.d.ts.map +1 -1
  713. package/dist/tooltip/index.d.ts +2 -2
  714. package/dist/tooltip/index.js +2 -0
  715. package/dist/tooltip/index.jsx +2 -0
  716. package/dist/tree/createTree.d.ts +8 -4
  717. package/dist/tree/createTree.d.ts.map +1 -1
  718. package/dist/tree/createTreeItem.d.ts +4 -4
  719. package/dist/tree/createTreeItem.d.ts.map +1 -1
  720. package/dist/tree/createTreeSelectionCheckbox.d.ts +3 -3
  721. package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
  722. package/dist/tree/index.d.ts +4 -4
  723. package/dist/tree/index.js +2 -0
  724. package/dist/tree/index.jsx +2 -0
  725. package/dist/tree/types.d.ts +20 -6
  726. package/dist/tree/types.d.ts.map +1 -1
  727. package/dist/utils/animation.d.ts +60 -0
  728. package/dist/utils/animation.d.ts.map +1 -0
  729. package/dist/utils/createDescription.d.ts +2 -2
  730. package/dist/utils/createDescription.d.ts.map +1 -1
  731. package/dist/utils/dom.d.ts +48 -2
  732. package/dist/utils/dom.d.ts.map +1 -1
  733. package/dist/utils/env.d.ts.map +1 -1
  734. package/dist/utils/focus.d.ts +1 -1
  735. package/dist/utils/focus.d.ts.map +1 -1
  736. package/dist/utils/geometry.d.ts.map +1 -1
  737. package/dist/utils/index.d.ts +15 -12
  738. package/dist/utils/index.d.ts.map +1 -1
  739. package/dist/utils/index.js +5 -0
  740. package/dist/utils/index.jsx +5 -0
  741. package/dist/utils/keyboard.d.ts +17 -0
  742. package/dist/utils/keyboard.d.ts.map +1 -0
  743. package/dist/utils/mergeProps.d.ts.map +1 -1
  744. package/dist/utils/reactivity.d.ts +1 -1
  745. package/dist/utils/scrollIntoView.d.ts +30 -0
  746. package/dist/utils/scrollIntoView.d.ts.map +1 -0
  747. package/dist/visually-hidden/createVisuallyHidden.d.ts +2 -2
  748. package/dist/visually-hidden/createVisuallyHidden.d.ts.map +1 -1
  749. package/dist/visually-hidden/index.d.ts +1 -1
  750. package/dist/visually-hidden/index.js +2 -0
  751. package/dist/visually-hidden/index.jsx +2 -0
  752. package/package.json +334 -33
  753. package/src/actiongroup/createActionGroup.ts +101 -91
  754. package/src/actiongroup/index.ts +1 -1
  755. package/src/autocomplete/createAutocomplete.ts +177 -148
  756. package/src/autocomplete/index.ts +1 -1
  757. package/src/breadcrumbs/createBreadcrumbs.ts +33 -42
  758. package/src/breadcrumbs/index.ts +1 -1
  759. package/src/button/createButton.ts +102 -73
  760. package/src/button/createToggleButton.ts +10 -10
  761. package/src/button/createToggleButtonGroup.ts +25 -32
  762. package/src/button/index.ts +6 -9
  763. package/src/button/types.ts +18 -12
  764. package/src/calendar/createCalendar.ts +64 -29
  765. package/src/calendar/createCalendarCell.ts +115 -46
  766. package/src/calendar/createCalendarGrid.ts +97 -41
  767. package/src/calendar/createCalendarMonthPicker.ts +105 -0
  768. package/src/calendar/createCalendarYearPicker.ts +144 -0
  769. package/src/calendar/createRangeCalendar.ts +68 -31
  770. package/src/calendar/createRangeCalendarCell.ts +92 -31
  771. package/src/calendar/index.ts +21 -8
  772. package/src/calendar/intl/index.ts +210 -0
  773. package/src/calendar/utils.ts +231 -0
  774. package/src/checkbox/createCheckbox.ts +23 -21
  775. package/src/checkbox/createCheckboxGroup.ts +68 -44
  776. package/src/checkbox/createCheckboxGroupItem.ts +26 -41
  777. package/src/checkbox/createCheckboxGroupState.ts +3 -22
  778. package/src/checkbox/index.ts +8 -10
  779. package/src/collections/index.ts +33 -29
  780. package/src/color/createColorArea.ts +232 -154
  781. package/src/color/createColorField.ts +107 -58
  782. package/src/color/createColorSlider.ts +231 -73
  783. package/src/color/createColorSwatch.ts +38 -13
  784. package/src/color/createColorWheel.ts +208 -83
  785. package/src/color/index.ts +6 -6
  786. package/src/color/types.ts +98 -16
  787. package/src/combobox/createComboBox.ts +157 -100
  788. package/src/combobox/index.ts +1 -1
  789. package/src/combobox/intl/index.ts +5 -5
  790. package/src/datepicker/createDateField.ts +192 -39
  791. package/src/datepicker/createDatePicker.ts +260 -67
  792. package/src/datepicker/createDatePickerGroup.ts +149 -0
  793. package/src/datepicker/createDateRangePicker.ts +105 -57
  794. package/src/datepicker/createDateSegment.ts +188 -96
  795. package/src/datepicker/createTimeField.ts +38 -34
  796. package/src/datepicker/createTimeSegment.ts +67 -85
  797. package/src/datepicker/index.ts +13 -14
  798. package/src/dialog/createDialog.ts +45 -38
  799. package/src/dialog/index.ts +2 -2
  800. package/src/dialog/types.ts +4 -4
  801. package/src/disclosure/createDisclosure.ts +138 -33
  802. package/src/disclosure/createDisclosureGroup.ts +8 -21
  803. package/src/disclosure/index.ts +2 -2
  804. package/src/dnd/createDrag.ts +19 -25
  805. package/src/dnd/createDraggableCollection.ts +4 -4
  806. package/src/dnd/createDraggableItem.ts +20 -19
  807. package/src/dnd/createDrop.ts +42 -51
  808. package/src/dnd/createDroppableCollection.ts +293 -173
  809. package/src/dnd/createDroppableItem.ts +34 -34
  810. package/src/dnd/index.ts +23 -12
  811. package/src/dnd/types.ts +4 -7
  812. package/src/dnd/utils.ts +58 -47
  813. package/src/focus/FocusScope.tsx +301 -176
  814. package/src/focus/createAutoFocus.ts +4 -20
  815. package/src/focus/createFocusRestore.ts +15 -28
  816. package/src/focus/createVirtualFocus.ts +20 -36
  817. package/src/focus/index.ts +4 -8
  818. package/src/form/createFormReset.ts +4 -4
  819. package/src/form/createFormValidation.ts +23 -39
  820. package/src/form/index.ts +2 -5
  821. package/src/grid/GridKeyboardDelegate.ts +30 -30
  822. package/src/grid/createGrid.ts +36 -36
  823. package/src/grid/createGridCell.ts +18 -18
  824. package/src/grid/createGridRow.ts +14 -14
  825. package/src/grid/index.ts +5 -5
  826. package/src/grid/types.ts +8 -8
  827. package/src/gridlist/createGridList.ts +172 -64
  828. package/src/gridlist/createGridListItem.ts +98 -121
  829. package/src/gridlist/createGridListSection.ts +54 -0
  830. package/src/gridlist/createGridListSelectionCheckbox.ts +12 -9
  831. package/src/gridlist/index.ts +7 -4
  832. package/src/gridlist/types.ts +58 -7
  833. package/src/i18n/createCollator.ts +5 -18
  834. package/src/i18n/createDateFormatter.ts +5 -13
  835. package/src/i18n/createFilter.ts +11 -24
  836. package/src/i18n/createNumberFormatter.ts +4 -6
  837. package/src/i18n/createStringFormatter.ts +19 -15
  838. package/src/i18n/index.ts +8 -11
  839. package/src/i18n/locale.tsx +15 -40
  840. package/src/i18n/utils.ts +35 -39
  841. package/src/index.ts +111 -172
  842. package/src/interactions/FocusableProvider.tsx +3 -7
  843. package/src/interactions/PressEvent.ts +18 -4
  844. package/src/interactions/createFocus.ts +12 -8
  845. package/src/interactions/createFocusRing.ts +21 -19
  846. package/src/interactions/createFocusWithin.ts +20 -13
  847. package/src/interactions/createFocusable.ts +15 -16
  848. package/src/interactions/createHover.ts +70 -55
  849. package/src/interactions/createInteractionModality.ts +96 -94
  850. package/src/interactions/createKeyboard.ts +12 -2
  851. package/src/interactions/createLongPress.ts +23 -23
  852. package/src/interactions/createMove.ts +72 -62
  853. package/src/interactions/createPress.ts +192 -92
  854. package/src/interactions/index.ts +24 -16
  855. package/src/label/createField.ts +18 -19
  856. package/src/label/createLabel.ts +18 -30
  857. package/src/label/createLabels.ts +8 -12
  858. package/src/label/index.ts +5 -5
  859. package/src/landmark/createLandmark.ts +30 -51
  860. package/src/landmark/index.ts +1 -1
  861. package/src/link/createLink.ts +83 -56
  862. package/src/link/index.ts +1 -1
  863. package/src/listbox/createListBox.ts +198 -66
  864. package/src/listbox/createOption.ts +112 -71
  865. package/src/listbox/index.ts +2 -6
  866. package/src/live-announcer/announce.ts +44 -71
  867. package/src/live-announcer/index.ts +1 -1
  868. package/src/menu/createMenu.ts +171 -65
  869. package/src/menu/createMenuItem.ts +315 -51
  870. package/src/menu/createMenuTrigger.ts +15 -15
  871. package/src/menu/index.ts +3 -12
  872. package/src/meter/createMeter.ts +7 -15
  873. package/src/meter/index.ts +1 -1
  874. package/src/numberfield/createNumberField.ts +205 -80
  875. package/src/numberfield/index.ts +1 -1
  876. package/src/overlays/ariaHideOutside.ts +14 -10
  877. package/src/overlays/createInteractOutside.ts +21 -18
  878. package/src/overlays/createModal.tsx +17 -17
  879. package/src/overlays/createOverlay.ts +38 -8
  880. package/src/overlays/createOverlayTrigger.ts +16 -16
  881. package/src/overlays/createPreventScroll.ts +46 -24
  882. package/src/overlays/index.ts +6 -17
  883. package/src/popover/calculatePosition.ts +134 -124
  884. package/src/popover/createOverlayPosition.ts +55 -40
  885. package/src/popover/createPopover.ts +42 -17
  886. package/src/popover/index.ts +3 -3
  887. package/src/progress/createProgressBar.ts +31 -32
  888. package/src/progress/index.ts +1 -1
  889. package/src/radio/createRadio.ts +114 -75
  890. package/src/radio/createRadioGroup.ts +83 -77
  891. package/src/radio/createRadioGroupState.ts +7 -31
  892. package/src/radio/index.ts +3 -8
  893. package/src/searchfield/createSearchField.ts +57 -29
  894. package/src/searchfield/index.ts +2 -2
  895. package/src/select/createHiddenSelect.tsx +57 -44
  896. package/src/select/createSelect.ts +146 -73
  897. package/src/select/index.ts +2 -7
  898. package/src/selection/DOMLayoutDelegate.ts +102 -0
  899. package/src/selection/ListKeyboardDelegate.ts +398 -0
  900. package/src/selection/constants.ts +16 -0
  901. package/src/selection/createCollectionRowInteraction.ts +209 -0
  902. package/src/selection/createScrollIntoViewOnFocus.ts +65 -0
  903. package/src/selection/createSelectableCollection.ts +645 -0
  904. package/src/selection/createSelectableItem.ts +498 -0
  905. package/src/selection/createSelectableList.ts +93 -0
  906. package/src/selection/createTypeSelect.ts +120 -59
  907. package/src/selection/index.ts +32 -1
  908. package/src/selection/selectItem.ts +80 -0
  909. package/src/selection/utils.ts +82 -0
  910. package/src/separator/createSeparator.ts +20 -25
  911. package/src/separator/index.ts +1 -1
  912. package/src/slider/createSlider.ts +128 -112
  913. package/src/slider/index.ts +2 -2
  914. package/src/ssr/index.tsx +38 -46
  915. package/src/steplist/createStepList.ts +106 -0
  916. package/src/steplist/index.ts +8 -0
  917. package/src/switch/createSwitch.ts +19 -14
  918. package/src/switch/index.ts +1 -1
  919. package/src/table/createTable.ts +192 -95
  920. package/src/table/createTableCell.ts +17 -16
  921. package/src/table/createTableColumnHeader.ts +67 -20
  922. package/src/table/createTableColumnResize.ts +256 -0
  923. package/src/table/createTableHeaderRow.ts +7 -7
  924. package/src/table/createTableRow.ts +206 -91
  925. package/src/table/createTableRowGroup.ts +5 -7
  926. package/src/table/createTableSelectAllCheckbox.ts +14 -14
  927. package/src/table/createTableSelectionCheckbox.ts +8 -8
  928. package/src/table/index.ts +14 -9
  929. package/src/table/types.ts +43 -7
  930. package/src/tabs/createTabs.ts +123 -111
  931. package/src/tabs/index.ts +1 -1
  932. package/src/tag/createTag.ts +57 -50
  933. package/src/tag/createTagGroup.ts +47 -41
  934. package/src/tag/index.ts +2 -6
  935. package/src/textfield/createTextField.ts +67 -35
  936. package/src/textfield/index.ts +1 -5
  937. package/src/toast/createToast.ts +29 -26
  938. package/src/toast/createToastRegion.ts +169 -26
  939. package/src/toast/index.ts +2 -6
  940. package/src/toggle/createToggle.ts +115 -53
  941. package/src/toggle/createToggleState.ts +2 -10
  942. package/src/toggle/index.ts +4 -5
  943. package/src/toolbar/createToolbar.ts +214 -230
  944. package/src/toolbar/index.ts +1 -1
  945. package/src/tooltip/createTooltip.ts +11 -24
  946. package/src/tooltip/createTooltipTrigger.ts +61 -49
  947. package/src/tooltip/index.ts +2 -2
  948. package/src/tree/createTree.ts +128 -72
  949. package/src/tree/createTreeItem.ts +120 -135
  950. package/src/tree/createTreeSelectionCheckbox.ts +11 -8
  951. package/src/tree/index.ts +4 -4
  952. package/src/tree/types.ts +20 -6
  953. package/src/utils/animation.ts +151 -0
  954. package/src/utils/createDescription.ts +6 -23
  955. package/src/utils/dom.ts +265 -68
  956. package/src/utils/env.ts +9 -11
  957. package/src/utils/events.ts +7 -7
  958. package/src/utils/filterDOMProps.ts +49 -49
  959. package/src/utils/focus.ts +60 -68
  960. package/src/utils/geometry.ts +1 -4
  961. package/src/utils/globalListeners.ts +9 -9
  962. package/src/utils/index.ts +20 -22
  963. package/src/utils/keyboard.ts +25 -0
  964. package/src/utils/mergeProps.ts +49 -15
  965. package/src/utils/platform.ts +2 -2
  966. package/src/utils/reactivity.ts +3 -3
  967. package/src/utils/scrollIntoView.ts +181 -0
  968. package/src/utils/textSelection.ts +16 -16
  969. package/src/visually-hidden/createVisuallyHidden.ts +16 -28
  970. package/src/visually-hidden/index.ts +1 -1
  971. package/dist/i18n/NumberFormatter.d.ts +0 -43
  972. package/dist/i18n/NumberFormatter.d.ts.map +0 -1
  973. package/dist/index.js.map +0 -1
  974. package/dist/index.ssr.js +0 -17082
  975. package/dist/index.ssr.js.map +0 -1
  976. package/src/i18n/NumberFormatter.ts +0 -266
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFocusRing.jsx","names":["isGlobalFocusVisible","isFocusVisible"],"sources":["../../src/interactions/createFocusRing.ts"],"sourcesContent":["/**\n * createFocusRing hook for Solidaria\n *\n * Determines whether a focus ring should be visible for a given element.\n * Focus rings are visible when the user navigates with keyboard, but hidden\n * when using mouse/touch.\n *\n * Port of @react-aria/focus useFocusRing.\n */\n\nimport {\n type JSX,\n type Accessor,\n createSignal,\n createEffect,\n onCleanup,\n createMemo,\n} from \"solid-js\";\nimport { createFocus } from \"./createFocus\";\nimport { createFocusWithin } from \"./createFocusWithin\";\nimport {\n createFocusVisibleListener,\n isFocusVisible as isGlobalFocusVisible,\n} from \"./createInteractionModality\";\n\nexport interface FocusRingProps {\n /** Whether the element is a text input. */\n isTextInput?: boolean;\n /** Whether the element will be auto focused. */\n autoFocus?: boolean;\n /** Whether focus should be tracked within the element. */\n within?: boolean;\n}\n\nexport interface FocusRingResult {\n /** Whether the element is currently focused. */\n isFocused: Accessor<boolean>;\n /** Whether the focus ring should be visible. */\n isFocusVisible: Accessor<boolean>;\n /** Props to spread on the element to track focus. */\n focusProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Determines whether a focus ring should be visible for a given element.\n *\n * Focus rings are visible when:\n * - The element is focused AND\n * - The user is navigating with keyboard (not mouse/touch)\n *\n * For text inputs, focus rings are always visible when focused.\n */\nexport function createFocusRing(props: FocusRingProps = {}): FocusRingResult {\n const { isTextInput = false, autoFocus = false, within = false } = props;\n\n const [isFocused, setIsFocused] = createSignal(false);\n const [focusVisibleFlag, setFocusVisibleFlag] = createSignal(autoFocus || isGlobalFocusVisible());\n const isFocusVisible = createMemo(() => isFocused() && focusVisibleFlag());\n\n createEffect(() => {\n const cleanup = createFocusVisibleListener(\n (visible) => {\n setFocusVisibleFlag(visible);\n },\n { isTextInput },\n );\n onCleanup(cleanup);\n });\n\n const onFocusChange = (focused: boolean) => {\n setIsFocused(focused);\n };\n\n const focusResult = createFocus({\n isDisabled: within,\n onFocusChange,\n });\n\n const focusWithinResult = createFocusWithin({\n isDisabled: !within,\n onFocusWithinChange: onFocusChange,\n });\n\n return {\n isFocused,\n isFocusVisible,\n focusProps: (within\n ? focusWithinResult.focusWithinProps\n : focusResult.focusProps) as JSX.HTMLAttributes<HTMLElement>,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAgB,gBAAgB,QAAwB,CAAC,GAAoB;CAC3E,MAAM,EAAE,cAAc,OAAO,YAAY,OAAO,SAAS,UAAU;CAEnE,MAAM,CAAC,WAAW,gBAAgB,aAAa,KAAK;CACpD,MAAM,CAAC,kBAAkB,uBAAuB,aAAa,aAAaA,eAAqB,CAAC;CAChG,MAAMC,mBAAiB,iBAAiB,UAAU,KAAK,iBAAiB,CAAC;CAEzE,mBAAmB;EAOjB,UANgB,4BACb,YAAY;GACX,oBAAoB,OAAO;EAC7B,GACA,EAAE,YAAY,CAEA,CAAC;CACnB,CAAC;CAED,MAAM,iBAAiB,YAAqB;EAC1C,aAAa,OAAO;CACtB;CAEA,MAAM,cAAc,YAAY;EAC9B,YAAY;EACZ;CACF,CAAC;CAED,MAAM,oBAAoB,kBAAkB;EAC1C,YAAY,CAAC;EACb,qBAAqB;CACvB,CAAC;CAED,OAAO;EACL;EACA,gBAAA;EACA,YAAa,SACT,kBAAkB,mBAClB,YAAY;CAClB;AACF"}
@@ -0,0 +1,121 @@
1
+ import { h as setEventTarget, s as createGlobalListeners } from "./utils.js";
2
+ import { a as getEventTarget, s as getOwnerDocument, y as nodeContains } from "./focus.js";
3
+ import { onCleanup } from "solid-js";
4
+ //#region src/interactions/createFocusWithin.ts
5
+ /**
6
+ * createFocusWithin - Handles focus events for the target and its descendants.
7
+ *
8
+ * This is a 1-1 port of React-Aria's useFocusWithin hook adapted for SolidJS.
9
+ */
10
+ function getActiveElement(doc) {
11
+ let activeElement = doc.activeElement;
12
+ while (activeElement && activeElement.shadowRoot?.activeElement) activeElement = activeElement.shadowRoot?.activeElement ?? null;
13
+ return activeElement;
14
+ }
15
+ function createSyntheticBlurHandler() {
16
+ let isFocused = false;
17
+ let observer = null;
18
+ return (_e, target) => {
19
+ if (target instanceof HTMLButtonElement || target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) {
20
+ isFocused = true;
21
+ const onBlurHandler = () => {
22
+ isFocused = false;
23
+ if (observer) {
24
+ observer.disconnect();
25
+ observer = null;
26
+ }
27
+ };
28
+ target.addEventListener("focusout", onBlurHandler, { once: true });
29
+ observer = new MutationObserver(() => {
30
+ if (isFocused && target.disabled) {
31
+ isFocused = false;
32
+ observer?.disconnect();
33
+ observer = null;
34
+ const ownerDocument = target.ownerDocument;
35
+ const relatedTarget = target === ownerDocument.activeElement ? null : ownerDocument.activeElement;
36
+ target.dispatchEvent(new FocusEvent("blur", { relatedTarget }));
37
+ target.dispatchEvent(new FocusEvent("focusout", {
38
+ bubbles: true,
39
+ relatedTarget
40
+ }));
41
+ }
42
+ });
43
+ observer.observe(target, {
44
+ attributes: true,
45
+ attributeFilter: ["disabled"]
46
+ });
47
+ return () => {
48
+ if (observer) {
49
+ observer.disconnect();
50
+ observer = null;
51
+ }
52
+ };
53
+ }
54
+ };
55
+ }
56
+ /**
57
+ * Handles focus events for the target and its descendants.
58
+ *
59
+ * Based on react-aria's useFocusWithin but adapted for SolidJS.
60
+ */
61
+ function createFocusWithin(props = {}) {
62
+ const { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props;
63
+ let isFocusWithin = false;
64
+ const { addGlobalListener, removeAllGlobalListeners } = createGlobalListeners();
65
+ const syntheticBlurHandler = createSyntheticBlurHandler();
66
+ let cleanupRef;
67
+ onCleanup(() => {
68
+ cleanupRef?.();
69
+ removeAllGlobalListeners();
70
+ });
71
+ const onBlur = (e) => {
72
+ if (!e.currentTarget.contains(e.target)) return;
73
+ if (isFocusWithin && !e.currentTarget.contains(e.relatedTarget)) {
74
+ isFocusWithin = false;
75
+ removeAllGlobalListeners();
76
+ cleanupRef?.();
77
+ cleanupRef = void 0;
78
+ if (onBlurWithin) onBlurWithin(e);
79
+ if (onFocusWithinChange) onFocusWithinChange(false);
80
+ }
81
+ };
82
+ const onFocus = (e) => {
83
+ if (!e.currentTarget.contains(e.target)) return;
84
+ const ownerDocument = getOwnerDocument(e.target);
85
+ const activeElement = ownerDocument ? getActiveElement(ownerDocument) : null;
86
+ if (!isFocusWithin && activeElement === getEventTarget(e)) {
87
+ if (onFocusWithin) onFocusWithin(e);
88
+ if (onFocusWithinChange) onFocusWithinChange(true);
89
+ isFocusWithin = true;
90
+ cleanupRef = syntheticBlurHandler(e, e.target);
91
+ const currentTarget = e.currentTarget;
92
+ addGlobalListener("focus", (focusEvent) => {
93
+ if (isFocusWithin && !nodeContains(currentTarget, focusEvent.target)) {
94
+ const window = ownerDocument?.defaultView;
95
+ if (window) {
96
+ const nativeEvent = new window.FocusEvent("blur", { relatedTarget: focusEvent.target });
97
+ setEventTarget(nativeEvent, currentTarget);
98
+ isFocusWithin = false;
99
+ removeAllGlobalListeners();
100
+ if (onBlurWithin) onBlurWithin(nativeEvent);
101
+ if (onFocusWithinChange) onFocusWithinChange(false);
102
+ cleanupRef?.();
103
+ cleanupRef = void 0;
104
+ }
105
+ }
106
+ }, { capture: true });
107
+ }
108
+ };
109
+ if (isDisabled) return { focusWithinProps: {
110
+ onFocus: void 0,
111
+ onBlur: void 0
112
+ } };
113
+ return { focusWithinProps: {
114
+ onFocus,
115
+ onBlur
116
+ } };
117
+ }
118
+ //#endregion
119
+ export { createFocusWithin as t };
120
+
121
+ //# sourceMappingURL=createFocusWithin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFocusWithin.js","names":[],"sources":["../../src/interactions/createFocusWithin.ts"],"sourcesContent":["/**\n * createFocusWithin - Handles focus events for the target and its descendants.\n *\n * This is a 1-1 port of React-Aria's useFocusWithin hook adapted for SolidJS.\n */\n\nimport { JSX, onCleanup } from \"solid-js\";\nimport { getOwnerDocument, getEventTarget, nodeContains, createGlobalListeners } from \"../utils\";\nimport { setEventTarget } from \"../utils/events\";\n\nexport interface FocusWithinProps {\n /** Whether the focus within events should be disabled. */\n isDisabled?: boolean;\n /** Handler that is called when the target element or a descendant receives focus. */\n onFocusWithin?: (e: FocusEvent) => void;\n /** Handler that is called when the target element and all descendants lose focus. */\n onBlurWithin?: (e: FocusEvent) => void;\n /** Handler that is called when the focus within state changes. */\n onFocusWithinChange?: (isFocusWithin: boolean) => void;\n}\n\nexport interface FocusWithinResult {\n /** Props to spread onto the target element. */\n focusWithinProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\nfunction getActiveElement(doc: Document): Element | null {\n let activeElement = doc.activeElement;\n while (activeElement && (activeElement as Element).shadowRoot?.activeElement) {\n activeElement = (activeElement as Element).shadowRoot?.activeElement ?? null;\n }\n return activeElement;\n}\n\nfunction createSyntheticBlurHandler(): (\n _e: FocusEvent,\n target: Element,\n) => (() => void) | undefined {\n let isFocused = false;\n let observer: MutationObserver | null = null;\n\n return (_e: FocusEvent, target: Element) => {\n if (\n target instanceof HTMLButtonElement ||\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement\n ) {\n isFocused = true;\n\n const onBlurHandler = () => {\n isFocused = false;\n\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n };\n\n target.addEventListener(\"focusout\", onBlurHandler, { once: true });\n\n observer = new MutationObserver(() => {\n if (isFocused && (target as HTMLButtonElement).disabled) {\n isFocused = false;\n observer?.disconnect();\n observer = null;\n const ownerDocument = target.ownerDocument;\n const relatedTarget =\n target === ownerDocument.activeElement ? null : ownerDocument.activeElement;\n target.dispatchEvent(new FocusEvent(\"blur\", { relatedTarget }));\n target.dispatchEvent(new FocusEvent(\"focusout\", { bubbles: true, relatedTarget }));\n }\n });\n\n observer.observe(target, { attributes: true, attributeFilter: [\"disabled\"] });\n\n return () => {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n };\n }\n\n return undefined;\n };\n}\n\n/**\n * Handles focus events for the target and its descendants.\n *\n * Based on react-aria's useFocusWithin but adapted for SolidJS.\n */\nexport function createFocusWithin(props: FocusWithinProps = {}): FocusWithinResult {\n const { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props;\n\n // State tracking\n let isFocusWithin = false;\n\n // Global listeners manager\n const { addGlobalListener, removeAllGlobalListeners } = createGlobalListeners();\n const syntheticBlurHandler = createSyntheticBlurHandler();\n let cleanupRef: (() => void) | undefined;\n\n // Cleanup on unmount\n onCleanup(() => {\n cleanupRef?.();\n removeAllGlobalListeners();\n });\n\n const onBlur: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Ignore events bubbling through portals\n if (!e.currentTarget.contains(e.target as Node)) {\n return;\n }\n\n // We don't want to trigger onBlurWithin and then immediately onFocusWithin again\n // when moving focus inside the element. Only trigger if the currentTarget doesn't\n // include the relatedTarget (where focus is moving).\n if (isFocusWithin && !e.currentTarget.contains(e.relatedTarget as Node)) {\n isFocusWithin = false;\n removeAllGlobalListeners();\n cleanupRef?.();\n cleanupRef = undefined;\n\n if (onBlurWithin) {\n onBlurWithin(e);\n }\n\n if (onFocusWithinChange) {\n onFocusWithinChange(false);\n }\n }\n };\n\n const onFocus: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Ignore events bubbling through portals\n if (!e.currentTarget.contains(e.target as Node)) {\n return;\n }\n\n // Double check that document.activeElement actually matches e.target\n // in case a previously chained focus handler already moved focus somewhere else.\n const ownerDocument = getOwnerDocument(e.target);\n const activeElement = ownerDocument ? getActiveElement(ownerDocument) : null;\n\n if (!isFocusWithin && activeElement === getEventTarget(e)) {\n if (onFocusWithin) {\n onFocusWithin(e);\n }\n\n if (onFocusWithinChange) {\n onFocusWithinChange(true);\n }\n\n isFocusWithin = true;\n cleanupRef = syntheticBlurHandler(e, e.target);\n\n // Browsers don't fire blur events when elements are removed from the DOM.\n // However, if a focus event occurs outside the element we're tracking, we\n // can manually fire onBlur.\n const currentTarget = e.currentTarget;\n\n addGlobalListener(\n \"focus\",\n (focusEvent: Event) => {\n if (\n isFocusWithin &&\n !nodeContains(currentTarget, (focusEvent as FocusEvent).target as Element)\n ) {\n // Create a synthetic blur event\n const window = ownerDocument?.defaultView;\n if (window) {\n const nativeEvent = new window.FocusEvent(\"blur\", {\n relatedTarget: (focusEvent as FocusEvent).target as Element,\n });\n setEventTarget(nativeEvent, currentTarget);\n\n isFocusWithin = false;\n removeAllGlobalListeners();\n\n if (onBlurWithin) {\n onBlurWithin(nativeEvent);\n }\n\n if (onFocusWithinChange) {\n onFocusWithinChange(false);\n }\n cleanupRef?.();\n cleanupRef = undefined;\n }\n }\n },\n { capture: true },\n );\n }\n };\n\n if (isDisabled) {\n return {\n focusWithinProps: {\n onFocus: undefined,\n onBlur: undefined,\n },\n };\n }\n\n return {\n focusWithinProps: {\n onFocus,\n onBlur,\n },\n };\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAS,iBAAiB,KAA+B;CACvD,IAAI,gBAAgB,IAAI;CACxB,OAAO,iBAAkB,cAA0B,YAAY,eAC7D,gBAAiB,cAA0B,YAAY,iBAAiB;CAE1E,OAAO;AACT;AAEA,SAAS,6BAGqB;CAC5B,IAAI,YAAY;CAChB,IAAI,WAAoC;CAExC,QAAQ,IAAgB,WAAoB;EAC1C,IACE,kBAAkB,qBAClB,kBAAkB,oBAClB,kBAAkB,uBAClB,kBAAkB,mBAClB;GACA,YAAY;GAEZ,MAAM,sBAAsB;IAC1B,YAAY;IAEZ,IAAI,UAAU;KACZ,SAAS,WAAW;KACpB,WAAW;IACb;GACF;GAEA,OAAO,iBAAiB,YAAY,eAAe,EAAE,MAAM,KAAK,CAAC;GAEjE,WAAW,IAAI,uBAAuB;IACpC,IAAI,aAAc,OAA6B,UAAU;KACvD,YAAY;KACZ,UAAU,WAAW;KACrB,WAAW;KACX,MAAM,gBAAgB,OAAO;KAC7B,MAAM,gBACJ,WAAW,cAAc,gBAAgB,OAAO,cAAc;KAChE,OAAO,cAAc,IAAI,WAAW,QAAQ,EAAE,cAAc,CAAC,CAAC;KAC9D,OAAO,cAAc,IAAI,WAAW,YAAY;MAAE,SAAS;MAAM;KAAc,CAAC,CAAC;IACnF;GACF,CAAC;GAED,SAAS,QAAQ,QAAQ;IAAE,YAAY;IAAM,iBAAiB,CAAC,UAAU;GAAE,CAAC;GAE5E,aAAa;IACX,IAAI,UAAU;KACZ,SAAS,WAAW;KACpB,WAAW;IACb;GACF;EACF;CAGF;AACF;;;;;;AAOA,SAAgB,kBAAkB,QAA0B,CAAC,GAAsB;CACjF,MAAM,EAAE,YAAY,cAAc,eAAe,wBAAwB;CAGzE,IAAI,gBAAgB;CAGpB,MAAM,EAAE,mBAAmB,6BAA6B,sBAAsB;CAC9E,MAAM,uBAAuB,2BAA2B;CACxD,IAAI;CAGJ,gBAAgB;EACd,aAAa;EACb,yBAAyB;CAC3B,CAAC;CAED,MAAM,UAAqD,MAAM;EAE/D,IAAI,CAAC,EAAE,cAAc,SAAS,EAAE,MAAc,GAC5C;EAMF,IAAI,iBAAiB,CAAC,EAAE,cAAc,SAAS,EAAE,aAAqB,GAAG;GACvE,gBAAgB;GAChB,yBAAyB;GACzB,aAAa;GACb,aAAa,KAAA;GAEb,IAAI,cACF,aAAa,CAAC;GAGhB,IAAI,qBACF,oBAAoB,KAAK;EAE7B;CACF;CAEA,MAAM,WAAsD,MAAM;EAEhE,IAAI,CAAC,EAAE,cAAc,SAAS,EAAE,MAAc,GAC5C;EAKF,MAAM,gBAAgB,iBAAiB,EAAE,MAAM;EAC/C,MAAM,gBAAgB,gBAAgB,iBAAiB,aAAa,IAAI;EAExE,IAAI,CAAC,iBAAiB,kBAAkB,eAAe,CAAC,GAAG;GACzD,IAAI,eACF,cAAc,CAAC;GAGjB,IAAI,qBACF,oBAAoB,IAAI;GAG1B,gBAAgB;GAChB,aAAa,qBAAqB,GAAG,EAAE,MAAM;GAK7C,MAAM,gBAAgB,EAAE;GAExB,kBACE,UACC,eAAsB;IACrB,IACE,iBACA,CAAC,aAAa,eAAgB,WAA0B,MAAiB,GACzE;KAEA,MAAM,SAAS,eAAe;KAC9B,IAAI,QAAQ;MACV,MAAM,cAAc,IAAI,OAAO,WAAW,QAAQ,EAChD,eAAgB,WAA0B,OAC5C,CAAC;MACD,eAAe,aAAa,aAAa;MAEzC,gBAAgB;MAChB,yBAAyB;MAEzB,IAAI,cACF,aAAa,WAAW;MAG1B,IAAI,qBACF,oBAAoB,KAAK;MAE3B,aAAa;MACb,aAAa,KAAA;KACf;IACF;GACF,GACA,EAAE,SAAS,KAAK,CAClB;EACF;CACF;CAEA,IAAI,YACF,OAAO,EACL,kBAAkB;EAChB,SAAS,KAAA;EACT,QAAQ,KAAA;CACV,EACF;CAGF,OAAO,EACL,kBAAkB;EAChB;EACA;CACF,EACF;AACF"}
@@ -0,0 +1,121 @@
1
+ import { h as setEventTarget, s as createGlobalListeners } from "./utils.jsx";
2
+ import { a as getEventTarget, s as getOwnerDocument, y as nodeContains } from "./focus.jsx";
3
+ import { onCleanup } from "solid-js";
4
+ //#region src/interactions/createFocusWithin.ts
5
+ /**
6
+ * createFocusWithin - Handles focus events for the target and its descendants.
7
+ *
8
+ * This is a 1-1 port of React-Aria's useFocusWithin hook adapted for SolidJS.
9
+ */
10
+ function getActiveElement(doc) {
11
+ let activeElement = doc.activeElement;
12
+ while (activeElement && activeElement.shadowRoot?.activeElement) activeElement = activeElement.shadowRoot?.activeElement ?? null;
13
+ return activeElement;
14
+ }
15
+ function createSyntheticBlurHandler() {
16
+ let isFocused = false;
17
+ let observer = null;
18
+ return (_e, target) => {
19
+ if (target instanceof HTMLButtonElement || target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) {
20
+ isFocused = true;
21
+ const onBlurHandler = () => {
22
+ isFocused = false;
23
+ if (observer) {
24
+ observer.disconnect();
25
+ observer = null;
26
+ }
27
+ };
28
+ target.addEventListener("focusout", onBlurHandler, { once: true });
29
+ observer = new MutationObserver(() => {
30
+ if (isFocused && target.disabled) {
31
+ isFocused = false;
32
+ observer?.disconnect();
33
+ observer = null;
34
+ const ownerDocument = target.ownerDocument;
35
+ const relatedTarget = target === ownerDocument.activeElement ? null : ownerDocument.activeElement;
36
+ target.dispatchEvent(new FocusEvent("blur", { relatedTarget }));
37
+ target.dispatchEvent(new FocusEvent("focusout", {
38
+ bubbles: true,
39
+ relatedTarget
40
+ }));
41
+ }
42
+ });
43
+ observer.observe(target, {
44
+ attributes: true,
45
+ attributeFilter: ["disabled"]
46
+ });
47
+ return () => {
48
+ if (observer) {
49
+ observer.disconnect();
50
+ observer = null;
51
+ }
52
+ };
53
+ }
54
+ };
55
+ }
56
+ /**
57
+ * Handles focus events for the target and its descendants.
58
+ *
59
+ * Based on react-aria's useFocusWithin but adapted for SolidJS.
60
+ */
61
+ function createFocusWithin(props = {}) {
62
+ const { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props;
63
+ let isFocusWithin = false;
64
+ const { addGlobalListener, removeAllGlobalListeners } = createGlobalListeners();
65
+ const syntheticBlurHandler = createSyntheticBlurHandler();
66
+ let cleanupRef;
67
+ onCleanup(() => {
68
+ cleanupRef?.();
69
+ removeAllGlobalListeners();
70
+ });
71
+ const onBlur = (e) => {
72
+ if (!e.currentTarget.contains(e.target)) return;
73
+ if (isFocusWithin && !e.currentTarget.contains(e.relatedTarget)) {
74
+ isFocusWithin = false;
75
+ removeAllGlobalListeners();
76
+ cleanupRef?.();
77
+ cleanupRef = void 0;
78
+ if (onBlurWithin) onBlurWithin(e);
79
+ if (onFocusWithinChange) onFocusWithinChange(false);
80
+ }
81
+ };
82
+ const onFocus = (e) => {
83
+ if (!e.currentTarget.contains(e.target)) return;
84
+ const ownerDocument = getOwnerDocument(e.target);
85
+ const activeElement = ownerDocument ? getActiveElement(ownerDocument) : null;
86
+ if (!isFocusWithin && activeElement === getEventTarget(e)) {
87
+ if (onFocusWithin) onFocusWithin(e);
88
+ if (onFocusWithinChange) onFocusWithinChange(true);
89
+ isFocusWithin = true;
90
+ cleanupRef = syntheticBlurHandler(e, e.target);
91
+ const currentTarget = e.currentTarget;
92
+ addGlobalListener("focus", (focusEvent) => {
93
+ if (isFocusWithin && !nodeContains(currentTarget, focusEvent.target)) {
94
+ const window = ownerDocument?.defaultView;
95
+ if (window) {
96
+ const nativeEvent = new window.FocusEvent("blur", { relatedTarget: focusEvent.target });
97
+ setEventTarget(nativeEvent, currentTarget);
98
+ isFocusWithin = false;
99
+ removeAllGlobalListeners();
100
+ if (onBlurWithin) onBlurWithin(nativeEvent);
101
+ if (onFocusWithinChange) onFocusWithinChange(false);
102
+ cleanupRef?.();
103
+ cleanupRef = void 0;
104
+ }
105
+ }
106
+ }, { capture: true });
107
+ }
108
+ };
109
+ if (isDisabled) return { focusWithinProps: {
110
+ onFocus: void 0,
111
+ onBlur: void 0
112
+ } };
113
+ return { focusWithinProps: {
114
+ onFocus,
115
+ onBlur
116
+ } };
117
+ }
118
+ //#endregion
119
+ export { createFocusWithin as t };
120
+
121
+ //# sourceMappingURL=createFocusWithin.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFocusWithin.jsx","names":[],"sources":["../../src/interactions/createFocusWithin.ts"],"sourcesContent":["/**\n * createFocusWithin - Handles focus events for the target and its descendants.\n *\n * This is a 1-1 port of React-Aria's useFocusWithin hook adapted for SolidJS.\n */\n\nimport { JSX, onCleanup } from \"solid-js\";\nimport { getOwnerDocument, getEventTarget, nodeContains, createGlobalListeners } from \"../utils\";\nimport { setEventTarget } from \"../utils/events\";\n\nexport interface FocusWithinProps {\n /** Whether the focus within events should be disabled. */\n isDisabled?: boolean;\n /** Handler that is called when the target element or a descendant receives focus. */\n onFocusWithin?: (e: FocusEvent) => void;\n /** Handler that is called when the target element and all descendants lose focus. */\n onBlurWithin?: (e: FocusEvent) => void;\n /** Handler that is called when the focus within state changes. */\n onFocusWithinChange?: (isFocusWithin: boolean) => void;\n}\n\nexport interface FocusWithinResult {\n /** Props to spread onto the target element. */\n focusWithinProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\nfunction getActiveElement(doc: Document): Element | null {\n let activeElement = doc.activeElement;\n while (activeElement && (activeElement as Element).shadowRoot?.activeElement) {\n activeElement = (activeElement as Element).shadowRoot?.activeElement ?? null;\n }\n return activeElement;\n}\n\nfunction createSyntheticBlurHandler(): (\n _e: FocusEvent,\n target: Element,\n) => (() => void) | undefined {\n let isFocused = false;\n let observer: MutationObserver | null = null;\n\n return (_e: FocusEvent, target: Element) => {\n if (\n target instanceof HTMLButtonElement ||\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement\n ) {\n isFocused = true;\n\n const onBlurHandler = () => {\n isFocused = false;\n\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n };\n\n target.addEventListener(\"focusout\", onBlurHandler, { once: true });\n\n observer = new MutationObserver(() => {\n if (isFocused && (target as HTMLButtonElement).disabled) {\n isFocused = false;\n observer?.disconnect();\n observer = null;\n const ownerDocument = target.ownerDocument;\n const relatedTarget =\n target === ownerDocument.activeElement ? null : ownerDocument.activeElement;\n target.dispatchEvent(new FocusEvent(\"blur\", { relatedTarget }));\n target.dispatchEvent(new FocusEvent(\"focusout\", { bubbles: true, relatedTarget }));\n }\n });\n\n observer.observe(target, { attributes: true, attributeFilter: [\"disabled\"] });\n\n return () => {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n };\n }\n\n return undefined;\n };\n}\n\n/**\n * Handles focus events for the target and its descendants.\n *\n * Based on react-aria's useFocusWithin but adapted for SolidJS.\n */\nexport function createFocusWithin(props: FocusWithinProps = {}): FocusWithinResult {\n const { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props;\n\n // State tracking\n let isFocusWithin = false;\n\n // Global listeners manager\n const { addGlobalListener, removeAllGlobalListeners } = createGlobalListeners();\n const syntheticBlurHandler = createSyntheticBlurHandler();\n let cleanupRef: (() => void) | undefined;\n\n // Cleanup on unmount\n onCleanup(() => {\n cleanupRef?.();\n removeAllGlobalListeners();\n });\n\n const onBlur: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Ignore events bubbling through portals\n if (!e.currentTarget.contains(e.target as Node)) {\n return;\n }\n\n // We don't want to trigger onBlurWithin and then immediately onFocusWithin again\n // when moving focus inside the element. Only trigger if the currentTarget doesn't\n // include the relatedTarget (where focus is moving).\n if (isFocusWithin && !e.currentTarget.contains(e.relatedTarget as Node)) {\n isFocusWithin = false;\n removeAllGlobalListeners();\n cleanupRef?.();\n cleanupRef = undefined;\n\n if (onBlurWithin) {\n onBlurWithin(e);\n }\n\n if (onFocusWithinChange) {\n onFocusWithinChange(false);\n }\n }\n };\n\n const onFocus: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Ignore events bubbling through portals\n if (!e.currentTarget.contains(e.target as Node)) {\n return;\n }\n\n // Double check that document.activeElement actually matches e.target\n // in case a previously chained focus handler already moved focus somewhere else.\n const ownerDocument = getOwnerDocument(e.target);\n const activeElement = ownerDocument ? getActiveElement(ownerDocument) : null;\n\n if (!isFocusWithin && activeElement === getEventTarget(e)) {\n if (onFocusWithin) {\n onFocusWithin(e);\n }\n\n if (onFocusWithinChange) {\n onFocusWithinChange(true);\n }\n\n isFocusWithin = true;\n cleanupRef = syntheticBlurHandler(e, e.target);\n\n // Browsers don't fire blur events when elements are removed from the DOM.\n // However, if a focus event occurs outside the element we're tracking, we\n // can manually fire onBlur.\n const currentTarget = e.currentTarget;\n\n addGlobalListener(\n \"focus\",\n (focusEvent: Event) => {\n if (\n isFocusWithin &&\n !nodeContains(currentTarget, (focusEvent as FocusEvent).target as Element)\n ) {\n // Create a synthetic blur event\n const window = ownerDocument?.defaultView;\n if (window) {\n const nativeEvent = new window.FocusEvent(\"blur\", {\n relatedTarget: (focusEvent as FocusEvent).target as Element,\n });\n setEventTarget(nativeEvent, currentTarget);\n\n isFocusWithin = false;\n removeAllGlobalListeners();\n\n if (onBlurWithin) {\n onBlurWithin(nativeEvent);\n }\n\n if (onFocusWithinChange) {\n onFocusWithinChange(false);\n }\n cleanupRef?.();\n cleanupRef = undefined;\n }\n }\n },\n { capture: true },\n );\n }\n };\n\n if (isDisabled) {\n return {\n focusWithinProps: {\n onFocus: undefined,\n onBlur: undefined,\n },\n };\n }\n\n return {\n focusWithinProps: {\n onFocus,\n onBlur,\n },\n };\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAS,iBAAiB,KAA+B;CACvD,IAAI,gBAAgB,IAAI;CACxB,OAAO,iBAAkB,cAA0B,YAAY,eAC7D,gBAAiB,cAA0B,YAAY,iBAAiB;CAE1E,OAAO;AACT;AAEA,SAAS,6BAGqB;CAC5B,IAAI,YAAY;CAChB,IAAI,WAAoC;CAExC,QAAQ,IAAgB,WAAoB;EAC1C,IACE,kBAAkB,qBAClB,kBAAkB,oBAClB,kBAAkB,uBAClB,kBAAkB,mBAClB;GACA,YAAY;GAEZ,MAAM,sBAAsB;IAC1B,YAAY;IAEZ,IAAI,UAAU;KACZ,SAAS,WAAW;KACpB,WAAW;IACb;GACF;GAEA,OAAO,iBAAiB,YAAY,eAAe,EAAE,MAAM,KAAK,CAAC;GAEjE,WAAW,IAAI,uBAAuB;IACpC,IAAI,aAAc,OAA6B,UAAU;KACvD,YAAY;KACZ,UAAU,WAAW;KACrB,WAAW;KACX,MAAM,gBAAgB,OAAO;KAC7B,MAAM,gBACJ,WAAW,cAAc,gBAAgB,OAAO,cAAc;KAChE,OAAO,cAAc,IAAI,WAAW,QAAQ,EAAE,cAAc,CAAC,CAAC;KAC9D,OAAO,cAAc,IAAI,WAAW,YAAY;MAAE,SAAS;MAAM;KAAc,CAAC,CAAC;IACnF;GACF,CAAC;GAED,SAAS,QAAQ,QAAQ;IAAE,YAAY;IAAM,iBAAiB,CAAC,UAAU;GAAE,CAAC;GAE5E,aAAa;IACX,IAAI,UAAU;KACZ,SAAS,WAAW;KACpB,WAAW;IACb;GACF;EACF;CAGF;AACF;;;;;;AAOA,SAAgB,kBAAkB,QAA0B,CAAC,GAAsB;CACjF,MAAM,EAAE,YAAY,cAAc,eAAe,wBAAwB;CAGzE,IAAI,gBAAgB;CAGpB,MAAM,EAAE,mBAAmB,6BAA6B,sBAAsB;CAC9E,MAAM,uBAAuB,2BAA2B;CACxD,IAAI;CAGJ,gBAAgB;EACd,aAAa;EACb,yBAAyB;CAC3B,CAAC;CAED,MAAM,UAAqD,MAAM;EAE/D,IAAI,CAAC,EAAE,cAAc,SAAS,EAAE,MAAc,GAC5C;EAMF,IAAI,iBAAiB,CAAC,EAAE,cAAc,SAAS,EAAE,aAAqB,GAAG;GACvE,gBAAgB;GAChB,yBAAyB;GACzB,aAAa;GACb,aAAa,KAAA;GAEb,IAAI,cACF,aAAa,CAAC;GAGhB,IAAI,qBACF,oBAAoB,KAAK;EAE7B;CACF;CAEA,MAAM,WAAsD,MAAM;EAEhE,IAAI,CAAC,EAAE,cAAc,SAAS,EAAE,MAAc,GAC5C;EAKF,MAAM,gBAAgB,iBAAiB,EAAE,MAAM;EAC/C,MAAM,gBAAgB,gBAAgB,iBAAiB,aAAa,IAAI;EAExE,IAAI,CAAC,iBAAiB,kBAAkB,eAAe,CAAC,GAAG;GACzD,IAAI,eACF,cAAc,CAAC;GAGjB,IAAI,qBACF,oBAAoB,IAAI;GAG1B,gBAAgB;GAChB,aAAa,qBAAqB,GAAG,EAAE,MAAM;GAK7C,MAAM,gBAAgB,EAAE;GAExB,kBACE,UACC,eAAsB;IACrB,IACE,iBACA,CAAC,aAAa,eAAgB,WAA0B,MAAiB,GACzE;KAEA,MAAM,SAAS,eAAe;KAC9B,IAAI,QAAQ;MACV,MAAM,cAAc,IAAI,OAAO,WAAW,QAAQ,EAChD,eAAgB,WAA0B,OAC5C,CAAC;MACD,eAAe,aAAa,aAAa;MAEzC,gBAAgB;MAChB,yBAAyB;MAEzB,IAAI,cACF,aAAa,WAAW;MAG1B,IAAI,qBACF,oBAAoB,KAAK;MAE3B,aAAa;MACb,aAAa,KAAA;KACf;IACF;GACF,GACA,EAAE,SAAS,KAAK,CAClB;EACF;CACF;CAEA,IAAI,YACF,OAAO,EACL,kBAAkB;EAChB,SAAS,KAAA;EACT,QAAQ,KAAA;CACV,EACF;CAGF,OAAO,EACL,kBAAkB;EAChB;EACA;CACF,EACF;AACF"}
@@ -0,0 +1,131 @@
1
+ import { o as mergeProps } from "./env.js";
2
+ import { t as focusSafely } from "./focus.js";
3
+ import { t as createFocus } from "./createFocus.js";
4
+ import { createContext, onMount, useContext } from "solid-js";
5
+ //#region src/interactions/createKeyboard.ts
6
+ /**
7
+ * Wraps a keyboard event handler to make stopPropagation the default,
8
+ * and support continuePropagation instead.
9
+ */
10
+ function createEventHandler(handler) {
11
+ if (!handler) return;
12
+ return (e) => {
13
+ let shouldStopPropagation = true;
14
+ const parentContinuePropagation = e.continuePropagation;
15
+ handler(Object.assign(e, { continuePropagation() {
16
+ shouldStopPropagation = false;
17
+ if (typeof parentContinuePropagation === "function") parentContinuePropagation.call(e);
18
+ } }));
19
+ if (shouldStopPropagation) e.stopPropagation();
20
+ };
21
+ }
22
+ /**
23
+ * Handles keyboard interactions for a focusable element.
24
+ *
25
+ * Based on react-aria's useKeyboard but adapted for SolidJS.
26
+ */
27
+ function createKeyboard(props = {}) {
28
+ if (props.isDisabled) return { keyboardProps: {} };
29
+ return { keyboardProps: {
30
+ onKeyDown: createEventHandler(props.onKeyDown),
31
+ onKeyUp: createEventHandler(props.onKeyUp)
32
+ } };
33
+ }
34
+ //#endregion
35
+ //#region src/interactions/createFocusable.ts
36
+ /**
37
+ * createFocusable - Makes an element focusable and capable of auto focus.
38
+ *
39
+ * This is a 1-1 port of React-Aria's useFocusable hook adapted for SolidJS.
40
+ */
41
+ /**
42
+ * Context for passing focusable props to nested focusable children.
43
+ * Used by FocusableProvider to pass DOM props to the nearest focusable child.
44
+ */
45
+ const FocusableContext = createContext(null);
46
+ /**
47
+ * Hook to consume the FocusableContext and sync the ref.
48
+ */
49
+ function useFocusableContext(setRef) {
50
+ const context = useContext(FocusableContext) || {};
51
+ if (context.ref) {
52
+ const contextRef = context.ref;
53
+ const originalSetRef = setRef;
54
+ setRef = (el) => {
55
+ originalSetRef(el);
56
+ contextRef(el);
57
+ };
58
+ }
59
+ const { ref: _, ...otherProps } = context;
60
+ return otherProps;
61
+ }
62
+ function isDisabledValue(isDisabled) {
63
+ if (typeof isDisabled === "function") return isDisabled();
64
+ return isDisabled ?? false;
65
+ }
66
+ /**
67
+ * Makes an element focusable, handling disabled state and tab order.
68
+ * Provides focus state tracking and autoFocus support.
69
+ *
70
+ * Based on react-aria's useFocusable but adapted for SolidJS.
71
+ *
72
+ * @example
73
+ * ```tsx
74
+ * import { createFocusable } from 'solidaria';
75
+ *
76
+ * function FocusableInput(props) {
77
+ * let ref;
78
+ * const { focusableProps } = createFocusable({
79
+ * autoFocus: props.autoFocus,
80
+ * onFocusChange: (focused) => console.log('Focus:', focused),
81
+ * });
82
+ *
83
+ * return (
84
+ * <input
85
+ * {...focusableProps}
86
+ * ref={(el) => { ref = el; focusableProps.ref?.(el); }}
87
+ * />
88
+ * );
89
+ * }
90
+ * ```
91
+ */
92
+ function createFocusable(props = {}, ref) {
93
+ let elementRef = null;
94
+ let autoFocusDone = false;
95
+ const setRef = (el) => {
96
+ elementRef = el;
97
+ ref?.(el);
98
+ };
99
+ const { focusProps } = createFocus({
100
+ isDisabled: isDisabledValue(props.isDisabled),
101
+ onFocus: props.onFocus,
102
+ onBlur: props.onBlur,
103
+ onFocusChange: props.onFocusChange
104
+ });
105
+ const { keyboardProps } = createKeyboard({
106
+ isDisabled: isDisabledValue(props.isDisabled),
107
+ onKeyDown: props.onKeyDown,
108
+ onKeyUp: props.onKeyUp
109
+ });
110
+ const interactions = mergeProps(focusProps, keyboardProps);
111
+ const contextProps = useFocusableContext(setRef);
112
+ const interactionProps = isDisabledValue(props.isDisabled) ? {} : contextProps;
113
+ onMount(() => {
114
+ if (props.autoFocus && elementRef && !autoFocusDone) {
115
+ focusSafely(elementRef);
116
+ autoFocusDone = true;
117
+ }
118
+ });
119
+ return { focusableProps: mergeProps({
120
+ ...interactions,
121
+ get tabIndex() {
122
+ if (isDisabledValue(props.isDisabled)) return;
123
+ return props.excludeFromTabOrder ? -1 : 0;
124
+ },
125
+ ref: setRef
126
+ }, interactionProps) };
127
+ }
128
+ //#endregion
129
+ export { createFocusable as n, createKeyboard as r, FocusableContext as t };
130
+
131
+ //# sourceMappingURL=createFocusable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFocusable.js","names":[],"sources":["../../src/interactions/createKeyboard.ts","../../src/interactions/createFocusable.ts"],"sourcesContent":["/**\n * createKeyboard - Handles keyboard interactions for a focusable element.\n *\n * This is a 1-1 port of React-Aria's useKeyboard hook adapted for SolidJS.\n */\n\nimport { JSX } from \"solid-js\";\n\n/**\n * Keyboard event with continuePropagation support.\n * By default, keyboard events stop propagation.\n */\nexport interface KeyboardEvent extends globalThis.KeyboardEvent {\n /** Call this to allow the event to propagate to parent elements. */\n continuePropagation(): void;\n}\n\nexport interface KeyboardEvents {\n /** Handler that is called when a key is pressed. */\n onKeyDown?: (e: KeyboardEvent) => void;\n /** Handler that is called when a key is released. */\n onKeyUp?: (e: KeyboardEvent) => void;\n}\n\nexport interface CreateKeyboardProps extends KeyboardEvents {\n /** Whether the keyboard events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface KeyboardResult {\n /** Props to spread onto the target element. */\n keyboardProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Wraps a keyboard event handler to make stopPropagation the default,\n * and support continuePropagation instead.\n */\nfunction createEventHandler<T extends globalThis.KeyboardEvent>(\n handler?: (e: KeyboardEvent) => void,\n): ((e: T) => void) | undefined {\n if (!handler) {\n return undefined;\n }\n\n return (e: T) => {\n let shouldStopPropagation = true;\n\n // A nested createEventHandler may already have installed continuePropagation\n // on this event; capture it so continuing here continues on the wrapper too.\n const parentContinuePropagation = (e as { continuePropagation?: () => void })\n .continuePropagation;\n\n // Create a wrapped event with continuePropagation\n const event = Object.assign(e, {\n continuePropagation() {\n shouldStopPropagation = false;\n // Nested createEventHandler might have set continuePropagation, so we\n // should continue propagation on the wrappers too.\n if (typeof parentContinuePropagation === \"function\") {\n parentContinuePropagation.call(e);\n }\n },\n }) as KeyboardEvent;\n\n handler(event);\n\n if (shouldStopPropagation) {\n e.stopPropagation();\n }\n };\n}\n\n/**\n * Handles keyboard interactions for a focusable element.\n *\n * Based on react-aria's useKeyboard but adapted for SolidJS.\n */\nexport function createKeyboard(props: CreateKeyboardProps = {}): KeyboardResult {\n if (props.isDisabled) {\n return {\n keyboardProps: {},\n };\n }\n\n return {\n keyboardProps: {\n onKeyDown: createEventHandler(props.onKeyDown),\n onKeyUp: createEventHandler(props.onKeyUp),\n },\n };\n}\n","/**\n * createFocusable - Makes an element focusable and capable of auto focus.\n *\n * This is a 1-1 port of React-Aria's useFocusable hook adapted for SolidJS.\n */\n\nimport { JSX, Accessor, createContext, useContext, onMount } from \"solid-js\";\nimport { createFocus, type FocusEvents } from \"./createFocus\";\nimport { createKeyboard, type KeyboardEvents } from \"./createKeyboard\";\nimport { mergeProps, focusSafely } from \"../utils\";\n\nexport interface FocusableDOMProps {\n /** Whether to exclude the element from the sequential tab order. */\n excludeFromTabOrder?: boolean;\n}\n\nexport interface FocusableProps extends FocusEvents, KeyboardEvents {\n /** Whether the element should receive focus on mount. */\n autoFocus?: boolean;\n}\n\nexport interface CreateFocusableProps extends FocusableProps, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: Accessor<boolean> | boolean;\n}\n\nexport interface FocusableResult {\n /** Props to spread on the focusable element. */\n focusableProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n// --- FocusableContext ---\n\nexport interface FocusableContextValue {\n ref?: (el: HTMLElement) => void;\n [key: string]: unknown;\n}\n\n/**\n * Context for passing focusable props to nested focusable children.\n * Used by FocusableProvider to pass DOM props to the nearest focusable child.\n */\nexport const FocusableContext = createContext<FocusableContextValue | null>(null);\n\n/**\n * Hook to consume the FocusableContext and sync the ref.\n */\nfunction useFocusableContext(\n setRef: (el: HTMLElement) => void,\n): Omit<FocusableContextValue, \"ref\"> {\n const context = useContext(FocusableContext) || {};\n\n // If context has a ref, sync our ref to it\n if (context.ref) {\n const contextRef = context.ref;\n // Create a combined ref that calls both\n const originalSetRef = setRef;\n setRef = (el: HTMLElement) => {\n originalSetRef(el);\n contextRef(el);\n };\n }\n\n // Return context without the ref\n const { ref: _, ...otherProps } = context;\n return otherProps;\n}\n\nexport interface FocusableProviderProps {\n /** The child element to provide DOM props to. */\n children?: JSX.Element;\n}\n\nfunction isDisabledValue(isDisabled: Accessor<boolean> | boolean | undefined): boolean {\n if (typeof isDisabled === \"function\") {\n return isDisabled();\n }\n return isDisabled ?? false;\n}\n\n/**\n * Makes an element focusable, handling disabled state and tab order.\n * Provides focus state tracking and autoFocus support.\n *\n * Based on react-aria's useFocusable but adapted for SolidJS.\n *\n * @example\n * ```tsx\n * import { createFocusable } from 'solidaria';\n *\n * function FocusableInput(props) {\n * let ref;\n * const { focusableProps } = createFocusable({\n * autoFocus: props.autoFocus,\n * onFocusChange: (focused) => console.log('Focus:', focused),\n * });\n *\n * return (\n * <input\n * {...focusableProps}\n * ref={(el) => { ref = el; focusableProps.ref?.(el); }}\n * />\n * );\n * }\n * ```\n */\nexport function createFocusable(\n props: CreateFocusableProps = {},\n ref?: (el: HTMLElement) => void,\n): FocusableResult {\n let elementRef: HTMLElement | null = null;\n let autoFocusDone = false;\n\n // Set up ref handler\n const setRef = (el: HTMLElement) => {\n elementRef = el;\n ref?.(el);\n };\n\n // Get focus and keyboard props from the respective hooks\n const { focusProps } = createFocus({\n isDisabled: isDisabledValue(props.isDisabled),\n onFocus: props.onFocus,\n onBlur: props.onBlur,\n onFocusChange: props.onFocusChange,\n });\n\n const { keyboardProps } = createKeyboard({\n isDisabled: isDisabledValue(props.isDisabled),\n onKeyDown: props.onKeyDown,\n onKeyUp: props.onKeyUp,\n });\n\n // Merge focus and keyboard interactions\n const interactions = mergeProps(focusProps, keyboardProps);\n\n // Get context props (from FocusableProvider if present)\n const contextProps = useFocusableContext(setRef);\n const interactionProps = isDisabledValue(props.isDisabled) ? {} : contextProps;\n\n // Handle autoFocus\n onMount(() => {\n if (props.autoFocus && elementRef && !autoFocusDone) {\n focusSafely(elementRef);\n autoFocusDone = true;\n }\n });\n\n // Build final focusable props\n const focusableProps = mergeProps(\n {\n ...interactions,\n get tabIndex() {\n if (isDisabledValue(props.isDisabled)) {\n return undefined;\n }\n return props.excludeFromTabOrder ? -1 : 0;\n },\n ref: setRef,\n },\n interactionProps,\n ) as JSX.HTMLAttributes<HTMLElement>;\n\n return {\n focusableProps,\n };\n}\n"],"mappings":";;;;;;;;;AAsCA,SAAS,mBACP,SAC8B;CAC9B,IAAI,CAAC,SACH;CAGF,QAAQ,MAAS;EACf,IAAI,wBAAwB;EAI5B,MAAM,4BAA6B,EAChC;EAcH,QAXc,OAAO,OAAO,GAAG,EAC7B,sBAAsB;GACpB,wBAAwB;GAGxB,IAAI,OAAO,8BAA8B,YACvC,0BAA0B,KAAK,CAAC;EAEpC,EACF,CAEY,CAAC;EAEb,IAAI,uBACF,EAAE,gBAAgB;CAEtB;AACF;;;;;;AAOA,SAAgB,eAAe,QAA6B,CAAC,GAAmB;CAC9E,IAAI,MAAM,YACR,OAAO,EACL,eAAe,CAAC,EAClB;CAGF,OAAO,EACL,eAAe;EACb,WAAW,mBAAmB,MAAM,SAAS;EAC7C,SAAS,mBAAmB,MAAM,OAAO;CAC3C,EACF;AACF;;;;;;;;;;;;ACjDA,MAAa,mBAAmB,cAA4C,IAAI;;;;AAKhF,SAAS,oBACP,QACoC;CACpC,MAAM,UAAU,WAAW,gBAAgB,KAAK,CAAC;CAGjD,IAAI,QAAQ,KAAK;EACf,MAAM,aAAa,QAAQ;EAE3B,MAAM,iBAAiB;EACvB,UAAU,OAAoB;GAC5B,eAAe,EAAE;GACjB,WAAW,EAAE;EACf;CACF;CAGA,MAAM,EAAE,KAAK,GAAG,GAAG,eAAe;CAClC,OAAO;AACT;AAOA,SAAS,gBAAgB,YAA8D;CACrF,IAAI,OAAO,eAAe,YACxB,OAAO,WAAW;CAEpB,OAAO,cAAc;AACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAgB,gBACd,QAA8B,CAAC,GAC/B,KACiB;CACjB,IAAI,aAAiC;CACrC,IAAI,gBAAgB;CAGpB,MAAM,UAAU,OAAoB;EAClC,aAAa;EACb,MAAM,EAAE;CACV;CAGA,MAAM,EAAE,eAAe,YAAY;EACjC,YAAY,gBAAgB,MAAM,UAAU;EAC5C,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,eAAe,MAAM;CACvB,CAAC;CAED,MAAM,EAAE,kBAAkB,eAAe;EACvC,YAAY,gBAAgB,MAAM,UAAU;EAC5C,WAAW,MAAM;EACjB,SAAS,MAAM;CACjB,CAAC;CAGD,MAAM,eAAe,WAAW,YAAY,aAAa;CAGzD,MAAM,eAAe,oBAAoB,MAAM;CAC/C,MAAM,mBAAmB,gBAAgB,MAAM,UAAU,IAAI,CAAC,IAAI;CAGlE,cAAc;EACZ,IAAI,MAAM,aAAa,cAAc,CAAC,eAAe;GACnD,YAAY,UAAU;GACtB,gBAAgB;EAClB;CACF,CAAC;CAiBD,OAAO,EACL,gBAfqB,WACrB;EACE,GAAG;EACH,IAAI,WAAW;GACb,IAAI,gBAAgB,MAAM,UAAU,GAClC;GAEF,OAAO,MAAM,sBAAsB,KAAK;EAC1C;EACA,KAAK;CACP,GACA,gBAIa,EACf;AACF"}
@@ -0,0 +1,131 @@
1
+ import { o as mergeProps } from "./env.jsx";
2
+ import { t as focusSafely } from "./focus.jsx";
3
+ import { t as createFocus } from "./createFocus.jsx";
4
+ import { createContext, onMount, useContext } from "solid-js";
5
+ //#region src/interactions/createKeyboard.ts
6
+ /**
7
+ * Wraps a keyboard event handler to make stopPropagation the default,
8
+ * and support continuePropagation instead.
9
+ */
10
+ function createEventHandler(handler) {
11
+ if (!handler) return;
12
+ return (e) => {
13
+ let shouldStopPropagation = true;
14
+ const parentContinuePropagation = e.continuePropagation;
15
+ handler(Object.assign(e, { continuePropagation() {
16
+ shouldStopPropagation = false;
17
+ if (typeof parentContinuePropagation === "function") parentContinuePropagation.call(e);
18
+ } }));
19
+ if (shouldStopPropagation) e.stopPropagation();
20
+ };
21
+ }
22
+ /**
23
+ * Handles keyboard interactions for a focusable element.
24
+ *
25
+ * Based on react-aria's useKeyboard but adapted for SolidJS.
26
+ */
27
+ function createKeyboard(props = {}) {
28
+ if (props.isDisabled) return { keyboardProps: {} };
29
+ return { keyboardProps: {
30
+ onKeyDown: createEventHandler(props.onKeyDown),
31
+ onKeyUp: createEventHandler(props.onKeyUp)
32
+ } };
33
+ }
34
+ //#endregion
35
+ //#region src/interactions/createFocusable.ts
36
+ /**
37
+ * createFocusable - Makes an element focusable and capable of auto focus.
38
+ *
39
+ * This is a 1-1 port of React-Aria's useFocusable hook adapted for SolidJS.
40
+ */
41
+ /**
42
+ * Context for passing focusable props to nested focusable children.
43
+ * Used by FocusableProvider to pass DOM props to the nearest focusable child.
44
+ */
45
+ const FocusableContext = createContext(null);
46
+ /**
47
+ * Hook to consume the FocusableContext and sync the ref.
48
+ */
49
+ function useFocusableContext(setRef) {
50
+ const context = useContext(FocusableContext) || {};
51
+ if (context.ref) {
52
+ const contextRef = context.ref;
53
+ const originalSetRef = setRef;
54
+ setRef = (el) => {
55
+ originalSetRef(el);
56
+ contextRef(el);
57
+ };
58
+ }
59
+ const { ref: _, ...otherProps } = context;
60
+ return otherProps;
61
+ }
62
+ function isDisabledValue(isDisabled) {
63
+ if (typeof isDisabled === "function") return isDisabled();
64
+ return isDisabled ?? false;
65
+ }
66
+ /**
67
+ * Makes an element focusable, handling disabled state and tab order.
68
+ * Provides focus state tracking and autoFocus support.
69
+ *
70
+ * Based on react-aria's useFocusable but adapted for SolidJS.
71
+ *
72
+ * @example
73
+ * ```tsx
74
+ * import { createFocusable } from 'solidaria';
75
+ *
76
+ * function FocusableInput(props) {
77
+ * let ref;
78
+ * const { focusableProps } = createFocusable({
79
+ * autoFocus: props.autoFocus,
80
+ * onFocusChange: (focused) => console.log('Focus:', focused),
81
+ * });
82
+ *
83
+ * return (
84
+ * <input
85
+ * {...focusableProps}
86
+ * ref={(el) => { ref = el; focusableProps.ref?.(el); }}
87
+ * />
88
+ * );
89
+ * }
90
+ * ```
91
+ */
92
+ function createFocusable(props = {}, ref) {
93
+ let elementRef = null;
94
+ let autoFocusDone = false;
95
+ const setRef = (el) => {
96
+ elementRef = el;
97
+ ref?.(el);
98
+ };
99
+ const { focusProps } = createFocus({
100
+ isDisabled: isDisabledValue(props.isDisabled),
101
+ onFocus: props.onFocus,
102
+ onBlur: props.onBlur,
103
+ onFocusChange: props.onFocusChange
104
+ });
105
+ const { keyboardProps } = createKeyboard({
106
+ isDisabled: isDisabledValue(props.isDisabled),
107
+ onKeyDown: props.onKeyDown,
108
+ onKeyUp: props.onKeyUp
109
+ });
110
+ const interactions = mergeProps(focusProps, keyboardProps);
111
+ const contextProps = useFocusableContext(setRef);
112
+ const interactionProps = isDisabledValue(props.isDisabled) ? {} : contextProps;
113
+ onMount(() => {
114
+ if (props.autoFocus && elementRef && !autoFocusDone) {
115
+ focusSafely(elementRef);
116
+ autoFocusDone = true;
117
+ }
118
+ });
119
+ return { focusableProps: mergeProps({
120
+ ...interactions,
121
+ get tabIndex() {
122
+ if (isDisabledValue(props.isDisabled)) return;
123
+ return props.excludeFromTabOrder ? -1 : 0;
124
+ },
125
+ ref: setRef
126
+ }, interactionProps) };
127
+ }
128
+ //#endregion
129
+ export { createFocusable as n, createKeyboard as r, FocusableContext as t };
130
+
131
+ //# sourceMappingURL=createFocusable.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFocusable.jsx","names":[],"sources":["../../src/interactions/createKeyboard.ts","../../src/interactions/createFocusable.ts"],"sourcesContent":["/**\n * createKeyboard - Handles keyboard interactions for a focusable element.\n *\n * This is a 1-1 port of React-Aria's useKeyboard hook adapted for SolidJS.\n */\n\nimport { JSX } from \"solid-js\";\n\n/**\n * Keyboard event with continuePropagation support.\n * By default, keyboard events stop propagation.\n */\nexport interface KeyboardEvent extends globalThis.KeyboardEvent {\n /** Call this to allow the event to propagate to parent elements. */\n continuePropagation(): void;\n}\n\nexport interface KeyboardEvents {\n /** Handler that is called when a key is pressed. */\n onKeyDown?: (e: KeyboardEvent) => void;\n /** Handler that is called when a key is released. */\n onKeyUp?: (e: KeyboardEvent) => void;\n}\n\nexport interface CreateKeyboardProps extends KeyboardEvents {\n /** Whether the keyboard events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface KeyboardResult {\n /** Props to spread onto the target element. */\n keyboardProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Wraps a keyboard event handler to make stopPropagation the default,\n * and support continuePropagation instead.\n */\nfunction createEventHandler<T extends globalThis.KeyboardEvent>(\n handler?: (e: KeyboardEvent) => void,\n): ((e: T) => void) | undefined {\n if (!handler) {\n return undefined;\n }\n\n return (e: T) => {\n let shouldStopPropagation = true;\n\n // A nested createEventHandler may already have installed continuePropagation\n // on this event; capture it so continuing here continues on the wrapper too.\n const parentContinuePropagation = (e as { continuePropagation?: () => void })\n .continuePropagation;\n\n // Create a wrapped event with continuePropagation\n const event = Object.assign(e, {\n continuePropagation() {\n shouldStopPropagation = false;\n // Nested createEventHandler might have set continuePropagation, so we\n // should continue propagation on the wrappers too.\n if (typeof parentContinuePropagation === \"function\") {\n parentContinuePropagation.call(e);\n }\n },\n }) as KeyboardEvent;\n\n handler(event);\n\n if (shouldStopPropagation) {\n e.stopPropagation();\n }\n };\n}\n\n/**\n * Handles keyboard interactions for a focusable element.\n *\n * Based on react-aria's useKeyboard but adapted for SolidJS.\n */\nexport function createKeyboard(props: CreateKeyboardProps = {}): KeyboardResult {\n if (props.isDisabled) {\n return {\n keyboardProps: {},\n };\n }\n\n return {\n keyboardProps: {\n onKeyDown: createEventHandler(props.onKeyDown),\n onKeyUp: createEventHandler(props.onKeyUp),\n },\n };\n}\n","/**\n * createFocusable - Makes an element focusable and capable of auto focus.\n *\n * This is a 1-1 port of React-Aria's useFocusable hook adapted for SolidJS.\n */\n\nimport { JSX, Accessor, createContext, useContext, onMount } from \"solid-js\";\nimport { createFocus, type FocusEvents } from \"./createFocus\";\nimport { createKeyboard, type KeyboardEvents } from \"./createKeyboard\";\nimport { mergeProps, focusSafely } from \"../utils\";\n\nexport interface FocusableDOMProps {\n /** Whether to exclude the element from the sequential tab order. */\n excludeFromTabOrder?: boolean;\n}\n\nexport interface FocusableProps extends FocusEvents, KeyboardEvents {\n /** Whether the element should receive focus on mount. */\n autoFocus?: boolean;\n}\n\nexport interface CreateFocusableProps extends FocusableProps, FocusableDOMProps {\n /** Whether focus should be disabled. */\n isDisabled?: Accessor<boolean> | boolean;\n}\n\nexport interface FocusableResult {\n /** Props to spread on the focusable element. */\n focusableProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n// --- FocusableContext ---\n\nexport interface FocusableContextValue {\n ref?: (el: HTMLElement) => void;\n [key: string]: unknown;\n}\n\n/**\n * Context for passing focusable props to nested focusable children.\n * Used by FocusableProvider to pass DOM props to the nearest focusable child.\n */\nexport const FocusableContext = createContext<FocusableContextValue | null>(null);\n\n/**\n * Hook to consume the FocusableContext and sync the ref.\n */\nfunction useFocusableContext(\n setRef: (el: HTMLElement) => void,\n): Omit<FocusableContextValue, \"ref\"> {\n const context = useContext(FocusableContext) || {};\n\n // If context has a ref, sync our ref to it\n if (context.ref) {\n const contextRef = context.ref;\n // Create a combined ref that calls both\n const originalSetRef = setRef;\n setRef = (el: HTMLElement) => {\n originalSetRef(el);\n contextRef(el);\n };\n }\n\n // Return context without the ref\n const { ref: _, ...otherProps } = context;\n return otherProps;\n}\n\nexport interface FocusableProviderProps {\n /** The child element to provide DOM props to. */\n children?: JSX.Element;\n}\n\nfunction isDisabledValue(isDisabled: Accessor<boolean> | boolean | undefined): boolean {\n if (typeof isDisabled === \"function\") {\n return isDisabled();\n }\n return isDisabled ?? false;\n}\n\n/**\n * Makes an element focusable, handling disabled state and tab order.\n * Provides focus state tracking and autoFocus support.\n *\n * Based on react-aria's useFocusable but adapted for SolidJS.\n *\n * @example\n * ```tsx\n * import { createFocusable } from 'solidaria';\n *\n * function FocusableInput(props) {\n * let ref;\n * const { focusableProps } = createFocusable({\n * autoFocus: props.autoFocus,\n * onFocusChange: (focused) => console.log('Focus:', focused),\n * });\n *\n * return (\n * <input\n * {...focusableProps}\n * ref={(el) => { ref = el; focusableProps.ref?.(el); }}\n * />\n * );\n * }\n * ```\n */\nexport function createFocusable(\n props: CreateFocusableProps = {},\n ref?: (el: HTMLElement) => void,\n): FocusableResult {\n let elementRef: HTMLElement | null = null;\n let autoFocusDone = false;\n\n // Set up ref handler\n const setRef = (el: HTMLElement) => {\n elementRef = el;\n ref?.(el);\n };\n\n // Get focus and keyboard props from the respective hooks\n const { focusProps } = createFocus({\n isDisabled: isDisabledValue(props.isDisabled),\n onFocus: props.onFocus,\n onBlur: props.onBlur,\n onFocusChange: props.onFocusChange,\n });\n\n const { keyboardProps } = createKeyboard({\n isDisabled: isDisabledValue(props.isDisabled),\n onKeyDown: props.onKeyDown,\n onKeyUp: props.onKeyUp,\n });\n\n // Merge focus and keyboard interactions\n const interactions = mergeProps(focusProps, keyboardProps);\n\n // Get context props (from FocusableProvider if present)\n const contextProps = useFocusableContext(setRef);\n const interactionProps = isDisabledValue(props.isDisabled) ? {} : contextProps;\n\n // Handle autoFocus\n onMount(() => {\n if (props.autoFocus && elementRef && !autoFocusDone) {\n focusSafely(elementRef);\n autoFocusDone = true;\n }\n });\n\n // Build final focusable props\n const focusableProps = mergeProps(\n {\n ...interactions,\n get tabIndex() {\n if (isDisabledValue(props.isDisabled)) {\n return undefined;\n }\n return props.excludeFromTabOrder ? -1 : 0;\n },\n ref: setRef,\n },\n interactionProps,\n ) as JSX.HTMLAttributes<HTMLElement>;\n\n return {\n focusableProps,\n };\n}\n"],"mappings":";;;;;;;;;AAsCA,SAAS,mBACP,SAC8B;CAC9B,IAAI,CAAC,SACH;CAGF,QAAQ,MAAS;EACf,IAAI,wBAAwB;EAI5B,MAAM,4BAA6B,EAChC;EAcH,QAXc,OAAO,OAAO,GAAG,EAC7B,sBAAsB;GACpB,wBAAwB;GAGxB,IAAI,OAAO,8BAA8B,YACvC,0BAA0B,KAAK,CAAC;EAEpC,EACF,CAEY,CAAC;EAEb,IAAI,uBACF,EAAE,gBAAgB;CAEtB;AACF;;;;;;AAOA,SAAgB,eAAe,QAA6B,CAAC,GAAmB;CAC9E,IAAI,MAAM,YACR,OAAO,EACL,eAAe,CAAC,EAClB;CAGF,OAAO,EACL,eAAe;EACb,WAAW,mBAAmB,MAAM,SAAS;EAC7C,SAAS,mBAAmB,MAAM,OAAO;CAC3C,EACF;AACF;;;;;;;;;;;;ACjDA,MAAa,mBAAmB,cAA4C,IAAI;;;;AAKhF,SAAS,oBACP,QACoC;CACpC,MAAM,UAAU,WAAW,gBAAgB,KAAK,CAAC;CAGjD,IAAI,QAAQ,KAAK;EACf,MAAM,aAAa,QAAQ;EAE3B,MAAM,iBAAiB;EACvB,UAAU,OAAoB;GAC5B,eAAe,EAAE;GACjB,WAAW,EAAE;EACf;CACF;CAGA,MAAM,EAAE,KAAK,GAAG,GAAG,eAAe;CAClC,OAAO;AACT;AAOA,SAAS,gBAAgB,YAA8D;CACrF,IAAI,OAAO,eAAe,YACxB,OAAO,WAAW;CAEpB,OAAO,cAAc;AACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAgB,gBACd,QAA8B,CAAC,GAC/B,KACiB;CACjB,IAAI,aAAiC;CACrC,IAAI,gBAAgB;CAGpB,MAAM,UAAU,OAAoB;EAClC,aAAa;EACb,MAAM,EAAE;CACV;CAGA,MAAM,EAAE,eAAe,YAAY;EACjC,YAAY,gBAAgB,MAAM,UAAU;EAC5C,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,eAAe,MAAM;CACvB,CAAC;CAED,MAAM,EAAE,kBAAkB,eAAe;EACvC,YAAY,gBAAgB,MAAM,UAAU;EAC5C,WAAW,MAAM;EACjB,SAAS,MAAM;CACjB,CAAC;CAGD,MAAM,eAAe,WAAW,YAAY,aAAa;CAGzD,MAAM,eAAe,oBAAoB,MAAM;CAC/C,MAAM,mBAAmB,gBAAgB,MAAM,UAAU,IAAI,CAAC,IAAI;CAGlE,cAAc;EACZ,IAAI,MAAM,aAAa,cAAc,CAAC,eAAe;GACnD,YAAY,UAAU;GACtB,gBAAgB;EAClB;CACF,CAAC;CAiBD,OAAO,EACL,gBAfqB,WACrB;EACE,GAAG;EACH,IAAI,WAAW;GACb,IAAI,gBAAgB,MAAM,UAAU,GAClC;GAEF,OAAO,MAAM,sBAAsB,KAAK;EAC1C;EACA,KAAK;CACP,GACA,gBAIa,EACf;AACF"}