aural-ui 4.0.1 → 4.1.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.
Files changed (174) hide show
  1. package/dist/components/aspect-ratio/AspectRatio.stories.tsx +290 -1228
  2. package/dist/components/avatar/Avatar.stories.tsx +219 -235
  3. package/dist/components/badge/Badge.stories.tsx +379 -116
  4. package/dist/components/banner/Banner.stories.tsx +445 -391
  5. package/dist/components/breadcrumb/Breadcrumb.stories.tsx +453 -199
  6. package/dist/components/button/Button.stories.tsx +585 -230
  7. package/dist/components/card/Card.stories.tsx +619 -301
  8. package/dist/components/char-count/CharCount.stories.tsx +350 -248
  9. package/dist/components/checkbox/Checkbox.stories.tsx +309 -167
  10. package/dist/components/chip/Chip.stories.tsx +362 -168
  11. package/dist/components/circular-loader/CircularLoader.stories.tsx +221 -636
  12. package/dist/components/clamp-lines/ClampLines.stories.tsx +246 -117
  13. package/dist/components/collapsible/Collapsible.stories.tsx +391 -252
  14. package/dist/components/command/Command.stories.tsx +530 -867
  15. package/dist/components/dialog/Dialog.stories.tsx +501 -950
  16. package/dist/components/divider/Divider.stories.tsx +264 -527
  17. package/dist/components/dot-loader/DotLoader.stories.tsx +256 -257
  18. package/dist/components/drawer/Drawer.stories.tsx +659 -1023
  19. package/dist/components/dropdown/Dropdown.stories.tsx +643 -1028
  20. package/dist/components/form/Form.stories.tsx +560 -274
  21. package/dist/components/helper-text/HelperText.stories.tsx +199 -200
  22. package/dist/components/hover-card/HoverCard.stories.tsx +318 -1254
  23. package/dist/components/icon-button/IconButton.stories.tsx +837 -194
  24. package/dist/components/if-else/if-else.stories.tsx +370 -83
  25. package/dist/components/input/Input.stories.tsx +436 -368
  26. package/dist/components/label/Label.stories.tsx +156 -154
  27. package/dist/components/list/List.stories.tsx +484 -835
  28. package/dist/components/marquee/Marquee.stories.tsx +356 -712
  29. package/dist/components/otp-inputs/OtpInputs.stories.tsx +352 -422
  30. package/dist/components/overlay/Overlay.stories.tsx +452 -824
  31. package/dist/components/pagination/Pagination.stories.tsx +721 -210
  32. package/dist/components/popover/Popover.stories.tsx +481 -896
  33. package/dist/components/radio/Radio.stories.tsx +432 -124
  34. package/dist/components/resizable/Resizable.stories.tsx +495 -799
  35. package/dist/components/scroll-area/ScrollArea.stories.tsx +383 -1059
  36. package/dist/components/search/Search.stories.tsx +312 -595
  37. package/dist/components/select/Select.stories.tsx +684 -789
  38. package/dist/components/sheet/Sheet.stories.tsx +671 -950
  39. package/dist/components/skelton/Skelton.stories.tsx +230 -764
  40. package/dist/components/slider/Slider.stories.tsx +383 -760
  41. package/dist/components/stepper/Stepper.stories.tsx +371 -514
  42. package/dist/components/switch/Switch.stories.tsx +461 -208
  43. package/dist/components/switch-case/SwitchCase.stories.tsx +367 -188
  44. package/dist/components/table/Table.stories.tsx +770 -916
  45. package/dist/components/tabs/Tabs.stories.tsx +458 -1455
  46. package/dist/components/tag/Tag.stories.tsx +714 -542
  47. package/dist/components/textarea/TextArea.stories.tsx +621 -562
  48. package/dist/components/thumbnail-tags/ThumbnailTags.stories.tsx +228 -154
  49. package/dist/components/toast/Toast.stories.tsx +452 -1339
  50. package/dist/components/toggle/Toggle.stories.tsx +488 -931
  51. package/dist/components/tooltip/Tooltip.stories.tsx +344 -1388
  52. package/dist/components/typography/Typography.stories.tsx +406 -89
  53. package/dist/hooks/use-change-state/UseChangeState.stories.tsx +309 -606
  54. package/dist/hooks/use-previous/UsePrevious.stories.tsx +367 -917
  55. package/dist/hooks/use-standalone-pagination/UseStandalonePagination.stories.tsx +639 -867
  56. package/dist/icons/Icons.stories.tsx +0 -12
  57. package/dist/icons/ai-avatar-icon/AiAvatarIcon.stories.tsx +223 -1060
  58. package/dist/icons/alert-icon/AlertIcon.stories.tsx +106 -968
  59. package/dist/icons/all-icons.tsx +37 -16
  60. package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +137 -1010
  61. package/dist/icons/apple-logo-icon/AppleLogoIcon.stories.tsx +145 -935
  62. package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +132 -1046
  63. package/dist/icons/arrow-corner-up-left-icon/ArrowCornerUpLeftIcon.stories.tsx +134 -986
  64. package/dist/icons/arrow-corner-up-right-icon/ArrowCornerUpRightIcon.stories.tsx +135 -1028
  65. package/dist/icons/arrow-left-icon/ArrowLeftIcon.stories.tsx +133 -971
  66. package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +145 -1123
  67. package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +143 -1252
  68. package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +123 -632
  69. package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +141 -1223
  70. package/dist/icons/backward-ten-seconds-icon/BackwardTenSecondsIcon.stories.tsx +164 -1018
  71. package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +121 -1236
  72. package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +121 -1213
  73. package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +116 -893
  74. package/dist/icons/camera-icon/CameraIcon.stories.tsx +109 -1254
  75. package/dist/icons/capital-a-letter-icon/CapitalALetterIcon.stories.tsx +114 -975
  76. package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +157 -994
  77. package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +160 -992
  78. package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +140 -970
  79. package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +126 -993
  80. package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +144 -987
  81. package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +141 -1007
  82. package/dist/icons/circle-tick-icon/CircleTickIcon.stories.tsx +147 -1187
  83. package/dist/icons/circular-play-icon/CircularPlayIcon.stories.tsx +110 -476
  84. package/dist/icons/coin-icon/CoinIcon.stories.tsx +120 -1364
  85. package/dist/icons/coin-toons-icon/CoinToonsIcon.stories.tsx +113 -1360
  86. package/dist/icons/column-wide-add-icon/ColumnWideAddIcon.stories.tsx +111 -942
  87. package/dist/icons/command-icon/CommandIcon.stories.tsx +124 -1087
  88. package/dist/icons/copy-icon/CopyIcon.stories.tsx +119 -996
  89. package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +144 -1046
  90. package/dist/icons/cross-icon/CrossIcon.stories.tsx +136 -999
  91. package/dist/icons/download-icon/DownloadIcon.stories.tsx +123 -857
  92. package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +121 -1080
  93. package/dist/icons/email-icon/EmailIcon.stories.tsx +112 -979
  94. package/dist/icons/expand-icon/ExpandIcon.stories.tsx +109 -1146
  95. package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +141 -1068
  96. package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +140 -1081
  97. package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +124 -1050
  98. package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +123 -1091
  99. package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +122 -633
  100. package/dist/icons/filter-bar-row-icon/FilterBarRowIcon.stories.tsx +116 -1087
  101. package/dist/icons/forward-ten-seconds-icon/ForwardTenSecondsIcon.stories.tsx +166 -1020
  102. package/dist/icons/git-branch-icon/GitBranchIcon.stories.tsx +112 -1182
  103. package/dist/icons/git-fork-icon/GitForkIcon.stories.tsx +112 -1155
  104. package/dist/icons/globe-icon/GlobeIcon.stories.tsx +127 -325
  105. package/dist/icons/google-logo-icon/GoogleLogoIcon.stories.tsx +142 -985
  106. package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +116 -1217
  107. package/dist/icons/head-icon/HeadIcon.stories.tsx +108 -953
  108. package/dist/icons/heart-icon/HeartIcon.stories.tsx +117 -1060
  109. package/dist/icons/image-avatar-sparkle-icon/ImageAvatarSparkleIcon.stories.tsx +116 -716
  110. package/dist/icons/image-icon/ImageIcon.stories.tsx +102 -1164
  111. package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +108 -1233
  112. package/dist/icons/import-left-arrow-folder-icon/ImportLeftArrowFolderIcon.stories.tsx +133 -1289
  113. package/dist/icons/indian-flag-icon/IndianFlagIcon.stories.tsx +155 -1012
  114. package/dist/icons/instagram-icon/InstagramIcon.stories.tsx +158 -1438
  115. package/dist/icons/layout-column-icon/LayoutColumnIcon.stories.tsx +121 -1011
  116. package/dist/icons/layout-left-icon/LayoutLeftIcon.stories.tsx +116 -981
  117. package/dist/icons/layout-right-icon/LayoutRightIcon.stories.tsx +116 -979
  118. package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +105 -1252
  119. package/dist/icons/linked-in-icon/LinkedInIcon.stories.tsx +151 -1554
  120. package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +107 -1227
  121. package/dist/icons/magic-edit-icon/MagicEditIcon.stories.tsx +116 -707
  122. package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +119 -1226
  123. package/dist/icons/message-icon/MessageIcon.stories.tsx +111 -557
  124. package/dist/icons/minimize-icon/MinimizeIcon.stories.tsx +112 -1198
  125. package/dist/icons/moon-icon/MoonIcon.stories.tsx +117 -557
  126. package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +106 -1235
  127. package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +112 -1185
  128. package/dist/icons/musical-note-icon/MusicalNoteIcon.stories.tsx +116 -1012
  129. package/dist/icons/notepad-icon/NotepadIcon.stories.tsx +108 -1137
  130. package/dist/icons/notes-icon/NotesIcon.stories.tsx +116 -1138
  131. package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +106 -1146
  132. package/dist/icons/page-text-icon/PageTextIcon.stories.tsx +119 -719
  133. package/dist/icons/paint-roll-icon/PaintRollIcon.stories.tsx +110 -999
  134. package/dist/icons/paper-plane-icon/PaperPlaneIcon.stories.tsx +109 -912
  135. package/dist/icons/pause-icon/PauseIcon.stories.tsx +110 -1041
  136. package/dist/icons/pencil-icon/PencilIcon.stories.tsx +112 -1109
  137. package/dist/icons/phone-icon/PhoneIcon.stories.tsx +112 -1023
  138. package/dist/icons/plus-icon/PlusIcon.stories.tsx +103 -1132
  139. package/dist/icons/pocket-studio-icon/PocketStudioIcon.stories.tsx +104 -870
  140. package/dist/icons/scroll-down-icon/ScrollDownIcon.stories.tsx +99 -476
  141. package/dist/icons/search-icon/SearchIcon.stories.tsx +108 -1161
  142. package/dist/icons/setting-icon/SettingIcon.stories.tsx +104 -1009
  143. package/dist/icons/share-icon/ShareIcon.stories.tsx +117 -1064
  144. package/dist/icons/shield-icon/ShieldIcon.stories.tsx +114 -974
  145. package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +134 -1160
  146. package/dist/icons/skip-backward-icon/SkipBackwardIcon.stories.tsx +169 -1017
  147. package/dist/icons/skip-forward-icon/SkipForwardIcon.stories.tsx +161 -1016
  148. package/dist/icons/sparkles-soft-icon/SparklesSoftIcon.stories.tsx +102 -1001
  149. package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +155 -593
  150. package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +155 -608
  151. package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +142 -712
  152. package/dist/icons/star-icon/StarIcon.stories.tsx +120 -946
  153. package/dist/icons/store-coin-icon/StoreCoinIcon.stories.tsx +109 -1013
  154. package/dist/icons/suggestion-icon/SuggestionIcon.stories.tsx +113 -891
  155. package/dist/icons/sun-icon/SunIcon.stories.tsx +117 -864
  156. package/dist/icons/text-color-icon/TextColorIcon.stories.tsx +113 -989
  157. package/dist/icons/text-indicator-icon/TextIndicatorIcon.stories.tsx +120 -1027
  158. package/dist/icons/threads-icon/ThreadsIcon.stories.tsx +153 -1476
  159. package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +143 -1187
  160. package/dist/icons/tick-icon/TickIcon.stories.tsx +142 -1322
  161. package/dist/icons/trash-icon/TrashIcon.stories.tsx +105 -970
  162. package/dist/icons/twitter-x-icon/TwitterXIcon.stories.tsx +154 -1457
  163. package/dist/icons/upload-icon/UploadIcon.stories.tsx +112 -930
  164. package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +115 -1019
  165. package/dist/icons/video-play-list-icon/VideoPlaylistIcon.stories.tsx +122 -1092
  166. package/dist/icons/voice-playing-icon/VoicePlayingIcon.stories.tsx +120 -1401
  167. package/dist/icons/volume-full-icon/VolumeFullIcon.stories.tsx +107 -1212
  168. package/dist/icons/volume-half-icon/VolumeHalfIcon.stories.tsx +109 -1122
  169. package/dist/icons/volume-off-icon/VolumeOffIcon.stories.tsx +112 -1124
  170. package/dist/icons/warning-icon/WarningIcon.stories.tsx +119 -1083
  171. package/dist/icons/youtube-icon/YoutubeIcon.stories.tsx +158 -983
  172. package/dist/index.cjs +1 -1
  173. package/dist/index.js +1 -1
  174. package/package.json +1 -1
@@ -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 paginated data with customizable options.",
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
- // Main Pagination Stories
76
- export const Default: Story = {
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
- export const Small: Story = {
86
- args: {
87
- size: "sm",
88
- showFirstLast: true,
89
- showPageSize: false,
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
- export const Large: Story = {
94
- args: {
95
- size: "lg",
96
- showFirstLast: true,
97
- showPageSize: false,
98
- },
99
- }
104
+ // ─── 2. Sizes ─────────────────────────────────────────────────────────────────
100
105
 
101
- export const WithPageSize: Story = {
102
- args: {
103
- size: "md",
104
- showFirstLast: true,
105
- showPageSize: true,
106
- pageSizeOptions: [10, 20, 50, 100],
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
- export const WithoutFirstLast: Story = {
111
- args: {
112
- size: "md",
113
- showFirstLast: false,
114
- showPageSize: false,
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
- export const FirstPage: Story = {
119
- decorators: [
120
- (Story) => (
121
- <PaginationProvider totalItems={100} initialPage={1} initialPageSize={10}>
122
- <Story />
123
- </PaginationProvider>
124
- ),
125
- ],
126
- args: {
127
- size: "md",
128
- showFirstLast: true,
129
- showPageSize: true,
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
- export const LastPage: Story = {
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
- // Primitives Stories
153
- export const PrimitiveButtons: Story = {
164
+ export const Configurations: Story = {
154
165
  render: () => (
155
- <div className="text-fm-primary space-y-4">
156
- <div className="space-x-2">
157
- <h3 className="mb-2 text-sm font-medium">Button Variants</h3>
158
- <PaginationButton variant="navigation" size="md">
159
- <ChevronLeftIcon />
160
- </PaginationButton>
161
- <PaginationButton variant="number" size="md">
162
- 1
163
- </PaginationButton>
164
- <PaginationButton variant="active" size="md">
165
- 2
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-x-2">
176
- <h3 className="mb-2 text-sm font-medium">Button Sizes</h3>
177
- <PaginationButton variant="number" size="sm">
178
- 1
179
- </PaginationButton>
180
- <PaginationButton variant="number" size="md">
181
- 2
182
- </PaginationButton>
183
- <PaginationButton variant="number" size="lg">
184
- 3
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-x-2">
189
- <h3 className="mb-2 text-sm font-medium">Disabled States</h3>
190
- <PaginationButton variant="navigation" size="md" disabled>
191
- <ChevronLeftIcon />
192
- </PaginationButton>
193
- <PaginationButton variant="number" size="md" disabled>
194
- 1
195
- </PaginationButton>
196
- <PaginationButton variant="navigation" size="md" disabled>
197
- <ChevronRightIcon />
198
- </PaginationButton>
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
- "Individual pagination button primitives with different variants, sizes, and states.",
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
- export const PrimitiveEllipsis: Story = {
219
+ // ─── 4. States ────────────────────────────────────────────────────────────────
220
+
221
+ export const States: Story = {
213
222
  render: () => (
214
- <div className="text-fm-primary space-y-4">
215
- <div className="flex items-center space-x-2">
216
- <h3 className="text-sm font-medium">Ellipsis Sizes</h3>
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
- <div className="flex items-center space-x-2">
219
- <PaginationButton variant="number" size="sm">
220
- 1
221
- </PaginationButton>
222
- <PaginationEllipsis size="sm" />
223
- <PaginationButton variant="number" size="sm">
224
- 5
225
- </PaginationButton>
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
- <div className="flex items-center space-x-2">
228
- <PaginationButton variant="number" size="md">
229
- 1
230
- </PaginationButton>
231
- <PaginationEllipsis size="md" />
232
- <PaginationButton variant="number" size="md">
233
- 5
234
- </PaginationButton>
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
- <div className="flex items-center space-x-2">
237
- <PaginationButton variant="number" size="lg">
238
- 1
239
- </PaginationButton>
240
- <PaginationEllipsis size="lg" />
241
- <PaginationButton variant="number" size="lg">
242
- 5
243
- </PaginationButton>
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: "Pagination ellipsis primitive in different sizes.",
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
- export const PrimitiveSizeSelector: Story = {
257
- render: () => (
258
- <PaginationProvider totalItems={100} initialPage={1} initialPageSize={10}>
259
- <div className="text-fm-primary space-y-4">
260
- <div>
261
- <h3 className="mb-2 text-sm font-medium">Size Selector Sizes</h3>
262
- </div>
263
- <div className="space-y-2">
264
- <PaginationSizeSelector
265
- size="sm"
266
- pageSizeOptions={[5, 10, 20]}
267
- pageSize={10}
268
- setPageSize={(size) => console.log("Set page size:", size)}
269
- />
270
- <PaginationSizeSelector
271
- size="md"
272
- pageSizeOptions={[10, 20, 50]}
273
- pageSize={20}
274
- setPageSize={(size) => console.log("Set page size:", size)}
275
- />
276
- <PaginationSizeSelector
277
- size="lg"
278
- pageSizeOptions={[20, 50, 100]}
279
- pageSize={50}
280
- setPageSize={(size) => console.log("Set page size:", size)}
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
- </PaginationProvider>
285
- ),
436
+ )
437
+ },
286
438
  parameters: {
439
+ layout: "fullscreen",
287
440
  docs: {
288
441
  description: {
289
- story: "Pagination size selector primitive in different sizes.",
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
- export const PrimitiveComposition: Story = {
449
+ // ─── 6. Parts ─────────────────────────────────────────────────────────────────
450
+
451
+ export const Parts: Story = {
296
452
  render: () => (
297
- <div className="text-fm-primary space-y-6">
298
- <div>
299
- <h3 className="mb-2 text-sm font-medium">
300
- Custom Composition with Primitives
301
- </h3>
302
- <PaginationRoot>
303
- <PaginationContent>
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
- <PaginationButton variant="number" size="md">
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
- <PaginationEllipsis size="md" />
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
- 10
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
- </PaginationContent>
333
- </PaginationRoot>
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
- <h3 className="mb-2 text-sm font-medium">Minimal Composition</h3>
338
- <PaginationRoot>
339
- <PaginationContent>
340
- <PaginationButton variant="navigation" size="sm">
341
- <ChevronLeftIcon />
342
- </PaginationButton>
343
- <PaginationButton variant="active" size="sm">
344
- 5
345
- </PaginationButton>
346
- <PaginationButton variant="navigation" size="sm">
347
- <ChevronRightIcon />
348
- </PaginationButton>
349
- </PaginationContent>
350
- </PaginationRoot>
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: "Examples of custom compositions using pagination primitives.",
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
  },