@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,145 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Label } from './label';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Label> = {
|
|
5
|
-
title: '数据录入 · Data Entry/Label',
|
|
6
|
-
component: Label,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component:
|
|
12
|
-
'表单字段标签 —— 标记并描述表单控件的文本入口。Radix Label 实现 + 工程化扩展并集:`disabled` 显式禁用态(脱离 peer 也工作)、`required` 后置红色 `*`(顺序为 `文字 ⓘ *`,对齐设计规范)、`tooltip` 文字后 info icon hover 提示(对齐 antd `Form.Item.tooltip`)、`maxWidth` / `minWidth` 宽度约束 + `truncate` 省略号(应对长字段名固定栅格表单场景)。视觉走 OpenTrek semantic tokens,所有样式来自 `@teamix-evo/design`,无 mock。',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
argTypes: {
|
|
17
|
-
disabled: {
|
|
18
|
-
description: '视觉禁用态(脱离 peer 也工作)',
|
|
19
|
-
control: 'boolean',
|
|
20
|
-
},
|
|
21
|
-
required: {
|
|
22
|
-
description:
|
|
23
|
-
'必填标记,在文字和 tooltip icon **后**追加红色 `*`(顺序为 `文字 ⓘ *`)',
|
|
24
|
-
control: 'boolean',
|
|
25
|
-
},
|
|
26
|
-
children: {
|
|
27
|
-
description: '标签文本',
|
|
28
|
-
control: 'text',
|
|
29
|
-
},
|
|
30
|
-
tooltip: {
|
|
31
|
-
description: '辅助说明文本,有值时在文字后渲染 info icon + hover tooltip',
|
|
32
|
-
control: 'text',
|
|
33
|
-
},
|
|
34
|
-
tooltipSide: {
|
|
35
|
-
description: 'tooltip 弹出方向',
|
|
36
|
-
control: 'inline-radio',
|
|
37
|
-
options: ['top', 'right', 'bottom', 'left'],
|
|
38
|
-
},
|
|
39
|
-
maxWidth: {
|
|
40
|
-
description: '最大宽度,超出截断省略号',
|
|
41
|
-
control: 'number',
|
|
42
|
-
},
|
|
43
|
-
minWidth: {
|
|
44
|
-
description: '最小宽度(px)',
|
|
45
|
-
control: 'number',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
args: {
|
|
49
|
-
children: '邮箱',
|
|
50
|
-
htmlFor: 'demo-input',
|
|
51
|
-
disabled: false,
|
|
52
|
-
required: false,
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export default meta;
|
|
57
|
-
type Story = StoryObj<typeof Label>;
|
|
58
|
-
|
|
59
|
-
/** 默认 Label,可在 Controls 调 `required` / `disabled` 等 props。 */
|
|
60
|
-
export const Playground: Story = {};
|
|
61
|
-
|
|
62
|
-
/** 必填态:文字和 tooltip icon **后**追加红色 `*`(顺序为 `文字 ⓘ *`,语义来自 design destructive token,对齐设计规范,不要手写颜色)。 */
|
|
63
|
-
export const Required: Story = {
|
|
64
|
-
args: { children: '用户名', required: true },
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/** 对比:仅视觉示范必填 vs 非必填。 */
|
|
68
|
-
export const RequiredComparison: Story = {
|
|
69
|
-
parameters: { controls: { disable: true } },
|
|
70
|
-
render: () => (
|
|
71
|
-
<div className="flex flex-col gap-3">
|
|
72
|
-
<Label htmlFor="req-1" required>
|
|
73
|
-
必填字段
|
|
74
|
-
</Label>
|
|
75
|
-
<Label htmlFor="req-2">可选字段</Label>
|
|
76
|
-
</div>
|
|
77
|
-
),
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
/** 禁用态:文字 70% 透明 + cursor-not-allowed。 */
|
|
81
|
-
export const Disabled: Story = {
|
|
82
|
-
args: { children: '只读字段', disabled: true },
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
/** 与 input 配合(实际项目中最常用形态)。 */
|
|
86
|
-
export const WithInput: Story = {
|
|
87
|
-
parameters: { controls: { disable: true } },
|
|
88
|
-
render: () => (
|
|
89
|
-
<div className="flex flex-col gap-2">
|
|
90
|
-
<Label htmlFor="email-with-input" required>
|
|
91
|
-
邮箱
|
|
92
|
-
</Label>
|
|
93
|
-
<input
|
|
94
|
-
id="email-with-input"
|
|
95
|
-
type="email"
|
|
96
|
-
aria-required="true"
|
|
97
|
-
placeholder="you@example.com"
|
|
98
|
-
className="rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
99
|
-
/>
|
|
100
|
-
</div>
|
|
101
|
-
),
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
/** Peer 联动:input 禁用时 Label 自动响应(无需显式 `disabled` prop)。 */
|
|
105
|
-
export const PeerDisabled: Story = {
|
|
106
|
-
parameters: { controls: { disable: true } },
|
|
107
|
-
render: () => (
|
|
108
|
-
<div className="flex flex-col gap-2">
|
|
109
|
-
<input
|
|
110
|
-
id="peer-input"
|
|
111
|
-
disabled
|
|
112
|
-
placeholder="disabled input"
|
|
113
|
-
className="peer rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm"
|
|
114
|
-
/>
|
|
115
|
-
<Label htmlFor="peer-input">peer-disabled 自动响应</Label>
|
|
116
|
-
</div>
|
|
117
|
-
),
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
/** 带 tooltip:文字后跟随 info icon,hover 触发气泡说明,对齐 antd `Form.Item.tooltip`。 */
|
|
121
|
-
export const WithTooltip: Story = {
|
|
122
|
-
args: {
|
|
123
|
-
children: '客户编号',
|
|
124
|
-
tooltip: '由系统自动生成的全局唯一编号,提交后不可修改',
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
/** 截断:当字段名过长且布局栅格固定时,使用 `maxWidth` 触发 truncate 省略号。 */
|
|
129
|
-
export const Truncated: Story = {
|
|
130
|
-
args: {
|
|
131
|
-
children: '这是一段非常非常非常长的字段标签文本',
|
|
132
|
-
maxWidth: 160,
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
/** 全特性组合:required 红 `*` + tooltip info icon + maxWidth 截断(典型业务表单形态)。 */
|
|
137
|
-
export const WithAllFeatures: Story = {
|
|
138
|
-
args: {
|
|
139
|
-
children: '这是一段需要被截断的必填字段标签',
|
|
140
|
-
required: true,
|
|
141
|
-
tooltip: '该字段必填,长度限制 32 字符;超出栅格宽度自动省略,hover label 看完整文案。',
|
|
142
|
-
tooltipSide: 'right',
|
|
143
|
-
maxWidth: 200,
|
|
144
|
-
},
|
|
145
|
-
};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
3
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
-
import { Info } from 'lucide-react';
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/utils/cn';
|
|
7
|
-
import {
|
|
8
|
-
TooltipContent,
|
|
9
|
-
TooltipProvider,
|
|
10
|
-
TooltipRoot,
|
|
11
|
-
TooltipTrigger,
|
|
12
|
-
} from '@/components/tooltip/tooltip';
|
|
13
|
-
|
|
14
|
-
const labelVariants = cva(
|
|
15
|
-
'text-xs font-medium leading-8 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
|
|
16
|
-
{
|
|
17
|
-
variants: {
|
|
18
|
-
disabled: {
|
|
19
|
-
true: 'cursor-not-allowed opacity-70',
|
|
20
|
-
false: '',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
defaultVariants: {
|
|
24
|
-
disabled: false,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
export interface LabelProps
|
|
30
|
-
extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,
|
|
31
|
-
VariantProps<typeof labelVariants> {
|
|
32
|
-
/**
|
|
33
|
-
* 视觉禁用态。除原生 `peer-disabled:` 联动外,显式置 `true` 也会触发禁用样式;
|
|
34
|
-
* 适合 label 与目标控件不直接相邻、无法走 `peer` 约束的场景。
|
|
35
|
-
* @default false
|
|
36
|
-
*/
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* 必填标记。`true` 时在 children 与 info icon **后**追加红色 `*`
|
|
40
|
-
* (语义来自 design destructive token);顺序为 `文字 ⓘ *`,三者间距 4px。
|
|
41
|
-
* 配合 `aria-required` 在 input 上一起使用以保证可访问性。
|
|
42
|
-
* @default false
|
|
43
|
-
*/
|
|
44
|
-
required?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* 辅助说明文本 — 有值时在 label 文字后渲染 info icon + hover tooltip
|
|
47
|
-
* (对齐 antd `Form.Item.tooltip` 习惯)。
|
|
48
|
-
*/
|
|
49
|
-
tooltip?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Tooltip 弹出方向。
|
|
52
|
-
* @default 'top'
|
|
53
|
-
*/
|
|
54
|
-
tooltipSide?: 'top' | 'right' | 'bottom' | 'left';
|
|
55
|
-
/**
|
|
56
|
-
* 最大宽度 — 超出时截断省略号。数字单位为 px,字符串直接用作 CSS 值。
|
|
57
|
-
* 适合长字段名在固定宽度表单中防止换行影响布局。
|
|
58
|
-
* @default undefined
|
|
59
|
-
*/
|
|
60
|
-
maxWidth?: number | string;
|
|
61
|
-
/**
|
|
62
|
-
* 最小宽度(px) — 防止过度压缩,在响应式布局中保留可读宽度下限。
|
|
63
|
-
* @default undefined
|
|
64
|
-
*/
|
|
65
|
-
minWidth?: number;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const Label = React.forwardRef<
|
|
69
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
70
|
-
LabelProps
|
|
71
|
-
>(
|
|
72
|
-
(
|
|
73
|
-
{
|
|
74
|
-
className,
|
|
75
|
-
style,
|
|
76
|
-
disabled = false,
|
|
77
|
-
required = false,
|
|
78
|
-
tooltip,
|
|
79
|
-
tooltipSide = 'top',
|
|
80
|
-
maxWidth,
|
|
81
|
-
minWidth,
|
|
82
|
-
children,
|
|
83
|
-
...props
|
|
84
|
-
},
|
|
85
|
-
ref,
|
|
86
|
-
) => {
|
|
87
|
-
const mergedStyle: React.CSSProperties = {
|
|
88
|
-
...style,
|
|
89
|
-
...(maxWidth !== undefined && {
|
|
90
|
-
maxWidth: typeof maxWidth === 'number' ? `${maxWidth}px` : maxWidth,
|
|
91
|
-
}),
|
|
92
|
-
...(minWidth !== undefined && { minWidth: `${minWidth}px` }),
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<LabelPrimitive.Root
|
|
97
|
-
ref={ref}
|
|
98
|
-
data-required={required ? '' : undefined}
|
|
99
|
-
style={mergedStyle}
|
|
100
|
-
className={cn(
|
|
101
|
-
labelVariants({ disabled }),
|
|
102
|
-
maxWidth !== undefined && 'truncate',
|
|
103
|
-
className,
|
|
104
|
-
)}
|
|
105
|
-
{...props}
|
|
106
|
-
>
|
|
107
|
-
<span className="inline-flex items-center gap-1 align-middle">
|
|
108
|
-
<span className={cn(maxWidth !== undefined && 'truncate')}>
|
|
109
|
-
{children}
|
|
110
|
-
</span>
|
|
111
|
-
{tooltip ? (
|
|
112
|
-
<TooltipProvider delayDuration={200}>
|
|
113
|
-
<TooltipRoot>
|
|
114
|
-
<TooltipTrigger asChild>
|
|
115
|
-
<Info
|
|
116
|
-
className="size-3.5 shrink-0 cursor-help text-muted-foreground transition-colors hover:text-foreground"
|
|
117
|
-
aria-hidden="true"
|
|
118
|
-
/>
|
|
119
|
-
</TooltipTrigger>
|
|
120
|
-
<TooltipContent side={tooltipSide}>
|
|
121
|
-
<p className="max-w-xs text-xs">{tooltip}</p>
|
|
122
|
-
</TooltipContent>
|
|
123
|
-
</TooltipRoot>
|
|
124
|
-
</TooltipProvider>
|
|
125
|
-
) : null}
|
|
126
|
-
{required ? (
|
|
127
|
-
<span className="shrink-0 text-destructive" aria-hidden="true">
|
|
128
|
-
*
|
|
129
|
-
</span>
|
|
130
|
-
) : null}
|
|
131
|
-
</span>
|
|
132
|
-
</LabelPrimitive.Root>
|
|
133
|
-
);
|
|
134
|
-
},
|
|
135
|
-
);
|
|
136
|
-
Label.displayName = 'Label';
|
|
137
|
-
|
|
138
|
-
export { Label, labelVariants };
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: masonry
|
|
3
|
-
name: Masonry
|
|
4
|
-
displayName: 瀑布流
|
|
5
|
-
type: component
|
|
6
|
-
category: deprecated
|
|
7
|
-
since: 0.1.0
|
|
8
|
-
package: '@teamix-evo/ui'
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Masonry 瀑布流
|
|
12
|
-
|
|
13
|
-
瀑布流 — antd 独有补足。**等价 antd `Masonry`**(v6.0 新)。基于 CSS `column-count` + `break-inside: avoid` 的纯 CSS 实现 — **0 JS、SSR 友好、自动按 children 高度填充列**。
|
|
14
|
-
|
|
15
|
-
## When to use
|
|
16
|
-
|
|
17
|
-
- 图片墙 / Pinterest 风格的相册
|
|
18
|
-
- 博客 / 资讯卡片流(每张卡高度不一)
|
|
19
|
-
- Dashboard 卡片墙(不同卡片高度差异大)
|
|
20
|
-
|
|
21
|
-
## When NOT to use
|
|
22
|
-
|
|
23
|
-
- 严格等高网格 → `Grid (Row/Col)` / Tailwind `grid grid-cols-N`
|
|
24
|
-
- 严格视觉对齐(按"哪列最矮就填哪列")→ 用 JS-driven masonry(react-masonry-css)
|
|
25
|
-
- 等宽等高数据流 → `List grid={{column:N}}` / `Item` + Tailwind grid
|
|
26
|
-
|
|
27
|
-
## Props
|
|
28
|
-
|
|
29
|
-
<!-- auto:props:begin -->
|
|
30
|
-
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
31
|
-
| --- | --- | --- | --- | --- |
|
|
32
|
-
| `columns` | `number` | `3` | – | 列数(antd `columns` 并集) — 固定值或响应式断点配置 `{ default, sm, md, lg, xl }`。 **响应式注意**:本组件用 CSS `column-count`,断点匹配靠 Tailwind `@container` 不便, 简化为 fixed 列数。响应式建议直接在外层包 className(如 `md:columns-3 columns-2`)+ `columns={undefined}`。 |
|
|
33
|
-
| `gap` | `number` | `16` | – | 列间距(像素)。 |
|
|
34
|
-
<!-- auto:props:end -->
|
|
35
|
-
|
|
36
|
-
## 依赖
|
|
37
|
-
|
|
38
|
-
<!-- auto:deps:begin -->
|
|
39
|
-
### 同库依赖
|
|
40
|
-
|
|
41
|
-
> `teamix-evo ui add masonry` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
42
|
-
|
|
43
|
-
| Entry | 类型 | 描述 |
|
|
44
|
-
| --- | --- | --- |
|
|
45
|
-
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
46
|
-
|
|
47
|
-
### npm 依赖
|
|
48
|
-
|
|
49
|
-
_无 — 本组件不依赖任何 npm 包。_
|
|
50
|
-
<!-- auto:deps:end -->
|
|
51
|
-
|
|
52
|
-
## AI 生成纪律
|
|
53
|
-
|
|
54
|
-
- **子项填充顺序**:CSS columns 是**自上而下、自左而右一列填完再到下一列**(不像 JS masonry 选最矮列)— 对内容流 OK,对严格视觉对齐不适用
|
|
55
|
-
- **`columns` 是固定值**:响应式建议外层包 Tailwind `md:columns-3 columns-2` + 本组件传 `columns={undefined}` 让 CSS class 接管
|
|
56
|
-
- **每个子项最好独立卡片化**(rounded-md / border / shadow),不要嵌套裸文本 — column-break 在裸文本上会断行不优雅
|
|
57
|
-
- **不要给子项设 fixed height**:Masonry 的核心价值就是按自然高度填充;如需等高直接用 Grid
|
|
58
|
-
- **图片项务必设 `width=100%`**:否则会按原图宽度撑破列宽
|
|
59
|
-
|
|
60
|
-
## Examples
|
|
61
|
-
|
|
62
|
-
```tsx
|
|
63
|
-
import { Masonry } from '@/components/ui/masonry';
|
|
64
|
-
|
|
65
|
-
// 基础
|
|
66
|
-
<Masonry columns={3} gap={16}>
|
|
67
|
-
{photos.map((p) => (
|
|
68
|
-
<img key={p.id} src={p.url} alt={p.alt} className="w-full rounded-md" />
|
|
69
|
-
))}
|
|
70
|
-
</Masonry>
|
|
71
|
-
|
|
72
|
-
// 卡片墙
|
|
73
|
-
<Masonry columns={4} gap={12}>
|
|
74
|
-
{cards.map((c) => (
|
|
75
|
-
<Card key={c.id}>
|
|
76
|
-
<CardHeader><CardTitle>{c.title}</CardTitle></CardHeader>
|
|
77
|
-
<CardContent>{c.body}</CardContent>
|
|
78
|
-
</Card>
|
|
79
|
-
))}
|
|
80
|
-
</Masonry>
|
|
81
|
-
|
|
82
|
-
// 响应式(外层 className 控制列数,组件不强加)
|
|
83
|
-
<div className="columns-2 md:columns-3 lg:columns-4">
|
|
84
|
-
{items.map((it) => (
|
|
85
|
-
<div key={it.id} className="mb-4 break-inside-avoid">
|
|
86
|
-
<Card>{it.content}</Card>
|
|
87
|
-
</div>
|
|
88
|
-
))}
|
|
89
|
-
</div>
|
|
90
|
-
```
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Masonry } from './masonry';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Masonry> = {
|
|
5
|
-
title: '废弃 · Deprecated/Masonry',
|
|
6
|
-
component: Masonry,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component:
|
|
12
|
-
'⚠️ **已废弃** — 仅 Storybook 留档,不通过 manifest 对外发布。\n\n瀑布流 — CSS column-count + break-inside: avoid 的 0 JS 实现(图片墙 / 资讯卡片流 / Dashboard 卡片墙)。等价 antd `Masonry`(v6.0 新)。响应式建议外层 className 控制。',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
argTypes: {
|
|
17
|
-
columns: { control: { type: 'number', min: 1, max: 6 } },
|
|
18
|
-
gap: { control: { type: 'number', min: 0, max: 48 } },
|
|
19
|
-
},
|
|
20
|
-
args: { columns: 3, gap: 16 },
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default meta;
|
|
24
|
-
type Story = StoryObj<typeof Masonry>;
|
|
25
|
-
|
|
26
|
-
const cards = Array.from({ length: 12 }).map((_, i) => ({
|
|
27
|
-
id: i,
|
|
28
|
-
h: 80 + ((i * 37) % 180),
|
|
29
|
-
text: `卡片 ${i + 1}`,
|
|
30
|
-
}));
|
|
31
|
-
|
|
32
|
-
export const Playground: Story = {
|
|
33
|
-
render: (args) => (
|
|
34
|
-
<Masonry {...args} className="w-full">
|
|
35
|
-
{cards.map((c) => (
|
|
36
|
-
<div
|
|
37
|
-
key={c.id}
|
|
38
|
-
className="flex items-center justify-center rounded-md border border-border bg-card text-sm"
|
|
39
|
-
style={{ height: c.h }}
|
|
40
|
-
>
|
|
41
|
-
{c.text}({c.h}px)
|
|
42
|
-
</div>
|
|
43
|
-
))}
|
|
44
|
-
</Masonry>
|
|
45
|
-
),
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const ColorfulPhotos: Story = {
|
|
49
|
-
parameters: { controls: { disable: true } },
|
|
50
|
-
render: () => (
|
|
51
|
-
<Masonry columns={4} gap={12} className="w-full">
|
|
52
|
-
{cards.map((c) => (
|
|
53
|
-
<div
|
|
54
|
-
key={c.id}
|
|
55
|
-
className="rounded-md bg-muted text-center text-xs text-muted-foreground"
|
|
56
|
-
style={{
|
|
57
|
-
height: c.h,
|
|
58
|
-
background: `linear-gradient(135deg, hsl(${
|
|
59
|
-
(c.id * 30) % 360
|
|
60
|
-
}, 60%, 70%), hsl(${(c.id * 30 + 60) % 360}, 60%, 50%))`,
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
63
|
-
<span className="block py-2 text-white/90">photo {c.id + 1}</span>
|
|
64
|
-
</div>
|
|
65
|
-
))}
|
|
66
|
-
</Masonry>
|
|
67
|
-
),
|
|
68
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@/utils/cn';
|
|
4
|
-
|
|
5
|
-
export interface MasonryProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
/**
|
|
7
|
-
* 列数(antd `columns` 并集) — 固定值或响应式断点配置 `{ default, sm, md, lg, xl }`。
|
|
8
|
-
*
|
|
9
|
-
* **响应式注意**:本组件用 CSS `column-count`,断点匹配靠 Tailwind `@container` 不便,
|
|
10
|
-
* 简化为 fixed 列数。响应式建议直接在外层包 className(如 `md:columns-3 columns-2`)+ `columns={undefined}`。
|
|
11
|
-
* @default 3
|
|
12
|
-
*/
|
|
13
|
-
columns?: number;
|
|
14
|
-
/**
|
|
15
|
-
* 列间距(像素)。
|
|
16
|
-
* @default 16
|
|
17
|
-
*/
|
|
18
|
-
gap?: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 瀑布流 — antd 独有补足。**等价 antd `Masonry`**(v6.0 新)。基于 CSS `column-count`
|
|
23
|
-
* + `break-inside: avoid` 的纯 CSS 实现 — 0 JS、SSR 友好、自动按 children 高度填充列。
|
|
24
|
-
*
|
|
25
|
-
* **局限**(对齐 CSS columns 的固有限制):
|
|
26
|
-
* - 子项按 **DOM 顺序**填充列(自上而下、自左而右一列填完再到下一列)
|
|
27
|
-
* - 不像 JS-driven masonry(react-masonry-css / Pinterest 风格)那样按"哪列最矮就填哪列"
|
|
28
|
-
* - 适合内容流(博客、相册),不适合严格视觉对齐的场景
|
|
29
|
-
*/
|
|
30
|
-
const Masonry = React.forwardRef<HTMLDivElement, MasonryProps>(
|
|
31
|
-
({ columns = 3, gap = 16, className, children, style, ...props }, ref) => {
|
|
32
|
-
const items = React.Children.toArray(children).filter(Boolean);
|
|
33
|
-
return (
|
|
34
|
-
<div
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={cn('block', className)}
|
|
37
|
-
style={{
|
|
38
|
-
columnCount: columns,
|
|
39
|
-
columnGap: `${gap}px`,
|
|
40
|
-
...style,
|
|
41
|
-
}}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
{items.map((child, i) => (
|
|
45
|
-
<div
|
|
46
|
-
key={i}
|
|
47
|
-
// eslint-disable-next-line teamix-evo/no-arbitrary-tw-value -- runtime CSS var driven by `gap` prop; consumes per-instance var, not tokenizable.
|
|
48
|
-
className="mb-[var(--masonry-gap)] break-inside-avoid"
|
|
49
|
-
style={{ ['--masonry-gap' as string]: `${gap}px` }}
|
|
50
|
-
>
|
|
51
|
-
{child}
|
|
52
|
-
</div>
|
|
53
|
-
))}
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
},
|
|
57
|
-
);
|
|
58
|
-
Masonry.displayName = 'Masonry';
|
|
59
|
-
|
|
60
|
-
export { Masonry };
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: mentions
|
|
3
|
-
name: Mentions
|
|
4
|
-
displayName: 提及
|
|
5
|
-
type: component
|
|
6
|
-
category: deprecated
|
|
7
|
-
since: 0.1.0
|
|
8
|
-
package: '@teamix-evo/ui'
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Mentions 提及
|
|
12
|
-
|
|
13
|
-
@提及 — antd 独有补足。在 Textarea 中输入 `@`(或自定义 `prefix`)即弹出候选下拉,选中后插入 `@name `。键盘 ↑↓ 切换、Enter / Tab 选中、Esc 关闭。**异步候选**用 `onSearch(query)` 由消费方刷新 `options`。
|
|
14
|
-
|
|
15
|
-
## When to use
|
|
16
|
-
|
|
17
|
-
- 评论 / 工单输入框需要 @ 同事、# 话题
|
|
18
|
-
- 任意需要"输入触发字符 → 弹出候选 → 选中插入"的场景
|
|
19
|
-
|
|
20
|
-
## When NOT to use
|
|
21
|
-
|
|
22
|
-
- 全字段候选(下拉选单)→ `Select` / `Combobox`
|
|
23
|
-
- 仅是搜索输入 → `Input` + 业务侧自渲染建议列表
|
|
24
|
-
|
|
25
|
-
## Props
|
|
26
|
-
|
|
27
|
-
<!-- auto:props:begin -->
|
|
28
|
-
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
29
|
-
| --- | --- | --- | --- | --- |
|
|
30
|
-
| `options` | `MentionsOption[]` | – | ✓ | 候选项(antd `options` 并集)。 |
|
|
31
|
-
| `value` | `string` | – | – | 受控值。 |
|
|
32
|
-
| `defaultValue` | `string` | – | – | uncontrolled 初值。 |
|
|
33
|
-
| `onChange` | `(value: string) => void` | – | – | 文本变化回调。 |
|
|
34
|
-
| `prefix` | `string` | `"@"` | – | 触发符(antd `prefix` 并集) — 通常是 `@` 或 `#`。 |
|
|
35
|
-
| `split` | `string` | `" "` | – | 选中候选项后插入文本的尾随分隔(对齐 antd `split` 默认空格)。 |
|
|
36
|
-
| `onSearch` | `(query: string, prefix: string) => void` | – | – | 用户在 prefix 后输入时的搜索回调,用于业务侧异步刷新 `options`。 |
|
|
37
|
-
| `onSelect` | `(option: MentionsOption, prefix: string) => void` | – | – | 选中候选项时回调。 |
|
|
38
|
-
| `rows` | `number` | `3` | – | 文本框尺寸传透传 Textarea(行数)。 |
|
|
39
|
-
| `disabled` | `boolean` | – | – | 禁用。 |
|
|
40
|
-
<!-- auto:props:end -->
|
|
41
|
-
|
|
42
|
-
## 依赖
|
|
43
|
-
|
|
44
|
-
<!-- auto:deps:begin -->
|
|
45
|
-
### 同库依赖
|
|
46
|
-
|
|
47
|
-
> `teamix-evo ui add mentions` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
48
|
-
|
|
49
|
-
| Entry | 类型 | 描述 |
|
|
50
|
-
| --- | --- | --- |
|
|
51
|
-
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
52
|
-
| `input` | component | 文本输入合集 — Input(单行 + prefix/suffix/clearable/showCount/addonBefore/addonAfter/size)+ Textarea(多行 + autoSize)+ InputGroup 系列(InputGroupAddon / InputGroupInput / InputGroupTextarea)三件合一,size 与 Button 同档(sm 24 / md 32 / lg 36) |
|
|
53
|
-
|
|
54
|
-
### npm 依赖
|
|
55
|
-
|
|
56
|
-
_无 — 本组件不依赖任何 npm 包。_
|
|
57
|
-
<!-- auto:deps:end -->
|
|
58
|
-
|
|
59
|
-
## AI 生成纪律
|
|
60
|
-
|
|
61
|
-
- **`onSearch` 是异步刷新点**:`options` 由消费方根据 `query` 拉接口刷新,组件本身不内置网络层
|
|
62
|
-
- **`prefix` 必须是单字符**(`@` / `#` / `/` 等)— 多字符触发会与正文混淆
|
|
63
|
-
- **不要在 `onSelect` 里改 `value`** — 组件已经替消费方插入并触发了 `onChange`
|
|
64
|
-
- **email 不会误触**:`a@b` 中 `@` 前是字母,组件不会把它当作触发符;触发符前必须是空白或行首
|
|
65
|
-
- **键盘冲突**:Enter 在候选打开时被消费(选中候选),关闭时回归原生换行 — 这是预期
|
|
66
|
-
- **大候选列表**(> 100 项)请在 `onSearch` 中做服务端筛选,组件不内置虚拟化
|
|
67
|
-
|
|
68
|
-
## Examples
|
|
69
|
-
|
|
70
|
-
```tsx
|
|
71
|
-
import { Mentions } from '@/components/ui/mentions';
|
|
72
|
-
import * as React from 'react';
|
|
73
|
-
|
|
74
|
-
const users = [
|
|
75
|
-
{ value: 'alice', label: 'Alice (前端)' },
|
|
76
|
-
{ value: 'bob', label: 'Bob (后端)' },
|
|
77
|
-
{ value: 'carol', label: 'Carol (设计)' },
|
|
78
|
-
];
|
|
79
|
-
|
|
80
|
-
// 静态候选
|
|
81
|
-
<Mentions options={users} placeholder="输入 @ 提及同事..." />;
|
|
82
|
-
|
|
83
|
-
// 异步候选
|
|
84
|
-
const [opts, setOpts] = React.useState(users);
|
|
85
|
-
<Mentions
|
|
86
|
-
options={opts}
|
|
87
|
-
onSearch={async (q) => {
|
|
88
|
-
const list = await fetchUsers(q);
|
|
89
|
-
setOpts(list);
|
|
90
|
-
}}
|
|
91
|
-
/>;
|
|
92
|
-
|
|
93
|
-
// 双触发符:@ + # — 当前组件支持单 prefix,如需多触发请实例化两个 Mentions
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Mentions 形态 — 旧库无此组件
|
|
99
|
-
|
|
100
|
-
> 旧库(hybridcloud)不含 Mentions;本组件为**新库独有**,对齐 antd `Mentions` API 形态。
|
|
101
|
-
> 基于内置 Textarea + 自绘候选列表(无 portal);用 `prefix` 触发、`onSearch` 异步刷新、`onSelect` 埋点。
|
|
102
|
-
|
|
103
|
-
### antd Mentions 对齐表
|
|
104
|
-
|
|
105
|
-
| antd prop | 新库 prop | 备注 |
|
|
106
|
-
| ------------------- | ------------------ | --------------------------------------- |
|
|
107
|
-
| `options` | `options` | 结构一致 `{ value, label?, disabled? }` |
|
|
108
|
-
| `prefix` | `prefix` | 触发符,单字符 |
|
|
109
|
-
| `split` | `split` | 选中后尾随分隔,默认空格 |
|
|
110
|
-
| `onSearch` | `onSearch` | 异步刷新回调 |
|
|
111
|
-
| `onSelect` | `onSelect` | 选中回调 |
|
|
112
|
-
| `value / onChange` | `value / onChange` | 受控模式 |
|
|
113
|
-
| `defaultValue` | `defaultValue` | 非受控初值 |
|
|
114
|
-
| `disabled` | `disabled` | 整组禁用 |
|
|
115
|
-
| `rows` | `rows` | Textarea 行数(默认 3) |
|
|
116
|
-
| `placement` | 不支持 | 固定 bottom-left(级联层级场景不需调整) |
|
|
117
|
-
| `getPopupContainer` | 不支持 | 无 portal,列表就在组件内 relative 定位 |
|
|
118
|
-
| `filterOption` | 内置 includes | 如需自定义过滤逻辑,请在 onSearch 中做 |
|
|
119
|
-
| `validateSearch` | 不支持 | 低频 |
|