@teamix-evo/ui 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (520) hide show
  1. package/README.md +46 -50
  2. package/manifest.json +420 -647
  3. package/package.json +15 -34
  4. package/src/_design-system/theme-tokens/stories.tsx +1474 -0
  5. package/src/components/accordion/index.tsx +139 -0
  6. package/src/components/accordion/meta.md +162 -0
  7. package/src/components/accordion/stories.tsx +145 -0
  8. package/src/components/affix/index.tsx +149 -0
  9. package/src/components/affix/meta.md +23 -0
  10. package/src/components/affix/stories.tsx +70 -0
  11. package/src/components/alert/index.tsx +220 -0
  12. package/src/components/alert/meta.md +133 -0
  13. package/src/components/alert/stories.tsx +126 -0
  14. package/src/components/alert-dialog/index.tsx +282 -0
  15. package/src/components/alert-dialog/meta.md +86 -0
  16. package/src/components/alert-dialog/stories.tsx +163 -0
  17. package/src/components/avatar/index.tsx +159 -0
  18. package/src/components/avatar/meta.md +242 -0
  19. package/src/components/avatar/stories.tsx +241 -0
  20. package/src/components/badge/index.tsx +299 -0
  21. package/src/components/badge/meta.md +237 -0
  22. package/src/components/badge/stories.tsx +275 -0
  23. package/src/components/breadcrumb/index.tsx +137 -0
  24. package/src/components/breadcrumb/meta.md +64 -0
  25. package/src/components/breadcrumb/stories.tsx +86 -0
  26. package/src/components/button/index.tsx +202 -0
  27. package/src/components/button/meta.md +209 -0
  28. package/src/components/button/stories.tsx +215 -0
  29. package/src/components/button-group/index.tsx +211 -0
  30. package/src/components/button-group/meta.md +190 -0
  31. package/src/components/button-group/stories.tsx +182 -0
  32. package/src/components/calendar/index.tsx +240 -0
  33. package/src/components/calendar/meta.md +36 -0
  34. package/src/components/calendar/stories.tsx +36 -0
  35. package/src/components/card/index.tsx +262 -0
  36. package/src/components/card/meta.md +194 -0
  37. package/src/components/card/stories.tsx +202 -0
  38. package/src/components/carousel/index.tsx +481 -0
  39. package/src/components/carousel/meta.md +208 -0
  40. package/src/components/carousel/stories.tsx +271 -0
  41. package/src/components/cascader-select/index.tsx +308 -0
  42. package/src/components/cascader-select/meta.md +28 -0
  43. package/src/components/cascader-select/stories.tsx +118 -0
  44. package/src/components/checkbox/index.tsx +208 -0
  45. package/src/components/checkbox/meta.md +166 -0
  46. package/src/components/checkbox/stories.tsx +206 -0
  47. package/src/components/collapsible/index.tsx +72 -0
  48. package/src/components/collapsible/meta.md +87 -0
  49. package/src/components/collapsible/stories.tsx +97 -0
  50. package/src/components/color-picker/index.tsx +677 -0
  51. package/src/components/color-picker/meta.md +83 -0
  52. package/src/components/color-picker/stories.tsx +172 -0
  53. package/src/components/combobox/index.tsx +687 -0
  54. package/src/components/combobox/meta.md +83 -0
  55. package/src/components/combobox/stories.tsx +179 -0
  56. package/src/components/command/index.tsx +238 -0
  57. package/src/components/command/meta.md +48 -0
  58. package/src/components/command/stories.tsx +83 -0
  59. package/src/components/data-table/index.tsx +1537 -0
  60. package/src/components/data-table/meta.md +107 -0
  61. package/src/components/data-table/stories.tsx +1234 -0
  62. package/src/components/date-picker/index.tsx +1492 -0
  63. package/src/components/date-picker/meta.md +103 -0
  64. package/src/components/date-picker/stories.tsx +125 -0
  65. package/src/components/descriptions/index.tsx +535 -0
  66. package/src/components/descriptions/meta.md +104 -0
  67. package/src/components/descriptions/stories.tsx +389 -0
  68. package/src/components/dialog/index.tsx +255 -0
  69. package/src/components/dialog/meta.md +244 -0
  70. package/src/components/dialog/stories.tsx +330 -0
  71. package/src/components/dropdown-menu/index.tsx +301 -0
  72. package/src/components/dropdown-menu/meta.md +93 -0
  73. package/src/components/dropdown-menu/stories.tsx +124 -0
  74. package/src/components/empty/index.tsx +431 -0
  75. package/src/components/empty/meta.md +274 -0
  76. package/src/components/empty/stories.tsx +278 -0
  77. package/src/components/field/index.tsx +374 -0
  78. package/src/components/field/meta.md +283 -0
  79. package/src/components/field/stories.tsx +327 -0
  80. package/src/components/filter-bar/index.tsx +976 -0
  81. package/src/components/filter-bar/meta.md +57 -0
  82. package/src/components/filter-bar/stories.tsx +496 -0
  83. package/src/components/float-button/index.tsx +163 -0
  84. package/src/components/float-button/meta.md +73 -0
  85. package/src/components/float-button/stories.tsx +68 -0
  86. package/src/components/form/index.tsx +218 -0
  87. package/src/components/form/meta.md +16 -0
  88. package/src/components/form/stories.tsx +301 -0
  89. package/src/components/hover-card/index.tsx +103 -0
  90. package/src/components/hover-card/meta.md +71 -0
  91. package/src/components/hover-card/stories.tsx +107 -0
  92. package/src/components/icon/index.tsx +225 -0
  93. package/src/components/icon/meta.md +102 -0
  94. package/src/components/icon/stories.tsx +127 -0
  95. package/src/components/image/index.tsx +147 -0
  96. package/src/components/image/meta.md +55 -0
  97. package/src/components/image/stories.tsx +48 -0
  98. package/src/components/input/index.tsx +63 -0
  99. package/src/components/input/meta.md +57 -0
  100. package/src/components/input/stories.tsx +66 -0
  101. package/src/components/input-group/index.tsx +292 -0
  102. package/src/components/input-group/meta.md +108 -0
  103. package/src/components/input-group/stories.tsx +258 -0
  104. package/src/components/input-ip/index.tsx +288 -0
  105. package/src/components/input-ip/meta.md +48 -0
  106. package/src/components/input-ip/stories.tsx +69 -0
  107. package/src/components/input-number/index.tsx +360 -0
  108. package/src/components/input-number/meta.md +156 -0
  109. package/src/components/input-number/stories.tsx +187 -0
  110. package/src/components/item/index.tsx +368 -0
  111. package/src/components/item/meta.md +395 -0
  112. package/src/components/item/stories.tsx +432 -0
  113. package/src/components/label/index.tsx +44 -0
  114. package/src/components/label/meta.md +68 -0
  115. package/src/components/label/stories.tsx +64 -0
  116. package/src/components/mentions/index.tsx +369 -0
  117. package/src/components/mentions/meta.md +118 -0
  118. package/src/components/mentions/stories.tsx +153 -0
  119. package/src/components/menubar/index.tsx +313 -0
  120. package/src/components/menubar/meta.md +52 -0
  121. package/src/components/menubar/stories.tsx +99 -0
  122. package/src/components/navigation-menu/index.tsx +216 -0
  123. package/src/components/navigation-menu/meta.md +66 -0
  124. package/src/components/navigation-menu/stories.tsx +137 -0
  125. package/src/components/page-header/index.tsx +218 -0
  126. package/src/components/page-header/meta.md +211 -0
  127. package/src/components/page-header/stories.tsx +290 -0
  128. package/src/components/page-shell/index.tsx +119 -0
  129. package/src/components/page-shell/meta.md +115 -0
  130. package/src/components/page-shell/stories.tsx +154 -0
  131. package/src/components/pagination/index.tsx +580 -0
  132. package/src/components/pagination/meta.md +39 -0
  133. package/src/components/pagination/stories.tsx +319 -0
  134. package/src/components/popconfirm/index.tsx +477 -0
  135. package/src/components/popconfirm/meta.md +164 -0
  136. package/src/components/popconfirm/stories.tsx +231 -0
  137. package/src/components/popover/index.tsx +181 -0
  138. package/src/components/popover/meta.md +97 -0
  139. package/src/components/popover/stories.tsx +169 -0
  140. package/src/components/progress/index.tsx +176 -0
  141. package/src/components/progress/meta.md +95 -0
  142. package/src/components/progress/stories.tsx +115 -0
  143. package/src/components/radio-group/index.tsx +78 -0
  144. package/src/components/radio-group/meta.md +137 -0
  145. package/src/components/radio-group/stories.tsx +285 -0
  146. package/src/components/rate/index.tsx +284 -0
  147. package/src/components/rate/meta.md +63 -0
  148. package/src/components/rate/stories.tsx +107 -0
  149. package/src/components/resizable/index.tsx +122 -0
  150. package/src/components/resizable/meta.md +142 -0
  151. package/src/components/resizable/stories.tsx +105 -0
  152. package/src/components/scroll-area/index.tsx +83 -0
  153. package/src/components/scroll-area/meta.md +85 -0
  154. package/src/components/scroll-area/stories.tsx +82 -0
  155. package/src/components/select/index.tsx +325 -0
  156. package/src/components/select/meta.md +183 -0
  157. package/src/components/select/stories.tsx +210 -0
  158. package/src/components/separator/index.tsx +51 -0
  159. package/src/components/separator/meta.md +68 -0
  160. package/src/components/separator/stories.tsx +53 -0
  161. package/src/components/sheet/index.tsx +293 -0
  162. package/src/components/sheet/meta.md +226 -0
  163. package/src/components/sheet/stories.tsx +405 -0
  164. package/src/components/sidebar/index.tsx +715 -0
  165. package/src/components/sidebar/meta.md +14 -0
  166. package/src/components/sidebar/{sidebar.stories.tsx → stories.tsx} +250 -330
  167. package/src/components/skeleton/index.tsx +415 -0
  168. package/src/components/skeleton/meta.md +210 -0
  169. package/src/components/skeleton/stories.tsx +197 -0
  170. package/src/components/slider/index.tsx +222 -0
  171. package/src/components/slider/meta.md +125 -0
  172. package/src/components/slider/stories.tsx +109 -0
  173. package/src/components/sonner/index.tsx +149 -0
  174. package/src/components/sonner/meta.md +156 -0
  175. package/src/components/sonner/stories.tsx +285 -0
  176. package/src/components/spinner/index.tsx +335 -0
  177. package/src/components/spinner/meta.md +172 -0
  178. package/src/components/spinner/stories.tsx +197 -0
  179. package/src/components/statistic/{statistic.tsx → index.tsx} +25 -26
  180. package/src/components/statistic/meta.md +94 -0
  181. package/src/components/statistic/stories.tsx +85 -0
  182. package/src/components/steps/index.tsx +500 -0
  183. package/src/components/steps/meta.md +245 -0
  184. package/src/components/steps/stories.tsx +287 -0
  185. package/src/components/switch/index.tsx +175 -0
  186. package/src/components/switch/meta.md +107 -0
  187. package/src/components/switch/stories.tsx +154 -0
  188. package/src/components/table/index.tsx +350 -0
  189. package/src/components/table/meta.md +148 -0
  190. package/src/components/table/stories.tsx +189 -0
  191. package/src/components/tabs/index.tsx +379 -0
  192. package/src/components/tabs/meta.md +244 -0
  193. package/src/components/tabs/stories.tsx +312 -0
  194. package/src/components/tag/index.tsx +774 -0
  195. package/src/components/tag/meta.md +256 -0
  196. package/src/components/tag/stories.tsx +431 -0
  197. package/src/components/textarea/index.tsx +62 -0
  198. package/src/components/textarea/meta.md +77 -0
  199. package/src/components/textarea/stories.tsx +112 -0
  200. package/src/components/time-picker/index.tsx +887 -0
  201. package/src/components/time-picker/meta.md +102 -0
  202. package/src/components/time-picker/stories.tsx +125 -0
  203. package/src/components/timeline/index.tsx +422 -0
  204. package/src/components/timeline/meta.md +352 -0
  205. package/src/components/timeline/stories.tsx +369 -0
  206. package/src/components/toggle/index.tsx +74 -0
  207. package/src/components/toggle/meta.md +76 -0
  208. package/src/components/toggle/stories.tsx +66 -0
  209. package/src/components/toggle-group/index.tsx +167 -0
  210. package/src/components/toggle-group/meta.md +141 -0
  211. package/src/components/toggle-group/stories.tsx +124 -0
  212. package/src/components/tooltip/index.tsx +144 -0
  213. package/src/components/tooltip/meta.md +186 -0
  214. package/src/components/tooltip/stories.tsx +212 -0
  215. package/src/components/transfer/index.tsx +639 -0
  216. package/src/components/transfer/meta.md +76 -0
  217. package/src/components/transfer/stories.tsx +221 -0
  218. package/src/components/tree/index.tsx +764 -0
  219. package/src/components/tree/meta.md +96 -0
  220. package/src/components/tree/stories.tsx +385 -0
  221. package/src/components/tree/utils.ts +269 -0
  222. package/src/components/tree-select/index.tsx +400 -0
  223. package/src/components/tree-select/meta.md +78 -0
  224. package/src/components/tree-select/stories.tsx +234 -0
  225. package/src/components/typography/index.tsx +290 -0
  226. package/src/components/typography/meta.md +151 -0
  227. package/src/components/typography/stories.tsx +151 -0
  228. package/src/components/upload/index.tsx +858 -0
  229. package/src/components/upload/meta.md +122 -0
  230. package/src/components/upload/stories.tsx +261 -0
  231. package/src/components/watermark/index.tsx +152 -0
  232. package/src/components/watermark/meta.md +67 -0
  233. package/src/components/watermark/stories.tsx +59 -0
  234. package/src/hooks/use-mobile.ts +9 -11
  235. package/src/lib/color.ts +243 -0
  236. package/src/{utils/cn.ts → lib/utils.ts} +1 -1
  237. package/src/components/accordion/accordion.meta.md +0 -88
  238. package/src/components/accordion/accordion.stories.tsx +0 -72
  239. package/src/components/accordion/accordion.tsx +0 -154
  240. package/src/components/affix/affix.meta.md +0 -98
  241. package/src/components/affix/affix.stories.tsx +0 -134
  242. package/src/components/affix/affix.tsx +0 -167
  243. package/src/components/alert/alert.meta.md +0 -132
  244. package/src/components/alert/alert.stories.tsx +0 -138
  245. package/src/components/alert/alert.tsx +0 -179
  246. package/src/components/alert-dialog/alert-dialog.meta.md +0 -152
  247. package/src/components/alert-dialog/alert-dialog.stories.tsx +0 -223
  248. package/src/components/alert-dialog/alert-dialog.tsx +0 -183
  249. package/src/components/anchor/anchor.meta.md +0 -92
  250. package/src/components/anchor/anchor.stories.tsx +0 -74
  251. package/src/components/anchor/anchor.tsx +0 -130
  252. package/src/components/app/app.meta.md +0 -91
  253. package/src/components/app/app.stories.tsx +0 -64
  254. package/src/components/app/app.tsx +0 -58
  255. package/src/components/aspect-ratio/aspect-ratio.meta.md +0 -82
  256. package/src/components/aspect-ratio/aspect-ratio.stories.tsx +0 -59
  257. package/src/components/aspect-ratio/aspect-ratio.tsx +0 -22
  258. package/src/components/auto-complete/auto-complete.meta.md +0 -110
  259. package/src/components/auto-complete/auto-complete.stories.tsx +0 -136
  260. package/src/components/auto-complete/auto-complete.tsx +0 -253
  261. package/src/components/avatar/avatar.meta.md +0 -93
  262. package/src/components/avatar/avatar.stories.tsx +0 -98
  263. package/src/components/avatar/avatar.tsx +0 -127
  264. package/src/components/badge/badge.meta.md +0 -120
  265. package/src/components/badge/badge.stories.tsx +0 -153
  266. package/src/components/badge/badge.tsx +0 -204
  267. package/src/components/breadcrumb/breadcrumb.meta.md +0 -127
  268. package/src/components/breadcrumb/breadcrumb.stories.tsx +0 -207
  269. package/src/components/breadcrumb/breadcrumb.tsx +0 -136
  270. package/src/components/button/button.meta.md +0 -335
  271. package/src/components/button/button.stories.tsx +0 -743
  272. package/src/components/button/button.tsx +0 -462
  273. package/src/components/button/demo/as-child.tsx +0 -24
  274. package/src/components/button/demo/basic.tsx +0 -8
  275. package/src/components/button/demo/block.tsx +0 -16
  276. package/src/components/button/demo/loading.tsx +0 -19
  277. package/src/components/button/demo/shapes.tsx +0 -18
  278. package/src/components/button/demo/sizes.tsx +0 -19
  279. package/src/components/button/demo/variants.tsx +0 -19
  280. package/src/components/button/demo/with-icon.tsx +0 -20
  281. package/src/components/calendar/calendar.meta.md +0 -128
  282. package/src/components/calendar/calendar.stories.tsx +0 -68
  283. package/src/components/calendar/calendar.tsx +0 -172
  284. package/src/components/card/card.meta.md +0 -139
  285. package/src/components/card/card.stories.tsx +0 -151
  286. package/src/components/card/card.tsx +0 -305
  287. package/src/components/carousel/carousel.meta.md +0 -118
  288. package/src/components/carousel/carousel.stories.tsx +0 -89
  289. package/src/components/carousel/carousel.tsx +0 -224
  290. package/src/components/cascader/cascader.meta.md +0 -140
  291. package/src/components/cascader/cascader.stories.tsx +0 -120
  292. package/src/components/cascader/cascader.tsx +0 -541
  293. package/src/components/checkbox/checkbox.meta.md +0 -167
  294. package/src/components/checkbox/checkbox.stories.tsx +0 -288
  295. package/src/components/checkbox/checkbox.tsx +0 -193
  296. package/src/components/collapsible/collapsible.meta.md +0 -88
  297. package/src/components/collapsible/collapsible.stories.tsx +0 -43
  298. package/src/components/collapsible/collapsible.tsx +0 -105
  299. package/src/components/color-picker/color-picker.meta.md +0 -89
  300. package/src/components/color-picker/color-picker.stories.tsx +0 -159
  301. package/src/components/color-picker/color-picker.tsx +0 -171
  302. package/src/components/command/command.meta.md +0 -120
  303. package/src/components/command/command.stories.tsx +0 -59
  304. package/src/components/command/command.tsx +0 -158
  305. package/src/components/context-menu/context-menu.meta.md +0 -93
  306. package/src/components/context-menu/context-menu.stories.tsx +0 -54
  307. package/src/components/context-menu/context-menu.tsx +0 -204
  308. package/src/components/data-table/data-table.meta.md +0 -150
  309. package/src/components/data-table/data-table.stories.tsx +0 -132
  310. package/src/components/data-table/data-table.tsx +0 -185
  311. package/src/components/date-picker/date-picker.meta.md +0 -175
  312. package/src/components/date-picker/date-picker.stories.tsx +0 -108
  313. package/src/components/date-picker/date-picker.tsx +0 -1554
  314. package/src/components/descriptions/descriptions.meta.md +0 -83
  315. package/src/components/descriptions/descriptions.stories.tsx +0 -60
  316. package/src/components/descriptions/descriptions.tsx +0 -137
  317. package/src/components/dialog/dialog.meta.md +0 -168
  318. package/src/components/dialog/dialog.stories.tsx +0 -255
  319. package/src/components/dialog/dialog.tsx +0 -180
  320. package/src/components/dialog/imperative.tsx +0 -252
  321. package/src/components/drawer/drawer.meta.md +0 -95
  322. package/src/components/drawer/drawer.stories.tsx +0 -71
  323. package/src/components/drawer/drawer.tsx +0 -23
  324. package/src/components/dropdown-menu/dropdown-menu.meta.md +0 -171
  325. package/src/components/dropdown-menu/dropdown-menu.stories.tsx +0 -198
  326. package/src/components/dropdown-menu/dropdown-menu.tsx +0 -209
  327. package/src/components/ellipsis/ellipsis.meta.md +0 -87
  328. package/src/components/ellipsis/ellipsis.stories.tsx +0 -72
  329. package/src/components/ellipsis/ellipsis.tsx +0 -153
  330. package/src/components/empty/empty.meta.md +0 -86
  331. package/src/components/empty/empty.stories.tsx +0 -46
  332. package/src/components/empty/empty.tsx +0 -54
  333. package/src/components/field/field.meta.md +0 -154
  334. package/src/components/field/field.stories.tsx +0 -497
  335. package/src/components/field/field.tsx +0 -392
  336. package/src/components/filter-bar/filter-bar.meta.md +0 -92
  337. package/src/components/filter-bar/filter-bar.stories.tsx +0 -1083
  338. package/src/components/filter-bar/filter-bar.tsx +0 -568
  339. package/src/components/flex/flex.meta.md +0 -142
  340. package/src/components/flex/flex.stories.tsx +0 -199
  341. package/src/components/flex/flex.tsx +0 -145
  342. package/src/components/float-button/float-button.meta.md +0 -92
  343. package/src/components/float-button/float-button.stories.tsx +0 -80
  344. package/src/components/float-button/float-button.tsx +0 -143
  345. package/src/components/form/form.meta.md +0 -153
  346. package/src/components/form/form.stories.tsx +0 -469
  347. package/src/components/form/form.tsx +0 -260
  348. package/src/components/grid/grid.meta.md +0 -92
  349. package/src/components/grid/grid.stories.tsx +0 -101
  350. package/src/components/grid/grid.tsx +0 -130
  351. package/src/components/hover-card/hover-card.meta.md +0 -103
  352. package/src/components/hover-card/hover-card.stories.tsx +0 -97
  353. package/src/components/hover-card/hover-card.tsx +0 -67
  354. package/src/components/icon/DEVELOPMENT.md +0 -809
  355. package/src/components/icon/icon.meta.md +0 -170
  356. package/src/components/icon/icon.stories.tsx +0 -344
  357. package/src/components/icon/icon.tsx +0 -248
  358. package/src/components/image/image.meta.md +0 -99
  359. package/src/components/image/image.stories.tsx +0 -55
  360. package/src/components/image/image.tsx +0 -140
  361. package/src/components/input/demo/basic.tsx +0 -12
  362. package/src/components/input/demo/clearable.tsx +0 -21
  363. package/src/components/input/demo/show-count.tsx +0 -18
  364. package/src/components/input/demo/sizes.tsx +0 -15
  365. package/src/components/input/input.meta.md +0 -115
  366. package/src/components/input/input.stories.tsx +0 -144
  367. package/src/components/input/input.tsx +0 -212
  368. package/src/components/input-group/input-group.meta.md +0 -124
  369. package/src/components/input-group/input-group.stories.tsx +0 -121
  370. package/src/components/input-group/input-group.tsx +0 -143
  371. package/src/components/input-number/input-number.meta.md +0 -148
  372. package/src/components/input-number/input-number.stories.tsx +0 -125
  373. package/src/components/input-number/input-number.tsx +0 -283
  374. package/src/components/input-otp/input-otp.meta.md +0 -106
  375. package/src/components/input-otp/input-otp.stories.tsx +0 -65
  376. package/src/components/input-otp/input-otp.tsx +0 -97
  377. package/src/components/item/item.meta.md +0 -121
  378. package/src/components/item/item.stories.tsx +0 -116
  379. package/src/components/item/item.tsx +0 -172
  380. package/src/components/kbd/kbd.meta.md +0 -94
  381. package/src/components/kbd/kbd.stories.tsx +0 -70
  382. package/src/components/kbd/kbd.tsx +0 -86
  383. package/src/components/label/label.meta.md +0 -99
  384. package/src/components/label/label.stories.tsx +0 -145
  385. package/src/components/label/label.tsx +0 -138
  386. package/src/components/masonry/masonry.meta.md +0 -90
  387. package/src/components/masonry/masonry.stories.tsx +0 -68
  388. package/src/components/masonry/masonry.tsx +0 -60
  389. package/src/components/mentions/mentions.meta.md +0 -119
  390. package/src/components/mentions/mentions.stories.tsx +0 -189
  391. package/src/components/mentions/mentions.tsx +0 -243
  392. package/src/components/menubar/menubar.meta.md +0 -118
  393. package/src/components/menubar/menubar.stories.tsx +0 -141
  394. package/src/components/menubar/menubar.tsx +0 -232
  395. package/src/components/native-select/native-select.meta.md +0 -93
  396. package/src/components/native-select/native-select.stories.tsx +0 -83
  397. package/src/components/native-select/native-select.tsx +0 -54
  398. package/src/components/navigation-menu/navigation-menu.meta.md +0 -118
  399. package/src/components/navigation-menu/navigation-menu.stories.tsx +0 -215
  400. package/src/components/navigation-menu/navigation-menu.tsx +0 -129
  401. package/src/components/notification/notification.meta.md +0 -133
  402. package/src/components/notification/notification.stories.tsx +0 -98
  403. package/src/components/notification/notification.tsx +0 -99
  404. package/src/components/page-header/DEVELOPMENT.md +0 -842
  405. package/src/components/page-header/page-header.meta.md +0 -208
  406. package/src/components/page-header/page-header.stories.tsx +0 -421
  407. package/src/components/page-header/page-header.tsx +0 -281
  408. package/src/components/pagination/pagination.meta.md +0 -230
  409. package/src/components/pagination/pagination.stories.tsx +0 -284
  410. package/src/components/pagination/pagination.tsx +0 -577
  411. package/src/components/popconfirm/popconfirm.meta.md +0 -114
  412. package/src/components/popconfirm/popconfirm.stories.tsx +0 -75
  413. package/src/components/popconfirm/popconfirm.tsx +0 -134
  414. package/src/components/popover/popover.meta.md +0 -154
  415. package/src/components/popover/popover.stories.tsx +0 -158
  416. package/src/components/popover/popover.tsx +0 -104
  417. package/src/components/progress/progress.meta.md +0 -118
  418. package/src/components/progress/progress.stories.tsx +0 -75
  419. package/src/components/progress/progress.tsx +0 -203
  420. package/src/components/radio-group/radio-group.meta.md +0 -175
  421. package/src/components/radio-group/radio-group.stories.tsx +0 -113
  422. package/src/components/radio-group/radio-group.tsx +0 -209
  423. package/src/components/rate/rate.meta.md +0 -118
  424. package/src/components/rate/rate.stories.tsx +0 -89
  425. package/src/components/rate/rate.tsx +0 -180
  426. package/src/components/resizable/resizable.meta.md +0 -95
  427. package/src/components/resizable/resizable.stories.tsx +0 -104
  428. package/src/components/resizable/resizable.tsx +0 -56
  429. package/src/components/result/result.meta.md +0 -95
  430. package/src/components/result/result.stories.tsx +0 -67
  431. package/src/components/result/result.tsx +0 -100
  432. package/src/components/scroll-area/scroll-area.meta.md +0 -85
  433. package/src/components/scroll-area/scroll-area.stories.tsx +0 -49
  434. package/src/components/scroll-area/scroll-area.tsx +0 -51
  435. package/src/components/segmented/segmented.meta.md +0 -106
  436. package/src/components/segmented/segmented.stories.tsx +0 -130
  437. package/src/components/segmented/segmented.tsx +0 -146
  438. package/src/components/select/select.meta.md +0 -255
  439. package/src/components/select/select.stories.tsx +0 -275
  440. package/src/components/select/select.tsx +0 -735
  441. package/src/components/separator/separator.meta.md +0 -75
  442. package/src/components/separator/separator.stories.tsx +0 -71
  443. package/src/components/separator/separator.tsx +0 -100
  444. package/src/components/sheet/sheet.meta.md +0 -113
  445. package/src/components/sheet/sheet.stories.tsx +0 -188
  446. package/src/components/sheet/sheet.tsx +0 -226
  447. package/src/components/sidebar/sidebar.meta.md +0 -150
  448. package/src/components/sidebar/sidebar.tsx +0 -824
  449. package/src/components/skeleton/skeleton.meta.md +0 -94
  450. package/src/components/skeleton/skeleton.stories.tsx +0 -79
  451. package/src/components/skeleton/skeleton.tsx +0 -144
  452. package/src/components/slider/slider.meta.md +0 -146
  453. package/src/components/slider/slider.stories.tsx +0 -121
  454. package/src/components/slider/slider.tsx +0 -227
  455. package/src/components/sonner/sonner.meta.md +0 -147
  456. package/src/components/sonner/sonner.stories.tsx +0 -164
  457. package/src/components/sonner/sonner.tsx +0 -169
  458. package/src/components/spinner/spinner.meta.md +0 -125
  459. package/src/components/spinner/spinner.stories.tsx +0 -123
  460. package/src/components/spinner/spinner.tsx +0 -166
  461. package/src/components/statistic/statistic.meta.md +0 -104
  462. package/src/components/statistic/statistic.stories.tsx +0 -67
  463. package/src/components/steps/steps.meta.md +0 -116
  464. package/src/components/steps/steps.stories.tsx +0 -115
  465. package/src/components/steps/steps.tsx +0 -173
  466. package/src/components/switch/switch.meta.md +0 -138
  467. package/src/components/switch/switch.stories.tsx +0 -75
  468. package/src/components/switch/switch.tsx +0 -169
  469. package/src/components/table/table.meta.md +0 -106
  470. package/src/components/table/table.stories.tsx +0 -80
  471. package/src/components/table/table.tsx +0 -122
  472. package/src/components/tabs/tabs.meta.md +0 -111
  473. package/src/components/tabs/tabs.stories.tsx +0 -156
  474. package/src/components/tabs/tabs.tsx +0 -190
  475. package/src/components/tag/tag.meta.md +0 -159
  476. package/src/components/tag/tag.stories.tsx +0 -250
  477. package/src/components/tag/tag.tsx +0 -386
  478. package/src/components/textarea/textarea.meta.md +0 -99
  479. package/src/components/textarea/textarea.stories.tsx +0 -89
  480. package/src/components/textarea/textarea.tsx +0 -137
  481. package/src/components/time-picker/time-picker.meta.md +0 -175
  482. package/src/components/time-picker/time-picker.stories.tsx +0 -129
  483. package/src/components/time-picker/time-picker.tsx +0 -946
  484. package/src/components/timeline/timeline.meta.md +0 -110
  485. package/src/components/timeline/timeline.stories.tsx +0 -134
  486. package/src/components/timeline/timeline.tsx +0 -168
  487. package/src/components/toggle/toggle.meta.md +0 -89
  488. package/src/components/toggle/toggle.stories.tsx +0 -66
  489. package/src/components/toggle/toggle.tsx +0 -54
  490. package/src/components/toggle-group/toggle-group.meta.md +0 -91
  491. package/src/components/toggle-group/toggle-group.stories.tsx +0 -83
  492. package/src/components/toggle-group/toggle-group.tsx +0 -78
  493. package/src/components/tooltip/tooltip.meta.md +0 -149
  494. package/src/components/tooltip/tooltip.stories.tsx +0 -108
  495. package/src/components/tooltip/tooltip.tsx +0 -153
  496. package/src/components/tour/tour.meta.md +0 -121
  497. package/src/components/tour/tour.stories.tsx +0 -66
  498. package/src/components/tour/tour.tsx +0 -242
  499. package/src/components/transfer/transfer.meta.md +0 -95
  500. package/src/components/transfer/transfer.stories.tsx +0 -64
  501. package/src/components/transfer/transfer.tsx +0 -258
  502. package/src/components/tree/tree.meta.md +0 -169
  503. package/src/components/tree/tree.stories.tsx +0 -128
  504. package/src/components/tree/tree.tsx +0 -368
  505. package/src/components/tree-select/tree-select.meta.md +0 -151
  506. package/src/components/tree-select/tree-select.stories.tsx +0 -80
  507. package/src/components/tree-select/tree-select.tsx +0 -206
  508. package/src/components/typography/typography.meta.md +0 -149
  509. package/src/components/typography/typography.stories.tsx +0 -116
  510. package/src/components/typography/typography.tsx +0 -260
  511. package/src/components/upload/upload.meta.md +0 -156
  512. package/src/components/upload/upload.stories.tsx +0 -135
  513. package/src/components/upload/upload.tsx +0 -398
  514. package/src/components/watermark/watermark.meta.md +0 -100
  515. package/src/components/watermark/watermark.stories.tsx +0 -170
  516. package/src/components/watermark/watermark.tsx +0 -166
  517. package/src/hooks/use-breakpoint.ts +0 -117
  518. package/src/hooks/use-debounce-callback.ts +0 -52
  519. package/src/stories/theme-tokens.stories.tsx +0 -747
  520. package/src/utils/trigger-input.ts +0 -53
@@ -1,128 +0,0 @@
1
- ---
2
- id: calendar
3
- name: Calendar
4
- displayName: 日历
5
- type: component
6
- category: data-display
7
- since: 0.1.0
8
- package: '@teamix-evo/ui'
9
- ---
10
-
11
- # Calendar 日历
12
-
13
- 日期选择面板 — 基于 [`react-day-picker`](https://react-day-picker.js.org/),与 design tokens 对齐。
14
- **两种用法**:
15
-
16
- 1. **inline**(裸 Calendar):嵌入页面或 Card
17
- 2. **配 Popover** → `DatePicker`(单日)/ `DateRangePicker`(范围)
18
-
19
- ## When to use
20
-
21
- - 日期 / 范围选择(配 `DatePicker`)
22
- - 日历视图(展示日程 / 假期 / 数据热力)
23
- - 月份导航器
24
-
25
- ## When NOT to use
26
-
27
- - 时间选择 → 配 `Input type="time"` 或自定义 TimePicker
28
- - 模糊时间("近 7 天") → `Select` + 预设范围
29
- - 仅显示日期 → `<time>` 配 `date-fns`
30
-
31
- ## Props
32
-
33
- > 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。
34
-
35
- <!-- auto:props:begin -->
36
- | 名称 | 类型 | 默认值 | 必填 | 说明 |
37
- | --- | --- | --- | --- | --- |
38
- | `className` | `string` | – | – | 容器 className。组件内部默认带 `p-3`,会与传入值自动 merge。 |
39
- | `classNames` | `DayPickerProps['classNames']` | – | – | 覆盖底层 react-day-picker 的 classNames slots(深度自定义日格 / 表头 / 导航等)。 |
40
- | `showOutsideDays` | `boolean` | `true` | – | 是否显示当月范围外的日期(灰色填充,占位补齐周表格)。 |
41
- | `mode` | `DayPickerProps['mode']` | `"single"` | – | 选择模式 — `'single'` 单选(`selected: Date`)/ `'multiple'` 多选(`selected: Date[]`) / `'range'` 范围(`selected: DateRange`)。 |
42
- | `numberOfMonths` | `number` | `1` | – | 受控已选值 — 类型随 `mode` 变化: - `single` → `Date \| undefined` - `multiple` → `Date[]` - `range` → `{ from?: Date; to?: Date } \| undefined` 详细类型由底层 react-day-picker 判别联合保证;此处仅展示业务侧期望形态。 同时显示几个月历(对齐 antd `numberOfMonths`)。 |
43
- | `disabled` | `DayPickerProps['disabled']` | – | – | 不可选日期匹配器 — 支持 `Date` / `Date[]` / `DateRange` / 函数 `(date) => boolean` / 复合数组。 |
44
- | `defaultMonth` | `Date` | – | – | 默认显示的月份(uncontrolled — 仅初始生效)。 不传时使用 `selected` 的月份,均无则当前月。 |
45
- | `month` | `Date` | – | – | 受控当前显示的月份(配 `onMonthChange` 使用)。 |
46
- | `onMonthChange` | `(month: Date) => void` | – | – | 月份切换回调。 |
47
- | `weekStartsOn` | `DayPickerProps['weekStartsOn']` | `0` | – | 一周起始日 — `0` 周日 / `1` 周一 / ... / `6` 周六(对齐 ISO 8601 / antd `firstDayOfWeek`)。 |
48
- | `captionLayout` | `DayPickerProps['captionLayout']` | – | – | 标题布局 — 控制是否显示年 / 月下拉: - `'label'`(默认)— 仅标签文字 - `'dropdown'` — 月 + 年下拉 - `'dropdown-months'` — 仅月份下拉 - `'dropdown-years'` — 仅年份下拉 |
49
- | `locale` | `DayPickerProps['locale']` | – | – | date-fns Locale 对象,用于本地化星期 / 月份名 / RTL 等(默认 en-US)。 |
50
- <!-- auto:props:end -->
51
-
52
- ## 依赖
53
-
54
- > 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
55
-
56
- <!-- auto:deps:begin -->
57
- ### 同库依赖
58
-
59
- > `teamix-evo ui add calendar` 时,以下 entry 会被自动连带安装(无需手动 add)。
60
-
61
- | Entry | 类型 | 描述 |
62
- | --- | --- | --- |
63
- | `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
64
- | `button` | component | 通用按钮 — shadcn 实现 + cloud-design 能力并集(loading / icon / shape / block / dashed variant / color 语义双 prop / disabledTooltip)。同文件合一导出 ButtonGroup + ButtonGroupText(等价 antd Space.Compact + cd SplitButton)。 |
65
-
66
- ### npm 依赖
67
-
68
- > 业务侧需要先 `pnpm add` / `npm install` 这些包。CLI 在 `ui add` 完成后会列出此提示。
69
-
70
- ```bash
71
- pnpm add react-day-picker@^9.0.0 lucide-react@^0.460.0
72
- ```
73
- <!-- auto:deps:end -->
74
-
75
- > 透传所有 react-day-picker `<DayPicker>` props(`mode` / `selected` / `onSelect` / `disabled` / `fromYear` / `toYear` / `numberOfMonths` 等)。完整 API:[react-day-picker.js.org](https://react-day-picker.js.org/)。
76
-
77
- ## AI 生成纪律
78
-
79
- - **`mode` 必传**:`'single'` / `'multiple'` / `'range'` 三选一,API 不同(`selected` 类型不同)
80
- - **disabled 日期**:用 `disabled={(date) => date < startOfDay(new Date())}` 而非自己过滤
81
- - **`fromYear` / `toYear` 限制可选范围**:不设置时年份下拉无界
82
- - **多日期范围**:`mode="range"` 时 `selected` 是 `{ from?: Date, to?: Date }`
83
- - **无障碍自带**:react-day-picker 完整 ARIA + 键盘导航,不要自行覆盖
84
- - **`classNames` 必须用 react-day-picker v9 的 slot key**:本组件依赖 `react-day-picker@^9`。v9 重命名了所有 slot,**v8 老 key 完全失效**(默认渲染会塌掉成 `<table>` 原生样式)。常见映射:
85
- - `caption` → `month_caption`
86
- - `nav_button` / `nav_button_previous` / `nav_button_next` → `button_previous` / `button_next`(`nav` 为容器)
87
- - `table` → `month_grid`
88
- - `head_row` / `head_cell` → `weekdays` / `weekday`
89
- - `row` → `week`
90
- - `cell` / `day` → `day`(td 外壳)/ `day_button`(真正的按钮)
91
- - `day_selected` / `day_today` / `day_outside` / `day_disabled` / `day_hidden` / `day_range_*` → 去 `day_` 前缀:`selected` / `today` / `outside` / `disabled` / `hidden` / `range_*`
92
- - **nav 是 `<Months>` 直接子元素,与 `<Month>` 平级**(默认 `navLayout`):若 `nav` 用 absolute 定位横跨容器顶部覆盖到 caption 区域,**必须给 nav 加 `z-10`**,否则源码顺序在后的 `month_caption` 会盖住翻月按钮导致点击失效;同时 `month_caption` 不要自行加 `relative`(会创建 stacking context 反而把 nav 压在下面)
93
- - **状态类(selected/today/range\_\*)作用在 `day_button` 上,不是 `day` 外壳**:视觉态(背景色/圆角)需直接写到对应 slot;`day` 外壳负责 range 段连续背景,用 `[&:has([data-selected])]` / `[data-range-*]` 这种 v9 data attribute 选择器
94
-
95
- ## Examples
96
-
97
- ```tsx
98
- import { Calendar } from '@/components/ui/calendar';
99
- import * as React from 'react';
100
-
101
- // 单日
102
- const [date, setDate] = React.useState<Date | undefined>();
103
- <Calendar mode="single" selected={date} onSelect={setDate} />;
104
-
105
- // 多选
106
- const [days, setDays] = React.useState<Date[]>([]);
107
- <Calendar mode="multiple" selected={days} onSelect={setDays} />;
108
-
109
- // 范围
110
- const [range, setRange] = React.useState<{ from?: Date; to?: Date }>();
111
- <Calendar
112
- mode="range"
113
- selected={range}
114
- onSelect={setRange}
115
- numberOfMonths={2}
116
- />;
117
-
118
- // 限制范围 + 禁用过去
119
- import { startOfDay } from 'date-fns';
120
- <Calendar
121
- mode="single"
122
- selected={date}
123
- onSelect={setDate}
124
- disabled={(d) => d < startOfDay(new Date())}
125
- fromYear={2020}
126
- toYear={2030}
127
- />;
128
- ```
@@ -1,68 +0,0 @@
1
- import * as React from 'react';
2
- import type { Meta, StoryObj } from '@storybook/react-vite';
3
- import type { DateRange } from 'react-day-picker';
4
- import { Calendar } from './calendar';
5
-
6
- const meta: Meta<typeof Calendar> = {
7
- title: '数据展示 · Data Display/Calendar',
8
- component: Calendar,
9
- tags: ['autodocs'],
10
- parameters: {
11
- layout: 'centered',
12
- docs: {
13
- description: {
14
- component:
15
- '日历 — 内联日期选择面板。基于 react-day-picker@9 + design tokens,支持 `mode="single" | "multiple" | "range"` 三种选择模式、年份 / 月份导航、`disabled` 函数式禁用、`numberOfMonths` 多月并排;通常配 `Popover` 包装为 `DatePicker`。',
16
- },
17
- },
18
- },
19
- };
20
-
21
- export default meta;
22
- type Story = StoryObj<typeof Calendar>;
23
-
24
- export const Single: Story = {
25
- render: () => {
26
- const [date, setDate] = React.useState<Date | undefined>(new Date());
27
- return (
28
- <Calendar
29
- mode="single"
30
- selected={date}
31
- onSelect={setDate}
32
- className="rounded-md border border-border"
33
- />
34
- );
35
- },
36
- };
37
-
38
- export const Multiple: Story = {
39
- render: () => {
40
- const [days, setDays] = React.useState<Date[] | undefined>([]);
41
- return (
42
- <Calendar
43
- mode="multiple"
44
- selected={days}
45
- onSelect={setDays}
46
- className="rounded-md border border-border"
47
- />
48
- );
49
- },
50
- };
51
-
52
- export const Range: Story = {
53
- render: () => {
54
- const [range, setRange] = React.useState<DateRange | undefined>({
55
- from: new Date(),
56
- to: new Date(Date.now() + 7 * 24 * 3600 * 1000),
57
- });
58
- return (
59
- <Calendar
60
- mode="range"
61
- selected={range}
62
- onSelect={setRange}
63
- numberOfMonths={2}
64
- className="rounded-md border border-border"
65
- />
66
- );
67
- },
68
- };
@@ -1,172 +0,0 @@
1
- import * as React from 'react';
2
- import {
3
- ChevronDown,
4
- ChevronLeft,
5
- ChevronRight,
6
- ChevronUp,
7
- } from 'lucide-react';
8
- import { DayPicker, type DayPickerProps } from 'react-day-picker';
9
-
10
- import { cn } from '@/utils/cn';
11
- import { buttonVariants } from '@/components/button/button';
12
-
13
- /**
14
- * Calendar 自身的可定制属性(ui 层包装)。底层完整 props 透传至
15
- * [`DayPicker`](https://daypicker.dev/) — 下表列出业务侧最常用的核心 props,
16
- * 其余 DayPicker prop(`initialFocus` / `pagedNavigation` 等)走 `...rest` 透传。
17
- */
18
- export interface CalendarProps {
19
- /**
20
- * 容器 className。组件内部默认带 `p-3`,会与传入值自动 merge。
21
- */
22
- className?: string;
23
- /**
24
- * 覆盖底层 react-day-picker 的 classNames slots(深度自定义日格 / 表头 / 导航等)。
25
- */
26
- classNames?: DayPickerProps['classNames'];
27
- /**
28
- * 是否显示当月范围外的日期(灰色填充,占位补齐周表格)。
29
- * @default true
30
- */
31
- showOutsideDays?: boolean;
32
- /**
33
- * 选择模式 — `'single'` 单选(`selected: Date`)/ `'multiple'` 多选(`selected: Date[]`)
34
- * / `'range'` 范围(`selected: DateRange`)。
35
- * @default "single"
36
- */
37
- mode?: DayPickerProps['mode'];
38
- /**
39
- * 受控已选值 — 类型随 `mode` 变化:
40
- * - `single` → `Date | undefined`
41
- * - `multiple` → `Date[]`
42
- * - `range` → `{ from?: Date; to?: Date } | undefined`
43
- *
44
- * 详细类型由底层 react-day-picker 判别联合保证;此处仅展示业务侧期望形态。
45
- */
46
- // selected / onSelect 由 DayPickerProps 通过 `& DayPickerProps` 透传保证类型正确;
47
- // 此处声明仅为 meta 文档展示,不参与运行时类型推导。
48
- // 业务侧调用:`<Calendar mode="single" selected={date} onSelect={(d) => ...} />`
49
- /**
50
- * 同时显示几个月历(对齐 antd `numberOfMonths`)。
51
- * @default 1
52
- */
53
- numberOfMonths?: number;
54
- /**
55
- * 不可选日期匹配器 — 支持 `Date` / `Date[]` / `DateRange` / 函数 `(date) => boolean`
56
- * / 复合数组。
57
- */
58
- disabled?: DayPickerProps['disabled'];
59
- /**
60
- * 默认显示的月份(uncontrolled — 仅初始生效)。
61
- * 不传时使用 `selected` 的月份,均无则当前月。
62
- */
63
- defaultMonth?: Date;
64
- /** 受控当前显示的月份(配 `onMonthChange` 使用)。 */
65
- month?: Date;
66
- /** 月份切换回调。 */
67
- onMonthChange?: (month: Date) => void;
68
- /**
69
- * 一周起始日 — `0` 周日 / `1` 周一 / ... / `6` 周六(对齐 ISO 8601 / antd `firstDayOfWeek`)。
70
- * @default 0
71
- */
72
- weekStartsOn?: DayPickerProps['weekStartsOn'];
73
- /**
74
- * 标题布局 — 控制是否显示年 / 月下拉:
75
- * - `'label'`(默认)— 仅标签文字
76
- * - `'dropdown'` — 月 + 年下拉
77
- * - `'dropdown-months'` — 仅月份下拉
78
- * - `'dropdown-years'` — 仅年份下拉
79
- */
80
- captionLayout?: DayPickerProps['captionLayout'];
81
- /**
82
- * date-fns Locale 对象,用于本地化星期 / 月份名 / RTL 等(默认 en-US)。
83
- * @example
84
- * import { zhCN } from 'date-fns/locale';
85
- * <Calendar locale={zhCN} />
86
- */
87
- locale?: DayPickerProps['locale'];
88
- }
89
-
90
- function Calendar({
91
- className,
92
- classNames,
93
- showOutsideDays = true,
94
- ...props
95
- }: CalendarProps & DayPickerProps) {
96
- return (
97
- <DayPicker
98
- showOutsideDays={showOutsideDays}
99
- className={cn('p-3', className)}
100
- classNames={{
101
- root: 'w-fit',
102
- months: 'flex flex-col sm:flex-row gap-4 relative',
103
- month: 'flex flex-col gap-4',
104
- month_caption: 'flex justify-center pt-1 items-center h-7 w-full',
105
- caption_label: 'text-xs font-medium',
106
- nav: 'absolute inset-x-1 top-1 z-10 flex items-center justify-between',
107
- button_previous: cn(
108
- buttonVariants({ variant: 'outline', size: 'icon' }),
109
- 'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',
110
- ),
111
- button_next: cn(
112
- buttonVariants({ variant: 'outline', size: 'icon' }),
113
- 'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',
114
- ),
115
- month_grid: 'w-full border-collapse',
116
- weekdays: 'flex',
117
- weekday: 'text-muted-foreground rounded-md w-8 font-normal text-xs-cal',
118
- week: 'flex w-full mt-2',
119
- day: cn(
120
- 'relative p-0 text-center text-xs focus-within:relative focus-within:z-20',
121
- '[&:has([data-selected])]:bg-accent',
122
- '[&:has([data-selected])]:first:rounded-l-md [&:has([data-selected])]:last:rounded-r-md',
123
- '[&:has([data-range-start])]:rounded-l-md [&:has([data-range-end])]:rounded-r-md',
124
- '[&:not(:has([data-range-middle]))]:[&:has([data-selected])]:rounded-md',
125
- // 预留 1px transparent dashed border 全 4 边占位 —— DateRangePicker preview 虚线
126
- // 切换时不触发 cell 宽度 / 高度跳变(仅切换 border-color)。
127
- // dashed border 跨 cell 时 pattern 节奏不可避免有微小偏差(CSS 固有限制),
128
- // 但 cell 间 0 gap,视觉上无明显断点。
129
- 'border border-transparent border-dashed',
130
- ),
131
- day_button: cn(
132
- buttonVariants({ variant: 'ghost' }),
133
- 'size-8 rounded-md p-0 font-normal aria-selected:opacity-100',
134
- 'focus-visible:ring-offset-0',
135
- // 父 day cell(td)有 aria-selected 时,button hover 保持 primary 蓝,
136
- // 不被 ghost variant 的 hover:bg-accent 覆盖。react-day-picker v9 的
137
- // aria-selected 加在 cell 上而非 button 上,所以走 ancestor selector。
138
- '[[aria-selected]_&]:hover:bg-primary [[aria-selected]_&]:hover:text-primary-foreground',
139
- ),
140
- range_start: 'day-range-start',
141
- range_end: 'day-range-end',
142
- range_middle:
143
- 'aria-selected:bg-accent aria-selected:text-accent-foreground',
144
- selected:
145
- 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground rounded-md',
146
- today: 'bg-accent text-accent-foreground rounded-md',
147
- outside:
148
- 'day-outside text-muted-foreground aria-selected:text-muted-foreground',
149
- disabled: 'text-muted-foreground opacity-50',
150
- hidden: 'invisible',
151
- ...classNames,
152
- }}
153
- components={{
154
- Chevron: ({ orientation, className: chevronClassName, ...rest }) => {
155
- const Icon =
156
- orientation === 'left'
157
- ? ChevronLeft
158
- : orientation === 'up'
159
- ? ChevronUp
160
- : orientation === 'down'
161
- ? ChevronDown
162
- : ChevronRight;
163
- return <Icon {...rest} className={cn('size-4', chevronClassName)} />;
164
- },
165
- }}
166
- {...props}
167
- />
168
- );
169
- }
170
- Calendar.displayName = 'Calendar';
171
-
172
- export { Calendar };
@@ -1,139 +0,0 @@
1
- ---
2
- id: card
3
- name: Card
4
- displayName: 卡片
5
- type: component
6
- category: data-display
7
- since: 0.1.0
8
- package: '@teamix-evo/ui'
9
- ---
10
-
11
- # Card 卡片
12
-
13
- 卡片容器 — shadcn 组合式(`Card / Header / Title / Description / Content / Footer`)+ antd 并集(`hoverable / loading / Cover / Actions / Meta / extra`)。
14
- **单卡覆盖列表项 / 详情卡 / 资源卡 / 媒体卡多种形态**。
15
-
16
- ## When to use
17
-
18
- - 列表项 / 网格卡片(产品 / 服务 / 用户)
19
- - 详情页的分块容器
20
- - 仪表板小部件(配 Header.extra 放刷新按钮)
21
- - 媒体卡(`<CardCover>` 顶部图片)
22
-
23
- ## When NOT to use
24
-
25
- - 整屏页面背景 → 用普通 div + spacing
26
- - 简单文字提示 → `Alert` / `Badge`
27
- - 浮层 → `Popover` / `HoverCard`
28
-
29
- ## Props
30
-
31
- > 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。
32
-
33
- <!-- auto:props:begin -->
34
- | 名称 | 类型 | 默认值 | 必填 | 说明 |
35
- | --- | --- | --- | --- | --- |
36
- | `hoverable` | `boolean` | `false` | – | 鼠标 hover 时的视觉反馈(antd `hoverable` 并集) — 阴影升级 + 微交互。 |
37
- | `loading` | `boolean` | `false` | – | 加载态(antd `loading` 并集) — 整卡渲染为骨架屏占位,不展示 children。 |
38
- | `size` | `CardSize` | `"default"` | – | 卡片尺寸(antd `size` 并集,并与 cloud-design spec 对齐) — - `sm`: 16px padding + sm 标题 (16px) - `default`: 24px padding + base 标题 (16px) - `lg`: 32px padding + lg 标题 (18px) 会通过 context 传递给其子组件(Header / Content / Footer)。 |
39
- <!-- auto:props:end -->
40
-
41
- ## 依赖
42
-
43
- > 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
44
-
45
- <!-- auto:deps:begin -->
46
- ### 同库依赖
47
-
48
- > `teamix-evo ui add card` 时,以下 entry 会被自动连带安装(无需手动 add)。
49
-
50
- | Entry | 类型 | 描述 |
51
- | --- | --- | --- |
52
- | `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
53
- | `skeleton` | component | 骨架屏 — shadcn pulse 单元素 + antd Avatar/Image/Button/Input/Paragraph 子家族,自动 motion-reduce |
54
-
55
- ### npm 依赖
56
-
57
- _无 — 本组件不依赖任何 npm 包。_
58
- <!-- auto:deps:end -->
59
-
60
- ## AI 生成纪律
61
-
62
- - **`hoverable` 仅用于可点击卡**:配 `onClick` 或包 `<Link>`,不能 hover 起视觉但点了无反应
63
- - **`loading` 整卡替换为骨架**:`children` 在 loading 时不渲染,**不要**手动嵌套 Skeleton
64
- - **`extra` 放轻量按钮**:刷新 / 更多 / 切换;**不要**塞主操作(放 CardFooter 更醒目)
65
- - **`<CardCover>` 顶部对齐**:必须是 Card 的第一个子元素(避免上方圆角穿帮)
66
- - **`<CardActions items>` 数组用法**:item 可以是文本 / 图标按钮;数组长度不超过 4
67
-
68
- ## Card 形态 — 旧库 API → 新库映射
69
-
70
- 旧库(Teamix 1.0 / `@alifd/next.Card` / `Card.Content` / `Card.Media` / `Card.Actions`)走数据驱动 + free 模式;新库走**纯组合**。下表给出旧库 API 到新库写法的逐项映射。
71
-
72
- | 旧库 API | 新库写法 | 备注 |
73
- | --- | --- | --- |
74
- | `<Card title="..." subTitle="...">` | `<CardHeader><CardTitle>...</CardTitle><CardDescription>...</CardDescription></CardHeader>` | 组合式更利于多语言换行 / 自定义节点 |
75
- | `<Card extra={...}>` | `<CardHeader extra={...}>...</CardHeader>` | API 一致;放刷新 / 更多 / 切换等轻量按钮 |
76
- | `<Card.Media>` | `<CardCover>` | 圆角自动只渲顶部(`rounded-t-lg`) |
77
- | `<Card.Actions>` | `<CardActions items={[...]} />` | 自动均分等宽 + 中间分隔线 |
78
- | `<Card.Divider />` | `<Separator />` | 用 `@/components/ui/separator` |
79
- | `loading` 骨架屏 | `loading` (P0 已实现) | 整卡渲染为 3 行骨架占位 |
80
- | `hoverable` 鼠标反馈 | `hoverable` (P0 已实现) | 阴影升级 + 微交互 |
81
- | `size="small/medium/large"` | `size="sm/default/lg"` | 重命名 — `sm` 16px / `default` 24px / `lg` 32px padding |
82
- | `showTitleBullet` 左侧竖线 | 不修复 — 业务自加 `<CardTitle className="border-l-2 border-primary pl-2">` | className 自实现 |
83
- | `showHeadDivider` 标题分割线 | 不修复 — 用 `<Separator />` 或 `border-b` | — |
84
- | `contentHeight` 内容固定高 | 不修复 — `<CardContent className="h-[N]">` | — |
85
- | `free` 自由组合模式 | 不修复 — 新库始终组合式 | 默认即 free |
86
- | `hasBorder={false}` | 不修复 — `className="border-0 shadow-none"` | — |
87
- | `Card.CollapseContent` | 组合 `<Collapsible>` 在 `<CardContent>` 内 | 用 `@/components/ui/collapsible` |
88
- | `Card.DropDownActions` | 组合 `<CardAction>` + `<DropdownMenu>` | shadcn 2026-04 新增 `<CardAction>` 子组件 |
89
-
90
- ## Examples
91
-
92
- ```tsx
93
- import {
94
- Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter,
95
- CardCover, CardActions, CardMeta,
96
- } from '@/components/ui/card';
97
- import { Button } from '@/components/ui/button';
98
- import { Heart, Share, MessageSquare, MoreHorizontal } from 'lucide-react';
99
-
100
- // 基础
101
- <Card>
102
- <CardHeader extra={<Button size="icon" variant="ghost"><MoreHorizontal /></Button>}>
103
- <CardTitle>项目名称</CardTitle>
104
- <CardDescription>项目简介一行...</CardDescription>
105
- </CardHeader>
106
- <CardContent>主体内容</CardContent>
107
- <CardFooter className="justify-end gap-2">
108
- <Button variant="outline">取消</Button>
109
- <Button>确认</Button>
110
- </CardFooter>
111
- </Card>
112
-
113
- // hoverable
114
- <Card hoverable onClick={() => navigate('/x')}>
115
- <CardContent>...</CardContent>
116
- </Card>
117
-
118
- // loading
119
- <Card loading />
120
-
121
- // 媒体卡(antd 风格)
122
- <Card hoverable>
123
- <CardCover>
124
- <img src="/cover.jpg" alt="" />
125
- </CardCover>
126
- <CardContent className="pt-4">
127
- <CardMeta
128
- avatar={<Avatar><AvatarImage src="..." /><AvatarFallback>A</AvatarFallback></Avatar>}
129
- title="作者"
130
- description="发布时间"
131
- />
132
- </CardContent>
133
- <CardActions items={[
134
- <span><Heart className="inline size-4" /> 12</span>,
135
- <span><Share className="inline size-4" /> 4</span>,
136
- <span><MessageSquare className="inline size-4" /> 8</span>,
137
- ]} />
138
- </Card>
139
- ```
@@ -1,151 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
- import { Heart, MessageSquare, MoreHorizontal, Share } from 'lucide-react';
3
- import {
4
- Card,
5
- CardHeader,
6
- CardTitle,
7
- CardDescription,
8
- CardContent,
9
- CardFooter,
10
- CardCover,
11
- CardActions,
12
- CardMeta,
13
- } from './card';
14
- import { Button } from '@/components/button/button';
15
- import {
16
- Avatar,
17
- AvatarImage,
18
- AvatarFallback,
19
- } from '@/components/avatar/avatar';
20
-
21
- const meta: Meta<typeof Card> = {
22
- title: '数据展示 · Data Display/Card',
23
- component: Card,
24
- tags: ['autodocs'],
25
- parameters: {
26
- docs: {
27
- description: {
28
- component:
29
- '卡片容器 — shadcn 组合式(Card / Header / Title / Description / Content / Footer) + antd 并集(hoverable / loading / Cover / Actions / Meta / extra)。单卡覆盖列表项 / 详情卡 / 资源卡 / 媒体卡多种形态。',
30
- },
31
- },
32
- },
33
- argTypes: {
34
- hoverable: { control: 'boolean' },
35
- loading: { control: 'boolean' },
36
- size: { control: 'inline-radio', options: ['sm', 'default', 'lg'] },
37
- },
38
- args: { hoverable: false, loading: false, size: 'default' },
39
- };
40
-
41
- export default meta;
42
- type Story = StoryObj<typeof Card>;
43
-
44
- export const Basic: Story = {
45
- render: (args) => (
46
- <Card {...args} className="w-80">
47
- <CardHeader
48
- extra={
49
- <Button size="icon" variant="ghost" aria-label="更多">
50
- <MoreHorizontal />
51
- </Button>
52
- }
53
- >
54
- <CardTitle>项目名称</CardTitle>
55
- <CardDescription>项目简介一行...</CardDescription>
56
- </CardHeader>
57
- <CardContent>
58
- <p className="text-sm text-muted-foreground">主体内容区域。</p>
59
- </CardContent>
60
- <CardFooter className="justify-end gap-2">
61
- <Button variant="outline">取消</Button>
62
- <Button>确认</Button>
63
- </CardFooter>
64
- </Card>
65
- ),
66
- };
67
-
68
- export const Hoverable: Story = {
69
- args: { hoverable: true },
70
- render: (args) => (
71
- <Card {...args} className="w-72">
72
- <CardContent className="pt-6">
73
- <p className="text-sm">悬浮我看阴影变化</p>
74
- </CardContent>
75
- </Card>
76
- ),
77
- };
78
-
79
- export const Loading: Story = {
80
- args: { loading: true },
81
- render: (args) => <Card {...args} className="w-80" />,
82
- };
83
-
84
- export const Media: Story = {
85
- parameters: { controls: { disable: true } },
86
- render: () => (
87
- <Card hoverable className="w-80">
88
- <CardCover>
89
- <img
90
- src="https://placehold.co/600x320/e5e7eb/6b7280?text=Cover"
91
- alt="cover"
92
- />
93
- </CardCover>
94
- <CardContent className="pt-4">
95
- <CardMeta
96
- avatar={
97
- <Avatar>
98
- <AvatarImage src="https://github.com/shadcn.png" />
99
- <AvatarFallback>U</AvatarFallback>
100
- </Avatar>
101
- }
102
- title="发布者"
103
- description="2 小时前 · 北京"
104
- />
105
- </CardContent>
106
- <CardActions
107
- items={[
108
- <span key="like" className="inline-flex items-center gap-1">
109
- <Heart className="size-4" /> 12
110
- </span>,
111
- <span key="share" className="inline-flex items-center gap-1">
112
- <Share className="size-4" /> 4
113
- </span>,
114
- <span key="comment" className="inline-flex items-center gap-1">
115
- <MessageSquare className="size-4" /> 8
116
- </span>,
117
- ]}
118
- />
119
- </Card>
120
- ),
121
- };
122
-
123
- export const Sizes: Story = {
124
- name: 'Sizes · sm / default / lg',
125
- parameters: { controls: { disable: true } },
126
- render: () => (
127
- <div className="flex flex-col gap-4">
128
- {(['sm', 'default', 'lg'] as const).map((s) => (
129
- <Card key={s} size={s} className="w-80">
130
- <CardHeader>
131
- <CardTitle>size = {s}</CardTitle>
132
- <CardDescription>
133
- padding 与标题级随 size 变化: sm → 16px / default → 24px / lg → 32px
134
- </CardDescription>
135
- </CardHeader>
136
- <CardContent>
137
- <p className="text-sm text-muted-foreground">
138
- 内容区 padding 同步从 head 继承,顶部 pt-0 跟 header 默认 gap 对齐。
139
- </p>
140
- </CardContent>
141
- <CardFooter className="justify-end gap-2">
142
- <Button size={s === 'lg' ? 'lg' : s === 'sm' ? 'sm' : 'default'} variant="outline">
143
- 取消
144
- </Button>
145
- <Button size={s === 'lg' ? 'lg' : s === 'sm' ? 'sm' : 'default'}>确认</Button>
146
- </CardFooter>
147
- </Card>
148
- ))}
149
- </div>
150
- ),
151
- };