@atlaskit/menu 1.4.7 → 1.4.8

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 (48) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/entry-points/menu-item/button-item.js +0 -2
  3. package/dist/cjs/entry-points/menu-item/custom-item.js +0 -2
  4. package/dist/cjs/entry-points/menu-item/heading-item.js +0 -2
  5. package/dist/cjs/entry-points/menu-item/link-item.js +0 -2
  6. package/dist/cjs/entry-points/menu-item/skeleton-heading-item.js +0 -2
  7. package/dist/cjs/entry-points/menu-item/skeleton-item.js +0 -2
  8. package/dist/cjs/entry-points/menu-section/menu-group.js +0 -2
  9. package/dist/cjs/entry-points/menu-section/popup-menu-group.js +0 -2
  10. package/dist/cjs/entry-points/menu-section/section.js +0 -2
  11. package/dist/cjs/index.js +0 -10
  12. package/dist/cjs/internal/components/menu-item-primitive.js +25 -34
  13. package/dist/cjs/internal/components/skeleton-shimmer.js +4 -8
  14. package/dist/cjs/menu-item/button-item.js +21 -30
  15. package/dist/cjs/menu-item/custom-item.js +24 -32
  16. package/dist/cjs/menu-item/heading-item.js +8 -17
  17. package/dist/cjs/menu-item/link-item.js +23 -33
  18. package/dist/cjs/menu-item/skeleton-heading-item.js +11 -16
  19. package/dist/cjs/menu-item/skeleton-item.js +11 -17
  20. package/dist/cjs/menu-section/menu-group.js +10 -17
  21. package/dist/cjs/menu-section/popup-menu-group.js +6 -13
  22. package/dist/cjs/menu-section/section.js +16 -24
  23. package/dist/cjs/version.json +1 -1
  24. package/dist/es2019/internal/components/menu-item-primitive.js +9 -12
  25. package/dist/es2019/internal/components/skeleton-shimmer.js +3 -4
  26. package/dist/es2019/menu-item/button-item.js +4 -6
  27. package/dist/es2019/menu-item/custom-item.js +8 -7
  28. package/dist/es2019/menu-item/heading-item.js +3 -3
  29. package/dist/es2019/menu-item/link-item.js +5 -8
  30. package/dist/es2019/menu-item/skeleton-heading-item.js +6 -5
  31. package/dist/es2019/menu-item/skeleton-item.js +4 -3
  32. package/dist/es2019/menu-section/menu-group.js +4 -6
  33. package/dist/es2019/menu-section/popup-menu-group.js +3 -4
  34. package/dist/es2019/menu-section/section.js +9 -8
  35. package/dist/es2019/version.json +1 -1
  36. package/dist/esm/internal/components/menu-item-primitive.js +24 -27
  37. package/dist/esm/internal/components/skeleton-shimmer.js +5 -6
  38. package/dist/esm/menu-item/button-item.js +21 -24
  39. package/dist/esm/menu-item/custom-item.js +26 -26
  40. package/dist/esm/menu-item/heading-item.js +8 -9
  41. package/dist/esm/menu-item/link-item.js +23 -27
  42. package/dist/esm/menu-item/skeleton-heading-item.js +11 -10
  43. package/dist/esm/menu-item/skeleton-item.js +11 -10
  44. package/dist/esm/menu-section/menu-group.js +10 -13
  45. package/dist/esm/menu-section/popup-menu-group.js +7 -9
  46. package/dist/esm/menu-section/section.js +16 -16
  47. package/dist/esm/version.json +1 -1
  48. package/package.json +1 -1
@@ -1,29 +1,21 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
-
12
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
-
14
10
  var _react = require("react");
15
-
16
11
  var _react2 = require("@emotion/react");
17
-
18
12
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
19
-
20
13
  var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/menu-item-primitive"));
21
-
22
14
  var _excluded = ["children", "href", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
23
-
24
15
  var preventEvent = function preventEvent(e) {
25
16
  e.preventDefault();
26
17
  };
18
+
27
19
  /**
28
20
  * __Link item__
29
21
  *
@@ -32,34 +24,31 @@ var preventEvent = function preventEvent(e) {
32
24
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/link-item)
33
25
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
34
26
  */
35
-
36
-
37
- var LinkItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)( // Type needed on props to extract types with extract react types.
27
+ var LinkItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(
28
+ // Type needed on props to extract types with extract react types.
38
29
  function (props, ref) {
39
30
  var children = props.children,
40
- href = props.href,
41
- _props$cssFn = props.cssFn,
42
- cssFn = _props$cssFn === void 0 ? _noop.default : _props$cssFn,
43
- description = props.description,
44
- iconAfter = props.iconAfter,
45
- iconBefore = props.iconBefore,
46
- _props$isDisabled = props.isDisabled,
47
- isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
48
- _props$isSelected = props.isSelected,
49
- isSelected = _props$isSelected === void 0 ? false : _props$isSelected,
50
- onClick = props.onClick,
51
- testId = props.testId,
52
- overrides = props.overrides,
53
- onMouseDown = props.onMouseDown,
54
- shouldTitleWrap = props.shouldTitleWrap,
55
- shouldDescriptionWrap = props.shouldDescriptionWrap,
56
- rest = (0, _objectWithoutProperties2.default)(props, _excluded);
31
+ href = props.href,
32
+ _props$cssFn = props.cssFn,
33
+ cssFn = _props$cssFn === void 0 ? _noop.default : _props$cssFn,
34
+ description = props.description,
35
+ iconAfter = props.iconAfter,
36
+ iconBefore = props.iconBefore,
37
+ _props$isDisabled = props.isDisabled,
38
+ isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
39
+ _props$isSelected = props.isSelected,
40
+ isSelected = _props$isSelected === void 0 ? false : _props$isSelected,
41
+ onClick = props.onClick,
42
+ testId = props.testId,
43
+ overrides = props.overrides,
44
+ onMouseDown = props.onMouseDown,
45
+ shouldTitleWrap = props.shouldTitleWrap,
46
+ shouldDescriptionWrap = props.shouldDescriptionWrap,
47
+ rest = (0, _objectWithoutProperties2.default)(props, _excluded);
57
48
  var onMouseDownHandler = onMouseDown;
58
-
59
49
  if (!children) {
60
50
  return null;
61
51
  }
62
-
63
52
  return (0, _react2.jsx)(_menuItemPrimitive.default, (0, _extends2.default)({}, rest, {
64
53
  // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
65
54
  overrides: overrides,
@@ -70,7 +59,8 @@ function (props, ref) {
70
59
  description: description,
71
60
  shouldTitleWrap: shouldTitleWrap,
72
61
  shouldDescriptionWrap: shouldDescriptionWrap,
73
- css: // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
62
+ css:
63
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
74
64
  cssFn({
75
65
  isSelected: isSelected,
76
66
  isDisabled: isDisabled
@@ -78,7 +68,7 @@ function (props, ref) {
78
68
  title: children
79
69
  }), function (_ref) {
80
70
  var children = _ref.children,
81
- className = _ref.className;
71
+ className = _ref.className;
82
72
  return (0, _react2.jsx)("a", (0, _extends2.default)({
83
73
  "data-testid": testId
84
74
  }, rest, {
@@ -1,27 +1,22 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = require("@emotion/react");
11
-
12
9
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
13
-
14
10
  var _colors = require("@atlaskit/theme/colors");
15
-
16
11
  var _skeletonShimmer = _interopRequireDefault(require("../internal/components/skeleton-shimmer"));
17
-
18
12
  /** @jsx jsx */
13
+
19
14
  var skeletonStyles = (0, _react.css)({
20
- padding: "var(--ds-scale-0, 0px)".concat(" ", "var(--ds-scale-250, 20px)"),
15
+ padding: "var(--ds-space-0, 0px)".concat(" ", "var(--ds-space-250, 20px)"),
21
16
  '::after': {
22
17
  display: 'block',
23
18
  width: '30%',
24
- height: "var(--ds-scale-100, 8px)",
19
+ height: "var(--ds-space-100, 8px)",
25
20
  backgroundColor: "var(--ds-skeleton, ".concat(_colors.N20A, ")"),
26
21
  borderRadius: 100,
27
22
  content: '""'
@@ -37,6 +32,7 @@ var customWidthStyles = (0, _react.css)({
37
32
  width: 'var(--width)'
38
33
  }
39
34
  });
35
+
40
36
  /**
41
37
  * __Skeleton heading item__
42
38
  *
@@ -45,14 +41,13 @@ var customWidthStyles = (0, _react.css)({
45
41
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/skeleton-heading-item)
46
42
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
47
43
  */
48
-
49
44
  var SkeletonHeadingItem = function SkeletonHeadingItem(_ref) {
50
45
  var _ref$isShimmering = _ref.isShimmering,
51
- isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering,
52
- testId = _ref.testId,
53
- width = _ref.width,
54
- _ref$cssFn = _ref.cssFn,
55
- cssFn = _ref$cssFn === void 0 ? _noop.default : _ref$cssFn;
46
+ isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering,
47
+ testId = _ref.testId,
48
+ width = _ref.width,
49
+ _ref$cssFn = _ref.cssFn,
50
+ cssFn = _ref$cssFn === void 0 ? _noop.default : _ref$cssFn;
56
51
  return (0, _react.jsx)(_skeletonShimmer.default, {
57
52
  isShimmering: isShimmering
58
53
  }, function (_ref2) {
@@ -62,13 +57,13 @@ var SkeletonHeadingItem = function SkeletonHeadingItem(_ref) {
62
57
  style: {
63
58
  '--width': width
64
59
  },
65
- css: [skeletonStyles, width ? customWidthStyles : defaultWidthStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
60
+ css: [skeletonStyles, width ? customWidthStyles : defaultWidthStyles,
61
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
66
62
  (0, _react.css)(cssFn(undefined))],
67
63
  "data-ds--menu--skeleton-heading-item": true,
68
64
  "data-testid": testId
69
65
  });
70
66
  });
71
67
  };
72
-
73
68
  var _default = SkeletonHeadingItem;
74
69
  exports.default = _default;
@@ -1,23 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = require("@emotion/react");
11
-
12
9
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
13
-
14
10
  var _colors = require("@atlaskit/theme/colors");
15
-
16
11
  var _constants = require("@atlaskit/theme/constants");
17
-
18
12
  var _skeletonShimmer = _interopRequireDefault(require("../internal/components/skeleton-shimmer"));
19
-
20
13
  /** @jsx jsx */
14
+
21
15
  var gridSize = (0, _constants.gridSize)();
22
16
  var borderRadius = (0, _constants.borderRadius)();
23
17
  var itemElemSpacing = gridSize * 1.5;
@@ -92,6 +86,7 @@ var iconStyles = (0, _react.css)({
92
86
  borderRadius: borderRadius
93
87
  }
94
88
  });
89
+
95
90
  /**
96
91
  * __Skeleton item__
97
92
  *
@@ -100,16 +95,15 @@ var iconStyles = (0, _react.css)({
100
95
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/skeleton-item)
101
96
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
102
97
  */
103
-
104
98
  var SkeletonItem = function SkeletonItem(_ref) {
105
99
  var hasAvatar = _ref.hasAvatar,
106
- hasIcon = _ref.hasIcon,
107
- _ref$isShimmering = _ref.isShimmering,
108
- isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering,
109
- testId = _ref.testId,
110
- width = _ref.width,
111
- _ref$cssFn = _ref.cssFn,
112
- cssFn = _ref$cssFn === void 0 ? _noop.default : _ref$cssFn;
100
+ hasIcon = _ref.hasIcon,
101
+ _ref$isShimmering = _ref.isShimmering,
102
+ isShimmering = _ref$isShimmering === void 0 ? false : _ref$isShimmering,
103
+ testId = _ref.testId,
104
+ width = _ref.width,
105
+ _ref$cssFn = _ref.cssFn,
106
+ cssFn = _ref$cssFn === void 0 ? _noop.default : _ref$cssFn;
113
107
  return (0, _react.jsx)(_skeletonShimmer.default, {
114
108
  isShimmering: isShimmering
115
109
  }, function (_ref2) {
@@ -119,12 +113,12 @@ var SkeletonItem = function SkeletonItem(_ref) {
119
113
  style: {
120
114
  '--width': width
121
115
  },
122
- css: [skeletonStyles, (hasAvatar || hasIcon) && beforeElementStyles, hasAvatar && avatarStyles, hasIcon && iconStyles, width ? customWidthStyles : defaultWidthStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
116
+ css: [skeletonStyles, (hasAvatar || hasIcon) && beforeElementStyles, hasAvatar && avatarStyles, hasIcon && iconStyles, width ? customWidthStyles : defaultWidthStyles,
117
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
123
118
  (0, _react.css)(cssFn())],
124
119
  "data-testid": testId
125
120
  });
126
121
  });
127
122
  };
128
-
129
123
  var _default = SkeletonItem;
130
124
  exports.default = _default;
@@ -1,22 +1,15 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
-
12
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
-
14
10
  var _react = require("@emotion/react");
15
-
16
11
  var _dsExplorations = require("@atlaskit/ds-explorations");
17
-
18
12
  var _excluded = ["maxWidth", "minWidth", "minHeight", "maxHeight", "testId", "role"];
19
-
20
13
  /**
21
14
  * __Menu group__
22
15
  *
@@ -27,13 +20,14 @@ var _excluded = ["maxWidth", "minWidth", "minHeight", "maxHeight", "testId", "ro
27
20
  */
28
21
  var MenuGroup = function MenuGroup(_ref) {
29
22
  var maxWidth = _ref.maxWidth,
30
- minWidth = _ref.minWidth,
31
- minHeight = _ref.minHeight,
32
- maxHeight = _ref.maxHeight,
33
- testId = _ref.testId,
34
- role = _ref.role,
35
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
36
- return (// @ts-ignore type of rest/children needs to be made stricter to fit in Box -- string shouldn't be allowed
23
+ minWidth = _ref.minWidth,
24
+ minHeight = _ref.minHeight,
25
+ maxHeight = _ref.maxHeight,
26
+ testId = _ref.testId,
27
+ role = _ref.role,
28
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
29
+ return (
30
+ // @ts-ignore type of rest/children needs to be made stricter to fit in Box -- string shouldn't be allowed
37
31
  (0, _react.jsx)(_dsExplorations.UNSAFE_Box, (0, _extends2.default)({
38
32
  UNSAFE_style: {
39
33
  minWidth: minWidth,
@@ -46,11 +40,10 @@ var MenuGroup = function MenuGroup(_ref) {
46
40
  overflow: "auto",
47
41
  testId: testId,
48
42
  role: role,
49
- position: "static" // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
50
-
43
+ position: "static"
44
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
51
45
  }, rest))
52
46
  );
53
47
  };
54
-
55
48
  var _default = MenuGroup;
56
49
  exports.default = _default;
@@ -1,38 +1,31 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
-
12
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
-
14
10
  var _react = require("@emotion/react");
15
-
16
11
  var _menuGroup = _interopRequireDefault(require("./menu-group"));
17
-
18
12
  var _excluded = ["maxWidth", "minWidth"];
19
-
20
13
  /**
21
14
  * @deprecated
22
15
  */
23
16
  var PopupMenuGroup = function PopupMenuGroup(_ref) {
24
17
  var _ref$maxWidth = _ref.maxWidth,
25
- maxWidth = _ref$maxWidth === void 0 ? 800 : _ref$maxWidth,
26
- _ref$minWidth = _ref.minWidth,
27
- minWidth = _ref$minWidth === void 0 ? 320 : _ref$minWidth,
28
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
29
- return (// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
18
+ maxWidth = _ref$maxWidth === void 0 ? 800 : _ref$maxWidth,
19
+ _ref$minWidth = _ref.minWidth,
20
+ minWidth = _ref$minWidth === void 0 ? 320 : _ref$minWidth,
21
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
22
+ return (
23
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
30
24
  (0, _react.jsx)(_menuGroup.default, (0, _extends2.default)({
31
25
  maxWidth: maxWidth,
32
26
  minWidth: minWidth
33
27
  }, rest))
34
28
  );
35
29
  };
36
-
37
30
  var _default = PopupMenuGroup;
38
31
  exports.default = _default;
@@ -1,40 +1,30 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
-
12
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
-
14
10
  var _react = require("react");
15
-
16
11
  var _react2 = require("@emotion/react");
17
-
18
12
  var _colors = require("@atlaskit/theme/colors");
19
-
20
13
  var _constants = require("@atlaskit/theme/constants");
21
-
22
14
  var _typography = require("@atlaskit/theme/typography");
23
-
24
15
  var _headingItem = _interopRequireDefault(require("../menu-item/heading-item"));
25
-
26
16
  var _excluded = ["children", "overrides", "title", "testId", "isScrollable", "hasSeparator", "id"];
27
17
  var gridSize = (0, _constants.gridSize)();
28
18
  var itemHeadingTopMargin = gridSize * 2.5;
29
- var itemHeadingBottomMargin = gridSize * 0.75; // Skeleton content is slightly shorter than the real content.
19
+ var itemHeadingBottomMargin = gridSize * 0.75;
20
+ // Skeleton content is slightly shorter than the real content.
30
21
  // Because of that we slightly increase the top margin to offset this so the
31
22
  // containing size both real and skeleton always equal approx 30px.
32
-
33
23
  var itemHeadingContentHeight = _typography.headingSizes.h100.lineHeight;
34
24
  var skeletonHeadingHeight = gridSize;
35
25
  var skeletonHeadingMarginOffset = 3;
36
- var skeletonHeadingTopMargin = itemHeadingTopMargin + (itemHeadingContentHeight - skeletonHeadingHeight) - skeletonHeadingMarginOffset; // We want to move the entire body up by 3px without affecting the height of the skeleton container.
37
-
26
+ var skeletonHeadingTopMargin = itemHeadingTopMargin + (itemHeadingContentHeight - skeletonHeadingHeight) - skeletonHeadingMarginOffset;
27
+ // We want to move the entire body up by 3px without affecting the height of the skeleton container.
38
28
  var skeletonHeadingBottomMargin = itemHeadingBottomMargin + skeletonHeadingMarginOffset;
39
29
  var sectionPaddingTopBottom = gridSize * 0.75;
40
30
  var VAR_SEPARATOR_COLOR = '--ds-menu-seperator-color';
@@ -85,6 +75,7 @@ var noSeparatorStyles = (0, _react2.css)({
85
75
  marginTop: -6
86
76
  }
87
77
  });
78
+
88
79
  /**
89
80
  * __Section__
90
81
  *
@@ -93,24 +84,25 @@ var noSeparatorStyles = (0, _react2.css)({
93
84
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/section)
94
85
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
95
86
  */
96
-
97
87
  var Section = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
98
88
  var children = _ref.children,
99
- overrides = _ref.overrides,
100
- title = _ref.title,
101
- testId = _ref.testId,
102
- isScrollable = _ref.isScrollable,
103
- hasSeparator = _ref.hasSeparator,
104
- id = _ref.id,
105
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
106
- var childrenMarkup = title !== undefined ? (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_headingItem.default // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
89
+ overrides = _ref.overrides,
90
+ title = _ref.title,
91
+ testId = _ref.testId,
92
+ isScrollable = _ref.isScrollable,
93
+ hasSeparator = _ref.hasSeparator,
94
+ id = _ref.id,
95
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
96
+ var childrenMarkup = title !== undefined ? (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_headingItem.default
97
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
107
98
  , {
108
99
  cssFn: overrides && overrides.HeadingItem && overrides.HeadingItem.cssFn,
109
100
  testId: testId && "".concat(testId, "--heading"),
110
101
  "aria-hidden": true
111
102
  }, title), children) : children;
112
103
  return (0, _react2.jsx)("div", (0, _extends2.default)({}, rest, {
113
- id: id // NOTE: Firefox allows elements that have "overflow: auto" to gain focus (as if it had tab-index="0")
104
+ id: id
105
+ // NOTE: Firefox allows elements that have "overflow: auto" to gain focus (as if it had tab-index="0")
114
106
  // We have made a deliberate choice to leave this behaviour as is.
115
107
  ,
116
108
  css: [sectionStyles, isScrollable ? scrollableStyles : unscrollableStyles, hasSeparator ? separatorStyles : noSeparatorStyles],
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "sideEffects": false
5
5
  }
@@ -5,21 +5,20 @@ import FocusRing from '@atlaskit/focus-ring';
5
5
  import { N20, N200, N30 } from '@atlaskit/theme/colors';
6
6
  import { fontSize as fontSizeFn } from '@atlaskit/theme/constants';
7
7
  import { headingSizes } from '@atlaskit/theme/typography';
8
-
9
- const defaultRender = (Component, props) => // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
8
+ const defaultRender = (Component, props) =>
9
+ // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
10
10
  jsx(Component, props);
11
-
12
11
  const fontSize = fontSizeFn();
13
- const itemMinHeight = "var(--ds-scale-500, 40px)";
12
+ const itemMinHeight = "var(--ds-space-500, 40px)";
14
13
  const beforeElementStyles = css({
15
14
  display: 'flex',
16
- marginRight: "var(--ds-scale-150, 12px)",
15
+ marginRight: "var(--ds-space-150, 12px)",
17
16
  alignItems: 'center',
18
17
  flexShrink: 0
19
18
  });
20
19
  const afterElementStyles = css({
21
20
  display: 'flex',
22
- marginLeft: "var(--ds-scale-150, 12px)",
21
+ marginLeft: "var(--ds-space-150, 12px)",
23
22
  alignItems: 'center',
24
23
  flexShrink: 0
25
24
  });
@@ -45,7 +44,7 @@ const wordBreakStyles = css({
45
44
  wordBreak: 'break-word'
46
45
  });
47
46
  const descriptionStyles = css({
48
- marginTop: "var(--ds-scale-050, 3px)",
47
+ marginTop: "var(--ds-space-050, 3px)",
49
48
  color: `var(--ds-text-subtlest, ${N200})`,
50
49
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
51
50
  fontSize: headingSizes.h200.size
@@ -58,10 +57,9 @@ const primitiveStyles = css({
58
57
  boxSizing: 'border-box',
59
58
  width: '100%',
60
59
  minHeight: itemMinHeight,
61
- // TODO Delete this comment after verifying spacing token -> previous value `0`
62
- margin: "var(--ds-scale-0, 0px)",
60
+ margin: "var(--ds-space-0, 0px)",
63
61
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
64
- padding: `${"var(--ds-scale-100, 8px)"} ${"var(--ds-scale-250, 20px)"}`,
62
+ padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-250, 20px)"}`,
65
63
  alignItems: 'center',
66
64
  border: 0,
67
65
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
@@ -118,6 +116,7 @@ const selectedStyles = css({
118
116
  color: "var(--ds-text-selected, currentColor)"
119
117
  }
120
118
  });
119
+
121
120
  /**
122
121
  * __Menu item primitive__
123
122
  *
@@ -132,7 +131,6 @@ const selectedStyles = css({
132
131
  * </MenuItemPrimitive>
133
132
  * ```
134
133
  */
135
-
136
134
  const MenuItemPrimitive = ({
137
135
  children,
138
136
  title,
@@ -174,5 +172,4 @@ const MenuItemPrimitive = ({
174
172
  }));
175
173
  });
176
174
  };
177
-
178
175
  export default MenuItemPrimitive;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
+
2
3
  import { ClassNames, css, jsx, keyframes } from '@emotion/react';
3
4
  import { N20A, N30A } from '@atlaskit/theme/colors';
4
-
5
5
  /**
6
6
  * These keyframes are mirrored in:
7
7
  * packages/design-system/theme/src/constants.tsx
@@ -16,13 +16,13 @@ const shimmerKeyframes = keyframes({
16
16
  backgroundColor: `var(--ds-skeleton-subtle, ${N30A})`
17
17
  }
18
18
  });
19
+
19
20
  /**
20
21
  * These styles are mirrored in:
21
22
  * packages/design-system/theme/src/constants.tsx
22
23
  *
23
24
  * Please update both.
24
25
  */
25
-
26
26
  const shimmerStyles = css({
27
27
  '::before, ::after': {
28
28
  animationDirection: 'alternate',
@@ -33,6 +33,7 @@ const shimmerStyles = css({
33
33
  backgroundColor: `var(--ds-skeleton, ${N20A})`
34
34
  }
35
35
  });
36
+
36
37
  /**
37
38
  * __Skeleton shimmer__
38
39
  *
@@ -46,7 +47,6 @@ const shimmerStyles = css({
46
47
  *
47
48
  * @internal
48
49
  */
49
-
50
50
  const SkeletonShimmer = ({
51
51
  children,
52
52
  isShimmering = false
@@ -57,5 +57,4 @@ const SkeletonShimmer = ({
57
57
  className: isShimmering ? css(shimmerStyles) : undefined
58
58
  }));
59
59
  };
60
-
61
60
  export default SkeletonShimmer;
@@ -1,11 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
-
3
2
  /** @jsx jsx */
4
3
  import { forwardRef, memo } from 'react';
5
4
  import { jsx } from '@emotion/react';
6
5
  import noop from '@atlaskit/ds-lib/noop';
7
6
  import MenuItemPrimitive from '../internal/components/menu-item-primitive';
8
-
9
7
  /**
10
8
  * __Button item__
11
9
  *
@@ -14,7 +12,8 @@ import MenuItemPrimitive from '../internal/components/menu-item-primitive';
14
12
  * - [Examples](https://atlaskit.atlassian.com/packages/design-system/menu/docs/button-item)
15
13
  * - [Code](https://atlaskit.atlassian.com/packages/design-system/menu)
16
14
  */
17
- const ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef( // Type needed on props to extract types with extract react types.
15
+ const ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(
16
+ // Type needed on props to extract types with extract react types.
18
17
  (props, ref) => {
19
18
  const {
20
19
  children,
@@ -33,11 +32,9 @@ const ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef( // Type needed on
33
32
  ...rest
34
33
  } = props;
35
34
  const onMouseDownHandler = onMouseDown;
36
-
37
35
  if (!children) {
38
36
  return null;
39
37
  }
40
-
41
38
  return jsx(MenuItemPrimitive, _extends({}, rest, {
42
39
  // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
43
40
  overrides: overrides,
@@ -49,7 +46,8 @@ const ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef( // Type needed on
49
46
  title: children,
50
47
  shouldTitleWrap: shouldTitleWrap,
51
48
  shouldDescriptionWrap: shouldDescriptionWrap,
52
- css: // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
49
+ css:
50
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
53
51
  cssFn({
54
52
  isSelected,
55
53
  isDisabled
@@ -1,15 +1,15 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
-
3
2
  /** @jsx jsx */
3
+
4
4
  import { forwardRef, memo } from 'react';
5
5
  import { css, jsx } from '@emotion/react';
6
6
  import noop from '@atlaskit/ds-lib/noop';
7
7
  import MenuItemPrimitive from '../internal/components/menu-item-primitive';
8
-
9
8
  const preventEvent = e => {
10
9
  e.preventDefault();
11
- }; // Dirty hack to get generics working with forward ref [1/2]
10
+ };
12
11
 
12
+ // Dirty hack to get generics working with forward ref [1/2]
13
13
 
14
14
  /**
15
15
  * __Custom item__
@@ -37,11 +37,9 @@ const CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
37
37
  ...rest
38
38
  }, ref) => {
39
39
  const onMouseDownHandler = onMouseDown;
40
-
41
40
  if (!Component) {
42
41
  return null;
43
42
  }
44
-
45
43
  return jsx(MenuItemPrimitive, _extends({}, rest, {
46
44
  // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
47
45
  overrides: overrides,
@@ -52,7 +50,8 @@ const CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
52
50
  isSelected: isSelected,
53
51
  isDisabled: isDisabled,
54
52
  shouldTitleWrap: shouldTitleWrap,
55
- shouldDescriptionWrap: shouldDescriptionWrap // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
53
+ shouldDescriptionWrap: shouldDescriptionWrap
54
+ // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
56
55
  ,
57
56
  css: css(cssFn({
58
57
  isDisabled,
@@ -73,6 +72,8 @@ const CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
73
72
  tabIndex: isDisabled ? -1 : undefined,
74
73
  "aria-disabled": isDisabled
75
74
  }), children));
76
- }) // Dirty hack to get generics working with forward ref [2/2]
75
+ })
76
+ // Dirty hack to get generics working with forward ref [2/2]
77
77
  );
78
+
78
79
  export default CustomItem;