@instructure/ui-pagination 10.24.3-snapshot-11 → 10.24.3-snapshot-12

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,9 +3,12 @@
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
- ## [10.24.3-snapshot-11](https://github.com/instructure/instructure-ui/compare/v10.24.2...v10.24.3-snapshot-11) (2025-09-04)
6
+ ## [10.24.3-snapshot-12](https://github.com/instructure/instructure-ui/compare/v10.24.2...v10.24.3-snapshot-12) (2025-09-04)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-pagination
8
+
9
+ ### Features
10
+
11
+ * **ui-pagination:** add onMouseEnter to Pagination ([327fe69](https://github.com/instructure/instructure-ui/commit/327fe69f15ac34e2efe5bb6d0580d8e07bcd6147))
9
12
 
10
13
 
11
14
 
@@ -107,6 +107,7 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
107
107
  pages.push(_jsx(Pagination.Page, {
108
108
  ref: e => i === currentPage ? this.currentPageRef = e : null,
109
109
  onClick: () => this.handleNavigation(i, currentPage),
110
+ onMouseEnter: () => this.handleOnMouseEnter(i),
110
111
  current: i === currentPage,
111
112
  ...(this.props.screenReaderLabelPageButton ? {
112
113
  screenReaderLabel: this.props.screenReaderLabelPageButton(i, this.props.totalPageNumber)
@@ -209,6 +210,11 @@ let Pagination = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
209
210
  buttonRef: handleButtonRef
210
211
  }) : null;
211
212
  };
213
+ this.handleOnMouseEnter = page => {
214
+ if (typeof this.props.onMouseEnter === 'function') {
215
+ this.props.onMouseEnter(page);
216
+ }
217
+ };
212
218
  this._labelId = props.deterministicId();
213
219
  }
214
220
  get _root() {
@@ -49,8 +49,9 @@ const propTypes = {
49
49
  siblingCount: PropTypes.number,
50
50
  boundaryCount: PropTypes.number,
51
51
  onPageChange: PropTypes.func,
52
+ onMouseEnter: PropTypes.func,
52
53
  renderPageIndicator: PropTypes.func,
53
54
  ellipsis: PropTypes.node
54
55
  };
55
- const allowedProps = ['children', 'disabled', 'withFirstAndLastButton', 'showDisabledButtons', 'label', 'labelNext', 'labelPrev', 'labelFirst', 'labelLast', 'labelNumberInput', 'screenReaderLabelNumberInput', 'screenReaderLabelPageButton', 'variant', 'margin', 'as', 'elementRef', 'inputRef', 'shouldHandleFocus', 'totalPageNumber', 'currentPage', 'onPageChange', 'siblingCount', 'boundaryCount', 'renderPageIndicator', 'ellipsis'];
56
+ const allowedProps = ['children', 'disabled', 'withFirstAndLastButton', 'showDisabledButtons', 'label', 'labelNext', 'labelPrev', 'labelFirst', 'labelLast', 'labelNumberInput', 'screenReaderLabelNumberInput', 'screenReaderLabelPageButton', 'variant', 'margin', 'as', 'elementRef', 'inputRef', 'shouldHandleFocus', 'totalPageNumber', 'currentPage', 'onPageChange', 'siblingCount', 'boundaryCount', 'renderPageIndicator', 'ellipsis', 'onMouseEnter'];
56
57
  export { propTypes, allowedProps };
@@ -122,6 +122,7 @@ let Pagination = exports.Pagination = (_dec = (0, _withDeterministicId.withDeter
122
122
  pages.push((0, _jsxRuntime.jsx)(Pagination.Page, {
123
123
  ref: e => i === currentPage ? this.currentPageRef = e : null,
124
124
  onClick: () => this.handleNavigation(i, currentPage),
125
+ onMouseEnter: () => this.handleOnMouseEnter(i),
125
126
  current: i === currentPage,
126
127
  ...(this.props.screenReaderLabelPageButton ? {
127
128
  screenReaderLabel: this.props.screenReaderLabelPageButton(i, this.props.totalPageNumber)
@@ -224,6 +225,11 @@ let Pagination = exports.Pagination = (_dec = (0, _withDeterministicId.withDeter
224
225
  buttonRef: handleButtonRef
225
226
  }) : null;
226
227
  };
228
+ this.handleOnMouseEnter = page => {
229
+ if (typeof this.props.onMouseEnter === 'function') {
230
+ this.props.onMouseEnter(page);
231
+ }
232
+ };
227
233
  this._labelId = props.deterministicId();
228
234
  }
229
235
  get _root() {
@@ -56,7 +56,8 @@ const propTypes = exports.propTypes = {
56
56
  siblingCount: _propTypes.default.number,
57
57
  boundaryCount: _propTypes.default.number,
58
58
  onPageChange: _propTypes.default.func,
59
+ onMouseEnter: _propTypes.default.func,
59
60
  renderPageIndicator: _propTypes.default.func,
60
61
  ellipsis: _propTypes.default.node
61
62
  };
62
- const allowedProps = exports.allowedProps = ['children', 'disabled', 'withFirstAndLastButton', 'showDisabledButtons', 'label', 'labelNext', 'labelPrev', 'labelFirst', 'labelLast', 'labelNumberInput', 'screenReaderLabelNumberInput', 'screenReaderLabelPageButton', 'variant', 'margin', 'as', 'elementRef', 'inputRef', 'shouldHandleFocus', 'totalPageNumber', 'currentPage', 'onPageChange', 'siblingCount', 'boundaryCount', 'renderPageIndicator', 'ellipsis'];
63
+ const allowedProps = exports.allowedProps = ['children', 'disabled', 'withFirstAndLastButton', 'showDisabledButtons', 'label', 'labelNext', 'labelPrev', 'labelFirst', 'labelLast', 'labelNumberInput', 'screenReaderLabelNumberInput', 'screenReaderLabelPageButton', 'variant', 'margin', 'as', 'elementRef', 'inputRef', 'shouldHandleFocus', 'totalPageNumber', 'currentPage', 'onPageChange', 'siblingCount', 'boundaryCount', 'renderPageIndicator', 'ellipsis', 'onMouseEnter'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-pagination",
3
- "version": "10.24.3-snapshot-11",
3
+ "version": "10.24.3-snapshot-12",
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": "10.24.3-snapshot-11",
27
- "@instructure/ui-babel-preset": "10.24.3-snapshot-11",
26
+ "@instructure/ui-axe-check": "10.24.3-snapshot-12",
27
+ "@instructure/ui-babel-preset": "10.24.3-snapshot-12",
28
28
  "@testing-library/jest-dom": "^6.6.3",
29
29
  "@testing-library/react": "^16.0.1",
30
30
  "@testing-library/user-event": "^14.6.1",
@@ -32,23 +32,23 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.27.6",
35
- "@instructure/emotion": "10.24.3-snapshot-11",
36
- "@instructure/shared-types": "10.24.3-snapshot-11",
37
- "@instructure/ui-a11y-content": "10.24.3-snapshot-11",
38
- "@instructure/ui-a11y-utils": "10.24.3-snapshot-11",
39
- "@instructure/ui-buttons": "10.24.3-snapshot-11",
40
- "@instructure/ui-dom-utils": "10.24.3-snapshot-11",
41
- "@instructure/ui-icons": "10.24.3-snapshot-11",
42
- "@instructure/ui-number-input": "10.24.3-snapshot-11",
43
- "@instructure/ui-portal": "10.24.3-snapshot-11",
44
- "@instructure/ui-prop-types": "10.24.3-snapshot-11",
45
- "@instructure/ui-react-utils": "10.24.3-snapshot-11",
46
- "@instructure/ui-testable": "10.24.3-snapshot-11",
47
- "@instructure/ui-themes": "10.24.3-snapshot-11",
48
- "@instructure/ui-tooltip": "10.24.3-snapshot-11",
49
- "@instructure/ui-utils": "10.24.3-snapshot-11",
50
- "@instructure/ui-view": "10.24.3-snapshot-11",
51
- "@instructure/uid": "10.24.3-snapshot-11",
35
+ "@instructure/emotion": "10.24.3-snapshot-12",
36
+ "@instructure/shared-types": "10.24.3-snapshot-12",
37
+ "@instructure/ui-a11y-content": "10.24.3-snapshot-12",
38
+ "@instructure/ui-a11y-utils": "10.24.3-snapshot-12",
39
+ "@instructure/ui-buttons": "10.24.3-snapshot-12",
40
+ "@instructure/ui-dom-utils": "10.24.3-snapshot-12",
41
+ "@instructure/ui-icons": "10.24.3-snapshot-12",
42
+ "@instructure/ui-number-input": "10.24.3-snapshot-12",
43
+ "@instructure/ui-portal": "10.24.3-snapshot-12",
44
+ "@instructure/ui-prop-types": "10.24.3-snapshot-12",
45
+ "@instructure/ui-react-utils": "10.24.3-snapshot-12",
46
+ "@instructure/ui-testable": "10.24.3-snapshot-12",
47
+ "@instructure/ui-themes": "10.24.3-snapshot-12",
48
+ "@instructure/ui-tooltip": "10.24.3-snapshot-12",
49
+ "@instructure/ui-utils": "10.24.3-snapshot-12",
50
+ "@instructure/ui-view": "10.24.3-snapshot-12",
51
+ "@instructure/uid": "10.24.3-snapshot-12",
52
52
  "prop-types": "^15.8.1"
53
53
  },
54
54
  "peerDependencies": {
@@ -331,6 +331,7 @@ class Pagination extends Component<PaginationProps> {
331
331
  ref={(e) => (i === currentPage ? (this.currentPageRef = e) : null)}
332
332
  key={i}
333
333
  onClick={() => this.handleNavigation(i, currentPage)}
334
+ onMouseEnter={() => this.handleOnMouseEnter(i)}
334
335
  current={i === currentPage}
335
336
  {...(this.props.screenReaderLabelPageButton
336
337
  ? {
@@ -615,6 +616,12 @@ class Pagination extends Component<PaginationProps> {
615
616
  ) : null
616
617
  }
617
618
 
619
+ handleOnMouseEnter = (page: number) => {
620
+ if (typeof this.props.onMouseEnter === 'function') {
621
+ this.props.onMouseEnter(page)
622
+ }
623
+ }
624
+
618
625
  render() {
619
626
  const currentPageIndex = fastFindIndex(
620
627
  this.childPages,
@@ -182,6 +182,11 @@ type PaginationOwnProps = {
182
182
  */
183
183
  onPageChange?: (next: number, prev: number) => void
184
184
 
185
+ /**
186
+ * Called when a page is hovered.
187
+ */
188
+ onMouseEnter?: (page: number) => void
189
+
185
190
  /**
186
191
  * Renders the visible pages
187
192
  */
@@ -234,6 +239,7 @@ const propTypes: PropValidators<PropKeys> = {
234
239
  siblingCount: PropTypes.number,
235
240
  boundaryCount: PropTypes.number,
236
241
  onPageChange: PropTypes.func,
242
+ onMouseEnter: PropTypes.func,
237
243
  renderPageIndicator: PropTypes.func,
238
244
  ellipsis: PropTypes.node
239
245
  }
@@ -263,7 +269,8 @@ const allowedProps: AllowedPropKeys = [
263
269
  'siblingCount',
264
270
  'boundaryCount',
265
271
  'renderPageIndicator',
266
- 'ellipsis'
272
+ 'ellipsis',
273
+ 'onMouseEnter'
267
274
  ]
268
275
 
269
276
  type PaginationSnapshot = {