@cagatayfdn/flora-components 0.0.113 → 0.0.114
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.
- package/dist/components/Modal/Modal.js +27 -26
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
|
|
2
|
-
import { useEffect as
|
|
2
|
+
import { useEffect as w } from "react";
|
|
3
3
|
import { c as s } from "../../index-BHf7G3IG.js";
|
|
4
|
-
import { Icons as
|
|
5
|
-
import
|
|
6
|
-
import '../../Modal.css';const
|
|
7
|
-
overlay:
|
|
8
|
-
modal:
|
|
9
|
-
content:
|
|
10
|
-
header:
|
|
11
|
-
close:
|
|
12
|
-
body:
|
|
13
|
-
desc:
|
|
14
|
-
modal__light:
|
|
15
|
-
},
|
|
4
|
+
import { Icons as N } from "../../assets/icons/icons.js";
|
|
5
|
+
import b from "../Icon/index.js";
|
|
6
|
+
import '../../Modal.css';const f = "_overlay_yit4w_1", g = "_modal_yit4w_10", C = "_content_yit4w_25", k = "_header_yit4w_35", E = "_close_yit4w_55", S = "_body_yit4w_62", F = "_desc_yit4w_66", B = "_modal__light_yit4w_70", o = {
|
|
7
|
+
overlay: f,
|
|
8
|
+
modal: g,
|
|
9
|
+
content: C,
|
|
10
|
+
header: k,
|
|
11
|
+
close: E,
|
|
12
|
+
body: S,
|
|
13
|
+
desc: F,
|
|
14
|
+
modal__light: B
|
|
15
|
+
}, K = (i) => {
|
|
16
16
|
const {
|
|
17
17
|
children: m,
|
|
18
18
|
header: a,
|
|
@@ -20,23 +20,24 @@ import '../../Modal.css';const b = "_overlay_yit4w_1", f = "_modal_yit4w_10", g
|
|
|
20
20
|
description: d,
|
|
21
21
|
className: y,
|
|
22
22
|
onClose: _,
|
|
23
|
+
showClose: h = !0,
|
|
23
24
|
visible: c = !0,
|
|
24
25
|
appearance: l,
|
|
25
|
-
headerClass:
|
|
26
|
-
descriptionClass:
|
|
27
|
-
} = i,
|
|
26
|
+
headerClass: v,
|
|
27
|
+
descriptionClass: x
|
|
28
|
+
} = i, p = () => {
|
|
28
29
|
document.body.style.width = "calc(100% - 15px)", document.body.className = "overflow-hidden";
|
|
29
|
-
},
|
|
30
|
+
}, j = () => {
|
|
30
31
|
document.body.className = "", document.body.removeAttribute("style");
|
|
31
32
|
}, n = () => {
|
|
32
33
|
_();
|
|
33
34
|
};
|
|
34
|
-
return
|
|
35
|
-
const r = (
|
|
36
|
-
|
|
35
|
+
return w(() => {
|
|
36
|
+
const r = (u) => {
|
|
37
|
+
u.key === "Escape" && n();
|
|
37
38
|
};
|
|
38
|
-
return document.addEventListener("keydown", r), c &&
|
|
39
|
-
|
|
39
|
+
return document.addEventListener("keydown", r), c && p(), () => {
|
|
40
|
+
j(), document.removeEventListener("keydown", r);
|
|
40
41
|
};
|
|
41
42
|
}, [c]), /* @__PURE__ */ e.jsx(e.Fragment, { children: c && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
42
43
|
/* @__PURE__ */ e.jsx(
|
|
@@ -55,12 +56,12 @@ import '../../Modal.css';const b = "_overlay_yit4w_1", f = "_modal_yit4w_10", g
|
|
|
55
56
|
}),
|
|
56
57
|
"data-testid": "modal-container",
|
|
57
58
|
children: /* @__PURE__ */ e.jsxs("div", { className: s(y, o.content), children: [
|
|
58
|
-
t || a ? /* @__PURE__ */ e.jsxs("div", { className: s(o.header,
|
|
59
|
+
t || a ? /* @__PURE__ */ e.jsxs("div", { className: s(o.header, v), children: [
|
|
59
60
|
t ? /* @__PURE__ */ e.jsx("h2", { children: t }) : a,
|
|
60
|
-
/* @__PURE__ */ e.jsx("span", { className: o.close, onClick: n, children: /* @__PURE__ */ e.jsx(
|
|
61
|
+
h && /* @__PURE__ */ e.jsx("span", { className: o.close, onClick: n, children: /* @__PURE__ */ e.jsx(b, { name: N.Close }) })
|
|
61
62
|
] }) : /* @__PURE__ */ e.jsx(e.Fragment, {}),
|
|
62
63
|
/* @__PURE__ */ e.jsxs("div", { className: o.body, children: [
|
|
63
|
-
d && /* @__PURE__ */ e.jsx("p", { className: s(o.desc,
|
|
64
|
+
d && /* @__PURE__ */ e.jsx("p", { className: s(o.desc, x), children: d }),
|
|
64
65
|
m
|
|
65
66
|
] })
|
|
66
67
|
] })
|
|
@@ -69,5 +70,5 @@ import '../../Modal.css';const b = "_overlay_yit4w_1", f = "_modal_yit4w_10", g
|
|
|
69
70
|
] }) });
|
|
70
71
|
};
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
+
K as default
|
|
73
74
|
};
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED