@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,183 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
3
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/utils/cn';
|
|
6
|
-
import { buttonVariants } from '@/components/button/button';
|
|
7
|
-
|
|
8
|
-
const AlertDialog = AlertDialogPrimitive.Root;
|
|
9
|
-
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
10
|
-
|
|
11
|
-
const AlertDialogTrigger = React.forwardRef<
|
|
12
|
-
React.ElementRef<typeof AlertDialogPrimitive.Trigger>,
|
|
13
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Trigger>
|
|
14
|
-
>(({ className, ...props }, ref) => (
|
|
15
|
-
<AlertDialogPrimitive.Trigger
|
|
16
|
-
ref={ref}
|
|
17
|
-
className={cn('cursor-pointer', className)}
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
));
|
|
21
|
-
AlertDialogTrigger.displayName = AlertDialogPrimitive.Trigger.displayName;
|
|
22
|
-
|
|
23
|
-
const AlertDialogOverlay = React.forwardRef<
|
|
24
|
-
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
25
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
26
|
-
>(({ className, ...props }, ref) => (
|
|
27
|
-
<AlertDialogPrimitive.Overlay
|
|
28
|
-
ref={ref}
|
|
29
|
-
className={cn(
|
|
30
|
-
'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
31
|
-
className,
|
|
32
|
-
)}
|
|
33
|
-
{...props}
|
|
34
|
-
/>
|
|
35
|
-
));
|
|
36
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* AlertDialog content 变体 — 与 Dialog 保持同源视觉。
|
|
40
|
-
* - 圆角 `--radius-dialog`(16px)
|
|
41
|
-
* - 无 border,纯白 + shadow 作为视觉分界
|
|
42
|
-
* - size 绑定 `--layout-dialog-{sm|md|lg|xl}` tokens(确认类默认 `sm`,更紧凑)
|
|
43
|
-
*/
|
|
44
|
-
const alertDialogContentVariants = cva(
|
|
45
|
-
'fixed left-1/2 top-1/2 z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border-0 bg-background p-6 shadow-lg duration-200 rounded-[var(--radius-dialog)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
|
|
46
|
-
{
|
|
47
|
-
variants: {
|
|
48
|
-
size: {
|
|
49
|
-
sm: 'max-w-[var(--layout-dialog-sm)]',
|
|
50
|
-
md: 'max-w-[var(--layout-dialog-md)]',
|
|
51
|
-
lg: 'max-w-[var(--layout-dialog-lg)]',
|
|
52
|
-
xl: 'max-w-[var(--layout-dialog-xl)]',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
defaultVariants: { size: 'sm' },
|
|
56
|
-
},
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
export type AlertDialogSize = NonNullable<
|
|
60
|
-
VariantProps<typeof alertDialogContentVariants>['size']
|
|
61
|
-
>;
|
|
62
|
-
|
|
63
|
-
export interface AlertDialogContentProps
|
|
64
|
-
extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>,
|
|
65
|
-
VariantProps<typeof alertDialogContentVariants> {
|
|
66
|
-
/**
|
|
67
|
-
* 确认对话框尺寸 — 绑定 design tokens `--layout-dialog-{sm|md|lg|xl}`。
|
|
68
|
-
* OpenTrek 基准:sm=400 / md=600 / lg=800 / xl=1200。
|
|
69
|
-
* 确认场景文案短、信息少,默认 `sm`。
|
|
70
|
-
* @default "sm"
|
|
71
|
-
*/
|
|
72
|
-
size?: AlertDialogSize;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const AlertDialogContent = React.forwardRef<
|
|
76
|
-
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
77
|
-
AlertDialogContentProps
|
|
78
|
-
>(({ className, size = 'sm', ...props }, ref) => (
|
|
79
|
-
<AlertDialogPortal>
|
|
80
|
-
<AlertDialogOverlay />
|
|
81
|
-
<AlertDialogPrimitive.Content
|
|
82
|
-
ref={ref}
|
|
83
|
-
data-slot="dialog-content"
|
|
84
|
-
className={cn(alertDialogContentVariants({ size }), className)}
|
|
85
|
-
{...props}
|
|
86
|
-
/>
|
|
87
|
-
</AlertDialogPortal>
|
|
88
|
-
));
|
|
89
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
90
|
-
|
|
91
|
-
const AlertDialogHeader = ({
|
|
92
|
-
className,
|
|
93
|
-
...props
|
|
94
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
95
|
-
<div
|
|
96
|
-
className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
|
|
97
|
-
{...props}
|
|
98
|
-
/>
|
|
99
|
-
);
|
|
100
|
-
AlertDialogHeader.displayName = 'AlertDialogHeader';
|
|
101
|
-
|
|
102
|
-
const AlertDialogFooter = ({
|
|
103
|
-
className,
|
|
104
|
-
...props
|
|
105
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
106
|
-
<div
|
|
107
|
-
className={cn(
|
|
108
|
-
'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-2',
|
|
109
|
-
className,
|
|
110
|
-
)}
|
|
111
|
-
{...props}
|
|
112
|
-
/>
|
|
113
|
-
);
|
|
114
|
-
AlertDialogFooter.displayName = 'AlertDialogFooter';
|
|
115
|
-
|
|
116
|
-
const AlertDialogTitle = React.forwardRef<
|
|
117
|
-
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
118
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
119
|
-
>(({ className, ...props }, ref) => (
|
|
120
|
-
<AlertDialogPrimitive.Title
|
|
121
|
-
ref={ref}
|
|
122
|
-
data-slot="dialog-title"
|
|
123
|
-
className={cn('text-lg font-semibold', className)}
|
|
124
|
-
{...props}
|
|
125
|
-
/>
|
|
126
|
-
));
|
|
127
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
128
|
-
|
|
129
|
-
const AlertDialogDescription = React.forwardRef<
|
|
130
|
-
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
131
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
132
|
-
>(({ className, ...props }, ref) => (
|
|
133
|
-
<AlertDialogPrimitive.Description
|
|
134
|
-
ref={ref}
|
|
135
|
-
className={cn('text-xs text-muted-foreground', className)}
|
|
136
|
-
{...props}
|
|
137
|
-
/>
|
|
138
|
-
));
|
|
139
|
-
AlertDialogDescription.displayName =
|
|
140
|
-
AlertDialogPrimitive.Description.displayName;
|
|
141
|
-
|
|
142
|
-
const AlertDialogAction = React.forwardRef<
|
|
143
|
-
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
144
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
145
|
-
>(({ className, ...props }, ref) => (
|
|
146
|
-
<AlertDialogPrimitive.Action
|
|
147
|
-
ref={ref}
|
|
148
|
-
className={cn(buttonVariants(), className)}
|
|
149
|
-
{...props}
|
|
150
|
-
/>
|
|
151
|
-
));
|
|
152
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
153
|
-
|
|
154
|
-
const AlertDialogCancel = React.forwardRef<
|
|
155
|
-
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
156
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
157
|
-
>(({ className, ...props }, ref) => (
|
|
158
|
-
<AlertDialogPrimitive.Cancel
|
|
159
|
-
ref={ref}
|
|
160
|
-
className={cn(
|
|
161
|
-
buttonVariants({ variant: 'outline' }),
|
|
162
|
-
'mt-2 sm:mt-0',
|
|
163
|
-
className,
|
|
164
|
-
)}
|
|
165
|
-
{...props}
|
|
166
|
-
/>
|
|
167
|
-
));
|
|
168
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
169
|
-
|
|
170
|
-
export {
|
|
171
|
-
AlertDialog,
|
|
172
|
-
AlertDialogPortal,
|
|
173
|
-
AlertDialogOverlay,
|
|
174
|
-
AlertDialogTrigger,
|
|
175
|
-
AlertDialogContent,
|
|
176
|
-
AlertDialogHeader,
|
|
177
|
-
AlertDialogFooter,
|
|
178
|
-
AlertDialogTitle,
|
|
179
|
-
AlertDialogDescription,
|
|
180
|
-
AlertDialogAction,
|
|
181
|
-
AlertDialogCancel,
|
|
182
|
-
alertDialogContentVariants,
|
|
183
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: anchor
|
|
3
|
-
name: Anchor
|
|
4
|
-
displayName: 锚点
|
|
5
|
-
type: component
|
|
6
|
-
category: deprecated
|
|
7
|
-
since: 0.1.0
|
|
8
|
-
package: '@teamix-evo/ui'
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Anchor 锚点
|
|
12
|
-
|
|
13
|
-
锚点导航 — antd 独有补足。**等价 antd `Anchor`**。长文档 / 详情页侧边的目录,点击锚点滚动到对应 `id` 节点,滚动时自动高亮当前可见的锚点(IntersectionObserver)。支持嵌套两层缩进。
|
|
14
|
-
|
|
15
|
-
## When to use
|
|
16
|
-
|
|
17
|
-
- 文档 / 帮助页 / 设置页的侧边目录
|
|
18
|
-
- 长详情页(订单 / 用户 / 商品)的快捷跳转
|
|
19
|
-
- 协议 / 隐私政策的章节导航
|
|
20
|
-
|
|
21
|
-
## When NOT to use
|
|
22
|
-
|
|
23
|
-
- 单页应用路由跳转 → `Link` / 路由库
|
|
24
|
-
- 主导航(顶部 / 侧栏菜单)→ `NavigationMenu` / `Sidebar`
|
|
25
|
-
- 步骤导航(顺序操作)→ `Steps`
|
|
26
|
-
|
|
27
|
-
## Props
|
|
28
|
-
|
|
29
|
-
<!-- auto:props:begin -->
|
|
30
|
-
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
31
|
-
| --- | --- | --- | --- | --- |
|
|
32
|
-
| `items` | `AnchorItem[]` | – | ✓ | 锚点项树(antd `items` 并集)。 |
|
|
33
|
-
| `offsetTop` | `number` | `0` | – | 当目标元素距视口顶部小于此值时高亮(IntersectionObserver `rootMargin`)。 |
|
|
34
|
-
| `scrollBehavior` | `'smooth' \| 'auto'` | `"smooth"` | – | 点击锚点平滑滚动行为。 |
|
|
35
|
-
| `onChange` | `(key: string) => void` | – | – | 当前高亮变化回调。 |
|
|
36
|
-
<!-- auto:props:end -->
|
|
37
|
-
|
|
38
|
-
## 依赖
|
|
39
|
-
|
|
40
|
-
<!-- auto:deps:begin -->
|
|
41
|
-
### 同库依赖
|
|
42
|
-
|
|
43
|
-
> `teamix-evo ui add anchor` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
44
|
-
|
|
45
|
-
| Entry | 类型 | 描述 |
|
|
46
|
-
| --- | --- | --- |
|
|
47
|
-
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
48
|
-
|
|
49
|
-
### npm 依赖
|
|
50
|
-
|
|
51
|
-
_无 — 本组件不依赖任何 npm 包。_
|
|
52
|
-
<!-- auto:deps:end -->
|
|
53
|
-
|
|
54
|
-
## AI 生成纪律
|
|
55
|
-
|
|
56
|
-
- **必须给目标节点设 `id`** — Anchor 用 `document.getElementById(key)` 找元素;**不要**用 `data-*` 或 React ref
|
|
57
|
-
- **`offsetTop` 与你的 Header 高度对齐** — 否则点击锚点后内容会被 header 遮挡
|
|
58
|
-
- **`scrollBehavior="smooth"` 默认开** — 受用户系统 `prefers-reduced-motion` 影响,无需手动判断
|
|
59
|
-
- **嵌套 ≤ 2 层** — 3 层以上侧栏拥挤;深结构改用 Tree 或折叠
|
|
60
|
-
- **不要给 Anchor 包 Affix** — 直接 Tailwind `sticky top-N` 更轻
|
|
61
|
-
- **`onChange`** 是只读回调(同步状态到 URL hash 等),**不要**在里面再调 scrollTo,会无限循环
|
|
62
|
-
|
|
63
|
-
## Examples
|
|
64
|
-
|
|
65
|
-
```tsx
|
|
66
|
-
import { Anchor } from '@/components/ui/anchor';
|
|
67
|
-
|
|
68
|
-
const items = [
|
|
69
|
-
{ key: 'intro', title: '介绍' },
|
|
70
|
-
{
|
|
71
|
-
key: 'install',
|
|
72
|
-
title: '安装',
|
|
73
|
-
children: [
|
|
74
|
-
{ key: 'npm', title: 'npm' },
|
|
75
|
-
{ key: 'pnpm', title: 'pnpm' },
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
{ key: 'usage', title: '使用' },
|
|
79
|
-
];
|
|
80
|
-
|
|
81
|
-
<aside className="sticky top-16 w-56">
|
|
82
|
-
<Anchor items={items} offsetTop={64} />
|
|
83
|
-
</aside>
|
|
84
|
-
|
|
85
|
-
// 同步到 URL
|
|
86
|
-
<Anchor
|
|
87
|
-
items={items}
|
|
88
|
-
onChange={(key) => {
|
|
89
|
-
window.history.replaceState(null, '', `#${key}`);
|
|
90
|
-
}}
|
|
91
|
-
/>
|
|
92
|
-
```
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Anchor } from './anchor';
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Anchor> = {
|
|
5
|
-
title: '废弃 · Deprecated/Anchor',
|
|
6
|
-
component: Anchor,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component:
|
|
12
|
-
'⚠️ **已废弃** — 仅 Storybook 留档,不通过 manifest 对外发布。\n\n锚点导航 — 长文档 / 详情页侧边目录,点击滚动到 id 节点,滚动时 IntersectionObserver 自动高亮。等价 antd `Anchor`。',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof Anchor>;
|
|
20
|
-
|
|
21
|
-
const items = [
|
|
22
|
-
{ key: 'intro', title: '介绍' },
|
|
23
|
-
{
|
|
24
|
-
key: 'install',
|
|
25
|
-
title: '安装',
|
|
26
|
-
children: [
|
|
27
|
-
{ key: 'npm', title: 'npm' },
|
|
28
|
-
{ key: 'pnpm', title: 'pnpm' },
|
|
29
|
-
{ key: 'yarn', title: 'yarn' },
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
{ key: 'usage', title: '使用' },
|
|
33
|
-
{ key: 'faq', title: 'FAQ' },
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
export const Playground: Story = {
|
|
37
|
-
parameters: { controls: { disable: true } },
|
|
38
|
-
render: () => (
|
|
39
|
-
<div className="flex gap-6">
|
|
40
|
-
<aside className="sticky top-0 h-fit w-44 shrink-0">
|
|
41
|
-
<Anchor items={items} offsetTop={20} />
|
|
42
|
-
</aside>
|
|
43
|
-
<article className="flex-1 space-y-12 text-sm">
|
|
44
|
-
<section id="intro">
|
|
45
|
-
<h2 className="mb-2 text-lg font-semibold">介绍</h2>
|
|
46
|
-
<p>{Array(8).fill('这是介绍段落。').join(' ')}</p>
|
|
47
|
-
</section>
|
|
48
|
-
<section id="install">
|
|
49
|
-
<h2 className="mb-2 text-lg font-semibold">安装</h2>
|
|
50
|
-
<section id="npm" className="mb-6">
|
|
51
|
-
<h3 className="mb-2 font-semibold">npm</h3>
|
|
52
|
-
<p>{Array(6).fill('npm install.').join(' ')}</p>
|
|
53
|
-
</section>
|
|
54
|
-
<section id="pnpm" className="mb-6">
|
|
55
|
-
<h3 className="mb-2 font-semibold">pnpm</h3>
|
|
56
|
-
<p>{Array(6).fill('pnpm add.').join(' ')}</p>
|
|
57
|
-
</section>
|
|
58
|
-
<section id="yarn">
|
|
59
|
-
<h3 className="mb-2 font-semibold">yarn</h3>
|
|
60
|
-
<p>{Array(6).fill('yarn add.').join(' ')}</p>
|
|
61
|
-
</section>
|
|
62
|
-
</section>
|
|
63
|
-
<section id="usage">
|
|
64
|
-
<h2 className="mb-2 text-lg font-semibold">使用</h2>
|
|
65
|
-
<p>{Array(10).fill('使用说明文字。').join(' ')}</p>
|
|
66
|
-
</section>
|
|
67
|
-
<section id="faq">
|
|
68
|
-
<h2 className="mb-2 text-lg font-semibold">FAQ</h2>
|
|
69
|
-
<p>{Array(10).fill('常见问题。').join(' ')}</p>
|
|
70
|
-
</section>
|
|
71
|
-
</article>
|
|
72
|
-
</div>
|
|
73
|
-
),
|
|
74
|
-
};
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@/utils/cn';
|
|
4
|
-
|
|
5
|
-
export interface AnchorItem {
|
|
6
|
-
/** 目标元素 id(组件会按 `#${id}` 滚动到该元素)。 */
|
|
7
|
-
key: string;
|
|
8
|
-
/** 显示文本。 */
|
|
9
|
-
title: React.ReactNode;
|
|
10
|
-
/** 子节点(渲染为嵌套缩进)。 */
|
|
11
|
-
children?: AnchorItem[];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface AnchorProps
|
|
15
|
-
extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
16
|
-
/** 锚点项树(antd `items` 并集)。 */
|
|
17
|
-
items: AnchorItem[];
|
|
18
|
-
/**
|
|
19
|
-
* 当目标元素距视口顶部小于此值时高亮(IntersectionObserver `rootMargin`)。
|
|
20
|
-
* @default 0
|
|
21
|
-
*/
|
|
22
|
-
offsetTop?: number;
|
|
23
|
-
/**
|
|
24
|
-
* 点击锚点平滑滚动行为。
|
|
25
|
-
* @default "smooth"
|
|
26
|
-
*/
|
|
27
|
-
scrollBehavior?: 'smooth' | 'auto';
|
|
28
|
-
/** 当前高亮变化回调。 */
|
|
29
|
-
onChange?: (key: string) => void;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function flatten(items: AnchorItem[]): AnchorItem[] {
|
|
33
|
-
const out: AnchorItem[] = [];
|
|
34
|
-
const walk = (it: AnchorItem) => {
|
|
35
|
-
out.push(it);
|
|
36
|
-
it.children?.forEach(walk);
|
|
37
|
-
};
|
|
38
|
-
items.forEach(walk);
|
|
39
|
-
return out;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* 锚点导航 — antd 独有补足。**等价 antd `Anchor`**。长文档 / 详情页侧边的目录,
|
|
44
|
-
* 点击锚点滚动到对应 `id` 节点,滚动时自动高亮当前可见的锚点(IntersectionObserver)。
|
|
45
|
-
*/
|
|
46
|
-
const Anchor = React.forwardRef<HTMLElement, AnchorProps>(
|
|
47
|
-
(
|
|
48
|
-
{
|
|
49
|
-
items,
|
|
50
|
-
offsetTop = 0,
|
|
51
|
-
scrollBehavior = 'smooth',
|
|
52
|
-
onChange,
|
|
53
|
-
className,
|
|
54
|
-
...props
|
|
55
|
-
},
|
|
56
|
-
ref,
|
|
57
|
-
) => {
|
|
58
|
-
const [active, setActive] = React.useState<string>('');
|
|
59
|
-
const flat = React.useMemo(() => flatten(items), [items]);
|
|
60
|
-
|
|
61
|
-
React.useEffect(() => {
|
|
62
|
-
if (typeof window === 'undefined') return;
|
|
63
|
-
const observer = new IntersectionObserver(
|
|
64
|
-
(entries) => {
|
|
65
|
-
const visible = entries.find((e) => e.isIntersecting);
|
|
66
|
-
if (visible) {
|
|
67
|
-
const id = visible.target.id;
|
|
68
|
-
setActive(id);
|
|
69
|
-
onChange?.(id);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
rootMargin: `-${offsetTop}px 0px -50% 0px`,
|
|
74
|
-
threshold: 0,
|
|
75
|
-
},
|
|
76
|
-
);
|
|
77
|
-
flat.forEach((it) => {
|
|
78
|
-
const el = document.getElementById(it.key);
|
|
79
|
-
if (el) observer.observe(el);
|
|
80
|
-
});
|
|
81
|
-
return () => observer.disconnect();
|
|
82
|
-
}, [flat, offsetTop, onChange]);
|
|
83
|
-
|
|
84
|
-
const handleClick = (e: React.MouseEvent, key: string) => {
|
|
85
|
-
e.preventDefault();
|
|
86
|
-
const el = document.getElementById(key);
|
|
87
|
-
if (el) {
|
|
88
|
-
const top = el.getBoundingClientRect().top + window.scrollY - offsetTop;
|
|
89
|
-
window.scrollTo({ top, behavior: scrollBehavior });
|
|
90
|
-
setActive(key);
|
|
91
|
-
onChange?.(key);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const renderItem = (it: AnchorItem, depth: number): React.ReactNode => (
|
|
96
|
-
<li key={it.key}>
|
|
97
|
-
<a
|
|
98
|
-
href={`#${it.key}`}
|
|
99
|
-
onClick={(e) => handleClick(e, it.key)}
|
|
100
|
-
className={cn(
|
|
101
|
-
'block border-l-2 py-1 pr-2 text-xs transition-colors',
|
|
102
|
-
depth === 0 ? 'pl-3' : depth === 1 ? 'pl-6' : 'pl-9',
|
|
103
|
-
active === it.key
|
|
104
|
-
? 'border-primary text-primary'
|
|
105
|
-
: 'border-transparent text-muted-foreground hover:text-foreground',
|
|
106
|
-
)}
|
|
107
|
-
>
|
|
108
|
-
{it.title}
|
|
109
|
-
</a>
|
|
110
|
-
{it.children && it.children.length > 0 ? (
|
|
111
|
-
<ul>{it.children.map((c) => renderItem(c, depth + 1))}</ul>
|
|
112
|
-
) : null}
|
|
113
|
-
</li>
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
return (
|
|
117
|
-
<nav
|
|
118
|
-
ref={ref}
|
|
119
|
-
aria-label="目录"
|
|
120
|
-
className={cn('text-xs', className)}
|
|
121
|
-
{...props}
|
|
122
|
-
>
|
|
123
|
-
<ul>{items.map((it) => renderItem(it, 0))}</ul>
|
|
124
|
-
</nav>
|
|
125
|
-
);
|
|
126
|
-
},
|
|
127
|
-
);
|
|
128
|
-
Anchor.displayName = 'Anchor';
|
|
129
|
-
|
|
130
|
-
export { Anchor };
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: app
|
|
3
|
-
name: App
|
|
4
|
-
type: component
|
|
5
|
-
category: deprecated
|
|
6
|
-
since: 0.1.0
|
|
7
|
-
package: '@teamix-evo/ui'
|
|
8
|
-
displayName: 应用容器
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# App 应用容器
|
|
12
|
-
|
|
13
|
-
应用根容器 — antd 独有补足。**对标 antd `App`** 的核心职责:挂全局 Toaster + 设置 dir / lang + 承载根级 className。**与 antd 区别**:不接管主题(本库主题靠 design tokens / CSS vars,**不引入 runtime ConfigProvider**),也不收敛 `useApp()` hook(toast / notification 直接 import 即可)。
|
|
14
|
-
|
|
15
|
-
## When to use
|
|
16
|
-
|
|
17
|
-
- 整个应用的最外层容器(`layout.tsx` / `_app.tsx` / `main.tsx` root)
|
|
18
|
-
- 需要"挂一次 Toaster,后续到处 toast"的场景
|
|
19
|
-
- 国际化需要 `dir="rtl"` 时
|
|
20
|
-
|
|
21
|
-
## When NOT to use
|
|
22
|
-
|
|
23
|
-
- 子页面层级容器 → 用 `Flex` / `Grid` / 普通 div
|
|
24
|
-
- 需要 runtime 切换主题色 → 改 CSS variables(design tokens),**不要**通过 ConfigProvider
|
|
25
|
-
- 单独需要 Toaster → 直接挂 `<Toaster />`
|
|
26
|
-
|
|
27
|
-
## Props
|
|
28
|
-
|
|
29
|
-
<!-- auto:props:begin -->
|
|
30
|
-
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
31
|
-
| --- | --- | --- | --- | --- |
|
|
32
|
-
| `withToaster` | `boolean` | `true` | – | 是否挂载 `<Toaster />`(antd `App` 内部托管 message / notification 静态实例) — 全应用根挂一次。 |
|
|
33
|
-
| `toasterProps` | `ToasterProps` | – | – | 传递给 Toaster 的配置(位置 / 主题 / 自动关闭等) — 仅 `withToaster=true` 时生效。 |
|
|
34
|
-
| `dir` | `'ltr' \| 'rtl'` | `"ltr"` | – | 文字方向 — 设到根容器的 `dir` 属性,Radix 等组件会自动适配。 |
|
|
35
|
-
<!-- auto:props:end -->
|
|
36
|
-
|
|
37
|
-
## 依赖
|
|
38
|
-
|
|
39
|
-
<!-- auto:deps:begin -->
|
|
40
|
-
### 同库依赖
|
|
41
|
-
|
|
42
|
-
> `teamix-evo ui add app` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
43
|
-
|
|
44
|
-
| Entry | 类型 | 描述 |
|
|
45
|
-
| --- | --- | --- |
|
|
46
|
-
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
47
|
-
| `sonner` | component | Toast 通知 — sonner 包装,等价 antd message + notification 并集(toast() 函数式 API + Toaster 容器,面性 5 状态图标 + 无边框) |
|
|
48
|
-
|
|
49
|
-
### npm 依赖
|
|
50
|
-
|
|
51
|
-
_无 — 本组件不依赖任何 npm 包。_
|
|
52
|
-
<!-- auto:deps:end -->
|
|
53
|
-
|
|
54
|
-
## AI 生成纪律
|
|
55
|
-
|
|
56
|
-
- **整应用挂一次** — 子级别再嵌 `App` 会造成 Toaster 重复渲染
|
|
57
|
-
- **不要把它当 Layout 用** — 它只是根 mount 点,真正的页面布局用 `Flex` / `Grid`
|
|
58
|
-
- **`withToaster=false`** 仅当你已经在别处单独挂了 `<Toaster />` 时关闭,避免重复
|
|
59
|
-
- **`dir="rtl"`** 仅在阿语 / 希伯来语等右到左语言场景设;Radix 组件已自动适配
|
|
60
|
-
- **不要在 App 内做主题切换**:换 `class="dark"` 或写 CSS var 覆盖,**不要**走 React state
|
|
61
|
-
|
|
62
|
-
## Examples
|
|
63
|
-
|
|
64
|
-
```tsx
|
|
65
|
-
import { App } from '@/components/ui/app';
|
|
66
|
-
|
|
67
|
-
// 应用根
|
|
68
|
-
function Root() {
|
|
69
|
-
return (
|
|
70
|
-
<App>
|
|
71
|
-
<Header />
|
|
72
|
-
<Main />
|
|
73
|
-
<Footer />
|
|
74
|
-
</App>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// 自定义 Toaster 位置
|
|
79
|
-
<App toasterProps={{ position: 'top-center', richColors: true }}>
|
|
80
|
-
...
|
|
81
|
-
</App>
|
|
82
|
-
|
|
83
|
-
// RTL
|
|
84
|
-
<App dir="rtl">...</App>
|
|
85
|
-
|
|
86
|
-
// 已自挂 Toaster
|
|
87
|
-
<App withToaster={false}>
|
|
88
|
-
<Toaster position="bottom-right" />
|
|
89
|
-
...
|
|
90
|
-
</App>
|
|
91
|
-
```
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { App } from './app';
|
|
3
|
-
import { Button } from '@/components/button/button';
|
|
4
|
-
import { toast } from '@/components/sonner/sonner';
|
|
5
|
-
import { notification } from '@/components/notification/notification';
|
|
6
|
-
|
|
7
|
-
const meta: Meta<typeof App> = {
|
|
8
|
-
title: '废弃 · Deprecated/App',
|
|
9
|
-
component: App,
|
|
10
|
-
tags: ['autodocs'],
|
|
11
|
-
parameters: {
|
|
12
|
-
docs: {
|
|
13
|
-
description: {
|
|
14
|
-
component:
|
|
15
|
-
'⚠️ **已废弃** — 仅 Storybook 留档,不通过 manifest 对外发布。\n\n应用根容器 — 挂全局 Toaster + 设置 dir / lang + 承载根级 className。对标 antd `App`,但不接管主题(主题靠 design tokens / CSS vars),也不收敛 useApp() hook。',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
argTypes: {
|
|
20
|
-
withToaster: { control: 'boolean' },
|
|
21
|
-
dir: { control: 'inline-radio', options: ['ltr', 'rtl'] },
|
|
22
|
-
},
|
|
23
|
-
args: { withToaster: true, dir: 'ltr' },
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default meta;
|
|
27
|
-
type Story = StoryObj<typeof App>;
|
|
28
|
-
|
|
29
|
-
export const Playground: Story = {
|
|
30
|
-
render: (args) => (
|
|
31
|
-
<App {...args} className="rounded-md border border-border p-6">
|
|
32
|
-
<div className="flex flex-col gap-3">
|
|
33
|
-
<span className="text-sm text-muted-foreground">
|
|
34
|
-
App 内挂载了 Toaster,可直接触发:
|
|
35
|
-
</span>
|
|
36
|
-
<div className="flex gap-2">
|
|
37
|
-
<Button onClick={() => toast.success('已保存')}>触发 toast</Button>
|
|
38
|
-
<Button
|
|
39
|
-
variant="outline"
|
|
40
|
-
onClick={() =>
|
|
41
|
-
notification.primary({
|
|
42
|
-
title: 'App 容器在生效',
|
|
43
|
-
description: '右上角 Toaster 是 App 默认挂载的',
|
|
44
|
-
})
|
|
45
|
-
}
|
|
46
|
-
>
|
|
47
|
-
触发 notification
|
|
48
|
-
</Button>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</App>
|
|
52
|
-
),
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export const RTL: Story = {
|
|
56
|
-
parameters: { controls: { disable: true } },
|
|
57
|
-
render: () => (
|
|
58
|
-
<App dir="rtl" className="rounded-md border border-border p-6">
|
|
59
|
-
<div className="text-sm">
|
|
60
|
-
当前方向: <strong>rtl</strong> — 你会看到自然的右到左流向
|
|
61
|
-
</div>
|
|
62
|
-
</App>
|
|
63
|
-
),
|
|
64
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@/utils/cn';
|
|
4
|
-
import { Toaster, type ToasterProps } from '@/components/sonner/sonner';
|
|
5
|
-
|
|
6
|
-
export interface AppProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
/**
|
|
8
|
-
* 是否挂载 `<Toaster />`(antd `App` 内部托管 message / notification 静态实例) — 全应用根挂一次。
|
|
9
|
-
* @default true
|
|
10
|
-
*/
|
|
11
|
-
withToaster?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* 传递给 Toaster 的配置(位置 / 主题 / 自动关闭等) — 仅 `withToaster=true` 时生效。
|
|
14
|
-
*/
|
|
15
|
-
toasterProps?: ToasterProps;
|
|
16
|
-
/**
|
|
17
|
-
* 文字方向 — 设到根容器的 `dir` 属性,Radix 等组件会自动适配。
|
|
18
|
-
* @default "ltr"
|
|
19
|
-
*/
|
|
20
|
-
dir?: 'ltr' | 'rtl';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* 应用根容器 — antd 独有补足。**对标 antd `App`** 的核心职责:
|
|
25
|
-
* - **挂载全局 Toaster**(后续 toast / notification 静态调用的渲染层)
|
|
26
|
-
* - **设置 dir / lang** 等顶层属性
|
|
27
|
-
* - **承载根级 className**(让业务侧把 design tokens 挂到这一层即可)
|
|
28
|
-
*
|
|
29
|
-
* 与 antd 区别:
|
|
30
|
-
* - 不接管主题(本库主题靠 design tokens / CSS vars,**不引入 runtime ConfigProvider**)
|
|
31
|
-
* - 不收敛 `useApp()` hook 提供 message/notification(直接 import `toast` / `notification` 即可)
|
|
32
|
-
*/
|
|
33
|
-
const App = React.forwardRef<HTMLDivElement, AppProps>(
|
|
34
|
-
(
|
|
35
|
-
{
|
|
36
|
-
withToaster = true,
|
|
37
|
-
toasterProps,
|
|
38
|
-
dir = 'ltr',
|
|
39
|
-
className,
|
|
40
|
-
children,
|
|
41
|
-
...props
|
|
42
|
-
},
|
|
43
|
-
ref,
|
|
44
|
-
) => (
|
|
45
|
-
<div
|
|
46
|
-
ref={ref}
|
|
47
|
-
dir={dir}
|
|
48
|
-
className={cn('min-h-screen bg-background text-foreground', className)}
|
|
49
|
-
{...props}
|
|
50
|
-
>
|
|
51
|
-
{children}
|
|
52
|
-
{withToaster ? <Toaster {...toasterProps} /> : null}
|
|
53
|
-
</div>
|
|
54
|
-
),
|
|
55
|
-
);
|
|
56
|
-
App.displayName = 'App';
|
|
57
|
-
|
|
58
|
-
export { App };
|