@instructure/ui-pagination 11.0.1-snapshot-1 → 11.0.1-snapshot-2
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/CHANGELOG.md +1 -1
- package/package.json +18 -18
- package/src/Pagination/README.md +120 -247
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [11.0.1-snapshot-
|
|
6
|
+
## [11.0.1-snapshot-2](https://github.com/instructure/instructure-ui/compare/v11.0.0...v11.0.1-snapshot-2) (2025-10-10)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-pagination
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-pagination",
|
|
3
|
-
"version": "11.0.1-snapshot-
|
|
3
|
+
"version": "11.0.1-snapshot-2",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "11.0.1-snapshot-
|
|
27
|
-
"@instructure/ui-babel-preset": "11.0.1-snapshot-
|
|
26
|
+
"@instructure/ui-axe-check": "11.0.1-snapshot-2",
|
|
27
|
+
"@instructure/ui-babel-preset": "11.0.1-snapshot-2",
|
|
28
28
|
"@testing-library/jest-dom": "^6.6.3",
|
|
29
29
|
"@testing-library/react": "15.0.7",
|
|
30
30
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -32,21 +32,21 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.27.6",
|
|
35
|
-
"@instructure/emotion": "11.0.1-snapshot-
|
|
36
|
-
"@instructure/shared-types": "11.0.1-snapshot-
|
|
37
|
-
"@instructure/ui-a11y-content": "11.0.1-snapshot-
|
|
38
|
-
"@instructure/ui-a11y-utils": "11.0.1-snapshot-
|
|
39
|
-
"@instructure/ui-buttons": "11.0.1-snapshot-
|
|
40
|
-
"@instructure/ui-dom-utils": "11.0.1-snapshot-
|
|
41
|
-
"@instructure/ui-icons": "11.0.1-snapshot-
|
|
42
|
-
"@instructure/ui-number-input": "11.0.1-snapshot-
|
|
43
|
-
"@instructure/ui-portal": "11.0.1-snapshot-
|
|
44
|
-
"@instructure/ui-react-utils": "11.0.1-snapshot-
|
|
45
|
-
"@instructure/ui-themes": "11.0.1-snapshot-
|
|
46
|
-
"@instructure/ui-tooltip": "11.0.1-snapshot-
|
|
47
|
-
"@instructure/ui-utils": "11.0.1-snapshot-
|
|
48
|
-
"@instructure/ui-view": "11.0.1-snapshot-
|
|
49
|
-
"@instructure/uid": "11.0.1-snapshot-
|
|
35
|
+
"@instructure/emotion": "11.0.1-snapshot-2",
|
|
36
|
+
"@instructure/shared-types": "11.0.1-snapshot-2",
|
|
37
|
+
"@instructure/ui-a11y-content": "11.0.1-snapshot-2",
|
|
38
|
+
"@instructure/ui-a11y-utils": "11.0.1-snapshot-2",
|
|
39
|
+
"@instructure/ui-buttons": "11.0.1-snapshot-2",
|
|
40
|
+
"@instructure/ui-dom-utils": "11.0.1-snapshot-2",
|
|
41
|
+
"@instructure/ui-icons": "11.0.1-snapshot-2",
|
|
42
|
+
"@instructure/ui-number-input": "11.0.1-snapshot-2",
|
|
43
|
+
"@instructure/ui-portal": "11.0.1-snapshot-2",
|
|
44
|
+
"@instructure/ui-react-utils": "11.0.1-snapshot-2",
|
|
45
|
+
"@instructure/ui-themes": "11.0.1-snapshot-2",
|
|
46
|
+
"@instructure/ui-tooltip": "11.0.1-snapshot-2",
|
|
47
|
+
"@instructure/ui-utils": "11.0.1-snapshot-2",
|
|
48
|
+
"@instructure/ui-view": "11.0.1-snapshot-2",
|
|
49
|
+
"@instructure/uid": "11.0.1-snapshot-2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"react": ">=18 <=19"
|
package/src/Pagination/README.md
CHANGED
|
@@ -16,273 +16,146 @@ One of the biggest improvement is that pagination now can handle large page numb
|
|
|
16
16
|
|
|
17
17
|
The pagination component provides props to handle most of the pagination use-cases. These following examples are the same as the "old" examples in behaviour, but with the "new" API
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
render(<Example />)
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
- ```js
|
|
46
|
-
const Example = () => {
|
|
47
|
-
const [currentPage, setCurrentPage] = useState(1)
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<Pagination
|
|
51
|
-
as="nav"
|
|
52
|
-
margin="small"
|
|
53
|
-
variant="compact"
|
|
54
|
-
labelNext="Next Page"
|
|
55
|
-
labelPrev="Previous Page"
|
|
56
|
-
currentPage={currentPage}
|
|
57
|
-
totalPageNumber={9}
|
|
58
|
-
onPageChange={(nextPage) => setCurrentPage(nextPage)}
|
|
59
|
-
/>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
19
|
+
```js
|
|
20
|
+
---
|
|
21
|
+
type: example
|
|
22
|
+
---
|
|
23
|
+
const Example = () => {
|
|
24
|
+
const [currentPage, setCurrentPage] = useState(1)
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Pagination
|
|
28
|
+
as="nav"
|
|
29
|
+
margin="small"
|
|
30
|
+
variant="compact"
|
|
31
|
+
labelNext="Next Page"
|
|
32
|
+
labelPrev="Previous Page"
|
|
33
|
+
currentPage={currentPage}
|
|
34
|
+
totalPageNumber={9}
|
|
35
|
+
onPageChange={(nextPage) => setCurrentPage(nextPage)}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
62
39
|
|
|
63
|
-
|
|
64
|
-
|
|
40
|
+
render(<Example />)
|
|
41
|
+
```
|
|
65
42
|
|
|
66
43
|
You can set any `totalPageNumber`, the component can handle it easily.\
|
|
67
44
|
Furthermore, you can set `siblingCount`, which indicates how many pages are visible on either side of the `currentPage` and the
|
|
68
45
|
`boundaryCount`, which indicates how many pages are visible in the beginning and end.\
|
|
69
46
|
Also, you can set `screenReaderLabelPageButton` to customize what a screenreader will announce when the button receives focus.
|
|
70
47
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
render(<Example />)
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
- ```js
|
|
103
|
-
const Example = () => {
|
|
104
|
-
const [currentPage, setCurrentPage] = useState(1)
|
|
105
|
-
return (
|
|
106
|
-
<Pagination
|
|
107
|
-
as="nav"
|
|
108
|
-
margin="small"
|
|
109
|
-
variant="compact"
|
|
110
|
-
labelNext="Next Page"
|
|
111
|
-
labelPrev="Previous Page"
|
|
112
|
-
currentPage={currentPage}
|
|
113
|
-
totalPageNumber={100000}
|
|
114
|
-
onPageChange={(nextPage) => setCurrentPage(nextPage)}
|
|
115
|
-
siblingCount={3}
|
|
116
|
-
boundaryCount={2}
|
|
117
|
-
screenReaderLabelPageButton={(currentPage, totalPageNumber) =>
|
|
118
|
-
`Page ${currentPage} of ${totalPageNumber}`
|
|
119
|
-
}
|
|
120
|
-
/>
|
|
121
|
-
)
|
|
122
|
-
}
|
|
48
|
+
```js
|
|
49
|
+
---
|
|
50
|
+
type: example
|
|
51
|
+
---
|
|
52
|
+
const Example = () => {
|
|
53
|
+
const [currentPage, setCurrentPage] = useState(1)
|
|
54
|
+
return (
|
|
55
|
+
<Pagination
|
|
56
|
+
as="nav"
|
|
57
|
+
margin="small"
|
|
58
|
+
variant="compact"
|
|
59
|
+
labelNext="Next Page"
|
|
60
|
+
labelPrev="Previous Page"
|
|
61
|
+
currentPage={currentPage}
|
|
62
|
+
totalPageNumber={100000}
|
|
63
|
+
onPageChange={(nextPage) => setCurrentPage(nextPage)}
|
|
64
|
+
siblingCount={3}
|
|
65
|
+
boundaryCount={2}
|
|
66
|
+
screenReaderLabelPageButton={(currentPage, totalPageNumber) =>
|
|
67
|
+
`Page ${currentPage} of ${totalPageNumber}`
|
|
68
|
+
}
|
|
69
|
+
/>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
123
72
|
|
|
124
|
-
|
|
125
|
-
|
|
73
|
+
render(<Example />)
|
|
74
|
+
```
|
|
126
75
|
|
|
127
76
|
You can only display 1000 pages at once.
|
|
128
77
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
render(<Example />)
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
- ```js
|
|
158
|
-
const Example = () => {
|
|
159
|
-
const [currentPage, setCurrentPage] = useState(1)
|
|
160
|
-
return (
|
|
161
|
-
<Pagination
|
|
162
|
-
as="nav"
|
|
163
|
-
margin="small"
|
|
164
|
-
variant="full"
|
|
165
|
-
labelNext="Next Page"
|
|
166
|
-
labelPrev="Previous Page"
|
|
167
|
-
currentPage={currentPage}
|
|
168
|
-
totalPageNumber={100000}
|
|
169
|
-
onPageChange={(nextPage) => setCurrentPage(nextPage)}
|
|
170
|
-
siblingCount={3}
|
|
171
|
-
boundaryCount={2}
|
|
172
|
-
/>
|
|
173
|
-
)
|
|
174
|
-
}
|
|
78
|
+
```js
|
|
79
|
+
---
|
|
80
|
+
type: example
|
|
81
|
+
---
|
|
82
|
+
const Example = () => {
|
|
83
|
+
const [currentPage, setCurrentPage] = useState(1)
|
|
84
|
+
return (
|
|
85
|
+
<Pagination
|
|
86
|
+
as="nav"
|
|
87
|
+
margin="small"
|
|
88
|
+
variant="full"
|
|
89
|
+
labelNext="Next Page"
|
|
90
|
+
labelPrev="Previous Page"
|
|
91
|
+
currentPage={currentPage}
|
|
92
|
+
totalPageNumber={100000}
|
|
93
|
+
onPageChange={(nextPage) => setCurrentPage(nextPage)}
|
|
94
|
+
siblingCount={3}
|
|
95
|
+
boundaryCount={2}
|
|
96
|
+
/>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
175
99
|
|
|
176
|
-
|
|
177
|
-
|
|
100
|
+
render(<Example />)
|
|
101
|
+
```
|
|
178
102
|
|
|
179
103
|
You can override the default page rendering with `renderPageIndicator`.
|
|
180
104
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
render(<Example />)
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
- ```js
|
|
213
|
-
const Example = () => {
|
|
214
|
-
const [currentPage, setCurrentPage] = useState(1)
|
|
215
|
-
|
|
216
|
-
const pageMap = ['A-G', 'H-J', 'K-M', 'N-Q', 'R-Z']
|
|
217
|
-
|
|
218
|
-
return (
|
|
219
|
-
<Pagination
|
|
220
|
-
as="nav"
|
|
221
|
-
margin="small"
|
|
222
|
-
variant="full"
|
|
223
|
-
labelNext="Next Page"
|
|
224
|
-
labelPrev="Previous Page"
|
|
225
|
-
currentPage={currentPage}
|
|
226
|
-
totalPageNumber={5}
|
|
227
|
-
onPageChange={(nextPage) => setCurrentPage(nextPage)}
|
|
228
|
-
siblingCount={5}
|
|
229
|
-
boundaryCount={0}
|
|
230
|
-
renderPageIndicator={(page) => pageMap[page - 1]}
|
|
231
|
-
/>
|
|
232
|
-
)
|
|
233
|
-
}
|
|
105
|
+
```js
|
|
106
|
+
---
|
|
107
|
+
type: example
|
|
108
|
+
---
|
|
109
|
+
const Example = () => {
|
|
110
|
+
const [currentPage, setCurrentPage] = useState(1)
|
|
111
|
+
|
|
112
|
+
const pageMap = ['A-G', 'H-J', 'K-M', 'N-Q', 'R-Z']
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<Pagination
|
|
116
|
+
as="nav"
|
|
117
|
+
margin="small"
|
|
118
|
+
variant="full"
|
|
119
|
+
labelNext="Next Page"
|
|
120
|
+
labelPrev="Previous Page"
|
|
121
|
+
currentPage={currentPage}
|
|
122
|
+
totalPageNumber={5}
|
|
123
|
+
onPageChange={(nextPage) => setCurrentPage(nextPage)}
|
|
124
|
+
siblingCount={5}
|
|
125
|
+
boundaryCount={0}
|
|
126
|
+
renderPageIndicator={(page) => pageMap[page - 1]}
|
|
127
|
+
/>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
234
130
|
|
|
235
|
-
|
|
236
|
-
|
|
131
|
+
render(<Example />)
|
|
132
|
+
```
|
|
237
133
|
|
|
238
134
|
The `variant="input"` prop will render Pagination with a NumberInput and all the arrow buttons.
|
|
239
135
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
render(<Example />)
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
- ```js
|
|
267
|
-
const Example = () => {
|
|
268
|
-
const [currentPage, setCurrentPage] = useState(1)
|
|
269
|
-
|
|
270
|
-
return (
|
|
271
|
-
<Pagination
|
|
272
|
-
as="nav"
|
|
273
|
-
margin="small"
|
|
274
|
-
variant="input"
|
|
275
|
-
labelNext="Next Page"
|
|
276
|
-
labelPrev="Previous Page"
|
|
277
|
-
currentPage={currentPage}
|
|
278
|
-
totalPageNumber={9}
|
|
279
|
-
onPageChange={(nextPage) => setCurrentPage(nextPage)}
|
|
280
|
-
/>
|
|
281
|
-
)
|
|
282
|
-
}
|
|
136
|
+
```js
|
|
137
|
+
---
|
|
138
|
+
type: example
|
|
139
|
+
---
|
|
140
|
+
const Example = () => {
|
|
141
|
+
const [currentPage, setCurrentPage] = useState(1)
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<Pagination
|
|
145
|
+
as="nav"
|
|
146
|
+
margin="small"
|
|
147
|
+
variant="input"
|
|
148
|
+
labelNext="Next Page"
|
|
149
|
+
labelPrev="Previous Page"
|
|
150
|
+
currentPage={currentPage}
|
|
151
|
+
totalPageNumber={9}
|
|
152
|
+
onPageChange={(nextPage) => setCurrentPage(nextPage)}
|
|
153
|
+
/>
|
|
154
|
+
)
|
|
155
|
+
}
|
|
283
156
|
|
|
284
|
-
|
|
285
|
-
|
|
157
|
+
render(<Example />)
|
|
158
|
+
```
|
|
286
159
|
|
|
287
160
|
### Legacy examples
|
|
288
161
|
|