@atlaskit/pagination 14.3.2 → 14.4.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/pagination
2
2
 
3
+ ## 14.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 14.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`12d9c63d4c1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/12d9c63d4c1) - [ux] pass pageLabel to dynamic-table component and updat prev label in examples, add description in the types file, update example files
14
+
3
15
  ## 14.3.2
4
16
 
5
17
  ### Patch Changes
@@ -28,7 +28,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
28
28
  var analyticsAttributes = {
29
29
  componentName: 'pagination',
30
30
  packageName: "@atlaskit/pagination",
31
- packageVersion: "14.3.2"
31
+ packageVersion: "14.4.1"
32
32
  };
33
33
  function InnerPagination(_ref, ref) {
34
34
  var _ref$components = _ref.components,
@@ -38,6 +38,8 @@ function InnerPagination(_ref, ref) {
38
38
  selectedIndex = _ref.selectedIndex,
39
39
  _ref$label = _ref.label,
40
40
  label = _ref$label === void 0 ? 'pagination' : _ref$label,
41
+ _ref$pageLabel = _ref.pageLabel,
42
+ pageLabel = _ref$pageLabel === void 0 ? 'page' : _ref$pageLabel,
41
43
  _ref$previousLabel = _ref.previousLabel,
42
44
  previousLabel = _ref$previousLabel === void 0 ? 'previous' : _ref$previousLabel,
43
45
  _ref$nextLabel = _ref.nextLabel,
@@ -77,6 +79,7 @@ function InnerPagination(_ref, ref) {
77
79
  }, analyticsAttributes));
78
80
  var transform = function transform(page, currPageIndex, testId) {
79
81
  var selectedPage = pages[selectedIndexValue];
82
+ var pageIndexLabel = "".concat(pageLabel, " ").concat(getPageLabel ? getPageLabel(page, currPageIndex) : page);
80
83
  return /*#__PURE__*/_react.default.createElement(_page.default, {
81
84
  key: "page-".concat(getPageLabel ? getPageLabel(page, currPageIndex) : currPageIndex),
82
85
  component: components.Page,
@@ -86,6 +89,8 @@ function InnerPagination(_ref, ref) {
86
89
  selectedPageIndex: currPageIndex
87
90
  });
88
91
  },
92
+ "aria-current": page === selectedPage ? 'page' : undefined,
93
+ "aria-label": pageIndexLabel,
89
94
  isSelected: page === selectedPage,
90
95
  page: page,
91
96
  testId: testId && "".concat(testId, "--").concat(page === selectedPage ? 'current-' : '', "page-").concat(currPageIndex)
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/pagination",
3
- "version": "14.3.2",
3
+ "version": "14.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -14,13 +14,14 @@ import collapseRange from './internal/utils/collapse-range';
14
14
  const analyticsAttributes = {
15
15
  componentName: 'pagination',
16
16
  packageName: "@atlaskit/pagination",
17
- packageVersion: "14.3.2"
17
+ packageVersion: "14.4.1"
18
18
  };
19
19
  function InnerPagination({
20
20
  components = emptyObject,
21
21
  defaultSelectedIndex = 0,
22
22
  selectedIndex,
23
23
  label = 'pagination',
24
+ pageLabel = 'page',
24
25
  previousLabel = 'previous',
25
26
  nextLabel = 'next',
26
27
  style = emptyObject,
@@ -53,6 +54,7 @@ function InnerPagination({
53
54
  });
54
55
  const transform = (page, currPageIndex, testId) => {
55
56
  const selectedPage = pages[selectedIndexValue];
57
+ const pageIndexLabel = `${pageLabel} ${getPageLabel ? getPageLabel(page, currPageIndex) : page}`;
56
58
  return /*#__PURE__*/React.createElement(PageComponent, {
57
59
  key: `page-${getPageLabel ? getPageLabel(page, currPageIndex) : currPageIndex}`,
58
60
  component: components.Page,
@@ -60,6 +62,8 @@ function InnerPagination({
60
62
  event,
61
63
  selectedPageIndex: currPageIndex
62
64
  }),
65
+ "aria-current": page === selectedPage ? 'page' : undefined,
66
+ "aria-label": pageIndexLabel,
63
67
  isSelected: page === selectedPage,
64
68
  page: page,
65
69
  testId: testId && `${testId}--${page === selectedPage ? 'current-' : ''}page-${currPageIndex}`
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/pagination",
3
- "version": "14.3.2",
3
+ "version": "14.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -18,7 +18,7 @@ import collapseRange from './internal/utils/collapse-range';
18
18
  var analyticsAttributes = {
19
19
  componentName: 'pagination',
20
20
  packageName: "@atlaskit/pagination",
21
- packageVersion: "14.3.2"
21
+ packageVersion: "14.4.1"
22
22
  };
23
23
  function InnerPagination(_ref, ref) {
24
24
  var _ref$components = _ref.components,
@@ -28,6 +28,8 @@ function InnerPagination(_ref, ref) {
28
28
  selectedIndex = _ref.selectedIndex,
29
29
  _ref$label = _ref.label,
30
30
  label = _ref$label === void 0 ? 'pagination' : _ref$label,
31
+ _ref$pageLabel = _ref.pageLabel,
32
+ pageLabel = _ref$pageLabel === void 0 ? 'page' : _ref$pageLabel,
31
33
  _ref$previousLabel = _ref.previousLabel,
32
34
  previousLabel = _ref$previousLabel === void 0 ? 'previous' : _ref$previousLabel,
33
35
  _ref$nextLabel = _ref.nextLabel,
@@ -67,6 +69,7 @@ function InnerPagination(_ref, ref) {
67
69
  }, analyticsAttributes));
68
70
  var transform = function transform(page, currPageIndex, testId) {
69
71
  var selectedPage = pages[selectedIndexValue];
72
+ var pageIndexLabel = "".concat(pageLabel, " ").concat(getPageLabel ? getPageLabel(page, currPageIndex) : page);
70
73
  return /*#__PURE__*/React.createElement(PageComponent, {
71
74
  key: "page-".concat(getPageLabel ? getPageLabel(page, currPageIndex) : currPageIndex),
72
75
  component: components.Page,
@@ -76,6 +79,8 @@ function InnerPagination(_ref, ref) {
76
79
  selectedPageIndex: currPageIndex
77
80
  });
78
81
  },
82
+ "aria-current": page === selectedPage ? 'page' : undefined,
83
+ "aria-label": pageIndexLabel,
79
84
  isSelected: page === selectedPage,
80
85
  page: page,
81
86
  testId: testId && "".concat(testId, "--").concat(page === selectedPage ? 'current-' : '', "page-").concat(currPageIndex)
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/pagination",
3
- "version": "14.3.2",
3
+ "version": "14.4.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { PaginationPropTypes } from './types';
3
- 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.Element;
3
+ declare function InnerPagination<T>({ components, defaultSelectedIndex, selectedIndex, label, pageLabel, previousLabel, nextLabel, style, max, onChange, pages, getPageLabel, renderEllipsis, analyticsContext, testId, }: PaginationPropTypes<T>, ref: React.Ref<HTMLDivElement>): JSX.Element;
4
4
  declare const _default: typeof InnerPagination;
5
5
  export default _default;
@@ -18,15 +18,26 @@ export interface PaginationPropTypes<T = unknown> {
18
18
  */
19
19
  getPageLabel?: (page: T, pageIndex: number) => number | string;
20
20
  /**
21
- * The aria-label for the pagination wrapper
21
+ * The aria-label for the pagination nav wrapper.
22
+ * The default value is "pagination".
22
23
  */
23
24
  label?: string;
24
25
  /**
25
- * The aria-label for the next button
26
+ * The aria-label for the next button.
27
+ * The default value is "next".
26
28
  */
27
29
  nextLabel?: string;
28
30
  /**
29
- * The aria-label for the previous button
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".
30
41
  */
31
42
  previousLabel?: string;
32
43
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { PaginationPropTypes } from './types';
3
- 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.Element;
3
+ declare function InnerPagination<T>({ components, defaultSelectedIndex, selectedIndex, label, pageLabel, previousLabel, nextLabel, style, max, onChange, pages, getPageLabel, renderEllipsis, analyticsContext, testId, }: PaginationPropTypes<T>, ref: React.Ref<HTMLDivElement>): JSX.Element;
4
4
  declare const _default: typeof InnerPagination;
5
5
  export default _default;
@@ -18,15 +18,26 @@ export interface PaginationPropTypes<T = unknown> {
18
18
  */
19
19
  getPageLabel?: (page: T, pageIndex: number) => number | string;
20
20
  /**
21
- * The aria-label for the pagination wrapper
21
+ * The aria-label for the pagination nav wrapper.
22
+ * The default value is "pagination".
22
23
  */
23
24
  label?: string;
24
25
  /**
25
- * The aria-label for the next button
26
+ * The aria-label for the next button.
27
+ * The default value is "next".
26
28
  */
27
29
  nextLabel?: string;
28
30
  /**
29
- * The aria-label for the previous button
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".
30
41
  */
31
42
  previousLabel?: string;
32
43
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/pagination",
3
- "version": "14.3.2",
3
+ "version": "14.4.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/"
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "atlassian": {
31
31
  "team": "Design System Team",
32
- "releaseModel": "scheduled",
32
+ "releaseModel": "continuous",
33
33
  "website": {
34
34
  "name": "Pagination",
35
35
  "category": "Components"
@@ -39,10 +39,10 @@
39
39
  "@atlaskit/analytics-next": "^9.1.0",
40
40
  "@atlaskit/button": "^16.7.0",
41
41
  "@atlaskit/codemod-utils": "^4.2.0",
42
- "@atlaskit/ds-explorations": "^2.1.0",
42
+ "@atlaskit/ds-explorations": "^2.2.0",
43
43
  "@atlaskit/ds-lib": "^2.2.0",
44
44
  "@atlaskit/icon": "^21.12.0",
45
- "@atlaskit/primitives": "^0.9.0",
45
+ "@atlaskit/primitives": "^0.10.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "memoize-one": "^6.0.0"
48
48
  },
@@ -53,7 +53,7 @@
53
53
  "@atlaskit/code": "^14.6.0",
54
54
  "@atlaskit/docs": "*",
55
55
  "@atlaskit/ds-lib": "^2.2.0",
56
- "@atlaskit/dynamic-table": "^14.9.0",
56
+ "@atlaskit/dynamic-table": "^14.10.0",
57
57
  "@atlaskit/heading": "^1.3.0",
58
58
  "@atlaskit/section-message": "^6.4.0",
59
59
  "@atlaskit/ssr": "*",
package/report.api.md CHANGED
@@ -32,6 +32,7 @@ function InnerPagination<T>(
32
32
  defaultSelectedIndex,
33
33
  selectedIndex,
34
34
  label,
35
+ pageLabel,
35
36
  previousLabel,
36
37
  nextLabel,
37
38
  style,
@@ -64,6 +65,7 @@ export interface PaginationPropTypes<T = unknown> {
64
65
  page: T,
65
66
  analyticsEvent?: UIAnalyticsEvent,
66
67
  ) => void;
68
+ pageLabel?: string;
67
69
  pages: T[];
68
70
  previousLabel?: string;
69
71
  renderEllipsis?: (arg: { key: string }) => ReactElement;
@@ -0,0 +1,47 @@
1
+ ## API Report File for "@atlaskit/pagination"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import type { CSSProperties } from 'react';
8
+ import { default as React_2 } from 'react';
9
+ import type { ReactElement } from 'react';
10
+ import type { SyntheticEvent } from 'react';
11
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
12
+
13
+ // @public (undocumented)
14
+ const _default: typeof InnerPagination;
15
+ export default _default;
16
+
17
+ // @public (undocumented)
18
+ function InnerPagination<T>({ components, defaultSelectedIndex, selectedIndex, label, pageLabel, previousLabel, nextLabel, style, max, onChange, pages, getPageLabel, renderEllipsis, analyticsContext, testId, }: PaginationPropTypes<T>, ref: React_2.Ref<HTMLDivElement>): JSX.Element;
19
+
20
+ // @public (undocumented)
21
+ export interface PaginationPropTypes<T = unknown> {
22
+ analyticsContext?: Record<string, any>;
23
+ components?: {
24
+ Page?: React.ElementType;
25
+ Previous?: React.ElementType;
26
+ Next?: React.ElementType;
27
+ };
28
+ defaultSelectedIndex?: number;
29
+ getPageLabel?: (page: T, pageIndex: number) => number | string;
30
+ label?: string;
31
+ max?: number;
32
+ nextLabel?: string;
33
+ onChange?: (event: SyntheticEvent, page: T, analyticsEvent?: UIAnalyticsEvent) => void;
34
+ pageLabel?: string;
35
+ pages: T[];
36
+ previousLabel?: string;
37
+ renderEllipsis?: (arg: {
38
+ key: string;
39
+ }) => ReactElement;
40
+ selectedIndex?: number;
41
+ style?: CSSProperties;
42
+ testId?: string;
43
+ }
44
+
45
+ // (No @packageDocumentation comment for this package)
46
+
47
+ ```