@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.
- package/dist/components/brand/parto-logo.cjs +130 -0
- package/dist/components/brand/parto-logo.cjs.map +1 -0
- package/dist/components/brand/parto-logo.d.cts +38 -0
- package/dist/components/brand/parto-logo.d.ts +38 -0
- package/dist/components/brand/parto-logo.js +108 -0
- package/dist/components/brand/parto-logo.js.map +1 -0
- package/dist/components/charts/PartoAreaChart.cjs +579 -7
- package/dist/components/charts/PartoAreaChart.cjs.map +1 -1
- package/dist/components/charts/PartoAreaChart.js +564 -4
- package/dist/components/charts/PartoAreaChart.js.map +1 -1
- package/dist/components/charts/PartoBarChart.cjs +616 -7
- package/dist/components/charts/PartoBarChart.cjs.map +1 -1
- package/dist/components/charts/PartoBarChart.js +601 -4
- package/dist/components/charts/PartoBarChart.js.map +1 -1
- package/dist/components/charts/PartoLineChart.cjs +584 -7
- package/dist/components/charts/PartoLineChart.cjs.map +1 -1
- package/dist/components/charts/PartoLineChart.js +569 -4
- package/dist/components/charts/PartoLineChart.js.map +1 -1
- package/dist/components/charts/PartoPieChart.cjs +566 -7
- package/dist/components/charts/PartoPieChart.cjs.map +1 -1
- package/dist/components/charts/PartoPieChart.js +551 -4
- package/dist/components/charts/PartoPieChart.js.map +1 -1
- package/dist/components/ui/accordion.cjs +97 -0
- package/dist/components/ui/accordion.cjs.map +1 -0
- package/dist/components/ui/accordion.d.cts +22 -0
- package/dist/components/ui/accordion.d.ts +22 -0
- package/dist/components/ui/accordion.js +72 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/{chunk-MMC6M35Q.cjs → components/ui/alert-dialog.cjs} +216 -22
- package/dist/components/ui/alert-dialog.cjs.map +1 -0
- package/dist/components/ui/alert-dialog.d.cts +17 -0
- package/dist/components/ui/alert-dialog.d.ts +17 -0
- package/dist/{chunk-3QYYPPFJ.js → components/ui/alert-dialog.js} +175 -10
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert-rule-card.cjs +289 -8
- package/dist/components/ui/alert-rule-card.cjs.map +1 -1
- package/dist/components/ui/alert-rule-card.d.cts +1 -1
- package/dist/components/ui/alert-rule-card.d.ts +1 -1
- package/dist/components/ui/alert-rule-card.js +271 -4
- package/dist/components/ui/alert-rule-card.js.map +1 -1
- package/dist/components/ui/alert.cjs +81 -0
- package/dist/components/ui/alert.cjs.map +1 -0
- package/dist/components/ui/alert.d.cts +11 -0
- package/dist/components/ui/alert.d.ts +11 -0
- package/dist/components/ui/alert.js +57 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/app-bar.cjs +67 -0
- package/dist/components/ui/app-bar.cjs.map +1 -0
- package/dist/components/ui/app-bar.d.cts +22 -0
- package/dist/components/ui/app-bar.d.ts +22 -0
- package/dist/components/ui/app-bar.js +44 -0
- package/dist/components/ui/app-bar.js.map +1 -0
- package/dist/components/ui/avatar.cjs +66 -14
- package/dist/components/ui/avatar.cjs.map +1 -1
- package/dist/components/ui/avatar.js +47 -2
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.cjs +113 -9
- package/dist/components/ui/badge.cjs.map +1 -1
- package/dist/components/ui/badge.d.cts +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/badge.js +96 -2
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.cjs +100 -0
- package/dist/components/ui/breadcrumb.cjs.map +1 -0
- package/dist/components/ui/breadcrumb.d.cts +35 -0
- package/dist/components/ui/breadcrumb.d.ts +35 -0
- package/dist/components/ui/breadcrumb.js +92 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button.cjs +304 -11
- package/dist/components/ui/button.cjs.map +1 -1
- package/dist/components/ui/button.d.cts +3 -3
- package/dist/components/ui/button.d.ts +3 -3
- package/dist/components/ui/button.js +306 -3
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.cjs +401 -8
- package/dist/components/ui/calendar.cjs.map +1 -1
- package/dist/components/ui/calendar.js +404 -4
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.cjs +154 -30
- package/dist/components/ui/card.cjs.map +1 -1
- package/dist/components/ui/card.js +131 -2
- package/dist/components/ui/card.js.map +1 -1
- package/dist/{chunk-CAJKSTXX.cjs → components/ui/checkbox.cjs} +10 -5
- package/dist/components/ui/checkbox.cjs.map +1 -0
- package/dist/components/ui/checkbox.d.cts +6 -0
- package/dist/components/ui/checkbox.d.ts +6 -0
- package/dist/{chunk-5JJSRGJD.js → components/ui/checkbox.js} +9 -4
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/concept-card.cjs +728 -11
- package/dist/components/ui/concept-card.cjs.map +1 -1
- package/dist/components/ui/concept-card.d.cts +2 -2
- package/dist/components/ui/concept-card.d.ts +2 -2
- package/dist/components/ui/concept-card.js +710 -7
- package/dist/components/ui/concept-card.js.map +1 -1
- package/dist/components/ui/data-table.cjs +1553 -10
- package/dist/components/ui/data-table.cjs.map +1 -1
- package/dist/components/ui/data-table.js +1537 -7
- package/dist/components/ui/data-table.js.map +1 -1
- package/dist/components/ui/dialog.cjs +119 -42
- package/dist/components/ui/dialog.cjs.map +1 -1
- package/dist/components/ui/dialog.js +92 -2
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu.cjs +268 -0
- package/dist/components/ui/dropdown-menu.cjs.map +1 -0
- package/dist/components/ui/dropdown-menu.d.cts +73 -0
- package/dist/components/ui/dropdown-menu.d.ts +73 -0
- package/dist/components/ui/dropdown-menu.js +232 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/filter-provider.cjs +70 -13
- package/dist/components/ui/filter-provider.cjs.map +1 -1
- package/dist/components/ui/filter-provider.js +51 -1
- package/dist/components/ui/filter-provider.js.map +1 -1
- package/dist/components/ui/form.cjs +169 -0
- package/dist/components/ui/form.cjs.map +1 -0
- package/dist/components/ui/form.d.cts +46 -0
- package/dist/components/ui/form.d.ts +46 -0
- package/dist/components/ui/form.js +139 -0
- package/dist/components/ui/form.js.map +1 -0
- package/dist/components/ui/input.cjs +135 -15
- package/dist/components/ui/input.cjs.map +1 -1
- package/dist/components/ui/input.d.cts +15 -0
- package/dist/components/ui/input.d.ts +15 -0
- package/dist/components/ui/input.js +116 -3
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/iran-province-heat.cjs +328 -5
- package/dist/components/ui/iran-province-heat.cjs.map +1 -1
- package/dist/components/ui/iran-province-heat.js +312 -2
- package/dist/components/ui/iran-province-heat.js.map +1 -1
- package/dist/components/ui/label.cjs +52 -0
- package/dist/components/ui/label.cjs.map +1 -0
- package/dist/components/ui/label.d.cts +10 -0
- package/dist/components/ui/label.d.ts +10 -0
- package/dist/components/ui/label.js +30 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/page-card.cjs +627 -8
- package/dist/components/ui/page-card.cjs.map +1 -1
- package/dist/components/ui/page-card.d.cts +3 -2
- package/dist/components/ui/page-card.d.ts +3 -2
- package/dist/components/ui/page-card.js +611 -5
- package/dist/components/ui/page-card.js.map +1 -1
- package/dist/components/ui/page-header.cjs +299 -0
- package/dist/components/ui/page-header.cjs.map +1 -0
- package/dist/components/ui/page-header.d.cts +21 -0
- package/dist/components/ui/page-header.d.ts +21 -0
- package/dist/components/ui/page-header.js +277 -0
- package/dist/components/ui/page-header.js.map +1 -0
- package/dist/components/ui/password-input.cjs +168 -0
- package/dist/components/ui/password-input.cjs.map +1 -0
- package/dist/components/ui/password-input.d.cts +48 -0
- package/dist/components/ui/password-input.d.ts +48 -0
- package/dist/components/ui/password-input.js +146 -0
- package/dist/components/ui/password-input.js.map +1 -0
- package/dist/components/ui/popover.cjs +51 -18
- package/dist/components/ui/popover.cjs.map +1 -1
- package/dist/components/ui/popover.js +30 -2
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.cjs +95 -0
- package/dist/components/ui/progress.cjs.map +1 -0
- package/dist/components/ui/progress.d.cts +18 -0
- package/dist/components/ui/progress.d.ts +18 -0
- package/dist/components/ui/progress.js +72 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-card.cjs +84 -0
- package/dist/components/ui/radio-card.cjs.map +1 -0
- package/dist/components/ui/radio-card.d.cts +12 -0
- package/dist/components/ui/radio-card.d.ts +12 -0
- package/dist/components/ui/radio-card.js +58 -0
- package/dist/components/ui/radio-card.js.map +1 -0
- package/dist/components/ui/radio-group.cjs +62 -0
- package/dist/components/ui/radio-group.cjs.map +1 -0
- package/dist/components/ui/radio-group.d.cts +7 -0
- package/dist/components/ui/radio-group.d.ts +7 -0
- package/dist/components/ui/radio-group.js +38 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/saved-query-card.cjs +409 -7
- package/dist/components/ui/saved-query-card.cjs.map +1 -1
- package/dist/components/ui/saved-query-card.js +394 -4
- package/dist/components/ui/saved-query-card.js.map +1 -1
- package/dist/components/ui/scroll-area.cjs +79 -0
- package/dist/components/ui/scroll-area.cjs.map +1 -0
- package/dist/components/ui/scroll-area.d.cts +14 -0
- package/dist/components/ui/scroll-area.d.ts +14 -0
- package/dist/components/ui/scroll-area.js +56 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.cjs +242 -0
- package/dist/components/ui/select.cjs.map +1 -0
- package/dist/components/ui/select.d.cts +29 -0
- package/dist/components/ui/select.d.ts +29 -0
- package/dist/components/ui/select.js +210 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.cjs +105 -6
- package/dist/components/ui/separator.cjs.map +1 -1
- package/dist/components/ui/separator.js +87 -2
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.cjs +134 -38
- package/dist/components/ui/sheet.cjs.map +1 -1
- package/dist/components/ui/sheet.js +109 -2
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/{chunk-D2EBLE2B.cjs → components/ui/skeleton.cjs} +21 -16
- package/dist/components/ui/skeleton.cjs.map +1 -0
- package/dist/components/ui/skeleton.d.cts +90 -0
- package/dist/components/ui/skeleton.d.ts +90 -0
- package/dist/{chunk-SB5DSYR5.js → components/ui/skeleton.js} +8 -3
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.cjs +129 -0
- package/dist/components/ui/slider.cjs.map +1 -0
- package/dist/components/ui/slider.d.cts +10 -0
- package/dist/components/ui/slider.d.ts +10 -0
- package/dist/components/ui/slider.js +107 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/social-platform-badge.cjs +120 -0
- package/dist/components/ui/social-platform-badge.cjs.map +1 -0
- package/dist/components/ui/social-platform-badge.d.cts +21 -0
- package/dist/components/ui/social-platform-badge.d.ts +21 -0
- package/dist/components/ui/social-platform-badge.js +97 -0
- package/dist/components/ui/social-platform-badge.js.map +1 -0
- package/dist/components/ui/sonner.cjs +51 -0
- package/dist/components/ui/sonner.cjs.map +1 -0
- package/dist/components/ui/sonner.d.cts +13 -0
- package/dist/components/ui/sonner.d.ts +13 -0
- package/dist/components/ui/sonner.js +45 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/sparkline.cjs +159 -6
- package/dist/components/ui/sparkline.cjs.map +1 -1
- package/dist/components/ui/sparkline.js +142 -2
- package/dist/components/ui/sparkline.js.map +1 -1
- package/dist/components/ui/switch.cjs +96 -0
- package/dist/components/ui/switch.cjs.map +1 -0
- package/dist/components/ui/switch.d.cts +13 -0
- package/dist/components/ui/switch.d.ts +13 -0
- package/dist/components/ui/switch.js +73 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.cjs +188 -0
- package/dist/components/ui/table.cjs.map +1 -0
- package/dist/components/ui/table.d.cts +59 -0
- package/dist/components/ui/table.d.ts +59 -0
- package/dist/components/ui/table.js +178 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.cjs +140 -0
- package/dist/components/ui/tabs.cjs.map +1 -0
- package/dist/components/ui/tabs.d.cts +21 -0
- package/dist/components/ui/tabs.d.ts +21 -0
- package/dist/components/ui/tabs.js +115 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.cjs +56 -0
- package/dist/components/ui/textarea.cjs.map +1 -0
- package/dist/components/ui/textarea.d.cts +5 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.js +34 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toggle-group.cjs +123 -0
- package/dist/components/ui/toggle-group.cjs.map +1 -0
- package/dist/components/ui/toggle-group.d.cts +7 -0
- package/dist/components/ui/toggle-group.d.ts +7 -0
- package/dist/components/ui/toggle-group.js +99 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/tooltip.cjs +77 -18
- package/dist/components/ui/tooltip.cjs.map +1 -1
- package/dist/components/ui/tooltip.js +56 -2
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/{concept-card-RwPbqJ06.d.cts → concept-card-BXra9mr0.d.cts} +2 -2
- package/dist/{concept-card-CcOBb2Nz.d.ts → concept-card-BoJ5gIJD.d.ts} +2 -2
- package/dist/hooks/use-hotkey-registry.cjs +201 -14
- package/dist/hooks/use-hotkey-registry.cjs.map +1 -1
- package/dist/hooks/use-hotkey-registry.js +182 -2
- package/dist/hooks/use-hotkey-registry.js.map +1 -1
- package/dist/hooks/use-hotkeys.cjs +144 -9
- package/dist/hooks/use-hotkeys.cjs.map +1 -1
- package/dist/hooks/use-hotkeys.js +126 -1
- package/dist/hooks/use-hotkeys.js.map +1 -1
- package/dist/{i18n-CAd9wGOr.d.cts → i18n-BfRhV5aw.d.cts} +5 -3
- package/dist/{i18n-ArS3mqj0.d.ts → i18n-ewyqbKM-.d.ts} +5 -3
- package/dist/index.cjs +20906 -15706
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +396 -69
- package/dist/index.d.cts +49 -490
- package/dist/index.d.ts +49 -490
- package/dist/index.js +7704 -2032
- package/dist/index.js.map +1 -1
- package/dist/{page-card-CmShVqG-.d.cts → page-card-C9XXXOVr.d.cts} +3 -20
- package/dist/{page-card-HBn-cy4J.d.ts → page-card-DAnbez_f.d.ts} +3 -20
- package/dist/toggle-group-B8r4LOQw.d.cts +26 -0
- package/dist/toggle-group-B8r4LOQw.d.ts +26 -0
- package/package.json +132 -2
- package/tailwind.config.ts +45 -0
- package/dist/chunk-2ACKKPWA.cjs +0 -112
- package/dist/chunk-2ACKKPWA.cjs.map +0 -1
- package/dist/chunk-2UD3LGVX.cjs +0 -316
- package/dist/chunk-2UD3LGVX.cjs.map +0 -1
- package/dist/chunk-3QYYPPFJ.js.map +0 -1
- package/dist/chunk-4SVQNEVH.js +0 -173
- package/dist/chunk-4SVQNEVH.js.map +0 -1
- package/dist/chunk-4WONHORR.cjs +0 -152
- package/dist/chunk-4WONHORR.cjs.map +0 -1
- package/dist/chunk-5HCXH6GS.js +0 -409
- package/dist/chunk-5HCXH6GS.js.map +0 -1
- package/dist/chunk-5JJSRGJD.js.map +0 -1
- package/dist/chunk-5K6E4ZSW.cjs +0 -77
- package/dist/chunk-5K6E4ZSW.cjs.map +0 -1
- package/dist/chunk-5NY26ULO.js +0 -89
- package/dist/chunk-5NY26ULO.js.map +0 -1
- package/dist/chunk-7RVPG3LE.cjs +0 -231
- package/dist/chunk-7RVPG3LE.cjs.map +0 -1
- package/dist/chunk-AYEK3WOM.js +0 -207
- package/dist/chunk-AYEK3WOM.js.map +0 -1
- package/dist/chunk-BRMBLIQG.js +0 -53
- package/dist/chunk-BRMBLIQG.js.map +0 -1
- package/dist/chunk-CAJKSTXX.cjs.map +0 -1
- package/dist/chunk-CKFWMHQU.js +0 -401
- package/dist/chunk-CKFWMHQU.js.map +0 -1
- package/dist/chunk-CV3N3HVK.js +0 -672
- package/dist/chunk-CV3N3HVK.js.map +0 -1
- package/dist/chunk-D2EBLE2B.cjs.map +0 -1
- package/dist/chunk-GCZ6YATL.js +0 -940
- package/dist/chunk-GCZ6YATL.js.map +0 -1
- package/dist/chunk-GKRAZGDI.cjs +0 -84
- package/dist/chunk-GKRAZGDI.cjs.map +0 -1
- package/dist/chunk-GPYJ66CG.js +0 -45
- package/dist/chunk-GPYJ66CG.js.map +0 -1
- package/dist/chunk-HF6XU5NI.js +0 -84
- package/dist/chunk-HF6XU5NI.js.map +0 -1
- package/dist/chunk-HJPDZOMJ.cjs +0 -87
- package/dist/chunk-HJPDZOMJ.cjs.map +0 -1
- package/dist/chunk-HS3XI3CC.cjs +0 -69
- package/dist/chunk-HS3XI3CC.cjs.map +0 -1
- package/dist/chunk-HUCC3QH5.cjs +0 -53
- package/dist/chunk-HUCC3QH5.cjs.map +0 -1
- package/dist/chunk-HYZ6BQPS.cjs +0 -425
- package/dist/chunk-HYZ6BQPS.cjs.map +0 -1
- package/dist/chunk-ISCSZMYW.cjs +0 -106
- package/dist/chunk-ISCSZMYW.cjs.map +0 -1
- package/dist/chunk-IXFEFIDO.js +0 -82
- package/dist/chunk-IXFEFIDO.js.map +0 -1
- package/dist/chunk-JCJLN437.js +0 -108
- package/dist/chunk-JCJLN437.js.map +0 -1
- package/dist/chunk-JMKNNH63.cjs +0 -982
- package/dist/chunk-JMKNNH63.cjs.map +0 -1
- package/dist/chunk-JUBHQAA2.js +0 -53
- package/dist/chunk-JUBHQAA2.js.map +0 -1
- package/dist/chunk-K6G63EED.cjs +0 -41
- package/dist/chunk-K6G63EED.cjs.map +0 -1
- package/dist/chunk-KCWRCSI7.js +0 -62
- package/dist/chunk-KCWRCSI7.js.map +0 -1
- package/dist/chunk-KYM7NIJO.cjs +0 -433
- package/dist/chunk-KYM7NIJO.cjs.map +0 -1
- package/dist/chunk-L2L5CKC2.js +0 -291
- package/dist/chunk-L2L5CKC2.js.map +0 -1
- package/dist/chunk-M5CHZ5BA.js +0 -124
- package/dist/chunk-M5CHZ5BA.js.map +0 -1
- package/dist/chunk-MEK4RSGC.js +0 -65
- package/dist/chunk-MEK4RSGC.js.map +0 -1
- package/dist/chunk-MEKWH3GS.js +0 -89
- package/dist/chunk-MEKWH3GS.js.map +0 -1
- package/dist/chunk-MFTX2DDQ.js +0 -27
- package/dist/chunk-MFTX2DDQ.js.map +0 -1
- package/dist/chunk-MMC6M35Q.cjs.map +0 -1
- package/dist/chunk-NMH43BDC.js +0 -130
- package/dist/chunk-NMH43BDC.js.map +0 -1
- package/dist/chunk-NORDUD2T.cjs +0 -135
- package/dist/chunk-NORDUD2T.cjs.map +0 -1
- package/dist/chunk-NV4JOKWL.cjs +0 -197
- package/dist/chunk-NV4JOKWL.cjs.map +0 -1
- package/dist/chunk-O2JG7WY5.cjs +0 -121
- package/dist/chunk-O2JG7WY5.cjs.map +0 -1
- package/dist/chunk-ONO2FTV4.cjs +0 -68
- package/dist/chunk-ONO2FTV4.cjs.map +0 -1
- package/dist/chunk-OQB6HIUL.cjs +0 -108
- package/dist/chunk-OQB6HIUL.cjs.map +0 -1
- package/dist/chunk-OS6CMYAS.cjs +0 -79
- package/dist/chunk-OS6CMYAS.cjs.map +0 -1
- package/dist/chunk-PYURPUTV.js +0 -402
- package/dist/chunk-PYURPUTV.js.map +0 -1
- package/dist/chunk-RJ3HYZ7S.js +0 -44
- package/dist/chunk-RJ3HYZ7S.js.map +0 -1
- package/dist/chunk-RZNRIOLT.js +0 -128
- package/dist/chunk-RZNRIOLT.js.map +0 -1
- package/dist/chunk-S3T2L6NA.js +0 -38
- package/dist/chunk-S3T2L6NA.js.map +0 -1
- package/dist/chunk-S5IPJQZ3.cjs +0 -161
- package/dist/chunk-S5IPJQZ3.cjs.map +0 -1
- package/dist/chunk-SB5DSYR5.js.map +0 -1
- package/dist/chunk-SFXV2DUH.js +0 -106
- package/dist/chunk-SFXV2DUH.js.map +0 -1
- package/dist/chunk-SXEPGD4Z.cjs +0 -152
- package/dist/chunk-SXEPGD4Z.cjs.map +0 -1
- package/dist/chunk-SXWSOU3Y.js +0 -89
- package/dist/chunk-SXWSOU3Y.js.map +0 -1
- package/dist/chunk-SZMVOHT7.cjs +0 -107
- package/dist/chunk-SZMVOHT7.cjs.map +0 -1
- package/dist/chunk-TWJXOV4C.js +0 -145
- package/dist/chunk-TWJXOV4C.js.map +0 -1
- package/dist/chunk-U3ADRIVO.cjs +0 -434
- package/dist/chunk-U3ADRIVO.cjs.map +0 -1
- package/dist/chunk-U5FLLCGC.cjs +0 -151
- package/dist/chunk-U5FLLCGC.cjs.map +0 -1
- package/dist/chunk-UOZN45G4.cjs +0 -130
- package/dist/chunk-UOZN45G4.cjs.map +0 -1
- package/dist/chunk-VHLDOG74.cjs +0 -167
- package/dist/chunk-VHLDOG74.cjs.map +0 -1
- package/dist/chunk-YC5KLN6I.js +0 -139
- package/dist/chunk-YC5KLN6I.js.map +0 -1
- package/dist/chunk-YENXXYUV.cjs +0 -111
- package/dist/chunk-YENXXYUV.cjs.map +0 -1
- package/dist/chunk-YFQWC2PW.js +0 -113
- package/dist/chunk-YFQWC2PW.js.map +0 -1
- package/dist/chunk-Z2TY4A75.cjs +0 -700
- package/dist/chunk-Z2TY4A75.cjs.map +0 -1
- package/dist/chunk-Z56O7UEU.cjs +0 -136
- package/dist/chunk-Z56O7UEU.cjs.map +0 -1
- package/dist/chunk-ZBZDR4ZC.js +0 -106
- package/dist/chunk-ZBZDR4ZC.js.map +0 -1
|
@@ -1,9 +1,1539 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
3
|
-
import '
|
|
4
|
-
import '
|
|
5
|
-
import '
|
|
6
|
-
import '
|
|
7
|
-
import '
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React6 from 'react';
|
|
3
|
+
import { forwardRef, cloneElement, isValidElement } from 'react';
|
|
4
|
+
import { CheckIcon, Loader2, ChevronRightIcon, ChevronLeftIcon, MoreHorizontalIcon, ChevronDown, ChevronRight } from 'lucide-react';
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
8
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
|
+
import { cva } from 'class-variance-authority';
|
|
10
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
11
|
+
|
|
12
|
+
function cn(...inputs) {
|
|
13
|
+
return twMerge(clsx(inputs));
|
|
14
|
+
}
|
|
15
|
+
function convertToLocalNumbers(text, locale) {
|
|
16
|
+
if (locale === "fa" || locale === "ar") {
|
|
17
|
+
const persianDigits = ["\u06F0", "\u06F1", "\u06F2", "\u06F3", "\u06F4", "\u06F5", "\u06F6", "\u06F7", "\u06F8", "\u06F9"];
|
|
18
|
+
return String(text).replace(/\d/g, (digit) => persianDigits[parseInt(digit)]);
|
|
19
|
+
}
|
|
20
|
+
return String(text);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// src/lib/i18n.ts
|
|
24
|
+
function isRTL(locale) {
|
|
25
|
+
return locale === "fa" || locale === "ar";
|
|
26
|
+
}
|
|
27
|
+
var UI_STRINGS = {
|
|
28
|
+
fa: {
|
|
29
|
+
// Autocomplete
|
|
30
|
+
noResults: "\u0646\u062A\u06CC\u062C\u0647\u200C\u0627\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F",
|
|
31
|
+
suggestions: "\u067E\u06CC\u0634\u0646\u0647\u0627\u062F\u0647\u0627",
|
|
32
|
+
// MultiSelect
|
|
33
|
+
select: "\u0627\u0646\u062A\u062E\u0627\u0628 \u06A9\u0646\u06CC\u062F",
|
|
34
|
+
noOptionsFound: "\u0645\u0648\u0631\u062F\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F",
|
|
35
|
+
search: "\u062C\u0633\u062A\u062C\u0648...",
|
|
36
|
+
clearAll: "\u067E\u0627\u06A9 \u06A9\u0631\u062F\u0646 \u0647\u0645\u0647",
|
|
37
|
+
// DatePicker / DateRangePicker
|
|
38
|
+
selectDate: "\u0627\u0646\u062A\u062E\u0627\u0628 \u062A\u0627\u0631\u06CC\u062E",
|
|
39
|
+
selectDateRange: "\u0627\u0646\u062A\u062E\u0627\u0628 \u0628\u0627\u0632\u0647 \u062A\u0627\u0631\u06CC\u062E",
|
|
40
|
+
// ErrorState
|
|
41
|
+
errorLoadingData: "\u062E\u0637\u0627 \u062F\u0631 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u062F\u0627\u062F\u0647\u200C\u0647\u0627",
|
|
42
|
+
retry: "\u062A\u0644\u0627\u0634 \u0645\u062C\u062F\u062F",
|
|
43
|
+
// FilterChip
|
|
44
|
+
remove: "\u062D\u0630\u0641",
|
|
45
|
+
// UserAutocomplete
|
|
46
|
+
noUsersFound: "\u06A9\u0627\u0631\u0628\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F",
|
|
47
|
+
// Pagination
|
|
48
|
+
goToPreviousPage: "\u0631\u0641\u062A\u0646 \u0628\u0647 \u0635\u0641\u062D\u0647 \u0642\u0628\u0644\u06CC",
|
|
49
|
+
goToNextPage: "\u0631\u0641\u062A\u0646 \u0628\u0647 \u0635\u0641\u062D\u0647 \u0628\u0639\u062F\u06CC",
|
|
50
|
+
previous: "\u0642\u0628\u0644\u06CC",
|
|
51
|
+
next: "\u0628\u0639\u062F\u06CC",
|
|
52
|
+
// ProfileInfo
|
|
53
|
+
actions: "\u0639\u0645\u0644\u06CC\u0627\u062A",
|
|
54
|
+
// CopyButton
|
|
55
|
+
copy: "\u06A9\u067E\u06CC",
|
|
56
|
+
copied: "\u06A9\u067E\u06CC \u0634\u062F",
|
|
57
|
+
// ConfirmDialog
|
|
58
|
+
confirm: "\u062A\u0627\u06CC\u06CC\u062F",
|
|
59
|
+
cancel: "\u0627\u0646\u0635\u0631\u0627\u0641",
|
|
60
|
+
areYouSure: "\u0622\u06CC\u0627 \u0645\u0637\u0645\u0626\u0646 \u0647\u0633\u062A\u06CC\u062F\u061F",
|
|
61
|
+
// Stepper
|
|
62
|
+
stepperLabel: "\u0645\u0631\u0627\u062D\u0644",
|
|
63
|
+
stepCompleted: "\u062A\u06A9\u0645\u06CC\u0644 \u0634\u062F\u0647",
|
|
64
|
+
stepCurrent: "\u0645\u0631\u062D\u0644\u0647 \u0641\u0639\u0644\u06CC",
|
|
65
|
+
stepPending: "\u062F\u0631 \u0627\u0646\u062A\u0638\u0627\u0631",
|
|
66
|
+
// FilterBar / FilterPanel
|
|
67
|
+
clearFilters: "\u067E\u0627\u06A9 \u06A9\u0631\u062F\u0646 \u0641\u06CC\u0644\u062A\u0631\u0647\u0627",
|
|
68
|
+
activeFilters: "\u0641\u06CC\u0644\u062A\u0631\u0647\u0627\u06CC \u0641\u0639\u0627\u0644",
|
|
69
|
+
filters: "\u0641\u06CC\u0644\u062A\u0631\u0647\u0627",
|
|
70
|
+
applyFilters: "\u0627\u0639\u0645\u0627\u0644",
|
|
71
|
+
resetFilters: "\u067E\u06CC\u0634\u200C\u0641\u0631\u0636",
|
|
72
|
+
noFiltersActive: "\u0641\u06CC\u0644\u062A\u0631 \u0641\u0639\u0627\u0644\u06CC \u0646\u06CC\u0633\u062A",
|
|
73
|
+
clearSection: "\u067E\u0627\u06A9 \u06A9\u0631\u062F\u0646 \u0627\u06CC\u0646 \u0628\u062E\u0634",
|
|
74
|
+
// PageHeader
|
|
75
|
+
goBack: "\u0628\u0627\u0632\u06AF\u0634\u062A",
|
|
76
|
+
// ViewToggle
|
|
77
|
+
gridView: "\u0646\u0645\u0627\u06CC \u0634\u0628\u06A9\u0647\u200C\u0627\u06CC",
|
|
78
|
+
listView: "\u0646\u0645\u0627\u06CC \u0644\u06CC\u0633\u062A\u06CC",
|
|
79
|
+
// PageLoader
|
|
80
|
+
loading: "\u062F\u0631 \u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC...",
|
|
81
|
+
// ErrorBoundary
|
|
82
|
+
unexpectedError: "\u062E\u0637\u0627\u06CC \u063A\u06CC\u0631\u0645\u0646\u062A\u0638\u0631\u0647\u200C\u0627\u06CC \u0631\u062E \u062F\u0627\u062F",
|
|
83
|
+
// DataTable
|
|
84
|
+
selectAll: "\u0627\u0646\u062A\u062E\u0627\u0628 \u0647\u0645\u0647",
|
|
85
|
+
selectRow: "\u0627\u0646\u062A\u062E\u0627\u0628 \u0631\u062F\u06CC\u0641",
|
|
86
|
+
noDataToDisplay: "\u062F\u0627\u062F\u0647\u200C\u0627\u06CC \u0628\u0631\u0627\u06CC \u0646\u0645\u0627\u06CC\u0634 \u0648\u062C\u0648\u062F \u0646\u062F\u0627\u0631\u062F",
|
|
87
|
+
// InstagramPost
|
|
88
|
+
likesCount: "\u062A\u0639\u062F\u0627\u062F \u0644\u0627\u06CC\u06A9",
|
|
89
|
+
commentsCount: "\u062A\u0639\u062F\u0627\u062F \u06A9\u0627\u0645\u0646\u062A",
|
|
90
|
+
viewsCount: "\u062A\u0639\u062F\u0627\u062F \u0628\u0627\u0632\u062F\u06CC\u062F",
|
|
91
|
+
sharesCount: "\u062A\u0639\u062F\u0627\u062F \u0627\u0634\u062A\u0631\u0627\u06A9",
|
|
92
|
+
postTypeLabel: "\u0646\u0648\u0639 \u067E\u0633\u062A",
|
|
93
|
+
postTypePhoto: "\u0639\u06A9\u0633",
|
|
94
|
+
postTypeVideo: "\u0648\u06CC\u062F\u06CC\u0648",
|
|
95
|
+
postTypeCarousel: "\u0627\u0633\u0644\u0627\u06CC\u062F",
|
|
96
|
+
showMore: "\u0628\u06CC\u0634\u062A\u0631",
|
|
97
|
+
showLess: "\u06A9\u0645\u062A\u0631",
|
|
98
|
+
noMediaAvailable: "\u0631\u0633\u0627\u0646\u0647\u200C\u0627\u06CC \u0645\u0648\u062C\u0648\u062F \u0646\u06CC\u0633\u062A",
|
|
99
|
+
commentAnalysis: "\u062A\u062D\u0644\u06CC\u0644 \u06A9\u0627\u0645\u0646\u062A\u200C\u0647\u0627",
|
|
100
|
+
commentAnalysisDisabled: "\u062A\u062D\u0644\u06CC\u0644 \u06A9\u0627\u0645\u0646\u062A\u200C\u0647\u0627 (\u063A\u06CC\u0631\u0641\u0639\u0627\u0644)",
|
|
101
|
+
booster: "\u0628\u0648\u0633\u062A\u0631",
|
|
102
|
+
boosterDisabled: "\u0628\u0648\u0633\u062A\u0631 (\u063A\u06CC\u0631\u0641\u0639\u0627\u0644)",
|
|
103
|
+
aiAnalysis: "\u062A\u062D\u0644\u06CC\u0644 \u0647\u0648\u0634 \u0645\u0635\u0646\u0648\u0639\u06CC",
|
|
104
|
+
aiAnalysisDisabled: "\u062A\u062D\u0644\u06CC\u0644 \u0647\u0648\u0634 \u0645\u0635\u0646\u0648\u0639\u06CC (\u063A\u06CC\u0631\u0641\u0639\u0627\u0644)",
|
|
105
|
+
openOnInstagram: "\u0628\u0627\u0632 \u06A9\u0631\u062F\u0646 \u062F\u0631 \u0627\u06CC\u0646\u0633\u062A\u0627\u06AF\u0631\u0627\u0645",
|
|
106
|
+
openOnInstagramDisabled: "\u0628\u0627\u0632 \u06A9\u0631\u062F\u0646 \u062F\u0631 \u0627\u06CC\u0646\u0633\u062A\u0627\u06AF\u0631\u0627\u0645 (\u063A\u06CC\u0631\u0641\u0639\u0627\u0644)"
|
|
107
|
+
},
|
|
108
|
+
ar: {
|
|
109
|
+
noResults: "\u0644\u0645 \u064A\u062A\u0645 \u0627\u0644\u0639\u062B\u0648\u0631 \u0639\u0644\u0649 \u0646\u062A\u0627\u0626\u062C",
|
|
110
|
+
suggestions: "\u0627\u0642\u062A\u0631\u0627\u062D\u0627\u062A",
|
|
111
|
+
select: "\u0627\u062E\u062A\u0631",
|
|
112
|
+
noOptionsFound: "\u0644\u0645 \u064A\u062A\u0645 \u0627\u0644\u0639\u062B\u0648\u0631 \u0639\u0644\u0649 \u062E\u064A\u0627\u0631\u0627\u062A",
|
|
113
|
+
search: "\u0628\u062D\u062B...",
|
|
114
|
+
clearAll: "\u0645\u0633\u062D \u0627\u0644\u0643\u0644",
|
|
115
|
+
selectDate: "\u0627\u062E\u062A\u0631 \u062A\u0627\u0631\u064A\u062E",
|
|
116
|
+
selectDateRange: "\u0627\u062E\u062A\u0631 \u0646\u0637\u0627\u0642 \u0627\u0644\u062A\u0627\u0631\u064A\u062E",
|
|
117
|
+
errorLoadingData: "\u062E\u0637\u0623 \u0641\u064A \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0628\u064A\u0627\u0646\u0627\u062A",
|
|
118
|
+
retry: "\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",
|
|
119
|
+
remove: "\u062D\u0630\u0641",
|
|
120
|
+
noUsersFound: "\u0644\u0645 \u064A\u062A\u0645 \u0627\u0644\u0639\u062B\u0648\u0631 \u0639\u0644\u0649 \u0645\u0633\u062A\u062E\u062F\u0645\u064A\u0646",
|
|
121
|
+
goToPreviousPage: "\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0635\u0641\u062D\u0629 \u0627\u0644\u0633\u0627\u0628\u0642\u0629",
|
|
122
|
+
goToNextPage: "\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0635\u0641\u062D\u0629 \u0627\u0644\u062A\u0627\u0644\u064A\u0629",
|
|
123
|
+
previous: "\u0627\u0644\u0633\u0627\u0628\u0642",
|
|
124
|
+
next: "\u0627\u0644\u062A\u0627\u0644\u064A",
|
|
125
|
+
actions: "\u0625\u062C\u0631\u0627\u0621\u0627\u062A",
|
|
126
|
+
// CopyButton
|
|
127
|
+
copy: "\u0646\u0633\u062E",
|
|
128
|
+
copied: "\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",
|
|
129
|
+
// ConfirmDialog
|
|
130
|
+
confirm: "\u062A\u0623\u0643\u064A\u062F",
|
|
131
|
+
cancel: "\u0625\u0644\u063A\u0627\u0621",
|
|
132
|
+
areYouSure: "\u0647\u0644 \u0623\u0646\u062A \u0645\u062A\u0623\u0643\u062F\u061F",
|
|
133
|
+
// Stepper
|
|
134
|
+
stepperLabel: "\u0627\u0644\u062E\u0637\u0648\u0627\u062A",
|
|
135
|
+
stepCompleted: "\u0645\u0643\u062A\u0645\u0644",
|
|
136
|
+
stepCurrent: "\u0627\u0644\u062E\u0637\u0648\u0629 \u0627\u0644\u062D\u0627\u0644\u064A\u0629",
|
|
137
|
+
stepPending: "\u0642\u064A\u062F \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631",
|
|
138
|
+
// FilterBar / FilterPanel
|
|
139
|
+
clearFilters: "\u0645\u0633\u062D \u0627\u0644\u0641\u0644\u0627\u062A\u0631",
|
|
140
|
+
activeFilters: "\u0627\u0644\u0641\u0644\u0627\u062A\u0631 \u0627\u0644\u0646\u0634\u0637\u0629",
|
|
141
|
+
filters: "\u0627\u0644\u0641\u0644\u0627\u062A\u0631",
|
|
142
|
+
applyFilters: "\u062A\u0637\u0628\u064A\u0642",
|
|
143
|
+
resetFilters: "\u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A",
|
|
144
|
+
noFiltersActive: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0641\u0644\u0627\u062A\u0631 \u0646\u0634\u0637\u0629",
|
|
145
|
+
clearSection: "\u0645\u0633\u062D \u0647\u0630\u0627 \u0627\u0644\u0642\u0633\u0645",
|
|
146
|
+
// PageHeader
|
|
147
|
+
goBack: "\u0631\u062C\u0648\u0639",
|
|
148
|
+
// ViewToggle
|
|
149
|
+
gridView: "\u0639\u0631\u0636 \u0634\u0628\u0643\u064A",
|
|
150
|
+
listView: "\u0639\u0631\u0636 \u0642\u0627\u0626\u0645\u0629",
|
|
151
|
+
// PageLoader
|
|
152
|
+
loading: "\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644...",
|
|
153
|
+
// ErrorBoundary
|
|
154
|
+
unexpectedError: "\u062D\u062F\u062B \u062E\u0637\u0623 \u063A\u064A\u0631 \u0645\u062A\u0648\u0642\u0639",
|
|
155
|
+
// DataTable
|
|
156
|
+
selectAll: "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644",
|
|
157
|
+
selectRow: "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0635\u0641",
|
|
158
|
+
noDataToDisplay: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0628\u064A\u0627\u0646\u0627\u062A \u0644\u0644\u0639\u0631\u0636",
|
|
159
|
+
// InstagramPost
|
|
160
|
+
likesCount: "\u0639\u062F\u062F \u0627\u0644\u0625\u0639\u062C\u0627\u0628\u0627\u062A",
|
|
161
|
+
commentsCount: "\u0639\u062F\u062F \u0627\u0644\u062A\u0639\u0644\u064A\u0642\u0627\u062A",
|
|
162
|
+
viewsCount: "\u0639\u062F\u062F \u0627\u0644\u0645\u0634\u0627\u0647\u062F\u0627\u062A",
|
|
163
|
+
sharesCount: "\u0639\u062F\u062F \u0627\u0644\u0645\u0634\u0627\u0631\u0643\u0627\u062A",
|
|
164
|
+
postTypeLabel: "\u0646\u0648\u0639 \u0627\u0644\u0645\u0646\u0634\u0648\u0631",
|
|
165
|
+
postTypePhoto: "\u0635\u0648\u0631\u0629",
|
|
166
|
+
postTypeVideo: "\u0641\u064A\u062F\u064A\u0648",
|
|
167
|
+
postTypeCarousel: "\u0634\u0631\u0627\u0626\u062D",
|
|
168
|
+
showMore: "\u0627\u0644\u0645\u0632\u064A\u062F",
|
|
169
|
+
showLess: "\u0623\u0642\u0644",
|
|
170
|
+
noMediaAvailable: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0648\u0633\u0627\u0626\u0637",
|
|
171
|
+
commentAnalysis: "\u062A\u062D\u0644\u064A\u0644 \u0627\u0644\u062A\u0639\u0644\u064A\u0642\u0627\u062A",
|
|
172
|
+
commentAnalysisDisabled: "\u062A\u062D\u0644\u064A\u0644 \u0627\u0644\u062A\u0639\u0644\u064A\u0642\u0627\u062A (\u0645\u0639\u0637\u0644)",
|
|
173
|
+
booster: "\u062A\u0639\u0632\u064A\u0632",
|
|
174
|
+
boosterDisabled: "\u062A\u0639\u0632\u064A\u0632 (\u0645\u0639\u0637\u0644)",
|
|
175
|
+
aiAnalysis: "\u062A\u062D\u0644\u064A\u0644 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",
|
|
176
|
+
aiAnalysisDisabled: "\u062A\u062D\u0644\u064A\u0644 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A (\u0645\u0639\u0637\u0644)",
|
|
177
|
+
openOnInstagram: "\u0641\u062A\u062D \u0641\u064A \u0625\u0646\u0633\u062A\u0627\u062C\u0631\u0627\u0645",
|
|
178
|
+
openOnInstagramDisabled: "\u0641\u062A\u062D \u0641\u064A \u0625\u0646\u0633\u062A\u0627\u062C\u0631\u0627\u0645 (\u0645\u0639\u0637\u0644)"
|
|
179
|
+
},
|
|
180
|
+
en: {
|
|
181
|
+
noResults: "No results found",
|
|
182
|
+
suggestions: "Suggestions",
|
|
183
|
+
select: "Select",
|
|
184
|
+
noOptionsFound: "No options found",
|
|
185
|
+
search: "Search...",
|
|
186
|
+
clearAll: "Clear all",
|
|
187
|
+
selectDate: "Select date",
|
|
188
|
+
selectDateRange: "Select date range",
|
|
189
|
+
errorLoadingData: "Error loading data",
|
|
190
|
+
retry: "Retry",
|
|
191
|
+
remove: "Remove",
|
|
192
|
+
noUsersFound: "No users found",
|
|
193
|
+
goToPreviousPage: "Go to previous page",
|
|
194
|
+
goToNextPage: "Go to next page",
|
|
195
|
+
previous: "Previous",
|
|
196
|
+
next: "Next",
|
|
197
|
+
actions: "Actions",
|
|
198
|
+
// CopyButton
|
|
199
|
+
copy: "Copy",
|
|
200
|
+
copied: "Copied",
|
|
201
|
+
// ConfirmDialog
|
|
202
|
+
confirm: "Confirm",
|
|
203
|
+
cancel: "Cancel",
|
|
204
|
+
areYouSure: "Are you sure?",
|
|
205
|
+
// Stepper
|
|
206
|
+
stepperLabel: "Steps",
|
|
207
|
+
stepCompleted: "Completed",
|
|
208
|
+
stepCurrent: "Current step",
|
|
209
|
+
stepPending: "Pending",
|
|
210
|
+
// FilterBar / FilterPanel
|
|
211
|
+
clearFilters: "Clear filters",
|
|
212
|
+
activeFilters: "Active filters",
|
|
213
|
+
filters: "Filters",
|
|
214
|
+
applyFilters: "Apply",
|
|
215
|
+
resetFilters: "Reset",
|
|
216
|
+
noFiltersActive: "No active filters",
|
|
217
|
+
clearSection: "Clear this section",
|
|
218
|
+
// PageHeader
|
|
219
|
+
goBack: "Go back",
|
|
220
|
+
// ViewToggle
|
|
221
|
+
gridView: "Grid view",
|
|
222
|
+
listView: "List view",
|
|
223
|
+
// PageLoader
|
|
224
|
+
loading: "Loading...",
|
|
225
|
+
// ErrorBoundary
|
|
226
|
+
unexpectedError: "An unexpected error occurred",
|
|
227
|
+
// DataTable
|
|
228
|
+
selectAll: "Select all",
|
|
229
|
+
selectRow: "Select row",
|
|
230
|
+
noDataToDisplay: "No data to display",
|
|
231
|
+
// InstagramPost
|
|
232
|
+
likesCount: "Likes",
|
|
233
|
+
commentsCount: "Comments",
|
|
234
|
+
viewsCount: "Views",
|
|
235
|
+
sharesCount: "Shares",
|
|
236
|
+
postTypeLabel: "Post type",
|
|
237
|
+
postTypePhoto: "Photo",
|
|
238
|
+
postTypeVideo: "Video",
|
|
239
|
+
postTypeCarousel: "Carousel",
|
|
240
|
+
showMore: "More",
|
|
241
|
+
showLess: "Less",
|
|
242
|
+
noMediaAvailable: "No media available",
|
|
243
|
+
commentAnalysis: "Comment Analysis",
|
|
244
|
+
commentAnalysisDisabled: "Comment Analysis (disabled)",
|
|
245
|
+
booster: "Booster",
|
|
246
|
+
boosterDisabled: "Booster (disabled)",
|
|
247
|
+
aiAnalysis: "AI Analysis",
|
|
248
|
+
aiAnalysisDisabled: "AI Analysis (disabled)",
|
|
249
|
+
openOnInstagram: "Open on Instagram",
|
|
250
|
+
openOnInstagramDisabled: "Open on Instagram (disabled)"
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
function getUIStrings(locale = "fa") {
|
|
254
|
+
return UI_STRINGS[locale] ?? UI_STRINGS.fa;
|
|
255
|
+
}
|
|
256
|
+
var Checkbox = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
257
|
+
CheckboxPrimitive.Root,
|
|
258
|
+
{
|
|
259
|
+
ref,
|
|
260
|
+
"data-slot": "checkbox",
|
|
261
|
+
className: cn(
|
|
262
|
+
"peer border-control bg-control data-[state=checked]:bg-brand data-[state=checked]:text-on-brand data-[state=checked]:border-brand focus-visible:border-brand-default focus-visible:ring-brand-default/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-all duration-150 outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
263
|
+
className
|
|
264
|
+
),
|
|
265
|
+
...props,
|
|
266
|
+
children: /* @__PURE__ */ jsx(
|
|
267
|
+
CheckboxPrimitive.Indicator,
|
|
268
|
+
{
|
|
269
|
+
"data-slot": "checkbox-indicator",
|
|
270
|
+
className: "grid place-content-center text-current transition-none",
|
|
271
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" })
|
|
272
|
+
}
|
|
273
|
+
)
|
|
274
|
+
}
|
|
275
|
+
));
|
|
276
|
+
Checkbox.displayName = "Checkbox";
|
|
277
|
+
var skeletonVariants = cva("bg-accent animate-pulse", {
|
|
278
|
+
variants: {
|
|
279
|
+
shape: {
|
|
280
|
+
rect: "rounded-md",
|
|
281
|
+
line: "rounded-full h-4 w-full",
|
|
282
|
+
circle: "rounded-full",
|
|
283
|
+
text: "rounded h-4"
|
|
284
|
+
},
|
|
285
|
+
size: {
|
|
286
|
+
sm: "",
|
|
287
|
+
md: "",
|
|
288
|
+
lg: ""
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
compoundVariants: [
|
|
292
|
+
{ shape: "circle", size: "sm", class: "size-8" },
|
|
293
|
+
{ shape: "circle", size: "md", class: "size-10" },
|
|
294
|
+
{ shape: "circle", size: "lg", class: "size-14" }
|
|
295
|
+
],
|
|
296
|
+
defaultVariants: {
|
|
297
|
+
shape: "rect",
|
|
298
|
+
size: "md"
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
function Skeleton({ className, shape, size, count, ...props }) {
|
|
302
|
+
if (count && count > 1) {
|
|
303
|
+
return /* @__PURE__ */ jsx("div", { role: "status", "aria-busy": "true", "aria-label": "Loading", className: "space-y-2", children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsx(
|
|
304
|
+
"div",
|
|
305
|
+
{
|
|
306
|
+
"data-slot": "skeleton",
|
|
307
|
+
"aria-hidden": "true",
|
|
308
|
+
className: cn(skeletonVariants({ shape, size }), className)
|
|
309
|
+
},
|
|
310
|
+
i
|
|
311
|
+
)) });
|
|
312
|
+
}
|
|
313
|
+
return /* @__PURE__ */ jsx(
|
|
314
|
+
"div",
|
|
315
|
+
{
|
|
316
|
+
"data-slot": "skeleton",
|
|
317
|
+
role: "status",
|
|
318
|
+
"aria-busy": "true",
|
|
319
|
+
"aria-label": "Loading",
|
|
320
|
+
...props,
|
|
321
|
+
className: cn(skeletonVariants({ shape, size }), className)
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
Skeleton.displayName = "Skeleton";
|
|
326
|
+
function Table({
|
|
327
|
+
className,
|
|
328
|
+
size = "md",
|
|
329
|
+
striped = false,
|
|
330
|
+
bordered = false,
|
|
331
|
+
stickyHeader = false,
|
|
332
|
+
...props
|
|
333
|
+
}) {
|
|
334
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: /* @__PURE__ */ jsx(
|
|
335
|
+
"table",
|
|
336
|
+
{
|
|
337
|
+
"data-slot": "table",
|
|
338
|
+
"data-size": size,
|
|
339
|
+
"data-striped": striped || void 0,
|
|
340
|
+
"data-bordered": bordered || void 0,
|
|
341
|
+
"data-sticky-header": stickyHeader || void 0,
|
|
342
|
+
className: cn("w-full caption-bottom", className),
|
|
343
|
+
...props
|
|
344
|
+
}
|
|
345
|
+
) });
|
|
346
|
+
}
|
|
347
|
+
function TableHeader({ className, ...props }) {
|
|
348
|
+
return /* @__PURE__ */ jsx(
|
|
349
|
+
"thead",
|
|
350
|
+
{
|
|
351
|
+
"data-slot": "table-header",
|
|
352
|
+
className: cn(
|
|
353
|
+
// 1.1.16 — internal row dividers use --border-muted (subtle), same
|
|
354
|
+
// rationale as Card. The page-level rule of thumb: borders that
|
|
355
|
+
// separate sections of one surface should whisper, not shout.
|
|
356
|
+
"[&_tr]:border-b [&_tr]:border-muted bg-surface-75",
|
|
357
|
+
"[[data-sticky-header]_&]:sticky [[data-sticky-header]_&]:top-0 [[data-sticky-header]_&]:z-[9] [[data-sticky-header]_&]:bg-surface-75",
|
|
358
|
+
className
|
|
359
|
+
),
|
|
360
|
+
...props
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
function TableBody({ className, ...props }) {
|
|
365
|
+
return /* @__PURE__ */ jsx(
|
|
366
|
+
"tbody",
|
|
367
|
+
{
|
|
368
|
+
"data-slot": "table-body",
|
|
369
|
+
className: cn(
|
|
370
|
+
"[&_tr:last-child]:border-0",
|
|
371
|
+
"[[data-striped]_&_tr:nth-child(even)]:bg-surface-75 [[data-striped]_&_tr:nth-child(even):hover]:bg-surface-200",
|
|
372
|
+
className
|
|
373
|
+
),
|
|
374
|
+
...props
|
|
375
|
+
}
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
function TableRow({ className, ...props }) {
|
|
379
|
+
return /* @__PURE__ */ jsx(
|
|
380
|
+
"tr",
|
|
381
|
+
{
|
|
382
|
+
"data-slot": "table-row",
|
|
383
|
+
className: cn(
|
|
384
|
+
"hover:bg-surface-200 data-[state=selected]:bg-selection border-b border-muted transition-colors",
|
|
385
|
+
className
|
|
386
|
+
),
|
|
387
|
+
...props
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
function TableHead({ className, sortDirection, ...props }) {
|
|
392
|
+
const ariaSort = sortDirection === "asc" ? "ascending" : sortDirection === "desc" ? "descending" : sortDirection === "none" ? "none" : void 0;
|
|
393
|
+
return /* @__PURE__ */ jsx(
|
|
394
|
+
"th",
|
|
395
|
+
{
|
|
396
|
+
"data-slot": "table-head",
|
|
397
|
+
"aria-sort": ariaSort,
|
|
398
|
+
className: cn(
|
|
399
|
+
"text-foreground-lighter text-start align-middle font-semibold whitespace-nowrap [&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
400
|
+
// Size variants (inherited from parent table)
|
|
401
|
+
"[[data-size=sm]_&]:h-8 [[data-size=sm]_&]:px-2 [[data-size=sm]_&]:text-xs",
|
|
402
|
+
"[[data-size=md]_&]:h-10 [[data-size=md]_&]:px-3 [[data-size=md]_&]:text-sm",
|
|
403
|
+
"[[data-size=lg]_&]:h-12 [[data-size=lg]_&]:px-4 [[data-size=lg]_&]:text-base",
|
|
404
|
+
// Bordered variant
|
|
405
|
+
"[[data-bordered]_&]:border [[data-bordered]_&]:border-border",
|
|
406
|
+
className
|
|
407
|
+
),
|
|
408
|
+
...props
|
|
409
|
+
}
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
function TableCell({ className, ...props }) {
|
|
413
|
+
return /* @__PURE__ */ jsx(
|
|
414
|
+
"td",
|
|
415
|
+
{
|
|
416
|
+
"data-slot": "table-cell",
|
|
417
|
+
className: cn(
|
|
418
|
+
"align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
419
|
+
// Size variants (inherited from parent table)
|
|
420
|
+
"[[data-size=sm]_&]:px-2 [[data-size=sm]_&]:py-1.5 [[data-size=sm]_&]:text-xs",
|
|
421
|
+
"[[data-size=md]_&]:px-3 [[data-size=md]_&]:py-2 [[data-size=md]_&]:text-sm",
|
|
422
|
+
"[[data-size=lg]_&]:px-4 [[data-size=lg]_&]:py-3 [[data-size=lg]_&]:text-base",
|
|
423
|
+
// Bordered variant
|
|
424
|
+
"[[data-bordered]_&]:border [[data-bordered]_&]:border-border",
|
|
425
|
+
className
|
|
426
|
+
),
|
|
427
|
+
...props
|
|
428
|
+
}
|
|
429
|
+
);
|
|
430
|
+
}
|
|
431
|
+
function TableSortHeader({ className, children, sorted, ...props }) {
|
|
432
|
+
return /* @__PURE__ */ jsxs(
|
|
433
|
+
"button",
|
|
434
|
+
{
|
|
435
|
+
"data-slot": "table-sort-header",
|
|
436
|
+
className: cn(
|
|
437
|
+
"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",
|
|
438
|
+
sorted && "text-foreground",
|
|
439
|
+
className
|
|
440
|
+
),
|
|
441
|
+
...props,
|
|
442
|
+
children: [
|
|
443
|
+
children,
|
|
444
|
+
/* @__PURE__ */ jsxs("span", { className: "inline-flex flex-col -space-y-0.5", children: [
|
|
445
|
+
/* @__PURE__ */ jsx(
|
|
446
|
+
"svg",
|
|
447
|
+
{
|
|
448
|
+
width: "8",
|
|
449
|
+
height: "5",
|
|
450
|
+
viewBox: "0 0 8 5",
|
|
451
|
+
className: cn("transition-colors", sorted === "asc" ? "text-foreground" : "text-foreground-muted"),
|
|
452
|
+
children: /* @__PURE__ */ jsx("path", { d: "M4 0L8 5H0L4 0Z", fill: "currentColor" })
|
|
453
|
+
}
|
|
454
|
+
),
|
|
455
|
+
/* @__PURE__ */ jsx(
|
|
456
|
+
"svg",
|
|
457
|
+
{
|
|
458
|
+
width: "8",
|
|
459
|
+
height: "5",
|
|
460
|
+
viewBox: "0 0 8 5",
|
|
461
|
+
className: cn("transition-colors", sorted === "desc" ? "text-foreground" : "text-foreground-muted"),
|
|
462
|
+
children: /* @__PURE__ */ jsx("path", { d: "M4 5L0 0H8L4 5Z", fill: "currentColor" })
|
|
463
|
+
}
|
|
464
|
+
)
|
|
465
|
+
] })
|
|
466
|
+
]
|
|
467
|
+
}
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
Table.displayName = "Table";
|
|
471
|
+
TableHeader.displayName = "TableHeader";
|
|
472
|
+
TableBody.displayName = "TableBody";
|
|
473
|
+
TableHead.displayName = "TableHead";
|
|
474
|
+
TableRow.displayName = "TableRow";
|
|
475
|
+
TableCell.displayName = "TableCell";
|
|
476
|
+
TableSortHeader.displayName = "TableSortHeader";
|
|
477
|
+
|
|
478
|
+
// src/lib/constants.ts
|
|
479
|
+
var SIZE = {
|
|
480
|
+
text: {
|
|
481
|
+
xs: "text-xs",
|
|
482
|
+
sm: "text-sm leading-4",
|
|
483
|
+
md: "text-sm",
|
|
484
|
+
lg: "text-base",
|
|
485
|
+
xl: "text-base"
|
|
486
|
+
},
|
|
487
|
+
padding: {
|
|
488
|
+
xs: "px-2.5 py-1",
|
|
489
|
+
sm: "px-3 py-2",
|
|
490
|
+
md: "px-4 py-2",
|
|
491
|
+
lg: "px-4 py-2",
|
|
492
|
+
xl: "px-6 py-3"
|
|
493
|
+
},
|
|
494
|
+
height: {
|
|
495
|
+
xs: "h-[26px]",
|
|
496
|
+
sm: "h-[34px]",
|
|
497
|
+
md: "h-[38px]",
|
|
498
|
+
lg: "h-[42px]",
|
|
499
|
+
xl: "h-[50px]"
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
var SIZE_VARIANTS = {
|
|
503
|
+
xs: `${SIZE.text["xs"]} ${SIZE.padding["xs"]} ${SIZE.height["xs"]}`,
|
|
504
|
+
sm: `${SIZE.text["sm"]} ${SIZE.padding["sm"]} ${SIZE.height["sm"]}`,
|
|
505
|
+
md: `${SIZE.text["md"]} ${SIZE.padding["md"]} ${SIZE.height["md"]}`,
|
|
506
|
+
lg: `${SIZE.text["lg"]} ${SIZE.padding["lg"]} ${SIZE.height["lg"]}`,
|
|
507
|
+
xl: `${SIZE.text["xl"]} ${SIZE.padding["xl"]} ${SIZE.height["xl"]}`
|
|
508
|
+
};
|
|
509
|
+
var DESTRUCTIVE_VARIANT = `
|
|
510
|
+
text-foreground
|
|
511
|
+
bg-destructive-300 dark:bg-destructive-400 hover:bg-destructive-400 dark:hover:bg-destructive-400/80
|
|
512
|
+
border-destructive-500 hover:border-destructive
|
|
513
|
+
hover:text-hi-contrast
|
|
514
|
+
data-[state=open]:border-destructive
|
|
515
|
+
data-[state=open]:bg-destructive-400 dark:data-[state=open]:bg-destructive-600/80
|
|
516
|
+
`;
|
|
517
|
+
var buttonVariants = cva(
|
|
518
|
+
`inline-flex items-center justify-center
|
|
519
|
+
relative
|
|
520
|
+
cursor-pointer
|
|
521
|
+
gap-2
|
|
522
|
+
text-center
|
|
523
|
+
font-normal
|
|
524
|
+
ease-out
|
|
525
|
+
duration-200
|
|
526
|
+
rounded-md
|
|
527
|
+
outline-none
|
|
528
|
+
transition-all
|
|
529
|
+
active:scale-[0.98]
|
|
530
|
+
focus-visible:ring-2
|
|
531
|
+
focus-visible:ring-ring
|
|
532
|
+
focus-visible:ring-offset-2
|
|
533
|
+
border
|
|
534
|
+
disabled:pointer-events-none
|
|
535
|
+
disabled:opacity-50
|
|
536
|
+
[&_svg]:pointer-events-none
|
|
537
|
+
[&_svg]:shrink-0
|
|
538
|
+
`,
|
|
539
|
+
{
|
|
540
|
+
variants: {
|
|
541
|
+
variant: {
|
|
542
|
+
primary: `
|
|
543
|
+
bg-brand-400 dark:bg-brand-500
|
|
544
|
+
hover:bg-brand-300 dark:hover:bg-brand-500/80
|
|
545
|
+
text-foreground
|
|
546
|
+
border-brand-500/75 dark:border-brand/30
|
|
547
|
+
hover:border-brand-600 dark:hover:border-brand-500
|
|
548
|
+
data-[state=open]:bg-brand-400/80 dark:data-[state=open]:bg-brand-600/80
|
|
549
|
+
`,
|
|
550
|
+
default: `
|
|
551
|
+
text-foreground
|
|
552
|
+
bg-alternative dark:bg-muted hover:bg-selection
|
|
553
|
+
border-strong hover:border-stronger
|
|
554
|
+
data-[state=open]:bg-selection
|
|
555
|
+
data-[state=open]:border-button-hover
|
|
556
|
+
`,
|
|
557
|
+
secondary: `
|
|
558
|
+
bg-foreground
|
|
559
|
+
text-background hover:text-border-stronger
|
|
560
|
+
focus-visible:text-border-control
|
|
561
|
+
border-foreground-light hover:border-foreground-lighter
|
|
562
|
+
data-[state=open]:border-foreground-lighter
|
|
563
|
+
`,
|
|
564
|
+
outline: `
|
|
565
|
+
text-foreground
|
|
566
|
+
bg-transparent
|
|
567
|
+
border-strong hover:border-foreground-muted
|
|
568
|
+
data-[state=open]:border-stronger
|
|
569
|
+
`,
|
|
570
|
+
dashed: `
|
|
571
|
+
text-foreground
|
|
572
|
+
border
|
|
573
|
+
border-dashed
|
|
574
|
+
border-strong hover:border-stronger
|
|
575
|
+
bg-transparent
|
|
576
|
+
data-[state=open]:border-stronger
|
|
577
|
+
`,
|
|
578
|
+
link: `
|
|
579
|
+
text-brand-600
|
|
580
|
+
border
|
|
581
|
+
border-transparent
|
|
582
|
+
bg-transparent
|
|
583
|
+
hover:bg-brand-400
|
|
584
|
+
shadow-none
|
|
585
|
+
data-[state=open]:bg-brand-400
|
|
586
|
+
`,
|
|
587
|
+
text: `
|
|
588
|
+
text-foreground
|
|
589
|
+
hover:bg-surface-300
|
|
590
|
+
shadow-none
|
|
591
|
+
data-[state=open]:bg-surface-300
|
|
592
|
+
border-transparent
|
|
593
|
+
`,
|
|
594
|
+
danger: DESTRUCTIVE_VARIANT,
|
|
595
|
+
warning: `
|
|
596
|
+
text-foreground
|
|
597
|
+
bg-warning-300 dark:bg-warning-400 hover:bg-warning-400 dark:hover:bg-warning-400/80
|
|
598
|
+
border-warning-500 hover:border-warning
|
|
599
|
+
hover:text-hi-contrast
|
|
600
|
+
data-[state=open]:border-warning
|
|
601
|
+
data-[state=open]:bg-warning-400 dark:data-[state=open]:bg-warning-600/80
|
|
602
|
+
`,
|
|
603
|
+
destructive: DESTRUCTIVE_VARIANT,
|
|
604
|
+
ghost: `
|
|
605
|
+
text-foreground
|
|
606
|
+
hover:bg-surface-100 dark:hover:bg-surface-200
|
|
607
|
+
border-transparent
|
|
608
|
+
`
|
|
609
|
+
},
|
|
610
|
+
block: {
|
|
611
|
+
true: "w-full flex items-center justify-center"
|
|
612
|
+
},
|
|
613
|
+
size: {
|
|
614
|
+
...SIZE_VARIANTS,
|
|
615
|
+
default: SIZE_VARIANTS.sm,
|
|
616
|
+
icon: "size-9",
|
|
617
|
+
// Compact icon-only button (24×24). Useful for dense rows in tables
|
|
618
|
+
// and toolbars. Pair with a 14px lucide icon for a balanced look.
|
|
619
|
+
"icon-xs": "size-6",
|
|
620
|
+
"icon-sm": "size-7",
|
|
621
|
+
"icon-lg": "size-10"
|
|
622
|
+
},
|
|
623
|
+
disabled: {
|
|
624
|
+
true: "opacity-50 cursor-not-allowed pointer-events-none"
|
|
625
|
+
},
|
|
626
|
+
rounded: {
|
|
627
|
+
true: "rounded-full"
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
defaultVariants: {
|
|
631
|
+
variant: "default",
|
|
632
|
+
size: "sm"
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
);
|
|
636
|
+
var IconContainerVariants = cva("inline-flex items-center justify-center", {
|
|
637
|
+
variants: {
|
|
638
|
+
size: {
|
|
639
|
+
xs: "[&_svg]:size-[14px]",
|
|
640
|
+
sm: "[&_svg]:size-[18px]",
|
|
641
|
+
md: "[&_svg]:size-[20px]",
|
|
642
|
+
lg: "[&_svg]:size-[20px]",
|
|
643
|
+
xl: "[&_svg]:size-[24px]",
|
|
644
|
+
/** @deprecated */
|
|
645
|
+
tiny: "[&_svg]:size-[14px]",
|
|
646
|
+
/** @deprecated */
|
|
647
|
+
small: "[&_svg]:size-[18px]",
|
|
648
|
+
/** @deprecated */
|
|
649
|
+
medium: "[&_svg]:size-[20px]",
|
|
650
|
+
/** @deprecated */
|
|
651
|
+
large: "[&_svg]:size-[20px]",
|
|
652
|
+
/** @deprecated */
|
|
653
|
+
xlarge: "[&_svg]:size-[24px]",
|
|
654
|
+
default: "[&_svg]:size-[18px]",
|
|
655
|
+
icon: "[&_svg]:size-[18px]"
|
|
656
|
+
},
|
|
657
|
+
variant: {
|
|
658
|
+
primary: "text-brand-600",
|
|
659
|
+
default: "text-foreground-lighter",
|
|
660
|
+
secondary: "text-border-muted",
|
|
661
|
+
outline: "text-foreground-lighter",
|
|
662
|
+
dashed: "text-foreground-lighter",
|
|
663
|
+
link: "text-brand-600",
|
|
664
|
+
text: "text-foreground-lighter",
|
|
665
|
+
danger: "text-destructive-600",
|
|
666
|
+
warning: "text-warning",
|
|
667
|
+
destructive: "text-destructive-600",
|
|
668
|
+
ghost: "text-foreground-lighter"
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
var loadingVariants = cva("", {
|
|
673
|
+
variants: {
|
|
674
|
+
variant: {
|
|
675
|
+
primary: "text-brand-600",
|
|
676
|
+
default: "text-foreground-lighter",
|
|
677
|
+
secondary: "text-border-muted",
|
|
678
|
+
outline: "text-foreground-lighter",
|
|
679
|
+
dashed: "text-foreground-lighter",
|
|
680
|
+
link: "text-brand-600",
|
|
681
|
+
text: "text-foreground-muted",
|
|
682
|
+
danger: "text-destructive-600",
|
|
683
|
+
warning: "text-warning",
|
|
684
|
+
destructive: "text-destructive-600",
|
|
685
|
+
ghost: "text-foreground-lighter"
|
|
686
|
+
},
|
|
687
|
+
loading: {
|
|
688
|
+
default: "",
|
|
689
|
+
true: `animate-spin`
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
var Button = forwardRef(
|
|
694
|
+
({
|
|
695
|
+
asChild = false,
|
|
696
|
+
variant,
|
|
697
|
+
type,
|
|
698
|
+
size = "sm",
|
|
699
|
+
children,
|
|
700
|
+
isLoading,
|
|
701
|
+
loading,
|
|
702
|
+
block,
|
|
703
|
+
icon,
|
|
704
|
+
iconEnd,
|
|
705
|
+
iconStart,
|
|
706
|
+
iconRight,
|
|
707
|
+
iconLeft,
|
|
708
|
+
htmlType = "button",
|
|
709
|
+
rounded,
|
|
710
|
+
className,
|
|
711
|
+
...props
|
|
712
|
+
}, ref) => {
|
|
713
|
+
if (process.env.NODE_ENV !== "production") {
|
|
714
|
+
const deprecatedSizes = ["tiny", "small", "medium", "large", "xlarge"];
|
|
715
|
+
if (size && deprecatedSizes.includes(size)) {
|
|
716
|
+
console.warn(`[Parto UI] Button: size="${size}" is deprecated. Use xs|sm|md|lg|xl instead.`);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
const Comp = asChild ? Slot : "button";
|
|
720
|
+
const { tabIndex } = props;
|
|
721
|
+
const buttonVariant = type && typeof type === "string" && !["button", "submit", "reset"].includes(type) ? type : variant || "default";
|
|
722
|
+
const _loading = isLoading ?? loading;
|
|
723
|
+
const resolvedIconStart = icon ?? iconStart ?? iconLeft;
|
|
724
|
+
const resolvedIconEnd = iconEnd ?? iconRight;
|
|
725
|
+
const showIcon = _loading || resolvedIconStart;
|
|
726
|
+
const disabled = _loading === true || props.disabled;
|
|
727
|
+
const computedTabIndex = tabIndex !== void 0 ? tabIndex : disabled ? -1 : 0;
|
|
728
|
+
const iconSize = size === "default" ? "sm" : size === "icon" || size === "icon-sm" ? "sm" : size === "icon-xs" ? "xs" : size === "icon-lg" ? "lg" : size ?? "sm";
|
|
729
|
+
return /* @__PURE__ */ jsx(
|
|
730
|
+
Comp,
|
|
731
|
+
{
|
|
732
|
+
ref,
|
|
733
|
+
"data-slot": "button",
|
|
734
|
+
"data-size": size,
|
|
735
|
+
type: htmlType,
|
|
736
|
+
disabled,
|
|
737
|
+
"aria-busy": _loading || void 0,
|
|
738
|
+
tabIndex: computedTabIndex,
|
|
739
|
+
className: cn(buttonVariants({ variant: buttonVariant, size, disabled, block, rounded }), className),
|
|
740
|
+
onClick: (e) => {
|
|
741
|
+
if (disabled) return e.preventDefault();
|
|
742
|
+
else props?.onClick?.(e);
|
|
743
|
+
},
|
|
744
|
+
...props,
|
|
745
|
+
children: asChild ? isValidElement(children) ? cloneElement(
|
|
746
|
+
children,
|
|
747
|
+
void 0,
|
|
748
|
+
showIcon && (_loading ? /* @__PURE__ */ jsx("div", { className: cn(IconContainerVariants({ size: iconSize, variant: buttonVariant })), children: /* @__PURE__ */ jsx(Loader2, { className: cn(loadingVariants({ loading: _loading, variant: buttonVariant })) }) }) : resolvedIconStart ? /* @__PURE__ */ jsx("div", { className: cn(IconContainerVariants({ size: iconSize, variant: buttonVariant })), children: resolvedIconStart }) : null),
|
|
749
|
+
children.props?.children && /* @__PURE__ */ jsx("span", { className: "inline-flex items-center gap-2 truncate", children: children.props.children }),
|
|
750
|
+
resolvedIconEnd && !_loading && /* @__PURE__ */ jsx("div", { className: cn(IconContainerVariants({ size: iconSize, variant: buttonVariant })), children: resolvedIconEnd })
|
|
751
|
+
) : null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
752
|
+
showIcon && (_loading ? /* @__PURE__ */ jsxs("div", { className: cn(IconContainerVariants({ size: iconSize, variant: buttonVariant })), children: [
|
|
753
|
+
/* @__PURE__ */ jsx(
|
|
754
|
+
Loader2,
|
|
755
|
+
{
|
|
756
|
+
"aria-hidden": "true",
|
|
757
|
+
className: cn(loadingVariants({ loading: _loading, variant: buttonVariant }))
|
|
758
|
+
}
|
|
759
|
+
),
|
|
760
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "\u062F\u0631 \u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC..." })
|
|
761
|
+
] }) : resolvedIconStart ? /* @__PURE__ */ jsx("div", { className: cn(IconContainerVariants({ size: iconSize, variant: buttonVariant })), children: resolvedIconStart }) : null),
|
|
762
|
+
children && /* @__PURE__ */ jsx("span", { className: "inline-flex items-center gap-2 truncate", children }),
|
|
763
|
+
resolvedIconEnd && !_loading && /* @__PURE__ */ jsx("div", { className: cn(IconContainerVariants({ size: iconSize, variant: buttonVariant })), children: resolvedIconEnd })
|
|
764
|
+
] })
|
|
765
|
+
}
|
|
766
|
+
);
|
|
767
|
+
}
|
|
768
|
+
);
|
|
769
|
+
Button.displayName = "Button";
|
|
770
|
+
var PaginationDirectionContext = React6.createContext("rtl");
|
|
771
|
+
function usePaginationDirection() {
|
|
772
|
+
return React6.useContext(PaginationDirectionContext);
|
|
773
|
+
}
|
|
774
|
+
function Pagination({ className, dir, children, ...props }) {
|
|
775
|
+
const resolvedDir = dir ?? "rtl";
|
|
776
|
+
return /* @__PURE__ */ jsx(PaginationDirectionContext.Provider, { value: resolvedDir, children: /* @__PURE__ */ jsx(
|
|
777
|
+
"nav",
|
|
778
|
+
{
|
|
779
|
+
role: "navigation",
|
|
780
|
+
"aria-label": "pagination",
|
|
781
|
+
"data-slot": "pagination",
|
|
782
|
+
dir: resolvedDir,
|
|
783
|
+
className: cn("mx-auto flex w-full justify-center not-prose", className),
|
|
784
|
+
...props,
|
|
785
|
+
children
|
|
786
|
+
}
|
|
787
|
+
) });
|
|
788
|
+
}
|
|
789
|
+
function PaginationContent({ className, ...props }) {
|
|
790
|
+
const dir = usePaginationDirection();
|
|
791
|
+
return /* @__PURE__ */ jsx(
|
|
792
|
+
"ul",
|
|
793
|
+
{
|
|
794
|
+
"data-slot": "pagination-content",
|
|
795
|
+
dir,
|
|
796
|
+
className: cn("flex flex-row items-center gap-1 list-none", className),
|
|
797
|
+
...props
|
|
798
|
+
}
|
|
799
|
+
);
|
|
800
|
+
}
|
|
801
|
+
function PaginationItem({ ...props }) {
|
|
802
|
+
return /* @__PURE__ */ jsx("li", { "data-slot": "pagination-item", ...props });
|
|
803
|
+
}
|
|
804
|
+
function PaginationLink({ className, isActive, size = "icon", dir, ...props }) {
|
|
805
|
+
const contextDir = usePaginationDirection();
|
|
806
|
+
const linkDir = dir ?? (contextDir === "rtl" ? "rtl" : "ltr");
|
|
807
|
+
return /* @__PURE__ */ jsx(
|
|
808
|
+
"a",
|
|
809
|
+
{
|
|
810
|
+
"aria-current": isActive ? "page" : void 0,
|
|
811
|
+
"data-slot": "pagination-link",
|
|
812
|
+
"data-active": isActive,
|
|
813
|
+
dir: linkDir,
|
|
814
|
+
className: cn(
|
|
815
|
+
buttonVariants({
|
|
816
|
+
variant: "outline",
|
|
817
|
+
size
|
|
818
|
+
}),
|
|
819
|
+
// Remove underline from links
|
|
820
|
+
"no-underline",
|
|
821
|
+
// Active state styling with green color
|
|
822
|
+
isActive && [
|
|
823
|
+
"border-brand-500 bg-brand/10 text-brand-600",
|
|
824
|
+
"dark:border-brand-600 dark:bg-brand/10 dark:text-brand-400",
|
|
825
|
+
"pointer-events-none"
|
|
826
|
+
],
|
|
827
|
+
className
|
|
828
|
+
),
|
|
829
|
+
...props
|
|
830
|
+
}
|
|
831
|
+
);
|
|
832
|
+
}
|
|
833
|
+
function PaginationPrevious({ className, ...props }) {
|
|
834
|
+
const dir = usePaginationDirection();
|
|
835
|
+
const isRTL2 = dir === "rtl";
|
|
836
|
+
const strings = getUIStrings(isRTL2 ? "fa" : "en");
|
|
837
|
+
const Icon = isRTL2 ? ChevronRightIcon : ChevronLeftIcon;
|
|
838
|
+
return /* @__PURE__ */ jsxs(
|
|
839
|
+
PaginationLink,
|
|
840
|
+
{
|
|
841
|
+
"aria-label": strings.goToPreviousPage,
|
|
842
|
+
size: "default",
|
|
843
|
+
className: cn("gap-1 ps-2.5 pe-2.5 no-underline flex items-center", className),
|
|
844
|
+
dir: "ltr",
|
|
845
|
+
...props,
|
|
846
|
+
children: [
|
|
847
|
+
/* @__PURE__ */ jsx(Icon, { className: "size-4" }),
|
|
848
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline no-underline", children: strings.previous })
|
|
849
|
+
]
|
|
850
|
+
}
|
|
851
|
+
);
|
|
852
|
+
}
|
|
853
|
+
function PaginationNext({ className, ...props }) {
|
|
854
|
+
const dir = usePaginationDirection();
|
|
855
|
+
const isRTL2 = dir === "rtl";
|
|
856
|
+
const strings = getUIStrings(isRTL2 ? "fa" : "en");
|
|
857
|
+
const Icon = isRTL2 ? ChevronLeftIcon : ChevronRightIcon;
|
|
858
|
+
return /* @__PURE__ */ jsx(
|
|
859
|
+
PaginationLink,
|
|
860
|
+
{
|
|
861
|
+
"aria-label": strings.goToNextPage,
|
|
862
|
+
size: "default",
|
|
863
|
+
className: cn("gap-1 ps-2.5 pe-2.5 no-underline flex items-center", className),
|
|
864
|
+
dir: "ltr",
|
|
865
|
+
...props,
|
|
866
|
+
children: isRTL2 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
867
|
+
/* @__PURE__ */ jsx(Icon, { className: "size-4" }),
|
|
868
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline no-underline", children: strings.next })
|
|
869
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
870
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:inline no-underline", children: strings.next }),
|
|
871
|
+
/* @__PURE__ */ jsx(Icon, { className: "size-4" })
|
|
872
|
+
] })
|
|
873
|
+
}
|
|
874
|
+
);
|
|
875
|
+
}
|
|
876
|
+
function PaginationEllipsis({ className, ...props }) {
|
|
877
|
+
return /* @__PURE__ */ jsxs(
|
|
878
|
+
"span",
|
|
879
|
+
{
|
|
880
|
+
"aria-hidden": true,
|
|
881
|
+
"data-slot": "pagination-ellipsis",
|
|
882
|
+
className: cn("flex size-9 items-center justify-center", className),
|
|
883
|
+
...props,
|
|
884
|
+
children: [
|
|
885
|
+
/* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }),
|
|
886
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
|
|
887
|
+
]
|
|
888
|
+
}
|
|
889
|
+
);
|
|
890
|
+
}
|
|
891
|
+
Pagination.displayName = "Pagination";
|
|
892
|
+
PaginationContent.displayName = "PaginationContent";
|
|
893
|
+
PaginationItem.displayName = "PaginationItem";
|
|
894
|
+
PaginationLink.displayName = "PaginationLink";
|
|
895
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
896
|
+
PaginationNext.displayName = "PaginationNext";
|
|
897
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
898
|
+
var PaginationControlled = React6.forwardRef(
|
|
899
|
+
({
|
|
900
|
+
currentPage,
|
|
901
|
+
totalPages,
|
|
902
|
+
onPageChange,
|
|
903
|
+
siblingCount = 1,
|
|
904
|
+
showFirstLast = false,
|
|
905
|
+
showPrevNext = true,
|
|
906
|
+
showEllipsis = true,
|
|
907
|
+
className,
|
|
908
|
+
locale = "fa"
|
|
909
|
+
}, ref) => {
|
|
910
|
+
const isRTL2 = locale === "fa" || locale === "ar";
|
|
911
|
+
const localizeNumber = (n) => convertToLocalNumbers(String(n), locale);
|
|
912
|
+
const handlePageChange = (page) => {
|
|
913
|
+
if (page >= 1 && page <= totalPages && page !== currentPage) {
|
|
914
|
+
onPageChange(page);
|
|
915
|
+
}
|
|
916
|
+
};
|
|
917
|
+
const generatePageNumbers = () => {
|
|
918
|
+
const pages = [];
|
|
919
|
+
const totalNumbers = siblingCount * 2 + 5;
|
|
920
|
+
const totalBlocks = totalNumbers + 2;
|
|
921
|
+
if (totalPages <= totalBlocks) {
|
|
922
|
+
for (let i = 1; i <= totalPages; i++) {
|
|
923
|
+
pages.push(i);
|
|
924
|
+
}
|
|
925
|
+
} else {
|
|
926
|
+
const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
|
|
927
|
+
const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages);
|
|
928
|
+
const shouldShowLeftEllipsis = leftSiblingIndex > 2;
|
|
929
|
+
const shouldShowRightEllipsis = rightSiblingIndex < totalPages - 1;
|
|
930
|
+
if (!shouldShowLeftEllipsis && shouldShowRightEllipsis) {
|
|
931
|
+
const leftItemCount = 3 + 2 * siblingCount;
|
|
932
|
+
const leftRange = [];
|
|
933
|
+
for (let i = 1; i <= leftItemCount; i++) {
|
|
934
|
+
leftRange.push(i);
|
|
935
|
+
}
|
|
936
|
+
pages.push(...leftRange);
|
|
937
|
+
if (showEllipsis) pages.push("ellipsis");
|
|
938
|
+
pages.push(totalPages);
|
|
939
|
+
} else if (shouldShowLeftEllipsis && !shouldShowRightEllipsis) {
|
|
940
|
+
pages.push(1);
|
|
941
|
+
if (showEllipsis) pages.push("ellipsis");
|
|
942
|
+
const rightItemCount = 3 + 2 * siblingCount;
|
|
943
|
+
const rightRange = [];
|
|
944
|
+
for (let i = totalPages - rightItemCount + 1; i <= totalPages; i++) {
|
|
945
|
+
rightRange.push(i);
|
|
946
|
+
}
|
|
947
|
+
pages.push(...rightRange);
|
|
948
|
+
} else if (shouldShowLeftEllipsis && shouldShowRightEllipsis) {
|
|
949
|
+
pages.push(1);
|
|
950
|
+
if (showEllipsis) pages.push("ellipsis");
|
|
951
|
+
for (let i = leftSiblingIndex; i <= rightSiblingIndex; i++) {
|
|
952
|
+
pages.push(i);
|
|
953
|
+
}
|
|
954
|
+
if (showEllipsis) pages.push("ellipsis");
|
|
955
|
+
pages.push(totalPages);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
return pages;
|
|
959
|
+
};
|
|
960
|
+
const pageNumbers = generatePageNumbers();
|
|
961
|
+
const showFirstButton = showFirstLast && !pageNumbers.includes(1) && currentPage > 1;
|
|
962
|
+
const showLastButton = showFirstLast && !pageNumbers.includes(totalPages) && currentPage < totalPages;
|
|
963
|
+
return /* @__PURE__ */ jsx(Pagination, { ref, "data-slot": "pagination-controlled", className: cn(className), dir: isRTL2 ? "rtl" : "ltr", children: /* @__PURE__ */ jsxs(PaginationContent, { children: [
|
|
964
|
+
showFirstButton && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
|
|
965
|
+
PaginationLink,
|
|
966
|
+
{
|
|
967
|
+
href: "#",
|
|
968
|
+
onClick: (e) => {
|
|
969
|
+
e.preventDefault();
|
|
970
|
+
handlePageChange(1);
|
|
971
|
+
},
|
|
972
|
+
children: localizeNumber(1)
|
|
973
|
+
}
|
|
974
|
+
) }),
|
|
975
|
+
showPrevNext && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
|
|
976
|
+
PaginationPrevious,
|
|
977
|
+
{
|
|
978
|
+
href: "#",
|
|
979
|
+
onClick: (e) => {
|
|
980
|
+
e.preventDefault();
|
|
981
|
+
handlePageChange(currentPage - 1);
|
|
982
|
+
},
|
|
983
|
+
className: currentPage === 1 ? "pointer-events-none opacity-50" : ""
|
|
984
|
+
}
|
|
985
|
+
) }),
|
|
986
|
+
pageNumbers.map((page, index) => {
|
|
987
|
+
if (page === "ellipsis") {
|
|
988
|
+
return /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationEllipsis, {}) }, `ellipsis-${index}`);
|
|
989
|
+
}
|
|
990
|
+
return /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
|
|
991
|
+
PaginationLink,
|
|
992
|
+
{
|
|
993
|
+
href: "#",
|
|
994
|
+
isActive: page === currentPage,
|
|
995
|
+
onClick: (e) => {
|
|
996
|
+
e.preventDefault();
|
|
997
|
+
handlePageChange(page);
|
|
998
|
+
},
|
|
999
|
+
children: localizeNumber(page)
|
|
1000
|
+
}
|
|
1001
|
+
) }, page);
|
|
1002
|
+
}),
|
|
1003
|
+
showPrevNext && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
|
|
1004
|
+
PaginationNext,
|
|
1005
|
+
{
|
|
1006
|
+
href: "#",
|
|
1007
|
+
onClick: (e) => {
|
|
1008
|
+
e.preventDefault();
|
|
1009
|
+
handlePageChange(currentPage + 1);
|
|
1010
|
+
},
|
|
1011
|
+
className: currentPage === totalPages ? "pointer-events-none opacity-50" : ""
|
|
1012
|
+
}
|
|
1013
|
+
) }),
|
|
1014
|
+
showLastButton && /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
|
|
1015
|
+
PaginationLink,
|
|
1016
|
+
{
|
|
1017
|
+
href: "#",
|
|
1018
|
+
onClick: (e) => {
|
|
1019
|
+
e.preventDefault();
|
|
1020
|
+
handlePageChange(totalPages);
|
|
1021
|
+
},
|
|
1022
|
+
children: localizeNumber(totalPages)
|
|
1023
|
+
}
|
|
1024
|
+
) })
|
|
1025
|
+
] }) });
|
|
1026
|
+
}
|
|
1027
|
+
);
|
|
1028
|
+
PaginationControlled.displayName = "PaginationControlled";
|
|
1029
|
+
function useInfiniteScroll({
|
|
1030
|
+
onLoadMore,
|
|
1031
|
+
hasMore,
|
|
1032
|
+
isLoading = false,
|
|
1033
|
+
rootMargin = "200px",
|
|
1034
|
+
threshold = 0
|
|
1035
|
+
}) {
|
|
1036
|
+
const observerRef = React6.useRef(null);
|
|
1037
|
+
const callbackRef = React6.useRef(onLoadMore);
|
|
1038
|
+
React6.useEffect(() => {
|
|
1039
|
+
callbackRef.current = onLoadMore;
|
|
1040
|
+
}, [onLoadMore]);
|
|
1041
|
+
const hasMoreRef = React6.useRef(hasMore);
|
|
1042
|
+
React6.useEffect(() => {
|
|
1043
|
+
hasMoreRef.current = hasMore;
|
|
1044
|
+
}, [hasMore]);
|
|
1045
|
+
const isLoadingRef = React6.useRef(isLoading);
|
|
1046
|
+
React6.useEffect(() => {
|
|
1047
|
+
isLoadingRef.current = isLoading;
|
|
1048
|
+
}, [isLoading]);
|
|
1049
|
+
const sentinelRef = React6.useCallback(
|
|
1050
|
+
(node) => {
|
|
1051
|
+
if (observerRef.current) {
|
|
1052
|
+
observerRef.current.disconnect();
|
|
1053
|
+
observerRef.current = null;
|
|
1054
|
+
}
|
|
1055
|
+
if (!node) return;
|
|
1056
|
+
observerRef.current = new IntersectionObserver(
|
|
1057
|
+
(entries) => {
|
|
1058
|
+
const entry = entries[0];
|
|
1059
|
+
if (entry?.isIntersecting && hasMoreRef.current && !isLoadingRef.current) {
|
|
1060
|
+
callbackRef.current();
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
{ rootMargin, threshold }
|
|
1064
|
+
);
|
|
1065
|
+
observerRef.current.observe(node);
|
|
1066
|
+
},
|
|
1067
|
+
[rootMargin, threshold]
|
|
1068
|
+
);
|
|
1069
|
+
React6.useEffect(() => {
|
|
1070
|
+
return () => {
|
|
1071
|
+
observerRef.current?.disconnect();
|
|
1072
|
+
};
|
|
1073
|
+
}, []);
|
|
1074
|
+
return { sentinelRef };
|
|
1075
|
+
}
|
|
1076
|
+
var spinnerVariants = cva("animate-spin text-muted-foreground", {
|
|
1077
|
+
variants: {
|
|
1078
|
+
size: {
|
|
1079
|
+
xs: "size-3",
|
|
1080
|
+
sm: "size-4",
|
|
1081
|
+
md: "size-5",
|
|
1082
|
+
lg: "size-6",
|
|
1083
|
+
xl: "size-8"
|
|
1084
|
+
}
|
|
1085
|
+
},
|
|
1086
|
+
defaultVariants: {
|
|
1087
|
+
size: "sm"
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1090
|
+
var Spinner = React6.forwardRef(({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1091
|
+
"span",
|
|
1092
|
+
{
|
|
1093
|
+
ref,
|
|
1094
|
+
"data-slot": "spinner",
|
|
1095
|
+
role: "status",
|
|
1096
|
+
"aria-label": "\u062F\u0631 \u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC...",
|
|
1097
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
1098
|
+
...props,
|
|
1099
|
+
children: /* @__PURE__ */ jsx(Loader2, { className: spinnerVariants({ size }), "aria-hidden": "true" })
|
|
1100
|
+
}
|
|
1101
|
+
));
|
|
1102
|
+
Spinner.displayName = "Spinner";
|
|
1103
|
+
var noop = () => {
|
|
1104
|
+
};
|
|
1105
|
+
function DataTableInner({
|
|
1106
|
+
columns,
|
|
1107
|
+
data,
|
|
1108
|
+
size = "md",
|
|
1109
|
+
isLoading = false,
|
|
1110
|
+
loadingRows = 5,
|
|
1111
|
+
emptyState,
|
|
1112
|
+
pagination,
|
|
1113
|
+
sort,
|
|
1114
|
+
multiSort,
|
|
1115
|
+
footer = false,
|
|
1116
|
+
stickyFooter = true,
|
|
1117
|
+
onColumnResize,
|
|
1118
|
+
selection,
|
|
1119
|
+
columnVisibility,
|
|
1120
|
+
expansion,
|
|
1121
|
+
infiniteScroll,
|
|
1122
|
+
virtualize,
|
|
1123
|
+
striped = false,
|
|
1124
|
+
bordered = false,
|
|
1125
|
+
stickyHeader = false,
|
|
1126
|
+
className,
|
|
1127
|
+
caption,
|
|
1128
|
+
resultCount,
|
|
1129
|
+
locale = "fa"
|
|
1130
|
+
}, ref) {
|
|
1131
|
+
const t = getUIStrings(locale);
|
|
1132
|
+
const hasSelection = !!selection;
|
|
1133
|
+
const hasExpansion = !!expansion;
|
|
1134
|
+
const rtl = isRTL(locale);
|
|
1135
|
+
const visibleColumns = React6.useMemo(() => {
|
|
1136
|
+
return columns.filter((col) => {
|
|
1137
|
+
const explicit = columnVisibility?.visible[col.id];
|
|
1138
|
+
if (explicit !== void 0) return explicit;
|
|
1139
|
+
return col.defaultVisible !== false;
|
|
1140
|
+
});
|
|
1141
|
+
}, [columns, columnVisibility]);
|
|
1142
|
+
const allColumnCount = visibleColumns.length + (hasSelection ? 1 : 0) + (hasExpansion ? 1 : 0);
|
|
1143
|
+
const getRowKey = React6.useMemo(
|
|
1144
|
+
() => selection?.getRowKey ?? ((_, index) => index),
|
|
1145
|
+
[selection?.getRowKey]
|
|
1146
|
+
);
|
|
1147
|
+
const allRowKeys = React6.useMemo(() => data.map((row, i) => getRowKey(row, i)), [data, getRowKey]);
|
|
1148
|
+
const allSelected = hasSelection && data.length > 0 && allRowKeys.every((key) => selection.selectedRows.has(key));
|
|
1149
|
+
const someSelected = hasSelection && !allSelected && allRowKeys.some((key) => selection.selectedRows.has(key));
|
|
1150
|
+
const handleSelectAll = () => {
|
|
1151
|
+
if (!selection) return;
|
|
1152
|
+
if (allSelected) {
|
|
1153
|
+
selection.onSelectionChange(/* @__PURE__ */ new Set());
|
|
1154
|
+
} else {
|
|
1155
|
+
selection.onSelectionChange(new Set(allRowKeys));
|
|
1156
|
+
}
|
|
1157
|
+
};
|
|
1158
|
+
const handleSelectRow = (key) => {
|
|
1159
|
+
if (!selection) return;
|
|
1160
|
+
const next = new Set(selection.selectedRows);
|
|
1161
|
+
if (next.has(key)) {
|
|
1162
|
+
next.delete(key);
|
|
1163
|
+
} else {
|
|
1164
|
+
next.add(key);
|
|
1165
|
+
}
|
|
1166
|
+
selection.onSelectionChange(next);
|
|
1167
|
+
};
|
|
1168
|
+
const handleSort = (columnId, e) => {
|
|
1169
|
+
if (multiSort) {
|
|
1170
|
+
const isShift = !!e && "shiftKey" in e && e.shiftKey;
|
|
1171
|
+
const existing = multiSort.rules.find((r) => r.column === columnId);
|
|
1172
|
+
const maxRules = multiSort.maxRules ?? 3;
|
|
1173
|
+
let next;
|
|
1174
|
+
if (!isShift) {
|
|
1175
|
+
if (existing) {
|
|
1176
|
+
next = [{ column: columnId, direction: existing.direction === "asc" ? "desc" : "asc" }];
|
|
1177
|
+
} else {
|
|
1178
|
+
next = [{ column: columnId, direction: "asc" }];
|
|
1179
|
+
}
|
|
1180
|
+
} else {
|
|
1181
|
+
if (existing) {
|
|
1182
|
+
if (existing.direction === "asc") {
|
|
1183
|
+
next = multiSort.rules.map((r) => r.column === columnId ? { ...r, direction: "desc" } : r);
|
|
1184
|
+
} else {
|
|
1185
|
+
next = multiSort.rules.filter((r) => r.column !== columnId);
|
|
1186
|
+
}
|
|
1187
|
+
} else {
|
|
1188
|
+
next = [...multiSort.rules, { column: columnId, direction: "asc" }].slice(0, maxRules);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
multiSort.onSortChange(next);
|
|
1192
|
+
return;
|
|
1193
|
+
}
|
|
1194
|
+
if (!sort) return;
|
|
1195
|
+
const nextDirection = sort.column === columnId && sort.direction === "asc" ? "desc" : "asc";
|
|
1196
|
+
sort.onSort(columnId, nextDirection);
|
|
1197
|
+
};
|
|
1198
|
+
const getSortDir = (columnId) => {
|
|
1199
|
+
if (multiSort) {
|
|
1200
|
+
const rule = multiSort.rules.find((r) => r.column === columnId);
|
|
1201
|
+
return rule ? rule.direction : "none";
|
|
1202
|
+
}
|
|
1203
|
+
if (!sort || sort.column !== columnId || !sort.direction) return "none";
|
|
1204
|
+
return sort.direction;
|
|
1205
|
+
};
|
|
1206
|
+
const getSortPriority = (columnId) => {
|
|
1207
|
+
if (!multiSort) return 0;
|
|
1208
|
+
const idx = multiSort.rules.findIndex((r) => r.column === columnId);
|
|
1209
|
+
return idx === -1 ? 0 : idx + 1;
|
|
1210
|
+
};
|
|
1211
|
+
const alignClass = (align) => {
|
|
1212
|
+
if (align === "center") return "text-center";
|
|
1213
|
+
if (align === "end") return "text-end";
|
|
1214
|
+
return "text-start";
|
|
1215
|
+
};
|
|
1216
|
+
const pinClass = (pinned) => {
|
|
1217
|
+
if (!pinned) return "";
|
|
1218
|
+
const sideClass = pinned === "start" ? "sticky inset-inline-start-0 z-[1]" : "sticky inset-inline-end-0 z-[1]";
|
|
1219
|
+
return `${sideClass} bg-background`;
|
|
1220
|
+
};
|
|
1221
|
+
const handleToggleExpand = (rowKey) => {
|
|
1222
|
+
if (!expansion) return;
|
|
1223
|
+
const next = new Set(expansion.expandedRows);
|
|
1224
|
+
if (next.has(rowKey)) next.delete(rowKey);
|
|
1225
|
+
else next.add(rowKey);
|
|
1226
|
+
expansion.onExpandedRowsChange(next);
|
|
1227
|
+
};
|
|
1228
|
+
const [resizeWidths, setResizeWidths] = React6.useState({});
|
|
1229
|
+
const dragRef = React6.useRef(null);
|
|
1230
|
+
const startResize = React6.useCallback(
|
|
1231
|
+
(columnId, e) => {
|
|
1232
|
+
const col = columns.find((c) => c.id === columnId);
|
|
1233
|
+
if (!col) return;
|
|
1234
|
+
const headerCell = e.currentTarget.closest("th");
|
|
1235
|
+
const measured = headerCell?.getBoundingClientRect().width || 0;
|
|
1236
|
+
const startWidth = typeof col.width === "number" ? col.width : measured > 0 ? measured : 120;
|
|
1237
|
+
dragRef.current = {
|
|
1238
|
+
columnId,
|
|
1239
|
+
startX: e.clientX,
|
|
1240
|
+
startWidth,
|
|
1241
|
+
currentWidth: startWidth,
|
|
1242
|
+
minWidth: col.minWidth ?? 60,
|
|
1243
|
+
maxWidth: col.maxWidth ?? 800
|
|
1244
|
+
};
|
|
1245
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
1246
|
+
e.preventDefault();
|
|
1247
|
+
e.stopPropagation();
|
|
1248
|
+
},
|
|
1249
|
+
[columns]
|
|
1250
|
+
);
|
|
1251
|
+
const onResizePointerMove = React6.useCallback(
|
|
1252
|
+
(e) => {
|
|
1253
|
+
const drag = dragRef.current;
|
|
1254
|
+
if (!drag) return;
|
|
1255
|
+
const dx = (rtl ? -1 : 1) * (e.clientX - drag.startX);
|
|
1256
|
+
const next = Math.max(drag.minWidth, Math.min(drag.maxWidth, drag.startWidth + dx));
|
|
1257
|
+
drag.currentWidth = next;
|
|
1258
|
+
setResizeWidths((prev) => prev[drag.columnId] === next ? prev : { ...prev, [drag.columnId]: next });
|
|
1259
|
+
},
|
|
1260
|
+
[rtl]
|
|
1261
|
+
);
|
|
1262
|
+
const endResize = React6.useCallback(
|
|
1263
|
+
(e) => {
|
|
1264
|
+
const drag = dragRef.current;
|
|
1265
|
+
if (!drag) return;
|
|
1266
|
+
onColumnResize?.(drag.columnId, drag.currentWidth);
|
|
1267
|
+
dragRef.current = null;
|
|
1268
|
+
e.currentTarget.releasePointerCapture?.(e.pointerId);
|
|
1269
|
+
},
|
|
1270
|
+
[onColumnResize]
|
|
1271
|
+
);
|
|
1272
|
+
const getColumnWidth = (col) => {
|
|
1273
|
+
return resizeWidths[col.id] ?? col.width;
|
|
1274
|
+
};
|
|
1275
|
+
const handleResizeKeyDown = React6.useCallback(
|
|
1276
|
+
(columnId, e) => {
|
|
1277
|
+
const isArrowGrow = rtl ? e.key === "ArrowLeft" : e.key === "ArrowRight";
|
|
1278
|
+
const isArrowShrink = rtl ? e.key === "ArrowRight" : e.key === "ArrowLeft";
|
|
1279
|
+
if (!isArrowGrow && !isArrowShrink && e.key !== "Home" && e.key !== "End") return;
|
|
1280
|
+
const col = columns.find((c) => c.id === columnId);
|
|
1281
|
+
if (!col) return;
|
|
1282
|
+
const headerCell = e.currentTarget.closest("th");
|
|
1283
|
+
const measured = headerCell?.getBoundingClientRect().width || 0;
|
|
1284
|
+
const minWidth = col.minWidth ?? 60;
|
|
1285
|
+
const maxWidth = col.maxWidth ?? 800;
|
|
1286
|
+
const current = resizeWidths[columnId] ?? (typeof col.width === "number" ? col.width : measured > 0 ? measured : 120);
|
|
1287
|
+
const step = e.shiftKey ? 32 : 8;
|
|
1288
|
+
let next;
|
|
1289
|
+
if (e.key === "Home") next = minWidth;
|
|
1290
|
+
else if (e.key === "End") next = maxWidth;
|
|
1291
|
+
else if (isArrowGrow) next = Math.min(maxWidth, current + step);
|
|
1292
|
+
else next = Math.max(minWidth, current - step);
|
|
1293
|
+
e.preventDefault();
|
|
1294
|
+
setResizeWidths((prev) => prev[columnId] === next ? prev : { ...prev, [columnId]: next });
|
|
1295
|
+
onColumnResize?.(columnId, next);
|
|
1296
|
+
},
|
|
1297
|
+
[columns, resizeWidths, rtl, onColumnResize]
|
|
1298
|
+
);
|
|
1299
|
+
const { sentinelRef } = useInfiniteScroll({
|
|
1300
|
+
onLoadMore: infiniteScroll?.onLoadMore ?? noop,
|
|
1301
|
+
hasMore: !!infiniteScroll?.hasMore,
|
|
1302
|
+
isLoading: !!infiniteScroll?.isLoadingMore,
|
|
1303
|
+
rootMargin: infiniteScroll?.rootMargin ?? "200px"
|
|
1304
|
+
});
|
|
1305
|
+
const virtRowHeight = virtualize?.rowHeight ?? 0;
|
|
1306
|
+
const virtViewportHeight = virtualize?.viewportHeight ?? 480;
|
|
1307
|
+
const virtOverscan = virtualize?.overscan ?? 6;
|
|
1308
|
+
const virtScrollRef = React6.useRef(null);
|
|
1309
|
+
const [virtScrollTop, setVirtScrollTop] = React6.useState(0);
|
|
1310
|
+
const handleVirtScroll = React6.useCallback((e) => {
|
|
1311
|
+
setVirtScrollTop(e.currentTarget.scrollTop);
|
|
1312
|
+
}, []);
|
|
1313
|
+
const { virtStartIndex, virtEndIndex, virtTopSpacer, virtBottomSpacer } = React6.useMemo(() => {
|
|
1314
|
+
if (!virtualize || data.length === 0) {
|
|
1315
|
+
return { virtStartIndex: 0, virtEndIndex: data.length, virtTopSpacer: 0, virtBottomSpacer: 0 };
|
|
1316
|
+
}
|
|
1317
|
+
const start = Math.max(0, Math.floor(virtScrollTop / virtRowHeight) - virtOverscan);
|
|
1318
|
+
const visibleCount = Math.ceil(virtViewportHeight / virtRowHeight) + virtOverscan * 2;
|
|
1319
|
+
const end = Math.min(data.length, start + visibleCount);
|
|
1320
|
+
return {
|
|
1321
|
+
virtStartIndex: start,
|
|
1322
|
+
virtEndIndex: end,
|
|
1323
|
+
virtTopSpacer: start * virtRowHeight,
|
|
1324
|
+
virtBottomSpacer: (data.length - end) * virtRowHeight
|
|
1325
|
+
};
|
|
1326
|
+
}, [virtualize, data.length, virtScrollTop, virtRowHeight, virtViewportHeight, virtOverscan]);
|
|
1327
|
+
return /* @__PURE__ */ jsxs("div", { ref, "data-slot": "data-table", className: cn("flex flex-col gap-4", className), children: [
|
|
1328
|
+
resultCount && /* @__PURE__ */ jsx("div", { "data-slot": "data-table-result-count", className: "text-sm text-foreground-muted", children: resultCount }),
|
|
1329
|
+
/* @__PURE__ */ jsx(
|
|
1330
|
+
"div",
|
|
1331
|
+
{
|
|
1332
|
+
ref: virtualize ? virtScrollRef : void 0,
|
|
1333
|
+
onScroll: virtualize ? handleVirtScroll : void 0,
|
|
1334
|
+
style: virtualize ? { maxHeight: virtViewportHeight, overflowY: "auto" } : void 0,
|
|
1335
|
+
"data-slot": virtualize ? "data-table-virtual-scroll" : void 0,
|
|
1336
|
+
children: /* @__PURE__ */ jsxs(Table, { size, striped, bordered, stickyHeader: stickyHeader || !!virtualize, children: [
|
|
1337
|
+
caption && /* @__PURE__ */ jsx("caption", { className: "text-foreground-muted mt-4 text-sm", children: caption }),
|
|
1338
|
+
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
1339
|
+
hasSelection && /* @__PURE__ */ jsx(TableHead, { className: cn("w-[40px]", pinClass("start")), children: /* @__PURE__ */ jsx(
|
|
1340
|
+
Checkbox,
|
|
1341
|
+
{
|
|
1342
|
+
checked: allSelected ? true : someSelected ? "indeterminate" : false,
|
|
1343
|
+
onCheckedChange: handleSelectAll,
|
|
1344
|
+
"aria-label": t.selectAll
|
|
1345
|
+
}
|
|
1346
|
+
) }),
|
|
1347
|
+
hasExpansion && /* @__PURE__ */ jsx(TableHead, { className: cn("w-[36px]", pinClass("start")), "aria-hidden": "true" }),
|
|
1348
|
+
visibleColumns.map((col) => {
|
|
1349
|
+
const sortable = col.sortable && (sort || multiSort);
|
|
1350
|
+
const dir = sortable ? getSortDir(col.id) : "none";
|
|
1351
|
+
const priority = getSortPriority(col.id);
|
|
1352
|
+
const liveWidth = getColumnWidth(col);
|
|
1353
|
+
return /* @__PURE__ */ jsxs(
|
|
1354
|
+
TableHead,
|
|
1355
|
+
{
|
|
1356
|
+
sortDirection: sortable ? dir : void 0,
|
|
1357
|
+
className: cn("relative", alignClass(col.align), pinClass(col.pinned), col.className),
|
|
1358
|
+
style: liveWidth ? { width: liveWidth } : void 0,
|
|
1359
|
+
children: [
|
|
1360
|
+
sortable ? /* @__PURE__ */ jsx(
|
|
1361
|
+
TableSortHeader,
|
|
1362
|
+
{
|
|
1363
|
+
sorted: dir === "none" ? false : dir,
|
|
1364
|
+
onClick: (e) => handleSort(col.id, e),
|
|
1365
|
+
children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
1366
|
+
col.header,
|
|
1367
|
+
priority > 0 && multiSort && multiSort.rules.length > 1 && /* @__PURE__ */ jsx(
|
|
1368
|
+
"span",
|
|
1369
|
+
{
|
|
1370
|
+
"data-slot": "data-table-sort-priority",
|
|
1371
|
+
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",
|
|
1372
|
+
"aria-label": `\u0627\u0648\u0644\u0648\u06CC\u062A \u0645\u0631\u062A\u0628\u200C\u0633\u0627\u0632\u06CC ${priority}`,
|
|
1373
|
+
children: priority
|
|
1374
|
+
}
|
|
1375
|
+
)
|
|
1376
|
+
] })
|
|
1377
|
+
}
|
|
1378
|
+
) : col.header,
|
|
1379
|
+
col.resizable && // role="separator" + tabIndex + ArrowKey handler is the
|
|
1380
|
+
// WAI-ARIA windowsplitter pattern (resizable separator).
|
|
1381
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
1382
|
+
/* @__PURE__ */ jsx(
|
|
1383
|
+
"div",
|
|
1384
|
+
{
|
|
1385
|
+
"data-slot": "data-table-resize-handle",
|
|
1386
|
+
role: "separator",
|
|
1387
|
+
"aria-orientation": "vertical",
|
|
1388
|
+
"aria-label": "\u062A\u063A\u06CC\u06CC\u0631 \u0627\u0646\u062F\u0627\u0632\u0647 \u0633\u062A\u0648\u0646",
|
|
1389
|
+
tabIndex: 0,
|
|
1390
|
+
"aria-valuenow": getColumnWidth(col),
|
|
1391
|
+
"aria-valuemin": col.minWidth ?? 60,
|
|
1392
|
+
"aria-valuemax": col.maxWidth ?? 800,
|
|
1393
|
+
onKeyDown: (e) => handleResizeKeyDown(col.id, e),
|
|
1394
|
+
onPointerDown: (e) => startResize(col.id, e),
|
|
1395
|
+
onPointerMove: onResizePointerMove,
|
|
1396
|
+
onPointerUp: endResize,
|
|
1397
|
+
onPointerCancel: endResize,
|
|
1398
|
+
className: cn(
|
|
1399
|
+
"absolute inset-block-0 inset-inline-end-0 w-1.5 cursor-col-resize select-none touch-none",
|
|
1400
|
+
"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",
|
|
1401
|
+
"hover:before:opacity-100 focus:before:opacity-100 focus-visible:outline-none focus-visible:before:!bg-brand focus-visible:before:opacity-100",
|
|
1402
|
+
dragRef.current?.columnId === col.id && "before:!bg-brand before:opacity-100"
|
|
1403
|
+
)
|
|
1404
|
+
}
|
|
1405
|
+
)
|
|
1406
|
+
]
|
|
1407
|
+
},
|
|
1408
|
+
col.id
|
|
1409
|
+
);
|
|
1410
|
+
})
|
|
1411
|
+
] }) }),
|
|
1412
|
+
/* @__PURE__ */ jsxs(TableBody, { children: [
|
|
1413
|
+
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 } }) }),
|
|
1414
|
+
isLoading ? Array.from({ length: loadingRows }).map((_, rowIdx) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
1415
|
+
hasSelection && /* @__PURE__ */ jsx(TableCell, { className: pinClass("start"), children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4" }) }),
|
|
1416
|
+
hasExpansion && /* @__PURE__ */ jsx(TableCell, { className: pinClass("start"), children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4" }) }),
|
|
1417
|
+
visibleColumns.map((col) => {
|
|
1418
|
+
const liveWidth = getColumnWidth(col);
|
|
1419
|
+
return /* @__PURE__ */ jsx(
|
|
1420
|
+
TableCell,
|
|
1421
|
+
{
|
|
1422
|
+
className: cn(alignClass(col.align), pinClass(col.pinned), col.className),
|
|
1423
|
+
style: liveWidth ? { width: liveWidth } : void 0,
|
|
1424
|
+
children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full max-w-[120px]" })
|
|
1425
|
+
},
|
|
1426
|
+
col.id
|
|
1427
|
+
);
|
|
1428
|
+
})
|
|
1429
|
+
] }, `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) => {
|
|
1430
|
+
const rowIdx = virtualize ? virtStartIndex + sliceIdx : sliceIdx;
|
|
1431
|
+
const rowKey = getRowKey(row, rowIdx);
|
|
1432
|
+
const isSelected = hasSelection && selection.selectedRows.has(rowKey);
|
|
1433
|
+
const isExpanded = hasExpansion && expansion.expandedRows.has(rowKey);
|
|
1434
|
+
const ChevronIcon = ChevronRight;
|
|
1435
|
+
return /* @__PURE__ */ jsxs(React6.Fragment, { children: [
|
|
1436
|
+
/* @__PURE__ */ jsxs(TableRow, { "data-state": isSelected ? "selected" : void 0, children: [
|
|
1437
|
+
hasSelection && /* @__PURE__ */ jsx(TableCell, { className: pinClass("start"), children: /* @__PURE__ */ jsx(
|
|
1438
|
+
Checkbox,
|
|
1439
|
+
{
|
|
1440
|
+
checked: isSelected,
|
|
1441
|
+
onCheckedChange: () => handleSelectRow(rowKey),
|
|
1442
|
+
"aria-label": `${t.selectRow} ${(rowIdx + 1).toLocaleString(locale === "fa" ? "fa-IR" : locale === "ar" ? "ar-SA" : "en-US")}`
|
|
1443
|
+
}
|
|
1444
|
+
) }),
|
|
1445
|
+
hasExpansion && /* @__PURE__ */ jsx(TableCell, { className: pinClass("start"), children: /* @__PURE__ */ jsx(
|
|
1446
|
+
"button",
|
|
1447
|
+
{
|
|
1448
|
+
type: "button",
|
|
1449
|
+
"aria-label": isExpanded ? "collapse" : "expand",
|
|
1450
|
+
"aria-expanded": isExpanded,
|
|
1451
|
+
onClick: () => handleToggleExpand(rowKey),
|
|
1452
|
+
className: "inline-flex size-6 items-center justify-center rounded text-foreground-lighter hover:bg-surface-100 hover:text-foreground transition-colors",
|
|
1453
|
+
children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "size-4", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronIcon, { className: cn("size-4", rtl && "rotate-180"), "aria-hidden": "true" })
|
|
1454
|
+
}
|
|
1455
|
+
) }),
|
|
1456
|
+
visibleColumns.map((col) => {
|
|
1457
|
+
const liveWidth = getColumnWidth(col);
|
|
1458
|
+
return /* @__PURE__ */ jsx(
|
|
1459
|
+
TableCell,
|
|
1460
|
+
{
|
|
1461
|
+
className: cn(alignClass(col.align), pinClass(col.pinned), col.className),
|
|
1462
|
+
style: liveWidth ? { width: liveWidth } : void 0,
|
|
1463
|
+
children: col.cell(row, rowIdx)
|
|
1464
|
+
},
|
|
1465
|
+
col.id
|
|
1466
|
+
);
|
|
1467
|
+
})
|
|
1468
|
+
] }),
|
|
1469
|
+
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) }) })
|
|
1470
|
+
] }, rowKey);
|
|
1471
|
+
}),
|
|
1472
|
+
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 } }) }),
|
|
1473
|
+
infiniteScroll && !isLoading && data.length > 0 && infiniteScroll.hasMore && /* @__PURE__ */ jsx("tr", { "data-slot": "data-table-infinite-sentinel", "aria-hidden": !infiniteScroll.isLoadingMore, children: /* @__PURE__ */ jsx(
|
|
1474
|
+
"td",
|
|
1475
|
+
{
|
|
1476
|
+
ref: sentinelRef,
|
|
1477
|
+
colSpan: allColumnCount,
|
|
1478
|
+
className: "border-0",
|
|
1479
|
+
children: infiniteScroll.isLoadingMore ? infiniteScroll.loadingMoreContent ?? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-3 text-sm text-foreground-lighter", children: [
|
|
1480
|
+
/* @__PURE__ */ jsx(Spinner, { size: "sm" }),
|
|
1481
|
+
/* @__PURE__ */ jsx("span", { children: t.loading ?? "\u062F\u0631 \u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC" })
|
|
1482
|
+
] }) : /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "h-px" })
|
|
1483
|
+
}
|
|
1484
|
+
) }),
|
|
1485
|
+
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 }) })
|
|
1486
|
+
] }),
|
|
1487
|
+
footer && visibleColumns.some((c) => !!c.footer) && !isLoading && data.length > 0 && /* @__PURE__ */ jsx(
|
|
1488
|
+
"tfoot",
|
|
1489
|
+
{
|
|
1490
|
+
"data-slot": "data-table-footer",
|
|
1491
|
+
"data-sticky": stickyFooter || void 0,
|
|
1492
|
+
className: cn(
|
|
1493
|
+
"bg-surface-75 border-t border-border-default font-medium",
|
|
1494
|
+
stickyFooter && "[&>tr>td]:sticky [&>tr>td]:inset-block-end-0 [&>tr>td]:bg-surface-75 [&>tr>td]:z-[8]"
|
|
1495
|
+
),
|
|
1496
|
+
children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
1497
|
+
hasSelection && /* @__PURE__ */ jsx("td", { className: pinClass("start"), "aria-hidden": "true" }),
|
|
1498
|
+
hasExpansion && /* @__PURE__ */ jsx("td", { className: pinClass("start"), "aria-hidden": "true" }),
|
|
1499
|
+
visibleColumns.map((col) => {
|
|
1500
|
+
const liveWidth = getColumnWidth(col);
|
|
1501
|
+
return /* @__PURE__ */ jsx(
|
|
1502
|
+
"td",
|
|
1503
|
+
{
|
|
1504
|
+
className: cn(
|
|
1505
|
+
alignClass(col.align),
|
|
1506
|
+
pinClass(col.pinned),
|
|
1507
|
+
col.className,
|
|
1508
|
+
"[[data-size=sm]_&]:px-2 [[data-size=sm]_&]:py-1.5 [[data-size=sm]_&]:text-xs",
|
|
1509
|
+
"[[data-size=md]_&]:px-3 [[data-size=md]_&]:py-2 [[data-size=md]_&]:text-sm",
|
|
1510
|
+
"[[data-size=lg]_&]:px-4 [[data-size=lg]_&]:py-3 [[data-size=lg]_&]:text-base"
|
|
1511
|
+
),
|
|
1512
|
+
style: liveWidth ? { width: liveWidth } : void 0,
|
|
1513
|
+
children: col.footer ? col.footer() : null
|
|
1514
|
+
},
|
|
1515
|
+
col.id
|
|
1516
|
+
);
|
|
1517
|
+
})
|
|
1518
|
+
] })
|
|
1519
|
+
}
|
|
1520
|
+
)
|
|
1521
|
+
] })
|
|
1522
|
+
}
|
|
1523
|
+
),
|
|
1524
|
+
pagination && pagination.totalPages > 1 && /* @__PURE__ */ jsx("div", { "data-slot": "data-table-pagination", className: "flex justify-center", children: /* @__PURE__ */ jsx(
|
|
1525
|
+
PaginationControlled,
|
|
1526
|
+
{
|
|
1527
|
+
currentPage: pagination.currentPage,
|
|
1528
|
+
totalPages: pagination.totalPages,
|
|
1529
|
+
onPageChange: pagination.onPageChange
|
|
1530
|
+
}
|
|
1531
|
+
) })
|
|
1532
|
+
] });
|
|
1533
|
+
}
|
|
1534
|
+
var DataTable = React6.forwardRef(DataTableInner);
|
|
1535
|
+
DataTable.displayName = "DataTable";
|
|
1536
|
+
|
|
1537
|
+
export { DataTable };
|
|
8
1538
|
//# sourceMappingURL=data-table.js.map
|
|
9
1539
|
//# sourceMappingURL=data-table.js.map
|