@atlaskit/pagination 16.3.1 → 17.0.1
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 +35 -0
- package/dist/cjs/pagination.js +1 -1
- package/dist/es2019/pagination.js +1 -1
- package/dist/esm/pagination.js +1 -1
- package/package.json +16 -23
- package/pagination/package.json +1 -8
- package/pagination.docs.tsx +41 -39
- package/types/package.json +1 -8
- package/dist/types-ts4.5/entry-points/pagination.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -2
- package/dist/types-ts4.5/internal/components/navigator.d.ts +0 -20
- package/dist/types-ts4.5/internal/components/page.d.ts +0 -17
- package/dist/types-ts4.5/internal/components/render-ellipsis.d.ts +0 -9
- package/dist/types-ts4.5/internal/constants.d.ts +0 -1
- package/dist/types-ts4.5/internal/utils/collapse-range.d.ts +0 -12
- package/dist/types-ts4.5/pagination.d.ts +0 -15
- package/dist/types-ts4.5/types.d.ts +0 -92
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @atlaskit/pagination
|
|
2
2
|
|
|
3
|
+
## 17.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ee28cf33718b0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ee28cf33718b0) -
|
|
8
|
+
Add @atlassian/react-compiler-gating as a runtime dependency to enable React Compiler platform
|
|
9
|
+
gating.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 17.0.0
|
|
13
|
+
|
|
14
|
+
### Major Changes
|
|
15
|
+
|
|
16
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
17
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
18
|
+
|
|
19
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
20
|
+
|
|
21
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
22
|
+
|
|
23
|
+
```diff
|
|
24
|
+
- "typesVersions": {
|
|
25
|
+
- ">=4.5 <4.9": {
|
|
26
|
+
- "*": [
|
|
27
|
+
- "dist/types-ts4.5/*",
|
|
28
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
29
|
+
- ]
|
|
30
|
+
- }
|
|
31
|
+
- },
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Updated dependencies
|
|
37
|
+
|
|
3
38
|
## 16.3.1
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
package/dist/cjs/pagination.js
CHANGED
|
@@ -34,7 +34,7 @@ var styles = {
|
|
|
34
34
|
var analyticsAttributes = {
|
|
35
35
|
componentName: 'pagination',
|
|
36
36
|
packageName: "@atlaskit/pagination",
|
|
37
|
-
packageVersion: "
|
|
37
|
+
packageVersion: "17.0.0"
|
|
38
38
|
};
|
|
39
39
|
function NavigatorIcon(_ref) {
|
|
40
40
|
var chevronDirection = _ref.chevronDirection;
|
package/dist/esm/pagination.js
CHANGED
|
@@ -25,7 +25,7 @@ var styles = {
|
|
|
25
25
|
var analyticsAttributes = {
|
|
26
26
|
componentName: 'pagination',
|
|
27
27
|
packageName: "@atlaskit/pagination",
|
|
28
|
-
packageVersion: "
|
|
28
|
+
packageVersion: "17.0.0"
|
|
29
29
|
};
|
|
30
30
|
function NavigatorIcon(_ref) {
|
|
31
31
|
var chevronDirection = _ref.chevronDirection;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/pagination",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.1",
|
|
4
4
|
"description": "Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -13,14 +13,6 @@
|
|
|
13
13
|
"module": "dist/esm/index.js",
|
|
14
14
|
"module:es2019": "dist/es2019/index.js",
|
|
15
15
|
"types": "dist/types/index.d.ts",
|
|
16
|
-
"typesVersions": {
|
|
17
|
-
">=4.5 <4.9": {
|
|
18
|
-
"*": [
|
|
19
|
-
"dist/types-ts4.5/*",
|
|
20
|
-
"dist/types-ts4.5/index.d.ts"
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
16
|
"sideEffects": [
|
|
25
17
|
"**/*.compiled.css"
|
|
26
18
|
],
|
|
@@ -40,14 +32,15 @@
|
|
|
40
32
|
}
|
|
41
33
|
},
|
|
42
34
|
"dependencies": {
|
|
43
|
-
"@atlaskit/analytics-next": "^
|
|
44
|
-
"@atlaskit/button": "^
|
|
45
|
-
"@atlaskit/css": "^0.
|
|
46
|
-
"@atlaskit/ds-lib": "^
|
|
47
|
-
"@atlaskit/icon": "^
|
|
48
|
-
"@atlaskit/primitives": "^
|
|
49
|
-
"@atlaskit/tokens": "^
|
|
50
|
-
"@atlaskit/visually-hidden": "^
|
|
35
|
+
"@atlaskit/analytics-next": "^12.0.0",
|
|
36
|
+
"@atlaskit/button": "^24.1.0",
|
|
37
|
+
"@atlaskit/css": "^1.0.0",
|
|
38
|
+
"@atlaskit/ds-lib": "^8.0.0",
|
|
39
|
+
"@atlaskit/icon": "^36.0.0",
|
|
40
|
+
"@atlaskit/primitives": "^20.0.0",
|
|
41
|
+
"@atlaskit/tokens": "^15.0.0",
|
|
42
|
+
"@atlaskit/visually-hidden": "^4.0.0",
|
|
43
|
+
"@atlassian/react-compiler-gating": "^0.2.0",
|
|
51
44
|
"@babel/runtime": "^7.0.0",
|
|
52
45
|
"memoize-one": "^6.0.0"
|
|
53
46
|
},
|
|
@@ -58,16 +51,16 @@
|
|
|
58
51
|
"@af/accessibility-testing": "workspace:^",
|
|
59
52
|
"@af/integration-testing": "workspace:^",
|
|
60
53
|
"@af/visual-regression": "workspace:^",
|
|
61
|
-
"@atlaskit/code": "^
|
|
62
|
-
"@atlaskit/docs": "^
|
|
63
|
-
"@atlaskit/heading": "^
|
|
64
|
-
"@atlaskit/link": "^
|
|
65
|
-
"@atlaskit/section-message": "^
|
|
66
|
-
"@atlassian/react-compiler-gating": "workspace:^",
|
|
54
|
+
"@atlaskit/code": "^18.0.0",
|
|
55
|
+
"@atlaskit/docs": "^12.0.0",
|
|
56
|
+
"@atlaskit/heading": "^6.0.0",
|
|
57
|
+
"@atlaskit/link": "^4.0.0",
|
|
58
|
+
"@atlaskit/section-message": "^9.1.0",
|
|
67
59
|
"@atlassian/ssr-tests": "workspace:^",
|
|
68
60
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
69
61
|
"@testing-library/dom": "^10.1.0",
|
|
70
62
|
"@testing-library/react": "^16.3.0",
|
|
63
|
+
"react": "^18.2.0",
|
|
71
64
|
"react-dom": "^18.2.0"
|
|
72
65
|
},
|
|
73
66
|
"techstack": {
|
package/pagination/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/pagination.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/pagination.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/pagination.d.ts"
|
|
17
10
|
}
|
package/pagination.docs.tsx
CHANGED
|
@@ -1,47 +1,49 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
|
|
4
4
|
|
|
5
|
-
const documentation:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
description: 'A component for pagination controls.',
|
|
9
|
-
status: 'general-availability',
|
|
10
|
-
import: {
|
|
5
|
+
const documentation: StructuredContentSource = {
|
|
6
|
+
components: [
|
|
7
|
+
{
|
|
11
8
|
name: 'Pagination',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
packageJson: require('./package.json'),
|
|
16
|
-
},
|
|
17
|
-
usageGuidelines: [
|
|
18
|
-
'Use for navigating through paged content',
|
|
19
|
-
'Provide clear page indicators',
|
|
20
|
-
'Consider total page count display',
|
|
21
|
-
'Use appropriate page limits',
|
|
22
|
-
],
|
|
23
|
-
contentGuidelines: [
|
|
24
|
-
'Use clear page labels',
|
|
25
|
-
'Provide meaningful navigation text',
|
|
26
|
-
'Use consistent pagination terminology',
|
|
27
|
-
'Consider page context information',
|
|
28
|
-
],
|
|
29
|
-
accessibilityGuidelines: [
|
|
30
|
-
'Provide clear page navigation labels',
|
|
31
|
-
'Use appropriate ARIA labels for pagination',
|
|
32
|
-
'Ensure keyboard navigation support',
|
|
33
|
-
'Announce page changes to screen readers',
|
|
34
|
-
],
|
|
35
|
-
examples: [
|
|
36
|
-
{
|
|
9
|
+
description: 'A component for pagination controls.',
|
|
10
|
+
status: 'general-availability',
|
|
11
|
+
import: {
|
|
37
12
|
name: 'Pagination',
|
|
38
|
-
|
|
39
|
-
|
|
13
|
+
package: '@atlaskit/pagination',
|
|
14
|
+
type: 'default',
|
|
15
|
+
packagePath: path.resolve(__dirname),
|
|
16
|
+
packageJson: require('./package.json'),
|
|
40
17
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
18
|
+
usageGuidelines: [
|
|
19
|
+
'Use for navigating through paged content',
|
|
20
|
+
'Provide clear page indicators',
|
|
21
|
+
'Consider total page count display',
|
|
22
|
+
'Use appropriate page limits',
|
|
23
|
+
],
|
|
24
|
+
contentGuidelines: [
|
|
25
|
+
'Use clear page labels',
|
|
26
|
+
'Provide meaningful navigation text',
|
|
27
|
+
'Use consistent pagination terminology',
|
|
28
|
+
'Consider page context information',
|
|
29
|
+
],
|
|
30
|
+
accessibilityGuidelines: [
|
|
31
|
+
'Provide clear page navigation labels',
|
|
32
|
+
'Use appropriate ARIA labels for pagination',
|
|
33
|
+
'Ensure keyboard navigation support',
|
|
34
|
+
'Announce page changes to screen readers',
|
|
35
|
+
],
|
|
36
|
+
examples: [
|
|
37
|
+
{
|
|
38
|
+
name: 'Pagination',
|
|
39
|
+
description: 'Pagination example',
|
|
40
|
+
source: path.resolve(__dirname, './examples/ai/pagination.tsx'),
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
keywords: ['pagination', 'pages', 'navigation', 'paging', 'controls'],
|
|
44
|
+
categories: ['navigation'],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
46
48
|
|
|
47
49
|
export default documentation;
|
package/types/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
17
10
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '../pagination';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { PaginationPropTypes } from '../types';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { type ReactElement, type SyntheticEvent } from 'react';
|
|
2
|
-
type NavigatorProps = {
|
|
3
|
-
/**
|
|
4
|
-
* This will be passed in as aria-label to the button. Use this to supply a descriptive label for assistive technology.
|
|
5
|
-
*/
|
|
6
|
-
'aria-label'?: string;
|
|
7
|
-
/**
|
|
8
|
-
* Sets whether the navigator is disabled.
|
|
9
|
-
*/
|
|
10
|
-
isDisabled?: boolean;
|
|
11
|
-
iconBefore: ReactElement;
|
|
12
|
-
testId?: string;
|
|
13
|
-
/**
|
|
14
|
-
* This function is called when the user clicks on the navigator.
|
|
15
|
-
*/
|
|
16
|
-
onClick?: (event: SyntheticEvent) => void;
|
|
17
|
-
component?: React.ElementType<any>;
|
|
18
|
-
};
|
|
19
|
-
export default function Navigator(props: NavigatorProps): React.JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type ButtonProps } from '@atlaskit/button/standard-button';
|
|
3
|
-
import type { Appearance } from '@atlaskit/button/types';
|
|
4
|
-
type Diff<T, U> = T extends U ? never : T;
|
|
5
|
-
type PageProps = Diff<ButtonProps, {
|
|
6
|
-
appearance?: Appearance;
|
|
7
|
-
autoFocus: boolean;
|
|
8
|
-
isDisabled: boolean;
|
|
9
|
-
isLoading: boolean;
|
|
10
|
-
spacing: 'compact' | 'default' | 'none';
|
|
11
|
-
shouldFitContainer: boolean;
|
|
12
|
-
type: 'button' | 'submit';
|
|
13
|
-
}> & {
|
|
14
|
-
page?: any;
|
|
15
|
-
};
|
|
16
|
-
export default function Page(props: PageProps): React.JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const emptyObject: {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type ReactElement } from 'react';
|
|
2
|
-
declare const collapseRange: <T>(pages: Array<T>, current: number, { max, ellipsis, transform, }: {
|
|
3
|
-
max: number;
|
|
4
|
-
ellipsis: (arg: {
|
|
5
|
-
key: string;
|
|
6
|
-
testId?: string;
|
|
7
|
-
from: number;
|
|
8
|
-
to: number;
|
|
9
|
-
}) => ReactElement;
|
|
10
|
-
transform: (page: T, index: number, testId?: string) => ReactElement;
|
|
11
|
-
}, testId?: string) => ReactElement[];
|
|
12
|
-
export default collapseRange;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type PaginationPropTypes } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* __Pagination__
|
|
5
|
-
*
|
|
6
|
-
* Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.
|
|
7
|
-
*
|
|
8
|
-
* - [Examples](https://atlassian.design/components/pagination/examples)
|
|
9
|
-
* - [Code](https://atlassian.design/components/pagination/code)
|
|
10
|
-
* - [Usage](https://atlassian.design/components/pagination/usage)
|
|
11
|
-
*/
|
|
12
|
-
declare const Pagination: <T>(props: PaginationPropTypes<T> & {
|
|
13
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
14
|
-
}) => React.ReactElement;
|
|
15
|
-
export default Pagination;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactElement, SyntheticEvent } from 'react';
|
|
2
|
-
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
export interface PaginationPropTypes<T = unknown> {
|
|
4
|
-
/**
|
|
5
|
-
* Replace the built-in page, previous, next and/ or ellipsis component
|
|
6
|
-
*/
|
|
7
|
-
components?: {
|
|
8
|
-
Page?: React.ElementType;
|
|
9
|
-
Previous?: React.ElementType;
|
|
10
|
-
Next?: React.ElementType;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Index of the page to be selected by default.
|
|
14
|
-
*/
|
|
15
|
-
defaultSelectedIndex?: number;
|
|
16
|
-
/**
|
|
17
|
-
* Helper function to get text displayed on the page button. This is helpful in scenarios when page the page passed in is an object.
|
|
18
|
-
*/
|
|
19
|
-
getPageLabel?: (page: T, pageIndex: number) => number | string;
|
|
20
|
-
/**
|
|
21
|
-
* The aria-label for the pagination nav wrapper.
|
|
22
|
-
* The default value is "pagination".
|
|
23
|
-
*/
|
|
24
|
-
label?: string;
|
|
25
|
-
/**
|
|
26
|
-
* The aria-label for the next button.
|
|
27
|
-
* The default value is "next".
|
|
28
|
-
*/
|
|
29
|
-
nextLabel?: string;
|
|
30
|
-
/**
|
|
31
|
-
* The aria-label for the individual page numbers.
|
|
32
|
-
* The default value is "page".
|
|
33
|
-
* The page number is automatically appended to the pageLabel.
|
|
34
|
-
* For Example, pageLabel="página" will render aria-label="página 1"
|
|
35
|
-
* as the label for page 1.
|
|
36
|
-
*/
|
|
37
|
-
pageLabel?: string;
|
|
38
|
-
/**
|
|
39
|
-
* The aria-label for the previous button.
|
|
40
|
-
* The default value is "previous".
|
|
41
|
-
*/
|
|
42
|
-
previousLabel?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Style to spread on the container element.
|
|
45
|
-
*/
|
|
46
|
-
style?: CSSProperties;
|
|
47
|
-
/**
|
|
48
|
-
* Maximum number of pages to be displayed in the pagination.
|
|
49
|
-
*/
|
|
50
|
-
max?: number;
|
|
51
|
-
/**
|
|
52
|
-
* The onChange handler which is called when the page is changed.
|
|
53
|
-
*/
|
|
54
|
-
onChange?: (event: SyntheticEvent, page: T, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
55
|
-
/**
|
|
56
|
-
* Array of the pages to display.
|
|
57
|
-
*/
|
|
58
|
-
pages: T[];
|
|
59
|
-
/**
|
|
60
|
-
* Index of the selected page. This will make this pagination controlled.
|
|
61
|
-
*/
|
|
62
|
-
selectedIndex?: number;
|
|
63
|
-
/**
|
|
64
|
-
* The react Node returned from the function is rendered instead of the default ellipsis node.
|
|
65
|
-
*/
|
|
66
|
-
renderEllipsis?: (arg: {
|
|
67
|
-
key: string;
|
|
68
|
-
from: number;
|
|
69
|
-
to: number;
|
|
70
|
-
}) => ReactElement;
|
|
71
|
-
/**
|
|
72
|
-
* Additional information to be included in the `context` of analytics events.
|
|
73
|
-
*/
|
|
74
|
-
analyticsContext?: Record<string, any>;
|
|
75
|
-
/**
|
|
76
|
-
* A `testId` prop is provided for specified elements,
|
|
77
|
-
* which is a unique string that appears as a data attribute `data-testid`
|
|
78
|
-
* in the rendered code, serving as a hook for automated tests.
|
|
79
|
-
*
|
|
80
|
-
* Will set data-testid on these elements when defined:
|
|
81
|
-
* - Pagination nav wrapper - {testId}
|
|
82
|
-
* - Page - {testId}--page-{page index}
|
|
83
|
-
* - Current page - {testId}--current-page-{page index}
|
|
84
|
-
* - Left navigator - {testId}--left-navigator
|
|
85
|
-
* - Right navigator - {testId}--right-navigator
|
|
86
|
-
*/
|
|
87
|
-
testId?: string;
|
|
88
|
-
/**
|
|
89
|
-
* Sets whether the Paginator is disabled
|
|
90
|
-
*/
|
|
91
|
-
isDisabled?: boolean;
|
|
92
|
-
}
|