@atlaskit/navigation-system 2.17.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -1
- package/dist/cjs/ui/page-layout/top-nav/top-nav-start.js +59 -13
- package/dist/cjs/ui/page-layout/top-nav/top-nav.compiled.css +2 -1
- package/dist/cjs/ui/page-layout/top-nav/top-nav.js +1 -1
- package/dist/es2019/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -1
- package/dist/es2019/ui/page-layout/top-nav/top-nav-start.js +57 -7
- package/dist/es2019/ui/page-layout/top-nav/top-nav.compiled.css +2 -1
- package/dist/es2019/ui/page-layout/top-nav/top-nav.js +1 -1
- package/dist/esm/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -1
- package/dist/esm/ui/page-layout/top-nav/top-nav-start.js +60 -13
- package/dist/esm/ui/page-layout/top-nav/top-nav.compiled.css +2 -1
- package/dist/esm/ui/page-layout/top-nav/top-nav.js +1 -1
- package/dist/types/ui/page-layout/top-nav/top-nav-start.d.ts +9 -7
- package/dist/types-ts4.5/ui/page-layout/top-nav/top-nav-start.d.ts +9 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 2.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`35dbcb50e7873`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/35dbcb50e7873) -
|
|
8
|
+
Changes TopNavMiddle items (search + create) to now be centred on large desktop screens, when the
|
|
9
|
+
`navx-full-height-sidear` feature gate is enabled.
|
|
10
|
+
|
|
3
11
|
## 2.17.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
._4t3i1osq{height:100%}
|
|
6
6
|
._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
|
|
7
7
|
._lcxv1wug{pointer-events:auto}
|
|
8
|
-
|
|
8
|
+
._vchhusvi{box-sizing:border-box}
|
|
9
|
+
@media (min-width:64rem){._15rin7od{min-width:unset}._glte1osq{width:100%}._15rip2n4{min-width:330px}._glte1ris{width:max-content}._15ri1mjv{min-width:300px}._1gs5usvi{box-sizing:border-box}._glte93mn{width:var(--n_sNvlw,100%)}._exxmpxbi{padding-inline-end:var(--ds-space-200,1pc)}}
|
|
@@ -15,13 +15,32 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
15
15
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
16
16
|
var _topNavStartContext = require("../../../context/top-nav-start/top-nav-start-context");
|
|
17
17
|
var _toggleButtonProvider = require("../side-nav/toggle-button-provider");
|
|
18
|
-
var
|
|
18
|
+
var _useSideNavVisibility3 = require("../side-nav/use-side-nav-visibility");
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Styles for the TopNavStart element.
|
|
22
|
+
*
|
|
23
|
+
* When `navx-full-height-sidebar` is enabled this is the styling for the inner element,
|
|
24
|
+
* which re-enables pointer events.
|
|
25
|
+
*/
|
|
26
|
+
var innerStyles = {
|
|
21
27
|
root: "_zulp1b66 _yyhykb7n _4t3i1osq _4cvr1h6o _1e0c1txw _glte1ris _15ri1mjv _1gs5usvi",
|
|
22
28
|
jiraProductLogoUpdate: "_15rip2n4",
|
|
23
|
-
fullHeightSidebar: "
|
|
24
|
-
fullHeightSidebarExpanded: "_15rin7od _glte1osq
|
|
29
|
+
fullHeightSidebar: "_lcxv1wug",
|
|
30
|
+
fullHeightSidebarExpanded: "_15rin7od _glte1osq"
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Styles for the outer element, that does not have re-enabled pointer events and spans the entire
|
|
35
|
+
* width of the TopNavStart area.
|
|
36
|
+
*
|
|
37
|
+
* This wrapper element is only rendered when `navx-full-height-sidebar` is enabled.
|
|
38
|
+
*/
|
|
39
|
+
var wrapperStyles = {
|
|
40
|
+
root: "_vchhusvi",
|
|
41
|
+
fullHeightSidebar: "_bozgutpp",
|
|
42
|
+
fullHeightSidebarCollapsed: "_15rip2n4",
|
|
43
|
+
fullHeightSidebarExpanded: "_glte93mn _exxmpxbi"
|
|
25
44
|
};
|
|
26
45
|
|
|
27
46
|
/**
|
|
@@ -31,16 +50,43 @@ var styles = {
|
|
|
31
50
|
* This ensures we get focus restoration for free.
|
|
32
51
|
*/
|
|
33
52
|
var sideNavToggleButtonKey = 'side-nav-toggle-button';
|
|
53
|
+
var TopNavStartInnerOld = /*#__PURE__*/(0, _react.forwardRef)(function TopNavStartInner(_ref, ref) {
|
|
54
|
+
var children = _ref.children,
|
|
55
|
+
testId = _ref.testId;
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
+
ref: ref,
|
|
58
|
+
"data-testid": testId,
|
|
59
|
+
className: (0, _runtime.ax)([innerStyles.root, (0, _platformFeatureFlags.fg)('team25-eu-jira-logo-updates-csm-jsm') && innerStyles.jiraProductLogoUpdate])
|
|
60
|
+
}, children);
|
|
61
|
+
});
|
|
62
|
+
var TopNavStartInnerFHS = /*#__PURE__*/(0, _react.forwardRef)(function TopNavStartInnerFHS(_ref2, ref) {
|
|
63
|
+
var children = _ref2.children,
|
|
64
|
+
testId = _ref2.testId;
|
|
65
|
+
// This needs the real `defaultCollapsed` state or will not SSR properly
|
|
66
|
+
// TODO: lift `defaultCollapsed` state to `Root` (DSP-23683)
|
|
67
|
+
// then context value will be correct in SSR / from initial render
|
|
68
|
+
var _useSideNavVisibility = (0, _useSideNavVisibility3.useSideNavVisibility)({
|
|
69
|
+
defaultCollapsed: true
|
|
70
|
+
}),
|
|
71
|
+
isExpandedOnDesktop = _useSideNavVisibility.isExpandedOnDesktop;
|
|
72
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
+
ref: ref,
|
|
74
|
+
"data-testid": testId,
|
|
75
|
+
className: (0, _runtime.ax)([wrapperStyles.root, wrapperStyles.fullHeightSidebar, isExpandedOnDesktop && wrapperStyles.fullHeightSidebarExpanded])
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
className: (0, _runtime.ax)([innerStyles.root, innerStyles.fullHeightSidebar, isExpandedOnDesktop && innerStyles.fullHeightSidebarExpanded, (0, _platformFeatureFlags.fg)('team25-eu-jira-logo-updates-csm-jsm') && innerStyles.jiraProductLogoUpdate])
|
|
78
|
+
}, children));
|
|
79
|
+
});
|
|
34
80
|
|
|
35
81
|
/**
|
|
36
82
|
* __TopNavStart__
|
|
37
83
|
*
|
|
38
84
|
* Wrapper for the top navigation actions on the inline-start (left) side of the top navigation.
|
|
39
85
|
*/
|
|
40
|
-
function TopNavStart(
|
|
41
|
-
var children =
|
|
42
|
-
testId =
|
|
43
|
-
sideNavToggleButton =
|
|
86
|
+
function TopNavStart(_ref3) {
|
|
87
|
+
var children = _ref3.children,
|
|
88
|
+
testId = _ref3.testId,
|
|
89
|
+
sideNavToggleButton = _ref3.sideNavToggleButton;
|
|
44
90
|
var ref = (0, _react.useContext)(_topNavStartContext.TopNavStartAttachRef);
|
|
45
91
|
var elementRef = (0, _react.useRef)(null);
|
|
46
92
|
(0, _react.useEffect)(function () {
|
|
@@ -52,10 +98,10 @@ function TopNavStart(_ref) {
|
|
|
52
98
|
// This needs the real `defaultCollapsed` state or will not SSR properly
|
|
53
99
|
// TODO: lift `defaultCollapsed` state to `Root` (DSP-23683)
|
|
54
100
|
// then context value will be correct in SSR / from initial render
|
|
55
|
-
var
|
|
101
|
+
var _useSideNavVisibility2 = (0, _useSideNavVisibility3.useSideNavVisibility)({
|
|
56
102
|
defaultCollapsed: true
|
|
57
103
|
}),
|
|
58
|
-
isExpandedOnDesktop =
|
|
104
|
+
isExpandedOnDesktop = _useSideNavVisibility2.isExpandedOnDesktop;
|
|
59
105
|
|
|
60
106
|
// For SSR assume desktop
|
|
61
107
|
var _useState = (0, _react.useState)(true),
|
|
@@ -75,10 +121,10 @@ function TopNavStart(_ref) {
|
|
|
75
121
|
(0, _compiled.UNSAFE_useMediaQuery)('above.md', function (event) {
|
|
76
122
|
setIsDesktop(event.matches);
|
|
77
123
|
});
|
|
78
|
-
|
|
124
|
+
var TopNavStartInner = (0, _platformFeatureFlags.fg)('navx-full-height-sidebar') ? TopNavStartInnerFHS : TopNavStartInnerOld;
|
|
125
|
+
return /*#__PURE__*/_react.default.createElement(TopNavStartInner, {
|
|
79
126
|
ref: (0, _platformFeatureFlags.fg)('platform_fix_component_state_update_for_suspense') ? elementRef : ref,
|
|
80
|
-
|
|
81
|
-
className: (0, _runtime.ax)([styles.root, (0, _platformFeatureFlags.fg)('navx-full-height-sidebar') && styles.fullHeightSidebar, isExpandedOnDesktop && (0, _platformFeatureFlags.fg)('navx-full-height-sidebar') && styles.fullHeightSidebarExpanded, (0, _platformFeatureFlags.fg)('team25-eu-jira-logo-updates-csm-jsm') && styles.jiraProductLogoUpdate])
|
|
127
|
+
testId: testId
|
|
82
128
|
}, !(0, _platformFeatureFlags.fg)('navx-full-height-sidebar') && /*#__PURE__*/_react.default.createElement(_toggleButtonProvider.SideNavToggleButtonSlotProvider, {
|
|
83
129
|
key: sideNavToggleButtonKey
|
|
84
130
|
}, sideNavToggleButton), sideNavToggleButton && (!isDesktop || !isExpandedOnDesktop) && (0, _platformFeatureFlags.fg)('navx-full-height-sidebar') && /*#__PURE__*/_react.default.createElement(_toggleButtonProvider.SideNavToggleButtonSlotProvider, {
|
|
@@ -20,4 +20,5 @@
|
|
|
20
20
|
._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
|
|
21
21
|
._yv0e1mfv{grid-template-columns:auto 1fr auto}
|
|
22
22
|
@media (min-width:48rem){._1j8b18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
23
|
-
@media (min-width:64rem){.
|
|
23
|
+
@media (min-width:64rem){._1rqt16a9{grid-template-columns:0fr minmax(min-content,max-content) 1fr}._hyzqcs5v{z-index:2}._pdlmutpp{gap:var(--ds-space-150,9pt)}}
|
|
24
|
+
@media (min-width:110.5rem){._jh1g18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
@@ -34,7 +34,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
34
34
|
var styles = {
|
|
35
35
|
root: "_nd5l8cbt _zulpu2gc _18zrutpp _179r7r9e _1e0c11p5 _yv0e1mfv _4cvr1h6o _bfhkvuon _vchhusvi _4t3i1dgc _152t1nws _kqsw1if8 _1pbyegat _d6vu1bgi _1j8b18ax",
|
|
36
36
|
fullHeightSidebar: "_179rglyw _bozgze3t _y4tiutpp _bfhkglyw _lcxvglyw _pdlmutpp",
|
|
37
|
-
fullHeightSidebarExpanded: "
|
|
37
|
+
fullHeightSidebarExpanded: "_1rqt16a9 _jh1g18ax"
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
/**
|
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
._4t3i1osq{height:100%}
|
|
6
6
|
._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
|
|
7
7
|
._lcxv1wug{pointer-events:auto}
|
|
8
|
-
|
|
8
|
+
._vchhusvi{box-sizing:border-box}
|
|
9
|
+
@media (min-width:64rem){._15rin7od{min-width:unset}._glte1osq{width:100%}._15rip2n4{min-width:330px}._glte1ris{width:max-content}._15ri1mjv{min-width:300px}._1gs5usvi{box-sizing:border-box}._glte93mn{width:var(--n_sNvlw,100%)}._exxmpxbi{padding-inline-end:var(--ds-space-200,1pc)}}
|
|
@@ -1,17 +1,37 @@
|
|
|
1
1
|
/* top-nav-start.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./top-nav-start.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
4
|
+
import React, { forwardRef, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { UNSAFE_useMediaQuery } from '@atlaskit/primitives/compiled';
|
|
7
7
|
import { TopNavStartAttachRef } from '../../../context/top-nav-start/top-nav-start-context';
|
|
8
8
|
import { SideNavToggleButtonSlotProvider } from '../side-nav/toggle-button-provider';
|
|
9
9
|
import { useSideNavVisibility } from '../side-nav/use-side-nav-visibility';
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Styles for the TopNavStart element.
|
|
13
|
+
*
|
|
14
|
+
* When `navx-full-height-sidebar` is enabled this is the styling for the inner element,
|
|
15
|
+
* which re-enables pointer events.
|
|
16
|
+
*/
|
|
17
|
+
const innerStyles = {
|
|
11
18
|
root: "_zulp1b66 _yyhykb7n _4t3i1osq _4cvr1h6o _1e0c1txw _glte1ris _15ri1mjv _1gs5usvi",
|
|
12
19
|
jiraProductLogoUpdate: "_15rip2n4",
|
|
13
|
-
fullHeightSidebar: "
|
|
14
|
-
fullHeightSidebarExpanded: "_15rin7od _glte1osq
|
|
20
|
+
fullHeightSidebar: "_lcxv1wug",
|
|
21
|
+
fullHeightSidebarExpanded: "_15rin7od _glte1osq"
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Styles for the outer element, that does not have re-enabled pointer events and spans the entire
|
|
26
|
+
* width of the TopNavStart area.
|
|
27
|
+
*
|
|
28
|
+
* This wrapper element is only rendered when `navx-full-height-sidebar` is enabled.
|
|
29
|
+
*/
|
|
30
|
+
const wrapperStyles = {
|
|
31
|
+
root: "_vchhusvi",
|
|
32
|
+
fullHeightSidebar: "_bozgutpp",
|
|
33
|
+
fullHeightSidebarCollapsed: "_15rip2n4",
|
|
34
|
+
fullHeightSidebarExpanded: "_glte93mn _exxmpxbi"
|
|
15
35
|
};
|
|
16
36
|
|
|
17
37
|
/**
|
|
@@ -21,6 +41,36 @@ const styles = {
|
|
|
21
41
|
* This ensures we get focus restoration for free.
|
|
22
42
|
*/
|
|
23
43
|
const sideNavToggleButtonKey = 'side-nav-toggle-button';
|
|
44
|
+
const TopNavStartInnerOld = /*#__PURE__*/forwardRef(function TopNavStartInner({
|
|
45
|
+
children,
|
|
46
|
+
testId
|
|
47
|
+
}, ref) {
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
ref: ref,
|
|
50
|
+
"data-testid": testId,
|
|
51
|
+
className: ax([innerStyles.root, fg('team25-eu-jira-logo-updates-csm-jsm') && innerStyles.jiraProductLogoUpdate])
|
|
52
|
+
}, children);
|
|
53
|
+
});
|
|
54
|
+
const TopNavStartInnerFHS = /*#__PURE__*/forwardRef(function TopNavStartInnerFHS({
|
|
55
|
+
children,
|
|
56
|
+
testId
|
|
57
|
+
}, ref) {
|
|
58
|
+
// This needs the real `defaultCollapsed` state or will not SSR properly
|
|
59
|
+
// TODO: lift `defaultCollapsed` state to `Root` (DSP-23683)
|
|
60
|
+
// then context value will be correct in SSR / from initial render
|
|
61
|
+
const {
|
|
62
|
+
isExpandedOnDesktop
|
|
63
|
+
} = useSideNavVisibility({
|
|
64
|
+
defaultCollapsed: true
|
|
65
|
+
});
|
|
66
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
ref: ref,
|
|
68
|
+
"data-testid": testId,
|
|
69
|
+
className: ax([wrapperStyles.root, wrapperStyles.fullHeightSidebar, isExpandedOnDesktop && wrapperStyles.fullHeightSidebarExpanded])
|
|
70
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: ax([innerStyles.root, innerStyles.fullHeightSidebar, isExpandedOnDesktop && innerStyles.fullHeightSidebarExpanded, fg('team25-eu-jira-logo-updates-csm-jsm') && innerStyles.jiraProductLogoUpdate])
|
|
72
|
+
}, children));
|
|
73
|
+
});
|
|
24
74
|
|
|
25
75
|
/**
|
|
26
76
|
* __TopNavStart__
|
|
@@ -64,10 +114,10 @@ export function TopNavStart({
|
|
|
64
114
|
UNSAFE_useMediaQuery('above.md', event => {
|
|
65
115
|
setIsDesktop(event.matches);
|
|
66
116
|
});
|
|
67
|
-
|
|
117
|
+
const TopNavStartInner = fg('navx-full-height-sidebar') ? TopNavStartInnerFHS : TopNavStartInnerOld;
|
|
118
|
+
return /*#__PURE__*/React.createElement(TopNavStartInner, {
|
|
68
119
|
ref: fg('platform_fix_component_state_update_for_suspense') ? elementRef : ref,
|
|
69
|
-
|
|
70
|
-
className: ax([styles.root, fg('navx-full-height-sidebar') && styles.fullHeightSidebar, isExpandedOnDesktop && fg('navx-full-height-sidebar') && styles.fullHeightSidebarExpanded, fg('team25-eu-jira-logo-updates-csm-jsm') && styles.jiraProductLogoUpdate])
|
|
120
|
+
testId: testId
|
|
71
121
|
}, !fg('navx-full-height-sidebar') && /*#__PURE__*/React.createElement(SideNavToggleButtonSlotProvider, {
|
|
72
122
|
key: sideNavToggleButtonKey
|
|
73
123
|
}, sideNavToggleButton), sideNavToggleButton && (!isDesktop || !isExpandedOnDesktop) && fg('navx-full-height-sidebar') && /*#__PURE__*/React.createElement(SideNavToggleButtonSlotProvider, {
|
|
@@ -20,4 +20,5 @@
|
|
|
20
20
|
._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
|
|
21
21
|
._yv0e1mfv{grid-template-columns:auto 1fr auto}
|
|
22
22
|
@media (min-width:48rem){._1j8b18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
23
|
-
@media (min-width:64rem){.
|
|
23
|
+
@media (min-width:64rem){._1rqt16a9{grid-template-columns:0fr minmax(min-content,max-content) 1fr}._hyzqcs5v{z-index:2}._pdlmutpp{gap:var(--ds-space-150,9pt)}}
|
|
24
|
+
@media (min-width:110.5rem){._jh1g18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
@@ -23,7 +23,7 @@ import { useSideNavVisibility } from '../side-nav/use-side-nav-visibility';
|
|
|
23
23
|
const styles = {
|
|
24
24
|
root: "_nd5l8cbt _zulpu2gc _18zrutpp _179r7r9e _1e0c11p5 _yv0e1mfv _4cvr1h6o _bfhkvuon _vchhusvi _4t3i1dgc _152t1nws _kqsw1if8 _1pbyegat _d6vu1bgi _1j8b18ax",
|
|
25
25
|
fullHeightSidebar: "_179rglyw _bozgze3t _y4tiutpp _bfhkglyw _lcxvglyw _pdlmutpp",
|
|
26
|
-
fullHeightSidebarExpanded: "
|
|
26
|
+
fullHeightSidebarExpanded: "_1rqt16a9 _jh1g18ax"
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
._4t3i1osq{height:100%}
|
|
6
6
|
._bozgutpp{padding-inline-start:var(--ds-space-150,9pt)}
|
|
7
7
|
._lcxv1wug{pointer-events:auto}
|
|
8
|
-
|
|
8
|
+
._vchhusvi{box-sizing:border-box}
|
|
9
|
+
@media (min-width:64rem){._15rin7od{min-width:unset}._glte1osq{width:100%}._15rip2n4{min-width:330px}._glte1ris{width:max-content}._15ri1mjv{min-width:300px}._1gs5usvi{box-sizing:border-box}._glte93mn{width:var(--n_sNvlw,100%)}._exxmpxbi{padding-inline-end:var(--ds-space-200,1pc)}}
|
|
@@ -2,17 +2,37 @@
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import "./top-nav-start.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import React, { useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
5
|
+
import React, { forwardRef, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { UNSAFE_useMediaQuery } from '@atlaskit/primitives/compiled';
|
|
8
8
|
import { TopNavStartAttachRef } from '../../../context/top-nav-start/top-nav-start-context';
|
|
9
9
|
import { SideNavToggleButtonSlotProvider } from '../side-nav/toggle-button-provider';
|
|
10
10
|
import { useSideNavVisibility } from '../side-nav/use-side-nav-visibility';
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Styles for the TopNavStart element.
|
|
14
|
+
*
|
|
15
|
+
* When `navx-full-height-sidebar` is enabled this is the styling for the inner element,
|
|
16
|
+
* which re-enables pointer events.
|
|
17
|
+
*/
|
|
18
|
+
var innerStyles = {
|
|
12
19
|
root: "_zulp1b66 _yyhykb7n _4t3i1osq _4cvr1h6o _1e0c1txw _glte1ris _15ri1mjv _1gs5usvi",
|
|
13
20
|
jiraProductLogoUpdate: "_15rip2n4",
|
|
14
|
-
fullHeightSidebar: "
|
|
15
|
-
fullHeightSidebarExpanded: "_15rin7od _glte1osq
|
|
21
|
+
fullHeightSidebar: "_lcxv1wug",
|
|
22
|
+
fullHeightSidebarExpanded: "_15rin7od _glte1osq"
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Styles for the outer element, that does not have re-enabled pointer events and spans the entire
|
|
27
|
+
* width of the TopNavStart area.
|
|
28
|
+
*
|
|
29
|
+
* This wrapper element is only rendered when `navx-full-height-sidebar` is enabled.
|
|
30
|
+
*/
|
|
31
|
+
var wrapperStyles = {
|
|
32
|
+
root: "_vchhusvi",
|
|
33
|
+
fullHeightSidebar: "_bozgutpp",
|
|
34
|
+
fullHeightSidebarCollapsed: "_15rip2n4",
|
|
35
|
+
fullHeightSidebarExpanded: "_glte93mn _exxmpxbi"
|
|
16
36
|
};
|
|
17
37
|
|
|
18
38
|
/**
|
|
@@ -22,16 +42,43 @@ var styles = {
|
|
|
22
42
|
* This ensures we get focus restoration for free.
|
|
23
43
|
*/
|
|
24
44
|
var sideNavToggleButtonKey = 'side-nav-toggle-button';
|
|
45
|
+
var TopNavStartInnerOld = /*#__PURE__*/forwardRef(function TopNavStartInner(_ref, ref) {
|
|
46
|
+
var children = _ref.children,
|
|
47
|
+
testId = _ref.testId;
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
ref: ref,
|
|
50
|
+
"data-testid": testId,
|
|
51
|
+
className: ax([innerStyles.root, fg('team25-eu-jira-logo-updates-csm-jsm') && innerStyles.jiraProductLogoUpdate])
|
|
52
|
+
}, children);
|
|
53
|
+
});
|
|
54
|
+
var TopNavStartInnerFHS = /*#__PURE__*/forwardRef(function TopNavStartInnerFHS(_ref2, ref) {
|
|
55
|
+
var children = _ref2.children,
|
|
56
|
+
testId = _ref2.testId;
|
|
57
|
+
// This needs the real `defaultCollapsed` state or will not SSR properly
|
|
58
|
+
// TODO: lift `defaultCollapsed` state to `Root` (DSP-23683)
|
|
59
|
+
// then context value will be correct in SSR / from initial render
|
|
60
|
+
var _useSideNavVisibility = useSideNavVisibility({
|
|
61
|
+
defaultCollapsed: true
|
|
62
|
+
}),
|
|
63
|
+
isExpandedOnDesktop = _useSideNavVisibility.isExpandedOnDesktop;
|
|
64
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
ref: ref,
|
|
66
|
+
"data-testid": testId,
|
|
67
|
+
className: ax([wrapperStyles.root, wrapperStyles.fullHeightSidebar, isExpandedOnDesktop && wrapperStyles.fullHeightSidebarExpanded])
|
|
68
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: ax([innerStyles.root, innerStyles.fullHeightSidebar, isExpandedOnDesktop && innerStyles.fullHeightSidebarExpanded, fg('team25-eu-jira-logo-updates-csm-jsm') && innerStyles.jiraProductLogoUpdate])
|
|
70
|
+
}, children));
|
|
71
|
+
});
|
|
25
72
|
|
|
26
73
|
/**
|
|
27
74
|
* __TopNavStart__
|
|
28
75
|
*
|
|
29
76
|
* Wrapper for the top navigation actions on the inline-start (left) side of the top navigation.
|
|
30
77
|
*/
|
|
31
|
-
export function TopNavStart(
|
|
32
|
-
var children =
|
|
33
|
-
testId =
|
|
34
|
-
sideNavToggleButton =
|
|
78
|
+
export function TopNavStart(_ref3) {
|
|
79
|
+
var children = _ref3.children,
|
|
80
|
+
testId = _ref3.testId,
|
|
81
|
+
sideNavToggleButton = _ref3.sideNavToggleButton;
|
|
35
82
|
var ref = useContext(TopNavStartAttachRef);
|
|
36
83
|
var elementRef = useRef(null);
|
|
37
84
|
useEffect(function () {
|
|
@@ -43,10 +90,10 @@ export function TopNavStart(_ref) {
|
|
|
43
90
|
// This needs the real `defaultCollapsed` state or will not SSR properly
|
|
44
91
|
// TODO: lift `defaultCollapsed` state to `Root` (DSP-23683)
|
|
45
92
|
// then context value will be correct in SSR / from initial render
|
|
46
|
-
var
|
|
93
|
+
var _useSideNavVisibility2 = useSideNavVisibility({
|
|
47
94
|
defaultCollapsed: true
|
|
48
95
|
}),
|
|
49
|
-
isExpandedOnDesktop =
|
|
96
|
+
isExpandedOnDesktop = _useSideNavVisibility2.isExpandedOnDesktop;
|
|
50
97
|
|
|
51
98
|
// For SSR assume desktop
|
|
52
99
|
var _useState = useState(true),
|
|
@@ -66,10 +113,10 @@ export function TopNavStart(_ref) {
|
|
|
66
113
|
UNSAFE_useMediaQuery('above.md', function (event) {
|
|
67
114
|
setIsDesktop(event.matches);
|
|
68
115
|
});
|
|
69
|
-
|
|
116
|
+
var TopNavStartInner = fg('navx-full-height-sidebar') ? TopNavStartInnerFHS : TopNavStartInnerOld;
|
|
117
|
+
return /*#__PURE__*/React.createElement(TopNavStartInner, {
|
|
70
118
|
ref: fg('platform_fix_component_state_update_for_suspense') ? elementRef : ref,
|
|
71
|
-
|
|
72
|
-
className: ax([styles.root, fg('navx-full-height-sidebar') && styles.fullHeightSidebar, isExpandedOnDesktop && fg('navx-full-height-sidebar') && styles.fullHeightSidebarExpanded, fg('team25-eu-jira-logo-updates-csm-jsm') && styles.jiraProductLogoUpdate])
|
|
119
|
+
testId: testId
|
|
73
120
|
}, !fg('navx-full-height-sidebar') && /*#__PURE__*/React.createElement(SideNavToggleButtonSlotProvider, {
|
|
74
121
|
key: sideNavToggleButtonKey
|
|
75
122
|
}, sideNavToggleButton), sideNavToggleButton && (!isDesktop || !isExpandedOnDesktop) && fg('navx-full-height-sidebar') && /*#__PURE__*/React.createElement(SideNavToggleButtonSlotProvider, {
|
|
@@ -20,4 +20,5 @@
|
|
|
20
20
|
._y4tiutpp{padding-inline-end:var(--ds-space-150,9pt)}
|
|
21
21
|
._yv0e1mfv{grid-template-columns:auto 1fr auto}
|
|
22
22
|
@media (min-width:48rem){._1j8b18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
23
|
-
@media (min-width:64rem){.
|
|
23
|
+
@media (min-width:64rem){._1rqt16a9{grid-template-columns:0fr minmax(min-content,max-content) 1fr}._hyzqcs5v{z-index:2}._pdlmutpp{gap:var(--ds-space-150,9pt)}}
|
|
24
|
+
@media (min-width:110.5rem){._jh1g18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
@@ -25,7 +25,7 @@ import { useSideNavVisibility } from '../side-nav/use-side-nav-visibility';
|
|
|
25
25
|
var styles = {
|
|
26
26
|
root: "_nd5l8cbt _zulpu2gc _18zrutpp _179r7r9e _1e0c11p5 _yv0e1mfv _4cvr1h6o _bfhkvuon _vchhusvi _4t3i1dgc _152t1nws _kqsw1if8 _1pbyegat _d6vu1bgi _1j8b18ax",
|
|
27
27
|
fullHeightSidebar: "_179rglyw _bozgze3t _y4tiutpp _bfhkglyw _lcxvglyw _pdlmutpp",
|
|
28
|
-
fullHeightSidebarExpanded: "
|
|
28
|
+
fullHeightSidebarExpanded: "_1rqt16a9 _jh1g18ax"
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
|
|
7
|
-
* __TopNavStart__
|
|
8
|
-
*
|
|
9
|
-
* Wrapper for the top navigation actions on the inline-start (left) side of the top navigation.
|
|
10
|
-
*/
|
|
11
|
-
export declare function TopNavStart({ children, testId, sideNavToggleButton, }: {
|
|
6
|
+
type TopNavStartProps = {
|
|
12
7
|
/**
|
|
13
8
|
* The content of the layout area.
|
|
14
9
|
*
|
|
@@ -30,4 +25,11 @@ export declare function TopNavStart({ children, testId, sideNavToggleButton, }:
|
|
|
30
25
|
* Consumers that do not need a toggle button can explicitly pass `null`.
|
|
31
26
|
*/
|
|
32
27
|
sideNavToggleButton?: React.ReactNode;
|
|
33
|
-
}
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* __TopNavStart__
|
|
31
|
+
*
|
|
32
|
+
* Wrapper for the top navigation actions on the inline-start (left) side of the top navigation.
|
|
33
|
+
*/
|
|
34
|
+
export declare function TopNavStart({ children, testId, sideNavToggleButton }: TopNavStartProps): JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
|
|
7
|
-
* __TopNavStart__
|
|
8
|
-
*
|
|
9
|
-
* Wrapper for the top navigation actions on the inline-start (left) side of the top navigation.
|
|
10
|
-
*/
|
|
11
|
-
export declare function TopNavStart({ children, testId, sideNavToggleButton, }: {
|
|
6
|
+
type TopNavStartProps = {
|
|
12
7
|
/**
|
|
13
8
|
* The content of the layout area.
|
|
14
9
|
*
|
|
@@ -30,4 +25,11 @@ export declare function TopNavStart({ children, testId, sideNavToggleButton, }:
|
|
|
30
25
|
* Consumers that do not need a toggle button can explicitly pass `null`.
|
|
31
26
|
*/
|
|
32
27
|
sideNavToggleButton?: React.ReactNode;
|
|
33
|
-
}
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* __TopNavStart__
|
|
31
|
+
*
|
|
32
|
+
* Wrapper for the top navigation actions on the inline-start (left) side of the top navigation.
|
|
33
|
+
*/
|
|
34
|
+
export declare function TopNavStart({ children, testId, sideNavToggleButton }: TopNavStartProps): JSX.Element;
|
|
35
|
+
export {};
|
package/package.json
CHANGED