@atlaskit/menu 7.0.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 +29 -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 +8 -9
  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
@@ -1,106 +1,34 @@
1
+ /* skeleton-item.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./skeleton-item.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ const skeletonItemElemSize = 20;
6
+ const N20A = 'rgba(9, 30, 66, 0.04)';
7
+ const N30A = 'rgba(9, 30, 66, 0.08)';
8
+ const styles = {
9
+ root: "_1rjcze3t _18zrv47k _1e0c1txw _1tke1ylp _4cvr1h6o _lcxvglyw _14mj53f4 _1qdgrdoj _1hfklbf8 _aetrb3bt _3mxot94y",
10
+ defaultWidth: "_sf1e1n8h _4rfy1ssb _baud1nrf _mr7o1vuk _69tq19wn _kt4d1n05",
11
+ customWidth: "_11w8rzut",
12
+ beforeElement: "_1mp4gktf _kfgtgktf _7bjqidpf _1ruslbf8 _1kt9b3bt _1mbqdlk8 _1rhxv77o",
13
+ avatar: "_rfx31osq",
14
+ icon: "_rfx31l7b",
15
+ sideNavSkeleton: "_18zru2gc _kfgt1k8s _1mbqpxbi _1mp41k8s"
16
+ };
17
+
1
18
  /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
19
+ * These styles are mirrored in:
20
+ * packages/design-system/theme/src/constants.tsx
21
+ * packages/design-system/menu/src/menu-item/skeleton-heading-item.tsx
22
+ *
23
+ * Please update both.
4
24
  */
25
+ const shimmerKeyframes = null;
5
26
 
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 { borderRadius as borderRadiusFn,
12
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
13
- gridSize as gridSizeFn } from '@atlaskit/theme/constants';
14
- import SkeletonShimmer from '../internal/components/skeleton-shimmer';
15
- const gridSize = gridSizeFn();
16
- const borderRadius = borderRadiusFn();
17
- const itemElemSpacing = gridSize * 1.5;
18
- const itemExpectedElemSize = gridSize * 3;
19
- const itemMinHeight = gridSize * 5;
20
- const skeletonItemElemSize = gridSize * 2.5;
21
- const itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
22
- const skeletonTextBorderRadius = 100;
23
- const skeletonContentHeight = 9;
24
- const skeletonColor = `var(--ds-skeleton, ${N20A})`;
25
- const skeletonStyles = css({
26
- display: 'flex',
27
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
28
- minHeight: itemMinHeight,
29
- padding: `0 ${"var(--ds-space-250, 20px)"}`,
30
- alignItems: 'center',
31
- pointerEvents: 'none',
32
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
33
- '::after': {
34
- height: skeletonContentHeight,
35
- backgroundColor: skeletonColor,
36
- borderRadius: skeletonTextBorderRadius,
37
- content: '""',
38
- // This is a little bespoke but we need to push everything down 1px
39
- // because the skeleton content should align to the bottom of the text.
40
- // Confirm VR test failures before accepting a change.
41
- marginBlockStart: 1
42
- }
43
- });
44
- const defaultWidthStyles = css({
45
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
46
- ':nth-of-type(1n)::after': {
47
- flexBasis: '70%'
48
- },
49
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
50
- ':nth-of-type(2n)::after': {
51
- flexBasis: '50%'
52
- },
53
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
54
- ':nth-of-type(3n)::after': {
55
- flexBasis: '60%'
56
- },
57
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
58
- ':nth-of-type(4n)::after': {
59
- flexBasis: '90%'
60
- },
61
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
62
- ':nth-of-type(5n)::after': {
63
- flexBasis: '35%'
64
- },
65
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
66
- ':nth-of-type(6n)::after': {
67
- flexBasis: '77%'
68
- }
69
- });
70
- const customWidthStyles = css({
71
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
72
- '::after': {
73
- flexBasis: 'var(--width)'
74
- }
75
- });
76
- const beforeElementStyles = css({
77
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
78
- '::before': {
79
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
80
- width: skeletonItemElemSize,
81
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
82
- height: skeletonItemElemSize,
83
- flexShrink: 0,
84
- backgroundColor: skeletonColor,
85
- content: '""',
86
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
87
- marginInlineEnd: itemElemSpacing + itemElemSkeletonOffset,
88
- marginInlineStart: "var(--ds-space-025, 2px)"
89
- }
90
- });
91
- const avatarStyles = css({
92
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
93
- '::before': {
94
- borderRadius: '100%'
95
- }
96
- });
97
- const iconStyles = css({
98
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
99
- '::before': {
100
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
101
- borderRadius
102
- }
103
- });
27
+ /**
28
+ * These styles are defined using `css` rather than `cssMap` as there is a bug when using
29
+ * `cssMap` that causes a build failure due to the use of keyframes within this pseudo-element.
30
+ */
31
+ const shimmerStyles = null;
104
32
 
105
33
  /**
106
34
  * __Skeleton item__
@@ -114,29 +42,17 @@ const SkeletonItem = ({
114
42
  hasAvatar,
115
43
  hasIcon,
116
44
  isShimmering = false,
45
+ isSideNavSkeleton = false,
117
46
  testId,
118
47
  width,
119
- cssFn = noop
48
+ xcss
120
49
  }) => {
121
- propDeprecationWarning("@atlaskit/menu" || '', 'cssFn', cssFn !== noop, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
122
- );
123
-
124
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
125
- const UNSAFE_overrides = css(cssFn());
126
- return jsx(SkeletonShimmer, {
127
- isShimmering: isShimmering
128
- }, ({
129
- className
130
- }) => jsx("div", {
131
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
132
- className: className,
50
+ return /*#__PURE__*/React.createElement("div", {
51
+ className: 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 _19oh1qxh _10881qxh _18lgp3kn _zo24p3kn _1hfklbf8 _1ruslbf8", xcss]),
133
52
  style: {
134
53
  '--width': width
135
54
  },
136
- css: [skeletonStyles, (hasAvatar || hasIcon) && beforeElementStyles, hasAvatar && avatarStyles, hasIcon && iconStyles, width ? customWidthStyles : defaultWidthStyles,
137
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
138
- UNSAFE_overrides],
139
55
  "data-testid": testId
140
- }));
56
+ });
141
57
  };
142
58
  export 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
+ ._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,39 +1,31 @@
1
+ /* skeleton-heading-item.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import "./skeleton-heading-item.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
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; }
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; }
8
+ var N20A = 'rgba(9, 30, 66, 0.04)';
9
+ var N30A = 'rgba(9, 30, 66, 0.08)';
10
+ var styles = {
11
+ skeleton: "_1rjcze3t _18zrpxbi _14mj53f4 _1ywu1ule _z0ai1r5k _1qdgu2gc _1hfklbf8 _aetrb3bt",
12
+ customWidth: "_z0airzut"
13
+ };
14
+
1
15
  /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
16
+ * These styles are mirrored in:
17
+ * packages/design-system/theme/src/constants.tsx
18
+ * packages/design-system/menu/src/menu-item/skeleton-item.tsx
19
+ *
20
+ * Please update both.
4
21
  */
22
+ var shimmerKeyframes = null;
5
23
 
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
- var 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, ".concat(N20A, ")"),
21
- borderRadius: 100,
22
- content: '""'
23
- }
24
- });
25
- var 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
- var 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
- });
24
+ /**
25
+ * These styles are defined using `css` rather than `cssMap` as there is a
26
+ * bug when using `cssMap` that causes a build failure due to the use of keyframes.
27
+ */
28
+ var shimmerStyles = null;
37
29
 
38
30
  /**
39
31
  * __Skeleton heading item__
@@ -48,29 +40,17 @@ var SkeletonHeadingItem = function SkeletonHeadingItem(_ref) {
48
40
  isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering,
49
41
  testId = _ref.testId,
50
42
  width = _ref.width,
51
- _ref$cssFn = _ref.cssFn,
52
- cssFn = _ref$cssFn === void 0 ? noop : _ref$cssFn;
53
- propDeprecationWarning("@atlaskit/menu" || '', 'cssFn', cssFn !== noop, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
54
- );
55
-
56
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
57
- var UNSAFE_overrides = css(cssFn(undefined));
58
- return jsx(SkeletonShimmer, {
59
- isShimmering: isShimmering
60
- }, function (_ref2) {
61
- var className = _ref2.className;
62
- return jsx("div", {
63
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
64
- className: className,
65
- style: {
66
- '--width': width
67
- },
68
- css: [skeletonStyles, width ? customWidthStyles : defaultWidthStyles,
69
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
70
- UNSAFE_overrides],
71
- "data-ds--menu--skeleton-heading-item": true,
72
- "data-testid": testId
73
- });
43
+ xcss = _ref.xcss;
44
+ return /*#__PURE__*/React.createElement("div", {
45
+ className: ax([styles.skeleton, width && styles.customWidth, isShimmering && "", isShimmering && "_unfq1yy8 _9nev1yy8 _kwc012o8 _joxl12o8 _18f312c5 _evp612c5 _19oh1hno _10881hno _18lgp3kn _zo24p3kn _1hfk3yfp _1rus3yfp", xcss]),
46
+ "data-ds--menu--skeleton-heading-item": true,
47
+ "data-testid": testId,
48
+ style: _objectSpread(_objectSpread({}, {
49
+ '--width': width
50
+ }), {}, {
51
+ "--_1j9jaml": ix("var(--ds-skeleton, ".concat(N20A, ")")),
52
+ "--_wb902m": ix("var(--ds-skeleton-subtle, ".concat(N30A, ")"))
53
+ })
74
54
  });
75
55
  };
76
56
  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
+ ._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,106 +1,37 @@
1
+ /* skeleton-item.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import "./skeleton-item.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
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; }
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; }
8
+ var skeletonItemElemSize = 20;
9
+ var N20A = 'rgba(9, 30, 66, 0.04)';
10
+ var N30A = 'rgba(9, 30, 66, 0.08)';
11
+ var styles = {
12
+ root: "_1rjcze3t _18zrv47k _1e0c1txw _1tke1ylp _4cvr1h6o _lcxvglyw _14mj53f4 _1qdgrdoj _1hfklbf8 _aetrb3bt _3mxot94y",
13
+ defaultWidth: "_sf1e1n8h _4rfy1ssb _baud1nrf _mr7o1vuk _69tq19wn _kt4d1n05",
14
+ customWidth: "_11w8rzut",
15
+ beforeElement: "_1mp4gktf _kfgtgktf _7bjqidpf _1ruslbf8 _1kt9b3bt _1mbqdlk8 _1rhxv77o",
16
+ avatar: "_rfx31osq",
17
+ icon: "_rfx31l7b",
18
+ sideNavSkeleton: "_18zru2gc _kfgt1k8s _1mbqpxbi _1mp41k8s"
19
+ };
20
+
1
21
  /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
22
+ * These styles are mirrored in:
23
+ * packages/design-system/theme/src/constants.tsx
24
+ * packages/design-system/menu/src/menu-item/skeleton-heading-item.tsx
25
+ *
26
+ * Please update both.
4
27
  */
28
+ var shimmerKeyframes = null;
5
29
 
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 { borderRadius as borderRadiusFn,
12
- // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
13
- gridSize as gridSizeFn } from '@atlaskit/theme/constants';
14
- import SkeletonShimmer from '../internal/components/skeleton-shimmer';
15
- var gridSize = gridSizeFn();
16
- var borderRadius = borderRadiusFn();
17
- var itemElemSpacing = gridSize * 1.5;
18
- var itemExpectedElemSize = gridSize * 3;
19
- var itemMinHeight = gridSize * 5;
20
- var skeletonItemElemSize = gridSize * 2.5;
21
- var itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
22
- var skeletonTextBorderRadius = 100;
23
- var skeletonContentHeight = 9;
24
- var skeletonColor = "var(--ds-skeleton, ".concat(N20A, ")");
25
- var skeletonStyles = css({
26
- display: 'flex',
27
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
28
- minHeight: itemMinHeight,
29
- padding: "0 ".concat("var(--ds-space-250, 20px)"),
30
- alignItems: 'center',
31
- pointerEvents: 'none',
32
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
33
- '::after': {
34
- height: skeletonContentHeight,
35
- backgroundColor: skeletonColor,
36
- borderRadius: skeletonTextBorderRadius,
37
- content: '""',
38
- // This is a little bespoke but we need to push everything down 1px
39
- // because the skeleton content should align to the bottom of the text.
40
- // Confirm VR test failures before accepting a change.
41
- marginBlockStart: 1
42
- }
43
- });
44
- var defaultWidthStyles = css({
45
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
46
- ':nth-of-type(1n)::after': {
47
- flexBasis: '70%'
48
- },
49
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
50
- ':nth-of-type(2n)::after': {
51
- flexBasis: '50%'
52
- },
53
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
54
- ':nth-of-type(3n)::after': {
55
- flexBasis: '60%'
56
- },
57
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
58
- ':nth-of-type(4n)::after': {
59
- flexBasis: '90%'
60
- },
61
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
62
- ':nth-of-type(5n)::after': {
63
- flexBasis: '35%'
64
- },
65
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
66
- ':nth-of-type(6n)::after': {
67
- flexBasis: '77%'
68
- }
69
- });
70
- var customWidthStyles = css({
71
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
72
- '::after': {
73
- flexBasis: 'var(--width)'
74
- }
75
- });
76
- var beforeElementStyles = css({
77
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
78
- '::before': {
79
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
80
- width: skeletonItemElemSize,
81
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
82
- height: skeletonItemElemSize,
83
- flexShrink: 0,
84
- backgroundColor: skeletonColor,
85
- content: '""',
86
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
87
- marginInlineEnd: itemElemSpacing + itemElemSkeletonOffset,
88
- marginInlineStart: "var(--ds-space-025, 2px)"
89
- }
90
- });
91
- var avatarStyles = css({
92
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
93
- '::before': {
94
- borderRadius: '100%'
95
- }
96
- });
97
- var iconStyles = css({
98
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
99
- '::before': {
100
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
101
- borderRadius: borderRadius
102
- }
103
- });
30
+ /**
31
+ * These styles are defined using `css` rather than `cssMap` as there is a bug when using
32
+ * `cssMap` that causes a build failure due to the use of keyframes within this pseudo-element.
33
+ */
34
+ var shimmerStyles = null;
104
35
 
105
36
  /**
106
37
  * __Skeleton item__
@@ -115,30 +46,20 @@ var SkeletonItem = function SkeletonItem(_ref) {
115
46
  hasIcon = _ref.hasIcon,
116
47
  _ref$isShimmering = _ref.isShimmering,
117
48
  isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering,
49
+ _ref$isSideNavSkeleto = _ref.isSideNavSkeleton,
50
+ isSideNavSkeleton = _ref$isSideNavSkeleto === void 0 ? false : _ref$isSideNavSkeleto,
118
51
  testId = _ref.testId,
119
52
  width = _ref.width,
120
- _ref$cssFn = _ref.cssFn,
121
- cssFn = _ref$cssFn === void 0 ? noop : _ref$cssFn;
122
- propDeprecationWarning("@atlaskit/menu" || '', 'cssFn', cssFn !== noop, '' // TODO: Create DAC post when primitives/xcss are available as alternatives
123
- );
124
-
125
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
126
- var UNSAFE_overrides = css(cssFn());
127
- return jsx(SkeletonShimmer, {
128
- isShimmering: isShimmering
129
- }, function (_ref2) {
130
- var className = _ref2.className;
131
- return jsx("div", {
132
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
133
- className: className,
134
- style: {
135
- '--width': width
136
- },
137
- css: [skeletonStyles, (hasAvatar || hasIcon) && beforeElementStyles, hasAvatar && avatarStyles, hasIcon && iconStyles, width ? customWidthStyles : defaultWidthStyles,
138
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
139
- UNSAFE_overrides],
140
- "data-testid": testId
141
- });
53
+ xcss = _ref.xcss;
54
+ return /*#__PURE__*/React.createElement("div", {
55
+ className: 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]),
56
+ "data-testid": testId,
57
+ style: _objectSpread(_objectSpread({}, {
58
+ '--width': width
59
+ }), {}, {
60
+ "--_1j9jaml": ix("var(--ds-skeleton, ".concat(N20A, ")")),
61
+ "--_wb902m": ix("var(--ds-skeleton-subtle, ".concat(N30A, ")"))
62
+ })
142
63
  });
143
64
  };
144
65
  export default SkeletonItem;
@@ -8,4 +8,4 @@ export { default as SkeletonHeadingItem } from './menu-item/skeleton-heading-ite
8
8
  export { default as Section } from './menu-section/section';
9
9
  export { default as MenuGroup } from './menu-section/menu-group';
10
10
  export { default as PopupMenuGroup } from './menu-section/popup-menu-group';
11
- export type { ButtonItemProps, CSSFn, StatelessCSSFn, CustomItemComponentProps, CustomItemProps, HeadingItemProps, ItemState, LinkItemProps, MenuGroupProps, SectionProps, SkeletonHeadingItemProps, SkeletonItemProps, Dimension, MenuItemProps as BaseItemProps, MenuGroupSizing, RenderFunction, SectionProps as SectionBaseProps, } from './types';
11
+ export type { ButtonItemProps, CustomItemComponentProps, CustomItemProps, HeadingItemProps, LinkItemProps, MenuGroupProps, SectionProps, SkeletonHeadingItemProps, SkeletonItemProps, Dimension, MenuItemProps as BaseItemProps, MenuGroupSizing, RenderFunction, SectionProps as SectionBaseProps, } from './types';
@@ -1,4 +1,4 @@
1
- import { jsx } from '@emotion/react';
1
+ /// <reference types="react" />
2
2
  import type { SkeletonHeadingItemProps } from '../types';
3
3
  /**
4
4
  * __Skeleton heading item__
@@ -8,5 +8,5 @@ import type { SkeletonHeadingItemProps } from '../types';
8
8
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/skeleton-heading-item)
9
9
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
10
10
  */
11
- declare const SkeletonHeadingItem: ({ isShimmering, testId, width, cssFn, }: SkeletonHeadingItemProps) => jsx.JSX.Element;
11
+ declare const SkeletonHeadingItem: ({ isShimmering, testId, width, xcss, }: SkeletonHeadingItemProps) => JSX.Element;
12
12
  export default SkeletonHeadingItem;
@@ -1,4 +1,4 @@
1
- import { jsx } from '@emotion/react';
1
+ /// <reference types="react" />
2
2
  import type { SkeletonItemProps } from '../types';
3
3
  /**
4
4
  * __Skeleton item__
@@ -8,5 +8,5 @@ import type { SkeletonItemProps } from '../types';
8
8
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/skeleton-item)
9
9
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
10
10
  */
11
- declare const SkeletonItem: ({ hasAvatar, hasIcon, isShimmering, testId, width, cssFn, }: SkeletonItemProps) => jsx.JSX.Element;
11
+ declare const SkeletonItem: ({ hasAvatar, hasIcon, isShimmering, isSideNavSkeleton, testId, width, xcss, }: SkeletonItemProps) => JSX.Element;
12
12
  export default SkeletonItem;
@@ -1,5 +1,5 @@
1
1
  import { type ComponentType, type PropsWithChildren, type Ref } from 'react';
2
- import { type CSSObject } from '@emotion/react';
2
+ import { StrictXCSSProp } from '@atlaskit/css';
3
3
  import type { SpacingMode } from './internal/components/menu-context';
4
4
  export interface RenderFunction<TProps = {}> {
5
5
  (Component: ComponentType | string, props: TProps): React.ReactNode;
@@ -318,10 +318,14 @@ export interface SkeletonItemProps {
318
318
  */
319
319
  isShimmering?: boolean;
320
320
  /**
321
- * A function that overrides the styles of this component.
322
- * It receives the current styles and returns a customized styles object.
321
+ * When `true`, the size/spacing of the skeleton size/spacing is adjusted to match the side navigation menu item.
322
+ * @deprecated This API exists to support functionality in `@atlaskit/side-navigation` and should not be used. Once the new navigation is fully rolled out, this prop will be removed.
323
+ */
324
+ isSideNavSkeleton?: boolean;
325
+ /**
326
+ * Bounded style overrides.
323
327
  */
324
- cssFn?: StatelessCSSFn;
328
+ xcss?: StrictXCSSProp<'minHeight' | 'paddingBlock' | 'paddingInline' | 'paddingBlockStart' | 'paddingBlockEnd' | 'paddingInlineStart' | 'paddingInlineEnd', never>;
325
329
  }
326
330
  export interface HeadingItemProps {
327
331
  /**
@@ -364,29 +368,7 @@ export interface SkeletonHeadingItemProps {
364
368
  */
365
369
  isShimmering?: boolean;
366
370
  /**
367
- * A function that overrides the styles of this component.
368
- * It receives the current styles and returns a customized styles object.
369
- *
370
- * @deprecated This API is deprecated and will be removed in a future release. See DSP-2676 for more information.
371
+ * Bounded style overrides.
371
372
  */
372
- cssFn?: StatelessCSSFn;
373
- }
374
- export type ItemState = {
375
- isSelected: boolean;
376
- isDisabled: boolean;
377
- };
378
- /**
379
- * A function that overrides the styles of
380
- * menu components. It receives the current state
381
- * and should return a CSSObject.
382
- *
383
- * @see @atlaskit/menu/docs/85-overriding-item-styles
384
- * @deprecated This type is deprecated and will be removed in a future release. See DSP-2676 for more information.
385
- */
386
- export interface CSSFn<TState = ItemState extends void ? void : ItemState> {
387
- (currentState: TState): CSSObject | CSSObject[];
373
+ xcss?: StrictXCSSProp<'paddingBlock' | 'paddingInline' | 'paddingBlockStart' | 'paddingBlockEnd' | 'paddingInlineStart' | 'paddingInlineEnd', never>;
388
374
  }
389
- /**
390
- * @deprecated This type is deprecated and will be removed in a future release. See DSP-2676 for more information.
391
- */
392
- export type StatelessCSSFn = CSSFn<void>;
@@ -8,4 +8,4 @@ export { default as SkeletonHeadingItem } from './menu-item/skeleton-heading-ite
8
8
  export { default as Section } from './menu-section/section';
9
9
  export { default as MenuGroup } from './menu-section/menu-group';
10
10
  export { default as PopupMenuGroup } from './menu-section/popup-menu-group';
11
- export type { ButtonItemProps, CSSFn, StatelessCSSFn, CustomItemComponentProps, CustomItemProps, HeadingItemProps, ItemState, LinkItemProps, MenuGroupProps, SectionProps, SkeletonHeadingItemProps, SkeletonItemProps, Dimension, MenuItemProps as BaseItemProps, MenuGroupSizing, RenderFunction, SectionProps as SectionBaseProps, } from './types';
11
+ export type { ButtonItemProps, CustomItemComponentProps, CustomItemProps, HeadingItemProps, LinkItemProps, MenuGroupProps, SectionProps, SkeletonHeadingItemProps, SkeletonItemProps, Dimension, MenuItemProps as BaseItemProps, MenuGroupSizing, RenderFunction, SectionProps as SectionBaseProps, } from './types';
@@ -1,4 +1,4 @@
1
- import { jsx } from '@emotion/react';
1
+ /// <reference types="react" />
2
2
  import type { SkeletonHeadingItemProps } from '../types';
3
3
  /**
4
4
  * __Skeleton heading item__
@@ -8,5 +8,5 @@ import type { SkeletonHeadingItemProps } from '../types';
8
8
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/skeleton-heading-item)
9
9
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
10
10
  */
11
- declare const SkeletonHeadingItem: ({ isShimmering, testId, width, cssFn, }: SkeletonHeadingItemProps) => jsx.JSX.Element;
11
+ declare const SkeletonHeadingItem: ({ isShimmering, testId, width, xcss, }: SkeletonHeadingItemProps) => JSX.Element;
12
12
  export default SkeletonHeadingItem;
@@ -1,4 +1,4 @@
1
- import { jsx } from '@emotion/react';
1
+ /// <reference types="react" />
2
2
  import type { SkeletonItemProps } from '../types';
3
3
  /**
4
4
  * __Skeleton item__
@@ -8,5 +8,5 @@ import type { SkeletonItemProps } from '../types';
8
8
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/skeleton-item)
9
9
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
10
10
  */
11
- declare const SkeletonItem: ({ hasAvatar, hasIcon, isShimmering, testId, width, cssFn, }: SkeletonItemProps) => jsx.JSX.Element;
11
+ declare const SkeletonItem: ({ hasAvatar, hasIcon, isShimmering, isSideNavSkeleton, testId, width, xcss, }: SkeletonItemProps) => JSX.Element;
12
12
  export default SkeletonItem;