-
Notifications
You must be signed in to change notification settings - Fork 844
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EuiOverlayMask] Convert to Emotion; remove
onClick
prop (#6090)
* add fade in animation * emotion styles; remove onClick handler; useEuiPortal * remove unused sass * update imagewrapper click to close * docs * CL * fix props table * fix docs example * fix zIndex * account for header
- Loading branch information
1 parent
6b31422
commit 596a65e
Showing
17 changed files
with
211 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,7 @@ | ||
import React, { FunctionComponent, ReactNode } from 'react'; | ||
import React, { FunctionComponent } from 'react'; | ||
import { CommonProps } from '../../../../src/components/common'; | ||
import { EuiOverlayMaskInterface } from '../../../../src/components/overlay_mask/overlay_mask'; | ||
|
||
interface EuiOverlayMaskInterface extends CommonProps { | ||
/** | ||
* Function that applies to clicking the mask itself and not the children | ||
*/ | ||
onClick?: () => void; | ||
/** | ||
* ReactNode to render as this component's children | ||
*/ | ||
children?: ReactNode; | ||
/** | ||
* Should the mask visually sit above or below the EuiHeader (controlled by z-index) | ||
*/ | ||
headerZindexLocation?: 'above' | 'below'; | ||
} | ||
|
||
export const EuiOverlayMaskProps: FunctionComponent<EuiOverlayMaskInterface> = () => ( | ||
<div /> | ||
); | ||
export const EuiOverlayMaskProps: FunctionComponent< | ||
EuiOverlayMaskInterface & CommonProps | ||
> = () => <div />; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { css } from '@emotion/react'; | ||
import { logicalCSS, euiAnimFadeIn } from '../../global_styling'; | ||
import { transparentize, UseEuiTheme } from '../../services'; | ||
|
||
export const euiOverlayMaskStyles = ({ euiTheme }: UseEuiTheme) => ({ | ||
euiOverlayMask: css` | ||
.euiOverlayMask { | ||
position: fixed; | ||
${logicalCSS('top', 0)} | ||
${logicalCSS('left', 0)} | ||
${logicalCSS('right', 0)} | ||
${logicalCSS('bottom', 0)} | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
${logicalCSS('padding-bottom', '10vh')}; | ||
animation: ${euiAnimFadeIn} ${euiTheme.animation.fast} ease-in; | ||
background: ${transparentize(euiTheme.colors.ink, 0.5)}; | ||
} | ||
`, | ||
aboveHeader: css` | ||
.euiOverlayMask { | ||
z-index: ${euiTheme.levels.mask}; | ||
} | ||
`, | ||
belowHeader: css` | ||
.euiOverlayMask { | ||
z-index: ${euiTheme.levels.maskBelowHeader}; | ||
// TODO: use size variable when EuiHeader is converted | ||
${logicalCSS('top', `${euiTheme.base * 3}px`)}; | ||
} | ||
`, | ||
}); | ||
|
||
export const euiOverlayMaskBodyStyles = css` | ||
body { | ||
overflow: hidden; | ||
} | ||
`; |
Oops, something went wrong.