@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,67 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { ShoppingCart, Users } from 'lucide-react';
|
|
3
|
-
import { Statistic } from './statistic';
|
|
4
|
-
import { Card, CardContent } from '@/components/card/card';
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof Statistic> = {
|
|
7
|
-
title: '数据展示 · Data Display/Statistic',
|
|
8
|
-
component: Statistic,
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
parameters: {
|
|
11
|
-
docs: {
|
|
12
|
-
description: {
|
|
13
|
-
component:
|
|
14
|
-
'数字展示 — 仪表板核心指标。大字号 + 千分位 + 精度 + 前后缀 + 趋势(上 / 下,自动配色)。等价 antd Statistic。',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default meta;
|
|
21
|
-
type Story = StoryObj<typeof Statistic>;
|
|
22
|
-
|
|
23
|
-
export const Basic: Story = {
|
|
24
|
-
args: { title: '今日 GMV', value: 8493521, prefix: '¥' },
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const Trends: Story = {
|
|
28
|
-
parameters: { controls: { disable: true } },
|
|
29
|
-
render: () => (
|
|
30
|
-
<div className="flex flex-wrap gap-8">
|
|
31
|
-
<Statistic title="活跃用户" value={1234} trend="up" trendValue="+12.4%" />
|
|
32
|
-
<Statistic
|
|
33
|
-
title="错误率"
|
|
34
|
-
value={0.83}
|
|
35
|
-
precision={2}
|
|
36
|
-
suffix="%"
|
|
37
|
-
trend="down"
|
|
38
|
-
trendValue="-0.5%"
|
|
39
|
-
/>
|
|
40
|
-
<Statistic title="待处理" value={42} />
|
|
41
|
-
</div>
|
|
42
|
-
),
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const InCards: Story = {
|
|
46
|
-
parameters: { controls: { disable: true } },
|
|
47
|
-
render: () => (
|
|
48
|
-
<div className="grid grid-cols-2 gap-4">
|
|
49
|
-
<Card>
|
|
50
|
-
<CardContent className="pt-6">
|
|
51
|
-
<Statistic
|
|
52
|
-
title="本月订单"
|
|
53
|
-
value={2847}
|
|
54
|
-
prefix={<ShoppingCart />}
|
|
55
|
-
trend="up"
|
|
56
|
-
trendValue="+18%"
|
|
57
|
-
/>
|
|
58
|
-
</CardContent>
|
|
59
|
-
</Card>
|
|
60
|
-
<Card>
|
|
61
|
-
<CardContent className="pt-6">
|
|
62
|
-
<Statistic title="活跃用户" value={12480} prefix={<Users />} />
|
|
63
|
-
</CardContent>
|
|
64
|
-
</Card>
|
|
65
|
-
</div>
|
|
66
|
-
),
|
|
67
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: steps
|
|
3
|
-
name: Steps
|
|
4
|
-
displayName: 步骤条
|
|
5
|
-
type: component
|
|
6
|
-
category: navigation
|
|
7
|
-
since: 0.1.0
|
|
8
|
-
package: '@teamix-evo/ui'
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Steps 步骤条
|
|
12
|
-
|
|
13
|
-
步骤条 — antd 独有补足。引导用户完成多步流程(注册 / 下单 / 部署),清晰展示当前 / 已完成 / 待完成 / 错误状态。
|
|
14
|
-
|
|
15
|
-
## When to use
|
|
16
|
-
|
|
17
|
-
- 多步表单(注册 / 入驻 / 配置)
|
|
18
|
-
- 流程进度可视化(订单状态 / CI/CD)
|
|
19
|
-
- 长任务的阶段反馈
|
|
20
|
-
|
|
21
|
-
## When NOT to use
|
|
22
|
-
|
|
23
|
-
- 平级 tab → `Tabs`
|
|
24
|
-
- 简单进度 → `Progress` / `ProgressCircle`
|
|
25
|
-
- 历史时间线 → 自定义 timeline(暂无组件)
|
|
26
|
-
|
|
27
|
-
## Props
|
|
28
|
-
|
|
29
|
-
<!-- auto:props:begin -->
|
|
30
|
-
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
31
|
-
| --- | --- | --- | --- | --- |
|
|
32
|
-
| `items` | `StepItem[]` | – | ✓ | 步骤列表。 |
|
|
33
|
-
| `current` | `number` | `0` | – | 当前步骤(0-based)。`current` 之前的为 finish,`current` 为 process,之后为 wait。 |
|
|
34
|
-
| `status` | `'process' \| 'error'` | `"process"` | – | 当前步骤的状态(只影响 `current` 那一步;`process` 默认,`error` 标红)。 |
|
|
35
|
-
| `direction` | `'horizontal' \| 'vertical'` | `"horizontal"` | – | 排列方向。 |
|
|
36
|
-
| `size` | `'sm' \| 'md' \| 'default'` | `"default"` | – | 尺寸。 |
|
|
37
|
-
<!-- auto:props:end -->
|
|
38
|
-
|
|
39
|
-
## 依赖
|
|
40
|
-
|
|
41
|
-
<!-- auto:deps:begin -->
|
|
42
|
-
### 同库依赖
|
|
43
|
-
|
|
44
|
-
> `teamix-evo ui add steps` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
45
|
-
|
|
46
|
-
| Entry | 类型 | 描述 |
|
|
47
|
-
| --- | --- | --- |
|
|
48
|
-
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
49
|
-
|
|
50
|
-
### npm 依赖
|
|
51
|
-
|
|
52
|
-
> 业务侧需要先 `pnpm add` / `npm install` 这些包。CLI 在 `ui add` 完成后会列出此提示。
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
pnpm add lucide-react@^0.460.0
|
|
56
|
-
```
|
|
57
|
-
<!-- auto:deps:end -->
|
|
58
|
-
|
|
59
|
-
> `StepItem` 类型:`{ title; description?; status?: 'wait' | 'process' | 'finish' | 'error' | 'disabled'; icon? }`。5 状态视觉区分:
|
|
60
|
-
>
|
|
61
|
-
> | 状态 | 圆点 | 连线 | 标题 | 交互 |
|
|
62
|
-
> | --- | --- | --- | --- | --- |
|
|
63
|
-
> | `wait` | 描边 + muted | border | muted | 可点击 |
|
|
64
|
-
> | `process` | primary 填充 + shadow | border | foreground + medium | 可点击 |
|
|
65
|
-
> | `finish` | primary 填充 + Check | primary | foreground | 可点击 |
|
|
66
|
-
> | `error` | destructive 填充 + X | border | destructive + medium | 可点击 |
|
|
67
|
-
> | `disabled` | muted + opacity-60 | border + opacity-60 | muted + opacity-60 | `pointer-events: none` + `aria-disabled` |
|
|
68
|
-
|
|
69
|
-
## AI 生成纪律
|
|
70
|
-
|
|
71
|
-
- **`current` 0-based**:第一步是 0,与数组索引一致
|
|
72
|
-
- **`status="error"` 仅当前步**:把整体状态置错;**不要**对历史已完成步标 error
|
|
73
|
-
- **单项 `disabled`**:用 `StepItem.status: 'disabled'` 表示该步不可点击(需升级 / 该路径不适用),视觉 muted 变深 + 60% 透明度 + 提示 `aria-disabled`
|
|
74
|
-
- **`description` 简短**:不超过 1 行,长说明放主区
|
|
75
|
-
- **vertical 用于侧栏**:横向用于宽屏 / 顶部
|
|
76
|
-
- **不要堆叠超过 6 步**:认知超载;> 6 步改用 Wizard 模式 + 折叠
|
|
77
|
-
|
|
78
|
-
## Examples
|
|
79
|
-
|
|
80
|
-
```tsx
|
|
81
|
-
import { Steps } from '@/components/ui/steps';
|
|
82
|
-
|
|
83
|
-
// 横向
|
|
84
|
-
<Steps
|
|
85
|
-
current={1}
|
|
86
|
-
items={[
|
|
87
|
-
{ title: '账户信息', description: '填写基本信息' },
|
|
88
|
-
{ title: '验证邮箱', description: '收取验证码' },
|
|
89
|
-
{ title: '完成', description: '注册成功' },
|
|
90
|
-
]}
|
|
91
|
-
/>
|
|
92
|
-
|
|
93
|
-
// 当前步出错
|
|
94
|
-
<Steps
|
|
95
|
-
current={1}
|
|
96
|
-
status="error"
|
|
97
|
-
items={[
|
|
98
|
-
{ title: '上传文件' },
|
|
99
|
-
{ title: '解析数据' },
|
|
100
|
-
{ title: '导入完成' },
|
|
101
|
-
]}
|
|
102
|
-
/>
|
|
103
|
-
|
|
104
|
-
// 纵向
|
|
105
|
-
<Steps direction="vertical" current={2} items={[...]} />
|
|
106
|
-
|
|
107
|
-
// 自定义 icon
|
|
108
|
-
<Steps
|
|
109
|
-
current={0}
|
|
110
|
-
items={[
|
|
111
|
-
{ title: '提交', icon: <UploadIcon /> },
|
|
112
|
-
{ title: '审核', icon: <ShieldCheck /> },
|
|
113
|
-
{ title: '通过', icon: <Check /> },
|
|
114
|
-
]}
|
|
115
|
-
/>
|
|
116
|
-
```
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Steps } from './steps';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Steps> = {
|
|
5
|
-
title: '导航 · Navigation/Steps',
|
|
6
|
-
component: Steps,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component:
|
|
12
|
-
'Steps 步骤条 — 在多步流程(注册 / 下单 / 部署)中明示当前阶段与整体进度。**antd 独有补足**,shadcn 未提供对应原子;API 能力取 antd `Steps` 起点并保留准则需要的子集:`current` / `status` / `direction` / `size` / `StepItem.status`(`wait` / `process` / `finish` / `error` / `disabled` 5 状态) / `StepItem.icon`。视觉走 OpenTrek semantic tokens,所有样式来自 `@teamix-evo/tokens`,无 mock。',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
argTypes: {
|
|
17
|
-
current: { control: 'number' },
|
|
18
|
-
status: { control: 'inline-radio', options: ['process', 'error'] },
|
|
19
|
-
direction: { control: 'inline-radio', options: ['horizontal', 'vertical'] },
|
|
20
|
-
size: { control: 'inline-radio', options: ['sm', 'default'] },
|
|
21
|
-
},
|
|
22
|
-
args: {
|
|
23
|
-
current: 1,
|
|
24
|
-
status: 'process',
|
|
25
|
-
direction: 'horizontal',
|
|
26
|
-
size: 'default',
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default meta;
|
|
31
|
-
type Story = StoryObj<typeof Steps>;
|
|
32
|
-
|
|
33
|
-
const items = [
|
|
34
|
-
{ title: '账户信息', description: '填写基本信息' },
|
|
35
|
-
{ title: '验证邮箱', description: '收取验证码' },
|
|
36
|
-
{ title: '完成', description: '注册成功' },
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
export const Horizontal: Story = {
|
|
40
|
-
render: (args) => (
|
|
41
|
-
<div className="w-[600px]">
|
|
42
|
-
<Steps {...args} items={items} />
|
|
43
|
-
</div>
|
|
44
|
-
),
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Vertical: Story = {
|
|
48
|
-
args: { direction: 'vertical', current: 1 },
|
|
49
|
-
render: (args) => (
|
|
50
|
-
<div className="w-72">
|
|
51
|
-
<Steps {...args} items={items} />
|
|
52
|
-
</div>
|
|
53
|
-
),
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const ErrorState: Story = {
|
|
57
|
-
parameters: { controls: { disable: true } },
|
|
58
|
-
render: () => (
|
|
59
|
-
<div className="w-[600px]">
|
|
60
|
-
<Steps
|
|
61
|
-
current={1}
|
|
62
|
-
status="error"
|
|
63
|
-
items={[
|
|
64
|
-
{ title: '上传文件' },
|
|
65
|
-
{ title: '解析数据', description: '解析失败,请重试' },
|
|
66
|
-
{ title: '导入完成' },
|
|
67
|
-
]}
|
|
68
|
-
/>
|
|
69
|
-
</div>
|
|
70
|
-
),
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const Small: Story = {
|
|
74
|
-
parameters: { controls: { disable: true } },
|
|
75
|
-
render: () => (
|
|
76
|
-
<div className="w-96">
|
|
77
|
-
<Steps size="sm" current={1} items={items} />
|
|
78
|
-
</div>
|
|
79
|
-
),
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const AllStatuses: Story = {
|
|
83
|
-
parameters: { controls: { disable: true } },
|
|
84
|
-
render: () => (
|
|
85
|
-
<div className="w-[720px]">
|
|
86
|
-
<Steps
|
|
87
|
-
current={1}
|
|
88
|
-
items={[
|
|
89
|
-
{ title: 'Finish', description: '已完成', status: 'finish' },
|
|
90
|
-
{ title: 'Process', description: '进行中', status: 'process' },
|
|
91
|
-
{ title: 'Wait', description: '等待中', status: 'wait' },
|
|
92
|
-
{ title: 'Error', description: '处理失败', status: 'error' },
|
|
93
|
-
{ title: 'Disabled', description: '不可点击', status: 'disabled' },
|
|
94
|
-
]}
|
|
95
|
-
/>
|
|
96
|
-
</div>
|
|
97
|
-
),
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const DisabledStep: Story = {
|
|
101
|
-
parameters: { controls: { disable: true } },
|
|
102
|
-
render: () => (
|
|
103
|
-
<div className="w-[600px]">
|
|
104
|
-
<Steps
|
|
105
|
-
current={0}
|
|
106
|
-
items={[
|
|
107
|
-
{ title: '账户信息' },
|
|
108
|
-
{ title: '验证邮箱' },
|
|
109
|
-
{ title: '高级设置', status: 'disabled', description: '需升级后可用' },
|
|
110
|
-
{ title: '完成' },
|
|
111
|
-
]}
|
|
112
|
-
/>
|
|
113
|
-
</div>
|
|
114
|
-
),
|
|
115
|
-
};
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Check, X } from 'lucide-react';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/utils/cn';
|
|
5
|
-
|
|
6
|
-
export type StepStatus = 'wait' | 'process' | 'finish' | 'error' | 'disabled';
|
|
7
|
-
|
|
8
|
-
export interface StepItem {
|
|
9
|
-
/** 步骤标题(必填)。 */
|
|
10
|
-
title: React.ReactNode;
|
|
11
|
-
/** 描述(可选)。 */
|
|
12
|
-
description?: React.ReactNode;
|
|
13
|
-
/** 自定义状态(覆盖父级根据 current 推导出的状态)。`disabled` 状态不响应点击。 */
|
|
14
|
-
status?: StepStatus;
|
|
15
|
-
/** 自定义图标(覆盖默认数字 / 勾选 / 错误)。 */
|
|
16
|
-
icon?: React.ReactNode;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface StepsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
20
|
-
/** 步骤列表。 */
|
|
21
|
-
items: StepItem[];
|
|
22
|
-
/**
|
|
23
|
-
* 当前步骤(0-based)。`current` 之前的为 finish,`current` 为 process,之后为 wait。
|
|
24
|
-
* @default 0
|
|
25
|
-
*/
|
|
26
|
-
current?: number;
|
|
27
|
-
/**
|
|
28
|
-
* 当前步骤的状态(只影响 `current` 那一步;`process` 默认,`error` 标红)。
|
|
29
|
-
* @default "process"
|
|
30
|
-
*/
|
|
31
|
-
status?: 'process' | 'error';
|
|
32
|
-
/**
|
|
33
|
-
* 排列方向。
|
|
34
|
-
* @default "horizontal"
|
|
35
|
-
*/
|
|
36
|
-
direction?: 'horizontal' | 'vertical';
|
|
37
|
-
/**
|
|
38
|
-
* 尺寸。
|
|
39
|
-
* @default "default"
|
|
40
|
-
*/
|
|
41
|
-
size?: 'sm' | 'md' | 'default';
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function statusFor(
|
|
45
|
-
i: number,
|
|
46
|
-
current: number,
|
|
47
|
-
topStatus: 'process' | 'error',
|
|
48
|
-
itemStatus?: StepStatus,
|
|
49
|
-
): StepStatus {
|
|
50
|
-
if (itemStatus) return itemStatus;
|
|
51
|
-
if (i < current) return 'finish';
|
|
52
|
-
if (i === current) return topStatus;
|
|
53
|
-
return 'wait';
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const dotColor: Record<StepStatus, string> = {
|
|
57
|
-
wait: 'border-border bg-background text-muted-foreground',
|
|
58
|
-
process: 'border-primary bg-primary text-primary-foreground shadow-sm',
|
|
59
|
-
finish: 'border-primary bg-primary text-primary-foreground',
|
|
60
|
-
error: 'border-destructive bg-destructive text-destructive-foreground',
|
|
61
|
-
disabled: 'border-border bg-muted text-muted-foreground opacity-60',
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const lineColor: Record<StepStatus, string> = {
|
|
65
|
-
wait: 'bg-border',
|
|
66
|
-
process: 'bg-border',
|
|
67
|
-
finish: 'bg-primary',
|
|
68
|
-
error: 'bg-border',
|
|
69
|
-
disabled: 'bg-border opacity-60',
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const titleColor: Record<StepStatus, string> = {
|
|
73
|
-
wait: 'text-muted-foreground',
|
|
74
|
-
process: 'text-foreground font-medium',
|
|
75
|
-
finish: 'text-foreground',
|
|
76
|
-
error: 'text-destructive font-medium',
|
|
77
|
-
disabled: 'text-muted-foreground opacity-60',
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const Steps = React.forwardRef<HTMLDivElement, StepsProps>(
|
|
81
|
-
(
|
|
82
|
-
{
|
|
83
|
-
items,
|
|
84
|
-
current = 0,
|
|
85
|
-
status = 'process',
|
|
86
|
-
direction = 'horizontal',
|
|
87
|
-
size = 'md',
|
|
88
|
-
className,
|
|
89
|
-
...props
|
|
90
|
-
},
|
|
91
|
-
ref,
|
|
92
|
-
) => {
|
|
93
|
-
const isVertical = direction === 'vertical';
|
|
94
|
-
const dotSize = size === 'sm' ? 'size-6 text-xs' : 'size-8 text-xs';
|
|
95
|
-
return (
|
|
96
|
-
<div
|
|
97
|
-
ref={ref}
|
|
98
|
-
className={cn(
|
|
99
|
-
'flex',
|
|
100
|
-
isVertical ? 'flex-col gap-0' : 'flex-row items-start gap-0',
|
|
101
|
-
className,
|
|
102
|
-
)}
|
|
103
|
-
{...props}
|
|
104
|
-
>
|
|
105
|
-
{items.map((it, i) => {
|
|
106
|
-
const s = statusFor(i, current, status, it.status);
|
|
107
|
-
const isLast = i === items.length - 1;
|
|
108
|
-
const isDisabled = s === 'disabled';
|
|
109
|
-
const icon =
|
|
110
|
-
it.icon ??
|
|
111
|
-
(s === 'finish' ? (
|
|
112
|
-
<Check className="size-4" />
|
|
113
|
-
) : s === 'error' ? (
|
|
114
|
-
<X className="size-4" />
|
|
115
|
-
) : (
|
|
116
|
-
i + 1
|
|
117
|
-
));
|
|
118
|
-
return (
|
|
119
|
-
<div
|
|
120
|
-
key={i}
|
|
121
|
-
aria-disabled={isDisabled || undefined}
|
|
122
|
-
className={cn(
|
|
123
|
-
'flex flex-1',
|
|
124
|
-
isVertical ? 'flex-row gap-3' : 'flex-col gap-2',
|
|
125
|
-
isDisabled && 'pointer-events-none',
|
|
126
|
-
)}
|
|
127
|
-
>
|
|
128
|
-
<div
|
|
129
|
-
className={cn(
|
|
130
|
-
'flex',
|
|
131
|
-
isVertical
|
|
132
|
-
? 'flex-col items-center gap-2'
|
|
133
|
-
: 'flex-row items-center gap-2',
|
|
134
|
-
)}
|
|
135
|
-
>
|
|
136
|
-
<div
|
|
137
|
-
className={cn(
|
|
138
|
-
'flex shrink-0 items-center justify-center rounded-full border-2 font-medium tabular-nums',
|
|
139
|
-
dotSize,
|
|
140
|
-
dotColor[s],
|
|
141
|
-
)}
|
|
142
|
-
>
|
|
143
|
-
{icon}
|
|
144
|
-
</div>
|
|
145
|
-
{!isLast ? (
|
|
146
|
-
<div
|
|
147
|
-
className={cn(
|
|
148
|
-
lineColor[s],
|
|
149
|
-
isVertical ? 'min-h-8 w-px flex-1' : 'h-px flex-1',
|
|
150
|
-
)}
|
|
151
|
-
/>
|
|
152
|
-
) : null}
|
|
153
|
-
</div>
|
|
154
|
-
<div
|
|
155
|
-
className={cn('flex flex-col gap-0.5', !isVertical && 'pr-3')}
|
|
156
|
-
>
|
|
157
|
-
<div className={cn('text-xs', titleColor[s])}>{it.title}</div>
|
|
158
|
-
{it.description ? (
|
|
159
|
-
<div className="text-xs text-muted-foreground">
|
|
160
|
-
{it.description}
|
|
161
|
-
</div>
|
|
162
|
-
) : null}
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
);
|
|
166
|
-
})}
|
|
167
|
-
</div>
|
|
168
|
-
);
|
|
169
|
-
},
|
|
170
|
-
);
|
|
171
|
-
Steps.displayName = 'Steps';
|
|
172
|
-
|
|
173
|
-
export { Steps };
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: switch
|
|
3
|
-
name: Switch
|
|
4
|
-
displayName: 开关
|
|
5
|
-
type: component
|
|
6
|
-
category: data-entry
|
|
7
|
-
since: 0.1.0
|
|
8
|
-
package: '@teamix-evo/ui'
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Switch 开关
|
|
12
|
-
|
|
13
|
-
开关 — Radix Switch + antd 的 `loading / checkedChildren / unCheckedChildren / size`。
|
|
14
|
-
|
|
15
|
-
## When to use
|
|
16
|
-
|
|
17
|
-
- 立即生效的二元状态切换(订阅 / 通知 / 主题)
|
|
18
|
-
- 对比 Checkbox:Switch 表示**立即应用**,Checkbox 表示**待提交**
|
|
19
|
-
|
|
20
|
-
## When NOT to use
|
|
21
|
-
|
|
22
|
-
- 表单内需提交后生效 → 用 `Checkbox`
|
|
23
|
-
- 多个互斥选项 → 用 `Radio Group` 或 `Toggle Group`
|
|
24
|
-
|
|
25
|
-
## Props
|
|
26
|
-
|
|
27
|
-
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。
|
|
28
|
-
|
|
29
|
-
<!-- auto:props:begin -->
|
|
30
|
-
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
31
|
-
| --- | --- | --- | --- | --- |
|
|
32
|
-
| `checked` | `boolean` | – | – | 受控选中状态(等价 antd `checked`)。 与 `defaultChecked` 二选一,不同时传。 |
|
|
33
|
-
| `defaultChecked` | `boolean` | `false` | – | 非受控初始选中态(等价 antd `defaultChecked`)。 |
|
|
34
|
-
| `onCheckedChange` | `(checked: boolean) => void` | – | – | 选中状态变化回调 — Radix 命名,等价 antd `onChange(checked)`。 |
|
|
35
|
-
| `disabled` | `boolean` | `false` | – | 禁用整个 Switch(灰化 + 不响应交互)。`loading` 也会自动禁用。 |
|
|
36
|
-
| `required` | `boolean` | `false` | – | 表单必填 — 设置 HTML 原生 `required`,表单层校验依赖此值。 |
|
|
37
|
-
| `name` | `string` | – | – | 表单字段名(原生 `<input name>`,提交表单时使用)。 |
|
|
38
|
-
| `value` | `string` | – | – | 表单字段值(选中时随表单提交)。 |
|
|
39
|
-
| `id` | `string` | – | – | id 属性,配合 `<label htmlFor>` 关联标签。 |
|
|
40
|
-
| `loading` | `boolean` | `false` | – | 加载态 — 自动 `disabled`,thumb 上叠加自旋 spinner(antd 并集)。 |
|
|
41
|
-
| `checkedChildren` | `React.ReactNode` | – | – | 选中态显示的内文(antd `checkedChildren` 并集)。 |
|
|
42
|
-
| `unCheckedChildren` | `React.ReactNode` | – | – | 未选中态显示的内文(antd `unCheckedChildren` 并集)。 |
|
|
43
|
-
| `size` | `'sm' \| 'md' \| 'default'` | `"md"` | – | 尺寸。`md` 与 `default` 完全等价,后者作为向后兼容别名保留;新代码请优先 使用 `md`,与 Button / Input / Checkbox / Radio 等表单原子组件的 size enum 一致。 |
|
|
44
|
-
<!-- auto:props:end -->
|
|
45
|
-
|
|
46
|
-
## 依赖
|
|
47
|
-
|
|
48
|
-
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
|
|
49
|
-
|
|
50
|
-
<!-- auto:deps:begin -->
|
|
51
|
-
### 同库依赖
|
|
52
|
-
|
|
53
|
-
> `teamix-evo ui add switch` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
54
|
-
|
|
55
|
-
| Entry | 类型 | 描述 |
|
|
56
|
-
| --- | --- | --- |
|
|
57
|
-
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
58
|
-
|
|
59
|
-
### npm 依赖
|
|
60
|
-
|
|
61
|
-
> 业务侧需要先 `pnpm add` / `npm install` 这些包。CLI 在 `ui add` 完成后会列出此提示。
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
pnpm add @radix-ui/react-switch@^1.1.0 lucide-react@^0.460.0
|
|
65
|
-
```
|
|
66
|
-
<!-- auto:deps:end -->
|
|
67
|
-
|
|
68
|
-
> 透传所有 Radix Switch.Root props(`checked` / `defaultChecked` / `onCheckedChange` / `name` / `value` 等)。
|
|
69
|
-
|
|
70
|
-
## AI 生成纪律
|
|
71
|
-
|
|
72
|
-
- **`loading` 期间禁止操作**:已自动 `disabled`,**不要**手动叠加 disabled 影响 UX 一致
|
|
73
|
-
- **`checkedChildren` 文字 ≤ 2 个汉字**:仅"开/关"或"On/Off",过长会溢出胶囊
|
|
74
|
-
- **配 Label 无障碍**:Switch 不带可见文字时,必须用 `aria-label` 或外部 `<Label>` + `id` 关联
|
|
75
|
-
- **size 命名**:首选 `'sm' | 'md'`,与 Button / Input / Checkbox / Radio 等表单原子保持一致;`'default'` 作为向后兼容别名保留(等价 `'md'`)
|
|
76
|
-
- **size 对齐 cloud-design**:`sm` 外框 16x28(h-4 w-7) 对齐旧库 `small`,`md`/`default` 外框 24x44(h-6 w-11) 对齐旧库 `medium`,**不要随意改尺寸**(会与表单/表格里的密集布局打架)
|
|
77
|
-
- **内文模式 sm 限制**:`sm` 下内文使用 10px 字号(inline style,绕开 `no-arbitrary-tw-value`),实际可视宽度仅够容纳 1 个汉字(如"开/关");如需多字请用 `md` size
|
|
78
|
-
- **thumb 紧贴边缘规范**:开/关两态下 thumb 始终紧贴 track 一侧;有 `checkedChildren / unCheckedChildren` 时,文字 span 仅在 thumb 反向加 padding,thumb 与轨道边缘距离对称(checked: thumb 贴右,文字偏左 padding;unchecked: thumb 贴左,文字偏右 padding)
|
|
79
|
-
- **inner text 自适应宽度**:文字态下 track `min-w` 弹性,文字 span 通过 `flex-1` + 单侧 padding 撑开容器,**不要给 track 写死 w-\* 数值**
|
|
80
|
-
|
|
81
|
-
## Examples
|
|
82
|
-
|
|
83
|
-
```tsx
|
|
84
|
-
import { Switch } from '@/components/ui/switch';
|
|
85
|
-
import { Label } from '@/components/ui/label';
|
|
86
|
-
|
|
87
|
-
// 基础(可控)
|
|
88
|
-
const [on, setOn] = React.useState(false);
|
|
89
|
-
<Switch checked={on} onCheckedChange={setOn} aria-label="启用通知" />
|
|
90
|
-
|
|
91
|
-
// 配 Label
|
|
92
|
-
<div className="flex items-center gap-2">
|
|
93
|
-
<Switch id="notify" />
|
|
94
|
-
<Label htmlFor="notify">订阅邮件提醒</Label>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
// 加载态
|
|
98
|
-
<Switch loading defaultChecked />
|
|
99
|
-
|
|
100
|
-
// 内文(开/关 / On/Off)
|
|
101
|
-
<Switch checkedChildren="开" unCheckedChildren="关" defaultChecked />
|
|
102
|
-
|
|
103
|
-
// 小尺寸
|
|
104
|
-
<Switch size="sm" />
|
|
105
|
-
|
|
106
|
-
// md(推荐写法,与 Button/Input/Checkbox 一致)
|
|
107
|
-
<Switch size="md" />
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
## Switch 形态 — 旧库 API → 新映射
|
|
111
|
-
|
|
112
|
-
> 决策:**不新增独立组件**,直接在 `@teamix-evo/ui Switch` 上承接 cloud-design `Switch` 的所有有效用法。本章节是从旧库平滑迁移的查表索引,与 [上面的 Props 表](#props) 互补。
|
|
113
|
-
|
|
114
|
-
### Props 映射
|
|
115
|
-
|
|
116
|
-
| cloud-design `Switch` | `@teamix-evo/ui Switch` | 说明 |
|
|
117
|
-
| --------------------------------------- | ------------------------------- | ------------------------------------------------- |
|
|
118
|
-
| `checked` / `defaultChecked` | 同名 | 透传 Radix `Switch.Root` |
|
|
119
|
-
| `onChange(checked, e)` | `onCheckedChange(checked)` | Radix 命名,签名仅返回 `boolean`(无 event 形参) |
|
|
120
|
-
| `disabled` | 同名 | 透传 |
|
|
121
|
-
| `size="small"` | `size="sm"` | 命名对齐(与 Button/Input/Checkbox 同 enum) |
|
|
122
|
-
| `size="medium"` | `size="md"` 或 `size="default"` | `md` 为新写法,`default` 作为兼容别名保留 |
|
|
123
|
-
| `loading` | 同名 | 自动 `disabled` + thumb 上叠 spinner(antd 并集) |
|
|
124
|
-
| `checkedChildren` / `unCheckedChildren` | 同名 | 透传,thumb 紧贴边缘 + 文字 span 单侧 padding 渲染 |
|
|
125
|
-
| `autoWidth`(默认 true) | 内置行为 | track `min-w` + 文字 span `flex-1`,无需 prop |
|
|
126
|
-
|
|
127
|
-
### 不修复 / 后续工序清单
|
|
128
|
-
|
|
129
|
-
- **视觉尺寸 / 颜色微调**(40→36 / 22→20 / 18→16 / `#D9D9D9` → `#E5E5E5`):涉及 `@teamix-evo/tokens` 包,本次不动,留作 tokens 包 MVP 工序
|
|
130
|
-
- **报告 §1/§3 的 "checkedChildren / unCheckedChildren 缺失" 描述过时**:实际本仓库自 0.1.0 起已完整实现(thumb 紧贴边缘 + 文字 span 单侧 padding + min-w 弹性宽度),无需补齐
|
|
131
|
-
- **报告 §6 的 size 命名 `'medium'` → `'md'` 描述部分过时**:本仓库实际命名是 `'sm' | 'default'`,本次新增 `'md'` 别名后与其他原子组件对齐
|
|
132
|
-
|
|
133
|
-
### Switch 专项 AI 生成纪律
|
|
134
|
-
|
|
135
|
-
- 写新代码请优先用 `size="md"`,与 Button / Input / Checkbox / Radio 一致;遗留 `size="default"` 仍兼容,**不要主动批量改动**(避免无意义 diff)
|
|
136
|
-
- `onCheckedChange` 签名只有 `(checked: boolean) => void`,**不要按旧库习惯**期待 `(checked, event)` 双参数
|
|
137
|
-
- 受控模式 `checked` + `onCheckedChange` 必须配对;只写 `checked` 不写回调会冻结状态
|
|
138
|
-
- 内文模式下 thumb / 文字的 padding 与 flex order 已在组件内固化,**不要在外层覆盖** `[&>span]:` 等 Tailwind 选择器
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Switch } from './switch';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Switch> = {
|
|
5
|
-
title: '数据录入 · Data Entry/Switch',
|
|
6
|
-
component: Switch,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component:
|
|
12
|
-
'开关 — 在开 / 关两种状态间切换,适用于需要即时生效的二值设置。Radix Switch 实现 + antd Switch 的并集能力:支持 `size` (sm / default)、`loading` 异步状态、以及 `checkedChildren` / `unCheckedChildren` 在轨道内渲染状态文本(对齐 antd)。',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
argTypes: {
|
|
17
|
-
size: { control: 'inline-radio', options: ['sm', 'md'] },
|
|
18
|
-
loading: { control: 'boolean' },
|
|
19
|
-
disabled: { control: 'boolean' },
|
|
20
|
-
checkedChildren: { control: 'text' },
|
|
21
|
-
unCheckedChildren: { control: 'text' },
|
|
22
|
-
},
|
|
23
|
-
args: { size: 'md', loading: false, disabled: false },
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default meta;
|
|
27
|
-
type Story = StoryObj<typeof Switch>;
|
|
28
|
-
|
|
29
|
-
export const Playground: Story = {};
|
|
30
|
-
|
|
31
|
-
export const Sizes: Story = {
|
|
32
|
-
parameters: { controls: { disable: true } },
|
|
33
|
-
render: () => (
|
|
34
|
-
<div className="flex items-center gap-4">
|
|
35
|
-
<Switch size="sm" defaultChecked />
|
|
36
|
-
<Switch size="md" defaultChecked />
|
|
37
|
-
</div>
|
|
38
|
-
),
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const States: Story = {
|
|
42
|
-
parameters: { controls: { disable: true } },
|
|
43
|
-
render: () => (
|
|
44
|
-
<div className="flex items-center gap-4">
|
|
45
|
-
<Switch />
|
|
46
|
-
<Switch defaultChecked />
|
|
47
|
-
<Switch disabled />
|
|
48
|
-
<Switch disabled defaultChecked />
|
|
49
|
-
<Switch loading />
|
|
50
|
-
<Switch loading defaultChecked />
|
|
51
|
-
</div>
|
|
52
|
-
),
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export const WithLabel: Story = {
|
|
56
|
-
parameters: { controls: { disable: true } },
|
|
57
|
-
render: () => (
|
|
58
|
-
<div className="flex items-center gap-2">
|
|
59
|
-
<Switch id="notify-stories" />
|
|
60
|
-
<label htmlFor="notify-stories" className="text-sm font-medium">
|
|
61
|
-
订阅邮件提醒
|
|
62
|
-
</label>
|
|
63
|
-
</div>
|
|
64
|
-
),
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const InnerText: Story = {
|
|
68
|
-
parameters: { controls: { disable: true } },
|
|
69
|
-
render: () => (
|
|
70
|
-
<div className="flex items-center gap-4">
|
|
71
|
-
<Switch checkedChildren="开" unCheckedChildren="关" defaultChecked />
|
|
72
|
-
<Switch checkedChildren="On" unCheckedChildren="Off" />
|
|
73
|
-
</div>
|
|
74
|
-
),
|
|
75
|
-
};
|