@ceed/ads 1.35.1 → 1.37.0-next.1

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 (124) hide show
  1. package/README.md +85 -95
  2. package/dist/components/Accordions/Accordions.d.ts +1 -0
  3. package/dist/components/Alert/Alert.d.ts +5 -5
  4. package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
  5. package/dist/components/Avatar/Avatar.d.ts +7 -17
  6. package/dist/components/Box/Box.d.ts +1 -0
  7. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -5
  8. package/dist/components/Button/Button.d.ts +3 -2
  9. package/dist/components/Calendar/Calendar.d.ts +1 -0
  10. package/dist/components/Card/Card.d.ts +1 -0
  11. package/dist/components/Checkbox/Checkbox.d.ts +1 -0
  12. package/dist/components/Chip/Chip.d.ts +1 -0
  13. package/dist/components/Container/Container.d.ts +6 -1
  14. package/dist/components/DialogActions/DialogActions.d.ts +1 -0
  15. package/dist/components/DialogContent/DialogContent.d.ts +1 -0
  16. package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
  17. package/dist/components/DialogTitle/DialogTitle.d.ts +1 -0
  18. package/dist/components/Divider/Divider.d.ts +1 -0
  19. package/dist/components/Dropdown/Dropdown.d.ts +28 -1
  20. package/dist/components/FilterMenu/components/MonthRange.d.ts +11 -0
  21. package/dist/components/FilterMenu/types.d.ts +5 -1
  22. package/dist/components/FilterableCheckboxGroup/FilterableCheckboxGroup.d.ts +1 -1
  23. package/dist/components/FormControl/FormControl.d.ts +1 -0
  24. package/dist/components/FormHelperText/FormHelperText.d.ts +1 -0
  25. package/dist/components/FormLabel/FormLabel.d.ts +1 -0
  26. package/dist/components/Grid/Grid.d.ts +1 -0
  27. package/dist/components/IconButton/IconButton.d.ts +3 -2
  28. package/dist/components/IconMenuButton/IconMenuButton.d.ts +7 -6
  29. package/dist/components/InfoSign/InfoSign.d.ts +3 -2
  30. package/dist/components/Input/Input.d.ts +8 -22
  31. package/dist/components/InsetDrawer/InsetDrawer.d.ts +1 -0
  32. package/dist/components/Markdown/Markdown.d.ts +9 -24
  33. package/dist/components/Menu/Menu.d.ts +2 -1
  34. package/dist/components/MenuButton/MenuButton.d.ts +10 -8
  35. package/dist/components/Modal/Modal.d.ts +4 -2
  36. package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -2
  37. package/dist/components/NavigationItem/NavigationItem.d.ts +3 -2
  38. package/dist/components/Navigator/Navigator.d.ts +5 -4
  39. package/dist/components/Pagination/Pagination.d.ts +2 -2
  40. package/dist/components/ProfileMenu/ProfileMenu.d.ts +3 -3
  41. package/dist/components/Radio/Radio.d.ts +1 -0
  42. package/dist/components/RadioList/RadioList.d.ts +3 -2
  43. package/dist/components/Select/Select.d.ts +12 -10
  44. package/dist/components/Sheet/Sheet.d.ts +1 -0
  45. package/dist/components/Stack/Stack.d.ts +1 -0
  46. package/dist/components/Stepper/Stepper.d.ts +2 -1
  47. package/dist/components/Switch/Switch.d.ts +1 -0
  48. package/dist/components/Table/Table.d.ts +7 -5
  49. package/dist/components/Tabs/Tabs.d.ts +1 -0
  50. package/dist/components/Textarea/Textarea.d.ts +8 -20
  51. package/dist/components/ThemeProvider/ThemeProvider.d.ts +24 -2
  52. package/dist/components/Tooltip/Tooltip.d.ts +1 -0
  53. package/dist/components/Typography/Typography.d.ts +1 -0
  54. package/dist/components/Uploader/Uploader.d.ts +18 -17
  55. package/dist/components/data-display/Avatar.md +61 -73
  56. package/dist/components/data-display/Badge.md +198 -182
  57. package/dist/components/data-display/Chip.md +165 -143
  58. package/dist/components/data-display/DataTable.md +843 -338
  59. package/dist/components/data-display/InfoSign.md +1 -3
  60. package/dist/components/data-display/Markdown.md +93 -125
  61. package/dist/components/data-display/Table.md +1454 -1008
  62. package/dist/components/data-display/Tooltip.md +1 -1
  63. package/dist/components/data-display/Typography.md +101 -104
  64. package/dist/components/feedback/Alert.md +81 -87
  65. package/dist/components/feedback/CircularProgress.md +34 -38
  66. package/dist/components/feedback/Dialog.md +25 -17
  67. package/dist/components/feedback/Modal.md +297 -266
  68. package/dist/components/feedback/Skeleton.md +125 -89
  69. package/dist/components/index.d.ts +60 -1
  70. package/dist/components/inputs/Autocomplete.md +192 -96
  71. package/dist/components/inputs/Button.md +85 -85
  72. package/dist/components/inputs/ButtonGroup.md +197 -187
  73. package/dist/components/inputs/Calendar.md +25 -28
  74. package/dist/components/inputs/Checkbox.md +13 -31
  75. package/dist/components/inputs/CurrencyInput.md +6 -6
  76. package/dist/components/inputs/DatePicker.md +229 -110
  77. package/dist/components/inputs/DateRangePicker.md +248 -137
  78. package/dist/components/inputs/FilterMenu.md +138 -8
  79. package/dist/components/inputs/FilterableCheckboxGroup.md +116 -56
  80. package/dist/components/inputs/FormControl.md +76 -70
  81. package/dist/components/inputs/IconButton.md +231 -207
  82. package/dist/components/inputs/Input.md +133 -100
  83. package/dist/components/inputs/MonthPicker.md +186 -84
  84. package/dist/components/inputs/MonthRangePicker.md +73 -49
  85. package/dist/components/inputs/PercentageInput.md +17 -33
  86. package/dist/components/inputs/RadioButton.md +322 -258
  87. package/dist/components/inputs/RadioList.md +68 -52
  88. package/dist/components/inputs/RadioTileGroup.md +287 -170
  89. package/dist/components/inputs/SearchBar.md +82 -60
  90. package/dist/components/inputs/Select.md +108 -97
  91. package/dist/components/inputs/Slider.md +155 -104
  92. package/dist/components/inputs/Switch.md +194 -139
  93. package/dist/components/inputs/Textarea.md +17 -22
  94. package/dist/components/inputs/Uploader/Uploader.md +69 -40
  95. package/dist/components/layout/Box.md +841 -662
  96. package/dist/components/layout/Container.md +3 -11
  97. package/dist/components/layout/Grid.md +480 -394
  98. package/dist/components/layout/Stack.md +739 -566
  99. package/dist/components/navigation/Breadcrumbs.md +182 -116
  100. package/dist/components/navigation/Dropdown.md +732 -391
  101. package/dist/components/navigation/IconMenuButton.md +15 -7
  102. package/dist/components/navigation/InsetDrawer.md +550 -378
  103. package/dist/components/navigation/Link.md +104 -94
  104. package/dist/components/navigation/Menu.md +624 -503
  105. package/dist/components/navigation/MenuButton.md +19 -11
  106. package/dist/components/navigation/NavigationGroup.md +19 -50
  107. package/dist/components/navigation/NavigationItem.md +6 -6
  108. package/dist/components/navigation/Navigator.md +26 -28
  109. package/dist/components/navigation/Pagination.md +87 -76
  110. package/dist/components/navigation/ProfileMenu.md +67 -45
  111. package/dist/components/navigation/Stepper.md +2 -12
  112. package/dist/components/navigation/Tabs.md +210 -184
  113. package/dist/components/surfaces/Accordions.md +90 -173
  114. package/dist/components/surfaces/Card.md +1096 -711
  115. package/dist/components/surfaces/Divider.md +562 -412
  116. package/dist/components/surfaces/Sheet.md +700 -518
  117. package/dist/guides/ThemeProvider.md +65 -40
  118. package/dist/index.browser.js +5 -5
  119. package/dist/index.browser.js.map +4 -4
  120. package/dist/index.cjs +1906 -1690
  121. package/dist/index.d.ts +1 -1
  122. package/dist/index.js +1404 -1180
  123. package/framer/index.js +1 -1
  124. package/package.json +34 -36
@@ -238,7 +238,7 @@ function ToolbarActions({ selectedItems, onAction }) {
238
238
  | `buttonText` | `string` | (required) | Text displayed in the trigger button |
239
239
  | `items` | `{ text: string; onClick?: () => void }[]` | (required) | Menu item list |
240
240
  | `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'outlined'` | Button visual style |
241
- | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Button size |
241
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'sm'` | Button size |
242
242
  | `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Button color |
243
243
  | `disabled` | `boolean` | `false` | Disables the button |
244
244
  | `startDecorator` | `ReactNode` | - | Content before button text |
@@ -252,11 +252,15 @@ function ToolbarActions({ selectedItems, onAction }) {
252
252
  - **Use descriptive button text.** The button label should clearly indicate what kind of options the menu contains. Avoid vague labels like "More" or "Options" -- prefer specific labels like "Export Options" or "User Actions".
253
253
 
254
254
  ```tsx
255
- {/* ✅ Good: Clear purpose */}
256
- <MenuButton buttonText="Export Options" items={exportItems} />
257
-
258
- {/* Avoid: Vague label */}
259
- <MenuButton buttonText="More" items={items} />
255
+ {
256
+ /* Good: Clear purpose */
257
+ }
258
+ <MenuButton buttonText="Export Options" items={exportItems} />;
259
+
260
+ {
261
+ /* ❌ Avoid: Vague label */
262
+ }
263
+ <MenuButton buttonText="More" items={items} />;
260
264
  ```
261
265
 
262
266
  - **Keep the items list short and focused.** Aim for 3-7 items that are logically related. If you need more items or mixed content, switch to the Dropdown + Menu composition pattern.
@@ -272,14 +276,18 @@ function ToolbarActions({ selectedItems, onAction }) {
272
276
  - **Do not use MenuButton for form value selection.** MenuButton triggers actions -- it is not a Select replacement. For form inputs where the user picks a value, use the Select component.
273
277
 
274
278
  ```tsx
275
- {/* ❌ Bad: Form selection */}
276
- <MenuButton buttonText={selectedValue} items={options} />
277
-
278
- {/* Good: Use Select for forms */}
279
+ {
280
+ /* Bad: Form selection */
281
+ }
282
+ <MenuButton buttonText={selectedValue} items={options} />;
283
+
284
+ {
285
+ /* ✅ Good: Use Select for forms */
286
+ }
279
287
  <Select value={selectedValue} onChange={handleChange}>
280
288
  <Option value="a">Option A</Option>
281
289
  <Option value="b">Option B</Option>
282
- </Select>
290
+ </Select>;
283
291
  ```
284
292
 
285
293
  - **Use `placement` to prevent overflow.** When the trigger is near the right edge of the viewport, use `placement="bottom-end"` so the menu does not extend beyond the screen.
@@ -19,14 +19,16 @@ import { NavigationGroup, NavigationItem } from '@ceed/ads';
19
19
 
20
20
  function Sidebar() {
21
21
  return (
22
- <NavigationGroup
23
- title="User Management"
24
- startDecorator={<PeopleIcon />}
25
- defaultExpanded={true}
26
- >
27
- <NavigationItem id="users" level={1}>All Users</NavigationItem>
28
- <NavigationItem id="roles" level={1}>Roles</NavigationItem>
29
- <NavigationItem id="permissions" level={1}>Permissions</NavigationItem>
22
+ <NavigationGroup title="User Management" startDecorator={<PeopleIcon />} defaultExpanded={true}>
23
+ <NavigationItem id="users" level={1}>
24
+ All Users
25
+ </NavigationItem>
26
+ <NavigationItem id="roles" level={1}>
27
+ Roles
28
+ </NavigationItem>
29
+ <NavigationItem id="permissions" level={1}>
30
+ Permissions
31
+ </NavigationItem>
30
32
  </NavigationGroup>
31
33
  );
32
34
  }
@@ -96,11 +98,7 @@ Icons work at any nesting level.
96
98
  function AdminNavigation() {
97
99
  return (
98
100
  <>
99
- <NavigationGroup
100
- title="User Management"
101
- startDecorator={<PeopleIcon />}
102
- defaultExpanded={true}
103
- >
101
+ <NavigationGroup title="User Management" startDecorator={<PeopleIcon />} defaultExpanded={true}>
104
102
  <NavigationItem id="users" level={1}>
105
103
  All Users
106
104
  </NavigationItem>
@@ -112,10 +110,7 @@ function AdminNavigation() {
112
110
  </NavigationItem>
113
111
  </NavigationGroup>
114
112
 
115
- <NavigationGroup
116
- title="Content"
117
- startDecorator={<ArticleIcon />}
118
- >
113
+ <NavigationGroup title="Content" startDecorator={<ArticleIcon />}>
119
114
  <NavigationItem id="posts" level={1}>
120
115
  Posts
121
116
  </NavigationItem>
@@ -127,10 +122,7 @@ function AdminNavigation() {
127
122
  </NavigationItem>
128
123
  </NavigationGroup>
129
124
 
130
- <NavigationGroup
131
- title="Settings"
132
- startDecorator={<SettingsIcon />}
133
- >
125
+ <NavigationGroup title="Settings" startDecorator={<SettingsIcon />}>
134
126
  <NavigationItem id="general" level={1}>
135
127
  General
136
128
  </NavigationItem>
@@ -151,20 +143,12 @@ function AdminNavigation() {
151
143
  ```tsx
152
144
  function NestedNavigation() {
153
145
  return (
154
- <NavigationGroup
155
- title="E-commerce"
156
- startDecorator={<ShoppingCartIcon />}
157
- defaultExpanded={true}
158
- >
146
+ <NavigationGroup title="E-commerce" startDecorator={<ShoppingCartIcon />} defaultExpanded={true}>
159
147
  <NavigationItem id="dashboard" level={1}>
160
148
  Dashboard
161
149
  </NavigationItem>
162
150
 
163
- <NavigationGroup
164
- title="Products"
165
- level={1}
166
- defaultExpanded={true}
167
- >
151
+ <NavigationGroup title="Products" level={1} defaultExpanded={true}>
168
152
  <NavigationItem id="all-products" level={2}>
169
153
  All Products
170
154
  </NavigationItem>
@@ -176,10 +160,7 @@ function NestedNavigation() {
176
160
  </NavigationItem>
177
161
  </NavigationGroup>
178
162
 
179
- <NavigationGroup
180
- title="Orders"
181
- level={1}
182
- >
163
+ <NavigationGroup title="Orders" level={1}>
183
164
  <NavigationItem id="all-orders" level={2}>
184
165
  All Orders
185
166
  </NavigationItem>
@@ -243,11 +224,7 @@ function DocsSidebar({ sections, currentPath }) {
243
224
  NavigationGroup extends Joy UI's Accordion, so you can use additional Accordion props:
244
225
 
245
226
  ```tsx
246
- <NavigationGroup
247
- title="Settings"
248
- expanded={isExpanded}
249
- onChange={(event, expanded) => setIsExpanded(expanded)}
250
- >
227
+ <NavigationGroup title="Settings" expanded={isExpanded} onChange={(event, expanded) => setIsExpanded(expanded)}>
251
228
  {/* Content */}
252
229
  </NavigationGroup>
253
230
  ```
@@ -362,11 +339,7 @@ function LazyNavigationGroup({ title, loadContent }) {
362
339
  };
363
340
 
364
341
  return (
365
- <NavigationGroup
366
- title={title}
367
- expanded={expanded}
368
- onChange={handleChange}
369
- >
342
+ <NavigationGroup title={title} expanded={expanded} onChange={handleChange}>
370
343
  {content || <Skeleton />}
371
344
  </NavigationGroup>
372
345
  );
@@ -382,11 +355,7 @@ function SidebarNavigation() {
382
355
  const [expandedGroups, setExpandedGroups] = useState(['products']);
383
356
 
384
357
  const handleGroupChange = (groupId) => (event, isExpanded) => {
385
- setExpandedGroups((prev) =>
386
- isExpanded
387
- ? [...prev, groupId]
388
- : prev.filter((id) => id !== groupId)
389
- );
358
+ setExpandedGroups((prev) => (isExpanded ? [...prev, groupId] : prev.filter((id) => id !== groupId)));
390
359
  };
391
360
 
392
361
  return (
@@ -244,9 +244,7 @@ NavigationItem includes built-in accessibility features:
244
244
 
245
245
  ```tsx
246
246
  // Selected state is announced
247
- <NavigationItem selected={true}>
248
- Dashboard {/* Announced as "Dashboard, current page" */}
249
- </NavigationItem>
247
+ <NavigationItem selected={true}>Dashboard {/* Announced as "Dashboard, current page" */}</NavigationItem>
250
248
  ```
251
249
 
252
250
  ## Best Practices
@@ -305,7 +303,9 @@ const handleClick = useCallback((id) => {
305
303
  }, []);
306
304
 
307
305
  // Pass stable handler to all items
308
- <NavigationItem id="item1" onClick={handleClick}>Item 1</NavigationItem>
306
+ <NavigationItem id="item1" onClick={handleClick}>
307
+ Item 1
308
+ </NavigationItem>;
309
309
  ```
310
310
 
311
311
  ### Avoid Inline Objects
@@ -314,11 +314,11 @@ Don't create new decorator elements on each render:
314
314
 
315
315
  ```tsx
316
316
  // ❌ Bad: New element created each render
317
- <NavigationItem startDecorator={<HomeIcon />}>Home</NavigationItem>
317
+ <NavigationItem startDecorator={<HomeIcon />}>Home</NavigationItem>;
318
318
 
319
319
  // ✅ Good: Memoized or static
320
320
  const homeIcon = <HomeIcon />;
321
- <NavigationItem startDecorator={homeIcon}>Home</NavigationItem>
321
+ <NavigationItem startDecorator={homeIcon}>Home</NavigationItem>;
322
322
  ```
323
323
 
324
324
  NavigationItem provides a foundational building block for sidebar navigation. Use it within Navigator for automatic item management, or combine it with NavigationGroup for custom hierarchical navigation structures.
@@ -157,12 +157,7 @@ function FileBrowser({ folders, onFolderSelect }) {
157
157
  });
158
158
  };
159
159
 
160
- return (
161
- <Navigator
162
- items={buildNavigatorItems(folders)}
163
- onSelect={onFolderSelect}
164
- />
165
- );
160
+ return <Navigator items={buildNavigatorItems(folders)} onSelect={onFolderSelect} />;
166
161
  }
167
162
  ```
168
163
 
@@ -221,11 +216,11 @@ Navigator uses a composition pattern with NavigationItem and NavigationGroup:
221
216
 
222
217
  ```tsx
223
218
  interface NavigatorItem {
224
- id: string; // Unique identifier
225
- type: 'item'; // Indicates a navigation item
226
- title: string | React.ReactNode; // Display text or element
227
- startDecorator?: React.ReactNode; // Icon before title
228
- selected?: boolean; // Selection state
219
+ id: string; // Unique identifier
220
+ type: 'item'; // Indicates a navigation item
221
+ title: string | React.ReactNode; // Display text or element
222
+ startDecorator?: React.ReactNode; // Icon before title
223
+ selected?: boolean; // Selection state
229
224
  }
230
225
  ```
231
226
 
@@ -233,11 +228,11 @@ interface NavigatorItem {
233
228
 
234
229
  ```tsx
235
230
  interface NavigatorGroup {
236
- type: 'group'; // Indicates a group
237
- title: string | React.ReactNode; // Group title
238
- startDecorator?: React.ReactNode; // Icon before title
239
- expanded?: boolean; // Default expanded state
240
- content: React.ReactNode; // Content when expanded (usually nested Navigator)
231
+ type: 'group'; // Indicates a group
232
+ title: string | React.ReactNode; // Group title
233
+ startDecorator?: React.ReactNode; // Icon before title
234
+ expanded?: boolean; // Default expanded state
235
+ content: React.ReactNode; // Content when expanded (usually nested Navigator)
241
236
  }
242
237
  ```
243
238
 
@@ -310,7 +305,7 @@ const items = [
310
305
  // ❌ Bad: Inconsistent icons
311
306
  const items = [
312
307
  { id: 'home', type: 'item', title: 'Home', startDecorator: <HomeIcon /> },
313
- { id: 'settings', type: 'item', title: 'Settings' }, // Missing icon
308
+ { id: 'settings', type: 'item', title: 'Settings' }, // Missing icon
314
309
  ];
315
310
  ```
316
311
 
@@ -354,17 +349,20 @@ function Sidebar() {
354
349
  When items are computed, memoize them to prevent unnecessary re-renders:
355
350
 
356
351
  ```tsx
357
- const items = useMemo(() => [
358
- {
359
- id: 'home',
360
- type: 'item',
361
- title: 'Home',
362
- selected: currentPath === '/home',
363
- },
364
- // ... more items
365
- ], [currentPath]);
366
-
367
- <Navigator items={items} onSelect={handleSelect} />
352
+ const items = useMemo(
353
+ () => [
354
+ {
355
+ id: 'home',
356
+ type: 'item',
357
+ title: 'Home',
358
+ selected: currentPath === '/home',
359
+ },
360
+ // ... more items
361
+ ],
362
+ [currentPath],
363
+ );
364
+
365
+ <Navigator items={items} onSelect={handleSelect} />;
368
366
  ```
369
367
 
370
368
  ### Lazy Load Content
@@ -8,15 +8,15 @@ Pagination ships in two variants -- **standard** (clickable page numbers) and **
8
8
 
9
9
  ```tsx
10
10
  <Stack spacing={4}>
11
- <Stack spacing={1}>
12
- <div>Standard</div>
13
- <Pagination {...args} variant="standard" />
14
- </Stack>
15
- <Stack spacing={1}>
16
- <div>Compact</div>
17
- <Pagination {...args} variant="compact" />
11
+ <Stack spacing={1}>
12
+ <div>Standard</div>
13
+ <Pagination {...args} variant="standard" />
14
+ </Stack>
15
+ <Stack spacing={1}>
16
+ <div>Compact</div>
17
+ <Pagination {...args} variant="compact" />
18
+ </Stack>
18
19
  </Stack>
19
- </Stack>
20
20
  ```
21
21
 
22
22
  | Field | Description | Default |
@@ -36,11 +36,7 @@ function DataList() {
36
36
  return (
37
37
  <>
38
38
  <ItemList items={items} page={page} pageSize={pageSize} />
39
- <Pagination
40
- rowCount={totalItems}
41
- paginationModel={{ page, pageSize }}
42
- onPageChange={setPage}
43
- />
39
+ <Pagination rowCount={totalItems} paginationModel={{ page, pageSize }} onPageChange={setPage} />
44
40
  </>
45
41
  );
46
42
  }
@@ -52,19 +48,19 @@ Pagination is available in three sizes -- `sm`, `md`, and `lg` -- for both the s
52
48
 
53
49
  ```tsx
54
50
  <Stack spacing={4}>
55
- <Stack spacing={2}>
56
- <div>Standard</div>
57
- <Pagination {...args} variant="standard" size="sm" />
58
- <Pagination {...args} variant="standard" size="md" />
59
- <Pagination {...args} variant="standard" size="lg" />
60
- </Stack>
61
- <Stack spacing={2}>
62
- <div>Compact</div>
63
- <Pagination {...args} variant="compact" size="sm" />
64
- <Pagination {...args} variant="compact" size="md" />
65
- <Pagination {...args} variant="compact" size="lg" />
51
+ <Stack spacing={2}>
52
+ <div>Standard</div>
53
+ <Pagination {...args} variant="standard" size="sm" />
54
+ <Pagination {...args} variant="standard" size="md" />
55
+ <Pagination {...args} variant="standard" size="lg" />
56
+ </Stack>
57
+ <Stack spacing={2}>
58
+ <div>Compact</div>
59
+ <Pagination {...args} variant="compact" size="sm" />
60
+ <Pagination {...args} variant="compact" size="md" />
61
+ <Pagination {...args} variant="compact" size="lg" />
62
+ </Stack>
66
63
  </Stack>
67
- </Stack>
68
64
  ```
69
65
 
70
66
  ## Pagination Page Positions
@@ -73,37 +69,61 @@ The component correctly handles the visual presentation when the user is at the
73
69
 
74
70
  ```tsx
75
71
  <Stack spacing={4}>
76
- <Stack spacing={2}>
77
- <div>Standard</div>
78
- <Pagination {...args} variant="standard" defaultPaginationModel={{
79
- page: 1,
80
- pageSize: 1
81
- }} />
82
- <Pagination {...args} variant="standard" defaultPaginationModel={{
83
- page: 10,
84
- pageSize: 1
85
- }} />
86
- <Pagination {...args} variant="standard" defaultPaginationModel={{
87
- page: 20,
88
- pageSize: 1
89
- }} />
90
- </Stack>
91
- <Stack spacing={2}>
92
- <div>Compact</div>
93
- <Pagination {...args} variant="compact" defaultPaginationModel={{
94
- page: 1,
95
- pageSize: 1
96
- }} />
97
- <Pagination {...args} variant="compact" defaultPaginationModel={{
98
- page: 10,
99
- pageSize: 1
100
- }} />
101
- <Pagination {...args} variant="compact" defaultPaginationModel={{
102
- page: 20,
103
- pageSize: 1
104
- }} />
72
+ <Stack spacing={2}>
73
+ <div>Standard</div>
74
+ <Pagination
75
+ {...args}
76
+ variant="standard"
77
+ defaultPaginationModel={{
78
+ page: 1,
79
+ pageSize: 1
80
+ }}
81
+ />
82
+ <Pagination
83
+ {...args}
84
+ variant="standard"
85
+ defaultPaginationModel={{
86
+ page: 10,
87
+ pageSize: 1
88
+ }}
89
+ />
90
+ <Pagination
91
+ {...args}
92
+ variant="standard"
93
+ defaultPaginationModel={{
94
+ page: 20,
95
+ pageSize: 1
96
+ }}
97
+ />
98
+ </Stack>
99
+ <Stack spacing={2}>
100
+ <div>Compact</div>
101
+ <Pagination
102
+ {...args}
103
+ variant="compact"
104
+ defaultPaginationModel={{
105
+ page: 1,
106
+ pageSize: 1
107
+ }}
108
+ />
109
+ <Pagination
110
+ {...args}
111
+ variant="compact"
112
+ defaultPaginationModel={{
113
+ page: 10,
114
+ pageSize: 1
115
+ }}
116
+ />
117
+ <Pagination
118
+ {...args}
119
+ variant="compact"
120
+ defaultPaginationModel={{
121
+ page: 20,
122
+ pageSize: 1
123
+ }}
124
+ />
125
+ </Stack>
105
126
  </Stack>
106
- </Stack>
107
127
  ```
108
128
 
109
129
  ## Uncontrolled Pagination
@@ -128,12 +148,12 @@ Pagination automatically adjusts when the total number of items changes. If the
128
148
 
129
149
  ```tsx
130
150
  <Stack gap={2}>
131
- <Pagination {...args} rowCount={rowCount} />
132
- <Stack direction="row" gap={2}>
133
- <Button onClick={() => setRowCount(rowCount - 1)}>Decrease Row count</Button>
134
- <Button onClick={() => setRowCount(rowCount + 1)}>Increase Row count</Button>
151
+ <Pagination {...args} rowCount={rowCount} />
152
+ <Stack direction="row" gap={2}>
153
+ <Button onClick={() => setRowCount(rowCount - 1)}>Decrease Row count</Button>
154
+ <Button onClick={() => setRowCount(rowCount + 1)}>Increase Row count</Button>
155
+ </Stack>
135
156
  </Stack>
136
- </Stack>
137
157
  ```
138
158
 
139
159
  ## Pagination for Data Table
@@ -149,14 +169,9 @@ function DataTable({ columns }) {
149
169
  <Table columns={columns} data={data} loading={isLoading} />
150
170
  <Stack direction="row" justifyContent="space-between" alignItems="center" mt={2}>
151
171
  <Typography level="body-sm">
152
- Showing {(page - 1) * pageSize + 1}--{Math.min(page * pageSize, totalCount)} of{' '}
153
- {totalCount}
172
+ Showing {(page - 1) * pageSize + 1}--{Math.min(page * pageSize, totalCount)} of {totalCount}
154
173
  </Typography>
155
- <Pagination
156
- rowCount={totalCount}
157
- paginationModel={{ page, pageSize }}
158
- onPageChange={setPage}
159
- />
174
+ <Pagination rowCount={totalCount} paginationModel={{ page, pageSize }} onPageChange={setPage} />
160
175
  </Stack>
161
176
  </Box>
162
177
  );
@@ -176,7 +191,9 @@ function SearchResults({ query }) {
176
191
 
177
192
  return (
178
193
  <Stack spacing={2}>
179
- <Typography level="body-sm">{totalCount} results for "{query}"</Typography>
194
+ <Typography level="body-sm">
195
+ {totalCount} results for "{query}"
196
+ </Typography>
180
197
  <ResultList results={results} />
181
198
  <Pagination
182
199
  rowCount={totalCount}
@@ -200,13 +217,7 @@ function URLPaginatedList() {
200
217
  setSearchParams({ page: String(newPage) });
201
218
  };
202
219
 
203
- return (
204
- <Pagination
205
- rowCount={totalCount}
206
- paginationModel={{ page, pageSize: 25 }}
207
- onPageChange={handlePageChange}
208
- />
209
- );
220
+ return <Pagination rowCount={totalCount} paginationModel={{ page, pageSize: 25 }} onPageChange={handlePageChange} />;
210
221
  }
211
222
  ```
212
223
 
@@ -220,7 +231,7 @@ function URLPaginatedList() {
220
231
  | `defaultPaginationModel` | `{ page: number; pageSize: number }` | `{ page: 1, pageSize: 25 }` | Initial pagination state |
221
232
  | `rowCount` | `number` | (required) | Total number of rows |
222
233
  | `onPageChange` | `(newPage: number) => void` | (required) | Callback when page changes |
223
- | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Pagination control size |
234
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'sm'` | Pagination control size |
224
235
  | `variant` | `'standard' \| 'compact'` | `'standard'` | Pagination display mode |
225
236
 
226
237
  ## Best Practices