@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,104 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import {
|
|
3
|
-
ResizablePanelGroup,
|
|
4
|
-
ResizablePanel,
|
|
5
|
-
ResizableHandle,
|
|
6
|
-
} from './resizable';
|
|
7
|
-
|
|
8
|
-
const meta: Meta<typeof ResizablePanelGroup> = {
|
|
9
|
-
title: '布局 · Layout/Resizable',
|
|
10
|
-
component: ResizablePanelGroup,
|
|
11
|
-
tags: ['autodocs'],
|
|
12
|
-
parameters: {
|
|
13
|
-
docs: {
|
|
14
|
-
description: {
|
|
15
|
-
component:
|
|
16
|
-
'可拖拽分栏 — 编辑器 / 桌面应用风格(VS Code、Figma)。基于 react-resizable-panels,支持横/纵向、嵌套、min/max 限制、握把可视化。',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
type Story = StoryObj<typeof ResizablePanelGroup>;
|
|
24
|
-
|
|
25
|
-
export const Horizontal: Story = {
|
|
26
|
-
render: () => (
|
|
27
|
-
<ResizablePanelGroup
|
|
28
|
-
direction="horizontal"
|
|
29
|
-
className="min-h-[300px] w-[600px] rounded-lg border border-border"
|
|
30
|
-
>
|
|
31
|
-
<ResizablePanel defaultSize={30} minSize={20}>
|
|
32
|
-
<div className="flex h-full items-center justify-center p-6">
|
|
33
|
-
<span className="text-sm">侧栏(30%)</span>
|
|
34
|
-
</div>
|
|
35
|
-
</ResizablePanel>
|
|
36
|
-
<ResizableHandle withHandle />
|
|
37
|
-
<ResizablePanel defaultSize={70}>
|
|
38
|
-
<div className="flex h-full items-center justify-center p-6">
|
|
39
|
-
<span className="text-sm">主区(70%)</span>
|
|
40
|
-
</div>
|
|
41
|
-
</ResizablePanel>
|
|
42
|
-
</ResizablePanelGroup>
|
|
43
|
-
),
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const Vertical: Story = {
|
|
47
|
-
parameters: { controls: { disable: true } },
|
|
48
|
-
render: () => (
|
|
49
|
-
<ResizablePanelGroup
|
|
50
|
-
direction="vertical"
|
|
51
|
-
className="min-h-[400px] w-[400px] rounded-lg border border-border"
|
|
52
|
-
>
|
|
53
|
-
<ResizablePanel defaultSize={70}>
|
|
54
|
-
<div className="flex h-full items-center justify-center p-6 text-sm">
|
|
55
|
-
上(70%)
|
|
56
|
-
</div>
|
|
57
|
-
</ResizablePanel>
|
|
58
|
-
<ResizableHandle />
|
|
59
|
-
<ResizablePanel defaultSize={30}>
|
|
60
|
-
<div className="flex h-full items-center justify-center p-6 text-sm">
|
|
61
|
-
下(30%)
|
|
62
|
-
</div>
|
|
63
|
-
</ResizablePanel>
|
|
64
|
-
</ResizablePanelGroup>
|
|
65
|
-
),
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const Nested: Story = {
|
|
69
|
-
parameters: { controls: { disable: true } },
|
|
70
|
-
render: () => (
|
|
71
|
-
<ResizablePanelGroup
|
|
72
|
-
direction="horizontal"
|
|
73
|
-
className="min-h-[400px] w-[700px] rounded-lg border border-border"
|
|
74
|
-
>
|
|
75
|
-
<ResizablePanel defaultSize={20} minSize={15}>
|
|
76
|
-
<div className="flex h-full items-center justify-center p-4 text-sm">
|
|
77
|
-
目录
|
|
78
|
-
</div>
|
|
79
|
-
</ResizablePanel>
|
|
80
|
-
<ResizableHandle withHandle />
|
|
81
|
-
<ResizablePanel defaultSize={55}>
|
|
82
|
-
<ResizablePanelGroup direction="vertical">
|
|
83
|
-
<ResizablePanel defaultSize={70}>
|
|
84
|
-
<div className="flex h-full items-center justify-center p-4 text-sm">
|
|
85
|
-
编辑区
|
|
86
|
-
</div>
|
|
87
|
-
</ResizablePanel>
|
|
88
|
-
<ResizableHandle />
|
|
89
|
-
<ResizablePanel defaultSize={30}>
|
|
90
|
-
<div className="flex h-full items-center justify-center p-4 text-sm">
|
|
91
|
-
终端
|
|
92
|
-
</div>
|
|
93
|
-
</ResizablePanel>
|
|
94
|
-
</ResizablePanelGroup>
|
|
95
|
-
</ResizablePanel>
|
|
96
|
-
<ResizableHandle withHandle />
|
|
97
|
-
<ResizablePanel defaultSize={25}>
|
|
98
|
-
<div className="flex h-full items-center justify-center p-4 text-sm">
|
|
99
|
-
预览
|
|
100
|
-
</div>
|
|
101
|
-
</ResizablePanel>
|
|
102
|
-
</ResizablePanelGroup>
|
|
103
|
-
),
|
|
104
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { GripVertical } from 'lucide-react';
|
|
3
|
-
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/utils/cn';
|
|
6
|
-
|
|
7
|
-
export interface ResizablePanelGroupProps
|
|
8
|
-
extends React.ComponentProps<typeof ResizablePrimitive.PanelGroup> {}
|
|
9
|
-
|
|
10
|
-
const ResizablePanelGroup = ({
|
|
11
|
-
className,
|
|
12
|
-
...props
|
|
13
|
-
}: ResizablePanelGroupProps) => (
|
|
14
|
-
<ResizablePrimitive.PanelGroup
|
|
15
|
-
className={cn(
|
|
16
|
-
'flex h-full w-full data-[panel-group-direction=vertical]:flex-col',
|
|
17
|
-
className,
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
ResizablePanelGroup.displayName = 'ResizablePanelGroup';
|
|
23
|
-
|
|
24
|
-
const ResizablePanel = ResizablePrimitive.Panel;
|
|
25
|
-
|
|
26
|
-
export interface ResizableHandleProps
|
|
27
|
-
extends React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> {
|
|
28
|
-
/**
|
|
29
|
-
* 是否在 handle 上显示握把图标(`<GripVertical />`),提升可发现性。
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
withHandle?: boolean;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const ResizableHandle = ({
|
|
36
|
-
withHandle = false,
|
|
37
|
-
className,
|
|
38
|
-
...props
|
|
39
|
-
}: ResizableHandleProps) => (
|
|
40
|
-
<ResizablePrimitive.PanelResizeHandle
|
|
41
|
-
className={cn(
|
|
42
|
-
'relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90',
|
|
43
|
-
className,
|
|
44
|
-
)}
|
|
45
|
-
{...props}
|
|
46
|
-
>
|
|
47
|
-
{withHandle ? (
|
|
48
|
-
<div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border border-border bg-border">
|
|
49
|
-
<GripVertical className="size-2.5" />
|
|
50
|
-
</div>
|
|
51
|
-
) : null}
|
|
52
|
-
</ResizablePrimitive.PanelResizeHandle>
|
|
53
|
-
);
|
|
54
|
-
ResizableHandle.displayName = 'ResizableHandle';
|
|
55
|
-
|
|
56
|
-
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: result
|
|
3
|
-
name: Result
|
|
4
|
-
type: component
|
|
5
|
-
category: feedback
|
|
6
|
-
since: 0.1.0
|
|
7
|
-
package: '@teamix-evo/ui'
|
|
8
|
-
displayName: 结果页
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Result 结果页
|
|
12
|
-
|
|
13
|
-
结果页 — antd 独有补足。**整页级反馈**:操作成功、失败、404、403、500 等场景的居中状态页(图标 + 标题 + 副标题 + 操作区)。
|
|
14
|
-
|
|
15
|
-
## When to use
|
|
16
|
-
|
|
17
|
-
- 操作完成的成功页(订单提交、支付完成)
|
|
18
|
-
- 错误页(500 / 404 / 403)
|
|
19
|
-
- 表单提交失败的反馈页
|
|
20
|
-
- 空数据 + 引导操作(也可考虑 `Empty`)
|
|
21
|
-
|
|
22
|
-
## When NOT to use
|
|
23
|
-
|
|
24
|
-
- 行内提示 → `Alert`
|
|
25
|
-
- 短暂消息 → `Sonner`
|
|
26
|
-
- 阻断式确认 → `AlertDialog`
|
|
27
|
-
|
|
28
|
-
## Props
|
|
29
|
-
|
|
30
|
-
<!-- auto:props:begin -->
|
|
31
|
-
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
32
|
-
| --- | --- | --- | --- | --- |
|
|
33
|
-
| `status` | `ResultStatus` | `"info"` | – | 状态类型 — 决定默认图标和配色;`404 / 403 / 500` 显示大字号错误码代替图标。 |
|
|
34
|
-
| `icon` | `React.ReactNode` | – | – | 自定义图标(覆盖默认)。 |
|
|
35
|
-
| `title` | `React.ReactNode` | – | – | 标题。 |
|
|
36
|
-
| `subTitle` | `React.ReactNode` | – | – | 副标题(描述)。 |
|
|
37
|
-
| `extra` | `React.ReactNode` | – | – | 操作区(放 Button)。 |
|
|
38
|
-
<!-- auto:props:end -->
|
|
39
|
-
|
|
40
|
-
## 依赖
|
|
41
|
-
|
|
42
|
-
<!-- auto:deps:begin -->
|
|
43
|
-
### 同库依赖
|
|
44
|
-
|
|
45
|
-
> `teamix-evo ui add result` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
46
|
-
|
|
47
|
-
| Entry | 类型 | 描述 |
|
|
48
|
-
| --- | --- | --- |
|
|
49
|
-
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
50
|
-
|
|
51
|
-
### npm 依赖
|
|
52
|
-
|
|
53
|
-
> 业务侧需要先 `pnpm add` / `npm install` 这些包。CLI 在 `ui add` 完成后会列出此提示。
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
pnpm add lucide-react@^0.460.0
|
|
57
|
-
```
|
|
58
|
-
<!-- auto:deps:end -->
|
|
59
|
-
|
|
60
|
-
## AI 生成纪律
|
|
61
|
-
|
|
62
|
-
- **`status` 决定默认图标 + 配色**:用语义,不要随便覆盖
|
|
63
|
-
- **`extra` 必有主 / 次操作**:错误页放"重试 + 返回",成功页放"查看详情 + 完成"
|
|
64
|
-
- **大字号错误码**(`404 / 403 / 500`)自动渲染,无需自行加 icon
|
|
65
|
-
- **不要嵌套 Result**:Result 是页面级组件
|
|
66
|
-
- **subTitle 简短**:< 1 段,长说明用单独的内容区
|
|
67
|
-
|
|
68
|
-
## Examples
|
|
69
|
-
|
|
70
|
-
```tsx
|
|
71
|
-
import { Result } from '@/components/ui/result';
|
|
72
|
-
import { Button } from '@/components/ui/button';
|
|
73
|
-
|
|
74
|
-
// 成功
|
|
75
|
-
<Result
|
|
76
|
-
status="success"
|
|
77
|
-
title="提交成功"
|
|
78
|
-
subTitle="订单已生成,我们将尽快处理。"
|
|
79
|
-
extra={[
|
|
80
|
-
<Button key="view">查看订单</Button>,
|
|
81
|
-
<Button key="back" variant="outline">返回首页</Button>,
|
|
82
|
-
]}
|
|
83
|
-
/>
|
|
84
|
-
|
|
85
|
-
// 错误页
|
|
86
|
-
<Result
|
|
87
|
-
status="500"
|
|
88
|
-
title="服务异常"
|
|
89
|
-
subTitle="抱歉,系统出错。请稍后重试或联系管理员。"
|
|
90
|
-
extra={<Button>返回首页</Button>}
|
|
91
|
-
/>
|
|
92
|
-
|
|
93
|
-
// 404
|
|
94
|
-
<Result status="404" title="页面不存在" extra={<Button>返回首页</Button>} />
|
|
95
|
-
```
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Result } from './result';
|
|
3
|
-
import { Button } from '@/components/button/button';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof Result> = {
|
|
6
|
-
title: '反馈 · Feedback/Result',
|
|
7
|
-
component: Result,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component:
|
|
13
|
-
'结果页 — 整页级反馈(成功 / 失败 / 404 / 403 / 500)。图标 + 标题 + 副标题 + 操作区,自动配色。等价 antd Result。',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default meta;
|
|
20
|
-
type Story = StoryObj<typeof Result>;
|
|
21
|
-
|
|
22
|
-
export const Success: Story = {
|
|
23
|
-
render: () => (
|
|
24
|
-
<Result
|
|
25
|
-
status="success"
|
|
26
|
-
title="提交成功"
|
|
27
|
-
subTitle="订单已生成,我们将尽快处理并通过邮件通知你。"
|
|
28
|
-
extra={
|
|
29
|
-
<>
|
|
30
|
-
<Button>查看订单</Button>
|
|
31
|
-
<Button variant="outline">返回首页</Button>
|
|
32
|
-
</>
|
|
33
|
-
}
|
|
34
|
-
/>
|
|
35
|
-
),
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const Error500: Story = {
|
|
39
|
-
parameters: { controls: { disable: true } },
|
|
40
|
-
render: () => (
|
|
41
|
-
<Result
|
|
42
|
-
status="500"
|
|
43
|
-
title="服务异常"
|
|
44
|
-
subTitle="抱歉,系统出错了。请稍后重试或联系管理员。"
|
|
45
|
-
extra={<Button>返回首页</Button>}
|
|
46
|
-
/>
|
|
47
|
-
),
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const NotFound: Story = {
|
|
51
|
-
parameters: { controls: { disable: true } },
|
|
52
|
-
render: () => (
|
|
53
|
-
<Result
|
|
54
|
-
status="404"
|
|
55
|
-
title="页面不存在"
|
|
56
|
-
subTitle="你访问的页面已被移除或不存在。"
|
|
57
|
-
extra={<Button>返回首页</Button>}
|
|
58
|
-
/>
|
|
59
|
-
),
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const Forbidden: Story = {
|
|
63
|
-
parameters: { controls: { disable: true } },
|
|
64
|
-
render: () => (
|
|
65
|
-
<Result status="403" title="无权访问" subTitle="联系管理员申请访问权限。" />
|
|
66
|
-
),
|
|
67
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { AlertCircle, CheckCircle2, Info, XCircle } from 'lucide-react';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/utils/cn';
|
|
5
|
-
|
|
6
|
-
export type ResultStatus =
|
|
7
|
-
| 'success'
|
|
8
|
-
| 'error'
|
|
9
|
-
| 'info'
|
|
10
|
-
| 'warning'
|
|
11
|
-
| '404'
|
|
12
|
-
| '403'
|
|
13
|
-
| '500';
|
|
14
|
-
|
|
15
|
-
const iconMap = {
|
|
16
|
-
success: { Icon: CheckCircle2, color: 'text-success' },
|
|
17
|
-
error: { Icon: XCircle, color: 'text-destructive' },
|
|
18
|
-
info: { Icon: Info, color: 'text-info' },
|
|
19
|
-
warning: { Icon: AlertCircle, color: 'text-warning' },
|
|
20
|
-
'404': { Icon: AlertCircle, color: 'text-muted-foreground' },
|
|
21
|
-
'403': { Icon: AlertCircle, color: 'text-muted-foreground' },
|
|
22
|
-
'500': { Icon: AlertCircle, color: 'text-destructive' },
|
|
23
|
-
} as const;
|
|
24
|
-
|
|
25
|
-
const codeText = {
|
|
26
|
-
'404': '404',
|
|
27
|
-
'403': '403',
|
|
28
|
-
'500': '500',
|
|
29
|
-
} as const;
|
|
30
|
-
|
|
31
|
-
export interface ResultProps
|
|
32
|
-
extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
33
|
-
/**
|
|
34
|
-
* 状态类型 — 决定默认图标和配色;`404 / 403 / 500` 显示大字号错误码代替图标。
|
|
35
|
-
* @default "info"
|
|
36
|
-
*/
|
|
37
|
-
status?: ResultStatus;
|
|
38
|
-
/** 自定义图标(覆盖默认)。 */
|
|
39
|
-
icon?: React.ReactNode;
|
|
40
|
-
/** 标题。 */
|
|
41
|
-
title?: React.ReactNode;
|
|
42
|
-
/** 副标题(描述)。 */
|
|
43
|
-
subTitle?: React.ReactNode;
|
|
44
|
-
/** 操作区(放 Button)。 */
|
|
45
|
-
extra?: React.ReactNode;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const Result = React.forwardRef<HTMLDivElement, ResultProps>(
|
|
49
|
-
(
|
|
50
|
-
{
|
|
51
|
-
status = 'info',
|
|
52
|
-
icon,
|
|
53
|
-
title,
|
|
54
|
-
subTitle,
|
|
55
|
-
extra,
|
|
56
|
-
className,
|
|
57
|
-
children,
|
|
58
|
-
...props
|
|
59
|
-
},
|
|
60
|
-
ref,
|
|
61
|
-
) => {
|
|
62
|
-
const { Icon, color } = iconMap[status];
|
|
63
|
-
const isCode = status === '404' || status === '403' || status === '500';
|
|
64
|
-
return (
|
|
65
|
-
<div
|
|
66
|
-
ref={ref}
|
|
67
|
-
className={cn(
|
|
68
|
-
'flex flex-col items-center gap-4 px-6 py-12 text-center',
|
|
69
|
-
className,
|
|
70
|
-
)}
|
|
71
|
-
{...props}
|
|
72
|
-
>
|
|
73
|
-
{icon ? (
|
|
74
|
-
<div className="text-6xl">{icon}</div>
|
|
75
|
-
) : isCode ? (
|
|
76
|
-
<div className={cn('text-7xl font-bold', color)}>
|
|
77
|
-
{codeText[status as '404' | '403' | '500']}
|
|
78
|
-
</div>
|
|
79
|
-
) : (
|
|
80
|
-
<Icon className={cn('size-16', color)} aria-hidden="true" />
|
|
81
|
-
)}
|
|
82
|
-
{title ? <h2 className="text-2xl font-semibold">{title}</h2> : null}
|
|
83
|
-
{subTitle ? (
|
|
84
|
-
<p className="max-w-prose text-xs text-muted-foreground">
|
|
85
|
-
{subTitle}
|
|
86
|
-
</p>
|
|
87
|
-
) : null}
|
|
88
|
-
{children ? <div className="w-full">{children}</div> : null}
|
|
89
|
-
{extra ? (
|
|
90
|
-
<div className="flex flex-wrap items-center justify-center gap-2">
|
|
91
|
-
{extra}
|
|
92
|
-
</div>
|
|
93
|
-
) : null}
|
|
94
|
-
</div>
|
|
95
|
-
);
|
|
96
|
-
},
|
|
97
|
-
);
|
|
98
|
-
Result.displayName = 'Result';
|
|
99
|
-
|
|
100
|
-
export { Result };
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: scroll-area
|
|
3
|
-
name: ScrollArea
|
|
4
|
-
displayName: 滚动区域
|
|
5
|
-
type: component
|
|
6
|
-
category: deprecated
|
|
7
|
-
since: 0.1.0
|
|
8
|
-
package: '@teamix-evo/ui'
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# ScrollArea 滚动区域
|
|
12
|
-
|
|
13
|
-
自定义滚动容器 — Radix ScrollArea。**shadcn-only**(antd 用原生滚动)。
|
|
14
|
-
**核心价值**:跨浏览器一致的滚动条样式 + 触屏友好 + 自动隐藏 thumb。
|
|
15
|
-
|
|
16
|
-
## When to use
|
|
17
|
-
|
|
18
|
-
- 需要一致滚动条样式的容器(列表 / 侧栏 / 抽屉内长内容)
|
|
19
|
-
- 在 Radix Dialog / Sheet 内的可滚动子区域
|
|
20
|
-
- 需要隐藏原生滚动条但保留滚动能力
|
|
21
|
-
|
|
22
|
-
## When NOT to use
|
|
23
|
-
|
|
24
|
-
- 整页滚动 → 用 `<body>` 默认
|
|
25
|
-
- 短内容(< 视口)→ 不需要包装
|
|
26
|
-
|
|
27
|
-
## Props
|
|
28
|
-
|
|
29
|
-
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。
|
|
30
|
-
|
|
31
|
-
<!-- auto:props:begin -->
|
|
32
|
-
_(no props)_
|
|
33
|
-
<!-- auto:props:end -->
|
|
34
|
-
|
|
35
|
-
## 依赖
|
|
36
|
-
|
|
37
|
-
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
|
|
38
|
-
|
|
39
|
-
<!-- auto:deps:begin -->
|
|
40
|
-
### 同库依赖
|
|
41
|
-
|
|
42
|
-
> `teamix-evo ui add scroll-area` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
43
|
-
|
|
44
|
-
| Entry | 类型 | 描述 |
|
|
45
|
-
| --- | --- | --- |
|
|
46
|
-
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
47
|
-
|
|
48
|
-
### npm 依赖
|
|
49
|
-
|
|
50
|
-
> 业务侧需要先 `pnpm add` / `npm install` 这些包。CLI 在 `ui add` 完成后会列出此提示。
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
pnpm add @radix-ui/react-scroll-area@^1.2.0
|
|
54
|
-
```
|
|
55
|
-
<!-- auto:deps:end -->
|
|
56
|
-
|
|
57
|
-
> 子组件:`ScrollArea`(主容器,内置 Viewport + ScrollBar 组合)/ `ScrollBar`(独立 ScrollBar,需要自定义双向滚动时使用)。
|
|
58
|
-
|
|
59
|
-
## AI 生成纪律
|
|
60
|
-
|
|
61
|
-
- **必给容器固定高度**:ScrollArea 不会自动撑满父级,要么 `h-*` / `max-h-*`,要么父级 flex 撑开
|
|
62
|
-
- **`type` 控制行为**:`auto`(默认,内容溢出才显示)/ `always`(常驻)/ `scroll`(交互后显示)/ `hover`(hover 时显示)
|
|
63
|
-
- **横向滚动需独立 ScrollBar**:`<ScrollBar orientation="horizontal" />` 加在 `<ScrollArea>` 内
|
|
64
|
-
- **不嵌套 ScrollArea**:嵌套滚动会让 thumb 行为混乱
|
|
65
|
-
|
|
66
|
-
## Examples
|
|
67
|
-
|
|
68
|
-
```tsx
|
|
69
|
-
import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area';
|
|
70
|
-
|
|
71
|
-
// 纵向(默认)
|
|
72
|
-
<ScrollArea className="h-72 w-48 rounded-md border p-4">
|
|
73
|
-
{Array.from({ length: 50 }).map((_, i) => (
|
|
74
|
-
<div key={i} className="text-sm">第 {i + 1} 行</div>
|
|
75
|
-
))}
|
|
76
|
-
</ScrollArea>
|
|
77
|
-
|
|
78
|
-
// 横向 + 纵向
|
|
79
|
-
<ScrollArea className="h-72 w-96 whitespace-nowrap rounded-md border">
|
|
80
|
-
<div className="flex w-max gap-4 p-4">
|
|
81
|
-
{items.map((it) => <div key={it.id} className="size-32 shrink-0">...</div>)}
|
|
82
|
-
</div>
|
|
83
|
-
<ScrollBar orientation="horizontal" />
|
|
84
|
-
</ScrollArea>
|
|
85
|
-
```
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { ScrollArea, ScrollBar } from './scroll-area';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof ScrollArea> = {
|
|
5
|
-
title: '废弃 · Deprecated/ScrollArea',
|
|
6
|
-
component: ScrollArea,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component:
|
|
12
|
-
'⚠️ **已废弃** — 仅 Storybook 留档,不通过 manifest 对外发布。\n\n自定义滚动容器 — 基于 Radix ScrollArea,跨浏览器一致的滚动条样式 + 触屏友好 + 自动隐藏 thumb。shadcn 专有,antd 用原生滚动。',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof ScrollArea>;
|
|
20
|
-
|
|
21
|
-
export const Vertical: Story = {
|
|
22
|
-
render: () => (
|
|
23
|
-
<ScrollArea className="h-72 w-48 rounded-md border border-border p-4">
|
|
24
|
-
{Array.from({ length: 50 }).map((_, i) => (
|
|
25
|
-
<div key={i} className="py-1 text-sm">
|
|
26
|
-
第 {i + 1} 行
|
|
27
|
-
</div>
|
|
28
|
-
))}
|
|
29
|
-
</ScrollArea>
|
|
30
|
-
),
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const Horizontal: Story = {
|
|
34
|
-
render: () => (
|
|
35
|
-
<ScrollArea className="w-96 whitespace-nowrap rounded-md border border-border">
|
|
36
|
-
<div className="flex w-max gap-4 p-4">
|
|
37
|
-
{Array.from({ length: 12 }).map((_, i) => (
|
|
38
|
-
<div
|
|
39
|
-
key={i}
|
|
40
|
-
className="flex size-32 shrink-0 items-center justify-center rounded-md bg-muted text-sm text-muted-foreground"
|
|
41
|
-
>
|
|
42
|
-
#{i + 1}
|
|
43
|
-
</div>
|
|
44
|
-
))}
|
|
45
|
-
</div>
|
|
46
|
-
<ScrollBar orientation="horizontal" />
|
|
47
|
-
</ScrollArea>
|
|
48
|
-
),
|
|
49
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/utils/cn';
|
|
5
|
-
|
|
6
|
-
export interface ScrollAreaProps
|
|
7
|
-
extends React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> {}
|
|
8
|
-
|
|
9
|
-
const ScrollArea = React.forwardRef<
|
|
10
|
-
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
11
|
-
ScrollAreaProps
|
|
12
|
-
>(({ className, children, ...props }, ref) => (
|
|
13
|
-
<ScrollAreaPrimitive.Root
|
|
14
|
-
ref={ref}
|
|
15
|
-
className={cn('relative overflow-hidden', className)}
|
|
16
|
-
{...props}
|
|
17
|
-
>
|
|
18
|
-
<ScrollAreaPrimitive.Viewport className="size-full rounded-inherit">
|
|
19
|
-
{children}
|
|
20
|
-
</ScrollAreaPrimitive.Viewport>
|
|
21
|
-
<ScrollBar />
|
|
22
|
-
<ScrollAreaPrimitive.Corner />
|
|
23
|
-
</ScrollAreaPrimitive.Root>
|
|
24
|
-
));
|
|
25
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
26
|
-
|
|
27
|
-
const ScrollBar = React.forwardRef<
|
|
28
|
-
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
29
|
-
React.ComponentPropsWithoutRef<
|
|
30
|
-
typeof ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
31
|
-
>
|
|
32
|
-
>(({ className, orientation = 'vertical', ...props }, ref) => (
|
|
33
|
-
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
34
|
-
ref={ref}
|
|
35
|
-
orientation={orientation}
|
|
36
|
-
className={cn(
|
|
37
|
-
'flex touch-none select-none transition-colors',
|
|
38
|
-
orientation === 'vertical' &&
|
|
39
|
-
'h-full w-2.5 border-l border-l-transparent p-px',
|
|
40
|
-
orientation === 'horizontal' &&
|
|
41
|
-
'h-2.5 flex-col border-t border-t-transparent p-px',
|
|
42
|
-
className,
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
|
47
|
-
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
48
|
-
));
|
|
49
|
-
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
50
|
-
|
|
51
|
-
export { ScrollArea, ScrollBar };
|