lawgic-dev-kit 0.15.4 → 0.15.7

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.
@@ -1,4 +1,4 @@
1
- var e = { exports: {} };
1
+ var o = { exports: {} };
2
2
  export {
3
- e as __module
3
+ o as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var o = { exports: {} };
1
+ var e = { exports: {} };
2
2
  export {
3
- o as __module
3
+ e as __module
4
4
  };
@@ -1,23 +1,23 @@
1
1
  import { j as t } from "../../../_virtual/jsx-runtime.js";
2
- import { useState as D, useRef as L } from "react";
3
- import { translateBytes as P } from "../../../utils/files.js";
2
+ import { useState as h, useRef as P } from "react";
3
+ import { translateBytes as F } from "../../../utils/files.js";
4
4
  import "../../../_virtual/lodash.js";
5
5
  import "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
6
- import { useTheme as $ } from "../../../hooks/useTheme.js";
6
+ import { useTheme as L } from "../../../hooks/useTheme.js";
7
7
  import "react-hook-form";
8
8
  import "../../../constants/countries.js";
9
9
  import "../ImageProfileInput/ImageProfileInput.validators.js";
10
- import F from "../TextButton/TextButton.js";
10
+ import T from "../TextButton/TextButton.js";
11
11
  import "fuse.js";
12
- import T from "../LoadingProgress/LoadingProgress.js";
12
+ import I from "../LoadingProgress/LoadingProgress.js";
13
13
  import "../../molecules/InformationContainer/InformationContainer.js";
14
- const Q = ({
15
- title: y = "drag_and_drop_your_files_here",
14
+ const V = ({
15
+ title: j = "drag_and_drop_your_files_here",
16
16
  subtitle: p = null,
17
- buttonTitle: N = "choose_files",
18
- onUpload: E = () => {
17
+ buttonTitle: v = "choose_files",
18
+ onUpload: b = () => {
19
19
  },
20
- acceptedExtensions: n = [
20
+ acceptedExtensions: o = [
21
21
  "pdf",
22
22
  "png",
23
23
  "jpg",
@@ -28,82 +28,78 @@ const Q = ({
28
28
  "xls",
29
29
  "xlsx"
30
30
  ],
31
- maxSize: l = 1024,
31
+ maxSize: n = 1024,
32
32
  // en KB
33
- loading: C = !1,
34
- loadingDuration: k = 1e4
33
+ loading: y = !1,
34
+ loadingDuration: N = 1e4,
35
+ className: f = ""
35
36
  }) => {
36
- const { t: a } = $(), [m, o] = D(!1), [u, i] = D(""), c = L(null), w = n.map((e) => `.${e}`).join(","), f = (e) => {
37
+ const { t: l } = L(), [u, a] = h(!1), [m, i] = h(""), c = P(null), D = o.map((e) => `.${e}`).join(","), x = (e) => {
37
38
  const r = [];
38
39
  let d = !1;
39
40
  Array.from(e).forEach((s) => {
40
- var b;
41
- const B = ((b = s.name.split(".").pop()) == null ? void 0 : b.toLowerCase()) || "";
42
- if (!n.includes(B)) {
41
+ var g;
42
+ const B = ((g = s.name.split(".").pop()) == null ? void 0 : g.toLowerCase()) || "";
43
+ if (!o.includes(B)) {
43
44
  i(
44
45
  `El archivo ${s.name} tiene una extensión no permitida.`
45
46
  ), d = !0;
46
47
  return;
47
48
  }
48
- if (s.size > l * 1024) {
49
+ if (s.size > n * 1024) {
49
50
  i(
50
- `El archivo ${s.name} excede el tamaño máximo de ${l}KB.`
51
+ `El archivo ${s.name} excede el tamaño máximo de ${n}KB.`
51
52
  ), d = !0;
52
53
  return;
53
54
  }
54
55
  r.push(s);
55
- }), !d && r.length > 0 && (i(""), E(r));
56
- }, x = () => {
56
+ }), !d && r.length > 0 && (i(""), b(r));
57
+ }, w = () => {
57
58
  c.current && c.current.click();
58
- }, _ = (e) => {
59
+ }, E = (e) => {
59
60
  const r = e.target.files;
60
- r && r.length > 0 && f(r), e.target.value = "";
61
- }, g = (e) => {
62
- e.preventDefault(), e.stopPropagation(), o(!0);
63
- }, h = (e) => {
64
- e.preventDefault(), e.stopPropagation(), o(!1);
65
- }, v = (e) => {
66
- e.preventDefault(), e.stopPropagation(), m || o(!0);
67
- }, j = (e) => {
68
- e.preventDefault(), e.stopPropagation(), o(!1);
61
+ r && r.length > 0 && x(r), e.target.value = "";
62
+ }, C = (e) => {
63
+ e.preventDefault(), e.stopPropagation(), a(!0);
64
+ }, $ = (e) => {
65
+ e.preventDefault(), e.stopPropagation(), a(!1);
66
+ }, _ = (e) => {
67
+ e.preventDefault(), e.stopPropagation(), u || a(!0);
68
+ }, k = (e) => {
69
+ e.preventDefault(), e.stopPropagation(), a(!1);
69
70
  const r = e.dataTransfer.files;
70
- r.length > 0 && f(r);
71
+ r.length > 0 && x(r);
71
72
  };
72
- return C ? /* @__PURE__ */ t.jsx("div", { className: "w-full mx-auto font-sans", children: /* @__PURE__ */ t.jsx("div", { className: "bg-blue-50 p-16 rounded-2xl", children: /* @__PURE__ */ t.jsxs(
73
+ return y ? /* @__PURE__ */ t.jsx("div", { className: `w-full mx-auto font-sans h-full ${f} flex flex-col grow`, children: /* @__PURE__ */ t.jsx("div", { className: "bg-blue-50 p-16 rounded-2xl h-full flex flex-col grow", children: /* @__PURE__ */ t.jsxs(
73
74
  "div",
74
75
  {
75
- className: "flex items-center justify-center gap-16 border-[1.4px] border-dashed rounded-2xl pt-28 p-32 text-center transition-all duration-300 border-blue-100 select-none",
76
- onDragEnter: g,
77
- onDragLeave: h,
78
- onDragOver: v,
79
- onDrop: j,
80
- onClick: x,
76
+ className: "h-full grow flex items-center justify-center gap-16 border-[1.4px] border-dashed rounded-2xl pt-28 p-32 text-center transition-all duration-300 border-blue-100 select-none",
81
77
  children: [
82
78
  /* @__PURE__ */ t.jsx(
83
- T,
79
+ I,
84
80
  {
85
81
  size: 75,
86
- duration: k,
82
+ duration: N,
87
83
  strokeWidth: 6,
88
84
  color: "#4570EB"
89
85
  }
90
86
  ),
91
87
  /* @__PURE__ */ t.jsxs("h4", { className: "text-body-s text-gray-400", children: [
92
- a("loading"),
88
+ l("loading"),
93
89
  "..."
94
90
  ] })
95
91
  ]
96
92
  }
97
- ) }) }) : /* @__PURE__ */ t.jsxs("div", { className: "w-full mx-auto font-sans", children: [
93
+ ) }) }) : /* @__PURE__ */ t.jsxs("div", { className: `w-full mx-auto font-sans h-full ${f}`, children: [
98
94
  /* @__PURE__ */ t.jsx("div", { className: "bg-blue-50 p-16 rounded-2xl", children: /* @__PURE__ */ t.jsxs(
99
95
  "div",
100
96
  {
101
- className: `flex flex-col border-[1.4px] border-dashed rounded-2xl pt-28 p-32 text-center cursor-pointer transition-all duration-300 ${m ? "border-blue-400 bg-blue-100/50" : "border-blue-100 hover:border-blue-400"}`,
102
- onDragEnter: g,
103
- onDragLeave: h,
104
- onDragOver: v,
105
- onDrop: j,
106
- onClick: x,
97
+ className: `flex flex-col border-[1.4px] border-dashed rounded-2xl pt-28 p-32 text-center cursor-pointer transition-all duration-300 ${u ? "border-blue-400 bg-blue-100/50" : "border-blue-100 hover:border-blue-400"}`,
98
+ onDragEnter: C,
99
+ onDragLeave: $,
100
+ onDragOver: _,
101
+ onDrop: k,
102
+ onClick: w,
107
103
  children: [
108
104
  /* @__PURE__ */ t.jsx("div", { className: "flex justify-center translate-y-4", children: /* @__PURE__ */ t.jsx(
109
105
  "img",
@@ -114,9 +110,9 @@ const Q = ({
114
110
  }
115
111
  ) }),
116
112
  /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center", children: [
117
- /* @__PURE__ */ t.jsx("h3", { className: "font-600 text-xl text-dark", children: a(y) }),
118
- p && /* @__PURE__ */ t.jsx("p", { className: "font-400 text-lg text-gray-500", children: a(p) }),
119
- /* @__PURE__ */ t.jsx(F, { color: "blue", children: a(N) }),
113
+ /* @__PURE__ */ t.jsx("h3", { className: "font-600 text-xl text-dark", children: l(j) }),
114
+ p && /* @__PURE__ */ t.jsx("p", { className: "font-400 text-lg text-gray-500", children: l(p) }),
115
+ /* @__PURE__ */ t.jsx(T, { color: "blue", children: l(v) }),
120
116
  /* @__PURE__ */ t.jsx(
121
117
  "input",
122
118
  {
@@ -124,23 +120,23 @@ const Q = ({
124
120
  ref: c,
125
121
  className: "hidden",
126
122
  multiple: !0,
127
- accept: w,
128
- onChange: _
123
+ accept: D,
124
+ onChange: E
129
125
  }
130
126
  )
131
127
  ] })
132
128
  ]
133
129
  }
134
130
  ) }),
135
- u && /* @__PURE__ */ t.jsx("div", { className: "mt-3 text-sm text-red-500", children: u }),
131
+ m && /* @__PURE__ */ t.jsx("div", { className: "mt-3 text-sm text-red-500", children: m }),
136
132
  /* @__PURE__ */ t.jsx("div", { className: "mt-10 w-full flex justify-center", children: /* @__PURE__ */ t.jsxs("span", { className: "text-gray-500 font-400 text-base", children: [
137
- n.join(", ").toUpperCase(),
133
+ o.join(", ").toUpperCase(),
138
134
  " formats. Maximus size:",
139
135
  " ",
140
- P(l, "mb")
136
+ F(n, "mb")
141
137
  ] }) })
142
138
  ] });
143
139
  };
144
140
  export {
145
- Q as default
141
+ V as default
146
142
  };
@@ -31,4 +31,5 @@ export interface UploadContainerProps {
31
31
  maxSize?: number;
32
32
  loading?: boolean;
33
33
  loadingDuration?: number;
34
+ className?: string;
34
35
  }