@proyecto-viviana/solidaria-components 0.3.2 → 0.4.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 (398) hide show
  1. package/dist/ActionBar.js +184 -0
  2. package/dist/ActionBar.js.map +1 -0
  3. package/dist/ActionBar.jsx +128 -0
  4. package/dist/ActionBar.jsx.map +1 -0
  5. package/dist/ActionGroup.js +179 -0
  6. package/dist/ActionGroup.js.map +1 -0
  7. package/dist/ActionGroup.jsx +129 -0
  8. package/dist/ActionGroup.jsx.map +1 -0
  9. package/dist/Alert.js +111 -0
  10. package/dist/Alert.js.map +1 -0
  11. package/dist/Alert.jsx +82 -0
  12. package/dist/Alert.jsx.map +1 -0
  13. package/dist/Autocomplete.js +130 -0
  14. package/dist/Autocomplete.js.map +1 -0
  15. package/dist/Autocomplete.jsx +116 -0
  16. package/dist/Autocomplete.jsx.map +1 -0
  17. package/dist/Breadcrumbs.d.ts.map +1 -1
  18. package/dist/Breadcrumbs.js +334 -0
  19. package/dist/Breadcrumbs.js.map +1 -0
  20. package/dist/Breadcrumbs.jsx +266 -0
  21. package/dist/Breadcrumbs.jsx.map +1 -0
  22. package/dist/Button.d.ts.map +1 -1
  23. package/dist/Button.js +348 -0
  24. package/dist/Button.js.map +1 -0
  25. package/dist/Button.jsx +314 -0
  26. package/dist/Button.jsx.map +1 -0
  27. package/dist/Calendar.d.ts +4 -4
  28. package/dist/Calendar.d.ts.map +1 -1
  29. package/dist/Calendar.js +538 -0
  30. package/dist/Calendar.js.map +1 -0
  31. package/dist/Calendar.jsx +333 -0
  32. package/dist/Calendar.jsx.map +1 -0
  33. package/dist/CalendarPicker.d.ts +33 -0
  34. package/dist/CalendarPicker.d.ts.map +1 -0
  35. package/dist/CalendarPicker.js +44 -0
  36. package/dist/CalendarPicker.js.map +1 -0
  37. package/dist/CalendarPicker.jsx +44 -0
  38. package/dist/CalendarPicker.jsx.map +1 -0
  39. package/dist/Checkbox.d.ts +83 -4
  40. package/dist/Checkbox.d.ts.map +1 -1
  41. package/dist/Checkbox.js +923 -0
  42. package/dist/Checkbox.js.map +1 -0
  43. package/dist/Checkbox.jsx +707 -0
  44. package/dist/Checkbox.jsx.map +1 -0
  45. package/dist/Collection.d.ts.map +1 -1
  46. package/dist/Collection.js +202 -0
  47. package/dist/Collection.js.map +1 -0
  48. package/dist/Collection.jsx +152 -0
  49. package/dist/Collection.jsx.map +1 -0
  50. package/dist/Color.d.ts.map +1 -1
  51. package/dist/Color.js +1720 -0
  52. package/dist/Color.js.map +1 -0
  53. package/dist/Color.jsx +1344 -0
  54. package/dist/Color.jsx.map +1 -0
  55. package/dist/ColorEditor.js +208 -0
  56. package/dist/ColorEditor.js.map +1 -0
  57. package/dist/ColorEditor.jsx +120 -0
  58. package/dist/ColorEditor.jsx.map +1 -0
  59. package/dist/ComboBox.d.ts +4 -4
  60. package/dist/ComboBox.d.ts.map +1 -1
  61. package/dist/ComboBox.js +992 -0
  62. package/dist/ComboBox.js.map +1 -0
  63. package/dist/ComboBox.jsx +714 -0
  64. package/dist/ComboBox.jsx.map +1 -0
  65. package/dist/ContextualHelpTrigger.js +146 -0
  66. package/dist/ContextualHelpTrigger.js.map +1 -0
  67. package/dist/ContextualHelpTrigger.jsx +109 -0
  68. package/dist/ContextualHelpTrigger.jsx.map +1 -0
  69. package/dist/DateField.d.ts +3 -3
  70. package/dist/DateField.d.ts.map +1 -1
  71. package/dist/DateField.js +4 -0
  72. package/dist/DateField.jsx +4 -0
  73. package/dist/DateField2.js +499 -0
  74. package/dist/DateField2.js.map +1 -0
  75. package/dist/DateField2.jsx +317 -0
  76. package/dist/DateField2.jsx.map +1 -0
  77. package/dist/DatePicker.d.ts +4 -4
  78. package/dist/DatePicker.d.ts.map +1 -1
  79. package/dist/DatePicker.js +991 -0
  80. package/dist/DatePicker.js.map +1 -0
  81. package/dist/DatePicker.jsx +682 -0
  82. package/dist/DatePicker.jsx.map +1 -0
  83. package/dist/Dialog.d.ts.map +1 -1
  84. package/dist/Dialog.js +337 -0
  85. package/dist/Dialog.js.map +1 -0
  86. package/dist/Dialog.jsx +192 -0
  87. package/dist/Dialog.jsx.map +1 -0
  88. package/dist/Disclosure.d.ts.map +1 -1
  89. package/dist/Disclosure.js +328 -0
  90. package/dist/Disclosure.js.map +1 -0
  91. package/dist/Disclosure.jsx +230 -0
  92. package/dist/Disclosure.jsx.map +1 -0
  93. package/dist/DragAndDrop.d.ts.map +1 -1
  94. package/dist/DragAndDrop.js +176 -0
  95. package/dist/DragAndDrop.js.map +1 -0
  96. package/dist/DragAndDrop.jsx +160 -0
  97. package/dist/DragAndDrop.jsx.map +1 -0
  98. package/dist/DropZone.d.ts.map +1 -1
  99. package/dist/DropZone.js +189 -0
  100. package/dist/DropZone.js.map +1 -0
  101. package/dist/DropZone.jsx +144 -0
  102. package/dist/DropZone.jsx.map +1 -0
  103. package/dist/FieldError.js +66 -0
  104. package/dist/FieldError.js.map +1 -0
  105. package/dist/FieldError.jsx +47 -0
  106. package/dist/FieldError.jsx.map +1 -0
  107. package/dist/FileTrigger.js +79 -0
  108. package/dist/FileTrigger.js.map +1 -0
  109. package/dist/FileTrigger.jsx +49 -0
  110. package/dist/FileTrigger.jsx.map +1 -0
  111. package/dist/Focusable.js +70 -0
  112. package/dist/Focusable.js.map +1 -0
  113. package/dist/Focusable.jsx +69 -0
  114. package/dist/Focusable.jsx.map +1 -0
  115. package/dist/Form.js +99 -0
  116. package/dist/Form.js.map +1 -0
  117. package/dist/Form.jsx +73 -0
  118. package/dist/Form.jsx.map +1 -0
  119. package/dist/GridList.d.ts +34 -2
  120. package/dist/GridList.d.ts.map +1 -1
  121. package/dist/GridList.js +723 -0
  122. package/dist/GridList.js.map +1 -0
  123. package/dist/GridList.jsx +552 -0
  124. package/dist/GridList.jsx.map +1 -0
  125. package/dist/HiddenTimeInput.js +104 -0
  126. package/dist/HiddenTimeInput.js.map +1 -0
  127. package/dist/HiddenTimeInput.jsx +69 -0
  128. package/dist/HiddenTimeInput.jsx.map +1 -0
  129. package/dist/Icon.d.ts.map +1 -1
  130. package/dist/Icon.js +127 -0
  131. package/dist/Icon.js.map +1 -0
  132. package/dist/Icon.jsx +72 -0
  133. package/dist/Icon.jsx.map +1 -0
  134. package/dist/Keyboard.js +30 -0
  135. package/dist/Keyboard.js.map +1 -0
  136. package/dist/Keyboard.jsx +24 -0
  137. package/dist/Keyboard.jsx.map +1 -0
  138. package/dist/Landmark.js +134 -0
  139. package/dist/Landmark.js.map +1 -0
  140. package/dist/Landmark.jsx +118 -0
  141. package/dist/Landmark.jsx.map +1 -0
  142. package/dist/Link.d.ts.map +1 -1
  143. package/dist/Link.js +219 -0
  144. package/dist/Link.js.map +1 -0
  145. package/dist/Link.jsx +189 -0
  146. package/dist/Link.jsx.map +1 -0
  147. package/dist/ListBox.d.ts.map +1 -1
  148. package/dist/ListBox.js +670 -0
  149. package/dist/ListBox.js.map +1 -0
  150. package/dist/ListBox.jsx +508 -0
  151. package/dist/ListBox.jsx.map +1 -0
  152. package/dist/Menu.d.ts +27 -9
  153. package/dist/Menu.d.ts.map +1 -1
  154. package/dist/Menu.js +1254 -0
  155. package/dist/Menu.js.map +1 -0
  156. package/dist/Menu.jsx +1042 -0
  157. package/dist/Menu.jsx.map +1 -0
  158. package/dist/Meter.d.ts.map +1 -1
  159. package/dist/Meter.js +123 -0
  160. package/dist/Meter.js.map +1 -0
  161. package/dist/Meter.jsx +107 -0
  162. package/dist/Meter.jsx.map +1 -0
  163. package/dist/Modal.d.ts.map +1 -1
  164. package/dist/Modal.js +380 -0
  165. package/dist/Modal.js.map +1 -0
  166. package/dist/Modal.jsx +314 -0
  167. package/dist/Modal.jsx.map +1 -0
  168. package/dist/NumberField.d.ts +3 -3
  169. package/dist/NumberField.d.ts.map +1 -1
  170. package/dist/NumberField.js +573 -0
  171. package/dist/NumberField.js.map +1 -0
  172. package/dist/NumberField.jsx +443 -0
  173. package/dist/NumberField.jsx.map +1 -0
  174. package/dist/Popover.d.ts +10 -2
  175. package/dist/Popover.d.ts.map +1 -1
  176. package/dist/Popover.js +464 -0
  177. package/dist/Popover.js.map +1 -0
  178. package/dist/Popover.jsx +333 -0
  179. package/dist/Popover.jsx.map +1 -0
  180. package/dist/Pressable.js +69 -0
  181. package/dist/Pressable.js.map +1 -0
  182. package/dist/Pressable.jsx +68 -0
  183. package/dist/Pressable.jsx.map +1 -0
  184. package/dist/ProgressBar.d.ts.map +1 -1
  185. package/dist/ProgressBar.js +130 -0
  186. package/dist/ProgressBar.js.map +1 -0
  187. package/dist/ProgressBar.jsx +114 -0
  188. package/dist/ProgressBar.jsx.map +1 -0
  189. package/dist/RadioGroup.d.ts +82 -4
  190. package/dist/RadioGroup.d.ts.map +1 -1
  191. package/dist/RadioGroup.js +931 -0
  192. package/dist/RadioGroup.js.map +1 -0
  193. package/dist/RadioGroup.jsx +681 -0
  194. package/dist/RadioGroup.jsx.map +1 -0
  195. package/dist/RangeCalendar.d.ts.map +1 -1
  196. package/dist/RangeCalendar.js +410 -0
  197. package/dist/RangeCalendar.js.map +1 -0
  198. package/dist/RangeCalendar.jsx +253 -0
  199. package/dist/RangeCalendar.jsx.map +1 -0
  200. package/dist/RouterProvider.js +118 -0
  201. package/dist/RouterProvider.js.map +1 -0
  202. package/dist/RouterProvider.jsx +112 -0
  203. package/dist/RouterProvider.jsx.map +1 -0
  204. package/dist/SearchField.d.ts +2 -2
  205. package/dist/SearchField.d.ts.map +1 -1
  206. package/dist/SearchField.js +643 -0
  207. package/dist/SearchField.js.map +1 -0
  208. package/dist/SearchField.jsx +526 -0
  209. package/dist/SearchField.jsx.map +1 -0
  210. package/dist/Select.d.ts.map +1 -1
  211. package/dist/Select.js +1031 -0
  212. package/dist/Select.js.map +1 -0
  213. package/dist/Select.jsx +744 -0
  214. package/dist/Select.jsx.map +1 -0
  215. package/dist/SelectionIndicator.d.ts.map +1 -1
  216. package/dist/SelectionIndicator.js +86 -0
  217. package/dist/SelectionIndicator.js.map +1 -0
  218. package/dist/SelectionIndicator.jsx +50 -0
  219. package/dist/SelectionIndicator.jsx.map +1 -0
  220. package/dist/Separator.js +97 -0
  221. package/dist/Separator.js.map +1 -0
  222. package/dist/Separator.jsx +85 -0
  223. package/dist/Separator.jsx.map +1 -0
  224. package/dist/SharedElementTransition.d.ts.map +1 -1
  225. package/dist/SharedElementTransition.js +165 -0
  226. package/dist/SharedElementTransition.js.map +1 -0
  227. package/dist/SharedElementTransition.jsx +138 -0
  228. package/dist/SharedElementTransition.jsx.map +1 -0
  229. package/dist/Slider.d.ts +33 -1
  230. package/dist/Slider.d.ts.map +1 -1
  231. package/dist/Slider.js +515 -0
  232. package/dist/Slider.js.map +1 -0
  233. package/dist/Slider.jsx +403 -0
  234. package/dist/Slider.jsx.map +1 -0
  235. package/dist/StepList.js +198 -0
  236. package/dist/StepList.js.map +1 -0
  237. package/dist/StepList.jsx +141 -0
  238. package/dist/StepList.jsx.map +1 -0
  239. package/dist/Switch.d.ts +65 -2
  240. package/dist/Switch.d.ts.map +1 -1
  241. package/dist/Switch.js +534 -0
  242. package/dist/Switch.js.map +1 -0
  243. package/dist/Switch.jsx +393 -0
  244. package/dist/Switch.jsx.map +1 -0
  245. package/dist/Table.d.ts +48 -0
  246. package/dist/Table.d.ts.map +1 -1
  247. package/dist/Table.js +1759 -0
  248. package/dist/Table.js.map +1 -0
  249. package/dist/Table.jsx +1348 -0
  250. package/dist/Table.jsx.map +1 -0
  251. package/dist/Tabs.d.ts +0 -4
  252. package/dist/Tabs.d.ts.map +1 -1
  253. package/dist/Tabs.js +595 -0
  254. package/dist/Tabs.js.map +1 -0
  255. package/dist/Tabs.jsx +367 -0
  256. package/dist/Tabs.jsx.map +1 -0
  257. package/dist/TagGroup.d.ts.map +1 -1
  258. package/dist/TagGroup.js +378 -0
  259. package/dist/TagGroup.js.map +1 -0
  260. package/dist/TagGroup.jsx +270 -0
  261. package/dist/TagGroup.jsx.map +1 -0
  262. package/dist/Text.d.ts +18 -6
  263. package/dist/Text.d.ts.map +1 -1
  264. package/dist/Text.js +42 -0
  265. package/dist/Text.js.map +1 -0
  266. package/dist/Text.jsx +35 -0
  267. package/dist/Text.jsx.map +1 -0
  268. package/dist/TextField.d.ts +6 -6
  269. package/dist/TextField.d.ts.map +1 -1
  270. package/dist/TextField.js +436 -0
  271. package/dist/TextField.js.map +1 -0
  272. package/dist/TextField.jsx +403 -0
  273. package/dist/TextField.jsx.map +1 -0
  274. package/dist/TimeField.d.ts +3 -3
  275. package/dist/TimeField.d.ts.map +1 -1
  276. package/dist/TimeField.js +372 -0
  277. package/dist/TimeField.js.map +1 -0
  278. package/dist/TimeField.jsx +224 -0
  279. package/dist/TimeField.jsx.map +1 -0
  280. package/dist/Toast.d.ts +14 -0
  281. package/dist/Toast.d.ts.map +1 -1
  282. package/dist/Toast.js +551 -0
  283. package/dist/Toast.js.map +1 -0
  284. package/dist/Toast.jsx +361 -0
  285. package/dist/Toast.jsx.map +1 -0
  286. package/dist/ToggleButton.d.ts.map +1 -1
  287. package/dist/ToggleButton.js +123 -0
  288. package/dist/ToggleButton.js.map +1 -0
  289. package/dist/ToggleButton.jsx +88 -0
  290. package/dist/ToggleButton.jsx.map +1 -0
  291. package/dist/ToggleButtonGroup.d.ts.map +1 -1
  292. package/dist/ToggleButtonGroup.js +114 -0
  293. package/dist/ToggleButtonGroup.js.map +1 -0
  294. package/dist/ToggleButtonGroup.jsx +85 -0
  295. package/dist/ToggleButtonGroup.jsx.map +1 -0
  296. package/dist/Toolbar.js +112 -0
  297. package/dist/Toolbar.js.map +1 -0
  298. package/dist/Toolbar.jsx +92 -0
  299. package/dist/Toolbar.jsx.map +1 -0
  300. package/dist/Tooltip.d.ts.map +1 -1
  301. package/dist/Tooltip.js +539 -0
  302. package/dist/Tooltip.js.map +1 -0
  303. package/dist/Tooltip.jsx +465 -0
  304. package/dist/Tooltip.jsx.map +1 -0
  305. package/dist/Tree.d.ts +14 -2
  306. package/dist/Tree.d.ts.map +1 -1
  307. package/dist/Tree.js +1424 -0
  308. package/dist/Tree.js.map +1 -0
  309. package/dist/Tree.jsx +1172 -0
  310. package/dist/Tree.jsx.map +1 -0
  311. package/dist/Virtualizer.d.ts +16 -2
  312. package/dist/Virtualizer.d.ts.map +1 -1
  313. package/dist/Virtualizer.js +2 -0
  314. package/dist/Virtualizer.jsx +2 -0
  315. package/dist/Virtualizer2.js +751 -0
  316. package/dist/Virtualizer2.js.map +1 -0
  317. package/dist/Virtualizer2.jsx +730 -0
  318. package/dist/Virtualizer2.jsx.map +1 -0
  319. package/dist/VirtualizerLayouts.d.ts +18 -0
  320. package/dist/VirtualizerLayouts.d.ts.map +1 -1
  321. package/dist/VisuallyHidden.js +42 -0
  322. package/dist/VisuallyHidden.js.map +1 -0
  323. package/dist/VisuallyHidden.jsx +35 -0
  324. package/dist/VisuallyHidden.jsx.map +1 -0
  325. package/dist/contexts.js +33 -0
  326. package/dist/contexts.js.map +1 -0
  327. package/dist/contexts.jsx +33 -0
  328. package/dist/contexts.jsx.map +1 -0
  329. package/dist/index.d.ts +7 -6
  330. package/dist/index.d.ts.map +1 -1
  331. package/dist/index.js +70 -23932
  332. package/dist/index.jsx +70 -18337
  333. package/dist/useDragAndDrop.js +2 -0
  334. package/dist/useDragAndDrop.jsx +2 -0
  335. package/dist/useDragAndDrop2.js +395 -0
  336. package/dist/useDragAndDrop2.js.map +1 -0
  337. package/dist/useDragAndDrop2.jsx +395 -0
  338. package/dist/useDragAndDrop2.jsx.map +1 -0
  339. package/dist/utils.d.ts +83 -11
  340. package/dist/utils.d.ts.map +1 -1
  341. package/dist/utils.js +285 -0
  342. package/dist/utils.js.map +1 -0
  343. package/dist/utils.jsx +277 -0
  344. package/dist/utils.jsx.map +1 -0
  345. package/dist/virtualizer/Layout.js +144 -0
  346. package/dist/virtualizer/Layout.js.map +1 -0
  347. package/dist/virtualizer/Layout.jsx +144 -0
  348. package/dist/virtualizer/Layout.jsx.map +1 -0
  349. package/package.json +401 -4
  350. package/src/Breadcrumbs.tsx +3 -1
  351. package/src/Button.tsx +22 -2
  352. package/src/Calendar.tsx +27 -10
  353. package/src/CalendarPicker.tsx +73 -0
  354. package/src/Checkbox.tsx +539 -3
  355. package/src/Collection.tsx +9 -3
  356. package/src/Color.tsx +42 -14
  357. package/src/ComboBox.tsx +50 -6
  358. package/src/DateField.tsx +20 -2
  359. package/src/DatePicker.tsx +57 -5
  360. package/src/Dialog.tsx +13 -5
  361. package/src/Disclosure.tsx +3 -1
  362. package/src/DragAndDrop.tsx +3 -1
  363. package/src/DropZone.tsx +3 -1
  364. package/src/GridList.tsx +125 -24
  365. package/src/Icon.tsx +3 -1
  366. package/src/Link.tsx +3 -1
  367. package/src/ListBox.tsx +31 -4
  368. package/src/Menu.tsx +252 -128
  369. package/src/Meter.tsx +3 -1
  370. package/src/Modal.tsx +100 -52
  371. package/src/NumberField.tsx +51 -8
  372. package/src/Popover.tsx +40 -10
  373. package/src/ProgressBar.tsx +3 -1
  374. package/src/RadioGroup.tsx +468 -4
  375. package/src/RangeCalendar.tsx +3 -1
  376. package/src/SearchField.tsx +27 -3
  377. package/src/Select.tsx +22 -7
  378. package/src/SelectionIndicator.tsx +3 -1
  379. package/src/SharedElementTransition.tsx +3 -1
  380. package/src/Slider.tsx +159 -13
  381. package/src/Switch.tsx +395 -2
  382. package/src/Table.tsx +409 -95
  383. package/src/Tabs.tsx +16 -45
  384. package/src/TagGroup.tsx +3 -1
  385. package/src/Text.tsx +31 -10
  386. package/src/TextField.tsx +43 -5
  387. package/src/TimeField.tsx +20 -2
  388. package/src/Toast.tsx +79 -14
  389. package/src/ToggleButton.tsx +3 -1
  390. package/src/ToggleButtonGroup.tsx +3 -1
  391. package/src/Tooltip.tsx +3 -1
  392. package/src/Tree.tsx +77 -9
  393. package/src/Virtualizer.tsx +180 -31
  394. package/src/VirtualizerLayouts.ts +45 -10
  395. package/src/index.ts +50 -0
  396. package/src/utils.tsx +243 -27
  397. package/dist/index.js.map +0 -1
  398. package/dist/index.jsx.map +0 -1
package/dist/Switch.js ADDED
@@ -0,0 +1,534 @@
1
+ import { Provider, filterDOMProps, useRenderProps } from "./utils.js";
2
+ import { VisuallyHidden } from "./VisuallyHidden.js";
3
+ import { FieldErrorContext } from "./FieldError.js";
4
+ 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";
8
+ import { VALID_VALIDITY_STATE, createToggleState } from "@proyecto-viviana/solid-stately";
9
+ //#region src/Switch.tsx
10
+ /**
11
+ * ToggleSwitch component for solidaria-components
12
+ *
13
+ * A pre-wired headless switch that combines state + aria hooks.
14
+ * Port of react-aria-components/src/Switch.tsx
15
+ *
16
+ * Named "ToggleSwitch" to avoid conflict with SolidJS's built-in Switch component.
17
+ */
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>`);
19
+ const ToggleSwitchContext = createContext(null);
20
+ /**
21
+ * A switch allows a user to turn a setting on or off.
22
+ *
23
+ * This is a headless component that provides accessibility and state management.
24
+ * Style it using the render props pattern or data attributes.
25
+ *
26
+ * Named "ToggleSwitch" to avoid conflict with SolidJS's built-in Switch component.
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * <ToggleSwitch>
31
+ * {({ isSelected }) => (
32
+ * <>
33
+ * <span class={`switch-track ${isSelected ? 'bg-blue-500' : 'bg-gray-300'}`}>
34
+ * <span class={`switch-thumb ${isSelected ? 'translate-x-5' : 'translate-x-0'}`} />
35
+ * </span>
36
+ * <span>Enable notifications</span>
37
+ * </>
38
+ * )}
39
+ * </ToggleSwitch>
40
+ * ```
41
+ */
42
+ function ToggleSwitch(props) {
43
+ const [inputElement, setInputElement] = createSignal(null);
44
+ const [local, ariaProps] = splitProps(props, [
45
+ "class",
46
+ "style",
47
+ "slot",
48
+ "description",
49
+ "errorMessage"
50
+ ]);
51
+ const descriptionId = createUniqueId();
52
+ const errorMessageId = createUniqueId();
53
+ const state = createToggleState(() => ({
54
+ isSelected: ariaProps.isSelected,
55
+ defaultSelected: ariaProps.defaultSelected,
56
+ onChange: ariaProps.onChange,
57
+ isReadOnly: ariaProps.isReadOnly
58
+ }));
59
+ const switchAria = createSwitch(() => ({
60
+ ...ariaProps,
61
+ children: typeof props.children === "function" ? true : props.children
62
+ }), state, inputElement);
63
+ const describedBy = () => {
64
+ const ids = [
65
+ ariaProps["aria-describedby"],
66
+ local.description ? descriptionId : void 0,
67
+ switchAria.isInvalid && local.errorMessage ? errorMessageId : void 0
68
+ ].filter(Boolean);
69
+ return ids.length ? ids.join(" ") : void 0;
70
+ };
71
+ const { isFocused, isFocusVisible, focusProps } = createFocusRing();
72
+ const { isHovered, hoverProps } = createHover({ get isDisabled() {
73
+ return ariaProps.isDisabled || ariaProps.isReadOnly;
74
+ } });
75
+ const renderValues = createMemo(() => ({
76
+ isSelected: switchAria.isSelected(),
77
+ isHovered: isHovered(),
78
+ isPressed: switchAria.isPressed(),
79
+ isFocused: isFocused(),
80
+ isFocusVisible: isFocusVisible(),
81
+ isDisabled: switchAria.isDisabled,
82
+ isReadOnly: switchAria.isReadOnly,
83
+ isInvalid: switchAria.isInvalid,
84
+ state
85
+ }));
86
+ const renderProps = useRenderProps({
87
+ get children() {
88
+ return props.children;
89
+ },
90
+ class: local.class,
91
+ style: local.style,
92
+ defaultClassName: "solidaria-ToggleSwitch"
93
+ }, renderValues);
94
+ const childRenderValues = {
95
+ get isSelected() {
96
+ return switchAria.isSelected();
97
+ },
98
+ get isHovered() {
99
+ return isHovered();
100
+ },
101
+ get isPressed() {
102
+ return switchAria.isPressed();
103
+ },
104
+ get isFocused() {
105
+ return isFocused();
106
+ },
107
+ get isFocusVisible() {
108
+ return isFocusVisible();
109
+ },
110
+ get isDisabled() {
111
+ return switchAria.isDisabled;
112
+ },
113
+ get isReadOnly() {
114
+ return switchAria.isReadOnly;
115
+ },
116
+ get isInvalid() {
117
+ return switchAria.isInvalid;
118
+ },
119
+ get state() {
120
+ return state;
121
+ }
122
+ };
123
+ const domProps = createMemo(() => {
124
+ const filtered = filterDOMProps(ariaProps, { global: true });
125
+ delete filtered.id;
126
+ delete filtered.onClick;
127
+ return filtered;
128
+ });
129
+ const cleanLabelProps = () => {
130
+ const { ref: _ref1, ...rest } = switchAria.labelProps;
131
+ return rest;
132
+ };
133
+ const cleanHoverProps = () => {
134
+ const { ref: _ref2, ...rest } = hoverProps;
135
+ return rest;
136
+ };
137
+ const cleanInputProps = () => {
138
+ const { ref: _ref3, ...rest } = switchAria.inputProps;
139
+ return rest;
140
+ };
141
+ const cleanFocusProps = () => {
142
+ const { ref: _ref4, ...rest } = focusProps;
143
+ return rest;
144
+ };
145
+ const switchChildren = untrack(() => {
146
+ const children = props.children;
147
+ return typeof children === "function" ? children(childRenderValues) : children;
148
+ });
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"]() {
153
+ return renderProps.class();
154
+ },
155
+ get style() {
156
+ return renderProps.style();
157
+ },
158
+ get ["data-selected"]() {
159
+ return switchAria.isSelected() || void 0;
160
+ },
161
+ get ["data-pressed"]() {
162
+ return switchAria.isPressed() || void 0;
163
+ },
164
+ get ["data-hovered"]() {
165
+ return isHovered() || void 0;
166
+ },
167
+ get ["data-focused"]() {
168
+ return isFocused() || void 0;
169
+ },
170
+ get ["data-focus-visible"]() {
171
+ return isFocusVisible() || void 0;
172
+ },
173
+ get ["data-disabled"]() {
174
+ return switchAria.isDisabled || void 0;
175
+ },
176
+ get ["data-readonly"]() {
177
+ return switchAria.isReadOnly || void 0;
178
+ }
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"]() {
184
+ 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);
212
+ runHydrationEvents();
213
+ return _el$;
214
+ })();
215
+ }
216
+ const SwitchFieldContext = createContext(null);
217
+ const InternalSwitchContext = createContext(null);
218
+ /**
219
+ * A switch button is the clickable area of a switch, including the indicator and label.
220
+ * Must be rendered inside a `SwitchField` (or the legacy `ToggleSwitch`).
221
+ */
222
+ function SwitchButton(props) {
223
+ const getCtx = createMemo(() => useContext(InternalSwitchContext));
224
+ return createComponent(Show, {
225
+ get when() {
226
+ return getCtx();
227
+ },
228
+ fallback: null,
229
+ keyed: true,
230
+ children: (ctx) => createComponent(SwitchButtonImpl, {
231
+ buttonProps: props,
232
+ ctx
233
+ })
234
+ });
235
+ }
236
+ function SwitchButtonImpl(props) {
237
+ const { ctx } = props;
238
+ const switchAria = ctx.switchAria;
239
+ const { isFocused, isFocusVisible, focusProps } = createFocusRing();
240
+ const { isHovered, hoverProps } = createHover({
241
+ get isDisabled() {
242
+ return switchAria.isDisabled || switchAria.isReadOnly;
243
+ },
244
+ onHoverStart: props.buttonProps.onHoverStart,
245
+ onHoverEnd: props.buttonProps.onHoverEnd,
246
+ onHoverChange: props.buttonProps.onHoverChange
247
+ });
248
+ const renderValues = createMemo(() => ({
249
+ isSelected: switchAria.isSelected(),
250
+ isHovered: isHovered(),
251
+ isPressed: switchAria.isPressed(),
252
+ isFocused: isFocused(),
253
+ isFocusVisible: isFocusVisible(),
254
+ isDisabled: switchAria.isDisabled,
255
+ isReadOnly: switchAria.isReadOnly,
256
+ isInvalid: switchAria.isInvalid,
257
+ isRequired: ctx.isRequired,
258
+ state: ctx.state
259
+ }));
260
+ const renderProps = useRenderProps({
261
+ children: props.buttonProps.children,
262
+ class: props.buttonProps.class,
263
+ style: props.buttonProps.style,
264
+ defaultClassName: ctx.defaultClassName
265
+ }, renderValues);
266
+ const childRenderValues = {
267
+ get isSelected() {
268
+ return switchAria.isSelected();
269
+ },
270
+ get isHovered() {
271
+ return isHovered();
272
+ },
273
+ get isPressed() {
274
+ return switchAria.isPressed();
275
+ },
276
+ get isFocused() {
277
+ return isFocused();
278
+ },
279
+ get isFocusVisible() {
280
+ return isFocusVisible();
281
+ },
282
+ get isDisabled() {
283
+ return switchAria.isDisabled;
284
+ },
285
+ get isReadOnly() {
286
+ return switchAria.isReadOnly;
287
+ },
288
+ get isInvalid() {
289
+ return switchAria.isInvalid;
290
+ },
291
+ get isRequired() {
292
+ return ctx.isRequired;
293
+ },
294
+ get state() {
295
+ return ctx.state;
296
+ }
297
+ };
298
+ const cleanLabelProps = () => {
299
+ const { ref: _ref1, ...rest } = switchAria.labelProps;
300
+ return rest;
301
+ };
302
+ const cleanHoverProps = () => {
303
+ const { ref: _ref2, ...rest } = hoverProps;
304
+ return rest;
305
+ };
306
+ const cleanInputProps = () => {
307
+ const { ref: _ref3, ...rest } = switchAria.inputProps;
308
+ return rest;
309
+ };
310
+ const cleanFocusProps = () => {
311
+ const { ref: _ref4, ...rest } = focusProps;
312
+ return rest;
313
+ };
314
+ const switchChildren = untrack(() => {
315
+ const children = props.buttonProps.children;
316
+ return typeof children === "function" ? children(childRenderValues) : children;
317
+ });
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"]() {
322
+ return renderProps.class();
323
+ },
324
+ get style() {
325
+ return renderProps.style();
326
+ },
327
+ get slot() {
328
+ return props.buttonProps.slot;
329
+ },
330
+ get ["data-selected"]() {
331
+ return switchAria.isSelected() || void 0;
332
+ },
333
+ get ["data-pressed"]() {
334
+ return switchAria.isPressed() || void 0;
335
+ },
336
+ get ["data-hovered"]() {
337
+ return isHovered() || void 0;
338
+ },
339
+ get ["data-focused"]() {
340
+ return isFocused() || void 0;
341
+ },
342
+ get ["data-focus-visible"]() {
343
+ return isFocusVisible() || void 0;
344
+ },
345
+ get ["data-disabled"]() {
346
+ return switchAria.isDisabled || void 0;
347
+ },
348
+ get ["data-readonly"]() {
349
+ return switchAria.isReadOnly || void 0;
350
+ },
351
+ get ["data-invalid"]() {
352
+ return switchAria.isInvalid || void 0;
353
+ },
354
+ get ["data-required"]() {
355
+ return ctx.isRequired || void 0;
356
+ }
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);
367
+ runHydrationEvents();
368
+ return _el$11;
369
+ })();
370
+ }
371
+ /**
372
+ * A switch allows a user to turn a setting on or off, with support for validation and help text.
373
+ * Wraps a `SwitchButton` and provides description/error wiring through
374
+ * TextContext slots — render help text with `<Text slot="description">`.
375
+ *
376
+ * @example
377
+ * ```tsx
378
+ * <SwitchField>
379
+ * <SwitchButton>Enable sync</SwitchButton>
380
+ * <Text slot="description">Sync across devices</Text>
381
+ * </SwitchField>
382
+ * ```
383
+ */
384
+ function SwitchField(props) {
385
+ const contextProps = useContext(SwitchFieldContext);
386
+ const contextSlotProps = contextProps?.slots?.[props.slot ?? "default"];
387
+ const contextBaseProps = createMemo(() => {
388
+ if (!contextProps) return {};
389
+ const { slots: _slots, ...rest } = contextProps;
390
+ return rest;
391
+ });
392
+ const merged = contextProps ? mergeProps$2(contextBaseProps(), contextSlotProps ?? {}, props) : props;
393
+ const [inputElement, setInputElement] = createSignal(null);
394
+ const [local, ariaProps] = splitProps(merged, [
395
+ "class",
396
+ "style",
397
+ "slot",
398
+ "children"
399
+ ]);
400
+ const state = createToggleState(() => ({
401
+ isSelected: ariaProps.isSelected,
402
+ defaultSelected: ariaProps.defaultSelected,
403
+ onChange: ariaProps.onChange,
404
+ isReadOnly: ariaProps.isReadOnly
405
+ }));
406
+ const switchAria = createSwitch(() => ({
407
+ ...ariaProps,
408
+ children: true
409
+ }), state, inputElement);
410
+ const internalContext = {
411
+ switchAria,
412
+ state,
413
+ setInputElement,
414
+ defaultClassName: "solidaria-SwitchButton",
415
+ get isRequired() {
416
+ return ariaProps.isRequired || false;
417
+ }
418
+ };
419
+ const textSlots = { slots: {
420
+ get description() {
421
+ return switchAria.descriptionProps;
422
+ },
423
+ get errorMessage() {
424
+ return switchAria.errorMessageProps;
425
+ }
426
+ } };
427
+ const renderValues = createMemo(() => ({
428
+ isSelected: switchAria.isSelected(),
429
+ isDisabled: switchAria.isDisabled,
430
+ isReadOnly: switchAria.isReadOnly,
431
+ isInvalid: switchAria.isInvalid,
432
+ isRequired: ariaProps.isRequired || false,
433
+ state
434
+ }));
435
+ const renderProps = useRenderProps({
436
+ children: merged.children,
437
+ class: local.class,
438
+ style: local.style,
439
+ defaultClassName: "solidaria-SwitchField"
440
+ }, renderValues);
441
+ const fieldErrorContext = {
442
+ get validation() {
443
+ return {
444
+ isInvalid: switchAria.isInvalid,
445
+ validationDetails: VALID_VALIDITY_STATE,
446
+ validationErrors: []
447
+ };
448
+ },
449
+ get errorMessageProps() {
450
+ return switchAria.errorMessageProps;
451
+ }
452
+ };
453
+ const domProps = createMemo(() => {
454
+ const filtered = filterDOMProps(ariaProps, { global: true });
455
+ delete filtered.id;
456
+ delete filtered.onClick;
457
+ return filtered;
458
+ });
459
+ const FieldChildren = () => {
460
+ const childRenderValues = {
461
+ get isSelected() {
462
+ return switchAria.isSelected();
463
+ },
464
+ get isDisabled() {
465
+ return switchAria.isDisabled;
466
+ },
467
+ get isReadOnly() {
468
+ return switchAria.isReadOnly;
469
+ },
470
+ get isInvalid() {
471
+ return switchAria.isInvalid;
472
+ },
473
+ get isRequired() {
474
+ return ariaProps.isRequired || false;
475
+ },
476
+ get state() {
477
+ return state;
478
+ }
479
+ };
480
+ return memo(createMemo(() => {
481
+ const children = merged.children;
482
+ return typeof children === "function" ? children(childRenderValues) : children;
483
+ }));
484
+ };
485
+ return createComponent(InternalSwitchContext.Provider, {
486
+ value: internalContext,
487
+ get children() {
488
+ return createComponent(FieldErrorContext.Provider, {
489
+ value: fieldErrorContext,
490
+ get children() {
491
+ var _el$17 = getNextElement(_tmpl$6);
492
+ spread(_el$17, mergeProps(domProps, {
493
+ get ["class"]() {
494
+ return renderProps.class();
495
+ },
496
+ get style() {
497
+ return renderProps.style();
498
+ },
499
+ get slot() {
500
+ return local.slot;
501
+ },
502
+ get ["data-selected"]() {
503
+ return switchAria.isSelected() || void 0;
504
+ },
505
+ get ["data-disabled"]() {
506
+ return switchAria.isDisabled || void 0;
507
+ },
508
+ get ["data-readonly"]() {
509
+ return switchAria.isReadOnly || void 0;
510
+ },
511
+ get ["data-invalid"]() {
512
+ return switchAria.isInvalid || void 0;
513
+ },
514
+ get ["data-required"]() {
515
+ return ariaProps.isRequired || void 0;
516
+ }
517
+ }), false, true);
518
+ insert(_el$17, createComponent(Provider, {
519
+ values: [[TextContext, textSlots]],
520
+ get children() {
521
+ return createComponent(FieldChildren, {});
522
+ }
523
+ }));
524
+ runHydrationEvents();
525
+ return _el$17;
526
+ }
527
+ });
528
+ }
529
+ });
530
+ }
531
+ //#endregion
532
+ export { SwitchButton, SwitchField, SwitchFieldContext, ToggleSwitch, ToggleSwitchContext };
533
+
534
+ //# sourceMappingURL=Switch.js.map
@@ -0,0 +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,mBAAmBjD,aAAsC,IAAI;CAElF,MAAM,CAACmD,OAAOC,aAAalD,WAAW6C,OAAO;EAC3C;EACA;EACA;EACA;EACA;CAAc,CACf;CACD,MAAMM,gBAAgBpD,eAAe;CACrC,MAAMqD,iBAAiBrD,eAAe;CAGtC,MAAMmC,QAAQxB,yBAAyB;EACrCgB,YAAYwB,UAAUxB;EACtB2B,iBAAiBH,UAAUG;EAC3BC,UAAUJ,UAAUI;EACpBtB,YAAYkB,UAAUlB;CACxB,EAAE;CAEF,MAAMuB,aAAanD,oBACV;EACL,GAAG8C;EACHb,UAAU,OAAOQ,MAAMR,aAAa,aAAa,OAAOQ,MAAMR;CAChE,IACAH,OACAY,YACF;CACA,MAAMU,oBAAoB;EACxB,MAAMC,MAAM;GACVP,UAAU;GACVD,MAAMT,cAAcW,gBAAgBO,KAAAA;GACpCH,WAAWtB,aAAagB,MAAMP,eAAeU,iBAAiBM,KAAAA;EAAS,CACxE,CAACC,OAAOC,OAAO;EAChB,OAAOH,IAAII,SAASJ,IAAIK,KA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