@app-studio/web 0.9.41 → 0.9.44
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/dist/bot/Bot.d.ts +15 -0
- package/dist/bot/Cache.d.ts +13 -0
- package/dist/bot/Config.d.ts +13 -0
- package/dist/bot/ContentFetcher.d.ts +9 -0
- package/dist/bot/DocuCode.d.ts +19 -0
- package/dist/bot/FileHandler.d.ts +39 -0
- package/dist/bot/ai/AnthropicConnector.d.ts +6 -0
- package/dist/bot/ai/GeminiConnector.d.ts +7 -0
- package/dist/bot/ai/GroqConnector.d.ts +7 -0
- package/dist/bot/ai/HuggingFaceConnector.d.ts +6 -0
- package/dist/bot/ai/OpenAIConnector.d.ts +11 -0
- package/dist/bot/ai/ReplicateConnector.d.ts +7 -0
- package/dist/bot/ai/SambaNovaConnector.d.ts +6 -0
- package/dist/bot/ai/ai.config.d.ts +12 -0
- package/dist/bot/ai/ai.service.d.ts +36 -0
- package/dist/bot/data.d.ts +19 -0
- package/dist/bot/extractors.d.ts +8 -0
- package/dist/bot/index.d.ts +1 -0
- package/dist/bot/prompt/1-project.d.ts +1 -0
- package/dist/bot/prompt/2-response.d.ts +1 -0
- package/dist/bot/prompt/3-comment.d.ts +1 -0
- package/dist/components/Title/Title/SlideEffect.d.ts +14 -0
- package/dist/components/Title/Title/Title.props.d.ts +20 -0
- package/dist/components/Title/Title/Title.state.d.ts +4 -0
- package/dist/web.cjs.development.js +265 -78
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +265 -78
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +265 -78
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/docs/components/Accordion.mdx +74 -121
- package/docs/components/Alert.mdx +19 -70
- package/docs/components/AspectRatio.mdx +13 -11
- package/docs/components/AudioInput.mdx +43 -0
- package/docs/components/Avatar.mdx +18 -43
- package/docs/components/Background.mdx +100 -492
- package/docs/components/Badge.mdx +45 -130
- package/docs/components/Button.mdx +76 -128
- package/docs/components/Calendar.mdx +7 -7
- package/docs/components/Card.mdx +247 -290
- package/docs/components/Carousel.mdx +94 -321
- package/docs/components/Chart.mdx +171 -26
- package/docs/components/ChatInput.mdx +327 -275
- package/docs/components/Checkbox.mdx +3 -5
- package/docs/components/ColorInput.mdx +6 -6
- package/docs/components/ColorPicker.mdx +452 -0
- package/docs/components/ComboBox.mdx +13 -13
- package/docs/components/Command.mdx +140 -188
- package/docs/components/ContextMenu.mdx +47 -171
- package/docs/components/CookieConsent.mdx +53 -0
- package/docs/components/CountryPicker.mdx +8 -8
- package/docs/components/DatePicker.mdx +3 -3
- package/docs/components/DragAndDrop.mdx +279 -463
- package/docs/components/Drawer.mdx +392 -231
- package/docs/components/DropdownMenu.mdx +37 -155
- package/docs/components/EmojiPicker.mdx +84 -0
- package/docs/components/File.mdx +130 -4
- package/docs/components/Formik.mdx +39 -39
- package/docs/components/Gradient.mdx +359 -182
- package/docs/components/Horizontal.mdx +1 -2
- package/docs/components/HoverCard.mdx +57 -125
- package/docs/components/KanbanBoard.mdx +9 -9
- package/docs/components/Link.mdx +22 -30
- package/docs/components/Loader.mdx +230 -413
- package/docs/components/Menubar.mdx +73 -69
- package/docs/components/Message.mdx +210 -525
- package/docs/components/Modal.mdx +351 -475
- package/docs/components/NavigationMenu.mdx +8 -8
- package/docs/components/OTPInput.mdx +194 -0
- package/docs/components/Pagination.mdx +451 -107
- package/docs/components/Password.mdx +8 -8
- package/docs/components/ProgressBar.mdx +460 -0
- package/docs/components/Resizable.mdx +103 -102
- package/docs/components/Select.mdx +5 -5
- package/docs/components/Separator.mdx +11 -98
- package/docs/components/ShareButton.mdx +29 -0
- package/docs/components/Sidebar.mdx +70 -131
- package/docs/components/Slider.mdx +99 -185
- package/docs/components/StatusIndicator.mdx +373 -0
- package/docs/components/Switch.mdx +3 -3
- package/docs/components/Table.mdx +25 -105
- package/docs/components/Tabs.mdx +40 -143
- package/docs/components/TagInput.mdx +17 -17
- package/docs/components/Text.mdx +3 -3
- package/docs/components/TextArea.mdx +6 -6
- package/docs/components/TextField.mdx +12 -12
- package/docs/components/Title.mdx +267 -525
- package/docs/components/Toast.mdx +65 -142
- package/docs/components/Toggle.mdx +37 -49
- package/docs/components/ToggleGroup.mdx +36 -57
- package/docs/components/Tooltip.mdx +501 -138
- package/docs/components/Uploader.mdx +205 -351
- package/package.json +1 -1
- package/dist/components/AuthGuard/AuthGuard.d.ts +0 -35
- package/dist/components/AuthGuard/index.d.ts +0 -1
- package/docs/adk-components.md +0 -319
- package/docs/adk-quick-start.md +0 -268
|
@@ -1,150 +1,494 @@
|
|
|
1
1
|
# Pagination
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A pagination component for navigating through pages with customizable appearance, page size selection, and navigation controls.
|
|
4
4
|
|
|
5
5
|
### **Import**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
```tsx
|
|
7
|
+
import { Pagination } from '@app-studio/web';
|
|
8
|
+
```
|
|
9
9
|
|
|
10
10
|
### **Default**
|
|
11
11
|
```tsx
|
|
12
12
|
import React, { useState } from 'react';
|
|
13
|
-
import { Pagination } from '
|
|
13
|
+
import { Pagination } from '@app-studio/web';
|
|
14
14
|
|
|
15
15
|
export const DefaultPagination = () => {
|
|
16
16
|
const [currentPage, setCurrentPage] = useState(1);
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Pagination
|
|
20
|
+
currentPage={currentPage}
|
|
21
|
+
totalPages={10}
|
|
22
|
+
onPageChange={setCurrentPage}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### **currentPage**
|
|
29
|
+
The current page number (1-based).
|
|
30
|
+
|
|
31
|
+
- **Type:** `number`
|
|
32
|
+
- **Required:** `true`
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import React, { useState } from 'react';
|
|
36
|
+
import { Pagination } from '@app-studio/web';
|
|
37
|
+
import { Text, Vertical } from 'app-studio';
|
|
38
|
+
|
|
39
|
+
export const ControlledPagination = () => {
|
|
40
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Vertical gap={10}>
|
|
44
|
+
<Pagination
|
|
45
|
+
currentPage={currentPage}
|
|
46
|
+
totalPages={10}
|
|
47
|
+
onPageChange={setCurrentPage}
|
|
48
|
+
/>
|
|
49
|
+
<Text>Current Page: {currentPage}</Text>
|
|
50
|
+
</Vertical>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### **totalPages**
|
|
56
|
+
The total number of pages.
|
|
18
57
|
|
|
58
|
+
- **Type:** `number`
|
|
59
|
+
- **Required:** `true`
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import React, { useState } from 'react';
|
|
63
|
+
import { Pagination } from '@app-studio/web';
|
|
64
|
+
|
|
65
|
+
export const TotalPagesPagination = () => {
|
|
66
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
67
|
+
|
|
19
68
|
return (
|
|
20
|
-
<Pagination
|
|
69
|
+
<Pagination
|
|
21
70
|
currentPage={currentPage}
|
|
22
|
-
totalPages={
|
|
71
|
+
totalPages={50}
|
|
23
72
|
onPageChange={setCurrentPage}
|
|
24
73
|
/>
|
|
25
74
|
);
|
|
26
75
|
};
|
|
27
76
|
```
|
|
28
77
|
|
|
29
|
-
### **
|
|
30
|
-
|
|
78
|
+
### **onPageChange**
|
|
79
|
+
Callback function when page changes.
|
|
80
|
+
|
|
81
|
+
- **Type:** `(page: number) => void`
|
|
82
|
+
- **Required:** `true`
|
|
31
83
|
|
|
32
84
|
```tsx
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
totalPages={totalPages}
|
|
36
|
-
onPageChange={setCurrentPage}
|
|
37
|
-
variant="default"
|
|
38
|
-
/>
|
|
85
|
+
import React, { useState } from 'react';
|
|
86
|
+
import { Pagination } from '@app-studio/web';
|
|
39
87
|
|
|
40
|
-
|
|
41
|
-
currentPage=
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
88
|
+
export const PageChangePagination = () => {
|
|
89
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<Pagination
|
|
93
|
+
currentPage={currentPage}
|
|
94
|
+
totalPages={10}
|
|
95
|
+
onPageChange={(page) => {
|
|
96
|
+
console.log('Navigating to page:', page);
|
|
97
|
+
setCurrentPage(page);
|
|
98
|
+
}}
|
|
99
|
+
/>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### **pageSize**
|
|
105
|
+
The number of items per page.
|
|
106
|
+
|
|
107
|
+
- **Type:** `number`
|
|
46
108
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
109
|
+
```tsx
|
|
110
|
+
import React, { useState } from 'react';
|
|
111
|
+
import { Pagination } from '@app-studio/web';
|
|
112
|
+
|
|
113
|
+
export const PageSizePagination = () => {
|
|
114
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
115
|
+
const [pageSize, setPageSize] = useState(10);
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<Pagination
|
|
119
|
+
currentPage={currentPage}
|
|
120
|
+
totalPages={10}
|
|
121
|
+
pageSize={pageSize}
|
|
122
|
+
onPageChange={setCurrentPage}
|
|
123
|
+
onPageSizeChange={setPageSize}
|
|
124
|
+
showPageSizeSelector
|
|
125
|
+
/>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
53
128
|
```
|
|
54
129
|
|
|
55
|
-
### **
|
|
56
|
-
|
|
130
|
+
### **pageSizeOptions**
|
|
131
|
+
Available page size options.
|
|
132
|
+
|
|
133
|
+
- **Type:** `PageSizeOption[]`
|
|
57
134
|
|
|
58
135
|
```tsx
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
totalPages={totalPages}
|
|
62
|
-
onPageChange={setCurrentPage}
|
|
63
|
-
size="sm"
|
|
64
|
-
/>
|
|
136
|
+
import React, { useState } from 'react';
|
|
137
|
+
import { Pagination } from '@app-studio/web';
|
|
65
138
|
|
|
66
|
-
|
|
67
|
-
currentPage=
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
139
|
+
export const PageSizeOptionsPagination = () => {
|
|
140
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
141
|
+
const [pageSize, setPageSize] = useState(10);
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<Pagination
|
|
145
|
+
currentPage={currentPage}
|
|
146
|
+
totalPages={20}
|
|
147
|
+
pageSize={pageSize}
|
|
148
|
+
pageSizeOptions={[
|
|
149
|
+
{ value: 5, label: '5 per page' },
|
|
150
|
+
{ value: 10, label: '10 per page' },
|
|
151
|
+
{ value: 25, label: '25 per page' },
|
|
152
|
+
{ value: 50, label: '50 per page' },
|
|
153
|
+
]}
|
|
154
|
+
onPageChange={setCurrentPage}
|
|
155
|
+
onPageSizeChange={setPageSize}
|
|
156
|
+
showPageSizeSelector
|
|
157
|
+
/>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### **showPageSizeSelector**
|
|
163
|
+
Whether to show the page size selector.
|
|
72
164
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
165
|
+
- **Type:** `boolean`
|
|
166
|
+
- **Default:** `false`
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
import React, { useState } from 'react';
|
|
170
|
+
import { Pagination } from '@app-studio/web';
|
|
171
|
+
|
|
172
|
+
export const WithPageSizeSelector = () => {
|
|
173
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
174
|
+
const [pageSize, setPageSize] = useState(10);
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<Pagination
|
|
178
|
+
currentPage={currentPage}
|
|
179
|
+
totalPages={10}
|
|
180
|
+
pageSize={pageSize}
|
|
181
|
+
showPageSizeSelector
|
|
182
|
+
onPageChange={setCurrentPage}
|
|
183
|
+
onPageSizeChange={setPageSize}
|
|
184
|
+
/>
|
|
185
|
+
);
|
|
186
|
+
};
|
|
79
187
|
```
|
|
80
188
|
|
|
81
|
-
### **
|
|
82
|
-
|
|
189
|
+
### **showPageInfo**
|
|
190
|
+
Whether to show the page information text.
|
|
191
|
+
|
|
192
|
+
- **Type:** `boolean`
|
|
193
|
+
- **Default:** `true`
|
|
83
194
|
|
|
84
195
|
```tsx
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
totalPages={totalPages}
|
|
88
|
-
onPageChange={setCurrentPage}
|
|
89
|
-
shape="rounded"
|
|
90
|
-
/>
|
|
196
|
+
import React, { useState } from 'react';
|
|
197
|
+
import { Pagination } from '@app-studio/web';
|
|
91
198
|
|
|
92
|
-
|
|
93
|
-
currentPage=
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
199
|
+
export const WithPageInfo = () => {
|
|
200
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
201
|
+
|
|
202
|
+
return (
|
|
203
|
+
<Pagination
|
|
204
|
+
currentPage={currentPage}
|
|
205
|
+
totalPages={10}
|
|
206
|
+
showPageInfo
|
|
207
|
+
onPageChange={setCurrentPage}
|
|
208
|
+
/>
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### **maxPageButtons**
|
|
214
|
+
The maximum number of page buttons to show.
|
|
215
|
+
|
|
216
|
+
- **Type:** `number`
|
|
217
|
+
- **Default:** `7`
|
|
218
|
+
|
|
219
|
+
```tsx
|
|
220
|
+
import React, { useState } from 'react';
|
|
221
|
+
import { Pagination } from '@app-studio/web';
|
|
222
|
+
import { Vertical } from 'app-studio';
|
|
98
223
|
|
|
99
|
-
|
|
100
|
-
currentPage=
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
224
|
+
export const MaxPageButtons = () => {
|
|
225
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
226
|
+
|
|
227
|
+
return (
|
|
228
|
+
<Vertical gap={20}>
|
|
229
|
+
<Pagination
|
|
230
|
+
currentPage={currentPage}
|
|
231
|
+
totalPages={20}
|
|
232
|
+
maxPageButtons={5}
|
|
233
|
+
onPageChange={setCurrentPage}
|
|
234
|
+
/>
|
|
235
|
+
<Pagination
|
|
236
|
+
currentPage={currentPage}
|
|
237
|
+
totalPages={20}
|
|
238
|
+
maxPageButtons={10}
|
|
239
|
+
onPageChange={setCurrentPage}
|
|
240
|
+
/>
|
|
241
|
+
</Vertical>
|
|
242
|
+
);
|
|
243
|
+
};
|
|
105
244
|
```
|
|
106
245
|
|
|
107
|
-
### **
|
|
108
|
-
|
|
246
|
+
### **showFirstLastButtons**
|
|
247
|
+
Whether to show the first and last page buttons.
|
|
248
|
+
|
|
249
|
+
- **Type:** `boolean`
|
|
250
|
+
- **Default:** `true`
|
|
109
251
|
|
|
110
252
|
```tsx
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
253
|
+
import React, { useState } from 'react';
|
|
254
|
+
import { Pagination } from '@app-studio/web';
|
|
255
|
+
|
|
256
|
+
export const FirstLastButtons = () => {
|
|
257
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<Pagination
|
|
261
|
+
currentPage={currentPage}
|
|
262
|
+
totalPages={10}
|
|
263
|
+
showFirstLastButtons
|
|
264
|
+
onPageChange={setCurrentPage}
|
|
265
|
+
/>
|
|
266
|
+
);
|
|
267
|
+
};
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### **size**
|
|
271
|
+
The size of the pagination component.
|
|
272
|
+
|
|
273
|
+
- **Type:** `Size`
|
|
274
|
+
- **Default:** `'md'`
|
|
275
|
+
- **Possible Values:** `'xs' | 'sm' | 'md' | 'lg' | 'xl'`
|
|
276
|
+
|
|
277
|
+
```tsx
|
|
278
|
+
import React, { useState } from 'react';
|
|
279
|
+
import { Pagination } from '@app-studio/web';
|
|
280
|
+
import { Vertical } from 'app-studio';
|
|
281
|
+
|
|
282
|
+
export const SizedPaginations = () => {
|
|
283
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
284
|
+
|
|
285
|
+
return (
|
|
286
|
+
<Vertical gap={20}>
|
|
287
|
+
{['sm', 'md', 'lg'].map((size) => (
|
|
288
|
+
<Pagination
|
|
289
|
+
key={size}
|
|
290
|
+
currentPage={currentPage}
|
|
291
|
+
totalPages={10}
|
|
292
|
+
size={size as any}
|
|
293
|
+
onPageChange={setCurrentPage}
|
|
294
|
+
/>
|
|
295
|
+
))}
|
|
296
|
+
</Vertical>
|
|
297
|
+
);
|
|
298
|
+
};
|
|
122
299
|
```
|
|
123
300
|
|
|
124
|
-
### **
|
|
125
|
-
The
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
301
|
+
### **variant**
|
|
302
|
+
The visual style variant of the pagination component.
|
|
303
|
+
|
|
304
|
+
- **Type:** `Variant`
|
|
305
|
+
- **Default:** `'default'`
|
|
306
|
+
- **Possible Values:** `'default' | 'outlined' | 'filled'`
|
|
307
|
+
|
|
308
|
+
```tsx
|
|
309
|
+
import React, { useState } from 'react';
|
|
310
|
+
import { Pagination } from '@app-studio/web';
|
|
311
|
+
import { Vertical } from 'app-studio';
|
|
312
|
+
|
|
313
|
+
export const VariantPaginations = () => {
|
|
314
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
315
|
+
|
|
316
|
+
return (
|
|
317
|
+
<Vertical gap={20}>
|
|
318
|
+
{['default', 'outlined', 'filled'].map((variant) => (
|
|
319
|
+
<Pagination
|
|
320
|
+
key={variant}
|
|
321
|
+
currentPage={currentPage}
|
|
322
|
+
totalPages={10}
|
|
323
|
+
variant={variant as any}
|
|
324
|
+
onPageChange={setCurrentPage}
|
|
325
|
+
/>
|
|
326
|
+
))}
|
|
327
|
+
</Vertical>
|
|
328
|
+
);
|
|
329
|
+
};
|
|
150
330
|
```
|
|
331
|
+
|
|
332
|
+
### **shape**
|
|
333
|
+
The shape of the pagination buttons.
|
|
334
|
+
|
|
335
|
+
- **Type:** `Shape`
|
|
336
|
+
- **Default:** `'rounded'`
|
|
337
|
+
- **Possible Values:** `'sharp' | 'rounded' | 'pillShaped'`
|
|
338
|
+
|
|
339
|
+
```tsx
|
|
340
|
+
import React, { useState } from 'react';
|
|
341
|
+
import { Pagination } from '@app-studio/web';
|
|
342
|
+
import { Vertical } from 'app-studio';
|
|
343
|
+
|
|
344
|
+
export const ShapedPaginations = () => {
|
|
345
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
346
|
+
|
|
347
|
+
return (
|
|
348
|
+
<Vertical gap={20}>
|
|
349
|
+
{['sharp', 'rounded', 'pillShaped'].map((shape) => (
|
|
350
|
+
<Pagination
|
|
351
|
+
key={shape}
|
|
352
|
+
currentPage={currentPage}
|
|
353
|
+
totalPages={10}
|
|
354
|
+
shape={shape as any}
|
|
355
|
+
onPageChange={setCurrentPage}
|
|
356
|
+
/>
|
|
357
|
+
))}
|
|
358
|
+
</Vertical>
|
|
359
|
+
);
|
|
360
|
+
};
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### **views**
|
|
364
|
+
Custom styles for different parts of the pagination component.
|
|
365
|
+
|
|
366
|
+
- **Type:** `PaginationStyles`
|
|
367
|
+
|
|
368
|
+
```tsx
|
|
369
|
+
import React, { useState } from 'react';
|
|
370
|
+
import { Pagination } from '@app-studio/web';
|
|
371
|
+
|
|
372
|
+
export const StyledPagination = () => {
|
|
373
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
374
|
+
|
|
375
|
+
return (
|
|
376
|
+
<Pagination
|
|
377
|
+
currentPage={currentPage}
|
|
378
|
+
totalPages={10}
|
|
379
|
+
onPageChange={setCurrentPage}
|
|
380
|
+
views={{
|
|
381
|
+
container: {
|
|
382
|
+
gap: 8,
|
|
383
|
+
},
|
|
384
|
+
button: {
|
|
385
|
+
borderColor: '#3b82f6',
|
|
386
|
+
},
|
|
387
|
+
activeButton: {
|
|
388
|
+
backgroundColor: '#3b82f6',
|
|
389
|
+
color: '#ffffff',
|
|
390
|
+
}
|
|
391
|
+
}}
|
|
392
|
+
/>
|
|
393
|
+
);
|
|
394
|
+
};
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### **Complete Example**
|
|
398
|
+
A fully featured pagination with all options.
|
|
399
|
+
|
|
400
|
+
```tsx
|
|
401
|
+
import React, { useState } from 'react';
|
|
402
|
+
import { Pagination } from '@app-studio/web';
|
|
403
|
+
import { Vertical, Text } from 'app-studio';
|
|
404
|
+
|
|
405
|
+
export const CompletePagination = () => {
|
|
406
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
407
|
+
const [pageSize, setPageSize] = useState(10);
|
|
408
|
+
|
|
409
|
+
const totalItems = 250;
|
|
410
|
+
const totalPages = Math.ceil(totalItems / pageSize);
|
|
411
|
+
|
|
412
|
+
return (
|
|
413
|
+
<Vertical gap={20}>
|
|
414
|
+
<Text>
|
|
415
|
+
Showing {(currentPage - 1) * pageSize + 1} to{' '}
|
|
416
|
+
{Math.min(currentPage * pageSize, totalItems)} of {totalItems} items
|
|
417
|
+
</Text>
|
|
418
|
+
|
|
419
|
+
<Pagination
|
|
420
|
+
currentPage={currentPage}
|
|
421
|
+
totalPages={totalPages}
|
|
422
|
+
pageSize={pageSize}
|
|
423
|
+
pageSizeOptions={[
|
|
424
|
+
{ value: 10, label: '10' },
|
|
425
|
+
{ value: 25, label: '25' },
|
|
426
|
+
{ value: 50, label: '50' },
|
|
427
|
+
{ value: 100, label: '100' },
|
|
428
|
+
]}
|
|
429
|
+
onPageChange={setCurrentPage}
|
|
430
|
+
onPageSizeChange={(newSize) => {
|
|
431
|
+
setPageSize(newSize);
|
|
432
|
+
setCurrentPage(1); // Reset to first page
|
|
433
|
+
}}
|
|
434
|
+
showPageSizeSelector
|
|
435
|
+
showPageInfo
|
|
436
|
+
showFirstLastButtons
|
|
437
|
+
maxPageButtons={7}
|
|
438
|
+
size="md"
|
|
439
|
+
variant="outlined"
|
|
440
|
+
shape="rounded"
|
|
441
|
+
/>
|
|
442
|
+
</Vertical>
|
|
443
|
+
);
|
|
444
|
+
};
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### **Table Pagination**
|
|
448
|
+
Common use case with a data table.
|
|
449
|
+
|
|
450
|
+
```tsx
|
|
451
|
+
import React, { useState } from 'react';
|
|
452
|
+
import { Pagination } from '@app-studio/web';
|
|
453
|
+
import { Vertical, Text } from 'app-studio';
|
|
454
|
+
|
|
455
|
+
export const TablePagination = () => {
|
|
456
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
457
|
+
const [pageSize, setPageSize] = useState(10);
|
|
458
|
+
|
|
459
|
+
// Simulated data
|
|
460
|
+
const allData = Array.from({ length: 100 }, (_, i) => ({
|
|
461
|
+
id: i + 1,
|
|
462
|
+
name: `Item ${i + 1}`,
|
|
463
|
+
}));
|
|
464
|
+
|
|
465
|
+
const totalPages = Math.ceil(allData.length / pageSize);
|
|
466
|
+
const startIndex = (currentPage - 1) * pageSize;
|
|
467
|
+
const currentData = allData.slice(startIndex, startIndex + pageSize);
|
|
468
|
+
|
|
469
|
+
return (
|
|
470
|
+
<Vertical gap={20}>
|
|
471
|
+
{/* Your table component here */}
|
|
472
|
+
<Vertical gap={5}>
|
|
473
|
+
{currentData.map((item) => (
|
|
474
|
+
<Text key={item.id}>{item.name}</Text>
|
|
475
|
+
))}
|
|
476
|
+
</Vertical>
|
|
477
|
+
|
|
478
|
+
<Pagination
|
|
479
|
+
currentPage={currentPage}
|
|
480
|
+
totalPages={totalPages}
|
|
481
|
+
pageSize={pageSize}
|
|
482
|
+
onPageChange={setCurrentPage}
|
|
483
|
+
onPageSizeChange={(newSize) => {
|
|
484
|
+
setPageSize(newSize);
|
|
485
|
+
setCurrentPage(1);
|
|
486
|
+
}}
|
|
487
|
+
showPageSizeSelector
|
|
488
|
+
showPageInfo
|
|
489
|
+
/>
|
|
490
|
+
</Vertical>
|
|
491
|
+
);
|
|
492
|
+
};
|
|
493
|
+
```
|
|
494
|
+
|
|
@@ -38,8 +38,8 @@ It has type equals to “password” and isClearable set to false. It has all th
|
|
|
38
38
|
“**_visibleIcon_**” and “**_hiddenIcon_**” are icons indicating whether the password is visible or hidden.
|
|
39
39
|
|
|
40
40
|
```tsx
|
|
41
|
-
import { OpenEyeIcon } from
|
|
42
|
-
import { CloseEyeIcon } from
|
|
41
|
+
import { OpenEyeIcon } from '@app-studio/web';
|
|
42
|
+
import { CloseEyeIcon } from '@app-studio/web';
|
|
43
43
|
|
|
44
44
|
<Password
|
|
45
45
|
visibleIcon={<OpenEyeIcon size={14} />}
|
|
@@ -53,9 +53,9 @@ import { CloseEyeIcon } from "../../Icon/CloseEye";
|
|
|
53
53
|
|
|
54
54
|
```tsx
|
|
55
55
|
import { Vertical } from "app-studio";
|
|
56
|
-
import { Button } from
|
|
57
|
-
import { OpenEyeIcon } from
|
|
58
|
-
import { CloseEyeIcon } from
|
|
56
|
+
import { Button } from '@app-studio/web';
|
|
57
|
+
import { OpenEyeIcon } from '@app-studio/web';
|
|
58
|
+
import { CloseEyeIcon } from '@app-studio/web';
|
|
59
59
|
|
|
60
60
|
<Password
|
|
61
61
|
placeholder="Password"
|
|
@@ -72,9 +72,9 @@ import { CloseEyeIcon } from "../../Icon/CloseEye";
|
|
|
72
72
|
|
|
73
73
|
```tsx
|
|
74
74
|
import { Vertical } from "app-studio";
|
|
75
|
-
import { Button } from
|
|
76
|
-
import { OpenEyeIcon } from
|
|
77
|
-
import { CloseEyeIcon } from
|
|
75
|
+
import { Button } from '@app-studio/web';
|
|
76
|
+
import { OpenEyeIcon } from '@app-studio/web';
|
|
77
|
+
import { CloseEyeIcon } from '@app-studio/web';
|
|
78
78
|
|
|
79
79
|
<Password
|
|
80
80
|
placeholder="Password"
|