@caseparts-org/caseblocks 0.0.117 → 0.0.118
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.
|
@@ -6,7 +6,8 @@ export interface ModalProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
6
6
|
caption?: string;
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
closeOnOverlayClick?: boolean;
|
|
9
|
+
contentWrapperClassName?: string;
|
|
9
10
|
headerSize?: ModalHeaderSize;
|
|
10
11
|
headerVariant?: ModalHeaderVariant;
|
|
11
12
|
}
|
|
12
|
-
export declare function Modal({ isOpen, caption, onClose, closeOnOverlayClick, headerSize, headerVariant, className, children, ...otherProps }: ModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export declare function Modal({ isOpen, caption, onClose, closeOnOverlayClick, headerSize, headerVariant, className, contentWrapperClassName, children, ...otherProps }: ModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,53 +1,54 @@
|
|
|
1
1
|
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { Text as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import '../../assets/Modal.css';const
|
|
6
|
-
overlay:
|
|
7
|
-
container:
|
|
8
|
-
header:
|
|
9
|
-
closeButton:
|
|
10
|
-
content:
|
|
11
|
-
headerPlain:
|
|
12
|
-
},
|
|
2
|
+
import { c as t } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { Text as p } from "../../atoms/Text/Text.js";
|
|
4
|
+
import { Icon as y } from "../../atoms/Icon/Icon.js";
|
|
5
|
+
import '../../assets/Modal.css';const g = "_overlay_1du2l_1", x = "_container_1du2l_11", N = "_header_1du2l_30", T = "_closeButton_1du2l_43", k = "_content_1du2l_56", z = "_headerPlain_1du2l_64", e = {
|
|
6
|
+
overlay: g,
|
|
7
|
+
container: x,
|
|
8
|
+
header: N,
|
|
9
|
+
closeButton: T,
|
|
10
|
+
content: k,
|
|
11
|
+
headerPlain: z
|
|
12
|
+
}, B = {
|
|
13
13
|
sm: "sm",
|
|
14
14
|
md: "md",
|
|
15
15
|
lg: "lg"
|
|
16
|
-
},
|
|
16
|
+
}, C = {
|
|
17
17
|
sm: "sm",
|
|
18
18
|
md: "md",
|
|
19
19
|
lg: "md"
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function I({
|
|
22
22
|
isOpen: i,
|
|
23
23
|
caption: o,
|
|
24
24
|
onClose: l,
|
|
25
25
|
closeOnOverlayClick: d = !0,
|
|
26
|
-
headerSize:
|
|
26
|
+
headerSize: n = "md",
|
|
27
27
|
headerVariant: r = "default",
|
|
28
28
|
className: m,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
contentWrapperClassName: u,
|
|
30
|
+
children: _,
|
|
31
|
+
...h
|
|
31
32
|
}) {
|
|
32
33
|
if (!i) return null;
|
|
33
|
-
const
|
|
34
|
+
const f = (c) => {
|
|
34
35
|
d && c.target === c.currentTarget && l();
|
|
35
|
-
},
|
|
36
|
-
return /* @__PURE__ */ a("div", { className:
|
|
36
|
+
}, v = r === "default" && !!o;
|
|
37
|
+
return /* @__PURE__ */ a("div", { className: t(e.overlay), onClick: f, children: /* @__PURE__ */ s("div", { className: t(e.container, m), role: "dialog", "aria-modal": "true", ...h, children: [
|
|
37
38
|
/* @__PURE__ */ s(
|
|
38
39
|
"div",
|
|
39
40
|
{
|
|
40
|
-
className:
|
|
41
|
+
className: t(
|
|
41
42
|
e.header,
|
|
42
|
-
e[`header-${
|
|
43
|
+
e[`header-${n}`],
|
|
43
44
|
r === "plain" && e.headerPlain
|
|
44
45
|
),
|
|
45
46
|
children: [
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
v ? /* @__PURE__ */ a(
|
|
48
|
+
p,
|
|
48
49
|
{
|
|
49
50
|
as: "div",
|
|
50
|
-
size:
|
|
51
|
+
size: B[n],
|
|
51
52
|
variant: "display",
|
|
52
53
|
className: e.caption,
|
|
53
54
|
children: o
|
|
@@ -60,15 +61,15 @@ function j({
|
|
|
60
61
|
className: e.closeButton,
|
|
61
62
|
"aria-label": "Close",
|
|
62
63
|
onClick: l,
|
|
63
|
-
children: /* @__PURE__ */ a(
|
|
64
|
+
children: /* @__PURE__ */ a(y, { iconKey: "fa-regular fa-xmark", size: C[n] })
|
|
64
65
|
}
|
|
65
66
|
)
|
|
66
67
|
]
|
|
67
68
|
}
|
|
68
69
|
),
|
|
69
|
-
/* @__PURE__ */ a("div", { className: e.content, children:
|
|
70
|
+
/* @__PURE__ */ a("div", { className: t(e.content, u), children: _ })
|
|
70
71
|
] }) });
|
|
71
72
|
}
|
|
72
73
|
export {
|
|
73
|
-
|
|
74
|
+
I as Modal
|
|
74
75
|
};
|