@cagatayfdn/flora-components 0.0.138 → 0.0.140

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 (186) hide show
  1. package/dist/Accordion.css +1 -0
  2. package/dist/ActionButton.css +1 -0
  3. package/dist/AlertCard.css +1 -0
  4. package/dist/Autocomplete.css +1 -0
  5. package/dist/Button.css +1 -0
  6. package/dist/Card.css +1 -0
  7. package/dist/Checkbox.css +1 -0
  8. package/dist/Config.css +1 -0
  9. package/dist/Confirm.css +1 -0
  10. package/dist/ContentHeader.css +1 -0
  11. package/dist/Datepicker.css +1 -0
  12. package/dist/Divider.css +1 -0
  13. package/dist/DropdownList.css +1 -0
  14. package/dist/ErrorLogModal.css +1 -0
  15. package/dist/FileUpload.css +1 -0
  16. package/dist/FileUpload.module-BxCEtOHx.js +32 -0
  17. package/dist/Heading.css +1 -0
  18. package/dist/IconBox.css +1 -0
  19. package/dist/InfoBoxList.css +1 -0
  20. package/dist/InfoBoxList.module-BHkAHgos.js +8 -0
  21. package/dist/InfoDate.css +1 -0
  22. package/dist/InfoText.css +1 -0
  23. package/dist/Input.css +1 -0
  24. package/dist/Label.css +1 -0
  25. package/dist/Legends.css +1 -0
  26. package/dist/Loading.css +1 -0
  27. package/dist/MenuItem-Df6Zsa7E.js +53 -0
  28. package/dist/MenuItem.css +1 -0
  29. package/dist/Modal.css +1 -0
  30. package/dist/NoResult.css +1 -0
  31. package/dist/PageWrap.css +1 -0
  32. package/dist/Pager.css +1 -0
  33. package/dist/Panel.css +1 -0
  34. package/dist/Radio.css +1 -0
  35. package/dist/ResultError.css +1 -0
  36. package/dist/ScrollContainer.css +1 -0
  37. package/dist/Select-BE_y91ZN.js +1831 -0
  38. package/dist/Select.css +1 -0
  39. package/dist/Select.module-ByPQ6qr4.js +21 -0
  40. package/dist/StatusTag.css +1 -0
  41. package/dist/StatusTypography.css +1 -0
  42. package/dist/Stepper.css +1 -0
  43. package/dist/Switch.css +1 -0
  44. package/dist/Tab.css +1 -0
  45. package/dist/Table.css +1 -0
  46. package/dist/Table.module-DUqpZOLt.js +29 -0
  47. package/dist/Textarea.css +1 -0
  48. package/dist/Tooltip.css +1 -0
  49. package/dist/Trans-B4ILpbwK.js +343 -0
  50. package/dist/TypographyText.css +1 -0
  51. package/dist/ValidationError.css +1 -0
  52. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  53. package/dist/_isArray-CBUZFxFA.js +6 -0
  54. package/dist/_isString-BUpNGP_8.js +6 -0
  55. package/dist/_reduce-DsUCMz4O.js +148 -0
  56. package/dist/assets/icons/icons.js +70 -0
  57. package/dist/assets/images/500_error_2x.gif +0 -0
  58. package/dist/assets/images/oms.png +0 -0
  59. package/dist/components/Accordion/Accordion.js +60 -0
  60. package/dist/components/ActionButton/ActionButton.js +54 -0
  61. package/dist/components/AlertCard/AlertCard.js +29 -0
  62. package/dist/components/AuthUserCan/Permission.js +18 -0
  63. package/dist/components/AuthUserCan/index.js +23 -0
  64. package/dist/components/Autocomplete/Autocomplete.js +87 -0
  65. package/dist/components/Button/Button.js +87 -0
  66. package/dist/components/Card/Card.js +21 -0
  67. package/dist/components/Charts/Bar.js +18 -0
  68. package/dist/components/Charts/Legends.js +21 -0
  69. package/dist/components/Charts/Line.js +18 -0
  70. package/dist/components/Charts/Pie.js +43 -0
  71. package/dist/components/Charts/index.js +31 -0
  72. package/dist/components/Charts/types.js +1 -0
  73. package/dist/components/Charts/utils.js +12 -0
  74. package/dist/components/Checkbox/Checkbox.js +68 -0
  75. package/dist/components/Config/Config.js +32 -0
  76. package/dist/components/Confirm/Confirm.js +60 -0
  77. package/dist/components/ContentHeader/ContentHeader.js +75 -0
  78. package/dist/components/ContentLoader/ContentLoader.js +16 -0
  79. package/dist/components/Countdown/Countdown.js +20 -0
  80. package/dist/components/Datepicker/Datepicker.js +1478 -0
  81. package/dist/components/Divider/Divider.js +27 -0
  82. package/dist/components/Drawer/Provider.js +24 -0
  83. package/dist/components/Drawer/index.js +55 -0
  84. package/dist/components/Dropdown/DropdownList.js +90 -0
  85. package/dist/components/ErrorLogModal/ErrorLogModal.js +69 -0
  86. package/dist/components/FileUpload/FileUpload.js +237 -0
  87. package/dist/components/FileUpload/ImagePreview.js +19 -0
  88. package/dist/components/FileUpload/LengthCard.js +6 -0
  89. package/dist/components/FileUpload/PreviewModal.js +53 -0
  90. package/dist/components/Grid/Column.js +29 -0
  91. package/dist/components/Grid/Row.js +6 -0
  92. package/dist/components/Heading/Heading.js +22 -0
  93. package/dist/components/Icon/index.js +24 -0
  94. package/dist/components/IconBox/IconBox.js +13 -0
  95. package/dist/components/InfiniteScroll/InfiniteScroll.js +41 -0
  96. package/dist/components/InfoBoxList/InfoBoxList.js +30 -0
  97. package/dist/components/InfoBoxList/helper.js +83 -0
  98. package/dist/components/InfoDate/InfoDate.js +19 -0
  99. package/dist/components/InfoText/InfoText.js +13 -0
  100. package/dist/components/Input/Input.js +140 -0
  101. package/dist/components/Label/Label.js +22 -0
  102. package/dist/components/Loading/Loading.js +62 -0
  103. package/dist/components/Modal/Modal.js +74 -0
  104. package/dist/components/NavigatorCard/index.js +59 -0
  105. package/dist/components/NoResult/NoResult.js +12 -0
  106. package/dist/components/Notification/Notification.js +26 -0
  107. package/dist/components/PageWrapper/PageWrap.js +46 -0
  108. package/dist/components/Pager/Pager.js +103 -0
  109. package/dist/components/Panel/Panel.js +71 -0
  110. package/dist/components/PermaLink/PermaLink.js +387 -0
  111. package/dist/components/Radio/Radio.js +96 -0
  112. package/dist/components/ResultError/ResultError.js +20 -0
  113. package/dist/components/ScrollContainer/ScrollContainer.js +23 -0
  114. package/dist/components/Select/NoData.js +10 -0
  115. package/dist/components/Select/OptionItem.js +19 -0
  116. package/dist/components/Select/Select.js +13 -0
  117. package/dist/components/Sidebar/MenuItem.js +9 -0
  118. package/dist/components/Sidebar/index.js +137 -0
  119. package/dist/components/StatusTag/StatusTag.js +24 -0
  120. package/dist/components/StatusTypography/StatusTypography.js +51 -0
  121. package/dist/components/Stepper/Stepper.js +75 -0
  122. package/dist/components/Switch/Switch.js +84 -0
  123. package/dist/components/Tab/Tab.js +28 -0
  124. package/dist/components/Table/Table.js +271 -0
  125. package/dist/components/Table/TableHeader.js +137 -0
  126. package/dist/components/Table/TableSort.js +25 -0
  127. package/dist/components/Textarea/Textarea.js +95 -0
  128. package/dist/components/Tooltip/Tooltip.js +1548 -0
  129. package/dist/components/TypographyText/TypographyText.js +91 -0
  130. package/dist/components/ValidationError/ValidationError.js +7 -0
  131. package/dist/components/index.js +133 -0
  132. package/dist/defineProperty-DeKy1XT0.js +37 -0
  133. package/dist/enums/appearance.js +14 -0
  134. package/dist/enums/applicationTypeSlug.js +4 -0
  135. package/dist/enums/index.js +29 -0
  136. package/dist/enums/isActiveColor.js +4 -0
  137. package/dist/enums/size.js +4 -0
  138. package/dist/enums/status.js +11 -0
  139. package/dist/equals-PL9KqVQf.js +119 -0
  140. package/dist/flatpickr-CRz1AV0e.js +59 -0
  141. package/dist/helper-lFjvXQpv.js +1465 -0
  142. package/dist/hooks/index.js +15 -0
  143. package/dist/hooks/useAauth.js +40 -0
  144. package/dist/hooks/useDisclosure.js +14 -0
  145. package/dist/hooks/useDrawer.js +9 -0
  146. package/dist/hooks/useMediaQuery.js +21 -0
  147. package/dist/hooks/useNiceModal.js +13 -0
  148. package/dist/i18nInstance-CiCZbaCK.js +55 -0
  149. package/dist/includes-8YTFrx85.js +46 -0
  150. package/dist/index-9ZLCCecr.js +364 -0
  151. package/dist/index-BHf7G3IG.js +35 -0
  152. package/dist/index-BJU1K2Aw.js +8003 -0
  153. package/dist/index-CB61CB0b.js +669 -0
  154. package/dist/index-H7XbDVmH.js +320 -0
  155. package/dist/index.css +1 -0
  156. package/dist/index.d.mts +1478 -0
  157. package/dist/index.d.ts +1478 -0
  158. package/dist/index.js +203 -0
  159. package/dist/index2.css +1 -0
  160. package/dist/jsx-runtime-BcAkpsdy.js +631 -0
  161. package/dist/keys-B0bo5Q7o.js +67 -0
  162. package/dist/locales/en/index.js +615 -0
  163. package/dist/locales/i18n.js +1417 -0
  164. package/dist/locales/index.js +5 -0
  165. package/dist/locales/tr/index.js +615 -0
  166. package/dist/main.css +1 -0
  167. package/dist/main.js +57 -0
  168. package/dist/prodivers.css +6 -0
  169. package/dist/prodivers.js +13 -0
  170. package/dist/react-content-loader.es-CswLCxkm.js +90 -0
  171. package/dist/react-toastify.esm-BUWNP7Nm.js +808 -0
  172. package/dist/types/common/date.js +1 -0
  173. package/dist/types/common/events.js +1 -0
  174. package/dist/types/common/forms.js +1 -0
  175. package/dist/types/common/option.js +1 -0
  176. package/dist/types/index.js +1 -0
  177. package/dist/useTranslation-CnCPcxVj.js +142 -0
  178. package/dist/utils/date.js +413 -0
  179. package/dist/utils/flatpickr.js +4 -0
  180. package/dist/utils/helper.js +18 -0
  181. package/dist/utils/index.js +27 -0
  182. package/dist/utils/language.js +46 -0
  183. package/dist/utils/table.js +62 -0
  184. package/dist/utils/validation.js +27 -0
  185. package/dist/utils/yup.js +2921 -0
  186. package/package.json +1 -1
@@ -0,0 +1,27 @@
1
+ import { j as t } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { DividerAppearance as _ } from "../../enums/appearance.js";
3
+ import { c as s } from "../../index-BHf7G3IG.js";
4
+ import '../../Divider.css';const a = "_divider_i35dl_2", o = "_grey_i35dl_2", g = "_light_i35dl_2", l = "_dark_grey_i35dl_2", i = {
5
+ divider: a,
6
+ grey: o,
7
+ light: g,
8
+ dark_grey: l,
9
+ "margin-15": "_margin-15_i35dl_2",
10
+ "margin-30": "_margin-30_i35dl_2"
11
+ }, v = ({
12
+ appearance: r = _.GREY,
13
+ className: e,
14
+ margin: d = "15"
15
+ }) => /* @__PURE__ */ t.jsx(
16
+ "hr",
17
+ {
18
+ "data-testid": "divider",
19
+ className: s(i.divider, e, {
20
+ [i[`${r}`]]: r,
21
+ [i[`margin-${d}`]]: d
22
+ })
23
+ }
24
+ );
25
+ export {
26
+ v as default
27
+ };
@@ -0,0 +1,24 @@
1
+ import { j as a } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { createContext as c, useReducer as i, useContext as d } from "react";
3
+ const w = {}, D = (e, r) => {
4
+ switch (r.type) {
5
+ case "OPEN_DRAWER":
6
+ return { ...e, [r.id]: !0 };
7
+ case "CLOSE_DRAWER":
8
+ return { ...e, [r.id]: !1 };
9
+ default:
10
+ return e;
11
+ }
12
+ }, s = c(void 0), E = ({ children: e }) => {
13
+ const [r, o] = i(D, w), n = (t) => o({ type: "OPEN_DRAWER", id: t }), u = (t) => o({ type: "CLOSE_DRAWER", id: t });
14
+ return /* @__PURE__ */ a.jsx(s.Provider, { value: { state: r, openDrawer: n, closeDrawer: u }, children: e });
15
+ }, p = () => {
16
+ const e = d(s);
17
+ if (!e)
18
+ throw new Error("useDrawerContext must be used within a DrawerProvider");
19
+ return e;
20
+ };
21
+ export {
22
+ E as DrawerProvider,
23
+ p as useDrawerContext
24
+ };
@@ -0,0 +1,55 @@
1
+ import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { c as w } from "../../index-BHf7G3IG.js";
3
+ import { useDrawerContext as f } from "./Provider.js";
4
+ import h from "../Icon/index.js";
5
+ import { useEffect as x } from "react";
6
+ import '../../index.css';const j = "_drawer_ltlqj_2", u = "_header_ltlqj_2", y = "_body_ltlqj_2", a = {
7
+ drawer: j,
8
+ header: u,
9
+ body: y
10
+ };
11
+ function D({ id: t, children: n, title: i, onClose: d }) {
12
+ const { state: c, closeDrawer: l } = f(), s = c[t] || !1;
13
+ if (!s)
14
+ return null;
15
+ const r = () => {
16
+ l(t), d && d();
17
+ };
18
+ return x(() => {
19
+ if (!s)
20
+ return;
21
+ const o = (m) => {
22
+ m.key === "Escape" && r();
23
+ };
24
+ return document.addEventListener("keydown", o), () => {
25
+ document.removeEventListener("keydown", o);
26
+ };
27
+ }, [s, t, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
28
+ /* @__PURE__ */ e.jsx(
29
+ "div",
30
+ {
31
+ "data-testid": "drawer-overlay",
32
+ onClick: r,
33
+ style: {
34
+ position: "fixed",
35
+ top: 0,
36
+ left: 0,
37
+ width: "100%",
38
+ height: "100%",
39
+ background: "rgba(0, 0, 0, 0.5)",
40
+ zIndex: 999
41
+ }
42
+ }
43
+ ),
44
+ /* @__PURE__ */ e.jsxs("div", { "data-testid": "drawer", className: w(a.drawer), children: [
45
+ /* @__PURE__ */ e.jsxs("div", { "data-testid": "drawer-header", className: a.header, children: [
46
+ /* @__PURE__ */ e.jsx("div", { children: i }),
47
+ /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(h, { onClick: r, name: "close" }) })
48
+ ] }),
49
+ /* @__PURE__ */ e.jsx("div", { "data-testid": "drawer-body", className: a.body, children: n })
50
+ ] })
51
+ ] });
52
+ }
53
+ export {
54
+ D as default
55
+ };
@@ -0,0 +1,90 @@
1
+ import { j as o } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { useState as x, useRef as j, useEffect as k } from "react";
3
+ import { c as d } from "../../index-BHf7G3IG.js";
4
+ import N from "../Icon/index.js";
5
+ import E from "../PermaLink/PermaLink.js";
6
+ import '../../DropdownList.css';const b = "_dropdownMenu_1n5ha_2", g = "_dropdownMenu__lg_1n5ha_2", C = "_dropdownMenu__md_1n5ha_2", L = "_dropdownMenu__sm_1n5ha_2", R = "_active_1n5ha_2", $ = "_icon_1n5ha_2", y = "_title_1n5ha_2", H = "_disabled_1n5ha_2", e = {
7
+ dropdownMenu: b,
8
+ dropdownMenu__lg: g,
9
+ dropdownMenu__md: C,
10
+ dropdownMenu__sm: L,
11
+ active: R,
12
+ icon: $,
13
+ title: y,
14
+ disabled: H
15
+ }, B = ({
16
+ buttonChild: m,
17
+ items: h,
18
+ footerItem: a,
19
+ className: w,
20
+ title: l,
21
+ titleClass: M,
22
+ event: r = "hover",
23
+ size: i = "lg",
24
+ isDisabled: c
25
+ }) => {
26
+ const [_, t] = x(!1), u = j(null), p = (n) => {
27
+ const s = u.current;
28
+ s != null && s.contains(n.target) || t(!1);
29
+ };
30
+ k(() => (document.addEventListener("mousedown", p), () => {
31
+ document.removeEventListener("mousedown", p);
32
+ }), []);
33
+ const f = (n) => {
34
+ c || n === "click" && t(!_);
35
+ };
36
+ return /* @__PURE__ */ o.jsx(
37
+ "div",
38
+ {
39
+ className: d("h-full flex items-center", {
40
+ [e.disabled]: c
41
+ }),
42
+ ref: u,
43
+ "data-testid": "dropdown-list",
44
+ children: /* @__PURE__ */ o.jsxs(
45
+ "div",
46
+ {
47
+ className: d(w, e.dropdownMenu, {
48
+ [e.disabled]: c
49
+ }),
50
+ onMouseLeave: () => r === "hover" && t(!1),
51
+ onMouseEnter: () => r === "hover" && t(!0),
52
+ onClick: () => f(r),
53
+ children: [
54
+ m,
55
+ /* @__PURE__ */ o.jsx(
56
+ "div",
57
+ {
58
+ className: d(e.dropdownMenu, {
59
+ [e.active]: _,
60
+ [e[`dropdownMenu__${i}`]]: i
61
+ }),
62
+ children: /* @__PURE__ */ o.jsxs("ul", { children: [
63
+ l && /* @__PURE__ */ o.jsx("li", { className: d(e.title, M), children: l }),
64
+ h.map((n, s) => /* @__PURE__ */ o.jsxs(
65
+ "li",
66
+ {
67
+ "data-testid": `dropdown-item-${s}`,
68
+ className: d(n.className, {
69
+ [e.icon]: n.icon
70
+ }),
71
+ children: [
72
+ n.icon && /* @__PURE__ */ o.jsx(N, { name: n.icon }),
73
+ n.to ? /* @__PURE__ */ o.jsx(E, { to: n.to, children: n.text }) : /* @__PURE__ */ o.jsx("a", { onClick: (v) => n.onClick && n.onClick(v), children: n.text })
74
+ ]
75
+ },
76
+ s
77
+ )),
78
+ a && a
79
+ ] })
80
+ }
81
+ )
82
+ ]
83
+ }
84
+ )
85
+ }
86
+ );
87
+ };
88
+ export {
89
+ B as default
90
+ };
@@ -0,0 +1,69 @@
1
+ import { j as o } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { N as c } from "../../index-H7XbDVmH.js";
3
+ import "../../index-BHf7G3IG.js";
4
+ import "../../hooks/useAauth.js";
5
+ import "../../assets/images/500_error_2x.gif";
6
+ import "../../locales/i18n.js";
7
+ import "react";
8
+ import "../Tooltip/Tooltip.js";
9
+ import "../../react-toastify.esm-BUWNP7Nm.js";
10
+ import "../../utils/date.js";
11
+ import "../Input/Input.js";
12
+ import m from "../ScrollContainer/ScrollContainer.js";
13
+ import "../Charts/index.js";
14
+ import "../Checkbox/Checkbox.js";
15
+ import "../Confirm/Confirm.js";
16
+ import "../Datepicker/Datepicker.js";
17
+ import t from "../Divider/Divider.js";
18
+ import "../Drawer/Provider.js";
19
+ import "../FileUpload/FileUpload.js";
20
+ import x from "../Modal/Modal.js";
21
+ import e from "../Grid/Column.js";
22
+ import u from "../Grid/Row.js";
23
+ import a from "../InfoDate/InfoDate.js";
24
+ import "../../Select-BE_y91ZN.js";
25
+ import "../Switch/Switch.js";
26
+ import "../Textarea/Textarea.js";
27
+ import w from "../../hooks/useNiceModal.js";
28
+ import { u as h } from "../../useTranslation-CnCPcxVj.js";
29
+ import { T as M } from "../../Trans-B4ILpbwK.js";
30
+ import '../../ErrorLogModal.css';const g = "_dropdownMenu_8gwxh_2", j = "_dropdownMenu__lg_8gwxh_2", f = "_dropdownMenu__md_8gwxh_2", b = "_dropdownMenu__sm_8gwxh_2", N = "_active_8gwxh_2", v = "_icon_8gwxh_2", L = "_title_8gwxh_2", T = "_disabled_8gwxh_2", l = {
31
+ dropdownMenu: g,
32
+ dropdownMenu__lg: j,
33
+ dropdownMenu__md: f,
34
+ dropdownMenu__sm: b,
35
+ active: N,
36
+ icon: v,
37
+ title: L,
38
+ disabled: T
39
+ }, y = ({ id: i, onClose: n, errors: s }) => {
40
+ const { t: d } = h(), [, _] = w(i), p = () => {
41
+ _(), n && n();
42
+ };
43
+ return /* @__PURE__ */ o.jsx(
44
+ x,
45
+ {
46
+ onClose: p,
47
+ className: l.realTimeLogModalStyle,
48
+ header: /* @__PURE__ */ o.jsx("div", { className: l.modalHeader, children: d("title.error_log") }),
49
+ children: /* @__PURE__ */ o.jsx(m, { children: s ? s.map((r) => /* @__PURE__ */ o.jsxs("div", { className: "container-fluid", children: [
50
+ /* @__PURE__ */ o.jsxs(u, { children: [
51
+ /* @__PURE__ */ o.jsxs(e, { children: [
52
+ /* @__PURE__ */ o.jsx("b", { children: `${d("label.created_date")}:` }),
53
+ /* @__PURE__ */ o.jsx(a, { date: r == null ? void 0 : r.created_date })
54
+ ] }),
55
+ /* @__PURE__ */ o.jsxs(e, { children: [
56
+ /* @__PURE__ */ o.jsx("b", { children: `${d("label.date_updated")}:` }),
57
+ /* @__PURE__ */ o.jsx(a, { date: r == null ? void 0 : r.update_date })
58
+ ] })
59
+ ] }),
60
+ /* @__PURE__ */ o.jsx(t, { className: "mt-4 mb-4" }),
61
+ /* @__PURE__ */ o.jsx("p", { className: "pre-line", children: r == null ? void 0 : r.log_data }),
62
+ /* @__PURE__ */ o.jsx(t, { className: "mt-4 mb-4" })
63
+ ] }, r == null ? void 0 : r.id)) : /* @__PURE__ */ o.jsx(M, { i18nKey: "text.not_found", values: { dataname: "Log" } }) })
64
+ }
65
+ );
66
+ }, so = c.create(y);
67
+ export {
68
+ so as default
69
+ };
@@ -0,0 +1,237 @@
1
+ import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import Z, { useState as j, useEffect as ee } from "react";
3
+ import te from "../Icon/index.js";
4
+ import { Notification as se } from "../Notification/Notification.js";
5
+ import { c as ae } from "../../helper-lFjvXQpv.js";
6
+ import { c as p } from "../../index-BHf7G3IG.js";
7
+ import { Icons as re } from "../../assets/icons/icons.js";
8
+ import { s as t } from "../../FileUpload.module-BxCEtOHx.js";
9
+ import ie from "../../assets/images/oms.png";
10
+ import { AppearanceDirection as le, NotificationAppearanceType as ne } from "../../enums/appearance.js";
11
+ import { imageFormatValidation as oe } from "../../utils/validation.js";
12
+ import M from "../Label/Label.js";
13
+ import ce from "../Tooltip/Tooltip.js";
14
+ import me from "../ValidationError/ValidationError.js";
15
+ import de from "./LengthCard.js";
16
+ import pe from "./PreviewModal.js";
17
+ import { u as fe } from "../../useTranslation-CnCPcxVj.js";
18
+ const ue = Z.forwardRef(
19
+ (A, W) => {
20
+ var O, k;
21
+ const {
22
+ name: h,
23
+ label: g,
24
+ id: $,
25
+ type: N = "text",
26
+ size: F,
27
+ isDisabled: v,
28
+ info: C,
29
+ error: P,
30
+ appearance: x,
31
+ description: B,
32
+ className: L,
33
+ wrapperClassName: U,
34
+ height: R = "40",
35
+ value: i,
36
+ fileName: _,
37
+ required: V,
38
+ onChange: o,
39
+ multiple: a = !1,
40
+ ...z
41
+ } = A, { t: T } = fe(), S = {
42
+ [t[`type__${N}`]]: N !== "text"
43
+ }, [c, b] = j(), [f, y] = j(), [s, u] = j([]), [q, w] = j(!1), G = p(
44
+ "form-group",
45
+ {
46
+ [t[`size__${F}`]]: F,
47
+ [t.disabled]: v,
48
+ [t.hidden]: N === "hidden"
49
+ },
50
+ U
51
+ ), H = (d) => d[0] && oe(d) ? new Promise((l, r) => {
52
+ const m = new FileReader();
53
+ m.readAsDataURL(d[0]), m.onload = () => l(m.result), m.onerror = (n) => r(n);
54
+ }) : ie, J = async (d) => {
55
+ const l = d.currentTarget.files;
56
+ let r = [];
57
+ if (!(s.length + l.length > 5)) {
58
+ if (a && !((s == null ? void 0 : s.length) >= 5)) {
59
+ const m = Object.values(l);
60
+ for (let n = 0; n < m.length; n++)
61
+ r.push(
62
+ ae(m[n])
63
+ );
64
+ await Promise.all(r).then((n) => {
65
+ var E;
66
+ ((E = s.filter(
67
+ (X) => n.some((Y) => X === Y)
68
+ )) == null ? void 0 : E.length) > 0 ? se({
69
+ message: T("text.duplicate_image_error"),
70
+ type: ne.ERROR
71
+ }) : (o && o([...s, ...n]), u([
72
+ ...s || [],
73
+ ...n
74
+ ]), b(l));
75
+ });
76
+ return;
77
+ }
78
+ l[0] && !a && (r = await H(l), o && o(r), y(r), b(l));
79
+ }
80
+ }, D = () => {
81
+ u([]), y(""), b(""), o && o("");
82
+ }, I = (d, l) => {
83
+ const r = d;
84
+ if (l && r.length == 1) {
85
+ D(), w(!1);
86
+ return;
87
+ }
88
+ if (l) {
89
+ const m = r.filter((n) => n !== l);
90
+ u(m), o && o(m);
91
+ return;
92
+ }
93
+ if (r.length == 1) {
94
+ D();
95
+ return;
96
+ }
97
+ r.length >= 0 && (u(r.slice(0, -1)), o && o(r.slice(0, -1)));
98
+ }, K = () => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
99
+ /* @__PURE__ */ e.jsxs("div", { className: t.imageContainer, "data-testid": "fileupload-multipleimages", children: [
100
+ /* @__PURE__ */ e.jsx("img", { src: s[s.length - 1] }),
101
+ /* @__PURE__ */ e.jsx(
102
+ te,
103
+ {
104
+ name: re.Trash,
105
+ className: t.deleteIcon,
106
+ onClick: () => I(s)
107
+ }
108
+ )
109
+ ] }),
110
+ /* @__PURE__ */ e.jsx("div", { className: t.lengthContainer, children: s.length > 1 && /* @__PURE__ */ e.jsx(
111
+ de,
112
+ {
113
+ onCardClick: () => w(!0),
114
+ count: s.length - 1
115
+ }
116
+ ) })
117
+ ] }), Q = (d) => {
118
+ d.target.value = null;
119
+ };
120
+ return ee(() => {
121
+ i && y(i), a && i && u(i);
122
+ }, [i]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
123
+ /* @__PURE__ */ e.jsxs("div", { className: G, "data-testid": "fileupload-container", children: [
124
+ /* @__PURE__ */ e.jsxs(
125
+ "div",
126
+ {
127
+ className: p(t.container, {
128
+ [t[`${x}`]]: x,
129
+ [t.disabled]: v
130
+ }),
131
+ children: [
132
+ /* @__PURE__ */ e.jsxs(
133
+ "div",
134
+ {
135
+ className: p("flex", "w-full", {
136
+ "justify-between": g,
137
+ "justify-start": !g
138
+ }),
139
+ children: [
140
+ g && /* @__PURE__ */ e.jsx(M, { appearance: x, name: h, children: g }),
141
+ (C && a || C && !f && !a) && /* @__PURE__ */ e.jsxs(
142
+ M,
143
+ {
144
+ className: t.info,
145
+ appearance: x,
146
+ name: h,
147
+ children: [
148
+ V && "*",
149
+ " ",
150
+ C
151
+ ]
152
+ }
153
+ )
154
+ ]
155
+ }
156
+ ),
157
+ /* @__PURE__ */ e.jsxs(
158
+ "div",
159
+ {
160
+ className: p({
161
+ [t.selectedFileWrap]: c || i,
162
+ [t.selectedFileWrap__multiple]: i || a && s.length > 0
163
+ }),
164
+ children: [
165
+ !a && f && /* @__PURE__ */ e.jsx("img", { src: f }),
166
+ a && s.length > 0 && K(),
167
+ /* @__PURE__ */ e.jsxs("div", { className: t.fileGroup, children: [
168
+ (c || _) && !a && /* @__PURE__ */ e.jsx(
169
+ ce,
170
+ {
171
+ id: h,
172
+ tooltipContent: c && ((O = c[0]) == null ? void 0 : O.name) || _,
173
+ ellipsis: !0,
174
+ direction: le.TOP,
175
+ children: /* @__PURE__ */ e.jsx("span", { className: t.fileName, children: c && ((k = c[0]) == null ? void 0 : k.name) || _ })
176
+ }
177
+ ),
178
+ /* @__PURE__ */ e.jsxs(
179
+ "div",
180
+ {
181
+ className: p(t.fieldWrap, {
182
+ [t.border__black]: !(i && !a && c),
183
+ [t.border__blue]: i && !a && c,
184
+ [t["mr-auto"]]: i && !a,
185
+ [t[`height-${R}`]]: R && !c && !f,
186
+ [t["height-40"]]: f || c,
187
+ [t.fieldWrap__multiple]: i && a && s.length >= 0
188
+ }),
189
+ children: [
190
+ /* @__PURE__ */ e.jsx(
191
+ "input",
192
+ {
193
+ type: "file",
194
+ name: h,
195
+ "data-testid": "fileupload-input",
196
+ id: $,
197
+ className: p(
198
+ t.control,
199
+ S,
200
+ L
201
+ ),
202
+ disabled: v,
203
+ onChange: J,
204
+ onClick: Q,
205
+ ref: W,
206
+ multiple: a,
207
+ ...z
208
+ }
209
+ ),
210
+ /* @__PURE__ */ e.jsx("span", { children: i && !a ? T("button.edit") : B })
211
+ ]
212
+ }
213
+ )
214
+ ] })
215
+ ]
216
+ }
217
+ )
218
+ ]
219
+ }
220
+ ),
221
+ P && /* @__PURE__ */ e.jsx(me, { ...P })
222
+ ] }),
223
+ q && /* @__PURE__ */ e.jsx(
224
+ pe,
225
+ {
226
+ imagePaths: s,
227
+ onDelete: I,
228
+ onClose: () => w(!1)
229
+ }
230
+ )
231
+ ] });
232
+ }
233
+ );
234
+ ue.displayName = "FileUpload";
235
+ export {
236
+ ue as default
237
+ };
@@ -0,0 +1,19 @@
1
+ import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import o from "../Modal/Modal.js";
3
+ import { s as i } from "../../FileUpload.module-BxCEtOHx.js";
4
+ import { u as a } from "../../useTranslation-CnCPcxVj.js";
5
+ const f = ({ onClose: t, src: r }) => {
6
+ const { t: s } = a();
7
+ return /* @__PURE__ */ e.jsx(
8
+ o,
9
+ {
10
+ onClose: t,
11
+ title: s("title.preview"),
12
+ className: i.imagePreviewModal,
13
+ children: /* @__PURE__ */ e.jsx("img", { src: r })
14
+ }
15
+ );
16
+ };
17
+ export {
18
+ f as default
19
+ };
@@ -0,0 +1,6 @@
1
+ import { j as s } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { s as e } from "../../FileUpload.module-BxCEtOHx.js";
3
+ const l = ({ count: t, onCardClick: a }) => /* @__PURE__ */ s.jsx("div", { "data-testid": "fileupload-lengthcard", className: e.lengthCard, onClick: a, children: /* @__PURE__ */ s.jsx("span", { children: `+ ${t}` }) });
4
+ export {
5
+ l as default
6
+ };
@@ -0,0 +1,53 @@
1
+ import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { useState as a } from "react";
3
+ import n from "../Icon/index.js";
4
+ import j from "../Modal/Modal.js";
5
+ import { Icons as m } from "../../assets/icons/icons.js";
6
+ import { s as r } from "../../FileUpload.module-BxCEtOHx.js";
7
+ import u from "./ImagePreview.js";
8
+ import { u as w } from "../../useTranslation-CnCPcxVj.js";
9
+ const O = ({ imagePaths: i, onClose: l, onDelete: c }) => {
10
+ const { t: d } = w(), [p, o] = a(!1), [t, v] = a(), x = (s) => {
11
+ v(s), o(!0);
12
+ };
13
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
14
+ /* @__PURE__ */ e.jsx(
15
+ j,
16
+ {
17
+ title: d("title.edit_images"),
18
+ className: r.previewModal,
19
+ onClose: l,
20
+ headerClass: r.header,
21
+ children: /* @__PURE__ */ e.jsx("div", { className: r.pictureContainer, children: i.map((s, f) => /* @__PURE__ */ e.jsxs("div", { className: r.previewContainer, children: [
22
+ /* @__PURE__ */ e.jsxs("div", { className: r.preview, children: [
23
+ /* @__PURE__ */ e.jsx(
24
+ n,
25
+ {
26
+ name: m.Preview,
27
+ onClick: () => x(s)
28
+ }
29
+ ),
30
+ /* @__PURE__ */ e.jsx(
31
+ n,
32
+ {
33
+ name: m.Trash,
34
+ onClick: () => c(i, s)
35
+ }
36
+ )
37
+ ] }),
38
+ /* @__PURE__ */ e.jsx("img", { src: s })
39
+ ] }, f)) })
40
+ }
41
+ ),
42
+ p && t && /* @__PURE__ */ e.jsx(
43
+ u,
44
+ {
45
+ src: t,
46
+ onClose: () => o(!1)
47
+ }
48
+ )
49
+ ] });
50
+ };
51
+ export {
52
+ O as default
53
+ };
@@ -0,0 +1,29 @@
1
+ import { j as n } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { c as $ } from "../../index-BHf7G3IG.js";
3
+ const p = ({
4
+ children: m,
5
+ auto: l = !1,
6
+ size: o,
7
+ sm: c,
8
+ md: s,
9
+ lg: a,
10
+ xl: t,
11
+ className: r
12
+ }) => {
13
+ const e = $(
14
+ {
15
+ col: !o && !l,
16
+ "col-auto": !o && l,
17
+ [`col-xl-${t}`]: t,
18
+ [`col-lg-${a}`]: a,
19
+ [`col-md-${s}`]: s,
20
+ [`col-sm-${c}`]: c,
21
+ [`col-${o}`]: o && !l
22
+ },
23
+ r
24
+ );
25
+ return /* @__PURE__ */ n.jsx("div", { "data-testid": "column", className: e, children: m });
26
+ };
27
+ export {
28
+ p as default
29
+ };
@@ -0,0 +1,6 @@
1
+ import { j as a } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { c as o } from "../../index-BHf7G3IG.js";
3
+ const m = ({ children: s, className: t }) => /* @__PURE__ */ a.jsx("div", { "data-testid": "row", className: o("row", t), children: s });
4
+ export {
5
+ m as default
6
+ };
@@ -0,0 +1,22 @@
1
+ import c from "react";
2
+ import { c as o } from "../../index-BHf7G3IG.js";
3
+ import '../../Heading.css';const m = "_h2_dcf3m_2", n = "_h1_dcf3m_2", r = {
4
+ h2: m,
5
+ h1: n
6
+ }, f = ({
7
+ children: s,
8
+ level: e = 2,
9
+ className: a
10
+ }) => {
11
+ const t = `h${e}`;
12
+ return c.createElement(
13
+ t,
14
+ {
15
+ className: o(r[t], a)
16
+ },
17
+ s
18
+ );
19
+ };
20
+ export {
21
+ f as default
22
+ };
@@ -0,0 +1,24 @@
1
+ import { j as l } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { c as r } from "../../index-BHf7G3IG.js";
3
+ const f = (s) => {
4
+ const { name: t, onClick: a, style: o, isDisabled: e, className: c } = s, i = (n) => {
5
+ if (e)
6
+ return n.preventDefault();
7
+ a && a(n);
8
+ };
9
+ return /* @__PURE__ */ l.jsx(
10
+ "i",
11
+ {
12
+ ...s,
13
+ style: o,
14
+ "data-testid": `icon-${t}`,
15
+ onClick: i,
16
+ className: r(`icon-${t}`, c, {
17
+ disabled: e
18
+ })
19
+ }
20
+ );
21
+ };
22
+ export {
23
+ f as default
24
+ };