aural-ui 4.0.1 → 4.2.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 +8 -1
- package/dist/components/aspect-ratio/AspectRatio.stories.tsx +290 -1228
- package/dist/components/avatar/Avatar.stories.tsx +219 -235
- package/dist/components/badge/Badge.stories.tsx +379 -116
- package/dist/components/banner/Banner.stories.tsx +445 -391
- package/dist/components/breadcrumb/Breadcrumb.stories.tsx +453 -199
- package/dist/components/button/Button.stories.tsx +585 -230
- package/dist/components/card/Card.stories.tsx +619 -301
- package/dist/components/char-count/CharCount.stories.tsx +350 -248
- package/dist/components/checkbox/Checkbox.stories.tsx +309 -167
- package/dist/components/chip/Chip.stories.tsx +362 -168
- package/dist/components/circular-loader/CircularLoader.stories.tsx +221 -636
- package/dist/components/clamp-lines/ClampLines.stories.tsx +246 -117
- package/dist/components/collapsible/Collapsible.stories.tsx +391 -252
- package/dist/components/command/Command.stories.tsx +530 -867
- package/dist/components/dialog/Dialog.stories.tsx +501 -950
- package/dist/components/divider/Divider.stories.tsx +264 -527
- package/dist/components/dot-loader/DotLoader.stories.tsx +256 -257
- package/dist/components/drawer/Drawer.stories.tsx +659 -1023
- package/dist/components/dropdown/Dropdown.stories.tsx +643 -1028
- package/dist/components/form/Form.stories.tsx +560 -274
- package/dist/components/helper-text/HelperText.stories.tsx +199 -200
- package/dist/components/hover-card/HoverCard.stories.tsx +318 -1254
- package/dist/components/icon-button/IconButton.stories.tsx +837 -194
- package/dist/components/if-else/if-else.stories.tsx +370 -83
- package/dist/components/input/Input.stories.tsx +436 -368
- package/dist/components/label/Label.stories.tsx +156 -154
- package/dist/components/list/List.stories.tsx +484 -835
- package/dist/components/marquee/Marquee.stories.tsx +356 -712
- package/dist/components/otp-inputs/OtpInputs.stories.tsx +352 -422
- package/dist/components/overlay/Overlay.stories.tsx +452 -824
- package/dist/components/pagination/Pagination.stories.tsx +721 -210
- package/dist/components/popover/Popover.stories.tsx +481 -896
- package/dist/components/radio/Radio.stories.tsx +432 -124
- package/dist/components/resizable/Resizable.stories.tsx +495 -799
- package/dist/components/scroll-area/ScrollArea.stories.tsx +383 -1059
- package/dist/components/search/Search.stories.tsx +312 -595
- package/dist/components/select/Select.stories.tsx +684 -789
- package/dist/components/sheet/Sheet.stories.tsx +671 -950
- package/dist/components/skelton/Skelton.stories.tsx +230 -764
- package/dist/components/slider/Slider.stories.tsx +383 -760
- package/dist/components/stepper/Stepper.stories.tsx +371 -514
- package/dist/components/switch/Switch.stories.tsx +461 -208
- package/dist/components/switch-case/SwitchCase.stories.tsx +367 -188
- package/dist/components/table/Table.stories.tsx +770 -916
- package/dist/components/tabs/Tabs.stories.tsx +458 -1455
- package/dist/components/tag/Tag.stories.tsx +714 -542
- package/dist/components/textarea/TextArea.stories.tsx +621 -562
- package/dist/components/thumbnail-tags/ThumbnailTags.stories.tsx +228 -154
- package/dist/components/toast/Toast.stories.tsx +452 -1339
- package/dist/components/toggle/Toggle.stories.tsx +488 -931
- package/dist/components/tooltip/Tooltip.stories.tsx +344 -1388
- package/dist/components/typography/Typography.stories.tsx +406 -89
- package/dist/hooks/use-change-state/UseChangeState.stories.tsx +309 -606
- package/dist/hooks/use-previous/UsePrevious.stories.tsx +367 -917
- package/dist/hooks/use-standalone-pagination/UseStandalonePagination.stories.tsx +639 -867
- package/dist/icons/Icons.stories.tsx +0 -12
- package/dist/icons/ai-avatar-icon/AiAvatarIcon.stories.tsx +223 -1060
- package/dist/icons/alert-icon/AlertIcon.stories.tsx +106 -968
- package/dist/icons/all-icons.tsx +37 -16
- package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +137 -1010
- package/dist/icons/apple-logo-icon/AppleLogoIcon.stories.tsx +145 -935
- package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +132 -1046
- package/dist/icons/arrow-corner-up-left-icon/ArrowCornerUpLeftIcon.stories.tsx +134 -986
- package/dist/icons/arrow-corner-up-right-icon/ArrowCornerUpRightIcon.stories.tsx +135 -1028
- package/dist/icons/arrow-left-icon/ArrowLeftIcon.stories.tsx +133 -971
- package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +145 -1123
- package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +143 -1252
- package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +123 -632
- package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +141 -1223
- package/dist/icons/backward-ten-seconds-icon/BackwardTenSecondsIcon.stories.tsx +164 -1018
- package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +121 -1236
- package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +121 -1213
- package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +116 -893
- package/dist/icons/camera-icon/CameraIcon.stories.tsx +109 -1254
- package/dist/icons/capital-a-letter-icon/CapitalALetterIcon.stories.tsx +114 -975
- package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +157 -994
- package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +160 -992
- package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +140 -970
- package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +126 -993
- package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +144 -987
- package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +141 -1007
- package/dist/icons/circle-tick-icon/CircleTickIcon.stories.tsx +147 -1187
- package/dist/icons/circular-play-icon/CircularPlayIcon.stories.tsx +110 -476
- package/dist/icons/coin-icon/CoinIcon.stories.tsx +120 -1364
- package/dist/icons/coin-toons-icon/CoinToonsIcon.stories.tsx +113 -1360
- package/dist/icons/column-wide-add-icon/ColumnWideAddIcon.stories.tsx +111 -942
- package/dist/icons/command-icon/CommandIcon.stories.tsx +124 -1087
- package/dist/icons/copy-icon/CopyIcon.stories.tsx +119 -996
- package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +144 -1046
- package/dist/icons/cross-icon/CrossIcon.stories.tsx +136 -999
- package/dist/icons/download-icon/DownloadIcon.stories.tsx +123 -857
- package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +121 -1080
- package/dist/icons/email-icon/EmailIcon.stories.tsx +112 -979
- package/dist/icons/expand-icon/ExpandIcon.stories.tsx +109 -1146
- package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +141 -1068
- package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +140 -1081
- package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +124 -1050
- package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +123 -1091
- package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +122 -633
- package/dist/icons/filter-bar-row-icon/FilterBarRowIcon.stories.tsx +116 -1087
- package/dist/icons/forward-ten-seconds-icon/ForwardTenSecondsIcon.stories.tsx +166 -1020
- package/dist/icons/git-branch-icon/GitBranchIcon.stories.tsx +112 -1182
- package/dist/icons/git-fork-icon/GitForkIcon.stories.tsx +112 -1155
- package/dist/icons/globe-icon/GlobeIcon.stories.tsx +127 -325
- package/dist/icons/google-logo-icon/GoogleLogoIcon.stories.tsx +142 -985
- package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +116 -1217
- package/dist/icons/head-icon/HeadIcon.stories.tsx +108 -953
- package/dist/icons/heart-icon/HeartIcon.stories.tsx +117 -1060
- package/dist/icons/image-avatar-sparkle-icon/ImageAvatarSparkleIcon.stories.tsx +116 -716
- package/dist/icons/image-icon/ImageIcon.stories.tsx +102 -1164
- package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +108 -1233
- package/dist/icons/import-left-arrow-folder-icon/ImportLeftArrowFolderIcon.stories.tsx +133 -1289
- package/dist/icons/indian-flag-icon/IndianFlagIcon.stories.tsx +155 -1012
- package/dist/icons/instagram-icon/InstagramIcon.stories.tsx +158 -1438
- package/dist/icons/layout-column-icon/LayoutColumnIcon.stories.tsx +121 -1011
- package/dist/icons/layout-left-icon/LayoutLeftIcon.stories.tsx +116 -981
- package/dist/icons/layout-right-icon/LayoutRightIcon.stories.tsx +116 -979
- package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +105 -1252
- package/dist/icons/linked-in-icon/LinkedInIcon.stories.tsx +151 -1554
- package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +107 -1227
- package/dist/icons/magic-edit-icon/MagicEditIcon.stories.tsx +116 -707
- package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +119 -1226
- package/dist/icons/message-icon/MessageIcon.stories.tsx +111 -557
- package/dist/icons/minimize-icon/MinimizeIcon.stories.tsx +112 -1198
- package/dist/icons/moon-icon/MoonIcon.stories.tsx +117 -557
- package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +106 -1235
- package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +112 -1185
- package/dist/icons/musical-note-icon/MusicalNoteIcon.stories.tsx +116 -1012
- package/dist/icons/notepad-icon/NotepadIcon.stories.tsx +108 -1137
- package/dist/icons/notes-icon/NotesIcon.stories.tsx +116 -1138
- package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +106 -1146
- package/dist/icons/page-text-icon/PageTextIcon.stories.tsx +119 -719
- package/dist/icons/paint-roll-icon/PaintRollIcon.stories.tsx +110 -999
- package/dist/icons/paper-plane-icon/PaperPlaneIcon.stories.tsx +109 -912
- package/dist/icons/pause-icon/PauseIcon.stories.tsx +110 -1041
- package/dist/icons/pencil-icon/PencilIcon.stories.tsx +112 -1109
- package/dist/icons/phone-icon/PhoneIcon.stories.tsx +112 -1023
- package/dist/icons/plus-icon/PlusIcon.stories.tsx +103 -1132
- package/dist/icons/pocket-studio-icon/PocketStudioIcon.stories.tsx +104 -870
- package/dist/icons/scroll-down-icon/ScrollDownIcon.stories.tsx +99 -476
- package/dist/icons/search-icon/SearchIcon.stories.tsx +108 -1161
- package/dist/icons/setting-icon/SettingIcon.stories.tsx +104 -1009
- package/dist/icons/share-icon/ShareIcon.stories.tsx +117 -1064
- package/dist/icons/shield-icon/ShieldIcon.stories.tsx +114 -974
- package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +134 -1160
- package/dist/icons/skip-backward-icon/SkipBackwardIcon.stories.tsx +169 -1017
- package/dist/icons/skip-forward-icon/SkipForwardIcon.stories.tsx +161 -1016
- package/dist/icons/sparkles-soft-icon/SparklesSoftIcon.stories.tsx +102 -1001
- package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +155 -593
- package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +155 -608
- package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +142 -712
- package/dist/icons/star-icon/StarIcon.stories.tsx +120 -946
- package/dist/icons/store-coin-icon/StoreCoinIcon.stories.tsx +109 -1013
- package/dist/icons/suggestion-icon/SuggestionIcon.stories.tsx +113 -891
- package/dist/icons/sun-icon/SunIcon.stories.tsx +117 -864
- package/dist/icons/text-color-icon/TextColorIcon.stories.tsx +113 -989
- package/dist/icons/text-indicator-icon/TextIndicatorIcon.stories.tsx +120 -1027
- package/dist/icons/threads-icon/ThreadsIcon.stories.tsx +153 -1476
- package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +143 -1187
- package/dist/icons/tick-icon/TickIcon.stories.tsx +142 -1322
- package/dist/icons/trash-icon/TrashIcon.stories.tsx +105 -970
- package/dist/icons/twitter-x-icon/TwitterXIcon.stories.tsx +154 -1457
- package/dist/icons/upload-icon/UploadIcon.stories.tsx +112 -930
- package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +115 -1019
- package/dist/icons/video-play-list-icon/VideoPlaylistIcon.stories.tsx +122 -1092
- package/dist/icons/voice-playing-icon/VoicePlayingIcon.stories.tsx +120 -1401
- package/dist/icons/volume-full-icon/VolumeFullIcon.stories.tsx +107 -1212
- package/dist/icons/volume-half-icon/VolumeHalfIcon.stories.tsx +109 -1122
- package/dist/icons/volume-off-icon/VolumeOffIcon.stories.tsx +112 -1124
- package/dist/icons/warning-icon/WarningIcon.stories.tsx +119 -1083
- package/dist/icons/youtube-icon/YoutubeIcon.stories.tsx +158 -983
- package/dist/index.cjs +90 -90
- package/dist/index.js +90 -90
- package/package.json +8 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react"
|
|
1
|
+
import React, { useState } from "react"
|
|
2
2
|
import {
|
|
3
3
|
ChevronDoubleLeftIcon,
|
|
4
4
|
ChevronDoubleRightIcon,
|
|
@@ -7,6 +7,8 @@ import {
|
|
|
7
7
|
} from "@icons/index"
|
|
8
8
|
import type { Meta, StoryObj } from "@storybook/react-vite"
|
|
9
9
|
|
|
10
|
+
import { AuralComponentDocsPage } from "src/ui/story-spec/components/component-story-docs-page"
|
|
11
|
+
|
|
10
12
|
import {
|
|
11
13
|
Pagination,
|
|
12
14
|
PaginationButton,
|
|
@@ -22,18 +24,29 @@ const meta: Meta<typeof Pagination> = {
|
|
|
22
24
|
component: Pagination,
|
|
23
25
|
parameters: {
|
|
24
26
|
layout: "centered",
|
|
25
|
-
backgrounds: {
|
|
26
|
-
default: "dark",
|
|
27
|
-
values: [
|
|
28
|
-
{ name: "dark", value: "#0a0a0a" },
|
|
29
|
-
{ name: "light", value: "#ffffff" },
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
27
|
docs: {
|
|
33
28
|
description: {
|
|
34
29
|
component:
|
|
35
|
-
"A pagination component for navigating through
|
|
30
|
+
"A compound pagination component for navigating through large datasets. Provides a fully-managed high-level Pagination component plus low-level primitives (PaginationButton, PaginationEllipsis, PaginationSizeSelector, PaginationRoot, PaginationContent) for custom compositions. State is supplied via PaginationProvider.",
|
|
36
31
|
},
|
|
32
|
+
page: () => (
|
|
33
|
+
<AuralComponentDocsPage
|
|
34
|
+
features={[
|
|
35
|
+
{
|
|
36
|
+
title: "Provider State",
|
|
37
|
+
description: "Centralized page context",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: "Low-level Primitives",
|
|
41
|
+
description: "Fully custom layouts",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: "Size Selector",
|
|
45
|
+
description: "Page size dropdown",
|
|
46
|
+
},
|
|
47
|
+
]}
|
|
48
|
+
/>
|
|
49
|
+
),
|
|
37
50
|
},
|
|
38
51
|
},
|
|
39
52
|
tags: ["autodocs"],
|
|
@@ -55,10 +68,6 @@ const meta: Meta<typeof Pagination> = {
|
|
|
55
68
|
control: "object",
|
|
56
69
|
description: "Available page sizes",
|
|
57
70
|
},
|
|
58
|
-
className: {
|
|
59
|
-
control: "text",
|
|
60
|
-
description: "Additional CSS class name",
|
|
61
|
-
},
|
|
62
71
|
},
|
|
63
72
|
decorators: [
|
|
64
73
|
(Story, context) => (
|
|
@@ -72,130 +81,128 @@ const meta: Meta<typeof Pagination> = {
|
|
|
72
81
|
export default meta
|
|
73
82
|
type Story = StoryObj<typeof Pagination>
|
|
74
83
|
|
|
75
|
-
//
|
|
76
|
-
|
|
84
|
+
// ─── 1. Playground ────────────────────────────────────────────────────────────
|
|
85
|
+
|
|
86
|
+
export const Playground: Story = {
|
|
77
87
|
args: {
|
|
78
88
|
size: "md",
|
|
79
89
|
showFirstLast: true,
|
|
80
90
|
showPageSize: false,
|
|
81
91
|
pageSizeOptions: [10, 20, 50, 100],
|
|
82
92
|
},
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
render: (args) => <Pagination {...args} />,
|
|
94
|
+
parameters: {
|
|
95
|
+
docs: {
|
|
96
|
+
description: {
|
|
97
|
+
story:
|
|
98
|
+
"Use the controls panel in the sidebar to toggle size, first/last buttons, and page size selector. The pagination is live — click through pages to see state changes.",
|
|
99
|
+
},
|
|
100
|
+
},
|
|
90
101
|
},
|
|
91
102
|
}
|
|
92
103
|
|
|
93
|
-
|
|
94
|
-
args: {
|
|
95
|
-
size: "lg",
|
|
96
|
-
showFirstLast: true,
|
|
97
|
-
showPageSize: false,
|
|
98
|
-
},
|
|
99
|
-
}
|
|
104
|
+
// ─── 2. Sizes ─────────────────────────────────────────────────────────────────
|
|
100
105
|
|
|
101
|
-
export const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
export const Sizes: Story = {
|
|
107
|
+
render: () => (
|
|
108
|
+
<div className="space-y-8">
|
|
109
|
+
<div className="space-y-4">
|
|
110
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
111
|
+
Small (sm)
|
|
112
|
+
</h4>
|
|
113
|
+
<div className="flex flex-wrap items-end justify-center gap-6">
|
|
114
|
+
<div className="space-y-2 text-center">
|
|
115
|
+
<Pagination size="sm" showFirstLast showPageSize={false} />
|
|
116
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
117
|
+
Small — 32px buttons
|
|
118
|
+
</p>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
109
122
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
123
|
+
<div className="space-y-4">
|
|
124
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
125
|
+
Medium (md)
|
|
126
|
+
</h4>
|
|
127
|
+
<div className="flex flex-wrap items-end justify-center gap-6">
|
|
128
|
+
<div className="space-y-2 text-center">
|
|
129
|
+
<Pagination size="md" showFirstLast showPageSize={false} />
|
|
130
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
131
|
+
Medium — 40px buttons (default)
|
|
132
|
+
</p>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
117
136
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
137
|
+
<div className="space-y-4">
|
|
138
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
139
|
+
Large (lg)
|
|
140
|
+
</h4>
|
|
141
|
+
<div className="flex flex-wrap items-end justify-center gap-6">
|
|
142
|
+
<div className="space-y-2 text-center">
|
|
143
|
+
<Pagination size="lg" showFirstLast showPageSize={false} />
|
|
144
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
145
|
+
Large — 48px buttons
|
|
146
|
+
</p>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
),
|
|
152
|
+
parameters: {
|
|
153
|
+
docs: {
|
|
154
|
+
description: {
|
|
155
|
+
story:
|
|
156
|
+
"Side-by-side scale comparison across all three sizes: small (32px), medium (40px), and large (48px).",
|
|
157
|
+
},
|
|
158
|
+
},
|
|
130
159
|
},
|
|
131
160
|
}
|
|
132
161
|
|
|
133
|
-
|
|
134
|
-
decorators: [
|
|
135
|
-
(Story) => (
|
|
136
|
-
<PaginationProvider
|
|
137
|
-
totalItems={100}
|
|
138
|
-
initialPage={10}
|
|
139
|
-
initialPageSize={10}
|
|
140
|
-
>
|
|
141
|
-
<Story />
|
|
142
|
-
</PaginationProvider>
|
|
143
|
-
),
|
|
144
|
-
],
|
|
145
|
-
args: {
|
|
146
|
-
size: "md",
|
|
147
|
-
showFirstLast: true,
|
|
148
|
-
showPageSize: true,
|
|
149
|
-
},
|
|
150
|
-
}
|
|
162
|
+
// ─── 3. Configurations ────────────────────────────────────────────────────────
|
|
151
163
|
|
|
152
|
-
|
|
153
|
-
export const PrimitiveButtons: Story = {
|
|
164
|
+
export const Configurations: Story = {
|
|
154
165
|
render: () => (
|
|
155
|
-
<div className="
|
|
156
|
-
<div className="space-
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
</PaginationButton>
|
|
167
|
-
<PaginationButton variant="number" size="md">
|
|
168
|
-
3
|
|
169
|
-
</PaginationButton>
|
|
170
|
-
<PaginationButton variant="navigation" size="md">
|
|
171
|
-
<ChevronRightIcon />
|
|
172
|
-
</PaginationButton>
|
|
166
|
+
<div className="space-y-8">
|
|
167
|
+
<div className="space-y-4">
|
|
168
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
169
|
+
With First / Last Buttons
|
|
170
|
+
</h4>
|
|
171
|
+
<div className="space-y-2 text-center">
|
|
172
|
+
<Pagination size="md" showFirstLast showPageSize={false} />
|
|
173
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
174
|
+
showFirstLast=true
|
|
175
|
+
</p>
|
|
176
|
+
</div>
|
|
173
177
|
</div>
|
|
174
178
|
|
|
175
|
-
<div className="space-
|
|
176
|
-
<
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
</PaginationButton>
|
|
179
|
+
<div className="space-y-4">
|
|
180
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
181
|
+
Without First / Last Buttons
|
|
182
|
+
</h4>
|
|
183
|
+
<div className="space-y-2 text-center">
|
|
184
|
+
<Pagination size="md" showFirstLast={false} showPageSize={false} />
|
|
185
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
186
|
+
showFirstLast=false
|
|
187
|
+
</p>
|
|
188
|
+
</div>
|
|
186
189
|
</div>
|
|
187
190
|
|
|
188
|
-
<div className="space-
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
191
|
+
<div className="space-y-4">
|
|
192
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
193
|
+
With Page Size Selector
|
|
194
|
+
</h4>
|
|
195
|
+
<div className="space-y-2 text-center">
|
|
196
|
+
<Pagination
|
|
197
|
+
size="md"
|
|
198
|
+
showFirstLast
|
|
199
|
+
showPageSize
|
|
200
|
+
pageSizeOptions={[10, 20, 50, 100]}
|
|
201
|
+
/>
|
|
202
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
203
|
+
showPageSize=true — page size control shown on the left
|
|
204
|
+
</p>
|
|
205
|
+
</div>
|
|
199
206
|
</div>
|
|
200
207
|
</div>
|
|
201
208
|
),
|
|
@@ -203,158 +210,662 @@ export const PrimitiveButtons: Story = {
|
|
|
203
210
|
docs: {
|
|
204
211
|
description: {
|
|
205
212
|
story:
|
|
206
|
-
"
|
|
213
|
+
"Configuration axes: with and without first/last navigation buttons, and with the page size selector visible.",
|
|
207
214
|
},
|
|
208
215
|
},
|
|
209
216
|
},
|
|
210
217
|
}
|
|
211
218
|
|
|
212
|
-
|
|
219
|
+
// ─── 4. States ────────────────────────────────────────────────────────────────
|
|
220
|
+
|
|
221
|
+
export const States: Story = {
|
|
213
222
|
render: () => (
|
|
214
|
-
<div className="
|
|
215
|
-
<div className="
|
|
216
|
-
<
|
|
223
|
+
<div className="space-y-8">
|
|
224
|
+
<div className="space-y-4">
|
|
225
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
226
|
+
First Page (prev / first disabled)
|
|
227
|
+
</h4>
|
|
228
|
+
<PaginationProvider
|
|
229
|
+
totalItems={100}
|
|
230
|
+
initialPage={1}
|
|
231
|
+
initialPageSize={10}
|
|
232
|
+
>
|
|
233
|
+
<div className="space-y-2 text-center">
|
|
234
|
+
<Pagination size="md" showFirstLast showPageSize={false} />
|
|
235
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
236
|
+
Page 1 of 10 — back navigation disabled
|
|
237
|
+
</p>
|
|
238
|
+
</div>
|
|
239
|
+
</PaginationProvider>
|
|
217
240
|
</div>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
|
|
241
|
+
|
|
242
|
+
<div className="space-y-4">
|
|
243
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
244
|
+
Last Page (next / last disabled)
|
|
245
|
+
</h4>
|
|
246
|
+
<PaginationProvider
|
|
247
|
+
totalItems={100}
|
|
248
|
+
initialPage={10}
|
|
249
|
+
initialPageSize={10}
|
|
250
|
+
>
|
|
251
|
+
<div className="space-y-2 text-center">
|
|
252
|
+
<Pagination size="md" showFirstLast showPageSize={false} />
|
|
253
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
254
|
+
Page 10 of 10 — forward navigation disabled
|
|
255
|
+
</p>
|
|
256
|
+
</div>
|
|
257
|
+
</PaginationProvider>
|
|
226
258
|
</div>
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
<
|
|
233
|
-
|
|
234
|
-
|
|
259
|
+
|
|
260
|
+
<div className="space-y-4">
|
|
261
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
262
|
+
Mid-Range (with ellipsis)
|
|
263
|
+
</h4>
|
|
264
|
+
<PaginationProvider
|
|
265
|
+
totalItems={250}
|
|
266
|
+
initialPage={5}
|
|
267
|
+
initialPageSize={10}
|
|
268
|
+
>
|
|
269
|
+
<div className="space-y-2 text-center">
|
|
270
|
+
<Pagination size="md" showFirstLast showPageSize={false} />
|
|
271
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
272
|
+
Page 5 of 25 — ellipsis visible on both sides
|
|
273
|
+
</p>
|
|
274
|
+
</div>
|
|
275
|
+
</PaginationProvider>
|
|
235
276
|
</div>
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
<
|
|
242
|
-
|
|
243
|
-
|
|
277
|
+
|
|
278
|
+
<div className="space-y-4">
|
|
279
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
280
|
+
Button States
|
|
281
|
+
</h4>
|
|
282
|
+
<div className="flex flex-wrap items-end gap-4">
|
|
283
|
+
<div className="space-y-2 text-center">
|
|
284
|
+
<PaginationButton variant="number" size="md">
|
|
285
|
+
5
|
|
286
|
+
</PaginationButton>
|
|
287
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
288
|
+
Number — default
|
|
289
|
+
</p>
|
|
290
|
+
</div>
|
|
291
|
+
<div className="space-y-2 text-center">
|
|
292
|
+
<PaginationButton variant="active" size="md">
|
|
293
|
+
6
|
|
294
|
+
</PaginationButton>
|
|
295
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
296
|
+
Number — active
|
|
297
|
+
</p>
|
|
298
|
+
</div>
|
|
299
|
+
<div className="space-y-2 text-center">
|
|
300
|
+
<PaginationButton variant="number" size="md" disabled>
|
|
301
|
+
7
|
|
302
|
+
</PaginationButton>
|
|
303
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
304
|
+
Number — disabled
|
|
305
|
+
</p>
|
|
306
|
+
</div>
|
|
307
|
+
<div className="space-y-2 text-center">
|
|
308
|
+
<PaginationButton variant="navigation" size="md">
|
|
309
|
+
<ChevronLeftIcon />
|
|
310
|
+
</PaginationButton>
|
|
311
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
312
|
+
Navigation — enabled
|
|
313
|
+
</p>
|
|
314
|
+
</div>
|
|
315
|
+
<div className="space-y-2 text-center">
|
|
316
|
+
<PaginationButton variant="navigation" size="md" disabled>
|
|
317
|
+
<ChevronRightIcon />
|
|
318
|
+
</PaginationButton>
|
|
319
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
320
|
+
Navigation — disabled
|
|
321
|
+
</p>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
244
324
|
</div>
|
|
245
325
|
</div>
|
|
246
326
|
),
|
|
247
327
|
parameters: {
|
|
248
328
|
docs: {
|
|
249
329
|
description: {
|
|
250
|
-
story:
|
|
330
|
+
story:
|
|
331
|
+
"First page (back disabled), last page (forward disabled), mid-range with ellipsis, and individual button state variants (default, active, disabled).",
|
|
251
332
|
},
|
|
252
333
|
},
|
|
253
334
|
},
|
|
254
335
|
}
|
|
255
336
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
337
|
+
// ─── 5. Interactive ───────────────────────────────────────────────────────────
|
|
338
|
+
|
|
339
|
+
export const Interactive: Story = {
|
|
340
|
+
render: () => {
|
|
341
|
+
const [totalItems] = useState(250)
|
|
342
|
+
const [initialPage] = useState(1)
|
|
343
|
+
|
|
344
|
+
return (
|
|
345
|
+
<div className="w-full p-8">
|
|
346
|
+
<div className="mx-auto max-w-3xl space-y-6">
|
|
347
|
+
<div className="grid grid-cols-1 gap-6 lg:grid-cols-3">
|
|
348
|
+
{/* Controls Panel */}
|
|
349
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-5 rounded-xl border p-5">
|
|
350
|
+
<p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
|
|
351
|
+
Dataset
|
|
352
|
+
</p>
|
|
353
|
+
<div className="space-y-2">
|
|
354
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
355
|
+
Total items:{" "}
|
|
356
|
+
<span className="text-fm-primary font-medium">
|
|
357
|
+
{totalItems}
|
|
358
|
+
</span>
|
|
359
|
+
</p>
|
|
360
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
361
|
+
Starting page:{" "}
|
|
362
|
+
<span className="text-fm-primary font-medium">
|
|
363
|
+
{initialPage}
|
|
364
|
+
</span>
|
|
365
|
+
</p>
|
|
366
|
+
</div>
|
|
367
|
+
<div className="border-fm-divider-secondary border-t pt-4" />
|
|
368
|
+
<p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
|
|
369
|
+
Info
|
|
370
|
+
</p>
|
|
371
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
372
|
+
Click page numbers or navigation arrows to move through pages.
|
|
373
|
+
The active page highlights and ellipsis collapses distant pages
|
|
374
|
+
automatically.
|
|
375
|
+
</p>
|
|
376
|
+
</div>
|
|
377
|
+
|
|
378
|
+
{/* Preview Stage */}
|
|
379
|
+
<div className="flex flex-col gap-6 lg:col-span-2">
|
|
380
|
+
<PaginationProvider
|
|
381
|
+
totalItems={totalItems}
|
|
382
|
+
initialPage={initialPage}
|
|
383
|
+
initialPageSize={10}
|
|
384
|
+
>
|
|
385
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary flex flex-col gap-6 rounded-xl border p-6">
|
|
386
|
+
<div className="space-y-1">
|
|
387
|
+
<p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold">
|
|
388
|
+
With page size selector
|
|
389
|
+
</p>
|
|
390
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
391
|
+
size="md" · showFirstLast · showPageSize
|
|
392
|
+
</p>
|
|
393
|
+
</div>
|
|
394
|
+
<Pagination
|
|
395
|
+
size="md"
|
|
396
|
+
showFirstLast
|
|
397
|
+
showPageSize
|
|
398
|
+
pageSizeOptions={[10, 20, 50]}
|
|
399
|
+
/>
|
|
400
|
+
</div>
|
|
401
|
+
</PaginationProvider>
|
|
402
|
+
|
|
403
|
+
<PaginationProvider
|
|
404
|
+
totalItems={totalItems}
|
|
405
|
+
initialPage={initialPage}
|
|
406
|
+
initialPageSize={10}
|
|
407
|
+
>
|
|
408
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary flex flex-col gap-6 rounded-xl border p-6">
|
|
409
|
+
<div className="space-y-1">
|
|
410
|
+
<p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold">
|
|
411
|
+
Compact — no first/last
|
|
412
|
+
</p>
|
|
413
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
414
|
+
size="sm" · showFirstLast=false
|
|
415
|
+
</p>
|
|
416
|
+
</div>
|
|
417
|
+
<Pagination
|
|
418
|
+
size="sm"
|
|
419
|
+
showFirstLast={false}
|
|
420
|
+
showPageSize={false}
|
|
421
|
+
/>
|
|
422
|
+
</div>
|
|
423
|
+
</PaginationProvider>
|
|
424
|
+
|
|
425
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border px-4 py-3">
|
|
426
|
+
<code className="text-fm-secondary text-fm-md leading-fm-md font-[var(--font-fm-mono)]">
|
|
427
|
+
{
|
|
428
|
+
'<PaginationProvider totalItems={250}>\n <Pagination size="md" showFirstLast showPageSize />\n</PaginationProvider>'
|
|
429
|
+
}
|
|
430
|
+
</code>
|
|
431
|
+
</div>
|
|
432
|
+
</div>
|
|
433
|
+
</div>
|
|
282
434
|
</div>
|
|
283
435
|
</div>
|
|
284
|
-
|
|
285
|
-
|
|
436
|
+
)
|
|
437
|
+
},
|
|
286
438
|
parameters: {
|
|
439
|
+
layout: "fullscreen",
|
|
287
440
|
docs: {
|
|
288
441
|
description: {
|
|
289
|
-
story:
|
|
442
|
+
story:
|
|
443
|
+
"Live interactive demo of two Pagination variants side by side. Click through pages to observe ellipsis collapsing, active page highlighting, and disabled navigation edges.",
|
|
290
444
|
},
|
|
291
445
|
},
|
|
292
446
|
},
|
|
293
447
|
}
|
|
294
448
|
|
|
295
|
-
|
|
449
|
+
// ─── 6. Parts ─────────────────────────────────────────────────────────────────
|
|
450
|
+
|
|
451
|
+
export const Parts: Story = {
|
|
296
452
|
render: () => (
|
|
297
|
-
<div className="
|
|
298
|
-
<div>
|
|
299
|
-
<
|
|
300
|
-
|
|
301
|
-
</
|
|
302
|
-
<
|
|
303
|
-
<
|
|
453
|
+
<div className="space-y-10">
|
|
454
|
+
<div className="space-y-4">
|
|
455
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
456
|
+
PaginationButton
|
|
457
|
+
</h4>
|
|
458
|
+
<div className="flex flex-wrap items-end gap-4">
|
|
459
|
+
<div className="space-y-2 text-center">
|
|
304
460
|
<PaginationButton variant="navigation" size="md">
|
|
305
461
|
<ChevronDoubleLeftIcon />
|
|
306
462
|
</PaginationButton>
|
|
463
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
464
|
+
navigation
|
|
465
|
+
</p>
|
|
466
|
+
</div>
|
|
467
|
+
<div className="space-y-2 text-center">
|
|
307
468
|
<PaginationButton variant="navigation" size="md">
|
|
308
469
|
<ChevronLeftIcon />
|
|
309
470
|
</PaginationButton>
|
|
471
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
472
|
+
navigation
|
|
473
|
+
</p>
|
|
474
|
+
</div>
|
|
475
|
+
<div className="space-y-2 text-center">
|
|
310
476
|
<PaginationButton variant="number" size="md">
|
|
311
|
-
1
|
|
312
|
-
</PaginationButton>
|
|
313
|
-
<PaginationButton variant="number" size="md">
|
|
314
|
-
2
|
|
315
|
-
</PaginationButton>
|
|
316
|
-
<PaginationButton variant="active" size="md">
|
|
317
477
|
3
|
|
318
478
|
</PaginationButton>
|
|
319
|
-
<
|
|
479
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
480
|
+
number
|
|
481
|
+
</p>
|
|
482
|
+
</div>
|
|
483
|
+
<div className="space-y-2 text-center">
|
|
484
|
+
<PaginationButton variant="active" size="md">
|
|
320
485
|
4
|
|
321
486
|
</PaginationButton>
|
|
322
|
-
<
|
|
487
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
488
|
+
active
|
|
489
|
+
</p>
|
|
490
|
+
</div>
|
|
491
|
+
<div className="space-y-2 text-center">
|
|
323
492
|
<PaginationButton variant="number" size="md">
|
|
324
|
-
|
|
493
|
+
5
|
|
325
494
|
</PaginationButton>
|
|
495
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
496
|
+
number
|
|
497
|
+
</p>
|
|
498
|
+
</div>
|
|
499
|
+
<div className="space-y-2 text-center">
|
|
326
500
|
<PaginationButton variant="navigation" size="md">
|
|
327
501
|
<ChevronRightIcon />
|
|
328
502
|
</PaginationButton>
|
|
503
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
504
|
+
navigation
|
|
505
|
+
</p>
|
|
506
|
+
</div>
|
|
507
|
+
<div className="space-y-2 text-center">
|
|
329
508
|
<PaginationButton variant="navigation" size="md">
|
|
330
509
|
<ChevronDoubleRightIcon />
|
|
331
510
|
</PaginationButton>
|
|
332
|
-
|
|
333
|
-
|
|
511
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
512
|
+
navigation
|
|
513
|
+
</p>
|
|
514
|
+
</div>
|
|
515
|
+
</div>
|
|
516
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
|
|
517
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
518
|
+
A standalone button primitive. Accepts{" "}
|
|
519
|
+
<code className="text-fm-primary">variant</code> (number, active,
|
|
520
|
+
navigation) and <code className="text-fm-primary">size</code> (sm,
|
|
521
|
+
md, lg). Used inside PaginationContent for custom compositions.
|
|
522
|
+
</p>
|
|
523
|
+
</div>
|
|
334
524
|
</div>
|
|
335
525
|
|
|
336
|
-
<div>
|
|
337
|
-
<
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
<
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
526
|
+
<div className="space-y-4">
|
|
527
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
528
|
+
PaginationEllipsis
|
|
529
|
+
</h4>
|
|
530
|
+
<div className="flex flex-wrap items-end gap-6">
|
|
531
|
+
<div className="space-y-2 text-center">
|
|
532
|
+
<div className="flex items-center gap-1">
|
|
533
|
+
<PaginationButton variant="number" size="sm">
|
|
534
|
+
1
|
|
535
|
+
</PaginationButton>
|
|
536
|
+
<PaginationEllipsis size="sm" />
|
|
537
|
+
<PaginationButton variant="number" size="sm">
|
|
538
|
+
9
|
|
539
|
+
</PaginationButton>
|
|
540
|
+
</div>
|
|
541
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
542
|
+
sm
|
|
543
|
+
</p>
|
|
544
|
+
</div>
|
|
545
|
+
<div className="space-y-2 text-center">
|
|
546
|
+
<div className="flex items-center gap-1">
|
|
547
|
+
<PaginationButton variant="number" size="md">
|
|
548
|
+
1
|
|
549
|
+
</PaginationButton>
|
|
550
|
+
<PaginationEllipsis size="md" />
|
|
551
|
+
<PaginationButton variant="number" size="md">
|
|
552
|
+
9
|
|
553
|
+
</PaginationButton>
|
|
554
|
+
</div>
|
|
555
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
556
|
+
md
|
|
557
|
+
</p>
|
|
558
|
+
</div>
|
|
559
|
+
<div className="space-y-2 text-center">
|
|
560
|
+
<div className="flex items-center gap-1">
|
|
561
|
+
<PaginationButton variant="number" size="lg">
|
|
562
|
+
1
|
|
563
|
+
</PaginationButton>
|
|
564
|
+
<PaginationEllipsis size="lg" />
|
|
565
|
+
<PaginationButton variant="number" size="lg">
|
|
566
|
+
9
|
|
567
|
+
</PaginationButton>
|
|
568
|
+
</div>
|
|
569
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
570
|
+
lg
|
|
571
|
+
</p>
|
|
572
|
+
</div>
|
|
573
|
+
</div>
|
|
574
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
|
|
575
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
576
|
+
A decorative span that renders "…" to indicate skipped pages. Uses{" "}
|
|
577
|
+
<code className="text-fm-primary">aria-hidden="true"</code> — screen
|
|
578
|
+
readers skip it. Sized via the same{" "}
|
|
579
|
+
<code className="text-fm-primary">size</code> prop as
|
|
580
|
+
PaginationButton.
|
|
581
|
+
</p>
|
|
582
|
+
</div>
|
|
583
|
+
</div>
|
|
584
|
+
|
|
585
|
+
<div className="space-y-4">
|
|
586
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
587
|
+
PaginationSizeSelector
|
|
588
|
+
</h4>
|
|
589
|
+
<PaginationProvider
|
|
590
|
+
totalItems={100}
|
|
591
|
+
initialPage={1}
|
|
592
|
+
initialPageSize={10}
|
|
593
|
+
>
|
|
594
|
+
<div className="flex flex-wrap items-end gap-6">
|
|
595
|
+
<div className="space-y-2 text-center">
|
|
596
|
+
<PaginationSizeSelector
|
|
597
|
+
size="sm"
|
|
598
|
+
pageSizeOptions={[5, 10, 20]}
|
|
599
|
+
pageSize={10}
|
|
600
|
+
setPageSize={(s) => console.log("page size:", s)}
|
|
601
|
+
/>
|
|
602
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
603
|
+
sm
|
|
604
|
+
</p>
|
|
605
|
+
</div>
|
|
606
|
+
<div className="space-y-2 text-center">
|
|
607
|
+
<PaginationSizeSelector
|
|
608
|
+
size="md"
|
|
609
|
+
pageSizeOptions={[10, 20, 50]}
|
|
610
|
+
pageSize={20}
|
|
611
|
+
setPageSize={(s) => console.log("page size:", s)}
|
|
612
|
+
/>
|
|
613
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
614
|
+
md
|
|
615
|
+
</p>
|
|
616
|
+
</div>
|
|
617
|
+
<div className="space-y-2 text-center">
|
|
618
|
+
<PaginationSizeSelector
|
|
619
|
+
size="lg"
|
|
620
|
+
pageSizeOptions={[20, 50, 100]}
|
|
621
|
+
pageSize={50}
|
|
622
|
+
setPageSize={(s) => console.log("page size:", s)}
|
|
623
|
+
/>
|
|
624
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
625
|
+
lg
|
|
626
|
+
</p>
|
|
627
|
+
</div>
|
|
628
|
+
</div>
|
|
629
|
+
</PaginationProvider>
|
|
630
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
|
|
631
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
632
|
+
A select control for choosing how many items to show per page.
|
|
633
|
+
Requires <code className="text-fm-primary">pageSize</code> (current
|
|
634
|
+
value) and <code className="text-fm-primary">setPageSize</code>{" "}
|
|
635
|
+
(change handler). When used inside Pagination, these are wired
|
|
636
|
+
automatically via PaginationProvider.
|
|
637
|
+
</p>
|
|
638
|
+
</div>
|
|
639
|
+
</div>
|
|
640
|
+
|
|
641
|
+
<div className="space-y-4">
|
|
642
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
643
|
+
Custom Composition (PaginationRoot + PaginationContent)
|
|
644
|
+
</h4>
|
|
645
|
+
<div className="space-y-4">
|
|
646
|
+
<PaginationRoot>
|
|
647
|
+
<PaginationContent>
|
|
648
|
+
<PaginationButton variant="navigation" size="md">
|
|
649
|
+
<ChevronDoubleLeftIcon />
|
|
650
|
+
</PaginationButton>
|
|
651
|
+
<PaginationButton variant="navigation" size="md">
|
|
652
|
+
<ChevronLeftIcon />
|
|
653
|
+
</PaginationButton>
|
|
654
|
+
<PaginationButton variant="number" size="md">
|
|
655
|
+
1
|
|
656
|
+
</PaginationButton>
|
|
657
|
+
<PaginationButton variant="number" size="md">
|
|
658
|
+
2
|
|
659
|
+
</PaginationButton>
|
|
660
|
+
<PaginationButton variant="active" size="md">
|
|
661
|
+
3
|
|
662
|
+
</PaginationButton>
|
|
663
|
+
<PaginationButton variant="number" size="md">
|
|
664
|
+
4
|
|
665
|
+
</PaginationButton>
|
|
666
|
+
<PaginationEllipsis size="md" />
|
|
667
|
+
<PaginationButton variant="number" size="md">
|
|
668
|
+
10
|
|
669
|
+
</PaginationButton>
|
|
670
|
+
<PaginationButton variant="navigation" size="md">
|
|
671
|
+
<ChevronRightIcon />
|
|
672
|
+
</PaginationButton>
|
|
673
|
+
<PaginationButton variant="navigation" size="md">
|
|
674
|
+
<ChevronDoubleRightIcon />
|
|
675
|
+
</PaginationButton>
|
|
676
|
+
</PaginationContent>
|
|
677
|
+
</PaginationRoot>
|
|
678
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm text-center">
|
|
679
|
+
Fully custom layout — no PaginationProvider required
|
|
680
|
+
</p>
|
|
681
|
+
</div>
|
|
682
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
|
|
683
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
684
|
+
PaginationRoot is a flex container with{" "}
|
|
685
|
+
<code className="text-fm-primary">justify-between</code>.
|
|
686
|
+
PaginationContent is a <code className="text-fm-primary">nav</code>{" "}
|
|
687
|
+
element with{" "}
|
|
688
|
+
<code className="text-fm-primary">
|
|
689
|
+
aria-label="Pagination navigation"
|
|
690
|
+
</code>
|
|
691
|
+
. Compose these with any button primitives for fully custom
|
|
692
|
+
pagination UI without the managed Pagination component.
|
|
693
|
+
</p>
|
|
694
|
+
</div>
|
|
351
695
|
</div>
|
|
352
696
|
</div>
|
|
353
697
|
),
|
|
354
698
|
parameters: {
|
|
355
699
|
docs: {
|
|
356
700
|
description: {
|
|
357
|
-
story:
|
|
701
|
+
story:
|
|
702
|
+
"Individual compound-component parts: PaginationButton (all variants and sizes), PaginationEllipsis (all sizes), PaginationSizeSelector, and a fully custom PaginationRoot + PaginationContent composition without the managed Pagination component.",
|
|
703
|
+
},
|
|
704
|
+
},
|
|
705
|
+
},
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
// ─── 7. Use Cases ─────────────────────────────────────────────────────────────
|
|
709
|
+
|
|
710
|
+
export const UseCases: Story = {
|
|
711
|
+
render: () => (
|
|
712
|
+
<div className="mx-auto max-w-3xl space-y-8 p-8">
|
|
713
|
+
<div className="space-y-4">
|
|
714
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
715
|
+
Track Library Browser
|
|
716
|
+
</h4>
|
|
717
|
+
<PaginationProvider
|
|
718
|
+
totalItems={347}
|
|
719
|
+
initialPage={3}
|
|
720
|
+
initialPageSize={20}
|
|
721
|
+
>
|
|
722
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary mx-auto max-w-md rounded-xl border">
|
|
723
|
+
<div className="border-fm-divider-secondary border-b p-4">
|
|
724
|
+
<p className="text-fm-primary font-fm-brand text-fm-md leading-fm-md font-semibold">
|
|
725
|
+
All Tracks
|
|
726
|
+
</p>
|
|
727
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
728
|
+
347 tracks
|
|
729
|
+
</p>
|
|
730
|
+
</div>
|
|
731
|
+
{[
|
|
732
|
+
"Midnight Dreams",
|
|
733
|
+
"Electric Sunrise",
|
|
734
|
+
"Neon Horizon",
|
|
735
|
+
"Echoes in Rain",
|
|
736
|
+
"Solar Wind",
|
|
737
|
+
].map((title, i) => (
|
|
738
|
+
<div
|
|
739
|
+
key={title}
|
|
740
|
+
className="border-fm-divider-secondary flex items-center justify-between border-b p-4 last:border-b-0"
|
|
741
|
+
>
|
|
742
|
+
<div className="flex items-center gap-3">
|
|
743
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm w-5 text-right">
|
|
744
|
+
{i + 41}
|
|
745
|
+
</p>
|
|
746
|
+
<div>
|
|
747
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm font-medium">
|
|
748
|
+
{title}
|
|
749
|
+
</p>
|
|
750
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
751
|
+
3:2{i + 1}
|
|
752
|
+
</p>
|
|
753
|
+
</div>
|
|
754
|
+
</div>
|
|
755
|
+
</div>
|
|
756
|
+
))}
|
|
757
|
+
<div className="p-4">
|
|
758
|
+
<Pagination
|
|
759
|
+
size="sm"
|
|
760
|
+
showFirstLast={false}
|
|
761
|
+
showPageSize={false}
|
|
762
|
+
/>
|
|
763
|
+
</div>
|
|
764
|
+
</div>
|
|
765
|
+
</PaginationProvider>
|
|
766
|
+
</div>
|
|
767
|
+
|
|
768
|
+
<div className="space-y-4">
|
|
769
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
770
|
+
Album Search Results
|
|
771
|
+
</h4>
|
|
772
|
+
<PaginationProvider
|
|
773
|
+
totalItems={120}
|
|
774
|
+
initialPage={2}
|
|
775
|
+
initialPageSize={10}
|
|
776
|
+
>
|
|
777
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary mx-auto max-w-md space-y-4 rounded-xl border p-5">
|
|
778
|
+
<div className="flex items-center justify-between">
|
|
779
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
780
|
+
Showing 11–20 of 120 results
|
|
781
|
+
</p>
|
|
782
|
+
</div>
|
|
783
|
+
<div className="grid grid-cols-2 gap-3">
|
|
784
|
+
{[
|
|
785
|
+
"Midnight Sessions",
|
|
786
|
+
"Neon Frequencies",
|
|
787
|
+
"Echoes Vol. 2",
|
|
788
|
+
"Solar Drift",
|
|
789
|
+
].map((album) => (
|
|
790
|
+
<div
|
|
791
|
+
key={album}
|
|
792
|
+
className="border-fm-divider-secondary rounded-lg border p-3"
|
|
793
|
+
>
|
|
794
|
+
<div className="bg-fm-surface-secondary mb-2 aspect-square w-full rounded-md" />
|
|
795
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm font-medium">
|
|
796
|
+
{album}
|
|
797
|
+
</p>
|
|
798
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
799
|
+
Various Artists
|
|
800
|
+
</p>
|
|
801
|
+
</div>
|
|
802
|
+
))}
|
|
803
|
+
</div>
|
|
804
|
+
<Pagination
|
|
805
|
+
size="md"
|
|
806
|
+
showFirstLast
|
|
807
|
+
showPageSize
|
|
808
|
+
pageSizeOptions={[10, 20, 50]}
|
|
809
|
+
/>
|
|
810
|
+
</div>
|
|
811
|
+
</PaginationProvider>
|
|
812
|
+
</div>
|
|
813
|
+
|
|
814
|
+
<div className="space-y-4">
|
|
815
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
816
|
+
Admin Data Table
|
|
817
|
+
</h4>
|
|
818
|
+
<PaginationProvider
|
|
819
|
+
totalItems={1500}
|
|
820
|
+
initialPage={1}
|
|
821
|
+
initialPageSize={50}
|
|
822
|
+
>
|
|
823
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary mx-auto max-w-md space-y-3 rounded-xl border p-5">
|
|
824
|
+
<div className="flex items-center justify-between">
|
|
825
|
+
<p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold">
|
|
826
|
+
Upload Log
|
|
827
|
+
</p>
|
|
828
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
829
|
+
1,500 entries
|
|
830
|
+
</p>
|
|
831
|
+
</div>
|
|
832
|
+
<div className="border-fm-divider-secondary rounded-lg border">
|
|
833
|
+
{[
|
|
834
|
+
"track_001.flac",
|
|
835
|
+
"track_002.mp3",
|
|
836
|
+
"cover_art.png",
|
|
837
|
+
"metadata.json",
|
|
838
|
+
].map((file, i) => (
|
|
839
|
+
<div
|
|
840
|
+
key={file}
|
|
841
|
+
className="border-fm-divider-secondary flex items-center justify-between border-b p-3 last:border-b-0"
|
|
842
|
+
>
|
|
843
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
844
|
+
{file}
|
|
845
|
+
</p>
|
|
846
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
847
|
+
{(i + 1) * 2}.{i}MB
|
|
848
|
+
</p>
|
|
849
|
+
</div>
|
|
850
|
+
))}
|
|
851
|
+
</div>
|
|
852
|
+
<Pagination
|
|
853
|
+
size="md"
|
|
854
|
+
showFirstLast
|
|
855
|
+
showPageSize
|
|
856
|
+
pageSizeOptions={[25, 50, 100]}
|
|
857
|
+
/>
|
|
858
|
+
</div>
|
|
859
|
+
</PaginationProvider>
|
|
860
|
+
</div>
|
|
861
|
+
</div>
|
|
862
|
+
),
|
|
863
|
+
parameters: {
|
|
864
|
+
layout: "fullscreen",
|
|
865
|
+
docs: {
|
|
866
|
+
description: {
|
|
867
|
+
story:
|
|
868
|
+
"Real product scenarios: a track library browser with compact pagination, an album search results grid, and an admin data table with page size control.",
|
|
358
869
|
},
|
|
359
870
|
},
|
|
360
871
|
},
|