@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
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import {
|
|
3
|
+
Empty,
|
|
4
|
+
EmptyContent,
|
|
5
|
+
EmptyDescription,
|
|
6
|
+
EmptyHeader,
|
|
7
|
+
EmptyMedia,
|
|
8
|
+
EmptyTitle,
|
|
9
|
+
} from './index';
|
|
10
|
+
import { Button } from '@/components/button';
|
|
11
|
+
import { Alert, AlertDescription } from '@/components/alert';
|
|
12
|
+
import { InfoIcon } from 'lucide-react';
|
|
13
|
+
|
|
14
|
+
const meta: Meta<typeof Empty> = {
|
|
15
|
+
title: '数据展示 · Data Display/Empty 空状态',
|
|
16
|
+
component: Empty,
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
decorators: [
|
|
19
|
+
(Story) => (
|
|
20
|
+
<div className="flex min-h-96 w-full items-center justify-center">
|
|
21
|
+
<Story />
|
|
22
|
+
</div>
|
|
23
|
+
),
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
|
|
30
|
+
/* -------------------------------------------------------------------------------------------------
|
|
31
|
+
* 页面级横向布局 — 大插图在左、标题/描述/按钮在右
|
|
32
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
33
|
+
|
|
34
|
+
const PageActions = () => (
|
|
35
|
+
<div className="flex gap-3">
|
|
36
|
+
<Button size="lg">返回上一级</Button>
|
|
37
|
+
<Button size="lg" variant="outline">
|
|
38
|
+
其他操作
|
|
39
|
+
</Button>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
/** 403 — 没有访问权限。 */
|
|
44
|
+
export const Status403: Story = {
|
|
45
|
+
name: '403 没有访问权限',
|
|
46
|
+
render: () => (
|
|
47
|
+
<Empty layout="horizontal" status="403" extra={<PageActions />} />
|
|
48
|
+
),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** 404 — 页面不存在。 */
|
|
52
|
+
export const Status404: Story = {
|
|
53
|
+
name: '404 页面不存在',
|
|
54
|
+
render: () => (
|
|
55
|
+
<Empty layout="horizontal" status="404" extra={<PageActions />} />
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** 500 — 服务器错误。 */
|
|
60
|
+
export const Status500: Story = {
|
|
61
|
+
name: '500 服务器错误',
|
|
62
|
+
render: () => (
|
|
63
|
+
<Empty
|
|
64
|
+
layout="horizontal"
|
|
65
|
+
status="500"
|
|
66
|
+
extra={
|
|
67
|
+
<div className="flex gap-3">
|
|
68
|
+
<Button size="lg">重试</Button>
|
|
69
|
+
<Button size="lg" variant="outline">
|
|
70
|
+
联系客服
|
|
71
|
+
</Button>
|
|
72
|
+
</div>
|
|
73
|
+
}
|
|
74
|
+
/>
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** 搜索结果为空。 */
|
|
79
|
+
export const NoSearch: Story = {
|
|
80
|
+
name: '搜索结果为空',
|
|
81
|
+
render: () => (
|
|
82
|
+
<Empty
|
|
83
|
+
layout="horizontal"
|
|
84
|
+
status="noSearch"
|
|
85
|
+
extra={
|
|
86
|
+
<Button size="lg" variant="outline">
|
|
87
|
+
清除筛选
|
|
88
|
+
</Button>
|
|
89
|
+
}
|
|
90
|
+
/>
|
|
91
|
+
),
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/** 数据为空。 */
|
|
95
|
+
export const NoData: Story = {
|
|
96
|
+
name: '数据为空',
|
|
97
|
+
render: () => (
|
|
98
|
+
<Empty
|
|
99
|
+
layout="horizontal"
|
|
100
|
+
status="noData"
|
|
101
|
+
extra={<Button size="lg">新建</Button>}
|
|
102
|
+
/>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/** 暂无网络。 */
|
|
107
|
+
export const NoNetwork: Story = {
|
|
108
|
+
name: '暂无网络',
|
|
109
|
+
render: () => (
|
|
110
|
+
<Empty
|
|
111
|
+
layout="horizontal"
|
|
112
|
+
status="noNetwork"
|
|
113
|
+
extra={<Button size="lg">重试</Button>}
|
|
114
|
+
/>
|
|
115
|
+
),
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/** 浏览器不兼容。 */
|
|
119
|
+
export const BrowserError: Story = {
|
|
120
|
+
name: '浏览器不兼容',
|
|
121
|
+
render: () => (
|
|
122
|
+
<Empty
|
|
123
|
+
layout="horizontal"
|
|
124
|
+
status="browserError"
|
|
125
|
+
extra={
|
|
126
|
+
<Button size="lg" variant="outline">
|
|
127
|
+
了解详情
|
|
128
|
+
</Button>
|
|
129
|
+
}
|
|
130
|
+
/>
|
|
131
|
+
),
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/** 创建成功。 */
|
|
135
|
+
export const CreateSuccess: Story = {
|
|
136
|
+
name: '创建成功',
|
|
137
|
+
render: () => (
|
|
138
|
+
<Empty
|
|
139
|
+
layout="horizontal"
|
|
140
|
+
status="createSuccess"
|
|
141
|
+
extra={
|
|
142
|
+
<div className="flex gap-3">
|
|
143
|
+
<Button size="lg">查看详情</Button>
|
|
144
|
+
<Button size="lg" variant="outline">
|
|
145
|
+
继续创建
|
|
146
|
+
</Button>
|
|
147
|
+
</div>
|
|
148
|
+
}
|
|
149
|
+
/>
|
|
150
|
+
),
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/** 创建失败。 */
|
|
154
|
+
export const CreateError: Story = {
|
|
155
|
+
name: '创建失败',
|
|
156
|
+
render: () => (
|
|
157
|
+
<Empty
|
|
158
|
+
layout="horizontal"
|
|
159
|
+
status="createError"
|
|
160
|
+
extra={<Button size="lg">重试</Button>}
|
|
161
|
+
/>
|
|
162
|
+
),
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/** 导入数据。 */
|
|
166
|
+
export const ImportData: Story = {
|
|
167
|
+
name: '导入数据',
|
|
168
|
+
render: () => (
|
|
169
|
+
<Empty
|
|
170
|
+
layout="horizontal"
|
|
171
|
+
status="import"
|
|
172
|
+
extra={<Button size="lg">上传文件</Button>}
|
|
173
|
+
/>
|
|
174
|
+
),
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/* -------------------------------------------------------------------------------------------------
|
|
178
|
+
* 容器内使用 — 竖向、偏小,常见于表格 / 列表 / 卡片内的空态占位
|
|
179
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
180
|
+
|
|
181
|
+
/** 容器内使用 — 竖向布局,放在带边框的容器里,适合表格 / 列表无数据时的占位。 */
|
|
182
|
+
export const InContainer: Story = {
|
|
183
|
+
name: '容器内使用',
|
|
184
|
+
render: () => (
|
|
185
|
+
<div className="w-full max-w-2xl rounded-md border border-border bg-card">
|
|
186
|
+
<Empty status="noData" />
|
|
187
|
+
</div>
|
|
188
|
+
),
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
/* -------------------------------------------------------------------------------------------------
|
|
192
|
+
* 带 message / 带图标
|
|
193
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
194
|
+
|
|
195
|
+
/** 使用 message 区域 — 在描述与按钮之间内嵌 Alert,补充上下文信息。 */
|
|
196
|
+
export const WithMessage: Story = {
|
|
197
|
+
name: '使用 message 区域',
|
|
198
|
+
render: () => (
|
|
199
|
+
<Empty
|
|
200
|
+
layout="horizontal"
|
|
201
|
+
status="404"
|
|
202
|
+
extra={
|
|
203
|
+
<div className="flex flex-col gap-4">
|
|
204
|
+
<Alert>
|
|
205
|
+
<InfoIcon />
|
|
206
|
+
<AlertDescription>
|
|
207
|
+
当前数据包:数据包名称名称数据包名称名称数据包名称名称
|
|
208
|
+
</AlertDescription>
|
|
209
|
+
</Alert>
|
|
210
|
+
<PageActions />
|
|
211
|
+
</div>
|
|
212
|
+
}
|
|
213
|
+
/>
|
|
214
|
+
),
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/** 带图标 — 横向小尺寸,内联状态图标 + 标题/描述/按钮,适合抽屉、对话框 M/L 中的结果反馈。 */
|
|
218
|
+
export const WithIcon: Story = {
|
|
219
|
+
name: '带图标',
|
|
220
|
+
render: () => (
|
|
221
|
+
<Empty
|
|
222
|
+
layout="horizontal"
|
|
223
|
+
size="sm"
|
|
224
|
+
status="success"
|
|
225
|
+
title="创建成功,标题居左对齐,标题(不含 icon)宽度根据文字内容自适应,超过 400px 后折行"
|
|
226
|
+
description="描述内容,文案居左对齐,宽度根据文字内容自适应,超出 400px 后折行,此样式适用于页面、抽屉、对话框 M/L 中的结果反馈。文字区域主要用于辅助信息说明,同时如有后续引导操作或者内容区,可在容器底部呈现。"
|
|
227
|
+
extra={<PageActions />}
|
|
228
|
+
/>
|
|
229
|
+
),
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
/* -------------------------------------------------------------------------------------------------
|
|
233
|
+
* 辅助:尺寸 / 边框 / 完全组装
|
|
234
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
235
|
+
|
|
236
|
+
/** 三档尺寸对照 — sm / default / lg。 */
|
|
237
|
+
export const Sizes: Story = {
|
|
238
|
+
render: () => (
|
|
239
|
+
<div className="flex flex-col gap-6">
|
|
240
|
+
<Empty size="sm" status="noData" />
|
|
241
|
+
<Empty size="default" status="noData" />
|
|
242
|
+
<Empty size="lg" status="noData" />
|
|
243
|
+
</div>
|
|
244
|
+
),
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/** 显式 bordered — 卡片态空状态,适合需要明确边界的容器内场景。 */
|
|
248
|
+
export const Bordered: Story = {
|
|
249
|
+
render: () => (
|
|
250
|
+
<Empty
|
|
251
|
+
bordered
|
|
252
|
+
status="noData"
|
|
253
|
+
title="暂无数据"
|
|
254
|
+
description="点击下方按钮新建。"
|
|
255
|
+
extra={<Button>新建</Button>}
|
|
256
|
+
/>
|
|
257
|
+
),
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
/** 完全组装写法 — 绕过 status 预设,所有内容自定义。 */
|
|
261
|
+
export const Composable: Story = {
|
|
262
|
+
render: () => (
|
|
263
|
+
<Empty>
|
|
264
|
+
<EmptyMedia>
|
|
265
|
+
<InfoIcon className="size-10 text-info" />
|
|
266
|
+
</EmptyMedia>
|
|
267
|
+
<EmptyHeader>
|
|
268
|
+
<EmptyTitle>自定义标题</EmptyTitle>
|
|
269
|
+
<EmptyDescription>
|
|
270
|
+
完全使用复合组件组装,适合需要精细控制的场景。
|
|
271
|
+
</EmptyDescription>
|
|
272
|
+
</EmptyHeader>
|
|
273
|
+
<EmptyContent>
|
|
274
|
+
<Button>开始</Button>
|
|
275
|
+
</EmptyContent>
|
|
276
|
+
</Empty>
|
|
277
|
+
),
|
|
278
|
+
};
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表单字段 Field
|
|
3
|
+
*
|
|
4
|
+
* 表单控件的包装器,提供标签、描述和错误展示区域。
|
|
5
|
+
*
|
|
6
|
+
* @when
|
|
7
|
+
* - 表单控件的标准包装(label + input + error)
|
|
8
|
+
* - 表单验证错误展示
|
|
9
|
+
* - 必填项 / 可选项标记
|
|
10
|
+
*/
|
|
11
|
+
'use client';
|
|
12
|
+
|
|
13
|
+
import { useMemo } from 'react';
|
|
14
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
15
|
+
|
|
16
|
+
import { cn } from '@/lib/utils';
|
|
17
|
+
import { Label } from '@/components/label';
|
|
18
|
+
import { Separator } from '@/components/separator';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* inset 布局下去除子控件自身边框/背景/focus ring 的 Tailwind 子选择器集。
|
|
22
|
+
* 参考 FilterBar outline 模式(ADR 0037 v2.3),仅适用带边框输入控件。
|
|
23
|
+
*/
|
|
24
|
+
const INSET_INNER_RESET = [
|
|
25
|
+
// Input
|
|
26
|
+
'[&_[data-slot=input]]:rounded-none',
|
|
27
|
+
'[&_[data-slot=input]]:!border-0',
|
|
28
|
+
'[&_[data-slot=input]]:bg-transparent',
|
|
29
|
+
'[&_[data-slot=input]]:!shadow-none',
|
|
30
|
+
'[&_[data-slot=input]]:!ring-0',
|
|
31
|
+
'[&_[data-slot=input]]:h-full',
|
|
32
|
+
// Textarea
|
|
33
|
+
'[&_[data-slot=textarea]]:rounded-none',
|
|
34
|
+
'[&_[data-slot=textarea]]:!border-0',
|
|
35
|
+
'[&_[data-slot=textarea]]:bg-transparent',
|
|
36
|
+
'[&_[data-slot=textarea]]:!shadow-none',
|
|
37
|
+
'[&_[data-slot=textarea]]:!ring-0',
|
|
38
|
+
// Select
|
|
39
|
+
'[&_[data-slot=select-trigger]]:rounded-none',
|
|
40
|
+
'[&_[data-slot=select-trigger]]:!border-0',
|
|
41
|
+
'[&_[data-slot=select-trigger]]:bg-transparent',
|
|
42
|
+
'[&_[data-slot=select-trigger]]:!shadow-none',
|
|
43
|
+
'[&_[data-slot=select-trigger]]:!ring-0',
|
|
44
|
+
'[&_[data-slot=select-trigger]]:h-full',
|
|
45
|
+
'[&_[data-slot=select-trigger]]:flex-1',
|
|
46
|
+
// InputNumber
|
|
47
|
+
'[&_[data-slot=input-number]]:rounded-none',
|
|
48
|
+
'[&_[data-slot=input-number]]:!border-0',
|
|
49
|
+
'[&_[data-slot=input-number]]:bg-transparent',
|
|
50
|
+
'[&_[data-slot=input-number]]:!shadow-none',
|
|
51
|
+
'[&_[data-slot=input-number]]:!ring-0',
|
|
52
|
+
'[&_[data-slot=input-number]]:h-full',
|
|
53
|
+
'[&_[data-slot=input-number]]:flex-1',
|
|
54
|
+
'[&_[data-slot=input-number]_button]:!border-0',
|
|
55
|
+
// InputIP
|
|
56
|
+
'[&_[data-slot=input-ip]]:rounded-none',
|
|
57
|
+
'[&_[data-slot=input-ip]]:!border-0',
|
|
58
|
+
'[&_[data-slot=input-ip]]:bg-transparent',
|
|
59
|
+
'[&_[data-slot=input-ip]]:!shadow-none',
|
|
60
|
+
'[&_[data-slot=input-ip]]:!ring-0',
|
|
61
|
+
'[&_[data-slot=input-ip]]:h-full',
|
|
62
|
+
'[&_[data-slot=input-ip]]:flex-1',
|
|
63
|
+
// InputGroup wrapper
|
|
64
|
+
'[&_[data-slot=input-group]]:rounded-none',
|
|
65
|
+
'[&_[data-slot=input-group]]:!border-0',
|
|
66
|
+
'[&_[data-slot=input-group]]:bg-transparent',
|
|
67
|
+
'[&_[data-slot=input-group]]:!shadow-none',
|
|
68
|
+
'[&_[data-slot=input-group]]:!ring-0',
|
|
69
|
+
'[&_[data-slot=input-group]]:h-full',
|
|
70
|
+
'[&_[data-slot=input-group]]:flex-1',
|
|
71
|
+
// DatePicker
|
|
72
|
+
'[&_[data-slot=date-picker]]:rounded-none',
|
|
73
|
+
'[&_[data-slot=date-picker]]:!border-0',
|
|
74
|
+
'[&_[data-slot=date-picker]]:bg-transparent',
|
|
75
|
+
'[&_[data-slot=date-picker]]:!shadow-none',
|
|
76
|
+
'[&_[data-slot=date-picker]]:!ring-0',
|
|
77
|
+
'[&_[data-slot=date-picker]]:h-full',
|
|
78
|
+
'[&_[data-slot=date-picker]]:flex-1',
|
|
79
|
+
// DateRangePicker
|
|
80
|
+
'[&_[data-slot=date-range-picker]]:rounded-none',
|
|
81
|
+
'[&_[data-slot=date-range-picker]]:!border-0',
|
|
82
|
+
'[&_[data-slot=date-range-picker]]:bg-transparent',
|
|
83
|
+
'[&_[data-slot=date-range-picker]]:!shadow-none',
|
|
84
|
+
'[&_[data-slot=date-range-picker]]:!ring-0',
|
|
85
|
+
'[&_[data-slot=date-range-picker]]:h-full',
|
|
86
|
+
'[&_[data-slot=date-range-picker]]:flex-1',
|
|
87
|
+
// TimePicker
|
|
88
|
+
'[&_[data-slot=time-picker]]:rounded-none',
|
|
89
|
+
'[&_[data-slot=time-picker]]:!border-0',
|
|
90
|
+
'[&_[data-slot=time-picker]]:bg-transparent',
|
|
91
|
+
'[&_[data-slot=time-picker]]:!shadow-none',
|
|
92
|
+
'[&_[data-slot=time-picker]]:!ring-0',
|
|
93
|
+
'[&_[data-slot=time-picker]]:h-full',
|
|
94
|
+
'[&_[data-slot=time-picker]]:flex-1',
|
|
95
|
+
// TimeRangePicker
|
|
96
|
+
'[&_[data-slot=time-range-picker]]:rounded-none',
|
|
97
|
+
'[&_[data-slot=time-range-picker]]:!border-0',
|
|
98
|
+
'[&_[data-slot=time-range-picker]]:bg-transparent',
|
|
99
|
+
'[&_[data-slot=time-range-picker]]:!shadow-none',
|
|
100
|
+
'[&_[data-slot=time-range-picker]]:!ring-0',
|
|
101
|
+
'[&_[data-slot=time-range-picker]]:h-full',
|
|
102
|
+
'[&_[data-slot=time-range-picker]]:flex-1',
|
|
103
|
+
// TreeSelect
|
|
104
|
+
'[&_[data-slot=tree-select]]:w-full',
|
|
105
|
+
'[&_[data-slot=tree-select]>button]:rounded-none',
|
|
106
|
+
'[&_[data-slot=tree-select]>button]:!border-0',
|
|
107
|
+
'[&_[data-slot=tree-select]>button]:bg-transparent',
|
|
108
|
+
'[&_[data-slot=tree-select]>button]:!shadow-none',
|
|
109
|
+
'[&_[data-slot=tree-select]>button]:!ring-0',
|
|
110
|
+
'[&_[data-slot=tree-select]>button]:h-full',
|
|
111
|
+
'[&_[data-slot=tree-select]>button]:w-full',
|
|
112
|
+
'[&_[data-slot=tree-select]>button]:min-w-0',
|
|
113
|
+
// CascaderSelect
|
|
114
|
+
'[&_[data-slot=cascader-select]]:w-full',
|
|
115
|
+
'[&_[data-slot=cascader-select]>button]:rounded-none',
|
|
116
|
+
'[&_[data-slot=cascader-select]>button]:!border-0',
|
|
117
|
+
'[&_[data-slot=cascader-select]>button]:bg-transparent',
|
|
118
|
+
'[&_[data-slot=cascader-select]>button]:!shadow-none',
|
|
119
|
+
'[&_[data-slot=cascader-select]>button]:!ring-0',
|
|
120
|
+
'[&_[data-slot=cascader-select]>button]:h-full',
|
|
121
|
+
'[&_[data-slot=cascader-select]>button]:w-full',
|
|
122
|
+
'[&_[data-slot=cascader-select]>button]:min-w-0',
|
|
123
|
+
].join(' ');
|
|
124
|
+
|
|
125
|
+
function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {
|
|
126
|
+
return (
|
|
127
|
+
<fieldset
|
|
128
|
+
data-slot="field-set"
|
|
129
|
+
className={cn(
|
|
130
|
+
'flex flex-col gap-5 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',
|
|
131
|
+
className,
|
|
132
|
+
)}
|
|
133
|
+
{...props}
|
|
134
|
+
/>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function FieldLegend({
|
|
139
|
+
className,
|
|
140
|
+
variant = 'legend',
|
|
141
|
+
...props
|
|
142
|
+
}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {
|
|
143
|
+
return (
|
|
144
|
+
<legend
|
|
145
|
+
data-slot="field-legend"
|
|
146
|
+
data-variant={variant}
|
|
147
|
+
className={cn(
|
|
148
|
+
'font-medium data-[variant=label]:text-xs data-[variant=legend]:text-sm',
|
|
149
|
+
className,
|
|
150
|
+
)}
|
|
151
|
+
{...props}
|
|
152
|
+
/>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
157
|
+
return (
|
|
158
|
+
<div
|
|
159
|
+
data-slot="field-group"
|
|
160
|
+
className={cn(
|
|
161
|
+
'group/field-group @container/field-group flex w-full flex-col gap-5 [&>[data-slot=field-set]+[data-slot=field-set]]:mt-3 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4',
|
|
162
|
+
className,
|
|
163
|
+
)}
|
|
164
|
+
{...props}
|
|
165
|
+
/>
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const fieldVariants = cva(
|
|
170
|
+
'group/field flex w-full data-[invalid=true]:text-destructive',
|
|
171
|
+
{
|
|
172
|
+
variants: {
|
|
173
|
+
orientation: {
|
|
174
|
+
vertical: 'flex-col gap-1 *:w-full [&>.sr-only]:w-auto',
|
|
175
|
+
responsive:
|
|
176
|
+
'flex-col gap-1 *:w-full @[30rem]/field-group:grid @[30rem]/field-group:grid-cols-12 @[30rem]/field-group:gap-x-4 @[30rem]/field-group:gap-y-1 @[30rem]/field-group:items-start @[30rem]/field-group:[&>[data-slot=field-label]]:col-span-2 @[30rem]/field-group:[&>:not([data-slot=field-label])]:col-span-8 @[30rem]/field-group:[&>:not([data-slot=field-label])]:col-start-3 [&>.sr-only]:w-auto',
|
|
177
|
+
inset: 'flex-col gap-1',
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
defaultVariants: {
|
|
181
|
+
orientation: 'vertical',
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
function Field({
|
|
187
|
+
className,
|
|
188
|
+
orientation = 'vertical',
|
|
189
|
+
...props
|
|
190
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {
|
|
191
|
+
return (
|
|
192
|
+
<div
|
|
193
|
+
role="group"
|
|
194
|
+
data-slot="field"
|
|
195
|
+
data-orientation={orientation}
|
|
196
|
+
className={cn(fieldVariants({ orientation }), className)}
|
|
197
|
+
{...props}
|
|
198
|
+
/>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* inset 模式的内部包装:共享边框容器,包含 FieldLabel + 控件。
|
|
204
|
+
* 在 inset 模式下由 FieldInsetBox 接管 label+input 的边框展示。
|
|
205
|
+
*/
|
|
206
|
+
function FieldInsetBox({ className, ...props }: React.ComponentProps<'div'>) {
|
|
207
|
+
return (
|
|
208
|
+
<div
|
|
209
|
+
data-slot="field-inset-box"
|
|
210
|
+
className={cn(
|
|
211
|
+
'flex h-8 w-full items-center rounded-md border border-input bg-card',
|
|
212
|
+
'focus-within:border-ring focus-within:ring-1 focus-within:ring-ring',
|
|
213
|
+
'group-data-[invalid=true]/field:!border-destructive group-data-[invalid=true]/field:!shadow-none',
|
|
214
|
+
'group-data-[invalid=true]/field:focus-within:!border-destructive group-data-[invalid=true]/field:focus-within:ring-destructive/20',
|
|
215
|
+
INSET_INNER_RESET,
|
|
216
|
+
className,
|
|
217
|
+
)}
|
|
218
|
+
{...props}
|
|
219
|
+
/>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function FieldContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
224
|
+
return (
|
|
225
|
+
<div
|
|
226
|
+
data-slot="field-content"
|
|
227
|
+
className={cn(
|
|
228
|
+
'group/field-content flex flex-1 flex-col gap-1 leading-snug',
|
|
229
|
+
className,
|
|
230
|
+
)}
|
|
231
|
+
{...props}
|
|
232
|
+
/>
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function FieldLabel({
|
|
237
|
+
className,
|
|
238
|
+
...props
|
|
239
|
+
}: React.ComponentProps<typeof Label>) {
|
|
240
|
+
return (
|
|
241
|
+
<Label
|
|
242
|
+
data-slot="field-label"
|
|
243
|
+
className={cn(
|
|
244
|
+
'group/field-label peer/field-label flex w-fit gap-1 leading-8 group-data-[disabled=true]/field:opacity-50 has-data-[state=checked]:border-primary/30 has-data-[state=checked]:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5',
|
|
245
|
+
'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',
|
|
246
|
+
'group-data-[orientation=inset]/field:h-full group-data-[orientation=inset]/field:shrink-0 group-data-[orientation=inset]/field:items-center group-data-[orientation=inset]/field:pl-3 group-data-[orientation=inset]/field:pr-2 group-data-[orientation=inset]/field:leading-normal group-data-[orientation=inset]/field:text-muted-foreground',
|
|
247
|
+
className,
|
|
248
|
+
)}
|
|
249
|
+
{...props}
|
|
250
|
+
/>
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
255
|
+
return (
|
|
256
|
+
<div
|
|
257
|
+
data-slot="field-label"
|
|
258
|
+
className={cn(
|
|
259
|
+
'flex w-fit items-center gap-1 text-xs font-medium group-data-[disabled=true]/field:opacity-50',
|
|
260
|
+
className,
|
|
261
|
+
)}
|
|
262
|
+
{...props}
|
|
263
|
+
/>
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
268
|
+
return (
|
|
269
|
+
<p
|
|
270
|
+
data-slot="field-description"
|
|
271
|
+
className={cn(
|
|
272
|
+
'text-left text-xs leading-normal font-normal text-muted-foreground [[data-variant=legend]+&]:-mt-1.5',
|
|
273
|
+
'[&>a]:text-primary [&>a:hover]:text-primary/80',
|
|
274
|
+
className,
|
|
275
|
+
)}
|
|
276
|
+
{...props}
|
|
277
|
+
/>
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function FieldSeparator({
|
|
282
|
+
children,
|
|
283
|
+
className,
|
|
284
|
+
...props
|
|
285
|
+
}: React.ComponentProps<'div'> & {
|
|
286
|
+
children?: React.ReactNode;
|
|
287
|
+
}) {
|
|
288
|
+
return (
|
|
289
|
+
<div
|
|
290
|
+
data-slot="field-separator"
|
|
291
|
+
data-content={!!children}
|
|
292
|
+
className={cn(
|
|
293
|
+
'relative -my-2 h-5 text-xs group-data-[variant=outline]/field-group:-mb-2',
|
|
294
|
+
className,
|
|
295
|
+
)}
|
|
296
|
+
{...props}
|
|
297
|
+
>
|
|
298
|
+
<Separator className="absolute inset-0 top-1/2" />
|
|
299
|
+
{children && (
|
|
300
|
+
<span
|
|
301
|
+
className="relative mx-auto block w-fit bg-background px-2 text-muted-foreground"
|
|
302
|
+
data-slot="field-separator-content"
|
|
303
|
+
>
|
|
304
|
+
{children}
|
|
305
|
+
</span>
|
|
306
|
+
)}
|
|
307
|
+
</div>
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function FieldError({
|
|
312
|
+
className,
|
|
313
|
+
children,
|
|
314
|
+
errors,
|
|
315
|
+
...props
|
|
316
|
+
}: React.ComponentProps<'div'> & {
|
|
317
|
+
errors?: Array<{ message?: string } | undefined>;
|
|
318
|
+
}) {
|
|
319
|
+
const content = useMemo(() => {
|
|
320
|
+
if (children) {
|
|
321
|
+
return children;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
if (!errors?.length) {
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const uniqueErrors = [
|
|
329
|
+
...new Map(errors.map((error) => [error?.message, error])).values(),
|
|
330
|
+
];
|
|
331
|
+
|
|
332
|
+
if (uniqueErrors?.length == 1) {
|
|
333
|
+
return uniqueErrors[0]?.message;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return (
|
|
337
|
+
<ul className="ml-4 flex list-disc flex-col gap-1">
|
|
338
|
+
{uniqueErrors.map(
|
|
339
|
+
(error, index) =>
|
|
340
|
+
error?.message && <li key={index}>{error.message}</li>,
|
|
341
|
+
)}
|
|
342
|
+
</ul>
|
|
343
|
+
);
|
|
344
|
+
}, [children, errors]);
|
|
345
|
+
|
|
346
|
+
if (!content) {
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
return (
|
|
351
|
+
<div
|
|
352
|
+
role="alert"
|
|
353
|
+
data-slot="field-error"
|
|
354
|
+
className={cn('text-xs font-normal text-destructive -mt-1', className)}
|
|
355
|
+
{...props}
|
|
356
|
+
>
|
|
357
|
+
{content}
|
|
358
|
+
</div>
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export {
|
|
363
|
+
Field,
|
|
364
|
+
FieldInsetBox,
|
|
365
|
+
FieldLabel,
|
|
366
|
+
FieldDescription,
|
|
367
|
+
FieldError,
|
|
368
|
+
FieldGroup,
|
|
369
|
+
FieldLegend,
|
|
370
|
+
FieldSeparator,
|
|
371
|
+
FieldSet,
|
|
372
|
+
FieldContent,
|
|
373
|
+
FieldTitle,
|
|
374
|
+
};
|