@atlaskit/menu 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/menu
2
2
 
3
+ ## 1.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`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.
8
+
3
9
  ## 1.2.1
4
10
 
5
11
  ### Patch Changes
@@ -159,7 +159,6 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
159
159
  iconAfter = _ref.iconAfter,
160
160
  iconBefore = _ref.iconBefore,
161
161
  overrides = _ref.overrides,
162
- testId = _ref.testId,
163
162
  className = _ref.className,
164
163
  _ref$shouldTitleWrap = _ref.shouldTitleWrap,
165
164
  shouldTitleWrap = _ref$shouldTitleWrap === void 0 ? false : _ref$shouldTitleWrap,
@@ -176,7 +175,6 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
176
175
  return (0, _core.jsx)(_focusRing.default, {
177
176
  isInset: true
178
177
  }, children({
179
- 'data-testid': testId,
180
178
  className: cx([cn([primitiveStyles, !isDisabled && !isSelected && unselectedStyles, !isDisabled && isSelected && selectedStyles, isDisabled ? disabledStyles : interactiveStyles]), className]),
181
179
  children: (0, _core.jsx)(_react.Fragment, null, iconBefore && (0, _core.jsx)("span", {
182
180
  "data-item-elem-before": true,
@@ -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,
@@ -70,8 +70,7 @@ var CustomItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
70
70
  isSelected: isSelected,
71
71
  isDisabled: isDisabled,
72
72
  shouldTitleWrap: shouldTitleWrap,
73
- shouldDescriptionWrap: shouldDescriptionWrap,
74
- testId: testId // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
73
+ shouldDescriptionWrap: shouldDescriptionWrap // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
75
74
  ,
76
75
  css: (0, _core.css)(cssFn({
77
76
  isDisabled: isDisabled,
@@ -79,10 +78,12 @@ var CustomItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
79
78
  }))
80
79
  }), function (_ref2) {
81
80
  var children = _ref2.children,
82
- props = (0, _objectWithoutProperties2.default)(_ref2, ["children"]);
83
- return (0, _core.jsx)(Component, (0, _extends2.default)({}, rest, props, {
81
+ className = _ref2.className;
82
+ return (0, _core.jsx)(Component, (0, _extends2.default)({
83
+ "data-testid": testId
84
+ }, rest, {
85
+ className: className,
84
86
  ref: ref,
85
- "data-testid": testId,
86
87
  draggable: false,
87
88
  onDragStart: preventEvent,
88
89
  onMouseDown: isDisabled ? preventEvent : onMouseDownHandler,
@@ -76,12 +76,14 @@ function (props, ref) {
76
76
  isSelected: isSelected,
77
77
  isDisabled: isDisabled
78
78
  }),
79
- title: children,
80
- testId: testId
79
+ title: children
81
80
  }), function (_ref) {
82
81
  var children = _ref.children,
83
- props = (0, _objectWithoutProperties2.default)(_ref, ["children"]);
84
- return (0, _core.jsx)("a", (0, _extends2.default)({}, rest, props, {
82
+ className = _ref.className;
83
+ return (0, _core.jsx)("a", (0, _extends2.default)({
84
+ "data-testid": testId
85
+ }, rest, {
86
+ className: className,
85
87
  href: isDisabled ? undefined : href,
86
88
  draggable: false,
87
89
  onDragStart: preventEvent,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -142,7 +142,6 @@ const MenuItemPrimitive = ({
142
142
  iconAfter,
143
143
  iconBefore,
144
144
  overrides,
145
- testId,
146
145
  className,
147
146
  shouldTitleWrap = false,
148
147
  shouldDescriptionWrap = false,
@@ -157,7 +156,6 @@ const MenuItemPrimitive = ({
157
156
  return jsx(FocusRing, {
158
157
  isInset: true
159
158
  }, children({
160
- 'data-testid': testId,
161
159
  className: cx([cn([primitiveStyles, !isDisabled && !isSelected && unselectedStyles, !isDisabled && isSelected && selectedStyles, isDisabled ? disabledStyles : interactiveStyles]), className]),
162
160
  children: jsx(Fragment, null, iconBefore && jsx("span", {
163
161
  "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,
@@ -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,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -144,7 +144,6 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
144
144
  iconAfter = _ref.iconAfter,
145
145
  iconBefore = _ref.iconBefore,
146
146
  overrides = _ref.overrides,
147
- testId = _ref.testId,
148
147
  className = _ref.className,
149
148
  _ref$shouldTitleWrap = _ref.shouldTitleWrap,
150
149
  shouldTitleWrap = _ref$shouldTitleWrap === void 0 ? false : _ref$shouldTitleWrap,
@@ -161,7 +160,6 @@ var MenuItemPrimitive = function MenuItemPrimitive(_ref) {
161
160
  return jsx(FocusRing, {
162
161
  isInset: true
163
162
  }, children({
164
- 'data-testid': testId,
165
163
  className: cx([cn([primitiveStyles, !isDisabled && !isSelected && unselectedStyles, !isDisabled && isSelected && selectedStyles, isDisabled ? disabledStyles : interactiveStyles]), className]),
166
164
  children: jsx(Fragment, null, iconBefore && jsx("span", {
167
165
  "data-item-elem-before": true,
@@ -45,7 +45,6 @@ function (props, ref) {
45
45
  return jsx(MenuItemPrimitive, _extends({}, rest, {
46
46
  // eslint-disable-next-line @repo/internal/react/no-unsafe-overrides
47
47
  overrides: overrides,
48
- testId: testId,
49
48
  iconBefore: iconBefore,
50
49
  iconAfter: iconAfter,
51
50
  isDisabled: isDisabled,
@@ -61,9 +60,11 @@ function (props, ref) {
61
60
  })
62
61
  }), function (_ref) {
63
62
  var children = _ref.children,
64
- props = _objectWithoutProperties(_ref, ["children"]);
65
-
66
- return jsx("button", _extends({}, rest, props, {
63
+ className = _ref.className;
64
+ return jsx("button", _extends({
65
+ "data-testid": testId
66
+ }, rest, {
67
+ className: className,
67
68
  ref: ref,
68
69
  disabled: isDisabled,
69
70
  onClick: onClick,
@@ -57,8 +57,7 @@ var CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref)
57
57
  isSelected: isSelected,
58
58
  isDisabled: isDisabled,
59
59
  shouldTitleWrap: shouldTitleWrap,
60
- shouldDescriptionWrap: shouldDescriptionWrap,
61
- testId: testId // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
60
+ shouldDescriptionWrap: shouldDescriptionWrap // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
62
61
  ,
63
62
  css: css(cssFn({
64
63
  isDisabled: isDisabled,
@@ -66,11 +65,12 @@ var CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref)
66
65
  }))
67
66
  }), function (_ref2) {
68
67
  var children = _ref2.children,
69
- props = _objectWithoutProperties(_ref2, ["children"]);
70
-
71
- return jsx(Component, _extends({}, rest, props, {
68
+ className = _ref2.className;
69
+ return jsx(Component, _extends({
70
+ "data-testid": testId
71
+ }, rest, {
72
+ className: className,
72
73
  ref: ref,
73
- "data-testid": testId,
74
74
  draggable: false,
75
75
  onDragStart: preventEvent,
76
76
  onMouseDown: isDisabled ? preventEvent : onMouseDownHandler,
@@ -63,13 +63,14 @@ function (props, ref) {
63
63
  isSelected: isSelected,
64
64
  isDisabled: isDisabled
65
65
  }),
66
- title: children,
67
- testId: testId
66
+ title: children
68
67
  }), function (_ref) {
69
68
  var children = _ref.children,
70
- props = _objectWithoutProperties(_ref, ["children"]);
71
-
72
- return jsx("a", _extends({}, rest, props, {
69
+ className = _ref.className;
70
+ return jsx("a", _extends({
71
+ "data-testid": testId
72
+ }, rest, {
73
+ className: className,
73
74
  href: isDisabled ? undefined : href,
74
75
  draggable: false,
75
76
  onDragStart: preventEvent,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -13,5 +13,5 @@ import type { MenuItemPrimitiveProps } from '../../types';
13
13
  * </MenuItemPrimitive>
14
14
  * ```
15
15
  */
16
- declare const MenuItemPrimitive: ({ children, title, description, iconAfter, iconBefore, overrides, testId, className, shouldTitleWrap, shouldDescriptionWrap, isDisabled, isSelected, }: MenuItemPrimitiveProps) => JSX.Element;
16
+ declare const MenuItemPrimitive: ({ children, title, description, iconAfter, iconBefore, overrides, className, shouldTitleWrap, shouldDescriptionWrap, isDisabled, isSelected, }: MenuItemPrimitiveProps) => JSX.Element;
17
17
  export default MenuItemPrimitive;
@@ -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.1",
3
+ "version": "1.2.2",
4
4
  "description": "A collection of composable menu components that can be used anywhere.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"