@atlaskit/navigation-system 11.2.3 → 11.3.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 +28 -0
- package/dist/cjs/ui/fhs-rollout/is-custom-is-fhs-enabled-context.js +2 -2
- package/dist/cjs/ui/fhs-rollout/is-fhs-enabled-context.js +6 -6
- package/dist/cjs/ui/fhs-rollout/is-fhs-enabled-provider.js +14 -18
- package/dist/cjs/ui/fhs-rollout/use-is-fhs-enabled.js +5 -5
- package/dist/cjs/ui/page-layout/banner.compiled.css +0 -1
- package/dist/cjs/ui/page-layout/banner.js +2 -5
- package/dist/cjs/ui/page-layout/constants.js +1 -13
- package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.compiled.css +0 -1
- package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.js +2 -5
- package/dist/cjs/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +0 -68
- package/dist/cjs/ui/page-layout/ribbon.js +0 -7
- package/dist/cjs/ui/page-layout/side-nav/side-nav-content.js +1 -9
- package/dist/cjs/ui/page-layout/side-nav/side-nav.compiled.css +3 -10
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +21 -54
- package/dist/cjs/ui/page-layout/top-nav/top-nav-end.compiled.css +0 -1
- package/dist/cjs/ui/page-layout/top-nav/top-nav-end.js +2 -5
- package/dist/cjs/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -12
- package/dist/cjs/ui/page-layout/top-nav/top-nav-start.js +9 -250
- package/dist/cjs/ui/page-layout/top-nav/top-nav.compiled.css +1 -15
- package/dist/cjs/ui/page-layout/top-nav/top-nav.js +5 -16
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.compiled.css +0 -2
- package/dist/cjs/ui/top-nav-items/nav-logo/app-logo.js +6 -11
- package/dist/cjs/ui/top-nav-items/nav-logo/custom-logo.compiled.css +0 -2
- package/dist/cjs/ui/top-nav-items/nav-logo/custom-logo.js +3 -6
- package/dist/cjs/ui/top-nav-items/search.compiled.css +3 -2
- package/dist/cjs/ui/top-nav-items/search.js +3 -7
- package/dist/es2019/ui/fhs-rollout/is-custom-is-fhs-enabled-context.js +2 -2
- package/dist/es2019/ui/fhs-rollout/is-fhs-enabled-context.js +6 -4
- package/dist/es2019/ui/fhs-rollout/is-fhs-enabled-provider.js +12 -17
- package/dist/es2019/ui/fhs-rollout/use-is-fhs-enabled.js +5 -8
- package/dist/es2019/ui/page-layout/banner.compiled.css +0 -1
- package/dist/es2019/ui/page-layout/banner.js +2 -5
- package/dist/es2019/ui/page-layout/constants.js +0 -12
- package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.compiled.css +0 -1
- package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.js +2 -5
- package/dist/es2019/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +2 -61
- package/dist/es2019/ui/page-layout/ribbon.js +0 -7
- package/dist/es2019/ui/page-layout/side-nav/side-nav-content.js +2 -8
- package/dist/es2019/ui/page-layout/side-nav/side-nav.compiled.css +3 -10
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +5 -44
- package/dist/es2019/ui/page-layout/top-nav/top-nav-end.compiled.css +0 -1
- package/dist/es2019/ui/page-layout/top-nav/top-nav-end.js +2 -5
- package/dist/es2019/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -12
- package/dist/es2019/ui/page-layout/top-nav/top-nav-start.js +6 -243
- package/dist/es2019/ui/page-layout/top-nav/top-nav.compiled.css +1 -15
- package/dist/es2019/ui/page-layout/top-nav/top-nav.js +5 -18
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.compiled.css +0 -2
- package/dist/es2019/ui/top-nav-items/nav-logo/app-logo.js +6 -11
- package/dist/es2019/ui/top-nav-items/nav-logo/custom-logo.compiled.css +0 -2
- package/dist/es2019/ui/top-nav-items/nav-logo/custom-logo.js +3 -6
- package/dist/es2019/ui/top-nav-items/search.compiled.css +3 -2
- package/dist/es2019/ui/top-nav-items/search.js +3 -7
- package/dist/esm/ui/fhs-rollout/is-custom-is-fhs-enabled-context.js +2 -2
- package/dist/esm/ui/fhs-rollout/is-fhs-enabled-context.js +6 -6
- package/dist/esm/ui/fhs-rollout/is-fhs-enabled-provider.js +13 -16
- package/dist/esm/ui/fhs-rollout/use-is-fhs-enabled.js +5 -6
- package/dist/esm/ui/page-layout/banner.compiled.css +0 -1
- package/dist/esm/ui/page-layout/banner.js +2 -5
- package/dist/esm/ui/page-layout/constants.js +0 -12
- package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.compiled.css +0 -1
- package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.js +2 -5
- package/dist/esm/ui/page-layout/panel-splitter/side-nav-panel-splitter.js +2 -71
- package/dist/esm/ui/page-layout/ribbon.js +0 -7
- package/dist/esm/ui/page-layout/side-nav/side-nav-content.js +2 -10
- package/dist/esm/ui/page-layout/side-nav/side-nav.compiled.css +3 -10
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +22 -55
- package/dist/esm/ui/page-layout/top-nav/top-nav-end.compiled.css +0 -1
- package/dist/esm/ui/page-layout/top-nav/top-nav-end.js +2 -5
- package/dist/esm/ui/page-layout/top-nav/top-nav-start.compiled.css +2 -12
- package/dist/esm/ui/page-layout/top-nav/top-nav-start.js +10 -250
- package/dist/esm/ui/page-layout/top-nav/top-nav.compiled.css +1 -15
- package/dist/esm/ui/page-layout/top-nav/top-nav.js +5 -16
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.compiled.css +0 -2
- package/dist/esm/ui/top-nav-items/nav-logo/app-logo.js +6 -11
- package/dist/esm/ui/top-nav-items/nav-logo/custom-logo.compiled.css +0 -2
- package/dist/esm/ui/top-nav-items/nav-logo/custom-logo.js +3 -6
- package/dist/esm/ui/top-nav-items/search.compiled.css +3 -2
- package/dist/esm/ui/top-nav-items/search.js +3 -7
- package/dist/types/ui/fhs-rollout/is-custom-is-fhs-enabled-context.d.ts +2 -2
- package/dist/types/ui/fhs-rollout/is-fhs-enabled-context.d.ts +5 -2
- package/dist/types/ui/fhs-rollout/is-fhs-enabled-provider.d.ts +9 -2
- package/dist/types/ui/fhs-rollout/use-is-fhs-enabled.d.ts +4 -1
- package/dist/types/ui/page-layout/constants.d.ts +0 -4
- package/dist/types/ui/page-layout/panel-splitter/panel-splitter.d.ts +0 -2
- package/dist/types/ui/page-layout/side-nav/side-nav.d.ts +0 -1
- package/package.json +6 -8
|
@@ -1,149 +1,15 @@
|
|
|
1
1
|
/* top-nav-start.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import "./top-nav-start.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, {
|
|
5
|
-
import useStableRef from '@atlaskit/ds-lib/use-stable-ref';
|
|
6
|
-
import { OpenLayerObserverNamespaceProvider } from '@atlaskit/layering/open-layer-observer-namespace-provider';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
|
-
import { UNSAFE_useMediaQuery } from '@atlaskit/primitives/compiled/use-media-query';
|
|
4
|
+
import React, { useContext, useEffect, useRef } from 'react';
|
|
9
5
|
import { TopNavStartAttachRef } from '../../../context/top-nav-start/top-nav-start-attach-ref';
|
|
10
|
-
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
11
|
-
import { useHasCustomTheme } from '../../top-nav-items/themed/has-custom-theme-context';
|
|
12
|
-
import { HasDefaultBackgroundColorContext } from '../../top-nav-items/themed/has-default-background-color-context';
|
|
13
|
-
import { openLayerObserverTopNavStartNamespace } from '../constants';
|
|
14
|
-
import { SideNavVisibilityState } from '../side-nav/side-nav-visibility-state';
|
|
15
|
-
import { useSideNavVisibility } from '../side-nav/use-side-nav-visibility';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Firefox does support these reorder animations, but only partially enabling layout animations would look odd.
|
|
19
|
-
*
|
|
20
|
-
* We are using JS to detect Firefox and disable animations, instead of using CSS, as Compiled currently does not merge duplicate
|
|
21
|
-
* CSS at-rules when at-rules are nested: https://github.com/atlassian-labs/compiled/blob/e04a325915e1d13010205089e4915de0e53bc2d4/packages/css/src/plugins/merge-duplicate-at-rules.ts#L5
|
|
22
|
-
* Avoiding nesting the `@supports` at-rule inside of `@media` means Compiled can remove duplicate styles from the generated CSS.
|
|
23
|
-
*/
|
|
24
|
-
let isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
25
|
-
|
|
26
|
-
// Placed in a variable, as the value is used in the translateX value for the children wrapper animation.
|
|
27
|
-
const flexGap = "var(--ds-space-050, 4px)";
|
|
28
6
|
|
|
29
7
|
/**
|
|
30
8
|
* Styles for the TopNavStart element.
|
|
31
|
-
*
|
|
32
|
-
* When `useIsFhsEnabled` is true this is the styling for the inner element,
|
|
33
|
-
* which re-enables pointer events.
|
|
34
9
|
*/
|
|
35
10
|
const innerStyles = {
|
|
36
|
-
root: "_zulp1b66 _yyhykb7n _4t3i1osq _4cvr1h6o _1e0c1txw _glte1ris _15rip2n4 _1gs5usvi"
|
|
37
|
-
fullHeightSidebarExpanded: "_15rin7od _glte1osq"
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Styles for the outer element, that does not have re-enabled pointer events and spans the entire
|
|
42
|
-
* width of the TopNavStart area.
|
|
43
|
-
*
|
|
44
|
-
* This wrapper element is only rendered when `useIsFhsEnabled` is true.
|
|
45
|
-
*/
|
|
46
|
-
const wrapperStyles = {
|
|
47
|
-
root: "_vchhusvi _bozgutpp _4t3i1osq _13wnh2mm _1l3vb3bt _juxdstnw _1vinidpf _1719idpf _e6znidpf _1kyhe4h9 _4cwynqa1 _435s1l7x _m7c3idpf",
|
|
48
|
-
fullHeightSidebarExpanded: "_glte93mn _exxmutpp _4ap3vuon _m7c3kb7n",
|
|
49
|
-
fullHeightSidebarBorderTransition: "_n8qabrmi _wc72fnf5 _j3mr1v42",
|
|
50
|
-
fullHeightSidebarCustomTheming: "_4ap319ly _1m5lglyw"
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* We use a fixed translateX offset for the slide animation (used when the TopNavStart children elements are reordered).
|
|
55
|
-
* This fixed offset makes the elements appear to animate smoothly from the old to the new position.
|
|
56
|
-
* This offset is calculated based on:
|
|
57
|
-
* - 32px (2rem) width of the side nav toggle button (IconButton)
|
|
58
|
-
* - 4px gap ('space.050' token) of the flex container
|
|
59
|
-
*
|
|
60
|
-
* The benefit of hardcoding this offset is that we don't need to calculate it using JS each time the sidebar is toggled.
|
|
61
|
-
* However, it could become out of sync if the width of IconButton changes.
|
|
62
|
-
*
|
|
63
|
-
* The alternative is using JS to store the previous position of the children wrapper element, and calculate the offset based on
|
|
64
|
-
* the new position, and then transforming using that offset. This would prevent the animation from going out of sync.
|
|
65
|
-
*/
|
|
66
|
-
const childrenWrapperAnimationOffset = `calc(2rem + ${flexGap})`;
|
|
67
|
-
const childrenWrapperStyles = {
|
|
68
|
-
root: "_zulp1kw7 _1e0c1kw7 _4cvr1h6o _1ul9idpf _15yekb7n _65m41mrw",
|
|
69
|
-
animationBaseStyles: "_10t81e03",
|
|
70
|
-
finalPosition: "_mjvcz12g _xrrpfnf5",
|
|
71
|
-
expandAnimationStartPosition: "_mjvcyrjp",
|
|
72
|
-
collapseAnimationStartPosition: "_mjvco0k7"
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* We use a fixed translateX offset for the toggle button slide animation (used when the TopNavStart children elements are reordered).
|
|
77
|
-
* The specific value doesn't matter too much for the toggle button animation, so we are using `100%`, which will match the toggle button width.
|
|
78
|
-
*
|
|
79
|
-
* By combining the `translateX` animation with an `opacity` fade, the feel and experience is actually quite similar to animating the
|
|
80
|
-
* element from the exact old position (offset), and it avoids the additional complexity of needing to track and calculate the exact offset.
|
|
81
|
-
*/
|
|
82
|
-
const toggleButtonWrapperStyles = {
|
|
83
|
-
root: "_15yekb7n _65m41mrw _10t81rjc",
|
|
84
|
-
finalPosition: "_mjvcz12g _xrrpfnf5 _bgpzkb7n",
|
|
85
|
-
expandAnimationStartPosition: "_mjvc1p9u _bgpzidpf",
|
|
86
|
-
collapseAnimationStartPosition: "_mjvc1efy _bgpzidpf",
|
|
87
|
-
expandAnimationTimingFunction: "_1xq51ytf",
|
|
88
|
-
collapseAnimationTimingFunction: "_1xq55ucs",
|
|
89
|
-
alignEnd: "_ahbq1wug"
|
|
11
|
+
root: "_zulp1b66 _yyhykb7n _4t3i1osq _4cvr1h6o _1e0c1txw _glte1ris _15rip2n4 _1gs5usvi"
|
|
90
12
|
};
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* The consistent key used for the side nav toggle button to ensure it does not get remounted
|
|
94
|
-
* when it is reordered.
|
|
95
|
-
*
|
|
96
|
-
* This ensures we get focus restoration for free.
|
|
97
|
-
*/
|
|
98
|
-
const sideNavToggleButtonKey = 'side-nav-toggle-button';
|
|
99
|
-
const TopNavStartInnerOld = /*#__PURE__*/forwardRef(function TopNavStartInner({
|
|
100
|
-
children,
|
|
101
|
-
testId
|
|
102
|
-
}, ref) {
|
|
103
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
104
|
-
ref: ref,
|
|
105
|
-
"data-testid": testId,
|
|
106
|
-
className: ax([innerStyles.root])
|
|
107
|
-
}, children);
|
|
108
|
-
});
|
|
109
|
-
const TopNavStartInnerFHS = /*#__PURE__*/forwardRef(function TopNavStartInnerFHS({
|
|
110
|
-
children,
|
|
111
|
-
testId
|
|
112
|
-
}, ref) {
|
|
113
|
-
// This needs the real `defaultCollapsed` state or will not SSR properly
|
|
114
|
-
// TODO: lift `defaultCollapsed` state to `Root` (DSP-23683)
|
|
115
|
-
// then context value will be correct in SSR / from initial render
|
|
116
|
-
const {
|
|
117
|
-
isExpandedOnDesktop
|
|
118
|
-
} = useSideNavVisibility({
|
|
119
|
-
defaultCollapsed: true
|
|
120
|
-
});
|
|
121
|
-
const sideNavState = useContext(SideNavVisibilityState);
|
|
122
|
-
const isFirstRenderRef = useRef(true);
|
|
123
|
-
useEffect(() => {
|
|
124
|
-
// Ignore renders until the side nav state is initialized
|
|
125
|
-
// So that apps using the legacy API for setting side nav default state do not see
|
|
126
|
-
// animations when they shouldn't
|
|
127
|
-
if (sideNavState === null) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
if (isFirstRenderRef.current) {
|
|
131
|
-
isFirstRenderRef.current = false;
|
|
132
|
-
}
|
|
133
|
-
}, [sideNavState]);
|
|
134
|
-
const hasCustomTheme = useHasCustomTheme();
|
|
135
|
-
const hasDefaultBackgroundColor = useContext(HasDefaultBackgroundColorContext);
|
|
136
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
137
|
-
className: ax([wrapperStyles.root, isExpandedOnDesktop && wrapperStyles.fullHeightSidebarExpanded, !isFirstRenderRef.current && isExpandedOnDesktop && wrapperStyles.fullHeightSidebarBorderTransition, hasCustomTheme && !hasDefaultBackgroundColor && fg('platform_dst_nav4_custom_theming_fhs_1') && wrapperStyles.fullHeightSidebarCustomTheming])
|
|
138
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
139
|
-
ref: ref,
|
|
140
|
-
"data-testid": testId,
|
|
141
|
-
className: ax([innerStyles.root, isExpandedOnDesktop && innerStyles.fullHeightSidebarExpanded])
|
|
142
|
-
}, /*#__PURE__*/React.createElement(OpenLayerObserverNamespaceProvider, {
|
|
143
|
-
namespace: openLayerObserverTopNavStartNamespace
|
|
144
|
-
}, children)));
|
|
145
|
-
});
|
|
146
|
-
|
|
147
13
|
/**
|
|
148
14
|
* __TopNavStart__
|
|
149
15
|
*
|
|
@@ -154,7 +20,6 @@ export function TopNavStart({
|
|
|
154
20
|
testId,
|
|
155
21
|
sideNavToggleButton
|
|
156
22
|
}) {
|
|
157
|
-
const isFhsEnabled = useIsFhsEnabled();
|
|
158
23
|
const ref = useContext(TopNavStartAttachRef);
|
|
159
24
|
const elementRef = useRef(null);
|
|
160
25
|
|
|
@@ -163,111 +28,9 @@ export function TopNavStart({
|
|
|
163
28
|
useEffect(() => {
|
|
164
29
|
ref(elementRef.current);
|
|
165
30
|
}, [elementRef, ref]);
|
|
166
|
-
|
|
167
|
-
// This needs the real `defaultCollapsed` state or will not SSR properly
|
|
168
|
-
// TODO: lift `defaultCollapsed` state to `Root` (DSP-23683)
|
|
169
|
-
// then context value will be correct in SSR / from initial render
|
|
170
|
-
const {
|
|
171
|
-
isExpandedOnDesktop
|
|
172
|
-
} = useSideNavVisibility({
|
|
173
|
-
defaultCollapsed: true
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
// For SSR assume desktop
|
|
177
|
-
const [isDesktop, setIsDesktop] = useState(true);
|
|
178
|
-
// Set state to real value on client
|
|
179
|
-
// This could result in some visible shift on mobile when hydrating SSR
|
|
180
|
-
// TODO: review and improve SSR behavior as necessary (DSP-23817)
|
|
181
|
-
useLayoutEffect(() => {
|
|
182
|
-
// Checking this to avoid breaking tests when `matchMedia` is not mocked
|
|
183
|
-
// Ideally we wouldn't cater to test environments, but this avoids introducing unnecessary friction
|
|
184
|
-
if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
|
|
185
|
-
setIsDesktop(window.matchMedia('(min-width: 64rem)').matches);
|
|
186
|
-
}
|
|
187
|
-
}, []);
|
|
188
|
-
UNSAFE_useMediaQuery('above.md', event => {
|
|
189
|
-
setIsDesktop(event.matches);
|
|
190
|
-
});
|
|
191
|
-
const [animationState, setAnimationState] = useState({
|
|
192
|
-
type: 'idle'
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
// Used to prevent the reorder animations from running on the initial render.
|
|
196
|
-
const isFirstRenderRef = useRef(true);
|
|
197
|
-
const sideNavState = useContext(SideNavVisibilityState);
|
|
198
|
-
useEffect(() => {
|
|
199
|
-
if (!isFhsEnabled) {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// Ignore renders until the side nav state is initialized
|
|
204
|
-
// So that apps using the legacy API for setting side nav default state do not see
|
|
205
|
-
// animations when they shouldn't
|
|
206
|
-
if (sideNavState === null) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
if (isFirstRenderRef.current) {
|
|
210
|
-
isFirstRenderRef.current = false;
|
|
211
|
-
}
|
|
212
|
-
}, [isFhsEnabled, sideNavState]);
|
|
213
|
-
|
|
214
|
-
// Using a stable ref to avoid re-running the animation layout effect when the toggle button prop value changes, which
|
|
215
|
-
// can happen a lot (e.g. if the parent re-renders)
|
|
216
|
-
const sideNavToggleButtonStableRef = useStableRef(sideNavToggleButton);
|
|
217
|
-
useLayoutEffect(() => {
|
|
218
|
-
if (!isFhsEnabled) {
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* This layout effect is used to animate the TopNavStart children elements to their new position after being reordered.
|
|
224
|
-
* It is called when the sidebar's desktop expansion state changes.
|
|
225
|
-
*
|
|
226
|
-
* It works by first setting a translateX offset on the elements, used as the start position of the slide animation.
|
|
227
|
-
* - For the toggle button, it's a fixed offset. It's combined with an opacity, so the exact offset doesn't matter too much.
|
|
228
|
-
* - For the children wrapper (wrapping everything except the toggle button), an offset was chosen to make the animation
|
|
229
|
-
* start position the exact same as the element's old position. See comments for `childrenWrapperStyles` for more details.
|
|
230
|
-
*
|
|
231
|
-
* On the next frame, the translateX offset is cleared, triggering the animation to the new position.
|
|
232
|
-
*/
|
|
233
|
-
|
|
234
|
-
if (isFirstRenderRef.current) {
|
|
235
|
-
// No animations on initial render.
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
if (!sideNavToggleButtonStableRef.current) {
|
|
239
|
-
// If there is no toggle button, there should be no re-order animations.
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// Set the translateX offsets so elements are ready to animate to their actual new position after being reordered
|
|
244
|
-
setAnimationState({
|
|
245
|
-
type: isExpandedOnDesktop ? 'expand' : 'collapse'
|
|
246
|
-
});
|
|
247
|
-
requestAnimationFrame(() => {
|
|
248
|
-
// Clear translateX offsets on next frame to trigger animation to new position in a re-render
|
|
249
|
-
setAnimationState({
|
|
250
|
-
type: 'idle'
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
// This layout effect is called when the sidebar's desktop expansion state changes.
|
|
255
|
-
}, [isExpandedOnDesktop, isFhsEnabled, sideNavToggleButtonStableRef]);
|
|
256
|
-
const TopNavStartInner = isFhsEnabled ? TopNavStartInnerFHS : TopNavStartInnerOld;
|
|
257
|
-
return /*#__PURE__*/React.createElement(TopNavStartInner, {
|
|
31
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
258
32
|
ref: elementRef,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
className: ax([!isFirefox && toggleButtonWrapperStyles.root, !isFirefox && animationState.type === 'idle' && toggleButtonWrapperStyles.finalPosition, !isFirefox &&
|
|
263
|
-
// Timing function is applied when the browser animates to the idle position.
|
|
264
|
-
animationState.type === 'idle' && toggleButtonWrapperStyles.collapseAnimationTimingFunction, !isFirefox && animationState.type === 'collapse' && toggleButtonWrapperStyles.collapseAnimationStartPosition])
|
|
265
|
-
}, sideNavToggleButton), isFhsEnabled ? /*#__PURE__*/React.createElement("div", {
|
|
266
|
-
className: ax([childrenWrapperStyles.root, !isFirefox && childrenWrapperStyles.animationBaseStyles, !isFirefox && animationState.type === 'idle' && childrenWrapperStyles.finalPosition, !isFirefox && animationState.type === 'expand' && childrenWrapperStyles.expandAnimationStartPosition, !isFirefox && animationState.type === 'collapse' && childrenWrapperStyles.collapseAnimationStartPosition])
|
|
267
|
-
}, children) : children, sideNavToggleButton && isDesktop && isExpandedOnDesktop && isFhsEnabled && /*#__PURE__*/React.createElement("div", {
|
|
268
|
-
key: sideNavToggleButtonKey,
|
|
269
|
-
className: ax([!isFirefox && toggleButtonWrapperStyles.root, toggleButtonWrapperStyles.alignEnd, !isFirefox && animationState.type === 'idle' && toggleButtonWrapperStyles.finalPosition, !isFirefox &&
|
|
270
|
-
// Timing function is applied when the browser animates to the idle position.
|
|
271
|
-
animationState.type === 'idle' && toggleButtonWrapperStyles.expandAnimationTimingFunction, !isFirefox && animationState.type === 'expand' && toggleButtonWrapperStyles.expandAnimationStartPosition])
|
|
272
|
-
}, sideNavToggleButton));
|
|
33
|
+
"data-testid": testId,
|
|
34
|
+
className: ax([innerStyles.root])
|
|
35
|
+
}, sideNavToggleButton, children);
|
|
273
36
|
}
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
._nd5l8cbt{grid-area:top-bar}
|
|
2
2
|
._zulpu2gc{gap:var(--ds-space-100,8px)}
|
|
3
3
|
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
4
|
-
._18zrze3t{padding-inline:var(--ds-space-0,0)}
|
|
5
|
-
._179rglyw{border-block-end:none}
|
|
6
4
|
._179ria51{border-block-end:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._152t1nws{inset-block-start:var(--n_bnrM,0)}
|
|
7
|
-
._18postnw:after{position:absolute}
|
|
8
|
-
._1beue4h9:after{border-block-end-width:var(--ds-border-width,1px)}
|
|
9
|
-
._1cte1l7x:after{border-block-end-color:var(--ds-border,#0b120e24)}
|
|
10
|
-
._1czdidpf:after{inset-inline-end:0}
|
|
11
5
|
._1e0c11p5{display:grid}
|
|
12
|
-
._1gufidpf:after{inset-block-end:0}
|
|
13
|
-
._1pby11wp{z-index:3}
|
|
14
6
|
._1pbyegat{z-index:4}
|
|
15
7
|
._4cvr1h6o{align-items:center}
|
|
16
8
|
._4t3i1dgc{height:var(--n_tNvM)}
|
|
17
|
-
._aetrb3bt:after{content:""}
|
|
18
9
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
19
10
|
._d6vu1bgi >span[data-ep-placeholder-id=top_navigation_skeleton]{display:contents}
|
|
20
|
-
._g0nf3tht:after{inset-inline-start:var(--n_sNvlw,0)}
|
|
21
11
|
._kqsw1if8{position:sticky}
|
|
22
|
-
._lcxv1wug{pointer-events:auto}
|
|
23
|
-
._uaeunqa1:after{border-block-end-style:solid}
|
|
24
12
|
._vchhusvi{box-sizing:border-box}
|
|
25
13
|
._yv0e1mfv{grid-template-columns:auto 1fr auto}
|
|
26
|
-
@media (min-width:48rem){._1j8b18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
27
|
-
@media (min-width:64rem){._1m5lglyw:after{display:none}._1rqt16a9{grid-template-columns:0fr minmax(min-content,max-content) 1fr}._pdlmutpp{gap:var(--ds-space-150,9pt)}}
|
|
28
|
-
@media (min-width:110.5rem){._jh1g18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
14
|
+
@media (min-width:48rem){._1j8b18ax{grid-template-columns:1fr minmax(min-content,max-content) 1fr}}
|
|
@@ -6,7 +6,6 @@ import { useContext } from 'react';
|
|
|
6
6
|
import { componentWithFG } from '@atlaskit/platform-feature-flags-react/component-with-fg';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
8
|
import { useSkipLinkInternal } from '../../../context/skip-links/use-skip-link-internal';
|
|
9
|
-
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
10
9
|
import { HasCustomThemeContext } from '../../top-nav-items/themed/has-custom-theme-context';
|
|
11
10
|
import { HasDefaultBackgroundColorContext } from '../../top-nav-items/themed/has-default-background-color-context';
|
|
12
11
|
import { useCustomTheme } from '../../top-nav-items/themed/use-custom-theme';
|
|
@@ -15,7 +14,6 @@ import { UNSAFE_topNavVar, topNavMountedVar } from '../constants';
|
|
|
15
14
|
import { DangerouslyHoistCssVarToDocumentRoot } from '../dangerously-hoist-css-var-to-document-root';
|
|
16
15
|
import { HoistCssVarToLocalGrid } from '../hoist-css-var-to-local-grid';
|
|
17
16
|
import { DangerouslyHoistSlotSizes } from '../hoist-slot-sizes-context';
|
|
18
|
-
import { useSideNavVisibility } from '../side-nav/use-side-nav-visibility';
|
|
19
17
|
import { useLayoutId } from '../use-layout-id';
|
|
20
18
|
|
|
21
19
|
/**
|
|
@@ -27,10 +25,7 @@ import { useLayoutId } from '../use-layout-id';
|
|
|
27
25
|
* - The background sits below the expanded side nav
|
|
28
26
|
*/
|
|
29
27
|
const styles = {
|
|
30
|
-
root: "_nd5l8cbt _zulpu2gc _18zrutpp _179ria51 _1e0c11p5 _yv0e1mfv _4cvr1h6o _bfhkvuon _vchhusvi _4t3i1dgc _152t1nws _kqsw1if8 _1pbyegat _d6vu1bgi _1j8b18ax"
|
|
31
|
-
fullHeightSidebar: "_18zrze3t _179rglyw _lcxv1wug _bfhkvuon _1pby11wp _aetrb3bt _18postnw _1gufidpf _1czdidpf _g0nf3tht _1beue4h9 _uaeunqa1 _1cte1l7x _pdlmutpp",
|
|
32
|
-
fullHeightSidebarExpanded: "_1rqt16a9 _jh1g18ax",
|
|
33
|
-
fullHeightSidebarCustomTheming: "_1m5lglyw"
|
|
28
|
+
root: "_nd5l8cbt _zulpu2gc _18zrutpp _179ria51 _1e0c11p5 _yv0e1mfv _4cvr1h6o _bfhkvuon _vchhusvi _4t3i1dgc _152t1nws _kqsw1if8 _1pbyegat _d6vu1bgi _1j8b18ax"
|
|
34
29
|
};
|
|
35
30
|
/**
|
|
36
31
|
* The top nav layout area. It will display at the top of the screen, below the banner if one is present.
|
|
@@ -44,7 +39,6 @@ function TopNavOld({
|
|
|
44
39
|
id: providedId,
|
|
45
40
|
customTheme: customThemeConfig
|
|
46
41
|
}) {
|
|
47
|
-
const isFhsEnabled = useIsFhsEnabled();
|
|
48
42
|
const dangerouslyHoistSlotSizes = useContext(DangerouslyHoistSlotSizes);
|
|
49
43
|
const id = useLayoutId({
|
|
50
44
|
providedId
|
|
@@ -54,17 +48,14 @@ function TopNavOld({
|
|
|
54
48
|
label: skipLinkLabel,
|
|
55
49
|
isHidden: fg('platform_dst_nav4_skip_link_a11y_1')
|
|
56
50
|
});
|
|
57
|
-
const height = heightProp !== null && heightProp !== void 0 ? heightProp :
|
|
51
|
+
const height = heightProp !== null && heightProp !== void 0 ? heightProp : fg('platform_dst_ads_appswitcher_improvements') ? 56 : 48;
|
|
58
52
|
const customTheme = useCustomTheme(customThemeConfig);
|
|
59
|
-
const {
|
|
60
|
-
isExpandedOnDesktop
|
|
61
|
-
} = useSideNavVisibility();
|
|
62
53
|
return /*#__PURE__*/React.createElement(HasCustomThemeContext.Provider, {
|
|
63
54
|
value: customTheme.isEnabled
|
|
64
55
|
}, /*#__PURE__*/React.createElement("header", {
|
|
65
56
|
id: id,
|
|
66
57
|
"data-layout-slot": true,
|
|
67
|
-
className: ax([styles.root,
|
|
58
|
+
className: ax([styles.root, xcss]),
|
|
68
59
|
"data-testid": testId
|
|
69
60
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
70
61
|
,
|
|
@@ -97,7 +88,6 @@ function TopNavNew({
|
|
|
97
88
|
id: providedId,
|
|
98
89
|
customTheme: customThemeConfig
|
|
99
90
|
}) {
|
|
100
|
-
const isFhsEnabled = useIsFhsEnabled();
|
|
101
91
|
const dangerouslyHoistSlotSizes = useContext(DangerouslyHoistSlotSizes);
|
|
102
92
|
const id = useLayoutId({
|
|
103
93
|
providedId
|
|
@@ -107,12 +97,9 @@ function TopNavNew({
|
|
|
107
97
|
label: skipLinkLabel,
|
|
108
98
|
isHidden: fg('platform_dst_nav4_skip_link_a11y_1')
|
|
109
99
|
});
|
|
110
|
-
const height = heightProp !== null && heightProp !== void 0 ? heightProp :
|
|
100
|
+
const height = heightProp !== null && heightProp !== void 0 ? heightProp : fg('platform_dst_ads_appswitcher_improvements') ? 56 : 48;
|
|
111
101
|
const customTheme = useCustomThemeNew(customThemeConfig);
|
|
112
102
|
const hasDefaultBackground = customTheme.isEnabled ? customTheme.hasDefaultBackground : true;
|
|
113
|
-
const {
|
|
114
|
-
isExpandedOnDesktop
|
|
115
|
-
} = useSideNavVisibility();
|
|
116
103
|
return /*#__PURE__*/React.createElement(HasCustomThemeContext.Provider, {
|
|
117
104
|
value: customTheme.isEnabled
|
|
118
105
|
}, /*#__PURE__*/React.createElement(HasDefaultBackgroundColorContext.Provider, {
|
|
@@ -120,7 +107,7 @@ function TopNavNew({
|
|
|
120
107
|
}, /*#__PURE__*/React.createElement("header", {
|
|
121
108
|
id: id,
|
|
122
109
|
"data-layout-slot": true,
|
|
123
|
-
className: ax([styles.root,
|
|
110
|
+
className: ax([styles.root, xcss]),
|
|
124
111
|
"data-testid": testId
|
|
125
112
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
126
113
|
,
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
._1e0c1txw{display:flex}
|
|
6
6
|
._1e0cglyw{display:none}
|
|
7
7
|
._1o9zidpf{flex-shrink:0}
|
|
8
|
-
._1o9zkb7n{flex-shrink:1}
|
|
9
8
|
._1pfh1i6y{margin-block-start:var(--ds-space-negative-025,-2px)}
|
|
10
9
|
._1reo15vq{overflow-x:hidden}
|
|
11
10
|
._1toh1r31._1toh1r31{text-decoration-color:currentColor}
|
|
@@ -17,7 +16,6 @@
|
|
|
17
16
|
._ahbq1b66{margin-inline-start:var(--ds-space-050,4px)}
|
|
18
17
|
._c71l1tcg{max-height:24px}
|
|
19
18
|
._mrqmnqa1._mrqmnqa1{text-decoration-style:solid}
|
|
20
|
-
._p12f1osq{max-width:100%}
|
|
21
19
|
._p12f1tcg{max-width:24px}
|
|
22
20
|
._p12fnklw{max-width:20pc}
|
|
23
21
|
._uiztglyw{-webkit-user-select:none;-ms-user-select:none;user-select:none}
|
|
@@ -8,22 +8,18 @@ import { Anchor } from '@atlaskit/primitives/compiled/anchor';
|
|
|
8
8
|
import { Inline } from '@atlaskit/primitives/compiled/inline';
|
|
9
9
|
import { Text } from '@atlaskit/primitives/compiled/text';
|
|
10
10
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
11
|
-
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
12
11
|
import { useHasCustomTheme } from '../themed/has-custom-theme-context';
|
|
13
12
|
import { LogoRenderer } from './logo-renderer';
|
|
14
13
|
const anchorStyles = {
|
|
15
14
|
root: "_2rko1mok _1e0c1txw _4cvr1h6o _4t3izwfg _1o9zidpf _ahbq1b66 _1toh1r31 _5jyqglyw _mrqmnqa1 _1w901kw7",
|
|
16
15
|
interactionStates: "_irr31dpa _1di69yc7",
|
|
17
|
-
interactionStatesCustomTheming: "_irr31rps _1di6yhlj"
|
|
18
|
-
fullHeightSidebar: "_1reo15vq _18m915vq _1o9zkb7n"
|
|
16
|
+
interactionStatesCustomTheming: "_irr31rps _1di6yhlj"
|
|
19
17
|
};
|
|
20
18
|
const logoWrapperStyles = {
|
|
21
|
-
root: "_18zr1b66"
|
|
22
|
-
fullHeightSidebar: "_p12f1osq"
|
|
19
|
+
root: "_18zr1b66"
|
|
23
20
|
};
|
|
24
21
|
const iconContainerStyles = {
|
|
25
|
-
root: "_1reo15vq _18m915vq _1e0c1txw _p12f1tcg _c71l1tcg"
|
|
26
|
-
fullHeightSidebar: "_1o9zidpf"
|
|
22
|
+
root: "_1reo15vq _18m915vq _1e0c1txw _p12f1tcg _c71l1tcg"
|
|
27
23
|
};
|
|
28
24
|
const logoTextStyles = {
|
|
29
25
|
root: "_1bsb1ris _p12fnklw _uiztglyw _y4tiv77o _1e0cglyw _2lx21bp4 _1bah1h6o _10y41txw"
|
|
@@ -51,7 +47,6 @@ export const AppLogo = ({
|
|
|
51
47
|
icon,
|
|
52
48
|
onClick
|
|
53
49
|
}) => {
|
|
54
|
-
const isFhsEnabled = useIsFhsEnabled();
|
|
55
50
|
const ref = useRef(null);
|
|
56
51
|
const nameRef = useRef(null);
|
|
57
52
|
const hasCustomTheme = useHasCustomTheme();
|
|
@@ -71,14 +66,14 @@ export const AppLogo = ({
|
|
|
71
66
|
// @ts-expect-error - non-standard values for `borderRadius` and the custom theming interaction states
|
|
72
67
|
// eslint-disable-next-line @compiled/no-suppress-xcss
|
|
73
68
|
,
|
|
74
|
-
xcss: cx(anchorStyles.root, hasCustomTheme ? anchorStyles.interactionStatesCustomTheming : anchorStyles.interactionStates
|
|
69
|
+
xcss: cx(anchorStyles.root, hasCustomTheme ? anchorStyles.interactionStatesCustomTheming : anchorStyles.interactionStates),
|
|
75
70
|
onClick: onClick
|
|
76
71
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
77
72
|
space: "space.075",
|
|
78
73
|
alignBlock: "center",
|
|
79
|
-
xcss:
|
|
74
|
+
xcss: logoWrapperStyles.root
|
|
80
75
|
}, /*#__PURE__*/React.createElement("div", {
|
|
81
|
-
className: ax([iconContainerStyles.root
|
|
76
|
+
className: ax([iconContainerStyles.root])
|
|
82
77
|
}, /*#__PURE__*/React.createElement(LogoRenderer, {
|
|
83
78
|
logoOrIcon: icon
|
|
84
79
|
})), /*#__PURE__*/React.createElement("span", {
|
|
@@ -5,12 +5,10 @@
|
|
|
5
5
|
._1e0cglyw{display:none}
|
|
6
6
|
._1jpx1f51 img{object-fit:contain}
|
|
7
7
|
._1reo15vq{overflow-x:hidden}
|
|
8
|
-
._1ul91tcg{min-width:24px}
|
|
9
8
|
._4cvr1h6o{align-items:center}
|
|
10
9
|
._4t3izwfg{height:2pc}
|
|
11
10
|
._ahbq1b66{margin-inline-start:var(--ds-space-050,4px)}
|
|
12
11
|
._bna71tcg img{height:24px}
|
|
13
|
-
._p12f1osq{max-width:100%}
|
|
14
12
|
._p12f1tcg{max-width:24px}
|
|
15
13
|
._p12fnklw{max-width:20pc}
|
|
16
14
|
._rtys1kw7 img{max-width:inherit}
|
|
@@ -4,7 +4,6 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useEffect, useRef } from 'react';
|
|
5
5
|
import { cx } from '@compiled/react';
|
|
6
6
|
import { Anchor } from '@atlaskit/primitives/compiled/anchor';
|
|
7
|
-
import { useIsFhsEnabled } from '../../fhs-rollout/use-is-fhs-enabled';
|
|
8
7
|
import { useHasCustomTheme } from '../themed/has-custom-theme-context';
|
|
9
8
|
import { LogoRenderer } from './logo-renderer';
|
|
10
9
|
const anchorStyles = {
|
|
@@ -15,8 +14,7 @@ const anchorStyles = {
|
|
|
15
14
|
newInteractionStatesCustomTheming: "_irr31rps _1di6yhlj"
|
|
16
15
|
};
|
|
17
16
|
const sharedIconOrLogoContainerStyles = {
|
|
18
|
-
root: "_1reo15vq _18m915vq _18zr1b66 _bna71tcg _rtys1kw7 _1jpx1f51"
|
|
19
|
-
withFullHeightSidebar: "_p12f1osq _1ul91tcg"
|
|
17
|
+
root: "_1reo15vq _18m915vq _18zr1b66 _bna71tcg _rtys1kw7 _1jpx1f51"
|
|
20
18
|
};
|
|
21
19
|
const iconContainerStyles = {
|
|
22
20
|
root: "_1e0c1txw _p12f1tcg _vchh1ntv _10y4glyw"
|
|
@@ -72,7 +70,6 @@ export const CustomLogo = ({
|
|
|
72
70
|
}
|
|
73
71
|
}, []);
|
|
74
72
|
const hasCustomTheme = useHasCustomTheme();
|
|
75
|
-
const isFhsEnabled = useIsFhsEnabled();
|
|
76
73
|
return /*#__PURE__*/React.createElement(Anchor, {
|
|
77
74
|
ref: ref,
|
|
78
75
|
"aria-label": label,
|
|
@@ -83,11 +80,11 @@ export const CustomLogo = ({
|
|
|
83
80
|
xcss: cx(anchorStyles.root, anchorStyles.customLogoBorderRadius, anchorStyles.newMargin, hasCustomTheme ? anchorStyles.newInteractionStatesCustomTheming : anchorStyles.newInteractionStates),
|
|
84
81
|
onClick: onClick
|
|
85
82
|
}, /*#__PURE__*/React.createElement("div", {
|
|
86
|
-
className: ax([sharedIconOrLogoContainerStyles.root, iconContainerStyles.root
|
|
83
|
+
className: ax([sharedIconOrLogoContainerStyles.root, iconContainerStyles.root])
|
|
87
84
|
}, /*#__PURE__*/React.createElement(LogoRenderer, {
|
|
88
85
|
logoOrIcon: icon
|
|
89
86
|
})), /*#__PURE__*/React.createElement("div", {
|
|
90
|
-
className: ax([sharedIconOrLogoContainerStyles.root, logoContainerStyles.root
|
|
87
|
+
className: ax([sharedIconOrLogoContainerStyles.root, logoContainerStyles.root])
|
|
91
88
|
}, /*#__PURE__*/React.createElement(LogoRenderer, {
|
|
92
89
|
logoOrIcon: logo
|
|
93
90
|
})));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
1
|
+
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
2
|
+
._v564k6bl{transition:var(--ds-button-hovered,background-color border-color .15s cubic-bezier(.4,1,.6,1))}._18zr12x7{padding-inline:var(--ds-space-075,6px)}
|
|
2
3
|
._1ii7kb7n{grid-row:1}
|
|
3
4
|
._1rjcze3t{padding-block:var(--ds-space-0,0)}
|
|
4
5
|
._yyhy11wp{grid-column:3}
|
|
@@ -12,9 +13,9 @@
|
|
|
12
13
|
._80om1kdv{cursor:text}
|
|
13
14
|
._bfhk1j9a{background-color:var(--ds-background-input,#fff)}
|
|
14
15
|
._p12f1kvu{max-width:680px}
|
|
15
|
-
._p12fktbq{max-width:780px}
|
|
16
16
|
._vchhusvi{box-sizing:border-box}
|
|
17
17
|
._yv0e1mfv{grid-template-columns:auto 1fr auto}
|
|
18
18
|
._irr3l4ek:hover{background-color:var(--ds-background-input-hovered,#f8f8f8)}
|
|
19
|
+
._1ggl5xtf:active{transition:var(--ds-button-pressed,background-color border-color .15s cubic-bezier(.4,1,.6,1))}
|
|
19
20
|
._1di6r01l:active{background-color:var(--ds-background-input-pressed,#fff)}
|
|
20
21
|
@media (min-width:30rem){._114b11p5{display:grid}}
|
|
@@ -2,20 +2,17 @@
|
|
|
2
2
|
import "./search.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { Fragment } from 'react';
|
|
5
|
-
import { cx } from '@atlaskit/css';
|
|
6
5
|
import SearchIcon from '@atlaskit/icon/core/search';
|
|
7
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
7
|
import { Pressable } from '@atlaskit/primitives/compiled/pressable';
|
|
9
8
|
import { Show } from '@atlaskit/primitives/compiled/show';
|
|
10
9
|
import { Text } from '@atlaskit/primitives/compiled/text';
|
|
11
|
-
import { useIsFhsEnabled } from '../fhs-rollout/use-is-fhs-enabled';
|
|
12
10
|
import { IconButton } from './themed/icon-button';
|
|
13
11
|
const styles = {
|
|
14
|
-
root: "_2rko1qi0 _1rjcze3t _18zr12x7 _yv0e1mfv _4cvr1h6o _bfhk1j9a _vchhusvi _80om1kdv _1e0cglyw _4t3izwfg _p12f1kvu _1bsb1osq _irr3l4ek _1di6r01l _114b11p5",
|
|
12
|
+
root: "_2rko1qi0 _v564k6bl _1rjcze3t _18zr12x7 _yv0e1mfv _4cvr1h6o _bfhk1j9a _vchhusvi _80om1kdv _1e0cglyw _4t3izwfg _p12f1kvu _1bsb1osq _irr3l4ek _1ggl5xtf _1di6r01l _114b11p5",
|
|
15
13
|
buttonText: "_yyhyjvu9 _1ii7kb7n",
|
|
16
14
|
iconBefore: "_yyhykb7n _1ii7kb7n _1e0c1txw",
|
|
17
|
-
elemAfter: "_yyhy11wp _1ii7kb7n _1e0c1txw"
|
|
18
|
-
fullHeightSidebar: "_p12fktbq"
|
|
15
|
+
elemAfter: "_yyhy11wp _1ii7kb7n _1e0c1txw"
|
|
19
16
|
};
|
|
20
17
|
/**
|
|
21
18
|
* __Search__
|
|
@@ -30,7 +27,6 @@ export const Search = ({
|
|
|
30
27
|
interactionName,
|
|
31
28
|
'aria-haspopup': ariaHaspopup
|
|
32
29
|
}) => {
|
|
33
|
-
const isFhsEnabled = useIsFhsEnabled();
|
|
34
30
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Pressable, {
|
|
35
31
|
style: {
|
|
36
32
|
// To win the specificity war against Emotion we move this into inline styles
|
|
@@ -40,7 +36,7 @@ export const Search = ({
|
|
|
40
36
|
border: `${"var(--ds-border-width, 1px)"} solid ${fg('platform-dst-tokens-finesse') ? "var(--ds-border-input-search, #0B120E24)" : "var(--ds-border-input, #8C8F97)"}`
|
|
41
37
|
},
|
|
42
38
|
onClick: onClick,
|
|
43
|
-
xcss:
|
|
39
|
+
xcss: styles.root,
|
|
44
40
|
interactionName: interactionName,
|
|
45
41
|
"aria-haspopup": ariaHaspopup
|
|
46
42
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -3,7 +3,7 @@ import { createContext } from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* __Is custom is fhs enabled context__
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* @deprecated Full height sidebar (FHS) has been rolled back. This context is no longer used and
|
|
7
|
+
* will be deleted in a future major release.
|
|
8
8
|
*/
|
|
9
9
|
export var IsCustomIsFhsEnabledContext = /*#__PURE__*/createContext(false);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
2
|
/**
|
|
4
3
|
* __Is fhs enabled context__
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* @deprecated Full height sidebar (FHS) has been rolled back and this context is no longer read by
|
|
6
|
+
* any platform component. Its value is ignored. Remove usages of it; it will be deleted in a future
|
|
7
|
+
* major release.
|
|
8
|
+
*
|
|
9
|
+
* See https://hello.atlassian.net/wiki/spaces/navx/pages/7189669176/Full+Height+Sidebar+FHS+Rollback+Plan
|
|
8
10
|
*/
|
|
9
|
-
export var IsFhsEnabledContext = /*#__PURE__*/createContext(
|
|
10
|
-
return fg('navx-full-height-sidebar');
|
|
11
|
-
});
|
|
11
|
+
export var IsFhsEnabledContext = /*#__PURE__*/createContext(false);
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { IsCustomIsFhsEnabledContext } from './is-custom-is-fhs-enabled-context';
|
|
3
|
-
import { IsFhsEnabledContext } from './is-fhs-enabled-context';
|
|
1
|
+
import React from 'react';
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* __Is fhs enabled provider__
|
|
7
5
|
*
|
|
8
|
-
*
|
|
6
|
+
* @deprecated Full height sidebar (FHS) has been rolled back. This provider is now a passthrough:
|
|
7
|
+
* it renders its children and ignores `value`. Remove it from your app; it will be deleted in a
|
|
8
|
+
* future major release.
|
|
9
|
+
*
|
|
10
|
+
* See https://hello.atlassian.net/wiki/spaces/navx/pages/7189669176/Full+Height+Sidebar+FHS+Rollback+Plan
|
|
9
11
|
*/
|
|
10
12
|
export var IsFhsEnabledProvider = function IsFhsEnabledProvider(_ref) {
|
|
11
|
-
var children = _ref.children
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
value: true
|
|
19
|
-
}, /*#__PURE__*/React.createElement(IsFhsEnabledContext.Provider, {
|
|
20
|
-
value: value
|
|
21
|
-
}, children));
|
|
22
|
-
};
|
|
13
|
+
var children = _ref.children;
|
|
14
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Full height sidebar (FHS) has been rolled back. `value` is ignored.
|
|
19
|
+
*/
|