@teamix-evo/ui 0.4.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.
- package/README.md +46 -50
- package/manifest.json +406 -653
- package/package.json +15 -34
- package/src/_design-system/theme-tokens/stories.tsx +1474 -0
- package/src/components/accordion/index.tsx +139 -0
- package/src/components/accordion/meta.md +162 -0
- package/src/components/accordion/stories.tsx +145 -0
- package/src/components/affix/index.tsx +149 -0
- package/src/components/affix/meta.md +23 -0
- package/src/components/affix/stories.tsx +70 -0
- package/src/components/alert/index.tsx +220 -0
- package/src/components/alert/meta.md +133 -0
- package/src/components/alert/stories.tsx +126 -0
- package/src/components/alert-dialog/index.tsx +282 -0
- package/src/components/alert-dialog/meta.md +86 -0
- package/src/components/alert-dialog/stories.tsx +163 -0
- package/src/components/avatar/index.tsx +159 -0
- package/src/components/avatar/meta.md +242 -0
- package/src/components/avatar/stories.tsx +241 -0
- package/src/components/badge/index.tsx +299 -0
- package/src/components/badge/meta.md +237 -0
- package/src/components/badge/stories.tsx +275 -0
- package/src/components/breadcrumb/index.tsx +137 -0
- package/src/components/breadcrumb/meta.md +64 -0
- package/src/components/breadcrumb/stories.tsx +86 -0
- package/src/components/button/index.tsx +202 -0
- package/src/components/button/meta.md +209 -0
- package/src/components/button/stories.tsx +215 -0
- package/src/components/button-group/index.tsx +211 -0
- package/src/components/button-group/meta.md +190 -0
- package/src/components/button-group/stories.tsx +182 -0
- package/src/components/calendar/index.tsx +240 -0
- package/src/components/calendar/meta.md +36 -0
- package/src/components/calendar/stories.tsx +36 -0
- package/src/components/card/index.tsx +262 -0
- package/src/components/card/meta.md +194 -0
- package/src/components/card/stories.tsx +202 -0
- package/src/components/carousel/index.tsx +481 -0
- package/src/components/carousel/meta.md +208 -0
- package/src/components/carousel/stories.tsx +271 -0
- package/src/components/cascader-select/index.tsx +308 -0
- package/src/components/cascader-select/meta.md +28 -0
- package/src/components/cascader-select/stories.tsx +118 -0
- package/src/components/checkbox/index.tsx +208 -0
- package/src/components/checkbox/meta.md +166 -0
- package/src/components/checkbox/stories.tsx +206 -0
- package/src/components/collapsible/index.tsx +72 -0
- package/src/components/collapsible/meta.md +87 -0
- package/src/components/collapsible/stories.tsx +97 -0
- package/src/components/color-picker/index.tsx +677 -0
- package/src/components/color-picker/meta.md +83 -0
- package/src/components/color-picker/stories.tsx +172 -0
- package/src/components/combobox/index.tsx +687 -0
- package/src/components/combobox/meta.md +83 -0
- package/src/components/combobox/stories.tsx +179 -0
- package/src/components/command/index.tsx +238 -0
- package/src/components/command/meta.md +48 -0
- package/src/components/command/stories.tsx +83 -0
- package/src/components/data-table/index.tsx +1537 -0
- package/src/components/data-table/meta.md +107 -0
- package/src/components/data-table/stories.tsx +1234 -0
- package/src/components/date-picker/index.tsx +1492 -0
- package/src/components/date-picker/meta.md +103 -0
- package/src/components/date-picker/stories.tsx +125 -0
- package/src/components/descriptions/index.tsx +535 -0
- package/src/components/descriptions/meta.md +104 -0
- package/src/components/descriptions/stories.tsx +389 -0
- package/src/components/dialog/index.tsx +255 -0
- package/src/components/dialog/meta.md +244 -0
- package/src/components/dialog/stories.tsx +330 -0
- package/src/components/dropdown-menu/index.tsx +301 -0
- package/src/components/dropdown-menu/meta.md +93 -0
- package/src/components/dropdown-menu/stories.tsx +124 -0
- package/src/components/empty/index.tsx +431 -0
- package/src/components/empty/meta.md +274 -0
- package/src/components/empty/stories.tsx +278 -0
- package/src/components/field/index.tsx +374 -0
- package/src/components/field/meta.md +283 -0
- package/src/components/field/stories.tsx +327 -0
- package/src/components/filter-bar/index.tsx +976 -0
- package/src/components/filter-bar/meta.md +57 -0
- package/src/components/filter-bar/stories.tsx +496 -0
- package/src/components/float-button/index.tsx +163 -0
- package/src/components/float-button/meta.md +73 -0
- package/src/components/float-button/stories.tsx +68 -0
- package/src/components/form/index.tsx +218 -0
- package/src/components/form/meta.md +16 -0
- package/src/components/form/stories.tsx +301 -0
- package/src/components/hover-card/index.tsx +103 -0
- package/src/components/hover-card/meta.md +71 -0
- package/src/components/hover-card/stories.tsx +107 -0
- package/src/components/icon/index.tsx +225 -0
- package/src/components/icon/meta.md +102 -0
- package/src/components/icon/stories.tsx +127 -0
- package/src/components/image/index.tsx +147 -0
- package/src/components/image/meta.md +55 -0
- package/src/components/image/stories.tsx +48 -0
- package/src/components/input/index.tsx +63 -0
- package/src/components/input/meta.md +57 -0
- package/src/components/input/stories.tsx +66 -0
- package/src/components/input-group/index.tsx +292 -0
- package/src/components/input-group/meta.md +108 -0
- package/src/components/input-group/stories.tsx +258 -0
- package/src/components/input-ip/index.tsx +288 -0
- package/src/components/input-ip/meta.md +48 -0
- package/src/components/input-ip/stories.tsx +69 -0
- package/src/components/input-number/index.tsx +360 -0
- package/src/components/input-number/meta.md +156 -0
- package/src/components/input-number/stories.tsx +187 -0
- package/src/components/item/index.tsx +368 -0
- package/src/components/item/meta.md +395 -0
- package/src/components/item/stories.tsx +432 -0
- package/src/components/label/index.tsx +44 -0
- package/src/components/label/meta.md +68 -0
- package/src/components/label/stories.tsx +64 -0
- package/src/components/mentions/index.tsx +369 -0
- package/src/components/mentions/meta.md +118 -0
- package/src/components/mentions/stories.tsx +153 -0
- package/src/components/menubar/index.tsx +313 -0
- package/src/components/menubar/meta.md +52 -0
- package/src/components/menubar/stories.tsx +99 -0
- package/src/components/navigation-menu/index.tsx +216 -0
- package/src/components/navigation-menu/meta.md +66 -0
- package/src/components/navigation-menu/stories.tsx +137 -0
- package/src/components/page-header/index.tsx +218 -0
- package/src/components/page-header/meta.md +211 -0
- package/src/components/page-header/stories.tsx +290 -0
- package/src/components/page-shell/index.tsx +119 -0
- package/src/components/page-shell/meta.md +115 -0
- package/src/components/page-shell/stories.tsx +154 -0
- package/src/components/pagination/index.tsx +580 -0
- package/src/components/pagination/meta.md +39 -0
- package/src/components/pagination/stories.tsx +319 -0
- package/src/components/popconfirm/index.tsx +477 -0
- package/src/components/popconfirm/meta.md +164 -0
- package/src/components/popconfirm/stories.tsx +231 -0
- package/src/components/popover/index.tsx +181 -0
- package/src/components/popover/meta.md +97 -0
- package/src/components/popover/stories.tsx +169 -0
- package/src/components/progress/index.tsx +176 -0
- package/src/components/progress/meta.md +95 -0
- package/src/components/progress/stories.tsx +115 -0
- package/src/components/radio-group/index.tsx +78 -0
- package/src/components/radio-group/meta.md +137 -0
- package/src/components/radio-group/stories.tsx +285 -0
- package/src/components/rate/index.tsx +284 -0
- package/src/components/rate/meta.md +63 -0
- package/src/components/rate/stories.tsx +107 -0
- package/src/components/resizable/index.tsx +122 -0
- package/src/components/resizable/meta.md +142 -0
- package/src/components/resizable/stories.tsx +105 -0
- package/src/components/scroll-area/index.tsx +83 -0
- package/src/components/scroll-area/meta.md +85 -0
- package/src/components/scroll-area/stories.tsx +82 -0
- package/src/components/select/index.tsx +325 -0
- package/src/components/select/meta.md +183 -0
- package/src/components/select/stories.tsx +210 -0
- package/src/components/separator/index.tsx +51 -0
- package/src/components/separator/meta.md +68 -0
- package/src/components/separator/stories.tsx +53 -0
- package/src/components/sheet/index.tsx +293 -0
- package/src/components/sheet/meta.md +226 -0
- package/src/components/sheet/stories.tsx +405 -0
- package/src/components/sidebar/index.tsx +715 -0
- package/src/components/sidebar/meta.md +14 -0
- package/src/components/sidebar/{sidebar.stories.tsx → stories.tsx} +250 -330
- package/src/components/skeleton/index.tsx +415 -0
- package/src/components/skeleton/meta.md +210 -0
- package/src/components/skeleton/stories.tsx +197 -0
- package/src/components/slider/index.tsx +222 -0
- package/src/components/slider/meta.md +125 -0
- package/src/components/slider/stories.tsx +109 -0
- package/src/components/sonner/index.tsx +149 -0
- package/src/components/sonner/meta.md +156 -0
- package/src/components/sonner/stories.tsx +285 -0
- package/src/components/spinner/index.tsx +335 -0
- package/src/components/spinner/meta.md +172 -0
- package/src/components/spinner/stories.tsx +197 -0
- package/src/components/statistic/{statistic.tsx → index.tsx} +25 -26
- package/src/components/statistic/meta.md +94 -0
- package/src/components/statistic/stories.tsx +85 -0
- package/src/components/steps/index.tsx +500 -0
- package/src/components/steps/meta.md +245 -0
- package/src/components/steps/stories.tsx +287 -0
- package/src/components/switch/index.tsx +175 -0
- package/src/components/switch/meta.md +107 -0
- package/src/components/switch/stories.tsx +154 -0
- package/src/components/table/index.tsx +350 -0
- package/src/components/table/meta.md +148 -0
- package/src/components/table/stories.tsx +189 -0
- package/src/components/tabs/index.tsx +379 -0
- package/src/components/tabs/meta.md +244 -0
- package/src/components/tabs/stories.tsx +312 -0
- package/src/components/tag/index.tsx +774 -0
- package/src/components/tag/meta.md +256 -0
- package/src/components/tag/stories.tsx +431 -0
- package/src/components/textarea/index.tsx +62 -0
- package/src/components/textarea/meta.md +77 -0
- package/src/components/textarea/stories.tsx +112 -0
- package/src/components/time-picker/index.tsx +887 -0
- package/src/components/time-picker/meta.md +102 -0
- package/src/components/time-picker/stories.tsx +125 -0
- package/src/components/timeline/index.tsx +422 -0
- package/src/components/timeline/meta.md +352 -0
- package/src/components/timeline/stories.tsx +369 -0
- package/src/components/toggle/index.tsx +74 -0
- package/src/components/toggle/meta.md +76 -0
- package/src/components/toggle/stories.tsx +66 -0
- package/src/components/toggle-group/index.tsx +167 -0
- package/src/components/toggle-group/meta.md +141 -0
- package/src/components/toggle-group/stories.tsx +124 -0
- package/src/components/tooltip/index.tsx +144 -0
- package/src/components/tooltip/meta.md +186 -0
- package/src/components/tooltip/stories.tsx +212 -0
- package/src/components/transfer/index.tsx +639 -0
- package/src/components/transfer/meta.md +76 -0
- package/src/components/transfer/stories.tsx +221 -0
- package/src/components/tree/index.tsx +764 -0
- package/src/components/tree/meta.md +96 -0
- package/src/components/tree/stories.tsx +385 -0
- package/src/components/tree/utils.ts +269 -0
- package/src/components/tree-select/index.tsx +400 -0
- package/src/components/tree-select/meta.md +78 -0
- package/src/components/tree-select/stories.tsx +234 -0
- package/src/components/typography/index.tsx +290 -0
- package/src/components/typography/meta.md +151 -0
- package/src/components/typography/stories.tsx +151 -0
- package/src/components/upload/index.tsx +858 -0
- package/src/components/upload/meta.md +122 -0
- package/src/components/upload/stories.tsx +261 -0
- package/src/components/watermark/index.tsx +152 -0
- package/src/components/watermark/meta.md +67 -0
- package/src/components/watermark/stories.tsx +59 -0
- package/src/hooks/use-mobile.ts +9 -11
- package/src/lib/color.ts +243 -0
- package/src/{utils/cn.ts → lib/utils.ts} +1 -1
- package/src/components/accordion/accordion.meta.md +0 -88
- package/src/components/accordion/accordion.stories.tsx +0 -72
- package/src/components/accordion/accordion.tsx +0 -154
- package/src/components/affix/affix.meta.md +0 -98
- package/src/components/affix/affix.stories.tsx +0 -134
- package/src/components/affix/affix.tsx +0 -167
- package/src/components/alert/alert.meta.md +0 -132
- package/src/components/alert/alert.stories.tsx +0 -138
- package/src/components/alert/alert.tsx +0 -179
- package/src/components/alert-dialog/alert-dialog.meta.md +0 -152
- package/src/components/alert-dialog/alert-dialog.stories.tsx +0 -223
- package/src/components/alert-dialog/alert-dialog.tsx +0 -183
- package/src/components/anchor/anchor.meta.md +0 -92
- package/src/components/anchor/anchor.stories.tsx +0 -74
- package/src/components/anchor/anchor.tsx +0 -130
- package/src/components/app/app.meta.md +0 -91
- package/src/components/app/app.stories.tsx +0 -64
- package/src/components/app/app.tsx +0 -58
- package/src/components/aspect-ratio/aspect-ratio.meta.md +0 -82
- package/src/components/aspect-ratio/aspect-ratio.stories.tsx +0 -59
- package/src/components/aspect-ratio/aspect-ratio.tsx +0 -22
- package/src/components/auto-complete/auto-complete.meta.md +0 -110
- package/src/components/auto-complete/auto-complete.stories.tsx +0 -136
- package/src/components/auto-complete/auto-complete.tsx +0 -253
- package/src/components/avatar/avatar.meta.md +0 -93
- package/src/components/avatar/avatar.stories.tsx +0 -98
- package/src/components/avatar/avatar.tsx +0 -127
- package/src/components/badge/badge.meta.md +0 -120
- package/src/components/badge/badge.stories.tsx +0 -153
- package/src/components/badge/badge.tsx +0 -204
- package/src/components/breadcrumb/breadcrumb.meta.md +0 -127
- package/src/components/breadcrumb/breadcrumb.stories.tsx +0 -207
- package/src/components/breadcrumb/breadcrumb.tsx +0 -136
- package/src/components/button/button.meta.md +0 -335
- package/src/components/button/button.stories.tsx +0 -743
- package/src/components/button/button.tsx +0 -466
- package/src/components/calendar/calendar.meta.md +0 -128
- package/src/components/calendar/calendar.stories.tsx +0 -68
- package/src/components/calendar/calendar.tsx +0 -172
- package/src/components/card/card.meta.md +0 -139
- package/src/components/card/card.stories.tsx +0 -151
- package/src/components/card/card.tsx +0 -306
- package/src/components/carousel/carousel.meta.md +0 -118
- package/src/components/carousel/carousel.stories.tsx +0 -89
- package/src/components/carousel/carousel.tsx +0 -224
- package/src/components/cascader/cascader.meta.md +0 -140
- package/src/components/cascader/cascader.stories.tsx +0 -120
- package/src/components/cascader/cascader.tsx +0 -548
- package/src/components/checkbox/checkbox.meta.md +0 -167
- package/src/components/checkbox/checkbox.stories.tsx +0 -288
- package/src/components/checkbox/checkbox.tsx +0 -195
- package/src/components/collapsible/collapsible.meta.md +0 -88
- package/src/components/collapsible/collapsible.stories.tsx +0 -43
- package/src/components/collapsible/collapsible.tsx +0 -105
- package/src/components/color-picker/color-picker.meta.md +0 -89
- package/src/components/color-picker/color-picker.stories.tsx +0 -159
- package/src/components/color-picker/color-picker.tsx +0 -171
- package/src/components/command/command.meta.md +0 -120
- package/src/components/command/command.stories.tsx +0 -59
- package/src/components/command/command.tsx +0 -158
- package/src/components/context-menu/context-menu.meta.md +0 -93
- package/src/components/context-menu/context-menu.stories.tsx +0 -54
- package/src/components/context-menu/context-menu.tsx +0 -204
- package/src/components/data-table/data-table.meta.md +0 -150
- package/src/components/data-table/data-table.stories.tsx +0 -132
- package/src/components/data-table/data-table.tsx +0 -185
- package/src/components/date-picker/date-picker.meta.md +0 -175
- package/src/components/date-picker/date-picker.stories.tsx +0 -108
- package/src/components/date-picker/date-picker.tsx +0 -1554
- package/src/components/descriptions/descriptions.meta.md +0 -83
- package/src/components/descriptions/descriptions.stories.tsx +0 -60
- package/src/components/descriptions/descriptions.tsx +0 -137
- package/src/components/dialog/dialog.meta.md +0 -168
- package/src/components/dialog/dialog.stories.tsx +0 -255
- package/src/components/dialog/dialog.tsx +0 -180
- package/src/components/dialog/imperative.tsx +0 -252
- package/src/components/drawer/drawer.meta.md +0 -95
- package/src/components/drawer/drawer.stories.tsx +0 -71
- package/src/components/drawer/drawer.tsx +0 -23
- package/src/components/dropdown-menu/dropdown-menu.meta.md +0 -171
- package/src/components/dropdown-menu/dropdown-menu.stories.tsx +0 -198
- package/src/components/dropdown-menu/dropdown-menu.tsx +0 -209
- package/src/components/ellipsis/ellipsis.meta.md +0 -87
- package/src/components/ellipsis/ellipsis.stories.tsx +0 -72
- package/src/components/ellipsis/ellipsis.tsx +0 -153
- package/src/components/empty/empty.meta.md +0 -86
- package/src/components/empty/empty.stories.tsx +0 -46
- package/src/components/empty/empty.tsx +0 -54
- package/src/components/field/field.meta.md +0 -154
- package/src/components/field/field.stories.tsx +0 -497
- package/src/components/field/field.tsx +0 -392
- package/src/components/filter-bar/filter-bar.meta.md +0 -92
- package/src/components/filter-bar/filter-bar.stories.tsx +0 -1086
- package/src/components/filter-bar/filter-bar.tsx +0 -568
- package/src/components/flex/flex.meta.md +0 -142
- package/src/components/flex/flex.stories.tsx +0 -199
- package/src/components/flex/flex.tsx +0 -145
- package/src/components/float-button/float-button.meta.md +0 -92
- package/src/components/float-button/float-button.stories.tsx +0 -80
- package/src/components/float-button/float-button.tsx +0 -143
- package/src/components/form/form.meta.md +0 -153
- package/src/components/form/form.stories.tsx +0 -472
- package/src/components/form/form.tsx +0 -260
- package/src/components/grid/grid.meta.md +0 -92
- package/src/components/grid/grid.stories.tsx +0 -101
- package/src/components/grid/grid.tsx +0 -130
- package/src/components/hover-card/hover-card.meta.md +0 -103
- package/src/components/hover-card/hover-card.stories.tsx +0 -97
- package/src/components/hover-card/hover-card.tsx +0 -67
- package/src/components/icon/DEVELOPMENT.md +0 -809
- package/src/components/icon/icon.meta.md +0 -170
- package/src/components/icon/icon.stories.tsx +0 -344
- package/src/components/icon/icon.tsx +0 -248
- package/src/components/image/image.meta.md +0 -99
- package/src/components/image/image.stories.tsx +0 -55
- package/src/components/image/image.tsx +0 -140
- package/src/components/input/input.meta.md +0 -115
- package/src/components/input/input.stories.tsx +0 -144
- package/src/components/input/input.tsx +0 -212
- package/src/components/input-group/input-group.meta.md +0 -124
- package/src/components/input-group/input-group.stories.tsx +0 -121
- package/src/components/input-group/input-group.tsx +0 -143
- package/src/components/input-number/input-number.meta.md +0 -148
- package/src/components/input-number/input-number.stories.tsx +0 -125
- package/src/components/input-number/input-number.tsx +0 -283
- package/src/components/input-otp/input-otp.meta.md +0 -106
- package/src/components/input-otp/input-otp.stories.tsx +0 -65
- package/src/components/input-otp/input-otp.tsx +0 -97
- package/src/components/item/item.meta.md +0 -121
- package/src/components/item/item.stories.tsx +0 -116
- package/src/components/item/item.tsx +0 -172
- package/src/components/kbd/kbd.meta.md +0 -94
- package/src/components/kbd/kbd.stories.tsx +0 -70
- package/src/components/kbd/kbd.tsx +0 -86
- package/src/components/label/label.meta.md +0 -99
- package/src/components/label/label.stories.tsx +0 -145
- package/src/components/label/label.tsx +0 -138
- package/src/components/masonry/masonry.meta.md +0 -90
- package/src/components/masonry/masonry.stories.tsx +0 -68
- package/src/components/masonry/masonry.tsx +0 -60
- package/src/components/mentions/mentions.meta.md +0 -119
- package/src/components/mentions/mentions.stories.tsx +0 -189
- package/src/components/mentions/mentions.tsx +0 -243
- package/src/components/menubar/menubar.meta.md +0 -118
- package/src/components/menubar/menubar.stories.tsx +0 -141
- package/src/components/menubar/menubar.tsx +0 -232
- package/src/components/native-select/native-select.meta.md +0 -93
- package/src/components/native-select/native-select.stories.tsx +0 -83
- package/src/components/native-select/native-select.tsx +0 -54
- package/src/components/navigation-menu/navigation-menu.meta.md +0 -118
- package/src/components/navigation-menu/navigation-menu.stories.tsx +0 -215
- package/src/components/navigation-menu/navigation-menu.tsx +0 -129
- package/src/components/notification/notification.meta.md +0 -133
- package/src/components/notification/notification.stories.tsx +0 -98
- package/src/components/notification/notification.tsx +0 -99
- package/src/components/page-header/DEVELOPMENT.md +0 -842
- package/src/components/page-header/page-header.meta.md +0 -210
- package/src/components/page-header/page-header.stories.tsx +0 -428
- package/src/components/page-header/page-header.tsx +0 -284
- package/src/components/page-shell/page-shell.meta.md +0 -116
- package/src/components/page-shell/page-shell.stories.tsx +0 -149
- package/src/components/page-shell/page-shell.tsx +0 -115
- package/src/components/pagination/pagination.meta.md +0 -230
- package/src/components/pagination/pagination.stories.tsx +0 -284
- package/src/components/pagination/pagination.tsx +0 -567
- package/src/components/popconfirm/popconfirm.meta.md +0 -114
- package/src/components/popconfirm/popconfirm.stories.tsx +0 -75
- package/src/components/popconfirm/popconfirm.tsx +0 -134
- package/src/components/popover/popover.meta.md +0 -154
- package/src/components/popover/popover.stories.tsx +0 -158
- package/src/components/popover/popover.tsx +0 -104
- package/src/components/progress/progress.meta.md +0 -118
- package/src/components/progress/progress.stories.tsx +0 -75
- package/src/components/progress/progress.tsx +0 -203
- package/src/components/radio-group/radio-group.meta.md +0 -175
- package/src/components/radio-group/radio-group.stories.tsx +0 -113
- package/src/components/radio-group/radio-group.tsx +0 -209
- package/src/components/rate/rate.meta.md +0 -118
- package/src/components/rate/rate.stories.tsx +0 -89
- package/src/components/rate/rate.tsx +0 -180
- package/src/components/resizable/resizable.meta.md +0 -95
- package/src/components/resizable/resizable.stories.tsx +0 -104
- package/src/components/resizable/resizable.tsx +0 -56
- package/src/components/result/result.meta.md +0 -95
- package/src/components/result/result.stories.tsx +0 -67
- package/src/components/result/result.tsx +0 -100
- package/src/components/scroll-area/scroll-area.meta.md +0 -85
- package/src/components/scroll-area/scroll-area.stories.tsx +0 -49
- package/src/components/scroll-area/scroll-area.tsx +0 -51
- package/src/components/segmented/segmented.meta.md +0 -106
- package/src/components/segmented/segmented.stories.tsx +0 -130
- package/src/components/segmented/segmented.tsx +0 -146
- package/src/components/select/select.meta.md +0 -255
- package/src/components/select/select.stories.tsx +0 -275
- package/src/components/select/select.tsx +0 -735
- package/src/components/separator/separator.meta.md +0 -75
- package/src/components/separator/separator.stories.tsx +0 -71
- package/src/components/separator/separator.tsx +0 -100
- package/src/components/sheet/sheet.meta.md +0 -113
- package/src/components/sheet/sheet.stories.tsx +0 -188
- package/src/components/sheet/sheet.tsx +0 -226
- package/src/components/sidebar/sidebar.meta.md +0 -151
- package/src/components/sidebar/sidebar.tsx +0 -853
- package/src/components/skeleton/skeleton.meta.md +0 -94
- package/src/components/skeleton/skeleton.stories.tsx +0 -79
- package/src/components/skeleton/skeleton.tsx +0 -144
- package/src/components/slider/slider.meta.md +0 -146
- package/src/components/slider/slider.stories.tsx +0 -121
- package/src/components/slider/slider.tsx +0 -227
- package/src/components/sonner/sonner.meta.md +0 -147
- package/src/components/sonner/sonner.stories.tsx +0 -164
- package/src/components/sonner/sonner.tsx +0 -169
- package/src/components/spinner/spinner.meta.md +0 -125
- package/src/components/spinner/spinner.stories.tsx +0 -123
- package/src/components/spinner/spinner.tsx +0 -166
- package/src/components/statistic/statistic.meta.md +0 -104
- package/src/components/statistic/statistic.stories.tsx +0 -67
- package/src/components/steps/steps.meta.md +0 -116
- package/src/components/steps/steps.stories.tsx +0 -115
- package/src/components/steps/steps.tsx +0 -173
- package/src/components/switch/switch.meta.md +0 -138
- package/src/components/switch/switch.stories.tsx +0 -75
- package/src/components/switch/switch.tsx +0 -169
- package/src/components/table/table.meta.md +0 -106
- package/src/components/table/table.stories.tsx +0 -80
- package/src/components/table/table.tsx +0 -124
- package/src/components/tabs/tabs.meta.md +0 -111
- package/src/components/tabs/tabs.stories.tsx +0 -156
- package/src/components/tabs/tabs.tsx +0 -190
- package/src/components/tag/tag.meta.md +0 -159
- package/src/components/tag/tag.stories.tsx +0 -250
- package/src/components/tag/tag.tsx +0 -386
- package/src/components/textarea/textarea.meta.md +0 -99
- package/src/components/textarea/textarea.stories.tsx +0 -89
- package/src/components/textarea/textarea.tsx +0 -137
- package/src/components/time-picker/time-picker.meta.md +0 -175
- package/src/components/time-picker/time-picker.stories.tsx +0 -129
- package/src/components/time-picker/time-picker.tsx +0 -946
- package/src/components/timeline/timeline.meta.md +0 -110
- package/src/components/timeline/timeline.stories.tsx +0 -134
- package/src/components/timeline/timeline.tsx +0 -168
- package/src/components/toggle/toggle.meta.md +0 -89
- package/src/components/toggle/toggle.stories.tsx +0 -66
- package/src/components/toggle/toggle.tsx +0 -54
- package/src/components/toggle-group/toggle-group.meta.md +0 -91
- package/src/components/toggle-group/toggle-group.stories.tsx +0 -83
- package/src/components/toggle-group/toggle-group.tsx +0 -78
- package/src/components/tooltip/tooltip.meta.md +0 -149
- package/src/components/tooltip/tooltip.stories.tsx +0 -108
- package/src/components/tooltip/tooltip.tsx +0 -153
- package/src/components/tour/tour.meta.md +0 -121
- package/src/components/tour/tour.stories.tsx +0 -66
- package/src/components/tour/tour.tsx +0 -242
- package/src/components/transfer/transfer.meta.md +0 -95
- package/src/components/transfer/transfer.stories.tsx +0 -64
- package/src/components/transfer/transfer.tsx +0 -258
- package/src/components/tree/tree.meta.md +0 -169
- package/src/components/tree/tree.stories.tsx +0 -128
- package/src/components/tree/tree.tsx +0 -368
- package/src/components/tree-select/tree-select.meta.md +0 -151
- package/src/components/tree-select/tree-select.stories.tsx +0 -80
- package/src/components/tree-select/tree-select.tsx +0 -206
- package/src/components/typography/typography.meta.md +0 -149
- package/src/components/typography/typography.stories.tsx +0 -116
- package/src/components/typography/typography.tsx +0 -260
- package/src/components/upload/upload.meta.md +0 -156
- package/src/components/upload/upload.stories.tsx +0 -135
- package/src/components/upload/upload.tsx +0 -398
- package/src/components/watermark/watermark.meta.md +0 -100
- package/src/components/watermark/watermark.stories.tsx +0 -170
- package/src/components/watermark/watermark.tsx +0 -166
- package/src/hooks/use-breakpoint.ts +0 -117
- package/src/hooks/use-debounce-callback.ts +0 -52
- package/src/stories/theme-tokens.stories.tsx +0 -747
- package/src/utils/trigger-input.ts +0 -57
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ChevronDown, X } from 'lucide-react';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/utils/cn';
|
|
5
|
-
import { Button } from '@/components/button/button';
|
|
6
|
-
import {
|
|
7
|
-
Popover,
|
|
8
|
-
PopoverContent,
|
|
9
|
-
PopoverTrigger,
|
|
10
|
-
} from '@/components/popover/popover';
|
|
11
|
-
import { Tree, type TreeNode } from '@/components/tree/tree';
|
|
12
|
-
|
|
13
|
-
export interface TreeSelectProps {
|
|
14
|
-
/** 树形数据(antd `treeData` 并集)。 */
|
|
15
|
-
data: TreeNode[];
|
|
16
|
-
/**
|
|
17
|
-
* 多选模式 — 启用后下拉内的 Tree 变为 checkable;value 是 key 数组。
|
|
18
|
-
* @default false
|
|
19
|
-
*/
|
|
20
|
-
multiple?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* 受控 value:
|
|
23
|
-
* - `multiple=false`:`string`(单 key)/ `undefined`(未选)
|
|
24
|
-
* - `multiple=true`:`string[]`
|
|
25
|
-
*/
|
|
26
|
-
value?: string | string[];
|
|
27
|
-
/** uncontrolled 初值。 */
|
|
28
|
-
defaultValue?: string | string[];
|
|
29
|
-
/** value 变化回调。 */
|
|
30
|
-
onChange?: (value: string | string[]) => void;
|
|
31
|
-
/**
|
|
32
|
-
* 默认展开全部节点(antd `treeDefaultExpandAll` 并集)。
|
|
33
|
-
* @default false
|
|
34
|
-
*/
|
|
35
|
-
defaultExpandAll?: boolean;
|
|
36
|
-
/** 占位文本。 @default "请选择" */
|
|
37
|
-
placeholder?: string;
|
|
38
|
-
/** 整体禁用。 */
|
|
39
|
-
disabled?: boolean;
|
|
40
|
-
/** 触发器 className。 */
|
|
41
|
-
className?: string;
|
|
42
|
-
/**
|
|
43
|
-
* 触发器尺寸。
|
|
44
|
-
* @default "default"
|
|
45
|
-
*/
|
|
46
|
-
size?: 'sm' | 'md' | 'default' | 'lg';
|
|
47
|
-
/**
|
|
48
|
-
* 显示清除按钮(antd `allowClear` 并集) — 触发器有值时右侧出现 ✕,点击清空。
|
|
49
|
-
* @default false
|
|
50
|
-
*/
|
|
51
|
-
allowClear?: boolean;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function flattenLabelMap(nodes: TreeNode[]): Map<string, React.ReactNode> {
|
|
55
|
-
const map = new Map<string, React.ReactNode>();
|
|
56
|
-
const walk = (n: TreeNode) => {
|
|
57
|
-
map.set(n.key, n.title);
|
|
58
|
-
n.children?.forEach(walk);
|
|
59
|
-
};
|
|
60
|
-
nodes.forEach(walk);
|
|
61
|
-
return map;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* 树形下拉选择 — antd 独有补足。**等价 antd `TreeSelect`**。
|
|
66
|
-
* 把 `Tree` 嵌入 Popover,提供单选(selectable)或多选(checkable)两种模式 — 组织架构 / 分类树形选择常用。
|
|
67
|
-
*/
|
|
68
|
-
const TreeSelect = React.forwardRef<HTMLButtonElement, TreeSelectProps>(
|
|
69
|
-
(
|
|
70
|
-
{
|
|
71
|
-
data,
|
|
72
|
-
multiple = false,
|
|
73
|
-
value,
|
|
74
|
-
defaultValue,
|
|
75
|
-
onChange,
|
|
76
|
-
defaultExpandAll = false,
|
|
77
|
-
placeholder = '请选择',
|
|
78
|
-
disabled = false,
|
|
79
|
-
className,
|
|
80
|
-
size = 'md',
|
|
81
|
-
allowClear = false,
|
|
82
|
-
},
|
|
83
|
-
ref,
|
|
84
|
-
) => {
|
|
85
|
-
const isControlled = value !== undefined;
|
|
86
|
-
const [internal, setInternal] = React.useState<string | string[]>(
|
|
87
|
-
defaultValue ?? (multiple ? [] : ''),
|
|
88
|
-
);
|
|
89
|
-
const current = isControlled ? value! : internal;
|
|
90
|
-
|
|
91
|
-
const [open, setOpen] = React.useState(false);
|
|
92
|
-
|
|
93
|
-
const labelMap = React.useMemo(() => flattenLabelMap(data), [data]);
|
|
94
|
-
|
|
95
|
-
const display = React.useMemo(() => {
|
|
96
|
-
if (multiple) {
|
|
97
|
-
const arr = (current as string[]) ?? [];
|
|
98
|
-
if (arr.length === 0) return '';
|
|
99
|
-
if (arr.length <= 3) return arr.map((k) => labelMap.get(k) ?? k);
|
|
100
|
-
return `已选 ${arr.length} 项`;
|
|
101
|
-
}
|
|
102
|
-
const k = current as string;
|
|
103
|
-
return k ? labelMap.get(k) : '';
|
|
104
|
-
}, [current, labelMap, multiple]);
|
|
105
|
-
|
|
106
|
-
const renderDisplay = () => {
|
|
107
|
-
if (!display) return placeholder;
|
|
108
|
-
if (Array.isArray(display)) {
|
|
109
|
-
return (
|
|
110
|
-
<span className="flex flex-wrap gap-1">
|
|
111
|
-
{display.map((d, i) => (
|
|
112
|
-
<span
|
|
113
|
-
key={i}
|
|
114
|
-
className="inline-flex items-center rounded-md bg-muted px-1.5 py-0.5 text-xs text-muted-foreground"
|
|
115
|
-
>
|
|
116
|
-
{d}
|
|
117
|
-
</span>
|
|
118
|
-
))}
|
|
119
|
-
</span>
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
return <span className="truncate">{display}</span>;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const hasValue = multiple
|
|
126
|
-
? Array.isArray(current) && current.length > 0
|
|
127
|
-
: !!current;
|
|
128
|
-
|
|
129
|
-
const handleClear = (e: React.MouseEvent) => {
|
|
130
|
-
e.preventDefault();
|
|
131
|
-
e.stopPropagation();
|
|
132
|
-
const next = multiple ? [] : '';
|
|
133
|
-
if (!isControlled) setInternal(next);
|
|
134
|
-
onChange?.(next);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
return (
|
|
138
|
-
<Popover open={open} onOpenChange={setOpen}>
|
|
139
|
-
<PopoverTrigger asChild>
|
|
140
|
-
<Button
|
|
141
|
-
ref={ref}
|
|
142
|
-
type="button"
|
|
143
|
-
variant="outline"
|
|
144
|
-
size={size}
|
|
145
|
-
disabled={disabled}
|
|
146
|
-
className={cn(
|
|
147
|
-
'group/treeselect min-w-panel-sm justify-between font-normal',
|
|
148
|
-
!display && 'text-muted-foreground',
|
|
149
|
-
className,
|
|
150
|
-
)}
|
|
151
|
-
>
|
|
152
|
-
<span className="min-w-0 flex-1 text-left">{renderDisplay()}</span>
|
|
153
|
-
{allowClear && hasValue && !disabled ? (
|
|
154
|
-
<span
|
|
155
|
-
role="button"
|
|
156
|
-
tabIndex={-1}
|
|
157
|
-
aria-label="清除"
|
|
158
|
-
onClick={handleClear}
|
|
159
|
-
onMouseDown={(e) => e.stopPropagation()}
|
|
160
|
-
className="ml-2 hidden shrink-0 rounded-sm text-muted-foreground transition-colors hover:text-foreground group-hover/treeselect:inline-flex"
|
|
161
|
-
>
|
|
162
|
-
<X className="size-3.5" />
|
|
163
|
-
</span>
|
|
164
|
-
) : null}
|
|
165
|
-
<ChevronDown
|
|
166
|
-
className={cn(
|
|
167
|
-
'ml-2 size-4 shrink-0 opacity-50',
|
|
168
|
-
allowClear && hasValue && 'group-hover/treeselect:hidden',
|
|
169
|
-
)}
|
|
170
|
-
/>
|
|
171
|
-
</Button>
|
|
172
|
-
</PopoverTrigger>
|
|
173
|
-
<PopoverContent className="w-72 p-1" align="start">
|
|
174
|
-
{multiple ? (
|
|
175
|
-
<Tree
|
|
176
|
-
data={data}
|
|
177
|
-
checkable
|
|
178
|
-
selectable={false}
|
|
179
|
-
defaultExpandAll={defaultExpandAll}
|
|
180
|
-
checkedKeys={current as string[]}
|
|
181
|
-
onCheck={(next) => {
|
|
182
|
-
if (!isControlled) setInternal(next);
|
|
183
|
-
onChange?.(next);
|
|
184
|
-
}}
|
|
185
|
-
/>
|
|
186
|
-
) : (
|
|
187
|
-
<Tree
|
|
188
|
-
data={data}
|
|
189
|
-
defaultExpandAll={defaultExpandAll}
|
|
190
|
-
selectedKeys={current ? [current as string] : []}
|
|
191
|
-
onSelect={(next) => {
|
|
192
|
-
const v = next[0] ?? '';
|
|
193
|
-
if (!isControlled) setInternal(v);
|
|
194
|
-
onChange?.(v);
|
|
195
|
-
setOpen(false);
|
|
196
|
-
}}
|
|
197
|
-
/>
|
|
198
|
-
)}
|
|
199
|
-
</PopoverContent>
|
|
200
|
-
</Popover>
|
|
201
|
-
);
|
|
202
|
-
},
|
|
203
|
-
);
|
|
204
|
-
TreeSelect.displayName = 'TreeSelect';
|
|
205
|
-
|
|
206
|
-
export { TreeSelect };
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: typography
|
|
3
|
-
name: Typography
|
|
4
|
-
displayName: 排版
|
|
5
|
-
type: component
|
|
6
|
-
category: general
|
|
7
|
-
since: 0.1.0
|
|
8
|
-
package: '@teamix-evo/ui'
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Typography 排版
|
|
12
|
-
|
|
13
|
-
排版组件 — `Prose`(富文本容器)+ shadcn 风格 `Title / Paragraph / Text / Link` + antd `Text` 的 `strong / delete / disabled / code / ellipsis / copyable` 并集。语义色采用 [ADR 0021](../../../../../docs/adr/0021-semantic-color-api-unification.md) 统一 `color` API。
|
|
14
|
-
|
|
15
|
-
> Prose 不依赖 `@tailwindcss/typography` 插件,样式手写并对齐 OpenTrek tokens。
|
|
16
|
-
|
|
17
|
-
## When to use
|
|
18
|
-
|
|
19
|
-
- **Prose**:Markdown / CMS 富文本渲染容器(自动套排版样式)
|
|
20
|
-
- **Title**:页面 / 区块标题(`level={1..6}` 自动映射 `<h1>~<h6>`,对齐 antd `Typography.Title.level`)
|
|
21
|
-
- **Paragraph**:正文段落(行高 / 字号 / 颜色统一)
|
|
22
|
-
- **Text**:行内文本带语义色(`color`) / 强调 / 复制
|
|
23
|
-
- **Link**:语义化链接(`color` + 默认下划线 hover)
|
|
24
|
-
|
|
25
|
-
## When NOT to use
|
|
26
|
-
|
|
27
|
-
- 富文本编辑(可编辑) → 用 Tiptap / Lexical 等编辑器
|
|
28
|
-
- 单一颜色文本 → 直接 `<span className="text-...">`,无需包装
|
|
29
|
-
- 多行 ellipsis(2 行 / 3 行) → 自行 `line-clamp-N`(本组件 ellipsis 仅单行)
|
|
30
|
-
|
|
31
|
-
## Props
|
|
32
|
-
|
|
33
|
-
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`typography.tsx`](./typography.tsx) 的 `TextProps` interface JSDoc。
|
|
34
|
-
|
|
35
|
-
<!-- auto:props:begin -->
|
|
36
|
-
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
37
|
-
| --- | --- | --- | --- | --- |
|
|
38
|
-
| `color` | `TextColor` | `"default"` | – | 语义色 — 6 档枚举,字面与 OpenTrek tokens 对齐(见 [ADR 0021](../../../../../docs/adr/0021-semantic-color-api-unification.md))。 antd `type` 迁移:`secondary`→`muted`、`danger`→`destructive`。 |
|
|
39
|
-
| `delete` | `boolean` | `false` | – | 删除线。 |
|
|
40
|
-
| `disabled` | `boolean` | `false` | – | 不可用(灰色 + 不可选)。 |
|
|
41
|
-
| `strong` | `boolean` | `false` | – | 加粗。 |
|
|
42
|
-
| `code` | `boolean` | `false` | – | 行内代码样式(`code`)。 |
|
|
43
|
-
| `ellipsis` | `boolean` | `false` | – | 单行省略(antd `ellipsis` 简化版 — 只支持 boolean,行数 / suffix 留 v0.x)。 |
|
|
44
|
-
| `copyable` | `boolean \| { text: string; tooltips?: [string, string] }` | `false` | – | 可复制(antd `copyable` 并集)— 末尾追加复制图标按钮。 传对象时可指定要复制的文本(默认是 children 的纯文本);传 `true` 用 children。 |
|
|
45
|
-
<!-- auto:props:end -->
|
|
46
|
-
|
|
47
|
-
## 依赖
|
|
48
|
-
|
|
49
|
-
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
|
|
50
|
-
|
|
51
|
-
<!-- auto:deps:begin -->
|
|
52
|
-
### 同库依赖
|
|
53
|
-
|
|
54
|
-
> `teamix-evo ui add typography` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
55
|
-
|
|
56
|
-
| Entry | 类型 | 描述 |
|
|
57
|
-
| --- | --- | --- |
|
|
58
|
-
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
59
|
-
|
|
60
|
-
### npm 依赖
|
|
61
|
-
|
|
62
|
-
> 业务侧需要先 `pnpm add` / `npm install` 这些包。CLI 在 `ui add` 完成后会列出此提示。
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
pnpm add lucide-react@^0.460.0
|
|
66
|
-
```
|
|
67
|
-
<!-- auto:deps:end -->
|
|
68
|
-
|
|
69
|
-
## AI 生成纪律
|
|
70
|
-
|
|
71
|
-
- **`Title level` 决定标签**:不要用 `<h2>` 配 `level={1}`,语义会冲突
|
|
72
|
-
- **`Text color` 优先于 className 颜色**:语义色让暗色模式自动适配
|
|
73
|
-
- **`copyable` 仅当 children 是 string**:富节点请显式传 `copyable={{ text: '...' }}`
|
|
74
|
-
- **`ellipsis` 单行**:多行省略请直接 `className="line-clamp-2"`
|
|
75
|
-
- **Prose 内部不要嵌套 Prose**:嵌套排版会双倍间距
|
|
76
|
-
|
|
77
|
-
## Typography 形态 — 旧库 API → 新库映射
|
|
78
|
-
|
|
79
|
-
旧库(Teamix 1.0 / `@alifd/next.Typography` + `Typography.Text` / `Typography.Paragraph` / `Typography.H1`~`H6`)与新库(`Typography` / `Title` / `Paragraph` / `Text` / `Link` / `Prose`)逐项对应。
|
|
80
|
-
|
|
81
|
-
### 组件拆合
|
|
82
|
-
|
|
83
|
-
| 旧库 | 新库 | 备注 |
|
|
84
|
-
| --- | --- | --- |
|
|
85
|
-
| `Typography` | `Prose` | 富文本容器,渲染 Markdown / CMS 输出 |
|
|
86
|
-
| `Typography.H1` ~ `Typography.H6` | `<Title level={1..6}>` | level 决定字号 + 标签;新增 level=6 对齐 antd |
|
|
87
|
-
| `Typography.Paragraph` | `Paragraph` | 同义 |
|
|
88
|
-
| `Typography.Text` | `Text` | 行内文本 |
|
|
89
|
-
| — | `Link` | 新增 — 语义化 `<a>` 元素 |
|
|
90
|
-
|
|
91
|
-
### Props / 值映射
|
|
92
|
-
|
|
93
|
-
| 旧库 | 新库 | 备注 |
|
|
94
|
-
| --- | --- | --- |
|
|
95
|
-
| `<Text type="secondary">` | `<Text color="muted">` | ADR 0021 语义色重命名 |
|
|
96
|
-
| `<Text type="danger">` | `<Text color="destructive">` | ADR 0021 — 不收 antd `error` / `danger` 别名 |
|
|
97
|
-
| `<Text strong>` | `<Text strong>` | 行为一致 |
|
|
98
|
-
| `<Text delete>` | `<Text delete>` | 行为一致 |
|
|
99
|
-
| `<Text code>` | `<Text code>` | 行为一致 |
|
|
100
|
-
| `<Text disabled>` | `<Text disabled>` | 行为一致 |
|
|
101
|
-
| `<Text ellipsis>` | `<Text ellipsis>` | P0 已实现 — 单行 truncate;多行用 `className="line-clamp-N"` |
|
|
102
|
-
| `<Text copyable>` | `<Text copyable>` | P0 已实现 — 默认复制 children;传对象指定 `text` |
|
|
103
|
-
| `<Text copyable={{ text }}>` | `<Text copyable={{ text }}>` | 对象签名一致 |
|
|
104
|
-
| `size="body1/body2/caption/overline"` | className `text-sm/text-xs/...` | shadcn 字号通过 Tailwind 直控,不抽 prop |
|
|
105
|
-
| `mark` 黄色高亮 | 直接用 `<mark>` 标签 | HTML 原生 |
|
|
106
|
-
| `underline` | `className="underline"` | Tailwind utility |
|
|
107
|
-
| `editable` 行内编辑 | 不修复 — 用 Tiptap / Lexical / Input + state | 复杂度高,业务低频 |
|
|
108
|
-
|
|
109
|
-
### 不修复清单
|
|
110
|
-
|
|
111
|
-
| 旧库能力 | 理由 |
|
|
112
|
-
| --- | --- |
|
|
113
|
-
| `mark` / `underline` / `delete` / `code` 全 prop | 直接用 HTML 原生 / Tailwind utility 更简洁,只保留 `delete` / `code` 的便捷 prop |
|
|
114
|
-
| `editable` 行内编辑 | 业务低频 + 复杂度高,推荐用 Tiptap 等编辑器 |
|
|
115
|
-
| `component` 自定义根标签 | shadcn 走 `asChild` (Slot) 替代 — 需要时用 `<Title asChild><span>...</span></Title>` |
|
|
116
|
-
|
|
117
|
-
## Examples
|
|
118
|
-
|
|
119
|
-
```tsx
|
|
120
|
-
import { Prose, Title, Paragraph, Text, Link } from '@/components/ui/typography';
|
|
121
|
-
|
|
122
|
-
// 标题层级
|
|
123
|
-
<Title level={1}>页面标题</Title>
|
|
124
|
-
<Title level={2}>章节标题</Title>
|
|
125
|
-
|
|
126
|
-
// 段落
|
|
127
|
-
<Paragraph>正文段落,统一字号 / 行高 / 颜色。</Paragraph>
|
|
128
|
-
|
|
129
|
-
// 行内文本
|
|
130
|
-
<Text color="success" strong>成功</Text>
|
|
131
|
-
<Text color="destructive" delete>已废弃</Text>
|
|
132
|
-
<Text disabled>不可用</Text>
|
|
133
|
-
<Text code>const x = 1</Text>
|
|
134
|
-
<Text ellipsis>这是一段非常长的文字...被截断</Text>
|
|
135
|
-
<Text copyable>可复制的文本</Text>
|
|
136
|
-
<Text copyable={{ text: 'lyca@teamix.dev' }}>邮箱(复制不同的内容)</Text>
|
|
137
|
-
|
|
138
|
-
// 链接
|
|
139
|
-
<Link href="/docs">文档</Link>
|
|
140
|
-
<Link href="/danger" color="destructive">危险链接</Link>
|
|
141
|
-
|
|
142
|
-
// Prose 容器(渲染 Markdown 等富文本)
|
|
143
|
-
<Prose>
|
|
144
|
-
<h1>Markdown 标题</h1>
|
|
145
|
-
<p>段落...</p>
|
|
146
|
-
<ul><li>列表项</li></ul>
|
|
147
|
-
<pre><code>console.log('hi')</code></pre>
|
|
148
|
-
</Prose>
|
|
149
|
-
```
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Prose, Title, Paragraph, Text, Link } from './typography';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Text> = {
|
|
5
|
-
title: '通用 · General/Typography',
|
|
6
|
-
component: Text,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component:
|
|
12
|
-
'排版组件 — Prose 富文本容器 + Title / Paragraph / Text / Link,合并 antd 的 `type` / `strong` / `delete` / `disabled` / `code` / `ellipsis` / `copyable` 能力。语义色采用 [ADR 0021](../../../../../docs/adr/0021-semantic-color-api-unification.md) 统一 `color` API(antd `type` 的 secondary/success/warning/danger 合并为 `color` 的 muted/success/warning/destructive)。',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof Text>;
|
|
20
|
-
|
|
21
|
-
export const Titles: Story = {
|
|
22
|
-
parameters: { controls: { disable: true } },
|
|
23
|
-
render: () => (
|
|
24
|
-
<div className="flex flex-col gap-2">
|
|
25
|
-
{([1, 2, 3, 4, 5] as const).map((l) => (
|
|
26
|
-
<Title key={l} level={l}>
|
|
27
|
-
Level {l} 标题
|
|
28
|
-
</Title>
|
|
29
|
-
))}
|
|
30
|
-
</div>
|
|
31
|
-
),
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const TextColors: Story = {
|
|
35
|
-
parameters: { controls: { disable: true } },
|
|
36
|
-
render: () => (
|
|
37
|
-
<div className="flex flex-col gap-2 text-sm">
|
|
38
|
-
<Text>默认</Text>
|
|
39
|
-
<Text color="muted">次要</Text>
|
|
40
|
-
<Text color="primary">信息 / 主颜色</Text>
|
|
41
|
-
<Text color="success">成功</Text>
|
|
42
|
-
<Text color="warning">警告</Text>
|
|
43
|
-
<Text color="destructive">危险</Text>
|
|
44
|
-
<Text strong>加粗</Text>
|
|
45
|
-
<Text delete>已废弃</Text>
|
|
46
|
-
<Text disabled>不可用</Text>
|
|
47
|
-
<Text code>const x = 1</Text>
|
|
48
|
-
</div>
|
|
49
|
-
),
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export const Copyable: Story = {
|
|
53
|
-
parameters: { controls: { disable: true } },
|
|
54
|
-
render: () => (
|
|
55
|
-
<div className="flex flex-col gap-2 text-sm">
|
|
56
|
-
<Text copyable>这段文字可复制</Text>
|
|
57
|
-
<Text copyable={{ text: 'lyca@teamix.dev' }}>邮箱(复制实际地址)</Text>
|
|
58
|
-
</div>
|
|
59
|
-
),
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const Ellipsis: Story = {
|
|
63
|
-
parameters: { controls: { disable: true } },
|
|
64
|
-
render: () => (
|
|
65
|
-
<div className="w-48">
|
|
66
|
-
<Text ellipsis>
|
|
67
|
-
这是一段非常非常非常长的文字内容,在窄容器内会被自动截断成单行。
|
|
68
|
-
</Text>
|
|
69
|
-
</div>
|
|
70
|
-
),
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const Links: Story = {
|
|
74
|
-
parameters: { controls: { disable: true } },
|
|
75
|
-
render: () => (
|
|
76
|
-
<div className="flex flex-col gap-2 text-sm">
|
|
77
|
-
<Link href="#docs" onClick={(e) => e.preventDefault()}>
|
|
78
|
-
文档
|
|
79
|
-
</Link>
|
|
80
|
-
<Link
|
|
81
|
-
href="#delete"
|
|
82
|
-
color="destructive"
|
|
83
|
-
onClick={(e) => e.preventDefault()}
|
|
84
|
-
>
|
|
85
|
-
危险操作链接
|
|
86
|
-
</Link>
|
|
87
|
-
</div>
|
|
88
|
-
),
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const ProseDemo: Story = {
|
|
92
|
-
parameters: { controls: { disable: true } },
|
|
93
|
-
render: () => (
|
|
94
|
-
<Prose>
|
|
95
|
-
<h1>Prose 容器</h1>
|
|
96
|
-
<p>
|
|
97
|
-
Prose 给原始 HTML(Markdown 渲染产物 / CMS 富文本)套上一致排版样式 —
|
|
98
|
-
标题字号、段落行高、列表样式、代码块、引用。
|
|
99
|
-
</p>
|
|
100
|
-
<h2>子标题</h2>
|
|
101
|
-
<p>
|
|
102
|
-
访问 <a href="#">链接</a> 查看更多。<strong>强调</strong> <em>斜体</em>{' '}
|
|
103
|
-
<code>inline-code</code>。
|
|
104
|
-
</p>
|
|
105
|
-
<ul>
|
|
106
|
-
<li>列表项 1</li>
|
|
107
|
-
<li>列表项 2</li>
|
|
108
|
-
<li>列表项 3</li>
|
|
109
|
-
</ul>
|
|
110
|
-
<blockquote>这是一段引用文字。</blockquote>
|
|
111
|
-
<pre>
|
|
112
|
-
<code>{`function hello() {\n return 'world';\n}`}</code>
|
|
113
|
-
</pre>
|
|
114
|
-
</Prose>
|
|
115
|
-
),
|
|
116
|
-
};
|