@atlaskit/skeleton 0.5.2 → 1.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/skeleton
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#164612](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/164612)
8
+ [`8bac6a32c3cbf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8bac6a32c3cbf) -
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/skeleton`, 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
+ ## 0.5.3
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+
3
27
  ## 0.5.2
4
28
 
5
29
  ### Patch Changes
@@ -0,0 +1,7 @@
1
+ ._1pglp3kn{animation-timing-function:linear}
2
+ ._5sag12o8{animation-duration:1.5s}
3
+ ._7hjf1yy8{animation-direction:alternate}
4
+ ._bfhkn82g{background-color:var(--ds-skeleton,#091e420f)}
5
+ ._j7hq586c{animation-name:kskr1ph}
6
+ ._tip812c5{animation-iteration-count:infinite}
7
+ @keyframes kskr1ph{0%{background-color:var(--_wenvhl)}to{background-color:var(--_1soe2er)}}
@@ -1,38 +1,24 @@
1
+ /* index.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
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
6
  Object.defineProperty(exports, "__esModule", {
5
7
  value: true
6
8
  });
7
9
  exports.default = void 0;
10
+ require("./index.compiled.css");
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _runtime = require("@compiled/react/runtime");
8
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- var _react = require("@emotion/react");
11
- var _constants = require("@atlaskit/theme/constants");
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
+ 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; }
12
17
  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; }
13
- 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; } /**
14
- * @jsxRuntime classic
15
- * @jsx jsx
16
- */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
17
- var shimmer = (0, _constants.skeletonShimmer)();
18
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
19
- var shimmerKeyframes = (0, _react.keyframes)(shimmer.keyframes);
20
- var skeletonStyles = (0, _react.css)(_objectSpread({}, shimmer.css));
21
- var activeShimmerStyles = (0, _react.css)({
22
- animationName: "".concat(shimmerKeyframes)
23
- });
24
- var getKeyframes = function getKeyframes(fromColor, toColor) {
25
- return (0, _react.keyframes)({
26
- from: {
27
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
28
- backgroundColor: fromColor
29
- },
30
- to: {
31
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
32
- backgroundColor: toColor
33
- }
34
- });
35
- };
18
+ 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; }
19
+ var shimmerKeyframes = null;
20
+ var skeletonStyles = null;
21
+ var activeShimmerStyles = null;
36
22
 
37
23
  /**
38
24
  * __Skeleton__
@@ -54,17 +40,22 @@ var Skeleton = function Skeleton(_ref) {
54
40
  groupName = _ref.groupName,
55
41
  testId = _ref.testId;
56
42
  var groupDataAttribute = groupName && "data-".concat(groupName);
57
- return (0, _react.jsx)("div", (0, _extends2.default)({
58
- "data-testid": testId,
59
- css: [skeletonStyles, isShimmering && activeShimmerStyles,
60
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
61
- {
43
+ return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
44
+ "data-testid": testId
45
+ }, groupDataAttribute && (0, _defineProperty2.default)({}, groupDataAttribute, 'true'), {
46
+ className: (0, _runtime.ax)(["_7hjf1yy8 _5sag12o8 _tip812c5 _1pglp3kn _bfhkn82g", isShimmering && "", isShimmering && "_j7hq586c"]),
47
+ style: _objectSpread(_objectSpread({}, {
62
48
  width: width,
63
49
  height: height,
64
50
  borderRadius: borderRadius,
65
51
  backgroundColor: color,
66
- animationName: color && ShimmeringEndColor ? getKeyframes(color, ShimmeringEndColor) : undefined
67
- }]
68
- }, groupDataAttribute && (0, _defineProperty2.default)({}, groupDataAttribute, 'true')));
52
+ // Override the keyframes if both colors are provided, otherwise use the CSS variable fallbacks in our keyframes
53
+ '--ds-skeleton-from-color': color && ShimmeringEndColor ? color : undefined,
54
+ '--ds-skeleton-to-color': color && ShimmeringEndColor ? ShimmeringEndColor : undefined
55
+ }), {}, {
56
+ "--_wenvhl": (0, _runtime.ix)("var(--ds-skeleton-from-color, ".concat("var(--ds-skeleton, #091E420F)", ")")),
57
+ "--_1soe2er": (0, _runtime.ix)("var(--ds-skeleton-to-color, ".concat("var(--ds-skeleton-subtle, #091E4208)", ")"))
58
+ })
59
+ }));
69
60
  };
70
61
  var _default = exports.default = Skeleton;
@@ -0,0 +1,7 @@
1
+ ._1pglp3kn{animation-timing-function:linear}
2
+ ._5sag12o8{animation-duration:1.5s}
3
+ ._7hjf1yy8{animation-direction:alternate}
4
+ ._bfhkn82g{background-color:var(--ds-skeleton,#091e420f)}
5
+ ._j7hq1y0p{animation-name:ksxefwj}
6
+ ._tip812c5{animation-iteration-count:infinite}
7
+ @keyframes ksxefwj{0%{background-color:var(--ds-skeleton-from-color,var(--ds-skeleton,#091e420f))}to{background-color:var(--ds-skeleton-to-color,var(--ds-skeleton-subtle,#091e4208))}}
@@ -1,31 +1,11 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.32.2 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { css, jsx, keyframes } from '@emotion/react';
8
- import { skeletonShimmer } from '@atlaskit/theme/constants';
9
- const shimmer = skeletonShimmer();
10
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
11
- const shimmerKeyframes = keyframes(shimmer.keyframes);
12
- const skeletonStyles = css({
13
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
14
- ...shimmer.css
15
- });
16
- const activeShimmerStyles = css({
17
- animationName: `${shimmerKeyframes}`
18
- });
19
- const getKeyframes = (fromColor, toColor) => keyframes({
20
- from: {
21
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
22
- backgroundColor: fromColor
23
- },
24
- to: {
25
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
26
- backgroundColor: toColor
27
- }
28
- });
3
+ import "./index.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
6
+ const shimmerKeyframes = null;
7
+ const skeletonStyles = null;
8
+ const activeShimmerStyles = null;
29
9
 
30
10
  /**
31
11
  * __Skeleton__
@@ -46,19 +26,21 @@ const Skeleton = ({
46
26
  testId
47
27
  }) => {
48
28
  const groupDataAttribute = groupName && `data-${groupName}`;
49
- return jsx("div", _extends({
29
+ return /*#__PURE__*/React.createElement("div", _extends({
50
30
  "data-testid": testId,
51
- css: [skeletonStyles, isShimmering && activeShimmerStyles,
52
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
53
- {
31
+ style: {
54
32
  width,
55
33
  height,
56
34
  borderRadius,
57
35
  backgroundColor: color,
58
- animationName: color && ShimmeringEndColor ? getKeyframes(color, ShimmeringEndColor) : undefined
59
- }]
36
+ // Override the keyframes if both colors are provided, otherwise use the CSS variable fallbacks in our keyframes
37
+ '--ds-skeleton-from-color': color && ShimmeringEndColor ? color : undefined,
38
+ '--ds-skeleton-to-color': color && ShimmeringEndColor ? ShimmeringEndColor : undefined
39
+ }
60
40
  }, groupDataAttribute && {
61
41
  [groupDataAttribute]: 'true'
42
+ }, {
43
+ className: ax(["_7hjf1yy8 _5sag12o8 _tip812c5 _1pglp3kn _bfhkn82g", isShimmering && "", isShimmering && "_j7hq1y0p"])
62
44
  }));
63
45
  };
64
46
  export default Skeleton;
@@ -0,0 +1,7 @@
1
+ ._1pglp3kn{animation-timing-function:linear}
2
+ ._5sag12o8{animation-duration:1.5s}
3
+ ._7hjf1yy8{animation-direction:alternate}
4
+ ._bfhkn82g{background-color:var(--ds-skeleton,#091e420f)}
5
+ ._j7hq586c{animation-name:kskr1ph}
6
+ ._tip812c5{animation-iteration-count:infinite}
7
+ @keyframes kskr1ph{0%{background-color:var(--_wenvhl)}to{background-color:var(--_1soe2er)}}
@@ -1,33 +1,14 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.32.2 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ import "./index.compiled.css";
5
+ import * as React from 'react';
6
+ import { ax, ix } from "@compiled/react/runtime";
3
7
  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
8
  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
- /**
6
- * @jsxRuntime classic
7
- * @jsx jsx
8
- */
9
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
- import { css, jsx, keyframes } from '@emotion/react';
11
- import { skeletonShimmer } from '@atlaskit/theme/constants';
12
- var shimmer = skeletonShimmer();
13
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
14
- var shimmerKeyframes = keyframes(shimmer.keyframes);
15
- var skeletonStyles = css(_objectSpread({}, shimmer.css));
16
- var activeShimmerStyles = css({
17
- animationName: "".concat(shimmerKeyframes)
18
- });
19
- var getKeyframes = function getKeyframes(fromColor, toColor) {
20
- return keyframes({
21
- from: {
22
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
23
- backgroundColor: fromColor
24
- },
25
- to: {
26
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
27
- backgroundColor: toColor
28
- }
29
- });
30
- };
9
+ var shimmerKeyframes = null;
10
+ var skeletonStyles = null;
11
+ var activeShimmerStyles = null;
31
12
 
32
13
  /**
33
14
  * __Skeleton__
@@ -49,17 +30,22 @@ var Skeleton = function Skeleton(_ref) {
49
30
  groupName = _ref.groupName,
50
31
  testId = _ref.testId;
51
32
  var groupDataAttribute = groupName && "data-".concat(groupName);
52
- return jsx("div", _extends({
53
- "data-testid": testId,
54
- css: [skeletonStyles, isShimmering && activeShimmerStyles,
55
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
56
- {
33
+ return /*#__PURE__*/React.createElement("div", _extends({
34
+ "data-testid": testId
35
+ }, groupDataAttribute && _defineProperty({}, groupDataAttribute, 'true'), {
36
+ className: ax(["_7hjf1yy8 _5sag12o8 _tip812c5 _1pglp3kn _bfhkn82g", isShimmering && "", isShimmering && "_j7hq586c"]),
37
+ style: _objectSpread(_objectSpread({}, {
57
38
  width: width,
58
39
  height: height,
59
40
  borderRadius: borderRadius,
60
41
  backgroundColor: color,
61
- animationName: color && ShimmeringEndColor ? getKeyframes(color, ShimmeringEndColor) : undefined
62
- }]
63
- }, groupDataAttribute && _defineProperty({}, groupDataAttribute, 'true')));
42
+ // Override the keyframes if both colors are provided, otherwise use the CSS variable fallbacks in our keyframes
43
+ '--ds-skeleton-from-color': color && ShimmeringEndColor ? color : undefined,
44
+ '--ds-skeleton-to-color': color && ShimmeringEndColor ? ShimmeringEndColor : undefined
45
+ }), {}, {
46
+ "--_wenvhl": ix("var(--ds-skeleton-from-color, ".concat("var(--ds-skeleton, #091E420F)", ")")),
47
+ "--_1soe2er": ix("var(--ds-skeleton-to-color, ".concat("var(--ds-skeleton-subtle, #091E4208)", ")"))
48
+ })
49
+ }));
64
50
  };
65
51
  export default Skeleton;
@@ -1,8 +1,4 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { jsx } from '@emotion/react';
1
+ /// <reference types="react" />
6
2
  type SkeletonProps = {
7
3
  width: string | number;
8
4
  height: string | number;
@@ -39,5 +35,5 @@ type SkeletonProps = {
39
35
  * - [Examples](https://atlassian.design/components/skeleton/examples)
40
36
  * - [Code](https://atlassian.design/components/skeleton/code)
41
37
  */
42
- declare const Skeleton: ({ width, height, borderRadius, color, ShimmeringEndColor, isShimmering, groupName, testId, }: SkeletonProps) => jsx.JSX.Element;
38
+ declare const Skeleton: ({ width, height, borderRadius, color, ShimmeringEndColor, isShimmering, groupName, testId, }: SkeletonProps) => JSX.Element;
43
39
  export default Skeleton;
@@ -1,8 +1,4 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { jsx } from '@emotion/react';
1
+ /// <reference types="react" />
6
2
  type SkeletonProps = {
7
3
  width: string | number;
8
4
  height: string | number;
@@ -39,5 +35,5 @@ type SkeletonProps = {
39
35
  * - [Examples](https://atlassian.design/components/skeleton/examples)
40
36
  * - [Code](https://atlassian.design/components/skeleton/code)
41
37
  */
42
- declare const Skeleton: ({ width, height, borderRadius, color, ShimmeringEndColor, isShimmering, groupName, testId, }: SkeletonProps) => jsx.JSX.Element;
38
+ declare const Skeleton: ({ width, height, borderRadius, color, ShimmeringEndColor, isShimmering, groupName, testId, }: SkeletonProps) => JSX.Element;
43
39
  export default Skeleton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/skeleton",
3
- "version": "0.5.2",
3
+ "version": "1.0.0",
4
4
  "description": "A skeleton acts as a placeholder for content, usually while the content loads.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,7 +12,9 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "sideEffects": false,
15
+ "sideEffects": [
16
+ "**/*.compiled.css"
17
+ ],
16
18
  "atlaskit:src": "src/index.tsx",
17
19
  "atlassian": {
18
20
  "team": "Design System Team",
@@ -26,9 +28,9 @@
26
28
  "runReact18": true
27
29
  },
28
30
  "dependencies": {
29
- "@atlaskit/theme": "^13.0.0",
31
+ "@atlaskit/tokens": "^2.2.0",
30
32
  "@babel/runtime": "^7.0.0",
31
- "@emotion/react": "^11.7.1"
33
+ "@compiled/react": "^0.18.1"
32
34
  },
33
35
  "peerDependencies": {
34
36
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"