@instructure/ui-pagination 8.8.1-snapshot.3 → 8.9.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 (47) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es/Pagination/PaginationArrowButton/index.js +3 -8
  3. package/{src/Pagination/PaginationArrowButton/types.ts → es/Pagination/PaginationArrowButton/props.js} +8 -8
  4. package/es/Pagination/PaginationButton/index.js +2 -12
  5. package/{src/Pagination/PaginationButton/types.ts → es/Pagination/PaginationButton/props.js} +13 -3
  6. package/es/Pagination/index.js +7 -71
  7. package/es/Pagination/props.js +86 -0
  8. package/lib/Pagination/PaginationArrowButton/index.js +3 -8
  9. package/lib/Pagination/PaginationArrowButton/props.js +42 -0
  10. package/lib/Pagination/PaginationButton/index.js +3 -15
  11. package/{src/Pagination/types.ts → lib/Pagination/PaginationButton/props.js} +24 -17
  12. package/lib/Pagination/index.js +7 -72
  13. package/lib/Pagination/props.js +100 -0
  14. package/package.json +21 -22
  15. package/src/Pagination/PaginationArrowButton/index.tsx +4 -8
  16. package/src/Pagination/PaginationArrowButton/props.ts +51 -0
  17. package/src/Pagination/PaginationButton/index.tsx +5 -13
  18. package/src/Pagination/PaginationButton/props.ts +55 -0
  19. package/src/Pagination/index.tsx +8 -63
  20. package/src/Pagination/props.ts +118 -0
  21. package/src/index.ts +3 -3
  22. package/types/Pagination/PaginationArrowButton/index.d.ts +12 -9
  23. package/types/Pagination/PaginationArrowButton/index.d.ts.map +1 -1
  24. package/types/Pagination/PaginationArrowButton/props.d.ts +15 -0
  25. package/types/Pagination/PaginationArrowButton/props.d.ts.map +1 -0
  26. package/types/Pagination/PaginationButton/index.d.ts +10 -13
  27. package/types/Pagination/PaginationButton/index.d.ts.map +1 -1
  28. package/types/Pagination/PaginationButton/props.d.ts +14 -0
  29. package/types/Pagination/PaginationButton/props.d.ts.map +1 -0
  30. package/types/Pagination/index.d.ts +26 -60
  31. package/types/Pagination/index.d.ts.map +1 -1
  32. package/types/Pagination/props.d.ts +23 -0
  33. package/types/Pagination/props.d.ts.map +1 -0
  34. package/types/index.d.ts +3 -3
  35. package/LICENSE.md +0 -27
  36. package/es/Pagination/PaginationArrowButton/types.js +0 -1
  37. package/es/Pagination/PaginationButton/types.js +0 -1
  38. package/es/Pagination/types.js +0 -1
  39. package/lib/Pagination/PaginationArrowButton/types.js +0 -1
  40. package/lib/Pagination/PaginationButton/types.js +0 -1
  41. package/lib/Pagination/types.js +0 -1
  42. package/types/Pagination/PaginationArrowButton/types.d.ts +0 -7
  43. package/types/Pagination/PaginationArrowButton/types.d.ts.map +0 -1
  44. package/types/Pagination/PaginationButton/types.d.ts +0 -4
  45. package/types/Pagination/PaginationButton/types.d.ts.map +0 -1
  46. package/types/Pagination/types.d.ts +0 -17
  47. package/types/Pagination/types.d.ts.map +0 -1
@@ -23,22 +23,22 @@
23
23
  */
24
24
  /** @jsx jsx */
25
25
  import React, { Component } from 'react'
26
- import PropTypes from 'prop-types'
27
26
 
28
27
  import { View } from '@instructure/ui-view'
29
28
  import { testable } from '@instructure/ui-testable'
30
29
  import { omitProps } from '@instructure/ui-react-utils'
31
30
  import { uid } from '@instructure/uid'
32
- import { Children } from '@instructure/ui-prop-types'
33
31
  import { hasVisibleChildren } from '@instructure/ui-a11y-utils'
34
32
  import { findTabbable, getActiveElement } from '@instructure/ui-dom-utils'
35
- import { withStyle, jsx, ThemeablePropTypes } from '@instructure/emotion'
33
+ import { withStyle, jsx } from '@instructure/emotion'
36
34
 
37
35
  import { PaginationButton } from './PaginationButton'
38
36
  import { PaginationArrowButton } from './PaginationArrowButton'
39
37
 
40
38
  import generateStyle from './styles'
41
- import { PaginationProps } from './types'
39
+
40
+ import { propTypes, allowedProps } from './props'
41
+ import type { PaginationProps } from './props'
42
42
 
43
43
  /** This is an [].findIndex optimized to work on really big, but sparse, arrays */
44
44
  // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'arr' implicitly has an 'any' type.
@@ -73,65 +73,10 @@ category: components
73
73
  class Pagination extends Component<PaginationProps> {
74
74
  static readonly componentId = 'Pagination'
75
75
 
76
- static propTypes = {
77
- // eslint-disable-next-line react/require-default-props
78
- makeStyles: PropTypes.func,
79
- // eslint-disable-next-line react/require-default-props
80
- styles: PropTypes.object,
81
- /**
82
- * children of type Pagination.Page
83
- */
84
- children: Children.oneOf([PaginationButton]),
85
- /**
86
- * Disables interaction with all pages
87
- */
88
- disabled: PropTypes.bool,
89
- /**
90
- * Visible label for component
91
- */
92
- label: PropTypes.node,
93
- /**
94
- * Accessible label for next button
95
- */
96
- labelNext: PropTypes.string,
97
- /**
98
- * Accessible label for previous button
99
- */
100
- labelPrev: PropTypes.string,
101
- /**
102
- * The compact variant truncates the page navigation to show only the first,
103
- * last, and pages immediately surrounding the current page. Fewer than 5 pages,
104
- * no next/previous arrow buttons will be shown, and all pages will be listed
105
- */
106
- variant: PropTypes.oneOf(['full', 'compact']),
107
- /**
108
- * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
109
- * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
110
- * familiar CSS-like shorthand. For example: `margin="small auto large"`.
111
- */
112
- margin: ThemeablePropTypes.spacing,
113
- /**
114
- * the element type to render as
115
- */
116
- as: PropTypes.elementType,
117
- /**
118
- * provides a reference to the underlying html root element
119
- */
120
- elementRef: PropTypes.func,
121
- /**
122
- * For accessibility, Pagination sets focus on the first or last Pagination.Pages,
123
- * respectively, when the Previous or Next arrow buttons are removed from the DOM.
124
- * Set this property to `false` to prevent this behavior.
125
- */
126
- shouldHandleFocus: PropTypes.bool
127
- }
128
-
76
+ static propTypes = propTypes
77
+ static allowedProps = allowedProps
129
78
  static defaultProps = {
130
79
  children: null,
131
- label: undefined,
132
- labelNext: undefined,
133
- labelPrev: undefined,
134
- margin: undefined,
135
80
  disabled: false,
136
81
  variant: 'full',
137
82
  as: 'div',
@@ -338,12 +283,12 @@ class Pagination extends Component<PaginationProps> {
338
283
  as={this.props.as}
339
284
  elementRef={this.handleElementRef}
340
285
  margin={this.props.margin}
341
- css={this.props.styles.pagination}
286
+ css={this.props.styles?.pagination}
342
287
  // @ts-expect-error ts-migrate(2339) FIXME: Property '_labelId' does not exist on type 'Pagina... Remove this comment to see the full error message
343
288
  aria-labelledby={this.props.label && this._labelId}
344
289
  >
345
290
  {this.props.label && this.renderLabel()}
346
- <View display="inline-block" css={this.props.styles.pages}>
291
+ <View display="inline-block" css={this.props.styles?.pages}>
347
292
  {shouldShowPrevButton(this.props, currentPageIndex) &&
348
293
  this.renderArrowButton(this.props.labelPrev, -1, currentPageIndex)}
349
294
  {this.renderPages(currentPageIndex)}
@@ -0,0 +1,118 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import React from 'react'
26
+ import PropTypes from 'prop-types'
27
+
28
+ import { Children } from '@instructure/ui-prop-types'
29
+ import { ThemeablePropTypes } from '@instructure/emotion'
30
+
31
+ import { PaginationButton } from './PaginationButton'
32
+
33
+ import type { Spacing, WithStyleProps } from '@instructure/emotion'
34
+ import type { AsElementType, PropValidators } from '@instructure/shared-types'
35
+
36
+ type PaginationOwnProps = {
37
+ children?: React.ReactNode // TODO: oneof([PaginationButton])
38
+ disabled?: boolean
39
+ label?: React.ReactNode
40
+ labelNext?: string
41
+ labelPrev?: string
42
+ variant?: 'full' | 'compact'
43
+ margin?: Spacing
44
+ as?: AsElementType
45
+ elementRef?: (...args: any[]) => any
46
+ shouldHandleFocus?: boolean
47
+ }
48
+
49
+ type PropKeys = keyof PaginationOwnProps
50
+
51
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
52
+
53
+ type PaginationProps = PaginationOwnProps & WithStyleProps
54
+
55
+ const propTypes: PropValidators<PropKeys> = {
56
+ /**
57
+ * children of type Pagination.Page
58
+ */
59
+ children: Children.oneOf([PaginationButton]),
60
+ /**
61
+ * Disables interaction with all pages
62
+ */
63
+ disabled: PropTypes.bool,
64
+ /**
65
+ * Visible label for component
66
+ */
67
+ label: PropTypes.node,
68
+ /**
69
+ * Accessible label for next button
70
+ */
71
+ labelNext: PropTypes.string,
72
+ /**
73
+ * Accessible label for previous button
74
+ */
75
+ labelPrev: PropTypes.string,
76
+ /**
77
+ * The compact variant truncates the page navigation to show only the first,
78
+ * last, and pages immediately surrounding the current page. Fewer than 5 pages,
79
+ * no next/previous arrow buttons will be shown, and all pages will be listed
80
+ */
81
+ variant: PropTypes.oneOf(['full', 'compact']),
82
+ /**
83
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
84
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
85
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
86
+ */
87
+ margin: ThemeablePropTypes.spacing,
88
+ /**
89
+ * the element type to render as
90
+ */
91
+ as: PropTypes.elementType,
92
+ /**
93
+ * provides a reference to the underlying html root element
94
+ */
95
+ elementRef: PropTypes.func,
96
+ /**
97
+ * For accessibility, Pagination sets focus on the first or last Pagination.Pages,
98
+ * respectively, when the Previous or Next arrow buttons are removed from the DOM.
99
+ * Set this property to `false` to prevent this behavior.
100
+ */
101
+ shouldHandleFocus: PropTypes.bool
102
+ }
103
+
104
+ const allowedProps: AllowedPropKeys = [
105
+ 'children',
106
+ 'disabled',
107
+ 'label',
108
+ 'labelNext',
109
+ 'labelPrev',
110
+ 'variant',
111
+ 'margin',
112
+ 'as',
113
+ 'elementRef',
114
+ 'shouldHandleFocus'
115
+ ]
116
+
117
+ export type { PaginationProps }
118
+ export { propTypes, allowedProps }
package/src/index.ts CHANGED
@@ -24,6 +24,6 @@
24
24
 
25
25
  export { Pagination, PaginationButton } from './Pagination'
26
26
 
27
- export type { PaginationProps } from './Pagination/types'
28
- export type { PaginationPageProps } from './Pagination/PaginationButton/types'
29
- export type { PaginationNavigationProps } from './Pagination/PaginationArrowButton/types'
27
+ export type { PaginationProps } from './Pagination/props'
28
+ export type { PaginationPageProps } from './Pagination/PaginationButton/props'
29
+ export type { PaginationNavigationProps } from './Pagination/PaginationArrowButton/props'
@@ -1,6 +1,5 @@
1
- import { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { PaginationNavigationProps } from './types';
1
+ import React, { Component } from 'react';
2
+ import type { PaginationNavigationProps } from './props';
4
3
  /**
5
4
  ---
6
5
  parent: Pagination
@@ -9,13 +8,17 @@ id: Pagination.Navigation
9
8
  **/
10
9
  declare class PaginationArrowButton extends Component<PaginationNavigationProps> {
11
10
  static readonly componentId = "Pagination.Navigation";
12
- static propTypes: {
13
- direction: PropTypes.Requireable<string>;
14
- label: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
15
- buttonRef: PropTypes.Requireable<(...args: any[]) => any>;
16
- };
11
+ static allowedProps: readonly (keyof {
12
+ direction?: "next" | "prev" | undefined;
13
+ label: React.ReactNode;
14
+ buttonRef?: ((...args: any[]) => any) | undefined;
15
+ })[];
16
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
17
+ direction?: "next" | "prev" | undefined;
18
+ label: React.ReactNode;
19
+ buttonRef?: ((...args: any[]) => any) | undefined;
20
+ }>;
17
21
  static defaultProps: {
18
- direction: undefined;
19
22
  buttonRef: (el: any) => void;
20
23
  };
21
24
  render(): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Pagination/PaginationArrowButton/index.tsx"],"names":[],"mappings":"AAwBA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,SAAS,MAAM,YAAY,CAAA;AAUlC,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAEnD;;;;;GAKG;AACH,cACM,qBAAsB,SAAQ,SAAS,CAAC,yBAAyB,CAAC;IACtE,MAAM,CAAC,QAAQ,CAAC,WAAW,2BAA0B;IAErD,MAAM,CAAC,SAAS;;;;MAIf;IAED,MAAM,CAAC,YAAY;;;MAIlB;IAED,MAAM;CAyBP;AAED,eAAe,qBAAqB,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Pagination/PaginationArrowButton/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAGxD;;;;;GAKG;AACH,cACM,qBAAsB,SAAQ,SAAS,CAAC,yBAAyB,CAAC;IACtE,MAAM,CAAC,QAAQ,CAAC,WAAW,2BAA0B;IAErD,MAAM,CAAC,YAAY;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;MAGlB;IAED,MAAM;CAyBP;AAED,eAAe,qBAAqB,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { PropValidators } from '@instructure/shared-types';
3
+ declare type PaginationNavigationOwnProps = {
4
+ direction?: 'next' | 'prev';
5
+ label: string | React.ReactNode;
6
+ buttonRef?: (...args: any[]) => any;
7
+ };
8
+ declare type PropKeys = keyof PaginationNavigationOwnProps;
9
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
10
+ declare type PaginationNavigationProps = PaginationNavigationOwnProps;
11
+ declare const propTypes: PropValidators<PropKeys>;
12
+ declare const allowedProps: AllowedPropKeys;
13
+ export type { PaginationNavigationProps };
14
+ export { propTypes, allowedProps };
15
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Pagination/PaginationArrowButton/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,aAAK,4BAA4B,GAAG;IAClC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAC/B,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;CACpC,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,4BAA4B,CAAA;AAElD,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,yBAAyB,GAAG,4BAA4B,CAAA;AAE7D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAIvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAqD,CAAA;AAEzE,YAAY,EAAE,yBAAyB,EAAE,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,6 +1,5 @@
1
- import { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { PaginationPageProps } from './types';
1
+ import React, { Component } from 'react';
2
+ import type { PaginationPageProps } from './props';
4
3
  /**
5
4
  ---
6
5
  parent: Pagination
@@ -9,16 +8,14 @@ id: Pagination.Page
9
8
  **/
10
9
  declare class PaginationButton extends Component<PaginationPageProps> {
11
10
  static readonly componentId = "Pagination.Page";
12
- static propTypes: {
13
- /**
14
- * Content to render as page selection
15
- */
16
- children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
17
- /**
18
- * Whether the page is currently displayed
19
- */
20
- current: PropTypes.Requireable<boolean>;
21
- };
11
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
12
+ children: React.ReactNode;
13
+ current?: boolean | undefined;
14
+ }>;
15
+ static allowedProps: readonly (keyof {
16
+ children: React.ReactNode;
17
+ current?: boolean | undefined;
18
+ })[];
22
19
  static defaultProps: {
23
20
  current: boolean;
24
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Pagination/PaginationButton/index.tsx"],"names":[],"mappings":"AAwBA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,SAAS,MAAM,YAAY,CAAA;AAKlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;GAKG;AAEH,cACM,gBAAiB,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,SAAS;QACd;;WAEG;;QAEH;;WAEG;;MAEJ;IAED,MAAM,CAAC,YAAY;;MAElB;IAED,MAAM;CAeP;AAED,eAAe,gBAAgB,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Pagination/PaginationButton/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;GAKG;AAEH,cACM,gBAAiB,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,SAAS;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;SAAe;IAClC,MAAM,CAAC,YAAY;;MAElB;IAED,MAAM;CAeP;AAED,eAAe,gBAAgB,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { PropValidators } from '@instructure/shared-types';
3
+ declare type PaginationPageOwnProps = {
4
+ children: React.ReactNode;
5
+ current?: boolean;
6
+ };
7
+ declare type PropKeys = keyof PaginationPageOwnProps;
8
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
9
+ declare type PaginationPageProps = PaginationPageOwnProps;
10
+ declare const propTypes: PropValidators<PropKeys>;
11
+ declare const allowedProps: AllowedPropKeys;
12
+ export type { PaginationPageProps };
13
+ export { propTypes, allowedProps };
14
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Pagination/PaginationButton/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,aAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,sBAAsB,CAAA;AAE5C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,mBAAmB,GAAG,sBAAsB,CAAA;AAEjD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CASvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAyC,CAAA;AAE7D,YAAY,EAAE,mBAAmB,EAAE,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,10 +1,9 @@
1
1
  /** @jsx jsx */
2
- import { Component } from 'react';
3
- import PropTypes from 'prop-types';
2
+ import React, { Component } from 'react';
4
3
  import { jsx } from '@instructure/emotion';
5
4
  import { PaginationButton } from './PaginationButton';
6
5
  import { PaginationArrowButton } from './PaginationArrowButton';
7
- import { PaginationProps } from './types';
6
+ import type { PaginationProps } from './props';
8
7
  /**
9
8
  ---
10
9
  category: components
@@ -12,65 +11,32 @@ category: components
12
11
  **/
13
12
  declare class Pagination extends Component<PaginationProps> {
14
13
  static readonly componentId = "Pagination";
15
- static propTypes: {
16
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
17
- styles: PropTypes.Requireable<object>;
18
- /**
19
- * children of type Pagination.Page
20
- */
21
- children: {
22
- (props: Record<string, any>, propName: string, componentName: string): Error | null;
23
- isRequired: (props: Record<string, any>, propName: string, componentName: string, location?: string | undefined, propFullName?: string | undefined) => Error | null;
24
- };
25
- /**
26
- * Disables interaction with all pages
27
- */
28
- disabled: PropTypes.Requireable<boolean>;
29
- /**
30
- * Visible label for component
31
- */
32
- label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
33
- /**
34
- * Accessible label for next button
35
- */
36
- labelNext: PropTypes.Requireable<string>;
37
- /**
38
- * Accessible label for previous button
39
- */
40
- labelPrev: PropTypes.Requireable<string>;
41
- /**
42
- * The compact variant truncates the page navigation to show only the first,
43
- * last, and pages immediately surrounding the current page. Fewer than 5 pages,
44
- * no next/previous arrow buttons will be shown, and all pages will be listed
45
- */
46
- variant: PropTypes.Requireable<string>;
47
- /**
48
- * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
49
- * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
50
- * familiar CSS-like shorthand. For example: `margin="small auto large"`.
51
- */
52
- margin: (props: any, propName: any, componentName: any, location: any) => any;
53
- /**
54
- * the element type to render as
55
- */
56
- as: PropTypes.Requireable<PropTypes.ReactComponentLike>;
57
- /**
58
- * provides a reference to the underlying html root element
59
- */
60
- elementRef: PropTypes.Requireable<(...args: any[]) => any>;
61
- /**
62
- * For accessibility, Pagination sets focus on the first or last Pagination.Pages,
63
- * respectively, when the Previous or Next arrow buttons are removed from the DOM.
64
- * Set this property to `false` to prevent this behavior.
65
- */
66
- shouldHandleFocus: PropTypes.Requireable<boolean>;
67
- };
14
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
15
+ children?: React.ReactNode;
16
+ disabled?: boolean | undefined;
17
+ label?: React.ReactNode;
18
+ labelNext?: string | undefined;
19
+ labelPrev?: string | undefined;
20
+ variant?: "full" | "compact" | undefined;
21
+ margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
22
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
23
+ elementRef?: ((...args: any[]) => any) | undefined;
24
+ shouldHandleFocus?: boolean | undefined;
25
+ }>;
26
+ static allowedProps: readonly (keyof {
27
+ children?: React.ReactNode;
28
+ disabled?: boolean | undefined;
29
+ label?: React.ReactNode;
30
+ labelNext?: string | undefined;
31
+ labelPrev?: string | undefined;
32
+ variant?: "full" | "compact" | undefined;
33
+ margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
34
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
35
+ elementRef?: ((...args: any[]) => any) | undefined;
36
+ shouldHandleFocus?: boolean | undefined;
37
+ })[];
68
38
  static defaultProps: {
69
39
  children: null;
70
- label: undefined;
71
- labelNext: undefined;
72
- labelPrev: undefined;
73
- margin: undefined;
74
40
  disabled: boolean;
75
41
  variant: string;
76
42
  as: string;