@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
package/dist/Switch.js CHANGED
@@ -1,10 +1,23 @@
1
- import { Provider, filterDOMProps, useRenderProps } from "./utils.js";
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/Switch.tsx
13
+ import { Provider, dataAttr, filterDOMProps, useRenderProps } from "./utils.js";
2
14
  import { VisuallyHidden } from "./VisuallyHidden.js";
3
- import { FieldErrorContext } from "./FieldError.js";
4
15
  import { TextContext } from "./Text.js";
5
- import { createComponent, getNextElement, getNextMarker, insert, memo, mergeProps, runHydrationEvents, setAttribute, spread, template, use } from "solid-js/web";
6
- import { Show, createContext, createMemo, createSignal, createUniqueId, splitProps, untrack, useContext } from "solid-js";
7
- import { createFocusRing, createHover, createSwitch, mergeProps as mergeProps$2 } from "@proyecto-viviana/solidaria";
16
+ import { FieldErrorContext } from "./FieldError.js";
17
+ import { createComponent, getNextElement, getNextMarker, insert, memo, ref, runHydrationEvents, setAttribute, spread, template } from "@solidjs/web";
18
+ import { Show, createContext, createMemo, createSignal, createUniqueId, untrack, useContext } from "solid-js";
19
+ import { createFocusRing, createHover, createSwitch, mergeProps as mergeProps$1 } from "@proyecto-viviana/solidaria";
20
+ import { splitProps } from "@proyecto-viviana/solidaria/utils";
8
21
  import { VALID_VALIDITY_STATE, createToggleState } from "@proyecto-viviana/solid-stately";
9
22
  //#region src/Switch.tsx
10
23
  /**
@@ -15,7 +28,12 @@ import { VALID_VALIDITY_STATE, createToggleState } from "@proyecto-viviana/solid
15
28
  *
16
29
  * Named "ToggleSwitch" to avoid conflict with SolidJS's built-in Switch component.
17
30
  */
18
- var _tmpl$ = /*#__PURE__*/ template(`<input>`), _tmpl$2 = /*#__PURE__*/ template(`<span slot=description>`), _tmpl$3 = /*#__PURE__*/ template(`<span slot=errorMessage>`), _tmpl$4 = /*#__PURE__*/ template(`<label><!$><!/><!$><!/><!$><!/><!$><!/>`), _tmpl$5 = /*#__PURE__*/ template(`<label><!$><!/><!$><!/>`), _tmpl$6 = /*#__PURE__*/ template(`<div>`);
31
+ var _tmpl$ = /* @__PURE__ */ template(`<input>`);
32
+ var _tmpl$2 = /* @__PURE__ */ template(`<span slot=description>`);
33
+ var _tmpl$3 = /* @__PURE__ */ template(`<span slot=errorMessage>`);
34
+ var _tmpl$4 = /* @__PURE__ */ template(`<label><!$><!/><!$><!/><!$><!/><!$><!/>`);
35
+ var _tmpl$5 = /* @__PURE__ */ template(`<label><!$><!/><!$><!/>`);
36
+ var _tmpl$6 = /* @__PURE__ */ template(`<div>`);
19
37
  const ToggleSwitchContext = createContext(null);
20
38
  /**
21
39
  * A switch allows a user to turn a setting on or off.
@@ -146,72 +164,95 @@ function ToggleSwitch(props) {
146
164
  const children = props.children;
147
165
  return typeof children === "function" ? children(childRenderValues) : children;
148
166
  });
149
- return (() => {
150
- var _el$ = getNextElement(_tmpl$4), _el$5 = _el$.firstChild, [_el$6, _co$] = getNextMarker(_el$5.nextSibling), _el$7 = _el$6.nextSibling, [_el$8, _co$2] = getNextMarker(_el$7.nextSibling), _el$9 = _el$8.nextSibling, [_el$0, _co$3] = getNextMarker(_el$9.nextSibling), _el$1 = _el$0.nextSibling, [_el$10, _co$4] = getNextMarker(_el$1.nextSibling);
151
- spread(_el$, mergeProps(domProps, cleanLabelProps, cleanHoverProps, {
152
- get ["class"]() {
167
+ var _el$ = getNextElement(_tmpl$4);
168
+ var _el$3 = _el$.firstChild;
169
+ var [_el$4, _el$5] = getNextMarker(_el$3.nextSibling);
170
+ var _el$6 = _el$4.nextSibling;
171
+ var [_el$7, _el$8] = getNextMarker(_el$6.nextSibling);
172
+ var _el$10 = _el$7.nextSibling;
173
+ var [_el$11, _el$12] = getNextMarker(_el$10.nextSibling);
174
+ var _el$14 = _el$11.nextSibling;
175
+ var [_el$15, _el$16] = getNextMarker(_el$14.nextSibling);
176
+ spread(_el$, [
177
+ domProps,
178
+ cleanLabelProps,
179
+ cleanHoverProps,
180
+ {
181
+ get "class"() {
153
182
  return renderProps.class();
154
183
  },
155
184
  get style() {
156
185
  return renderProps.style();
157
186
  },
158
- get ["data-selected"]() {
159
- return switchAria.isSelected() || void 0;
187
+ get "data-selected"() {
188
+ return dataAttr(switchAria.isSelected());
160
189
  },
161
- get ["data-pressed"]() {
162
- return switchAria.isPressed() || void 0;
190
+ get "data-pressed"() {
191
+ return dataAttr(switchAria.isPressed());
163
192
  },
164
- get ["data-hovered"]() {
165
- return isHovered() || void 0;
193
+ get "data-hovered"() {
194
+ return dataAttr(isHovered());
166
195
  },
167
- get ["data-focused"]() {
168
- return isFocused() || void 0;
196
+ get "data-focused"() {
197
+ return dataAttr(isFocused());
169
198
  },
170
- get ["data-focus-visible"]() {
171
- return isFocusVisible() || void 0;
199
+ get "data-focus-visible"() {
200
+ return dataAttr(isFocusVisible());
172
201
  },
173
- get ["data-disabled"]() {
174
- return switchAria.isDisabled || void 0;
202
+ get "data-disabled"() {
203
+ return dataAttr(switchAria.isDisabled);
175
204
  },
176
- get ["data-readonly"]() {
177
- return switchAria.isReadOnly || void 0;
205
+ get "data-readonly"() {
206
+ return dataAttr(switchAria.isReadOnly);
178
207
  }
179
- }), false, true);
180
- insert(_el$, createComponent(VisuallyHidden, { get children() {
181
- var _el$2 = getNextElement(_tmpl$);
182
- use(setInputElement, _el$2);
183
- spread(_el$2, mergeProps(cleanInputProps, cleanFocusProps, { get ["aria-describedby"]() {
208
+ }
209
+ ], true);
210
+ insert(_el$, createComponent(VisuallyHidden, { get children() {
211
+ var _el$2 = getNextElement(_tmpl$);
212
+ ref(() => {
213
+ return setInputElement;
214
+ }, _el$2);
215
+ spread(_el$2, [
216
+ cleanInputProps,
217
+ cleanFocusProps,
218
+ { get "aria-describedby"() {
184
219
  return describedBy();
185
- } }), false, false);
186
- runHydrationEvents();
187
- return _el$2;
188
- } }), _el$6, _co$);
189
- insert(_el$, switchChildren, _el$8, _co$2);
190
- insert(_el$, createComponent(Show, {
191
- get when() {
192
- return local.description;
193
- },
194
- get children() {
195
- var _el$3 = getNextElement(_tmpl$2);
196
- setAttribute(_el$3, "id", descriptionId);
197
- insert(_el$3, () => local.description);
198
- return _el$3;
199
- }
200
- }), _el$0, _co$3);
201
- insert(_el$, createComponent(Show, {
202
- get when() {
203
- return memo(() => !!switchAria.isInvalid)() && local.errorMessage;
204
- },
205
- get children() {
206
- var _el$4 = getNextElement(_tmpl$3);
207
- setAttribute(_el$4, "id", errorMessageId);
208
- insert(_el$4, () => local.errorMessage);
209
- return _el$4;
210
- }
211
- }), _el$10, _co$4);
220
+ } }
221
+ ], false);
212
222
  runHydrationEvents();
213
- return _el$;
214
- })();
223
+ return _el$2;
224
+ } }), _el$4, _el$5);
225
+ insert(_el$, switchChildren, _el$7, _el$8);
226
+ insert(_el$, createComponent(Show, {
227
+ get when() {
228
+ return local.description;
229
+ },
230
+ get children() {
231
+ var _el$9 = getNextElement(_tmpl$2);
232
+ setAttribute(_el$9, "id", descriptionId);
233
+ insert(_el$9, () => {
234
+ return local.description;
235
+ });
236
+ return _el$9;
237
+ }
238
+ }), _el$11, _el$12);
239
+ insert(_el$, createComponent(Show, {
240
+ get when() {
241
+ return memo(() => {
242
+ return !!switchAria.isInvalid;
243
+ })() ? local.errorMessage : switchAria.isInvalid;
244
+ },
245
+ get children() {
246
+ var _el$13 = getNextElement(_tmpl$3);
247
+ setAttribute(_el$13, "id", errorMessageId);
248
+ insert(_el$13, () => {
249
+ return local.errorMessage;
250
+ });
251
+ return _el$13;
252
+ }
253
+ }), _el$15, _el$16);
254
+ runHydrationEvents();
255
+ return _el$;
215
256
  }
216
257
  const SwitchFieldContext = createContext(null);
217
258
  const InternalSwitchContext = createContext(null);
@@ -315,10 +356,16 @@ function SwitchButtonImpl(props) {
315
356
  const children = props.buttonProps.children;
316
357
  return typeof children === "function" ? children(childRenderValues) : children;
317
358
  });
318
- return (() => {
319
- var _el$11 = getNextElement(_tmpl$5), _el$13 = _el$11.firstChild, [_el$14, _co$5] = getNextMarker(_el$13.nextSibling), _el$15 = _el$14.nextSibling, [_el$16, _co$6] = getNextMarker(_el$15.nextSibling);
320
- spread(_el$11, mergeProps(cleanLabelProps, cleanHoverProps, {
321
- get ["class"]() {
359
+ var _el$17 = getNextElement(_tmpl$5);
360
+ var _el$19 = _el$17.firstChild;
361
+ var [_el$20, _el$21] = getNextMarker(_el$19.nextSibling);
362
+ var _el$22 = _el$20.nextSibling;
363
+ var [_el$23, _el$24] = getNextMarker(_el$22.nextSibling);
364
+ spread(_el$17, [
365
+ cleanLabelProps,
366
+ cleanHoverProps,
367
+ {
368
+ get "class"() {
322
369
  return renderProps.class();
323
370
  },
324
371
  get style() {
@@ -327,46 +374,48 @@ function SwitchButtonImpl(props) {
327
374
  get slot() {
328
375
  return props.buttonProps.slot;
329
376
  },
330
- get ["data-selected"]() {
331
- return switchAria.isSelected() || void 0;
377
+ get "data-selected"() {
378
+ return dataAttr(switchAria.isSelected());
332
379
  },
333
- get ["data-pressed"]() {
334
- return switchAria.isPressed() || void 0;
380
+ get "data-pressed"() {
381
+ return dataAttr(switchAria.isPressed());
335
382
  },
336
- get ["data-hovered"]() {
337
- return isHovered() || void 0;
383
+ get "data-hovered"() {
384
+ return dataAttr(isHovered());
338
385
  },
339
- get ["data-focused"]() {
340
- return isFocused() || void 0;
386
+ get "data-focused"() {
387
+ return dataAttr(isFocused());
341
388
  },
342
- get ["data-focus-visible"]() {
343
- return isFocusVisible() || void 0;
389
+ get "data-focus-visible"() {
390
+ return dataAttr(isFocusVisible());
344
391
  },
345
- get ["data-disabled"]() {
346
- return switchAria.isDisabled || void 0;
392
+ get "data-disabled"() {
393
+ return dataAttr(switchAria.isDisabled);
347
394
  },
348
- get ["data-readonly"]() {
349
- return switchAria.isReadOnly || void 0;
395
+ get "data-readonly"() {
396
+ return dataAttr(switchAria.isReadOnly);
350
397
  },
351
- get ["data-invalid"]() {
352
- return switchAria.isInvalid || void 0;
398
+ get "data-invalid"() {
399
+ return dataAttr(switchAria.isInvalid);
353
400
  },
354
- get ["data-required"]() {
355
- return ctx.isRequired || void 0;
401
+ get "data-required"() {
402
+ return dataAttr(ctx.isRequired);
356
403
  }
357
- }), false, true);
358
- insert(_el$11, createComponent(VisuallyHidden, { get children() {
359
- var _el$12 = getNextElement(_tmpl$);
360
- var _ref$ = ctx.setInputElement;
361
- typeof _ref$ === "function" ? use(_ref$, _el$12) : ctx.setInputElement = _el$12;
362
- spread(_el$12, mergeProps(cleanInputProps, cleanFocusProps), false, false);
363
- runHydrationEvents();
364
- return _el$12;
365
- } }), _el$14, _co$5);
366
- insert(_el$11, switchChildren, _el$16, _co$6);
404
+ }
405
+ ], true);
406
+ insert(_el$17, createComponent(VisuallyHidden, { get children() {
407
+ var _el$18 = getNextElement(_tmpl$);
408
+ var _ref$ = ctx.setInputElement;
409
+ typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => {
410
+ return _ref$;
411
+ }, _el$18) : ctx.setInputElement = _el$18;
412
+ spread(_el$18, [cleanInputProps, cleanFocusProps], false);
367
413
  runHydrationEvents();
368
- return _el$11;
369
- })();
414
+ return _el$18;
415
+ } }), _el$20, _el$21);
416
+ insert(_el$17, switchChildren, _el$23, _el$24);
417
+ runHydrationEvents();
418
+ return _el$17;
370
419
  }
371
420
  /**
372
421
  * A switch allows a user to turn a setting on or off, with support for validation and help text.
@@ -383,13 +432,13 @@ function SwitchButtonImpl(props) {
383
432
  */
384
433
  function SwitchField(props) {
385
434
  const contextProps = useContext(SwitchFieldContext);
386
- const contextSlotProps = contextProps?.slots?.[props.slot ?? "default"];
435
+ const contextSlotProps = contextProps?.slots?.[typeof props.slot === "string" ? props.slot : "default"];
387
436
  const contextBaseProps = createMemo(() => {
388
437
  if (!contextProps) return {};
389
438
  const { slots: _slots, ...rest } = contextProps;
390
439
  return rest;
391
440
  });
392
- const merged = contextProps ? mergeProps$2(contextBaseProps(), contextSlotProps ?? {}, props) : props;
441
+ const merged = contextProps ? mergeProps$1(contextBaseProps(), contextSlotProps ?? {}, props) : props;
393
442
  const [inputElement, setInputElement] = createSignal(null);
394
443
  const [local, ariaProps] = splitProps(merged, [
395
444
  "class",
@@ -477,20 +526,21 @@ function SwitchField(props) {
477
526
  return state;
478
527
  }
479
528
  };
480
- return memo(createMemo(() => {
529
+ const renderedChildren = createMemo(() => {
481
530
  const children = merged.children;
482
531
  return typeof children === "function" ? children(childRenderValues) : children;
483
- }));
532
+ });
533
+ return memo(renderedChildren);
484
534
  };
485
- return createComponent(InternalSwitchContext.Provider, {
535
+ return createComponent(InternalSwitchContext, {
486
536
  value: internalContext,
487
537
  get children() {
488
- return createComponent(FieldErrorContext.Provider, {
538
+ return createComponent(FieldErrorContext, {
489
539
  value: fieldErrorContext,
490
540
  get children() {
491
- var _el$17 = getNextElement(_tmpl$6);
492
- spread(_el$17, mergeProps(domProps, {
493
- get ["class"]() {
541
+ var _el$25 = getNextElement(_tmpl$6);
542
+ spread(_el$25, [domProps, {
543
+ get "class"() {
494
544
  return renderProps.class();
495
545
  },
496
546
  get style() {
@@ -499,30 +549,30 @@ function SwitchField(props) {
499
549
  get slot() {
500
550
  return local.slot;
501
551
  },
502
- get ["data-selected"]() {
503
- return switchAria.isSelected() || void 0;
552
+ get "data-selected"() {
553
+ return dataAttr(switchAria.isSelected());
504
554
  },
505
- get ["data-disabled"]() {
506
- return switchAria.isDisabled || void 0;
555
+ get "data-disabled"() {
556
+ return dataAttr(switchAria.isDisabled);
507
557
  },
508
- get ["data-readonly"]() {
509
- return switchAria.isReadOnly || void 0;
558
+ get "data-readonly"() {
559
+ return dataAttr(switchAria.isReadOnly);
510
560
  },
511
- get ["data-invalid"]() {
512
- return switchAria.isInvalid || void 0;
561
+ get "data-invalid"() {
562
+ return dataAttr(switchAria.isInvalid);
513
563
  },
514
- get ["data-required"]() {
515
- return ariaProps.isRequired || void 0;
564
+ get "data-required"() {
565
+ return dataAttr(ariaProps.isRequired || false);
516
566
  }
517
- }), false, true);
518
- insert(_el$17, createComponent(Provider, {
567
+ }], true);
568
+ insert(_el$25, createComponent(Provider, {
519
569
  values: [[TextContext, textSlots]],
520
570
  get children() {
521
571
  return createComponent(FieldChildren, {});
522
572
  }
523
573
  }));
524
574
  runHydrationEvents();
525
- return _el$17;
575
+ return _el$25;
526
576
  }
527
577
  });
528
578
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","names":["JSX","Context","createContext","createMemo","createSignal","createUniqueId","splitProps","untrack","useContext","Show","createSwitch","createFocusRing","createHover","mergeProps","AriaSwitchProps","SwitchAria","createToggleState","VALID_VALIDITY_STATE","ToggleState","ValidationResult","VisuallyHidden","FieldErrorContext","FieldErrorContextValue","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","Provider","useRenderProps","filterDOMProps","TextContext","ToggleSwitchRenderProps","isSelected","isHovered","isPressed","isFocused","isFocusVisible","isDisabled","isReadOnly","isInvalid","state","ToggleSwitchProps","Omit","children","class","style","description","Element","errorMessage","ToggleSwitchContext","ToggleSwitch","props","inputElement","setInputElement","HTMLInputElement","local","ariaProps","descriptionId","errorMessageId","defaultSelected","onChange","switchAria","describedBy","ids","undefined","filter","Boolean","length","join","focusProps","hoverProps","renderValues","renderProps","defaultClassName","childRenderValues","domProps","filtered","global","Record","id","onClick","cleanLabelProps","ref","_ref1","rest","labelProps","cleanHoverProps","_ref2","cleanInputProps","_ref3","inputProps","cleanFocusProps","_ref4","switchChildren","_el$","_$getNextElement","_tmpl$4","_el$5","firstChild","_el$6","_co$","_$getNextMarker","nextSibling","_el$7","_el$8","_co$2","_el$9","_el$0","_co$3","_el$1","_el$10","_co$4","_$spread","_$mergeProps","data-selected","data-pressed","data-hovered","data-focused","data-focus-visible","data-disabled","data-readonly","_$insert","_$createComponent","_el$2","_tmpl$","_$use","aria-describedby","_$runHydrationEvents","when","_el$3","_tmpl$2","_$setAttribute","_$memo","_el$4","_tmpl$3","SwitchFieldRenderProps","isRequired","SwitchButtonRenderProps","SwitchFieldProps","SwitchButtonProps","onHoverStart","onHoverEnd","onHoverChange","SwitchFieldContextValue","slots","SwitchFieldContext","InternalSwitchContextValue","el","InternalSwitchContext","SwitchButton","getCtx","fallback","keyed","ctx","SwitchButtonImpl","buttonProps","_el$11","_tmpl$5","_el$13","_el$14","_co$5","_el$15","_el$16","_co$6","slot","data-invalid","data-required","_el$12","_ref$","SwitchField","contextProps","contextSlotProps","contextBaseProps","_slots","merged","internalContext","textSlots","descriptionProps","errorMessageProps","fieldErrorContext","validation","validationDetails","validationErrors","HTMLAttributes","HTMLElement","FieldChildren","renderedChildren","value","_el$17","_tmpl$6","values","Array"],"sources":["../src/Switch.tsx"],"sourcesContent":["/**\n * ToggleSwitch component for solidaria-components\n *\n * A pre-wired headless switch that combines state + aria hooks.\n * Port of react-aria-components/src/Switch.tsx\n *\n * Named \"ToggleSwitch\" to avoid conflict with SolidJS's built-in Switch component.\n */\n\nimport {\n type JSX,\n type Context,\n createContext,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n untrack,\n useContext,\n Show,\n} from \"solid-js\";\nimport {\n createSwitch,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaSwitchProps,\n type SwitchAria,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createToggleState,\n VALID_VALIDITY_STATE,\n type ToggleState,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n Provider,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\n\nexport interface ToggleSwitchRenderProps {\n /** Whether the switch is selected. */\n isSelected: boolean;\n /** Whether the switch is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the switch is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the switch is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the switch is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the switch is disabled. */\n isDisabled: boolean;\n /** Whether the switch is read only. */\n isReadOnly: boolean;\n /** Whether the switch is invalid. */\n isInvalid: boolean;\n /** State of the switch. */\n state: ToggleState;\n}\n\nexport interface ToggleSwitchProps extends Omit<AriaSwitchProps, \"children\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<ToggleSwitchRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToggleSwitchRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToggleSwitchRenderProps>;\n /** A description for the switch. */\n description?: JSX.Element;\n /** An error message for the switch. */\n errorMessage?: JSX.Element;\n}\n\nexport const ToggleSwitchContext = createContext<ToggleSwitchProps | null>(null);\n\n/**\n * A switch allows a user to turn a setting on or off.\n *\n * This is a headless component that provides accessibility and state management.\n * Style it using the render props pattern or data attributes.\n *\n * Named \"ToggleSwitch\" to avoid conflict with SolidJS's built-in Switch component.\n *\n * @example\n * ```tsx\n * <ToggleSwitch>\n * {({ isSelected }) => (\n * <>\n * <span class={`switch-track ${isSelected ? 'bg-blue-500' : 'bg-gray-300'}`}>\n * <span class={`switch-thumb ${isSelected ? 'translate-x-5' : 'translate-x-0'}`} />\n * </span>\n * <span>Enable notifications</span>\n * </>\n * )}\n * </ToggleSwitch>\n * ```\n */\nexport function ToggleSwitch(props: ToggleSwitchProps): JSX.Element {\n const [inputElement, setInputElement] = createSignal<HTMLInputElement | null>(null);\n\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"description\",\n \"errorMessage\",\n ]);\n const descriptionId = createUniqueId();\n const errorMessageId = createUniqueId();\n\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createToggleState(() => ({\n isSelected: ariaProps.isSelected,\n defaultSelected: ariaProps.defaultSelected,\n onChange: ariaProps.onChange,\n isReadOnly: ariaProps.isReadOnly,\n }));\n\n const switchAria = createSwitch(\n () => ({\n ...ariaProps,\n children: typeof props.children === \"function\" ? true : props.children,\n }),\n state,\n inputElement,\n );\n const describedBy = () => {\n const ids = [\n ariaProps[\"aria-describedby\"],\n local.description ? descriptionId : undefined,\n switchAria.isInvalid && local.errorMessage ? errorMessageId : undefined,\n ].filter(Boolean);\n return ids.length ? ids.join(\" \") : undefined;\n };\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return ariaProps.isDisabled || ariaProps.isReadOnly;\n },\n });\n\n const renderValues = createMemo<ToggleSwitchRenderProps>(() => ({\n isSelected: switchAria.isSelected(),\n isHovered: isHovered(),\n isPressed: switchAria.isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: switchAria.isDisabled,\n isReadOnly: switchAria.isReadOnly,\n isInvalid: switchAria.isInvalid,\n state,\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-ToggleSwitch\",\n },\n renderValues,\n );\n const childRenderValues: ToggleSwitchRenderProps = {\n get isSelected() {\n return switchAria.isSelected();\n },\n get isHovered() {\n return isHovered();\n },\n get isPressed() {\n return switchAria.isPressed();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return switchAria.isDisabled;\n },\n get isReadOnly() {\n return switchAria.isReadOnly;\n },\n get isInvalid() {\n return switchAria.isInvalid;\n },\n get state() {\n return state;\n },\n };\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n delete (filtered as Record<string, unknown>).id;\n delete (filtered as Record<string, unknown>).onClick;\n return filtered;\n });\n\n const cleanLabelProps = () => {\n const { ref: _ref1, ...rest } = switchAria.labelProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanInputProps = () => {\n const { ref: _ref3, ...rest } = switchAria.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref4, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n // Resolve the render-prop children ONCE (untracked) — see TextField. Re-invoking\n // it on a reactive update re-clones its templates and, mid-hydration, throws a\n // Hydration Mismatch. The children keep fine-grained reactivity via the\n // childRenderValues getters + <Show>s.\n const switchChildren = untrack(() => {\n const children = props.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n });\n\n return (\n <label\n {...domProps()}\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={switchAria.isSelected() || undefined}\n data-pressed={switchAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={switchAria.isDisabled || undefined}\n data-readonly={switchAria.isReadOnly || undefined}\n >\n <VisuallyHidden>\n <input\n ref={setInputElement}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n aria-describedby={describedBy()}\n />\n </VisuallyHidden>\n {switchChildren}\n <Show when={local.description}>\n <span id={descriptionId} slot=\"description\">\n {local.description}\n </span>\n </Show>\n <Show when={switchAria.isInvalid && local.errorMessage}>\n <span id={errorMessageId} slot=\"errorMessage\">\n {local.errorMessage}\n </span>\n </Show>\n </label>\n );\n}\n\n// ============================================================================\n// SwitchField + SwitchButton — the RAC form-field split (RAC 1.19)\n// ----------------------------------------------------------------------------\n// Upstream split the monolithic Switch into a SwitchField wrapper (owns state,\n// validation, and help text) containing a SwitchButton control (the clickable\n// label + indicator). Mirrors react-aria-components/src/Switch.tsx. The legacy\n// `ToggleSwitch` above stays as the deprecated monolith for back-compat.\n//\n// Help text wiring mirrors upstream exactly: SwitchField has NO description /\n// errorMessage props. createSwitch mints descriptionProps / errorMessageProps\n// (slot ids) and bakes the combined aria-describedby into inputProps, and the\n// field provides those ids through TextContext slots. Consumers render the help\n// text themselves with `<Text slot=\"description\">` / `<FieldError>`.\n// ============================================================================\n\nexport interface SwitchFieldRenderProps {\n /** Whether the switch is selected. */\n isSelected: boolean;\n /** Whether the switch is disabled. */\n isDisabled: boolean;\n /** Whether the switch is read only. */\n isReadOnly: boolean;\n /** Whether the switch is invalid. */\n isInvalid: boolean;\n /** Whether the switch is required. */\n isRequired: boolean;\n /** State of the switch. */\n state: ToggleState;\n}\n\nexport interface SwitchButtonRenderProps extends ToggleSwitchRenderProps {\n /** Whether the switch is required. */\n isRequired: boolean;\n}\n\nexport interface SwitchFieldProps extends Omit<AriaSwitchProps, \"children\">, SlotProps {\n /** The children of the component (typically a `SwitchButton`). A function may receive render props. */\n children?: RenderChildren<SwitchFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SwitchFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SwitchFieldRenderProps>;\n}\n\nexport interface SwitchButtonProps extends SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<SwitchButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SwitchButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SwitchButtonRenderProps>;\n /** Handler called when hover starts. */\n onHoverStart?: () => void;\n /** Handler called when hover ends. */\n onHoverEnd?: () => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n}\n\nexport interface SwitchFieldContextValue extends SwitchFieldProps {\n slots?: Record<string, SwitchFieldProps>;\n}\nexport const SwitchFieldContext = createContext<SwitchFieldContextValue | null>(null);\n\n/** Carries the switch aria + state from a SwitchField/Switch wrapper to its SwitchButton. */\ninterface InternalSwitchContextValue {\n switchAria: SwitchAria;\n state: ToggleState;\n setInputElement: (el: HTMLInputElement | null) => void;\n defaultClassName: string;\n isRequired: boolean;\n}\nconst InternalSwitchContext = createContext<InternalSwitchContextValue | null>(null);\n\n/**\n * A switch button is the clickable area of a switch, including the indicator and label.\n * Must be rendered inside a `SwitchField` (or the legacy `ToggleSwitch`).\n */\nexport function SwitchButton(props: SwitchButtonProps): JSX.Element {\n // Accessed reactively so it resolves once the parent provider mounts (HMR-safe).\n const getCtx = createMemo(() => useContext(InternalSwitchContext));\n return (\n <Show when={getCtx()} fallback={null} keyed>\n {(ctx) => <SwitchButtonImpl buttonProps={props} ctx={ctx} />}\n </Show>\n );\n}\n\nfunction SwitchButtonImpl(props: {\n buttonProps: SwitchButtonProps;\n ctx: InternalSwitchContextValue;\n}): JSX.Element {\n const { ctx } = props;\n const switchAria = ctx.switchAria;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return switchAria.isDisabled || switchAria.isReadOnly;\n },\n onHoverStart: props.buttonProps.onHoverStart,\n onHoverEnd: props.buttonProps.onHoverEnd,\n onHoverChange: props.buttonProps.onHoverChange,\n });\n\n const renderValues = createMemo<SwitchButtonRenderProps>(() => ({\n isSelected: switchAria.isSelected(),\n isHovered: isHovered(),\n isPressed: switchAria.isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: switchAria.isDisabled,\n isReadOnly: switchAria.isReadOnly,\n isInvalid: switchAria.isInvalid,\n isRequired: ctx.isRequired,\n state: ctx.state,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.buttonProps.children,\n class: props.buttonProps.class,\n style: props.buttonProps.style,\n defaultClassName: ctx.defaultClassName,\n },\n renderValues,\n );\n\n const childRenderValues: SwitchButtonRenderProps = {\n get isSelected() {\n return switchAria.isSelected();\n },\n get isHovered() {\n return isHovered();\n },\n get isPressed() {\n return switchAria.isPressed();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return switchAria.isDisabled;\n },\n get isReadOnly() {\n return switchAria.isReadOnly;\n },\n get isInvalid() {\n return switchAria.isInvalid;\n },\n get isRequired() {\n return ctx.isRequired;\n },\n get state() {\n return ctx.state;\n },\n };\n\n const cleanLabelProps = () => {\n const { ref: _ref1, ...rest } = switchAria.labelProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanInputProps = () => {\n const { ref: _ref3, ...rest } = switchAria.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref4, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n\n // Resolve the render-prop children ONCE (untracked) — see ToggleSwitch above.\n // The button's own children are leaf visuals (they don't consume context), so\n // untrack is safe and keeps fine-grained reactivity via the getters + <Show>s.\n const switchChildren = untrack(() => {\n const children = props.buttonProps.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n });\n\n return (\n <label\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={props.buttonProps.slot}\n data-selected={switchAria.isSelected() || undefined}\n data-pressed={switchAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-disabled={switchAria.isDisabled || undefined}\n data-readonly={switchAria.isReadOnly || undefined}\n data-invalid={switchAria.isInvalid || undefined}\n data-required={ctx.isRequired || undefined}\n >\n <VisuallyHidden>\n <input ref={ctx.setInputElement} {...cleanInputProps()} {...cleanFocusProps()} />\n </VisuallyHidden>\n {switchChildren}\n </label>\n );\n}\n\n/**\n * A switch allows a user to turn a setting on or off, with support for validation and help text.\n * Wraps a `SwitchButton` and provides description/error wiring through\n * TextContext slots — render help text with `<Text slot=\"description\">`.\n *\n * @example\n * ```tsx\n * <SwitchField>\n * <SwitchButton>Enable sync</SwitchButton>\n * <Text slot=\"description\">Sync across devices</Text>\n * </SwitchField>\n * ```\n */\nexport function SwitchField(props: SwitchFieldProps): JSX.Element {\n const contextProps = useContext(SwitchFieldContext);\n const contextSlotProps = contextProps?.slots?.[props.slot ?? \"default\"];\n const contextBaseProps = createMemo<SwitchFieldProps>(() => {\n if (!contextProps) return {};\n const { slots: _slots, ...rest } = contextProps;\n return rest;\n });\n const merged = contextProps\n ? (mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) as SwitchFieldProps)\n : props;\n\n const [inputElement, setInputElement] = createSignal<HTMLInputElement | null>(null);\n // `children` is split out of ariaProps so the hook accessor's `...ariaProps`\n // spread does not eagerly read it — reading a Solid `children` getter\n // instantiates the nested SwitchButton, and doing so OUTSIDE the\n // InternalSwitchContext provider both breaks its context binding and recurses.\n const [local, ariaProps] = splitProps(merged, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const state = createToggleState(() => ({\n isSelected: ariaProps.isSelected,\n defaultSelected: ariaProps.defaultSelected,\n onChange: ariaProps.onChange,\n isReadOnly: ariaProps.isReadOnly,\n }));\n\n const switchAria = createSwitch(\n () => ({\n ...ariaProps,\n // The hook reads `children` only to decide if an aria-label is needed; the\n // visible label lives in the SwitchButton, so report presence as a literal.\n children: true,\n }),\n state,\n inputElement,\n );\n\n const internalContext: InternalSwitchContextValue = {\n switchAria,\n state,\n setInputElement,\n defaultClassName: \"solidaria-SwitchButton\",\n get isRequired() {\n return ariaProps.isRequired || false;\n },\n };\n\n // The hook mints the description/error slot ids and bakes the combined\n // aria-describedby into the input; the field exposes those ids through\n // TextContext so a `<Text slot=\"description\">` / `<FieldError>` child resolves\n // them. Mirrors react-aria-components' Switch Provider value list.\n const textSlots = {\n slots: {\n get description() {\n return switchAria.descriptionProps;\n },\n get errorMessage() {\n return switchAria.errorMessageProps;\n },\n },\n };\n\n const renderValues = createMemo<SwitchFieldRenderProps>(() => ({\n isSelected: switchAria.isSelected(),\n isDisabled: switchAria.isDisabled,\n isReadOnly: switchAria.isReadOnly,\n isInvalid: switchAria.isInvalid,\n isRequired: ariaProps.isRequired || false,\n state,\n }));\n\n const renderProps = useRenderProps(\n {\n children: merged.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SwitchField\",\n },\n renderValues,\n );\n\n const fieldErrorContext: FieldErrorContextValue = {\n get validation(): ValidationResult {\n return {\n isInvalid: switchAria.isInvalid,\n validationDetails: VALID_VALIDITY_STATE,\n validationErrors: [],\n };\n },\n get errorMessageProps() {\n return switchAria.errorMessageProps as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n delete (filtered as Record<string, unknown>).id;\n delete (filtered as Record<string, unknown>).onClick;\n return filtered;\n });\n\n // Children are accessed inside the providers (component-execution owner) so a\n // nested SwitchButton's useContext binds to InternalSwitchContext. Mirrors\n // RadioGroup's GroupChildren — do NOT pre-resolve outside the provider.\n const FieldChildren = () => {\n const childRenderValues: SwitchFieldRenderProps = {\n get isSelected() {\n return switchAria.isSelected();\n },\n get isDisabled() {\n return switchAria.isDisabled;\n },\n get isReadOnly() {\n return switchAria.isReadOnly;\n },\n get isInvalid() {\n return switchAria.isInvalid;\n },\n get isRequired() {\n return ariaProps.isRequired || false;\n },\n get state() {\n return state;\n },\n };\n const renderedChildren = createMemo(() => {\n const children = merged.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n });\n return <>{renderedChildren()}</>;\n };\n\n return (\n <InternalSwitchContext.Provider value={internalContext}>\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-selected={switchAria.isSelected() || undefined}\n data-disabled={switchAria.isDisabled || undefined}\n data-readonly={switchAria.isReadOnly || undefined}\n data-invalid={switchAria.isInvalid || undefined}\n data-required={ariaProps.isRequired || false || undefined}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n <FieldChildren />\n </Provider>\n </div>\n </FieldErrorContext.Provider>\n </InternalSwitchContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkFA,MAAaiD,sBAAsB/C,cAAwC,IAAI;;;;;;;;;;;;;;;;;;;;;;;AAwB/E,SAAgBgD,aAAaC,OAAuC;CAClE,MAAM,CAACC,cAAcC,mBAAm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A,CAAA;AAM1B"}
1
+ {"version":3,"file":"Switch.js","names":["<VisuallyHidden>\n <input\n ref={setInputElement}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n aria-describedby={describedBy()}\n />\n </VisuallyHidden>","ref={setInputElement}","<input\n ref={setInputElement}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n aria-describedby={describedBy()}\n />","<label\n {...domProps()}\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(switchAria.isSelected())}\n data-pressed={dataAttr(switchAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n data-disabled={dataAttr(switchAria.isDisabled)}\n data-readonly={dataAttr(switchAria.isReadOnly)}\n >\n <VisuallyHidden>\n <input\n ref={setInputElement}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n aria-describedby={describedBy()}\n />\n </VisuallyHidden>\n {switchChildren}\n <Show when={local.description}>\n <span id={descriptionId} slot=\"description\">\n {local.description}\n </span>\n </Show>\n <Show when={switchAria.isInvalid && local.errorMessage}>\n <span id={errorMessageId} slot=\"errorMessage\">\n {local.errorMessage}\n </span>\n </Show>\n </label>","<Show when={local.description}>\n <span id={descriptionId} slot=\"description\">\n {local.description}\n </span>\n </Show>","<span id={descriptionId} slot=\"description\">\n {local.description}\n </span>","<Show when={switchAria.isInvalid && local.errorMessage}>\n <span id={errorMessageId} slot=\"errorMessage\">\n {local.errorMessage}\n </span>\n </Show>","switchAria.isInvalid && local.errorMessage","<span id={errorMessageId} slot=\"errorMessage\">\n {local.errorMessage}\n </span>","<Show when={getCtx()} fallback={null} keyed>\n {(ctx) => <SwitchButtonImpl buttonProps={props} ctx={ctx} />}\n </Show>","fallback={null}","<SwitchButtonImpl buttonProps={props} ctx={ctx} />","buttonProps={props}","<VisuallyHidden>\n <input ref={ctx.setInputElement} {...cleanInputProps()} {...cleanFocusProps()} />\n </VisuallyHidden>","ref={ctx.setInputElement}","<input ref={ctx.setInputElement} {...cleanInputProps()} {...cleanFocusProps()} />","<label\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={props.buttonProps.slot}\n data-selected={dataAttr(switchAria.isSelected())}\n data-pressed={dataAttr(switchAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n data-disabled={dataAttr(switchAria.isDisabled)}\n data-readonly={dataAttr(switchAria.isReadOnly)}\n data-invalid={dataAttr(switchAria.isInvalid)}\n data-required={dataAttr(ctx.isRequired)}\n >\n <VisuallyHidden>\n <input ref={ctx.setInputElement} {...cleanInputProps()} {...cleanFocusProps()} />\n </VisuallyHidden>\n {switchChildren}\n </label>","{renderedChildren()}","<InternalSwitchContext value={internalContext}>\n <FieldErrorContext value={fieldErrorContext}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-selected={dataAttr(switchAria.isSelected())}\n data-disabled={dataAttr(switchAria.isDisabled)}\n data-readonly={dataAttr(switchAria.isReadOnly)}\n data-invalid={dataAttr(switchAria.isInvalid)}\n data-required={dataAttr(ariaProps.isRequired || false)}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n <FieldChildren />\n </Provider>\n </div>\n </FieldErrorContext>\n </InternalSwitchContext>","value={internalContext}","<FieldErrorContext value={fieldErrorContext}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-selected={dataAttr(switchAria.isSelected())}\n data-disabled={dataAttr(switchAria.isDisabled)}\n data-readonly={dataAttr(switchAria.isReadOnly)}\n data-invalid={dataAttr(switchAria.isInvalid)}\n data-required={dataAttr(ariaProps.isRequired || false)}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n <FieldChildren />\n </Provider>\n </div>\n </FieldErrorContext>","value={fieldErrorContext}","<Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n <FieldChildren />\n </Provider>","values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}","<FieldChildren />","<div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-selected={dataAttr(switchAria.isSelected())}\n data-disabled={dataAttr(switchAria.isDisabled)}\n data-readonly={dataAttr(switchAria.isReadOnly)}\n data-invalid={dataAttr(switchAria.isInvalid)}\n data-required={dataAttr(ariaProps.isRequired || false)}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n <FieldChildren />\n </Provider>\n </div>"],"sources":["../src/Switch.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/Switch.tsx\n\n/**\n * ToggleSwitch component for solidaria-components\n *\n * A pre-wired headless switch that combines state + aria hooks.\n * Port of react-aria-components/src/Switch.tsx\n *\n * Named \"ToggleSwitch\" to avoid conflict with SolidJS's built-in Switch component.\n */\n\nimport {\n createContext,\n createMemo,\n createSignal,\n createUniqueId,\n untrack,\n useContext,\n Show,\n} from \"solid-js\";\nimport type { Context } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createSwitch,\n createFocusRing,\n createHover,\n mergeProps,\n type AriaSwitchProps,\n type SwitchAria,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createToggleState,\n VALID_VALIDITY_STATE,\n type ToggleState,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n Provider,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport interface ToggleSwitchRenderProps {\n /** Whether the switch is selected. */\n isSelected: boolean;\n /** Whether the switch is currently hovered with a mouse. */\n isHovered: boolean;\n /** Whether the switch is currently in a pressed state. */\n isPressed: boolean;\n /** Whether the switch is focused, either via a mouse or keyboard. */\n isFocused: boolean;\n /** Whether the switch is keyboard focused. */\n isFocusVisible: boolean;\n /** Whether the switch is disabled. */\n isDisabled: boolean;\n /** Whether the switch is read only. */\n isReadOnly: boolean;\n /** Whether the switch is invalid. */\n isInvalid: boolean;\n /** State of the switch. */\n state: ToggleState;\n}\n\nexport interface ToggleSwitchProps extends Omit<AriaSwitchProps, \"children\">, SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<ToggleSwitchRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToggleSwitchRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToggleSwitchRenderProps>;\n /** A description for the switch. */\n description?: JSX.Element;\n /** An error message for the switch. */\n errorMessage?: JSX.Element;\n}\n\nexport const ToggleSwitchContext = createContext<ToggleSwitchProps | null>(null);\n\n/**\n * A switch allows a user to turn a setting on or off.\n *\n * This is a headless component that provides accessibility and state management.\n * Style it using the render props pattern or data attributes.\n *\n * Named \"ToggleSwitch\" to avoid conflict with SolidJS's built-in Switch component.\n *\n * @example\n * ```tsx\n * <ToggleSwitch>\n * {({ isSelected }) => (\n * <>\n * <span class={`switch-track ${isSelected ? 'bg-blue-500' : 'bg-gray-300'}`}>\n * <span class={`switch-thumb ${isSelected ? 'translate-x-5' : 'translate-x-0'}`} />\n * </span>\n * <span>Enable notifications</span>\n * </>\n * )}\n * </ToggleSwitch>\n * ```\n */\nexport function ToggleSwitch(props: ToggleSwitchProps): JSX.Element {\n const [inputElement, setInputElement] = createSignal<HTMLInputElement | null>(null);\n\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"description\",\n \"errorMessage\",\n ]);\n const descriptionId = createUniqueId();\n const errorMessageId = createUniqueId();\n\n // Use getters to ensure props are read lazily inside reactive contexts\n const state = createToggleState(() => ({\n isSelected: ariaProps.isSelected,\n defaultSelected: ariaProps.defaultSelected,\n onChange: ariaProps.onChange,\n isReadOnly: ariaProps.isReadOnly,\n }));\n\n const switchAria = createSwitch(\n () => ({\n ...ariaProps,\n children: typeof props.children === \"function\" ? true : props.children,\n }),\n state,\n inputElement,\n );\n const describedBy = () => {\n const ids = [\n ariaProps[\"aria-describedby\"],\n local.description ? descriptionId : undefined,\n switchAria.isInvalid && local.errorMessage ? errorMessageId : undefined,\n ].filter(Boolean);\n return ids.length ? ids.join(\" \") : undefined;\n };\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return ariaProps.isDisabled || ariaProps.isReadOnly;\n },\n });\n\n const renderValues = createMemo<ToggleSwitchRenderProps>(() => ({\n isSelected: switchAria.isSelected(),\n isHovered: isHovered(),\n isPressed: switchAria.isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: switchAria.isDisabled,\n isReadOnly: switchAria.isReadOnly,\n isInvalid: switchAria.isInvalid,\n state,\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-ToggleSwitch\",\n },\n renderValues,\n );\n const childRenderValues: ToggleSwitchRenderProps = {\n get isSelected() {\n return switchAria.isSelected();\n },\n get isHovered() {\n return isHovered();\n },\n get isPressed() {\n return switchAria.isPressed();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return switchAria.isDisabled;\n },\n get isReadOnly() {\n return switchAria.isReadOnly;\n },\n get isInvalid() {\n return switchAria.isInvalid;\n },\n get state() {\n return state;\n },\n };\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n delete (filtered as Record<string, unknown>).id;\n delete (filtered as Record<string, unknown>).onClick;\n return filtered;\n });\n\n const cleanLabelProps = () => {\n const { ref: _ref1, ...rest } = switchAria.labelProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanInputProps = () => {\n const { ref: _ref3, ...rest } = switchAria.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref4, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n // Resolve the render-prop children ONCE (untracked) — see TextField. Re-invoking\n // it on a reactive update re-clones its templates and, mid-hydration, throws a\n // Hydration Mismatch. The children keep fine-grained reactivity via the\n // childRenderValues getters + <Show>s.\n const switchChildren = untrack(() => {\n const children = props.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n });\n\n return (\n <label\n {...domProps()}\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={dataAttr(switchAria.isSelected())}\n data-pressed={dataAttr(switchAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n data-disabled={dataAttr(switchAria.isDisabled)}\n data-readonly={dataAttr(switchAria.isReadOnly)}\n >\n <VisuallyHidden>\n <input\n ref={setInputElement}\n {...cleanInputProps()}\n {...cleanFocusProps()}\n aria-describedby={describedBy()}\n />\n </VisuallyHidden>\n {switchChildren}\n <Show when={local.description}>\n <span id={descriptionId} slot=\"description\">\n {local.description}\n </span>\n </Show>\n <Show when={switchAria.isInvalid && local.errorMessage}>\n <span id={errorMessageId} slot=\"errorMessage\">\n {local.errorMessage}\n </span>\n </Show>\n </label>\n );\n}\n\n// ============================================================================\n// SwitchField + SwitchButton — the RAC form-field split (RAC 1.19)\n// ----------------------------------------------------------------------------\n// Upstream split the monolithic Switch into a SwitchField wrapper (owns state,\n// validation, and help text) containing a SwitchButton control (the clickable\n// label + indicator). Mirrors react-aria-components/src/Switch.tsx. The legacy\n// `ToggleSwitch` above stays as the deprecated monolith for back-compat.\n//\n// Help text wiring mirrors upstream exactly: SwitchField has NO description /\n// errorMessage props. createSwitch mints descriptionProps / errorMessageProps\n// (slot ids) and bakes the combined aria-describedby into inputProps, and the\n// field provides those ids through TextContext slots. Consumers render the help\n// text themselves with `<Text slot=\"description\">` / `<FieldError>`.\n// ============================================================================\n\nexport interface SwitchFieldRenderProps {\n /** Whether the switch is selected. */\n isSelected: boolean;\n /** Whether the switch is disabled. */\n isDisabled: boolean;\n /** Whether the switch is read only. */\n isReadOnly: boolean;\n /** Whether the switch is invalid. */\n isInvalid: boolean;\n /** Whether the switch is required. */\n isRequired: boolean;\n /** State of the switch. */\n state: ToggleState;\n}\n\nexport interface SwitchButtonRenderProps extends ToggleSwitchRenderProps {\n /** Whether the switch is required. */\n isRequired: boolean;\n}\n\nexport interface SwitchFieldProps extends Omit<AriaSwitchProps, \"children\">, SlotProps {\n /** The children of the component (typically a `SwitchButton`). A function may receive render props. */\n children?: RenderChildren<SwitchFieldRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SwitchFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SwitchFieldRenderProps>;\n}\n\nexport interface SwitchButtonProps extends SlotProps {\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<SwitchButtonRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SwitchButtonRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SwitchButtonRenderProps>;\n /** Handler called when hover starts. */\n onHoverStart?: () => void;\n /** Handler called when hover ends. */\n onHoverEnd?: () => void;\n /** Handler called when hover state changes. */\n onHoverChange?: (isHovered: boolean) => void;\n}\n\nexport interface SwitchFieldContextValue extends SwitchFieldProps {\n slots?: Record<string, SwitchFieldProps>;\n}\nexport const SwitchFieldContext = createContext<SwitchFieldContextValue | null>(null);\n\n/** Carries the switch aria + state from a SwitchField/Switch wrapper to its SwitchButton. */\ninterface InternalSwitchContextValue {\n switchAria: SwitchAria;\n state: ToggleState;\n setInputElement: (el: HTMLInputElement | null) => void;\n defaultClassName: string;\n isRequired: boolean;\n}\nconst InternalSwitchContext = createContext<InternalSwitchContextValue | null>(null);\n\n/**\n * A switch button is the clickable area of a switch, including the indicator and label.\n * Must be rendered inside a `SwitchField` (or the legacy `ToggleSwitch`).\n */\nexport function SwitchButton(props: SwitchButtonProps): JSX.Element {\n // Accessed reactively so it resolves once the parent provider mounts (HMR-safe).\n const getCtx = createMemo(() => useContext(InternalSwitchContext));\n return (\n <Show when={getCtx()} fallback={null} keyed>\n {(ctx) => <SwitchButtonImpl buttonProps={props} ctx={ctx} />}\n </Show>\n );\n}\n\nfunction SwitchButtonImpl(props: {\n buttonProps: SwitchButtonProps;\n ctx: InternalSwitchContextValue;\n}): JSX.Element {\n const { ctx } = props;\n const switchAria = ctx.switchAria;\n\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return switchAria.isDisabled || switchAria.isReadOnly;\n },\n onHoverStart: props.buttonProps.onHoverStart,\n onHoverEnd: props.buttonProps.onHoverEnd,\n onHoverChange: props.buttonProps.onHoverChange,\n });\n\n const renderValues = createMemo<SwitchButtonRenderProps>(() => ({\n isSelected: switchAria.isSelected(),\n isHovered: isHovered(),\n isPressed: switchAria.isPressed(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: switchAria.isDisabled,\n isReadOnly: switchAria.isReadOnly,\n isInvalid: switchAria.isInvalid,\n isRequired: ctx.isRequired,\n state: ctx.state,\n }));\n\n const renderProps = useRenderProps(\n {\n children: props.buttonProps.children,\n class: props.buttonProps.class,\n style: props.buttonProps.style,\n defaultClassName: ctx.defaultClassName,\n },\n renderValues,\n );\n\n const childRenderValues: SwitchButtonRenderProps = {\n get isSelected() {\n return switchAria.isSelected();\n },\n get isHovered() {\n return isHovered();\n },\n get isPressed() {\n return switchAria.isPressed();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return switchAria.isDisabled;\n },\n get isReadOnly() {\n return switchAria.isReadOnly;\n },\n get isInvalid() {\n return switchAria.isInvalid;\n },\n get isRequired() {\n return ctx.isRequired;\n },\n get state() {\n return ctx.state;\n },\n };\n\n const cleanLabelProps = () => {\n const { ref: _ref1, ...rest } = switchAria.labelProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanInputProps = () => {\n const { ref: _ref3, ...rest } = switchAria.inputProps as Record<string, unknown>;\n return rest;\n };\n const cleanFocusProps = () => {\n const { ref: _ref4, ...rest } = focusProps as Record<string, unknown>;\n return rest;\n };\n\n // Resolve the render-prop children ONCE (untracked) — see ToggleSwitch above.\n // The button's own children are leaf visuals (they don't consume context), so\n // untrack is safe and keeps fine-grained reactivity via the getters + <Show>s.\n const switchChildren = untrack(() => {\n const children = props.buttonProps.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n });\n\n return (\n <label\n {...cleanLabelProps()}\n {...cleanHoverProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={props.buttonProps.slot}\n data-selected={dataAttr(switchAria.isSelected())}\n data-pressed={dataAttr(switchAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n data-disabled={dataAttr(switchAria.isDisabled)}\n data-readonly={dataAttr(switchAria.isReadOnly)}\n data-invalid={dataAttr(switchAria.isInvalid)}\n data-required={dataAttr(ctx.isRequired)}\n >\n <VisuallyHidden>\n <input ref={ctx.setInputElement} {...cleanInputProps()} {...cleanFocusProps()} />\n </VisuallyHidden>\n {switchChildren}\n </label>\n );\n}\n\n/**\n * A switch allows a user to turn a setting on or off, with support for validation and help text.\n * Wraps a `SwitchButton` and provides description/error wiring through\n * TextContext slots — render help text with `<Text slot=\"description\">`.\n *\n * @example\n * ```tsx\n * <SwitchField>\n * <SwitchButton>Enable sync</SwitchButton>\n * <Text slot=\"description\">Sync across devices</Text>\n * </SwitchField>\n * ```\n */\nexport function SwitchField(props: SwitchFieldProps): JSX.Element {\n const contextProps = useContext(SwitchFieldContext);\n const contextSlotProps =\n contextProps?.slots?.[typeof props.slot === \"string\" ? props.slot : \"default\"];\n const contextBaseProps = createMemo<SwitchFieldProps>(() => {\n if (!contextProps) return {};\n const { slots: _slots, ...rest } = contextProps;\n return rest;\n });\n const merged = contextProps\n ? (mergeProps(contextBaseProps(), contextSlotProps ?? {}, props) as SwitchFieldProps)\n : props;\n\n const [inputElement, setInputElement] = createSignal<HTMLInputElement | null>(null);\n // `children` is split out of ariaProps so the hook accessor's `...ariaProps`\n // spread does not eagerly read it — reading a Solid `children` getter\n // instantiates the nested SwitchButton, and doing so OUTSIDE the\n // InternalSwitchContext provider both breaks its context binding and recurses.\n const [local, ariaProps] = splitProps(merged, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const state = createToggleState(() => ({\n isSelected: ariaProps.isSelected,\n defaultSelected: ariaProps.defaultSelected,\n onChange: ariaProps.onChange,\n isReadOnly: ariaProps.isReadOnly,\n }));\n\n const switchAria = createSwitch(\n () => ({\n ...ariaProps,\n // The hook reads `children` only to decide if an aria-label is needed; the\n // visible label lives in the SwitchButton, so report presence as a literal.\n children: true,\n }),\n state,\n inputElement,\n );\n\n const internalContext: InternalSwitchContextValue = {\n switchAria,\n state,\n setInputElement,\n defaultClassName: \"solidaria-SwitchButton\",\n get isRequired() {\n return ariaProps.isRequired || false;\n },\n };\n\n // The hook mints the description/error slot ids and bakes the combined\n // aria-describedby into the input; the field exposes those ids through\n // TextContext so a `<Text slot=\"description\">` / `<FieldError>` child resolves\n // them. Mirrors react-aria-components' Switch Provider value list.\n const textSlots = {\n slots: {\n get description() {\n return switchAria.descriptionProps;\n },\n get errorMessage() {\n return switchAria.errorMessageProps;\n },\n },\n };\n\n const renderValues = createMemo<SwitchFieldRenderProps>(() => ({\n isSelected: switchAria.isSelected(),\n isDisabled: switchAria.isDisabled,\n isReadOnly: switchAria.isReadOnly,\n isInvalid: switchAria.isInvalid,\n isRequired: ariaProps.isRequired || false,\n state,\n }));\n\n const renderProps = useRenderProps(\n {\n children: merged.children,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-SwitchField\",\n },\n renderValues,\n );\n\n const fieldErrorContext: FieldErrorContextValue = {\n get validation(): ValidationResult {\n return {\n isInvalid: switchAria.isInvalid,\n validationDetails: VALID_VALIDITY_STATE,\n validationErrors: [],\n };\n },\n get errorMessageProps() {\n return switchAria.errorMessageProps as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps, { global: true });\n delete (filtered as Record<string, unknown>).id;\n delete (filtered as Record<string, unknown>).onClick;\n return filtered;\n });\n\n // Children are accessed inside the providers (component-execution owner) so a\n // nested SwitchButton's useContext binds to InternalSwitchContext. Mirrors\n // RadioGroup's GroupChildren — do NOT pre-resolve outside the provider.\n const FieldChildren = () => {\n const childRenderValues: SwitchFieldRenderProps = {\n get isSelected() {\n return switchAria.isSelected();\n },\n get isDisabled() {\n return switchAria.isDisabled;\n },\n get isReadOnly() {\n return switchAria.isReadOnly;\n },\n get isInvalid() {\n return switchAria.isInvalid;\n },\n get isRequired() {\n return ariaProps.isRequired || false;\n },\n get state() {\n return state;\n },\n };\n const renderedChildren = createMemo(() => {\n const children = merged.children;\n return typeof children === \"function\" ? children(childRenderValues) : children;\n });\n return <>{renderedChildren()}</>;\n };\n\n return (\n <InternalSwitchContext value={internalContext}>\n <FieldErrorContext value={fieldErrorContext}>\n <div\n {...domProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-selected={dataAttr(switchAria.isSelected())}\n data-disabled={dataAttr(switchAria.isDisabled)}\n data-readonly={dataAttr(switchAria.isReadOnly)}\n data-invalid={dataAttr(switchAria.isInvalid)}\n data-required={dataAttr(ariaProps.isRequired || false)}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n <FieldChildren />\n </Provider>\n </div>\n </FieldErrorContext>\n </InternalSwitchContext>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiGA,MAAa,sBAAsB,cAAwC,IAAI;;;;;;;;;;;;;;;;;;;;;;;AAwB/E,SAAgB,aAAa,OAAuC;CAClE,MAAM,CAAC,cAAc,mBAAmB,aAAsC,IAAI;CAElF,MAAM,CAAC,OAAO,aAAa,WAAW,OAAO;EAC3C;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,MAAM,gBAAgB,eAAe;CACrC,MAAM,iBAAiB,eAAe;CAGtC,MAAM,QAAQ,yBAAyB;EACrC,YAAY,UAAU;EACtB,iBAAiB,UAAU;EAC3B,UAAU,UAAU;EACpB,YAAY,UAAU;CACxB,EAAE;CAEF,MAAM,aAAa,oBACV;EACL,GAAG;EACH,UAAU,OAAO,MAAM,aAAa,aAAa,OAAO,MAAM;CAChE,IACA,OACA,YACF;CACA,MAAM,oBAAoB;EACxB,MAAM,MAAM;GACV,UAAU;GACV,MAAM,cAAc,gBAAgB,KAAA;GACpC,WAAW,aAAa,MAAM,eAAe,iBAAiB,KAAA;EAChE,CAAC,CAAC,OAAO,OAAO;EAChB,OAAO,IAAI,SAAS,IAAI,KAAK,GAAG,IAAI,KAAA;CACtC;CAEA,MAAM,EAAE,WAAW,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