@atlaskit/pagination 16.3.0 → 17.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @atlaskit/pagination
2
2
 
3
+ ## 17.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
8
+ Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
9
+
10
+ Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
11
+
12
+ Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
13
+
14
+ ```diff
15
+ - "typesVersions": {
16
+ - ">=4.5 <4.9": {
17
+ - "*": [
18
+ - "dist/types-ts4.5/*",
19
+ - "dist/types-ts4.5/index.d.ts"
20
+ - ]
21
+ - }
22
+ - },
23
+ ```
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
29
+ ## 16.3.1
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies
34
+
3
35
  ## 16.3.0
4
36
 
5
37
  ### Minor Changes
@@ -34,7 +34,7 @@ var styles = {
34
34
  var analyticsAttributes = {
35
35
  componentName: 'pagination',
36
36
  packageName: "@atlaskit/pagination",
37
- packageVersion: "16.3.0"
37
+ packageVersion: "16.3.1"
38
38
  };
39
39
  function NavigatorIcon(_ref) {
40
40
  var chevronDirection = _ref.chevronDirection;
@@ -21,7 +21,7 @@ const styles = {
21
21
  const analyticsAttributes = {
22
22
  componentName: 'pagination',
23
23
  packageName: "@atlaskit/pagination",
24
- packageVersion: "16.3.0"
24
+ packageVersion: "16.3.1"
25
25
  };
26
26
  function NavigatorIcon({
27
27
  chevronDirection
@@ -25,7 +25,7 @@ var styles = {
25
25
  var analyticsAttributes = {
26
26
  componentName: 'pagination',
27
27
  packageName: "@atlaskit/pagination",
28
- packageVersion: "16.3.0"
28
+ packageVersion: "16.3.1"
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": "16.3.0",
3
+ "version": "17.0.0",
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,14 @@
40
32
  }
41
33
  },
42
34
  "dependencies": {
43
- "@atlaskit/analytics-next": "^11.2.0",
44
- "@atlaskit/button": "^23.11.0",
45
- "@atlaskit/css": "^0.19.0",
46
- "@atlaskit/ds-lib": "^7.0.0",
47
- "@atlaskit/icon": "^34.3.0",
48
- "@atlaskit/primitives": "^19.0.0",
49
- "@atlaskit/tokens": "^13.0.0",
50
- "@atlaskit/visually-hidden": "^3.0.0",
35
+ "@atlaskit/analytics-next": "^12.0.0",
36
+ "@atlaskit/button": "^24.0.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": "^14.0.0",
42
+ "@atlaskit/visually-hidden": "^4.0.0",
51
43
  "@babel/runtime": "^7.0.0",
52
44
  "memoize-one": "^6.0.0"
53
45
  },
@@ -58,16 +50,17 @@
58
50
  "@af/accessibility-testing": "workspace:^",
59
51
  "@af/integration-testing": "workspace:^",
60
52
  "@af/visual-regression": "workspace:^",
61
- "@atlaskit/code": "^17.4.0",
62
- "@atlaskit/docs": "^11.8.0",
63
- "@atlaskit/heading": "^5.4.0",
64
- "@atlaskit/link": "^3.4.0",
65
- "@atlaskit/section-message": "^8.12.0",
53
+ "@atlaskit/code": "^18.0.0",
54
+ "@atlaskit/docs": "^12.0.0",
55
+ "@atlaskit/heading": "^6.0.0",
56
+ "@atlaskit/link": "^4.0.0",
57
+ "@atlaskit/section-message": "^9.0.0",
66
58
  "@atlassian/react-compiler-gating": "workspace:^",
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": {
@@ -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
  }
@@ -1,47 +1,49 @@
1
1
  import path from 'path';
2
2
 
3
- import type { ComponentStructuredContentSource } from '@atlassian/structured-docs-types';
3
+ import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
4
4
 
5
- const documentation: ComponentStructuredContentSource[] = [
6
- {
7
- name: 'Pagination',
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
- package: '@atlaskit/pagination',
13
- type: 'default',
14
- packagePath: path.resolve(__dirname),
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
- description: 'Pagination example',
39
- source: path.resolve(__dirname, './examples/ai/pagination.tsx'),
13
+ package: '@atlaskit/pagination',
14
+ type: 'default',
15
+ packagePath: path.resolve(__dirname),
16
+ packageJson: require('./package.json'),
40
17
  },
41
- ],
42
- keywords: ['pagination', 'pages', 'navigation', 'paging', 'controls'],
43
- categories: ['navigation'],
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;
@@ -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,2 +0,0 @@
1
- export { default } from './pagination';
2
- 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,9 +0,0 @@
1
- import { type ReactElement } from 'react';
2
- type EllipsisProp = {
3
- key: string;
4
- testId?: string;
5
- from: number;
6
- to: number;
7
- };
8
- export default function renderEllipsis({ key, testId, from, to }: EllipsisProp): ReactElement;
9
- 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
- }
package/offerings.json DELETED
@@ -1,34 +0,0 @@
1
- [
2
- {
3
- "name": "Pagination",
4
- "package": "@atlaskit/pagination",
5
- "import": {
6
- "name": "Pagination",
7
- "package": "@atlaskit/pagination",
8
- "type": "default"
9
- },
10
- "keywords": ["pagination", "pages", "navigation", "paging", "controls"],
11
- "categories": ["navigation"],
12
- "shortDescription": "A component for pagination controls.",
13
- "status": "general-availability",
14
- "accessibilityGuidelines": [
15
- "Provide clear page navigation labels",
16
- "Use appropriate ARIA labels for pagination",
17
- "Ensure keyboard navigation support",
18
- "Announce page changes to screen readers"
19
- ],
20
- "usageGuidelines": [
21
- "Use for navigating through paged content",
22
- "Provide clear page indicators",
23
- "Consider total page count display",
24
- "Use appropriate page limits"
25
- ],
26
- "contentGuidelines": [
27
- "Use clear page labels",
28
- "Provide meaningful navigation text",
29
- "Use consistent pagination terminology",
30
- "Consider page context information"
31
- ],
32
- "examples": ["./examples/ai/pagination.tsx"]
33
- }
34
- ]