lawgic-dev-kit 0.14.6 → 0.14.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,5 +1,4 @@
1
- import { __require as r } from "../node_modules/property-expr/index.js";
2
- var e = r();
1
+ var p = { exports: {} };
3
2
  export {
4
- e as p
3
+ p as __module
5
4
  };
@@ -1,5 +1,5 @@
1
- import { __require as r } from "../node_modules/tiny-case/index.js";
2
- var a = r();
1
+ import { __require as r } from "../node_modules/property-expr/index.js";
2
+ var e = r();
3
3
  export {
4
- a as t
4
+ e as p
5
5
  };
@@ -1,7 +1,5 @@
1
- import { getDefaultExportFromCjs as o } from "./_commonjsHelpers.js";
2
- import { __require as r } from "../node_modules/toposort/index.js";
3
- var t = r();
4
- const s = /* @__PURE__ */ o(t);
1
+ import { __require as r } from "../node_modules/tiny-case/index.js";
2
+ var a = r();
5
3
  export {
6
- s as default
4
+ a as t
7
5
  };
@@ -1,4 +1,7 @@
1
- var p = { exports: {} };
1
+ import { getDefaultExportFromCjs as o } from "./_commonjsHelpers.js";
2
+ import { __require as r } from "../node_modules/toposort/index.js";
3
+ var t = r();
4
+ const s = /* @__PURE__ */ o(t);
2
5
  export {
3
- p as __module
6
+ s as default
4
7
  };
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ export interface LoadingProgressProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ size?: number;
4
+ strokeWidth?: number;
5
+ color?: string;
6
+ duration?: number;
7
+ label?: string;
8
+ initialProgress?: number;
9
+ automaticProgress?: boolean;
10
+ }
11
+ declare const LoadingProgress: React.FC<LoadingProgressProps>;
12
+ export default LoadingProgress;
@@ -0,0 +1,71 @@
1
+ import { j as s } from "../../../_virtual/jsx-runtime.js";
2
+ import { useState as E, useEffect as P } from "react";
3
+ const k = ({
4
+ size: e = 100,
5
+ strokeWidth: r = 4,
6
+ color: c = "#1DA696",
7
+ duration: o = 3e3,
8
+ label: i = "",
9
+ initialProgress: h = 0,
10
+ automaticProgress: l = !0,
11
+ ...j
12
+ }) => {
13
+ const [m, g] = E(h), a = (e - r) / 2, f = 2 * Math.PI * a, p = f * (1 - m / 100), { className: y = "", ...N } = j;
14
+ return P(() => {
15
+ if (!l) return;
16
+ let n, t;
17
+ const x = (d) => {
18
+ n || (n = d);
19
+ const v = d - n, u = Math.min(100, v / o * 100);
20
+ g(u), u < 100 && (t = requestAnimationFrame(x));
21
+ };
22
+ return t = requestAnimationFrame(x), () => {
23
+ t && cancelAnimationFrame(t);
24
+ };
25
+ }, [o, l]), /* @__PURE__ */ s.jsxs("div", { ...N, className: `relative flex items-center justify-center ${y}`, children: [
26
+ /* @__PURE__ */ s.jsxs("svg", { height: e, width: e, className: "transform -rotate-90", children: [
27
+ /* @__PURE__ */ s.jsx(
28
+ "circle",
29
+ {
30
+ stroke: "#E5E7EB",
31
+ fill: "transparent",
32
+ strokeWidth: r,
33
+ r: a,
34
+ cx: e / 2,
35
+ cy: e / 2
36
+ }
37
+ ),
38
+ /* @__PURE__ */ s.jsx(
39
+ "circle",
40
+ {
41
+ stroke: c,
42
+ fill: "transparent",
43
+ strokeWidth: r,
44
+ strokeDasharray: f,
45
+ strokeDashoffset: p,
46
+ strokeLinecap: "round",
47
+ r: a,
48
+ cx: e / 2,
49
+ cy: e / 2
50
+ }
51
+ )
52
+ ] }),
53
+ /* @__PURE__ */ s.jsxs("div", { className: "absolute flex flex-col items-center justify-center", children: [
54
+ i && /* @__PURE__ */ s.jsx("div", { className: "text-xs font-medium text-gray-500", children: i }),
55
+ /* @__PURE__ */ s.jsxs(
56
+ "div",
57
+ {
58
+ className: "text-lg font-semibold",
59
+ style: { color: c },
60
+ children: [
61
+ Math.round(m),
62
+ "%"
63
+ ]
64
+ }
65
+ )
66
+ ] })
67
+ ] });
68
+ };
69
+ export {
70
+ k as default
71
+ };
@@ -0,0 +1 @@
1
+ export { default as LoadingProgress } from './LoadingProgress';
@@ -1,21 +1,22 @@
1
1
  import { j as t } from "../../../_virtual/jsx-runtime.js";
2
- import { useState as g, useRef as $ } from "react";
3
- import k from "../TextButton/TextButton.js";
4
- import { useTheme as B } from "../../../hooks/useTheme.js";
5
- import { translateBytes as F } from "../../../utils/files.js";
2
+ import { useState as D, useRef as L } from "react";
3
+ import { translateBytes as P } from "../../../utils/files.js";
6
4
  import "../../../_virtual/lodash.js";
7
5
  import "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
6
+ import { useTheme as $ } from "../../../hooks/useTheme.js";
8
7
  import "react-hook-form";
9
8
  import "../../../constants/countries.js";
10
9
  import "../ImageProfileInput/ImageProfileInput.validators.js";
10
+ import F from "../TextButton/TextButton.js";
11
+ import T from "../LoadingProgress/LoadingProgress.js";
11
12
  import "../../molecules/InformationContainer/InformationContainer.js";
12
- const z = ({
13
- title: h = "drag_and_drop_your_files_here",
14
- subtitle: d = null,
15
- buttonTitle: v = "choose_files",
16
- onUpload: j = () => {
13
+ const J = ({
14
+ title: y = "drag_and_drop_your_files_here",
15
+ subtitle: p = null,
16
+ buttonTitle: N = "choose_files",
17
+ onUpload: E = () => {
17
18
  },
18
- acceptedExtensions: o = [
19
+ acceptedExtensions: n = [
19
20
  "pdf",
20
21
  "png",
21
22
  "jpg",
@@ -26,55 +27,82 @@ const z = ({
26
27
  "xls",
27
28
  "xlsx"
28
29
  ],
29
- maxSize: n = 1024
30
+ maxSize: l = 1024,
30
31
  // en KB
32
+ loading: C = !1,
33
+ loadingDuration: k = 1e4
31
34
  }) => {
32
- const { t: l } = B(), [m, a] = g(!1), [f, i] = g(""), c = $(null), y = o.map((e) => `.${e}`).join(","), u = (e) => {
35
+ const { t: a } = $(), [m, o] = D(!1), [u, i] = D(""), c = L(null), w = n.map((e) => `.${e}`).join(","), f = (e) => {
33
36
  const r = [];
34
- let p = !1;
37
+ let d = !1;
35
38
  Array.from(e).forEach((s) => {
36
- var x;
37
- const _ = ((x = s.name.split(".").pop()) == null ? void 0 : x.toLowerCase()) || "";
38
- if (!o.includes(_)) {
39
+ var b;
40
+ const B = ((b = s.name.split(".").pop()) == null ? void 0 : b.toLowerCase()) || "";
41
+ if (!n.includes(B)) {
39
42
  i(
40
43
  `El archivo ${s.name} tiene una extensión no permitida.`
41
- ), p = !0;
44
+ ), d = !0;
42
45
  return;
43
46
  }
44
- if (s.size > n * 1024) {
47
+ if (s.size > l * 1024) {
45
48
  i(
46
- `El archivo ${s.name} excede el tamaño máximo de ${n}KB.`
47
- ), p = !0;
49
+ `El archivo ${s.name} excede el tamaño máximo de ${l}KB.`
50
+ ), d = !0;
48
51
  return;
49
52
  }
50
53
  r.push(s);
51
- }), !p && r.length > 0 && (i(""), j(r));
52
- }, D = () => {
54
+ }), !d && r.length > 0 && (i(""), E(r));
55
+ }, x = () => {
53
56
  c.current && c.current.click();
54
- }, b = (e) => {
57
+ }, _ = (e) => {
55
58
  const r = e.target.files;
56
- r && r.length > 0 && u(r), e.target.value = "";
57
- }, N = (e) => {
58
- e.preventDefault(), e.stopPropagation(), a(!0);
59
- }, C = (e) => {
60
- e.preventDefault(), e.stopPropagation(), a(!1);
61
- }, E = (e) => {
62
- e.preventDefault(), e.stopPropagation(), m || a(!0);
63
- }, w = (e) => {
64
- e.preventDefault(), e.stopPropagation(), a(!1);
59
+ r && r.length > 0 && f(r), e.target.value = "";
60
+ }, g = (e) => {
61
+ e.preventDefault(), e.stopPropagation(), o(!0);
62
+ }, h = (e) => {
63
+ e.preventDefault(), e.stopPropagation(), o(!1);
64
+ }, v = (e) => {
65
+ e.preventDefault(), e.stopPropagation(), m || o(!0);
66
+ }, j = (e) => {
67
+ e.preventDefault(), e.stopPropagation(), o(!1);
65
68
  const r = e.dataTransfer.files;
66
- r.length > 0 && u(r);
69
+ r.length > 0 && f(r);
67
70
  };
68
- return /* @__PURE__ */ t.jsxs("div", { className: "w-full mx-auto font-sans", children: [
69
- /* @__PURE__ */ t.jsxs(
71
+ 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(
72
+ "div",
73
+ {
74
+ 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",
75
+ onDragEnter: g,
76
+ onDragLeave: h,
77
+ onDragOver: v,
78
+ onDrop: j,
79
+ onClick: x,
80
+ children: [
81
+ /* @__PURE__ */ t.jsx(
82
+ T,
83
+ {
84
+ size: 75,
85
+ duration: k,
86
+ strokeWidth: 6,
87
+ color: "#4570EB"
88
+ }
89
+ ),
90
+ /* @__PURE__ */ t.jsxs("h4", { className: "text-body-s text-gray-400", children: [
91
+ a("loading"),
92
+ "..."
93
+ ] })
94
+ ]
95
+ }
96
+ ) }) }) : /* @__PURE__ */ t.jsxs("div", { className: "w-full mx-auto font-sans", children: [
97
+ /* @__PURE__ */ t.jsx("div", { className: "bg-blue-50 p-16 rounded-2xl", children: /* @__PURE__ */ t.jsxs(
70
98
  "div",
71
99
  {
72
- 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-gray-200 bg-white hover:border-blue-400"}`,
73
- onDragEnter: N,
74
- onDragLeave: C,
75
- onDragOver: E,
76
- onDrop: w,
77
- onClick: D,
100
+ 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"}`,
101
+ onDragEnter: g,
102
+ onDragLeave: h,
103
+ onDragOver: v,
104
+ onDrop: j,
105
+ onClick: x,
78
106
  children: [
79
107
  /* @__PURE__ */ t.jsx("div", { className: "flex justify-center translate-y-4", children: /* @__PURE__ */ t.jsx(
80
108
  "img",
@@ -85,9 +113,9 @@ const z = ({
85
113
  }
86
114
  ) }),
87
115
  /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center", children: [
88
- /* @__PURE__ */ t.jsx("h3", { className: "font-600 text-xl text-dark", children: l(h) }),
89
- d && /* @__PURE__ */ t.jsx("p", { className: "font-400 text-lg text-gray-500", children: l(d) }),
90
- /* @__PURE__ */ t.jsx(k, { color: "blue", children: l(v) }),
116
+ /* @__PURE__ */ t.jsx("h3", { className: "font-600 text-xl text-dark", children: a(y) }),
117
+ p && /* @__PURE__ */ t.jsx("p", { className: "font-400 text-lg text-gray-500", children: a(p) }),
118
+ /* @__PURE__ */ t.jsx(F, { color: "blue", children: a(N) }),
91
119
  /* @__PURE__ */ t.jsx(
92
120
  "input",
93
121
  {
@@ -95,23 +123,23 @@ const z = ({
95
123
  ref: c,
96
124
  className: "hidden",
97
125
  multiple: !0,
98
- accept: y,
99
- onChange: b
126
+ accept: w,
127
+ onChange: _
100
128
  }
101
129
  )
102
130
  ] })
103
131
  ]
104
132
  }
105
- ),
106
- f && /* @__PURE__ */ t.jsx("div", { className: "mt-3 text-sm text-red-500", children: f }),
133
+ ) }),
134
+ u && /* @__PURE__ */ t.jsx("div", { className: "mt-3 text-sm text-red-500", children: u }),
107
135
  /* @__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: [
108
- o.join(", ").toUpperCase(),
136
+ n.join(", ").toUpperCase(),
109
137
  " formats. Maximus size:",
110
138
  " ",
111
- F(n, "mb")
139
+ P(l, "mb")
112
140
  ] }) })
113
141
  ] });
114
142
  };
115
143
  export {
116
- z as default
144
+ J as default
117
145
  };
@@ -29,4 +29,6 @@ export interface UploadContainerProps {
29
29
  * @default 1024
30
30
  */
31
31
  maxSize?: number;
32
+ loading?: boolean;
33
+ loadingDuration: number;
32
34
  }
@@ -32,3 +32,4 @@ export * from './UncontrolledSelector/index';
32
32
  export * from './UncontrolledTextInput/index';
33
33
  export * from './UploadContainer/index';
34
34
  export * from './Tooltip/index';
35
+ export * from './LoadingProgress/index';
package/dist/index.js CHANGED
@@ -7,12 +7,12 @@ import { default as x } from "./components/atoms/Button/Button.js";
7
7
  import { default as i } from "./components/atoms/CenterModal/CenterModal.js";
8
8
  import { default as I } from "./components/atoms/Checkbox/Checkbox.js";
9
9
  import { default as C } from "./components/atoms/CountryInput/CountryInput.js";
10
- import { default as g } from "./components/atoms/CountryLabel/CountryLabel.js";
10
+ import { default as S } from "./components/atoms/CountryLabel/CountryLabel.js";
11
11
  import { default as h } from "./components/atoms/CountrySelectInput/CountryDropdown.js";
12
12
  import { default as D } from "./components/atoms/Divider/Divider.js";
13
- import { default as b } from "./components/atoms/IconButton/IconButton.js";
14
- import { default as U } from "./components/atoms/ImageProfileInput/ImageProfileInput.js";
15
- import { default as A } from "./components/atoms/ImageProfileInput/ImageProfileInput.validators.js";
13
+ import { default as P } from "./components/atoms/IconButton/IconButton.js";
14
+ import { default as L } from "./components/atoms/ImageProfileInput/ImageProfileInput.js";
15
+ import { default as w } from "./components/atoms/ImageProfileInput/ImageProfileInput.validators.js";
16
16
  import { default as v } from "./components/atoms/IndexedStep/IndexedStep.js";
17
17
  import { default as z } from "./components/atoms/InfoCard/InfoCard.js";
18
18
  import { default as O } from "./components/atoms/InformationDisclaimer/InformationDisclaimer.js";
@@ -33,95 +33,97 @@ import { default as uo } from "./components/atoms/UncontrolledSelector/Uncontrol
33
33
  import { default as no } from "./components/atoms/UncontrolledTextInput/UncontrolledTextInput.js";
34
34
  import { default as co } from "./components/atoms/UploadContainer/UploadContainer.js";
35
35
  import { default as To } from "./components/atoms/Tooltip/Tooltip.js";
36
- import { default as So } from "./components/molecules/AlertModal/AlertModal.js";
37
- import { default as Bo } from "./components/molecules/CalendarSelector/CalendarSelector.js";
38
- import { default as Mo } from "./components/molecules/DateInput/DateInput.js";
39
- import { default as yo } from "./components/molecules/DialogModal/DialogModal.js";
40
- import { default as Po } from "./components/molecules/Dropdown/Dropdown.js";
41
- import { default as wo } from "./components/molecules/FileUpload/FileUpload.js";
42
- import { default as Lo } from "./components/molecules/FloatingMenu/FloatingMenu.js";
43
- import { default as Fo } from "./components/molecules/IndexedStepper/IndexedStepper.js";
44
- import { default as ko } from "./components/molecules/InformationContainer/InformationContainer.js";
45
- import { default as Vo } from "./components/molecules/SearchModal/SearchModal.js";
46
- import { default as qo } from "./components/molecules/Stepper/Stepper.js";
47
- import { default as Go } from "./components/molecules/Tabs/Tabs.js";
48
- import { default as Jo } from "./components/molecules/UncontrolledDateInput/UncontrolledDateInput.js";
49
- import { Organism as No } from "./components/organisms/index.js";
50
- import { formatLocalizedDate as Ro } from "./utils/dates.js";
51
- import { toBase64 as Xo, translateBytes as Yo } from "./utils/files.js";
52
- import { getImageUrl as _o } from "./utils/images.js";
53
- import { ModalContainer as ot, closeModal as tt, openCustomModal as et, openModal as rt } from "./utils/modal.js";
54
- import { renderTabContent as ft } from "./utils/renderContentOptions.js";
55
- import { capitalizeFirstLetter as lt, stringToColor as dt } from "./utils/strings.js";
56
- import { showToastAsync as st, showToastLoading as ut, toast as xt } from "./utils/toast.js";
57
- import { ThemeProvider as it } from "./providers/ThemeProvider.js";
58
- import { useTheme as It } from "./hooks/useTheme.js";
36
+ import { default as go } from "./components/atoms/LoadingProgress/LoadingProgress.js";
37
+ import { default as Bo } from "./components/molecules/AlertModal/AlertModal.js";
38
+ import { default as Mo } from "./components/molecules/CalendarSelector/CalendarSelector.js";
39
+ import { default as yo } from "./components/molecules/DateInput/DateInput.js";
40
+ import { default as bo } from "./components/molecules/DialogModal/DialogModal.js";
41
+ import { default as Uo } from "./components/molecules/Dropdown/Dropdown.js";
42
+ import { default as Ao } from "./components/molecules/FileUpload/FileUpload.js";
43
+ import { default as Fo } from "./components/molecules/FloatingMenu/FloatingMenu.js";
44
+ import { default as ko } from "./components/molecules/IndexedStepper/IndexedStepper.js";
45
+ import { default as Vo } from "./components/molecules/InformationContainer/InformationContainer.js";
46
+ import { default as qo } from "./components/molecules/SearchModal/SearchModal.js";
47
+ import { default as Go } from "./components/molecules/Stepper/Stepper.js";
48
+ import { default as Jo } from "./components/molecules/Tabs/Tabs.js";
49
+ import { default as No } from "./components/molecules/UncontrolledDateInput/UncontrolledDateInput.js";
50
+ import { Organism as Ro } from "./components/organisms/index.js";
51
+ import { formatLocalizedDate as Xo } from "./utils/dates.js";
52
+ import { toBase64 as Zo, translateBytes as _o } from "./utils/files.js";
53
+ import { getImageUrl as ot } from "./utils/images.js";
54
+ import { ModalContainer as et, closeModal as rt, openCustomModal as at, openModal as ft } from "./utils/modal.js";
55
+ import { renderTabContent as lt } from "./utils/renderContentOptions.js";
56
+ import { capitalizeFirstLetter as mt, stringToColor as st } from "./utils/strings.js";
57
+ import { showToastAsync as xt, showToastLoading as nt, toast as it } from "./utils/toast.js";
58
+ import { ThemeProvider as It } from "./providers/ThemeProvider.js";
59
+ import { useTheme as Ct } from "./hooks/useTheme.js";
59
60
  import "./contexts/themeContext.js";
60
- import { defaultTheme as Ct } from "./themes/default.js";
61
+ import { defaultTheme as St } from "./themes/default.js";
61
62
  export {
62
63
  a as ActionButton,
63
- So as AlertModal,
64
+ Bo as AlertModal,
64
65
  p as AsyncToast,
65
66
  d as Avatar,
66
67
  s as BoxContainer,
67
68
  x as Button,
68
- Bo as CalendarSelector,
69
+ Mo as CalendarSelector,
69
70
  i as CenterModal,
70
71
  I as Checkbox,
71
72
  h as CountryDropdown,
72
73
  C as CountryInput,
73
- g as CountryLabel,
74
- Mo as DateInput,
75
- yo as DialogModal,
74
+ S as CountryLabel,
75
+ yo as DateInput,
76
+ bo as DialogModal,
76
77
  D as Divider,
77
- Po as Dropdown,
78
- wo as FileUpload,
79
- Lo as FloatingMenu,
80
- b as IconButton,
81
- U as ImageProfileInput,
78
+ Uo as Dropdown,
79
+ Ao as FileUpload,
80
+ Fo as FloatingMenu,
81
+ P as IconButton,
82
+ L as ImageProfileInput,
82
83
  v as IndexedStep,
83
- Fo as IndexedStepper,
84
+ ko as IndexedStepper,
84
85
  z as InfoCard,
85
- ko as InformationContainer,
86
+ Vo as InformationContainer,
86
87
  O as InformationDisclaimer,
88
+ go as LoadingProgress,
87
89
  j as LoadingSpinner,
88
- ot as ModalContainer,
89
- No as Organism,
90
+ et as ModalContainer,
91
+ Ro as Organism,
90
92
  E as PasswordInput,
91
93
  H as PhoneInput,
92
94
  K as ProgressBar,
93
95
  Q as SearchBar,
94
- Vo as SearchModal,
96
+ qo as SearchModal,
95
97
  W as SectionButton,
96
98
  Y as SelectInput,
97
99
  _ as SidebarButton,
98
- qo as Stepper,
100
+ Go as Stepper,
99
101
  oo as Tab,
100
- Go as Tabs,
102
+ Jo as Tabs,
101
103
  eo as TextButton,
102
104
  ao as TextInput,
103
105
  po as TextStaticInput,
104
- it as ThemeProvider,
106
+ It as ThemeProvider,
105
107
  mo as Toast,
106
108
  To as Tooltip,
107
- Jo as UncontrolledDateInput,
109
+ No as UncontrolledDateInput,
108
110
  uo as UncontrolledSelector,
109
111
  no as UncontrolledTextInput,
110
112
  co as UploadContainer,
111
- lt as capitalizeFirstLetter,
112
- tt as closeModal,
113
- Ct as defaultTheme,
114
- Ro as formatLocalizedDate,
115
- _o as getImageUrl,
116
- et as openCustomModal,
117
- rt as openModal,
118
- ft as renderTabContent,
119
- st as showToastAsync,
120
- ut as showToastLoading,
121
- dt as stringToColor,
122
- Xo as toBase64,
123
- xt as toast,
124
- Yo as translateBytes,
125
- It as useTheme,
126
- A as yupImageProfileValidator
113
+ mt as capitalizeFirstLetter,
114
+ rt as closeModal,
115
+ St as defaultTheme,
116
+ Xo as formatLocalizedDate,
117
+ ot as getImageUrl,
118
+ at as openCustomModal,
119
+ ft as openModal,
120
+ lt as renderTabContent,
121
+ xt as showToastAsync,
122
+ nt as showToastLoading,
123
+ st as stringToColor,
124
+ Zo as toBase64,
125
+ it as toast,
126
+ _o as translateBytes,
127
+ Ct as useTheme,
128
+ w as yupImageProfileValidator
127
129
  };