@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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"popover.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils.ts","../../../src/components/ui/popover.tsx"],"names":[],"mappings":";;;;;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACCA,IAAM,OAAA,GAA2B,gBAAA,CAAA;AAEjC,IAAM,cAAA,GAAkC,gBAAA,CAAA;AAExC,IAAM,aAAA,GAAiC,gBAAA,CAAA;AAEvC,IAAM,cAAA,GAAuB,KAAA,CAAA,UAAA,CAG3B,CAAC,EAAE,WAAW,KAAA,GAAQ,QAAA,EAAU,UAAA,GAAa,CAAA,EAAG,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC5D,GAAA,CAAkB,yBAAjB,EACC,QAAA,kBAAA,GAAA;AAAA,EAAkB,gBAAA,CAAA,OAAA;AAAA,EAAjB;AAAA,IACC,GAAA;AAAA,IACA,WAAA,EAAU,iBAAA;AAAA,IACV,KAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,geAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CAAA,EACF,CACD;AACD,cAAA,CAAe,cAA+B,gBAAA,CAAA,OAAA,CAAQ,WAAA","file":"popover.js","sourcesContent":["import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\nimport { formatJalaliDate } from '@/lib/jalali-utils'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport type SupportedLocale = 'fa' | 'ar' | 'en'\n\n/**\n * Convert digits in a string to Persian/Arabic numerals based on locale.\n * @example convertToLocalNumbers('123', 'fa') => '۱۲۳'\n * @example convertToLocalNumbers('123', 'en') => '123'\n */\nexport function convertToLocalNumbers(text: string | number, locale: SupportedLocale): string {\n if (locale === 'fa' || locale === 'ar') {\n const persianDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']\n return String(text).replace(/\\d/g, (digit) => persianDigits[parseInt(digit)])\n }\n return String(text)\n}\n\n/**\n * Format large numbers with locale-aware suffixes (K/M/B).\n * @example formatLargeNumber(1500, 'fa') => '۱.۵ هزار'\n * @example formatLargeNumber(1500, 'en') => '1.5K'\n */\nexport function formatLargeNumber(num: number, locale: SupportedLocale): string {\n if (num >= 1_000_000_000) {\n const formatted = (num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'B' : ' میلیارد')\n }\n if (num >= 1_000_000) {\n const formatted = (num / 1_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'M' : ' میلیون')\n }\n if (num >= 1_000) {\n const formatted = (num / 1_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'K' : ' هزار')\n }\n return convertToLocalNumbers(num.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ','), locale)\n}\n\n/**\n * Format number to Instagram-style short format (English only).\n * @example formatNumber(123456, 'short') => '123K'\n * @example formatNumber(123456, 'exact') => '123,456'\n */\nexport function formatNumber(num: number | undefined, format: 'exact' | 'short' = 'exact'): string {\n if (num === undefined || num === null) return '0'\n\n if (format === 'exact') {\n return num.toLocaleString('en-US')\n }\n\n // Short format (Instagram style)\n if (num >= 1_000_000_000) {\n return `${(num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')}B`\n }\n if (num >= 1_000_000) {\n return `${(num / 1_000_000).toFixed(1).replace(/\\.0$/, '')}M`\n }\n if (num >= 1_000) {\n return `${(num / 1_000).toFixed(1).replace(/\\.0$/, '')}K`\n }\n return num.toString()\n}\n\n/**\n * Format date to relative time with absolute on hover (Persian)\n * @example formatRelativeTime(new Date()) => '۲ ساعت پیش'\n */\nexport function formatRelativeTime(date: Date | string | number): string {\n const now = new Date()\n const then = new Date(date)\n const diffInSeconds = Math.floor((now.getTime() - then.getTime()) / 1000)\n\n if (diffInSeconds < 60) {\n return 'همین الان'\n }\n\n const diffInMinutes = Math.floor(diffInSeconds / 60)\n if (diffInMinutes < 60) {\n return `${convertToLocalNumbers(diffInMinutes, 'fa')} دقیقه پیش`\n }\n\n const diffInHours = Math.floor(diffInMinutes / 60)\n if (diffInHours < 24) {\n return `${convertToLocalNumbers(diffInHours, 'fa')} ساعت پیش`\n }\n\n const diffInDays = Math.floor(diffInHours / 24)\n if (diffInDays < 7) {\n return `${convertToLocalNumbers(diffInDays, 'fa')} روز پیش`\n }\n\n const diffInWeeks = Math.floor(diffInDays / 7)\n if (diffInWeeks < 4) {\n return `${convertToLocalNumbers(diffInWeeks, 'fa')} هفته پیش`\n }\n\n const diffInMonths = Math.floor(diffInDays / 30)\n if (diffInMonths < 12) {\n return `${convertToLocalNumbers(diffInMonths, 'fa')} ماه پیش`\n }\n\n const diffInYears = Math.floor(diffInDays / 365)\n return `${convertToLocalNumbers(diffInYears, 'fa')} سال پیش`\n}\n\n/**\n * Format date to absolute format (Persian / Jalali)\n * Uses date-fns-jalali for accurate Jalali conversion.\n * @example formatAbsoluteTime(new Date()) => '۱۵ دی ۱۴۰۳، ۱۵:۳۰'\n */\nexport function formatAbsoluteTime(date: Date | string | number): string {\n const d = new Date(date)\n return formatJalaliDate(d, 'd MMMM yyyy، HH:mm')\n}\n","'use client'\n\nimport * as React from 'react'\nimport * as PopoverPrimitive from '@radix-ui/react-popover'\n\nimport { cn } from '@/lib/utils'\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 rounded-md border border-overlay bg-overlay p-4 text-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }\n"]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var ProgressPrimitive = require('@radix-ui/react-progress');
|
|
6
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
7
|
+
var clsx = require('clsx');
|
|
8
|
+
var tailwindMerge = require('tailwind-merge');
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
|
|
11
|
+
function _interopNamespace(e) {
|
|
12
|
+
if (e && e.__esModule) return e;
|
|
13
|
+
var n = Object.create(null);
|
|
14
|
+
if (e) {
|
|
15
|
+
Object.keys(e).forEach(function (k) {
|
|
16
|
+
if (k !== 'default') {
|
|
17
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return e[k]; }
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
n.default = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
|
+
var ProgressPrimitive__namespace = /*#__PURE__*/_interopNamespace(ProgressPrimitive);
|
|
31
|
+
|
|
32
|
+
function cn(...inputs) {
|
|
33
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
34
|
+
}
|
|
35
|
+
var progressVariants = classVarianceAuthority.cva("relative w-full overflow-hidden rounded-full bg-surface-300", {
|
|
36
|
+
variants: {
|
|
37
|
+
size: {
|
|
38
|
+
sm: "h-1",
|
|
39
|
+
md: "h-2",
|
|
40
|
+
lg: "h-3"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
size: "md"
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
var progressIndicatorVariants = classVarianceAuthority.cva("h-full w-full flex-1 transition-all origin-left rtl:origin-right", {
|
|
48
|
+
variants: {
|
|
49
|
+
variant: {
|
|
50
|
+
primary: "bg-[hsl(var(--brand-default))]",
|
|
51
|
+
secondary: "bg-foreground",
|
|
52
|
+
success: "bg-sentiment-positive",
|
|
53
|
+
warning: "bg-warning-500",
|
|
54
|
+
destructive: "bg-destructive-500"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
defaultVariants: {
|
|
58
|
+
variant: "primary"
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var Progress = React__namespace.forwardRef(
|
|
62
|
+
({ className, value, size, variant, label, showValue = false, ...props }, ref) => {
|
|
63
|
+
const clampedValue = Math.max(0, Math.min(100, value ?? 0));
|
|
64
|
+
const displayValue = `${Math.round(clampedValue)}%`;
|
|
65
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "progress-wrapper", className: "w-full space-y-2", children: [
|
|
66
|
+
(label || showValue) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
67
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground", children: label }),
|
|
68
|
+
showValue && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-light font-medium", children: displayValue })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
71
|
+
ProgressPrimitive__namespace.Root,
|
|
72
|
+
{
|
|
73
|
+
ref,
|
|
74
|
+
"data-slot": "progress",
|
|
75
|
+
className: cn(progressVariants({ size }), className),
|
|
76
|
+
value,
|
|
77
|
+
...props,
|
|
78
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
+
ProgressPrimitive__namespace.Indicator,
|
|
80
|
+
{
|
|
81
|
+
"data-slot": "progress-indicator",
|
|
82
|
+
className: cn(progressIndicatorVariants({ variant })),
|
|
83
|
+
style: { transform: `scaleX(${clampedValue / 100})` }
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
Progress.displayName = "Progress";
|
|
92
|
+
|
|
93
|
+
exports.Progress = Progress;
|
|
94
|
+
//# sourceMappingURL=progress.cjs.map
|
|
95
|
+
//# sourceMappingURL=progress.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils.ts","../../../src/components/ui/progress.tsx"],"names":["twMerge","clsx","cva","React","jsxs","jsx","ProgressPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACEA,IAAM,gBAAA,GAAmBC,2BAAI,6DAAA,EAA+D;AAAA,EAC1F,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,KAAA;AAAA,MACJ,EAAA,EAAI,KAAA;AAAA,MACJ,EAAA,EAAI;AAAA;AACN,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,IAAA,EAAM;AAAA;AAEV,CAAC,CAAA;AAED,IAAM,yBAAA,GAA4BA,2BAAI,kEAAA,EAAoE;AAAA,EACxG,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,OAAA,EAAS,gCAAA;AAAA,MACT,SAAA,EAAW,eAAA;AAAA,MACX,OAAA,EAAS,uBAAA;AAAA,MACT,OAAA,EAAS,gBAAA;AAAA,MACT,WAAA,EAAa;AAAA;AACf,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS;AAAA;AAEb,CAAC,CAAA;AAWD,IAAM,QAAA,GAAiBC,gBAAA,CAAA,UAAA;AAAA,EACrB,CAAC,EAAE,SAAA,EAAW,KAAA,EAAO,IAAA,EAAM,OAAA,EAAS,KAAA,EAAO,SAAA,GAAY,KAAA,EAAO,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAChF,IAAA,MAAM,YAAA,GAAe,KAAK,GAAA,CAAI,CAAA,EAAG,KAAK,GAAA,CAAI,GAAA,EAAK,KAAA,IAAS,CAAC,CAAC,CAAA;AAC1D,IAAA,MAAM,YAAA,GAAe,CAAA,EAAG,IAAA,CAAK,KAAA,CAAM,YAAY,CAAC,CAAA,CAAA,CAAA;AAEhD,IAAA,uBACEC,eAAA,CAAC,KAAA,EAAA,EAAI,WAAA,EAAU,kBAAA,EAAmB,WAAU,kBAAA,EACxC,QAAA,EAAA;AAAA,MAAA,CAAA,KAAA,IAAS,SAAA,qBACTA,eAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,2CAAA,EACZ,QAAA,EAAA;AAAA,QAAA,KAAA,oBAASC,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,iBAAA,EAAmB,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,QAClD,SAAA,oBAAaA,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,qCAAqC,QAAA,EAAA,YAAA,EAAa;AAAA,OAAA,EAClF,CAAA;AAAA,sBAEFA,cAAA;AAAA,QAAmBC,4BAAA,CAAA,IAAA;AAAA,QAAlB;AAAA,UACC,GAAA;AAAA,UACA,WAAA,EAAU,UAAA;AAAA,UACV,WAAW,EAAA,CAAG,gBAAA,CAAiB,EAAE,IAAA,EAAM,GAAG,SAAS,CAAA;AAAA,UACnD,KAAA;AAAA,UACC,GAAG,KAAA;AAAA,UAEJ,QAAA,kBAAAD,cAAA;AAAA,YAAmBC,4BAAA,CAAA,SAAA;AAAA,YAAlB;AAAA,cACC,WAAA,EAAU,oBAAA;AAAA,cACV,WAAW,EAAA,CAAG,yBAAA,CAA0B,EAAE,OAAA,EAAS,CAAC,CAAA;AAAA,cACpD,OAAO,EAAE,SAAA,EAAW,CAAA,OAAA,EAAU,YAAA,GAAe,GAAG,CAAA,CAAA,CAAA;AAAI;AAAA;AACtD;AAAA;AACF,KAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEA,QAAA,CAAS,WAAA,GAAc,UAAA","file":"progress.cjs","sourcesContent":["import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\nimport { formatJalaliDate } from '@/lib/jalali-utils'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport type SupportedLocale = 'fa' | 'ar' | 'en'\n\n/**\n * Convert digits in a string to Persian/Arabic numerals based on locale.\n * @example convertToLocalNumbers('123', 'fa') => '۱۲۳'\n * @example convertToLocalNumbers('123', 'en') => '123'\n */\nexport function convertToLocalNumbers(text: string | number, locale: SupportedLocale): string {\n if (locale === 'fa' || locale === 'ar') {\n const persianDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']\n return String(text).replace(/\\d/g, (digit) => persianDigits[parseInt(digit)])\n }\n return String(text)\n}\n\n/**\n * Format large numbers with locale-aware suffixes (K/M/B).\n * @example formatLargeNumber(1500, 'fa') => '۱.۵ هزار'\n * @example formatLargeNumber(1500, 'en') => '1.5K'\n */\nexport function formatLargeNumber(num: number, locale: SupportedLocale): string {\n if (num >= 1_000_000_000) {\n const formatted = (num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'B' : ' میلیارد')\n }\n if (num >= 1_000_000) {\n const formatted = (num / 1_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'M' : ' میلیون')\n }\n if (num >= 1_000) {\n const formatted = (num / 1_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'K' : ' هزار')\n }\n return convertToLocalNumbers(num.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ','), locale)\n}\n\n/**\n * Format number to Instagram-style short format (English only).\n * @example formatNumber(123456, 'short') => '123K'\n * @example formatNumber(123456, 'exact') => '123,456'\n */\nexport function formatNumber(num: number | undefined, format: 'exact' | 'short' = 'exact'): string {\n if (num === undefined || num === null) return '0'\n\n if (format === 'exact') {\n return num.toLocaleString('en-US')\n }\n\n // Short format (Instagram style)\n if (num >= 1_000_000_000) {\n return `${(num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')}B`\n }\n if (num >= 1_000_000) {\n return `${(num / 1_000_000).toFixed(1).replace(/\\.0$/, '')}M`\n }\n if (num >= 1_000) {\n return `${(num / 1_000).toFixed(1).replace(/\\.0$/, '')}K`\n }\n return num.toString()\n}\n\n/**\n * Format date to relative time with absolute on hover (Persian)\n * @example formatRelativeTime(new Date()) => '۲ ساعت پیش'\n */\nexport function formatRelativeTime(date: Date | string | number): string {\n const now = new Date()\n const then = new Date(date)\n const diffInSeconds = Math.floor((now.getTime() - then.getTime()) / 1000)\n\n if (diffInSeconds < 60) {\n return 'همین الان'\n }\n\n const diffInMinutes = Math.floor(diffInSeconds / 60)\n if (diffInMinutes < 60) {\n return `${convertToLocalNumbers(diffInMinutes, 'fa')} دقیقه پیش`\n }\n\n const diffInHours = Math.floor(diffInMinutes / 60)\n if (diffInHours < 24) {\n return `${convertToLocalNumbers(diffInHours, 'fa')} ساعت پیش`\n }\n\n const diffInDays = Math.floor(diffInHours / 24)\n if (diffInDays < 7) {\n return `${convertToLocalNumbers(diffInDays, 'fa')} روز پیش`\n }\n\n const diffInWeeks = Math.floor(diffInDays / 7)\n if (diffInWeeks < 4) {\n return `${convertToLocalNumbers(diffInWeeks, 'fa')} هفته پیش`\n }\n\n const diffInMonths = Math.floor(diffInDays / 30)\n if (diffInMonths < 12) {\n return `${convertToLocalNumbers(diffInMonths, 'fa')} ماه پیش`\n }\n\n const diffInYears = Math.floor(diffInDays / 365)\n return `${convertToLocalNumbers(diffInYears, 'fa')} سال پیش`\n}\n\n/**\n * Format date to absolute format (Persian / Jalali)\n * Uses date-fns-jalali for accurate Jalali conversion.\n * @example formatAbsoluteTime(new Date()) => '۱۵ دی ۱۴۰۳، ۱۵:۳۰'\n */\nexport function formatAbsoluteTime(date: Date | string | number): string {\n const d = new Date(date)\n return formatJalaliDate(d, 'd MMMM yyyy، HH:mm')\n}\n","'use client'\n\nimport * as React from 'react'\nimport * as ProgressPrimitive from '@radix-ui/react-progress'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nconst progressVariants = cva('relative w-full overflow-hidden rounded-full bg-surface-300', {\n variants: {\n size: {\n sm: 'h-1',\n md: 'h-2',\n lg: 'h-3',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n})\n\nconst progressIndicatorVariants = cva('h-full w-full flex-1 transition-all origin-left rtl:origin-right', {\n variants: {\n variant: {\n primary: 'bg-[hsl(var(--brand-default))]',\n secondary: 'bg-foreground',\n success: 'bg-sentiment-positive',\n warning: 'bg-warning-500',\n destructive: 'bg-destructive-500',\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n})\n\nexport interface ProgressProps\n extends\n React.ComponentProps<typeof ProgressPrimitive.Root>,\n VariantProps<typeof progressVariants>,\n VariantProps<typeof progressIndicatorVariants> {\n label?: string\n showValue?: boolean\n}\n\nconst Progress = React.forwardRef<React.ElementRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n ({ className, value, size, variant, label, showValue = false, ...props }, ref) => {\n const clampedValue = Math.max(0, Math.min(100, value ?? 0))\n const displayValue = `${Math.round(clampedValue)}%`\n\n return (\n <div data-slot=\"progress-wrapper\" className=\"w-full space-y-2\">\n {(label || showValue) && (\n <div className=\"flex items-center justify-between text-sm\">\n {label && <span className=\"text-foreground\">{label}</span>}\n {showValue && <span className=\"text-foreground-light font-medium\">{displayValue}</span>}\n </div>\n )}\n <ProgressPrimitive.Root\n ref={ref}\n data-slot=\"progress\"\n className={cn(progressVariants({ size }), className)}\n value={value}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={cn(progressIndicatorVariants({ variant }))}\n style={{ transform: `scaleX(${clampedValue / 100})` }}\n />\n </ProgressPrimitive.Root>\n </div>\n )\n }\n)\n\nProgress.displayName = 'Progress'\n\nexport { Progress }\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const progressVariants: (props?: ({
|
|
7
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
declare const progressIndicatorVariants: (props?: ({
|
|
10
|
+
variant?: "warning" | "success" | "destructive" | "primary" | "secondary" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
interface ProgressProps extends React.ComponentProps<typeof ProgressPrimitive.Root>, VariantProps<typeof progressVariants>, VariantProps<typeof progressIndicatorVariants> {
|
|
13
|
+
label?: string;
|
|
14
|
+
showValue?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const Progress: React.ForwardRefExoticComponent<Omit<ProgressProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
|
|
18
|
+
export { Progress, type ProgressProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const progressVariants: (props?: ({
|
|
7
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
declare const progressIndicatorVariants: (props?: ({
|
|
10
|
+
variant?: "warning" | "success" | "destructive" | "primary" | "secondary" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
interface ProgressProps extends React.ComponentProps<typeof ProgressPrimitive.Root>, VariantProps<typeof progressVariants>, VariantProps<typeof progressIndicatorVariants> {
|
|
13
|
+
label?: string;
|
|
14
|
+
showValue?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const Progress: React.ForwardRefExoticComponent<Omit<ProgressProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
|
|
18
|
+
export { Progress, type ProgressProps };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
var progressVariants = cva("relative w-full overflow-hidden rounded-full bg-surface-300", {
|
|
13
|
+
variants: {
|
|
14
|
+
size: {
|
|
15
|
+
sm: "h-1",
|
|
16
|
+
md: "h-2",
|
|
17
|
+
lg: "h-3"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
size: "md"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var progressIndicatorVariants = cva("h-full w-full flex-1 transition-all origin-left rtl:origin-right", {
|
|
25
|
+
variants: {
|
|
26
|
+
variant: {
|
|
27
|
+
primary: "bg-[hsl(var(--brand-default))]",
|
|
28
|
+
secondary: "bg-foreground",
|
|
29
|
+
success: "bg-sentiment-positive",
|
|
30
|
+
warning: "bg-warning-500",
|
|
31
|
+
destructive: "bg-destructive-500"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
variant: "primary"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
var Progress = React.forwardRef(
|
|
39
|
+
({ className, value, size, variant, label, showValue = false, ...props }, ref) => {
|
|
40
|
+
const clampedValue = Math.max(0, Math.min(100, value ?? 0));
|
|
41
|
+
const displayValue = `${Math.round(clampedValue)}%`;
|
|
42
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "progress-wrapper", className: "w-full space-y-2", children: [
|
|
43
|
+
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
44
|
+
label && /* @__PURE__ */ jsx("span", { className: "text-foreground", children: label }),
|
|
45
|
+
showValue && /* @__PURE__ */ jsx("span", { className: "text-foreground-light font-medium", children: displayValue })
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
ProgressPrimitive.Root,
|
|
49
|
+
{
|
|
50
|
+
ref,
|
|
51
|
+
"data-slot": "progress",
|
|
52
|
+
className: cn(progressVariants({ size }), className),
|
|
53
|
+
value,
|
|
54
|
+
...props,
|
|
55
|
+
children: /* @__PURE__ */ jsx(
|
|
56
|
+
ProgressPrimitive.Indicator,
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "progress-indicator",
|
|
59
|
+
className: cn(progressIndicatorVariants({ variant })),
|
|
60
|
+
style: { transform: `scaleX(${clampedValue / 100})` }
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
] });
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
Progress.displayName = "Progress";
|
|
69
|
+
|
|
70
|
+
export { Progress };
|
|
71
|
+
//# sourceMappingURL=progress.js.map
|
|
72
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils.ts","../../../src/components/ui/progress.tsx"],"names":[],"mappings":";;;;;;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACEA,IAAM,gBAAA,GAAmB,IAAI,6DAAA,EAA+D;AAAA,EAC1F,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,KAAA;AAAA,MACJ,EAAA,EAAI,KAAA;AAAA,MACJ,EAAA,EAAI;AAAA;AACN,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,IAAA,EAAM;AAAA;AAEV,CAAC,CAAA;AAED,IAAM,yBAAA,GAA4B,IAAI,kEAAA,EAAoE;AAAA,EACxG,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,OAAA,EAAS,gCAAA;AAAA,MACT,SAAA,EAAW,eAAA;AAAA,MACX,OAAA,EAAS,uBAAA;AAAA,MACT,OAAA,EAAS,gBAAA;AAAA,MACT,WAAA,EAAa;AAAA;AACf,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS;AAAA;AAEb,CAAC,CAAA;AAWD,IAAM,QAAA,GAAiB,KAAA,CAAA,UAAA;AAAA,EACrB,CAAC,EAAE,SAAA,EAAW,KAAA,EAAO,IAAA,EAAM,OAAA,EAAS,KAAA,EAAO,SAAA,GAAY,KAAA,EAAO,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAChF,IAAA,MAAM,YAAA,GAAe,KAAK,GAAA,CAAI,CAAA,EAAG,KAAK,GAAA,CAAI,GAAA,EAAK,KAAA,IAAS,CAAC,CAAC,CAAA;AAC1D,IAAA,MAAM,YAAA,GAAe,CAAA,EAAG,IAAA,CAAK,KAAA,CAAM,YAAY,CAAC,CAAA,CAAA,CAAA;AAEhD,IAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,WAAA,EAAU,kBAAA,EAAmB,WAAU,kBAAA,EACxC,QAAA,EAAA;AAAA,MAAA,CAAA,KAAA,IAAS,SAAA,qBACT,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,2CAAA,EACZ,QAAA,EAAA;AAAA,QAAA,KAAA,oBAAS,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,iBAAA,EAAmB,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,QAClD,SAAA,oBAAa,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,qCAAqC,QAAA,EAAA,YAAA,EAAa;AAAA,OAAA,EAClF,CAAA;AAAA,sBAEF,GAAA;AAAA,QAAmB,iBAAA,CAAA,IAAA;AAAA,QAAlB;AAAA,UACC,GAAA;AAAA,UACA,WAAA,EAAU,UAAA;AAAA,UACV,WAAW,EAAA,CAAG,gBAAA,CAAiB,EAAE,IAAA,EAAM,GAAG,SAAS,CAAA;AAAA,UACnD,KAAA;AAAA,UACC,GAAG,KAAA;AAAA,UAEJ,QAAA,kBAAA,GAAA;AAAA,YAAmB,iBAAA,CAAA,SAAA;AAAA,YAAlB;AAAA,cACC,WAAA,EAAU,oBAAA;AAAA,cACV,WAAW,EAAA,CAAG,yBAAA,CAA0B,EAAE,OAAA,EAAS,CAAC,CAAA;AAAA,cACpD,OAAO,EAAE,SAAA,EAAW,CAAA,OAAA,EAAU,YAAA,GAAe,GAAG,CAAA,CAAA,CAAA;AAAI;AAAA;AACtD;AAAA;AACF,KAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEA,QAAA,CAAS,WAAA,GAAc,UAAA","file":"progress.js","sourcesContent":["import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\nimport { formatJalaliDate } from '@/lib/jalali-utils'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport type SupportedLocale = 'fa' | 'ar' | 'en'\n\n/**\n * Convert digits in a string to Persian/Arabic numerals based on locale.\n * @example convertToLocalNumbers('123', 'fa') => '۱۲۳'\n * @example convertToLocalNumbers('123', 'en') => '123'\n */\nexport function convertToLocalNumbers(text: string | number, locale: SupportedLocale): string {\n if (locale === 'fa' || locale === 'ar') {\n const persianDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']\n return String(text).replace(/\\d/g, (digit) => persianDigits[parseInt(digit)])\n }\n return String(text)\n}\n\n/**\n * Format large numbers with locale-aware suffixes (K/M/B).\n * @example formatLargeNumber(1500, 'fa') => '۱.۵ هزار'\n * @example formatLargeNumber(1500, 'en') => '1.5K'\n */\nexport function formatLargeNumber(num: number, locale: SupportedLocale): string {\n if (num >= 1_000_000_000) {\n const formatted = (num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'B' : ' میلیارد')\n }\n if (num >= 1_000_000) {\n const formatted = (num / 1_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'M' : ' میلیون')\n }\n if (num >= 1_000) {\n const formatted = (num / 1_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'K' : ' هزار')\n }\n return convertToLocalNumbers(num.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ','), locale)\n}\n\n/**\n * Format number to Instagram-style short format (English only).\n * @example formatNumber(123456, 'short') => '123K'\n * @example formatNumber(123456, 'exact') => '123,456'\n */\nexport function formatNumber(num: number | undefined, format: 'exact' | 'short' = 'exact'): string {\n if (num === undefined || num === null) return '0'\n\n if (format === 'exact') {\n return num.toLocaleString('en-US')\n }\n\n // Short format (Instagram style)\n if (num >= 1_000_000_000) {\n return `${(num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')}B`\n }\n if (num >= 1_000_000) {\n return `${(num / 1_000_000).toFixed(1).replace(/\\.0$/, '')}M`\n }\n if (num >= 1_000) {\n return `${(num / 1_000).toFixed(1).replace(/\\.0$/, '')}K`\n }\n return num.toString()\n}\n\n/**\n * Format date to relative time with absolute on hover (Persian)\n * @example formatRelativeTime(new Date()) => '۲ ساعت پیش'\n */\nexport function formatRelativeTime(date: Date | string | number): string {\n const now = new Date()\n const then = new Date(date)\n const diffInSeconds = Math.floor((now.getTime() - then.getTime()) / 1000)\n\n if (diffInSeconds < 60) {\n return 'همین الان'\n }\n\n const diffInMinutes = Math.floor(diffInSeconds / 60)\n if (diffInMinutes < 60) {\n return `${convertToLocalNumbers(diffInMinutes, 'fa')} دقیقه پیش`\n }\n\n const diffInHours = Math.floor(diffInMinutes / 60)\n if (diffInHours < 24) {\n return `${convertToLocalNumbers(diffInHours, 'fa')} ساعت پیش`\n }\n\n const diffInDays = Math.floor(diffInHours / 24)\n if (diffInDays < 7) {\n return `${convertToLocalNumbers(diffInDays, 'fa')} روز پیش`\n }\n\n const diffInWeeks = Math.floor(diffInDays / 7)\n if (diffInWeeks < 4) {\n return `${convertToLocalNumbers(diffInWeeks, 'fa')} هفته پیش`\n }\n\n const diffInMonths = Math.floor(diffInDays / 30)\n if (diffInMonths < 12) {\n return `${convertToLocalNumbers(diffInMonths, 'fa')} ماه پیش`\n }\n\n const diffInYears = Math.floor(diffInDays / 365)\n return `${convertToLocalNumbers(diffInYears, 'fa')} سال پیش`\n}\n\n/**\n * Format date to absolute format (Persian / Jalali)\n * Uses date-fns-jalali for accurate Jalali conversion.\n * @example formatAbsoluteTime(new Date()) => '۱۵ دی ۱۴۰۳، ۱۵:۳۰'\n */\nexport function formatAbsoluteTime(date: Date | string | number): string {\n const d = new Date(date)\n return formatJalaliDate(d, 'd MMMM yyyy، HH:mm')\n}\n","'use client'\n\nimport * as React from 'react'\nimport * as ProgressPrimitive from '@radix-ui/react-progress'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nconst progressVariants = cva('relative w-full overflow-hidden rounded-full bg-surface-300', {\n variants: {\n size: {\n sm: 'h-1',\n md: 'h-2',\n lg: 'h-3',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n})\n\nconst progressIndicatorVariants = cva('h-full w-full flex-1 transition-all origin-left rtl:origin-right', {\n variants: {\n variant: {\n primary: 'bg-[hsl(var(--brand-default))]',\n secondary: 'bg-foreground',\n success: 'bg-sentiment-positive',\n warning: 'bg-warning-500',\n destructive: 'bg-destructive-500',\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n})\n\nexport interface ProgressProps\n extends\n React.ComponentProps<typeof ProgressPrimitive.Root>,\n VariantProps<typeof progressVariants>,\n VariantProps<typeof progressIndicatorVariants> {\n label?: string\n showValue?: boolean\n}\n\nconst Progress = React.forwardRef<React.ElementRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n ({ className, value, size, variant, label, showValue = false, ...props }, ref) => {\n const clampedValue = Math.max(0, Math.min(100, value ?? 0))\n const displayValue = `${Math.round(clampedValue)}%`\n\n return (\n <div data-slot=\"progress-wrapper\" className=\"w-full space-y-2\">\n {(label || showValue) && (\n <div className=\"flex items-center justify-between text-sm\">\n {label && <span className=\"text-foreground\">{label}</span>}\n {showValue && <span className=\"text-foreground-light font-medium\">{displayValue}</span>}\n </div>\n )}\n <ProgressPrimitive.Root\n ref={ref}\n data-slot=\"progress\"\n className={cn(progressVariants({ size }), className)}\n value={value}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={cn(progressIndicatorVariants({ variant }))}\n style={{ transform: `scaleX(${clampedValue / 100})` }}\n />\n </ProgressPrimitive.Root>\n </div>\n )\n }\n)\n\nProgress.displayName = 'Progress'\n\nexport { Progress }\n"]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
|
6
|
+
var clsx = require('clsx');
|
|
7
|
+
var tailwindMerge = require('tailwind-merge');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
Object.keys(e).forEach(function (k) {
|
|
15
|
+
if (k !== 'default') {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return e[k]; }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
n.default = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
29
|
+
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
30
|
+
|
|
31
|
+
function cn(...inputs) {
|
|
32
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
33
|
+
}
|
|
34
|
+
var RadioCards = React__namespace.forwardRef(({ className, columns = 1, dir = "rtl", style, children, ...props }, ref) => {
|
|
35
|
+
const gridStyle = typeof columns === "number" ? { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` } : {};
|
|
36
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
RadioGroupPrimitive__namespace.Root,
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
"data-slot": "radio-cards",
|
|
41
|
+
dir,
|
|
42
|
+
className: cn("grid gap-3", className),
|
|
43
|
+
style: { ...gridStyle, ...style },
|
|
44
|
+
...props,
|
|
45
|
+
children
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
RadioCards.displayName = "RadioCards";
|
|
50
|
+
var RadioCardItem = React__namespace.forwardRef(({ className, children, ...props }, ref) => {
|
|
51
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
+
RadioGroupPrimitive__namespace.Item,
|
|
53
|
+
{
|
|
54
|
+
ref,
|
|
55
|
+
"data-slot": "radio-card-item",
|
|
56
|
+
className: cn(
|
|
57
|
+
"relative flex cursor-pointer rounded-lg border border-control bg-surface-100 px-4 py-3 transition-all",
|
|
58
|
+
"hover:border-brand/40 hover:bg-surface-200",
|
|
59
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2",
|
|
60
|
+
"data-[state=checked]:border-brand data-[state=checked]:bg-brand/5",
|
|
61
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props,
|
|
65
|
+
children
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
RadioCardItem.displayName = "RadioCardItem";
|
|
70
|
+
var RadioCardTitle = React__namespace.forwardRef(
|
|
71
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("h4", { ref, className: cn("text-sm font-semibold leading-none", className), ...props })
|
|
72
|
+
);
|
|
73
|
+
RadioCardTitle.displayName = "RadioCardTitle";
|
|
74
|
+
var RadioCardDescription = React__namespace.forwardRef(
|
|
75
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("p", { ref, className: cn("text-sm text-foreground-muted", className), ...props })
|
|
76
|
+
);
|
|
77
|
+
RadioCardDescription.displayName = "RadioCardDescription";
|
|
78
|
+
|
|
79
|
+
exports.RadioCardDescription = RadioCardDescription;
|
|
80
|
+
exports.RadioCardItem = RadioCardItem;
|
|
81
|
+
exports.RadioCardTitle = RadioCardTitle;
|
|
82
|
+
exports.RadioCards = RadioCards;
|
|
83
|
+
//# sourceMappingURL=radio-card.cjs.map
|
|
84
|
+
//# sourceMappingURL=radio-card.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils.ts","../../../src/components/ui/radio-card.tsx"],"names":["twMerge","clsx","React","jsx","RadioGroupPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACCA,IAAM,UAAA,GAAmBC,gBAAA,CAAA,UAAA,CAMvB,CAAC,EAAE,WAAW,OAAA,GAAU,CAAA,EAAG,GAAA,GAAM,KAAA,EAAO,KAAA,EAAO,QAAA,EAAU,GAAG,KAAA,IAAS,GAAA,KAAQ;AAG7E,EAAA,MAAM,SAAA,GACJ,OAAO,OAAA,KAAY,QAAA,GAAW,EAAE,qBAAqB,CAAA,OAAA,EAAU,OAAO,CAAA,iBAAA,CAAA,EAAoB,GAAI,EAAC;AAEjG,EAAA,uBACEC,cAAA;AAAA,IAAqBC,8BAAA,CAAA,IAAA;AAAA,IAApB;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,aAAA;AAAA,MACV,GAAA;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,YAAA,EAAc,SAAS,CAAA;AAAA,MACrC,KAAA,EAAO,EAAE,GAAG,SAAA,EAAW,GAAG,KAAA,EAAM;AAAA,MAC/B,GAAG,KAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;AACD,UAAA,CAAW,WAAA,GAAc,YAAA;AAEzB,IAAM,aAAA,GAAsBF,4BAG1B,CAAC,EAAE,WAAW,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAC5C,EAAA,uBACEC,cAAA;AAAA,IAAqBC,8BAAA,CAAA,IAAA;AAAA,IAApB;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,iBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,uGAAA;AAAA,QACA,4CAAA;AAAA,QACA,sGAAA;AAAA,QACA,mEAAA;AAAA,QACA,iDAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;AACD,aAAA,CAAc,WAAA,GAAc,eAAA;AAE5B,IAAM,cAAA,GAAuBF,gBAAA,CAAA,UAAA;AAAA,EAC3B,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACxBC,cAAA,CAAC,IAAA,EAAA,EAAG,GAAA,EAAU,WAAW,EAAA,CAAG,oCAAA,EAAsC,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO;AAE7F;AACA,cAAA,CAAe,WAAA,GAAc,gBAAA;AAE7B,IAAM,oBAAA,GAA6BD,gBAAA,CAAA,UAAA;AAAA,EACjC,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACxBC,cAAA,CAAC,GAAA,EAAA,EAAE,GAAA,EAAU,WAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO;AAEvF;AACA,oBAAA,CAAqB,WAAA,GAAc,sBAAA","file":"radio-card.cjs","sourcesContent":["import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\nimport { formatJalaliDate } from '@/lib/jalali-utils'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport type SupportedLocale = 'fa' | 'ar' | 'en'\n\n/**\n * Convert digits in a string to Persian/Arabic numerals based on locale.\n * @example convertToLocalNumbers('123', 'fa') => '۱۲۳'\n * @example convertToLocalNumbers('123', 'en') => '123'\n */\nexport function convertToLocalNumbers(text: string | number, locale: SupportedLocale): string {\n if (locale === 'fa' || locale === 'ar') {\n const persianDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']\n return String(text).replace(/\\d/g, (digit) => persianDigits[parseInt(digit)])\n }\n return String(text)\n}\n\n/**\n * Format large numbers with locale-aware suffixes (K/M/B).\n * @example formatLargeNumber(1500, 'fa') => '۱.۵ هزار'\n * @example formatLargeNumber(1500, 'en') => '1.5K'\n */\nexport function formatLargeNumber(num: number, locale: SupportedLocale): string {\n if (num >= 1_000_000_000) {\n const formatted = (num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'B' : ' میلیارد')\n }\n if (num >= 1_000_000) {\n const formatted = (num / 1_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'M' : ' میلیون')\n }\n if (num >= 1_000) {\n const formatted = (num / 1_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'K' : ' هزار')\n }\n return convertToLocalNumbers(num.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ','), locale)\n}\n\n/**\n * Format number to Instagram-style short format (English only).\n * @example formatNumber(123456, 'short') => '123K'\n * @example formatNumber(123456, 'exact') => '123,456'\n */\nexport function formatNumber(num: number | undefined, format: 'exact' | 'short' = 'exact'): string {\n if (num === undefined || num === null) return '0'\n\n if (format === 'exact') {\n return num.toLocaleString('en-US')\n }\n\n // Short format (Instagram style)\n if (num >= 1_000_000_000) {\n return `${(num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')}B`\n }\n if (num >= 1_000_000) {\n return `${(num / 1_000_000).toFixed(1).replace(/\\.0$/, '')}M`\n }\n if (num >= 1_000) {\n return `${(num / 1_000).toFixed(1).replace(/\\.0$/, '')}K`\n }\n return num.toString()\n}\n\n/**\n * Format date to relative time with absolute on hover (Persian)\n * @example formatRelativeTime(new Date()) => '۲ ساعت پیش'\n */\nexport function formatRelativeTime(date: Date | string | number): string {\n const now = new Date()\n const then = new Date(date)\n const diffInSeconds = Math.floor((now.getTime() - then.getTime()) / 1000)\n\n if (diffInSeconds < 60) {\n return 'همین الان'\n }\n\n const diffInMinutes = Math.floor(diffInSeconds / 60)\n if (diffInMinutes < 60) {\n return `${convertToLocalNumbers(diffInMinutes, 'fa')} دقیقه پیش`\n }\n\n const diffInHours = Math.floor(diffInMinutes / 60)\n if (diffInHours < 24) {\n return `${convertToLocalNumbers(diffInHours, 'fa')} ساعت پیش`\n }\n\n const diffInDays = Math.floor(diffInHours / 24)\n if (diffInDays < 7) {\n return `${convertToLocalNumbers(diffInDays, 'fa')} روز پیش`\n }\n\n const diffInWeeks = Math.floor(diffInDays / 7)\n if (diffInWeeks < 4) {\n return `${convertToLocalNumbers(diffInWeeks, 'fa')} هفته پیش`\n }\n\n const diffInMonths = Math.floor(diffInDays / 30)\n if (diffInMonths < 12) {\n return `${convertToLocalNumbers(diffInMonths, 'fa')} ماه پیش`\n }\n\n const diffInYears = Math.floor(diffInDays / 365)\n return `${convertToLocalNumbers(diffInYears, 'fa')} سال پیش`\n}\n\n/**\n * Format date to absolute format (Persian / Jalali)\n * Uses date-fns-jalali for accurate Jalali conversion.\n * @example formatAbsoluteTime(new Date()) => '۱۵ دی ۱۴۰۳، ۱۵:۳۰'\n */\nexport function formatAbsoluteTime(date: Date | string | number): string {\n const d = new Date(date)\n return formatJalaliDate(d, 'd MMMM yyyy، HH:mm')\n}\n","'use client'\n\nimport * as React from 'react'\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\n\nimport { cn } from '@/lib/utils'\n\nconst RadioCards = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> & {\n columns?: number\n dir?: 'rtl' | 'ltr'\n }\n>(({ className, columns = 1, dir = 'rtl', style, children, ...props }, ref) => {\n // Build grid-template-columns via inline style — Tailwind JIT can't handle\n // dynamic class names like `grid-cols-${n}` (they are purged at build time)\n const gridStyle: React.CSSProperties =\n typeof columns === 'number' ? { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` } : {}\n\n return (\n <RadioGroupPrimitive.Root\n ref={ref}\n data-slot=\"radio-cards\"\n dir={dir}\n className={cn('grid gap-3', className)}\n style={{ ...gridStyle, ...style }}\n {...props}\n >\n {children}\n </RadioGroupPrimitive.Root>\n )\n})\nRadioCards.displayName = 'RadioCards'\n\nconst RadioCardItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, children, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n data-slot=\"radio-card-item\"\n className={cn(\n 'relative flex cursor-pointer rounded-lg border border-control bg-surface-100 px-4 py-3 transition-all',\n 'hover:border-brand/40 hover:bg-surface-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2',\n 'data-[state=checked]:border-brand data-[state=checked]:bg-brand/5',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className\n )}\n {...props}\n >\n {children}\n </RadioGroupPrimitive.Item>\n )\n})\nRadioCardItem.displayName = 'RadioCardItem'\n\nconst RadioCardTitle = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h4 ref={ref} className={cn('text-sm font-semibold leading-none', className)} {...props} />\n )\n)\nRadioCardTitle.displayName = 'RadioCardTitle'\n\nconst RadioCardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n ({ className, ...props }, ref) => (\n <p ref={ref} className={cn('text-sm text-foreground-muted', className)} {...props} />\n )\n)\nRadioCardDescription.displayName = 'RadioCardDescription'\n\nexport { RadioCards, RadioCardItem, RadioCardTitle, RadioCardDescription }\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
|
|
4
|
+
declare const RadioCards: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
5
|
+
columns?: number;
|
|
6
|
+
dir?: "rtl" | "ltr";
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const RadioCardItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
declare const RadioCardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
10
|
+
declare const RadioCardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
11
|
+
|
|
12
|
+
export { RadioCardDescription, RadioCardItem, RadioCardTitle, RadioCards };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
|
|
4
|
+
declare const RadioCards: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
5
|
+
columns?: number;
|
|
6
|
+
dir?: "rtl" | "ltr";
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const RadioCardItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
declare const RadioCardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
10
|
+
declare const RadioCardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
11
|
+
|
|
12
|
+
export { RadioCardDescription, RadioCardItem, RadioCardTitle, RadioCards };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return twMerge(clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
var RadioCards = React.forwardRef(({ className, columns = 1, dir = "rtl", style, children, ...props }, ref) => {
|
|
12
|
+
const gridStyle = typeof columns === "number" ? { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` } : {};
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
RadioGroupPrimitive.Root,
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
"data-slot": "radio-cards",
|
|
18
|
+
dir,
|
|
19
|
+
className: cn("grid gap-3", className),
|
|
20
|
+
style: { ...gridStyle, ...style },
|
|
21
|
+
...props,
|
|
22
|
+
children
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
RadioCards.displayName = "RadioCards";
|
|
27
|
+
var RadioCardItem = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
RadioGroupPrimitive.Item,
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
"data-slot": "radio-card-item",
|
|
33
|
+
className: cn(
|
|
34
|
+
"relative flex cursor-pointer rounded-lg border border-control bg-surface-100 px-4 py-3 transition-all",
|
|
35
|
+
"hover:border-brand/40 hover:bg-surface-200",
|
|
36
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2",
|
|
37
|
+
"data-[state=checked]:border-brand data-[state=checked]:bg-brand/5",
|
|
38
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
...props,
|
|
42
|
+
children
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
RadioCardItem.displayName = "RadioCardItem";
|
|
47
|
+
var RadioCardTitle = React.forwardRef(
|
|
48
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("h4", { ref, className: cn("text-sm font-semibold leading-none", className), ...props })
|
|
49
|
+
);
|
|
50
|
+
RadioCardTitle.displayName = "RadioCardTitle";
|
|
51
|
+
var RadioCardDescription = React.forwardRef(
|
|
52
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("text-sm text-foreground-muted", className), ...props })
|
|
53
|
+
);
|
|
54
|
+
RadioCardDescription.displayName = "RadioCardDescription";
|
|
55
|
+
|
|
56
|
+
export { RadioCardDescription, RadioCardItem, RadioCardTitle, RadioCards };
|
|
57
|
+
//# sourceMappingURL=radio-card.js.map
|
|
58
|
+
//# sourceMappingURL=radio-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils.ts","../../../src/components/ui/radio-card.tsx"],"names":[],"mappings":";;;;;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACCA,IAAM,UAAA,GAAmB,KAAA,CAAA,UAAA,CAMvB,CAAC,EAAE,WAAW,OAAA,GAAU,CAAA,EAAG,GAAA,GAAM,KAAA,EAAO,KAAA,EAAO,QAAA,EAAU,GAAG,KAAA,IAAS,GAAA,KAAQ;AAG7E,EAAA,MAAM,SAAA,GACJ,OAAO,OAAA,KAAY,QAAA,GAAW,EAAE,qBAAqB,CAAA,OAAA,EAAU,OAAO,CAAA,iBAAA,CAAA,EAAoB,GAAI,EAAC;AAEjG,EAAA,uBACE,GAAA;AAAA,IAAqB,mBAAA,CAAA,IAAA;AAAA,IAApB;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,aAAA;AAAA,MACV,GAAA;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,YAAA,EAAc,SAAS,CAAA;AAAA,MACrC,KAAA,EAAO,EAAE,GAAG,SAAA,EAAW,GAAG,KAAA,EAAM;AAAA,MAC/B,GAAG,KAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;AACD,UAAA,CAAW,WAAA,GAAc,YAAA;AAEzB,IAAM,aAAA,GAAsB,iBAG1B,CAAC,EAAE,WAAW,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAC5C,EAAA,uBACE,GAAA;AAAA,IAAqB,mBAAA,CAAA,IAAA;AAAA,IAApB;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,iBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,uGAAA;AAAA,QACA,4CAAA;AAAA,QACA,sGAAA;AAAA,QACA,mEAAA;AAAA,QACA,iDAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEH;AAAA;AAAA,GACH;AAEJ,CAAC;AACD,aAAA,CAAc,WAAA,GAAc,eAAA;AAE5B,IAAM,cAAA,GAAuB,KAAA,CAAA,UAAA;AAAA,EAC3B,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACxB,GAAA,CAAC,IAAA,EAAA,EAAG,GAAA,EAAU,WAAW,EAAA,CAAG,oCAAA,EAAsC,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO;AAE7F;AACA,cAAA,CAAe,WAAA,GAAc,gBAAA;AAE7B,IAAM,oBAAA,GAA6B,KAAA,CAAA,UAAA;AAAA,EACjC,CAAC,EAAE,SAAA,EAAW,GAAG,KAAA,IAAS,GAAA,qBACxB,GAAA,CAAC,GAAA,EAAA,EAAE,GAAA,EAAU,WAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO;AAEvF;AACA,oBAAA,CAAqB,WAAA,GAAc,sBAAA","file":"radio-card.js","sourcesContent":["import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\nimport { formatJalaliDate } from '@/lib/jalali-utils'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport type SupportedLocale = 'fa' | 'ar' | 'en'\n\n/**\n * Convert digits in a string to Persian/Arabic numerals based on locale.\n * @example convertToLocalNumbers('123', 'fa') => '۱۲۳'\n * @example convertToLocalNumbers('123', 'en') => '123'\n */\nexport function convertToLocalNumbers(text: string | number, locale: SupportedLocale): string {\n if (locale === 'fa' || locale === 'ar') {\n const persianDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']\n return String(text).replace(/\\d/g, (digit) => persianDigits[parseInt(digit)])\n }\n return String(text)\n}\n\n/**\n * Format large numbers with locale-aware suffixes (K/M/B).\n * @example formatLargeNumber(1500, 'fa') => '۱.۵ هزار'\n * @example formatLargeNumber(1500, 'en') => '1.5K'\n */\nexport function formatLargeNumber(num: number, locale: SupportedLocale): string {\n if (num >= 1_000_000_000) {\n const formatted = (num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'B' : ' میلیارد')\n }\n if (num >= 1_000_000) {\n const formatted = (num / 1_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'M' : ' میلیون')\n }\n if (num >= 1_000) {\n const formatted = (num / 1_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'K' : ' هزار')\n }\n return convertToLocalNumbers(num.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ','), locale)\n}\n\n/**\n * Format number to Instagram-style short format (English only).\n * @example formatNumber(123456, 'short') => '123K'\n * @example formatNumber(123456, 'exact') => '123,456'\n */\nexport function formatNumber(num: number | undefined, format: 'exact' | 'short' = 'exact'): string {\n if (num === undefined || num === null) return '0'\n\n if (format === 'exact') {\n return num.toLocaleString('en-US')\n }\n\n // Short format (Instagram style)\n if (num >= 1_000_000_000) {\n return `${(num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')}B`\n }\n if (num >= 1_000_000) {\n return `${(num / 1_000_000).toFixed(1).replace(/\\.0$/, '')}M`\n }\n if (num >= 1_000) {\n return `${(num / 1_000).toFixed(1).replace(/\\.0$/, '')}K`\n }\n return num.toString()\n}\n\n/**\n * Format date to relative time with absolute on hover (Persian)\n * @example formatRelativeTime(new Date()) => '۲ ساعت پیش'\n */\nexport function formatRelativeTime(date: Date | string | number): string {\n const now = new Date()\n const then = new Date(date)\n const diffInSeconds = Math.floor((now.getTime() - then.getTime()) / 1000)\n\n if (diffInSeconds < 60) {\n return 'همین الان'\n }\n\n const diffInMinutes = Math.floor(diffInSeconds / 60)\n if (diffInMinutes < 60) {\n return `${convertToLocalNumbers(diffInMinutes, 'fa')} دقیقه پیش`\n }\n\n const diffInHours = Math.floor(diffInMinutes / 60)\n if (diffInHours < 24) {\n return `${convertToLocalNumbers(diffInHours, 'fa')} ساعت پیش`\n }\n\n const diffInDays = Math.floor(diffInHours / 24)\n if (diffInDays < 7) {\n return `${convertToLocalNumbers(diffInDays, 'fa')} روز پیش`\n }\n\n const diffInWeeks = Math.floor(diffInDays / 7)\n if (diffInWeeks < 4) {\n return `${convertToLocalNumbers(diffInWeeks, 'fa')} هفته پیش`\n }\n\n const diffInMonths = Math.floor(diffInDays / 30)\n if (diffInMonths < 12) {\n return `${convertToLocalNumbers(diffInMonths, 'fa')} ماه پیش`\n }\n\n const diffInYears = Math.floor(diffInDays / 365)\n return `${convertToLocalNumbers(diffInYears, 'fa')} سال پیش`\n}\n\n/**\n * Format date to absolute format (Persian / Jalali)\n * Uses date-fns-jalali for accurate Jalali conversion.\n * @example formatAbsoluteTime(new Date()) => '۱۵ دی ۱۴۰۳، ۱۵:۳۰'\n */\nexport function formatAbsoluteTime(date: Date | string | number): string {\n const d = new Date(date)\n return formatJalaliDate(d, 'd MMMM yyyy، HH:mm')\n}\n","'use client'\n\nimport * as React from 'react'\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\n\nimport { cn } from '@/lib/utils'\n\nconst RadioCards = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> & {\n columns?: number\n dir?: 'rtl' | 'ltr'\n }\n>(({ className, columns = 1, dir = 'rtl', style, children, ...props }, ref) => {\n // Build grid-template-columns via inline style — Tailwind JIT can't handle\n // dynamic class names like `grid-cols-${n}` (they are purged at build time)\n const gridStyle: React.CSSProperties =\n typeof columns === 'number' ? { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` } : {}\n\n return (\n <RadioGroupPrimitive.Root\n ref={ref}\n data-slot=\"radio-cards\"\n dir={dir}\n className={cn('grid gap-3', className)}\n style={{ ...gridStyle, ...style }}\n {...props}\n >\n {children}\n </RadioGroupPrimitive.Root>\n )\n})\nRadioCards.displayName = 'RadioCards'\n\nconst RadioCardItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, children, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n data-slot=\"radio-card-item\"\n className={cn(\n 'relative flex cursor-pointer rounded-lg border border-control bg-surface-100 px-4 py-3 transition-all',\n 'hover:border-brand/40 hover:bg-surface-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2',\n 'data-[state=checked]:border-brand data-[state=checked]:bg-brand/5',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className\n )}\n {...props}\n >\n {children}\n </RadioGroupPrimitive.Item>\n )\n})\nRadioCardItem.displayName = 'RadioCardItem'\n\nconst RadioCardTitle = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h4 ref={ref} className={cn('text-sm font-semibold leading-none', className)} {...props} />\n )\n)\nRadioCardTitle.displayName = 'RadioCardTitle'\n\nconst RadioCardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n ({ className, ...props }, ref) => (\n <p ref={ref} className={cn('text-sm text-foreground-muted', className)} {...props} />\n )\n)\nRadioCardDescription.displayName = 'RadioCardDescription'\n\nexport { RadioCards, RadioCardItem, RadioCardTitle, RadioCardDescription }\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
|
6
|
+
var lucideReact = require('lucide-react');
|
|
7
|
+
var clsx = require('clsx');
|
|
8
|
+
var tailwindMerge = require('tailwind-merge');
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
|
|
11
|
+
function _interopNamespace(e) {
|
|
12
|
+
if (e && e.__esModule) return e;
|
|
13
|
+
var n = Object.create(null);
|
|
14
|
+
if (e) {
|
|
15
|
+
Object.keys(e).forEach(function (k) {
|
|
16
|
+
if (k !== 'default') {
|
|
17
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return e[k]; }
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
n.default = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
|
+
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
31
|
+
|
|
32
|
+
function cn(...inputs) {
|
|
33
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
34
|
+
}
|
|
35
|
+
var RadioGroup = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Root, { ref, "data-slot": "radio-group", className: cn("grid gap-3", className), ...props }));
|
|
36
|
+
var RadioGroupItem = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
RadioGroupPrimitive__namespace.Item,
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
"data-slot": "radio-group-item",
|
|
41
|
+
className: cn(
|
|
42
|
+
"border-control bg-control 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 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-all duration-150 outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props,
|
|
46
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
47
|
+
RadioGroupPrimitive__namespace.Indicator,
|
|
48
|
+
{
|
|
49
|
+
"data-slot": "radio-group-indicator",
|
|
50
|
+
className: "relative flex items-center justify-center",
|
|
51
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleIcon, { className: "fill-brand absolute top-1/2 start-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rtl:translate-x-1/2" })
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
));
|
|
56
|
+
RadioGroup.displayName = "RadioGroup";
|
|
57
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
58
|
+
|
|
59
|
+
exports.RadioGroup = RadioGroup;
|
|
60
|
+
exports.RadioGroupItem = RadioGroupItem;
|
|
61
|
+
//# sourceMappingURL=radio-group.cjs.map
|
|
62
|
+
//# sourceMappingURL=radio-group.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils.ts","../../../src/components/ui/radio-group.tsx"],"names":["twMerge","clsx","React","jsx","RadioGroupPrimitive","CircleIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACEA,IAAM,UAAA,GAAmBC,4BAGvB,CAAC,EAAE,WAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1BC,cAAA,CAAqBC,8BAAA,CAAA,IAAA,EAApB,EAAyB,GAAA,EAAU,WAAA,EAAU,eAAc,SAAA,EAAW,EAAA,CAAG,cAAc,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAChH;AAED,IAAM,cAAA,GAAuBF,4BAG3B,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1BC,cAAA;AAAA,EAAqBC,8BAAA,CAAA,IAAA;AAAA,EAApB;AAAA,IACC,GAAA;AAAA,IACA,WAAA,EAAU,kBAAA;AAAA,IACV,SAAA,EAAW,EAAA;AAAA,MACT,mXAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG,KAAA;AAAA,IAEJ,QAAA,kBAAAD,cAAA;AAAA,MAAqBC,8BAAA,CAAA,SAAA;AAAA,MAApB;AAAA,QACC,WAAA,EAAU,uBAAA;AAAA,QACV,SAAA,EAAU,2CAAA;AAAA,QAEV,QAAA,kBAAAD,cAAA,CAACE,sBAAA,EAAA,EAAW,SAAA,EAAU,oGAAA,EAAqG;AAAA;AAAA;AAC7H;AACF,CACD;AAED,UAAA,CAAW,WAAA,GAAc,YAAA;AACzB,cAAA,CAAe,WAAA,GAAc,gBAAA","file":"radio-group.cjs","sourcesContent":["import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\nimport { formatJalaliDate } from '@/lib/jalali-utils'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport type SupportedLocale = 'fa' | 'ar' | 'en'\n\n/**\n * Convert digits in a string to Persian/Arabic numerals based on locale.\n * @example convertToLocalNumbers('123', 'fa') => '۱۲۳'\n * @example convertToLocalNumbers('123', 'en') => '123'\n */\nexport function convertToLocalNumbers(text: string | number, locale: SupportedLocale): string {\n if (locale === 'fa' || locale === 'ar') {\n const persianDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']\n return String(text).replace(/\\d/g, (digit) => persianDigits[parseInt(digit)])\n }\n return String(text)\n}\n\n/**\n * Format large numbers with locale-aware suffixes (K/M/B).\n * @example formatLargeNumber(1500, 'fa') => '۱.۵ هزار'\n * @example formatLargeNumber(1500, 'en') => '1.5K'\n */\nexport function formatLargeNumber(num: number, locale: SupportedLocale): string {\n if (num >= 1_000_000_000) {\n const formatted = (num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'B' : ' میلیارد')\n }\n if (num >= 1_000_000) {\n const formatted = (num / 1_000_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'M' : ' میلیون')\n }\n if (num >= 1_000) {\n const formatted = (num / 1_000).toFixed(1).replace(/\\.0$/, '')\n return convertToLocalNumbers(formatted, locale) + (locale === 'en' ? 'K' : ' هزار')\n }\n return convertToLocalNumbers(num.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ','), locale)\n}\n\n/**\n * Format number to Instagram-style short format (English only).\n * @example formatNumber(123456, 'short') => '123K'\n * @example formatNumber(123456, 'exact') => '123,456'\n */\nexport function formatNumber(num: number | undefined, format: 'exact' | 'short' = 'exact'): string {\n if (num === undefined || num === null) return '0'\n\n if (format === 'exact') {\n return num.toLocaleString('en-US')\n }\n\n // Short format (Instagram style)\n if (num >= 1_000_000_000) {\n return `${(num / 1_000_000_000).toFixed(1).replace(/\\.0$/, '')}B`\n }\n if (num >= 1_000_000) {\n return `${(num / 1_000_000).toFixed(1).replace(/\\.0$/, '')}M`\n }\n if (num >= 1_000) {\n return `${(num / 1_000).toFixed(1).replace(/\\.0$/, '')}K`\n }\n return num.toString()\n}\n\n/**\n * Format date to relative time with absolute on hover (Persian)\n * @example formatRelativeTime(new Date()) => '۲ ساعت پیش'\n */\nexport function formatRelativeTime(date: Date | string | number): string {\n const now = new Date()\n const then = new Date(date)\n const diffInSeconds = Math.floor((now.getTime() - then.getTime()) / 1000)\n\n if (diffInSeconds < 60) {\n return 'همین الان'\n }\n\n const diffInMinutes = Math.floor(diffInSeconds / 60)\n if (diffInMinutes < 60) {\n return `${convertToLocalNumbers(diffInMinutes, 'fa')} دقیقه پیش`\n }\n\n const diffInHours = Math.floor(diffInMinutes / 60)\n if (diffInHours < 24) {\n return `${convertToLocalNumbers(diffInHours, 'fa')} ساعت پیش`\n }\n\n const diffInDays = Math.floor(diffInHours / 24)\n if (diffInDays < 7) {\n return `${convertToLocalNumbers(diffInDays, 'fa')} روز پیش`\n }\n\n const diffInWeeks = Math.floor(diffInDays / 7)\n if (diffInWeeks < 4) {\n return `${convertToLocalNumbers(diffInWeeks, 'fa')} هفته پیش`\n }\n\n const diffInMonths = Math.floor(diffInDays / 30)\n if (diffInMonths < 12) {\n return `${convertToLocalNumbers(diffInMonths, 'fa')} ماه پیش`\n }\n\n const diffInYears = Math.floor(diffInDays / 365)\n return `${convertToLocalNumbers(diffInYears, 'fa')} سال پیش`\n}\n\n/**\n * Format date to absolute format (Persian / Jalali)\n * Uses date-fns-jalali for accurate Jalali conversion.\n * @example formatAbsoluteTime(new Date()) => '۱۵ دی ۱۴۰۳، ۱۵:۳۰'\n */\nexport function formatAbsoluteTime(date: Date | string | number): string {\n const d = new Date(date)\n return formatJalaliDate(d, 'd MMMM yyyy، HH:mm')\n}\n","'use client'\n\nimport * as React from 'react'\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\nimport { CircleIcon } from 'lucide-react'\n\nimport { cn } from '@/lib/utils'\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Root ref={ref} data-slot=\"radio-group\" className={cn('grid gap-3', className)} {...props} />\n))\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n data-slot=\"radio-group-item\"\n className={cn(\n 'border-control bg-control 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 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-all duration-150 outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator\n data-slot=\"radio-group-indicator\"\n className=\"relative flex items-center justify-center\"\n >\n <CircleIcon className=\"fill-brand absolute top-1/2 start-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rtl:translate-x-1/2\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n))\n\nRadioGroup.displayName = 'RadioGroup'\nRadioGroupItem.displayName = 'RadioGroupItem'\n\nexport { RadioGroup, RadioGroupItem }\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
|
|
4
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
|
|
7
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
|
|
4
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
|
|
7
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
4
|
+
import { CircleIcon } from 'lucide-react';
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
var RadioGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, { ref, "data-slot": "radio-group", className: cn("grid gap-3", className), ...props }));
|
|
13
|
+
var RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
14
|
+
RadioGroupPrimitive.Item,
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
"data-slot": "radio-group-item",
|
|
18
|
+
className: cn(
|
|
19
|
+
"border-control bg-control 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 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-all duration-150 outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
20
|
+
className
|
|
21
|
+
),
|
|
22
|
+
...props,
|
|
23
|
+
children: /* @__PURE__ */ jsx(
|
|
24
|
+
RadioGroupPrimitive.Indicator,
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "radio-group-indicator",
|
|
27
|
+
className: "relative flex items-center justify-center",
|
|
28
|
+
children: /* @__PURE__ */ jsx(CircleIcon, { className: "fill-brand absolute top-1/2 start-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rtl:translate-x-1/2" })
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
));
|
|
33
|
+
RadioGroup.displayName = "RadioGroup";
|
|
34
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
35
|
+
|
|
36
|
+
export { RadioGroup, RadioGroupItem };
|
|
37
|
+
//# sourceMappingURL=radio-group.js.map
|
|
38
|
+
//# sourceMappingURL=radio-group.js.map
|