@parto-system-design/ui 1.1.11 → 1.1.16

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 (411) hide show
  1. package/dist/components/brand/parto-logo.cjs +130 -0
  2. package/dist/components/brand/parto-logo.cjs.map +1 -0
  3. package/dist/components/brand/parto-logo.d.cts +38 -0
  4. package/dist/components/brand/parto-logo.d.ts +38 -0
  5. package/dist/components/brand/parto-logo.js +108 -0
  6. package/dist/components/brand/parto-logo.js.map +1 -0
  7. package/dist/components/charts/PartoAreaChart.cjs +579 -7
  8. package/dist/components/charts/PartoAreaChart.cjs.map +1 -1
  9. package/dist/components/charts/PartoAreaChart.js +564 -4
  10. package/dist/components/charts/PartoAreaChart.js.map +1 -1
  11. package/dist/components/charts/PartoBarChart.cjs +616 -7
  12. package/dist/components/charts/PartoBarChart.cjs.map +1 -1
  13. package/dist/components/charts/PartoBarChart.js +601 -4
  14. package/dist/components/charts/PartoBarChart.js.map +1 -1
  15. package/dist/components/charts/PartoLineChart.cjs +584 -7
  16. package/dist/components/charts/PartoLineChart.cjs.map +1 -1
  17. package/dist/components/charts/PartoLineChart.js +569 -4
  18. package/dist/components/charts/PartoLineChart.js.map +1 -1
  19. package/dist/components/charts/PartoPieChart.cjs +566 -7
  20. package/dist/components/charts/PartoPieChart.cjs.map +1 -1
  21. package/dist/components/charts/PartoPieChart.js +551 -4
  22. package/dist/components/charts/PartoPieChart.js.map +1 -1
  23. package/dist/components/ui/accordion.cjs +97 -0
  24. package/dist/components/ui/accordion.cjs.map +1 -0
  25. package/dist/components/ui/accordion.d.cts +22 -0
  26. package/dist/components/ui/accordion.d.ts +22 -0
  27. package/dist/components/ui/accordion.js +72 -0
  28. package/dist/components/ui/accordion.js.map +1 -0
  29. package/dist/{chunk-MMC6M35Q.cjs → components/ui/alert-dialog.cjs} +216 -22
  30. package/dist/components/ui/alert-dialog.cjs.map +1 -0
  31. package/dist/components/ui/alert-dialog.d.cts +17 -0
  32. package/dist/components/ui/alert-dialog.d.ts +17 -0
  33. package/dist/{chunk-3QYYPPFJ.js → components/ui/alert-dialog.js} +175 -10
  34. package/dist/components/ui/alert-dialog.js.map +1 -0
  35. package/dist/components/ui/alert-rule-card.cjs +289 -8
  36. package/dist/components/ui/alert-rule-card.cjs.map +1 -1
  37. package/dist/components/ui/alert-rule-card.d.cts +1 -1
  38. package/dist/components/ui/alert-rule-card.d.ts +1 -1
  39. package/dist/components/ui/alert-rule-card.js +271 -4
  40. package/dist/components/ui/alert-rule-card.js.map +1 -1
  41. package/dist/components/ui/alert.cjs +81 -0
  42. package/dist/components/ui/alert.cjs.map +1 -0
  43. package/dist/components/ui/alert.d.cts +11 -0
  44. package/dist/components/ui/alert.d.ts +11 -0
  45. package/dist/components/ui/alert.js +57 -0
  46. package/dist/components/ui/alert.js.map +1 -0
  47. package/dist/components/ui/app-bar.cjs +67 -0
  48. package/dist/components/ui/app-bar.cjs.map +1 -0
  49. package/dist/components/ui/app-bar.d.cts +22 -0
  50. package/dist/components/ui/app-bar.d.ts +22 -0
  51. package/dist/components/ui/app-bar.js +44 -0
  52. package/dist/components/ui/app-bar.js.map +1 -0
  53. package/dist/components/ui/avatar.cjs +66 -14
  54. package/dist/components/ui/avatar.cjs.map +1 -1
  55. package/dist/components/ui/avatar.js +47 -2
  56. package/dist/components/ui/avatar.js.map +1 -1
  57. package/dist/components/ui/badge.cjs +113 -9
  58. package/dist/components/ui/badge.cjs.map +1 -1
  59. package/dist/components/ui/badge.d.cts +1 -1
  60. package/dist/components/ui/badge.d.ts +1 -1
  61. package/dist/components/ui/badge.js +96 -2
  62. package/dist/components/ui/badge.js.map +1 -1
  63. package/dist/components/ui/breadcrumb.cjs +100 -0
  64. package/dist/components/ui/breadcrumb.cjs.map +1 -0
  65. package/dist/components/ui/breadcrumb.d.cts +35 -0
  66. package/dist/components/ui/breadcrumb.d.ts +35 -0
  67. package/dist/components/ui/breadcrumb.js +92 -0
  68. package/dist/components/ui/breadcrumb.js.map +1 -0
  69. package/dist/components/ui/button.cjs +304 -11
  70. package/dist/components/ui/button.cjs.map +1 -1
  71. package/dist/components/ui/button.d.cts +3 -3
  72. package/dist/components/ui/button.d.ts +3 -3
  73. package/dist/components/ui/button.js +306 -3
  74. package/dist/components/ui/button.js.map +1 -1
  75. package/dist/components/ui/calendar.cjs +401 -8
  76. package/dist/components/ui/calendar.cjs.map +1 -1
  77. package/dist/components/ui/calendar.js +404 -4
  78. package/dist/components/ui/calendar.js.map +1 -1
  79. package/dist/components/ui/card.cjs +154 -30
  80. package/dist/components/ui/card.cjs.map +1 -1
  81. package/dist/components/ui/card.js +131 -2
  82. package/dist/components/ui/card.js.map +1 -1
  83. package/dist/{chunk-CAJKSTXX.cjs → components/ui/checkbox.cjs} +10 -5
  84. package/dist/components/ui/checkbox.cjs.map +1 -0
  85. package/dist/components/ui/checkbox.d.cts +6 -0
  86. package/dist/components/ui/checkbox.d.ts +6 -0
  87. package/dist/{chunk-5JJSRGJD.js → components/ui/checkbox.js} +9 -4
  88. package/dist/components/ui/checkbox.js.map +1 -0
  89. package/dist/components/ui/concept-card.cjs +728 -11
  90. package/dist/components/ui/concept-card.cjs.map +1 -1
  91. package/dist/components/ui/concept-card.d.cts +2 -2
  92. package/dist/components/ui/concept-card.d.ts +2 -2
  93. package/dist/components/ui/concept-card.js +710 -7
  94. package/dist/components/ui/concept-card.js.map +1 -1
  95. package/dist/components/ui/data-table.cjs +1553 -10
  96. package/dist/components/ui/data-table.cjs.map +1 -1
  97. package/dist/components/ui/data-table.js +1537 -7
  98. package/dist/components/ui/data-table.js.map +1 -1
  99. package/dist/components/ui/dialog.cjs +119 -42
  100. package/dist/components/ui/dialog.cjs.map +1 -1
  101. package/dist/components/ui/dialog.js +92 -2
  102. package/dist/components/ui/dialog.js.map +1 -1
  103. package/dist/components/ui/dropdown-menu.cjs +268 -0
  104. package/dist/components/ui/dropdown-menu.cjs.map +1 -0
  105. package/dist/components/ui/dropdown-menu.d.cts +73 -0
  106. package/dist/components/ui/dropdown-menu.d.ts +73 -0
  107. package/dist/components/ui/dropdown-menu.js +232 -0
  108. package/dist/components/ui/dropdown-menu.js.map +1 -0
  109. package/dist/components/ui/filter-provider.cjs +70 -13
  110. package/dist/components/ui/filter-provider.cjs.map +1 -1
  111. package/dist/components/ui/filter-provider.js +51 -1
  112. package/dist/components/ui/filter-provider.js.map +1 -1
  113. package/dist/components/ui/form.cjs +169 -0
  114. package/dist/components/ui/form.cjs.map +1 -0
  115. package/dist/components/ui/form.d.cts +46 -0
  116. package/dist/components/ui/form.d.ts +46 -0
  117. package/dist/components/ui/form.js +139 -0
  118. package/dist/components/ui/form.js.map +1 -0
  119. package/dist/components/ui/input.cjs +135 -15
  120. package/dist/components/ui/input.cjs.map +1 -1
  121. package/dist/components/ui/input.d.cts +15 -0
  122. package/dist/components/ui/input.d.ts +15 -0
  123. package/dist/components/ui/input.js +116 -3
  124. package/dist/components/ui/input.js.map +1 -1
  125. package/dist/components/ui/iran-province-heat.cjs +328 -5
  126. package/dist/components/ui/iran-province-heat.cjs.map +1 -1
  127. package/dist/components/ui/iran-province-heat.js +312 -2
  128. package/dist/components/ui/iran-province-heat.js.map +1 -1
  129. package/dist/components/ui/label.cjs +52 -0
  130. package/dist/components/ui/label.cjs.map +1 -0
  131. package/dist/components/ui/label.d.cts +10 -0
  132. package/dist/components/ui/label.d.ts +10 -0
  133. package/dist/components/ui/label.js +30 -0
  134. package/dist/components/ui/label.js.map +1 -0
  135. package/dist/components/ui/page-card.cjs +627 -8
  136. package/dist/components/ui/page-card.cjs.map +1 -1
  137. package/dist/components/ui/page-card.d.cts +3 -2
  138. package/dist/components/ui/page-card.d.ts +3 -2
  139. package/dist/components/ui/page-card.js +611 -5
  140. package/dist/components/ui/page-card.js.map +1 -1
  141. package/dist/components/ui/page-header.cjs +299 -0
  142. package/dist/components/ui/page-header.cjs.map +1 -0
  143. package/dist/components/ui/page-header.d.cts +21 -0
  144. package/dist/components/ui/page-header.d.ts +21 -0
  145. package/dist/components/ui/page-header.js +277 -0
  146. package/dist/components/ui/page-header.js.map +1 -0
  147. package/dist/components/ui/password-input.cjs +168 -0
  148. package/dist/components/ui/password-input.cjs.map +1 -0
  149. package/dist/components/ui/password-input.d.cts +48 -0
  150. package/dist/components/ui/password-input.d.ts +48 -0
  151. package/dist/components/ui/password-input.js +146 -0
  152. package/dist/components/ui/password-input.js.map +1 -0
  153. package/dist/components/ui/popover.cjs +51 -18
  154. package/dist/components/ui/popover.cjs.map +1 -1
  155. package/dist/components/ui/popover.js +30 -2
  156. package/dist/components/ui/popover.js.map +1 -1
  157. package/dist/components/ui/progress.cjs +95 -0
  158. package/dist/components/ui/progress.cjs.map +1 -0
  159. package/dist/components/ui/progress.d.cts +18 -0
  160. package/dist/components/ui/progress.d.ts +18 -0
  161. package/dist/components/ui/progress.js +72 -0
  162. package/dist/components/ui/progress.js.map +1 -0
  163. package/dist/components/ui/radio-card.cjs +84 -0
  164. package/dist/components/ui/radio-card.cjs.map +1 -0
  165. package/dist/components/ui/radio-card.d.cts +12 -0
  166. package/dist/components/ui/radio-card.d.ts +12 -0
  167. package/dist/components/ui/radio-card.js +58 -0
  168. package/dist/components/ui/radio-card.js.map +1 -0
  169. package/dist/components/ui/radio-group.cjs +62 -0
  170. package/dist/components/ui/radio-group.cjs.map +1 -0
  171. package/dist/components/ui/radio-group.d.cts +7 -0
  172. package/dist/components/ui/radio-group.d.ts +7 -0
  173. package/dist/components/ui/radio-group.js +38 -0
  174. package/dist/components/ui/radio-group.js.map +1 -0
  175. package/dist/components/ui/saved-query-card.cjs +409 -7
  176. package/dist/components/ui/saved-query-card.cjs.map +1 -1
  177. package/dist/components/ui/saved-query-card.js +394 -4
  178. package/dist/components/ui/saved-query-card.js.map +1 -1
  179. package/dist/components/ui/scroll-area.cjs +79 -0
  180. package/dist/components/ui/scroll-area.cjs.map +1 -0
  181. package/dist/components/ui/scroll-area.d.cts +14 -0
  182. package/dist/components/ui/scroll-area.d.ts +14 -0
  183. package/dist/components/ui/scroll-area.js +56 -0
  184. package/dist/components/ui/scroll-area.js.map +1 -0
  185. package/dist/components/ui/select.cjs +242 -0
  186. package/dist/components/ui/select.cjs.map +1 -0
  187. package/dist/components/ui/select.d.cts +29 -0
  188. package/dist/components/ui/select.d.ts +29 -0
  189. package/dist/components/ui/select.js +210 -0
  190. package/dist/components/ui/select.js.map +1 -0
  191. package/dist/components/ui/separator.cjs +105 -6
  192. package/dist/components/ui/separator.cjs.map +1 -1
  193. package/dist/components/ui/separator.js +87 -2
  194. package/dist/components/ui/separator.js.map +1 -1
  195. package/dist/components/ui/sheet.cjs +134 -38
  196. package/dist/components/ui/sheet.cjs.map +1 -1
  197. package/dist/components/ui/sheet.js +109 -2
  198. package/dist/components/ui/sheet.js.map +1 -1
  199. package/dist/{chunk-D2EBLE2B.cjs → components/ui/skeleton.cjs} +21 -16
  200. package/dist/components/ui/skeleton.cjs.map +1 -0
  201. package/dist/components/ui/skeleton.d.cts +90 -0
  202. package/dist/components/ui/skeleton.d.ts +90 -0
  203. package/dist/{chunk-SB5DSYR5.js → components/ui/skeleton.js} +8 -3
  204. package/dist/components/ui/skeleton.js.map +1 -0
  205. package/dist/components/ui/slider.cjs +129 -0
  206. package/dist/components/ui/slider.cjs.map +1 -0
  207. package/dist/components/ui/slider.d.cts +10 -0
  208. package/dist/components/ui/slider.d.ts +10 -0
  209. package/dist/components/ui/slider.js +107 -0
  210. package/dist/components/ui/slider.js.map +1 -0
  211. package/dist/components/ui/social-platform-badge.cjs +120 -0
  212. package/dist/components/ui/social-platform-badge.cjs.map +1 -0
  213. package/dist/components/ui/social-platform-badge.d.cts +21 -0
  214. package/dist/components/ui/social-platform-badge.d.ts +21 -0
  215. package/dist/components/ui/social-platform-badge.js +97 -0
  216. package/dist/components/ui/social-platform-badge.js.map +1 -0
  217. package/dist/components/ui/sonner.cjs +51 -0
  218. package/dist/components/ui/sonner.cjs.map +1 -0
  219. package/dist/components/ui/sonner.d.cts +13 -0
  220. package/dist/components/ui/sonner.d.ts +13 -0
  221. package/dist/components/ui/sonner.js +45 -0
  222. package/dist/components/ui/sonner.js.map +1 -0
  223. package/dist/components/ui/sparkline.cjs +159 -6
  224. package/dist/components/ui/sparkline.cjs.map +1 -1
  225. package/dist/components/ui/sparkline.js +142 -2
  226. package/dist/components/ui/sparkline.js.map +1 -1
  227. package/dist/components/ui/switch.cjs +96 -0
  228. package/dist/components/ui/switch.cjs.map +1 -0
  229. package/dist/components/ui/switch.d.cts +13 -0
  230. package/dist/components/ui/switch.d.ts +13 -0
  231. package/dist/components/ui/switch.js +73 -0
  232. package/dist/components/ui/switch.js.map +1 -0
  233. package/dist/components/ui/table.cjs +188 -0
  234. package/dist/components/ui/table.cjs.map +1 -0
  235. package/dist/components/ui/table.d.cts +59 -0
  236. package/dist/components/ui/table.d.ts +59 -0
  237. package/dist/components/ui/table.js +178 -0
  238. package/dist/components/ui/table.js.map +1 -0
  239. package/dist/components/ui/tabs.cjs +140 -0
  240. package/dist/components/ui/tabs.cjs.map +1 -0
  241. package/dist/components/ui/tabs.d.cts +21 -0
  242. package/dist/components/ui/tabs.d.ts +21 -0
  243. package/dist/components/ui/tabs.js +115 -0
  244. package/dist/components/ui/tabs.js.map +1 -0
  245. package/dist/components/ui/textarea.cjs +56 -0
  246. package/dist/components/ui/textarea.cjs.map +1 -0
  247. package/dist/components/ui/textarea.d.cts +5 -0
  248. package/dist/components/ui/textarea.d.ts +5 -0
  249. package/dist/components/ui/textarea.js +34 -0
  250. package/dist/components/ui/textarea.js.map +1 -0
  251. package/dist/components/ui/toggle-group.cjs +123 -0
  252. package/dist/components/ui/toggle-group.cjs.map +1 -0
  253. package/dist/components/ui/toggle-group.d.cts +7 -0
  254. package/dist/components/ui/toggle-group.d.ts +7 -0
  255. package/dist/components/ui/toggle-group.js +99 -0
  256. package/dist/components/ui/toggle-group.js.map +1 -0
  257. package/dist/components/ui/tooltip.cjs +77 -18
  258. package/dist/components/ui/tooltip.cjs.map +1 -1
  259. package/dist/components/ui/tooltip.js +56 -2
  260. package/dist/components/ui/tooltip.js.map +1 -1
  261. package/dist/{concept-card-RwPbqJ06.d.cts → concept-card-BXra9mr0.d.cts} +2 -2
  262. package/dist/{concept-card-CcOBb2Nz.d.ts → concept-card-BoJ5gIJD.d.ts} +2 -2
  263. package/dist/hooks/use-hotkey-registry.cjs +201 -14
  264. package/dist/hooks/use-hotkey-registry.cjs.map +1 -1
  265. package/dist/hooks/use-hotkey-registry.js +182 -2
  266. package/dist/hooks/use-hotkey-registry.js.map +1 -1
  267. package/dist/hooks/use-hotkeys.cjs +144 -9
  268. package/dist/hooks/use-hotkeys.cjs.map +1 -1
  269. package/dist/hooks/use-hotkeys.js +126 -1
  270. package/dist/hooks/use-hotkeys.js.map +1 -1
  271. package/dist/{i18n-CAd9wGOr.d.cts → i18n-BfRhV5aw.d.cts} +5 -3
  272. package/dist/{i18n-ArS3mqj0.d.ts → i18n-ewyqbKM-.d.ts} +5 -3
  273. package/dist/index.cjs +20906 -15706
  274. package/dist/index.cjs.map +1 -1
  275. package/dist/index.css +396 -69
  276. package/dist/index.d.cts +49 -490
  277. package/dist/index.d.ts +49 -490
  278. package/dist/index.js +7704 -2032
  279. package/dist/index.js.map +1 -1
  280. package/dist/{page-card-CmShVqG-.d.cts → page-card-C9XXXOVr.d.cts} +3 -20
  281. package/dist/{page-card-HBn-cy4J.d.ts → page-card-DAnbez_f.d.ts} +3 -20
  282. package/dist/toggle-group-B8r4LOQw.d.cts +26 -0
  283. package/dist/toggle-group-B8r4LOQw.d.ts +26 -0
  284. package/package.json +132 -2
  285. package/tailwind.config.ts +45 -0
  286. package/dist/chunk-2ACKKPWA.cjs +0 -112
  287. package/dist/chunk-2ACKKPWA.cjs.map +0 -1
  288. package/dist/chunk-2UD3LGVX.cjs +0 -316
  289. package/dist/chunk-2UD3LGVX.cjs.map +0 -1
  290. package/dist/chunk-3QYYPPFJ.js.map +0 -1
  291. package/dist/chunk-4SVQNEVH.js +0 -173
  292. package/dist/chunk-4SVQNEVH.js.map +0 -1
  293. package/dist/chunk-4WONHORR.cjs +0 -152
  294. package/dist/chunk-4WONHORR.cjs.map +0 -1
  295. package/dist/chunk-5HCXH6GS.js +0 -409
  296. package/dist/chunk-5HCXH6GS.js.map +0 -1
  297. package/dist/chunk-5JJSRGJD.js.map +0 -1
  298. package/dist/chunk-5K6E4ZSW.cjs +0 -77
  299. package/dist/chunk-5K6E4ZSW.cjs.map +0 -1
  300. package/dist/chunk-5NY26ULO.js +0 -89
  301. package/dist/chunk-5NY26ULO.js.map +0 -1
  302. package/dist/chunk-7RVPG3LE.cjs +0 -231
  303. package/dist/chunk-7RVPG3LE.cjs.map +0 -1
  304. package/dist/chunk-AYEK3WOM.js +0 -207
  305. package/dist/chunk-AYEK3WOM.js.map +0 -1
  306. package/dist/chunk-BRMBLIQG.js +0 -53
  307. package/dist/chunk-BRMBLIQG.js.map +0 -1
  308. package/dist/chunk-CAJKSTXX.cjs.map +0 -1
  309. package/dist/chunk-CKFWMHQU.js +0 -401
  310. package/dist/chunk-CKFWMHQU.js.map +0 -1
  311. package/dist/chunk-CV3N3HVK.js +0 -672
  312. package/dist/chunk-CV3N3HVK.js.map +0 -1
  313. package/dist/chunk-D2EBLE2B.cjs.map +0 -1
  314. package/dist/chunk-GCZ6YATL.js +0 -940
  315. package/dist/chunk-GCZ6YATL.js.map +0 -1
  316. package/dist/chunk-GKRAZGDI.cjs +0 -84
  317. package/dist/chunk-GKRAZGDI.cjs.map +0 -1
  318. package/dist/chunk-GPYJ66CG.js +0 -45
  319. package/dist/chunk-GPYJ66CG.js.map +0 -1
  320. package/dist/chunk-HF6XU5NI.js +0 -84
  321. package/dist/chunk-HF6XU5NI.js.map +0 -1
  322. package/dist/chunk-HJPDZOMJ.cjs +0 -87
  323. package/dist/chunk-HJPDZOMJ.cjs.map +0 -1
  324. package/dist/chunk-HS3XI3CC.cjs +0 -69
  325. package/dist/chunk-HS3XI3CC.cjs.map +0 -1
  326. package/dist/chunk-HUCC3QH5.cjs +0 -53
  327. package/dist/chunk-HUCC3QH5.cjs.map +0 -1
  328. package/dist/chunk-HYZ6BQPS.cjs +0 -425
  329. package/dist/chunk-HYZ6BQPS.cjs.map +0 -1
  330. package/dist/chunk-ISCSZMYW.cjs +0 -106
  331. package/dist/chunk-ISCSZMYW.cjs.map +0 -1
  332. package/dist/chunk-IXFEFIDO.js +0 -82
  333. package/dist/chunk-IXFEFIDO.js.map +0 -1
  334. package/dist/chunk-JCJLN437.js +0 -108
  335. package/dist/chunk-JCJLN437.js.map +0 -1
  336. package/dist/chunk-JMKNNH63.cjs +0 -982
  337. package/dist/chunk-JMKNNH63.cjs.map +0 -1
  338. package/dist/chunk-JUBHQAA2.js +0 -53
  339. package/dist/chunk-JUBHQAA2.js.map +0 -1
  340. package/dist/chunk-K6G63EED.cjs +0 -41
  341. package/dist/chunk-K6G63EED.cjs.map +0 -1
  342. package/dist/chunk-KCWRCSI7.js +0 -62
  343. package/dist/chunk-KCWRCSI7.js.map +0 -1
  344. package/dist/chunk-KYM7NIJO.cjs +0 -433
  345. package/dist/chunk-KYM7NIJO.cjs.map +0 -1
  346. package/dist/chunk-L2L5CKC2.js +0 -291
  347. package/dist/chunk-L2L5CKC2.js.map +0 -1
  348. package/dist/chunk-M5CHZ5BA.js +0 -124
  349. package/dist/chunk-M5CHZ5BA.js.map +0 -1
  350. package/dist/chunk-MEK4RSGC.js +0 -65
  351. package/dist/chunk-MEK4RSGC.js.map +0 -1
  352. package/dist/chunk-MEKWH3GS.js +0 -89
  353. package/dist/chunk-MEKWH3GS.js.map +0 -1
  354. package/dist/chunk-MFTX2DDQ.js +0 -27
  355. package/dist/chunk-MFTX2DDQ.js.map +0 -1
  356. package/dist/chunk-MMC6M35Q.cjs.map +0 -1
  357. package/dist/chunk-NMH43BDC.js +0 -130
  358. package/dist/chunk-NMH43BDC.js.map +0 -1
  359. package/dist/chunk-NORDUD2T.cjs +0 -135
  360. package/dist/chunk-NORDUD2T.cjs.map +0 -1
  361. package/dist/chunk-NV4JOKWL.cjs +0 -197
  362. package/dist/chunk-NV4JOKWL.cjs.map +0 -1
  363. package/dist/chunk-O2JG7WY5.cjs +0 -121
  364. package/dist/chunk-O2JG7WY5.cjs.map +0 -1
  365. package/dist/chunk-ONO2FTV4.cjs +0 -68
  366. package/dist/chunk-ONO2FTV4.cjs.map +0 -1
  367. package/dist/chunk-OQB6HIUL.cjs +0 -108
  368. package/dist/chunk-OQB6HIUL.cjs.map +0 -1
  369. package/dist/chunk-OS6CMYAS.cjs +0 -79
  370. package/dist/chunk-OS6CMYAS.cjs.map +0 -1
  371. package/dist/chunk-PYURPUTV.js +0 -402
  372. package/dist/chunk-PYURPUTV.js.map +0 -1
  373. package/dist/chunk-RJ3HYZ7S.js +0 -44
  374. package/dist/chunk-RJ3HYZ7S.js.map +0 -1
  375. package/dist/chunk-RZNRIOLT.js +0 -128
  376. package/dist/chunk-RZNRIOLT.js.map +0 -1
  377. package/dist/chunk-S3T2L6NA.js +0 -38
  378. package/dist/chunk-S3T2L6NA.js.map +0 -1
  379. package/dist/chunk-S5IPJQZ3.cjs +0 -161
  380. package/dist/chunk-S5IPJQZ3.cjs.map +0 -1
  381. package/dist/chunk-SB5DSYR5.js.map +0 -1
  382. package/dist/chunk-SFXV2DUH.js +0 -106
  383. package/dist/chunk-SFXV2DUH.js.map +0 -1
  384. package/dist/chunk-SXEPGD4Z.cjs +0 -152
  385. package/dist/chunk-SXEPGD4Z.cjs.map +0 -1
  386. package/dist/chunk-SXWSOU3Y.js +0 -89
  387. package/dist/chunk-SXWSOU3Y.js.map +0 -1
  388. package/dist/chunk-SZMVOHT7.cjs +0 -107
  389. package/dist/chunk-SZMVOHT7.cjs.map +0 -1
  390. package/dist/chunk-TWJXOV4C.js +0 -145
  391. package/dist/chunk-TWJXOV4C.js.map +0 -1
  392. package/dist/chunk-U3ADRIVO.cjs +0 -434
  393. package/dist/chunk-U3ADRIVO.cjs.map +0 -1
  394. package/dist/chunk-U5FLLCGC.cjs +0 -151
  395. package/dist/chunk-U5FLLCGC.cjs.map +0 -1
  396. package/dist/chunk-UOZN45G4.cjs +0 -130
  397. package/dist/chunk-UOZN45G4.cjs.map +0 -1
  398. package/dist/chunk-VHLDOG74.cjs +0 -167
  399. package/dist/chunk-VHLDOG74.cjs.map +0 -1
  400. package/dist/chunk-YC5KLN6I.js +0 -139
  401. package/dist/chunk-YC5KLN6I.js.map +0 -1
  402. package/dist/chunk-YENXXYUV.cjs +0 -111
  403. package/dist/chunk-YENXXYUV.cjs.map +0 -1
  404. package/dist/chunk-YFQWC2PW.js +0 -113
  405. package/dist/chunk-YFQWC2PW.js.map +0 -1
  406. package/dist/chunk-Z2TY4A75.cjs +0 -700
  407. package/dist/chunk-Z2TY4A75.cjs.map +0 -1
  408. package/dist/chunk-Z56O7UEU.cjs +0 -136
  409. package/dist/chunk-Z56O7UEU.cjs.map +0 -1
  410. package/dist/chunk-ZBZDR4ZC.js +0 -106
  411. package/dist/chunk-ZBZDR4ZC.js.map +0 -1
@@ -1,940 +0,0 @@
1
- import { buttonVariants } from './chunk-3QYYPPFJ.js';
2
- import { Checkbox } from './chunk-5JJSRGJD.js';
3
- import { Skeleton } from './chunk-SB5DSYR5.js';
4
- import { getUIStrings, isRTL } from './chunk-CV3N3HVK.js';
5
- import { cn, convertToLocalNumbers } from './chunk-4SVQNEVH.js';
6
- import * as React5 from 'react';
7
- import { Loader2, ChevronRightIcon, ChevronLeftIcon, MoreHorizontalIcon, ChevronDown, ChevronRight } from 'lucide-react';
8
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
- import { cva } from 'class-variance-authority';
10
-
11
- function Table({
12
- className,
13
- size = "md",
14
- striped = false,
15
- bordered = false,
16
- stickyHeader = false,
17
- ...props
18
- }) {
19
- return /* @__PURE__ */ jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: /* @__PURE__ */ jsx(
20
- "table",
21
- {
22
- "data-slot": "table",
23
- "data-size": size,
24
- "data-striped": striped || void 0,
25
- "data-bordered": bordered || void 0,
26
- "data-sticky-header": stickyHeader || void 0,
27
- className: cn("w-full caption-bottom", className),
28
- ...props
29
- }
30
- ) });
31
- }
32
- function TableHeader({ className, ...props }) {
33
- return /* @__PURE__ */ jsx(
34
- "thead",
35
- {
36
- "data-slot": "table-header",
37
- className: cn(
38
- "[&_tr]:border-b bg-surface-75",
39
- "[[data-sticky-header]_&]:sticky [[data-sticky-header]_&]:top-0 [[data-sticky-header]_&]:z-[9] [[data-sticky-header]_&]:bg-surface-75",
40
- className
41
- ),
42
- ...props
43
- }
44
- );
45
- }
46
- function TableBody({ className, ...props }) {
47
- return /* @__PURE__ */ jsx(
48
- "tbody",
49
- {
50
- "data-slot": "table-body",
51
- className: cn(
52
- "[&_tr:last-child]:border-0",
53
- "[[data-striped]_&_tr:nth-child(even)]:bg-surface-75 [[data-striped]_&_tr:nth-child(even):hover]:bg-surface-200",
54
- className
55
- ),
56
- ...props
57
- }
58
- );
59
- }
60
- function TableFooter({ className, ...props }) {
61
- return /* @__PURE__ */ jsx(
62
- "tfoot",
63
- {
64
- "data-slot": "table-footer",
65
- className: cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className),
66
- ...props
67
- }
68
- );
69
- }
70
- function TableRow({ className, ...props }) {
71
- return /* @__PURE__ */ jsx(
72
- "tr",
73
- {
74
- "data-slot": "table-row",
75
- className: cn("hover:bg-surface-200 data-[state=selected]:bg-selection border-b transition-colors", className),
76
- ...props
77
- }
78
- );
79
- }
80
- function TableHead({ className, sortDirection, ...props }) {
81
- const ariaSort = sortDirection === "asc" ? "ascending" : sortDirection === "desc" ? "descending" : sortDirection === "none" ? "none" : void 0;
82
- return /* @__PURE__ */ jsx(
83
- "th",
84
- {
85
- "data-slot": "table-head",
86
- "aria-sort": ariaSort,
87
- className: cn(
88
- "text-foreground-lighter text-start align-middle font-semibold whitespace-nowrap [&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-[2px]",
89
- // Size variants (inherited from parent table)
90
- "[[data-size=sm]_&]:h-8 [[data-size=sm]_&]:px-2 [[data-size=sm]_&]:text-xs",
91
- "[[data-size=md]_&]:h-10 [[data-size=md]_&]:px-3 [[data-size=md]_&]:text-sm",
92
- "[[data-size=lg]_&]:h-12 [[data-size=lg]_&]:px-4 [[data-size=lg]_&]:text-base",
93
- // Bordered variant
94
- "[[data-bordered]_&]:border [[data-bordered]_&]:border-border",
95
- className
96
- ),
97
- ...props
98
- }
99
- );
100
- }
101
- function TableCell({ className, ...props }) {
102
- return /* @__PURE__ */ jsx(
103
- "td",
104
- {
105
- "data-slot": "table-cell",
106
- className: cn(
107
- "align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-[2px]",
108
- // Size variants (inherited from parent table)
109
- "[[data-size=sm]_&]:px-2 [[data-size=sm]_&]:py-1.5 [[data-size=sm]_&]:text-xs",
110
- "[[data-size=md]_&]:px-3 [[data-size=md]_&]:py-2 [[data-size=md]_&]:text-sm",
111
- "[[data-size=lg]_&]:px-4 [[data-size=lg]_&]:py-3 [[data-size=lg]_&]:text-base",
112
- // Bordered variant
113
- "[[data-bordered]_&]:border [[data-bordered]_&]:border-border",
114
- className
115
- ),
116
- ...props
117
- }
118
- );
119
- }
120
- function TableCaption({ className, ...props }) {
121
- return /* @__PURE__ */ jsx("caption", { "data-slot": "table-caption", className: cn("text-foreground-muted mt-4 text-sm", className), ...props });
122
- }
123
- function TableSortHeader({ className, children, sorted, ...props }) {
124
- return /* @__PURE__ */ jsxs(
125
- "button",
126
- {
127
- "data-slot": "table-sort-header",
128
- className: cn(
129
- "inline-flex items-center gap-1.5 cursor-pointer select-none hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 rounded-sm",
130
- sorted && "text-foreground",
131
- className
132
- ),
133
- ...props,
134
- children: [
135
- children,
136
- /* @__PURE__ */ jsxs("span", { className: "inline-flex flex-col -space-y-0.5", children: [
137
- /* @__PURE__ */ jsx(
138
- "svg",
139
- {
140
- width: "8",
141
- height: "5",
142
- viewBox: "0 0 8 5",
143
- className: cn("transition-colors", sorted === "asc" ? "text-foreground" : "text-foreground-muted"),
144
- children: /* @__PURE__ */ jsx("path", { d: "M4 0L8 5H0L4 0Z", fill: "currentColor" })
145
- }
146
- ),
147
- /* @__PURE__ */ jsx(
148
- "svg",
149
- {
150
- width: "8",
151
- height: "5",
152
- viewBox: "0 0 8 5",
153
- className: cn("transition-colors", sorted === "desc" ? "text-foreground" : "text-foreground-muted"),
154
- children: /* @__PURE__ */ jsx("path", { d: "M4 5L0 0H8L4 5Z", fill: "currentColor" })
155
- }
156
- )
157
- ] })
158
- ]
159
- }
160
- );
161
- }
162
- Table.displayName = "Table";
163
- TableHeader.displayName = "TableHeader";
164
- TableBody.displayName = "TableBody";
165
- TableFooter.displayName = "TableFooter";
166
- TableHead.displayName = "TableHead";
167
- TableRow.displayName = "TableRow";
168
- TableCell.displayName = "TableCell";
169
- TableCaption.displayName = "TableCaption";
170
- TableSortHeader.displayName = "TableSortHeader";
171
- var PaginationDirectionContext = React5.createContext("rtl");
172
- function usePaginationDirection() {
173
- return React5.useContext(PaginationDirectionContext);
174
- }
175
- function Pagination({ className, dir, children, ...props }) {
176
- const resolvedDir = dir ?? "rtl";
177
- return /* @__PURE__ */ jsx(PaginationDirectionContext.Provider, { value: resolvedDir, children: /* @__PURE__ */ jsx(
178
- "nav",
179
- {
180
- role: "navigation",
181
- "aria-label": "pagination",
182
- "data-slot": "pagination",
183
- dir: resolvedDir,
184
- className: cn("mx-auto flex w-full justify-center not-prose", className),
185
- ...props,
186
- children
187
- }
188
- ) });
189
- }
190
- function PaginationContent({ className, ...props }) {
191
- const dir = usePaginationDirection();
192
- return /* @__PURE__ */ jsx(
193
- "ul",
194
- {
195
- "data-slot": "pagination-content",
196
- dir,
197
- className: cn("flex flex-row items-center gap-1 list-none", className),
198
- ...props
199
- }
200
- );
201
- }
202
- function PaginationItem({ ...props }) {
203
- return /* @__PURE__ */ jsx("li", { "data-slot": "pagination-item", ...props });
204
- }
205
- function PaginationLink({ className, isActive, size = "icon", dir, ...props }) {
206
- const contextDir = usePaginationDirection();
207
- const linkDir = dir ?? (contextDir === "rtl" ? "rtl" : "ltr");
208
- return /* @__PURE__ */ jsx(
209
- "a",
210
- {
211
- "aria-current": isActive ? "page" : void 0,
212
- "data-slot": "pagination-link",
213
- "data-active": isActive,
214
- dir: linkDir,
215
- className: cn(
216
- buttonVariants({
217
- variant: "outline",
218
- size
219
- }),
220
- // Remove underline from links
221
- "no-underline",
222
- // Active state styling with green color
223
- isActive && [
224
- "border-brand-500 bg-brand/10 text-brand-600",
225
- "dark:border-brand-600 dark:bg-brand/10 dark:text-brand-400",
226
- "pointer-events-none"
227
- ],
228
- className
229
- ),
230
- ...props
231
- }
232
- );
233
- }
234
- function PaginationPrevious({ className, ...props }) {
235
- const dir = usePaginationDirection();
236
- const isRTL2 = dir === "rtl";
237
- const strings = getUIStrings(isRTL2 ? "fa" : "en");
238
- const Icon = isRTL2 ? ChevronRightIcon : ChevronLeftIcon;
239
- return /* @__PURE__ */ jsxs(
240
- PaginationLink,
241
- {
242
- "aria-label": strings.goToPreviousPage,
243
- size: "default",
244
- className: cn("gap-1 ps-2.5 pe-2.5 no-underline flex items-center", className),
245
- dir: "ltr",
246
- ...props,
247
- children: [
248
- /* @__PURE__ */ jsx(Icon, { className: "size-4" }),
249
- /* @__PURE__ */ jsx("span", { className: "hidden sm:inline no-underline", children: strings.previous })
250
- ]
251
- }
252
- );
253
- }
254
- function PaginationNext({ className, ...props }) {
255
- const dir = usePaginationDirection();
256
- const isRTL2 = dir === "rtl";
257
- const strings = getUIStrings(isRTL2 ? "fa" : "en");
258
- const Icon = isRTL2 ? ChevronLeftIcon : ChevronRightIcon;
259
- return /* @__PURE__ */ jsx(
260
- PaginationLink,
261
- {
262
- "aria-label": strings.goToNextPage,
263
- size: "default",
264
- className: cn("gap-1 ps-2.5 pe-2.5 no-underline flex items-center", className),
265
- dir: "ltr",
266
- ...props,
267
- children: isRTL2 ? /* @__PURE__ */ jsxs(Fragment, { children: [
268
- /* @__PURE__ */ jsx(Icon, { className: "size-4" }),
269
- /* @__PURE__ */ jsx("span", { className: "hidden sm:inline no-underline", children: strings.next })
270
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
271
- /* @__PURE__ */ jsx("span", { className: "hidden sm:inline no-underline", children: strings.next }),
272
- /* @__PURE__ */ jsx(Icon, { className: "size-4" })
273
- ] })
274
- }
275
- );
276
- }
277
- function PaginationEllipsis({ className, ...props }) {
278
- return /* @__PURE__ */ jsxs(
279
- "span",
280
- {
281
- "aria-hidden": true,
282
- "data-slot": "pagination-ellipsis",
283
- className: cn("flex size-9 items-center justify-center", className),
284
- ...props,
285
- children: [
286
- /* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }),
287
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
288
- ]
289
- }
290
- );
291
- }
292
- Pagination.displayName = "Pagination";
293
- PaginationContent.displayName = "PaginationContent";
294
- PaginationItem.displayName = "PaginationItem";
295
- PaginationLink.displayName = "PaginationLink";
296
- PaginationPrevious.displayName = "PaginationPrevious";
297
- PaginationNext.displayName = "PaginationNext";
298
- PaginationEllipsis.displayName = "PaginationEllipsis";
299
- var PaginationControlled = React5.forwardRef(
300
- ({
301
- currentPage,
302
- totalPages,
303
- onPageChange,
304
- siblingCount = 1,
305
- showFirstLast = false,
306
- showPrevNext = true,
307
- showEllipsis = true,
308
- className,
309
- locale = "fa"
310
- }, ref) => {
311
- const isRTL2 = locale === "fa" || locale === "ar";
312
- const localizeNumber = (n) => convertToLocalNumbers(String(n), locale);
313
- const handlePageChange = (page) => {
314
- if (page >= 1 && page <= totalPages && page !== currentPage) {
315
- onPageChange(page);
316
- }
317
- };
318
- const generatePageNumbers = () => {
319
- const pages = [];
320
- const totalNumbers = siblingCount * 2 + 5;
321
- const totalBlocks = totalNumbers + 2;
322
- if (totalPages <= totalBlocks) {
323
- for (let i = 1; i <= totalPages; i++) {
324
- pages.push(i);
325
- }
326
- } else {
327
- const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
328
- const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages);
329
- const shouldShowLeftEllipsis = leftSiblingIndex > 2;
330
- const shouldShowRightEllipsis = rightSiblingIndex < totalPages - 1;
331
- if (!shouldShowLeftEllipsis && shouldShowRightEllipsis) {
332
- const leftItemCount = 3 + 2 * siblingCount;
333
- const leftRange = [];
334
- for (let i = 1; i <= leftItemCount; i++) {
335
- leftRange.push(i);
336
- }
337
- pages.push(...leftRange);
338
- if (showEllipsis) pages.push("ellipsis");
339
- pages.push(totalPages);
340
- } else if (shouldShowLeftEllipsis && !shouldShowRightEllipsis) {
341
- pages.push(1);
342
- if (showEllipsis) pages.push("ellipsis");
343
- const rightItemCount = 3 + 2 * siblingCount;
344
- const rightRange = [];
345
- for (let i = totalPages - rightItemCount + 1; i <= totalPages; i++) {
346
- rightRange.push(i);
347
- }
348
- pages.push(...rightRange);
349
- } else if (shouldShowLeftEllipsis && shouldShowRightEllipsis) {
350
- pages.push(1);
351
- if (showEllipsis) pages.push("ellipsis");
352
- for (let i = leftSiblingIndex; i <= rightSiblingIndex; i++) {
353
- pages.push(i);
354
- }
355
- if (showEllipsis) pages.push("ellipsis");
356
- pages.push(totalPages);
357
- }
358
- }
359
- return pages;
360
- };
361
- const pageNumbers = generatePageNumbers();
362
- const showFirstButton = showFirstLast && !pageNumbers.includes(1) && currentPage > 1;
363
- const showLastButton = showFirstLast && !pageNumbers.includes(totalPages) && currentPage < totalPages;
364
- return /* @__PURE__ */ jsx(Pagination, { ref, "data-slot": "pagination-controlled", className: cn(className), dir: isRTL2 ? "rtl" : "ltr", children: /* @__PURE__ */ jsxs(PaginationContent, { children: [
365
- showFirstButton && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
366
- PaginationLink,
367
- {
368
- href: "#",
369
- onClick: (e) => {
370
- e.preventDefault();
371
- handlePageChange(1);
372
- },
373
- children: localizeNumber(1)
374
- }
375
- ) }),
376
- showPrevNext && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
377
- PaginationPrevious,
378
- {
379
- href: "#",
380
- onClick: (e) => {
381
- e.preventDefault();
382
- handlePageChange(currentPage - 1);
383
- },
384
- className: currentPage === 1 ? "pointer-events-none opacity-50" : ""
385
- }
386
- ) }),
387
- pageNumbers.map((page, index) => {
388
- if (page === "ellipsis") {
389
- return /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationEllipsis, {}) }, `ellipsis-${index}`);
390
- }
391
- return /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
392
- PaginationLink,
393
- {
394
- href: "#",
395
- isActive: page === currentPage,
396
- onClick: (e) => {
397
- e.preventDefault();
398
- handlePageChange(page);
399
- },
400
- children: localizeNumber(page)
401
- }
402
- ) }, page);
403
- }),
404
- showPrevNext && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
405
- PaginationNext,
406
- {
407
- href: "#",
408
- onClick: (e) => {
409
- e.preventDefault();
410
- handlePageChange(currentPage + 1);
411
- },
412
- className: currentPage === totalPages ? "pointer-events-none opacity-50" : ""
413
- }
414
- ) }),
415
- showLastButton && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
416
- PaginationLink,
417
- {
418
- href: "#",
419
- onClick: (e) => {
420
- e.preventDefault();
421
- handlePageChange(totalPages);
422
- },
423
- children: localizeNumber(totalPages)
424
- }
425
- ) })
426
- ] }) });
427
- }
428
- );
429
- PaginationControlled.displayName = "PaginationControlled";
430
- function useInfiniteScroll({
431
- onLoadMore,
432
- hasMore,
433
- isLoading = false,
434
- rootMargin = "200px",
435
- threshold = 0
436
- }) {
437
- const observerRef = React5.useRef(null);
438
- const callbackRef = React5.useRef(onLoadMore);
439
- React5.useEffect(() => {
440
- callbackRef.current = onLoadMore;
441
- }, [onLoadMore]);
442
- const hasMoreRef = React5.useRef(hasMore);
443
- React5.useEffect(() => {
444
- hasMoreRef.current = hasMore;
445
- }, [hasMore]);
446
- const isLoadingRef = React5.useRef(isLoading);
447
- React5.useEffect(() => {
448
- isLoadingRef.current = isLoading;
449
- }, [isLoading]);
450
- const sentinelRef = React5.useCallback(
451
- (node) => {
452
- if (observerRef.current) {
453
- observerRef.current.disconnect();
454
- observerRef.current = null;
455
- }
456
- if (!node) return;
457
- observerRef.current = new IntersectionObserver(
458
- (entries) => {
459
- const entry = entries[0];
460
- if (entry?.isIntersecting && hasMoreRef.current && !isLoadingRef.current) {
461
- callbackRef.current();
462
- }
463
- },
464
- { rootMargin, threshold }
465
- );
466
- observerRef.current.observe(node);
467
- },
468
- [rootMargin, threshold]
469
- );
470
- React5.useEffect(() => {
471
- return () => {
472
- observerRef.current?.disconnect();
473
- };
474
- }, []);
475
- return { sentinelRef };
476
- }
477
- var spinnerVariants = cva("animate-spin text-muted-foreground", {
478
- variants: {
479
- size: {
480
- xs: "size-3",
481
- sm: "size-4",
482
- md: "size-5",
483
- lg: "size-6",
484
- xl: "size-8"
485
- }
486
- },
487
- defaultVariants: {
488
- size: "sm"
489
- }
490
- });
491
- var Spinner = React5.forwardRef(({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(
492
- "span",
493
- {
494
- ref,
495
- "data-slot": "spinner",
496
- role: "status",
497
- "aria-label": "\u062F\u0631 \u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC...",
498
- className: cn("inline-flex items-center justify-center", className),
499
- ...props,
500
- children: /* @__PURE__ */ jsx(Loader2, { className: spinnerVariants({ size }), "aria-hidden": "true" })
501
- }
502
- ));
503
- Spinner.displayName = "Spinner";
504
- var noop = () => {
505
- };
506
- function DataTableInner({
507
- columns,
508
- data,
509
- size = "md",
510
- isLoading = false,
511
- loadingRows = 5,
512
- emptyState,
513
- pagination,
514
- sort,
515
- multiSort,
516
- footer = false,
517
- stickyFooter = true,
518
- onColumnResize,
519
- selection,
520
- columnVisibility,
521
- expansion,
522
- infiniteScroll,
523
- virtualize,
524
- striped = false,
525
- bordered = false,
526
- stickyHeader = false,
527
- className,
528
- caption,
529
- resultCount,
530
- locale = "fa"
531
- }, ref) {
532
- const t = getUIStrings(locale);
533
- const hasSelection = !!selection;
534
- const hasExpansion = !!expansion;
535
- const rtl = isRTL(locale);
536
- const visibleColumns = React5.useMemo(() => {
537
- return columns.filter((col) => {
538
- const explicit = columnVisibility?.visible[col.id];
539
- if (explicit !== void 0) return explicit;
540
- return col.defaultVisible !== false;
541
- });
542
- }, [columns, columnVisibility]);
543
- const allColumnCount = visibleColumns.length + (hasSelection ? 1 : 0) + (hasExpansion ? 1 : 0);
544
- const getRowKey = React5.useMemo(
545
- () => selection?.getRowKey ?? ((_, index) => index),
546
- [selection?.getRowKey]
547
- );
548
- const allRowKeys = React5.useMemo(() => data.map((row, i) => getRowKey(row, i)), [data, getRowKey]);
549
- const allSelected = hasSelection && data.length > 0 && allRowKeys.every((key) => selection.selectedRows.has(key));
550
- const someSelected = hasSelection && !allSelected && allRowKeys.some((key) => selection.selectedRows.has(key));
551
- const handleSelectAll = () => {
552
- if (!selection) return;
553
- if (allSelected) {
554
- selection.onSelectionChange(/* @__PURE__ */ new Set());
555
- } else {
556
- selection.onSelectionChange(new Set(allRowKeys));
557
- }
558
- };
559
- const handleSelectRow = (key) => {
560
- if (!selection) return;
561
- const next = new Set(selection.selectedRows);
562
- if (next.has(key)) {
563
- next.delete(key);
564
- } else {
565
- next.add(key);
566
- }
567
- selection.onSelectionChange(next);
568
- };
569
- const handleSort = (columnId, e) => {
570
- if (multiSort) {
571
- const isShift = !!e && "shiftKey" in e && e.shiftKey;
572
- const existing = multiSort.rules.find((r) => r.column === columnId);
573
- const maxRules = multiSort.maxRules ?? 3;
574
- let next;
575
- if (!isShift) {
576
- if (existing) {
577
- next = [{ column: columnId, direction: existing.direction === "asc" ? "desc" : "asc" }];
578
- } else {
579
- next = [{ column: columnId, direction: "asc" }];
580
- }
581
- } else {
582
- if (existing) {
583
- if (existing.direction === "asc") {
584
- next = multiSort.rules.map((r) => r.column === columnId ? { ...r, direction: "desc" } : r);
585
- } else {
586
- next = multiSort.rules.filter((r) => r.column !== columnId);
587
- }
588
- } else {
589
- next = [...multiSort.rules, { column: columnId, direction: "asc" }].slice(0, maxRules);
590
- }
591
- }
592
- multiSort.onSortChange(next);
593
- return;
594
- }
595
- if (!sort) return;
596
- const nextDirection = sort.column === columnId && sort.direction === "asc" ? "desc" : "asc";
597
- sort.onSort(columnId, nextDirection);
598
- };
599
- const getSortDir = (columnId) => {
600
- if (multiSort) {
601
- const rule = multiSort.rules.find((r) => r.column === columnId);
602
- return rule ? rule.direction : "none";
603
- }
604
- if (!sort || sort.column !== columnId || !sort.direction) return "none";
605
- return sort.direction;
606
- };
607
- const getSortPriority = (columnId) => {
608
- if (!multiSort) return 0;
609
- const idx = multiSort.rules.findIndex((r) => r.column === columnId);
610
- return idx === -1 ? 0 : idx + 1;
611
- };
612
- const alignClass = (align) => {
613
- if (align === "center") return "text-center";
614
- if (align === "end") return "text-end";
615
- return "text-start";
616
- };
617
- const pinClass = (pinned) => {
618
- if (!pinned) return "";
619
- const sideClass = pinned === "start" ? "sticky inset-inline-start-0 z-[1]" : "sticky inset-inline-end-0 z-[1]";
620
- return `${sideClass} bg-background`;
621
- };
622
- const handleToggleExpand = (rowKey) => {
623
- if (!expansion) return;
624
- const next = new Set(expansion.expandedRows);
625
- if (next.has(rowKey)) next.delete(rowKey);
626
- else next.add(rowKey);
627
- expansion.onExpandedRowsChange(next);
628
- };
629
- const [resizeWidths, setResizeWidths] = React5.useState({});
630
- const dragRef = React5.useRef(null);
631
- const startResize = React5.useCallback(
632
- (columnId, e) => {
633
- const col = columns.find((c) => c.id === columnId);
634
- if (!col) return;
635
- const headerCell = e.currentTarget.closest("th");
636
- const measured = headerCell?.getBoundingClientRect().width || 0;
637
- const startWidth = typeof col.width === "number" ? col.width : measured > 0 ? measured : 120;
638
- dragRef.current = {
639
- columnId,
640
- startX: e.clientX,
641
- startWidth,
642
- currentWidth: startWidth,
643
- minWidth: col.minWidth ?? 60,
644
- maxWidth: col.maxWidth ?? 800
645
- };
646
- e.currentTarget.setPointerCapture?.(e.pointerId);
647
- e.preventDefault();
648
- e.stopPropagation();
649
- },
650
- [columns]
651
- );
652
- const onResizePointerMove = React5.useCallback(
653
- (e) => {
654
- const drag = dragRef.current;
655
- if (!drag) return;
656
- const dx = (rtl ? -1 : 1) * (e.clientX - drag.startX);
657
- const next = Math.max(drag.minWidth, Math.min(drag.maxWidth, drag.startWidth + dx));
658
- drag.currentWidth = next;
659
- setResizeWidths((prev) => prev[drag.columnId] === next ? prev : { ...prev, [drag.columnId]: next });
660
- },
661
- [rtl]
662
- );
663
- const endResize = React5.useCallback(
664
- (e) => {
665
- const drag = dragRef.current;
666
- if (!drag) return;
667
- onColumnResize?.(drag.columnId, drag.currentWidth);
668
- dragRef.current = null;
669
- e.currentTarget.releasePointerCapture?.(e.pointerId);
670
- },
671
- [onColumnResize]
672
- );
673
- const getColumnWidth = (col) => {
674
- return resizeWidths[col.id] ?? col.width;
675
- };
676
- const handleResizeKeyDown = React5.useCallback(
677
- (columnId, e) => {
678
- const isArrowGrow = rtl ? e.key === "ArrowLeft" : e.key === "ArrowRight";
679
- const isArrowShrink = rtl ? e.key === "ArrowRight" : e.key === "ArrowLeft";
680
- if (!isArrowGrow && !isArrowShrink && e.key !== "Home" && e.key !== "End") return;
681
- const col = columns.find((c) => c.id === columnId);
682
- if (!col) return;
683
- const headerCell = e.currentTarget.closest("th");
684
- const measured = headerCell?.getBoundingClientRect().width || 0;
685
- const minWidth = col.minWidth ?? 60;
686
- const maxWidth = col.maxWidth ?? 800;
687
- const current = resizeWidths[columnId] ?? (typeof col.width === "number" ? col.width : measured > 0 ? measured : 120);
688
- const step = e.shiftKey ? 32 : 8;
689
- let next;
690
- if (e.key === "Home") next = minWidth;
691
- else if (e.key === "End") next = maxWidth;
692
- else if (isArrowGrow) next = Math.min(maxWidth, current + step);
693
- else next = Math.max(minWidth, current - step);
694
- e.preventDefault();
695
- setResizeWidths((prev) => prev[columnId] === next ? prev : { ...prev, [columnId]: next });
696
- onColumnResize?.(columnId, next);
697
- },
698
- [columns, resizeWidths, rtl, onColumnResize]
699
- );
700
- const { sentinelRef } = useInfiniteScroll({
701
- onLoadMore: infiniteScroll?.onLoadMore ?? noop,
702
- hasMore: !!infiniteScroll?.hasMore,
703
- isLoading: !!infiniteScroll?.isLoadingMore,
704
- rootMargin: infiniteScroll?.rootMargin ?? "200px"
705
- });
706
- const virtRowHeight = virtualize?.rowHeight ?? 0;
707
- const virtViewportHeight = virtualize?.viewportHeight ?? 480;
708
- const virtOverscan = virtualize?.overscan ?? 6;
709
- const virtScrollRef = React5.useRef(null);
710
- const [virtScrollTop, setVirtScrollTop] = React5.useState(0);
711
- const handleVirtScroll = React5.useCallback((e) => {
712
- setVirtScrollTop(e.currentTarget.scrollTop);
713
- }, []);
714
- const { virtStartIndex, virtEndIndex, virtTopSpacer, virtBottomSpacer } = React5.useMemo(() => {
715
- if (!virtualize || data.length === 0) {
716
- return { virtStartIndex: 0, virtEndIndex: data.length, virtTopSpacer: 0, virtBottomSpacer: 0 };
717
- }
718
- const start = Math.max(0, Math.floor(virtScrollTop / virtRowHeight) - virtOverscan);
719
- const visibleCount = Math.ceil(virtViewportHeight / virtRowHeight) + virtOverscan * 2;
720
- const end = Math.min(data.length, start + visibleCount);
721
- return {
722
- virtStartIndex: start,
723
- virtEndIndex: end,
724
- virtTopSpacer: start * virtRowHeight,
725
- virtBottomSpacer: (data.length - end) * virtRowHeight
726
- };
727
- }, [virtualize, data.length, virtScrollTop, virtRowHeight, virtViewportHeight, virtOverscan]);
728
- return /* @__PURE__ */ jsxs("div", { ref, "data-slot": "data-table", className: cn("flex flex-col gap-4", className), children: [
729
- resultCount && /* @__PURE__ */ jsx("div", { "data-slot": "data-table-result-count", className: "text-sm text-foreground-muted", children: resultCount }),
730
- /* @__PURE__ */ jsx(
731
- "div",
732
- {
733
- ref: virtualize ? virtScrollRef : void 0,
734
- onScroll: virtualize ? handleVirtScroll : void 0,
735
- style: virtualize ? { maxHeight: virtViewportHeight, overflowY: "auto" } : void 0,
736
- "data-slot": virtualize ? "data-table-virtual-scroll" : void 0,
737
- children: /* @__PURE__ */ jsxs(Table, { size, striped, bordered, stickyHeader: stickyHeader || !!virtualize, children: [
738
- caption && /* @__PURE__ */ jsx("caption", { className: "text-foreground-muted mt-4 text-sm", children: caption }),
739
- /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
740
- hasSelection && /* @__PURE__ */ jsx(TableHead, { className: cn("w-[40px]", pinClass("start")), children: /* @__PURE__ */ jsx(
741
- Checkbox,
742
- {
743
- checked: allSelected ? true : someSelected ? "indeterminate" : false,
744
- onCheckedChange: handleSelectAll,
745
- "aria-label": t.selectAll
746
- }
747
- ) }),
748
- hasExpansion && /* @__PURE__ */ jsx(TableHead, { className: cn("w-[36px]", pinClass("start")), "aria-hidden": "true" }),
749
- visibleColumns.map((col) => {
750
- const sortable = col.sortable && (sort || multiSort);
751
- const dir = sortable ? getSortDir(col.id) : "none";
752
- const priority = getSortPriority(col.id);
753
- const liveWidth = getColumnWidth(col);
754
- return /* @__PURE__ */ jsxs(
755
- TableHead,
756
- {
757
- sortDirection: sortable ? dir : void 0,
758
- className: cn("relative", alignClass(col.align), pinClass(col.pinned), col.className),
759
- style: liveWidth ? { width: liveWidth } : void 0,
760
- children: [
761
- sortable ? /* @__PURE__ */ jsx(
762
- TableSortHeader,
763
- {
764
- sorted: dir === "none" ? false : dir,
765
- onClick: (e) => handleSort(col.id, e),
766
- children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
767
- col.header,
768
- priority > 0 && multiSort && multiSort.rules.length > 1 && /* @__PURE__ */ jsx(
769
- "span",
770
- {
771
- "data-slot": "data-table-sort-priority",
772
- className: "inline-flex h-4 min-w-4 items-center justify-center rounded bg-overlay-active px-1 text-[10px] font-medium tabular-nums text-foreground-light",
773
- "aria-label": `\u0627\u0648\u0644\u0648\u06CC\u062A \u0645\u0631\u062A\u0628\u200C\u0633\u0627\u0632\u06CC ${priority}`,
774
- children: priority
775
- }
776
- )
777
- ] })
778
- }
779
- ) : col.header,
780
- col.resizable && // role="separator" + tabIndex + ArrowKey handler is the
781
- // WAI-ARIA windowsplitter pattern (resizable separator).
782
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
783
- /* @__PURE__ */ jsx(
784
- "div",
785
- {
786
- "data-slot": "data-table-resize-handle",
787
- role: "separator",
788
- "aria-orientation": "vertical",
789
- "aria-label": "\u062A\u063A\u06CC\u06CC\u0631 \u0627\u0646\u062F\u0627\u0632\u0647 \u0633\u062A\u0648\u0646",
790
- tabIndex: 0,
791
- "aria-valuenow": getColumnWidth(col),
792
- "aria-valuemin": col.minWidth ?? 60,
793
- "aria-valuemax": col.maxWidth ?? 800,
794
- onKeyDown: (e) => handleResizeKeyDown(col.id, e),
795
- onPointerDown: (e) => startResize(col.id, e),
796
- onPointerMove: onResizePointerMove,
797
- onPointerUp: endResize,
798
- onPointerCancel: endResize,
799
- className: cn(
800
- "absolute inset-block-0 inset-inline-end-0 w-1.5 cursor-col-resize select-none touch-none",
801
- "before:absolute before:inset-block-2 before:inset-inline-1/2 before:w-px before:-translate-x-1/2 before:bg-border-default before:opacity-0 before:transition-opacity",
802
- "hover:before:opacity-100 focus:before:opacity-100 focus-visible:outline-none focus-visible:before:!bg-brand focus-visible:before:opacity-100",
803
- dragRef.current?.columnId === col.id && "before:!bg-brand before:opacity-100"
804
- )
805
- }
806
- )
807
- ]
808
- },
809
- col.id
810
- );
811
- })
812
- ] }) }),
813
- /* @__PURE__ */ jsxs(TableBody, { children: [
814
- virtualize && !isLoading && data.length > 0 && virtTopSpacer > 0 && /* @__PURE__ */ jsx("tr", { "aria-hidden": "true", "data-slot": "data-table-virtual-spacer-top", children: /* @__PURE__ */ jsx("td", { colSpan: allColumnCount, style: { height: virtTopSpacer, padding: 0 } }) }),
815
- isLoading ? Array.from({ length: loadingRows }).map((_, rowIdx) => /* @__PURE__ */ jsxs(TableRow, { children: [
816
- hasSelection && /* @__PURE__ */ jsx(TableCell, { className: pinClass("start"), children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4" }) }),
817
- hasExpansion && /* @__PURE__ */ jsx(TableCell, { className: pinClass("start"), children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4" }) }),
818
- visibleColumns.map((col) => {
819
- const liveWidth = getColumnWidth(col);
820
- return /* @__PURE__ */ jsx(
821
- TableCell,
822
- {
823
- className: cn(alignClass(col.align), pinClass(col.pinned), col.className),
824
- style: liveWidth ? { width: liveWidth } : void 0,
825
- children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full max-w-[120px]" })
826
- },
827
- col.id
828
- );
829
- })
830
- ] }, `skeleton-${rowIdx}`)) : data.length === 0 ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: allColumnCount, children: emptyState || /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-10 text-foreground-muted text-sm", children: t.noDataToDisplay }) }) }) : (virtualize ? data.slice(virtStartIndex, virtEndIndex) : data).map((row, sliceIdx) => {
831
- const rowIdx = virtualize ? virtStartIndex + sliceIdx : sliceIdx;
832
- const rowKey = getRowKey(row, rowIdx);
833
- const isSelected = hasSelection && selection.selectedRows.has(rowKey);
834
- const isExpanded = hasExpansion && expansion.expandedRows.has(rowKey);
835
- const ChevronIcon = ChevronRight;
836
- return /* @__PURE__ */ jsxs(React5.Fragment, { children: [
837
- /* @__PURE__ */ jsxs(TableRow, { "data-state": isSelected ? "selected" : void 0, children: [
838
- hasSelection && /* @__PURE__ */ jsx(TableCell, { className: pinClass("start"), children: /* @__PURE__ */ jsx(
839
- Checkbox,
840
- {
841
- checked: isSelected,
842
- onCheckedChange: () => handleSelectRow(rowKey),
843
- "aria-label": `${t.selectRow} ${(rowIdx + 1).toLocaleString(locale === "fa" ? "fa-IR" : locale === "ar" ? "ar-SA" : "en-US")}`
844
- }
845
- ) }),
846
- hasExpansion && /* @__PURE__ */ jsx(TableCell, { className: pinClass("start"), children: /* @__PURE__ */ jsx(
847
- "button",
848
- {
849
- type: "button",
850
- "aria-label": isExpanded ? "collapse" : "expand",
851
- "aria-expanded": isExpanded,
852
- onClick: () => handleToggleExpand(rowKey),
853
- className: "inline-flex size-6 items-center justify-center rounded text-foreground-lighter hover:bg-surface-100 hover:text-foreground transition-colors",
854
- children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "size-4", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronIcon, { className: cn("size-4", rtl && "rotate-180"), "aria-hidden": "true" })
855
- }
856
- ) }),
857
- visibleColumns.map((col) => {
858
- const liveWidth = getColumnWidth(col);
859
- return /* @__PURE__ */ jsx(
860
- TableCell,
861
- {
862
- className: cn(alignClass(col.align), pinClass(col.pinned), col.className),
863
- style: liveWidth ? { width: liveWidth } : void 0,
864
- children: col.cell(row, rowIdx)
865
- },
866
- col.id
867
- );
868
- })
869
- ] }),
870
- hasExpansion && isExpanded && /* @__PURE__ */ jsx(TableRow, { "data-slot": "data-table-expanded-row", children: /* @__PURE__ */ jsx(TableCell, { colSpan: allColumnCount, className: "bg-surface-100/50 border-t-0", children: expansion.renderExpandedRow(row, rowIdx) }) })
871
- ] }, rowKey);
872
- }),
873
- virtualize && !isLoading && data.length > 0 && virtBottomSpacer > 0 && /* @__PURE__ */ jsx("tr", { "aria-hidden": "true", "data-slot": "data-table-virtual-spacer-bottom", children: /* @__PURE__ */ jsx("td", { colSpan: allColumnCount, style: { height: virtBottomSpacer, padding: 0 } }) }),
874
- infiniteScroll && !isLoading && data.length > 0 && infiniteScroll.hasMore && /* @__PURE__ */ jsx("tr", { "data-slot": "data-table-infinite-sentinel", "aria-hidden": !infiniteScroll.isLoadingMore, children: /* @__PURE__ */ jsx(
875
- "td",
876
- {
877
- ref: sentinelRef,
878
- colSpan: allColumnCount,
879
- className: "border-0",
880
- children: infiniteScroll.isLoadingMore ? infiniteScroll.loadingMoreContent ?? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-3 text-sm text-foreground-lighter", children: [
881
- /* @__PURE__ */ jsx(Spinner, { size: "sm" }),
882
- /* @__PURE__ */ jsx("span", { children: t.loading ?? "\u062F\u0631 \u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC" })
883
- ] }) : /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "h-px" })
884
- }
885
- ) }),
886
- infiniteScroll && !isLoading && data.length > 0 && !infiniteScroll.hasMore && infiniteScroll.endContent && /* @__PURE__ */ jsx("tr", { "data-slot": "data-table-infinite-end", children: /* @__PURE__ */ jsx("td", { colSpan: allColumnCount, className: "border-0 py-3 text-center text-xs text-foreground-lighter", children: infiniteScroll.endContent }) })
887
- ] }),
888
- footer && visibleColumns.some((c) => !!c.footer) && !isLoading && data.length > 0 && /* @__PURE__ */ jsx(
889
- "tfoot",
890
- {
891
- "data-slot": "data-table-footer",
892
- "data-sticky": stickyFooter || void 0,
893
- className: cn(
894
- "bg-surface-75 border-t border-border-default font-medium",
895
- stickyFooter && "[&>tr>td]:sticky [&>tr>td]:inset-block-end-0 [&>tr>td]:bg-surface-75 [&>tr>td]:z-[8]"
896
- ),
897
- children: /* @__PURE__ */ jsxs("tr", { children: [
898
- hasSelection && /* @__PURE__ */ jsx("td", { className: pinClass("start"), "aria-hidden": "true" }),
899
- hasExpansion && /* @__PURE__ */ jsx("td", { className: pinClass("start"), "aria-hidden": "true" }),
900
- visibleColumns.map((col) => {
901
- const liveWidth = getColumnWidth(col);
902
- return /* @__PURE__ */ jsx(
903
- "td",
904
- {
905
- className: cn(
906
- alignClass(col.align),
907
- pinClass(col.pinned),
908
- col.className,
909
- "[[data-size=sm]_&]:px-2 [[data-size=sm]_&]:py-1.5 [[data-size=sm]_&]:text-xs",
910
- "[[data-size=md]_&]:px-3 [[data-size=md]_&]:py-2 [[data-size=md]_&]:text-sm",
911
- "[[data-size=lg]_&]:px-4 [[data-size=lg]_&]:py-3 [[data-size=lg]_&]:text-base"
912
- ),
913
- style: liveWidth ? { width: liveWidth } : void 0,
914
- children: col.footer ? col.footer() : null
915
- },
916
- col.id
917
- );
918
- })
919
- ] })
920
- }
921
- )
922
- ] })
923
- }
924
- ),
925
- pagination && pagination.totalPages > 1 && /* @__PURE__ */ jsx("div", { "data-slot": "data-table-pagination", className: "flex justify-center", children: /* @__PURE__ */ jsx(
926
- PaginationControlled,
927
- {
928
- currentPage: pagination.currentPage,
929
- totalPages: pagination.totalPages,
930
- onPageChange: pagination.onPageChange
931
- }
932
- ) })
933
- ] });
934
- }
935
- var DataTable = React5.forwardRef(DataTableInner);
936
- DataTable.displayName = "DataTable";
937
-
938
- export { DataTable, Pagination, PaginationContent, PaginationControlled, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Spinner, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TableSortHeader, spinnerVariants, useInfiniteScroll };
939
- //# sourceMappingURL=chunk-GCZ6YATL.js.map
940
- //# sourceMappingURL=chunk-GCZ6YATL.js.map