@atlaskit/dropdown-menu 16.1.0 → 16.1.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,19 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 16.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#172917](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/172917)
|
|
8
|
+
[`8a3d5265aaa3b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8a3d5265aaa3b) -
|
|
9
|
+
Adds aria described by for better screen reader context
|
|
10
|
+
|
|
11
|
+
## 16.1.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 16.1.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -13,10 +13,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
14
14
|
var _menu = require("@atlaskit/menu");
|
|
15
15
|
var _buttonItem = _interopRequireDefault(require("@atlaskit/menu/button-item"));
|
|
16
|
+
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
16
17
|
var _radioIcon = _interopRequireDefault(require("../internal/components/radio-icon"));
|
|
17
18
|
var _useRadioState3 = _interopRequireDefault(require("../internal/hooks/use-radio-state"));
|
|
18
19
|
var _useRegisterItemWithFocusManager = _interopRequireDefault(require("../internal/hooks/use-register-item-with-focus-manager"));
|
|
19
|
-
var _isVoiceOverSupported = _interopRequireDefault(require("../internal/utils/is-voice-over-supported"));
|
|
20
20
|
var _excluded = ["children", "defaultSelected", "testId", "id", "title", "description", "isDisabled", "isSelected", "onClick", "shouldDescriptionWrap", "shouldTitleWrap", "interactionName"];
|
|
21
21
|
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); }
|
|
22
22
|
/**
|
|
@@ -68,6 +68,7 @@ var DropdownItemRadio = function DropdownItemRadio(_ref) {
|
|
|
68
68
|
value: "none"
|
|
69
69
|
}, /*#__PURE__*/_react.default.createElement(_buttonItem.default, (0, _extends2.default)({
|
|
70
70
|
"aria-checked": selected,
|
|
71
|
+
"aria-describedby": "".concat(id, "-radio"),
|
|
71
72
|
description: description,
|
|
72
73
|
iconBefore: /*#__PURE__*/_react.default.createElement(_radioIcon.default, {
|
|
73
74
|
checked: selected
|
|
@@ -77,7 +78,7 @@ var DropdownItemRadio = function DropdownItemRadio(_ref) {
|
|
|
77
78
|
isSelected: selected,
|
|
78
79
|
onClick: onClickHandler,
|
|
79
80
|
ref: itemRef,
|
|
80
|
-
role:
|
|
81
|
+
role: "menuitemradio",
|
|
81
82
|
shouldDescriptionWrap: shouldDescriptionWrap,
|
|
82
83
|
shouldTitleWrap: shouldTitleWrap,
|
|
83
84
|
testId: testId
|
|
@@ -88,6 +89,8 @@ var DropdownItemRadio = function DropdownItemRadio(_ref) {
|
|
|
88
89
|
title: title,
|
|
89
90
|
interactionName: interactionName
|
|
90
91
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
91
|
-
}, rest), children)
|
|
92
|
+
}, rest), children), /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, {
|
|
93
|
+
id: "".concat(id, "-radio")
|
|
94
|
+
}, "radio button ", selected));
|
|
92
95
|
};
|
|
93
96
|
var _default = exports.default = DropdownItemRadio;
|
|
@@ -3,10 +3,10 @@ import React, { useCallback } from 'react';
|
|
|
3
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
4
4
|
import { SELECTION_STYLE_CONTEXT_DO_NOT_USE } from '@atlaskit/menu';
|
|
5
5
|
import ButtonItem from '@atlaskit/menu/button-item';
|
|
6
|
+
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
6
7
|
import RadioIcon from '../internal/components/radio-icon';
|
|
7
8
|
import useRadioState from '../internal/hooks/use-radio-state';
|
|
8
9
|
import useRegisterItemWithFocusManager from '../internal/hooks/use-register-item-with-focus-manager';
|
|
9
|
-
import isVoiceOverSupported from '../internal/utils/is-voice-over-supported';
|
|
10
10
|
/**
|
|
11
11
|
* __Dropdown item radio__
|
|
12
12
|
*
|
|
@@ -50,6 +50,7 @@ const DropdownItemRadio = ({
|
|
|
50
50
|
value: "none"
|
|
51
51
|
}, /*#__PURE__*/React.createElement(ButtonItem, _extends({
|
|
52
52
|
"aria-checked": selected,
|
|
53
|
+
"aria-describedby": `${id}-radio`,
|
|
53
54
|
description: description,
|
|
54
55
|
iconBefore: /*#__PURE__*/React.createElement(RadioIcon, {
|
|
55
56
|
checked: selected
|
|
@@ -59,7 +60,7 @@ const DropdownItemRadio = ({
|
|
|
59
60
|
isSelected: selected,
|
|
60
61
|
onClick: onClickHandler,
|
|
61
62
|
ref: itemRef,
|
|
62
|
-
role:
|
|
63
|
+
role: "menuitemradio",
|
|
63
64
|
shouldDescriptionWrap: shouldDescriptionWrap,
|
|
64
65
|
shouldTitleWrap: shouldTitleWrap,
|
|
65
66
|
testId: testId
|
|
@@ -70,6 +71,8 @@ const DropdownItemRadio = ({
|
|
|
70
71
|
title: title,
|
|
71
72
|
interactionName: interactionName
|
|
72
73
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
73
|
-
}, rest), children)
|
|
74
|
+
}, rest), children), /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
75
|
+
id: `${id}-radio`
|
|
76
|
+
}, "radio button ", selected));
|
|
74
77
|
};
|
|
75
78
|
export default DropdownItemRadio;
|
|
@@ -6,10 +6,10 @@ import React, { useCallback } from 'react';
|
|
|
6
6
|
import noop from '@atlaskit/ds-lib/noop';
|
|
7
7
|
import { SELECTION_STYLE_CONTEXT_DO_NOT_USE } from '@atlaskit/menu';
|
|
8
8
|
import ButtonItem from '@atlaskit/menu/button-item';
|
|
9
|
+
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
9
10
|
import RadioIcon from '../internal/components/radio-icon';
|
|
10
11
|
import useRadioState from '../internal/hooks/use-radio-state';
|
|
11
12
|
import useRegisterItemWithFocusManager from '../internal/hooks/use-register-item-with-focus-manager';
|
|
12
|
-
import isVoiceOverSupported from '../internal/utils/is-voice-over-supported';
|
|
13
13
|
/**
|
|
14
14
|
* __Dropdown item radio__
|
|
15
15
|
*
|
|
@@ -59,6 +59,7 @@ var DropdownItemRadio = function DropdownItemRadio(_ref) {
|
|
|
59
59
|
value: "none"
|
|
60
60
|
}, /*#__PURE__*/React.createElement(ButtonItem, _extends({
|
|
61
61
|
"aria-checked": selected,
|
|
62
|
+
"aria-describedby": "".concat(id, "-radio"),
|
|
62
63
|
description: description,
|
|
63
64
|
iconBefore: /*#__PURE__*/React.createElement(RadioIcon, {
|
|
64
65
|
checked: selected
|
|
@@ -68,7 +69,7 @@ var DropdownItemRadio = function DropdownItemRadio(_ref) {
|
|
|
68
69
|
isSelected: selected,
|
|
69
70
|
onClick: onClickHandler,
|
|
70
71
|
ref: itemRef,
|
|
71
|
-
role:
|
|
72
|
+
role: "menuitemradio",
|
|
72
73
|
shouldDescriptionWrap: shouldDescriptionWrap,
|
|
73
74
|
shouldTitleWrap: shouldTitleWrap,
|
|
74
75
|
testId: testId
|
|
@@ -79,6 +80,8 @@ var DropdownItemRadio = function DropdownItemRadio(_ref) {
|
|
|
79
80
|
title: title,
|
|
80
81
|
interactionName: interactionName
|
|
81
82
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
82
|
-
}, rest), children)
|
|
83
|
+
}, rest), children), /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
84
|
+
id: "".concat(id, "-radio")
|
|
85
|
+
}, "radio button ", selected));
|
|
83
86
|
};
|
|
84
87
|
export default DropdownItemRadio;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dropdown-menu",
|
|
3
|
-
"version": "16.1.
|
|
3
|
+
"version": "16.1.2",
|
|
4
4
|
"description": "A dropdown menu displays a list of actions or options to a user.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,17 +26,18 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@atlaskit/button": "^23.2.0",
|
|
29
|
-
"@atlaskit/css": "^0.
|
|
29
|
+
"@atlaskit/css": "^0.11.0",
|
|
30
30
|
"@atlaskit/ds-lib": "^4.0.0",
|
|
31
|
-
"@atlaskit/icon": "^27.
|
|
31
|
+
"@atlaskit/icon": "^27.1.0",
|
|
32
32
|
"@atlaskit/layering": "^3.0.0",
|
|
33
33
|
"@atlaskit/menu": "^8.0.0",
|
|
34
34
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
35
35
|
"@atlaskit/popup": "^4.3.0",
|
|
36
|
-
"@atlaskit/primitives": "^14.
|
|
36
|
+
"@atlaskit/primitives": "^14.9.0",
|
|
37
37
|
"@atlaskit/spinner": "^18.0.0",
|
|
38
38
|
"@atlaskit/theme": "^18.0.0",
|
|
39
|
-
"@atlaskit/tokens": "^5.
|
|
39
|
+
"@atlaskit/tokens": "^5.4.0",
|
|
40
|
+
"@atlaskit/visually-hidden": "^3.0.0",
|
|
40
41
|
"@babel/runtime": "^7.0.0",
|
|
41
42
|
"bind-event-listener": "^3.0.0"
|
|
42
43
|
},
|