@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 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-1](https://github.com/instructure/instructure-ui/compare/v11.0.0...v11.0.1-snapshot-1) (2025-10-08)
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-1",
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-1",
27
- "@instructure/ui-babel-preset": "11.0.1-snapshot-1",
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-1",
36
- "@instructure/shared-types": "11.0.1-snapshot-1",
37
- "@instructure/ui-a11y-content": "11.0.1-snapshot-1",
38
- "@instructure/ui-a11y-utils": "11.0.1-snapshot-1",
39
- "@instructure/ui-buttons": "11.0.1-snapshot-1",
40
- "@instructure/ui-dom-utils": "11.0.1-snapshot-1",
41
- "@instructure/ui-icons": "11.0.1-snapshot-1",
42
- "@instructure/ui-number-input": "11.0.1-snapshot-1",
43
- "@instructure/ui-portal": "11.0.1-snapshot-1",
44
- "@instructure/ui-react-utils": "11.0.1-snapshot-1",
45
- "@instructure/ui-themes": "11.0.1-snapshot-1",
46
- "@instructure/ui-tooltip": "11.0.1-snapshot-1",
47
- "@instructure/ui-utils": "11.0.1-snapshot-1",
48
- "@instructure/ui-view": "11.0.1-snapshot-1",
49
- "@instructure/uid": "11.0.1-snapshot-1"
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"
@@ -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
- - ```js
20
- class Example extends React.Component {
21
- constructor(props) {
22
- super(props)
23
- this.state = { currentPage: 1 }
24
- }
25
-
26
- render() {
27
- return (
28
- <Pagination
29
- as="nav"
30
- margin="small"
31
- variant="compact"
32
- labelNext="Next Page"
33
- labelPrev="Previous Page"
34
- currentPage={this.state.currentPage}
35
- totalPageNumber={9}
36
- onPageChange={(nextPage) => this.setState({ currentPage: nextPage })}
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
- render(<Example />)
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
- - ```js
72
- class Example extends React.Component {
73
- constructor(props) {
74
- super(props)
75
- this.state = { currentPage: 1 }
76
- }
77
-
78
- render() {
79
- return (
80
- <Pagination
81
- as="nav"
82
- margin="small"
83
- variant="compact"
84
- labelNext="Next Page"
85
- labelPrev="Previous Page"
86
- currentPage={this.state.currentPage}
87
- totalPageNumber={100000}
88
- onPageChange={(nextPage) => this.setState({ currentPage: nextPage })}
89
- siblingCount={3}
90
- boundaryCount={2}
91
- screenReaderLabelPageButton={(currentPage, totalPageNumber) =>
92
- `Page ${currentPage} of ${totalPageNumber}`
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
- render(<Example />)
125
- ```
73
+ render(<Example />)
74
+ ```
126
75
 
127
76
  You can only display 1000 pages at once.
128
77
 
129
- - ```js
130
- class Example extends React.Component {
131
- constructor(props) {
132
- super(props)
133
- this.state = { currentPage: 1 }
134
- }
135
-
136
- render() {
137
- return (
138
- <Pagination
139
- as="nav"
140
- margin="small"
141
- variant="full"
142
- labelNext="Next Page"
143
- labelPrev="Previous Page"
144
- currentPage={this.state.currentPage}
145
- totalPageNumber={100000}
146
- onPageChange={(nextPage) => this.setState({ currentPage: nextPage })}
147
- siblingCount={3}
148
- boundaryCount={2}
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
- render(<Example />)
177
- ```
100
+ render(<Example />)
101
+ ```
178
102
 
179
103
  You can override the default page rendering with `renderPageIndicator`.
180
104
 
181
- - ```js
182
- class Example extends React.Component {
183
- constructor(props) {
184
- super(props)
185
- this.state = { currentPage: 1 }
186
- }
187
-
188
- pageMap = ['A-G', 'H-J', 'K-M', 'N-Q', 'R-Z']
189
-
190
- render() {
191
- return (
192
- <Pagination
193
- as="nav"
194
- margin="small"
195
- variant="full"
196
- labelNext="Next Page"
197
- labelPrev="Previous Page"
198
- currentPage={this.state.currentPage}
199
- totalPageNumber={5}
200
- onPageChange={(nextPage) => this.setState({ currentPage: nextPage })}
201
- siblingCount={5}
202
- boundaryCount={0}
203
- renderPageIndicator={(page) => this.pageMap[page - 1]}
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
- render(<Example />)
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
- - ```js
241
- class Example extends React.Component {
242
- constructor(props) {
243
- super(props)
244
- this.state = { currentPage: 1 }
245
- }
246
-
247
- render() {
248
- return (
249
- <Pagination
250
- as="nav"
251
- margin="small"
252
- variant="input"
253
- labelNext="Next Page"
254
- labelPrev="Previous Page"
255
- currentPage={this.state.currentPage}
256
- totalPageNumber={9}
257
- onPageChange={(nextPage) => this.setState({ currentPage: nextPage })}
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
- render(<Example />)
285
- ```
157
+ render(<Example />)
158
+ ```
286
159
 
287
160
  ### Legacy examples
288
161