@atlaskit/menu 8.1.2 → 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.
Files changed (27) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/menu-item/button-item.js +5 -0
  3. package/dist/es2019/menu-item/button-item.js +5 -0
  4. package/dist/esm/menu-item/button-item.js +5 -0
  5. package/dist/types/internal/components/menu-context.d.ts +0 -1
  6. package/dist/types/internal/components/menu-item-primitive.d.ts +0 -1
  7. package/dist/types/menu-item/button-item.d.ts +0 -1
  8. package/dist/types/menu-item/custom-item.d.ts +0 -1
  9. package/dist/types/menu-item/heading-item.d.ts +0 -1
  10. package/dist/types/menu-item/link-item.d.ts +0 -1
  11. package/dist/types/menu-item/skeleton-heading-item.d.ts +0 -1
  12. package/dist/types/menu-item/skeleton-item.d.ts +0 -1
  13. package/dist/types/menu-section/menu-group.d.ts +0 -1
  14. package/dist/types/menu-section/popup-menu-group.d.ts +0 -1
  15. package/dist/types/menu-section/section.d.ts +0 -1
  16. package/dist/types-ts4.5/internal/components/menu-context.d.ts +0 -1
  17. package/dist/types-ts4.5/internal/components/menu-item-primitive.d.ts +0 -1
  18. package/dist/types-ts4.5/menu-item/button-item.d.ts +0 -1
  19. package/dist/types-ts4.5/menu-item/custom-item.d.ts +0 -1
  20. package/dist/types-ts4.5/menu-item/heading-item.d.ts +0 -1
  21. package/dist/types-ts4.5/menu-item/link-item.d.ts +0 -1
  22. package/dist/types-ts4.5/menu-item/skeleton-heading-item.d.ts +0 -1
  23. package/dist/types-ts4.5/menu-item/skeleton-item.d.ts +0 -1
  24. package/dist/types-ts4.5/menu-section/menu-group.d.ts +0 -1
  25. package/dist/types-ts4.5/menu-section/popup-menu-group.d.ts +0 -1
  26. package/dist/types-ts4.5/menu-section/section.d.ts +0 -1
  27. package/package.json +8 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
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
+
16
+ ## 8.2.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [#200012](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/200012)
21
+ [`3b577f51b24b1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3b577f51b24b1) -
22
+ ButtonItem will convey its selected state to screen readers when `isSelected`. This is done
23
+ through the `aria-current` attribute.
24
+
25
+ This change is behind a feature flag, which will be removed in a future release.
26
+
3
27
  ## 8.1.2
4
28
 
5
29
  ### Patch Changes
@@ -13,6 +13,7 @@ var _runtime = require("@compiled/react/runtime");
13
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
14
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
15
  var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-context"));
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/menu-item-primitive"));
17
18
  var _excluded = ["children", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap", "className", "interactionName"];
18
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
@@ -70,6 +71,10 @@ var ButtonItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
70
71
  className = _ref.className;
71
72
  return /*#__PURE__*/React.createElement("button", (0, _extends2.default)({
72
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
73
78
  }, rest, {
74
79
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
75
80
  className: className,
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { forwardRef, memo, useCallback, useContext } from 'react';
6
6
  import InteractionContext from '@atlaskit/interaction-context';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import MenuItemPrimitive from '../internal/components/menu-item-primitive';
8
9
  /**
9
10
  * __Button item__
@@ -59,6 +60,10 @@ const ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((props, ref) => {
59
60
  className
60
61
  }) => /*#__PURE__*/React.createElement("button", _extends({
61
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
62
67
  }, rest, {
63
68
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
64
69
  className: className,
@@ -6,6 +6,7 @@ import * as React from 'react';
6
6
  import { ax, ix } from "@compiled/react/runtime";
7
7
  import { forwardRef, memo, useCallback, useContext } from 'react';
8
8
  import InteractionContext from '@atlaskit/interaction-context';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import MenuItemPrimitive from '../internal/components/menu-item-primitive';
10
11
  /**
11
12
  * __Button item__
@@ -61,6 +62,10 @@ var ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref
61
62
  className = _ref.className;
62
63
  return /*#__PURE__*/React.createElement("button", _extends({
63
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
64
69
  }, rest, {
65
70
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
66
71
  className: className,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type SpacingMode = 'compact' | 'cozy';
3
2
  /**
4
3
  * __Spacing context__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { MenuItemPrimitiveProps } from '../../types';
3
2
  /**
4
3
  * __Menu item primitive__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ButtonItemProps } from '../types';
3
2
  /**
4
3
  * __Button item__
@@ -2,7 +2,6 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- /// <reference types="react" />
6
5
  import type { CustomItemComponentProps, CustomItemProps } from '../types';
7
6
  interface CustomItemTypeGenericHackProps {
8
7
  <TComponentProps>(props: CustomItemProps<TComponentProps> & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { HeadingItemProps } from '../types';
3
2
  /**
4
3
  * __Heading item__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { LinkItemProps } from '../types';
3
2
  /**
4
3
  * __Link item__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { SkeletonHeadingItemProps } from '../types';
3
2
  /**
4
3
  * __Skeleton heading item__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { SkeletonItemProps } from '../types';
3
2
  /**
4
3
  * __Skeleton item__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { MenuGroupProps } from '../types';
3
2
  /**
4
3
  * __Menu group__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { MenuGroupProps } from '../types';
3
2
  /**
4
3
  * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { SectionProps } from '../types';
3
2
  /**
4
3
  * __Section__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type SpacingMode = 'compact' | 'cozy';
3
2
  /**
4
3
  * __Spacing context__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { MenuItemPrimitiveProps } from '../../types';
3
2
  /**
4
3
  * __Menu item primitive__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ButtonItemProps } from '../types';
3
2
  /**
4
3
  * __Button item__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * @jsxRuntime classic
4
3
  * @jsx jsx
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { HeadingItemProps } from '../types';
3
2
  /**
4
3
  * __Heading item__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { LinkItemProps } from '../types';
3
2
  /**
4
3
  * __Link item__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { SkeletonHeadingItemProps } from '../types';
3
2
  /**
4
3
  * __Skeleton heading item__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { SkeletonItemProps } from '../types';
3
2
  /**
4
3
  * __Skeleton item__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { MenuGroupProps } from '../types';
3
2
  /**
4
3
  * __Menu group__
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { MenuGroupProps } from '../types';
3
2
  /**
4
3
  * @deprecated refer to MenuGroup, explicitly set maxWidth and minWidth
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { SectionProps } from '../types';
3
2
  /**
4
3
  * __Section__
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/menu",
3
- "version": "8.1.2",
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/"
@@ -40,7 +40,7 @@
40
40
  }
41
41
  },
42
42
  "dependencies": {
43
- "@atlaskit/app-provider": "^3.0.0",
43
+ "@atlaskit/app-provider": "^3.1.0",
44
44
  "@atlaskit/css": "^0.12.0",
45
45
  "@atlaskit/interaction-context": "^3.0.0",
46
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
@@ -61,16 +61,15 @@
61
61
  "@atlaskit/button": "^23.3.0",
62
62
  "@atlaskit/docs": "^11.0.0",
63
63
  "@atlaskit/ds-lib": "^5.0.0",
64
- "@atlaskit/icon": "^27.9.0",
64
+ "@atlaskit/icon": "^27.11.0",
65
65
  "@atlaskit/icon-file-type": "^7.0.0",
66
- "@atlaskit/icon-object": "^7.1.0",
66
+ "@atlaskit/icon-object": "^7.2.0",
67
67
  "@atlaskit/link": "^3.2.0",
68
68
  "@atlaskit/section-message": "^8.5.0",
69
69
  "@atlassian/feature-flags-test-utils": "^0.3.0",
70
70
  "@testing-library/react": "^13.4.0",
71
71
  "ast-types": "^0.13.3",
72
- "jscodeshift": "^17.0.0",
73
- "typescript": "~5.4.2"
72
+ "jscodeshift": "^17.0.0"
74
73
  },
75
74
  "keywords": [
76
75
  "atlaskit",
@@ -120,6 +119,9 @@
120
119
  "platform-feature-flags": {
121
120
  "platform_fix_a11y_selected_and_hovered_state_color": {
122
121
  "type": "boolean"
122
+ },
123
+ "platform_dst_menu_item_button_aria_current": {
124
+ "type": "boolean"
123
125
  }
124
126
  },
125
127
  "homepage": "https://atlassian.design/components/menu/"