@atlaskit/navigation-system 5.16.0 → 5.17.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.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-header.js +3 -1
- package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item-content.js +8 -3
- package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +21 -2
- package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item.js +3 -1
- package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-header.js +4 -2
- package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item-content.js +10 -5
- package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +18 -1
- package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item.js +3 -1
- package/dist/esm/ui/menu-item/flyout-menu-item/flyout-header.js +4 -2
- package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item-content.js +10 -5
- package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +20 -1
- package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item.js +3 -1
- package/dist/types/ui/menu-item/flyout-menu-item/flyout-menu-item-context.d.ts +15 -0
- package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-menu-item-context.d.ts +15 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 5.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6f95ec25daa67`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6f95ec25daa67) -
|
|
8
|
+
Fixes to accessibility issues for the flyout menu.
|
|
9
|
+
|
|
10
|
+
This includes changing the `aria-haspopup` value from `"true"` to `"dialog"`, setting the `role`
|
|
11
|
+
of the popup container to `"dialog"`, adding an `aria-labelledby` to the popup container to
|
|
12
|
+
reference the `id` of the title in the header slot, and ensuring that escape dismisses the dialog
|
|
13
|
+
and places focus back on the trigger.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 5.16.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -31,6 +31,7 @@ var FlyoutHeader = exports.FlyoutHeader = function FlyoutHeader(props) {
|
|
|
31
31
|
testId = props.testId,
|
|
32
32
|
title = props.title,
|
|
33
33
|
closeButtonLabel = props.closeButtonLabel;
|
|
34
|
+
var id = (0, _flyoutMenuItemContext.useTitleId)();
|
|
34
35
|
var setIsOpen = (0, _react.useContext)(_flyoutMenuItemContext.SetIsOpenContext);
|
|
35
36
|
var onClose = (0, _react.useContext)(_flyoutMenuItemContext.OnCloseContext);
|
|
36
37
|
var handleClose = (0, _react.useCallback)(function () {
|
|
@@ -48,6 +49,7 @@ var FlyoutHeader = exports.FlyoutHeader = function FlyoutHeader(props) {
|
|
|
48
49
|
testId: testId && "".concat(testId, "--close-button")
|
|
49
50
|
}), /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
50
51
|
size: "xsmall",
|
|
51
|
-
as: "span"
|
|
52
|
+
as: "span",
|
|
53
|
+
id: id
|
|
52
54
|
}, title)), children);
|
|
53
55
|
};
|
|
@@ -50,6 +50,7 @@ var FlyoutMenuItemContent = exports.FlyoutMenuItemContent = /*#__PURE__*/(0, _re
|
|
|
50
50
|
onClose === null || onClose === void 0 || onClose();
|
|
51
51
|
setIsOpen(false);
|
|
52
52
|
}, [setIsOpen, onClose]);
|
|
53
|
+
var titleId = (0, _react.useId)();
|
|
53
54
|
return /*#__PURE__*/_react.default.createElement(_experimental.PopupContent, {
|
|
54
55
|
appearance: "UNSAFE_modal-below-sm",
|
|
55
56
|
onClose: handleClose,
|
|
@@ -62,7 +63,9 @@ var FlyoutMenuItemContent = exports.FlyoutMenuItemContent = /*#__PURE__*/(0, _re
|
|
|
62
63
|
shouldFitViewport: true,
|
|
63
64
|
testId: containerTestId,
|
|
64
65
|
xcss: flyoutMenuItemContentStyles.root,
|
|
65
|
-
autoFocus: autoFocus
|
|
66
|
+
autoFocus: autoFocus,
|
|
67
|
+
role: (0, _platformFeatureFlags.fg)("platform_dst_nav4_flyout_menu_slots_close_button") ? "dialog" : undefined,
|
|
68
|
+
titleId: (0, _platformFeatureFlags.fg)("platform_dst_nav4_flyout_menu_slots_close_button") ? titleId : undefined
|
|
66
69
|
/**
|
|
67
70
|
* Disabling GPU acceleration removes the use of `transform` by popper.js for this popup.
|
|
68
71
|
*
|
|
@@ -83,13 +86,15 @@ var FlyoutMenuItemContent = exports.FlyoutMenuItemContent = /*#__PURE__*/(0, _re
|
|
|
83
86
|
return /*#__PURE__*/_react.default.createElement(UpdatePopperOnContentResize, {
|
|
84
87
|
ref: forwardedRef,
|
|
85
88
|
update: update
|
|
86
|
-
}, (0, _platformFeatureFlags.fg)("platform_dst_nav4_flyout_menu_slots_close_button") ? /*#__PURE__*/_react.default.createElement(_flyoutMenuItemContext.
|
|
89
|
+
}, (0, _platformFeatureFlags.fg)("platform_dst_nav4_flyout_menu_slots_close_button") ? /*#__PURE__*/_react.default.createElement(_flyoutMenuItemContext.TitleIdContextProvider, {
|
|
90
|
+
value: titleId
|
|
91
|
+
}, /*#__PURE__*/_react.default.createElement(_flyoutMenuItemContext.OnCloseProvider, {
|
|
87
92
|
value: function value() {
|
|
88
93
|
return onClose;
|
|
89
94
|
}
|
|
90
95
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
91
96
|
className: (0, _runtime.ax)([flyoutMenuItemContentContainerStyles.container])
|
|
92
|
-
}, children)) : children);
|
|
97
|
+
}, children))) : children);
|
|
93
98
|
});
|
|
94
99
|
});
|
|
95
100
|
function createResizeObserver(update) {
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.useSetFlyoutMenuOpen = exports.useFlyoutMenuOpen = exports.SetIsOpenContext = exports.OnCloseProvider = exports.OnCloseContext = exports.IsOpenContext = void 0;
|
|
7
|
+
exports.useTitleId = exports.useSetFlyoutMenuOpen = exports.useFlyoutMenuOpen = exports.TitleIdContextProvider = exports.TitleIdContext = exports.SetIsOpenContext = exports.OnCloseProvider = exports.OnCloseContext = exports.IsOpenContext = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
10
10
|
/**
|
|
@@ -39,4 +39,23 @@ var OnCloseContext = exports.OnCloseContext = /*#__PURE__*/(0, _react.createCont
|
|
|
39
39
|
*
|
|
40
40
|
* A context provider for supplying the onClose function to the FlyoutHeader.
|
|
41
41
|
*/
|
|
42
|
-
var OnCloseProvider = exports.OnCloseProvider = OnCloseContext.Provider;
|
|
42
|
+
var OnCloseProvider = exports.OnCloseProvider = OnCloseContext.Provider;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* __Title id context__
|
|
46
|
+
*
|
|
47
|
+
* A context for storing the title id of the FlyoutMenuItem that is displayed in
|
|
48
|
+
* FlyoutHeader, and used as the aria-labelledby on the FlyoutMenuItemContent
|
|
49
|
+
* container.
|
|
50
|
+
*/
|
|
51
|
+
var TitleIdContext = exports.TitleIdContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
52
|
+
var useTitleId = exports.useTitleId = function useTitleId() {
|
|
53
|
+
return (0, _react.useContext)(TitleIdContext);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* __Title id provider__
|
|
58
|
+
*
|
|
59
|
+
* A context provider for supplying the title id to the FlyoutHeader.
|
|
60
|
+
*/
|
|
61
|
+
var TitleIdContextProvider = exports.TitleIdContextProvider = TitleIdContext.Provider;
|
|
@@ -10,6 +10,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _useControlled3 = _interopRequireDefault(require("@atlaskit/ds-lib/use-controlled"));
|
|
12
12
|
var _usePreviousValue = _interopRequireDefault(require("@atlaskit/ds-lib/use-previous-value"));
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
14
|
var _experimental = require("@atlaskit/popup/experimental");
|
|
14
15
|
var _menuListItem = require("../menu-list-item");
|
|
15
16
|
var _flyoutMenuItemContext = require("./flyout-menu-item-context");
|
|
@@ -69,6 +70,7 @@ var FlyoutMenuItem = exports.FlyoutMenuItem = /*#__PURE__*/(0, _react.forwardRef
|
|
|
69
70
|
ref: forwardedRef
|
|
70
71
|
}, /*#__PURE__*/_react.default.createElement(_experimental.Popup, {
|
|
71
72
|
id: id,
|
|
72
|
-
isOpen: isOpen
|
|
73
|
+
isOpen: isOpen,
|
|
74
|
+
role: (0, _platformFeatureFlags.fg)('platform_dst_nav4_flyout_menu_slots_close_button') ? 'dialog' : undefined
|
|
73
75
|
}, children))));
|
|
74
76
|
});
|
|
@@ -5,7 +5,7 @@ import React, { useCallback, useContext } from 'react';
|
|
|
5
5
|
import Heading from '@atlaskit/heading';
|
|
6
6
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
7
7
|
import { CloseButton } from './close-button';
|
|
8
|
-
import { OnCloseContext, SetIsOpenContext } from './flyout-menu-item-context';
|
|
8
|
+
import { OnCloseContext, SetIsOpenContext, useTitleId } from './flyout-menu-item-context';
|
|
9
9
|
const headerStyles = {
|
|
10
10
|
root: "_zulp12x7 _bozg1b66 _85i512x7 _1e0c1txw _2lx21bp4",
|
|
11
11
|
flex: "_zulppxbi _1bah1yb4 _2lx21sbv _4cvr1h6o _1bsb1osq _bozgv77o"
|
|
@@ -24,6 +24,7 @@ export const FlyoutHeader = props => {
|
|
|
24
24
|
title,
|
|
25
25
|
closeButtonLabel
|
|
26
26
|
} = props;
|
|
27
|
+
const id = useTitleId();
|
|
27
28
|
const setIsOpen = useContext(SetIsOpenContext);
|
|
28
29
|
const onClose = useContext(OnCloseContext);
|
|
29
30
|
const handleClose = useCallback(() => {
|
|
@@ -41,6 +42,7 @@ export const FlyoutHeader = props => {
|
|
|
41
42
|
testId: testId && `${testId}--close-button`
|
|
42
43
|
}), /*#__PURE__*/React.createElement(Heading, {
|
|
43
44
|
size: "xsmall",
|
|
44
|
-
as: "span"
|
|
45
|
+
as: "span",
|
|
46
|
+
id: id
|
|
45
47
|
}, title)), children);
|
|
46
48
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* flyout-menu-item-content.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./flyout-menu-item-content.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import React, { forwardRef, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { PopupContent } from '@atlaskit/popup/experimental';
|
|
8
|
-
import { OnCloseProvider, SetIsOpenContext } from './flyout-menu-item-context';
|
|
8
|
+
import { OnCloseProvider, SetIsOpenContext, TitleIdContextProvider } from './flyout-menu-item-context';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* The vertical offset in px to ensure the flyout container does not exceed the bounds of
|
|
@@ -42,6 +42,7 @@ export const FlyoutMenuItemContent = /*#__PURE__*/forwardRef(({
|
|
|
42
42
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
43
43
|
setIsOpen(false);
|
|
44
44
|
}, [setIsOpen, onClose]);
|
|
45
|
+
const titleId = useId();
|
|
45
46
|
return /*#__PURE__*/React.createElement(PopupContent, {
|
|
46
47
|
appearance: "UNSAFE_modal-below-sm",
|
|
47
48
|
onClose: handleClose,
|
|
@@ -54,7 +55,9 @@ export const FlyoutMenuItemContent = /*#__PURE__*/forwardRef(({
|
|
|
54
55
|
shouldFitViewport: true,
|
|
55
56
|
testId: containerTestId,
|
|
56
57
|
xcss: flyoutMenuItemContentStyles.root,
|
|
57
|
-
autoFocus: autoFocus
|
|
58
|
+
autoFocus: autoFocus,
|
|
59
|
+
role: fg("platform_dst_nav4_flyout_menu_slots_close_button") ? "dialog" : undefined,
|
|
60
|
+
titleId: fg("platform_dst_nav4_flyout_menu_slots_close_button") ? titleId : undefined
|
|
58
61
|
/**
|
|
59
62
|
* Disabling GPU acceleration removes the use of `transform` by popper.js for this popup.
|
|
60
63
|
*
|
|
@@ -75,11 +78,13 @@ export const FlyoutMenuItemContent = /*#__PURE__*/forwardRef(({
|
|
|
75
78
|
}) => /*#__PURE__*/React.createElement(UpdatePopperOnContentResize, {
|
|
76
79
|
ref: forwardedRef,
|
|
77
80
|
update: update
|
|
78
|
-
}, fg("platform_dst_nav4_flyout_menu_slots_close_button") ? /*#__PURE__*/React.createElement(
|
|
81
|
+
}, fg("platform_dst_nav4_flyout_menu_slots_close_button") ? /*#__PURE__*/React.createElement(TitleIdContextProvider, {
|
|
82
|
+
value: titleId
|
|
83
|
+
}, /*#__PURE__*/React.createElement(OnCloseProvider, {
|
|
79
84
|
value: () => onClose
|
|
80
85
|
}, /*#__PURE__*/React.createElement("div", {
|
|
81
86
|
className: ax([flyoutMenuItemContentContainerStyles.container])
|
|
82
|
-
}, children)) : children));
|
|
87
|
+
}, children))) : children));
|
|
83
88
|
});
|
|
84
89
|
function createResizeObserver(update) {
|
|
85
90
|
return new ResizeObserver(update);
|
|
@@ -29,4 +29,21 @@ export const OnCloseContext = /*#__PURE__*/createContext(null);
|
|
|
29
29
|
*
|
|
30
30
|
* A context provider for supplying the onClose function to the FlyoutHeader.
|
|
31
31
|
*/
|
|
32
|
-
export const OnCloseProvider = OnCloseContext.Provider;
|
|
32
|
+
export const OnCloseProvider = OnCloseContext.Provider;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* __Title id context__
|
|
36
|
+
*
|
|
37
|
+
* A context for storing the title id of the FlyoutMenuItem that is displayed in
|
|
38
|
+
* FlyoutHeader, and used as the aria-labelledby on the FlyoutMenuItemContent
|
|
39
|
+
* container.
|
|
40
|
+
*/
|
|
41
|
+
export const TitleIdContext = /*#__PURE__*/createContext(undefined);
|
|
42
|
+
export const useTitleId = () => useContext(TitleIdContext);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* __Title id provider__
|
|
46
|
+
*
|
|
47
|
+
* A context provider for supplying the title id to the FlyoutHeader.
|
|
48
|
+
*/
|
|
49
|
+
export const TitleIdContextProvider = TitleIdContext.Provider;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef, useEffect } from 'react';
|
|
2
2
|
import useControlled from '@atlaskit/ds-lib/use-controlled';
|
|
3
3
|
import usePreviousValue from '@atlaskit/ds-lib/use-previous-value';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { Popup } from '@atlaskit/popup/experimental';
|
|
5
6
|
import { MenuListItem } from '../menu-list-item';
|
|
6
7
|
import { IsOpenContext, SetIsOpenContext } from './flyout-menu-item-context';
|
|
@@ -54,6 +55,7 @@ export const FlyoutMenuItem = /*#__PURE__*/forwardRef(({
|
|
|
54
55
|
ref: forwardedRef
|
|
55
56
|
}, /*#__PURE__*/React.createElement(Popup, {
|
|
56
57
|
id: id,
|
|
57
|
-
isOpen: isOpen
|
|
58
|
+
isOpen: isOpen,
|
|
59
|
+
role: fg('platform_dst_nav4_flyout_menu_slots_close_button') ? 'dialog' : undefined
|
|
58
60
|
}, children))));
|
|
59
61
|
});
|
|
@@ -5,7 +5,7 @@ import React, { useCallback, useContext } from 'react';
|
|
|
5
5
|
import Heading from '@atlaskit/heading';
|
|
6
6
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
7
7
|
import { CloseButton } from './close-button';
|
|
8
|
-
import { OnCloseContext, SetIsOpenContext } from './flyout-menu-item-context';
|
|
8
|
+
import { OnCloseContext, SetIsOpenContext, useTitleId } from './flyout-menu-item-context';
|
|
9
9
|
var headerStyles = {
|
|
10
10
|
root: "_zulp12x7 _bozg1b66 _85i512x7 _1e0c1txw _2lx21bp4",
|
|
11
11
|
flex: "_zulppxbi _1bah1yb4 _2lx21sbv _4cvr1h6o _1bsb1osq _bozgv77o"
|
|
@@ -22,6 +22,7 @@ export var FlyoutHeader = function FlyoutHeader(props) {
|
|
|
22
22
|
testId = props.testId,
|
|
23
23
|
title = props.title,
|
|
24
24
|
closeButtonLabel = props.closeButtonLabel;
|
|
25
|
+
var id = useTitleId();
|
|
25
26
|
var setIsOpen = useContext(SetIsOpenContext);
|
|
26
27
|
var onClose = useContext(OnCloseContext);
|
|
27
28
|
var handleClose = useCallback(function () {
|
|
@@ -39,6 +40,7 @@ export var FlyoutHeader = function FlyoutHeader(props) {
|
|
|
39
40
|
testId: testId && "".concat(testId, "--close-button")
|
|
40
41
|
}), /*#__PURE__*/React.createElement(Heading, {
|
|
41
42
|
size: "xsmall",
|
|
42
|
-
as: "span"
|
|
43
|
+
as: "span",
|
|
44
|
+
id: id
|
|
43
45
|
}, title)), children);
|
|
44
46
|
};
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import "./flyout-menu-item-content.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import React, { forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import React, { forwardRef, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
6
6
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
8
|
import { PopupContent } from '@atlaskit/popup/experimental';
|
|
9
|
-
import { OnCloseProvider, SetIsOpenContext } from './flyout-menu-item-context';
|
|
9
|
+
import { OnCloseProvider, SetIsOpenContext, TitleIdContextProvider } from './flyout-menu-item-context';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* The vertical offset in px to ensure the flyout container does not exceed the bounds of
|
|
@@ -42,6 +42,7 @@ export var FlyoutMenuItemContent = /*#__PURE__*/forwardRef(function (_ref, forwa
|
|
|
42
42
|
onClose === null || onClose === void 0 || onClose();
|
|
43
43
|
setIsOpen(false);
|
|
44
44
|
}, [setIsOpen, onClose]);
|
|
45
|
+
var titleId = useId();
|
|
45
46
|
return /*#__PURE__*/React.createElement(PopupContent, {
|
|
46
47
|
appearance: "UNSAFE_modal-below-sm",
|
|
47
48
|
onClose: handleClose,
|
|
@@ -54,7 +55,9 @@ export var FlyoutMenuItemContent = /*#__PURE__*/forwardRef(function (_ref, forwa
|
|
|
54
55
|
shouldFitViewport: true,
|
|
55
56
|
testId: containerTestId,
|
|
56
57
|
xcss: flyoutMenuItemContentStyles.root,
|
|
57
|
-
autoFocus: autoFocus
|
|
58
|
+
autoFocus: autoFocus,
|
|
59
|
+
role: fg("platform_dst_nav4_flyout_menu_slots_close_button") ? "dialog" : undefined,
|
|
60
|
+
titleId: fg("platform_dst_nav4_flyout_menu_slots_close_button") ? titleId : undefined
|
|
58
61
|
/**
|
|
59
62
|
* Disabling GPU acceleration removes the use of `transform` by popper.js for this popup.
|
|
60
63
|
*
|
|
@@ -75,13 +78,15 @@ export var FlyoutMenuItemContent = /*#__PURE__*/forwardRef(function (_ref, forwa
|
|
|
75
78
|
return /*#__PURE__*/React.createElement(UpdatePopperOnContentResize, {
|
|
76
79
|
ref: forwardedRef,
|
|
77
80
|
update: update
|
|
78
|
-
}, fg("platform_dst_nav4_flyout_menu_slots_close_button") ? /*#__PURE__*/React.createElement(
|
|
81
|
+
}, fg("platform_dst_nav4_flyout_menu_slots_close_button") ? /*#__PURE__*/React.createElement(TitleIdContextProvider, {
|
|
82
|
+
value: titleId
|
|
83
|
+
}, /*#__PURE__*/React.createElement(OnCloseProvider, {
|
|
79
84
|
value: function value() {
|
|
80
85
|
return onClose;
|
|
81
86
|
}
|
|
82
87
|
}, /*#__PURE__*/React.createElement("div", {
|
|
83
88
|
className: ax([flyoutMenuItemContentContainerStyles.container])
|
|
84
|
-
}, children)) : children);
|
|
89
|
+
}, children))) : children);
|
|
85
90
|
});
|
|
86
91
|
});
|
|
87
92
|
function createResizeObserver(update) {
|
|
@@ -33,4 +33,23 @@ export var OnCloseContext = /*#__PURE__*/createContext(null);
|
|
|
33
33
|
*
|
|
34
34
|
* A context provider for supplying the onClose function to the FlyoutHeader.
|
|
35
35
|
*/
|
|
36
|
-
export var OnCloseProvider = OnCloseContext.Provider;
|
|
36
|
+
export var OnCloseProvider = OnCloseContext.Provider;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* __Title id context__
|
|
40
|
+
*
|
|
41
|
+
* A context for storing the title id of the FlyoutMenuItem that is displayed in
|
|
42
|
+
* FlyoutHeader, and used as the aria-labelledby on the FlyoutMenuItemContent
|
|
43
|
+
* container.
|
|
44
|
+
*/
|
|
45
|
+
export var TitleIdContext = /*#__PURE__*/createContext(undefined);
|
|
46
|
+
export var useTitleId = function useTitleId() {
|
|
47
|
+
return useContext(TitleIdContext);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* __Title id provider__
|
|
52
|
+
*
|
|
53
|
+
* A context provider for supplying the title id to the FlyoutHeader.
|
|
54
|
+
*/
|
|
55
|
+
export var TitleIdContextProvider = TitleIdContext.Provider;
|
|
@@ -2,6 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import React, { forwardRef, useEffect } from 'react';
|
|
3
3
|
import useControlled from '@atlaskit/ds-lib/use-controlled';
|
|
4
4
|
import usePreviousValue from '@atlaskit/ds-lib/use-previous-value';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { Popup } from '@atlaskit/popup/experimental';
|
|
6
7
|
import { MenuListItem } from '../menu-list-item';
|
|
7
8
|
import { IsOpenContext, SetIsOpenContext } from './flyout-menu-item-context';
|
|
@@ -60,6 +61,7 @@ export var FlyoutMenuItem = /*#__PURE__*/forwardRef(function (_ref, forwardedRef
|
|
|
60
61
|
ref: forwardedRef
|
|
61
62
|
}, /*#__PURE__*/React.createElement(Popup, {
|
|
62
63
|
id: id,
|
|
63
|
-
isOpen: isOpen
|
|
64
|
+
isOpen: isOpen,
|
|
65
|
+
role: fg('platform_dst_nav4_flyout_menu_slots_close_button') ? 'dialog' : undefined
|
|
64
66
|
}, children))));
|
|
65
67
|
});
|
|
@@ -24,3 +24,18 @@ export declare const OnCloseContext: import("react").Context<(() => void) | null
|
|
|
24
24
|
* A context provider for supplying the onClose function to the FlyoutHeader.
|
|
25
25
|
*/
|
|
26
26
|
export declare const OnCloseProvider: import("react").Provider<(() => void) | null | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* __Title id context__
|
|
29
|
+
*
|
|
30
|
+
* A context for storing the title id of the FlyoutMenuItem that is displayed in
|
|
31
|
+
* FlyoutHeader, and used as the aria-labelledby on the FlyoutMenuItemContent
|
|
32
|
+
* container.
|
|
33
|
+
*/
|
|
34
|
+
export declare const TitleIdContext: import("react").Context<string | undefined>;
|
|
35
|
+
export declare const useTitleId: () => string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* __Title id provider__
|
|
38
|
+
*
|
|
39
|
+
* A context provider for supplying the title id to the FlyoutHeader.
|
|
40
|
+
*/
|
|
41
|
+
export declare const TitleIdContextProvider: import("react").Provider<string | undefined>;
|
|
@@ -24,3 +24,18 @@ export declare const OnCloseContext: import("react").Context<(() => void) | null
|
|
|
24
24
|
* A context provider for supplying the onClose function to the FlyoutHeader.
|
|
25
25
|
*/
|
|
26
26
|
export declare const OnCloseProvider: import("react").Provider<(() => void) | null | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* __Title id context__
|
|
29
|
+
*
|
|
30
|
+
* A context for storing the title id of the FlyoutMenuItem that is displayed in
|
|
31
|
+
* FlyoutHeader, and used as the aria-labelledby on the FlyoutMenuItemContent
|
|
32
|
+
* container.
|
|
33
|
+
*/
|
|
34
|
+
export declare const TitleIdContext: import("react").Context<string | undefined>;
|
|
35
|
+
export declare const useTitleId: () => string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* __Title id provider__
|
|
38
|
+
*
|
|
39
|
+
* A context provider for supplying the title id to the FlyoutHeader.
|
|
40
|
+
*/
|
|
41
|
+
export declare const TitleIdContextProvider: import("react").Provider<string | undefined>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/navigation-system",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.17.0",
|
|
4
4
|
"description": "The latest navigation system for Atlassian apps.",
|
|
5
5
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
6
6
|
"author": "Atlassian Pty Ltd",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@atlaskit/layering": "^3.5.0",
|
|
77
77
|
"@atlaskit/logo": "^19.9.0",
|
|
78
78
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
79
|
-
"@atlaskit/popup": "^4.
|
|
79
|
+
"@atlaskit/popup": "^4.11.0",
|
|
80
80
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
81
81
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
82
82
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
@@ -102,9 +102,9 @@
|
|
|
102
102
|
"@atlaskit/badge": "^18.3.0",
|
|
103
103
|
"@atlaskit/banner": "^14.0.0",
|
|
104
104
|
"@atlaskit/breadcrumbs": "^15.3.0",
|
|
105
|
-
"@atlaskit/dropdown-menu": "^16.
|
|
105
|
+
"@atlaskit/dropdown-menu": "^16.4.0",
|
|
106
106
|
"@atlaskit/form": "^15.2.0",
|
|
107
|
-
"@atlaskit/link": "^3.
|
|
107
|
+
"@atlaskit/link": "^3.3.0",
|
|
108
108
|
"@atlaskit/lozenge": "^13.3.0",
|
|
109
109
|
"@atlaskit/menu": "^8.4.0",
|
|
110
110
|
"@atlaskit/modal-dialog": "^14.9.0",
|