@teamix-evo/ui 0.3.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 +420 -647
- 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 -462
- package/src/components/button/demo/as-child.tsx +0 -24
- package/src/components/button/demo/basic.tsx +0 -8
- package/src/components/button/demo/block.tsx +0 -16
- package/src/components/button/demo/loading.tsx +0 -19
- package/src/components/button/demo/shapes.tsx +0 -18
- package/src/components/button/demo/sizes.tsx +0 -19
- package/src/components/button/demo/variants.tsx +0 -19
- package/src/components/button/demo/with-icon.tsx +0 -20
- 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 -305
- 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 -541
- 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 -193
- 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 -1083
- 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 -469
- 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/demo/basic.tsx +0 -12
- package/src/components/input/demo/clearable.tsx +0 -21
- package/src/components/input/demo/show-count.tsx +0 -18
- package/src/components/input/demo/sizes.tsx +0 -15
- 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 -208
- package/src/components/page-header/page-header.stories.tsx +0 -421
- package/src/components/page-header/page-header.tsx +0 -281
- 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 -577
- 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 -150
- package/src/components/sidebar/sidebar.tsx +0 -824
- 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 -122
- 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 -53
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ArrowLeft } from 'lucide-react';
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/utils/cn';
|
|
5
|
-
import { Skeleton, SkeletonParagraph } from '@/components/skeleton/skeleton';
|
|
6
|
-
|
|
7
|
-
// ─── PageHeader: 顶层容器(<header>) ─────────────────────────────────────────
|
|
8
|
-
|
|
9
|
-
export interface PageHeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
10
|
-
/**
|
|
11
|
-
* 右下角背景装饰图 URL — 通过 inline `style.backgroundImage` 注入(Tailwind 不支持
|
|
12
|
-
* 动态 URL)。固定 `bg-no-repeat bg-right-bottom`。
|
|
13
|
-
*/
|
|
14
|
-
backgroundImage?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const PageHeader = React.forwardRef<HTMLElement, PageHeaderProps>(
|
|
18
|
-
({ className, backgroundImage, style, children, ...props }, ref) => {
|
|
19
|
-
const bgStyle: React.CSSProperties | undefined = backgroundImage
|
|
20
|
-
? {
|
|
21
|
-
backgroundImage: `url(${backgroundImage})`,
|
|
22
|
-
backgroundRepeat: 'no-repeat',
|
|
23
|
-
backgroundPosition: 'right bottom',
|
|
24
|
-
...style,
|
|
25
|
-
}
|
|
26
|
-
: style;
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<header
|
|
30
|
-
ref={ref}
|
|
31
|
-
className={cn(
|
|
32
|
-
'relative flex flex-col gap-4 overflow-hidden bg-background px-6 py-4',
|
|
33
|
-
className,
|
|
34
|
-
)}
|
|
35
|
-
style={bgStyle}
|
|
36
|
-
{...props}
|
|
37
|
-
>
|
|
38
|
-
{children}
|
|
39
|
-
</header>
|
|
40
|
-
);
|
|
41
|
-
},
|
|
42
|
-
);
|
|
43
|
-
PageHeader.displayName = 'PageHeader';
|
|
44
|
-
|
|
45
|
-
// ─── PageHeaderNav: 导航层(面包屑 + 右侧链接)──────────────────────────────
|
|
46
|
-
|
|
47
|
-
const PageHeaderNav = React.forwardRef<
|
|
48
|
-
HTMLDivElement,
|
|
49
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
50
|
-
>(({ className, ...props }, ref) => (
|
|
51
|
-
<div
|
|
52
|
-
ref={ref}
|
|
53
|
-
className={cn(
|
|
54
|
-
'flex min-h-5 items-center justify-between text-xs',
|
|
55
|
-
className,
|
|
56
|
-
)}
|
|
57
|
-
{...props}
|
|
58
|
-
/>
|
|
59
|
-
));
|
|
60
|
-
PageHeaderNav.displayName = 'PageHeaderNav';
|
|
61
|
-
|
|
62
|
-
// ─── PageHeaderContent: 主内容区(左右双列)─────────────────────────────────
|
|
63
|
-
|
|
64
|
-
const PageHeaderContent = React.forwardRef<
|
|
65
|
-
HTMLDivElement,
|
|
66
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
67
|
-
>(({ className, ...props }, ref) => (
|
|
68
|
-
<div
|
|
69
|
-
ref={ref}
|
|
70
|
-
className={cn(
|
|
71
|
-
'flex flex-wrap items-start justify-between gap-4',
|
|
72
|
-
className,
|
|
73
|
-
)}
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
));
|
|
77
|
-
PageHeaderContent.displayName = 'PageHeaderContent';
|
|
78
|
-
|
|
79
|
-
// ─── PageHeaderHeading: 标题行 ───────────────────────────────────────────────
|
|
80
|
-
|
|
81
|
-
export interface PageHeaderHeadingProps
|
|
82
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
83
|
-
/**
|
|
84
|
-
* 前置返回按钮。为 `true` 时渲染 `ArrowLeft` 图标按钮,点击触发 `onBack`。
|
|
85
|
-
* @default false
|
|
86
|
-
*/
|
|
87
|
-
goBack?: boolean;
|
|
88
|
-
/** 返回按钮点击回调。 */
|
|
89
|
-
onBack?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const PageHeaderHeading = React.forwardRef<
|
|
93
|
-
HTMLDivElement,
|
|
94
|
-
PageHeaderHeadingProps
|
|
95
|
-
>(({ className, goBack = false, onBack, children, ...props }, ref) => (
|
|
96
|
-
<div
|
|
97
|
-
ref={ref}
|
|
98
|
-
className={cn('flex items-center gap-3', className)}
|
|
99
|
-
{...props}
|
|
100
|
-
>
|
|
101
|
-
{goBack ? (
|
|
102
|
-
<button
|
|
103
|
-
type="button"
|
|
104
|
-
onClick={onBack}
|
|
105
|
-
aria-label="返回"
|
|
106
|
-
className={cn(
|
|
107
|
-
'inline-flex size-8 shrink-0 cursor-pointer items-center justify-center text-muted-foreground transition-colors',
|
|
108
|
-
'hover:text-foreground',
|
|
109
|
-
'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',
|
|
110
|
-
)}
|
|
111
|
-
>
|
|
112
|
-
<ArrowLeft className="size-5" aria-hidden="true" />
|
|
113
|
-
</button>
|
|
114
|
-
) : null}
|
|
115
|
-
{children}
|
|
116
|
-
</div>
|
|
117
|
-
));
|
|
118
|
-
PageHeaderHeading.displayName = 'PageHeaderHeading';
|
|
119
|
-
|
|
120
|
-
// ─── PageHeaderDescription: 描述文字(<p>) ──────────────────────────────────
|
|
121
|
-
|
|
122
|
-
const PageHeaderDescription = React.forwardRef<
|
|
123
|
-
HTMLParagraphElement,
|
|
124
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
125
|
-
>(({ className, ...props }, ref) => (
|
|
126
|
-
<p
|
|
127
|
-
ref={ref}
|
|
128
|
-
className={cn('text-xs text-muted-foreground', className)}
|
|
129
|
-
{...props}
|
|
130
|
-
/>
|
|
131
|
-
));
|
|
132
|
-
PageHeaderDescription.displayName = 'PageHeaderDescription';
|
|
133
|
-
|
|
134
|
-
// ─── PageHeaderActions: 操作按钮区 ───────────────────────────────────────────
|
|
135
|
-
|
|
136
|
-
const PageHeaderActions = React.forwardRef<
|
|
137
|
-
HTMLDivElement,
|
|
138
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
139
|
-
>(({ className, ...props }, ref) => (
|
|
140
|
-
<div
|
|
141
|
-
ref={ref}
|
|
142
|
-
className={cn('flex shrink-0 items-center gap-2', className)}
|
|
143
|
-
{...props}
|
|
144
|
-
/>
|
|
145
|
-
));
|
|
146
|
-
PageHeaderActions.displayName = 'PageHeaderActions';
|
|
147
|
-
|
|
148
|
-
// ─── PageHeaderData / PageHeaderDataItem: 数据概览 ───────────────────────────
|
|
149
|
-
|
|
150
|
-
const PageHeaderData = React.forwardRef<
|
|
151
|
-
HTMLDivElement,
|
|
152
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
153
|
-
>(({ className, ...props }, ref) => (
|
|
154
|
-
<div
|
|
155
|
-
ref={ref}
|
|
156
|
-
className={cn('flex shrink-0 items-end gap-6', className)}
|
|
157
|
-
{...props}
|
|
158
|
-
/>
|
|
159
|
-
));
|
|
160
|
-
PageHeaderData.displayName = 'PageHeaderData';
|
|
161
|
-
|
|
162
|
-
const dataItemColor = {
|
|
163
|
-
default: 'text-foreground',
|
|
164
|
-
primary: 'text-primary',
|
|
165
|
-
success: 'text-success',
|
|
166
|
-
warning: 'text-warning',
|
|
167
|
-
destructive: 'text-destructive',
|
|
168
|
-
} as const;
|
|
169
|
-
|
|
170
|
-
export interface PageHeaderDataItemProps
|
|
171
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
172
|
-
/** 数据标签(上行,muted 小字)。 */
|
|
173
|
-
label: React.ReactNode;
|
|
174
|
-
/**
|
|
175
|
-
* 值的语义色(调色板) — 对齐 [ADR 0021](../../../../../docs/adr/0021-semantic-color-api-unification.md)。
|
|
176
|
-
*
|
|
177
|
-
* 填充背景类场景 default 本身为中性色,省略 muted 档;信息色用 `primary`,不收 `info`。
|
|
178
|
-
* @default "default"
|
|
179
|
-
*/
|
|
180
|
-
color?: keyof typeof dataItemColor;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
const PageHeaderDataItem = React.forwardRef<
|
|
184
|
-
HTMLDivElement,
|
|
185
|
-
PageHeaderDataItemProps
|
|
186
|
-
>(({ className, label, color = 'default', children, ...props }, ref) => (
|
|
187
|
-
<div ref={ref} className={cn('flex flex-col', className)} {...props}>
|
|
188
|
-
<span className="text-xs text-muted-foreground">{label}</span>
|
|
189
|
-
<span
|
|
190
|
-
className={cn(
|
|
191
|
-
'text-base font-semibold tabular-nums',
|
|
192
|
-
dataItemColor[color],
|
|
193
|
-
)}
|
|
194
|
-
>
|
|
195
|
-
{children}
|
|
196
|
-
</span>
|
|
197
|
-
</div>
|
|
198
|
-
));
|
|
199
|
-
PageHeaderDataItem.displayName = 'PageHeaderDataItem';
|
|
200
|
-
|
|
201
|
-
// ─── PageHeaderFooter: 底部详情 ──────────────────────────────────────────────
|
|
202
|
-
|
|
203
|
-
const PageHeaderFooter = React.forwardRef<
|
|
204
|
-
HTMLDivElement,
|
|
205
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
206
|
-
>(({ className, ...props }, ref) => (
|
|
207
|
-
<div
|
|
208
|
-
ref={ref}
|
|
209
|
-
className={cn('mt-4 border-t border-t-border pt-4', className)}
|
|
210
|
-
{...props}
|
|
211
|
-
/>
|
|
212
|
-
));
|
|
213
|
-
PageHeaderFooter.displayName = 'PageHeaderFooter';
|
|
214
|
-
|
|
215
|
-
// ─── PageHeaderSkeleton: 骨架屏 ──────────────────────────────────────────────
|
|
216
|
-
|
|
217
|
-
export interface PageHeaderSkeletonProps
|
|
218
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
219
|
-
/**
|
|
220
|
-
* 显示面包屑骨架行。
|
|
221
|
-
* @default true
|
|
222
|
-
*/
|
|
223
|
-
showNav?: boolean;
|
|
224
|
-
/**
|
|
225
|
-
* 显示描述骨架行。
|
|
226
|
-
* @default true
|
|
227
|
-
*/
|
|
228
|
-
showDescription?: boolean;
|
|
229
|
-
/**
|
|
230
|
-
* 显示底部详情骨架(3 列 × 2 行网格)。
|
|
231
|
-
* @default false
|
|
232
|
-
*/
|
|
233
|
-
showFooter?: boolean;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const PageHeaderSkeleton = React.forwardRef<
|
|
237
|
-
HTMLDivElement,
|
|
238
|
-
PageHeaderSkeletonProps
|
|
239
|
-
>(
|
|
240
|
-
(
|
|
241
|
-
{
|
|
242
|
-
className,
|
|
243
|
-
showNav = true,
|
|
244
|
-
showDescription = true,
|
|
245
|
-
showFooter = false,
|
|
246
|
-
...props
|
|
247
|
-
},
|
|
248
|
-
ref,
|
|
249
|
-
) => (
|
|
250
|
-
<div
|
|
251
|
-
ref={ref}
|
|
252
|
-
className={cn('flex flex-col gap-4 bg-background px-6 py-4', className)}
|
|
253
|
-
aria-busy="true"
|
|
254
|
-
{...props}
|
|
255
|
-
>
|
|
256
|
-
{showNav ? <Skeleton shape="line" className="h-3 w-48" /> : null}
|
|
257
|
-
<div className="flex items-center gap-3">
|
|
258
|
-
<Skeleton shape="rect" className="size-8 rounded-md" />
|
|
259
|
-
<Skeleton shape="line" className="h-6 w-80" />
|
|
260
|
-
</div>
|
|
261
|
-
{showDescription ? <Skeleton shape="line" className="h-4 w-96" /> : null}
|
|
262
|
-
{showFooter ? <SkeletonParagraph rows={2} className="pt-3" /> : null}
|
|
263
|
-
</div>
|
|
264
|
-
),
|
|
265
|
-
);
|
|
266
|
-
PageHeaderSkeleton.displayName = 'PageHeaderSkeleton';
|
|
267
|
-
|
|
268
|
-
// ─── exports ─────────────────────────────────────────────────────────────────
|
|
269
|
-
|
|
270
|
-
export {
|
|
271
|
-
PageHeader,
|
|
272
|
-
PageHeaderNav,
|
|
273
|
-
PageHeaderContent,
|
|
274
|
-
PageHeaderHeading,
|
|
275
|
-
PageHeaderDescription,
|
|
276
|
-
PageHeaderActions,
|
|
277
|
-
PageHeaderData,
|
|
278
|
-
PageHeaderDataItem,
|
|
279
|
-
PageHeaderFooter,
|
|
280
|
-
PageHeaderSkeleton,
|
|
281
|
-
};
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: pagination
|
|
3
|
-
name: Pagination
|
|
4
|
-
displayName: 分页
|
|
5
|
-
type: component
|
|
6
|
-
category: navigation
|
|
7
|
-
since: 0.1.0
|
|
8
|
-
package: '@teamix-evo/ui'
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Pagination 分页
|
|
12
|
-
|
|
13
|
-
**分页 — 在大量内容中按页切换浏览,带受控/非受控 + 页码窗口折叠 + 三档密度 + 三种形态**。两套 API:
|
|
14
|
-
|
|
15
|
-
1. **shadcn primitives**(`Pagination / Content / Item / Link / Previous / Next / Ellipsis`)— 完全可组合,适合自定义复杂分页布局
|
|
16
|
-
2. **`SimplePagination`**(antd 风格 props 化高阶包装)— `total / pageSize / current / onChange` 即用,**自动计算页码窗口 + 折叠 ellipsis + 显示总数**;支持 `size` (`sm`/`md`/`lg`)、`type` (`normal`/`simple`/`mini`)、`pageSizeSelector` + `pageSizeList`、`showJump`、`showFirstLast`
|
|
17
|
-
|
|
18
|
-
## When to use
|
|
19
|
-
|
|
20
|
-
- 列表 / 表格分页(配 Data Table)
|
|
21
|
-
- 长内容多页阅读
|
|
22
|
-
- 搜索结果分页
|
|
23
|
-
- **空间紧凑场景** → `type="mini"`(仅前后箭头 + 页号/总页)
|
|
24
|
-
- **移动端 / 卡片右下角** → `type="simple"`(prev + 当前/总 + next)
|
|
25
|
-
|
|
26
|
-
## When NOT to use
|
|
27
|
-
|
|
28
|
-
- 无限滚动 → IntersectionObserver + `hasMore` flag
|
|
29
|
-
- 总数小(< 1 页)→ 不显示
|
|
30
|
-
|
|
31
|
-
## Props
|
|
32
|
-
|
|
33
|
-
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。
|
|
34
|
-
|
|
35
|
-
<!-- auto:props:begin -->
|
|
36
|
-
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
37
|
-
| --- | --- | --- | --- | --- |
|
|
38
|
-
| `current` | `number` | – | – | 当前页(1-based,受控)。与 `defaultCurrent` 互斥。 |
|
|
39
|
-
| `defaultCurrent` | `number` | `1` | – | 默认当前页(非受控)。 |
|
|
40
|
-
| `onChange` | `(page: number, pageSize: number) => void` | – | – | 页码 / pageSize 变化回调。第二参为变化后的 pageSize。 |
|
|
41
|
-
| `total` | `number` | – | ✓ | 总条数。 |
|
|
42
|
-
| `pageSize` | `number` | – | – | 每页大小(受控)。与 `defaultPageSize` 互斥。 |
|
|
43
|
-
| `defaultPageSize` | `number` | `10` | – | 默认每页大小(非受控)。 |
|
|
44
|
-
| `pageSizeList` | `number[]` | `[10, 20, 50, 100]` | – | 每页大小可选项(用于 `pageSizeSelector`)。 |
|
|
45
|
-
| `pageSizeSelector` | `boolean` | `false` | – | 显示每页大小选择器(对齐 antd `showSizeChanger` / cloud-design `pageSizeSelector`)。 |
|
|
46
|
-
| `onPageSizeChange` | `(pageSize: number) => void` | – | – | pageSize 变化回调。 |
|
|
47
|
-
| `size` | `PaginationSize` | `"md"` | – | 组件大小,对齐 Button / Input 的 sm(h-7) / md(h-8) / lg(h-9) 三档。 |
|
|
48
|
-
| `type` | `PaginationType` | `"normal"` | – | 组件类型 — `normal` 完整 / `simple` 简化(prev + 页码/总页 + next) / `mini` 极简(仅前后箭头)。 |
|
|
49
|
-
| `showFirstLast` | `boolean` | `false` | – | `normal` 类型下,显示首末页快捷按钮。 |
|
|
50
|
-
| `showTotal` | `boolean` | `true` | – | 显示总数文本(`mini` 类型默认不显示)。 |
|
|
51
|
-
| `totalRender` | `(total: number, range: [number, number]) => React.ReactNode` | – | – | 自定义总数渲染。 |
|
|
52
|
-
| `showJump` | `boolean` | `false` | – | `normal` 类型下,显示跳转输入框。 |
|
|
53
|
-
| `siblingCount` | `number` | `5` | – | 中间显示几个页号。建议奇数。 |
|
|
54
|
-
| `className` | `string` | – | – | 容器 className。 |
|
|
55
|
-
<!-- auto:props:end -->
|
|
56
|
-
|
|
57
|
-
## 依赖
|
|
58
|
-
|
|
59
|
-
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
|
|
60
|
-
|
|
61
|
-
<!-- auto:deps:begin -->
|
|
62
|
-
### 同库依赖
|
|
63
|
-
|
|
64
|
-
> `teamix-evo ui add pagination` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
65
|
-
|
|
66
|
-
| Entry | 类型 | 描述 |
|
|
67
|
-
| --- | --- | --- |
|
|
68
|
-
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
69
|
-
| `button` | component | 通用按钮 — shadcn 实现 + cloud-design 能力并集(loading / icon / shape / block / dashed variant / color 语义双 prop / disabledTooltip)。同文件合一导出 ButtonGroup + ButtonGroupText(等价 antd Space.Compact + cd SplitButton)。 |
|
|
70
|
-
|
|
71
|
-
### npm 依赖
|
|
72
|
-
|
|
73
|
-
> 业务侧需要先 `pnpm add` / `npm install` 这些包。CLI 在 `ui add` 完成后会列出此提示。
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
pnpm add class-variance-authority@^0.7.0 lucide-react@^0.460.0
|
|
77
|
-
```
|
|
78
|
-
<!-- auto:deps:end -->
|
|
79
|
-
|
|
80
|
-
## AI 生成纪律
|
|
81
|
-
|
|
82
|
-
- **业务侧用 `SimplePagination`**:除非要完全自定义布局,默认走高阶 API
|
|
83
|
-
- **`size` 三档对齐 Button/Input**:`sm`(h-7) / `md`(h-8,默认) / `lg`(h-9);**不要**自己加 `h-[28px]` 等 arbitrary value
|
|
84
|
-
- **`type` 三态语义清晰**:
|
|
85
|
-
- `normal` = 完整(页码列表 + prev/next + 可选 pageSizeSelector / showJump / showFirstLast)
|
|
86
|
-
- `simple` = 简化(prev + 当前页/总页 + next),适合卡片角落
|
|
87
|
-
- `mini` = 极简(仅 prev/next 图标 + 页号/总页文本),适合表格行内 / 工具条
|
|
88
|
-
- **`pageSizeSelector` 仅 normal 生效**:`simple` / `mini` 形态下传入会被忽略
|
|
89
|
-
- **当前页 1-based**:antd 惯例,与 0-based 数组索引区分清楚
|
|
90
|
-
- **`pageSize` 默认 10**:与 antd / Web 主流一致;`pageSizeList` 默认 `[10, 20, 50, 100]`
|
|
91
|
-
- **`siblingCount` 控制中间窗口**:奇数(5/7)效果好,偶数会产生不对称
|
|
92
|
-
- **`onChange` 第二参为 pageSize**:`(page, pageSize) => void` — 切换 pageSize 时会回到第 1 页并触发一次 `onChange(1, newSize)`
|
|
93
|
-
- **不要嵌套 Pagination**:同一容器只一组分页
|
|
94
|
-
- **不要传 antd 的 `defaultPageSize` 同时传 `pageSize`**:受控/非受控择一(运行时以受控值为准)
|
|
95
|
-
- **跳转输入框**:`showJump` 默认 `false`,启用后回车提交;非数字静默忽略
|
|
96
|
-
|
|
97
|
-
## Examples
|
|
98
|
-
|
|
99
|
-
```tsx
|
|
100
|
-
import { SimplePagination } from '@/components/ui/pagination';
|
|
101
|
-
import * as React from 'react';
|
|
102
|
-
|
|
103
|
-
// 受控 + 默认 normal × md
|
|
104
|
-
const [page, setPage] = React.useState(1);
|
|
105
|
-
<SimplePagination
|
|
106
|
-
total={245}
|
|
107
|
-
current={page}
|
|
108
|
-
pageSize={10}
|
|
109
|
-
onChange={(p) => setPage(p)}
|
|
110
|
-
/>
|
|
111
|
-
|
|
112
|
-
// 三档尺寸
|
|
113
|
-
<SimplePagination total={245} size="sm" current={page} onChange={(p) => setPage(p)} />
|
|
114
|
-
<SimplePagination total={245} size="md" current={page} onChange={(p) => setPage(p)} />
|
|
115
|
-
<SimplePagination total={245} size="lg" current={page} onChange={(p) => setPage(p)} />
|
|
116
|
-
|
|
117
|
-
// 简化形态(卡片右下角)
|
|
118
|
-
<SimplePagination
|
|
119
|
-
type="simple"
|
|
120
|
-
total={245}
|
|
121
|
-
current={page}
|
|
122
|
-
onChange={(p) => setPage(p)}
|
|
123
|
-
/>
|
|
124
|
-
|
|
125
|
-
// 极简形态(表格行内 / 工具条)
|
|
126
|
-
<SimplePagination
|
|
127
|
-
type="mini"
|
|
128
|
-
total={245}
|
|
129
|
-
current={page}
|
|
130
|
-
onChange={(p) => setPage(p)}
|
|
131
|
-
/>
|
|
132
|
-
|
|
133
|
-
// 完整能力 — pageSizeSelector + showJump + showFirstLast
|
|
134
|
-
<SimplePagination
|
|
135
|
-
total={1234}
|
|
136
|
-
current={page}
|
|
137
|
-
pageSizeSelector
|
|
138
|
-
pageSizeList={[10, 20, 50, 100]}
|
|
139
|
-
showJump
|
|
140
|
-
showFirstLast
|
|
141
|
-
onChange={(p, s) => {
|
|
142
|
-
setPage(p);
|
|
143
|
-
/* s 是当前 pageSize */
|
|
144
|
-
}}
|
|
145
|
-
onPageSizeChange={(s) => console.log('pageSize →', s)}
|
|
146
|
-
/>
|
|
147
|
-
|
|
148
|
-
// 自定义总数文本
|
|
149
|
-
<SimplePagination
|
|
150
|
-
total={245}
|
|
151
|
-
current={page}
|
|
152
|
-
onChange={(p) => setPage(p)}
|
|
153
|
-
totalRender={(t, [s, e]) => `${s}-${e} of ${t}`}
|
|
154
|
-
/>
|
|
155
|
-
|
|
156
|
-
// 非受控 — defaultCurrent + defaultPageSize
|
|
157
|
-
<SimplePagination total={245} defaultCurrent={2} defaultPageSize={20} pageSizeSelector />
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
```tsx
|
|
161
|
-
// 自由组合(primitives)— 自定义任意布局
|
|
162
|
-
import {
|
|
163
|
-
Pagination,
|
|
164
|
-
PaginationContent,
|
|
165
|
-
PaginationItem,
|
|
166
|
-
PaginationLink,
|
|
167
|
-
PaginationPrevious,
|
|
168
|
-
PaginationNext,
|
|
169
|
-
PaginationEllipsis,
|
|
170
|
-
} from '@/components/ui/pagination';
|
|
171
|
-
|
|
172
|
-
<Pagination>
|
|
173
|
-
<PaginationContent>
|
|
174
|
-
<PaginationItem>
|
|
175
|
-
<PaginationPrevious size="md" onClick={...} />
|
|
176
|
-
</PaginationItem>
|
|
177
|
-
<PaginationItem>
|
|
178
|
-
<PaginationLink size="md" onClick={...}>1</PaginationLink>
|
|
179
|
-
</PaginationItem>
|
|
180
|
-
<PaginationItem>
|
|
181
|
-
<PaginationLink size="md" isActive>2</PaginationLink>
|
|
182
|
-
</PaginationItem>
|
|
183
|
-
<PaginationItem>
|
|
184
|
-
<PaginationLink size="md" onClick={...}>3</PaginationLink>
|
|
185
|
-
</PaginationItem>
|
|
186
|
-
<PaginationItem>
|
|
187
|
-
<PaginationEllipsis size="md" />
|
|
188
|
-
</PaginationItem>
|
|
189
|
-
<PaginationItem>
|
|
190
|
-
<PaginationNext size="md" onClick={...} />
|
|
191
|
-
</PaginationItem>
|
|
192
|
-
</PaginationContent>
|
|
193
|
-
</Pagination>;
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
## Pagination 形态 — 旧库 API → 新映射
|
|
199
|
-
|
|
200
|
-
> 旧库 `Pagination`(hybridcloud) → 新库 `SimplePagination`(高阶 API) + Pagination Primitives(自由组合)。
|
|
201
|
-
> 新库提供两层架构:SimplePagination 开箱即用;Primitives 用于自定义布局。
|
|
202
|
-
|
|
203
|
-
### 命名 & 结构映射
|
|
204
|
-
|
|
205
|
-
| 旧库 | 新库 | 说明 |
|
|
206
|
-
| ---------------------------------- | ---------------------------------- | ---------------------------- |
|
|
207
|
-
| `Pagination` | `SimplePagination` | 高阶封装(开箱即用) |
|
|
208
|
-
| — | `Pagination` + Primitives | 新库新增自由组合层 |
|
|
209
|
-
| `type: 'normal'\|'simple'\|'mini'` | `type: 'normal'\|'simple'\|'mini'` | 保持一致 |
|
|
210
|
-
| `size: small/medium/large` | `size: 'sm' \| 'md' \| 'lg'` | md = medium |
|
|
211
|
-
| `onChange(current, e)` | `onChange(page, pageSize)` | 签名变更,第二参改为 pageSize |
|
|
212
|
-
| `pageSizeSelector='dropdown'` | `pageSizeSelector={true}` | 简化为布尔 |
|
|
213
|
-
| `pageShowCount` | `siblingCount` | 当前页两侧显示页数 |
|
|
214
|
-
| `showJump` | `showJump` | 跳转输入框 |
|
|
215
|
-
| `totalRender` | `totalRender` | 总条数自定义渲染 |
|
|
216
|
-
| `hideOnlyOnePage` | 不复刻 | 业务层条件渲染更灵活 |
|
|
217
|
-
| `link` (链接模式) | 不复刻 | Primitives 自行用 `<a>` |
|
|
218
|
-
| `shape` | 不复刻 | 不再设计多种箭头变体 |
|
|
219
|
-
| `pageSizePosition` | 不复刻 | 固定右侧 |
|
|
220
|
-
| `useFloatLayout` | 不复刻 | 用 flexbox 替代 |
|
|
221
|
-
| `pageNumberRender` | 不复刻 | 通过 Primitives 自行实现 |
|
|
222
|
-
|
|
223
|
-
### 迁移 FAQ
|
|
224
|
-
|
|
225
|
-
| 问题 | 回答 |
|
|
226
|
-
| ---------------------------- | ------------------------------------------------------------------------------ |
|
|
227
|
-
| onChange 签名差异? | 旧: `(current, event)` → 新: `(page, pageSize)` — 第二参从 event 改为 pageSize |
|
|
228
|
-
| 怎么做自定义布局? | 用 Primitives(Pagination + PaginationContent + PaginationLink + …) |
|
|
229
|
-
| showFirstLast? | SimplePagination 已内置首/末页按钮(P0 新增能力) |
|
|
230
|
-
| pageSizeSelector 选项怎么配? | `pageSizeList` prop 传入 `[10, 20, 50, 100]` 数组 |
|