@addsign/moje-agenda-shared-lib 0.0.29 → 0.0.30

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.
Files changed (39) hide show
  1. package/dist/assets/tailwind.css +1484 -1
  2. package/dist/components/Button.js +23 -20
  3. package/dist/components/Button.js.map +1 -0
  4. package/dist/components/Calendar.js +89 -57
  5. package/dist/components/Calendar.js.map +1 -0
  6. package/dist/components/ConfirmationModalDialog.js +52 -47
  7. package/dist/components/ConfirmationModalDialog.js.map +1 -0
  8. package/dist/components/DataTable.js +211 -145
  9. package/dist/components/DataTable.js.map +1 -0
  10. package/dist/components/Spinner.js +9 -8
  11. package/dist/components/Spinner.js.map +1 -0
  12. package/dist/components/form/AutocompleteSearchBar.js +323 -239
  13. package/dist/components/form/AutocompleteSearchBar.js.map +1 -0
  14. package/dist/components/form/FormField.js +171 -142
  15. package/dist/components/form/FormField.js.map +1 -0
  16. package/dist/components/form/PositionsSelectorSingle.js +143 -113
  17. package/dist/components/form/PositionsSelectorSingle.js.map +1 -0
  18. package/dist/components/layout/PageTitle.js +9 -8
  19. package/dist/components/layout/PageTitle.js.map +1 -0
  20. package/dist/components/layout/SectionTitle.js +9 -8
  21. package/dist/components/layout/SectionTitle.js.map +1 -0
  22. package/dist/contexts/FederationContext.js +12 -8
  23. package/dist/contexts/FederationContext.js.map +1 -0
  24. package/dist/contexts/useFederationContext.js +5 -4
  25. package/dist/contexts/useFederationContext.js.map +1 -0
  26. package/dist/iconBase-BY_L6Cb_.js +144 -0
  27. package/dist/iconBase-BY_L6Cb_.js.map +1 -0
  28. package/dist/index-C0yNf1cc.js +48 -0
  29. package/dist/index-C0yNf1cc.js.map +1 -0
  30. package/dist/main.js +29 -28
  31. package/dist/main.js.map +1 -0
  32. package/dist/types.d.ts +1 -0
  33. package/dist/types.js +1 -0
  34. package/dist/types.js.map +1 -0
  35. package/dist/utils/getFullName.js +9 -3
  36. package/dist/utils/getFullName.js.map +1 -0
  37. package/package.json +1 -1
  38. package/dist/iconBase-DkR9t2l_.js +0 -117
  39. package/dist/index-CO5g84CR.js +0 -47
@@ -1,30 +1,33 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import '../assets/tailwind.css';/* empty css */
3
- const n = " py-2 px-4 leading-[25px] ", s = {
4
- primary: "bg-primary text-gray-100 hover:bg-gray w-fit rounded-lg whitespace-nowrap font-medium disabled:opacity-50",
5
- secondary: "bg-white text-gray-800 hover:bg-gray-100 rounded-lg border border-gray-300 shadow whitespace-nowrap font-medium disabled:opacity-50",
6
- transparent: "bg-transparent border border-transparent hover:bg-gray-100 hover:border-gray-200 rounded-lg text-primary font-medium text-gray-800 w-fit disabled:opacity-50",
7
- success: "bg-gray-500 hover:bg-gray-700 text-white rounded-lg disabled:opacity-50",
8
- danger: "bg-gray-500 hover:bg-gray-700 text-white rounded-lg disabled:opacity-50",
3
+ const commonStyles = " py-2 px-4 leading-[25px] ";
4
+ const buttonStyles = {
5
+ primary: "!bg-primary text-gray-100 hover:bg-gray w-fit rounded-lg whitespace-nowrap font-medium disabled:opacity-50",
6
+ secondary: "!bg-white text-gray-800 hover:bg-gray-100 rounded-lg border border-gray-300 shadow whitespace-nowrap font-medium disabled:opacity-50",
7
+ transparent: "!bg-transparent border border-transparent hover:bg-gray-100 hover:border-gray-200 rounded-lg text-primary font-medium text-gray-800 w-fit disabled:opacity-50",
8
+ success: "!bg-gray-500 hover:bg-gray-700 text-white rounded-lg disabled:opacity-50",
9
+ danger: "!bg-gray-500 hover:bg-gray-700 text-white rounded-lg disabled:opacity-50",
9
10
  icon: "text-primary font-medium rounded-full text-sm text-center inline-flex items-center ml-4 h-full disabled:opacity-50"
10
- }, b = ({
11
- variant: e = "primary",
12
- children: r,
13
- onClick: t,
14
- className: a,
15
- ...o
11
+ };
12
+ const Button = ({
13
+ variant = "primary",
14
+ children,
15
+ onClick,
16
+ className,
17
+ ...props
16
18
  }) => {
17
- const d = n + s[e];
18
- return /* @__PURE__ */ i(
19
+ const classNames = commonStyles + buttonStyles[variant];
20
+ return /* @__PURE__ */ jsx(
19
21
  "button",
20
22
  {
21
- className: d + " " + (a || " sharedLibraryource "),
22
- onClick: t,
23
- ...o,
24
- children: r
23
+ className: classNames + " " + (className || " sharedLibraryource "),
24
+ onClick,
25
+ ...props,
26
+ children
25
27
  }
26
28
  );
27
29
  };
28
30
  export {
29
- b as default
31
+ Button as default
30
32
  };
33
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","sources":["../../lib/components/Button.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport \"../css/tailwind.css\";\r\n\r\ntype ButtonVariant =\r\n | \"primary\"\r\n | \"secondary\"\r\n | \"transparent\"\r\n | \"success\"\r\n | \"danger\"\r\n | \"icon\";\r\n\r\ninterface IButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\r\n variant?: ButtonVariant;\r\n}\r\nconst commonStyles = \" py-2 px-4 leading-[25px] \";\r\nconst buttonStyles: { [key in ButtonVariant]: string } = {\r\n primary:\r\n \"!bg-primary text-gray-100 hover:bg-gray w-fit rounded-lg whitespace-nowrap font-medium disabled:opacity-50\",\r\n secondary:\r\n \"!bg-white text-gray-800 hover:bg-gray-100 rounded-lg border border-gray-300 shadow whitespace-nowrap font-medium disabled:opacity-50\",\r\n transparent:\r\n \"!bg-transparent border border-transparent hover:bg-gray-100 hover:border-gray-200 rounded-lg text-primary font-medium text-gray-800 w-fit disabled:opacity-50\",\r\n success:\r\n \"!bg-gray-500 hover:bg-gray-700 text-white rounded-lg disabled:opacity-50\",\r\n danger:\r\n \"!bg-gray-500 hover:bg-gray-700 text-white rounded-lg disabled:opacity-50\",\r\n icon: \"text-primary font-medium rounded-full text-sm text-center inline-flex items-center ml-4 h-full disabled:opacity-50\",\r\n};\r\nconst Button: React.FC<IButtonProps> = ({\r\n variant = \"primary\",\r\n children,\r\n onClick,\r\n className,\r\n ...props\r\n}) => {\r\n const classNames = commonStyles + buttonStyles[variant];\r\n\r\n return (\r\n <button\r\n className={classNames + \" \" + (className || \" sharedLibraryource \")}\r\n onClick={onClick}\r\n {...props}\r\n >\r\n {children}\r\n </button>\r\n );\r\n};\r\n\r\nexport default Button;\r\n"],"names":[],"mappings":";;AAcA,MAAM,eAAe;AACrB,MAAM,eAAmD;AAAA,EACvD,SACE;AAAA,EACF,WACE;AAAA,EACF,aACE;AAAA,EACF,SACE;AAAA,EACF,QACE;AAAA,EACF,MAAM;AACR;AACA,MAAM,SAAiC,CAAC;AAAA,EACtC,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,aAAa,eAAe,aAAa,OAAO;AAGpD,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,aAAa,OAAO,aAAa;AAAA,MAC5C;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;"}
@@ -1,11 +1,14 @@
1
- import { jsxs as s, jsx as i } from "react/jsx-runtime";
2
- import j, { useState as h, useCallback as x, useEffect as P } from "react";
3
- const Y = ({ items: b }) => {
4
- const [l, f] = h(
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import React, { useState, useCallback, useEffect } from "react";
3
+ const Calendar = ({ items }) => {
4
+ const [currentMonth, setCurrentMonth] = useState(
5
5
  (/* @__PURE__ */ new Date()).getMonth()
6
- ), [d, g] = h(
6
+ );
7
+ const [currentYear, setCurrentYear] = useState(
7
8
  (/* @__PURE__ */ new Date()).getFullYear()
8
- ), [y, v] = h([]), N = [
9
+ );
10
+ const [calendarData, setCalendarData] = useState([]);
11
+ const monthNames = [
9
12
  "Leden",
10
13
  "Únor",
11
14
  "Březen",
@@ -18,7 +21,8 @@ const Y = ({ items: b }) => {
18
21
  "Říjen",
19
22
  "Listopad",
20
23
  "Prosinec"
21
- ], D = [
24
+ ];
25
+ const dayNames = [
22
26
  "Pondělí",
23
27
  "Úterý",
24
28
  "Středa",
@@ -26,94 +30,122 @@ const Y = ({ items: b }) => {
26
30
  "Pátek",
27
31
  "Sobota",
28
32
  "Neděle"
29
- ], k = (e) => e % 4 === 0 && e % 100 !== 0 || e % 400 === 0, m = x((e, t) => e === 1 ? k(t) ? 29 : 28 : [0, 2, 4, 6, 7, 9, 11].includes(e) ? 31 : 30, []), p = x(
30
- (e, t) => {
31
- const a = [];
32
- let r = new Date(t, e, 1).getDay() - 1;
33
- r === -1 && (r = 6);
34
- let o = 1;
35
- for (let n = 0; n < 6; n++) {
36
- const c = [];
37
- for (let u = 0; u < 7; u++)
38
- n === 0 && u < r || o > m(e, t) ? c.push("") : c.push(o++);
39
- a.push(c);
33
+ ];
34
+ const isLeapYear = (year) => year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
35
+ const daysInMonth = useCallback((month, year) => {
36
+ if (month === 1) {
37
+ return isLeapYear(year) ? 29 : 28;
38
+ }
39
+ if ([0, 2, 4, 6, 7, 9, 11].includes(month)) {
40
+ return 31;
41
+ }
42
+ return 30;
43
+ }, []);
44
+ const generateMonthDays = useCallback(
45
+ (month, year) => {
46
+ const days = [];
47
+ let firstDayOfMonth = new Date(year, month, 1).getDay() - 1;
48
+ if (firstDayOfMonth === -1)
49
+ firstDayOfMonth = 6;
50
+ let dayCounter = 1;
51
+ for (let week = 0; week < 6; week++) {
52
+ const weekDays = [];
53
+ for (let day = 0; day < 7; day++) {
54
+ if (week === 0 && day < firstDayOfMonth) {
55
+ weekDays.push("");
56
+ } else if (dayCounter > daysInMonth(month, year)) {
57
+ weekDays.push("");
58
+ } else {
59
+ weekDays.push(dayCounter++);
60
+ }
61
+ }
62
+ days.push(weekDays);
40
63
  }
41
- return a;
64
+ return days;
42
65
  },
43
- [m]
66
+ [daysInMonth]
44
67
  );
45
- P(() => {
46
- v(p(l, d));
47
- }, [l, d, p]);
48
- const w = () => {
49
- f((e) => e === 11 ? 0 : e + 1), l === 11 && g((e) => e + 1);
50
- }, C = () => {
51
- f((e) => e === 0 ? 11 : e - 1), l === 0 && g((e) => e - 1);
52
- }, M = (e, t, a) => {
53
- const r = new Date(a, t, e);
54
- return b.filter((o) => r >= o.from && r <= o.to);
68
+ useEffect(() => {
69
+ setCalendarData(generateMonthDays(currentMonth, currentYear));
70
+ }, [currentMonth, currentYear, generateMonthDays]);
71
+ const goToNextMonth = () => {
72
+ setCurrentMonth((prev) => prev === 11 ? 0 : prev + 1);
73
+ if (currentMonth === 11) {
74
+ setCurrentYear((prev) => prev + 1);
75
+ }
76
+ };
77
+ const goToPreviousMonth = () => {
78
+ setCurrentMonth((prev) => prev === 0 ? 11 : prev - 1);
79
+ if (currentMonth === 0) {
80
+ setCurrentYear((prev) => prev - 1);
81
+ }
82
+ };
83
+ const findItemsForDay = (day, month, year) => {
84
+ const date = new Date(year, month, day);
85
+ return items.filter((item) => date >= item.from && date <= item.to);
55
86
  };
56
- return /* @__PURE__ */ s("div", { className: "flex flex-col bg-white shadow-lg flex-grow text-xs", children: [
57
- /* @__PURE__ */ s("div", { className: "flex justify-between items-center bg-gray-200 text-black p-4", children: [
58
- /* @__PURE__ */ s("h2", { className: "font-semibold text-xl", children: [
59
- N[l],
87
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col bg-white shadow-lg flex-grow text-xs", children: [
88
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center bg-gray-200 text-black p-4", children: [
89
+ /* @__PURE__ */ jsxs("h2", { className: "font-semibold text-xl", children: [
90
+ monthNames[currentMonth],
60
91
  " ",
61
- d
92
+ currentYear
62
93
  ] }),
63
- /* @__PURE__ */ s("div", { children: [
64
- /* @__PURE__ */ i(
94
+ /* @__PURE__ */ jsxs("div", { children: [
95
+ /* @__PURE__ */ jsx(
65
96
  "button",
66
97
  {
67
- onClick: C,
98
+ onClick: goToPreviousMonth,
68
99
  className: "mx-1 px-3 py-2 text-black bg-gray-400 hover:bg-gray-500",
69
100
  children: "Předchozí"
70
101
  }
71
102
  ),
72
- /* @__PURE__ */ i(
103
+ /* @__PURE__ */ jsx(
73
104
  "button",
74
105
  {
75
- onClick: w,
106
+ onClick: goToNextMonth,
76
107
  className: "mx-1 px-3 py-2 text-black bg-gray-400 hover:bg-gray-500",
77
108
  children: "Následující"
78
109
  }
79
110
  )
80
111
  ] })
81
112
  ] }),
82
- /* @__PURE__ */ s("div", { className: "grid grid-cols-7 divide-x divide-y", children: [
83
- D.map((e, t) => /* @__PURE__ */ i("div", { className: "p-4 text-center font-semibold", children: e }, t)),
84
- y.map((e, t) => /* @__PURE__ */ i(j.Fragment, { children: e.map((a, r) => {
85
- const o = a ? M(a, l, d) : [];
86
- return /* @__PURE__ */ s(
113
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-7 divide-x divide-y", children: [
114
+ dayNames.map((day, index) => /* @__PURE__ */ jsx("div", { className: "p-4 text-center font-semibold", children: day }, index)),
115
+ calendarData.map((week, weekIndex) => /* @__PURE__ */ jsx(React.Fragment, { children: week.map((day, dayIndex) => {
116
+ const itemsForDay = day ? findItemsForDay(day, currentMonth, currentYear) : [];
117
+ return /* @__PURE__ */ jsxs(
87
118
  "div",
88
119
  {
89
120
  className: "p-0 align-middle justify-center text-center",
90
121
  children: [
91
- /* @__PURE__ */ s("div", { className: "py-1 font-bold", children: [
92
- a,
122
+ /* @__PURE__ */ jsxs("div", { className: "py-1 font-bold", children: [
123
+ day,
93
124
  " "
94
125
  ] }),
95
- o.map((n, c) => /* @__PURE__ */ i(
126
+ itemsForDay.map((item, itemIndex) => /* @__PURE__ */ jsx(
96
127
  "div",
97
128
  {
98
129
  className: "dataItem w-full py-1 bg-primary text-white text-center mt-0",
99
130
  style: {
100
- backgroundColor: n.background,
101
- color: n.color
131
+ backgroundColor: item.background,
132
+ color: item.color
102
133
  },
103
- "data-tooltip-target": "tooltip-" + n.id,
104
- title: n.tooltip,
105
- children: n.label
134
+ "data-tooltip-target": "tooltip-" + item.id,
135
+ title: item.tooltip,
136
+ children: item.label
106
137
  },
107
- c
138
+ itemIndex
108
139
  ))
109
140
  ]
110
141
  },
111
- r
142
+ dayIndex
112
143
  );
113
- }) }, t))
144
+ }) }, weekIndex))
114
145
  ] })
115
146
  ] });
116
147
  };
117
148
  export {
118
- Y as default
149
+ Calendar as default
119
150
  };
151
+ //# sourceMappingURL=Calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Calendar.js","sources":["../../lib/components/Calendar.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback } from \"react\";\n\nexport interface ICalendarItem {\n id: number;\n label: string;\n from: Date;\n to: Date;\n background?: string;\n color?: string;\n tooltip?: string;\n}\n\ntype ICalendarProps = {\n items: ICalendarItem[];\n};\n\n// Check if a day is within any item's date range\n\nconst Calendar: React.FunctionComponent<ICalendarProps> = ({ items }) => {\n const [currentMonth, setCurrentMonth] = useState<number>(\n new Date().getMonth()\n );\n const [currentYear, setCurrentYear] = useState<number>(\n new Date().getFullYear()\n );\n const [calendarData, setCalendarData] = useState<(string | number)[][]>([]);\n\n const monthNames: string[] = [\n \"Leden\",\n \"Únor\",\n \"Březen\",\n \"Duben\",\n \"Květen\",\n \"Červen\",\n \"Červenec\",\n \"Srpen\",\n \"Září\",\n \"Říjen\",\n \"Listopad\",\n \"Prosinec\",\n ];\n const dayNames: string[] = [\n \"Pondělí\",\n \"Úterý\",\n \"Středa\",\n \"Čtvrtek\",\n \"Pátek\",\n \"Sobota\",\n \"Neděle\",\n ];\n\n // Leap year check\n const isLeapYear = (year: number) =>\n (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n\n // Days in each month\n const daysInMonth = useCallback((month: number, year: number) => {\n if (month === 1) {\n // February\n return isLeapYear(year) ? 29 : 28;\n }\n if ([0, 2, 4, 6, 7, 9, 11].includes(month)) {\n // Months with 31 days\n\n return 31;\n }\n\n return 30; // Months with 30 days\n }, []);\n\n // Generate days for a month\n const generateMonthDays = useCallback(\n (month: number, year: number) => {\n const days = [];\n // const firstDayOfMonth = new Date(year, month, 1).getDay()\n\n // Adjusted to make week start from Monday\n let firstDayOfMonth = new Date(year, month, 1).getDay() - 1;\n if (firstDayOfMonth === -1) firstDayOfMonth = 6; // Sunday becomes 6 instead of -1\n\n let dayCounter = 1;\n\n for (let week = 0; week < 6; week++) {\n const weekDays = [];\n for (let day = 0; day < 7; day++) {\n if (week === 0 && day < firstDayOfMonth) {\n weekDays.push(\"\");\n } else if (dayCounter > daysInMonth(month, year)) {\n weekDays.push(\"\");\n } else {\n weekDays.push(dayCounter++);\n }\n }\n days.push(weekDays);\n }\n return days;\n },\n [daysInMonth]\n );\n\n useEffect(() => {\n setCalendarData(generateMonthDays(currentMonth, currentYear));\n }, [currentMonth, currentYear, generateMonthDays]);\n\n // Navigation handlers\n const goToNextMonth = () => {\n setCurrentMonth((prev) => (prev === 11 ? 0 : prev + 1));\n if (currentMonth === 11) {\n setCurrentYear((prev) => prev + 1);\n }\n };\n\n const goToPreviousMonth = () => {\n setCurrentMonth((prev) => (prev === 0 ? 11 : prev - 1));\n if (currentMonth === 0) {\n setCurrentYear((prev) => prev - 1);\n }\n };\n const findItemsForDay = (\n day: number,\n month: number,\n year: number\n ): ICalendarItem[] => {\n const date = new Date(year, month, day);\n return items.filter((item) => date >= item.from && date <= item.to);\n };\n return (\n <div className=\"flex flex-col bg-white shadow-lg flex-grow text-xs\">\n <div className=\"flex justify-between items-center bg-gray-200 text-black p-4\">\n <h2 className=\"font-semibold text-xl\">\n {monthNames[currentMonth]} {currentYear}\n </h2>\n <div>\n <button\n onClick={goToPreviousMonth}\n className=\"mx-1 px-3 py-2 text-black bg-gray-400 hover:bg-gray-500\"\n >\n Předchozí\n </button>\n <button\n onClick={goToNextMonth}\n className=\"mx-1 px-3 py-2 text-black bg-gray-400 hover:bg-gray-500\"\n >\n Následující\n </button>\n </div>\n </div>\n <div className=\"grid grid-cols-7 divide-x divide-y\">\n {dayNames.map((day, index) => (\n <div key={index} className=\"p-4 text-center font-semibold\">\n {day}\n </div>\n ))}\n {calendarData.map((week, weekIndex) => (\n <React.Fragment key={weekIndex}>\n {week.map((day, dayIndex) => {\n const itemsForDay = day\n ? findItemsForDay(day as number, currentMonth, currentYear)\n : [];\n return (\n <div\n key={dayIndex}\n className=\"p-0 align-middle justify-center text-center\"\n >\n <div className=\"py-1 font-bold\">{day} </div>\n {itemsForDay.map((item, itemIndex) => (\n <div\n key={itemIndex}\n className=\"dataItem w-full py-1 bg-primary text-white text-center mt-0\"\n style={{\n backgroundColor: item.background,\n color: item.color,\n }}\n data-tooltip-target={\"tooltip-\" + item.id}\n title={item.tooltip}\n >\n {item.label}\n </div>\n ))}\n </div>\n );\n })}\n </React.Fragment>\n ))}\n </div>\n </div>\n );\n};\n\nexport default Calendar;\n"],"names":[],"mappings":";;AAkBA,MAAM,WAAoD,CAAC,EAAE,YAAY;AACjE,QAAA,CAAC,cAAc,eAAe,IAAI;AAAA,KACtC,oBAAI,KAAK,GAAE,SAAS;AAAA,EAAA;AAEhB,QAAA,CAAC,aAAa,cAAc,IAAI;AAAA,KACpC,oBAAI,KAAK,GAAE,YAAY;AAAA,EAAA;AAEzB,QAAM,CAAC,cAAc,eAAe,IAAI,SAAgC,CAAE,CAAA;AAE1E,QAAM,aAAuB;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF,QAAM,WAAqB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAII,QAAA,aAAa,CAAC,SACjB,OAAO,MAAM,KAAK,OAAO,QAAQ,KAAM,OAAO,QAAQ;AAGzD,QAAM,cAAc,YAAY,CAAC,OAAe,SAAiB;AAC/D,QAAI,UAAU,GAAG;AAER,aAAA,WAAW,IAAI,IAAI,KAAK;AAAA,IACjC;AACI,QAAA,CAAC,GAAG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AK;AAAA,oBACtB,OAAO,KAAK;AAAA,kBACd;AAAA,kBACA,uBAAqB,aAAa,KAAK;AAAA,kBACvC,OAAO,KAAK;AAAA,kBAEX,UAAK,KAAA;AAAA,gBAAA;AAAA,gBATD;AAAA,cAAA,CAWR;AAAA,YAAA;AAAA,UAAA;AAAA,UAjBI;AAAA,QAAA;AAAA,MAkBP,CAEH,EA3BkB,GAAA,SA4BrB,CACD;AAAA,IAAA,GACH;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -1,91 +1,95 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { useEffect as h } from "react";
3
- import { G as l } from "../iconBase-DkR9t2l_.js";
4
- function f(r) {
5
- return l({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M268 416h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12zM432 80h-82.41l-34-56.7A48 48 0 0 0 274.41 0H173.59a48 48 0 0 0-41.16 23.3L98.41 80H16A16 16 0 0 0 0 96v16a16 16 0 0 0 16 16h16v336a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128h16a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM171.84 50.91A6 6 0 0 1 177 48h94a6 6 0 0 1 5.15 2.91L293.61 80H154.39zM368 464H80V128h288zm-212-48h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12z" }, child: [] }] })(r);
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
+ import { G as GenIcon } from "../iconBase-BY_L6Cb_.js";
4
+ function FaRegTrashAlt(props) {
5
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M268 416h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12zM432 80h-82.41l-34-56.7A48 48 0 0 0 274.41 0H173.59a48 48 0 0 0-41.16 23.3L98.41 80H16A16 16 0 0 0 0 96v16a16 16 0 0 0 16 16h16v336a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128h16a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM171.84 50.91A6 6 0 0 1 177 48h94a6 6 0 0 1 5.15 2.91L293.61 80H154.39zM368 464H80V128h288zm-212-48h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12z" }, "child": [] }] })(props);
6
6
  }
7
- function m(r) {
8
- return l({ 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: [] }] })(r);
7
+ function IoCloseOutline(props) {
8
+ 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);
9
9
  }
10
- function b({
11
- title: r,
12
- confirmAction: i,
13
- cancelAction: s,
14
- description: d,
15
- agreeeText: o,
16
- cancelText: n
10
+ function ConfirmationModalDialog({
11
+ title,
12
+ confirmAction,
13
+ cancelAction,
14
+ description,
15
+ agreeeText,
16
+ cancelText
17
17
  }) {
18
- return h(() => {
19
- const a = (c) => {
20
- c.key === "Escape" && s();
18
+ useEffect(() => {
19
+ const handleKeyDown = (event) => {
20
+ if (event.key === "Escape") {
21
+ cancelAction();
22
+ }
21
23
  };
22
- return window.addEventListener("keydown", a), () => {
23
- window.removeEventListener("keydown", a);
24
+ window.addEventListener("keydown", handleKeyDown);
25
+ return () => {
26
+ window.removeEventListener("keydown", handleKeyDown);
24
27
  };
25
- }, [s]), /* @__PURE__ */ e(
28
+ }, [cancelAction]);
29
+ return /* @__PURE__ */ jsx(
26
30
  "div",
27
31
  {
28
32
  className: "fixed inset-0 bg-black bg-opacity-25 flex items-center justify-center p-4",
29
33
  style: { zIndex: 50 },
30
- children: /* @__PURE__ */ t("div", { className: "w-96 h-64 bg-white rounded-xl shadow flex-col justify-start items-center inline-flex relative overflow-hidden", children: [
31
- /* @__PURE__ */ e(
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(
32
36
  "div",
33
37
  {
34
38
  id: "graphics",
35
39
  className: "w-80 h-80 left-[-120px] top-[-120px] absolute ",
36
- children: /* @__PURE__ */ t("div", { className: "w-80 h-80 left-0 top-0 absolute", children: [
37
- /* @__PURE__ */ e("div", { className: "w-24 h-24 left-[120px] top-[120px] absolute rounded-full border border-gray-150" }),
38
- /* @__PURE__ */ e("div", { className: "w-36 h-36 left-[96px] top-[96px] absolute rounded-full border border-gray-100 " }),
39
- /* @__PURE__ */ e("div", { className: "w-48 h-48 left-[72px] top-[72px] absolute rounded-full border border-gray-100 " }),
40
- /* @__PURE__ */ e("div", { className: "w-60 h-60 left-[48px] top-[48px] absolute rounded-full border border-gray-50 " }),
41
- /* @__PURE__ */ e("div", { className: "w-72 h-72 left-[24px] top-[24px] absolute rounded-full border border-gray-50" })
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" })
42
46
  ] })
43
47
  }
44
48
  ),
45
- /* @__PURE__ */ t(
49
+ /* @__PURE__ */ jsxs(
46
50
  "div",
47
51
  {
48
52
  id: "header",
49
53
  className: "self-stretch h-40 flex-col justify-start items-center flex z-40",
50
54
  children: [
51
- /* @__PURE__ */ t("div", { className: "self-stretch h-40 px-6 pt-6 flex-col justify-start items-start gap-4 flex", children: [
52
- /* @__PURE__ */ e("div", { className: "w-12 h-12 relative bg-red-100 rounded-full", children: /* @__PURE__ */ e(f, { className: "w-6 h-6 left-[12px] top-[12px] absolute" }) }),
53
- /* @__PURE__ */ t("div", { className: "self-stretch h-16 flex-col justify-start items-start gap-1 flex", children: [
54
- /* @__PURE__ */ e("div", { className: "self-stretch text-gray-900 text-lg font-semibold font-['Inter'] leading-7", children: r }),
55
- /* @__PURE__ */ e("div", { className: "self-stretch text-slate-600 text-sm font-normal font-['Open Sans'] leading-tight", children: d })
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 })
56
60
  ] })
57
61
  ] }),
58
- /* @__PURE__ */ e(
62
+ /* @__PURE__ */ jsx(
59
63
  "div",
60
64
  {
61
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",
62
- onClick: s,
63
- children: /* @__PURE__ */ e(m, { className: "w-6 h-6 relative text-gray-400" })
66
+ onClick: cancelAction,
67
+ children: /* @__PURE__ */ jsx(IoCloseOutline, { className: "w-6 h-6 relative text-gray-400" })
64
68
  }
65
69
  )
66
70
  ]
67
71
  }
68
72
  ),
69
- /* @__PURE__ */ e(
73
+ /* @__PURE__ */ jsx(
70
74
  "div",
71
75
  {
72
76
  id: "actions",
73
77
  className: "self-stretch h-24 pt-8 flex-col justify-start items-start flex z-40",
74
- children: /* @__PURE__ */ t("div", { className: "self-stretch px-6 pb-6 justify-start items-start gap-3 inline-flex", children: [
75
- /* @__PURE__ */ e(
78
+ children: /* @__PURE__ */ jsxs("div", { className: "self-stretch px-6 pb-6 justify-start items-start gap-3 inline-flex", children: [
79
+ /* @__PURE__ */ jsx(
76
80
  "div",
77
81
  {
78
82
  className: "grow shrink basis-0 h-11 px-4 py-2.5 bg-white rounded-lg shadow border border-gray-300 justify-center items-center gap-1.5 flex cursor-pointer",
79
- onClick: s,
80
- children: /* @__PURE__ */ e("div", { className: "px-0.5 justify-center items-center flex", children: /* @__PURE__ */ e("button", { className: "text-slate-700 text-base font-semibold font-['Inter'] leading-normal", children: n || "Zrušit" }) })
83
+ onClick: cancelAction,
84
+ children: /* @__PURE__ */ jsx("div", { className: "px-0.5 justify-center items-center flex", children: /* @__PURE__ */ jsx("button", { className: "text-slate-700 text-base font-semibold font-['Inter'] leading-normal", children: cancelText || "Zrušit" }) })
81
85
  }
82
86
  ),
83
- /* @__PURE__ */ e(
87
+ /* @__PURE__ */ jsx(
84
88
  "div",
85
89
  {
86
90
  className: "grow shrink basis-0 h-11 px-4 py-2.5 bg-red-600 rounded-lg shadow border border-red-600 justify-center items-center gap-1.5 flex cursor-pointer",
87
- onClick: i,
88
- children: /* @__PURE__ */ e("div", { className: "px-0.5 justify-center items-center flex", children: /* @__PURE__ */ e("button", { className: "text-white text-base font-semibold font-['Inter'] leading-normal", children: o || "OK" }) })
91
+ onClick: confirmAction,
92
+ children: /* @__PURE__ */ jsx("div", { className: "px-0.5 justify-center items-center flex", children: /* @__PURE__ */ jsx("button", { className: "text-white text-base font-semibold font-['Inter'] leading-normal", children: agreeeText || "OK" }) })
89
93
  }
90
94
  )
91
95
  ] })
@@ -96,6 +100,7 @@ function b({
96
100
  );
97
101
  }
98
102
  export {
99
- b as ConfirmationModalDialog,
100
- b as default
103
+ ConfirmationModalDialog,
104
+ ConfirmationModalDialog as default
101
105
  };
106
+ //# sourceMappingURL=ConfirmationModalDialog.js.map