@atlaskit/dropdown-menu 16.3.7 → 16.3.9
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 +14 -0
- package/dist/cjs/dropdown-menu.js +5 -0
- package/dist/es2019/dropdown-menu.js +6 -0
- package/dist/esm/dropdown-menu.js +5 -0
- package/package.json +10 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 16.3.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 16.3.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`cdb2b90aee75b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cdb2b90aee75b) -
|
|
14
|
+
Fixes accessibility violation of submenus not being either a `role='group'` or a `role='menuitem'`
|
|
15
|
+
when opened
|
|
16
|
+
|
|
3
17
|
## 16.3.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -19,6 +19,8 @@ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
|
19
19
|
var _useControlled = _interopRequireDefault(require("@atlaskit/ds-lib/use-controlled"));
|
|
20
20
|
var _useFocusEvent = _interopRequireDefault(require("@atlaskit/ds-lib/use-focus-event"));
|
|
21
21
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down"));
|
|
22
|
+
var _layering = require("@atlaskit/layering");
|
|
23
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
24
|
var _popup = _interopRequireDefault(require("@atlaskit/popup"));
|
|
23
25
|
var _constants = require("@atlaskit/theme/constants");
|
|
24
26
|
var _focusManager = _interopRequireDefault(require("./internal/components/focus-manager"));
|
|
@@ -114,6 +116,8 @@ var DropdownMenu = function DropdownMenu(_ref) {
|
|
|
114
116
|
setTriggeredUsingKeyboard = _useState2[1];
|
|
115
117
|
var id = (0, _useGeneratedId.default)();
|
|
116
118
|
var itemRef = (0, _useRegisterItemWithFocusManager.default)();
|
|
119
|
+
var _useLayering = (0, _layering.useLayering)(),
|
|
120
|
+
currentLevel = _useLayering.currentLevel;
|
|
117
121
|
var fallbackPlacements = (0, _react.useMemo)(function () {
|
|
118
122
|
return getFallbackPlacements(placement);
|
|
119
123
|
}, [placement]);
|
|
@@ -271,6 +275,7 @@ var DropdownMenu = function DropdownMenu(_ref) {
|
|
|
271
275
|
onClose: handleOnClose,
|
|
272
276
|
zIndex: zIndex,
|
|
273
277
|
placement: placement,
|
|
278
|
+
role: shouldRenderToParent && currentLevel > 0 && (0, _platformFeatureFlags.fg)('platform-dst-nested-dropdown-menu-role') ? 'group' : undefined,
|
|
274
279
|
fallbackPlacements: fallbackPlacements,
|
|
275
280
|
testId: testId && "".concat(testId, "--content"),
|
|
276
281
|
shouldUseCaptureOnOutsideClick: true
|
|
@@ -8,6 +8,8 @@ import noop from '@atlaskit/ds-lib/noop';
|
|
|
8
8
|
import useControlledState from '@atlaskit/ds-lib/use-controlled';
|
|
9
9
|
import useFocus from '@atlaskit/ds-lib/use-focus-event';
|
|
10
10
|
import ExpandIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
11
|
+
import { useLayering } from '@atlaskit/layering';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
13
|
import Popup from '@atlaskit/popup';
|
|
12
14
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
13
15
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -84,6 +86,9 @@ const DropdownMenu = ({
|
|
|
84
86
|
const [isTriggeredUsingKeyboard, setTriggeredUsingKeyboard] = useState(false);
|
|
85
87
|
const id = useGeneratedId();
|
|
86
88
|
const itemRef = useRegisterItemWithFocusManager();
|
|
89
|
+
const {
|
|
90
|
+
currentLevel
|
|
91
|
+
} = useLayering();
|
|
87
92
|
const fallbackPlacements = useMemo(() => getFallbackPlacements(placement), [placement]);
|
|
88
93
|
const handleTriggerClicked = useCallback(
|
|
89
94
|
// TODO: event is an `any` and is being cast incorrectly
|
|
@@ -242,6 +247,7 @@ const DropdownMenu = ({
|
|
|
242
247
|
onClose: handleOnClose,
|
|
243
248
|
zIndex: zIndex,
|
|
244
249
|
placement: placement,
|
|
250
|
+
role: shouldRenderToParent && currentLevel > 0 && fg('platform-dst-nested-dropdown-menu-role') ? 'group' : undefined,
|
|
245
251
|
fallbackPlacements: fallbackPlacements,
|
|
246
252
|
testId: testId && `${testId}--content`,
|
|
247
253
|
shouldUseCaptureOnOutsideClick: true
|
|
@@ -14,6 +14,8 @@ import noop from '@atlaskit/ds-lib/noop';
|
|
|
14
14
|
import useControlledState from '@atlaskit/ds-lib/use-controlled';
|
|
15
15
|
import useFocus from '@atlaskit/ds-lib/use-focus-event';
|
|
16
16
|
import ExpandIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
17
|
+
import { useLayering } from '@atlaskit/layering';
|
|
18
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
19
|
import Popup from '@atlaskit/popup';
|
|
18
20
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
19
21
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -106,6 +108,8 @@ var DropdownMenu = function DropdownMenu(_ref) {
|
|
|
106
108
|
setTriggeredUsingKeyboard = _useState2[1];
|
|
107
109
|
var id = useGeneratedId();
|
|
108
110
|
var itemRef = useRegisterItemWithFocusManager();
|
|
111
|
+
var _useLayering = useLayering(),
|
|
112
|
+
currentLevel = _useLayering.currentLevel;
|
|
109
113
|
var fallbackPlacements = useMemo(function () {
|
|
110
114
|
return getFallbackPlacements(placement);
|
|
111
115
|
}, [placement]);
|
|
@@ -263,6 +267,7 @@ var DropdownMenu = function DropdownMenu(_ref) {
|
|
|
263
267
|
onClose: handleOnClose,
|
|
264
268
|
zIndex: zIndex,
|
|
265
269
|
placement: placement,
|
|
270
|
+
role: shouldRenderToParent && currentLevel > 0 && fg('platform-dst-nested-dropdown-menu-role') ? 'group' : undefined,
|
|
266
271
|
fallbackPlacements: fallbackPlacements,
|
|
267
272
|
testId: testId && "".concat(testId, "--content"),
|
|
268
273
|
shouldUseCaptureOnOutsideClick: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dropdown-menu",
|
|
3
|
-
"version": "16.3.
|
|
3
|
+
"version": "16.3.9",
|
|
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/"
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@atlaskit/button": "^23.4.0",
|
|
28
|
-
"@atlaskit/css": "^0.
|
|
28
|
+
"@atlaskit/css": "^0.13.0",
|
|
29
29
|
"@atlaskit/ds-lib": "^5.0.0",
|
|
30
30
|
"@atlaskit/icon": "^28.1.0",
|
|
31
31
|
"@atlaskit/layering": "^3.0.0",
|
|
32
|
-
"@atlaskit/menu": "^8.
|
|
32
|
+
"@atlaskit/menu": "^8.4.0",
|
|
33
33
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
34
34
|
"@atlaskit/popup": "^4.3.0",
|
|
35
|
-
"@atlaskit/primitives": "^14.
|
|
35
|
+
"@atlaskit/primitives": "^14.13.0",
|
|
36
36
|
"@atlaskit/spinner": "^19.0.0",
|
|
37
37
|
"@atlaskit/theme": "^20.0.0",
|
|
38
|
-
"@atlaskit/tokens": "^6.
|
|
38
|
+
"@atlaskit/tokens": "^6.2.0",
|
|
39
39
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
40
40
|
"@babel/runtime": "^7.0.0",
|
|
41
41
|
"bind-event-listener": "^3.0.0"
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"@atlaskit/avatar": "^25.1.0",
|
|
54
54
|
"@atlaskit/checkbox": "^17.1.0",
|
|
55
55
|
"@atlaskit/docs": "^11.0.0",
|
|
56
|
-
"@atlaskit/form": "^12.
|
|
56
|
+
"@atlaskit/form": "^12.4.0",
|
|
57
57
|
"@atlaskit/heading": "^5.2.0",
|
|
58
58
|
"@atlaskit/link": "^3.2.0",
|
|
59
59
|
"@atlaskit/lozenge": "^13.0.0",
|
|
60
60
|
"@atlaskit/modal-dialog": "^14.3.0",
|
|
61
|
-
"@atlaskit/section-message": "^8.
|
|
61
|
+
"@atlaskit/section-message": "^8.7.0",
|
|
62
62
|
"@atlaskit/textfield": "^8.0.0",
|
|
63
63
|
"@atlaskit/toggle": "^15.1.0",
|
|
64
64
|
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
@@ -90,6 +90,9 @@
|
|
|
90
90
|
},
|
|
91
91
|
"platform_dst_dropdown_radio_default_selected_fix": {
|
|
92
92
|
"type": "boolean"
|
|
93
|
+
},
|
|
94
|
+
"platform-dst-nested-dropdown-menu-role": {
|
|
95
|
+
"type": "boolean"
|
|
93
96
|
}
|
|
94
97
|
},
|
|
95
98
|
"techstack": {
|
|
@@ -123,9 +126,5 @@
|
|
|
123
126
|
]
|
|
124
127
|
}
|
|
125
128
|
},
|
|
126
|
-
"af:exports": {
|
|
127
|
-
".": "./src/index.tsx",
|
|
128
|
-
"./types": "./src/types.tsx"
|
|
129
|
-
},
|
|
130
129
|
"homepage": "https://atlassian.design/components/dropdown-menu/"
|
|
131
130
|
}
|