@atlaskit/navigation-system 5.13.1 → 5.14.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 (44) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/entry-points/side-nav-items/flyout-menu-item.js +23 -2
  3. package/dist/cjs/ui/menu-item/flyout-menu-item/close-button.js +33 -0
  4. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-body.compiled.css +5 -0
  5. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-body.js +30 -0
  6. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-footer.js +24 -0
  7. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-header.compiled.css +10 -0
  8. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-header.js +53 -0
  9. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item-content.compiled.css +4 -0
  10. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item-content.js +23 -1
  11. package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +16 -2
  12. package/dist/es2019/entry-points/side-nav-items/flyout-menu-item.js +5 -2
  13. package/dist/es2019/ui/menu-item/flyout-menu-item/close-button.js +25 -0
  14. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-body.compiled.css +5 -0
  15. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-body.js +25 -0
  16. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-footer.js +19 -0
  17. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-header.compiled.css +10 -0
  18. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-header.js +46 -0
  19. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item-content.compiled.css +4 -0
  20. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item-content.js +23 -2
  21. package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +15 -1
  22. package/dist/esm/entry-points/side-nav-items/flyout-menu-item.js +5 -2
  23. package/dist/esm/ui/menu-item/flyout-menu-item/close-button.js +26 -0
  24. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-body.compiled.css +5 -0
  25. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-body.js +23 -0
  26. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-footer.js +17 -0
  27. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-header.compiled.css +10 -0
  28. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-header.js +44 -0
  29. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item-content.compiled.css +4 -0
  30. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item-content.js +25 -2
  31. package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +15 -1
  32. package/dist/types/entry-points/side-nav-items/flyout-menu-item.d.ts +4 -1
  33. package/dist/types/ui/menu-item/flyout-menu-item/close-button.d.ts +34 -0
  34. package/dist/types/ui/menu-item/flyout-menu-item/flyout-body.d.ts +26 -0
  35. package/dist/types/ui/menu-item/flyout-menu-item/flyout-footer.d.ts +25 -0
  36. package/dist/types/ui/menu-item/flyout-menu-item/flyout-header.d.ts +35 -0
  37. package/dist/types/ui/menu-item/flyout-menu-item/flyout-menu-item-context.d.ts +12 -0
  38. package/dist/types-ts4.5/entry-points/side-nav-items/flyout-menu-item.d.ts +4 -1
  39. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/close-button.d.ts +34 -0
  40. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-body.d.ts +26 -0
  41. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-footer.d.ts +25 -0
  42. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-header.d.ts +35 -0
  43. package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-menu-item-context.d.ts +12 -0
  44. package/package.json +9 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlassian/navigation-system
2
2
 
3
+ ## 5.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`a910081d920cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a910081d920cc) -
8
+ Adds a header (with a close button), body, and footer as slot subcomponents of flyout menu item
9
+ content, and adjusts for body scrolling
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 5.13.1
4
16
 
5
17
  ### Patch Changes
@@ -9,6 +9,24 @@ Object.defineProperty(exports, "COLLAPSE_ELEM_BEFORE", {
9
9
  return _menuItemSignals.COLLAPSE_ELEM_BEFORE;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "FlyoutBody", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _flyoutBody.FlyoutBody;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "FlyoutFooter", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _flyoutFooter.FlyoutFooter;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "FlyoutHeader", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _flyoutHeader.FlyoutHeader;
28
+ }
29
+ });
12
30
  Object.defineProperty(exports, "FlyoutMenuItem", {
13
31
  enumerable: true,
14
32
  get: function get() {
@@ -28,6 +46,9 @@ Object.defineProperty(exports, "FlyoutMenuItemTrigger", {
28
46
  }
29
47
  });
30
48
  var _flyoutMenuItem = require("../../ui/menu-item/flyout-menu-item/flyout-menu-item");
49
+ var _flyoutBody = require("../../ui/menu-item/flyout-menu-item/flyout-body");
31
50
  var _flyoutMenuItemContent = require("../../ui/menu-item/flyout-menu-item/flyout-menu-item-content");
32
- var _flyoutMenuItemTrigger = require("../../ui/menu-item/flyout-menu-item/flyout-menu-item-trigger");
33
- var _menuItemSignals = require("../../ui/menu-item/menu-item-signals");
51
+ var _flyoutFooter = require("../../ui/menu-item/flyout-menu-item/flyout-footer");
52
+ var _flyoutHeader = require("../../ui/menu-item/flyout-menu-item/flyout-header");
53
+ var _menuItemSignals = require("../../ui/menu-item/menu-item-signals");
54
+ var _flyoutMenuItemTrigger = require("../../ui/menu-item/flyout-menu-item/flyout-menu-item-trigger");
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.CloseButton = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _new = require("@atlaskit/button/new");
10
+ var _cross = _interopRequireDefault(require("@atlaskit/icon/core/cross"));
11
+ /**
12
+ * __Close button__
13
+ *
14
+ * The close button is to be used for flyout menu item headers to ensure that
15
+ * all users have an accessible and obvious way to close the flyout menu.
16
+ *
17
+ * Ensure that the close button renders first in the DOM to make sure that
18
+ * users will encounter all elements of the flyout menu, including everything
19
+ * within the flyout menu header. This can be done using a `Flex` primitive as
20
+ * the custom header's container with a flex direction of `row-reverse`.
21
+ */
22
+ var CloseButton = exports.CloseButton = function CloseButton(_ref) {
23
+ var label = _ref.label,
24
+ onClick = _ref.onClick,
25
+ testId = _ref.testId;
26
+ return /*#__PURE__*/_react.default.createElement(_new.IconButton, {
27
+ testId: testId,
28
+ appearance: "subtle",
29
+ icon: _cross.default,
30
+ label: label || 'Close Flyout Menu',
31
+ onClick: onClick
32
+ });
33
+ };
@@ -0,0 +1,5 @@
1
+ ._18m91wug{overflow-y:auto}
2
+ ._1bahv2br{justify-content:start}
3
+ ._1e0c1txw{display:flex}
4
+ ._2lx21bp4{flex-direction:column}
5
+ ._4t3i1osq{height:100%}
@@ -0,0 +1,30 @@
1
+ /* flyout-body.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ "use strict";
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.FlyoutBody = void 0;
9
+ require("./flyout-body.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
11
+ var _react = _interopRequireDefault(require("react"));
12
+ var bodyStyles = {
13
+ root: "_1e0c1txw _2lx21bp4 _18m91wug _4t3i1osq _1bahv2br"
14
+ };
15
+ /**
16
+ * __Flyout menu item body__
17
+ *
18
+ * The main section of a flyout menu. This component is used to render the
19
+ * primary contents of the flyout menu. This component should be placed between
20
+ * FlyoutHeader and FlyoutFooter (if present), as is scrollable if the content
21
+ * exceeds the available space.
22
+ */
23
+ var FlyoutBody = exports.FlyoutBody = function FlyoutBody(props) {
24
+ var children = props.children,
25
+ testId = props.testId;
26
+ return /*#__PURE__*/_react.default.createElement("div", {
27
+ "data-testid": testId,
28
+ className: (0, _runtime.ax)([bodyStyles.root])
29
+ }, children);
30
+ };
@@ -0,0 +1,24 @@
1
+ /* flyout-footer.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ "use strict";
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.FlyoutFooter = void 0;
9
+ var _runtime = require("@compiled/react/runtime");
10
+ var _react = _interopRequireDefault(require("react"));
11
+ /**
12
+ * __Flyout menu item footer__
13
+ *
14
+ * The footer section of a flyout menu. This component can display
15
+ * supplementary actions or information at the bottom of the flyout menu. This
16
+ * component should be placed after FlyoutBody within the FlyoutMenuItemContent.
17
+ */
18
+ var FlyoutFooter = exports.FlyoutFooter = function FlyoutFooter(props) {
19
+ var children = props.children,
20
+ testId = props.testId;
21
+ return /*#__PURE__*/_react.default.createElement("div", {
22
+ "data-testid": testId
23
+ }, children);
24
+ };
@@ -0,0 +1,10 @@
1
+
2
+ ._zulp12x7{gap:var(--ds-space-075,6px)}
3
+ ._zulppxbi{gap:var(--ds-space-200,1pc)}._1bah1yb4{justify-content:space-between}
4
+ ._1bsb1osq{width:100%}
5
+ ._1e0c1txw{display:flex}
6
+ ._2lx21bp4{flex-direction:column}
7
+ ._2lx21sbv{flex-direction:row-reverse}
8
+ ._4cvr1h6o{align-items:center}
9
+ ._85i512x7{padding-block-end:var(--ds-space-075,6px)}
10
+ ._bozg12x7{padding-inline-start:var(--ds-space-075,6px)}
@@ -0,0 +1,53 @@
1
+ /* flyout-header.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ "use strict";
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.FlyoutHeader = void 0;
10
+ require("./flyout-header.compiled.css");
11
+ var _runtime = require("@compiled/react/runtime");
12
+ var _react = _interopRequireWildcard(require("react"));
13
+ var _heading = _interopRequireDefault(require("@atlaskit/heading"));
14
+ var _compiled = require("@atlaskit/primitives/compiled");
15
+ var _closeButton = require("./close-button");
16
+ var _flyoutMenuItemContext = require("./flyout-menu-item-context");
17
+ 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); }
18
+ var headerStyles = {
19
+ root: "_zulp12x7 _bozg12x7 _85i512x7 _1e0c1txw _2lx21bp4",
20
+ flex: "_zulppxbi _1bah1yb4 _2lx21sbv _4cvr1h6o _1bsb1osq"
21
+ };
22
+ /**
23
+ * __FlyoutHeader__
24
+ *
25
+ * The header section of a flyout menu. This component displays the title, and
26
+ * close button, as well as any other provided actions relevant to the menu.
27
+ * This component should be placed first within the FlyoutMenuItemContent.
28
+ */
29
+ var FlyoutHeader = exports.FlyoutHeader = function FlyoutHeader(props) {
30
+ var children = props.children,
31
+ testId = props.testId,
32
+ title = props.title,
33
+ closeButtonLabel = props.closeButtonLabel;
34
+ var setIsOpen = (0, _react.useContext)(_flyoutMenuItemContext.SetIsOpenContext);
35
+ var onClose = (0, _react.useContext)(_flyoutMenuItemContext.OnCloseContext);
36
+ var handleClose = (0, _react.useCallback)(function () {
37
+ onClose === null || onClose === void 0 || onClose();
38
+ setIsOpen(false);
39
+ }, [setIsOpen, onClose]);
40
+ return /*#__PURE__*/_react.default.createElement("div", {
41
+ "data-testid": testId,
42
+ className: (0, _runtime.ax)([headerStyles.root])
43
+ }, /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
44
+ xcss: headerStyles.flex
45
+ }, /*#__PURE__*/_react.default.createElement(_closeButton.CloseButton, {
46
+ label: closeButtonLabel,
47
+ onClick: handleClose,
48
+ testId: testId && "".concat(testId, "--close-button")
49
+ }), /*#__PURE__*/_react.default.createElement(_heading.default, {
50
+ size: "xsmall",
51
+ as: "span"
52
+ }, title)), children);
53
+ };
@@ -1,5 +1,9 @@
1
+ ._1e0c1txw{display:flex}
1
2
  ._1q51u2gc{padding-block-start:var(--ds-space-100,8px)}
3
+ ._2lx21bp4{flex-direction:column}
4
+ ._4t3i1osq{height:100%}
2
5
  ._85i5u2gc{padding-block-end:var(--ds-space-100,8px)}
3
6
  ._bozgu2gc{padding-inline-start:var(--ds-space-100,8px)}
7
+ ._c71l2gk1{max-height:calc(100vh - 26px)}
4
8
  ._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
5
9
  @media (min-width:48rem){._14b51kdj{width:25pc}}
@@ -16,9 +16,25 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
16
  var _experimental = require("@atlaskit/popup/experimental");
17
17
  var _flyoutMenuItemContext = require("./flyout-menu-item-context");
18
18
  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); }
19
+ /**
20
+ * The vertical offset in px to ensure the flyout container does not exceed the bounds of
21
+ * the window. This matches the padding of the content container, and it's position within
22
+ * the viewport.
23
+ *
24
+ * - FlyoutMenuItemContent: paddingBlock: token('space.100'); – 8px top, 8px bottom
25
+ * - Position: 5px top, 5px bottom
26
+ *
27
+ * Total vertical padding:
28
+ * (8px [content top] + 8px [content bottom]) +
29
+ * (5px [position top] + 5px [position bottom]) = 26px
30
+ */
31
+ var FLYOUT_MENU_VERTICAL_OFFSET_PX = 26;
19
32
  var flyoutMenuItemContentStyles = {
20
33
  root: "_1q51u2gc _85i5u2gc _bozgu2gc _y4tiu2gc _14b51kdj"
21
34
  };
35
+ var flyoutMenuItemContentContainerStyles = {
36
+ container: "_1e0c1txw _4t3i1osq _c71l2gk1 _2lx21bp4"
37
+ };
22
38
  /**
23
39
  * __FlyoutMenuItemContent__
24
40
  *
@@ -67,7 +83,13 @@ var FlyoutMenuItemContent = exports.FlyoutMenuItemContent = /*#__PURE__*/(0, _re
67
83
  return /*#__PURE__*/_react.default.createElement(UpdatePopperOnContentResize, {
68
84
  ref: forwardedRef,
69
85
  update: update
70
- }, children);
86
+ }, (0, _platformFeatureFlags.fg)("platform_dst_nav4_flyout_menu_slots_close_button") ? /*#__PURE__*/_react.default.createElement(_flyoutMenuItemContext.OnCloseProvider, {
87
+ value: function value() {
88
+ return onClose;
89
+ }
90
+ }, /*#__PURE__*/_react.default.createElement("div", {
91
+ className: (0, _runtime.ax)([flyoutMenuItemContentContainerStyles.container])
92
+ }, children)) : children);
71
93
  });
72
94
  });
73
95
  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.IsOpenContext = void 0;
7
+ exports.useSetFlyoutMenuOpen = exports.useFlyoutMenuOpen = 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
  /**
@@ -25,4 +25,18 @@ var useFlyoutMenuOpen = exports.useFlyoutMenuOpen = function useFlyoutMenuOpen()
25
25
  };
26
26
  var useSetFlyoutMenuOpen = exports.useSetFlyoutMenuOpen = function useSetFlyoutMenuOpen() {
27
27
  return (0, _react.useContext)(SetIsOpenContext);
28
- };
28
+ };
29
+
30
+ /**
31
+ * __On close context__
32
+ *
33
+ * A context for storing the onClose value of the FlyoutMenuItem.
34
+ */
35
+ var OnCloseContext = exports.OnCloseContext = /*#__PURE__*/(0, _react.createContext)(null);
36
+
37
+ /**
38
+ * __On close provider__
39
+ *
40
+ * A context provider for supplying the testId to the FlyoutHeader.
41
+ */
42
+ var OnCloseProvider = exports.OnCloseProvider = OnCloseContext.Provider;
@@ -1,4 +1,7 @@
1
1
  export { FlyoutMenuItem } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item';
2
+ export { FlyoutBody } from '../../ui/menu-item/flyout-menu-item/flyout-body';
2
3
  export { FlyoutMenuItemContent } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-content';
3
- export { FlyoutMenuItemTrigger } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-trigger';
4
- export { COLLAPSE_ELEM_BEFORE } from '../../ui/menu-item/menu-item-signals';
4
+ export { FlyoutFooter } from '../../ui/menu-item/flyout-menu-item/flyout-footer';
5
+ export { FlyoutHeader } from '../../ui/menu-item/flyout-menu-item/flyout-header';
6
+ export { COLLAPSE_ELEM_BEFORE } from '../../ui/menu-item/menu-item-signals';
7
+ export { FlyoutMenuItemTrigger } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-trigger';
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { IconButton } from "@atlaskit/button/new";
3
+ import CrossIcon from "@atlaskit/icon/core/cross";
4
+ /**
5
+ * __Close button__
6
+ *
7
+ * The close button is to be used for flyout menu item headers to ensure that
8
+ * all users have an accessible and obvious way to close the flyout menu.
9
+ *
10
+ * Ensure that the close button renders first in the DOM to make sure that
11
+ * users will encounter all elements of the flyout menu, including everything
12
+ * within the flyout menu header. This can be done using a `Flex` primitive as
13
+ * the custom header's container with a flex direction of `row-reverse`.
14
+ */
15
+ export const CloseButton = ({
16
+ label,
17
+ onClick,
18
+ testId
19
+ }) => /*#__PURE__*/React.createElement(IconButton, {
20
+ testId: testId,
21
+ appearance: "subtle",
22
+ icon: CrossIcon,
23
+ label: label || 'Close Flyout Menu',
24
+ onClick: onClick
25
+ });
@@ -0,0 +1,5 @@
1
+ ._18m91wug{overflow-y:auto}
2
+ ._1bahv2br{justify-content:start}
3
+ ._1e0c1txw{display:flex}
4
+ ._2lx21bp4{flex-direction:column}
5
+ ._4t3i1osq{height:100%}
@@ -0,0 +1,25 @@
1
+ /* flyout-body.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import "./flyout-body.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React from 'react';
5
+ const bodyStyles = {
6
+ root: "_1e0c1txw _2lx21bp4 _18m91wug _4t3i1osq _1bahv2br"
7
+ };
8
+ /**
9
+ * __Flyout menu item body__
10
+ *
11
+ * The main section of a flyout menu. This component is used to render the
12
+ * primary contents of the flyout menu. This component should be placed between
13
+ * FlyoutHeader and FlyoutFooter (if present), as is scrollable if the content
14
+ * exceeds the available space.
15
+ */
16
+ export const FlyoutBody = props => {
17
+ const {
18
+ children,
19
+ testId
20
+ } = props;
21
+ return /*#__PURE__*/React.createElement("div", {
22
+ "data-testid": testId,
23
+ className: ax([bodyStyles.root])
24
+ }, children);
25
+ };
@@ -0,0 +1,19 @@
1
+ /* flyout-footer.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import { ax, ix } from "@compiled/react/runtime";
3
+ import React from 'react';
4
+ /**
5
+ * __Flyout menu item footer__
6
+ *
7
+ * The footer section of a flyout menu. This component can display
8
+ * supplementary actions or information at the bottom of the flyout menu. This
9
+ * component should be placed after FlyoutBody within the FlyoutMenuItemContent.
10
+ */
11
+ export const FlyoutFooter = props => {
12
+ const {
13
+ children,
14
+ testId
15
+ } = props;
16
+ return /*#__PURE__*/React.createElement("div", {
17
+ "data-testid": testId
18
+ }, children);
19
+ };
@@ -0,0 +1,10 @@
1
+
2
+ ._zulp12x7{gap:var(--ds-space-075,6px)}
3
+ ._zulppxbi{gap:var(--ds-space-200,1pc)}._1bah1yb4{justify-content:space-between}
4
+ ._1bsb1osq{width:100%}
5
+ ._1e0c1txw{display:flex}
6
+ ._2lx21bp4{flex-direction:column}
7
+ ._2lx21sbv{flex-direction:row-reverse}
8
+ ._4cvr1h6o{align-items:center}
9
+ ._85i512x7{padding-block-end:var(--ds-space-075,6px)}
10
+ ._bozg12x7{padding-inline-start:var(--ds-space-075,6px)}
@@ -0,0 +1,46 @@
1
+ /* flyout-header.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import "./flyout-header.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React, { useCallback, useContext } from 'react';
5
+ import Heading from '@atlaskit/heading';
6
+ import { Flex } from '@atlaskit/primitives/compiled';
7
+ import { CloseButton } from './close-button';
8
+ import { OnCloseContext, SetIsOpenContext } from './flyout-menu-item-context';
9
+ const headerStyles = {
10
+ root: "_zulp12x7 _bozg12x7 _85i512x7 _1e0c1txw _2lx21bp4",
11
+ flex: "_zulppxbi _1bah1yb4 _2lx21sbv _4cvr1h6o _1bsb1osq"
12
+ };
13
+ /**
14
+ * __FlyoutHeader__
15
+ *
16
+ * The header section of a flyout menu. This component displays the title, and
17
+ * close button, as well as any other provided actions relevant to the menu.
18
+ * This component should be placed first within the FlyoutMenuItemContent.
19
+ */
20
+ export const FlyoutHeader = props => {
21
+ const {
22
+ children,
23
+ testId,
24
+ title,
25
+ closeButtonLabel
26
+ } = props;
27
+ const setIsOpen = useContext(SetIsOpenContext);
28
+ const onClose = useContext(OnCloseContext);
29
+ const handleClose = useCallback(() => {
30
+ onClose === null || onClose === void 0 ? void 0 : onClose();
31
+ setIsOpen(false);
32
+ }, [setIsOpen, onClose]);
33
+ return /*#__PURE__*/React.createElement("div", {
34
+ "data-testid": testId,
35
+ className: ax([headerStyles.root])
36
+ }, /*#__PURE__*/React.createElement(Flex, {
37
+ xcss: headerStyles.flex
38
+ }, /*#__PURE__*/React.createElement(CloseButton, {
39
+ label: closeButtonLabel,
40
+ onClick: handleClose,
41
+ testId: testId && `${testId}--close-button`
42
+ }), /*#__PURE__*/React.createElement(Heading, {
43
+ size: "xsmall",
44
+ as: "span"
45
+ }, title)), children);
46
+ };
@@ -1,5 +1,9 @@
1
+ ._1e0c1txw{display:flex}
1
2
  ._1q51u2gc{padding-block-start:var(--ds-space-100,8px)}
3
+ ._2lx21bp4{flex-direction:column}
4
+ ._4t3i1osq{height:100%}
2
5
  ._85i5u2gc{padding-block-end:var(--ds-space-100,8px)}
3
6
  ._bozgu2gc{padding-inline-start:var(--ds-space-100,8px)}
7
+ ._c71l2gk1{max-height:calc(100vh - 26px)}
4
8
  ._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
5
9
  @media (min-width:48rem){._14b51kdj{width:25pc}}
@@ -5,10 +5,27 @@ import React, { forwardRef, useCallback, useContext, useEffect, useMemo, useRef,
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 { SetIsOpenContext } from './flyout-menu-item-context';
8
+ import { OnCloseProvider, SetIsOpenContext } from './flyout-menu-item-context';
9
+
10
+ /**
11
+ * The vertical offset in px to ensure the flyout container does not exceed the bounds of
12
+ * the window. This matches the padding of the content container, and it's position within
13
+ * the viewport.
14
+ *
15
+ * - FlyoutMenuItemContent: paddingBlock: token('space.100'); – 8px top, 8px bottom
16
+ * - Position: 5px top, 5px bottom
17
+ *
18
+ * Total vertical padding:
19
+ * (8px [content top] + 8px [content bottom]) +
20
+ * (5px [position top] + 5px [position bottom]) = 26px
21
+ */
22
+ const FLYOUT_MENU_VERTICAL_OFFSET_PX = 26;
9
23
  const flyoutMenuItemContentStyles = {
10
24
  root: "_1q51u2gc _85i5u2gc _bozgu2gc _y4tiu2gc _14b51kdj"
11
25
  };
26
+ const flyoutMenuItemContentContainerStyles = {
27
+ container: "_1e0c1txw _4t3i1osq _c71l2gk1 _2lx21bp4"
28
+ };
12
29
  /**
13
30
  * __FlyoutMenuItemContent__
14
31
  *
@@ -58,7 +75,11 @@ export const FlyoutMenuItemContent = /*#__PURE__*/forwardRef(({
58
75
  }) => /*#__PURE__*/React.createElement(UpdatePopperOnContentResize, {
59
76
  ref: forwardedRef,
60
77
  update: update
61
- }, children));
78
+ }, fg("platform_dst_nav4_flyout_menu_slots_close_button") ? /*#__PURE__*/React.createElement(OnCloseProvider, {
79
+ value: () => onClose
80
+ }, /*#__PURE__*/React.createElement("div", {
81
+ className: ax([flyoutMenuItemContentContainerStyles.container])
82
+ }, children)) : children));
62
83
  });
63
84
  function createResizeObserver(update) {
64
85
  return new ResizeObserver(update);
@@ -15,4 +15,18 @@ export const IsOpenContext = /*#__PURE__*/createContext(false);
15
15
  */
16
16
  export const SetIsOpenContext = /*#__PURE__*/createContext(noop);
17
17
  export const useFlyoutMenuOpen = () => useContext(IsOpenContext);
18
- export const useSetFlyoutMenuOpen = () => useContext(SetIsOpenContext);
18
+ export const useSetFlyoutMenuOpen = () => useContext(SetIsOpenContext);
19
+
20
+ /**
21
+ * __On close context__
22
+ *
23
+ * A context for storing the onClose value of the FlyoutMenuItem.
24
+ */
25
+ export const OnCloseContext = /*#__PURE__*/createContext(null);
26
+
27
+ /**
28
+ * __On close provider__
29
+ *
30
+ * A context provider for supplying the testId to the FlyoutHeader.
31
+ */
32
+ export const OnCloseProvider = OnCloseContext.Provider;
@@ -1,4 +1,7 @@
1
1
  export { FlyoutMenuItem } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item';
2
+ export { FlyoutBody } from '../../ui/menu-item/flyout-menu-item/flyout-body';
2
3
  export { FlyoutMenuItemContent } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-content';
3
- export { FlyoutMenuItemTrigger } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-trigger';
4
- export { COLLAPSE_ELEM_BEFORE } from '../../ui/menu-item/menu-item-signals';
4
+ export { FlyoutFooter } from '../../ui/menu-item/flyout-menu-item/flyout-footer';
5
+ export { FlyoutHeader } from '../../ui/menu-item/flyout-menu-item/flyout-header';
6
+ export { COLLAPSE_ELEM_BEFORE } from '../../ui/menu-item/menu-item-signals';
7
+ export { FlyoutMenuItemTrigger } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-trigger';
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { IconButton } from "@atlaskit/button/new";
3
+ import CrossIcon from "@atlaskit/icon/core/cross";
4
+ /**
5
+ * __Close button__
6
+ *
7
+ * The close button is to be used for flyout menu item headers to ensure that
8
+ * all users have an accessible and obvious way to close the flyout menu.
9
+ *
10
+ * Ensure that the close button renders first in the DOM to make sure that
11
+ * users will encounter all elements of the flyout menu, including everything
12
+ * within the flyout menu header. This can be done using a `Flex` primitive as
13
+ * the custom header's container with a flex direction of `row-reverse`.
14
+ */
15
+ export var CloseButton = function CloseButton(_ref) {
16
+ var label = _ref.label,
17
+ onClick = _ref.onClick,
18
+ testId = _ref.testId;
19
+ return /*#__PURE__*/React.createElement(IconButton, {
20
+ testId: testId,
21
+ appearance: "subtle",
22
+ icon: CrossIcon,
23
+ label: label || 'Close Flyout Menu',
24
+ onClick: onClick
25
+ });
26
+ };
@@ -0,0 +1,5 @@
1
+ ._18m91wug{overflow-y:auto}
2
+ ._1bahv2br{justify-content:start}
3
+ ._1e0c1txw{display:flex}
4
+ ._2lx21bp4{flex-direction:column}
5
+ ._4t3i1osq{height:100%}
@@ -0,0 +1,23 @@
1
+ /* flyout-body.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import "./flyout-body.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React from 'react';
5
+ var bodyStyles = {
6
+ root: "_1e0c1txw _2lx21bp4 _18m91wug _4t3i1osq _1bahv2br"
7
+ };
8
+ /**
9
+ * __Flyout menu item body__
10
+ *
11
+ * The main section of a flyout menu. This component is used to render the
12
+ * primary contents of the flyout menu. This component should be placed between
13
+ * FlyoutHeader and FlyoutFooter (if present), as is scrollable if the content
14
+ * exceeds the available space.
15
+ */
16
+ export var FlyoutBody = function FlyoutBody(props) {
17
+ var children = props.children,
18
+ testId = props.testId;
19
+ return /*#__PURE__*/React.createElement("div", {
20
+ "data-testid": testId,
21
+ className: ax([bodyStyles.root])
22
+ }, children);
23
+ };
@@ -0,0 +1,17 @@
1
+ /* flyout-footer.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import { ax, ix } from "@compiled/react/runtime";
3
+ import React from 'react';
4
+ /**
5
+ * __Flyout menu item footer__
6
+ *
7
+ * The footer section of a flyout menu. This component can display
8
+ * supplementary actions or information at the bottom of the flyout menu. This
9
+ * component should be placed after FlyoutBody within the FlyoutMenuItemContent.
10
+ */
11
+ export var FlyoutFooter = function FlyoutFooter(props) {
12
+ var children = props.children,
13
+ testId = props.testId;
14
+ return /*#__PURE__*/React.createElement("div", {
15
+ "data-testid": testId
16
+ }, children);
17
+ };
@@ -0,0 +1,10 @@
1
+
2
+ ._zulp12x7{gap:var(--ds-space-075,6px)}
3
+ ._zulppxbi{gap:var(--ds-space-200,1pc)}._1bah1yb4{justify-content:space-between}
4
+ ._1bsb1osq{width:100%}
5
+ ._1e0c1txw{display:flex}
6
+ ._2lx21bp4{flex-direction:column}
7
+ ._2lx21sbv{flex-direction:row-reverse}
8
+ ._4cvr1h6o{align-items:center}
9
+ ._85i512x7{padding-block-end:var(--ds-space-075,6px)}
10
+ ._bozg12x7{padding-inline-start:var(--ds-space-075,6px)}
@@ -0,0 +1,44 @@
1
+ /* flyout-header.tsx generated by @compiled/babel-plugin v0.38.1 */
2
+ import "./flyout-header.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
4
+ import React, { useCallback, useContext } from 'react';
5
+ import Heading from '@atlaskit/heading';
6
+ import { Flex } from '@atlaskit/primitives/compiled';
7
+ import { CloseButton } from './close-button';
8
+ import { OnCloseContext, SetIsOpenContext } from './flyout-menu-item-context';
9
+ var headerStyles = {
10
+ root: "_zulp12x7 _bozg12x7 _85i512x7 _1e0c1txw _2lx21bp4",
11
+ flex: "_zulppxbi _1bah1yb4 _2lx21sbv _4cvr1h6o _1bsb1osq"
12
+ };
13
+ /**
14
+ * __FlyoutHeader__
15
+ *
16
+ * The header section of a flyout menu. This component displays the title, and
17
+ * close button, as well as any other provided actions relevant to the menu.
18
+ * This component should be placed first within the FlyoutMenuItemContent.
19
+ */
20
+ export var FlyoutHeader = function FlyoutHeader(props) {
21
+ var children = props.children,
22
+ testId = props.testId,
23
+ title = props.title,
24
+ closeButtonLabel = props.closeButtonLabel;
25
+ var setIsOpen = useContext(SetIsOpenContext);
26
+ var onClose = useContext(OnCloseContext);
27
+ var handleClose = useCallback(function () {
28
+ onClose === null || onClose === void 0 || onClose();
29
+ setIsOpen(false);
30
+ }, [setIsOpen, onClose]);
31
+ return /*#__PURE__*/React.createElement("div", {
32
+ "data-testid": testId,
33
+ className: ax([headerStyles.root])
34
+ }, /*#__PURE__*/React.createElement(Flex, {
35
+ xcss: headerStyles.flex
36
+ }, /*#__PURE__*/React.createElement(CloseButton, {
37
+ label: closeButtonLabel,
38
+ onClick: handleClose,
39
+ testId: testId && "".concat(testId, "--close-button")
40
+ }), /*#__PURE__*/React.createElement(Heading, {
41
+ size: "xsmall",
42
+ as: "span"
43
+ }, title)), children);
44
+ };
@@ -1,5 +1,9 @@
1
+ ._1e0c1txw{display:flex}
1
2
  ._1q51u2gc{padding-block-start:var(--ds-space-100,8px)}
3
+ ._2lx21bp4{flex-direction:column}
4
+ ._4t3i1osq{height:100%}
2
5
  ._85i5u2gc{padding-block-end:var(--ds-space-100,8px)}
3
6
  ._bozgu2gc{padding-inline-start:var(--ds-space-100,8px)}
7
+ ._c71l2gk1{max-height:calc(100vh - 26px)}
4
8
  ._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
5
9
  @media (min-width:48rem){._14b51kdj{width:25pc}}
@@ -6,10 +6,27 @@ import React, { forwardRef, useCallback, useContext, useEffect, useMemo, useRef,
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 { SetIsOpenContext } from './flyout-menu-item-context';
9
+ import { OnCloseProvider, SetIsOpenContext } from './flyout-menu-item-context';
10
+
11
+ /**
12
+ * The vertical offset in px to ensure the flyout container does not exceed the bounds of
13
+ * the window. This matches the padding of the content container, and it's position within
14
+ * the viewport.
15
+ *
16
+ * - FlyoutMenuItemContent: paddingBlock: token('space.100'); – 8px top, 8px bottom
17
+ * - Position: 5px top, 5px bottom
18
+ *
19
+ * Total vertical padding:
20
+ * (8px [content top] + 8px [content bottom]) +
21
+ * (5px [position top] + 5px [position bottom]) = 26px
22
+ */
23
+ var FLYOUT_MENU_VERTICAL_OFFSET_PX = 26;
10
24
  var flyoutMenuItemContentStyles = {
11
25
  root: "_1q51u2gc _85i5u2gc _bozgu2gc _y4tiu2gc _14b51kdj"
12
26
  };
27
+ var flyoutMenuItemContentContainerStyles = {
28
+ container: "_1e0c1txw _4t3i1osq _c71l2gk1 _2lx21bp4"
29
+ };
13
30
  /**
14
31
  * __FlyoutMenuItemContent__
15
32
  *
@@ -58,7 +75,13 @@ export var FlyoutMenuItemContent = /*#__PURE__*/forwardRef(function (_ref, forwa
58
75
  return /*#__PURE__*/React.createElement(UpdatePopperOnContentResize, {
59
76
  ref: forwardedRef,
60
77
  update: update
61
- }, children);
78
+ }, fg("platform_dst_nav4_flyout_menu_slots_close_button") ? /*#__PURE__*/React.createElement(OnCloseProvider, {
79
+ value: function value() {
80
+ return onClose;
81
+ }
82
+ }, /*#__PURE__*/React.createElement("div", {
83
+ className: ax([flyoutMenuItemContentContainerStyles.container])
84
+ }, children)) : children);
62
85
  });
63
86
  });
64
87
  function createResizeObserver(update) {
@@ -19,4 +19,18 @@ export var useFlyoutMenuOpen = function useFlyoutMenuOpen() {
19
19
  };
20
20
  export var useSetFlyoutMenuOpen = function useSetFlyoutMenuOpen() {
21
21
  return useContext(SetIsOpenContext);
22
- };
22
+ };
23
+
24
+ /**
25
+ * __On close context__
26
+ *
27
+ * A context for storing the onClose value of the FlyoutMenuItem.
28
+ */
29
+ export var OnCloseContext = /*#__PURE__*/createContext(null);
30
+
31
+ /**
32
+ * __On close provider__
33
+ *
34
+ * A context provider for supplying the testId to the FlyoutHeader.
35
+ */
36
+ export var OnCloseProvider = OnCloseContext.Provider;
@@ -1,4 +1,7 @@
1
1
  export { FlyoutMenuItem, type FlyoutMenuItemProps, } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item';
2
+ export { FlyoutBody, type FlyoutBodyProps, } from '../../ui/menu-item/flyout-menu-item/flyout-body';
2
3
  export { FlyoutMenuItemContent, type FlyoutMenuItemContentProps, } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-content';
3
- export { FlyoutMenuItemTrigger, type FlyoutMenuItemTriggerProps, } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-trigger';
4
+ export { FlyoutFooter, type FlyoutFooterProps, } from '../../ui/menu-item/flyout-menu-item/flyout-footer';
5
+ export { FlyoutHeader, type FlyoutHeaderProps, } from '../../ui/menu-item/flyout-menu-item/flyout-header';
4
6
  export { COLLAPSE_ELEM_BEFORE } from '../../ui/menu-item/menu-item-signals';
7
+ export { FlyoutMenuItemTrigger, type FlyoutMenuItemTriggerProps, } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-trigger';
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ type CloseButtonProps = {
3
+ /**
4
+ * The accessible name to give to the close button.
5
+ *
6
+ * Used as the aria-label for the close button to ensure screen reader
7
+ * accessibility.
8
+ */
9
+ label: string;
10
+ /**
11
+ * The handler called when the close button is clicked. Typically, this
12
+ * should trigger the same close logic as the top-level flyout menu
13
+ * component.
14
+ */
15
+ onClick?: () => void;
16
+ /**
17
+ * A unique string that appears as data attribute data-testid in the
18
+ * rendered code, serving as a hook for automated tests.
19
+ */
20
+ testId?: string;
21
+ };
22
+ /**
23
+ * __Close button__
24
+ *
25
+ * The close button is to be used for flyout menu item headers to ensure that
26
+ * all users have an accessible and obvious way to close the flyout menu.
27
+ *
28
+ * Ensure that the close button renders first in the DOM to make sure that
29
+ * users will encounter all elements of the flyout menu, including everything
30
+ * within the flyout menu header. This can be done using a `Flex` primitive as
31
+ * the custom header's container with a flex direction of `row-reverse`.
32
+ */
33
+ export declare const CloseButton: (props: CloseButtonProps) => React.JSX.Element;
34
+ export {};
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ export interface FlyoutBodyProps {
7
+ /**
8
+ * The content to display within the main body of the flyout menu.
9
+ * Typically includes the primary interactive elements.
10
+ */
11
+ children?: React.ReactNode;
12
+ /**
13
+ * A unique string that appears as data attribute data-testid in the
14
+ * rendered code, serving as a hook for automated tests.
15
+ */
16
+ testId?: string;
17
+ }
18
+ /**
19
+ * __Flyout menu item body__
20
+ *
21
+ * The main section of a flyout menu. This component is used to render the
22
+ * primary contents of the flyout menu. This component should be placed between
23
+ * FlyoutHeader and FlyoutFooter (if present), as is scrollable if the content
24
+ * exceeds the available space.
25
+ */
26
+ export declare const FlyoutBody: (props: FlyoutBodyProps) => JSX.Element;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ export interface FlyoutFooterProps {
7
+ /**
8
+ * The content to display within the flyout footer. Typically used for
9
+ * supplementary actions or information.
10
+ */
11
+ children?: React.ReactNode;
12
+ /**
13
+ * A unique string that appears as data attribute data-testid in the
14
+ * rendered code, serving as a hook for automated tests.
15
+ */
16
+ testId?: string;
17
+ }
18
+ /**
19
+ * __Flyout menu item footer__
20
+ *
21
+ * The footer section of a flyout menu. This component can display
22
+ * supplementary actions or information at the bottom of the flyout menu. This
23
+ * component should be placed after FlyoutBody within the FlyoutMenuItemContent.
24
+ */
25
+ export declare const FlyoutFooter: (props: FlyoutFooterProps) => JSX.Element;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ export interface FlyoutHeaderProps {
7
+ /**
8
+ * The actions to display within the flyout header.
9
+ */
10
+ children?: React.ReactNode;
11
+ /**
12
+ * A unique string that appears as data attribute data-testid in the
13
+ * rendered code, serving as a hook for automated tests.
14
+ */
15
+ testId?: string;
16
+ /**
17
+ * The title of the flyout menu.
18
+ */
19
+ title: string;
20
+ /**
21
+ * The accessible label for the close button in the flyout header.
22
+ *
23
+ * Used as the aria-label for the close button to ensure screen reader
24
+ * accessibility.
25
+ */
26
+ closeButtonLabel: string;
27
+ }
28
+ /**
29
+ * __FlyoutHeader__
30
+ *
31
+ * The header section of a flyout menu. This component displays the title, and
32
+ * close button, as well as any other provided actions relevant to the menu.
33
+ * This component should be placed first within the FlyoutMenuItemContent.
34
+ */
35
+ export declare const FlyoutHeader: (props: FlyoutHeaderProps) => JSX.Element;
@@ -12,3 +12,15 @@ export declare const IsOpenContext: import("react").Context<boolean>;
12
12
  export declare const SetIsOpenContext: import("react").Context<(value: boolean) => void>;
13
13
  export declare const useFlyoutMenuOpen: () => boolean;
14
14
  export declare const useSetFlyoutMenuOpen: () => (value: boolean) => void;
15
+ /**
16
+ * __On close context__
17
+ *
18
+ * A context for storing the onClose value of the FlyoutMenuItem.
19
+ */
20
+ export declare const OnCloseContext: import("react").Context<(() => void) | null | undefined>;
21
+ /**
22
+ * __On close provider__
23
+ *
24
+ * A context provider for supplying the testId to the FlyoutHeader.
25
+ */
26
+ export declare const OnCloseProvider: import("react").Provider<(() => void) | null | undefined>;
@@ -1,4 +1,7 @@
1
1
  export { FlyoutMenuItem, type FlyoutMenuItemProps, } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item';
2
+ export { FlyoutBody, type FlyoutBodyProps, } from '../../ui/menu-item/flyout-menu-item/flyout-body';
2
3
  export { FlyoutMenuItemContent, type FlyoutMenuItemContentProps, } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-content';
3
- export { FlyoutMenuItemTrigger, type FlyoutMenuItemTriggerProps, } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-trigger';
4
+ export { FlyoutFooter, type FlyoutFooterProps, } from '../../ui/menu-item/flyout-menu-item/flyout-footer';
5
+ export { FlyoutHeader, type FlyoutHeaderProps, } from '../../ui/menu-item/flyout-menu-item/flyout-header';
4
6
  export { COLLAPSE_ELEM_BEFORE } from '../../ui/menu-item/menu-item-signals';
7
+ export { FlyoutMenuItemTrigger, type FlyoutMenuItemTriggerProps, } from '../../ui/menu-item/flyout-menu-item/flyout-menu-item-trigger';
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ type CloseButtonProps = {
3
+ /**
4
+ * The accessible name to give to the close button.
5
+ *
6
+ * Used as the aria-label for the close button to ensure screen reader
7
+ * accessibility.
8
+ */
9
+ label: string;
10
+ /**
11
+ * The handler called when the close button is clicked. Typically, this
12
+ * should trigger the same close logic as the top-level flyout menu
13
+ * component.
14
+ */
15
+ onClick?: () => void;
16
+ /**
17
+ * A unique string that appears as data attribute data-testid in the
18
+ * rendered code, serving as a hook for automated tests.
19
+ */
20
+ testId?: string;
21
+ };
22
+ /**
23
+ * __Close button__
24
+ *
25
+ * The close button is to be used for flyout menu item headers to ensure that
26
+ * all users have an accessible and obvious way to close the flyout menu.
27
+ *
28
+ * Ensure that the close button renders first in the DOM to make sure that
29
+ * users will encounter all elements of the flyout menu, including everything
30
+ * within the flyout menu header. This can be done using a `Flex` primitive as
31
+ * the custom header's container with a flex direction of `row-reverse`.
32
+ */
33
+ export declare const CloseButton: (props: CloseButtonProps) => React.JSX.Element;
34
+ export {};
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ export interface FlyoutBodyProps {
7
+ /**
8
+ * The content to display within the main body of the flyout menu.
9
+ * Typically includes the primary interactive elements.
10
+ */
11
+ children?: React.ReactNode;
12
+ /**
13
+ * A unique string that appears as data attribute data-testid in the
14
+ * rendered code, serving as a hook for automated tests.
15
+ */
16
+ testId?: string;
17
+ }
18
+ /**
19
+ * __Flyout menu item body__
20
+ *
21
+ * The main section of a flyout menu. This component is used to render the
22
+ * primary contents of the flyout menu. This component should be placed between
23
+ * FlyoutHeader and FlyoutFooter (if present), as is scrollable if the content
24
+ * exceeds the available space.
25
+ */
26
+ export declare const FlyoutBody: (props: FlyoutBodyProps) => JSX.Element;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ export interface FlyoutFooterProps {
7
+ /**
8
+ * The content to display within the flyout footer. Typically used for
9
+ * supplementary actions or information.
10
+ */
11
+ children?: React.ReactNode;
12
+ /**
13
+ * A unique string that appears as data attribute data-testid in the
14
+ * rendered code, serving as a hook for automated tests.
15
+ */
16
+ testId?: string;
17
+ }
18
+ /**
19
+ * __Flyout menu item footer__
20
+ *
21
+ * The footer section of a flyout menu. This component can display
22
+ * supplementary actions or information at the bottom of the flyout menu. This
23
+ * component should be placed after FlyoutBody within the FlyoutMenuItemContent.
24
+ */
25
+ export declare const FlyoutFooter: (props: FlyoutFooterProps) => JSX.Element;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ export interface FlyoutHeaderProps {
7
+ /**
8
+ * The actions to display within the flyout header.
9
+ */
10
+ children?: React.ReactNode;
11
+ /**
12
+ * A unique string that appears as data attribute data-testid in the
13
+ * rendered code, serving as a hook for automated tests.
14
+ */
15
+ testId?: string;
16
+ /**
17
+ * The title of the flyout menu.
18
+ */
19
+ title: string;
20
+ /**
21
+ * The accessible label for the close button in the flyout header.
22
+ *
23
+ * Used as the aria-label for the close button to ensure screen reader
24
+ * accessibility.
25
+ */
26
+ closeButtonLabel: string;
27
+ }
28
+ /**
29
+ * __FlyoutHeader__
30
+ *
31
+ * The header section of a flyout menu. This component displays the title, and
32
+ * close button, as well as any other provided actions relevant to the menu.
33
+ * This component should be placed first within the FlyoutMenuItemContent.
34
+ */
35
+ export declare const FlyoutHeader: (props: FlyoutHeaderProps) => JSX.Element;
@@ -12,3 +12,15 @@ export declare const IsOpenContext: import("react").Context<boolean>;
12
12
  export declare const SetIsOpenContext: import("react").Context<(value: boolean) => void>;
13
13
  export declare const useFlyoutMenuOpen: () => boolean;
14
14
  export declare const useSetFlyoutMenuOpen: () => (value: boolean) => void;
15
+ /**
16
+ * __On close context__
17
+ *
18
+ * A context for storing the onClose value of the FlyoutMenuItem.
19
+ */
20
+ export declare const OnCloseContext: import("react").Context<(() => void) | null | undefined>;
21
+ /**
22
+ * __On close provider__
23
+ *
24
+ * A context provider for supplying the testId to the FlyoutHeader.
25
+ */
26
+ export declare const OnCloseProvider: import("react").Provider<(() => void) | null | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "5.13.1",
3
+ "version": "5.14.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",
@@ -71,11 +71,12 @@
71
71
  "@atlaskit/button": "^23.9.0",
72
72
  "@atlaskit/css": "^0.19.0",
73
73
  "@atlaskit/ds-lib": "^5.3.0",
74
+ "@atlaskit/heading": "^5.2.0",
74
75
  "@atlaskit/icon": "^29.3.0",
75
76
  "@atlaskit/layering": "^3.4.0",
76
77
  "@atlaskit/logo": "^19.9.0",
77
78
  "@atlaskit/platform-feature-flags": "^1.1.0",
78
- "@atlaskit/popup": "^4.8.0",
79
+ "@atlaskit/popup": "^4.9.0",
79
80
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
80
81
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
81
82
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
@@ -102,10 +103,9 @@
102
103
  "@atlaskit/banner": "^14.0.0",
103
104
  "@atlaskit/breadcrumbs": "^15.3.0",
104
105
  "@atlaskit/dropdown-menu": "^16.3.0",
105
- "@atlaskit/form": "^15.1.0",
106
- "@atlaskit/heading": "^5.2.0",
106
+ "@atlaskit/form": "^15.2.0",
107
107
  "@atlaskit/link": "^3.2.0",
108
- "@atlaskit/lozenge": "^13.2.0",
108
+ "@atlaskit/lozenge": "^13.3.0",
109
109
  "@atlaskit/menu": "^8.4.0",
110
110
  "@atlaskit/modal-dialog": "^14.9.0",
111
111
  "@atlaskit/onboarding": "^14.4.0",
@@ -116,7 +116,7 @@
116
116
  "@atlaskit/skeleton": "^2.1.0",
117
117
  "@atlaskit/textfield": "^8.2.0",
118
118
  "@atlassian/feature-flags-test-utils": "^1.0.0",
119
- "@atlassian/gemini": "^1.25.0",
119
+ "@atlassian/gemini": "^1.26.0",
120
120
  "@atlassian/search-dialog": "^9.10.0",
121
121
  "@atlassian/ssr-tests": "workspace:^",
122
122
  "@atlassian/test-utils": "^1.0.0",
@@ -190,6 +190,9 @@
190
190
  },
191
191
  "platform-dst-shape-theme-default": {
192
192
  "type": "boolean"
193
+ },
194
+ "platform_dst_nav4_flyout_menu_slots_close_button": {
195
+ "type": "boolean"
193
196
  }
194
197
  },
195
198
  "homepage": "https://atlassian.design/components/navigation-system"