react-simple-game-engine 0.2.63 → 0.2.64
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.
@@ -1,10 +1,11 @@
|
|
1
|
-
import { ReactElement, ReactNode } from "react";
|
1
|
+
import { ReactElement, ReactNode, CSSProperties } from "react";
|
2
2
|
declare type ModalProps = {
|
3
3
|
children?: ReactElement;
|
4
4
|
content: ReactNode;
|
5
5
|
defaultOpen?: boolean;
|
6
6
|
event?: string;
|
7
7
|
onClose?: () => void;
|
8
|
+
backgroundStyle?: CSSProperties;
|
8
9
|
};
|
9
10
|
export declare type RefModalFunctions = {
|
10
11
|
open: () => void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/ui-components/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,YAAY,EACZ,SAAS,
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/ui-components/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,YAAY,EACZ,SAAS,EAKT,aAAa,EACd,MAAM,OAAO,CAAC;AAGf,aAAK,UAAU,GAAG;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,SAAS,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,aAAa,CAAC;CACjC,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,KAAK,0GA0HhB,CAAC"}
|
@@ -14,7 +14,7 @@ import { useMemo, useEffect, useState, useCallback, forwardRef, cloneElement, us
|
|
14
14
|
import * as ReactDOM from "react-dom";
|
15
15
|
export var Modal = forwardRef(function (_a, ref) {
|
16
16
|
var _b;
|
17
|
-
var trigger = _a.children, content = _a.content, _c = _a.defaultOpen, defaultOpen = _c === void 0 ? false : _c, onClose = _a.onClose, _d = _a.event, event = _d === void 0 ? "onClick" : _d;
|
17
|
+
var backgroundStyle = _a.backgroundStyle, trigger = _a.children, content = _a.content, _c = _a.defaultOpen, defaultOpen = _c === void 0 ? false : _c, onClose = _a.onClose, _d = _a.event, event = _d === void 0 ? "onClick" : _d;
|
18
18
|
var refModal = useRef(null);
|
19
19
|
var _e = useState(defaultOpen), isOpen = _e[0], setOpen = _e[1];
|
20
20
|
var container = useMemo(function () {
|
@@ -75,12 +75,7 @@ export var Modal = forwardRef(function (_a, ref) {
|
|
75
75
|
display: "flex",
|
76
76
|
alignItems: "center",
|
77
77
|
justifyContent: "center",
|
78
|
-
}, ref: refModal }, { children: [_jsx("div", { style: {
|
79
|
-
width: "100%",
|
80
|
-
height: "100%",
|
81
|
-
position: "absolute",
|
82
|
-
zIndex: 0,
|
83
|
-
}, onClick: handleClose }), _jsx("main", __assign({ style: {
|
78
|
+
}, ref: refModal }, { children: [_jsx("div", { style: __assign({ width: "100%", height: "100%", position: "absolute", zIndex: 0 }, backgroundStyle), onClick: handleClose }), _jsx("main", __assign({ style: {
|
84
79
|
position: "relative",
|
85
80
|
zIndex: 1,
|
86
81
|
minWidth: "200px",
|