@atlaskit/dropdown-menu 16.4.4 → 16.4.5
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 +8 -0
- package/dist/cjs/internal/components/menu-wrapper.compiled.css +4 -4
- package/dist/cjs/internal/components/menu-wrapper.js +3 -2
- package/dist/es2019/internal/components/menu-wrapper.compiled.css +4 -4
- package/dist/es2019/internal/components/menu-wrapper.js +3 -2
- package/dist/esm/internal/components/menu-wrapper.compiled.css +4 -4
- package/dist/esm/internal/components/menu-wrapper.js +3 -2
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 16.4.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b76a4bfc0a066`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b76a4bfc0a066) -
|
|
8
|
+
Focus on first focusable element in dropdown menu by default for keyboard trigger under fg
|
|
9
|
+
platform_dst_menu_item_focus
|
|
10
|
+
|
|
3
11
|
## 16.4.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
._19bvv47k{padding-left:var(--ds-space-250,20px)}
|
|
2
1
|
._1bah1h6o{justify-content:center}
|
|
3
2
|
._1e0c1txw{display:flex}
|
|
3
|
+
._1q51v47k{padding-block-start:var(--ds-space-250,20px)}
|
|
4
4
|
._1ul91lit{min-width:10pc}
|
|
5
|
-
.
|
|
6
|
-
.
|
|
7
|
-
.
|
|
5
|
+
._85i5v47k{padding-block-end:var(--ds-space-250,20px)}
|
|
6
|
+
._bozgv47k{padding-inline-start:var(--ds-space-250,20px)}
|
|
7
|
+
._y4tiv47k{padding-inline-end:var(--ds-space-250,20px)}
|
|
@@ -12,6 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var React = _react;
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _menuGroup = _interopRequireDefault(require("@atlaskit/menu/menu-group"));
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
16
17
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
17
18
|
var _isCheckboxItem = _interopRequireDefault(require("../utils/is-checkbox-item"));
|
|
@@ -19,7 +20,7 @@ var _isRadioItem = _interopRequireDefault(require("../utils/is-radio-item"));
|
|
|
19
20
|
var _focusManager = require("./focus-manager");
|
|
20
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); }
|
|
21
22
|
var styles = {
|
|
22
|
-
spinnerContainer: "_1e0c1txw _1ul91lit _1bah1h6o
|
|
23
|
+
spinnerContainer: "_1e0c1txw _1ul91lit _1bah1h6o _1q51v47k _y4tiv47k _85i5v47k _bozgv47k"
|
|
23
24
|
};
|
|
24
25
|
var LoadingIndicator = function LoadingIndicator(_ref) {
|
|
25
26
|
var _ref$statusLabel = _ref.statusLabel,
|
|
@@ -91,7 +92,7 @@ var MenuWrapper = function MenuWrapper(_ref2) {
|
|
|
91
92
|
}).find(function (el) {
|
|
92
93
|
return !!el && !el.hasAttribute('disabled');
|
|
93
94
|
})) !== null && _menuItemRefs$map$fin !== void 0 ? _menuItemRefs$map$fin : null;
|
|
94
|
-
if (shouldRenderToParent && (isTriggeredUsingKeyboard || autoFocus)) {
|
|
95
|
+
if (((0, _platformFeatureFlags.fg)('platform_dst_menu_item_focus') || shouldRenderToParent) && (isTriggeredUsingKeyboard || autoFocus)) {
|
|
95
96
|
firstFocusableRef === null || firstFocusableRef === void 0 || firstFocusableRef.focus();
|
|
96
97
|
}
|
|
97
98
|
setInitialFocusRef === null || setInitialFocusRef === void 0 || setInitialFocusRef(firstFocusableRef);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
._19bvv47k{padding-left:var(--ds-space-250,20px)}
|
|
2
1
|
._1bah1h6o{justify-content:center}
|
|
3
2
|
._1e0c1txw{display:flex}
|
|
3
|
+
._1q51v47k{padding-block-start:var(--ds-space-250,20px)}
|
|
4
4
|
._1ul91lit{min-width:10pc}
|
|
5
|
-
.
|
|
6
|
-
.
|
|
7
|
-
.
|
|
5
|
+
._85i5v47k{padding-block-end:var(--ds-space-250,20px)}
|
|
6
|
+
._bozgv47k{padding-inline-start:var(--ds-space-250,20px)}
|
|
7
|
+
._y4tiv47k{padding-inline-end:var(--ds-space-250,20px)}
|
|
@@ -4,13 +4,14 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useContext, useEffect, useLayoutEffect } from 'react';
|
|
6
6
|
import MenuGroup from '@atlaskit/menu/menu-group';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
8
9
|
import Spinner from '@atlaskit/spinner';
|
|
9
10
|
import isCheckboxItem from '../utils/is-checkbox-item';
|
|
10
11
|
import isRadioItem from '../utils/is-radio-item';
|
|
11
12
|
import { FocusManagerContext } from './focus-manager';
|
|
12
13
|
const styles = {
|
|
13
|
-
spinnerContainer: "_1e0c1txw _1ul91lit _1bah1h6o
|
|
14
|
+
spinnerContainer: "_1e0c1txw _1ul91lit _1bah1h6o _1q51v47k _y4tiv47k _85i5v47k _bozgv47k"
|
|
14
15
|
};
|
|
15
16
|
const LoadingIndicator = ({
|
|
16
17
|
statusLabel = 'Loading',
|
|
@@ -81,7 +82,7 @@ const MenuWrapper = ({
|
|
|
81
82
|
const firstFocusableRef = (_menuItemRefs$map$fin = menuItemRefs.map(({
|
|
82
83
|
current
|
|
83
84
|
}) => current).find(el => !!el && !el.hasAttribute('disabled'))) !== null && _menuItemRefs$map$fin !== void 0 ? _menuItemRefs$map$fin : null;
|
|
84
|
-
if (shouldRenderToParent && (isTriggeredUsingKeyboard || autoFocus)) {
|
|
85
|
+
if ((fg('platform_dst_menu_item_focus') || shouldRenderToParent) && (isTriggeredUsingKeyboard || autoFocus)) {
|
|
85
86
|
firstFocusableRef === null || firstFocusableRef === void 0 ? void 0 : firstFocusableRef.focus();
|
|
86
87
|
}
|
|
87
88
|
setInitialFocusRef === null || setInitialFocusRef === void 0 ? void 0 : setInitialFocusRef(firstFocusableRef);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
._19bvv47k{padding-left:var(--ds-space-250,20px)}
|
|
2
1
|
._1bah1h6o{justify-content:center}
|
|
3
2
|
._1e0c1txw{display:flex}
|
|
3
|
+
._1q51v47k{padding-block-start:var(--ds-space-250,20px)}
|
|
4
4
|
._1ul91lit{min-width:10pc}
|
|
5
|
-
.
|
|
6
|
-
.
|
|
7
|
-
.
|
|
5
|
+
._85i5v47k{padding-block-end:var(--ds-space-250,20px)}
|
|
6
|
+
._bozgv47k{padding-inline-start:var(--ds-space-250,20px)}
|
|
7
|
+
._y4tiv47k{padding-inline-end:var(--ds-space-250,20px)}
|
|
@@ -4,13 +4,14 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useContext, useEffect, useLayoutEffect } from 'react';
|
|
6
6
|
import MenuGroup from '@atlaskit/menu/menu-group';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
8
9
|
import Spinner from '@atlaskit/spinner';
|
|
9
10
|
import isCheckboxItem from '../utils/is-checkbox-item';
|
|
10
11
|
import isRadioItem from '../utils/is-radio-item';
|
|
11
12
|
import { FocusManagerContext } from './focus-manager';
|
|
12
13
|
var styles = {
|
|
13
|
-
spinnerContainer: "_1e0c1txw _1ul91lit _1bah1h6o
|
|
14
|
+
spinnerContainer: "_1e0c1txw _1ul91lit _1bah1h6o _1q51v47k _y4tiv47k _85i5v47k _bozgv47k"
|
|
14
15
|
};
|
|
15
16
|
var LoadingIndicator = function LoadingIndicator(_ref) {
|
|
16
17
|
var _ref$statusLabel = _ref.statusLabel,
|
|
@@ -82,7 +83,7 @@ var MenuWrapper = function MenuWrapper(_ref2) {
|
|
|
82
83
|
}).find(function (el) {
|
|
83
84
|
return !!el && !el.hasAttribute('disabled');
|
|
84
85
|
})) !== null && _menuItemRefs$map$fin !== void 0 ? _menuItemRefs$map$fin : null;
|
|
85
|
-
if (shouldRenderToParent && (isTriggeredUsingKeyboard || autoFocus)) {
|
|
86
|
+
if ((fg('platform_dst_menu_item_focus') || shouldRenderToParent) && (isTriggeredUsingKeyboard || autoFocus)) {
|
|
86
87
|
firstFocusableRef === null || firstFocusableRef === void 0 || firstFocusableRef.focus();
|
|
87
88
|
}
|
|
88
89
|
setInitialFocusRef === null || setInitialFocusRef === void 0 || setInitialFocusRef(firstFocusableRef);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dropdown-menu",
|
|
3
|
-
"version": "16.4.
|
|
3
|
+
"version": "16.4.5",
|
|
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/"
|
|
@@ -48,20 +48,20 @@
|
|
|
48
48
|
"@af/accessibility-testing": "workspace:^",
|
|
49
49
|
"@af/integration-testing": "workspace:^",
|
|
50
50
|
"@af/visual-regression": "workspace:^",
|
|
51
|
-
"@atlaskit/app-provider": "^4.
|
|
51
|
+
"@atlaskit/app-provider": "^4.1.0",
|
|
52
52
|
"@atlaskit/atlassian-navigation": "^5.6.0",
|
|
53
53
|
"@atlaskit/avatar": "^25.7.0",
|
|
54
54
|
"@atlaskit/checkbox": "^17.3.0",
|
|
55
55
|
"@atlaskit/docs": "^11.3.0",
|
|
56
56
|
"@atlaskit/form": "^15.3.0",
|
|
57
|
-
"@atlaskit/heading": "^5.
|
|
57
|
+
"@atlaskit/heading": "^5.3.0",
|
|
58
58
|
"@atlaskit/link": "^3.3.0",
|
|
59
|
-
"@atlaskit/lozenge": "^13.
|
|
59
|
+
"@atlaskit/lozenge": "^13.4.0",
|
|
60
60
|
"@atlaskit/modal-dialog": "^14.10.0",
|
|
61
61
|
"@atlaskit/section-message": "^8.12.0",
|
|
62
62
|
"@atlaskit/textfield": "^8.2.0",
|
|
63
63
|
"@atlaskit/toggle": "^15.2.0",
|
|
64
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
64
|
+
"@atlassian/a11y-jest-testing": "^0.9.0",
|
|
65
65
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
66
66
|
"@testing-library/react": "^16.3.0",
|
|
67
67
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -89,6 +89,9 @@
|
|
|
89
89
|
},
|
|
90
90
|
"platform-dst-nested-dropdown-menu-role": {
|
|
91
91
|
"type": "boolean"
|
|
92
|
+
},
|
|
93
|
+
"platform_dst_menu_item_focus": {
|
|
94
|
+
"type": "boolean"
|
|
92
95
|
}
|
|
93
96
|
},
|
|
94
97
|
"techstack": {
|