@atlaskit/navigation-system 10.5.2 → 10.5.4

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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlassian/navigation-system
2
2
 
3
+ ## 10.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`88a1176b97a25`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/88a1176b97a25) -
8
+ Internal TypeScript typecheck fixes for ts7 (tsgo) adoption. No functional or API changes.
9
+ - Updated dependencies
10
+
11
+ ## 10.5.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [`f2ec2ee8b495e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2ec2ee8b495e) -
16
+ Update `@atlaskit/spotlight` imports to use de-barrelled entry-points.
17
+ - [`5d91339612c3b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5d91339612c3b) -
18
+ Fix side nav rendering in the wrong grid area under streaming SSR, where Compiled could emit the
19
+ mobile and desktop `grid-area` atomic rules out of order. The mobile rule is now scoped to
20
+ `@media not (min-width: 64rem)` so it can never conflict with the desktop rule. Behind the
21
+ `platform_dst_nav4_side_nav_grid_area_fix` feature gate.
22
+ - Updated dependencies
23
+
3
24
  ## 10.5.2
4
25
 
5
26
  ### Patch Changes
@@ -48,7 +48,7 @@ function focusElement(element) {
48
48
  element.focus({
49
49
  // Forces the focus ring to appear after moving focus to the slot
50
50
  // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#focusvisible
51
- // @ts-expect-error - new and not in types yet
51
+ // @ts-ignore - new and not in types yet. Can be removed once we adopt ts7.
52
52
  focusVisible: true
53
53
  });
54
54
  }
@@ -25,4 +25,5 @@
25
25
  @media (min-width:64rem){._165t56xv{height:calc(100vh - var(--n_bnrM, 0px))}._p0az1elq{transform:translateX(calc(var(--n_snvRsz, var(--n_snvW, 0px)) - var(--ds-border-width, 1px)))}._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}}
26
26
  @media (prefers-reduced-motion:no-preference) and (min-width:64rem){._17ly8iot{transition-property:transform,display}._177m1a5r{transition-behavior:allow-discrete}._1sg81gzg{grid-area:main}._vgub1mm8{transition-timing-function:cubic-bezier(0,.4,0,1)}._hh1u1p9u{transform:translateX(calc(-100%*var(--animation-direction)))}@starting-style{._s2eg1p9u{transform:translateX(calc(-100%*var(--animation-direction)))}}._1sg8k0mc{grid-area:side-nav}._vgub1ku9{transition-timing-function:cubic-bezier(.6,0,0,1)}._hjoifnf5{transition-duration:.2s}}
27
27
  @media (prefers-reduced-motion:no-preference) and (not (min-width:64rem)){._aadi1p9u{transform:translateX(calc(-100%*var(--animation-direction)))}}
28
+ @media not (min-width:64rem){._89fi1b6c{grid-area:main/aside/aside/aside}}
28
29
  @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}}}
@@ -70,7 +70,7 @@ var panelSplitterPortalTargetStyles = {
70
70
  root: "_kqsw1n9t _1pbyegat _u7coidpf _t9ectl5p _4t3ieqxy _165t56xv _p0az1elq"
71
71
  };
72
72
  var styles = {
73
- root: "_nd5l1b6c _191wglyw _t51zglyw _bfhk1bhr _16qs130s _vchhusvi _4t3ieqxy _152timx3 _kqsw1if8 _1bsb1ego _1pbycs5v _14b5hc79 _qilnk0mc _p5clia51 _4ap3vuon _scbpglyw",
73
+ root: "_191wglyw _t51zglyw _bfhk1bhr _16qs130s _vchhusvi _4t3ieqxy _152timx3 _kqsw1if8 _1bsb1ego _1pbycs5v _14b5hc79 _qilnk0mc _p5clia51 _4ap3vuon _scbpglyw",
74
74
  flyoutOpen: "_qiln1gzg _p5clglyw _4ap31bhr _scbp130s _139f8iot _1tpvfnf5 _sylc1a5r _oyeijq3t",
75
75
  flyoutAnimateClosed: "_1e0cglyw _qiln1gzg _139f8iot _1tpvfnf5 _sylc1a5r _1uwsjq3t",
76
76
  animationRTLSupport: "_15yekb7n _65m41mrw",
@@ -87,6 +87,37 @@ var styles = {
87
87
  expandAnimationDesktop: "_1sg8k0mc _vgub1ku9 _s2eg1p9u",
88
88
  collapseAnimationDesktop: "_1sg81gzg _vgub1mm8 _hh1u1p9u"
89
89
  };
90
+
91
+ /**
92
+ * Workaround for non-deterministic Compiled style ordering in local development. See MAGMA-4606.
93
+ *
94
+ * The mobile `grid-area` for the side nav, split out from `styles.root` so it can be gated. The
95
+ * desktop rule (`gridArea: 'side-nav'`) lives in `styles.root` inside `@media (min-width: 64rem)`.
96
+ *
97
+ * Why this is needed:
98
+ * The mobile rule (unscoped) and the desktop rule (`@media (min-width: 64rem)`) compile to two atomic
99
+ * rules of equal specificity — a `@media` query adds no specificity — so at desktop widths the winner
100
+ * is decided purely by stylesheet insertion order (last wins). In production this is fine: Compiled's
101
+ * stylesheet extraction sorts the media queries deterministically. But in local development stylesheet
102
+ * extraction is disabled (https://github.com/atlassian-labs/compiled/issues/1306), so styles are
103
+ * injected as inline `<style>` tags in whatever order components happen to render. Under streaming SSR
104
+ * (Suspense), the desktop rule can be emitted earlier on the page by another component, leaving the
105
+ * unscoped mobile rule last — so it wins on desktop and the side nav renders in the wrong grid area.
106
+ *
107
+ * - `mobileLegacy` (gate OFF): the original unscoped mobile rule, which exhibits the bug above.
108
+ * - `mobile` (gate ON): the mobile rule scoped to `@media not (min-width: 64rem)`, the exact inverse
109
+ * of the desktop `@media (min-width: 64rem)` rule. The two can never both match at a given viewport,
110
+ * so insertion order no longer matters and the bug cannot occur.
111
+ *
112
+ * Cleaning up `fg('platform_dst_nav4_side_nav_grid_area_fix')` (gate fully rolled out):
113
+ * 1. Move `gridAreaStyles.mobile`'s `@media not (min-width: 64rem)` grid-area rule back into
114
+ * `styles.root`.
115
+ * 2. Delete this entire block (`gridAreaStyles`) and the `fg(...)` branch in the `css` prop below.
116
+ */
117
+ var gridAreaStyles = {
118
+ mobileLegacy: "_nd5l1b6c",
119
+ mobile: "_89fi1b6c"
120
+ };
90
121
  var fallbackDefaultWidth = 320;
91
122
  var onPeekStartDelayMs = exports.onPeekStartDelayMs = 500;
92
123
 
@@ -760,7 +791,7 @@ function SideNavInternal(_ref) {
760
791
  style: (0, _defineProperty2.default)({}, _constants.sideNavVar, clampedWidth),
761
792
  ref: mergedRef,
762
793
  "data-testid": testId,
763
- className: (0, _runtime.ax)([styles.root, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop, isFhsEnabled && styles.animationRTLSupport, shouldShowSidebarToggleAnimation && styles.animationBaseStyles, isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.expandAnimationMobile, !isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.collapseAnimationMobile, isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.expandAnimationDesktop, !isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.collapseAnimationDesktop, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFhsEnabled && styles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFhsEnabled && styles.flyoutAnimateClosed, ((sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' || (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close') && !isFirefox && isFhsEnabled && styles.flyoutBaseStylesFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFirefox && isFhsEnabled && styles.flyoutOpenFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar])
794
+ className: (0, _runtime.ax)([styles.root, (0, _platformFeatureFlags.fg)('platform_dst_nav4_side_nav_grid_area_fix') ? gridAreaStyles.mobile : gridAreaStyles.mobileLegacy, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop, isFhsEnabled && styles.animationRTLSupport, shouldShowSidebarToggleAnimation && styles.animationBaseStyles, isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.expandAnimationMobile, !isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.collapseAnimationMobile, isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.expandAnimationDesktop, !isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.collapseAnimationDesktop, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFhsEnabled && styles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFhsEnabled && styles.flyoutAnimateClosed, ((sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' || (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close') && !isFirefox && isFhsEnabled && styles.flyoutBaseStylesFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFirefox && isFhsEnabled && styles.flyoutOpenFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar])
764
795
  }), /*#__PURE__*/_react.default.createElement(_dangerouslyHoistCssVarToDocumentRoot.DangerouslyHoistCssVarToDocumentRoot, {
765
796
  variableName: _constants.sideNavLiveWidthVar,
766
797
  value: "0px",
@@ -8,7 +8,7 @@ exports.useCustomThemeNew = useCustomThemeNew;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("react");
10
10
  var _appProvider = require("@atlaskit/app-provider");
11
- var _tokens = require("@atlaskit/tokens");
11
+ var _getTokenValue = require("@atlaskit/tokens/get-token-value");
12
12
  var _hex = require("./color-utils/formats/hex");
13
13
  var _useCustomTheme = require("./use-custom-theme");
14
14
  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; }
@@ -41,7 +41,7 @@ function useCustomThemeNew(theme) {
41
41
  if (!value.isEnabled) {
42
42
  return true;
43
43
  }
44
- var defaultBackground = (0, _hex.parseHex)((0, _tokens.getTokenValue)('elevation.surface', colorMode === 'light' ? '#FFFFFF' : '#1F1F21'));
44
+ var defaultBackground = (0, _hex.parseHex)((0, _getTokenValue.getTokenValue)('elevation.surface', colorMode === 'light' ? '#FFFFFF' : '#1F1F21'));
45
45
  return defaultBackground ? value.style.backgroundColor === toRGBString(defaultBackground) : true;
46
46
  }, [value, colorMode]);
47
47
  if (value.isEnabled) {
@@ -43,7 +43,7 @@ export function focusElement(element) {
43
43
  element.focus({
44
44
  // Forces the focus ring to appear after moving focus to the slot
45
45
  // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#focusvisible
46
- // @ts-expect-error - new and not in types yet
46
+ // @ts-ignore - new and not in types yet. Can be removed once we adopt ts7.
47
47
  focusVisible: true
48
48
  });
49
49
  }
@@ -25,4 +25,5 @@
25
25
  @media (min-width:64rem){._165t56xv{height:calc(100vh - var(--n_bnrM, 0px))}._p0az1elq{transform:translateX(calc(var(--n_snvRsz, var(--n_snvW, 0px)) - var(--ds-border-width, 1px)))}._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}}
26
26
  @media (prefers-reduced-motion:no-preference) and (min-width:64rem){._17ly8iot{transition-property:transform,display}._177m1a5r{transition-behavior:allow-discrete}._1sg81gzg{grid-area:main}._vgub1mm8{transition-timing-function:cubic-bezier(0,.4,0,1)}._hh1u1p9u{transform:translateX(calc(-100%*var(--animation-direction)))}@starting-style{._s2eg1p9u{transform:translateX(calc(-100%*var(--animation-direction)))}}._1sg8k0mc{grid-area:side-nav}._vgub1ku9{transition-timing-function:cubic-bezier(.6,0,0,1)}._hjoifnf5{transition-duration:.2s}}
27
27
  @media (prefers-reduced-motion:no-preference) and (not (min-width:64rem)){._aadi1p9u{transform:translateX(calc(-100%*var(--animation-direction)))}}
28
+ @media not (min-width:64rem){._89fi1b6c{grid-area:main/aside/aside/aside}}
28
29
  @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}}}
@@ -56,7 +56,7 @@ const panelSplitterPortalTargetStyles = {
56
56
  root: "_kqsw1n9t _1pbyegat _u7coidpf _t9ectl5p _4t3ieqxy _165t56xv _p0az1elq"
57
57
  };
58
58
  const styles = {
59
- root: "_nd5l1b6c _191wglyw _t51zglyw _bfhk1bhr _16qs130s _vchhusvi _4t3ieqxy _152timx3 _kqsw1if8 _1bsb1ego _1pbycs5v _14b5hc79 _qilnk0mc _p5clia51 _4ap3vuon _scbpglyw",
59
+ root: "_191wglyw _t51zglyw _bfhk1bhr _16qs130s _vchhusvi _4t3ieqxy _152timx3 _kqsw1if8 _1bsb1ego _1pbycs5v _14b5hc79 _qilnk0mc _p5clia51 _4ap3vuon _scbpglyw",
60
60
  flyoutOpen: "_qiln1gzg _p5clglyw _4ap31bhr _scbp130s _139f8iot _1tpvfnf5 _sylc1a5r _oyeijq3t",
61
61
  flyoutAnimateClosed: "_1e0cglyw _qiln1gzg _139f8iot _1tpvfnf5 _sylc1a5r _1uwsjq3t",
62
62
  animationRTLSupport: "_15yekb7n _65m41mrw",
@@ -73,6 +73,37 @@ const styles = {
73
73
  expandAnimationDesktop: "_1sg8k0mc _vgub1ku9 _s2eg1p9u",
74
74
  collapseAnimationDesktop: "_1sg81gzg _vgub1mm8 _hh1u1p9u"
75
75
  };
76
+
77
+ /**
78
+ * Workaround for non-deterministic Compiled style ordering in local development. See MAGMA-4606.
79
+ *
80
+ * The mobile `grid-area` for the side nav, split out from `styles.root` so it can be gated. The
81
+ * desktop rule (`gridArea: 'side-nav'`) lives in `styles.root` inside `@media (min-width: 64rem)`.
82
+ *
83
+ * Why this is needed:
84
+ * The mobile rule (unscoped) and the desktop rule (`@media (min-width: 64rem)`) compile to two atomic
85
+ * rules of equal specificity — a `@media` query adds no specificity — so at desktop widths the winner
86
+ * is decided purely by stylesheet insertion order (last wins). In production this is fine: Compiled's
87
+ * stylesheet extraction sorts the media queries deterministically. But in local development stylesheet
88
+ * extraction is disabled (https://github.com/atlassian-labs/compiled/issues/1306), so styles are
89
+ * injected as inline `<style>` tags in whatever order components happen to render. Under streaming SSR
90
+ * (Suspense), the desktop rule can be emitted earlier on the page by another component, leaving the
91
+ * unscoped mobile rule last — so it wins on desktop and the side nav renders in the wrong grid area.
92
+ *
93
+ * - `mobileLegacy` (gate OFF): the original unscoped mobile rule, which exhibits the bug above.
94
+ * - `mobile` (gate ON): the mobile rule scoped to `@media not (min-width: 64rem)`, the exact inverse
95
+ * of the desktop `@media (min-width: 64rem)` rule. The two can never both match at a given viewport,
96
+ * so insertion order no longer matters and the bug cannot occur.
97
+ *
98
+ * Cleaning up `fg('platform_dst_nav4_side_nav_grid_area_fix')` (gate fully rolled out):
99
+ * 1. Move `gridAreaStyles.mobile`'s `@media not (min-width: 64rem)` grid-area rule back into
100
+ * `styles.root`.
101
+ * 2. Delete this entire block (`gridAreaStyles`) and the `fg(...)` branch in the `css` prop below.
102
+ */
103
+ const gridAreaStyles = {
104
+ mobileLegacy: "_nd5l1b6c",
105
+ mobile: "_89fi1b6c"
106
+ };
76
107
  const fallbackDefaultWidth = 320;
77
108
  export const onPeekStartDelayMs = 500;
78
109
 
@@ -750,7 +781,7 @@ function SideNavInternal({
750
781
  },
751
782
  ref: mergedRef,
752
783
  "data-testid": testId,
753
- className: ax([styles.root, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop, isFhsEnabled && styles.animationRTLSupport, shouldShowSidebarToggleAnimation && styles.animationBaseStyles, isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.expandAnimationMobile, !isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.collapseAnimationMobile, isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.expandAnimationDesktop, !isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.collapseAnimationDesktop, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFhsEnabled && styles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFhsEnabled && styles.flyoutAnimateClosed, ((sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' || (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close') && !isFirefox && isFhsEnabled && styles.flyoutBaseStylesFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFirefox && isFhsEnabled && styles.flyoutOpenFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar])
784
+ className: ax([styles.root, fg('platform_dst_nav4_side_nav_grid_area_fix') ? gridAreaStyles.mobile : gridAreaStyles.mobileLegacy, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop, isFhsEnabled && styles.animationRTLSupport, shouldShowSidebarToggleAnimation && styles.animationBaseStyles, isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.expandAnimationMobile, !isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.collapseAnimationMobile, isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.expandAnimationDesktop, !isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.collapseAnimationDesktop, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFhsEnabled && styles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFhsEnabled && styles.flyoutAnimateClosed, ((sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' || (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close') && !isFirefox && isFhsEnabled && styles.flyoutBaseStylesFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFirefox && isFhsEnabled && styles.flyoutOpenFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar])
754
785
  }), /*#__PURE__*/React.createElement(DangerouslyHoistCssVarToDocumentRoot, {
755
786
  variableName: sideNavLiveWidthVar,
756
787
  value: "0px",
@@ -1,6 +1,6 @@
1
1
  import { useMemo } from 'react';
2
2
  import { useColorMode } from '@atlaskit/app-provider';
3
- import { getTokenValue } from '@atlaskit/tokens';
3
+ import { getTokenValue } from '@atlaskit/tokens/get-token-value';
4
4
  import { parseHex } from './color-utils/formats/hex';
5
5
  import { useCustomTheme } from './use-custom-theme';
6
6
  function toRGBString({
@@ -43,7 +43,7 @@ export function focusElement(element) {
43
43
  element.focus({
44
44
  // Forces the focus ring to appear after moving focus to the slot
45
45
  // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#focusvisible
46
- // @ts-expect-error - new and not in types yet
46
+ // @ts-ignore - new and not in types yet. Can be removed once we adopt ts7.
47
47
  focusVisible: true
48
48
  });
49
49
  }
@@ -25,4 +25,5 @@
25
25
  @media (min-width:64rem){._165t56xv{height:calc(100vh - var(--n_bnrM, 0px))}._p0az1elq{transform:translateX(calc(var(--n_snvRsz, var(--n_snvW, 0px)) - var(--ds-border-width, 1px)))}._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}}
26
26
  @media (prefers-reduced-motion:no-preference) and (min-width:64rem){._17ly8iot{transition-property:transform,display}._177m1a5r{transition-behavior:allow-discrete}._1sg81gzg{grid-area:main}._vgub1mm8{transition-timing-function:cubic-bezier(0,.4,0,1)}._hh1u1p9u{transform:translateX(calc(-100%*var(--animation-direction)))}@starting-style{._s2eg1p9u{transform:translateX(calc(-100%*var(--animation-direction)))}}._1sg8k0mc{grid-area:side-nav}._vgub1ku9{transition-timing-function:cubic-bezier(.6,0,0,1)}._hjoifnf5{transition-duration:.2s}}
27
27
  @media (prefers-reduced-motion:no-preference) and (not (min-width:64rem)){._aadi1p9u{transform:translateX(calc(-100%*var(--animation-direction)))}}
28
+ @media not (min-width:64rem){._89fi1b6c{grid-area:main/aside/aside/aside}}
28
29
  @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}}}
@@ -60,7 +60,7 @@ var panelSplitterPortalTargetStyles = {
60
60
  root: "_kqsw1n9t _1pbyegat _u7coidpf _t9ectl5p _4t3ieqxy _165t56xv _p0az1elq"
61
61
  };
62
62
  var styles = {
63
- root: "_nd5l1b6c _191wglyw _t51zglyw _bfhk1bhr _16qs130s _vchhusvi _4t3ieqxy _152timx3 _kqsw1if8 _1bsb1ego _1pbycs5v _14b5hc79 _qilnk0mc _p5clia51 _4ap3vuon _scbpglyw",
63
+ root: "_191wglyw _t51zglyw _bfhk1bhr _16qs130s _vchhusvi _4t3ieqxy _152timx3 _kqsw1if8 _1bsb1ego _1pbycs5v _14b5hc79 _qilnk0mc _p5clia51 _4ap3vuon _scbpglyw",
64
64
  flyoutOpen: "_qiln1gzg _p5clglyw _4ap31bhr _scbp130s _139f8iot _1tpvfnf5 _sylc1a5r _oyeijq3t",
65
65
  flyoutAnimateClosed: "_1e0cglyw _qiln1gzg _139f8iot _1tpvfnf5 _sylc1a5r _1uwsjq3t",
66
66
  animationRTLSupport: "_15yekb7n _65m41mrw",
@@ -77,6 +77,37 @@ var styles = {
77
77
  expandAnimationDesktop: "_1sg8k0mc _vgub1ku9 _s2eg1p9u",
78
78
  collapseAnimationDesktop: "_1sg81gzg _vgub1mm8 _hh1u1p9u"
79
79
  };
80
+
81
+ /**
82
+ * Workaround for non-deterministic Compiled style ordering in local development. See MAGMA-4606.
83
+ *
84
+ * The mobile `grid-area` for the side nav, split out from `styles.root` so it can be gated. The
85
+ * desktop rule (`gridArea: 'side-nav'`) lives in `styles.root` inside `@media (min-width: 64rem)`.
86
+ *
87
+ * Why this is needed:
88
+ * The mobile rule (unscoped) and the desktop rule (`@media (min-width: 64rem)`) compile to two atomic
89
+ * rules of equal specificity — a `@media` query adds no specificity — so at desktop widths the winner
90
+ * is decided purely by stylesheet insertion order (last wins). In production this is fine: Compiled's
91
+ * stylesheet extraction sorts the media queries deterministically. But in local development stylesheet
92
+ * extraction is disabled (https://github.com/atlassian-labs/compiled/issues/1306), so styles are
93
+ * injected as inline `<style>` tags in whatever order components happen to render. Under streaming SSR
94
+ * (Suspense), the desktop rule can be emitted earlier on the page by another component, leaving the
95
+ * unscoped mobile rule last — so it wins on desktop and the side nav renders in the wrong grid area.
96
+ *
97
+ * - `mobileLegacy` (gate OFF): the original unscoped mobile rule, which exhibits the bug above.
98
+ * - `mobile` (gate ON): the mobile rule scoped to `@media not (min-width: 64rem)`, the exact inverse
99
+ * of the desktop `@media (min-width: 64rem)` rule. The two can never both match at a given viewport,
100
+ * so insertion order no longer matters and the bug cannot occur.
101
+ *
102
+ * Cleaning up `fg('platform_dst_nav4_side_nav_grid_area_fix')` (gate fully rolled out):
103
+ * 1. Move `gridAreaStyles.mobile`'s `@media not (min-width: 64rem)` grid-area rule back into
104
+ * `styles.root`.
105
+ * 2. Delete this entire block (`gridAreaStyles`) and the `fg(...)` branch in the `css` prop below.
106
+ */
107
+ var gridAreaStyles = {
108
+ mobileLegacy: "_nd5l1b6c",
109
+ mobile: "_89fi1b6c"
110
+ };
80
111
  var fallbackDefaultWidth = 320;
81
112
  export var onPeekStartDelayMs = 500;
82
113
 
@@ -750,7 +781,7 @@ function SideNavInternal(_ref) {
750
781
  style: _defineProperty({}, sideNavVar, clampedWidth),
751
782
  ref: mergedRef,
752
783
  "data-testid": testId,
753
- className: ax([styles.root, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop, isFhsEnabled && styles.animationRTLSupport, shouldShowSidebarToggleAnimation && styles.animationBaseStyles, isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.expandAnimationMobile, !isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.collapseAnimationMobile, isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.expandAnimationDesktop, !isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.collapseAnimationDesktop, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFhsEnabled && styles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFhsEnabled && styles.flyoutAnimateClosed, ((sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' || (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close') && !isFirefox && isFhsEnabled && styles.flyoutBaseStylesFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFirefox && isFhsEnabled && styles.flyoutOpenFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar])
784
+ className: ax([styles.root, fg('platform_dst_nav4_side_nav_grid_area_fix') ? gridAreaStyles.mobile : gridAreaStyles.mobileLegacy, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop, isFhsEnabled && styles.animationRTLSupport, shouldShowSidebarToggleAnimation && styles.animationBaseStyles, isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.expandAnimationMobile, !isExpandedOnMobile && shouldShowSidebarToggleAnimation && styles.collapseAnimationMobile, isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.expandAnimationDesktop, !isExpandedOnDesktop && shouldShowSidebarToggleAnimation && styles.collapseAnimationDesktop, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFhsEnabled && styles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFhsEnabled && styles.flyoutAnimateClosed, ((sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' || (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close') && !isFirefox && isFhsEnabled && styles.flyoutBaseStylesFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isFirefox && isFhsEnabled && styles.flyoutOpenFullHeightSidebar, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isFirefox && isFhsEnabled && styles.flyoutAnimateClosedFullHeightSidebar])
754
785
  }), /*#__PURE__*/React.createElement(DangerouslyHoistCssVarToDocumentRoot, {
755
786
  variableName: sideNavLiveWidthVar,
756
787
  value: "0px",
@@ -3,7 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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) { _defineProperty(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; }
4
4
  import { useMemo } from 'react';
5
5
  import { useColorMode } from '@atlaskit/app-provider';
6
- import { getTokenValue } from '@atlaskit/tokens';
6
+ import { getTokenValue } from '@atlaskit/tokens/get-token-value';
7
7
  import { parseHex } from './color-utils/formats/hex';
8
8
  import { useCustomTheme } from './use-custom-theme';
9
9
  function toRGBString(_ref) {
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
- * @jsxFrag
5
4
  */
6
5
  import React from 'react';
7
6
  import type { CommonSlotProps } from '../types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "10.5.2",
3
+ "version": "10.5.4",
4
4
  "description": "The latest navigation system for Atlassian apps.",
5
5
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
6
6
  "author": "Atlassian Pty Ltd",
@@ -69,7 +69,7 @@
69
69
  "@atlaskit/primitives": "^20.6.0",
70
70
  "@atlaskit/react-compiler-gating": "^0.2.0",
71
71
  "@atlaskit/side-nav-items": "^2.2.0",
72
- "@atlaskit/tokens": "^15.6.0",
72
+ "@atlaskit/tokens": "^15.8.0",
73
73
  "@atlaskit/tooltip": "^23.1.0",
74
74
  "@atlaskit/visually-hidden": "^4.1.0",
75
75
  "@babel/runtime": "^7.0.0",
@@ -88,13 +88,13 @@
88
88
  "@af/visual-regression": "workspace:^",
89
89
  "@atlaskit/badge": "^19.1.0",
90
90
  "@atlaskit/banner": "^15.1.0",
91
- "@atlaskit/breadcrumbs": "^17.4.0",
91
+ "@atlaskit/breadcrumbs": "^17.5.0",
92
92
  "@atlaskit/dropdown-menu": "^17.1.0",
93
93
  "@atlaskit/flag": "^18.1.0",
94
94
  "@atlaskit/form": "^16.1.0",
95
95
  "@atlaskit/heading": "^6.2.0",
96
96
  "@atlaskit/inline-dialog": "^19.1.0",
97
- "@atlaskit/link": "^4.1.0",
97
+ "@atlaskit/link": "^4.3.0",
98
98
  "@atlaskit/lozenge": "^14.1.0",
99
99
  "@atlaskit/menu": "^9.2.0",
100
100
  "@atlaskit/modal-dialog": "^16.1.0",
@@ -105,9 +105,9 @@
105
105
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.0.0",
106
106
  "@atlaskit/select": "^22.5.0",
107
107
  "@atlaskit/skeleton": "^4.2.0",
108
- "@atlaskit/spotlight": "^2.1.0",
108
+ "@atlaskit/spotlight": "^3.0.0",
109
109
  "@atlaskit/textfield": "^9.1.0",
110
- "@atlaskit/top-layer": "^1.6.0",
110
+ "@atlaskit/top-layer": "^1.8.0",
111
111
  "@atlassian/feature-flags-test-utils": "^1.2.0",
112
112
  "@atlassian/gemini": "^1.49.0",
113
113
  "@atlassian/search-dialog": "^10.5.0",
@@ -164,6 +164,9 @@
164
164
  "platform_dst_nav4_skip_link_a11y_1": {
165
165
  "type": "boolean"
166
166
  },
167
+ "platform_dst_nav4_side_nav_grid_area_fix": {
168
+ "type": "boolean"
169
+ },
167
170
  "platform-dst-motion-uplift-button": {
168
171
  "type": "boolean",
169
172
  "referenceOnly": true