@atlaskit/menu 1.2.0 → 1.2.4

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 (41) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/index.js +14 -14
  3. package/dist/cjs/internal/components/menu-item-primitive.js +12 -21
  4. package/dist/cjs/menu-item/button-item.js +7 -5
  5. package/dist/cjs/menu-item/custom-item.js +9 -7
  6. package/dist/cjs/menu-item/heading-item.js +3 -5
  7. package/dist/cjs/menu-item/link-item.js +9 -6
  8. package/dist/cjs/menu-item/skeleton-heading-item.js +1 -3
  9. package/dist/cjs/menu-item/skeleton-item.js +1 -3
  10. package/dist/cjs/menu-section/menu-group.js +2 -2
  11. package/dist/cjs/menu-section/popup-menu-group.js +2 -2
  12. package/dist/cjs/menu-section/section.js +3 -5
  13. package/dist/cjs/version.json +1 -1
  14. package/dist/es2019/internal/components/menu-item-primitive.js +12 -20
  15. package/dist/es2019/menu-item/button-item.js +5 -3
  16. package/dist/es2019/menu-item/custom-item.js +6 -5
  17. package/dist/es2019/menu-item/heading-item.js +1 -2
  18. package/dist/es2019/menu-item/link-item.js +6 -4
  19. package/dist/es2019/menu-item/skeleton-heading-item.js +1 -2
  20. package/dist/es2019/menu-item/skeleton-item.js +1 -2
  21. package/dist/es2019/menu-section/section.js +1 -2
  22. package/dist/es2019/version.json +1 -1
  23. package/dist/esm/internal/components/menu-item-primitive.js +12 -20
  24. package/dist/esm/menu-item/button-item.js +7 -5
  25. package/dist/esm/menu-item/custom-item.js +8 -7
  26. package/dist/esm/menu-item/heading-item.js +3 -3
  27. package/dist/esm/menu-item/link-item.js +8 -6
  28. package/dist/esm/menu-item/skeleton-heading-item.js +1 -2
  29. package/dist/esm/menu-item/skeleton-item.js +1 -2
  30. package/dist/esm/menu-section/menu-group.js +2 -1
  31. package/dist/esm/menu-section/popup-menu-group.js +2 -1
  32. package/dist/esm/menu-section/section.js +3 -3
  33. package/dist/esm/version.json +1 -1
  34. package/dist/types/internal/components/menu-item-primitive.d.ts +2 -1
  35. package/dist/types/menu-item/custom-item.d.ts +1 -0
  36. package/dist/types/menu-item/skeleton-heading-item.d.ts +1 -0
  37. package/dist/types/menu-item/skeleton-item.d.ts +1 -0
  38. package/dist/types/menu-section/menu-group.d.ts +1 -0
  39. package/dist/types/menu-section/popup-menu-group.d.ts +1 -0
  40. package/dist/types/types.d.ts +0 -2
  41. package/package.json +9 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/menu
2
2
 
3
+ ## 1.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.2.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`f460cc7c411`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f460cc7c411) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving bundle size.
14
+ - Updated dependencies
15
+
16
+ ## 1.2.2
17
+
18
+ ### Patch Changes
19
+
20
+ - [`2eeb5c46710`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2eeb5c46710) - Menu items can take `data-testid` directly again however we recommend to still use the officially supported `testId` prop instead. The `data-testid` prop was unintentionally removed in a previous version however will be removed as a breaking change in a later major version and remains not officially typed.
21
+
22
+ ## 1.2.1
23
+
24
+ ### Patch Changes
25
+
26
+ - [`2b2290121eb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2b2290121eb) - Raised the minimum version carat range of focus ring to latest.
27
+
3
28
  ## 1.2.0
4
29
 
5
30
  ### Minor Changes
package/dist/cjs/index.js CHANGED
@@ -11,34 +11,34 @@ Object.defineProperty(exports, "ButtonItem", {
11
11
  return _buttonItem.default;
12
12
  }
13
13
  });
14
- Object.defineProperty(exports, "LinkItem", {
14
+ Object.defineProperty(exports, "CustomItem", {
15
15
  enumerable: true,
16
16
  get: function get() {
17
- return _linkItem.default;
17
+ return _customItem.default;
18
18
  }
19
19
  });
20
- Object.defineProperty(exports, "CustomItem", {
20
+ Object.defineProperty(exports, "HeadingItem", {
21
21
  enumerable: true,
22
22
  get: function get() {
23
- return _customItem.default;
23
+ return _headingItem.default;
24
24
  }
25
25
  });
26
- Object.defineProperty(exports, "SkeletonItem", {
26
+ Object.defineProperty(exports, "LinkItem", {
27
27
  enumerable: true,
28
28
  get: function get() {
29
- return _skeletonItem.default;
29
+ return _linkItem.default;
30
30
  }
31
31
  });
32
- Object.defineProperty(exports, "HeadingItem", {
32
+ Object.defineProperty(exports, "MenuGroup", {
33
33
  enumerable: true,
34
34
  get: function get() {
35
- return _headingItem.default;
35
+ return _menuGroup.default;
36
36
  }
37
37
  });
38
- Object.defineProperty(exports, "SkeletonHeadingItem", {
38
+ Object.defineProperty(exports, "PopupMenuGroup", {
39
39
  enumerable: true,
40
40
  get: function get() {
41
- return _skeletonHeadingItem.default;
41
+ return _popupMenuGroup.default;
42
42
  }
43
43
  });
44
44
  Object.defineProperty(exports, "Section", {
@@ -47,16 +47,16 @@ Object.defineProperty(exports, "Section", {
47
47
  return _section.default;
48
48
  }
49
49
  });
50
- Object.defineProperty(exports, "MenuGroup", {
50
+ Object.defineProperty(exports, "SkeletonHeadingItem", {
51
51
  enumerable: true,
52
52
  get: function get() {
53
- return _menuGroup.default;
53
+ return _skeletonHeadingItem.default;
54
54
  }
55
55
  });
56
- Object.defineProperty(exports, "PopupMenuGroup", {
56
+ Object.defineProperty(exports, "SkeletonItem", {
57
57
  enumerable: true,
58
58
  get: function get() {
59
- return _popupMenuGroup.default;
59
+ return _skeletonItem.default;
60
60
  }
61
61
  });
62
62
 
@@ -19,8 +19,6 @@ var _constants = require("@atlaskit/theme/constants");
19
19
 
20
20
  var _typography = require("@atlaskit/theme/typography");
21
21
 
22
- var _tokens = require("@atlaskit/tokens");
23
-
24
22
  /** @jsx jsx */
25
23
  var defaultRender = function defaultRender(Component, props) {
26
24
  return (0, _core.jsx)(Component, props);
@@ -67,7 +65,7 @@ var wordBreakStyles = (0, _core.css)({
67
65
  });
68
66
  var descriptionStyles = (0, _core.css)({
69
67
  marginTop: itemDescriptionSpacing,
70
- color: (0, _tokens.token)('color.text.lowEmphasis', _colors.N200),
68
+ color: "var(--ds-text-lowEmphasis, ".concat(_colors.N200, ")"),
71
69
  fontSize: _typography.headingSizes.h200.size
72
70
  });
73
71
  var primitiveStyles = (0, _core.css)({
@@ -100,11 +98,11 @@ var unselectedStyles = (0, _core.css)({
100
98
  color: 'currentColor'
101
99
  },
102
100
  ':hover': {
103
- backgroundColor: (0, _tokens.token)('color.background.transparentNeutral.hover', _colors.N20),
101
+ backgroundColor: "var(--ds-background-transparentNeutral-hover, ".concat(_colors.N20, ")"),
104
102
  color: 'currentColor'
105
103
  },
106
104
  ':active': {
107
- backgroundColor: (0, _tokens.token)('color.background.transparentNeutral.pressed', _colors.N30),
105
+ backgroundColor: "var(--ds-background-transparentNeutral-pressed, ".concat(_colors.N30, ")"),
108
106
  boxShadow: 'none',
109
107
  color: 'currentColor'
110
108
  }
@@ -113,28 +111,23 @@ var disabledStyles = (0, _core.css)({
113
111
  cursor: 'not-allowed',
114
112
  '&, :hover, :active': {
115
113
  backgroundColor: 'transparent',
116
- color: (0, _tokens.token)('color.text.disabled', _colors.N200)
114
+ color: "var(--ds-text-disabled, ".concat(_colors.N200, ")")
117
115
  }
118
116
  });
119
117
  var selectedStyles = (0, _core.css)({
120
- backgroundColor: (0, _tokens.token)('color.background.selected.resting', _colors.N20),
121
- // Suppress the need for a fallback as selected color isn't used in the non-tokens world.
122
- // When removing fallbacks make sure to remove this supression.
123
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
124
- color: (0, _tokens.token)('color.text.selected'),
118
+ backgroundColor: "var(--ds-background-selected-resting, ".concat(_colors.N20, ")"),
119
+ // Fallback set as babel plugin inserts one otherwise
120
+ color: "var(--ds-text-selected, currentColor)",
125
121
  ':visited': {
126
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
127
- color: (0, _tokens.token)('color.text.selected')
122
+ color: "var(--ds-text-selected, currentColor)"
128
123
  },
129
124
  ':hover': {
130
- backgroundColor: (0, _tokens.token)('color.background.selected.hover', _colors.N20),
131
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
132
- color: (0, _tokens.token)('color.text.selected')
125
+ backgroundColor: "var(--ds-background-selected-hover, ".concat(_colors.N20, ")"),
126
+ color: "var(--ds-text-selected, currentColor)"
133
127
  },
134
128
  ':active': {
135
- backgroundColor: (0, _tokens.token)('color.background.selected.pressed', _colors.N30),
136
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
137
- color: (0, _tokens.token)('color.text.selected')
129
+ backgroundColor: "var(--ds-background-selected-pressed, ".concat(_colors.N30, ")"),
130
+ color: "var(--ds-text-selected, currentColor)"
138
131
  }
139
132
  });
140
133
  /**
@@ -159,7 +152,6 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
159
152
  iconAfter = _ref.iconAfter,
160
153
  iconBefore = _ref.iconBefore,
161
154
  overrides = _ref.overrides,
162
- testId = _ref.testId,
163
155
  className = _ref.className,
164
156
  _ref$shouldTitleWrap = _ref.shouldTitleWrap,
165
157
  shouldTitleWrap = _ref$shouldTitleWrap === void 0 ? false : _ref$shouldTitleWrap,
@@ -176,7 +168,6 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
176
168
  return (0, _core.jsx)(_focusRing.default, {
177
169
  isInset: true
178
170
  }, children({
179
- 'data-testid': testId,
180
171
  className: cx([cn([primitiveStyles, !isDisabled && !isSelected && unselectedStyles, !isDisabled && isSelected && selectedStyles, isDisabled ? disabledStyles : interactiveStyles]), className]),
181
172
  children: (0, _core.jsx)(_react.Fragment, null, iconBefore && (0, _core.jsx)("span", {
182
173
  "data-item-elem-before": true,
@@ -21,7 +21,7 @@ var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/
21
21
 
22
22
  var _useBlurOnMouseDown = require("../internal/hooks/use-blur-on-mouse-down");
23
23
 
24
- /** @jsx jsx */
24
+ var _excluded = ["children", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
25
25
 
26
26
  /**
27
27
  * __Button item__
@@ -49,7 +49,7 @@ function (props, ref) {
49
49
  onMouseDown = props.onMouseDown,
50
50
  shouldTitleWrap = props.shouldTitleWrap,
51
51
  shouldDescriptionWrap = props.shouldDescriptionWrap,
52
- rest = (0, _objectWithoutProperties2.default)(props, ["children", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"]);
52
+ rest = (0, _objectWithoutProperties2.default)(props, _excluded);
53
53
  var onMouseDownHandler = (0, _useBlurOnMouseDown.useBlurOnMouseDown)(onMouseDown);
54
54
 
55
55
  if (!children) {
@@ -59,7 +59,6 @@ function (props, ref) {
59
59
  return (0, _core.jsx)(_menuItemPrimitive.default, (0, _extends2.default)({}, rest, {
60
60
  // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
61
61
  overrides: overrides,
62
- testId: testId,
63
62
  iconBefore: iconBefore,
64
63
  iconAfter: iconAfter,
65
64
  isDisabled: isDisabled,
@@ -75,8 +74,11 @@ function (props, ref) {
75
74
  })
76
75
  }), function (_ref) {
77
76
  var children = _ref.children,
78
- props = (0, _objectWithoutProperties2.default)(_ref, ["children"]);
79
- return (0, _core.jsx)("button", (0, _extends2.default)({}, rest, props, {
77
+ className = _ref.className;
78
+ return (0, _core.jsx)("button", (0, _extends2.default)({
79
+ "data-testid": testId
80
+ }, rest, {
81
+ className: className,
80
82
  ref: ref,
81
83
  disabled: isDisabled,
82
84
  onClick: onClick,
@@ -21,7 +21,8 @@ var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/
21
21
 
22
22
  var _useBlurOnMouseDown = require("../internal/hooks/use-blur-on-mouse-down");
23
23
 
24
- /** @jsx jsx */
24
+ var _excluded = ["component", "cssFn", "isDisabled", "isSelected", "onClick", "testId", "children", "description", "iconAfter", "iconBefore", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
25
+
25
26
  var preventEvent = function preventEvent(e) {
26
27
  e.preventDefault();
27
28
  }; // Dirty hack to get generics working with forward ref [1/2]
@@ -53,7 +54,7 @@ var CustomItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
53
54
  onMouseDown = _ref.onMouseDown,
54
55
  shouldTitleWrap = _ref.shouldTitleWrap,
55
56
  shouldDescriptionWrap = _ref.shouldDescriptionWrap,
56
- rest = (0, _objectWithoutProperties2.default)(_ref, ["component", "cssFn", "isDisabled", "isSelected", "onClick", "testId", "children", "description", "iconAfter", "iconBefore", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"]);
57
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
57
58
  var onMouseDownHandler = (0, _useBlurOnMouseDown.useBlurOnMouseDown)(onMouseDown);
58
59
 
59
60
  if (!Component) {
@@ -70,8 +71,7 @@ var CustomItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
70
71
  isSelected: isSelected,
71
72
  isDisabled: isDisabled,
72
73
  shouldTitleWrap: shouldTitleWrap,
73
- shouldDescriptionWrap: shouldDescriptionWrap,
74
- testId: testId // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
74
+ shouldDescriptionWrap: shouldDescriptionWrap // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
75
75
  ,
76
76
  css: (0, _core.css)(cssFn({
77
77
  isDisabled: isDisabled,
@@ -79,10 +79,12 @@ var CustomItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
79
79
  }))
80
80
  }), function (_ref2) {
81
81
  var children = _ref2.children,
82
- props = (0, _objectWithoutProperties2.default)(_ref2, ["children"]);
83
- return (0, _core.jsx)(Component, (0, _extends2.default)({}, rest, props, {
82
+ className = _ref2.className;
83
+ return (0, _core.jsx)(Component, (0, _extends2.default)({
84
+ "data-testid": testId
85
+ }, rest, {
86
+ className: className,
84
87
  ref: ref,
85
- "data-testid": testId,
86
88
  draggable: false,
87
89
  onDragStart: preventEvent,
88
90
  onMouseDown: isDisabled ? preventEvent : onMouseDownHandler,
@@ -23,16 +23,14 @@ var _constants = require("@atlaskit/theme/constants");
23
23
 
24
24
  var _typography = require("@atlaskit/theme/typography");
25
25
 
26
- var _tokens = require("@atlaskit/tokens");
27
-
28
- /** @jsx jsx */
26
+ var _excluded = ["children", "testId", "id", "cssFn"];
29
27
  var gridSize = (0, _constants.gridSize)();
30
28
  var itemSidePadding = gridSize * 2.5;
31
29
  var itemHeadingContentHeight = _typography.headingSizes.h100.lineHeight;
32
30
  var itemHeadingFontSize = _typography.headingSizes.h100.size;
33
31
  var headingStyles = (0, _core.css)({
34
32
  padding: "0 ".concat(itemSidePadding, "px"),
35
- color: (0, _tokens.token)('color.text.lowEmphasis', _colors.N200),
33
+ color: "var(--ds-text-lowEmphasis, ".concat(_colors.N200, ")"),
36
34
  fontSize: itemHeadingFontSize,
37
35
  fontWeight: 700,
38
36
  lineHeight: itemHeadingContentHeight / itemHeadingFontSize,
@@ -53,7 +51,7 @@ var HeadingItem = /*#__PURE__*/(0, _react.memo)(function (_ref) {
53
51
  id = _ref.id,
54
52
  _ref$cssFn = _ref.cssFn,
55
53
  cssFn = _ref$cssFn === void 0 ? _noop.default : _ref$cssFn,
56
- rest = (0, _objectWithoutProperties2.default)(_ref, ["children", "testId", "id", "cssFn"]);
54
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
57
55
  return (0, _core.jsx)("div", (0, _extends2.default)({
58
56
  css: [headingStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
59
57
  cssFn(undefined)],
@@ -21,7 +21,8 @@ var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/
21
21
 
22
22
  var _useBlurOnMouseDown = require("../internal/hooks/use-blur-on-mouse-down");
23
23
 
24
- /** @jsx jsx */
24
+ var _excluded = ["children", "href", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
25
+
25
26
  var preventEvent = function preventEvent(e) {
26
27
  e.preventDefault();
27
28
  };
@@ -54,7 +55,7 @@ function (props, ref) {
54
55
  onMouseDown = props.onMouseDown,
55
56
  shouldTitleWrap = props.shouldTitleWrap,
56
57
  shouldDescriptionWrap = props.shouldDescriptionWrap,
57
- rest = (0, _objectWithoutProperties2.default)(props, ["children", "href", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"]);
58
+ rest = (0, _objectWithoutProperties2.default)(props, _excluded);
58
59
  var onMouseDownHandler = (0, _useBlurOnMouseDown.useBlurOnMouseDown)(onMouseDown);
59
60
 
60
61
  if (!children) {
@@ -76,12 +77,14 @@ function (props, ref) {
76
77
  isSelected: isSelected,
77
78
  isDisabled: isDisabled
78
79
  }),
79
- title: children,
80
- testId: testId
80
+ title: children
81
81
  }), function (_ref) {
82
82
  var children = _ref.children,
83
- props = (0, _objectWithoutProperties2.default)(_ref, ["children"]);
84
- return (0, _core.jsx)("a", (0, _extends2.default)({}, rest, props, {
83
+ className = _ref.className;
84
+ return (0, _core.jsx)("a", (0, _extends2.default)({
85
+ "data-testid": testId
86
+ }, rest, {
87
+ className: className,
85
88
  href: isDisabled ? undefined : href,
86
89
  draggable: false,
87
90
  onDragStart: preventEvent,
@@ -15,8 +15,6 @@ var _colors = require("@atlaskit/theme/colors");
15
15
 
16
16
  var _constants = require("@atlaskit/theme/constants");
17
17
 
18
- var _tokens = require("@atlaskit/tokens");
19
-
20
18
  /** @jsx jsx */
21
19
  var skeletonStyles = (0, _core.css)({
22
20
  padding: "0 ".concat((0, _constants.gridSize)() * 2.5, "px"),
@@ -24,7 +22,7 @@ var skeletonStyles = (0, _core.css)({
24
22
  display: 'block',
25
23
  width: '30%',
26
24
  height: (0, _constants.gridSize)(),
27
- backgroundColor: (0, _tokens.token)('color.background.subtleNeutral.resting', (0, _colors.skeleton)()),
25
+ backgroundColor: "var(--ds-background-subtleNeutral-resting, ".concat((0, _colors.skeleton)(), ")"),
28
26
  borderRadius: 100,
29
27
  content: '""'
30
28
  }
@@ -15,8 +15,6 @@ var _colors = require("@atlaskit/theme/colors");
15
15
 
16
16
  var _constants = require("@atlaskit/theme/constants");
17
17
 
18
- var _tokens = require("@atlaskit/tokens");
19
-
20
18
  /** @jsx jsx */
21
19
  var gridSize = (0, _constants.gridSize)();
22
20
  var borderRadius = (0, _constants.borderRadius)();
@@ -28,7 +26,7 @@ var skeletonItemElemSize = gridSize * 2.5;
28
26
  var itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
29
27
  var skeletonTextBorderRadius = 100;
30
28
  var skeletonContentHeight = 9;
31
- var skeletonColor = (0, _tokens.token)('color.background.subtleNeutral.resting', (0, _colors.skeleton)());
29
+ var skeletonColor = "var(--ds-background-subtleNeutral-resting, ".concat((0, _colors.skeleton)(), ")");
32
30
  var skeletonStyles = (0, _core.css)({
33
31
  display: 'flex',
34
32
  minHeight: itemMinHeight,
@@ -13,7 +13,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
13
13
 
14
14
  var _core = require("@emotion/core");
15
15
 
16
- /** @jsx jsx */
16
+ var _excluded = ["maxWidth", "minWidth", "minHeight", "maxHeight", "testId"];
17
17
  var groupStyles = (0, _core.css)({
18
18
  display: 'flex',
19
19
  flexDirection: 'column',
@@ -34,7 +34,7 @@ var MenuGroup = function MenuGroup(_ref) {
34
34
  minHeight = _ref.minHeight,
35
35
  maxHeight = _ref.maxHeight,
36
36
  testId = _ref.testId,
37
- rest = (0, _objectWithoutProperties2.default)(_ref, ["maxWidth", "minWidth", "minHeight", "maxHeight", "testId"]);
37
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
38
38
  return (0, _core.jsx)("div", (0, _extends2.default)({
39
39
  style: {
40
40
  minWidth: minWidth,
@@ -15,7 +15,7 @@ var _core = require("@emotion/core");
15
15
 
16
16
  var _menuGroup = _interopRequireDefault(require("./menu-group"));
17
17
 
18
- /** @jsx jsx */
18
+ var _excluded = ["maxWidth", "minWidth"];
19
19
 
20
20
  /**
21
21
  * @deprecated
@@ -25,7 +25,7 @@ var PopupMenuGroup = function PopupMenuGroup(_ref) {
25
25
  maxWidth = _ref$maxWidth === void 0 ? 800 : _ref$maxWidth,
26
26
  _ref$minWidth = _ref.minWidth,
27
27
  minWidth = _ref$minWidth === void 0 ? 320 : _ref$minWidth,
28
- rest = (0, _objectWithoutProperties2.default)(_ref, ["maxWidth", "minWidth"]);
28
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
29
29
  return (0, _core.jsx)(_menuGroup.default, (0, _extends2.default)({
30
30
  maxWidth: maxWidth,
31
31
  minWidth: minWidth
@@ -21,11 +21,9 @@ var _constants = require("@atlaskit/theme/constants");
21
21
 
22
22
  var _typography = require("@atlaskit/theme/typography");
23
23
 
24
- var _tokens = require("@atlaskit/tokens");
25
-
26
24
  var _headingItem = _interopRequireDefault(require("../menu-item/heading-item"));
27
25
 
28
- /** @jsx jsx */
26
+ var _excluded = ["children", "overrides", "title", "testId", "isScrollable", "hasSeparator", "id"];
29
27
  var gridSize = (0, _constants.gridSize)();
30
28
  var itemHeadingTopMargin = gridSize * 2.5;
31
29
  var itemHeadingBottomMargin = gridSize * 0.75; // Skeleton content is slightly shorter than the real content.
@@ -78,7 +76,7 @@ var unscrollableStyles = (0, _core.css)({
78
76
  flexShrink: 0
79
77
  });
80
78
  var separatorStyles = (0, _core.css)({
81
- borderTop: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ").concat((0, _tokens.token)('color.border.neutral', _colors.N30A), ")")
79
+ borderTop: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ").concat("var(--ds-border-neutral, ".concat(_colors.N30A, ")"), ")")
82
80
  });
83
81
  var noSeparatorStyles = (0, _core.css)({
84
82
  // this is to ensure that adjacent sections without separators don't get additional margins.
@@ -104,7 +102,7 @@ var Section = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
104
102
  isScrollable = _ref.isScrollable,
105
103
  hasSeparator = _ref.hasSeparator,
106
104
  id = _ref.id,
107
- rest = (0, _objectWithoutProperties2.default)(_ref, ["children", "overrides", "title", "testId", "isScrollable", "hasSeparator", "id"]);
105
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
108
106
  var childrenMarkup = title !== undefined ? (0, _core.jsx)(_react.Fragment, null, (0, _core.jsx)(_headingItem.default // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
109
107
  , {
110
108
  cssFn: overrides && overrides.HeadingItem && overrides.HeadingItem.cssFn,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.2.0",
3
+ "version": "1.2.4",
4
4
  "sideEffects": false
5
5
  }
@@ -5,7 +5,6 @@ import FocusRing from '@atlaskit/focus-ring';
5
5
  import { N20, N200, N30 } from '@atlaskit/theme/colors';
6
6
  import { fontSize as fontSizeFn, gridSize as gridSizeFn } from '@atlaskit/theme/constants';
7
7
  import { headingSizes } from '@atlaskit/theme/typography';
8
- import { token } from '@atlaskit/tokens';
9
8
 
10
9
  const defaultRender = (Component, props) => jsx(Component, props);
11
10
 
@@ -50,7 +49,7 @@ const wordBreakStyles = css({
50
49
  });
51
50
  const descriptionStyles = css({
52
51
  marginTop: itemDescriptionSpacing,
53
- color: token('color.text.lowEmphasis', N200),
52
+ color: `var(--ds-text-lowEmphasis, ${N200})`,
54
53
  fontSize: headingSizes.h200.size
55
54
  });
56
55
  const primitiveStyles = css({
@@ -83,11 +82,11 @@ const unselectedStyles = css({
83
82
  color: 'currentColor'
84
83
  },
85
84
  ':hover': {
86
- backgroundColor: token('color.background.transparentNeutral.hover', N20),
85
+ backgroundColor: `var(--ds-background-transparentNeutral-hover, ${N20})`,
87
86
  color: 'currentColor'
88
87
  },
89
88
  ':active': {
90
- backgroundColor: token('color.background.transparentNeutral.pressed', N30),
89
+ backgroundColor: `var(--ds-background-transparentNeutral-pressed, ${N30})`,
91
90
  boxShadow: 'none',
92
91
  color: 'currentColor'
93
92
  }
@@ -96,28 +95,23 @@ const disabledStyles = css({
96
95
  cursor: 'not-allowed',
97
96
  '&, :hover, :active': {
98
97
  backgroundColor: 'transparent',
99
- color: token('color.text.disabled', N200)
98
+ color: `var(--ds-text-disabled, ${N200})`
100
99
  }
101
100
  });
102
101
  const selectedStyles = css({
103
- backgroundColor: token('color.background.selected.resting', N20),
104
- // Suppress the need for a fallback as selected color isn't used in the non-tokens world.
105
- // When removing fallbacks make sure to remove this supression.
106
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
107
- color: token('color.text.selected'),
102
+ backgroundColor: `var(--ds-background-selected-resting, ${N20})`,
103
+ // Fallback set as babel plugin inserts one otherwise
104
+ color: "var(--ds-text-selected, currentColor)",
108
105
  ':visited': {
109
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
110
- color: token('color.text.selected')
106
+ color: "var(--ds-text-selected, currentColor)"
111
107
  },
112
108
  ':hover': {
113
- backgroundColor: token('color.background.selected.hover', N20),
114
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
115
- color: token('color.text.selected')
109
+ backgroundColor: `var(--ds-background-selected-hover, ${N20})`,
110
+ color: "var(--ds-text-selected, currentColor)"
116
111
  },
117
112
  ':active': {
118
- backgroundColor: token('color.background.selected.pressed', N30),
119
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
120
- color: token('color.text.selected')
113
+ backgroundColor: `var(--ds-background-selected-pressed, ${N30})`,
114
+ color: "var(--ds-text-selected, currentColor)"
121
115
  }
122
116
  });
123
117
  /**
@@ -142,7 +136,6 @@ const MenuItemPrimitive = ({
142
136
  iconAfter,
143
137
  iconBefore,
144
138
  overrides,
145
- testId,
146
139
  className,
147
140
  shouldTitleWrap = false,
148
141
  shouldDescriptionWrap = false,
@@ -157,7 +150,6 @@ const MenuItemPrimitive = ({
157
150
  return jsx(FocusRing, {
158
151
  isInset: true
159
152
  }, children({
160
- 'data-testid': testId,
161
153
  className: cx([cn([primitiveStyles, !isDisabled && !isSelected && unselectedStyles, !isDisabled && isSelected && selectedStyles, isDisabled ? disabledStyles : interactiveStyles]), className]),
162
154
  children: jsx(Fragment, null, iconBefore && jsx("span", {
163
155
  "data-item-elem-before": true,
@@ -42,7 +42,6 @@ const ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef( // Type needed on
42
42
  return jsx(MenuItemPrimitive, _extends({}, rest, {
43
43
  // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
44
44
  overrides: overrides,
45
- testId: testId,
46
45
  iconBefore: iconBefore,
47
46
  iconAfter: iconAfter,
48
47
  isDisabled: isDisabled,
@@ -58,8 +57,11 @@ const ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef( // Type needed on
58
57
  })
59
58
  }), ({
60
59
  children,
61
- ...props
62
- }) => jsx("button", _extends({}, rest, props, {
60
+ className
61
+ }) => jsx("button", _extends({
62
+ "data-testid": testId
63
+ }, rest, {
64
+ className: className,
63
65
  ref: ref,
64
66
  disabled: isDisabled,
65
67
  onClick: onClick,
@@ -53,8 +53,7 @@ const CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
53
53
  isSelected: isSelected,
54
54
  isDisabled: isDisabled,
55
55
  shouldTitleWrap: shouldTitleWrap,
56
- shouldDescriptionWrap: shouldDescriptionWrap,
57
- testId: testId // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
56
+ shouldDescriptionWrap: shouldDescriptionWrap // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
58
57
  ,
59
58
  css: css(cssFn({
60
59
  isDisabled,
@@ -62,10 +61,12 @@ const CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
62
61
  }))
63
62
  }), ({
64
63
  children,
65
- ...props
66
- }) => jsx(Component, _extends({}, rest, props, {
64
+ className
65
+ }) => jsx(Component, _extends({
66
+ "data-testid": testId
67
+ }, rest, {
68
+ className: className,
67
69
  ref: ref,
68
- "data-testid": testId,
69
70
  draggable: false,
70
71
  onDragStart: preventEvent,
71
72
  onMouseDown: isDisabled ? preventEvent : onMouseDownHandler,
@@ -7,14 +7,13 @@ import noop from '@atlaskit/ds-lib/noop';
7
7
  import { N200 } from '@atlaskit/theme/colors';
8
8
  import { gridSize as gridSizeFn } from '@atlaskit/theme/constants';
9
9
  import { headingSizes } from '@atlaskit/theme/typography';
10
- import { token } from '@atlaskit/tokens';
11
10
  const gridSize = gridSizeFn();
12
11
  const itemSidePadding = gridSize * 2.5;
13
12
  const itemHeadingContentHeight = headingSizes.h100.lineHeight;
14
13
  const itemHeadingFontSize = headingSizes.h100.size;
15
14
  const headingStyles = css({
16
15
  padding: `0 ${itemSidePadding}px`,
17
- color: token('color.text.lowEmphasis', N200),
16
+ color: `var(--ds-text-lowEmphasis, ${N200})`,
18
17
  fontSize: itemHeadingFontSize,
19
18
  fontWeight: 700,
20
19
  lineHeight: itemHeadingContentHeight / itemHeadingFontSize,
@@ -60,12 +60,14 @@ const LinkItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef( // Type needed on p
60
60
  isSelected,
61
61
  isDisabled
62
62
  }),
63
- title: children,
64
- testId: testId
63
+ title: children
65
64
  }), ({
66
65
  children,
67
- ...props
68
- }) => jsx("a", _extends({}, rest, props, {
66
+ className
67
+ }) => jsx("a", _extends({
68
+ "data-testid": testId
69
+ }, rest, {
70
+ className: className,
69
71
  href: isDisabled ? undefined : href,
70
72
  draggable: false,
71
73
  onDragStart: preventEvent,
@@ -3,14 +3,13 @@ import { css, jsx } from '@emotion/core';
3
3
  import noop from '@atlaskit/ds-lib/noop';
4
4
  import { skeleton as skeletonColorFn } from '@atlaskit/theme/colors';
5
5
  import { gridSize } from '@atlaskit/theme/constants';
6
- import { token } from '@atlaskit/tokens';
7
6
  const skeletonStyles = css({
8
7
  padding: `0 ${gridSize() * 2.5}px`,
9
8
  '::after': {
10
9
  display: 'block',
11
10
  width: '30%',
12
11
  height: gridSize(),
13
- backgroundColor: token('color.background.subtleNeutral.resting', skeletonColorFn()),
12
+ backgroundColor: `var(--ds-background-subtleNeutral-resting, ${skeletonColorFn()})`,
14
13
  borderRadius: 100,
15
14
  content: '""'
16
15
  }
@@ -3,7 +3,6 @@ import { css, jsx } from '@emotion/core';
3
3
  import noop from '@atlaskit/ds-lib/noop';
4
4
  import { skeleton as skeletonColorFn } from '@atlaskit/theme/colors';
5
5
  import { borderRadius as borderRadiusFn, gridSize as gridSizeFn } from '@atlaskit/theme/constants';
6
- import { token } from '@atlaskit/tokens';
7
6
  const gridSize = gridSizeFn();
8
7
  const borderRadius = borderRadiusFn();
9
8
  const itemElemSpacing = gridSize * 1.5;
@@ -14,7 +13,7 @@ const skeletonItemElemSize = gridSize * 2.5;
14
13
  const itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
15
14
  const skeletonTextBorderRadius = 100;
16
15
  const skeletonContentHeight = 9;
17
- const skeletonColor = token('color.background.subtleNeutral.resting', skeletonColorFn());
16
+ const skeletonColor = `var(--ds-background-subtleNeutral-resting, ${skeletonColorFn()})`;
18
17
  const skeletonStyles = css({
19
18
  display: 'flex',
20
19
  minHeight: itemMinHeight,
@@ -6,7 +6,6 @@ import { css, jsx } from '@emotion/core';
6
6
  import { N30A } from '@atlaskit/theme/colors';
7
7
  import { gridSize as gridSizeFn } from '@atlaskit/theme/constants';
8
8
  import { headingSizes } from '@atlaskit/theme/typography';
9
- import { token } from '@atlaskit/tokens';
10
9
  import HeadingItem from '../menu-item/heading-item';
11
10
  const gridSize = gridSizeFn();
12
11
  const itemHeadingTopMargin = gridSize * 2.5;
@@ -60,7 +59,7 @@ const unscrollableStyles = css({
60
59
  flexShrink: 0
61
60
  });
62
61
  const separatorStyles = css({
63
- borderTop: `2px solid var(${VAR_SEPARATOR_COLOR}, ${token('color.border.neutral', N30A)})`
62
+ borderTop: `2px solid var(${VAR_SEPARATOR_COLOR}, ${`var(--ds-border-neutral, ${N30A})`})`
64
63
  });
65
64
  const noSeparatorStyles = css({
66
65
  // this is to ensure that adjacent sections without separators don't get additional margins.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.2.0",
3
+ "version": "1.2.4",
4
4
  "sideEffects": false
5
5
  }
@@ -5,7 +5,6 @@ import FocusRing from '@atlaskit/focus-ring';
5
5
  import { N20, N200, N30 } from '@atlaskit/theme/colors';
6
6
  import { fontSize as fontSizeFn, gridSize as gridSizeFn } from '@atlaskit/theme/constants';
7
7
  import { headingSizes } from '@atlaskit/theme/typography';
8
- import { token } from '@atlaskit/tokens';
9
8
 
10
9
  var defaultRender = function defaultRender(Component, props) {
11
10
  return jsx(Component, props);
@@ -52,7 +51,7 @@ var wordBreakStyles = css({
52
51
  });
53
52
  var descriptionStyles = css({
54
53
  marginTop: itemDescriptionSpacing,
55
- color: token('color.text.lowEmphasis', N200),
54
+ color: "var(--ds-text-lowEmphasis, ".concat(N200, ")"),
56
55
  fontSize: headingSizes.h200.size
57
56
  });
58
57
  var primitiveStyles = css({
@@ -85,11 +84,11 @@ var unselectedStyles = css({
85
84
  color: 'currentColor'
86
85
  },
87
86
  ':hover': {
88
- backgroundColor: token('color.background.transparentNeutral.hover', N20),
87
+ backgroundColor: "var(--ds-background-transparentNeutral-hover, ".concat(N20, ")"),
89
88
  color: 'currentColor'
90
89
  },
91
90
  ':active': {
92
- backgroundColor: token('color.background.transparentNeutral.pressed', N30),
91
+ backgroundColor: "var(--ds-background-transparentNeutral-pressed, ".concat(N30, ")"),
93
92
  boxShadow: 'none',
94
93
  color: 'currentColor'
95
94
  }
@@ -98,28 +97,23 @@ var disabledStyles = css({
98
97
  cursor: 'not-allowed',
99
98
  '&, :hover, :active': {
100
99
  backgroundColor: 'transparent',
101
- color: token('color.text.disabled', N200)
100
+ color: "var(--ds-text-disabled, ".concat(N200, ")")
102
101
  }
103
102
  });
104
103
  var selectedStyles = css({
105
- backgroundColor: token('color.background.selected.resting', N20),
106
- // Suppress the need for a fallback as selected color isn't used in the non-tokens world.
107
- // When removing fallbacks make sure to remove this supression.
108
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
109
- color: token('color.text.selected'),
104
+ backgroundColor: "var(--ds-background-selected-resting, ".concat(N20, ")"),
105
+ // Fallback set as babel plugin inserts one otherwise
106
+ color: "var(--ds-text-selected, currentColor)",
110
107
  ':visited': {
111
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
112
- color: token('color.text.selected')
108
+ color: "var(--ds-text-selected, currentColor)"
113
109
  },
114
110
  ':hover': {
115
- backgroundColor: token('color.background.selected.hover', N20),
116
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
117
- color: token('color.text.selected')
111
+ backgroundColor: "var(--ds-background-selected-hover, ".concat(N20, ")"),
112
+ color: "var(--ds-text-selected, currentColor)"
118
113
  },
119
114
  ':active': {
120
- backgroundColor: token('color.background.selected.pressed', N30),
121
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
122
- color: token('color.text.selected')
115
+ backgroundColor: "var(--ds-background-selected-pressed, ".concat(N30, ")"),
116
+ color: "var(--ds-text-selected, currentColor)"
123
117
  }
124
118
  });
125
119
  /**
@@ -144,7 +138,6 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
144
138
  iconAfter = _ref.iconAfter,
145
139
  iconBefore = _ref.iconBefore,
146
140
  overrides = _ref.overrides,
147
- testId = _ref.testId,
148
141
  className = _ref.className,
149
142
  _ref$shouldTitleWrap = _ref.shouldTitleWrap,
150
143
  shouldTitleWrap = _ref$shouldTitleWrap === void 0 ? false : _ref$shouldTitleWrap,
@@ -161,7 +154,6 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
161
154
  return jsx(FocusRing, {
162
155
  isInset: true
163
156
  }, children({
164
- 'data-testid': testId,
165
157
  className: cx([cn([primitiveStyles, !isDisabled && !isSelected && unselectedStyles, !isDisabled && isSelected && selectedStyles, isDisabled ? disabledStyles : interactiveStyles]), className]),
166
158
  children: jsx(Fragment, null, iconBefore && jsx("span", {
167
159
  "data-item-elem-before": true,
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["children", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
3
4
 
4
5
  /** @jsx jsx */
5
6
  import { forwardRef, memo } from 'react';
@@ -34,7 +35,7 @@ function (props, ref) {
34
35
  onMouseDown = props.onMouseDown,
35
36
  shouldTitleWrap = props.shouldTitleWrap,
36
37
  shouldDescriptionWrap = props.shouldDescriptionWrap,
37
- rest = _objectWithoutProperties(props, ["children", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"]);
38
+ rest = _objectWithoutProperties(props, _excluded);
38
39
 
39
40
  var onMouseDownHandler = useBlurOnMouseDown(onMouseDown);
40
41
 
@@ -45,7 +46,6 @@ function (props, ref) {
45
46
  return jsx(MenuItemPrimitive, _extends({}, rest, {
46
47
  // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
47
48
  overrides: overrides,
48
- testId: testId,
49
49
  iconBefore: iconBefore,
50
50
  iconAfter: iconAfter,
51
51
  isDisabled: isDisabled,
@@ -61,9 +61,11 @@ function (props, ref) {
61
61
  })
62
62
  }), function (_ref) {
63
63
  var children = _ref.children,
64
- props = _objectWithoutProperties(_ref, ["children"]);
65
-
66
- return jsx("button", _extends({}, rest, props, {
64
+ className = _ref.className;
65
+ return jsx("button", _extends({
66
+ "data-testid": testId
67
+ }, rest, {
68
+ className: className,
67
69
  ref: ref,
68
70
  disabled: isDisabled,
69
71
  onClick: onClick,
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["component", "cssFn", "isDisabled", "isSelected", "onClick", "testId", "children", "description", "iconAfter", "iconBefore", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
3
4
 
4
5
  /** @jsx jsx */
5
6
  import { forwardRef, memo } from 'react';
@@ -39,7 +40,7 @@ var CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref)
39
40
  onMouseDown = _ref.onMouseDown,
40
41
  shouldTitleWrap = _ref.shouldTitleWrap,
41
42
  shouldDescriptionWrap = _ref.shouldDescriptionWrap,
42
- rest = _objectWithoutProperties(_ref, ["component", "cssFn", "isDisabled", "isSelected", "onClick", "testId", "children", "description", "iconAfter", "iconBefore", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"]);
43
+ rest = _objectWithoutProperties(_ref, _excluded);
43
44
 
44
45
  var onMouseDownHandler = useBlurOnMouseDown(onMouseDown);
45
46
 
@@ -57,8 +58,7 @@ var CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref)
57
58
  isSelected: isSelected,
58
59
  isDisabled: isDisabled,
59
60
  shouldTitleWrap: shouldTitleWrap,
60
- shouldDescriptionWrap: shouldDescriptionWrap,
61
- testId: testId // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
61
+ shouldDescriptionWrap: shouldDescriptionWrap // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
62
62
  ,
63
63
  css: css(cssFn({
64
64
  isDisabled: isDisabled,
@@ -66,11 +66,12 @@ var CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref)
66
66
  }))
67
67
  }), function (_ref2) {
68
68
  var children = _ref2.children,
69
- props = _objectWithoutProperties(_ref2, ["children"]);
70
-
71
- return jsx(Component, _extends({}, rest, props, {
69
+ className = _ref2.className;
70
+ return jsx(Component, _extends({
71
+ "data-testid": testId
72
+ }, rest, {
73
+ className: className,
72
74
  ref: ref,
73
- "data-testid": testId,
74
75
  draggable: false,
75
76
  onDragStart: preventEvent,
76
77
  onMouseDown: isDisabled ? preventEvent : onMouseDownHandler,
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["children", "testId", "id", "cssFn"];
3
4
 
4
5
  /** @jsx jsx */
5
6
  import { memo } from 'react';
@@ -8,14 +9,13 @@ import noop from '@atlaskit/ds-lib/noop';
8
9
  import { N200 } from '@atlaskit/theme/colors';
9
10
  import { gridSize as gridSizeFn } from '@atlaskit/theme/constants';
10
11
  import { headingSizes } from '@atlaskit/theme/typography';
11
- import { token } from '@atlaskit/tokens';
12
12
  var gridSize = gridSizeFn();
13
13
  var itemSidePadding = gridSize * 2.5;
14
14
  var itemHeadingContentHeight = headingSizes.h100.lineHeight;
15
15
  var itemHeadingFontSize = headingSizes.h100.size;
16
16
  var headingStyles = css({
17
17
  padding: "0 ".concat(itemSidePadding, "px"),
18
- color: token('color.text.lowEmphasis', N200),
18
+ color: "var(--ds-text-lowEmphasis, ".concat(N200, ")"),
19
19
  fontSize: itemHeadingFontSize,
20
20
  fontWeight: 700,
21
21
  lineHeight: itemHeadingContentHeight / itemHeadingFontSize,
@@ -36,7 +36,7 @@ var HeadingItem = /*#__PURE__*/memo(function (_ref) {
36
36
  id = _ref.id,
37
37
  _ref$cssFn = _ref.cssFn,
38
38
  cssFn = _ref$cssFn === void 0 ? noop : _ref$cssFn,
39
- rest = _objectWithoutProperties(_ref, ["children", "testId", "id", "cssFn"]);
39
+ rest = _objectWithoutProperties(_ref, _excluded);
40
40
 
41
41
  return jsx("div", _extends({
42
42
  css: [headingStyles, // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["children", "href", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"];
3
4
 
4
5
  /** @jsx jsx */
5
6
  import { forwardRef, memo } from 'react';
@@ -40,7 +41,7 @@ function (props, ref) {
40
41
  onMouseDown = props.onMouseDown,
41
42
  shouldTitleWrap = props.shouldTitleWrap,
42
43
  shouldDescriptionWrap = props.shouldDescriptionWrap,
43
- rest = _objectWithoutProperties(props, ["children", "href", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap"]);
44
+ rest = _objectWithoutProperties(props, _excluded);
44
45
 
45
46
  var onMouseDownHandler = useBlurOnMouseDown(onMouseDown);
46
47
 
@@ -63,13 +64,14 @@ function (props, ref) {
63
64
  isSelected: isSelected,
64
65
  isDisabled: isDisabled
65
66
  }),
66
- title: children,
67
- testId: testId
67
+ title: children
68
68
  }), function (_ref) {
69
69
  var children = _ref.children,
70
- props = _objectWithoutProperties(_ref, ["children"]);
71
-
72
- return jsx("a", _extends({}, rest, props, {
70
+ className = _ref.className;
71
+ return jsx("a", _extends({
72
+ "data-testid": testId
73
+ }, rest, {
74
+ className: className,
73
75
  href: isDisabled ? undefined : href,
74
76
  draggable: false,
75
77
  onDragStart: preventEvent,
@@ -3,14 +3,13 @@ import { css, jsx } from '@emotion/core';
3
3
  import noop from '@atlaskit/ds-lib/noop';
4
4
  import { skeleton as skeletonColorFn } from '@atlaskit/theme/colors';
5
5
  import { gridSize } from '@atlaskit/theme/constants';
6
- import { token } from '@atlaskit/tokens';
7
6
  var skeletonStyles = css({
8
7
  padding: "0 ".concat(gridSize() * 2.5, "px"),
9
8
  '::after': {
10
9
  display: 'block',
11
10
  width: '30%',
12
11
  height: gridSize(),
13
- backgroundColor: token('color.background.subtleNeutral.resting', skeletonColorFn()),
12
+ backgroundColor: "var(--ds-background-subtleNeutral-resting, ".concat(skeletonColorFn(), ")"),
14
13
  borderRadius: 100,
15
14
  content: '""'
16
15
  }
@@ -3,7 +3,6 @@ import { css, jsx } from '@emotion/core';
3
3
  import noop from '@atlaskit/ds-lib/noop';
4
4
  import { skeleton as skeletonColorFn } from '@atlaskit/theme/colors';
5
5
  import { borderRadius as borderRadiusFn, gridSize as gridSizeFn } from '@atlaskit/theme/constants';
6
- import { token } from '@atlaskit/tokens';
7
6
  var gridSize = gridSizeFn();
8
7
  var borderRadius = borderRadiusFn();
9
8
  var itemElemSpacing = gridSize * 1.5;
@@ -14,7 +13,7 @@ var skeletonItemElemSize = gridSize * 2.5;
14
13
  var itemElemSkeletonOffset = (itemExpectedElemSize - skeletonItemElemSize) / 2;
15
14
  var skeletonTextBorderRadius = 100;
16
15
  var skeletonContentHeight = 9;
17
- var skeletonColor = token('color.background.subtleNeutral.resting', skeletonColorFn());
16
+ var skeletonColor = "var(--ds-background-subtleNeutral-resting, ".concat(skeletonColorFn(), ")");
18
17
  var skeletonStyles = css({
19
18
  display: 'flex',
20
19
  minHeight: itemMinHeight,
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["maxWidth", "minWidth", "minHeight", "maxHeight", "testId"];
3
4
 
4
5
  /** @jsx jsx */
5
6
  import { css, jsx } from '@emotion/core';
@@ -23,7 +24,7 @@ var MenuGroup = function MenuGroup(_ref) {
23
24
  minHeight = _ref.minHeight,
24
25
  maxHeight = _ref.maxHeight,
25
26
  testId = _ref.testId,
26
- rest = _objectWithoutProperties(_ref, ["maxWidth", "minWidth", "minHeight", "maxHeight", "testId"]);
27
+ rest = _objectWithoutProperties(_ref, _excluded);
27
28
 
28
29
  return jsx("div", _extends({
29
30
  style: {
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["maxWidth", "minWidth"];
3
4
 
4
5
  /** @jsx jsx */
5
6
  import { jsx } from '@emotion/core';
@@ -13,7 +14,7 @@ var PopupMenuGroup = function PopupMenuGroup(_ref) {
13
14
  maxWidth = _ref$maxWidth === void 0 ? 800 : _ref$maxWidth,
14
15
  _ref$minWidth = _ref.minWidth,
15
16
  minWidth = _ref$minWidth === void 0 ? 320 : _ref$minWidth,
16
- rest = _objectWithoutProperties(_ref, ["maxWidth", "minWidth"]);
17
+ rest = _objectWithoutProperties(_ref, _excluded);
17
18
 
18
19
  return jsx(MenuGroup, _extends({
19
20
  maxWidth: maxWidth,
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["children", "overrides", "title", "testId", "isScrollable", "hasSeparator", "id"];
3
4
 
4
5
  /** @jsx jsx */
5
6
  import { forwardRef, Fragment } from 'react';
@@ -7,7 +8,6 @@ import { css, jsx } from '@emotion/core';
7
8
  import { N30A } from '@atlaskit/theme/colors';
8
9
  import { gridSize as gridSizeFn } from '@atlaskit/theme/constants';
9
10
  import { headingSizes } from '@atlaskit/theme/typography';
10
- import { token } from '@atlaskit/tokens';
11
11
  import HeadingItem from '../menu-item/heading-item';
12
12
  var gridSize = gridSizeFn();
13
13
  var itemHeadingTopMargin = gridSize * 2.5;
@@ -61,7 +61,7 @@ var unscrollableStyles = css({
61
61
  flexShrink: 0
62
62
  });
63
63
  var separatorStyles = css({
64
- borderTop: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ").concat(token('color.border.neutral', N30A), ")")
64
+ borderTop: "2px solid var(".concat(VAR_SEPARATOR_COLOR, ", ").concat("var(--ds-border-neutral, ".concat(N30A, ")"), ")")
65
65
  });
66
66
  var noSeparatorStyles = css({
67
67
  // this is to ensure that adjacent sections without separators don't get additional margins.
@@ -87,7 +87,7 @@ var Section = /*#__PURE__*/forwardRef(function (_ref, ref) {
87
87
  isScrollable = _ref.isScrollable,
88
88
  hasSeparator = _ref.hasSeparator,
89
89
  id = _ref.id,
90
- rest = _objectWithoutProperties(_ref, ["children", "overrides", "title", "testId", "isScrollable", "hasSeparator", "id"]);
90
+ rest = _objectWithoutProperties(_ref, _excluded);
91
91
 
92
92
  var childrenMarkup = title !== undefined ? jsx(Fragment, null, jsx(HeadingItem // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
93
93
  , {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.2.0",
3
+ "version": "1.2.4",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { MenuItemPrimitiveProps } from '../../types';
2
3
  /**
3
4
  * __Menu item primitive__
@@ -13,5 +14,5 @@ import type { MenuItemPrimitiveProps } from '../../types';
13
14
  * </MenuItemPrimitive>
14
15
  * ```
15
16
  */
16
- declare const MenuItemPrimitive: ({ children, title, description, iconAfter, iconBefore, overrides, testId, className, shouldTitleWrap, shouldDescriptionWrap, isDisabled, isSelected, }: MenuItemPrimitiveProps) => JSX.Element;
17
+ declare const MenuItemPrimitive: ({ children, title, description, iconAfter, iconBefore, overrides, className, shouldTitleWrap, shouldDescriptionWrap, isDisabled, isSelected, }: MenuItemPrimitiveProps) => JSX.Element;
17
18
  export default MenuItemPrimitive;
@@ -1,4 +1,5 @@
1
1
  /** @jsx jsx */
2
+ /// <reference types="react" />
2
3
  import type { CustomItemComponentProps, CustomItemProps } from '../types';
3
4
  interface CustomItemTypeGenericHackProps {
4
5
  <TComponentProps>(props: CustomItemProps<TComponentProps> & {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { SkeletonHeadingItemProps } from '../types';
2
3
  /**
3
4
  * __Skeleton heading item__
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { SkeletonItemProps } from '../types';
2
3
  /**
3
4
  * __Skeleton item__
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { MenuGroupProps } from '../types';
2
3
  /**
3
4
  * __Menu group__
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { MenuGroupProps } from '../types';
2
3
  /**
3
4
  * @deprecated
@@ -96,7 +96,6 @@ export interface SectionProps {
96
96
  export interface MenuItemPrimitiveProps {
97
97
  children: (props: {
98
98
  className: string;
99
- 'data-testid': string | undefined;
100
99
  children: React.ReactNode;
101
100
  }) => JSX.Element;
102
101
  title: React.ReactNode | undefined;
@@ -109,7 +108,6 @@ export interface MenuItemPrimitiveProps {
109
108
  isDisabled: boolean | undefined;
110
109
  isSelected: boolean | undefined;
111
110
  className?: string;
112
- testId?: string;
113
111
  }
114
112
  export interface MenuItemProps {
115
113
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.2.0",
3
+ "version": "1.2.4",
4
4
  "description": "A collection of composable menu components that can be used anywhere.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -16,7 +16,6 @@
16
16
  "atlaskit:src": "src/index.tsx",
17
17
  "atlassian": {
18
18
  "team": "Design System Team",
19
- "inPublicMirror": true,
20
19
  "releaseModel": "scheduled",
21
20
  "website": {
22
21
  "name": "Menu"
@@ -37,9 +36,9 @@
37
36
  },
38
37
  "dependencies": {
39
38
  "@atlaskit/ds-lib": "^1.2.0",
40
- "@atlaskit/focus-ring": "^0.2.0",
41
- "@atlaskit/theme": "^12.0.0",
42
- "@atlaskit/tokens": "^0.3.0",
39
+ "@atlaskit/focus-ring": "^0.2.4",
40
+ "@atlaskit/theme": "^12.1.0",
41
+ "@atlaskit/tokens": "^0.5.0",
43
42
  "@babel/runtime": "^7.0.0",
44
43
  "@emotion/core": "^10.0.9"
45
44
  },
@@ -51,7 +50,7 @@
51
50
  "@atlaskit/avatar": "^20.5.0",
52
51
  "@atlaskit/button": "^16.0.0",
53
52
  "@atlaskit/docs": "*",
54
- "@atlaskit/icon": "^21.9.0",
53
+ "@atlaskit/icon": "^21.10.0",
55
54
  "@atlaskit/icon-file-type": "^6.0.0",
56
55
  "@atlaskit/icon-object": "^6.0.0",
57
56
  "@atlaskit/section-message": "^6.0.0",
@@ -81,7 +80,10 @@
81
80
  "@repo/internal": {
82
81
  "ui-components": "lite-mode",
83
82
  "design-system": "v1",
84
- "styling": "emotion",
83
+ "styling": [
84
+ "static",
85
+ "emotion"
86
+ ],
85
87
  "analytics": "analytics-next",
86
88
  "theming": "tokens",
87
89
  "deprecation": "no-deprecated-imports"