@instructure/ui-pagination 10.26.1 → 11.0.1-snapshot-0

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 (44) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/es/Pagination/PaginationArrowButton/index.js +8 -5
  3. package/es/Pagination/PaginationArrowButton/props.js +1 -8
  4. package/es/Pagination/PaginationButton/index.js +10 -6
  5. package/es/Pagination/PaginationButton/props.js +1 -8
  6. package/es/Pagination/PaginationPageInput/index.js +6 -6
  7. package/es/Pagination/PaginationPageInput/props.js +1 -11
  8. package/es/Pagination/index.js +11 -8
  9. package/es/Pagination/props.js +1 -32
  10. package/lib/Pagination/PaginationArrowButton/index.js +8 -4
  11. package/lib/Pagination/PaginationArrowButton/props.js +1 -9
  12. package/lib/Pagination/PaginationButton/index.js +11 -5
  13. package/lib/Pagination/PaginationButton/props.js +1 -9
  14. package/lib/Pagination/PaginationPageInput/index.js +5 -5
  15. package/lib/Pagination/PaginationPageInput/props.js +1 -12
  16. package/lib/Pagination/index.js +10 -6
  17. package/lib/Pagination/props.js +1 -33
  18. package/package.json +20 -23
  19. package/src/Pagination/PaginationArrowButton/index.tsx +2 -4
  20. package/src/Pagination/PaginationArrowButton/props.ts +1 -12
  21. package/src/Pagination/PaginationButton/index.tsx +2 -4
  22. package/src/Pagination/PaginationButton/props.ts +2 -12
  23. package/src/Pagination/PaginationPageInput/index.tsx +6 -5
  24. package/src/Pagination/PaginationPageInput/props.ts +2 -19
  25. package/src/Pagination/index.tsx +7 -6
  26. package/src/Pagination/props.ts +2 -38
  27. package/tsconfig.build.json +0 -2
  28. package/tsconfig.build.tsbuildinfo +1 -1
  29. package/types/Pagination/PaginationArrowButton/index.d.ts +0 -6
  30. package/types/Pagination/PaginationArrowButton/index.d.ts.map +1 -1
  31. package/types/Pagination/PaginationArrowButton/props.d.ts +2 -3
  32. package/types/Pagination/PaginationArrowButton/props.d.ts.map +1 -1
  33. package/types/Pagination/PaginationButton/index.d.ts +0 -6
  34. package/types/Pagination/PaginationButton/index.d.ts.map +1 -1
  35. package/types/Pagination/PaginationButton/props.d.ts +2 -3
  36. package/types/Pagination/PaginationButton/props.d.ts.map +1 -1
  37. package/types/Pagination/PaginationPageInput/index.d.ts +0 -9
  38. package/types/Pagination/PaginationPageInput/index.d.ts.map +1 -1
  39. package/types/Pagination/PaginationPageInput/props.d.ts +2 -3
  40. package/types/Pagination/PaginationPageInput/props.d.ts.map +1 -1
  41. package/types/Pagination/index.d.ts +0 -28
  42. package/types/Pagination/index.d.ts.map +1 -1
  43. package/types/Pagination/props.d.ts +2 -3
  44. package/types/Pagination/props.d.ts.map +1 -1
@@ -1,13 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports.propTypes = exports.allowedProps = void 0;
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _Children = require("@instructure/ui-prop-types/lib/Children.js");
10
- var _PaginationButton = require("./PaginationButton");
6
+ exports.allowedProps = void 0;
11
7
  /*
12
8
  * The MIT License (MIT)
13
9
  *
@@ -32,32 +28,4 @@ var _PaginationButton = require("./PaginationButton");
32
28
  * SOFTWARE.
33
29
  */
34
30
 
35
- const propTypes = exports.propTypes = {
36
- children: _Children.Children.oneOf([_PaginationButton.PaginationButton]),
37
- disabled: _propTypes.default.bool,
38
- withFirstAndLastButton: _propTypes.default.bool,
39
- showDisabledButtons: _propTypes.default.bool,
40
- label: _propTypes.default.node,
41
- labelNext: _propTypes.default.string,
42
- labelPrev: _propTypes.default.string,
43
- labelFirst: _propTypes.default.string,
44
- labelLast: _propTypes.default.string,
45
- labelNumberInput: _propTypes.default.func,
46
- screenReaderLabelNumberInput: _propTypes.default.func,
47
- screenReaderLabelPageButton: _propTypes.default.func,
48
- variant: _propTypes.default.oneOf(['full', 'compact', 'input']),
49
- margin: _propTypes.default.string,
50
- as: _propTypes.default.elementType,
51
- elementRef: _propTypes.default.func,
52
- inputRef: _propTypes.default.func,
53
- shouldHandleFocus: _propTypes.default.bool,
54
- totalPageNumber: _propTypes.default.number,
55
- currentPage: _propTypes.default.number,
56
- siblingCount: _propTypes.default.number,
57
- boundaryCount: _propTypes.default.number,
58
- onPageChange: _propTypes.default.func,
59
- onMouseEnter: _propTypes.default.func,
60
- renderPageIndicator: _propTypes.default.func,
61
- ellipsis: _propTypes.default.node
62
- };
63
31
  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.26.1",
3
+ "version": "11.0.1-snapshot-0",
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,36 +23,33 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-axe-check": "10.26.1",
27
- "@instructure/ui-babel-preset": "10.26.1",
26
+ "@instructure/ui-axe-check": "11.0.1-snapshot-0",
27
+ "@instructure/ui-babel-preset": "11.0.1-snapshot-0",
28
28
  "@testing-library/jest-dom": "^6.6.3",
29
- "@testing-library/react": "^16.0.1",
29
+ "@testing-library/react": "15.0.7",
30
30
  "@testing-library/user-event": "^14.6.1",
31
31
  "vitest": "^3.2.2"
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.27.6",
35
- "@instructure/emotion": "10.26.1",
36
- "@instructure/shared-types": "10.26.1",
37
- "@instructure/ui-a11y-content": "10.26.1",
38
- "@instructure/ui-a11y-utils": "10.26.1",
39
- "@instructure/ui-buttons": "10.26.1",
40
- "@instructure/ui-dom-utils": "10.26.1",
41
- "@instructure/ui-icons": "10.26.1",
42
- "@instructure/ui-number-input": "10.26.1",
43
- "@instructure/ui-portal": "10.26.1",
44
- "@instructure/ui-prop-types": "10.26.1",
45
- "@instructure/ui-react-utils": "10.26.1",
46
- "@instructure/ui-testable": "10.26.1",
47
- "@instructure/ui-themes": "10.26.1",
48
- "@instructure/ui-tooltip": "10.26.1",
49
- "@instructure/ui-utils": "10.26.1",
50
- "@instructure/ui-view": "10.26.1",
51
- "@instructure/uid": "10.26.1",
52
- "prop-types": "^15.8.1"
35
+ "@instructure/emotion": "11.0.1-snapshot-0",
36
+ "@instructure/shared-types": "11.0.1-snapshot-0",
37
+ "@instructure/ui-a11y-content": "11.0.1-snapshot-0",
38
+ "@instructure/ui-a11y-utils": "11.0.1-snapshot-0",
39
+ "@instructure/ui-buttons": "11.0.1-snapshot-0",
40
+ "@instructure/ui-dom-utils": "11.0.1-snapshot-0",
41
+ "@instructure/ui-icons": "11.0.1-snapshot-0",
42
+ "@instructure/ui-number-input": "11.0.1-snapshot-0",
43
+ "@instructure/ui-portal": "11.0.1-snapshot-0",
44
+ "@instructure/ui-react-utils": "11.0.1-snapshot-0",
45
+ "@instructure/ui-themes": "11.0.1-snapshot-0",
46
+ "@instructure/ui-tooltip": "11.0.1-snapshot-0",
47
+ "@instructure/ui-utils": "11.0.1-snapshot-0",
48
+ "@instructure/ui-view": "11.0.1-snapshot-0",
49
+ "@instructure/uid": "11.0.1-snapshot-0"
53
50
  },
54
51
  "peerDependencies": {
55
- "react": ">=16.14 <=18"
52
+ "react": ">=18 <=19"
56
53
  },
57
54
  "publishConfig": {
58
55
  "access": "public"
@@ -33,10 +33,9 @@ import {
33
33
  IconArrowDoubleStartSolid,
34
34
  IconArrowDoubleEndSolid
35
35
  } from '@instructure/ui-icons'
36
- import { testable } from '@instructure/ui-testable'
37
36
 
38
37
  import type { PaginationNavigationProps } from './props'
39
- import { allowedProps, propTypes } from './props'
38
+ import { allowedProps } from './props'
40
39
 
41
40
  /**
42
41
  ---
@@ -44,12 +43,10 @@ parent: Pagination
44
43
  id: Pagination.Navigation
45
44
  ---
46
45
  **/
47
- @testable()
48
46
  class PaginationArrowButton extends Component<PaginationNavigationProps> {
49
47
  static readonly componentId = 'Pagination.Navigation'
50
48
 
51
49
  static allowedProps = allowedProps
52
- static propTypes = propTypes
53
50
 
54
51
  static defaultProps = {}
55
52
 
@@ -103,6 +100,7 @@ class PaginationArrowButton extends Component<PaginationNavigationProps> {
103
100
  rel={props.href || props.to ? direction : undefined}
104
101
  elementRef={buttonRef}
105
102
  margin={this.margin}
103
+ data-cid="PaginationArrowButton"
106
104
  >
107
105
  {this.Icon}
108
106
  </IconButton>
@@ -23,11 +23,8 @@
23
23
  */
24
24
 
25
25
  import React from 'react'
26
- import PropTypes from 'prop-types'
27
-
28
26
  import type {
29
27
  OtherHTMLAttributes,
30
- PropValidators,
31
28
  PickPropsWithExceptions
32
29
  } from '@instructure/shared-types'
33
30
  import type { IconButtonProps } from '@instructure/ui-buttons'
@@ -64,14 +61,6 @@ type PaginationNavigationProps =
64
61
  > &
65
62
  PaginationNavigationOwnProps &
66
63
  OtherHTMLAttributes<PaginationNavigationOwnProps>
67
-
68
- const propTypes: PropValidators<PropKeys> = {
69
- direction: PropTypes.oneOf(['first', 'prev', 'next', 'last']),
70
- label: PropTypes.string.isRequired,
71
- buttonRef: PropTypes.func,
72
- onClick: PropTypes.func
73
- }
74
-
75
64
  const allowedProps: AllowedPropKeys = [
76
65
  'direction',
77
66
  'label',
@@ -82,4 +71,4 @@ const allowedProps: AllowedPropKeys = [
82
71
  ]
83
72
 
84
73
  export type { PaginationNavigationProps, PaginationArrowDirections }
85
- export { propTypes, allowedProps }
74
+ export { allowedProps }
@@ -26,9 +26,8 @@ import { Component } from 'react'
26
26
 
27
27
  import { BaseButton } from '@instructure/ui-buttons'
28
28
  import { omitProps } from '@instructure/ui-react-utils'
29
- import { testable } from '@instructure/ui-testable'
30
29
 
31
- import { propTypes, allowedProps } from './props'
30
+ import { allowedProps } from './props'
32
31
  import type { PaginationPageProps } from './props'
33
32
 
34
33
  /**
@@ -38,11 +37,9 @@ id: Pagination.Page
38
37
  ---
39
38
  **/
40
39
 
41
- @testable()
42
40
  class PaginationButton extends Component<PaginationPageProps> {
43
41
  static readonly componentId = 'Pagination.Page'
44
42
 
45
- static propTypes = propTypes
46
43
  static allowedProps = allowedProps
47
44
  static defaultProps = {
48
45
  current: false
@@ -64,6 +61,7 @@ class PaginationButton extends Component<PaginationPageProps> {
64
61
  <li style={{ all: 'unset' }}>
65
62
  <BaseButton
66
63
  color="primary"
64
+ data-cid="PaginationButton"
67
65
  withBackground={this.props.current}
68
66
  withBorder={this.props.current}
69
67
  {...props}
@@ -23,12 +23,9 @@
23
23
  */
24
24
 
25
25
  import React from 'react'
26
- import PropTypes from 'prop-types'
27
-
28
26
  import type {
29
27
  OtherHTMLAttributes,
30
- PickPropsWithExceptions,
31
- PropValidators
28
+ PickPropsWithExceptions
32
29
  } from '@instructure/shared-types'
33
30
  import type { BaseButtonProps } from '@instructure/ui-buttons'
34
31
 
@@ -68,13 +65,6 @@ type PaginationPageProps =
68
65
  PaginationPageOwnProps &
69
66
  OtherHTMLAttributes<PaginationPageOwnProps>
70
67
 
71
- const propTypes: PropValidators<PropKeys> = {
72
- children: PropTypes.node.isRequired,
73
- current: PropTypes.bool,
74
- onClick: PropTypes.func,
75
- screenReaderLabel: PropTypes.string
76
- }
77
-
78
68
  const allowedProps: AllowedPropKeys = [
79
69
  'children',
80
70
  'current',
@@ -84,4 +74,4 @@ const allowedProps: AllowedPropKeys = [
84
74
  ]
85
75
 
86
76
  export type { PaginationPageProps }
87
- export { propTypes, allowedProps }
77
+ export { allowedProps }
@@ -24,7 +24,6 @@
24
24
 
25
25
  import { Component } from 'react'
26
26
 
27
- import { testable } from '@instructure/ui-testable'
28
27
  import { withStyle } from '@instructure/emotion'
29
28
  import { NumberInput } from '@instructure/ui-number-input'
30
29
  import { ScreenReaderContent } from '@instructure/ui-a11y-content'
@@ -32,7 +31,7 @@ import { ScreenReaderContent } from '@instructure/ui-a11y-content'
32
31
  import generateStyle from './styles'
33
32
  import generateComponentTheme from './theme'
34
33
 
35
- import { propTypes, allowedProps } from './props'
34
+ import { allowedProps } from './props'
36
35
  import type {
37
36
  PaginationPageInputProps,
38
37
  PaginationPageInputState
@@ -45,14 +44,12 @@ id: Pagination.PageInput
45
44
  ---
46
45
  **/
47
46
  @withStyle(generateStyle, generateComponentTheme)
48
- @testable()
49
47
  class PaginationPageInput extends Component<
50
48
  PaginationPageInputProps,
51
49
  PaginationPageInputState
52
50
  > {
53
51
  static readonly componentId = 'Pagination.PageInput'
54
52
 
55
- static propTypes = propTypes
56
53
  static allowedProps = allowedProps
57
54
  static defaultProps = {
58
55
  disabled: false
@@ -212,7 +209,11 @@ class PaginationPageInput extends Component<
212
209
  const { styles, disabled } = this.props
213
210
 
214
211
  return (
215
- <span css={styles?.paginationPageInput} ref={this.handleRef}>
212
+ <span
213
+ css={styles?.paginationPageInput}
214
+ ref={this.handleRef}
215
+ data-cid="PaginationPageInput"
216
+ >
216
217
  <span css={styles?.numberInput}>
217
218
  <NumberInput
218
219
  renderLabel={this.renderScreenReaderLabel()}
@@ -22,15 +22,9 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types'
26
-
27
25
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
28
- import type {
29
- PaginationPageInputTheme,
30
- PropValidators
31
- } from '@instructure/shared-types'
26
+ import type { PaginationPageInputTheme } from '@instructure/shared-types'
32
27
  import React from 'react'
33
-
34
28
  type PaginationPageInputOwnProps = {
35
29
  /**
36
30
  * The number of pages in total
@@ -83,17 +77,6 @@ type PaginationPageInputState = {
83
77
  number: number
84
78
  value: string
85
79
  }
86
-
87
- const propTypes: PropValidators<PropKeys> = {
88
- numberOfPages: PropTypes.number.isRequired,
89
- currentPageIndex: PropTypes.number.isRequired,
90
- onChange: PropTypes.func.isRequired,
91
- screenReaderLabel: PropTypes.func.isRequired,
92
- label: PropTypes.func,
93
- disabled: PropTypes.bool,
94
- inputRef: PropTypes.func
95
- }
96
-
97
80
  const allowedProps: AllowedPropKeys = [
98
81
  'numberOfPages',
99
82
  'currentPageIndex',
@@ -109,4 +92,4 @@ export type {
109
92
  PaginationPageInputStyle,
110
93
  PaginationPageInputState
111
94
  }
112
- export { propTypes, allowedProps }
95
+ export { allowedProps }
@@ -21,7 +21,6 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
-
25
24
  import {
26
25
  cloneElement,
27
26
  Children,
@@ -31,7 +30,6 @@ import {
31
30
  } from 'react'
32
31
 
33
32
  import { View } from '@instructure/ui-view'
34
- import { testable } from '@instructure/ui-testable'
35
33
  import { omitProps, withDeterministicId } from '@instructure/ui-react-utils'
36
34
  import { hasVisibleChildren } from '@instructure/ui-a11y-utils'
37
35
  import { findTabbable, getActiveElement } from '@instructure/ui-dom-utils'
@@ -47,7 +45,7 @@ import generateComponentTheme from './theme'
47
45
  import type { PaginationPageProps } from './PaginationButton/props'
48
46
  import type { PaginationArrowDirections } from './PaginationArrowButton/props'
49
47
 
50
- import { propTypes, allowedProps } from './props'
48
+ import { allowedProps } from './props'
51
49
  import type { PaginationProps, PaginationSnapshot, ChildPage } from './props'
52
50
 
53
51
  /** This is an [].findIndex optimized to work on really big, but sparse, arrays */
@@ -88,11 +86,9 @@ category: components
88
86
  **/
89
87
  @withDeterministicId()
90
88
  @withStyle(generateStyle, generateComponentTheme)
91
- @testable()
92
89
  class Pagination extends Component<PaginationProps> {
93
90
  static readonly componentId = 'Pagination'
94
91
 
95
- static propTypes = propTypes
96
92
  static allowedProps = allowedProps
97
93
  static defaultProps = {
98
94
  disabled: false,
@@ -328,7 +324,11 @@ class Pagination extends Component<PaginationProps> {
328
324
  for (let i = from; i <= to; i++) {
329
325
  pages.push(
330
326
  <Pagination.Page
331
- ref={(e) => (i === currentPage ? (this.currentPageRef = e) : null)}
327
+ ref={(e) => {
328
+ if (i === currentPage) {
329
+ this.currentPageRef = e
330
+ }
331
+ }}
332
332
  key={i}
333
333
  onClick={() => this.handleNavigation(i, currentPage)}
334
334
  onMouseEnter={() => this.handleOnMouseEnter(i)}
@@ -642,6 +642,7 @@ class Pagination extends Component<PaginationProps> {
642
642
  margin={this.props.margin}
643
643
  css={this.props.styles?.pagination}
644
644
  aria-labelledby={this.props.label ? this._labelId : undefined}
645
+ data-cid="Pagination"
645
646
  >
646
647
  {this.props.label && this.renderLabel()}
647
648
  <View display="inline-block" css={this.props.styles?.pages}>
@@ -23,12 +23,6 @@
23
23
  */
24
24
 
25
25
  import React from 'react'
26
- import PropTypes from 'prop-types'
27
-
28
- import { Children } from '@instructure/ui-prop-types'
29
-
30
- import { PaginationButton } from './PaginationButton'
31
-
32
26
  import type {
33
27
  Spacing,
34
28
  WithStyleProps,
@@ -36,8 +30,7 @@ import type {
36
30
  } from '@instructure/emotion'
37
31
  import type {
38
32
  AsElementType,
39
- OtherHTMLAttributes,
40
- PropValidators
33
+ OtherHTMLAttributes
41
34
  } from '@instructure/shared-types'
42
35
  import type { PaginationPageProps } from './PaginationButton/props'
43
36
  import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
@@ -215,35 +208,6 @@ type PaginationStyle = ComponentStyle<
215
208
  'pagination' | 'pages' | 'pageIndicatorList'
216
209
  >
217
210
 
218
- const propTypes: PropValidators<PropKeys> = {
219
- children: Children.oneOf([PaginationButton]),
220
- disabled: PropTypes.bool,
221
- withFirstAndLastButton: PropTypes.bool,
222
- showDisabledButtons: PropTypes.bool,
223
- label: PropTypes.node,
224
- labelNext: PropTypes.string,
225
- labelPrev: PropTypes.string,
226
- labelFirst: PropTypes.string,
227
- labelLast: PropTypes.string,
228
- labelNumberInput: PropTypes.func,
229
- screenReaderLabelNumberInput: PropTypes.func,
230
- screenReaderLabelPageButton: PropTypes.func,
231
- variant: PropTypes.oneOf(['full', 'compact', 'input']),
232
- margin: PropTypes.string,
233
- as: PropTypes.elementType,
234
- elementRef: PropTypes.func,
235
- inputRef: PropTypes.func,
236
- shouldHandleFocus: PropTypes.bool,
237
- totalPageNumber: PropTypes.number,
238
- currentPage: PropTypes.number,
239
- siblingCount: PropTypes.number,
240
- boundaryCount: PropTypes.number,
241
- onPageChange: PropTypes.func,
242
- onMouseEnter: PropTypes.func,
243
- renderPageIndicator: PropTypes.func,
244
- ellipsis: PropTypes.node
245
- }
246
-
247
211
  const allowedProps: AllowedPropKeys = [
248
212
  'children',
249
213
  'disabled',
@@ -278,4 +242,4 @@ type PaginationSnapshot = {
278
242
  }
279
243
 
280
244
  export type { PaginationProps, PaginationStyle, PaginationSnapshot, ChildPage }
281
- export { propTypes, allowedProps }
245
+ export { allowedProps }
@@ -17,9 +17,7 @@
17
17
  { "path": "../ui-dom-utils/tsconfig.build.json" },
18
18
  { "path": "../ui-icons/tsconfig.build.json" },
19
19
  { "path": "../ui-portal/tsconfig.build.json" },
20
- { "path": "../ui-prop-types/tsconfig.build.json" },
21
20
  { "path": "../ui-react-utils/tsconfig.build.json" },
22
- { "path": "../ui-testable/tsconfig.build.json" },
23
21
  { "path": "../ui-themes/tsconfig.build.json" },
24
22
  { "path": "../ui-tooltip/tsconfig.build.json" },
25
23
  { "path": "../ui-utils/tsconfig.build.json" },