@soroush.tech/design-system 0.1.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 (373) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +278 -0
  3. package/dist/AppBar.cjs +71 -0
  4. package/dist/AppBar.d.cts +23 -0
  5. package/dist/AppBar.d.mts +23 -0
  6. package/dist/AppBar.mjs +69 -0
  7. package/dist/Avatar.cjs +106 -0
  8. package/dist/Avatar.d.cts +28 -0
  9. package/dist/Avatar.d.mts +28 -0
  10. package/dist/Avatar.mjs +103 -0
  11. package/dist/Backdrop.cjs +26 -0
  12. package/dist/Backdrop.d.cts +10 -0
  13. package/dist/Backdrop.d.mts +10 -0
  14. package/dist/Backdrop.mjs +25 -0
  15. package/dist/Button.cjs +178 -0
  16. package/dist/Button.d.cts +2 -0
  17. package/dist/Button.d.mts +2 -0
  18. package/dist/Button.mjs +175 -0
  19. package/dist/ButtonGroup.cjs +110 -0
  20. package/dist/ButtonGroup.d.cts +2 -0
  21. package/dist/ButtonGroup.d.mts +2 -0
  22. package/dist/ButtonGroup.mjs +107 -0
  23. package/dist/ButtonGroupContext-DS-kl9lG.mjs +5 -0
  24. package/dist/ButtonGroupContext-NtkVeDVE.cjs +9 -0
  25. package/dist/Card.cjs +95 -0
  26. package/dist/Card.d.cts +18 -0
  27. package/dist/Card.d.mts +18 -0
  28. package/dist/Card.mjs +93 -0
  29. package/dist/Checkbox.cjs +192 -0
  30. package/dist/Checkbox.d.cts +2 -0
  31. package/dist/Checkbox.d.mts +2 -0
  32. package/dist/Checkbox.mjs +190 -0
  33. package/dist/CircularProgress.cjs +136 -0
  34. package/dist/CircularProgress.d.cts +34 -0
  35. package/dist/CircularProgress.d.mts +34 -0
  36. package/dist/CircularProgress.mjs +133 -0
  37. package/dist/CodeBlock.cjs +101 -0
  38. package/dist/CodeBlock.d.cts +2 -0
  39. package/dist/CodeBlock.d.mts +2 -0
  40. package/dist/CodeBlock.mjs +100 -0
  41. package/dist/Drawer.cjs +69 -0
  42. package/dist/Drawer.d.cts +22 -0
  43. package/dist/Drawer.d.mts +22 -0
  44. package/dist/Drawer.mjs +66 -0
  45. package/dist/Field.cjs +59 -0
  46. package/dist/Field.d.cts +36 -0
  47. package/dist/Field.d.mts +36 -0
  48. package/dist/Field.mjs +58 -0
  49. package/dist/Flex.cjs +21 -0
  50. package/dist/Flex.d.cts +2 -0
  51. package/dist/Flex.d.mts +2 -0
  52. package/dist/Flex.mjs +19 -0
  53. package/dist/FocusTrap.cjs +82 -0
  54. package/dist/FocusTrap.d.cts +24 -0
  55. package/dist/FocusTrap.d.mts +24 -0
  56. package/dist/FocusTrap.mjs +81 -0
  57. package/dist/Form.cjs +44 -0
  58. package/dist/Form.d.cts +41 -0
  59. package/dist/Form.d.mts +41 -0
  60. package/dist/Form.mjs +42 -0
  61. package/dist/FormContext-CRmRgDgu.cjs +10 -0
  62. package/dist/FormContext-_G3sxJyQ.mjs +6 -0
  63. package/dist/FormControl.cjs +84 -0
  64. package/dist/FormControl.d.cts +78 -0
  65. package/dist/FormControl.d.mts +78 -0
  66. package/dist/FormControl.mjs +81 -0
  67. package/dist/FormControlContext-CyxdOxdN.mjs +6 -0
  68. package/dist/FormControlContext-aeKTjRKY.cjs +10 -0
  69. package/dist/FormHelperText.cjs +40 -0
  70. package/dist/FormHelperText.d.cts +16 -0
  71. package/dist/FormHelperText.d.mts +16 -0
  72. package/dist/FormHelperText.mjs +39 -0
  73. package/dist/FormLabel.cjs +34 -0
  74. package/dist/FormLabel.d.cts +2 -0
  75. package/dist/FormLabel.d.mts +2 -0
  76. package/dist/FormLabel.mjs +33 -0
  77. package/dist/Grid.cjs +37 -0
  78. package/dist/Grid.d.cts +21 -0
  79. package/dist/Grid.d.mts +21 -0
  80. package/dist/Grid.mjs +32 -0
  81. package/dist/Icon-1YtNCUKo.cjs +755 -0
  82. package/dist/Icon-CAKRmFz3.mjs +742 -0
  83. package/dist/Icon.cjs +4 -0
  84. package/dist/Icon.d.cts +2 -0
  85. package/dist/Icon.d.mts +2 -0
  86. package/dist/Icon.mjs +2 -0
  87. package/dist/Image.cjs +82 -0
  88. package/dist/Image.d.cts +2 -0
  89. package/dist/Image.d.mts +2 -0
  90. package/dist/Image.mjs +80 -0
  91. package/dist/LinearProgress.cjs +217 -0
  92. package/dist/LinearProgress.d.cts +36 -0
  93. package/dist/LinearProgress.d.mts +36 -0
  94. package/dist/LinearProgress.mjs +214 -0
  95. package/dist/Link.cjs +64 -0
  96. package/dist/Link.d.cts +2 -0
  97. package/dist/Link.d.mts +2 -0
  98. package/dist/Link.mjs +62 -0
  99. package/dist/Markdown/Control.cjs +61 -0
  100. package/dist/Markdown/Control.d.cts +18 -0
  101. package/dist/Markdown/Control.d.mts +18 -0
  102. package/dist/Markdown/Control.mjs +60 -0
  103. package/dist/Markdown/Editor.cjs +130 -0
  104. package/dist/Markdown/Editor.d.cts +40 -0
  105. package/dist/Markdown/Editor.d.mts +40 -0
  106. package/dist/Markdown/Editor.mjs +128 -0
  107. package/dist/Markdown/Preview.cjs +241 -0
  108. package/dist/Markdown/Preview.d.cts +55 -0
  109. package/dist/Markdown/Preview.d.mts +55 -0
  110. package/dist/Markdown/Preview.mjs +236 -0
  111. package/dist/Markdown/Toolbar.cjs +4 -0
  112. package/dist/Markdown/Toolbar.d.cts +13 -0
  113. package/dist/Markdown/Toolbar.d.mts +13 -0
  114. package/dist/Markdown/Toolbar.mjs +2 -0
  115. package/dist/Markdown.cjs +13 -0
  116. package/dist/Markdown.d.cts +80 -0
  117. package/dist/Markdown.d.mts +80 -0
  118. package/dist/Markdown.mjs +6 -0
  119. package/dist/MarkdownContext-BN8A3W-J.mjs +11 -0
  120. package/dist/MarkdownContext-DSwjzpH8.cjs +22 -0
  121. package/dist/MenuItem.cjs +150 -0
  122. package/dist/MenuItem.d.cts +51 -0
  123. package/dist/MenuItem.d.mts +51 -0
  124. package/dist/MenuItem.mjs +147 -0
  125. package/dist/Modal-BDMPTSXv.cjs +351 -0
  126. package/dist/Modal-DR60peRg.mjs +327 -0
  127. package/dist/Modal.cjs +6 -0
  128. package/dist/Modal.d.cts +2 -0
  129. package/dist/Modal.d.mts +2 -0
  130. package/dist/Modal.mjs +2 -0
  131. package/dist/NativeSelect.cjs +189 -0
  132. package/dist/NativeSelect.d.cts +62 -0
  133. package/dist/NativeSelect.d.mts +62 -0
  134. package/dist/NativeSelect.mjs +186 -0
  135. package/dist/Pagination/PaginationItem.cjs +116 -0
  136. package/dist/Pagination/PaginationItem.d.cts +2 -0
  137. package/dist/Pagination/PaginationItem.d.mts +2 -0
  138. package/dist/Pagination/PaginationItem.mjs +114 -0
  139. package/dist/Pagination.cjs +134 -0
  140. package/dist/Pagination.d.cts +23 -0
  141. package/dist/Pagination.d.mts +23 -0
  142. package/dist/Pagination.mjs +130 -0
  143. package/dist/Paper.cjs +51 -0
  144. package/dist/Paper.d.cts +2 -0
  145. package/dist/Paper.d.mts +2 -0
  146. package/dist/Paper.mjs +48 -0
  147. package/dist/Popover-B61J7C79.mjs +252 -0
  148. package/dist/Popover-CRDLmywF.cjs +259 -0
  149. package/dist/Popover.cjs +3 -0
  150. package/dist/Popover.d.cts +84 -0
  151. package/dist/Popover.d.mts +84 -0
  152. package/dist/Popover.mjs +2 -0
  153. package/dist/Portal.cjs +20 -0
  154. package/dist/Portal.d.cts +18 -0
  155. package/dist/Portal.d.mts +18 -0
  156. package/dist/Portal.mjs +19 -0
  157. package/dist/Quote.cjs +11 -0
  158. package/dist/Quote.d.cts +2 -0
  159. package/dist/Quote.d.mts +2 -0
  160. package/dist/Quote.mjs +10 -0
  161. package/dist/Radio.cjs +143 -0
  162. package/dist/Radio.d.cts +38 -0
  163. package/dist/Radio.d.mts +38 -0
  164. package/dist/Radio.mjs +141 -0
  165. package/dist/Select.cjs +528 -0
  166. package/dist/Select.d.cts +68 -0
  167. package/dist/Select.d.mts +68 -0
  168. package/dist/Select.mjs +525 -0
  169. package/dist/Skeleton.cjs +82 -0
  170. package/dist/Skeleton.d.cts +21 -0
  171. package/dist/Skeleton.d.mts +21 -0
  172. package/dist/Skeleton.mjs +79 -0
  173. package/dist/Switch.cjs +332 -0
  174. package/dist/Switch.d.cts +40 -0
  175. package/dist/Switch.d.mts +40 -0
  176. package/dist/Switch.mjs +329 -0
  177. package/dist/Table/Table.cjs +65 -0
  178. package/dist/Table/Table.d.cts +2 -0
  179. package/dist/Table/Table.d.mts +2 -0
  180. package/dist/Table/Table.mjs +63 -0
  181. package/dist/Table/TableBody.cjs +42 -0
  182. package/dist/Table/TableBody.d.cts +2 -0
  183. package/dist/Table/TableBody.d.mts +2 -0
  184. package/dist/Table/TableBody.mjs +40 -0
  185. package/dist/Table/TableCell.cjs +93 -0
  186. package/dist/Table/TableCell.d.cts +2 -0
  187. package/dist/Table/TableCell.d.mts +2 -0
  188. package/dist/Table/TableCell.mjs +91 -0
  189. package/dist/Table/TableContainer.cjs +15 -0
  190. package/dist/Table/TableContainer.d.cts +2 -0
  191. package/dist/Table/TableContainer.d.mts +2 -0
  192. package/dist/Table/TableContainer.mjs +14 -0
  193. package/dist/Table/TableControl.cjs +42 -0
  194. package/dist/Table/TableControl.d.cts +2 -0
  195. package/dist/Table/TableControl.d.mts +2 -0
  196. package/dist/Table/TableControl.mjs +41 -0
  197. package/dist/Table/TableFooter.cjs +42 -0
  198. package/dist/Table/TableFooter.d.cts +2 -0
  199. package/dist/Table/TableFooter.d.mts +2 -0
  200. package/dist/Table/TableFooter.mjs +40 -0
  201. package/dist/Table/TableHead.cjs +42 -0
  202. package/dist/Table/TableHead.d.cts +2 -0
  203. package/dist/Table/TableHead.d.mts +2 -0
  204. package/dist/Table/TableHead.mjs +40 -0
  205. package/dist/Table/TablePagination.cjs +89 -0
  206. package/dist/Table/TablePagination.d.cts +2 -0
  207. package/dist/Table/TablePagination.d.mts +2 -0
  208. package/dist/Table/TablePagination.mjs +88 -0
  209. package/dist/Table/TablePaginationActions.cjs +65 -0
  210. package/dist/Table/TablePaginationActions.d.cts +2 -0
  211. package/dist/Table/TablePaginationActions.d.mts +2 -0
  212. package/dist/Table/TablePaginationActions.mjs +63 -0
  213. package/dist/Table/TableRow.cjs +56 -0
  214. package/dist/Table/TableRow.d.cts +2 -0
  215. package/dist/Table/TableRow.d.mts +2 -0
  216. package/dist/Table/TableRow.mjs +54 -0
  217. package/dist/Table/TableSortLabel.cjs +62 -0
  218. package/dist/Table/TableSortLabel.d.cts +2 -0
  219. package/dist/Table/TableSortLabel.d.mts +2 -0
  220. package/dist/Table/TableSortLabel.mjs +60 -0
  221. package/dist/Table/hooks.cjs +112 -0
  222. package/dist/Table/hooks.d.cts +3 -0
  223. package/dist/Table/hooks.d.mts +3 -0
  224. package/dist/Table/hooks.mjs +109 -0
  225. package/dist/Table.cjs +31 -0
  226. package/dist/Table.d.cts +16 -0
  227. package/dist/Table.d.mts +16 -0
  228. package/dist/Table.mjs +15 -0
  229. package/dist/TableContext-2qH7XYJB.d.cts +19 -0
  230. package/dist/TableContext-2qH7XYJB.d.mts +19 -0
  231. package/dist/TableContext-BRWPghAI.mjs +6 -0
  232. package/dist/TableContext-qqp35o8z.cjs +10 -0
  233. package/dist/TableSectionContext-meIG4lFZ.mjs +5 -0
  234. package/dist/TableSectionContext-pYlJ-duI.cjs +9 -0
  235. package/dist/TextInput-6o37Zddp.cjs +231 -0
  236. package/dist/TextInput-D_lHYJlL.mjs +224 -0
  237. package/dist/TextInput.cjs +3 -0
  238. package/dist/TextInput.d.cts +2 -0
  239. package/dist/TextInput.d.mts +2 -0
  240. package/dist/TextInput.mjs +2 -0
  241. package/dist/ThemeProvider.cjs +15 -0
  242. package/dist/ThemeProvider.d.cts +20 -0
  243. package/dist/ThemeProvider.d.mts +20 -0
  244. package/dist/ThemeProvider.mjs +14 -0
  245. package/dist/ToggleButton/ToggleButton.cjs +58 -0
  246. package/dist/ToggleButton/ToggleButton.d.cts +14 -0
  247. package/dist/ToggleButton/ToggleButton.d.mts +14 -0
  248. package/dist/ToggleButton/ToggleButton.mjs +56 -0
  249. package/dist/ToggleButton/ToggleButtonGroup.cjs +54 -0
  250. package/dist/ToggleButton/ToggleButtonGroup.d.cts +23 -0
  251. package/dist/ToggleButton/ToggleButtonGroup.d.mts +23 -0
  252. package/dist/ToggleButton/ToggleButtonGroup.mjs +52 -0
  253. package/dist/ToggleButton.cjs +7 -0
  254. package/dist/ToggleButton.d.cts +4 -0
  255. package/dist/ToggleButton.d.mts +4 -0
  256. package/dist/ToggleButton.mjs +4 -0
  257. package/dist/ToggleButtonGroupContext-CqD-Afho.d.cts +15 -0
  258. package/dist/ToggleButtonGroupContext-CqD-Afho.d.mts +15 -0
  259. package/dist/ToggleButtonGroupContext-DxIyy8ze.mjs +5 -0
  260. package/dist/ToggleButtonGroupContext-Ewc5Ixas.cjs +9 -0
  261. package/dist/Toolbar-B-W22Sk4.cjs +459 -0
  262. package/dist/Toolbar-KbR97iJS.mjs +448 -0
  263. package/dist/Typography.cjs +64 -0
  264. package/dist/Typography.d.cts +3 -0
  265. package/dist/Typography.d.mts +3 -0
  266. package/dist/Typography.mjs +61 -0
  267. package/dist/View.cjs +40 -0
  268. package/dist/View.d.cts +2 -0
  269. package/dist/View.d.mts +2 -0
  270. package/dist/View.mjs +38 -0
  271. package/dist/applyAction-B2B-hnP3.mjs +98 -0
  272. package/dist/applyAction-B2uVHxOE.cjs +103 -0
  273. package/dist/createTheme-Dts2F4R_.d.cts +21 -0
  274. package/dist/createTheme-Dts2F4R_.d.mts +21 -0
  275. package/dist/hooks/useCopyToClipboard.cjs +33 -0
  276. package/dist/hooks/useCopyToClipboard.d.cts +16 -0
  277. package/dist/hooks/useCopyToClipboard.d.mts +16 -0
  278. package/dist/hooks/useCopyToClipboard.mjs +31 -0
  279. package/dist/hooks.cjs +52 -0
  280. package/dist/hooks.d.cts +40 -0
  281. package/dist/hooks.d.mts +40 -0
  282. package/dist/hooks.mjs +41 -0
  283. package/dist/index-4rC2j7fR.d.cts +46 -0
  284. package/dist/index-8dzWTpFp.d.cts +24 -0
  285. package/dist/index-B1rCD6Oo.d.cts +17 -0
  286. package/dist/index-BH8jQOdF.d.mts +46 -0
  287. package/dist/index-BLRMuO_x.d.mts +24 -0
  288. package/dist/index-BLfFycfJ.d.mts +72 -0
  289. package/dist/index-BPrjvi7B.d.cts +13 -0
  290. package/dist/index-BX5-NfbX.d.cts +94 -0
  291. package/dist/index-Bihpwn75.d.cts +64 -0
  292. package/dist/index-BlfIbAMs.d.cts +45 -0
  293. package/dist/index-BnzUumAC2.d.mts +30 -0
  294. package/dist/index-BoqlPb3Z.d.mts +13 -0
  295. package/dist/index-BqVgv2B_.d.mts +42 -0
  296. package/dist/index-Bwi4kRpf.d.mts +79 -0
  297. package/dist/index-Bx24ZnOV.d.mts +43 -0
  298. package/dist/index-C-P_hipv.d.mts +21 -0
  299. package/dist/index-C0xMvDjL.d.mts +49 -0
  300. package/dist/index-C5_ciaeo.d.cts +79 -0
  301. package/dist/index-CDVnvjIE.d.cts +27 -0
  302. package/dist/index-CDcGTGR4.d.cts +21 -0
  303. package/dist/index-CEOZI-6L.d.mts +48 -0
  304. package/dist/index-CLU39rUS2.d.mts +30 -0
  305. package/dist/index-CM_KCTee.d.cts +48 -0
  306. package/dist/index-CT9uGKrs.d.cts +30 -0
  307. package/dist/index-CcYSvIJi.d.cts +21 -0
  308. package/dist/index-CdF_4ckE.d.mts +11 -0
  309. package/dist/index-CeYkEXU2.d.cts +68 -0
  310. package/dist/index-Cl_yBpzW2.d.mts +13 -0
  311. package/dist/index-Cv_UOfYx.d.mts +18 -0
  312. package/dist/index-CxSNNzBT2.d.mts +68 -0
  313. package/dist/index-CyZYXDn0.d.cts +42 -0
  314. package/dist/index-DASvoACZ.d.cts +49 -0
  315. package/dist/index-DBGE6yKw.d.mts +16 -0
  316. package/dist/index-DCQ2fsDu.d.mts +40 -0
  317. package/dist/index-DD2AVtiR.d.cts +16 -0
  318. package/dist/index-DE5PtzPn.d.mts +27 -0
  319. package/dist/index-DOPXpr2J.d.cts +43 -0
  320. package/dist/index-DSCMXFTn.d.cts +30 -0
  321. package/dist/index-DTkQSXQD.d.cts +11 -0
  322. package/dist/index-DeJWkpf9.d.cts +16 -0
  323. package/dist/index-DeiZHSwA.d.cts +12 -0
  324. package/dist/index-Des8BisQ.d.mts +12 -0
  325. package/dist/index-Dg8-CPOO.d.cts +18 -0
  326. package/dist/index-DgRS5Aqv.d.mts +16 -0
  327. package/dist/index-Dm9HfgV6.d.mts +63 -0
  328. package/dist/index-DmJIuQJj.d.mts +24 -0
  329. package/dist/index-Dp81rWM1.d.cts +72 -0
  330. package/dist/index-Dtzj8X58.d.cts +40 -0
  331. package/dist/index-DvW2eETV.d.mts +21 -0
  332. package/dist/index-Dy03o__A.d.mts +94 -0
  333. package/dist/index-FwTocqhP.d.cts +34 -0
  334. package/dist/index-GVsFY00r.d.cts +21 -0
  335. package/dist/index-Nqco3fsM.d.cts +13 -0
  336. package/dist/index-g-9DZ_KQ.d.cts +28 -0
  337. package/dist/index-g9EThkSg.d.mts +21 -0
  338. package/dist/index-kpk9e3xM2.d.mts +45 -0
  339. package/dist/index-pX7tBQdJ.d.mts +34 -0
  340. package/dist/index-u57CbuAU2.d.mts +28 -0
  341. package/dist/index-x80UG39F.d.cts +24 -0
  342. package/dist/index-z35LEYG8.d.mts +17 -0
  343. package/dist/index.cjs +68 -0
  344. package/dist/index.d.cts +4 -0
  345. package/dist/index.d.mts +4 -0
  346. package/dist/index.mjs +3 -0
  347. package/dist/inputVariantStyles-BBkkYQtE.cjs +32 -0
  348. package/dist/inputVariantStyles-CcqpGfuP.mjs +28 -0
  349. package/dist/rolldown-runtime-BBjsoOtd.mjs +27 -0
  350. package/dist/rolldown-runtime-DDXJien1.cjs +50 -0
  351. package/dist/src-BiocWFSR.cjs +60 -0
  352. package/dist/src-DcNT2aIK.mjs +49 -0
  353. package/dist/themeDefault-B-QjpGEO.cjs +16 -0
  354. package/dist/themeDefault-CjXaY3ok.mjs +11 -0
  355. package/dist/themes-D1SAp3SL.d.mts +500 -0
  356. package/dist/themes-D81JYbqm.d.cts +500 -0
  357. package/dist/themes.cjs +318 -0
  358. package/dist/themes.d.cts +3 -0
  359. package/dist/themes.d.mts +3 -0
  360. package/dist/themes.mjs +303 -0
  361. package/dist/useDefaultProps-Cb-5FNok.cjs +19 -0
  362. package/dist/useDefaultProps-CoApb4KT.mjs +14 -0
  363. package/dist/useTableSort--XMWjujs.d.cts +51 -0
  364. package/dist/useTableSort-CpDs4cGq.d.mts +51 -0
  365. package/dist/utils/styleCache.cjs +7 -0
  366. package/dist/utils/styleCache.d.cts +3 -0
  367. package/dist/utils/styleCache.d.mts +4 -0
  368. package/dist/utils/styleCache.mjs +5 -0
  369. package/dist/utils.cjs +65 -0
  370. package/dist/utils.d.cts +39 -0
  371. package/dist/utils.d.mts +39 -0
  372. package/dist/utils.mjs +58 -0
  373. package/package.json +125 -0
@@ -0,0 +1,63 @@
1
+ import { d as styled, u as useTheme } from "../src-DcNT2aIK.mjs";
2
+ import { t as themeDefault } from "../themeDefault-CjXaY3ok.mjs";
3
+ import { PaginationItem } from "../Pagination/PaginationItem.mjs";
4
+ import "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/Table/TablePaginationActions/TablePaginationActions.tsx
7
+ const ActionsRoot = styled("div", {
8
+ name: "TablePaginationActions",
9
+ label: "TablePaginationActions"
10
+ })({
11
+ display: "inline-flex",
12
+ alignItems: "center",
13
+ gap: "0.25rem",
14
+ flexShrink: 0
15
+ });
16
+ /**
17
+ * The first / previous / next / last button cluster inside `TablePagination`.
18
+ * Composes `PaginationItem`'s nav types; boundary state is derived from
19
+ * `count` / `page` / `rowsPerPage`.
20
+ */
21
+ function TablePaginationActions({ count, page, rowsPerPage, onPageChange, getItemAriaLabel, disabled = false, shouldShowFirstButton = false, shouldShowLastButton = false, size: sizeProp, ...rest }) {
22
+ const theme = useTheme();
23
+ const size = sizeProp ?? themeDefault(theme, "compactSize", "sm");
24
+ const lastPage = rowsPerPage === -1 ? 0 : Math.max(0, Math.ceil(count / rowsPerPage) - 1);
25
+ const isBackwardDisabled = disabled || page <= 0;
26
+ const isNextDisabled = disabled || count !== -1 && page >= lastPage;
27
+ const isLastDisabled = disabled || count === -1 || page >= lastPage;
28
+ return /* @__PURE__ */ jsxs(ActionsRoot, {
29
+ ...rest,
30
+ children: [
31
+ shouldShowFirstButton && /* @__PURE__ */ jsx(PaginationItem, {
32
+ type: "first",
33
+ size,
34
+ disabled: isBackwardDisabled,
35
+ onClick: () => onPageChange(0),
36
+ "aria-label": getItemAriaLabel("first")
37
+ }),
38
+ /* @__PURE__ */ jsx(PaginationItem, {
39
+ type: "previous",
40
+ size,
41
+ disabled: isBackwardDisabled,
42
+ onClick: () => onPageChange(page - 1),
43
+ "aria-label": getItemAriaLabel("previous")
44
+ }),
45
+ /* @__PURE__ */ jsx(PaginationItem, {
46
+ type: "next",
47
+ size,
48
+ disabled: isNextDisabled,
49
+ onClick: () => onPageChange(page + 1),
50
+ "aria-label": getItemAriaLabel("next")
51
+ }),
52
+ shouldShowLastButton && /* @__PURE__ */ jsx(PaginationItem, {
53
+ type: "last",
54
+ size,
55
+ disabled: isLastDisabled,
56
+ onClick: () => onPageChange(lastPage),
57
+ "aria-label": getItemAriaLabel("last")
58
+ })
59
+ ]
60
+ });
61
+ }
62
+ //#endregion
63
+ export { TablePaginationActions };
@@ -0,0 +1,56 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_src = require("../src-BiocWFSR.cjs");
3
+ const require_themeDefault = require("../themeDefault-B-QjpGEO.cjs");
4
+ const require_TableContext = require("../TableContext-qqp35o8z.cjs");
5
+ let react = require("react");
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/Table/TableRow/TableRow.tsx
9
+ const shouldForwardProp = (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)([
10
+ ..._soroush_tech_styled_system_should_forward_prop.props,
11
+ "isHoverable",
12
+ "isSelected"
13
+ ]);
14
+ const colorSystem = (0, require_src.src_exports.system)({
15
+ bg: {
16
+ property: "backgroundColor",
17
+ scale: "background"
18
+ },
19
+ borderColor: {
20
+ property: "borderColor",
21
+ scale: "border"
22
+ }
23
+ });
24
+ const hoverStyle = ({ isHoverable, color, theme }) => {
25
+ const c = theme.palette[color ?? require_themeDefault.themeDefault(theme, "color", "primary")];
26
+ return isHoverable ? { "&:hover": {
27
+ backgroundColor: c.light,
28
+ color: c.contrastText
29
+ } } : {};
30
+ };
31
+ const selectedStyle = ({ isSelected, color, theme }) => {
32
+ const c = theme.palette[color ?? require_themeDefault.themeDefault(theme, "color", "primary")];
33
+ return isSelected ? {
34
+ backgroundColor: c.dark,
35
+ color: c.contrastText
36
+ } : {};
37
+ };
38
+ const TableRowBase = require_src.styled("tr", {
39
+ name: "TableRow",
40
+ label: "TableRow",
41
+ shouldForwardProp,
42
+ systemProps: [
43
+ require_src.src_exports.space,
44
+ colorSystem,
45
+ require_src.src_exports.border
46
+ ]
47
+ })(selectedStyle, hoverStyle);
48
+ function TableRow({ color, ...rest }) {
49
+ const table = (0, react.useContext)(require_TableContext.TableContext);
50
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableRowBase, {
51
+ color: color ?? table.color,
52
+ ...rest
53
+ });
54
+ }
55
+ //#endregion
56
+ exports.TableRow = TableRow;
@@ -0,0 +1,2 @@
1
+ import { a as TableRowProps, i as TableRowColor, n as TableRowBackgroundToken, r as TableRowBorderColorToken, t as TableRow } from "../index-CT9uGKrs.cjs";
2
+ export { TableRow, TableRowBackgroundToken, TableRowBorderColorToken, TableRowColor, TableRowProps };
@@ -0,0 +1,2 @@
1
+ import { a as TableRowProps, i as TableRowColor, n as TableRowBackgroundToken, r as TableRowBorderColorToken, t as TableRow } from "../index-CLU39rUS2.mjs";
2
+ export { TableRow, TableRowBackgroundToken, TableRowBorderColorToken, TableRowColor, TableRowProps };
@@ -0,0 +1,54 @@
1
+ import { a as createShouldForwardProp, c as props, d as styled, l as src_exports } from "../src-DcNT2aIK.mjs";
2
+ import { t as themeDefault } from "../themeDefault-CjXaY3ok.mjs";
3
+ import { t as TableContext } from "../TableContext-BRWPghAI.mjs";
4
+ import { useContext } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/Table/TableRow/TableRow.tsx
7
+ const shouldForwardProp = createShouldForwardProp([
8
+ ...props,
9
+ "isHoverable",
10
+ "isSelected"
11
+ ]);
12
+ const colorSystem = (0, src_exports.system)({
13
+ bg: {
14
+ property: "backgroundColor",
15
+ scale: "background"
16
+ },
17
+ borderColor: {
18
+ property: "borderColor",
19
+ scale: "border"
20
+ }
21
+ });
22
+ const hoverStyle = ({ isHoverable, color, theme }) => {
23
+ const c = theme.palette[color ?? themeDefault(theme, "color", "primary")];
24
+ return isHoverable ? { "&:hover": {
25
+ backgroundColor: c.light,
26
+ color: c.contrastText
27
+ } } : {};
28
+ };
29
+ const selectedStyle = ({ isSelected, color, theme }) => {
30
+ const c = theme.palette[color ?? themeDefault(theme, "color", "primary")];
31
+ return isSelected ? {
32
+ backgroundColor: c.dark,
33
+ color: c.contrastText
34
+ } : {};
35
+ };
36
+ const TableRowBase = styled("tr", {
37
+ name: "TableRow",
38
+ label: "TableRow",
39
+ shouldForwardProp,
40
+ systemProps: [
41
+ src_exports.space,
42
+ colorSystem,
43
+ src_exports.border
44
+ ]
45
+ })(selectedStyle, hoverStyle);
46
+ function TableRow({ color, ...rest }) {
47
+ const table = useContext(TableContext);
48
+ return /* @__PURE__ */ jsx(TableRowBase, {
49
+ color: color ?? table.color,
50
+ ...rest
51
+ });
52
+ }
53
+ //#endregion
54
+ export { TableRow };
@@ -0,0 +1,62 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_src = require("../src-BiocWFSR.cjs");
3
+ const require_Icon = require("../Icon-1YtNCUKo.cjs");
4
+ const require_TableContext = require("../TableContext-qqp35o8z.cjs");
5
+ let react = require("react");
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/Table/TableSortLabel/TableSortLabel.tsx
9
+ const SortLabelRoot = require_src.styled("button", {
10
+ name: "TableSortLabel",
11
+ label: "TableSortLabel",
12
+ shouldForwardProp: (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)([
13
+ ..._soroush_tech_styled_system_should_forward_prop.props,
14
+ "isActive",
15
+ "shouldHideSortIcon"
16
+ ]),
17
+ systemProps: [require_src.src_exports.space]
18
+ })({
19
+ display: "inline-flex",
20
+ alignItems: "center",
21
+ gap: "0.25rem",
22
+ padding: 0,
23
+ border: "none",
24
+ background: "transparent",
25
+ cursor: "pointer",
26
+ color: "inherit",
27
+ font: "inherit"
28
+ }, ({ theme }) => ({ "&:focus-visible": {
29
+ outline: `2px solid ${(0, require_src.src_exports.get)(theme, "palette.primary.main")}`,
30
+ outlineOffset: "2px"
31
+ } }), ({ isActive, shouldHideSortIcon }) => !isActive && shouldHideSortIcon ? { "&:hover .sort-icon, &:focus-visible .sort-icon": { opacity: .5 } } : {});
32
+ const shouldForwardIconProp = (prop) => prop !== "isDescending" && prop !== "isActive" && prop !== "shouldHideSortIcon";
33
+ const SortIcon = require_src.styled(require_Icon.Icon, {
34
+ name: "TableSortLabel",
35
+ slot: "icon",
36
+ label: "TableSortLabelIcon",
37
+ shouldForwardProp: shouldForwardIconProp
38
+ })({ transition: "transform 0.2s ease, opacity 0.2s ease" }, ({ isDescending }) => ({ transform: isDescending ? "rotate(180deg)" : "none" }), ({ isActive, shouldHideSortIcon }) => {
39
+ return { opacity: isActive ? 1 : shouldHideSortIcon ? 0 : .5 };
40
+ });
41
+ function TableSortLabel({ isActive = false, direction = "asc", shouldHideSortIcon, iconName = "arrow_upward", iconProps, type = "button", children, ...rest }) {
42
+ const table = (0, react.useContext)(require_TableContext.TableContext);
43
+ const resolvedHideSortIcon = shouldHideSortIcon ?? table.shouldHideSortIcon ?? true;
44
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SortLabelRoot, {
45
+ isActive,
46
+ shouldHideSortIcon: resolvedHideSortIcon,
47
+ type,
48
+ ...rest,
49
+ children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SortIcon, {
50
+ name: iconName,
51
+ size: "1em",
52
+ color: "inherit",
53
+ isDescending: direction === "desc",
54
+ isActive,
55
+ shouldHideSortIcon: resolvedHideSortIcon,
56
+ ...iconProps,
57
+ className: "sort-icon"
58
+ })]
59
+ });
60
+ }
61
+ //#endregion
62
+ exports.TableSortLabel = TableSortLabel;
@@ -0,0 +1,2 @@
1
+ import { n as TableSortLabelDirection, r as TableSortLabelProps, t as TableSortLabel } from "../index-8dzWTpFp.cjs";
2
+ export { TableSortLabel, TableSortLabelDirection, TableSortLabelProps };
@@ -0,0 +1,2 @@
1
+ import { n as TableSortLabelDirection, r as TableSortLabelProps, t as TableSortLabel } from "../index-DmJIuQJj.mjs";
2
+ export { TableSortLabel, TableSortLabelDirection, TableSortLabelProps };
@@ -0,0 +1,60 @@
1
+ import { a as createShouldForwardProp, c as props, d as styled, l as src_exports } from "../src-DcNT2aIK.mjs";
2
+ import { t as Icon } from "../Icon-CAKRmFz3.mjs";
3
+ import { t as TableContext } from "../TableContext-BRWPghAI.mjs";
4
+ import { useContext } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/Table/TableSortLabel/TableSortLabel.tsx
7
+ const SortLabelRoot = styled("button", {
8
+ name: "TableSortLabel",
9
+ label: "TableSortLabel",
10
+ shouldForwardProp: createShouldForwardProp([
11
+ ...props,
12
+ "isActive",
13
+ "shouldHideSortIcon"
14
+ ]),
15
+ systemProps: [src_exports.space]
16
+ })({
17
+ display: "inline-flex",
18
+ alignItems: "center",
19
+ gap: "0.25rem",
20
+ padding: 0,
21
+ border: "none",
22
+ background: "transparent",
23
+ cursor: "pointer",
24
+ color: "inherit",
25
+ font: "inherit"
26
+ }, ({ theme }) => ({ "&:focus-visible": {
27
+ outline: `2px solid ${(0, src_exports.get)(theme, "palette.primary.main")}`,
28
+ outlineOffset: "2px"
29
+ } }), ({ isActive, shouldHideSortIcon }) => !isActive && shouldHideSortIcon ? { "&:hover .sort-icon, &:focus-visible .sort-icon": { opacity: .5 } } : {});
30
+ const shouldForwardIconProp = (prop) => prop !== "isDescending" && prop !== "isActive" && prop !== "shouldHideSortIcon";
31
+ const SortIcon = styled(Icon, {
32
+ name: "TableSortLabel",
33
+ slot: "icon",
34
+ label: "TableSortLabelIcon",
35
+ shouldForwardProp: shouldForwardIconProp
36
+ })({ transition: "transform 0.2s ease, opacity 0.2s ease" }, ({ isDescending }) => ({ transform: isDescending ? "rotate(180deg)" : "none" }), ({ isActive, shouldHideSortIcon }) => {
37
+ return { opacity: isActive ? 1 : shouldHideSortIcon ? 0 : .5 };
38
+ });
39
+ function TableSortLabel({ isActive = false, direction = "asc", shouldHideSortIcon, iconName = "arrow_upward", iconProps, type = "button", children, ...rest }) {
40
+ const table = useContext(TableContext);
41
+ const resolvedHideSortIcon = shouldHideSortIcon ?? table.shouldHideSortIcon ?? true;
42
+ return /* @__PURE__ */ jsxs(SortLabelRoot, {
43
+ isActive,
44
+ shouldHideSortIcon: resolvedHideSortIcon,
45
+ type,
46
+ ...rest,
47
+ children: [children, /* @__PURE__ */ jsx(SortIcon, {
48
+ name: iconName,
49
+ size: "1em",
50
+ color: "inherit",
51
+ isDescending: direction === "desc",
52
+ isActive,
53
+ shouldHideSortIcon: resolvedHideSortIcon,
54
+ ...iconProps,
55
+ className: "sort-icon"
56
+ })]
57
+ });
58
+ }
59
+ //#endregion
60
+ export { TableSortLabel };
@@ -0,0 +1,112 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let react = require("react");
3
+ //#region src/Table/hooks/useTablePagination.ts
4
+ /**
5
+ * Pagination state for tables.
6
+ *
7
+ * ```tsx
8
+ * const pagination = useTablePagination({ defaultRowsPerPage: 10 })
9
+ * <TablePagination count={data.length} {...pagination} />
10
+ * <TableControl data={data} pagination={pagination}>{(row) => …}</TableControl>
11
+ * ```
12
+ */
13
+ function useTablePagination({ defaultPage = 0, defaultRowsPerPage = 10 } = {}) {
14
+ const [page, setPage] = (0, react.useState)(defaultPage);
15
+ const [rowsPerPage, setRowsPerPage] = (0, react.useState)(defaultRowsPerPage);
16
+ return {
17
+ page,
18
+ rowsPerPage,
19
+ onPageChange: (0, react.useCallback)((nextPage) => setPage(nextPage), []),
20
+ onRowsPerPageChange: (0, react.useCallback)((nextRowsPerPage) => {
21
+ setRowsPerPage(nextRowsPerPage);
22
+ setPage(0);
23
+ }, [])
24
+ };
25
+ }
26
+ //#endregion
27
+ //#region src/Table/hooks/useTableSelection.ts
28
+ const toggleKey = (selected, selectedSet, key) => selectedSet.has(key) ? selected.filter((item) => item !== key) : [...selected, key];
29
+ /**
30
+ * Key-based row selection that survives paging and re-sorting — selection is
31
+ * stored as row identities, and the select-all/indeterminate state is computed
32
+ * against the full `keys` list rather than the visible slice.
33
+ *
34
+ * ```tsx
35
+ * const selection = useTableSelection(services.map((s) => s.service))
36
+ * <Checkbox {...selection.all} aria-label="Select all" />
37
+ * <Checkbox {...selection.row(row.service)} aria-label={`Select ${row.service}`} />
38
+ * <TableRow isSelected={selection.isSelected(row.service)}>…</TableRow>
39
+ * ```
40
+ */
41
+ function useTableSelection(keys, onChange) {
42
+ const [selected, setSelected] = (0, react.useState)([]);
43
+ return (0, react.useMemo)(() => {
44
+ const selectedSet = new Set(selected);
45
+ const isAllSelected = keys.length > 0 && keys.every((key) => selectedSet.has(key));
46
+ const isSomeSelected = !isAllSelected && keys.some((key) => selectedSet.has(key));
47
+ const update = (next) => {
48
+ setSelected(next);
49
+ onChange?.(next);
50
+ };
51
+ return {
52
+ selected,
53
+ isSelected: (key) => selectedSet.has(key),
54
+ all: {
55
+ checked: isAllSelected,
56
+ indeterminate: isSomeSelected,
57
+ onChange: () => update(isAllSelected ? [] : [...keys])
58
+ },
59
+ row: (key) => ({
60
+ checked: selectedSet.has(key),
61
+ onChange: () => update(toggleKey(selected, selectedSet, key))
62
+ }),
63
+ clear: () => update([])
64
+ };
65
+ }, [
66
+ selected,
67
+ JSON.stringify(keys),
68
+ onChange
69
+ ]);
70
+ }
71
+ //#endregion
72
+ //#region src/Table/hooks/useTableSort.ts
73
+ /**
74
+ * Column-keyed sort state for sortable tables. Each column remembers its own
75
+ * direction (initially `'asc'`); clicking a column activates it AND flips its
76
+ * stored direction — so the first click on a column sorts `'desc'`.
77
+ * `keys` is read once on mount.
78
+ *
79
+ * ```tsx
80
+ * const sort = useTableSort(['name', 'latency'])
81
+ * <TableSortLabel {...sort.name}>Service</TableSortLabel>
82
+ * <TableControl data={rows} sort={sort}>{(row) => …}</TableControl>
83
+ * ```
84
+ */
85
+ function useTableSort(keys, onChange) {
86
+ const [activeKey, setActiveKey] = (0, react.useState)(null);
87
+ const [directions, setDirections] = (0, react.useState)(() => Object.fromEntries(keys.map((key) => [key, "asc"])));
88
+ return (0, react.useMemo)(() => {
89
+ const entries = Object.keys(directions).map((key) => [key, {
90
+ isActive: activeKey === key,
91
+ direction: directions[key],
92
+ onClick: () => {
93
+ const direction = directions[key] === "asc" ? "desc" : "asc";
94
+ setActiveKey(key);
95
+ setDirections({
96
+ ...directions,
97
+ [key]: direction
98
+ });
99
+ onChange?.(key, direction);
100
+ }
101
+ }]);
102
+ return Object.fromEntries(entries);
103
+ }, [
104
+ activeKey,
105
+ directions,
106
+ onChange
107
+ ]);
108
+ }
109
+ //#endregion
110
+ exports.useTablePagination = useTablePagination;
111
+ exports.useTableSelection = useTableSelection;
112
+ exports.useTableSort = useTableSort;
@@ -0,0 +1,3 @@
1
+ import { a as UseTablePaginationOptions, i as TablePaginationState, n as TableSortMap, o as useTablePagination, r as useTableSort, t as TableSortEntry } from "../useTableSort--XMWjujs.cjs";
2
+ import { i as useTableSelection, n as TableSelectionAllProps, r as TableSelectionRowProps, t as TableSelection } from "../index-Dtzj8X58.cjs";
3
+ export { TablePaginationState, TableSelection, TableSelectionAllProps, TableSelectionRowProps, TableSortEntry, TableSortMap, UseTablePaginationOptions, useTablePagination, useTableSelection, useTableSort };
@@ -0,0 +1,3 @@
1
+ import { a as UseTablePaginationOptions, i as TablePaginationState, n as TableSortMap, o as useTablePagination, r as useTableSort, t as TableSortEntry } from "../useTableSort-CpDs4cGq.mjs";
2
+ import { i as useTableSelection, n as TableSelectionAllProps, r as TableSelectionRowProps, t as TableSelection } from "../index-DCQ2fsDu.mjs";
3
+ export { TablePaginationState, TableSelection, TableSelectionAllProps, TableSelectionRowProps, TableSortEntry, TableSortMap, UseTablePaginationOptions, useTablePagination, useTableSelection, useTableSort };
@@ -0,0 +1,109 @@
1
+ import { useCallback, useMemo, useState } from "react";
2
+ //#region src/Table/hooks/useTablePagination.ts
3
+ /**
4
+ * Pagination state for tables.
5
+ *
6
+ * ```tsx
7
+ * const pagination = useTablePagination({ defaultRowsPerPage: 10 })
8
+ * <TablePagination count={data.length} {...pagination} />
9
+ * <TableControl data={data} pagination={pagination}>{(row) => …}</TableControl>
10
+ * ```
11
+ */
12
+ function useTablePagination({ defaultPage = 0, defaultRowsPerPage = 10 } = {}) {
13
+ const [page, setPage] = useState(defaultPage);
14
+ const [rowsPerPage, setRowsPerPage] = useState(defaultRowsPerPage);
15
+ return {
16
+ page,
17
+ rowsPerPage,
18
+ onPageChange: useCallback((nextPage) => setPage(nextPage), []),
19
+ onRowsPerPageChange: useCallback((nextRowsPerPage) => {
20
+ setRowsPerPage(nextRowsPerPage);
21
+ setPage(0);
22
+ }, [])
23
+ };
24
+ }
25
+ //#endregion
26
+ //#region src/Table/hooks/useTableSelection.ts
27
+ const toggleKey = (selected, selectedSet, key) => selectedSet.has(key) ? selected.filter((item) => item !== key) : [...selected, key];
28
+ /**
29
+ * Key-based row selection that survives paging and re-sorting — selection is
30
+ * stored as row identities, and the select-all/indeterminate state is computed
31
+ * against the full `keys` list rather than the visible slice.
32
+ *
33
+ * ```tsx
34
+ * const selection = useTableSelection(services.map((s) => s.service))
35
+ * <Checkbox {...selection.all} aria-label="Select all" />
36
+ * <Checkbox {...selection.row(row.service)} aria-label={`Select ${row.service}`} />
37
+ * <TableRow isSelected={selection.isSelected(row.service)}>…</TableRow>
38
+ * ```
39
+ */
40
+ function useTableSelection(keys, onChange) {
41
+ const [selected, setSelected] = useState([]);
42
+ return useMemo(() => {
43
+ const selectedSet = new Set(selected);
44
+ const isAllSelected = keys.length > 0 && keys.every((key) => selectedSet.has(key));
45
+ const isSomeSelected = !isAllSelected && keys.some((key) => selectedSet.has(key));
46
+ const update = (next) => {
47
+ setSelected(next);
48
+ onChange?.(next);
49
+ };
50
+ return {
51
+ selected,
52
+ isSelected: (key) => selectedSet.has(key),
53
+ all: {
54
+ checked: isAllSelected,
55
+ indeterminate: isSomeSelected,
56
+ onChange: () => update(isAllSelected ? [] : [...keys])
57
+ },
58
+ row: (key) => ({
59
+ checked: selectedSet.has(key),
60
+ onChange: () => update(toggleKey(selected, selectedSet, key))
61
+ }),
62
+ clear: () => update([])
63
+ };
64
+ }, [
65
+ selected,
66
+ JSON.stringify(keys),
67
+ onChange
68
+ ]);
69
+ }
70
+ //#endregion
71
+ //#region src/Table/hooks/useTableSort.ts
72
+ /**
73
+ * Column-keyed sort state for sortable tables. Each column remembers its own
74
+ * direction (initially `'asc'`); clicking a column activates it AND flips its
75
+ * stored direction — so the first click on a column sorts `'desc'`.
76
+ * `keys` is read once on mount.
77
+ *
78
+ * ```tsx
79
+ * const sort = useTableSort(['name', 'latency'])
80
+ * <TableSortLabel {...sort.name}>Service</TableSortLabel>
81
+ * <TableControl data={rows} sort={sort}>{(row) => …}</TableControl>
82
+ * ```
83
+ */
84
+ function useTableSort(keys, onChange) {
85
+ const [activeKey, setActiveKey] = useState(null);
86
+ const [directions, setDirections] = useState(() => Object.fromEntries(keys.map((key) => [key, "asc"])));
87
+ return useMemo(() => {
88
+ const entries = Object.keys(directions).map((key) => [key, {
89
+ isActive: activeKey === key,
90
+ direction: directions[key],
91
+ onClick: () => {
92
+ const direction = directions[key] === "asc" ? "desc" : "asc";
93
+ setActiveKey(key);
94
+ setDirections({
95
+ ...directions,
96
+ [key]: direction
97
+ });
98
+ onChange?.(key, direction);
99
+ }
100
+ }]);
101
+ return Object.fromEntries(entries);
102
+ }, [
103
+ activeKey,
104
+ directions,
105
+ onChange
106
+ ]);
107
+ }
108
+ //#endregion
109
+ export { useTablePagination, useTableSelection, useTableSort };
package/dist/Table.cjs ADDED
@@ -0,0 +1,31 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_TableContext = require("./TableContext-qqp35o8z.cjs");
3
+ const require_Table_TableSortLabel = require("./Table/TableSortLabel.cjs");
4
+ const require_Table_hooks = require("./Table/hooks.cjs");
5
+ const require_Table_Table = require("./Table/Table.cjs");
6
+ const require_TableSectionContext = require("./TableSectionContext-pYlJ-duI.cjs");
7
+ const require_Table_TableBody = require("./Table/TableBody.cjs");
8
+ const require_Table_TableCell = require("./Table/TableCell.cjs");
9
+ const require_Table_TableContainer = require("./Table/TableContainer.cjs");
10
+ const require_Table_TableControl = require("./Table/TableControl.cjs");
11
+ const require_Table_TableFooter = require("./Table/TableFooter.cjs");
12
+ const require_Table_TableHead = require("./Table/TableHead.cjs");
13
+ const require_Table_TablePaginationActions = require("./Table/TablePaginationActions.cjs");
14
+ const require_Table_TablePagination = require("./Table/TablePagination.cjs");
15
+ const require_Table_TableRow = require("./Table/TableRow.cjs");
16
+ exports.Table = require_Table_Table.Table;
17
+ exports.TableBody = require_Table_TableBody.TableBody;
18
+ exports.TableCell = require_Table_TableCell.TableCell;
19
+ exports.TableContainer = require_Table_TableContainer.TableContainer;
20
+ exports.TableContext = require_TableContext.TableContext;
21
+ exports.TableControl = require_Table_TableControl.TableControl;
22
+ exports.TableFooter = require_Table_TableFooter.TableFooter;
23
+ exports.TableHead = require_Table_TableHead.TableHead;
24
+ exports.TablePagination = require_Table_TablePagination.TablePagination;
25
+ exports.TablePaginationActions = require_Table_TablePaginationActions.TablePaginationActions;
26
+ exports.TableRow = require_Table_TableRow.TableRow;
27
+ exports.TableSectionContext = require_TableSectionContext.TableSectionContext;
28
+ exports.TableSortLabel = require_Table_TableSortLabel.TableSortLabel;
29
+ exports.useTablePagination = require_Table_hooks.useTablePagination;
30
+ exports.useTableSelection = require_Table_hooks.useTableSelection;
31
+ exports.useTableSort = require_Table_hooks.useTableSort;
@@ -0,0 +1,16 @@
1
+ import { a as UseTablePaginationOptions, i as TablePaginationState, n as TableSortMap, o as useTablePagination, r as useTableSort, t as TableSortEntry } from "./useTableSort--XMWjujs.cjs";
2
+ import { i as useTableSelection, n as TableSelectionAllProps, r as TableSelectionRowProps, t as TableSelection } from "./index-Dtzj8X58.cjs";
3
+ import { n as TableSortLabelDirection, r as TableSortLabelProps, t as TableSortLabel } from "./index-8dzWTpFp.cjs";
4
+ import { n as TableContext, r as TableContextValue, t as TableCellPadding } from "./TableContext-2qH7XYJB.cjs";
5
+ import { a as TableProps, i as TableBorderColorToken, n as TableAlign, o as TableSize, r as TableBackgroundToken, t as Table } from "./index-CM_KCTee.cjs";
6
+ import { a as TableBodyProps, i as TableBodyColorToken, n as TableBodyBackgroundToken, r as TableBodyBorderColorToken, t as TableBody } from "./index-GVsFY00r.cjs";
7
+ import { a as TableCellColorToken, c as TableCellVariant, i as TableCellBorderColorToken, l as TableSection, n as TableCellAlign, o as TableCellProps, r as TableCellBackgroundToken, s as TableCellSortDirection, t as TableCell, u as TableSectionContext } from "./index-4rC2j7fR.cjs";
8
+ import { n as TableContainerProps, t as TableContainer } from "./index-DeJWkpf9.cjs";
9
+ import { n as TableControlProps, t as TableControl } from "./index-g-9DZ_KQ.cjs";
10
+ import { a as TableFooterProps, i as TableFooterColorToken, n as TableFooterBackgroundToken, r as TableFooterBorderColorToken, t as TableFooter } from "./index-CDcGTGR4.cjs";
11
+ import { a as TableHeadProps, i as TableHeadColorToken, n as TableHeadBackgroundToken, r as TableHeadBorderColorToken, t as TableHead } from "./index-CcYSvIJi.cjs";
12
+ import { n as TablePaginationActions, r as TablePaginationActionsProps, t as TablePaginationActionType } from "./index-DSCMXFTn.cjs";
13
+ import { n as TablePaginationDisplayedRowsInfo, r as TablePaginationProps, t as TablePagination } from "./index-BlfIbAMs.cjs";
14
+ import { a as TableRowProps, i as TableRowColor, n as TableRowBackgroundToken, r as TableRowBorderColorToken, t as TableRow } from "./index-CT9uGKrs.cjs";
15
+ import "./index-Nqco3fsM.cjs";
16
+ export { Table, TableAlign, TableBackgroundToken, TableBody, TableBodyBackgroundToken, TableBodyBorderColorToken, TableBodyColorToken, TableBodyProps, TableBorderColorToken, TableCell, TableCellAlign, TableCellBackgroundToken, TableCellBorderColorToken, TableCellColorToken, TableCellPadding, TableCellProps, TableCellSortDirection, TableCellVariant, TableContainer, TableContainerProps, TableContext, TableContextValue, TableControl, TableControlProps, TableFooter, TableFooterBackgroundToken, TableFooterBorderColorToken, TableFooterColorToken, TableFooterProps, TableHead, TableHeadBackgroundToken, TableHeadBorderColorToken, TableHeadColorToken, TableHeadProps, TablePagination, TablePaginationActionType, TablePaginationActions, TablePaginationActionsProps, TablePaginationDisplayedRowsInfo, TablePaginationProps, TablePaginationState, TableProps, TableRow, TableRowBackgroundToken, TableRowBorderColorToken, TableRowColor, TableRowProps, TableSection, TableSectionContext, TableSelection, TableSelectionAllProps, TableSelectionRowProps, TableSize, TableSortEntry, TableSortLabel, TableSortLabelDirection, TableSortLabelProps, TableSortMap, UseTablePaginationOptions, useTablePagination, useTableSelection, useTableSort };
@@ -0,0 +1,16 @@
1
+ import { a as UseTablePaginationOptions, i as TablePaginationState, n as TableSortMap, o as useTablePagination, r as useTableSort, t as TableSortEntry } from "./useTableSort-CpDs4cGq.mjs";
2
+ import { i as useTableSelection, n as TableSelectionAllProps, r as TableSelectionRowProps, t as TableSelection } from "./index-DCQ2fsDu.mjs";
3
+ import { n as TableSortLabelDirection, r as TableSortLabelProps, t as TableSortLabel } from "./index-DmJIuQJj.mjs";
4
+ import { n as TableContext, r as TableContextValue, t as TableCellPadding } from "./TableContext-2qH7XYJB.mjs";
5
+ import { a as TableProps, i as TableBorderColorToken, n as TableAlign, o as TableSize, r as TableBackgroundToken, t as Table } from "./index-CEOZI-6L.mjs";
6
+ import { a as TableBodyProps, i as TableBodyColorToken, n as TableBodyBackgroundToken, r as TableBodyBorderColorToken, t as TableBody } from "./index-C-P_hipv.mjs";
7
+ import { a as TableCellColorToken, c as TableCellVariant, i as TableCellBorderColorToken, l as TableSection, n as TableCellAlign, o as TableCellProps, r as TableCellBackgroundToken, s as TableCellSortDirection, t as TableCell, u as TableSectionContext } from "./index-BH8jQOdF.mjs";
8
+ import { n as TableContainerProps, t as TableContainer } from "./index-DBGE6yKw.mjs";
9
+ import { n as TableControlProps, t as TableControl } from "./index-u57CbuAU2.mjs";
10
+ import { a as TableFooterProps, i as TableFooterColorToken, n as TableFooterBackgroundToken, r as TableFooterBorderColorToken, t as TableFooter } from "./index-g9EThkSg.mjs";
11
+ import { a as TableHeadProps, i as TableHeadColorToken, n as TableHeadBackgroundToken, r as TableHeadBorderColorToken, t as TableHead } from "./index-DvW2eETV.mjs";
12
+ import { n as TablePaginationActions, r as TablePaginationActionsProps, t as TablePaginationActionType } from "./index-BnzUumAC2.mjs";
13
+ import { n as TablePaginationDisplayedRowsInfo, r as TablePaginationProps, t as TablePagination } from "./index-kpk9e3xM2.mjs";
14
+ import { a as TableRowProps, i as TableRowColor, n as TableRowBackgroundToken, r as TableRowBorderColorToken, t as TableRow } from "./index-CLU39rUS2.mjs";
15
+ import "./index-Cl_yBpzW2.mjs";
16
+ export { Table, TableAlign, TableBackgroundToken, TableBody, TableBodyBackgroundToken, TableBodyBorderColorToken, TableBodyColorToken, TableBodyProps, TableBorderColorToken, TableCell, TableCellAlign, TableCellBackgroundToken, TableCellBorderColorToken, TableCellColorToken, TableCellPadding, TableCellProps, TableCellSortDirection, TableCellVariant, TableContainer, TableContainerProps, TableContext, TableContextValue, TableControl, TableControlProps, TableFooter, TableFooterBackgroundToken, TableFooterBorderColorToken, TableFooterColorToken, TableFooterProps, TableHead, TableHeadBackgroundToken, TableHeadBorderColorToken, TableHeadColorToken, TableHeadProps, TablePagination, TablePaginationActionType, TablePaginationActions, TablePaginationActionsProps, TablePaginationDisplayedRowsInfo, TablePaginationProps, TablePaginationState, TableProps, TableRow, TableRowBackgroundToken, TableRowBorderColorToken, TableRowColor, TableRowProps, TableSection, TableSectionContext, TableSelection, TableSelectionAllProps, TableSelectionRowProps, TableSize, TableSortEntry, TableSortLabel, TableSortLabelDirection, TableSortLabelProps, TableSortMap, UseTablePaginationOptions, useTablePagination, useTableSelection, useTableSort };
package/dist/Table.mjs ADDED
@@ -0,0 +1,15 @@
1
+ import { t as TableContext } from "./TableContext-BRWPghAI.mjs";
2
+ import { TableSortLabel } from "./Table/TableSortLabel.mjs";
3
+ import { useTablePagination, useTableSelection, useTableSort } from "./Table/hooks.mjs";
4
+ import { Table } from "./Table/Table.mjs";
5
+ import { t as TableSectionContext } from "./TableSectionContext-meIG4lFZ.mjs";
6
+ import { TableBody } from "./Table/TableBody.mjs";
7
+ import { TableCell } from "./Table/TableCell.mjs";
8
+ import { TableContainer } from "./Table/TableContainer.mjs";
9
+ import { TableControl } from "./Table/TableControl.mjs";
10
+ import { TableFooter } from "./Table/TableFooter.mjs";
11
+ import { TableHead } from "./Table/TableHead.mjs";
12
+ import { TablePaginationActions } from "./Table/TablePaginationActions.mjs";
13
+ import { TablePagination } from "./Table/TablePagination.mjs";
14
+ import { TableRow } from "./Table/TableRow.mjs";
15
+ export { Table, TableBody, TableCell, TableContainer, TableContext, TableControl, TableFooter, TableHead, TablePagination, TablePaginationActions, TableRow, TableSectionContext, TableSortLabel, useTablePagination, useTableSelection, useTableSort };
@@ -0,0 +1,19 @@
1
+ import { Theme } from "@emotion/react";
2
+ //#region src/Table/TableContext.d.ts
3
+ /** Cell padding modes broadcast from `Table` to descendant cells. */
4
+ type TableCellPadding = 'normal' | 'none';
5
+ /** Table-wide cell config, provided by `Table` and consumed by `TableCell` / `TableSortLabel`. */
6
+ interface TableContextValue {
7
+ size?: keyof Theme['sizes'];
8
+ cellPadding?: TableCellPadding;
9
+ hasStickyHeader?: boolean;
10
+ /** Palette color for descendant rows' hover/selected shading — a row's own `color` wins. */
11
+ color?: keyof Theme['palette'];
12
+ /** Hides inactive sort icons (revealed on hover/focus). */
13
+ shouldHideSortIcon?: boolean;
14
+ /** Truncates overflowing cell text with an ellipsis. */
15
+ hasEllipsis?: boolean;
16
+ }
17
+ declare const TableContext: import("react").Context<TableContextValue>;
18
+ //#endregion
19
+ export { TableContext as n, TableContextValue as r, TableCellPadding as t };