@proyecto-viviana/solidaria 0.3.0 → 0.4.1

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 (743) 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 +141 -0
  10. package/dist/_chunk/actiongroup.js.map +1 -0
  11. package/dist/_chunk/actiongroup.jsx +141 -0
  12. package/dist/_chunk/actiongroup.jsx.map +1 -0
  13. package/dist/_chunk/announce.js +207 -0
  14. package/dist/_chunk/announce.js.map +1 -0
  15. package/dist/_chunk/announce.jsx +207 -0
  16. package/dist/_chunk/announce.jsx.map +1 -0
  17. package/dist/_chunk/ariaHideOutside.js +122 -0
  18. package/dist/_chunk/ariaHideOutside.js.map +1 -0
  19. package/dist/_chunk/ariaHideOutside.jsx +122 -0
  20. package/dist/_chunk/ariaHideOutside.jsx.map +1 -0
  21. package/dist/_chunk/autocomplete.js +244 -0
  22. package/dist/_chunk/autocomplete.js.map +1 -0
  23. package/dist/_chunk/autocomplete.jsx +244 -0
  24. package/dist/_chunk/autocomplete.jsx.map +1 -0
  25. package/dist/_chunk/breadcrumbs.js +121 -0
  26. package/dist/_chunk/breadcrumbs.js.map +1 -0
  27. package/dist/_chunk/breadcrumbs.jsx +121 -0
  28. package/dist/_chunk/breadcrumbs.jsx.map +1 -0
  29. package/dist/_chunk/button.js +275 -0
  30. package/dist/_chunk/button.js.map +1 -0
  31. package/dist/_chunk/button.jsx +275 -0
  32. package/dist/_chunk/button.jsx.map +1 -0
  33. package/dist/_chunk/calendar.js +1037 -0
  34. package/dist/_chunk/calendar.js.map +1 -0
  35. package/dist/_chunk/calendar.jsx +1037 -0
  36. package/dist/_chunk/calendar.jsx.map +1 -0
  37. package/dist/_chunk/checkbox.js +235 -0
  38. package/dist/_chunk/checkbox.js.map +1 -0
  39. package/dist/_chunk/checkbox.jsx +235 -0
  40. package/dist/_chunk/checkbox.jsx.map +1 -0
  41. package/dist/_chunk/color.js +1458 -0
  42. package/dist/_chunk/color.js.map +1 -0
  43. package/dist/_chunk/color.jsx +1458 -0
  44. package/dist/_chunk/color.jsx.map +1 -0
  45. package/dist/_chunk/combobox.js +1062 -0
  46. package/dist/_chunk/combobox.js.map +1 -0
  47. package/dist/_chunk/combobox.jsx +1062 -0
  48. package/dist/_chunk/combobox.jsx.map +1 -0
  49. package/dist/_chunk/constants.js +19 -0
  50. package/dist/_chunk/constants.js.map +1 -0
  51. package/dist/_chunk/constants.jsx +19 -0
  52. package/dist/_chunk/constants.jsx.map +1 -0
  53. package/dist/_chunk/createCollator.js +61 -0
  54. package/dist/_chunk/createCollator.js.map +1 -0
  55. package/dist/_chunk/createCollator.jsx +61 -0
  56. package/dist/_chunk/createCollator.jsx.map +1 -0
  57. package/dist/_chunk/createCollectionRowInteraction.js +133 -0
  58. package/dist/_chunk/createCollectionRowInteraction.js.map +1 -0
  59. package/dist/_chunk/createCollectionRowInteraction.jsx +133 -0
  60. package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -0
  61. package/dist/_chunk/createField.js +55 -0
  62. package/dist/_chunk/createField.js.map +1 -0
  63. package/dist/_chunk/createField.jsx +55 -0
  64. package/dist/_chunk/createField.jsx.map +1 -0
  65. package/dist/_chunk/createFocus.js +105 -0
  66. package/dist/_chunk/createFocus.js.map +1 -0
  67. package/dist/_chunk/createFocus.jsx +105 -0
  68. package/dist/_chunk/createFocus.jsx.map +1 -0
  69. package/dist/_chunk/createFocusRing.js +54 -0
  70. package/dist/_chunk/createFocusRing.js.map +1 -0
  71. package/dist/_chunk/createFocusRing.jsx +54 -0
  72. package/dist/_chunk/createFocusRing.jsx.map +1 -0
  73. package/dist/_chunk/createFocusWithin.js +120 -0
  74. package/dist/_chunk/createFocusWithin.js.map +1 -0
  75. package/dist/_chunk/createFocusWithin.jsx +120 -0
  76. package/dist/_chunk/createFocusWithin.jsx.map +1 -0
  77. package/dist/_chunk/createFocusable.js +131 -0
  78. package/dist/_chunk/createFocusable.js.map +1 -0
  79. package/dist/_chunk/createFocusable.jsx +131 -0
  80. package/dist/_chunk/createFocusable.jsx.map +1 -0
  81. package/dist/_chunk/createFormReset.js +39 -0
  82. package/dist/_chunk/createFormReset.js.map +1 -0
  83. package/dist/_chunk/createFormReset.jsx +39 -0
  84. package/dist/_chunk/createFormReset.jsx.map +1 -0
  85. package/dist/_chunk/createFormValidation.js +135 -0
  86. package/dist/_chunk/createFormValidation.js.map +1 -0
  87. package/dist/_chunk/createFormValidation.jsx +135 -0
  88. package/dist/_chunk/createFormValidation.jsx.map +1 -0
  89. package/dist/_chunk/createHover.js +131 -0
  90. package/dist/_chunk/createHover.js.map +1 -0
  91. package/dist/_chunk/createHover.jsx +131 -0
  92. package/dist/_chunk/createHover.jsx.map +1 -0
  93. package/dist/_chunk/createInteractionModality.js +268 -0
  94. package/dist/_chunk/createInteractionModality.js.map +1 -0
  95. package/dist/_chunk/createInteractionModality.jsx +268 -0
  96. package/dist/_chunk/createInteractionModality.jsx.map +1 -0
  97. package/dist/_chunk/createLabel.js +47 -0
  98. package/dist/_chunk/createLabel.js.map +1 -0
  99. package/dist/_chunk/createLabel.jsx +47 -0
  100. package/dist/_chunk/createLabel.jsx.map +1 -0
  101. package/dist/_chunk/createLabels.js +32 -0
  102. package/dist/_chunk/createLabels.js.map +1 -0
  103. package/dist/_chunk/createLabels.jsx +32 -0
  104. package/dist/_chunk/createLabels.jsx.map +1 -0
  105. package/dist/_chunk/createLandmark.js +198 -0
  106. package/dist/_chunk/createLandmark.js.map +1 -0
  107. package/dist/_chunk/createLandmark.jsx +198 -0
  108. package/dist/_chunk/createLandmark.jsx.map +1 -0
  109. package/dist/_chunk/createOverlay.js +327 -0
  110. package/dist/_chunk/createOverlay.js.map +1 -0
  111. package/dist/_chunk/createOverlay.jsx +327 -0
  112. package/dist/_chunk/createOverlay.jsx.map +1 -0
  113. package/dist/_chunk/createPress.js +526 -0
  114. package/dist/_chunk/createPress.js.map +1 -0
  115. package/dist/_chunk/createPress.jsx +526 -0
  116. package/dist/_chunk/createPress.jsx.map +1 -0
  117. package/dist/_chunk/createProgressBar.js +82 -0
  118. package/dist/_chunk/createProgressBar.js.map +1 -0
  119. package/dist/_chunk/createProgressBar.jsx +82 -0
  120. package/dist/_chunk/createProgressBar.jsx.map +1 -0
  121. package/dist/_chunk/createSelectableItem.js +302 -0
  122. package/dist/_chunk/createSelectableItem.js.map +1 -0
  123. package/dist/_chunk/createSelectableItem.jsx +302 -0
  124. package/dist/_chunk/createSelectableItem.jsx.map +1 -0
  125. package/dist/_chunk/createStringFormatter.js +61 -0
  126. package/dist/_chunk/createStringFormatter.js.map +1 -0
  127. package/dist/_chunk/createStringFormatter.jsx +61 -0
  128. package/dist/_chunk/createStringFormatter.jsx.map +1 -0
  129. package/dist/_chunk/createToggle.js +159 -0
  130. package/dist/_chunk/createToggle.js.map +1 -0
  131. package/dist/_chunk/createToggle.jsx +159 -0
  132. package/dist/_chunk/createToggle.jsx.map +1 -0
  133. package/dist/_chunk/createTypeSelect.js +125 -0
  134. package/dist/_chunk/createTypeSelect.js.map +1 -0
  135. package/dist/_chunk/createTypeSelect.jsx +125 -0
  136. package/dist/_chunk/createTypeSelect.jsx.map +1 -0
  137. package/dist/_chunk/datepicker.js +1706 -0
  138. package/dist/_chunk/datepicker.js.map +1 -0
  139. package/dist/_chunk/datepicker.jsx +1706 -0
  140. package/dist/_chunk/datepicker.jsx.map +1 -0
  141. package/dist/_chunk/dialog.js +62 -0
  142. package/dist/_chunk/dialog.js.map +1 -0
  143. package/dist/_chunk/dialog.jsx +62 -0
  144. package/dist/_chunk/dialog.jsx.map +1 -0
  145. package/dist/_chunk/disclosure.js +185 -0
  146. package/dist/_chunk/disclosure.js.map +1 -0
  147. package/dist/_chunk/disclosure.jsx +185 -0
  148. package/dist/_chunk/disclosure.jsx.map +1 -0
  149. package/dist/_chunk/dnd.js +2395 -0
  150. package/dist/_chunk/dnd.js.map +1 -0
  151. package/dist/_chunk/dnd.jsx +2395 -0
  152. package/dist/_chunk/dnd.jsx.map +1 -0
  153. package/dist/_chunk/env.js +87 -0
  154. package/dist/_chunk/env.js.map +1 -0
  155. package/dist/_chunk/env.jsx +87 -0
  156. package/dist/_chunk/env.jsx.map +1 -0
  157. package/dist/_chunk/filterDOMProps.js +82 -0
  158. package/dist/_chunk/filterDOMProps.js.map +1 -0
  159. package/dist/_chunk/filterDOMProps.jsx +82 -0
  160. package/dist/_chunk/filterDOMProps.jsx.map +1 -0
  161. package/dist/_chunk/focus.js +399 -0
  162. package/dist/_chunk/focus.js.map +1 -0
  163. package/dist/_chunk/focus.jsx +399 -0
  164. package/dist/_chunk/focus.jsx.map +1 -0
  165. package/dist/_chunk/focus2.js +631 -0
  166. package/dist/_chunk/focus2.js.map +1 -0
  167. package/dist/_chunk/focus2.jsx +631 -0
  168. package/dist/_chunk/focus2.jsx.map +1 -0
  169. package/dist/_chunk/grid.js +623 -0
  170. package/dist/_chunk/grid.js.map +1 -0
  171. package/dist/_chunk/grid.jsx +623 -0
  172. package/dist/_chunk/grid.jsx.map +1 -0
  173. package/dist/_chunk/gridlist.js +369 -0
  174. package/dist/_chunk/gridlist.js.map +1 -0
  175. package/dist/_chunk/gridlist.jsx +369 -0
  176. package/dist/_chunk/gridlist.jsx.map +1 -0
  177. package/dist/_chunk/i18n.js +199 -0
  178. package/dist/_chunk/i18n.js.map +1 -0
  179. package/dist/_chunk/i18n.jsx +199 -0
  180. package/dist/_chunk/i18n.jsx.map +1 -0
  181. package/dist/_chunk/interactions.js +331 -0
  182. package/dist/_chunk/interactions.js.map +1 -0
  183. package/dist/_chunk/interactions.jsx +325 -0
  184. package/dist/_chunk/interactions.jsx.map +1 -0
  185. package/dist/_chunk/link.js +97 -0
  186. package/dist/_chunk/link.js.map +1 -0
  187. package/dist/_chunk/link.jsx +97 -0
  188. package/dist/_chunk/link.jsx.map +1 -0
  189. package/dist/_chunk/listbox.js +356 -0
  190. package/dist/_chunk/listbox.js.map +1 -0
  191. package/dist/_chunk/listbox.jsx +356 -0
  192. package/dist/_chunk/listbox.jsx.map +1 -0
  193. package/dist/_chunk/locale.js +173 -0
  194. package/dist/_chunk/locale.js.map +1 -0
  195. package/dist/_chunk/locale.jsx +167 -0
  196. package/dist/_chunk/locale.jsx.map +1 -0
  197. package/dist/_chunk/menu.js +519 -0
  198. package/dist/_chunk/menu.js.map +1 -0
  199. package/dist/_chunk/menu.jsx +519 -0
  200. package/dist/_chunk/menu.jsx.map +1 -0
  201. package/dist/_chunk/meter.js +33 -0
  202. package/dist/_chunk/meter.js.map +1 -0
  203. package/dist/_chunk/meter.jsx +33 -0
  204. package/dist/_chunk/meter.jsx.map +1 -0
  205. package/dist/_chunk/numberfield.js +259 -0
  206. package/dist/_chunk/numberfield.js.map +1 -0
  207. package/dist/_chunk/numberfield.jsx +259 -0
  208. package/dist/_chunk/numberfield.jsx.map +1 -0
  209. package/dist/_chunk/overlays.js +186 -0
  210. package/dist/_chunk/overlays.js.map +1 -0
  211. package/dist/_chunk/overlays.jsx +162 -0
  212. package/dist/_chunk/overlays.jsx.map +1 -0
  213. package/dist/_chunk/popover.js +574 -0
  214. package/dist/_chunk/popover.js.map +1 -0
  215. package/dist/_chunk/popover.jsx +574 -0
  216. package/dist/_chunk/popover.jsx.map +1 -0
  217. package/dist/_chunk/radio.js +320 -0
  218. package/dist/_chunk/radio.js.map +1 -0
  219. package/dist/_chunk/radio.jsx +320 -0
  220. package/dist/_chunk/radio.jsx.map +1 -0
  221. package/dist/_chunk/reactivity.js +21 -0
  222. package/dist/_chunk/reactivity.js.map +1 -0
  223. package/dist/_chunk/reactivity.jsx +21 -0
  224. package/dist/_chunk/reactivity.jsx.map +1 -0
  225. package/dist/_chunk/searchfield.js +210 -0
  226. package/dist/_chunk/searchfield.js.map +1 -0
  227. package/dist/_chunk/searchfield.jsx +210 -0
  228. package/dist/_chunk/searchfield.jsx.map +1 -0
  229. package/dist/_chunk/select.js +406 -0
  230. package/dist/_chunk/select.js.map +1 -0
  231. package/dist/_chunk/select.jsx +397 -0
  232. package/dist/_chunk/select.jsx.map +1 -0
  233. package/dist/_chunk/selection.js +666 -0
  234. package/dist/_chunk/selection.js.map +1 -0
  235. package/dist/_chunk/selection.jsx +666 -0
  236. package/dist/_chunk/selection.jsx.map +1 -0
  237. package/dist/_chunk/separator.js +29 -0
  238. package/dist/_chunk/separator.js.map +1 -0
  239. package/dist/_chunk/separator.jsx +29 -0
  240. package/dist/_chunk/separator.jsx.map +1 -0
  241. package/dist/_chunk/slider.js +256 -0
  242. package/dist/_chunk/slider.js.map +1 -0
  243. package/dist/_chunk/slider.jsx +256 -0
  244. package/dist/_chunk/slider.jsx.map +1 -0
  245. package/dist/_chunk/spinbutton.js +153 -0
  246. package/dist/_chunk/spinbutton.js.map +1 -0
  247. package/dist/_chunk/spinbutton.jsx +153 -0
  248. package/dist/_chunk/spinbutton.jsx.map +1 -0
  249. package/dist/_chunk/steplist.js +66 -0
  250. package/dist/_chunk/steplist.js.map +1 -0
  251. package/dist/_chunk/steplist.jsx +66 -0
  252. package/dist/_chunk/steplist.jsx.map +1 -0
  253. package/dist/_chunk/switch.js +34 -0
  254. package/dist/_chunk/switch.js.map +1 -0
  255. package/dist/_chunk/switch.jsx +34 -0
  256. package/dist/_chunk/switch.jsx.map +1 -0
  257. package/dist/_chunk/table.js +1088 -0
  258. package/dist/_chunk/table.js.map +1 -0
  259. package/dist/_chunk/table.jsx +1088 -0
  260. package/dist/_chunk/table.jsx.map +1 -0
  261. package/dist/_chunk/tabs.js +263 -0
  262. package/dist/_chunk/tabs.js.map +1 -0
  263. package/dist/_chunk/tabs.jsx +263 -0
  264. package/dist/_chunk/tabs.jsx.map +1 -0
  265. package/dist/_chunk/tag.js +322 -0
  266. package/dist/_chunk/tag.js.map +1 -0
  267. package/dist/_chunk/tag.jsx +322 -0
  268. package/dist/_chunk/tag.jsx.map +1 -0
  269. package/dist/_chunk/textfield.js +110 -0
  270. package/dist/_chunk/textfield.js.map +1 -0
  271. package/dist/_chunk/textfield.jsx +110 -0
  272. package/dist/_chunk/textfield.jsx.map +1 -0
  273. package/dist/_chunk/toast.js +250 -0
  274. package/dist/_chunk/toast.js.map +1 -0
  275. package/dist/_chunk/toast.jsx +250 -0
  276. package/dist/_chunk/toast.jsx.map +1 -0
  277. package/dist/_chunk/toolbar.js +226 -0
  278. package/dist/_chunk/toolbar.js.map +1 -0
  279. package/dist/_chunk/toolbar.jsx +226 -0
  280. package/dist/_chunk/toolbar.jsx.map +1 -0
  281. package/dist/_chunk/tooltip.js +185 -0
  282. package/dist/_chunk/tooltip.js.map +1 -0
  283. package/dist/_chunk/tooltip.jsx +185 -0
  284. package/dist/_chunk/tooltip.jsx.map +1 -0
  285. package/dist/_chunk/tree.js +452 -0
  286. package/dist/_chunk/tree.js.map +1 -0
  287. package/dist/_chunk/tree.jsx +452 -0
  288. package/dist/_chunk/tree.jsx.map +1 -0
  289. package/dist/_chunk/utils.js +705 -0
  290. package/dist/_chunk/utils.js.map +1 -0
  291. package/dist/_chunk/utils.jsx +705 -0
  292. package/dist/_chunk/utils.jsx.map +1 -0
  293. package/dist/_chunk/visually-hidden.js +93 -0
  294. package/dist/_chunk/visually-hidden.js.map +1 -0
  295. package/dist/_chunk/visually-hidden.jsx +93 -0
  296. package/dist/_chunk/visually-hidden.jsx.map +1 -0
  297. package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
  298. package/dist/actiongroup/index.js +2 -0
  299. package/dist/actiongroup/index.jsx +2 -0
  300. package/dist/autocomplete/createAutocomplete.d.ts +12 -7
  301. package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
  302. package/dist/autocomplete/index.js +2 -0
  303. package/dist/autocomplete/index.jsx +2 -0
  304. package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
  305. package/dist/breadcrumbs/index.js +2 -0
  306. package/dist/breadcrumbs/index.jsx +2 -0
  307. package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
  308. package/dist/button/index.js +2 -0
  309. package/dist/button/index.jsx +2 -0
  310. package/dist/calendar/createCalendar.d.ts.map +1 -1
  311. package/dist/calendar/createCalendarCell.d.ts.map +1 -1
  312. package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
  313. package/dist/calendar/createCalendarMonthPicker.d.ts +41 -0
  314. package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -0
  315. package/dist/calendar/createCalendarYearPicker.d.ts +49 -0
  316. package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -0
  317. package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
  318. package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
  319. package/dist/calendar/index.d.ts +2 -0
  320. package/dist/calendar/index.d.ts.map +1 -1
  321. package/dist/calendar/index.js +2 -0
  322. package/dist/calendar/index.jsx +2 -0
  323. package/dist/calendar/intl/index.d.ts +1 -1
  324. package/dist/calendar/intl/index.d.ts.map +1 -1
  325. package/dist/calendar/utils.d.ts +4 -0
  326. package/dist/calendar/utils.d.ts.map +1 -1
  327. package/dist/checkbox/createCheckbox.d.ts +4 -0
  328. package/dist/checkbox/createCheckbox.d.ts.map +1 -1
  329. package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
  330. package/dist/checkbox/index.js +2 -0
  331. package/dist/checkbox/index.jsx +2 -0
  332. package/dist/collections/index.js +160 -0
  333. package/dist/collections/index.js.map +1 -0
  334. package/dist/collections/index.jsx +160 -0
  335. package/dist/collections/index.jsx.map +1 -0
  336. package/dist/color/createColorArea.d.ts.map +1 -1
  337. package/dist/color/createColorField.d.ts.map +1 -1
  338. package/dist/color/createColorSlider.d.ts.map +1 -1
  339. package/dist/color/createColorSwatch.d.ts.map +1 -1
  340. package/dist/color/createColorWheel.d.ts.map +1 -1
  341. package/dist/color/index.js +2 -0
  342. package/dist/color/index.jsx +2 -0
  343. package/dist/color/intl/index.d.ts +30 -0
  344. package/dist/color/intl/index.d.ts.map +1 -0
  345. package/dist/combobox/createComboBox.d.ts.map +1 -1
  346. package/dist/combobox/index.js +2 -0
  347. package/dist/combobox/index.jsx +2 -0
  348. package/dist/combobox/intl/generated-locales.d.ts +16 -0
  349. package/dist/combobox/intl/generated-locales.d.ts.map +1 -0
  350. package/dist/combobox/intl/index.d.ts +2 -2
  351. package/dist/combobox/intl/index.d.ts.map +1 -1
  352. package/dist/datepicker/createDateField.d.ts +45 -23
  353. package/dist/datepicker/createDateField.d.ts.map +1 -1
  354. package/dist/datepicker/createDatePicker.d.ts +34 -6
  355. package/dist/datepicker/createDatePicker.d.ts.map +1 -1
  356. package/dist/datepicker/createDatePickerGroup.d.ts +13 -13
  357. package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
  358. package/dist/datepicker/createDateRangePicker.d.ts +55 -7
  359. package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
  360. package/dist/datepicker/createDateSegment.d.ts +6 -15
  361. package/dist/datepicker/createDateSegment.d.ts.map +1 -1
  362. package/dist/datepicker/createDisplayNames.d.ts +17 -0
  363. package/dist/datepicker/createDisplayNames.d.ts.map +1 -0
  364. package/dist/datepicker/createTimeField.d.ts +12 -49
  365. package/dist/datepicker/createTimeField.d.ts.map +1 -1
  366. package/dist/datepicker/index.d.ts +3 -3
  367. package/dist/datepicker/index.d.ts.map +1 -1
  368. package/dist/datepicker/index.js +2 -0
  369. package/dist/datepicker/index.jsx +2 -0
  370. package/dist/datepicker/intl.d.ts +12 -0
  371. package/dist/datepicker/intl.d.ts.map +1 -0
  372. package/dist/dialog/index.js +2 -0
  373. package/dist/dialog/index.jsx +2 -0
  374. package/dist/disclosure/index.js +2 -0
  375. package/dist/disclosure/index.jsx +2 -0
  376. package/dist/dnd/DragManager.d.ts +86 -0
  377. package/dist/dnd/DragManager.d.ts.map +1 -0
  378. package/dist/dnd/DropTargetKeyboardNavigation.d.ts +42 -0
  379. package/dist/dnd/DropTargetKeyboardNavigation.d.ts.map +1 -0
  380. package/dist/dnd/createDrag.d.ts.map +1 -1
  381. package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
  382. package/dist/dnd/createDraggableItem.d.ts +12 -7
  383. package/dist/dnd/createDraggableItem.d.ts.map +1 -1
  384. package/dist/dnd/createDroppableCollection.d.ts +7 -15
  385. package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
  386. package/dist/dnd/index.d.ts +5 -1
  387. package/dist/dnd/index.d.ts.map +1 -1
  388. package/dist/dnd/index.js +3 -0
  389. package/dist/dnd/index.jsx +3 -0
  390. package/dist/dnd/intl/index.d.ts +39 -0
  391. package/dist/dnd/intl/index.d.ts.map +1 -0
  392. package/dist/dnd/utils.d.ts +7 -2
  393. package/dist/dnd/utils.d.ts.map +1 -1
  394. package/dist/focus/FocusScope.d.ts +7 -0
  395. package/dist/focus/FocusScope.d.ts.map +1 -1
  396. package/dist/focus/index.d.ts +2 -1
  397. package/dist/focus/index.d.ts.map +1 -1
  398. package/dist/focus/index.js +3 -0
  399. package/dist/focus/index.jsx +3 -0
  400. package/dist/focus/virtualFocus.d.ts +26 -0
  401. package/dist/focus/virtualFocus.d.ts.map +1 -0
  402. package/dist/form/createFormValidation.d.ts.map +1 -1
  403. package/dist/form/index.js +3 -0
  404. package/dist/form/index.jsx +3 -0
  405. package/dist/grid/index.js +2 -0
  406. package/dist/grid/index.jsx +2 -0
  407. package/dist/gridlist/createGridList.d.ts +7 -1
  408. package/dist/gridlist/createGridList.d.ts.map +1 -1
  409. package/dist/gridlist/createGridListItem.d.ts +1 -1
  410. package/dist/gridlist/createGridListItem.d.ts.map +1 -1
  411. package/dist/gridlist/createGridListSection.d.ts +15 -0
  412. package/dist/gridlist/createGridListSection.d.ts.map +1 -0
  413. package/dist/gridlist/index.d.ts +2 -1
  414. package/dist/gridlist/index.d.ts.map +1 -1
  415. package/dist/gridlist/index.js +2 -0
  416. package/dist/gridlist/index.jsx +2 -0
  417. package/dist/gridlist/types.d.ts +50 -0
  418. package/dist/gridlist/types.d.ts.map +1 -1
  419. package/dist/i18n/index.js +5 -0
  420. package/dist/i18n/index.jsx +5 -0
  421. package/dist/index.d.ts +10 -6
  422. package/dist/index.d.ts.map +1 -1
  423. package/dist/index.js +77 -18311
  424. package/dist/index.jsx +77 -18242
  425. package/dist/interactions/FocusableProvider.d.ts.map +1 -1
  426. package/dist/interactions/PressEvent.d.ts +11 -0
  427. package/dist/interactions/PressEvent.d.ts.map +1 -1
  428. package/dist/interactions/createFocus.d.ts.map +1 -1
  429. package/dist/interactions/createFocusWithin.d.ts.map +1 -1
  430. package/dist/interactions/createInteractionModality.d.ts +0 -1
  431. package/dist/interactions/createInteractionModality.d.ts.map +1 -1
  432. package/dist/interactions/createKeyboard.d.ts.map +1 -1
  433. package/dist/interactions/createPress.d.ts.map +1 -1
  434. package/dist/interactions/index.js +9 -0
  435. package/dist/interactions/index.jsx +9 -0
  436. package/dist/label/createLabels.d.ts.map +1 -1
  437. package/dist/label/index.js +4 -0
  438. package/dist/label/index.jsx +4 -0
  439. package/dist/landmark/index.js +2 -0
  440. package/dist/landmark/index.jsx +2 -0
  441. package/dist/link/index.js +2 -0
  442. package/dist/link/index.jsx +2 -0
  443. package/dist/listbox/createListBox.d.ts +37 -0
  444. package/dist/listbox/createListBox.d.ts.map +1 -1
  445. package/dist/listbox/createOption.d.ts +7 -1
  446. package/dist/listbox/createOption.d.ts.map +1 -1
  447. package/dist/listbox/index.js +2 -0
  448. package/dist/listbox/index.jsx +2 -0
  449. package/dist/live-announcer/index.js +2 -0
  450. package/dist/live-announcer/index.jsx +2 -0
  451. package/dist/menu/createMenu.d.ts +7 -4
  452. package/dist/menu/createMenu.d.ts.map +1 -1
  453. package/dist/menu/createMenuItem.d.ts +9 -1
  454. package/dist/menu/createMenuItem.d.ts.map +1 -1
  455. package/dist/menu/index.js +2 -0
  456. package/dist/menu/index.jsx +2 -0
  457. package/dist/meter/index.js +2 -0
  458. package/dist/meter/index.jsx +2 -0
  459. package/dist/numberfield/createNumberField.d.ts.map +1 -1
  460. package/dist/numberfield/index.js +2 -0
  461. package/dist/numberfield/index.jsx +2 -0
  462. package/dist/overlays/index.js +4 -0
  463. package/dist/overlays/index.jsx +4 -0
  464. package/dist/popover/calculatePosition.d.ts +2 -0
  465. package/dist/popover/calculatePosition.d.ts.map +1 -1
  466. package/dist/popover/createOverlayPosition.d.ts +8 -0
  467. package/dist/popover/createOverlayPosition.d.ts.map +1 -1
  468. package/dist/popover/index.js +2 -0
  469. package/dist/popover/index.jsx +2 -0
  470. package/dist/progress/index.js +2 -0
  471. package/dist/progress/index.jsx +2 -0
  472. package/dist/radio/createRadio.d.ts +2 -0
  473. package/dist/radio/createRadio.d.ts.map +1 -1
  474. package/dist/radio/index.js +2 -0
  475. package/dist/radio/index.jsx +2 -0
  476. package/dist/searchfield/index.js +2 -0
  477. package/dist/searchfield/index.jsx +2 -0
  478. package/dist/select/createSelect.d.ts +2 -0
  479. package/dist/select/createSelect.d.ts.map +1 -1
  480. package/dist/select/index.js +2 -0
  481. package/dist/select/index.jsx +2 -0
  482. package/dist/selection/DOMLayoutDelegate.d.ts +58 -0
  483. package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -0
  484. package/dist/selection/ListKeyboardDelegate.d.ts +95 -0
  485. package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -0
  486. package/dist/selection/constants.d.ts +15 -0
  487. package/dist/selection/constants.d.ts.map +1 -0
  488. package/dist/selection/createCollectionRowInteraction.d.ts +13 -0
  489. package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -0
  490. package/dist/selection/createScrollIntoViewOnFocus.d.ts +31 -0
  491. package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -0
  492. package/dist/selection/createSelectableCollection.d.ts +69 -0
  493. package/dist/selection/createSelectableCollection.d.ts.map +1 -0
  494. package/dist/selection/createSelectableItem.d.ts +154 -0
  495. package/dist/selection/createSelectableItem.d.ts.map +1 -0
  496. package/dist/selection/createSelectableList.d.ts +43 -0
  497. package/dist/selection/createSelectableList.d.ts.map +1 -0
  498. package/dist/selection/createTypeSelect.d.ts.map +1 -1
  499. package/dist/selection/index.d.ts +9 -0
  500. package/dist/selection/index.d.ts.map +1 -1
  501. package/dist/selection/index.js +5 -0
  502. package/dist/selection/index.jsx +5 -0
  503. package/dist/selection/selectItem.d.ts +29 -0
  504. package/dist/selection/selectItem.d.ts.map +1 -0
  505. package/dist/selection/utils.d.ts +40 -0
  506. package/dist/selection/utils.d.ts.map +1 -0
  507. package/dist/separator/index.js +2 -0
  508. package/dist/separator/index.jsx +2 -0
  509. package/dist/slider/createSlider.d.ts.map +1 -1
  510. package/dist/slider/index.js +2 -0
  511. package/dist/slider/index.jsx +2 -0
  512. package/dist/spinbutton/createSpinButton.d.ts +41 -0
  513. package/dist/spinbutton/createSpinButton.d.ts.map +1 -0
  514. package/dist/spinbutton/index.d.ts +3 -0
  515. package/dist/spinbutton/index.d.ts.map +1 -0
  516. package/dist/spinbutton/index.js +2 -0
  517. package/dist/spinbutton/index.jsx +2 -0
  518. package/dist/spinbutton/intl.d.ts +5 -0
  519. package/dist/spinbutton/intl.d.ts.map +1 -0
  520. package/dist/ssr/index.d.ts +17 -0
  521. package/dist/ssr/index.d.ts.map +1 -1
  522. package/dist/ssr/index.js +299 -0
  523. package/dist/ssr/index.js.map +1 -0
  524. package/dist/ssr/index.jsx +292 -0
  525. package/dist/ssr/index.jsx.map +1 -0
  526. package/dist/steplist/index.js +2 -0
  527. package/dist/steplist/index.jsx +2 -0
  528. package/dist/switch/createSwitch.d.ts +4 -0
  529. package/dist/switch/createSwitch.d.ts.map +1 -1
  530. package/dist/switch/index.js +2 -0
  531. package/dist/switch/index.jsx +2 -0
  532. package/dist/table/createTable.d.ts.map +1 -1
  533. package/dist/table/createTableColumnHeader.d.ts.map +1 -1
  534. package/dist/table/createTableRow.d.ts +1 -1
  535. package/dist/table/createTableRow.d.ts.map +1 -1
  536. package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -1
  537. package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
  538. package/dist/table/index.js +2 -0
  539. package/dist/table/index.jsx +2 -0
  540. package/dist/table/types.d.ts +35 -1
  541. package/dist/table/types.d.ts.map +1 -1
  542. package/dist/table/utils.d.ts +15 -0
  543. package/dist/table/utils.d.ts.map +1 -0
  544. package/dist/tabs/createTabs.d.ts +5 -3
  545. package/dist/tabs/createTabs.d.ts.map +1 -1
  546. package/dist/tabs/index.js +2 -0
  547. package/dist/tabs/index.jsx +2 -0
  548. package/dist/tag/createTag.d.ts +2 -0
  549. package/dist/tag/createTag.d.ts.map +1 -1
  550. package/dist/tag/createTagGroup.d.ts +7 -0
  551. package/dist/tag/createTagGroup.d.ts.map +1 -1
  552. package/dist/tag/index.js +2 -0
  553. package/dist/tag/index.jsx +2 -0
  554. package/dist/textfield/index.js +2 -0
  555. package/dist/textfield/index.jsx +2 -0
  556. package/dist/toast/createToast.d.ts.map +1 -1
  557. package/dist/toast/index.js +2 -0
  558. package/dist/toast/index.jsx +2 -0
  559. package/dist/toggle/createToggle.d.ts +4 -0
  560. package/dist/toggle/createToggle.d.ts.map +1 -1
  561. package/dist/toggle/index.js +3 -0
  562. package/dist/toggle/index.jsx +3 -0
  563. package/dist/toolbar/createToolbar.d.ts +1 -1
  564. package/dist/toolbar/createToolbar.d.ts.map +1 -1
  565. package/dist/toolbar/index.js +2 -0
  566. package/dist/toolbar/index.jsx +2 -0
  567. package/dist/tooltip/index.js +2 -0
  568. package/dist/tooltip/index.jsx +2 -0
  569. package/dist/tree/createTree.d.ts +5 -1
  570. package/dist/tree/createTree.d.ts.map +1 -1
  571. package/dist/tree/createTreeItem.d.ts +1 -1
  572. package/dist/tree/createTreeItem.d.ts.map +1 -1
  573. package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
  574. package/dist/tree/index.js +2 -0
  575. package/dist/tree/index.jsx +2 -0
  576. package/dist/tree/types.d.ts +10 -0
  577. package/dist/tree/types.d.ts.map +1 -1
  578. package/dist/utils/animation.d.ts +60 -0
  579. package/dist/utils/animation.d.ts.map +1 -0
  580. package/dist/utils/dom.d.ts +49 -2
  581. package/dist/utils/dom.d.ts.map +1 -1
  582. package/dist/utils/index.d.ts +4 -1
  583. package/dist/utils/index.d.ts.map +1 -1
  584. package/dist/utils/index.js +6 -0
  585. package/dist/utils/index.jsx +6 -0
  586. package/dist/utils/keyboard.d.ts +17 -0
  587. package/dist/utils/keyboard.d.ts.map +1 -0
  588. package/dist/utils/mergeProps.d.ts.map +1 -1
  589. package/dist/utils/scrollIntoView.d.ts +30 -0
  590. package/dist/utils/scrollIntoView.d.ts.map +1 -0
  591. package/dist/visually-hidden/index.js +2 -0
  592. package/dist/visually-hidden/index.jsx +2 -0
  593. package/package.json +304 -3
  594. package/src/actiongroup/createActionGroup.ts +26 -109
  595. package/src/autocomplete/createAutocomplete.ts +202 -35
  596. package/src/breadcrumbs/createBreadcrumbs.ts +12 -4
  597. package/src/button/createToggleButtonGroup.ts +19 -14
  598. package/src/calendar/createCalendar.ts +5 -4
  599. package/src/calendar/createCalendarCell.ts +36 -5
  600. package/src/calendar/createCalendarGrid.ts +47 -12
  601. package/src/calendar/createCalendarMonthPicker.ts +105 -0
  602. package/src/calendar/createCalendarYearPicker.ts +144 -0
  603. package/src/calendar/createRangeCalendar.ts +27 -15
  604. package/src/calendar/createRangeCalendarCell.ts +17 -3
  605. package/src/calendar/index.ts +17 -0
  606. package/src/calendar/intl/index.ts +8 -0
  607. package/src/calendar/utils.ts +4 -0
  608. package/src/checkbox/createCheckbox.ts +10 -0
  609. package/src/checkbox/createCheckboxGroupItem.ts +12 -16
  610. package/src/color/createColorArea.ts +17 -10
  611. package/src/color/createColorField.ts +8 -1
  612. package/src/color/createColorSlider.ts +1 -2
  613. package/src/color/createColorSwatch.ts +4 -2
  614. package/src/color/createColorWheel.ts +0 -6
  615. package/src/color/intl/index.ts +316 -0
  616. package/src/combobox/createComboBox.ts +35 -4
  617. package/src/combobox/intl/generated-locales.ts +635 -0
  618. package/src/combobox/intl/index.ts +8 -2
  619. package/src/datepicker/createDateField.ts +228 -213
  620. package/src/datepicker/createDatePicker.ts +157 -146
  621. package/src/datepicker/createDatePickerGroup.ts +88 -82
  622. package/src/datepicker/createDateRangePicker.ts +230 -179
  623. package/src/datepicker/createDateSegment.ts +386 -384
  624. package/src/datepicker/createDisplayNames.ts +45 -0
  625. package/src/datepicker/createTimeField.ts +36 -129
  626. package/src/datepicker/index.ts +13 -14
  627. package/src/datepicker/intl.ts +633 -0
  628. package/src/dnd/DragManager.ts +693 -0
  629. package/src/dnd/DropTargetKeyboardNavigation.ts +337 -0
  630. package/src/dnd/createDrag.ts +31 -5
  631. package/src/dnd/createDraggableCollection.ts +33 -15
  632. package/src/dnd/createDraggableItem.ts +92 -5
  633. package/src/dnd/createDroppableCollection.ts +488 -371
  634. package/src/dnd/index.ts +11 -0
  635. package/src/dnd/intl/ar-AE.json +29 -0
  636. package/src/dnd/intl/bg-BG.json +29 -0
  637. package/src/dnd/intl/cs-CZ.json +29 -0
  638. package/src/dnd/intl/da-DK.json +29 -0
  639. package/src/dnd/intl/de-DE.json +29 -0
  640. package/src/dnd/intl/el-GR.json +29 -0
  641. package/src/dnd/intl/en-US.json +29 -0
  642. package/src/dnd/intl/es-ES.json +29 -0
  643. package/src/dnd/intl/et-EE.json +29 -0
  644. package/src/dnd/intl/fi-FI.json +29 -0
  645. package/src/dnd/intl/fr-FR.json +29 -0
  646. package/src/dnd/intl/he-IL.json +29 -0
  647. package/src/dnd/intl/hr-HR.json +29 -0
  648. package/src/dnd/intl/hu-HU.json +29 -0
  649. package/src/dnd/intl/index.ts +139 -0
  650. package/src/dnd/intl/it-IT.json +29 -0
  651. package/src/dnd/intl/ja-JP.json +29 -0
  652. package/src/dnd/intl/ko-KR.json +29 -0
  653. package/src/dnd/intl/lt-LT.json +29 -0
  654. package/src/dnd/intl/lv-LV.json +29 -0
  655. package/src/dnd/intl/nb-NO.json +29 -0
  656. package/src/dnd/intl/nl-NL.json +29 -0
  657. package/src/dnd/intl/pl-PL.json +29 -0
  658. package/src/dnd/intl/pt-BR.json +29 -0
  659. package/src/dnd/intl/pt-PT.json +29 -0
  660. package/src/dnd/intl/ro-RO.json +29 -0
  661. package/src/dnd/intl/ru-RU.json +29 -0
  662. package/src/dnd/intl/sk-SK.json +29 -0
  663. package/src/dnd/intl/sl-SI.json +29 -0
  664. package/src/dnd/intl/sr-SP.json +29 -0
  665. package/src/dnd/intl/sv-SE.json +29 -0
  666. package/src/dnd/intl/tr-TR.json +29 -0
  667. package/src/dnd/intl/uk-UA.json +29 -0
  668. package/src/dnd/intl/zh-CN.json +29 -0
  669. package/src/dnd/intl/zh-TW.json +29 -0
  670. package/src/dnd/utils.ts +63 -3
  671. package/src/focus/FocusScope.tsx +266 -24
  672. package/src/focus/index.ts +8 -0
  673. package/src/focus/virtualFocus.ts +55 -0
  674. package/src/form/createFormValidation.ts +8 -1
  675. package/src/gridlist/createGridList.ts +187 -48
  676. package/src/gridlist/createGridListItem.ts +87 -155
  677. package/src/gridlist/createGridListSection.ts +54 -0
  678. package/src/gridlist/index.ts +3 -0
  679. package/src/gridlist/types.ts +47 -0
  680. package/src/index.ts +51 -3
  681. package/src/interactions/FocusableProvider.tsx +11 -6
  682. package/src/interactions/PressEvent.ts +14 -0
  683. package/src/interactions/createFocus.ts +26 -21
  684. package/src/interactions/createFocusWithin.ts +23 -24
  685. package/src/interactions/createInteractionModality.ts +26 -15
  686. package/src/interactions/createKeyboard.ts +10 -0
  687. package/src/interactions/createPress.ts +29 -6
  688. package/src/label/createLabels.ts +7 -4
  689. package/src/listbox/createListBox.ts +203 -10
  690. package/src/listbox/createOption.ts +84 -74
  691. package/src/menu/createMenu.ts +93 -16
  692. package/src/menu/createMenuItem.ts +253 -41
  693. package/src/numberfield/createNumberField.ts +82 -14
  694. package/src/popover/calculatePosition.ts +19 -7
  695. package/src/popover/createOverlayPosition.ts +9 -0
  696. package/src/radio/createRadio.ts +19 -2
  697. package/src/select/createSelect.ts +41 -4
  698. package/src/selection/DOMLayoutDelegate.ts +102 -0
  699. package/src/selection/ListKeyboardDelegate.ts +398 -0
  700. package/src/selection/constants.ts +16 -0
  701. package/src/selection/createCollectionRowInteraction.ts +209 -0
  702. package/src/selection/createScrollIntoViewOnFocus.ts +65 -0
  703. package/src/selection/createSelectableCollection.ts +645 -0
  704. package/src/selection/createSelectableItem.ts +512 -0
  705. package/src/selection/createSelectableList.ts +93 -0
  706. package/src/selection/createTypeSelect.ts +112 -51
  707. package/src/selection/index.ts +31 -0
  708. package/src/selection/selectItem.ts +80 -0
  709. package/src/selection/utils.ts +82 -0
  710. package/src/slider/createSlider.ts +48 -1
  711. package/src/spinbutton/createSpinButton.ts +163 -0
  712. package/src/spinbutton/index.ts +10 -0
  713. package/src/spinbutton/intl.ts +115 -0
  714. package/src/ssr/index.tsx +31 -0
  715. package/src/switch/createSwitch.ts +10 -0
  716. package/src/table/createTable.ts +82 -27
  717. package/src/table/createTableColumnHeader.ts +10 -0
  718. package/src/table/createTableRow.ts +208 -203
  719. package/src/table/createTableSelectAllCheckbox.ts +3 -4
  720. package/src/table/createTableSelectionCheckbox.ts +24 -1
  721. package/src/table/types.ts +37 -1
  722. package/src/table/utils.ts +41 -0
  723. package/src/tabs/createTabs.ts +95 -24
  724. package/src/tag/createTag.ts +30 -36
  725. package/src/tag/createTagGroup.ts +92 -0
  726. package/src/toast/createToast.ts +1 -0
  727. package/src/toggle/createToggle.ts +20 -0
  728. package/src/toolbar/createToolbar.ts +43 -94
  729. package/src/tree/createTree.ts +165 -52
  730. package/src/tree/createTreeItem.ts +105 -120
  731. package/src/tree/createTreeSelectionCheckbox.ts +14 -1
  732. package/src/tree/types.ts +10 -0
  733. package/src/utils/animation.ts +243 -0
  734. package/src/utils/dom.ts +216 -25
  735. package/src/utils/index.ts +10 -0
  736. package/src/utils/keyboard.ts +25 -0
  737. package/src/utils/mergeProps.ts +8 -1
  738. package/src/utils/scrollIntoView.ts +181 -0
  739. package/dist/datepicker/createTimeSegment.d.ts +0 -29
  740. package/dist/datepicker/createTimeSegment.d.ts.map +0 -1
  741. package/dist/index.js.map +0 -1
  742. package/dist/index.jsx.map +0 -1
  743. package/src/datepicker/createTimeSegment.ts +0 -352
@@ -0,0 +1,302 @@
1
+ import { t as createPress } from "./createPress.jsx";
2
+ import { i as mergeProps$1 } from "./env.jsx";
3
+ import { t as access } from "./reactivity.jsx";
4
+ import { c as isCtrlKeyPressed, w as isAppleDevice } from "./utils.jsx";
5
+ import { a as getEventTarget, b as openLink, s as getOwnerDocument, t as focusSafely } from "./focus.jsx";
6
+ import { r as createLongPress } from "./interactions.jsx";
7
+ import { createId } from "../ssr/index.jsx";
8
+ import { n as createDragSession } from "./DragManager.jsx";
9
+ import { createEffect, createUniqueId } from "solid-js";
10
+ //#region src/selection/utils.ts
11
+ /**
12
+ * Resolves the DOM element rendered for a collection item by its key, scoped to
13
+ * the owning collection when a `data-collection` id is present. Mirrors
14
+ * `@react-aria/selection`'s `getItemElement`, adapted to take a Solid ref
15
+ * accessor instead of a React ref object.
16
+ */
17
+ function getItemElement(ref, key) {
18
+ const root = ref();
19
+ if (!root) return null;
20
+ let selector = `[data-key="${CSS.escape(String(key))}"]`;
21
+ const collectionId = root.dataset.collection;
22
+ if (collectionId) selector = `[data-collection="${CSS.escape(collectionId)}"]${selector}`;
23
+ return root.querySelector(selector);
24
+ }
25
+ /**
26
+ * A stable, SSR-safe id for a collection, shared between the collection
27
+ * container and its items so {@link getItemElement} can scope a query by
28
+ * `data-collection` (needed to disambiguate nested collections).
29
+ *
30
+ * Divergence from upstream: React's `useCollectionId` keys this WeakMap by the
31
+ * collection object and relies on a render-stable `useId`. A Solid collection is
32
+ * rebuilt with a new identity whenever its items change, so we key by the
33
+ * SelectionManager instance instead — it is created once and never replaced, so
34
+ * the container and its items always resolve to the same entry — and generate
35
+ * the id with our SSR-safe `createId`.
36
+ */
37
+ const collectionIdMap = /* @__PURE__ */ new WeakMap();
38
+ /**
39
+ * Registers (on first call) and returns the collection id for a SelectionManager.
40
+ * The collection container calls this; its items read the same id via
41
+ * {@link getCollectionId}. Must be called within a reactive owner (uses createId).
42
+ */
43
+ function registerCollectionId(manager) {
44
+ let id = collectionIdMap.get(manager);
45
+ if (id == null) {
46
+ id = createId();
47
+ collectionIdMap.set(manager, id);
48
+ }
49
+ return id;
50
+ }
51
+ /**
52
+ * Returns the collection id registered for a SelectionManager, or `undefined`
53
+ * when its container has not registered one (e.g. an item not yet wired into a
54
+ * `createSelectableCollection`). A Solid `undefined` attribute is omitted, so an
55
+ * unregistered item simply renders no `data-collection`.
56
+ */
57
+ function getCollectionId(manager) {
58
+ return collectionIdMap.get(manager);
59
+ }
60
+ /**
61
+ * Returns whether the modifier for non-contiguous (toggle) keyboard selection
62
+ * is pressed. Mirrors `@react-aria/selection`'s `isNonContiguousSelectionModifier`:
63
+ * Ctrl + Arrow Up/Down has a system-wide meaning on macOS, so Apple devices use
64
+ * Alt instead; Windows and Ubuntu use Ctrl.
65
+ */
66
+ function isNonContiguousSelectionModifier(e) {
67
+ return isAppleDevice() ? e.altKey === true : e.ctrlKey === true;
68
+ }
69
+ //#endregion
70
+ //#region src/selection/selectItem.ts
71
+ /**
72
+ * Resolve a press/keyboard interaction into a selection mutation on `manager`,
73
+ * faithful to `useSelectableItem.onSelect`. `collection` is required for the
74
+ * shift-extend (contiguous range) path.
75
+ */
76
+ function selectItem(manager, key, e, collection) {
77
+ if (e.pointerType === "keyboard" && isNonContiguousSelectionModifier(e)) {
78
+ manager.toggleSelection(key);
79
+ return;
80
+ }
81
+ if (manager.selectionMode() === "none") return;
82
+ if (manager.selectionMode() === "single") if (manager.isSelected(key) && !manager.disallowEmptySelection()) manager.toggleSelection(key);
83
+ else manager.replaceSelection(key);
84
+ else if (e.shiftKey) manager.extendSelection(key, collection);
85
+ else if (manager.selectionBehavior() === "toggle" || isCtrlKeyPressed(e) || e.pointerType === "touch" || e.pointerType === "virtual") manager.toggleSelection(key);
86
+ else manager.replaceSelection(key);
87
+ }
88
+ //#endregion
89
+ //#region src/selection/createSelectableItem.ts
90
+ /**
91
+ * createSelectableItem - handles interactions with an item in a selectable
92
+ * collection. Port of `@react-aria/selection`'s `useSelectableItem`.
93
+ *
94
+ * This encapsulates the full press-path action model: the
95
+ * selection-vs-action decision per pointer type, the press-up-vs-press timing
96
+ * (menus select on press up, rows on press down), the keyboard Space/Enter
97
+ * split, double-click secondary actions, and long-press-to-toggle. The
98
+ * selection decision itself is delegated to the aria-layer {@link selectItem}
99
+ * (Phase 0), which is also where the platform-aware modifier resolution lives.
100
+ *
101
+ * Documented adaptations from upstream (React → Solid / our thinner state):
102
+ * - **Link model is prop-threaded.** Our collection nodes don't expose
103
+ * `manager.isLink`/`manager.getItemProps`, so link items pass `isLink` /
104
+ * `href` / `routerOptions` via options and navigation goes through
105
+ * {@link openLink} (we have no `RouterProvider` context).
106
+ * - **Selection manager shape is structural.** ListState passes its
107
+ * SelectionManager; grid-like states pass an adapter with the same observable
108
+ * surface. `canSelectItem` is read from that surface when available so
109
+ * `disabledBehavior: 'selection'` keeps actions enabled while selection stays
110
+ * blocked.
111
+ * - **Virtual focus** guards real DOM focus and updates the focused key on
112
+ * press; we have no `moveVirtualFocus`, so no AT cursor move is dispatched.
113
+ * - **`onDragStart`** is bubble phase (upstream uses capture to beat `useDrag`);
114
+ * wired to capture when drag-and-drop integration lands.
115
+ * - **`getItemProps` press-handler chaining** (collection-provided press
116
+ * handlers) is omitted — our nodes don't carry them.
117
+ */
118
+ /**
119
+ * DOM event dispatched when an item action is performed. Mirrors upstream's
120
+ * `react-aria-item-action`; combobox/autocomplete listen for it to close on
121
+ * action. Exported so emitter and listener share one constant.
122
+ */
123
+ const ITEM_ACTION_EVENT = "solidaria:item-action";
124
+ const isActionKey = (key) => key === "Enter";
125
+ const isSelectionKey = (key) => key === " ";
126
+ /**
127
+ * Provides the behavior and accessibility implementation for an item in a
128
+ * selectable collection.
129
+ */
130
+ function createSelectableItem(options, manager, ref) {
131
+ const getOptions = () => access(options);
132
+ const generatedId = createUniqueId();
133
+ const key = () => getOptions().key;
134
+ const id = () => getOptions().id ?? generatedId;
135
+ const linkBehavior = () => getOptions().linkBehavior ?? "action";
136
+ const shouldUseVirtualFocus = () => getOptions().shouldUseVirtualFocus ?? false;
137
+ const allowsDifferentPressOrigin = () => getOptions().allowsDifferentPressOrigin ?? false;
138
+ const shouldSelectOnPressUp = () => getOptions().shouldSelectOnPressUp ?? false;
139
+ const isLink = () => getOptions().isLink ?? !!getOptions().href;
140
+ const collection = () => manager.collection();
141
+ const isDisabled = () => getOptions().isDisabled === true || manager.isDisabled(key());
142
+ const canSelectItem = () => {
143
+ const k = key();
144
+ return manager.canSelectItem?.(k) ?? manager.selectionManager?.canSelectItem?.(k) ?? (manager.selectionMode() !== "none" && !manager.isDisabled(k));
145
+ };
146
+ const isLinkOverride = () => isLink() && linkBehavior() === "override";
147
+ const isActionOverride = () => getOptions().onAction != null && getOptions().UNSTABLE_itemBehavior === "action";
148
+ const hasLinkAction = () => isLink() && linkBehavior() !== "selection" && linkBehavior() !== "none";
149
+ const allowsSelection = () => !isDisabled() && canSelectItem() && !isLinkOverride() && !isActionOverride();
150
+ const allowsActions = () => (getOptions().onAction != null || hasLinkAction()) && !isDisabled();
151
+ const hasPrimaryAction = () => allowsActions() && (manager.selectionBehavior() === "replace" ? !allowsSelection() : !allowsSelection() || manager.isEmpty());
152
+ const hasSecondaryAction = () => allowsActions() && allowsSelection() && manager.selectionBehavior() === "replace";
153
+ const hasAction = () => hasPrimaryAction() || hasSecondaryAction();
154
+ const longPressEnabled = () => hasAction() && allowsSelection();
155
+ let modality = null;
156
+ let longPressEnabledOnPressStart = false;
157
+ let hadPrimaryActionOnPressStart = false;
158
+ const isSelected = () => manager.selectionMode() !== "none" && manager.isSelected(key());
159
+ const isFocused = () => manager.isFocused() && manager.focusedKey() === key();
160
+ const onSelect = (e) => {
161
+ const k = key();
162
+ if (e.pointerType === "keyboard" && isNonContiguousSelectionModifier(e)) {
163
+ manager.toggleSelection(k);
164
+ return;
165
+ }
166
+ if (manager.selectionMode() === "none") return;
167
+ if (isLink()) {
168
+ if (linkBehavior() === "selection") {
169
+ const el = ref();
170
+ if (el instanceof HTMLAnchorElement) openLink(el, e);
171
+ const sel = manager.selectedKeys();
172
+ if (sel !== "all") manager.setSelectedKeys(sel);
173
+ return;
174
+ } else if (linkBehavior() === "override" || linkBehavior() === "none") return;
175
+ }
176
+ selectItem(manager, k, e, collection());
177
+ };
178
+ const performAction = (e) => {
179
+ const o = getOptions();
180
+ if (o.onAction) {
181
+ o.onAction(e);
182
+ ref()?.dispatchEvent(new CustomEvent(ITEM_ACTION_EVENT, { bubbles: true }));
183
+ }
184
+ if (hasLinkAction()) {
185
+ const el = ref();
186
+ if (el instanceof HTMLAnchorElement) openLink(el, e);
187
+ }
188
+ };
189
+ const dragSession = createDragSession();
190
+ createEffect(() => {
191
+ if (dragSession()) return;
192
+ if (key() !== manager.focusedKey() || !manager.isFocused()) return;
193
+ const o = getOptions();
194
+ if (!shouldUseVirtualFocus()) if (o.focus) o.focus();
195
+ else {
196
+ const el = ref();
197
+ if (el && getOwnerDocument(el).activeElement !== el) focusSafely(el);
198
+ }
199
+ });
200
+ const { pressProps, isPressed } = createPress({
201
+ get isDisabled() {
202
+ return !(allowsSelection() || hasPrimaryAction() || shouldUseVirtualFocus() && !isDisabled());
203
+ },
204
+ get preventFocusOnPress() {
205
+ return shouldUseVirtualFocus();
206
+ },
207
+ onPressStart(e) {
208
+ modality = e.pointerType;
209
+ longPressEnabledOnPressStart = longPressEnabled();
210
+ if (shouldSelectOnPressUp()) {
211
+ if (e.pointerType === "keyboard" && (!hasAction() || isSelectionKey(e.key))) onSelect(e);
212
+ } else {
213
+ hadPrimaryActionOnPressStart = hasPrimaryAction();
214
+ if (allowsSelection() && (e.pointerType === "mouse" && !hasPrimaryAction() || e.pointerType === "keyboard" && (!allowsActions() || isSelectionKey(e.key)))) onSelect(e);
215
+ }
216
+ if (shouldUseVirtualFocus() && e.pointerType !== "touch") {
217
+ manager.setFocused(true);
218
+ manager.setFocusedKey(key());
219
+ }
220
+ },
221
+ onPressUp(e) {
222
+ if (shouldSelectOnPressUp() && allowsDifferentPressOrigin() && !hasPrimaryAction() && e.pointerType === "mouse" && allowsSelection()) onSelect(e);
223
+ },
224
+ onPress(e) {
225
+ if (shouldSelectOnPressUp()) {
226
+ if (!allowsDifferentPressOrigin()) {
227
+ if (hasPrimaryAction() || hasSecondaryAction() && e.pointerType !== "mouse") {
228
+ if (e.pointerType === "keyboard" && !isActionKey(e.key)) return;
229
+ performAction(e);
230
+ } else if (e.pointerType !== "keyboard" && allowsSelection()) onSelect(e);
231
+ } else if (hasPrimaryAction()) performAction(e);
232
+ else if (e.pointerType !== "keyboard" && e.pointerType !== "mouse" && allowsSelection()) onSelect(e);
233
+ } else if (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && hasAction() && isActionKey(e.key) || e.pointerType === "mouse" && hadPrimaryActionOnPressStart) {
234
+ if (hasAction()) performAction(e);
235
+ else if (allowsSelection()) onSelect(e);
236
+ }
237
+ if (shouldUseVirtualFocus() && e.pointerType === "touch") {
238
+ manager.setFocused(true);
239
+ manager.setFocusedKey(key());
240
+ }
241
+ }
242
+ });
243
+ const { longPressProps } = createLongPress({
244
+ get isDisabled() {
245
+ return !longPressEnabled();
246
+ },
247
+ onLongPress(e) {
248
+ if (e.pointerType === "touch") {
249
+ onSelect(e);
250
+ manager.setSelectionBehavior("toggle");
251
+ }
252
+ }
253
+ });
254
+ const onDblClick = (e) => {
255
+ if (!hasSecondaryAction()) return;
256
+ if (modality === "mouse") {
257
+ e.stopPropagation();
258
+ e.preventDefault();
259
+ performAction(e);
260
+ }
261
+ };
262
+ const onDragStart = (e) => {
263
+ if (modality === "touch" && longPressEnabledOnPressStart) e.preventDefault();
264
+ };
265
+ const onClick = (e) => {
266
+ if (linkBehavior() !== "none" && isLink()) {
267
+ if (!openLink.isOpening) e.preventDefault();
268
+ }
269
+ };
270
+ return {
271
+ get itemProps() {
272
+ const k = key();
273
+ const disabled = isDisabled();
274
+ const baseProps = {
275
+ "data-key": String(k),
276
+ "data-collection": getCollectionId(manager.selectionManager ?? manager)
277
+ };
278
+ if (!shouldUseVirtualFocus() && !disabled) {
279
+ baseProps.tabIndex = k === manager.focusedKey() ? 0 : -1;
280
+ baseProps.onFocus = (e) => {
281
+ if (getEventTarget(e) === ref()) manager.setFocusedKey(k);
282
+ };
283
+ } else if (disabled) baseProps.onMouseDown = (e) => e.preventDefault();
284
+ return mergeProps$1(baseProps, allowsSelection() || hasPrimaryAction() || shouldUseVirtualFocus() && !disabled ? pressProps : {}, longPressEnabled() ? longPressProps : {}, {
285
+ onDblClick,
286
+ onDragStart,
287
+ onClick,
288
+ id: id()
289
+ }, shouldUseVirtualFocus() ? { onMouseDown: (e) => e.preventDefault() } : {});
290
+ },
291
+ isPressed,
292
+ isSelected,
293
+ isFocused,
294
+ isDisabled,
295
+ allowsSelection,
296
+ hasAction
297
+ };
298
+ }
299
+ //#endregion
300
+ export { isNonContiguousSelectionModifier as a, getItemElement as i, createSelectableItem as n, registerCollectionId as o, selectItem as r, ITEM_ACTION_EVENT as t };
301
+
302
+ //# sourceMappingURL=createSelectableItem.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSelectableItem.jsx","names":["mergeProps"],"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\";\nimport { createDragSession } from \"../dnd/DragManager\";\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 const dragSession = createDragSession();\n createEffect(() => {\n // While a keyboard drag session is active, real DOM focus is owned by the\n // DragManager (it lives on drop indicators / the collection), and upstream's\n // React `useSelectableItem` focus effect provably cannot re-run mid-drag —\n // its dep array `[ref, key, focusedKey, childFocusStrategy, isFocused]` stays\n // frozen. Our reactive effect would otherwise re-fire and steal focus back\n // onto the focused option, bouncing focus off the drop indicator. Reading the\n // reactive drag-session accessor here also re-runs this effect once the drag\n // ends, restoring normal roving-tabindex focus.\n if (dragSession()) {\n return;\n }\n\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":"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"}
@@ -0,0 +1,61 @@
1
+ import { i as useLocale } from "./locale.js";
2
+ import { createMemo } from "solid-js";
3
+ import { LocalizedStringDictionary, LocalizedStringFormatter } from "@internationalized/string";
4
+ //#region src/i18n/createStringFormatter.ts
5
+ /**
6
+ * String formatter for localized strings with ICU MessageFormat support.
7
+ * Port of @react-aria/i18n useLocalizedStringFormatter.
8
+ */
9
+ const cache = /* @__PURE__ */ new WeakMap();
10
+ function getCachedDictionary(strings) {
11
+ let dictionary = cache.get(strings);
12
+ if (!dictionary) {
13
+ dictionary = new LocalizedStringDictionary(strings);
14
+ cache.set(strings, dictionary);
15
+ }
16
+ return dictionary;
17
+ }
18
+ /**
19
+ * Returns a cached LocalizedStringDictionary for the given strings.
20
+ */
21
+ function createStringDictionary(strings, packageName) {
22
+ return packageName && LocalizedStringDictionary.getGlobalDictionaryForPackage(packageName) || getCachedDictionary(strings);
23
+ }
24
+ /**
25
+ * Provides localized string formatting for the current locale.
26
+ * Supports interpolating variables, selecting the correct pluralization,
27
+ * and formatting numbers. Automatically updates when the locale changes.
28
+ *
29
+ * @param strings - A mapping of languages to localized strings by key.
30
+ * @param packageName - Optional package name for global dictionary lookup.
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * const strings = {
35
+ * 'en-US': {
36
+ * greeting: 'Hello, {name}!',
37
+ * count: '{count, plural, one {# item} other {# items}}'
38
+ * }
39
+ * };
40
+ *
41
+ * function MyComponent() {
42
+ * const stringFormatter = createStringFormatter(strings);
43
+ *
44
+ * return (
45
+ * <div>
46
+ * {stringFormatter().format('greeting', { name: 'World' })}
47
+ * {stringFormatter().format('count', { count: 5 })}
48
+ * </div>
49
+ * );
50
+ * }
51
+ * ```
52
+ */
53
+ function createStringFormatter(strings, packageName) {
54
+ const localeAccessor = useLocale();
55
+ const dictionary = createStringDictionary(strings, packageName);
56
+ return createMemo(() => new LocalizedStringFormatter(localeAccessor().locale, dictionary));
57
+ }
58
+ //#endregion
59
+ export { createStringFormatter as n, createStringDictionary as t };
60
+
61
+ //# sourceMappingURL=createStringFormatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStringFormatter.js","names":[],"sources":["../../src/i18n/createStringFormatter.ts"],"sourcesContent":["/**\n * String formatter for localized strings with ICU MessageFormat support.\n * Port of @react-aria/i18n useLocalizedStringFormatter.\n */\n\nimport {\n LocalizedString,\n LocalizedStringDictionary,\n LocalizedStringFormatter,\n type LocalizedStrings,\n} from \"@internationalized/string\";\nimport { createMemo, type Accessor } from \"solid-js\";\nimport { useLocale } from \"./locale\";\n\n// Cache for dictionaries to avoid recreating them\nconst cache = new WeakMap<\n LocalizedStrings<string, LocalizedString>,\n LocalizedStringDictionary<string, LocalizedString>\n>();\n\nfunction getCachedDictionary<K extends string, T extends LocalizedString>(\n strings: LocalizedStrings<K, T>,\n): LocalizedStringDictionary<K, T> {\n let dictionary = cache.get(strings as LocalizedStrings<string, LocalizedString>);\n if (!dictionary) {\n dictionary = new LocalizedStringDictionary(\n strings as LocalizedStrings<string, LocalizedString>,\n );\n cache.set(strings as LocalizedStrings<string, LocalizedString>, dictionary);\n }\n return dictionary as LocalizedStringDictionary<K, T>;\n}\n\n/**\n * Returns a cached LocalizedStringDictionary for the given strings.\n */\nexport function createStringDictionary<\n K extends string = string,\n T extends LocalizedString = string,\n>(strings: LocalizedStrings<K, T>, packageName?: string): LocalizedStringDictionary<K, T> {\n return (\n (packageName && LocalizedStringDictionary.getGlobalDictionaryForPackage(packageName)) ||\n getCachedDictionary(strings)\n );\n}\n\n/**\n * Provides localized string formatting for the current locale.\n * Supports interpolating variables, selecting the correct pluralization,\n * and formatting numbers. Automatically updates when the locale changes.\n *\n * @param strings - A mapping of languages to localized strings by key.\n * @param packageName - Optional package name for global dictionary lookup.\n *\n * @example\n * ```tsx\n * const strings = {\n * 'en-US': {\n * greeting: 'Hello, {name}!',\n * count: '{count, plural, one {# item} other {# items}}'\n * }\n * };\n *\n * function MyComponent() {\n * const stringFormatter = createStringFormatter(strings);\n *\n * return (\n * <div>\n * {stringFormatter().format('greeting', { name: 'World' })}\n * {stringFormatter().format('count', { count: 5 })}\n * </div>\n * );\n * }\n * ```\n */\nexport function createStringFormatter<\n K extends string = string,\n T extends LocalizedString = string,\n>(strings: LocalizedStrings<K, T>, packageName?: string): Accessor<LocalizedStringFormatter<K, T>> {\n const localeAccessor = useLocale();\n const dictionary = createStringDictionary(strings, packageName);\n\n return createMemo(() => new LocalizedStringFormatter(localeAccessor().locale, dictionary));\n}\n\nexport type {\n LocalizedString,\n LocalizedStringDictionary,\n LocalizedStringFormatter,\n LocalizedStrings,\n};\n"],"mappings":";;;;;;;;AAeA,MAAM,wBAAQ,IAAI,QAGhB;AAEF,SAAS,oBACP,SACiC;CACjC,IAAI,aAAa,MAAM,IAAI,OAAoD;CAC/E,IAAI,CAAC,YAAY;EACf,aAAa,IAAI,0BACf,OACF;EACA,MAAM,IAAI,SAAsD,UAAU;CAC5E;CACA,OAAO;AACT;;;;AAKA,SAAgB,uBAGd,SAAiC,aAAuD;CACxF,OACG,eAAe,0BAA0B,8BAA8B,WAAW,KACnF,oBAAoB,OAAO;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,sBAGd,SAAiC,aAAgE;CACjG,MAAM,iBAAiB,UAAU;CACjC,MAAM,aAAa,uBAAuB,SAAS,WAAW;CAE9D,OAAO,iBAAiB,IAAI,yBAAyB,eAAe,CAAC,CAAC,QAAQ,UAAU,CAAC;AAC3F"}
@@ -0,0 +1,61 @@
1
+ import { i as useLocale } from "./locale.jsx";
2
+ import { createMemo } from "solid-js";
3
+ import { LocalizedStringDictionary, LocalizedStringFormatter } from "@internationalized/string";
4
+ //#region src/i18n/createStringFormatter.ts
5
+ /**
6
+ * String formatter for localized strings with ICU MessageFormat support.
7
+ * Port of @react-aria/i18n useLocalizedStringFormatter.
8
+ */
9
+ const cache = /* @__PURE__ */ new WeakMap();
10
+ function getCachedDictionary(strings) {
11
+ let dictionary = cache.get(strings);
12
+ if (!dictionary) {
13
+ dictionary = new LocalizedStringDictionary(strings);
14
+ cache.set(strings, dictionary);
15
+ }
16
+ return dictionary;
17
+ }
18
+ /**
19
+ * Returns a cached LocalizedStringDictionary for the given strings.
20
+ */
21
+ function createStringDictionary(strings, packageName) {
22
+ return packageName && LocalizedStringDictionary.getGlobalDictionaryForPackage(packageName) || getCachedDictionary(strings);
23
+ }
24
+ /**
25
+ * Provides localized string formatting for the current locale.
26
+ * Supports interpolating variables, selecting the correct pluralization,
27
+ * and formatting numbers. Automatically updates when the locale changes.
28
+ *
29
+ * @param strings - A mapping of languages to localized strings by key.
30
+ * @param packageName - Optional package name for global dictionary lookup.
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * const strings = {
35
+ * 'en-US': {
36
+ * greeting: 'Hello, {name}!',
37
+ * count: '{count, plural, one {# item} other {# items}}'
38
+ * }
39
+ * };
40
+ *
41
+ * function MyComponent() {
42
+ * const stringFormatter = createStringFormatter(strings);
43
+ *
44
+ * return (
45
+ * <div>
46
+ * {stringFormatter().format('greeting', { name: 'World' })}
47
+ * {stringFormatter().format('count', { count: 5 })}
48
+ * </div>
49
+ * );
50
+ * }
51
+ * ```
52
+ */
53
+ function createStringFormatter(strings, packageName) {
54
+ const localeAccessor = useLocale();
55
+ const dictionary = createStringDictionary(strings, packageName);
56
+ return createMemo(() => new LocalizedStringFormatter(localeAccessor().locale, dictionary));
57
+ }
58
+ //#endregion
59
+ export { createStringFormatter as n, createStringDictionary as t };
60
+
61
+ //# sourceMappingURL=createStringFormatter.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStringFormatter.jsx","names":[],"sources":["../../src/i18n/createStringFormatter.ts"],"sourcesContent":["/**\n * String formatter for localized strings with ICU MessageFormat support.\n * Port of @react-aria/i18n useLocalizedStringFormatter.\n */\n\nimport {\n LocalizedString,\n LocalizedStringDictionary,\n LocalizedStringFormatter,\n type LocalizedStrings,\n} from \"@internationalized/string\";\nimport { createMemo, type Accessor } from \"solid-js\";\nimport { useLocale } from \"./locale\";\n\n// Cache for dictionaries to avoid recreating them\nconst cache = new WeakMap<\n LocalizedStrings<string, LocalizedString>,\n LocalizedStringDictionary<string, LocalizedString>\n>();\n\nfunction getCachedDictionary<K extends string, T extends LocalizedString>(\n strings: LocalizedStrings<K, T>,\n): LocalizedStringDictionary<K, T> {\n let dictionary = cache.get(strings as LocalizedStrings<string, LocalizedString>);\n if (!dictionary) {\n dictionary = new LocalizedStringDictionary(\n strings as LocalizedStrings<string, LocalizedString>,\n );\n cache.set(strings as LocalizedStrings<string, LocalizedString>, dictionary);\n }\n return dictionary as LocalizedStringDictionary<K, T>;\n}\n\n/**\n * Returns a cached LocalizedStringDictionary for the given strings.\n */\nexport function createStringDictionary<\n K extends string = string,\n T extends LocalizedString = string,\n>(strings: LocalizedStrings<K, T>, packageName?: string): LocalizedStringDictionary<K, T> {\n return (\n (packageName && LocalizedStringDictionary.getGlobalDictionaryForPackage(packageName)) ||\n getCachedDictionary(strings)\n );\n}\n\n/**\n * Provides localized string formatting for the current locale.\n * Supports interpolating variables, selecting the correct pluralization,\n * and formatting numbers. Automatically updates when the locale changes.\n *\n * @param strings - A mapping of languages to localized strings by key.\n * @param packageName - Optional package name for global dictionary lookup.\n *\n * @example\n * ```tsx\n * const strings = {\n * 'en-US': {\n * greeting: 'Hello, {name}!',\n * count: '{count, plural, one {# item} other {# items}}'\n * }\n * };\n *\n * function MyComponent() {\n * const stringFormatter = createStringFormatter(strings);\n *\n * return (\n * <div>\n * {stringFormatter().format('greeting', { name: 'World' })}\n * {stringFormatter().format('count', { count: 5 })}\n * </div>\n * );\n * }\n * ```\n */\nexport function createStringFormatter<\n K extends string = string,\n T extends LocalizedString = string,\n>(strings: LocalizedStrings<K, T>, packageName?: string): Accessor<LocalizedStringFormatter<K, T>> {\n const localeAccessor = useLocale();\n const dictionary = createStringDictionary(strings, packageName);\n\n return createMemo(() => new LocalizedStringFormatter(localeAccessor().locale, dictionary));\n}\n\nexport type {\n LocalizedString,\n LocalizedStringDictionary,\n LocalizedStringFormatter,\n LocalizedStrings,\n};\n"],"mappings":";;;;;;;;AAeA,MAAM,wBAAQ,IAAI,QAGhB;AAEF,SAAS,oBACP,SACiC;CACjC,IAAI,aAAa,MAAM,IAAI,OAAoD;CAC/E,IAAI,CAAC,YAAY;EACf,aAAa,IAAI,0BACf,OACF;EACA,MAAM,IAAI,SAAsD,UAAU;CAC5E;CACA,OAAO;AACT;;;;AAKA,SAAgB,uBAGd,SAAiC,aAAuD;CACxF,OACG,eAAe,0BAA0B,8BAA8B,WAAW,KACnF,oBAAoB,OAAO;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,sBAGd,SAAiC,aAAgE;CACjG,MAAM,iBAAiB,UAAU;CACjC,MAAM,aAAa,uBAAuB,SAAS,WAAW;CAE9D,OAAO,iBAAiB,IAAI,yBAAyB,eAAe,CAAC,CAAC,QAAQ,UAAU,CAAC;AAC3F"}