@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
@@ -1,6 +1,7 @@
1
1
  import { t as createPress } from "./createPress.jsx";
2
- import { i as access, o as mergeProps, t as isDevEnv } from "./env.jsx";
2
+ import { i as mergeProps$1, t as isDevEnv } from "./env.jsx";
3
3
  import { t as filterDOMProps } from "./filterDOMProps.jsx";
4
+ import { t as access } from "./reactivity.jsx";
4
5
  import { p as isVirtualClick } from "./utils.jsx";
5
6
  import { a as getEventTarget } from "./focus.jsx";
6
7
  import { t as createFocusWithin } from "./createFocusWithin.jsx";
@@ -240,7 +241,7 @@ function createMenu(props, state, ref) {
240
241
  },
241
242
  get menuProps() {
242
243
  const p = getProps();
243
- const baseProps = mergeProps(domProps(), focusWithinProps, fieldProps, {
244
+ const baseProps = mergeProps$1(domProps(), focusWithinProps, fieldProps, {
244
245
  role: "menu",
245
246
  get tabIndex() {
246
247
  return getProps().isDisabled ? void 0 : state.focusedKey() == null ? 0 : -1;
@@ -248,7 +249,7 @@ function createMenu(props, state, ref) {
248
249
  "aria-disabled": p.isDisabled || void 0,
249
250
  onKeyDown
250
251
  });
251
- if (!p.disallowTypeAhead) return mergeProps(baseProps, typeSelectProps);
252
+ if (!p.disallowTypeAhead) return mergeProps$1(baseProps, typeSelectProps);
252
253
  return baseProps;
253
254
  }
254
255
  };
@@ -449,7 +450,7 @@ function createMenuItem(props, state, ref) {
449
450
  if (p.rel) baseProps.rel = p.rel;
450
451
  if (p.download != null && p.download !== false) baseProps.download = p.download === true ? "" : p.download;
451
452
  }
452
- return mergeProps(selectableItemProps(), menuPressProps(), hoverProps, focusProps, keyboardProps, { onClick: performMenuAction }, baseProps);
453
+ return mergeProps$1(selectableItemProps(), menuPressProps(), hoverProps, focusProps, keyboardProps, { onClick: performMenuAction }, baseProps);
453
454
  },
454
455
  labelProps: { id: labelId },
455
456
  get descriptionProps() {
@@ -1 +1 @@
1
- {"version":3,"file":"menu.jsx","names":[],"sources":["../../src/menu/createMenu.ts","../../src/menu/createMenuItem.ts","../../src/menu/createMenuTrigger.ts"],"sourcesContent":["/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n * Based on @react-aria/menu useMenu.\n */\n\nimport { createEffect, onCleanup, type JSX, type Accessor } from \"solid-js\";\nimport { createFocusWithin } from \"../interactions/createFocusWithin\";\nimport { createLabel } from \"../label/createLabel\";\nimport { createTypeSelect } from \"../selection/createTypeSelect\";\nimport { selectItem } from \"../selection/selectItem\";\nimport { filterDOMProps } from \"../utils/filterDOMProps\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport { isDevEnv } from \"../utils/env\";\nimport type { MenuState, Key, Collection } from \"@proyecto-viviana/solid-stately\";\n\n/**\n * Default number of items to skip for page up/down when DOM measurement is not available.\n */\nconst DEFAULT_PAGE_SIZE = 10;\n\n/**\n * Find the next non-disabled key in a collection.\n */\nfunction findNextNonDisabledKey<T>(\n collection: Collection<T>,\n currentKey: Key | null,\n direction: \"next\" | \"prev\",\n isDisabled: (key: Key) => boolean,\n wrap: boolean,\n): Key | null {\n const getNextKey =\n direction === \"next\"\n ? (key: Key) => collection.getKeyAfter(key)\n : (key: Key) => collection.getKeyBefore(key);\n\n const getFirstKey =\n direction === \"next\" ? () => collection.getFirstKey() : () => collection.getLastKey();\n\n let nextKey = currentKey != null ? getNextKey(currentKey) : getFirstKey();\n\n // Skip disabled keys\n while (nextKey != null && isDisabled(nextKey)) {\n nextKey = getNextKey(nextKey);\n }\n\n // If we've reached the end and wrapping is enabled\n if (nextKey == null && wrap) {\n nextKey = getFirstKey();\n // Skip disabled keys from the start\n while (nextKey != null && isDisabled(nextKey)) {\n nextKey = getNextKey(nextKey);\n }\n }\n\n return nextKey;\n}\n\nexport interface AriaMenuProps<T = unknown> {\n /** An ID for the menu. */\n id?: string;\n /** Whether the menu is disabled. */\n isDisabled?: boolean;\n /** The label for the menu. */\n label?: JSX.Element;\n /** An accessible label for the menu when no visible label is provided. */\n \"aria-label\"?: string;\n /** The ID of an element that labels the menu. */\n \"aria-labelledby\"?: string;\n /** The ID of an element that describes the menu. */\n \"aria-describedby\"?: string;\n /** Handler called when focus moves into the menu. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler called when focus moves out of the menu. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler called when the focus state changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Handler called when an item is activated (pressed). */\n onAction?: (key: Key, value: T) => void;\n /** Handler called when the menu should close. */\n onClose?: () => void;\n /** Whether the menu should close when an item is selected. */\n shouldCloseOnSelect?: boolean;\n /** Whether focus should automatically wrap around. */\n shouldFocusWrap?: boolean;\n /** Whether to auto-focus the first item when the menu opens. */\n autoFocus?: boolean | \"first\" | \"last\";\n /** Whether type-to-select is disabled. @default false */\n disallowTypeAhead?: boolean;\n}\n\nexport interface MenuAria {\n /** Props for the menu element. */\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the menu's label element (if any). */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n// Shared data between menu and menu items\nconst menuData = new WeakMap<object, MenuData>();\n\ninterface MenuData {\n id: string;\n // Type-erased like upstream menu/utils.ts MenuData (value: any): the WeakMap\n // is keyed by an untyped state, so the item value flows through as unknown.\n onAction?: (key: Key, value: unknown) => void;\n onClose?: () => void;\n isDisabled?: boolean;\n shouldCloseOnSelect?: boolean;\n}\n\nexport function getMenuData(state: MenuState): MenuData | undefined {\n return menuData.get(state);\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n */\nexport function createMenu<T>(\n props: MaybeAccessor<AriaMenuProps<T>>,\n state: MenuState<T>,\n ref?: Accessor<HTMLElement | null>,\n): MenuAria {\n const getProps = () => access(props);\n const id = createId(getProps().id);\n\n // Development-time warning for missing accessibility labels\n if (isDevEnv()) {\n const p = getProps();\n if (!p.label && !p[\"aria-label\"] && !p[\"aria-labelledby\"]) {\n console.warn(\n \"[solidaria] A Menu requires an aria-label or aria-labelledby attribute for accessibility.\",\n );\n }\n }\n\n // Filter DOM props\n const domProps = () =>\n filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true });\n\n const updateSharedData = () => {\n const p = getProps();\n menuData.set(state, {\n id,\n onAction: p.onAction as MenuData[\"onAction\"],\n onClose: p.onClose,\n isDisabled: p.isDisabled,\n shouldCloseOnSelect: p.shouldCloseOnSelect,\n });\n };\n\n // Ensure menu items created in the same render pass can read parent metadata.\n updateSharedData();\n\n // Share data with child menu items\n createEffect(() => {\n updateSharedData();\n\n onCleanup(() => {\n menuData.delete(state);\n });\n });\n\n // Handle focus within\n const { focusWithinProps } = createFocusWithin({\n onFocusWithin: (e) => getProps().onFocus?.(e),\n onBlurWithin: (e) => getProps().onBlur?.(e),\n onFocusWithinChange: (isFocused) => {\n getProps().onFocusChange?.(isFocused);\n state.setFocused(isFocused);\n },\n });\n\n // Label handling\n const { labelProps, fieldProps } = createLabel({\n get id() {\n return id;\n },\n get label() {\n return getProps().label;\n },\n get \"aria-label\"() {\n return getProps()[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return getProps()[\"aria-labelledby\"];\n },\n labelElementType: \"span\",\n });\n\n // Type-to-select\n const { typeSelectProps } = createTypeSelect({\n collection: () => state.collection(),\n focusedKey: () => state.focusedKey(),\n onFocusedKeyChange: (key) => state.setFocusedKey(key),\n isKeyDisabled: (key) => state.isDisabled(key),\n get isDisabled() {\n return getProps().disallowTypeAhead ?? false;\n },\n });\n\n // Keyboard navigation\n const onKeyDown: JSX.EventHandler<HTMLElement, KeyboardEvent> = (e) => {\n if (getProps().isDisabled) return;\n\n const collection = state.collection();\n const p = getProps();\n const wrap = p.shouldFocusWrap ?? false;\n\n // Disabled keys only block keyboard navigation under disabledBehavior \"all\"\n // (the default); under \"selection\" they stay focusable while their selection\n // remains blocked. Mirrors ListKeyboardDelegate.isDisabled in React Aria,\n // which gates the navigation skip on the resolved disabledBehavior.\n const isDisabled = (key: Key) => state.isDisabled(key) && state.disabledBehavior() === \"all\";\n\n switch (e.key) {\n case \"ArrowDown\": {\n // Only consume the key once a target exists, mirroring\n // useSelectableCollection (ArrowDown, 211-225): preventDefault is called\n // inside `if (nextKey != null)`, so at the last item without wrap the\n // arrow bubbles instead of being swallowed.\n const currentKey = state.focusedKey();\n const nextKey = findNextNonDisabledKey(collection, currentKey, \"next\", isDisabled, wrap);\n if (nextKey != null) {\n e.preventDefault();\n state.setFocusedKey(nextKey);\n }\n break;\n }\n case \"ArrowUp\": {\n const currentKey = state.focusedKey();\n const prevKey = findNextNonDisabledKey(collection, currentKey, \"prev\", isDisabled, wrap);\n if (prevKey != null) {\n e.preventDefault();\n state.setFocusedKey(prevKey);\n }\n break;\n }\n case \"Home\": {\n // Mirror useSelectableCollection (Home, 283-285): with nothing focused,\n // Shift+Home has no anchor to extend from, so leave the event alone.\n if (state.focusedKey() == null && e.shiftKey) break;\n e.preventDefault();\n // Find first non-disabled key\n let firstKey = collection.getFirstKey();\n while (firstKey != null && isDisabled(firstKey)) {\n firstKey = collection.getKeyAfter(firstKey);\n }\n if (firstKey != null) {\n state.setFocusedKey(firstKey);\n }\n break;\n }\n case \"End\": {\n // Mirror useSelectableCollection (End, 300-302): same anchor guard as Home.\n if (state.focusedKey() == null && e.shiftKey) break;\n e.preventDefault();\n // Find last non-disabled key\n let lastKey = collection.getLastKey();\n while (lastKey != null && isDisabled(lastKey)) {\n lastKey = collection.getKeyBefore(lastKey);\n }\n if (lastKey != null) {\n state.setFocusedKey(lastKey);\n }\n break;\n }\n case \" \":\n case \"Enter\": {\n if (e.target !== e.currentTarget) break;\n e.preventDefault();\n const focusedKey = state.focusedKey();\n // Activation is gated on the navigation-disabled check, not the raw\n // one: under disabledBehavior \"selection\" a focusable disabled item\n // still fires onAction (and closes), mirroring useSelectableItem's\n // allowsActions (manager.isDisabled is gated on \"all\"). Selection stays\n // blocked independently — state.select self-guards on the raw disabled\n // check (SelectionManager.canSelectItem).\n if (focusedKey != null && !isDisabled(focusedKey)) {\n // Route through the aria-layer onSelect so the platform-aware modifier\n // resolution (isCtrlKeyPressed / non-contiguous modifier) and the\n // shift-extend path are applied. Keyboard activation carries\n // pointerType \"keyboard\".\n selectItem(\n state,\n focusedKey,\n {\n pointerType: \"keyboard\",\n shiftKey: e.shiftKey,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n altKey: e.altKey,\n },\n collection,\n );\n // Pass the activated item's value as the second arg, mirroring\n // useMenuItem performAction: onAction(key, item?.value).\n p.onAction?.(focusedKey, collection.getItem(focusedKey)?.value as T);\n const item = collection.getItem(focusedKey);\n const isLink = !!item?.props?.href;\n const shouldClose =\n p.shouldCloseOnSelect ??\n (e.key === \"Enter\" || state.selectionMode() === \"none\" || isLink);\n if (shouldClose) {\n p.onClose?.();\n }\n }\n break;\n }\n case \"Escape\": {\n e.preventDefault();\n p.onClose?.();\n break;\n }\n case \"PageDown\": {\n // Mirror useSelectableCollection (PageDown, 324-332): only consume the\n // key when an item is focused. A non-empty collection always yields a\n // page target via getKeyPageBelow, so a focused key means focus moves\n // and the event is swallowed; with nothing focused, leave it alone to\n // bubble (e.g. to scroll an enclosing region).\n const currentKey = state.focusedKey();\n if (currentKey == null) break;\n e.preventDefault();\n const el = ref?.();\n\n if (el) {\n // Use DOM measurements to calculate how many items fit in a page\n const visibleHeight = el.clientHeight;\n let traveled = 0;\n let targetKey = currentKey;\n\n while (targetKey != null && traveled < visibleHeight) {\n const nextKey = collection.getKeyAfter(targetKey);\n if (nextKey == null) break;\n\n // Try to measure the item height\n const itemElement = el.querySelector(`[data-key=\"${targetKey}\"]`);\n traveled += itemElement?.clientHeight ?? 32;\n\n // Skip disabled items\n if (!isDisabled(nextKey)) {\n targetKey = nextKey;\n } else {\n // Skip over disabled items without counting them\n const afterDisabled = findNextNonDisabledKey(\n collection,\n nextKey,\n \"next\",\n isDisabled,\n false,\n );\n if (afterDisabled != null) {\n targetKey = afterDisabled;\n } else {\n break;\n }\n }\n }\n\n if (targetKey != null && targetKey !== currentKey) {\n state.setFocusedKey(targetKey);\n }\n } else {\n // Fallback: move by DEFAULT_PAGE_SIZE items\n let count = DEFAULT_PAGE_SIZE;\n let targetKey = currentKey;\n\n while (count > 0 && targetKey != null) {\n const nextKey = findNextNonDisabledKey(\n collection,\n targetKey,\n \"next\",\n isDisabled,\n false,\n );\n if (nextKey == null) break;\n targetKey = nextKey;\n count--;\n }\n\n if (targetKey != null) {\n state.setFocusedKey(targetKey);\n }\n }\n break;\n }\n case \"PageUp\": {\n // Mirror useSelectableCollection (PageUp, 333-341): only consume the key\n // when an item is focused. A non-empty collection always yields a page\n // target via getKeyPageAbove, so a focused key means focus moves and the\n // event is swallowed; with nothing focused, leave it alone to bubble\n // (e.g. to scroll an enclosing region).\n const currentKey = state.focusedKey();\n if (currentKey == null) break;\n e.preventDefault();\n const el = ref?.();\n\n if (el) {\n // Use DOM measurements to calculate how many items fit in a page\n const visibleHeight = el.clientHeight;\n let traveled = 0;\n let targetKey = currentKey;\n\n while (targetKey != null && traveled < visibleHeight) {\n const prevKey = collection.getKeyBefore(targetKey);\n if (prevKey == null) break;\n\n // Try to measure the item height\n const itemElement = el.querySelector(`[data-key=\"${targetKey}\"]`);\n traveled += itemElement?.clientHeight ?? 32;\n\n // Skip disabled items\n if (!isDisabled(prevKey)) {\n targetKey = prevKey;\n } else {\n // Skip over disabled items without counting them\n const beforeDisabled = findNextNonDisabledKey(\n collection,\n prevKey,\n \"prev\",\n isDisabled,\n false,\n );\n if (beforeDisabled != null) {\n targetKey = beforeDisabled;\n } else {\n break;\n }\n }\n }\n\n if (targetKey != null && targetKey !== currentKey) {\n state.setFocusedKey(targetKey);\n }\n } else {\n // Fallback: move by DEFAULT_PAGE_SIZE items\n let count = DEFAULT_PAGE_SIZE;\n let targetKey = currentKey;\n\n while (count > 0 && targetKey != null) {\n const prevKey = findNextNonDisabledKey(\n collection,\n targetKey,\n \"prev\",\n isDisabled,\n false,\n );\n if (prevKey == null) break;\n targetKey = prevKey;\n count--;\n }\n\n if (targetKey != null) {\n state.setFocusedKey(targetKey);\n }\n }\n break;\n }\n }\n };\n\n return {\n get labelProps() {\n return labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get menuProps() {\n const p = getProps();\n\n const baseProps = mergeProps(\n domProps(),\n focusWithinProps as Record<string, unknown>,\n fieldProps as Record<string, unknown>,\n {\n role: \"menu\",\n // Roving tabindex: the menu container is tab-reachable (0) only while no\n // item holds focus; once `focusedKey` is set the container drops to -1 so\n // Tab/Shift+Tab traverse past it and real focus stays on the item. This\n // mirrors upstream `useMenu`, which spreads `useSelectableList`'s\n // `listProps.tabIndex` (`manager.focusedKey == null ? 0 : -1`, non-virtual\n // focus) onto the menu.\n //\n // This MUST be a getter, not an eagerly-evaluated value. Consumers\n // (solidaria-components `Menu.tsx`) destructure `menuProps` once and\n // spread it through `mergeProps`; a plain `tabIndex: <value>` would be\n // computed at that first read (while `focusedKey` is still null → 0) and\n // frozen. As a getter it survives `mergeProps` (which preserves getters),\n // so the consumer's reactive element-spread re-reads `state.focusedKey()`\n // and the container tabindex tracks focus.\n get tabIndex() {\n return getProps().isDisabled ? undefined : state.focusedKey() == null ? 0 : -1;\n },\n \"aria-disabled\": p.isDisabled || undefined,\n onKeyDown,\n } as Record<string, unknown>,\n );\n\n // Add type-select props if enabled\n if (!p.disallowTypeAhead) {\n return mergeProps(\n baseProps,\n typeSelectProps as Record<string, unknown>,\n ) as JSX.HTMLAttributes<HTMLElement>;\n }\n\n return baseProps as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n}\n","/**\n * Provides the behavior and accessibility implementation for a menu item.\n * Based on @react-aria/menu useMenuItem.\n */\n\nimport { type JSX, type Accessor } from \"solid-js\";\nimport { createPress, type PressEvent } from \"../interactions/createPress\";\nimport { createHover } from \"../interactions/createHover\";\nimport { createFocusRing } from \"../interactions/createFocusRing\";\nimport { createSelectableItem } from \"../selection/createSelectableItem\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport { getEventTarget } from \"../utils/dom\";\nimport { isVirtualClick } from \"../utils/events\";\nimport { createSlotId } from \"../ssr\";\nimport { getMenuData } from \"./createMenu\";\nimport type { MenuState, Key, Selection, SelectionMode } from \"@proyecto-viviana/solid-stately\";\n\nexport interface AriaMenuItemProps {\n /** The unique key for the menu item. */\n key: Key;\n /** Optional DOM id for the menu item. Defaults to the key. */\n id?: string;\n /** Whether the menu item is disabled. */\n isDisabled?: boolean;\n /** An accessible label for the menu item. */\n \"aria-label\"?: string;\n /** Element controlled by this menu item, for submenu triggers. */\n \"aria-controls\"?: string;\n /** Whether this menu item opens a submenu or subdialog. */\n \"aria-haspopup\"?: string | boolean;\n /** Whether the submenu or subdialog is expanded. */\n \"aria-expanded\"?: boolean | \"true\" | \"false\";\n /** Handler called when the menu item is selected. */\n onAction?: () => void;\n /** Whether to close the menu when this item is selected. */\n closeOnSelect?: boolean;\n /** A URL to link to. Turns the menu item into a link. */\n href?: string;\n /** The target window for the link. */\n target?: string;\n /** The relationship between the linked resource and the current page. */\n rel?: string;\n /** Causes the browser to download the linked URL. A string may be provided to suggest a file name. */\n download?: boolean | string;\n}\n\nexport interface MenuItemAria {\n /** Props for the menu item element. */\n menuItemProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the label text inside the menu item. */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the description text inside the menu item. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the keyboard shortcut inside the menu item. */\n keyboardShortcutProps: JSX.HTMLAttributes<HTMLElement>;\n /** Whether the menu item is currently focused. */\n isFocused: Accessor<boolean>;\n /** Whether the menu item is keyboard focused. */\n isFocusVisible: Accessor<boolean>;\n /** Whether the menu item is currently pressed. */\n isPressed: Accessor<boolean>;\n /** Whether the menu item is disabled. */\n isDisabled: Accessor<boolean>;\n /** Whether the menu item is selected. */\n isSelected: Accessor<boolean>;\n /** The parent menu selection mode. */\n selectionMode: Accessor<SelectionMode>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu item.\n */\nexport function createMenuItem<T>(\n props: MaybeAccessor<AriaMenuItemProps>,\n state: MenuState<T>,\n ref?: () => HTMLElement | null,\n): MenuItemAria {\n const getProps = () => access(props);\n\n // Get shared data from menu\n const getData = () => getMenuData(state);\n\n // Computed states. `state.isDisabled` is SelectionManager.isDisabled, which\n // already respects disabledBehavior=\"selection\"; these items stay actionable\n // while SelectionManager.canSelectItem keeps selection blocked.\n const isDisabled: Accessor<boolean> = () => {\n return Boolean(\n getData()?.isDisabled || getProps().isDisabled || state.isDisabled(getProps().key),\n );\n };\n\n const selectionMode: Accessor<SelectionMode> = () => {\n return state.selectionMode();\n };\n\n // Whether this is a link item\n const isLink = () => !!getProps().href;\n const isTrigger = () => !!getProps()[\"aria-haspopup\"];\n\n const selectableItem = createSelectableItem(\n () => {\n const p = getProps();\n return {\n key: p.key,\n id: p.id ?? String(p.key),\n isDisabled: isDisabled(),\n isLink: isLink(),\n href: p.href,\n shouldSelectOnPressUp: true,\n allowsDifferentPressOrigin: true,\n linkBehavior: \"none\",\n };\n },\n state,\n () => ref?.() ?? null,\n );\n\n const isFocused: Accessor<boolean> = () => selectableItem.isFocused();\n\n const isSelected: Accessor<boolean> = () => {\n return !isTrigger() && selectableItem.isSelected();\n };\n\n type MenuInteraction = {\n pointerType: PressEvent[\"pointerType\"];\n key?: string;\n };\n\n let interaction: MenuInteraction | null = null;\n let isMenuPressActive = false;\n let isDispatchingKeyboardClick = false;\n let isDispatchingMenuSyntheticClick = false;\n let selectionEventBeforeMenuPressUp: Selection | null = null;\n let hasSelectionEventBeforeMenuPressUp = false;\n let pendingSyntheticClickSelectionEvent: Selection | null = null;\n let suppressNextKeyboardClick = false;\n\n const getShouldClose = (): boolean => {\n const p = getProps();\n const explicitClose = p.closeOnSelect ?? getData()?.shouldCloseOnSelect;\n if (explicitClose !== undefined) {\n return explicitClose;\n }\n\n if (interaction?.pointerType === \"keyboard\") {\n return interaction.key === \"Enter\" || selectionMode() === \"none\" || isLink();\n }\n\n return selectionMode() !== \"multiple\" || isLink();\n };\n\n const performMenuAction = (event: MouseEvent) => {\n if (isDisabled()) {\n event.preventDefault();\n return;\n }\n\n if (suppressNextKeyboardClick && interaction == null) {\n suppressNextKeyboardClick = false;\n return;\n }\n\n const p = getProps();\n const key = p.key;\n const data = getData();\n\n // Submenu triggers open their submenu via the local item action, but do not\n // fire the parent menu onAction or close the menu.\n if (isTrigger()) {\n p.onAction?.();\n interaction = null;\n return;\n }\n\n // Call item-specific onAction.\n p.onAction?.();\n\n // Call menu-level onAction with the activated item's value, mirroring\n // useMenuItem performAction: onAction(key, item?.value).\n const item = state.collection().getItem(key);\n data?.onAction?.(key, item?.value);\n\n if (getShouldClose()) {\n data?.onClose?.();\n }\n\n interaction = null;\n };\n\n // Menu-specific press handling is separate from selectable-item selection,\n // matching upstream useMenuItem: useSelectableItem owns selection/focus\n // timing; the menu layer owns pressed state, different-origin release, action,\n // links, and close behavior.\n const { pressProps, isPressed } = createPress({\n get isDisabled() {\n return isDisabled();\n },\n onPressChange(isPressed) {\n isMenuPressActive = isPressed;\n },\n onPressUp(e) {\n if (e.pointerType !== \"keyboard\" && !isDispatchingKeyboardClick) {\n interaction = { pointerType: e.pointerType };\n }\n\n // Native menus allow pressing the trigger, dragging to an item, and\n // releasing to activate it. Upstream useMenuItem synthesizes a click in\n // this different-origin mouse case.\n if (e.pointerType === \"mouse\" && !isMenuPressActive && e.target instanceof HTMLElement) {\n const selectionEventAfterPressUp = state.selectionManager.lastSelectionEvent;\n pendingSyntheticClickSelectionEvent =\n hasSelectionEventBeforeMenuPressUp &&\n selectionEventAfterPressUp != null &&\n selectionEventAfterPressUp !== selectionEventBeforeMenuPressUp\n ? selectionEventAfterPressUp\n : null;\n\n isDispatchingMenuSyntheticClick = true;\n try {\n e.target.click();\n } finally {\n isDispatchingMenuSyntheticClick = false;\n hasSelectionEventBeforeMenuPressUp = false;\n selectionEventBeforeMenuPressUp = null;\n pendingSyntheticClickSelectionEvent = null;\n }\n }\n },\n });\n\n const captureSelectionEventBeforeMenuPressUp = () => {\n selectionEventBeforeMenuPressUp = state.selectionManager.lastSelectionEvent;\n hasSelectionEventBeforeMenuPressUp = true;\n };\n\n const withMenuPressUpSelectionSnapshot = <EventType extends Event>(handler: unknown) => {\n if (typeof handler !== \"function\") {\n return handler;\n }\n\n return (event: EventType) => {\n captureSelectionEventBeforeMenuPressUp();\n (handler as (event: EventType) => void)(event);\n };\n };\n\n const selectableItemProps = () => {\n const props = selectableItem.itemProps as Record<string, unknown>;\n const onClick = props.onClick;\n\n return {\n ...props,\n onPointerUp: withMenuPressUpSelectionSnapshot<PointerEvent>(props.onPointerUp),\n onMouseUp: withMenuPressUpSelectionSnapshot<MouseEvent>(props.onMouseUp),\n onClick:\n typeof onClick === \"function\"\n ? (event: MouseEvent) => {\n // The menu layer's upstream-compatible target.click() should activate\n // the menu item, not feed back into selectable-item virtual selection.\n if (isDispatchingMenuSyntheticClick && isVirtualClick(event)) {\n if (pendingSyntheticClickSelectionEvent != null) {\n state.selectionManager.emitDuplicateSelectionEvent(\n pendingSyntheticClickSelectionEvent,\n );\n pendingSyntheticClickSelectionEvent = null;\n }\n return;\n }\n\n (onClick as (event: MouseEvent) => void)(event);\n }\n : onClick,\n };\n };\n\n const menuPressProps = () => {\n const {\n onKeyDown: _onKeyDown,\n onKeyUp: _onKeyUp,\n ...props\n } = pressProps as Record<string, unknown>;\n return props;\n };\n\n const keyboardProps = {\n onKeyDown: (event: KeyboardEvent) => {\n if (isDisabled() || event.repeat) {\n return;\n }\n\n if (event.key !== \" \" && event.key !== \"Enter\") {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n interaction = { pointerType: \"keyboard\", key: event.key };\n\n const target = getEventTarget<HTMLElement>(event) ?? ref?.();\n if (target instanceof HTMLElement) {\n suppressNextKeyboardClick = true;\n isDispatchingKeyboardClick = true;\n try {\n target.click();\n } finally {\n isDispatchingKeyboardClick = false;\n }\n }\n },\n onKeyUp: (event: KeyboardEvent) => {\n if (event.key === \" \" || event.key === \"Enter\") {\n suppressNextKeyboardClick = false;\n }\n },\n };\n\n // Handle hover\n const { hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n onHoverStart() {\n state.setFocusedKey(getProps().key);\n },\n });\n\n // Handle focus ring\n const { isFocusVisible, focusProps } = createFocusRing();\n\n // Generate unique IDs for label and description. The description + keyboard\n // ids use `createSlotId` (a 1:1 port of upstream `useSlotId`): each resolves\n // to `undefined` unless an element carrying that id is actually rendered, so\n // an item with no description/shortcut leaves `aria-describedby` unset instead\n // of pointing at a non-existent element. Mirrors useMenuItem's\n // `[props['aria-describedby'], descriptionId, keyboardId].filter(Boolean)`.\n const labelId = `${getProps().key}-label`;\n const descriptionId = createSlotId();\n const keyboardId = createSlotId();\n\n return {\n get menuItemProps() {\n const p = getProps();\n const key = p.key;\n const ariaLabel = p[\"aria-label\"];\n const mode = selectionMode();\n const selected = isSelected();\n const trigger = isTrigger();\n\n const baseProps: Record<string, unknown> = {\n role: trigger\n ? \"menuitem\"\n : mode === \"single\"\n ? \"menuitemradio\"\n : mode === \"multiple\"\n ? \"menuitemcheckbox\"\n : \"menuitem\",\n id: p.id ?? String(key),\n \"aria-disabled\": isDisabled() || undefined,\n \"aria-checked\": mode !== \"none\" && !trigger ? selected : undefined,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": !ariaLabel ? labelId : undefined,\n \"aria-describedby\": [descriptionId(), keyboardId()].filter(Boolean).join(\" \") || undefined,\n \"aria-controls\": p[\"aria-controls\"],\n \"aria-haspopup\": p[\"aria-haspopup\"],\n \"aria-expanded\": p[\"aria-expanded\"],\n \"data-selected\": selected || undefined,\n \"data-focused\": isFocused() || undefined,\n \"data-focus-visible\": isFocusVisible() || undefined,\n \"data-pressed\": isPressed() || undefined,\n \"data-disabled\": isDisabled() || undefined,\n };\n\n // Add link props when href is present\n if (isLink()) {\n baseProps.href = isDisabled() ? undefined : p.href;\n if (p.target) baseProps.target = p.target;\n if (p.rel) baseProps.rel = p.rel;\n if (p.download != null && p.download !== false) {\n baseProps.download = p.download === true ? \"\" : p.download;\n }\n }\n\n return mergeProps(\n selectableItemProps(),\n menuPressProps(),\n hoverProps as Record<string, unknown>,\n focusProps as Record<string, unknown>,\n keyboardProps,\n { onClick: performMenuAction },\n baseProps,\n ) as JSX.HTMLAttributes<HTMLElement>;\n },\n labelProps: {\n id: labelId,\n },\n // Getters so the slot id stays reactive: `createSlotId` may clear the id\n // (to `undefined`) after mount if no element registered it, and consumers\n // reading these props re-track that change.\n get descriptionProps() {\n return { id: descriptionId() };\n },\n get keyboardShortcutProps() {\n return { id: keyboardId(), \"aria-hidden\": true };\n },\n isFocused,\n isFocusVisible: () => isFocused() && isFocusVisible(),\n isPressed,\n isDisabled,\n isSelected,\n selectionMode,\n };\n}\n","/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n * Based on @react-aria/menu useMenuTrigger.\n */\n\nimport { type JSX } from \"solid-js\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport type { OverlayTriggerState } from \"@proyecto-viviana/solid-stately\";\n\nexport interface AriaMenuTriggerProps {\n /** The type of menu that the menu trigger opens. */\n type?: \"menu\" | \"listbox\";\n /** Whether the menu trigger is disabled. */\n isDisabled?: boolean;\n /** An ID for the menu. */\n id?: string;\n}\n\nexport interface MenuTriggerAria {\n /** Props for the menu trigger button. */\n menuTriggerProps: JSX.HTMLAttributes<HTMLElement> & {\n onPress: () => void;\n onKeyDown: (e: KeyboardEvent) => void;\n };\n /** Props for the menu element. */\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n */\nexport function createMenuTrigger(\n props: MaybeAccessor<AriaMenuTriggerProps>,\n state: OverlayTriggerState,\n): MenuTriggerAria {\n const getProps = () => access(props);\n const menuId = createId(getProps().id);\n\n const onPress = () => {\n if (!getProps().isDisabled) {\n state.toggle();\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (getProps().isDisabled) return;\n\n switch (e.key) {\n case \"Enter\":\n case \" \":\n case \"ArrowDown\": {\n e.preventDefault();\n if (!state.isOpen()) {\n state.open();\n }\n break;\n }\n case \"ArrowUp\": {\n e.preventDefault();\n if (!state.isOpen()) {\n state.open();\n }\n break;\n }\n }\n };\n\n return {\n get menuTriggerProps() {\n const p = getProps();\n const type = p.type ?? \"menu\";\n const isOpen = state.isOpen();\n\n return {\n \"aria-haspopup\": type,\n \"aria-expanded\": isOpen,\n \"aria-controls\": isOpen ? menuId : undefined,\n \"aria-disabled\": p.isDisabled || undefined,\n onPress,\n onKeyDown,\n };\n },\n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O;IACL,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB,SAAS,SAAS,KAAA;IACnC,iBAAiB,EAAE,cAAc,KAAA;IACjC;IACA;GACF;EACF;EACA,WAAW,EACT,IAAI,OACN;CACF;AACF"}
1
+ {"version":3,"file":"menu.jsx","names":["mergeProps","mergeProps"],"sources":["../../src/menu/createMenu.ts","../../src/menu/createMenuItem.ts","../../src/menu/createMenuTrigger.ts"],"sourcesContent":["/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n * Based on @react-aria/menu useMenu.\n */\n\nimport { createEffect, onCleanup, type JSX, type Accessor } from \"solid-js\";\nimport { createFocusWithin } from \"../interactions/createFocusWithin\";\nimport { createLabel } from \"../label/createLabel\";\nimport { createTypeSelect } from \"../selection/createTypeSelect\";\nimport { selectItem } from \"../selection/selectItem\";\nimport { filterDOMProps } from \"../utils/filterDOMProps\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport { isDevEnv } from \"../utils/env\";\nimport type { MenuState, Key, Collection } from \"@proyecto-viviana/solid-stately\";\n\n/**\n * Default number of items to skip for page up/down when DOM measurement is not available.\n */\nconst DEFAULT_PAGE_SIZE = 10;\n\n/**\n * Find the next non-disabled key in a collection.\n */\nfunction findNextNonDisabledKey<T>(\n collection: Collection<T>,\n currentKey: Key | null,\n direction: \"next\" | \"prev\",\n isDisabled: (key: Key) => boolean,\n wrap: boolean,\n): Key | null {\n const getNextKey =\n direction === \"next\"\n ? (key: Key) => collection.getKeyAfter(key)\n : (key: Key) => collection.getKeyBefore(key);\n\n const getFirstKey =\n direction === \"next\" ? () => collection.getFirstKey() : () => collection.getLastKey();\n\n let nextKey = currentKey != null ? getNextKey(currentKey) : getFirstKey();\n\n // Skip disabled keys\n while (nextKey != null && isDisabled(nextKey)) {\n nextKey = getNextKey(nextKey);\n }\n\n // If we've reached the end and wrapping is enabled\n if (nextKey == null && wrap) {\n nextKey = getFirstKey();\n // Skip disabled keys from the start\n while (nextKey != null && isDisabled(nextKey)) {\n nextKey = getNextKey(nextKey);\n }\n }\n\n return nextKey;\n}\n\nexport interface AriaMenuProps<T = unknown> {\n /** An ID for the menu. */\n id?: string;\n /** Whether the menu is disabled. */\n isDisabled?: boolean;\n /** The label for the menu. */\n label?: JSX.Element;\n /** An accessible label for the menu when no visible label is provided. */\n \"aria-label\"?: string;\n /** The ID of an element that labels the menu. */\n \"aria-labelledby\"?: string;\n /** The ID of an element that describes the menu. */\n \"aria-describedby\"?: string;\n /** Handler called when focus moves into the menu. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler called when focus moves out of the menu. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler called when the focus state changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Handler called when an item is activated (pressed). */\n onAction?: (key: Key, value: T) => void;\n /** Handler called when the menu should close. */\n onClose?: () => void;\n /** Whether the menu should close when an item is selected. */\n shouldCloseOnSelect?: boolean;\n /** Whether focus should automatically wrap around. */\n shouldFocusWrap?: boolean;\n /** Whether to auto-focus the first item when the menu opens. */\n autoFocus?: boolean | \"first\" | \"last\";\n /** Whether type-to-select is disabled. @default false */\n disallowTypeAhead?: boolean;\n}\n\nexport interface MenuAria {\n /** Props for the menu element. */\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the menu's label element (if any). */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n// Shared data between menu and menu items\nconst menuData = new WeakMap<object, MenuData>();\n\ninterface MenuData {\n id: string;\n // Type-erased like upstream menu/utils.ts MenuData (value: any): the WeakMap\n // is keyed by an untyped state, so the item value flows through as unknown.\n onAction?: (key: Key, value: unknown) => void;\n onClose?: () => void;\n isDisabled?: boolean;\n shouldCloseOnSelect?: boolean;\n}\n\nexport function getMenuData(state: MenuState): MenuData | undefined {\n return menuData.get(state);\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n */\nexport function createMenu<T>(\n props: MaybeAccessor<AriaMenuProps<T>>,\n state: MenuState<T>,\n ref?: Accessor<HTMLElement | null>,\n): MenuAria {\n const getProps = () => access(props);\n const id = createId(getProps().id);\n\n // Development-time warning for missing accessibility labels\n if (isDevEnv()) {\n const p = getProps();\n if (!p.label && !p[\"aria-label\"] && !p[\"aria-labelledby\"]) {\n console.warn(\n \"[solidaria] A Menu requires an aria-label or aria-labelledby attribute for accessibility.\",\n );\n }\n }\n\n // Filter DOM props\n const domProps = () =>\n filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true });\n\n const updateSharedData = () => {\n const p = getProps();\n menuData.set(state, {\n id,\n onAction: p.onAction as MenuData[\"onAction\"],\n onClose: p.onClose,\n isDisabled: p.isDisabled,\n shouldCloseOnSelect: p.shouldCloseOnSelect,\n });\n };\n\n // Ensure menu items created in the same render pass can read parent metadata.\n updateSharedData();\n\n // Share data with child menu items\n createEffect(() => {\n updateSharedData();\n\n onCleanup(() => {\n menuData.delete(state);\n });\n });\n\n // Handle focus within\n const { focusWithinProps } = createFocusWithin({\n onFocusWithin: (e) => getProps().onFocus?.(e),\n onBlurWithin: (e) => getProps().onBlur?.(e),\n onFocusWithinChange: (isFocused) => {\n getProps().onFocusChange?.(isFocused);\n state.setFocused(isFocused);\n },\n });\n\n // Label handling\n const { labelProps, fieldProps } = createLabel({\n get id() {\n return id;\n },\n get label() {\n return getProps().label;\n },\n get \"aria-label\"() {\n return getProps()[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return getProps()[\"aria-labelledby\"];\n },\n labelElementType: \"span\",\n });\n\n // Type-to-select\n const { typeSelectProps } = createTypeSelect({\n collection: () => state.collection(),\n focusedKey: () => state.focusedKey(),\n onFocusedKeyChange: (key) => state.setFocusedKey(key),\n isKeyDisabled: (key) => state.isDisabled(key),\n get isDisabled() {\n return getProps().disallowTypeAhead ?? false;\n },\n });\n\n // Keyboard navigation\n const onKeyDown: JSX.EventHandler<HTMLElement, KeyboardEvent> = (e) => {\n if (getProps().isDisabled) return;\n\n const collection = state.collection();\n const p = getProps();\n const wrap = p.shouldFocusWrap ?? false;\n\n // Disabled keys only block keyboard navigation under disabledBehavior \"all\"\n // (the default); under \"selection\" they stay focusable while their selection\n // remains blocked. Mirrors ListKeyboardDelegate.isDisabled in React Aria,\n // which gates the navigation skip on the resolved disabledBehavior.\n const isDisabled = (key: Key) => state.isDisabled(key) && state.disabledBehavior() === \"all\";\n\n switch (e.key) {\n case \"ArrowDown\": {\n // Only consume the key once a target exists, mirroring\n // useSelectableCollection (ArrowDown, 211-225): preventDefault is called\n // inside `if (nextKey != null)`, so at the last item without wrap the\n // arrow bubbles instead of being swallowed.\n const currentKey = state.focusedKey();\n const nextKey = findNextNonDisabledKey(collection, currentKey, \"next\", isDisabled, wrap);\n if (nextKey != null) {\n e.preventDefault();\n state.setFocusedKey(nextKey);\n }\n break;\n }\n case \"ArrowUp\": {\n const currentKey = state.focusedKey();\n const prevKey = findNextNonDisabledKey(collection, currentKey, \"prev\", isDisabled, wrap);\n if (prevKey != null) {\n e.preventDefault();\n state.setFocusedKey(prevKey);\n }\n break;\n }\n case \"Home\": {\n // Mirror useSelectableCollection (Home, 283-285): with nothing focused,\n // Shift+Home has no anchor to extend from, so leave the event alone.\n if (state.focusedKey() == null && e.shiftKey) break;\n e.preventDefault();\n // Find first non-disabled key\n let firstKey = collection.getFirstKey();\n while (firstKey != null && isDisabled(firstKey)) {\n firstKey = collection.getKeyAfter(firstKey);\n }\n if (firstKey != null) {\n state.setFocusedKey(firstKey);\n }\n break;\n }\n case \"End\": {\n // Mirror useSelectableCollection (End, 300-302): same anchor guard as Home.\n if (state.focusedKey() == null && e.shiftKey) break;\n e.preventDefault();\n // Find last non-disabled key\n let lastKey = collection.getLastKey();\n while (lastKey != null && isDisabled(lastKey)) {\n lastKey = collection.getKeyBefore(lastKey);\n }\n if (lastKey != null) {\n state.setFocusedKey(lastKey);\n }\n break;\n }\n case \" \":\n case \"Enter\": {\n if (e.target !== e.currentTarget) break;\n e.preventDefault();\n const focusedKey = state.focusedKey();\n // Activation is gated on the navigation-disabled check, not the raw\n // one: under disabledBehavior \"selection\" a focusable disabled item\n // still fires onAction (and closes), mirroring useSelectableItem's\n // allowsActions (manager.isDisabled is gated on \"all\"). Selection stays\n // blocked independently — state.select self-guards on the raw disabled\n // check (SelectionManager.canSelectItem).\n if (focusedKey != null && !isDisabled(focusedKey)) {\n // Route through the aria-layer onSelect so the platform-aware modifier\n // resolution (isCtrlKeyPressed / non-contiguous modifier) and the\n // shift-extend path are applied. Keyboard activation carries\n // pointerType \"keyboard\".\n selectItem(\n state,\n focusedKey,\n {\n pointerType: \"keyboard\",\n shiftKey: e.shiftKey,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n altKey: e.altKey,\n },\n collection,\n );\n // Pass the activated item's value as the second arg, mirroring\n // useMenuItem performAction: onAction(key, item?.value).\n p.onAction?.(focusedKey, collection.getItem(focusedKey)?.value as T);\n const item = collection.getItem(focusedKey);\n const isLink = !!item?.props?.href;\n const shouldClose =\n p.shouldCloseOnSelect ??\n (e.key === \"Enter\" || state.selectionMode() === \"none\" || isLink);\n if (shouldClose) {\n p.onClose?.();\n }\n }\n break;\n }\n case \"Escape\": {\n e.preventDefault();\n p.onClose?.();\n break;\n }\n case \"PageDown\": {\n // Mirror useSelectableCollection (PageDown, 324-332): only consume the\n // key when an item is focused. A non-empty collection always yields a\n // page target via getKeyPageBelow, so a focused key means focus moves\n // and the event is swallowed; with nothing focused, leave it alone to\n // bubble (e.g. to scroll an enclosing region).\n const currentKey = state.focusedKey();\n if (currentKey == null) break;\n e.preventDefault();\n const el = ref?.();\n\n if (el) {\n // Use DOM measurements to calculate how many items fit in a page\n const visibleHeight = el.clientHeight;\n let traveled = 0;\n let targetKey = currentKey;\n\n while (targetKey != null && traveled < visibleHeight) {\n const nextKey = collection.getKeyAfter(targetKey);\n if (nextKey == null) break;\n\n // Try to measure the item height\n const itemElement = el.querySelector(`[data-key=\"${targetKey}\"]`);\n traveled += itemElement?.clientHeight ?? 32;\n\n // Skip disabled items\n if (!isDisabled(nextKey)) {\n targetKey = nextKey;\n } else {\n // Skip over disabled items without counting them\n const afterDisabled = findNextNonDisabledKey(\n collection,\n nextKey,\n \"next\",\n isDisabled,\n false,\n );\n if (afterDisabled != null) {\n targetKey = afterDisabled;\n } else {\n break;\n }\n }\n }\n\n if (targetKey != null && targetKey !== currentKey) {\n state.setFocusedKey(targetKey);\n }\n } else {\n // Fallback: move by DEFAULT_PAGE_SIZE items\n let count = DEFAULT_PAGE_SIZE;\n let targetKey = currentKey;\n\n while (count > 0 && targetKey != null) {\n const nextKey = findNextNonDisabledKey(\n collection,\n targetKey,\n \"next\",\n isDisabled,\n false,\n );\n if (nextKey == null) break;\n targetKey = nextKey;\n count--;\n }\n\n if (targetKey != null) {\n state.setFocusedKey(targetKey);\n }\n }\n break;\n }\n case \"PageUp\": {\n // Mirror useSelectableCollection (PageUp, 333-341): only consume the key\n // when an item is focused. A non-empty collection always yields a page\n // target via getKeyPageAbove, so a focused key means focus moves and the\n // event is swallowed; with nothing focused, leave it alone to bubble\n // (e.g. to scroll an enclosing region).\n const currentKey = state.focusedKey();\n if (currentKey == null) break;\n e.preventDefault();\n const el = ref?.();\n\n if (el) {\n // Use DOM measurements to calculate how many items fit in a page\n const visibleHeight = el.clientHeight;\n let traveled = 0;\n let targetKey = currentKey;\n\n while (targetKey != null && traveled < visibleHeight) {\n const prevKey = collection.getKeyBefore(targetKey);\n if (prevKey == null) break;\n\n // Try to measure the item height\n const itemElement = el.querySelector(`[data-key=\"${targetKey}\"]`);\n traveled += itemElement?.clientHeight ?? 32;\n\n // Skip disabled items\n if (!isDisabled(prevKey)) {\n targetKey = prevKey;\n } else {\n // Skip over disabled items without counting them\n const beforeDisabled = findNextNonDisabledKey(\n collection,\n prevKey,\n \"prev\",\n isDisabled,\n false,\n );\n if (beforeDisabled != null) {\n targetKey = beforeDisabled;\n } else {\n break;\n }\n }\n }\n\n if (targetKey != null && targetKey !== currentKey) {\n state.setFocusedKey(targetKey);\n }\n } else {\n // Fallback: move by DEFAULT_PAGE_SIZE items\n let count = DEFAULT_PAGE_SIZE;\n let targetKey = currentKey;\n\n while (count > 0 && targetKey != null) {\n const prevKey = findNextNonDisabledKey(\n collection,\n targetKey,\n \"prev\",\n isDisabled,\n false,\n );\n if (prevKey == null) break;\n targetKey = prevKey;\n count--;\n }\n\n if (targetKey != null) {\n state.setFocusedKey(targetKey);\n }\n }\n break;\n }\n }\n };\n\n return {\n get labelProps() {\n return labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get menuProps() {\n const p = getProps();\n\n const baseProps = mergeProps(\n domProps(),\n focusWithinProps as Record<string, unknown>,\n fieldProps as Record<string, unknown>,\n {\n role: \"menu\",\n // Roving tabindex: the menu container is tab-reachable (0) only while no\n // item holds focus; once `focusedKey` is set the container drops to -1 so\n // Tab/Shift+Tab traverse past it and real focus stays on the item. This\n // mirrors upstream `useMenu`, which spreads `useSelectableList`'s\n // `listProps.tabIndex` (`manager.focusedKey == null ? 0 : -1`, non-virtual\n // focus) onto the menu.\n //\n // This MUST be a getter, not an eagerly-evaluated value. Consumers\n // (solidaria-components `Menu.tsx`) destructure `menuProps` once and\n // spread it through `mergeProps`; a plain `tabIndex: <value>` would be\n // computed at that first read (while `focusedKey` is still null → 0) and\n // frozen. As a getter it survives `mergeProps` (which preserves getters),\n // so the consumer's reactive element-spread re-reads `state.focusedKey()`\n // and the container tabindex tracks focus.\n get tabIndex() {\n return getProps().isDisabled ? undefined : state.focusedKey() == null ? 0 : -1;\n },\n \"aria-disabled\": p.isDisabled || undefined,\n onKeyDown,\n } as Record<string, unknown>,\n );\n\n // Add type-select props if enabled\n if (!p.disallowTypeAhead) {\n return mergeProps(\n baseProps,\n typeSelectProps as Record<string, unknown>,\n ) as JSX.HTMLAttributes<HTMLElement>;\n }\n\n return baseProps as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n}\n","/**\n * Provides the behavior and accessibility implementation for a menu item.\n * Based on @react-aria/menu useMenuItem.\n */\n\nimport { type JSX, type Accessor } from \"solid-js\";\nimport { createPress, type PressEvent } from \"../interactions/createPress\";\nimport { createHover } from \"../interactions/createHover\";\nimport { createFocusRing } from \"../interactions/createFocusRing\";\nimport { createSelectableItem } from \"../selection/createSelectableItem\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport { getEventTarget } from \"../utils/dom\";\nimport { isVirtualClick } from \"../utils/events\";\nimport { createSlotId } from \"../ssr\";\nimport { getMenuData } from \"./createMenu\";\nimport type { MenuState, Key, Selection, SelectionMode } from \"@proyecto-viviana/solid-stately\";\n\nexport interface AriaMenuItemProps {\n /** The unique key for the menu item. */\n key: Key;\n /** Optional DOM id for the menu item. Defaults to the key. */\n id?: string;\n /** Whether the menu item is disabled. */\n isDisabled?: boolean;\n /** An accessible label for the menu item. */\n \"aria-label\"?: string;\n /** Element controlled by this menu item, for submenu triggers. */\n \"aria-controls\"?: string;\n /** Whether this menu item opens a submenu or subdialog. */\n \"aria-haspopup\"?: string | boolean;\n /** Whether the submenu or subdialog is expanded. */\n \"aria-expanded\"?: boolean | \"true\" | \"false\";\n /** Handler called when the menu item is selected. */\n onAction?: () => void;\n /** Whether to close the menu when this item is selected. */\n closeOnSelect?: boolean;\n /** A URL to link to. Turns the menu item into a link. */\n href?: string;\n /** The target window for the link. */\n target?: string;\n /** The relationship between the linked resource and the current page. */\n rel?: string;\n /** Causes the browser to download the linked URL. A string may be provided to suggest a file name. */\n download?: boolean | string;\n}\n\nexport interface MenuItemAria {\n /** Props for the menu item element. */\n menuItemProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the label text inside the menu item. */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the description text inside the menu item. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the keyboard shortcut inside the menu item. */\n keyboardShortcutProps: JSX.HTMLAttributes<HTMLElement>;\n /** Whether the menu item is currently focused. */\n isFocused: Accessor<boolean>;\n /** Whether the menu item is keyboard focused. */\n isFocusVisible: Accessor<boolean>;\n /** Whether the menu item is currently pressed. */\n isPressed: Accessor<boolean>;\n /** Whether the menu item is disabled. */\n isDisabled: Accessor<boolean>;\n /** Whether the menu item is selected. */\n isSelected: Accessor<boolean>;\n /** The parent menu selection mode. */\n selectionMode: Accessor<SelectionMode>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu item.\n */\nexport function createMenuItem<T>(\n props: MaybeAccessor<AriaMenuItemProps>,\n state: MenuState<T>,\n ref?: () => HTMLElement | null,\n): MenuItemAria {\n const getProps = () => access(props);\n\n // Get shared data from menu\n const getData = () => getMenuData(state);\n\n // Computed states. `state.isDisabled` is SelectionManager.isDisabled, which\n // already respects disabledBehavior=\"selection\"; these items stay actionable\n // while SelectionManager.canSelectItem keeps selection blocked.\n const isDisabled: Accessor<boolean> = () => {\n return Boolean(\n getData()?.isDisabled || getProps().isDisabled || state.isDisabled(getProps().key),\n );\n };\n\n const selectionMode: Accessor<SelectionMode> = () => {\n return state.selectionMode();\n };\n\n // Whether this is a link item\n const isLink = () => !!getProps().href;\n const isTrigger = () => !!getProps()[\"aria-haspopup\"];\n\n const selectableItem = createSelectableItem(\n () => {\n const p = getProps();\n return {\n key: p.key,\n id: p.id ?? String(p.key),\n isDisabled: isDisabled(),\n isLink: isLink(),\n href: p.href,\n shouldSelectOnPressUp: true,\n allowsDifferentPressOrigin: true,\n linkBehavior: \"none\",\n };\n },\n state,\n () => ref?.() ?? null,\n );\n\n const isFocused: Accessor<boolean> = () => selectableItem.isFocused();\n\n const isSelected: Accessor<boolean> = () => {\n return !isTrigger() && selectableItem.isSelected();\n };\n\n type MenuInteraction = {\n pointerType: PressEvent[\"pointerType\"];\n key?: string;\n };\n\n let interaction: MenuInteraction | null = null;\n let isMenuPressActive = false;\n let isDispatchingKeyboardClick = false;\n let isDispatchingMenuSyntheticClick = false;\n let selectionEventBeforeMenuPressUp: Selection | null = null;\n let hasSelectionEventBeforeMenuPressUp = false;\n let pendingSyntheticClickSelectionEvent: Selection | null = null;\n let suppressNextKeyboardClick = false;\n\n const getShouldClose = (): boolean => {\n const p = getProps();\n const explicitClose = p.closeOnSelect ?? getData()?.shouldCloseOnSelect;\n if (explicitClose !== undefined) {\n return explicitClose;\n }\n\n if (interaction?.pointerType === \"keyboard\") {\n return interaction.key === \"Enter\" || selectionMode() === \"none\" || isLink();\n }\n\n return selectionMode() !== \"multiple\" || isLink();\n };\n\n const performMenuAction = (event: MouseEvent) => {\n if (isDisabled()) {\n event.preventDefault();\n return;\n }\n\n if (suppressNextKeyboardClick && interaction == null) {\n suppressNextKeyboardClick = false;\n return;\n }\n\n const p = getProps();\n const key = p.key;\n const data = getData();\n\n // Submenu triggers open their submenu via the local item action, but do not\n // fire the parent menu onAction or close the menu.\n if (isTrigger()) {\n p.onAction?.();\n interaction = null;\n return;\n }\n\n // Call item-specific onAction.\n p.onAction?.();\n\n // Call menu-level onAction with the activated item's value, mirroring\n // useMenuItem performAction: onAction(key, item?.value).\n const item = state.collection().getItem(key);\n data?.onAction?.(key, item?.value);\n\n if (getShouldClose()) {\n data?.onClose?.();\n }\n\n interaction = null;\n };\n\n // Menu-specific press handling is separate from selectable-item selection,\n // matching upstream useMenuItem: useSelectableItem owns selection/focus\n // timing; the menu layer owns pressed state, different-origin release, action,\n // links, and close behavior.\n const { pressProps, isPressed } = createPress({\n get isDisabled() {\n return isDisabled();\n },\n onPressChange(isPressed) {\n isMenuPressActive = isPressed;\n },\n onPressUp(e) {\n if (e.pointerType !== \"keyboard\" && !isDispatchingKeyboardClick) {\n interaction = { pointerType: e.pointerType };\n }\n\n // Native menus allow pressing the trigger, dragging to an item, and\n // releasing to activate it. Upstream useMenuItem synthesizes a click in\n // this different-origin mouse case.\n if (e.pointerType === \"mouse\" && !isMenuPressActive && e.target instanceof HTMLElement) {\n const selectionEventAfterPressUp = state.selectionManager.lastSelectionEvent;\n pendingSyntheticClickSelectionEvent =\n hasSelectionEventBeforeMenuPressUp &&\n selectionEventAfterPressUp != null &&\n selectionEventAfterPressUp !== selectionEventBeforeMenuPressUp\n ? selectionEventAfterPressUp\n : null;\n\n isDispatchingMenuSyntheticClick = true;\n try {\n e.target.click();\n } finally {\n isDispatchingMenuSyntheticClick = false;\n hasSelectionEventBeforeMenuPressUp = false;\n selectionEventBeforeMenuPressUp = null;\n pendingSyntheticClickSelectionEvent = null;\n }\n }\n },\n });\n\n const captureSelectionEventBeforeMenuPressUp = () => {\n selectionEventBeforeMenuPressUp = state.selectionManager.lastSelectionEvent;\n hasSelectionEventBeforeMenuPressUp = true;\n };\n\n const withMenuPressUpSelectionSnapshot = <EventType extends Event>(handler: unknown) => {\n if (typeof handler !== \"function\") {\n return handler;\n }\n\n return (event: EventType) => {\n captureSelectionEventBeforeMenuPressUp();\n (handler as (event: EventType) => void)(event);\n };\n };\n\n const selectableItemProps = () => {\n const props = selectableItem.itemProps as Record<string, unknown>;\n const onClick = props.onClick;\n\n return {\n ...props,\n onPointerUp: withMenuPressUpSelectionSnapshot<PointerEvent>(props.onPointerUp),\n onMouseUp: withMenuPressUpSelectionSnapshot<MouseEvent>(props.onMouseUp),\n onClick:\n typeof onClick === \"function\"\n ? (event: MouseEvent) => {\n // The menu layer's upstream-compatible target.click() should activate\n // the menu item, not feed back into selectable-item virtual selection.\n if (isDispatchingMenuSyntheticClick && isVirtualClick(event)) {\n if (pendingSyntheticClickSelectionEvent != null) {\n state.selectionManager.emitDuplicateSelectionEvent(\n pendingSyntheticClickSelectionEvent,\n );\n pendingSyntheticClickSelectionEvent = null;\n }\n return;\n }\n\n (onClick as (event: MouseEvent) => void)(event);\n }\n : onClick,\n };\n };\n\n const menuPressProps = () => {\n const {\n onKeyDown: _onKeyDown,\n onKeyUp: _onKeyUp,\n ...props\n } = pressProps as Record<string, unknown>;\n return props;\n };\n\n const keyboardProps = {\n onKeyDown: (event: KeyboardEvent) => {\n if (isDisabled() || event.repeat) {\n return;\n }\n\n if (event.key !== \" \" && event.key !== \"Enter\") {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n interaction = { pointerType: \"keyboard\", key: event.key };\n\n const target = getEventTarget<HTMLElement>(event) ?? ref?.();\n if (target instanceof HTMLElement) {\n suppressNextKeyboardClick = true;\n isDispatchingKeyboardClick = true;\n try {\n target.click();\n } finally {\n isDispatchingKeyboardClick = false;\n }\n }\n },\n onKeyUp: (event: KeyboardEvent) => {\n if (event.key === \" \" || event.key === \"Enter\") {\n suppressNextKeyboardClick = false;\n }\n },\n };\n\n // Handle hover\n const { hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n onHoverStart() {\n state.setFocusedKey(getProps().key);\n },\n });\n\n // Handle focus ring\n const { isFocusVisible, focusProps } = createFocusRing();\n\n // Generate unique IDs for label and description. The description + keyboard\n // ids use `createSlotId` (a 1:1 port of upstream `useSlotId`): each resolves\n // to `undefined` unless an element carrying that id is actually rendered, so\n // an item with no description/shortcut leaves `aria-describedby` unset instead\n // of pointing at a non-existent element. Mirrors useMenuItem's\n // `[props['aria-describedby'], descriptionId, keyboardId].filter(Boolean)`.\n const labelId = `${getProps().key}-label`;\n const descriptionId = createSlotId();\n const keyboardId = createSlotId();\n\n return {\n get menuItemProps() {\n const p = getProps();\n const key = p.key;\n const ariaLabel = p[\"aria-label\"];\n const mode = selectionMode();\n const selected = isSelected();\n const trigger = isTrigger();\n\n const baseProps: Record<string, unknown> = {\n role: trigger\n ? \"menuitem\"\n : mode === \"single\"\n ? \"menuitemradio\"\n : mode === \"multiple\"\n ? \"menuitemcheckbox\"\n : \"menuitem\",\n id: p.id ?? String(key),\n \"aria-disabled\": isDisabled() || undefined,\n \"aria-checked\": mode !== \"none\" && !trigger ? selected : undefined,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": !ariaLabel ? labelId : undefined,\n \"aria-describedby\": [descriptionId(), keyboardId()].filter(Boolean).join(\" \") || undefined,\n \"aria-controls\": p[\"aria-controls\"],\n \"aria-haspopup\": p[\"aria-haspopup\"],\n \"aria-expanded\": p[\"aria-expanded\"],\n \"data-selected\": selected || undefined,\n \"data-focused\": isFocused() || undefined,\n \"data-focus-visible\": isFocusVisible() || undefined,\n \"data-pressed\": isPressed() || undefined,\n \"data-disabled\": isDisabled() || undefined,\n };\n\n // Add link props when href is present\n if (isLink()) {\n baseProps.href = isDisabled() ? undefined : p.href;\n if (p.target) baseProps.target = p.target;\n if (p.rel) baseProps.rel = p.rel;\n if (p.download != null && p.download !== false) {\n baseProps.download = p.download === true ? \"\" : p.download;\n }\n }\n\n return mergeProps(\n selectableItemProps(),\n menuPressProps(),\n hoverProps as Record<string, unknown>,\n focusProps as Record<string, unknown>,\n keyboardProps,\n { onClick: performMenuAction },\n baseProps,\n ) as JSX.HTMLAttributes<HTMLElement>;\n },\n labelProps: {\n id: labelId,\n },\n // Getters so the slot id stays reactive: `createSlotId` may clear the id\n // (to `undefined`) after mount if no element registered it, and consumers\n // reading these props re-track that change.\n get descriptionProps() {\n return { id: descriptionId() };\n },\n get keyboardShortcutProps() {\n return { id: keyboardId(), \"aria-hidden\": true };\n },\n isFocused,\n isFocusVisible: () => isFocused() && isFocusVisible(),\n isPressed,\n isDisabled,\n isSelected,\n selectionMode,\n };\n}\n","/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n * Based on @react-aria/menu useMenuTrigger.\n */\n\nimport { type JSX } from \"solid-js\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport type { OverlayTriggerState } from \"@proyecto-viviana/solid-stately\";\n\nexport interface AriaMenuTriggerProps {\n /** The type of menu that the menu trigger opens. */\n type?: \"menu\" | \"listbox\";\n /** Whether the menu trigger is disabled. */\n isDisabled?: boolean;\n /** An ID for the menu. */\n id?: string;\n}\n\nexport interface MenuTriggerAria {\n /** Props for the menu trigger button. */\n menuTriggerProps: JSX.HTMLAttributes<HTMLElement> & {\n onPress: () => void;\n onKeyDown: (e: KeyboardEvent) => void;\n };\n /** Props for the menu element. */\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n */\nexport function createMenuTrigger(\n props: MaybeAccessor<AriaMenuTriggerProps>,\n state: OverlayTriggerState,\n): MenuTriggerAria {\n const getProps = () => access(props);\n const menuId = createId(getProps().id);\n\n const onPress = () => {\n if (!getProps().isDisabled) {\n state.toggle();\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (getProps().isDisabled) return;\n\n switch (e.key) {\n case \"Enter\":\n case \" \":\n case \"ArrowDown\": {\n e.preventDefault();\n if (!state.isOpen()) {\n state.open();\n }\n break;\n }\n case \"ArrowUp\": {\n e.preventDefault();\n if (!state.isOpen()) {\n state.open();\n }\n break;\n }\n }\n };\n\n return {\n get menuTriggerProps() {\n const p = getProps();\n const type = p.type ?? \"menu\";\n const isOpen = state.isOpen();\n\n return {\n \"aria-haspopup\": type,\n \"aria-expanded\": isOpen,\n \"aria-controls\": isOpen ? menuId : undefined,\n \"aria-disabled\": p.isDisabled || undefined,\n onPress,\n onKeyDown,\n };\n },\n menuProps: {\n id: menuId,\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,oBAAoB;;;;AAK1B,SAAS,uBACP,YACA,YACA,WACA,YACA,MACY;CACZ,MAAM,aACJ,cAAc,UACT,QAAa,WAAW,YAAY,GAAG,KACvC,QAAa,WAAW,aAAa,GAAG;CAE/C,MAAM,cACJ,cAAc,eAAe,WAAW,YAAY,UAAU,WAAW,WAAW;CAEtF,IAAI,UAAU,cAAc,OAAO,WAAW,UAAU,IAAI,YAAY;CAGxE,OAAO,WAAW,QAAQ,WAAW,OAAO,GAC1C,UAAU,WAAW,OAAO;CAI9B,IAAI,WAAW,QAAQ,MAAM;EAC3B,UAAU,YAAY;EAEtB,OAAO,WAAW,QAAQ,WAAW,OAAO,GAC1C,UAAU,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;GAC1B,OAAO;IAAE,IAAI,WAAW;IAAG,eAAe;GAAK;EACjD;EACA;EACA,sBAAsB,UAAU,KAAK,eAAe;EACpD;EACA;EACA;EACA;CACF;AACF;;;;;;AC5XA,SAAgB,kBACd,OACA,OACiB;CACjB,MAAM,iBAAiB,OAAO,KAAK;CACnC,MAAM,SAAS,SAAS,SAAS,CAAC,CAAC,EAAE;CAErC,MAAM,gBAAgB;EACpB,IAAI,CAAC,SAAS,CAAC,CAAC,YACd,MAAM,OAAO;CAEjB;CAEA,MAAM,aAAa,MAAqB;EACtC,IAAI,SAAS,CAAC,CAAC,YAAY;EAE3B,QAAQ,EAAE,KAAV;GACE,KAAK;GACL,KAAK;GACL,KAAK;IACH,EAAE,eAAe;IACjB,IAAI,CAAC,MAAM,OAAO,GAChB,MAAM,KAAK;IAEb;GAEF,KAAK;IACH,EAAE,eAAe;IACjB,IAAI,CAAC,MAAM,OAAO,GAChB,MAAM,KAAK;IAEb;EAEJ;CACF;CAEA,OAAO;EACL,IAAI,mBAAmB;GACrB,MAAM,IAAI,SAAS;GACnB,MAAM,OAAO,EAAE,QAAQ;GACvB,MAAM,SAAS,MAAM,OAAO;GAE5B,OAAO;IACL,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB,SAAS,SAAS,KAAA;IACnC,iBAAiB,EAAE,cAAc,KAAA;IACjC;IACA;GACF;EACF;EACA,WAAW,EACT,IAAI,OACN;CACF;AACF"}
@@ -1,5 +1,6 @@
1
- import { i as access, o as mergeProps } from "./env.js";
1
+ import { i as mergeProps$1 } from "./env.js";
2
2
  import { t as filterDOMProps } from "./filterDOMProps.js";
3
+ import { t as access } from "./reactivity.js";
3
4
  import { createId } from "../ssr/index.js";
4
5
  import { t as createLabel } from "./createLabel.js";
5
6
  import { createMemo } from "solid-js";
@@ -166,7 +167,7 @@ function createNumberField(props, state, inputRef) {
166
167
  const p = getProps();
167
168
  const isDisabled = p.isDisabled ?? state.isDisabled();
168
169
  const isReadOnly = p.isReadOnly ?? state.isReadOnly();
169
- return mergeProps(domProps(), fieldProps, {
170
+ return mergeProps$1(domProps(), fieldProps, {
170
171
  id: inputId,
171
172
  type: "text",
172
173
  inputMode: "decimal",
@@ -1 +1 @@
1
- {"version":3,"file":"numberfield.js","names":[],"sources":["../../src/numberfield/createNumberField.ts"],"sourcesContent":["/**\n * Provides the behavior and accessibility implementation for a number field.\n * Based on @react-aria/numberfield useNumberField.\n */\n\nimport { type JSX, createMemo } from \"solid-js\";\nimport { createLabel } from \"../label/createLabel\";\nimport { filterDOMProps } from \"../utils/filterDOMProps\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport type { NumberFieldState } from \"@proyecto-viviana/solid-stately\";\nimport type { AriaButtonProps } from \"../button/types\";\nimport type { PressEvent } from \"../interactions\";\n\nexport interface AriaNumberFieldProps {\n /** A label for the number field. */\n label?: JSX.Element;\n /** An accessible label for the number field. */\n \"aria-label\"?: string;\n /** The element ID that labels the number field. */\n \"aria-labelledby\"?: string;\n /** The element ID that describes the number field. */\n \"aria-describedby\"?: string;\n /** Whether the number field is disabled. */\n isDisabled?: boolean;\n /** Whether the number field is read-only. */\n isReadOnly?: boolean;\n /** Whether the number field is required. */\n isRequired?: boolean;\n /** Whether the number field is invalid. */\n isInvalid?: boolean;\n /** A description for the number field. */\n description?: JSX.Element;\n /** An error message for the number field. */\n errorMessage?: JSX.Element;\n /** The ID of the number field. */\n id?: string;\n /** Whether to auto-focus the input. */\n autoFocus?: boolean;\n /** The name for the form input. */\n name?: string;\n /** The form element this input belongs to. */\n form?: string;\n /** Handler for focus events. */\n onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent>;\n /** Handler for blur events. */\n onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent>;\n /** Handler called when focus state changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Handler for key down events. */\n onKeyDown?: JSX.EventHandler<HTMLInputElement, KeyboardEvent>;\n /** Handler for key up events. */\n onKeyUp?: JSX.EventHandler<HTMLInputElement, KeyboardEvent>;\n /** Handler for paste events. */\n onPaste?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n /** Handler for copy events. */\n onCopy?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n /** Handler for cut events. */\n onCut?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n}\n\nexport interface NumberFieldAria {\n /** Props for the label element. */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the input element group. */\n groupProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the input element. */\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n /** Props for the increment button. */\n incrementButtonProps: AriaButtonProps;\n /** Props for the decrement button. */\n decrementButtonProps: AriaButtonProps;\n /** Props for the description element. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the error message element. */\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a number field.\n */\nexport function createNumberField(\n props: MaybeAccessor<AriaNumberFieldProps>,\n state: NumberFieldState,\n inputRef?: () => HTMLInputElement | null,\n): NumberFieldAria {\n const getProps = () => access(props);\n const id = createId(getProps().id);\n\n // Generate IDs for associated elements\n const inputId = `${id}-input`;\n const incrementId = `${id}-increment`;\n const decrementId = `${id}-decrement`;\n const descriptionId = `${id}-description`;\n const errorMessageId = `${id}-error`;\n\n // Label handling\n const { labelProps, fieldProps } = createLabel({\n get id() {\n return inputId;\n },\n get label() {\n return getProps().label;\n },\n get \"aria-label\"() {\n return getProps()[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return getProps()[\"aria-labelledby\"];\n },\n // Upstream react-aria `useNumberField` → `useField` → `useLabel` with the DEFAULT\n // `labelElementType: 'label'`: the S2 NumberField label is a native `<label htmlFor>`\n // (verified against the shipped React DOM: `<label id for=inputId>`). This hardcoded\n // `\"span\"` was a self-inflicted divergence — it dropped the `for` association and made\n // `NumberFieldLabel` render a `<span>`. Reverted to `\"label\"` so `createLabel` emits\n // `for: inputId` (the input still also carries `aria-labelledby`, exactly as upstream).\n labelElementType: \"label\",\n });\n\n // Increment/decrement button labels — a 1:1 port of upstream `useNumberField`'s\n // four-case logic. Upstream RAC's `NumberField` component feeds `useNumberField` a\n // BOOLEAN slot for `label` (from `useSlot`), never the label string, so a visible\n // label is NEVER concatenated into the button `aria-label`. Instead: with a visible\n // label the button reads `aria-label: \"Increase\"` PLUS `aria-labelledby: \"<selfId>\n // <labelId>\"`; only an explicit `aria-label` (and no visible label) changes the text\n // (`\"Increase <aria-label>\"`). The prior `Increase ${getLabelText()}` was a\n // self-inflicted divergence that produced \"Increase Quantity\" where S2 ships\n // \"Increase\". `fieldLabel` mirrors upstream: `props['aria-label'] || ''` — the visible\n // label string is intentionally excluded (it arrives as a boolean slot in RAC).\n const fieldLabel = (): string => getProps()[\"aria-label\"] ?? \"\";\n const buttonLabelledBy = (): string | undefined => {\n if (fieldLabel()) return undefined;\n return getProps().label != null\n ? (labelProps.id as string | undefined)\n : getProps()[\"aria-labelledby\"];\n };\n\n // Filter DOM props\n const domProps = createMemo(() =>\n filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true }),\n );\n\n // Handle input change\n const onInputChange: JSX.EventHandler<HTMLInputElement, Event> = (e) => {\n const value = e.currentTarget.value;\n if (state.validate(value)) {\n state.setInputValue(value);\n }\n };\n\n // Handle input blur - commit value\n const onInputBlur: JSX.EventHandler<HTMLInputElement, FocusEvent> = (e) => {\n state.commit();\n const p = getProps();\n p.onBlur?.(e);\n p.onFocusChange?.(false);\n };\n\n const onInputFocus: JSX.EventHandler<HTMLInputElement, FocusEvent> = (e) => {\n const p = getProps();\n p.onFocus?.(e);\n p.onFocusChange?.(true);\n };\n\n // Handle keyboard events\n const onKeyDown: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (e) => {\n const p = getProps();\n if (p.isDisabled || p.isReadOnly) {\n p.onKeyDown?.(e);\n return;\n }\n\n switch (e.key) {\n case \"ArrowUp\":\n e.preventDefault();\n state.increment();\n break;\n case \"ArrowDown\":\n e.preventDefault();\n state.decrement();\n break;\n case \"PageUp\":\n e.preventDefault();\n state.incrementToMax();\n break;\n case \"PageDown\":\n e.preventDefault();\n state.decrementToMin();\n break;\n case \"Home\":\n e.preventDefault();\n state.decrementToMin();\n break;\n case \"End\":\n e.preventDefault();\n state.incrementToMax();\n break;\n case \"Enter\":\n state.commit();\n break;\n }\n\n p.onKeyDown?.(e);\n };\n\n const onKeyUp: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (e) => {\n getProps().onKeyUp?.(e);\n };\n\n const onButtonPressStart = (e: PressEvent) => {\n const input = inputRef?.();\n\n // Keep existing input focus in place. This avoids hiding software keyboards\n // and prevents a blur/refocus flicker when mouse pressing the steppers.\n if (input && input.ownerDocument.activeElement === input) {\n return;\n }\n\n if (e.pointerType === \"mouse\") {\n input?.focus();\n } else if (e.target instanceof HTMLElement) {\n e.target.focus();\n }\n };\n\n let incrementTouchPressUp = false;\n let decrementTouchPressUp = false;\n\n const onIncrementPressStart = (e: PressEvent) => {\n if (e.pointerType !== \"touch\") {\n state.increment();\n } else {\n incrementTouchPressUp = false;\n }\n\n onButtonPressStart(e);\n };\n\n const onIncrementPressUp = (e: PressEvent) => {\n if (e.pointerType === \"touch\") {\n incrementTouchPressUp = true;\n }\n };\n\n const onIncrementPressEnd = (e: PressEvent) => {\n if (e.pointerType === \"touch\" && incrementTouchPressUp) {\n state.increment();\n }\n\n incrementTouchPressUp = false;\n };\n const onIncrementClick = (e: MouseEvent) => {\n if (!state.canIncrement()) {\n e.preventDefault();\n return;\n }\n\n state.increment();\n inputRef?.()?.focus();\n };\n\n const onDecrementPressStart = (e: PressEvent) => {\n if (e.pointerType !== \"touch\") {\n state.decrement();\n } else {\n decrementTouchPressUp = false;\n }\n\n onButtonPressStart(e);\n };\n\n const onDecrementPressUp = (e: PressEvent) => {\n if (e.pointerType === \"touch\") {\n decrementTouchPressUp = true;\n }\n };\n\n const onDecrementPressEnd = (e: PressEvent) => {\n if (e.pointerType === \"touch\" && decrementTouchPressUp) {\n state.decrement();\n }\n\n decrementTouchPressUp = false;\n };\n const onDecrementClick = (e: MouseEvent) => {\n if (!state.canDecrement()) {\n e.preventDefault();\n return;\n }\n\n state.decrement();\n inputRef?.()?.focus();\n };\n\n // Build aria-describedby\n const getAriaDescribedBy = () => {\n const p = getProps();\n const parts: string[] = [];\n if (p[\"aria-describedby\"]) parts.push(p[\"aria-describedby\"]);\n if (p.description) parts.push(descriptionId);\n if (p.isInvalid && p.errorMessage) parts.push(errorMessageId);\n return parts.length > 0 ? parts.join(\" \") : undefined;\n };\n\n return {\n get labelProps() {\n return labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get groupProps() {\n return {\n role: \"group\",\n \"aria-disabled\": getProps().isDisabled || undefined,\n \"aria-invalid\": getProps().isInvalid || undefined,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n get inputProps() {\n const p = getProps();\n const isDisabled = p.isDisabled ?? state.isDisabled();\n const isReadOnly = p.isReadOnly ?? state.isReadOnly();\n\n return mergeProps(\n domProps(),\n fieldProps as Record<string, unknown>,\n {\n id: inputId,\n type: \"text\",\n inputMode: \"decimal\" as const,\n autoComplete: \"off\",\n autoCorrect: \"off\",\n spellcheck: false,\n // Upstream routes the input through useFormattedTextField → useTextField →\n // useFocusable, which \"always set[s] a tabIndex so that Safari allows\n // focusing native buttons and inputs\": `excludeFromTabOrder ? -1 : 0`, then\n // `undefined` when disabled. The input is never excluded, so the rendered\n // DOM carries `tabindex=\"0\"` (absent only when disabled). We hand-roll\n // inputProps (see the spinbutton-override note below) so we must replay that\n // one focusable prop here to stay byte-identical to React's tab order.\n tabIndex: isDisabled ? undefined : 0,\n // Upstream useNumberField wraps useSpinButton but deliberately\n // overrides its output: role=spinbutton can't be focused with\n // VoiceOver, so the input is a plain textbox (inside the role=group\n // wrapper above) and every aria-value* is dropped in favour of\n // aria-roledescription. The formatted value is still announced via the\n // input's own value. Mirror that contract instead of leaking the raw\n // spinbutton semantics.\n //\n // The string MUST match upstream's `stringFormatter.format('numberField')`,\n // whose en-US value is `Number field` (capitalised) — not a lowercase\n // hand-roll. Full locale routing via `createStringFormatter` (as\n // `createDateField` does) is tracked as `intl-roledescription-hardcodes`\n // (also covers the ColorArea/ColorSwatch English hardcodes); this keeps the\n // en-US roledescription byte-identical to React Spectrum in the meantime.\n \"aria-roledescription\": \"Number field\",\n \"aria-invalid\": p.isInvalid || undefined,\n \"aria-required\": p.isRequired || undefined,\n \"aria-describedby\": getAriaDescribedBy(),\n disabled: isDisabled || undefined,\n readOnly: isReadOnly || undefined,\n required: p.isRequired || undefined,\n value: state.inputValue(),\n onInput: onInputChange,\n onChange: onInputChange,\n onFocus: onInputFocus,\n onBlur: onInputBlur,\n onKeyDown,\n onKeyUp,\n onPaste: p.onPaste,\n onCopy: p.onCopy,\n onCut: p.onCut,\n name: p.name,\n form: p.form,\n autoFocus: p.autoFocus,\n } as Record<string, unknown>,\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n },\n get incrementButtonProps() {\n const labelledBy = buttonLabelledBy();\n return {\n id: incrementId,\n type: \"button\",\n \"aria-label\": `Increase ${fieldLabel()}`.trim(),\n \"aria-labelledby\": labelledBy ? `${incrementId} ${labelledBy}` : undefined,\n \"aria-controls\": inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n allowFocusWhenDisabled: true,\n get disabled() {\n return !state.canIncrement();\n },\n tabIndex: -1,\n get isDisabled() {\n return !state.canIncrement();\n },\n onClick: onIncrementClick,\n onPressStart: onIncrementPressStart,\n onPressUp: onIncrementPressUp,\n onPressEnd: onIncrementPressEnd,\n } as AriaButtonProps;\n },\n get decrementButtonProps() {\n const labelledBy = buttonLabelledBy();\n return {\n id: decrementId,\n type: \"button\",\n \"aria-label\": `Decrease ${fieldLabel()}`.trim(),\n \"aria-labelledby\": labelledBy ? `${decrementId} ${labelledBy}` : undefined,\n \"aria-controls\": inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n allowFocusWhenDisabled: true,\n get disabled() {\n return !state.canDecrement();\n },\n tabIndex: -1,\n get isDisabled() {\n return !state.canDecrement();\n },\n onClick: onDecrementClick,\n onPressStart: onDecrementPressStart,\n onPressUp: onDecrementPressUp,\n onPressEnd: onDecrementPressEnd,\n } as AriaButtonProps;\n },\n get descriptionProps() {\n return {\n id: descriptionId,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n get errorMessageProps() {\n return {\n id: errorMessageId,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAkFA,SAAgB,kBACd,OACA,OACA,UACiB;CACjB,MAAM,iBAAiB,OAAO,KAAK;CACnC,MAAM,KAAK,SAAS,SAAS,CAAC,CAAC,EAAE;CAGjC,MAAM,UAAU,GAAG,GAAG;CACtB,MAAM,cAAc,GAAG,GAAG;CAC1B,MAAM,cAAc,GAAG,GAAG;CAC1B,MAAM,gBAAgB,GAAG,GAAG;CAC5B,MAAM,iBAAiB,GAAG,GAAG;CAG7B,MAAM,EAAE,YAAY,eAAe,YAAY;EAC7C,IAAI,KAAK;GACP,OAAO;EACT;EACA,IAAI,QAAQ;GACV,OAAO,SAAS,CAAC,CAAC;EACpB;EACA,IAAI,eAAe;GACjB,OAAO,SAAS,CAAC,CAAC;EACpB;EACA,IAAI,oBAAoB;GACtB,OAAO,SAAS,CAAC,CAAC;EACpB;EAOA,kBAAkB;CACpB,CAAC;CAYD,MAAM,mBAA2B,SAAS,CAAC,CAAC,iBAAiB;CAC7D,MAAM,yBAA6C;EACjD,IAAI,WAAW,GAAG,OAAO,KAAA;EACzB,OAAO,SAAS,CAAC,CAAC,SAAS,OACtB,WAAW,KACZ,SAAS,CAAC,CAAC;CACjB;CAGA,MAAM,WAAW,iBACf,eAAe,SAAS,GAAyC,EAAE,WAAW,KAAK,CAAC,CACtF;CAGA,MAAM,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AAmB,aAAa,GAAG,YAAY,GAAG,eAAe,KAAA;IACjE,iBAAiB;IACjB,qBAAqB;IACrB,qBAAqB;IACrB,wBAAwB;IACxB,IAAI,WAAW;KACb,OAAO,CAAC,MAAM,aAAa;IAC7B;IACA,UAAU;IACV,IAAI,aAAa;KACf,OAAO,CAAC,MAAM,aAAa;IAC7B;IACA,SAAS;IACT,cAAc;IACd,WAAW;IACX,YAAY;GACd;EACF;EACA,IAAI,mBAAmB;GACrB,OAAO,EACL,IAAI,cACN;EACF;EACA,IAAI,oBAAoB;GACtB,OAAO,EACL,IAAI,eACN;EACF;CACF;AACF"}
1
+ {"version":3,"file":"numberfield.js","names":["mergeProps"],"sources":["../../src/numberfield/createNumberField.ts"],"sourcesContent":["/**\n * Provides the behavior and accessibility implementation for a number field.\n * Based on @react-aria/numberfield useNumberField.\n */\n\nimport { type JSX, createMemo } from \"solid-js\";\nimport { createLabel } from \"../label/createLabel\";\nimport { filterDOMProps } from \"../utils/filterDOMProps\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport type { NumberFieldState } from \"@proyecto-viviana/solid-stately\";\nimport type { AriaButtonProps } from \"../button/types\";\nimport type { PressEvent } from \"../interactions\";\n\nexport interface AriaNumberFieldProps {\n /** A label for the number field. */\n label?: JSX.Element;\n /** An accessible label for the number field. */\n \"aria-label\"?: string;\n /** The element ID that labels the number field. */\n \"aria-labelledby\"?: string;\n /** The element ID that describes the number field. */\n \"aria-describedby\"?: string;\n /** Whether the number field is disabled. */\n isDisabled?: boolean;\n /** Whether the number field is read-only. */\n isReadOnly?: boolean;\n /** Whether the number field is required. */\n isRequired?: boolean;\n /** Whether the number field is invalid. */\n isInvalid?: boolean;\n /** A description for the number field. */\n description?: JSX.Element;\n /** An error message for the number field. */\n errorMessage?: JSX.Element;\n /** The ID of the number field. */\n id?: string;\n /** Whether to auto-focus the input. */\n autoFocus?: boolean;\n /** The name for the form input. */\n name?: string;\n /** The form element this input belongs to. */\n form?: string;\n /** Handler for focus events. */\n onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent>;\n /** Handler for blur events. */\n onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent>;\n /** Handler called when focus state changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Handler for key down events. */\n onKeyDown?: JSX.EventHandler<HTMLInputElement, KeyboardEvent>;\n /** Handler for key up events. */\n onKeyUp?: JSX.EventHandler<HTMLInputElement, KeyboardEvent>;\n /** Handler for paste events. */\n onPaste?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n /** Handler for copy events. */\n onCopy?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n /** Handler for cut events. */\n onCut?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n}\n\nexport interface NumberFieldAria {\n /** Props for the label element. */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the input element group. */\n groupProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the input element. */\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n /** Props for the increment button. */\n incrementButtonProps: AriaButtonProps;\n /** Props for the decrement button. */\n decrementButtonProps: AriaButtonProps;\n /** Props for the description element. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the error message element. */\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a number field.\n */\nexport function createNumberField(\n props: MaybeAccessor<AriaNumberFieldProps>,\n state: NumberFieldState,\n inputRef?: () => HTMLInputElement | null,\n): NumberFieldAria {\n const getProps = () => access(props);\n const id = createId(getProps().id);\n\n // Generate IDs for associated elements\n const inputId = `${id}-input`;\n const incrementId = `${id}-increment`;\n const decrementId = `${id}-decrement`;\n const descriptionId = `${id}-description`;\n const errorMessageId = `${id}-error`;\n\n // Label handling\n const { labelProps, fieldProps } = createLabel({\n get id() {\n return inputId;\n },\n get label() {\n return getProps().label;\n },\n get \"aria-label\"() {\n return getProps()[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return getProps()[\"aria-labelledby\"];\n },\n // Upstream react-aria `useNumberField` → `useField` → `useLabel` with the DEFAULT\n // `labelElementType: 'label'`: the S2 NumberField label is a native `<label htmlFor>`\n // (verified against the shipped React DOM: `<label id for=inputId>`). This hardcoded\n // `\"span\"` was a self-inflicted divergence — it dropped the `for` association and made\n // `NumberFieldLabel` render a `<span>`. Reverted to `\"label\"` so `createLabel` emits\n // `for: inputId` (the input still also carries `aria-labelledby`, exactly as upstream).\n labelElementType: \"label\",\n });\n\n // Increment/decrement button labels — a 1:1 port of upstream `useNumberField`'s\n // four-case logic. Upstream RAC's `NumberField` component feeds `useNumberField` a\n // BOOLEAN slot for `label` (from `useSlot`), never the label string, so a visible\n // label is NEVER concatenated into the button `aria-label`. Instead: with a visible\n // label the button reads `aria-label: \"Increase\"` PLUS `aria-labelledby: \"<selfId>\n // <labelId>\"`; only an explicit `aria-label` (and no visible label) changes the text\n // (`\"Increase <aria-label>\"`). The prior `Increase ${getLabelText()}` was a\n // self-inflicted divergence that produced \"Increase Quantity\" where S2 ships\n // \"Increase\". `fieldLabel` mirrors upstream: `props['aria-label'] || ''` — the visible\n // label string is intentionally excluded (it arrives as a boolean slot in RAC).\n const fieldLabel = (): string => getProps()[\"aria-label\"] ?? \"\";\n const buttonLabelledBy = (): string | undefined => {\n if (fieldLabel()) return undefined;\n return getProps().label != null\n ? (labelProps.id as string | undefined)\n : getProps()[\"aria-labelledby\"];\n };\n\n // Filter DOM props\n const domProps = createMemo(() =>\n filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true }),\n );\n\n // Handle input change\n const onInputChange: JSX.EventHandler<HTMLInputElement, Event> = (e) => {\n const value = e.currentTarget.value;\n if (state.validate(value)) {\n state.setInputValue(value);\n }\n };\n\n // Handle input blur - commit value\n const onInputBlur: JSX.EventHandler<HTMLInputElement, FocusEvent> = (e) => {\n state.commit();\n const p = getProps();\n p.onBlur?.(e);\n p.onFocusChange?.(false);\n };\n\n const onInputFocus: JSX.EventHandler<HTMLInputElement, FocusEvent> = (e) => {\n const p = getProps();\n p.onFocus?.(e);\n p.onFocusChange?.(true);\n };\n\n // Handle keyboard events\n const onKeyDown: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (e) => {\n const p = getProps();\n if (p.isDisabled || p.isReadOnly) {\n p.onKeyDown?.(e);\n return;\n }\n\n switch (e.key) {\n case \"ArrowUp\":\n e.preventDefault();\n state.increment();\n break;\n case \"ArrowDown\":\n e.preventDefault();\n state.decrement();\n break;\n case \"PageUp\":\n e.preventDefault();\n state.incrementToMax();\n break;\n case \"PageDown\":\n e.preventDefault();\n state.decrementToMin();\n break;\n case \"Home\":\n e.preventDefault();\n state.decrementToMin();\n break;\n case \"End\":\n e.preventDefault();\n state.incrementToMax();\n break;\n case \"Enter\":\n state.commit();\n break;\n }\n\n p.onKeyDown?.(e);\n };\n\n const onKeyUp: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (e) => {\n getProps().onKeyUp?.(e);\n };\n\n const onButtonPressStart = (e: PressEvent) => {\n const input = inputRef?.();\n\n // Keep existing input focus in place. This avoids hiding software keyboards\n // and prevents a blur/refocus flicker when mouse pressing the steppers.\n if (input && input.ownerDocument.activeElement === input) {\n return;\n }\n\n if (e.pointerType === \"mouse\") {\n input?.focus();\n } else if (e.target instanceof HTMLElement) {\n e.target.focus();\n }\n };\n\n let incrementTouchPressUp = false;\n let decrementTouchPressUp = false;\n\n const onIncrementPressStart = (e: PressEvent) => {\n if (e.pointerType !== \"touch\") {\n state.increment();\n } else {\n incrementTouchPressUp = false;\n }\n\n onButtonPressStart(e);\n };\n\n const onIncrementPressUp = (e: PressEvent) => {\n if (e.pointerType === \"touch\") {\n incrementTouchPressUp = true;\n }\n };\n\n const onIncrementPressEnd = (e: PressEvent) => {\n if (e.pointerType === \"touch\" && incrementTouchPressUp) {\n state.increment();\n }\n\n incrementTouchPressUp = false;\n };\n const onIncrementClick = (e: MouseEvent) => {\n if (!state.canIncrement()) {\n e.preventDefault();\n return;\n }\n\n state.increment();\n inputRef?.()?.focus();\n };\n\n const onDecrementPressStart = (e: PressEvent) => {\n if (e.pointerType !== \"touch\") {\n state.decrement();\n } else {\n decrementTouchPressUp = false;\n }\n\n onButtonPressStart(e);\n };\n\n const onDecrementPressUp = (e: PressEvent) => {\n if (e.pointerType === \"touch\") {\n decrementTouchPressUp = true;\n }\n };\n\n const onDecrementPressEnd = (e: PressEvent) => {\n if (e.pointerType === \"touch\" && decrementTouchPressUp) {\n state.decrement();\n }\n\n decrementTouchPressUp = false;\n };\n const onDecrementClick = (e: MouseEvent) => {\n if (!state.canDecrement()) {\n e.preventDefault();\n return;\n }\n\n state.decrement();\n inputRef?.()?.focus();\n };\n\n // Build aria-describedby\n const getAriaDescribedBy = () => {\n const p = getProps();\n const parts: string[] = [];\n if (p[\"aria-describedby\"]) parts.push(p[\"aria-describedby\"]);\n if (p.description) parts.push(descriptionId);\n if (p.isInvalid && p.errorMessage) parts.push(errorMessageId);\n return parts.length > 0 ? parts.join(\" \") : undefined;\n };\n\n return {\n get labelProps() {\n return labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get groupProps() {\n return {\n role: \"group\",\n \"aria-disabled\": getProps().isDisabled || undefined,\n \"aria-invalid\": getProps().isInvalid || undefined,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n get inputProps() {\n const p = getProps();\n const isDisabled = p.isDisabled ?? state.isDisabled();\n const isReadOnly = p.isReadOnly ?? state.isReadOnly();\n\n return mergeProps(\n domProps(),\n fieldProps as Record<string, unknown>,\n {\n id: inputId,\n type: \"text\",\n inputMode: \"decimal\" as const,\n autoComplete: \"off\",\n autoCorrect: \"off\",\n spellcheck: false,\n // Upstream routes the input through useFormattedTextField → useTextField →\n // useFocusable, which \"always set[s] a tabIndex so that Safari allows\n // focusing native buttons and inputs\": `excludeFromTabOrder ? -1 : 0`, then\n // `undefined` when disabled. The input is never excluded, so the rendered\n // DOM carries `tabindex=\"0\"` (absent only when disabled). We hand-roll\n // inputProps (see the spinbutton-override note below) so we must replay that\n // one focusable prop here to stay byte-identical to React's tab order.\n tabIndex: isDisabled ? undefined : 0,\n // Upstream useNumberField wraps useSpinButton but deliberately\n // overrides its output: role=spinbutton can't be focused with\n // VoiceOver, so the input is a plain textbox (inside the role=group\n // wrapper above) and every aria-value* is dropped in favour of\n // aria-roledescription. The formatted value is still announced via the\n // input's own value. Mirror that contract instead of leaking the raw\n // spinbutton semantics.\n //\n // The string MUST match upstream's `stringFormatter.format('numberField')`,\n // whose en-US value is `Number field` (capitalised) — not a lowercase\n // hand-roll. Full locale routing via `createStringFormatter` (as\n // `createDateField` does) is tracked as `intl-roledescription-hardcodes`\n // (also covers the ColorArea/ColorSwatch English hardcodes); this keeps the\n // en-US roledescription byte-identical to React Spectrum in the meantime.\n \"aria-roledescription\": \"Number field\",\n \"aria-invalid\": p.isInvalid || undefined,\n \"aria-required\": p.isRequired || undefined,\n \"aria-describedby\": getAriaDescribedBy(),\n disabled: isDisabled || undefined,\n readOnly: isReadOnly || undefined,\n required: p.isRequired || undefined,\n value: state.inputValue(),\n onInput: onInputChange,\n onChange: onInputChange,\n onFocus: onInputFocus,\n onBlur: onInputBlur,\n onKeyDown,\n onKeyUp,\n onPaste: p.onPaste,\n onCopy: p.onCopy,\n onCut: p.onCut,\n name: p.name,\n form: p.form,\n autoFocus: p.autoFocus,\n } as Record<string, unknown>,\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n },\n get incrementButtonProps() {\n const labelledBy = buttonLabelledBy();\n return {\n id: incrementId,\n type: \"button\",\n \"aria-label\": `Increase ${fieldLabel()}`.trim(),\n \"aria-labelledby\": labelledBy ? `${incrementId} ${labelledBy}` : undefined,\n \"aria-controls\": inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n allowFocusWhenDisabled: true,\n get disabled() {\n return !state.canIncrement();\n },\n tabIndex: -1,\n get isDisabled() {\n return !state.canIncrement();\n },\n onClick: onIncrementClick,\n onPressStart: onIncrementPressStart,\n onPressUp: onIncrementPressUp,\n onPressEnd: onIncrementPressEnd,\n } as AriaButtonProps;\n },\n get decrementButtonProps() {\n const labelledBy = buttonLabelledBy();\n return {\n id: decrementId,\n type: \"button\",\n \"aria-label\": `Decrease ${fieldLabel()}`.trim(),\n \"aria-labelledby\": labelledBy ? `${decrementId} ${labelledBy}` : undefined,\n \"aria-controls\": inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n allowFocusWhenDisabled: true,\n get disabled() {\n return !state.canDecrement();\n },\n tabIndex: -1,\n get isDisabled() {\n return !state.canDecrement();\n },\n onClick: onDecrementClick,\n onPressStart: onDecrementPressStart,\n onPressUp: onDecrementPressUp,\n onPressEnd: onDecrementPressEnd,\n } as AriaButtonProps;\n },\n get descriptionProps() {\n return {\n id: descriptionId,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n get errorMessageProps() {\n return {\n id: errorMessageId,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAkFA,SAAgB,kBACd,OACA,OACA,UACiB;CACjB,MAAM,iBAAiB,OAAO,KAAK;CACnC,MAAM,KAAK,SAAS,SAAS,CAAC,CAAC,EAAE;CAGjC,MAAM,UAAU,GAAG,GAAG;CACtB,MAAM,cAAc,GAAG,GAAG;CAC1B,MAAM,cAAc,GAAG,GAAG;CAC1B,MAAM,gBAAgB,GAAG,GAAG;CAC5B,MAAM,iBAAiB,GAAG,GAAG;CAG7B,MAAM,EAAE,YAAY,eAAe,YAAY;EAC7C,IAAI,KAAK;GACP,OAAO;EACT;EACA,IAAI,QAAQ;GACV,OAAO,SAAS,CAAC,CAAC;EACpB;EACA,IAAI,eAAe;GACjB,OAAO,SAAS,CAAC,CAAC;EACpB;EACA,IAAI,oBAAoB;GACtB,OAAO,SAAS,CAAC,CAAC;EACpB;EAOA,kBAAkB;CACpB,CAAC;CAYD,M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,MAAM,aAAa;IAC7B;IACA,UAAU;IACV,IAAI,aAAa;KACf,OAAO,CAAC,MAAM,aAAa;IAC7B;IACA,SAAS;IACT,cAAc;IACd,WAAW;IACX,YAAY;GACd;EACF;EACA,IAAI,uBAAuB;GACzB,MAAM,aAAa,iBAAiB;GACpC,OAAO;IACL,IAAI;IACJ,MAAM;IACN,cAAc,YAAY,WAAW,IAAI,KAAK;IAC9C,mBAAmB,aAAa,GAAG,YAAY,GAAG,eAAe,KAAA;IACjE,iBAAiB;IACjB,qBAAqB;IACrB,qBAAqB;IACrB,wBAAwB;IACxB,IAAI,WAAW;KACb,OAAO,CAAC,MAAM,aAAa;IAC7B;IACA,UAAU;IACV,IAAI,aAAa;KACf,OAAO,CAAC,MAAM,aAAa;IAC7B;IACA,SAAS;IACT,cAAc;IACd,WAAW;IACX,YAAY;GACd;EACF;EACA,IAAI,mBAAmB;GACrB,OAAO,EACL,IAAI,cACN;EACF;EACA,IAAI,oBAAoB;GACtB,OAAO,EACL,IAAI,eACN;EACF;CACF;AACF"}
@@ -1,5 +1,6 @@
1
- import { i as access, o as mergeProps } from "./env.jsx";
1
+ import { i as mergeProps$1 } from "./env.jsx";
2
2
  import { t as filterDOMProps } from "./filterDOMProps.jsx";
3
+ import { t as access } from "./reactivity.jsx";
3
4
  import { createId } from "../ssr/index.jsx";
4
5
  import { t as createLabel } from "./createLabel.jsx";
5
6
  import { createMemo } from "solid-js";
@@ -166,7 +167,7 @@ function createNumberField(props, state, inputRef) {
166
167
  const p = getProps();
167
168
  const isDisabled = p.isDisabled ?? state.isDisabled();
168
169
  const isReadOnly = p.isReadOnly ?? state.isReadOnly();
169
- return mergeProps(domProps(), fieldProps, {
170
+ return mergeProps$1(domProps(), fieldProps, {
170
171
  id: inputId,
171
172
  type: "text",
172
173
  inputMode: "decimal",
@@ -1 +1 @@
1
- {"version":3,"file":"numberfield.jsx","names":[],"sources":["../../src/numberfield/createNumberField.ts"],"sourcesContent":["/**\n * Provides the behavior and accessibility implementation for a number field.\n * Based on @react-aria/numberfield useNumberField.\n */\n\nimport { type JSX, createMemo } from \"solid-js\";\nimport { createLabel } from \"../label/createLabel\";\nimport { filterDOMProps } from \"../utils/filterDOMProps\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport type { NumberFieldState } from \"@proyecto-viviana/solid-stately\";\nimport type { AriaButtonProps } from \"../button/types\";\nimport type { PressEvent } from \"../interactions\";\n\nexport interface AriaNumberFieldProps {\n /** A label for the number field. */\n label?: JSX.Element;\n /** An accessible label for the number field. */\n \"aria-label\"?: string;\n /** The element ID that labels the number field. */\n \"aria-labelledby\"?: string;\n /** The element ID that describes the number field. */\n \"aria-describedby\"?: string;\n /** Whether the number field is disabled. */\n isDisabled?: boolean;\n /** Whether the number field is read-only. */\n isReadOnly?: boolean;\n /** Whether the number field is required. */\n isRequired?: boolean;\n /** Whether the number field is invalid. */\n isInvalid?: boolean;\n /** A description for the number field. */\n description?: JSX.Element;\n /** An error message for the number field. */\n errorMessage?: JSX.Element;\n /** The ID of the number field. */\n id?: string;\n /** Whether to auto-focus the input. */\n autoFocus?: boolean;\n /** The name for the form input. */\n name?: string;\n /** The form element this input belongs to. */\n form?: string;\n /** Handler for focus events. */\n onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent>;\n /** Handler for blur events. */\n onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent>;\n /** Handler called when focus state changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Handler for key down events. */\n onKeyDown?: JSX.EventHandler<HTMLInputElement, KeyboardEvent>;\n /** Handler for key up events. */\n onKeyUp?: JSX.EventHandler<HTMLInputElement, KeyboardEvent>;\n /** Handler for paste events. */\n onPaste?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n /** Handler for copy events. */\n onCopy?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n /** Handler for cut events. */\n onCut?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n}\n\nexport interface NumberFieldAria {\n /** Props for the label element. */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the input element group. */\n groupProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the input element. */\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n /** Props for the increment button. */\n incrementButtonProps: AriaButtonProps;\n /** Props for the decrement button. */\n decrementButtonProps: AriaButtonProps;\n /** Props for the description element. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the error message element. */\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a number field.\n */\nexport function createNumberField(\n props: MaybeAccessor<AriaNumberFieldProps>,\n state: NumberFieldState,\n inputRef?: () => HTMLInputElement | null,\n): NumberFieldAria {\n const getProps = () => access(props);\n const id = createId(getProps().id);\n\n // Generate IDs for associated elements\n const inputId = `${id}-input`;\n const incrementId = `${id}-increment`;\n const decrementId = `${id}-decrement`;\n const descriptionId = `${id}-description`;\n const errorMessageId = `${id}-error`;\n\n // Label handling\n const { labelProps, fieldProps } = createLabel({\n get id() {\n return inputId;\n },\n get label() {\n return getProps().label;\n },\n get \"aria-label\"() {\n return getProps()[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return getProps()[\"aria-labelledby\"];\n },\n // Upstream react-aria `useNumberField` → `useField` → `useLabel` with the DEFAULT\n // `labelElementType: 'label'`: the S2 NumberField label is a native `<label htmlFor>`\n // (verified against the shipped React DOM: `<label id for=inputId>`). This hardcoded\n // `\"span\"` was a self-inflicted divergence — it dropped the `for` association and made\n // `NumberFieldLabel` render a `<span>`. Reverted to `\"label\"` so `createLabel` emits\n // `for: inputId` (the input still also carries `aria-labelledby`, exactly as upstream).\n labelElementType: \"label\",\n });\n\n // Increment/decrement button labels — a 1:1 port of upstream `useNumberField`'s\n // four-case logic. Upstream RAC's `NumberField` component feeds `useNumberField` a\n // BOOLEAN slot for `label` (from `useSlot`), never the label string, so a visible\n // label is NEVER concatenated into the button `aria-label`. Instead: with a visible\n // label the button reads `aria-label: \"Increase\"` PLUS `aria-labelledby: \"<selfId>\n // <labelId>\"`; only an explicit `aria-label` (and no visible label) changes the text\n // (`\"Increase <aria-label>\"`). The prior `Increase ${getLabelText()}` was a\n // self-inflicted divergence that produced \"Increase Quantity\" where S2 ships\n // \"Increase\". `fieldLabel` mirrors upstream: `props['aria-label'] || ''` — the visible\n // label string is intentionally excluded (it arrives as a boolean slot in RAC).\n const fieldLabel = (): string => getProps()[\"aria-label\"] ?? \"\";\n const buttonLabelledBy = (): string | undefined => {\n if (fieldLabel()) return undefined;\n return getProps().label != null\n ? (labelProps.id as string | undefined)\n : getProps()[\"aria-labelledby\"];\n };\n\n // Filter DOM props\n const domProps = createMemo(() =>\n filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true }),\n );\n\n // Handle input change\n const onInputChange: JSX.EventHandler<HTMLInputElement, Event> = (e) => {\n const value = e.currentTarget.value;\n if (state.validate(value)) {\n state.setInputValue(value);\n }\n };\n\n // Handle input blur - commit value\n const onInputBlur: JSX.EventHandler<HTMLInputElement, FocusEvent> = (e) => {\n state.commit();\n const p = getProps();\n p.onBlur?.(e);\n p.onFocusChange?.(false);\n };\n\n const onInputFocus: JSX.EventHandler<HTMLInputElement, FocusEvent> = (e) => {\n const p = getProps();\n p.onFocus?.(e);\n p.onFocusChange?.(true);\n };\n\n // Handle keyboard events\n const onKeyDown: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (e) => {\n const p = getProps();\n if (p.isDisabled || p.isReadOnly) {\n p.onKeyDown?.(e);\n return;\n }\n\n switch (e.key) {\n case \"ArrowUp\":\n e.preventDefault();\n state.increment();\n break;\n case \"ArrowDown\":\n e.preventDefault();\n state.decrement();\n break;\n case \"PageUp\":\n e.preventDefault();\n state.incrementToMax();\n break;\n case \"PageDown\":\n e.preventDefault();\n state.decrementToMin();\n break;\n case \"Home\":\n e.preventDefault();\n state.decrementToMin();\n break;\n case \"End\":\n e.preventDefault();\n state.incrementToMax();\n break;\n case \"Enter\":\n state.commit();\n break;\n }\n\n p.onKeyDown?.(e);\n };\n\n const onKeyUp: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (e) => {\n getProps().onKeyUp?.(e);\n };\n\n const onButtonPressStart = (e: PressEvent) => {\n const input = inputRef?.();\n\n // Keep existing input focus in place. This avoids hiding software keyboards\n // and prevents a blur/refocus flicker when mouse pressing the steppers.\n if (input && input.ownerDocument.activeElement === input) {\n return;\n }\n\n if (e.pointerType === \"mouse\") {\n input?.focus();\n } else if (e.target instanceof HTMLElement) {\n e.target.focus();\n }\n };\n\n let incrementTouchPressUp = false;\n let decrementTouchPressUp = false;\n\n const onIncrementPressStart = (e: PressEvent) => {\n if (e.pointerType !== \"touch\") {\n state.increment();\n } else {\n incrementTouchPressUp = false;\n }\n\n onButtonPressStart(e);\n };\n\n const onIncrementPressUp = (e: PressEvent) => {\n if (e.pointerType === \"touch\") {\n incrementTouchPressUp = true;\n }\n };\n\n const onIncrementPressEnd = (e: PressEvent) => {\n if (e.pointerType === \"touch\" && incrementTouchPressUp) {\n state.increment();\n }\n\n incrementTouchPressUp = false;\n };\n const onIncrementClick = (e: MouseEvent) => {\n if (!state.canIncrement()) {\n e.preventDefault();\n return;\n }\n\n state.increment();\n inputRef?.()?.focus();\n };\n\n const onDecrementPressStart = (e: PressEvent) => {\n if (e.pointerType !== \"touch\") {\n state.decrement();\n } else {\n decrementTouchPressUp = false;\n }\n\n onButtonPressStart(e);\n };\n\n const onDecrementPressUp = (e: PressEvent) => {\n if (e.pointerType === \"touch\") {\n decrementTouchPressUp = true;\n }\n };\n\n const onDecrementPressEnd = (e: PressEvent) => {\n if (e.pointerType === \"touch\" && decrementTouchPressUp) {\n state.decrement();\n }\n\n decrementTouchPressUp = false;\n };\n const onDecrementClick = (e: MouseEvent) => {\n if (!state.canDecrement()) {\n e.preventDefault();\n return;\n }\n\n state.decrement();\n inputRef?.()?.focus();\n };\n\n // Build aria-describedby\n const getAriaDescribedBy = () => {\n const p = getProps();\n const parts: string[] = [];\n if (p[\"aria-describedby\"]) parts.push(p[\"aria-describedby\"]);\n if (p.description) parts.push(descriptionId);\n if (p.isInvalid && p.errorMessage) parts.push(errorMessageId);\n return parts.length > 0 ? parts.join(\" \") : undefined;\n };\n\n return {\n get labelProps() {\n return labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get groupProps() {\n return {\n role: \"group\",\n \"aria-disabled\": getProps().isDisabled || undefined,\n \"aria-invalid\": getProps().isInvalid || undefined,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n get inputProps() {\n const p = getProps();\n const isDisabled = p.isDisabled ?? state.isDisabled();\n const isReadOnly = p.isReadOnly ?? state.isReadOnly();\n\n return mergeProps(\n domProps(),\n fieldProps as Record<string, unknown>,\n {\n id: inputId,\n type: \"text\",\n inputMode: \"decimal\" as const,\n autoComplete: \"off\",\n autoCorrect: \"off\",\n spellcheck: false,\n // Upstream routes the input through useFormattedTextField → useTextField →\n // useFocusable, which \"always set[s] a tabIndex so that Safari allows\n // focusing native buttons and inputs\": `excludeFromTabOrder ? -1 : 0`, then\n // `undefined` when disabled. The input is never excluded, so the rendered\n // DOM carries `tabindex=\"0\"` (absent only when disabled). We hand-roll\n // inputProps (see the spinbutton-override note below) so we must replay that\n // one focusable prop here to stay byte-identical to React's tab order.\n tabIndex: isDisabled ? undefined : 0,\n // Upstream useNumberField wraps useSpinButton but deliberately\n // overrides its output: role=spinbutton can't be focused with\n // VoiceOver, so the input is a plain textbox (inside the role=group\n // wrapper above) and every aria-value* is dropped in favour of\n // aria-roledescription. The formatted value is still announced via the\n // input's own value. Mirror that contract instead of leaking the raw\n // spinbutton semantics.\n //\n // The string MUST match upstream's `stringFormatter.format('numberField')`,\n // whose en-US value is `Number field` (capitalised) — not a lowercase\n // hand-roll. Full locale routing via `createStringFormatter` (as\n // `createDateField` does) is tracked as `intl-roledescription-hardcodes`\n // (also covers the ColorArea/ColorSwatch English hardcodes); this keeps the\n // en-US roledescription byte-identical to React Spectrum in the meantime.\n \"aria-roledescription\": \"Number field\",\n \"aria-invalid\": p.isInvalid || undefined,\n \"aria-required\": p.isRequired || undefined,\n \"aria-describedby\": getAriaDescribedBy(),\n disabled: isDisabled || undefined,\n readOnly: isReadOnly || undefined,\n required: p.isRequired || undefined,\n value: state.inputValue(),\n onInput: onInputChange,\n onChange: onInputChange,\n onFocus: onInputFocus,\n onBlur: onInputBlur,\n onKeyDown,\n onKeyUp,\n onPaste: p.onPaste,\n onCopy: p.onCopy,\n onCut: p.onCut,\n name: p.name,\n form: p.form,\n autoFocus: p.autoFocus,\n } as Record<string, unknown>,\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n },\n get incrementButtonProps() {\n const labelledBy = buttonLabelledBy();\n return {\n id: incrementId,\n type: \"button\",\n \"aria-label\": `Increase ${fieldLabel()}`.trim(),\n \"aria-labelledby\": labelledBy ? `${incrementId} ${labelledBy}` : undefined,\n \"aria-controls\": inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n allowFocusWhenDisabled: true,\n get disabled() {\n return !state.canIncrement();\n },\n tabIndex: -1,\n get isDisabled() {\n return !state.canIncrement();\n },\n onClick: onIncrementClick,\n onPressStart: onIncrementPressStart,\n onPressUp: onIncrementPressUp,\n onPressEnd: onIncrementPressEnd,\n } as AriaButtonProps;\n },\n get decrementButtonProps() {\n const labelledBy = buttonLabelledBy();\n return {\n id: decrementId,\n type: \"button\",\n \"aria-label\": `Decrease ${fieldLabel()}`.trim(),\n \"aria-labelledby\": labelledBy ? `${decrementId} ${labelledBy}` : undefined,\n \"aria-controls\": inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n allowFocusWhenDisabled: true,\n get disabled() {\n return !state.canDecrement();\n },\n tabIndex: -1,\n get isDisabled() {\n return !state.canDecrement();\n },\n onClick: onDecrementClick,\n onPressStart: onDecrementPressStart,\n onPressUp: onDecrementPressUp,\n onPressEnd: onDecrementPressEnd,\n } as AriaButtonProps;\n },\n get descriptionProps() {\n return {\n id: descriptionId,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n get errorMessageProps() {\n return {\n id: errorMessageId,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAkFA,SAAgB,kBACd,OACA,OACA,UACiB;CACjB,MAAM,iBAAiB,OAAO,KAAK;CACnC,MAAM,KAAK,SAAS,SAAS,CAAC,CAAC,EAAE;CAGjC,MAAM,UAAU,GAAG,GAAG;CACtB,MAAM,cAAc,GAAG,GAAG;CAC1B,MAAM,cAAc,GAAG,GAAG;CAC1B,MAAM,gBAAgB,GAAG,GAAG;CAC5B,MAAM,iBAAiB,GAAG,GAAG;CAG7B,MAAM,EAAE,YAAY,eAAe,YAAY;EAC7C,IAAI,KAAK;GACP,OAAO;EACT;EACA,IAAI,QAAQ;GACV,OAAO,SAAS,CAAC,CAAC;EACpB;EACA,IAAI,eAAe;GACjB,OAAO,SAAS,CAAC,CAAC;EACpB;EACA,IAAI,oBAAoB;GACtB,OAAO,SAAS,CAAC,CAAC;EACpB;EAOA,kBAAkB;CACpB,CAAC;CAYD,MAAM,mBAA2B,SAAS,CAAC,CAAC,iBAAiB;CAC7D,MAAM,yBAA6C;EACjD,IAAI,WAAW,GAAG,OAAO,KAAA;EACzB,OAAO,SAAS,CAAC,CAAC,SAAS,OACtB,WAAW,KACZ,SAAS,CAAC,CAAC;CACjB;CAGA,MAAM,WAAW,iBACf,eAAe,SAAS,GAAyC,EAAE,WAAW,KAAK,CAAC,CACtF;CAGA,MAAM,iBAA4D,MAAM;EACtE,MAAM,QAAQ,EAAE,cAAc;EAC9B,IAAI,MAAM,SAAS,KAAK,GACtB,MAAM,cAAc,KAAK;CAE7B;CAGA,MAAM,eAA+D,MAAM;EACzE,MAAM,OAAO;EACb,MAAM,IAAI,SAAS;EACnB,EAAE,SAAS,CAAC;EACZ,EAAE,gBAAgB,KAAK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AAS;IACT,cAAc;IACd,WAAW;IACX,YAAY;GACd;EACF;EACA,IAAI,mBAAmB;GACrB,OAAO,EACL,IAAI,cACN;EACF;EACA,IAAI,oBAAoB;GACtB,OAAO,EACL,IAAI,eACN;EACF;CACF;AACF"}
1
+ {"version":3,"file":"numberfield.jsx","names":["mergeProps"],"sources":["../../src/numberfield/createNumberField.ts"],"sourcesContent":["/**\n * Provides the behavior and accessibility implementation for a number field.\n * Based on @react-aria/numberfield useNumberField.\n */\n\nimport { type JSX, createMemo } from \"solid-js\";\nimport { createLabel } from \"../label/createLabel\";\nimport { filterDOMProps } from \"../utils/filterDOMProps\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport type { NumberFieldState } from \"@proyecto-viviana/solid-stately\";\nimport type { AriaButtonProps } from \"../button/types\";\nimport type { PressEvent } from \"../interactions\";\n\nexport interface AriaNumberFieldProps {\n /** A label for the number field. */\n label?: JSX.Element;\n /** An accessible label for the number field. */\n \"aria-label\"?: string;\n /** The element ID that labels the number field. */\n \"aria-labelledby\"?: string;\n /** The element ID that describes the number field. */\n \"aria-describedby\"?: string;\n /** Whether the number field is disabled. */\n isDisabled?: boolean;\n /** Whether the number field is read-only. */\n isReadOnly?: boolean;\n /** Whether the number field is required. */\n isRequired?: boolean;\n /** Whether the number field is invalid. */\n isInvalid?: boolean;\n /** A description for the number field. */\n description?: JSX.Element;\n /** An error message for the number field. */\n errorMessage?: JSX.Element;\n /** The ID of the number field. */\n id?: string;\n /** Whether to auto-focus the input. */\n autoFocus?: boolean;\n /** The name for the form input. */\n name?: string;\n /** The form element this input belongs to. */\n form?: string;\n /** Handler for focus events. */\n onFocus?: JSX.EventHandler<HTMLInputElement, FocusEvent>;\n /** Handler for blur events. */\n onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent>;\n /** Handler called when focus state changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Handler for key down events. */\n onKeyDown?: JSX.EventHandler<HTMLInputElement, KeyboardEvent>;\n /** Handler for key up events. */\n onKeyUp?: JSX.EventHandler<HTMLInputElement, KeyboardEvent>;\n /** Handler for paste events. */\n onPaste?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n /** Handler for copy events. */\n onCopy?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n /** Handler for cut events. */\n onCut?: JSX.EventHandler<HTMLInputElement, ClipboardEvent>;\n}\n\nexport interface NumberFieldAria {\n /** Props for the label element. */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the input element group. */\n groupProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the input element. */\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n /** Props for the increment button. */\n incrementButtonProps: AriaButtonProps;\n /** Props for the decrement button. */\n decrementButtonProps: AriaButtonProps;\n /** Props for the description element. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the error message element. */\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a number field.\n */\nexport function createNumberField(\n props: MaybeAccessor<AriaNumberFieldProps>,\n state: NumberFieldState,\n inputRef?: () => HTMLInputElement | null,\n): NumberFieldAria {\n const getProps = () => access(props);\n const id = createId(getProps().id);\n\n // Generate IDs for associated elements\n const inputId = `${id}-input`;\n const incrementId = `${id}-increment`;\n const decrementId = `${id}-decrement`;\n const descriptionId = `${id}-description`;\n const errorMessageId = `${id}-error`;\n\n // Label handling\n const { labelProps, fieldProps } = createLabel({\n get id() {\n return inputId;\n },\n get label() {\n return getProps().label;\n },\n get \"aria-label\"() {\n return getProps()[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return getProps()[\"aria-labelledby\"];\n },\n // Upstream react-aria `useNumberField` → `useField` → `useLabel` with the DEFAULT\n // `labelElementType: 'label'`: the S2 NumberField label is a native `<label htmlFor>`\n // (verified against the shipped React DOM: `<label id for=inputId>`). This hardcoded\n // `\"span\"` was a self-inflicted divergence — it dropped the `for` association and made\n // `NumberFieldLabel` render a `<span>`. Reverted to `\"label\"` so `createLabel` emits\n // `for: inputId` (the input still also carries `aria-labelledby`, exactly as upstream).\n labelElementType: \"label\",\n });\n\n // Increment/decrement button labels — a 1:1 port of upstream `useNumberField`'s\n // four-case logic. Upstream RAC's `NumberField` component feeds `useNumberField` a\n // BOOLEAN slot for `label` (from `useSlot`), never the label string, so a visible\n // label is NEVER concatenated into the button `aria-label`. Instead: with a visible\n // label the button reads `aria-label: \"Increase\"` PLUS `aria-labelledby: \"<selfId>\n // <labelId>\"`; only an explicit `aria-label` (and no visible label) changes the text\n // (`\"Increase <aria-label>\"`). The prior `Increase ${getLabelText()}` was a\n // self-inflicted divergence that produced \"Increase Quantity\" where S2 ships\n // \"Increase\". `fieldLabel` mirrors upstream: `props['aria-label'] || ''` — the visible\n // label string is intentionally excluded (it arrives as a boolean slot in RAC).\n const fieldLabel = (): string => getProps()[\"aria-label\"] ?? \"\";\n const buttonLabelledBy = (): string | undefined => {\n if (fieldLabel()) return undefined;\n return getProps().label != null\n ? (labelProps.id as string | undefined)\n : getProps()[\"aria-labelledby\"];\n };\n\n // Filter DOM props\n const domProps = createMemo(() =>\n filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true }),\n );\n\n // Handle input change\n const onInputChange: JSX.EventHandler<HTMLInputElement, Event> = (e) => {\n const value = e.currentTarget.value;\n if (state.validate(value)) {\n state.setInputValue(value);\n }\n };\n\n // Handle input blur - commit value\n const onInputBlur: JSX.EventHandler<HTMLInputElement, FocusEvent> = (e) => {\n state.commit();\n const p = getProps();\n p.onBlur?.(e);\n p.onFocusChange?.(false);\n };\n\n const onInputFocus: JSX.EventHandler<HTMLInputElement, FocusEvent> = (e) => {\n const p = getProps();\n p.onFocus?.(e);\n p.onFocusChange?.(true);\n };\n\n // Handle keyboard events\n const onKeyDown: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (e) => {\n const p = getProps();\n if (p.isDisabled || p.isReadOnly) {\n p.onKeyDown?.(e);\n return;\n }\n\n switch (e.key) {\n case \"ArrowUp\":\n e.preventDefault();\n state.increment();\n break;\n case \"ArrowDown\":\n e.preventDefault();\n state.decrement();\n break;\n case \"PageUp\":\n e.preventDefault();\n state.incrementToMax();\n break;\n case \"PageDown\":\n e.preventDefault();\n state.decrementToMin();\n break;\n case \"Home\":\n e.preventDefault();\n state.decrementToMin();\n break;\n case \"End\":\n e.preventDefault();\n state.incrementToMax();\n break;\n case \"Enter\":\n state.commit();\n break;\n }\n\n p.onKeyDown?.(e);\n };\n\n const onKeyUp: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (e) => {\n getProps().onKeyUp?.(e);\n };\n\n const onButtonPressStart = (e: PressEvent) => {\n const input = inputRef?.();\n\n // Keep existing input focus in place. This avoids hiding software keyboards\n // and prevents a blur/refocus flicker when mouse pressing the steppers.\n if (input && input.ownerDocument.activeElement === input) {\n return;\n }\n\n if (e.pointerType === \"mouse\") {\n input?.focus();\n } else if (e.target instanceof HTMLElement) {\n e.target.focus();\n }\n };\n\n let incrementTouchPressUp = false;\n let decrementTouchPressUp = false;\n\n const onIncrementPressStart = (e: PressEvent) => {\n if (e.pointerType !== \"touch\") {\n state.increment();\n } else {\n incrementTouchPressUp = false;\n }\n\n onButtonPressStart(e);\n };\n\n const onIncrementPressUp = (e: PressEvent) => {\n if (e.pointerType === \"touch\") {\n incrementTouchPressUp = true;\n }\n };\n\n const onIncrementPressEnd = (e: PressEvent) => {\n if (e.pointerType === \"touch\" && incrementTouchPressUp) {\n state.increment();\n }\n\n incrementTouchPressUp = false;\n };\n const onIncrementClick = (e: MouseEvent) => {\n if (!state.canIncrement()) {\n e.preventDefault();\n return;\n }\n\n state.increment();\n inputRef?.()?.focus();\n };\n\n const onDecrementPressStart = (e: PressEvent) => {\n if (e.pointerType !== \"touch\") {\n state.decrement();\n } else {\n decrementTouchPressUp = false;\n }\n\n onButtonPressStart(e);\n };\n\n const onDecrementPressUp = (e: PressEvent) => {\n if (e.pointerType === \"touch\") {\n decrementTouchPressUp = true;\n }\n };\n\n const onDecrementPressEnd = (e: PressEvent) => {\n if (e.pointerType === \"touch\" && decrementTouchPressUp) {\n state.decrement();\n }\n\n decrementTouchPressUp = false;\n };\n const onDecrementClick = (e: MouseEvent) => {\n if (!state.canDecrement()) {\n e.preventDefault();\n return;\n }\n\n state.decrement();\n inputRef?.()?.focus();\n };\n\n // Build aria-describedby\n const getAriaDescribedBy = () => {\n const p = getProps();\n const parts: string[] = [];\n if (p[\"aria-describedby\"]) parts.push(p[\"aria-describedby\"]);\n if (p.description) parts.push(descriptionId);\n if (p.isInvalid && p.errorMessage) parts.push(errorMessageId);\n return parts.length > 0 ? parts.join(\" \") : undefined;\n };\n\n return {\n get labelProps() {\n return labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get groupProps() {\n return {\n role: \"group\",\n \"aria-disabled\": getProps().isDisabled || undefined,\n \"aria-invalid\": getProps().isInvalid || undefined,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n get inputProps() {\n const p = getProps();\n const isDisabled = p.isDisabled ?? state.isDisabled();\n const isReadOnly = p.isReadOnly ?? state.isReadOnly();\n\n return mergeProps(\n domProps(),\n fieldProps as Record<string, unknown>,\n {\n id: inputId,\n type: \"text\",\n inputMode: \"decimal\" as const,\n autoComplete: \"off\",\n autoCorrect: \"off\",\n spellcheck: false,\n // Upstream routes the input through useFormattedTextField → useTextField →\n // useFocusable, which \"always set[s] a tabIndex so that Safari allows\n // focusing native buttons and inputs\": `excludeFromTabOrder ? -1 : 0`, then\n // `undefined` when disabled. The input is never excluded, so the rendered\n // DOM carries `tabindex=\"0\"` (absent only when disabled). We hand-roll\n // inputProps (see the spinbutton-override note below) so we must replay that\n // one focusable prop here to stay byte-identical to React's tab order.\n tabIndex: isDisabled ? undefined : 0,\n // Upstream useNumberField wraps useSpinButton but deliberately\n // overrides its output: role=spinbutton can't be focused with\n // VoiceOver, so the input is a plain textbox (inside the role=group\n // wrapper above) and every aria-value* is dropped in favour of\n // aria-roledescription. The formatted value is still announced via the\n // input's own value. Mirror that contract instead of leaking the raw\n // spinbutton semantics.\n //\n // The string MUST match upstream's `stringFormatter.format('numberField')`,\n // whose en-US value is `Number field` (capitalised) — not a lowercase\n // hand-roll. Full locale routing via `createStringFormatter` (as\n // `createDateField` does) is tracked as `intl-roledescription-hardcodes`\n // (also covers the ColorArea/ColorSwatch English hardcodes); this keeps the\n // en-US roledescription byte-identical to React Spectrum in the meantime.\n \"aria-roledescription\": \"Number field\",\n \"aria-invalid\": p.isInvalid || undefined,\n \"aria-required\": p.isRequired || undefined,\n \"aria-describedby\": getAriaDescribedBy(),\n disabled: isDisabled || undefined,\n readOnly: isReadOnly || undefined,\n required: p.isRequired || undefined,\n value: state.inputValue(),\n onInput: onInputChange,\n onChange: onInputChange,\n onFocus: onInputFocus,\n onBlur: onInputBlur,\n onKeyDown,\n onKeyUp,\n onPaste: p.onPaste,\n onCopy: p.onCopy,\n onCut: p.onCut,\n name: p.name,\n form: p.form,\n autoFocus: p.autoFocus,\n } as Record<string, unknown>,\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n },\n get incrementButtonProps() {\n const labelledBy = buttonLabelledBy();\n return {\n id: incrementId,\n type: \"button\",\n \"aria-label\": `Increase ${fieldLabel()}`.trim(),\n \"aria-labelledby\": labelledBy ? `${incrementId} ${labelledBy}` : undefined,\n \"aria-controls\": inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n allowFocusWhenDisabled: true,\n get disabled() {\n return !state.canIncrement();\n },\n tabIndex: -1,\n get isDisabled() {\n return !state.canIncrement();\n },\n onClick: onIncrementClick,\n onPressStart: onIncrementPressStart,\n onPressUp: onIncrementPressUp,\n onPressEnd: onIncrementPressEnd,\n } as AriaButtonProps;\n },\n get decrementButtonProps() {\n const labelledBy = buttonLabelledBy();\n return {\n id: decrementId,\n type: \"button\",\n \"aria-label\": `Decrease ${fieldLabel()}`.trim(),\n \"aria-labelledby\": labelledBy ? `${decrementId} ${labelledBy}` : undefined,\n \"aria-controls\": inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n allowFocusWhenDisabled: true,\n get disabled() {\n return !state.canDecrement();\n },\n tabIndex: -1,\n get isDisabled() {\n return !state.canDecrement();\n },\n onClick: onDecrementClick,\n onPressStart: onDecrementPressStart,\n onPressUp: onDecrementPressUp,\n onPressEnd: onDecrementPressEnd,\n } as AriaButtonProps;\n },\n get descriptionProps() {\n return {\n id: descriptionId,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n get errorMessageProps() {\n return {\n id: errorMessageId,\n } as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAkFA,SAAgB,kBACd,OACA,OACA,UACiB;CACjB,MAAM,iBAAiB,OAAO,KAAK;CACnC,MAAM,KAAK,SAAS,SAAS,CAAC,CAAC,EAAE;CAGjC,MAAM,UAAU,GAAG,GAAG;CACtB,MAAM,cAAc,GAAG,GAAG;CAC1B,MAAM,cAAc,GAAG,GAAG;CAC1B,MAAM,gBAAgB,GAAG,GAAG;CAC5B,MAAM,iBAAiB,GAAG,GAAG;CAG7B,MAAM,EAAE,YAAY,eAAe,YAAY;EAC7C,IAAI,KAAK;GACP,OAAO;EACT;EACA,IAAI,QAAQ;GACV,OAAO,SAAS,CAAC,CAAC;EACpB;EACA,IAAI,eAAe;GACjB,OAAO,SAAS,CAAC,CAAC;EACpB;EACA,IAAI,oBAAoB;GACtB,OAAO,SAAS,CAAC,CAAC;EACpB;EAOA,kBAAkB;CACpB,CAAC;CAYD,MAAM,mBAA2B,SAAS,CAAC,CAAC,iBAAiB;CAC7D,MAAM,yBAA6C;EACjD,IAAI,WAAW,GAAG,OAAO,KAAA;EACzB,OAAO,SAAS,CAAC,CAAC,SAAS,OACtB,WAAW,KACZ,SAAS,CAAC,CAAC;CACjB;CAGA,MAAM,WAAW,iBACf,eAAe,SAAS,GAAyC,EA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,cAAc,YAAY,WAAW,IAAI,KAAK;IAC9C,mBAAmB,aAAa,GAAG,YAAY,GAAG,eAAe,KAAA;IACjE,iBAAiB;IACjB,qBAAqB;IACrB,qBAAqB;IACrB,wBAAwB;IACxB,IAAI,WAAW;KACb,OAAO,CAAC,MAAM,aAAa;IAC7B;IACA,UAAU;IACV,IAAI,aAAa;KACf,OAAO,CAAC,MAAM,aAAa;IAC7B;IACA,SAAS;IACT,cAAc;IACd,WAAW;IACX,YAAY;GACd;EACF;EACA,IAAI,mBAAmB;GACrB,OAAO,EACL,IAAI,cACN;EACF;EACA,IAAI,oBAAoB;GACtB,OAAO,EACL,IAAI,eACN;EACF;CACF;AACF"}
@@ -1,4 +1,4 @@
1
- import { i as access } from "./env.js";
1
+ import { t as access } from "./reactivity.js";
2
2
  import { createId } from "../ssr/index.js";
3
3
  import { createContext, createEffect, createSignal, onCleanup, useContext } from "solid-js";
4
4
  import { Portal, createComponent, getNextElement, insert, isServer, runHydrationEvents, spread, template } from "solid-js/web";
@@ -1,4 +1,4 @@
1
- import { i as access } from "./env.jsx";
1
+ import { t as access } from "./reactivity.jsx";
2
2
  import { createId } from "../ssr/index.jsx";
3
3
  import { createContext, createEffect, createSignal, onCleanup, useContext } from "solid-js";
4
4
  import { Portal, isServer } from "solid-js/web";
@@ -1,5 +1,5 @@
1
- import { o as mergeProps } from "./env.js";
2
- import { a as useLocale } from "./createCollator.js";
1
+ import { i as mergeProps$1 } from "./env.js";
2
+ import { i as useLocale } from "./locale.js";
3
3
  import { r as createPreventScroll, t as createOverlay } from "./createOverlay.js";
4
4
  import { n as keepVisible, t as ariaHideOutside } from "./ariaHideOutside.js";
5
5
  import { createEffect, createSignal, onCleanup } from "solid-js";
@@ -540,7 +540,7 @@ function createPopover(props, state) {
540
540
  });
541
541
  }
542
542
  });
543
- const merged = mergeProps(overlayProps, positionProps);
543
+ const merged = mergeProps$1(overlayProps, positionProps);
544
544
  return {
545
545
  popoverProps: new Proxy(merged, {
546
546
  get(target, key) {