@via-profit/ui-kit 0.1.0-rc.91 → 0.1.0-rc.93
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.
|
@@ -21,6 +21,7 @@ const StyledModalInner = styled_1.default.div `
|
|
|
21
21
|
opacity: 0;
|
|
22
22
|
z-index: ${({ theme }) => theme.zIndex.modal};
|
|
23
23
|
outline: none;
|
|
24
|
+
pointer-events: all;
|
|
24
25
|
position: relative;
|
|
25
26
|
background-color: ${({ theme }) => theme.color.surface.toString()};
|
|
26
27
|
border-radius: ${({ theme }) => theme.shape.radiusFactor * 2}em;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
@@ -9,7 +20,7 @@ const ModalOverlay_1 = __importDefault(require("./ModalOverlay"));
|
|
|
9
20
|
const ModalInner_1 = __importDefault(require("./ModalInner"));
|
|
10
21
|
const ModalInnerContainer_1 = __importDefault(require("./ModalInnerContainer"));
|
|
11
22
|
const RenderModal = props => {
|
|
12
|
-
const { children, overrides } = props;
|
|
23
|
+
const { children, overrides } = props, restProps = __rest(props, ["children", "overrides"]);
|
|
13
24
|
const { state } = (0, context_1.useContext)();
|
|
14
25
|
const { isOpen, closeOnOverlayClick, onRequestClose } = state;
|
|
15
26
|
const overridesMap = react_1.default.useMemo(() => ({
|
|
@@ -18,7 +29,7 @@ const RenderModal = props => {
|
|
|
18
29
|
InnerContainer: (overrides === null || overrides === void 0 ? void 0 : overrides.InnerContainer) || ModalInnerContainer_1.default,
|
|
19
30
|
}), [overrides]);
|
|
20
31
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
21
|
-
react_1.default.useMemo(() => (react_1.default.createElement(overridesMap.Overlay, { isOpen: isOpen,
|
|
32
|
+
react_1.default.useMemo(() => (react_1.default.createElement(overridesMap.Overlay, Object.assign({}, restProps, { isOpen: isOpen, closeOnOverlayClick: closeOnOverlayClick, onRequestClose: onRequestClose }))), [overridesMap, isOpen, closeOnOverlayClick, onRequestClose, restProps]),
|
|
22
33
|
react_1.default.useMemo(() => (react_1.default.createElement(overridesMap.InnerContainer, { isOpen: isOpen, onRequestClose: onRequestClose },
|
|
23
34
|
react_1.default.createElement(overridesMap.Inner, { isOpen: isOpen, onRequestClose: onRequestClose }, children))), [children, isOpen, overridesMap, onRequestClose])));
|
|
24
35
|
};
|
|
@@ -17,8 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
19
|
const react_2 = require("@emotion/react");
|
|
20
|
-
const
|
|
20
|
+
const ModalInner_1 = __importDefault(require("../BaseModal/ModalInner"));
|
|
21
|
+
const StyledDrawerBottomInner = (0, styled_1.default)(ModalInner_1.default) `
|
|
21
22
|
position: fixed;
|
|
23
|
+
margin: 0;
|
|
22
24
|
left: 0;
|
|
23
25
|
right: 0;
|
|
24
26
|
bottom: -100%;
|
|
@@ -33,7 +35,7 @@ const StyledDrawerBottomInner = styled_1.default.div `
|
|
|
33
35
|
transition:
|
|
34
36
|
opacity 120ms ease-out,
|
|
35
37
|
bottom 600ms ease-out;
|
|
36
|
-
${({
|
|
38
|
+
${({ isOpen }) => isOpen &&
|
|
37
39
|
(0, react_2.css) `
|
|
38
40
|
opacity: 1;
|
|
39
41
|
bottom: 0;
|
|
@@ -42,8 +44,9 @@ const StyledDrawerBottomInner = styled_1.default.div `
|
|
|
42
44
|
bottom 240ms ease-out;
|
|
43
45
|
`}
|
|
44
46
|
`;
|
|
45
|
-
const StyledDrawerTopInner = styled_1.default.
|
|
47
|
+
const StyledDrawerTopInner = (0, styled_1.default)(ModalInner_1.default) `
|
|
46
48
|
position: fixed;
|
|
49
|
+
margin: 0;
|
|
47
50
|
left: 0;
|
|
48
51
|
right: 0;
|
|
49
52
|
top: -100%;
|
|
@@ -58,7 +61,7 @@ const StyledDrawerTopInner = styled_1.default.div `
|
|
|
58
61
|
transition:
|
|
59
62
|
top 600ms ease-out,
|
|
60
63
|
opacity 120ms ease-out;
|
|
61
|
-
${({
|
|
64
|
+
${({ isOpen }) => isOpen &&
|
|
62
65
|
(0, react_2.css) `
|
|
63
66
|
opacity: 1;
|
|
64
67
|
top: 0;
|
|
@@ -67,8 +70,9 @@ const StyledDrawerTopInner = styled_1.default.div `
|
|
|
67
70
|
opacity 100ms ease-out;
|
|
68
71
|
`}
|
|
69
72
|
`;
|
|
70
|
-
const StyledDrawerRightInner = styled_1.default.
|
|
73
|
+
const StyledDrawerRightInner = (0, styled_1.default)(ModalInner_1.default) `
|
|
71
74
|
position: fixed;
|
|
75
|
+
margin: 0;
|
|
72
76
|
right: -100%;
|
|
73
77
|
top: 0;
|
|
74
78
|
bottom: 0;
|
|
@@ -83,7 +87,7 @@ const StyledDrawerRightInner = styled_1.default.div `
|
|
|
83
87
|
transition:
|
|
84
88
|
right 600ms ease-out,
|
|
85
89
|
opacity 120ms ease-out;
|
|
86
|
-
${({
|
|
90
|
+
${({ isOpen }) => isOpen &&
|
|
87
91
|
(0, react_2.css) `
|
|
88
92
|
opacity: 1;
|
|
89
93
|
right: 0;
|
|
@@ -92,8 +96,9 @@ const StyledDrawerRightInner = styled_1.default.div `
|
|
|
92
96
|
opacity 100ms ease-out;
|
|
93
97
|
`}
|
|
94
98
|
`;
|
|
95
|
-
const StyledDrawerLeftInner = styled_1.default.
|
|
99
|
+
const StyledDrawerLeftInner = (0, styled_1.default)(ModalInner_1.default) `
|
|
96
100
|
position: fixed;
|
|
101
|
+
margin: 0;
|
|
97
102
|
left: -100%;
|
|
98
103
|
top: 0;
|
|
99
104
|
bottom: 0;
|
|
@@ -108,7 +113,7 @@ const StyledDrawerLeftInner = styled_1.default.div `
|
|
|
108
113
|
transition:
|
|
109
114
|
left 600ms ease-out,
|
|
110
115
|
opacity 120ms ease-out;
|
|
111
|
-
${({
|
|
116
|
+
${({ isOpen }) => isOpen &&
|
|
112
117
|
(0, react_2.css) `
|
|
113
118
|
opacity: 1;
|
|
114
119
|
left: 0;
|
|
@@ -132,6 +137,6 @@ const DrawerInner = (props, ref) => {
|
|
|
132
137
|
return StyledDrawerBottomInner;
|
|
133
138
|
}
|
|
134
139
|
}, [anchor]);
|
|
135
|
-
return (react_1.default.createElement(Element, Object.assign({
|
|
140
|
+
return (react_1.default.createElement(Element, Object.assign({ isOpen: isOpen, id: `${dialogID}-description`, onRequestClose: onRequestClose }, nativeProps, { ref: ref }), children));
|
|
136
141
|
};
|
|
137
142
|
exports.default = react_1.default.forwardRef(DrawerInner);
|