@atlaskit/pagination 14.10.0 → 15.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,29 @@
1
1
  # @atlaskit/pagination
2
2
 
3
+ ## 15.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#174375](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/174375)
8
+ [`4a3e12575f8ef`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4a3e12575f8ef) -
9
+ Migrated from `@emotion/react` to `@compiled/react` in order to improve performance, align with
10
+ the rest of the Atlaskit techstack, and support React 18 Streaming SSR.
11
+
12
+ Please note, in order to use this version of `@atlaskit/pagination`, you will need to ensure that
13
+ your bundler is configured to handle `.css` imports correctly. Most bundlers come with built-in
14
+ support for `.css` imports, so you may not need to do anything. If you are using a different
15
+ bundler, please refer to the documentation for that bundler to understand how to handle `.css`
16
+ imports.
17
+
18
+ For more information on the migration, please refer to
19
+ [RFC-73 Migrating our components to Compiled CSS-in-JS](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953).
20
+
21
+ ## 14.10.1
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+
3
27
  ## 14.10.0
4
28
 
5
29
  ### Minor Changes
@@ -0,0 +1,2 @@
1
+ ._1e0c1txw{display:flex}
2
+ ._kqswh2mm{position:relative}
@@ -1,3 +1,4 @@
1
+ /* render-ellipsis.tsx generated by @compiled/babel-plugin v0.32.2 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -5,25 +6,26 @@ Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = renderEllipsis;
9
+ require("./render-ellipsis.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
8
11
  var _react = _interopRequireDefault(require("react"));
9
- var _primitives = require("@atlaskit/primitives");
12
+ var _compiled = require("@atlaskit/primitives/compiled");
10
13
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
11
- var containerStyles = (0, _primitives.xcss)({
12
- display: 'flex',
13
- position: 'relative'
14
- });
14
+ var styles = {
15
+ container: "_1e0c1txw _kqswh2mm"
16
+ };
15
17
  function renderEllipsis(_ref) {
16
18
  var key = _ref.key,
17
19
  testId = _ref.testId,
18
20
  from = _ref.from,
19
21
  to = _ref.to;
20
- return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
22
+ return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
21
23
  as: "li",
22
24
  testId: testId,
23
25
  key: key,
24
- xcss: containerStyles,
26
+ xcss: styles.container,
25
27
  paddingInline: "space.100"
26
- }, /*#__PURE__*/_react.default.createElement(_primitives.Text, {
28
+ }, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
27
29
  testId: testId && "".concat(testId, "-text")
28
30
  }, /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, null, "Skipped pages from ", from, " to ", to), "\u2026"));
29
31
  }
@@ -0,0 +1,4 @@
1
+ ._18s8ze3t{margin:var(--ds-space-0,0)}
2
+ ._1yt4ze3t{padding:var(--ds-space-0,0)}
3
+ ._18zr12x7{padding-inline:var(--ds-space-075,6px)}
4
+ ._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
@@ -1,3 +1,4 @@
1
+ /* pagination.tsx generated by @compiled/babel-plugin v0.32.2 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -6,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
6
7
  value: true
7
8
  });
8
9
  exports.default = void 0;
10
+ require("./pagination.compiled.css");
11
+ var _runtime = require("@compiled/react/runtime");
9
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
13
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
14
  var _react = _interopRequireWildcard(require("react"));
@@ -14,7 +17,7 @@ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
14
17
  var _useControlled3 = _interopRequireDefault(require("@atlaskit/ds-lib/use-controlled"));
15
18
  var _chevronLeftChevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-left--chevron-left-large"));
16
19
  var _chevronRightChevronRightLarge = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-right--chevron-right-large"));
17
- var _primitives = require("@atlaskit/primitives");
20
+ var _compiled = require("@atlaskit/primitives/compiled");
18
21
  var _navigator = _interopRequireDefault(require("./internal/components/navigator"));
19
22
  var _page = _interopRequireDefault(require("./internal/components/page"));
20
23
  var _renderEllipsis = _interopRequireDefault(require("./internal/components/render-ellipsis"));
@@ -24,27 +27,22 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
24
27
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
28
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
26
29
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
30
+ var styles = {
31
+ paginationMenu: "_1yt4ze3t _18s8ze3t",
32
+ paginationMenuItem: "_1pfhze3t",
33
+ navigatorIconWrapper: "_18zr12x7"
34
+ };
27
35
  var analyticsAttributes = {
28
36
  componentName: 'pagination',
29
37
  packageName: "@atlaskit/pagination",
30
- packageVersion: "14.10.0"
38
+ packageVersion: "15.0.0"
31
39
  };
32
- var paginationMenuStyles = (0, _primitives.xcss)({
33
- padding: 'space.0',
34
- margin: 'space.0'
35
- });
36
- var paginationMenuItemStyles = (0, _primitives.xcss)({
37
- marginBlockStart: 'space.0'
38
- });
39
- var navigatorIconWrapperStyles = (0, _primitives.xcss)({
40
- paddingInline: 'space.075'
41
- });
42
40
  function NavigatorIcon(_ref) {
43
41
  var chevronDirection = _ref.chevronDirection;
44
42
  var Chevron = chevronDirection === 'left' ? _chevronLeftChevronLeftLarge.default : _chevronRightChevronRightLarge.default;
45
- return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
43
+ return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
46
44
  as: "span",
47
- xcss: navigatorIconWrapperStyles
45
+ xcss: styles.navigatorIconWrapper
48
46
  }, /*#__PURE__*/_react.default.createElement(Chevron, {
49
47
  label: "",
50
48
  LEGACY_margin: "0 ".concat("var(--ds-space-negative-075, -6px)"),
@@ -103,9 +101,9 @@ function InnerPagination(_ref2, ref) {
103
101
  var selectedPage = pages[selectedIndexValue];
104
102
  var pageIndexLabel = "".concat(pageLabel, " ").concat(getPageLabel ? getPageLabel(page, currPageIndex) : page);
105
103
  var isCurrentPage = page === selectedPage;
106
- return /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
104
+ return /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
107
105
  as: "li",
108
- xcss: paginationMenuItemStyles,
106
+ xcss: styles.paginationMenuItem,
109
107
  key: "page-".concat(getPageLabel ? getPageLabel(page, currPageIndex) : currPageIndex)
110
108
  }, /*#__PURE__*/_react.default.createElement(_page.default, {
111
109
  component: components.Page,
@@ -126,13 +124,13 @@ function InnerPagination(_ref2, ref) {
126
124
  return (
127
125
  /*#__PURE__*/
128
126
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
129
- _react.default.createElement(_primitives.Box, {
127
+ _react.default.createElement(_compiled.Box, {
130
128
  testId: testId,
131
129
  style: style,
132
130
  ref: ref,
133
131
  "aria-label": label,
134
132
  as: "nav"
135
- }, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
133
+ }, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
136
134
  space: "space.0",
137
135
  alignBlock: "center"
138
136
  }, /*#__PURE__*/_react.default.createElement(_navigator.default, {
@@ -150,11 +148,11 @@ function InnerPagination(_ref2, ref) {
150
148
  }),
151
149
  "aria-label": previousLabel,
152
150
  testId: testId && "".concat(testId, "--left-navigator")
153
- }), /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
151
+ }), /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
154
152
  space: "space.0",
155
153
  alignBlock: "baseline",
156
154
  as: "ul",
157
- xcss: paginationMenuStyles
155
+ xcss: styles.paginationMenu
158
156
  }, (0, _collapseRange.default)(pages, selectedIndexValue, {
159
157
  max: max,
160
158
  ellipsis: renderEllipsis,
@@ -0,0 +1,2 @@
1
+ ._1e0c1txw{display:flex}
2
+ ._kqswh2mm{position:relative}
@@ -1,10 +1,12 @@
1
+ /* render-ellipsis.tsx generated by @compiled/babel-plugin v0.32.2 */
2
+ import "./render-ellipsis.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
1
4
  import React from 'react';
2
- import { Box, Text, xcss } from '@atlaskit/primitives';
5
+ import { Box, Text } from '@atlaskit/primitives/compiled';
3
6
  import VisuallyHidden from '@atlaskit/visually-hidden';
4
- const containerStyles = xcss({
5
- display: 'flex',
6
- position: 'relative'
7
- });
7
+ const styles = {
8
+ container: "_1e0c1txw _kqswh2mm"
9
+ };
8
10
  export default function renderEllipsis({
9
11
  key,
10
12
  testId,
@@ -15,7 +17,7 @@ export default function renderEllipsis({
15
17
  as: "li",
16
18
  testId: testId,
17
19
  key: key,
18
- xcss: containerStyles,
20
+ xcss: styles.container,
19
21
  paddingInline: "space.100"
20
22
  }, /*#__PURE__*/React.createElement(Text, {
21
23
  testId: testId && `${testId}-text`
@@ -0,0 +1,4 @@
1
+ ._18s8ze3t{margin:var(--ds-space-0,0)}
2
+ ._1yt4ze3t{padding:var(--ds-space-0,0)}
3
+ ._18zr12x7{padding-inline:var(--ds-space-075,6px)}
4
+ ._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
@@ -1,37 +1,35 @@
1
+ /* pagination.tsx generated by @compiled/babel-plugin v0.32.2 */
2
+ import "./pagination.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
1
4
  import React, { forwardRef, memo } from 'react';
2
5
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
3
6
  import noop from '@atlaskit/ds-lib/noop';
4
7
  import useControlled from '@atlaskit/ds-lib/use-controlled';
5
8
  import ChevronLeftLargeIcon from '@atlaskit/icon/utility/migration/chevron-left--chevron-left-large';
6
9
  import ChevronRightLargeIcon from '@atlaskit/icon/utility/migration/chevron-right--chevron-right-large';
7
- import { Box, Inline, xcss } from '@atlaskit/primitives';
10
+ import { Box, Inline } from '@atlaskit/primitives/compiled';
8
11
  import Navigator from './internal/components/navigator';
9
12
  import PageComponent from './internal/components/page';
10
13
  import renderDefaultEllipsis from './internal/components/render-ellipsis';
11
14
  import { emptyObject } from './internal/constants';
12
15
  import collapseRange from './internal/utils/collapse-range';
16
+ const styles = {
17
+ paginationMenu: "_1yt4ze3t _18s8ze3t",
18
+ paginationMenuItem: "_1pfhze3t",
19
+ navigatorIconWrapper: "_18zr12x7"
20
+ };
13
21
  const analyticsAttributes = {
14
22
  componentName: 'pagination',
15
23
  packageName: "@atlaskit/pagination",
16
- packageVersion: "14.10.0"
24
+ packageVersion: "15.0.0"
17
25
  };
18
- const paginationMenuStyles = xcss({
19
- padding: 'space.0',
20
- margin: 'space.0'
21
- });
22
- const paginationMenuItemStyles = xcss({
23
- marginBlockStart: 'space.0'
24
- });
25
- const navigatorIconWrapperStyles = xcss({
26
- paddingInline: 'space.075'
27
- });
28
26
  function NavigatorIcon({
29
27
  chevronDirection
30
28
  }) {
31
29
  const Chevron = chevronDirection === 'left' ? ChevronLeftLargeIcon : ChevronRightLargeIcon;
32
30
  return /*#__PURE__*/React.createElement(Box, {
33
31
  as: "span",
34
- xcss: navigatorIconWrapperStyles
32
+ xcss: styles.navigatorIconWrapper
35
33
  }, /*#__PURE__*/React.createElement(Chevron, {
36
34
  label: "",
37
35
  LEGACY_margin: `0 ${"var(--ds-space-negative-075, -6px)"}`,
@@ -81,7 +79,7 @@ function InnerPagination({
81
79
  const isCurrentPage = page === selectedPage;
82
80
  return /*#__PURE__*/React.createElement(Inline, {
83
81
  as: "li",
84
- xcss: paginationMenuItemStyles,
82
+ xcss: styles.paginationMenuItem,
85
83
  key: `page-${getPageLabel ? getPageLabel(page, currPageIndex) : currPageIndex}`
86
84
  }, /*#__PURE__*/React.createElement(PageComponent, {
87
85
  component: components.Page,
@@ -126,7 +124,7 @@ function InnerPagination({
126
124
  space: "space.0",
127
125
  alignBlock: "baseline",
128
126
  as: "ul",
129
- xcss: paginationMenuStyles
127
+ xcss: styles.paginationMenu
130
128
  }, collapseRange(pages, selectedIndexValue, {
131
129
  max: max,
132
130
  ellipsis: renderEllipsis,
@@ -0,0 +1,2 @@
1
+ ._1e0c1txw{display:flex}
2
+ ._kqswh2mm{position:relative}
@@ -1,10 +1,12 @@
1
+ /* render-ellipsis.tsx generated by @compiled/babel-plugin v0.32.2 */
2
+ import "./render-ellipsis.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
1
4
  import React from 'react';
2
- import { Box, Text, xcss } from '@atlaskit/primitives';
5
+ import { Box, Text } from '@atlaskit/primitives/compiled';
3
6
  import VisuallyHidden from '@atlaskit/visually-hidden';
4
- var containerStyles = xcss({
5
- display: 'flex',
6
- position: 'relative'
7
- });
7
+ var styles = {
8
+ container: "_1e0c1txw _kqswh2mm"
9
+ };
8
10
  export default function renderEllipsis(_ref) {
9
11
  var key = _ref.key,
10
12
  testId = _ref.testId,
@@ -14,7 +16,7 @@ export default function renderEllipsis(_ref) {
14
16
  as: "li",
15
17
  testId: testId,
16
18
  key: key,
17
- xcss: containerStyles,
19
+ xcss: styles.container,
18
20
  paddingInline: "space.100"
19
21
  }, /*#__PURE__*/React.createElement(Text, {
20
22
  testId: testId && "".concat(testId, "-text")
@@ -0,0 +1,4 @@
1
+ ._18s8ze3t{margin:var(--ds-space-0,0)}
2
+ ._1yt4ze3t{padding:var(--ds-space-0,0)}
3
+ ._18zr12x7{padding-inline:var(--ds-space-075,6px)}
4
+ ._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
@@ -1,5 +1,8 @@
1
+ /* pagination.tsx generated by @compiled/babel-plugin v0.32.2 */
1
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+ import "./pagination.compiled.css";
5
+ import { ax, ix } from "@compiled/react/runtime";
3
6
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
8
  import React, { forwardRef, memo } from 'react';
@@ -8,33 +11,28 @@ import noop from '@atlaskit/ds-lib/noop';
8
11
  import useControlled from '@atlaskit/ds-lib/use-controlled';
9
12
  import ChevronLeftLargeIcon from '@atlaskit/icon/utility/migration/chevron-left--chevron-left-large';
10
13
  import ChevronRightLargeIcon from '@atlaskit/icon/utility/migration/chevron-right--chevron-right-large';
11
- import { Box, Inline, xcss } from '@atlaskit/primitives';
14
+ import { Box, Inline } from '@atlaskit/primitives/compiled';
12
15
  import Navigator from './internal/components/navigator';
13
16
  import PageComponent from './internal/components/page';
14
17
  import renderDefaultEllipsis from './internal/components/render-ellipsis';
15
18
  import { emptyObject } from './internal/constants';
16
19
  import collapseRange from './internal/utils/collapse-range';
20
+ var styles = {
21
+ paginationMenu: "_1yt4ze3t _18s8ze3t",
22
+ paginationMenuItem: "_1pfhze3t",
23
+ navigatorIconWrapper: "_18zr12x7"
24
+ };
17
25
  var analyticsAttributes = {
18
26
  componentName: 'pagination',
19
27
  packageName: "@atlaskit/pagination",
20
- packageVersion: "14.10.0"
28
+ packageVersion: "15.0.0"
21
29
  };
22
- var paginationMenuStyles = xcss({
23
- padding: 'space.0',
24
- margin: 'space.0'
25
- });
26
- var paginationMenuItemStyles = xcss({
27
- marginBlockStart: 'space.0'
28
- });
29
- var navigatorIconWrapperStyles = xcss({
30
- paddingInline: 'space.075'
31
- });
32
30
  function NavigatorIcon(_ref) {
33
31
  var chevronDirection = _ref.chevronDirection;
34
32
  var Chevron = chevronDirection === 'left' ? ChevronLeftLargeIcon : ChevronRightLargeIcon;
35
33
  return /*#__PURE__*/React.createElement(Box, {
36
34
  as: "span",
37
- xcss: navigatorIconWrapperStyles
35
+ xcss: styles.navigatorIconWrapper
38
36
  }, /*#__PURE__*/React.createElement(Chevron, {
39
37
  label: "",
40
38
  LEGACY_margin: "0 ".concat("var(--ds-space-negative-075, -6px)"),
@@ -95,7 +93,7 @@ function InnerPagination(_ref2, ref) {
95
93
  var isCurrentPage = page === selectedPage;
96
94
  return /*#__PURE__*/React.createElement(Inline, {
97
95
  as: "li",
98
- xcss: paginationMenuItemStyles,
96
+ xcss: styles.paginationMenuItem,
99
97
  key: "page-".concat(getPageLabel ? getPageLabel(page, currPageIndex) : currPageIndex)
100
98
  }, /*#__PURE__*/React.createElement(PageComponent, {
101
99
  component: components.Page,
@@ -144,7 +142,7 @@ function InnerPagination(_ref2, ref) {
144
142
  space: "space.0",
145
143
  alignBlock: "baseline",
146
144
  as: "ul",
147
- xcss: paginationMenuStyles
145
+ xcss: styles.paginationMenu
148
146
  }, collapseRange(pages, selectedIndexValue, {
149
147
  max: max,
150
148
  ellipsis: renderEllipsis,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/pagination",
3
- "version": "14.10.0",
3
+ "version": "15.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/"
@@ -38,13 +38,14 @@
38
38
  }
39
39
  },
40
40
  "dependencies": {
41
- "@atlaskit/analytics-next": "^10.1.0",
41
+ "@atlaskit/analytics-next": "^10.2.0",
42
42
  "@atlaskit/button": "^20.3.0",
43
43
  "@atlaskit/codemod-utils": "^4.2.0",
44
- "@atlaskit/ds-lib": "^3.2.0",
45
- "@atlaskit/icon": "^22.26.0",
46
- "@atlaskit/primitives": "^13.2.0",
47
- "@atlaskit/tokens": "^2.3.0",
44
+ "@atlaskit/css": "^0.7.0",
45
+ "@atlaskit/ds-lib": "^3.3.0",
46
+ "@atlaskit/icon": "^23.1.0",
47
+ "@atlaskit/primitives": "^13.3.0",
48
+ "@atlaskit/tokens": "^2.4.0",
48
49
  "@atlaskit/visually-hidden": "^1.5.0",
49
50
  "@babel/runtime": "^7.0.0",
50
51
  "memoize-one": "^6.0.0"