1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
3 | import * as React from 'react';
|
4 | import PropTypes from 'prop-types';
|
5 | export const styles = {
|
6 |
|
7 | root: {
|
8 | zIndex: -1,
|
9 | position: 'fixed',
|
10 | right: 0,
|
11 | bottom: 0,
|
12 | top: 0,
|
13 | left: 0,
|
14 | backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
15 | WebkitTapHighlightColor: 'transparent'
|
16 | },
|
17 |
|
18 |
|
19 | invisible: {
|
20 | backgroundColor: 'transparent'
|
21 | }
|
22 | };
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | const SimpleBackdrop = React.forwardRef(function SimpleBackdrop(props, ref) {
|
28 | const {
|
29 | invisible = false,
|
30 | open
|
31 | } = props,
|
32 | other = _objectWithoutPropertiesLoose(props, ["invisible", "open"]);
|
33 |
|
34 | return open ? React.createElement("div", _extends({
|
35 | "aria-hidden": true,
|
36 | ref: ref
|
37 | }, other, {
|
38 | style: _extends({}, styles.root, invisible ? styles.invisible : {}, other.style)
|
39 | })) : null;
|
40 | });
|
41 | process.env.NODE_ENV !== "production" ? SimpleBackdrop.propTypes = {
|
42 | |
43 |
|
44 |
|
45 |
|
46 | invisible: PropTypes.bool,
|
47 |
|
48 | |
49 |
|
50 |
|
51 | open: PropTypes.bool.isRequired
|
52 | } : void 0;
|
53 | export default SimpleBackdrop; |
\ | No newline at end of file |