@atlaskit/navigation-system 11.2.2 → 11.3.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 +36 -0
- package/dist/cjs/components/skip-links/skip-link.js +2 -2
- package/dist/cjs/components/skip-links/skip-links-container.js +2 -2
- package/dist/cjs/ui/fhs-rollout/is-custom-is-fhs-enabled-context.js +2 -2
- package/dist/cjs/ui/fhs-rollout/is-fhs-enabled-context.js +6 -6
- package/dist/cjs/ui/fhs-rollout/is-fhs-enabled-provider.js +14 -18
- package/dist/cjs/ui/fhs-rollout/use-is-fhs-enabled.js +5 -5
- package/dist/cjs/ui/page-layout/banner.compiled.css +0 -1
- package/dist/cjs/ui/page-layout/banner.js +2 -5
- package/dist/cjs/ui/page-layout/constants.js +1 -13
- package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.compiled.css +0 -1
- package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.js +2 -5
- package/dist/cjs/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +0 -68
- package/dist/cjs/ui/page-layout/ribbon.js +0 -7
- package/dist/cjs/ui/page-layout/side-nav/side-nav-content.js +1 -9
- package/dist/cjs/ui/page-layout/side-nav/side-nav.compiled.css +3 -10
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +21 -54
- package/dist/cjs/ui/page-layout/top-nav/top-nav-end.compiled.css +0 -1
- package/dist/cjs/ui/page-layout/top-nav/top-nav-end.js +4 -7
- package/dist/cjs/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -12
- package/dist/cjs/ui/page-layout/top-nav/top-nav-start.js +9 -250
- package/dist/cjs/ui/page-layout/top-nav/top-nav.compiled.css +1 -15
- package/dist/cjs/ui/page-layout/top-nav/top-nav.js +5 -16
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.compiled.css +0 -2
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.js +13 -16
- package/dist/cjs/ui/top-nav-items/nav-logo/custom-logo.compiled.css +0 -2
- package/dist/cjs/ui/top-nav-items/nav-logo/custom-logo.js +5 -8
- package/dist/cjs/ui/top-nav-items/search.compiled.css +3 -2
- package/dist/cjs/ui/top-nav-items/search.js +9 -11
- package/dist/cjs/ui/top-nav-items/themed/themed-anchor.js +2 -2
- package/dist/cjs/ui/top-nav-items/themed/themed-pressable.js +2 -2
- package/dist/es2019/components/skip-links/skip-link.js +1 -1
- package/dist/es2019/components/skip-links/skip-links-container.js +1 -1
- package/dist/es2019/ui/fhs-rollout/is-custom-is-fhs-enabled-context.js +2 -2
- package/dist/es2019/ui/fhs-rollout/is-fhs-enabled-context.js +6 -4
- package/dist/es2019/ui/fhs-rollout/is-fhs-enabled-provider.js +12 -17
- package/dist/es2019/ui/fhs-rollout/use-is-fhs-enabled.js +5 -8
- package/dist/es2019/ui/page-layout/banner.compiled.css +0 -1
- package/dist/es2019/ui/page-layout/banner.js +2 -5
- package/dist/es2019/ui/page-layout/chat-panel.js +1 -1
- package/dist/es2019/ui/page-layout/constants.js +0 -12
- package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.compiled.css +0 -1
- package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.js +2 -5
- package/dist/es2019/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +2 -61
- package/dist/es2019/ui/page-layout/ribbon.js +0 -7
- package/dist/es2019/ui/page-layout/side-nav/side-nav-content.js +2 -8
- package/dist/es2019/ui/page-layout/side-nav/side-nav.compiled.css +3 -10
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +5 -44
- package/dist/es2019/ui/page-layout/top-nav/top-nav-end.compiled.css +0 -1
- package/dist/es2019/ui/page-layout/top-nav/top-nav-end.js +3 -6
- package/dist/es2019/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -12
- package/dist/es2019/ui/page-layout/top-nav/top-nav-start.js +6 -243
- package/dist/es2019/ui/page-layout/top-nav/top-nav.compiled.css +1 -15
- package/dist/es2019/ui/page-layout/top-nav/top-nav.js +5 -18
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.compiled.css +0 -2
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.js +9 -12
- package/dist/es2019/ui/top-nav-items/nav-logo/custom-logo.compiled.css +0 -2
- package/dist/es2019/ui/top-nav-items/nav-logo/custom-logo.js +4 -7
- package/dist/es2019/ui/top-nav-items/search.compiled.css +3 -2
- package/dist/es2019/ui/top-nav-items/search.js +6 -8
- package/dist/es2019/ui/top-nav-items/themed/themed-anchor.js +1 -1
- package/dist/es2019/ui/top-nav-items/themed/themed-pressable.js +1 -1
- package/dist/esm/components/skip-links/skip-link.js +1 -1
- package/dist/esm/components/skip-links/skip-links-container.js +1 -1
- package/dist/esm/ui/fhs-rollout/is-custom-is-fhs-enabled-context.js +2 -2
- package/dist/esm/ui/fhs-rollout/is-fhs-enabled-context.js +6 -6
- package/dist/esm/ui/fhs-rollout/is-fhs-enabled-provider.js +13 -16
- package/dist/esm/ui/fhs-rollout/use-is-fhs-enabled.js +5 -6
- package/dist/esm/ui/page-layout/banner.compiled.css +0 -1
- package/dist/esm/ui/page-layout/banner.js +2 -5
- package/dist/esm/ui/page-layout/chat-panel.js +1 -1
- package/dist/esm/ui/page-layout/constants.js +0 -12
- package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.compiled.css +0 -1
- package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.js +2 -5
- package/dist/esm/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +2 -71
- package/dist/esm/ui/page-layout/ribbon.js +0 -7
- package/dist/esm/ui/page-layout/side-nav/side-nav-content.js +2 -10
- package/dist/esm/ui/page-layout/side-nav/side-nav.compiled.css +3 -10
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +22 -55
- package/dist/esm/ui/page-layout/top-nav/top-nav-end.compiled.css +0 -1
- package/dist/esm/ui/page-layout/top-nav/top-nav-end.js +3 -6
- package/dist/esm/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -12
- package/dist/esm/ui/page-layout/top-nav/top-nav-start.js +10 -250
- package/dist/esm/ui/page-layout/top-nav/top-nav.compiled.css +1 -15
- package/dist/esm/ui/page-layout/top-nav/top-nav.js +5 -16
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.compiled.css +0 -2
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.js +9 -12
- package/dist/esm/ui/top-nav-items/nav-logo/custom-logo.compiled.css +0 -2
- package/dist/esm/ui/top-nav-items/nav-logo/custom-logo.js +4 -7
- package/dist/esm/ui/top-nav-items/search.compiled.css +3 -2
- package/dist/esm/ui/top-nav-items/search.js +6 -8
- package/dist/esm/ui/top-nav-items/themed/themed-anchor.js +1 -1
- package/dist/esm/ui/top-nav-items/themed/themed-pressable.js +1 -1
- package/dist/types/ui/fhs-rollout/is-custom-is-fhs-enabled-context.d.ts +2 -2
- package/dist/types/ui/fhs-rollout/is-fhs-enabled-context.d.ts +5 -2
- package/dist/types/ui/fhs-rollout/is-fhs-enabled-provider.d.ts +9 -2
- package/dist/types/ui/fhs-rollout/use-is-fhs-enabled.d.ts +4 -1
- package/dist/types/ui/page-layout/constants.d.ts +0 -4
- package/dist/types/ui/page-layout/dangerously-hoist-css-var-to-document-root.d.ts +1 -1
- package/dist/types/ui/page-layout/panel-splitter/get-width-from-drag-location.d.ts +1 -1
- package/dist/types/ui/page-layout/panel-splitter/panel-splitter.d.ts +0 -2
- package/dist/types/ui/page-layout/side-nav/side-nav.d.ts +0 -1
- package/dist/types/ui/top-nav-items/themed/themed-anchor.d.ts +1 -1
- package/dist/types/ui/top-nav-items/themed/themed-button.d.ts +1 -1
- package/dist/types/ui/top-nav-items/themed/themed-icon-button.d.ts +1 -1
- package/dist/types/ui/top-nav-items/themed/themed-link-button.d.ts +1 -1
- package/dist/types/ui/top-nav-items/themed/themed-link-icon-button.d.ts +1 -1
- package/dist/types/ui/top-nav-items/themed/themed-pressable.d.ts +1 -1
- package/package.json +8 -10
|
@@ -10,15 +10,8 @@ import { useLayoutId } from './use-layout-id';
|
|
|
10
10
|
var localSlotLayersStatic = {
|
|
11
11
|
chatPanelOverlay: 5,
|
|
12
12
|
ribbon: 4,
|
|
13
|
-
// The side nav panel splitter is layered above the top nav when FHS is enabled.
|
|
14
|
-
// It has the same z-index value, but is rendered after the top nav in the DOM so is stacked above.
|
|
15
|
-
sideNavPanelSplitterFHS: 4,
|
|
16
13
|
topBar: 4,
|
|
17
14
|
banner: 4,
|
|
18
|
-
// When FHS is enabled, the side nav is layered below the top nav,
|
|
19
|
-
// but above the panel
|
|
20
|
-
bannerFHS: 3,
|
|
21
|
-
topNavFHS: 3,
|
|
22
15
|
sideNav: 2,
|
|
23
16
|
panelSmallViewports: 1
|
|
24
17
|
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/* side-nav-content.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import "./side-nav-content.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { forwardRef
|
|
5
|
-
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
6
|
-
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
7
|
-
|
|
4
|
+
import React, { forwardRef } from 'react';
|
|
8
5
|
/**
|
|
9
6
|
* The main content of the side nav, filling up the middle section. It acts as a scroll container.
|
|
10
7
|
*
|
|
@@ -21,13 +18,8 @@ var styles = {
|
|
|
21
18
|
function _SideNavContent(_ref, forwardedRef) {
|
|
22
19
|
var children = _ref.children,
|
|
23
20
|
testId = _ref.testId;
|
|
24
|
-
var isFhsEnabled = useIsFhsEnabled();
|
|
25
|
-
var internalRef = useRef(null);
|
|
26
|
-
var mergedRef = useMemo(function () {
|
|
27
|
-
return mergeRefs([internalRef, forwardedRef]);
|
|
28
|
-
}, [forwardedRef]);
|
|
29
21
|
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
-
ref:
|
|
22
|
+
ref: forwardedRef,
|
|
31
23
|
"data-testid": testId,
|
|
32
24
|
className: ax([styles.scrollContainer])
|
|
33
25
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
._191wglyw{border-inline-start:none}
|
|
2
2
|
._t51zglyw{border-inline-end:none}._152timx3{inset-block-start:calc(var(--n_bnrM, 0px) + var(--n_tNvM, 0px))}
|
|
3
|
-
._15yekb7n{--animation-direction:1}
|
|
4
3
|
._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
5
4
|
._1bah1yb4{justify-content:space-between}
|
|
6
5
|
._1bsb1ego{width:min(90%,20pc)}
|
|
@@ -9,24 +8,18 @@
|
|
|
9
8
|
._1e0cglyw{display:none}
|
|
10
9
|
._1p2s1vfh{--exit-animation:var(--ds-sidenav-exit-left,200ms cubic-bezier(0,0.4,0,1) SlideOut100PercentLeft)}
|
|
11
10
|
._1pbycs5v{z-index:2}
|
|
12
|
-
._1pbyegat{z-index:4}
|
|
13
11
|
._2lx21bp4{flex-direction:column}
|
|
14
12
|
._4t3i1osq{height:100%}
|
|
15
13
|
._4t3ieqxy{height:calc(100vh - var(--n_bnrM, 0px) - var(--n_tNvM, 0px))}
|
|
16
14
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
17
15
|
._cjprp6j8{--enter-animation:var(--ds-sidenav-enter-left,250ms cubic-bezier(0,0.4,0,1) SlideIn100PercentLeft)}
|
|
18
16
|
._kqsw1if8{position:sticky}
|
|
19
|
-
._kqsw1n9t{position:fixed}
|
|
20
|
-
._t9ectl5p{transform:translateX(calc(var(--n_snvRsz, var(--n_snvW, 0px))))}
|
|
21
|
-
._u7coidpf{inset-block-end:0}
|
|
22
17
|
._vchhusvi{box-sizing:border-box}
|
|
23
18
|
[dir=rtl] ._1jq41dy6{--enter-animation:var(--ds-sidenav-enter-right,250ms cubic-bezier(0,0.4,0,1) SlideIn100PercentRight)}
|
|
24
19
|
[dir=rtl] ._2qe0jwwr{--exit-animation:var(--ds-sidenav-exit-right,200ms cubic-bezier(0,0.4,0,1) SlideOut100PercentRight)}
|
|
25
|
-
|
|
26
|
-
@media (prefers-reduced-motion:no-preference){._10t81t0s{transition-property:display}._1vrh1a5r{transition-behavior:allow-discrete}._xrrpi9qs{transition-duration:var(--ds-duration-medium,.2s)}._10t88iot{transition-property:transform,display}._xrrpfnf5{transition-duration:.2s}._1lh81gzg{grid-area:main}._1xq51mm8{transition-timing-function:cubic-bezier(0,.4,0,1)}._k1affm5y{animation:var(--exit-animation)}@starting-style{._1nu51p9u{transform:translateX(calc(-100%*var(--animation-direction)))}}._1xq51ku9{transition-timing-function:cubic-bezier(.6,0,0,1)}._k1af10ed{animation:var(--enter-animation)}}
|
|
20
|
+
@media (prefers-reduced-motion:no-preference){._10t81t0s{transition-property:display}._1vrh1a5r{transition-behavior:allow-discrete}._xrrpi9qs{transition-duration:var(--ds-duration-medium,.2s)}._1lh81gzg{grid-area:main}._k1affm5y{animation:var(--exit-animation)}._k1af10ed{animation:var(--enter-animation)}}
|
|
27
21
|
@media (min-width:48rem){._14b5hc79{width:var(--n_snvRsz,var(--n_sNvw))}}
|
|
28
|
-
@media (min-width:64rem){.
|
|
29
|
-
@media (prefers-reduced-motion:no-preference) and (min-width:64rem){.
|
|
30
|
-
@media (prefers-reduced-motion:no-preference) and (not (min-width:64rem)){._aadi1p9u{transform:translateX(calc(-100%*var(--animation-direction)))}}
|
|
22
|
+
@media (min-width:64rem){._cpcf1gzg._cpcf1gzg{grid-area:main}._6kttglyw._6kttglyw{border-inline-end:none}._w8v11bhr._w8v11bhr{background-color:var(--ds-surface-overlay,#fff)}._1jug130s._1jug130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}._dm2518uv{display:initial}._dm25glyw{display:none}._qiln1gzg{grid-area:main}._p5clglyw{border-inline-end:none}._4ap31bhr{background-color:var(--ds-surface-overlay,#fff)}._scbp130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}._qilnk0mc{grid-area:side-nav}._p5clia51{border-inline-end:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._4ap3vuon{background-color:var(--ds-surface,#fff)}._scbpglyw{box-shadow:none}}
|
|
23
|
+
@media (prefers-reduced-motion:no-preference) and (min-width:64rem){._1sg81gzg{grid-area:main}._n2infm5y{animation:var(--exit-animation)}._17ly1wzp{transition-property:grid-area,display}._hjoi1wsm{transition-duration:var(--ds-duration-instant,0ms),var(--ds-duration-medium,.2s)}._1wxo1cio{transition-delay:19ms,var(--ds-duration-instant,0ms)}@starting-style{._1xpz1gzg{grid-area:main}}._1sg8k0mc{grid-area:side-nav}._n2in10ed{animation:var(--enter-animation)}._17ly1q8v{transition-property:grid-area}._hjoi147i{transition-duration:var(--ds-duration-instant,0ms)}._1wxo4so3{transition-delay:24ms}}
|
|
31
24
|
@media not (min-width:64rem){._89fi1b6c{grid-area:main/aside/aside/aside}}
|
|
32
25
|
@supports not (-moz-appearance:none){@media (prefers-reduced-motion:no-preference){._139f8iot{transition-property:transform,display}._1tpvfnf5{transition-duration:.2s}._sylc1a5r{transition-behavior:allow-discrete}._1uwsjq3t{transform:translateX(-100%)}}@media (prefers-reduced-motion:no-preference){@starting-style{._oyeijq3t{transform:translateX(-100%)}}._139f8iot{transition-property:transform,display}._1tpvfnf5{transition-duration:.2s}._sylc1a5r{transition-behavior:allow-discrete}}@media (prefers-reduced-motion:no-preference){._4xci10ed{animation:var(--enter-animation)}._1tpv1mzy{transition-duration:var(--ds-duration-long,.25s)}._sylc1a5r{transition-behavior:allow-discrete}}@media (prefers-reduced-motion:no-preference){._4xcifm5y{animation:var(--exit-animation)}._1tpvi9qs{transition-duration:var(--ds-duration-medium,.2s)}._sylc1a5r{transition-behavior:allow-discrete}}}
|
|
@@ -20,8 +20,7 @@ import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/el
|
|
|
20
20
|
|
|
21
21
|
import { useSkipLinkInternal } from '../../../context/skip-links/use-skip-link-internal';
|
|
22
22
|
import { TopNavStartElement } from '../../../context/top-nav-start/top-nav-start-element';
|
|
23
|
-
import {
|
|
24
|
-
import { UNSAFE_sideNavLayoutVar, mainMinimumWidthVar, openLayerObserverSideNavNamespace, openLayerObserverTopNavStartNamespace, sideNavLiveWidthVar, sideNavPanelSplitterId, sideNavVar } from '../constants';
|
|
23
|
+
import { UNSAFE_sideNavLayoutVar, mainMinimumWidthVar, openLayerObserverSideNavNamespace, sideNavLiveWidthVar, sideNavPanelSplitterId, sideNavVar } from '../constants';
|
|
25
24
|
import { DangerouslyHoistCssVarToDocumentRoot } from '../dangerously-hoist-css-var-to-document-root';
|
|
26
25
|
import { DangerouslyHoistSlotSizes } from '../hoist-slot-sizes-context';
|
|
27
26
|
import { convertResizeBoundToPixels } from '../panel-splitter/convert-resize-bound-to-pixels';
|
|
@@ -44,9 +43,6 @@ import { useSideNavVisibility } from './use-side-nav-visibility';
|
|
|
44
43
|
import { useSideNavVisibilityCallbacks } from './use-side-nav-visibility-callbacks';
|
|
45
44
|
import { useToggleSideNav } from './use-toggle-side-nav';
|
|
46
45
|
var panelSplitterResizingVar = '--n_snvRsz';
|
|
47
|
-
// Used to share the side nav width with the panel splitter, which is rendered outside the side nav element
|
|
48
|
-
// but positioned to stay at its right edge.
|
|
49
|
-
var sideNavClampedWidthVar = '--n_snvW';
|
|
50
46
|
var fallbackMinWidth = '240px';
|
|
51
47
|
function getPixelCustomProperty(element, propertyName, fallback) {
|
|
52
48
|
var raw = getComputedStyle(element).getPropertyValue(propertyName).trim();
|
|
@@ -60,28 +56,16 @@ function getPixelCustomProperty(element, propertyName, fallback) {
|
|
|
60
56
|
* Avoiding nesting the `@supports` at-rule inside of `@media` means Compiled can remove duplicate styles from the generated CSS.
|
|
61
57
|
*/
|
|
62
58
|
var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
63
|
-
var panelSplitterPortalTargetStyles = {
|
|
64
|
-
root: "_kqsw1n9t _1pbyegat _u7coidpf _t9ectl5p _4t3ieqxy _165t56xv _p0az1elq"
|
|
65
|
-
};
|
|
66
59
|
var styles = {
|
|
67
60
|
root: "_191wglyw _t51zglyw _bfhk1bhr _16qs130s _vchhusvi _4t3ieqxy _152timx3 _kqsw1if8 _1bsb1ego _1pbycs5v _14b5hc79 _qilnk0mc _p5clia51 _4ap3vuon _scbpglyw _89fi1b6c",
|
|
68
61
|
chatPanelSizing: "_1bsbhc79",
|
|
69
62
|
managedOverlay: "_cpcf1gzg _6kttglyw _w8v11bhr _1jug130s",
|
|
70
63
|
flyoutOpen: "_qiln1gzg _p5clglyw _4ap31bhr _scbp130s _139f8iot _1tpvfnf5 _sylc1a5r _oyeijq3t",
|
|
71
64
|
flyoutAnimateClosed: "_1e0cglyw _qiln1gzg _139f8iot _1tpvfnf5 _sylc1a5r _1uwsjq3t",
|
|
72
|
-
animationRTLSupport: "_15yekb7n _65m41mrw",
|
|
73
|
-
flyoutBaseStylesFullHeightSidebar: "_qiln1gzg _p5clglyw _4ap31bhr _scbp130s _17ly8iot _177m1a5r",
|
|
74
|
-
flyoutOpenFullHeightSidebar: "_hjoifnf5 _vgub1ku9 _s2eg1p9u",
|
|
75
|
-
flyoutAnimateClosedFullHeightSidebar: "_dm25glyw _hjoifnf5 _vgub1mm8 _hh1u1p9u",
|
|
76
65
|
flexContainer: "_4t3i1osq _1e0c1txw _2lx21bp4 _1bah1yb4",
|
|
77
66
|
hiddenMobileAndDesktop: "_1e0cglyw",
|
|
78
67
|
hiddenMobileOnly: "_1e0cglyw _dm2518uv",
|
|
79
|
-
hiddenDesktopOnly: "_dm25glyw"
|
|
80
|
-
animationBaseStyles: "_10t88iot _1vrh1a5r _xrrpfnf5",
|
|
81
|
-
expandAnimationMobile: "_1xq51ku9 _1nu51p9u",
|
|
82
|
-
collapseAnimationMobile: "_1lh81gzg _1xq51mm8 _aadi1p9u",
|
|
83
|
-
expandAnimationDesktop: "_1sg8k0mc _vgub1ku9 _s2eg1p9u",
|
|
84
|
-
collapseAnimationDesktop: "_1sg81gzg _vgub1mm8 _hh1u1p9u"
|
|
68
|
+
hiddenDesktopOnly: "_dm25glyw"
|
|
85
69
|
};
|
|
86
70
|
|
|
87
71
|
/**
|
|
@@ -103,8 +87,6 @@ var motionUpliftStyles = {
|
|
|
103
87
|
collapseAnimationMobile: "_1lh81gzg _k1affm5y",
|
|
104
88
|
flyoutOpen: "_qiln1gzg _p5clglyw _4ap31bhr _scbp130s _4xci10ed _1tpv1mzy _sylc1a5r",
|
|
105
89
|
flyoutAnimateClosed: "_1e0cglyw _qiln1gzg _4xcifm5y _1tpvi9qs _sylc1a5r",
|
|
106
|
-
flyoutOpenFullHeightSidebar: "_n2in10ed _hjoi1mzy",
|
|
107
|
-
flyoutAnimateClosedFullHeightSidebar: "_dm25glyw _n2infm5y _hjoii9qs",
|
|
108
90
|
expandAnimationDesktop: "_1sg8k0mc _n2in10ed _1xpz1gzg _17ly1q8v _hjoi147i _1wxo4so3",
|
|
109
91
|
collapseAnimationDesktop: "_1sg81gzg _n2infm5y _17ly1wzp _hjoi1wsm _1wxo1cio"
|
|
110
92
|
};
|
|
@@ -136,7 +118,6 @@ function SideNavInternal(_ref) {
|
|
|
136
118
|
providedId = _ref.id,
|
|
137
119
|
canToggleWithShortcut = _ref.canToggleWithShortcut;
|
|
138
120
|
var isChatPanelLayoutEnabled = fg('platform-dst-chat-panel-layout');
|
|
139
|
-
var isFhsEnabled = useIsFhsEnabled();
|
|
140
121
|
var id = useLayoutId({
|
|
141
122
|
providedId: providedId
|
|
142
123
|
});
|
|
@@ -277,7 +258,6 @@ function SideNavInternal(_ref) {
|
|
|
277
258
|
var clampedWidth = !isChatPanelLayoutEnabled ? "clamp(240px, ".concat(inlineWidth, "px, 50vw)") : managedSizing ? "".concat(renderedWidth, "px") : "clamp(".concat(minWidth, ", ").concat(renderedWidth, "px, ").concat(configuredMaxWidth, ")");
|
|
278
259
|
var dangerouslyHoistSlotSizes = useContext(DangerouslyHoistSlotSizes);
|
|
279
260
|
var navRef = useRef(null);
|
|
280
|
-
var panelSplitterPortalTargetRef = useRef(null);
|
|
281
261
|
var getResizeBounds = useCallback(function () {
|
|
282
262
|
if (!isChatPanelLayoutEnabled) {
|
|
283
263
|
return {
|
|
@@ -382,13 +362,6 @@ function SideNavInternal(_ref) {
|
|
|
382
362
|
}
|
|
383
363
|
}
|
|
384
364
|
function open() {
|
|
385
|
-
// Prevent the flyout from being opened if there are any open layers in the top nav start
|
|
386
|
-
if (openLayerObserver && openLayerObserver.getCount({
|
|
387
|
-
namespace: openLayerObserverTopNavStartNamespace,
|
|
388
|
-
type: 'popup'
|
|
389
|
-
}) > 0) {
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
365
|
var prevFlyoutState = flyoutStateRef.current;
|
|
393
366
|
tryAbortPendingClose();
|
|
394
367
|
flyoutStateRef.current = {
|
|
@@ -879,7 +852,7 @@ function SideNavInternal(_ref) {
|
|
|
879
852
|
var isMotionUpliftEnabled = fg('platform-dst-motion-uplift-sidenav');
|
|
880
853
|
|
|
881
854
|
// This is only used for the regular expand and collapse animations, not the flyout animations.
|
|
882
|
-
var shouldShowSidebarToggleAnimation =
|
|
855
|
+
var shouldShowSidebarToggleAnimation = isMotionUpliftEnabled &&
|
|
883
856
|
// We do not apply the animation styles on the initial render, as the `@starting-style` rule will cause the sidebar to
|
|
884
857
|
// slide in initially.
|
|
885
858
|
hasExpandedStateChanged &&
|
|
@@ -910,7 +883,7 @@ function SideNavInternal(_ref) {
|
|
|
910
883
|
style: _defineProperty({}, sideNavVar, clampedWidth),
|
|
911
884
|
ref: mergedRef,
|
|
912
885
|
"data-testid": testId,
|
|
913
|
-
className: ax([styles.root, isChatPanelLayoutEnabled && styles.chatPanelSizing, isChatPanelLayoutEnabled && (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'overlay' && styles.managedOverlay, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop, isMotionUpliftEnabled && motionUpliftStyles.animationRTLSupport,
|
|
886
|
+
className: ax([styles.root, isChatPanelLayoutEnabled && styles.chatPanelSizing, isChatPanelLayoutEnabled && (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'overlay' && styles.managedOverlay, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop, isMotionUpliftEnabled && motionUpliftStyles.animationRTLSupport, shouldShowSidebarToggleAnimation && isMotionUpliftEnabled && motionUpliftStyles.animationBaseStyles, isExpandedOnMobile && shouldShowSidebarToggleAnimation && isMotionUpliftEnabled && motionUpliftStyles.expandAnimationMobile, !isExpandedOnMobile && shouldShowSidebarToggleAnimation && isMotionUpliftEnabled && motionUpliftStyles.collapseAnimationMobile, isExpandedOnDesktop && shouldShowSidebarToggleAnimation && isMotionUpliftEnabled && motionUpliftStyles.expandAnimationDesktop, !isExpandedOnDesktop && shouldShowSidebarToggleAnimation && isMotionUpliftEnabled && motionUpliftStyles.collapseAnimationDesktop, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && isMotionUpliftEnabled && motionUpliftStyles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isMotionUpliftEnabled && styles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && isMotionUpliftEnabled && motionUpliftStyles.flyoutAnimateClosed, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isMotionUpliftEnabled && styles.flyoutAnimateClosed])
|
|
914
887
|
}), /*#__PURE__*/React.createElement(DangerouslyHoistCssVarToDocumentRoot, {
|
|
915
888
|
variableName: sideNavLiveWidthVar,
|
|
916
889
|
value: "0px",
|
|
@@ -929,7 +902,6 @@ function SideNavInternal(_ref) {
|
|
|
929
902
|
, /*#__PURE__*/React.createElement(PanelSplitterProvider, {
|
|
930
903
|
panelId: sideNavPanelSplitterId,
|
|
931
904
|
panelRef: navRef,
|
|
932
|
-
portalRef: isFhsEnabled ? panelSplitterPortalTargetRef : undefined,
|
|
933
905
|
panelWidth: renderedWidth,
|
|
934
906
|
onCompleteResize: onCompleteResize,
|
|
935
907
|
onResizeStartInternal: isChatPanelLayoutEnabled && managedSizing ? onResizeStartInternal : undefined,
|
|
@@ -942,12 +914,7 @@ function SideNavInternal(_ref) {
|
|
|
942
914
|
shortcut: isShortcutEnabled ? sideNavToggleTooltipKeyboardShortcut : undefined
|
|
943
915
|
}, /*#__PURE__*/React.createElement("div", {
|
|
944
916
|
className: ax([styles.flexContainer])
|
|
945
|
-
}, children)))
|
|
946
|
-
ref: panelSplitterPortalTargetRef,
|
|
947
|
-
"data-layout-slot": true,
|
|
948
|
-
style: _defineProperty({}, sideNavClampedWidthVar, clampedWidth),
|
|
949
|
-
className: ax([panelSplitterPortalTargetStyles.root, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop])
|
|
950
|
-
}));
|
|
917
|
+
}, children))));
|
|
951
918
|
}
|
|
952
919
|
|
|
953
920
|
/**
|
|
@@ -958,23 +925,23 @@ function SideNavInternal(_ref) {
|
|
|
958
925
|
*
|
|
959
926
|
* You can optionally render a `PanelSplitter` as a child to make the side navigation slot resizable.
|
|
960
927
|
*/
|
|
961
|
-
export function SideNav(
|
|
962
|
-
var children =
|
|
963
|
-
defaultCollapsed =
|
|
964
|
-
|
|
965
|
-
defaultWidth =
|
|
966
|
-
minWidth =
|
|
967
|
-
maxWidth =
|
|
968
|
-
testId =
|
|
969
|
-
label =
|
|
970
|
-
|
|
971
|
-
skipLinkLabel =
|
|
972
|
-
onExpand =
|
|
973
|
-
onCollapse =
|
|
974
|
-
onPeekStart =
|
|
975
|
-
onPeekEnd =
|
|
976
|
-
canToggleWithShortcut =
|
|
977
|
-
id =
|
|
928
|
+
export function SideNav(_ref8) {
|
|
929
|
+
var children = _ref8.children,
|
|
930
|
+
defaultCollapsed = _ref8.defaultCollapsed,
|
|
931
|
+
_ref8$defaultWidth = _ref8.defaultWidth,
|
|
932
|
+
defaultWidth = _ref8$defaultWidth === void 0 ? 320 : _ref8$defaultWidth,
|
|
933
|
+
minWidth = _ref8.minWidth,
|
|
934
|
+
maxWidth = _ref8.maxWidth,
|
|
935
|
+
testId = _ref8.testId,
|
|
936
|
+
label = _ref8.label,
|
|
937
|
+
_ref8$skipLinkLabel = _ref8.skipLinkLabel,
|
|
938
|
+
skipLinkLabel = _ref8$skipLinkLabel === void 0 ? label : _ref8$skipLinkLabel,
|
|
939
|
+
onExpand = _ref8.onExpand,
|
|
940
|
+
onCollapse = _ref8.onCollapse,
|
|
941
|
+
onPeekStart = _ref8.onPeekStart,
|
|
942
|
+
onPeekEnd = _ref8.onPeekEnd,
|
|
943
|
+
canToggleWithShortcut = _ref8.canToggleWithShortcut,
|
|
944
|
+
id = _ref8.id;
|
|
978
945
|
return /*#__PURE__*/React.createElement(OpenLayerObserverNamespaceProvider, {
|
|
979
946
|
namespace: openLayerObserverSideNavNamespace
|
|
980
947
|
}, /*#__PURE__*/React.createElement(SideNavInternal, {
|
|
@@ -5,6 +5,5 @@
|
|
|
5
5
|
._1e0cglyw{display:none}
|
|
6
6
|
._1ul9zwfg{min-width:2pc}
|
|
7
7
|
._4cvr1h6o{align-items:center}
|
|
8
|
-
._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
|
|
9
8
|
@media (min-width:48rem){._181n1txw{display:flex}._1d2y1ris{min-width:max-content}}
|
|
10
9
|
@media (min-width:64rem){._glte1ris{width:max-content}._15rip2n4{min-width:330px}._1gs5usvi{box-sizing:border-box}._ndwch9n0{justify-self:end}}
|
|
@@ -10,16 +10,14 @@ import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
|
10
10
|
import { OpenLayerObserverNamespaceProvider } from '@atlaskit/layering/open-layer-observer-namespace-provider';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
12
|
import { Popup } from '@atlaskit/popup/popup';
|
|
13
|
-
import { UNSAFE_useMediaQuery as useMediaQuery } from '@atlaskit/primitives/compiled/
|
|
13
|
+
import { UNSAFE_useMediaQuery as useMediaQuery } from '@atlaskit/primitives/compiled/use-media-query';
|
|
14
14
|
import { List } from '../../../components/list';
|
|
15
|
-
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
16
15
|
import { HasCustomThemeContext } from '../../top-nav-items/themed/has-custom-theme-context';
|
|
17
16
|
import { IconButton } from '../../top-nav-items/themed/icon-button';
|
|
18
17
|
import { openLayerObserverTopNavEndNamespace } from '../constants';
|
|
19
18
|
var containerStyles = {
|
|
20
19
|
root: "_yyhy11wp _1e0c1txw _1bahh9n0 _1ul9zwfg _1d2y1ris _glte1ris _15rip2n4 _1gs5usvi _ndwch9n0",
|
|
21
|
-
withPersistentItems: "_zulp1b66 _4cvr1h6o"
|
|
22
|
-
fullHeightSidebar: "_y4tiutpp"
|
|
20
|
+
withPersistentItems: "_zulp1b66 _4cvr1h6o"
|
|
23
21
|
};
|
|
24
22
|
var listStyles = {
|
|
25
23
|
root: "_zulp1b66 _4cvr1h6o _1e0c1txw",
|
|
@@ -43,7 +41,6 @@ export function TopNavEnd(_ref) {
|
|
|
43
41
|
_ref$showMoreButtonLa = _ref.showMoreButtonLabel,
|
|
44
42
|
showMoreButtonLabel = _ref$showMoreButtonLa === void 0 ? 'Show more' : _ref$showMoreButtonLa;
|
|
45
43
|
var hasPersistentItems = fg('platform-dst-chat-panel-layout') && persistentItems != null;
|
|
46
|
-
var isFhsEnabled = useIsFhsEnabled();
|
|
47
44
|
var _useState = useState(false),
|
|
48
45
|
_useState2 = _slicedToArray(_useState, 2),
|
|
49
46
|
isOpen = _useState2[0],
|
|
@@ -74,7 +71,7 @@ export function TopNavEnd(_ref) {
|
|
|
74
71
|
}, children);
|
|
75
72
|
var content = /*#__PURE__*/React.createElement("nav", {
|
|
76
73
|
"aria-label": label,
|
|
77
|
-
className: ax([containerStyles.root, hasPersistentItems && containerStyles.withPersistentItems
|
|
74
|
+
className: ax([containerStyles.root, hasPersistentItems && containerStyles.withPersistentItems])
|
|
78
75
|
}, isMobile ? /*#__PURE__*/React.createElement(Popup, {
|
|
79
76
|
isOpen: isOpen,
|
|
80
77
|
onClose: function onClose() {
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
2
|
-
.
|
|
3
|
-
._yyhykb7n{grid-column:1}._15yekb7n{--animation-direction:1}
|
|
4
|
-
._1e0c1kw7{display:inherit}
|
|
5
|
-
._1e0c1txw{display:flex}
|
|
6
|
-
._1ul9idpf{min-width:0}
|
|
2
|
+
._yyhykb7n{grid-column:1}._1e0c1txw{display:flex}
|
|
7
3
|
._4cvr1h6o{align-items:center}
|
|
8
4
|
._4t3i1osq{height:100%}
|
|
9
|
-
.
|
|
10
|
-
._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
|
|
11
|
-
._vchhusvi{box-sizing:border-box}
|
|
12
|
-
[dir=rtl] ._65m41mrw{--animation-direction:-1}
|
|
13
|
-
@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}}
|
|
14
|
-
@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%}._4ap319ly{background-color:revert}._1m5lglyw:after{display:none}._glte1ris{width:max-content}._15rip2n4{min-width:330px}._1gs5usvi{box-sizing:border-box}._glte93mn{width:var(--n_sNvlw,100%)}._exxmutpp{padding-inline-end:var(--ds-space-150,9pt)}._4ap3vuon{background-color:var(--ds-surface,#fff)}._m7c3kb7n:after{opacity:1}}
|
|
15
|
-
@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}}
|
|
5
|
+
@media (min-width:64rem){._glte1ris{width:max-content}._15rip2n4{min-width:330px}._1gs5usvi{box-sizing:border-box}}
|
|
@@ -1,157 +1,24 @@
|
|
|
1
1
|
/* top-nav-start.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
2
|
import "./top-nav-start.compiled.css";
|
|
4
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import React, {
|
|
6
|
-
import useStableRef from '@atlaskit/ds-lib/use-stable-ref';
|
|
7
|
-
import { OpenLayerObserverNamespaceProvider } from '@atlaskit/layering/open-layer-observer-namespace-provider';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
|
-
import { UNSAFE_useMediaQuery } from '@atlaskit/primitives/compiled';
|
|
4
|
+
import React, { useContext, useEffect, useRef } from 'react';
|
|
10
5
|
import { TopNavStartAttachRef } from '../../../context/top-nav-start/top-nav-start-attach-ref';
|
|
11
|
-
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
12
|
-
import { useHasCustomTheme } from '../../top-nav-items/themed/has-custom-theme-context';
|
|
13
|
-
import { HasDefaultBackgroundColorContext } from '../../top-nav-items/themed/has-default-background-color-context';
|
|
14
|
-
import { openLayerObserverTopNavStartNamespace } from '../constants';
|
|
15
|
-
import { SideNavVisibilityState } from '../side-nav/side-nav-visibility-state';
|
|
16
|
-
import { useSideNavVisibility } from '../side-nav/use-side-nav-visibility';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Firefox does support these reorder animations, but only partially enabling layout animations would look odd.
|
|
20
|
-
*
|
|
21
|
-
* We are using JS to detect Firefox and disable animations, instead of using CSS, as Compiled currently does not merge duplicate
|
|
22
|
-
* CSS at-rules when at-rules are nested: https://github.com/atlassian-labs/compiled/blob/e04a325915e1d13010205089e4915de0e53bc2d4/packages/css/src/plugins/merge-duplicate-at-rules.ts#L5
|
|
23
|
-
* Avoiding nesting the `@supports` at-rule inside of `@media` means Compiled can remove duplicate styles from the generated CSS.
|
|
24
|
-
*/
|
|
25
|
-
var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
26
|
-
|
|
27
|
-
// Placed in a variable, as the value is used in the translateX value for the children wrapper animation.
|
|
28
|
-
var flexGap = "var(--ds-space-050, 4px)";
|
|
29
6
|
|
|
30
7
|
/**
|
|
31
8
|
* Styles for the TopNavStart element.
|
|
32
|
-
*
|
|
33
|
-
* When `useIsFhsEnabled` is true this is the styling for the inner element,
|
|
34
|
-
* which re-enables pointer events.
|
|
35
9
|
*/
|
|
36
10
|
var innerStyles = {
|
|
37
|
-
root: "_zulp1b66 _yyhykb7n _4t3i1osq _4cvr1h6o _1e0c1txw _glte1ris _15rip2n4 _1gs5usvi"
|
|
38
|
-
fullHeightSidebarExpanded: "_15rin7od _glte1osq"
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Styles for the outer element, that does not have re-enabled pointer events and spans the entire
|
|
43
|
-
* width of the TopNavStart area.
|
|
44
|
-
*
|
|
45
|
-
* This wrapper element is only rendered when `useIsFhsEnabled` is true.
|
|
46
|
-
*/
|
|
47
|
-
var wrapperStyles = {
|
|
48
|
-
root: "_vchhusvi _bozgutpp _4t3i1osq _13wnh2mm _1l3vb3bt _juxdstnw _1vinidpf _1719idpf _e6znidpf _1kyhe4h9 _4cwynqa1 _435s1l7x _m7c3idpf",
|
|
49
|
-
fullHeightSidebarExpanded: "_glte93mn _exxmutpp _4ap3vuon _m7c3kb7n",
|
|
50
|
-
fullHeightSidebarBorderTransition: "_n8qabrmi _wc72fnf5 _j3mr1v42",
|
|
51
|
-
fullHeightSidebarCustomTheming: "_4ap319ly _1m5lglyw"
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* We use a fixed translateX offset for the slide animation (used when the TopNavStart children elements are reordered).
|
|
56
|
-
* This fixed offset makes the elements appear to animate smoothly from the old to the new position.
|
|
57
|
-
* This offset is calculated based on:
|
|
58
|
-
* - 32px (2rem) width of the side nav toggle button (IconButton)
|
|
59
|
-
* - 4px gap ('space.050' token) of the flex container
|
|
60
|
-
*
|
|
61
|
-
* The benefit of hardcoding this offset is that we don't need to calculate it using JS each time the sidebar is toggled.
|
|
62
|
-
* However, it could become out of sync if the width of IconButton changes.
|
|
63
|
-
*
|
|
64
|
-
* The alternative is using JS to store the previous position of the children wrapper element, and calculate the offset based on
|
|
65
|
-
* the new position, and then transforming using that offset. This would prevent the animation from going out of sync.
|
|
66
|
-
*/
|
|
67
|
-
var childrenWrapperAnimationOffset = "calc(2rem + ".concat(flexGap, ")");
|
|
68
|
-
var childrenWrapperStyles = {
|
|
69
|
-
root: "_zulp1kw7 _1e0c1kw7 _4cvr1h6o _1ul9idpf _15yekb7n _65m41mrw",
|
|
70
|
-
animationBaseStyles: "_10t81e03",
|
|
71
|
-
finalPosition: "_mjvcz12g _xrrpfnf5",
|
|
72
|
-
expandAnimationStartPosition: "_mjvcyrjp",
|
|
73
|
-
collapseAnimationStartPosition: "_mjvco0k7"
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* We use a fixed translateX offset for the toggle button slide animation (used when the TopNavStart children elements are reordered).
|
|
78
|
-
* The specific value doesn't matter too much for the toggle button animation, so we are using `100%`, which will match the toggle button width.
|
|
79
|
-
*
|
|
80
|
-
* By combining the `translateX` animation with an `opacity` fade, the feel and experience is actually quite similar to animating the
|
|
81
|
-
* element from the exact old position (offset), and it avoids the additional complexity of needing to track and calculate the exact offset.
|
|
82
|
-
*/
|
|
83
|
-
var toggleButtonWrapperStyles = {
|
|
84
|
-
root: "_15yekb7n _65m41mrw _10t81rjc",
|
|
85
|
-
finalPosition: "_mjvcz12g _xrrpfnf5 _bgpzkb7n",
|
|
86
|
-
expandAnimationStartPosition: "_mjvc1p9u _bgpzidpf",
|
|
87
|
-
collapseAnimationStartPosition: "_mjvc1efy _bgpzidpf",
|
|
88
|
-
expandAnimationTimingFunction: "_1xq51ytf",
|
|
89
|
-
collapseAnimationTimingFunction: "_1xq55ucs",
|
|
90
|
-
alignEnd: "_ahbq1wug"
|
|
11
|
+
root: "_zulp1b66 _yyhykb7n _4t3i1osq _4cvr1h6o _1e0c1txw _glte1ris _15rip2n4 _1gs5usvi"
|
|
91
12
|
};
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* The consistent key used for the side nav toggle button to ensure it does not get remounted
|
|
95
|
-
* when it is reordered.
|
|
96
|
-
*
|
|
97
|
-
* This ensures we get focus restoration for free.
|
|
98
|
-
*/
|
|
99
|
-
var sideNavToggleButtonKey = 'side-nav-toggle-button';
|
|
100
|
-
var TopNavStartInnerOld = /*#__PURE__*/forwardRef(function TopNavStartInner(_ref, ref) {
|
|
101
|
-
var children = _ref.children,
|
|
102
|
-
testId = _ref.testId;
|
|
103
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
104
|
-
ref: ref,
|
|
105
|
-
"data-testid": testId,
|
|
106
|
-
className: ax([innerStyles.root])
|
|
107
|
-
}, children);
|
|
108
|
-
});
|
|
109
|
-
var TopNavStartInnerFHS = /*#__PURE__*/forwardRef(function TopNavStartInnerFHS(_ref2, ref) {
|
|
110
|
-
var children = _ref2.children,
|
|
111
|
-
testId = _ref2.testId;
|
|
112
|
-
// This needs the real `defaultCollapsed` state or will not SSR properly
|
|
113
|
-
// TODO: lift `defaultCollapsed` state to `Root` (DSP-23683)
|
|
114
|
-
// then context value will be correct in SSR / from initial render
|
|
115
|
-
var _useSideNavVisibility = useSideNavVisibility({
|
|
116
|
-
defaultCollapsed: true
|
|
117
|
-
}),
|
|
118
|
-
isExpandedOnDesktop = _useSideNavVisibility.isExpandedOnDesktop;
|
|
119
|
-
var sideNavState = useContext(SideNavVisibilityState);
|
|
120
|
-
var isFirstRenderRef = useRef(true);
|
|
121
|
-
useEffect(function () {
|
|
122
|
-
// Ignore renders until the side nav state is initialized
|
|
123
|
-
// So that apps using the legacy API for setting side nav default state do not see
|
|
124
|
-
// animations when they shouldn't
|
|
125
|
-
if (sideNavState === null) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
if (isFirstRenderRef.current) {
|
|
129
|
-
isFirstRenderRef.current = false;
|
|
130
|
-
}
|
|
131
|
-
}, [sideNavState]);
|
|
132
|
-
var hasCustomTheme = useHasCustomTheme();
|
|
133
|
-
var hasDefaultBackgroundColor = useContext(HasDefaultBackgroundColorContext);
|
|
134
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
135
|
-
className: ax([wrapperStyles.root, isExpandedOnDesktop && wrapperStyles.fullHeightSidebarExpanded, !isFirstRenderRef.current && isExpandedOnDesktop && wrapperStyles.fullHeightSidebarBorderTransition, hasCustomTheme && !hasDefaultBackgroundColor && fg('platform_dst_nav4_custom_theming_fhs_1') && wrapperStyles.fullHeightSidebarCustomTheming])
|
|
136
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
137
|
-
ref: ref,
|
|
138
|
-
"data-testid": testId,
|
|
139
|
-
className: ax([innerStyles.root, isExpandedOnDesktop && innerStyles.fullHeightSidebarExpanded])
|
|
140
|
-
}, /*#__PURE__*/React.createElement(OpenLayerObserverNamespaceProvider, {
|
|
141
|
-
namespace: openLayerObserverTopNavStartNamespace
|
|
142
|
-
}, children)));
|
|
143
|
-
});
|
|
144
|
-
|
|
145
13
|
/**
|
|
146
14
|
* __TopNavStart__
|
|
147
15
|
*
|
|
148
16
|
* Wrapper for the top navigation actions on the inline-start (left) side of the top navigation.
|
|
149
17
|
*/
|
|
150
|
-
export function TopNavStart(
|
|
151
|
-
var children =
|
|
152
|
-
testId =
|
|
153
|
-
sideNavToggleButton =
|
|
154
|
-
var isFhsEnabled = useIsFhsEnabled();
|
|
18
|
+
export function TopNavStart(_ref) {
|
|
19
|
+
var children = _ref.children,
|
|
20
|
+
testId = _ref.testId,
|
|
21
|
+
sideNavToggleButton = _ref.sideNavToggleButton;
|
|
155
22
|
var ref = useContext(TopNavStartAttachRef);
|
|
156
23
|
var elementRef = useRef(null);
|
|
157
24
|
|
|
@@ -160,116 +27,9 @@ export function TopNavStart(_ref3) {
|
|
|
160
27
|
useEffect(function () {
|
|
161
28
|
ref(elementRef.current);
|
|
162
29
|
}, [elementRef, ref]);
|
|
163
|
-
|
|
164
|
-
// This needs the real `defaultCollapsed` state or will not SSR properly
|
|
165
|
-
// TODO: lift `defaultCollapsed` state to `Root` (DSP-23683)
|
|
166
|
-
// then context value will be correct in SSR / from initial render
|
|
167
|
-
var _useSideNavVisibility2 = useSideNavVisibility({
|
|
168
|
-
defaultCollapsed: true
|
|
169
|
-
}),
|
|
170
|
-
isExpandedOnDesktop = _useSideNavVisibility2.isExpandedOnDesktop;
|
|
171
|
-
|
|
172
|
-
// For SSR assume desktop
|
|
173
|
-
var _useState = useState(true),
|
|
174
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
175
|
-
isDesktop = _useState2[0],
|
|
176
|
-
setIsDesktop = _useState2[1];
|
|
177
|
-
// Set state to real value on client
|
|
178
|
-
// This could result in some visible shift on mobile when hydrating SSR
|
|
179
|
-
// TODO: review and improve SSR behavior as necessary (DSP-23817)
|
|
180
|
-
useLayoutEffect(function () {
|
|
181
|
-
// Checking this to avoid breaking tests when `matchMedia` is not mocked
|
|
182
|
-
// Ideally we wouldn't cater to test environments, but this avoids introducing unnecessary friction
|
|
183
|
-
if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
|
|
184
|
-
setIsDesktop(window.matchMedia('(min-width: 64rem)').matches);
|
|
185
|
-
}
|
|
186
|
-
}, []);
|
|
187
|
-
UNSAFE_useMediaQuery('above.md', function (event) {
|
|
188
|
-
setIsDesktop(event.matches);
|
|
189
|
-
});
|
|
190
|
-
var _useState3 = useState({
|
|
191
|
-
type: 'idle'
|
|
192
|
-
}),
|
|
193
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
194
|
-
animationState = _useState4[0],
|
|
195
|
-
setAnimationState = _useState4[1];
|
|
196
|
-
|
|
197
|
-
// Used to prevent the reorder animations from running on the initial render.
|
|
198
|
-
var isFirstRenderRef = useRef(true);
|
|
199
|
-
var sideNavState = useContext(SideNavVisibilityState);
|
|
200
|
-
useEffect(function () {
|
|
201
|
-
if (!isFhsEnabled) {
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// Ignore renders until the side nav state is initialized
|
|
206
|
-
// So that apps using the legacy API for setting side nav default state do not see
|
|
207
|
-
// animations when they shouldn't
|
|
208
|
-
if (sideNavState === null) {
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
if (isFirstRenderRef.current) {
|
|
212
|
-
isFirstRenderRef.current = false;
|
|
213
|
-
}
|
|
214
|
-
}, [isFhsEnabled, sideNavState]);
|
|
215
|
-
|
|
216
|
-
// Using a stable ref to avoid re-running the animation layout effect when the toggle button prop value changes, which
|
|
217
|
-
// can happen a lot (e.g. if the parent re-renders)
|
|
218
|
-
var sideNavToggleButtonStableRef = useStableRef(sideNavToggleButton);
|
|
219
|
-
useLayoutEffect(function () {
|
|
220
|
-
if (!isFhsEnabled) {
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* This layout effect is used to animate the TopNavStart children elements to their new position after being reordered.
|
|
226
|
-
* It is called when the sidebar's desktop expansion state changes.
|
|
227
|
-
*
|
|
228
|
-
* It works by first setting a translateX offset on the elements, used as the start position of the slide animation.
|
|
229
|
-
* - For the toggle button, it's a fixed offset. It's combined with an opacity, so the exact offset doesn't matter too much.
|
|
230
|
-
* - For the children wrapper (wrapping everything except the toggle button), an offset was chosen to make the animation
|
|
231
|
-
* start position the exact same as the element's old position. See comments for `childrenWrapperStyles` for more details.
|
|
232
|
-
*
|
|
233
|
-
* On the next frame, the translateX offset is cleared, triggering the animation to the new position.
|
|
234
|
-
*/
|
|
235
|
-
|
|
236
|
-
if (isFirstRenderRef.current) {
|
|
237
|
-
// No animations on initial render.
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
if (!sideNavToggleButtonStableRef.current) {
|
|
241
|
-
// If there is no toggle button, there should be no re-order animations.
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// Set the translateX offsets so elements are ready to animate to their actual new position after being reordered
|
|
246
|
-
setAnimationState({
|
|
247
|
-
type: isExpandedOnDesktop ? 'expand' : 'collapse'
|
|
248
|
-
});
|
|
249
|
-
requestAnimationFrame(function () {
|
|
250
|
-
// Clear translateX offsets on next frame to trigger animation to new position in a re-render
|
|
251
|
-
setAnimationState({
|
|
252
|
-
type: 'idle'
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
// This layout effect is called when the sidebar's desktop expansion state changes.
|
|
257
|
-
}, [isExpandedOnDesktop, isFhsEnabled, sideNavToggleButtonStableRef]);
|
|
258
|
-
var TopNavStartInner = isFhsEnabled ? TopNavStartInnerFHS : TopNavStartInnerOld;
|
|
259
|
-
return /*#__PURE__*/React.createElement(TopNavStartInner, {
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
260
31
|
ref: elementRef,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
className: ax([!isFirefox && toggleButtonWrapperStyles.root, !isFirefox && animationState.type === 'idle' && toggleButtonWrapperStyles.finalPosition, !isFirefox &&
|
|
265
|
-
// Timing function is applied when the browser animates to the idle position.
|
|
266
|
-
animationState.type === 'idle' && toggleButtonWrapperStyles.collapseAnimationTimingFunction, !isFirefox && animationState.type === 'collapse' && toggleButtonWrapperStyles.collapseAnimationStartPosition])
|
|
267
|
-
}, sideNavToggleButton), isFhsEnabled ? /*#__PURE__*/React.createElement("div", {
|
|
268
|
-
className: ax([childrenWrapperStyles.root, !isFirefox && childrenWrapperStyles.animationBaseStyles, !isFirefox && animationState.type === 'idle' && childrenWrapperStyles.finalPosition, !isFirefox && animationState.type === 'expand' && childrenWrapperStyles.expandAnimationStartPosition, !isFirefox && animationState.type === 'collapse' && childrenWrapperStyles.collapseAnimationStartPosition])
|
|
269
|
-
}, children) : children, sideNavToggleButton && isDesktop && isExpandedOnDesktop && isFhsEnabled && /*#__PURE__*/React.createElement("div", {
|
|
270
|
-
key: sideNavToggleButtonKey,
|
|
271
|
-
className: ax([!isFirefox && toggleButtonWrapperStyles.root, toggleButtonWrapperStyles.alignEnd, !isFirefox && animationState.type === 'idle' && toggleButtonWrapperStyles.finalPosition, !isFirefox &&
|
|
272
|
-
// Timing function is applied when the browser animates to the idle position.
|
|
273
|
-
animationState.type === 'idle' && toggleButtonWrapperStyles.expandAnimationTimingFunction, !isFirefox && animationState.type === 'expand' && toggleButtonWrapperStyles.expandAnimationStartPosition])
|
|
274
|
-
}, sideNavToggleButton));
|
|
32
|
+
"data-testid": testId,
|
|
33
|
+
className: ax([innerStyles.root])
|
|
34
|
+
}, sideNavToggleButton, children);
|
|
275
35
|
}
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
._nd5l8cbt{grid-area:top-bar}
|
|
2
2
|
._zulpu2gc{gap:var(--ds-space-100,8px)}
|
|
3
3
|
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
4
|
-
._18zrze3t{padding-inline:var(--ds-space-0,0)}
|
|
5
|
-
._179rglyw{border-block-end:none}
|
|
6
4
|
._179ria51{border-block-end:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._152t1nws{inset-block-start:var(--n_bnrM,0)}
|
|
7
|
-
._18postnw:after{position:absolute}
|
|
8
|
-
._1beue4h9:after{border-block-end-width:var(--ds-border-width,1px)}
|
|
9
|
-
._1cte1l7x:after{border-block-end-color:var(--ds-border,#0b120e24)}
|
|
10
|
-
._1czdidpf:after{inset-inline-end:0}
|
|
11
5
|
._1e0c11p5{display:grid}
|
|
12
|
-
._1gufidpf:after{inset-block-end:0}
|
|
13
|
-
._1pby11wp{z-index:3}
|
|
14
6
|
._1pbyegat{z-index:4}
|
|
15
7
|
._4cvr1h6o{align-items:center}
|
|
16
8
|
._4t3i1dgc{height:var(--n_tNvM)}
|
|
17
|
-
._aetrb3bt:after{content:""}
|
|
18
9
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
19
10
|
._d6vu1bgi >span[data-ep-placeholder-id=top_navigation_skeleton]{display:contents}
|
|
20
|
-
._g0nf3tht:after{inset-inline-start:var(--n_sNvlw,0)}
|
|
21
11
|
._kqsw1if8{position:sticky}
|
|
22
|
-
._lcxv1wug{pointer-events:auto}
|
|
23
|
-
._uaeunqa1:after{border-block-end-style:solid}
|
|
24
12
|
._vchhusvi{box-sizing:border-box}
|
|
25
13
|
._yv0e1mfv{grid-template-columns:auto 1fr auto}
|
|
26
|
-
@media (min-width:48rem){._1j8b18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
27
|
-
@media (min-width:64rem){._1m5lglyw:after{display:none}._1rqt16a9{grid-template-columns:0fr minmax(min-content,max-content) 1fr}._pdlmutpp{gap:var(--ds-space-150,9pt)}}
|
|
28
|
-
@media (min-width:110.5rem){._jh1g18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
14
|
+
@media (min-width:48rem){._1j8b18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|