@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/Toast.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","names":["JSX","Accessor","createContext","createMemo","createEffect","createSignal","onCleanup","splitProps","Show","useContext","Portal","ToastState","QueuedToast","ToastQueueOptions","ToastOptions","ToastQueue","createToastState","createToast","createToastRegion","useUNSAFE_PortalContext","RenderChildren","ClassNameOrFunction","StyleOrFunction","useRenderProps","filterDOMProps","useIsHydrated","ToastContent","id","dataAttribute","children","title","description","variant","type","actionLabel","onAction","shouldCloseOnAction","action","label","ToastRenderProps","isEntering","isExiting","animation","toast","ToastRegionRenderProps","visibleToasts","ToastRegionProps","class","style","state","portal","placement","ToastProps","ToastContext","ToastAriaContextValue","titleProps","HTMLAttributes","HTMLElement","descriptionProps","contentProps","ToastAriaContext","toastStateByKey","Map","useToastContext","context","Error","globalToastQueue","maxVisibleToasts","Infinity","hasExitAnimation","addToast","content","options","add","normalizeToastPlacement","replace","NonNullable","ToastProviderProps","Element","queueOptions","useGlobalQueue","ToastProvider","props","queue","_$createComponent","Provider","value","ToastRegion","isHydrated","local","rest","portalContext","portalContainer","getContainer","undefined","regionElement","setRegionElement","contextState","regionAria","close","key","remove","clear","pauseAll","resumeAll","ref","aria-label","renderValues","renderProps","defaultClassName","domProps","Record","global","placementStyles","CSSProperties","edge","align","split","base","position","display","gap","padding","top","right","left","transform","bottom","normalizedPlacement","hasToasts","length","hasAuthoredRegionStyle","regionContent","mergedStyle","custom","_ref","cleanRegionProps","regionProps","_el$","_$getNextElement","_tmpl$","_$use","_$spread","_$mergeProps","data-placement","_$insert","renderChildren","_$runHydrationEvents","when","_$memo","fallback","mount","Toast","toastRef","HTMLDivElement","set","get","delete","hasTitle","toastAria","hasDescription","const","handleRootClick","event","MouseEvent","target","closest","animations","getAnimations","canceled","Promise","all","map","a","finished","then","catch","cleanToastProps","toastProps","titleId","descriptionId","titleEl","querySelector","descriptionEl","contentEl","role","ariaLive","ariaAtomic","setAttribute","_el$2","_ref$","data-animation","data-type","data-variant","ToastTitleProps","ToastTitle","ariaTitleProps","_el$3","_tmpl$2","ToastDescriptionProps","ToastDescription","ariaDescriptionProps","_el$4","_tmpl$3","ToastContentProps","ariaContentProps","_el$5","_tmpl$4","ToastCloseButtonProps","ToastCloseButton","handleClose","_el$6","_tmpl$5","$$click","_$addEventListener","_$effect","_p$","_v$","_v$2","_v$3","e","_$className","t","_$style","_$setAttribute","DefaultToastProps","DefaultToast","actionHandler","handleAction","_el$7","_tmpl$7","_el$9","firstChild","_el$0","_co$","_$getNextMarker","nextSibling","_el$1","_el$10","_co$2","flex","_el$8","_tmpl$6","_$delegateEvents"],"sources":["../src/Toast.tsx"],"sourcesContent":["/**\n * Toast components for solidaria-components\n *\n * Toast notifications with auto-dismiss, pause on hover/focus, and accessibility.\n * Port of react-aria-components Toast.\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n createEffect,\n createSignal,\n onCleanup,\n splitProps,\n Show,\n useContext,\n} from \"solid-js\";\nimport { Portal } from \"solid-js/web\";\nimport {\n type ToastState,\n type QueuedToast,\n type ToastQueueOptions,\n type ToastOptions,\n ToastQueue,\n createToastState,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n createToast,\n createToastRegion,\n useUNSAFE_PortalContext,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n useRenderProps,\n filterDOMProps,\n useIsHydrated,\n} from \"./utils\";\n\nexport interface ToastContent {\n /** DOM id for the toast root when content is queued through Spectrum ToastQueue. */\n id?: string;\n /** Data attributes for the toast root when content is queued through Spectrum ToastQueue. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n /** Spectrum Toast message content. */\n children?: string;\n /** The title of the toast. */\n title?: string;\n /** The description/body of the toast. */\n description?: string;\n /** Spectrum variant. */\n variant?: \"info\" | \"positive\" | \"negative\" | \"neutral\";\n /** Backward-compatible type/variant of the toast. */\n type?: \"info\" | \"success\" | \"warning\" | \"error\" | \"positive\" | \"negative\" | \"neutral\";\n /** Spectrum action button label. */\n actionLabel?: string;\n /** Handler called when the Spectrum action button is pressed. */\n onAction?: () => void;\n /** Whether the toast should close when the Spectrum action is performed. */\n shouldCloseOnAction?: boolean;\n /** Custom action button. */\n action?: {\n label: string;\n onAction: () => void;\n };\n}\n\nexport interface ToastRenderProps {\n /** Whether the toast is currently animating in. */\n isEntering: boolean;\n /** Whether the toast is currently animating out. */\n isExiting: boolean;\n /** The animation state (entering, exiting, queued). */\n animation: \"entering\" | \"exiting\" | \"queued\" | undefined;\n /** The toast data. */\n toast: QueuedToast<ToastContent>;\n}\n\nexport interface ToastRegionRenderProps {\n /** The visible toasts. */\n visibleToasts: Accessor<QueuedToast<ToastContent>[]>;\n}\n\nexport interface ToastRegionProps {\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ToastRegionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToastRegionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToastRegionRenderProps>;\n /** The toast state to display. If not provided, uses ToastContext. */\n state?: ToastState<ToastContent>;\n /** Accessible label for the region. */\n \"aria-label\"?: string;\n /** Whether to render in a portal. */\n portal?: boolean;\n /** Placement of the toast region. */\n placement?:\n | \"top\"\n | \"top start\"\n | \"top end\"\n | \"top-start\"\n | \"top-end\"\n | \"bottom\"\n | \"bottom start\"\n | \"bottom end\"\n | \"bottom-start\"\n | \"bottom-end\";\n}\n\nexport interface ToastProps {\n /** DOM id for the toast root. */\n id?: string;\n /** Data attributes for the toast root. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n /** The toast data. */\n toast: QueuedToast<ToastContent>;\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ToastRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToastRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToastRenderProps>;\n}\n\nexport const ToastContext = createContext<ToastState<ToastContent> | null>(null);\n\ninterface ToastAriaContextValue {\n titleProps: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n contentProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\nconst ToastAriaContext = createContext<ToastAriaContextValue | null>(null);\nconst toastStateByKey = new Map<string, ToastState<ToastContent>>();\n\nexport function useToastContext(): ToastState<ToastContent> {\n const context = useContext(ToastContext);\n if (!context) {\n throw new Error(\"Toast components must be used within a ToastProvider\");\n }\n return context;\n}\n\n/** Default global toast queue that can be used for app-wide toasts. */\nexport const globalToastQueue = new ToastQueue<ToastContent>({\n maxVisibleToasts: Infinity,\n hasExitAnimation: true,\n});\n\n/**\n * Add a toast to the global queue.\n * Convenience function for adding toasts from anywhere in the app.\n */\nexport function addToast(content: ToastContent, options?: ToastOptions): string {\n return globalToastQueue.add(content, options);\n}\n\nfunction normalizeToastPlacement(placement?: ToastRegionProps[\"placement\"]) {\n return (placement ?? \"bottom\").replace(\"-\", \" \") as NonNullable<ToastRegionProps[\"placement\"]>;\n}\n\nexport interface ToastProviderProps {\n /** The children of the provider. */\n children: JSX.Element;\n /** Custom toast queue options. */\n queueOptions?: ToastQueueOptions;\n /** Use global queue instead of creating a new one. */\n useGlobalQueue?: boolean;\n}\n\n/**\n * ToastProvider creates a toast queue context for descendant components.\n * Use this to wrap your app or a section that needs toast notifications.\n *\n * @example\n * ```tsx\n * <ToastProvider>\n * <App />\n * <ToastRegion />\n * </ToastProvider>\n * ```\n */\nexport function ToastProvider(props: ToastProviderProps): JSX.Element {\n const queue = props.useGlobalQueue\n ? globalToastQueue\n : new ToastQueue<ToastContent>(props.queueOptions);\n\n const state = createToastState({ queue });\n\n return <ToastContext.Provider value={state}>{props.children}</ToastContext.Provider>;\n}\n\n/**\n * ToastRegion is a container that displays all visible toasts.\n * It handles pause on hover/focus and provides the landmark region.\n *\n * @example\n * ```tsx\n * <ToastRegion placement=\"bottom-end\">\n * {(renderProps) => (\n * <For each={renderProps.visibleToasts}>\n * {(toast) => <Toast toast={toast} />}\n * </For>\n * )}\n * </ToastRegion>\n * ```\n */\nexport function ToastRegion(props: ToastRegionProps): JSX.Element {\n // Do NOT early-return on the server: returning null on the server and a <Show>\n // on the client desyncs hydration when the region is in the SSR tree. Render the\n // same structure on both and gate the Portal on useIsHydrated() (see Popover).\n const isHydrated = useIsHydrated();\n\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"state\",\n \"aria-label\",\n \"portal\",\n \"placement\",\n ]);\n const portalContext = useUNSAFE_PortalContext();\n const portalContainer = () => portalContext.getContainer?.() ?? undefined;\n const [regionElement, setRegionElement] = createSignal<HTMLElement>();\n\n const contextState = useContext(ToastContext);\n const state = () => local.state ?? contextState;\n\n const regionAria = createToastRegion<ToastContent>({\n state: {\n visibleToasts: () => state()?.visibleToasts() ?? [],\n add: (content, options) => state()?.add(content, options) ?? \"\",\n close: (key) => state()?.close(key),\n remove: (key) => state()?.remove(key),\n clear: () => state()?.clear(),\n pauseAll: () => state()?.pauseAll(),\n resumeAll: () => state()?.resumeAll(),\n },\n ref: regionElement,\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n });\n\n const renderValues = createMemo<ToastRegionRenderProps>(() => ({\n visibleToasts: () => state()?.visibleToasts() ?? [],\n }));\n\n const renderProps = useRenderProps(\n {\n // Lazy: the region content is gated behind `<Show when={isHydrated() && …}>`\n // (Portal) below, so reading children must not instantiate templates during\n // the component body (would walk getNextElement before the gate the server\n // kept closed → hydration mismatch). See Popover for the full rationale.\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ToastRegion\",\n },\n renderValues,\n );\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const placementStyles = createMemo<JSX.CSSProperties>(() => {\n const placement = normalizeToastPlacement(local.placement);\n const [edge, align = \"center\"] = placement.split(\" \");\n const base: JSX.CSSProperties = {\n position: \"fixed\",\n \"z-index\": 100001,\n display: \"flex\",\n \"flex-direction\": edge === \"top\" ? \"column\" : \"column-reverse\",\n gap: \"8px\",\n padding: \"16px\",\n \"pointer-events\": \"none\",\n };\n\n if (edge === \"top\") {\n if (align === \"end\") {\n return { ...base, top: \"16px\", right: \"16px\" } as JSX.CSSProperties;\n }\n if (align === \"start\") {\n return { ...base, top: \"16px\", left: \"16px\" } as JSX.CSSProperties;\n }\n return {\n ...base,\n top: \"16px\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n } as JSX.CSSProperties;\n }\n\n if (align === \"end\") {\n return { ...base, bottom: \"16px\", right: \"16px\" } as JSX.CSSProperties;\n }\n if (align === \"start\") {\n return { ...base, bottom: \"16px\", left: \"16px\" } as JSX.CSSProperties;\n }\n return {\n ...base,\n bottom: \"16px\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n } as JSX.CSSProperties;\n });\n\n const normalizedPlacement = () => normalizeToastPlacement(local.placement);\n\n const visibleToasts = () => state()?.visibleToasts() ?? [];\n const hasToasts = () => visibleToasts().length > 0;\n const hasAuthoredRegionStyle = () => local.class != null || local.style != null;\n\n const regionContent = () => {\n if (!state()) return null;\n\n const mergedStyle = () => {\n const custom = renderProps.style();\n // React Aria Components leaves ToastRegion unstyled. Keep this package's\n // fallback placement only for bare regions so styled layers such as S2 can\n // own fixed viewport geometry with their generated classes.\n if (hasAuthoredRegionStyle()) return custom;\n\n const placement = placementStyles();\n if (!custom) return placement;\n return { ...placement, ...custom } as JSX.CSSProperties;\n };\n\n const { ref: _ref, ...cleanRegionProps } = regionAria.regionProps as Record<string, unknown>;\n\n return (\n <div\n ref={setRegionElement}\n {...domProps()}\n {...cleanRegionProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-placement={normalizedPlacement()}\n >\n {renderProps.renderChildren()}\n </div>\n );\n };\n\n return (\n <Show when={isHydrated() && hasToasts()}>\n <Show when={local.portal !== false} fallback={regionContent()}>\n <Portal mount={portalContainer()}>{regionContent()}</Portal>\n </Show>\n </Show>\n );\n}\n\n/**\n * Toast is an individual notification component.\n *\n * @example\n * ```tsx\n * <Toast toast={toast}>\n * {(renderProps) => (\n * <div class={renderProps.isExiting ? 'fade-out' : 'fade-in'}>\n * <h3>{renderProps.toast.content.title}</h3>\n * <p>{renderProps.toast.content.description}</p>\n * </div>\n * )}\n * </Toast>\n * ```\n */\nexport function Toast(props: ToastProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"toast\", \"children\", \"class\", \"style\"]);\n\n let toastRef!: HTMLDivElement;\n\n const state = useToastContext();\n\n createEffect(() => {\n const key = local.toast.key;\n toastStateByKey.set(key, state);\n onCleanup(() => {\n if (toastStateByKey.get(key) === state) {\n toastStateByKey.delete(key);\n }\n });\n });\n\n const hasTitle = () => !!(local.toast.content.children ?? local.toast.content.title);\n const toastAria = createToast({\n toast: local.toast,\n state,\n hasTitle: hasTitle(),\n hasDescription: !!local.toast.content.description,\n });\n\n const renderValues = createMemo<ToastRenderProps>(() => ({\n isEntering: local.toast.animation === \"entering\",\n isExiting: local.toast.animation === \"exiting\",\n animation: local.toast.animation,\n toast: local.toast,\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-Toast\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const mergedStyle = () => {\n const custom = renderProps.style();\n if (!custom) return { \"pointer-events\": \"auto\" as const };\n return { \"pointer-events\": \"auto\" as const, ...custom } as JSX.CSSProperties;\n };\n\n const handleRootClick = (event: MouseEvent) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n if (target.closest(\"[data-solidaria-toast-close-button]\")) {\n state.close(local.toast.key);\n state.remove(local.toast.key);\n }\n };\n\n // Exit animation lifecycle:\n // When animation becomes 'exiting', wait for CSS animations/transitions to finish,\n // then call state.remove() to finalize removal from the queue.\n // In JSDOM or when no animations are running, remove immediately.\n // Reduced-motion is handled by CSS (shorter/no animations), so the lifecycle\n // naturally completes faster when the user prefers reduced motion.\n createEffect(() => {\n if (local.toast.animation !== \"exiting\") return;\n if (!toastRef) {\n state.remove(local.toast.key);\n return;\n }\n\n // Check if the element supports the Web Animations API\n if (!(\"getAnimations\" in toastRef)) {\n state.remove(local.toast.key);\n return;\n }\n\n const animations = toastRef.getAnimations();\n if (animations.length === 0) {\n // No CSS animations/transitions running - remove immediately\n state.remove(local.toast.key);\n return;\n }\n\n // Wait for all running animations to finish, then remove\n let canceled = false;\n Promise.all(animations.map((a) => a.finished))\n .then(() => {\n if (!canceled) {\n state.remove(local.toast.key);\n }\n })\n .catch(() => {\n // Animation was canceled (e.g. element removed) - still clean up\n if (!canceled) {\n state.remove(local.toast.key);\n }\n });\n\n onCleanup(() => {\n canceled = true;\n });\n });\n\n const { ref: _ref, ...cleanToastProps } = toastAria.toastProps as Record<string, unknown>;\n\n // Ensure ARIA title/description IDs and the content live-region attributes are\n // present on rendered sub-components, even when children are pre-composed outside\n // the Toast provider owner (as DefaultToast does), where useContext can't reach\n // this owner's ToastAriaContext.\n createEffect(() => {\n if (!toastRef) return;\n\n const titleId = (toastAria.titleProps as Record<string, unknown>).id as string | undefined;\n const descriptionId = (toastAria.descriptionProps as Record<string, unknown>).id as\n | string\n | undefined;\n const contentProps = toastAria.contentProps as Record<string, unknown>;\n\n if (titleId) {\n const titleEl = toastRef.querySelector(\"[data-solidaria-toast-title]\");\n if (titleEl instanceof HTMLElement) {\n titleEl.id = titleId;\n }\n }\n\n if (descriptionId) {\n const descriptionEl = toastRef.querySelector(\"[data-solidaria-toast-description]\");\n if (descriptionEl instanceof HTMLElement) {\n descriptionEl.id = descriptionId;\n }\n }\n\n // Wire the content area as a live region (role=\"alert\" / aria-live=\"assertive\")\n // so the toast message is announced to screen readers when it appears.\n const contentEl = toastRef.querySelector(\"[data-solidaria-toast-content]\");\n if (contentEl instanceof HTMLElement) {\n const role = contentProps.role as string | undefined;\n const ariaLive = contentProps[\"aria-live\"] as string | undefined;\n const ariaAtomic = contentProps[\"aria-atomic\"] as string | undefined;\n if (role) contentEl.setAttribute(\"role\", role);\n if (ariaLive) contentEl.setAttribute(\"aria-live\", ariaLive);\n if (ariaAtomic) contentEl.setAttribute(\"aria-atomic\", ariaAtomic);\n }\n });\n\n return (\n <ToastAriaContext.Provider\n value={{\n titleProps: toastAria.titleProps,\n descriptionProps: toastAria.descriptionProps,\n contentProps: toastAria.contentProps,\n }}\n >\n <div\n ref={toastRef}\n {...domProps()}\n {...cleanToastProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-animation={local.toast.animation}\n data-type={local.toast.content.type ?? local.toast.content.variant}\n data-variant={local.toast.content.variant}\n on:click={handleRootClick}\n >\n {renderProps.renderChildren()}\n </div>\n </ToastAriaContext.Provider>\n );\n}\n\nexport interface ToastTitleProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastTitle renders the toast title with proper accessibility attributes.\n */\nexport function ToastTitle(props: ToastTitleProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaTitleProps } = (context?.titleProps ?? {}) as Record<string, unknown>;\n\n // Upstream S2 Toast renders the title via `<Text slot=\"title\">`, and RAC `Text`\n // defaults to `elementType=\"span\"` — so the title's text-node container is a\n // `<span>`, not a `<div>`. Mirror that (the D7 contrast descriptor keys on the\n // container tag name; a `<div>` here diverged on every variant × theme). (parity rule #1/#2)\n return (\n <span data-solidaria-toast-title=\"\" {...ariaTitleProps} class={props.class} style={props.style}>\n {props.children}\n </span>\n );\n}\n\nexport interface ToastDescriptionProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastDescription renders the toast description with proper accessibility attributes.\n */\nexport function ToastDescription(props: ToastDescriptionProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaDescriptionProps } = (context?.descriptionProps ?? {}) as Record<\n string,\n unknown\n >;\n\n // Match the title: upstream toast text is rendered in `<span>` elements (RAC\n // `Text`). The port additionally supports a description (upstream S2 has only a\n // title); keep it as a `<span>` sibling so its text-node container tag is faithful.\n return (\n <span\n data-solidaria-toast-description=\"\"\n {...ariaDescriptionProps}\n class={props.class}\n style={props.style}\n >\n {props.children}\n </span>\n );\n}\n\nexport interface ToastContentProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastContent wraps the toast message (title + description) in the live region\n * announced to screen readers. It carries `role=\"alert\"` / `aria-live=\"assertive\"`\n * from createToast's contentProps so the toast text is announced when it appears.\n *\n * It is rendered as a sibling of the close button (never wrapping it) so screen\n * readers announce the message without reading the close button first.\n */\nexport function ToastContent(props: ToastContentProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaContentProps } = (context?.contentProps ?? {}) as Record<\n string,\n unknown\n >;\n\n return (\n <div\n data-solidaria-toast-content=\"\"\n {...ariaContentProps}\n class={props.class}\n style={props.style}\n >\n {props.children}\n </div>\n );\n}\n\nexport interface ToastCloseButtonProps {\n /** The toast to close. */\n toast: QueuedToast<ToastContent>;\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n \"aria-label\"?: string;\n}\n\n/**\n * ToastCloseButton is a button that closes the toast.\n */\nexport function ToastCloseButton(props: ToastCloseButtonProps): JSX.Element {\n const contextState = useContext(ToastContext);\n const handleClose = () => {\n const key = props.toast.key;\n const state = contextState ?? toastStateByKey.get(key);\n state?.close(key);\n state?.remove(key);\n };\n\n return (\n <button\n type=\"button\"\n class={props.class}\n style={props.style}\n aria-label={props[\"aria-label\"] ?? \"Close\"}\n data-solidaria-toast-close-button=\"\"\n on:click={handleClose}\n onClick={handleClose}\n >\n {props.children ?? \"×\"}\n </button>\n );\n}\n\nexport interface DefaultToastProps {\n toast: QueuedToast<ToastContent>;\n}\n\n/**\n * DefaultToast provides a basic toast layout with title, description, and close button.\n * Use this as a starting point or as-is for simple toast needs.\n */\nexport function DefaultToast(props: DefaultToastProps): JSX.Element {\n const content = () => props.toast.content;\n const title = () => content().children ?? content().title;\n const actionLabel = () => content().actionLabel ?? content().action?.label;\n const actionHandler = () => content().onAction ?? content().action?.onAction;\n const state = useToastContext();\n const handleAction = () => {\n actionHandler()?.();\n if (content().shouldCloseOnAction) {\n state.close(props.toast.key);\n state.remove(props.toast.key);\n }\n };\n\n return (\n <Toast toast={props.toast}>\n <div style={{ display: \"flex\", \"align-items\": \"flex-start\", gap: \"12px\" }}>\n <ToastContent style={{ flex: 1 }}>\n <Show when={title()}>\n <ToastTitle style={{ \"font-weight\": \"bold\", \"margin-bottom\": \"4px\" }}>\n {title()}\n </ToastTitle>\n </Show>\n <Show when={content().description}>\n <ToastDescription>{content().description}</ToastDescription>\n </Show>\n <Show when={actionLabel()}>\n <button type=\"button\" style={{ \"margin-top\": \"8px\" }} onClick={handleAction}>\n {actionLabel()}\n </button>\n </Show>\n </ToastContent>\n <ToastCloseButton toast={props.toast} />\n </div>\n </Toast>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAgIA,MAAaqD,eAAenD,cAA+C,IAAI;AAQ/E,MAAM0D,mBAAmB1D,cAA4C,IAAI;AACzE,MAAM2D,kCAAkB,IAAIC,IAAsC;AAElE,SAAgBC,kBAA4C;CAC1D,MAAMC,UAAUvD,WAAW4C,YAAY;CACvC,IAAI,CAACW,SACH,MAAM,IAAIC,MAAM,sDAAsD;CAExE,OAAOD;AACT;;AAGA,MAAaE,mBAAmB,IAAInD,WAAyB;CAC3DoD,kBAAkBC;CAClBC,kBAAkB;AACpB,CAAC;;;;;AAMD,SAAgBC,SAASC,SAAuBC,SAAgC;CAC9E,OAAON,iBAAiBO,IAAIF,SAASC,OAAO;AAC9C;AAEA,SAASE,wBAAwBvB,WAA2C;CAC1E,QAAQA,aAAa,SAAA,CAAUwB,QAAQ,KAAK,GAAG;AACjD;;;;;;;;;;;;;AAuBA,SAAgBM,cAAcC,OAAwC;CAKpE,MAAMjC,QAAQjC,iBAAiB,EAAEmE,OAJnBD,MAAMF,iBAChBd,mBACA,IAAInD,WAAyBmE,MAAMH,YAAY,EAEZ,CAAC;CAExC,OAAAK,gBAAQ/B,aAAagC,UAAQ;EAACC,OAAOrC;EAAK,IAAApB,WAAA;GAAA,OAAGqD,MAAMrD;EAAQ;CAAA,CAAA;AAC7D;;;;;;;;;;;;;;;;AAiBA,SAAgB0D,YAAYL,OAAsC;CAIhE,MAAMM,aAAa/D,cAAc;CAEjC,MAAM,CAACgE,OAAOC,QAAQnF,WAAW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CAAA,CAAA;AAI5C;AAACc,eAAA,CAAA,OAAA,CAAA"}
1
+ {"version":3,"file":"Toast.js","names":["<ToastContext value={state}>{props.children}</ToastContext>","value={state}","ref={setRegionElement}","{renderProps.renderChildren()}","<div\n ref={setRegionElement}\n {...domProps()}\n {...cleanRegionProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-placement={normalizedPlacement()}\n >\n {renderProps.renderChildren()}\n </div>","<Show when={isHydrated() && hasToasts()}>\n <Show when={local.portal !== false} fallback={regionContent()}>\n <Portal mount={portalContainer()}>{regionContent()}</Portal>\n </Show>\n </Show>","isHydrated() && hasToasts()","<Show when={local.portal !== false} fallback={regionContent()}>\n <Portal mount={portalContainer()}>{regionContent()}</Portal>\n </Show>","<Portal mount={portalContainer()}>{regionContent()}</Portal>","<ToastAriaContext\n value={{\n titleProps: toastAria.titleProps,\n descriptionProps: toastAria.descriptionProps,\n contentProps: toastAria.contentProps,\n }}\n >\n <div\n ref={setToastEl}\n {...domProps()}\n {...cleanToastProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-animation={local.toast.animation}\n data-type={local.toast.content.type ?? local.toast.content.variant}\n data-variant={local.toast.content.variant}\n onClick={handleRootClick}\n >\n <Provider\n values={\n [\n [ToastContentContext, toastAria.contentProps],\n [\n TextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n get title() {\n return toastAria.titleProps;\n },\n get description() {\n return toastAria.descriptionProps;\n },\n },\n },\n ],\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n close: {\n onPress: () => {\n state.close(local.toast.key);\n state.remove(local.toast.key);\n },\n \"aria-label\": (toastAria.closeButtonProps as Record<string, unknown>)[\n \"aria-label\"\n ],\n },\n },\n },\n ],\n ] as Array<[Context<unknown>, unknown]>\n }\n >\n {renderProps.renderChildren()}\n </Provider>\n </div>\n </ToastAriaContext>","ref={setToastEl}","onClick={handleRootClick}","<Provider\n values={\n [\n [ToastContentContext, toastAria.contentProps],\n [\n TextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n get title() {\n return toastAria.titleProps;\n },\n get description() {\n return toastAria.descriptionProps;\n },\n },\n },\n ],\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n close: {\n onPress: () => {\n state.close(local.toast.key);\n state.remove(local.toast.key);\n },\n \"aria-label\": (toastAria.closeButtonProps as Record<string, unknown>)[\n \"aria-label\"\n ],\n },\n },\n },\n ],\n ] as Array<[Context<unknown>, unknown]>\n }\n >\n {renderProps.renderChildren()}\n </Provider>","<div\n ref={setToastEl}\n {...domProps()}\n {...cleanToastProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-animation={local.toast.animation}\n data-type={local.toast.content.type ?? local.toast.content.variant}\n data-variant={local.toast.content.variant}\n onClick={handleRootClick}\n >\n <Provider\n values={\n [\n [ToastContentContext, toastAria.contentProps],\n [\n TextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n get title() {\n return toastAria.titleProps;\n },\n get description() {\n return toastAria.descriptionProps;\n },\n },\n },\n ],\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n close: {\n onPress: () => {\n state.close(local.toast.key);\n state.remove(local.toast.key);\n },\n \"aria-label\": (toastAria.closeButtonProps as Record<string, unknown>)[\n \"aria-label\"\n ],\n },\n },\n },\n ],\n ] as Array<[Context<unknown>, unknown]>\n }\n >\n {renderProps.renderChildren()}\n </Provider>\n </div>","{props.children}","<span data-solidaria-toast-title=\"\" {...ariaTitleProps} class={props.class} style={props.style}>\n {props.children}\n </span>","<span\n data-solidaria-toast-description=\"\"\n {...ariaDescriptionProps}\n class={props.class}\n style={props.style}\n >\n {props.children}\n </span>","{local.children}","<div data-solidaria-toast-content=\"\" {...rest} class={local.class} style={local.style}>\n {local.children}\n </div>","style={props.style}","aria-label={props[\"aria-label\"] ?? \"Close\"}","<button\n type=\"button\"\n class={props.class}\n style={props.style}\n aria-label={props[\"aria-label\"] ?? \"Close\"}\n data-solidaria-toast-close-button=\"\"\n onClick={handleClose}\n >\n {props.children ?? \"×\"}\n </button>","<Toast toast={props.toast}>\n <div style={{ display: \"flex\", \"align-items\": \"flex-start\", gap: \"12px\" }}>\n <ToastContent style={{ flex: 1 }}>\n <Show when={title()}>\n <ToastTitle style={{ \"font-weight\": \"bold\", \"margin-bottom\": \"4px\" }}>\n {title()}\n </ToastTitle>\n </Show>\n <Show when={content().description}>\n <ToastDescription>{content().description}</ToastDescription>\n </Show>\n <Show when={actionLabel()}>\n <button type=\"button\" style={{ \"margin-top\": \"8px\" }} onClick={handleAction}>\n {actionLabel()}\n </button>\n </Show>\n </ToastContent>\n <ToastCloseButton toast={props.toast} />\n </div>\n </Toast>","<ToastContent style={{ flex: 1 }}>\n <Show when={title()}>\n <ToastTitle style={{ \"font-weight\": \"bold\", \"margin-bottom\": \"4px\" }}>\n {title()}\n </ToastTitle>\n </Show>\n <Show when={content().description}>\n <ToastDescription>{content().description}</ToastDescription>\n </Show>\n <Show when={actionLabel()}>\n <button type=\"button\" style={{ \"margin-top\": \"8px\" }} onClick={handleAction}>\n {actionLabel()}\n </button>\n </Show>\n </ToastContent>","style={{ flex: 1 }}","<Show when={title()}>\n <ToastTitle style={{ \"font-weight\": \"bold\", \"margin-bottom\": \"4px\" }}>\n {title()}\n </ToastTitle>\n </Show>","<ToastTitle style={{ \"font-weight\": \"bold\", \"margin-bottom\": \"4px\" }}>\n {title()}\n </ToastTitle>","style={{ \"font-weight\": \"bold\", \"margin-bottom\": \"4px\" }}","<Show when={content().description}>\n <ToastDescription>{content().description}</ToastDescription>\n </Show>","<ToastDescription>{content().description}</ToastDescription>","<Show when={actionLabel()}>\n <button type=\"button\" style={{ \"margin-top\": \"8px\" }} onClick={handleAction}>\n {actionLabel()}\n </button>\n </Show>","{actionLabel()}","<button type=\"button\" style={{ \"margin-top\": \"8px\" }} onClick={handleAction}>\n {actionLabel()}\n </button>","<div style={{ display: \"flex\", \"align-items\": \"flex-start\", gap: \"12px\" }}>\n <ToastContent style={{ flex: 1 }}>\n <Show when={title()}>\n <ToastTitle style={{ \"font-weight\": \"bold\", \"margin-bottom\": \"4px\" }}>\n {title()}\n </ToastTitle>\n </Show>\n <Show when={content().description}>\n <ToastDescription>{content().description}</ToastDescription>\n </Show>\n <Show when={actionLabel()}>\n <button type=\"button\" style={{ \"margin-top\": \"8px\" }} onClick={handleAction}>\n {actionLabel()}\n </button>\n </Show>\n </ToastContent>\n <ToastCloseButton toast={props.toast} />\n </div>","<ToastCloseButton toast={props.toast} />"],"sources":["../src/Toast.tsx"],"sourcesContent":["/*\n * Copyright 2025 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/Toast.tsx\n\n/**\n * Toast components for solidaria-components\n *\n * Toast notifications with auto-dismiss, pause on hover/focus, and accessibility.\n * Port of react-aria-components Toast.\n */\n\nimport {\n createContext,\n createMemo,\n createEffect,\n createRenderEffect,\n createSignal,\n onCleanup,\n Show,\n useContext,\n createTrackedEffect,\n} from \"solid-js\";\nimport type { Accessor, Context } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { Portal } from \"@solidjs/web\";\nimport {\n type ToastState,\n type QueuedToast,\n type ToastQueueOptions,\n type ToastOptions,\n ToastQueue,\n createToastState,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n createToast,\n createToastRegion,\n useUNSAFE_PortalContext,\n} from \"@proyecto-viviana/solidaria\";\nimport { ButtonContext } from \"./Button\";\nimport { TextContext } from \"./Text\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\nimport {\n type ContextValue,\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n DEFAULT_SLOT,\n Provider,\n useContextProps,\n useRenderProps,\n filterDOMProps,\n useIsHydrated,\n} from \"./utils\";\n\nexport interface ToastContent {\n /** DOM id for the toast root when content is queued through Spectrum ToastQueue. */\n id?: string;\n /** Data attributes for the toast root when content is queued through Spectrum ToastQueue. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n /** Spectrum Toast message content. */\n children?: string;\n /** The title of the toast. */\n title?: string;\n /** The description/body of the toast. */\n description?: string;\n /** Spectrum variant. */\n variant?: \"info\" | \"positive\" | \"negative\" | \"neutral\";\n /** Backward-compatible type/variant of the toast. */\n type?: \"info\" | \"success\" | \"warning\" | \"error\" | \"positive\" | \"negative\" | \"neutral\";\n /** Spectrum action button label. */\n actionLabel?: string;\n /** Handler called when the Spectrum action button is pressed. */\n onAction?: () => void;\n /** Whether the toast should close when the Spectrum action is performed. */\n shouldCloseOnAction?: boolean;\n /** Custom action button. */\n action?: {\n label: string;\n onAction: () => void;\n };\n}\n\nexport interface ToastRenderProps {\n /** Whether the toast is currently animating in. */\n isEntering: boolean;\n /** Whether the toast is currently animating out. */\n isExiting: boolean;\n /** The animation state (entering, exiting, queued). */\n animation: \"entering\" | \"exiting\" | \"queued\" | undefined;\n /** The toast data. */\n toast: QueuedToast<ToastContent>;\n}\n\nexport interface ToastRegionRenderProps {\n /** The visible toasts. */\n visibleToasts: Accessor<QueuedToast<ToastContent>[]>;\n}\n\nexport interface ToastRegionProps {\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ToastRegionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToastRegionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToastRegionRenderProps>;\n /** The toast state to display. If not provided, uses ToastContext. */\n state?: ToastState<ToastContent>;\n /** Accessible label for the region. */\n \"aria-label\"?: string;\n /** Whether to render in a portal. */\n portal?: boolean;\n /** Placement of the toast region. */\n placement?:\n | \"top\"\n | \"top start\"\n | \"top end\"\n | \"top-start\"\n | \"top-end\"\n | \"bottom\"\n | \"bottom start\"\n | \"bottom end\"\n | \"bottom-start\"\n | \"bottom-end\";\n}\n\nexport interface ToastProps {\n /** DOM id for the toast root. */\n id?: string;\n /** Data attributes for the toast root. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n /** The toast data. */\n toast: QueuedToast<ToastContent>;\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ToastRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToastRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToastRenderProps>;\n}\n\nexport const ToastContext = createContext<ToastState<ToastContent> | null>(null);\n\ninterface ToastAriaContextValue {\n titleProps: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n contentProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\nconst ToastAriaContext = createContext<ToastAriaContextValue | null>(null);\nexport const ToastContentContext = createContext<ContextValue<ToastContentProps, HTMLDivElement>>(\n {},\n);\nconst toastStateByKey = new Map<string, ToastState<ToastContent>>();\n\nexport function useToastContext(): ToastState<ToastContent> {\n const context = useContext(ToastContext);\n if (!context) {\n throw new Error(\"Toast components must be used within a ToastProvider\");\n }\n return context;\n}\n\n/** Default global toast queue that can be used for app-wide toasts. */\nexport const globalToastQueue = new ToastQueue<ToastContent>({\n maxVisibleToasts: Infinity,\n hasExitAnimation: true,\n});\n\n/**\n * Add a toast to the global queue.\n * Convenience function for adding toasts from anywhere in the app.\n */\nexport function addToast(content: ToastContent, options?: ToastOptions): string {\n return globalToastQueue.add(content, options);\n}\n\nfunction normalizeToastPlacement(placement?: ToastRegionProps[\"placement\"]) {\n return (placement ?? \"bottom\").replace(\"-\", \" \") as NonNullable<ToastRegionProps[\"placement\"]>;\n}\n\nexport interface ToastProviderProps {\n /** The children of the provider. */\n children: JSX.Element;\n /** Custom toast queue options. */\n queueOptions?: ToastQueueOptions;\n /** Use global queue instead of creating a new one. */\n useGlobalQueue?: boolean;\n}\n\n/**\n * ToastProvider creates a toast queue context for descendant components.\n * Use this to wrap your app or a section that needs toast notifications.\n *\n * @example\n * ```tsx\n * <ToastProvider>\n * <App />\n * <ToastRegion />\n * </ToastProvider>\n * ```\n */\nexport function ToastProvider(props: ToastProviderProps): JSX.Element {\n const queue = props.useGlobalQueue\n ? globalToastQueue\n : new ToastQueue<ToastContent>(props.queueOptions);\n\n const state = createToastState({ queue });\n\n return <ToastContext value={state}>{props.children}</ToastContext>;\n}\n\n/**\n * ToastRegion is a container that displays all visible toasts.\n * It handles pause on hover/focus and provides the landmark region.\n *\n * @example\n * ```tsx\n * <ToastRegion placement=\"bottom-end\">\n * {(renderProps) => (\n * <For each={renderProps.visibleToasts}>\n * {(toast) => <Toast toast={toast} />}\n * </For>\n * )}\n * </ToastRegion>\n * ```\n */\nexport function ToastRegion(props: ToastRegionProps): JSX.Element {\n // Do NOT early-return on the server: returning null on the server and a <Show>\n // on the client desyncs hydration when the region is in the SSR tree. Render the\n // same structure on both and gate the Portal on useIsHydrated() (see Popover).\n const isHydrated = useIsHydrated();\n\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"state\",\n \"aria-label\",\n \"portal\",\n \"placement\",\n ]);\n const portalContext = useUNSAFE_PortalContext();\n const portalContainer = () => portalContext.getContainer?.() ?? undefined;\n const [regionElement, setRegionElement] = createSignal<HTMLElement>();\n\n const contextState = useContext(ToastContext);\n const state = () => local.state ?? contextState;\n\n const regionAria = createToastRegion<ToastContent>({\n state: {\n visibleToasts: () => state()?.visibleToasts() ?? [],\n add: (content, options) => state()?.add(content, options) ?? \"\",\n close: (key) => state()?.close(key),\n remove: (key) => state()?.remove(key),\n clear: () => state()?.clear(),\n pauseAll: () => state()?.pauseAll(),\n resumeAll: () => state()?.resumeAll(),\n },\n ref: regionElement,\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n });\n\n const renderValues = createMemo<ToastRegionRenderProps>(() => ({\n visibleToasts: () => state()?.visibleToasts() ?? [],\n }));\n\n const renderProps = useRenderProps(\n {\n // Lazy: the region content is gated behind `<Show when={isHydrated() && …}>`\n // (Portal) below, so reading children must not instantiate templates during\n // the component body (would walk getNextElement before the gate the server\n // kept closed → hydration mismatch). See Popover for the full rationale.\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ToastRegion\",\n },\n renderValues,\n );\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const placementStyles = createMemo<JSX.CSSProperties>(() => {\n const placement = normalizeToastPlacement(local.placement);\n const [edge, align = \"center\"] = placement.split(\" \");\n const base: JSX.CSSProperties = {\n position: \"fixed\",\n \"z-index\": 100001,\n display: \"flex\",\n \"flex-direction\": edge === \"top\" ? \"column\" : \"column-reverse\",\n gap: \"8px\",\n padding: \"16px\",\n \"pointer-events\": \"none\",\n };\n\n if (edge === \"top\") {\n if (align === \"end\") {\n return { ...base, top: \"16px\", right: \"16px\" } as JSX.CSSProperties;\n }\n if (align === \"start\") {\n return { ...base, top: \"16px\", left: \"16px\" } as JSX.CSSProperties;\n }\n return {\n ...base,\n top: \"16px\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n } as JSX.CSSProperties;\n }\n\n if (align === \"end\") {\n return { ...base, bottom: \"16px\", right: \"16px\" } as JSX.CSSProperties;\n }\n if (align === \"start\") {\n return { ...base, bottom: \"16px\", left: \"16px\" } as JSX.CSSProperties;\n }\n return {\n ...base,\n bottom: \"16px\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n } as JSX.CSSProperties;\n });\n\n const normalizedPlacement = () => normalizeToastPlacement(local.placement);\n\n const visibleToasts = () => state()?.visibleToasts() ?? [];\n const hasToasts = () => visibleToasts().length > 0;\n const hasAuthoredRegionStyle = () => local.class != null || local.style != null;\n\n const regionContent = () => {\n if (!state()) return null;\n\n const mergedStyle = () => {\n const custom = renderProps.style();\n // React Aria Components leaves ToastRegion unstyled. Keep this package's\n // fallback placement only for bare regions so styled layers such as S2 can\n // own fixed viewport geometry with their generated classes.\n if (hasAuthoredRegionStyle()) return custom;\n\n const placement = placementStyles();\n if (!custom) return placement;\n return { ...placement, ...custom } as JSX.CSSProperties;\n };\n\n const { ref: _ref, ...cleanRegionProps } = regionAria.regionProps as Record<string, unknown>;\n\n return (\n <div\n ref={setRegionElement}\n {...domProps()}\n {...cleanRegionProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-placement={normalizedPlacement()}\n >\n {renderProps.renderChildren()}\n </div>\n );\n };\n\n return (\n <Show when={isHydrated() && hasToasts()}>\n <Show when={local.portal !== false} fallback={regionContent()}>\n <Portal mount={portalContainer()}>{regionContent()}</Portal>\n </Show>\n </Show>\n );\n}\n\n/**\n * Toast is an individual notification component.\n *\n * @example\n * ```tsx\n * <Toast toast={toast}>\n * {(renderProps) => (\n * <div class={renderProps.isExiting ? 'fade-out' : 'fade-in'}>\n * <h3>{renderProps.toast.content.title}</h3>\n * <p>{renderProps.toast.content.description}</p>\n * </div>\n * )}\n * </Toast>\n * ```\n */\nexport function Toast(props: ToastProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"toast\", \"children\", \"class\", \"style\"]);\n\n const [toastEl, setToastEl] = createSignal<HTMLDivElement | null>(null);\n\n const state = useToastContext();\n\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n const key = local.toast.key;\n toastStateByKey.set(key, state);\n _s2Cleanups.push(() => {\n if (toastStateByKey.get(key) === state) {\n toastStateByKey.delete(key);\n }\n });\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n const hasTitle = () => !!(local.toast.content.children ?? local.toast.content.title);\n const toastAria = createToast({\n toast: local.toast,\n state,\n hasTitle: hasTitle(),\n hasDescription: !!local.toast.content.description,\n });\n\n const renderValues = createMemo<ToastRenderProps>(() => ({\n isEntering: local.toast.animation === \"entering\",\n isExiting: local.toast.animation === \"exiting\",\n animation: local.toast.animation,\n toast: local.toast,\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-Toast\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const mergedStyle = () => {\n const custom = renderProps.style();\n if (!custom) return { \"pointer-events\": \"auto\" as const };\n return { \"pointer-events\": \"auto\" as const, ...custom } as JSX.CSSProperties;\n };\n\n const handleRootClick = (event: MouseEvent) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n if (target.closest(\"[data-solidaria-toast-close-button]\")) {\n state.close(local.toast.key);\n state.remove(local.toast.key);\n }\n };\n\n // Exit animation lifecycle:\n // When animation becomes 'exiting', wait for CSS animations/transitions to finish,\n // then call state.remove() to finalize removal from the queue.\n // In JSDOM or when no animations are running, remove immediately.\n // Reduced-motion is handled by CSS (shorter/no animations), so the lifecycle\n // naturally completes faster when the user prefers reduced motion.\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n if (local.toast.animation !== \"exiting\") return;\n const toastRef = toastEl();\n if (!toastRef) {\n state.remove(local.toast.key);\n return;\n }\n\n // Check if the element supports the Web Animations API\n if (!(\"getAnimations\" in toastRef)) {\n state.remove(local.toast.key);\n return;\n }\n\n const animations = toastRef.getAnimations();\n if (animations.length === 0) {\n // No CSS animations/transitions running - remove immediately\n state.remove(local.toast.key);\n return;\n }\n\n // Wait for all running animations to finish, then remove\n let canceled = false;\n Promise.all(animations.map((a) => a.finished))\n .then(() => {\n if (!canceled) {\n state.remove(local.toast.key);\n }\n })\n .catch(() => {\n // Animation was canceled (e.g. element removed) - still clean up\n if (!canceled) {\n state.remove(local.toast.key);\n }\n });\n\n _s2Cleanups.push(() => {\n canceled = true;\n });\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n const { ref: _ref, ...cleanToastProps } = toastAria.toastProps as Record<string, unknown>;\n\n // Apply title/description ids and content live-region attributes onto\n // descendants that opted in via data-solidaria-toast-* (S2 used a raw\n // content div before ToastContent). Signal ref + createRenderEffect so\n // a first-run null ref still reapplies after mount, before paint.\n createRenderEffect(\n () => {\n const toastRef = toastEl();\n const titleId = (toastAria.titleProps as Record<string, unknown>).id as string | undefined;\n const descriptionId = (toastAria.descriptionProps as Record<string, unknown>).id as\n | string\n | undefined;\n const contentProps = toastAria.contentProps as Record<string, unknown>;\n return { toastRef, titleId, descriptionId, contentProps };\n },\n ({ toastRef, titleId, descriptionId, contentProps }) => {\n if (!toastRef) return;\n\n if (titleId) {\n const titleEl = toastRef.querySelector(\"[data-solidaria-toast-title]\");\n if (titleEl instanceof HTMLElement) {\n titleEl.id = titleId;\n }\n }\n\n if (descriptionId) {\n const descriptionEl = toastRef.querySelector(\"[data-solidaria-toast-description]\");\n if (descriptionEl instanceof HTMLElement) {\n descriptionEl.id = descriptionId;\n }\n }\n\n const contentEl = toastRef.querySelector(\"[data-solidaria-toast-content]\");\n if (contentEl instanceof HTMLElement) {\n const role = contentProps.role as string | undefined;\n const ariaAtomic = contentProps[\"aria-atomic\"] as string | undefined;\n const ariaHidden = contentProps[\"aria-hidden\"] as string | undefined;\n if (role) contentEl.setAttribute(\"role\", role);\n if (ariaAtomic) contentEl.setAttribute(\"aria-atomic\", ariaAtomic);\n if (ariaHidden) contentEl.setAttribute(\"aria-hidden\", ariaHidden);\n else contentEl.removeAttribute(\"aria-hidden\");\n }\n },\n );\n\n return (\n <ToastAriaContext\n value={{\n titleProps: toastAria.titleProps,\n descriptionProps: toastAria.descriptionProps,\n contentProps: toastAria.contentProps,\n }}\n >\n <div\n ref={setToastEl}\n {...domProps()}\n {...cleanToastProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-animation={local.toast.animation}\n data-type={local.toast.content.type ?? local.toast.content.variant}\n data-variant={local.toast.content.variant}\n onClick={handleRootClick}\n >\n <Provider\n values={\n [\n [ToastContentContext, toastAria.contentProps],\n [\n TextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n get title() {\n return toastAria.titleProps;\n },\n get description() {\n return toastAria.descriptionProps;\n },\n },\n },\n ],\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n close: {\n onPress: () => {\n state.close(local.toast.key);\n state.remove(local.toast.key);\n },\n \"aria-label\": (toastAria.closeButtonProps as Record<string, unknown>)[\n \"aria-label\"\n ],\n },\n },\n },\n ],\n ] as Array<[Context<unknown>, unknown]>\n }\n >\n {renderProps.renderChildren()}\n </Provider>\n </div>\n </ToastAriaContext>\n );\n}\n\nexport interface ToastTitleProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastTitle renders the toast title with proper accessibility attributes.\n */\nexport function ToastTitle(props: ToastTitleProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaTitleProps } = (context?.titleProps ?? {}) as Record<string, unknown>;\n\n // Upstream S2 Toast renders the title via `<Text slot=\"title\">`, and RAC `Text`\n // defaults to `elementType=\"span\"` — so the title's text-node container is a\n // `<span>`, not a `<div>`. Mirror that (the D7 contrast descriptor keys on the\n // container tag name; a `<div>` here diverged on every variant × theme). (parity rule #1/#2)\n return (\n <span data-solidaria-toast-title=\"\" {...ariaTitleProps} class={props.class} style={props.style}>\n {props.children}\n </span>\n );\n}\n\nexport interface ToastDescriptionProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastDescription renders the toast description with proper accessibility attributes.\n */\nexport function ToastDescription(props: ToastDescriptionProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaDescriptionProps } = (context?.descriptionProps ?? {}) as Record<\n string,\n unknown\n >;\n\n // Match the title: upstream toast text is rendered in `<span>` elements (RAC\n // `Text`). The port additionally supports a description (upstream S2 has only a\n // title); keep it as a `<span>` sibling so its text-node container tag is faithful.\n return (\n <span\n data-solidaria-toast-description=\"\"\n {...ariaDescriptionProps}\n class={props.class}\n style={props.style}\n >\n {props.children}\n </span>\n );\n}\n\nexport interface ToastContentProps extends JSX.HTMLAttributes<HTMLDivElement>, SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastContent wraps the toast message (title + description) in the live region\n * announced to screen readers. It consumes RAC ToastContentContext (role=\"alert\",\n * aria-atomic, aria-hidden until mounted) so the toast text is announced when\n * it appears.\n *\n * It is rendered as a sibling of the close button (never wrapping it) so screen\n * readers announce the message without reading the close button first.\n */\nexport function ToastContent(props: ToastContentProps): JSX.Element {\n const [merged] = useContextProps(props, undefined, ToastContentContext);\n const [local, rest] = splitProps(merged, [\"class\", \"style\", \"children\", \"slot\", \"ref\"]);\n\n return (\n <div data-solidaria-toast-content=\"\" {...rest} class={local.class} style={local.style}>\n {local.children}\n </div>\n );\n}\n\nexport interface ToastCloseButtonProps {\n /** The toast to close. */\n toast: QueuedToast<ToastContent>;\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n \"aria-label\"?: string;\n}\n\n/**\n * ToastCloseButton is a button that closes the toast.\n */\nexport function ToastCloseButton(props: ToastCloseButtonProps): JSX.Element {\n const contextState = useContext(ToastContext);\n const handleClose = () => {\n const key = props.toast.key;\n const state = contextState ?? toastStateByKey.get(key);\n state?.close(key);\n state?.remove(key);\n };\n\n return (\n <button\n type=\"button\"\n class={props.class}\n style={props.style}\n aria-label={props[\"aria-label\"] ?? \"Close\"}\n data-solidaria-toast-close-button=\"\"\n onClick={handleClose}\n >\n {props.children ?? \"×\"}\n </button>\n );\n}\n\nexport interface DefaultToastProps {\n toast: QueuedToast<ToastContent>;\n}\n\n/**\n * DefaultToast provides a basic toast layout with title, description, and close button.\n * Use this as a starting point or as-is for simple toast needs.\n */\nexport function DefaultToast(props: DefaultToastProps): JSX.Element {\n const content = () => props.toast.content;\n const title = () => content().children ?? content().title;\n const actionLabel = () => content().actionLabel ?? content().action?.label;\n const actionHandler = () => content().onAction ?? content().action?.onAction;\n const state = useToastContext();\n const handleAction = () => {\n actionHandler()?.();\n if (content().shouldCloseOnAction) {\n state.close(props.toast.key);\n state.remove(props.toast.key);\n }\n };\n\n return (\n <Toast toast={props.toast}>\n <div style={{ display: \"flex\", \"align-items\": \"flex-start\", gap: \"12px\" }}>\n <ToastContent style={{ flex: 1 }}>\n <Show when={title()}>\n <ToastTitle style={{ \"font-weight\": \"bold\", \"margin-bottom\": \"4px\" }}>\n {title()}\n </ToastTitle>\n </Show>\n <Show when={content().description}>\n <ToastDescription>{content().description}</ToastDescription>\n </Show>\n <Show when={actionLabel()}>\n <button type=\"button\" style={{ \"margin-top\": \"8px\" }} onClick={handleAction}>\n {actionLabel()}\n </button>\n </Show>\n </ToastContent>\n <ToastCloseButton toast={props.toast} />\n </div>\n </Toast>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuJA,MAAa,eAAe,cAA+C,IAAI;AAQ/E,MAAM,mBAAmB,cAA4C,IAAI;AACzE,MAAa,sBAAsB,cACjC,CAAC,CACH;AACA,MAAM,kCAAkB,IAAI,IAAsC;AAElE,SAAgB,kBAA4C;CAC1D,MAAM,UAAU,WAAW,YAAY;CACvC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,sDAAsD;CAExE,OAAO;AACT;;AAGA,MAAa,mBAAmB,IAAI,WAAyB;CAC3D,kBAAkB;CAClB,kBAAkB;AACpB,CAAC;;;;;AAMD,SAAgB,SAAS,SAAuB,SAAgC;CAC9E,OAAO,iBAAiB,IAAI,SAAS,OAAO;AAC9C;AAEA,SAAS,wBAAwB,WAA2C;CAC1E,QAAQ,aAAa,SAAA,CAAU,QAAQ,KAAK,GAAG;AACjD;;;;;;;;;;;;;AAuBA,SAAgB,cAAc,OAAwC;CACpE,MAAM,QAAQ,MAAM,iBAChB,mBACA,IAAI,WAAyB,MAAM,YAAY;CAEnD,MAAM,QAAQ,iBAAiB,EAAE,MAA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G,OAAA,MAAM;SACG;;OACR;;MACNC,gBAAAA,MAAAA;OAAM,IAAA,OAAA;QAAM,OAAA,QAAQ,CAAC,CAAC;OAAW;OAAjC,IAAA,WAAA;QACEC,OAAAA,gBAAAA,kBAAAA,EAAAA,IAAAA,WAAAA;SAAmB,OAAA,QAAQ,CAAC,CAAC;QAA8B,EAAA,CAAA;OACvD;;MACNC,gBAAAA,MAAAA;OAAM,IAAA,OAAA;QAAM,OAAA,YAAY;OAAC;OAAzB,IAAA,WAAA;QACE,IAAA,QAAA,eAAA,OAEQ;QAF8C,MAAA,WAAS;QAA/D,OAAA,OACEC,YAAAA;SAAC,OAAA,YAAa;QACR,CAAA,CAAA;QAFR,mBAEQ;QAHV,OACEC;OAGI;;KAZP;IAaa;GAfhBC,CAAAA,GAAAA,QAAAA,MAiBK;GAjBL,OAAA,OAgBEC,gBAAAA,kBAAAA,EAAkB,IAAA,QAAA;IAAO,OAAA,MAAM;GAAK,EAAG,CAAA,GAhBzCD,QAAAA,MAiBK;GAlBP,OACEA;EAkBK;;AAEX"}
package/dist/Toast.jsx CHANGED
@@ -1,7 +1,22 @@
1
- import { filterDOMProps, useIsHydrated, useRenderProps } from "./utils.jsx";
2
- import { Show, createContext, createEffect, createMemo, createSignal, onCleanup, splitProps, useContext } from "solid-js";
3
- import { Portal } from "solid-js/web";
1
+ /*
2
+ * Copyright 2025 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/Toast.tsx
13
+ import { DEFAULT_SLOT, Provider, filterDOMProps, useContextProps, useIsHydrated, useRenderProps } from "./utils.jsx";
14
+ import { ButtonContext } from "./Button.jsx";
15
+ import { TextContext } from "./Text.jsx";
16
+ import { Show, createContext, createMemo, createRenderEffect, createSignal, createTrackedEffect, useContext } from "solid-js";
17
+ import { Portal } from "@solidjs/web";
4
18
  import { createToast, createToastRegion, useUNSAFE_PortalContext } from "@proyecto-viviana/solidaria";
19
+ import { splitProps } from "@proyecto-viviana/solidaria/utils";
5
20
  import { ToastQueue, createToastState } from "@proyecto-viviana/solid-stately";
6
21
  //#region src/Toast.tsx
7
22
  /**
@@ -12,6 +27,7 @@ import { ToastQueue, createToastState } from "@proyecto-viviana/solid-stately";
12
27
  */
13
28
  const ToastContext = createContext(null);
14
29
  const ToastAriaContext = createContext(null);
30
+ const ToastContentContext = createContext({});
15
31
  const toastStateByKey = /* @__PURE__ */ new Map();
16
32
  function useToastContext() {
17
33
  const context = useContext(ToastContext);
@@ -46,8 +62,9 @@ function normalizeToastPlacement(placement) {
46
62
  * ```
47
63
  */
48
64
  function ToastProvider(props) {
49
- const state = createToastState({ queue: props.useGlobalQueue ? globalToastQueue : new ToastQueue(props.queueOptions) });
50
- return <ToastContext.Provider value={state}>{props.children}</ToastContext.Provider>;
65
+ const queue = props.useGlobalQueue ? globalToastQueue : new ToastQueue(props.queueOptions);
66
+ const state = createToastState({ queue });
67
+ return <ToastContext value={state}>{props.children}</ToastContext>;
51
68
  }
52
69
  /**
53
70
  * ToastRegion is a container that displays all visible toasts.
@@ -200,14 +217,18 @@ function Toast(props) {
200
217
  "class",
201
218
  "style"
202
219
  ]);
203
- let toastRef;
220
+ const [toastEl, setToastEl] = createSignal(null);
204
221
  const state = useToastContext();
205
- createEffect(() => {
222
+ createTrackedEffect(() => {
223
+ const _s2Cleanups = [];
206
224
  const key = local.toast.key;
207
225
  toastStateByKey.set(key, state);
208
- onCleanup(() => {
226
+ _s2Cleanups.push(() => {
209
227
  if (toastStateByKey.get(key) === state) toastStateByKey.delete(key);
210
228
  });
229
+ return () => {
230
+ for (const c of _s2Cleanups) c();
231
+ };
211
232
  });
212
233
  const hasTitle = () => !!(local.toast.content.children ?? local.toast.content.title);
213
234
  const toastAria = createToast({
@@ -247,21 +268,97 @@ function Toast(props) {
247
268
  state.remove(local.toast.key);
248
269
  }
249
270
  };
250
- createEffect(() => {
271
+ createTrackedEffect(() => {
272
+ const _s2Cleanups = [];
251
273
  if (local.toast.animation !== "exiting") return;
252
- state.remove(local.toast.key);
274
+ const toastRef = toastEl();
275
+ if (!toastRef) {
276
+ state.remove(local.toast.key);
277
+ return;
278
+ }
279
+ if (!("getAnimations" in toastRef)) {
280
+ state.remove(local.toast.key);
281
+ return;
282
+ }
283
+ const animations = toastRef.getAnimations();
284
+ if (animations.length === 0) {
285
+ state.remove(local.toast.key);
286
+ return;
287
+ }
288
+ let canceled = false;
289
+ Promise.all(animations.map((a) => a.finished)).then(() => {
290
+ if (!canceled) state.remove(local.toast.key);
291
+ }).catch(() => {
292
+ if (!canceled) state.remove(local.toast.key);
293
+ });
294
+ _s2Cleanups.push(() => {
295
+ canceled = true;
296
+ });
297
+ return () => {
298
+ for (const c of _s2Cleanups) c();
299
+ };
253
300
  });
254
301
  const { ref: _ref, ...cleanToastProps } = toastAria.toastProps;
255
- createEffect(() => {});
256
- return <ToastAriaContext.Provider value={{
302
+ createRenderEffect(() => {
303
+ return {
304
+ toastRef: toastEl(),
305
+ titleId: toastAria.titleProps.id,
306
+ descriptionId: toastAria.descriptionProps.id,
307
+ contentProps: toastAria.contentProps
308
+ };
309
+ }, ({ toastRef, titleId, descriptionId, contentProps }) => {
310
+ if (!toastRef) return;
311
+ if (titleId) {
312
+ const titleEl = toastRef.querySelector("[data-solidaria-toast-title]");
313
+ if (titleEl instanceof HTMLElement) titleEl.id = titleId;
314
+ }
315
+ if (descriptionId) {
316
+ const descriptionEl = toastRef.querySelector("[data-solidaria-toast-description]");
317
+ if (descriptionEl instanceof HTMLElement) descriptionEl.id = descriptionId;
318
+ }
319
+ const contentEl = toastRef.querySelector("[data-solidaria-toast-content]");
320
+ if (contentEl instanceof HTMLElement) {
321
+ const role = contentProps.role;
322
+ const ariaAtomic = contentProps["aria-atomic"];
323
+ const ariaHidden = contentProps["aria-hidden"];
324
+ if (role) contentEl.setAttribute("role", role);
325
+ if (ariaAtomic) contentEl.setAttribute("aria-atomic", ariaAtomic);
326
+ if (ariaHidden) contentEl.setAttribute("aria-hidden", ariaHidden);
327
+ else contentEl.removeAttribute("aria-hidden");
328
+ }
329
+ });
330
+ return <ToastAriaContext value={{
257
331
  titleProps: toastAria.titleProps,
258
332
  descriptionProps: toastAria.descriptionProps,
259
333
  contentProps: toastAria.contentProps
260
334
  }}>
261
- <div ref={toastRef} {...domProps()} {...cleanToastProps} class={renderProps.class()} style={mergedStyle()} data-animation={local.toast.animation} data-type={local.toast.content.type ?? local.toast.content.variant} data-variant={local.toast.content.variant} on:click={handleRootClick}>
262
- {renderProps.renderChildren()}
335
+ <div ref={setToastEl} {...domProps()} {...cleanToastProps} class={renderProps.class()} style={mergedStyle()} data-animation={local.toast.animation} data-type={local.toast.content.type ?? local.toast.content.variant} data-variant={local.toast.content.variant} onClick={handleRootClick}>
336
+ <Provider values={[
337
+ [ToastContentContext, toastAria.contentProps],
338
+ [TextContext, { slots: {
339
+ [DEFAULT_SLOT]: {},
340
+ get title() {
341
+ return toastAria.titleProps;
342
+ },
343
+ get description() {
344
+ return toastAria.descriptionProps;
345
+ }
346
+ } }],
347
+ [ButtonContext, { slots: {
348
+ [DEFAULT_SLOT]: {},
349
+ close: {
350
+ onPress: () => {
351
+ state.close(local.toast.key);
352
+ state.remove(local.toast.key);
353
+ },
354
+ "aria-label": toastAria.closeButtonProps["aria-label"]
355
+ }
356
+ } }]
357
+ ]}>
358
+ {renderProps.renderChildren()}
359
+ </Provider>
263
360
  </div>
264
- </ToastAriaContext.Provider>;
361
+ </ToastAriaContext>;
265
362
  }
266
363
  /**
267
364
  * ToastTitle renders the toast title with proper accessibility attributes.
@@ -283,16 +380,24 @@ function ToastDescription(props) {
283
380
  }
284
381
  /**
285
382
  * ToastContent wraps the toast message (title + description) in the live region
286
- * announced to screen readers. It carries `role="alert"` / `aria-live="assertive"`
287
- * from createToast's contentProps so the toast text is announced when it appears.
383
+ * announced to screen readers. It consumes RAC ToastContentContext (role="alert",
384
+ * aria-atomic, aria-hidden until mounted) so the toast text is announced when
385
+ * it appears.
288
386
  *
289
387
  * It is rendered as a sibling of the close button (never wrapping it) so screen
290
388
  * readers announce the message without reading the close button first.
291
389
  */
292
390
  function ToastContent(props) {
293
- const { ref: _ref, ...ariaContentProps } = useContext(ToastAriaContext)?.contentProps ?? {};
294
- return <div data-solidaria-toast-content="" {...ariaContentProps} class={props.class} style={props.style}>
295
- {props.children}
391
+ const [merged] = useContextProps(props, void 0, ToastContentContext);
392
+ const [local, rest] = splitProps(merged, [
393
+ "class",
394
+ "style",
395
+ "children",
396
+ "slot",
397
+ "ref"
398
+ ]);
399
+ return <div data-solidaria-toast-content="" {...rest} class={local.class} style={local.style}>
400
+ {local.children}
296
401
  </div>;
297
402
  }
298
403
  /**
@@ -306,7 +411,7 @@ function ToastCloseButton(props) {
306
411
  state?.close(key);
307
412
  state?.remove(key);
308
413
  };
309
- return <button type="button" class={props.class} style={props.style} aria-label={props["aria-label"] ?? "Close"} data-solidaria-toast-close-button="" on:click={handleClose} onClick={handleClose}>
414
+ return <button type="button" class={props.class} style={props.style} aria-label={props["aria-label"] ?? "Close"} data-solidaria-toast-close-button="" onClick={handleClose}>
310
415
  {props.children ?? "×"}
311
416
  </button>;
312
417
  }
@@ -356,6 +461,6 @@ function DefaultToast(props) {
356
461
  </Toast>;
357
462
  }
358
463
  //#endregion
359
- export { DefaultToast, Toast, ToastCloseButton, ToastContent, ToastContext, ToastDescription, ToastProvider, ToastRegion, ToastTitle, addToast, globalToastQueue, useToastContext };
464
+ export { DefaultToast, Toast, ToastCloseButton, ToastContent, ToastContentContext, ToastContext, ToastDescription, ToastProvider, ToastRegion, ToastTitle, addToast, globalToastQueue, useToastContext };
360
465
 
361
466
  //# sourceMappingURL=Toast.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.jsx","names":[],"sources":["../src/Toast.tsx"],"sourcesContent":["/**\n * Toast components for solidaria-components\n *\n * Toast notifications with auto-dismiss, pause on hover/focus, and accessibility.\n * Port of react-aria-components Toast.\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createMemo,\n createEffect,\n createSignal,\n onCleanup,\n splitProps,\n Show,\n useContext,\n} from \"solid-js\";\nimport { Portal } from \"solid-js/web\";\nimport {\n type ToastState,\n type QueuedToast,\n type ToastQueueOptions,\n type ToastOptions,\n ToastQueue,\n createToastState,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n createToast,\n createToastRegion,\n useUNSAFE_PortalContext,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n useRenderProps,\n filterDOMProps,\n useIsHydrated,\n} from \"./utils\";\n\nexport interface ToastContent {\n /** DOM id for the toast root when content is queued through Spectrum ToastQueue. */\n id?: string;\n /** Data attributes for the toast root when content is queued through Spectrum ToastQueue. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n /** Spectrum Toast message content. */\n children?: string;\n /** The title of the toast. */\n title?: string;\n /** The description/body of the toast. */\n description?: string;\n /** Spectrum variant. */\n variant?: \"info\" | \"positive\" | \"negative\" | \"neutral\";\n /** Backward-compatible type/variant of the toast. */\n type?: \"info\" | \"success\" | \"warning\" | \"error\" | \"positive\" | \"negative\" | \"neutral\";\n /** Spectrum action button label. */\n actionLabel?: string;\n /** Handler called when the Spectrum action button is pressed. */\n onAction?: () => void;\n /** Whether the toast should close when the Spectrum action is performed. */\n shouldCloseOnAction?: boolean;\n /** Custom action button. */\n action?: {\n label: string;\n onAction: () => void;\n };\n}\n\nexport interface ToastRenderProps {\n /** Whether the toast is currently animating in. */\n isEntering: boolean;\n /** Whether the toast is currently animating out. */\n isExiting: boolean;\n /** The animation state (entering, exiting, queued). */\n animation: \"entering\" | \"exiting\" | \"queued\" | undefined;\n /** The toast data. */\n toast: QueuedToast<ToastContent>;\n}\n\nexport interface ToastRegionRenderProps {\n /** The visible toasts. */\n visibleToasts: Accessor<QueuedToast<ToastContent>[]>;\n}\n\nexport interface ToastRegionProps {\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ToastRegionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToastRegionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToastRegionRenderProps>;\n /** The toast state to display. If not provided, uses ToastContext. */\n state?: ToastState<ToastContent>;\n /** Accessible label for the region. */\n \"aria-label\"?: string;\n /** Whether to render in a portal. */\n portal?: boolean;\n /** Placement of the toast region. */\n placement?:\n | \"top\"\n | \"top start\"\n | \"top end\"\n | \"top-start\"\n | \"top-end\"\n | \"bottom\"\n | \"bottom start\"\n | \"bottom end\"\n | \"bottom-start\"\n | \"bottom-end\";\n}\n\nexport interface ToastProps {\n /** DOM id for the toast root. */\n id?: string;\n /** Data attributes for the toast root. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n /** The toast data. */\n toast: QueuedToast<ToastContent>;\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ToastRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToastRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToastRenderProps>;\n}\n\nexport const ToastContext = createContext<ToastState<ToastContent> | null>(null);\n\ninterface ToastAriaContextValue {\n titleProps: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n contentProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\nconst ToastAriaContext = createContext<ToastAriaContextValue | null>(null);\nconst toastStateByKey = new Map<string, ToastState<ToastContent>>();\n\nexport function useToastContext(): ToastState<ToastContent> {\n const context = useContext(ToastContext);\n if (!context) {\n throw new Error(\"Toast components must be used within a ToastProvider\");\n }\n return context;\n}\n\n/** Default global toast queue that can be used for app-wide toasts. */\nexport const globalToastQueue = new ToastQueue<ToastContent>({\n maxVisibleToasts: Infinity,\n hasExitAnimation: true,\n});\n\n/**\n * Add a toast to the global queue.\n * Convenience function for adding toasts from anywhere in the app.\n */\nexport function addToast(content: ToastContent, options?: ToastOptions): string {\n return globalToastQueue.add(content, options);\n}\n\nfunction normalizeToastPlacement(placement?: ToastRegionProps[\"placement\"]) {\n return (placement ?? \"bottom\").replace(\"-\", \" \") as NonNullable<ToastRegionProps[\"placement\"]>;\n}\n\nexport interface ToastProviderProps {\n /** The children of the provider. */\n children: JSX.Element;\n /** Custom toast queue options. */\n queueOptions?: ToastQueueOptions;\n /** Use global queue instead of creating a new one. */\n useGlobalQueue?: boolean;\n}\n\n/**\n * ToastProvider creates a toast queue context for descendant components.\n * Use this to wrap your app or a section that needs toast notifications.\n *\n * @example\n * ```tsx\n * <ToastProvider>\n * <App />\n * <ToastRegion />\n * </ToastProvider>\n * ```\n */\nexport function ToastProvider(props: ToastProviderProps): JSX.Element {\n const queue = props.useGlobalQueue\n ? globalToastQueue\n : new ToastQueue<ToastContent>(props.queueOptions);\n\n const state = createToastState({ queue });\n\n return <ToastContext.Provider value={state}>{props.children}</ToastContext.Provider>;\n}\n\n/**\n * ToastRegion is a container that displays all visible toasts.\n * It handles pause on hover/focus and provides the landmark region.\n *\n * @example\n * ```tsx\n * <ToastRegion placement=\"bottom-end\">\n * {(renderProps) => (\n * <For each={renderProps.visibleToasts}>\n * {(toast) => <Toast toast={toast} />}\n * </For>\n * )}\n * </ToastRegion>\n * ```\n */\nexport function ToastRegion(props: ToastRegionProps): JSX.Element {\n // Do NOT early-return on the server: returning null on the server and a <Show>\n // on the client desyncs hydration when the region is in the SSR tree. Render the\n // same structure on both and gate the Portal on useIsHydrated() (see Popover).\n const isHydrated = useIsHydrated();\n\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"state\",\n \"aria-label\",\n \"portal\",\n \"placement\",\n ]);\n const portalContext = useUNSAFE_PortalContext();\n const portalContainer = () => portalContext.getContainer?.() ?? undefined;\n const [regionElement, setRegionElement] = createSignal<HTMLElement>();\n\n const contextState = useContext(ToastContext);\n const state = () => local.state ?? contextState;\n\n const regionAria = createToastRegion<ToastContent>({\n state: {\n visibleToasts: () => state()?.visibleToasts() ?? [],\n add: (content, options) => state()?.add(content, options) ?? \"\",\n close: (key) => state()?.close(key),\n remove: (key) => state()?.remove(key),\n clear: () => state()?.clear(),\n pauseAll: () => state()?.pauseAll(),\n resumeAll: () => state()?.resumeAll(),\n },\n ref: regionElement,\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n });\n\n const renderValues = createMemo<ToastRegionRenderProps>(() => ({\n visibleToasts: () => state()?.visibleToasts() ?? [],\n }));\n\n const renderProps = useRenderProps(\n {\n // Lazy: the region content is gated behind `<Show when={isHydrated() && …}>`\n // (Portal) below, so reading children must not instantiate templates during\n // the component body (would walk getNextElement before the gate the server\n // kept closed → hydration mismatch). See Popover for the full rationale.\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ToastRegion\",\n },\n renderValues,\n );\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const placementStyles = createMemo<JSX.CSSProperties>(() => {\n const placement = normalizeToastPlacement(local.placement);\n const [edge, align = \"center\"] = placement.split(\" \");\n const base: JSX.CSSProperties = {\n position: \"fixed\",\n \"z-index\": 100001,\n display: \"flex\",\n \"flex-direction\": edge === \"top\" ? \"column\" : \"column-reverse\",\n gap: \"8px\",\n padding: \"16px\",\n \"pointer-events\": \"none\",\n };\n\n if (edge === \"top\") {\n if (align === \"end\") {\n return { ...base, top: \"16px\", right: \"16px\" } as JSX.CSSProperties;\n }\n if (align === \"start\") {\n return { ...base, top: \"16px\", left: \"16px\" } as JSX.CSSProperties;\n }\n return {\n ...base,\n top: \"16px\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n } as JSX.CSSProperties;\n }\n\n if (align === \"end\") {\n return { ...base, bottom: \"16px\", right: \"16px\" } as JSX.CSSProperties;\n }\n if (align === \"start\") {\n return { ...base, bottom: \"16px\", left: \"16px\" } as JSX.CSSProperties;\n }\n return {\n ...base,\n bottom: \"16px\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n } as JSX.CSSProperties;\n });\n\n const normalizedPlacement = () => normalizeToastPlacement(local.placement);\n\n const visibleToasts = () => state()?.visibleToasts() ?? [];\n const hasToasts = () => visibleToasts().length > 0;\n const hasAuthoredRegionStyle = () => local.class != null || local.style != null;\n\n const regionContent = () => {\n if (!state()) return null;\n\n const mergedStyle = () => {\n const custom = renderProps.style();\n // React Aria Components leaves ToastRegion unstyled. Keep this package's\n // fallback placement only for bare regions so styled layers such as S2 can\n // own fixed viewport geometry with their generated classes.\n if (hasAuthoredRegionStyle()) return custom;\n\n const placement = placementStyles();\n if (!custom) return placement;\n return { ...placement, ...custom } as JSX.CSSProperties;\n };\n\n const { ref: _ref, ...cleanRegionProps } = regionAria.regionProps as Record<string, unknown>;\n\n return (\n <div\n ref={setRegionElement}\n {...domProps()}\n {...cleanRegionProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-placement={normalizedPlacement()}\n >\n {renderProps.renderChildren()}\n </div>\n );\n };\n\n return (\n <Show when={isHydrated() && hasToasts()}>\n <Show when={local.portal !== false} fallback={regionContent()}>\n <Portal mount={portalContainer()}>{regionContent()}</Portal>\n </Show>\n </Show>\n );\n}\n\n/**\n * Toast is an individual notification component.\n *\n * @example\n * ```tsx\n * <Toast toast={toast}>\n * {(renderProps) => (\n * <div class={renderProps.isExiting ? 'fade-out' : 'fade-in'}>\n * <h3>{renderProps.toast.content.title}</h3>\n * <p>{renderProps.toast.content.description}</p>\n * </div>\n * )}\n * </Toast>\n * ```\n */\nexport function Toast(props: ToastProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"toast\", \"children\", \"class\", \"style\"]);\n\n let toastRef!: HTMLDivElement;\n\n const state = useToastContext();\n\n createEffect(() => {\n const key = local.toast.key;\n toastStateByKey.set(key, state);\n onCleanup(() => {\n if (toastStateByKey.get(key) === state) {\n toastStateByKey.delete(key);\n }\n });\n });\n\n const hasTitle = () => !!(local.toast.content.children ?? local.toast.content.title);\n const toastAria = createToast({\n toast: local.toast,\n state,\n hasTitle: hasTitle(),\n hasDescription: !!local.toast.content.description,\n });\n\n const renderValues = createMemo<ToastRenderProps>(() => ({\n isEntering: local.toast.animation === \"entering\",\n isExiting: local.toast.animation === \"exiting\",\n animation: local.toast.animation,\n toast: local.toast,\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-Toast\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const mergedStyle = () => {\n const custom = renderProps.style();\n if (!custom) return { \"pointer-events\": \"auto\" as const };\n return { \"pointer-events\": \"auto\" as const, ...custom } as JSX.CSSProperties;\n };\n\n const handleRootClick = (event: MouseEvent) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n if (target.closest(\"[data-solidaria-toast-close-button]\")) {\n state.close(local.toast.key);\n state.remove(local.toast.key);\n }\n };\n\n // Exit animation lifecycle:\n // When animation becomes 'exiting', wait for CSS animations/transitions to finish,\n // then call state.remove() to finalize removal from the queue.\n // In JSDOM or when no animations are running, remove immediately.\n // Reduced-motion is handled by CSS (shorter/no animations), so the lifecycle\n // naturally completes faster when the user prefers reduced motion.\n createEffect(() => {\n if (local.toast.animation !== \"exiting\") return;\n if (!toastRef) {\n state.remove(local.toast.key);\n return;\n }\n\n // Check if the element supports the Web Animations API\n if (!(\"getAnimations\" in toastRef)) {\n state.remove(local.toast.key);\n return;\n }\n\n const animations = toastRef.getAnimations();\n if (animations.length === 0) {\n // No CSS animations/transitions running - remove immediately\n state.remove(local.toast.key);\n return;\n }\n\n // Wait for all running animations to finish, then remove\n let canceled = false;\n Promise.all(animations.map((a) => a.finished))\n .then(() => {\n if (!canceled) {\n state.remove(local.toast.key);\n }\n })\n .catch(() => {\n // Animation was canceled (e.g. element removed) - still clean up\n if (!canceled) {\n state.remove(local.toast.key);\n }\n });\n\n onCleanup(() => {\n canceled = true;\n });\n });\n\n const { ref: _ref, ...cleanToastProps } = toastAria.toastProps as Record<string, unknown>;\n\n // Ensure ARIA title/description IDs and the content live-region attributes are\n // present on rendered sub-components, even when children are pre-composed outside\n // the Toast provider owner (as DefaultToast does), where useContext can't reach\n // this owner's ToastAriaContext.\n createEffect(() => {\n if (!toastRef) return;\n\n const titleId = (toastAria.titleProps as Record<string, unknown>).id as string | undefined;\n const descriptionId = (toastAria.descriptionProps as Record<string, unknown>).id as\n | string\n | undefined;\n const contentProps = toastAria.contentProps as Record<string, unknown>;\n\n if (titleId) {\n const titleEl = toastRef.querySelector(\"[data-solidaria-toast-title]\");\n if (titleEl instanceof HTMLElement) {\n titleEl.id = titleId;\n }\n }\n\n if (descriptionId) {\n const descriptionEl = toastRef.querySelector(\"[data-solidaria-toast-description]\");\n if (descriptionEl instanceof HTMLElement) {\n descriptionEl.id = descriptionId;\n }\n }\n\n // Wire the content area as a live region (role=\"alert\" / aria-live=\"assertive\")\n // so the toast message is announced to screen readers when it appears.\n const contentEl = toastRef.querySelector(\"[data-solidaria-toast-content]\");\n if (contentEl instanceof HTMLElement) {\n const role = contentProps.role as string | undefined;\n const ariaLive = contentProps[\"aria-live\"] as string | undefined;\n const ariaAtomic = contentProps[\"aria-atomic\"] as string | undefined;\n if (role) contentEl.setAttribute(\"role\", role);\n if (ariaLive) contentEl.setAttribute(\"aria-live\", ariaLive);\n if (ariaAtomic) contentEl.setAttribute(\"aria-atomic\", ariaAtomic);\n }\n });\n\n return (\n <ToastAriaContext.Provider\n value={{\n titleProps: toastAria.titleProps,\n descriptionProps: toastAria.descriptionProps,\n contentProps: toastAria.contentProps,\n }}\n >\n <div\n ref={toastRef}\n {...domProps()}\n {...cleanToastProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-animation={local.toast.animation}\n data-type={local.toast.content.type ?? local.toast.content.variant}\n data-variant={local.toast.content.variant}\n on:click={handleRootClick}\n >\n {renderProps.renderChildren()}\n </div>\n </ToastAriaContext.Provider>\n );\n}\n\nexport interface ToastTitleProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastTitle renders the toast title with proper accessibility attributes.\n */\nexport function ToastTitle(props: ToastTitleProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaTitleProps } = (context?.titleProps ?? {}) as Record<string, unknown>;\n\n // Upstream S2 Toast renders the title via `<Text slot=\"title\">`, and RAC `Text`\n // defaults to `elementType=\"span\"` — so the title's text-node container is a\n // `<span>`, not a `<div>`. Mirror that (the D7 contrast descriptor keys on the\n // container tag name; a `<div>` here diverged on every variant × theme). (parity rule #1/#2)\n return (\n <span data-solidaria-toast-title=\"\" {...ariaTitleProps} class={props.class} style={props.style}>\n {props.children}\n </span>\n );\n}\n\nexport interface ToastDescriptionProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastDescription renders the toast description with proper accessibility attributes.\n */\nexport function ToastDescription(props: ToastDescriptionProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaDescriptionProps } = (context?.descriptionProps ?? {}) as Record<\n string,\n unknown\n >;\n\n // Match the title: upstream toast text is rendered in `<span>` elements (RAC\n // `Text`). The port additionally supports a description (upstream S2 has only a\n // title); keep it as a `<span>` sibling so its text-node container tag is faithful.\n return (\n <span\n data-solidaria-toast-description=\"\"\n {...ariaDescriptionProps}\n class={props.class}\n style={props.style}\n >\n {props.children}\n </span>\n );\n}\n\nexport interface ToastContentProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastContent wraps the toast message (title + description) in the live region\n * announced to screen readers. It carries `role=\"alert\"` / `aria-live=\"assertive\"`\n * from createToast's contentProps so the toast text is announced when it appears.\n *\n * It is rendered as a sibling of the close button (never wrapping it) so screen\n * readers announce the message without reading the close button first.\n */\nexport function ToastContent(props: ToastContentProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaContentProps } = (context?.contentProps ?? {}) as Record<\n string,\n unknown\n >;\n\n return (\n <div\n data-solidaria-toast-content=\"\"\n {...ariaContentProps}\n class={props.class}\n style={props.style}\n >\n {props.children}\n </div>\n );\n}\n\nexport interface ToastCloseButtonProps {\n /** The toast to close. */\n toast: QueuedToast<ToastContent>;\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n \"aria-label\"?: string;\n}\n\n/**\n * ToastCloseButton is a button that closes the toast.\n */\nexport function ToastCloseButton(props: ToastCloseButtonProps): JSX.Element {\n const contextState = useContext(ToastContext);\n const handleClose = () => {\n const key = props.toast.key;\n const state = contextState ?? toastStateByKey.get(key);\n state?.close(key);\n state?.remove(key);\n };\n\n return (\n <button\n type=\"button\"\n class={props.class}\n style={props.style}\n aria-label={props[\"aria-label\"] ?? \"Close\"}\n data-solidaria-toast-close-button=\"\"\n on:click={handleClose}\n onClick={handleClose}\n >\n {props.children ?? \"×\"}\n </button>\n );\n}\n\nexport interface DefaultToastProps {\n toast: QueuedToast<ToastContent>;\n}\n\n/**\n * DefaultToast provides a basic toast layout with title, description, and close button.\n * Use this as a starting point or as-is for simple toast needs.\n */\nexport function DefaultToast(props: DefaultToastProps): JSX.Element {\n const content = () => props.toast.content;\n const title = () => content().children ?? content().title;\n const actionLabel = () => content().actionLabel ?? content().action?.label;\n const actionHandler = () => content().onAction ?? content().action?.onAction;\n const state = useToastContext();\n const handleAction = () => {\n actionHandler()?.();\n if (content().shouldCloseOnAction) {\n state.close(props.toast.key);\n state.remove(props.toast.key);\n }\n };\n\n return (\n <Toast toast={props.toast}>\n <div style={{ display: \"flex\", \"align-items\": \"flex-start\", gap: \"12px\" }}>\n <ToastContent style={{ flex: 1 }}>\n <Show when={title()}>\n <ToastTitle style={{ \"font-weight\": \"bold\", \"margin-bottom\": \"4px\" }}>\n {title()}\n </ToastTitle>\n </Show>\n <Show when={content().description}>\n <ToastDescription>{content().description}</ToastDescription>\n </Show>\n <Show when={actionLabel()}>\n <button type=\"button\" style={{ \"margin-top\": \"8px\" }} onClick={handleAction}>\n {actionLabel()}\n </button>\n </Show>\n </ToastContent>\n <ToastCloseButton toast={props.toast} />\n </div>\n </Toast>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAgIA,MAAa,eAAe,cAA+C,IAAI;AAQ/E,MAAM,mBAAmB,cAA4C,IAAI;AACzE,MAAM,kCAAkB,IAAI,IAAsC;AAElE,SAAgB,kBAA4C;CAC1D,MAAM,UAAU,WAAW,YAAY;CACvC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,sDAAsD;CAExE,OAAO;AACT;;AAGA,MAAa,mBAAmB,IAAI,WAAyB;CAC3D,kBAAkB;CAClB,kBAAkB;AACpB,CAAC;;;;;AAMD,SAAgB,SAAS,SAAuB,SAAgC;CAC9E,OAAO,iBAAiB,IAAI,SAAS,OAAO;AAC9C;AAEA,SAAS,wBAAwB,WAA2C;CAC1E,QAAQ,aAAa,SAAA,CAAU,QAAQ,KAAK,GAAG;AACjD;;;;;;;;;;;;;AAuBA,SAAgB,cAAc,OAAwC;CAKpE,MAAM,QAAQ,iBAAiB,EAAE,OAJnB,MAAM,iBAChB,mBACA,IAAI,WAAyB,MAAM,YAAY,EAEZ,CAAC;CAExC,OAAO,CAAC,aAAa,SAAS,OAAO,QAAQ,MAAM,SAAS,EAAE,aAAa;AAC7E;;;;;;;;;;;;;;;;AAiBA,SAAgB,YAAY,OAAsC;CAIhE,MAAM,aAAa,cAAc;CAEjC,MAAM,CAAC,OAAO,QAAQ,WAAW,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,MAAM,gBAAg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,kBAAkB,QAAQ,CAAC,CAAC,YAAY,EAAE,iBAAiB;UAC9D,EAAE,KAAK;UACP,CAAC,KAAK,MAAM,YAAY,GAAG;YACzB,CAAC,OAAO,cAAc,OAAO,EAAE,cAAc,MAAM,GAAG,SAAS,cAAc;eAC1E,YAAY,EAAE;YACjB,EAAE,OAAO;UACX,EAAE,KAAK;QACT,EAAE,aAAa;QACf,CAAC,iBAAiB,OAAO,MAAM,SAAS;MAC1C,EAAE,IAAI;IACR,EAAE;AAEN"}
1
+ {"version":3,"file":"Toast.jsx","names":[],"sources":["../src/Toast.tsx"],"sourcesContent":["/*\n * Copyright 2025 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/Toast.tsx\n\n/**\n * Toast components for solidaria-components\n *\n * Toast notifications with auto-dismiss, pause on hover/focus, and accessibility.\n * Port of react-aria-components Toast.\n */\n\nimport {\n createContext,\n createMemo,\n createEffect,\n createRenderEffect,\n createSignal,\n onCleanup,\n Show,\n useContext,\n createTrackedEffect,\n} from \"solid-js\";\nimport type { Accessor, Context } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { Portal } from \"@solidjs/web\";\nimport {\n type ToastState,\n type QueuedToast,\n type ToastQueueOptions,\n type ToastOptions,\n ToastQueue,\n createToastState,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n createToast,\n createToastRegion,\n useUNSAFE_PortalContext,\n} from \"@proyecto-viviana/solidaria\";\nimport { ButtonContext } from \"./Button\";\nimport { TextContext } from \"./Text\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\nimport {\n type ContextValue,\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n DEFAULT_SLOT,\n Provider,\n useContextProps,\n useRenderProps,\n filterDOMProps,\n useIsHydrated,\n} from \"./utils\";\n\nexport interface ToastContent {\n /** DOM id for the toast root when content is queued through Spectrum ToastQueue. */\n id?: string;\n /** Data attributes for the toast root when content is queued through Spectrum ToastQueue. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n /** Spectrum Toast message content. */\n children?: string;\n /** The title of the toast. */\n title?: string;\n /** The description/body of the toast. */\n description?: string;\n /** Spectrum variant. */\n variant?: \"info\" | \"positive\" | \"negative\" | \"neutral\";\n /** Backward-compatible type/variant of the toast. */\n type?: \"info\" | \"success\" | \"warning\" | \"error\" | \"positive\" | \"negative\" | \"neutral\";\n /** Spectrum action button label. */\n actionLabel?: string;\n /** Handler called when the Spectrum action button is pressed. */\n onAction?: () => void;\n /** Whether the toast should close when the Spectrum action is performed. */\n shouldCloseOnAction?: boolean;\n /** Custom action button. */\n action?: {\n label: string;\n onAction: () => void;\n };\n}\n\nexport interface ToastRenderProps {\n /** Whether the toast is currently animating in. */\n isEntering: boolean;\n /** Whether the toast is currently animating out. */\n isExiting: boolean;\n /** The animation state (entering, exiting, queued). */\n animation: \"entering\" | \"exiting\" | \"queued\" | undefined;\n /** The toast data. */\n toast: QueuedToast<ToastContent>;\n}\n\nexport interface ToastRegionRenderProps {\n /** The visible toasts. */\n visibleToasts: Accessor<QueuedToast<ToastContent>[]>;\n}\n\nexport interface ToastRegionProps {\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ToastRegionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToastRegionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToastRegionRenderProps>;\n /** The toast state to display. If not provided, uses ToastContext. */\n state?: ToastState<ToastContent>;\n /** Accessible label for the region. */\n \"aria-label\"?: string;\n /** Whether to render in a portal. */\n portal?: boolean;\n /** Placement of the toast region. */\n placement?:\n | \"top\"\n | \"top start\"\n | \"top end\"\n | \"top-start\"\n | \"top-end\"\n | \"bottom\"\n | \"bottom start\"\n | \"bottom end\"\n | \"bottom-start\"\n | \"bottom-end\";\n}\n\nexport interface ToastProps {\n /** DOM id for the toast root. */\n id?: string;\n /** Data attributes for the toast root. */\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n /** The toast data. */\n toast: QueuedToast<ToastContent>;\n /** The children of the component - can be JSX or render function. */\n children?: RenderChildren<ToastRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<ToastRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<ToastRenderProps>;\n}\n\nexport const ToastContext = createContext<ToastState<ToastContent> | null>(null);\n\ninterface ToastAriaContextValue {\n titleProps: JSX.HTMLAttributes<HTMLElement>;\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n contentProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\nconst ToastAriaContext = createContext<ToastAriaContextValue | null>(null);\nexport const ToastContentContext = createContext<ContextValue<ToastContentProps, HTMLDivElement>>(\n {},\n);\nconst toastStateByKey = new Map<string, ToastState<ToastContent>>();\n\nexport function useToastContext(): ToastState<ToastContent> {\n const context = useContext(ToastContext);\n if (!context) {\n throw new Error(\"Toast components must be used within a ToastProvider\");\n }\n return context;\n}\n\n/** Default global toast queue that can be used for app-wide toasts. */\nexport const globalToastQueue = new ToastQueue<ToastContent>({\n maxVisibleToasts: Infinity,\n hasExitAnimation: true,\n});\n\n/**\n * Add a toast to the global queue.\n * Convenience function for adding toasts from anywhere in the app.\n */\nexport function addToast(content: ToastContent, options?: ToastOptions): string {\n return globalToastQueue.add(content, options);\n}\n\nfunction normalizeToastPlacement(placement?: ToastRegionProps[\"placement\"]) {\n return (placement ?? \"bottom\").replace(\"-\", \" \") as NonNullable<ToastRegionProps[\"placement\"]>;\n}\n\nexport interface ToastProviderProps {\n /** The children of the provider. */\n children: JSX.Element;\n /** Custom toast queue options. */\n queueOptions?: ToastQueueOptions;\n /** Use global queue instead of creating a new one. */\n useGlobalQueue?: boolean;\n}\n\n/**\n * ToastProvider creates a toast queue context for descendant components.\n * Use this to wrap your app or a section that needs toast notifications.\n *\n * @example\n * ```tsx\n * <ToastProvider>\n * <App />\n * <ToastRegion />\n * </ToastProvider>\n * ```\n */\nexport function ToastProvider(props: ToastProviderProps): JSX.Element {\n const queue = props.useGlobalQueue\n ? globalToastQueue\n : new ToastQueue<ToastContent>(props.queueOptions);\n\n const state = createToastState({ queue });\n\n return <ToastContext value={state}>{props.children}</ToastContext>;\n}\n\n/**\n * ToastRegion is a container that displays all visible toasts.\n * It handles pause on hover/focus and provides the landmark region.\n *\n * @example\n * ```tsx\n * <ToastRegion placement=\"bottom-end\">\n * {(renderProps) => (\n * <For each={renderProps.visibleToasts}>\n * {(toast) => <Toast toast={toast} />}\n * </For>\n * )}\n * </ToastRegion>\n * ```\n */\nexport function ToastRegion(props: ToastRegionProps): JSX.Element {\n // Do NOT early-return on the server: returning null on the server and a <Show>\n // on the client desyncs hydration when the region is in the SSR tree. Render the\n // same structure on both and gate the Portal on useIsHydrated() (see Popover).\n const isHydrated = useIsHydrated();\n\n const [local, rest] = splitProps(props, [\n \"children\",\n \"class\",\n \"style\",\n \"state\",\n \"aria-label\",\n \"portal\",\n \"placement\",\n ]);\n const portalContext = useUNSAFE_PortalContext();\n const portalContainer = () => portalContext.getContainer?.() ?? undefined;\n const [regionElement, setRegionElement] = createSignal<HTMLElement>();\n\n const contextState = useContext(ToastContext);\n const state = () => local.state ?? contextState;\n\n const regionAria = createToastRegion<ToastContent>({\n state: {\n visibleToasts: () => state()?.visibleToasts() ?? [],\n add: (content, options) => state()?.add(content, options) ?? \"\",\n close: (key) => state()?.close(key),\n remove: (key) => state()?.remove(key),\n clear: () => state()?.clear(),\n pauseAll: () => state()?.pauseAll(),\n resumeAll: () => state()?.resumeAll(),\n },\n ref: regionElement,\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n });\n\n const renderValues = createMemo<ToastRegionRenderProps>(() => ({\n visibleToasts: () => state()?.visibleToasts() ?? [],\n }));\n\n const renderProps = useRenderProps(\n {\n // Lazy: the region content is gated behind `<Show when={isHydrated() && …}>`\n // (Portal) below, so reading children must not instantiate templates during\n // the component body (would walk getNextElement before the gate the server\n // kept closed → hydration mismatch). See Popover for the full rationale.\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ToastRegion\",\n },\n renderValues,\n );\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const placementStyles = createMemo<JSX.CSSProperties>(() => {\n const placement = normalizeToastPlacement(local.placement);\n const [edge, align = \"center\"] = placement.split(\" \");\n const base: JSX.CSSProperties = {\n position: \"fixed\",\n \"z-index\": 100001,\n display: \"flex\",\n \"flex-direction\": edge === \"top\" ? \"column\" : \"column-reverse\",\n gap: \"8px\",\n padding: \"16px\",\n \"pointer-events\": \"none\",\n };\n\n if (edge === \"top\") {\n if (align === \"end\") {\n return { ...base, top: \"16px\", right: \"16px\" } as JSX.CSSProperties;\n }\n if (align === \"start\") {\n return { ...base, top: \"16px\", left: \"16px\" } as JSX.CSSProperties;\n }\n return {\n ...base,\n top: \"16px\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n } as JSX.CSSProperties;\n }\n\n if (align === \"end\") {\n return { ...base, bottom: \"16px\", right: \"16px\" } as JSX.CSSProperties;\n }\n if (align === \"start\") {\n return { ...base, bottom: \"16px\", left: \"16px\" } as JSX.CSSProperties;\n }\n return {\n ...base,\n bottom: \"16px\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n } as JSX.CSSProperties;\n });\n\n const normalizedPlacement = () => normalizeToastPlacement(local.placement);\n\n const visibleToasts = () => state()?.visibleToasts() ?? [];\n const hasToasts = () => visibleToasts().length > 0;\n const hasAuthoredRegionStyle = () => local.class != null || local.style != null;\n\n const regionContent = () => {\n if (!state()) return null;\n\n const mergedStyle = () => {\n const custom = renderProps.style();\n // React Aria Components leaves ToastRegion unstyled. Keep this package's\n // fallback placement only for bare regions so styled layers such as S2 can\n // own fixed viewport geometry with their generated classes.\n if (hasAuthoredRegionStyle()) return custom;\n\n const placement = placementStyles();\n if (!custom) return placement;\n return { ...placement, ...custom } as JSX.CSSProperties;\n };\n\n const { ref: _ref, ...cleanRegionProps } = regionAria.regionProps as Record<string, unknown>;\n\n return (\n <div\n ref={setRegionElement}\n {...domProps()}\n {...cleanRegionProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-placement={normalizedPlacement()}\n >\n {renderProps.renderChildren()}\n </div>\n );\n };\n\n return (\n <Show when={isHydrated() && hasToasts()}>\n <Show when={local.portal !== false} fallback={regionContent()}>\n <Portal mount={portalContainer()}>{regionContent()}</Portal>\n </Show>\n </Show>\n );\n}\n\n/**\n * Toast is an individual notification component.\n *\n * @example\n * ```tsx\n * <Toast toast={toast}>\n * {(renderProps) => (\n * <div class={renderProps.isExiting ? 'fade-out' : 'fade-in'}>\n * <h3>{renderProps.toast.content.title}</h3>\n * <p>{renderProps.toast.content.description}</p>\n * </div>\n * )}\n * </Toast>\n * ```\n */\nexport function Toast(props: ToastProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"toast\", \"children\", \"class\", \"style\"]);\n\n const [toastEl, setToastEl] = createSignal<HTMLDivElement | null>(null);\n\n const state = useToastContext();\n\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n const key = local.toast.key;\n toastStateByKey.set(key, state);\n _s2Cleanups.push(() => {\n if (toastStateByKey.get(key) === state) {\n toastStateByKey.delete(key);\n }\n });\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n const hasTitle = () => !!(local.toast.content.children ?? local.toast.content.title);\n const toastAria = createToast({\n toast: local.toast,\n state,\n hasTitle: hasTitle(),\n hasDescription: !!local.toast.content.description,\n });\n\n const renderValues = createMemo<ToastRenderProps>(() => ({\n isEntering: local.toast.animation === \"entering\",\n isExiting: local.toast.animation === \"exiting\",\n animation: local.toast.animation,\n toast: local.toast,\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-Toast\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const mergedStyle = () => {\n const custom = renderProps.style();\n if (!custom) return { \"pointer-events\": \"auto\" as const };\n return { \"pointer-events\": \"auto\" as const, ...custom } as JSX.CSSProperties;\n };\n\n const handleRootClick = (event: MouseEvent) => {\n const target = event.target;\n if (!(target instanceof Element)) return;\n if (target.closest(\"[data-solidaria-toast-close-button]\")) {\n state.close(local.toast.key);\n state.remove(local.toast.key);\n }\n };\n\n // Exit animation lifecycle:\n // When animation becomes 'exiting', wait for CSS animations/transitions to finish,\n // then call state.remove() to finalize removal from the queue.\n // In JSDOM or when no animations are running, remove immediately.\n // Reduced-motion is handled by CSS (shorter/no animations), so the lifecycle\n // naturally completes faster when the user prefers reduced motion.\n createTrackedEffect(() => {\n const _s2Cleanups: Array<() => void> = [];\n\n if (local.toast.animation !== \"exiting\") return;\n const toastRef = toastEl();\n if (!toastRef) {\n state.remove(local.toast.key);\n return;\n }\n\n // Check if the element supports the Web Animations API\n if (!(\"getAnimations\" in toastRef)) {\n state.remove(local.toast.key);\n return;\n }\n\n const animations = toastRef.getAnimations();\n if (animations.length === 0) {\n // No CSS animations/transitions running - remove immediately\n state.remove(local.toast.key);\n return;\n }\n\n // Wait for all running animations to finish, then remove\n let canceled = false;\n Promise.all(animations.map((a) => a.finished))\n .then(() => {\n if (!canceled) {\n state.remove(local.toast.key);\n }\n })\n .catch(() => {\n // Animation was canceled (e.g. element removed) - still clean up\n if (!canceled) {\n state.remove(local.toast.key);\n }\n });\n\n _s2Cleanups.push(() => {\n canceled = true;\n });\n\n return () => {\n for (const c of _s2Cleanups) c();\n };\n });\n\n const { ref: _ref, ...cleanToastProps } = toastAria.toastProps as Record<string, unknown>;\n\n // Apply title/description ids and content live-region attributes onto\n // descendants that opted in via data-solidaria-toast-* (S2 used a raw\n // content div before ToastContent). Signal ref + createRenderEffect so\n // a first-run null ref still reapplies after mount, before paint.\n createRenderEffect(\n () => {\n const toastRef = toastEl();\n const titleId = (toastAria.titleProps as Record<string, unknown>).id as string | undefined;\n const descriptionId = (toastAria.descriptionProps as Record<string, unknown>).id as\n | string\n | undefined;\n const contentProps = toastAria.contentProps as Record<string, unknown>;\n return { toastRef, titleId, descriptionId, contentProps };\n },\n ({ toastRef, titleId, descriptionId, contentProps }) => {\n if (!toastRef) return;\n\n if (titleId) {\n const titleEl = toastRef.querySelector(\"[data-solidaria-toast-title]\");\n if (titleEl instanceof HTMLElement) {\n titleEl.id = titleId;\n }\n }\n\n if (descriptionId) {\n const descriptionEl = toastRef.querySelector(\"[data-solidaria-toast-description]\");\n if (descriptionEl instanceof HTMLElement) {\n descriptionEl.id = descriptionId;\n }\n }\n\n const contentEl = toastRef.querySelector(\"[data-solidaria-toast-content]\");\n if (contentEl instanceof HTMLElement) {\n const role = contentProps.role as string | undefined;\n const ariaAtomic = contentProps[\"aria-atomic\"] as string | undefined;\n const ariaHidden = contentProps[\"aria-hidden\"] as string | undefined;\n if (role) contentEl.setAttribute(\"role\", role);\n if (ariaAtomic) contentEl.setAttribute(\"aria-atomic\", ariaAtomic);\n if (ariaHidden) contentEl.setAttribute(\"aria-hidden\", ariaHidden);\n else contentEl.removeAttribute(\"aria-hidden\");\n }\n },\n );\n\n return (\n <ToastAriaContext\n value={{\n titleProps: toastAria.titleProps,\n descriptionProps: toastAria.descriptionProps,\n contentProps: toastAria.contentProps,\n }}\n >\n <div\n ref={setToastEl}\n {...domProps()}\n {...cleanToastProps}\n class={renderProps.class()}\n style={mergedStyle()}\n data-animation={local.toast.animation}\n data-type={local.toast.content.type ?? local.toast.content.variant}\n data-variant={local.toast.content.variant}\n onClick={handleRootClick}\n >\n <Provider\n values={\n [\n [ToastContentContext, toastAria.contentProps],\n [\n TextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n get title() {\n return toastAria.titleProps;\n },\n get description() {\n return toastAria.descriptionProps;\n },\n },\n },\n ],\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n close: {\n onPress: () => {\n state.close(local.toast.key);\n state.remove(local.toast.key);\n },\n \"aria-label\": (toastAria.closeButtonProps as Record<string, unknown>)[\n \"aria-label\"\n ],\n },\n },\n },\n ],\n ] as Array<[Context<unknown>, unknown]>\n }\n >\n {renderProps.renderChildren()}\n </Provider>\n </div>\n </ToastAriaContext>\n );\n}\n\nexport interface ToastTitleProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastTitle renders the toast title with proper accessibility attributes.\n */\nexport function ToastTitle(props: ToastTitleProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaTitleProps } = (context?.titleProps ?? {}) as Record<string, unknown>;\n\n // Upstream S2 Toast renders the title via `<Text slot=\"title\">`, and RAC `Text`\n // defaults to `elementType=\"span\"` — so the title's text-node container is a\n // `<span>`, not a `<div>`. Mirror that (the D7 contrast descriptor keys on the\n // container tag name; a `<div>` here diverged on every variant × theme). (parity rule #1/#2)\n return (\n <span data-solidaria-toast-title=\"\" {...ariaTitleProps} class={props.class} style={props.style}>\n {props.children}\n </span>\n );\n}\n\nexport interface ToastDescriptionProps {\n children: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastDescription renders the toast description with proper accessibility attributes.\n */\nexport function ToastDescription(props: ToastDescriptionProps): JSX.Element {\n const context = useContext(ToastAriaContext);\n const { ref: _ref, ...ariaDescriptionProps } = (context?.descriptionProps ?? {}) as Record<\n string,\n unknown\n >;\n\n // Match the title: upstream toast text is rendered in `<span>` elements (RAC\n // `Text`). The port additionally supports a description (upstream S2 has only a\n // title); keep it as a `<span>` sibling so its text-node container tag is faithful.\n return (\n <span\n data-solidaria-toast-description=\"\"\n {...ariaDescriptionProps}\n class={props.class}\n style={props.style}\n >\n {props.children}\n </span>\n );\n}\n\nexport interface ToastContentProps extends JSX.HTMLAttributes<HTMLDivElement>, SlotProps {\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * ToastContent wraps the toast message (title + description) in the live region\n * announced to screen readers. It consumes RAC ToastContentContext (role=\"alert\",\n * aria-atomic, aria-hidden until mounted) so the toast text is announced when\n * it appears.\n *\n * It is rendered as a sibling of the close button (never wrapping it) so screen\n * readers announce the message without reading the close button first.\n */\nexport function ToastContent(props: ToastContentProps): JSX.Element {\n const [merged] = useContextProps(props, undefined, ToastContentContext);\n const [local, rest] = splitProps(merged, [\"class\", \"style\", \"children\", \"slot\", \"ref\"]);\n\n return (\n <div data-solidaria-toast-content=\"\" {...rest} class={local.class} style={local.style}>\n {local.children}\n </div>\n );\n}\n\nexport interface ToastCloseButtonProps {\n /** The toast to close. */\n toast: QueuedToast<ToastContent>;\n children?: JSX.Element;\n class?: string;\n style?: JSX.CSSProperties;\n \"aria-label\"?: string;\n}\n\n/**\n * ToastCloseButton is a button that closes the toast.\n */\nexport function ToastCloseButton(props: ToastCloseButtonProps): JSX.Element {\n const contextState = useContext(ToastContext);\n const handleClose = () => {\n const key = props.toast.key;\n const state = contextState ?? toastStateByKey.get(key);\n state?.close(key);\n state?.remove(key);\n };\n\n return (\n <button\n type=\"button\"\n class={props.class}\n style={props.style}\n aria-label={props[\"aria-label\"] ?? \"Close\"}\n data-solidaria-toast-close-button=\"\"\n onClick={handleClose}\n >\n {props.children ?? \"×\"}\n </button>\n );\n}\n\nexport interface DefaultToastProps {\n toast: QueuedToast<ToastContent>;\n}\n\n/**\n * DefaultToast provides a basic toast layout with title, description, and close button.\n * Use this as a starting point or as-is for simple toast needs.\n */\nexport function DefaultToast(props: DefaultToastProps): JSX.Element {\n const content = () => props.toast.content;\n const title = () => content().children ?? content().title;\n const actionLabel = () => content().actionLabel ?? content().action?.label;\n const actionHandler = () => content().onAction ?? content().action?.onAction;\n const state = useToastContext();\n const handleAction = () => {\n actionHandler()?.();\n if (content().shouldCloseOnAction) {\n state.close(props.toast.key);\n state.remove(props.toast.key);\n }\n };\n\n return (\n <Toast toast={props.toast}>\n <div style={{ display: \"flex\", \"align-items\": \"flex-start\", gap: \"12px\" }}>\n <ToastContent style={{ flex: 1 }}>\n <Show when={title()}>\n <ToastTitle style={{ \"font-weight\": \"bold\", \"margin-bottom\": \"4px\" }}>\n {title()}\n </ToastTitle>\n </Show>\n <Show when={content().description}>\n <ToastDescription>{content().description}</ToastDescription>\n </Show>\n <Show when={actionLabel()}>\n <button type=\"button\" style={{ \"margin-top\": \"8px\" }} onClick={handleAction}>\n {actionLabel()}\n </button>\n </Show>\n </ToastContent>\n <ToastCloseButton toast={props.toast} />\n </div>\n </Toast>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuJA,MAAa,eAAe,cAA+C,IAAI;AAQ/E,MAAM,mBAAmB,cAA4C,IAAI;AACzE,MAAa,sBAAsB,cACjC,CAAC,CACH;AACA,MAAM,kCAAkB,IAAI,IAAsC;AAElE,SAAgB,kBAA4C;CAC1D,MAAM,UAAU,WAAW,YAAY;CACvC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,sDAAsD;CAExE,OAAO;AACT;;AAGA,MAAa,mBAAmB,IAAI,WAAyB;CAC3D,kBAAkB;CAClB,kBAAkB;AACpB,CAAC;;;;;AAMD,SAAgB,SAAS,SAAuB,SAAgC;CAC9E,OAAO,iBAAiB,IAAI,SAAS,OAAO;AAC9C;AAEA,SAAS,wBAAwB,WAA2C;CAC1E,QAAQ,aAAa,SAAA,CAAU,QAAQ,KAAK,GAAG;AACjD;;;;;;;;;;;;;AAuBA,SAAgB,cAAc,OAAwC;CACpE,MAAM,QAAQ,MAAM,iBAChB,mBACA,IAAI,WAAyB,MAAM,YAAY;CAEnD,MAAM,QAAQ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ggleButton component for solidaria-components
3
- *
4
- * A pre-wired headless toggle button that combines pressed + selected state.
5
- * Port direction: react-aria-components/src/ToggleButton.tsx
6
- */
7
- import { type JSX } from "solid-js";
1
+ import type { JSX } from "@solidjs/web";
8
2
  import { type AriaToggleButtonProps } from "@proyecto-viviana/solidaria";
9
3
  import type { Key } from "@proyecto-viviana/solid-stately";
10
4
  import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";