Skip to content

Commit eadf52f

Browse files
committed
fixes
1 parent a4101de commit eadf52f

14 files changed

Lines changed: 40 additions & 50 deletions

File tree

src/core/packages/chrome/layout/core-chrome-layout-components/banner/layout_banner.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const root: EmotionFn = ({ euiTheme }) => css`
1616
position: sticky;
1717
width: var(--kbn-layout--banner-width);
1818
height: var(--kbn-layout--banner-height);
19-
z-index: ${euiTheme.levels.header};
19+
z-index: var(--kbn-layout--slot-zIndex);
2020
`;
2121

2222
export const styles = {

src/core/packages/chrome/layout/core-chrome-layout-components/debug/simple_debug_overlay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface SimpleDebugOverlayProps {
2727

2828
export const SimpleDebugOverlay: React.FC<SimpleDebugOverlayProps> = ({
2929
label = 'Debug Overlay',
30-
background = 'rgba(0,153,255,0.15)',
30+
background = '#e6f4ff',
3131
color = '#0099ff',
3232
style = {},
3333
children,

src/core/packages/chrome/layout/core-chrome-layout-components/footer/layout_footer.styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const root = css`
1515
grid-area: footer;
1616
width: var(--kbn-layout--footer-width);
1717
height: var(--kbn-layout--footer-height);
18+
z-index: var(--kbn-layout--slot-zIndex);
1819
`;
1920

2021
export const styles = {

src/core/packages/chrome/layout/core-chrome-layout-components/header/layout_header.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const root: EmotionFn = ({ euiTheme }) => css`
1515
overflow: hidden;
1616
grid-area: header;
1717
height: var(--kbn-layout--header-height);
18-
z-index: ${euiTheme.levels.header};
18+
z-index: var(--kbn-layout--slot-zIndex);
1919
`;
2020

2121
export const styles = {

src/core/packages/chrome/layout/core-chrome-layout-components/layout_global_css.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import React from 'react';
1111
import { Global, css } from '@emotion/react';
1212
import { useLayoutState } from './layout_state_context';
13+
import { useEuiTheme } from '@elastic/eui';
1314

1415
/**
1516
* Sets up global CSS for the layout using the CSS variables (custom properties) approach.
@@ -70,6 +71,8 @@ export const LayoutGlobalCSS = () => {
7071
sidebarPanelWidth,
7172
} = useLayoutState();
7273

74+
const { euiTheme } = useEuiTheme();
75+
7376
const banner = css`
7477
--kbn-layout--banner-top: 0;
7578
--kbn-layout--banner-left: 0;
@@ -122,6 +125,13 @@ export const LayoutGlobalCSS = () => {
122125
--kbn-layout--footer-width: var(--kbn-layout--application-width);
123126
`;
124127

128+
// we want to place layout slots eui's flyouts
129+
const common = css`
130+
--kbn-layout--slot-zIndex: ${typeof euiTheme.levels.flyout === 'number'
131+
? euiTheme.levels.flyout + 50
132+
: euiTheme.levels.flyout};
133+
`;
134+
125135
const styles = css`
126136
:root {
127137
${banner}
@@ -130,6 +140,7 @@ export const LayoutGlobalCSS = () => {
130140
${sidebar}
131141
${application}
132142
${footer}
143+
${common}
133144
}
134145
`;
135146

src/core/packages/chrome/layout/core-chrome-layout-components/navigation/layout_navigation.styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const root: EmotionFn = ({ euiTheme }) => css`
1818
align-self: start;
1919
height: 100%;
2020
width: var(--kbn-layout--navigation-width);
21+
z-index: var(--kbn-layout--slot-zIndex);
2122
`;
2223

2324
export const styles = {

src/core/packages/chrome/layout/core-chrome-layout-components/sidebar/layout_sidebar.styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const root = css`
2020
align-items: center;
2121
height: 100%;
2222
width: var(--kbn-layout--sidebar-width);
23+
z-index: var(--kbn-layout--slot-zIndex);
2324
`;
2425

2526
export const styles = {

src/core/packages/chrome/layout/core-chrome-layout-components/sidebar/layout_sidebar_panel.styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const root = css`
1717
overflow: hidden;
1818
position: sticky;
1919
width: var(--kbn-layout--sidebar-panel-width);
20+
z-index: var(--kbn-layout--slot-zIndex);
2021
`;
2122

2223
export const styles = {

src/core/packages/chrome/layout/core-chrome-layout/app_containers.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('AppWrapper', () => {
1818
it('toggles the `hidden-chrome` class depending on the chrome visibility state', () => {
1919
const chromeVisible$ = new BehaviorSubject<boolean>(true);
2020
const { getByTestId, rerender } = render(
21-
<AppWrapper chromeVisible$={chromeVisible$}>app-content</AppWrapper>
21+
<AppWrapper chromeVisible={chromeVisible$.value}>app-content</AppWrapper>
2222
);
2323

2424
// The data-test-subj attribute is used for querying
@@ -32,7 +32,7 @@ describe('AppWrapper', () => {
3232
`);
3333

3434
act(() => chromeVisible$.next(false));
35-
rerender(<AppWrapper chromeVisible$={chromeVisible$}>app-content</AppWrapper>);
35+
rerender(<AppWrapper chromeVisible={chromeVisible$.value}>app-content</AppWrapper>);
3636
expect(getByTestId('kbnAppWrapper hiddenChrome')).toMatchInlineSnapshot(`
3737
<div
3838
class="kbnAppWrapper kbnAppWrapper--hiddenChrome"
@@ -43,7 +43,7 @@ describe('AppWrapper', () => {
4343
`);
4444

4545
act(() => chromeVisible$.next(true));
46-
rerender(<AppWrapper chromeVisible$={chromeVisible$}>app-content</AppWrapper>);
46+
rerender(<AppWrapper chromeVisible={chromeVisible$.value}>app-content</AppWrapper>);
4747
expect(getByTestId('kbnAppWrapper visibleChrome')).toMatchInlineSnapshot(`
4848
<div
4949
class="kbnAppWrapper"

src/core/packages/chrome/layout/core-chrome-layout/app_containers.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,18 @@
88
*/
99

1010
import React, { FC, PropsWithChildren } from 'react';
11-
import { Observable } from 'rxjs';
12-
import useObservable from 'react-use/lib/useObservable';
1311
import classNames from 'classnames';
1412
import { APP_WRAPPER_CLASS } from '@kbn/core-application-common';
1513

1614
export const AppWrapper: FC<
1715
PropsWithChildren<{
18-
chromeVisible$: Observable<boolean>;
16+
chromeVisible: boolean;
1917
}>
20-
> = ({ chromeVisible$, children }) => {
21-
const visible = useObservable(chromeVisible$);
18+
> = ({ chromeVisible, children }) => {
2219
return (
2320
<div
24-
className={classNames(APP_WRAPPER_CLASS, { 'kbnAppWrapper--hiddenChrome': !visible })}
25-
data-test-subj={`kbnAppWrapper ${visible ? 'visible' : 'hidden'}Chrome`}
21+
className={classNames(APP_WRAPPER_CLASS, { 'kbnAppWrapper--hiddenChrome': !chromeVisible })}
22+
data-test-subj={`kbnAppWrapper ${chromeVisible ? 'visible' : 'hidden'}Chrome`}
2623
>
2724
{children}
2825
</div>

0 commit comments

Comments
 (0)