@proyecto-viviana/solidaria-components 0.5.0 → 0.7.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (561) hide show
  1. package/LICENSE-APACHE-2.0 +201 -0
  2. package/NOTICE +91 -0
  3. package/README.md +4 -7
  4. package/dist/ActionBar.d.ts +2 -10
  5. package/dist/ActionBar.d.ts.map +1 -1
  6. package/dist/ActionBar.js +95 -59
  7. package/dist/ActionBar.js.map +1 -1
  8. package/dist/ActionBar.jsx +42 -15
  9. package/dist/ActionBar.jsx.map +1 -1
  10. package/dist/ActionGroup.d.ts +1 -12
  11. package/dist/ActionGroup.d.ts.map +1 -1
  12. package/dist/ActionGroup.js +66 -44
  13. package/dist/ActionGroup.js.map +1 -1
  14. package/dist/ActionGroup.jsx +25 -10
  15. package/dist/ActionGroup.jsx.map +1 -1
  16. package/dist/Alert.d.ts +4 -1
  17. package/dist/Alert.d.ts.map +1 -1
  18. package/dist/Alert.js +25 -17
  19. package/dist/Alert.js.map +1 -1
  20. package/dist/Alert.jsx +9 -5
  21. package/dist/Alert.jsx.map +1 -1
  22. package/dist/Autocomplete.d.ts +2 -9
  23. package/dist/Autocomplete.d.ts.map +1 -1
  24. package/dist/Autocomplete.js +18 -5
  25. package/dist/Autocomplete.js.map +1 -1
  26. package/dist/Autocomplete.jsx +20 -7
  27. package/dist/Autocomplete.jsx.map +1 -1
  28. package/dist/Breadcrumbs.d.ts +2 -7
  29. package/dist/Breadcrumbs.d.ts.map +1 -1
  30. package/dist/Breadcrumbs.js +71 -51
  31. package/dist/Breadcrumbs.js.map +1 -1
  32. package/dist/Breadcrumbs.jsx +25 -12
  33. package/dist/Breadcrumbs.jsx.map +1 -1
  34. package/dist/Button.d.ts +1 -7
  35. package/dist/Button.d.ts.map +1 -1
  36. package/dist/Button.js +125 -72
  37. package/dist/Button.js.map +1 -1
  38. package/dist/Button.jsx +105 -43
  39. package/dist/Button.jsx.map +1 -1
  40. package/dist/Calendar.d.ts +1 -7
  41. package/dist/Calendar.d.ts.map +1 -1
  42. package/dist/Calendar.js +297 -221
  43. package/dist/Calendar.js.map +1 -1
  44. package/dist/Calendar.jsx +52 -32
  45. package/dist/Calendar.jsx.map +1 -1
  46. package/dist/CalendarPicker.d.ts +1 -10
  47. package/dist/CalendarPicker.d.ts.map +1 -1
  48. package/dist/CalendarPicker.js +12 -0
  49. package/dist/CalendarPicker.js.map +1 -1
  50. package/dist/CalendarPicker.jsx +12 -0
  51. package/dist/CalendarPicker.jsx.map +1 -1
  52. package/dist/Checkbox.d.ts +2 -7
  53. package/dist/Checkbox.d.ts.map +1 -1
  54. package/dist/Checkbox.js +332 -270
  55. package/dist/Checkbox.js.map +1 -1
  56. package/dist/Checkbox.jsx +70 -77
  57. package/dist/Checkbox.jsx.map +1 -1
  58. package/dist/Collection.d.ts +33 -7
  59. package/dist/Collection.d.ts.map +1 -1
  60. package/dist/Collection.js +128 -74
  61. package/dist/Collection.js.map +1 -1
  62. package/dist/Collection.jsx +46 -7
  63. package/dist/Collection.jsx.map +1 -1
  64. package/dist/Color.d.ts +15 -20
  65. package/dist/Color.d.ts.map +1 -1
  66. package/dist/Color.js +572 -334
  67. package/dist/Color.js.map +1 -1
  68. package/dist/Color.jsx +205 -85
  69. package/dist/Color.jsx.map +1 -1
  70. package/dist/ColorEditor.d.ts +3 -1
  71. package/dist/ColorEditor.d.ts.map +1 -1
  72. package/dist/ColorEditor.js +147 -124
  73. package/dist/ColorEditor.js.map +1 -1
  74. package/dist/ColorEditor.jsx +4 -1
  75. package/dist/ColorEditor.jsx.map +1 -1
  76. package/dist/ComboBox.d.ts +31 -10
  77. package/dist/ComboBox.d.ts.map +1 -1
  78. package/dist/ComboBox.js +539 -274
  79. package/dist/ComboBox.js.map +1 -1
  80. package/dist/ComboBox.jsx +213 -70
  81. package/dist/ComboBox.jsx.map +1 -1
  82. package/dist/ContextualHelpTrigger.d.ts +1 -7
  83. package/dist/ContextualHelpTrigger.d.ts.map +1 -1
  84. package/dist/ContextualHelpTrigger.js +102 -72
  85. package/dist/ContextualHelpTrigger.js.map +1 -1
  86. package/dist/ContextualHelpTrigger.jsx +36 -16
  87. package/dist/ContextualHelpTrigger.jsx.map +1 -1
  88. package/dist/DateField.d.ts +2 -7
  89. package/dist/DateField.d.ts.map +1 -1
  90. package/dist/DateField.js +0 -2
  91. package/dist/DateField.jsx +0 -2
  92. package/dist/DateField2.js +194 -179
  93. package/dist/DateField2.js.map +1 -1
  94. package/dist/DateField2.jsx +58 -55
  95. package/dist/DateField2.jsx.map +1 -1
  96. package/dist/DatePicker.d.ts +7 -7
  97. package/dist/DatePicker.d.ts.map +1 -1
  98. package/dist/DatePicker.js +2 -2
  99. package/dist/DatePicker.jsx +2 -2
  100. package/dist/DatePicker2.js +357 -435
  101. package/dist/DatePicker2.js.map +1 -1
  102. package/dist/DatePicker2.jsx +109 -178
  103. package/dist/DatePicker2.jsx.map +1 -1
  104. package/dist/DateRangePickerContext.d.ts +7 -0
  105. package/dist/DateRangePickerContext.d.ts.map +1 -1
  106. package/dist/Dialog.d.ts +4 -9
  107. package/dist/Dialog.d.ts.map +1 -1
  108. package/dist/Dialog.js +168 -101
  109. package/dist/Dialog.js.map +1 -1
  110. package/dist/Dialog.jsx +75 -27
  111. package/dist/Dialog.jsx.map +1 -1
  112. package/dist/Disclosure.d.ts +1 -9
  113. package/dist/Disclosure.d.ts.map +1 -1
  114. package/dist/Disclosure.js +121 -79
  115. package/dist/Disclosure.js.map +1 -1
  116. package/dist/Disclosure.jsx +32 -19
  117. package/dist/Disclosure.jsx.map +1 -1
  118. package/dist/DragAndDrop.d.ts +9 -6
  119. package/dist/DragAndDrop.d.ts.map +1 -1
  120. package/dist/DragAndDrop.js +37 -22
  121. package/dist/DragAndDrop.js.map +1 -1
  122. package/dist/DragAndDrop.jsx +20 -4
  123. package/dist/DragAndDrop.jsx.map +1 -1
  124. package/dist/DragPreview.d.ts +1 -1
  125. package/dist/DragPreview.d.ts.map +1 -1
  126. package/dist/DropZone.d.ts +1 -7
  127. package/dist/DropZone.d.ts.map +1 -1
  128. package/dist/DropZone.js +74 -40
  129. package/dist/DropZone.js.map +1 -1
  130. package/dist/DropZone.jsx +24 -8
  131. package/dist/DropZone.jsx.map +1 -1
  132. package/dist/ElementTag.d.ts +9 -20
  133. package/dist/ElementTag.d.ts.map +1 -1
  134. package/dist/ElementTag.js +8 -210
  135. package/dist/ElementTag.js.map +1 -1
  136. package/dist/ElementTag.jsx +8 -57
  137. package/dist/ElementTag.jsx.map +1 -1
  138. package/dist/FieldError.d.ts +8 -7
  139. package/dist/FieldError.d.ts.map +1 -1
  140. package/dist/FieldError.js +33 -13
  141. package/dist/FieldError.js.map +1 -1
  142. package/dist/FieldError.jsx +20 -5
  143. package/dist/FieldError.jsx.map +1 -1
  144. package/dist/FileTrigger.d.ts +1 -7
  145. package/dist/FileTrigger.d.ts.map +1 -1
  146. package/dist/FileTrigger.js +30 -12
  147. package/dist/FileTrigger.js.map +1 -1
  148. package/dist/FileTrigger.jsx +15 -2
  149. package/dist/FileTrigger.jsx.map +1 -1
  150. package/dist/Focusable.d.ts +2 -8
  151. package/dist/Focusable.d.ts.map +1 -1
  152. package/dist/Focusable.js +23 -6
  153. package/dist/Focusable.js.map +1 -1
  154. package/dist/Focusable.jsx +22 -5
  155. package/dist/Focusable.jsx.map +1 -1
  156. package/dist/Form.d.ts +9 -8
  157. package/dist/Form.d.ts.map +1 -1
  158. package/dist/Form.js +66 -43
  159. package/dist/Form.js.map +1 -1
  160. package/dist/Form.jsx +36 -16
  161. package/dist/Form.jsx.map +1 -1
  162. package/dist/GridList.d.ts +5 -10
  163. package/dist/GridList.d.ts.map +1 -1
  164. package/dist/GridList.js +372 -243
  165. package/dist/GridList.js.map +1 -1
  166. package/dist/GridList.jsx +177 -99
  167. package/dist/GridList.jsx.map +1 -1
  168. package/dist/HiddenDateInput.d.ts +1 -7
  169. package/dist/HiddenDateInput.d.ts.map +1 -1
  170. package/dist/Icon.d.ts +4 -1
  171. package/dist/Icon.d.ts.map +1 -1
  172. package/dist/Icon.js +41 -37
  173. package/dist/Icon.js.map +1 -1
  174. package/dist/Icon.jsx +7 -3
  175. package/dist/Icon.jsx.map +1 -1
  176. package/dist/Keyboard.d.ts +1 -7
  177. package/dist/Keyboard.d.ts.map +1 -1
  178. package/dist/Keyboard.js +24 -11
  179. package/dist/Keyboard.js.map +1 -1
  180. package/dist/Keyboard.jsx +15 -2
  181. package/dist/Keyboard.jsx.map +1 -1
  182. package/dist/Label.d.ts +20 -0
  183. package/dist/Label.d.ts.map +1 -0
  184. package/dist/Label.js +60 -0
  185. package/dist/Label.js.map +1 -0
  186. package/dist/Label.jsx +47 -0
  187. package/dist/Label.jsx.map +1 -0
  188. package/dist/Landmark.d.ts +4 -1
  189. package/dist/Landmark.d.ts.map +1 -1
  190. package/dist/Landmark.js +10 -4
  191. package/dist/Landmark.js.map +1 -1
  192. package/dist/Landmark.jsx +5 -1
  193. package/dist/Landmark.jsx.map +1 -1
  194. package/dist/Link.d.ts +2 -7
  195. package/dist/Link.d.ts.map +1 -1
  196. package/dist/Link.js +56 -36
  197. package/dist/Link.js.map +1 -1
  198. package/dist/Link.jsx +52 -10
  199. package/dist/Link.jsx.map +1 -1
  200. package/dist/ListBox.d.ts +17 -13
  201. package/dist/ListBox.d.ts.map +1 -1
  202. package/dist/ListBox.js +647 -348
  203. package/dist/ListBox.js.map +1 -1
  204. package/dist/ListBox.jsx +339 -236
  205. package/dist/ListBox.jsx.map +1 -1
  206. package/dist/ListDropTargetDelegate.d.ts +3 -0
  207. package/dist/ListDropTargetDelegate.d.ts.map +1 -1
  208. package/dist/Menu.d.ts +39 -30
  209. package/dist/Menu.d.ts.map +1 -1
  210. package/dist/Menu.js +547 -368
  211. package/dist/Menu.js.map +1 -1
  212. package/dist/Menu.jsx +328 -230
  213. package/dist/Menu.jsx.map +1 -1
  214. package/dist/Meter.d.ts +6 -13
  215. package/dist/Meter.d.ts.map +1 -1
  216. package/dist/Meter.js +55 -18
  217. package/dist/Meter.js.map +1 -1
  218. package/dist/Meter.jsx +33 -8
  219. package/dist/Meter.jsx.map +1 -1
  220. package/dist/Modal.d.ts +1 -7
  221. package/dist/Modal.d.ts.map +1 -1
  222. package/dist/Modal.js +104 -56
  223. package/dist/Modal.js.map +1 -1
  224. package/dist/Modal.jsx +68 -38
  225. package/dist/Modal.jsx.map +1 -1
  226. package/dist/NumberField.d.ts +4 -7
  227. package/dist/NumberField.d.ts.map +1 -1
  228. package/dist/NumberField.js +243 -124
  229. package/dist/NumberField.js.map +1 -1
  230. package/dist/NumberField.jsx +115 -26
  231. package/dist/NumberField.jsx.map +1 -1
  232. package/dist/Popover.d.ts +15 -7
  233. package/dist/Popover.d.ts.map +1 -1
  234. package/dist/Popover.js +370 -181
  235. package/dist/Popover.js.map +1 -1
  236. package/dist/Popover.jsx +215 -82
  237. package/dist/Popover.jsx.map +1 -1
  238. package/dist/Pressable.d.ts +2 -8
  239. package/dist/Pressable.d.ts.map +1 -1
  240. package/dist/Pressable.js +23 -6
  241. package/dist/Pressable.js.map +1 -1
  242. package/dist/Pressable.jsx +22 -5
  243. package/dist/Pressable.jsx.map +1 -1
  244. package/dist/PreviewTrigger.d.ts +24 -0
  245. package/dist/PreviewTrigger.d.ts.map +1 -0
  246. package/dist/PreviewTrigger.js +128 -0
  247. package/dist/PreviewTrigger.js.map +1 -0
  248. package/dist/PreviewTrigger.jsx +117 -0
  249. package/dist/PreviewTrigger.jsx.map +1 -0
  250. package/dist/ProgressBar.d.ts +1 -7
  251. package/dist/ProgressBar.d.ts.map +1 -1
  252. package/dist/ProgressBar.js +34 -14
  253. package/dist/ProgressBar.js.map +1 -1
  254. package/dist/ProgressBar.jsx +17 -3
  255. package/dist/ProgressBar.jsx.map +1 -1
  256. package/dist/RadioGroup.d.ts +2 -7
  257. package/dist/RadioGroup.d.ts.map +1 -1
  258. package/dist/RadioGroup.js +388 -269
  259. package/dist/RadioGroup.js.map +1 -1
  260. package/dist/RadioGroup.jsx +110 -99
  261. package/dist/RadioGroup.jsx.map +1 -1
  262. package/dist/RangeCalendar.d.ts +3 -7
  263. package/dist/RangeCalendar.d.ts.map +1 -1
  264. package/dist/RangeCalendar.js +271 -202
  265. package/dist/RangeCalendar.js.map +1 -1
  266. package/dist/RangeCalendar.jsx +56 -37
  267. package/dist/RangeCalendar.jsx.map +1 -1
  268. package/dist/RouterProvider.d.ts +3 -9
  269. package/dist/RouterProvider.d.ts.map +1 -1
  270. package/dist/RouterProvider.js +15 -14
  271. package/dist/RouterProvider.js.map +1 -1
  272. package/dist/RouterProvider.jsx +14 -13
  273. package/dist/RouterProvider.jsx.map +1 -1
  274. package/dist/SearchField.d.ts +4 -7
  275. package/dist/SearchField.d.ts.map +1 -1
  276. package/dist/SearchField.js +191 -164
  277. package/dist/SearchField.js.map +1 -1
  278. package/dist/SearchField.jsx +69 -62
  279. package/dist/SearchField.jsx.map +1 -1
  280. package/dist/Select.d.ts +5 -10
  281. package/dist/Select.d.ts.map +1 -1
  282. package/dist/Select.js +565 -359
  283. package/dist/Select.js.map +1 -1
  284. package/dist/Select.jsx +281 -161
  285. package/dist/Select.jsx.map +1 -1
  286. package/dist/SelectionIndicator.d.ts +1 -4
  287. package/dist/SelectionIndicator.d.ts.map +1 -1
  288. package/dist/SelectionIndicator.js +29 -13
  289. package/dist/SelectionIndicator.js.map +1 -1
  290. package/dist/SelectionIndicator.jsx +18 -4
  291. package/dist/SelectionIndicator.jsx.map +1 -1
  292. package/dist/Separator.d.ts +1 -7
  293. package/dist/Separator.d.ts.map +1 -1
  294. package/dist/Separator.js +22 -6
  295. package/dist/Separator.js.map +1 -1
  296. package/dist/Separator.jsx +16 -3
  297. package/dist/Separator.jsx.map +1 -1
  298. package/dist/SharedElementTransition.d.ts +1 -10
  299. package/dist/SharedElementTransition.d.ts.map +1 -1
  300. package/dist/SharedElementTransition.js +68 -40
  301. package/dist/SharedElementTransition.js.map +1 -1
  302. package/dist/SharedElementTransition.jsx +49 -25
  303. package/dist/SharedElementTransition.jsx.map +1 -1
  304. package/dist/Slider.d.ts +2 -8
  305. package/dist/Slider.d.ts.map +1 -1
  306. package/dist/Slider.js +155 -97
  307. package/dist/Slider.js.map +1 -1
  308. package/dist/Slider.jsx +25 -12
  309. package/dist/Slider.jsx.map +1 -1
  310. package/dist/StepList.d.ts +1 -7
  311. package/dist/StepList.d.ts.map +1 -1
  312. package/dist/StepList.js +112 -68
  313. package/dist/StepList.js.map +1 -1
  314. package/dist/StepList.jsx +58 -20
  315. package/dist/StepList.jsx.map +1 -1
  316. package/dist/Switch.d.ts +2 -9
  317. package/dist/Switch.d.ts.map +1 -1
  318. package/dist/Switch.js +164 -114
  319. package/dist/Switch.js.map +1 -1
  320. package/dist/Switch.jsx +26 -13
  321. package/dist/Switch.jsx.map +1 -1
  322. package/dist/Table.d.ts +2 -1
  323. package/dist/Table.d.ts.map +1 -1
  324. package/dist/Table.js +689 -592
  325. package/dist/Table.js.map +1 -1
  326. package/dist/Table.jsx +317 -237
  327. package/dist/Table.jsx.map +1 -1
  328. package/dist/Tabs.d.ts +2 -7
  329. package/dist/Tabs.d.ts.map +1 -1
  330. package/dist/Tabs.js +278 -293
  331. package/dist/Tabs.js.map +1 -1
  332. package/dist/Tabs.jsx +68 -66
  333. package/dist/Tabs.jsx.map +1 -1
  334. package/dist/TagGroup.d.ts +4 -11
  335. package/dist/TagGroup.d.ts.map +1 -1
  336. package/dist/TagGroup.js +153 -115
  337. package/dist/TagGroup.js.map +1 -1
  338. package/dist/TagGroup.jsx +37 -24
  339. package/dist/TagGroup.jsx.map +1 -1
  340. package/dist/Text.d.ts +3 -3
  341. package/dist/Text.d.ts.map +1 -1
  342. package/dist/Text.js +24 -7
  343. package/dist/Text.js.map +1 -1
  344. package/dist/Text.jsx +17 -5
  345. package/dist/Text.jsx.map +1 -1
  346. package/dist/TextField.d.ts +3 -16
  347. package/dist/TextField.d.ts.map +1 -1
  348. package/dist/TextField.js +104 -129
  349. package/dist/TextField.js.map +1 -1
  350. package/dist/TextField.jsx +76 -102
  351. package/dist/TextField.jsx.map +1 -1
  352. package/dist/TimeField.d.ts +2 -15
  353. package/dist/TimeField.d.ts.map +1 -1
  354. package/dist/TimeField.js +86 -102
  355. package/dist/TimeField.js.map +1 -1
  356. package/dist/TimeField.jsx +32 -49
  357. package/dist/TimeField.jsx.map +1 -1
  358. package/dist/Toast.d.ts +10 -13
  359. package/dist/Toast.d.ts.map +1 -1
  360. package/dist/Toast.js +209 -108
  361. package/dist/Toast.js.map +1 -1
  362. package/dist/Toast.jsx +127 -22
  363. package/dist/Toast.jsx.map +1 -1
  364. package/dist/ToggleButton.d.ts +1 -7
  365. package/dist/ToggleButton.d.ts.map +1 -1
  366. package/dist/ToggleButton.js +57 -35
  367. package/dist/ToggleButton.js.map +1 -1
  368. package/dist/ToggleButton.jsx +26 -12
  369. package/dist/ToggleButton.jsx.map +1 -1
  370. package/dist/ToggleButtonGroup.d.ts +1 -7
  371. package/dist/ToggleButtonGroup.d.ts.map +1 -1
  372. package/dist/ToggleButtonGroup.js +59 -44
  373. package/dist/ToggleButtonGroup.js.map +1 -1
  374. package/dist/ToggleButtonGroup.jsx +25 -12
  375. package/dist/ToggleButtonGroup.jsx.map +1 -1
  376. package/dist/TokenField.d.ts +52 -0
  377. package/dist/TokenField.d.ts.map +1 -0
  378. package/dist/TokenField.js +301 -0
  379. package/dist/TokenField.js.map +1 -0
  380. package/dist/TokenField.jsx +197 -0
  381. package/dist/TokenField.jsx.map +1 -0
  382. package/dist/Toolbar.d.ts +2 -7
  383. package/dist/Toolbar.d.ts.map +1 -1
  384. package/dist/Toolbar.js +35 -16
  385. package/dist/Toolbar.js.map +1 -1
  386. package/dist/Toolbar.jsx +15 -2
  387. package/dist/Toolbar.jsx.map +1 -1
  388. package/dist/Tooltip.d.ts +2 -7
  389. package/dist/Tooltip.d.ts.map +1 -1
  390. package/dist/Tooltip.js +105 -68
  391. package/dist/Tooltip.js.map +1 -1
  392. package/dist/Tooltip.jsx +60 -36
  393. package/dist/Tooltip.jsx.map +1 -1
  394. package/dist/Tree.d.ts +8 -11
  395. package/dist/Tree.d.ts.map +1 -1
  396. package/dist/Tree.js +486 -339
  397. package/dist/Tree.js.map +1 -1
  398. package/dist/Tree.jsx +155 -107
  399. package/dist/Tree.jsx.map +1 -1
  400. package/dist/Virtualizer.d.ts +39 -9
  401. package/dist/Virtualizer.d.ts.map +1 -1
  402. package/dist/Virtualizer.js +2 -2
  403. package/dist/Virtualizer.jsx +2 -2
  404. package/dist/Virtualizer2.js +491 -136
  405. package/dist/Virtualizer2.js.map +1 -1
  406. package/dist/Virtualizer2.jsx +455 -122
  407. package/dist/Virtualizer2.jsx.map +1 -1
  408. package/dist/VirtualizerLayouts.d.ts +55 -2
  409. package/dist/VirtualizerLayouts.d.ts.map +1 -1
  410. package/dist/VisuallyHidden.d.ts +4 -3
  411. package/dist/VisuallyHidden.d.ts.map +1 -1
  412. package/dist/VisuallyHidden.js +18 -11
  413. package/dist/VisuallyHidden.js.map +1 -1
  414. package/dist/VisuallyHidden.jsx +15 -9
  415. package/dist/VisuallyHidden.jsx.map +1 -1
  416. package/dist/contexts.d.ts +25 -0
  417. package/dist/contexts.d.ts.map +1 -1
  418. package/dist/contexts.js +3 -0
  419. package/dist/contexts.js.map +1 -1
  420. package/dist/contexts.jsx +3 -0
  421. package/dist/contexts.jsx.map +1 -1
  422. package/dist/index.d.ts +11 -9
  423. package/dist/index.d.ts.map +1 -1
  424. package/dist/index.js +14 -11
  425. package/dist/index.jsx +14 -11
  426. package/dist/intl/index.d.ts +16 -0
  427. package/dist/intl/index.d.ts.map +1 -0
  428. package/dist/intl.js +212 -0
  429. package/dist/intl.js.map +1 -0
  430. package/dist/intl.jsx +212 -0
  431. package/dist/intl.jsx.map +1 -0
  432. package/dist/useDragAndDrop.d.ts +4 -2
  433. package/dist/useDragAndDrop.d.ts.map +1 -1
  434. package/dist/useDragAndDrop2.js +39 -21
  435. package/dist/useDragAndDrop2.js.map +1 -1
  436. package/dist/useDragAndDrop2.jsx +39 -21
  437. package/dist/useDragAndDrop2.jsx.map +1 -1
  438. package/dist/utils.d.ts +28 -9
  439. package/dist/utils.d.ts.map +1 -1
  440. package/dist/utils.js +96 -24
  441. package/dist/utils.js.map +1 -1
  442. package/dist/utils.jsx +81 -24
  443. package/dist/utils.jsx.map +1 -1
  444. package/dist/virtualizer/Layout.d.ts +9 -0
  445. package/dist/virtualizer/Layout.d.ts.map +1 -1
  446. package/dist/virtualizer/Layout.js +23 -2
  447. package/dist/virtualizer/Layout.js.map +1 -1
  448. package/dist/virtualizer/Layout.jsx +23 -2
  449. package/dist/virtualizer/Layout.jsx.map +1 -1
  450. package/package.json +29 -10
  451. package/src/ActionBar.tsx +50 -24
  452. package/src/ActionGroup.tsx +31 -19
  453. package/src/Alert.tsx +10 -4
  454. package/src/Autocomplete.tsx +24 -15
  455. package/src/Breadcrumbs.tsx +32 -16
  456. package/src/Button.tsx +182 -67
  457. package/src/Calendar.tsx +65 -47
  458. package/src/CalendarPicker.tsx +16 -1
  459. package/src/Checkbox.tsx +84 -116
  460. package/src/Collection.tsx +84 -3
  461. package/src/Color.tsx +282 -104
  462. package/src/ColorEditor.tsx +5 -1
  463. package/src/ComboBox.tsx +384 -109
  464. package/src/ContextualHelpTrigger.tsx +47 -41
  465. package/src/DateField.tsx +74 -106
  466. package/src/DatePicker.tsx +156 -352
  467. package/src/DateRangePickerContext.tsx +8 -0
  468. package/src/Dialog.tsx +105 -38
  469. package/src/Disclosure.tsx +29 -19
  470. package/src/DragAndDrop.tsx +43 -8
  471. package/src/DragPreview.tsx +20 -1
  472. package/src/DropZone.tsx +32 -18
  473. package/src/ElementTag.tsx +14 -104
  474. package/src/FieldError.tsx +39 -7
  475. package/src/FileTrigger.tsx +18 -3
  476. package/src/Focusable.tsx +27 -6
  477. package/src/Form.tsx +57 -11
  478. package/src/GridList.tsx +233 -141
  479. package/src/HiddenDateInput.tsx +19 -3
  480. package/src/Icon.tsx +8 -2
  481. package/src/Keyboard.tsx +18 -2
  482. package/src/Label.tsx +77 -0
  483. package/src/Landmark.tsx +6 -1
  484. package/src/Link.tsx +65 -19
  485. package/src/ListBox.tsx +645 -468
  486. package/src/ListDropTargetDelegate.ts +4 -0
  487. package/src/Menu.tsx +512 -349
  488. package/src/Meter.tsx +42 -8
  489. package/src/Modal.tsx +85 -42
  490. package/src/NumberField.tsx +161 -48
  491. package/src/Popover.tsx +424 -148
  492. package/src/Pressable.tsx +27 -6
  493. package/src/PreviewTrigger.tsx +171 -0
  494. package/src/ProgressBar.tsx +25 -3
  495. package/src/RadioGroup.tsx +230 -161
  496. package/src/RangeCalendar.tsx +75 -63
  497. package/src/RouterProvider.tsx +24 -14
  498. package/src/SearchField.tsx +118 -121
  499. package/src/Select.tsx +454 -274
  500. package/src/SelectionIndicator.tsx +21 -3
  501. package/src/Separator.tsx +17 -1
  502. package/src/SharedElementTransition.tsx +115 -97
  503. package/src/Slider.tsx +35 -17
  504. package/src/StepList.tsx +71 -32
  505. package/src/Switch.tsx +45 -29
  506. package/src/Table.tsx +446 -380
  507. package/src/Tabs.tsx +132 -155
  508. package/src/TagGroup.tsx +53 -40
  509. package/src/Text.tsx +23 -6
  510. package/src/TextField.tsx +118 -159
  511. package/src/TimeField.tsx +34 -95
  512. package/src/Toast.tsx +141 -67
  513. package/src/ToggleButton.tsx +33 -15
  514. package/src/ToggleButtonGroup.tsx +27 -9
  515. package/src/TokenField.tsx +379 -0
  516. package/src/Toolbar.tsx +19 -9
  517. package/src/Tooltip.tsx +126 -84
  518. package/src/Tree.tsx +233 -173
  519. package/src/Virtualizer.tsx +400 -138
  520. package/src/VirtualizerLayouts.ts +211 -26
  521. package/src/VisuallyHidden.tsx +22 -8
  522. package/src/contexts.ts +13 -0
  523. package/src/index.ts +32 -11
  524. package/src/intl/ar-AE.json +6 -0
  525. package/src/intl/bg-BG.json +6 -0
  526. package/src/intl/cs-CZ.json +6 -0
  527. package/src/intl/da-DK.json +6 -0
  528. package/src/intl/de-DE.json +6 -0
  529. package/src/intl/el-GR.json +6 -0
  530. package/src/intl/en-US.json +6 -0
  531. package/src/intl/es-ES.json +6 -0
  532. package/src/intl/et-EE.json +6 -0
  533. package/src/intl/fi-FI.json +6 -0
  534. package/src/intl/fr-FR.json +6 -0
  535. package/src/intl/he-IL.json +6 -0
  536. package/src/intl/hr-HR.json +6 -0
  537. package/src/intl/hu-HU.json +6 -0
  538. package/src/intl/index.ts +125 -0
  539. package/src/intl/it-IT.json +6 -0
  540. package/src/intl/ja-JP.json +6 -0
  541. package/src/intl/ko-KR.json +6 -0
  542. package/src/intl/lt-LT.json +6 -0
  543. package/src/intl/lv-LV.json +6 -0
  544. package/src/intl/nb-NO.json +6 -0
  545. package/src/intl/nl-NL.json +6 -0
  546. package/src/intl/pl-PL.json +6 -0
  547. package/src/intl/pt-BR.json +6 -0
  548. package/src/intl/pt-PT.json +6 -0
  549. package/src/intl/ro-RO.json +6 -0
  550. package/src/intl/ru-RU.json +6 -0
  551. package/src/intl/sk-SK.json +6 -0
  552. package/src/intl/sl-SI.json +6 -0
  553. package/src/intl/sr-SP.json +6 -0
  554. package/src/intl/sv-SE.json +6 -0
  555. package/src/intl/tr-TR.json +6 -0
  556. package/src/intl/uk-UA.json +6 -0
  557. package/src/intl/zh-CN.json +6 -0
  558. package/src/intl/zh-TW.json +6 -0
  559. package/src/useDragAndDrop.ts +30 -32
  560. package/src/utils.tsx +124 -68
  561. package/src/virtualizer/Layout.ts +29 -0
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField.js","names":["JSX","Context","createContext","createMemo","splitProps","useContext","createNumberField","createButton","createFocusRing","createHover","AriaNumberFieldProps","AriaButtonProps","createNumberFieldState","NumberFieldState","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","Provider","TextContext","NumberFieldRenderProps","isDisabled","isInvalid","isRequired","isReadOnly","value","NumberFieldProps","Omit","defaultValue","onChange","minValue","maxValue","step","locale","formatOptions","Intl","NumberFormatOptions","label","Element","children","class","style","NumberFieldInputRenderProps","isFocused","isFocusVisible","isHovered","NumberFieldInputProps","NumberFieldButtonRenderProps","isPressed","NumberFieldIncrementButtonProps","NumberFieldDecrementButtonProps","NumberFieldContextValue","state","inputProps","InputHTMLAttributes","HTMLInputElement","incrementButtonProps","decrementButtonProps","labelProps","HTMLAttributes","HTMLElement","groupProps","descriptionProps","errorMessageProps","setInputRef","el","NumberFieldContext","NumberFieldStateContext","NumberField","props","local","stateProps","ariaProps","rest","inputRef","numberFieldAria","aria-label","aria-labelledby","aria-describedby","description","errorMessage","id","autoFocus","name","form","onFocus","onBlur","onFocusChange","onKeyDown","onKeyUp","onPaste","onCopy","onCut","renderValues","numberValue","renderProps","defaultClassName","childRenderValues","fieldChildren","domProps","Record","global","contextValue","textSlots","slots","_$createComponent","_el$","_$getNextElement","_tmpl$","_$spread","_$mergeProps","data-disabled","undefined","data-invalid","data-required","data-readonly","_$insert","values","Array","_$runHydrationEvents","NumberFieldLabel","CSSProperties","context","Error","cleanLabelProps","ref","_ref","_el$2","_tmpl$2","NumberFieldGroup","HTMLDivElement","cleanGroupProps","_el$3","NumberFieldInput","focusProps","hoverProps","cleanInputProps","onInput","_onInput","cleanFocusProps","cleanHoverProps","handleInput","EventHandler","InputEvent","event","_el$4","_tmpl$3","_ref$","_$use","data-focused","data-focus-visible","data-hovered","NumberFieldIncrementButton","canIncrement","pressButtonProps","onClick","_onClick","disabled","_disabled","type","_type","tabIndex","_tabIndex","buttonAria","elementType","cleanButtonProps","buttonProps","_el$5","aria-disabled","data-pressed","renderChildren","NumberFieldDecrementButton","canDecrement","_el$6","Label","Group","Input","IncrementButton","DecrementButton"],"sources":["../src/NumberField.tsx"],"sourcesContent":["/**\n * NumberField component for solidaria-components\n *\n * A pre-wired headless number field that combines state + aria hooks.\n * Port of react-aria-components/src/NumberField.tsx\n */\n\nimport {\n type JSX,\n type Context,\n createContext,\n createMemo,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport {\n createNumberField,\n createButton,\n createFocusRing,\n createHover,\n type AriaNumberFieldProps,\n type AriaButtonProps,\n} from \"@proyecto-viviana/solidaria\";\nimport { createNumberFieldState, type NumberFieldState } from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n Provider,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\n\nexport interface NumberFieldRenderProps {\n /** Whether the number field is disabled. */\n isDisabled: boolean;\n /** Whether the number field is invalid. */\n isInvalid: boolean;\n /** Whether the number field is required. */\n isRequired: boolean;\n /** Whether the number field is read-only. */\n isReadOnly: boolean;\n /** The current numeric value. */\n value: number;\n}\n\nexport interface NumberFieldProps extends Omit<AriaNumberFieldProps, \"label\">, SlotProps {\n /** The current value (controlled). */\n value?: number;\n /** The default value (uncontrolled). */\n defaultValue?: number;\n /** Handler called when the value changes. */\n onChange?: (value: number) => void;\n /** The minimum value. */\n minValue?: number;\n /** The maximum value. */\n maxValue?: number;\n /** The step value for increment/decrement. */\n step?: number;\n /** The locale for number formatting. */\n locale?: string;\n /** Number format options. */\n formatOptions?: Intl.NumberFormatOptions;\n /** A visible label for the number field. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<NumberFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldRenderProps>;\n}\n\nexport interface NumberFieldInputRenderProps {\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is invalid. */\n isInvalid: boolean;\n}\n\nexport interface NumberFieldInputProps extends SlotProps {\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldInputRenderProps>;\n}\n\nexport interface NumberFieldButtonRenderProps {\n /** Whether the button is pressed. */\n isPressed: boolean;\n /** Whether the button is hovered. */\n isHovered: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n}\n\nexport interface NumberFieldIncrementButtonProps extends SlotProps {\n /** The children of the button. */\n children?: RenderChildren<NumberFieldButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldButtonRenderProps>;\n}\n\nexport interface NumberFieldDecrementButtonProps extends SlotProps {\n /** The children of the button. */\n children?: RenderChildren<NumberFieldButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldButtonRenderProps>;\n}\n\ninterface NumberFieldContextValue {\n state: NumberFieldState;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n incrementButtonProps: AriaButtonProps;\n decrementButtonProps: AriaButtonProps;\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n groupProps: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n isDisabled: boolean;\n isInvalid: boolean;\n isRequired: boolean;\n isReadOnly: boolean;\n setInputRef: (el: HTMLInputElement) => void;\n}\n\nexport const NumberFieldContext = createContext<NumberFieldContextValue | null>(null);\nexport const NumberFieldStateContext = createContext<NumberFieldState | null>(null);\n\n/**\n * A number field allows a user to enter a number and increment/decrement the value.\n */\nexport function NumberField(props: NumberFieldProps): JSX.Element {\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"step\",\n \"locale\",\n \"formatOptions\",\n ],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"isInvalid\",\n \"description\",\n \"errorMessage\",\n \"id\",\n \"autoFocus\",\n \"name\",\n \"form\",\n \"onFocus\",\n \"onBlur\",\n \"onFocusChange\",\n \"onKeyDown\",\n \"onKeyUp\",\n \"onPaste\",\n \"onCopy\",\n \"onCut\",\n ],\n );\n\n const state = createNumberFieldState({\n get value() {\n return stateProps.value;\n },\n get defaultValue() {\n return stateProps.defaultValue;\n },\n get onChange() {\n return stateProps.onChange;\n },\n get minValue() {\n return stateProps.minValue;\n },\n get maxValue() {\n return stateProps.maxValue;\n },\n get step() {\n return stateProps.step;\n },\n get locale() {\n return stateProps.locale;\n },\n get formatOptions() {\n return stateProps.formatOptions;\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n });\n\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const numberFieldAria = createNumberField(\n {\n get label() {\n return ariaProps.label;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get description() {\n return ariaProps.description;\n },\n get errorMessage() {\n return ariaProps.errorMessage;\n },\n get id() {\n return ariaProps.id;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get name() {\n return ariaProps.name;\n },\n get form() {\n return ariaProps.form;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get onPaste() {\n return ariaProps.onPaste;\n },\n get onCopy() {\n return ariaProps.onCopy;\n },\n get onCut() {\n return ariaProps.onCut;\n },\n },\n state,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<NumberFieldRenderProps>(() => ({\n isDisabled: ariaProps.isDisabled ?? false,\n isInvalid: ariaProps.isInvalid ?? false,\n isRequired: ariaProps.isRequired ?? false,\n isReadOnly: ariaProps.isReadOnly ?? false,\n value: state.numberValue(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField\",\n },\n renderValues,\n );\n\n const childRenderValues: NumberFieldRenderProps = {\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return ariaProps.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n get value() {\n return state.numberValue();\n },\n };\n\n const fieldChildren = () => {\n const children = local.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const contextValue: NumberFieldContextValue = {\n state,\n get inputProps() {\n return numberFieldAria.inputProps;\n },\n get incrementButtonProps() {\n return numberFieldAria.incrementButtonProps;\n },\n get decrementButtonProps() {\n return numberFieldAria.decrementButtonProps;\n },\n get labelProps() {\n return numberFieldAria.labelProps;\n },\n get groupProps() {\n return numberFieldAria.groupProps;\n },\n get descriptionProps() {\n return numberFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return numberFieldAria.errorMessageProps;\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return ariaProps.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n setInputRef,\n };\n // Provide the description / errorMessage props as `TextContext` slots (mirrors\n // react-aria-components' NumberField), so a `<Text slot=\"description\">` /\n // `<Text slot=\"errorMessage\">` child picks up the `id` its `aria-describedby`\n // references. Additive: existing consumers reading these off\n // `NumberFieldContext` are unaffected.\n const textSlots = {\n slots: {\n get description() {\n return numberFieldAria.descriptionProps;\n },\n get errorMessage() {\n return numberFieldAria.errorMessageProps;\n },\n },\n };\n\n return (\n <NumberFieldStateContext.Provider value={state}>\n <NumberFieldContext.Provider value={contextValue}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={ariaProps.isDisabled || undefined}\n data-invalid={ariaProps.isInvalid || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-readonly={ariaProps.isReadOnly || undefined}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </NumberFieldContext.Provider>\n </NumberFieldStateContext.Provider>\n );\n}\n\n/**\n * The label for a number field.\n */\nexport function NumberFieldLabel(props: {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}): JSX.Element {\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldLabel must be used within a NumberField\");\n }\n\n // Upstream RAC/S2 renders the NumberField label as a native `<label>` (the field's\n // `labelElementType` is the default `'label'`), so `labelProps` carries `for=inputId`.\n // This was a `<span>` — a self-inflicted divergence dropping the native for/label\n // semantics; reverted to `<label>` to match the shipped React DOM byte-for-byte.\n // (Mirror SearchFieldLabel: `labelProps` is typed for a generic element, so strip the\n // `ref` and spread the rest onto the `<label>` intrinsic.)\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = context.labelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <label\n {...cleanLabelProps()}\n class={props.class ?? \"solidaria-NumberField-label\"}\n style={props.style}\n >\n {props.children}\n </label>\n );\n}\n\n/**\n * The input group for a number field (contains input and buttons).\n */\nexport function NumberFieldGroup(props: JSX.HTMLAttributes<HTMLDivElement>): JSX.Element {\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\"]);\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldGroup must be used within a NumberField\");\n }\n\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = context.groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanGroupProps()}\n class={local.class ?? \"solidaria-NumberField-group\"}\n style={local.style}\n >\n {local.children}\n </div>\n );\n}\n\n/**\n * The input element for a number field.\n */\nexport function NumberFieldInput(props: NumberFieldInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldInput must be used within a NumberField\");\n }\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled;\n },\n });\n\n const renderValues = createMemo<NumberFieldInputRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: context.isDisabled,\n isInvalid: context.isInvalid,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const { ref: _ref, onInput: _onInput, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const handleInput: JSX.EventHandler<HTMLInputElement, InputEvent> = (event) => {\n (\n context.inputProps as unknown as { onInput?: JSX.EventHandler<HTMLInputElement, InputEvent> }\n ).onInput?.(event);\n (domProps as unknown as { onInput?: JSX.EventHandler<HTMLInputElement, InputEvent> }).onInput?.(\n event,\n );\n };\n\n return (\n <input\n {...domProps}\n ref={context.setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\n onInput={handleInput}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={context.isDisabled || undefined}\n data-invalid={context.isInvalid || undefined}\n />\n );\n}\n\n/**\n * The increment button for a number field.\n */\nexport function NumberFieldIncrementButton(props: NumberFieldIncrementButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldIncrementButton must be used within a NumberField\");\n }\n\n const isDisabled = () => context.isDisabled || !context.state.canIncrement();\n const pressButtonProps = () => {\n const {\n onClick: _onClick,\n disabled: _disabled,\n type: _type,\n tabIndex: _tabIndex,\n ...rest\n } = context.incrementButtonProps as Record<string, unknown>;\n return rest;\n };\n\n const buttonAria = createButton({\n ...pressButtonProps(),\n elementType: \"div\",\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canIncrement();\n },\n });\n\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-increment\",\n },\n renderValues,\n );\n\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n aria-disabled={isDisabled() || undefined}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={buttonAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The decrement button for a number field.\n */\nexport function NumberFieldDecrementButton(props: NumberFieldDecrementButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldDecrementButton must be used within a NumberField\");\n }\n\n const isDisabled = () => context.isDisabled || !context.state.canDecrement();\n const pressButtonProps = () => {\n const {\n onClick: _onClick,\n disabled: _disabled,\n type: _type,\n tabIndex: _tabIndex,\n ...rest\n } = context.decrementButtonProps as Record<string, unknown>;\n return rest;\n };\n\n const buttonAria = createButton({\n ...pressButtonProps(),\n elementType: \"div\",\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canDecrement();\n },\n });\n\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-decrement\",\n },\n renderValues,\n );\n\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n aria-disabled={isDisabled() || undefined}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={buttonAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\nNumberField.Label = NumberFieldLabel;\nNumberField.Group = NumberFieldGroup;\nNumberField.Input = NumberFieldInput;\nNumberField.IncrementButton = NumberFieldIncrementButton;\nNumberField.DecrementButton = NumberFieldDecrementButton;\n"],"mappings":";;;;;;;;;;;;;;AA0IA,MAAaoE,qBAAqBlE,cAA8C,IAAI;AACpF,MAAamE,0BAA0BnE,cAAuC,IAAI;;;;AAKlF,SAAgBoE,YAAYC,OAAsC;CAChE,MAAM,CAACC,OAAOC,YAAYC,WAAWC,QAAQvE,WAC3CmE,OACA;EAAC;EAAY;EAAS;EAAS;CAAM,GACrC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAe,GAEjB;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CAEX;CAEA,MAAMjB,QAAQ1C,uBAAuB;EACnC,IAAIe,QAAQ;GACV,OAAO8C,WAAW9C;EACpB;EACA,IAAIG,eAAe;GACjB,OAAO2C,WAAW3C;EACpB;EACA,IAAIC,WAAW;GACb,OAAO0C,WAAW1C;EACpB;EACA,IAAIC,WAAW;GACb,OAAOyC,WAAWzC;EACpB;EACA,IAAIC,WAAW;GACb,OAAOwC,WAAWxC;EACpB;EACA,IAAIC,OAAO;GACT,OAAOuC,WAAWvC;EACpB;EACA,IAAIC,SAAS;GACX,OAAOsC,WAAWtC;EACpB;EACA,IAAIC,gBAAgB;GAClB,OAAOqC,WAAWrC;EACpB;EACA,IAAIb,aAAa;GACf,OAAOmD,UAAUnD;EACnB;EACA,IAAIG,aAAa;GACf,OAAOgD,UAAUhD;EACnB;CACF,CAAC;CAED,IAAIkD;CACJ,MAAMV,eAAeC,OAAyB;EAC5CS,WAAWT;CACb;CAEA,MAAMU,kBAAkBvE,kBACtB;EACE,IAAIiC,QAAQ;GACV,OAAOmC,UAAUnC;EACnB;EACA,IAAI,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QAAQ3C;AACpBjE,YAAY6G,kBAAkBzB;AAC9BpF,YAAY8G,kBAAkBP"}
1
+ {"version":3,"file":"NumberField.js","names":["<FieldErrorContext value={fieldErrorContext}>\n <LabelContext value={labelContextValue}>\n <NumberFieldStateContext value={state}>\n <NumberFieldContext value={contextValue}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(ariaProps.isDisabled)}\n data-invalid={dataAttr(numberFieldAria.isInvalid)}\n data-required={dataAttr(ariaProps.isRequired)}\n data-readonly={dataAttr(ariaProps.isReadOnly)}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </NumberFieldContext>\n </NumberFieldStateContext>\n </LabelContext>\n </FieldErrorContext>","value={fieldErrorContext}","<LabelContext value={labelContextValue}>\n <NumberFieldStateContext value={state}>\n <NumberFieldContext value={contextValue}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(ariaProps.isDisabled)}\n data-invalid={dataAttr(numberFieldAria.isInvalid)}\n data-required={dataAttr(ariaProps.isRequired)}\n data-readonly={dataAttr(ariaProps.isReadOnly)}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </NumberFieldContext>\n </NumberFieldStateContext>\n </LabelContext>","value={labelContextValue}","<NumberFieldStateContext value={state}>\n <NumberFieldContext value={contextValue}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(ariaProps.isDisabled)}\n data-invalid={dataAttr(numberFieldAria.isInvalid)}\n data-required={dataAttr(ariaProps.isRequired)}\n data-readonly={dataAttr(ariaProps.isReadOnly)}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </NumberFieldContext>\n </NumberFieldStateContext>","value={state}","<NumberFieldContext value={contextValue}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(ariaProps.isDisabled)}\n data-invalid={dataAttr(numberFieldAria.isInvalid)}\n data-required={dataAttr(ariaProps.isRequired)}\n data-readonly={dataAttr(ariaProps.isReadOnly)}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </NumberFieldContext>","value={contextValue}","<Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>","values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}","<div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(ariaProps.isDisabled)}\n data-invalid={dataAttr(numberFieldAria.isInvalid)}\n data-required={dataAttr(ariaProps.isRequired)}\n data-readonly={dataAttr(ariaProps.isReadOnly)}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>","ref={(el) => context.labelRef?.(el)}","{props.children}","<label\n {...cleanLabelProps()}\n ref={(el) => context.labelRef?.(el)}\n class={props.class ?? \"solidaria-NumberField-label\"}\n style={props.style}\n >\n {props.children}\n </label>","{local.children}","<div\n {...domProps}\n {...cleanGroupProps()}\n class={local.class ?? \"solidaria-NumberField-group\"}\n style={local.style}\n >\n {local.children}\n </div>","ref={context.setInputRef}","onInput={handleInput}","<input\n {...domProps}\n ref={context.setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\n onInput={handleInput}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(context.isDisabled)}\n data-invalid={dataAttr(context.isInvalid)}\n />","{renderProps.renderChildren()}","<div\n {...domProps}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n aria-disabled={attrTrue(isDisabled())}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={dataAttr(buttonAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(isDisabled())}\n >\n {renderProps.renderChildren()}\n </div>"],"sources":["../src/NumberField.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/NumberField.tsx\n\n/**\n * NumberField component for solidaria-components\n *\n * A pre-wired headless number field that combines state + aria hooks.\n * Port of react-aria-components/src/NumberField.tsx\n */\n\nimport { createContext, createMemo, createSignal, useContext } from \"solid-js\";\nimport type { Context } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createNumberField,\n createButton,\n createFocusRing,\n createHover,\n type AriaNumberFieldProps,\n type AriaButtonProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createNumberFieldState,\n type NumberFieldState,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FormContext, resolveValidationBehavior } from \"./Form\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n Provider,\n useSlot,\n dataAttr,\n attrTrue,\n attrString,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\nimport { LabelContext, type LabelProps } from \"./Label\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface NumberFieldRenderProps {\n /** Whether the number field is disabled. */\n isDisabled: boolean;\n /** Whether the number field is invalid. */\n isInvalid: boolean;\n /** Whether the number field is required. */\n isRequired: boolean;\n /** Whether the number field is read-only. */\n isReadOnly: boolean;\n /** The current numeric value. */\n value: number;\n}\n\nexport interface NumberFieldProps extends Omit<AriaNumberFieldProps, \"label\">, SlotProps {\n /** The current value (controlled). */\n value?: number;\n /** The default value (uncontrolled). */\n defaultValue?: number;\n /** Handler called when the value changes. */\n onChange?: (value: number) => void;\n /** The minimum value. */\n minValue?: number;\n /** The maximum value. */\n maxValue?: number;\n /** The step value for increment/decrement. */\n step?: number;\n /** The locale for number formatting. */\n locale?: string;\n /** Number format options. */\n formatOptions?: Intl.NumberFormatOptions;\n /** A visible label for the number field. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<NumberFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldRenderProps>;\n}\n\nexport interface NumberFieldInputRenderProps {\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is invalid. */\n isInvalid: boolean;\n}\n\nexport interface NumberFieldInputProps extends SlotProps {\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldInputRenderProps>;\n}\n\nexport interface NumberFieldButtonRenderProps {\n /** Whether the button is pressed. */\n isPressed: boolean;\n /** Whether the button is hovered. */\n isHovered: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n}\n\nexport interface NumberFieldIncrementButtonProps extends SlotProps {\n /** The children of the button. */\n children?: RenderChildren<NumberFieldButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldButtonRenderProps>;\n}\n\nexport interface NumberFieldDecrementButtonProps extends SlotProps {\n /** The children of the button. */\n children?: RenderChildren<NumberFieldButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldButtonRenderProps>;\n}\n\ninterface NumberFieldContextValue {\n state: NumberFieldState;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n incrementButtonProps: AriaButtonProps;\n decrementButtonProps: AriaButtonProps;\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n groupProps: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n isDisabled: boolean;\n isInvalid: boolean;\n isRequired: boolean;\n isReadOnly: boolean;\n setInputRef: (el: HTMLInputElement) => void;\n /** Slot probe for the rendered label, so `useLabel` knows a label exists. */\n labelRef?: (el: Element | null) => void;\n}\n\nexport const NumberFieldContext = createContext<NumberFieldContextValue | null>(null);\nexport const NumberFieldStateContext = createContext<NumberFieldState | null>(null);\n\n/**\n * A number field allows a user to enter a number and increment/decrement the value.\n */\nexport function NumberField(props: NumberFieldProps): JSX.Element {\n const formContext = useContext(FormContext);\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"step\",\n \"locale\",\n \"formatOptions\",\n ],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"isInvalid\",\n \"description\",\n \"errorMessage\",\n \"id\",\n \"autoFocus\",\n \"name\",\n \"form\",\n \"onFocus\",\n \"onBlur\",\n \"onFocusChange\",\n \"onKeyDown\",\n \"onKeyUp\",\n \"onPaste\",\n \"onCopy\",\n \"onCut\",\n \"validationBehavior\",\n \"commitBehavior\",\n \"validate\",\n \"validationState\",\n ],\n );\n\n const state = createNumberFieldState({\n get value() {\n return stateProps.value;\n },\n get defaultValue() {\n return stateProps.defaultValue;\n },\n get onChange() {\n return stateProps.onChange;\n },\n get minValue() {\n return stateProps.minValue;\n },\n get maxValue() {\n return stateProps.maxValue;\n },\n get step() {\n return stateProps.step;\n },\n get locale() {\n return stateProps.locale;\n },\n get formatOptions() {\n return stateProps.formatOptions;\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get validationState() {\n return ariaProps.validationState;\n },\n get validate() {\n return ariaProps.validate;\n },\n get name() {\n return ariaProps.name;\n },\n get validationBehavior() {\n return resolveValidationBehavior(ariaProps.validationBehavior, formContext);\n },\n get commitBehavior() {\n return ariaProps.commitBehavior;\n },\n });\n\n const [inputEl, setInputEl] = createSignal<HTMLInputElement | undefined>(undefined, {\n ownedWrite: true,\n });\n const setInputRef = (el: HTMLInputElement) => {\n setInputEl(el);\n };\n\n const [labelRef, hasLabel] = useSlot(!ariaProps[\"aria-label\"] && !ariaProps[\"aria-labelledby\"]);\n\n const numberFieldAria = createNumberField(\n {\n // A slotted `<Label>` / `<NumberFieldLabel>` counts as a label, exactly\n // as RAC's `useSlot` does (`NumberField.tsx:117`). Without it `useLabel`\n // mints no `labelProps` and the input has no accessible name.\n get label() {\n return ariaProps.label ?? hasLabel();\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get description() {\n return ariaProps.description;\n },\n get errorMessage() {\n return ariaProps.errorMessage;\n },\n get id() {\n return ariaProps.id;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get name() {\n return ariaProps.name;\n },\n get form() {\n return ariaProps.form;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get onPaste() {\n return ariaProps.onPaste;\n },\n get onCopy() {\n return ariaProps.onCopy;\n },\n get onCut() {\n return ariaProps.onCut;\n },\n get validationBehavior() {\n return ariaProps.validationBehavior;\n },\n get commitBehavior() {\n return ariaProps.commitBehavior;\n },\n get validate() {\n return ariaProps.validate;\n },\n get validationState() {\n return ariaProps.validationState;\n },\n },\n state,\n () => inputEl() ?? null,\n );\n\n const renderValues = createMemo<NumberFieldRenderProps>(() => ({\n isDisabled: ariaProps.isDisabled ?? false,\n isInvalid: numberFieldAria.isInvalid,\n isRequired: ariaProps.isRequired ?? false,\n isReadOnly: ariaProps.isReadOnly ?? false,\n value: state.numberValue(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField\",\n },\n renderValues,\n );\n\n const childRenderValues: NumberFieldRenderProps = {\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return numberFieldAria.isInvalid;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n get value() {\n return state.numberValue();\n },\n };\n\n const fieldChildren = () => {\n const children = local.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const contextValue: NumberFieldContextValue = {\n state,\n get inputProps() {\n return numberFieldAria.inputProps;\n },\n get incrementButtonProps() {\n return numberFieldAria.incrementButtonProps;\n },\n get decrementButtonProps() {\n return numberFieldAria.decrementButtonProps;\n },\n get labelProps() {\n return numberFieldAria.labelProps;\n },\n get groupProps() {\n return numberFieldAria.groupProps;\n },\n get descriptionProps() {\n return numberFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return numberFieldAria.errorMessageProps;\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return numberFieldAria.isInvalid;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n setInputRef,\n labelRef,\n };\n\n // RAC exposes one shared `<Label>` through `LabelContext`; `NumberFieldLabel`\n // is a local convenience alias over the same wiring.\n const labelContextValue: LabelProps = {\n ref: labelRef,\n get id() {\n return (numberFieldAria.labelProps as JSX.LabelHTMLAttributes<HTMLLabelElement>).id;\n },\n get htmlFor() {\n const labelProps = numberFieldAria.labelProps as JSX.LabelHTMLAttributes<HTMLLabelElement> & {\n htmlFor?: string;\n };\n return attrString(labelProps.htmlFor ?? labelProps.for);\n },\n get for() {\n const labelProps = numberFieldAria.labelProps as JSX.LabelHTMLAttributes<HTMLLabelElement> & {\n htmlFor?: string;\n };\n return attrString(labelProps.htmlFor ?? labelProps.for);\n },\n };\n // Provide the description / errorMessage props as `TextContext` slots (mirrors\n // react-aria-components' NumberField), so a `<Text slot=\"description\">` /\n // `<Text slot=\"errorMessage\">` child picks up the `id` its `aria-describedby`\n // references. Additive: existing consumers reading these off\n // `NumberFieldContext` are unaffected.\n const textSlots = {\n slots: {\n get description() {\n return numberFieldAria.descriptionProps;\n },\n get errorMessage() {\n return numberFieldAria.errorMessageProps;\n },\n },\n };\n const fieldValidation = createMemo<ValidationResult>(() => {\n const isInvalid = numberFieldAria.isInvalid;\n const validationErrors = numberFieldAria.validationErrors;\n const errorMessage = ariaProps.errorMessage;\n return {\n isInvalid,\n validationErrors:\n isInvalid && validationErrors.length === 0 && typeof errorMessage === \"string\"\n ? [errorMessage]\n : validationErrors,\n validationDetails: numberFieldAria.validationDetails,\n };\n });\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return fieldValidation();\n },\n get errorMessageProps() {\n return numberFieldAria.errorMessageProps;\n },\n };\n\n return (\n <FieldErrorContext value={fieldErrorContext}>\n <LabelContext value={labelContextValue}>\n <NumberFieldStateContext value={state}>\n <NumberFieldContext value={contextValue}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(ariaProps.isDisabled)}\n data-invalid={dataAttr(numberFieldAria.isInvalid)}\n data-required={dataAttr(ariaProps.isRequired)}\n data-readonly={dataAttr(ariaProps.isReadOnly)}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </NumberFieldContext>\n </NumberFieldStateContext>\n </LabelContext>\n </FieldErrorContext>\n );\n}\n\n/**\n * The label for a number field.\n */\nexport function NumberFieldLabel(props: {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}): JSX.Element {\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldLabel must be used within a NumberField\");\n }\n\n // Upstream RAC/S2 renders the NumberField label as a native `<label>` (the field's\n // `labelElementType` is the default `'label'`), so `labelProps` carries `for=inputId`.\n // This was a `<span>` — a self-inflicted divergence dropping the native for/label\n // semantics; reverted to `<label>` to match the shipped React DOM byte-for-byte.\n // (Mirror SearchFieldLabel: `labelProps` is typed for a generic element, so strip the\n // `ref` and spread the rest onto the `<label>` intrinsic.)\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = context.labelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <label\n {...cleanLabelProps()}\n ref={(el) => context.labelRef?.(el)}\n class={props.class ?? \"solidaria-NumberField-label\"}\n style={props.style}\n >\n {props.children}\n </label>\n );\n}\n\n/**\n * The input group for a number field (contains input and buttons).\n */\nexport function NumberFieldGroup(props: JSX.HTMLAttributes<HTMLDivElement>): JSX.Element {\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\"]);\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldGroup must be used within a NumberField\");\n }\n\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = context.groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanGroupProps()}\n class={local.class ?? \"solidaria-NumberField-group\"}\n style={local.style}\n >\n {local.children}\n </div>\n );\n}\n\n/**\n * The input element for a number field.\n */\nexport function NumberFieldInput(props: NumberFieldInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldInput must be used within a NumberField\");\n }\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled;\n },\n });\n\n const renderValues = createMemo<NumberFieldInputRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: context.isDisabled,\n isInvalid: context.isInvalid,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const { ref: _ref, onInput: _onInput, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const handleInput: JSX.EventHandler<HTMLInputElement, InputEvent> = (event) => {\n (\n context.inputProps as unknown as { onInput?: JSX.EventHandler<HTMLInputElement, InputEvent> }\n ).onInput?.(event);\n (domProps as unknown as { onInput?: JSX.EventHandler<HTMLInputElement, InputEvent> }).onInput?.(\n event,\n );\n };\n\n return (\n <input\n {...domProps}\n ref={context.setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\n onInput={handleInput}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(context.isDisabled)}\n data-invalid={dataAttr(context.isInvalid)}\n />\n );\n}\n\n/**\n * The increment button for a number field.\n */\nexport function NumberFieldIncrementButton(props: NumberFieldIncrementButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldIncrementButton must be used within a NumberField\");\n }\n\n const isDisabled = () => context.isDisabled || !context.state.canIncrement();\n const pressButtonProps = () => {\n const {\n onClick: _onClick,\n disabled: _disabled,\n type: _type,\n tabindex: _tabIndex,\n ...rest\n } = context.incrementButtonProps as Record<string, unknown>;\n return rest;\n };\n\n const buttonAria = createButton({\n ...pressButtonProps(),\n elementType: \"div\",\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canIncrement();\n },\n });\n\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-increment\",\n },\n renderValues,\n );\n\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n aria-disabled={attrTrue(isDisabled())}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={dataAttr(buttonAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(isDisabled())}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The decrement button for a number field.\n */\nexport function NumberFieldDecrementButton(props: NumberFieldDecrementButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldDecrementButton must be used within a NumberField\");\n }\n\n const isDisabled = () => context.isDisabled || !context.state.canDecrement();\n const pressButtonProps = () => {\n const {\n onClick: _onClick,\n disabled: _disabled,\n type: _type,\n tabindex: _tabIndex,\n ...rest\n } = context.decrementButtonProps as Record<string, unknown>;\n return rest;\n };\n\n const buttonAria = createButton({\n ...pressButtonProps(),\n elementType: \"div\",\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canDecrement();\n },\n });\n\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-decrement\",\n },\n renderValues,\n );\n\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n aria-disabled={attrTrue(isDisabled())}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={dataAttr(buttonAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(isDisabled())}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\nNumberField.Label = NumberFieldLabel;\nNumberField.Group = NumberFieldGroup;\nNumberField.Input = NumberFieldInput;\nNumberField.IncrementButton = NumberFieldIncrementButton;\nNumberField.DecrementButton = NumberFieldDecrementButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiKA,MAAa,qBAAqB,cAA8C,IAAI;AACpF,MAAa,0BAA0B,cAAuC,IAAI;;;;AAKlF,SAAgB,YAAY,OAAsC;CAChE,MAAM,cAAc,WAAW,WAAW;CAC1C,MAAM,CAAC,OAAO,YAAY,WAAW,QAAQ,WAC3C,OACA;EAAC;EAAY;EAAS;EAAS;CAAM,GACrC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,GACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,QAAQ,uBAAuB;EACnC,IAAI,QAAQ;GACV,OAAO,WAAW;EACpB;EACA,IAAI,eAAe;GACjB,OAAO,WAAW;EACpB;EACA,IAAI,WAAW;GACb,OAAO,WAAW;EACpB;EACA,IAAI,WAAW;GACb,OAAO,WAAW;EACpB;EACA,IAAI,WAAW;GACb,OAAO,WAAW;EACpB;EACA,IAAI,OAAO;GACT,OAAO,WAAW;EACpB;EACA,IAAI,SAAS;GACX,OAAO,WAAW;EACpB;EACA,IAAI,gBAAgB;GAClB,OAAO,WAAW;EACpB;EACA,IAAI,aAAa;GACf,OAAO,UAAU;EACnB;EACA,IAAI,aAAa;GACf,OAAO,UAAU;EACnB;EACA,IAAI,YAAY;GACd,OAAO,UAAU;EACnB;EACA,IAAI,kBAAkB;GACpB,OAAO,UAAU;EACnB;EACA,IAAI,WAAW;GACb,OAAO,UAAU;EACnB;EACA,IAAI,OAAO;GACT,O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AAkB"}
@@ -1,7 +1,23 @@
1
- import { Provider, filterDOMProps, useRenderProps } from "./utils.jsx";
1
+ /*
2
+ * Copyright 2022 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/NumberField.tsx
13
+ import { Provider, attrString as attrString$1, attrTrue, dataAttr, filterDOMProps, useRenderProps, useSlot } from "./utils.jsx";
2
14
  import { TextContext } from "./Text.jsx";
3
- import { createContext, createMemo, splitProps, useContext } from "solid-js";
15
+ import { FieldErrorContext } from "./FieldError.jsx";
16
+ import { FormContext, resolveValidationBehavior } from "./Form.jsx";
17
+ import { n as LabelContext } from "./Label.jsx";
18
+ import { createContext, createMemo, createSignal, useContext } from "solid-js";
4
19
  import { createButton, createFocusRing, createHover, createNumberField } from "@proyecto-viviana/solidaria";
20
+ import { splitProps } from "@proyecto-viviana/solidaria/utils";
5
21
  import { createNumberFieldState } from "@proyecto-viviana/solid-stately";
6
22
  //#region src/NumberField.tsx
7
23
  /**
@@ -16,6 +32,7 @@ const NumberFieldStateContext = createContext(null);
16
32
  * A number field allows a user to enter a number and increment/decrement the value.
17
33
  */
18
34
  function NumberField(props) {
35
+ const formContext = useContext(FormContext);
19
36
  const [local, stateProps, ariaProps, rest] = splitProps(props, [
20
37
  "children",
21
38
  "class",
@@ -52,7 +69,11 @@ function NumberField(props) {
52
69
  "onKeyUp",
53
70
  "onPaste",
54
71
  "onCopy",
55
- "onCut"
72
+ "onCut",
73
+ "validationBehavior",
74
+ "commitBehavior",
75
+ "validate",
76
+ "validationState"
56
77
  ]);
57
78
  const state = createNumberFieldState({
58
79
  get value() {
@@ -84,15 +105,34 @@ function NumberField(props) {
84
105
  },
85
106
  get isReadOnly() {
86
107
  return ariaProps.isReadOnly;
108
+ },
109
+ get isInvalid() {
110
+ return ariaProps.isInvalid;
111
+ },
112
+ get validationState() {
113
+ return ariaProps.validationState;
114
+ },
115
+ get validate() {
116
+ return ariaProps.validate;
117
+ },
118
+ get name() {
119
+ return ariaProps.name;
120
+ },
121
+ get validationBehavior() {
122
+ return resolveValidationBehavior(ariaProps.validationBehavior, formContext);
123
+ },
124
+ get commitBehavior() {
125
+ return ariaProps.commitBehavior;
87
126
  }
88
127
  });
89
- let inputRef;
128
+ const [inputEl, setInputEl] = createSignal(void 0, { ownedWrite: true });
90
129
  const setInputRef = (el) => {
91
- inputRef = el;
130
+ setInputEl(el);
92
131
  };
132
+ const [labelRef, hasLabel] = useSlot(!ariaProps["aria-label"] && !ariaProps["aria-labelledby"]);
93
133
  const numberFieldAria = createNumberField({
94
134
  get label() {
95
- return ariaProps.label;
135
+ return ariaProps.label ?? hasLabel();
96
136
  },
97
137
  get "aria-label"() {
98
138
  return ariaProps["aria-label"];
@@ -156,11 +196,23 @@ function NumberField(props) {
156
196
  },
157
197
  get onCut() {
158
198
  return ariaProps.onCut;
199
+ },
200
+ get validationBehavior() {
201
+ return ariaProps.validationBehavior;
202
+ },
203
+ get commitBehavior() {
204
+ return ariaProps.commitBehavior;
205
+ },
206
+ get validate() {
207
+ return ariaProps.validate;
208
+ },
209
+ get validationState() {
210
+ return ariaProps.validationState;
159
211
  }
160
- }, state, () => inputRef ?? null);
212
+ }, state, () => inputEl() ?? null);
161
213
  const renderValues = createMemo(() => ({
162
214
  isDisabled: ariaProps.isDisabled ?? false,
163
- isInvalid: ariaProps.isInvalid ?? false,
215
+ isInvalid: numberFieldAria.isInvalid,
164
216
  isRequired: ariaProps.isRequired ?? false,
165
217
  isReadOnly: ariaProps.isReadOnly ?? false,
166
218
  value: state.numberValue()
@@ -178,7 +230,7 @@ function NumberField(props) {
178
230
  return ariaProps.isDisabled ?? false;
179
231
  },
180
232
  get isInvalid() {
181
- return ariaProps.isInvalid ?? false;
233
+ return numberFieldAria.isInvalid;
182
234
  },
183
235
  get isRequired() {
184
236
  return ariaProps.isRequired ?? false;
@@ -222,7 +274,7 @@ function NumberField(props) {
222
274
  return ariaProps.isDisabled ?? false;
223
275
  },
224
276
  get isInvalid() {
225
- return ariaProps.isInvalid ?? false;
277
+ return numberFieldAria.isInvalid;
226
278
  },
227
279
  get isRequired() {
228
280
  return ariaProps.isRequired ?? false;
@@ -230,7 +282,22 @@ function NumberField(props) {
230
282
  get isReadOnly() {
231
283
  return ariaProps.isReadOnly ?? false;
232
284
  },
233
- setInputRef
285
+ setInputRef,
286
+ labelRef
287
+ };
288
+ const labelContextValue = {
289
+ ref: labelRef,
290
+ get id() {
291
+ return numberFieldAria.labelProps.id;
292
+ },
293
+ get htmlFor() {
294
+ const labelProps = numberFieldAria.labelProps;
295
+ return attrString$1(labelProps.htmlFor ?? labelProps.for);
296
+ },
297
+ get for() {
298
+ const labelProps = numberFieldAria.labelProps;
299
+ return attrString$1(labelProps.htmlFor ?? labelProps.for);
300
+ }
234
301
  };
235
302
  const textSlots = { slots: {
236
303
  get description() {
@@ -240,15 +307,37 @@ function NumberField(props) {
240
307
  return numberFieldAria.errorMessageProps;
241
308
  }
242
309
  } };
243
- return <NumberFieldStateContext.Provider value={state}>
244
- <NumberFieldContext.Provider value={contextValue}>
245
- <div {...domProps()} class={renderProps.class()} style={renderProps.style()} data-disabled={ariaProps.isDisabled || void 0} data-invalid={ariaProps.isInvalid || void 0} data-required={ariaProps.isRequired || void 0} data-readonly={ariaProps.isReadOnly || void 0}>
246
- <Provider values={[[TextContext, textSlots]]}>
247
- {fieldChildren()}
248
- </Provider>
249
- </div>
250
- </NumberFieldContext.Provider>
251
- </NumberFieldStateContext.Provider>;
310
+ const fieldValidation = createMemo(() => {
311
+ const isInvalid = numberFieldAria.isInvalid;
312
+ const validationErrors = numberFieldAria.validationErrors;
313
+ const errorMessage = ariaProps.errorMessage;
314
+ return {
315
+ isInvalid,
316
+ validationErrors: isInvalid && validationErrors.length === 0 && typeof errorMessage === "string" ? [errorMessage] : validationErrors,
317
+ validationDetails: numberFieldAria.validationDetails
318
+ };
319
+ });
320
+ const fieldErrorContext = {
321
+ get validation() {
322
+ return fieldValidation();
323
+ },
324
+ get errorMessageProps() {
325
+ return numberFieldAria.errorMessageProps;
326
+ }
327
+ };
328
+ return <FieldErrorContext value={fieldErrorContext}>
329
+ <LabelContext value={labelContextValue}>
330
+ <NumberFieldStateContext value={state}>
331
+ <NumberFieldContext value={contextValue}>
332
+ <div {...domProps()} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(ariaProps.isDisabled)} data-invalid={dataAttr(numberFieldAria.isInvalid)} data-required={dataAttr(ariaProps.isRequired)} data-readonly={dataAttr(ariaProps.isReadOnly)}>
333
+ <Provider values={[[TextContext, textSlots]]}>
334
+ {fieldChildren()}
335
+ </Provider>
336
+ </div>
337
+ </NumberFieldContext>
338
+ </NumberFieldStateContext>
339
+ </LabelContext>
340
+ </FieldErrorContext>;
252
341
  }
253
342
  /**
254
343
  * The label for a number field.
@@ -260,7 +349,7 @@ function NumberFieldLabel(props) {
260
349
  const { ref: _ref, ...rest } = context.labelProps;
261
350
  return rest;
262
351
  };
263
- return <label {...cleanLabelProps()} class={props.class ?? "solidaria-NumberField-label"} style={props.style}>
352
+ return <label {...cleanLabelProps()} ref={(el) => context.labelRef?.(el)} class={props.class ?? "solidaria-NumberField-label"} style={props.style}>
264
353
  {props.children}
265
354
  </label>;
266
355
  }
@@ -326,7 +415,7 @@ function NumberFieldInput(props) {
326
415
  context.inputProps.onInput?.(event);
327
416
  domProps.onInput?.(event);
328
417
  };
329
- return <input {...domProps} ref={context.setInputRef} {...cleanInputProps()} {...cleanFocusProps()} {...cleanHoverProps()} onInput={handleInput} class={renderProps.class()} style={renderProps.style()} data-focused={isFocused() || void 0} data-focus-visible={isFocusVisible() || void 0} data-hovered={isHovered() || void 0} data-disabled={context.isDisabled || void 0} data-invalid={context.isInvalid || void 0} />;
418
+ return <input {...domProps} ref={context.setInputRef} {...cleanInputProps()} {...cleanFocusProps()} {...cleanHoverProps()} onInput={handleInput} class={renderProps.class()} style={renderProps.style()} data-focused={dataAttr(isFocused())} data-focus-visible={dataAttr(isFocusVisible())} data-hovered={dataAttr(isHovered())} data-disabled={dataAttr(context.isDisabled)} data-invalid={dataAttr(context.isInvalid)} />;
330
419
  }
331
420
  /**
332
421
  * The increment button for a number field.
@@ -342,7 +431,7 @@ function NumberFieldIncrementButton(props) {
342
431
  if (!context) throw new Error("NumberFieldIncrementButton must be used within a NumberField");
343
432
  const isDisabled = () => context.isDisabled || !context.state.canIncrement();
344
433
  const pressButtonProps = () => {
345
- const { onClick: _onClick, disabled: _disabled, type: _type, tabIndex: _tabIndex, ...rest } = context.incrementButtonProps;
434
+ const { onClick: _onClick, disabled: _disabled, type: _type, tabindex: _tabIndex, ...rest } = context.incrementButtonProps;
346
435
  return rest;
347
436
  };
348
437
  const buttonAria = createButton({
@@ -376,7 +465,7 @@ function NumberFieldIncrementButton(props) {
376
465
  const { ref: _ref, ...rest } = hoverProps;
377
466
  return rest;
378
467
  };
379
- return <div {...domProps} {...cleanButtonProps()} {...cleanHoverProps()} aria-disabled={isDisabled() || void 0} class={renderProps.class()} style={renderProps.style()} data-pressed={buttonAria.isPressed() || void 0} data-hovered={isHovered() || void 0} data-disabled={isDisabled() || void 0}>
468
+ return <div {...domProps} {...cleanButtonProps()} {...cleanHoverProps()} aria-disabled={attrTrue(isDisabled())} class={renderProps.class()} style={renderProps.style()} data-pressed={dataAttr(buttonAria.isPressed())} data-hovered={dataAttr(isHovered())} data-disabled={dataAttr(isDisabled())}>
380
469
  {renderProps.renderChildren()}
381
470
  </div>;
382
471
  }
@@ -394,7 +483,7 @@ function NumberFieldDecrementButton(props) {
394
483
  if (!context) throw new Error("NumberFieldDecrementButton must be used within a NumberField");
395
484
  const isDisabled = () => context.isDisabled || !context.state.canDecrement();
396
485
  const pressButtonProps = () => {
397
- const { onClick: _onClick, disabled: _disabled, type: _type, tabIndex: _tabIndex, ...rest } = context.decrementButtonProps;
486
+ const { onClick: _onClick, disabled: _disabled, type: _type, tabindex: _tabIndex, ...rest } = context.decrementButtonProps;
398
487
  return rest;
399
488
  };
400
489
  const buttonAria = createButton({
@@ -428,7 +517,7 @@ function NumberFieldDecrementButton(props) {
428
517
  const { ref: _ref, ...rest } = hoverProps;
429
518
  return rest;
430
519
  };
431
- return <div {...domProps} {...cleanButtonProps()} {...cleanHoverProps()} aria-disabled={isDisabled() || void 0} class={renderProps.class()} style={renderProps.style()} data-pressed={buttonAria.isPressed() || void 0} data-hovered={isHovered() || void 0} data-disabled={isDisabled() || void 0}>
520
+ return <div {...domProps} {...cleanButtonProps()} {...cleanHoverProps()} aria-disabled={attrTrue(isDisabled())} class={renderProps.class()} style={renderProps.style()} data-pressed={dataAttr(buttonAria.isPressed())} data-hovered={dataAttr(isHovered())} data-disabled={dataAttr(isDisabled())}>
432
521
  {renderProps.renderChildren()}
433
522
  </div>;
434
523
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField.jsx","names":[],"sources":["../src/NumberField.tsx"],"sourcesContent":["/**\n * NumberField component for solidaria-components\n *\n * A pre-wired headless number field that combines state + aria hooks.\n * Port of react-aria-components/src/NumberField.tsx\n */\n\nimport {\n type JSX,\n type Context,\n createContext,\n createMemo,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport {\n createNumberField,\n createButton,\n createFocusRing,\n createHover,\n type AriaNumberFieldProps,\n type AriaButtonProps,\n} from \"@proyecto-viviana/solidaria\";\nimport { createNumberFieldState, type NumberFieldState } from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n Provider,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\n\nexport interface NumberFieldRenderProps {\n /** Whether the number field is disabled. */\n isDisabled: boolean;\n /** Whether the number field is invalid. */\n isInvalid: boolean;\n /** Whether the number field is required. */\n isRequired: boolean;\n /** Whether the number field is read-only. */\n isReadOnly: boolean;\n /** The current numeric value. */\n value: number;\n}\n\nexport interface NumberFieldProps extends Omit<AriaNumberFieldProps, \"label\">, SlotProps {\n /** The current value (controlled). */\n value?: number;\n /** The default value (uncontrolled). */\n defaultValue?: number;\n /** Handler called when the value changes. */\n onChange?: (value: number) => void;\n /** The minimum value. */\n minValue?: number;\n /** The maximum value. */\n maxValue?: number;\n /** The step value for increment/decrement. */\n step?: number;\n /** The locale for number formatting. */\n locale?: string;\n /** Number format options. */\n formatOptions?: Intl.NumberFormatOptions;\n /** A visible label for the number field. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<NumberFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldRenderProps>;\n}\n\nexport interface NumberFieldInputRenderProps {\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is invalid. */\n isInvalid: boolean;\n}\n\nexport interface NumberFieldInputProps extends SlotProps {\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldInputRenderProps>;\n}\n\nexport interface NumberFieldButtonRenderProps {\n /** Whether the button is pressed. */\n isPressed: boolean;\n /** Whether the button is hovered. */\n isHovered: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n}\n\nexport interface NumberFieldIncrementButtonProps extends SlotProps {\n /** The children of the button. */\n children?: RenderChildren<NumberFieldButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldButtonRenderProps>;\n}\n\nexport interface NumberFieldDecrementButtonProps extends SlotProps {\n /** The children of the button. */\n children?: RenderChildren<NumberFieldButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldButtonRenderProps>;\n}\n\ninterface NumberFieldContextValue {\n state: NumberFieldState;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n incrementButtonProps: AriaButtonProps;\n decrementButtonProps: AriaButtonProps;\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n groupProps: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n isDisabled: boolean;\n isInvalid: boolean;\n isRequired: boolean;\n isReadOnly: boolean;\n setInputRef: (el: HTMLInputElement) => void;\n}\n\nexport const NumberFieldContext = createContext<NumberFieldContextValue | null>(null);\nexport const NumberFieldStateContext = createContext<NumberFieldState | null>(null);\n\n/**\n * A number field allows a user to enter a number and increment/decrement the value.\n */\nexport function NumberField(props: NumberFieldProps): JSX.Element {\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"step\",\n \"locale\",\n \"formatOptions\",\n ],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"isInvalid\",\n \"description\",\n \"errorMessage\",\n \"id\",\n \"autoFocus\",\n \"name\",\n \"form\",\n \"onFocus\",\n \"onBlur\",\n \"onFocusChange\",\n \"onKeyDown\",\n \"onKeyUp\",\n \"onPaste\",\n \"onCopy\",\n \"onCut\",\n ],\n );\n\n const state = createNumberFieldState({\n get value() {\n return stateProps.value;\n },\n get defaultValue() {\n return stateProps.defaultValue;\n },\n get onChange() {\n return stateProps.onChange;\n },\n get minValue() {\n return stateProps.minValue;\n },\n get maxValue() {\n return stateProps.maxValue;\n },\n get step() {\n return stateProps.step;\n },\n get locale() {\n return stateProps.locale;\n },\n get formatOptions() {\n return stateProps.formatOptions;\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n });\n\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const numberFieldAria = createNumberField(\n {\n get label() {\n return ariaProps.label;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get description() {\n return ariaProps.description;\n },\n get errorMessage() {\n return ariaProps.errorMessage;\n },\n get id() {\n return ariaProps.id;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get name() {\n return ariaProps.name;\n },\n get form() {\n return ariaProps.form;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get onPaste() {\n return ariaProps.onPaste;\n },\n get onCopy() {\n return ariaProps.onCopy;\n },\n get onCut() {\n return ariaProps.onCut;\n },\n },\n state,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<NumberFieldRenderProps>(() => ({\n isDisabled: ariaProps.isDisabled ?? false,\n isInvalid: ariaProps.isInvalid ?? false,\n isRequired: ariaProps.isRequired ?? false,\n isReadOnly: ariaProps.isReadOnly ?? false,\n value: state.numberValue(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField\",\n },\n renderValues,\n );\n\n const childRenderValues: NumberFieldRenderProps = {\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return ariaProps.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n get value() {\n return state.numberValue();\n },\n };\n\n const fieldChildren = () => {\n const children = local.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const contextValue: NumberFieldContextValue = {\n state,\n get inputProps() {\n return numberFieldAria.inputProps;\n },\n get incrementButtonProps() {\n return numberFieldAria.incrementButtonProps;\n },\n get decrementButtonProps() {\n return numberFieldAria.decrementButtonProps;\n },\n get labelProps() {\n return numberFieldAria.labelProps;\n },\n get groupProps() {\n return numberFieldAria.groupProps;\n },\n get descriptionProps() {\n return numberFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return numberFieldAria.errorMessageProps;\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return ariaProps.isInvalid ?? false;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n setInputRef,\n };\n // Provide the description / errorMessage props as `TextContext` slots (mirrors\n // react-aria-components' NumberField), so a `<Text slot=\"description\">` /\n // `<Text slot=\"errorMessage\">` child picks up the `id` its `aria-describedby`\n // references. Additive: existing consumers reading these off\n // `NumberFieldContext` are unaffected.\n const textSlots = {\n slots: {\n get description() {\n return numberFieldAria.descriptionProps;\n },\n get errorMessage() {\n return numberFieldAria.errorMessageProps;\n },\n },\n };\n\n return (\n <NumberFieldStateContext.Provider value={state}>\n <NumberFieldContext.Provider value={contextValue}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={ariaProps.isDisabled || undefined}\n data-invalid={ariaProps.isInvalid || undefined}\n data-required={ariaProps.isRequired || undefined}\n data-readonly={ariaProps.isReadOnly || undefined}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </NumberFieldContext.Provider>\n </NumberFieldStateContext.Provider>\n );\n}\n\n/**\n * The label for a number field.\n */\nexport function NumberFieldLabel(props: {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}): JSX.Element {\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldLabel must be used within a NumberField\");\n }\n\n // Upstream RAC/S2 renders the NumberField label as a native `<label>` (the field's\n // `labelElementType` is the default `'label'`), so `labelProps` carries `for=inputId`.\n // This was a `<span>` — a self-inflicted divergence dropping the native for/label\n // semantics; reverted to `<label>` to match the shipped React DOM byte-for-byte.\n // (Mirror SearchFieldLabel: `labelProps` is typed for a generic element, so strip the\n // `ref` and spread the rest onto the `<label>` intrinsic.)\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = context.labelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <label\n {...cleanLabelProps()}\n class={props.class ?? \"solidaria-NumberField-label\"}\n style={props.style}\n >\n {props.children}\n </label>\n );\n}\n\n/**\n * The input group for a number field (contains input and buttons).\n */\nexport function NumberFieldGroup(props: JSX.HTMLAttributes<HTMLDivElement>): JSX.Element {\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\"]);\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldGroup must be used within a NumberField\");\n }\n\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = context.groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanGroupProps()}\n class={local.class ?? \"solidaria-NumberField-group\"}\n style={local.style}\n >\n {local.children}\n </div>\n );\n}\n\n/**\n * The input element for a number field.\n */\nexport function NumberFieldInput(props: NumberFieldInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldInput must be used within a NumberField\");\n }\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled;\n },\n });\n\n const renderValues = createMemo<NumberFieldInputRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: context.isDisabled,\n isInvalid: context.isInvalid,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const { ref: _ref, onInput: _onInput, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const handleInput: JSX.EventHandler<HTMLInputElement, InputEvent> = (event) => {\n (\n context.inputProps as unknown as { onInput?: JSX.EventHandler<HTMLInputElement, InputEvent> }\n ).onInput?.(event);\n (domProps as unknown as { onInput?: JSX.EventHandler<HTMLInputElement, InputEvent> }).onInput?.(\n event,\n );\n };\n\n return (\n <input\n {...domProps}\n ref={context.setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\n onInput={handleInput}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={context.isDisabled || undefined}\n data-invalid={context.isInvalid || undefined}\n />\n );\n}\n\n/**\n * The increment button for a number field.\n */\nexport function NumberFieldIncrementButton(props: NumberFieldIncrementButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldIncrementButton must be used within a NumberField\");\n }\n\n const isDisabled = () => context.isDisabled || !context.state.canIncrement();\n const pressButtonProps = () => {\n const {\n onClick: _onClick,\n disabled: _disabled,\n type: _type,\n tabIndex: _tabIndex,\n ...rest\n } = context.incrementButtonProps as Record<string, unknown>;\n return rest;\n };\n\n const buttonAria = createButton({\n ...pressButtonProps(),\n elementType: \"div\",\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canIncrement();\n },\n });\n\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-increment\",\n },\n renderValues,\n );\n\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n aria-disabled={isDisabled() || undefined}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={buttonAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The decrement button for a number field.\n */\nexport function NumberFieldDecrementButton(props: NumberFieldDecrementButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldDecrementButton must be used within a NumberField\");\n }\n\n const isDisabled = () => context.isDisabled || !context.state.canDecrement();\n const pressButtonProps = () => {\n const {\n onClick: _onClick,\n disabled: _disabled,\n type: _type,\n tabIndex: _tabIndex,\n ...rest\n } = context.decrementButtonProps as Record<string, unknown>;\n return rest;\n };\n\n const buttonAria = createButton({\n ...pressButtonProps(),\n elementType: \"div\",\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canDecrement();\n },\n });\n\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-decrement\",\n },\n renderValues,\n );\n\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n aria-disabled={isDisabled() || undefined}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={buttonAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={isDisabled() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\nNumberField.Label = NumberFieldLabel;\nNumberField.Group = NumberFieldGroup;\nNumberField.Input = NumberFieldInput;\nNumberField.IncrementButton = NumberFieldIncrementButton;\nNumberField.DecrementButton = NumberFieldDecrementButton;\n"],"mappings":";;;;;;;;;;;;AA0IA,MAAa,qBAAqB,cAA8C,IAAI;AACpF,MAAa,0BAA0B,cAAuC,IAAI;;;;AA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U;EACrB,YAAY,WAAW;CACzB,EAAE;CAEF,MAAM,cAAc,eAClB;EACE,IAAI,WAAW;GACb,OAAO,MAAM;EACf;EACA,OAAO,MAAM;EACb,OAAO,MAAM;EACb,kBAAkB;CACpB,GACA,YACF;CAEA,MAAM,yBAAyB;EAC7B,MAAM,EAAE,KAAK,MAAM,GAAG,SAAS,WAAW;EAC1C,OAAO;CACT;CACA,MAAM,wBAAwB;EAC5B,MAAM,EAAE,KAAK,MAAM,GAAG,SAAS;EAC/B,OAAO;CACT;CAEA,OACE,CAAC,QACK,cACA,iBAAiB,OACjB,gBAAgB,GACpB,eAAe,WAAW,KAAK,KAAA,GAC/B,OAAO,YAAY,MAAM,GACzB,OAAO,YAAY,MAAM,GACzB,cAAc,WAAW,UAAU,KAAK,KAAA,GACxC,cAAc,UAAU,KAAK,KAAA,GAC7B,eAAe,WAAW,KAAK,KAAA,GAChC;OACE,YAAY,eAAe,EAAE;IAChC,EAAE;AAEN;AAEA,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,kBAAkB;AAC9B,YAAY,kBAAkB"}
1
+ {"version":3,"file":"NumberField.jsx","names":["attrString"],"sources":["../src/NumberField.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/NumberField.tsx\n\n/**\n * NumberField component for solidaria-components\n *\n * A pre-wired headless number field that combines state + aria hooks.\n * Port of react-aria-components/src/NumberField.tsx\n */\n\nimport { createContext, createMemo, createSignal, useContext } from \"solid-js\";\nimport type { Context } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createNumberField,\n createButton,\n createFocusRing,\n createHover,\n type AriaNumberFieldProps,\n type AriaButtonProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createNumberFieldState,\n type NumberFieldState,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FormContext, resolveValidationBehavior } from \"./Form\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n Provider,\n useSlot,\n dataAttr,\n attrTrue,\n attrString,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\nimport { LabelContext, type LabelProps } from \"./Label\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface NumberFieldRenderProps {\n /** Whether the number field is disabled. */\n isDisabled: boolean;\n /** Whether the number field is invalid. */\n isInvalid: boolean;\n /** Whether the number field is required. */\n isRequired: boolean;\n /** Whether the number field is read-only. */\n isReadOnly: boolean;\n /** The current numeric value. */\n value: number;\n}\n\nexport interface NumberFieldProps extends Omit<AriaNumberFieldProps, \"label\">, SlotProps {\n /** The current value (controlled). */\n value?: number;\n /** The default value (uncontrolled). */\n defaultValue?: number;\n /** Handler called when the value changes. */\n onChange?: (value: number) => void;\n /** The minimum value. */\n minValue?: number;\n /** The maximum value. */\n maxValue?: number;\n /** The step value for increment/decrement. */\n step?: number;\n /** The locale for number formatting. */\n locale?: string;\n /** Number format options. */\n formatOptions?: Intl.NumberFormatOptions;\n /** A visible label for the number field. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<NumberFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldRenderProps>;\n}\n\nexport interface NumberFieldInputRenderProps {\n /** Whether the input is focused. */\n isFocused: boolean;\n /** Whether the input has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the input is hovered. */\n isHovered: boolean;\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is invalid. */\n isInvalid: boolean;\n}\n\nexport interface NumberFieldInputProps extends SlotProps {\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldInputRenderProps>;\n}\n\nexport interface NumberFieldButtonRenderProps {\n /** Whether the button is pressed. */\n isPressed: boolean;\n /** Whether the button is hovered. */\n isHovered: boolean;\n /** Whether the button is disabled. */\n isDisabled: boolean;\n}\n\nexport interface NumberFieldIncrementButtonProps extends SlotProps {\n /** The children of the button. */\n children?: RenderChildren<NumberFieldButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldButtonRenderProps>;\n}\n\nexport interface NumberFieldDecrementButtonProps extends SlotProps {\n /** The children of the button. */\n children?: RenderChildren<NumberFieldButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<NumberFieldButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<NumberFieldButtonRenderProps>;\n}\n\ninterface NumberFieldContextValue {\n state: NumberFieldState;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n incrementButtonProps: AriaButtonProps;\n decrementButtonProps: AriaButtonProps;\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n groupProps: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n isDisabled: boolean;\n isInvalid: boolean;\n isRequired: boolean;\n isReadOnly: boolean;\n setInputRef: (el: HTMLInputElement) => void;\n /** Slot probe for the rendered label, so `useLabel` knows a label exists. */\n labelRef?: (el: Element | null) => void;\n}\n\nexport const NumberFieldContext = createContext<NumberFieldContextValue | null>(null);\nexport const NumberFieldStateContext = createContext<NumberFieldState | null>(null);\n\n/**\n * A number field allows a user to enter a number and increment/decrement the value.\n */\nexport function NumberField(props: NumberFieldProps): JSX.Element {\n const formContext = useContext(FormContext);\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"children\", \"class\", \"style\", \"slot\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"step\",\n \"locale\",\n \"formatOptions\",\n ],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"isInvalid\",\n \"description\",\n \"errorMessage\",\n \"id\",\n \"autoFocus\",\n \"name\",\n \"form\",\n \"onFocus\",\n \"onBlur\",\n \"onFocusChange\",\n \"onKeyDown\",\n \"onKeyUp\",\n \"onPaste\",\n \"onCopy\",\n \"onCut\",\n \"validationBehavior\",\n \"commitBehavior\",\n \"validate\",\n \"validationState\",\n ],\n );\n\n const state = createNumberFieldState({\n get value() {\n return stateProps.value;\n },\n get defaultValue() {\n return stateProps.defaultValue;\n },\n get onChange() {\n return stateProps.onChange;\n },\n get minValue() {\n return stateProps.minValue;\n },\n get maxValue() {\n return stateProps.maxValue;\n },\n get step() {\n return stateProps.step;\n },\n get locale() {\n return stateProps.locale;\n },\n get formatOptions() {\n return stateProps.formatOptions;\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get validationState() {\n return ariaProps.validationState;\n },\n get validate() {\n return ariaProps.validate;\n },\n get name() {\n return ariaProps.name;\n },\n get validationBehavior() {\n return resolveValidationBehavior(ariaProps.validationBehavior, formContext);\n },\n get commitBehavior() {\n return ariaProps.commitBehavior;\n },\n });\n\n const [inputEl, setInputEl] = createSignal<HTMLInputElement | undefined>(undefined, {\n ownedWrite: true,\n });\n const setInputRef = (el: HTMLInputElement) => {\n setInputEl(el);\n };\n\n const [labelRef, hasLabel] = useSlot(!ariaProps[\"aria-label\"] && !ariaProps[\"aria-labelledby\"]);\n\n const numberFieldAria = createNumberField(\n {\n // A slotted `<Label>` / `<NumberFieldLabel>` counts as a label, exactly\n // as RAC's `useSlot` does (`NumberField.tsx:117`). Without it `useLabel`\n // mints no `labelProps` and the input has no accessible name.\n get label() {\n return ariaProps.label ?? hasLabel();\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return ariaProps[\"aria-describedby\"];\n },\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly;\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n get isInvalid() {\n return ariaProps.isInvalid;\n },\n get description() {\n return ariaProps.description;\n },\n get errorMessage() {\n return ariaProps.errorMessage;\n },\n get id() {\n return ariaProps.id;\n },\n get autoFocus() {\n return ariaProps.autoFocus;\n },\n get name() {\n return ariaProps.name;\n },\n get form() {\n return ariaProps.form;\n },\n get onFocus() {\n return ariaProps.onFocus;\n },\n get onBlur() {\n return ariaProps.onBlur;\n },\n get onFocusChange() {\n return ariaProps.onFocusChange;\n },\n get onKeyDown() {\n return ariaProps.onKeyDown;\n },\n get onKeyUp() {\n return ariaProps.onKeyUp;\n },\n get onPaste() {\n return ariaProps.onPaste;\n },\n get onCopy() {\n return ariaProps.onCopy;\n },\n get onCut() {\n return ariaProps.onCut;\n },\n get validationBehavior() {\n return ariaProps.validationBehavior;\n },\n get commitBehavior() {\n return ariaProps.commitBehavior;\n },\n get validate() {\n return ariaProps.validate;\n },\n get validationState() {\n return ariaProps.validationState;\n },\n },\n state,\n () => inputEl() ?? null,\n );\n\n const renderValues = createMemo<NumberFieldRenderProps>(() => ({\n isDisabled: ariaProps.isDisabled ?? false,\n isInvalid: numberFieldAria.isInvalid,\n isRequired: ariaProps.isRequired ?? false,\n isReadOnly: ariaProps.isReadOnly ?? false,\n value: state.numberValue(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField\",\n },\n renderValues,\n );\n\n const childRenderValues: NumberFieldRenderProps = {\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return numberFieldAria.isInvalid;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n get value() {\n return state.numberValue();\n },\n };\n\n const fieldChildren = () => {\n const children = local.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n };\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const contextValue: NumberFieldContextValue = {\n state,\n get inputProps() {\n return numberFieldAria.inputProps;\n },\n get incrementButtonProps() {\n return numberFieldAria.incrementButtonProps;\n },\n get decrementButtonProps() {\n return numberFieldAria.decrementButtonProps;\n },\n get labelProps() {\n return numberFieldAria.labelProps;\n },\n get groupProps() {\n return numberFieldAria.groupProps;\n },\n get descriptionProps() {\n return numberFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return numberFieldAria.errorMessageProps;\n },\n get isDisabled() {\n return ariaProps.isDisabled ?? false;\n },\n get isInvalid() {\n return numberFieldAria.isInvalid;\n },\n get isRequired() {\n return ariaProps.isRequired ?? false;\n },\n get isReadOnly() {\n return ariaProps.isReadOnly ?? false;\n },\n setInputRef,\n labelRef,\n };\n\n // RAC exposes one shared `<Label>` through `LabelContext`; `NumberFieldLabel`\n // is a local convenience alias over the same wiring.\n const labelContextValue: LabelProps = {\n ref: labelRef,\n get id() {\n return (numberFieldAria.labelProps as JSX.LabelHTMLAttributes<HTMLLabelElement>).id;\n },\n get htmlFor() {\n const labelProps = numberFieldAria.labelProps as JSX.LabelHTMLAttributes<HTMLLabelElement> & {\n htmlFor?: string;\n };\n return attrString(labelProps.htmlFor ?? labelProps.for);\n },\n get for() {\n const labelProps = numberFieldAria.labelProps as JSX.LabelHTMLAttributes<HTMLLabelElement> & {\n htmlFor?: string;\n };\n return attrString(labelProps.htmlFor ?? labelProps.for);\n },\n };\n // Provide the description / errorMessage props as `TextContext` slots (mirrors\n // react-aria-components' NumberField), so a `<Text slot=\"description\">` /\n // `<Text slot=\"errorMessage\">` child picks up the `id` its `aria-describedby`\n // references. Additive: existing consumers reading these off\n // `NumberFieldContext` are unaffected.\n const textSlots = {\n slots: {\n get description() {\n return numberFieldAria.descriptionProps;\n },\n get errorMessage() {\n return numberFieldAria.errorMessageProps;\n },\n },\n };\n const fieldValidation = createMemo<ValidationResult>(() => {\n const isInvalid = numberFieldAria.isInvalid;\n const validationErrors = numberFieldAria.validationErrors;\n const errorMessage = ariaProps.errorMessage;\n return {\n isInvalid,\n validationErrors:\n isInvalid && validationErrors.length === 0 && typeof errorMessage === \"string\"\n ? [errorMessage]\n : validationErrors,\n validationDetails: numberFieldAria.validationDetails,\n };\n });\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return fieldValidation();\n },\n get errorMessageProps() {\n return numberFieldAria.errorMessageProps;\n },\n };\n\n return (\n <FieldErrorContext value={fieldErrorContext}>\n <LabelContext value={labelContextValue}>\n <NumberFieldStateContext value={state}>\n <NumberFieldContext value={contextValue}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(ariaProps.isDisabled)}\n data-invalid={dataAttr(numberFieldAria.isInvalid)}\n data-required={dataAttr(ariaProps.isRequired)}\n data-readonly={dataAttr(ariaProps.isReadOnly)}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {fieldChildren()}\n </Provider>\n </div>\n </NumberFieldContext>\n </NumberFieldStateContext>\n </LabelContext>\n </FieldErrorContext>\n );\n}\n\n/**\n * The label for a number field.\n */\nexport function NumberFieldLabel(props: {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}): JSX.Element {\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldLabel must be used within a NumberField\");\n }\n\n // Upstream RAC/S2 renders the NumberField label as a native `<label>` (the field's\n // `labelElementType` is the default `'label'`), so `labelProps` carries `for=inputId`.\n // This was a `<span>` — a self-inflicted divergence dropping the native for/label\n // semantics; reverted to `<label>` to match the shipped React DOM byte-for-byte.\n // (Mirror SearchFieldLabel: `labelProps` is typed for a generic element, so strip the\n // `ref` and spread the rest onto the `<label>` intrinsic.)\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = context.labelProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <label\n {...cleanLabelProps()}\n ref={(el) => context.labelRef?.(el)}\n class={props.class ?? \"solidaria-NumberField-label\"}\n style={props.style}\n >\n {props.children}\n </label>\n );\n}\n\n/**\n * The input group for a number field (contains input and buttons).\n */\nexport function NumberFieldGroup(props: JSX.HTMLAttributes<HTMLDivElement>): JSX.Element {\n const [local, domProps] = splitProps(props, [\"children\", \"class\", \"style\"]);\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldGroup must be used within a NumberField\");\n }\n\n const cleanGroupProps = () => {\n const { ref: _ref, ...rest } = context.groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanGroupProps()}\n class={local.class ?? \"solidaria-NumberField-group\"}\n style={local.style}\n >\n {local.children}\n </div>\n );\n}\n\n/**\n * The input element for a number field.\n */\nexport function NumberFieldInput(props: NumberFieldInputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldInput must be used within a NumberField\");\n }\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled;\n },\n });\n\n const renderValues = createMemo<NumberFieldInputRenderProps>(() => ({\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: context.isDisabled,\n isInvalid: context.isInvalid,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-input\",\n },\n renderValues,\n );\n\n const cleanInputProps = () => {\n const { ref: _ref, onInput: _onInput, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const handleInput: JSX.EventHandler<HTMLInputElement, InputEvent> = (event) => {\n (\n context.inputProps as unknown as { onInput?: JSX.EventHandler<HTMLInputElement, InputEvent> }\n ).onInput?.(event);\n (domProps as unknown as { onInput?: JSX.EventHandler<HTMLInputElement, InputEvent> }).onInput?.(\n event,\n );\n };\n\n return (\n <input\n {...domProps}\n ref={context.setInputRef}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n {...cleanHoverProps()}\n onInput={handleInput}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(context.isDisabled)}\n data-invalid={dataAttr(context.isInvalid)}\n />\n );\n}\n\n/**\n * The increment button for a number field.\n */\nexport function NumberFieldIncrementButton(props: NumberFieldIncrementButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldIncrementButton must be used within a NumberField\");\n }\n\n const isDisabled = () => context.isDisabled || !context.state.canIncrement();\n const pressButtonProps = () => {\n const {\n onClick: _onClick,\n disabled: _disabled,\n type: _type,\n tabindex: _tabIndex,\n ...rest\n } = context.incrementButtonProps as Record<string, unknown>;\n return rest;\n };\n\n const buttonAria = createButton({\n ...pressButtonProps(),\n elementType: \"div\",\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canIncrement();\n },\n });\n\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-increment\",\n },\n renderValues,\n );\n\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n aria-disabled={attrTrue(isDisabled())}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={dataAttr(buttonAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(isDisabled())}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The decrement button for a number field.\n */\nexport function NumberFieldDecrementButton(props: NumberFieldDecrementButtonProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(NumberFieldContext);\n if (!context) {\n throw new Error(\"NumberFieldDecrementButton must be used within a NumberField\");\n }\n\n const isDisabled = () => context.isDisabled || !context.state.canDecrement();\n const pressButtonProps = () => {\n const {\n onClick: _onClick,\n disabled: _disabled,\n type: _type,\n tabindex: _tabIndex,\n ...rest\n } = context.decrementButtonProps as Record<string, unknown>;\n return rest;\n };\n\n const buttonAria = createButton({\n ...pressButtonProps(),\n elementType: \"div\",\n get isDisabled() {\n return isDisabled();\n },\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return context.isDisabled || !context.state.canDecrement();\n },\n });\n\n const renderValues = createMemo<NumberFieldButtonRenderProps>(() => ({\n isPressed: buttonAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-NumberField-decrement\",\n },\n renderValues,\n );\n\n const cleanButtonProps = () => {\n const { ref: _ref, ...rest } = buttonAria.buttonProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <div\n {...domProps}\n {...cleanButtonProps()}\n {...cleanHoverProps()}\n aria-disabled={attrTrue(isDisabled())}\n class={renderProps.class()}\n style={renderProps.style()}\n data-pressed={dataAttr(buttonAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(isDisabled())}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\nNumberField.Label = NumberFieldLabel;\nNumberField.Group = NumberFieldGroup;\nNumberField.Input = NumberFieldInput;\nNumberField.IncrementButton = NumberFieldIncrementButton;\nNumberField.DecrementButton = NumberFieldDecrementButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiKA,MAAa,qBAAqB,cAA8C,IAAI;AACpF,MAAa,0BAA0B,cAAuC,IAAI;;;;AAKlF,SAAgB,YAAY,OAAsC;CAChE,MAAM,cAAc,WAAW,WAAW;CAC1C,MAAM,CAAC,OAAO,YAAY,WAAW,QAAQ,WAC3C,OACA;EAAC;EAAY;EAAS;EAAS;CAAM,GACrC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,GACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,QA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B;EAC7B,MAAM,EAAE,KAAK,MAAM,GAAG,SAAS,WAAW;EAC1C,OAAO;CACT;CACA,MAAM,wBAAwB;EAC5B,MAAM,EAAE,KAAK,MAAM,GAAG,SAAS;EAC/B,OAAO;CACT;CAEA,OACE,CAAC,QACK,cACA,iBAAiB,OACjB,gBAAgB,GACpB,eAAe,SAAS,WAAW,CAAC,GACpC,OAAO,YAAY,MAAM,GACzB,OAAO,YAAY,MAAM,GACzB,cAAc,SAAS,WAAW,UAAU,CAAC,GAC7C,cAAc,SAAS,UAAU,CAAC,GAClC,eAAe,SAAS,WAAW,CAAC,GACrC;OACE,YAAY,eAAe,EAAE;IAChC,EAAE;AAEN;AAEA,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,kBAAkB;AAC9B,YAAY,kBAAkB"}
package/dist/Popover.d.ts CHANGED
@@ -1,10 +1,4 @@
1
- /**
2
- * Popover component for solidaria-components
3
- *
4
- * A headless popover component that positions relative to a trigger element.
5
- * Port of react-aria-components Popover.
6
- */
7
- import { type JSX } from "solid-js";
1
+ import type { JSX } from "@solidjs/web";
8
2
  import { type AriaLabelingProps, type Placement, type PlacementAxis } from "@proyecto-viviana/solidaria";
9
3
  import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
10
4
  export interface PopoverRenderProps {
@@ -120,6 +114,11 @@ export interface PopoverProps extends SlotProps, AriaLabelingProps {
120
114
  isEntering?: boolean;
121
115
  /** Whether the popover is exiting (for animations). */
122
116
  isExiting?: boolean;
117
+ /**
118
+ * Whether the popover should appear and disappear without an entry or exit animation.
119
+ * Used by PreviewTrigger to skip animations when quickly swapping between overlays.
120
+ */
121
+ shouldSkipAnimation?: boolean;
123
122
  }
124
123
  export interface PopoverTriggerProps {
125
124
  /** The children - should include a trigger and popover content. */
@@ -137,6 +136,15 @@ interface PopoverContextValue {
137
136
  arrowProps: () => JSX.HTMLAttributes<HTMLElement>;
138
137
  }
139
138
  export declare const PopoverContext: import("solid-js").Context<PopoverContextValue | null>;
139
+ /**
140
+ * RAC Overlay.tsx OverlayContext. Dialog's useOverlayFocusContain equivalent
141
+ * sets contain so a nested Dialog still traps Tab when the Popover itself is
142
+ * not the dialog (DatePicker / DateRangePicker CalendarPopover).
143
+ */
144
+ export interface OverlayContextValue {
145
+ setContain: (contain: boolean) => void;
146
+ }
147
+ export declare const OverlayContext: import("solid-js").Context<OverlayContextValue | null>;
140
148
  /**
141
149
  * A PopoverTrigger opens a popover when a trigger element is pressed.
142
150
  * Children should include a trigger element (e.g. Button) and the Popover.