@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,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]` 数组 |
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
-
import { SimplePagination } from './pagination';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof SimplePagination> = {
|
|
6
|
-
title: '导航 · Navigation/Pagination',
|
|
7
|
-
component: SimplePagination,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component:
|
|
13
|
-
'**分页 Pagination —— 在大量内容中按页切换浏览,带受控/非受控 + 页码窗口折叠**。shadcn primitives(`Pagination / Content / Item / Link / Previous / Next / Ellipsis`)+ 高阶 `SimplePagination`(antd 风格 props 化)。**对齐 antd `size` / `defaultPageSize` / `pageSizeOptions` / `showSizeChanger` 与 cloud-design `type` / `pageSizeSelector` / `pageSizeList` / `showJump` 的并集**:`size` (`sm`/`md`/`lg` 对齐 Button/Input)、`type` (`normal`/`simple`/`mini`)、`pageSizeSelector`、`pageSizeList`、`showJump`、`showFirstLast`、`showTotal`、`totalRender`、`siblingCount`。视觉走 OpenTrek semantic tokens,所有样式来自 `@teamix-evo/tokens`,无 mock。',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
argTypes: {
|
|
18
|
-
total: { control: 'number' },
|
|
19
|
-
pageSize: { control: 'number' },
|
|
20
|
-
siblingCount: { control: 'number' },
|
|
21
|
-
showFirstLast: { control: 'boolean' },
|
|
22
|
-
showTotal: { control: 'boolean' },
|
|
23
|
-
showJump: { control: 'boolean' },
|
|
24
|
-
pageSizeSelector: { control: 'boolean' },
|
|
25
|
-
size: { control: 'inline-radio', options: ['sm', 'md', 'lg'] },
|
|
26
|
-
type: { control: 'inline-radio', options: ['normal', 'simple', 'mini'] },
|
|
27
|
-
},
|
|
28
|
-
args: {
|
|
29
|
-
total: 245,
|
|
30
|
-
pageSize: 10,
|
|
31
|
-
siblingCount: 5,
|
|
32
|
-
size: 'md',
|
|
33
|
-
type: 'normal',
|
|
34
|
-
},
|
|
35
|
-
decorators: [(Story) => <div className="w-[760px]">{Story()}</div>],
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default meta;
|
|
39
|
-
type Story = StoryObj<typeof SimplePagination>;
|
|
40
|
-
|
|
41
|
-
export const Playground: Story = {
|
|
42
|
-
render: (args) => {
|
|
43
|
-
const [page, setPage] = React.useState(args.current ?? 1);
|
|
44
|
-
return (
|
|
45
|
-
<SimplePagination
|
|
46
|
-
{...args}
|
|
47
|
-
current={page}
|
|
48
|
-
onChange={(p) => setPage(p)}
|
|
49
|
-
/>
|
|
50
|
-
);
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// ─── size 三档 ────────────────────────────────────────────────────────────────
|
|
55
|
-
|
|
56
|
-
export const SizeSmall: Story = {
|
|
57
|
-
parameters: { controls: { disable: true } },
|
|
58
|
-
render: () => {
|
|
59
|
-
const [page, setPage] = React.useState(3);
|
|
60
|
-
return (
|
|
61
|
-
<SimplePagination
|
|
62
|
-
total={245}
|
|
63
|
-
size="sm"
|
|
64
|
-
current={page}
|
|
65
|
-
onChange={(p) => setPage(p)}
|
|
66
|
-
/>
|
|
67
|
-
);
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const SizeMedium: Story = {
|
|
72
|
-
parameters: { controls: { disable: true } },
|
|
73
|
-
render: () => {
|
|
74
|
-
const [page, setPage] = React.useState(3);
|
|
75
|
-
return (
|
|
76
|
-
<SimplePagination
|
|
77
|
-
total={245}
|
|
78
|
-
size="md"
|
|
79
|
-
current={page}
|
|
80
|
-
onChange={(p) => setPage(p)}
|
|
81
|
-
/>
|
|
82
|
-
);
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export const SizeLarge: Story = {
|
|
87
|
-
parameters: { controls: { disable: true } },
|
|
88
|
-
render: () => {
|
|
89
|
-
const [page, setPage] = React.useState(3);
|
|
90
|
-
return (
|
|
91
|
-
<SimplePagination
|
|
92
|
-
total={245}
|
|
93
|
-
size="lg"
|
|
94
|
-
current={page}
|
|
95
|
-
onChange={(p) => setPage(p)}
|
|
96
|
-
/>
|
|
97
|
-
);
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// ─── type 三态 ────────────────────────────────────────────────────────────────
|
|
102
|
-
|
|
103
|
-
export const TypeNormal: Story = {
|
|
104
|
-
parameters: { controls: { disable: true } },
|
|
105
|
-
render: () => {
|
|
106
|
-
const [page, setPage] = React.useState(3);
|
|
107
|
-
return (
|
|
108
|
-
<SimplePagination
|
|
109
|
-
total={245}
|
|
110
|
-
type="normal"
|
|
111
|
-
current={page}
|
|
112
|
-
onChange={(p) => setPage(p)}
|
|
113
|
-
/>
|
|
114
|
-
);
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export const TypeSimple: Story = {
|
|
119
|
-
parameters: { controls: { disable: true } },
|
|
120
|
-
render: () => {
|
|
121
|
-
const [page, setPage] = React.useState(3);
|
|
122
|
-
return (
|
|
123
|
-
<SimplePagination
|
|
124
|
-
total={245}
|
|
125
|
-
type="simple"
|
|
126
|
-
current={page}
|
|
127
|
-
onChange={(p) => setPage(p)}
|
|
128
|
-
/>
|
|
129
|
-
);
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export const TypeMini: Story = {
|
|
134
|
-
parameters: { controls: { disable: true } },
|
|
135
|
-
render: () => {
|
|
136
|
-
const [page, setPage] = React.useState(3);
|
|
137
|
-
return (
|
|
138
|
-
<SimplePagination
|
|
139
|
-
total={245}
|
|
140
|
-
type="mini"
|
|
141
|
-
current={page}
|
|
142
|
-
onChange={(p) => setPage(p)}
|
|
143
|
-
/>
|
|
144
|
-
);
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
// ─── 矩阵:type × size(共 9 个组合)─────────────────────────────────────────
|
|
149
|
-
|
|
150
|
-
export const Matrix: Story = {
|
|
151
|
-
parameters: {
|
|
152
|
-
controls: { disable: true },
|
|
153
|
-
docs: {
|
|
154
|
-
description: {
|
|
155
|
-
story:
|
|
156
|
-
'`type × size` 的完整矩阵 — 用于一眼比对所有形态的视觉密度与高度对齐(对应 Button/Input 的 h-7 / h-8 / h-9 三档)。',
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
render: () => {
|
|
161
|
-
const types: Array<'normal' | 'simple' | 'mini'> = [
|
|
162
|
-
'normal',
|
|
163
|
-
'simple',
|
|
164
|
-
'mini',
|
|
165
|
-
];
|
|
166
|
-
const sizes: Array<'sm' | 'md' | 'lg'> = ['sm', 'md', 'lg'];
|
|
167
|
-
return (
|
|
168
|
-
<div className="flex flex-col gap-6">
|
|
169
|
-
{types.map((t) => (
|
|
170
|
-
<div key={t} className="flex flex-col gap-3">
|
|
171
|
-
<div className="text-sm font-medium text-muted-foreground">
|
|
172
|
-
type = {t}
|
|
173
|
-
</div>
|
|
174
|
-
{sizes.map((s) => {
|
|
175
|
-
// 每行独立受控 — 让 demo 可交互
|
|
176
|
-
return (
|
|
177
|
-
<MatrixRow
|
|
178
|
-
key={`${t}-${s}`}
|
|
179
|
-
type={t}
|
|
180
|
-
size={s}
|
|
181
|
-
showTotal={t !== 'mini'}
|
|
182
|
-
/>
|
|
183
|
-
);
|
|
184
|
-
})}
|
|
185
|
-
</div>
|
|
186
|
-
))}
|
|
187
|
-
</div>
|
|
188
|
-
);
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
const MatrixRow = ({
|
|
193
|
-
type,
|
|
194
|
-
size,
|
|
195
|
-
showTotal,
|
|
196
|
-
}: {
|
|
197
|
-
type: 'normal' | 'simple' | 'mini';
|
|
198
|
-
size: 'sm' | 'md' | 'lg';
|
|
199
|
-
showTotal?: boolean;
|
|
200
|
-
}) => {
|
|
201
|
-
const [page, setPage] = React.useState(3);
|
|
202
|
-
return (
|
|
203
|
-
<div className="flex items-center gap-4">
|
|
204
|
-
<span className="w-10 shrink-0 text-xs text-muted-foreground">
|
|
205
|
-
{size}
|
|
206
|
-
</span>
|
|
207
|
-
<SimplePagination
|
|
208
|
-
total={245}
|
|
209
|
-
type={type}
|
|
210
|
-
size={size}
|
|
211
|
-
showTotal={showTotal}
|
|
212
|
-
current={page}
|
|
213
|
-
onChange={(p) => setPage(p)}
|
|
214
|
-
/>
|
|
215
|
-
</div>
|
|
216
|
-
);
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
// ─── pageSizeSelector + showJump(normal 专属)─────────────────────────────
|
|
220
|
-
|
|
221
|
-
export const WithPageSizeSelector: Story = {
|
|
222
|
-
parameters: { controls: { disable: true } },
|
|
223
|
-
render: () => {
|
|
224
|
-
const [page, setPage] = React.useState(1);
|
|
225
|
-
const [size, setSize] = React.useState(10);
|
|
226
|
-
return (
|
|
227
|
-
<SimplePagination
|
|
228
|
-
total={1234}
|
|
229
|
-
current={page}
|
|
230
|
-
pageSize={size}
|
|
231
|
-
pageSizeSelector
|
|
232
|
-
pageSizeList={[10, 20, 50, 100]}
|
|
233
|
-
onChange={(p, s) => {
|
|
234
|
-
setPage(p);
|
|
235
|
-
setSize(s);
|
|
236
|
-
}}
|
|
237
|
-
onPageSizeChange={(s) => setSize(s)}
|
|
238
|
-
/>
|
|
239
|
-
);
|
|
240
|
-
},
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
export const WithJumpAndFirstLast: Story = {
|
|
244
|
-
parameters: { controls: { disable: true } },
|
|
245
|
-
render: () => {
|
|
246
|
-
const [page, setPage] = React.useState(15);
|
|
247
|
-
return (
|
|
248
|
-
<SimplePagination
|
|
249
|
-
total={1234}
|
|
250
|
-
current={page}
|
|
251
|
-
showFirstLast
|
|
252
|
-
showJump
|
|
253
|
-
pageSizeSelector
|
|
254
|
-
onChange={(p) => setPage(p)}
|
|
255
|
-
/>
|
|
256
|
-
);
|
|
257
|
-
},
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
// ─── 自定义总数文本 ─────────────────────────────────────────────────────────
|
|
261
|
-
|
|
262
|
-
export const CustomTotal: Story = {
|
|
263
|
-
parameters: { controls: { disable: true } },
|
|
264
|
-
render: () => {
|
|
265
|
-
const [page, setPage] = React.useState(1);
|
|
266
|
-
return (
|
|
267
|
-
<SimplePagination
|
|
268
|
-
total={245}
|
|
269
|
-
current={page}
|
|
270
|
-
onChange={(p) => setPage(p)}
|
|
271
|
-
totalRender={(t, [s, e]) => `${s}–${e} of ${t}`}
|
|
272
|
-
/>
|
|
273
|
-
);
|
|
274
|
-
},
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
// ─── 非受控 ─────────────────────────────────────────────────────────────────
|
|
278
|
-
|
|
279
|
-
export const Uncontrolled: Story = {
|
|
280
|
-
parameters: { controls: { disable: true } },
|
|
281
|
-
render: () => (
|
|
282
|
-
<SimplePagination total={245} defaultCurrent={2} pageSizeSelector />
|
|
283
|
-
),
|
|
284
|
-
};
|