@atlaskit/pagination 14.2.1 → 14.2.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,17 @@
1
1
  # @atlaskit/pagination
2
2
 
3
+ ## 14.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 14.2.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`9827dcb82b8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9827dcb82b8) - No-op change to introduce spacing tokens to design system components.
14
+
3
15
  ## 14.2.1
4
16
 
5
17
  ### Patch Changes
@@ -1,7 +1,8 @@
1
1
  import { renameNamedImportWithAliasName } from '@atlaskit/codemod-utils';
2
2
 
3
- export const renamePaginationPropTypeToPaginationProps = renameNamedImportWithAliasName(
4
- '@atlaskit/pagination',
5
- 'PaginationPropTypes',
6
- 'PaginationProps',
7
- );
3
+ export const renamePaginationPropTypeToPaginationProps =
4
+ renameNamedImportWithAliasName(
5
+ '@atlaskit/pagination',
6
+ 'PaginationPropTypes',
7
+ 'PaginationProps',
8
+ );
@@ -15,13 +15,12 @@ var _react2 = require("@emotion/react");
15
15
 
16
16
  var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
17
17
 
18
- var _constants = require("@atlaskit/theme/constants");
19
-
20
18
  /** @jsx jsx */
21
- var gridSize = (0, _constants.gridSize)();
22
19
  var navigatorStyles = (0, _react2.css)({
23
- paddingRight: gridSize / 2,
24
- paddingLeft: gridSize / 2
20
+ // TODO Delete this comment after verifying spacing token -> previous value `gridSize / 2`
21
+ paddingRight: "var(--ds-scale-050, 4px)",
22
+ // TODO Delete this comment after verifying spacing token -> previous value `gridSize / 2`
23
+ paddingLeft: "var(--ds-scale-050, 4px)"
25
24
  });
26
25
 
27
26
  function Navigator(props) {
@@ -10,7 +10,7 @@ var _react = require("@emotion/react");
10
10
  /** @jsx jsx */
11
11
  var ellipsisStyles = (0, _react.css)({
12
12
  display: 'inline-flex',
13
- padding: '0 8px',
13
+ padding: "var(--ds-scale-0, 0px)".concat(" ", "var(--ds-scale-100, 8px)"),
14
14
  alignItems: 'center',
15
15
  textAlign: 'center'
16
16
  });
@@ -42,7 +42,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
42
42
  var analyticsAttributes = {
43
43
  componentName: 'pagination',
44
44
  packageName: "@atlaskit/pagination",
45
- packageVersion: "14.2.1"
45
+ packageVersion: "14.2.3"
46
46
  };
47
47
  var navStyles = (0, _react2.css)({
48
48
  display: 'flex'
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/pagination",
3
- "version": "14.2.1",
3
+ "version": "14.2.3",
4
4
  "sideEffects": false
5
5
  }
@@ -4,11 +4,11 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  import React from 'react';
5
5
  import { css, jsx } from '@emotion/react';
6
6
  import Button from '@atlaskit/button/standard-button';
7
- import { gridSize as getGridSize } from '@atlaskit/theme/constants';
8
- const gridSize = getGridSize();
9
7
  const navigatorStyles = css({
10
- paddingRight: gridSize / 2,
11
- paddingLeft: gridSize / 2
8
+ // TODO Delete this comment after verifying spacing token -> previous value `gridSize / 2`
9
+ paddingRight: "var(--ds-scale-050, 4px)",
10
+ // TODO Delete this comment after verifying spacing token -> previous value `gridSize / 2`
11
+ paddingLeft: "var(--ds-scale-050, 4px)"
12
12
  });
13
13
  export default function Navigator(props) {
14
14
  return jsx(Button // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
@@ -2,7 +2,7 @@
2
2
  import { css, jsx } from '@emotion/react';
3
3
  const ellipsisStyles = css({
4
4
  display: 'inline-flex',
5
- padding: '0 8px',
5
+ padding: `${"var(--ds-scale-0, 0px)"} ${"var(--ds-scale-100, 8px)"}`,
6
6
  alignItems: 'center',
7
7
  textAlign: 'center'
8
8
  });
@@ -14,7 +14,7 @@ import collapseRange from './internal/utils/collapse-range';
14
14
  const analyticsAttributes = {
15
15
  componentName: 'pagination',
16
16
  packageName: "@atlaskit/pagination",
17
- packageVersion: "14.2.1"
17
+ packageVersion: "14.2.3"
18
18
  };
19
19
  const navStyles = css({
20
20
  display: 'flex'
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/pagination",
3
- "version": "14.2.1",
3
+ "version": "14.2.3",
4
4
  "sideEffects": false
5
5
  }
@@ -4,11 +4,11 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  import React from 'react';
5
5
  import { css, jsx } from '@emotion/react';
6
6
  import Button from '@atlaskit/button/standard-button';
7
- import { gridSize as getGridSize } from '@atlaskit/theme/constants';
8
- var gridSize = getGridSize();
9
7
  var navigatorStyles = css({
10
- paddingRight: gridSize / 2,
11
- paddingLeft: gridSize / 2
8
+ // TODO Delete this comment after verifying spacing token -> previous value `gridSize / 2`
9
+ paddingRight: "var(--ds-scale-050, 4px)",
10
+ // TODO Delete this comment after verifying spacing token -> previous value `gridSize / 2`
11
+ paddingLeft: "var(--ds-scale-050, 4px)"
12
12
  });
13
13
  export default function Navigator(props) {
14
14
  return jsx(Button // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
@@ -2,7 +2,7 @@
2
2
  import { css, jsx } from '@emotion/react';
3
3
  var ellipsisStyles = css({
4
4
  display: 'inline-flex',
5
- padding: '0 8px',
5
+ padding: "var(--ds-scale-0, 0px)".concat(" ", "var(--ds-scale-100, 8px)"),
6
6
  alignItems: 'center',
7
7
  textAlign: 'center'
8
8
  });
@@ -21,7 +21,7 @@ import collapseRange from './internal/utils/collapse-range';
21
21
  var analyticsAttributes = {
22
22
  componentName: 'pagination',
23
23
  packageName: "@atlaskit/pagination",
24
- packageVersion: "14.2.1"
24
+ packageVersion: "14.2.3"
25
25
  };
26
26
  var navStyles = css({
27
27
  display: 'flex'
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/pagination",
3
- "version": "14.2.1",
3
+ "version": "14.2.3",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/pagination",
3
- "version": "14.2.1",
3
+ "version": "14.2.3",
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,13 +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.0 <4.5": {
18
- "*": [
19
- "dist/types-ts4.0/*"
20
- ]
21
- }
22
- },
23
16
  "sideEffects": false,
24
17
  "atlaskit:src": "src/index.tsx",
25
18
  "af:exports": {
@@ -27,6 +20,7 @@
27
20
  ".": "./src/index.tsx"
28
21
  },
29
22
  "atlassian": {
23
+ "disableProductCI": true,
30
24
  "team": "Design System Team",
31
25
  "releaseModel": "scheduled",
32
26
  "website": {
@@ -36,11 +30,11 @@
36
30
  },
37
31
  "dependencies": {
38
32
  "@atlaskit/analytics-next": "^8.0.0",
39
- "@atlaskit/button": "^16.3.0",
33
+ "@atlaskit/button": "^16.4.0",
40
34
  "@atlaskit/codemod-utils": "^4.1.0",
41
35
  "@atlaskit/ds-lib": "^2.1.0",
42
- "@atlaskit/icon": "^21.10.0",
43
- "@atlaskit/theme": "^12.2.0",
36
+ "@atlaskit/icon": "^21.11.0",
37
+ "@atlaskit/tokens": "^0.11.0",
44
38
  "@babel/runtime": "^7.0.0",
45
39
  "@emotion/react": "^11.7.1",
46
40
  "memoize-one": "^6.0.0"
@@ -52,7 +46,7 @@
52
46
  "@atlaskit/docs": "*",
53
47
  "@atlaskit/ds-lib": "^2.1.0",
54
48
  "@atlaskit/dynamic-table": "^14.8.0",
55
- "@atlaskit/section-message": "^6.2.0",
49
+ "@atlaskit/section-message": "^6.3.0",
56
50
  "@atlaskit/ssr": "*",
57
51
  "@atlaskit/visual-regression": "*",
58
52
  "@atlaskit/webdriver-runner": "*",
@@ -77,6 +71,7 @@
77
71
  "dom-events": "use-bind-event-listener",
78
72
  "ui-components": "lite-mode",
79
73
  "analytics": "analytics-next",
74
+ "design-tokens": "spacing",
80
75
  "theming": "tokens",
81
76
  "deprecation": "no-deprecated-imports",
82
77
  "styling": [
package/report.api.md CHANGED
@@ -2,18 +2,27 @@
2
2
 
3
3
  > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
4
 
5
+ <!--
6
+ Generated API Report version: 2.0
7
+ -->
8
+
9
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
10
+
5
11
  ```ts
6
12
  /// <reference types="react" />
7
13
 
8
14
  import type { CSSProperties } from 'react';
15
+ import { jsx } from '@emotion/react';
9
16
  import type { ReactElement } from 'react';
10
17
  import type { SyntheticEvent } from 'react';
11
18
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
12
19
 
13
- declare const _default: typeof InnerPagination;
20
+ // @public (undocumented)
21
+ const _default: typeof InnerPagination;
14
22
  export default _default;
15
23
 
16
- declare function InnerPagination<T>(
24
+ // @public (undocumented)
25
+ function InnerPagination<T>(
17
26
  {
18
27
  components,
19
28
  defaultSelectedIndex,
@@ -31,57 +40,33 @@ declare function InnerPagination<T>(
31
40
  testId,
32
41
  }: PaginationPropTypes<T>,
33
42
  ref: React.Ref<HTMLDivElement>,
34
- ): JSX.Element;
43
+ ): jsx.JSX.Element;
35
44
 
36
- export declare interface PaginationPropTypes<T = unknown> {
37
- /** Replace the built-in Page, Previous, Next and/ or Ellipsis component */
45
+ // @public (undocumented)
46
+ export interface PaginationPropTypes<T = unknown> {
47
+ analyticsContext?: Record<string, any>;
38
48
  components?: {
39
49
  Page?: React.ElementType;
40
50
  Previous?: React.ElementType;
41
51
  Next?: React.ElementType;
42
52
  };
43
- /** Index of the page to be selected by default */
44
53
  defaultSelectedIndex?: number;
45
- /** Helper function to get text displayed on the page button. It is helpful in scenarios when page the page passed in is an object */
46
54
  getPageLabel?: (page: T, pageIndex: number) => number | string;
47
- /** The aria-label for the pagination wrapper */
48
55
  label?: string;
49
- /** The aria-label for the next button */
50
- nextLabel?: string;
51
- /** The aria-label for the previous button */
52
- previousLabel?: string;
53
- /** Style to spread on the container element */
54
- style?: CSSProperties;
55
- /** Maximum number of pages to be displayed in the pagination */
56
56
  max?: number;
57
- /** The onChange handler which is called when the page is changed */
57
+ nextLabel?: string;
58
58
  onChange?: (
59
59
  event: SyntheticEvent,
60
60
  page: T,
61
61
  analyticsEvent?: UIAnalyticsEvent,
62
62
  ) => void;
63
- /** Array of the pages to display */
64
63
  pages: T[];
65
- /** Index of the selected page. This will make this pagination controlled */
66
- selectedIndex?: number;
67
- /** The react Node returned from the function is rendered instead of the default ellipsis node */
64
+ previousLabel?: string;
68
65
  renderEllipsis?: (arg: { key: string }) => ReactElement;
69
- /** Additional information to be included in the `context` of analytics events */
70
- analyticsContext?: Record<string, any>;
71
- /**
72
- A `testId` prop is provided for specified elements,
73
- which is a unique string that appears as a data attribute `data-testid`
74
- in the rendered code, serving as a hook for automated tests.
75
-
76
- Will set data-testid on these elements when defined:
77
- - Pagination nav wrapper - {testId}
78
- - Page - {testId}--page-{page index}
79
- - Current page - {testId}--current-page-{page index}
80
- - Left navigator - {testId}--left-navigator
81
- - Right navigator - {testId}--right-navigator
82
- */
66
+ selectedIndex?: number;
67
+ style?: CSSProperties;
83
68
  testId?: string;
84
69
  }
85
70
 
86
- export {};
71
+ // (No @packageDocumentation comment for this package)
87
72
  ```
@@ -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,22 +0,0 @@
1
- /** @jsx jsx */
2
- import React, { ReactElement, SyntheticEvent } from 'react';
3
- import { jsx } from '@emotion/react';
4
- export declare type NavigatorProps<T> = {
5
- /**
6
- * This will be passed in as aria-label to button. This is what screen reader will read
7
- */
8
- 'aria-label'?: string;
9
- /**
10
- * Is the navigator disabled
11
- */
12
- isDisabled?: boolean;
13
- iconBefore: ReactElement;
14
- pages: T[];
15
- testId?: string;
16
- /**
17
- * This function is called with the when user clicks on navigator
18
- */
19
- onClick?: (event: SyntheticEvent) => void;
20
- component?: React.ElementType<any>;
21
- };
22
- export default function Navigator<T>(props: NavigatorProps<T>): jsx.JSX.Element;
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import { ButtonProps } from '@atlaskit/button/standard-button';
3
- import type { Appearance } from '@atlaskit/button/types';
4
- declare type Diff<T, U> = T extends U ? never : T;
5
- declare 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): JSX.Element;
17
- export {};
@@ -1,6 +0,0 @@
1
- /** @jsx jsx */
2
- import { ReactElement } from 'react';
3
- export declare type EllipsisProp = {
4
- key: string;
5
- };
6
- export default function renderEllipsis({ key }: EllipsisProp): ReactElement;
@@ -1 +0,0 @@
1
- export declare const emptyObject: {};
@@ -1,9 +0,0 @@
1
- import { ReactElement } from 'react';
2
- declare const collapseRange: <T>(pages: T[], current: number, { max, ellipsis, transform, }: {
3
- max: number;
4
- ellipsis: (arg: {
5
- key: string;
6
- }) => ReactElement;
7
- transform: (page: T, index: number, testId?: string | undefined) => ReactElement;
8
- }, testId?: string | undefined) => ReactElement[];
9
- export default collapseRange;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { jsx } from '@emotion/react';
3
- import { PaginationPropTypes } from './types';
4
- declare function InnerPagination<T>({ components, defaultSelectedIndex, selectedIndex, label, previousLabel, nextLabel, style, max, onChange, pages, getPageLabel, renderEllipsis, analyticsContext, testId, }: PaginationPropTypes<T>, ref: React.Ref<HTMLDivElement>): jsx.JSX.Element;
5
- declare const _default: typeof InnerPagination;
6
- export default _default;
@@ -1,75 +0,0 @@
1
- import type { CSSProperties, ReactElement, SyntheticEvent } from 'react';
2
- import { 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. It 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 wrapper
22
- */
23
- label?: string;
24
- /**
25
- * The aria-label for the next button
26
- */
27
- nextLabel?: string;
28
- /**
29
- * The aria-label for the previous button
30
- */
31
- previousLabel?: string;
32
- /**
33
- * Style to spread on the container element
34
- */
35
- style?: CSSProperties;
36
- /**
37
- * Maximum number of pages to be displayed in the pagination
38
- */
39
- max?: number;
40
- /**
41
- * The onChange handler which is called when the page is changed
42
- */
43
- onChange?: (event: SyntheticEvent, page: T, analyticsEvent?: UIAnalyticsEvent) => void;
44
- /**
45
- * Array of the pages to display
46
- */
47
- pages: T[];
48
- /**
49
- * Index of the selected page. This will make this pagination controlled
50
- */
51
- selectedIndex?: number;
52
- /**
53
- * The react Node returned from the function is rendered instead of the default ellipsis node
54
- */
55
- renderEllipsis?: (arg: {
56
- key: string;
57
- }) => ReactElement;
58
- /**
59
- * Additional information to be included in the `context` of analytics events
60
- */
61
- analyticsContext?: Record<string, any>;
62
- /**
63
- * A `testId` prop is provided for specified elements,
64
- * which is a unique string that appears as a data attribute `data-testid`
65
- * in the rendered code, serving as a hook for automated tests.
66
- *
67
- * Will set data-testid on these elements when defined:
68
- * - Pagination nav wrapper - {testId}
69
- * - Page - {testId}--page-{page index}
70
- * - Current page - {testId}--current-page-{page index}
71
- * - Left navigator - {testId}--left-navigator
72
- * - Right navigator - {testId}--right-navigator
73
- */
74
- testId?: string;
75
- }