@atlaskit/navigation-system 5.14.0 → 5.16.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 +37 -0
- package/dist/cjs/ui/menu-item/flyout-menu-item/close-button.js +1 -1
- package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-body.compiled.css +5 -1
- package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-body.js +1 -1
- package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-footer.compiled.css +4 -0
- package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-footer.js +6 -1
- package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-header.compiled.css +2 -1
- package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-header.js +2 -2
- package/dist/cjs/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +1 -1
- package/dist/cjs/ui/page-layout/banner.compiled.css +1 -0
- package/dist/cjs/ui/page-layout/banner.js +6 -2
- package/dist/cjs/ui/page-layout/constants.js +16 -2
- package/dist/cjs/ui/page-layout/panel-splitter/provider.js +5 -3
- package/dist/cjs/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +59 -0
- package/dist/cjs/ui/page-layout/root.compiled.css +1 -0
- package/dist/cjs/ui/page-layout/root.js +7 -2
- package/dist/cjs/ui/page-layout/side-nav/side-nav-content.compiled.css +2 -1
- package/dist/cjs/ui/page-layout/side-nav/side-nav-content.js +8 -2
- package/dist/cjs/ui/page-layout/side-nav/side-nav-header.js +17 -0
- package/dist/cjs/ui/page-layout/side-nav/side-nav.compiled.css +3 -0
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +28 -17
- package/dist/cjs/ui/page-layout/top-nav/top-nav-end.js +3 -2
- package/dist/cjs/ui/page-layout/top-nav/top-nav-middle.js +2 -1
- package/dist/cjs/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -1
- package/dist/cjs/ui/page-layout/top-nav/top-nav-start.js +30 -3
- package/dist/cjs/ui/page-layout/top-nav/top-nav.compiled.css +11 -0
- package/dist/cjs/ui/page-layout/top-nav/top-nav.js +44 -5
- package/dist/es2019/ui/menu-item/flyout-menu-item/close-button.js +1 -1
- package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-body.compiled.css +5 -1
- package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-body.js +1 -1
- package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-footer.compiled.css +4 -0
- package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-footer.js +6 -1
- package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-header.compiled.css +2 -1
- package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-header.js +2 -2
- package/dist/es2019/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +1 -1
- package/dist/es2019/ui/page-layout/banner.compiled.css +1 -0
- package/dist/es2019/ui/page-layout/banner.js +6 -2
- package/dist/es2019/ui/page-layout/constants.js +15 -1
- package/dist/es2019/ui/page-layout/panel-splitter/provider.js +5 -3
- package/dist/es2019/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +57 -2
- package/dist/es2019/ui/page-layout/root.compiled.css +1 -0
- package/dist/es2019/ui/page-layout/root.js +7 -2
- package/dist/es2019/ui/page-layout/side-nav/side-nav-content.compiled.css +2 -1
- package/dist/es2019/ui/page-layout/side-nav/side-nav-content.js +9 -2
- package/dist/es2019/ui/page-layout/side-nav/side-nav-header.js +17 -0
- package/dist/es2019/ui/page-layout/side-nav/side-nav.compiled.css +3 -0
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +19 -8
- package/dist/es2019/ui/page-layout/top-nav/top-nav-end.js +3 -2
- package/dist/es2019/ui/page-layout/top-nav/top-nav-middle.js +2 -1
- package/dist/es2019/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -1
- package/dist/es2019/ui/page-layout/top-nav/top-nav-start.js +30 -3
- package/dist/es2019/ui/page-layout/top-nav/top-nav.compiled.css +11 -0
- package/dist/es2019/ui/page-layout/top-nav/top-nav.js +42 -7
- package/dist/esm/ui/menu-item/flyout-menu-item/close-button.js +1 -1
- package/dist/esm/ui/menu-item/flyout-menu-item/flyout-body.compiled.css +5 -1
- package/dist/esm/ui/menu-item/flyout-menu-item/flyout-body.js +1 -1
- package/dist/esm/ui/menu-item/flyout-menu-item/flyout-footer.compiled.css +4 -0
- package/dist/esm/ui/menu-item/flyout-menu-item/flyout-footer.js +6 -1
- package/dist/esm/ui/menu-item/flyout-menu-item/flyout-header.compiled.css +2 -1
- package/dist/esm/ui/menu-item/flyout-menu-item/flyout-header.js +2 -2
- package/dist/esm/ui/menu-item/flyout-menu-item/flyout-menu-item-context.js +1 -1
- package/dist/esm/ui/page-layout/banner.compiled.css +1 -0
- package/dist/esm/ui/page-layout/banner.js +6 -2
- package/dist/esm/ui/page-layout/constants.js +15 -1
- package/dist/esm/ui/page-layout/panel-splitter/provider.js +5 -3
- package/dist/esm/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +61 -2
- package/dist/esm/ui/page-layout/root.compiled.css +1 -0
- package/dist/esm/ui/page-layout/root.js +7 -2
- package/dist/esm/ui/page-layout/side-nav/side-nav-content.compiled.css +2 -1
- package/dist/esm/ui/page-layout/side-nav/side-nav-content.js +8 -2
- package/dist/esm/ui/page-layout/side-nav/side-nav-header.js +17 -0
- package/dist/esm/ui/page-layout/side-nav/side-nav.compiled.css +3 -0
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +19 -8
- package/dist/esm/ui/page-layout/top-nav/top-nav-end.js +3 -2
- package/dist/esm/ui/page-layout/top-nav/top-nav-middle.js +2 -1
- package/dist/esm/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -1
- package/dist/esm/ui/page-layout/top-nav/top-nav-start.js +30 -3
- package/dist/esm/ui/page-layout/top-nav/top-nav.compiled.css +11 -0
- package/dist/esm/ui/page-layout/top-nav/top-nav.js +46 -7
- package/dist/types/ui/menu-item/flyout-menu-item/flyout-menu-item-context.d.ts +1 -1
- package/dist/types/ui/page-layout/constants.d.ts +10 -0
- package/dist/types/ui/page-layout/panel-splitter/context.d.ts +7 -2
- package/dist/types/ui/page-layout/panel-splitter/provider.d.ts +20 -2
- package/dist/types/ui/page-layout/side-nav/side-nav.d.ts +6 -0
- package/dist/types-ts4.5/ui/menu-item/flyout-menu-item/flyout-menu-item-context.d.ts +1 -1
- package/dist/types-ts4.5/ui/page-layout/constants.d.ts +10 -0
- package/dist/types-ts4.5/ui/page-layout/panel-splitter/context.d.ts +7 -2
- package/dist/types-ts4.5/ui/page-layout/panel-splitter/provider.d.ts +20 -2
- package/dist/types-ts4.5/ui/page-layout/side-nav/side-nav.d.ts +6 -0
- package/package.json +8 -5
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/* side-nav.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import "./side-nav.compiled.css";
|
|
4
|
-
import * as React from 'react';
|
|
5
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
-
import { useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import React, { useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7
6
|
import { bind } from 'bind-event-listener';
|
|
8
7
|
import { flushSync } from 'react-dom';
|
|
9
8
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -16,7 +15,7 @@ import { media } from '@atlaskit/primitives/responsive';
|
|
|
16
15
|
import { useSkipLinkInternal } from '../../../context/skip-links/skip-links-context';
|
|
17
16
|
import { TopNavStartElement } from '../../../context/top-nav-start/top-nav-start-context';
|
|
18
17
|
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
19
|
-
import { bannerMountedVar, contentHeightWhenFixed, contentInsetBlockStart, localSlotLayers, sideNavLiveWidthVar, sideNavPanelSplitterId, sideNavVar, topNavMountedVar, UNSAFE_sideNavLayoutVar } from '../constants';
|
|
18
|
+
import { bannerMountedVar, contentHeightWhenFixed, contentInsetBlockStart, localSlotLayers, openLayerObserverSideNavNamespace, sideNavLiveWidthVar, sideNavPanelSplitterId, sideNavVar, topNavMountedVar, UNSAFE_sideNavLayoutVar } from '../constants';
|
|
20
19
|
import { DangerouslyHoistSlotSizes } from '../hoist-slot-sizes-context';
|
|
21
20
|
import { DangerouslyHoistCssVarToDocumentRoot } from '../hoist-utils';
|
|
22
21
|
import { useLayoutId } from '../id-utils';
|
|
@@ -49,7 +48,9 @@ function getResizeBounds() {
|
|
|
49
48
|
* Avoiding nesting the `@supports` at-rule inside of `@media` means Compiled can remove duplicate styles from the generated CSS.
|
|
50
49
|
*/
|
|
51
50
|
const isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
52
|
-
const
|
|
51
|
+
const panelSplitterPortalTargetStyles = {
|
|
52
|
+
root: "_kqswstnw _rjxpidpf _u7coidpf _4t3i1osq _165t56xv"
|
|
53
|
+
};
|
|
53
54
|
const styles = {
|
|
54
55
|
root: "_nd5l1b6c _191wglyw _t51zglyw _bfhk1bhr _16qs130s _vchhusvi _4t3ieqxy _152timx3 _kqsw1if8 _1bsb1ego _1pbycs5v _14b5hc79 _qilnk0mc _p5clia51 _4ap3vuon _scbpglyw",
|
|
55
56
|
flyoutOpen: "_qiln1gzg _p5clglyw _4ap31bhr _scbp130s _139f8iot _1tpvfnf5 _sylc1a5r _oyeijq3t",
|
|
@@ -166,6 +167,7 @@ function SideNavInternal({
|
|
|
166
167
|
const clampedWidth = `clamp(${widthResizeBounds.min}, ${width}px, ${widthResizeBounds.max})`;
|
|
167
168
|
const dangerouslyHoistSlotSizes = useContext(DangerouslyHoistSlotSizes);
|
|
168
169
|
const navRef = useRef(null);
|
|
170
|
+
const panelSplitterPortalTargetRef = useRef(null);
|
|
169
171
|
/**
|
|
170
172
|
* Used to share the side nav element with the `Panel`,
|
|
171
173
|
* which observes the side nav to determine its maximum width.
|
|
@@ -758,7 +760,7 @@ function SideNavInternal({
|
|
|
758
760
|
},
|
|
759
761
|
ref: mergedRef,
|
|
760
762
|
"data-testid": testId,
|
|
761
|
-
className: ax([styles.root, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop, isFhsEnabled && styles.animationRTLSupport, shouldShowSidebarToggleAnimation && styles.animationBaseStyles, isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.expandAnimationMobile, !isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.collapseAnimationMobile, isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.expandAnimationDesktop, !isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.collapseAnimationDesktop, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFhsEnabled && styles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFhsEnabled && styles.flyoutAnimateClosed, ((sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' || (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close') && !isFirefox && isFhsEnabled && styles.flyoutBaseStylesFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFirefox && isFhsEnabled && styles.flyoutOpenFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar, isFlyoutClosed && isFhsEnabled && styles.fullHeightSidebar])
|
|
763
|
+
className: ax([styles.root, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop, isFhsEnabled && styles.animationRTLSupport, shouldShowSidebarToggleAnimation && styles.animationBaseStyles, isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.expandAnimationMobile, !isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.collapseAnimationMobile, isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.expandAnimationDesktop, !isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.collapseAnimationDesktop, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFhsEnabled && styles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFhsEnabled && styles.flyoutAnimateClosed, ((sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' || (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close') && !isFirefox && isFhsEnabled && styles.flyoutBaseStylesFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFirefox && isFhsEnabled && styles.flyoutOpenFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar, isFlyoutClosed && isFhsEnabled && !fg('platform-dst-side-nav-layering-fixes') && styles.fullHeightSidebar])
|
|
762
764
|
}), /*#__PURE__*/React.createElement(DangerouslyHoistCssVarToDocumentRoot, {
|
|
763
765
|
variableName: sideNavLiveWidthVar,
|
|
764
766
|
value: "0px",
|
|
@@ -777,15 +779,24 @@ function SideNavInternal({
|
|
|
777
779
|
, /*#__PURE__*/React.createElement(PanelSplitterProvider, {
|
|
778
780
|
panelId: sideNavPanelSplitterId,
|
|
779
781
|
panelRef: navRef,
|
|
782
|
+
portalRef: isFhsEnabled && fg('platform-dst-side-nav-layering-fixes') ? panelSplitterPortalTargetRef : undefined,
|
|
780
783
|
panelWidth: width,
|
|
781
784
|
onCompleteResize: setWidth,
|
|
782
785
|
getResizeBounds: getResizeBounds,
|
|
783
|
-
resizingCssVar: panelSplitterResizingVar
|
|
784
|
-
|
|
786
|
+
resizingCssVar: panelSplitterResizingVar
|
|
787
|
+
// Not resizable when in peek (flyout) mode.
|
|
788
|
+
,
|
|
789
|
+
isEnabled: fg('platform-dst-side-nav-layering-fixes') ? !isFlyoutVisible :
|
|
790
|
+
// Old behaviour has a bug: the panel splitter would only be visible on sm screens (between 48rem and 64rem)
|
|
791
|
+
// if the side nav was expanded on desktop.
|
|
792
|
+
isExpandedOnDesktop && !isFlyoutVisible,
|
|
785
793
|
shortcut: isShortcutEnabled ? sideNavToggleTooltipKeyboardShortcut : undefined
|
|
786
794
|
}, /*#__PURE__*/React.createElement("div", {
|
|
787
795
|
className: ax([styles.flexContainer])
|
|
788
|
-
}, children)))
|
|
796
|
+
}, children)), isFhsEnabled && fg('platform-dst-side-nav-layering-fixes') && /*#__PURE__*/React.createElement("div", {
|
|
797
|
+
ref: panelSplitterPortalTargetRef,
|
|
798
|
+
className: ax([panelSplitterPortalTargetStyles.root])
|
|
799
|
+
}));
|
|
789
800
|
}
|
|
790
801
|
|
|
791
802
|
/**
|
|
@@ -16,7 +16,8 @@ import { IconButton } from '../../top-nav-items/themed/migration';
|
|
|
16
16
|
const containerStyles = {
|
|
17
17
|
root: "_yyhy11wp _1e0c1txw _1bahh9n0 _1ul9zwfg _1d2y1ris _glte1ris _15ri1mjv _1gs5usvi _ndwch9n0",
|
|
18
18
|
jiraProductLogoUpdate: "_15rip2n4",
|
|
19
|
-
fullHeightSidebar: "_lcxv1wug
|
|
19
|
+
fullHeightSidebar: "_y4tiutpp _lcxv1wug",
|
|
20
|
+
fullHeightSidebarWithLayeringFixes: "_y4tiutpp"
|
|
20
21
|
};
|
|
21
22
|
const listStyles = {
|
|
22
23
|
root: "_zulp1b66 _4cvr1h6o _1e0c1txw",
|
|
@@ -56,7 +57,7 @@ export function TopNavEnd({
|
|
|
56
57
|
}, [query]);
|
|
57
58
|
return /*#__PURE__*/React.createElement("nav", {
|
|
58
59
|
"aria-label": label,
|
|
59
|
-
className: ax([containerStyles.root, isFhsEnabled && containerStyles.fullHeightSidebar, fg('team25-eu-jira-logo-updates-csm-jsm') && containerStyles.jiraProductLogoUpdate])
|
|
60
|
+
className: ax([containerStyles.root, isFhsEnabled && !fg('platform-dst-side-nav-layering-fixes') && containerStyles.fullHeightSidebar, isFhsEnabled && fg('platform-dst-side-nav-layering-fixes') && containerStyles.fullHeightSidebarWithLayeringFixes, fg('team25-eu-jira-logo-updates-csm-jsm') && containerStyles.jiraProductLogoUpdate])
|
|
60
61
|
}, isMobile ? /*#__PURE__*/React.createElement(Popup, {
|
|
61
62
|
isOpen: isOpen,
|
|
62
63
|
onClose: () => setIsOpen(false),
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import "./top-nav-middle.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
6
7
|
const styles = {
|
|
7
8
|
root: "_zulpu2gc _yyhycs5v _1bsb1osq _4cvr1h6o _1e0c1txw _1bahh9n0 _181n11p5 _1j8b15b0 _lagd1bp4 _1t4c1ris _12e8h9n0",
|
|
@@ -21,6 +22,6 @@ export function TopNavMiddle({
|
|
|
21
22
|
}) {
|
|
22
23
|
const isFhsEnabled = useIsFhsEnabled();
|
|
23
24
|
return /*#__PURE__*/React.createElement("div", {
|
|
24
|
-
className: ax([styles.root, isFhsEnabled && styles.fullHeightSidebar])
|
|
25
|
+
className: ax([styles.root, isFhsEnabled && !fg('platform-dst-side-nav-layering-fixes') && styles.fullHeightSidebar])
|
|
25
26
|
}, children);
|
|
26
27
|
}
|
|
@@ -13,4 +13,5 @@
|
|
|
13
13
|
._vchhusvi{box-sizing:border-box}
|
|
14
14
|
[dir=rtl] ._65m41mrw{--animation-direction:-1}
|
|
15
15
|
@media (prefers-reduced-motion:no-preference){._10t81e03{transition-property:transform}._10t81rjc{transition-property:transform,opacity}._1xq51ytf{transition-timing-function:ease-in-out}._1xq55ucs{transition-timing-function:ease}._mjvc1efy{transform:translateX(calc(100%*var(--animation-direction)))}._bgpzidpf{opacity:0}._mjvc1p9u{transform:translateX(calc(-100%*var(--animation-direction)))}._mjvco0k7{transform:translateX(calc((-2rem + var(--ds-space-050, 4px)*-1)*var(--animation-direction)))}._mjvcyrjp{transform:translateX(calc((2rem + var(--ds-space-050, 4px))*var(--animation-direction)))}._mjvcz12g{transform:translateX(0)}._xrrpfnf5{transition-duration:.2s}._bgpzkb7n{opacity:1}}
|
|
16
|
-
@media (min-width:64rem){._15rin7od{min-width:unset}._glte1osq{width:100%}._15rip2n4{min-width:330px}._glte1ris{width:max-content}._15ri1mjv{min-width:300px}._1gs5usvi{box-sizing:border-box}._glte93mn{width:var(--n_sNvlw,100%)}._exxmpxbi{padding-inline-end:var(--ds-space-200,1pc)}}
|
|
16
|
+
@media (min-width:64rem){._13wnh2mm{position:relative}._1l3vb3bt:after{content:""}._juxdstnw:after{position:absolute}._1vinidpf:after{inset-block-start:0}._1719idpf:after{inset-block-end:0}._e6znidpf:after{inset-inline-end:0}._1kyhe4h9:after{border-inline-end-width:var(--ds-border-width,1px)}._4cwynqa1:after{border-inline-end-style:solid}._435s1l7x:after{border-inline-end-color:var(--ds-border,#0b120e24)}._m7c3idpf:after{opacity:0}._15rin7od{min-width:unset}._glte1osq{width:100%}._15rip2n4{min-width:330px}@supports (scroll-timeline-axis:block){html:not(:has([data-private-side-nav-header])) ._1kilgc9s{animation-timeline:--sNcst}html:not(:has([data-private-side-nav-header])) ._1m3lsjnm{animation-name:k1rswljm}html:not(:has([data-private-side-nav-header])) ._12g81hrf{animation-fill-mode:both}}._4ap3vuon{background-color:var(--ds-surface,#fff)}._m7c3kb7n:after{opacity:1}._glte1ris{width:max-content}._15ri1mjv{min-width:300px}._1gs5usvi{box-sizing:border-box}._glte93mn{width:var(--n_sNvlw,100%)}._exxmpxbi{padding-inline-end:var(--ds-space-200,1pc)}@supports (scroll-timeline-axis:block){@keyframes k1rswljm{0%{box-shadow:inset 0 -1px 0 0 transparent}0.1%{box-shadow:inset 0 -1px 0 0 var(--ds-border,#0b120e24)}to{box-shadow:inset 0 -1px 0 0 var(--ds-border,#0b120e24)}}}}
|
|
17
|
+
@media (prefers-reduced-motion:no-preference) and (min-width:64rem){._n8qabrmi:after{transition-property:opacity}._wc72fnf5:after{transition-duration:.2s}._j3mr1v42:after{transition-timing-function:ease-in}}
|
|
@@ -7,6 +7,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
7
7
|
import { UNSAFE_useMediaQuery } from '@atlaskit/primitives/compiled';
|
|
8
8
|
import { TopNavStartAttachRef } from '../../../context/top-nav-start/top-nav-start-context';
|
|
9
9
|
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
10
|
+
import { sideNavContentScrollTimelineVar } from '../constants';
|
|
10
11
|
import { useSideNavVisibility } from '../side-nav/use-side-nav-visibility';
|
|
11
12
|
import { SideNavVisibilityState } from '../side-nav/visibility-context';
|
|
12
13
|
|
|
@@ -35,6 +36,12 @@ const innerStyles = {
|
|
|
35
36
|
fullHeightSidebarExpanded: "_15rin7od _glte1osq"
|
|
36
37
|
};
|
|
37
38
|
|
|
39
|
+
/**
|
|
40
|
+
* The scroll indicator is usually applied in SideNavContent, but if there is no SideNavHeader it is
|
|
41
|
+
* applied in TopNavStart instead for layering reasons. See the comment in SideNavHeader for more details.
|
|
42
|
+
*/
|
|
43
|
+
const scrolledShadow = null;
|
|
44
|
+
|
|
38
45
|
/**
|
|
39
46
|
* Styles for the outer element, that does not have re-enabled pointer events and spans the entire
|
|
40
47
|
* width of the TopNavStart area.
|
|
@@ -43,7 +50,10 @@ const innerStyles = {
|
|
|
43
50
|
*/
|
|
44
51
|
const wrapperStyles = {
|
|
45
52
|
root: "_vchhusvi _bozgutpp _4t3i1osq",
|
|
46
|
-
fullHeightSidebarExpanded: "_glte93mn _exxmpxbi"
|
|
53
|
+
fullHeightSidebarExpanded: "_glte93mn _exxmpxbi",
|
|
54
|
+
fullHeightSidebarWithLayeringFixes: "_13wnh2mm _1l3vb3bt _juxdstnw _1vinidpf _1719idpf _e6znidpf _1kyhe4h9 _4cwynqa1 _435s1l7x _m7c3idpf",
|
|
55
|
+
fullHeightSidebarExpandedWithLayeringFixes: "_4ap3vuon _1kilgc9s _1m3lsjnm _12g81hrf _m7c3kb7n",
|
|
56
|
+
fullHeightSidebarBorderTransition: "_n8qabrmi _wc72fnf5 _j3mr1v42"
|
|
47
57
|
};
|
|
48
58
|
|
|
49
59
|
/**
|
|
@@ -114,12 +124,29 @@ const TopNavStartInnerFHS = /*#__PURE__*/forwardRef(function TopNavStartInnerFHS
|
|
|
114
124
|
} = useSideNavVisibility({
|
|
115
125
|
defaultCollapsed: true
|
|
116
126
|
});
|
|
127
|
+
const sideNavState = useContext(SideNavVisibilityState);
|
|
128
|
+
const isFirstRenderRef = useRef(true);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
if (!fg('platform-dst-side-nav-layering-fixes')) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Ignore renders until the side nav state is initialized
|
|
135
|
+
// So that apps using the legacy API for setting side nav default state do not see
|
|
136
|
+
// animations when they shouldn't
|
|
137
|
+
if (sideNavState === null) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (isFirstRenderRef.current) {
|
|
141
|
+
isFirstRenderRef.current = false;
|
|
142
|
+
}
|
|
143
|
+
}, [sideNavState]);
|
|
117
144
|
return /*#__PURE__*/React.createElement("div", {
|
|
118
|
-
className: ax([wrapperStyles.root, isExpandedOnDesktop && wrapperStyles.fullHeightSidebarExpanded])
|
|
145
|
+
className: ax([wrapperStyles.root, isExpandedOnDesktop && wrapperStyles.fullHeightSidebarExpanded, fg('platform-dst-side-nav-layering-fixes') && wrapperStyles.fullHeightSidebarWithLayeringFixes, !isFirstRenderRef.current && isExpandedOnDesktop && fg('platform-dst-side-nav-layering-fixes') && wrapperStyles.fullHeightSidebarBorderTransition, isExpandedOnDesktop && fg('platform-dst-side-nav-layering-fixes') && wrapperStyles.fullHeightSidebarExpandedWithLayeringFixes])
|
|
119
146
|
}, /*#__PURE__*/React.createElement("div", {
|
|
120
147
|
ref: ref,
|
|
121
148
|
"data-testid": testId,
|
|
122
|
-
className: ax([innerStyles.root, innerStyles.fullHeightSidebar, fg('team25-eu-jira-logo-updates-csm-jsm') && innerStyles.jiraProductLogoUpdate, isExpandedOnDesktop && innerStyles.fullHeightSidebarExpanded])
|
|
149
|
+
className: ax([innerStyles.root, !fg('platform-dst-side-nav-layering-fixes') && innerStyles.fullHeightSidebar, fg('team25-eu-jira-logo-updates-csm-jsm') && innerStyles.jiraProductLogoUpdate, isExpandedOnDesktop && innerStyles.fullHeightSidebarExpanded])
|
|
123
150
|
}, children));
|
|
124
151
|
});
|
|
125
152
|
|
|
@@ -5,17 +5,28 @@
|
|
|
5
5
|
._18zrze3t{padding-inline:var(--ds-space-0,0)}
|
|
6
6
|
._179rglyw{border-block-end:none}
|
|
7
7
|
._179ria51{border-block-end:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._152t1nws{inset-block-start:var(--n_bnrM,0)}
|
|
8
|
+
._18postnw:after{position:absolute}
|
|
9
|
+
._1beue4h9:after{border-block-end-width:var(--ds-border-width,1px)}
|
|
8
10
|
._1bsb1osq{width:100%}
|
|
11
|
+
._1cte1l7x:after{border-block-end-color:var(--ds-border,#0b120e24)}
|
|
12
|
+
._1czdidpf:after{inset-inline-end:0}
|
|
9
13
|
._1e0c11p5{display:grid}
|
|
14
|
+
._1gufidpf:after{inset-block-end:0}
|
|
15
|
+
._1pby11wp{z-index:3}
|
|
16
|
+
._1pbycs5v{z-index:2}
|
|
10
17
|
._1pbyegat{z-index:4}
|
|
11
18
|
._4cvr1h6o{align-items:center}
|
|
12
19
|
._4t3i1dgc{height:var(--n_tNvM)}
|
|
13
20
|
._4t3i1osq{height:100%}
|
|
21
|
+
._aetrb3bt:after{content:""}
|
|
14
22
|
._bfhkglyw{background-color:none}
|
|
15
23
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
16
24
|
._d6vu1bgi >span[data-ep-placeholder-id=top_navigation_skeleton]{display:contents}
|
|
25
|
+
._g0nf3tht:after{inset-inline-start:var(--n_sNvlw,0)}
|
|
17
26
|
._kqsw1if8{position:sticky}
|
|
27
|
+
._lcxv1wug{pointer-events:auto}
|
|
18
28
|
._lcxvglyw{pointer-events:none}
|
|
29
|
+
._uaeunqa1:after{border-block-end-style:solid}
|
|
19
30
|
._vchhusvi{box-sizing:border-box}
|
|
20
31
|
._yv0e1mfv{grid-template-columns:auto 1fr auto}
|
|
21
32
|
@media (min-width:48rem){._1j8b18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import "./top-nav.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { useContext, useMemo } from 'react';
|
|
5
|
+
import { useContext, useLayoutEffect, useMemo, useState } from 'react';
|
|
6
|
+
import { OpenLayerObserverNamespaceProvider, useOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
8
|
import { useSkipLink } from '../../../context/skip-links/skip-links-context';
|
|
7
9
|
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
8
10
|
import { HasCustomThemeContext } from '../../top-nav-items/themed/has-custom-theme-context';
|
|
9
11
|
import { useCustomTheme } from '../../top-nav-items/themed/use-custom-theme';
|
|
10
|
-
import { bannerMountedVar, localSlotLayers, topNavMountedVar, UNSAFE_topNavVar } from '../constants';
|
|
12
|
+
import { bannerMountedVar, localSlotLayers, openLayerObserverTopNavNamespace, sideNavLiveWidthVar, topNavMountedVar, UNSAFE_topNavVar } from '../constants';
|
|
11
13
|
import { DangerouslyHoistSlotSizes } from '../hoist-slot-sizes-context';
|
|
12
14
|
import { DangerouslyHoistCssVarToDocumentRoot, HoistCssVarToLocalGrid } from '../hoist-utils';
|
|
13
15
|
import { useLayoutId } from '../id-utils';
|
|
@@ -23,7 +25,9 @@ import { useSideNavVisibility } from '../side-nav/use-side-nav-visibility';
|
|
|
23
25
|
const styles = {
|
|
24
26
|
root: "_nd5l8cbt _zulpu2gc _18zrutpp _179ria51 _1e0c11p5 _yv0e1mfv _4cvr1h6o _bfhkvuon _vchhusvi _4t3i1dgc _152t1nws _kqsw1if8 _1pbyegat _d6vu1bgi _1j8b18ax",
|
|
25
27
|
fullHeightSidebar: "_18zrze3t _179rglyw _bfhkglyw _lcxvglyw _pdlmutpp",
|
|
26
|
-
fullHeightSidebarExpanded: "_1rqt16a9 _jh1g18ax"
|
|
28
|
+
fullHeightSidebarExpanded: "_1rqt16a9 _jh1g18ax",
|
|
29
|
+
fullHeightSidebarWithLayeringFixes: "_1pbycs5v _lcxv1wug _bfhkvuon _aetrb3bt _18postnw _1gufidpf _1czdidpf _g0nf3tht _1beue4h9 _uaeunqa1 _1cte1l7x",
|
|
30
|
+
fullHeightSidebarWithLayeringFixesAndOpenLayer: "_1pby11wp"
|
|
27
31
|
};
|
|
28
32
|
|
|
29
33
|
/**
|
|
@@ -57,6 +61,8 @@ export function TopNav({
|
|
|
57
61
|
const customTheme = useCustomTheme(UNSAFE_theme);
|
|
58
62
|
|
|
59
63
|
/**
|
|
64
|
+
* Note: this is no longer the case when fg('platform-dst-side-nav-layering-fixes') is enabled.
|
|
65
|
+
*
|
|
60
66
|
* With the full height sidebar we have a foreground and background element,
|
|
61
67
|
* so we need to apply the custom theme styles to the correct element.
|
|
62
68
|
*
|
|
@@ -87,9 +93,34 @@ export function TopNav({
|
|
|
87
93
|
const {
|
|
88
94
|
isExpandedOnDesktop
|
|
89
95
|
} = useSideNavVisibility();
|
|
96
|
+
const openLayerObserver = useOpenLayerObserver();
|
|
97
|
+
// Setting the initial state to false, as it is unlikely that the top nav would have an open popup when the app starts.
|
|
98
|
+
const [hasOpenPopup, setHasOpenPopup] = useState(false);
|
|
99
|
+
useLayoutEffect(() => {
|
|
100
|
+
if (!openLayerObserver || !isFhsEnabled || !fg('platform-dst-side-nav-layering-fixes')) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
function checkAndSetState() {
|
|
104
|
+
if (!openLayerObserver) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
setHasOpenPopup(openLayerObserver.getCount({
|
|
108
|
+
namespace: openLayerObserverTopNavNamespace,
|
|
109
|
+
type: 'popup'
|
|
110
|
+
}) > 0);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Initial check
|
|
114
|
+
checkAndSetState();
|
|
115
|
+
|
|
116
|
+
// Check again whenever number of layers in the top nav change
|
|
117
|
+
return openLayerObserver.onChange(checkAndSetState, {
|
|
118
|
+
namespace: openLayerObserverTopNavNamespace
|
|
119
|
+
});
|
|
120
|
+
}, [isFhsEnabled, openLayerObserver]);
|
|
90
121
|
return /*#__PURE__*/React.createElement(HasCustomThemeContext.Provider, {
|
|
91
122
|
value: customTheme.isEnabled
|
|
92
|
-
}, isFhsEnabled && /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
}, isFhsEnabled && !fg('platform-dst-side-nav-layering-fixes') && /*#__PURE__*/React.createElement("div", {
|
|
93
124
|
"data-layout-slot": true,
|
|
94
125
|
"aria-hidden": true
|
|
95
126
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
@@ -99,11 +130,13 @@ export function TopNav({
|
|
|
99
130
|
}), /*#__PURE__*/React.createElement("header", {
|
|
100
131
|
id: id,
|
|
101
132
|
"data-layout-slot": true,
|
|
102
|
-
className: ax([styles.root, isFhsEnabled && styles.fullHeightSidebar, isExpandedOnDesktop && isFhsEnabled && styles.fullHeightSidebarExpanded, xcss]),
|
|
133
|
+
className: ax([styles.root, isFhsEnabled && styles.fullHeightSidebar, isFhsEnabled && fg('platform-dst-side-nav-layering-fixes') && styles.fullHeightSidebarWithLayeringFixes, hasOpenPopup && isFhsEnabled && fg('platform-dst-side-nav-layering-fixes') && styles.fullHeightSidebarWithLayeringFixesAndOpenLayer, isExpandedOnDesktop && isFhsEnabled && styles.fullHeightSidebarExpanded, xcss]),
|
|
103
134
|
"data-testid": testId
|
|
104
135
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
105
136
|
,
|
|
106
|
-
style:
|
|
137
|
+
style:
|
|
138
|
+
// When the layering fixes are enabled, we no longer have separate elements for the foreground and background.
|
|
139
|
+
isFhsEnabled && !fg('platform-dst-side-nav-layering-fixes') ? foregroundStyle : customTheme.isEnabled ? customTheme.style : undefined
|
|
107
140
|
}, /*#__PURE__*/React.createElement(HoistCssVarToLocalGrid, {
|
|
108
141
|
variableName: topNavMountedVar,
|
|
109
142
|
value: height
|
|
@@ -117,5 +150,7 @@ export function TopNav({
|
|
|
117
150
|
value: height
|
|
118
151
|
})
|
|
119
152
|
// ------ END UNSAFE STYLES ------
|
|
120
|
-
,
|
|
153
|
+
, fg('platform-dst-side-nav-layering-fixes') ? /*#__PURE__*/React.createElement(OpenLayerObserverNamespaceProvider, {
|
|
154
|
+
namespace: openLayerObserverTopNavNamespace
|
|
155
|
+
}, children) : children));
|
|
121
156
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
._12l2x0bf{margin-inline-end:var(--ds-space-negative-100,-8px)}
|
|
1
2
|
._18m91wug{overflow-y:auto}
|
|
2
3
|
._1bahv2br{justify-content:start}
|
|
3
4
|
._1e0c1txw{display:flex}
|
|
4
5
|
._2lx21bp4{flex-direction:column}
|
|
5
|
-
._4t3i1osq{height:100%}
|
|
6
|
+
._4t3i1osq{height:100%}
|
|
7
|
+
._ahbqx0bf{margin-inline-start:var(--ds-space-negative-100,-8px)}
|
|
8
|
+
._bozgu2gc{padding-inline-start:var(--ds-space-100,8px)}
|
|
9
|
+
._y4tiu2gc{padding-inline-end:var(--ds-space-100,8px)}
|
|
@@ -3,7 +3,7 @@ import "./flyout-body.compiled.css";
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
5
|
var bodyStyles = {
|
|
6
|
-
root: "_1e0c1txw _2lx21bp4 _18m91wug _4t3i1osq _1bahv2br"
|
|
6
|
+
root: "_1e0c1txw _2lx21bp4 _18m91wug _4t3i1osq _1bahv2br _ahbqx0bf _12l2x0bf _bozgu2gc _y4tiu2gc"
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* __Flyout menu item body__
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* flyout-footer.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
import "./flyout-footer.compiled.css";
|
|
2
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
3
4
|
import React from 'react';
|
|
5
|
+
var footerStyles = {
|
|
6
|
+
root: "_7myae4h9 _1sw7nqa1 _qgnu1l7x _1q51u2gc"
|
|
7
|
+
};
|
|
4
8
|
/**
|
|
5
9
|
* __Flyout menu item footer__
|
|
6
10
|
*
|
|
@@ -12,6 +16,7 @@ export var FlyoutFooter = function FlyoutFooter(props) {
|
|
|
12
16
|
var children = props.children,
|
|
13
17
|
testId = props.testId;
|
|
14
18
|
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
-
"data-testid": testId
|
|
19
|
+
"data-testid": testId,
|
|
20
|
+
className: ax([footerStyles.root])
|
|
16
21
|
}, children);
|
|
17
22
|
};
|
|
@@ -7,4 +7,5 @@
|
|
|
7
7
|
._2lx21sbv{flex-direction:row-reverse}
|
|
8
8
|
._4cvr1h6o{align-items:center}
|
|
9
9
|
._85i512x7{padding-block-end:var(--ds-space-075,6px)}
|
|
10
|
-
.
|
|
10
|
+
._bozg1b66{padding-inline-start:var(--ds-space-050,4px)}
|
|
11
|
+
._bozgv77o{padding-inline-start:var(--ds-space-025,2px)}
|
|
@@ -7,8 +7,8 @@ import { Flex } from '@atlaskit/primitives/compiled';
|
|
|
7
7
|
import { CloseButton } from './close-button';
|
|
8
8
|
import { OnCloseContext, SetIsOpenContext } from './flyout-menu-item-context';
|
|
9
9
|
var headerStyles = {
|
|
10
|
-
root: "_zulp12x7
|
|
11
|
-
flex: "_zulppxbi _1bah1yb4 _2lx21sbv _4cvr1h6o _1bsb1osq"
|
|
10
|
+
root: "_zulp12x7 _bozg1b66 _85i512x7 _1e0c1txw _2lx21bp4",
|
|
11
|
+
flex: "_zulppxbi _1bah1yb4 _2lx21sbv _4cvr1h6o _1bsb1osq _bozgv77o"
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* __FlyoutHeader__
|
|
@@ -31,6 +31,6 @@ export var OnCloseContext = /*#__PURE__*/createContext(null);
|
|
|
31
31
|
/**
|
|
32
32
|
* __On close provider__
|
|
33
33
|
*
|
|
34
|
-
* A context provider for supplying the
|
|
34
|
+
* A context provider for supplying the onClose function to the FlyoutHeader.
|
|
35
35
|
*/
|
|
36
36
|
export var OnCloseProvider = OnCloseContext.Provider;
|
|
@@ -3,13 +3,16 @@ import "./banner.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useContext } from 'react';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { useSkipLinkInternal } from '../../context/skip-links/skip-links-context';
|
|
8
|
+
import { useIsFhsEnabled } from '../fhs-rollout/use-is-fhs-enabled';
|
|
7
9
|
import { bannerMountedVar, localSlotLayers, UNSAFE_bannerVar } from './constants';
|
|
8
10
|
import { DangerouslyHoistSlotSizes } from './hoist-slot-sizes-context';
|
|
9
11
|
import { DangerouslyHoistCssVarToDocumentRoot, HoistCssVarToLocalGrid } from './hoist-utils';
|
|
10
12
|
import { useLayoutId } from './id-utils';
|
|
11
13
|
var styles = {
|
|
12
|
-
root: "_nd5ldkfm _1reo15vq _18m915vq _4t3iutvi _152tidpf _kqsw1if8 _1pbyegat"
|
|
14
|
+
root: "_nd5ldkfm _1reo15vq _18m915vq _4t3iutvi _152tidpf _kqsw1if8 _1pbyegat",
|
|
15
|
+
fullHeightSidebarWithLayeringFixes: "_1pbycs5v"
|
|
13
16
|
};
|
|
14
17
|
|
|
15
18
|
/**
|
|
@@ -30,6 +33,7 @@ export function Banner(_ref) {
|
|
|
30
33
|
var id = useLayoutId({
|
|
31
34
|
providedId: providedId
|
|
32
35
|
});
|
|
36
|
+
var isFhsEnabled = useIsFhsEnabled();
|
|
33
37
|
|
|
34
38
|
/**
|
|
35
39
|
* Don't show the skip link if the slot has 0 height.
|
|
@@ -42,7 +46,7 @@ export function Banner(_ref) {
|
|
|
42
46
|
return /*#__PURE__*/React.createElement("div", {
|
|
43
47
|
id: id,
|
|
44
48
|
"data-layout-slot": true,
|
|
45
|
-
className: ax([styles.root, xcss]),
|
|
49
|
+
className: ax([styles.root, isFhsEnabled && fg('platform-dst-side-nav-layering-fixes') && styles.fullHeightSidebarWithLayeringFixes, xcss]),
|
|
46
50
|
"data-testid": testId
|
|
47
51
|
}, /*#__PURE__*/React.createElement(HoistCssVarToLocalGrid, {
|
|
48
52
|
variableName: bannerMountedVar,
|
|
@@ -50,6 +50,20 @@ export var UNSAFE_MAIN_INLINE_END_FOR_LEGACY_PAGES_ONLY = "calc(var(".concat(UNS
|
|
|
50
50
|
export var localSlotLayers = {
|
|
51
51
|
topBar: 4,
|
|
52
52
|
banner: 4,
|
|
53
|
+
// With the FHS layering refactors, the banner and top nav have a lower z-index to allow layers from the side nav to overlay them.
|
|
54
|
+
// When they all have equal z-index values, the DOM order determines the layering - meaning the side nav will be layered above the rest.
|
|
55
|
+
// But, when the top bar contains an open layer, it needs to be layered above the side nav, so has a higher value.
|
|
56
|
+
topNavFHSWithOpenLayer: 3,
|
|
57
|
+
bannerFHS: 2,
|
|
58
|
+
topNavFHS: 2,
|
|
53
59
|
sideNav: 2,
|
|
54
60
|
panelSmallViewports: 1
|
|
55
|
-
};
|
|
61
|
+
};
|
|
62
|
+
export var openLayerObserverSideNavNamespace = 'side-nav';
|
|
63
|
+
export var openLayerObserverTopNavNamespace = 'top-nav';
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* CSS scroll timeline variable for the side nav content scroll indicator.
|
|
67
|
+
* The scroll timeline is created in SideNavContent, and then used by TopNavStart to apply the scroll indicator line.
|
|
68
|
+
*/
|
|
69
|
+
export var sideNavContentScrollTimelineVar = '--sNcst';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { Fragment, useMemo, useRef } from 'react';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { PanelSplitterContext } from './context';
|
|
3
4
|
/**
|
|
4
5
|
* Provides the context required for the panel splitter to work within a page layout slot.
|
|
@@ -12,6 +13,7 @@ export var PanelSplitterProvider = function PanelSplitterProvider(_ref) {
|
|
|
12
13
|
getResizeBounds = _ref.getResizeBounds,
|
|
13
14
|
resizingCssVar = _ref.resizingCssVar,
|
|
14
15
|
panelRef = _ref.panelRef,
|
|
16
|
+
providedPortalRef = _ref.portalRef,
|
|
15
17
|
_ref$position = _ref.position,
|
|
16
18
|
position = _ref$position === void 0 ? 'end' : _ref$position,
|
|
17
19
|
_ref$isEnabled = _ref.isEnabled,
|
|
@@ -29,13 +31,13 @@ export var PanelSplitterProvider = function PanelSplitterProvider(_ref) {
|
|
|
29
31
|
position: position,
|
|
30
32
|
panelRef: panelRef,
|
|
31
33
|
isEnabled: isEnabled,
|
|
32
|
-
portalRef: portalRef,
|
|
34
|
+
portalRef: typeof providedPortalRef !== 'undefined' && fg('platform-dst-side-nav-layering-fixes') ? providedPortalRef : portalRef,
|
|
33
35
|
shortcut: shortcut
|
|
34
36
|
};
|
|
35
|
-
}, [panelId, panelWidth, onCompleteResize, getResizeBounds, resizingCssVar, position,
|
|
37
|
+
}, [panelId, panelWidth, onCompleteResize, getResizeBounds, resizingCssVar, position, panelRef, isEnabled, providedPortalRef, shortcut]);
|
|
36
38
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(PanelSplitterContext.Provider, {
|
|
37
39
|
value: context
|
|
38
|
-
}, children), /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
}, children), typeof providedPortalRef !== 'undefined' && fg('platform-dst-side-nav-layering-fixes') ? null : /*#__PURE__*/React.createElement("div", {
|
|
39
41
|
ref: portalRef
|
|
40
42
|
}));
|
|
41
43
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
2
3
|
import invariant from 'tiny-invariant';
|
|
3
|
-
import {
|
|
4
|
+
import { useOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
7
|
+
import { openLayerObserverSideNavNamespace, openLayerObserverTopNavNamespace, sideNavPanelSplitterId } from '../constants';
|
|
4
8
|
import { useToggleSideNav } from '../side-nav/use-toggle-side-nav';
|
|
5
9
|
import { OnDoubleClickContext, PanelSplitterContext } from './context';
|
|
6
10
|
import { PanelSplitter } from './panel-splitter';
|
|
@@ -30,6 +34,61 @@ export var SideNavPanelSplitter = function SideNavPanelSplitter(_ref) {
|
|
|
30
34
|
var toggleSideNav = useToggleSideNav({
|
|
31
35
|
trigger: 'double-click'
|
|
32
36
|
});
|
|
37
|
+
var isFhsEnabled = useIsFhsEnabled();
|
|
38
|
+
|
|
39
|
+
// The logic and state for disabling the panel splitter when there are open popups
|
|
40
|
+
// in the side nav or top nav is being placed here, instead of in `SideNav`, to prevent
|
|
41
|
+
// re-rendering the side nav anytime the number of open popups changes.
|
|
42
|
+
var _useState = useState(true),
|
|
43
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
44
|
+
isEnabled = _useState2[0],
|
|
45
|
+
setIsEnabled = _useState2[1];
|
|
46
|
+
var openLayerObserver = useOpenLayerObserver();
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
if (!openLayerObserver || !isFhsEnabled || !fg('platform-dst-side-nav-layering-fixes')) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
function checkAndSetState() {
|
|
52
|
+
if (!openLayerObserver) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// We don't technically need to check the side nav for open layers, as they wouldn't overlay the
|
|
57
|
+
// panel splitter, as it sits within the same stacking context as the side nav. For consistency however,
|
|
58
|
+
// we check it as well.
|
|
59
|
+
var openPopupsInSideNav = openLayerObserver.getCount({
|
|
60
|
+
namespace: openLayerObserverSideNavNamespace,
|
|
61
|
+
type: 'popup'
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// When there is an open layer in the top nav, the top nav is given a higher z-index than the side nav.
|
|
65
|
+
// This means the part of the side nav panel splitter that was sitting above the top nav will no longer
|
|
66
|
+
// be interactive (as it is now behind the top nav). So, we need to disable the entire panel splitter.
|
|
67
|
+
var openPopupsInTopNav = openLayerObserver.getCount({
|
|
68
|
+
namespace: openLayerObserverTopNavNamespace,
|
|
69
|
+
type: 'popup'
|
|
70
|
+
});
|
|
71
|
+
setIsEnabled(openPopupsInSideNav + openPopupsInTopNav === 0);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Initial check, in case the app has loaded with an open popup.
|
|
75
|
+
checkAndSetState();
|
|
76
|
+
|
|
77
|
+
// Creating separate listeners for each namespace, to avoid running them when layers in other parts of the app change.
|
|
78
|
+
var cleanupSideNavListener = openLayerObserver.onChange(checkAndSetState, {
|
|
79
|
+
namespace: openLayerObserverSideNavNamespace
|
|
80
|
+
});
|
|
81
|
+
var cleanupTopNavListener = openLayerObserver.onChange(checkAndSetState, {
|
|
82
|
+
namespace: openLayerObserverTopNavNamespace
|
|
83
|
+
});
|
|
84
|
+
return function cleanup() {
|
|
85
|
+
cleanupSideNavListener();
|
|
86
|
+
cleanupTopNavListener();
|
|
87
|
+
};
|
|
88
|
+
}, [isFhsEnabled, openLayerObserver]);
|
|
89
|
+
if (!isEnabled && isFhsEnabled && fg('platform-dst-side-nav-layering-fixes')) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
33
92
|
return /*#__PURE__*/React.createElement(OnDoubleClickContext.Provider, {
|
|
34
93
|
value: shouldCollapseOnDoubleClick ? toggleSideNav : undefined
|
|
35
94
|
}, /*#__PURE__*/React.createElement(PanelSplitter, {
|
|
@@ -3,8 +3,11 @@ import "./root.compiled.css";
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useEffect, useRef } from 'react';
|
|
5
5
|
import { OpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { SkipLinksProvider } from '../../context/skip-links/skip-links-provider';
|
|
7
8
|
import { TopNavStartProvider } from '../../context/top-nav-start/top-nav-start-context-provider';
|
|
9
|
+
import { useIsFhsEnabled } from '../fhs-rollout/use-is-fhs-enabled';
|
|
10
|
+
import { sideNavContentScrollTimelineVar } from './constants';
|
|
8
11
|
import { DangerouslyHoistSlotSizes } from './hoist-slot-sizes-context';
|
|
9
12
|
import { SideNavElementProvider } from './side-nav/element-context';
|
|
10
13
|
import { IsSideNavShortcutEnabledProvider } from './side-nav/is-side-nav-shortcut-enabled-context';
|
|
@@ -14,7 +17,8 @@ import { SideNavVisibilityProvider } from './side-nav/visibility-provider';
|
|
|
14
17
|
// ID of the root element that the banner and top bar slots hoist their sizes to. Only internally exported.
|
|
15
18
|
export var gridRootId = 'unsafe-design-system-page-layout-root';
|
|
16
19
|
var styles = {
|
|
17
|
-
root: "_1e0c11p5 _1tke1kxc _1lmcq9em _yv0ei47z _2z0516ab _1ciragmp _12fkuz0r _12qzrxre _1rqt70if _xkmgbaui _jbc7rxre _tyve1jg8"
|
|
20
|
+
root: "_1e0c11p5 _1tke1kxc _1lmcq9em _yv0ei47z _2z0516ab _1ciragmp _12fkuz0r _12qzrxre _1rqt70if _xkmgbaui _jbc7rxre _tyve1jg8",
|
|
21
|
+
sideNavScrollTimeline: "_10iwgc9s"
|
|
18
22
|
};
|
|
19
23
|
|
|
20
24
|
/**
|
|
@@ -33,6 +37,7 @@ export function Root(_ref) {
|
|
|
33
37
|
_ref$isSideNavShortcu = _ref.isSideNavShortcutEnabled,
|
|
34
38
|
isSideNavShortcutEnabled = _ref$isSideNavShortcu === void 0 ? false : _ref$isSideNavShortcu;
|
|
35
39
|
var ref = useRef(null);
|
|
40
|
+
var isFhsEnabled = useIsFhsEnabled();
|
|
36
41
|
useEffect(function () {
|
|
37
42
|
if (process.env.NODE_ENV !== 'production') {
|
|
38
43
|
var IGNORED_ELEMENTS = ['SCRIPT', 'STYLE'];
|
|
@@ -57,7 +62,7 @@ export function Root(_ref) {
|
|
|
57
62
|
testId: testId
|
|
58
63
|
}, /*#__PURE__*/React.createElement("div", {
|
|
59
64
|
ref: ref,
|
|
60
|
-
className: ax([styles.root, xcss]),
|
|
65
|
+
className: ax([styles.root, isFhsEnabled && fg('platform-dst-side-nav-layering-fixes') && styles.sideNavScrollTimeline, xcss]),
|
|
61
66
|
id: gridRootId,
|
|
62
67
|
"data-testid": testId
|
|
63
68
|
}, children)))))))));
|
|
@@ -10,4 +10,5 @@
|
|
|
10
10
|
._i0dlf1ug{flex-basis:0%}
|
|
11
11
|
._j7hq4n8p{animation-name:k1gwhnxc}
|
|
12
12
|
._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
|
|
13
|
-
@keyframes k1gwhnxc{0%{box-shadow:none}0.1%{box-shadow:0 -1px var(--ds-border,#0b120e24)}to{box-shadow:0 -1px var(--ds-border,#0b120e24)}}
|
|
13
|
+
@keyframes k1gwhnxc{0%{box-shadow:none}0.1%{box-shadow:0 -1px var(--ds-border,#0b120e24)}to{box-shadow:0 -1px var(--ds-border,#0b120e24)}}
|
|
14
|
+
@media (min-width:64rem){@supports (scroll-timeline-axis:block){._1sfqgc9s{scroll-timeline-name:--sNcst}._1q1x1ule{scroll-timeline-axis:block}html:has([data-private-side-nav-header]) ._8pm2gc9s{animation-timeline:--sNcst}html:has([data-private-side-nav-header]) ._1gd94n8p{animation-name:k1gwhnxc}}@supports (scroll-timeline-axis:block){@keyframes k1gwhnxc{0%{box-shadow:none}0.1%{box-shadow:0 -1px var(--ds-border,#0b120e24)}to{box-shadow:0 -1px var(--ds-border,#0b120e24)}}}}
|