@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,298 @@
1
+ import { t as createPress } from "./createPress.jsx";
2
+ import { i as access, o as mergeProps } from "./env.jsx";
3
+ import { c as isCtrlKeyPressed, w as isAppleDevice } from "./utils.jsx";
4
+ import { a as getEventTarget, b as openLink, s as getOwnerDocument, t as focusSafely } from "./focus.jsx";
5
+ import { t as createLongPress } from "./createLongPress.jsx";
6
+ import { createId } from "../ssr/index.jsx";
7
+ import { createEffect, createUniqueId } from "solid-js";
8
+ //#region src/selection/utils.ts
9
+ /**
10
+ * Resolves the DOM element rendered for a collection item by its key, scoped to
11
+ * the owning collection when a `data-collection` id is present. Mirrors
12
+ * `@react-aria/selection`'s `getItemElement`, adapted to take a Solid ref
13
+ * accessor instead of a React ref object.
14
+ */
15
+ function getItemElement(ref, key) {
16
+ const root = ref();
17
+ if (!root) return null;
18
+ let selector = `[data-key="${CSS.escape(String(key))}"]`;
19
+ const collectionId = root.dataset.collection;
20
+ if (collectionId) selector = `[data-collection="${CSS.escape(collectionId)}"]${selector}`;
21
+ return root.querySelector(selector);
22
+ }
23
+ /**
24
+ * A stable, SSR-safe id for a collection, shared between the collection
25
+ * container and its items so {@link getItemElement} can scope a query by
26
+ * `data-collection` (needed to disambiguate nested collections).
27
+ *
28
+ * Divergence from upstream: React's `useCollectionId` keys this WeakMap by the
29
+ * collection object and relies on a render-stable `useId`. A Solid collection is
30
+ * rebuilt with a new identity whenever its items change, so we key by the
31
+ * SelectionManager instance instead — it is created once and never replaced, so
32
+ * the container and its items always resolve to the same entry — and generate
33
+ * the id with our SSR-safe `createId`.
34
+ */
35
+ const collectionIdMap = /* @__PURE__ */ new WeakMap();
36
+ /**
37
+ * Registers (on first call) and returns the collection id for a SelectionManager.
38
+ * The collection container calls this; its items read the same id via
39
+ * {@link getCollectionId}. Must be called within a reactive owner (uses createId).
40
+ */
41
+ function registerCollectionId(manager) {
42
+ let id = collectionIdMap.get(manager);
43
+ if (id == null) {
44
+ id = createId();
45
+ collectionIdMap.set(manager, id);
46
+ }
47
+ return id;
48
+ }
49
+ /**
50
+ * Returns the collection id registered for a SelectionManager, or `undefined`
51
+ * when its container has not registered one (e.g. an item not yet wired into a
52
+ * `createSelectableCollection`). A Solid `undefined` attribute is omitted, so an
53
+ * unregistered item simply renders no `data-collection`.
54
+ */
55
+ function getCollectionId(manager) {
56
+ return collectionIdMap.get(manager);
57
+ }
58
+ /**
59
+ * Returns whether the modifier for non-contiguous (toggle) keyboard selection
60
+ * is pressed. Mirrors `@react-aria/selection`'s `isNonContiguousSelectionModifier`:
61
+ * Ctrl + Arrow Up/Down has a system-wide meaning on macOS, so Apple devices use
62
+ * Alt instead; Windows and Ubuntu use Ctrl.
63
+ */
64
+ function isNonContiguousSelectionModifier(e) {
65
+ return isAppleDevice() ? e.altKey === true : e.ctrlKey === true;
66
+ }
67
+ //#endregion
68
+ //#region src/selection/selectItem.ts
69
+ /**
70
+ * Resolve a press/keyboard interaction into a selection mutation on `manager`,
71
+ * faithful to `useSelectableItem.onSelect`. `collection` is required for the
72
+ * shift-extend (contiguous range) path.
73
+ */
74
+ function selectItem(manager, key, e, collection) {
75
+ if (e.pointerType === "keyboard" && isNonContiguousSelectionModifier(e)) {
76
+ manager.toggleSelection(key);
77
+ return;
78
+ }
79
+ if (manager.selectionMode() === "none") return;
80
+ if (manager.selectionMode() === "single") if (manager.isSelected(key) && !manager.disallowEmptySelection()) manager.toggleSelection(key);
81
+ else manager.replaceSelection(key);
82
+ else if (e.shiftKey) manager.extendSelection(key, collection);
83
+ else if (manager.selectionBehavior() === "toggle" || isCtrlKeyPressed(e) || e.pointerType === "touch" || e.pointerType === "virtual") manager.toggleSelection(key);
84
+ else manager.replaceSelection(key);
85
+ }
86
+ //#endregion
87
+ //#region src/selection/createSelectableItem.ts
88
+ /**
89
+ * createSelectableItem - handles interactions with an item in a selectable
90
+ * collection. Port of `@react-aria/selection`'s `useSelectableItem`.
91
+ *
92
+ * This encapsulates the full press-path action model: the
93
+ * selection-vs-action decision per pointer type, the press-up-vs-press timing
94
+ * (menus select on press up, rows on press down), the keyboard Space/Enter
95
+ * split, double-click secondary actions, and long-press-to-toggle. The
96
+ * selection decision itself is delegated to the aria-layer {@link selectItem}
97
+ * (Phase 0), which is also where the platform-aware modifier resolution lives.
98
+ *
99
+ * Documented adaptations from upstream (React → Solid / our thinner state):
100
+ * - **Link model is prop-threaded.** Our collection nodes don't expose
101
+ * `manager.isLink`/`manager.getItemProps`, so link items pass `isLink` /
102
+ * `href` / `routerOptions` via options and navigation goes through
103
+ * {@link openLink} (we have no `RouterProvider` context).
104
+ * - **Selection manager shape is structural.** ListState passes its
105
+ * SelectionManager; grid-like states pass an adapter with the same observable
106
+ * surface. `canSelectItem` is read from that surface when available so
107
+ * `disabledBehavior: 'selection'` keeps actions enabled while selection stays
108
+ * blocked.
109
+ * - **Virtual focus** guards real DOM focus and updates the focused key on
110
+ * press; we have no `moveVirtualFocus`, so no AT cursor move is dispatched.
111
+ * - **`onDragStart`** is bubble phase (upstream uses capture to beat `useDrag`);
112
+ * wired to capture when drag-and-drop integration lands.
113
+ * - **`getItemProps` press-handler chaining** (collection-provided press
114
+ * handlers) is omitted — our nodes don't carry them.
115
+ */
116
+ /**
117
+ * DOM event dispatched when an item action is performed. Mirrors upstream's
118
+ * `react-aria-item-action`; combobox/autocomplete listen for it to close on
119
+ * action. Exported so emitter and listener share one constant.
120
+ */
121
+ const ITEM_ACTION_EVENT = "solidaria:item-action";
122
+ const isActionKey = (key) => key === "Enter";
123
+ const isSelectionKey = (key) => key === " ";
124
+ /**
125
+ * Provides the behavior and accessibility implementation for an item in a
126
+ * selectable collection.
127
+ */
128
+ function createSelectableItem(options, manager, ref) {
129
+ const getOptions = () => access(options);
130
+ const generatedId = createUniqueId();
131
+ const key = () => getOptions().key;
132
+ const id = () => getOptions().id ?? generatedId;
133
+ const linkBehavior = () => getOptions().linkBehavior ?? "action";
134
+ const shouldUseVirtualFocus = () => getOptions().shouldUseVirtualFocus ?? false;
135
+ const allowsDifferentPressOrigin = () => getOptions().allowsDifferentPressOrigin ?? false;
136
+ const shouldSelectOnPressUp = () => getOptions().shouldSelectOnPressUp ?? false;
137
+ const isLink = () => getOptions().isLink ?? !!getOptions().href;
138
+ const collection = () => manager.collection();
139
+ const isDisabled = () => getOptions().isDisabled === true || manager.isDisabled(key());
140
+ const canSelectItem = () => {
141
+ const k = key();
142
+ return manager.canSelectItem?.(k) ?? manager.selectionManager?.canSelectItem?.(k) ?? (manager.selectionMode() !== "none" && !manager.isDisabled(k));
143
+ };
144
+ const isLinkOverride = () => isLink() && linkBehavior() === "override";
145
+ const isActionOverride = () => getOptions().onAction != null && getOptions().UNSTABLE_itemBehavior === "action";
146
+ const hasLinkAction = () => isLink() && linkBehavior() !== "selection" && linkBehavior() !== "none";
147
+ const allowsSelection = () => !isDisabled() && canSelectItem() && !isLinkOverride() && !isActionOverride();
148
+ const allowsActions = () => (getOptions().onAction != null || hasLinkAction()) && !isDisabled();
149
+ const hasPrimaryAction = () => allowsActions() && (manager.selectionBehavior() === "replace" ? !allowsSelection() : !allowsSelection() || manager.isEmpty());
150
+ const hasSecondaryAction = () => allowsActions() && allowsSelection() && manager.selectionBehavior() === "replace";
151
+ const hasAction = () => hasPrimaryAction() || hasSecondaryAction();
152
+ const longPressEnabled = () => hasAction() && allowsSelection();
153
+ let modality = null;
154
+ let longPressEnabledOnPressStart = false;
155
+ let hadPrimaryActionOnPressStart = false;
156
+ const isSelected = () => manager.selectionMode() !== "none" && manager.isSelected(key());
157
+ const isFocused = () => manager.isFocused() && manager.focusedKey() === key();
158
+ const onSelect = (e) => {
159
+ const k = key();
160
+ if (e.pointerType === "keyboard" && isNonContiguousSelectionModifier(e)) {
161
+ manager.toggleSelection(k);
162
+ return;
163
+ }
164
+ if (manager.selectionMode() === "none") return;
165
+ if (isLink()) {
166
+ if (linkBehavior() === "selection") {
167
+ const el = ref();
168
+ if (el instanceof HTMLAnchorElement) openLink(el, e);
169
+ const sel = manager.selectedKeys();
170
+ if (sel !== "all") manager.setSelectedKeys(sel);
171
+ return;
172
+ } else if (linkBehavior() === "override" || linkBehavior() === "none") return;
173
+ }
174
+ selectItem(manager, k, e, collection());
175
+ };
176
+ const performAction = (e) => {
177
+ const o = getOptions();
178
+ if (o.onAction) {
179
+ o.onAction(e);
180
+ ref()?.dispatchEvent(new CustomEvent(ITEM_ACTION_EVENT, { bubbles: true }));
181
+ }
182
+ if (hasLinkAction()) {
183
+ const el = ref();
184
+ if (el instanceof HTMLAnchorElement) openLink(el, e);
185
+ }
186
+ };
187
+ createEffect(() => {
188
+ if (key() !== manager.focusedKey() || !manager.isFocused()) return;
189
+ const o = getOptions();
190
+ if (!shouldUseVirtualFocus()) if (o.focus) o.focus();
191
+ else {
192
+ const el = ref();
193
+ if (el && getOwnerDocument(el).activeElement !== el) focusSafely(el);
194
+ }
195
+ });
196
+ const { pressProps, isPressed } = createPress({
197
+ get isDisabled() {
198
+ return !(allowsSelection() || hasPrimaryAction() || shouldUseVirtualFocus() && !isDisabled());
199
+ },
200
+ get preventFocusOnPress() {
201
+ return shouldUseVirtualFocus();
202
+ },
203
+ onPressStart(e) {
204
+ modality = e.pointerType;
205
+ longPressEnabledOnPressStart = longPressEnabled();
206
+ if (shouldSelectOnPressUp()) {
207
+ if (e.pointerType === "keyboard" && (!hasAction() || isSelectionKey(e.key))) onSelect(e);
208
+ } else {
209
+ hadPrimaryActionOnPressStart = hasPrimaryAction();
210
+ if (allowsSelection() && (e.pointerType === "mouse" && !hasPrimaryAction() || e.pointerType === "keyboard" && (!allowsActions() || isSelectionKey(e.key)))) onSelect(e);
211
+ }
212
+ if (shouldUseVirtualFocus() && e.pointerType !== "touch") {
213
+ manager.setFocused(true);
214
+ manager.setFocusedKey(key());
215
+ }
216
+ },
217
+ onPressUp(e) {
218
+ if (shouldSelectOnPressUp() && allowsDifferentPressOrigin() && !hasPrimaryAction() && e.pointerType === "mouse" && allowsSelection()) onSelect(e);
219
+ },
220
+ onPress(e) {
221
+ if (shouldSelectOnPressUp()) {
222
+ if (!allowsDifferentPressOrigin()) {
223
+ if (hasPrimaryAction() || hasSecondaryAction() && e.pointerType !== "mouse") {
224
+ if (e.pointerType === "keyboard" && !isActionKey(e.key)) return;
225
+ performAction(e);
226
+ } else if (e.pointerType !== "keyboard" && allowsSelection()) onSelect(e);
227
+ } else if (hasPrimaryAction()) performAction(e);
228
+ else if (e.pointerType !== "keyboard" && e.pointerType !== "mouse" && allowsSelection()) onSelect(e);
229
+ } else if (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && hasAction() && isActionKey(e.key) || e.pointerType === "mouse" && hadPrimaryActionOnPressStart) {
230
+ if (hasAction()) performAction(e);
231
+ else if (allowsSelection()) onSelect(e);
232
+ }
233
+ if (shouldUseVirtualFocus() && e.pointerType === "touch") {
234
+ manager.setFocused(true);
235
+ manager.setFocusedKey(key());
236
+ }
237
+ }
238
+ });
239
+ const { longPressProps } = createLongPress({
240
+ get isDisabled() {
241
+ return !longPressEnabled();
242
+ },
243
+ onLongPress(e) {
244
+ if (e.pointerType === "touch") {
245
+ onSelect(e);
246
+ manager.setSelectionBehavior("toggle");
247
+ }
248
+ }
249
+ });
250
+ const onDblClick = (e) => {
251
+ if (!hasSecondaryAction()) return;
252
+ if (modality === "mouse") {
253
+ e.stopPropagation();
254
+ e.preventDefault();
255
+ performAction(e);
256
+ }
257
+ };
258
+ const onDragStart = (e) => {
259
+ if (modality === "touch" && longPressEnabledOnPressStart) e.preventDefault();
260
+ };
261
+ const onClick = (e) => {
262
+ if (linkBehavior() !== "none" && isLink()) {
263
+ if (!openLink.isOpening) e.preventDefault();
264
+ }
265
+ };
266
+ return {
267
+ get itemProps() {
268
+ const k = key();
269
+ const disabled = isDisabled();
270
+ const baseProps = {
271
+ "data-key": String(k),
272
+ "data-collection": getCollectionId(manager.selectionManager ?? manager)
273
+ };
274
+ if (!shouldUseVirtualFocus() && !disabled) {
275
+ baseProps.tabIndex = k === manager.focusedKey() ? 0 : -1;
276
+ baseProps.onFocus = (e) => {
277
+ if (getEventTarget(e) === ref()) manager.setFocusedKey(k);
278
+ };
279
+ } else if (disabled) baseProps.onMouseDown = (e) => e.preventDefault();
280
+ return mergeProps(baseProps, allowsSelection() || hasPrimaryAction() || shouldUseVirtualFocus() && !disabled ? pressProps : {}, longPressEnabled() ? longPressProps : {}, {
281
+ onDblClick,
282
+ onDragStart,
283
+ onClick,
284
+ id: id()
285
+ }, shouldUseVirtualFocus() ? { onMouseDown: (e) => e.preventDefault() } : {});
286
+ },
287
+ isPressed,
288
+ isSelected,
289
+ isFocused,
290
+ isDisabled,
291
+ allowsSelection,
292
+ hasAction
293
+ };
294
+ }
295
+ //#endregion
296
+ export { isNonContiguousSelectionModifier as a, getItemElement as i, createSelectableItem as n, registerCollectionId as o, selectItem as r, ITEM_ACTION_EVENT as t };
297
+
298
+ //# sourceMappingURL=createSelectableItem.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSelectableItem.jsx","names":[],"sources":["../../src/selection/utils.ts","../../src/selection/selectItem.ts","../../src/selection/createSelectableItem.ts"],"sourcesContent":["/**\n * Selection helpers shared across collection item hooks.\n * Based on @react-aria/selection's utilities.\n */\n\nimport type { Accessor } from \"solid-js\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport { isAppleDevice } from \"../utils/platform\";\nimport { createId } from \"../ssr\";\n\n/**\n * Resolves the DOM element rendered for a collection item by its key, scoped to\n * the owning collection when a `data-collection` id is present. Mirrors\n * `@react-aria/selection`'s `getItemElement`, adapted to take a Solid ref\n * accessor instead of a React ref object.\n */\nexport function getItemElement(ref: Accessor<HTMLElement | null>, key: Key): HTMLElement | null {\n const root = ref();\n if (!root) {\n return null;\n }\n let selector = `[data-key=\"${CSS.escape(String(key))}\"]`;\n const collectionId = root.dataset.collection;\n if (collectionId) {\n selector = `[data-collection=\"${CSS.escape(collectionId)}\"]${selector}`;\n }\n return root.querySelector<HTMLElement>(selector);\n}\n\n/**\n * A stable, SSR-safe id for a collection, shared between the collection\n * container and its items so {@link getItemElement} can scope a query by\n * `data-collection` (needed to disambiguate nested collections).\n *\n * Divergence from upstream: React's `useCollectionId` keys this WeakMap by the\n * collection object and relies on a render-stable `useId`. A Solid collection is\n * rebuilt with a new identity whenever its items change, so we key by the\n * SelectionManager instance instead — it is created once and never replaced, so\n * the container and its items always resolve to the same entry — and generate\n * the id with our SSR-safe `createId`.\n */\nconst collectionIdMap = new WeakMap<object, string>();\n\n/**\n * Registers (on first call) and returns the collection id for a SelectionManager.\n * The collection container calls this; its items read the same id via\n * {@link getCollectionId}. Must be called within a reactive owner (uses createId).\n */\nexport function registerCollectionId(manager: object): string {\n let id = collectionIdMap.get(manager);\n if (id == null) {\n id = createId();\n collectionIdMap.set(manager, id);\n }\n return id;\n}\n\n/**\n * Returns the collection id registered for a SelectionManager, or `undefined`\n * when its container has not registered one (e.g. an item not yet wired into a\n * `createSelectableCollection`). A Solid `undefined` attribute is omitted, so an\n * unregistered item simply renders no `data-collection`.\n */\nexport function getCollectionId(manager: object): string | undefined {\n return collectionIdMap.get(manager);\n}\n\n/** The modifier-key fields consulted by {@link isNonContiguousSelectionModifier}. */\ninterface ModifierKeyEvent {\n altKey?: boolean;\n ctrlKey?: boolean;\n}\n\n/**\n * Returns whether the modifier for non-contiguous (toggle) keyboard selection\n * is pressed. Mirrors `@react-aria/selection`'s `isNonContiguousSelectionModifier`:\n * Ctrl + Arrow Up/Down has a system-wide meaning on macOS, so Apple devices use\n * Alt instead; Windows and Ubuntu use Ctrl.\n */\nexport function isNonContiguousSelectionModifier(e: ModifierKeyEvent): boolean {\n return isAppleDevice() ? e.altKey === true : e.ctrlKey === true;\n}\n","/**\n * The aria-layer selection decision, mirroring `@react-aria/selection`'s\n * `useSelectableItem` `onSelect`. This is where the platform-aware modifier\n * resolution lives — react-stately's `SelectionManager.select` only knows\n * `pointerType` + `selectionBehavior`; the ctrl/meta/shift decision belongs one\n * layer up, here, where `isMac` is reachable.\n *\n * The link branch (`linkBehavior` 'selection'/'override'/'none') is deferred to\n * `createSelectableItem` (Phase 1 of the press-path epic); callers here pass\n * non-link items.\n */\n\nimport type { Accessor } from \"solid-js\";\nimport type {\n Collection,\n Key,\n SelectionBehavior,\n SelectionMode,\n SelectionPressEvent,\n} from \"@proyecto-viviana/solid-stately\";\n\nimport { isCtrlKeyPressed } from \"../utils/keyboard\";\nimport { isNonContiguousSelectionModifier } from \"./utils\";\n\nexport interface SelectItemState {\n readonly selectionMode: Accessor<SelectionMode>;\n readonly selectionBehavior: Accessor<SelectionBehavior>;\n readonly disallowEmptySelection: Accessor<boolean>;\n isSelected(key: Key): boolean;\n toggleSelection(key: Key): void;\n replaceSelection(key: Key): void;\n extendSelection(toKey: Key, collection: Collection): void;\n}\n\n/**\n * Resolve a press/keyboard interaction into a selection mutation on `manager`,\n * faithful to `useSelectableItem.onSelect`. `collection` is required for the\n * shift-extend (contiguous range) path.\n */\nexport function selectItem(\n manager: SelectItemState,\n key: Key,\n e: SelectionPressEvent,\n collection: Collection,\n): void {\n // A keyboard non-contiguous modifier (Alt on Apple devices, Ctrl elsewhere)\n // always toggles, independent of mode/behavior.\n if (e.pointerType === \"keyboard\" && isNonContiguousSelectionModifier(e)) {\n manager.toggleSelection(key);\n return;\n }\n\n if (manager.selectionMode() === \"none\") {\n return;\n }\n\n if (manager.selectionMode() === \"single\") {\n // Single mode ignores selectionBehavior. Re-selecting the current item\n // deselects it when empty selection is allowed; otherwise it stays\n // selected (replace).\n if (manager.isSelected(key) && !manager.disallowEmptySelection()) {\n manager.toggleSelection(key);\n } else {\n manager.replaceSelection(key);\n }\n } else if (e.shiftKey) {\n manager.extendSelection(key, collection);\n } else if (\n manager.selectionBehavior() === \"toggle\" ||\n isCtrlKeyPressed(e) ||\n e.pointerType === \"touch\" ||\n e.pointerType === \"virtual\"\n ) {\n // touch / virtual (VoiceOver) have no modifier keys, so multi-select is\n // only reachable by toggling.\n manager.toggleSelection(key);\n } else {\n manager.replaceSelection(key);\n }\n}\n","/**\n * createSelectableItem - handles interactions with an item in a selectable\n * collection. Port of `@react-aria/selection`'s `useSelectableItem`.\n *\n * This encapsulates the full press-path action model: the\n * selection-vs-action decision per pointer type, the press-up-vs-press timing\n * (menus select on press up, rows on press down), the keyboard Space/Enter\n * split, double-click secondary actions, and long-press-to-toggle. The\n * selection decision itself is delegated to the aria-layer {@link selectItem}\n * (Phase 0), which is also where the platform-aware modifier resolution lives.\n *\n * Documented adaptations from upstream (React → Solid / our thinner state):\n * - **Link model is prop-threaded.** Our collection nodes don't expose\n * `manager.isLink`/`manager.getItemProps`, so link items pass `isLink` /\n * `href` / `routerOptions` via options and navigation goes through\n * {@link openLink} (we have no `RouterProvider` context).\n * - **Selection manager shape is structural.** ListState passes its\n * SelectionManager; grid-like states pass an adapter with the same observable\n * surface. `canSelectItem` is read from that surface when available so\n * `disabledBehavior: 'selection'` keeps actions enabled while selection stays\n * blocked.\n * - **Virtual focus** guards real DOM focus and updates the focused key on\n * press; we have no `moveVirtualFocus`, so no AT cursor move is dispatched.\n * - **`onDragStart`** is bubble phase (upstream uses capture to beat `useDrag`);\n * wired to capture when drag-and-drop integration lands.\n * - **`getItemProps` press-handler chaining** (collection-provided press\n * handlers) is omitted — our nodes don't carry them.\n */\n\nimport { createEffect, createUniqueId, type Accessor, type JSX } from \"solid-js\";\nimport type {\n Collection,\n DisabledBehavior,\n FocusStrategy,\n Key,\n Selection,\n SelectionBehavior,\n} from \"@proyecto-viviana/solid-stately\";\nimport { createPress, type PressEvent } from \"../interactions/createPress\";\nimport { createLongPress } from \"../interactions/createLongPress\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport { focusSafely } from \"../utils/focus\";\nimport { getOwnerDocument, getEventTarget, openLink } from \"../utils/dom\";\nimport { getCollectionId, isNonContiguousSelectionModifier } from \"./utils\";\nimport { selectItem, type SelectItemState } from \"./selectItem\";\n\n/**\n * DOM event dispatched when an item action is performed. Mirrors upstream's\n * `react-aria-item-action`; combobox/autocomplete listen for it to close on\n * action. Exported so emitter and listener share one constant.\n */\nexport const ITEM_ACTION_EVENT = \"solidaria:item-action\";\n\n/** How links in the collection behave relative to selection and actions. */\nexport type LinkBehavior = \"action\" | \"selection\" | \"override\" | \"none\";\n\nexport interface CreateSelectableItemOptions {\n /** A unique key for the item. */\n key: Key;\n /** Optional DOM id for the item element. Defaults to a generated id. */\n id?: string;\n /**\n * By default, selection occurs on pointer down. Set to select on pointer up\n * instead — useful when selecting an item makes the UI disappear (e.g. menus).\n */\n shouldSelectOnPressUp?: boolean;\n /**\n * Whether selection may trigger on a pointer up whose pointer down occurred on\n * a different target (e.g. press down on the menu trigger, up on a menu item).\n */\n allowsDifferentPressOrigin?: boolean;\n /** Whether the item is contained in a virtual scroller. */\n isVirtualized?: boolean;\n /** Function to focus the item, overriding the default DOM focus. */\n focus?: () => void;\n /** Whether the item should use virtual focus instead of receiving DOM focus. */\n shouldUseVirtualFocus?: boolean;\n /** Whether the item is disabled. */\n isDisabled?: boolean;\n /**\n * Handler called when the user performs an action on the item. The triggering\n * event depends on the collection's `selectionBehavior` and the modality.\n */\n onAction?: (event: PressEvent | MouseEvent) => void;\n /**\n * The behavior of links in the collection.\n * - `action`: link behaves like onAction.\n * - `selection`: link follows selection interactions (e.g. URL drives selection).\n * - `override`: links override all other interactions (link items aren't selectable).\n * - `none`: links are disabled for both selection and actions.\n * @default 'action'\n */\n linkBehavior?: LinkBehavior;\n /** Whether this item is a link (prop-threaded; our nodes don't expose `isLink`). */\n isLink?: boolean;\n /** The link target URL, when `isLink`. */\n href?: string;\n /** Router options forwarded to navigation, when `isLink`. */\n routerOptions?: Record<string, unknown>;\n /**\n * Unstable upstream override that forces an item with `onAction` to treat the\n * action as primary (single click), even when it is selectable.\n */\n UNSTABLE_itemBehavior?: \"selection\" | \"action\";\n}\n\nexport interface SelectableItemAria {\n /** Props to spread on the item root element. */\n itemProps: JSX.HTMLAttributes<HTMLElement>;\n /** Whether the item is currently pressed. */\n isPressed: Accessor<boolean>;\n /** Whether the item is currently selected. */\n isSelected: Accessor<boolean>;\n /** Whether the item is currently focused. */\n isFocused: Accessor<boolean>;\n /** Whether the item is non-interactive (selection and actions both disabled). */\n isDisabled: Accessor<boolean>;\n /** Whether the item may be selected. */\n allowsSelection: Accessor<boolean>;\n /** Whether the item has an action (primary or secondary). */\n hasAction: Accessor<boolean>;\n}\n\nexport interface SelectableItemState<T> extends SelectItemState {\n /** The collection the item belongs to. */\n readonly collection: Accessor<Collection<T>>;\n /** Whether the collection is currently focused. */\n readonly isFocused: Accessor<boolean>;\n /** Sets whether the collection is focused. */\n setFocused(isFocused: boolean): void;\n /** The currently focused key in the collection. */\n readonly focusedKey: Accessor<Key | null>;\n /** The strategy for child focus, when applicable. */\n readonly childFocusStrategy?: Accessor<FocusStrategy | null>;\n /** Sets the focused key. */\n setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void;\n /** The currently selected keys. */\n readonly selectedKeys: Accessor<Selection>;\n /** Disabled keys for the collection. */\n readonly disabledKeys: Accessor<Set<Key>>;\n /** How disabled keys behave. */\n readonly disabledBehavior: Accessor<DisabledBehavior>;\n /** Whether selection is empty. */\n readonly isEmpty: Accessor<boolean>;\n /** Whether all selectable items are selected. */\n readonly isSelectAll?: Accessor<boolean>;\n /** Whether the key is fully disabled for interaction. */\n isDisabled(key: Key): boolean;\n /** Whether the key may be selected. Defaults to SelectionManager when present. */\n canSelectItem?(key: Key): boolean;\n /** Set the selection behavior for the collection. */\n setSelectionBehavior(behavior: SelectionBehavior): void;\n /** Set multiple selected keys. */\n setSelectedKeys(keys: Iterable<Key>): void;\n /** Select all selectable keys. */\n selectAll(): void;\n /** Clear selection. */\n clearSelection(): void;\n /** Toggle select all. */\n toggleSelectAll(): void;\n /** Optional stable object used by selectable collections for DOM scoping. */\n readonly selectionManager?: {\n canSelectItem?(key: Key): boolean;\n } & object;\n}\n\nconst isActionKey = (key: string | undefined) => key === \"Enter\";\nconst isSelectionKey = (key: string | undefined) => key === \" \";\n\n/**\n * Provides the behavior and accessibility implementation for an item in a\n * selectable collection.\n */\nexport function createSelectableItem<T>(\n options: MaybeAccessor<CreateSelectableItemOptions>,\n manager: SelectableItemState<T>,\n ref: () => HTMLElement | null,\n): SelectableItemAria {\n const getOptions = () => access(options);\n const generatedId = createUniqueId();\n\n const key = () => getOptions().key;\n const id = () => getOptions().id ?? generatedId;\n const linkBehavior = (): LinkBehavior => getOptions().linkBehavior ?? \"action\";\n const shouldUseVirtualFocus = () => getOptions().shouldUseVirtualFocus ?? false;\n const allowsDifferentPressOrigin = () => getOptions().allowsDifferentPressOrigin ?? false;\n const shouldSelectOnPressUp = () => getOptions().shouldSelectOnPressUp ?? false;\n const isLink = () => getOptions().isLink ?? !!getOptions().href;\n\n const collection = (): Collection<T> => manager.collection();\n\n // Final disabled state: explicitly disabled, or disabled by the collection.\n const isDisabled = () => getOptions().isDisabled === true || manager.isDisabled(key());\n\n // Mirrors SelectionManager.canSelectItem, while allowing grid/table/tree\n // adapters to expose the raw selection-disabled check separately from\n // interaction disabled.\n const canSelectItem = () => {\n const k = key();\n return (\n manager.canSelectItem?.(k) ??\n manager.selectionManager?.canSelectItem?.(k) ??\n (manager.selectionMode() !== \"none\" && !manager.isDisabled(k))\n );\n };\n\n const isLinkOverride = () => isLink() && linkBehavior() === \"override\";\n const isActionOverride = () =>\n getOptions().onAction != null && getOptions().UNSTABLE_itemBehavior === \"action\";\n const hasLinkAction = () =>\n isLink() && linkBehavior() !== \"selection\" && linkBehavior() !== \"none\";\n\n const allowsSelection = () =>\n !isDisabled() && canSelectItem() && !isLinkOverride() && !isActionOverride();\n const allowsActions = () => (getOptions().onAction != null || hasLinkAction()) && !isDisabled();\n\n // With checkbox selection (behavior 'toggle'), onAction is primary and occurs\n // on a single click. With highlight selection (behavior 'replace'), onAction\n // is secondary and occurs on double click; single click selects.\n const hasPrimaryAction = () =>\n allowsActions() &&\n (manager.selectionBehavior() === \"replace\"\n ? !allowsSelection()\n : !allowsSelection() || manager.isEmpty());\n const hasSecondaryAction = () =>\n allowsActions() && allowsSelection() && manager.selectionBehavior() === \"replace\";\n const hasAction = () => hasPrimaryAction() || hasSecondaryAction();\n\n const longPressEnabled = () => hasAction() && allowsSelection();\n\n // Plain mutable state (no reactivity needed): the modality of the active press\n // and snapshots captured at press start.\n let modality: PressEvent[\"pointerType\"] | null = null;\n let longPressEnabledOnPressStart = false;\n let hadPrimaryActionOnPressStart = false;\n\n const isSelected = () => manager.selectionMode() !== \"none\" && manager.isSelected(key());\n const isFocused = () => manager.isFocused() && manager.focusedKey() === key();\n\n // The aria-layer selection decision, with the link branch (deferred from\n // selectItem) layered in. Mirrors useSelectableItem.onSelect.\n const onSelect = (e: PressEvent) => {\n const k = key();\n if (e.pointerType === \"keyboard\" && isNonContiguousSelectionModifier(e)) {\n manager.toggleSelection(k);\n return;\n }\n\n if (manager.selectionMode() === \"none\") {\n return;\n }\n\n if (isLink()) {\n if (linkBehavior() === \"selection\") {\n const el = ref();\n if (el instanceof HTMLAnchorElement) {\n openLink(el, e as unknown as Event);\n }\n // Restore the prior selection so select/combobox close cleanly.\n const sel = manager.selectedKeys();\n if (sel !== \"all\") {\n manager.setSelectedKeys(sel);\n }\n return;\n } else if (linkBehavior() === \"override\" || linkBehavior() === \"none\") {\n return;\n }\n }\n\n selectItem(manager, k, e, collection());\n };\n\n const performAction = (e: PressEvent | MouseEvent) => {\n const o = getOptions();\n if (o.onAction) {\n o.onAction(e);\n ref()?.dispatchEvent(new CustomEvent(ITEM_ACTION_EVENT, { bubbles: true }));\n }\n\n if (hasLinkAction()) {\n const el = ref();\n if (el instanceof HTMLAnchorElement) {\n openLink(el, e as unknown as Event);\n }\n }\n };\n\n // Focus the associated DOM node when this item becomes the focused key. This\n // is the imperative half of roving tabindex — the tabIndex 0/-1 swap below is\n // only declarative.\n createEffect(() => {\n if (key() !== manager.focusedKey() || !manager.isFocused()) {\n return;\n }\n\n const o = getOptions();\n if (!shouldUseVirtualFocus()) {\n if (o.focus) {\n o.focus();\n } else {\n const el = ref();\n if (el && getOwnerDocument(el).activeElement !== el) {\n focusSafely(el);\n }\n }\n }\n // Virtual focus: no moveVirtualFocus equivalent in our port (documented gap).\n });\n\n const { pressProps, isPressed } = createPress({\n get isDisabled() {\n // Press is only wired when the item is interactive (see the merge below),\n // but guard here too so disabled items never fire press handlers.\n return !(\n allowsSelection() ||\n hasPrimaryAction() ||\n (shouldUseVirtualFocus() && !isDisabled())\n );\n },\n get preventFocusOnPress() {\n return shouldUseVirtualFocus();\n },\n onPressStart(e) {\n modality = e.pointerType;\n longPressEnabledOnPressStart = longPressEnabled();\n\n if (shouldSelectOnPressUp()) {\n // Selection still happens on key down for the keyboard.\n if (e.pointerType === \"keyboard\" && (!hasAction() || isSelectionKey(e.key))) {\n onSelect(e);\n }\n } else {\n hadPrimaryActionOnPressStart = hasPrimaryAction();\n // Select on mouse down unless a primary action will occur on mouse up.\n // For keyboard, select on key down; with an action, Space selects on key\n // down and Enter performs the action on key up.\n if (\n allowsSelection() &&\n ((e.pointerType === \"mouse\" && !hasPrimaryAction()) ||\n (e.pointerType === \"keyboard\" && (!allowsActions() || isSelectionKey(e.key))))\n ) {\n onSelect(e);\n }\n }\n\n // When using virtual focus, update the focused key on (non-touch) press.\n if (shouldUseVirtualFocus() && e.pointerType !== \"touch\") {\n manager.setFocused(true);\n manager.setFocusedKey(key());\n }\n },\n onPressUp(e) {\n // Only relevant for press-up selection with a different press origin and\n // no primary action: select on the mouse up itself.\n if (\n shouldSelectOnPressUp() &&\n allowsDifferentPressOrigin() &&\n !hasPrimaryAction() &&\n e.pointerType === \"mouse\" &&\n allowsSelection()\n ) {\n onSelect(e);\n }\n },\n onPress(e) {\n if (shouldSelectOnPressUp()) {\n if (!allowsDifferentPressOrigin()) {\n if (hasPrimaryAction() || (hasSecondaryAction() && e.pointerType !== \"mouse\")) {\n if (e.pointerType === \"keyboard\" && !isActionKey(e.key)) {\n return;\n }\n performAction(e);\n } else if (e.pointerType !== \"keyboard\" && allowsSelection()) {\n onSelect(e);\n }\n } else if (hasPrimaryAction()) {\n performAction(e);\n } else if (e.pointerType !== \"keyboard\" && e.pointerType !== \"mouse\" && allowsSelection()) {\n onSelect(e);\n }\n } else if (\n // Selection on touch up; primary actions on pointer up. Both primary and\n // secondary actions on Enter key up. Secondary mouse actions go through\n // double click (below), not here.\n e.pointerType === \"touch\" ||\n e.pointerType === \"pen\" ||\n e.pointerType === \"virtual\" ||\n (e.pointerType === \"keyboard\" && hasAction() && isActionKey(e.key)) ||\n (e.pointerType === \"mouse\" && hadPrimaryActionOnPressStart)\n ) {\n if (hasAction()) {\n performAction(e);\n } else if (allowsSelection()) {\n onSelect(e);\n }\n }\n\n // When using virtual focus, update the focused key on a touch press.\n if (shouldUseVirtualFocus() && e.pointerType === \"touch\") {\n manager.setFocused(true);\n manager.setFocusedKey(key());\n }\n },\n });\n\n // Long pressing an item with touch when selectionBehavior = 'replace' switches\n // to 'toggle': single tap now selects (and toggles checkbox affordances)\n // instead of performing the action.\n const { longPressProps } = createLongPress({\n get isDisabled() {\n return !longPressEnabled();\n },\n onLongPress(e) {\n if (e.pointerType === \"touch\") {\n onSelect(e as unknown as PressEvent);\n manager.setSelectionBehavior(\"toggle\");\n }\n },\n });\n\n // Double clicking with a mouse with selectionBehavior = 'replace' performs the\n // secondary action.\n const onDblClick = (e: MouseEvent) => {\n if (!hasSecondaryAction()) return;\n if (modality === \"mouse\") {\n e.stopPropagation();\n e.preventDefault();\n performAction(e as unknown as PressEvent);\n }\n };\n\n // Prevent native drag and drop on long press when we also select on long\n // press. Upstream uses a capturing listener to beat useDrag; we use bubble\n // until drag-and-drop integration lands (documented adaptation).\n const onDragStart = (e: DragEvent) => {\n if (modality === \"touch\" && longPressEnabledOnPressStart) {\n e.preventDefault();\n }\n };\n\n // Prevent native link clicks so we control exactly when they open (matching\n // selection behavior).\n const onClick = (e: MouseEvent) => {\n if (linkBehavior() !== \"none\" && isLink()) {\n if (!(openLink as { isOpening?: boolean }).isOpening) {\n e.preventDefault();\n }\n }\n };\n\n return {\n get itemProps(): JSX.HTMLAttributes<HTMLElement> {\n const k = key();\n const disabled = isDisabled();\n\n const baseProps: Record<string, unknown> = {\n \"data-key\": String(k),\n // Scopes this item to its collection for getItemElement. Resolves to a\n // value only once a createSelectableCollection container has registered\n // the manager; otherwise undefined (Solid omits the attribute).\n \"data-collection\": getCollectionId(manager.selectionManager ?? manager),\n };\n\n // Roving tabindex: only the focused item is tabbable. With virtual focus,\n // omit tabIndex entirely (so iOS VoiceOver doesn't pull real focus).\n if (!shouldUseVirtualFocus() && !disabled) {\n baseProps.tabIndex = k === manager.focusedKey() ? 0 : -1;\n baseProps.onFocus = (e: FocusEvent) => {\n if (getEventTarget(e) === ref()) {\n manager.setFocusedKey(k);\n }\n };\n } else if (disabled) {\n // Prevent focus going to the body when clicking a disabled item.\n baseProps.onMouseDown = (e: MouseEvent) => e.preventDefault();\n }\n\n const interactive =\n allowsSelection() || hasPrimaryAction() || (shouldUseVirtualFocus() && !disabled);\n\n return mergeProps(\n baseProps,\n interactive ? (pressProps as Record<string, unknown>) : {},\n longPressEnabled() ? (longPressProps as Record<string, unknown>) : {},\n { onDblClick, onDragStart, onClick, id: id() },\n // Prevent DOM focus from moving on mouse down when using virtual focus.\n shouldUseVirtualFocus() ? { onMouseDown: (e: MouseEvent) => e.preventDefault() } : {},\n ) as JSX.HTMLAttributes<HTMLElement>;\n },\n isPressed,\n isSelected,\n isFocused,\n isDisabled,\n allowsSelection,\n hasAction,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,eAAe,KAAmC,KAA8B;CAC9F,MAAM,OAAO,IAAI;CACjB,IAAI,CAAC,MACH,OAAO;CAET,IAAI,WAAW,cAAc,IAAI,OAAO,OAAO,GAAG,CAAC,EAAE;CACrD,MAAM,eAAe,KAAK,QAAQ;CAClC,IAAI,cACF,WAAW,qBAAqB,IAAI,OAAO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AAI,UAET,UAAU,eAAe,MAAkB,EAAE,eAAe;GAM9D,OAAO,WACL,WAHA,gBAAgB,KAAK,iBAAiB,KAAM,sBAAsB,KAAK,CAAC,WAIzD,aAAyC,CAAC,GACzD,iBAAiB,IAAK,iBAA6C,CAAC,GACpE;IAAE;IAAY;IAAa;IAAS,IAAI,GAAG;GAAE,GAE7C,sBAAsB,IAAI,EAAE,cAAc,MAAkB,EAAE,eAAe,EAAE,IAAI,CAAC,CACtF;EACF;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -0,0 +1,158 @@
1
+ import { t as createPress } from "./createPress.js";
2
+ import { i as access, o as mergeProps, t as isDevEnv } from "./env.js";
3
+ import { t as filterDOMProps } from "./filterDOMProps.js";
4
+ import { n as createFocusable } from "./createFocusable.js";
5
+ import { createSlotId } from "../ssr/index.js";
6
+ import { createEffect } from "solid-js";
7
+ //#region src/toggle/createToggle.ts
8
+ /**
9
+ * Toggle hook for Solidaria
10
+ *
11
+ * Handles interactions for toggle elements, e.g. Checkboxes and Switches.
12
+ *
13
+ * This is a 1:1 port of @react-aria/toggle's useToggle hook.
14
+ */
15
+ /**
16
+ * Handles interactions for toggle elements, e.g. Checkboxes and Switches.
17
+ */
18
+ function createToggle(props, state, ref) {
19
+ const getProps = () => access(props);
20
+ const isDisabled = () => getProps().isDisabled ?? false;
21
+ const isReadOnly = () => getProps().isReadOnly ?? false;
22
+ const isInvalid = () => {
23
+ return getProps().isInvalid ?? false;
24
+ };
25
+ const { pressProps, isPressed } = createPress({
26
+ get onPressStart() {
27
+ return getProps().onPressStart;
28
+ },
29
+ get onPressEnd() {
30
+ return getProps().onPressEnd;
31
+ },
32
+ get onPressChange() {
33
+ return getProps().onPressChange;
34
+ },
35
+ get onPress() {
36
+ return getProps().onPress;
37
+ },
38
+ get onPressUp() {
39
+ return getProps().onPressUp;
40
+ },
41
+ get onClick() {
42
+ return getProps().onClick;
43
+ },
44
+ get isDisabled() {
45
+ return isDisabled();
46
+ }
47
+ });
48
+ const { pressProps: labelPressProps, isPressed: isLabelPressed } = createPress({
49
+ get onPressStart() {
50
+ return getProps().onPressStart;
51
+ },
52
+ get onPressEnd() {
53
+ return getProps().onPressEnd;
54
+ },
55
+ get onPressChange() {
56
+ return getProps().onPressChange;
57
+ },
58
+ get onPressUp() {
59
+ return getProps().onPressUp;
60
+ },
61
+ get onClick() {
62
+ return getProps().onClick;
63
+ },
64
+ onPress(e) {
65
+ getProps().onPress?.(e);
66
+ state.toggle();
67
+ ref()?.focus();
68
+ },
69
+ get isDisabled() {
70
+ return isDisabled() || isReadOnly();
71
+ }
72
+ });
73
+ const { focusableProps } = createFocusable({
74
+ get isDisabled() {
75
+ return isDisabled();
76
+ },
77
+ get autoFocus() {
78
+ return getProps().autoFocus;
79
+ },
80
+ get onFocus() {
81
+ return getProps().onFocus;
82
+ },
83
+ get onBlur() {
84
+ return getProps().onBlur;
85
+ },
86
+ get onFocusChange() {
87
+ return getProps().onFocusChange;
88
+ },
89
+ get onKeyDown() {
90
+ return getProps().onKeyDown;
91
+ },
92
+ get onKeyUp() {
93
+ return getProps().onKeyUp;
94
+ },
95
+ get excludeFromTabOrder() {
96
+ return getProps().excludeFromTabOrder;
97
+ }
98
+ }, ref);
99
+ const interactions = mergeProps(pressProps, focusableProps);
100
+ const domProps = () => filterDOMProps(getProps(), { labelable: true });
101
+ const onChange = (e) => {
102
+ e.stopPropagation();
103
+ if (isReadOnly()) {
104
+ e.currentTarget.checked = state.isSelected();
105
+ return;
106
+ }
107
+ state.setSelected(e.currentTarget.checked);
108
+ };
109
+ createEffect(() => {
110
+ const p = getProps();
111
+ const hasChildren = p.children != null;
112
+ const hasAriaLabel = p["aria-label"] != null || p["aria-labelledby"] != null;
113
+ if (!hasChildren && !hasAriaLabel && isDevEnv()) console.warn("If you do not provide children, you must specify an aria-label for accessibility");
114
+ });
115
+ const combinedIsPressed = () => isPressed() || isLabelPressed();
116
+ const descriptionId = createSlotId();
117
+ const errorMessageId = createSlotId();
118
+ return {
119
+ labelProps: mergeProps(labelPressProps, { onClick: (e) => e.preventDefault() }),
120
+ get inputProps() {
121
+ const p = getProps();
122
+ return mergeProps(domProps(), {
123
+ "aria-invalid": isInvalid() || void 0,
124
+ "aria-errormessage": p["aria-errormessage"],
125
+ "aria-controls": p["aria-controls"],
126
+ "aria-readonly": isReadOnly() || void 0,
127
+ "aria-describedby": [
128
+ descriptionId(),
129
+ errorMessageId(),
130
+ p["aria-describedby"]
131
+ ].filter(Boolean).join(" ") || void 0,
132
+ onChange,
133
+ disabled: isDisabled(),
134
+ ...p.value == null ? {} : { value: p.value },
135
+ name: p.name,
136
+ form: p.form,
137
+ type: "checkbox",
138
+ ...interactions,
139
+ onClick: (e) => e.stopPropagation()
140
+ });
141
+ },
142
+ get descriptionProps() {
143
+ return { id: descriptionId() };
144
+ },
145
+ get errorMessageProps() {
146
+ return { id: errorMessageId() };
147
+ },
148
+ isSelected: state.isSelected,
149
+ isPressed: combinedIsPressed,
150
+ isDisabled: isDisabled(),
151
+ isReadOnly: isReadOnly(),
152
+ isInvalid: isInvalid()
153
+ };
154
+ }
155
+ //#endregion
156
+ export { createToggle as t };
157
+
158
+ //# sourceMappingURL=createToggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createToggle.js","names":[],"sources":["../../src/toggle/createToggle.ts"],"sourcesContent":["/**\n * Toggle hook for Solidaria\n *\n * Handles interactions for toggle elements, e.g. Checkboxes and Switches.\n *\n * This is a 1:1 port of @react-aria/toggle's useToggle hook.\n */\n\nimport { JSX, Accessor, createEffect } from \"solid-js\";\nimport { createPress } from \"../interactions/createPress\";\nimport { createFocusable } from \"../interactions/createFocusable\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { filterDOMProps } from \"../utils/filterDOMProps\";\nimport { type MaybeAccessor, access } from \"../utils/reactivity\";\nimport { isDevEnv } from \"../utils/env\";\nimport { createSlotId } from \"../ssr\";\nimport { type ToggleState } from \"@proyecto-viviana/solid-stately\";\nimport { type PressEvent } from \"../interactions/PressEvent\";\n\nexport interface AriaToggleProps {\n /** Whether the element should be selected (controlled). */\n isSelected?: boolean;\n /** Whether the element should be selected by default (uncontrolled). */\n defaultSelected?: boolean;\n /** Handler that is called when the element's selection state changes. */\n onChange?: (isSelected: boolean) => void;\n /** The value of the input element, used when submitting an HTML form. */\n value?: string;\n /** The name of the input element, used when submitting an HTML form. */\n name?: string;\n /** The form to associate the input with. */\n form?: string;\n /** Whether the element is disabled. */\n isDisabled?: boolean;\n /** Whether the element is read only. */\n isReadOnly?: boolean;\n /** Whether the element is required. */\n isRequired?: boolean;\n /** Whether the element is invalid. */\n isInvalid?: boolean;\n /** The element's children. */\n children?: JSX.Element;\n /** Defines a string value that labels the current element. */\n \"aria-label\"?: string;\n /** Identifies the element (or elements) that labels the current element. */\n \"aria-labelledby\"?: string;\n /** Identifies the element (or elements) that describes the object. */\n \"aria-describedby\"?: string;\n /** Identifies the element (or elements) that provide an error message for the object. */\n \"aria-errormessage\"?: string;\n /** Identifies the element (or elements) whose contents or presence are controlled by the current element. */\n \"aria-controls\"?: string;\n /** The element's unique identifier. */\n id?: string;\n /** Handler that is called when the press is released over the target. */\n onPress?: (e: PressEvent) => void;\n /** Handler that is called when a press interaction starts. */\n onPressStart?: (e: PressEvent) => void;\n /** Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target. */\n onPressEnd?: (e: PressEvent) => void;\n /** Handler that is called when the press state changes. */\n onPressChange?: (isPressed: boolean) => void;\n /** Handler that is called when a press is released over the target, regardless of whether it started on the target or not. */\n onPressUp?: (e: PressEvent) => void;\n /** Handler that is called when the element is clicked. */\n onClick?: (e: MouseEvent) => void;\n /** Handler that is called when the element receives focus. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler that is called when the element loses focus. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler that is called when the element's focus status changes. */\n onFocusChange?: (isFocused: boolean) => void;\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 /** Whether to exclude the element from the tab order. */\n excludeFromTabOrder?: boolean;\n /** Whether to autofocus the element. */\n autoFocus?: boolean;\n}\n\nexport interface ToggleAria {\n /** Props to be spread on the label element. */\n labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;\n /** Props to be spread on the input element. */\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n /** Props for the description element, if any. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the error message element, if any. */\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n /** Whether the toggle is selected. */\n isSelected: Accessor<boolean>;\n /** Whether the toggle is in a pressed state. */\n isPressed: Accessor<boolean>;\n /** Whether the toggle is disabled. */\n isDisabled: boolean;\n /** Whether the toggle is read only. */\n isReadOnly: boolean;\n /** Whether the toggle is invalid. */\n isInvalid: boolean;\n}\n\n/**\n * Handles interactions for toggle elements, e.g. Checkboxes and Switches.\n */\nexport function createToggle(\n props: MaybeAccessor<AriaToggleProps>,\n state: ToggleState,\n ref: () => HTMLInputElement | null,\n): ToggleAria {\n const getProps = () => access(props);\n\n const isDisabled = () => getProps().isDisabled ?? false;\n const isReadOnly = () => getProps().isReadOnly ?? false;\n const isInvalid = () => {\n return getProps().isInvalid ?? false;\n };\n\n // Handle press state for keyboard interactions and cases where labelProps is not used.\n const { pressProps, isPressed } = createPress({\n get onPressStart() {\n return getProps().onPressStart;\n },\n get onPressEnd() {\n return getProps().onPressEnd;\n },\n get onPressChange() {\n return getProps().onPressChange;\n },\n get onPress() {\n return getProps().onPress;\n },\n get onPressUp() {\n return getProps().onPressUp;\n },\n get onClick() {\n return getProps().onClick;\n },\n get isDisabled() {\n return isDisabled();\n },\n });\n\n // Handle press state on the label.\n const { pressProps: labelPressProps, isPressed: isLabelPressed } = createPress({\n get onPressStart() {\n return getProps().onPressStart;\n },\n get onPressEnd() {\n return getProps().onPressEnd;\n },\n get onPressChange() {\n return getProps().onPressChange;\n },\n get onPressUp() {\n return getProps().onPressUp;\n },\n get onClick() {\n return getProps().onClick;\n },\n onPress(e: PressEvent) {\n getProps().onPress?.(e);\n state.toggle();\n ref()?.focus();\n },\n get isDisabled() {\n return isDisabled() || isReadOnly();\n },\n });\n\n // Handle focusable - extract the relevant props for createFocusable\n const { focusableProps } = createFocusable(\n {\n get isDisabled() {\n return isDisabled();\n },\n get autoFocus() {\n return getProps().autoFocus;\n },\n get onFocus() {\n return getProps().onFocus;\n },\n get onBlur() {\n return getProps().onBlur;\n },\n get onFocusChange() {\n return getProps().onFocusChange;\n },\n get onKeyDown() {\n return getProps().onKeyDown;\n },\n get onKeyUp() {\n return getProps().onKeyUp;\n },\n get excludeFromTabOrder() {\n return getProps().excludeFromTabOrder;\n },\n },\n ref as unknown as (el: HTMLElement) => void,\n );\n\n // Combine press and focusable props for input\n const interactions = mergeProps(pressProps, focusableProps);\n\n // Filter DOM props\n const domProps = () =>\n filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true });\n\n // Handle input change\n const onChange: JSX.EventHandler<HTMLInputElement, Event> = (e) => {\n // Since we spread props on label, onChange will end up there as well as in here.\n // So we have to stop propagation at the lowest level that we care about\n e.stopPropagation();\n\n // Don't update state if readonly\n if (isReadOnly()) {\n // Reset the checkbox to its previous state since the browser already toggled it\n e.currentTarget.checked = state.isSelected();\n return;\n }\n\n state.setSelected(e.currentTarget.checked);\n };\n\n // Warn if no accessible label\n createEffect(() => {\n const p = getProps();\n const hasChildren = p.children != null;\n const hasAriaLabel = p[\"aria-label\"] != null || p[\"aria-labelledby\"] != null;\n if (!hasChildren && !hasAriaLabel && isDevEnv()) {\n console.warn(\n \"If you do not provide children, you must specify an aria-label for accessibility\",\n );\n }\n });\n\n // Combined pressed state\n const combinedIsPressed: Accessor<boolean> = () => isPressed() || isLabelPressed();\n\n // Mint ids for the description and error message slots. Copied from createField\n // because we don't want the label behavior that provides — the id resolves only\n // once an element with that id is actually rendered (e.g. via TextContext slots).\n const descriptionId = createSlotId();\n const errorMessageId = createSlotId();\n\n return {\n labelProps: mergeProps(labelPressProps, {\n onClick: (e: MouseEvent) => e.preventDefault(),\n }) as JSX.LabelHTMLAttributes<HTMLLabelElement>,\n get inputProps() {\n const p = getProps();\n return mergeProps(domProps(), {\n \"aria-invalid\": isInvalid() || undefined,\n \"aria-errormessage\": p[\"aria-errormessage\"],\n \"aria-controls\": p[\"aria-controls\"],\n \"aria-readonly\": isReadOnly() || undefined,\n \"aria-describedby\":\n [descriptionId(), errorMessageId(), p[\"aria-describedby\"]].filter(Boolean).join(\" \") ||\n undefined,\n onChange,\n disabled: isDisabled(),\n ...(p.value == null ? {} : { value: p.value }),\n name: p.name,\n form: p.form,\n type: \"checkbox\" as const,\n ...interactions,\n // Stop click propagation to prevent labelProps.onClick from calling preventDefault\n // which would prevent the checkbox from toggling in JSDOM/testing-library environments\n onClick: (e: MouseEvent) => e.stopPropagation(),\n }) as JSX.InputHTMLAttributes<HTMLInputElement>;\n },\n get descriptionProps() {\n return { id: descriptionId() };\n },\n get errorMessageProps() {\n return { id: errorMessageId() };\n },\n isSelected: state.isSelected,\n isPressed: combinedIsPressed,\n isDisabled: isDisabled(),\n isReadOnly: isReadOnly(),\n isInvalid: isInvalid(),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA0GA,SAAgB,aACd,OACA,OACA,KACY;CACZ,MAAM,iBAAiB,OAAO,KAAK;CAEnC,MAAM,mBAAmB,SAAS,CAAC,CAAC,cAAc;CAClD,MAAM,mBAAmB,SAAS,CAAC,CAAC,cAAc;CAClD,MAAM,kBAAkB;EACtB,OAAO,SAAS,CAAC,CAAC,aAAa;CACjC;CAGA,MAAM,EAAE,YAAY,cAAc,YAAY;EAC5C,IAAI,eAAe;GACjB,OAAO,SAAS,CAAC,CAAC;EACpB;EACA,IAAI,aAAa;GACf,OAAO,SAAS,CAAC,CAAC;EACpB;EACA,IAAI,gBAAgB;GAClB,OAAO,SAAS,CAAC,CAAC;EAC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