lawgic-dev-kit 0.16.7 → 0.16.8

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,115 @@
1
+ import { j as e } from "../../../_virtual/jsx-runtime.js";
2
+ const F = ({
3
+ progress: p,
4
+ showPercentage: f = !0,
5
+ showLabel: m = !1,
6
+ percentageLabel: u = "progreso",
7
+ className: y = "",
8
+ size: s = 120,
9
+ strokeWidth: l = 8,
10
+ backgroundColor: N = "#e5e7eb",
11
+ animated: g = !0,
12
+ animationDuration: v = "1.5s",
13
+ colorThresholds: n,
14
+ lowThreshold: b = 30,
15
+ mediumThreshold: $ = 70,
16
+ lowColor: k = "#ef4444",
17
+ mediumColor: D = "#eab308",
18
+ highColor: M = "#22c55e",
19
+ singleColor: j,
20
+ clockwise: P = !0,
21
+ startAngle: C = -90
22
+ }) => {
23
+ const w = (c) => {
24
+ if (j)
25
+ return j;
26
+ if (n && n.length > 0) {
27
+ const r = [...n].sort(
28
+ (t, h) => t.threshold - h.threshold
29
+ );
30
+ for (let t = r.length - 1; t >= 0; t--)
31
+ if (c >= r[t].threshold)
32
+ return r[t].color;
33
+ return r[0].color;
34
+ }
35
+ return c < b ? k : c < $ ? D : M;
36
+ }, B = (c) => {
37
+ if (!n || n.length === 0) return;
38
+ const r = [...n].sort(
39
+ (t, h) => t.threshold - h.threshold
40
+ );
41
+ for (let t = r.length - 1; t >= 0; t--)
42
+ if (c >= r[t].threshold)
43
+ return r[t].label;
44
+ return r[0].label;
45
+ }, o = Math.min(100, Math.max(0, p)), E = w(o), i = B(o), a = s / 2, x = (s - l) / 2, d = 2 * Math.PI * x, I = d, L = d - o / 100 * d, R = `rotate(${C} ${a} ${a}) scale(${P ? 1 : -1}, 1)`;
46
+ return /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col items-center gap-2 ${y}`, children: [
47
+ /* @__PURE__ */ e.jsxs("div", { className: "relative", style: { width: s, height: s }, children: [
48
+ /* @__PURE__ */ e.jsxs(
49
+ "svg",
50
+ {
51
+ width: s,
52
+ height: s,
53
+ className: "transform -rotate-90",
54
+ viewBox: `0 0 ${s} ${s}`,
55
+ children: [
56
+ /* @__PURE__ */ e.jsx(
57
+ "circle",
58
+ {
59
+ cx: a,
60
+ cy: a,
61
+ r: x,
62
+ fill: "transparent",
63
+ stroke: N,
64
+ strokeWidth: l,
65
+ className: "opacity-20"
66
+ }
67
+ ),
68
+ /* @__PURE__ */ e.jsx(
69
+ "circle",
70
+ {
71
+ cx: a,
72
+ cy: a,
73
+ r: x,
74
+ fill: "transparent",
75
+ stroke: E,
76
+ strokeWidth: l,
77
+ strokeDasharray: I,
78
+ strokeDashoffset: L,
79
+ strokeLinecap: "round",
80
+ transform: R,
81
+ className: g ? "transition-all ease-out" : "",
82
+ style: g ? {
83
+ transitionDuration: v,
84
+ transitionProperty: "stroke-dashoffset, stroke"
85
+ } : {}
86
+ }
87
+ )
88
+ ]
89
+ }
90
+ ),
91
+ f && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
92
+ /* @__PURE__ */ e.jsxs("div", { className: "text-2xl font-bold text-gray-800", children: [
93
+ Math.round(o),
94
+ "%"
95
+ ] }),
96
+ m && /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-500 mt-1", children: i || u })
97
+ ] }) })
98
+ ] }),
99
+ m && !f && /* @__PURE__ */ e.jsxs("div", { className: "text-sm text-gray-600 text-center", children: [
100
+ /* @__PURE__ */ e.jsxs("span", { className: "font-medium", children: [
101
+ Math.round(o),
102
+ "%"
103
+ ] }),
104
+ i && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-gray-500 block", children: [
105
+ "(",
106
+ i,
107
+ ")"
108
+ ] }),
109
+ /* @__PURE__ */ e.jsx("span", { className: "text-gray-500", children: u })
110
+ ] })
111
+ ] });
112
+ };
113
+ export {
114
+ F as default
115
+ };
@@ -0,0 +1,72 @@
1
+ import { j as r } from "../../../_virtual/jsx-runtime.js";
2
+ const P = ({
3
+ progress: d,
4
+ showPercentage: h = !1,
5
+ percentageLabel: c = "",
6
+ className: u = "",
7
+ height: f = "h-5",
8
+ backgroundColor: x = "bg-gray-200",
9
+ animated: g = !0,
10
+ animationDuration: m = "duration-300",
11
+ colorThresholds: s,
12
+ lowThreshold: p = 30,
13
+ mediumThreshold: b = 70,
14
+ lowColor: j = "bg-red-500",
15
+ mediumColor: N = "bg-yellow-500",
16
+ highColor: $ = "bg-green-500",
17
+ singleColor: o
18
+ }) => {
19
+ const y = (n) => {
20
+ if (o)
21
+ return o;
22
+ if (s && s.length > 0) {
23
+ const t = [...s].sort(
24
+ (e, a) => e.threshold - a.threshold
25
+ );
26
+ for (let e = t.length - 1; e >= 0; e--)
27
+ if (n >= t[e].threshold)
28
+ return t[e].color;
29
+ return t[0].color;
30
+ }
31
+ return n < p ? j : n < b ? N : $;
32
+ }, w = (n) => {
33
+ if (!s || s.length === 0) return;
34
+ const t = [...s].sort(
35
+ (e, a) => e.threshold - a.threshold
36
+ );
37
+ for (let e = t.length - 1; e >= 0; e--)
38
+ if (n >= t[e].threshold)
39
+ return t[e].label;
40
+ return t[0].label;
41
+ }, l = Math.min(100, Math.max(0, d)), v = y(l), i = w(l), C = g ? `transition-all ${m} ease-in-out` : "";
42
+ return /* @__PURE__ */ r.jsxs("div", { className: `w-full flex gap-4 items-center ${u}`, children: [
43
+ /* @__PURE__ */ r.jsx(
44
+ "div",
45
+ {
46
+ className: `flex-1 ${x} rounded-full ${f} overflow-hidden`,
47
+ children: /* @__PURE__ */ r.jsx(
48
+ "div",
49
+ {
50
+ className: `h-full ${v} ${C} rounded-full`,
51
+ style: { width: `${l}%` }
52
+ }
53
+ )
54
+ }
55
+ ),
56
+ h && /* @__PURE__ */ r.jsxs("div", { className: "text-sm text-gray-700 font-medium text-nowrap flex items-center gap-1", children: [
57
+ /* @__PURE__ */ r.jsxs("span", { className: "font-bold", children: [
58
+ Math.round(l),
59
+ "%"
60
+ ] }),
61
+ i && /* @__PURE__ */ r.jsxs("span", { className: "text-xs text-gray-500", children: [
62
+ "(",
63
+ i,
64
+ ")"
65
+ ] }),
66
+ /* @__PURE__ */ r.jsx("span", { className: "text-gray-600", children: c })
67
+ ] })
68
+ ] });
69
+ };
70
+ export {
71
+ P as default
72
+ };
@@ -33,3 +33,5 @@ export * from './UncontrolledTextInput/index';
33
33
  export * from './UploadContainer/index';
34
34
  export * from './Tooltip/index';
35
35
  export * from './LoadingProgress/index';
36
+ export * from './ThresholdCircleProgress/index';
37
+ export * from './TresholdProgressBar/index';
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  /* empty css */
2
2
  import { default as a } from "./components/atoms/ActionButton/ActionButton.js";
3
- import { AsyncToast as p } from "./components/atoms/AsyncToast/index.js";
3
+ import { AsyncToast as l } from "./components/atoms/AsyncToast/index.js";
4
4
  import { default as d } from "./components/atoms/Avatar/Avatar.js";
5
- import { default as s } from "./components/atoms/BoxContainer/BoxContainer.js";
5
+ import { default as m } from "./components/atoms/BoxContainer/BoxContainer.js";
6
6
  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
- import { default as C } from "./components/atoms/CountryInput/CountryInput.js";
10
- import { default as S } from "./components/atoms/CountryLabel/CountryLabel.js";
11
- import { default as h } from "./components/atoms/CountrySelectInput/CountryDropdown.js";
12
- import { default as D } from "./components/atoms/Divider/Divider.js";
13
- import { default as P } from "./components/atoms/IconButton/IconButton.js";
9
+ import { default as g } from "./components/atoms/CountryInput/CountryInput.js";
10
+ import { default as h } from "./components/atoms/CountryLabel/CountryLabel.js";
11
+ import { default as S } from "./components/atoms/CountrySelectInput/CountryDropdown.js";
12
+ import { default as P } from "./components/atoms/Divider/Divider.js";
13
+ import { default as y } from "./components/atoms/IconButton/IconButton.js";
14
14
  import { default as L } from "./components/atoms/ImageProfileInput/ImageProfileInput.js";
15
15
  import { default as w } from "./components/atoms/ImageProfileInput/ImageProfileInput.validators.js";
16
16
  import { default as v } from "./components/atoms/IndexedStep/IndexedStep.js";
@@ -25,105 +25,109 @@ import { default as W } from "./components/atoms/SectionButton/SectionButton.js"
25
25
  import { default as Y } from "./components/atoms/SelectInput/SelectInput.js";
26
26
  import { default as _ } from "./components/atoms/SidebarButton/SidebarButton.js";
27
27
  import { default as oo } from "./components/atoms/Tab/Tab.js";
28
- import { default as eo } from "./components/atoms/TextButton/TextButton.js";
28
+ import { default as to } from "./components/atoms/TextButton/TextButton.js";
29
29
  import { default as ao } from "./components/atoms/TextInput/TextInput.js";
30
- import { default as po } from "./components/atoms/TextStaticInput/TextStaticInput.js";
31
- import { default as mo } from "./components/atoms/Toast/Toast.js";
30
+ import { default as lo } from "./components/atoms/TextStaticInput/TextStaticInput.js";
31
+ import { default as so } from "./components/atoms/Toast/Toast.js";
32
32
  import { default as uo } from "./components/atoms/UncontrolledSelector/UncontrolledSelector.js";
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 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";
36
+ import { default as Co } from "./components/atoms/LoadingProgress/LoadingProgress.js";
37
+ import { default as Bo } from "./components/atoms/ThresholdCircleProgress/ThresholdCircleProgress.js";
38
+ import { default as Mo } from "./components/atoms/TresholdProgressBar/TresholdProgressBar.js";
39
+ import { default as Do } from "./components/molecules/AlertModal/AlertModal.js";
40
+ import { default as bo } from "./components/molecules/CalendarSelector/CalendarSelector.js";
41
+ import { default as Uo } from "./components/molecules/DateInput/DateInput.js";
42
+ import { default as Ao } from "./components/molecules/DialogModal/DialogModal.js";
43
+ import { default as Fo } from "./components/molecules/Dropdown/Dropdown.js";
44
+ import { default as ko } from "./components/molecules/FileUpload/FileUpload.js";
45
+ import { default as Vo } from "./components/molecules/FloatingMenu/FloatingMenu.js";
46
+ import { default as qo } from "./components/molecules/IndexedStepper/IndexedStepper.js";
47
+ import { default as Go } from "./components/molecules/InformationContainer/InformationContainer.js";
48
+ import { default as Jo } from "./components/molecules/SearchModal/SearchModal.js";
49
+ import { default as No } from "./components/molecules/Stepper/Stepper.js";
50
+ import { default as Ro } from "./components/molecules/Tabs/Tabs.js";
51
+ import { default as Xo } from "./components/molecules/UncontrolledDateInput/UncontrolledDateInput.js";
52
+ import { Organism as Zo } from "./components/organisms/index.js";
53
+ import { formatLocalizedDate as $o } from "./utils/dates.js";
54
+ import { toBase64 as ee, translateBytes as te } from "./utils/files.js";
55
+ import { getImageUrl as ae } from "./utils/images.js";
56
+ import { ModalContainer as le, closeModal as pe, openCustomModal as de, openModal as se } from "./utils/modal.js";
57
+ import { renderTabContent as ue } from "./utils/renderContentOptions.js";
58
+ import { capitalizeFirstLetter as ne, stringToColor as ie } from "./utils/strings.js";
59
+ import { showToastAsync as Ie, showToastLoading as Te, toast as ge } from "./utils/toast.js";
60
+ import { ThemeProvider as he } from "./providers/ThemeProvider.js";
61
+ import { useTheme as Se } from "./hooks/useTheme.js";
60
62
  import "./contexts/themeContext.js";
61
- import { defaultTheme as St } from "./themes/default.js";
63
+ import { defaultTheme as Pe } from "./themes/default.js";
62
64
  export {
63
65
  a as ActionButton,
64
- Bo as AlertModal,
65
- p as AsyncToast,
66
+ Do as AlertModal,
67
+ l as AsyncToast,
66
68
  d as Avatar,
67
- s as BoxContainer,
69
+ m as BoxContainer,
68
70
  x as Button,
69
- Mo as CalendarSelector,
71
+ bo as CalendarSelector,
70
72
  i as CenterModal,
71
73
  I as Checkbox,
72
- h as CountryDropdown,
73
- C as CountryInput,
74
- S as CountryLabel,
75
- yo as DateInput,
76
- bo as DialogModal,
77
- D as Divider,
78
- Uo as Dropdown,
79
- Ao as FileUpload,
80
- Fo as FloatingMenu,
81
- P as IconButton,
74
+ S as CountryDropdown,
75
+ g as CountryInput,
76
+ h as CountryLabel,
77
+ Uo as DateInput,
78
+ Ao as DialogModal,
79
+ P as Divider,
80
+ Fo as Dropdown,
81
+ ko as FileUpload,
82
+ Vo as FloatingMenu,
83
+ y as IconButton,
82
84
  L as ImageProfileInput,
83
85
  v as IndexedStep,
84
- ko as IndexedStepper,
86
+ qo as IndexedStepper,
85
87
  z as InfoCard,
86
- Vo as InformationContainer,
88
+ Go as InformationContainer,
87
89
  O as InformationDisclaimer,
88
- go as LoadingProgress,
90
+ Co as LoadingProgress,
89
91
  j as LoadingSpinner,
90
- et as ModalContainer,
91
- Ro as Organism,
92
+ le as ModalContainer,
93
+ Zo as Organism,
92
94
  E as PasswordInput,
93
95
  H as PhoneInput,
94
96
  K as ProgressBar,
95
97
  Q as SearchBar,
96
- qo as SearchModal,
98
+ Jo as SearchModal,
97
99
  W as SectionButton,
98
100
  Y as SelectInput,
99
101
  _ as SidebarButton,
100
- Go as Stepper,
102
+ No as Stepper,
101
103
  oo as Tab,
102
- Jo as Tabs,
103
- eo as TextButton,
104
+ Ro as Tabs,
105
+ to as TextButton,
104
106
  ao as TextInput,
105
- po as TextStaticInput,
106
- It as ThemeProvider,
107
- mo as Toast,
107
+ lo as TextStaticInput,
108
+ he as ThemeProvider,
109
+ Bo as ThresholdCircleProgress,
110
+ so as Toast,
108
111
  To as Tooltip,
109
- No as UncontrolledDateInput,
112
+ Mo as TresholdProgressBar,
113
+ Xo as UncontrolledDateInput,
110
114
  uo as UncontrolledSelector,
111
115
  no as UncontrolledTextInput,
112
116
  co as UploadContainer,
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,
117
+ ne as capitalizeFirstLetter,
118
+ pe as closeModal,
119
+ Pe as defaultTheme,
120
+ $o as formatLocalizedDate,
121
+ ae as getImageUrl,
122
+ de as openCustomModal,
123
+ se as openModal,
124
+ ue as renderTabContent,
125
+ Ie as showToastAsync,
126
+ Te as showToastLoading,
127
+ ie as stringToColor,
128
+ ee as toBase64,
129
+ ge as toast,
130
+ te as translateBytes,
131
+ Se as useTheme,
128
132
  w as yupImageProfileValidator
129
133
  };