@atlaskit/menu 7.1.0 → 8.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.
Files changed (27) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/menu-item/skeleton-heading-item.compiled.css +16 -0
  3. package/dist/cjs/menu-item/skeleton-heading-item.js +39 -57
  4. package/dist/cjs/menu-item/skeleton-item.compiled.css +38 -0
  5. package/dist/cjs/menu-item/skeleton-item.js +46 -121
  6. package/dist/es2019/menu-item/skeleton-heading-item.compiled.css +16 -0
  7. package/dist/es2019/menu-item/skeleton-heading-item.js +26 -50
  8. package/dist/es2019/menu-item/skeleton-item.compiled.css +38 -0
  9. package/dist/es2019/menu-item/skeleton-item.js +33 -117
  10. package/dist/esm/menu-item/skeleton-heading-item.compiled.css +16 -0
  11. package/dist/esm/menu-item/skeleton-heading-item.js +36 -56
  12. package/dist/esm/menu-item/skeleton-item.compiled.css +38 -0
  13. package/dist/esm/menu-item/skeleton-item.js +43 -122
  14. package/dist/types/index.d.ts +1 -1
  15. package/dist/types/menu-item/skeleton-heading-item.d.ts +2 -2
  16. package/dist/types/menu-item/skeleton-item.d.ts +2 -2
  17. package/dist/types/types.d.ts +10 -28
  18. package/dist/types-ts4.5/index.d.ts +1 -1
  19. package/dist/types-ts4.5/menu-item/skeleton-heading-item.d.ts +2 -2
  20. package/dist/types-ts4.5/menu-item/skeleton-item.d.ts +2 -2
  21. package/dist/types-ts4.5/types.d.ts +10 -28
  22. package/package.json +2 -3
  23. package/dist/cjs/internal/components/skeleton-shimmer.js +0 -73
  24. package/dist/es2019/internal/components/skeleton-shimmer.js +0 -65
  25. package/dist/esm/internal/components/skeleton-shimmer.js +0 -66
  26. package/dist/types/internal/components/skeleton-shimmer.d.ts +0 -27
  27. package/dist/types-ts4.5/internal/components/skeleton-shimmer.d.ts +0 -27
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/menu
2
2
 
3
+ ## 8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#157531](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157531)
8
+ [`dd1068010784d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dd1068010784d) -
9
+ Migrated `SkeletonItem` and `SkeletonHeadingItem` components from @emotion/react to
10
+ @compiled/react in order toimprove performance, align with the rest of the Atlaskit techstack, and
11
+ support React 18 StreamingSSR.
12
+
13
+ Removed the `cssFn` prop from the `SkeletonItem` and `SkeletonHeadingItem` components.
14
+ Customization can now be applied via the new `xcss` prop. This allows for safe/bounded style
15
+ overrides.
16
+
17
+ Removed the following types related to the `cssFn` prop: `CSSFn`, `StatelessCSSFn`, `ItemState`.
18
+
3
19
  ## 7.1.0
4
20
 
5
21
  ### Minor Changes
@@ -0,0 +1,16 @@
1
+ ._14mj53f4:after{border-radius:75pt}
2
+ ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
3
+ ._1rjcze3t{padding-block:var(--ds-space-0,0)}
4
+ ._18f312c5:after, ._evp612c5:before{animation-iteration-count:infinite}
5
+ ._18lgp3kn:after, ._zo24p3kn:before{animation-timing-function:linear}
6
+ ._19oh1hno:after, ._10881hno:before{animation-name:k1mc5q4v}
7
+ ._1hfk3yfp:after, ._1rus3yfp:before{background-color:var(--_1j9jaml)}
8
+ ._1hfklbf8:after{background-color:var(--ds-skeleton,rgba(9,30,66,.04))}
9
+ ._1qdgu2gc:after{height:var(--ds-space-100,8px)}
10
+ ._1ywu1ule:after{display:block}
11
+ ._aetrb3bt:after{content:""}
12
+ ._kwc012o8:after, ._joxl12o8:before{animation-duration:1.5s}
13
+ ._unfq1yy8:after, ._9nev1yy8:before{animation-direction:alternate}
14
+ ._z0ai1r5k:after{width:30%}
15
+ ._z0airzut:after{width:var(--width)}
16
+ @keyframes k1mc5q4v{0%{background-color:var(--_1j9jaml)}to{background-color:var(--_wb902m)}}
@@ -1,47 +1,41 @@
1
+ /* skeleton-heading-item.tsx generated by @compiled/babel-plugin v0.36.1 */
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;
8
- var _react = require("@emotion/react");
9
- var _deprecationWarning = require("@atlaskit/ds-lib/deprecation-warning");
10
- var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
11
- var _colors = require("@atlaskit/theme/colors");
12
- var _skeletonShimmer = _interopRequireDefault(require("../internal/components/skeleton-shimmer"));
10
+ require("./skeleton-heading-item.compiled.css");
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _runtime = require("@compiled/react/runtime");
13
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
+ 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); }
15
+ 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; }
16
+ 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; }
17
+ 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; }
18
+ var N20A = 'rgba(9, 30, 66, 0.04)';
19
+ var N30A = 'rgba(9, 30, 66, 0.08)';
20
+ var styles = {
21
+ skeleton: "_1rjcze3t _18zrpxbi _14mj53f4 _1ywu1ule _z0ai1r5k _1qdgu2gc _1hfklbf8 _aetrb3bt",
22
+ customWidth: "_z0airzut"
23
+ };
24
+
13
25
  /**
14
- * @jsxRuntime classic
15
- * @jsx jsx
26
+ * These styles are mirrored in:
27
+ * packages/design-system/theme/src/constants.tsx
28
+ * packages/design-system/menu/src/menu-item/skeleton-item.tsx
29
+ *
30
+ * Please update both.
16
31
  */
32
+ var shimmerKeyframes = null;
17
33
 
18
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
19
-
20
- var skeletonStyles = (0, _react.css)({
21
- paddingBlock: "var(--ds-space-0, 0px)",
22
- paddingInline: "var(--ds-space-200, 16px)",
23
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
24
- '::after': {
25
- display: 'block',
26
- width: '30%',
27
- height: "var(--ds-space-100, 8px)",
28
- backgroundColor: "var(--ds-skeleton, ".concat(_colors.N20A, ")"),
29
- borderRadius: 100,
30
- content: '""'
31
- }
32
- });
33
- var defaultWidthStyles = (0, _react.css)({
34
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
35
- '::after': {
36
- width: '30%'
37
- }
38
- });
39
- var customWidthStyles = (0, _react.css)({
40
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
41
- '::after': {
42
- width: 'var(--width)'
43
- }
44
- });
34
+ /**
35
+ * These styles are defined using `css` rather than `cssMap` as there is a
36
+ * bug when using `cssMap` that causes a build failure due to the use of keyframes.
37
+ */
38
+ var shimmerStyles = null;
45
39
 
46
40
  /**
47
41
  * __Skeleton heading item__
@@ -56,29 +50,17 @@ var SkeletonHeadingItem = function SkeletonHeadingItem(_ref) {
56
50
  isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering,
57
51
  testId = _ref.testId,
58
52
  width = _ref.width,
59
- _ref$cssFn = _ref.cssFn,
60
- cssFn = _ref$cssFn === void 0 ? _noop.default : _ref$cssFn;
61
- (0, _deprecationWarning.propDeprecationWarning)("@atlaskit/menu" || '', 'cssFn', cssFn !== _noop.default, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
62
- );
63
-
64
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
65
- var UNSAFE_overrides = (0, _react.css)(cssFn(undefined));
66
- return (0, _react.jsx)(_skeletonShimmer.default, {
67
- isShimmering: isShimmering
68
- }, function (_ref2) {
69
- var className = _ref2.className;
70
- return (0, _react.jsx)("div", {
71
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
72
- className: className,
73
- style: {
74
- '--width': width
75
- },
76
- css: [skeletonStyles, width ? customWidthStyles : defaultWidthStyles,
77
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
78
- UNSAFE_overrides],
79
- "data-ds--menu--skeleton-heading-item": true,
80
- "data-testid": testId
81
- });
53
+ xcss = _ref.xcss;
54
+ return /*#__PURE__*/React.createElement("div", {
55
+ className: (0, _runtime.ax)([styles.skeleton, width && styles.customWidth, isShimmering && "", isShimmering && "_unfq1yy8 _9nev1yy8 _kwc012o8 _joxl12o8 _18f312c5 _evp612c5 _19oh1hno _10881hno _18lgp3kn _zo24p3kn _1hfk3yfp _1rus3yfp", xcss]),
56
+ "data-ds--menu--skeleton-heading-item": true,
57
+ "data-testid": testId,
58
+ style: _objectSpread(_objectSpread({}, {
59
+ '--width': width
60
+ }), {}, {
61
+ "--_1j9jaml": (0, _runtime.ix)("var(--ds-skeleton, ".concat(N20A, ")")),
62
+ "--_wb902m": (0, _runtime.ix)("var(--ds-skeleton-subtle, ".concat(N30A, ")"))
63
+ })
82
64
  });
83
65
  };
84
66
  var _default = exports.default = SkeletonHeadingItem;
@@ -0,0 +1,38 @@
1
+
2
+ ._14mj53f4:after{border-radius:75pt}
3
+ ._rfx31l7b:before{border-radius:3px}
4
+ ._rfx31osq:before{border-radius:100%}
5
+ ._18zru2gc{padding-inline:var(--ds-space-100,8px)}
6
+ ._18zrv47k{padding-inline:var(--ds-space-250,20px)}
7
+ ._1rjcze3t{padding-block:var(--ds-space-0,0)}._11w8rzut:after{flex-basis:var(--width)}
8
+ ._18f312c5:after, ._evp612c5:before{animation-iteration-count:infinite}
9
+ ._18lgp3kn:after, ._zo24p3kn:before{animation-timing-function:linear}
10
+ ._19oh1hno:after, ._10881hno:before{animation-name:k1mc5q4v}
11
+ ._1e0c1txw{display:flex}
12
+ ._1hfk3yfp:after, ._1rus3yfp:before{background-color:var(--_1j9jaml)}
13
+ ._1hfklbf8:after{background-color:var(--ds-skeleton,rgba(9,30,66,.04))}
14
+ ._1kt9b3bt:before{content:""}
15
+ ._1mbqdlk8:before{margin-inline-end:14px}
16
+ ._1mbqpxbi:before{margin-inline-end:var(--ds-space-200,1pc)}
17
+ ._1mp41k8s:before{width:1.5rem}
18
+ ._1mp4gktf:before{width:20px}
19
+ ._1qdgrdoj:after{height:9px}
20
+ ._1rhxv77o:before{margin-inline-start:var(--ds-space-025,2px)}
21
+ ._1ruslbf8:before{background-color:var(--ds-skeleton,rgba(9,30,66,.04))}
22
+ ._1tke1ylp{min-height:40px}
23
+ ._3mxot94y:after{margin-block-start:1px}
24
+ ._4cvr1h6o{align-items:center}
25
+ ._4rfy1ssb:nth-of-type(2n):after{flex-basis:50%}
26
+ ._69tq19wn:nth-of-type(5n):after{flex-basis:35%}
27
+ ._7bjqidpf:before{flex-shrink:0}
28
+ ._aetrb3bt:after{content:""}
29
+ ._baud1nrf:nth-of-type(3n):after{flex-basis:60%}
30
+ ._kfgt1k8s:before{height:1.5rem}
31
+ ._kfgtgktf:before{height:20px}
32
+ ._kt4d1n05:nth-of-type(6n):after{flex-basis:77%}
33
+ ._kwc012o8:after, ._joxl12o8:before{animation-duration:1.5s}
34
+ ._lcxvglyw{pointer-events:none}
35
+ ._mr7o1vuk:nth-of-type(4n):after{flex-basis:90%}
36
+ ._sf1e1n8h:nth-of-type(1n):after{flex-basis:70%}
37
+ ._unfq1yy8:after, ._9nev1yy8:before{animation-direction:alternate}
38
+ @keyframes k1mc5q4v{0%{background-color:var(--_1j9jaml)}to{background-color:var(--_wb902m)}}
@@ -1,112 +1,47 @@
1
+ /* skeleton-item.tsx generated by @compiled/babel-plugin v0.36.1 */
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;
8
- var _react = require("@emotion/react");
9
- var _deprecationWarning = require("@atlaskit/ds-lib/deprecation-warning");
10
- var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
11
- var _colors = require("@atlaskit/theme/colors");
12
- var _constants = require("@atlaskit/theme/constants");
13
- var _skeletonShimmer = _interopRequireDefault(require("../internal/components/skeleton-shimmer"));
10
+ require("./skeleton-item.compiled.css");
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _runtime = require("@compiled/react/runtime");
13
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
+ 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); }
15
+ 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; }
16
+ 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; }
17
+ 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; }
18
+ var skeletonItemElemSize = 20;
19
+ var N20A = 'rgba(9, 30, 66, 0.04)';
20
+ var N30A = 'rgba(9, 30, 66, 0.08)';
21
+ var styles = {
22
+ root: "_1rjcze3t _18zrv47k _1e0c1txw _1tke1ylp _4cvr1h6o _lcxvglyw _14mj53f4 _1qdgrdoj _1hfklbf8 _aetrb3bt _3mxot94y",
23
+ defaultWidth: "_sf1e1n8h _4rfy1ssb _baud1nrf _mr7o1vuk _69tq19wn _kt4d1n05",
24
+ customWidth: "_11w8rzut",
25
+ beforeElement: "_1mp4gktf _kfgtgktf _7bjqidpf _1ruslbf8 _1kt9b3bt _1mbqdlk8 _1rhxv77o",
26
+ avatar: "_rfx31osq",
27
+ icon: "_rfx31l7b",
28
+ sideNavSkeleton: "_18zru2gc _kfgt1k8s _1mbqpxbi _1mp41k8s"
29
+ };
30
+
14
31
  /**
15
- * @jsxRuntime classic
16
- * @jsx jsx
32
+ * These styles are mirrored in:
33
+ * packages/design-system/theme/src/constants.tsx
34
+ * packages/design-system/menu/src/menu-item/skeleton-heading-item.tsx
35
+ *
36
+ * Please update both.
17
37
  */
38
+ var shimmerKeyframes = null;
18
39
 
19
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
20
-
21
- var gridSize = (0, _constants.gridSize)();
22
- var borderRadius = (0, _constants.borderRadius)();
23
- var itemElemSpacing = gridSize * 1.5;
24
- var itemExpectedElemSize = gridSize * 3;
25
- var itemMinHeight = gridSize * 5;
26
- var skeletonItemElemSize = gridSize * 2.5;
27
- var itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
28
- var skeletonTextBorderRadius = 100;
29
- var skeletonContentHeight = 9;
30
- var skeletonColor = "var(--ds-skeleton, ".concat(_colors.N20A, ")");
31
- var skeletonStyles = (0, _react.css)({
32
- display: 'flex',
33
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
34
- minHeight: itemMinHeight,
35
- padding: "0 ".concat("var(--ds-space-250, 20px)"),
36
- alignItems: 'center',
37
- pointerEvents: 'none',
38
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
39
- '::after': {
40
- height: skeletonContentHeight,
41
- backgroundColor: skeletonColor,
42
- borderRadius: skeletonTextBorderRadius,
43
- content: '""',
44
- // This is a little bespoke but we need to push everything down 1px
45
- // because the skeleton content should align to the bottom of the text.
46
- // Confirm VR test failures before accepting a change.
47
- marginBlockStart: 1
48
- }
49
- });
50
- var defaultWidthStyles = (0, _react.css)({
51
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
52
- ':nth-of-type(1n)::after': {
53
- flexBasis: '70%'
54
- },
55
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
56
- ':nth-of-type(2n)::after': {
57
- flexBasis: '50%'
58
- },
59
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
60
- ':nth-of-type(3n)::after': {
61
- flexBasis: '60%'
62
- },
63
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
64
- ':nth-of-type(4n)::after': {
65
- flexBasis: '90%'
66
- },
67
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
68
- ':nth-of-type(5n)::after': {
69
- flexBasis: '35%'
70
- },
71
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
72
- ':nth-of-type(6n)::after': {
73
- flexBasis: '77%'
74
- }
75
- });
76
- var customWidthStyles = (0, _react.css)({
77
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
78
- '::after': {
79
- flexBasis: 'var(--width)'
80
- }
81
- });
82
- var beforeElementStyles = (0, _react.css)({
83
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
84
- '::before': {
85
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
86
- width: skeletonItemElemSize,
87
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
88
- height: skeletonItemElemSize,
89
- flexShrink: 0,
90
- backgroundColor: skeletonColor,
91
- content: '""',
92
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
93
- marginInlineEnd: itemElemSpacing + itemElemSkeletonOffset,
94
- marginInlineStart: "var(--ds-space-025, 2px)"
95
- }
96
- });
97
- var avatarStyles = (0, _react.css)({
98
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
99
- '::before': {
100
- borderRadius: '100%'
101
- }
102
- });
103
- var iconStyles = (0, _react.css)({
104
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
105
- '::before': {
106
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
107
- borderRadius: borderRadius
108
- }
109
- });
40
+ /**
41
+ * These styles are defined using `css` rather than `cssMap` as there is a bug when using
42
+ * `cssMap` that causes a build failure due to the use of keyframes within this pseudo-element.
43
+ */
44
+ var shimmerStyles = null;
110
45
 
111
46
  /**
112
47
  * __Skeleton item__
@@ -121,30 +56,20 @@ var SkeletonItem = function SkeletonItem(_ref) {
121
56
  hasIcon = _ref.hasIcon,
122
57
  _ref$isShimmering = _ref.isShimmering,
123
58
  isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering,
59
+ _ref$isSideNavSkeleto = _ref.isSideNavSkeleton,
60
+ isSideNavSkeleton = _ref$isSideNavSkeleto === void 0 ? false : _ref$isSideNavSkeleto,
124
61
  testId = _ref.testId,
125
62
  width = _ref.width,
126
- _ref$cssFn = _ref.cssFn,
127
- cssFn = _ref$cssFn === void 0 ? _noop.default : _ref$cssFn;
128
- (0, _deprecationWarning.propDeprecationWarning)("@atlaskit/menu" || '', 'cssFn', cssFn !== _noop.default, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
129
- );
130
-
131
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
132
- var UNSAFE_overrides = (0, _react.css)(cssFn());
133
- return (0, _react.jsx)(_skeletonShimmer.default, {
134
- isShimmering: isShimmering
135
- }, function (_ref2) {
136
- var className = _ref2.className;
137
- return (0, _react.jsx)("div", {
138
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
139
- className: className,
140
- style: {
141
- '--width': width
142
- },
143
- css: [skeletonStyles, (hasAvatar || hasIcon) && beforeElementStyles, hasAvatar && avatarStyles, hasIcon && iconStyles, width ? customWidthStyles : defaultWidthStyles,
144
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
145
- UNSAFE_overrides],
146
- "data-testid": testId
147
- });
63
+ xcss = _ref.xcss;
64
+ return /*#__PURE__*/React.createElement("div", {
65
+ className: (0, _runtime.ax)([styles.root, (hasAvatar || hasIcon) && styles.beforeElement, hasAvatar && styles.avatar, hasIcon && styles.icon, width ? styles.customWidth : styles.defaultWidth, isSideNavSkeleton && styles.sideNavSkeleton, isShimmering && "", isShimmering && "_unfq1yy8 _9nev1yy8 _kwc012o8 _joxl12o8 _18f312c5 _evp612c5 _19oh1hno _10881hno _18lgp3kn _zo24p3kn _1hfk3yfp _1rus3yfp", xcss]),
66
+ "data-testid": testId,
67
+ style: _objectSpread(_objectSpread({}, {
68
+ '--width': width
69
+ }), {}, {
70
+ "--_1j9jaml": (0, _runtime.ix)("var(--ds-skeleton, ".concat(N20A, ")")),
71
+ "--_wb902m": (0, _runtime.ix)("var(--ds-skeleton-subtle, ".concat(N30A, ")"))
72
+ })
148
73
  });
149
74
  };
150
75
  var _default = exports.default = SkeletonItem;
@@ -0,0 +1,16 @@
1
+ ._14mj53f4:after{border-radius:75pt}
2
+ ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
3
+ ._1rjcze3t{padding-block:var(--ds-space-0,0)}
4
+ ._18f312c5:after, ._evp612c5:before{animation-iteration-count:infinite}
5
+ ._18lgp3kn:after, ._zo24p3kn:before{animation-timing-function:linear}
6
+ ._19oh1qxh:after, ._10881qxh:before{animation-name:kiz0l3k}
7
+ ._1hfklbf8:after, ._1ruslbf8:before{background-color:var(--ds-skeleton,rgba(9,30,66,.04))}
8
+ ._1hfklbf8:after{background-color:var(--ds-skeleton,rgba(9,30,66,.04))}
9
+ ._1qdgu2gc:after{height:var(--ds-space-100,8px)}
10
+ ._1ywu1ule:after{display:block}
11
+ ._aetrb3bt:after{content:""}
12
+ ._kwc012o8:after, ._joxl12o8:before{animation-duration:1.5s}
13
+ ._unfq1yy8:after, ._9nev1yy8:before{animation-direction:alternate}
14
+ ._z0ai1r5k:after{width:30%}
15
+ ._z0airzut:after{width:var(--width)}
16
+ @keyframes kiz0l3k{0%{background-color:var(--ds-skeleton,rgba(9,30,66,.04))}to{background-color:var(--ds-skeleton-subtle,rgba(9,30,66,.08))}}
@@ -1,39 +1,28 @@
1
+ /* skeleton-heading-item.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./skeleton-heading-item.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ const N20A = 'rgba(9, 30, 66, 0.04)';
6
+ const N30A = 'rgba(9, 30, 66, 0.08)';
7
+ const styles = {
8
+ skeleton: "_1rjcze3t _18zrpxbi _14mj53f4 _1ywu1ule _z0ai1r5k _1qdgu2gc _1hfklbf8 _aetrb3bt",
9
+ customWidth: "_z0airzut"
10
+ };
11
+
1
12
  /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
13
+ * These styles are mirrored in:
14
+ * packages/design-system/theme/src/constants.tsx
15
+ * packages/design-system/menu/src/menu-item/skeleton-item.tsx
16
+ *
17
+ * Please update both.
4
18
  */
19
+ const shimmerKeyframes = null;
5
20
 
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { css, jsx } from '@emotion/react';
8
- import { propDeprecationWarning } from '@atlaskit/ds-lib/deprecation-warning';
9
- import noop from '@atlaskit/ds-lib/noop';
10
- import { N20A } from '@atlaskit/theme/colors';
11
- import SkeletonShimmer from '../internal/components/skeleton-shimmer';
12
- const skeletonStyles = css({
13
- paddingBlock: "var(--ds-space-0, 0px)",
14
- paddingInline: "var(--ds-space-200, 16px)",
15
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
16
- '::after': {
17
- display: 'block',
18
- width: '30%',
19
- height: "var(--ds-space-100, 8px)",
20
- backgroundColor: `var(--ds-skeleton, ${N20A})`,
21
- borderRadius: 100,
22
- content: '""'
23
- }
24
- });
25
- const defaultWidthStyles = css({
26
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
27
- '::after': {
28
- width: '30%'
29
- }
30
- });
31
- const customWidthStyles = css({
32
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
33
- '::after': {
34
- width: 'var(--width)'
35
- }
36
- });
21
+ /**
22
+ * These styles are defined using `css` rather than `cssMap` as there is a
23
+ * bug when using `cssMap` that causes a build failure due to the use of keyframes.
24
+ */
25
+ const shimmerStyles = null;
37
26
 
38
27
  /**
39
28
  * __Skeleton heading item__
@@ -47,28 +36,15 @@ const SkeletonHeadingItem = ({
47
36
  isShimmering = false,
48
37
  testId,
49
38
  width,
50
- cssFn = noop
39
+ xcss
51
40
  }) => {
52
- propDeprecationWarning("@atlaskit/menu" || '', 'cssFn', cssFn !== noop, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
53
- );
54
-
55
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
56
- const UNSAFE_overrides = css(cssFn(undefined));
57
- return jsx(SkeletonShimmer, {
58
- isShimmering: isShimmering
59
- }, ({
60
- className
61
- }) => jsx("div", {
62
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
63
- className: className,
41
+ return /*#__PURE__*/React.createElement("div", {
42
+ className: ax([styles.skeleton, width && styles.customWidth, isShimmering && "", isShimmering && "_unfq1yy8 _9nev1yy8 _kwc012o8 _joxl12o8 _18f312c5 _evp612c5 _19oh1qxh _10881qxh _18lgp3kn _zo24p3kn _1hfklbf8 _1ruslbf8", xcss]),
64
43
  style: {
65
44
  '--width': width
66
45
  },
67
- css: [skeletonStyles, width ? customWidthStyles : defaultWidthStyles,
68
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
69
- UNSAFE_overrides],
70
46
  "data-ds--menu--skeleton-heading-item": true,
71
47
  "data-testid": testId
72
- }));
48
+ });
73
49
  };
74
50
  export default SkeletonHeadingItem;
@@ -0,0 +1,38 @@
1
+
2
+ ._14mj53f4:after{border-radius:75pt}
3
+ ._rfx31l7b:before{border-radius:3px}
4
+ ._rfx31osq:before{border-radius:100%}
5
+ ._18zru2gc{padding-inline:var(--ds-space-100,8px)}
6
+ ._18zrv47k{padding-inline:var(--ds-space-250,20px)}
7
+ ._1rjcze3t{padding-block:var(--ds-space-0,0)}._11w8rzut:after{flex-basis:var(--width)}
8
+ ._18f312c5:after, ._evp612c5:before{animation-iteration-count:infinite}
9
+ ._18lgp3kn:after, ._zo24p3kn:before{animation-timing-function:linear}
10
+ ._19oh1qxh:after, ._10881qxh:before{animation-name:kiz0l3k}
11
+ ._1e0c1txw{display:flex}
12
+ ._1hfklbf8:after, ._1ruslbf8:before{background-color:var(--ds-skeleton,rgba(9,30,66,.04))}
13
+ ._1hfklbf8:after{background-color:var(--ds-skeleton,rgba(9,30,66,.04))}
14
+ ._1kt9b3bt:before{content:""}
15
+ ._1mbqdlk8:before{margin-inline-end:14px}
16
+ ._1mbqpxbi:before{margin-inline-end:var(--ds-space-200,1pc)}
17
+ ._1mp41k8s:before{width:1.5rem}
18
+ ._1mp4gktf:before{width:20px}
19
+ ._1qdgrdoj:after{height:9px}
20
+ ._1rhxv77o:before{margin-inline-start:var(--ds-space-025,2px)}
21
+ ._1ruslbf8:before{background-color:var(--ds-skeleton,rgba(9,30,66,.04))}
22
+ ._1tke1ylp{min-height:40px}
23
+ ._3mxot94y:after{margin-block-start:1px}
24
+ ._4cvr1h6o{align-items:center}
25
+ ._4rfy1ssb:nth-of-type(2n):after{flex-basis:50%}
26
+ ._69tq19wn:nth-of-type(5n):after{flex-basis:35%}
27
+ ._7bjqidpf:before{flex-shrink:0}
28
+ ._aetrb3bt:after{content:""}
29
+ ._baud1nrf:nth-of-type(3n):after{flex-basis:60%}
30
+ ._kfgt1k8s:before{height:1.5rem}
31
+ ._kfgtgktf:before{height:20px}
32
+ ._kt4d1n05:nth-of-type(6n):after{flex-basis:77%}
33
+ ._kwc012o8:after, ._joxl12o8:before{animation-duration:1.5s}
34
+ ._lcxvglyw{pointer-events:none}
35
+ ._mr7o1vuk:nth-of-type(4n):after{flex-basis:90%}
36
+ ._sf1e1n8h:nth-of-type(1n):after{flex-basis:70%}
37
+ ._unfq1yy8:after, ._9nev1yy8:before{animation-direction:alternate}
38
+ @keyframes kiz0l3k{0%{background-color:var(--ds-skeleton,rgba(9,30,66,.04))}to{background-color:var(--ds-skeleton-subtle,rgba(9,30,66,.08))}}