@atlaskit/menu 8.2.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/menu
2
2
 
3
+ ## 8.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#200326](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/200326)
8
+ [`f520c88226d22`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f520c88226d22) -
9
+ Reimplementing these changes due to a revert.
10
+
11
+ ButtonItem will convey its selected state to screen readers when `isSelected`. This is done
12
+ through the `aria-current` attribute.
13
+
14
+ This change is behind a feature flag, which will be removed in a future release.
15
+
3
16
  ## 8.2.0
4
17
 
5
18
  ### Minor Changes
@@ -71,6 +71,10 @@ var ButtonItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
71
71
  className = _ref.className;
72
72
  return /*#__PURE__*/React.createElement("button", (0, _extends2.default)({
73
73
  "data-testid": testId
74
+ // This is intentionally placed before the `...rest` spread to prevent overriding existing usages of `aria-current`,
75
+ // which are already being passed to the button element.
76
+ ,
77
+ "aria-current": isSelected && (0, _platformFeatureFlags.fg)('platform_dst_menu_item_button_aria_current') ? 'true' : undefined
74
78
  }, rest, {
75
79
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
76
80
  className: className,
@@ -78,7 +82,6 @@ var ButtonItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
78
82
  disabled: isDisabled,
79
83
  onClick: handleClick,
80
84
  onMouseDown: onMouseDownHandler,
81
- "aria-current": isSelected && (0, _platformFeatureFlags.fg)('platform_dst_menu_item_button_aria_current') ? 'true' : undefined,
82
85
  type: "button"
83
86
  }), children);
84
87
  });
@@ -60,6 +60,10 @@ const ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((props, ref) => {
60
60
  className
61
61
  }) => /*#__PURE__*/React.createElement("button", _extends({
62
62
  "data-testid": testId
63
+ // This is intentionally placed before the `...rest` spread to prevent overriding existing usages of `aria-current`,
64
+ // which are already being passed to the button element.
65
+ ,
66
+ "aria-current": isSelected && fg('platform_dst_menu_item_button_aria_current') ? 'true' : undefined
63
67
  }, rest, {
64
68
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
65
69
  className: className,
@@ -67,7 +71,6 @@ const ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((props, ref) => {
67
71
  disabled: isDisabled,
68
72
  onClick: handleClick,
69
73
  onMouseDown: onMouseDownHandler,
70
- "aria-current": isSelected && fg('platform_dst_menu_item_button_aria_current') ? 'true' : undefined,
71
74
  type: "button"
72
75
  }), children));
73
76
  }));
@@ -62,6 +62,10 @@ var ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref
62
62
  className = _ref.className;
63
63
  return /*#__PURE__*/React.createElement("button", _extends({
64
64
  "data-testid": testId
65
+ // This is intentionally placed before the `...rest` spread to prevent overriding existing usages of `aria-current`,
66
+ // which are already being passed to the button element.
67
+ ,
68
+ "aria-current": isSelected && fg('platform_dst_menu_item_button_aria_current') ? 'true' : undefined
65
69
  }, rest, {
66
70
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
67
71
  className: className,
@@ -69,7 +73,6 @@ var ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref
69
73
  disabled: isDisabled,
70
74
  onClick: handleClick,
71
75
  onMouseDown: onMouseDownHandler,
72
- "aria-current": isSelected && fg('platform_dst_menu_item_button_aria_current') ? 'true' : undefined,
73
76
  type: "button"
74
77
  }), children);
75
78
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "8.2.0",
3
+ "version": "8.3.0",
4
4
  "description": "A list of options to help users navigate, or perform actions.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"