@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/Tabs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","names":["Accessor","JSX","createContext","createEffect","createMemo","createSignal","splitProps","useContext","For","Show","onCleanup","createTabList","createTab","createTabPanel","createFocusRing","createHover","AriaTabListProps","AriaTabProps","AriaTabPanelProps","createTabListState","TabListState","Key","TabOrientation","KeyboardActivation","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","SelectionIndicator","SelectionIndicatorContext","SelectionIndicatorContextValue","SharedElementTransition","SelectionIndicatorProps","SelectionIndicatorRenderProps","TabsRenderProps","orientation","isDisabled","TabsProps","items","T","getKey","item","getTextValue","getDisabled","disabledKeys","Iterable","selectedKey","defaultSelectedKey","onSelectionChange","key","keyboardActivation","children","class","style","ref","RefLike","HTMLDivElement","TabListRenderProps","TabListProps","Omit","Element","TabRenderProps","isSelected","isFocused","isFocusVisible","isPressed","isHovered","TabProps","id","TabPanelRenderProps","isInert","isEntering","isExiting","state","TabPanelProps","shouldForceMount","TabPanelsProps","CSSProperties","TabsContextValue","setTabListItems","registerTab","tab","RegisteredTab","unregisterTab","el","current","assignRef","element","TabsContext","TabsStateContext","textValue","CollectionItemLike","label","collectionItemKey","Error","staticTabText","String","Tabs","props","local","stateProps","rest","tabListItems","undefined","registeredTabs","setRegisteredTabs","effectiveItems","renderValues","renderProps","defaultClassName","domProps","Record","global","contextValue","next","filter","push","_$createComponent","Provider","value","_el$","_$getNextElement","_tmpl$","_$use","_$spread","_$mergeProps","data-orientation","data-disabled","_$insert","_$runHydrationEvents","TabList","collectionProps","ariaProps","context","when","fallback","_tmpl$2","ctx","TabListInner","slot","renderItem","child","args","length","renderedChildren","tabListProps","handleKeyDown","e","KeyboardEvent","onKeyDown","handleFocus","FocusEvent","onFocusIn","handleBlur","onFocusOut","_el$3","$$focusout","$$focusin","$$keydown","_c$","_$memo","each","_$effect","_p$","_v$","role","_v$2","_v$3","_v$4","_v$5","_v$6","_v$7","_v$8","_v$9","_$setAttribute","t","a","o","i","n","_$className","s","_$style","h","r","Tab","tabsContext","_tmpl$3","TabInner","tabRef","tabAria","aria-label","aria-labelledby","hoverProps","selectionIndicatorContext","_el$5","_ref$","tabProps","aria-selected","aria-disabled","aria-controls","tabIndex","onMouseDown","onPointerDown","onClick","onFocus","onBlur","data-selected","data-focused","data-focus-visible","data-pressed","data-hovered","renderChildrenStable","TabPanels","previousSelectedKey","panelSize","setPanelSize","width","height","transition","window","getComputedStyle","shouldMeasureWidth","test","shouldMeasureHeight","selectedPanel","querySelector","HTMLElement","offsetWidth","offsetHeight","mergedStyle","_el$6","TabPanel","tabPanelProps","focusProps","Boolean","shouldRender","_el$7","_$addEventListener","renderChildren","_v$0","_v$1","_v$10","_v$11","_v$12","_v$13","_v$14","_v$15","_v$16","_v$17","_v$18","_v$19","_v$20","_v$21","_v$22","_v$23","d","l","u","_$setProperty","c","w","m","f","List","Panels","Panel","_$delegateEvents"],"sources":["../src/Tabs.tsx"],"sourcesContent":["/**\n * Tabs component for solidaria-components\n *\n * A pre-wired headless tabs component that combines state + aria hooks.\n * Port of react-aria-components/src/Tabs.tsx\n */\n\nimport {\n type Accessor,\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Show,\n onCleanup,\n} from \"solid-js\";\nimport {\n createTabList,\n createTab,\n createTabPanel,\n createFocusRing,\n createHover,\n type AriaTabListProps,\n type AriaTabProps,\n type AriaTabPanelProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createTabListState,\n type TabListState,\n type Key,\n type TabOrientation,\n type KeyboardActivation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport {\n SelectionIndicator,\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\n\nexport {\n SelectionIndicator,\n SelectionIndicatorContext,\n type SelectionIndicatorProps,\n type SelectionIndicatorRenderProps,\n} from \"./SelectionIndicator\";\n\nexport interface TabsRenderProps {\n /** The orientation of the tabs. */\n orientation: TabOrientation;\n /** Whether the tabs are disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabsProps<T> extends SlotProps {\n /** The items to render in the tab list. */\n items?: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled tabs. */\n disabledKeys?: Iterable<Key>;\n /** The currently selected tab key (controlled). */\n selectedKey?: Key | null;\n /** The default selected tab key (uncontrolled). */\n defaultSelectedKey?: Key;\n /** Handler for tab selection changes. */\n onSelectionChange?: (key: Key) => void;\n /** Whether the tabs are disabled. */\n isDisabled?: boolean;\n /** The keyboard activation mode. */\n keyboardActivation?: KeyboardActivation;\n /** The orientation of the tabs. */\n orientation?: TabOrientation;\n /** The children of the component. */\n children?: RenderChildren<TabsRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabsRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabsRenderProps>;\n /** Ref for the root tabs element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface TabListRenderProps {\n /** The orientation of the tab list. */\n orientation: TabOrientation;\n /** Whether the tab list is disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps, \"children\">, SlotProps {\n /** Items to render in the tab list. */\n items?: T[];\n /** The children of the tab list - static tabs or a render function for each item. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabListRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabListRenderProps>;\n}\n\nexport interface TabRenderProps {\n /** Whether the tab is selected. */\n isSelected: boolean;\n /** Whether the tab is focused. */\n isFocused: boolean;\n /** Whether the tab has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the tab is pressed. */\n isPressed: boolean;\n /** Whether the tab is hovered. */\n isHovered: boolean;\n /** Whether the tab is disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabProps extends Omit<AriaTabProps, \"key\">, SlotProps {\n /** The unique key for the tab. */\n id: Key;\n /** The children of the tab. */\n children?: RenderChildren<TabRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabRenderProps>;\n}\n\nexport interface TabPanelRenderProps {\n /** Whether the panel is the selected one. */\n isSelected: boolean;\n /** Whether the panel is focused. */\n isFocused: boolean;\n /** Whether the panel has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the panel is non-interactive while force mounted. */\n isInert: boolean;\n /** Whether the panel is currently entering. */\n isEntering: boolean;\n /** Whether the panel is currently exiting. */\n isExiting: boolean;\n /** State of the tab list. */\n state: TabListState<unknown> | null;\n}\n\nexport interface TabPanelProps extends AriaTabPanelProps, SlotProps {\n /** The children of the tab panel. */\n children?: RenderChildren<TabPanelRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabPanelRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabPanelRenderProps>;\n /** Whether to keep the panel mounted when not selected. */\n shouldForceMount?: boolean;\n}\n\nexport interface TabPanelsProps extends SlotProps {\n /** The grouped tab panels. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\ninterface TabsContextValue<T> {\n state: TabListState<T>;\n items: Accessor<T[]>;\n setTabListItems(items: T[] | undefined): void;\n registerTab(tab: RegisteredTab): void;\n unregisterTab(id: Key): void;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, element: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(element);\n } else if (typeof ref === \"object\" && \"current\" in ref) {\n ref.current = element;\n }\n}\n\nexport const TabsContext = createContext<TabsContextValue<unknown> | null>(null);\nexport const TabsStateContext = createContext<TabListState<unknown> | null>(null);\n\ninterface RegisteredTab {\n id: Key;\n textValue?: string;\n isDisabled?: boolean;\n}\n\ninterface CollectionItemLike {\n id?: Key;\n key?: Key;\n label?: string;\n textValue?: string;\n isDisabled?: boolean;\n}\n\nfunction collectionItemKey<T>(item: T): Key {\n const tab = item as CollectionItemLike;\n const key = tab.id ?? tab.key;\n if (key == null) {\n throw new Error(\"Tabs collection items require an id or key.\");\n }\n return key;\n}\n\nfunction staticTabText(tab: RegisteredTab): string {\n return tab.textValue ?? String(tab.id);\n}\n\n/**\n * Tabs provide a way to organize content into multiple sections, with only one section visible at a time.\n */\nexport function Tabs<T>(props: TabsProps<T>): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"ref\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"onSelectionChange\",\n \"isDisabled\",\n \"keyboardActivation\",\n \"orientation\",\n ],\n );\n\n const [tabListItems, setTabListItems] = createSignal<T[] | undefined>(undefined);\n const [registeredTabs, setRegisteredTabs] = createSignal<RegisteredTab[]>([]);\n const effectiveItems = createMemo<T[]>(() => {\n if (stateProps.items) return stateProps.items;\n if (tabListItems()) return tabListItems() ?? [];\n return registeredTabs() as T[];\n });\n\n // Create tab list state\n const state = createTabListState<T>({\n get items() {\n return effectiveItems();\n },\n get getKey() {\n return stateProps.getKey ?? collectionItemKey;\n },\n get getTextValue() {\n return (\n stateProps.getTextValue ??\n ((item: T) => {\n const tab = item as RegisteredTab & CollectionItemLike;\n return tab.textValue ?? tab.label ?? staticTabText(tab);\n })\n );\n },\n get getDisabled() {\n return (\n stateProps.getDisabled ??\n ((item: T) => {\n const tab = item as RegisteredTab & CollectionItemLike;\n return tab.isDisabled ?? false;\n })\n );\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get isDisabled() {\n return stateProps.isDisabled;\n },\n get keyboardActivation() {\n return stateProps.keyboardActivation;\n },\n get orientation() {\n return stateProps.orientation;\n },\n });\n\n const renderValues = createMemo<TabsRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n get children() {\n return props.children;\n },\n defaultClassName: \"solidaria-Tabs\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const contextValue: TabsContextValue<T> = {\n state,\n items: effectiveItems,\n setTabListItems(items) {\n setTabListItems(() => items);\n },\n registerTab(tab) {\n setRegisteredTabs((current) => {\n const next = current.filter((item) => item.id !== tab.id);\n next.push(tab);\n return next;\n });\n },\n unregisterTab(id) {\n setRegisteredTabs((current) => current.filter((item) => item.id !== id));\n },\n };\n\n return (\n <TabsContext.Provider value={contextValue as TabsContextValue<unknown>}>\n <TabsStateContext.Provider value={state}>\n <div\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-orientation={state.orientation()}\n data-disabled={state.isDisabled() || undefined}\n >\n {props.children as JSX.Element}\n </div>\n </TabsStateContext.Provider>\n </TabsContext.Provider>\n );\n}\n\n/**\n * A TabList contains Tab elements that represent the available tabs.\n */\nexport function TabList<T>(props: TabListProps<T>): JSX.Element {\n const [local, collectionProps, ariaProps] = splitProps(\n props,\n [\"class\", \"style\", \"slot\"],\n [\"items\"],\n );\n\n const context = useContext(TabsContext);\n\n return (\n <Show when={context} fallback={<div class=\"solidaria-TabList\" role=\"tablist\" />}>\n {(ctx) => (\n <TabListInner\n context={ctx()}\n local={local}\n items={collectionProps.items}\n ariaProps={ariaProps}\n children={props.children}\n />\n )}\n </Show>\n );\n}\n\n/** Inner TabList component that has access to context */\nfunction TabListInner<T>(props: {\n context: TabsContextValue<unknown>;\n local: {\n class?: ClassNameOrFunction<TabListRenderProps>;\n style?: StyleOrFunction<TabListRenderProps>;\n slot?: string;\n };\n ariaProps: Omit<TabListProps<T>, \"children\" | \"class\" | \"style\" | \"slot\" | \"items\">;\n items?: T[];\n children?: JSX.Element | ((item: T) => JSX.Element);\n}): JSX.Element {\n const state = props.context.state as TabListState<T>;\n const items = props.context.items as Accessor<T[]>;\n const renderItem = createMemo(() => {\n if (typeof props.children !== \"function\") {\n return undefined;\n }\n\n const child = props.children as (...args: unknown[]) => JSX.Element;\n if (child.length === 0 && props.items === undefined) {\n return undefined;\n }\n\n return props.children as (item: T) => JSX.Element;\n });\n const renderedChildren = createMemo(() => {\n if (renderItem() || typeof props.children !== \"function\") {\n return props.children as JSX.Element;\n }\n\n return (props.children as () => JSX.Element)();\n });\n\n createEffect(() => {\n props.context.setTabListItems(props.items as unknown[] | undefined);\n });\n\n onCleanup(() => {\n props.context.setTabListItems(undefined);\n });\n\n // Create tab list aria props\n const { tabListProps } = createTabList<T>(props.ariaProps as AriaTabListProps, state);\n\n const renderValues = createMemo<TabListRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.local.class,\n style: props.local.style,\n defaultClassName: \"solidaria-TabList\",\n },\n renderValues,\n );\n\n const handleKeyDown = (e: KeyboardEvent) => {\n tabListProps.onKeyDown(e);\n };\n\n const handleFocus = (e: FocusEvent) => {\n tabListProps.onFocusIn(e);\n };\n\n const handleBlur = (e: FocusEvent) => {\n tabListProps.onFocusOut(e);\n };\n\n return (\n <div\n role={tabListProps.role}\n aria-orientation={tabListProps[\"aria-orientation\"]}\n aria-label={tabListProps[\"aria-label\"]}\n aria-labelledby={tabListProps[\"aria-labelledby\"]}\n aria-describedby={tabListProps[\"aria-describedby\"]}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={handleKeyDown}\n onFocusIn={handleFocus}\n onFocusOut={handleBlur}\n data-orientation={state.orientation()}\n data-disabled={state.isDisabled() || undefined}\n >\n {renderItem() ? (\n <SharedElementTransition>\n <For each={(props.items ?? items()) as T[]}>{(item) => renderItem()?.(item)}</For>\n </SharedElementTransition>\n ) : (\n renderedChildren()\n )}\n </div>\n );\n}\n\n/**\n * A Tab represents an individual tab in a TabList.\n */\nexport function Tab(props: TabProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"id\"]);\n\n const context = useContext(TabsStateContext);\n const tabsContext = useContext(TabsContext);\n\n return (\n <Show when={context} fallback={<div class=\"solidaria-Tab\" role=\"tab\" />}>\n {(state) => (\n <TabInner\n state={state()}\n tabsContext={tabsContext}\n local={local}\n ariaProps={ariaProps}\n children={props.children}\n />\n )}\n </Show>\n );\n}\n\n/** Inner Tab component that has access to context */\nfunction TabInner(props: {\n state: TabListState<unknown>;\n tabsContext: TabsContextValue<unknown> | null;\n local: {\n class?: ClassNameOrFunction<TabRenderProps>;\n style?: StyleOrFunction<TabRenderProps>;\n slot?: string;\n id: Key;\n };\n ariaProps: Omit<TabProps, \"children\" | \"class\" | \"style\" | \"slot\" | \"id\">;\n children?: RenderChildren<TabRenderProps>;\n}): JSX.Element {\n let tabRef: HTMLDivElement | undefined;\n const textValue = () => {\n if (props.ariaProps[\"aria-label\"]) return props.ariaProps[\"aria-label\"];\n return typeof props.children === \"string\" ? props.children : undefined;\n };\n\n createEffect(() => {\n props.tabsContext?.registerTab({\n id: props.local.id,\n textValue: textValue(),\n isDisabled: props.ariaProps.isDisabled,\n });\n });\n\n onCleanup(() => {\n props.tabsContext?.unregisterTab(props.local.id);\n });\n\n // Create tab aria props\n const tabAria = createTab<unknown>(\n {\n key: props.local.id,\n get isDisabled() {\n return props.ariaProps.isDisabled;\n },\n get \"aria-label\"() {\n return props.ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return props.ariaProps[\"aria-labelledby\"];\n },\n },\n props.state,\n () => tabRef ?? null,\n );\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return tabAria.isDisabled();\n },\n });\n\n const renderValues = createMemo<TabRenderProps>(() => ({\n isSelected: tabAria.isSelected(),\n isFocused: tabAria.isFocused(),\n isFocusVisible: tabAria.isFocusVisible(),\n isPressed: tabAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: tabAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.local.class,\n style: props.local.style,\n defaultClassName: \"solidaria-Tab\",\n },\n renderValues,\n );\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: tabAria.isSelected,\n }));\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <div\n ref={tabRef}\n id={tabAria.tabProps.id}\n role={tabAria.tabProps.role}\n aria-selected={tabAria.isSelected()}\n aria-disabled={tabAria.isDisabled() || undefined}\n aria-controls={tabAria.isSelected() ? tabAria.tabProps[\"aria-controls\"] : undefined}\n aria-label={tabAria.tabProps[\"aria-label\"]}\n aria-labelledby={tabAria.tabProps[\"aria-labelledby\"]}\n tabIndex={tabAria.tabProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={tabAria.tabProps.onKeyDown}\n onMouseDown={tabAria.tabProps.onMouseDown}\n onPointerDown={tabAria.tabProps.onPointerDown}\n onClick={tabAria.tabProps.onClick}\n onFocus={tabAria.tabProps.onFocus}\n onFocusIn={tabAria.tabProps.onFocusIn}\n onBlur={tabAria.tabProps.onBlur}\n {...hoverProps}\n data-selected={tabAria.isSelected() || undefined}\n data-focused={tabAria.isFocused() || undefined}\n data-focus-visible={tabAria.isFocusVisible() || undefined}\n data-pressed={tabAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={tabAria.isDisabled() || undefined}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </SelectionIndicatorContext.Provider>\n );\n}\n\n/**\n * Groups multiple TabPanel elements.\n */\nexport function TabPanels(props: TabPanelsProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n const state = useContext(TabsStateContext);\n let ref: HTMLDivElement | undefined;\n let previousSelectedKey: Key | null | undefined = undefined;\n const [panelSize, setPanelSize] = createSignal<{ width?: string; height?: string }>({});\n\n createEffect(() => {\n const selectedKey = state?.selectedKey() ?? null;\n if (!ref) {\n previousSelectedKey = selectedKey;\n return;\n }\n\n if (previousSelectedKey === undefined) {\n previousSelectedKey = selectedKey;\n return;\n }\n\n if (previousSelectedKey === selectedKey) return;\n previousSelectedKey = selectedKey;\n\n const transition = window.getComputedStyle(ref).transition;\n const shouldMeasureWidth = /width|inline-size|all/.test(transition);\n const shouldMeasureHeight = /height|block-size|all/.test(transition);\n if (!shouldMeasureWidth && !shouldMeasureHeight) return;\n\n const selectedPanel = ref.querySelector<HTMLElement>('[role=\"tabpanel\"]:not([hidden])');\n if (!selectedPanel) return;\n\n setPanelSize({\n width: shouldMeasureWidth ? `${selectedPanel.offsetWidth}px` : undefined,\n height: shouldMeasureHeight ? `${selectedPanel.offsetHeight}px` : undefined,\n });\n });\n\n const mergedStyle = (): JSX.CSSProperties =>\n ({\n ...local.style,\n ...(panelSize().width ? { \"--tab-panel-width\": panelSize().width } : {}),\n ...(panelSize().height ? { \"--tab-panel-height\": panelSize().height } : {}),\n }) as JSX.CSSProperties;\n\n return (\n <div\n {...domProps()}\n ref={(el) => {\n ref = el;\n }}\n class={local.class ?? \"solidaria-TabPanels\"}\n style={mergedStyle()}\n >\n {local.children}\n </div>\n );\n}\n\n/**\n * A TabPanel displays the content for a selected Tab.\n */\nexport function TabPanel(props: TabPanelProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"shouldForceMount\"]);\n\n // Get state from context (may be null for SSR scenarios)\n const state = useContext(TabsStateContext);\n\n // Create tab panel aria props\n const { tabPanelProps, isSelected } = createTabPanel<unknown>(ariaProps, state);\n\n // Create focus ring for the panel\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const isInert = () =>\n Boolean(local.shouldForceMount && ariaProps.id !== undefined && !isSelected());\n const isEntering = () => false;\n const isExiting = () => false;\n\n const renderValues = createMemo<TabPanelRenderProps>(() => ({\n isSelected: isSelected(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isInert: isInert(),\n isEntering: isEntering(),\n isExiting: isExiting(),\n state,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TabPanel\",\n },\n renderValues,\n );\n\n // Determine if we should render the panel\n // If no id is provided, render when any tab is selected (shared panel pattern)\n // If id is provided, render when that specific tab is selected\n const shouldRender = () => {\n if (local.shouldForceMount) return true;\n if (ariaProps.id === undefined) {\n return state ? state.selectedKey() !== null : true;\n }\n return isSelected();\n };\n\n return (\n <Show when={shouldRender()}>\n <div\n id={tabPanelProps.id}\n role={tabPanelProps.role}\n aria-labelledby={tabPanelProps[\"aria-labelledby\"]}\n aria-label={tabPanelProps[\"aria-label\"]}\n aria-describedby={tabPanelProps[\"aria-describedby\"]}\n tabIndex={tabPanelProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onFocus={focusProps.onFocus}\n onBlur={focusProps.onBlur}\n data-selected={isSelected() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n inert={isInert() ? true : undefined}\n data-inert={isInert() || undefined}\n data-entering={isEntering() || undefined}\n data-exiting={isExiting() || undefined}\n hidden={\n ariaProps.id !== undefined && !isSelected() && !local.shouldForceMount ? true : undefined\n }\n >\n {renderProps.renderChildren()}\n </div>\n </Show>\n );\n}\n\nTabs.List = TabList;\nTabs.Tab = Tab;\nTabs.Panels = TabPanels;\nTabs.Panel = TabPanel;\nTabs.SelectionIndicator = SelectionIndicator;\n"],"mappings":";;;;;;;;;;;;;;;AA8LA,SAASwF,UAAahC,KAAiBiC,SAAkB;CACvD,IAAI,CAACjC,KAAK;CACV,IAAI,OAAOA,QAAQ,YACjBA,IAAIiC,OAAO;MACN,IAAI,OAAOjC,QAAQ,YAAY,aAAaA,KACjDA,IAAI+B,UAA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,KAAAA;IAAA8J,GAAA9J,KAAAA;IAAA+J,GAAA/J,KAAAA;IAAAgK,GAAAhK,KAAAA;GAAA,CAAA;GAAA,OAAAsI;EAAA;CAAA,CAAA;AAOnG;AAEA5I,KAAKuK,OAAOtI;AACZjC,KAAKwF,MAAMA;AACXxF,KAAKwK,SAASpD;AACdpH,KAAKyK,QAAQlC;AACbvI,KAAKrE,qBAAqBA;AAAmB+O,eAAA;CAAA;CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"Tabs.js","names":["<TabsContext value={contextValue as TabsContextValue<unknown>}>\n <TabsStateContext value={state}>\n <div\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-orientation={state.orientation()}\n data-disabled={dataAttr(state.isDisabled())}\n >\n {props.children as JSX.Element}\n </div>\n </TabsStateContext>\n </TabsContext>","value={contextValue as TabsContextValue<unknown>}","<TabsStateContext value={state}>\n <div\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-orientation={state.orientation()}\n data-disabled={dataAttr(state.isDisabled())}\n >\n {props.children as JSX.Element}\n </div>\n </TabsStateContext>","value={state}","ref={(element) => assignRef(local.ref, element)}","{props.children as JSX.Element}","<div\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-orientation={state.orientation()}\n data-disabled={dataAttr(state.isDisabled())}\n >\n {props.children as JSX.Element}\n </div>","<div class=\"solidaria-TabList\" role=\"tablist\" />","<SharedElementTransition>\n <For each={(collectionProps.items ?? items()) as T[]}>\n {(item) => (children as (item: T) => JSX.Element)(item)}\n </For>\n </SharedElementTransition>","<For each={(collectionProps.items ?? items()) as T[]}>\n {(item) => (children as (item: T) => JSX.Element)(item)}\n </For>","{renderChildren()}","aria-orientation={tabListProps[\"aria-orientation\"]}","aria-label={tabListProps[\"aria-label\"]}","aria-labelledby={tabListProps[\"aria-labelledby\"]}","aria-describedby={tabListProps[\"aria-describedby\"]}","class={renderProps.class()}","style={renderProps.style()}","data-orientation={state.orientation()}","data-disabled={dataAttr(state.isDisabled())}","<div\n role={tabListProps.role}\n aria-orientation={tabListProps[\"aria-orientation\"]}\n aria-label={tabListProps[\"aria-label\"]}\n aria-labelledby={tabListProps[\"aria-labelledby\"]}\n aria-describedby={tabListProps[\"aria-describedby\"]}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={handleKeyDown}\n onFocusIn={handleFocus}\n onFocusOut={handleBlur}\n data-orientation={state.orientation()}\n data-disabled={dataAttr(state.isDisabled())}\n >\n {renderChildren()}\n </div>","<div class=\"solidaria-Tab\" role=\"tab\" />","ref={setTabRef}","<SelectionIndicatorContext value={selectionIndicatorContext()}>\n {renderProps.renderChildrenStable()}\n </SelectionIndicatorContext>","<div\n ref={setTabRef}\n id={tabAria.tabProps.id}\n role={tabAria.tabProps.role}\n aria-selected={ariaTrueFalse(tabAria.isSelected())}\n aria-disabled={attrTrue(tabAria.isDisabled())}\n aria-controls={tabAria.isSelected() ? tabAria.tabProps[\"aria-controls\"] : undefined}\n aria-label={tabAria.tabProps[\"aria-label\"]}\n aria-labelledby={tabAria.tabProps[\"aria-labelledby\"]}\n tabindex={tabAria.tabProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={tabAria.tabProps.onKeyDown}\n onMouseDown={tabAria.tabProps.onMouseDown}\n onPointerDown={tabAria.tabProps.onPointerDown}\n onClick={tabAria.tabProps.onClick}\n onFocus={tabAria.tabProps.onFocus}\n onFocusIn={tabAria.tabProps.onFocusIn}\n onBlur={tabAria.tabProps.onBlur}\n {...hoverProps}\n data-selected={dataAttr(tabAria.isSelected())}\n data-focused={dataAttr(tabAria.isFocused())}\n data-focus-visible={dataAttr(tabAria.isFocusVisible())}\n data-pressed={dataAttr(tabAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(tabAria.isDisabled())}\n >\n <SelectionIndicatorContext value={selectionIndicatorContext()}>\n {renderProps.renderChildrenStable()}\n </SelectionIndicatorContext>\n </div>","ref={(el) => {\n ref = el;\n }}","{local.children}","<div\n {...domProps()}\n ref={(el) => {\n ref = el;\n }}\n class={local.class ?? \"solidaria-TabPanels\"}\n style={mergedStyle()}\n >\n {local.children}\n </div>","<Show when={shouldRender()}>\n <div\n ref={setPanelRef}\n id={tabPanelProps.id}\n role={tabPanelProps.role}\n aria-labelledby={tabPanelProps[\"aria-labelledby\"]}\n aria-label={tabPanelProps[\"aria-label\"]}\n aria-describedby={tabPanelProps[\"aria-describedby\"]}\n tabindex={tabPanelProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onFocus={focusProps.onFocus}\n onBlur={focusProps.onBlur}\n data-selected={dataAttr(isSelected())}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n inert={isInert() ? true : undefined}\n data-inert={dataAttr(isInert())}\n data-entering={dataAttr(isEntering())}\n data-exiting={dataAttr(isExiting())}\n hidden={\n ariaProps.id !== undefined && !isSelected() && !local.shouldForceMount ? true : undefined\n }\n >\n {renderProps.renderChildren()}\n </div>\n </Show>","ref={setPanelRef}","{renderProps.renderChildren()}","role={tabPanelProps.role}","aria-labelledby={tabPanelProps[\"aria-labelledby\"]}","aria-label={tabPanelProps[\"aria-label\"]}","aria-describedby={tabPanelProps[\"aria-describedby\"]}","tabindex={tabPanelProps.tabIndex}","data-selected={dataAttr(isSelected())}","data-focused={dataAttr(isFocused())}","data-focus-visible={dataAttr(isFocusVisible())}","inert={isInert() ? true : undefined}","data-inert={dataAttr(isInert())}","data-entering={dataAttr(isEntering())}","data-exiting={dataAttr(isExiting())}","hidden={\n ariaProps.id !== undefined && !isSelected() && !local.shouldForceMount ? true : undefined\n }","<div\n ref={setPanelRef}\n id={tabPanelProps.id}\n role={tabPanelProps.role}\n aria-labelledby={tabPanelProps[\"aria-labelledby\"]}\n aria-label={tabPanelProps[\"aria-label\"]}\n aria-describedby={tabPanelProps[\"aria-describedby\"]}\n tabindex={tabPanelProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onFocus={focusProps.onFocus}\n onBlur={focusProps.onBlur}\n data-selected={dataAttr(isSelected())}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n inert={isInert() ? true : undefined}\n data-inert={dataAttr(isInert())}\n data-entering={dataAttr(isEntering())}\n data-exiting={dataAttr(isExiting())}\n hidden={\n ariaProps.id !== undefined && !isSelected() && !local.shouldForceMount ? true : undefined\n }\n >\n {renderProps.renderChildren()}\n </div>"],"sources":["../src/Tabs.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Tabs.tsx\n\n/**\n * Tabs component for solidaria-components\n *\n * A pre-wired headless tabs component that combines state + aria hooks.\n * Port of react-aria-components/src/Tabs.tsx\n */\n\nimport {\n createContext,\n createEffect,\n createMemo,\n createSignal,\n useContext,\n For,\n Show,\n onCleanup,\n sharedConfig,\n createTrackedEffect,\n} from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createTabList,\n createTab,\n createTabPanel,\n createFocusRing,\n createHover,\n type AriaTabListProps,\n type AriaTabProps,\n type AriaTabPanelProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createTabListState,\n type TabListState,\n type Key,\n type TabOrientation,\n type KeyboardActivation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n ariaTrueFalse,\n attrTrue,\n} from \"./utils\";\nimport {\n SelectionIndicator,\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport {\n SelectionIndicator,\n SelectionIndicatorContext,\n type SelectionIndicatorProps,\n type SelectionIndicatorRenderProps,\n} from \"./SelectionIndicator\";\n\nexport interface TabsRenderProps {\n /** The orientation of the tabs. */\n orientation: TabOrientation;\n /** Whether the tabs are disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabsProps<T> extends SlotProps {\n /** The items to render in the tab list. */\n items?: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled tabs. */\n disabledKeys?: Iterable<Key>;\n /** The currently selected tab key (controlled). */\n selectedKey?: Key | null;\n /** The default selected tab key (uncontrolled). */\n defaultSelectedKey?: Key;\n /** Handler for tab selection changes. */\n onSelectionChange?: (key: Key) => void;\n /** Whether the tabs are disabled. */\n isDisabled?: boolean;\n /** The keyboard activation mode. */\n keyboardActivation?: KeyboardActivation;\n /** The orientation of the tabs. */\n orientation?: TabOrientation;\n /** The children of the component. */\n children?: RenderChildren<TabsRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabsRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabsRenderProps>;\n /** Ref for the root tabs element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface TabListRenderProps {\n /** The orientation of the tab list. */\n orientation: TabOrientation;\n /** Whether the tab list is disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps, \"children\">, SlotProps {\n /** Items to render in the tab list. */\n items?: T[];\n /** The children of the tab list - static tabs or a render function for each item. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabListRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabListRenderProps>;\n}\n\nexport interface TabRenderProps {\n /** Whether the tab is selected. */\n isSelected: boolean;\n /** Whether the tab is focused. */\n isFocused: boolean;\n /** Whether the tab has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the tab is pressed. */\n isPressed: boolean;\n /** Whether the tab is hovered. */\n isHovered: boolean;\n /** Whether the tab is disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabProps extends Omit<AriaTabProps, \"key\">, SlotProps {\n /** The unique key for the tab. */\n id: Key;\n /** The children of the tab. */\n children?: RenderChildren<TabRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabRenderProps>;\n}\n\nexport interface TabPanelRenderProps {\n /** Whether the panel is the selected one. */\n isSelected: boolean;\n /** Whether the panel is focused. */\n isFocused: boolean;\n /** Whether the panel has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the panel is non-interactive while force mounted. */\n isInert: boolean;\n /** Whether the panel is currently entering. */\n isEntering: boolean;\n /** Whether the panel is currently exiting. */\n isExiting: boolean;\n /** State of the tab list. */\n state: TabListState<unknown> | null;\n}\n\nexport interface TabPanelProps extends AriaTabPanelProps, SlotProps {\n /** The children of the tab panel. */\n children?: RenderChildren<TabPanelRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabPanelRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabPanelRenderProps>;\n /** Whether to keep the panel mounted when not selected. */\n shouldForceMount?: boolean;\n}\n\nexport interface TabPanelsProps extends SlotProps {\n /** The grouped tab panels. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\ninterface TabsContextValue<T> {\n state: TabListState<T>;\n items: Accessor<T[]>;\n setTabListItems(items: T[] | undefined): void;\n registerTab(tab: RegisteredTab): void;\n unregisterTab(id: Key): void;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, element: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(element);\n } else if (typeof ref === \"object\" && \"current\" in ref) {\n ref.current = element;\n }\n}\n\nexport const TabsContext = createContext<TabsContextValue<unknown> | null>(null);\nexport const TabsStateContext = createContext<TabListState<unknown> | null>(null);\n\ninterface RegisteredTab {\n id: Key;\n textValue?: string;\n isDisabled?: boolean;\n}\n\ninterface CollectionItemLike {\n id?: Key;\n key?: Key;\n label?: string;\n textValue?: string;\n isDisabled?: boolean;\n}\n\nfunction collectionItemKey<T>(item: T): Key {\n const tab = item as CollectionItemLike;\n const key = tab.id ?? tab.key;\n if (key == null) {\n throw new Error(\"Tabs collection items require an id or key.\");\n }\n return key;\n}\n\nfunction staticTabText(tab: RegisteredTab): string {\n return tab.textValue ?? String(tab.id);\n}\n\n/**\n * Tabs provide a way to organize content into multiple sections, with only one section visible at a time.\n */\nexport function Tabs<T>(props: TabsProps<T>): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"ref\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"onSelectionChange\",\n \"isDisabled\",\n \"keyboardActivation\",\n \"orientation\",\n ],\n );\n\n const [tabListItems, setTabListItems] = createSignal<T[] | undefined>(undefined, {\n ownedWrite: true,\n });\n const [registeredTabs, setRegisteredTabs] = createSignal<RegisteredTab[]>([], {\n ownedWrite: true,\n });\n const effectiveItems = createMemo<T[]>(() => {\n if (stateProps.items) return stateProps.items;\n if (tabListItems()) return tabListItems() ?? [];\n return registeredTabs() as T[];\n });\n\n // Create tab list state\n const state = createTabListState<T>({\n get items() {\n return effectiveItems();\n },\n get getKey() {\n return stateProps.getKey ?? collectionItemKey;\n },\n get getTextValue() {\n return (\n stateProps.getTextValue ??\n ((item: T) => {\n const tab = item as RegisteredTab & CollectionItemLike;\n return tab.textValue ?? tab.label ?? staticTabText(tab);\n })\n );\n },\n get getDisabled() {\n return (\n stateProps.getDisabled ??\n ((item: T) => {\n const tab = item as RegisteredTab & CollectionItemLike;\n return tab.isDisabled ?? false;\n })\n );\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get isDisabled() {\n return stateProps.isDisabled;\n },\n get keyboardActivation() {\n return stateProps.keyboardActivation;\n },\n get orientation() {\n return stateProps.orientation;\n },\n });\n\n const renderValues = createMemo<TabsRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n get children() {\n return props.children;\n },\n defaultClassName: \"solidaria-Tabs\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const contextValue: TabsContextValue<T> = {\n state,\n items: effectiveItems,\n setTabListItems(items) {\n setTabListItems(() => items);\n },\n registerTab(tab) {\n setRegisteredTabs((current) => {\n const next = current.filter((item) => item.id !== tab.id);\n next.push(tab);\n return next;\n });\n },\n unregisterTab(id) {\n setRegisteredTabs((current) => current.filter((item) => item.id !== id));\n },\n };\n\n return (\n <TabsContext value={contextValue as TabsContextValue<unknown>}>\n <TabsStateContext value={state}>\n <div\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-orientation={state.orientation()}\n data-disabled={dataAttr(state.isDisabled())}\n >\n {props.children as JSX.Element}\n </div>\n </TabsStateContext>\n </TabsContext>\n );\n}\n\n/**\n * A TabList contains Tab elements that represent the available tabs.\n */\nexport function TabList<T>(props: TabListProps<T>): JSX.Element {\n const [local, collectionProps, ariaProps] = splitProps(\n props,\n [\"class\", \"style\", \"slot\"],\n [\"items\"],\n );\n\n const context = useContext(TabsContext);\n\n if (!context) {\n return <div class=\"solidaria-TabList\" role=\"tablist\" />;\n }\n\n const state = context.state as TabListState<T>;\n const items = context.items as Accessor<T[]>;\n\n createEffect(\n () => collectionProps.items as unknown[] | undefined,\n (items) => {\n context.setTabListItems(items);\n },\n );\n\n onCleanup(() => {\n context.setTabListItems(undefined);\n });\n\n // Create tab list aria props\n const { tabListProps } = createTabList<T>(ariaProps as AriaTabListProps, state);\n\n const renderValues = createMemo<TabListRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TabList\",\n },\n renderValues,\n );\n\n const handleKeyDown = (e: KeyboardEvent) => {\n tabListProps.onKeyDown(e);\n };\n\n const handleFocus = (e: FocusEvent) => {\n tabListProps.onFocusIn(e);\n };\n\n const handleBlur = (e: FocusEvent) => {\n tabListProps.onFocusOut(e);\n };\n\n const renderChildren = () => {\n const children = props.children;\n const isItemRenderer =\n typeof children === \"function\" && (children as (...args: unknown[]) => unknown).length > 0;\n\n if (isItemRenderer) {\n return (\n <SharedElementTransition>\n <For each={(collectionProps.items ?? items()) as T[]}>\n {(item) => (children as (item: T) => JSX.Element)(item)}\n </For>\n </SharedElementTransition>\n );\n }\n\n return children as JSX.Element;\n };\n\n return (\n <div\n role={tabListProps.role}\n aria-orientation={tabListProps[\"aria-orientation\"]}\n aria-label={tabListProps[\"aria-label\"]}\n aria-labelledby={tabListProps[\"aria-labelledby\"]}\n aria-describedby={tabListProps[\"aria-describedby\"]}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={handleKeyDown}\n onFocusIn={handleFocus}\n onFocusOut={handleBlur}\n data-orientation={state.orientation()}\n data-disabled={dataAttr(state.isDisabled())}\n >\n {renderChildren()}\n </div>\n );\n}\n\n/**\n * A Tab represents an individual tab in a TabList.\n */\nexport function Tab(props: TabProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"id\"]);\n\n const context = useContext(TabsStateContext);\n const tabsContext = useContext(TabsContext);\n\n if (!context) {\n return <div class=\"solidaria-Tab\" role=\"tab\" />;\n }\n\n const [tabRef, setTabRef] = createSignal<HTMLDivElement | null>(null);\n const textValue = () => {\n if (ariaProps[\"aria-label\"]) return ariaProps[\"aria-label\"];\n return typeof props.children === \"string\" ? props.children : undefined;\n };\n\n createEffect(\n () => ({\n id: local.id,\n textValue: textValue(),\n isDisabled: ariaProps.isDisabled,\n }),\n (tab) => {\n tabsContext?.registerTab(tab);\n },\n );\n\n onCleanup(() => {\n tabsContext?.unregisterTab(local.id);\n });\n\n // Create tab aria props\n const tabAria = createTab<unknown>(\n {\n key: local.id,\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n },\n context,\n tabRef,\n );\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return tabAria.isDisabled();\n },\n });\n\n const renderValues = createMemo<TabRenderProps>(() => ({\n isSelected: tabAria.isSelected(),\n isFocused: tabAria.isFocused(),\n isFocusVisible: tabAria.isFocusVisible(),\n isPressed: tabAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: tabAria.isDisabled(),\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-Tab\",\n },\n renderValues,\n );\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: tabAria.isSelected,\n }));\n\n return (\n <div\n ref={setTabRef}\n id={tabAria.tabProps.id}\n role={tabAria.tabProps.role}\n aria-selected={ariaTrueFalse(tabAria.isSelected())}\n aria-disabled={attrTrue(tabAria.isDisabled())}\n aria-controls={tabAria.isSelected() ? tabAria.tabProps[\"aria-controls\"] : undefined}\n aria-label={tabAria.tabProps[\"aria-label\"]}\n aria-labelledby={tabAria.tabProps[\"aria-labelledby\"]}\n tabindex={tabAria.tabProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={tabAria.tabProps.onKeyDown}\n onMouseDown={tabAria.tabProps.onMouseDown}\n onPointerDown={tabAria.tabProps.onPointerDown}\n onClick={tabAria.tabProps.onClick}\n onFocus={tabAria.tabProps.onFocus}\n onFocusIn={tabAria.tabProps.onFocusIn}\n onBlur={tabAria.tabProps.onBlur}\n {...hoverProps}\n data-selected={dataAttr(tabAria.isSelected())}\n data-focused={dataAttr(tabAria.isFocused())}\n data-focus-visible={dataAttr(tabAria.isFocusVisible())}\n data-pressed={dataAttr(tabAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(tabAria.isDisabled())}\n >\n <SelectionIndicatorContext value={selectionIndicatorContext()}>\n {renderProps.renderChildrenStable()}\n </SelectionIndicatorContext>\n </div>\n );\n}\n\n/**\n * Groups multiple TabPanel elements.\n */\nexport function TabPanels(props: TabPanelsProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n const state = useContext(TabsStateContext);\n let ref: HTMLDivElement | undefined;\n let previousSelectedKey: Key | null | undefined = undefined;\n const [panelSize, setPanelSize] = createSignal<{ width?: string; height?: string }>({});\n\n createTrackedEffect(() => {\n const selectedKey = state?.selectedKey() ?? null;\n if (!ref) {\n previousSelectedKey = selectedKey;\n return;\n }\n\n if (previousSelectedKey === undefined) {\n previousSelectedKey = selectedKey;\n return;\n }\n\n if (previousSelectedKey === selectedKey) return;\n previousSelectedKey = selectedKey;\n\n const transition = window.getComputedStyle(ref).transition;\n const shouldMeasureWidth = /width|inline-size|all/.test(transition);\n const shouldMeasureHeight = /height|block-size|all/.test(transition);\n if (!shouldMeasureWidth && !shouldMeasureHeight) return;\n\n const selectedPanel = ref.querySelector<HTMLElement>('[role=\"tabpanel\"]:not([hidden])');\n if (!selectedPanel) return;\n\n setPanelSize({\n width: shouldMeasureWidth ? `${selectedPanel.offsetWidth}px` : undefined,\n height: shouldMeasureHeight ? `${selectedPanel.offsetHeight}px` : undefined,\n });\n });\n\n const mergedStyle = (): JSX.CSSProperties =>\n ({\n ...local.style,\n ...(panelSize().width ? { \"--tab-panel-width\": panelSize().width } : {}),\n ...(panelSize().height ? { \"--tab-panel-height\": panelSize().height } : {}),\n }) as JSX.CSSProperties;\n\n return (\n <div\n {...domProps()}\n ref={(el) => {\n ref = el;\n }}\n class={local.class ?? \"solidaria-TabPanels\"}\n style={mergedStyle()}\n >\n {local.children}\n </div>\n );\n}\n\n/**\n * A TabPanel displays the content for a selected Tab.\n */\nexport function TabPanel(props: TabPanelProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"shouldForceMount\"]);\n const [panelRef, setPanelRef] = createSignal<HTMLDivElement>();\n\n // Get state from context (may be null for SSR scenarios)\n const state = useContext(TabsStateContext);\n\n // Create tab panel aria props\n const { tabPanelProps, isSelected } = createTabPanel<unknown>(ariaProps, state, panelRef);\n\n // Create focus ring for the panel\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const isInert = () =>\n Boolean(local.shouldForceMount && ariaProps.id !== undefined && !isSelected());\n const isEntering = () => false;\n const isExiting = () => false;\n\n const renderValues = createMemo<TabPanelRenderProps>(() => ({\n isSelected: isSelected(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isInert: isInert(),\n isEntering: isEntering(),\n isExiting: isExiting(),\n state,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TabPanel\",\n },\n renderValues,\n );\n\n // Determine if we should render the panel\n // If no id is provided, render when any tab is selected (shared panel pattern)\n // If id is provided, render when that specific tab is selected\n const shouldRender = () => {\n if (local.shouldForceMount) return true;\n if (ariaProps.id === undefined) {\n return state ? state.selectedKey() !== null : true;\n }\n return isSelected();\n };\n\n return (\n <Show when={shouldRender()}>\n <div\n ref={setPanelRef}\n id={tabPanelProps.id}\n role={tabPanelProps.role}\n aria-labelledby={tabPanelProps[\"aria-labelledby\"]}\n aria-label={tabPanelProps[\"aria-label\"]}\n aria-describedby={tabPanelProps[\"aria-describedby\"]}\n tabindex={tabPanelProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onFocus={focusProps.onFocus}\n onBlur={focusProps.onBlur}\n data-selected={dataAttr(isSelected())}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n inert={isInert() ? true : undefined}\n data-inert={dataAttr(isInert())}\n data-entering={dataAttr(isEntering())}\n data-exiting={dataAttr(isExiting())}\n hidden={\n ariaProps.id !== undefined && !isSelected() && !local.shouldForceMount ? true : undefined\n }\n >\n {renderProps.renderChildren()}\n </div>\n </Show>\n );\n}\n\nTabs.List = TabList;\nTabs.Tab = Tab;\nTabs.Panels = TabPanels;\nTabs.Panel = TabPanel;\nTabs.SelectionIndicator = SelectionIndicator;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiNA,SAAS,YAAa,KAAiB,SAAkB;CACvD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YACjB,IAAI,OAAO;MACN,IAAI,OAAO,QAAQ,YAAY,aAAa,KACjD,IAAI,UAAU;AAElB;AAEA,MAAa,cAAc,cAAgD,IAAI;AAC/E,MAAa,mBAAmB,cAA4C,IAAI;AAgBhF,SAAS,kBAAqB,MAAc;CAC1C,MAAM,MAAM;CACZ,MAAM,MAAM,IAAI,MAAM,IAAI;CAC1B,IAAI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,KAAA,aAAA,OAAA,cAAA,CAA+B;IAC/B,MAAA,KAAA,KAAA,aAAA,OAAA,iBAAA,CAAqC;IACrC,MAAA,KAAA,KAAA,aAAA,OAAA,gBAAA,CAAmC;IACnC,MAAA,KAAA,KAAA,aAAA,OAAA,UAAA,CAEA;GAnBoB,CAAA;GAHxB,OACEC;EAyBI;;AAEV;AAEA,KAAK,OAAO;AACZ,KAAK,MAAM;AACX,KAAK,SAAS;AACd,KAAK,QAAQ;AACb,KAAK,qBAAqB"}
package/dist/Tabs.jsx CHANGED
@@ -1,8 +1,21 @@
1
- import { filterDOMProps, useRenderProps } from "./utils.jsx";
1
+ /*
2
+ * Copyright 2022 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Tabs.tsx
13
+ import { ariaTrueFalse, attrTrue, dataAttr, filterDOMProps, useRenderProps } from "./utils.jsx";
2
14
  import { SharedElementTransition } from "./SharedElementTransition.jsx";
3
15
  import { SelectionIndicator, SelectionIndicatorContext } from "./SelectionIndicator.jsx";
4
- import { For, Show, createContext, createEffect, createMemo, createSignal, onCleanup, splitProps, useContext } from "solid-js";
16
+ import { For, Show, createContext, createEffect, createMemo, createSignal, createTrackedEffect, onCleanup, useContext } from "solid-js";
5
17
  import { createFocusRing, createHover, createTab, createTabList, createTabPanel } from "@proyecto-viviana/solidaria";
18
+ import { splitProps } from "@proyecto-viviana/solidaria/utils";
6
19
  import { createTabListState } from "@proyecto-viviana/solid-stately";
7
20
  //#region src/Tabs.tsx
8
21
  /**
@@ -11,7 +24,7 @@ import { createTabListState } from "@proyecto-viviana/solid-stately";
11
24
  * A pre-wired headless tabs component that combines state + aria hooks.
12
25
  * Port of react-aria-components/src/Tabs.tsx
13
26
  */
14
- function assignRef(ref, element) {
27
+ function assignRef$1(ref, element) {
15
28
  if (!ref) return;
16
29
  if (typeof ref === "function") ref(element);
17
30
  else if (typeof ref === "object" && "current" in ref) ref.current = element;
@@ -49,8 +62,8 @@ function Tabs(props) {
49
62
  "keyboardActivation",
50
63
  "orientation"
51
64
  ]);
52
- const [tabListItems, setTabListItems] = createSignal(void 0);
53
- const [registeredTabs, setRegisteredTabs] = createSignal([]);
65
+ const [tabListItems, setTabListItems] = createSignal(void 0, { ownedWrite: true });
66
+ const [registeredTabs, setRegisteredTabs] = createSignal([], { ownedWrite: true });
54
67
  const effectiveItems = createMemo(() => {
55
68
  if (stateProps.items) return stateProps.items;
56
69
  if (tabListItems()) return tabListItems() ?? [];
@@ -126,13 +139,13 @@ function Tabs(props) {
126
139
  setRegisteredTabs((current) => current.filter((item) => item.id !== id));
127
140
  }
128
141
  };
129
- return <TabsContext.Provider value={contextValue}>
130
- <TabsStateContext.Provider value={state}>
131
- <div {...domProps()} ref={(element) => assignRef(local.ref, element)} class={renderProps.class()} style={renderProps.style()} data-orientation={state.orientation()} data-disabled={state.isDisabled() || void 0}>
142
+ return <TabsContext value={contextValue}>
143
+ <TabsStateContext value={state}>
144
+ <div {...domProps()} ref={(element) => assignRef$1(local.ref, element)} class={renderProps.class()} style={renderProps.style()} data-orientation={state.orientation()} data-disabled={dataAttr(state.isDisabled())}>
132
145
  {props.children}
133
146
  </div>
134
- </TabsStateContext.Provider>
135
- </TabsContext.Provider>;
147
+ </TabsStateContext>
148
+ </TabsContext>;
136
149
  }
137
150
  /**
138
151
  * A TabList contains Tab elements that represent the available tabs.
@@ -144,37 +157,23 @@ function TabList(props) {
144
157
  "slot"
145
158
  ], ["items"]);
146
159
  const context = useContext(TabsContext);
147
- return <Show when={context} fallback={<div class="solidaria-TabList" role="tablist" />}>
148
- {(ctx) => <TabListInner context={ctx()} local={local} items={collectionProps.items} ariaProps={ariaProps} children={props.children} />}
149
- </Show>;
150
- }
151
- /** Inner TabList component that has access to context */
152
- function TabListInner(props) {
153
- const state = props.context.state;
154
- const items = props.context.items;
155
- const renderItem = createMemo(() => {
156
- if (typeof props.children !== "function") return;
157
- if (props.children.length === 0 && props.items === void 0) return;
158
- return props.children;
159
- });
160
- const renderedChildren = createMemo(() => {
161
- if (renderItem() || typeof props.children !== "function") return props.children;
162
- return props.children();
163
- });
164
- createEffect(() => {
165
- props.context.setTabListItems(props.items);
160
+ if (!context) return <div class="solidaria-TabList" role="tablist" />;
161
+ const state = context.state;
162
+ const items = context.items;
163
+ createEffect(() => collectionProps.items, (items) => {
164
+ context.setTabListItems(items);
166
165
  });
167
166
  onCleanup(() => {
168
- props.context.setTabListItems(void 0);
167
+ context.setTabListItems(void 0);
169
168
  });
170
- const { tabListProps } = createTabList(props.ariaProps, state);
169
+ const { tabListProps } = createTabList(ariaProps, state);
171
170
  const renderValues = createMemo(() => ({
172
171
  orientation: state.orientation(),
173
172
  isDisabled: state.isDisabled()
174
173
  }));
175
174
  const renderProps = useRenderProps({
176
- class: props.local.class,
177
- style: props.local.style,
175
+ class: local.class,
176
+ style: local.style,
178
177
  defaultClassName: "solidaria-TabList"
179
178
  }, renderValues);
180
179
  const handleKeyDown = (e) => {
@@ -186,10 +185,17 @@ function TabListInner(props) {
186
185
  const handleBlur = (e) => {
187
186
  tabListProps.onFocusOut(e);
188
187
  };
189
- return <div role={tabListProps.role} aria-orientation={tabListProps["aria-orientation"]} aria-label={tabListProps["aria-label"]} aria-labelledby={tabListProps["aria-labelledby"]} aria-describedby={tabListProps["aria-describedby"]} class={renderProps.class()} style={renderProps.style()} onKeyDown={handleKeyDown} onFocusIn={handleFocus} onFocusOut={handleBlur} data-orientation={state.orientation()} data-disabled={state.isDisabled() || void 0}>
190
- {renderItem() ? <SharedElementTransition>
191
- <For each={props.items ?? items()}>{(item) => renderItem()?.(item)}</For>
192
- </SharedElementTransition> : renderedChildren()}
188
+ const renderChildren = () => {
189
+ const children = props.children;
190
+ if (typeof children === "function" && children.length > 0) return <SharedElementTransition>
191
+ <For each={collectionProps.items ?? items()}>
192
+ {(item) => children(item)}
193
+ </For>
194
+ </SharedElementTransition>;
195
+ return children;
196
+ };
197
+ return <div role={tabListProps.role} aria-orientation={tabListProps["aria-orientation"]} aria-label={tabListProps["aria-label"]} aria-labelledby={tabListProps["aria-labelledby"]} aria-describedby={tabListProps["aria-describedby"]} class={renderProps.class()} style={renderProps.style()} onKeyDown={handleKeyDown} onFocusIn={handleFocus} onFocusOut={handleBlur} data-orientation={state.orientation()} data-disabled={dataAttr(state.isDisabled())}>
198
+ {renderChildren()}
193
199
  </div>;
194
200
  }
195
201
  /**
@@ -204,39 +210,34 @@ function Tab(props) {
204
210
  ]);
205
211
  const context = useContext(TabsStateContext);
206
212
  const tabsContext = useContext(TabsContext);
207
- return <Show when={context} fallback={<div class="solidaria-Tab" role="tab" />}>
208
- {(state) => <TabInner state={state()} tabsContext={tabsContext} local={local} ariaProps={ariaProps} children={props.children} />}
209
- </Show>;
210
- }
211
- /** Inner Tab component that has access to context */
212
- function TabInner(props) {
213
- let tabRef;
213
+ if (!context) return <div class="solidaria-Tab" role="tab" />;
214
+ const [tabRef, setTabRef] = createSignal(null);
214
215
  const textValue = () => {
215
- if (props.ariaProps["aria-label"]) return props.ariaProps["aria-label"];
216
+ if (ariaProps["aria-label"]) return ariaProps["aria-label"];
216
217
  return typeof props.children === "string" ? props.children : void 0;
217
218
  };
218
- createEffect(() => {
219
- props.tabsContext?.registerTab({
220
- id: props.local.id,
221
- textValue: textValue(),
222
- isDisabled: props.ariaProps.isDisabled
223
- });
219
+ createEffect(() => ({
220
+ id: local.id,
221
+ textValue: textValue(),
222
+ isDisabled: ariaProps.isDisabled
223
+ }), (tab) => {
224
+ tabsContext?.registerTab(tab);
224
225
  });
225
226
  onCleanup(() => {
226
- props.tabsContext?.unregisterTab(props.local.id);
227
+ tabsContext?.unregisterTab(local.id);
227
228
  });
228
229
  const tabAria = createTab({
229
- key: props.local.id,
230
+ key: local.id,
230
231
  get isDisabled() {
231
- return props.ariaProps.isDisabled;
232
+ return ariaProps.isDisabled;
232
233
  },
233
234
  get "aria-label"() {
234
- return props.ariaProps["aria-label"];
235
+ return ariaProps["aria-label"];
235
236
  },
236
237
  get "aria-labelledby"() {
237
- return props.ariaProps["aria-labelledby"];
238
+ return ariaProps["aria-labelledby"];
238
239
  }
239
- }, props.state, () => null);
240
+ }, context, tabRef);
240
241
  const { isHovered, hoverProps } = createHover({ get isDisabled() {
241
242
  return tabAria.isDisabled();
242
243
  } });
@@ -252,16 +253,16 @@ function TabInner(props) {
252
253
  get children() {
253
254
  return props.children;
254
255
  },
255
- class: props.local.class,
256
- style: props.local.style,
256
+ class: local.class,
257
+ style: local.style,
257
258
  defaultClassName: "solidaria-Tab"
258
259
  }, renderValues);
259
260
  const selectionIndicatorContext = createMemo(() => ({ isSelected: tabAria.isSelected }));
260
- return <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>
261
- <div ref={tabRef} id={tabAria.tabProps.id} role={tabAria.tabProps.role} aria-selected={tabAria.isSelected()} aria-disabled={tabAria.isDisabled() || void 0} aria-controls={tabAria.isSelected() ? tabAria.tabProps["aria-controls"] : void 0} aria-label={tabAria.tabProps["aria-label"]} aria-labelledby={tabAria.tabProps["aria-labelledby"]} tabIndex={tabAria.tabProps.tabIndex} class={renderProps.class()} style={renderProps.style()} onKeyDown={tabAria.tabProps.onKeyDown} onMouseDown={tabAria.tabProps.onMouseDown} onPointerDown={tabAria.tabProps.onPointerDown} onClick={tabAria.tabProps.onClick} onFocus={tabAria.tabProps.onFocus} onFocusIn={tabAria.tabProps.onFocusIn} onBlur={tabAria.tabProps.onBlur} {...hoverProps} data-selected={tabAria.isSelected() || void 0} data-focused={tabAria.isFocused() || void 0} data-focus-visible={tabAria.isFocusVisible() || void 0} data-pressed={tabAria.isPressed() || void 0} data-hovered={isHovered() || void 0} data-disabled={tabAria.isDisabled() || void 0}>
261
+ return <div ref={setTabRef} id={tabAria.tabProps.id} role={tabAria.tabProps.role} aria-selected={ariaTrueFalse(tabAria.isSelected())} aria-disabled={attrTrue(tabAria.isDisabled())} aria-controls={tabAria.isSelected() ? tabAria.tabProps["aria-controls"] : void 0} aria-label={tabAria.tabProps["aria-label"]} aria-labelledby={tabAria.tabProps["aria-labelledby"]} tabindex={tabAria.tabProps.tabIndex} class={renderProps.class()} style={renderProps.style()} onKeyDown={tabAria.tabProps.onKeyDown} onMouseDown={tabAria.tabProps.onMouseDown} onPointerDown={tabAria.tabProps.onPointerDown} onClick={tabAria.tabProps.onClick} onFocus={tabAria.tabProps.onFocus} onFocusIn={tabAria.tabProps.onFocusIn} onBlur={tabAria.tabProps.onBlur} {...hoverProps} data-selected={dataAttr(tabAria.isSelected())} data-focused={dataAttr(tabAria.isFocused())} data-focus-visible={dataAttr(tabAria.isFocusVisible())} data-pressed={dataAttr(tabAria.isPressed())} data-hovered={dataAttr(isHovered())} data-disabled={dataAttr(tabAria.isDisabled())}>
262
+ <SelectionIndicatorContext value={selectionIndicatorContext()}>
262
263
  {renderProps.renderChildrenStable()}
263
- </div>
264
- </SelectionIndicatorContext.Provider>;
264
+ </SelectionIndicatorContext>
265
+ </div>;
265
266
  }
266
267
  /**
267
268
  * Groups multiple TabPanel elements.
@@ -278,7 +279,7 @@ function TabPanels(props) {
278
279
  let ref;
279
280
  let previousSelectedKey = void 0;
280
281
  const [panelSize, setPanelSize] = createSignal({});
281
- createEffect(() => {
282
+ createTrackedEffect(() => {
282
283
  const selectedKey = state?.selectedKey() ?? null;
283
284
  if (!ref) {
284
285
  previousSelectedKey = selectedKey;
@@ -322,8 +323,9 @@ function TabPanel(props) {
322
323
  "slot",
323
324
  "shouldForceMount"
324
325
  ]);
326
+ const [panelRef, setPanelRef] = createSignal();
325
327
  const state = useContext(TabsStateContext);
326
- const { tabPanelProps, isSelected } = createTabPanel(ariaProps, state);
328
+ const { tabPanelProps, isSelected } = createTabPanel(ariaProps, state, panelRef);
327
329
  const { isFocused, isFocusVisible, focusProps } = createFocusRing();
328
330
  const isInert = () => Boolean(local.shouldForceMount && ariaProps.id !== void 0 && !isSelected());
329
331
  const isEntering = () => false;
@@ -351,7 +353,7 @@ function TabPanel(props) {
351
353
  return isSelected();
352
354
  };
353
355
  return <Show when={shouldRender()}>
354
- <div id={tabPanelProps.id} role={tabPanelProps.role} aria-labelledby={tabPanelProps["aria-labelledby"]} aria-label={tabPanelProps["aria-label"]} aria-describedby={tabPanelProps["aria-describedby"]} tabIndex={tabPanelProps.tabIndex} class={renderProps.class()} style={renderProps.style()} onFocus={focusProps.onFocus} onBlur={focusProps.onBlur} data-selected={isSelected() || void 0} data-focused={isFocused() || void 0} data-focus-visible={isFocusVisible() || void 0} inert={isInert() ? true : void 0} data-inert={isInert() || void 0} data-entering={isEntering() || void 0} data-exiting={isExiting() || void 0} hidden={ariaProps.id !== void 0 && !isSelected() && !local.shouldForceMount ? true : void 0}>
356
+ <div ref={setPanelRef} id={tabPanelProps.id} role={tabPanelProps.role} aria-labelledby={tabPanelProps["aria-labelledby"]} aria-label={tabPanelProps["aria-label"]} aria-describedby={tabPanelProps["aria-describedby"]} tabindex={tabPanelProps.tabIndex} class={renderProps.class()} style={renderProps.style()} onFocus={focusProps.onFocus} onBlur={focusProps.onBlur} data-selected={dataAttr(isSelected())} data-focused={dataAttr(isFocused())} data-focus-visible={dataAttr(isFocusVisible())} inert={isInert() ? true : void 0} data-inert={dataAttr(isInert())} data-entering={dataAttr(isEntering())} data-exiting={dataAttr(isExiting())} hidden={ariaProps.id !== void 0 && !isSelected() && !local.shouldForceMount ? true : void 0}>
355
357
  {renderProps.renderChildren()}
356
358
  </div>
357
359
  </Show>;
package/dist/Tabs.jsx.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.jsx","names":["tab"],"sources":["../src/Tabs.tsx"],"sourcesContent":["/**\n * Tabs component for solidaria-components\n *\n * A pre-wired headless tabs component that combines state + aria hooks.\n * Port of react-aria-components/src/Tabs.tsx\n */\n\nimport {\n type Accessor,\n type JSX,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n splitProps,\n useContext,\n For,\n Show,\n onCleanup,\n} from \"solid-js\";\nimport {\n createTabList,\n createTab,\n createTabPanel,\n createFocusRing,\n createHover,\n type AriaTabListProps,\n type AriaTabProps,\n type AriaTabPanelProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createTabListState,\n type TabListState,\n type Key,\n type TabOrientation,\n type KeyboardActivation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport {\n SelectionIndicator,\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\n\nexport {\n SelectionIndicator,\n SelectionIndicatorContext,\n type SelectionIndicatorProps,\n type SelectionIndicatorRenderProps,\n} from \"./SelectionIndicator\";\n\nexport interface TabsRenderProps {\n /** The orientation of the tabs. */\n orientation: TabOrientation;\n /** Whether the tabs are disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabsProps<T> extends SlotProps {\n /** The items to render in the tab list. */\n items?: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled tabs. */\n disabledKeys?: Iterable<Key>;\n /** The currently selected tab key (controlled). */\n selectedKey?: Key | null;\n /** The default selected tab key (uncontrolled). */\n defaultSelectedKey?: Key;\n /** Handler for tab selection changes. */\n onSelectionChange?: (key: Key) => void;\n /** Whether the tabs are disabled. */\n isDisabled?: boolean;\n /** The keyboard activation mode. */\n keyboardActivation?: KeyboardActivation;\n /** The orientation of the tabs. */\n orientation?: TabOrientation;\n /** The children of the component. */\n children?: RenderChildren<TabsRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabsRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabsRenderProps>;\n /** Ref for the root tabs element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface TabListRenderProps {\n /** The orientation of the tab list. */\n orientation: TabOrientation;\n /** Whether the tab list is disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps, \"children\">, SlotProps {\n /** Items to render in the tab list. */\n items?: T[];\n /** The children of the tab list - static tabs or a render function for each item. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabListRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabListRenderProps>;\n}\n\nexport interface TabRenderProps {\n /** Whether the tab is selected. */\n isSelected: boolean;\n /** Whether the tab is focused. */\n isFocused: boolean;\n /** Whether the tab has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the tab is pressed. */\n isPressed: boolean;\n /** Whether the tab is hovered. */\n isHovered: boolean;\n /** Whether the tab is disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabProps extends Omit<AriaTabProps, \"key\">, SlotProps {\n /** The unique key for the tab. */\n id: Key;\n /** The children of the tab. */\n children?: RenderChildren<TabRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabRenderProps>;\n}\n\nexport interface TabPanelRenderProps {\n /** Whether the panel is the selected one. */\n isSelected: boolean;\n /** Whether the panel is focused. */\n isFocused: boolean;\n /** Whether the panel has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the panel is non-interactive while force mounted. */\n isInert: boolean;\n /** Whether the panel is currently entering. */\n isEntering: boolean;\n /** Whether the panel is currently exiting. */\n isExiting: boolean;\n /** State of the tab list. */\n state: TabListState<unknown> | null;\n}\n\nexport interface TabPanelProps extends AriaTabPanelProps, SlotProps {\n /** The children of the tab panel. */\n children?: RenderChildren<TabPanelRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabPanelRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabPanelRenderProps>;\n /** Whether to keep the panel mounted when not selected. */\n shouldForceMount?: boolean;\n}\n\nexport interface TabPanelsProps extends SlotProps {\n /** The grouped tab panels. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\ninterface TabsContextValue<T> {\n state: TabListState<T>;\n items: Accessor<T[]>;\n setTabListItems(items: T[] | undefined): void;\n registerTab(tab: RegisteredTab): void;\n unregisterTab(id: Key): void;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, element: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(element);\n } else if (typeof ref === \"object\" && \"current\" in ref) {\n ref.current = element;\n }\n}\n\nexport const TabsContext = createContext<TabsContextValue<unknown> | null>(null);\nexport const TabsStateContext = createContext<TabListState<unknown> | null>(null);\n\ninterface RegisteredTab {\n id: Key;\n textValue?: string;\n isDisabled?: boolean;\n}\n\ninterface CollectionItemLike {\n id?: Key;\n key?: Key;\n label?: string;\n textValue?: string;\n isDisabled?: boolean;\n}\n\nfunction collectionItemKey<T>(item: T): Key {\n const tab = item as CollectionItemLike;\n const key = tab.id ?? tab.key;\n if (key == null) {\n throw new Error(\"Tabs collection items require an id or key.\");\n }\n return key;\n}\n\nfunction staticTabText(tab: RegisteredTab): string {\n return tab.textValue ?? String(tab.id);\n}\n\n/**\n * Tabs provide a way to organize content into multiple sections, with only one section visible at a time.\n */\nexport function Tabs<T>(props: TabsProps<T>): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"ref\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"onSelectionChange\",\n \"isDisabled\",\n \"keyboardActivation\",\n \"orientation\",\n ],\n );\n\n const [tabListItems, setTabListItems] = createSignal<T[] | undefined>(undefined);\n const [registeredTabs, setRegisteredTabs] = createSignal<RegisteredTab[]>([]);\n const effectiveItems = createMemo<T[]>(() => {\n if (stateProps.items) return stateProps.items;\n if (tabListItems()) return tabListItems() ?? [];\n return registeredTabs() as T[];\n });\n\n // Create tab list state\n const state = createTabListState<T>({\n get items() {\n return effectiveItems();\n },\n get getKey() {\n return stateProps.getKey ?? collectionItemKey;\n },\n get getTextValue() {\n return (\n stateProps.getTextValue ??\n ((item: T) => {\n const tab = item as RegisteredTab & CollectionItemLike;\n return tab.textValue ?? tab.label ?? staticTabText(tab);\n })\n );\n },\n get getDisabled() {\n return (\n stateProps.getDisabled ??\n ((item: T) => {\n const tab = item as RegisteredTab & CollectionItemLike;\n return tab.isDisabled ?? false;\n })\n );\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get isDisabled() {\n return stateProps.isDisabled;\n },\n get keyboardActivation() {\n return stateProps.keyboardActivation;\n },\n get orientation() {\n return stateProps.orientation;\n },\n });\n\n const renderValues = createMemo<TabsRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n get children() {\n return props.children;\n },\n defaultClassName: \"solidaria-Tabs\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const contextValue: TabsContextValue<T> = {\n state,\n items: effectiveItems,\n setTabListItems(items) {\n setTabListItems(() => items);\n },\n registerTab(tab) {\n setRegisteredTabs((current) => {\n const next = current.filter((item) => item.id !== tab.id);\n next.push(tab);\n return next;\n });\n },\n unregisterTab(id) {\n setRegisteredTabs((current) => current.filter((item) => item.id !== id));\n },\n };\n\n return (\n <TabsContext.Provider value={contextValue as TabsContextValue<unknown>}>\n <TabsStateContext.Provider value={state}>\n <div\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-orientation={state.orientation()}\n data-disabled={state.isDisabled() || undefined}\n >\n {props.children as JSX.Element}\n </div>\n </TabsStateContext.Provider>\n </TabsContext.Provider>\n );\n}\n\n/**\n * A TabList contains Tab elements that represent the available tabs.\n */\nexport function TabList<T>(props: TabListProps<T>): JSX.Element {\n const [local, collectionProps, ariaProps] = splitProps(\n props,\n [\"class\", \"style\", \"slot\"],\n [\"items\"],\n );\n\n const context = useContext(TabsContext);\n\n return (\n <Show when={context} fallback={<div class=\"solidaria-TabList\" role=\"tablist\" />}>\n {(ctx) => (\n <TabListInner\n context={ctx()}\n local={local}\n items={collectionProps.items}\n ariaProps={ariaProps}\n children={props.children}\n />\n )}\n </Show>\n );\n}\n\n/** Inner TabList component that has access to context */\nfunction TabListInner<T>(props: {\n context: TabsContextValue<unknown>;\n local: {\n class?: ClassNameOrFunction<TabListRenderProps>;\n style?: StyleOrFunction<TabListRenderProps>;\n slot?: string;\n };\n ariaProps: Omit<TabListProps<T>, \"children\" | \"class\" | \"style\" | \"slot\" | \"items\">;\n items?: T[];\n children?: JSX.Element | ((item: T) => JSX.Element);\n}): JSX.Element {\n const state = props.context.state as TabListState<T>;\n const items = props.context.items as Accessor<T[]>;\n const renderItem = createMemo(() => {\n if (typeof props.children !== \"function\") {\n return undefined;\n }\n\n const child = props.children as (...args: unknown[]) => JSX.Element;\n if (child.length === 0 && props.items === undefined) {\n return undefined;\n }\n\n return props.children as (item: T) => JSX.Element;\n });\n const renderedChildren = createMemo(() => {\n if (renderItem() || typeof props.children !== \"function\") {\n return props.children as JSX.Element;\n }\n\n return (props.children as () => JSX.Element)();\n });\n\n createEffect(() => {\n props.context.setTabListItems(props.items as unknown[] | undefined);\n });\n\n onCleanup(() => {\n props.context.setTabListItems(undefined);\n });\n\n // Create tab list aria props\n const { tabListProps } = createTabList<T>(props.ariaProps as AriaTabListProps, state);\n\n const renderValues = createMemo<TabListRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.local.class,\n style: props.local.style,\n defaultClassName: \"solidaria-TabList\",\n },\n renderValues,\n );\n\n const handleKeyDown = (e: KeyboardEvent) => {\n tabListProps.onKeyDown(e);\n };\n\n const handleFocus = (e: FocusEvent) => {\n tabListProps.onFocusIn(e);\n };\n\n const handleBlur = (e: FocusEvent) => {\n tabListProps.onFocusOut(e);\n };\n\n return (\n <div\n role={tabListProps.role}\n aria-orientation={tabListProps[\"aria-orientation\"]}\n aria-label={tabListProps[\"aria-label\"]}\n aria-labelledby={tabListProps[\"aria-labelledby\"]}\n aria-describedby={tabListProps[\"aria-describedby\"]}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={handleKeyDown}\n onFocusIn={handleFocus}\n onFocusOut={handleBlur}\n data-orientation={state.orientation()}\n data-disabled={state.isDisabled() || undefined}\n >\n {renderItem() ? (\n <SharedElementTransition>\n <For each={(props.items ?? items()) as T[]}>{(item) => renderItem()?.(item)}</For>\n </SharedElementTransition>\n ) : (\n renderedChildren()\n )}\n </div>\n );\n}\n\n/**\n * A Tab represents an individual tab in a TabList.\n */\nexport function Tab(props: TabProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"id\"]);\n\n const context = useContext(TabsStateContext);\n const tabsContext = useContext(TabsContext);\n\n return (\n <Show when={context} fallback={<div class=\"solidaria-Tab\" role=\"tab\" />}>\n {(state) => (\n <TabInner\n state={state()}\n tabsContext={tabsContext}\n local={local}\n ariaProps={ariaProps}\n children={props.children}\n />\n )}\n </Show>\n );\n}\n\n/** Inner Tab component that has access to context */\nfunction TabInner(props: {\n state: TabListState<unknown>;\n tabsContext: TabsContextValue<unknown> | null;\n local: {\n class?: ClassNameOrFunction<TabRenderProps>;\n style?: StyleOrFunction<TabRenderProps>;\n slot?: string;\n id: Key;\n };\n ariaProps: Omit<TabProps, \"children\" | \"class\" | \"style\" | \"slot\" | \"id\">;\n children?: RenderChildren<TabRenderProps>;\n}): JSX.Element {\n let tabRef: HTMLDivElement | undefined;\n const textValue = () => {\n if (props.ariaProps[\"aria-label\"]) return props.ariaProps[\"aria-label\"];\n return typeof props.children === \"string\" ? props.children : undefined;\n };\n\n createEffect(() => {\n props.tabsContext?.registerTab({\n id: props.local.id,\n textValue: textValue(),\n isDisabled: props.ariaProps.isDisabled,\n });\n });\n\n onCleanup(() => {\n props.tabsContext?.unregisterTab(props.local.id);\n });\n\n // Create tab aria props\n const tabAria = createTab<unknown>(\n {\n key: props.local.id,\n get isDisabled() {\n return props.ariaProps.isDisabled;\n },\n get \"aria-label\"() {\n return props.ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return props.ariaProps[\"aria-labelledby\"];\n },\n },\n props.state,\n () => tabRef ?? null,\n );\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return tabAria.isDisabled();\n },\n });\n\n const renderValues = createMemo<TabRenderProps>(() => ({\n isSelected: tabAria.isSelected(),\n isFocused: tabAria.isFocused(),\n isFocusVisible: tabAria.isFocusVisible(),\n isPressed: tabAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: tabAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.local.class,\n style: props.local.style,\n defaultClassName: \"solidaria-Tab\",\n },\n renderValues,\n );\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: tabAria.isSelected,\n }));\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <div\n ref={tabRef}\n id={tabAria.tabProps.id}\n role={tabAria.tabProps.role}\n aria-selected={tabAria.isSelected()}\n aria-disabled={tabAria.isDisabled() || undefined}\n aria-controls={tabAria.isSelected() ? tabAria.tabProps[\"aria-controls\"] : undefined}\n aria-label={tabAria.tabProps[\"aria-label\"]}\n aria-labelledby={tabAria.tabProps[\"aria-labelledby\"]}\n tabIndex={tabAria.tabProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={tabAria.tabProps.onKeyDown}\n onMouseDown={tabAria.tabProps.onMouseDown}\n onPointerDown={tabAria.tabProps.onPointerDown}\n onClick={tabAria.tabProps.onClick}\n onFocus={tabAria.tabProps.onFocus}\n onFocusIn={tabAria.tabProps.onFocusIn}\n onBlur={tabAria.tabProps.onBlur}\n {...hoverProps}\n data-selected={tabAria.isSelected() || undefined}\n data-focused={tabAria.isFocused() || undefined}\n data-focus-visible={tabAria.isFocusVisible() || undefined}\n data-pressed={tabAria.isPressed() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={tabAria.isDisabled() || undefined}\n >\n {renderProps.renderChildrenStable()}\n </div>\n </SelectionIndicatorContext.Provider>\n );\n}\n\n/**\n * Groups multiple TabPanel elements.\n */\nexport function TabPanels(props: TabPanelsProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n const state = useContext(TabsStateContext);\n let ref: HTMLDivElement | undefined;\n let previousSelectedKey: Key | null | undefined = undefined;\n const [panelSize, setPanelSize] = createSignal<{ width?: string; height?: string }>({});\n\n createEffect(() => {\n const selectedKey = state?.selectedKey() ?? null;\n if (!ref) {\n previousSelectedKey = selectedKey;\n return;\n }\n\n if (previousSelectedKey === undefined) {\n previousSelectedKey = selectedKey;\n return;\n }\n\n if (previousSelectedKey === selectedKey) return;\n previousSelectedKey = selectedKey;\n\n const transition = window.getComputedStyle(ref).transition;\n const shouldMeasureWidth = /width|inline-size|all/.test(transition);\n const shouldMeasureHeight = /height|block-size|all/.test(transition);\n if (!shouldMeasureWidth && !shouldMeasureHeight) return;\n\n const selectedPanel = ref.querySelector<HTMLElement>('[role=\"tabpanel\"]:not([hidden])');\n if (!selectedPanel) return;\n\n setPanelSize({\n width: shouldMeasureWidth ? `${selectedPanel.offsetWidth}px` : undefined,\n height: shouldMeasureHeight ? `${selectedPanel.offsetHeight}px` : undefined,\n });\n });\n\n const mergedStyle = (): JSX.CSSProperties =>\n ({\n ...local.style,\n ...(panelSize().width ? { \"--tab-panel-width\": panelSize().width } : {}),\n ...(panelSize().height ? { \"--tab-panel-height\": panelSize().height } : {}),\n }) as JSX.CSSProperties;\n\n return (\n <div\n {...domProps()}\n ref={(el) => {\n ref = el;\n }}\n class={local.class ?? \"solidaria-TabPanels\"}\n style={mergedStyle()}\n >\n {local.children}\n </div>\n );\n}\n\n/**\n * A TabPanel displays the content for a selected Tab.\n */\nexport function TabPanel(props: TabPanelProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"shouldForceMount\"]);\n\n // Get state from context (may be null for SSR scenarios)\n const state = useContext(TabsStateContext);\n\n // Create tab panel aria props\n const { tabPanelProps, isSelected } = createTabPanel<unknown>(ariaProps, state);\n\n // Create focus ring for the panel\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const isInert = () =>\n Boolean(local.shouldForceMount && ariaProps.id !== undefined && !isSelected());\n const isEntering = () => false;\n const isExiting = () => false;\n\n const renderValues = createMemo<TabPanelRenderProps>(() => ({\n isSelected: isSelected(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isInert: isInert(),\n isEntering: isEntering(),\n isExiting: isExiting(),\n state,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TabPanel\",\n },\n renderValues,\n );\n\n // Determine if we should render the panel\n // If no id is provided, render when any tab is selected (shared panel pattern)\n // If id is provided, render when that specific tab is selected\n const shouldRender = () => {\n if (local.shouldForceMount) return true;\n if (ariaProps.id === undefined) {\n return state ? state.selectedKey() !== null : true;\n }\n return isSelected();\n };\n\n return (\n <Show when={shouldRender()}>\n <div\n id={tabPanelProps.id}\n role={tabPanelProps.role}\n aria-labelledby={tabPanelProps[\"aria-labelledby\"]}\n aria-label={tabPanelProps[\"aria-label\"]}\n aria-describedby={tabPanelProps[\"aria-describedby\"]}\n tabIndex={tabPanelProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onFocus={focusProps.onFocus}\n onBlur={focusProps.onBlur}\n data-selected={isSelected() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n inert={isInert() ? true : undefined}\n data-inert={isInert() || undefined}\n data-entering={isEntering() || undefined}\n data-exiting={isExiting() || undefined}\n hidden={\n ariaProps.id !== undefined && !isSelected() && !local.shouldForceMount ? true : undefined\n }\n >\n {renderProps.renderChildren()}\n </div>\n </Show>\n );\n}\n\nTabs.List = TabList;\nTabs.Tab = Tab;\nTabs.Panels = TabPanels;\nTabs.Panel = TabPanel;\nTabs.SelectionIndicator = SelectionIndicator;\n"],"mappings":";;;;;;;;;;;;;AA8LA,SAAS,UAAa,KAAiB,SAAkB;CACvD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YACjB,IAAI,OAAO;MACN,IAAI,OAAO,QAAQ,YAAY,aAAa,KACjD,IAAI,UAAU;AAElB;AAEA,MAAa,cAAc,cAAgD,IAAI;AAC/E,MAAa,mBAAmB,cAA4C,IAAI;AAgBhF,SAAS,kBAAqB,MAAc;CAC1C,MAAM,MAAM;CACZ,MAAM,MAAM,IAAI,MAAM,IAAI;CAC1B,IAAI,OAAO,MACT,MAAM,IAAI,MAAM,6CAA6C;CAE/D,OAAO;AACT;AAEA,SAAS,cAAc,KAA4B;CACjD,OAAO,IAAI,aAAa,OAAO,IAAI,EAAE;AACvC;;;;AAKA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nF;SACE,YAAY,eAAe,EAAE;MAChC,EAAE,IAAI;IACR,EAAE;AAEN;AAEA,KAAK,OAAO;AACZ,KAAK,MAAM;AACX,KAAK,SAAS;AACd,KAAK,QAAQ;AACb,KAAK,qBAAqB"}
1
+ {"version":3,"file":"Tabs.jsx","names":["assignRef","tab"],"sources":["../src/Tabs.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria-components/src/Tabs.tsx\n\n/**\n * Tabs component for solidaria-components\n *\n * A pre-wired headless tabs component that combines state + aria hooks.\n * Port of react-aria-components/src/Tabs.tsx\n */\n\nimport {\n createContext,\n createEffect,\n createMemo,\n createSignal,\n useContext,\n For,\n Show,\n onCleanup,\n sharedConfig,\n createTrackedEffect,\n} from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\nimport type { JSX } from \"@solidjs/web\";\nimport {\n createTabList,\n createTab,\n createTabPanel,\n createFocusRing,\n createHover,\n type AriaTabListProps,\n type AriaTabProps,\n type AriaTabPanelProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createTabListState,\n type TabListState,\n type Key,\n type TabOrientation,\n type KeyboardActivation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n dataAttr,\n ariaTrueFalse,\n attrTrue,\n} from \"./utils\";\nimport {\n SelectionIndicator,\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { SharedElementTransition } from \"./SharedElementTransition\";\nimport { splitProps } from \"@proyecto-viviana/solidaria/utils\";\n\nexport {\n SelectionIndicator,\n SelectionIndicatorContext,\n type SelectionIndicatorProps,\n type SelectionIndicatorRenderProps,\n} from \"./SelectionIndicator\";\n\nexport interface TabsRenderProps {\n /** The orientation of the tabs. */\n orientation: TabOrientation;\n /** Whether the tabs are disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabsProps<T> extends SlotProps {\n /** The items to render in the tab list. */\n items?: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled tabs. */\n disabledKeys?: Iterable<Key>;\n /** The currently selected tab key (controlled). */\n selectedKey?: Key | null;\n /** The default selected tab key (uncontrolled). */\n defaultSelectedKey?: Key;\n /** Handler for tab selection changes. */\n onSelectionChange?: (key: Key) => void;\n /** Whether the tabs are disabled. */\n isDisabled?: boolean;\n /** The keyboard activation mode. */\n keyboardActivation?: KeyboardActivation;\n /** The orientation of the tabs. */\n orientation?: TabOrientation;\n /** The children of the component. */\n children?: RenderChildren<TabsRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabsRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabsRenderProps>;\n /** Ref for the root tabs element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface TabListRenderProps {\n /** The orientation of the tab list. */\n orientation: TabOrientation;\n /** Whether the tab list is disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabListProps<T> extends Omit<AriaTabListProps, \"children\">, SlotProps {\n /** Items to render in the tab list. */\n items?: T[];\n /** The children of the tab list - static tabs or a render function for each item. */\n children?: JSX.Element | ((item: T) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabListRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabListRenderProps>;\n}\n\nexport interface TabRenderProps {\n /** Whether the tab is selected. */\n isSelected: boolean;\n /** Whether the tab is focused. */\n isFocused: boolean;\n /** Whether the tab has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the tab is pressed. */\n isPressed: boolean;\n /** Whether the tab is hovered. */\n isHovered: boolean;\n /** Whether the tab is disabled. */\n isDisabled: boolean;\n}\n\nexport interface TabProps extends Omit<AriaTabProps, \"key\">, SlotProps {\n /** The unique key for the tab. */\n id: Key;\n /** The children of the tab. */\n children?: RenderChildren<TabRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabRenderProps>;\n}\n\nexport interface TabPanelRenderProps {\n /** Whether the panel is the selected one. */\n isSelected: boolean;\n /** Whether the panel is focused. */\n isFocused: boolean;\n /** Whether the panel has visible focus ring. */\n isFocusVisible: boolean;\n /** Whether the panel is non-interactive while force mounted. */\n isInert: boolean;\n /** Whether the panel is currently entering. */\n isEntering: boolean;\n /** Whether the panel is currently exiting. */\n isExiting: boolean;\n /** State of the tab list. */\n state: TabListState<unknown> | null;\n}\n\nexport interface TabPanelProps extends AriaTabPanelProps, SlotProps {\n /** The children of the tab panel. */\n children?: RenderChildren<TabPanelRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<TabPanelRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<TabPanelRenderProps>;\n /** Whether to keep the panel mounted when not selected. */\n shouldForceMount?: boolean;\n}\n\nexport interface TabPanelsProps extends SlotProps {\n /** The grouped tab panels. */\n children?: JSX.Element;\n /** The CSS className for the element. */\n class?: string;\n /** The inline style for the element. */\n style?: JSX.CSSProperties;\n}\n\ninterface TabsContextValue<T> {\n state: TabListState<T>;\n items: Accessor<T[]>;\n setTabListItems(items: T[] | undefined): void;\n registerTab(tab: RegisteredTab): void;\n unregisterTab(id: Key): void;\n}\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, element: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(element);\n } else if (typeof ref === \"object\" && \"current\" in ref) {\n ref.current = element;\n }\n}\n\nexport const TabsContext = createContext<TabsContextValue<unknown> | null>(null);\nexport const TabsStateContext = createContext<TabListState<unknown> | null>(null);\n\ninterface RegisteredTab {\n id: Key;\n textValue?: string;\n isDisabled?: boolean;\n}\n\ninterface CollectionItemLike {\n id?: Key;\n key?: Key;\n label?: string;\n textValue?: string;\n isDisabled?: boolean;\n}\n\nfunction collectionItemKey<T>(item: T): Key {\n const tab = item as CollectionItemLike;\n const key = tab.id ?? tab.key;\n if (key == null) {\n throw new Error(\"Tabs collection items require an id or key.\");\n }\n return key;\n}\n\nfunction staticTabText(tab: RegisteredTab): string {\n return tab.textValue ?? String(tab.id);\n}\n\n/**\n * Tabs provide a way to organize content into multiple sections, with only one section visible at a time.\n */\nexport function Tabs<T>(props: TabsProps<T>): JSX.Element {\n const [local, stateProps, rest] = splitProps(\n props,\n [\"class\", \"style\", \"slot\", \"ref\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"onSelectionChange\",\n \"isDisabled\",\n \"keyboardActivation\",\n \"orientation\",\n ],\n );\n\n const [tabListItems, setTabListItems] = createSignal<T[] | undefined>(undefined, {\n ownedWrite: true,\n });\n const [registeredTabs, setRegisteredTabs] = createSignal<RegisteredTab[]>([], {\n ownedWrite: true,\n });\n const effectiveItems = createMemo<T[]>(() => {\n if (stateProps.items) return stateProps.items;\n if (tabListItems()) return tabListItems() ?? [];\n return registeredTabs() as T[];\n });\n\n // Create tab list state\n const state = createTabListState<T>({\n get items() {\n return effectiveItems();\n },\n get getKey() {\n return stateProps.getKey ?? collectionItemKey;\n },\n get getTextValue() {\n return (\n stateProps.getTextValue ??\n ((item: T) => {\n const tab = item as RegisteredTab & CollectionItemLike;\n return tab.textValue ?? tab.label ?? staticTabText(tab);\n })\n );\n },\n get getDisabled() {\n return (\n stateProps.getDisabled ??\n ((item: T) => {\n const tab = item as RegisteredTab & CollectionItemLike;\n return tab.isDisabled ?? false;\n })\n );\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get isDisabled() {\n return stateProps.isDisabled;\n },\n get keyboardActivation() {\n return stateProps.keyboardActivation;\n },\n get orientation() {\n return stateProps.orientation;\n },\n });\n\n const renderValues = createMemo<TabsRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n get children() {\n return props.children;\n },\n defaultClassName: \"solidaria-Tabs\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n\n const contextValue: TabsContextValue<T> = {\n state,\n items: effectiveItems,\n setTabListItems(items) {\n setTabListItems(() => items);\n },\n registerTab(tab) {\n setRegisteredTabs((current) => {\n const next = current.filter((item) => item.id !== tab.id);\n next.push(tab);\n return next;\n });\n },\n unregisterTab(id) {\n setRegisteredTabs((current) => current.filter((item) => item.id !== id));\n },\n };\n\n return (\n <TabsContext value={contextValue as TabsContextValue<unknown>}>\n <TabsStateContext value={state}>\n <div\n {...domProps()}\n ref={(element) => assignRef(local.ref, element)}\n class={renderProps.class()}\n style={renderProps.style()}\n data-orientation={state.orientation()}\n data-disabled={dataAttr(state.isDisabled())}\n >\n {props.children as JSX.Element}\n </div>\n </TabsStateContext>\n </TabsContext>\n );\n}\n\n/**\n * A TabList contains Tab elements that represent the available tabs.\n */\nexport function TabList<T>(props: TabListProps<T>): JSX.Element {\n const [local, collectionProps, ariaProps] = splitProps(\n props,\n [\"class\", \"style\", \"slot\"],\n [\"items\"],\n );\n\n const context = useContext(TabsContext);\n\n if (!context) {\n return <div class=\"solidaria-TabList\" role=\"tablist\" />;\n }\n\n const state = context.state as TabListState<T>;\n const items = context.items as Accessor<T[]>;\n\n createEffect(\n () => collectionProps.items as unknown[] | undefined,\n (items) => {\n context.setTabListItems(items);\n },\n );\n\n onCleanup(() => {\n context.setTabListItems(undefined);\n });\n\n // Create tab list aria props\n const { tabListProps } = createTabList<T>(ariaProps as AriaTabListProps, state);\n\n const renderValues = createMemo<TabListRenderProps>(() => ({\n orientation: state.orientation(),\n isDisabled: state.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TabList\",\n },\n renderValues,\n );\n\n const handleKeyDown = (e: KeyboardEvent) => {\n tabListProps.onKeyDown(e);\n };\n\n const handleFocus = (e: FocusEvent) => {\n tabListProps.onFocusIn(e);\n };\n\n const handleBlur = (e: FocusEvent) => {\n tabListProps.onFocusOut(e);\n };\n\n const renderChildren = () => {\n const children = props.children;\n const isItemRenderer =\n typeof children === \"function\" && (children as (...args: unknown[]) => unknown).length > 0;\n\n if (isItemRenderer) {\n return (\n <SharedElementTransition>\n <For each={(collectionProps.items ?? items()) as T[]}>\n {(item) => (children as (item: T) => JSX.Element)(item)}\n </For>\n </SharedElementTransition>\n );\n }\n\n return children as JSX.Element;\n };\n\n return (\n <div\n role={tabListProps.role}\n aria-orientation={tabListProps[\"aria-orientation\"]}\n aria-label={tabListProps[\"aria-label\"]}\n aria-labelledby={tabListProps[\"aria-labelledby\"]}\n aria-describedby={tabListProps[\"aria-describedby\"]}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={handleKeyDown}\n onFocusIn={handleFocus}\n onFocusOut={handleBlur}\n data-orientation={state.orientation()}\n data-disabled={dataAttr(state.isDisabled())}\n >\n {renderChildren()}\n </div>\n );\n}\n\n/**\n * A Tab represents an individual tab in a TabList.\n */\nexport function Tab(props: TabProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"id\"]);\n\n const context = useContext(TabsStateContext);\n const tabsContext = useContext(TabsContext);\n\n if (!context) {\n return <div class=\"solidaria-Tab\" role=\"tab\" />;\n }\n\n const [tabRef, setTabRef] = createSignal<HTMLDivElement | null>(null);\n const textValue = () => {\n if (ariaProps[\"aria-label\"]) return ariaProps[\"aria-label\"];\n return typeof props.children === \"string\" ? props.children : undefined;\n };\n\n createEffect(\n () => ({\n id: local.id,\n textValue: textValue(),\n isDisabled: ariaProps.isDisabled,\n }),\n (tab) => {\n tabsContext?.registerTab(tab);\n },\n );\n\n onCleanup(() => {\n tabsContext?.unregisterTab(local.id);\n });\n\n // Create tab aria props\n const tabAria = createTab<unknown>(\n {\n key: local.id,\n get isDisabled() {\n return ariaProps.isDisabled;\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return ariaProps[\"aria-labelledby\"];\n },\n },\n context,\n tabRef,\n );\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return tabAria.isDisabled();\n },\n });\n\n const renderValues = createMemo<TabRenderProps>(() => ({\n isSelected: tabAria.isSelected(),\n isFocused: tabAria.isFocused(),\n isFocusVisible: tabAria.isFocusVisible(),\n isPressed: tabAria.isPressed(),\n isHovered: isHovered(),\n isDisabled: tabAria.isDisabled(),\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-Tab\",\n },\n renderValues,\n );\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: tabAria.isSelected,\n }));\n\n return (\n <div\n ref={setTabRef}\n id={tabAria.tabProps.id}\n role={tabAria.tabProps.role}\n aria-selected={ariaTrueFalse(tabAria.isSelected())}\n aria-disabled={attrTrue(tabAria.isDisabled())}\n aria-controls={tabAria.isSelected() ? tabAria.tabProps[\"aria-controls\"] : undefined}\n aria-label={tabAria.tabProps[\"aria-label\"]}\n aria-labelledby={tabAria.tabProps[\"aria-labelledby\"]}\n tabindex={tabAria.tabProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onKeyDown={tabAria.tabProps.onKeyDown}\n onMouseDown={tabAria.tabProps.onMouseDown}\n onPointerDown={tabAria.tabProps.onPointerDown}\n onClick={tabAria.tabProps.onClick}\n onFocus={tabAria.tabProps.onFocus}\n onFocusIn={tabAria.tabProps.onFocusIn}\n onBlur={tabAria.tabProps.onBlur}\n {...hoverProps}\n data-selected={dataAttr(tabAria.isSelected())}\n data-focused={dataAttr(tabAria.isFocused())}\n data-focus-visible={dataAttr(tabAria.isFocusVisible())}\n data-pressed={dataAttr(tabAria.isPressed())}\n data-hovered={dataAttr(isHovered())}\n data-disabled={dataAttr(tabAria.isDisabled())}\n >\n <SelectionIndicatorContext value={selectionIndicatorContext()}>\n {renderProps.renderChildrenStable()}\n </SelectionIndicatorContext>\n </div>\n );\n}\n\n/**\n * Groups multiple TabPanel elements.\n */\nexport function TabPanels(props: TabPanelsProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n const domProps = createMemo(() =>\n filterDOMProps(rest as Record<string, unknown>, { global: true }),\n );\n const state = useContext(TabsStateContext);\n let ref: HTMLDivElement | undefined;\n let previousSelectedKey: Key | null | undefined = undefined;\n const [panelSize, setPanelSize] = createSignal<{ width?: string; height?: string }>({});\n\n createTrackedEffect(() => {\n const selectedKey = state?.selectedKey() ?? null;\n if (!ref) {\n previousSelectedKey = selectedKey;\n return;\n }\n\n if (previousSelectedKey === undefined) {\n previousSelectedKey = selectedKey;\n return;\n }\n\n if (previousSelectedKey === selectedKey) return;\n previousSelectedKey = selectedKey;\n\n const transition = window.getComputedStyle(ref).transition;\n const shouldMeasureWidth = /width|inline-size|all/.test(transition);\n const shouldMeasureHeight = /height|block-size|all/.test(transition);\n if (!shouldMeasureWidth && !shouldMeasureHeight) return;\n\n const selectedPanel = ref.querySelector<HTMLElement>('[role=\"tabpanel\"]:not([hidden])');\n if (!selectedPanel) return;\n\n setPanelSize({\n width: shouldMeasureWidth ? `${selectedPanel.offsetWidth}px` : undefined,\n height: shouldMeasureHeight ? `${selectedPanel.offsetHeight}px` : undefined,\n });\n });\n\n const mergedStyle = (): JSX.CSSProperties =>\n ({\n ...local.style,\n ...(panelSize().width ? { \"--tab-panel-width\": panelSize().width } : {}),\n ...(panelSize().height ? { \"--tab-panel-height\": panelSize().height } : {}),\n }) as JSX.CSSProperties;\n\n return (\n <div\n {...domProps()}\n ref={(el) => {\n ref = el;\n }}\n class={local.class ?? \"solidaria-TabPanels\"}\n style={mergedStyle()}\n >\n {local.children}\n </div>\n );\n}\n\n/**\n * A TabPanel displays the content for a selected Tab.\n */\nexport function TabPanel(props: TabPanelProps): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"shouldForceMount\"]);\n const [panelRef, setPanelRef] = createSignal<HTMLDivElement>();\n\n // Get state from context (may be null for SSR scenarios)\n const state = useContext(TabsStateContext);\n\n // Create tab panel aria props\n const { tabPanelProps, isSelected } = createTabPanel<unknown>(ariaProps, state, panelRef);\n\n // Create focus ring for the panel\n const { isFocused, isFocusVisible, focusProps } = createFocusRing();\n const isInert = () =>\n Boolean(local.shouldForceMount && ariaProps.id !== undefined && !isSelected());\n const isEntering = () => false;\n const isExiting = () => false;\n\n const renderValues = createMemo<TabPanelRenderProps>(() => ({\n isSelected: isSelected(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isInert: isInert(),\n isEntering: isEntering(),\n isExiting: isExiting(),\n state,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-TabPanel\",\n },\n renderValues,\n );\n\n // Determine if we should render the panel\n // If no id is provided, render when any tab is selected (shared panel pattern)\n // If id is provided, render when that specific tab is selected\n const shouldRender = () => {\n if (local.shouldForceMount) return true;\n if (ariaProps.id === undefined) {\n return state ? state.selectedKey() !== null : true;\n }\n return isSelected();\n };\n\n return (\n <Show when={shouldRender()}>\n <div\n ref={setPanelRef}\n id={tabPanelProps.id}\n role={tabPanelProps.role}\n aria-labelledby={tabPanelProps[\"aria-labelledby\"]}\n aria-label={tabPanelProps[\"aria-label\"]}\n aria-describedby={tabPanelProps[\"aria-describedby\"]}\n tabindex={tabPanelProps.tabIndex}\n class={renderProps.class()}\n style={renderProps.style()}\n onFocus={focusProps.onFocus}\n onBlur={focusProps.onBlur}\n data-selected={dataAttr(isSelected())}\n data-focused={dataAttr(isFocused())}\n data-focus-visible={dataAttr(isFocusVisible())}\n inert={isInert() ? true : undefined}\n data-inert={dataAttr(isInert())}\n data-entering={dataAttr(isEntering())}\n data-exiting={dataAttr(isExiting())}\n hidden={\n ariaProps.id !== undefined && !isSelected() && !local.shouldForceMount ? true : undefined\n }\n >\n {renderProps.renderChildren()}\n </div>\n </Show>\n );\n}\n\nTabs.List = TabList;\nTabs.Tab = Tab;\nTabs.Panels = TabPanels;\nTabs.Panel = TabPanel;\nTabs.SelectionIndicator = SelectionIndicator;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiNA,SAASA,YAAa,KAAiB,SAAkB;CACvD,IAAI,CAAC,KAAK;CACV,IAAI,OAAO,QAAQ,YACjB,IAAI,OAAO;MACN,IAAI,OAAO,QAAQ,YAAY,aAAa,KACjD,IAAI,UAAU;AAElB;AAEA,MAAa,cAAc,cAAgD,IAAI;AAC/E,MAAa,mBAAmB,cAA4C,IAAI;AAgBhF,SAAS,kBAAqB,MAAc;CAC1C,MAAM,MAAM;CACZ,MAAM,MAAM,IAAI,MAAM,IAAI;CAC1B,IAAI,OAAO,MACT,MAAM,IAAI,MAAM,6CAA6C;CAE/D,OAAO;AACT;AAEA,SAAS,cAAc,KAA4B;CACjD,OAAO,IAAI,aAAa,OAAO,IAAI,EAAE;AACvC;;;;AAKA,SAAgB,KAAQ,OAAkC;CACxD,MAAM,CAAC,OAAO,YAA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