@caseparts-org/caseblocks 0.0.270 → 0.0.271
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/molecules/Modal/Modal.js +46 -34
- package/package.json +1 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import v from "react";
|
|
3
|
+
import { r as p } from "../../index-BkF-BQ3Q.js";
|
|
3
4
|
import { c as n } from "../../clsx-OuTLNxxd.js";
|
|
4
|
-
import { Text as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import '../../assets/Modal.css';const
|
|
7
|
-
overlay:
|
|
8
|
-
container:
|
|
9
|
-
toolbar:
|
|
10
|
-
toolbarPlain:
|
|
11
|
-
headerGroup:
|
|
12
|
-
headerLeft:
|
|
13
|
-
headerRight:
|
|
14
|
-
closeButton:
|
|
15
|
-
content:
|
|
16
|
-
},
|
|
5
|
+
import { Text as g } from "../../atoms/Text/Text.js";
|
|
6
|
+
import { Icon as b } from "../../atoms/Icon/Icon.js";
|
|
7
|
+
import '../../assets/Modal.css';const y = "_overlay_1imlv_1", T = "_container_1imlv_11", x = "_toolbar_1imlv_30", z = "_toolbarPlain_1imlv_47", B = "_headerGroup_1imlv_52", M = "_headerLeft_1imlv_60", N = "_headerRight_1imlv_64", R = "_closeButton_1imlv_68", w = "_content_1imlv_87", r = {
|
|
8
|
+
overlay: y,
|
|
9
|
+
container: T,
|
|
10
|
+
toolbar: x,
|
|
11
|
+
toolbarPlain: z,
|
|
12
|
+
headerGroup: B,
|
|
13
|
+
headerLeft: M,
|
|
14
|
+
headerRight: N,
|
|
15
|
+
closeButton: R,
|
|
16
|
+
content: w
|
|
17
|
+
}, P = {
|
|
17
18
|
sm: "sm",
|
|
18
19
|
md: "md",
|
|
19
20
|
lg: "lg"
|
|
@@ -32,35 +33,46 @@ import '../../assets/Modal.css';const b = "_overlay_1imlv_1", y = "_container_1i
|
|
|
32
33
|
..._
|
|
33
34
|
}) => {
|
|
34
35
|
const c = v.useRef(!1);
|
|
35
|
-
if (!t) return null;
|
|
36
|
-
const
|
|
36
|
+
if (!t || typeof document > "u") return null;
|
|
37
|
+
const f = (i) => {
|
|
37
38
|
e && (c.current = i.target === i.currentTarget);
|
|
38
|
-
},
|
|
39
|
+
}, h = (i) => {
|
|
39
40
|
if (!e) {
|
|
40
41
|
c.current = !1;
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
44
|
c.current && i.target === i.currentTarget && o(), c.current = !1;
|
|
44
45
|
};
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
return p.createPortal(
|
|
47
|
+
/* @__PURE__ */ a(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: n(r.overlay),
|
|
51
|
+
onMouseDown: f,
|
|
52
|
+
onMouseUp: h,
|
|
53
|
+
children: /* @__PURE__ */ a(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: n(r.container, s),
|
|
57
|
+
role: "dialog",
|
|
58
|
+
"aria-modal": "true",
|
|
59
|
+
style: { ...m, "--modal-width": l },
|
|
60
|
+
..._,
|
|
61
|
+
children: u
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
document.body
|
|
67
|
+
);
|
|
68
|
+
}, D = ({ variant: t = "standard", className: o, children: e, ...l }) => /* @__PURE__ */ a(
|
|
57
69
|
"div",
|
|
58
70
|
{
|
|
59
71
|
className: n(r.toolbar, t === "plain" && r.toolbarPlain, o),
|
|
60
72
|
...l,
|
|
61
73
|
children: e
|
|
62
74
|
}
|
|
63
|
-
),
|
|
75
|
+
), G = ({
|
|
64
76
|
align: t = "left",
|
|
65
77
|
size: o = "md",
|
|
66
78
|
variant: e = "display",
|
|
@@ -74,13 +86,13 @@ import '../../assets/Modal.css';const b = "_overlay_1imlv_1", y = "_container_1i
|
|
|
74
86
|
{
|
|
75
87
|
className: n(r.headerGroup, t === "left" ? r.headerLeft : r.headerRight, l),
|
|
76
88
|
...m,
|
|
77
|
-
children: u ? /* @__PURE__ */ a(
|
|
89
|
+
children: u ? /* @__PURE__ */ a(g, { as: "div", size: P[o], variant: e, weight: "medium", children: s }) : s
|
|
78
90
|
}
|
|
79
91
|
);
|
|
80
|
-
},
|
|
81
|
-
d.Toolbar =
|
|
82
|
-
d.Header =
|
|
83
|
-
d.CloseButton =
|
|
92
|
+
}, L = ({ size: t = "md", className: o, ...e }) => /* @__PURE__ */ a("button", { type: "button", className: n(r.closeButton, o), "aria-label": "Close", ...e, children: /* @__PURE__ */ a(b, { iconKey: "fa-regular fa-xmark", size: C[t] }) }), S = ({ className: t, children: o, ...e }) => /* @__PURE__ */ a("div", { className: n(r.content, t), ...e, children: o });
|
|
93
|
+
d.Toolbar = D;
|
|
94
|
+
d.Header = G;
|
|
95
|
+
d.CloseButton = L;
|
|
84
96
|
d.Content = S;
|
|
85
97
|
export {
|
|
86
98
|
d as Modal
|