@proyecto-viviana/solidaria-components 0.5.1 → 0.7.0-rc.1

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 (655) hide show
  1. package/LICENSE-APACHE-2.0 +201 -0
  2. package/NOTICE +91 -0
  3. package/README.md +57 -34
  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 +20 -17
  19. package/dist/Alert.js.map +1 -1
  20. package/dist/Alert.jsx +10 -6
  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 +19 -6
  25. package/dist/Autocomplete.js.map +1 -1
  26. package/dist/Autocomplete.jsx +21 -8
  27. package/dist/Autocomplete.jsx.map +1 -1
  28. package/dist/Breadcrumbs.d.ts +2 -1
  29. package/dist/Breadcrumbs.d.ts.map +1 -1
  30. package/dist/Breadcrumbs.js +152 -59
  31. package/dist/Breadcrumbs.js.map +1 -1
  32. package/dist/Breadcrumbs.jsx +99 -19
  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 +144 -79
  37. package/dist/Button.js.map +1 -1
  38. package/dist/Button.jsx +124 -50
  39. package/dist/Button.jsx.map +1 -1
  40. package/dist/Calendar.d.ts +9 -7
  41. package/dist/Calendar.d.ts.map +1 -1
  42. package/dist/Calendar.js +321 -228
  43. package/dist/Calendar.js.map +1 -1
  44. package/dist/Calendar.jsx +74 -41
  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 +3 -19
  53. package/dist/Checkbox.d.ts.map +1 -1
  54. package/dist/Checkbox.js +422 -317
  55. package/dist/Checkbox.js.map +1 -1
  56. package/dist/Checkbox.jsx +150 -131
  57. package/dist/Checkbox.jsx.map +1 -1
  58. package/dist/Collection.d.ts +152 -6
  59. package/dist/Collection.d.ts.map +1 -1
  60. package/dist/Collection.js +245 -78
  61. package/dist/Collection.js.map +1 -1
  62. package/dist/Collection.jsx +150 -12
  63. package/dist/Collection.jsx.map +1 -1
  64. package/dist/Color.d.ts +8 -572
  65. package/dist/Color.d.ts.map +1 -1
  66. package/dist/Color.js +8 -1717
  67. package/dist/Color.jsx +8 -1340
  68. package/dist/ColorArea.d.ts +104 -0
  69. package/dist/ColorArea.d.ts.map +1 -0
  70. package/dist/ColorArea.js +382 -0
  71. package/dist/ColorArea.js.map +1 -0
  72. package/dist/ColorArea.jsx +286 -0
  73. package/dist/ColorArea.jsx.map +1 -0
  74. package/dist/ColorEditor.d.ts +3 -1
  75. package/dist/ColorEditor.d.ts.map +1 -1
  76. package/dist/ColorEditor.js +147 -125
  77. package/dist/ColorEditor.js.map +1 -1
  78. package/dist/ColorEditor.jsx +12 -6
  79. package/dist/ColorEditor.jsx.map +1 -1
  80. package/dist/ColorField.d.ts +89 -0
  81. package/dist/ColorField.d.ts.map +1 -0
  82. package/dist/ColorField.js +395 -0
  83. package/dist/ColorField.js.map +1 -0
  84. package/dist/ColorField.jsx +280 -0
  85. package/dist/ColorField.jsx.map +1 -0
  86. package/dist/ColorPicker.d.ts +33 -0
  87. package/dist/ColorPicker.d.ts.map +1 -0
  88. package/dist/ColorPicker.js +86 -0
  89. package/dist/ColorPicker.js.map +1 -0
  90. package/dist/ColorPicker.jsx +67 -0
  91. package/dist/ColorPicker.jsx.map +1 -0
  92. package/dist/ColorSlider.d.ts +145 -0
  93. package/dist/ColorSlider.d.ts.map +1 -0
  94. package/dist/ColorSlider.js +444 -0
  95. package/dist/ColorSlider.js.map +1 -0
  96. package/dist/ColorSlider.jsx +319 -0
  97. package/dist/ColorSlider.jsx.map +1 -0
  98. package/dist/ColorSwatch.d.ts +37 -0
  99. package/dist/ColorSwatch.d.ts.map +1 -0
  100. package/dist/ColorSwatch.js +101 -0
  101. package/dist/ColorSwatch.js.map +1 -0
  102. package/dist/ColorSwatch.jsx +84 -0
  103. package/dist/ColorSwatch.jsx.map +1 -0
  104. package/dist/ColorSwatchPicker.d.ts +82 -0
  105. package/dist/ColorSwatchPicker.d.ts.map +1 -0
  106. package/dist/ColorSwatchPicker.js +364 -0
  107. package/dist/ColorSwatchPicker.js.map +1 -0
  108. package/dist/ColorSwatchPicker.jsx +314 -0
  109. package/dist/ColorSwatchPicker.jsx.map +1 -0
  110. package/dist/ColorThumb.d.ts +16 -0
  111. package/dist/ColorThumb.d.ts.map +1 -0
  112. package/dist/ColorThumb.js +14 -0
  113. package/dist/ColorThumb.jsx +14 -0
  114. package/dist/ColorWheel.d.ts +103 -0
  115. package/dist/ColorWheel.d.ts.map +1 -0
  116. package/dist/ColorWheel.js +312 -0
  117. package/dist/ColorWheel.js.map +1 -0
  118. package/dist/ColorWheel.jsx +224 -0
  119. package/dist/ColorWheel.jsx.map +1 -0
  120. package/dist/ComboBox.d.ts +68 -32
  121. package/dist/ComboBox.d.ts.map +1 -1
  122. package/dist/ComboBox.js +564 -292
  123. package/dist/ComboBox.js.map +1 -1
  124. package/dist/ComboBox.jsx +235 -89
  125. package/dist/ComboBox.jsx.map +1 -1
  126. package/dist/ContextualHelpTrigger.d.ts +1 -7
  127. package/dist/ContextualHelpTrigger.d.ts.map +1 -1
  128. package/dist/ContextualHelpTrigger.js +104 -86
  129. package/dist/ContextualHelpTrigger.js.map +1 -1
  130. package/dist/ContextualHelpTrigger.jsx +38 -30
  131. package/dist/ContextualHelpTrigger.jsx.map +1 -1
  132. package/dist/DateField.d.ts +15 -9
  133. package/dist/DateField.d.ts.map +1 -1
  134. package/dist/DateField.js +0 -2
  135. package/dist/DateField.jsx +0 -2
  136. package/dist/DateField2.js +262 -196
  137. package/dist/DateField2.js.map +1 -1
  138. package/dist/DateField2.jsx +114 -74
  139. package/dist/DateField2.jsx.map +1 -1
  140. package/dist/DatePicker.d.ts +13 -34
  141. package/dist/DatePicker.d.ts.map +1 -1
  142. package/dist/DatePicker.js +3 -2
  143. package/dist/DatePicker.jsx +3 -2
  144. package/dist/DatePicker2.js +671 -512
  145. package/dist/DatePicker2.js.map +1 -1
  146. package/dist/DatePicker2.jsx +342 -222
  147. package/dist/DatePicker2.jsx.map +1 -1
  148. package/dist/DateRangePickerContext.d.ts +7 -0
  149. package/dist/DateRangePickerContext.d.ts.map +1 -1
  150. package/dist/Dialog.d.ts +6 -25
  151. package/dist/Dialog.d.ts.map +1 -1
  152. package/dist/Dialog.js +181 -232
  153. package/dist/Dialog.js.map +1 -1
  154. package/dist/Dialog.jsx +138 -98
  155. package/dist/Dialog.jsx.map +1 -1
  156. package/dist/Disclosure.d.ts +1 -9
  157. package/dist/Disclosure.d.ts.map +1 -1
  158. package/dist/Disclosure.js +167 -92
  159. package/dist/Disclosure.js.map +1 -1
  160. package/dist/Disclosure.jsx +62 -22
  161. package/dist/Disclosure.jsx.map +1 -1
  162. package/dist/DragAndDrop.d.ts +9 -6
  163. package/dist/DragAndDrop.d.ts.map +1 -1
  164. package/dist/DragAndDrop.js +40 -23
  165. package/dist/DragAndDrop.js.map +1 -1
  166. package/dist/DragAndDrop.jsx +23 -5
  167. package/dist/DragAndDrop.jsx.map +1 -1
  168. package/dist/DragPreview.d.ts +1 -1
  169. package/dist/DragPreview.d.ts.map +1 -1
  170. package/dist/DropZone.d.ts +4 -3
  171. package/dist/DropZone.d.ts.map +1 -1
  172. package/dist/DropZone.js +107 -57
  173. package/dist/DropZone.js.map +1 -1
  174. package/dist/DropZone.jsx +49 -13
  175. package/dist/DropZone.jsx.map +1 -1
  176. package/dist/ElementTag.d.ts +9 -20
  177. package/dist/ElementTag.d.ts.map +1 -1
  178. package/dist/ElementTag.js +8 -210
  179. package/dist/ElementTag.js.map +1 -1
  180. package/dist/ElementTag.jsx +8 -57
  181. package/dist/ElementTag.jsx.map +1 -1
  182. package/dist/FieldError.d.ts +8 -7
  183. package/dist/FieldError.d.ts.map +1 -1
  184. package/dist/FieldError.js +33 -13
  185. package/dist/FieldError.js.map +1 -1
  186. package/dist/FieldError.jsx +20 -5
  187. package/dist/FieldError.jsx.map +1 -1
  188. package/dist/FileTrigger.d.ts +1 -7
  189. package/dist/FileTrigger.d.ts.map +1 -1
  190. package/dist/FileTrigger.js +69 -17
  191. package/dist/FileTrigger.js.map +1 -1
  192. package/dist/FileTrigger.jsx +49 -3
  193. package/dist/FileTrigger.jsx.map +1 -1
  194. package/dist/Focusable.d.ts +2 -8
  195. package/dist/Focusable.d.ts.map +1 -1
  196. package/dist/Focusable.js +23 -6
  197. package/dist/Focusable.js.map +1 -1
  198. package/dist/Focusable.jsx +22 -5
  199. package/dist/Focusable.jsx.map +1 -1
  200. package/dist/Form.d.ts +9 -8
  201. package/dist/Form.d.ts.map +1 -1
  202. package/dist/Form.js +82 -42
  203. package/dist/Form.js.map +1 -1
  204. package/dist/Form.jsx +52 -17
  205. package/dist/Form.jsx.map +1 -1
  206. package/dist/GridList.d.ts +65 -37
  207. package/dist/GridList.d.ts.map +1 -1
  208. package/dist/GridList.js +512 -277
  209. package/dist/GridList.js.map +1 -1
  210. package/dist/GridList.jsx +307 -134
  211. package/dist/GridList.jsx.map +1 -1
  212. package/dist/Heading.d.ts +15 -0
  213. package/dist/Heading.d.ts.map +1 -0
  214. package/dist/Heading.js +55 -0
  215. package/dist/Heading.js.map +1 -0
  216. package/dist/Heading.jsx +40 -0
  217. package/dist/Heading.jsx.map +1 -0
  218. package/dist/HiddenDateInput.d.ts +1 -7
  219. package/dist/HiddenDateInput.d.ts.map +1 -1
  220. package/dist/Icon.d.ts +4 -1
  221. package/dist/Icon.d.ts.map +1 -1
  222. package/dist/Icon.js +55 -38
  223. package/dist/Icon.js.map +1 -1
  224. package/dist/Icon.jsx +12 -4
  225. package/dist/Icon.jsx.map +1 -1
  226. package/dist/Keyboard.d.ts +1 -7
  227. package/dist/Keyboard.d.ts.map +1 -1
  228. package/dist/Keyboard.js +24 -11
  229. package/dist/Keyboard.js.map +1 -1
  230. package/dist/Keyboard.jsx +15 -2
  231. package/dist/Keyboard.jsx.map +1 -1
  232. package/dist/Label.d.ts +20 -0
  233. package/dist/Label.d.ts.map +1 -0
  234. package/dist/Label.js +60 -0
  235. package/dist/Label.js.map +1 -0
  236. package/dist/Label.jsx +47 -0
  237. package/dist/Label.jsx.map +1 -0
  238. package/dist/Landmark.d.ts +4 -1
  239. package/dist/Landmark.d.ts.map +1 -1
  240. package/dist/Landmark.js +10 -4
  241. package/dist/Landmark.js.map +1 -1
  242. package/dist/Landmark.jsx +5 -1
  243. package/dist/Landmark.jsx.map +1 -1
  244. package/dist/Link.d.ts +4 -7
  245. package/dist/Link.d.ts.map +1 -1
  246. package/dist/Link.js +80 -47
  247. package/dist/Link.js.map +1 -1
  248. package/dist/Link.jsx +76 -21
  249. package/dist/Link.jsx.map +1 -1
  250. package/dist/ListBox.d.ts +62 -33
  251. package/dist/ListBox.d.ts.map +1 -1
  252. package/dist/ListBox.js +858 -411
  253. package/dist/ListBox.js.map +1 -1
  254. package/dist/ListBox.jsx +478 -268
  255. package/dist/ListBox.jsx.map +1 -1
  256. package/dist/ListDropTargetDelegate.d.ts +3 -0
  257. package/dist/ListDropTargetDelegate.d.ts.map +1 -1
  258. package/dist/Menu.d.ts +51 -34
  259. package/dist/Menu.d.ts.map +1 -1
  260. package/dist/Menu.js +808 -427
  261. package/dist/Menu.js.map +1 -1
  262. package/dist/Menu.jsx +570 -296
  263. package/dist/Menu.jsx.map +1 -1
  264. package/dist/Meter.d.ts +6 -13
  265. package/dist/Meter.d.ts.map +1 -1
  266. package/dist/Meter.js +55 -18
  267. package/dist/Meter.js.map +1 -1
  268. package/dist/Meter.jsx +33 -8
  269. package/dist/Meter.jsx.map +1 -1
  270. package/dist/Modal.d.ts +1 -7
  271. package/dist/Modal.d.ts.map +1 -1
  272. package/dist/Modal.js +106 -74
  273. package/dist/Modal.js.map +1 -1
  274. package/dist/Modal.jsx +68 -57
  275. package/dist/Modal.jsx.map +1 -1
  276. package/dist/NumberField.d.ts +6 -9
  277. package/dist/NumberField.d.ts.map +1 -1
  278. package/dist/NumberField.js +344 -136
  279. package/dist/NumberField.js.map +1 -1
  280. package/dist/NumberField.jsx +194 -38
  281. package/dist/NumberField.jsx.map +1 -1
  282. package/dist/Popover.d.ts +21 -7
  283. package/dist/Popover.d.ts.map +1 -1
  284. package/dist/Popover.js +392 -192
  285. package/dist/Popover.js.map +1 -1
  286. package/dist/Popover.jsx +237 -93
  287. package/dist/Popover.jsx.map +1 -1
  288. package/dist/Pressable.d.ts +2 -8
  289. package/dist/Pressable.d.ts.map +1 -1
  290. package/dist/Pressable.js +23 -6
  291. package/dist/Pressable.js.map +1 -1
  292. package/dist/Pressable.jsx +22 -5
  293. package/dist/Pressable.jsx.map +1 -1
  294. package/dist/PreviewTrigger.d.ts +24 -0
  295. package/dist/PreviewTrigger.d.ts.map +1 -0
  296. package/dist/PreviewTrigger.js +128 -0
  297. package/dist/PreviewTrigger.js.map +1 -0
  298. package/dist/PreviewTrigger.jsx +117 -0
  299. package/dist/PreviewTrigger.jsx.map +1 -0
  300. package/dist/ProgressBar.d.ts +1 -7
  301. package/dist/ProgressBar.d.ts.map +1 -1
  302. package/dist/ProgressBar.js +49 -16
  303. package/dist/ProgressBar.js.map +1 -1
  304. package/dist/ProgressBar.jsx +30 -6
  305. package/dist/ProgressBar.jsx.map +1 -1
  306. package/dist/RadioGroup.d.ts +4 -20
  307. package/dist/RadioGroup.d.ts.map +1 -1
  308. package/dist/RadioGroup.js +459 -338
  309. package/dist/RadioGroup.js.map +1 -1
  310. package/dist/RadioGroup.jsx +186 -153
  311. package/dist/RadioGroup.jsx.map +1 -1
  312. package/dist/RangeCalendar.d.ts +11 -7
  313. package/dist/RangeCalendar.d.ts.map +1 -1
  314. package/dist/RangeCalendar.js +299 -208
  315. package/dist/RangeCalendar.js.map +1 -1
  316. package/dist/RangeCalendar.jsx +79 -47
  317. package/dist/RangeCalendar.jsx.map +1 -1
  318. package/dist/RouterProvider.d.ts +17 -69
  319. package/dist/RouterProvider.d.ts.map +1 -1
  320. package/dist/RouterProvider.js +12 -116
  321. package/dist/RouterProvider.jsx +12 -110
  322. package/dist/SearchField.d.ts +5 -8
  323. package/dist/SearchField.d.ts.map +1 -1
  324. package/dist/SearchField.js +212 -181
  325. package/dist/SearchField.js.map +1 -1
  326. package/dist/SearchField.jsx +94 -78
  327. package/dist/SearchField.jsx.map +1 -1
  328. package/dist/Select.d.ts +73 -36
  329. package/dist/Select.d.ts.map +1 -1
  330. package/dist/Select.js +700 -453
  331. package/dist/Select.js.map +1 -1
  332. package/dist/Select.jsx +356 -237
  333. package/dist/Select.jsx.map +1 -1
  334. package/dist/SelectionIndicator.d.ts +1 -4
  335. package/dist/SelectionIndicator.d.ts.map +1 -1
  336. package/dist/SelectionIndicator.js +29 -13
  337. package/dist/SelectionIndicator.js.map +1 -1
  338. package/dist/SelectionIndicator.jsx +18 -4
  339. package/dist/SelectionIndicator.jsx.map +1 -1
  340. package/dist/Separator.d.ts +3 -9
  341. package/dist/Separator.d.ts.map +1 -1
  342. package/dist/Separator.js +24 -12
  343. package/dist/Separator.js.map +1 -1
  344. package/dist/Separator.jsx +18 -9
  345. package/dist/Separator.jsx.map +1 -1
  346. package/dist/SharedElementTransition.d.ts +1 -10
  347. package/dist/SharedElementTransition.d.ts.map +1 -1
  348. package/dist/SharedElementTransition.js +68 -40
  349. package/dist/SharedElementTransition.js.map +1 -1
  350. package/dist/SharedElementTransition.jsx +49 -25
  351. package/dist/SharedElementTransition.jsx.map +1 -1
  352. package/dist/Slider.d.ts +25 -26
  353. package/dist/Slider.d.ts.map +1 -1
  354. package/dist/Slider.js +324 -167
  355. package/dist/Slider.js.map +1 -1
  356. package/dist/Slider.jsx +195 -93
  357. package/dist/Slider.jsx.map +1 -1
  358. package/dist/StepList.d.ts +2 -8
  359. package/dist/StepList.d.ts.map +1 -1
  360. package/dist/StepList.js +121 -75
  361. package/dist/StepList.js.map +1 -1
  362. package/dist/StepList.jsx +67 -27
  363. package/dist/StepList.jsx.map +1 -1
  364. package/dist/Switch.d.ts +17 -11
  365. package/dist/Switch.d.ts.map +1 -1
  366. package/dist/Switch.js +213 -128
  367. package/dist/Switch.js.map +1 -1
  368. package/dist/Switch.jsx +68 -31
  369. package/dist/Switch.jsx.map +1 -1
  370. package/dist/Table.d.ts +21 -2
  371. package/dist/Table.d.ts.map +1 -1
  372. package/dist/Table.js +938 -638
  373. package/dist/Table.js.map +1 -1
  374. package/dist/Table.jsx +537 -259
  375. package/dist/Table.jsx.map +1 -1
  376. package/dist/Tabs.d.ts +2 -7
  377. package/dist/Tabs.d.ts.map +1 -1
  378. package/dist/Tabs.js +322 -300
  379. package/dist/Tabs.js.map +1 -1
  380. package/dist/Tabs.jsx +106 -67
  381. package/dist/Tabs.jsx.map +1 -1
  382. package/dist/TagGroup.d.ts +32 -22
  383. package/dist/TagGroup.d.ts.map +1 -1
  384. package/dist/TagGroup.js +377 -136
  385. package/dist/TagGroup.js.map +1 -1
  386. package/dist/TagGroup.jsx +220 -53
  387. package/dist/TagGroup.jsx.map +1 -1
  388. package/dist/Text.d.ts +3 -3
  389. package/dist/Text.d.ts.map +1 -1
  390. package/dist/Text.js +38 -8
  391. package/dist/Text.js.map +1 -1
  392. package/dist/Text.jsx +27 -5
  393. package/dist/Text.jsx.map +1 -1
  394. package/dist/TextField.d.ts +4 -17
  395. package/dist/TextField.d.ts.map +1 -1
  396. package/dist/TextField.js +116 -142
  397. package/dist/TextField.js.map +1 -1
  398. package/dist/TextField.jsx +88 -115
  399. package/dist/TextField.jsx.map +1 -1
  400. package/dist/TimeField.d.ts +3 -16
  401. package/dist/TimeField.d.ts.map +1 -1
  402. package/dist/TimeField.js +121 -107
  403. package/dist/TimeField.js.map +1 -1
  404. package/dist/TimeField.jsx +67 -54
  405. package/dist/TimeField.jsx.map +1 -1
  406. package/dist/Toast.d.ts +27 -14
  407. package/dist/Toast.d.ts.map +1 -1
  408. package/dist/Toast.js +273 -113
  409. package/dist/Toast.js.map +1 -1
  410. package/dist/Toast.jsx +182 -32
  411. package/dist/Toast.jsx.map +1 -1
  412. package/dist/ToggleButton.d.ts +1 -7
  413. package/dist/ToggleButton.d.ts.map +1 -1
  414. package/dist/ToggleButton.js +75 -35
  415. package/dist/ToggleButton.js.map +1 -1
  416. package/dist/ToggleButton.jsx +39 -13
  417. package/dist/ToggleButton.jsx.map +1 -1
  418. package/dist/ToggleButtonGroup.d.ts +1 -7
  419. package/dist/ToggleButtonGroup.d.ts.map +1 -1
  420. package/dist/ToggleButtonGroup.js +59 -44
  421. package/dist/ToggleButtonGroup.js.map +1 -1
  422. package/dist/ToggleButtonGroup.jsx +25 -12
  423. package/dist/ToggleButtonGroup.jsx.map +1 -1
  424. package/dist/TokenField.d.ts +54 -0
  425. package/dist/TokenField.d.ts.map +1 -0
  426. package/dist/TokenField.js +374 -0
  427. package/dist/TokenField.js.map +1 -0
  428. package/dist/TokenField.jsx +272 -0
  429. package/dist/TokenField.jsx.map +1 -0
  430. package/dist/Toolbar.d.ts +2 -7
  431. package/dist/Toolbar.d.ts.map +1 -1
  432. package/dist/Toolbar.js +37 -22
  433. package/dist/Toolbar.js.map +1 -1
  434. package/dist/Toolbar.jsx +17 -8
  435. package/dist/Toolbar.jsx.map +1 -1
  436. package/dist/Tooltip.d.ts +2 -7
  437. package/dist/Tooltip.d.ts.map +1 -1
  438. package/dist/Tooltip.js +128 -78
  439. package/dist/Tooltip.js.map +1 -1
  440. package/dist/Tooltip.jsx +83 -46
  441. package/dist/Tooltip.jsx.map +1 -1
  442. package/dist/Tree.d.ts +85 -39
  443. package/dist/Tree.d.ts.map +1 -1
  444. package/dist/Tree.js +926 -414
  445. package/dist/Tree.js.map +1 -1
  446. package/dist/Tree.jsx +450 -195
  447. package/dist/Tree.jsx.map +1 -1
  448. package/dist/Virtualizer.d.ts +41 -10
  449. package/dist/Virtualizer.d.ts.map +1 -1
  450. package/dist/Virtualizer.js +2 -2
  451. package/dist/Virtualizer.jsx +2 -2
  452. package/dist/Virtualizer2.js +554 -144
  453. package/dist/Virtualizer2.js.map +1 -1
  454. package/dist/Virtualizer2.jsx +516 -124
  455. package/dist/Virtualizer2.jsx.map +1 -1
  456. package/dist/VirtualizerLayouts.d.ts +55 -2
  457. package/dist/VirtualizerLayouts.d.ts.map +1 -1
  458. package/dist/VisuallyHidden.d.ts +4 -3
  459. package/dist/VisuallyHidden.d.ts.map +1 -1
  460. package/dist/VisuallyHidden.js +18 -11
  461. package/dist/VisuallyHidden.js.map +1 -1
  462. package/dist/VisuallyHidden.jsx +15 -9
  463. package/dist/VisuallyHidden.jsx.map +1 -1
  464. package/dist/calendarHeadingTitle.d.ts +14 -0
  465. package/dist/calendarHeadingTitle.d.ts.map +1 -0
  466. package/dist/calendarHeadingTitle.js +23 -0
  467. package/dist/calendarHeadingTitle.js.map +1 -0
  468. package/dist/calendarHeadingTitle.jsx +23 -0
  469. package/dist/calendarHeadingTitle.jsx.map +1 -0
  470. package/dist/contexts.d.ts +31 -1
  471. package/dist/contexts.d.ts.map +1 -1
  472. package/dist/contexts.js +9 -1
  473. package/dist/contexts.js.map +1 -1
  474. package/dist/contexts.jsx +9 -1
  475. package/dist/contexts.jsx.map +1 -1
  476. package/dist/fileTriggerContext.d.ts +5 -0
  477. package/dist/fileTriggerContext.d.ts.map +1 -0
  478. package/dist/fileTriggerContext.js +7 -0
  479. package/dist/fileTriggerContext.js.map +1 -0
  480. package/dist/fileTriggerContext.jsx +7 -0
  481. package/dist/fileTriggerContext.jsx.map +1 -0
  482. package/dist/index.d.ts +27 -15
  483. package/dist/index.d.ts.map +1 -1
  484. package/dist/index.js +30 -18
  485. package/dist/index.jsx +30 -18
  486. package/dist/intl/index.d.ts +16 -0
  487. package/dist/intl/index.d.ts.map +1 -0
  488. package/dist/intl.js +212 -0
  489. package/dist/intl.js.map +1 -0
  490. package/dist/intl.jsx +212 -0
  491. package/dist/intl.jsx.map +1 -0
  492. package/dist/loadMoreSentinel.d.ts +7 -0
  493. package/dist/loadMoreSentinel.d.ts.map +1 -0
  494. package/dist/loadMoreSentinel.js +30 -0
  495. package/dist/loadMoreSentinel.js.map +1 -0
  496. package/dist/loadMoreSentinel.jsx +30 -0
  497. package/dist/loadMoreSentinel.jsx.map +1 -0
  498. package/dist/slots.d.ts +35 -0
  499. package/dist/slots.d.ts.map +1 -0
  500. package/dist/slots.js +66 -0
  501. package/dist/slots.js.map +1 -0
  502. package/dist/slots.jsx +66 -0
  503. package/dist/slots.jsx.map +1 -0
  504. package/dist/staticSelectCollection.d.ts +2 -0
  505. package/dist/staticSelectCollection.d.ts.map +1 -0
  506. package/dist/staticSelectCollection.js +2 -0
  507. package/dist/staticSelectCollection.jsx +2 -0
  508. package/dist/useDragAndDrop.d.ts +6 -2
  509. package/dist/useDragAndDrop.d.ts.map +1 -1
  510. package/dist/useDragAndDrop2.js +39 -21
  511. package/dist/useDragAndDrop2.js.map +1 -1
  512. package/dist/useDragAndDrop2.jsx +39 -21
  513. package/dist/useDragAndDrop2.jsx.map +1 -1
  514. package/dist/utils.d.ts +49 -9
  515. package/dist/utils.d.ts.map +1 -1
  516. package/dist/utils.js +119 -24
  517. package/dist/utils.js.map +1 -1
  518. package/dist/utils.jsx +110 -24
  519. package/dist/utils.jsx.map +1 -1
  520. package/dist/virtualizer/Layout.d.ts +12 -2
  521. package/dist/virtualizer/Layout.d.ts.map +1 -1
  522. package/dist/virtualizer/Layout.js +23 -2
  523. package/dist/virtualizer/Layout.js.map +1 -1
  524. package/dist/virtualizer/Layout.jsx +23 -2
  525. package/dist/virtualizer/Layout.jsx.map +1 -1
  526. package/package.json +87 -10
  527. package/src/ActionBar.tsx +50 -24
  528. package/src/ActionGroup.tsx +30 -19
  529. package/src/Alert.tsx +12 -7
  530. package/src/Autocomplete.tsx +25 -16
  531. package/src/Breadcrumbs.tsx +139 -24
  532. package/src/Button.tsx +214 -76
  533. package/src/Calendar.tsx +120 -61
  534. package/src/CalendarPicker.tsx +16 -1
  535. package/src/Checkbox.tsx +205 -227
  536. package/src/Collection.tsx +334 -12
  537. package/src/Color.tsx +8 -2454
  538. package/src/ColorArea.tsx +479 -0
  539. package/src/ColorEditor.tsx +9 -9
  540. package/src/ColorField.tsx +471 -0
  541. package/src/ColorPicker.tsx +126 -0
  542. package/src/ColorSlider.tsx +562 -0
  543. package/src/ColorSwatch.tsx +129 -0
  544. package/src/ColorSwatchPicker.tsx +623 -0
  545. package/src/ColorThumb.tsx +19 -0
  546. package/src/ColorWheel.tsx +398 -0
  547. package/src/ComboBox.tsx +471 -173
  548. package/src/ContextualHelpTrigger.tsx +49 -65
  549. package/src/DateField.tsx +174 -131
  550. package/src/DatePicker.tsx +501 -376
  551. package/src/DateRangePickerContext.tsx +8 -0
  552. package/src/Dialog.tsx +224 -162
  553. package/src/Disclosure.tsx +85 -34
  554. package/src/DragAndDrop.tsx +51 -9
  555. package/src/DragPreview.tsx +20 -1
  556. package/src/DropZone.tsx +77 -42
  557. package/src/ElementTag.tsx +14 -104
  558. package/src/FieldError.tsx +39 -7
  559. package/src/FileTrigger.tsx +71 -4
  560. package/src/Focusable.tsx +27 -11
  561. package/src/Form.tsx +64 -15
  562. package/src/GridList.tsx +478 -214
  563. package/src/Heading.tsx +59 -0
  564. package/src/HiddenDateInput.tsx +19 -3
  565. package/src/Icon.tsx +19 -4
  566. package/src/Keyboard.tsx +18 -2
  567. package/src/Label.tsx +77 -0
  568. package/src/Landmark.tsx +6 -1
  569. package/src/Link.tsx +103 -30
  570. package/src/ListBox.tsx +924 -530
  571. package/src/ListDropTargetDelegate.ts +4 -0
  572. package/src/Menu.tsx +883 -465
  573. package/src/Meter.tsx +42 -8
  574. package/src/Modal.tsx +89 -80
  575. package/src/NumberField.tsx +267 -66
  576. package/src/Popover.tsx +454 -156
  577. package/src/Pressable.tsx +27 -11
  578. package/src/PreviewTrigger.tsx +171 -0
  579. package/src/ProgressBar.tsx +41 -5
  580. package/src/RadioGroup.tsx +358 -278
  581. package/src/RangeCalendar.tsx +130 -77
  582. package/src/RouterProvider.tsx +33 -215
  583. package/src/SearchField.tsx +157 -136
  584. package/src/Select.tsx +689 -453
  585. package/src/SelectionIndicator.tsx +21 -3
  586. package/src/Separator.tsx +22 -14
  587. package/src/SharedElementTransition.tsx +67 -46
  588. package/src/Slider.tsx +296 -120
  589. package/src/StepList.tsx +88 -38
  590. package/src/Switch.tsx +127 -51
  591. package/src/Table.tsx +842 -479
  592. package/src/Tabs.tsx +186 -156
  593. package/src/TagGroup.tsx +377 -90
  594. package/src/Text.tsx +39 -7
  595. package/src/TextField.tsx +136 -173
  596. package/src/TimeField.tsx +90 -93
  597. package/src/Toast.tsx +238 -82
  598. package/src/ToggleButton.tsx +60 -17
  599. package/src/ToggleButtonGroup.tsx +27 -9
  600. package/src/TokenField.tsx +502 -0
  601. package/src/Toolbar.tsx +21 -17
  602. package/src/Tooltip.tsx +157 -99
  603. package/src/Tree.tsx +888 -360
  604. package/src/Virtualizer.tsx +501 -148
  605. package/src/VirtualizerLayouts.ts +211 -26
  606. package/src/VisuallyHidden.tsx +22 -8
  607. package/src/calendarHeadingTitle.ts +37 -0
  608. package/src/contexts.ts +23 -1
  609. package/src/fileTriggerContext.ts +8 -0
  610. package/src/index.ts +98 -22
  611. package/src/intl/ar-AE.json +6 -0
  612. package/src/intl/bg-BG.json +6 -0
  613. package/src/intl/cs-CZ.json +6 -0
  614. package/src/intl/da-DK.json +6 -0
  615. package/src/intl/de-DE.json +6 -0
  616. package/src/intl/el-GR.json +6 -0
  617. package/src/intl/en-US.json +6 -0
  618. package/src/intl/es-ES.json +6 -0
  619. package/src/intl/et-EE.json +6 -0
  620. package/src/intl/fi-FI.json +6 -0
  621. package/src/intl/fr-FR.json +6 -0
  622. package/src/intl/he-IL.json +6 -0
  623. package/src/intl/hr-HR.json +6 -0
  624. package/src/intl/hu-HU.json +6 -0
  625. package/src/intl/index.ts +125 -0
  626. package/src/intl/it-IT.json +6 -0
  627. package/src/intl/ja-JP.json +6 -0
  628. package/src/intl/ko-KR.json +6 -0
  629. package/src/intl/lt-LT.json +6 -0
  630. package/src/intl/lv-LV.json +6 -0
  631. package/src/intl/nb-NO.json +6 -0
  632. package/src/intl/nl-NL.json +6 -0
  633. package/src/intl/pl-PL.json +6 -0
  634. package/src/intl/pt-BR.json +6 -0
  635. package/src/intl/pt-PT.json +6 -0
  636. package/src/intl/ro-RO.json +6 -0
  637. package/src/intl/ru-RU.json +6 -0
  638. package/src/intl/sk-SK.json +6 -0
  639. package/src/intl/sl-SI.json +6 -0
  640. package/src/intl/sr-SP.json +6 -0
  641. package/src/intl/sv-SE.json +6 -0
  642. package/src/intl/tr-TR.json +6 -0
  643. package/src/intl/uk-UA.json +6 -0
  644. package/src/intl/zh-CN.json +6 -0
  645. package/src/intl/zh-TW.json +6 -0
  646. package/src/loadMoreSentinel.ts +31 -0
  647. package/src/slots.tsx +103 -0
  648. package/src/staticSelectCollection.tsx +25 -0
  649. package/src/useDragAndDrop.ts +35 -33
  650. package/src/utils.tsx +178 -67
  651. package/src/virtualizer/Layout.ts +32 -2
  652. package/dist/Color.js.map +0 -1
  653. package/dist/Color.jsx.map +0 -1
  654. package/dist/RouterProvider.js.map +0 -1
  655. package/dist/RouterProvider.jsx.map +0 -1
package/dist/ActionBar.js CHANGED
@@ -1,7 +1,32 @@
1
- import { filterDOMProps, useRenderProps } from "./utils.js";
2
- import { className, createComponent, delegateEvents, effect, getNextElement, insert, mergeProps, runHydrationEvents, setAttribute, spread, style, template, use } from "solid-js/web";
3
- import { Show, createContext, createEffect, createMemo, splitProps, useContext } from "solid-js";
1
+ /*
2
+ * Copyright 2020 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
+ /*
13
+ * Copyright 2024 Adobe. All rights reserved.
14
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License. You may obtain a copy
16
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software distributed under
19
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
+ * OF ANY KIND, either express or implied. See the License for the specific language
21
+ * governing permissions and limitations under the License.
22
+ */
23
+ // Ported to SolidJS for Proyecto Viviana; based on packages/@adobe/react-spectrum/src/actionbar/ActionBarContainer.tsx
24
+ // Ported to SolidJS for Proyecto Viviana; based on packages/@react-spectrum/s2/src/ActionBar.tsx
25
+ import { dataAttr, filterDOMProps, useRenderProps } from "./utils.js";
26
+ import { className, createComponent, delegateEvents, effect, getNextElement, insert, readShallow, ref, runHydrationEvents, scope, setAttribute, spread, style, template } from "@solidjs/web";
27
+ import { Show, createContext, createEffect, createMemo, useContext } from "solid-js";
4
28
  import { announce } from "@proyecto-viviana/solidaria";
29
+ import { splitProps } from "@proyecto-viviana/solidaria/utils";
5
30
  //#region src/ActionBar.tsx
6
31
  /**
7
32
  * ActionBar component for solidaria-components
@@ -9,11 +34,17 @@ import { announce } from "@proyecto-viviana/solidaria";
9
34
  * Headless action bar that appears when items are selected in a collection.
10
35
  * Shows a selection count, clear button, and action buttons.
11
36
  *
12
- * No RAC headless equivalent — this is a thin component layer that ties
13
- * selection state to visibility and keyboard behavior.
37
+ * Based on packages/@react-spectrum/s2/src/ActionBar.tsx and
38
+ * https://github.com/adobe/react-spectrum/blob/5ecb3333001313e83898cd07644227897e3bae1f/packages/@adobe/react-spectrum/src/actionbar/ActionBarContainer.tsx.
39
+ * The Solid port keeps the S2 action-bar structure and the Spectrum
40
+ * ActionBarContainer ownership model. It exposes the selection count and clear
41
+ * action as separate headless primitives.
14
42
  */
15
- var _tmpl$ = /*#__PURE__*/ template(`<div>`), _tmpl$2 = /*#__PURE__*/ template(`<div style=position:relative>`), _tmpl$3 = /*#__PURE__*/ template(`<span>`), _tmpl$4 = /*#__PURE__*/ template(`<button type=button>`);
16
- function assignRef(ref, el) {
43
+ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
44
+ var _tmpl$2 = /* @__PURE__ */ template(`<div style=position:relative>`);
45
+ var _tmpl$3 = /* @__PURE__ */ template(`<span>`);
46
+ var _tmpl$4 = /* @__PURE__ */ template(`<button type=button>`);
47
+ function assignRef$1(ref, el) {
17
48
  if (!ref) return;
18
49
  if (typeof ref === "function") ref(el);
19
50
  else ref.current = el;
@@ -37,15 +68,14 @@ function ActionBar(props) {
37
68
  "actionsAvailableMessage",
38
69
  "ref"
39
70
  ]);
40
- const selectedItemCount = () => local.selectedItemCount ?? 0;
71
+ const selectedItemCount = createMemo(() => local.selectedItemCount ?? 0);
41
72
  const isOpen = () => selectedItemCount() !== 0;
42
73
  let wasOpen = false;
43
- createEffect(() => {
44
- const open = isOpen();
45
- if (open && !wasOpen) {
46
- const message = local.actionsAvailableMessage ?? "Actions available.";
47
- if (message) announce(message);
48
- }
74
+ createEffect(() => ({
75
+ open: isOpen(),
76
+ message: local.actionsAvailableMessage
77
+ }), ({ open, message }) => {
78
+ if (open && !wasOpen && message) announce(message);
49
79
  wasOpen = open;
50
80
  });
51
81
  const handleKeyDown = (e) => {
@@ -78,15 +108,17 @@ function ActionBar(props) {
78
108
  return isOpen();
79
109
  },
80
110
  get children() {
81
- return createComponent(ActionBarContext.Provider, {
111
+ return createComponent(ActionBarContext, {
82
112
  get value() {
83
113
  return contextValue();
84
114
  },
85
115
  get children() {
86
116
  var _el$ = getNextElement(_tmpl$);
87
- use((el) => assignRef(local.ref, el), _el$);
88
- spread(_el$, mergeProps(filteredDOMProps, {
89
- get ["class"]() {
117
+ ref(() => {
118
+ return (el) => assignRef$1(local.ref, el);
119
+ }, _el$);
120
+ spread(_el$, [filteredDOMProps, {
121
+ get "class"() {
90
122
  return renderProps.class();
91
123
  },
92
124
  get style() {
@@ -95,12 +127,14 @@ function ActionBar(props) {
95
127
  get slot() {
96
128
  return local.slot;
97
129
  },
98
- get ["data-open"]() {
99
- return isOpen() || void 0;
130
+ get "data-open"() {
131
+ return dataAttr(isOpen());
100
132
  },
101
- "onKeyDown": handleKeyDown
102
- }), false, true);
103
- insert(_el$, () => local.children);
133
+ onKeyDown: handleKeyDown
134
+ }], true);
135
+ insert(_el$, scope(() => {
136
+ return local.children;
137
+ }));
104
138
  runHydrationEvents();
105
139
  return _el$;
106
140
  }
@@ -112,20 +146,20 @@ function ActionBar(props) {
112
146
  * Container that positions a collection and its ActionBar.
113
147
  */
114
148
  function ActionBarContainer(props) {
115
- return (() => {
116
- var _el$2 = getNextElement(_tmpl$2);
117
- insert(_el$2, () => props.children);
118
- effect((_p$) => {
119
- var _v$ = props.class ?? "solidaria-ActionBarContainer", _v$2 = { ...props.style };
120
- _v$ !== _p$.e && className(_el$2, _p$.e = _v$);
121
- _p$.t = style(_el$2, _v$2, _p$.t);
122
- return _p$;
123
- }, {
124
- e: void 0,
125
- t: void 0
126
- });
127
- return _el$2;
128
- })();
149
+ var _el$2 = getNextElement(_tmpl$2);
150
+ insert(_el$2, scope(() => {
151
+ return props.children;
152
+ }));
153
+ effect(() => {
154
+ return {
155
+ e: readShallow(props.class ?? "solidaria-ActionBarContainer"),
156
+ t: { ...props.style }
157
+ };
158
+ }, ({ e, t }, _p$) => {
159
+ className(_el$2, e, _p$?.e);
160
+ style(_el$2, t, _p$?.t);
161
+ });
162
+ return _el$2;
129
163
  }
130
164
  /**
131
165
  * Displays the count of selected items.
@@ -139,34 +173,36 @@ function ActionBarSelectionCount(props) {
139
173
  if (count === 0) return "None selected";
140
174
  return `${count} selected`;
141
175
  };
142
- return (() => {
143
- var _el$3 = getNextElement(_tmpl$3);
144
- insert(_el$3, text);
145
- effect(() => className(_el$3, props.class));
146
- return _el$3;
147
- })();
176
+ var _el$3 = getNextElement(_tmpl$3);
177
+ insert(_el$3, scope(() => {
178
+ return text();
179
+ }));
180
+ effect(() => readShallow(props.class), (_v$, _$p) => {
181
+ className(_el$3, _v$, _$p);
182
+ });
183
+ return _el$3;
148
184
  }
149
185
  /**
150
186
  * Button to clear the current selection.
151
187
  */
152
188
  function ActionBarClearButton(props) {
153
189
  const ctx = useActionBarContext();
154
- return (() => {
155
- var _el$4 = getNextElement(_tmpl$4);
156
- _el$4.$$click = () => ctx?.onClearSelection?.();
157
- insert(_el$4, () => props.children ?? "✕");
158
- effect((_p$) => {
159
- var _v$3 = props["aria-label"] ?? "Clear selection", _v$4 = props.class;
160
- _v$3 !== _p$.e && setAttribute(_el$4, "aria-label", _p$.e = _v$3);
161
- _v$4 !== _p$.t && className(_el$4, _p$.t = _v$4);
162
- return _p$;
163
- }, {
164
- e: void 0,
165
- t: void 0
166
- });
167
- runHydrationEvents();
168
- return _el$4;
169
- })();
190
+ var _el$4 = getNextElement(_tmpl$4);
191
+ _el$4._$$click = () => ctx?.onClearSelection?.();
192
+ insert(_el$4, () => {
193
+ return props.children ?? "✕";
194
+ });
195
+ effect(() => {
196
+ return {
197
+ e: props["aria-label"] ?? "Clear selection",
198
+ t: readShallow(props.class)
199
+ };
200
+ }, ({ e, t }, _p$) => {
201
+ e !== _p$?.e && setAttribute(_el$4, "aria-label", e);
202
+ className(_el$4, t, _p$?.t);
203
+ });
204
+ runHydrationEvents();
205
+ return _el$4;
170
206
  }
171
207
  delegateEvents(["click"]);
172
208
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBar.js","names":["JSX","ParentProps","Show","createContext","createMemo","createEffect","splitProps","useContext","announce","Key","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","RefLike","el","T","current","assignRef","ref","ActionBarRenderProps","isOpen","selectedItemCount","ActionBarProps","Omit","HTMLAttributes","HTMLDivElement","onClearSelection","onAction","key","children","Element","class","style","onKeyDown","EventHandlerUnion","KeyboardEvent","actionsAvailableMessage","ActionBarContextValue","ActionBarContext","useActionBarContext","ActionBar","props","local","domProps","wasOpen","open","message","handleKeyDown","e","EventHandler","defaultPrevented","preventDefault","stopPropagation","renderProps","undefined","defaultClassName","filteredDOMProps","Record","global","contextValue","_$createComponent","when","Provider","value","_el$","_$getNextElement","_tmpl$","_$use","_$spread","_$mergeProps","slot","data-open","_$insert","_$runHydrationEvents","ActionBarContainerProps","CSSProperties","ActionBarContainer","_el$2","_tmpl$2","_$effect","_p$","_v$","_v$2","_$className","t","_$style","ActionBarSelectionCountProps","ActionBarSelectionCount","ctx","text","count","_el$3","_tmpl$3","ActionBarClearButtonProps","ActionBarClearButton","_el$4","_tmpl$4","$$click","_v$3","_v$4","_$setAttribute","_$delegateEvents"],"sources":["../src/ActionBar.tsx"],"sourcesContent":["/**\n * ActionBar component for solidaria-components\n *\n * Headless action bar that appears when items are selected in a collection.\n * Shows a selection count, clear button, and action buttons.\n *\n * No RAC headless equivalent — this is a thin component layer that ties\n * selection state to visibility and keyboard behavior.\n */\n\nimport {\n type JSX,\n type ParentProps,\n Show,\n createContext,\n createMemo,\n createEffect,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { announce } from \"@proyecto-viviana/solidaria\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface ActionBarRenderProps {\n /** Whether the action bar is visible. */\n isOpen: boolean;\n /** The number of selected items. */\n selectedItemCount: number | \"all\";\n}\n\nexport interface ActionBarProps\n extends\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\" | \"ref\" | \"slot\">,\n SlotProps {\n /** The number of selected items. ActionBar is hidden when 0. @default 0 */\n selectedItemCount?: number | \"all\";\n /** Callback when the clear button is pressed. */\n onClearSelection?: () => void;\n /** Callback when an action is triggered. */\n onAction?: (key: Key) => void;\n /** The action buttons to display. */\n children?: JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionBarRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionBarRenderProps>;\n /** Accessible label for the action bar. @default 'Actions' */\n \"aria-label\"?: string;\n /** Identifies the element (or elements) that labels the action bar. */\n \"aria-labelledby\"?: string;\n /** Optional keydown handler on the action bar element. */\n onKeyDown?: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent>;\n /** Screen reader announcement when the action bar becomes available. */\n actionsAvailableMessage?: string;\n /** Ref for the underlying action bar element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface ActionBarContextValue {\n selectedItemCount: () => number | \"all\";\n onClearSelection?: () => void;\n onAction?: (key: Key) => void;\n}\n\nexport const ActionBarContext = createContext<ActionBarContextValue | null>(null);\n\nexport function useActionBarContext(): ActionBarContextValue | null {\n return useContext(ActionBarContext);\n}\n\nexport function ActionBar(props: ActionBarProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"selectedItemCount\",\n \"onClearSelection\",\n \"onAction\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"aria-label\",\n \"aria-labelledby\",\n \"onKeyDown\",\n \"actionsAvailableMessage\",\n \"ref\",\n ]);\n\n const selectedItemCount = () => local.selectedItemCount ?? 0;\n const isOpen = () => selectedItemCount() !== 0;\n\n // Faithful to S2 `ActionBar` (ActionBar.tsx:192): the ROOT is a PLAIN\n // container with NO `role` — S2 spreads only `keyboardProps` (an Escape\n // handler that clears the selection) onto it. The single `toolbar` is the\n // inner `ActionButtonGroup` (styled layer), NOT this root. Applying\n // `createToolbar` here would (a) give the root a spurious `role=\"toolbar\"`\n // S2 never renders and (b) nest the real action toolbar inside it, forcing\n // its role to downgrade to `group`. So the root deliberately carries no\n // toolbar props — `aria-label`/`aria-labelledby` are consumed by the inner\n // ActionButtonGroup at the styled layer.\n let wasOpen = false;\n createEffect(() => {\n const open = isOpen();\n if (open && !wasOpen) {\n const message = local.actionsAvailableMessage ?? \"Actions available.\";\n if (message) {\n announce(message);\n }\n }\n wasOpen = open;\n });\n\n const handleKeyDown: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent> = (e) => {\n const onKeyDown = local.onKeyDown as\n | JSX.EventHandler<HTMLDivElement, KeyboardEvent>\n | undefined;\n onKeyDown?.(e);\n if (e.defaultPrevented) {\n return;\n }\n\n if (e.key === \"Escape\" && isOpen()) {\n e.preventDefault();\n e.stopPropagation();\n local.onClearSelection?.();\n }\n };\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionBar\",\n },\n () => ({\n isOpen: isOpen(),\n selectedItemCount: selectedItemCount(),\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n const contextValue = createMemo<ActionBarContextValue>(() => ({\n selectedItemCount,\n onClearSelection: local.onClearSelection,\n onAction: local.onAction,\n }));\n\n return (\n <Show when={isOpen()}>\n <ActionBarContext.Provider value={contextValue()}>\n <div\n {...filteredDOMProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-open={isOpen() || undefined}\n onKeyDown={handleKeyDown}\n ref={(el) => assignRef(local.ref, el)}\n >\n {local.children}\n </div>\n </ActionBarContext.Provider>\n </Show>\n );\n}\n\nexport interface ActionBarContainerProps extends ParentProps {\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * Container that positions a collection and its ActionBar.\n */\nexport function ActionBarContainer(props: ActionBarContainerProps): JSX.Element {\n return (\n <div\n class={props.class ?? \"solidaria-ActionBarContainer\"}\n style={{ position: \"relative\", ...props.style }}\n >\n {props.children}\n </div>\n );\n}\n\nexport interface ActionBarSelectionCountProps {\n class?: string;\n}\n\n/**\n * Displays the count of selected items.\n */\nexport function ActionBarSelectionCount(props: ActionBarSelectionCountProps): JSX.Element {\n const ctx = useActionBarContext();\n\n const text = () => {\n if (!ctx) return \"\";\n const count = ctx.selectedItemCount();\n if (count === \"all\") return \"All selected\";\n if (count === 0) return \"None selected\";\n return `${count} selected`;\n };\n\n return <span class={props.class}>{text()}</span>;\n}\n\nexport interface ActionBarClearButtonProps {\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n}\n\n/**\n * Button to clear the current selection.\n */\nexport function ActionBarClearButton(props: ActionBarClearButtonProps): JSX.Element {\n const ctx = useActionBarContext();\n\n return (\n <button\n type=\"button\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n class={props.class}\n onClick={() => ctx?.onClearSelection?.()}\n >\n {props.children ?? \"\\u2715\"}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,SAASmB,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KAAK;CACV,IAAI,OAAOA,QAAQ,YACjBA,IAAIJ,EAAE;MAENI,IAAIF,UAAUF;A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;EACpC,IAAIqE,UAAU,OAAO,OAAO;EAC5B,IAAIA,UAAU,GAAG,OAAO;EACxB,OAAO,GAAGA,MAAK;CACjB;CAEA,cAAA;EAAA,IAAAC,QAAA1B,eAAA2B,OAAA;EAAApB,OAAAmB,OAAkCF,IAAI;EAAAV,aAAAI,UAAAQ,OAAlBlD,MAAMV,KAAK,CAAA;EAAA,OAAA4D;CAAA,EAAA,CAAA;AACjC;;;;AAWA,SAAgBG,qBAAqBrD,OAA+C;CAClF,MAAM+C,MAAMjD,oBAAoB;CAEhC,cAAA;EAAA,IAAAwD,QAAA9B,eAAA+B,OAAA;EAAAD,MAAAE,gBAKmBT,KAAK9D,mBAAmB;EAAC8C,OAAAuB,aAEvCtD,MAAMZ,YAAY,GAAQ;EAAAkD,QAAAC,QAAA;GAAA,IAAAkB,OAJfzD,MAAM,iBAAiB,mBAAiB0D,OAC7C1D,MAAMV;GAAKmE,SAAAlB,IAAAhC,KAAAoD,aAAAL,OAAA,cAAAf,IAAAhC,IAAAkD,IAAA;GAAAC,SAAAnB,IAAAI,KAAAD,UAAAY,OAAAf,IAAAI,IAAAe,IAAA;GAAA,OAAAnB;EAAA,GAAA;GAAAhC,GAAAM,KAAAA;GAAA8B,GAAA9B,KAAAA;EAAA,CAAA;EAAAmB,mBAAA;EAAA,OAAAsB;CAAA,EAAA,CAAA;AAMxB;AAACM,eAAA,CAAA,OAAA,CAAA"}
1
+ {"version":3,"file":"ActionBar.js","names":["<Show when={isOpen()}>\n <ActionBarContext value={contextValue()}>\n <div\n {...filteredDOMProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-open={dataAttr(isOpen())}\n onKeyDown={handleKeyDown}\n ref={(el) => assignRef(local.ref, el)}\n >\n {local.children}\n </div>\n </ActionBarContext>\n </Show>","<ActionBarContext value={contextValue()}>\n <div\n {...filteredDOMProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-open={dataAttr(isOpen())}\n onKeyDown={handleKeyDown}\n ref={(el) => assignRef(local.ref, el)}\n >\n {local.children}\n </div>\n </ActionBarContext>","ref={(el) => assignRef(local.ref, el)}","onKeyDown={handleKeyDown}","{local.children}","<div\n {...filteredDOMProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-open={dataAttr(isOpen())}\n onKeyDown={handleKeyDown}\n ref={(el) => assignRef(local.ref, el)}\n >\n {local.children}\n </div>","{props.children}","style={{ position: \"relative\", ...props.style }}","<div\n class={props.class ?? \"solidaria-ActionBarContainer\"}\n style={{ position: \"relative\", ...props.style }}\n >\n {props.children}\n </div>","{text()}","<span class={props.class}>{text()}</span>","class={props.class}","<button\n type=\"button\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n class={props.class}\n onClick={() => ctx?.onClearSelection?.()}\n >\n {props.children ?? \"\\u2715\"}\n </button>"],"sources":["../src/ActionBar.tsx"],"sourcesContent":["/*\n * Copyright 2020 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/*\n * Copyright 2024 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/@adobe/react-spectrum/src/actionbar/ActionBarContainer.tsx\n// Ported to SolidJS for Proyecto Viviana; based on packages/@react-spectrum/s2/src/ActionBar.tsx\n\n/**\n * ActionBar component for solidaria-components\n *\n * Headless action bar that appears when items are selected in a collection.\n * Shows a selection count, clear button, and action buttons.\n *\n * Based on packages/@react-spectrum/s2/src/ActionBar.tsx and\n * https://github.com/adobe/react-spectrum/blob/5ecb3333001313e83898cd07644227897e3bae1f/packages/@adobe/react-spectrum/src/actionbar/ActionBarContainer.tsx.\n * The Solid port keeps the S2 action-bar structure and the Spectrum\n * ActionBarContainer ownership model. It exposes the selection count and clear\n * action as separate headless primitives.\n */\n\nimport { Show, createContext, createMemo, createEffect, useContext } from \"solid-js\";\nimport type { ParentProps } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { announce } from \"@proyecto-viviana/solidaria\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface ActionBarRenderProps {\n /** Whether the action bar is visible. */\n isOpen: boolean;\n /** The number of selected items. */\n selectedItemCount: number | \"all\";\n}\n\nexport interface ActionBarProps\n extends\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\" | \"ref\" | \"slot\">,\n SlotProps {\n /** The number of selected items. ActionBar is hidden when 0. @default 0 */\n selectedItemCount?: number | \"all\";\n /** Callback when the clear button is pressed. */\n onClearSelection?: () => void;\n /** Callback when an action is triggered. */\n onAction?: (key: Key) => void;\n /** The action buttons to display. */\n children?: JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionBarRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionBarRenderProps>;\n /** Accessible label for the action bar. @default 'Actions' */\n \"aria-label\"?: string;\n /** Identifies the element (or elements) that labels the action bar. */\n \"aria-labelledby\"?: string;\n /** Optional keydown handler on the action bar element. */\n onKeyDown?: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent>;\n /** Screen reader announcement when the action bar becomes available. */\n actionsAvailableMessage?: string;\n /** Ref for the underlying action bar element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface ActionBarContextValue {\n selectedItemCount: () => number | \"all\";\n onClearSelection?: () => void;\n onAction?: (key: Key) => void;\n}\n\nexport const ActionBarContext = createContext<ActionBarContextValue | null>(null);\n\nexport function useActionBarContext(): ActionBarContextValue | null {\n return useContext(ActionBarContext);\n}\n\nexport function ActionBar(props: ActionBarProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"selectedItemCount\",\n \"onClearSelection\",\n \"onAction\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"aria-label\",\n \"aria-labelledby\",\n \"onKeyDown\",\n \"actionsAvailableMessage\",\n \"ref\",\n ]);\n\n // Hoist the JSX getter: `selectedItemCount={count()}` compiles as a memo\n // created on first read, and createTrackedEffect forbids primitives.\n const selectedItemCount = createMemo(() => local.selectedItemCount ?? 0);\n const isOpen = () => selectedItemCount() !== 0;\n\n // Faithful to S2 `ActionBar` (ActionBar.tsx:192): the ROOT is a PLAIN\n // container with NO `role` — S2 spreads only `keyboardProps` (an Escape\n // handler that clears the selection) onto it. The single `toolbar` is the\n // inner `ActionButtonGroup` (styled layer), NOT this root. Applying\n // `createToolbar` here would (a) give the root a spurious `role=\"toolbar\"`\n // S2 never renders and (b) nest the real action toolbar inside it, forcing\n // its role to downgrade to `group`. So the root deliberately carries no\n // toolbar props — `aria-label`/`aria-labelledby` are consumed by the inner\n // ActionButtonGroup at the styled layer.\n let wasOpen = false;\n createEffect(\n () => ({ open: isOpen(), message: local.actionsAvailableMessage }),\n ({ open, message }) => {\n if (open && !wasOpen && message) {\n announce(message);\n }\n wasOpen = open;\n },\n );\n\n const handleKeyDown: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent> = (e) => {\n const onKeyDown = local.onKeyDown as\n | JSX.EventHandler<HTMLDivElement, KeyboardEvent>\n | undefined;\n onKeyDown?.(e);\n if (e.defaultPrevented) {\n return;\n }\n\n if (e.key === \"Escape\" && isOpen()) {\n e.preventDefault();\n e.stopPropagation();\n local.onClearSelection?.();\n }\n };\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionBar\",\n },\n () => ({\n isOpen: isOpen(),\n selectedItemCount: selectedItemCount(),\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n const contextValue = createMemo<ActionBarContextValue>(() => ({\n selectedItemCount,\n onClearSelection: local.onClearSelection,\n onAction: local.onAction,\n }));\n\n return (\n <Show when={isOpen()}>\n <ActionBarContext value={contextValue()}>\n <div\n {...filteredDOMProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-open={dataAttr(isOpen())}\n onKeyDown={handleKeyDown}\n ref={(el) => assignRef(local.ref, el)}\n >\n {local.children}\n </div>\n </ActionBarContext>\n </Show>\n );\n}\n\nexport interface ActionBarContainerProps extends ParentProps {\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * Container that positions a collection and its ActionBar.\n */\nexport function ActionBarContainer(props: ActionBarContainerProps): JSX.Element {\n return (\n <div\n class={props.class ?? \"solidaria-ActionBarContainer\"}\n style={{ position: \"relative\", ...props.style }}\n >\n {props.children}\n </div>\n );\n}\n\nexport interface ActionBarSelectionCountProps {\n class?: string;\n}\n\n/**\n * Displays the count of selected items.\n */\nexport function ActionBarSelectionCount(props: ActionBarSelectionCountProps): JSX.Element {\n const ctx = useActionBarContext();\n\n const text = () => {\n if (!ctx) return \"\";\n const count = ctx.selectedItemCount();\n if (count === \"all\") return \"All selected\";\n if (count === 0) return \"None selected\";\n return `${count} selected`;\n };\n\n return <span class={props.class}>{text()}</span>;\n}\n\nexport interface ActionBarClearButtonProps {\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n}\n\n/**\n * Button to clear the current selection.\n */\nexport function ActionBarClearButton(props: ActionBarClearButtonProps): JSX.Element {\n const ctx = useActionBarContext();\n\n return (\n <button\n type=\"button\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n class={props.class}\n onClick={() => ctx?.onClearSelection?.()}\n >\n {props.children ?? \"\\u2715\"}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAAS,YAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AA2CA,MAAa,mBAAmB,cAA4C,IAAI;AAEhF,SAAgB,sBAAoD;CAClE,OAAO,WAAW,gBAAgB;AACpC;AAEA,SAAgB,UAAU,OAAoC;CAC5D,MAAM,CAAC,OAAO,YAAY,WAAW,OAAO;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAID,MAAM,oBAAoB,iBAAiB,MAAM,qBAAqB,CAAC;CACvE,MAAM,eAAe,kBAAkB,MAAM;CAW7C,IAAI,UAAU;CACd,oBACS;EAAE,MAAM,OAAO;EAAG,SAAS,MAAM;CAAwB,KAC/D,EAAE,MAAM,cAAc;EACrB,IAAI,QAAQ,CAAC,WAAW,SACtB,SAAS,OAAO;EAElB,UAAU;CACZ,CACF;CAEA,MAAM,iBAAuE,MAAM;EACjF,MAAM,YAAY,MAAM;EAGxB,YAAY,CAAC;EACb,IAAI,EAAE,kBACJ;EAGF,IAAI,EAAE,QAAQ,YAAY,OAAO,GAAG;GAClC,EAAE,eAAe;GACjB,EAAE,gBAAgB;GAClB,MAAM,m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,GAAA,KAAA,CAAA;EACpD,MAAA,OAAA,GAAA,KAAA,CAA+C;CADK,CAAA;CAFxD,OACEC;AAOJ;;;;AASA,SAAgB,wBAAwB,OAAkD;CACxF,MAAM,MAAM,oBAAoB;CAEhC,MAAM,aAAa;EACjB,IAAI,CAAC,KAAK,OAAO;EACjB,MAAM,QAAQ,IAAI,kBAAkB;EACpC,IAAI,UAAU,OAAO,OAAO;EAC5B,IAAI,UAAU,GAAG,OAAO;EACxB,OAAO,GAAG,MAAM;CAClB;CAEO,IAAA,QAAA,eAAA,OAAwC;CAAxC,OAAA,OAA0BC,YAAAA;EAAC,OAAA,KAAM;CAAO,CAAA,CAAA;CAAlC,aAAA,YAAO,MAAM,KAAK,IAAlB,KAAA,QAAA;EAAkB,UAAA,OAAA,KAAA,GAAA;;CAA/B,OAAOC;AACT;;;;AAWA,SAAgB,qBAAqB,OAA+C;CAClF,MAAM,MAAM,oBAAoB;CAG9B,IAAA,QAAA,eAAA,OAOQ;CAHN,MAAA,iBAAe,KAAK,mBAAmB;CAJzC,OAAA,aAME;EAAC,OAAA,MAAM,YAAY;CAAQ,CACrB;CALN,aAAA;;GAAY,GAAA,MAAM,iBAAiB;GACnCC,GAAAA,YAAO,MAAM,KAAK;EADkC;CAApD,IAAA,EAAA,GAAA,KAAA,QAAA;EAAoD,MAAA,KAAA,KAAA,aAAA,OAAA,cAAA,CAAA;EACpD,UAAA,OAAA,GAAA,KAAA,CAAkB;CADkC,CAAA;CAFtD,mBAOQ;CARV,OACEC;AASJ"}
@@ -1,6 +1,31 @@
1
- import { filterDOMProps, useRenderProps } from "./utils.jsx";
2
- import { Show, createContext, createEffect, createMemo, splitProps, useContext } from "solid-js";
1
+ /*
2
+ * Copyright 2020 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
+ /*
13
+ * Copyright 2024 Adobe. All rights reserved.
14
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License. You may obtain a copy
16
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software distributed under
19
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
+ * OF ANY KIND, either express or implied. See the License for the specific language
21
+ * governing permissions and limitations under the License.
22
+ */
23
+ // Ported to SolidJS for Proyecto Viviana; based on packages/@adobe/react-spectrum/src/actionbar/ActionBarContainer.tsx
24
+ // Ported to SolidJS for Proyecto Viviana; based on packages/@react-spectrum/s2/src/ActionBar.tsx
25
+ import { dataAttr, filterDOMProps, useRenderProps } from "./utils.jsx";
26
+ import { Show, createContext, createEffect, createMemo, useContext } from "solid-js";
3
27
  import { announce } from "@proyecto-viviana/solidaria";
28
+ import { splitProps } from "@proyecto-viviana/solidaria/utils";
4
29
  //#region src/ActionBar.tsx
5
30
  /**
6
31
  * ActionBar component for solidaria-components
@@ -8,10 +33,13 @@ import { announce } from "@proyecto-viviana/solidaria";
8
33
  * Headless action bar that appears when items are selected in a collection.
9
34
  * Shows a selection count, clear button, and action buttons.
10
35
  *
11
- * No RAC headless equivalent — this is a thin component layer that ties
12
- * selection state to visibility and keyboard behavior.
36
+ * Based on packages/@react-spectrum/s2/src/ActionBar.tsx and
37
+ * https://github.com/adobe/react-spectrum/blob/5ecb3333001313e83898cd07644227897e3bae1f/packages/@adobe/react-spectrum/src/actionbar/ActionBarContainer.tsx.
38
+ * The Solid port keeps the S2 action-bar structure and the Spectrum
39
+ * ActionBarContainer ownership model. It exposes the selection count and clear
40
+ * action as separate headless primitives.
13
41
  */
14
- function assignRef(ref, el) {
42
+ function assignRef$1(ref, el) {
15
43
  if (!ref) return;
16
44
  if (typeof ref === "function") ref(el);
17
45
  else ref.current = el;
@@ -35,15 +63,14 @@ function ActionBar(props) {
35
63
  "actionsAvailableMessage",
36
64
  "ref"
37
65
  ]);
38
- const selectedItemCount = () => local.selectedItemCount ?? 0;
66
+ const selectedItemCount = createMemo(() => local.selectedItemCount ?? 0);
39
67
  const isOpen = () => selectedItemCount() !== 0;
40
68
  let wasOpen = false;
41
- createEffect(() => {
42
- const open = isOpen();
43
- if (open && !wasOpen) {
44
- const message = local.actionsAvailableMessage ?? "Actions available.";
45
- if (message) announce(message);
46
- }
69
+ createEffect(() => ({
70
+ open: isOpen(),
71
+ message: local.actionsAvailableMessage
72
+ }), ({ open, message }) => {
73
+ if (open && !wasOpen && message) announce(message);
47
74
  wasOpen = open;
48
75
  });
49
76
  const handleKeyDown = (e) => {
@@ -72,11 +99,11 @@ function ActionBar(props) {
72
99
  onAction: local.onAction
73
100
  }));
74
101
  return <Show when={isOpen()}>
75
- <ActionBarContext.Provider value={contextValue()}>
76
- <div {...filteredDOMProps()} class={renderProps.class()} style={renderProps.style()} slot={local.slot} data-open={isOpen() || void 0} onKeyDown={handleKeyDown} ref={(el) => assignRef(local.ref, el)}>
102
+ <ActionBarContext value={contextValue()}>
103
+ <div {...filteredDOMProps()} class={renderProps.class()} style={renderProps.style()} slot={local.slot} data-open={dataAttr(isOpen())} onKeyDown={handleKeyDown} ref={(el) => assignRef$1(local.ref, el)}>
77
104
  {local.children}
78
105
  </div>
79
- </ActionBarContext.Provider>
106
+ </ActionBarContext>
80
107
  </Show>;
81
108
  }
82
109
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBar.jsx","names":[],"sources":["../src/ActionBar.tsx"],"sourcesContent":["/**\n * ActionBar component for solidaria-components\n *\n * Headless action bar that appears when items are selected in a collection.\n * Shows a selection count, clear button, and action buttons.\n *\n * No RAC headless equivalent — this is a thin component layer that ties\n * selection state to visibility and keyboard behavior.\n */\n\nimport {\n type JSX,\n type ParentProps,\n Show,\n createContext,\n createMemo,\n createEffect,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { announce } from \"@proyecto-viviana/solidaria\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface ActionBarRenderProps {\n /** Whether the action bar is visible. */\n isOpen: boolean;\n /** The number of selected items. */\n selectedItemCount: number | \"all\";\n}\n\nexport interface ActionBarProps\n extends\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\" | \"ref\" | \"slot\">,\n SlotProps {\n /** The number of selected items. ActionBar is hidden when 0. @default 0 */\n selectedItemCount?: number | \"all\";\n /** Callback when the clear button is pressed. */\n onClearSelection?: () => void;\n /** Callback when an action is triggered. */\n onAction?: (key: Key) => void;\n /** The action buttons to display. */\n children?: JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionBarRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionBarRenderProps>;\n /** Accessible label for the action bar. @default 'Actions' */\n \"aria-label\"?: string;\n /** Identifies the element (or elements) that labels the action bar. */\n \"aria-labelledby\"?: string;\n /** Optional keydown handler on the action bar element. */\n onKeyDown?: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent>;\n /** Screen reader announcement when the action bar becomes available. */\n actionsAvailableMessage?: string;\n /** Ref for the underlying action bar element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface ActionBarContextValue {\n selectedItemCount: () => number | \"all\";\n onClearSelection?: () => void;\n onAction?: (key: Key) => void;\n}\n\nexport const ActionBarContext = createContext<ActionBarContextValue | null>(null);\n\nexport function useActionBarContext(): ActionBarContextValue | null {\n return useContext(ActionBarContext);\n}\n\nexport function ActionBar(props: ActionBarProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"selectedItemCount\",\n \"onClearSelection\",\n \"onAction\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"aria-label\",\n \"aria-labelledby\",\n \"onKeyDown\",\n \"actionsAvailableMessage\",\n \"ref\",\n ]);\n\n const selectedItemCount = () => local.selectedItemCount ?? 0;\n const isOpen = () => selectedItemCount() !== 0;\n\n // Faithful to S2 `ActionBar` (ActionBar.tsx:192): the ROOT is a PLAIN\n // container with NO `role` — S2 spreads only `keyboardProps` (an Escape\n // handler that clears the selection) onto it. The single `toolbar` is the\n // inner `ActionButtonGroup` (styled layer), NOT this root. Applying\n // `createToolbar` here would (a) give the root a spurious `role=\"toolbar\"`\n // S2 never renders and (b) nest the real action toolbar inside it, forcing\n // its role to downgrade to `group`. So the root deliberately carries no\n // toolbar props — `aria-label`/`aria-labelledby` are consumed by the inner\n // ActionButtonGroup at the styled layer.\n let wasOpen = false;\n createEffect(() => {\n const open = isOpen();\n if (open && !wasOpen) {\n const message = local.actionsAvailableMessage ?? \"Actions available.\";\n if (message) {\n announce(message);\n }\n }\n wasOpen = open;\n });\n\n const handleKeyDown: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent> = (e) => {\n const onKeyDown = local.onKeyDown as\n | JSX.EventHandler<HTMLDivElement, KeyboardEvent>\n | undefined;\n onKeyDown?.(e);\n if (e.defaultPrevented) {\n return;\n }\n\n if (e.key === \"Escape\" && isOpen()) {\n e.preventDefault();\n e.stopPropagation();\n local.onClearSelection?.();\n }\n };\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionBar\",\n },\n () => ({\n isOpen: isOpen(),\n selectedItemCount: selectedItemCount(),\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n const contextValue = createMemo<ActionBarContextValue>(() => ({\n selectedItemCount,\n onClearSelection: local.onClearSelection,\n onAction: local.onAction,\n }));\n\n return (\n <Show when={isOpen()}>\n <ActionBarContext.Provider value={contextValue()}>\n <div\n {...filteredDOMProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-open={isOpen() || undefined}\n onKeyDown={handleKeyDown}\n ref={(el) => assignRef(local.ref, el)}\n >\n {local.children}\n </div>\n </ActionBarContext.Provider>\n </Show>\n );\n}\n\nexport interface ActionBarContainerProps extends ParentProps {\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * Container that positions a collection and its ActionBar.\n */\nexport function ActionBarContainer(props: ActionBarContainerProps): JSX.Element {\n return (\n <div\n class={props.class ?? \"solidaria-ActionBarContainer\"}\n style={{ position: \"relative\", ...props.style }}\n >\n {props.children}\n </div>\n );\n}\n\nexport interface ActionBarSelectionCountProps {\n class?: string;\n}\n\n/**\n * Displays the count of selected items.\n */\nexport function ActionBarSelectionCount(props: ActionBarSelectionCountProps): JSX.Element {\n const ctx = useActionBarContext();\n\n const text = () => {\n if (!ctx) return \"\";\n const count = ctx.selectedItemCount();\n if (count === \"all\") return \"All selected\";\n if (count === 0) return \"None selected\";\n return `${count} selected`;\n };\n\n return <span class={props.class}>{text()}</span>;\n}\n\nexport interface ActionBarClearButtonProps {\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n}\n\n/**\n * Button to clear the current selection.\n */\nexport function ActionBarClearButton(props: ActionBarClearButtonProps): JSX.Element {\n const ctx = useActionBarContext();\n\n return (\n <button\n type=\"button\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n class={props.class}\n onClick={() => ctx?.onClearSelection?.()}\n >\n {props.children ?? \"\\u2715\"}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAgCA,SAAS,UAAa,KAAiB,IAAa;CAClD,IAAI,CA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AM,MAAM,MACZ,WAAW,OAAO,KAAK,KAAA,GACvB,WAAW,eACX,MAAM,OAAO,UAAU,MAAM,KAAK,EAAE,GACrC;WACE,MAAM,SAAS;QAClB,EAAE,IAAI;MACR,EAAE,iBAAiB,SAAS;IAC9B,EAAE;AAEN;;;;AAUA,SAAgB,mBAAmB,OAA6C;CAC9E,OACE,CAAC,IACC,OAAO,MAAM,SAAS,gCACtB,OAAO;EAAE,UAAU;EAAY,GAAG,MAAM;CAAM,GAC/C;OACE,MAAM,SAAS;IAClB,EAAE;AAEN;;;;AASA,SAAgB,wBAAwB,OAAkD;CACxF,MAAM,MAAM,oBAAoB;CAEhC,MAAM,aAAa;EACjB,IAAI,CAAC,KAAK,OAAO;EACjB,MAAM,QAAQ,IAAI,kBAAkB;EACpC,IAAI,UAAU,OAAO,OAAO;EAC5B,IAAI,UAAU,GAAG,OAAO;EACxB,OAAO,GAAG,MAAM;CAClB;CAEA,OAAO,CAAC,KAAK,OAAO,MAAM,QAAQ,KAAK,EAAE,EAAE;AAC7C;;;;AAWA,SAAgB,qBAAqB,OAA+C;CAClF,MAAM,MAAM,oBAAoB;CAEhC,OACE,CAAC,OACC,cACA,YAAY,MAAM,iBAAiB,mBACnC,OAAO,MAAM,OACb,eAAe,KAAK,mBAAmB,GACxC;OACE,MAAM,YAAY,IAAS;IAC9B,EAAE;AAEN"}
1
+ {"version":3,"file":"ActionBar.jsx","names":["assignRef"],"sources":["../src/ActionBar.tsx"],"sourcesContent":["/*\n * Copyright 2020 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/*\n * Copyright 2024 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/@adobe/react-spectrum/src/actionbar/ActionBarContainer.tsx\n// Ported to SolidJS for Proyecto Viviana; based on packages/@react-spectrum/s2/src/ActionBar.tsx\n\n/**\n * ActionBar component for solidaria-components\n *\n * Headless action bar that appears when items are selected in a collection.\n * Shows a selection count, clear button, and action buttons.\n *\n * Based on packages/@react-spectrum/s2/src/ActionBar.tsx and\n * https://github.com/adobe/react-spectrum/blob/5ecb3333001313e83898cd07644227897e3bae1f/packages/@adobe/react-spectrum/src/actionbar/ActionBarContainer.tsx.\n * The Solid port keeps the S2 action-bar structure and the Spectrum\n * ActionBarContainer ownership model. It exposes the selection count and clear\n * action as separate headless primitives.\n */\n\nimport { Show, createContext, createMemo, createEffect, useContext } from \"solid-js\";\nimport type { ParentProps } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport { announce } from \"@proyecto-viviana/solidaria\";\nimport type { Key } from \"@proyecto-viviana/solid-stately\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\nimport {\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n} from \"./utils\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nexport interface ActionBarRenderProps {\n /** Whether the action bar is visible. */\n isOpen: boolean;\n /** The number of selected items. */\n selectedItemCount: number | \"all\";\n}\n\nexport interface ActionBarProps\n extends\n Omit<JSX.HTMLAttributes<HTMLDivElement>, \"class\" | \"style\" | \"children\" | \"ref\" | \"slot\">,\n SlotProps {\n /** The number of selected items. ActionBar is hidden when 0. @default 0 */\n selectedItemCount?: number | \"all\";\n /** Callback when the clear button is pressed. */\n onClearSelection?: () => void;\n /** Callback when an action is triggered. */\n onAction?: (key: Key) => void;\n /** The action buttons to display. */\n children?: JSX.Element;\n /** CSS class for the container. */\n class?: ClassNameOrFunction<ActionBarRenderProps>;\n /** Inline style for the container. */\n style?: StyleOrFunction<ActionBarRenderProps>;\n /** Accessible label for the action bar. @default 'Actions' */\n \"aria-label\"?: string;\n /** Identifies the element (or elements) that labels the action bar. */\n \"aria-labelledby\"?: string;\n /** Optional keydown handler on the action bar element. */\n onKeyDown?: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent>;\n /** Screen reader announcement when the action bar becomes available. */\n actionsAvailableMessage?: string;\n /** Ref for the underlying action bar element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface ActionBarContextValue {\n selectedItemCount: () => number | \"all\";\n onClearSelection?: () => void;\n onAction?: (key: Key) => void;\n}\n\nexport const ActionBarContext = createContext<ActionBarContextValue | null>(null);\n\nexport function useActionBarContext(): ActionBarContextValue | null {\n return useContext(ActionBarContext);\n}\n\nexport function ActionBar(props: ActionBarProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"selectedItemCount\",\n \"onClearSelection\",\n \"onAction\",\n \"children\",\n \"class\",\n \"style\",\n \"slot\",\n \"aria-label\",\n \"aria-labelledby\",\n \"onKeyDown\",\n \"actionsAvailableMessage\",\n \"ref\",\n ]);\n\n // Hoist the JSX getter: `selectedItemCount={count()}` compiles as a memo\n // created on first read, and createTrackedEffect forbids primitives.\n const selectedItemCount = createMemo(() => local.selectedItemCount ?? 0);\n const isOpen = () => selectedItemCount() !== 0;\n\n // Faithful to S2 `ActionBar` (ActionBar.tsx:192): the ROOT is a PLAIN\n // container with NO `role` — S2 spreads only `keyboardProps` (an Escape\n // handler that clears the selection) onto it. The single `toolbar` is the\n // inner `ActionButtonGroup` (styled layer), NOT this root. Applying\n // `createToolbar` here would (a) give the root a spurious `role=\"toolbar\"`\n // S2 never renders and (b) nest the real action toolbar inside it, forcing\n // its role to downgrade to `group`. So the root deliberately carries no\n // toolbar props — `aria-label`/`aria-labelledby` are consumed by the inner\n // ActionButtonGroup at the styled layer.\n let wasOpen = false;\n createEffect(\n () => ({ open: isOpen(), message: local.actionsAvailableMessage }),\n ({ open, message }) => {\n if (open && !wasOpen && message) {\n announce(message);\n }\n wasOpen = open;\n },\n );\n\n const handleKeyDown: JSX.EventHandlerUnion<HTMLDivElement, KeyboardEvent> = (e) => {\n const onKeyDown = local.onKeyDown as\n | JSX.EventHandler<HTMLDivElement, KeyboardEvent>\n | undefined;\n onKeyDown?.(e);\n if (e.defaultPrevented) {\n return;\n }\n\n if (e.key === \"Escape\" && isOpen()) {\n e.preventDefault();\n e.stopPropagation();\n local.onClearSelection?.();\n }\n };\n\n const renderProps = useRenderProps(\n {\n children: undefined,\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-ActionBar\",\n },\n () => ({\n isOpen: isOpen(),\n selectedItemCount: selectedItemCount(),\n }),\n );\n\n const filteredDOMProps = createMemo(() =>\n filterDOMProps(domProps as Record<string, unknown>, { global: true }),\n );\n\n const contextValue = createMemo<ActionBarContextValue>(() => ({\n selectedItemCount,\n onClearSelection: local.onClearSelection,\n onAction: local.onAction,\n }));\n\n return (\n <Show when={isOpen()}>\n <ActionBarContext value={contextValue()}>\n <div\n {...filteredDOMProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n slot={local.slot}\n data-open={dataAttr(isOpen())}\n onKeyDown={handleKeyDown}\n ref={(el) => assignRef(local.ref, el)}\n >\n {local.children}\n </div>\n </ActionBarContext>\n </Show>\n );\n}\n\nexport interface ActionBarContainerProps extends ParentProps {\n class?: string;\n style?: JSX.CSSProperties;\n}\n\n/**\n * Container that positions a collection and its ActionBar.\n */\nexport function ActionBarContainer(props: ActionBarContainerProps): JSX.Element {\n return (\n <div\n class={props.class ?? \"solidaria-ActionBarContainer\"}\n style={{ position: \"relative\", ...props.style }}\n >\n {props.children}\n </div>\n );\n}\n\nexport interface ActionBarSelectionCountProps {\n class?: string;\n}\n\n/**\n * Displays the count of selected items.\n */\nexport function ActionBarSelectionCount(props: ActionBarSelectionCountProps): JSX.Element {\n const ctx = useActionBarContext();\n\n const text = () => {\n if (!ctx) return \"\";\n const count = ctx.selectedItemCount();\n if (count === \"all\") return \"All selected\";\n if (count === 0) return \"None selected\";\n return `${count} selected`;\n };\n\n return <span class={props.class}>{text()}</span>;\n}\n\nexport interface ActionBarClearButtonProps {\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n}\n\n/**\n * Button to clear the current selection.\n */\nexport function ActionBarClearButton(props: ActionBarClearButtonProps): JSX.Element {\n const ctx = useActionBarContext();\n\n return (\n <button\n type=\"button\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n class={props.class}\n onClick={() => ctx?.onClearSelection?.()}\n >\n {props.children ?? \"\\u2715\"}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAASA,YAAa,KAAiB,IAAa;CAClD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAE;MAEN,IAAI,UAAU;AAElB;AA2CA,MAAa,mBAAmB,cAA4C,IAAI;AAEhF,SAAgB,sBAAoD;CAClE,OAAO,WAAW,gBAAgB;AACpC;AAEA,SAAgB,UAAU,OAAoC;CAC5D,MAAM,CAAC,OAAO,YAAY,WAAW,OAAO;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAID,MAAM,oBAAoB,iBAAiB,MAAM,qBAAqB,CAAC;CACvE,MAAM,eAAe,kBAAkB,MAAM;CAW7C,IAAI,U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,MAAM,aAAa;EACjB,IAAI,CAAC,KAAK,OAAO;EACjB,MAAM,QAAQ,IAAI,kBAAkB;EACpC,IAAI,UAAU,OAAO,OAAO;EAC5B,IAAI,UAAU,GAAG,OAAO;EACxB,OAAO,GAAG,MAAM;CAClB;CAEA,OAAO,CAAC,KAAK,OAAO,MAAM,QAAQ,KAAK,EAAE,EAAE;AAC7C;;;;AAWA,SAAgB,qBAAqB,OAA+C;CAClF,MAAM,MAAM,oBAAoB;CAEhC,OACE,CAAC,OACC,cACA,YAAY,MAAM,iBAAiB,mBACnC,OAAO,MAAM,OACb,eAAe,KAAK,mBAAmB,GACxC;OACE,MAAM,YAAY,IAAS;IAC9B,EAAE;AAEN"}
@@ -1,15 +1,4 @@
1
- /**
2
- * ActionGroup component for solidaria-components
3
- *
4
- * Pre-wired headless action group component that combines
5
- * createListState + createActionGroup/createActionGroupItem.
6
- * Provides proper dynamic roles (toolbar/radiogroup), keyboard
7
- * navigation, and ARIA attributes.
8
- *
9
- * No RAC equivalent exists — this bridges solidaria ARIA hooks
10
- * directly to a headless component.
11
- */
12
- import { type JSX } from "solid-js";
1
+ import type { JSX } from "@solidjs/web";
13
2
  import { type ListState, type Key, type SelectionMode } from "@proyecto-viviana/solid-stately";
14
3
  import { type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
15
4
  export interface ActionGroupRenderProps {
@@ -1 +1 @@
1
- {"version":3,"file":"ActionGroup.d.ts","sourceRoot":"","sources":["../src/ActionGroup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,KAAK,GAAG,EAOT,MAAM,UAAU,CAAC;AAMlB,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,GAAG,EACR,KAAK,aAAa,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAGf,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,sBAAsB;IACrC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0BAA0B,KAAK,GAAG,CAAC,OAAO,CAAC;IAC5E,mCAAmC;IACnC,KAAK,CAAC,EAAE,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;IACpD,sCAAsC;IACtC,KAAK,CAAC,EAAE,eAAe,CAAC,sBAAsB,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IAClF,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,6EAAsD,CAAC;AACtF,eAAO,MAAM,uBAAuB,+DAAyD,CAAC;AAE9F,wBAAgB,WAAW,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EACrE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GACzB,GAAG,CAAC,OAAO,CA0Hb;AAiDD,wBAAgB,qBAAqB,IAAI,uBAAuB,GAAG,IAAI,CAEtE"}
@@ -1,7 +1,21 @@
1
- import { filterDOMProps, useRenderProps } from "./utils.js";
2
- import { createComponent, getNextElement, insert, mergeProps, runHydrationEvents, spread, template, use } from "solid-js/web";
3
- import { For, createContext, createMemo, splitProps, useContext } from "solid-js";
1
+ /*
2
+ * Copyright 2020 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/src/actiongroup/useActionGroup.ts
13
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/actiongroup/useActionGroupItem.ts
14
+ import { dataAttr, filterDOMProps, useRenderProps } from "./utils.js";
15
+ import { createComponent, getNextElement, insert, ref, runHydrationEvents, scope, spread, template } from "@solidjs/web";
16
+ import { For, createContext, createMemo, useContext } from "solid-js";
4
17
  import { createActionGroup, createActionGroupItem } from "@proyecto-viviana/solidaria";
18
+ import { splitProps } from "@proyecto-viviana/solidaria/utils";
5
19
  import { createListState } from "@proyecto-viviana/solid-stately";
6
20
  //#region src/ActionGroup.tsx
7
21
  /**
@@ -12,10 +26,12 @@ import { createListState } from "@proyecto-viviana/solid-stately";
12
26
  * Provides proper dynamic roles (toolbar/radiogroup), keyboard
13
27
  * navigation, and ARIA attributes.
14
28
  *
15
- * No RAC equivalent exists — this bridges solidaria ARIA hooks
16
- * directly to a headless component.
29
+ * Based on packages/react-aria/src/actiongroup/useActionGroup.ts and
30
+ * packages/react-aria/src/actiongroup/useActionGroupItem.ts. React Aria
31
+ * Components has no ActionGroup component, so this file wires the two hooks.
17
32
  */
18
- var _tmpl$ = /*#__PURE__*/ template(`<div>`), _tmpl$2 = /*#__PURE__*/ template(`<button>`);
33
+ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
34
+ var _tmpl$2 = /* @__PURE__ */ template(`<button>`);
19
35
  const ActionGroupContext = createContext(null);
20
36
  const ActionGroupStateContext = createContext(null);
21
37
  function ActionGroup(props) {
@@ -89,34 +105,40 @@ function ActionGroup(props) {
89
105
  selectionMode: local.selectionMode ?? "none"
90
106
  }));
91
107
  const filteredDOMProps = createMemo(() => filterDOMProps(domProps, { global: true }));
92
- return createComponent(ActionGroupContext.Provider, {
108
+ return createComponent(ActionGroupContext, {
93
109
  value: { state },
94
110
  get children() {
95
- return createComponent(ActionGroupStateContext.Provider, {
111
+ return createComponent(ActionGroupStateContext, {
96
112
  value: state,
97
113
  get children() {
98
114
  var _el$ = getNextElement(_tmpl$);
99
- use((el) => {
100
- const refFn = actionGroupProps.ref;
101
- refFn?.(el);
115
+ ref(() => {
116
+ return (el) => {
117
+ const refFn = actionGroupProps.ref;
118
+ refFn?.(el);
119
+ };
102
120
  }, _el$);
103
- spread(_el$, mergeProps(filteredDOMProps, actionGroupProps, {
104
- get ["class"]() {
105
- return renderProps.class();
106
- },
107
- get style() {
108
- return renderProps.style();
109
- },
110
- get slot() {
111
- return local.slot;
112
- },
113
- get ["data-orientation"]() {
114
- return orientation();
115
- },
116
- get ["data-disabled"]() {
117
- return local.isDisabled || void 0;
121
+ spread(_el$, [
122
+ filteredDOMProps,
123
+ actionGroupProps,
124
+ {
125
+ get "class"() {
126
+ return renderProps.class();
127
+ },
128
+ get style() {
129
+ return renderProps.style();
130
+ },
131
+ get slot() {
132
+ return local.slot;
133
+ },
134
+ get "data-orientation"() {
135
+ return orientation();
136
+ },
137
+ get "data-disabled"() {
138
+ return dataAttr(local.isDisabled);
139
+ }
118
140
  }
119
- }), false, true);
141
+ ], true);
120
142
  insert(_el$, createComponent(For, {
121
143
  get each() {
122
144
  return local.items;
@@ -152,23 +174,23 @@ function ActionGroupItemWrapper(props) {
152
174
  isFocused: isFocused()
153
175
  }));
154
176
  const [, restButtonProps] = splitProps(buttonProps, ["ref"]);
155
- return (() => {
156
- var _el$2 = getNextElement(_tmpl$2);
157
- spread(_el$2, mergeProps(restButtonProps, {
158
- get ["data-selected"]() {
159
- return isSelected() || void 0;
160
- },
161
- get ["data-disabled"]() {
162
- return isDisabled() || void 0;
163
- },
164
- get ["data-focused"]() {
165
- return isFocused() || void 0;
166
- }
167
- }), false, true);
168
- insert(_el$2, () => props.renderChild(props.item, renderProps()));
169
- runHydrationEvents();
170
- return _el$2;
171
- })();
177
+ var _el$2 = getNextElement(_tmpl$2);
178
+ spread(_el$2, [restButtonProps, {
179
+ get "data-selected"() {
180
+ return dataAttr(isSelected());
181
+ },
182
+ get "data-disabled"() {
183
+ return dataAttr(isDisabled());
184
+ },
185
+ get "data-focused"() {
186
+ return dataAttr(isFocused());
187
+ }
188
+ }], true);
189
+ insert(_el$2, scope(() => {
190
+ return props.renderChild(props.item, renderProps());
191
+ }));
192
+ runHydrationEvents();
193
+ return _el$2;
172
194
  }
173
195
  function useActionGroupContext() {
174
196
  return useContext(ActionGroupContext);