@soroush.tech/design-system 2.0.0-rc.0 → 2.0.0-rc.2

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 (299) hide show
  1. package/README.md +17 -1
  2. package/dist/AppBar.d.cts +1 -3
  3. package/dist/AppBar.d.mts +1 -3
  4. package/dist/Avatar.cjs +1 -1
  5. package/dist/Avatar.d.cts +1 -3
  6. package/dist/Avatar.d.mts +1 -3
  7. package/dist/Avatar.mjs +1 -1
  8. package/dist/Backdrop.d.cts +1 -1
  9. package/dist/Backdrop.d.mts +1 -1
  10. package/dist/Breadcrumbs.cjs +132 -0
  11. package/dist/Breadcrumbs.d.cts +40 -0
  12. package/dist/Breadcrumbs.d.mts +40 -0
  13. package/dist/Breadcrumbs.mjs +131 -0
  14. package/dist/Button.cjs +1 -1
  15. package/dist/Button.d.cts +1 -1
  16. package/dist/Button.d.mts +1 -1
  17. package/dist/Button.mjs +1 -1
  18. package/dist/ButtonGroup.d.cts +1 -1
  19. package/dist/ButtonGroup.d.mts +1 -1
  20. package/dist/Card.cjs +3 -3
  21. package/dist/Card.d.cts +4 -3
  22. package/dist/Card.d.mts +4 -3
  23. package/dist/Card.mjs +3 -3
  24. package/dist/Checkbox.d.cts +1 -2
  25. package/dist/Checkbox.d.mts +1 -2
  26. package/dist/CircularProgress.d.cts +2 -3
  27. package/dist/CircularProgress.d.mts +2 -3
  28. package/dist/Drawer.d.cts +3 -2
  29. package/dist/Drawer.d.mts +3 -2
  30. package/dist/Flex.d.cts +1 -1
  31. package/dist/Flex.d.mts +1 -1
  32. package/dist/Form.d.cts +1 -1
  33. package/dist/Form.d.mts +1 -1
  34. package/dist/FormControl.cjs +1 -1
  35. package/dist/FormControl.d.cts +1 -2
  36. package/dist/FormControl.d.mts +1 -2
  37. package/dist/FormControl.mjs +1 -1
  38. package/dist/FormHelperText.d.cts +1 -1
  39. package/dist/FormHelperText.d.mts +1 -1
  40. package/dist/FormLabel.d.cts +1 -1
  41. package/dist/FormLabel.d.mts +1 -1
  42. package/dist/Grid.d.cts +1 -3
  43. package/dist/Grid.d.mts +1 -3
  44. package/dist/{Icon-CI6q2Eyi.cjs → Icon-Cvuhp9ek.cjs} +12 -2
  45. package/dist/{Icon-CH3asUJu.mjs → Icon-DlheCTJb.mjs} +12 -2
  46. package/dist/Icon.cjs +1 -1
  47. package/dist/Icon.d.cts +1 -1
  48. package/dist/Icon.d.mts +1 -1
  49. package/dist/Icon.mjs +1 -1
  50. package/dist/Image.d.cts +1 -2
  51. package/dist/Image.d.mts +1 -2
  52. package/dist/LinearProgress.d.cts +2 -3
  53. package/dist/LinearProgress.d.mts +2 -3
  54. package/dist/Link.cjs +1 -1
  55. package/dist/Link.d.cts +1 -1
  56. package/dist/Link.d.mts +1 -1
  57. package/dist/Link.mjs +1 -1
  58. package/dist/Menu/ContextMenu.cjs +146 -0
  59. package/dist/Menu/ContextMenu.d.cts +52 -0
  60. package/dist/Menu/ContextMenu.d.mts +52 -0
  61. package/dist/Menu/ContextMenu.mjs +145 -0
  62. package/dist/Menu/Menu.cjs +3 -0
  63. package/dist/Menu/Menu.d.cts +2 -0
  64. package/dist/Menu/Menu.d.mts +2 -0
  65. package/dist/Menu/Menu.mjs +2 -0
  66. package/dist/Menu/MenuDivider.cjs +29 -0
  67. package/dist/Menu/MenuDivider.d.cts +12 -0
  68. package/dist/Menu/MenuDivider.d.mts +12 -0
  69. package/dist/Menu/MenuDivider.mjs +28 -0
  70. package/dist/Menu/MenuItems.cjs +29 -0
  71. package/dist/Menu/MenuItems.d.cts +2 -0
  72. package/dist/Menu/MenuItems.d.mts +2 -0
  73. package/dist/Menu/MenuItems.mjs +28 -0
  74. package/dist/Menu/MenuList.cjs +3 -0
  75. package/dist/Menu/MenuList.d.cts +38 -0
  76. package/dist/Menu/MenuList.d.mts +38 -0
  77. package/dist/Menu/MenuList.mjs +2 -0
  78. package/dist/Menu-BkKPTOfh.cjs +172 -0
  79. package/dist/Menu-tECbAEFj.mjs +167 -0
  80. package/dist/Menu.cjs +13 -0
  81. package/dist/Menu.d.cts +7 -0
  82. package/dist/Menu.d.mts +7 -0
  83. package/dist/Menu.mjs +6 -0
  84. package/dist/MenuItem-BR7ingQx.mjs +654 -0
  85. package/dist/MenuItem-CfdN4axw.cjs +684 -0
  86. package/dist/MenuItem.cjs +2 -148
  87. package/dist/MenuItem.d.cts +2 -52
  88. package/dist/MenuItem.d.mts +2 -52
  89. package/dist/MenuItem.mjs +1 -147
  90. package/dist/MenuList-B7msJ1IG.mjs +187 -0
  91. package/dist/MenuList-D4imLXAa.cjs +223 -0
  92. package/dist/MenuListContext-Dml16k0X.d.mts +21 -0
  93. package/dist/MenuListContext-vujGcRk9.d.cts +21 -0
  94. package/dist/Modal.d.cts +1 -1
  95. package/dist/Modal.d.mts +1 -1
  96. package/dist/NativeSelect.cjs +2 -2
  97. package/dist/NativeSelect.d.cts +2 -3
  98. package/dist/NativeSelect.d.mts +2 -3
  99. package/dist/NativeSelect.mjs +2 -2
  100. package/dist/Pagination/PaginationItem.cjs +1 -1
  101. package/dist/Pagination/PaginationItem.d.cts +1 -1
  102. package/dist/Pagination/PaginationItem.d.mts +1 -1
  103. package/dist/Pagination/PaginationItem.mjs +1 -1
  104. package/dist/Pagination.d.cts +2 -2
  105. package/dist/Pagination.d.mts +2 -2
  106. package/dist/Paper.cjs +1 -1
  107. package/dist/Paper.d.cts +2 -1
  108. package/dist/Paper.d.mts +2 -1
  109. package/dist/Paper.mjs +1 -1
  110. package/dist/{Popover-TpwRSORC.cjs → Popover-CiZfgiKE.cjs} +5 -125
  111. package/dist/Popover-QjM5Z1CR.mjs +133 -0
  112. package/dist/Popover.cjs +1 -1
  113. package/dist/Popover.d.cts +6 -7
  114. package/dist/Popover.d.mts +6 -7
  115. package/dist/Popover.mjs +1 -1
  116. package/dist/Pressable.cjs +1 -1
  117. package/dist/Pressable.d.cts +1 -1
  118. package/dist/Pressable.d.mts +1 -1
  119. package/dist/Pressable.mjs +1 -1
  120. package/dist/Quote.d.cts +2 -3
  121. package/dist/Quote.d.mts +2 -3
  122. package/dist/Radio.d.cts +1 -2
  123. package/dist/Radio.d.mts +1 -2
  124. package/dist/Select.cjs +3 -3
  125. package/dist/Select.d.cts +2 -3
  126. package/dist/Select.d.mts +2 -3
  127. package/dist/Select.mjs +3 -3
  128. package/dist/Sidebar/Sidebar.d.cts +1 -1
  129. package/dist/Sidebar/Sidebar.d.mts +1 -1
  130. package/dist/Sidebar/SidebarItem.cjs +1 -1
  131. package/dist/Sidebar/SidebarItem.d.cts +3 -4
  132. package/dist/Sidebar/SidebarItem.d.mts +3 -4
  133. package/dist/Sidebar/SidebarItem.mjs +1 -1
  134. package/dist/Skeleton.d.cts +1 -2
  135. package/dist/Skeleton.d.mts +1 -2
  136. package/dist/Switch.cjs +1 -1
  137. package/dist/Switch.d.cts +1 -2
  138. package/dist/Switch.d.mts +1 -2
  139. package/dist/Switch.mjs +1 -1
  140. package/dist/Table/Table.d.cts +2 -3
  141. package/dist/Table/Table.d.mts +2 -3
  142. package/dist/Table/TableBody.d.cts +1 -2
  143. package/dist/Table/TableBody.d.mts +1 -2
  144. package/dist/Table/TableCell.d.cts +1 -1
  145. package/dist/Table/TableCell.d.mts +1 -1
  146. package/dist/Table/TableContainer.d.cts +1 -3
  147. package/dist/Table/TableContainer.d.mts +1 -3
  148. package/dist/Table/TableControl.d.cts +1 -1
  149. package/dist/Table/TableControl.d.mts +1 -1
  150. package/dist/Table/TableFooter.d.cts +1 -2
  151. package/dist/Table/TableFooter.d.mts +1 -2
  152. package/dist/Table/TableHead.d.cts +1 -2
  153. package/dist/Table/TableHead.d.mts +1 -2
  154. package/dist/Table/TablePagination.d.cts +2 -2
  155. package/dist/Table/TablePagination.d.mts +2 -2
  156. package/dist/Table/TablePaginationActions.cjs +1 -1
  157. package/dist/Table/TablePaginationActions.d.cts +1 -1
  158. package/dist/Table/TablePaginationActions.d.mts +1 -1
  159. package/dist/Table/TablePaginationActions.mjs +1 -1
  160. package/dist/Table/TableRow.d.cts +1 -2
  161. package/dist/Table/TableRow.d.mts +1 -2
  162. package/dist/Table/TableSortLabel.cjs +1 -1
  163. package/dist/Table/TableSortLabel.d.cts +1 -1
  164. package/dist/Table/TableSortLabel.d.mts +1 -1
  165. package/dist/Table/TableSortLabel.mjs +1 -1
  166. package/dist/Table/hooks.d.cts +1 -1
  167. package/dist/Table/hooks.d.mts +1 -1
  168. package/dist/Table.d.cts +5 -5
  169. package/dist/Table.d.mts +5 -5
  170. package/dist/{TableContext-BeCxbtHH.d.cts → TableContext-6PgGpUzM.d.mts} +1 -1
  171. package/dist/{TableContext-BiRiYkVZ.d.mts → TableContext-CBGk-Lh8.d.cts} +1 -1
  172. package/dist/Tabs/Tab.cjs +306 -0
  173. package/dist/Tabs/Tab.d.cts +62 -0
  174. package/dist/Tabs/Tab.d.mts +62 -0
  175. package/dist/Tabs/Tab.mjs +305 -0
  176. package/dist/Tabs/TabContext.cjs +34 -0
  177. package/dist/Tabs/TabContext.d.cts +20 -0
  178. package/dist/Tabs/TabContext.d.mts +20 -0
  179. package/dist/Tabs/TabContext.mjs +33 -0
  180. package/dist/Tabs/TabList.cjs +31 -0
  181. package/dist/Tabs/TabList.d.cts +11 -0
  182. package/dist/Tabs/TabList.d.mts +11 -0
  183. package/dist/Tabs/TabList.mjs +30 -0
  184. package/dist/Tabs/TabPanel.cjs +40 -0
  185. package/dist/Tabs/TabPanel.d.cts +27 -0
  186. package/dist/Tabs/TabPanel.d.mts +27 -0
  187. package/dist/Tabs/TabPanel.mjs +38 -0
  188. package/dist/Tabs/TabScrollButton.cjs +93 -0
  189. package/dist/Tabs/TabScrollButton.d.cts +2 -0
  190. package/dist/Tabs/TabScrollButton.d.mts +2 -0
  191. package/dist/Tabs/TabScrollButton.mjs +91 -0
  192. package/dist/Tabs/Tabs.cjs +3 -0
  193. package/dist/Tabs/Tabs.d.cts +3 -0
  194. package/dist/Tabs/Tabs.d.mts +3 -0
  195. package/dist/Tabs/Tabs.mjs +2 -0
  196. package/dist/Tabs-D_wkX-Jb.cjs +645 -0
  197. package/dist/Tabs-YfCUbkQV.mjs +633 -0
  198. package/dist/Tabs.cjs +13 -0
  199. package/dist/Tabs.d.cts +8 -0
  200. package/dist/Tabs.d.mts +8 -0
  201. package/dist/Tabs.mjs +7 -0
  202. package/dist/TabsContext-C2agsLBN.d.cts +6 -0
  203. package/dist/TabsContext-DqyxdmGW.d.mts +6 -0
  204. package/dist/TabsValueContext-D40zGCpE.cjs +19 -0
  205. package/dist/TabsValueContext-DvL3inf7.mjs +8 -0
  206. package/dist/TextInput.cjs +1 -1
  207. package/dist/TextInput.d.cts +1 -2
  208. package/dist/TextInput.d.mts +1 -2
  209. package/dist/TextInput.mjs +1 -1
  210. package/dist/ToggleButton/ToggleButton.cjs +1 -1
  211. package/dist/ToggleButton/ToggleButton.d.cts +1 -1
  212. package/dist/ToggleButton/ToggleButton.d.mts +1 -1
  213. package/dist/ToggleButton/ToggleButton.mjs +1 -1
  214. package/dist/ToggleButton/ToggleButtonGroup.cjs +1 -1
  215. package/dist/ToggleButton/ToggleButtonGroup.d.cts +1 -1
  216. package/dist/ToggleButton/ToggleButtonGroup.d.mts +1 -1
  217. package/dist/ToggleButton/ToggleButtonGroup.mjs +1 -1
  218. package/dist/Typography.cjs +1 -1
  219. package/dist/Typography.d.cts +2 -2
  220. package/dist/Typography.d.mts +2 -2
  221. package/dist/Typography.mjs +1 -1
  222. package/dist/View.d.cts +1 -1
  223. package/dist/View.d.mts +1 -1
  224. package/dist/catalog.cjs +4110 -0
  225. package/dist/catalog.d.cts +90 -0
  226. package/dist/catalog.d.mts +90 -0
  227. package/dist/catalog.mjs +4109 -0
  228. package/dist/computePopoverPosition-BIprs_xo.mjs +123 -0
  229. package/dist/computePopoverPosition-DiyEOHnU.cjs +128 -0
  230. package/dist/dividerLine-BNljcGlv.cjs +66 -0
  231. package/dist/dividerLine-FahY-M6_.mjs +31 -0
  232. package/dist/engine.d.cts +1 -1
  233. package/dist/engine.d.mts +1 -1
  234. package/dist/index-B3LIhqHR.d.cts +98 -0
  235. package/dist/{index-DbEnSf2m.d.cts → index-B8DNxyEw.d.mts} +3 -4
  236. package/dist/{index-CxUsrlg1.d.cts → index-BCnKYNlZ.d.cts} +1 -2
  237. package/dist/{index-BUoVTCqX.d.mts → index-BFruxTHv.d.cts} +2 -3
  238. package/dist/{index-BSqet8aO.d.cts → index-BSA6SKao.d.mts} +2 -3
  239. package/dist/{index-CrN4MSUF.d.cts → index-BVPrG1L0.d.mts} +1 -1
  240. package/dist/{index-Celm-8iN.d.cts → index-BbgFYfX_.d.mts} +3 -4
  241. package/dist/{index-B78VkB0-.d.cts → index-Bhdn4KTy.d.cts} +2 -3
  242. package/dist/{index-Chg6pSrr.d.mts → index-BiVvxOvj.d.cts} +3 -4
  243. package/dist/index-BjPX49XA.d.mts +34 -0
  244. package/dist/{index-BB-dLv5V.d.mts → index-BjfPEP_5.d.cts} +3 -4
  245. package/dist/{index-Bid71KeF.d.cts → index-BlLH6rlE.d.cts} +2 -2
  246. package/dist/{index-Ctqajtac.d.cts → index-BqpS_Huq.d.mts} +12 -4
  247. package/dist/{index-BhibLnZ0.d.cts → index-Bxd9NOWb.d.mts} +2 -3
  248. package/dist/index-C3KrFPCj.d.mts +35 -0
  249. package/dist/{themes-RX2UX5gD.d.mts → index-CVNJEUwJ.d.mts} +217 -8
  250. package/dist/index-CWnbCxgw.d.cts +72 -0
  251. package/dist/index-Cj5Rhh_9.d.mts +72 -0
  252. package/dist/index-CoEqjFYn.d.mts +98 -0
  253. package/dist/{index-S-ClM6WM.d.mts → index-CrIxI8Na.d.mts} +2 -2
  254. package/dist/index-DBteSahY.d.cts +1 -0
  255. package/dist/index-DCmH5f9I.d.cts +72 -0
  256. package/dist/{index-VOsBSWEu.d.mts → index-DDJuUfL5.d.cts} +1 -1
  257. package/dist/{index-DdqdSOct.d.cts → index-DIC7HKpP.d.mts} +2 -3
  258. package/dist/{index-BfZuh9c2.d.mts → index-DJCpnTH3.d.mts} +2 -3
  259. package/dist/index-DQcnJ5H4.d.cts +35 -0
  260. package/dist/{index-DNwF3DUX.d.cts → index-DXhMkjQ6.d.cts} +2 -3
  261. package/dist/index-DckSub2J.d.mts +72 -0
  262. package/dist/{index-nc4Sxiy9.d.mts → index-DeDxYlSQ.d.mts} +2 -3
  263. package/dist/{themes-Kbk9h5cN.d.cts → index-DmJ7yWWi.d.cts} +214 -5
  264. package/dist/{index-Wnv6jCR3.d.mts → index-DqjXDutI.d.mts} +1 -2
  265. package/dist/{index-GpnmW6vu.d.mts → index-DrVYWt-X.d.mts} +1 -2
  266. package/dist/{index-Belxmt1X.d.cts → index-DuVNRXP4.d.cts} +1 -2
  267. package/dist/{index-smqjMLAZ.d.mts → index-IdMqR82e.d.cts} +2 -3
  268. package/dist/{index-DXvQ-JVZ.d.mts → index-XxydXX8l.d.cts} +2 -3
  269. package/dist/index-_G1osn09.d.mts +1 -0
  270. package/dist/index-gnh-Oe0n.d.cts +34 -0
  271. package/dist/{index-DO9J-Fla.d.mts → index-qlfNErNd.d.cts} +12 -4
  272. package/dist/index.d.cts +1 -2
  273. package/dist/index.d.mts +1 -2
  274. package/dist/style.cjs +1 -1
  275. package/dist/style.d.cts +2 -2
  276. package/dist/style.d.mts +2 -2
  277. package/dist/style.mjs +1 -1
  278. package/dist/surfaceSystem-BGQBoXv_.cjs +38 -0
  279. package/dist/surfaceSystem-D8TbmKy3.mjs +21 -0
  280. package/dist/theme-BxXuXRgQ.cjs +137 -0
  281. package/dist/theme-Z9_QludW.mjs +102 -0
  282. package/dist/theme.cjs +25 -24
  283. package/dist/theme.d.cts +3 -3
  284. package/dist/theme.d.mts +3 -3
  285. package/dist/theme.mjs +2 -1
  286. package/dist/{theme-CDVxig_g.mjs → themes-L-dE7_ck.mjs} +10 -110
  287. package/dist/{theme-BXlAP3xf.cjs → themes-gd6tcmqS.cjs} +0 -136
  288. package/dist/{useTablePagination-COTiNH_8.d.mts → useTablePagination-C5VKtqDp.d.cts} +1 -1
  289. package/dist/{useTablePagination-WFkaUZu8.d.cts → useTablePagination-C6LSlt3w.d.mts} +1 -1
  290. package/package.json +43 -2
  291. package/dist/Popover-DwnSLpp1.mjs +0 -253
  292. package/dist/index-B_dKjEDR.d.mts +0 -23
  293. package/dist/index-C1WqEDtQ.d.mts +0 -69
  294. package/dist/index-CA7HnbtH.d.cts +0 -21
  295. package/dist/index-CKZaErxJ.d.mts +0 -21
  296. package/dist/index-DBUwu65Z.d.cts +0 -69
  297. package/dist/index-DzQJSYIh.d.cts +0 -23
  298. package/dist/index-cuv3o-L7.d.mts +0 -34
  299. package/dist/index-nB94D7UM.d.cts +0 -34
@@ -0,0 +1,305 @@
1
+ import { a as src_exports, o as styled, t as createShouldForwardProp } from "../src-DLGYOJMh.mjs";
2
+ import { n as useDefaultProps } from "../theme-Z9_QludW.mjs";
3
+ import { t as Icon } from "../Icon-DlheCTJb.mjs";
4
+ import { i as TabIndexContext, n as getDividerShadow, o as useTabsContext } from "../dividerLine-FahY-M6_.mjs";
5
+ import { useContext } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/Tabs/Tab/Tab.tsx
8
+ const shouldForwardProp = createShouldForwardProp([
9
+ "variant",
10
+ "color",
11
+ "textColor",
12
+ "sizeToken",
13
+ "isSelected",
14
+ "isDisabled",
15
+ "iconPlacement",
16
+ "isWrapped",
17
+ "fullWidth",
18
+ "isVertical",
19
+ "hasDivider",
20
+ "selectedBg",
21
+ "bg",
22
+ "borderRadius",
23
+ "lineColor",
24
+ "rowPaddingTop",
25
+ "rowPaddingBottom"
26
+ ]);
27
+ const getEnclosedEdgeStyle = (theme, main, lineMain, isSelected, isVertical, hasDivider, radius) => {
28
+ const thin = theme.borderWidths.thin;
29
+ const top = `inset 0 ${thin} 0 ${main}`;
30
+ const right = `inset -${thin} 0 0 ${main}`;
31
+ const foot = `inset 0 -${thin} 0 ${main}`;
32
+ const left = `inset ${thin} 0 0 ${main}`;
33
+ const outline = isVertical ? [
34
+ top,
35
+ foot,
36
+ left
37
+ ] : [
38
+ top,
39
+ right,
40
+ left
41
+ ];
42
+ let edges = "none";
43
+ if (hasDivider) edges = isSelected ? outline.join(", ") : getDividerShadow(theme, isVertical, lineMain);
44
+ return {
45
+ border: "none",
46
+ padding: thin,
47
+ boxShadow: edges,
48
+ borderRadius: 0,
49
+ ...isVertical ? {
50
+ borderStartStartRadius: radius,
51
+ borderEndStartRadius: radius
52
+ } : {
53
+ borderTopLeftRadius: radius,
54
+ borderTopRightRadius: radius
55
+ }
56
+ };
57
+ };
58
+ const TabRoot = styled("div", {
59
+ name: "Tab",
60
+ label: "Tab",
61
+ shouldForwardProp
62
+ })(({ theme, variant, color, isSelected, isDisabled, fullWidth, isVertical, hasDivider, selectedBg, bg, borderRadius, lineColor }) => {
63
+ const main = (0, src_exports.get)(theme, `palette.${color}.main`);
64
+ const isBoxed = variant === "boxed";
65
+ const outlineColor = isBoxed && isSelected ? `${main}59` : "transparent";
66
+ const raised = (0, src_exports.get)(theme, "background.paper");
67
+ const groundKey = isSelected && selectedBg ? selectedBg : bg;
68
+ const ground = groundKey ? (0, src_exports.get)(theme, `background.${groundKey}`) : "transparent";
69
+ const isRounded = isBoxed || variant === "enclosed";
70
+ let radius = 0;
71
+ if (borderRadius) radius = theme.radii[borderRadius];
72
+ else if (isRounded) radius = theme.radii.sm;
73
+ return {
74
+ position: "relative",
75
+ display: "flex",
76
+ alignItems: "stretch",
77
+ flexGrow: fullWidth ? 1 : 0,
78
+ flexShrink: fullWidth ? 1 : 0,
79
+ flexBasis: fullWidth ? 0 : "auto",
80
+ minWidth: 0,
81
+ backgroundColor: ground,
82
+ border: `${theme.borderWidths.thin} solid ${outlineColor}`,
83
+ borderRadius: radius,
84
+ ...variant === "enclosed" && getEnclosedEdgeStyle(theme, main, (0, src_exports.get)(theme, `palette.${lineColor}.main`), isSelected, isVertical, hasDivider, String(radius)),
85
+ transition: "background-color 0.12s ease",
86
+ ...isDisabled ? {} : { "&:hover": { backgroundColor: isBoxed ? raised : `${main}14` } },
87
+ "&:hover [data-tab-close]": { visibility: "visible" }
88
+ };
89
+ });
90
+ const TabLabel = styled("button", {
91
+ name: "Tab",
92
+ slot: "label",
93
+ label: "TabLabel",
94
+ shouldForwardProp
95
+ })(({ theme, variant, color, textColor, sizeToken, isSelected, isDisabled, iconPlacement, isWrapped, isVertical, rowPaddingTop, rowPaddingBottom }) => {
96
+ const { paddingTop, paddingBottom, paddingLeft, paddingRight, fontSize } = theme.sizes[sizeToken];
97
+ const main = (0, src_exports.get)(theme, `palette.${color}.main`);
98
+ const idleColor = (0, src_exports.get)(theme, `text.${textColor ?? "primary"}`);
99
+ let labelColor = isSelected ? variant === "boxed" ? idleColor : main : idleColor;
100
+ if (isDisabled) labelColor = (0, src_exports.get)(theme, "text.disabled");
101
+ return {
102
+ appearance: "none",
103
+ display: "grid",
104
+ gridAutoFlow: iconPlacement === "start" || iconPlacement === "end" ? "column" : "row",
105
+ alignContent: iconPlacement === "bottom" ? "start" : "end",
106
+ alignItems: "center",
107
+ justifyContent: "center",
108
+ justifyItems: "center",
109
+ gap: theme.space[1],
110
+ flex: 1,
111
+ minWidth: 0,
112
+ margin: 0,
113
+ paddingTop: theme.space[isVertical ? paddingTop : rowPaddingTop],
114
+ paddingBottom: theme.space[isVertical ? paddingBottom : rowPaddingBottom],
115
+ paddingLeft: theme.space[paddingLeft],
116
+ paddingRight: theme.space[paddingRight],
117
+ fontFamily: theme.fonts.body,
118
+ fontSize: theme.fontSizes[fontSize],
119
+ lineHeight: theme.lineHeights.base,
120
+ whiteSpace: isWrapped ? "normal" : "nowrap",
121
+ textAlign: "center",
122
+ textDecoration: "none",
123
+ color: labelColor,
124
+ backgroundColor: "transparent",
125
+ border: "none",
126
+ borderRadius: "inherit",
127
+ cursor: isDisabled ? "default" : "pointer",
128
+ outline: "none",
129
+ "&:focus-visible": {
130
+ outline: `${theme.borderWidths.base} solid ${main}`,
131
+ outlineOffset: `-${theme.borderWidths.base}`
132
+ }
133
+ };
134
+ });
135
+ const SecondaryActionSlot = styled("div", {
136
+ name: "Tab",
137
+ slot: "secondaryAction",
138
+ label: "TabSecondaryAction"
139
+ })({
140
+ display: "flex",
141
+ alignItems: "center",
142
+ flexShrink: 0
143
+ });
144
+ const TabClose = styled("button", {
145
+ name: "Tab",
146
+ slot: "close",
147
+ label: "TabClose",
148
+ shouldForwardProp
149
+ })(({ theme, color, isSelected }) => {
150
+ const main = (0, src_exports.get)(theme, `palette.${color}.main`);
151
+ return {
152
+ appearance: "none",
153
+ display: "grid",
154
+ placeItems: "center",
155
+ alignSelf: "center",
156
+ flexShrink: 0,
157
+ width: theme.icon.sm,
158
+ height: theme.icon.sm,
159
+ padding: 0,
160
+ marginInlineEnd: theme.space[.5],
161
+ border: "none",
162
+ borderRadius: theme.radii.sm,
163
+ backgroundColor: "transparent",
164
+ color: "inherit",
165
+ cursor: "pointer",
166
+ visibility: isSelected ? "visible" : "hidden",
167
+ "&:hover": { backgroundColor: `${main}1F` }
168
+ };
169
+ });
170
+ const IconSlot = styled("span", {
171
+ name: "Tab",
172
+ slot: "icon",
173
+ label: "TabIcon"
174
+ })({
175
+ display: "inline-flex",
176
+ flexShrink: 0
177
+ });
178
+ /**
179
+ * @description One tab of a `Tabs`. In a `tablist` it is a `tab` with `aria-selected` and
180
+ * `aria-controls`, the selected one alone in the page's tab order; in a navigation
181
+ * (`Tabs as="nav"`) a button or link marked `aria-current="page"` when it is the current
182
+ * one. It takes one `icon`, which `iconPosition` places on a side of its label.
183
+ */
184
+ function Tab({ value: valueProp, label, icon, iconPosition = "top", isWrapped: isWrappedProp, bg: bgProp, borderRadius: borderRadiusProp, color: colorProp, textColor: textColorProp, size: sizeProp, selectedBg: selectedBgProp, disabled = false, href, as, onClick, title, closeLabel, secondaryAction, className, "data-testid": dataTestid }) {
185
+ const dp = useDefaultProps("Tab");
186
+ const iconPlacement = icon == null ? void 0 : iconPosition;
187
+ const isIconFirst = iconPlacement === "top" || iconPlacement === "start";
188
+ const iconSlot = icon == null ? null : /* @__PURE__ */ jsx(IconSlot, {
189
+ "aria-hidden": true,
190
+ children: icon
191
+ });
192
+ const isWrapped = isWrappedProp ?? dp.isWrapped ?? false;
193
+ const bg = bgProp ?? dp.bg;
194
+ const borderRadius = borderRadiusProp ?? dp.borderRadius;
195
+ const tabs = useTabsContext();
196
+ const index = useContext(TabIndexContext);
197
+ const value = valueProp ?? index;
198
+ const isSelected = tabs.selectedValue === value;
199
+ const { isNavigation, select, rowProps } = tabs;
200
+ const color = colorProp ?? rowProps.color ?? dp.color ?? tabs.color;
201
+ const textColor = textColorProp ?? rowProps.textColor ?? dp.textColor ?? tabs.textColor;
202
+ const size = sizeProp ?? rowProps.size ?? dp.size ?? tabs.size;
203
+ const selectedBg = selectedBgProp ?? rowProps.selectedBg ?? dp.selectedBg ?? tabs.selectedBg;
204
+ const handleClick = (event) => {
205
+ if (disabled) {
206
+ event.preventDefault();
207
+ return;
208
+ }
209
+ onClick?.(event);
210
+ select(value);
211
+ };
212
+ const handleFocus = () => {
213
+ if (tabs.shouldSelectOnFocus && !disabled && !isSelected) select(value);
214
+ };
215
+ const isClosable = closeLabel !== void 0;
216
+ const close = () => tabs.onTabClose?.(value);
217
+ const handleMouseDown = (event) => {
218
+ if (isClosable && event.button === 1) event.preventDefault();
219
+ };
220
+ const handleAuxClick = (event) => {
221
+ if (isClosable && event.button === 1) close();
222
+ };
223
+ const handleKeyDown = (event) => {
224
+ if (isClosable && event.key === "Delete") {
225
+ event.preventDefault();
226
+ close();
227
+ }
228
+ };
229
+ const element = as ?? (href === void 0 ? "button" : "a");
230
+ const semantics = isNavigation ? { "aria-current": isSelected ? "page" : void 0 } : {
231
+ role: "tab",
232
+ "aria-selected": isSelected,
233
+ "aria-controls": tabs.getPanelId(value),
234
+ tabIndex: value === tabs.focusableValue ? 0 : -1
235
+ };
236
+ const styleProps = {
237
+ variant: tabs.variant,
238
+ color,
239
+ textColor,
240
+ sizeToken: size,
241
+ isSelected,
242
+ isDisabled: disabled,
243
+ iconPlacement,
244
+ isWrapped,
245
+ fullWidth: tabs.fullWidth,
246
+ isVertical: tabs.isVertical,
247
+ hasDivider: tabs.hasDivider,
248
+ selectedBg,
249
+ bg,
250
+ borderRadius,
251
+ lineColor: tabs.selectedColor,
252
+ rowPaddingTop: tabs.rowPaddingTop,
253
+ rowPaddingBottom: tabs.rowPaddingBottom
254
+ };
255
+ return /* @__PURE__ */ jsxs(TabRoot, {
256
+ ...styleProps,
257
+ role: "presentation",
258
+ className,
259
+ "data-tab-value": String(value),
260
+ "data-tab-selected": isSelected || void 0,
261
+ children: [
262
+ /* @__PURE__ */ jsxs(TabLabel, {
263
+ ...semantics,
264
+ as: element,
265
+ id: tabs.getTabId(value),
266
+ type: element === "button" ? "button" : void 0,
267
+ href,
268
+ title,
269
+ "aria-disabled": disabled || void 0,
270
+ "aria-keyshortcuts": isClosable ? "Delete" : void 0,
271
+ "data-tab": true,
272
+ "data-testid": dataTestid,
273
+ ...styleProps,
274
+ onClick: handleClick,
275
+ onFocus: handleFocus,
276
+ onMouseDown: handleMouseDown,
277
+ onAuxClick: handleAuxClick,
278
+ onKeyDown: handleKeyDown,
279
+ children: [
280
+ isIconFirst && iconSlot,
281
+ label,
282
+ !isIconFirst && iconSlot
283
+ ]
284
+ }),
285
+ secondaryAction != null && /* @__PURE__ */ jsx(SecondaryActionSlot, { children: secondaryAction }),
286
+ isClosable && /* @__PURE__ */ jsx(TabClose, {
287
+ type: "button",
288
+ "aria-hidden": true,
289
+ title: closeLabel,
290
+ tabIndex: -1,
291
+ "data-tab-close": true,
292
+ color,
293
+ isSelected,
294
+ onClick: close,
295
+ children: /* @__PURE__ */ jsx(Icon, {
296
+ name: "close",
297
+ size: "0.75rem",
298
+ color: "inherit"
299
+ })
300
+ })
301
+ ]
302
+ });
303
+ }
304
+ //#endregion
305
+ export { Tab };
@@ -0,0 +1,34 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_TabsValueContext = require("../TabsValueContext-D40zGCpE.cjs");
3
+ let react = require("react");
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ //#region src/Tabs/TabContext/TabContext.tsx
6
+ /**
7
+ * @description Holds which tab is selected for a `Tabs` and the `TabPanel`s beside it, so
8
+ * the two can sit apart in the tree - the tabs in a header, the panels in the body - and
9
+ * still be linked (`aria-controls`, `aria-labelledby`).
10
+ */
11
+ function TabContext({ children, value: valueProp, defaultValue = null, onChange }) {
12
+ const [valueState, setValueState] = (0, react.useState)(defaultValue);
13
+ const value = valueProp === void 0 ? valueState : valueProp;
14
+ const baseId = (0, react.useId)();
15
+ const select = (0, react.useCallback)((next) => {
16
+ setValueState(next);
17
+ onChange?.(next);
18
+ }, [onChange]);
19
+ const context = (0, react.useMemo)(() => ({
20
+ value,
21
+ select,
22
+ baseId
23
+ }), [
24
+ value,
25
+ select,
26
+ baseId
27
+ ]);
28
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TabsValueContext.TabsValueContext.Provider, {
29
+ value: context,
30
+ children
31
+ });
32
+ }
33
+ //#endregion
34
+ exports.TabContext = TabContext;
@@ -0,0 +1,20 @@
1
+ import { t as TabValue } from "../TabsContext-C2agsLBN.cjs";
2
+ import { ReactNode } from "react";
3
+ //#region src/Tabs/TabContext/TabContext.d.ts
4
+ interface TabContextProps {
5
+ children?: ReactNode;
6
+ /** The selected tab's value - `null` for none. Controlled with `onChange`. */
7
+ value?: TabValue | null;
8
+ /** The selected tab's value at first, when uncontrolled. */
9
+ defaultValue?: TabValue | null;
10
+ /** Fired with a tab's value when it is chosen. */
11
+ onChange?: (value: TabValue) => void;
12
+ }
13
+ /**
14
+ * @description Holds which tab is selected for a `Tabs` and the `TabPanel`s beside it, so
15
+ * the two can sit apart in the tree - the tabs in a header, the panels in the body - and
16
+ * still be linked (`aria-controls`, `aria-labelledby`).
17
+ */
18
+ declare function TabContext({ children, value: valueProp, defaultValue, onChange }: Readonly<TabContextProps>): import("react").JSX.Element;
19
+ //#endregion
20
+ export { TabContext, TabContextProps };
@@ -0,0 +1,20 @@
1
+ import { t as TabValue } from "../TabsContext-DqyxdmGW.mjs";
2
+ import { ReactNode } from "react";
3
+ //#region src/Tabs/TabContext/TabContext.d.ts
4
+ interface TabContextProps {
5
+ children?: ReactNode;
6
+ /** The selected tab's value - `null` for none. Controlled with `onChange`. */
7
+ value?: TabValue | null;
8
+ /** The selected tab's value at first, when uncontrolled. */
9
+ defaultValue?: TabValue | null;
10
+ /** Fired with a tab's value when it is chosen. */
11
+ onChange?: (value: TabValue) => void;
12
+ }
13
+ /**
14
+ * @description Holds which tab is selected for a `Tabs` and the `TabPanel`s beside it, so
15
+ * the two can sit apart in the tree - the tabs in a header, the panels in the body - and
16
+ * still be linked (`aria-controls`, `aria-labelledby`).
17
+ */
18
+ declare function TabContext({ children, value: valueProp, defaultValue, onChange }: Readonly<TabContextProps>): import("react").JSX.Element;
19
+ //#endregion
20
+ export { TabContext, TabContextProps };
@@ -0,0 +1,33 @@
1
+ import { t as TabsValueContext } from "../TabsValueContext-DvL3inf7.mjs";
2
+ import { useCallback, useId, useMemo, useState } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/Tabs/TabContext/TabContext.tsx
5
+ /**
6
+ * @description Holds which tab is selected for a `Tabs` and the `TabPanel`s beside it, so
7
+ * the two can sit apart in the tree - the tabs in a header, the panels in the body - and
8
+ * still be linked (`aria-controls`, `aria-labelledby`).
9
+ */
10
+ function TabContext({ children, value: valueProp, defaultValue = null, onChange }) {
11
+ const [valueState, setValueState] = useState(defaultValue);
12
+ const value = valueProp === void 0 ? valueState : valueProp;
13
+ const baseId = useId();
14
+ const select = useCallback((next) => {
15
+ setValueState(next);
16
+ onChange?.(next);
17
+ }, [onChange]);
18
+ const context = useMemo(() => ({
19
+ value,
20
+ select,
21
+ baseId
22
+ }), [
23
+ value,
24
+ select,
25
+ baseId
26
+ ]);
27
+ return /* @__PURE__ */ jsx(TabsValueContext.Provider, {
28
+ value: context,
29
+ children
30
+ });
31
+ }
32
+ //#endregion
33
+ export { TabContext };
@@ -0,0 +1,31 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_TabsValueContext = require("../TabsValueContext-D40zGCpE.cjs");
3
+ const require_Tabs = require("../Tabs-D_wkX-Jb.cjs");
4
+ let react = require("react");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ //#region src/Tabs/TabList/TabList.tsx
7
+ /**
8
+ * @description The `Tabs` of a `TabContext`: it shows the context's value and chooses through it,
9
+ * and links each tab to its `TabPanel` - the tab `aria-controls` its panel, which is named by
10
+ * the tab. Everything else is a `Tabs`'.
11
+ */
12
+ function TabList({ onChange, ...rest }) {
13
+ const context = require_TabsValueContext.useTabsValue();
14
+ if (!context) throw new Error("A TabList must be inside a TabContext.");
15
+ const { baseId, value, select } = context;
16
+ const link = (0, react.useMemo)(() => ({ baseId }), [baseId]);
17
+ const handleChange = (next) => {
18
+ select(next);
19
+ onChange?.(next);
20
+ };
21
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Tabs.TabListContext.Provider, {
22
+ value: link,
23
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Tabs.Tabs, {
24
+ ...rest,
25
+ value,
26
+ onChange: handleChange
27
+ })
28
+ });
29
+ }
30
+ //#endregion
31
+ exports.TabList = TabList;
@@ -0,0 +1,11 @@
1
+ import { a as TabsProps } from "../index-B3LIhqHR.cjs";
2
+ //#region src/Tabs/TabList/TabList.d.ts
3
+ type TabListProps = Omit<TabsProps, 'value' | 'defaultValue'>;
4
+ /**
5
+ * @description The `Tabs` of a `TabContext`: it shows the context's value and chooses through it,
6
+ * and links each tab to its `TabPanel` - the tab `aria-controls` its panel, which is named by
7
+ * the tab. Everything else is a `Tabs`'.
8
+ */
9
+ declare function TabList({ onChange, ...rest }: Readonly<TabListProps>): import("react").JSX.Element;
10
+ //#endregion
11
+ export { TabList, TabListProps };
@@ -0,0 +1,11 @@
1
+ import { a as TabsProps } from "../index-CoEqjFYn.mjs";
2
+ //#region src/Tabs/TabList/TabList.d.ts
3
+ type TabListProps = Omit<TabsProps, 'value' | 'defaultValue'>;
4
+ /**
5
+ * @description The `Tabs` of a `TabContext`: it shows the context's value and chooses through it,
6
+ * and links each tab to its `TabPanel` - the tab `aria-controls` its panel, which is named by
7
+ * the tab. Everything else is a `Tabs`'.
8
+ */
9
+ declare function TabList({ onChange, ...rest }: Readonly<TabListProps>): import("react").JSX.Element;
10
+ //#endregion
11
+ export { TabList, TabListProps };
@@ -0,0 +1,30 @@
1
+ import { n as useTabsValue } from "../TabsValueContext-DvL3inf7.mjs";
2
+ import { n as TabListContext, t as Tabs } from "../Tabs-YfCUbkQV.mjs";
3
+ import { useMemo } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/Tabs/TabList/TabList.tsx
6
+ /**
7
+ * @description The `Tabs` of a `TabContext`: it shows the context's value and chooses through it,
8
+ * and links each tab to its `TabPanel` - the tab `aria-controls` its panel, which is named by
9
+ * the tab. Everything else is a `Tabs`'.
10
+ */
11
+ function TabList({ onChange, ...rest }) {
12
+ const context = useTabsValue();
13
+ if (!context) throw new Error("A TabList must be inside a TabContext.");
14
+ const { baseId, value, select } = context;
15
+ const link = useMemo(() => ({ baseId }), [baseId]);
16
+ const handleChange = (next) => {
17
+ select(next);
18
+ onChange?.(next);
19
+ };
20
+ return /* @__PURE__ */ jsx(TabListContext.Provider, {
21
+ value: link,
22
+ children: /* @__PURE__ */ jsx(Tabs, {
23
+ ...rest,
24
+ value,
25
+ onChange: handleChange
26
+ })
27
+ });
28
+ }
29
+ //#endregion
30
+ export { TabList };
@@ -0,0 +1,40 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_src = require("../src-DU81aGy9.cjs");
3
+ const require_theme = require("../theme-BxXuXRgQ.cjs");
4
+ const require_TabsValueContext = require("../TabsValueContext-D40zGCpE.cjs");
5
+ const require_surfaceSystem = require("../surfaceSystem-BGQBoXv_.cjs");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
8
+ //#region src/Tabs/TabPanel/TabPanel.tsx
9
+ const TabPanelRoot = require_src.styled("div", {
10
+ name: "TabPanel",
11
+ label: "TabPanel",
12
+ shouldForwardProp: (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)([..._soroush_tech_styled_system_should_forward_prop.props]),
13
+ systemProps: [require_src.src_exports.space, require_surfaceSystem.surfaceSystem]
14
+ })({ outline: "none" });
15
+ /**
16
+ * @description The content a tab shows: a `role="tabpanel"` named by its tab, which in
17
+ * turn `aria-controls` it. Shown only while its tab is selected. It sits in a
18
+ * `TabContext` beside the `Tabs`, which links the two.
19
+ */
20
+ function TabPanel({ value, children, shouldKeepMounted: shouldKeepMountedProp, className, "data-testid": dataTestid, ...spaceProps }) {
21
+ const dp = require_theme.useDefaultProps("TabPanel");
22
+ const shouldKeepMounted = shouldKeepMountedProp ?? dp.shouldKeepMounted ?? false;
23
+ const tabs = require_TabsValueContext.useTabsValue();
24
+ if (!tabs) throw new Error("A TabPanel must be inside a TabContext.");
25
+ const { baseId } = tabs;
26
+ const isSelected = tabs.value === value;
27
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabPanelRoot, {
28
+ ...spaceProps,
29
+ role: "tabpanel",
30
+ id: require_surfaceSystem.getPanelId(baseId, value),
31
+ "aria-labelledby": require_surfaceSystem.getTabId(baseId, value),
32
+ tabIndex: 0,
33
+ hidden: !isSelected,
34
+ className,
35
+ "data-testid": dataTestid,
36
+ children: isSelected || shouldKeepMounted ? children : null
37
+ });
38
+ }
39
+ //#endregion
40
+ exports.TabPanel = TabPanel;
@@ -0,0 +1,27 @@
1
+ import { V as Theme } from "../index-DmJ7yWWi.cjs";
2
+ import { t as TabValue } from "../TabsContext-C2agsLBN.cjs";
3
+ import { ReactNode } from "react";
4
+ import { SpaceProps } from "@soroush.tech/styled-system";
5
+ //#region src/Tabs/TabPanel/TabPanel.d.ts
6
+ interface TabPanelProps extends SpaceProps<Theme> {
7
+ /** The value of the tab this panel belongs to. */
8
+ value: TabValue;
9
+ /** The panel's content. */
10
+ children?: ReactNode;
11
+ /** Keep the content mounted while the panel is hidden. Default: `false`. */
12
+ shouldKeepMounted?: boolean;
13
+ /** The panel's ground - resolves against `theme.background`. Match its tab's `selectedBg`. */
14
+ bg?: keyof Theme['background'];
15
+ /** The panel's corner radius - resolves against `theme.radii`. */
16
+ borderRadius?: keyof Theme['radii'];
17
+ className?: string;
18
+ 'data-testid'?: string;
19
+ }
20
+ /**
21
+ * @description The content a tab shows: a `role="tabpanel"` named by its tab, which in
22
+ * turn `aria-controls` it. Shown only while its tab is selected. It sits in a
23
+ * `TabContext` beside the `Tabs`, which links the two.
24
+ */
25
+ declare function TabPanel({ value, children, shouldKeepMounted: shouldKeepMountedProp, className, 'data-testid': dataTestid, ...spaceProps }: Readonly<TabPanelProps>): import("react").JSX.Element;
26
+ //#endregion
27
+ export { TabPanel, TabPanelProps };
@@ -0,0 +1,27 @@
1
+ import { V as Theme } from "../index-CVNJEUwJ.mjs";
2
+ import { t as TabValue } from "../TabsContext-DqyxdmGW.mjs";
3
+ import { SpaceProps } from "@soroush.tech/styled-system";
4
+ import { ReactNode } from "react";
5
+ //#region src/Tabs/TabPanel/TabPanel.d.ts
6
+ interface TabPanelProps extends SpaceProps<Theme> {
7
+ /** The value of the tab this panel belongs to. */
8
+ value: TabValue;
9
+ /** The panel's content. */
10
+ children?: ReactNode;
11
+ /** Keep the content mounted while the panel is hidden. Default: `false`. */
12
+ shouldKeepMounted?: boolean;
13
+ /** The panel's ground - resolves against `theme.background`. Match its tab's `selectedBg`. */
14
+ bg?: keyof Theme['background'];
15
+ /** The panel's corner radius - resolves against `theme.radii`. */
16
+ borderRadius?: keyof Theme['radii'];
17
+ className?: string;
18
+ 'data-testid'?: string;
19
+ }
20
+ /**
21
+ * @description The content a tab shows: a `role="tabpanel"` named by its tab, which in
22
+ * turn `aria-controls` it. Shown only while its tab is selected. It sits in a
23
+ * `TabContext` beside the `Tabs`, which links the two.
24
+ */
25
+ declare function TabPanel({ value, children, shouldKeepMounted: shouldKeepMountedProp, className, 'data-testid': dataTestid, ...spaceProps }: Readonly<TabPanelProps>): import("react").JSX.Element;
26
+ //#endregion
27
+ export { TabPanel, TabPanelProps };
@@ -0,0 +1,38 @@
1
+ import { a as src_exports, i as props, o as styled, t as createShouldForwardProp } from "../src-DLGYOJMh.mjs";
2
+ import { n as useDefaultProps } from "../theme-Z9_QludW.mjs";
3
+ import { n as useTabsValue } from "../TabsValueContext-DvL3inf7.mjs";
4
+ import { n as getPanelId, r as getTabId, t as surfaceSystem } from "../surfaceSystem-D8TbmKy3.mjs";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/Tabs/TabPanel/TabPanel.tsx
7
+ const TabPanelRoot = styled("div", {
8
+ name: "TabPanel",
9
+ label: "TabPanel",
10
+ shouldForwardProp: createShouldForwardProp([...props]),
11
+ systemProps: [src_exports.space, surfaceSystem]
12
+ })({ outline: "none" });
13
+ /**
14
+ * @description The content a tab shows: a `role="tabpanel"` named by its tab, which in
15
+ * turn `aria-controls` it. Shown only while its tab is selected. It sits in a
16
+ * `TabContext` beside the `Tabs`, which links the two.
17
+ */
18
+ function TabPanel({ value, children, shouldKeepMounted: shouldKeepMountedProp, className, "data-testid": dataTestid, ...spaceProps }) {
19
+ const dp = useDefaultProps("TabPanel");
20
+ const shouldKeepMounted = shouldKeepMountedProp ?? dp.shouldKeepMounted ?? false;
21
+ const tabs = useTabsValue();
22
+ if (!tabs) throw new Error("A TabPanel must be inside a TabContext.");
23
+ const { baseId } = tabs;
24
+ const isSelected = tabs.value === value;
25
+ return /* @__PURE__ */ jsx(TabPanelRoot, {
26
+ ...spaceProps,
27
+ role: "tabpanel",
28
+ id: getPanelId(baseId, value),
29
+ "aria-labelledby": getTabId(baseId, value),
30
+ tabIndex: 0,
31
+ hidden: !isSelected,
32
+ className,
33
+ "data-testid": dataTestid,
34
+ children: isSelected || shouldKeepMounted ? children : null
35
+ });
36
+ }
37
+ //#endregion
38
+ export { TabPanel };