@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,392 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/utils/cn';
|
|
5
|
-
import { Label } from '@/components/label/label';
|
|
6
|
-
import {
|
|
7
|
-
useBreakpoint,
|
|
8
|
-
pickByBreakpoint,
|
|
9
|
-
type ResponsiveValue,
|
|
10
|
-
} from '@/hooks/use-breakpoint';
|
|
11
|
-
|
|
12
|
-
// ─── 类型 ──────────────────────────────────────────────────────────────
|
|
13
|
-
|
|
14
|
-
/** 输入域宽度档位 — 5 档系统,对应 104 / 216 / 328 / 440 / 552 px。 */
|
|
15
|
-
export type InputWidth = 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
16
|
-
|
|
17
|
-
// ─── FieldSet / FieldLegend(分组的语义边框)────────────────────────────
|
|
18
|
-
|
|
19
|
-
const FieldSet = React.forwardRef<
|
|
20
|
-
HTMLFieldSetElement,
|
|
21
|
-
React.FieldsetHTMLAttributes<HTMLFieldSetElement>
|
|
22
|
-
>(({ className, ...props }, ref) => (
|
|
23
|
-
<fieldset
|
|
24
|
-
ref={ref}
|
|
25
|
-
className={cn(
|
|
26
|
-
'flex flex-col gap-4 rounded-md border border-border bg-card p-4 disabled:cursor-not-allowed disabled:opacity-60',
|
|
27
|
-
className,
|
|
28
|
-
)}
|
|
29
|
-
{...props}
|
|
30
|
-
/>
|
|
31
|
-
));
|
|
32
|
-
FieldSet.displayName = 'FieldSet';
|
|
33
|
-
|
|
34
|
-
const FieldLegend = React.forwardRef<
|
|
35
|
-
HTMLLegendElement,
|
|
36
|
-
React.HTMLAttributes<HTMLLegendElement>
|
|
37
|
-
>(({ className, ...props }, ref) => (
|
|
38
|
-
<legend
|
|
39
|
-
ref={ref}
|
|
40
|
-
className={cn('px-1 text-sm font-medium leading-none', className)}
|
|
41
|
-
{...props}
|
|
42
|
-
/>
|
|
43
|
-
));
|
|
44
|
-
FieldLegend.displayName = 'FieldLegend';
|
|
45
|
-
|
|
46
|
-
// ─── FieldGroup(纵向排列多个 Field 的容器)──────────────────────────────
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* `FieldGroup` 行距密度 — 对齐《Teamix UI 表单设计规范》§3.5-3.6:
|
|
50
|
-
* - `normal`(默认)20px 行距 — 标准表单与混合(详情+表单)模式
|
|
51
|
-
* - `detail` 12px 行距 — 纯详情页(只展示不录入)
|
|
52
|
-
*/
|
|
53
|
-
export type FieldGroupDensity = 'normal' | 'detail';
|
|
54
|
-
|
|
55
|
-
export interface FieldGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
56
|
-
/**
|
|
57
|
-
* 行距密度。详情页用 `detail`(12px),其余(可编辑表单 / 部分展示+部分可编辑混合)用 `normal`(20px)。
|
|
58
|
-
* @default "normal"
|
|
59
|
-
*/
|
|
60
|
-
density?: FieldGroupDensity;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const FieldGroup = React.forwardRef<HTMLDivElement, FieldGroupProps>(
|
|
64
|
-
({ className, density = 'normal', ...props }, ref) => (
|
|
65
|
-
<div
|
|
66
|
-
ref={ref}
|
|
67
|
-
data-density={density}
|
|
68
|
-
className={cn(
|
|
69
|
-
'flex flex-col',
|
|
70
|
-
density === 'detail' ? 'gap-3' : 'gap-5',
|
|
71
|
-
className,
|
|
72
|
-
)}
|
|
73
|
-
{...props}
|
|
74
|
-
/>
|
|
75
|
-
),
|
|
76
|
-
);
|
|
77
|
-
FieldGroup.displayName = 'FieldGroup';
|
|
78
|
-
|
|
79
|
-
// ─── Field(单个字段容器:Label + Control + Description + Error)────────
|
|
80
|
-
|
|
81
|
-
export type FieldOrientation = 'vertical' | 'horizontal';
|
|
82
|
-
|
|
83
|
-
const fieldVariants = cva('flex', {
|
|
84
|
-
variants: {
|
|
85
|
-
orientation: {
|
|
86
|
-
vertical: 'flex-col gap-1',
|
|
87
|
-
horizontal: 'flex-row items-start gap-4',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
defaultVariants: { orientation: 'vertical' },
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
export interface FieldProps
|
|
94
|
-
extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,
|
|
95
|
-
Omit<VariantProps<typeof fieldVariants>, 'orientation'> {
|
|
96
|
-
/**
|
|
97
|
-
* 字段方向 — 标量或 5 档断点响应式映射:
|
|
98
|
-
* - `vertical`(默认)Label 在控件上;
|
|
99
|
-
* - `horizontal` Label 在控件左侧(配长表单);
|
|
100
|
-
* - 响应式对象 `{ base, xs, s, m, l, xl }` 按视口断点自动切换
|
|
101
|
-
* (对齐设计规范 §4.2:单栏表单 < 432 应改上下结构)。
|
|
102
|
-
*
|
|
103
|
-
* @default "vertical"
|
|
104
|
-
* @example orientation={{ base: 'vertical', xs: 'horizontal' }} // <432 上下,≥432 左右
|
|
105
|
-
*/
|
|
106
|
-
orientation?: ResponsiveValue<FieldOrientation>;
|
|
107
|
-
/**
|
|
108
|
-
* 标记字段为 invalid — 子组件的 ring / 文字色会跟随;同时把内部 `<FieldError>` 渲染为可见。
|
|
109
|
-
* @default false
|
|
110
|
-
*/
|
|
111
|
-
invalid?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* 输入域宽度档位 — 5 档系统,对应 104 / 216 / 328 / 440 / 552 px。
|
|
114
|
-
* 通过 Context 下发,并在 Field 容器上注入 CSS 变量 `--field-input-width`,子组件可消费。
|
|
115
|
-
*/
|
|
116
|
-
inputWidth?: InputWidth;
|
|
117
|
-
children?: React.ReactNode;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const FieldContext = React.createContext<{
|
|
121
|
-
invalid: boolean;
|
|
122
|
-
inputWidth?: InputWidth;
|
|
123
|
-
orientation: FieldOrientation;
|
|
124
|
-
}>({ invalid: false, orientation: 'vertical' });
|
|
125
|
-
|
|
126
|
-
/** 在受控/自定义子组件中读取当前 Field 的状态(invalid / inputWidth / 解析后的 orientation)。 */
|
|
127
|
-
const useField = () => React.useContext(FieldContext);
|
|
128
|
-
|
|
129
|
-
const Field = React.forwardRef<HTMLDivElement, FieldProps>(
|
|
130
|
-
(
|
|
131
|
-
{ orientation, invalid = false, inputWidth, className, style, ...props },
|
|
132
|
-
ref,
|
|
133
|
-
) => {
|
|
134
|
-
const currentBp = useBreakpoint();
|
|
135
|
-
const resolvedOrientation: FieldOrientation =
|
|
136
|
-
pickByBreakpoint(orientation, currentBp) ?? 'vertical';
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<FieldContext.Provider
|
|
140
|
-
value={{ invalid, inputWidth, orientation: resolvedOrientation }}
|
|
141
|
-
>
|
|
142
|
-
<div
|
|
143
|
-
ref={ref}
|
|
144
|
-
data-invalid={invalid ? '' : undefined}
|
|
145
|
-
data-orientation={resolvedOrientation}
|
|
146
|
-
className={cn(
|
|
147
|
-
fieldVariants({ orientation: resolvedOrientation }),
|
|
148
|
-
className,
|
|
149
|
-
)}
|
|
150
|
-
style={
|
|
151
|
-
{
|
|
152
|
-
...(inputWidth
|
|
153
|
-
? { '--field-input-width': `var(--input-width-${inputWidth})` }
|
|
154
|
-
: null),
|
|
155
|
-
...style,
|
|
156
|
-
} as React.CSSProperties
|
|
157
|
-
}
|
|
158
|
-
{...props}
|
|
159
|
-
/>
|
|
160
|
-
</FieldContext.Provider>
|
|
161
|
-
);
|
|
162
|
-
},
|
|
163
|
-
);
|
|
164
|
-
Field.displayName = 'Field';
|
|
165
|
-
|
|
166
|
-
// ─── FieldLabel(label,继承 invalid 着色)──────────────────────────────
|
|
167
|
-
|
|
168
|
-
export interface FieldLabelProps
|
|
169
|
-
extends React.ComponentPropsWithoutRef<typeof Label> {
|
|
170
|
-
/**
|
|
171
|
-
* 在 label 末尾追加 "*" 强调必填(antd Form `required` 并集)— 仅视觉,业务侧需在校验层确保必填。
|
|
172
|
-
* 顺序为 `文字 ⓘ *`,与 Label / FormLabel 保持一致。
|
|
173
|
-
* @default false
|
|
174
|
-
*/
|
|
175
|
-
required?: boolean;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const FieldLabel = React.forwardRef<
|
|
179
|
-
React.ElementRef<typeof Label>,
|
|
180
|
-
FieldLabelProps
|
|
181
|
-
>(({ required = false, className, style, maxWidth, children, ...props }, ref) => {
|
|
182
|
-
const { invalid, inputWidth, orientation } = React.useContext(FieldContext);
|
|
183
|
-
|
|
184
|
-
// horizontal 模式下,Label 默认 maxWidth = ⅓ 输入域宽(对齐规范 §七 "Label 最大宽 ⅓");
|
|
185
|
-
// 业务显式传 maxWidth 仍优先。inputWidth 未设时退化为 ⅓ 容器宽(100%/3)。
|
|
186
|
-
const autoMaxWidth =
|
|
187
|
-
orientation === 'horizontal' && maxWidth === undefined
|
|
188
|
-
? inputWidth
|
|
189
|
-
? `calc(var(--input-width-${inputWidth}) / 3)`
|
|
190
|
-
: '33.333%'
|
|
191
|
-
: undefined;
|
|
192
|
-
|
|
193
|
-
const mergedStyle: React.CSSProperties = {
|
|
194
|
-
...(autoMaxWidth && { maxWidth: autoMaxWidth }),
|
|
195
|
-
...style,
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
return (
|
|
199
|
-
<Label
|
|
200
|
-
ref={ref}
|
|
201
|
-
required={required}
|
|
202
|
-
style={mergedStyle}
|
|
203
|
-
maxWidth={maxWidth}
|
|
204
|
-
className={cn(
|
|
205
|
-
invalid && 'text-destructive',
|
|
206
|
-
// 启用了 maxWidth 时强制截断,保留 hover tooltip 由 Label 内置(若 tooltip prop 传入)
|
|
207
|
-
autoMaxWidth && 'truncate',
|
|
208
|
-
className,
|
|
209
|
-
)}
|
|
210
|
-
{...props}
|
|
211
|
-
>
|
|
212
|
-
{children}
|
|
213
|
-
</Label>
|
|
214
|
-
);
|
|
215
|
-
});
|
|
216
|
-
FieldLabel.displayName = 'FieldLabel';
|
|
217
|
-
|
|
218
|
-
// ─── FieldDescription / FieldError ────────────────────────────────────
|
|
219
|
-
|
|
220
|
-
const FieldDescription = React.forwardRef<
|
|
221
|
-
HTMLParagraphElement,
|
|
222
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
223
|
-
>(({ className, ...props }, ref) => (
|
|
224
|
-
<p
|
|
225
|
-
ref={ref}
|
|
226
|
-
className={cn('text-xs text-muted-foreground', className)}
|
|
227
|
-
{...props}
|
|
228
|
-
/>
|
|
229
|
-
));
|
|
230
|
-
FieldDescription.displayName = 'FieldDescription';
|
|
231
|
-
|
|
232
|
-
const FieldError = React.forwardRef<
|
|
233
|
-
HTMLParagraphElement,
|
|
234
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
235
|
-
>(({ className, children, ...props }, ref) => {
|
|
236
|
-
const { invalid } = React.useContext(FieldContext);
|
|
237
|
-
if (!invalid || !children) return null;
|
|
238
|
-
return (
|
|
239
|
-
<p
|
|
240
|
-
ref={ref}
|
|
241
|
-
role="alert"
|
|
242
|
-
className={cn('-mt-1 text-xs font-medium text-destructive', className)}
|
|
243
|
-
{...props}
|
|
244
|
-
>
|
|
245
|
-
{children}
|
|
246
|
-
</p>
|
|
247
|
-
);
|
|
248
|
-
});
|
|
249
|
-
FieldError.displayName = 'FieldError';
|
|
250
|
-
|
|
251
|
-
// ─── FieldSection(带可选标题的字段分组)────────────────────────────────
|
|
252
|
-
|
|
253
|
-
export interface FieldSectionProps
|
|
254
|
-
extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
255
|
-
/** 组标题 — 14px medium,有值时渲染标题行;多个 FieldSection 之间应由父容器提供 32px 间距(gap-8)。 */
|
|
256
|
-
title?: React.ReactNode;
|
|
257
|
-
/**
|
|
258
|
-
* 多栏 grid 列数 — 留空走 `flex-col`(单列纵向);设值时切到 CSS Grid,
|
|
259
|
-
* 列内 4px(`gap-x-4`)、行间 20px(`gap-y-5`,对齐规范 §3.1 规则 4)。
|
|
260
|
-
* @default undefined
|
|
261
|
-
*/
|
|
262
|
-
columns?: 1 | 2 | 3 | 4;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const FieldSection = React.forwardRef<HTMLDivElement, FieldSectionProps>(
|
|
266
|
-
({ title, columns, className, children, ...props }, ref) => (
|
|
267
|
-
<div ref={ref} className={cn('flex flex-col gap-5', className)} {...props}>
|
|
268
|
-
{title ? (
|
|
269
|
-
<h3 className="text-sm font-medium leading-none">{title}</h3>
|
|
270
|
-
) : null}
|
|
271
|
-
{columns && columns > 1 ? (
|
|
272
|
-
<div
|
|
273
|
-
className={cn(
|
|
274
|
-
'grid gap-x-4 gap-y-5',
|
|
275
|
-
columns === 2 && 'grid-cols-2',
|
|
276
|
-
columns === 3 && 'grid-cols-3',
|
|
277
|
-
columns === 4 && 'grid-cols-4',
|
|
278
|
-
)}
|
|
279
|
-
>
|
|
280
|
-
{children}
|
|
281
|
-
</div>
|
|
282
|
-
) : (
|
|
283
|
-
children
|
|
284
|
-
)}
|
|
285
|
-
</div>
|
|
286
|
-
),
|
|
287
|
-
);
|
|
288
|
-
FieldSection.displayName = 'FieldSection';
|
|
289
|
-
|
|
290
|
-
// ─── FieldActions(表单底部操作区)──────────────────────────────────────
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* 按钮容器场景 — 对齐《Teamix UI 表单设计规范》§六:
|
|
294
|
-
* - `page` 页面基础/分组表单:跟随表单流(`inline`)、左对齐、与输入域基线对齐
|
|
295
|
-
* - `page-stepper` 页面分步表单:吸底(`sticky`)、左对齐、不基线对齐(离侧导 24px 留给业务定 className)
|
|
296
|
-
* - `modal` 弹窗:跟随(`inline`)、右对齐、不基线对齐
|
|
297
|
-
* - `drawer` 抽屉:吸底(`sticky`)、左对齐、不基线对齐
|
|
298
|
-
*
|
|
299
|
-
* 显式 `position` / `align` / `alignWithInput` 优先级高于 `container` 推导。
|
|
300
|
-
*/
|
|
301
|
-
export type FieldActionsContainer = 'page' | 'page-stepper' | 'modal' | 'drawer';
|
|
302
|
-
|
|
303
|
-
const CONTAINER_DEFAULTS: Record<
|
|
304
|
-
FieldActionsContainer,
|
|
305
|
-
{ position: 'inline' | 'sticky'; align: 'start' | 'end'; alignWithInput: boolean }
|
|
306
|
-
> = {
|
|
307
|
-
page: { position: 'inline', align: 'start', alignWithInput: true },
|
|
308
|
-
'page-stepper': { position: 'sticky', align: 'start', alignWithInput: false },
|
|
309
|
-
modal: { position: 'inline', align: 'end', alignWithInput: false },
|
|
310
|
-
drawer: { position: 'sticky', align: 'start', alignWithInput: false },
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
export interface FieldActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
314
|
-
/**
|
|
315
|
-
* 容器场景预设 — 一次性配齐 `position` / `align` / `alignWithInput`,
|
|
316
|
-
* 对齐设计规范 §六按容器分类的按钮位置规则。显式传入的同名 prop 优先。
|
|
317
|
-
*
|
|
318
|
-
* @example container="modal" // 弹窗:inline + end + 不基线对齐
|
|
319
|
-
* @example container="drawer" // 抽屉:sticky + start + 不基线对齐
|
|
320
|
-
*/
|
|
321
|
-
container?: FieldActionsContainer;
|
|
322
|
-
/**
|
|
323
|
-
* 定位模式 — `inline` 跟随表单流;`sticky` 吸附在容器底部并带顶部分割线与背景。
|
|
324
|
-
* 未设时由 `container` 推导,默认 `inline`。
|
|
325
|
-
*/
|
|
326
|
-
position?: 'inline' | 'sticky';
|
|
327
|
-
/**
|
|
328
|
-
* 对齐方向 — `end` 右对齐(主操作在右,弹窗默认);`start` 左对齐(页面/抽屉默认)。
|
|
329
|
-
* 未设时由 `container` 推导,默认 `end`。
|
|
330
|
-
*/
|
|
331
|
-
align?: 'start' | 'end';
|
|
332
|
-
/**
|
|
333
|
-
* 与输入域基线对齐 — 水平表单(Field `orientation="horizontal"`)时预留 label 列宽度,
|
|
334
|
-
* 让按钮起点对齐输入框左边界(对齐设计规范 §六 "基础/分组表单按钮跟随基线对齐")。
|
|
335
|
-
* 通过 CSS 变量 `--form-label-width` 读取列宽,默认 `33.333%`(对齐规范 §七 label max ⅓)。
|
|
336
|
-
* 未设时由 `container` 推导,默认 `false`(仅 `container="page"` 时默认 `true`)。
|
|
337
|
-
*/
|
|
338
|
-
alignWithInput?: boolean;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
const FieldActions = React.forwardRef<HTMLDivElement, FieldActionsProps>(
|
|
342
|
-
(
|
|
343
|
-
{ container, position, align, alignWithInput, className, style, ...props },
|
|
344
|
-
ref,
|
|
345
|
-
) => {
|
|
346
|
-
const preset = container ? CONTAINER_DEFAULTS[container] : undefined;
|
|
347
|
-
const resolvedPosition = position ?? preset?.position ?? 'inline';
|
|
348
|
-
const resolvedAlign = align ?? preset?.align ?? 'end';
|
|
349
|
-
const resolvedAlignWithInput =
|
|
350
|
-
alignWithInput ?? preset?.alignWithInput ?? false;
|
|
351
|
-
|
|
352
|
-
const mergedStyle: React.CSSProperties = {
|
|
353
|
-
// 基线对齐用 inline style 表达 calc + CSS var(Tailwind arbitrary value 触 lint
|
|
354
|
-
// 且无法表达 calc 嵌套 var,inline 是规范允许的例外)
|
|
355
|
-
...(resolvedAlignWithInput && {
|
|
356
|
-
paddingLeft: 'calc(var(--form-label-width, 33.333%) + 0.75rem)',
|
|
357
|
-
}),
|
|
358
|
-
...style,
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
return (
|
|
362
|
-
<div
|
|
363
|
-
ref={ref}
|
|
364
|
-
data-container={container}
|
|
365
|
-
style={mergedStyle}
|
|
366
|
-
className={cn(
|
|
367
|
-
'flex gap-2 pt-4',
|
|
368
|
-
resolvedPosition === 'sticky' &&
|
|
369
|
-
'sticky bottom-0 border-t border-border bg-background py-4',
|
|
370
|
-
resolvedAlign === 'end' ? 'justify-end' : 'justify-start',
|
|
371
|
-
className,
|
|
372
|
-
)}
|
|
373
|
-
{...props}
|
|
374
|
-
/>
|
|
375
|
-
);
|
|
376
|
-
},
|
|
377
|
-
);
|
|
378
|
-
FieldActions.displayName = 'FieldActions';
|
|
379
|
-
|
|
380
|
-
export {
|
|
381
|
-
Field,
|
|
382
|
-
FieldLabel,
|
|
383
|
-
FieldDescription,
|
|
384
|
-
FieldError,
|
|
385
|
-
FieldGroup,
|
|
386
|
-
FieldSet,
|
|
387
|
-
FieldLegend,
|
|
388
|
-
FieldSection,
|
|
389
|
-
FieldActions,
|
|
390
|
-
fieldVariants,
|
|
391
|
-
useField,
|
|
392
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: filter-bar
|
|
3
|
-
name: FilterBar
|
|
4
|
-
displayName: 筛选栏
|
|
5
|
-
type: component
|
|
6
|
-
category: data-entry
|
|
7
|
-
since: 0.1.0
|
|
8
|
-
package: '@teamix-evo/ui'
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# FilterBar 筛选栏
|
|
12
|
-
|
|
13
|
-
筛选栏 — 面向 Table/List 上方的筛选表单变体,支持行内实时筛选 + 可折叠高级面板栅格布局。混合式架构:复合子组件自由组合 + FilterBarPreset 开箱即用。
|
|
14
|
-
|
|
15
|
-
## When to use
|
|
16
|
-
|
|
17
|
-
- 列表页/表格上方需要筛选数据
|
|
18
|
-
- 条件较少时行内实时触发(inline 模式)
|
|
19
|
-
- 条件较多时需要展开面板叠加筛选(panel 模式)
|
|
20
|
-
- 需要搜索 + 重置按钮的标准筛选场景
|
|
21
|
-
|
|
22
|
-
## When NOT to use
|
|
23
|
-
|
|
24
|
-
- 全局搜索框 → 用 `Input` + `Command`
|
|
25
|
-
- 侧栏持久筛选面板(永久可见) → 直接用 `Form` + `Card` 自行布局
|
|
26
|
-
- 单字段快速搜索 → 用 `Input` 配 `onKeyDown`
|
|
27
|
-
|
|
28
|
-
## Props
|
|
29
|
-
|
|
30
|
-
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。FilterBar 是复合组件,下表按子组件分节列出各自的 Props。
|
|
31
|
-
|
|
32
|
-
<!-- auto:props:begin -->
|
|
33
|
-
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
34
|
-
| --- | --- | --- | --- | --- |
|
|
35
|
-
| `form` | `UseFormReturn<any>` | – | ✓ | react-hook-form 实例 — 由 `useForm()` 创建,管理所有筛选字段的状态。 |
|
|
36
|
-
| `defaultExpanded` | `boolean` | `false` | – | 面板是否默认展开。 |
|
|
37
|
-
| `onFilter` | `(values: Record<string, any>) => void` | – | – | 筛选回调 — inline 模式防抖后触发,或面板模式点"搜索"按钮触发。 |
|
|
38
|
-
| `onReset` | `(values: Record<string, any>) => void` | – | – | 重置回调 — 点"重置"按钮后触发,参数为重置后的表单值。 |
|
|
39
|
-
| `filterDebounce` | `number` | `300` | – | inline 区 onChange 事件的防抖时间(ms)。 |
|
|
40
|
-
| `labelAlign` | `'left' \| 'right'` | `'left'` | – | Label 对齐模式 — 右对齐仅适用于筛选区短标签。 |
|
|
41
|
-
| `inputMaxWidth` | `number` | `undefined` | – | 输入域最大宽度(px) — 未设时走默认推断: 多栏(≥3 列)为 400,单栏/双栏为 600。 |
|
|
42
|
-
<!-- auto:props:end -->
|
|
43
|
-
|
|
44
|
-
## 依赖
|
|
45
|
-
|
|
46
|
-
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
|
|
47
|
-
|
|
48
|
-
<!-- auto:deps:begin -->
|
|
49
|
-
### 同库依赖
|
|
50
|
-
|
|
51
|
-
> `teamix-evo ui add filter-bar` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
52
|
-
|
|
53
|
-
| Entry | 类型 | 描述 |
|
|
54
|
-
| --- | --- | --- |
|
|
55
|
-
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
56
|
-
| `button` | component | 通用按钮 — shadcn 实现 + cloud-design 能力并集(loading / icon / shape / block / dashed variant / color 语义双 prop / disabledTooltip)。同文件合一导出 ButtonGroup + ButtonGroupText(等价 antd Space.Compact + cd SplitButton)。 |
|
|
57
|
-
| `form` | component | 表单 — react-hook-form + shadcn 7 件套(FormField/FormItem/Label/Control/Description/Message),配 zod 做 schema 校验 |
|
|
58
|
-
| `grid` | component | 24 栅格(Row + Col) — antd 独有补足。等价 antd Row + Col,基于 CSS Grid 的 24 列容器,支持 span / offset / order / flex / gutter / justify / align |
|
|
59
|
-
| `collapsible` | component | 单区域展开收起 — Radix Collapsible 薄包装(shadcn-only) |
|
|
60
|
-
| `use-debounce-callback` | hook | 防抖回调 hook — 返回一个防抖包装后的函数,在指定 delay 毫秒内连续调用只执行最后一次 |
|
|
61
|
-
| `use-breakpoint` | hook | 响应式断点 hook + pickByBreakpoint 工具 — 5 档断点(432/672/944/1200/1600,对齐《Teamix UI 表单设计规范》§4.1),给 Field 响应式 orientation / FilterBarPanel 响应式列数共用 |
|
|
62
|
-
|
|
63
|
-
### npm 依赖
|
|
64
|
-
|
|
65
|
-
> 业务侧需要先 `pnpm add` / `npm install` 这些包。CLI 在 `ui add` 完成后会列出此提示。
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
pnpm add lucide-react@^0.460.0 class-variance-authority@^0.7.0 @radix-ui/react-collapsible@^1.1.0
|
|
69
|
-
```
|
|
70
|
-
<!-- auto:deps:end -->
|
|
71
|
-
|
|
72
|
-
## 新增 Props 说明
|
|
73
|
-
|
|
74
|
-
除上表中的核心 FilterBar Props 外,本轮补充以下骨架能力:
|
|
75
|
-
|
|
76
|
-
- **`FilterBar.labelAlign`**:`'left' \| 'right'`,label 在 horizontal 模式下的对齐方式。默认 `'left'`;短标签成片场景可用 `'right'` 对齐 input。
|
|
77
|
-
- **`FilterBar.inputMaxWidth`**:`number`,统一限制 FilterBar 内控件的最大宽度(px),避免多栏下某列过宽拉伸。
|
|
78
|
-
- **`FilterBarPanel.responsiveColumns`**:`ResponsiveValue<1 \| 2 \| 3 \| 4>`,5 档断点映射(对齐《Teamix UI 表单设计规范》§4.1):`base` < 432 / `xs` ≥ 432 / `s` ≥ 672 / `m` ≥ 944 / `l` ≥ 1200 / `xl` ≥ 1600。优先级高于 `columns`。底层走 `useBreakpoint` hook + JS 计算 grid-template-columns,不依赖客户 Tailwind 配置。示例:`responsiveColumns={{ base: 1, xs: 2, m: 3, l: 4 }}`。
|
|
79
|
-
|
|
80
|
-
## AI 生成纪律
|
|
81
|
-
|
|
82
|
-
- **FilterBar 必须接受 form 实例**:`<FilterBar form={form}>...</FilterBar>`,由外部 `useForm()` 创建
|
|
83
|
-
- **筛选字段必须走 FormField**:无论 inline 还是 panel 内的字段,都必须用 `<FormField name="..." control={form.control} render={...} />`
|
|
84
|
-
- **FilterBarPanel 内字段自动栅格**:直接放 FormItem 即可,Panel 会自动用 Row/Col 包裹
|
|
85
|
-
- **不要在 FilterBarSearch 和 FilterBarPanel 放同名字段**:两个区域的字段名必须唯一,否则会冲突
|
|
86
|
-
- **inline 模式不要放 FilterBarActions**:行内区自动防抖触发 onFilter,不需要搜索按钮
|
|
87
|
-
- **面板模式推荐关闭 autoFilter**:有面板时设置 `<FilterBarSearch autoFilter={false}>`,筛选由 FilterBarActions 的搜索按钮统一触发
|
|
88
|
-
- **重置会清空所有字段**:`form.reset()` 清空所有默认值之外的数据,包括 inline 和 panel
|
|
89
|
-
- **FilterBarPreset 是快捷方式**:如果标准布局满足需求,优先用 FilterBarPreset 而非手动组合子组件
|
|
90
|
-
- ✅ 需要响应式时使用 `responsiveColumns`(5 档断点 base/xs/s/m/l/xl,不要用 `columns` + 手写媒体查询或 `lg:grid-cols-*`)
|
|
91
|
-
- ✅ 右对齐 label 仅适用于短标签筛选区(`labelAlign="right"`),长标签不要用;**viewport < 432px 自动改左对齐**(避免上下结构时 label 右贴反直觉,组件已内置响应式联动)
|
|
92
|
-
- ✅ 多栏筛选建议设置 `inputMaxWidth`(避免某个字段被拉伸过宽)
|