@atlaskit/navigation-system 11.7.9 → 11.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/constellation/layout/code.mdx +8 -0
  3. package/dist/cjs/ui/page-layout/calculate-layout-area-states.js +20 -14
  4. package/dist/cjs/ui/page-layout/layout-area-sizing-provider.js +4 -1
  5. package/dist/cjs/ui/page-layout/layout-area-sizing-runtime.js +19 -6
  6. package/dist/cjs/ui/page-layout/layout-overlay-clearance.js +11 -2
  7. package/dist/cjs/ui/page-layout/local-panel-surface.compiled.css +3 -6
  8. package/dist/cjs/ui/page-layout/local-panel-surface.js +21 -14
  9. package/dist/cjs/ui/page-layout/panel-layout-shell.compiled.css +4 -2
  10. package/dist/cjs/ui/page-layout/panel-layout-shell.js +18 -16
  11. package/dist/cjs/ui/page-layout/panel-layout.js +10 -2
  12. package/dist/cjs/ui/page-layout/panel.compiled.css +1 -1
  13. package/dist/cjs/ui/page-layout/panel.js +6 -3
  14. package/dist/cjs/ui/page-layout/side-nav/side-nav.compiled.css +7 -6
  15. package/dist/cjs/ui/page-layout/side-nav/side-nav.js +8 -7
  16. package/dist/cjs/ui/page-layout/use-layout-area-sizing.js +3 -1
  17. package/dist/cjs/ui/page-layout/use-panel-content-enter.js +27 -0
  18. package/dist/es2019/ui/page-layout/calculate-layout-area-states.js +19 -14
  19. package/dist/es2019/ui/page-layout/layout-area-sizing-provider.js +4 -1
  20. package/dist/es2019/ui/page-layout/layout-area-sizing-runtime.js +17 -6
  21. package/dist/es2019/ui/page-layout/layout-overlay-clearance.js +9 -1
  22. package/dist/es2019/ui/page-layout/local-panel-surface.compiled.css +3 -6
  23. package/dist/es2019/ui/page-layout/local-panel-surface.js +21 -14
  24. package/dist/es2019/ui/page-layout/panel-layout-shell.compiled.css +4 -2
  25. package/dist/es2019/ui/page-layout/panel-layout-shell.js +20 -14
  26. package/dist/es2019/ui/page-layout/panel-layout.js +8 -2
  27. package/dist/es2019/ui/page-layout/panel.compiled.css +1 -1
  28. package/dist/es2019/ui/page-layout/panel.js +6 -3
  29. package/dist/es2019/ui/page-layout/side-nav/side-nav.compiled.css +7 -6
  30. package/dist/es2019/ui/page-layout/side-nav/side-nav.js +9 -8
  31. package/dist/es2019/ui/page-layout/use-layout-area-sizing.js +3 -1
  32. package/dist/es2019/ui/page-layout/use-panel-content-enter.js +16 -0
  33. package/dist/esm/ui/page-layout/calculate-layout-area-states.js +20 -14
  34. package/dist/esm/ui/page-layout/layout-area-sizing-provider.js +4 -1
  35. package/dist/esm/ui/page-layout/layout-area-sizing-runtime.js +19 -6
  36. package/dist/esm/ui/page-layout/layout-overlay-clearance.js +9 -1
  37. package/dist/esm/ui/page-layout/local-panel-surface.compiled.css +3 -6
  38. package/dist/esm/ui/page-layout/local-panel-surface.js +21 -14
  39. package/dist/esm/ui/page-layout/panel-layout-shell.compiled.css +4 -2
  40. package/dist/esm/ui/page-layout/panel-layout-shell.js +18 -16
  41. package/dist/esm/ui/page-layout/panel-layout.js +10 -2
  42. package/dist/esm/ui/page-layout/panel.compiled.css +1 -1
  43. package/dist/esm/ui/page-layout/panel.js +6 -3
  44. package/dist/esm/ui/page-layout/side-nav/side-nav.compiled.css +7 -6
  45. package/dist/esm/ui/page-layout/side-nav/side-nav.js +8 -7
  46. package/dist/esm/ui/page-layout/use-layout-area-sizing.js +3 -1
  47. package/dist/esm/ui/page-layout/use-panel-content-enter.js +20 -0
  48. package/dist/types/ui/page-layout/calculate-layout-area-states.d.ts +5 -1
  49. package/dist/types/ui/page-layout/layout-area-sizing-context.d.ts +1 -0
  50. package/dist/types/ui/page-layout/layout-area-sizing-runtime.d.ts +2 -1
  51. package/dist/types/ui/page-layout/layout-overlay-clearance.d.ts +1 -1
  52. package/dist/types/ui/page-layout/panel-layout-shell.d.ts +5 -3
  53. package/dist/types/ui/page-layout/panel-layout.d.ts +8 -1
  54. package/dist/types/ui/page-layout/use-panel-content-enter.d.ts +5 -0
  55. package/package.json +11 -7
@@ -5,7 +5,6 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { useContext, useId } from 'react';
7
7
  import { fg } from '@atlaskit/platform-feature-flags/fg';
8
- import { LayoutOverlayClearance } from './layout-overlay-clearance';
9
8
  import { MainMinWidthContext } from './main-min-width-context';
10
9
 
11
10
  // The grid uses runtime CSS variables and container sizing outside @atlaskit/css's bounded values.
@@ -13,19 +12,19 @@ var localPanelTrackWidthVar = '--p_lclPnlTrackW';
13
12
  var localPanelResizingVar = '--p_lclPnlRsz';
14
13
  var localPanelMinWidthVar = '--p_lclPnlMinW';
15
14
 
16
- // Holds the single-column (closed) grid while the entering panel overlays `main`. With `backwards` fill
17
- // the `from` frame applies for the animation delay, then the real inline grid takes over. An animation
18
- // (rather than a transition) only starts when the class is added, so live resizing is never delayed.
19
- var holdClosedGrid = null;
15
+ // One CSS animation holds both the grid and its surface placement until the layout snap.
16
+ // Identical keyframes keep the layout static; normal styles take over at 60ms.
17
+ var holdPanelTrack = null;
20
18
  var styles = {
21
- panelEntering: "_1croukkr _wqfn147i _sl5p1ign _dqw8eoah",
22
19
  container: "_1f38177r _7cca15wb _4t3i1osq _1bsb1osq",
23
20
  layout: "_1reo1wug _18m91wug _1e0c11p5 _7cca15wb _1lmc1m6a _yv0ei47z _2z05hkll _4t3i1osq _1bsb1osq",
24
21
  mainContent: "_nd5l1gzg _1reo1wug _18m91wug _1e0c1txw _4t3i1osq _19121cl4",
25
- panelUplift: "_1reo15vq _18m915vq",
26
- unmeasured: "_evra4a59 _1lmcc53r _yv0eggl6 _129o1uuk _cw8k1fc5 _peezi77x _1tg31owj",
22
+ panelUplift: "_1reo15vq _18m915vq _bfhkvuon",
23
+ unmeasured: "_evra4a59 _1lmcc53r _yv0eggl6",
24
+ unmeasuredWidths: "_129o1uuk _cw8k1fc5 _peezi77x _1tg31owj _1qxn1ykh _13bt1t8m",
27
25
  managedInline: "_1uwq15vq _82e815vq _f8374a59 _1l7c1wug _vleg1orf",
28
26
  managedOverlay: "_1uwq15vq _82e815vq _f8371m6a _vlegi47z _1l7chkll",
27
+ entering: "_1cro60m4 _wqfno73m",
29
28
  panelClosed: "_f8371m6a _vlegi47z _1l7chkll"
30
29
  };
31
30
  /**
@@ -37,14 +36,16 @@ export function PanelLayoutShell(_ref) {
37
36
  isPanelOpen = _ref.isPanelOpen,
38
37
  panelWidth = _ref.panelWidth,
39
38
  compactPanelWidth = _ref.compactPanelWidth,
39
+ xlPanelWidth = _ref.xlPanelWidth,
40
+ xlDefaultPanelWidth = _ref.xlDefaultPanelWidth,
40
41
  defaultPanelWidth = _ref.defaultPanelWidth,
41
42
  compactDefaultPanelWidth = _ref.compactDefaultPanelWidth,
42
43
  _ref$panelMinWidth = _ref.panelMinWidth,
43
44
  panelMinWidth = _ref$panelMinWidth === void 0 ? 320 : _ref$panelMinWidth,
44
45
  mode = _ref.mode,
45
46
  layoutRef = _ref.layoutRef,
46
- _ref$shouldClipOverfl = _ref.shouldClipOverflow,
47
- shouldClipOverflow = _ref$shouldClipOverfl === void 0 ? false : _ref$shouldClipOverfl,
47
+ _ref$isMotionEnabled = _ref.isMotionEnabled,
48
+ isMotionEnabled = _ref$isMotionEnabled === void 0 ? false : _ref$isMotionEnabled,
48
49
  testId = _ref.testId;
49
50
  var mainMinWidth = useContext(MainMinWidthContext);
50
51
  var id = "local-panel-".concat(useId().replace(/[^a-zA-Z0-9_-]/g, '_'));
@@ -54,18 +55,19 @@ export function PanelLayoutShell(_ref) {
54
55
  var inlineQuery = "@container local-panel-layout (min-width: ".concat(mainMinWidth + panelMinWidth, "px)");
55
56
  return /*#__PURE__*/React.createElement("div", {
56
57
  className: ax([styles.container])
57
- }, mode === undefined && isPanelOpen && fg('platform-dst-chat-panel-layout') && /*#__PURE__*/React.createElement(LayoutOverlayClearance, {
58
- panelMinWidth: panelMinWidth,
59
- mainMinWidth: mainMinWidth
60
- }), mode === undefined && isPanelOpen &&
58
+ }, mode === undefined && isMotionEnabled && fg('platform-dst-chat-panel-layout') &&
59
+ /*#__PURE__*/
60
+ // Keep the inline motion cap available during exit, after the open-only track rule is removed.
61
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped query matches the SSR inline allocation, including caller-defined minimums.
62
+ React.createElement("style", null, "".concat(inlineQuery, " {\n\t\t\t\t\t#").concat(id, " { --p_lclPnlMotionMaxW: calc(100cqw - ").concat(mainMinWidth, "px); }\n\t\t\t\t}")), mode === undefined && isPanelOpen &&
61
63
  /*#__PURE__*/
62
64
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped SSR query supports caller-defined minimums; CSS variables are not allowed in query conditions.
63
65
  React.createElement("style", null, "".concat(inlineQuery, " {\n\t\t\t\t\t#").concat(id, " {\n\t\t\t\t\t\t--p_lclPnlSsrAreas: var(--p_lclPnlSsrInlineAreas);\n\t\t\t\t\t\t--p_lclPnlSsrColumns: minmax(0, 1fr) min(var(--p_lclPnlSsrPreferredW), calc(100% - ").concat(mainMinWidth, "px));\n\t\t\t\t\t\t--p_lclPnlSsrArea: panel;\n\t\t\t\t\t\t--p_lclPnlSsrWidth: 100%;\n\t\t\t\t\t\t--p_lclPnlSsrBackground: ", "var(--ds-surface, #FFFFFF)", ";\n\t\t\t\t\t\t--p_lclPnlSsrShadow: none;\n\t\t\t\t\t\t--p_lclPnlSsrBorder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #0B120E24)", ";\n\t\t\t\t\t}\n\t\t\t\t}")), /*#__PURE__*/React.createElement("div", {
64
66
  id: id,
65
67
  "data-testid": testId,
66
68
  ref: layoutRef,
67
- style: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, localPanelTrackWidthVar, "".concat(panelWidth, "px")), localPanelMinWidthVar, "".concat(panelMinWidth, "px")), '--p_lclPnlCompactW', "".concat(compactPanelWidth, "px")), '--p_lclPnlDefaultW', "".concat(defaultPanelWidth, "px")), '--p_lclPnlCompactDefaultW', "".concat(compactDefaultPanelWidth, "px")),
68
- className: ax([styles.layout, mode === undefined && isPanelOpen && styles.unmeasured, shouldClipOverflow && styles.panelUplift, mode === 'inline' && styles.managedInline, shouldClipOverflow && isPanelOpen && (mode === undefined || mode === 'inline') && styles.panelEntering, mode === 'overlay' && styles.managedOverlay, !isPanelOpen && styles.panelClosed])
69
+ style: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, 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")),
70
+ 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])
69
71
  }, /*#__PURE__*/React.createElement("div", {
70
72
  className: ax([styles.mainContent])
71
73
  }, children), panel));
@@ -14,7 +14,7 @@ import { useLayoutAreaSizing } from './use-layout-area-sizing';
14
14
  // Development-only ownership checks are scoped to each coordinator, not the whole page.
15
15
  var mountedPanelLayouts = new WeakSet();
16
16
  function CoordinatedPanelLayout(_ref) {
17
- var _ref2, _state$width;
17
+ var _ref2, _ref3, _state$width;
18
18
  var children = _ref.children,
19
19
  panel = _ref.panel,
20
20
  isPanelOpen = _ref.isPanelOpen,
@@ -22,6 +22,7 @@ function CoordinatedPanelLayout(_ref) {
22
22
  panelWidth = _ref.panelWidth,
23
23
  defaultPanelWidth = _ref.defaultPanelWidth,
24
24
  compactDefaultPanelWidth = _ref.compactDefaultPanelWidth,
25
+ xlDefaultPanelWidth = _ref.xlDefaultPanelWidth,
25
26
  suppliedMinWidth = _ref.panelMinWidth,
26
27
  panelMaxWidth = _ref.panelMaxWidth,
27
28
  onPanelWidthChange = _ref.onPanelWidthChange,
@@ -52,6 +53,9 @@ function CoordinatedPanelLayout(_ref) {
52
53
  var _useState5 = useState((_ref2 = compactDefaultPanelWidth !== null && compactDefaultPanelWidth !== void 0 ? compactDefaultPanelWidth : defaultPanelWidth) !== null && _ref2 !== void 0 ? _ref2 : fg('platform-dst-chat-panel-layout') ? defaults.compactPanelWidth : panelWidth !== null && panelWidth !== void 0 ? panelWidth : defaults.compactPanelWidth),
53
54
  _useState6 = _slicedToArray(_useState5, 1),
54
55
  compactWidth = _useState6[0];
56
+ var _useState7 = useState(fg('platform-dst-chat-panel-layout') ? (_ref3 = xlDefaultPanelWidth !== null && xlDefaultPanelWidth !== void 0 ? xlDefaultPanelWidth : defaultPanelWidth) !== null && _ref3 !== void 0 ? _ref3 : 500 : defaultWidth),
57
+ _useState8 = _slicedToArray(_useState7, 1),
58
+ xlWidth = _useState8[0];
55
59
  // Use the controlled request before measurement too, without changing the mount-time default.
56
60
  var fallbackWidth = Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : defaultWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity));
57
61
  var _useLayoutAreaSizing = useLayoutAreaSizing({
@@ -61,6 +65,7 @@ function CoordinatedPanelLayout(_ref) {
61
65
  requestedWidth: panelWidth,
62
66
  defaultWidth: defaultWidth,
63
67
  compactDefaultWidth: compactWidth,
68
+ xlDefaultWidth: xlWidth,
64
69
  minWidth: panelMinWidth,
65
70
  maxWidth: panelMaxWidth
66
71
  }
@@ -107,12 +112,14 @@ function CoordinatedPanelLayout(_ref) {
107
112
  isPanelOpen: isPanelOpen,
108
113
  panelWidth: (_state$width = state === null || state === void 0 ? void 0 : state.width) !== null && _state$width !== void 0 ? _state$width : fallbackWidth,
109
114
  defaultPanelWidth: defaultWidth,
115
+ xlDefaultPanelWidth: xlWidth,
116
+ xlPanelWidth: Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : xlWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity)),
110
117
  compactDefaultPanelWidth: compactWidth,
111
118
  compactPanelWidth: Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : compactWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity)),
112
119
  panelMinWidth: panelMinWidth,
113
120
  mode: state === null || state === void 0 ? void 0 : state.mode,
114
121
  layoutRef: layoutRef,
115
- shouldClipOverflow: isMotionEnabled,
122
+ isMotionEnabled: isMotionEnabled,
116
123
  testId: testId,
117
124
  panel: isMotionEnabled ? /*#__PURE__*/React.createElement(ExitingPersistence, null, surface) : surface
118
125
  }, children);
@@ -142,6 +149,7 @@ export function PanelLayout(props) {
142
149
  panelWidth: props.panelWidth,
143
150
  defaultPanelWidth: props.defaultPanelWidth,
144
151
  compactDefaultPanelWidth: props.compactDefaultPanelWidth,
152
+ xlDefaultPanelWidth: props.xlDefaultPanelWidth,
145
153
  panelMinWidth: props.panelMinWidth,
146
154
  panelMaxWidth: props.panelMaxWidth,
147
155
  onPanelWidthChange: props.onPanelWidthChange,
@@ -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){._k1af14vv{animation:var(--ds-panel-exit-right,.2s cubic-bezier(0,.4,0,1) SlideOut100PercentRight)}[dir=rtl] ._105aeydr{animation:var(--ds-panel-exit-left,.2s cubic-bezier(0,.4,0,1) SlideOut100PercentLeft)}._10t81ia4{transition-property:position}._xrrp147i{transition-duration:var(--ds-duration-instant,0ms)}._1wsa1jkh{transition-delay:19ms}._1vrh1a5r{transition-behavior:allow-discrete}._bq641n9t{position:fixed}@starting-style{._1kmh1n9t{position:fixed}}._k1af1nn1{animation:var(--ds-panel-enter-right,.25s cubic-bezier(0,.4,0,1) SlideIn100PercentRight)}._1wsa4so3{transition-delay:24ms}[dir=rtl] ._105abamb{animation:var(--ds-panel-enter-left,.25s cubic-bezier(0,.4,0,1) SlideIn100PercentLeft)}}
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}}
@@ -19,6 +19,7 @@ import { DangerouslyHoistSlotSizes } from './hoist-slot-sizes-context';
19
19
  import { PanelSplitterProvider } from './panel-splitter/provider';
20
20
  import { useSideNavRef } from './side-nav/use-side-nav-ref';
21
21
  import { useLayoutId } from './use-layout-id';
22
+ import { usePanelContentEnter } from './use-panel-content-enter';
22
23
  import { useResizingWidthCssVarOnRootElement } from './use-resizing-width-css-var-on-root-element';
23
24
  import { useSafeDefaultWidth } from './use-safe-default-width';
24
25
  var panelSplitterResizingVar = '--n_pnlRsz';
@@ -36,9 +37,10 @@ var styles = {
36
37
  border: "_191wglyw _16qs130s _1w6eia51 _scbpglyw",
37
38
  scrollContainer: "_1reo1wug _18m91wug _4t3i1osq",
38
39
  hidden: "_1e0cglyw",
39
- entering: "_k1af1nn1 _10t81ia4 _xrrp147i _1wsa4so3 _1vrh1a5r _1kmh1n9t _105abamb",
40
- exiting: "_k1af14vv _10t81ia4 _xrrp147i _1wsa1jkh _1vrh1a5r _bq641n9t _105aeydr",
40
+ entering: "_k1afx3bs _10t81ia4 _xrrp147i _1wsa1ja5 _1vrh1a5r _1kmh1n9t _105az3zp",
41
+ exiting: "_k1afry0p _bq641n9t _105a97o5",
41
42
  contentEntering: "_y44v1mph",
43
+ contentEnteringOnOpen: "_k1afi8w4",
42
44
  contentExiting: "_y44vf1qi",
43
45
  contentChangeContainer: "_4t3i1osq"
44
46
  };
@@ -106,6 +108,7 @@ export function Panel(_ref2) {
106
108
  state = _useMotion2.state,
107
109
  motionRef = _useMotion2.ref,
108
110
  reanimate = _useMotion2.reanimate;
111
+ var shouldAnimateContentEnter = usePanelContentEnter(state);
109
112
 
110
113
  /**
111
114
  * Don't show the skip link if the slot has 0 width.
@@ -236,7 +239,7 @@ export function Panel(_ref2) {
236
239
  resizingCssVar: panelSplitterResizingVar,
237
240
  position: "start"
238
241
  }, /*#__PURE__*/React.createElement("div", {
239
- className: ax([styles.scrollContainer, isMotionUpliftEnabled && state === 'entering' && styles.contentEntering, isMotionUpliftEnabled && state === 'exiting' && styles.contentExiting])
242
+ className: ax([styles.scrollContainer, isMotionUpliftEnabled && shouldAnimateContentEnter && styles.contentEnteringOnOpen, isMotionUpliftEnabled && state === 'exiting' && styles.contentExiting])
240
243
  }, isContentMotionEnabled ? /*#__PURE__*/React.createElement(ExitingPersistence, {
241
244
  exitThenEnter: contentKey !== undefined
242
245
  }, /*#__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
- ._1p2s1vfh{--exit-animation:var(--ds-sidenav-exit-left,200ms cubic-bezier(0,0.4,0,1) SlideOut100PercentLeft)}
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
- ._cjprp6j8{--enter-animation:var(--ds-sidenav-enter-left,250ms cubic-bezier(0,0.4,0,1) SlideIn100PercentLeft)}
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] ._1jq41dy6{--enter-animation:var(--ds-sidenav-enter-right,250ms cubic-bezier(0,0.4,0,1) SlideIn100PercentRight)}
19
- [dir=rtl] ._2qe0jwwr{--exit-animation:var(--ds-sidenav-exit-right,200ms cubic-bezier(0,0.4,0,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)}._1lh81gzg{grid-area:main}._k1affm5y{animation:var(--exit-animation)}._k1af10ed{animation:var(--enter-animation)}}
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)}._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}}
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}}}
@@ -123,20 +123,20 @@ var styles = {
123
123
  * with `@starting-style` used by `styles`.
124
124
  *
125
125
  * ⚠️ The `transition-duration` values below need to stay in sync with the duration baked into the tokens
126
- * (`motion.sidenav.enter.*` is 250ms, `motion.sidenav.exit.*` is 200ms). The `display` property is
126
+ * (`motion.sidenav.enter.*` and `motion.sidenav.exit.*` are both 200ms). The `display` property is
127
127
  * transitioned (with `allow-discrete`) so the element stays rendered for the length of the exit animation —
128
128
  * if the transition is shorter than the animation, `display: none` applies early and the exit animation
129
129
  * never runs.
130
130
  */
131
131
  var motionUpliftStyles = {
132
- animationRTLSupport: "_cjprp6j8 _1p2s1vfh _1jq41dy6 _2qe0jwwr",
132
+ animationRTLSupport: "_cjprbksg _1p2s1v7a _1jq4125i _2qe01hl6",
133
133
  animationBaseStyles: "_10t81t0s _1vrh1a5r _xrrpi9qs",
134
- expandAnimationMobile: "_k1af10ed",
135
- collapseAnimationMobile: "_1lh81gzg _k1affm5y",
134
+ expandAnimationMobile: "_nobw10ed",
135
+ collapseAnimationMobile: "_ycjn1gzg _nobwfm5y",
136
136
  flyoutOpen: "_qiln1gzg _p5clglyw _4ap31bhr _scbp130s _4xci10ed _1tpv1mzy _sylc1a5r",
137
137
  flyoutAnimateClosed: "_1e0cglyw _qiln1gzg _4xcifm5y _1tpvi9qs _sylc1a5r",
138
- expandAnimationDesktop: "_1sg8k0mc _n2in10ed _1xpz1gzg _17ly1q8v _hjoi147i _1wxo4so3",
139
- collapseAnimationDesktop: "_1sg81gzg _n2infm5y _17ly1wzp _hjoi1wsm _1wxo1cio"
138
+ expandAnimationDesktop: "_1sg8k0mc _n2in10ed _1xpz1gzg _17ly1q8v _hjoi147i _1wxo1ja5",
139
+ collapseAnimationDesktop: "_1sg81gzg _n2infm5y _17ly1wzp _hjoi1wsm _1wxo147i"
140
140
  };
141
141
  var fallbackDefaultWidth = 320;
142
142
  export var onPeekStartDelayMs = 500;
@@ -998,8 +998,9 @@ function SideNavInternal(_ref4) {
998
998
  }), isChatPanelLayoutEnabled &&
999
999
  /*#__PURE__*/
1000
1000
  // CSS reserves only the nav minimum for chat's fit decision, before effects or lazy loading.
1001
+ // Motion owns grid-area so this ID selector cannot override the entrance or exit snap.
1001
1002
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles
1002
- React.createElement("style", null, "\n#".concat(gridRootFitId, " { --n_clearanceNavMin: 0px; --n_clearanceNavTarget: ").concat(clampedWidth, "; }\n#").concat(gridRootChatFitId, " { --n_fitNav: 0px; }\n@media (min-width: 64rem) {\n #").concat(gridRootFitId, " { --n_clearanceNavMin: ").concat(isExpandedOnDesktop ? minWidth : '0px', "; }\n}\n").concat(shouldApplyUnmanagedSizing ? "#".concat(gridRootId, " nav[data-layout-slot] { grid-area: main / aside / aside / aside; width: min(90%, ").concat(clampedWidth, "); }") : '', "\n@media (min-width: 64rem) {\n #").concat(gridRootChatFitId, " { --n_fitNav: ").concat(isExpandedOnDesktop ? minWidth : '0px', "; }\n ").concat(shouldApplyUnmanagedSizing ? "#".concat(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.createElement(DangerouslyHoistCssVarToDocumentRoot, {
1003
+ React.createElement("style", null, "\n#".concat(gridRootFitId, " { --n_clearanceNavMin: 0px; --n_clearanceNavTarget: ").concat(clampedWidth, "; }\n#").concat(gridRootChatFitId, " { --n_fitNav: 0px; }\n@media (min-width: 64rem) {\n #").concat(gridRootFitId, " { --n_clearanceNavMin: ").concat(isExpandedOnDesktop ? minWidth : '0px', "; }\n}\n").concat(shouldApplyUnmanagedSizing ? "#".concat(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(gridRootChatFitId, " { --n_fitNav: ").concat(isExpandedOnDesktop ? minWidth : '0px', "; }\n ").concat(shouldApplyUnmanagedSizing ? "#".concat(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.createElement(DangerouslyHoistCssVarToDocumentRoot, {
1003
1004
  variableName: sideNavLiveWidthVar,
1004
1005
  value: "0px",
1005
1006
  mediaQuery: '@media (min-width: 64rem)',
@@ -8,6 +8,7 @@ export function useLayoutAreaSizing(_ref) {
8
8
  var requestedWidth = config.requestedWidth,
9
9
  defaultWidth = config.defaultWidth,
10
10
  compactDefaultWidth = config.compactDefaultWidth,
11
+ xlDefaultWidth = config.xlDefaultWidth,
11
12
  minWidth = config.minWidth,
12
13
  maxWidth = config.maxWidth,
13
14
  isOpen = config.isOpen,
@@ -34,12 +35,13 @@ export function useLayoutAreaSizing(_ref) {
34
35
  requestedWidth: requestedWidth,
35
36
  defaultWidth: defaultWidth,
36
37
  compactDefaultWidth: compactDefaultWidth,
38
+ xlDefaultWidth: xlDefaultWidth,
37
39
  minWidth: minWidth,
38
40
  maxWidth: maxWidth,
39
41
  isOpen: isOpen,
40
42
  onRequestClose: requestClose
41
43
  });
42
- }, [area, compactDefaultWidth, defaultWidth, isOpen, maxWidth, minWidth, registerArea, requestClose, requestedWidth]);
44
+ }, [area, compactDefaultWidth, xlDefaultWidth, defaultWidth, isOpen, maxWidth, minWidth, registerArea, requestClose, requestedWidth]);
43
45
  useEffect(function () {
44
46
  return function () {
45
47
  return unregisterArea === null || unregisterArea === void 0 ? void 0 : unregisterArea(area);
@@ -0,0 +1,20 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import { useEffect, useState } from 'react';
3
+ /**
4
+ * Keep the delayed content fade attached after the shorter panel slide finishes.
5
+ */
6
+ export function usePanelContentEnter(state) {
7
+ var _useState = useState(state === 'entering'),
8
+ _useState2 = _slicedToArray(_useState, 2),
9
+ hasEntered = _useState2[0],
10
+ setHasEntered = _useState2[1];
11
+ useEffect(function () {
12
+ if (state !== 'visible') {
13
+ setHasEntered(state === 'entering');
14
+ }
15
+ }, [state]);
16
+
17
+ // Exit/hidden removes the animation so reopening starts a fresh fade. A panel
18
+ // initially mounted as visible should not gain an entrance animation.
19
+ return state === 'entering' || state === 'visible' && hasEntered;
20
+ }
@@ -1,5 +1,5 @@
1
1
  import type { LayoutArea, LayoutAreaAllocation, LayoutAreaMode, LayoutWidthBound, ResizeSession, StoredLayoutArea } from './layout-area-sizing-context';
2
- export declare function calculateLayoutAreaStates({ viewportWidth, layoutWidth, isChatPanelOverlay, isSideNavOverlay, occupiedWidth, mainMinWidth: mainMinWidthBound, areas, resizeSession, initialModes, }: {
2
+ export declare function calculateLayoutAreaStates({ viewportWidth, layoutWidth, isChatPanelOverlay, isSideNavOverlay, isXlViewport, occupiedWidth, mainMinWidth: mainMinWidthBound, areas, resizeSession, initialModes, }: {
3
3
  viewportWidth: number;
4
4
  /**
5
5
  * Root's content width, excluding scrollbars, borders and padding.
@@ -13,6 +13,10 @@ export declare function calculateLayoutAreaStates({ viewportWidth, layoutWidth,
13
13
  * Whether the viewport is below Root and SideNav's 64rem desktop breakpoint.
14
14
  */
15
15
  isSideNavOverlay: boolean;
16
+ /**
17
+ * Whether the viewport matches the 110.5rem XL breakpoint.
18
+ */
19
+ isXlViewport?: boolean;
16
20
  occupiedWidth?: number;
17
21
  mainMinWidth: LayoutWidthBound;
18
22
  areas: Partial<Record<LayoutArea, StoredLayoutArea>>;
@@ -10,6 +10,7 @@ export type LayoutAreaConfig = {
10
10
  requestedWidth?: number;
11
11
  defaultWidth: number;
12
12
  compactDefaultWidth?: number;
13
+ xlDefaultWidth?: number;
13
14
  minWidth: LayoutWidthBound;
14
15
  maxWidth?: LayoutWidthBound;
15
16
  isOpen: boolean;
@@ -1,8 +1,9 @@
1
1
  import React, { type ReactNode } from 'react';
2
2
  import { type LayoutArea, type LayoutAreaState, type LayoutAreaSizingContextValue } from './layout-area-sizing-context';
3
- export declare function LayoutAreaSizingRuntime({ children, layoutRef, onReady, onUpdate, }: {
3
+ export declare function LayoutAreaSizingRuntime({ children, layoutRef, onReady, onUpdate, viewportWidthAtLoad, }: {
4
4
  children?: ReactNode;
5
5
  layoutRef?: React.RefObject<HTMLDivElement | null>;
6
+ viewportWidthAtLoad?: number;
6
7
  onReady?: (actions: LayoutAreaSizingContextValue | null) => void;
7
8
  onUpdate?: (states: Partial<Record<LayoutArea, LayoutAreaState>>) => void;
8
9
  }): JSX.Element;
@@ -6,4 +6,4 @@
6
6
  export declare function LayoutOverlayClearance({ panelMinWidth, mainMinWidth, }: {
7
7
  panelMinWidth: number;
8
8
  mainMinWidth: number;
9
- }): JSX.Element;
9
+ }): JSX.Element | null;
@@ -22,6 +22,8 @@ type PanelLayoutShellProps = {
22
22
  */
23
23
  panelWidth: number;
24
24
  compactPanelWidth: number;
25
+ xlPanelWidth: number;
26
+ xlDefaultPanelWidth: number;
25
27
  /**
26
28
  * Mount-time defaults determine the overlay cap independently of saved widths.
27
29
  */
@@ -40,13 +42,13 @@ type PanelLayoutShellProps = {
40
42
  */
41
43
  layoutRef?: MutableRefObject<HTMLDivElement | null>;
42
44
  /**
43
- * Clips the layout during panel motion.
45
+ * Enables coordinated panel motion and clips the sliding surface.
44
46
  */
45
- shouldClipOverflow?: boolean;
47
+ isMotionEnabled?: boolean;
46
48
  testId?: string;
47
49
  };
48
50
  /**
49
51
  * Grid and scrolling for Main and its local panel. Use inside navigation's Root and Main.
50
52
  */
51
- export declare function PanelLayoutShell({ children, panel, isPanelOpen, panelWidth, compactPanelWidth, defaultPanelWidth, compactDefaultPanelWidth, panelMinWidth, mode, layoutRef, shouldClipOverflow, testId, }: PanelLayoutShellProps): JSX.Element;
53
+ export declare function PanelLayoutShell({ children, panel, isPanelOpen, panelWidth, compactPanelWidth, xlPanelWidth, xlDefaultPanelWidth, defaultPanelWidth, compactDefaultPanelWidth, panelMinWidth, mode, layoutRef, isMotionEnabled, testId, }: PanelLayoutShellProps): JSX.Element;
52
54
  export {};
@@ -25,7 +25,8 @@ export type PanelLayoutProps = {
25
25
  panelWidth?: number;
26
26
  /**
27
27
  * Initial preferred width in pixels; subsequent changes are ignored.
28
- * Defaults to 365, or 400 with chat layout enabled.
28
+ * Defaults to 365, or 400 with chat layout enabled (500 at XL and above).
29
+ * An explicit value also supplies the compact and XL defaults unless separately overridden.
29
30
  * After a user resize, one preferred width is retained across inline and overlay modes.
30
31
  * Available space can constrain the rendered width without overwriting that preference.
31
32
  */
@@ -35,6 +36,12 @@ export type PanelLayoutProps = {
35
36
  * Used only until a controlled width or user resize supplies a preference.
36
37
  */
37
38
  compactDefaultPanelWidth?: number;
39
+ /**
40
+ * Default at XL viewports (110.5rem / 1768px and above), with chat layout enabled.
41
+ * Defaults to 500, or an explicitly supplied defaultPanelWidth.
42
+ * Captured on mount; controlled and user-resized widths take precedence.
43
+ */
44
+ xlDefaultPanelWidth?: number;
38
45
  /**
39
46
  * Minimum width in pixels. Defaults to 320. With chat layout enabled, overlays retain this minimum.
40
47
  */
@@ -0,0 +1,5 @@
1
+ import type { useMotion } from '@atlaskit/motion/entering/use-motion';
2
+ /**
3
+ * Keep the delayed content fade attached after the shorter panel slide finishes.
4
+ */
5
+ export declare function usePanelContentEnter(state: ReturnType<typeof useMotion>['state']): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "11.7.9",
3
+ "version": "11.8.1",
4
4
  "description": "The latest navigation system for Atlassian apps.",
5
5
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
6
6
  "license": "Apache-2.0",
@@ -59,7 +59,7 @@
59
59
  "dependencies": {
60
60
  "@atlaskit/analytics-next": "^12.6.0",
61
61
  "@atlaskit/app-provider": "^8.3.0",
62
- "@atlaskit/avatar": "^30.1.0",
62
+ "@atlaskit/avatar": "^31.0.0",
63
63
  "@atlaskit/button": "^25.8.0",
64
64
  "@atlaskit/css": "^1.1.0",
65
65
  "@atlaskit/ds-lib": "^8.0.0",
@@ -74,9 +74,9 @@
74
74
  "@atlaskit/primitives": "^22.7.0",
75
75
  "@atlaskit/react-compiler-gating": "^0.2.0",
76
76
  "@atlaskit/side-nav-items": "^2.6.0",
77
- "@atlaskit/tokens": "^20.12.0",
77
+ "@atlaskit/tokens": "^20.13.0",
78
78
  "@atlaskit/tooltip": "^24.4.0",
79
- "@atlaskit/top-layer": "^8.0.0",
79
+ "@atlaskit/top-layer": "^8.1.0",
80
80
  "@atlaskit/visually-hidden": "^4.4.0",
81
81
  "@babel/runtime": "^7.0.0",
82
82
  "@compiled/react": "^1.0.2",
@@ -123,10 +123,10 @@
123
123
  "@atlaskit/tabs": "^21.3.0",
124
124
  "@atlaskit/tag": "^17.1.0",
125
125
  "@atlaskit/textarea": "^10.3.0",
126
- "@atlaskit/textfield": "^10.3.0",
127
- "@atlassian/feature-flags-test-utils": "^1.3.0",
126
+ "@atlaskit/textfield": "^11.0.0",
127
+ "@atlassian/feature-flags-test-utils": "^2.0.0",
128
128
  "@atlassian/gemini": "^1.55.0",
129
- "@atlassian/panel-system": "^2.2.0",
129
+ "@atlassian/panel-system": "^2.3.0",
130
130
  "@atlassian/react-async": "^0.23.0",
131
131
  "@atlassian/react-entrypoint": "^1.1.0",
132
132
  "@atlassian/relay-test-utils": "workspace:^",
@@ -137,6 +137,7 @@
137
137
  "@atlassian/universal-create": "^8.8.0",
138
138
  "@atlassian/workbench": "workspace:^",
139
139
  "@axe-core/playwright": "^4.11.1",
140
+ "@testing-library/react": "^16.3.0",
140
141
  "raf-stub": "^2.0.1",
141
142
  "react": "^18.2.0",
142
143
  "react-dom": "^18.2.0",
@@ -174,6 +175,9 @@
174
175
  "type": "boolean",
175
176
  "referenceOnly": true
176
177
  },
178
+ "platform-dst-motion-uplift-panel-content": {
179
+ "type": "boolean"
180
+ },
177
181
  "platform_dst_ads_appswitcher_improvements": {
178
182
  "type": "boolean",
179
183
  "referenceOnly": true