@atlaskit/menu 8.1.2 → 8.2.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 +11 -0
  2. package/dist/cjs/menu-item/button-item.js +2 -0
  3. package/dist/es2019/menu-item/button-item.js +2 -0
  4. package/dist/esm/menu-item/button-item.js +2 -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,16 @@
1
1
  # @atlaskit/menu
2
2
 
3
+ ## 8.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#200012](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/200012)
8
+ [`3b577f51b24b1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3b577f51b24b1) -
9
+ ButtonItem will convey its selected state to screen readers when `isSelected`. This is done
10
+ through the `aria-current` attribute.
11
+
12
+ This change is behind a feature flag, which will be removed in a future release.
13
+
3
14
  ## 8.1.2
4
15
 
5
16
  ### 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); }
@@ -77,6 +78,7 @@ var ButtonItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
77
78
  disabled: isDisabled,
78
79
  onClick: handleClick,
79
80
  onMouseDown: onMouseDownHandler,
81
+ "aria-current": isSelected && (0, _platformFeatureFlags.fg)('platform_dst_menu_item_button_aria_current') ? 'true' : undefined,
80
82
  type: "button"
81
83
  }), children);
82
84
  });
@@ -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__
@@ -66,6 +67,7 @@ const ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((props, ref) => {
66
67
  disabled: isDisabled,
67
68
  onClick: handleClick,
68
69
  onMouseDown: onMouseDownHandler,
70
+ "aria-current": isSelected && fg('platform_dst_menu_item_button_aria_current') ? 'true' : undefined,
69
71
  type: "button"
70
72
  }), children));
71
73
  }));
@@ -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__
@@ -68,6 +69,7 @@ var ButtonItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref
68
69
  disabled: isDisabled,
69
70
  onClick: handleClick,
70
71
  onMouseDown: onMouseDownHandler,
72
+ "aria-current": isSelected && fg('platform_dst_menu_item_button_aria_current') ? 'true' : undefined,
71
73
  type: "button"
72
74
  }), children);
73
75
  });
@@ -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.2.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/"