prometeo-design-system 2.7.0 → 2.7.2
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.
- package/dist/Avatar.es.js +72 -33
- package/dist/Button.es.js +398 -2
- package/dist/DatePicker.es.js +2 -2
- package/dist/DrawerDesktop.es.js +31 -30
- package/dist/FAButton.es.js +69 -18
- package/dist/Header.es.js +14 -14
- package/dist/Icons/Icons.d.ts +5 -0
- package/dist/Icons.es.js +432 -330
- package/dist/{ImageGallery-DKzJg3un.js → ImageGallery-D8nIvBpV.js} +7 -7
- package/dist/ImageGallery.es.js +1 -1
- package/dist/Input-CnXDg2s7.js +253 -0
- package/dist/Input.es.js +1 -1
- package/dist/InputFormikV2.es.js +30 -18
- package/dist/ProgressBar.es.js +63 -35
- package/dist/{Select-BQMdfu1n.js → Select-CiaBY4E0.js} +332 -235
- package/dist/Select.es.js +1 -1
- package/dist/SelectFormik.es.js +21 -20
- package/dist/SelectSearch.es.js +1 -1
- package/dist/Switch.es.js +4 -4
- package/dist/Toast.es.js +1 -1
- package/dist/components/Avatar/Avatar.d.ts +9 -4
- package/dist/components/Button/Button.d.ts +8 -14
- package/dist/components/Button/Button_Legacy.d.ts +29 -0
- package/dist/components/Input/Input.d.ts +7 -10
- package/dist/components/ProgressBar/ProgressBar.d.ts +13 -3
- package/dist/components/RecurrentDatePicker/CustomFrequencySettings.d.ts +5 -5
- package/dist/components/Select/Select.d.ts +5 -5
- package/dist/exports/ProgressBar.d.ts +1 -1
- package/dist/index-BOQuZ0gG.js +34 -0
- package/dist/index.d.ts +1 -3
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +19 -21
- package/package.json +1 -5
- package/dist/Button-CvBWH1HX.js +0 -183
- package/dist/ButtonV2.d.ts +0 -6
- package/dist/ButtonV2.es.js +0 -217
- package/dist/Input-BTsR-vNF.js +0 -281
- package/dist/components/Button/ButtonV2.d.ts +0 -23
- package/dist/exports/ButtonV2.d.ts +0 -2
|
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-DKDX3adD.js";
|
|
|
2
2
|
import ee, { memo as D, forwardRef as L, useRef as v, useEffect as te, useCallback as i, useState as R, useImperativeHandle as ne } from "react";
|
|
3
3
|
import { c as X } from "./cn-B6yFEsav.js";
|
|
4
4
|
import { u as re } from "./useDragScroll-CHN9OMwn.js";
|
|
5
|
-
import
|
|
5
|
+
import S from "./Button.es.js";
|
|
6
6
|
import { Icons as M } from "./Icons.es.js";
|
|
7
7
|
const O = D(L(({ images: n, className: c }, r) => {
|
|
8
8
|
const { ref: d, bind: a } = re({
|
|
@@ -37,7 +37,7 @@ const O = D(L(({ images: n, className: c }, r) => {
|
|
|
37
37
|
);
|
|
38
38
|
}));
|
|
39
39
|
O.displayName = "GalleryPreview";
|
|
40
|
-
const
|
|
40
|
+
const _ = D(({ images: n, lightboxClassName: c, closeLightbox: r, showThumbnails: d, thumbnailsClassName: a, currentIndex: l, goToNext: o, goToPrevious: s, goToIndex: N }) => {
|
|
41
41
|
const h = v(null), y = v(null), w = v(null), m = v({
|
|
42
42
|
scale: 1,
|
|
43
43
|
translateX: 0,
|
|
@@ -194,7 +194,7 @@ const B = D(({ images: n, lightboxClassName: c, closeLightbox: r, showThumbnails
|
|
|
194
194
|
)
|
|
195
195
|
}
|
|
196
196
|
),
|
|
197
|
-
d && /* @__PURE__ */ t.jsx("div", { className: " w-full absolute items-center flex justify-center left-0 right-0 z-[100] bottom-0", children: /* @__PURE__ */ t.jsx(
|
|
197
|
+
d && /* @__PURE__ */ t.jsx("div", { className: " w-full absolute items-center flex justify-center left-0 right-0 z-[100] bottom-0", children: /* @__PURE__ */ t.jsx(B, { images: n, currentIndex: l, goToIndex: N, thumbnailsClassName: a }) }),
|
|
198
198
|
n.length > 1 && /* @__PURE__ */ t.jsxs("div", { className: "absolute bottom-20 left-1/2 transform -translate-x-1/2 text-neutral-default-default prometeo-fonts-label-xlarge px-4 py-2 rounded-full", children: [
|
|
199
199
|
l + 1,
|
|
200
200
|
" / ",
|
|
@@ -204,13 +204,13 @@ const B = D(({ images: n, lightboxClassName: c, closeLightbox: r, showThumbnails
|
|
|
204
204
|
}
|
|
205
205
|
);
|
|
206
206
|
});
|
|
207
|
-
|
|
207
|
+
_.displayName = "LightBox";
|
|
208
208
|
const se = (n, c) => {
|
|
209
209
|
if (n.currentIndex !== c.currentIndex || n.thumbnailsClassName !== c.thumbnailsClassName || n.images.length !== c.images.length) return !1;
|
|
210
210
|
for (let r = 0; r < n.images.length; r++)
|
|
211
211
|
if (n.images[r].src !== c.images[r].src) return !1;
|
|
212
212
|
return !0;
|
|
213
|
-
},
|
|
213
|
+
}, B = D(({ images: n, currentIndex: c, goToIndex: r, thumbnailsClassName: d }) => /* @__PURE__ */ t.jsxs(
|
|
214
214
|
"div",
|
|
215
215
|
{
|
|
216
216
|
className: "flex gap-4 w-max overflow-x-auto overflow-y-visible max-w-full px-16 py-4",
|
|
@@ -251,7 +251,7 @@ const se = (n, c) => {
|
|
|
251
251
|
]
|
|
252
252
|
}
|
|
253
253
|
), se);
|
|
254
|
-
|
|
254
|
+
B.displayName = "Thumbnails";
|
|
255
255
|
const ae = L(
|
|
256
256
|
(n, c) => {
|
|
257
257
|
const {
|
|
@@ -295,7 +295,7 @@ const ae = L(
|
|
|
295
295
|
}
|
|
296
296
|
),
|
|
297
297
|
h && /* @__PURE__ */ t.jsx(
|
|
298
|
-
|
|
298
|
+
_,
|
|
299
299
|
{
|
|
300
300
|
images: s,
|
|
301
301
|
closeLightbox: j,
|
package/dist/ImageGallery.es.js
CHANGED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { j as r } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
+
import { Icons as z } from "./Icons.es.js";
|
|
3
|
+
import { c as t } from "./cn-B6yFEsav.js";
|
|
4
|
+
import { useRef as q, useLayoutEffect as F, memo as V, forwardRef as ee, useState as te } from "react";
|
|
5
|
+
import re from "./Spinner.es.js";
|
|
6
|
+
import { H as oe } from "./HelperComponent-U6mPwuDH.js";
|
|
7
|
+
import le from "./Button.es.js";
|
|
8
|
+
const se = (o) => {
|
|
9
|
+
let e = o;
|
|
10
|
+
for (; e && e !== document.body; ) {
|
|
11
|
+
const n = window.getComputedStyle(e).backgroundColor;
|
|
12
|
+
if (n && n !== "transparent" && n !== "rgba(0, 0, 0, 0)")
|
|
13
|
+
return n;
|
|
14
|
+
e = e.parentElement;
|
|
15
|
+
}
|
|
16
|
+
const l = window.getComputedStyle(document.body).backgroundColor;
|
|
17
|
+
return l && l !== "transparent" && l !== "rgba(0, 0, 0, 0)" ? l : "rgb(255, 255, 255)";
|
|
18
|
+
};
|
|
19
|
+
function ae() {
|
|
20
|
+
const o = q(null);
|
|
21
|
+
return F(() => {
|
|
22
|
+
if (!o.current || !o.current.parentElement) return;
|
|
23
|
+
const e = se(o.current.parentElement);
|
|
24
|
+
o.current.style.backgroundColor = e;
|
|
25
|
+
}, []), {
|
|
26
|
+
ref: o
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const b = {
|
|
30
|
+
default: {
|
|
31
|
+
container: "",
|
|
32
|
+
input: t(
|
|
33
|
+
"border-neutral-default-default text-neutral-default-default!",
|
|
34
|
+
"focus:ring-primary-default-default focus:ring-[1px] focus:border-primary-default-default ",
|
|
35
|
+
"hover:border-neutral-strong-default"
|
|
36
|
+
),
|
|
37
|
+
label: t("text-neutral-medium-default"),
|
|
38
|
+
icon: t(
|
|
39
|
+
"text-neutral-medium-default",
|
|
40
|
+
"peer-focus:text-primary-default-default"
|
|
41
|
+
)
|
|
42
|
+
},
|
|
43
|
+
error: {
|
|
44
|
+
container: "",
|
|
45
|
+
input: t(
|
|
46
|
+
"border-error-default-default text-neutral-default-default",
|
|
47
|
+
"focus:border-error-default focus:border-2",
|
|
48
|
+
"focus:ring-0 focus:ring-error-default/20"
|
|
49
|
+
),
|
|
50
|
+
label: t("text-lime-500", "peer-focus:text-error-light"),
|
|
51
|
+
icon: t("text-error-light", "peer-focus:text-error-light")
|
|
52
|
+
},
|
|
53
|
+
success: {
|
|
54
|
+
container: "",
|
|
55
|
+
input: t(
|
|
56
|
+
"border-success-default-default text-neutral-default-default",
|
|
57
|
+
"focus:border-success-default focus:border-2",
|
|
58
|
+
"focus:ring-0 focus:ring-success-default/20"
|
|
59
|
+
),
|
|
60
|
+
label: t("text-success", "peer-focus:text-success-light"),
|
|
61
|
+
icon: t("text-success-light", "peer-focus:text-success-light")
|
|
62
|
+
}
|
|
63
|
+
}, I = ee(
|
|
64
|
+
({
|
|
65
|
+
label: o,
|
|
66
|
+
icon: e,
|
|
67
|
+
iconPosition: l = "left",
|
|
68
|
+
onChange: C,
|
|
69
|
+
value: n = "",
|
|
70
|
+
name: g,
|
|
71
|
+
width: m = "100%",
|
|
72
|
+
height: u,
|
|
73
|
+
variant: c = "default",
|
|
74
|
+
labelVariant: a = "default",
|
|
75
|
+
size: S = "medium",
|
|
76
|
+
disabled: x = !1,
|
|
77
|
+
type: s = "text",
|
|
78
|
+
isFetching: f,
|
|
79
|
+
errorComponent: h,
|
|
80
|
+
helperComponent: w,
|
|
81
|
+
placeholder: H,
|
|
82
|
+
required: N = !1,
|
|
83
|
+
onFocus: $,
|
|
84
|
+
onBlur: k,
|
|
85
|
+
onKeyDown: B,
|
|
86
|
+
onKeyUp: L,
|
|
87
|
+
className: R,
|
|
88
|
+
style: P,
|
|
89
|
+
readOnly: D = !1,
|
|
90
|
+
onClear: v,
|
|
91
|
+
...A
|
|
92
|
+
}, M) => {
|
|
93
|
+
const [y, O] = te(!1), { ref: T } = ae();
|
|
94
|
+
let p = S;
|
|
95
|
+
u && (p = "customHeight");
|
|
96
|
+
const d = {
|
|
97
|
+
small: {
|
|
98
|
+
container: "text-sm",
|
|
99
|
+
input: "h-10 px-3 text-[1rem] prometeo-fonts-body-large",
|
|
100
|
+
label: ` prometeo-fonts-label-large
|
|
101
|
+
peer-focus:prometeo-fonts-label-large
|
|
102
|
+
peer-placeholder-shown:${a === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default peer-focus:text-neutral-medium-default `,
|
|
103
|
+
icon: "w-4 h-4 right-3"
|
|
104
|
+
},
|
|
105
|
+
medium: {
|
|
106
|
+
container: "text-base",
|
|
107
|
+
input: "h-12 px-3 prometeo-fonts-body-large",
|
|
108
|
+
label: ` prometeo-fonts-label-large
|
|
109
|
+
peer-focus:prometeo-fonts-label-large
|
|
110
|
+
peer-placeholder-shown:${a === "default" ? "prometeo-fonts-body-large" : "prometeo-fonts-label-large"} peer-placeholder-shown:text-neutral-medium-default text-neutral-medium-default peer-focus:text-neutral-medium-default `,
|
|
111
|
+
icon: "w-5 h-5 right-3"
|
|
112
|
+
},
|
|
113
|
+
large: {
|
|
114
|
+
container: "text-lg",
|
|
115
|
+
input: "h-14 px-3 text-lg border-b border-t-0 border-x-0 rounded-none focus:ring-0 prometeo-fonts-body-xlarge ",
|
|
116
|
+
label: "peer-placeholder-shown:prometeo-fonts-body-xlarge peer-focus:prometeo-fonts-label-large peer-focus:text-neutral-medium-default prometeo-fonts-label-large ",
|
|
117
|
+
icon: "w-6 h-6 right-3"
|
|
118
|
+
},
|
|
119
|
+
customHeight: {
|
|
120
|
+
container: "text-base",
|
|
121
|
+
input: "text-base",
|
|
122
|
+
label: "text-sm peer-focus:text-sm peer-placeholder-shown:text-xs ",
|
|
123
|
+
icon: "w-6 h-6 right-3"
|
|
124
|
+
}
|
|
125
|
+
}, G = () => {
|
|
126
|
+
O(!y);
|
|
127
|
+
}, j = {};
|
|
128
|
+
m && m !== "100%" && (j.width = m), u && (j.height = u);
|
|
129
|
+
const E = c === "error" && h, J = !E && w, K = s === "password", Q = () => a === "static" ? "-top-1 -translate-y-full left-0 pl-3" : e ? `${i ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1 peer-focus:ml-0 peer-focus:mr-0 ${l === "left" ? "peer-placeholder-shown:ml-6" : "peer-placeholder-shown:mr-6"}` : `${i ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1`, U = () => u ? d.customHeight.label : d[p].label, W = () => u ? { height: u } : {}, X = () => a === "default" ? o : H || o || "", Y = () => K ? e ? l === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : e ? l === "left" ? "pl-10 pr-3" : "pr-10 pl-3" : "", Z = a === "default" && "transition-all duration-200 ease-in-out", i = h || w;
|
|
130
|
+
return /* @__PURE__ */ r.jsxs(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
className: t(
|
|
134
|
+
"relative",
|
|
135
|
+
d[p].container,
|
|
136
|
+
!m && "w-full",
|
|
137
|
+
"bg-inherit",
|
|
138
|
+
a === "static" && "mt-2",
|
|
139
|
+
R
|
|
140
|
+
),
|
|
141
|
+
style: { ...P, ...j },
|
|
142
|
+
children: [
|
|
143
|
+
/* @__PURE__ */ r.jsx(
|
|
144
|
+
"input",
|
|
145
|
+
{
|
|
146
|
+
id: g,
|
|
147
|
+
name: g,
|
|
148
|
+
ref: M,
|
|
149
|
+
value: n,
|
|
150
|
+
placeholder: X(),
|
|
151
|
+
type: s === "password" && y ? "text" : s,
|
|
152
|
+
className: t(
|
|
153
|
+
"peer w-full border rounded-lg bg-transparent appearance-none transition-all duration-200 ease-in-out",
|
|
154
|
+
"focus:outline-none px-3",
|
|
155
|
+
a === "default" && "placeholder:text-transparent",
|
|
156
|
+
a === "static" && "placeholder:text-neutral-medium-default ",
|
|
157
|
+
b[c].input,
|
|
158
|
+
d[p].input,
|
|
159
|
+
e && "pr-10",
|
|
160
|
+
x && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
|
|
161
|
+
b[c].container,
|
|
162
|
+
Y()
|
|
163
|
+
),
|
|
164
|
+
style: W(),
|
|
165
|
+
onChange: C,
|
|
166
|
+
onFocus: $,
|
|
167
|
+
onBlur: k,
|
|
168
|
+
disabled: x,
|
|
169
|
+
required: N,
|
|
170
|
+
onKeyDown: B,
|
|
171
|
+
onKeyUp: L,
|
|
172
|
+
readOnly: D,
|
|
173
|
+
...A
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ r.jsx(
|
|
177
|
+
"label",
|
|
178
|
+
{
|
|
179
|
+
ref: T,
|
|
180
|
+
htmlFor: g,
|
|
181
|
+
className: t(
|
|
182
|
+
"absolute left-3 pointer-events-none px-1 z-10",
|
|
183
|
+
Z,
|
|
184
|
+
U(),
|
|
185
|
+
b[c].label,
|
|
186
|
+
Q(),
|
|
187
|
+
N && "after:content-['*'] after:text-error-default after:ml-1",
|
|
188
|
+
x && "text-neutral-medium-disabled prometeo-fonts-label-large"
|
|
189
|
+
),
|
|
190
|
+
children: o
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
(e || s === "password" || f) && /* @__PURE__ */ r.jsx(
|
|
194
|
+
"button",
|
|
195
|
+
{
|
|
196
|
+
tabIndex: -1,
|
|
197
|
+
type: "button",
|
|
198
|
+
className: t(
|
|
199
|
+
`absolute ${i ? "top-[calc(50%-12px)]" : "top-1/2"} -translate-y-1/2 flex items-center justify-center z-10`,
|
|
200
|
+
d[p].icon,
|
|
201
|
+
b[c].icon,
|
|
202
|
+
s === "password" && !f ? "cursor-pointer" : "pointer-events-none",
|
|
203
|
+
l === "right" ? "right-3" : "left-3"
|
|
204
|
+
),
|
|
205
|
+
onClick: s === "password" && !f ? G : void 0,
|
|
206
|
+
onMouseDown: (_) => s === "password" && !f && _.preventDefault(),
|
|
207
|
+
children: /* @__PURE__ */ r.jsxs("div", { children: [
|
|
208
|
+
f && s !== "password" && /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsx(re, { size: 24, color: "#7c86ff", loading: !0, variant: "clip" }) }),
|
|
209
|
+
s === "password" && (y ? /* @__PURE__ */ r.jsx(z.EyeVisibility, { size: 24, className: "" }) : /* @__PURE__ */ r.jsx(z.EyeVisibilityOff, { size: 24, className: "" })),
|
|
210
|
+
e
|
|
211
|
+
] })
|
|
212
|
+
}
|
|
213
|
+
),
|
|
214
|
+
v && /* @__PURE__ */ r.jsx(
|
|
215
|
+
le,
|
|
216
|
+
{
|
|
217
|
+
type: "button",
|
|
218
|
+
color: "secondary",
|
|
219
|
+
size: "small",
|
|
220
|
+
animate: !1,
|
|
221
|
+
className: t(
|
|
222
|
+
`absolute! ${i ? "top-[calc(50%-12px)]" : "top-1/2"} -translate-y-1/2 flex items-center justify-center z-10 right-1`,
|
|
223
|
+
"size-6 p-4 ",
|
|
224
|
+
"bg-inherit",
|
|
225
|
+
"hover:bg-transparent! p-4 rounded-full"
|
|
226
|
+
),
|
|
227
|
+
label: "",
|
|
228
|
+
disabled: x,
|
|
229
|
+
onClick: v,
|
|
230
|
+
variant: "text",
|
|
231
|
+
animateIcon: !1,
|
|
232
|
+
icon: /* @__PURE__ */ r.jsx(z.Close, { size: 20, className: "" })
|
|
233
|
+
}
|
|
234
|
+
),
|
|
235
|
+
i && /* @__PURE__ */ r.jsx("div", { className: "min-h-6", children: (E || J) && /* @__PURE__ */ r.jsx(
|
|
236
|
+
oe,
|
|
237
|
+
{
|
|
238
|
+
className: "absolute ",
|
|
239
|
+
variant: c,
|
|
240
|
+
children: h || w
|
|
241
|
+
}
|
|
242
|
+
) })
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
I.displayName = "Input";
|
|
249
|
+
const me = V(I);
|
|
250
|
+
export {
|
|
251
|
+
me as I,
|
|
252
|
+
ae as u
|
|
253
|
+
};
|
package/dist/Input.es.js
CHANGED
package/dist/InputFormikV2.es.js
CHANGED
|
@@ -1,29 +1,41 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { FastField as
|
|
1
|
+
import { j as i } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
+
import { FastField as m, getIn as n } from "formik";
|
|
3
3
|
import { memo as s } from "react";
|
|
4
|
-
import { I as
|
|
5
|
-
const
|
|
6
|
-
field:
|
|
7
|
-
form:
|
|
4
|
+
import { I as d } from "./Input-CnXDg2s7.js";
|
|
5
|
+
const f = ({
|
|
6
|
+
field: a,
|
|
7
|
+
form: r,
|
|
8
8
|
...e
|
|
9
9
|
}) => {
|
|
10
|
-
const
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
10
|
+
const t = r.getFieldMeta(a.name), o = t.touched && t.error;
|
|
11
|
+
return /* @__PURE__ */ i.jsx(
|
|
12
|
+
d,
|
|
13
13
|
{
|
|
14
14
|
...e,
|
|
15
|
-
...
|
|
16
|
-
value:
|
|
17
|
-
onChange: (
|
|
18
|
-
|
|
15
|
+
...a,
|
|
16
|
+
value: a.value,
|
|
17
|
+
onChange: (u) => {
|
|
18
|
+
a.onChange({ target: { value: u.target.value, name: a.name } });
|
|
19
19
|
},
|
|
20
|
-
variant:
|
|
21
|
-
errorComponent:
|
|
20
|
+
variant: o ? "error" : "default",
|
|
21
|
+
errorComponent: t.error,
|
|
22
22
|
type: e.type,
|
|
23
|
-
ref: e.innerRef
|
|
23
|
+
ref: e.innerRef,
|
|
24
|
+
disabled: e.disabled
|
|
24
25
|
}
|
|
25
26
|
);
|
|
26
|
-
},
|
|
27
|
+
}, l = s(f), h = (a) => /* @__PURE__ */ i.jsx(
|
|
28
|
+
m,
|
|
29
|
+
{
|
|
30
|
+
name: a.name,
|
|
31
|
+
disabled: a.disabled,
|
|
32
|
+
shouldUpdate: (r, e) => {
|
|
33
|
+
const t = r.name;
|
|
34
|
+
return r.disabled !== e.disabled || t !== e.name || n(r.formik.values, t) !== n(e.formik.values, t) || n(r.formik.errors, t) !== n(e.formik.errors, t) || n(r.formik.touched, t) !== n(e.formik.touched, t) || r.formik.isSubmitting !== e.formik.isSubmitting || Object.keys(r).length !== Object.keys(e).length;
|
|
35
|
+
},
|
|
36
|
+
children: ({ field: r, form: e }) => /* @__PURE__ */ i.jsx(l, { ...a, field: r, form: e, disabled: a.disabled })
|
|
37
|
+
}
|
|
38
|
+
);
|
|
27
39
|
export {
|
|
28
|
-
|
|
40
|
+
h as default
|
|
29
41
|
};
|
package/dist/ProgressBar.es.js
CHANGED
|
@@ -1,42 +1,70 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-DKDX3adD.js";
|
|
2
2
|
import { c as j } from "./cn-B6yFEsav.js";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
({
|
|
6
|
-
className:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
import T from "react";
|
|
4
|
+
const M = T.forwardRef(
|
|
5
|
+
(o, g) => {
|
|
6
|
+
const { className: p, label: m, ...b } = o;
|
|
7
|
+
if (o.variant === "date") {
|
|
8
|
+
const { startDate: l, endDate: n } = o, r = new Date(l), t = new Date(n), a = /* @__PURE__ */ new Date(), i = t.getTime() - r.getTime(), c = a.getTime() - r.getTime(), d = Math.min(100, Math.max(0, c / i * 100)), u = 1440 * 60 * 1e3, f = Math.max(0, Math.ceil((t.getTime() - a.getTime()) / u)), x = Math.floor((a.getTime() - t.getTime()) / u), y = Math.ceil(i / u), w = Math.min(y, Math.max(0, Math.floor(c / u))), h = a > t, v = f === 0 && !h, N = h && x === 0;
|
|
9
|
+
let s = m;
|
|
10
|
+
return m || (h ? x === 0 ? s = "Vence hoy" : x === 1 ? s = "Vencido hace 1 día" : s = `Vencido hace ${x} días` : f === 0 ? s = "Vence hoy" : f === 1 ? s = "Falta 1 día" : s = `Faltan ${f} días`), /* @__PURE__ */ e.jsxs("div", { ref: g, className: p, ...b, children: [
|
|
11
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-end mb-2 gap-4 px-2", children: [
|
|
12
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
13
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm text-neutral-medium-default", children: "Tiempo restante de resolución" }),
|
|
14
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-semibold text-base text-neutral-default-default", children: s })
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ e.jsxs("span", { className: "text-sm text-neutral-medium-default whitespace-nowrap", children: [
|
|
17
|
+
w,
|
|
18
|
+
" / ",
|
|
19
|
+
y,
|
|
20
|
+
" días"
|
|
21
|
+
] })
|
|
19
22
|
] }),
|
|
20
|
-
/* @__PURE__ */ e.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full bg-neutral-800 dark:bg-neutral-900 border border-neutral-600 dark:border-neutral-700 rounded-sm h-4 overflow-hidden", children: /* @__PURE__ */ e.jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: j(
|
|
27
|
+
"h-full transition-all duration-300",
|
|
28
|
+
v || N ? "bg-yellow-500" : h ? "bg-red-500" : "bg-primary-default-default"
|
|
29
|
+
),
|
|
30
|
+
style: { width: `${d}%` }
|
|
31
|
+
}
|
|
32
|
+
) })
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
if (o.variant === "quantity") {
|
|
36
|
+
const { current: l, total: n, unit: r = "items" } = o, t = Math.min(100, Math.max(0, l / n * 100)), a = Math.max(0, n - l), i = l >= n, c = t >= 80 && !i;
|
|
37
|
+
let d = m;
|
|
38
|
+
return m || (i ? d = "Completado" : a === 1 ? d = `Falta 1 ${r}` : d = `Faltan ${a} ${r}`), /* @__PURE__ */ e.jsxs("div", { ref: g, className: p, ...b, children: [
|
|
39
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-end mb-2 gap-4 px-2", children: [
|
|
40
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
41
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm text-neutral-medium-default", children: "Progreso" }),
|
|
42
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-semibold text-base text-neutral-default-default", children: d })
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ e.jsxs("span", { className: "text-sm text-neutral-medium-default whitespace-nowrap", children: [
|
|
45
|
+
l,
|
|
46
|
+
" / ",
|
|
47
|
+
n,
|
|
48
|
+
" ",
|
|
49
|
+
r
|
|
50
|
+
] })
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full bg-neutral-800 dark:bg-neutral-900 border border-neutral-600 dark:border-neutral-700 rounded-sm h-4 overflow-hidden", children: /* @__PURE__ */ e.jsx(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: j(
|
|
56
|
+
"h-full transition-all duration-300",
|
|
57
|
+
i ? "bg-green-500" : c ? "bg-yellow-500" : "bg-primary-default-default"
|
|
58
|
+
),
|
|
59
|
+
style: { width: `${t}%` }
|
|
60
|
+
}
|
|
61
|
+
) })
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
38
65
|
}
|
|
39
66
|
);
|
|
67
|
+
M.displayName = "ProgressBar";
|
|
40
68
|
export {
|
|
41
|
-
|
|
69
|
+
M as default
|
|
42
70
|
};
|