@arkyn/components 3.0.1-beta.185 → 3.0.1-beta.187

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,50 +1,36 @@
1
1
  import { useScrollLock as e } from "../../../hooks/useScrollLock.js";
2
2
  import { ModalProvider as t } from "../modalContext.js";
3
3
  /* empty css */
4
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
- import { AnimatePresence as i, motion as a } from "framer-motion";
4
+ import { useEffect as n, useState as r } from "react";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  //#region src/components/modal/modalContainer/index.tsx
7
7
  function o(o) {
8
- let { isVisible: s, makeInvisible: c, children: l, className: u = "", ...d } = o;
9
- e(s);
10
- let f = `arkynModalContainer ${s ? "visibleTrue" : "visibleFalse"} ${u}`;
11
- return /* @__PURE__ */ n(t, {
12
- makeInvisible: c,
13
- children: /* @__PURE__ */ n(i, { children: s && /* @__PURE__ */ r("aside", {
14
- className: f.trim(),
8
+ let { isVisible: s, makeInvisible: c, children: l, className: u = "", ...d } = o, [f, p] = r(s), [m, h] = r(!1);
9
+ n(() => {
10
+ s ? (p(!0), h(!1)) : f && h(!0);
11
+ }, [s, f]), e(s);
12
+ function g(e) {
13
+ e.target === e.currentTarget && m && (h(!1), p(!1), c());
14
+ }
15
+ return f ? /* @__PURE__ */ i(t, {
16
+ makeInvisible: () => h(!0),
17
+ children: /* @__PURE__ */ a("aside", {
18
+ className: [
19
+ "arkynModalContainer",
20
+ m ? "exiting" : "",
21
+ u
22
+ ].filter(Boolean).join(" ").trim(),
15
23
  ...d,
16
- children: [/* @__PURE__ */ n(a.div, {
24
+ children: [/* @__PURE__ */ i("div", {
17
25
  className: "arkynModalContainerOverlay",
18
- transition: {
19
- duration: .15,
20
- ease: "easeOut"
21
- },
22
- initial: { opacity: 0 },
23
- animate: { opacity: 1 },
24
- exit: { opacity: 0 },
25
- onClick: c
26
- }), /* @__PURE__ */ n(a.div, {
26
+ onClick: () => h(!0),
27
+ onAnimationEnd: g
28
+ }), /* @__PURE__ */ i("div", {
27
29
  className: "arkynModalContainerContent",
28
- transition: {
29
- duration: .15,
30
- ease: "easeOut"
31
- },
32
- initial: {
33
- opacity: 0,
34
- scale: .75
35
- },
36
- animate: {
37
- opacity: 1,
38
- scale: 1
39
- },
40
- exit: {
41
- opacity: 0,
42
- scale: 0
43
- },
44
30
  children: l
45
31
  })]
46
- }) })
47
- });
32
+ })
33
+ }) : null;
48
34
  }
49
35
  //#endregion
50
36
  export { o as ModalContainer };