@atlaskit/navigation-system 11.4.3 → 11.6.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 +24 -0
- package/constellation/layout/code.mdx +28 -0
- package/dist/cjs/entry-points/top-nav-items/responsive-button.js +12 -0
- package/dist/cjs/ui/page-layout/top-nav/top-nav-element-context.js +9 -0
- package/dist/cjs/ui/page-layout/top-nav/top-nav-end.compiled.css +10 -3
- package/dist/cjs/ui/page-layout/top-nav/top-nav-end.js +52 -15
- package/dist/cjs/ui/page-layout/top-nav/top-nav-middle.compiled.css +6 -1
- package/dist/cjs/ui/page-layout/top-nav/top-nav-middle.js +4 -2
- package/dist/cjs/ui/page-layout/top-nav/top-nav-start.compiled.css +5 -2
- package/dist/cjs/ui/page-layout/top-nav/top-nav-start.js +6 -2
- package/dist/cjs/ui/page-layout/top-nav/top-nav.compiled.css +26 -1
- package/dist/cjs/ui/page-layout/top-nav/top-nav.js +75 -7
- package/dist/cjs/ui/page-layout/top-nav/use-is-compact-top-nav.js +16 -0
- package/dist/cjs/ui/page-layout/top-nav/use-measured-top-nav-breakpoints.js +77 -0
- package/dist/cjs/ui/page-layout/top-nav/use-top-nav-breakpoints.js +20 -0
- package/dist/cjs/ui/page-layout/top-nav/use-top-nav-end-focus.js +102 -0
- package/dist/cjs/ui/top-nav-items/create-button.js +16 -1
- package/dist/cjs/ui/top-nav-items/custom-title.compiled.css +2 -1
- package/dist/cjs/ui/top-nav-items/custom-title.js +6 -3
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.compiled.css +2 -1
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.js +4 -2
- package/dist/cjs/ui/top-nav-items/nav-logo/custom-logo.compiled.css +3 -1
- package/dist/cjs/ui/top-nav-items/nav-logo/custom-logo.js +9 -4
- package/dist/cjs/ui/top-nav-items/responsive-button.js +38 -0
- package/dist/cjs/ui/top-nav-items/search.compiled.css +34 -2
- package/dist/cjs/ui/top-nav-items/search.js +106 -11
- package/dist/cjs/ui/top-nav-items/themed/icon-button.js +24 -4
- package/dist/cjs/ui/top-nav-items/themed/responsive-icon-button.compiled.css +18 -0
- package/dist/cjs/ui/top-nav-items/themed/responsive-icon-button.js +33 -0
- package/dist/cjs/ui/top-nav-items/themed/themed-icon-button.compiled.css +1 -0
- package/dist/cjs/ui/top-nav-items/themed/themed-icon-button.js +68 -55
- package/dist/cjs/ui/top-nav-items/themed/themed-pressable.compiled.css +1 -1
- package/dist/cjs/ui/top-nav-items/themed/themed-pressable.js +1 -1
- package/dist/es2019/entry-points/top-nav-items/responsive-button.js +1 -0
- package/dist/es2019/ui/page-layout/top-nav/top-nav-element-context.js +3 -0
- package/dist/es2019/ui/page-layout/top-nav/top-nav-end.compiled.css +10 -3
- package/dist/es2019/ui/page-layout/top-nav/top-nav-end.js +53 -14
- package/dist/es2019/ui/page-layout/top-nav/top-nav-middle.compiled.css +6 -1
- package/dist/es2019/ui/page-layout/top-nav/top-nav-middle.js +4 -2
- package/dist/es2019/ui/page-layout/top-nav/top-nav-start.compiled.css +5 -2
- package/dist/es2019/ui/page-layout/top-nav/top-nav-start.js +6 -2
- package/dist/es2019/ui/page-layout/top-nav/top-nav.compiled.css +26 -1
- package/dist/es2019/ui/page-layout/top-nav/top-nav.js +54 -8
- package/dist/es2019/ui/page-layout/top-nav/use-is-compact-top-nav.js +11 -0
- package/dist/es2019/ui/page-layout/top-nav/use-measured-top-nav-breakpoints.js +50 -0
- package/dist/es2019/ui/page-layout/top-nav/use-top-nav-breakpoints.js +15 -0
- package/dist/es2019/ui/page-layout/top-nav/use-top-nav-end-focus.js +97 -0
- package/dist/es2019/ui/top-nav-items/create-button.js +16 -1
- package/dist/es2019/ui/top-nav-items/custom-title.compiled.css +2 -1
- package/dist/es2019/ui/top-nav-items/custom-title.js +6 -3
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.compiled.css +2 -1
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.js +4 -2
- package/dist/es2019/ui/top-nav-items/nav-logo/custom-logo.compiled.css +3 -1
- package/dist/es2019/ui/top-nav-items/nav-logo/custom-logo.js +9 -4
- package/dist/es2019/ui/top-nav-items/responsive-button.js +27 -0
- package/dist/es2019/ui/top-nav-items/search.compiled.css +34 -2
- package/dist/es2019/ui/top-nav-items/search.js +105 -10
- package/dist/es2019/ui/top-nav-items/themed/icon-button.js +23 -4
- package/dist/es2019/ui/top-nav-items/themed/responsive-icon-button.compiled.css +18 -0
- package/dist/es2019/ui/top-nav-items/themed/responsive-icon-button.js +26 -0
- package/dist/es2019/ui/top-nav-items/themed/themed-icon-button.compiled.css +1 -0
- package/dist/es2019/ui/top-nav-items/themed/themed-icon-button.js +63 -51
- package/dist/es2019/ui/top-nav-items/themed/themed-pressable.compiled.css +1 -1
- package/dist/es2019/ui/top-nav-items/themed/themed-pressable.js +1 -1
- package/dist/esm/entry-points/top-nav-items/responsive-button.js +1 -0
- package/dist/esm/ui/page-layout/top-nav/top-nav-element-context.js +3 -0
- package/dist/esm/ui/page-layout/top-nav/top-nav-end.compiled.css +10 -3
- package/dist/esm/ui/page-layout/top-nav/top-nav-end.js +53 -15
- package/dist/esm/ui/page-layout/top-nav/top-nav-middle.compiled.css +6 -1
- package/dist/esm/ui/page-layout/top-nav/top-nav-middle.js +4 -2
- package/dist/esm/ui/page-layout/top-nav/top-nav-start.compiled.css +5 -2
- package/dist/esm/ui/page-layout/top-nav/top-nav-start.js +6 -2
- package/dist/esm/ui/page-layout/top-nav/top-nav.compiled.css +26 -1
- package/dist/esm/ui/page-layout/top-nav/top-nav.js +75 -8
- package/dist/esm/ui/page-layout/top-nav/use-is-compact-top-nav.js +11 -0
- package/dist/esm/ui/page-layout/top-nav/use-measured-top-nav-breakpoints.js +70 -0
- package/dist/esm/ui/page-layout/top-nav/use-top-nav-breakpoints.js +15 -0
- package/dist/esm/ui/page-layout/top-nav/use-top-nav-end-focus.js +96 -0
- package/dist/esm/ui/top-nav-items/create-button.js +16 -1
- package/dist/esm/ui/top-nav-items/custom-title.compiled.css +2 -1
- package/dist/esm/ui/top-nav-items/custom-title.js +6 -3
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.compiled.css +2 -1
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.js +4 -2
- package/dist/esm/ui/top-nav-items/nav-logo/custom-logo.compiled.css +3 -1
- package/dist/esm/ui/top-nav-items/nav-logo/custom-logo.js +9 -4
- package/dist/esm/ui/top-nav-items/responsive-button.js +29 -0
- package/dist/esm/ui/top-nav-items/search.compiled.css +34 -2
- package/dist/esm/ui/top-nav-items/search.js +107 -11
- package/dist/esm/ui/top-nav-items/themed/icon-button.js +24 -4
- package/dist/esm/ui/top-nav-items/themed/responsive-icon-button.compiled.css +18 -0
- package/dist/esm/ui/top-nav-items/themed/responsive-icon-button.js +26 -0
- package/dist/esm/ui/top-nav-items/themed/themed-icon-button.compiled.css +1 -0
- package/dist/esm/ui/top-nav-items/themed/themed-icon-button.js +68 -55
- package/dist/esm/ui/top-nav-items/themed/themed-pressable.compiled.css +1 -1
- package/dist/esm/ui/top-nav-items/themed/themed-pressable.js +1 -1
- package/dist/types/entry-points/top-nav-items/responsive-button.d.ts +1 -0
- package/dist/types/ui/page-layout/top-nav/top-nav-element-context.d.ts +9 -0
- package/dist/types/ui/page-layout/top-nav/top-nav-end.d.ts +1 -0
- package/dist/types/ui/page-layout/top-nav/use-is-compact-top-nav.d.ts +6 -0
- package/dist/types/ui/page-layout/top-nav/use-measured-top-nav-breakpoints.d.ts +2 -0
- package/dist/types/ui/page-layout/top-nav/use-top-nav-breakpoints.d.ts +11 -0
- package/dist/types/ui/page-layout/top-nav/use-top-nav-end-focus.d.ts +12 -0
- package/dist/types/ui/top-nav-items/create-button.d.ts +2 -0
- package/dist/types/ui/top-nav-items/responsive-button.d.ts +23 -0
- package/dist/types/ui/top-nav-items/themed/icon-button.d.ts +1 -5
- package/dist/types/ui/top-nav-items/themed/responsive-icon-button.d.ts +10 -0
- package/dist/types/ui/top-nav-items/themed/themed-icon-button.d.ts +8 -0
- package/package.json +8 -7
- package/top-nav-items/responsive-button/package.json +10 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* themed-icon-button.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./themed-icon-button.compiled.css";
|
|
3
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
5
|
import React, { forwardRef } from 'react';
|
|
5
6
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
@@ -7,62 +8,73 @@ import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
|
7
8
|
import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
|
|
8
9
|
import IconRenderer from '../icon-renderer';
|
|
9
10
|
import { ThemedPressable } from './themed-pressable';
|
|
11
|
+
const styles = {
|
|
12
|
+
label: "_k48p1wq8"
|
|
13
|
+
};
|
|
10
14
|
export const ThemedIconButton = /*#__PURE__*/forwardRef(function ThemedIconButton({
|
|
11
15
|
icon: Icon,
|
|
12
16
|
label,
|
|
13
17
|
tooltip,
|
|
18
|
+
isTooltipDisabled,
|
|
19
|
+
shouldShowLabel = false,
|
|
14
20
|
...props
|
|
15
21
|
}, ref) {
|
|
16
22
|
var _tooltip$content;
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
23
|
+
return (
|
|
24
|
+
/*#__PURE__*/
|
|
25
|
+
// Keep the trigger mounted when tooltip availability changes so focus is preserved.
|
|
26
|
+
React.createElement(Tooltip, _extends({}, tooltip, {
|
|
27
|
+
content: isTooltipDisabled || shouldShowLabel ? null : (_tooltip$content = tooltip === null || tooltip === void 0 ? void 0 : tooltip.content) !== null && _tooltip$content !== void 0 ? _tooltip$content : label
|
|
28
|
+
}), triggerProps =>
|
|
29
|
+
/*#__PURE__*/
|
|
30
|
+
/**
|
|
31
|
+
* The `aria-describedby` from `triggerProps` is intentionally not passed down,
|
|
32
|
+
* because it would cause double announcements with the `VisuallyHidden` label.
|
|
33
|
+
*
|
|
34
|
+
* The `@atlaskit/button` IconButton uses the same approach.
|
|
35
|
+
*/
|
|
36
|
+
React.createElement(ThemedPressable, _extends({}, props, {
|
|
37
|
+
shape: shouldShowLabel ? 'default' : 'square',
|
|
38
|
+
ref: mergeRefs([ref, triggerProps.ref]),
|
|
39
|
+
onClick: (event, analyticsEvent) => {
|
|
40
|
+
var _props$onClick, _triggerProps$onClick;
|
|
41
|
+
(_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, event, analyticsEvent);
|
|
42
|
+
triggerProps === null || triggerProps === void 0 ? void 0 : (_triggerProps$onClick = triggerProps.onClick) === null || _triggerProps$onClick === void 0 ? void 0 : _triggerProps$onClick.call(triggerProps, event);
|
|
43
|
+
},
|
|
44
|
+
onMouseOver: e => {
|
|
45
|
+
var _triggerProps$onMouse, _props$onMouseOver;
|
|
46
|
+
(_triggerProps$onMouse = triggerProps.onMouseOver) === null || _triggerProps$onMouse === void 0 ? void 0 : _triggerProps$onMouse.call(triggerProps, e);
|
|
47
|
+
(_props$onMouseOver = props.onMouseOver) === null || _props$onMouseOver === void 0 ? void 0 : _props$onMouseOver.call(props, e);
|
|
48
|
+
},
|
|
49
|
+
onMouseOut: e => {
|
|
50
|
+
var _triggerProps$onMouse2, _props$onMouseOut;
|
|
51
|
+
(_triggerProps$onMouse2 = triggerProps.onMouseOut) === null || _triggerProps$onMouse2 === void 0 ? void 0 : _triggerProps$onMouse2.call(triggerProps, e);
|
|
52
|
+
(_props$onMouseOut = props.onMouseOut) === null || _props$onMouseOut === void 0 ? void 0 : _props$onMouseOut.call(props, e);
|
|
53
|
+
},
|
|
54
|
+
onMouseMove: e => {
|
|
55
|
+
var _triggerProps$onMouse3, _props$onMouseMove;
|
|
56
|
+
(_triggerProps$onMouse3 = triggerProps.onMouseMove) === null || _triggerProps$onMouse3 === void 0 ? void 0 : _triggerProps$onMouse3.call(triggerProps, e);
|
|
57
|
+
(_props$onMouseMove = props.onMouseMove) === null || _props$onMouseMove === void 0 ? void 0 : _props$onMouseMove.call(props, e);
|
|
58
|
+
},
|
|
59
|
+
onMouseDown: e => {
|
|
60
|
+
var _triggerProps$onMouse4, _props$onMouseDown;
|
|
61
|
+
(_triggerProps$onMouse4 = triggerProps.onMouseDown) === null || _triggerProps$onMouse4 === void 0 ? void 0 : _triggerProps$onMouse4.call(triggerProps, e);
|
|
62
|
+
(_props$onMouseDown = props.onMouseDown) === null || _props$onMouseDown === void 0 ? void 0 : _props$onMouseDown.call(props, e);
|
|
63
|
+
},
|
|
64
|
+
onFocus: e => {
|
|
65
|
+
var _triggerProps$onFocus, _props$onFocus;
|
|
66
|
+
(_triggerProps$onFocus = triggerProps.onFocus) === null || _triggerProps$onFocus === void 0 ? void 0 : _triggerProps$onFocus.call(triggerProps, e);
|
|
67
|
+
(_props$onFocus = props.onFocus) === null || _props$onFocus === void 0 ? void 0 : _props$onFocus.call(props, e);
|
|
68
|
+
},
|
|
69
|
+
onBlur: e => {
|
|
70
|
+
var _triggerProps$onBlur, _props$onBlur;
|
|
71
|
+
(_triggerProps$onBlur = triggerProps.onBlur) === null || _triggerProps$onBlur === void 0 ? void 0 : _triggerProps$onBlur.call(triggerProps, e);
|
|
72
|
+
(_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 ? void 0 : _props$onBlur.call(props, e);
|
|
73
|
+
}
|
|
74
|
+
}), /*#__PURE__*/React.createElement(IconRenderer, {
|
|
75
|
+
icon: Icon
|
|
76
|
+
}), shouldShowLabel ? /*#__PURE__*/React.createElement("span", {
|
|
77
|
+
className: ax([styles.label])
|
|
78
|
+
}, label) : /*#__PURE__*/React.createElement(VisuallyHidden, null, label)))
|
|
79
|
+
);
|
|
68
80
|
});
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
._1tv3nqa1:after{border-style:solid}
|
|
15
15
|
._39yqe4h9:after{border-width:var(--ds-border-width,1px)}
|
|
16
16
|
._8l3m15jn:after{border-color:var(--ds-top-bar-button-selected-border)}
|
|
17
|
-
.
|
|
17
|
+
._8l3m4il5:after{border-color:var(--ds-top-bar-button-disabled-border,transparent)}
|
|
18
18
|
._8l3maykr:after{border-color:var(--ds-top-bar-button-border)}
|
|
19
19
|
._18postnw:after{position:absolute}
|
|
20
20
|
._1bah1h6o{justify-content:center}
|
|
@@ -10,7 +10,7 @@ const styles = {
|
|
|
10
10
|
root: "_zulp12x7 _11c8fhey _2rko1qi0 _v564k6bl _4bfu1r31 _1hmsglyw _ajmmnqa1 _1rjcze3t _1e0c1txw _4cvr1h6o _1bah1h6o _4t3i5r7u _kqswh2mm _1nrm1r31 _1a3b1r31 _9oik1r31 _c2waglyw _4fprglyw _1bnxglyw _1iohnqa1 _5goinqa1 _jf4cnqa1 _1ggl5xtf",
|
|
11
11
|
border: "_14mj1kw7 _9v7aze3t _1tv3nqa1 _39yqe4h9 _aetrb3bt _18postnw",
|
|
12
12
|
selected: "_11q71qds _syazw5ct _8l3m15jn _f8pjw5ct _1053w5ct _19lcjrv1 _30l3w5ct _j6xtnh62 _9h8hw5ct",
|
|
13
|
-
disabled: "_11q71c9b _syaz1i3i
|
|
13
|
+
disabled: "_11q71c9b _syaz1i3i _8l3m4il5 _f8pj1i3i _10531i3i _19lc1c9b _30l31i3i _j6xt1c9b _9h8h1i3i"
|
|
14
14
|
};
|
|
15
15
|
const shapeStyles = {
|
|
16
16
|
default: "_18zrutpp",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ResponsiveButton as ResponsiveTopNavButton } from '../../ui/top-nav-items/responsive-button';
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
._1yt4u2gc{padding:var(--ds-space-100,8px)}
|
|
2
2
|
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
3
|
-
.
|
|
3
|
+
._zulpu2gc{gap:var(--ds-space-100,8px)}
|
|
4
|
+
._yyhy11wp{grid-column:3}._10fph9n0{justify-self:end}
|
|
5
|
+
._1bahh9n0{justify-content:end}
|
|
6
|
+
._1bsb14ik{width:var(--n_tnSideWidth,auto)}
|
|
7
|
+
._1e0c1bgi{display:contents}
|
|
8
|
+
._1e0c1cgg{display:var(--n_tnActionsDisplay,none)}
|
|
4
9
|
._1e0c1txw{display:flex}
|
|
5
10
|
._1e0cglyw{display:none}
|
|
11
|
+
._1ul98ox3{min-width:var(--n_tnEndMinWidth,2pc)}
|
|
6
12
|
._1ul9zwfg{min-width:2pc}
|
|
7
13
|
._4cvr1h6o{align-items:center}
|
|
8
|
-
|
|
9
|
-
@media (min-width:
|
|
14
|
+
._vchhusvi{box-sizing:border-box}
|
|
15
|
+
@media (min-width:48rem){._181n1txw{display:flex}._181nz5ha{display:var(--n_tnActionsDisplay,flex)}._1d2y1ris{min-width:max-content}._1d2yioy8{min-width:var(--n_tnEndMinWidth,max-content)}}
|
|
16
|
+
@media (min-width:64rem){._glte1ris{width:max-content}._15rip2n4{min-width:330px}._1gs5usvi{box-sizing:border-box}._ndwch9n0{justify-self:end}._gltexl30{width:var(--n_tnSideWidth,max-content)}._15riwpqv{min-width:var(--n_tnEndMinWidth,330px)}}
|
|
@@ -4,7 +4,10 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
import "./top-nav-end.compiled.css";
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
|
+
|
|
8
|
+
// Compiled supports the inherited container-layout widths outside @atlaskit/css's bounded values.
|
|
7
9
|
import { cx } from '@compiled/react';
|
|
10
|
+
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
8
11
|
import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
|
|
9
12
|
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
10
13
|
import { OpenLayerObserverNamespaceProvider } from '@atlaskit/layering/open-layer-observer-namespace-provider';
|
|
@@ -15,12 +18,18 @@ import { List } from '../../../components/list';
|
|
|
15
18
|
import { HasCustomThemeContext } from '../../top-nav-items/themed/has-custom-theme-context';
|
|
16
19
|
import { IconButton } from '../../top-nav-items/themed/icon-button';
|
|
17
20
|
import { openLayerObserverTopNavEndNamespace } from '../constants';
|
|
21
|
+
import { useTopNavBreakpoints } from './use-top-nav-breakpoints';
|
|
22
|
+
import { useTopNavEndFocus } from './use-top-nav-end-focus';
|
|
18
23
|
var containerStyles = {
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
focusScope: "_1e0c1bgi",
|
|
25
|
+
root: "_yyhy11wp _1e0c1txw _1bahh9n0 _1ul9zwfg",
|
|
26
|
+
withPersistentItems: "_zulpu2gc _4cvr1h6o",
|
|
27
|
+
container: "_1bsb14ik _1ul98ox3 _vchhusvi _10fph9n0 _1d2yioy8 _gltexl30 _15riwpqv",
|
|
28
|
+
viewport: "_1d2y1ris _glte1ris _15rip2n4 _1gs5usvi _ndwch9n0"
|
|
21
29
|
};
|
|
22
30
|
var listStyles = {
|
|
23
31
|
root: "_zulp1b66 _4cvr1h6o _1e0c1txw",
|
|
32
|
+
container: "_1e0c1cgg _181nz5ha",
|
|
24
33
|
hideOnSmallViewport: "_1e0cglyw _181n1txw",
|
|
25
34
|
popupContainer: "_1yt4u2gc"
|
|
26
35
|
};
|
|
@@ -34,12 +43,15 @@ var listStyles = {
|
|
|
34
43
|
* This is to prevent the actions from overflowing the top navigation.
|
|
35
44
|
*/
|
|
36
45
|
export function TopNavEnd(_ref) {
|
|
46
|
+
var _breakpoints$belowSm;
|
|
37
47
|
var children = _ref.children,
|
|
38
48
|
persistentItems = _ref.persistentItems,
|
|
39
49
|
_ref$label = _ref.label,
|
|
40
50
|
label = _ref$label === void 0 ? 'Actions' : _ref$label,
|
|
41
51
|
_ref$showMoreButtonLa = _ref.showMoreButtonLabel,
|
|
42
52
|
showMoreButtonLabel = _ref$showMoreButtonLa === void 0 ? 'Show more' : _ref$showMoreButtonLa;
|
|
53
|
+
var breakpoints = useTopNavBreakpoints();
|
|
54
|
+
var hasContainerBreakpoints = breakpoints != null;
|
|
43
55
|
var hasPersistentItems = fg('platform-dst-chat-panel-layout') && persistentItems != null;
|
|
44
56
|
var _useState = useState(false),
|
|
45
57
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -48,21 +60,40 @@ export function TopNavEnd(_ref) {
|
|
|
48
60
|
// Always setting to `false` for the initial render (will flip in an effect for mobile)
|
|
49
61
|
var _useState3 = useState(false),
|
|
50
62
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
51
|
-
|
|
52
|
-
|
|
63
|
+
isMobileViewport = _useState4[0],
|
|
64
|
+
setIsMobileViewport = _useState4[1];
|
|
53
65
|
// Note: `query` is a stable value between renders
|
|
54
66
|
var query = useMediaQuery('below.sm', function onChange(event) {
|
|
55
|
-
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
|
|
67
|
+
setIsMobileViewport(event.matches);
|
|
68
|
+
// Container mode closes only when the effective layout changes below.
|
|
69
|
+
// Keep the existing viewport behavior outside the rollout / provider.
|
|
70
|
+
if (fg('platform-dst-chat-panel-layout')) {
|
|
71
|
+
if (!hasContainerBreakpoints) {
|
|
72
|
+
setIsOpen(false);
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
setIsOpen(false);
|
|
76
|
+
}
|
|
59
77
|
});
|
|
60
78
|
useLayoutEffect(function () {
|
|
61
79
|
var _query$matches;
|
|
62
80
|
// The default is `false`, and desktop will remain as `false` (no re-render).
|
|
63
81
|
// Mobile will flip from `false` to `true`.
|
|
64
|
-
|
|
82
|
+
setIsMobileViewport((_query$matches = query === null || query === void 0 ? void 0 : query.matches) !== null && _query$matches !== void 0 ? _query$matches : false);
|
|
65
83
|
}, [query]);
|
|
84
|
+
var isMobile = (_breakpoints$belowSm = breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints.belowSm) !== null && _breakpoints$belowSm !== void 0 ? _breakpoints$belowSm : isMobileViewport;
|
|
85
|
+
var _useTopNavEndFocus = useTopNavEndFocus({
|
|
86
|
+
isMobile: isMobile,
|
|
87
|
+
enabled: fg('platform-dst-chat-panel-layout')
|
|
88
|
+
}),
|
|
89
|
+
actionsRef = _useTopNavEndFocus.actionsRef,
|
|
90
|
+
triggerRef = _useTopNavEndFocus.triggerRef,
|
|
91
|
+
onFocusCapture = _useTopNavEndFocus.onFocusCapture;
|
|
92
|
+
useLayoutEffect(function () {
|
|
93
|
+
if (fg('platform-dst-chat-panel-layout') && hasContainerBreakpoints) {
|
|
94
|
+
setIsOpen(false);
|
|
95
|
+
}
|
|
96
|
+
}, [isMobile, hasContainerBreakpoints]);
|
|
66
97
|
|
|
67
98
|
// The shared provider also covers the mobile overflow popup itself. Keep the
|
|
68
99
|
// previous content-only namespace coverage when the layout gate is disabled.
|
|
@@ -70,10 +101,7 @@ export function TopNavEnd(_ref) {
|
|
|
70
101
|
var actions = fg('platform-dst-chat-panel-layout') || fg('platform-dst-top-layer') ? children : /*#__PURE__*/React.createElement(OpenLayerObserverNamespaceProvider, {
|
|
71
102
|
namespace: openLayerObserverTopNavEndNamespace
|
|
72
103
|
}, children);
|
|
73
|
-
var
|
|
74
|
-
"aria-label": label,
|
|
75
|
-
className: ax([containerStyles.root, hasPersistentItems && containerStyles.withPersistentItems])
|
|
76
|
-
}, isMobile ? /*#__PURE__*/React.createElement(Popup, {
|
|
104
|
+
var regularActions = isMobile ? /*#__PURE__*/React.createElement(Popup, {
|
|
77
105
|
isOpen: isOpen,
|
|
78
106
|
onClose: function onClose() {
|
|
79
107
|
return setIsOpen(false);
|
|
@@ -88,11 +116,13 @@ export function TopNavEnd(_ref) {
|
|
|
88
116
|
return /*#__PURE__*/React.createElement(HasCustomThemeContext.Provider, {
|
|
89
117
|
value: false
|
|
90
118
|
}, /*#__PURE__*/React.createElement(List, {
|
|
119
|
+
ref: actionsRef,
|
|
91
120
|
xcss: cx(listStyles.root, listStyles.popupContainer)
|
|
92
121
|
}, actions));
|
|
93
122
|
},
|
|
94
123
|
trigger: function trigger(triggerProps) {
|
|
95
124
|
return /*#__PURE__*/React.createElement(IconButton, _extends({}, triggerProps, {
|
|
125
|
+
ref: fg('platform-dst-chat-panel-layout') ? mergeRefs([triggerProps.ref, triggerRef]) : triggerProps.ref,
|
|
96
126
|
label: showMoreButtonLabel,
|
|
97
127
|
isSelected: isOpen,
|
|
98
128
|
onClick: function onClick() {
|
|
@@ -103,8 +133,16 @@ export function TopNavEnd(_ref) {
|
|
|
103
133
|
}));
|
|
104
134
|
}
|
|
105
135
|
}) : /*#__PURE__*/React.createElement(List, {
|
|
106
|
-
|
|
107
|
-
|
|
136
|
+
ref: actionsRef,
|
|
137
|
+
xcss: cx(listStyles.root, fg('platform-dst-chat-panel-layout') ? listStyles.container : listStyles.hideOnSmallViewport)
|
|
138
|
+
}, actions);
|
|
139
|
+
var content = /*#__PURE__*/React.createElement("nav", {
|
|
140
|
+
"aria-label": label,
|
|
141
|
+
className: ax([containerStyles.root, fg('platform-dst-chat-panel-layout') ? containerStyles.container : containerStyles.viewport, hasPersistentItems && containerStyles.withPersistentItems])
|
|
142
|
+
}, fg('platform-dst-chat-panel-layout') ? /*#__PURE__*/React.createElement("div", {
|
|
143
|
+
onFocusCapture: onFocusCapture,
|
|
144
|
+
className: ax([containerStyles.focusScope])
|
|
145
|
+
}, regularActions) : regularActions, hasPersistentItems && persistentItems);
|
|
108
146
|
return fg('platform-dst-chat-panel-layout') && !fg('platform-dst-top-layer') ? /*#__PURE__*/React.createElement(OpenLayerObserverNamespaceProvider, {
|
|
109
147
|
namespace: openLayerObserverTopNavEndNamespace
|
|
110
148
|
}, content) : content;
|
|
@@ -2,5 +2,10 @@
|
|
|
2
2
|
._yyhycs5v{grid-column:2}._1bahh9n0{justify-content:end}
|
|
3
3
|
._1bsb1osq{width:100%}
|
|
4
4
|
._1e0c1txw{display:flex}
|
|
5
|
+
._1e0cqgwa{display:var(--n_tnMiddleDisplay,flex)}
|
|
6
|
+
._1eji1ris{grid-auto-columns:max-content}
|
|
5
7
|
._4cvr1h6o{align-items:center}
|
|
6
|
-
|
|
8
|
+
._6a6zh9n0{justify-items:end}
|
|
9
|
+
._wij21bp4{grid-auto-flow:column}
|
|
10
|
+
._yv0e15b0{grid-template-columns:minmax(min-content,780px)}
|
|
11
|
+
@media (min-width:48rem){._181n11p5{display:grid}._1j8b15b0{grid-template-columns:minmax(min-content,780px)}._lagd1bp4{grid-auto-flow:column}._1t4c1ris{grid-auto-columns:max-content}._12e8h9n0{justify-items:end}._181n1pe1{display:var(--n_tnMiddleDisplay,grid)}}
|
|
@@ -6,7 +6,9 @@ import { OpenLayerObserverNamespaceProvider } from '@atlaskit/layering/open-laye
|
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
7
|
import { openLayerObserverTopNavMiddleNamespace } from '../constants';
|
|
8
8
|
var styles = {
|
|
9
|
-
root: "_zulpu2gc _yyhycs5v _1bsb1osq _4cvr1h6o _1e0c1txw _1bahh9n0
|
|
9
|
+
root: "_zulpu2gc _yyhycs5v _1bsb1osq _4cvr1h6o _1e0c1txw _1bahh9n0",
|
|
10
|
+
container: "_1e0cqgwa _yv0e15b0 _wij21bp4 _1eji1ris _6a6zh9n0 _181n1pe1",
|
|
11
|
+
viewport: "_181n11p5 _1j8b15b0 _lagd1bp4 _1t4c1ris _12e8h9n0"
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
/**
|
|
@@ -20,7 +22,7 @@ var styles = {
|
|
|
20
22
|
export function TopNavMiddle(_ref) {
|
|
21
23
|
var children = _ref.children;
|
|
22
24
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
-
className: ax([styles.root])
|
|
25
|
+
className: ax([styles.root, fg('platform-dst-chat-panel-layout') ? styles.container : styles.viewport])
|
|
24
26
|
}, fg('platform-dst-top-layer') ? children : /*#__PURE__*/React.createElement(OpenLayerObserverNamespaceProvider, {
|
|
25
27
|
namespace: openLayerObserverTopNavMiddleNamespace
|
|
26
28
|
}, children));
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
2
|
-
._yyhykb7n{grid-column:1}.
|
|
2
|
+
._yyhykb7n{grid-column:1}._1bsb14ik{width:var(--n_tnSideWidth,auto)}
|
|
3
|
+
._1e0c1txw{display:flex}
|
|
4
|
+
._1ul91wqq{min-width:var(--n_tnStartMinWidth,0)}
|
|
3
5
|
._4cvr1h6o{align-items:center}
|
|
4
6
|
._4t3i1osq{height:100%}
|
|
5
|
-
|
|
7
|
+
._vchhusvi{box-sizing:border-box}
|
|
8
|
+
@media (min-width:64rem){._glte1ris{width:max-content}._15rip2n4{min-width:330px}._1gs5usvi{box-sizing:border-box}._gltexl30{width:var(--n_tnSideWidth,max-content)}._15ritp0n{min-width:var(--n_tnStartMinWidth,330px)}}
|
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
import "./top-nav-start.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useContext, useEffect, useRef } from 'react';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
6
|
import { TopNavStartAttachRef } from '../../../context/top-nav-start/top-nav-start-attach-ref';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Styles for the TopNavStart element.
|
|
9
10
|
*/
|
|
11
|
+
|
|
10
12
|
var innerStyles = {
|
|
11
|
-
root: "_zulp1b66 _yyhykb7n _4t3i1osq _4cvr1h6o _1e0c1txw
|
|
13
|
+
root: "_zulp1b66 _yyhykb7n _4t3i1osq _4cvr1h6o _1e0c1txw",
|
|
14
|
+
container: "_1bsb14ik _1ul91wqq _vchhusvi _gltexl30 _15ritp0n",
|
|
15
|
+
viewport: "_glte1ris _15rip2n4 _1gs5usvi"
|
|
12
16
|
};
|
|
13
17
|
/**
|
|
14
18
|
* __TopNavStart__
|
|
@@ -30,6 +34,6 @@ export function TopNavStart(_ref) {
|
|
|
30
34
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
35
|
ref: elementRef,
|
|
32
36
|
"data-testid": testId,
|
|
33
|
-
className: ax([innerStyles.root])
|
|
37
|
+
className: ax([innerStyles.root, fg('platform-dst-chat-panel-layout') ? innerStyles.container : innerStyles.viewport])
|
|
34
38
|
}, sideNavToggleButton, children);
|
|
35
39
|
}
|
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
._nd5l8cbt{grid-area:top-bar}
|
|
2
2
|
._zulpu2gc{gap:var(--ds-space-100,8px)}
|
|
3
|
+
._18zridpf{padding-inline:0}
|
|
3
4
|
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
4
|
-
._179ria51{border-block-end:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}.
|
|
5
|
+
._179ria51{border-block-end:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._121jglyw{--n_tnLogoDisplay:none}
|
|
6
|
+
._152t1nws{inset-block-start:var(--n_bnrM,0)}
|
|
7
|
+
._17hf1ris{--n_tnStartMinWidth:max-content}
|
|
8
|
+
._17sxglyw{--n_tnActionsDisplay:none}
|
|
9
|
+
._1bsb1j6v{width:1rem}
|
|
5
10
|
._1e0c11p5{display:grid}
|
|
11
|
+
._1e0c1ule{display:block}
|
|
12
|
+
._1f38jrq2{container-name:navigation-top-nav}
|
|
13
|
+
._1gd11txw{--n_tnSearchIconDisplay:flex}
|
|
14
|
+
._1oae1txw{--n_tnMiddleDisplay:flex}
|
|
6
15
|
._1pbyegat{z-index:4}
|
|
16
|
+
._1ul9idpf{min-width:0}
|
|
17
|
+
._1v3t1vi7{--n_tnEndMinWidth:32px}
|
|
18
|
+
._3um015vq{visibility:hidden}
|
|
19
|
+
._40201vi7{--n_tnSearchWidth:32px}
|
|
7
20
|
._4cvr1h6o{align-items:center}
|
|
21
|
+
._4gtwglyw{--n_tnSearchDisplay:none}
|
|
8
22
|
._4t3i1dgc{height:var(--n_tNvM)}
|
|
23
|
+
._4t3i1osq{height:100%}
|
|
24
|
+
._4t3iidpf{height:0}
|
|
25
|
+
._7cca15wb{container-type:inline-size}
|
|
26
|
+
._andq1wug{--n_tnSideWidth:auto}
|
|
9
27
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
10
28
|
._d6vu1bgi >span[data-ep-placeholder-id=top_navigation_skeleton]{display:contents}
|
|
29
|
+
._dv901txw{--n_tnIconDisplay:flex}
|
|
11
30
|
._kqsw1if8{position:sticky}
|
|
31
|
+
._kqswstnw{position:absolute}
|
|
32
|
+
._lcxvglyw{pointer-events:none}
|
|
12
33
|
._vchhusvi{box-sizing:border-box}
|
|
34
|
+
._yv0e14iv{grid-template-columns:auto minmax(0,1fr) auto}
|
|
13
35
|
._yv0e1mfv{grid-template-columns:auto 1fr auto}
|
|
36
|
+
@container navigation-top-nav (min-width: 30rem){._1vdu11p5{--n_tnSearchDisplay:grid}._tyr51osq{--n_tnSearchWidth:100%}._t7c0glyw{--n_tnSearchIconDisplay:none}}
|
|
37
|
+
@container navigation-top-nav (min-width: 48rem){._f4az18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}._1nd111p5{--n_tnMiddleDisplay:grid}._1py31ris{--n_tnEndMinWidth:max-content}._orr21txw{--n_tnActionsDisplay:flex}}
|
|
38
|
+
@container navigation-top-nav (min-width: 64rem){._gaza1ris{--n_tnSideWidth:max-content}._e5ixp2n4{--n_tnStartMinWidth:330px}._8hhxp2n4{--n_tnEndMinWidth:330px}._pdk61txw{--n_tnLogoDisplay:flex}._1x9fglyw{--n_tnIconDisplay:none}}
|
|
14
39
|
@media (min-width:48rem){._1j8b18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/* top-nav.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import "./top-nav.compiled.css";
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { useContext } from 'react';
|
|
6
|
+
import { startTransition, useCallback, useContext, useState } from 'react';
|
|
6
7
|
import { componentWithFG } from '@atlaskit/platform-feature-flags-react/component-with-fg';
|
|
7
8
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
9
|
import { useSkipLinkInternal } from '../../../context/skip-links/use-skip-link-internal';
|
|
@@ -15,6 +16,8 @@ import { DangerouslyHoistCssVarToDocumentRoot } from '../dangerously-hoist-css-v
|
|
|
15
16
|
import { HoistCssVarToLocalGrid } from '../hoist-css-var-to-local-grid';
|
|
16
17
|
import { DangerouslyHoistSlotSizes } from '../hoist-slot-sizes-context';
|
|
17
18
|
import { useLayoutId } from '../use-layout-id';
|
|
19
|
+
import { TopNavElementContext } from './top-nav-element-context';
|
|
20
|
+
import { useMeasuredTopNavBreakpoints } from './use-measured-top-nav-breakpoints';
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
23
|
* Styles for the container for the top nav items.
|
|
@@ -25,7 +28,11 @@ import { useLayoutId } from '../use-layout-id';
|
|
|
25
28
|
* - The background sits below the expanded side nav
|
|
26
29
|
*/
|
|
27
30
|
var styles = {
|
|
28
|
-
|
|
31
|
+
remProbe: "_kqswstnw _3um015vq _lcxvglyw _1bsb1j6v _4t3iidpf",
|
|
32
|
+
root: "_nd5l8cbt _zulpu2gc _18zrutpp _179ria51 _1e0c11p5 _yv0e1mfv _4cvr1h6o _bfhkvuon _vchhusvi _4t3i1dgc _152t1nws _kqsw1if8 _1pbyegat _d6vu1bgi",
|
|
33
|
+
viewportLayout: "_1j8b18ax",
|
|
34
|
+
container: "_18zridpf _1f38jrq2 _7cca15wb _1ul9idpf _1e0c1ule",
|
|
35
|
+
containerLayout: "_zulpu2gc _18zrutpp _1e0c11p5 _yv0e14iv _4cvr1h6o _vchhusvi _4t3i1osq _1ul9idpf _1oae1txw _andq1wug _17hf1ris _1v3t1vi7 _121jglyw _dv901txw _17sxglyw _4gtwglyw _40201vi7 _1gd11txw _d6vu1bgi _1vdu11p5 _tyr51osq _t7c0glyw _f4az18ax _1nd111p5 _1py31ris _orr21txw _gaza1ris _e5ixp2n4 _8hhxp2n4 _pdk61txw _1x9fglyw"
|
|
29
36
|
};
|
|
30
37
|
/**
|
|
31
38
|
* The top nav layout area. It will display at the top of the screen, below the banner if one is present.
|
|
@@ -39,6 +46,27 @@ function TopNavOld(_ref) {
|
|
|
39
46
|
testId = _ref.testId,
|
|
40
47
|
providedId = _ref.id,
|
|
41
48
|
customThemeConfig = _ref.customTheme;
|
|
49
|
+
var _useState = useState(null),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
topNavElement = _useState2[0],
|
|
52
|
+
setTopNavElement = _useState2[1];
|
|
53
|
+
var _useState3 = useState(null),
|
|
54
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
+
remProbe = _useState4[0],
|
|
56
|
+
setRemProbe = _useState4[1];
|
|
57
|
+
// Ref registration must also be non-urgent while navigation is hydrating.
|
|
58
|
+
// Otherwise its ancestor update can force a pending Suspense boundary to fall back.
|
|
59
|
+
var topNavRef = useCallback(function (element) {
|
|
60
|
+
startTransition(function () {
|
|
61
|
+
return setTopNavElement(element);
|
|
62
|
+
});
|
|
63
|
+
}, []);
|
|
64
|
+
var remProbeRef = useCallback(function (element) {
|
|
65
|
+
startTransition(function () {
|
|
66
|
+
return setRemProbe(element);
|
|
67
|
+
});
|
|
68
|
+
}, []);
|
|
69
|
+
var breakpoints = useMeasuredTopNavBreakpoints(topNavElement, remProbe);
|
|
42
70
|
var dangerouslyHoistSlotSizes = useContext(DangerouslyHoistSlotSizes);
|
|
43
71
|
var id = useLayoutId({
|
|
44
72
|
providedId: providedId
|
|
@@ -53,14 +81,19 @@ function TopNavOld(_ref) {
|
|
|
53
81
|
return /*#__PURE__*/React.createElement(HasCustomThemeContext.Provider, {
|
|
54
82
|
value: customTheme.isEnabled
|
|
55
83
|
}, /*#__PURE__*/React.createElement("header", {
|
|
84
|
+
ref: fg('platform-dst-chat-panel-layout') ? topNavRef : undefined,
|
|
56
85
|
id: id,
|
|
57
86
|
"data-layout-slot": true,
|
|
58
|
-
className: ax([styles.root, xcss]),
|
|
87
|
+
className: ax([styles.root, fg('platform-dst-chat-panel-layout') ? styles.container : styles.viewportLayout, xcss]),
|
|
59
88
|
"data-testid": testId
|
|
60
89
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
61
90
|
,
|
|
62
91
|
style: customTheme.isEnabled ? customTheme.style : undefined
|
|
63
|
-
}, /*#__PURE__*/React.createElement(
|
|
92
|
+
}, fg('platform-dst-chat-panel-layout') && /*#__PURE__*/React.createElement("span", {
|
|
93
|
+
ref: remProbeRef,
|
|
94
|
+
"aria-hidden": "true",
|
|
95
|
+
className: ax([styles.remProbe])
|
|
96
|
+
}), /*#__PURE__*/React.createElement(HoistCssVarToLocalGrid, {
|
|
64
97
|
variableName: topNavMountedVar,
|
|
65
98
|
value: height
|
|
66
99
|
}), dangerouslyHoistSlotSizes &&
|
|
@@ -73,7 +106,11 @@ function TopNavOld(_ref) {
|
|
|
73
106
|
value: height
|
|
74
107
|
})
|
|
75
108
|
// ------ END UNSAFE STYLES ------
|
|
76
|
-
,
|
|
109
|
+
, fg('platform-dst-chat-panel-layout') ? /*#__PURE__*/React.createElement(TopNavElementContext.Provider, {
|
|
110
|
+
value: breakpoints
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: ax([styles.containerLayout])
|
|
113
|
+
}, children)) : children));
|
|
77
114
|
}
|
|
78
115
|
|
|
79
116
|
/**
|
|
@@ -88,6 +125,27 @@ function TopNavNew(_ref2) {
|
|
|
88
125
|
testId = _ref2.testId,
|
|
89
126
|
providedId = _ref2.id,
|
|
90
127
|
customThemeConfig = _ref2.customTheme;
|
|
128
|
+
var _useState5 = useState(null),
|
|
129
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
130
|
+
topNavElement = _useState6[0],
|
|
131
|
+
setTopNavElement = _useState6[1];
|
|
132
|
+
var _useState7 = useState(null),
|
|
133
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
134
|
+
remProbe = _useState8[0],
|
|
135
|
+
setRemProbe = _useState8[1];
|
|
136
|
+
// Ref registration must also be non-urgent while navigation is hydrating.
|
|
137
|
+
// Otherwise its ancestor update can force a pending Suspense boundary to fall back.
|
|
138
|
+
var topNavRef = useCallback(function (element) {
|
|
139
|
+
startTransition(function () {
|
|
140
|
+
return setTopNavElement(element);
|
|
141
|
+
});
|
|
142
|
+
}, []);
|
|
143
|
+
var remProbeRef = useCallback(function (element) {
|
|
144
|
+
startTransition(function () {
|
|
145
|
+
return setRemProbe(element);
|
|
146
|
+
});
|
|
147
|
+
}, []);
|
|
148
|
+
var breakpoints = useMeasuredTopNavBreakpoints(topNavElement, remProbe);
|
|
91
149
|
var dangerouslyHoistSlotSizes = useContext(DangerouslyHoistSlotSizes);
|
|
92
150
|
var id = useLayoutId({
|
|
93
151
|
providedId: providedId
|
|
@@ -105,14 +163,19 @@ function TopNavNew(_ref2) {
|
|
|
105
163
|
}, /*#__PURE__*/React.createElement(HasDefaultBackgroundColorContext.Provider, {
|
|
106
164
|
value: hasDefaultBackground
|
|
107
165
|
}, /*#__PURE__*/React.createElement("header", {
|
|
166
|
+
ref: fg('platform-dst-chat-panel-layout') ? topNavRef : undefined,
|
|
108
167
|
id: id,
|
|
109
168
|
"data-layout-slot": true,
|
|
110
|
-
className: ax([styles.root, xcss]),
|
|
169
|
+
className: ax([styles.root, fg('platform-dst-chat-panel-layout') ? styles.container : styles.viewportLayout, xcss]),
|
|
111
170
|
"data-testid": testId
|
|
112
171
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
113
172
|
,
|
|
114
173
|
style: customTheme.isEnabled ? customTheme.style : undefined
|
|
115
|
-
}, /*#__PURE__*/React.createElement(
|
|
174
|
+
}, fg('platform-dst-chat-panel-layout') && /*#__PURE__*/React.createElement("span", {
|
|
175
|
+
ref: remProbeRef,
|
|
176
|
+
"aria-hidden": "true",
|
|
177
|
+
className: ax([styles.remProbe])
|
|
178
|
+
}), /*#__PURE__*/React.createElement(HoistCssVarToLocalGrid, {
|
|
116
179
|
variableName: topNavMountedVar,
|
|
117
180
|
value: height
|
|
118
181
|
}), dangerouslyHoistSlotSizes &&
|
|
@@ -125,7 +188,11 @@ function TopNavNew(_ref2) {
|
|
|
125
188
|
value: height
|
|
126
189
|
})
|
|
127
190
|
// ------ END UNSAFE STYLES ------
|
|
128
|
-
,
|
|
191
|
+
, fg('platform-dst-chat-panel-layout') ? /*#__PURE__*/React.createElement(TopNavElementContext.Provider, {
|
|
192
|
+
value: breakpoints
|
|
193
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
194
|
+
className: ax([styles.containerLayout])
|
|
195
|
+
}, children)) : children)));
|
|
129
196
|
}
|
|
130
197
|
|
|
131
198
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useTopNavBreakpoints } from './use-top-nav-breakpoints';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Use the enclosing TopNav's border-box width, matching its 48rem sm breakpoint.
|
|
5
|
+
* Until that width is measured, use an icon-only fallback: the server cannot know
|
|
6
|
+
* the container width, and text buttons can overlap at narrow widths.
|
|
7
|
+
*/
|
|
8
|
+
export function useIsCompactTopNav() {
|
|
9
|
+
var breakpoints = useTopNavBreakpoints();
|
|
10
|
+
return breakpoints ? !breakpoints.hasMeasured || breakpoints.belowSm : false;
|
|
11
|
+
}
|