decentraland-ui2 0.5.2-11500250167.commit-c752a22 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,15 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
3
3
|
import ArrowBackIosNewRoundedIcon from "@mui/icons-material/ArrowBackIosNewRounded";
|
4
4
|
import CancelRoundedIcon from "@mui/icons-material/CancelRounded";
|
5
|
-
import { IconButton,
|
6
|
-
import { ModalActionsContainer, ModalContainer, ModalContentContainer, ModalTitleContainer, } from "./Modal.styled";
|
5
|
+
import { IconButton, Typography } from "@mui/material";
|
6
|
+
import { Modal as BaseModal, ModalActionsContainer, ModalContainer, ModalContentContainer, ModalTitleContainer, } from "./Modal.styled";
|
7
7
|
const ModalContent = React.memo((props) => {
|
8
8
|
const { children, header, actions, title, subtitle, size, onClose, onBack, } = props;
|
9
9
|
return (_jsxs(ModalContainer, { elevation: 24, size: size, children: [header, (title || onClose || onBack) && (_jsxs(ModalTitleContainer, { children: [onBack && (_jsx(IconButton, { "aria-label": "back", size: "large", onClick: onBack, children: _jsx(ArrowBackIosNewRoundedIcon, {}) })), title && _jsx(Typography, { variant: "h5", children: title }), onClose && (_jsx(IconButton, { "aria-label": "close", size: "large", onClick: onClose, children: _jsx(CancelRoundedIcon, {}) }))] })), subtitle && _jsx(Typography, { variant: "subtitle1", children: subtitle }), _jsx(ModalContentContainer, { children: children }), actions && _jsx(ModalActionsContainer, { children: actions })] }));
|
10
10
|
});
|
11
11
|
const Modal = React.memo((props) => {
|
12
12
|
const { open, onClose, children, ...modalContentProps } = props;
|
13
|
-
return (_jsx(
|
13
|
+
return (_jsx(BaseModal, { open: open, onClose: onClose, children: _jsx(ModalContent, { ...modalContentProps, onClose: onClose, children: children }) }));
|
14
14
|
});
|
15
15
|
export { Modal, ModalContent };
|
16
16
|
//# sourceMappingURL=Modal.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,0BAA0B,MAAM,4CAA4C,CAAA;AACnF,OAAO,iBAAiB,MAAM,mCAAmC,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,0BAA0B,MAAM,4CAA4C,CAAA;AACnF,OAAO,iBAAiB,MAAM,mCAAmC,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,EACL,KAAK,IAAI,SAAS,EAClB,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,gBAAgB,CAAA;AAEvB,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAC7B,CACE,KAYC,EACD,EAAE;IACF,MAAM,EACJ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,MAAM,GACP,GAAG,KAAK,CAAA;IAET,OAAO,CACL,MAAC,cAAc,IAAC,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,aACtC,MAAM,EACN,CAAC,KAAK,IAAI,OAAO,IAAI,MAAM,CAAC,IAAI,CAC/B,MAAC,mBAAmB,eACjB,MAAM,IAAI,CACT,KAAC,UAAU,kBAAY,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,MAAM,YACxD,KAAC,0BAA0B,KAAG,GACnB,CACd,EACA,KAAK,IAAI,KAAC,UAAU,IAAC,OAAO,EAAC,IAAI,YAAE,KAAK,GAAc,EACtD,OAAO,IAAI,CACV,KAAC,UAAU,kBAAY,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,YAC1D,KAAC,iBAAiB,KAAG,GACV,CACd,IACmB,CACvB,EACA,QAAQ,IAAI,KAAC,UAAU,IAAC,OAAO,EAAC,WAAW,YAAE,QAAQ,GAAc,EACpE,KAAC,qBAAqB,cAAE,QAAQ,GAAyB,EACxD,OAAO,IAAI,KAAC,qBAAqB,cAAE,OAAO,GAAyB,IACrD,CAClB,CAAA;AACH,CAAC,CACF,CAAA;AAED,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,KAAiB,EAAE,EAAE;IAC7C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,iBAAiB,EAAE,GAAG,KAAK,CAAA;IAC/D,OAAO,CACL,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,YACrC,KAAC,YAAY,OAAK,iBAAiB,EAAE,OAAO,EAAE,OAAO,YAClD,QAAQ,GACI,GACL,CACb,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAA"}
|
@@ -1,4 +1,9 @@
|
|
1
1
|
import { ModalProps } from "./Modal.types";
|
2
|
+
declare const Modal: import("@emotion/styled").StyledComponent<import("@mui/material").ModalOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
4
|
+
}, "style" | "container" | "classes" | "className" | "children" | "sx" | "slots" | "slotProps" | "open" | "onClose" | "BackdropComponent" | "BackdropProps" | "closeAfterTransition" | "components" | "componentsProps" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disablePortal" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "onBackdropClick" | "onTransitionEnter" | "onTransitionExited"> & {
|
5
|
+
theme?: import("@emotion/react").Theme;
|
6
|
+
}, {}, {}>;
|
2
7
|
declare const ModalContainer: import("@emotion/styled").StyledComponent<import("@mui/material").PaperOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
3
8
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
4
9
|
}, "style" | "classes" | "className" | "children" | "square" | "sx" | "variant" | "elevation"> & {
|
@@ -19,4 +24,4 @@ declare const ModalActionsContainer: import("@emotion/styled").StyledComponent<i
|
|
19
24
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & {
|
20
25
|
theme?: import("@emotion/react").Theme;
|
21
26
|
}, {}, {}>;
|
22
|
-
export { ModalContainer, ModalTitleContainer, ModalContentContainer, ModalActionsContainer, };
|
27
|
+
export { Modal, ModalContainer, ModalTitleContainer, ModalContentContainer, ModalActionsContainer, };
|
@@ -1,5 +1,10 @@
|
|
1
1
|
import styled from "@emotion/styled";
|
2
|
-
import { Box as BoxMui, Paper as PaperMui, useTheme } from "@mui/material";
|
2
|
+
import { Box as BoxMui, Modal as MuiModal, Paper as PaperMui, useTheme, } from "@mui/material";
|
3
|
+
const Modal = styled(MuiModal)({
|
4
|
+
display: "flex",
|
5
|
+
alignItems: "center",
|
6
|
+
justifyContent: "center",
|
7
|
+
});
|
3
8
|
const ModalContainer = styled(PaperMui)((props) => {
|
4
9
|
const theme = useTheme();
|
5
10
|
let size = "900px";
|
@@ -10,10 +15,6 @@ const ModalContainer = styled(PaperMui)((props) => {
|
|
10
15
|
size = "720px";
|
11
16
|
}
|
12
17
|
return {
|
13
|
-
position: "absolute",
|
14
|
-
top: "50%",
|
15
|
-
left: "50%",
|
16
|
-
transform: "translate(-50%, -50%)",
|
17
18
|
width: size,
|
18
19
|
borderRadius: "12px",
|
19
20
|
overflow: "hidden",
|
@@ -24,9 +25,6 @@ const ModalContainer = styled(PaperMui)((props) => {
|
|
24
25
|
borderRadius: "0px",
|
25
26
|
margin: "0",
|
26
27
|
padding: "0",
|
27
|
-
top: "0",
|
28
|
-
left: "0",
|
29
|
-
transform: "translate(0, 0)",
|
30
28
|
},
|
31
29
|
};
|
32
30
|
});
|
@@ -48,5 +46,5 @@ const ModalActionsContainer = styled(BoxMui)({
|
|
48
46
|
marginRight: "16px",
|
49
47
|
},
|
50
48
|
});
|
51
|
-
export { ModalContainer, ModalTitleContainer, ModalContentContainer, ModalActionsContainer, };
|
49
|
+
export { Modal, ModalContainer, ModalTitleContainer, ModalContentContainer, ModalActionsContainer, };
|
52
50
|
//# sourceMappingURL=Modal.styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Modal.styled.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.styled.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AACpC,OAAO,
|
1
|
+
{"version":3,"file":"Modal.styled.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.styled.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAA;AACpC,OAAO,EACL,GAAG,IAAI,MAAM,EACb,KAAK,IAAI,QAAQ,EACjB,KAAK,IAAI,QAAQ,EACjB,QAAQ,GACT,MAAM,eAAe,CAAA;AAGtB,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7B,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;CACzB,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAA+B,EAAE,EAAE;IAC1E,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,IAAI,IAAI,GAAG,OAAO,CAAA;IAClB,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1B,IAAI,GAAG,OAAO,CAAA;IAChB,CAAC;SAAM,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAClC,IAAI,GAAG,OAAO,CAAA;IAChB,CAAC;IAED,OAAO;QACL,KAAK,EAAE,IAAI;QACX,YAAY,EAAE,MAAM;QACpB,QAAQ,EAAE,QAAQ;QAClB,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE;YAC9B,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE,OAAO;YACjB,SAAS,EAAE,OAAO;YAClB,YAAY,EAAE,KAAK;YACnB,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,GAAG;SACb;KACF,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACzC,OAAO,EAAE,MAAM;IACf,cAAc,EAAE,eAAe;IAC/B,OAAO,EAAE,MAAM;CAChB,CAAC,CAAA;AAEF,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3C,OAAO,EAAE,MAAM;CAChB,CAAC,CAAA;AAEF,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3C,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,MAAM;IACf,OAAO,EAAE;QACP,IAAI,EAAE,CAAC;KACR;IACD,2CAA2C,EAAE;QAC3C,WAAW,EAAE,MAAM;KACpB;CACF,CAAC,CAAA;AAEF,OAAO,EACL,KAAK,EACL,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,GACtB,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "decentraland-ui2",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.6.0",
|
4
4
|
"description": "Decentraland's UI components and styles",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -90,5 +90,5 @@
|
|
90
90
|
"files": [
|
91
91
|
"dist"
|
92
92
|
],
|
93
|
-
"commit": "
|
93
|
+
"commit": "6f01e759f239ae47353bedf681137621c8598834"
|
94
94
|
}
|