@addsign/moje-agenda-shared-lib 1.0.27 → 1.0.29

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.
@@ -0,0 +1,121 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { F as FaRegTrashAlt } from "./index-DH-TC1O6.js";
4
+ import { G as GenIcon } from "./iconBase-B8_TsgYI.js";
5
+ import Button from "./components/Button.js";
6
+ function IoCloseOutline(props) {
7
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "fill": "none", "strokeLinecap": "round", "strokeLinejoin": "round", "strokeWidth": "32", "d": "M368 368 144 144m224 0L144 368" }, "child": [] }] })(props);
8
+ }
9
+ function ConfirmationModalDialog({
10
+ title,
11
+ confirmAction,
12
+ cancelAction,
13
+ description,
14
+ agreeeText,
15
+ cancelText
16
+ }) {
17
+ const [isConfirming, setIsConfirming] = useState(false);
18
+ useEffect(() => {
19
+ const handleKeyDown = (event) => {
20
+ if (event.key === "Escape") {
21
+ cancelAction();
22
+ }
23
+ };
24
+ window.addEventListener("keydown", handleKeyDown);
25
+ return () => {
26
+ window.removeEventListener("keydown", handleKeyDown);
27
+ };
28
+ }, [cancelAction]);
29
+ return /* @__PURE__ */ jsx(
30
+ "div",
31
+ {
32
+ className: "fixed inset-0 bg-black bg-opacity-25 flex items-center justify-center p-4",
33
+ style: { zIndex: 50 },
34
+ children: /* @__PURE__ */ jsxs("div", { className: "w-96 h-64 bg-white rounded-xl shadow flex-col justify-start items-center inline-flex relative overflow-hidden", children: [
35
+ /* @__PURE__ */ jsx(
36
+ "div",
37
+ {
38
+ id: "graphics",
39
+ className: "w-80 h-80 left-[-120px] top-[-120px] absolute ",
40
+ children: /* @__PURE__ */ jsxs("div", { className: "w-80 h-80 left-0 top-0 absolute", children: [
41
+ /* @__PURE__ */ jsx("div", { className: "w-24 h-24 left-[120px] top-[120px] absolute rounded-full border border-gray-150" }),
42
+ /* @__PURE__ */ jsx("div", { className: "w-36 h-36 left-[96px] top-[96px] absolute rounded-full border border-gray-100 " }),
43
+ /* @__PURE__ */ jsx("div", { className: "w-48 h-48 left-[72px] top-[72px] absolute rounded-full border border-gray-100 " }),
44
+ /* @__PURE__ */ jsx("div", { className: "w-60 h-60 left-[48px] top-[48px] absolute rounded-full border border-gray-50 " }),
45
+ /* @__PURE__ */ jsx("div", { className: "w-72 h-72 left-[24px] top-[24px] absolute rounded-full border border-gray-50" })
46
+ ] })
47
+ }
48
+ ),
49
+ /* @__PURE__ */ jsxs(
50
+ "div",
51
+ {
52
+ id: "header",
53
+ className: "self-stretch h-40 flex-col justify-start items-center flex z-40",
54
+ children: [
55
+ /* @__PURE__ */ jsxs("div", { className: "self-stretch h-40 px-6 pt-6 flex-col justify-start items-start gap-4 flex", children: [
56
+ /* @__PURE__ */ jsx("div", { className: "w-12 h-12 relative bg-red-100 rounded-full", children: /* @__PURE__ */ jsx(FaRegTrashAlt, { className: "w-6 h-6 left-[12px] top-[12px] absolute" }) }),
57
+ /* @__PURE__ */ jsxs("div", { className: "self-stretch h-16 flex-col justify-start items-start gap-1 flex", children: [
58
+ /* @__PURE__ */ jsx("div", { className: "self-stretch text-gray-900 text-lg font-semibold font-['Inter'] leading-7", children: title }),
59
+ /* @__PURE__ */ jsx("div", { className: "self-stretch text-slate-600 text-sm font-normal font-['Open Sans'] leading-tight", children: description })
60
+ ] })
61
+ ] }),
62
+ /* @__PURE__ */ jsx(
63
+ "div",
64
+ {
65
+ className: "w-11 h-11 p-2 right-0 top-[16px] absolute rounded-full justify-center items-center inline-flex mr-4 hover:bg-gray-100",
66
+ onClick: cancelAction,
67
+ children: /* @__PURE__ */ jsx(IoCloseOutline, { className: "w-6 h-6 relative text-gray-400" })
68
+ }
69
+ )
70
+ ]
71
+ }
72
+ ),
73
+ /* @__PURE__ */ jsx(
74
+ "div",
75
+ {
76
+ id: "actions",
77
+ className: "self-stretch h-24 pt-8 flex-col justify-start items-start flex z-40",
78
+ children: /* @__PURE__ */ jsxs("div", { className: "self-stretch px-6 pb-6 justify-start items-start gap-3 flex", children: [
79
+ /* @__PURE__ */ jsx(
80
+ Button,
81
+ {
82
+ id: "ConfirmationModalDialog:back",
83
+ type: "button",
84
+ variant: "secondary",
85
+ onClick: cancelAction,
86
+ className: "flex-1",
87
+ children: cancelText || "Zrušit"
88
+ }
89
+ ),
90
+ /* @__PURE__ */ jsxs(
91
+ Button,
92
+ {
93
+ id: "ConfirmationModalDialog:agree",
94
+ type: "button",
95
+ variant: "danger",
96
+ onClick: () => {
97
+ if (!isConfirming) {
98
+ setIsConfirming(true);
99
+ confirmAction();
100
+ }
101
+ },
102
+ disabled: isConfirming,
103
+ className: "flex-1",
104
+ children: [
105
+ agreeeText || "OK",
106
+ " "
107
+ ]
108
+ }
109
+ )
110
+ ] })
111
+ }
112
+ )
113
+ ] })
114
+ }
115
+ );
116
+ }
117
+ export {
118
+ ConfirmationModalDialog as C,
119
+ IoCloseOutline as I
120
+ };
121
+ //# sourceMappingURL=ConfirmationModalDialog-CM6ONyzM.js.map