@caspeco/casper-ui-library 5.5.0 → 5.5.1
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-drawer.d.ts","sourceRoot":"","sources":["../../../lib/components/drawer/inline-drawer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAK3C,wBAAgB,YAAY,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,OAAO,EACP,UAAiB,EACjB,IAAW,EACX,MAAU,EACV,GAAG,KAAK,EACR,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"inline-drawer.d.ts","sourceRoot":"","sources":["../../../lib/components/drawer/inline-drawer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAK3C,wBAAgB,YAAY,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,OAAO,EACP,UAAiB,EACjB,IAAW,EACX,MAAU,EACV,GAAG,KAAK,EACR,EAAE,WAAW,2CA8Db"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Box as
|
|
3
|
-
import {
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { useInlineDrawerKeydown as
|
|
6
|
-
import { ThemeShadowVariable as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
children:
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Box as p } from "@chakra-ui/react";
|
|
3
|
+
import { motion as a } from "framer-motion";
|
|
4
|
+
import { useRef as x, useMemo as I, useState as y } from "react";
|
|
5
|
+
import { useInlineDrawerKeydown as S } from "./use-drawer-key-down.js";
|
|
6
|
+
import { ThemeShadowVariable as A, ThemeColorVariable as i } from "../../theme/theme-types.js";
|
|
7
|
+
const n = 0.3;
|
|
8
|
+
function M({
|
|
9
|
+
children: s,
|
|
10
10
|
isOpen: e,
|
|
11
|
-
onClose:
|
|
12
|
-
closeOnEsc:
|
|
13
|
-
size:
|
|
14
|
-
zIndex:
|
|
15
|
-
...
|
|
11
|
+
onClose: d,
|
|
12
|
+
closeOnEsc: m = !0,
|
|
13
|
+
size: o = "xs",
|
|
14
|
+
zIndex: u = 1,
|
|
15
|
+
...l
|
|
16
16
|
}) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
switch (
|
|
17
|
+
const c = x(null);
|
|
18
|
+
S({ isOpen: e, onClose: d, closeOnEsc: m });
|
|
19
|
+
const h = I(() => {
|
|
20
|
+
switch (o) {
|
|
21
21
|
case "xs":
|
|
22
22
|
return 320;
|
|
23
23
|
case "sm":
|
|
@@ -31,44 +31,43 @@ function N({
|
|
|
31
31
|
default:
|
|
32
32
|
return 320;
|
|
33
33
|
}
|
|
34
|
-
}, [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
n.aside,
|
|
34
|
+
}, [o]), [f, r] = y(!e), w = { width: e ? h : 0 };
|
|
35
|
+
return /* @__PURE__ */ t(
|
|
36
|
+
a.aside,
|
|
38
37
|
{
|
|
39
|
-
ref:
|
|
40
|
-
hidden:
|
|
38
|
+
ref: c,
|
|
39
|
+
hidden: f,
|
|
41
40
|
initial: !1,
|
|
42
|
-
onAnimationStart: () =>
|
|
43
|
-
onAnimationComplete: () =>
|
|
44
|
-
animate:
|
|
41
|
+
onAnimationStart: () => r(!1),
|
|
42
|
+
onAnimationComplete: () => r(!e),
|
|
43
|
+
animate: w,
|
|
45
44
|
transition: {
|
|
46
|
-
duration:
|
|
45
|
+
duration: n,
|
|
47
46
|
ease: "easeInOut"
|
|
48
47
|
},
|
|
49
48
|
style: {
|
|
50
|
-
backgroundColor:
|
|
51
|
-
color:
|
|
49
|
+
backgroundColor: i.Surface,
|
|
50
|
+
color: i.OnSurface,
|
|
52
51
|
overflow: "hidden",
|
|
53
|
-
boxShadow:
|
|
52
|
+
boxShadow: A.Medium,
|
|
54
53
|
height: "100dvh",
|
|
55
54
|
top: "0",
|
|
56
|
-
zIndex:
|
|
55
|
+
zIndex: u
|
|
57
56
|
},
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
|
|
57
|
+
children: /* @__PURE__ */ t(
|
|
58
|
+
a.div,
|
|
60
59
|
{
|
|
61
60
|
initial: { opacity: 0 },
|
|
62
61
|
animate: { opacity: e ? 1 : 0 },
|
|
63
62
|
exit: { opacity: 0 },
|
|
64
|
-
transition: { duration:
|
|
63
|
+
transition: { duration: n, ease: "easeInOut" },
|
|
65
64
|
style: { height: "100%", width: "100%" },
|
|
66
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: /* @__PURE__ */ t(p, { h: "100%", w: "100%", overflowY: "auto", ...l, children: s })
|
|
67
66
|
}
|
|
68
67
|
)
|
|
69
68
|
}
|
|
70
69
|
);
|
|
71
70
|
}
|
|
72
71
|
export {
|
|
73
|
-
|
|
72
|
+
M as InlineDrawer
|
|
74
73
|
};
|