@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":"Slider.js","names":["JSX","createContext","createMemo","splitProps","useContext","Show","createSlider","createFocusRing","createHover","mergeProps","AriaSliderProps","HoverEvents","createSliderState","SliderState","SliderOrientation","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","VisuallyHidden","SliderRenderProps","isDisabled","isDragging","isFocused","value","valuePercent","orientation","SliderProps","Omit","defaultValue","onChange","onChangeEnd","minValue","maxValue","step","locale","formatOptions","Intl","NumberFormatOptions","label","Element","children","class","style","ref","el","HTMLDivElement","SliderTrackRenderProps","SliderTrackProps","HTMLAttributes","SliderThumbRenderProps","isFocusVisible","isHovered","SliderThumbProps","SliderFillRenderProps","SliderFillProps","offset","SliderOutputRenderProps","formattedValue","SliderOutputProps","HTMLElement","SliderContextValue","state","trackProps","thumbProps","outputProps","inputProps","InputHTMLAttributes","HTMLInputElement","trackRef","setTrackRef","inputRef","setInputRef","SliderContext","SliderStateContext","SliderTrackContext","SliderFillContext","SliderOutputContext","Slider","props","local","stateProps","ariaProps","rest","sliderAria","renderValues","getValuePercent","renderProps","defaultClassName","childRenderValues","sliderChildren","domProps","Record","global","cleanGroupProps","_ref","groupProps","_$createComponent","Provider","_el$","_$getNextElement","_tmpl$2","_el$3","firstChild","_el$4","_co$","_$getNextMarker","nextSibling","_el$5","_el$6","_co$2","_ref$","_$use","_$spread","_$mergeProps","data-disabled","undefined","data-orientation","data-dragging","_$insert","when","_el$2","_tmpl$","labelProps","_$runHydrationEvents","SliderTrack","context","Error","cleanTrackProps","trackStyle","mergedStyle","renderStyle","_el$7","_tmpl$3","renderChildren","SliderThumb","focusProps","hoverProps","cleanThumbProps","thumbStyle","cleanFocusProps","cleanHoverProps","cleanInputProps","mergedInputProps","_el$8","_tmpl$4","_el$9","data-focused","data-focus-visible","data-hovered","clampFill","min","max","Math","SliderFill","onHoverStart","onHoverEnd","onHoverChange","percentOf","range","start","end","startPercent","sizePercent","CSSProperties","fillStyle","position","bottom","height","width","_el$0","SliderOutput","getFormattedValue","cleanDomProps","cleanOutputProps","renderedChildren","_el$1","_tmpl$5","Track","Thumb","Fill","Output"],"sources":["../src/Slider.tsx"],"sourcesContent":["/**\n * Slider component for solidaria-components\n *\n * A pre-wired headless slider that combines state + aria hooks.\n * Port of react-aria-components/src/Slider.tsx\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext, Show } from \"solid-js\";\nimport {\n createSlider,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaSliderProps,\n type HoverEvents,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSliderState,\n type SliderState,\n type SliderOrientation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\nexport interface SliderRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** Whether the slider is focused. */\n isFocused: boolean;\n /** The current value. */\n value: number;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderProps extends Omit<AriaSliderProps, \"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 /** Handler called when dragging ends. */\n onChangeEnd?: (value: number) => void;\n /** The minimum value. */\n minValue?: number;\n /** The maximum value. */\n maxValue?: number;\n /** The step value. */\n step?: number;\n /** The orientation of the slider. */\n orientation?: SliderOrientation;\n /** The locale for number formatting. */\n locale?: string;\n /** Number format options. */\n formatOptions?: Intl.NumberFormatOptions;\n /** A visible label for the slider. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<SliderRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderRenderProps>;\n /** Ref for the slider root element. */\n ref?: (el: HTMLDivElement) => void;\n}\n\nexport interface SliderTrackRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderTrackProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the track. */\n children?: RenderChildren<SliderTrackRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderTrackRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderTrackRenderProps>;\n}\n\nexport interface SliderThumbRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the thumb is being dragged. */\n isDragging: boolean;\n /** Whether the thumb is focused. */\n isFocused: boolean;\n /** Whether the thumb has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the thumb is hovered. */\n isHovered: boolean;\n /** The current value. */\n value: number;\n /** The value as a percent (0-1). */\n valuePercent: number;\n}\n\nexport interface SliderThumbProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the thumb. */\n children?: RenderChildren<SliderThumbRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderThumbRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderThumbRenderProps>;\n}\n\nexport interface SliderFillRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider fill is currently hovered with a mouse. */\n isHovered: boolean;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderFillProps\n extends\n SlotProps,\n HoverEvents,\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The offset from which to start the fill. Defaults to the slider's minValue. */\n offset?: number;\n /** The children of the fill. */\n children?: RenderChildren<SliderFillRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderFillRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderFillRenderProps>;\n}\n\nexport interface SliderOutputRenderProps {\n /** The current value. */\n value: number;\n /** The formatted value string. */\n formattedValue: string;\n}\n\nexport interface SliderOutputProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the output. */\n children?: RenderChildren<SliderOutputRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderOutputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderOutputRenderProps>;\n}\n\ninterface SliderContextValue {\n state: SliderState;\n trackProps: JSX.HTMLAttributes<HTMLElement>;\n thumbProps: JSX.HTMLAttributes<HTMLElement>;\n outputProps: JSX.HTMLAttributes<HTMLElement>;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n trackRef: HTMLElement | undefined;\n setTrackRef: (el: HTMLElement) => void;\n inputRef: HTMLInputElement | undefined;\n setInputRef: (el: HTMLInputElement) => void;\n}\n\nexport const SliderContext = createContext<SliderContextValue | null>(null);\nexport const SliderStateContext = SliderContext;\nexport const SliderTrackContext = SliderContext;\nexport const SliderFillContext = SliderContext;\nexport const SliderOutputContext = SliderContext;\n\n/**\n * A slider allows users to select a value from a range.\n */\nexport function Slider(props: SliderProps): JSX.Element {\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"onChangeEnd\",\n \"minValue\",\n \"maxValue\",\n \"step\",\n \"orientation\",\n \"locale\",\n \"formatOptions\",\n ],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"id\",\n \"name\",\n \"form\",\n ],\n );\n\n const state = createSliderState({\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 onChangeEnd() {\n return stateProps.onChangeEnd;\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 orientation() {\n return stateProps.orientation;\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 });\n\n let trackRef: HTMLElement | undefined;\n const setTrackRef = (el: HTMLElement) => {\n trackRef = el;\n };\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const sliderAria = createSlider(\n ariaProps,\n state,\n () => trackRef ?? null,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<SliderRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n isFocused: state.isFocused(),\n value: state.value(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider\",\n },\n renderValues,\n );\n\n const childRenderValues: SliderRenderProps = {\n get isDisabled() {\n return state.isDisabled;\n },\n get isDragging() {\n return state.isDragging();\n },\n get isFocused() {\n return state.isFocused();\n },\n get value() {\n return state.value();\n },\n get valuePercent() {\n return state.getValuePercent();\n },\n get orientation() {\n return state.orientation;\n },\n };\n\n const sliderChildren = () => {\n const children = props.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 cleanGroupProps = () => {\n const { ref: _ref, ...rest } = sliderAria.groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <SliderContext.Provider\n value={{\n state,\n get trackProps() {\n return sliderAria.trackProps;\n },\n get thumbProps() {\n return sliderAria.thumbProps;\n },\n get outputProps() {\n return sliderAria.outputProps;\n },\n get inputProps() {\n return sliderAria.inputProps;\n },\n get trackRef() {\n return trackRef;\n },\n setTrackRef,\n get inputRef() {\n return inputRef;\n },\n setInputRef,\n }}\n >\n <div\n {...domProps()}\n {...cleanGroupProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={state.isDisabled || undefined}\n data-orientation={state.orientation}\n data-dragging={state.isDragging() || undefined}\n >\n <Show when={ariaProps.label}>\n <span {...sliderAria.labelProps}>{ariaProps.label}</span>\n </Show>\n\n {sliderChildren()}\n </div>\n </SliderContext.Provider>\n );\n}\n\n/**\n * The track element of a slider.\n */\nexport function SliderTrack(props: SliderTrackProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderTrack must be used within a Slider\");\n }\n\n const { state, setTrackRef } = context;\n\n const renderValues = createMemo<SliderTrackRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider-track\",\n },\n renderValues,\n );\n\n const cleanTrackProps = () => {\n const { ref: _ref, style: trackStyle, ...rest } = context.trackProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = () => {\n const trackStyle = (context.trackProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...trackStyle, ...renderStyle };\n };\n\n return (\n <div\n {...domProps}\n ref={setTrackRef}\n {...cleanTrackProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n data-orientation={state.orientation}\n data-dragging={state.isDragging() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The thumb element of a slider.\n */\nexport function SliderThumb(props: SliderThumbProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderThumb must be used within a Slider\");\n }\n\n const { state, setInputRef } = context;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<SliderThumbRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n isFocused: isFocused() || state.isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n value: state.value(),\n valuePercent: state.getValuePercent(),\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-Slider-thumb\",\n },\n renderValues,\n );\n\n const cleanThumbProps = () => {\n const { ref: _ref, style: thumbStyle, ...rest } = context.thumbProps 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\n const mergedStyle = () => {\n const thumbStyle = (context.thumbProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...thumbStyle, ...renderStyle };\n };\n const cleanInputProps = () => {\n const { ref: _ref, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const mergedInputProps = () =>\n mergeProps(\n cleanInputProps() as Record<string, unknown>,\n cleanFocusProps() as Record<string, unknown>,\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n\n return (\n <>\n <VisuallyHidden>\n <input ref={setInputRef} {...mergedInputProps()} />\n </VisuallyHidden>\n <div\n {...domProps}\n {...cleanThumbProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n data-dragging={state.isDragging() || undefined}\n data-focused={isFocused() || state.isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </>\n );\n}\n\n/** Clamp a value between min and max (mirror of upstream's number/clamp). */\nfunction clampFill(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n/**\n * The fill element of a slider, displaying the selected range.\n *\n * Port of react-aria-components `SliderFill` (RAC 1.18). Upstream reads the\n * array-based `SliderState` (`values`/`getThumbPercent`); our `SliderState` is\n * single-value, so this fills from `offset` (default the slider's minValue, i.e.\n * 0%) to the current value — the single-thumb branch of upstream's math, using\n * the same `(v - min) / (max - min)` percent formula the state itself uses.\n */\nexport function SliderFill(props: SliderFillProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"offset\",\n \"children\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderFill must be used within a Slider\");\n }\n\n const { state } = context;\n\n const { isHovered, hoverProps } = createHover(() => ({\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n }));\n\n // Percent (0-100) of an arbitrary value within the track — mirrors\n // SliderState.getValuePercent's formula for a value other than the current one.\n const percentOf = (value: number) => {\n const range = state.maxValue - state.minValue;\n return range === 0 ? 0 : ((value - state.minValue) / range) * 100;\n };\n\n const offset = () =>\n local.offset != null ? clampFill(local.offset, state.minValue, state.maxValue) : state.minValue;\n const start = () => percentOf(offset());\n const end = () => state.getValuePercent() * 100;\n const startPercent = () => Math.min(start(), end());\n const sizePercent = () => Math.max(0, Math.max(start(), end()) - startPercent());\n\n const renderValues = createMemo<SliderFillRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isHovered: isHovered(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider-fill\",\n },\n renderValues,\n );\n\n // useRenderProps has no defaultStyle; merge the positioning style with the\n // user's, mirroring upstream SliderFill's defaultStyle (and SliderTrack here).\n const mergedStyle = (): JSX.CSSProperties => {\n const fillStyle: JSX.CSSProperties =\n state.orientation === \"vertical\"\n ? {\n position: \"absolute\",\n bottom: `${startPercent()}%`,\n height: `${sizePercent()}%`,\n width: \"100%\",\n }\n : {\n position: \"absolute\",\n \"inset-inline-start\": `${startPercent()}%`,\n width: `${sizePercent()}%`,\n height: \"100%\",\n };\n return { ...fillStyle, ...(renderProps.style() || {}) };\n };\n\n return (\n <div\n {...domProps}\n {...hoverProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-hovered={isHovered() || undefined}\n data-disabled={state.isDisabled || undefined}\n data-orientation={state.orientation}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The output element of a slider, displaying the current value.\n */\nexport function SliderOutput(props: SliderOutputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderOutput must be used within a Slider\");\n }\n\n const { state } = context;\n\n const renderValues = createMemo<SliderOutputRenderProps>(() => ({\n value: state.value(),\n formattedValue: state.getFormattedValue(),\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-Slider-output\",\n },\n renderValues,\n );\n\n const cleanDomProps = () => {\n const { ref: _ref, ...rest } = domProps as Record<string, unknown>;\n return rest;\n };\n const cleanOutputProps = () => {\n const { ref: _ref, ...rest } = context.outputProps as Record<string, unknown>;\n return rest;\n };\n\n const renderedChildren = () => {\n // Check if raw children prop exists before calling renderChildren\n if (renderProps.children === undefined || renderProps.children === null) {\n return state.getFormattedValue();\n }\n return renderProps.renderChildren();\n };\n\n return (\n <output\n {...cleanDomProps()}\n {...cleanOutputProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n {renderedChildren()}\n </output>\n );\n}\n\nSlider.Track = SliderTrack;\nSlider.Thumb = SliderThumb;\nSlider.Fill = SliderFill;\nSlider.Output = SliderOutput;\n"],"mappings":";;;;;;;;;;;;;;AAsLA,MAAa2E,gBAAgB1E,cAAyC,IAAI;AAC1E,MAAa2E,qBAAqB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kBAAkB;CACpB,GACAH,YACF;CAEA,MAAMwF,sBAAsB;EAC1B,MAAM,EAAEjI,KAAKmD,MAAM,GAAGZ,SAASQ;EAC/B,OAAOR;CACT;CACA,MAAM2F,yBAAyB;EAC7B,MAAM,EAAElI,KAAKmD,MAAM,GAAGZ,SAAS2C,QAAQ7D;EACvC,OAAOkB;CACT;CAEA,MAAM4F,yBAAyB;EAE7B,IAAIxF,YAAY9C,aAAa2E,KAAAA,KAAa7B,YAAY9C,aAAa,MACjE,OAAOqB,MAAM8G,kBAAkB;EAEjC,OAAOrF,YAAY+C,eAAe;CACpC;CAEA,cAAA;EAAA,IAAA0C,QAAA5E,eAAA6E,OAAA;EAAAhE,OAAA+D,OAAA9D,WAEQ2D,eACAC,kBAAgB;GAAA,KAAA,WAAA;IAAA,OACbvF,YAAY7C,MAAM;GAAC;GAAA,IAC1BC,QAAK;IAAA,OAAE4C,YAAY5C,MAAM;GAAC;EAAA,CAAA,GAAA,OAAA,IAAA;EAAA4E,OAAAyD,OAEzBD,gBAAgB;EAAAnD,mBAAA;EAAA,OAAAoD;CAAA,EAAA,CAAA;AAGvB;AAEAlG,OAAOoG,QAAQrD;AACf/C,OAAOqG,QAAQ5C;AACfzD,OAAOsG,OAAO1B;AACd5E,OAAOuG,SAASV"}
1
+ {"version":3,"file":"Slider.js","names":["<SliderContext\n value={{\n state,\n get trackProps() {\n return sliderAria.trackProps;\n },\n get thumbProps() {\n return sliderAria.thumbProps;\n },\n get outputProps() {\n return sliderAria.outputProps;\n },\n get inputProps() {\n return sliderAria.inputProps;\n },\n get trackRef() {\n return trackRef;\n },\n setTrackRef,\n get inputRef() {\n return inputRef;\n },\n setInputRef,\n }}\n >\n <div\n {...domProps()}\n {...cleanGroupProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled)}\n data-orientation={state.orientation}\n data-dragging={dataAttr(state.isDragging())}\n >\n <Show when={ariaProps.label}>\n <span {...sliderAria.labelProps}>{ariaProps.label}</span>\n </Show>\n\n {sliderChildren()}\n </div>\n </SliderContext>","value={{\n state,\n get trackProps() {\n return sliderAria.trackProps;\n },\n get thumbProps() {\n return sliderAria.thumbProps;\n },\n get outputProps() {\n return sliderAria.outputProps;\n },\n get inputProps() {\n return sliderAria.inputProps;\n },\n get trackRef() {\n return trackRef;\n },\n setTrackRef,\n get inputRef() {\n return inputRef;\n },\n setInputRef,\n }}","ref={local.ref}","<Show when={ariaProps.label}>\n <span {...sliderAria.labelProps}>{ariaProps.label}</span>\n </Show>","<span {...sliderAria.labelProps}>{ariaProps.label}</span>","<div\n {...domProps()}\n {...cleanGroupProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled)}\n data-orientation={state.orientation}\n data-dragging={dataAttr(state.isDragging())}\n >\n <Show when={ariaProps.label}>\n <span {...sliderAria.labelProps}>{ariaProps.label}</span>\n </Show>\n\n {sliderChildren()}\n </div>","{sliderChildren()}","ref={setTrackRef}","{renderProps.renderChildren()}","<div\n {...domProps}\n ref={setTrackRef}\n {...cleanTrackProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={dataAttr(state.isDisabled)}\n data-orientation={state.orientation}\n data-dragging={dataAttr(state.isDragging())}\n >\n {renderProps.renderChildren()}\n </div>","<VisuallyHidden>\n <input ref={setInputRef} {...mergedInputProps()} />\n </VisuallyHidden>","ref={setInputRef}","<input ref={setInputRef} {...mergedInputProps()} />","<div\n {...domProps}\n {...hoverProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(state.isDisabled)}\n data-orientation={state.orientation}\n >\n {renderProps.renderChildren()}\n </div>","{renderedChildren()}","<output\n {...cleanDomProps()}\n {...cleanOutputProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n {renderedChildren()}\n </output>"],"sources":["../src/Slider.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/Slider.tsx\n\n/**\n * Slider component for solidaria-components\n *\n * A pre-wired headless slider that combines state + aria hooks.\n * Solid adaptation of the pinned Slider component.\n */\n\nimport { createContext, createMemo, useContext, Show } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createSlider,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaSliderProps,\n type HoverEvents,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSliderState,\n type SliderState,\n type SliderOrientation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n coerceDomRecord,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface SliderRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** Whether the slider is focused. */\n isFocused: boolean;\n /** The current value. */\n value: number;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderProps extends Omit<AriaSliderProps, \"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 /** Handler called when dragging ends. */\n onChangeEnd?: (value: number) => void;\n /** The minimum value. */\n minValue?: number;\n /** The maximum value. */\n maxValue?: number;\n /** The step value. */\n step?: number;\n /** The orientation of the slider. */\n orientation?: SliderOrientation;\n /** The locale for number formatting. */\n locale?: string;\n /** Number format options. */\n formatOptions?: Intl.NumberFormatOptions;\n /** A visible label for the slider. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<SliderRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderRenderProps>;\n /** Ref for the slider root element. */\n ref?: (el: HTMLDivElement) => void;\n}\n\nexport interface SliderTrackRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderTrackProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the track. */\n children?: RenderChildren<SliderTrackRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderTrackRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderTrackRenderProps>;\n}\n\nexport interface SliderThumbRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the thumb is being dragged. */\n isDragging: boolean;\n /** Whether the thumb is focused. */\n isFocused: boolean;\n /** Whether the thumb has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the thumb is hovered. */\n isHovered: boolean;\n /** The current value. */\n value: number;\n /** The value as a percent (0-1). */\n valuePercent: number;\n}\n\nexport interface SliderThumbProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the thumb. */\n children?: RenderChildren<SliderThumbRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderThumbRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderThumbRenderProps>;\n}\n\nexport interface SliderFillRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider fill is currently hovered with a mouse. */\n isHovered: boolean;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderFillProps\n extends\n SlotProps,\n HoverEvents,\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The offset from which to start the fill. Defaults to the slider's minValue. */\n offset?: number;\n /** The children of the fill. */\n children?: RenderChildren<SliderFillRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderFillRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderFillRenderProps>;\n}\n\nexport interface SliderOutputRenderProps {\n /** The current value. */\n value: number;\n /** The formatted value string. */\n formattedValue: string;\n}\n\nexport interface SliderOutputProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the output. */\n children?: RenderChildren<SliderOutputRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderOutputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderOutputRenderProps>;\n}\n\ninterface SliderContextValue {\n state: SliderState;\n trackProps: JSX.HTMLAttributes<HTMLElement>;\n thumbProps: JSX.HTMLAttributes<HTMLElement>;\n outputProps: JSX.HTMLAttributes<HTMLElement>;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n trackRef: HTMLElement | undefined;\n setTrackRef: (el: HTMLElement) => void;\n inputRef: HTMLInputElement | undefined;\n setInputRef: (el: HTMLInputElement) => void;\n}\n\nexport const SliderContext = createContext<SliderContextValue | null>(null);\nexport const SliderStateContext = SliderContext;\nexport const SliderTrackContext = SliderContext;\nexport const SliderFillContext = SliderContext;\nexport const SliderOutputContext = SliderContext;\n\n/**\n * A slider allows users to select a value from a range.\n */\nexport function Slider(props: SliderProps): JSX.Element {\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"onChangeEnd\",\n \"minValue\",\n \"maxValue\",\n \"step\",\n \"orientation\",\n \"locale\",\n \"formatOptions\",\n ],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"id\",\n \"name\",\n \"form\",\n ],\n );\n\n const state = createSliderState({\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 onChangeEnd() {\n return stateProps.onChangeEnd;\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 orientation() {\n return stateProps.orientation;\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 });\n\n let trackRef: HTMLElement | undefined;\n const setTrackRef = (el: HTMLElement) => {\n trackRef = el;\n };\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const sliderAria = createSlider(\n ariaProps,\n state,\n () => trackRef ?? null,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<SliderRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n isFocused: state.isFocused(),\n value: state.value(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider\",\n },\n renderValues,\n );\n\n const childRenderValues: SliderRenderProps = {\n get isDisabled() {\n return state.isDisabled;\n },\n get isDragging() {\n return state.isDragging();\n },\n get isFocused() {\n return state.isFocused();\n },\n get value() {\n return state.value();\n },\n get valuePercent() {\n return state.getValuePercent();\n },\n get orientation() {\n return state.orientation;\n },\n };\n\n const sliderChildren = () => {\n const children = props.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 cleanGroupProps = () => {\n const { ref: _ref, ...rest } = sliderAria.groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <SliderContext\n value={{\n state,\n get trackProps() {\n return sliderAria.trackProps;\n },\n get thumbProps() {\n return sliderAria.thumbProps;\n },\n get outputProps() {\n return sliderAria.outputProps;\n },\n get inputProps() {\n return sliderAria.inputProps;\n },\n get trackRef() {\n return trackRef;\n },\n setTrackRef,\n get inputRef() {\n return inputRef;\n },\n setInputRef,\n }}\n >\n <div\n {...domProps()}\n {...cleanGroupProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled)}\n data-orientation={state.orientation}\n data-dragging={dataAttr(state.isDragging())}\n >\n <Show when={ariaProps.label}>\n <span {...sliderAria.labelProps}>{ariaProps.label}</span>\n </Show>\n\n {sliderChildren()}\n </div>\n </SliderContext>\n );\n}\n\n/**\n * The track element of a slider.\n */\nexport function SliderTrack(props: SliderTrackProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderTrack must be used within a Slider\");\n }\n\n const { state, setTrackRef } = context;\n\n const renderValues = createMemo<SliderTrackRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider-track\",\n },\n renderValues,\n );\n\n const cleanTrackProps = () => {\n const { ref: _ref, style: trackStyle, ...rest } = context.trackProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = () => {\n const trackStyle = (context.trackProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...trackStyle, ...renderStyle };\n };\n\n return (\n <div\n {...domProps}\n ref={setTrackRef}\n {...cleanTrackProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={dataAttr(state.isDisabled)}\n data-orientation={state.orientation}\n data-dragging={dataAttr(state.isDragging())}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The thumb element of a slider.\n */\nexport function SliderThumb(props: SliderThumbProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderThumb must be used within a Slider\");\n }\n\n const { state, setInputRef } = context;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<SliderThumbRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n isFocused: isFocused() || state.isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n value: state.value(),\n valuePercent: state.getValuePercent(),\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-Slider-thumb\",\n },\n renderValues,\n );\n\n const cleanThumbProps = () => {\n const { ref: _ref, style: thumbStyle, ...rest } = context.thumbProps 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\n const mergedStyle = () => {\n const thumbStyle = (context.thumbProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...thumbStyle, ...renderStyle };\n };\n const cleanInputProps = () => {\n const { ref: _ref, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const mergedInputProps = () =>\n mergeProps(\n cleanInputProps() as Record<string, unknown>,\n cleanFocusProps() as Record<string, unknown>,\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n\n return (\n <>\n <VisuallyHidden>\n <input ref={setInputRef} {...mergedInputProps()} />\n </VisuallyHidden>\n <div\n {...domProps}\n {...coerceDomRecord(cleanThumbProps() as Record<string, unknown>)}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={dataAttr(state.isDisabled)}\n data-dragging={dataAttr(state.isDragging())}\n data-focused={dataAttr(isFocused() || state.isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n data-hovered={dataAttr(isHovered())}\n >\n {renderProps.renderChildren()}\n </div>\n </>\n );\n}\n\n/** Clamp a value between min and max (mirror of upstream's number/clamp). */\nfunction clampFill(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n/**\n * The fill element of a slider, displaying the selected range.\n *\n * Solid adaptation of the pinned `SliderFill`. Upstream reads the\n * array-based `SliderState` (`values`/`getThumbPercent`); our `SliderState` is\n * single-value, so this fills from `offset` (default the slider's minValue, i.e.\n * 0%) to the current value — the single-thumb branch of upstream's math, using\n * the same `(v - min) / (max - min)` percent formula the state itself uses.\n */\nexport function SliderFill(props: SliderFillProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"offset\",\n \"children\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderFill must be used within a Slider\");\n }\n\n const { state } = context;\n\n const { isHovered, hoverProps } = createHover(() => ({\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n }));\n\n // Percent (0-100) of an arbitrary value within the track — mirrors\n // SliderState.getValuePercent's formula for a value other than the current one.\n const percentOf = (value: number) => {\n const range = state.maxValue - state.minValue;\n return range === 0 ? 0 : ((value - state.minValue) / range) * 100;\n };\n\n const offset = () =>\n local.offset != null ? clampFill(local.offset, state.minValue, state.maxValue) : state.minValue;\n const start = () => percentOf(offset());\n const end = () => state.getValuePercent() * 100;\n const startPercent = () => Math.min(start(), end());\n const sizePercent = () => Math.max(0, Math.max(start(), end()) - startPercent());\n\n const renderValues = createMemo<SliderFillRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isHovered: isHovered(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider-fill\",\n },\n renderValues,\n );\n\n // useRenderProps has no defaultStyle; merge the positioning style with the\n // user's, mirroring upstream SliderFill's defaultStyle (and SliderTrack here).\n const mergedStyle = (): JSX.CSSProperties => {\n const fillStyle: JSX.CSSProperties =\n state.orientation === \"vertical\"\n ? {\n position: \"absolute\",\n bottom: `${startPercent()}%`,\n height: `${sizePercent()}%`,\n width: \"100%\",\n }\n : {\n position: \"absolute\",\n \"inset-inline-start\": `${startPercent()}%`,\n width: `${sizePercent()}%`,\n height: \"100%\",\n };\n return { ...fillStyle, ...(renderProps.style() || {}) };\n };\n\n return (\n <div\n {...domProps}\n {...hoverProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(state.isDisabled)}\n data-orientation={state.orientation}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The output element of a slider, displaying the current value.\n */\nexport function SliderOutput(props: SliderOutputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderOutput must be used within a Slider\");\n }\n\n const { state } = context;\n\n const renderValues = createMemo<SliderOutputRenderProps>(() => ({\n value: state.value(),\n formattedValue: state.getFormattedValue(),\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-Slider-output\",\n },\n renderValues,\n );\n\n const cleanDomProps = () => {\n const { ref: _ref, ...rest } = domProps as Record<string, unknown>;\n return rest;\n };\n const cleanOutputProps = () => {\n const { ref: _ref, ...rest } = context.outputProps as Record<string, unknown>;\n return rest;\n };\n\n const renderedChildren = () => {\n // Check if raw children prop exists before calling renderChildren\n if (renderProps.children === undefined || renderProps.children === null) {\n return state.getFormattedValue();\n }\n return renderProps.renderChildren();\n };\n\n return (\n <output\n {...cleanDomProps()}\n {...cleanOutputProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n {renderedChildren()}\n </output>\n );\n}\n\nSlider.Track = SliderTrack;\nSlider.Thumb = SliderThumb;\nSlider.Fill = SliderFill;\nSlider.Output = SliderOutput;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwMA,MAAa,gBAAgB,cAAyC,IAAI;AAC1E,MAAa,qBAAqB;AAClC,MAAa,qBAAqB;AAClC,MAAa,oBAAoB;AACjC,MAAa,sBAAsB;;;;AAKnC,SAAgB,OAAO,OAAiC;CACtD,MAAM,CAAC,OAAO,YAAY,WAAW,QAAQ,WAC3C,OACA;EAAC;EAAS;EAAS;EAAQ;CAAK,GAChC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,GACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,QAAQ,kBAAkB;EAC9B,IAAI,QAAQ;GACV,OAAO,WAAW;EACpB;EACA,IAAI,eAAe;GACjB,OAAO,WAAW;EACpB;EACA,IAAI,WAAW;GACb,OAAO,WAAW;EACpB;EACA,IAAI,cAAc;GAChB,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,IA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AS"}
package/dist/Slider.jsx CHANGED
@@ -1,14 +1,27 @@
1
- import { 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/Slider.tsx
13
+ import { coerceDomRecord, dataAttr, filterDOMProps, useRenderProps } from "./utils.jsx";
2
14
  import { VisuallyHidden } from "./VisuallyHidden.jsx";
3
- import { Show, createContext, createMemo, splitProps, useContext } from "solid-js";
4
- import { createFocusRing, createHover, createSlider, mergeProps as mergeProps$1 } from "@proyecto-viviana/solidaria";
15
+ import { Show, createContext, createMemo, useContext } from "solid-js";
16
+ import { createFocusRing, createHover, createSlider, mergeProps } from "@proyecto-viviana/solidaria";
17
+ import { splitProps } from "@proyecto-viviana/solidaria/utils";
5
18
  import { createSliderState } from "@proyecto-viviana/solid-stately";
6
19
  //#region src/Slider.tsx
7
20
  /**
8
21
  * Slider component for solidaria-components
9
22
  *
10
23
  * A pre-wired headless slider that combines state + aria hooks.
11
- * Port of react-aria-components/src/Slider.tsx
24
+ * Solid adaptation of the pinned Slider component.
12
25
  */
13
26
  const SliderContext = createContext(null);
14
27
  const SliderStateContext = SliderContext;
@@ -134,7 +147,7 @@ function Slider(props) {
134
147
  const { ref: _ref, ...rest } = sliderAria.groupProps;
135
148
  return rest;
136
149
  };
137
- return <SliderContext.Provider value={{
150
+ return <SliderContext value={{
138
151
  state,
139
152
  get trackProps() {
140
153
  return sliderAria.trackProps;
@@ -157,14 +170,14 @@ function Slider(props) {
157
170
  },
158
171
  setInputRef
159
172
  }}>
160
- <div {...domProps()} {...cleanGroupProps()} ref={local.ref} class={renderProps.class()} style={renderProps.style()} data-disabled={state.isDisabled || void 0} data-orientation={state.orientation} data-dragging={state.isDragging() || void 0}>
173
+ <div {...domProps()} {...cleanGroupProps()} ref={local.ref} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state.isDisabled)} data-orientation={state.orientation} data-dragging={dataAttr(state.isDragging())}>
161
174
  <Show when={ariaProps.label}>
162
175
  <span {...sliderAria.labelProps}>{ariaProps.label}</span>
163
176
  </Show>
164
177
 
165
178
  {sliderChildren()}
166
179
  </div>
167
- </SliderContext.Provider>;
180
+ </SliderContext>;
168
181
  }
169
182
  /**
170
183
  * The track element of a slider.
@@ -205,7 +218,7 @@ function SliderTrack(props) {
205
218
  ...renderStyle
206
219
  };
207
220
  };
208
- return <div {...domProps} ref={setTrackRef} {...cleanTrackProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={state.isDisabled || void 0} data-orientation={state.orientation} data-dragging={state.isDragging() || void 0}>
221
+ return <div {...domProps} ref={setTrackRef} {...cleanTrackProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={dataAttr(state.isDisabled)} data-orientation={state.orientation} data-dragging={dataAttr(state.isDragging())}>
209
222
  {renderProps.renderChildren()}
210
223
  </div>;
211
224
  }
@@ -267,12 +280,12 @@ function SliderThumb(props) {
267
280
  const { ref: _ref, ...rest } = context.inputProps;
268
281
  return rest;
269
282
  };
270
- const mergedInputProps = () => mergeProps$1(cleanInputProps(), cleanFocusProps());
283
+ const mergedInputProps = () => mergeProps(cleanInputProps(), cleanFocusProps());
271
284
  return <>
272
285
  <VisuallyHidden>
273
286
  <input ref={setInputRef} {...mergedInputProps()} />
274
287
  </VisuallyHidden>
275
- <div {...domProps} {...cleanThumbProps()} {...cleanHoverProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={state.isDisabled || void 0} data-dragging={state.isDragging() || void 0} data-focused={isFocused() || state.isFocused() || void 0} data-focus-visible={isFocusVisible() || void 0} data-hovered={isHovered() || void 0}>
288
+ <div {...domProps} {...coerceDomRecord(cleanThumbProps())} {...cleanHoverProps()} class={renderProps.class()} style={mergedStyle()} data-disabled={dataAttr(state.isDisabled)} data-dragging={dataAttr(state.isDragging())} data-focused={dataAttr(isFocused() || state.isFocused())} data-focus-visible={dataAttr(isFocusVisible())} data-hovered={dataAttr(isHovered())}>
276
289
  {renderProps.renderChildren()}
277
290
  </div>
278
291
  </>;
@@ -284,7 +297,7 @@ function clampFill(value, min, max) {
284
297
  /**
285
298
  * The fill element of a slider, displaying the selected range.
286
299
  *
287
- * Port of react-aria-components `SliderFill` (RAC 1.18). Upstream reads the
300
+ * Solid adaptation of the pinned `SliderFill`. Upstream reads the
288
301
  * array-based `SliderState` (`values`/`getThumbPercent`); our `SliderState` is
289
302
  * single-value, so this fills from `offset` (default the slider's minValue, i.e.
290
303
  * 0%) to the current value — the single-thumb branch of upstream's math, using
@@ -348,7 +361,7 @@ function SliderFill(props) {
348
361
  ...renderProps.style() || {}
349
362
  };
350
363
  };
351
- return <div {...domProps} {...hoverProps} class={renderProps.class()} style={mergedStyle()} data-hovered={isHovered() || void 0} data-disabled={state.isDisabled || void 0} data-orientation={state.orientation}>
364
+ return <div {...domProps} {...hoverProps} class={renderProps.class()} style={mergedStyle()} data-hovered={dataAttr(isHovered())} data-disabled={dataAttr(state.isDisabled)} data-orientation={state.orientation}>
352
365
  {renderProps.renderChildren()}
353
366
  </div>;
354
367
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.jsx","names":["mergeProps"],"sources":["../src/Slider.tsx"],"sourcesContent":["/**\n * Slider component for solidaria-components\n *\n * A pre-wired headless slider that combines state + aria hooks.\n * Port of react-aria-components/src/Slider.tsx\n */\n\nimport { type JSX, createContext, createMemo, splitProps, useContext, Show } from \"solid-js\";\nimport {\n createSlider,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaSliderProps,\n type HoverEvents,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSliderState,\n type SliderState,\n type SliderOrientation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\n\nexport interface SliderRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** Whether the slider is focused. */\n isFocused: boolean;\n /** The current value. */\n value: number;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderProps extends Omit<AriaSliderProps, \"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 /** Handler called when dragging ends. */\n onChangeEnd?: (value: number) => void;\n /** The minimum value. */\n minValue?: number;\n /** The maximum value. */\n maxValue?: number;\n /** The step value. */\n step?: number;\n /** The orientation of the slider. */\n orientation?: SliderOrientation;\n /** The locale for number formatting. */\n locale?: string;\n /** Number format options. */\n formatOptions?: Intl.NumberFormatOptions;\n /** A visible label for the slider. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<SliderRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderRenderProps>;\n /** Ref for the slider root element. */\n ref?: (el: HTMLDivElement) => void;\n}\n\nexport interface SliderTrackRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderTrackProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the track. */\n children?: RenderChildren<SliderTrackRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderTrackRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderTrackRenderProps>;\n}\n\nexport interface SliderThumbRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the thumb is being dragged. */\n isDragging: boolean;\n /** Whether the thumb is focused. */\n isFocused: boolean;\n /** Whether the thumb has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the thumb is hovered. */\n isHovered: boolean;\n /** The current value. */\n value: number;\n /** The value as a percent (0-1). */\n valuePercent: number;\n}\n\nexport interface SliderThumbProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the thumb. */\n children?: RenderChildren<SliderThumbRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderThumbRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderThumbRenderProps>;\n}\n\nexport interface SliderFillRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider fill is currently hovered with a mouse. */\n isHovered: boolean;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderFillProps\n extends\n SlotProps,\n HoverEvents,\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The offset from which to start the fill. Defaults to the slider's minValue. */\n offset?: number;\n /** The children of the fill. */\n children?: RenderChildren<SliderFillRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderFillRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderFillRenderProps>;\n}\n\nexport interface SliderOutputRenderProps {\n /** The current value. */\n value: number;\n /** The formatted value string. */\n formattedValue: string;\n}\n\nexport interface SliderOutputProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the output. */\n children?: RenderChildren<SliderOutputRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderOutputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderOutputRenderProps>;\n}\n\ninterface SliderContextValue {\n state: SliderState;\n trackProps: JSX.HTMLAttributes<HTMLElement>;\n thumbProps: JSX.HTMLAttributes<HTMLElement>;\n outputProps: JSX.HTMLAttributes<HTMLElement>;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n trackRef: HTMLElement | undefined;\n setTrackRef: (el: HTMLElement) => void;\n inputRef: HTMLInputElement | undefined;\n setInputRef: (el: HTMLInputElement) => void;\n}\n\nexport const SliderContext = createContext<SliderContextValue | null>(null);\nexport const SliderStateContext = SliderContext;\nexport const SliderTrackContext = SliderContext;\nexport const SliderFillContext = SliderContext;\nexport const SliderOutputContext = SliderContext;\n\n/**\n * A slider allows users to select a value from a range.\n */\nexport function Slider(props: SliderProps): JSX.Element {\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"onChangeEnd\",\n \"minValue\",\n \"maxValue\",\n \"step\",\n \"orientation\",\n \"locale\",\n \"formatOptions\",\n ],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"id\",\n \"name\",\n \"form\",\n ],\n );\n\n const state = createSliderState({\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 onChangeEnd() {\n return stateProps.onChangeEnd;\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 orientation() {\n return stateProps.orientation;\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 });\n\n let trackRef: HTMLElement | undefined;\n const setTrackRef = (el: HTMLElement) => {\n trackRef = el;\n };\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const sliderAria = createSlider(\n ariaProps,\n state,\n () => trackRef ?? null,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<SliderRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n isFocused: state.isFocused(),\n value: state.value(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider\",\n },\n renderValues,\n );\n\n const childRenderValues: SliderRenderProps = {\n get isDisabled() {\n return state.isDisabled;\n },\n get isDragging() {\n return state.isDragging();\n },\n get isFocused() {\n return state.isFocused();\n },\n get value() {\n return state.value();\n },\n get valuePercent() {\n return state.getValuePercent();\n },\n get orientation() {\n return state.orientation;\n },\n };\n\n const sliderChildren = () => {\n const children = props.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 cleanGroupProps = () => {\n const { ref: _ref, ...rest } = sliderAria.groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <SliderContext.Provider\n value={{\n state,\n get trackProps() {\n return sliderAria.trackProps;\n },\n get thumbProps() {\n return sliderAria.thumbProps;\n },\n get outputProps() {\n return sliderAria.outputProps;\n },\n get inputProps() {\n return sliderAria.inputProps;\n },\n get trackRef() {\n return trackRef;\n },\n setTrackRef,\n get inputRef() {\n return inputRef;\n },\n setInputRef,\n }}\n >\n <div\n {...domProps()}\n {...cleanGroupProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={state.isDisabled || undefined}\n data-orientation={state.orientation}\n data-dragging={state.isDragging() || undefined}\n >\n <Show when={ariaProps.label}>\n <span {...sliderAria.labelProps}>{ariaProps.label}</span>\n </Show>\n\n {sliderChildren()}\n </div>\n </SliderContext.Provider>\n );\n}\n\n/**\n * The track element of a slider.\n */\nexport function SliderTrack(props: SliderTrackProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderTrack must be used within a Slider\");\n }\n\n const { state, setTrackRef } = context;\n\n const renderValues = createMemo<SliderTrackRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider-track\",\n },\n renderValues,\n );\n\n const cleanTrackProps = () => {\n const { ref: _ref, style: trackStyle, ...rest } = context.trackProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = () => {\n const trackStyle = (context.trackProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...trackStyle, ...renderStyle };\n };\n\n return (\n <div\n {...domProps}\n ref={setTrackRef}\n {...cleanTrackProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n data-orientation={state.orientation}\n data-dragging={state.isDragging() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The thumb element of a slider.\n */\nexport function SliderThumb(props: SliderThumbProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderThumb must be used within a Slider\");\n }\n\n const { state, setInputRef } = context;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<SliderThumbRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n isFocused: isFocused() || state.isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n value: state.value(),\n valuePercent: state.getValuePercent(),\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-Slider-thumb\",\n },\n renderValues,\n );\n\n const cleanThumbProps = () => {\n const { ref: _ref, style: thumbStyle, ...rest } = context.thumbProps 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\n const mergedStyle = () => {\n const thumbStyle = (context.thumbProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...thumbStyle, ...renderStyle };\n };\n const cleanInputProps = () => {\n const { ref: _ref, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const mergedInputProps = () =>\n mergeProps(\n cleanInputProps() as Record<string, unknown>,\n cleanFocusProps() as Record<string, unknown>,\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n\n return (\n <>\n <VisuallyHidden>\n <input ref={setInputRef} {...mergedInputProps()} />\n </VisuallyHidden>\n <div\n {...domProps}\n {...cleanThumbProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={state.isDisabled || undefined}\n data-dragging={state.isDragging() || undefined}\n data-focused={isFocused() || state.isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n >\n {renderProps.renderChildren()}\n </div>\n </>\n );\n}\n\n/** Clamp a value between min and max (mirror of upstream's number/clamp). */\nfunction clampFill(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n/**\n * The fill element of a slider, displaying the selected range.\n *\n * Port of react-aria-components `SliderFill` (RAC 1.18). Upstream reads the\n * array-based `SliderState` (`values`/`getThumbPercent`); our `SliderState` is\n * single-value, so this fills from `offset` (default the slider's minValue, i.e.\n * 0%) to the current value — the single-thumb branch of upstream's math, using\n * the same `(v - min) / (max - min)` percent formula the state itself uses.\n */\nexport function SliderFill(props: SliderFillProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"offset\",\n \"children\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderFill must be used within a Slider\");\n }\n\n const { state } = context;\n\n const { isHovered, hoverProps } = createHover(() => ({\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n }));\n\n // Percent (0-100) of an arbitrary value within the track — mirrors\n // SliderState.getValuePercent's formula for a value other than the current one.\n const percentOf = (value: number) => {\n const range = state.maxValue - state.minValue;\n return range === 0 ? 0 : ((value - state.minValue) / range) * 100;\n };\n\n const offset = () =>\n local.offset != null ? clampFill(local.offset, state.minValue, state.maxValue) : state.minValue;\n const start = () => percentOf(offset());\n const end = () => state.getValuePercent() * 100;\n const startPercent = () => Math.min(start(), end());\n const sizePercent = () => Math.max(0, Math.max(start(), end()) - startPercent());\n\n const renderValues = createMemo<SliderFillRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isHovered: isHovered(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider-fill\",\n },\n renderValues,\n );\n\n // useRenderProps has no defaultStyle; merge the positioning style with the\n // user's, mirroring upstream SliderFill's defaultStyle (and SliderTrack here).\n const mergedStyle = (): JSX.CSSProperties => {\n const fillStyle: JSX.CSSProperties =\n state.orientation === \"vertical\"\n ? {\n position: \"absolute\",\n bottom: `${startPercent()}%`,\n height: `${sizePercent()}%`,\n width: \"100%\",\n }\n : {\n position: \"absolute\",\n \"inset-inline-start\": `${startPercent()}%`,\n width: `${sizePercent()}%`,\n height: \"100%\",\n };\n return { ...fillStyle, ...(renderProps.style() || {}) };\n };\n\n return (\n <div\n {...domProps}\n {...hoverProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-hovered={isHovered() || undefined}\n data-disabled={state.isDisabled || undefined}\n data-orientation={state.orientation}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The output element of a slider, displaying the current value.\n */\nexport function SliderOutput(props: SliderOutputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderOutput must be used within a Slider\");\n }\n\n const { state } = context;\n\n const renderValues = createMemo<SliderOutputRenderProps>(() => ({\n value: state.value(),\n formattedValue: state.getFormattedValue(),\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-Slider-output\",\n },\n renderValues,\n );\n\n const cleanDomProps = () => {\n const { ref: _ref, ...rest } = domProps as Record<string, unknown>;\n return rest;\n };\n const cleanOutputProps = () => {\n const { ref: _ref, ...rest } = context.outputProps as Record<string, unknown>;\n return rest;\n };\n\n const renderedChildren = () => {\n // Check if raw children prop exists before calling renderChildren\n if (renderProps.children === undefined || renderProps.children === null) {\n return state.getFormattedValue();\n }\n return renderProps.renderChildren();\n };\n\n return (\n <output\n {...cleanDomProps()}\n {...cleanOutputProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n {renderedChildren()}\n </output>\n );\n}\n\nSlider.Track = SliderTrack;\nSlider.Thumb = SliderThumb;\nSlider.Fill = SliderFill;\nSlider.Output = SliderOutput;\n"],"mappings":";;;;;;;;;;;;AAsLA,MAAa,gBAAgB,cAAyC,IAAI;AAC1E,MAAa,qBAAqB;AAClC,MAAa,qBAAqB;AAClC,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Y,eAAe;CACpC;CAEA,OACE,CAAC,WACK,cAAc,OACd,iBAAiB,GACrB,OAAO,YAAY,MAAM,GACzB,OAAO,YAAY,MAAM,GAC1B;OACE,iBAAiB,EAAE;IACtB,EAAE;AAEN;AAEA,OAAO,QAAQ;AACf,OAAO,QAAQ;AACf,OAAO,OAAO;AACd,OAAO,SAAS"}
1
+ {"version":3,"file":"Slider.jsx","names":[],"sources":["../src/Slider.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/Slider.tsx\n\n/**\n * Slider component for solidaria-components\n *\n * A pre-wired headless slider that combines state + aria hooks.\n * Solid adaptation of the pinned Slider component.\n */\n\nimport { createContext, createMemo, useContext, Show } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createSlider,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaSliderProps,\n type HoverEvents,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSliderState,\n type SliderState,\n type SliderOrientation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n coerceDomRecord,\n} from \"./utils\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface SliderRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** Whether the slider is focused. */\n isFocused: boolean;\n /** The current value. */\n value: number;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderProps extends Omit<AriaSliderProps, \"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 /** Handler called when dragging ends. */\n onChangeEnd?: (value: number) => void;\n /** The minimum value. */\n minValue?: number;\n /** The maximum value. */\n maxValue?: number;\n /** The step value. */\n step?: number;\n /** The orientation of the slider. */\n orientation?: SliderOrientation;\n /** The locale for number formatting. */\n locale?: string;\n /** Number format options. */\n formatOptions?: Intl.NumberFormatOptions;\n /** A visible label for the slider. */\n label?: JSX.Element;\n /** The children of the component. */\n children?: RenderChildren<SliderRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderRenderProps>;\n /** Ref for the slider root element. */\n ref?: (el: HTMLDivElement) => void;\n}\n\nexport interface SliderTrackRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider is being dragged. */\n isDragging: boolean;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderTrackProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the track. */\n children?: RenderChildren<SliderTrackRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderTrackRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderTrackRenderProps>;\n}\n\nexport interface SliderThumbRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the thumb is being dragged. */\n isDragging: boolean;\n /** Whether the thumb is focused. */\n isFocused: boolean;\n /** Whether the thumb has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the thumb is hovered. */\n isHovered: boolean;\n /** The current value. */\n value: number;\n /** The value as a percent (0-1). */\n valuePercent: number;\n}\n\nexport interface SliderThumbProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the thumb. */\n children?: RenderChildren<SliderThumbRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderThumbRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderThumbRenderProps>;\n}\n\nexport interface SliderFillRenderProps {\n /** Whether the slider is disabled. */\n isDisabled: boolean;\n /** Whether the slider fill is currently hovered with a mouse. */\n isHovered: boolean;\n /** The value as a percent (0-1). */\n valuePercent: number;\n /** The orientation. */\n orientation: SliderOrientation;\n}\n\nexport interface SliderFillProps\n extends\n SlotProps,\n HoverEvents,\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\"> {\n /** The offset from which to start the fill. Defaults to the slider's minValue. */\n offset?: number;\n /** The children of the fill. */\n children?: RenderChildren<SliderFillRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderFillRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderFillRenderProps>;\n}\n\nexport interface SliderOutputRenderProps {\n /** The current value. */\n value: number;\n /** The formatted value string. */\n formattedValue: string;\n}\n\nexport interface SliderOutputProps\n extends SlotProps, Omit<JSX.HTMLAttributes<HTMLElement>, \"class\" | \"style\" | \"children\"> {\n /** The children of the output. */\n children?: RenderChildren<SliderOutputRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SliderOutputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SliderOutputRenderProps>;\n}\n\ninterface SliderContextValue {\n state: SliderState;\n trackProps: JSX.HTMLAttributes<HTMLElement>;\n thumbProps: JSX.HTMLAttributes<HTMLElement>;\n outputProps: JSX.HTMLAttributes<HTMLElement>;\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n trackRef: HTMLElement | undefined;\n setTrackRef: (el: HTMLElement) => void;\n inputRef: HTMLInputElement | undefined;\n setInputRef: (el: HTMLInputElement) => void;\n}\n\nexport const SliderContext = createContext<SliderContextValue | null>(null);\nexport const SliderStateContext = SliderContext;\nexport const SliderTrackContext = SliderContext;\nexport const SliderFillContext = SliderContext;\nexport const SliderOutputContext = SliderContext;\n\n/**\n * A slider allows users to select a value from a range.\n */\nexport function Slider(props: SliderProps): JSX.Element {\n const [local, stateProps, ariaProps, rest] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"ref\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"onChangeEnd\",\n \"minValue\",\n \"maxValue\",\n \"step\",\n \"orientation\",\n \"locale\",\n \"formatOptions\",\n ],\n [\n \"label\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"isDisabled\",\n \"id\",\n \"name\",\n \"form\",\n ],\n );\n\n const state = createSliderState({\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 onChangeEnd() {\n return stateProps.onChangeEnd;\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 orientation() {\n return stateProps.orientation;\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 });\n\n let trackRef: HTMLElement | undefined;\n const setTrackRef = (el: HTMLElement) => {\n trackRef = el;\n };\n let inputRef: HTMLInputElement | undefined;\n const setInputRef = (el: HTMLInputElement) => {\n inputRef = el;\n };\n\n const sliderAria = createSlider(\n ariaProps,\n state,\n () => trackRef ?? null,\n () => inputRef ?? null,\n );\n\n const renderValues = createMemo<SliderRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n isFocused: state.isFocused(),\n value: state.value(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider\",\n },\n renderValues,\n );\n\n const childRenderValues: SliderRenderProps = {\n get isDisabled() {\n return state.isDisabled;\n },\n get isDragging() {\n return state.isDragging();\n },\n get isFocused() {\n return state.isFocused();\n },\n get value() {\n return state.value();\n },\n get valuePercent() {\n return state.getValuePercent();\n },\n get orientation() {\n return state.orientation;\n },\n };\n\n const sliderChildren = () => {\n const children = props.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 cleanGroupProps = () => {\n const { ref: _ref, ...rest } = sliderAria.groupProps as Record<string, unknown>;\n return rest;\n };\n\n return (\n <SliderContext\n value={{\n state,\n get trackProps() {\n return sliderAria.trackProps;\n },\n get thumbProps() {\n return sliderAria.thumbProps;\n },\n get outputProps() {\n return sliderAria.outputProps;\n },\n get inputProps() {\n return sliderAria.inputProps;\n },\n get trackRef() {\n return trackRef;\n },\n setTrackRef,\n get inputRef() {\n return inputRef;\n },\n setInputRef,\n }}\n >\n <div\n {...domProps()}\n {...cleanGroupProps()}\n ref={local.ref}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled)}\n data-orientation={state.orientation}\n data-dragging={dataAttr(state.isDragging())}\n >\n <Show when={ariaProps.label}>\n <span {...sliderAria.labelProps}>{ariaProps.label}</span>\n </Show>\n\n {sliderChildren()}\n </div>\n </SliderContext>\n );\n}\n\n/**\n * The track element of a slider.\n */\nexport function SliderTrack(props: SliderTrackProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderTrack must be used within a Slider\");\n }\n\n const { state, setTrackRef } = context;\n\n const renderValues = createMemo<SliderTrackRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider-track\",\n },\n renderValues,\n );\n\n const cleanTrackProps = () => {\n const { ref: _ref, style: trackStyle, ...rest } = context.trackProps as Record<string, unknown>;\n return rest;\n };\n\n const mergedStyle = () => {\n const trackStyle = (context.trackProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...trackStyle, ...renderStyle };\n };\n\n return (\n <div\n {...domProps}\n ref={setTrackRef}\n {...cleanTrackProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={dataAttr(state.isDisabled)}\n data-orientation={state.orientation}\n data-dragging={dataAttr(state.isDragging())}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The thumb element of a slider.\n */\nexport function SliderThumb(props: SliderThumbProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderThumb must be used within a Slider\");\n }\n\n const { state, setInputRef } = context;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<SliderThumbRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isDragging: state.isDragging(),\n isFocused: isFocused() || state.isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n value: state.value(),\n valuePercent: state.getValuePercent(),\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-Slider-thumb\",\n },\n renderValues,\n );\n\n const cleanThumbProps = () => {\n const { ref: _ref, style: thumbStyle, ...rest } = context.thumbProps 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\n const mergedStyle = () => {\n const thumbStyle = (context.thumbProps as { style?: Record<string, string> }).style || {};\n const renderStyle = renderProps.style() || {};\n return { ...thumbStyle, ...renderStyle };\n };\n const cleanInputProps = () => {\n const { ref: _ref, ...rest } = context.inputProps as Record<string, unknown>;\n return rest;\n };\n const mergedInputProps = () =>\n mergeProps(\n cleanInputProps() as Record<string, unknown>,\n cleanFocusProps() as Record<string, unknown>,\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n\n return (\n <>\n <VisuallyHidden>\n <input ref={setInputRef} {...mergedInputProps()} />\n </VisuallyHidden>\n <div\n {...domProps}\n {...coerceDomRecord(cleanThumbProps() as Record<string, unknown>)}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={mergedStyle()}\n data-disabled={dataAttr(state.isDisabled)}\n data-dragging={dataAttr(state.isDragging())}\n data-focused={dataAttr(isFocused() || state.isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n data-hovered={dataAttr(isHovered())}\n >\n {renderProps.renderChildren()}\n </div>\n </>\n );\n}\n\n/** Clamp a value between min and max (mirror of upstream's number/clamp). */\nfunction clampFill(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\n/**\n * The fill element of a slider, displaying the selected range.\n *\n * Solid adaptation of the pinned `SliderFill`. Upstream reads the\n * array-based `SliderState` (`values`/`getThumbPercent`); our `SliderState` is\n * single-value, so this fills from `offset` (default the slider's minValue, i.e.\n * 0%) to the current value — the single-thumb branch of upstream's math, using\n * the same `(v - min) / (max - min)` percent formula the state itself uses.\n */\nexport function SliderFill(props: SliderFillProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"offset\",\n \"children\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onHoverChange\",\n ]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderFill must be used within a Slider\");\n }\n\n const { state } = context;\n\n const { isHovered, hoverProps } = createHover(() => ({\n onHoverStart: local.onHoverStart,\n onHoverEnd: local.onHoverEnd,\n onHoverChange: local.onHoverChange,\n }));\n\n // Percent (0-100) of an arbitrary value within the track — mirrors\n // SliderState.getValuePercent's formula for a value other than the current one.\n const percentOf = (value: number) => {\n const range = state.maxValue - state.minValue;\n return range === 0 ? 0 : ((value - state.minValue) / range) * 100;\n };\n\n const offset = () =>\n local.offset != null ? clampFill(local.offset, state.minValue, state.maxValue) : state.minValue;\n const start = () => percentOf(offset());\n const end = () => state.getValuePercent() * 100;\n const startPercent = () => Math.min(start(), end());\n const sizePercent = () => Math.max(0, Math.max(start(), end()) - startPercent());\n\n const renderValues = createMemo<SliderFillRenderProps>(() => ({\n isDisabled: state.isDisabled,\n isHovered: isHovered(),\n valuePercent: state.getValuePercent(),\n orientation: state.orientation,\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-Slider-fill\",\n },\n renderValues,\n );\n\n // useRenderProps has no defaultStyle; merge the positioning style with the\n // user's, mirroring upstream SliderFill's defaultStyle (and SliderTrack here).\n const mergedStyle = (): JSX.CSSProperties => {\n const fillStyle: JSX.CSSProperties =\n state.orientation === \"vertical\"\n ? {\n position: \"absolute\",\n bottom: `${startPercent()}%`,\n height: `${sizePercent()}%`,\n width: \"100%\",\n }\n : {\n position: \"absolute\",\n \"inset-inline-start\": `${startPercent()}%`,\n width: `${sizePercent()}%`,\n height: \"100%\",\n };\n return { ...fillStyle, ...(renderProps.style() || {}) };\n };\n\n return (\n <div\n {...domProps}\n {...hoverProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(state.isDisabled)}\n data-orientation={state.orientation}\n >\n {renderProps.renderChildren()}\n </div>\n );\n}\n\n/**\n * The output element of a slider, displaying the current value.\n */\nexport function SliderOutput(props: SliderOutputProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SliderContext);\n if (!context) {\n throw new Error(\"SliderOutput must be used within a Slider\");\n }\n\n const { state } = context;\n\n const renderValues = createMemo<SliderOutputRenderProps>(() => ({\n value: state.value(),\n formattedValue: state.getFormattedValue(),\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-Slider-output\",\n },\n renderValues,\n );\n\n const cleanDomProps = () => {\n const { ref: _ref, ...rest } = domProps as Record<string, unknown>;\n return rest;\n };\n const cleanOutputProps = () => {\n const { ref: _ref, ...rest } = context.outputProps as Record<string, unknown>;\n return rest;\n };\n\n const renderedChildren = () => {\n // Check if raw children prop exists before calling renderChildren\n if (renderProps.children === undefined || renderProps.children === null) {\n return state.getFormattedValue();\n }\n return renderProps.renderChildren();\n };\n\n return (\n <output\n {...cleanDomProps()}\n {...cleanOutputProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n >\n {renderedChildren()}\n </output>\n );\n}\n\nSlider.Track = SliderTrack;\nSlider.Thumb = SliderThumb;\nSlider.Fill = SliderFill;\nSlider.Output = SliderOutput;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwMA,MAAa,gBAAgB,cAAyC,IAAI;AAC1E,MAAa,qBAAqB;AAClC,MAAa,qBAAqB;AAClC,MAAa,oBAAoB;AACjC,MAAa,sBAAsB;;;;AAKnC,SAAgB,OAAO,OAAiC;CACtD,MAAM,CAAC,OAAO,YAAY,WAAW,QAAQ,WAC3C,OACA;EAAC;EAAS;EAAS;EAAQ;CAAK,GAChC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,GACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF;CAEA,MAAM,QA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4
- * A pre-wired headless step list component that combines state + aria hooks.
5
- * Renders an ordered list of steps with completion tracking.
6
- */
7
- import { type JSX } from "solid-js";
1
+ import type { JSX } from "@solidjs/web";
8
2
  import { type StepListState, type Key } from "@proyecto-viviana/solid-stately";
9
3
  import { type AriaStepListProps } from "@proyecto-viviana/solidaria";
10
4
  import { type ClassNameOrFunction, type StyleOrFunction } from "./utils";
@@ -1 +1 @@
1
- {"version":3,"file":"StepList.d.ts","sourceRoot":"","sources":["../src/StepList.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,GAAG,EAA0D,MAAM,UAAU,CAAC;AAC5F,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,GAAG,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EAGrB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,uBAAuB;IACtC,+CAA+C;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,qCAAqC;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,yCAAyC;IACzC,YAAY,EAAE,OAAO,CAAC;IACtB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAE,SAAQ,iBAAiB;IAC7F,sBAAsB;IACtB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,oDAAoD;IACpD,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,oDAAoD;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