@parto-system-design/ui 1.1.5 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/AGENTS.md +233 -0
  2. package/LICENSE +21 -0
  3. package/README.md +96 -43
  4. package/dist/chunk-2ACKKPWA.cjs +112 -0
  5. package/dist/chunk-2ACKKPWA.cjs.map +1 -0
  6. package/dist/chunk-2UD3LGVX.cjs +316 -0
  7. package/dist/chunk-2UD3LGVX.cjs.map +1 -0
  8. package/dist/chunk-3QYYPPFJ.js +269 -0
  9. package/dist/chunk-3QYYPPFJ.js.map +1 -0
  10. package/dist/chunk-4SVQNEVH.js +173 -0
  11. package/dist/chunk-4SVQNEVH.js.map +1 -0
  12. package/dist/chunk-4WONHORR.cjs +152 -0
  13. package/dist/chunk-4WONHORR.cjs.map +1 -0
  14. package/dist/chunk-5HCXH6GS.js +409 -0
  15. package/dist/chunk-5HCXH6GS.js.map +1 -0
  16. package/dist/chunk-5JJSRGJD.js +31 -0
  17. package/dist/chunk-5JJSRGJD.js.map +1 -0
  18. package/dist/chunk-5K6E4ZSW.cjs +77 -0
  19. package/dist/chunk-5K6E4ZSW.cjs.map +1 -0
  20. package/dist/chunk-5NY26ULO.js +89 -0
  21. package/dist/chunk-5NY26ULO.js.map +1 -0
  22. package/dist/chunk-7RVPG3LE.cjs +231 -0
  23. package/dist/chunk-7RVPG3LE.cjs.map +1 -0
  24. package/dist/chunk-AYEK3WOM.js +207 -0
  25. package/dist/chunk-AYEK3WOM.js.map +1 -0
  26. package/dist/chunk-BRMBLIQG.js +53 -0
  27. package/dist/chunk-BRMBLIQG.js.map +1 -0
  28. package/dist/chunk-CAJKSTXX.cjs +54 -0
  29. package/dist/chunk-CAJKSTXX.cjs.map +1 -0
  30. package/dist/chunk-CKFWMHQU.js +401 -0
  31. package/dist/chunk-CKFWMHQU.js.map +1 -0
  32. package/dist/chunk-CV3N3HVK.js +672 -0
  33. package/dist/chunk-CV3N3HVK.js.map +1 -0
  34. package/dist/chunk-D2EBLE2B.cjs +220 -0
  35. package/dist/chunk-D2EBLE2B.cjs.map +1 -0
  36. package/dist/chunk-GCZ6YATL.js +940 -0
  37. package/dist/chunk-GCZ6YATL.js.map +1 -0
  38. package/dist/chunk-GKRAZGDI.cjs +84 -0
  39. package/dist/chunk-GKRAZGDI.cjs.map +1 -0
  40. package/dist/chunk-GPYJ66CG.js +45 -0
  41. package/dist/chunk-GPYJ66CG.js.map +1 -0
  42. package/dist/chunk-HF6XU5NI.js +84 -0
  43. package/dist/chunk-HF6XU5NI.js.map +1 -0
  44. package/dist/chunk-HJPDZOMJ.cjs +87 -0
  45. package/dist/chunk-HJPDZOMJ.cjs.map +1 -0
  46. package/dist/chunk-HS3XI3CC.cjs +69 -0
  47. package/dist/chunk-HS3XI3CC.cjs.map +1 -0
  48. package/dist/chunk-HUCC3QH5.cjs +53 -0
  49. package/dist/chunk-HUCC3QH5.cjs.map +1 -0
  50. package/dist/chunk-HYZ6BQPS.cjs +425 -0
  51. package/dist/chunk-HYZ6BQPS.cjs.map +1 -0
  52. package/dist/chunk-ISCSZMYW.cjs +106 -0
  53. package/dist/chunk-ISCSZMYW.cjs.map +1 -0
  54. package/dist/chunk-IXFEFIDO.js +82 -0
  55. package/dist/chunk-IXFEFIDO.js.map +1 -0
  56. package/dist/chunk-JCJLN437.js +108 -0
  57. package/dist/chunk-JCJLN437.js.map +1 -0
  58. package/dist/chunk-JMKNNH63.cjs +982 -0
  59. package/dist/chunk-JMKNNH63.cjs.map +1 -0
  60. package/dist/chunk-JUBHQAA2.js +53 -0
  61. package/dist/chunk-JUBHQAA2.js.map +1 -0
  62. package/dist/chunk-K6G63EED.cjs +41 -0
  63. package/dist/chunk-K6G63EED.cjs.map +1 -0
  64. package/dist/chunk-KCWRCSI7.js +62 -0
  65. package/dist/chunk-KCWRCSI7.js.map +1 -0
  66. package/dist/chunk-KYM7NIJO.cjs +433 -0
  67. package/dist/chunk-KYM7NIJO.cjs.map +1 -0
  68. package/dist/chunk-L2L5CKC2.js +291 -0
  69. package/dist/chunk-L2L5CKC2.js.map +1 -0
  70. package/dist/chunk-M5CHZ5BA.js +124 -0
  71. package/dist/chunk-M5CHZ5BA.js.map +1 -0
  72. package/dist/chunk-MEK4RSGC.js +65 -0
  73. package/dist/chunk-MEK4RSGC.js.map +1 -0
  74. package/dist/chunk-MEKWH3GS.js +89 -0
  75. package/dist/chunk-MEKWH3GS.js.map +1 -0
  76. package/dist/chunk-MFTX2DDQ.js +27 -0
  77. package/dist/chunk-MFTX2DDQ.js.map +1 -0
  78. package/dist/chunk-MMC6M35Q.cjs +272 -0
  79. package/dist/chunk-MMC6M35Q.cjs.map +1 -0
  80. package/dist/chunk-NMH43BDC.js +130 -0
  81. package/dist/chunk-NMH43BDC.js.map +1 -0
  82. package/dist/chunk-NORDUD2T.cjs +135 -0
  83. package/dist/chunk-NORDUD2T.cjs.map +1 -0
  84. package/dist/chunk-NV4JOKWL.cjs +197 -0
  85. package/dist/chunk-NV4JOKWL.cjs.map +1 -0
  86. package/dist/chunk-O2JG7WY5.cjs +121 -0
  87. package/dist/chunk-O2JG7WY5.cjs.map +1 -0
  88. package/dist/chunk-ONO2FTV4.cjs +68 -0
  89. package/dist/chunk-ONO2FTV4.cjs.map +1 -0
  90. package/dist/chunk-OQB6HIUL.cjs +108 -0
  91. package/dist/chunk-OQB6HIUL.cjs.map +1 -0
  92. package/dist/chunk-OS6CMYAS.cjs +79 -0
  93. package/dist/chunk-OS6CMYAS.cjs.map +1 -0
  94. package/dist/chunk-PYURPUTV.js +402 -0
  95. package/dist/chunk-PYURPUTV.js.map +1 -0
  96. package/dist/chunk-RJ3HYZ7S.js +44 -0
  97. package/dist/chunk-RJ3HYZ7S.js.map +1 -0
  98. package/dist/chunk-RZNRIOLT.js +128 -0
  99. package/dist/chunk-RZNRIOLT.js.map +1 -0
  100. package/dist/chunk-S3T2L6NA.js +38 -0
  101. package/dist/chunk-S3T2L6NA.js.map +1 -0
  102. package/dist/chunk-S5IPJQZ3.cjs +161 -0
  103. package/dist/chunk-S5IPJQZ3.cjs.map +1 -0
  104. package/dist/chunk-SB5DSYR5.js +211 -0
  105. package/dist/chunk-SB5DSYR5.js.map +1 -0
  106. package/dist/chunk-SFXV2DUH.js +106 -0
  107. package/dist/chunk-SFXV2DUH.js.map +1 -0
  108. package/dist/chunk-SXEPGD4Z.cjs +152 -0
  109. package/dist/chunk-SXEPGD4Z.cjs.map +1 -0
  110. package/dist/chunk-SXWSOU3Y.js +89 -0
  111. package/dist/chunk-SXWSOU3Y.js.map +1 -0
  112. package/dist/chunk-SZMVOHT7.cjs +107 -0
  113. package/dist/chunk-SZMVOHT7.cjs.map +1 -0
  114. package/dist/chunk-TWJXOV4C.js +145 -0
  115. package/dist/chunk-TWJXOV4C.js.map +1 -0
  116. package/dist/chunk-U3ADRIVO.cjs +434 -0
  117. package/dist/chunk-U3ADRIVO.cjs.map +1 -0
  118. package/dist/chunk-U5FLLCGC.cjs +151 -0
  119. package/dist/chunk-U5FLLCGC.cjs.map +1 -0
  120. package/dist/chunk-UOZN45G4.cjs +130 -0
  121. package/dist/chunk-UOZN45G4.cjs.map +1 -0
  122. package/dist/chunk-VHLDOG74.cjs +167 -0
  123. package/dist/chunk-VHLDOG74.cjs.map +1 -0
  124. package/dist/chunk-YC5KLN6I.js +139 -0
  125. package/dist/chunk-YC5KLN6I.js.map +1 -0
  126. package/dist/chunk-YENXXYUV.cjs +111 -0
  127. package/dist/chunk-YENXXYUV.cjs.map +1 -0
  128. package/dist/chunk-YFQWC2PW.js +113 -0
  129. package/dist/chunk-YFQWC2PW.js.map +1 -0
  130. package/dist/chunk-Z2TY4A75.cjs +700 -0
  131. package/dist/chunk-Z2TY4A75.cjs.map +1 -0
  132. package/dist/chunk-Z56O7UEU.cjs +136 -0
  133. package/dist/chunk-Z56O7UEU.cjs.map +1 -0
  134. package/dist/chunk-ZBZDR4ZC.js +106 -0
  135. package/dist/chunk-ZBZDR4ZC.js.map +1 -0
  136. package/dist/components/charts/PartoAreaChart.cjs +15 -0
  137. package/dist/components/charts/PartoAreaChart.cjs.map +1 -0
  138. package/dist/components/charts/PartoAreaChart.d.cts +53 -0
  139. package/dist/components/charts/PartoAreaChart.d.ts +53 -0
  140. package/dist/components/charts/PartoAreaChart.js +6 -0
  141. package/dist/components/charts/PartoAreaChart.js.map +1 -0
  142. package/dist/components/charts/PartoBarChart.cjs +15 -0
  143. package/dist/components/charts/PartoBarChart.cjs.map +1 -0
  144. package/dist/components/charts/PartoBarChart.d.cts +61 -0
  145. package/dist/components/charts/PartoBarChart.d.ts +61 -0
  146. package/dist/components/charts/PartoBarChart.js +6 -0
  147. package/dist/components/charts/PartoBarChart.js.map +1 -0
  148. package/dist/components/charts/PartoLineChart.cjs +15 -0
  149. package/dist/components/charts/PartoLineChart.cjs.map +1 -0
  150. package/dist/components/charts/PartoLineChart.d.cts +57 -0
  151. package/dist/components/charts/PartoLineChart.d.ts +57 -0
  152. package/dist/components/charts/PartoLineChart.js +6 -0
  153. package/dist/components/charts/PartoLineChart.js.map +1 -0
  154. package/dist/components/charts/PartoPieChart.cjs +15 -0
  155. package/dist/components/charts/PartoPieChart.cjs.map +1 -0
  156. package/dist/components/charts/PartoPieChart.d.cts +52 -0
  157. package/dist/components/charts/PartoPieChart.d.ts +52 -0
  158. package/dist/components/charts/PartoPieChart.js +6 -0
  159. package/dist/components/charts/PartoPieChart.js.map +1 -0
  160. package/dist/components/ui/alert-rule-card.cjs +15 -0
  161. package/dist/components/ui/alert-rule-card.cjs.map +1 -0
  162. package/dist/components/ui/alert-rule-card.d.cts +38 -0
  163. package/dist/components/ui/alert-rule-card.d.ts +38 -0
  164. package/dist/components/ui/alert-rule-card.js +6 -0
  165. package/dist/components/ui/alert-rule-card.js.map +1 -0
  166. package/dist/components/ui/avatar.cjs +21 -0
  167. package/dist/components/ui/avatar.cjs.map +1 -0
  168. package/dist/components/ui/avatar.d.cts +18 -0
  169. package/dist/components/ui/avatar.d.ts +18 -0
  170. package/dist/components/ui/avatar.js +4 -0
  171. package/dist/components/ui/avatar.js.map +1 -0
  172. package/dist/components/ui/badge.cjs +17 -0
  173. package/dist/components/ui/badge.cjs.map +1 -0
  174. package/dist/components/ui/badge.d.cts +16 -0
  175. package/dist/components/ui/badge.d.ts +16 -0
  176. package/dist/components/ui/badge.js +4 -0
  177. package/dist/components/ui/badge.js.map +1 -0
  178. package/dist/components/ui/button.cjs +18 -0
  179. package/dist/components/ui/button.cjs.map +1 -0
  180. package/dist/components/ui/button.d.cts +37 -0
  181. package/dist/components/ui/button.d.ts +37 -0
  182. package/dist/components/ui/button.js +5 -0
  183. package/dist/components/ui/button.js.map +1 -0
  184. package/dist/components/ui/calendar.cjs +15 -0
  185. package/dist/components/ui/calendar.cjs.map +1 -0
  186. package/dist/components/ui/calendar.d.cts +17 -0
  187. package/dist/components/ui/calendar.d.ts +17 -0
  188. package/dist/components/ui/calendar.js +6 -0
  189. package/dist/components/ui/calendar.js.map +1 -0
  190. package/dist/components/ui/card.cjs +37 -0
  191. package/dist/components/ui/card.cjs.map +1 -0
  192. package/dist/components/ui/card.d.cts +18 -0
  193. package/dist/components/ui/card.d.ts +18 -0
  194. package/dist/components/ui/card.js +4 -0
  195. package/dist/components/ui/card.js.map +1 -0
  196. package/dist/components/ui/concept-card.cjs +18 -0
  197. package/dist/components/ui/concept-card.cjs.map +1 -0
  198. package/dist/components/ui/concept-card.d.cts +5 -0
  199. package/dist/components/ui/concept-card.d.ts +5 -0
  200. package/dist/components/ui/concept-card.js +9 -0
  201. package/dist/components/ui/concept-card.js.map +1 -0
  202. package/dist/components/ui/data-table.cjs +18 -0
  203. package/dist/components/ui/data-table.cjs.map +1 -0
  204. package/dist/components/ui/data-table.d.cts +181 -0
  205. package/dist/components/ui/data-table.d.ts +181 -0
  206. package/dist/components/ui/data-table.js +9 -0
  207. package/dist/components/ui/data-table.js.map +1 -0
  208. package/dist/components/ui/dialog.cjs +49 -0
  209. package/dist/components/ui/dialog.cjs.map +1 -0
  210. package/dist/components/ui/dialog.d.cts +22 -0
  211. package/dist/components/ui/dialog.d.ts +22 -0
  212. package/dist/components/ui/dialog.js +4 -0
  213. package/dist/components/ui/dialog.js.map +1 -0
  214. package/dist/components/ui/filter-provider.cjs +20 -0
  215. package/dist/components/ui/filter-provider.cjs.map +1 -0
  216. package/dist/components/ui/filter-provider.d.cts +49 -0
  217. package/dist/components/ui/filter-provider.d.ts +49 -0
  218. package/dist/components/ui/filter-provider.js +3 -0
  219. package/dist/components/ui/filter-provider.js.map +1 -0
  220. package/dist/components/ui/input.cjs +22 -0
  221. package/dist/components/ui/input.cjs.map +1 -0
  222. package/dist/components/ui/input.d.cts +16 -0
  223. package/dist/components/ui/input.d.ts +16 -0
  224. package/dist/components/ui/input.js +5 -0
  225. package/dist/components/ui/input.js.map +1 -0
  226. package/dist/components/ui/iran-province-heat.cjs +13 -0
  227. package/dist/components/ui/iran-province-heat.cjs.map +1 -0
  228. package/dist/components/ui/iran-province-heat.d.cts +64 -0
  229. package/dist/components/ui/iran-province-heat.d.ts +64 -0
  230. package/dist/components/ui/iran-province-heat.js +4 -0
  231. package/dist/components/ui/iran-province-heat.js.map +1 -0
  232. package/dist/components/ui/page-card.cjs +16 -0
  233. package/dist/components/ui/page-card.cjs.map +1 -0
  234. package/dist/components/ui/page-card.d.cts +6 -0
  235. package/dist/components/ui/page-card.d.ts +6 -0
  236. package/dist/components/ui/page-card.js +7 -0
  237. package/dist/components/ui/page-card.js.map +1 -0
  238. package/dist/components/ui/popover.cjs +25 -0
  239. package/dist/components/ui/popover.cjs.map +1 -0
  240. package/dist/components/ui/popover.d.cts +9 -0
  241. package/dist/components/ui/popover.d.ts +9 -0
  242. package/dist/components/ui/popover.js +4 -0
  243. package/dist/components/ui/popover.js.map +1 -0
  244. package/dist/components/ui/saved-query-card.cjs +15 -0
  245. package/dist/components/ui/saved-query-card.cjs.map +1 -0
  246. package/dist/components/ui/saved-query-card.d.cts +41 -0
  247. package/dist/components/ui/saved-query-card.d.ts +41 -0
  248. package/dist/components/ui/saved-query-card.js +6 -0
  249. package/dist/components/ui/saved-query-card.js.map +1 -0
  250. package/dist/components/ui/separator.cjs +13 -0
  251. package/dist/components/ui/separator.cjs.map +1 -0
  252. package/dist/components/ui/separator.d.cts +9 -0
  253. package/dist/components/ui/separator.d.ts +9 -0
  254. package/dist/components/ui/separator.js +4 -0
  255. package/dist/components/ui/separator.js.map +1 -0
  256. package/dist/components/ui/sheet.cjs +45 -0
  257. package/dist/components/ui/sheet.cjs.map +1 -0
  258. package/dist/components/ui/sheet.d.cts +44 -0
  259. package/dist/components/ui/sheet.d.ts +44 -0
  260. package/dist/components/ui/sheet.js +4 -0
  261. package/dist/components/ui/sheet.js.map +1 -0
  262. package/dist/components/ui/sparkline.cjs +13 -0
  263. package/dist/components/ui/sparkline.cjs.map +1 -0
  264. package/dist/components/ui/sparkline.d.cts +36 -0
  265. package/dist/components/ui/sparkline.d.ts +36 -0
  266. package/dist/components/ui/sparkline.js +4 -0
  267. package/dist/components/ui/sparkline.js.map +1 -0
  268. package/dist/components/ui/tooltip.cjs +25 -0
  269. package/dist/components/ui/tooltip.cjs.map +1 -0
  270. package/dist/components/ui/tooltip.d.cts +17 -0
  271. package/dist/components/ui/tooltip.d.ts +17 -0
  272. package/dist/components/ui/tooltip.js +4 -0
  273. package/dist/components/ui/tooltip.js.map +1 -0
  274. package/dist/concept-card-CcOBb2Nz.d.ts +83 -0
  275. package/dist/concept-card-RwPbqJ06.d.cts +83 -0
  276. package/dist/hooks/use-hotkey-registry.cjs +21 -0
  277. package/dist/hooks/use-hotkey-registry.cjs.map +1 -0
  278. package/dist/hooks/use-hotkey-registry.d.cts +65 -0
  279. package/dist/hooks/use-hotkey-registry.d.ts +65 -0
  280. package/dist/hooks/use-hotkey-registry.js +4 -0
  281. package/dist/hooks/use-hotkey-registry.js.map +1 -0
  282. package/dist/hooks/use-hotkeys.cjs +16 -0
  283. package/dist/hooks/use-hotkeys.cjs.map +1 -0
  284. package/dist/hooks/use-hotkeys.d.cts +66 -0
  285. package/dist/hooks/use-hotkeys.d.ts +66 -0
  286. package/dist/hooks/use-hotkeys.js +3 -0
  287. package/dist/hooks/use-hotkeys.js.map +1 -0
  288. package/dist/i18n-ArS3mqj0.d.ts +344 -0
  289. package/dist/i18n-CAd9wGOr.d.cts +344 -0
  290. package/dist/index.cjs +12195 -13224
  291. package/dist/index.cjs.map +1 -1
  292. package/dist/index.css +490 -34
  293. package/dist/index.d.cts +1635 -1263
  294. package/dist/index.d.ts +1635 -1263
  295. package/dist/index.js +10693 -12364
  296. package/dist/index.js.map +1 -1
  297. package/dist/page-card-CmShVqG-.d.cts +100 -0
  298. package/dist/page-card-HBn-cy4J.d.ts +100 -0
  299. package/dist/utils-DlXWmDZ-.d.cts +35 -0
  300. package/dist/utils-DlXWmDZ-.d.ts +35 -0
  301. package/package.json +160 -4
package/AGENTS.md ADDED
@@ -0,0 +1,233 @@
1
+ # @parto-system-design/ui — AI Reference
2
+
3
+ RTL-first React component library for Persian social listening platforms. Built on Radix UI + Tailwind CSS + Next.js.
4
+
5
+ ## Package
6
+
7
+ ```ts
8
+ // All imports from main entry — no subpath exports
9
+ import { Button, Card, DataTable, EngagementRate } from '@parto-system-design/ui'
10
+
11
+ // CSS imported separately — once in layout.tsx
12
+ import '@parto-system-design/ui/styles.css'
13
+ ```
14
+
15
+ ---
16
+
17
+ ## Next.js Setup (Required — all 4 steps)
18
+
19
+ ```js
20
+ // next.config.mjs
21
+ const nextConfig = {
22
+ transpilePackages: ['@parto-system-design/ui'], // REQUIRED — build fails without this
23
+ }
24
+ ```
25
+
26
+ ```ts
27
+ // tailwind.config.ts
28
+ const config: Config = {
29
+ darkMode: ['class', '[data-theme*="dark"]'],
30
+ content: [
31
+ './app/**/*.{ts,tsx}',
32
+ './components/**/*.{ts,tsx}',
33
+ './node_modules/@parto-system-design/ui/dist/**/*.{js,mjs}', // REQUIRED
34
+ ],
35
+ }
36
+ ```
37
+
38
+ ```tsx
39
+ // app/layout.tsx
40
+ import { ThemeProvider } from 'next-themes'
41
+ import '@parto-system-design/ui/styles.css'
42
+
43
+ export default function RootLayout({ children }) {
44
+ return (
45
+ <html lang="fa" dir="rtl" suppressHydrationWarning> {/* dir="rtl" is required */}
46
+ <body>
47
+ <ThemeProvider attribute="class" defaultTheme="light" themes={['light', 'dark']}>
48
+ {children}
49
+ </ThemeProvider>
50
+ </body>
51
+ </html>
52
+ )
53
+ }
54
+ ```
55
+
56
+ ---
57
+
58
+ ## RTL Rules — Non-negotiable
59
+
60
+ NEVER use physical CSS properties. Use CSS Logical Properties:
61
+
62
+ | ❌ Wrong | ✅ Right |
63
+ |---|---|
64
+ | `ml-4` | `ms-4` |
65
+ | `mr-4` | `me-4` |
66
+ | `pl-4` | `ps-4` |
67
+ | `pr-4` | `pe-4` |
68
+ | `text-left` | `text-start` |
69
+ | `text-right` | `text-end` |
70
+ | `border-l-*` | `border-s-*` |
71
+ | `border-r-*` | `border-e-*` |
72
+ | `rounded-l-*` | `rounded-s-*` |
73
+ | `rounded-r-*` | `rounded-e-*` |
74
+
75
+ **Exception:** `left-1/2 -translate-x-1/2` for absolute centering — this is geometric, not directional.
76
+
77
+ Directional icons: `<Icons.arrowRight className="rtl:rotate-180" />`
78
+
79
+ ---
80
+
81
+ ## Colors — Semantic Tokens Only
82
+
83
+ NEVER hardcode Tailwind colors. Use Parto semantic tokens:
84
+
85
+ | ❌ Wrong | ✅ Right |
86
+ |---|---|
87
+ | `text-gray-900` | `text-foreground` |
88
+ | `text-gray-500` | `text-light` |
89
+ | `text-gray-400` | `text-lighter` |
90
+ | `text-gray-300` | `text-muted` |
91
+ | `bg-white` | `bg-background` |
92
+ | `bg-gray-50` | `bg-surface-75` |
93
+ | `bg-gray-100` | `bg-surface-100` |
94
+ | `bg-gray-200` | `bg-surface-200` |
95
+ | `border-gray-200` | `border-default` |
96
+ | `bg-blue-600` | `bg-brand` |
97
+ | `style={{ color: '#...' }}` | `className="text-[hsl(var(--token))]"` |
98
+
99
+ **Full token list:**
100
+ - Text: `text-foreground` `text-light` `text-lighter` `text-muted` `text-contrast` `text-brand` `text-warning` `text-destructive`
101
+ - Surface: `bg-background` `bg-surface-75` `bg-surface-100` `bg-surface-200` `bg-surface-300` `bg-surface-400`
102
+ - Border: `border-default` `border-strong`
103
+ - Brand: `bg-brand` `text-brand` `bg-interactive`
104
+
105
+ ---
106
+
107
+ ## Component Selection Guide
108
+
109
+ | Need | Use |
110
+ |---|---|
111
+ | Interactive table with sort/filter/pagination | `DataTable` |
112
+ | Simple static table | `Table` |
113
+ | KPI / metric dashboard card | `MetricCard` |
114
+ | User or influencer profile card | `ProfileCard` |
115
+ | Empty state (no data) | `Empty` |
116
+ | Loading placeholder | `Skeleton` |
117
+ | Page title + actions bar | `PageHeader` |
118
+ | Status label / tag | `Badge` |
119
+ | Toast notifications | `Sonner` + `toast()` |
120
+ | Delete/destructive confirmation | `ConfirmDialog` |
121
+ | Generic modal | `Dialog` |
122
+ | Tab panels | `Tabs` |
123
+ | Collapsible sections | `Accordion` |
124
+ | App sidebar navigation | `Sidebar` |
125
+ | Slide-in panel | `Sheet` |
126
+ | Full-section error | `ErrorState` |
127
+ | Inline error/warning | `Alert` |
128
+ | Page navigation | `Pagination` |
129
+
130
+ ---
131
+
132
+ ## Domain Components (Social Listening)
133
+
134
+ ### EngagementRate — ALWAYS pass `category`
135
+
136
+ ```tsx
137
+ // ✅ Correct
138
+ <EngagementRate value={4.5} category="micro" />
139
+
140
+ // ❌ Wrong — thresholds are category-specific
141
+ <EngagementRate value={4.5} />
142
+ ```
143
+
144
+ Categories: `nano` (1K-10K) | `micro` (10K-100K) | `macro` (100K-1M) | `mega` (1M+)
145
+
146
+ ### SentimentBadge
147
+
148
+ ```tsx
149
+ <SentimentBadge sentiment="positive" /> // positive | negative | neutral
150
+ ```
151
+
152
+ ### SocialPlatformBadge
153
+
154
+ ```tsx
155
+ <SocialPlatformBadge platform="instagram" />
156
+ // platforms: instagram | telegram | youtube | tiktok | linkedin | twitter | threads
157
+ ```
158
+
159
+ ### PostCard — canonical post across all 7 platforms
160
+
161
+ ```tsx
162
+ <PostCard
163
+ post={{
164
+ id: 'p1',
165
+ source: 'instagram', // instagram | twitter | telegram | youtube | tiktok | linkedin | threads
166
+ author: { name: 'سارا احمدی', handle: 'sara.ahmadi', verified: true },
167
+ timestamp: Date.now(),
168
+ body: { type: 'text', text: 'متن پست #دیجی‌کالا' },
169
+ sentiment: 'positive',
170
+ metrics: { views: 12400, likes: 876, comments: 124 },
171
+ }}
172
+ density="comfortable" // or 'compact' for triage
173
+ onOpenDetails={(p) => openDetailsModal(p)}
174
+ />
175
+ ```
176
+
177
+ Icon-only actions on hover. Images of any aspect ratio letterbox with blurred backdrop.
178
+
179
+ ### PostDetailsModal — full drill-down (comments + AI analysis + OCR + platform metadata)
180
+
181
+ ```tsx
182
+ <PostDetailsModal
183
+ open={open}
184
+ onOpenChange={setOpen}
185
+ post={post}
186
+ details={{ comments, aiAnalysis, ocrText, transcript, platformMeta }}
187
+ />
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Charts
193
+
194
+ All charts: `isLoading` prop shows Skeleton, `width="100%"` for responsive.
195
+
196
+ ```tsx
197
+ // Line chart — row-oriented data, one key per series
198
+ <PartoLineChart
199
+ data={[{ name: 'فروردین', instagram: 4.2, telegram: 2.1 }]}
200
+ dataKeys={['instagram', 'telegram']}
201
+ xAxisKey="name"
202
+ isLoading={loading}
203
+ height={300}
204
+ />
205
+
206
+ // Bar chart
207
+ <PartoBarChart
208
+ data={[{ platform: 'اینستاگرام', posts: 45 }]}
209
+ keys={['posts']}
210
+ indexBy="platform"
211
+ height={300}
212
+ />
213
+ ```
214
+
215
+ Available: `PartoLineChart` `PartoBarChart` `PartoPieChart` `PartoAreaChart` `PartoHeatMap` `PartoWordCloud` `PartoRadarChart`
216
+
217
+ ---
218
+
219
+ ## Themes
220
+
221
+ Two themes: `light` (`:root`) | `dark` (`.dark` class / `[data-theme="dark"]`)
222
+
223
+ Tailwind dark mode uses dual selectors: `['class', '[data-theme*="dark"]']`
224
+
225
+ ---
226
+
227
+ ## MCP Server (for AI tools)
228
+
229
+ ```bash
230
+ npx @parto-system-design/mcp-server
231
+ ```
232
+
233
+ Exposes tools: `parto_search`, `parto_component`, `parto_setup`, `parto_rtl_rules`, `parto_colors`, `parto_review`
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Parto Design System contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,68 +1,121 @@
1
1
  # @parto-system-design/ui
2
2
 
3
- کتابخانه کامپوننت‌های Parto Design System
3
+ > Persian-first / RTL-native React component library for **افکارسنجی** (public-opinion monitoring), social listening, and influencer analytics. Supabase-style design language adapted for Farsi typography.
4
4
 
5
- ## نصب
5
+ [![npm version](https://img.shields.io/npm/v/@parto-system-design/ui.svg)](https://www.npmjs.com/package/@parto-system-design/ui)
6
+ [![license](https://img.shields.io/npm/l/@parto-system-design/ui.svg)](./LICENSE)
7
+
8
+ ## What's inside
9
+
10
+ - **170+ component entries** — primitives, layout, forms, charts, data viz
11
+ - **Domain-aware** for افکارسنجی: 5 political flow tokens, 9-emotion scale, 4-level severity, status pulse, 10 platform tokens (incl. TV / Radio / Press), action types, score tiers
12
+ - **Two themes**: Light + Dark, both production-grade with full token coverage
13
+ - **RTL native**: CSS Logical Properties throughout — no physical left/right
14
+ - **Trilingual**: Persian (canonical), Arabic, English labels for every domain primitive
15
+ - **Charts**: 8 wrappers over Recharts + custom Visx heatmap and word-cloud, all locale-aware (Persian-digit ticks, theme-resolved colors)
16
+ - **Tables**: DataTable v2 with multi-column sort, sticky footer, column resize, virtualization, infinite scroll, expansion, pinning, column visibility, comparison view, CSV export
17
+
18
+ ## Install
6
19
 
7
20
  ```bash
8
21
  pnpm add @parto-system-design/ui
22
+ # Peer deps:
23
+ pnpm add react react-dom
24
+ # Optional — only if you want next-themes integration:
25
+ pnpm add next-themes
9
26
  ```
10
27
 
11
- ## استفاده
28
+ The library externalizes its own dependencies (`recharts`, `@radix-ui/*`, `@visx/*`, etc.) so they install transparently via npm. No manual peer-dep wiring required.
12
29
 
13
- ```tsx
14
- import { Button, Card, PartoLineChart } from '@parto-system-design/ui';
15
- import '@parto-system-design/ui/styles.css';
30
+ ## Setup
16
31
 
17
- export default function App() {
18
- return (
19
- <Card>
20
- <Button>کلیک کنید</Button>
21
- </Card>
22
- );
32
+ ### 1. Import the stylesheet
33
+
34
+ ```ts
35
+ // app/layout.tsx (Next.js) or main.tsx (Vite)
36
+ import '@parto-system-design/ui/styles.css'
37
+ ```
38
+
39
+ ### 2. Tailwind theme (optional, recommended)
40
+
41
+ If your app uses Tailwind, extend the config so utility classes resolve the Parto tokens:
42
+
43
+ ```ts
44
+ // tailwind.config.ts
45
+ import partoConfig from '@parto-system-design/ui/tailwind.config'
46
+
47
+ export default {
48
+ ...partoConfig,
49
+ content: [
50
+ ...(partoConfig.content as string[]),
51
+ './app/**/*.{ts,tsx}',
52
+ './node_modules/@parto-system-design/ui/dist/**/*.{js,cjs}',
53
+ ],
23
54
  }
24
55
  ```
25
56
 
26
- ## توسعه
57
+ ### 3. Next.js — transpile the package
27
58
 
28
- ```bash
29
- # اجرای محیط توسعه
30
- pnpm dev
59
+ ```ts
60
+ // next.config.mjs
61
+ export default {
62
+ transpilePackages: ['@parto-system-design/ui'],
63
+ }
64
+ ```
31
65
 
32
- # ساخت
33
- pnpm build
66
+ ## Tree-shake-friendly subpath imports
34
67
 
35
- # بررسی نوع
36
- pnpm typecheck
68
+ For bundle-conscious apps, import each primitive from its own subpath. A
69
+ single `Button` import drops from ~343 KB (full barrel) to **~11 KB** —
70
+ a 97% reduction:
71
+
72
+ ```tsx
73
+ // Bundle-conscious — each component pays for itself only
74
+ import { Button } from '@parto-system-design/ui/button'
75
+ import { Input } from '@parto-system-design/ui/input'
76
+ import { IranProvinceHeat } from '@parto-system-design/ui/iran-province-heat'
77
+ import { PartoLineChart } from '@parto-system-design/ui/line-chart'
78
+
79
+ // Or ergonomic barrel — works as before, fine if you import many components
80
+ import { Button, Input, Card, Avatar, Badge } from '@parto-system-design/ui'
37
81
  ```
38
82
 
39
- ## کامپوننت‌ها
83
+ Subpaths are exported for the 25 highest-traffic components (primitives,
84
+ big surfaces, charts, domain cards, hooks). See `package.json` `exports`
85
+ for the full list. Less common components remain available via the
86
+ barrel import.
40
87
 
41
- - Button
42
- - Input
43
- - Card
44
- - Badge
45
- - Tabs
46
- - Dialog
47
- - Select
48
- - Tooltip
49
- - Popover
50
- - Alert
51
- - Separator
52
- - PartoLineChart
53
- - PartoBarChart
54
- - PartoPieChart
88
+ ## Quick start
55
89
 
56
- ## دیزاین سیستم
90
+ ```tsx
91
+ import { Button, IranProvinceHeat, FilterProvider } from '@parto-system-design/ui'
57
92
 
58
- مستندات کامل در `apps/docs` موجود است.
93
+ export default function Page() {
94
+ return (
95
+ <FilterProvider initialState={{ q: '', province: null }}>
96
+ <Button variant="primary">شروع</Button>
97
+ <IranProvinceHeat
98
+ data={{ tehran: 4820, isfahan: 2140, fars: 1480 }}
99
+ valueSuffix=" نظر"
100
+ topN={8}
101
+ hideMissing
102
+ showRank
103
+ />
104
+ </FilterProvider>
105
+ )
106
+ }
107
+ ```
108
+
109
+ ## Documentation
110
+
111
+ Full docs (Fumadocs v16) run locally on port 4200:
59
112
 
60
- ### ⚠️ مهم: یکسانی کامپوننت‌ها
113
+ ```bash
114
+ pnpm dev
115
+ ```
61
116
 
62
- **کامپوننت‌هایی که در مستندات (`apps/docs`) نمایش داده می‌شوند، دقیقاً همان کامپوننت‌هایی هستند که شما با `pnpm add @parto-system-design/ui` نصب می‌کنید.**
117
+ The component manifest at [`component-manifest.md`](./component-manifest.md) is auto-generated and lists every public export with its variants and data-slots handy for AI agents.
63
118
 
64
- - ✅ داک از همان پکیج `@parto-system-design/ui` استفاده می‌کند
65
- - ✅ همه کامپوننت‌ها از `src/index.ts` export می‌شوند
66
- - ✅ در production، فایل‌های build شده (`dist/`) منتشر می‌شوند
67
- - ✅ هیچ تفاوتی بین کامپوننت‌های داک و کامپوننت‌های قابل نصب وجود ندارد
119
+ ## License
68
120
 
121
+ [MIT](./LICENSE)
@@ -0,0 +1,112 @@
1
+ 'use strict';
2
+
3
+ var chunkNV4JOKWL_cjs = require('./chunk-NV4JOKWL.cjs');
4
+ var React = require('react');
5
+ var classVarianceAuthority = require('class-variance-authority');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
27
+
28
+ var badgeVariants = classVarianceAuthority.cva(
29
+ "inline-flex items-center rounded-full font-normal whitespace-nowrap transition-colors duration-150",
30
+ {
31
+ variants: {
32
+ variant: {
33
+ default: "bg-surface-75 text-foreground-light border border-strong",
34
+ secondary: "bg-[hsl(var(--secondary-default)/0.1)] border border-[hsl(var(--secondary-default)/0.4)] text-[hsl(var(--secondary-default))]",
35
+ success: "bg-brand bg-opacity-10 text-brand-600 border border-brand-500",
36
+ warning: "bg-warning bg-opacity-10 text-warning border border-warning-500",
37
+ destructive: "bg-destructive bg-opacity-10 text-destructive-600 border border-destructive-500",
38
+ brand: "bg-brand bg-opacity-10 text-brand-600 border border-brand-500",
39
+ outline: "bg-transparent text-foreground border border-foreground-muted"
40
+ },
41
+ size: {
42
+ xs: "px-1.5 py-[3px] text-2xs leading-none tracking-wide uppercase",
43
+ sm: "px-2 py-0.5 text-xs",
44
+ md: "px-2 py-0.5 text-xs",
45
+ lg: "px-3 py-0.5 text-sm",
46
+ /** @deprecated Use xs */
47
+ tiny: "px-1.5 py-[3px] text-2xs leading-none tracking-wide uppercase",
48
+ /** @deprecated Use sm */
49
+ small: "px-2 py-0.5 text-xs",
50
+ /** @deprecated Use lg */
51
+ large: "px-3 py-0.5 text-sm"
52
+ },
53
+ dot: {
54
+ true: ""
55
+ }
56
+ },
57
+ defaultVariants: {
58
+ variant: "default",
59
+ size: "sm"
60
+ }
61
+ }
62
+ );
63
+ var dotVariants = classVarianceAuthority.cva("size-2 rounded-full", {
64
+ variants: {
65
+ position: {
66
+ start: "-ms-0.5 me-1.5",
67
+ end: "ms-1.5 -me-0.5"
68
+ }
69
+ },
70
+ defaultVariants: {
71
+ position: "start"
72
+ }
73
+ });
74
+ var Badge = React__namespace.forwardRef(
75
+ ({ className, variant, size, dot, dotPosition = "end", children, ...props }, ref) => {
76
+ if (process.env.NODE_ENV !== "production") {
77
+ const deprecatedSizes = ["tiny", "small", "large"];
78
+ if (size && deprecatedSizes.includes(size)) {
79
+ console.warn(`[Parto UI] Badge: size="${size}" is deprecated. Use xs|sm|md|lg instead.`);
80
+ }
81
+ }
82
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { ref, "data-slot": "badge", className: chunkNV4JOKWL_cjs.cn(badgeVariants({ variant, size }), className), ...props, children: [
83
+ dot && dotPosition === "start" && /* @__PURE__ */ jsxRuntime.jsx(
84
+ "svg",
85
+ {
86
+ "aria-hidden": "true",
87
+ className: chunkNV4JOKWL_cjs.cn(dotVariants({ position: "start" })),
88
+ fill: "currentColor",
89
+ viewBox: "0 0 8 8",
90
+ children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "4", cy: "4", r: "3" })
91
+ }
92
+ ),
93
+ children,
94
+ dot && dotPosition === "end" && /* @__PURE__ */ jsxRuntime.jsx(
95
+ "svg",
96
+ {
97
+ "aria-hidden": "true",
98
+ className: chunkNV4JOKWL_cjs.cn(dotVariants({ position: "end" })),
99
+ fill: "currentColor",
100
+ viewBox: "0 0 8 8",
101
+ children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "4", cy: "4", r: "3" })
102
+ }
103
+ )
104
+ ] });
105
+ }
106
+ );
107
+ Badge.displayName = "Badge";
108
+
109
+ exports.Badge = Badge;
110
+ exports.badgeVariants = badgeVariants;
111
+ //# sourceMappingURL=chunk-2ACKKPWA.cjs.map
112
+ //# sourceMappingURL=chunk-2ACKKPWA.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/badge.tsx"],"names":["cva","React","cn","jsx"],"mappings":"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","file":"chunk-2ACKKPWA.cjs","sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nconst badgeVariants = cva(\n 'inline-flex items-center rounded-full font-normal whitespace-nowrap transition-colors duration-150',\n {\n variants: {\n variant: {\n default: 'bg-surface-75 text-foreground-light border border-strong',\n secondary:\n 'bg-[hsl(var(--secondary-default)/0.1)] border border-[hsl(var(--secondary-default)/0.4)] text-[hsl(var(--secondary-default))]',\n success: 'bg-brand bg-opacity-10 text-brand-600 border border-brand-500',\n warning: 'bg-warning bg-opacity-10 text-warning border border-warning-500',\n destructive: 'bg-destructive bg-opacity-10 text-destructive-600 border border-destructive-500',\n brand: 'bg-brand bg-opacity-10 text-brand-600 border border-brand-500',\n outline: 'bg-transparent text-foreground border border-foreground-muted',\n },\n size: {\n xs: 'px-1.5 py-[3px] text-2xs leading-none tracking-wide uppercase',\n sm: 'px-2 py-0.5 text-xs',\n md: 'px-2 py-0.5 text-xs',\n lg: 'px-3 py-0.5 text-sm',\n /** @deprecated Use xs */ tiny: 'px-1.5 py-[3px] text-2xs leading-none tracking-wide uppercase',\n /** @deprecated Use sm */ small: 'px-2 py-0.5 text-xs',\n /** @deprecated Use lg */ large: 'px-3 py-0.5 text-sm',\n },\n dot: {\n true: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'sm',\n },\n }\n)\n\nconst dotVariants = cva('size-2 rounded-full', {\n variants: {\n position: {\n start: '-ms-0.5 me-1.5',\n end: 'ms-1.5 -me-0.5',\n },\n },\n defaultVariants: {\n position: 'start',\n },\n})\n\nexport interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {\n dot?: boolean\n dotPosition?: 'start' | 'end'\n}\n\nconst Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, variant, size, dot, dotPosition = 'end', children, ...props }, ref) => {\n if (process.env.NODE_ENV !== 'production') {\n const deprecatedSizes = ['tiny', 'small', 'large']\n if (size && deprecatedSizes.includes(size as string)) {\n console.warn(`[Parto UI] Badge: size=\"${size}\" is deprecated. Use xs|sm|md|lg instead.`)\n }\n }\n\n return (\n <span ref={ref} data-slot=\"badge\" className={cn(badgeVariants({ variant, size }), className)} {...props}>\n {dot && dotPosition === 'start' && (\n <svg\n aria-hidden=\"true\"\n className={cn(dotVariants({ position: 'start' }))}\n fill=\"currentColor\"\n viewBox=\"0 0 8 8\"\n >\n <circle cx=\"4\" cy=\"4\" r=\"3\" />\n </svg>\n )}\n {children}\n {dot && dotPosition === 'end' && (\n <svg\n aria-hidden=\"true\"\n className={cn(dotVariants({ position: 'end' }))}\n fill=\"currentColor\"\n viewBox=\"0 0 8 8\"\n >\n <circle cx=\"4\" cy=\"4\" r=\"3\" />\n </svg>\n )}\n </span>\n )\n }\n)\n\nBadge.displayName = 'Badge'\n\nexport { Badge, badgeVariants }\n"]}