@atlaskit/navigation-system 8.2.0 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/constellation/layout/usage.mdx +2 -0
  3. package/constellation/top-nav-items/usage.mdx +2 -0
  4. package/dist/cjs/components/skip-links/skip-link.js +0 -1
  5. package/dist/cjs/components/skip-links/skip-links-container.compiled.css +2 -7
  6. package/dist/cjs/components/skip-links/skip-links-container.js +17 -14
  7. package/dist/cjs/components/skip-links/skip-links-popup.compiled.css +22 -0
  8. package/dist/cjs/components/skip-links/skip-links-popup.js +124 -0
  9. package/dist/cjs/context/skip-links/skip-links-provider.js +2 -0
  10. package/dist/cjs/ui/page-layout/root.js +6 -3
  11. package/dist/cjs/ui/page-layout/side-nav/side-nav.js +2 -12
  12. package/dist/es2019/components/skip-links/skip-link.js +0 -1
  13. package/dist/es2019/components/skip-links/skip-links-container.compiled.css +2 -7
  14. package/dist/es2019/components/skip-links/skip-links-container.js +17 -14
  15. package/dist/es2019/components/skip-links/skip-links-popup.compiled.css +22 -0
  16. package/dist/es2019/components/skip-links/skip-links-popup.js +107 -0
  17. package/dist/es2019/context/skip-links/skip-links-provider.js +2 -0
  18. package/dist/es2019/ui/page-layout/root.js +4 -3
  19. package/dist/es2019/ui/page-layout/side-nav/side-nav.js +2 -12
  20. package/dist/esm/components/skip-links/skip-link.js +0 -1
  21. package/dist/esm/components/skip-links/skip-links-container.compiled.css +2 -7
  22. package/dist/esm/components/skip-links/skip-links-container.js +17 -14
  23. package/dist/esm/components/skip-links/skip-links-popup.compiled.css +22 -0
  24. package/dist/esm/components/skip-links/skip-links-popup.js +115 -0
  25. package/dist/esm/context/skip-links/skip-links-provider.js +2 -0
  26. package/dist/esm/ui/page-layout/root.js +6 -3
  27. package/dist/esm/ui/page-layout/side-nav/side-nav.js +2 -12
  28. package/dist/types/components/skip-links/skip-link.d.ts +7 -5
  29. package/dist/types/components/skip-links/skip-links-container.d.ts +3 -2
  30. package/dist/types/components/skip-links/skip-links-popup.d.ts +11 -0
  31. package/dist/types/context/skip-links/skip-links-provider.d.ts +2 -1
  32. package/dist/types/ui/page-layout/root.d.ts +5 -1
  33. package/dist/types-ts4.5/components/skip-links/skip-link.d.ts +7 -5
  34. package/dist/types-ts4.5/components/skip-links/skip-links-container.d.ts +3 -2
  35. package/dist/types-ts4.5/components/skip-links/skip-links-popup.d.ts +11 -0
  36. package/dist/types-ts4.5/context/skip-links/skip-links-provider.d.ts +2 -1
  37. package/dist/types-ts4.5/ui/page-layout/root.d.ts +5 -1
  38. package/package.json +9 -12
  39. package/theming/color-utils/parse-hex/package.json +17 -0
  40. package/theming/color-utils/parse-hsl/package.json +17 -0
  41. package/theming/color-utils/parse-rgb/package.json +17 -0
  42. package/theming/color-utils/parse-user-color/package.json +17 -0
  43. package/theming/top-nav-button/package.json +17 -0
  44. package/theming/use-has-custom-theme/package.json +17 -0
  45. package/theming/use-legacy-search-theme/package.json +17 -0
  46. package/experimental/color-utils/parse-hex/package.json +0 -17
  47. package/experimental/color-utils/parse-hsl/package.json +0 -17
  48. package/experimental/color-utils/parse-rgb/package.json +0 -17
  49. package/experimental/color-utils/parse-user-color/package.json +0 -17
  50. package/experimental/top-nav-button/package.json +0 -17
  51. package/experimental/use-has-custom-theme/package.json +0 -17
  52. package/experimental/use-legacy-search-theme/package.json +0 -17
  53. /package/dist/cjs/entry-points/{experimental → theming}/color-utils/parse-hex.js +0 -0
  54. /package/dist/cjs/entry-points/{experimental → theming}/color-utils/parse-hsl.js +0 -0
  55. /package/dist/cjs/entry-points/{experimental → theming}/color-utils/parse-rgb.js +0 -0
  56. /package/dist/cjs/entry-points/{experimental → theming}/color-utils/parse-user-color.js +0 -0
  57. /package/dist/cjs/entry-points/{experimental → theming}/top-nav-button.js +0 -0
  58. /package/dist/cjs/entry-points/{experimental → theming}/use-has-custom-theme.js +0 -0
  59. /package/dist/cjs/entry-points/{experimental → theming}/use-legacy-search-theme.js +0 -0
  60. /package/dist/es2019/entry-points/{experimental → theming}/color-utils/parse-hex.js +0 -0
  61. /package/dist/es2019/entry-points/{experimental → theming}/color-utils/parse-hsl.js +0 -0
  62. /package/dist/es2019/entry-points/{experimental → theming}/color-utils/parse-rgb.js +0 -0
  63. /package/dist/es2019/entry-points/{experimental → theming}/color-utils/parse-user-color.js +0 -0
  64. /package/dist/es2019/entry-points/{experimental → theming}/top-nav-button.js +0 -0
  65. /package/dist/es2019/entry-points/{experimental → theming}/use-has-custom-theme.js +0 -0
  66. /package/dist/es2019/entry-points/{experimental → theming}/use-legacy-search-theme.js +0 -0
  67. /package/dist/esm/entry-points/{experimental → theming}/color-utils/parse-hex.js +0 -0
  68. /package/dist/esm/entry-points/{experimental → theming}/color-utils/parse-hsl.js +0 -0
  69. /package/dist/esm/entry-points/{experimental → theming}/color-utils/parse-rgb.js +0 -0
  70. /package/dist/esm/entry-points/{experimental → theming}/color-utils/parse-user-color.js +0 -0
  71. /package/dist/esm/entry-points/{experimental → theming}/top-nav-button.js +0 -0
  72. /package/dist/esm/entry-points/{experimental → theming}/use-has-custom-theme.js +0 -0
  73. /package/dist/esm/entry-points/{experimental → theming}/use-legacy-search-theme.js +0 -0
  74. /package/dist/types/entry-points/{experimental → theming}/color-utils/parse-hex.d.ts +0 -0
  75. /package/dist/types/entry-points/{experimental → theming}/color-utils/parse-hsl.d.ts +0 -0
  76. /package/dist/types/entry-points/{experimental → theming}/color-utils/parse-rgb.d.ts +0 -0
  77. /package/dist/types/entry-points/{experimental → theming}/color-utils/parse-user-color.d.ts +0 -0
  78. /package/dist/types/entry-points/{experimental → theming}/top-nav-button.d.ts +0 -0
  79. /package/dist/types/entry-points/{experimental → theming}/use-has-custom-theme.d.ts +0 -0
  80. /package/dist/types/entry-points/{experimental → theming}/use-legacy-search-theme.d.ts +0 -0
  81. /package/dist/types-ts4.5/entry-points/{experimental → theming}/color-utils/parse-hex.d.ts +0 -0
  82. /package/dist/types-ts4.5/entry-points/{experimental → theming}/color-utils/parse-hsl.d.ts +0 -0
  83. /package/dist/types-ts4.5/entry-points/{experimental → theming}/color-utils/parse-rgb.d.ts +0 -0
  84. /package/dist/types-ts4.5/entry-points/{experimental → theming}/color-utils/parse-user-color.d.ts +0 -0
  85. /package/dist/types-ts4.5/entry-points/{experimental → theming}/top-nav-button.d.ts +0 -0
  86. /package/dist/types-ts4.5/entry-points/{experimental → theming}/use-has-custom-theme.d.ts +0 -0
  87. /package/dist/types-ts4.5/entry-points/{experimental → theming}/use-legacy-search-theme.d.ts +0 -0
@@ -9,7 +9,6 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
9
9
  import mergeRefs from '@atlaskit/ds-lib/merge-refs';
10
10
  import useStableRef from '@atlaskit/ds-lib/use-stable-ref';
11
11
  import { OpenLayerObserverNamespaceProvider, useOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
12
- import { fg } from '@atlaskit/platform-feature-flags';
13
12
  import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
14
13
  import { media } from '@atlaskit/primitives/responsive';
15
14
  import { useSkipLinkInternal } from '../../../context/skip-links/use-skip-link-internal';
@@ -339,23 +338,14 @@ function SideNavInternal({
339
338
 
340
339
  // Sync the visibility in context (provided in `<Root>`) with the local `defaultCollapsed` prop provided to `SideNav`
341
340
  // after SSR hydration. This should only run once, after the initial render on the client.
342
- if (fg('navx-4418-fix-effect-state-updates-in-gsn')) {
343
- startTransition(() => {
344
- setSideNavState({
345
- desktop: initialDefaultCollapsed ? 'collapsed' : 'expanded',
346
- mobile: 'collapsed',
347
- flyout: 'closed',
348
- lastTrigger: null
349
- });
350
- });
351
- } else {
341
+ startTransition(() => {
352
342
  setSideNavState({
353
343
  desktop: initialDefaultCollapsed ? 'collapsed' : 'expanded',
354
344
  mobile: 'collapsed',
355
345
  flyout: 'closed',
356
346
  lastTrigger: null
357
347
  });
358
- }
348
+ });
359
349
  }, [initialDefaultCollapsed, setSideNavState, sideNavState]);
360
350
  const handleExpand = useCallback(({
361
351
  screen,
@@ -58,7 +58,6 @@ function focusElement(element) {
58
58
  focusVisible: true
59
59
  });
60
60
  }
61
-
62
61
  /**
63
62
  * A link that moves current tab position to a different element
64
63
  *
@@ -1,12 +1,8 @@
1
- ._11c8i4vh{font:var(--ds-font-heading-xxsmall,normal 653 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
1
+
2
2
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
- ._2rko1mok{border-radius:var(--ds-radius-large,8px)}
4
3
  ._zulp1b66{gap:var(--ds-space-050,4px)}
5
- ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
6
4
  ._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
7
- ._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
8
- ._1rjcutpp{padding-block:var(--ds-space-150,9pt)}
9
- ._152tv47k{inset-block-start:var(--ds-space-250,20px)}
5
+ ._1rjcutpp{padding-block:var(--ds-space-150,9pt)}._152tv47k{inset-block-start:var(--ds-space-250,20px)}
10
6
  ._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
11
7
  ._1e02v47k{inset-inline-start:var(--ds-space-250,20px)}
12
8
  ._1e0c1txw{display:flex}
@@ -19,7 +15,6 @@
19
15
  ._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
20
16
  ._kqsw1n9t{position:fixed}
21
17
  ._lcxvglyw{pointer-events:none}
22
- ._syazazsu{color:var(--ds-text-subtle,#505258)}
23
18
  ._tzy4idpf{opacity:0}
24
19
  ._18eu1wug:focus-within{pointer-events:auto}
25
20
  ._1digjh3g:focus-within{z-index:calc(infinity)}
@@ -10,13 +10,10 @@ import { useMemo } from 'react';
10
10
  import { fg } from '@atlaskit/platform-feature-flags';
11
11
  import { Text } from '@atlaskit/primitives/compiled';
12
12
  import { SkipLink } from './skip-link';
13
+ import { SkipLinksPopup } from './skip-links-popup';
13
14
  var styles = {
14
- root: "_1e0c1txw _2lx21bp4 _kqsw1n9t _1e02v47k _152tv47k _bfhk1bhr _16qs130s _1pby1mrw _tzy4idpf _lcxvglyw _1digjh3g _1mygkb7n _18eu1wug",
15
- rootOld: "_zulp1b66 _2rko12b0 _1rjcutpp _18zrutpp",
16
- rootNew: "_2rko1mok _1rjcu2gc _18zrpxbi",
17
- label: "_11c8i4vh _1rjcu2gc _syazazsu",
18
- skipLinkList: "_1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t",
19
- skipLinkListOld: "_zulp1b66"
15
+ root: "_zulp1b66 _2rko12b0 _1rjcutpp _18zrutpp _1e0c1txw _2lx21bp4 _kqsw1n9t _1e02v47k _152tv47k _bfhk1bhr _16qs130s _1pby1mrw _tzy4idpf _lcxvglyw _1digjh3g _1mygkb7n _18eu1wug",
16
+ skipLinkList: "_zulp1b66 _1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t"
20
17
  };
21
18
 
22
19
  /**
@@ -87,10 +84,11 @@ var isOnlyWhitespaceRegex = /^\s*$/;
87
84
  * The label is used as the heading of the skip links container. If the provided label is a string
88
85
  * comprised only of only whitespace (e.g. '' or ' '), the skip link heading element will be removed.
89
86
  *
90
- * The links prop is only used when the feature flag is enabled.
87
+ * When `platform_dst_nav4_skip_link_a11y_1` is enabled, rendering is delegated to `SkipLinksPopup`.
91
88
  */
92
89
  export function SkipLinksContainer(_ref) {
93
90
  var label = _ref.label,
91
+ triggerLabel = _ref.triggerLabel,
94
92
  testId = _ref.testId,
95
93
  links = _ref.links;
96
94
  var sortedLinks = useMemo(function () {
@@ -100,18 +98,23 @@ export function SkipLinksContainer(_ref) {
100
98
  return null;
101
99
  }
102
100
  var isEmptyLabel = isOnlyWhitespaceRegex.test(label);
101
+ if (fg('platform_dst_nav4_skip_link_a11y_1')) {
102
+ return /*#__PURE__*/React.createElement(SkipLinksPopup, {
103
+ label: label,
104
+ triggerLabel: triggerLabel,
105
+ testId: testId,
106
+ links: sortedLinks
107
+ });
108
+ }
103
109
  return /*#__PURE__*/React.createElement("div", {
104
110
  onKeyDown: closeOnEscape,
105
111
  "data-testid": testId ? "".concat(testId, "--skip-links-container") : undefined,
106
- className: ax([styles.root, fg('platform_dst_nav4_skip_link_a11y_1') ? styles.rootNew : styles.rootOld])
107
- }, !isEmptyLabel && (fg('platform_dst_nav4_skip_link_a11y_1') ? /*#__PURE__*/React.createElement("div", {
108
- "data-testid": testId ? "".concat(testId, "--skip-links-container--label") : undefined,
109
- className: ax([styles.label])
110
- }, label) : /*#__PURE__*/React.createElement(Text, {
112
+ className: ax([styles.root])
113
+ }, !isEmptyLabel && /*#__PURE__*/React.createElement(Text, {
111
114
  weight: "bold",
112
115
  testId: testId ? "".concat(testId, "--skip-links-container--label") : undefined
113
- }, label)), /*#__PURE__*/React.createElement("ol", {
114
- className: ax([styles.skipLinkList, !fg('platform_dst_nav4_skip_link_a11y_1') && styles.skipLinkListOld])
116
+ }, label), /*#__PURE__*/React.createElement("ol", {
117
+ className: ax([styles.skipLinkList])
115
118
  }, sortedLinks.map(function (_ref2) {
116
119
  var id = _ref2.id,
117
120
  label = _ref2.label,
@@ -0,0 +1,22 @@
1
+ ._11c8i4vh{font:var(--ds-font-heading-xxsmall,normal 653 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
+ ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
3
+ ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
4
+ ._1dqoglyw{border-style:none}
5
+ ._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
6
+ ._152tutpp{inset-block-start:var(--ds-space-150,9pt)}
7
+ ._1e02utpp{inset-inline-start:var(--ds-space-150,9pt)}
8
+ ._1e0c1txw{display:flex}
9
+ ._1pby1mrw{z-index:-1}
10
+ ._1pbyjh3g{z-index:calc(infinity)}
11
+ ._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
12
+ ._1x8w11lx{list-style-position:outside}
13
+ ._2lx21bp4{flex-direction:column}
14
+ ._2mzuglyw{list-style-type:none}
15
+ ._4ojojh3g:has(:focus-visible){z-index:calc(infinity)}
16
+ ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
17
+ ._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
18
+ ._c8j0kb7n:has(:focus-visible){opacity:1}
19
+ ._kqsw1n9t{position:fixed}
20
+ ._syazazsu{color:var(--ds-text-subtle,#505258)}
21
+ ._t9ecz6y5{transform:translateY(-100%)}
22
+ ._tzy4idpf{opacity:0}
@@ -0,0 +1,115 @@
1
+ /* skip-links-popup.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+ import "./skip-links-popup.compiled.css";
5
+ import * as React from 'react';
6
+ import { ax, ix } from "@compiled/react/runtime";
7
+ import { useCallback, useId, useRef, useState } from 'react';
8
+ import { flushSync } from 'react-dom';
9
+ import Button from '@atlaskit/button/new';
10
+ import mergeRefs from '@atlaskit/ds-lib/merge-refs';
11
+ import Popup from '@atlaskit/popup';
12
+ import { SkipLink } from './skip-link';
13
+ var contentStyles = {
14
+ root: "_1rjcu2gc _18zrpxbi _1e0c1txw _2lx21bp4 _1pbyjh3g",
15
+ skipLinkList: "_1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t",
16
+ label: "_11c8i4vh _1rjcu2gc _syazazsu"
17
+ };
18
+ var triggerStyles = {
19
+ root: "_2rko12b0 _1dqoglyw _kqsw1n9t _1e02utpp _152tutpp _1pby1mrw _tzy4idpf _bfhk1bhr _4ojojh3g _c8j0kb7n",
20
+ isOpen: "_tzy4idpf _t9ecz6y5"
21
+ };
22
+ var popupOffset = [0, 0];
23
+
24
+ /**
25
+ * Skip links shown behind `platform_dst_nav4_skip_link_a11y_1`: a single focus-revealed
26
+ * control opens a dialog listing skip targets.
27
+ */
28
+ export function SkipLinksPopup(_ref) {
29
+ var title = _ref.label,
30
+ triggerLabel = _ref.triggerLabel,
31
+ testId = _ref.testId,
32
+ links = _ref.links;
33
+ var titleId = useId();
34
+ var _useState = useState(false),
35
+ _useState2 = _slicedToArray(_useState, 2),
36
+ isOpen = _useState2[0],
37
+ setIsOpen = _useState2[1];
38
+ var triggerRef = useRef(null);
39
+ var openPopup = useCallback(function () {
40
+ setIsOpen(true);
41
+ }, []);
42
+
43
+ /**
44
+ * Closes the popup.
45
+ *
46
+ * Uses `flushSync` to avoid issues with focus management.
47
+ * This ensures the popup's focus lock is fully released by the time skip links or our `onClose` try to move focus.
48
+ */
49
+ var closePopup = useCallback(function () {
50
+ flushSync(function () {
51
+ setIsOpen(false);
52
+ });
53
+ }, []);
54
+
55
+ /**
56
+ * Restores focus to the trigger on close, if it hasn't moved to another element, such as when Esc is pressed instead of a skip link.
57
+ *
58
+ * We need this because using the standard `shouldReturnFocus` on the popup would break the skip link focus behaviour,
59
+ * as focus would always move back to the trigger.
60
+ */
61
+ var onClose = useCallback(function () {
62
+ closePopup();
63
+
64
+ // Focus on the body implies a skip link was not clicked
65
+ if (document.activeElement === document.body) {
66
+ var _triggerRef$current;
67
+ (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 || _triggerRef$current.focus();
68
+ }
69
+ }, [closePopup]);
70
+ return /*#__PURE__*/React.createElement(Popup, {
71
+ isOpen: isOpen,
72
+ onClose: onClose,
73
+ placement: "bottom-start",
74
+ shouldRenderToParent: true,
75
+ shouldReturnFocus: false,
76
+ role: "dialog",
77
+ titleId: titleId,
78
+ testId: testId ? "".concat(testId, "--skip-links-container") : undefined,
79
+ offset: popupOffset,
80
+ content: function content() {
81
+ return /*#__PURE__*/React.createElement("div", {
82
+ className: ax([contentStyles.root])
83
+ }, /*#__PURE__*/React.createElement("div", {
84
+ "data-testid": testId ? "".concat(testId, "--skip-links-container--label") : undefined,
85
+ id: titleId,
86
+ className: ax([contentStyles.label])
87
+ }, title), /*#__PURE__*/React.createElement("ol", {
88
+ className: ax([contentStyles.skipLinkList])
89
+ }, links.map(function (_ref2) {
90
+ var id = _ref2.id,
91
+ label = _ref2.label,
92
+ _onBeforeNavigate = _ref2.onBeforeNavigate;
93
+ return /*#__PURE__*/React.createElement(SkipLink, {
94
+ key: id,
95
+ id: id,
96
+ onBeforeNavigate: function onBeforeNavigate() {
97
+ closePopup();
98
+ _onBeforeNavigate === null || _onBeforeNavigate === void 0 || _onBeforeNavigate();
99
+ }
100
+ }, label);
101
+ })));
102
+ },
103
+ trigger: function trigger(triggerProps) {
104
+ return /*#__PURE__*/React.createElement("div", {
105
+ className: ax([triggerStyles.root, isOpen && triggerStyles.isOpen])
106
+ }, /*#__PURE__*/React.createElement(Button, _extends({}, triggerProps, {
107
+ ref: mergeRefs([triggerProps.ref, triggerRef]),
108
+ appearance: "primary",
109
+ isSelected: isOpen,
110
+ testId: testId ? "".concat(testId, "--skip-links-trigger") : undefined,
111
+ onClick: openPopup
112
+ }), triggerLabel));
113
+ }
114
+ });
115
+ }
@@ -36,6 +36,7 @@ var getByDomOrderSortFunction = function getByDomOrderSortFunction() {
36
36
  export function SkipLinksProvider(_ref) {
37
37
  var children = _ref.children,
38
38
  label = _ref.label,
39
+ triggerLabel = _ref.triggerLabel,
39
40
  testId = _ref.testId;
40
41
  var _useState = useState([]),
41
42
  _useState2 = _slicedToArray(_useState, 2),
@@ -75,6 +76,7 @@ export function SkipLinksProvider(_ref) {
75
76
  value: contextValue
76
77
  }, /*#__PURE__*/React.createElement(SkipLinksContainer, {
77
78
  label: label,
79
+ triggerLabel: triggerLabel,
78
80
  testId: testId,
79
81
  links: links
80
82
  }), children);
@@ -27,12 +27,14 @@ export function Root(_ref) {
27
27
  xcss = _ref.xcss,
28
28
  _ref$UNSAFE_dangerous = _ref.UNSAFE_dangerouslyHoistSlotSizes,
29
29
  UNSAFE_dangerouslyHoistSlotSizes = _ref$UNSAFE_dangerous === void 0 ? false : _ref$UNSAFE_dangerous,
30
- skipLinksLabel = _ref.skipLinksLabel,
30
+ _ref$skipLinksLabel = _ref.skipLinksLabel,
31
+ skipLinksLabel = _ref$skipLinksLabel === void 0 ? fg('platform_dst_nav4_skip_link_a11y_1') ? 'Skip to' : 'Skip to:' : _ref$skipLinksLabel,
32
+ _ref$skipLinksTrigger = _ref.skipLinksTriggerLabel,
33
+ skipLinksTriggerLabel = _ref$skipLinksTrigger === void 0 ? 'Skip to' : _ref$skipLinksTrigger,
31
34
  testId = _ref.testId,
32
35
  defaultSideNavCollapsed = _ref.defaultSideNavCollapsed,
33
36
  _ref$isSideNavShortcu = _ref.isSideNavShortcutEnabled,
34
37
  isSideNavShortcutEnabled = _ref$isSideNavShortcu === void 0 ? false : _ref$isSideNavShortcu;
35
- var resolvedSkipLinksLabel = skipLinksLabel !== null && skipLinksLabel !== void 0 ? skipLinksLabel : fg('platform_dst_nav4_skip_link_a11y_1') ? 'Skip to' : 'Skip to:';
36
38
  var ref = useRef(null);
37
39
  useEffect(function () {
38
40
  if (process.env.NODE_ENV !== 'production') {
@@ -54,7 +56,8 @@ export function Root(_ref) {
54
56
  }, /*#__PURE__*/React.createElement(TopNavStartProvider, null, /*#__PURE__*/React.createElement(OpenLayerObserver, null, /*#__PURE__*/React.createElement(DangerouslyHoistSlotSizes.Provider, {
55
57
  value: UNSAFE_dangerouslyHoistSlotSizes
56
58
  }, /*#__PURE__*/React.createElement(SkipLinksProvider, {
57
- label: resolvedSkipLinksLabel,
59
+ label: skipLinksLabel,
60
+ triggerLabel: skipLinksTriggerLabel,
58
61
  testId: testId
59
62
  }, /*#__PURE__*/React.createElement("div", {
60
63
  ref: ref,
@@ -13,7 +13,6 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
13
13
  import mergeRefs from '@atlaskit/ds-lib/merge-refs';
14
14
  import useStableRef from '@atlaskit/ds-lib/use-stable-ref';
15
15
  import { OpenLayerObserverNamespaceProvider, useOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
16
- import { fg } from '@atlaskit/platform-feature-flags';
17
16
  import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
18
17
  import { media } from '@atlaskit/primitives/responsive';
19
18
  import { useSkipLinkInternal } from '../../../context/skip-links/use-skip-link-internal';
@@ -348,23 +347,14 @@ function SideNavInternal(_ref) {
348
347
 
349
348
  // Sync the visibility in context (provided in `<Root>`) with the local `defaultCollapsed` prop provided to `SideNav`
350
349
  // after SSR hydration. This should only run once, after the initial render on the client.
351
- if (fg('navx-4418-fix-effect-state-updates-in-gsn')) {
352
- startTransition(function () {
353
- setSideNavState({
354
- desktop: initialDefaultCollapsed ? 'collapsed' : 'expanded',
355
- mobile: 'collapsed',
356
- flyout: 'closed',
357
- lastTrigger: null
358
- });
359
- });
360
- } else {
350
+ startTransition(function () {
361
351
  setSideNavState({
362
352
  desktop: initialDefaultCollapsed ? 'collapsed' : 'expanded',
363
353
  mobile: 'collapsed',
364
354
  flyout: 'closed',
365
355
  lastTrigger: null
366
356
  });
367
- }
357
+ });
368
358
  }, [initialDefaultCollapsed, setSideNavState, sideNavState]);
369
359
  var handleExpand = useCallback(function (_ref2) {
370
360
  var screen = _ref2.screen,
@@ -4,13 +4,15 @@
4
4
  */
5
5
  import { type ReactNode } from 'react';
6
6
  import type { SkipLinkData } from '../../context/skip-links/types';
7
+ type SkipLinkProps = {
8
+ id: string;
9
+ children: ReactNode;
10
+ onBeforeNavigate?: SkipLinkData['onBeforeNavigate'];
11
+ };
7
12
  /**
8
13
  * A link that moves current tab position to a different element
9
14
  *
10
15
  * This component is rendered internally and is not exported publicly.
11
16
  */
12
- export declare const SkipLink: ({ id, children, onBeforeNavigate, }: {
13
- id: string;
14
- children: ReactNode;
15
- onBeforeNavigate?: SkipLinkData['onBeforeNavigate'];
16
- }) => JSX.Element;
17
+ export declare const SkipLink: ({ id, children, onBeforeNavigate }: SkipLinkProps) => JSX.Element;
18
+ export {};
@@ -8,10 +8,11 @@ import { type SkipLinkData } from '../../context/skip-links/types';
8
8
  * The label is used as the heading of the skip links container. If the provided label is a string
9
9
  * comprised only of only whitespace (e.g. '' or ' '), the skip link heading element will be removed.
10
10
  *
11
- * The links prop is only used when the feature flag is enabled.
11
+ * When `platform_dst_nav4_skip_link_a11y_1` is enabled, rendering is delegated to `SkipLinksPopup`.
12
12
  */
13
- export declare function SkipLinksContainer({ label, testId, links, }: {
13
+ export declare function SkipLinksContainer({ label, triggerLabel, testId, links, }: {
14
14
  label: string;
15
+ triggerLabel: string;
15
16
  testId?: string;
16
17
  links: Array<SkipLinkData>;
17
18
  }): JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ import { type SkipLinkData } from '../../context/skip-links/types';
2
+ /**
3
+ * Skip links shown behind `platform_dst_nav4_skip_link_a11y_1`: a single focus-revealed
4
+ * control opens a dialog listing skip targets.
5
+ */
6
+ export declare function SkipLinksPopup({ label: title, triggerLabel, testId, links, }: {
7
+ label: string;
8
+ triggerLabel: string;
9
+ testId?: string;
10
+ links: Array<SkipLinkData>;
11
+ }): JSX.Element;
@@ -5,8 +5,9 @@ import React, { type ReactNode } from 'react';
5
5
  * - Provides the context to register/unregister skip links
6
6
  * - Renders the skip links container
7
7
  */
8
- export declare function SkipLinksProvider({ children, label, testId, }: {
8
+ export declare function SkipLinksProvider({ children, label, triggerLabel, testId, }: {
9
9
  children: ReactNode;
10
10
  label: string;
11
+ triggerLabel: string;
11
12
  testId?: string;
12
13
  }): React.JSX.Element;
@@ -9,7 +9,7 @@ export declare const gridRootId = "unsafe-design-system-page-layout-root";
9
9
  * The root component of the navigation system. It wraps the underlying components with the necessary contexts allowing to use certain data and hooks
10
10
  * @param skipLinksLabel - The very first element of the layout is a skip links container that can be accessed by pressing Tab button and holds the links to the other sections of the layout thus improving accessibility. This parameter defines the header text for this container
11
11
  */
12
- export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, testId, defaultSideNavCollapsed, isSideNavShortcutEnabled, }: {
12
+ export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, skipLinksTriggerLabel, testId, defaultSideNavCollapsed, isSideNavShortcutEnabled, }: {
13
13
  /**
14
14
  * For rendering the layout areas, e.g. TopNav, SideNav, Main.
15
15
  * They should be rendered as immediate children.
@@ -31,6 +31,10 @@ export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes,
31
31
  * The header text for the skip links container element.
32
32
  */
33
33
  skipLinksLabel?: string;
34
+ /**
35
+ * The label for the skip links button that opens the skip links popup.
36
+ */
37
+ skipLinksTriggerLabel?: string;
34
38
  /**
35
39
  * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
36
40
  */
@@ -4,13 +4,15 @@
4
4
  */
5
5
  import { type ReactNode } from 'react';
6
6
  import type { SkipLinkData } from '../../context/skip-links/types';
7
+ type SkipLinkProps = {
8
+ id: string;
9
+ children: ReactNode;
10
+ onBeforeNavigate?: SkipLinkData['onBeforeNavigate'];
11
+ };
7
12
  /**
8
13
  * A link that moves current tab position to a different element
9
14
  *
10
15
  * This component is rendered internally and is not exported publicly.
11
16
  */
12
- export declare const SkipLink: ({ id, children, onBeforeNavigate, }: {
13
- id: string;
14
- children: ReactNode;
15
- onBeforeNavigate?: SkipLinkData['onBeforeNavigate'];
16
- }) => JSX.Element;
17
+ export declare const SkipLink: ({ id, children, onBeforeNavigate }: SkipLinkProps) => JSX.Element;
18
+ export {};
@@ -8,10 +8,11 @@ import { type SkipLinkData } from '../../context/skip-links/types';
8
8
  * The label is used as the heading of the skip links container. If the provided label is a string
9
9
  * comprised only of only whitespace (e.g. '' or ' '), the skip link heading element will be removed.
10
10
  *
11
- * The links prop is only used when the feature flag is enabled.
11
+ * When `platform_dst_nav4_skip_link_a11y_1` is enabled, rendering is delegated to `SkipLinksPopup`.
12
12
  */
13
- export declare function SkipLinksContainer({ label, testId, links, }: {
13
+ export declare function SkipLinksContainer({ label, triggerLabel, testId, links, }: {
14
14
  label: string;
15
+ triggerLabel: string;
15
16
  testId?: string;
16
17
  links: Array<SkipLinkData>;
17
18
  }): JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ import { type SkipLinkData } from '../../context/skip-links/types';
2
+ /**
3
+ * Skip links shown behind `platform_dst_nav4_skip_link_a11y_1`: a single focus-revealed
4
+ * control opens a dialog listing skip targets.
5
+ */
6
+ export declare function SkipLinksPopup({ label: title, triggerLabel, testId, links, }: {
7
+ label: string;
8
+ triggerLabel: string;
9
+ testId?: string;
10
+ links: Array<SkipLinkData>;
11
+ }): JSX.Element;
@@ -5,8 +5,9 @@ import React, { type ReactNode } from 'react';
5
5
  * - Provides the context to register/unregister skip links
6
6
  * - Renders the skip links container
7
7
  */
8
- export declare function SkipLinksProvider({ children, label, testId, }: {
8
+ export declare function SkipLinksProvider({ children, label, triggerLabel, testId, }: {
9
9
  children: ReactNode;
10
10
  label: string;
11
+ triggerLabel: string;
11
12
  testId?: string;
12
13
  }): React.JSX.Element;
@@ -9,7 +9,7 @@ export declare const gridRootId = "unsafe-design-system-page-layout-root";
9
9
  * The root component of the navigation system. It wraps the underlying components with the necessary contexts allowing to use certain data and hooks
10
10
  * @param skipLinksLabel - The very first element of the layout is a skip links container that can be accessed by pressing Tab button and holds the links to the other sections of the layout thus improving accessibility. This parameter defines the header text for this container
11
11
  */
12
- export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, testId, defaultSideNavCollapsed, isSideNavShortcutEnabled, }: {
12
+ export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes, skipLinksLabel, skipLinksTriggerLabel, testId, defaultSideNavCollapsed, isSideNavShortcutEnabled, }: {
13
13
  /**
14
14
  * For rendering the layout areas, e.g. TopNav, SideNav, Main.
15
15
  * They should be rendered as immediate children.
@@ -31,6 +31,10 @@ export declare function Root({ children, xcss, UNSAFE_dangerouslyHoistSlotSizes,
31
31
  * The header text for the skip links container element.
32
32
  */
33
33
  skipLinksLabel?: string;
34
+ /**
35
+ * The label for the skip links button that opens the skip links popup.
36
+ */
37
+ skipLinksTriggerLabel?: string;
34
38
  /**
35
39
  * A unique string that appears as data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
36
40
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "8.2.0",
3
+ "version": "9.1.0",
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",
@@ -72,22 +72,22 @@
72
72
  "dependencies": {
73
73
  "@atlaskit/analytics-next": "^11.2.0",
74
74
  "@atlaskit/app-provider": "^4.3.0",
75
- "@atlaskit/avatar": "^25.13.0",
75
+ "@atlaskit/avatar": "^25.14.0",
76
76
  "@atlaskit/button": "^23.11.0",
77
77
  "@atlaskit/css": "^0.19.0",
78
78
  "@atlaskit/ds-lib": "^7.0.0",
79
79
  "@atlaskit/icon": "^34.3.0",
80
80
  "@atlaskit/layering": "^3.7.0",
81
- "@atlaskit/logo": "^20.0.0",
81
+ "@atlaskit/logo": "^20.1.0",
82
82
  "@atlaskit/platform-feature-flags": "^1.1.0",
83
83
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
84
- "@atlaskit/popup": "^4.16.0",
84
+ "@atlaskit/popup": "^4.17.0",
85
85
  "@atlaskit/pragmatic-drag-and-drop": "^1.8.0",
86
86
  "@atlaskit/primitives": "^19.0.0",
87
87
  "@atlaskit/side-nav-items": "^1.13.0",
88
88
  "@atlaskit/tokens": "^13.0.0",
89
89
  "@atlaskit/tooltip": "^21.2.0",
90
- "@atlaskit/visually-hidden": "^3.0.0",
90
+ "@atlaskit/visually-hidden": "^3.1.0",
91
91
  "@babel/runtime": "^7.0.0",
92
92
  "@compiled/react": "^0.20.0",
93
93
  "bind-event-listener": "^3.0.0",
@@ -103,17 +103,17 @@
103
103
  "@af/integration-testing": "workspace:^",
104
104
  "@af/visual-regression": "workspace:^",
105
105
  "@atlaskit/badge": "^18.6.0",
106
- "@atlaskit/banner": "^14.0.0",
106
+ "@atlaskit/banner": "^14.1.0",
107
107
  "@atlaskit/breadcrumbs": "^16.1.0",
108
108
  "@atlaskit/dropdown-menu": "^16.8.0",
109
109
  "@atlaskit/form": "^15.5.0",
110
110
  "@atlaskit/heading": "^5.4.0",
111
111
  "@atlaskit/link": "^3.4.0",
112
- "@atlaskit/lozenge": "^13.7.0",
112
+ "@atlaskit/lozenge": "^13.8.0",
113
113
  "@atlaskit/menu": "^8.5.0",
114
114
  "@atlaskit/modal-dialog": "^14.18.0",
115
115
  "@atlaskit/onboarding": "^14.6.0",
116
- "@atlaskit/page-header": "^12.1.0",
116
+ "@atlaskit/page-header": "^12.2.0",
117
117
  "@atlaskit/page-layout": "^4.3.0",
118
118
  "@atlaskit/popper": "^7.2.0",
119
119
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
@@ -123,7 +123,7 @@
123
123
  "@atlassian/feature-flags-test-utils": "^1.0.0",
124
124
  "@atlassian/gemini": "^1.44.0",
125
125
  "@atlassian/react-compiler-gating": "workspace:^",
126
- "@atlassian/search-dialog": "^10.0.0",
126
+ "@atlassian/search-dialog": "^10.1.0",
127
127
  "@atlassian/ssr-tests": "workspace:^",
128
128
  "@atlassian/test-utils": "^1.0.0",
129
129
  "@atlassian/testing-library": "^0.5.0",
@@ -175,9 +175,6 @@
175
175
  "platform_dst_nav4_flyout_menu_slots_close_button": {
176
176
  "type": "boolean"
177
177
  },
178
- "navx-4418-fix-effect-state-updates-in-gsn": {
179
- "type": "boolean"
180
- },
181
178
  "platform_dst_nav4_custom_theming_fhs_1": {
182
179
  "type": "boolean"
183
180
  },
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/navigation-system/theming/color-utils/parse-hex",
3
+ "main": "../../../dist/cjs/entry-points/theming/color-utils/parse-hex.js",
4
+ "module": "../../../dist/esm/entry-points/theming/color-utils/parse-hex.js",
5
+ "module:es2019": "../../../dist/es2019/entry-points/theming/color-utils/parse-hex.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../../../dist/types/entry-points/theming/color-utils/parse-hex.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../../../dist/types-ts4.5/entry-points/theming/color-utils/parse-hex.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/navigation-system/theming/color-utils/parse-hsl",
3
+ "main": "../../../dist/cjs/entry-points/theming/color-utils/parse-hsl.js",
4
+ "module": "../../../dist/esm/entry-points/theming/color-utils/parse-hsl.js",
5
+ "module:es2019": "../../../dist/es2019/entry-points/theming/color-utils/parse-hsl.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../../../dist/types/entry-points/theming/color-utils/parse-hsl.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../../../dist/types-ts4.5/entry-points/theming/color-utils/parse-hsl.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/navigation-system/theming/color-utils/parse-rgb",
3
+ "main": "../../../dist/cjs/entry-points/theming/color-utils/parse-rgb.js",
4
+ "module": "../../../dist/esm/entry-points/theming/color-utils/parse-rgb.js",
5
+ "module:es2019": "../../../dist/es2019/entry-points/theming/color-utils/parse-rgb.js",
6
+ "sideEffects": [
7
+ "*.compiled.css"
8
+ ],
9
+ "types": "../../../dist/types/entry-points/theming/color-utils/parse-rgb.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../../../dist/types-ts4.5/entry-points/theming/color-utils/parse-rgb.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }