@atlaskit/navigation-system 11.8.0 → 11.8.2
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 +33 -0
- package/dist/cjs/ui/page-layout/layout-overlay-clearance.js +11 -2
- package/dist/cjs/ui/page-layout/local-panel-surface.compiled.css +3 -4
- package/dist/cjs/ui/page-layout/local-panel-surface.js +9 -12
- package/dist/cjs/ui/page-layout/panel-layout-shell.compiled.css +2 -1
- package/dist/cjs/ui/page-layout/panel-layout-shell.js +10 -11
- package/dist/cjs/ui/page-layout/panel-layout.js +1 -1
- package/dist/cjs/ui/page-layout/panel.compiled.css +1 -1
- package/dist/cjs/ui/page-layout/panel.js +6 -3
- package/dist/cjs/ui/page-layout/side-nav/side-nav.compiled.css +7 -6
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +8 -7
- package/dist/cjs/ui/page-layout/use-panel-content-enter.js +27 -0
- package/dist/es2019/ui/page-layout/layout-overlay-clearance.js +9 -1
- package/dist/es2019/ui/page-layout/local-panel-surface.compiled.css +3 -4
- package/dist/es2019/ui/page-layout/local-panel-surface.js +9 -12
- package/dist/es2019/ui/page-layout/panel-layout-shell.compiled.css +2 -1
- package/dist/es2019/ui/page-layout/panel-layout-shell.js +9 -10
- package/dist/es2019/ui/page-layout/panel-layout.js +1 -1
- package/dist/es2019/ui/page-layout/panel.compiled.css +1 -1
- package/dist/es2019/ui/page-layout/panel.js +6 -3
- package/dist/es2019/ui/page-layout/side-nav/side-nav.compiled.css +7 -6
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +9 -8
- package/dist/es2019/ui/page-layout/use-panel-content-enter.js +16 -0
- package/dist/esm/ui/page-layout/layout-overlay-clearance.js +9 -1
- package/dist/esm/ui/page-layout/local-panel-surface.compiled.css +3 -4
- package/dist/esm/ui/page-layout/local-panel-surface.js +9 -12
- package/dist/esm/ui/page-layout/panel-layout-shell.compiled.css +2 -1
- package/dist/esm/ui/page-layout/panel-layout-shell.js +10 -11
- package/dist/esm/ui/page-layout/panel-layout.js +1 -1
- package/dist/esm/ui/page-layout/panel.compiled.css +1 -1
- package/dist/esm/ui/page-layout/panel.js +6 -3
- package/dist/esm/ui/page-layout/side-nav/side-nav.compiled.css +7 -6
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +8 -7
- package/dist/esm/ui/page-layout/use-panel-content-enter.js +20 -0
- package/dist/types/ui/page-layout/layout-overlay-clearance.d.ts +1 -1
- package/dist/types/ui/page-layout/panel-layout-shell.d.ts +3 -3
- package/dist/types/ui/page-layout/use-panel-content-enter.d.ts +5 -0
- package/package.json +8 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 11.8.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`63dc2ea477c1f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/63dc2ea477c1f) -
|
|
8
|
+
Fix local panel defaults becoming stuck when crossing viewport breakpoints in WebKit by removing a
|
|
9
|
+
redundant nested sizing container. Includes the XL default behind platform-dst-chat-panel-layout.
|
|
10
|
+
|
|
11
|
+
## 11.8.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`2bc99f7ee7d7c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2bc99f7ee7d7c) -
|
|
16
|
+
Refine panel and side-nav motion with a 200ms ExpoOut entrance, 200ms QuartOut exit, a 60ms
|
|
17
|
+
entrance layout snap and immediate exit layout snap. Preserve reduced motion and RTL behavior
|
|
18
|
+
behind platform-dst-motion-uplift-panel and platform-dst-motion-uplift-sidenav.
|
|
19
|
+
|
|
20
|
+
Add motion.panel.content.open for the complete opening fade: 100ms delay and 150ms ExpoOut. Let
|
|
21
|
+
the 150ms fade finish independently of the panel slide, while preserving the existing
|
|
22
|
+
content-replacement animation. Release the side-nav grid track immediately on collapse. Keep the
|
|
23
|
+
local panel layout snap in component-owned CSS, using 30% of motion.duration.medium instead of a
|
|
24
|
+
JavaScript timer or a separate layout animation token.
|
|
25
|
+
|
|
26
|
+
Add `motion.easing.out.expo` and `motion.easing.out.quart` easing tokens.
|
|
27
|
+
|
|
28
|
+
Keep mobile side-nav motion below the desktop breakpoint so stylesheet load order cannot leave an
|
|
29
|
+
expanded desktop sidebar over main content.
|
|
30
|
+
|
|
31
|
+
Keep fallback local-panel sizing from overriding siblings already managed by the resize
|
|
32
|
+
coordinator, preventing an open chat panel from briefly collapsing when the local panel opens.
|
|
33
|
+
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
|
|
3
36
|
## 11.8.0
|
|
4
37
|
|
|
5
38
|
### Minor Changes
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.LayoutOverlayClearance = LayoutOverlayClearance;
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _layoutAreaStateContexts = require("./layout-area-state-contexts");
|
|
9
10
|
var _root = require("./root");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
10
12
|
/**
|
|
11
13
|
* CSS owns fitting before hydration and lazy resize activation. Each slot hoists
|
|
12
14
|
* its own minimum and target into Root's capacity containers during rendering;
|
|
@@ -15,6 +17,13 @@ var _root = require("./root");
|
|
|
15
17
|
function LayoutOverlayClearance(_ref) {
|
|
16
18
|
var panelMinWidth = _ref.panelMinWidth,
|
|
17
19
|
mainMinWidth = _ref.mainMinWidth;
|
|
20
|
+
var sideNavSizing = (0, _react.useContext)(_layoutAreaStateContexts.layoutAreaStateContexts['side-nav']);
|
|
21
|
+
var chatSizing = (0, _react.useContext)(_layoutAreaStateContexts.layoutAreaStateContexts['chat-panel']);
|
|
22
|
+
// A newly opened local panel can be unmeasured for one render after its siblings have
|
|
23
|
+
// joined the resize coordinator. Its CSS fallback must not overwrite their managed widths.
|
|
24
|
+
if (sideNavSizing || chatSizing) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
18
27
|
var navMin = 'var(--n_clearanceNavMin, 0px)';
|
|
19
28
|
var navTarget = 'var(--n_clearanceNavTarget, 0px)';
|
|
20
29
|
var chatMinimum = 'var(--n_clearanceChatMin, 0px)';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.
|
|
1
|
+
._nd5l108g{grid-area:var(--p_lclPnlEnterArea,var(--p_lclPnlSsrArea,main))}
|
|
2
|
+
._nd5l12pz{grid-area:var(--p_lclPnlEnterArea,panel)}
|
|
2
3
|
._nd5l1gzg{grid-area:main}
|
|
3
|
-
._nd5l32aw{grid-area:var(--p_lclPnlSsrArea,main)}
|
|
4
4
|
._y44v1mph{animation:var(--ds-panel-content-enter,.15s cubic-bezier(.4,1,.6,1) FadeIn0to100)}
|
|
5
5
|
._y44vf1qi{animation:var(--ds-panel-content-exit,50ms cubic-bezier(.6,0,.8,.6) FadeOut100to0)}
|
|
6
6
|
._191wbqna{border-inline-start:var(--p_lclPnlSsrBorder,none)}
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
22
22
|
._bfhk1g1j{background-color:var(--p_lclPnlSsrBackground,var(--ds-surface-overlay,#fff))}
|
|
23
23
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
24
|
-
._ju25dn4k{animation-delay:var(--ds-duration-xshort,.1s)}
|
|
25
24
|
._kqsw1if8{position:sticky}
|
|
26
25
|
._vchhusvi{box-sizing:border-box}
|
|
27
|
-
@media (prefers-reduced-motion:no-preference){._15et3aws{width:min(90cqw,var(--p_lclPnlSsrPreferredW))}._15etq93i{width:max(var(--p_lclPnlMinW),min(var(--p_lclPnlSsrPreferredW),var(--p_lclPnlMotionMaxW,min(100cqw,var(--n_localPanelOverlayMax,100cqw),max(var(--p_lclPnlSsrDefaultW),90cqw)))))}.
|
|
26
|
+
@media (prefers-reduced-motion:no-preference){._15et3aws{width:min(90cqw,var(--p_lclPnlSsrPreferredW))}._15etq93i{width:max(var(--p_lclPnlMinW),min(var(--p_lclPnlSsrPreferredW),var(--p_lclPnlMotionMaxW,min(100cqw,var(--n_localPanelOverlayMax,100cqw),max(var(--p_lclPnlSsrDefaultW),90cqw)))))}._k1afi8w4{animation:var(--ds-panel-content-open,.15s cubic-bezier(.16,1,.3,1) FadeIn0to100 .1s)}._k1afry0p{animation:var(--ds-panel-exit-right,.2s cubic-bezier(.25,1,.5,1) SlideOut100PercentRight)}._1lh81gzg{grid-area:main}[dir=rtl] ._105a97o5{animation:var(--ds-panel-exit-left,.2s cubic-bezier(.25,1,.5,1) SlideOut100PercentLeft)}._15et1c5w{width:var(--p_lclPnlRsz,var(--p_lclPnlW))}._k1afx3bs{animation:var(--ds-panel-enter-right,.2s cubic-bezier(.16,1,.3,1) SlideIn100PercentRight)}[dir=rtl] ._105az3zp{animation:var(--ds-panel-enter-left,.2s cubic-bezier(.16,1,.3,1) SlideIn100PercentLeft)}}
|
|
@@ -25,6 +25,7 @@ var _layoutOverlayClearance = require("./layout-overlay-clearance");
|
|
|
25
25
|
var _mainMinWidthContext = require("./main-min-width-context");
|
|
26
26
|
var _panelSplitter = require("./panel-splitter/panel-splitter");
|
|
27
27
|
var _provider = require("./panel-splitter/provider");
|
|
28
|
+
var _usePanelContentEnter = require("./use-panel-content-enter");
|
|
28
29
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
29
30
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30
31
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -33,29 +34,24 @@ var panelSplitterResizingVar = '--p_lclPnlRsz';
|
|
|
33
34
|
var localPanelSplitterId = Symbol('LocalPanel PanelSplitter');
|
|
34
35
|
|
|
35
36
|
// Compiled preserves the existing container-relative widths and discrete motion styles.
|
|
36
|
-
/* eslint-disable @compiled/shorthand-property-sorting -- Content motion overrides only the animation delay. */
|
|
37
37
|
var styles = {
|
|
38
38
|
panelWrapper: "_nd5l1gzg _kqsw1if8 _bfhk1bhr _vchhusvi _4t3ieqxy _152tidpf _10fph9n0 _1bsb13q4",
|
|
39
|
-
managedInline: "
|
|
39
|
+
managedInline: "_nd5l12pz _bfhkvuon _152tidpf _1bsb1c5w",
|
|
40
40
|
refinedUnmeasured: "_1bsb123g",
|
|
41
|
-
unmeasured: "
|
|
41
|
+
unmeasured: "_nd5l108g _191wbqna _1bsb1cku _bfhk1g1j _16qs1dhr",
|
|
42
42
|
managedOverlay: "_nd5l1gzg _bfhk1bhr _1bsb1c5w",
|
|
43
43
|
panelScrollContainer: "_1reo1wug _18m91wug _4t3i1osq",
|
|
44
44
|
border: "_191wglyw _16qs130s",
|
|
45
45
|
managedInlineBorder: "_191wia51 _16qsglyw",
|
|
46
|
-
entering: "
|
|
46
|
+
entering: "_k1afx3bs _15et1c5w _105az3zp",
|
|
47
47
|
motionUnmeasured: "_15et3aws",
|
|
48
48
|
refinedMotionUnmeasured: "_15etq93i",
|
|
49
|
-
exiting: "
|
|
49
|
+
exiting: "_k1afry0p _1lh81gzg _15et1c5w _105a97o5",
|
|
50
50
|
contentEntering: "_y44v1mph",
|
|
51
|
+
contentEnteringOnOpen: "_k1afi8w4",
|
|
51
52
|
contentExiting: "_y44vf1qi",
|
|
52
53
|
contentChangeContainer: "_4t3i1osq"
|
|
53
54
|
};
|
|
54
|
-
var contentEnteringDelayStyles = {
|
|
55
|
-
root: "_ju25dn4k"
|
|
56
|
-
};
|
|
57
|
-
/* eslint-enable @compiled/shorthand-property-sorting */
|
|
58
|
-
|
|
59
55
|
var PanelContentMotion = function PanelContentMotion(_ref) {
|
|
60
56
|
var children = _ref.children;
|
|
61
57
|
var _useMotion = (0, _useMotion3.useMotion)(),
|
|
@@ -129,6 +125,7 @@ function LocalPanelSurface(_ref2) {
|
|
|
129
125
|
var _useMotion2 = (0, _useMotion3.useMotion)(),
|
|
130
126
|
state = _useMotion2.state,
|
|
131
127
|
motionRef = _useMotion2.ref;
|
|
128
|
+
var shouldAnimateContentEnter = (0, _usePanelContentEnter.usePanelContentEnter)(state);
|
|
132
129
|
var isMotionUpliftEnabled = (0, _fg.fg)('platform-dst-motion-uplift-panel');
|
|
133
130
|
var isContentMotionEnabled = (0, _fg.fg)('platform-dst-motion-uplift-panel-content');
|
|
134
131
|
var mergedRef = (0, _react.useMemo)(function () {
|
|
@@ -182,7 +179,7 @@ function LocalPanelSurface(_ref2) {
|
|
|
182
179
|
"data-layout-with-panel-slot": "",
|
|
183
180
|
style: (0, _defineProperty2.default)({}, localPanelVar, "".concat(renderedWidth, "px")),
|
|
184
181
|
ref: mergedRef,
|
|
185
|
-
className: (0, _runtime.ax)([
|
|
182
|
+
className: (0, _runtime.ax)([styles.panelWrapper, styles.border, !managedSizing && styles.unmeasured, !managedSizing && (0, _fg.fg)('platform-dst-chat-panel-layout') && styles.refinedUnmeasured, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'inline' && styles.managedInline, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'overlay' && styles.managedOverlay, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'inline' && styles.managedInlineBorder, isMotionUpliftEnabled && state === 'entering' && styles.entering, isMotionUpliftEnabled && state === 'exiting' && styles.exiting, isMotionUpliftEnabled && (state === 'entering' || state === 'exiting') && !managedSizing && styles.motionUnmeasured, isMotionUpliftEnabled && (state === 'entering' || state === 'exiting') && !managedSizing && (0, _fg.fg)('platform-dst-chat-panel-layout') && styles.refinedMotionUnmeasured])
|
|
186
183
|
}, !managedSizing && (0, _fg.fg)('platform-dst-chat-panel-layout') &&
|
|
187
184
|
/*#__PURE__*/
|
|
188
185
|
// Keep sibling allocation stable until the exiting surface actually unmounts.
|
|
@@ -205,7 +202,7 @@ function LocalPanelSurface(_ref2) {
|
|
|
205
202
|
}, /*#__PURE__*/React.createElement("div", {
|
|
206
203
|
ref: scrollRef,
|
|
207
204
|
"data-testid": testId && "".concat(testId, "--scroll-container"),
|
|
208
|
-
className: (0, _runtime.ax)([styles.panelScrollContainer, state === 'entering' && styles.contentEntering, isMotionUpliftEnabled &&
|
|
205
|
+
className: (0, _runtime.ax)([styles.panelScrollContainer, !isMotionUpliftEnabled && state === 'entering' && styles.contentEntering, isMotionUpliftEnabled && shouldAnimateContentEnter && styles.contentEnteringOnOpen, state === 'exiting' && styles.contentExiting])
|
|
209
206
|
}, isContentMotionEnabled && contentKey !== undefined ? /*#__PURE__*/React.createElement(_exitingPersistence.default, {
|
|
210
207
|
exitThenEnter: true
|
|
211
208
|
}, /*#__PURE__*/React.createElement(PanelContentMotion, {
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
._4t3i1osq{height:100%}
|
|
18
18
|
._7cca15wb{container-type:inline-size}
|
|
19
19
|
._82e815vq._82e815vq{overflow-y:hidden}
|
|
20
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
20
21
|
._cw8k1fc5{--p_lclPnlSsrDefaultW:var(--p_lclPnlCompactDefaultW)}
|
|
21
22
|
._evra4a59{--p_lclPnlSsrInlineAreas:"main panel"}
|
|
22
23
|
._f8371m6a._f8371m6a{grid-template-areas:"main"}
|
|
@@ -25,6 +26,6 @@
|
|
|
25
26
|
._vlegi47z._vlegi47z{grid-template-columns:minmax(0,1fr)}
|
|
26
27
|
._yv0eggl6{grid-template-columns:var(--p_lclPnlSsrColumns,minmax(0,1fr))}
|
|
27
28
|
._yv0ei47z{grid-template-columns:minmax(0,1fr)}
|
|
28
|
-
@media (prefers-reduced-motion:no-preference){.
|
|
29
|
+
@media (prefers-reduced-motion:no-preference){._1cro60m4{animation-name:k1jtk5cx}._wqfno73m{animation-duration:calc(var(--ds-duration-medium, .2s)*.3)}@keyframes k1jtk5cx{0%{grid-template-areas:"main";grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;--p_lclPnlEnterArea:main}to{grid-template-areas:"main";grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;--p_lclPnlEnterArea:main}}}
|
|
29
30
|
@media (min-width:64rem){._peezi77x{--p_lclPnlSsrPreferredW:var(--p_lclPnlTrackW)}._1tg31owj{--p_lclPnlSsrDefaultW:var(--p_lclPnlDefaultW)}}
|
|
30
31
|
@media (min-width:110.5rem){._1qxn1ykh{--p_lclPnlSsrPreferredW:var(--p_lclPnlXlW)}._13bt1t8m{--p_lclPnlSsrDefaultW:var(--p_lclPnlXlDefaultW)}}
|
|
@@ -20,20 +20,19 @@ var localPanelTrackWidthVar = '--p_lclPnlTrackW';
|
|
|
20
20
|
var localPanelResizingVar = '--p_lclPnlRsz';
|
|
21
21
|
var localPanelMinWidthVar = '--p_lclPnlMinW';
|
|
22
22
|
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
var holdClosedGrid = null;
|
|
23
|
+
// One CSS animation holds both the grid and its surface placement until the layout snap.
|
|
24
|
+
// Identical keyframes keep the layout static; normal styles take over at 60ms.
|
|
25
|
+
var holdPanelTrack = null;
|
|
27
26
|
var styles = {
|
|
28
|
-
panelEntering: "_1croukkr _wqfn147i _sl5p1ign _dqw8eoah",
|
|
29
27
|
container: "_1f38177r _7cca15wb _4t3i1osq _1bsb1osq",
|
|
30
|
-
layout: "_1reo1wug _18m91wug _1e0c11p5
|
|
28
|
+
layout: "_1reo1wug _18m91wug _1e0c11p5 _1lmc1m6a _yv0ei47z _2z05hkll _4t3i1osq _1bsb1osq",
|
|
31
29
|
mainContent: "_nd5l1gzg _1reo1wug _18m91wug _1e0c1txw _4t3i1osq _19121cl4",
|
|
32
|
-
panelUplift: "_1reo15vq _18m915vq",
|
|
30
|
+
panelUplift: "_1reo15vq _18m915vq _bfhkvuon",
|
|
33
31
|
unmeasured: "_evra4a59 _1lmcc53r _yv0eggl6",
|
|
34
32
|
unmeasuredWidths: "_129o1uuk _cw8k1fc5 _peezi77x _1tg31owj _1qxn1ykh _13bt1t8m",
|
|
35
33
|
managedInline: "_1uwq15vq _82e815vq _f8374a59 _1l7c1wug _vleg1orf",
|
|
36
34
|
managedOverlay: "_1uwq15vq _82e815vq _f8371m6a _vlegi47z _1l7chkll",
|
|
35
|
+
entering: "_1cro60m4 _wqfno73m",
|
|
37
36
|
panelClosed: "_f8371m6a _vlegi47z _1l7chkll"
|
|
38
37
|
};
|
|
39
38
|
/**
|
|
@@ -53,8 +52,8 @@ function PanelLayoutShell(_ref) {
|
|
|
53
52
|
panelMinWidth = _ref$panelMinWidth === void 0 ? 320 : _ref$panelMinWidth,
|
|
54
53
|
mode = _ref.mode,
|
|
55
54
|
layoutRef = _ref.layoutRef,
|
|
56
|
-
_ref$
|
|
57
|
-
|
|
55
|
+
_ref$isMotionEnabled = _ref.isMotionEnabled,
|
|
56
|
+
isMotionEnabled = _ref$isMotionEnabled === void 0 ? false : _ref$isMotionEnabled,
|
|
58
57
|
testId = _ref.testId;
|
|
59
58
|
var mainMinWidth = (0, _react.useContext)(_mainMinWidthContext.MainMinWidthContext);
|
|
60
59
|
var id = "local-panel-".concat((0, _react.useId)().replace(/[^a-zA-Z0-9_-]/g, '_'));
|
|
@@ -64,7 +63,7 @@ function PanelLayoutShell(_ref) {
|
|
|
64
63
|
var inlineQuery = "@container local-panel-layout (min-width: ".concat(mainMinWidth + panelMinWidth, "px)");
|
|
65
64
|
return /*#__PURE__*/React.createElement("div", {
|
|
66
65
|
className: (0, _runtime.ax)([styles.container])
|
|
67
|
-
}, mode === undefined &&
|
|
66
|
+
}, mode === undefined && isMotionEnabled && (0, _fg.fg)('platform-dst-chat-panel-layout') &&
|
|
68
67
|
/*#__PURE__*/
|
|
69
68
|
// Keep the inline motion cap available during exit, after the open-only track rule is removed.
|
|
70
69
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped query matches the SSR inline allocation, including caller-defined minimums.
|
|
@@ -76,7 +75,7 @@ function PanelLayoutShell(_ref) {
|
|
|
76
75
|
"data-testid": testId,
|
|
77
76
|
ref: layoutRef,
|
|
78
77
|
style: (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, localPanelTrackWidthVar, "".concat(panelWidth, "px")), localPanelMinWidthVar, "".concat(panelMinWidth, "px")), '--p_lclPnlCompactW', "".concat(compactPanelWidth, "px")), '--p_lclPnlXlW', "".concat(xlPanelWidth, "px")), '--p_lclPnlXlDefaultW', "".concat(xlDefaultPanelWidth, "px")), '--p_lclPnlDefaultW', "".concat(defaultPanelWidth, "px")), '--p_lclPnlCompactDefaultW', "".concat(compactDefaultPanelWidth, "px")),
|
|
79
|
-
className: (0, _runtime.ax)([styles.layout, mode === undefined && styles.unmeasuredWidths, mode === undefined && isPanelOpen && styles.unmeasured,
|
|
78
|
+
className: (0, _runtime.ax)([styles.layout, mode === undefined && styles.unmeasuredWidths, mode === undefined && isPanelOpen && styles.unmeasured, isMotionEnabled && styles.panelUplift, mode === 'inline' && styles.managedInline, mode === 'overlay' && styles.managedOverlay, !isPanelOpen && styles.panelClosed, isPanelOpen && isMotionEnabled && styles.entering])
|
|
80
79
|
}, /*#__PURE__*/React.createElement("div", {
|
|
81
80
|
className: (0, _runtime.ax)([styles.mainContent])
|
|
82
81
|
}, children), panel));
|
|
@@ -127,7 +127,7 @@ function CoordinatedPanelLayout(_ref) {
|
|
|
127
127
|
panelMinWidth: panelMinWidth,
|
|
128
128
|
mode: state === null || state === void 0 ? void 0 : state.mode,
|
|
129
129
|
layoutRef: layoutRef,
|
|
130
|
-
|
|
130
|
+
isMotionEnabled: isMotionEnabled,
|
|
131
131
|
testId: testId,
|
|
132
132
|
panel: isMotionEnabled ? /*#__PURE__*/_react.default.createElement(_exitingPersistence.default, null, surface) : surface
|
|
133
133
|
}, children);
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
15
15
|
._kqsw1if8{position:sticky}
|
|
16
16
|
._vchhusvi{box-sizing:border-box}
|
|
17
|
-
@media (prefers-reduced-motion:no-preference){.
|
|
17
|
+
@media (prefers-reduced-motion:no-preference){._k1afi8w4{animation:var(--ds-panel-content-open,.15s cubic-bezier(.16,1,.3,1) FadeIn0to100 .1s)}._k1afry0p{animation:var(--ds-panel-exit-right,.2s cubic-bezier(.25,1,.5,1) SlideOut100PercentRight)}[dir=rtl] ._105a97o5{animation:var(--ds-panel-exit-left,.2s cubic-bezier(.25,1,.5,1) SlideOut100PercentLeft)}._bq641n9t{position:fixed}@starting-style{._1kmh1n9t{position:fixed}}._k1afx3bs{animation:var(--ds-panel-enter-right,.2s cubic-bezier(.16,1,.3,1) SlideIn100PercentRight)}._10t81ia4{transition-property:position}._xrrp147i{transition-duration:var(--ds-duration-instant,0ms)}._1wsa1ja5{transition-delay:60ms}._1vrh1a5r{transition-behavior:allow-discrete}[dir=rtl] ._105az3zp{animation:var(--ds-panel-enter-left,.2s cubic-bezier(.16,1,.3,1) SlideIn100PercentLeft)}}
|
|
18
18
|
@media (min-width:48rem){._14b54rrg{width:var(--n_pnlRsz,var(--n_pnlW))}}
|
|
19
19
|
@media (min-width:64rem){._1w6eia51{border-inline-start:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._scbpglyw{box-shadow:none}._4ap3vuon{background-color:var(--ds-surface,#fff)}}
|
|
20
20
|
@media (min-width:90rem){._1dhy1c6w{grid-area:panel}._9sns1wug{z-index:auto}}
|
|
@@ -25,6 +25,7 @@ var _hoistSlotSizesContext = require("./hoist-slot-sizes-context");
|
|
|
25
25
|
var _provider = require("./panel-splitter/provider");
|
|
26
26
|
var _useSideNavRef = require("./side-nav/use-side-nav-ref");
|
|
27
27
|
var _useLayoutId = require("./use-layout-id");
|
|
28
|
+
var _usePanelContentEnter = require("./use-panel-content-enter");
|
|
28
29
|
var _useResizingWidthCssVarOnRootElement = require("./use-resizing-width-css-var-on-root-element");
|
|
29
30
|
var _useSafeDefaultWidth = require("./use-safe-default-width");
|
|
30
31
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -44,9 +45,10 @@ var styles = {
|
|
|
44
45
|
border: "_191wglyw _16qs130s _1w6eia51 _scbpglyw",
|
|
45
46
|
scrollContainer: "_1reo1wug _18m91wug _4t3i1osq",
|
|
46
47
|
hidden: "_1e0cglyw",
|
|
47
|
-
entering: "
|
|
48
|
-
exiting: "
|
|
48
|
+
entering: "_k1afx3bs _10t81ia4 _xrrp147i _1wsa1ja5 _1vrh1a5r _1kmh1n9t _105az3zp",
|
|
49
|
+
exiting: "_k1afry0p _bq641n9t _105a97o5",
|
|
49
50
|
contentEntering: "_y44v1mph",
|
|
51
|
+
contentEnteringOnOpen: "_k1afi8w4",
|
|
50
52
|
contentExiting: "_y44vf1qi",
|
|
51
53
|
contentChangeContainer: "_4t3i1osq"
|
|
52
54
|
};
|
|
@@ -114,6 +116,7 @@ function Panel(_ref2) {
|
|
|
114
116
|
state = _useMotion2.state,
|
|
115
117
|
motionRef = _useMotion2.ref,
|
|
116
118
|
reanimate = _useMotion2.reanimate;
|
|
119
|
+
var shouldAnimateContentEnter = (0, _usePanelContentEnter.usePanelContentEnter)(state);
|
|
117
120
|
|
|
118
121
|
/**
|
|
119
122
|
* Don't show the skip link if the slot has 0 width.
|
|
@@ -244,7 +247,7 @@ function Panel(_ref2) {
|
|
|
244
247
|
resizingCssVar: panelSplitterResizingVar,
|
|
245
248
|
position: "start"
|
|
246
249
|
}, /*#__PURE__*/React.createElement("div", {
|
|
247
|
-
className: (0, _runtime.ax)([styles.scrollContainer, isMotionUpliftEnabled &&
|
|
250
|
+
className: (0, _runtime.ax)([styles.scrollContainer, isMotionUpliftEnabled && shouldAnimateContentEnter && styles.contentEnteringOnOpen, isMotionUpliftEnabled && state === 'exiting' && styles.contentExiting])
|
|
248
251
|
}, isContentMotionEnabled ? /*#__PURE__*/React.createElement(_exitingPersistence.default, {
|
|
249
252
|
exitThenEnter: contentKey !== undefined
|
|
250
253
|
}, /*#__PURE__*/React.createElement(PanelContentMotion, {
|
|
@@ -6,20 +6,21 @@
|
|
|
6
6
|
._1bsbhc79{width:var(--n_snvRsz,var(--n_sNvw))}
|
|
7
7
|
._1e0c1txw{display:flex}
|
|
8
8
|
._1e0cglyw{display:none}
|
|
9
|
-
.
|
|
9
|
+
._1p2s1v7a{--exit-animation:var(--ds-sidenav-exit-left,200ms cubic-bezier(0.25,1,0.5,1) SlideOut100PercentLeft)}
|
|
10
10
|
._1pbycs5v{z-index:2}
|
|
11
11
|
._2lx21bp4{flex-direction:column}
|
|
12
12
|
._4t3i1osq{height:100%}
|
|
13
13
|
._4t3ieqxy{height:calc(100vh - var(--n_bnrM, 0px) - var(--n_tNvM, 0px))}
|
|
14
14
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
15
|
-
.
|
|
15
|
+
._cjprbksg{--enter-animation:var(--ds-sidenav-enter-left,200ms cubic-bezier(0.16,1,0.3,1) SlideIn100PercentLeft)}
|
|
16
16
|
._kqsw1if8{position:sticky}
|
|
17
17
|
._vchhusvi{box-sizing:border-box}
|
|
18
|
-
[dir=rtl] .
|
|
19
|
-
[dir=rtl] .
|
|
20
|
-
@media (prefers-reduced-motion:no-preference){._10t81t0s{transition-property:display}._1vrh1a5r{transition-behavior:allow-discrete}._xrrpi9qs{transition-duration:var(--ds-duration-medium,.2s)}
|
|
18
|
+
[dir=rtl] ._1jq4125i{--enter-animation:var(--ds-sidenav-enter-right,200ms cubic-bezier(0.16,1,0.3,1) SlideIn100PercentRight)}
|
|
19
|
+
[dir=rtl] ._2qe01hl6{--exit-animation:var(--ds-sidenav-exit-right,200ms cubic-bezier(0.25,1,0.5,1) SlideOut100PercentRight)}
|
|
20
|
+
@media (prefers-reduced-motion:no-preference){._10t81t0s{transition-property:display}._1vrh1a5r{transition-behavior:allow-discrete}._xrrpi9qs{transition-duration:var(--ds-duration-medium,.2s)}}
|
|
21
21
|
@media (min-width:48rem){._14b5hc79{width:var(--n_snvRsz,var(--n_sNvw))}}
|
|
22
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)}.
|
|
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)}._1wxo147i{transition-delay: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)}._1wxo1ja5{transition-delay:60ms}}
|
|
24
24
|
@media not (min-width:64rem){._89fi1b6c{grid-area:main/aside/aside/aside}}
|
|
25
|
+
@media (prefers-reduced-motion:no-preference) and (width < 64rem){._nobw10ed{animation:var(--enter-animation)}._ycjn1gzg{grid-area:main}._nobwfm5y{animation:var(--exit-animation)}}
|
|
25
26
|
@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}}}
|
|
@@ -131,20 +131,20 @@ var styles = {
|
|
|
131
131
|
* with `@starting-style` used by `styles`.
|
|
132
132
|
*
|
|
133
133
|
* ⚠️ The `transition-duration` values below need to stay in sync with the duration baked into the tokens
|
|
134
|
-
* (`motion.sidenav.enter.*`
|
|
134
|
+
* (`motion.sidenav.enter.*` and `motion.sidenav.exit.*` are both 200ms). The `display` property is
|
|
135
135
|
* transitioned (with `allow-discrete`) so the element stays rendered for the length of the exit animation —
|
|
136
136
|
* if the transition is shorter than the animation, `display: none` applies early and the exit animation
|
|
137
137
|
* never runs.
|
|
138
138
|
*/
|
|
139
139
|
var motionUpliftStyles = {
|
|
140
|
-
animationRTLSupport: "
|
|
140
|
+
animationRTLSupport: "_cjprbksg _1p2s1v7a _1jq4125i _2qe01hl6",
|
|
141
141
|
animationBaseStyles: "_10t81t0s _1vrh1a5r _xrrpi9qs",
|
|
142
|
-
expandAnimationMobile: "
|
|
143
|
-
collapseAnimationMobile: "
|
|
142
|
+
expandAnimationMobile: "_nobw10ed",
|
|
143
|
+
collapseAnimationMobile: "_ycjn1gzg _nobwfm5y",
|
|
144
144
|
flyoutOpen: "_qiln1gzg _p5clglyw _4ap31bhr _scbp130s _4xci10ed _1tpv1mzy _sylc1a5r",
|
|
145
145
|
flyoutAnimateClosed: "_1e0cglyw _qiln1gzg _4xcifm5y _1tpvi9qs _sylc1a5r",
|
|
146
|
-
expandAnimationDesktop: "_1sg8k0mc _n2in10ed _1xpz1gzg _17ly1q8v _hjoi147i
|
|
147
|
-
collapseAnimationDesktop: "_1sg81gzg _n2infm5y _17ly1wzp _hjoi1wsm
|
|
146
|
+
expandAnimationDesktop: "_1sg8k0mc _n2in10ed _1xpz1gzg _17ly1q8v _hjoi147i _1wxo1ja5",
|
|
147
|
+
collapseAnimationDesktop: "_1sg81gzg _n2infm5y _17ly1wzp _hjoi1wsm _1wxo147i"
|
|
148
148
|
};
|
|
149
149
|
var fallbackDefaultWidth = 320;
|
|
150
150
|
var onPeekStartDelayMs = exports.onPeekStartDelayMs = 500;
|
|
@@ -1006,8 +1006,9 @@ function SideNavInternal(_ref4) {
|
|
|
1006
1006
|
}), isChatPanelLayoutEnabled &&
|
|
1007
1007
|
/*#__PURE__*/
|
|
1008
1008
|
// CSS reserves only the nav minimum for chat's fit decision, before effects or lazy loading.
|
|
1009
|
+
// Motion owns grid-area so this ID selector cannot override the entrance or exit snap.
|
|
1009
1010
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles
|
|
1010
|
-
_react.default.createElement("style", null, "\n#".concat(_root.gridRootFitId, " { --n_clearanceNavMin: 0px; --n_clearanceNavTarget: ").concat(clampedWidth, "; }\n#").concat(_root.gridRootChatFitId, " { --n_fitNav: 0px; }\n@media (min-width: 64rem) {\n #").concat(_root.gridRootFitId, " { --n_clearanceNavMin: ").concat(isExpandedOnDesktop ? minWidth : '0px', "; }\n}\n").concat(shouldApplyUnmanagedSizing ? "#".concat(_root.gridRootId, " nav[data-layout-slot] { grid-area: main / aside / aside / aside; width: min(90%, ").concat(clampedWidth, "); }") : '', "\n@media (min-width: 64rem) {\n #").concat(_root.gridRootChatFitId, " { --n_fitNav: ").concat(isExpandedOnDesktop ? minWidth : '0px', "; }\n ").concat(shouldApplyUnmanagedSizing ? "#".concat(_root.gridRootId, " nav[data-layout-slot] { grid-area: side-nav; width: max(").concat(minWidth, ", min(").concat(clampedWidth, ", calc(100cqw + var(--n_fitNav) - var(--n_chatTrack, 0px)))); }") : '', "\n}\n")), /*#__PURE__*/_react.default.createElement(_dangerouslyHoistCssVarToDocumentRoot.DangerouslyHoistCssVarToDocumentRoot, {
|
|
1011
|
+
_react.default.createElement("style", null, "\n#".concat(_root.gridRootFitId, " { --n_clearanceNavMin: 0px; --n_clearanceNavTarget: ").concat(clampedWidth, "; }\n#").concat(_root.gridRootChatFitId, " { --n_fitNav: 0px; }\n@media (min-width: 64rem) {\n #").concat(_root.gridRootFitId, " { --n_clearanceNavMin: ").concat(isExpandedOnDesktop ? minWidth : '0px', "; }\n}\n").concat(shouldApplyUnmanagedSizing ? "#".concat(_root.gridRootId, " nav[data-layout-slot] { ").concat(isMotionUpliftEnabled ? '' : 'grid-area: main / aside / aside / aside;', " width: min(90%, ").concat(clampedWidth, "); }") : '', "\n@media (min-width: 64rem) {\n #").concat(_root.gridRootChatFitId, " { --n_fitNav: ").concat(isExpandedOnDesktop ? minWidth : '0px', "; }\n ").concat(shouldApplyUnmanagedSizing ? "#".concat(_root.gridRootId, " nav[data-layout-slot] { ").concat(isMotionUpliftEnabled ? '' : 'grid-area: side-nav;', " width: max(").concat(minWidth, ", min(").concat(clampedWidth, ", calc(100cqw + var(--n_fitNav) - var(--n_chatTrack, 0px)))); }") : '', "\n}\n")), /*#__PURE__*/_react.default.createElement(_dangerouslyHoistCssVarToDocumentRoot.DangerouslyHoistCssVarToDocumentRoot, {
|
|
1011
1012
|
variableName: _constants.sideNavLiveWidthVar,
|
|
1012
1013
|
value: "0px",
|
|
1013
1014
|
mediaQuery: '@media (min-width: 64rem)',
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.usePanelContentEnter = usePanelContentEnter;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
/**
|
|
11
|
+
* Keep the delayed content fade attached after the shorter panel slide finishes.
|
|
12
|
+
*/
|
|
13
|
+
function usePanelContentEnter(state) {
|
|
14
|
+
var _useState = (0, _react.useState)(state === 'entering'),
|
|
15
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
16
|
+
hasEntered = _useState2[0],
|
|
17
|
+
setHasEntered = _useState2[1];
|
|
18
|
+
(0, _react.useEffect)(function () {
|
|
19
|
+
if (state !== 'visible') {
|
|
20
|
+
setHasEntered(state === 'entering');
|
|
21
|
+
}
|
|
22
|
+
}, [state]);
|
|
23
|
+
|
|
24
|
+
// Exit/hidden removes the animation so reopening starts a fresh fade. A panel
|
|
25
|
+
// initially mounted as visible should not gain an entrance animation.
|
|
26
|
+
return state === 'entering' || state === 'visible' && hasEntered;
|
|
27
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { layoutAreaStateContexts } from './layout-area-state-contexts';
|
|
2
3
|
import { gridRootChatFitId, gridRootId } from './root';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -10,6 +11,13 @@ export function LayoutOverlayClearance({
|
|
|
10
11
|
panelMinWidth,
|
|
11
12
|
mainMinWidth
|
|
12
13
|
}) {
|
|
14
|
+
const sideNavSizing = useContext(layoutAreaStateContexts['side-nav']);
|
|
15
|
+
const chatSizing = useContext(layoutAreaStateContexts['chat-panel']);
|
|
16
|
+
// A newly opened local panel can be unmeasured for one render after its siblings have
|
|
17
|
+
// joined the resize coordinator. Its CSS fallback must not overwrite their managed widths.
|
|
18
|
+
if (sideNavSizing || chatSizing) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
13
21
|
const navMin = 'var(--n_clearanceNavMin, 0px)';
|
|
14
22
|
const navTarget = 'var(--n_clearanceNavTarget, 0px)';
|
|
15
23
|
const chatMinimum = 'var(--n_clearanceChatMin, 0px)';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.
|
|
1
|
+
._nd5l108g{grid-area:var(--p_lclPnlEnterArea,var(--p_lclPnlSsrArea,main))}
|
|
2
|
+
._nd5l12pz{grid-area:var(--p_lclPnlEnterArea,panel)}
|
|
2
3
|
._nd5l1gzg{grid-area:main}
|
|
3
|
-
._nd5l32aw{grid-area:var(--p_lclPnlSsrArea,main)}
|
|
4
4
|
._y44v1mph{animation:var(--ds-panel-content-enter,.15s cubic-bezier(.4,1,.6,1) FadeIn0to100)}
|
|
5
5
|
._y44vf1qi{animation:var(--ds-panel-content-exit,50ms cubic-bezier(.6,0,.8,.6) FadeOut100to0)}
|
|
6
6
|
._191wbqna{border-inline-start:var(--p_lclPnlSsrBorder,none)}
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
22
22
|
._bfhk1g1j{background-color:var(--p_lclPnlSsrBackground,var(--ds-surface-overlay,#fff))}
|
|
23
23
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
24
|
-
._ju25dn4k{animation-delay:var(--ds-duration-xshort,.1s)}
|
|
25
24
|
._kqsw1if8{position:sticky}
|
|
26
25
|
._vchhusvi{box-sizing:border-box}
|
|
27
|
-
@media (prefers-reduced-motion:no-preference){._15et3aws{width:min(90cqw,var(--p_lclPnlSsrPreferredW))}._15etq93i{width:max(var(--p_lclPnlMinW),min(var(--p_lclPnlSsrPreferredW),var(--p_lclPnlMotionMaxW,min(100cqw,var(--n_localPanelOverlayMax,100cqw),max(var(--p_lclPnlSsrDefaultW),90cqw)))))}.
|
|
26
|
+
@media (prefers-reduced-motion:no-preference){._15et3aws{width:min(90cqw,var(--p_lclPnlSsrPreferredW))}._15etq93i{width:max(var(--p_lclPnlMinW),min(var(--p_lclPnlSsrPreferredW),var(--p_lclPnlMotionMaxW,min(100cqw,var(--n_localPanelOverlayMax,100cqw),max(var(--p_lclPnlSsrDefaultW),90cqw)))))}._k1afi8w4{animation:var(--ds-panel-content-open,.15s cubic-bezier(.16,1,.3,1) FadeIn0to100 .1s)}._k1afry0p{animation:var(--ds-panel-exit-right,.2s cubic-bezier(.25,1,.5,1) SlideOut100PercentRight)}._1lh81gzg{grid-area:main}[dir=rtl] ._105a97o5{animation:var(--ds-panel-exit-left,.2s cubic-bezier(.25,1,.5,1) SlideOut100PercentLeft)}._15et1c5w{width:var(--p_lclPnlRsz,var(--p_lclPnlW))}._k1afx3bs{animation:var(--ds-panel-enter-right,.2s cubic-bezier(.16,1,.3,1) SlideIn100PercentRight)}[dir=rtl] ._105az3zp{animation:var(--ds-panel-enter-left,.2s cubic-bezier(.16,1,.3,1) SlideIn100PercentLeft)}}
|
|
@@ -15,34 +15,30 @@ import { LayoutOverlayClearance } from './layout-overlay-clearance';
|
|
|
15
15
|
import { MainMinWidthContext } from './main-min-width-context';
|
|
16
16
|
import { PanelSplitter } from './panel-splitter/panel-splitter';
|
|
17
17
|
import { PanelSplitterProvider } from './panel-splitter/provider';
|
|
18
|
+
import { usePanelContentEnter } from './use-panel-content-enter';
|
|
18
19
|
const localPanelVar = '--p_lclPnlW';
|
|
19
20
|
const panelSplitterResizingVar = '--p_lclPnlRsz';
|
|
20
21
|
const localPanelSplitterId = Symbol('LocalPanel PanelSplitter');
|
|
21
22
|
|
|
22
23
|
// Compiled preserves the existing container-relative widths and discrete motion styles.
|
|
23
|
-
/* eslint-disable @compiled/shorthand-property-sorting -- Content motion overrides only the animation delay. */
|
|
24
24
|
const styles = {
|
|
25
25
|
panelWrapper: "_nd5l1gzg _kqsw1if8 _bfhk1bhr _vchhusvi _4t3ieqxy _152tidpf _10fph9n0 _1bsb13q4",
|
|
26
|
-
managedInline: "
|
|
26
|
+
managedInline: "_nd5l12pz _bfhkvuon _152tidpf _1bsb1c5w",
|
|
27
27
|
refinedUnmeasured: "_1bsb123g",
|
|
28
|
-
unmeasured: "
|
|
28
|
+
unmeasured: "_nd5l108g _191wbqna _1bsb1cku _bfhk1g1j _16qs1dhr",
|
|
29
29
|
managedOverlay: "_nd5l1gzg _bfhk1bhr _1bsb1c5w",
|
|
30
30
|
panelScrollContainer: "_1reo1wug _18m91wug _4t3i1osq",
|
|
31
31
|
border: "_191wglyw _16qs130s",
|
|
32
32
|
managedInlineBorder: "_191wia51 _16qsglyw",
|
|
33
|
-
entering: "
|
|
33
|
+
entering: "_k1afx3bs _15et1c5w _105az3zp",
|
|
34
34
|
motionUnmeasured: "_15et3aws",
|
|
35
35
|
refinedMotionUnmeasured: "_15etq93i",
|
|
36
|
-
exiting: "
|
|
36
|
+
exiting: "_k1afry0p _1lh81gzg _15et1c5w _105a97o5",
|
|
37
37
|
contentEntering: "_y44v1mph",
|
|
38
|
+
contentEnteringOnOpen: "_k1afi8w4",
|
|
38
39
|
contentExiting: "_y44vf1qi",
|
|
39
40
|
contentChangeContainer: "_4t3i1osq"
|
|
40
41
|
};
|
|
41
|
-
const contentEnteringDelayStyles = {
|
|
42
|
-
root: "_ju25dn4k"
|
|
43
|
-
};
|
|
44
|
-
/* eslint-enable @compiled/shorthand-property-sorting */
|
|
45
|
-
|
|
46
42
|
const PanelContentMotion = ({
|
|
47
43
|
children
|
|
48
44
|
}) => {
|
|
@@ -118,6 +114,7 @@ export function LocalPanelSurface({
|
|
|
118
114
|
state,
|
|
119
115
|
ref: motionRef
|
|
120
116
|
} = useMotion();
|
|
117
|
+
const shouldAnimateContentEnter = usePanelContentEnter(state);
|
|
121
118
|
const isMotionUpliftEnabled = fg('platform-dst-motion-uplift-panel');
|
|
122
119
|
const isContentMotionEnabled = fg('platform-dst-motion-uplift-panel-content');
|
|
123
120
|
const mergedRef = useMemo(() => isMotionUpliftEnabled ? mergeRefs([ref, motionRef]) : ref, [isMotionUpliftEnabled, motionRef]);
|
|
@@ -169,7 +166,7 @@ export function LocalPanelSurface({
|
|
|
169
166
|
[localPanelVar]: `${renderedWidth}px`
|
|
170
167
|
},
|
|
171
168
|
ref: mergedRef,
|
|
172
|
-
className: ax([
|
|
169
|
+
className: ax([styles.panelWrapper, styles.border, !managedSizing && styles.unmeasured, !managedSizing && fg('platform-dst-chat-panel-layout') && styles.refinedUnmeasured, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'inline' && styles.managedInline, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'overlay' && styles.managedOverlay, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'inline' && styles.managedInlineBorder, isMotionUpliftEnabled && state === 'entering' && styles.entering, isMotionUpliftEnabled && state === 'exiting' && styles.exiting, isMotionUpliftEnabled && (state === 'entering' || state === 'exiting') && !managedSizing && styles.motionUnmeasured, isMotionUpliftEnabled && (state === 'entering' || state === 'exiting') && !managedSizing && fg('platform-dst-chat-panel-layout') && styles.refinedMotionUnmeasured])
|
|
173
170
|
}, !managedSizing && fg('platform-dst-chat-panel-layout') &&
|
|
174
171
|
/*#__PURE__*/
|
|
175
172
|
// Keep sibling allocation stable until the exiting surface actually unmounts.
|
|
@@ -192,7 +189,7 @@ export function LocalPanelSurface({
|
|
|
192
189
|
}, /*#__PURE__*/React.createElement("div", {
|
|
193
190
|
ref: scrollRef,
|
|
194
191
|
"data-testid": testId && `${testId}--scroll-container`,
|
|
195
|
-
className: ax([styles.panelScrollContainer, state === 'entering' && styles.contentEntering, isMotionUpliftEnabled &&
|
|
192
|
+
className: ax([styles.panelScrollContainer, !isMotionUpliftEnabled && state === 'entering' && styles.contentEntering, isMotionUpliftEnabled && shouldAnimateContentEnter && styles.contentEnteringOnOpen, state === 'exiting' && styles.contentExiting])
|
|
196
193
|
}, isContentMotionEnabled && contentKey !== undefined ? /*#__PURE__*/React.createElement(ExitingPersistence, {
|
|
197
194
|
exitThenEnter: true
|
|
198
195
|
}, /*#__PURE__*/React.createElement(PanelContentMotion, {
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
._4t3i1osq{height:100%}
|
|
18
18
|
._7cca15wb{container-type:inline-size}
|
|
19
19
|
._82e815vq._82e815vq{overflow-y:hidden}
|
|
20
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
20
21
|
._cw8k1fc5{--p_lclPnlSsrDefaultW:var(--p_lclPnlCompactDefaultW)}
|
|
21
22
|
._evra4a59{--p_lclPnlSsrInlineAreas:"main panel"}
|
|
22
23
|
._f8371m6a._f8371m6a{grid-template-areas:"main"}
|
|
@@ -25,6 +26,6 @@
|
|
|
25
26
|
._vlegi47z._vlegi47z{grid-template-columns:minmax(0,1fr)}
|
|
26
27
|
._yv0eggl6{grid-template-columns:var(--p_lclPnlSsrColumns,minmax(0,1fr))}
|
|
27
28
|
._yv0ei47z{grid-template-columns:minmax(0,1fr)}
|
|
28
|
-
@media (prefers-reduced-motion:no-preference){.
|
|
29
|
+
@media (prefers-reduced-motion:no-preference){._1cro60m4{animation-name:k1jtk5cx}._wqfno73m{animation-duration:calc(var(--ds-duration-medium, .2s)*.3)}@keyframes k1jtk5cx{0%{grid-template-areas:"main";grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;--p_lclPnlEnterArea:main}to{grid-template-areas:"main";grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;--p_lclPnlEnterArea:main}}}
|
|
29
30
|
@media (min-width:64rem){._peezi77x{--p_lclPnlSsrPreferredW:var(--p_lclPnlTrackW)}._1tg31owj{--p_lclPnlSsrDefaultW:var(--p_lclPnlDefaultW)}}
|
|
30
31
|
@media (min-width:110.5rem){._1qxn1ykh{--p_lclPnlSsrPreferredW:var(--p_lclPnlXlW)}._13bt1t8m{--p_lclPnlSsrDefaultW:var(--p_lclPnlXlDefaultW)}}
|
|
@@ -11,20 +11,19 @@ const localPanelTrackWidthVar = '--p_lclPnlTrackW';
|
|
|
11
11
|
const localPanelResizingVar = '--p_lclPnlRsz';
|
|
12
12
|
const localPanelMinWidthVar = '--p_lclPnlMinW';
|
|
13
13
|
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
const holdClosedGrid = null;
|
|
14
|
+
// One CSS animation holds both the grid and its surface placement until the layout snap.
|
|
15
|
+
// Identical keyframes keep the layout static; normal styles take over at 60ms.
|
|
16
|
+
const holdPanelTrack = null;
|
|
18
17
|
const styles = {
|
|
19
|
-
panelEntering: "_1cro1qv1 _wqfn147i _sl5p1ign _dqw8eoah",
|
|
20
18
|
container: "_1f38177r _7cca15wb _4t3i1osq _1bsb1osq",
|
|
21
|
-
layout: "_1reo1wug _18m91wug _1e0c11p5
|
|
19
|
+
layout: "_1reo1wug _18m91wug _1e0c11p5 _1lmc1m6a _yv0ei47z _2z05hkll _4t3i1osq _1bsb1osq",
|
|
22
20
|
mainContent: "_nd5l1gzg _1reo1wug _18m91wug _1e0c1txw _4t3i1osq _19121cl4",
|
|
23
|
-
panelUplift: "_1reo15vq _18m915vq",
|
|
21
|
+
panelUplift: "_1reo15vq _18m915vq _bfhkvuon",
|
|
24
22
|
unmeasured: "_evra4a59 _1lmcc53r _yv0eggl6",
|
|
25
23
|
unmeasuredWidths: "_129o1uuk _cw8k1fc5 _peezi77x _1tg31owj _1qxn1ykh _13bt1t8m",
|
|
26
24
|
managedInline: "_1uwq15vq _82e815vq _f8374a59 _1l7c1wug _vleg1orf",
|
|
27
25
|
managedOverlay: "_1uwq15vq _82e815vq _f8371m6a _vlegi47z _1l7chkll",
|
|
26
|
+
entering: "_1cro60m4 _wqfno73m",
|
|
28
27
|
panelClosed: "_f8371m6a _vlegi47z _1l7chkll"
|
|
29
28
|
};
|
|
30
29
|
/**
|
|
@@ -43,7 +42,7 @@ export function PanelLayoutShell({
|
|
|
43
42
|
panelMinWidth = 320,
|
|
44
43
|
mode,
|
|
45
44
|
layoutRef,
|
|
46
|
-
|
|
45
|
+
isMotionEnabled = false,
|
|
47
46
|
testId
|
|
48
47
|
}) {
|
|
49
48
|
const mainMinWidth = useContext(MainMinWidthContext);
|
|
@@ -54,7 +53,7 @@ export function PanelLayoutShell({
|
|
|
54
53
|
const inlineQuery = `@container local-panel-layout (min-width: ${mainMinWidth + panelMinWidth}px)`;
|
|
55
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
56
55
|
className: ax([styles.container])
|
|
57
|
-
}, mode === undefined &&
|
|
56
|
+
}, mode === undefined && isMotionEnabled && fg('platform-dst-chat-panel-layout') &&
|
|
58
57
|
/*#__PURE__*/
|
|
59
58
|
// Keep the inline motion cap available during exit, after the open-only track rule is removed.
|
|
60
59
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped query matches the SSR inline allocation, including caller-defined minimums.
|
|
@@ -91,7 +90,7 @@ export function PanelLayoutShell({
|
|
|
91
90
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
92
91
|
'--p_lclPnlCompactDefaultW': `${compactDefaultPanelWidth}px`
|
|
93
92
|
},
|
|
94
|
-
className: ax([styles.layout, mode === undefined && styles.unmeasuredWidths, mode === undefined && isPanelOpen && styles.unmeasured,
|
|
93
|
+
className: ax([styles.layout, mode === undefined && styles.unmeasuredWidths, mode === undefined && isPanelOpen && styles.unmeasured, isMotionEnabled && styles.panelUplift, mode === 'inline' && styles.managedInline, mode === 'overlay' && styles.managedOverlay, !isPanelOpen && styles.panelClosed, isPanelOpen && isMotionEnabled && styles.entering])
|
|
95
94
|
}, /*#__PURE__*/React.createElement("div", {
|
|
96
95
|
className: ax([styles.mainContent])
|
|
97
96
|
}, children), panel));
|
|
@@ -110,7 +110,7 @@ function CoordinatedPanelLayout({
|
|
|
110
110
|
panelMinWidth: panelMinWidth,
|
|
111
111
|
mode: state === null || state === void 0 ? void 0 : state.mode,
|
|
112
112
|
layoutRef: layoutRef,
|
|
113
|
-
|
|
113
|
+
isMotionEnabled: isMotionEnabled,
|
|
114
114
|
testId: testId,
|
|
115
115
|
panel: isMotionEnabled ? /*#__PURE__*/React.createElement(ExitingPersistence, null, surface) : surface
|
|
116
116
|
}, children);
|