@atlaskit/pagination 14.7.2 → 14.7.3

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
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/pagination
2
2
 
3
+ ## 14.7.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 14.7.2
4
10
 
5
11
  ### Patch Changes
@@ -20,7 +26,7 @@
20
26
 
21
27
  - [#96694](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/96694)
22
28
  [`336e03a3c58a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/336e03a3c58a) -
23
- Add support for React 18.
29
+ Add support for React 18 in non-strict mode.
24
30
 
25
31
  ## 14.6.6
26
32
 
package/README.md CHANGED
@@ -10,4 +10,5 @@ yarn add @atlaskit/pagination
10
10
 
11
11
  ## Usage
12
12
 
13
- Detailed docs and example usage can be found [here](https://atlassian.design/components/pagination/).
13
+ Detailed docs and example usage can be found
14
+ [here](https://atlassian.design/components/pagination/).
@@ -1,71 +1,61 @@
1
1
  import React from 'react';
2
2
 
3
3
  import { findByText, fireEvent } from '@testing-library/dom';
4
- import {
5
- type InteractionTaskArgs,
6
- type PublicInteractionTask,
7
- } from 'storybook-addon-performance';
4
+ import { type InteractionTaskArgs, type PublicInteractionTask } from 'storybook-addon-performance';
8
5
  import invariant from 'tiny-invariant';
9
6
 
10
7
  import Pagination from '../src';
11
8
 
12
9
  const getPageElement = (
13
- container: HTMLElement,
14
- textContent: string,
10
+ container: HTMLElement,
11
+ textContent: string,
15
12
  ): HTMLButtonElement | undefined =>
16
- Array.from(container.querySelectorAll('button')).find(
17
- (buttonElement: HTMLButtonElement) =>
18
- buttonElement.textContent?.trim() === textContent,
19
- );
13
+ Array.from(container.querySelectorAll('button')).find(
14
+ (buttonElement: HTMLButtonElement) => buttonElement.textContent?.trim() === textContent,
15
+ );
20
16
 
21
17
  const PaginationPerformance = () => {
22
- return <Pagination pages={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]} />;
18
+ return <Pagination pages={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]} />;
23
19
  };
24
20
 
25
21
  const interactionTasks: PublicInteractionTask[] = [
26
- {
27
- name: 'onChange (when ellipsis changes)',
28
- description: 'Render pagination and change page along with ellipsis',
29
- run: async ({
30
- container,
31
- controls,
32
- }: InteractionTaskArgs): Promise<void> => {
33
- const lastPageElement = getPageElement(container, '10');
34
-
35
- invariant(lastPageElement);
36
-
37
- await controls.time(async () => {
38
- fireEvent.click(lastPageElement!);
39
-
40
- await findByText(container, '9', undefined, { timeout: 20000 });
41
- });
42
- },
43
- },
44
- {
45
- name: `onChange (when ellipsis don't change)`,
46
- description: 'Render pagination and change page',
47
- run: async ({
48
- container,
49
- controls,
50
- }: InteractionTaskArgs): Promise<void> => {
51
- const secondPageElement = getPageElement(container, '2');
52
-
53
- invariant(secondPageElement);
54
-
55
- await controls.time(async () => {
56
- fireEvent.click(secondPageElement!);
57
- });
58
- },
59
- },
22
+ {
23
+ name: 'onChange (when ellipsis changes)',
24
+ description: 'Render pagination and change page along with ellipsis',
25
+ run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
26
+ const lastPageElement = getPageElement(container, '10');
27
+
28
+ invariant(lastPageElement);
29
+
30
+ await controls.time(async () => {
31
+ fireEvent.click(lastPageElement!);
32
+
33
+ await findByText(container, '9', undefined, { timeout: 20000 });
34
+ });
35
+ },
36
+ },
37
+ {
38
+ name: `onChange (when ellipsis don't change)`,
39
+ description: 'Render pagination and change page',
40
+ run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
41
+ const secondPageElement = getPageElement(container, '2');
42
+
43
+ invariant(secondPageElement);
44
+
45
+ await controls.time(async () => {
46
+ fireEvent.click(secondPageElement!);
47
+ });
48
+ },
49
+ },
60
50
  ];
61
51
 
62
52
  PaginationPerformance.story = {
63
- name: 'pagination',
64
- parameters: {
65
- performance: {
66
- interactions: interactionTasks,
67
- },
68
- },
53
+ name: 'pagination',
54
+ parameters: {
55
+ performance: {
56
+ interactions: interactionTasks,
57
+ },
58
+ },
69
59
  };
70
60
 
71
61
  export default PaginationPerformance;
@@ -1,71 +1,61 @@
1
1
  import React from 'react';
2
2
 
3
3
  import { findByText, fireEvent } from '@testing-library/dom';
4
- import {
5
- type InteractionTaskArgs,
6
- type PublicInteractionTask,
7
- } from 'storybook-addon-performance';
4
+ import { type InteractionTaskArgs, type PublicInteractionTask } from 'storybook-addon-performance';
8
5
  import invariant from 'tiny-invariant';
9
6
 
10
7
  import Pagination from '../src';
11
8
 
12
9
  const getPageElement = (
13
- container: HTMLElement,
14
- textContent: string,
10
+ container: HTMLElement,
11
+ textContent: string,
15
12
  ): HTMLButtonElement | undefined =>
16
- Array.from(container.querySelectorAll('button')).find(
17
- (buttonElement: HTMLButtonElement) =>
18
- buttonElement.textContent?.trim() === textContent,
19
- );
13
+ Array.from(container.querySelectorAll('button')).find(
14
+ (buttonElement: HTMLButtonElement) => buttonElement.textContent?.trim() === textContent,
15
+ );
20
16
  const pages1000 = new Array(1000).fill(0).map((p, index) => index + 1 + p);
21
17
  const PaginationPerformanceWith1000Pages = () => {
22
- return <Pagination pages={pages1000} />;
18
+ return <Pagination pages={pages1000} />;
23
19
  };
24
20
 
25
21
  const interactionTasks: PublicInteractionTask[] = [
26
- {
27
- name: 'onChange (when ellipsis changes)',
28
- description: 'Render pagination and change page along with ellipsis',
29
- run: async ({
30
- container,
31
- controls,
32
- }: InteractionTaskArgs): Promise<void> => {
33
- const lastPageElement = getPageElement(container, '1000');
34
-
35
- invariant(lastPageElement);
36
-
37
- await controls.time(async () => {
38
- fireEvent.click(lastPageElement!);
39
-
40
- await findByText(container, '999', undefined, { timeout: 20000 });
41
- });
42
- },
43
- },
44
- {
45
- name: `onChange (when ellipsis don't change)`,
46
- description: 'Render pagination and change page',
47
- run: async ({
48
- container,
49
- controls,
50
- }: InteractionTaskArgs): Promise<void> => {
51
- const secondPageElement = getPageElement(container, '2');
52
-
53
- invariant(secondPageElement);
54
-
55
- await controls.time(async () => {
56
- fireEvent.click(secondPageElement!);
57
- });
58
- },
59
- },
22
+ {
23
+ name: 'onChange (when ellipsis changes)',
24
+ description: 'Render pagination and change page along with ellipsis',
25
+ run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
26
+ const lastPageElement = getPageElement(container, '1000');
27
+
28
+ invariant(lastPageElement);
29
+
30
+ await controls.time(async () => {
31
+ fireEvent.click(lastPageElement!);
32
+
33
+ await findByText(container, '999', undefined, { timeout: 20000 });
34
+ });
35
+ },
36
+ },
37
+ {
38
+ name: `onChange (when ellipsis don't change)`,
39
+ description: 'Render pagination and change page',
40
+ run: async ({ container, controls }: InteractionTaskArgs): Promise<void> => {
41
+ const secondPageElement = getPageElement(container, '2');
42
+
43
+ invariant(secondPageElement);
44
+
45
+ await controls.time(async () => {
46
+ fireEvent.click(secondPageElement!);
47
+ });
48
+ },
49
+ },
60
50
  ];
61
51
 
62
52
  PaginationPerformanceWith1000Pages.story = {
63
- name: 'paginationWithLargeNumberOfPages',
64
- parameters: {
65
- performance: {
66
- interactions: interactionTasks,
67
- },
68
- },
53
+ name: 'paginationWithLargeNumberOfPages',
54
+ parameters: {
55
+ performance: {
56
+ interactions: interactionTasks,
57
+ },
58
+ },
69
59
  };
70
60
 
71
61
  export default PaginationPerformanceWith1000Pages;
@@ -1,34 +1,27 @@
1
1
  import { type JSCodeshift } from 'jscodeshift';
2
2
  import { type Collection } from 'jscodeshift/src/Collection';
3
3
 
4
- import {
5
- createTransformer,
6
- hasImportDeclaration,
7
- } from '@atlaskit/codemod-utils';
4
+ import { createTransformer, hasImportDeclaration } from '@atlaskit/codemod-utils';
8
5
 
9
6
  import { flattenI18nInnerPropsAsProp } from './migrations/flatten-i18n-props';
10
7
  import { removeCollapseRange } from './migrations/remove-collapase-range';
11
8
  import { removeI18nProps } from './migrations/remove-i18n-props';
12
9
  import { renameInnerStylesProps } from './migrations/rename-inner-styles-props';
13
10
  import { renamePaginationPropTypeToPaginationProps } from './migrations/rename-pagination-prop-types';
14
- import {
15
- renameNextProp,
16
- renamePrevProp,
17
- } from './migrations/rename-prev-next-label';
11
+ import { renameNextProp, renamePrevProp } from './migrations/rename-prev-next-label';
18
12
 
19
13
  const PAGINATION_PACKAGE = '@atlaskit/pagination';
20
14
  const transformer = createTransformer(
21
- [
22
- renameInnerStylesProps,
23
- renamePaginationPropTypeToPaginationProps,
24
- flattenI18nInnerPropsAsProp,
25
- removeI18nProps,
26
- renameNextProp,
27
- renamePrevProp,
28
- removeCollapseRange,
29
- ],
30
- (j: JSCodeshift, source: Collection<Node>) =>
31
- hasImportDeclaration(j, source, PAGINATION_PACKAGE),
15
+ [
16
+ renameInnerStylesProps,
17
+ renamePaginationPropTypeToPaginationProps,
18
+ flattenI18nInnerPropsAsProp,
19
+ removeI18nProps,
20
+ renameNextProp,
21
+ renamePrevProp,
22
+ removeCollapseRange,
23
+ ],
24
+ (j: JSCodeshift, source: Collection<Node>) => hasImportDeclaration(j, source, PAGINATION_PACKAGE),
32
25
  );
33
26
 
34
27
  export default transformer;
@@ -5,10 +5,10 @@ import transformer from '../14.0.0-lite-mode';
5
5
  const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
6
6
 
7
7
  describe('Pagination code-mods', () => {
8
- defineInlineTest(
9
- { default: transformer, parser: 'tsx' },
10
- {},
11
- `
8
+ defineInlineTest(
9
+ { default: transformer, parser: 'tsx' },
10
+ {},
11
+ `
12
12
  import React from 'react';
13
13
  import Pagination from '@atlaskit/pagination';
14
14
  import type { PaginationPropTypes } from '@atlaskit/pagination';
@@ -26,7 +26,7 @@ describe('Pagination code-mods', () => {
26
26
  );
27
27
  }
28
28
  `,
29
- `/* TODO: (from codemod) Pagination i18n prop has now been removed and we have tried to flatten its child prev & next as a standalone props.
29
+ `/* TODO: (from codemod) Pagination i18n prop has now been removed and we have tried to flatten its child prev & next as a standalone props.
30
30
  There may be cases in which codemod might not automatically flat i18n prop of Pagination and have to be handled manually. */
31
31
  /* TODO: (from codemod) Pagination collapseRange prop has now been removed to achieve more performance.
32
32
  We have not replaced 'collapseRange' with an equivalent API due to its minimal usage and prevent unwanted customisation.
@@ -48,6 +48,6 @@ describe('Pagination code-mods', () => {
48
48
  );
49
49
  }
50
50
  `,
51
- 'should rename innerStyles to style, PaginationPropTypes to PaginationProps and add an alias to PaginationProps, also elevate i18n prev, next inner props, rename to prevLabel, nextLabel prop and remove collapseRange prop',
52
- );
51
+ 'should rename innerStyles to style, PaginationPropTypes to PaginationProps and add an alias to PaginationProps, also elevate i18n prev, next inner props, rename to prevLabel, nextLabel prop and remove collapseRange prop',
52
+ );
53
53
  });
@@ -9,10 +9,10 @@ const transformer = createTransformer([flattenI18nInnerPropsAsProp]);
9
9
  const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
10
10
 
11
11
  describe('Flatten i18n inner props', () => {
12
- defineInlineTest(
13
- { default: transformer, parser: 'tsx' },
14
- {},
15
- `
12
+ defineInlineTest(
13
+ { default: transformer, parser: 'tsx' },
14
+ {},
15
+ `
16
16
  import React from 'react';
17
17
  import Pagination from '@atlaskit/pagination';
18
18
  const SimplePagination = () => {
@@ -24,7 +24,7 @@ describe('Flatten i18n inner props', () => {
24
24
  );
25
25
  };
26
26
  `,
27
- `
27
+ `
28
28
  import React from 'react';
29
29
  import Pagination from '@atlaskit/pagination';
30
30
  const SimplePagination = () => {
@@ -38,13 +38,13 @@ describe('Flatten i18n inner props', () => {
38
38
  );
39
39
  };
40
40
  `,
41
- 'should flatten prev & next properties in i18n props as a new standalone props',
42
- );
41
+ 'should flatten prev & next properties in i18n props as a new standalone props',
42
+ );
43
43
 
44
- defineInlineTest(
45
- { default: transformer, parser: 'tsx' },
46
- {},
47
- `
44
+ defineInlineTest(
45
+ { default: transformer, parser: 'tsx' },
46
+ {},
47
+ `
48
48
  import React from 'react';
49
49
  import Pagination from '@atlaskit/pagination';
50
50
 
@@ -60,7 +60,7 @@ describe('Flatten i18n inner props', () => {
60
60
  );
61
61
  };
62
62
  `,
63
- `
63
+ `
64
64
  import React from 'react';
65
65
  import Pagination from '@atlaskit/pagination';
66
66
 
@@ -78,13 +78,13 @@ describe('Flatten i18n inner props', () => {
78
78
  );
79
79
  };
80
80
  `,
81
- 'should flatten prev & next object properties in i18n props as a new standalone props',
82
- );
81
+ 'should flatten prev & next object properties in i18n props as a new standalone props',
82
+ );
83
83
 
84
- defineInlineTest(
85
- { default: transformer, parser: 'tsx' },
86
- {},
87
- `
84
+ defineInlineTest(
85
+ { default: transformer, parser: 'tsx' },
86
+ {},
87
+ `
88
88
  import React from 'react';
89
89
  import Pagination from '@atlaskit/pagination';
90
90
  const message = {
@@ -100,7 +100,7 @@ describe('Flatten i18n inner props', () => {
100
100
  );
101
101
  };
102
102
  `,
103
- `
103
+ `
104
104
  import React from 'react';
105
105
  import Pagination from '@atlaskit/pagination';
106
106
  const message = {
@@ -116,6 +116,6 @@ describe('Flatten i18n inner props', () => {
116
116
  );
117
117
  };
118
118
  `,
119
- 'should not flatten prev & next props if i18n value comming from a variable',
120
- );
119
+ 'should not flatten prev & next props if i18n value comming from a variable',
120
+ );
121
121
  });
@@ -8,10 +8,10 @@ const transformer = createTransformer([removeCollapseRange]);
8
8
  const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
9
9
 
10
10
  describe('Remove innerProps', () => {
11
- defineInlineTest(
12
- { default: transformer, parser: 'tsx' },
13
- {},
14
- `
11
+ defineInlineTest(
12
+ { default: transformer, parser: 'tsx' },
13
+ {},
14
+ `
15
15
  import React from 'react';
16
16
  import Pagination from '@atlaskit/pagination';
17
17
  const SimplePagination = () => {
@@ -24,7 +24,7 @@ describe('Remove innerProps', () => {
24
24
  );
25
25
  };
26
26
  `,
27
- `/* TODO: (from codemod) Pagination collapseRange prop has now been removed to achieve more performance.
27
+ `/* TODO: (from codemod) Pagination collapseRange prop has now been removed to achieve more performance.
28
28
  We have not replaced 'collapseRange' with an equivalent API due to its minimal usage and prevent unwanted customisation.
29
29
  As an alternate, can look for similar customistation via existing 'components' or 'renderEllipsis' prop */
30
30
  import React from 'react';
@@ -33,6 +33,6 @@ describe('Remove innerProps', () => {
33
33
  return <Pagination pages={[1,2,3,4]} testId="pagination" />;
34
34
  };
35
35
  `,
36
- 'should remove collapseRange props from Pagination',
37
- );
36
+ 'should remove collapseRange props from Pagination',
37
+ );
38
38
  });
@@ -8,10 +8,10 @@ const transformer = createTransformer([removeI18nProps]);
8
8
  const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
9
9
 
10
10
  describe('Remove innerProps', () => {
11
- defineInlineTest(
12
- { default: transformer, parser: 'tsx' },
13
- {},
14
- `
11
+ defineInlineTest(
12
+ { default: transformer, parser: 'tsx' },
13
+ {},
14
+ `
15
15
  import React from 'react';
16
16
  import Pagination from '@atlaskit/pagination';
17
17
  const SimplePagination = () => {
@@ -25,7 +25,7 @@ describe('Remove innerProps', () => {
25
25
  );
26
26
  };
27
27
  `,
28
- `
28
+ `
29
29
  /* TODO: (from codemod) Pagination i18n prop has now been removed and we have tried to flatten its child prev & next as a standalone props.
30
30
  There may be cases in which codemod might not automatically flat i18n prop of Pagination and have to be handled manually. */
31
31
  import React from 'react';
@@ -34,6 +34,6 @@ describe('Remove innerProps', () => {
34
34
  return <Pagination pages={[1,2,3,4]} testId="pagination" prev={'pr'} next={'ne'} />;
35
35
  };
36
36
  `,
37
- 'should remove i18n props from Pagination',
38
- );
37
+ 'should remove i18n props from Pagination',
38
+ );
39
39
  });
@@ -9,10 +9,10 @@ const transformer = createTransformer([renameInnerStylesProps]);
9
9
  const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
10
10
 
11
11
  describe('Rename innerStyles to style', () => {
12
- defineInlineTest(
13
- { default: transformer, parser: 'tsx' },
14
- {},
15
- `
12
+ defineInlineTest(
13
+ { default: transformer, parser: 'tsx' },
14
+ {},
15
+ `
16
16
  import React from 'react';
17
17
  import Pagination from '@atlaskit/pagination';
18
18
 
@@ -27,7 +27,7 @@ describe('Rename innerStyles to style', () => {
27
27
  );
28
28
  }
29
29
  `,
30
- `
30
+ `
31
31
  import React from 'react';
32
32
  import Pagination from '@atlaskit/pagination';
33
33
 
@@ -42,6 +42,6 @@ describe('Rename innerStyles to style', () => {
42
42
  );
43
43
  }
44
44
  `,
45
- 'should rename innerStyles prop to style prop',
46
- );
45
+ 'should rename innerStyles prop to style prop',
46
+ );
47
47
  });
@@ -4,54 +4,52 @@ import { createTransformer } from '@atlaskit/codemod-utils';
4
4
 
5
5
  import { renamePaginationPropTypeToPaginationProps } from '../migrations/rename-pagination-prop-types';
6
6
 
7
- const transformer = createTransformer([
8
- renamePaginationPropTypeToPaginationProps,
9
- ]);
7
+ const transformer = createTransformer([renamePaginationPropTypeToPaginationProps]);
10
8
 
11
9
  const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
12
10
 
13
11
  describe('Rename PaginationPropTypes to PaginationProps - with alias', () => {
14
- defineInlineTest(
15
- { default: transformer, parser: 'tsx' },
16
- {},
17
- `
12
+ defineInlineTest(
13
+ { default: transformer, parser: 'tsx' },
14
+ {},
15
+ `
18
16
  import React from 'react';
19
17
  import Pagination from '@atlaskit/pagination';
20
18
  import { PaginationPropTypes } from '@atlaskit/pagination';
21
19
  `,
22
- `
20
+ `
23
21
  import React from 'react';
24
22
  import Pagination from '@atlaskit/pagination';
25
23
  import { PaginationProps as PaginationPropTypes } from '@atlaskit/pagination';
26
24
  `,
27
- 'should rename PaginationPropTypes to PaginationProps - with alias ',
28
- );
25
+ 'should rename PaginationPropTypes to PaginationProps - with alias ',
26
+ );
29
27
 
30
- defineInlineTest(
31
- { default: transformer, parser: 'tsx' },
32
- {},
33
- `
28
+ defineInlineTest(
29
+ { default: transformer, parser: 'tsx' },
30
+ {},
31
+ `
34
32
  import React from 'react';
35
33
  import Pagination, { PaginationPropTypes } from '@atlaskit/pagination';
36
34
  `,
37
- `
35
+ `
38
36
  import React from 'react';
39
37
  import Pagination, { PaginationProps as PaginationPropTypes } from '@atlaskit/pagination';
40
38
  `,
41
- 'should rename PaginationPropTypes to PaginationProps with alias if it is there along with default import',
42
- );
39
+ 'should rename PaginationPropTypes to PaginationProps with alias if it is there along with default import',
40
+ );
43
41
 
44
- defineInlineTest(
45
- { default: transformer, parser: 'tsx' },
46
- {},
47
- `
42
+ defineInlineTest(
43
+ { default: transformer, parser: 'tsx' },
44
+ {},
45
+ `
48
46
  import React from 'react';
49
47
  import Pagination, { PaginationPropTypes as CustomPaginationPropTypes } from '@atlaskit/pagination';
50
48
  `,
51
- `
49
+ `
52
50
  import React from 'react';
53
51
  import Pagination, { PaginationProps as CustomPaginationPropTypes } from '@atlaskit/pagination';
54
52
  `,
55
- 'should preserve old alias name',
56
- );
53
+ 'should preserve old alias name',
54
+ );
57
55
  });
@@ -2,20 +2,17 @@ jest.autoMockOff();
2
2
 
3
3
  import { createTransformer } from '@atlaskit/codemod-utils';
4
4
 
5
- import {
6
- renameNextProp,
7
- renamePrevProp,
8
- } from '../migrations/rename-prev-next-label';
5
+ import { renameNextProp, renamePrevProp } from '../migrations/rename-prev-next-label';
9
6
 
10
7
  const transformer = createTransformer([renameNextProp, renamePrevProp]);
11
8
 
12
9
  const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
13
10
 
14
11
  describe('Rename previous and next label', () => {
15
- defineInlineTest(
16
- { default: transformer, parser: 'tsx' },
17
- {},
18
- `
12
+ defineInlineTest(
13
+ { default: transformer, parser: 'tsx' },
14
+ {},
15
+ `
19
16
  import React from 'react';
20
17
  import Pagination from '@atlaskit/pagination';
21
18
 
@@ -31,7 +28,7 @@ describe('Rename previous and next label', () => {
31
28
  );
32
29
  }
33
30
  `,
34
- `
31
+ `
35
32
  import React from 'react';
36
33
  import Pagination from '@atlaskit/pagination';
37
34
 
@@ -47,6 +44,6 @@ describe('Rename previous and next label', () => {
47
44
  );
48
45
  }
49
46
  `,
50
- 'should rename previous and next label to prevLabel and nextLabel',
51
- );
47
+ 'should rename previous and next label to prevLabel and nextLabel',
48
+ );
52
49
  });
@@ -1,7 +1,7 @@
1
1
  import { flattenCertainChildPropsAsProp } from '@atlaskit/codemod-utils';
2
2
 
3
3
  export const flattenI18nInnerPropsAsProp = flattenCertainChildPropsAsProp(
4
- '@atlaskit/pagination',
5
- 'i18n',
6
- ['prev', 'next'],
4
+ '@atlaskit/pagination',
5
+ 'i18n',
6
+ ['prev', 'next'],
7
7
  );
@@ -7,8 +7,4 @@ const comment = `Pagination collapseRange prop has now been removed to achieve m
7
7
  We have not replaced 'collapseRange' with an equivalent API due to its minimal usage and prevent unwanted customisation.
8
8
  As an alternate, can look for similar customistation via existing 'components' or 'renderEllipsis' prop`;
9
9
 
10
- export const removeCollapseRange = createRemoveFuncAddCommentFor(
11
- component,
12
- prop,
13
- comment,
14
- );
10
+ export const removeCollapseRange = createRemoveFuncAddCommentFor(component, prop, comment);
@@ -3,7 +3,7 @@ const comment = `Pagination i18n prop has now been removed and we have tried to
3
3
  There may be cases in which codemod might not automatically flat i18n prop of Pagination and have to be handled manually.`;
4
4
 
5
5
  export const removeI18nProps = createRemoveFuncAddCommentFor(
6
- '@atlaskit/pagination',
7
- 'i18n',
8
- comment,
6
+ '@atlaskit/pagination',
7
+ 'i18n',
8
+ comment,
9
9
  );
@@ -1,7 +1,7 @@
1
1
  import { createRenameFuncFor } from '@atlaskit/codemod-utils';
2
2
 
3
3
  export const renameInnerStylesProps = createRenameFuncFor(
4
- '@atlaskit/pagination',
5
- 'innerStyles',
6
- 'style',
4
+ '@atlaskit/pagination',
5
+ 'innerStyles',
6
+ 'style',
7
7
  );
@@ -1,8 +1,7 @@
1
1
  import { renameNamedImportWithAliasName } from '@atlaskit/codemod-utils';
2
2
 
3
- export const renamePaginationPropTypeToPaginationProps =
4
- renameNamedImportWithAliasName(
5
- '@atlaskit/pagination',
6
- 'PaginationPropTypes',
7
- 'PaginationProps',
8
- );
3
+ export const renamePaginationPropTypeToPaginationProps = renameNamedImportWithAliasName(
4
+ '@atlaskit/pagination',
5
+ 'PaginationPropTypes',
6
+ 'PaginationProps',
7
+ );
@@ -1,12 +1,4 @@
1
1
  import { createRenameFuncFor } from '@atlaskit/codemod-utils';
2
2
 
3
- export const renameNextProp = createRenameFuncFor(
4
- '@atlaskit/pagination',
5
- 'next',
6
- 'nextLabel',
7
- );
8
- export const renamePrevProp = createRenameFuncFor(
9
- '@atlaskit/pagination',
10
- 'prev',
11
- 'prevLabel',
12
- );
3
+ export const renameNextProp = createRenameFuncFor('@atlaskit/pagination', 'next', 'nextLabel');
4
+ export const renamePrevProp = createRenameFuncFor('@atlaskit/pagination', 'prev', 'prevLabel');
@@ -27,7 +27,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
27
27
  var analyticsAttributes = {
28
28
  componentName: 'pagination',
29
29
  packageName: "@atlaskit/pagination",
30
- packageVersion: "14.7.2"
30
+ packageVersion: "14.7.3"
31
31
  };
32
32
  var paginationMenuStyles = (0, _primitives.xcss)({
33
33
  padding: 'space.0',
@@ -13,7 +13,7 @@ import collapseRange from './internal/utils/collapse-range';
13
13
  const analyticsAttributes = {
14
14
  componentName: 'pagination',
15
15
  packageName: "@atlaskit/pagination",
16
- packageVersion: "14.7.2"
16
+ packageVersion: "14.7.3"
17
17
  };
18
18
  const paginationMenuStyles = xcss({
19
19
  padding: 'space.0',
@@ -17,7 +17,7 @@ import collapseRange from './internal/utils/collapse-range';
17
17
  var analyticsAttributes = {
18
18
  componentName: 'pagination',
19
19
  packageName: "@atlaskit/pagination",
20
- packageVersion: "14.7.2"
20
+ packageVersion: "14.7.3"
21
21
  };
22
22
  var paginationMenuStyles = xcss({
23
23
  padding: 'space.0',
@@ -5,4 +5,4 @@ export type EllipsisProp = {
5
5
  from: number;
6
6
  to: number;
7
7
  };
8
- export default function renderEllipsis({ key, testId, from, to, }: EllipsisProp): ReactElement;
8
+ export default function renderEllipsis({ key, testId, from, to }: EllipsisProp): ReactElement;
@@ -5,4 +5,4 @@ export type EllipsisProp = {
5
5
  from: number;
6
6
  to: number;
7
7
  };
8
- export default function renderEllipsis({ key, testId, from, to, }: EllipsisProp): ReactElement;
8
+ export default function renderEllipsis({ key, testId, from, to }: EllipsisProp): ReactElement;
package/package.json CHANGED
@@ -1,96 +1,96 @@
1
1
  {
2
- "name": "@atlaskit/pagination",
3
- "version": "14.7.2",
4
- "description": "Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.",
5
- "publishConfig": {
6
- "registry": "https://registry.npmjs.org/"
7
- },
8
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
- "homepage": "https://atlassian.design/components/pagination/",
10
- "author": "Atlassian Pty Ltd",
11
- "license": "Apache-2.0",
12
- "main": "dist/cjs/index.js",
13
- "module": "dist/esm/index.js",
14
- "module:es2019": "dist/es2019/index.js",
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
- "sideEffects": false,
25
- "atlaskit:src": "src/index.tsx",
26
- "af:exports": {
27
- "./types": "./src/entry-points/types.tsx",
28
- ".": "./src/index.tsx"
29
- },
30
- "atlassian": {
31
- "team": "Design System Team",
32
- "runReact18": true,
33
- "productPushConsumption": [
34
- "jira"
35
- ],
36
- "releaseModel": "continuous",
37
- "website": {
38
- "name": "Pagination",
39
- "category": "Components"
40
- }
41
- },
42
- "dependencies": {
43
- "@atlaskit/analytics-next": "^9.3.0",
44
- "@atlaskit/button": "^17.17.0",
45
- "@atlaskit/codemod-utils": "^4.2.0",
46
- "@atlaskit/ds-lib": "^2.3.0",
47
- "@atlaskit/icon": "^22.3.0",
48
- "@atlaskit/primitives": "^7.0.0",
49
- "@atlaskit/visually-hidden": "^1.3.0",
50
- "@babel/runtime": "^7.0.0",
51
- "memoize-one": "^6.0.0"
52
- },
53
- "peerDependencies": {
54
- "react": "^16.8.0 || ^17.0.0 || ~18.2.0"
55
- },
56
- "devDependencies": {
57
- "@af/accessibility-testing": "*",
58
- "@af/integration-testing": "*",
59
- "@af/visual-regression": "*",
60
- "@atlaskit/ssr": "*",
61
- "@atlaskit/visual-regression": "*",
62
- "@testing-library/dom": "^8.17.1",
63
- "@testing-library/react": "^12.1.5",
64
- "exenv": "^1.2.2",
65
- "jscodeshift": "^0.13.0",
66
- "react-dom": "^16.8.0",
67
- "react-router-dom": "^4.2.2",
68
- "storybook-addon-performance": "^0.16.0",
69
- "tiny-invariant": "^1.2.0",
70
- "typescript": "~5.4.2",
71
- "wait-for-expect": "^1.2.0"
72
- },
73
- "techstack": {
74
- "@atlassian/frontend": {
75
- "import-structure": "atlassian-conventions"
76
- },
77
- "@repo/internal": {
78
- "design-system": "v1",
79
- "dom-events": "use-bind-event-listener",
80
- "ui-components": [
81
- "primitives",
82
- "lite-mode"
83
- ],
84
- "analytics": "analytics-next",
85
- "design-tokens": [
86
- "color",
87
- "spacing"
88
- ],
89
- "deprecation": "no-deprecated-imports",
90
- "styling": [
91
- "emotion",
92
- "static"
93
- ]
94
- }
95
- }
96
- }
2
+ "name": "@atlaskit/pagination",
3
+ "version": "14.7.3",
4
+ "description": "Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.",
5
+ "publishConfig": {
6
+ "registry": "https://registry.npmjs.org/"
7
+ },
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
+ "homepage": "https://atlassian.design/components/pagination/",
10
+ "author": "Atlassian Pty Ltd",
11
+ "license": "Apache-2.0",
12
+ "main": "dist/cjs/index.js",
13
+ "module": "dist/esm/index.js",
14
+ "module:es2019": "dist/es2019/index.js",
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
+ "sideEffects": false,
25
+ "atlaskit:src": "src/index.tsx",
26
+ "af:exports": {
27
+ "./types": "./src/entry-points/types.tsx",
28
+ ".": "./src/index.tsx"
29
+ },
30
+ "atlassian": {
31
+ "team": "Design System Team",
32
+ "runReact18": true,
33
+ "productPushConsumption": [
34
+ "jira"
35
+ ],
36
+ "releaseModel": "continuous",
37
+ "website": {
38
+ "name": "Pagination",
39
+ "category": "Components"
40
+ }
41
+ },
42
+ "dependencies": {
43
+ "@atlaskit/analytics-next": "^9.3.0",
44
+ "@atlaskit/button": "^17.22.0",
45
+ "@atlaskit/codemod-utils": "^4.2.0",
46
+ "@atlaskit/ds-lib": "^2.3.0",
47
+ "@atlaskit/icon": "^22.4.0",
48
+ "@atlaskit/primitives": "^8.0.0",
49
+ "@atlaskit/visually-hidden": "^1.4.0",
50
+ "@babel/runtime": "^7.0.0",
51
+ "memoize-one": "^6.0.0"
52
+ },
53
+ "peerDependencies": {
54
+ "react": "^16.8.0 || ^17.0.0 || ~18.2.0"
55
+ },
56
+ "devDependencies": {
57
+ "@af/accessibility-testing": "*",
58
+ "@af/integration-testing": "*",
59
+ "@af/visual-regression": "*",
60
+ "@atlaskit/ssr": "*",
61
+ "@atlaskit/visual-regression": "*",
62
+ "@testing-library/dom": "^8.17.1",
63
+ "@testing-library/react": "^12.1.5",
64
+ "exenv": "^1.2.2",
65
+ "jscodeshift": "^0.13.0",
66
+ "react-dom": "^16.8.0",
67
+ "react-router-dom": "^4.2.2",
68
+ "storybook-addon-performance": "^0.16.0",
69
+ "tiny-invariant": "^1.2.0",
70
+ "typescript": "~5.4.2",
71
+ "wait-for-expect": "^1.2.0"
72
+ },
73
+ "techstack": {
74
+ "@atlassian/frontend": {
75
+ "import-structure": "atlassian-conventions"
76
+ },
77
+ "@repo/internal": {
78
+ "design-system": "v1",
79
+ "dom-events": "use-bind-event-listener",
80
+ "ui-components": [
81
+ "primitives",
82
+ "lite-mode"
83
+ ],
84
+ "analytics": "analytics-next",
85
+ "design-tokens": [
86
+ "color",
87
+ "spacing"
88
+ ],
89
+ "deprecation": "no-deprecated-imports",
90
+ "styling": [
91
+ "emotion",
92
+ "static"
93
+ ]
94
+ }
95
+ }
96
+ }
package/report.api.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  ## API Report File for "@atlaskit/pagination"
4
4
 
5
- > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
5
+ > Do not edit this file. This report is auto-generated using
6
+ > [API Extractor](https://api-extractor.com/).
6
7
  > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
8
 
8
9
  ### Table of contents
@@ -27,51 +28,47 @@ export default _default;
27
28
 
28
29
  // @public (undocumented)
29
30
  function InnerPagination<T>(
30
- {
31
- components,
32
- defaultSelectedIndex,
33
- selectedIndex,
34
- label,
35
- pageLabel,
36
- previousLabel,
37
- nextLabel,
38
- style,
39
- max,
40
- onChange,
41
- pages,
42
- getPageLabel,
43
- renderEllipsis,
44
- analyticsContext,
45
- testId,
46
- }: PaginationPropTypes<T>,
47
- ref: React_2.Ref<HTMLDivElement>,
31
+ {
32
+ components,
33
+ defaultSelectedIndex,
34
+ selectedIndex,
35
+ label,
36
+ pageLabel,
37
+ previousLabel,
38
+ nextLabel,
39
+ style,
40
+ max,
41
+ onChange,
42
+ pages,
43
+ getPageLabel,
44
+ renderEllipsis,
45
+ analyticsContext,
46
+ testId,
47
+ }: PaginationPropTypes<T>,
48
+ ref: React_2.Ref<HTMLDivElement>,
48
49
  ): JSX.Element;
49
50
 
50
51
  // @public (undocumented)
51
52
  export interface PaginationPropTypes<T = unknown> {
52
- analyticsContext?: Record<string, any>;
53
- components?: {
54
- Page?: React.ElementType;
55
- Previous?: React.ElementType;
56
- Next?: React.ElementType;
57
- };
58
- defaultSelectedIndex?: number;
59
- getPageLabel?: (page: T, pageIndex: number) => number | string;
60
- label?: string;
61
- max?: number;
62
- nextLabel?: string;
63
- onChange?: (
64
- event: SyntheticEvent,
65
- page: T,
66
- analyticsEvent?: UIAnalyticsEvent,
67
- ) => void;
68
- pageLabel?: string;
69
- pages: T[];
70
- previousLabel?: string;
71
- renderEllipsis?: (arg: { key: string }) => ReactElement;
72
- selectedIndex?: number;
73
- style?: CSSProperties;
74
- testId?: string;
53
+ analyticsContext?: Record<string, any>;
54
+ components?: {
55
+ Page?: React.ElementType;
56
+ Previous?: React.ElementType;
57
+ Next?: React.ElementType;
58
+ };
59
+ defaultSelectedIndex?: number;
60
+ getPageLabel?: (page: T, pageIndex: number) => number | string;
61
+ label?: string;
62
+ max?: number;
63
+ nextLabel?: string;
64
+ onChange?: (event: SyntheticEvent, page: T, analyticsEvent?: UIAnalyticsEvent) => void;
65
+ pageLabel?: string;
66
+ pages: T[];
67
+ previousLabel?: string;
68
+ renderEllipsis?: (arg: { key: string }) => ReactElement;
69
+ selectedIndex?: number;
70
+ style?: CSSProperties;
71
+ testId?: string;
75
72
  }
76
73
 
77
74
  // (No @packageDocumentation comment for this package)
@@ -85,7 +82,7 @@ export interface PaginationPropTypes<T = unknown> {
85
82
 
86
83
  ```json
87
84
  {
88
- "react": "^16.8.0"
85
+ "react": "^16.8.0"
89
86
  }
90
87
  ```
91
88