@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,743 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
-
import {
|
|
4
|
-
ArrowRight,
|
|
5
|
-
ChevronDown,
|
|
6
|
-
ChevronRight,
|
|
7
|
-
Download,
|
|
8
|
-
Heart,
|
|
9
|
-
Plus,
|
|
10
|
-
Search,
|
|
11
|
-
Trash,
|
|
12
|
-
X,
|
|
13
|
-
} from 'lucide-react';
|
|
14
|
-
import { Button, ButtonGroup, ButtonGroupText } from './button';
|
|
15
|
-
import { Input } from '@/components/input/input';
|
|
16
|
-
import {
|
|
17
|
-
DropdownMenu,
|
|
18
|
-
DropdownMenuTrigger,
|
|
19
|
-
DropdownMenuContent,
|
|
20
|
-
DropdownMenuItem,
|
|
21
|
-
DropdownMenuSeparator,
|
|
22
|
-
DropdownMenuCheckboxItem,
|
|
23
|
-
DropdownMenuRadioGroup,
|
|
24
|
-
DropdownMenuRadioItem,
|
|
25
|
-
DropdownMenuLabel,
|
|
26
|
-
} from '@/components/dropdown-menu/dropdown-menu';
|
|
27
|
-
import * as React from 'react';
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Storybook Controls 不能直接编辑 ReactNode,这里用字符串 key 通过 `mapping`
|
|
31
|
-
* 映射到真实 ReactNode — 编辑面板看到的是图标名下拉,实际 prop 收到 element。
|
|
32
|
-
*/
|
|
33
|
-
const iconMap: Record<string, ReactNode> = {
|
|
34
|
-
none: undefined,
|
|
35
|
-
arrowRight: <ArrowRight />,
|
|
36
|
-
chevronRight: <ChevronRight />,
|
|
37
|
-
download: <Download />,
|
|
38
|
-
heart: <Heart />,
|
|
39
|
-
plus: <Plus />,
|
|
40
|
-
search: <Search />,
|
|
41
|
-
trash: <Trash />,
|
|
42
|
-
x: <X />,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const meta: Meta<typeof Button> = {
|
|
46
|
-
title: '通用 · General/Button',
|
|
47
|
-
component: Button,
|
|
48
|
-
tags: ['autodocs'],
|
|
49
|
-
parameters: {
|
|
50
|
-
docs: {
|
|
51
|
-
description: {
|
|
52
|
-
component:
|
|
53
|
-
'Button 按钮 —— 触发即时动作的最基础交互原子(提交、删除、跳转、加载)。shadcn 实现底座 + cloud-design 能力并集:`variant`(7 档形态)/ `color`(ADR 0021 语义色双 prop,与 variant 组合表达"语义×视觉")/ `size`(sm/md/lg/icon,可由 `<ButtonGroup size>` 注入)/ `shape`(default/round/circle/square)/ `loading`(自动 disabled+aria-busy+spinner)/ `icon` + `iconRight`(双 slot)/ `block`(撑满)/ `asChild`(Radix Slot 渲染为 `<a>` 等)/ `disabledTooltip`(禁用态解释文案,wrapper 拾取 hover)。组件合一:`ButtonGroup` + `ButtonGroupText` 同文件导出,等价 antd `Space.Compact`,支持 SplitButton、Toolbar、Input addon 等组合形态。视觉走 semantic tokens,圆角走 Tailwind 标准 `rounded-md`(消费 `--radius-md`),高度 24/32/36(`h-6/h-8/h-9`)、字重 `font-normal`、padding `px-3`、icon-text `gap-1` 全部直接走 Tailwind utility;uni-manager 主题下对齐 cloud-design hybridcloud 视觉(圆角 2px、字重 400、sm 24px)。',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
argTypes: {
|
|
58
|
-
variant: {
|
|
59
|
-
description: '视觉风格,语义按 design token 走',
|
|
60
|
-
control: 'select',
|
|
61
|
-
options: [
|
|
62
|
-
'default',
|
|
63
|
-
'secondary',
|
|
64
|
-
'destructive',
|
|
65
|
-
'outline',
|
|
66
|
-
'dashed',
|
|
67
|
-
'ghost',
|
|
68
|
-
'link',
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
color: {
|
|
72
|
-
description:
|
|
73
|
-
'语义色(ADR 0021),与 variant 双 prop 组合;outline+destructive 即旧库 warning+outline',
|
|
74
|
-
control: 'inline-radio',
|
|
75
|
-
options: ['default', 'primary', 'destructive'],
|
|
76
|
-
},
|
|
77
|
-
size: {
|
|
78
|
-
description: '尺寸,`md` ≡ `default`,`icon` 为正方形纯图标按钮',
|
|
79
|
-
control: 'select',
|
|
80
|
-
options: ['sm', 'md', 'default', 'lg', 'icon'],
|
|
81
|
-
},
|
|
82
|
-
shape: {
|
|
83
|
-
description: '形状,`circle` / `square` 必须配 `size="icon"`',
|
|
84
|
-
control: 'select',
|
|
85
|
-
options: ['default', 'round', 'circle', 'square'],
|
|
86
|
-
},
|
|
87
|
-
block: {
|
|
88
|
-
description: '`true` 时撑满父容器宽度',
|
|
89
|
-
control: 'boolean',
|
|
90
|
-
},
|
|
91
|
-
loading: {
|
|
92
|
-
description: '显示自旋 spinner,自动 disabled,保留视觉宽度',
|
|
93
|
-
control: 'boolean',
|
|
94
|
-
},
|
|
95
|
-
iconPosition: {
|
|
96
|
-
description: '兼容旧 API,新代码请用 `icon` / `iconRight` 双 slot',
|
|
97
|
-
control: 'inline-radio',
|
|
98
|
-
options: ['start', 'end'],
|
|
99
|
-
},
|
|
100
|
-
icon: {
|
|
101
|
-
description: '左侧图标(从 lucide-react 选择,演示用 mapping)',
|
|
102
|
-
options: Object.keys(iconMap),
|
|
103
|
-
mapping: iconMap,
|
|
104
|
-
control: {
|
|
105
|
-
type: 'select',
|
|
106
|
-
labels: {
|
|
107
|
-
none: '无',
|
|
108
|
-
arrowRight: '→ ArrowRight',
|
|
109
|
-
chevronRight: '→ ChevronRight',
|
|
110
|
-
download: '⬇ Download',
|
|
111
|
-
heart: '♥ Heart',
|
|
112
|
-
plus: '+ Plus',
|
|
113
|
-
search: '🔍 Search',
|
|
114
|
-
trash: '🗑 Trash',
|
|
115
|
-
x: '✕ X',
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
iconRight: {
|
|
120
|
-
description: '右侧图标(双 slot,可与 `icon` 共存)',
|
|
121
|
-
options: Object.keys(iconMap),
|
|
122
|
-
mapping: iconMap,
|
|
123
|
-
control: {
|
|
124
|
-
type: 'select',
|
|
125
|
-
labels: {
|
|
126
|
-
none: '无',
|
|
127
|
-
arrowRight: '→ ArrowRight',
|
|
128
|
-
chevronRight: '→ ChevronRight',
|
|
129
|
-
download: '⬇ Download',
|
|
130
|
-
heart: '♥ Heart',
|
|
131
|
-
plus: '+ Plus',
|
|
132
|
-
search: '🔍 Search',
|
|
133
|
-
trash: '🗑 Trash',
|
|
134
|
-
x: '✕ X',
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
asChild: {
|
|
139
|
-
description:
|
|
140
|
-
'用 Radix Slot 渲染为子元素(忽略 loading / icon / iconRight)',
|
|
141
|
-
control: 'boolean',
|
|
142
|
-
},
|
|
143
|
-
disabled: { control: 'boolean' },
|
|
144
|
-
disabledTooltip: {
|
|
145
|
-
description:
|
|
146
|
-
'禁用解释文案,仅在 `disabled` 同时存在时生效,内部用 cursor-not-allowed wrapper + Tooltip 拾取 hover',
|
|
147
|
-
control: 'text',
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
args: {
|
|
151
|
-
children: 'Button',
|
|
152
|
-
variant: 'default',
|
|
153
|
-
color: 'default',
|
|
154
|
-
size: 'default',
|
|
155
|
-
shape: 'default',
|
|
156
|
-
block: false,
|
|
157
|
-
loading: false,
|
|
158
|
-
iconPosition: 'start',
|
|
159
|
-
asChild: false,
|
|
160
|
-
disabled: false,
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export default meta;
|
|
165
|
-
type Story = StoryObj<typeof Button>;
|
|
166
|
-
|
|
167
|
-
// ─── Single-knob stories: editable via the Controls panel ─────────────────────
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* 默认按钮。Controls 面板可调全部 props,即时预览。
|
|
171
|
-
*/
|
|
172
|
-
export const Playground: Story = {
|
|
173
|
-
args: {
|
|
174
|
-
children: 'Submit',
|
|
175
|
-
block: false,
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* 危险动作按钮 — 视觉用 `destructive` variant,不要硬编码 `bg-red-600`。
|
|
181
|
-
*/
|
|
182
|
-
export const Destructive: Story = {
|
|
183
|
-
args: { children: 'Delete', variant: 'destructive' },
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Loading 态 — 自动 `disabled` + `aria-busy=true` + spinner 替换左侧 icon,
|
|
188
|
-
* 视觉宽度保持以避免布局抖动。
|
|
189
|
-
*/
|
|
190
|
-
export const Loading: Story = {
|
|
191
|
-
args: { children: 'Saving', loading: true },
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* 双 slot icon — `icon` 左、`iconRight` 右,可同时存在。
|
|
196
|
-
*/
|
|
197
|
-
export const WithIcons: Story = {
|
|
198
|
-
args: {
|
|
199
|
-
children: 'Next step',
|
|
200
|
-
icon: <Search />,
|
|
201
|
-
iconRight: <ArrowRight />,
|
|
202
|
-
},
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* 块级按钮:`block=true` 撑满父容器宽度。常用于表单主操作 / 移动端。
|
|
207
|
-
*/
|
|
208
|
-
export const Block: Story = {
|
|
209
|
-
args: { children: 'Sign in', block: true },
|
|
210
|
-
decorators: [(Story) => <div style={{ width: 360 }}>{Story()}</div>],
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Icon-only:无 children 仅传 `icon`,组件自动收紧 padding;
|
|
215
|
-
* 配合 `shape="circle"` / `"square"` + `size="icon"` 得到等宽等高图标按钮。
|
|
216
|
-
*/
|
|
217
|
-
export const IconOnly: Story = {
|
|
218
|
-
parameters: { controls: { disable: true } },
|
|
219
|
-
render: () => (
|
|
220
|
-
<div className="flex flex-wrap items-center gap-3">
|
|
221
|
-
<Button size="icon" aria-label="Add" icon={<Plus />} />
|
|
222
|
-
<Button size="icon" shape="circle" aria-label="Like" icon={<Heart />} />
|
|
223
|
-
<Button
|
|
224
|
-
size="icon"
|
|
225
|
-
shape="square"
|
|
226
|
-
variant="outline"
|
|
227
|
-
aria-label="Search"
|
|
228
|
-
icon={<Search />}
|
|
229
|
-
/>
|
|
230
|
-
<Button
|
|
231
|
-
size="icon"
|
|
232
|
-
shape="circle"
|
|
233
|
-
variant="ghost"
|
|
234
|
-
aria-label="Close"
|
|
235
|
-
icon={<X />}
|
|
236
|
-
/>
|
|
237
|
-
</div>
|
|
238
|
-
),
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
// ─── Visual reference stories: comparison tables, no Controls ─────────────────
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* 七种 variant 横向对照(`default / secondary / destructive / outline /
|
|
245
|
-
* dashed / ghost / link`)。视觉锚点 — 调 design token 时这条故事最直观。
|
|
246
|
-
*/
|
|
247
|
-
export const VariantsMatrix: Story = {
|
|
248
|
-
parameters: { controls: { disable: true } },
|
|
249
|
-
render: () => (
|
|
250
|
-
<div className="flex flex-wrap items-center gap-3">
|
|
251
|
-
<Button>Default</Button>
|
|
252
|
-
<Button variant="secondary">Secondary</Button>
|
|
253
|
-
<Button variant="destructive">Destructive</Button>
|
|
254
|
-
<Button variant="outline">Outline</Button>
|
|
255
|
-
<Button variant="dashed">Dashed</Button>
|
|
256
|
-
<Button variant="ghost">Ghost</Button>
|
|
257
|
-
<Button variant="link">Link</Button>
|
|
258
|
-
</div>
|
|
259
|
-
),
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* 三档尺寸(`sm` 24px / `md`(`default`) 32px / `lg` 36px) + `icon`。
|
|
264
|
-
* cva 直接走 `h-6/h-8/h-9` Tailwind utility,与 Input / Select / DatePicker 同档。
|
|
265
|
-
*/
|
|
266
|
-
export const SizesMatrix: Story = {
|
|
267
|
-
parameters: { controls: { disable: true } },
|
|
268
|
-
render: () => (
|
|
269
|
-
<div className="flex flex-wrap items-center gap-3">
|
|
270
|
-
<Button size="sm">Small (24)</Button>
|
|
271
|
-
<Button size="md">Medium (32)</Button>
|
|
272
|
-
<Button size="lg">Large (36)</Button>
|
|
273
|
-
<Button size="icon" aria-label="Add" icon={<Plus />} />
|
|
274
|
-
</div>
|
|
275
|
-
),
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* 四种 shape(`default / round / circle / square`)。
|
|
280
|
-
* `circle` / `square` 必须配 `size="icon"`。
|
|
281
|
-
*/
|
|
282
|
-
export const ShapesMatrix: Story = {
|
|
283
|
-
parameters: { controls: { disable: true } },
|
|
284
|
-
render: () => (
|
|
285
|
-
<div className="flex flex-wrap items-center gap-3">
|
|
286
|
-
<Button shape="default">Default</Button>
|
|
287
|
-
<Button shape="round">Round</Button>
|
|
288
|
-
<Button size="icon" shape="circle" aria-label="Like" icon={<Heart />} />
|
|
289
|
-
<Button
|
|
290
|
-
size="icon"
|
|
291
|
-
shape="square"
|
|
292
|
-
aria-label="Search"
|
|
293
|
-
icon={<Search />}
|
|
294
|
-
/>
|
|
295
|
-
</div>
|
|
296
|
-
),
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* 状态对照:常态 / 禁用 / 加载 / 加载替换 icon。
|
|
301
|
-
* loading 自动 disabled,不要再传 `disabled`。
|
|
302
|
-
*/
|
|
303
|
-
export const StatesMatrix: Story = {
|
|
304
|
-
parameters: { controls: { disable: true } },
|
|
305
|
-
render: () => (
|
|
306
|
-
<div className="flex flex-wrap items-center gap-3">
|
|
307
|
-
<Button>Default</Button>
|
|
308
|
-
<Button disabled>Disabled</Button>
|
|
309
|
-
<Button loading>Loading</Button>
|
|
310
|
-
<Button variant="outline" loading icon={<Download />}>
|
|
311
|
-
Loading replaces left icon
|
|
312
|
-
</Button>
|
|
313
|
-
</div>
|
|
314
|
-
),
|
|
315
|
-
};
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* 双 slot 组合演示:同一按钮同时挂左右图标,适合 prefix + suffix 类操作
|
|
319
|
-
* (例如「下载」+「外部链接」)。
|
|
320
|
-
*/
|
|
321
|
-
export const DualSlots: Story = {
|
|
322
|
-
parameters: { controls: { disable: true } },
|
|
323
|
-
render: () => (
|
|
324
|
-
<div className="flex flex-wrap items-center gap-3">
|
|
325
|
-
<Button icon={<Download />} iconRight={<ArrowRight />}>
|
|
326
|
-
Download & continue
|
|
327
|
-
</Button>
|
|
328
|
-
<Button variant="outline" icon={<Search />} iconRight={<ChevronRight />}>
|
|
329
|
-
Search docs
|
|
330
|
-
</Button>
|
|
331
|
-
<Button
|
|
332
|
-
variant="ghost"
|
|
333
|
-
icon={<Heart />}
|
|
334
|
-
iconRight={<Plus />}
|
|
335
|
-
aria-label="Like and add"
|
|
336
|
-
/>
|
|
337
|
-
</div>
|
|
338
|
-
),
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* `asChild` 模式:把按钮视觉应用到子元素,常见用法是渲染为 `<a>` 链接。
|
|
343
|
-
* 注意此模式下 `loading` / `icon` / `iconRight` 会被忽略。
|
|
344
|
-
*/
|
|
345
|
-
export const AsChild: Story = {
|
|
346
|
-
parameters: { controls: { disable: true } },
|
|
347
|
-
render: () => (
|
|
348
|
-
<Button asChild variant="link">
|
|
349
|
-
<a href="https://teamix-evo.dev">Open docs</a>
|
|
350
|
-
</Button>
|
|
351
|
-
),
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
// ─── New stories added during Button MVP 优化对齐 ─────────────────────────────
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* ADR 0021 双 prop 组合 — 用 `variant="outline" color="destructive"` 表达
|
|
358
|
-
* 旧库 cloud-design `type="normal" warning` 的语义,而不是新增 variant。
|
|
359
|
-
* 同样支持 `variant="ghost" color="destructive"`(轻量删除)等组合。
|
|
360
|
-
*/
|
|
361
|
-
export const WarningOutline: Story = {
|
|
362
|
-
parameters: { controls: { disable: true } },
|
|
363
|
-
render: () => (
|
|
364
|
-
<div className="flex flex-wrap items-center gap-3">
|
|
365
|
-
<Button variant="outline" color="destructive" icon={<Trash />}>
|
|
366
|
-
删除
|
|
367
|
-
</Button>
|
|
368
|
-
<Button variant="ghost" color="destructive">
|
|
369
|
-
移除关联
|
|
370
|
-
</Button>
|
|
371
|
-
<Button variant="link" color="destructive">
|
|
372
|
-
解除绑定
|
|
373
|
-
</Button>
|
|
374
|
-
</div>
|
|
375
|
-
),
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* 禁用 + 解释文案 — `disabled` + `disabledTooltip` 触发 cursor-not-allowed
|
|
380
|
-
* wrapper + Tooltip;wrapper 拾取 hover,button 自身 pointer-events 关闭。
|
|
381
|
-
* 不传 `disabledTooltip` 时保持原生 disabled 行为不变。
|
|
382
|
-
*/
|
|
383
|
-
export const DisabledWithTooltip: Story = {
|
|
384
|
-
parameters: { controls: { disable: true } },
|
|
385
|
-
render: () => (
|
|
386
|
-
<div className="flex flex-wrap items-center gap-3">
|
|
387
|
-
<Button disabled disabledTooltip="无权限操作,请联系管理员">
|
|
388
|
-
发布
|
|
389
|
-
</Button>
|
|
390
|
-
<Button
|
|
391
|
-
variant="outline"
|
|
392
|
-
disabled
|
|
393
|
-
disabledTooltip="尚未选中任何条目"
|
|
394
|
-
icon={<Trash />}
|
|
395
|
-
>
|
|
396
|
-
批量删除
|
|
397
|
-
</Button>
|
|
398
|
-
</div>
|
|
399
|
-
),
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* ghost / link text 按钮 — 高度跟随主 size 档(24/32/36),与其他 variant 一致;
|
|
404
|
-
* 区别在于去除背景/边框与收紧水平 padding(ghost px-1 / link px-0)。
|
|
405
|
-
* (早期版本曾使用 18/20px 独立紧凑高度,D1 决策后取消)
|
|
406
|
-
*/
|
|
407
|
-
export const TextCompactSizes: Story = {
|
|
408
|
-
parameters: { controls: { disable: true } },
|
|
409
|
-
render: () => (
|
|
410
|
-
<div className="flex flex-col items-start gap-4">
|
|
411
|
-
<div className="flex flex-wrap items-center gap-3">
|
|
412
|
-
<Button variant="ghost" size="sm">
|
|
413
|
-
Ghost sm (24)
|
|
414
|
-
</Button>
|
|
415
|
-
<Button variant="ghost" size="md">
|
|
416
|
-
Ghost md (32)
|
|
417
|
-
</Button>
|
|
418
|
-
<Button variant="ghost" size="lg">
|
|
419
|
-
Ghost lg (36)
|
|
420
|
-
</Button>
|
|
421
|
-
</div>
|
|
422
|
-
<div className="flex flex-wrap items-center gap-3">
|
|
423
|
-
<Button variant="link" size="sm">
|
|
424
|
-
Link sm
|
|
425
|
-
</Button>
|
|
426
|
-
<Button variant="link" size="md">
|
|
427
|
-
Link md
|
|
428
|
-
</Button>
|
|
429
|
-
<Button variant="link" size="lg">
|
|
430
|
-
Link lg
|
|
431
|
-
</Button>
|
|
432
|
-
</div>
|
|
433
|
-
</div>
|
|
434
|
-
),
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
// ─── ButtonGroup stories (合并自 button-group.stories.tsx) ────────────────────
|
|
438
|
-
|
|
439
|
-
/**
|
|
440
|
-
* ButtonGroup 基础形态 — 把多个 `Button` / `Input` 包在一起共享边线,
|
|
441
|
-
* `attached`(默认 true)等价 antd `Space.Compact`,`false` 时按钮间留 8px。
|
|
442
|
-
*/
|
|
443
|
-
export const GroupPlayground: StoryObj<typeof ButtonGroup> = {
|
|
444
|
-
args: { orientation: 'horizontal', attached: true },
|
|
445
|
-
argTypes: {
|
|
446
|
-
orientation: {
|
|
447
|
-
control: 'inline-radio',
|
|
448
|
-
options: ['horizontal', 'vertical'],
|
|
449
|
-
},
|
|
450
|
-
attached: { control: 'boolean' },
|
|
451
|
-
},
|
|
452
|
-
render: (args) => (
|
|
453
|
-
<ButtonGroup {...args}>
|
|
454
|
-
<Button variant="outline">左</Button>
|
|
455
|
-
<Button variant="outline">中</Button>
|
|
456
|
-
<Button variant="outline">右</Button>
|
|
457
|
-
</ButtonGroup>
|
|
458
|
-
),
|
|
459
|
-
};
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* SplitButton 简化形态 — 左主操作 + 右下拉箭头(独立 Button)。
|
|
463
|
-
*/
|
|
464
|
-
export const GroupSplitButton: Story = {
|
|
465
|
-
parameters: { controls: { disable: true } },
|
|
466
|
-
render: () => (
|
|
467
|
-
<ButtonGroup>
|
|
468
|
-
<Button>保存</Button>
|
|
469
|
-
<Button shape="square" icon={<ChevronDown />} aria-label="更多保存选项" />
|
|
470
|
-
</ButtonGroup>
|
|
471
|
-
),
|
|
472
|
-
};
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* SplitButton 完整形态 — 右侧 ChevronDown 接 DropdownMenu。主按钮与
|
|
476
|
-
* 下拉触发使用同一 `variant` 保证视觉一致;对齐 cloud-design `SplitButton`
|
|
477
|
-
* 与 antd `Dropdown.Button` 的主场景。
|
|
478
|
-
*/
|
|
479
|
-
export const GroupSplitButtonWithDropdown: Story = {
|
|
480
|
-
parameters: { controls: { disable: true } },
|
|
481
|
-
render: () => (
|
|
482
|
-
<div className="flex flex-col items-start gap-3">
|
|
483
|
-
<ButtonGroup>
|
|
484
|
-
<Button>发布</Button>
|
|
485
|
-
<DropdownMenu>
|
|
486
|
-
<DropdownMenuTrigger asChild>
|
|
487
|
-
<Button
|
|
488
|
-
shape="square"
|
|
489
|
-
icon={<ChevronDown />}
|
|
490
|
-
aria-label="更多发布选项"
|
|
491
|
-
/>
|
|
492
|
-
</DropdownMenuTrigger>
|
|
493
|
-
<DropdownMenuContent align="end">
|
|
494
|
-
<DropdownMenuItem>保存为草稿</DropdownMenuItem>
|
|
495
|
-
<DropdownMenuItem>定时发布</DropdownMenuItem>
|
|
496
|
-
<DropdownMenuSeparator />
|
|
497
|
-
<DropdownMenuItem>发布到多个渠道…</DropdownMenuItem>
|
|
498
|
-
</DropdownMenuContent>
|
|
499
|
-
</DropdownMenu>
|
|
500
|
-
</ButtonGroup>
|
|
501
|
-
<ButtonGroup>
|
|
502
|
-
<Button variant="outline">编辑</Button>
|
|
503
|
-
<DropdownMenu>
|
|
504
|
-
<DropdownMenuTrigger asChild>
|
|
505
|
-
<Button
|
|
506
|
-
variant="outline"
|
|
507
|
-
shape="square"
|
|
508
|
-
icon={<ChevronDown />}
|
|
509
|
-
aria-label="更多编辑选项"
|
|
510
|
-
/>
|
|
511
|
-
</DropdownMenuTrigger>
|
|
512
|
-
<DropdownMenuContent align="end">
|
|
513
|
-
<DropdownMenuItem>复制</DropdownMenuItem>
|
|
514
|
-
<DropdownMenuItem>重命名</DropdownMenuItem>
|
|
515
|
-
<DropdownMenuSeparator />
|
|
516
|
-
<DropdownMenuItem className="text-destructive focus:text-destructive">
|
|
517
|
-
删除
|
|
518
|
-
</DropdownMenuItem>
|
|
519
|
-
</DropdownMenuContent>
|
|
520
|
-
</DropdownMenu>
|
|
521
|
-
</ButtonGroup>
|
|
522
|
-
</div>
|
|
523
|
-
),
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
/**
|
|
527
|
-
* SplitButton 多选形态 — 对应 cloud-design SplitButton 的 `selectMode="multiple"` +
|
|
528
|
-
* `selectedKeys`。新组合用 `DropdownMenuCheckboxItem` 表达,checked 受控,主按钮
|
|
529
|
-
* 文案随选择动态变化。
|
|
530
|
-
*/
|
|
531
|
-
export const GroupSplitButtonWithCheckbox: Story = {
|
|
532
|
-
parameters: { controls: { disable: true } },
|
|
533
|
-
render: () => {
|
|
534
|
-
const ChannelsSplit = () => {
|
|
535
|
-
const [channels, setChannels] = React.useState<Record<string, boolean>>({
|
|
536
|
-
web: true,
|
|
537
|
-
mobile: true,
|
|
538
|
-
email: false,
|
|
539
|
-
});
|
|
540
|
-
const toggle = (k: string) => (v: boolean) =>
|
|
541
|
-
setChannels((s) => ({ ...s, [k]: v }));
|
|
542
|
-
const count = Object.values(channels).filter(Boolean).length;
|
|
543
|
-
return (
|
|
544
|
-
<ButtonGroup>
|
|
545
|
-
<Button>{`发布到 ${count} 个渠道`}</Button>
|
|
546
|
-
<DropdownMenu>
|
|
547
|
-
<DropdownMenuTrigger asChild>
|
|
548
|
-
<Button
|
|
549
|
-
shape="square"
|
|
550
|
-
icon={<ChevronDown />}
|
|
551
|
-
aria-label="选择发布渠道"
|
|
552
|
-
/>
|
|
553
|
-
</DropdownMenuTrigger>
|
|
554
|
-
<DropdownMenuContent align="end">
|
|
555
|
-
<DropdownMenuLabel>发布渠道</DropdownMenuLabel>
|
|
556
|
-
<DropdownMenuSeparator />
|
|
557
|
-
<DropdownMenuCheckboxItem
|
|
558
|
-
checked={channels.web}
|
|
559
|
-
onCheckedChange={toggle('web')}
|
|
560
|
-
>
|
|
561
|
-
Web 站点
|
|
562
|
-
</DropdownMenuCheckboxItem>
|
|
563
|
-
<DropdownMenuCheckboxItem
|
|
564
|
-
checked={channels.mobile}
|
|
565
|
-
onCheckedChange={toggle('mobile')}
|
|
566
|
-
>
|
|
567
|
-
移动端
|
|
568
|
-
</DropdownMenuCheckboxItem>
|
|
569
|
-
<DropdownMenuCheckboxItem
|
|
570
|
-
checked={channels.email}
|
|
571
|
-
onCheckedChange={toggle('email')}
|
|
572
|
-
>
|
|
573
|
-
邮件订阅
|
|
574
|
-
</DropdownMenuCheckboxItem>
|
|
575
|
-
</DropdownMenuContent>
|
|
576
|
-
</DropdownMenu>
|
|
577
|
-
</ButtonGroup>
|
|
578
|
-
);
|
|
579
|
-
};
|
|
580
|
-
return <ChannelsSplit />;
|
|
581
|
-
},
|
|
582
|
-
};
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* SplitButton 单选形态 — 对应 cloud-design SplitButton 的 `selectMode="single"`。
|
|
586
|
-
* 新组合用 `DropdownMenuRadioGroup` + `DropdownMenuRadioItem` 表达,value 受控,
|
|
587
|
-
* 选中项 ✓ 反馈。
|
|
588
|
-
*/
|
|
589
|
-
export const GroupSplitButtonWithRadio: Story = {
|
|
590
|
-
parameters: { controls: { disable: true } },
|
|
591
|
-
render: () => {
|
|
592
|
-
const EnvSplit = () => {
|
|
593
|
-
const [env, setEnv] = React.useState('staging');
|
|
594
|
-
const envLabel = { dev: '开发', staging: '预发', prod: '生产' }[env];
|
|
595
|
-
return (
|
|
596
|
-
<ButtonGroup>
|
|
597
|
-
<Button>{`部署到 ${envLabel}`}</Button>
|
|
598
|
-
<DropdownMenu>
|
|
599
|
-
<DropdownMenuTrigger asChild>
|
|
600
|
-
<Button
|
|
601
|
-
shape="square"
|
|
602
|
-
icon={<ChevronDown />}
|
|
603
|
-
aria-label="切换部署环境"
|
|
604
|
-
/>
|
|
605
|
-
</DropdownMenuTrigger>
|
|
606
|
-
<DropdownMenuContent align="end">
|
|
607
|
-
<DropdownMenuLabel>部署环境</DropdownMenuLabel>
|
|
608
|
-
<DropdownMenuSeparator />
|
|
609
|
-
<DropdownMenuRadioGroup value={env} onValueChange={setEnv}>
|
|
610
|
-
<DropdownMenuRadioItem value="dev">开发</DropdownMenuRadioItem>
|
|
611
|
-
<DropdownMenuRadioItem value="staging">
|
|
612
|
-
预发
|
|
613
|
-
</DropdownMenuRadioItem>
|
|
614
|
-
<DropdownMenuRadioItem value="prod">生产</DropdownMenuRadioItem>
|
|
615
|
-
</DropdownMenuRadioGroup>
|
|
616
|
-
</DropdownMenuContent>
|
|
617
|
-
</DropdownMenu>
|
|
618
|
-
</ButtonGroup>
|
|
619
|
-
);
|
|
620
|
-
};
|
|
621
|
-
return <EnvSplit />;
|
|
622
|
-
},
|
|
623
|
-
};
|
|
624
|
-
|
|
625
|
-
/**
|
|
626
|
-
* SplitButton 三档尺寸 — 对应 cloud-design SplitButton 的 `size="small/medium/large"`。
|
|
627
|
-
* 通过 `<ButtonGroup size>` 注入,子 Button 同步继承;同时演示对齐旧库 `autoWidth=true`
|
|
628
|
-
* 的写法 — 用 `style.minWidth` 读 Radix 暴露的 `--radix-dropdown-menu-trigger-width`
|
|
629
|
-
* CSS 变量(避免 Tailwind arbitrary value 规则告警),让弹层最小宽度追平触发按钮宽度。
|
|
630
|
-
*/
|
|
631
|
-
export const GroupSplitButtonSizes: Story = {
|
|
632
|
-
parameters: { controls: { disable: true } },
|
|
633
|
-
render: () => {
|
|
634
|
-
const Demo = ({ size }: { size: 'sm' | 'md' | 'lg' }) => (
|
|
635
|
-
<ButtonGroup size={size}>
|
|
636
|
-
<Button>新建数据库</Button>
|
|
637
|
-
<DropdownMenu>
|
|
638
|
-
<DropdownMenuTrigger asChild>
|
|
639
|
-
<Button
|
|
640
|
-
shape="square"
|
|
641
|
-
icon={<ChevronDown />}
|
|
642
|
-
aria-label="更多新建选项"
|
|
643
|
-
/>
|
|
644
|
-
</DropdownMenuTrigger>
|
|
645
|
-
<DropdownMenuContent
|
|
646
|
-
align="end"
|
|
647
|
-
style={{ minWidth: 'var(--radix-dropdown-menu-trigger-width)' }}
|
|
648
|
-
>
|
|
649
|
-
<DropdownMenuItem>MySQL 实例</DropdownMenuItem>
|
|
650
|
-
<DropdownMenuItem>PostgreSQL 实例</DropdownMenuItem>
|
|
651
|
-
<DropdownMenuItem>Redis 实例</DropdownMenuItem>
|
|
652
|
-
</DropdownMenuContent>
|
|
653
|
-
</DropdownMenu>
|
|
654
|
-
</ButtonGroup>
|
|
655
|
-
);
|
|
656
|
-
return (
|
|
657
|
-
<div className="flex flex-col items-start gap-3">
|
|
658
|
-
<Demo size="sm" />
|
|
659
|
-
<Demo size="md" />
|
|
660
|
-
<Demo size="lg" />
|
|
661
|
-
</div>
|
|
662
|
-
);
|
|
663
|
-
},
|
|
664
|
-
};
|
|
665
|
-
|
|
666
|
-
/**
|
|
667
|
-
* `<ButtonGroup size="sm">` 自动通过 Context 把 sm 注入未显式传 size 的子 Button。
|
|
668
|
-
* 显式传 `size` 的子 Button 以子值优先,Context 不覆盖。
|
|
669
|
-
*/
|
|
670
|
-
export const GroupSizeInherit: Story = {
|
|
671
|
-
parameters: { controls: { disable: true } },
|
|
672
|
-
render: () => (
|
|
673
|
-
<div className="flex flex-col items-start gap-3">
|
|
674
|
-
<ButtonGroup size="sm">
|
|
675
|
-
<Button variant="outline">继承 sm</Button>
|
|
676
|
-
<Button variant="outline">继承 sm</Button>
|
|
677
|
-
<Button variant="outline" size="lg">
|
|
678
|
-
显式 lg(不继承)
|
|
679
|
-
</Button>
|
|
680
|
-
</ButtonGroup>
|
|
681
|
-
<ButtonGroup size="lg">
|
|
682
|
-
<Button>继承 lg</Button>
|
|
683
|
-
<Button variant="outline">继承 lg</Button>
|
|
684
|
-
<Button variant="outline">继承 lg</Button>
|
|
685
|
-
</ButtonGroup>
|
|
686
|
-
</div>
|
|
687
|
-
),
|
|
688
|
-
};
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
* 分页器形态。
|
|
692
|
-
*/
|
|
693
|
-
export const GroupPager: Story = {
|
|
694
|
-
parameters: { controls: { disable: true } },
|
|
695
|
-
render: () => (
|
|
696
|
-
<ButtonGroup>
|
|
697
|
-
<Button variant="outline">上一页</Button>
|
|
698
|
-
<Button variant="outline">1 / 10</Button>
|
|
699
|
-
<Button variant="outline">下一页</Button>
|
|
700
|
-
</ButtonGroup>
|
|
701
|
-
),
|
|
702
|
-
};
|
|
703
|
-
|
|
704
|
-
/**
|
|
705
|
-
* Input + addon 拼装。`ButtonGroupText` 提供 antd-style addon 文字。
|
|
706
|
-
*/
|
|
707
|
-
export const GroupInputAddon: Story = {
|
|
708
|
-
parameters: { controls: { disable: true } },
|
|
709
|
-
render: () => (
|
|
710
|
-
<ButtonGroup>
|
|
711
|
-
<ButtonGroupText>https://</ButtonGroupText>
|
|
712
|
-
<Input defaultValue="example.com" className="rounded-l-none" />
|
|
713
|
-
<Button>访问</Button>
|
|
714
|
-
</ButtonGroup>
|
|
715
|
-
),
|
|
716
|
-
};
|
|
717
|
-
|
|
718
|
-
/**
|
|
719
|
-
* 垂直方向按钮组。
|
|
720
|
-
*/
|
|
721
|
-
export const GroupVertical: Story = {
|
|
722
|
-
parameters: { controls: { disable: true } },
|
|
723
|
-
render: () => (
|
|
724
|
-
<ButtonGroup orientation="vertical">
|
|
725
|
-
<Button variant="outline">编辑</Button>
|
|
726
|
-
<Button variant="outline">复制</Button>
|
|
727
|
-
<Button variant="outline">删除</Button>
|
|
728
|
-
</ButtonGroup>
|
|
729
|
-
),
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
/**
|
|
733
|
-
* `attached={false}` — 按钮间保留 8px gap,圆角不被去除。
|
|
734
|
-
*/
|
|
735
|
-
export const GroupNotAttached: Story = {
|
|
736
|
-
parameters: { controls: { disable: true } },
|
|
737
|
-
render: () => (
|
|
738
|
-
<ButtonGroup attached={false}>
|
|
739
|
-
<Button variant="outline">取消</Button>
|
|
740
|
-
<Button>确定</Button>
|
|
741
|
-
</ButtonGroup>
|
|
742
|
-
),
|
|
743
|
-
};
|