@shiflo/ui 0.0.15 → 0.0.16
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,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as v, jsx as
|
|
1
|
+
import { jsxs as v, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m, useRef as k, useImperativeHandle as x, useLayoutEffect as $, useEffect as I } from "react";
|
|
3
3
|
import { createPortal as w } from "react-dom";
|
|
4
4
|
import i from "basic-styled";
|
|
@@ -6,7 +6,8 @@ const L = i.div`
|
|
|
6
6
|
position: fixed;
|
|
7
7
|
top: 0;
|
|
8
8
|
left: 0;
|
|
9
|
-
|
|
9
|
+
z-index: 1;
|
|
10
|
+
`, A = i.div`
|
|
10
11
|
position: fixed;
|
|
11
12
|
top: 0;
|
|
12
13
|
left: 0;
|
|
@@ -21,14 +22,12 @@ const L = i.div`
|
|
|
21
22
|
opacity ${({ transitionDuration: r }) => `${r}ms`}
|
|
22
23
|
${({ ease: r }) => r === "in" ? "ease-in" : "ease-out"},
|
|
23
24
|
background-color 0.2s;
|
|
24
|
-
|
|
25
|
-
`, A = i.div`
|
|
25
|
+
`, E = i.div`
|
|
26
26
|
position: fixed;
|
|
27
27
|
width: 100%;
|
|
28
28
|
display: flex;
|
|
29
29
|
justify-content: center;
|
|
30
30
|
align-items: center;
|
|
31
|
-
z-index: 1;
|
|
32
31
|
|
|
33
32
|
${({ placement: r }) => {
|
|
34
33
|
const t = {};
|
|
@@ -96,7 +95,7 @@ const L = i.div`
|
|
|
96
95
|
return t;
|
|
97
96
|
}}
|
|
98
97
|
`;
|
|
99
|
-
function
|
|
98
|
+
function q({
|
|
100
99
|
children: r,
|
|
101
100
|
open: t,
|
|
102
101
|
onClose: s,
|
|
@@ -118,16 +117,16 @@ function U({
|
|
|
118
117
|
e && cancelAnimationFrame(e);
|
|
119
118
|
};
|
|
120
119
|
}, [t, o]), I(() => {
|
|
121
|
-
const e = n.current,
|
|
120
|
+
const e = n.current, l = (j) => {
|
|
122
121
|
t || j.propertyName === "opacity" && c(!0);
|
|
123
122
|
};
|
|
124
|
-
return e == null || e.addEventListener("transitionend",
|
|
125
|
-
e == null || e.removeEventListener("transitionend",
|
|
123
|
+
return e == null || e.addEventListener("transitionend", l), () => {
|
|
124
|
+
e == null || e.removeEventListener("transitionend", l);
|
|
126
125
|
};
|
|
127
126
|
}, [t]), h ? null : w(
|
|
128
127
|
/* @__PURE__ */ v(L, { children: [
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
|
|
128
|
+
/* @__PURE__ */ d(
|
|
129
|
+
A,
|
|
131
130
|
{
|
|
132
131
|
ref: n,
|
|
133
132
|
transitionDuration: o,
|
|
@@ -140,11 +139,11 @@ function U({
|
|
|
140
139
|
...g
|
|
141
140
|
}
|
|
142
141
|
),
|
|
143
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ d(E, { placement: u, children: r })
|
|
144
143
|
] }),
|
|
145
144
|
document.body
|
|
146
145
|
);
|
|
147
146
|
}
|
|
148
147
|
export {
|
|
149
|
-
|
|
148
|
+
q as default
|
|
150
149
|
};
|