@proyecto-viviana/solidaria 0.4.0 → 0.4.2

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 (480) hide show
  1. package/dist/_chunk/DragManager.js +627 -0
  2. package/dist/_chunk/DragManager.js.map +1 -0
  3. package/dist/_chunk/DragManager.jsx +627 -0
  4. package/dist/_chunk/DragManager.jsx.map +1 -0
  5. package/dist/_chunk/FocusScope.js +400 -0
  6. package/dist/_chunk/FocusScope.js.map +1 -0
  7. package/dist/_chunk/FocusScope.jsx +375 -0
  8. package/dist/_chunk/FocusScope.jsx.map +1 -0
  9. package/dist/_chunk/actiongroup.js +13 -79
  10. package/dist/_chunk/actiongroup.js.map +1 -1
  11. package/dist/_chunk/actiongroup.jsx +13 -79
  12. package/dist/_chunk/actiongroup.jsx.map +1 -1
  13. package/dist/_chunk/{live-announcer.js → announce.js} +1 -1
  14. package/dist/_chunk/announce.js.map +1 -0
  15. package/dist/_chunk/{live-announcer.jsx → announce.jsx} +1 -1
  16. package/dist/_chunk/announce.jsx.map +1 -0
  17. package/dist/_chunk/autocomplete.js +56 -8
  18. package/dist/_chunk/autocomplete.js.map +1 -1
  19. package/dist/_chunk/autocomplete.jsx +56 -8
  20. package/dist/_chunk/autocomplete.jsx.map +1 -1
  21. package/dist/_chunk/breadcrumbs.js +6 -4
  22. package/dist/_chunk/breadcrumbs.js.map +1 -1
  23. package/dist/_chunk/breadcrumbs.jsx +6 -4
  24. package/dist/_chunk/breadcrumbs.jsx.map +1 -1
  25. package/dist/_chunk/button.js +8 -9
  26. package/dist/_chunk/button.js.map +1 -1
  27. package/dist/_chunk/button.jsx +8 -9
  28. package/dist/_chunk/button.jsx.map +1 -1
  29. package/dist/_chunk/calendar.js +27 -26
  30. package/dist/_chunk/calendar.js.map +1 -1
  31. package/dist/_chunk/calendar.jsx +27 -26
  32. package/dist/_chunk/calendar.jsx.map +1 -1
  33. package/dist/_chunk/checkbox.js +5 -4
  34. package/dist/_chunk/checkbox.js.map +1 -1
  35. package/dist/_chunk/checkbox.jsx +5 -4
  36. package/dist/_chunk/checkbox.jsx.map +1 -1
  37. package/dist/_chunk/color.js +302 -18
  38. package/dist/_chunk/color.js.map +1 -1
  39. package/dist/_chunk/color.jsx +302 -18
  40. package/dist/_chunk/color.jsx.map +1 -1
  41. package/dist/_chunk/combobox.js +638 -12
  42. package/dist/_chunk/combobox.js.map +1 -1
  43. package/dist/_chunk/combobox.jsx +638 -12
  44. package/dist/_chunk/combobox.jsx.map +1 -1
  45. package/dist/_chunk/constants.js +19 -0
  46. package/dist/_chunk/constants.js.map +1 -0
  47. package/dist/_chunk/constants.jsx +19 -0
  48. package/dist/_chunk/constants.jsx.map +1 -0
  49. package/dist/_chunk/createCollator.js +3 -171
  50. package/dist/_chunk/createCollator.js.map +1 -1
  51. package/dist/_chunk/createCollator.jsx +3 -165
  52. package/dist/_chunk/createCollator.jsx.map +1 -1
  53. package/dist/_chunk/createField.js +2 -1
  54. package/dist/_chunk/createField.js.map +1 -1
  55. package/dist/_chunk/createField.jsx +2 -1
  56. package/dist/_chunk/createField.jsx.map +1 -1
  57. package/dist/_chunk/createFocus.js +12 -8
  58. package/dist/_chunk/createFocus.js.map +1 -1
  59. package/dist/_chunk/createFocus.jsx +12 -8
  60. package/dist/_chunk/createFocus.jsx.map +1 -1
  61. package/dist/_chunk/createFocusWithin.js +12 -13
  62. package/dist/_chunk/createFocusWithin.js.map +1 -1
  63. package/dist/_chunk/createFocusWithin.jsx +12 -13
  64. package/dist/_chunk/createFocusWithin.jsx.map +1 -1
  65. package/dist/_chunk/createFocusable.js +3 -3
  66. package/dist/_chunk/createFocusable.js.map +1 -1
  67. package/dist/_chunk/createFocusable.jsx +3 -3
  68. package/dist/_chunk/createFocusable.jsx.map +1 -1
  69. package/dist/_chunk/{form.js → createFormReset.js} +1 -1
  70. package/dist/_chunk/createFormReset.js.map +1 -0
  71. package/dist/_chunk/{form.jsx → createFormReset.jsx} +1 -1
  72. package/dist/_chunk/createFormReset.jsx.map +1 -0
  73. package/dist/_chunk/createHover.js +2 -1
  74. package/dist/_chunk/createHover.js.map +1 -1
  75. package/dist/_chunk/createHover.jsx +2 -1
  76. package/dist/_chunk/createHover.jsx.map +1 -1
  77. package/dist/_chunk/createInteractionModality.js +2 -3
  78. package/dist/_chunk/createInteractionModality.js.map +1 -1
  79. package/dist/_chunk/createInteractionModality.jsx +2 -3
  80. package/dist/_chunk/createInteractionModality.jsx.map +1 -1
  81. package/dist/_chunk/createLabel.js +2 -1
  82. package/dist/_chunk/createLabel.js.map +1 -1
  83. package/dist/_chunk/createLabel.jsx +2 -1
  84. package/dist/_chunk/createLabel.jsx.map +1 -1
  85. package/dist/_chunk/createLabels.js +3 -2
  86. package/dist/_chunk/createLabels.js.map +1 -1
  87. package/dist/_chunk/createLabels.jsx +3 -2
  88. package/dist/_chunk/createLabels.jsx.map +1 -1
  89. package/dist/_chunk/createLandmark.js +1 -1
  90. package/dist/_chunk/createLandmark.jsx +1 -1
  91. package/dist/_chunk/createProgressBar.js +2 -1
  92. package/dist/_chunk/createProgressBar.js.map +1 -1
  93. package/dist/_chunk/createProgressBar.jsx +2 -1
  94. package/dist/_chunk/createProgressBar.jsx.map +1 -1
  95. package/dist/_chunk/createSelectableItem.js +7 -3
  96. package/dist/_chunk/createSelectableItem.js.map +1 -1
  97. package/dist/_chunk/createSelectableItem.jsx +7 -3
  98. package/dist/_chunk/createSelectableItem.jsx.map +1 -1
  99. package/dist/_chunk/createStringFormatter.js +61 -0
  100. package/dist/_chunk/createStringFormatter.js.map +1 -0
  101. package/dist/_chunk/createStringFormatter.jsx +61 -0
  102. package/dist/_chunk/createStringFormatter.jsx.map +1 -0
  103. package/dist/_chunk/createToggle.js +5 -4
  104. package/dist/_chunk/createToggle.js.map +1 -1
  105. package/dist/_chunk/createToggle.jsx +5 -4
  106. package/dist/_chunk/createToggle.jsx.map +1 -1
  107. package/dist/_chunk/datepicker.js +1413 -1100
  108. package/dist/_chunk/datepicker.js.map +1 -1
  109. package/dist/_chunk/datepicker.jsx +1413 -1100
  110. package/dist/_chunk/datepicker.jsx.map +1 -1
  111. package/dist/_chunk/disclosure.js +2 -2
  112. package/dist/_chunk/disclosure.js.map +1 -1
  113. package/dist/_chunk/disclosure.jsx +2 -2
  114. package/dist/_chunk/disclosure.jsx.map +1 -1
  115. package/dist/_chunk/dnd.js +1586 -495
  116. package/dist/_chunk/dnd.js.map +1 -1
  117. package/dist/_chunk/dnd.jsx +1586 -495
  118. package/dist/_chunk/dnd.jsx.map +1 -1
  119. package/dist/_chunk/env.js +1 -19
  120. package/dist/_chunk/env.js.map +1 -1
  121. package/dist/_chunk/env.jsx +1 -19
  122. package/dist/_chunk/env.jsx.map +1 -1
  123. package/dist/_chunk/focus.js +1 -1
  124. package/dist/_chunk/focus.js.map +1 -1
  125. package/dist/_chunk/focus.jsx +1 -1
  126. package/dist/_chunk/focus.jsx.map +1 -1
  127. package/dist/_chunk/focus2.js +54 -318
  128. package/dist/_chunk/focus2.js.map +1 -1
  129. package/dist/_chunk/focus2.jsx +53 -292
  130. package/dist/_chunk/focus2.jsx.map +1 -1
  131. package/dist/_chunk/grid.js +1 -1
  132. package/dist/_chunk/grid.jsx +1 -1
  133. package/dist/_chunk/gridlist.js +14 -9
  134. package/dist/_chunk/gridlist.js.map +1 -1
  135. package/dist/_chunk/gridlist.jsx +14 -9
  136. package/dist/_chunk/gridlist.jsx.map +1 -1
  137. package/dist/_chunk/i18n.js +3 -58
  138. package/dist/_chunk/i18n.js.map +1 -1
  139. package/dist/_chunk/i18n.jsx +3 -58
  140. package/dist/_chunk/i18n.jsx.map +1 -1
  141. package/dist/_chunk/interactions.js +99 -9
  142. package/dist/_chunk/interactions.js.map +1 -1
  143. package/dist/_chunk/interactions.jsx +97 -9
  144. package/dist/_chunk/interactions.jsx.map +1 -1
  145. package/dist/_chunk/link.js +2 -1
  146. package/dist/_chunk/link.js.map +1 -1
  147. package/dist/_chunk/link.jsx +2 -1
  148. package/dist/_chunk/link.jsx.map +1 -1
  149. package/dist/_chunk/listbox.js +42 -10
  150. package/dist/_chunk/listbox.js.map +1 -1
  151. package/dist/_chunk/listbox.jsx +42 -10
  152. package/dist/_chunk/listbox.jsx.map +1 -1
  153. package/dist/_chunk/locale.js +173 -0
  154. package/dist/_chunk/locale.js.map +1 -0
  155. package/dist/_chunk/locale.jsx +167 -0
  156. package/dist/_chunk/locale.jsx.map +1 -0
  157. package/dist/_chunk/menu.js +5 -4
  158. package/dist/_chunk/menu.js.map +1 -1
  159. package/dist/_chunk/menu.jsx +5 -4
  160. package/dist/_chunk/menu.jsx.map +1 -1
  161. package/dist/_chunk/numberfield.js +3 -2
  162. package/dist/_chunk/numberfield.js.map +1 -1
  163. package/dist/_chunk/numberfield.jsx +3 -2
  164. package/dist/_chunk/numberfield.jsx.map +1 -1
  165. package/dist/_chunk/overlays.js +1 -1
  166. package/dist/_chunk/overlays.jsx +1 -1
  167. package/dist/_chunk/popover.js +3 -3
  168. package/dist/_chunk/popover.js.map +1 -1
  169. package/dist/_chunk/popover.jsx +3 -3
  170. package/dist/_chunk/popover.jsx.map +1 -1
  171. package/dist/_chunk/radio.js +7 -6
  172. package/dist/_chunk/radio.js.map +1 -1
  173. package/dist/_chunk/radio.jsx +7 -6
  174. package/dist/_chunk/radio.jsx.map +1 -1
  175. package/dist/_chunk/reactivity.js +21 -0
  176. package/dist/_chunk/reactivity.js.map +1 -0
  177. package/dist/_chunk/reactivity.jsx +21 -0
  178. package/dist/_chunk/reactivity.jsx.map +1 -0
  179. package/dist/_chunk/searchfield.js +2 -1
  180. package/dist/_chunk/searchfield.js.map +1 -1
  181. package/dist/_chunk/searchfield.jsx +2 -1
  182. package/dist/_chunk/searchfield.jsx.map +1 -1
  183. package/dist/_chunk/select.js +8 -5
  184. package/dist/_chunk/select.js.map +1 -1
  185. package/dist/_chunk/select.jsx +8 -5
  186. package/dist/_chunk/select.jsx.map +1 -1
  187. package/dist/_chunk/selection.js +8 -21
  188. package/dist/_chunk/selection.js.map +1 -1
  189. package/dist/_chunk/selection.jsx +8 -21
  190. package/dist/_chunk/selection.jsx.map +1 -1
  191. package/dist/_chunk/separator.js +1 -1
  192. package/dist/_chunk/separator.jsx +1 -1
  193. package/dist/_chunk/slider.js +5 -4
  194. package/dist/_chunk/slider.js.map +1 -1
  195. package/dist/_chunk/slider.jsx +5 -4
  196. package/dist/_chunk/slider.jsx.map +1 -1
  197. package/dist/_chunk/spinbutton.js +153 -0
  198. package/dist/_chunk/spinbutton.js.map +1 -0
  199. package/dist/_chunk/spinbutton.jsx +153 -0
  200. package/dist/_chunk/spinbutton.jsx.map +1 -0
  201. package/dist/_chunk/table.js +45 -8
  202. package/dist/_chunk/table.js.map +1 -1
  203. package/dist/_chunk/table.jsx +45 -8
  204. package/dist/_chunk/table.jsx.map +1 -1
  205. package/dist/_chunk/tabs.js +11 -8
  206. package/dist/_chunk/tabs.js.map +1 -1
  207. package/dist/_chunk/tabs.jsx +11 -8
  208. package/dist/_chunk/tabs.jsx.map +1 -1
  209. package/dist/_chunk/tag.js +54 -18
  210. package/dist/_chunk/tag.js.map +1 -1
  211. package/dist/_chunk/tag.jsx +54 -18
  212. package/dist/_chunk/tag.jsx.map +1 -1
  213. package/dist/_chunk/textfield.js +2 -1
  214. package/dist/_chunk/textfield.js.map +1 -1
  215. package/dist/_chunk/textfield.jsx +2 -1
  216. package/dist/_chunk/textfield.jsx.map +1 -1
  217. package/dist/_chunk/toolbar.js +4 -36
  218. package/dist/_chunk/toolbar.js.map +1 -1
  219. package/dist/_chunk/toolbar.jsx +4 -36
  220. package/dist/_chunk/toolbar.jsx.map +1 -1
  221. package/dist/_chunk/tooltip.js +2 -2
  222. package/dist/_chunk/tooltip.js.map +1 -1
  223. package/dist/_chunk/tooltip.jsx +2 -2
  224. package/dist/_chunk/tooltip.jsx.map +1 -1
  225. package/dist/_chunk/tree.js +42 -14
  226. package/dist/_chunk/tree.js.map +1 -1
  227. package/dist/_chunk/tree.jsx +42 -14
  228. package/dist/_chunk/tree.jsx.map +1 -1
  229. package/dist/_chunk/utils.js +59 -19
  230. package/dist/_chunk/utils.js.map +1 -1
  231. package/dist/_chunk/utils.jsx +59 -19
  232. package/dist/_chunk/utils.jsx.map +1 -1
  233. package/dist/_chunk/visually-hidden.js +3 -2
  234. package/dist/_chunk/visually-hidden.js.map +1 -1
  235. package/dist/_chunk/visually-hidden.jsx +3 -2
  236. package/dist/_chunk/visually-hidden.jsx.map +1 -1
  237. package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
  238. package/dist/autocomplete/createAutocomplete.d.ts +10 -7
  239. package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
  240. package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
  241. package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
  242. package/dist/calendar/createCalendar.d.ts.map +1 -1
  243. package/dist/calendar/createCalendarCell.d.ts.map +1 -1
  244. package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
  245. package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
  246. package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
  247. package/dist/calendar/intl/index.d.ts +1 -1
  248. package/dist/calendar/intl/index.d.ts.map +1 -1
  249. package/dist/collections/index.js +1 -1
  250. package/dist/collections/index.jsx +1 -1
  251. package/dist/color/createColorArea.d.ts.map +1 -1
  252. package/dist/color/createColorField.d.ts.map +1 -1
  253. package/dist/color/createColorSlider.d.ts.map +1 -1
  254. package/dist/color/createColorSwatch.d.ts.map +1 -1
  255. package/dist/color/createColorWheel.d.ts.map +1 -1
  256. package/dist/color/intl/index.d.ts +30 -0
  257. package/dist/color/intl/index.d.ts.map +1 -0
  258. package/dist/combobox/createComboBox.d.ts.map +1 -1
  259. package/dist/combobox/intl/generated-locales.d.ts +16 -0
  260. package/dist/combobox/intl/generated-locales.d.ts.map +1 -0
  261. package/dist/combobox/intl/index.d.ts +2 -2
  262. package/dist/combobox/intl/index.d.ts.map +1 -1
  263. package/dist/datepicker/createDateField.d.ts +45 -23
  264. package/dist/datepicker/createDateField.d.ts.map +1 -1
  265. package/dist/datepicker/createDatePicker.d.ts +34 -6
  266. package/dist/datepicker/createDatePicker.d.ts.map +1 -1
  267. package/dist/datepicker/createDatePickerGroup.d.ts +13 -13
  268. package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
  269. package/dist/datepicker/createDateRangePicker.d.ts +55 -7
  270. package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
  271. package/dist/datepicker/createDateSegment.d.ts +6 -15
  272. package/dist/datepicker/createDateSegment.d.ts.map +1 -1
  273. package/dist/datepicker/createDisplayNames.d.ts +17 -0
  274. package/dist/datepicker/createDisplayNames.d.ts.map +1 -0
  275. package/dist/datepicker/createTimeField.d.ts +12 -49
  276. package/dist/datepicker/createTimeField.d.ts.map +1 -1
  277. package/dist/datepicker/index.d.ts +3 -3
  278. package/dist/datepicker/index.d.ts.map +1 -1
  279. package/dist/datepicker/index.js +2 -2
  280. package/dist/datepicker/index.jsx +2 -2
  281. package/dist/datepicker/intl.d.ts +12 -0
  282. package/dist/datepicker/intl.d.ts.map +1 -0
  283. package/dist/dnd/DragManager.d.ts +86 -0
  284. package/dist/dnd/DragManager.d.ts.map +1 -0
  285. package/dist/dnd/DropTargetKeyboardNavigation.d.ts +42 -0
  286. package/dist/dnd/DropTargetKeyboardNavigation.d.ts.map +1 -0
  287. package/dist/dnd/createDrag.d.ts.map +1 -1
  288. package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
  289. package/dist/dnd/createDraggableItem.d.ts +12 -7
  290. package/dist/dnd/createDraggableItem.d.ts.map +1 -1
  291. package/dist/dnd/createDroppableCollection.d.ts +7 -15
  292. package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
  293. package/dist/dnd/index.d.ts +5 -1
  294. package/dist/dnd/index.d.ts.map +1 -1
  295. package/dist/dnd/index.js +3 -2
  296. package/dist/dnd/index.jsx +3 -2
  297. package/dist/dnd/intl/index.d.ts +39 -0
  298. package/dist/dnd/intl/index.d.ts.map +1 -0
  299. package/dist/dnd/utils.d.ts +5 -0
  300. package/dist/dnd/utils.d.ts.map +1 -1
  301. package/dist/focus/FocusScope.d.ts +7 -0
  302. package/dist/focus/FocusScope.d.ts.map +1 -1
  303. package/dist/focus/index.d.ts +2 -1
  304. package/dist/focus/index.d.ts.map +1 -1
  305. package/dist/focus/index.js +3 -2
  306. package/dist/focus/index.jsx +3 -2
  307. package/dist/focus/virtualFocus.d.ts +26 -0
  308. package/dist/focus/virtualFocus.d.ts.map +1 -0
  309. package/dist/form/index.js +1 -1
  310. package/dist/form/index.jsx +1 -1
  311. package/dist/gridlist/createGridList.d.ts.map +1 -1
  312. package/dist/i18n/index.js +4 -2
  313. package/dist/i18n/index.jsx +4 -2
  314. package/dist/index.d.ts +3 -3
  315. package/dist/index.d.ts.map +1 -1
  316. package/dist/index.js +18 -12
  317. package/dist/index.jsx +18 -12
  318. package/dist/interactions/FocusableProvider.d.ts.map +1 -1
  319. package/dist/interactions/createFocus.d.ts.map +1 -1
  320. package/dist/interactions/createFocusWithin.d.ts.map +1 -1
  321. package/dist/interactions/createInteractionModality.d.ts.map +1 -1
  322. package/dist/interactions/index.js +1 -2
  323. package/dist/interactions/index.jsx +1 -2
  324. package/dist/label/createLabels.d.ts.map +1 -1
  325. package/dist/listbox/createListBox.d.ts.map +1 -1
  326. package/dist/listbox/createOption.d.ts +1 -1
  327. package/dist/listbox/createOption.d.ts.map +1 -1
  328. package/dist/live-announcer/index.js +1 -1
  329. package/dist/live-announcer/index.jsx +1 -1
  330. package/dist/select/createSelect.d.ts +2 -0
  331. package/dist/select/createSelect.d.ts.map +1 -1
  332. package/dist/selection/createSelectableItem.d.ts.map +1 -1
  333. package/dist/selection/index.js +2 -1
  334. package/dist/selection/index.jsx +2 -1
  335. package/dist/spinbutton/createSpinButton.d.ts +41 -0
  336. package/dist/spinbutton/createSpinButton.d.ts.map +1 -0
  337. package/dist/spinbutton/index.d.ts +3 -0
  338. package/dist/spinbutton/index.d.ts.map +1 -0
  339. package/dist/spinbutton/index.js +2 -0
  340. package/dist/spinbutton/index.jsx +2 -0
  341. package/dist/spinbutton/intl.d.ts +5 -0
  342. package/dist/spinbutton/intl.d.ts.map +1 -0
  343. package/dist/table/createTable.d.ts.map +1 -1
  344. package/dist/table/createTableColumnHeader.d.ts.map +1 -1
  345. package/dist/table/createTableRow.d.ts.map +1 -1
  346. package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
  347. package/dist/table/types.d.ts +8 -0
  348. package/dist/table/types.d.ts.map +1 -1
  349. package/dist/table/utils.d.ts +15 -0
  350. package/dist/table/utils.d.ts.map +1 -0
  351. package/dist/tabs/createTabs.d.ts +1 -0
  352. package/dist/tabs/createTabs.d.ts.map +1 -1
  353. package/dist/tag/createTag.d.ts.map +1 -1
  354. package/dist/tag/createTagGroup.d.ts +7 -0
  355. package/dist/tag/createTagGroup.d.ts.map +1 -1
  356. package/dist/toolbar/createToolbar.d.ts.map +1 -1
  357. package/dist/tree/createTree.d.ts.map +1 -1
  358. package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
  359. package/dist/utils/animation.d.ts.map +1 -1
  360. package/dist/utils/dom.d.ts +1 -0
  361. package/dist/utils/dom.d.ts.map +1 -1
  362. package/dist/utils/index.d.ts +1 -1
  363. package/dist/utils/index.d.ts.map +1 -1
  364. package/dist/utils/index.js +4 -3
  365. package/dist/utils/index.jsx +4 -3
  366. package/package.json +2 -2
  367. package/src/actiongroup/createActionGroup.ts +26 -109
  368. package/src/autocomplete/createAutocomplete.ts +136 -15
  369. package/src/breadcrumbs/createBreadcrumbs.ts +12 -4
  370. package/src/button/createToggleButtonGroup.ts +19 -14
  371. package/src/calendar/createCalendar.ts +3 -4
  372. package/src/calendar/createCalendarCell.ts +17 -3
  373. package/src/calendar/createCalendarGrid.ts +5 -4
  374. package/src/calendar/createRangeCalendar.ts +27 -17
  375. package/src/calendar/createRangeCalendarCell.ts +17 -3
  376. package/src/calendar/intl/index.ts +8 -0
  377. package/src/color/createColorArea.ts +17 -10
  378. package/src/color/createColorField.ts +8 -1
  379. package/src/color/createColorSlider.ts +1 -2
  380. package/src/color/createColorSwatch.ts +4 -2
  381. package/src/color/createColorWheel.ts +0 -6
  382. package/src/color/intl/index.ts +316 -0
  383. package/src/combobox/createComboBox.ts +35 -4
  384. package/src/combobox/intl/generated-locales.ts +635 -0
  385. package/src/combobox/intl/index.ts +8 -2
  386. package/src/datepicker/createDateField.ts +228 -213
  387. package/src/datepicker/createDatePicker.ts +157 -146
  388. package/src/datepicker/createDatePickerGroup.ts +88 -82
  389. package/src/datepicker/createDateRangePicker.ts +230 -179
  390. package/src/datepicker/createDateSegment.ts +386 -389
  391. package/src/datepicker/createDisplayNames.ts +45 -0
  392. package/src/datepicker/createTimeField.ts +36 -129
  393. package/src/datepicker/index.ts +13 -14
  394. package/src/datepicker/intl.ts +633 -0
  395. package/src/dnd/DragManager.ts +693 -0
  396. package/src/dnd/DropTargetKeyboardNavigation.ts +337 -0
  397. package/src/dnd/createDrag.ts +31 -5
  398. package/src/dnd/createDraggableCollection.ts +33 -15
  399. package/src/dnd/createDraggableItem.ts +92 -5
  400. package/src/dnd/createDroppableCollection.ts +487 -373
  401. package/src/dnd/index.ts +11 -0
  402. package/src/dnd/intl/ar-AE.json +29 -0
  403. package/src/dnd/intl/bg-BG.json +29 -0
  404. package/src/dnd/intl/cs-CZ.json +29 -0
  405. package/src/dnd/intl/da-DK.json +29 -0
  406. package/src/dnd/intl/de-DE.json +29 -0
  407. package/src/dnd/intl/el-GR.json +29 -0
  408. package/src/dnd/intl/en-US.json +29 -0
  409. package/src/dnd/intl/es-ES.json +29 -0
  410. package/src/dnd/intl/et-EE.json +29 -0
  411. package/src/dnd/intl/fi-FI.json +29 -0
  412. package/src/dnd/intl/fr-FR.json +29 -0
  413. package/src/dnd/intl/he-IL.json +29 -0
  414. package/src/dnd/intl/hr-HR.json +29 -0
  415. package/src/dnd/intl/hu-HU.json +29 -0
  416. package/src/dnd/intl/index.ts +139 -0
  417. package/src/dnd/intl/it-IT.json +29 -0
  418. package/src/dnd/intl/ja-JP.json +29 -0
  419. package/src/dnd/intl/ko-KR.json +29 -0
  420. package/src/dnd/intl/lt-LT.json +29 -0
  421. package/src/dnd/intl/lv-LV.json +29 -0
  422. package/src/dnd/intl/nb-NO.json +29 -0
  423. package/src/dnd/intl/nl-NL.json +29 -0
  424. package/src/dnd/intl/pl-PL.json +29 -0
  425. package/src/dnd/intl/pt-BR.json +29 -0
  426. package/src/dnd/intl/pt-PT.json +29 -0
  427. package/src/dnd/intl/ro-RO.json +29 -0
  428. package/src/dnd/intl/ru-RU.json +29 -0
  429. package/src/dnd/intl/sk-SK.json +29 -0
  430. package/src/dnd/intl/sl-SI.json +29 -0
  431. package/src/dnd/intl/sr-SP.json +29 -0
  432. package/src/dnd/intl/sv-SE.json +29 -0
  433. package/src/dnd/intl/tr-TR.json +29 -0
  434. package/src/dnd/intl/uk-UA.json +29 -0
  435. package/src/dnd/intl/zh-CN.json +29 -0
  436. package/src/dnd/intl/zh-TW.json +29 -0
  437. package/src/dnd/utils.ts +36 -0
  438. package/src/focus/FocusScope.tsx +120 -12
  439. package/src/focus/index.ts +8 -0
  440. package/src/focus/virtualFocus.ts +55 -0
  441. package/src/gridlist/createGridList.ts +52 -16
  442. package/src/index.ts +11 -3
  443. package/src/interactions/FocusableProvider.tsx +11 -6
  444. package/src/interactions/createFocus.ts +26 -21
  445. package/src/interactions/createFocusWithin.ts +23 -24
  446. package/src/interactions/createInteractionModality.ts +5 -3
  447. package/src/label/createLabels.ts +7 -4
  448. package/src/listbox/createListBox.ts +74 -2
  449. package/src/listbox/createOption.ts +16 -1
  450. package/src/select/createSelect.ts +23 -2
  451. package/src/selection/createSelectableItem.ts +14 -0
  452. package/src/spinbutton/createSpinButton.ts +163 -0
  453. package/src/spinbutton/index.ts +10 -0
  454. package/src/spinbutton/intl.ts +115 -0
  455. package/src/table/createTable.ts +26 -1
  456. package/src/table/createTableColumnHeader.ts +10 -0
  457. package/src/table/createTableRow.ts +10 -0
  458. package/src/table/createTableSelectionCheckbox.ts +24 -1
  459. package/src/table/types.ts +8 -0
  460. package/src/table/utils.ts +41 -0
  461. package/src/tabs/createTabs.ts +53 -12
  462. package/src/tag/createTag.ts +21 -32
  463. package/src/tag/createTagGroup.ts +92 -0
  464. package/src/toolbar/createToolbar.ts +6 -58
  465. package/src/tree/createTree.ts +69 -14
  466. package/src/tree/createTreeSelectionCheckbox.ts +14 -1
  467. package/src/utils/animation.ts +119 -27
  468. package/src/utils/dom.ts +3 -2
  469. package/src/utils/index.ts +2 -0
  470. package/dist/_chunk/createLongPress.js +0 -91
  471. package/dist/_chunk/createLongPress.js.map +0 -1
  472. package/dist/_chunk/createLongPress.jsx +0 -91
  473. package/dist/_chunk/createLongPress.jsx.map +0 -1
  474. package/dist/_chunk/form.js.map +0 -1
  475. package/dist/_chunk/form.jsx.map +0 -1
  476. package/dist/_chunk/live-announcer.js.map +0 -1
  477. package/dist/_chunk/live-announcer.jsx.map +0 -1
  478. package/dist/datepicker/createTimeSegment.d.ts +0 -29
  479. package/dist/datepicker/createTimeSegment.d.ts.map +0 -1
  480. package/src/datepicker/createTimeSegment.ts +0 -352
@@ -5,9 +5,10 @@
5
5
  * component like ListBox, GridList, or Table.
6
6
  */
7
7
 
8
- import { createMemo, onCleanup, type Accessor } from "solid-js";
8
+ import { createEffect, createMemo, onCleanup, type Accessor } from "solid-js";
9
9
  import type { JSX } from "solid-js";
10
10
  import type {
11
+ Collection,
11
12
  DroppableCollectionState,
12
13
  DropTarget,
13
14
  DropOperation,
@@ -18,12 +19,11 @@ import type {
18
19
  } from "@proyecto-viviana/solid-stately";
19
20
  import { DIRECTORY_DRAG_TYPE } from "@proyecto-viviana/solid-stately";
20
21
  import { createDrop } from "./createDrop";
21
- import {
22
- getGlobalDraggingCollectionRef,
23
- getGlobalDraggingKeys,
24
- getGlobalDraggingTypes,
25
- } from "./createDraggableCollection";
26
- import { getGlobalAllowedDropOperations, DROP_OPERATION } from "./utils";
22
+ import { getGlobalDraggingCollectionRef, getGlobalDraggingKeys } from "./createDraggableCollection";
23
+ import { getTypes } from "./utils";
24
+ import { registerDropTarget } from "./DragManager";
25
+ import { navigate, type DropNavigationKeyboardDelegate } from "./DropTargetKeyboardNavigation";
26
+ import { useLocale } from "../i18n/locale";
27
27
 
28
28
  // Global state for tracking the drop collection
29
29
  let globalDropCollectionRef: HTMLElement | null = null;
@@ -129,8 +129,12 @@ export interface DroppableCollectionOptions {
129
129
  keyboardDelegate?: KeyboardDelegateLike;
130
130
  /** Optional keyboard handler composed with internal drop target navigation keys. */
131
131
  onKeyDown?: (e: KeyboardEvent) => void;
132
- /** Collection snapshot used to restore focus and selection after a drop mutates items. */
133
- collection?: CollectionLike;
132
+ /**
133
+ * The collection backing the droppable. Used both to restore focus/selection
134
+ * after a drop mutates items and to drive keyboard drop-target navigation
135
+ * (`navigate()` walks `getKeyAfter`/`getKeyBefore`).
136
+ */
137
+ collection?: Collection;
134
138
  /** Current collection selection used to avoid replacing user-updated selection after a drop. */
135
139
  selectedKeys?: "all" | Iterable<Key>;
136
140
  /** Sets collection selection after a drop when new rows were inserted and selection was unchanged. */
@@ -171,6 +175,10 @@ export function createDroppableCollection(
171
175
  ): DroppableCollectionAria {
172
176
  const getOptions = createMemo(() => options());
173
177
 
178
+ // Layout direction drives keyboard drop-target navigation (Left/Right flip in
179
+ // RTL). Read at the reactive owner so the registration effect re-runs on change.
180
+ const locale = useLocale();
181
+
174
182
  // Track the next target during drag operations
175
183
  let nextTarget: DropTarget | null = null;
176
184
  let currentDropOperation: DropOperation | null = null;
@@ -186,7 +194,13 @@ export function createDroppableCollection(
186
194
  types: DragTypes,
187
195
  allowedOperations: DropOperation[],
188
196
  ): DropOperation => {
189
- return state.getDropOperation(target, types, allowedOperations);
197
+ return state.getDropOperation(
198
+ target,
199
+ types,
200
+ allowedOperations,
201
+ isInternalDropOperation(),
202
+ getGlobalDraggingKeys(),
203
+ );
190
204
  };
191
205
 
192
206
  // Create base drop behavior
@@ -256,29 +270,37 @@ export function createDroppableCollection(
256
270
  }
257
271
  },
258
272
  onDrop: (e) => {
259
- const opts = getOptions();
260
- setGlobalDropCollectionRef(opts.ref());
261
-
273
+ setGlobalDropCollectionRef(getOptions().ref());
262
274
  if (state.target) {
263
- const target = state.target;
264
- const previousCollection = opts.collection;
265
- const previousSelectedKeys = normalizeSelection(opts.selectedKeys);
266
- opts.onDrop?.({
267
- items: e.items,
268
- target,
269
- dropOperation: e.dropOperation,
270
- x: e.x,
271
- y: e.y,
272
- });
273
- void Promise.resolve(handleDrop(e.items, target, e.dropOperation)).then(() => {
274
- queueMicrotask(() => {
275
- updateFocusAfterDrop(getOptions(), previousCollection, previousSelectedKeys, target);
276
- });
277
- });
275
+ runDrop(e, state.target);
278
276
  }
279
277
  },
280
278
  }));
281
279
 
280
+ // Shared drop handler for both the native-pointer path (createDrop, above) and
281
+ // the keyboard path (the DragManager-registered drop target, below). Mirrors
282
+ // upstream's `defaultOnDrop`, which `useDrop` and `DragManager` both invoke.
283
+ const runDrop = (
284
+ e: { items: DropItem[]; dropOperation: DropOperation; x: number; y: number },
285
+ target: DropTarget,
286
+ ) => {
287
+ const opts = getOptions();
288
+ const previousCollection = opts.collection;
289
+ const previousSelectedKeys = normalizeSelection(opts.selectedKeys);
290
+ opts.onDrop?.({
291
+ items: e.items,
292
+ target,
293
+ dropOperation: e.dropOperation,
294
+ x: e.x,
295
+ y: e.y,
296
+ });
297
+ void Promise.resolve(handleDrop(e.items, target, e.dropOperation)).then(() => {
298
+ queueMicrotask(() => {
299
+ updateFocusAfterDrop(getOptions(), previousCollection, previousSelectedKeys, target);
300
+ });
301
+ });
302
+ };
303
+
282
304
  const handleDrop = async (
283
305
  items: DropItem[],
284
306
  target: DropTarget,
@@ -286,6 +308,13 @@ export function createDroppableCollection(
286
308
  ) => {
287
309
  const opts = getOptions();
288
310
  const isInternal = isInternalDropOperation();
311
+ // Capture the dragging keys ONCE up front, mirroring upstream's
312
+ // `let {draggingKeys} = globalDndState` at the top of `defaultOnDrop`. In
313
+ // Solid the global keys live in a signal whose drag-teardown effect flushes
314
+ // synchronously during this same drop flow (React batches, so upstream never
315
+ // observes the clear mid-handler). Re-reading the global in the onMove/onReorder
316
+ // branches would therefore see an already-emptied set; the snapshot preserves it.
317
+ const draggingKeys = getGlobalDraggingKeys();
289
318
 
290
319
  // Filter items by accepted types
291
320
  let filteredItems = items;
@@ -316,7 +345,6 @@ export function createDroppableCollection(
316
345
 
317
346
  // Handle move for internal operations
318
347
  if (opts.onMove && isInternal) {
319
- const draggingKeys = getGlobalDraggingKeys();
320
348
  await opts.onMove({
321
349
  keys: draggingKeys,
322
350
  target,
@@ -334,7 +362,6 @@ export function createDroppableCollection(
334
362
  }
335
363
 
336
364
  if (isInternal && opts.onReorder) {
337
- const draggingKeys = getGlobalDraggingKeys();
338
365
  await opts.onReorder({
339
366
  keys: draggingKeys,
340
367
  target,
@@ -353,369 +380,418 @@ export function createDroppableCollection(
353
380
  }
354
381
  });
355
382
 
356
- const collectionProps = createMemo(() => {
357
- const baseDropProps = drop.dropProps;
358
- const onKeyDownBase = baseDropProps.onKeyDown as ((e: KeyboardEvent) => void) | undefined;
359
- const onKeyDown = (e: KeyboardEvent): void => {
360
- onKeyDownBase?.(e);
383
+ // Wrap the raw `Set<string>` the DragManager hands keyboard drop targets into
384
+ // the `DragTypes` delegate the port state expects. Mirrors upstream, which
385
+ // passes the raw Set to `state.getDropOperation` (no wildcard expansion — that
386
+ // lives in the DataTransfer-backed DragTypes used by the native-pointer path).
387
+ const wrapTypes = (types: Set<string>): DragTypes => ({
388
+ has: (type: DragType | DragType[]) => {
389
+ if (typeof type === "string") return types.has(type);
390
+ if (Array.isArray(type)) return type.some((t) => typeof t === "string" && types.has(t));
391
+ return false;
392
+ },
393
+ });
394
+
395
+ const targetsEqual = (
396
+ a: DropTarget | null | undefined,
397
+ b: DropTarget | null | undefined,
398
+ ): boolean => {
399
+ if (!a || !b) return false;
400
+ if (a.type !== b.type) return false;
401
+ if (a.type === "root") return true;
402
+ if (a.type !== "item" || b.type !== "item") return false;
403
+ return a.key === b.key && a.dropPosition === b.dropPosition;
404
+ };
405
+
406
+ // Port substitute for upstream's `state.isDropTarget(target)` (the port state
407
+ // exposes `isDropTarget` only as a "drag is over this collection" boolean, not
408
+ // a per-target predicate): whether `target` equals the current drop target.
409
+ const isCurrentTarget = (target: DropTarget | null | undefined): boolean =>
410
+ targetsEqual(state.target, target);
411
+
412
+ // Register the collection element as a keyboard/virtual drop target on the
413
+ // DragManager singleton. This is the faithful port of upstream
414
+ // `useDroppableCollection`'s `useEffect` (react-aria 3.50) that installs the
415
+ // DragManager DropTarget — replacing the port's former self-contained
416
+ // `collectionProps.onKeyDown` engine. Re-runs when the element or locale
417
+ // direction changes (upstream keys the effect on `[localState, ref, onDrop, direction]`).
418
+ createEffect(() => {
419
+ const refEl = getOptions().ref();
420
+ if (!refEl) return;
421
+ const rtl = locale().direction === "rtl";
422
+
423
+ const getNextTarget = (
424
+ target: DropTarget | null | undefined,
425
+ wrap = true,
426
+ key: "left" | "right" | "up" | "down" = "down",
427
+ ): DropTarget | null => {
361
428
  const opts = getOptions();
362
- if (opts.isDisabled) return;
363
- const resolveDirection = (): "ltr" | "rtl" => {
364
- const refEl = opts.ref();
365
- if (
366
- refEl &&
367
- typeof window !== "undefined" &&
368
- typeof window.getComputedStyle === "function"
369
- ) {
370
- const computedDir = window.getComputedStyle(refEl).direction;
371
- if (computedDir === "rtl") return "rtl";
372
- }
373
- return typeof document !== "undefined" && document.dir === "rtl" ? "rtl" : "ltr";
374
- };
375
- const isRtl = resolveDirection() === "rtl";
376
- const forwardHorizontalKey = isRtl ? "ArrowLeft" : "ArrowRight";
377
- const backwardHorizontalKey = isRtl ? "ArrowRight" : "ArrowLeft";
378
- const callUserOnKeyDown = () => opts.onKeyDown?.(e);
379
- const getKeyboardAllowedOperations = (): DropOperation[] => {
380
- const allowedBits = getGlobalAllowedDropOperations();
381
- if (!allowedBits) return ["copy", "move", "link"];
382
- const allowed: DropOperation[] = [];
383
- if (allowedBits & DROP_OPERATION.copy) allowed.push("copy");
384
- if (allowedBits & DROP_OPERATION.move) allowed.push("move");
385
- if (allowedBits & DROP_OPERATION.link) allowed.push("link");
386
- return allowed.length > 0 ? allowed : ["copy", "move", "link"];
387
- };
388
- const getKeyboardDragTypes = (): DragTypes => {
389
- const draggingTypes = getGlobalDraggingTypes();
390
- if (draggingTypes.size === 0) {
391
- return { has: () => true };
392
- }
393
- return {
394
- // Keyboard drag mirrors upstream's raw Set<string> delegate: no
395
- // wildcard expansion (that lives in the DataTransfer-backed DragTypes).
396
- has: (type: DragType | DragType[]) => typeof type === "string" && draggingTypes.has(type),
397
- };
398
- };
399
- const isValidDropTarget = (target: DropTarget) =>
400
- state.getDropOperation(target, getKeyboardDragTypes(), getKeyboardAllowedOperations()) !==
401
- "cancel";
402
- const targetsEqual = (a: DropTarget, b: DropTarget): boolean => {
403
- if (a.type !== b.type) return false;
404
- if (a.type === "root" && b.type === "root") return true;
405
- if (a.type !== "item" || b.type !== "item") return false;
406
- return a.key === b.key && a.dropPosition === b.dropPosition;
407
- };
408
- const findNextValidTarget = (
409
- start: DropTarget | null,
410
- getNext: (target: DropTarget | null) => DropTarget | null,
411
- ): DropTarget | null => {
412
- let current = start;
413
- let seenRoot = 0;
414
- let safety = 0;
415
- while (safety < 256) {
416
- safety += 1;
417
- const next = getNext(current);
418
- if (!next) return null;
419
- if (current && targetsEqual(current, next)) {
420
- return isValidDropTarget(next) ? next : null;
421
- }
422
- current = next;
423
- if (next.type === "root") {
424
- seenRoot += 1;
425
- if (seenRoot >= 2) {
426
- return isValidDropTarget(next) ? next : null;
427
- }
428
- }
429
- if (isValidDropTarget(next)) return next;
430
- }
431
- return null;
432
- };
433
- const resolveTargetForKey = (
434
- key: string | number | null,
435
- direction: "next" | "previous",
436
- ): DropTarget | null => {
437
- if (key == null) return null;
438
- const onTarget: DropTarget = { type: "item", key, dropPosition: "on" };
439
- if (isValidDropTarget(onTarget)) return onTarget;
440
- const insertionOrder: Array<"before" | "after"> =
441
- direction === "next" ? ["before", "after"] : ["after", "before"];
442
- for (const position of insertionOrder) {
443
- const insertionTarget: DropTarget = { type: "item", key, dropPosition: position };
444
- if (isValidDropTarget(insertionTarget)) return insertionTarget;
445
- }
446
- return null;
447
- };
448
- const resolveBoundaryTargetForDirection = (
449
- key: string | number | null,
450
- direction: "next" | "previous",
451
- ): DropTarget | null => {
452
- if (key == null) return null;
453
- const boundaryOrder: Array<"before" | "on" | "after"> =
454
- direction === "next" ? ["before", "on", "after"] : ["after", "on", "before"];
455
- for (const position of boundaryOrder) {
456
- const candidate: DropTarget = { type: "item", key, dropPosition: position };
457
- if (isValidDropTarget(candidate)) return candidate;
429
+ const collection = opts.collection;
430
+ const keyboardDelegate = opts.keyboardDelegate;
431
+ if (!collection || !keyboardDelegate) return null;
432
+ return navigate(
433
+ keyboardDelegate as DropNavigationKeyboardDelegate,
434
+ collection,
435
+ target,
436
+ key,
437
+ rtl,
438
+ wrap,
439
+ );
440
+ };
441
+
442
+ const getPreviousTarget = (target: DropTarget | null | undefined, wrap = true) =>
443
+ getNextTarget(target, wrap, "up");
444
+
445
+ const nextValidTarget = (
446
+ target: DropTarget | null | undefined,
447
+ types: Set<string>,
448
+ allowedDropOperations: DropOperation[],
449
+ getNext: (target: DropTarget | null | undefined, wrap: boolean) => DropTarget | null,
450
+ wrap = true,
451
+ ): DropTarget | null => {
452
+ let seenRoot = 0;
453
+ let operation: DropOperation;
454
+ do {
455
+ const next = getNext(target, wrap);
456
+ if (!next) return null;
457
+ target = next;
458
+ operation = getDropOperationForTarget(next, wrapTypes(types), allowedDropOperations);
459
+ if (target.type === "root") {
460
+ seenRoot++;
458
461
  }
462
+ } while (operation === "cancel" && !isCurrentTarget(target) && seenRoot < 2);
463
+
464
+ if (operation === "cancel") {
459
465
  return null;
460
- };
461
- const resolveFallbackKeyboardTarget = (
462
- keyName: string,
463
- currentTarget: DropTarget | null = state.target,
464
- ): DropTarget | null => {
465
- const keyboardDelegate = opts.keyboardDelegate;
466
- if (!keyboardDelegate) return null;
467
- const currentKey = currentTarget?.type === "item" ? currentTarget.key : null;
468
- const keyForDirection = (
469
- direction: "next" | "previous",
470
- getter: ((key: string | number) => string | number | null) | undefined,
471
- ): DropTarget | null => {
472
- if (currentKey == null) {
473
- const boundaryKey =
474
- direction === "next"
475
- ? keyboardDelegate.getFirstKey?.()
476
- : keyboardDelegate.getLastKey?.();
477
- return resolveBoundaryTargetForDirection(boundaryKey ?? null, direction);
478
- }
479
- if (!getter) return null;
480
- let nextKey = getter(currentKey);
481
- let safety = 0;
482
- while (nextKey != null && safety < 256) {
483
- const resolvedTarget = resolveTargetForKey(nextKey, direction);
484
- if (resolvedTarget) return resolvedTarget;
485
- const candidate = getter(nextKey);
486
- if (candidate === nextKey) break;
487
- nextKey = candidate;
488
- safety += 1;
489
- }
490
- return null;
491
- };
492
-
493
- if (keyName === "ArrowDown") return keyForDirection("next", keyboardDelegate.getKeyBelow);
494
- if (keyName === "ArrowUp") return keyForDirection("previous", keyboardDelegate.getKeyAbove);
495
- if (keyName === forwardHorizontalKey) {
496
- return keyForDirection(
497
- "next",
498
- isRtl ? keyboardDelegate.getKeyLeftOf : keyboardDelegate.getKeyRightOf,
499
- );
500
- }
501
- if (keyName === backwardHorizontalKey) {
502
- return keyForDirection(
503
- "previous",
504
- isRtl ? keyboardDelegate.getKeyRightOf : keyboardDelegate.getKeyLeftOf,
505
- );
506
- }
507
- if (keyName === "Home")
508
- return resolveBoundaryTargetForDirection(
509
- keyboardDelegate.getFirstKey?.() ?? null,
510
- "next",
511
- );
512
- if (keyName === "End")
513
- return resolveBoundaryTargetForDirection(
514
- keyboardDelegate.getLastKey?.() ?? null,
515
- "previous",
516
- );
517
- if (keyName === "PageDown") {
518
- if (currentKey != null && keyboardDelegate.getKeyPageBelow) {
519
- return resolveTargetForKey(keyboardDelegate.getKeyPageBelow(currentKey), "next");
520
- }
521
- return keyForDirection("next", keyboardDelegate.getKeyBelow);
466
+ }
467
+
468
+ return target;
469
+ };
470
+
471
+ const unregister = registerDropTarget({
472
+ element: refEl,
473
+ preventFocusOnDrop: true,
474
+ getDropOperation(types, allowedOperations) {
475
+ if (state.target) {
476
+ return getDropOperationForTarget(state.target, wrapTypes(types), allowedOperations);
522
477
  }
523
- if (keyName === "PageUp") {
524
- if (currentKey != null && keyboardDelegate.getKeyPageAbove) {
525
- return resolveTargetForKey(keyboardDelegate.getKeyPageAbove(currentKey), "previous");
478
+
479
+ // Check if any of the targets accept the drop.
480
+ const target = nextValidTarget(null, types, allowedOperations, (t, wrap) =>
481
+ getNextTarget(t, wrap),
482
+ );
483
+ return target ? "move" : "cancel";
484
+ },
485
+ onDropEnter(_e, drag) {
486
+ const types = getTypes(drag.items);
487
+ // Update the drop collection ref tracker for createDroppableItem's isInternal check.
488
+ setGlobalDropCollectionRef(getOptions().ref());
489
+
490
+ // When entering the droppable collection for the first time, upstream's
491
+ // default drop target is AFTER the focused key
492
+ // (useDroppableCollection.ts:505-559). The port's DroppableCollectionState
493
+ // carries no selectionManager, but at keyboard pickup the dragged item IS
494
+ // the collection's focused item, so we recover the focused key from the
495
+ // drag target element's `data-key` (createSelectableItem stamps it).
496
+ const opts = getOptions();
497
+ let key = keyFromDragElement(drag.element, opts.collection);
498
+ let dropPosition: "before" | "on" | "after" = "after";
499
+
500
+ // Mirror upstream's reorder heuristic: if the focused item is also
501
+ // selected, drop after the last selected item; but if it is the first of
502
+ // a multi-selection, drop before the first (select-down → move down,
503
+ // select-up → move up). Single-key keyboard drags never hit this branch.
504
+ const selected = normalizeSelection(opts.selectedKeys);
505
+ if (key != null && opts.collection && selectionHas(selected, key)) {
506
+ const ordered = orderedSelectedKeys(selected, opts.collection);
507
+ if (ordered.length > 1 && ordered[0] === key) {
508
+ dropPosition = "before";
509
+ } else if (ordered.length > 0) {
510
+ key = ordered[ordered.length - 1];
526
511
  }
527
- return keyForDirection("previous", keyboardDelegate.getKeyAbove);
528
512
  }
529
- return null;
530
- };
531
- const resolvePageTargetForState = (
532
- direction: "next" | "previous",
533
- currentTarget: DropTarget,
534
- ): DropTarget | null => {
535
- const keyboardDelegate = opts.keyboardDelegate;
536
- if (!keyboardDelegate) return null;
537
- if (direction === "next") {
538
- let targetKey = keyboardDelegate.getFirstKey?.() ?? null;
539
- let dropPosition: "before" | "on" | "after" = "after";
540
- if (currentTarget.type === "item") {
541
- targetKey = currentTarget.key;
542
- dropPosition = currentTarget.dropPosition;
543
- }
544
- let nextKey =
545
- targetKey != null ? (keyboardDelegate.getKeyPageBelow?.(targetKey) ?? null) : null;
513
+
514
+ let target: DropTarget | null = null;
515
+ if (key != null) {
516
+ target = { type: "item", key, dropPosition };
517
+ // If the default target is not valid, find the next one that is, then
518
+ // fall back to the previous. Mirrors useDroppableCollection.ts:538-551.
546
519
  if (
547
- nextKey == null ||
548
- (currentTarget.type === "item" && currentTarget.key === keyboardDelegate.getLastKey?.())
520
+ getDropOperationForTarget(target, wrapTypes(types), drag.allowedDropOperations) ===
521
+ "cancel"
549
522
  ) {
550
- nextKey = keyboardDelegate.getLastKey?.() ?? null;
551
- dropPosition = "after";
523
+ target =
524
+ nextValidTarget(
525
+ target,
526
+ types,
527
+ drag.allowedDropOperations,
528
+ (t, wrap) => getNextTarget(t, wrap),
529
+ false,
530
+ ) ??
531
+ nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
552
532
  }
553
- if (nextKey == null) return null;
554
- return {
555
- type: "item",
556
- key: nextKey,
557
- dropPosition,
558
- };
559
533
  }
560
534
 
561
- if (currentTarget.type === "item") {
562
- if (currentTarget.key === keyboardDelegate.getFirstKey?.()) {
563
- return { type: "root" };
564
- }
565
- let nextKey = keyboardDelegate.getKeyPageAbove?.(currentTarget.key) ?? null;
566
- let dropPosition: "before" | "on" | "after" = currentTarget.dropPosition;
567
- if (nextKey == null) {
568
- nextKey = keyboardDelegate.getFirstKey?.() ?? null;
569
- dropPosition = "before";
570
- }
571
- if (nextKey == null) return null;
572
- return {
573
- type: "item",
574
- key: nextKey,
575
- dropPosition,
576
- };
535
+ // If no focused key, start from the root (upstream's fallback).
536
+ if (!target) {
537
+ target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>
538
+ getNextTarget(t, wrap),
539
+ );
577
540
  }
578
541
 
579
- return currentTarget.type === "root" ? currentTarget : null;
580
- };
581
- if (e.key === "PageDown" || e.key === "PageUp") {
542
+ state.setTarget(target);
543
+ },
544
+ onDropExit() {
545
+ setGlobalDropCollectionRef(null);
546
+ state.setTarget(null);
547
+ },
548
+ onDropTargetEnter(target) {
549
+ state.setTarget(target);
550
+ },
551
+ onDropActivate(e, target) {
552
+ const opts = getOptions();
582
553
  if (
583
- (e.key === "PageDown" && !opts.keyboardDelegate?.getKeyPageBelow) ||
584
- (e.key === "PageUp" && !opts.keyboardDelegate?.getKeyPageAbove)
554
+ target?.type === "item" &&
555
+ target?.dropPosition === "on" &&
556
+ typeof opts.onDropActivate === "function"
585
557
  ) {
586
- callUserOnKeyDown();
587
- return;
558
+ opts.onDropActivate({ target, x: e.x, y: e.y });
588
559
  }
589
- const direction = e.key === "PageDown" ? "next" : "previous";
590
- const pageNavigation = opts.dropTargetDelegate.getKeyboardPageNavigationTarget;
591
- const stepNavigation = opts.dropTargetDelegate.getKeyboardNavigationTarget;
592
- const resolveStepTarget = (
593
- target: DropTarget | null,
594
- navDirection: "next" | "previous",
595
- ): DropTarget | null =>
596
- stepNavigation?.(target, navDirection, isValidDropTarget) ??
597
- resolveFallbackKeyboardTarget(
598
- navDirection === "next" ? "ArrowDown" : "ArrowUp",
599
- target,
600
- ) ??
601
- resolveFallbackKeyboardTarget(navDirection === "next" ? "Home" : "End", target) ??
602
- null;
603
- let nextTarget: DropTarget | null = null;
604
- if (!state.target) {
605
- nextTarget = findNextValidTarget(null, (target) => resolveStepTarget(target, direction));
606
- } else {
607
- const pageTarget =
608
- pageNavigation?.(state.target, direction, isValidDropTarget) ??
609
- resolvePageTargetForState(direction, state.target) ??
610
- null;
611
- if (pageTarget && isValidDropTarget(pageTarget)) {
612
- nextTarget = pageTarget;
613
- } else {
614
- const startTarget = pageTarget ?? state.target;
615
- nextTarget =
616
- findNextValidTarget(startTarget, (target) => resolveStepTarget(target, direction)) ??
617
- findNextValidTarget(startTarget, (target) =>
618
- resolveStepTarget(target, direction === "next" ? "previous" : "next"),
619
- );
620
- }
621
- }
622
- if (nextTarget) {
623
- e.preventDefault();
624
- state.setTarget(nextTarget);
625
- }
626
- callUserOnKeyDown();
627
- return;
628
- }
629
- if (
630
- (e.key === "ArrowDown" ||
631
- e.key === "ArrowUp" ||
632
- e.key === "ArrowRight" ||
633
- e.key === "ArrowLeft" ||
634
- e.key === "Home" ||
635
- e.key === "End") &&
636
- opts.dropTargetDelegate.getKeyboardNavigationTarget
637
- ) {
638
- if (
639
- (e.key === "ArrowDown" && !opts.keyboardDelegate?.getKeyBelow) ||
640
- (e.key === "ArrowUp" && !opts.keyboardDelegate?.getKeyAbove) ||
641
- (e.key === "ArrowLeft" && !opts.keyboardDelegate?.getKeyLeftOf) ||
642
- (e.key === "ArrowRight" && !opts.keyboardDelegate?.getKeyRightOf) ||
643
- (e.key === "Home" && !opts.keyboardDelegate?.getFirstKey) ||
644
- (e.key === "End" && !opts.keyboardDelegate?.getLastKey)
645
- ) {
646
- callUserOnKeyDown();
647
- return;
648
- }
649
- const isForwardKey =
650
- e.key === "ArrowDown" || e.key === forwardHorizontalKey || e.key === "Home";
651
- const direction = isForwardKey ? "next" : "previous";
652
- const navigationStart = e.key === "Home" || e.key === "End" ? null : state.target;
653
- const nextTarget = findNextValidTarget(
654
- navigationStart,
655
- (target) =>
656
- opts.dropTargetDelegate.getKeyboardNavigationTarget?.(
657
- target,
658
- direction,
659
- isValidDropTarget,
660
- ) ?? resolveFallbackKeyboardTarget(e.key, target),
661
- );
662
- if (nextTarget) {
663
- e.preventDefault();
664
- state.setTarget(nextTarget);
560
+ },
561
+ onDrop(e, target) {
562
+ setGlobalDropCollectionRef(getOptions().ref());
563
+ if (state.target) {
564
+ runDrop(e, target || state.target);
665
565
  }
666
- callUserOnKeyDown();
667
- return;
668
- }
669
- if (
670
- e.key === "ArrowDown" ||
671
- e.key === "ArrowUp" ||
672
- e.key === "ArrowRight" ||
673
- e.key === "ArrowLeft" ||
674
- e.key === "Home" ||
675
- e.key === "End"
676
- ) {
677
- if (
678
- (e.key === "ArrowDown" && !opts.keyboardDelegate?.getKeyBelow) ||
679
- (e.key === "ArrowUp" && !opts.keyboardDelegate?.getKeyAbove) ||
680
- (e.key === "ArrowLeft" && !opts.keyboardDelegate?.getKeyLeftOf) ||
681
- (e.key === "ArrowRight" && !opts.keyboardDelegate?.getKeyRightOf) ||
682
- (e.key === "Home" && !opts.keyboardDelegate?.getFirstKey) ||
683
- (e.key === "End" && !opts.keyboardDelegate?.getLastKey)
684
- ) {
685
- callUserOnKeyDown();
566
+ },
567
+ onKeyDown(e, drag) {
568
+ const opts = getOptions();
569
+ const keyboardDelegate = opts.keyboardDelegate;
570
+ if (!keyboardDelegate) {
571
+ opts.onKeyDown?.(e);
686
572
  return;
687
573
  }
688
- const navigationStart = e.key === "Home" || e.key === "End" ? null : state.target;
689
- const nextTarget = findNextValidTarget(navigationStart, (target) =>
690
- resolveFallbackKeyboardTarget(e.key, target),
691
- );
692
- if (nextTarget) {
693
- e.preventDefault();
694
- state.setTarget(nextTarget);
574
+ const types = getTypes(drag.items);
575
+ switch (e.key) {
576
+ case "ArrowDown": {
577
+ if (keyboardDelegate.getKeyBelow) {
578
+ const target = nextValidTarget(
579
+ state.target,
580
+ types,
581
+ drag.allowedDropOperations,
582
+ (t, wrap) => getNextTarget(t, wrap, "down"),
583
+ );
584
+ state.setTarget(target);
585
+ }
586
+ break;
587
+ }
588
+ case "ArrowUp": {
589
+ if (keyboardDelegate.getKeyAbove) {
590
+ const target = nextValidTarget(
591
+ state.target,
592
+ types,
593
+ drag.allowedDropOperations,
594
+ (t, wrap) => getNextTarget(t, wrap, "up"),
595
+ );
596
+ state.setTarget(target);
597
+ }
598
+ break;
599
+ }
600
+ case "ArrowLeft": {
601
+ if (keyboardDelegate.getKeyLeftOf) {
602
+ const target = nextValidTarget(
603
+ state.target,
604
+ types,
605
+ drag.allowedDropOperations,
606
+ (t, wrap) => getNextTarget(t, wrap, "left"),
607
+ );
608
+ state.setTarget(target);
609
+ }
610
+ break;
611
+ }
612
+ case "ArrowRight": {
613
+ if (keyboardDelegate.getKeyRightOf) {
614
+ const target = nextValidTarget(
615
+ state.target,
616
+ types,
617
+ drag.allowedDropOperations,
618
+ (t, wrap) => getNextTarget(t, wrap, "right"),
619
+ );
620
+ state.setTarget(target);
621
+ }
622
+ break;
623
+ }
624
+ case "Home": {
625
+ if (keyboardDelegate.getFirstKey) {
626
+ const target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>
627
+ getNextTarget(t, wrap),
628
+ );
629
+ state.setTarget(target);
630
+ }
631
+ break;
632
+ }
633
+ case "End": {
634
+ if (keyboardDelegate.getLastKey) {
635
+ const target = nextValidTarget(
636
+ null,
637
+ types,
638
+ drag.allowedDropOperations,
639
+ getPreviousTarget,
640
+ );
641
+ state.setTarget(target);
642
+ }
643
+ break;
644
+ }
645
+ case "PageDown": {
646
+ if (keyboardDelegate.getKeyPageBelow) {
647
+ let target = state.target;
648
+ if (!target) {
649
+ target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>
650
+ getNextTarget(t, wrap),
651
+ );
652
+ } else {
653
+ // If on the root, go to the item a page below the top. Otherwise a page below the current item.
654
+ let targetKey = keyboardDelegate.getFirstKey?.();
655
+ if (target.type === "item") {
656
+ targetKey = target.key;
657
+ }
658
+ let nextKey: Key | null = null;
659
+ if (targetKey != null) {
660
+ nextKey = keyboardDelegate.getKeyPageBelow(targetKey);
661
+ }
662
+ let dropPosition: "before" | "on" | "after" =
663
+ target.type === "item" ? target.dropPosition : "after";
664
+
665
+ // If there is no next key, or we are starting on the last key, jump to the last possible position.
666
+ if (
667
+ nextKey == null ||
668
+ (target.type === "item" && target.key === keyboardDelegate.getLastKey?.())
669
+ ) {
670
+ nextKey = keyboardDelegate.getLastKey?.() ?? null;
671
+ dropPosition = "after";
672
+ }
673
+
674
+ if (nextKey == null) {
675
+ break;
676
+ }
677
+ target = {
678
+ type: "item",
679
+ key: nextKey,
680
+ dropPosition,
681
+ };
682
+
683
+ // If the target does not accept the drop, find the next valid target.
684
+ // If no next valid target, find the previous valid target.
685
+ const operation = getDropOperationForTarget(
686
+ target,
687
+ wrapTypes(types),
688
+ drag.allowedDropOperations,
689
+ );
690
+ if (operation === "cancel") {
691
+ target =
692
+ nextValidTarget(
693
+ target,
694
+ types,
695
+ drag.allowedDropOperations,
696
+ (t, wrap) => getNextTarget(t, wrap),
697
+ false,
698
+ ) ??
699
+ nextValidTarget(
700
+ target,
701
+ types,
702
+ drag.allowedDropOperations,
703
+ getPreviousTarget,
704
+ false,
705
+ );
706
+ }
707
+ }
708
+
709
+ state.setTarget(target ?? state.target);
710
+ }
711
+ break;
712
+ }
713
+ case "PageUp": {
714
+ if (!keyboardDelegate.getKeyPageAbove) {
715
+ break;
716
+ }
717
+
718
+ let target = state.target;
719
+ if (!target) {
720
+ target = nextValidTarget(
721
+ null,
722
+ types,
723
+ drag.allowedDropOperations,
724
+ getPreviousTarget,
725
+ );
726
+ } else if (target.type === "item") {
727
+ // If at the top already, switch to the root. Otherwise navigate a page up.
728
+ if (target.key === keyboardDelegate.getFirstKey?.()) {
729
+ target = {
730
+ type: "root",
731
+ };
732
+ } else {
733
+ let nextKey: Key | null | undefined = keyboardDelegate.getKeyPageAbove(target.key);
734
+ let dropPosition: "before" | "on" | "after" = target.dropPosition;
735
+ if (nextKey == null) {
736
+ nextKey = keyboardDelegate.getFirstKey?.();
737
+ dropPosition = "before";
738
+ }
739
+
740
+ if (nextKey == null) {
741
+ break;
742
+ }
743
+ target = {
744
+ type: "item",
745
+ key: nextKey,
746
+ dropPosition,
747
+ };
748
+ }
749
+
750
+ // If the target does not accept the drop, find the previous valid target.
751
+ // If no next valid target, find the next valid target.
752
+ const operation = getDropOperationForTarget(
753
+ target,
754
+ wrapTypes(types),
755
+ drag.allowedDropOperations,
756
+ );
757
+ if (operation === "cancel") {
758
+ target =
759
+ nextValidTarget(
760
+ target,
761
+ types,
762
+ drag.allowedDropOperations,
763
+ getPreviousTarget,
764
+ false,
765
+ ) ??
766
+ nextValidTarget(
767
+ target,
768
+ types,
769
+ drag.allowedDropOperations,
770
+ (t, wrap) => getNextTarget(t, wrap),
771
+ false,
772
+ );
773
+ }
774
+ }
775
+
776
+ state.setTarget(target ?? state.target);
777
+ break;
778
+ }
695
779
  }
696
- callUserOnKeyDown();
697
- return;
698
- }
699
- if (e.key === "Enter" && state.target) {
700
- e.preventDefault();
701
- state.activateTarget(0, 0);
702
- callUserOnKeyDown();
703
- return;
704
- }
705
- if (e.key === "Escape" && state.target) {
706
- e.preventDefault();
707
- state.exitTarget(0, 0);
708
- callUserOnKeyDown();
709
- return;
710
- }
711
- callUserOnKeyDown();
712
- };
713
- return {
714
- ...baseDropProps,
715
- onKeyDown,
716
- };
780
+ opts.onKeyDown?.(e);
781
+ },
782
+ });
783
+
784
+ onCleanup(unregister);
717
785
  });
718
786
 
787
+ const collectionProps = createMemo<Record<string, unknown>>(() => ({
788
+ ...drop.dropProps,
789
+ // Remove description from the collection element. If dropping on the entire
790
+ // collection, there should be a drop indicator that carries this
791
+ // description, so no need to double-announce.
792
+ "aria-describedby": null,
793
+ }));
794
+
719
795
  return {
720
796
  get collectionProps() {
721
797
  return collectionProps() as DroppableCollectionAria["collectionProps"];
@@ -729,6 +805,40 @@ function normalizeSelection(selection: "all" | Iterable<Key> | undefined): "all"
729
805
  return new Set(selection);
730
806
  }
731
807
 
808
+ // Recover the collection key of a dragged/dropped DOM element. createSelectableItem
809
+ // stamps `data-key={String(key)}`, so the attribute is the stringified key; map it
810
+ // back to the real (possibly numeric) collection key by matching against the
811
+ // collection's nodes.
812
+ function keyFromDragElement(element: HTMLElement | null, collection: Collection | undefined): Key | null {
813
+ if (!element) return null;
814
+ const raw = element.getAttribute("data-key") ?? element.closest("[data-key]")?.getAttribute("data-key");
815
+ if (raw == null) return null;
816
+ if (!collection) return raw;
817
+ // Fast path: the raw string is already a valid key.
818
+ if ((collection as unknown as CollectionLike).getItem(raw) != null) return raw;
819
+ for (const node of collection as unknown as CollectionLike) {
820
+ if (String(node.key) === raw) return node.key;
821
+ }
822
+ return raw;
823
+ }
824
+
825
+ function selectionHas(selection: "all" | Set<Key> | null, key: Key): boolean {
826
+ if (selection === "all") return true;
827
+ return selection != null && selection.has(key);
828
+ }
829
+
830
+ // The selected keys in collection (DOM) order, so [0] is the first selected item
831
+ // and [length-1] the last — mirroring upstream's firstSelectedKey/lastSelectedKey.
832
+ function orderedSelectedKeys(selection: "all" | Set<Key> | null, collection: Collection): Key[] {
833
+ const out: Key[] = [];
834
+ for (const node of collection as unknown as CollectionLike) {
835
+ if (node.type === "item" && selectionHas(selection, node.key)) {
836
+ out.push(node.key);
837
+ }
838
+ }
839
+ return out;
840
+ }
841
+
732
842
  function selectionEquals(a: "all" | Set<Key> | null, b: "all" | Set<Key> | null): boolean {
733
843
  if (a === b) return true;
734
844
  if (!a || !b || a === "all" || b === "all") return false;
@@ -758,11 +868,15 @@ function getNewItemKeys(collection: CollectionLike, previousCollection: Collecti
758
868
 
759
869
  function updateFocusAfterDrop(
760
870
  opts: DroppableCollectionOptions,
761
- previousCollection: CollectionLike | undefined,
871
+ previousCollectionRaw: Collection | undefined,
762
872
  previousSelectedKeys: "all" | Set<Key> | null,
763
873
  target: DropTarget,
764
874
  ): void {
765
- const collection = opts.collection;
875
+ // Read the (real) collection through the structural `CollectionLike` view: it
876
+ // exposes the optional cell/rowheader/isExpanded fields upstream inspects, which
877
+ // are simply absent (undefined) for flat collections like ListBox.
878
+ const collection = opts.collection as CollectionLike | undefined;
879
+ const previousCollection = previousCollectionRaw as unknown as CollectionLike | undefined;
766
880
  if (!collection || !previousCollection) return;
767
881
 
768
882
  const newKeys = getNewItemKeys(collection, previousCollection);