prometeo-design-system 2.9.6 → 2.9.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.
- package/dist/Button.es.js +9 -9
- package/dist/{CardProfile-CsytJlKZ.js → CardProfile-WHoeSibd.js} +8 -8
- package/dist/CardProfile.es.js +1 -1
- package/dist/CheckBox.es.js +4 -4
- package/dist/DatePicker-CbXUUnv7.js +3568 -0
- package/dist/DatePicker.es.js +3 -3439
- package/dist/DrawerDesktop.d.ts +6 -0
- package/dist/DrawerDesktop.es.js +211 -0
- package/dist/DrawerMobile.d.ts +6 -0
- package/dist/DrawerMobile.es.js +242 -0
- package/dist/DropZone.es.js +5 -5
- package/dist/FAButton.es.js +1 -1
- package/dist/{HelperComponent-g_xuKWzK.js → HelperComponent-BeNlTMqI.js} +7 -7
- package/dist/Icons/Icons.d.ts +1 -1
- package/dist/Icons.d.ts +0 -4
- package/dist/Icons.es.js +1119 -3
- package/dist/Image.es.js +29 -29
- package/dist/{ImageGallery-Ckxg9OIC.js → ImageGallery-WKzUevOQ.js} +34 -34
- package/dist/ImageGallery.es.js +1 -1
- package/dist/{Input-Cck37DpG.js → Input-Cf8P1QJv.js} +30 -31
- package/dist/Input.es.js +1 -1
- package/dist/InputMultiple.es.js +34 -34
- package/dist/Logo.es.js +1 -1
- package/dist/OtpInput.es.js +43 -43
- package/dist/RadioButton.es.js +1 -1
- package/dist/RecurrentDatePicker.d.ts +2 -0
- package/dist/RecurrentDatePicker.es.js +694 -0
- package/dist/RecurrentDatePickerRRule.d.ts +2 -0
- package/dist/RecurrentDatePickerRRule.es.js +1684 -0
- package/dist/{Select-BD5FTxVw.js → Select-DeKi15Iu.js} +31 -32
- package/dist/Select.es.js +1 -1
- package/dist/SelectSearch.es.js +1 -1
- package/dist/Spinner.es.js +172 -46
- package/dist/Steps.es.js +1 -1
- package/dist/Toast.es.js +22 -22
- package/dist/Tooltip.es.js +1 -1
- package/dist/components/Drawer/DrawerDesktop.d.ts +1 -0
- package/dist/components/Drawer/useDrawerDesktop.d.ts +1 -1
- package/dist/components/RecurrentDatePicker/PreviewCalendar.d.ts +4 -1
- package/dist/components/RecurrentDatePicker/RecurrentDatePicker.d.ts +4 -4
- package/dist/components/RecurrentDatePicker/RecurrentDatePickerRRule.d.ts +13 -0
- package/dist/components/RecurrentDatePicker/recurrentDatePicker.validations.d.ts +3 -3
- package/dist/components/Spinner/Spinner.d.ts +6 -6
- package/dist/exports/DrawerDesktop.d.ts +4 -0
- package/dist/exports/DrawerMobile.d.ts +4 -0
- package/dist/exports/Icons.d.ts +1 -2
- package/dist/exports/RecurrentDatePicker.d.ts +5 -0
- package/dist/exports/RecurrentDatePickerRRule.d.ts +2 -0
- package/dist/exports/Spinner.d.ts +2 -1
- package/dist/index.d.ts +8 -3
- package/dist/prometeo-design-system.es.js +412 -762
- package/dist/styles.css +1 -0
- package/dist/styles.d.ts +1 -0
- package/package.json +19 -6
- package/src/styles/app.css +1 -1313
- package/src/styles/base.css +1331 -0
- package/src/styles/utilities.css +24 -36
- package/dist/Icons-DtFC5DJ7.js +0 -1079
- package/dist/components/Spinner/SpinnerV2.d.ts +0 -12
- package/dist/prometeo-design-system.css +0 -1
package/dist/Image.es.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { j as n } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import { c as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
2
|
+
import { memo as P, useState as x, useRef as E, useCallback as w, useEffect as N } from "react";
|
|
3
|
+
import R from "./Spinner.es.js";
|
|
4
|
+
import { c as u } from "./cn-B6yFEsav.js";
|
|
5
|
+
import M from "./Skeleton.es.js";
|
|
6
|
+
const S = (s, e) => {
|
|
7
7
|
if (s.src !== e.src || s.alt !== e.alt || s.width !== e.width || s.height !== e.height || s.className !== e.className || s.lazy !== e.lazy || s.showLoader !== e.showLoader || s.allowPreview !== e.allowPreview) return !1;
|
|
8
8
|
const r = s.loaderProps, a = e.loaderProps;
|
|
9
9
|
return !(r !== a && (!r || !a || r.loaderType !== a.loaderType || r.variant !== a.variant || r.speedMultiplier !== a.speedMultiplier || r.className !== a.className || r.size !== a.size || r.backdropClassName !== a.backdropClassName));
|
|
10
|
-
},
|
|
10
|
+
}, T = P(
|
|
11
11
|
(s) => {
|
|
12
|
-
const { src: e, alt: r, width: a, height: c, className: f, lazy:
|
|
12
|
+
const { src: e, alt: r, width: a, height: c, className: f, lazy: b = !0, showLoader: y = !0, loaderProps: k, allowPreview: t = !1, galleryRef: l } = s, { variant: I = "clip", speedMultiplier: v = 0.7, className: j, backdropClassName: C, loaderType: d = "clasic" } = k || {}, [L, m] = x(!0), g = E(!1), h = w((i) => {
|
|
13
13
|
const o = new Image();
|
|
14
14
|
o.src = i, o.onload = () => {
|
|
15
|
-
|
|
15
|
+
m(!1);
|
|
16
16
|
}, o.onerror = () => {
|
|
17
|
-
|
|
17
|
+
m(!1);
|
|
18
18
|
};
|
|
19
19
|
}, []);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}, [e,
|
|
23
|
-
l?.current && !
|
|
20
|
+
N(() => {
|
|
21
|
+
h(e);
|
|
22
|
+
}, [e, h]), N(() => {
|
|
23
|
+
l?.current && !g.current && (l.current.addImage({ src: e, alt: r, width: a, height: c, className: f }), g.current = !0);
|
|
24
24
|
}, [l, e, r, a, c, f]);
|
|
25
|
-
const
|
|
25
|
+
const p = w(() => {
|
|
26
26
|
if (t && l?.current) {
|
|
27
|
-
const o = l.current.images.findIndex((
|
|
27
|
+
const o = l.current.images.findIndex((z) => z.src === e);
|
|
28
28
|
l.current.openLightbox(o >= 0 ? o : 0);
|
|
29
29
|
}
|
|
30
30
|
}, [t, l, e]);
|
|
@@ -33,7 +33,7 @@ const T = (s, e) => {
|
|
|
33
33
|
/* @__PURE__ */ n.jsxs(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
|
-
className:
|
|
36
|
+
className: u(
|
|
37
37
|
"relative rounded-2xl overflow-hidden select-none",
|
|
38
38
|
t && l && "cursor-pointer hover:brightness-75 transition-all ease-in-out duration-300",
|
|
39
39
|
f
|
|
@@ -44,11 +44,11 @@ const T = (s, e) => {
|
|
|
44
44
|
minWidth: a,
|
|
45
45
|
minHeight: c
|
|
46
46
|
},
|
|
47
|
-
onClick:
|
|
47
|
+
onClick: p,
|
|
48
48
|
role: t ? "button" : void 0,
|
|
49
49
|
tabIndex: t ? 0 : void 0,
|
|
50
50
|
onKeyDown: t ? (i) => {
|
|
51
|
-
(i.key === "Enter" || i.key === " ") && (i.preventDefault(),
|
|
51
|
+
(i.key === "Enter" || i.key === " ") && (i.preventDefault(), p());
|
|
52
52
|
} : void 0,
|
|
53
53
|
children: [
|
|
54
54
|
/* @__PURE__ */ n.jsx(
|
|
@@ -57,21 +57,21 @@ const T = (s, e) => {
|
|
|
57
57
|
draggable: !1,
|
|
58
58
|
src: e,
|
|
59
59
|
alt: r,
|
|
60
|
-
className:
|
|
61
|
-
loading:
|
|
60
|
+
className: u("object-cover", f, "w-full h-full"),
|
|
61
|
+
loading: b ? "lazy" : "eager"
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
|
|
64
|
+
L && y && /* @__PURE__ */ n.jsx(
|
|
65
65
|
"div",
|
|
66
66
|
{
|
|
67
|
-
className:
|
|
67
|
+
className: u(
|
|
68
68
|
"absolute grid place-items-center",
|
|
69
69
|
"inset-0",
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
d === "skeleton" ? "bg-inherit" : "bg-black/30",
|
|
71
|
+
C
|
|
72
72
|
),
|
|
73
|
-
children:
|
|
74
|
-
|
|
73
|
+
children: d === "clasic" ? /* @__PURE__ */ n.jsx(R, { variant: I, speedMultiplier: v, className: j }) : /* @__PURE__ */ n.jsx(
|
|
74
|
+
M,
|
|
75
75
|
{
|
|
76
76
|
className: "w-full h-full z-100"
|
|
77
77
|
}
|
|
@@ -83,9 +83,9 @@ const T = (s, e) => {
|
|
|
83
83
|
)
|
|
84
84
|
);
|
|
85
85
|
},
|
|
86
|
-
|
|
86
|
+
S
|
|
87
87
|
);
|
|
88
|
-
|
|
88
|
+
T.displayName = "Image";
|
|
89
89
|
export {
|
|
90
|
-
|
|
90
|
+
T as default
|
|
91
91
|
};
|
|
@@ -3,9 +3,9 @@ import Q, { memo as M, forwardRef as A, useRef as v, useEffect as ee, useCallbac
|
|
|
3
3
|
import { c as X } from "./cn-B6yFEsav.js";
|
|
4
4
|
import { u as ne } from "./useDragScroll-CHN9OMwn.js";
|
|
5
5
|
import S from "./Button.es.js";
|
|
6
|
-
import {
|
|
6
|
+
import { Close as re, CrevronLeft as se, CrevronRight as ae } from "./Icons.es.js";
|
|
7
7
|
const L = M(A(({ images: n, className: c }, r) => {
|
|
8
|
-
const { ref: d, bind:
|
|
8
|
+
const { ref: d, bind: a } = ne({
|
|
9
9
|
axis: "x",
|
|
10
10
|
friction: 0.9,
|
|
11
11
|
minVelocity: 0.5,
|
|
@@ -20,12 +20,12 @@ const L = M(A(({ images: n, className: c }, r) => {
|
|
|
20
20
|
{
|
|
21
21
|
ref: d,
|
|
22
22
|
className: X("flex gap-4 w-full overflow-x-auto py-2 relative", c),
|
|
23
|
-
onPointerDown:
|
|
24
|
-
onPointerMove:
|
|
25
|
-
onPointerUp:
|
|
26
|
-
onPointerLeave:
|
|
27
|
-
onPointerCancel:
|
|
28
|
-
onClickCapture:
|
|
23
|
+
onPointerDown: a.onPointerDown,
|
|
24
|
+
onPointerMove: a.onPointerMove,
|
|
25
|
+
onPointerUp: a.onPointerUp,
|
|
26
|
+
onPointerLeave: a.onPointerLeave,
|
|
27
|
+
onPointerCancel: a.onPointerCancel,
|
|
28
|
+
onClickCapture: a.onClickCapture,
|
|
29
29
|
"aria-label": "Image gallery",
|
|
30
30
|
children: n && n.length > 0 && n.map((l, o) => Q.cloneElement(l, {
|
|
31
31
|
key: l.props.src || o,
|
|
@@ -37,7 +37,7 @@ const L = M(A(({ images: n, className: c }, r) => {
|
|
|
37
37
|
);
|
|
38
38
|
}));
|
|
39
39
|
L.displayName = "GalleryPreview";
|
|
40
|
-
const O = M(({ images: n, lightboxClassName: c, closeLightbox: r, showThumbnails: d, thumbnailsClassName:
|
|
40
|
+
const O = M(({ 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,
|
|
@@ -53,15 +53,15 @@ const O = M(({ images: n, lightboxClassName: c, closeLightbox: r, showThumbnails
|
|
|
53
53
|
w.current && w.current.focus();
|
|
54
54
|
}, []);
|
|
55
55
|
const k = i((e) => {
|
|
56
|
-
e.preventDefault(), e.stopPropagation(), e.key === "Escape" ? r() : e.key === "ArrowLeft" ?
|
|
57
|
-
}, [r,
|
|
56
|
+
e.preventDefault(), e.stopPropagation(), e.key === "Escape" ? r() : e.key === "ArrowLeft" ? s() : e.key === "ArrowRight" && o();
|
|
57
|
+
}, [r, s, o]), P = i((e) => {
|
|
58
58
|
u.current = { startX: e.touches[0].clientX, startY: e.touches[0].clientY, isDragging: !0, distanceX: 0, distanceY: 0 };
|
|
59
59
|
}, []), j = i((e) => {
|
|
60
60
|
const g = e.touches[0];
|
|
61
61
|
u.current = { ...u.current, isDragging: !0, distanceX: g.clientX - u.current.startX, distanceY: g.clientY - u.current.startY };
|
|
62
62
|
}, []), z = i(() => {
|
|
63
|
-
u.current = { ...u.current, startX: 0, startY: 0, isDragging: !1 }, Math.abs(u.current.distanceX) > Math.abs(u.current.distanceY) && (u.current.distanceX < 0 ? o() :
|
|
64
|
-
}, [o,
|
|
63
|
+
u.current = { ...u.current, startX: 0, startY: 0, isDragging: !1 }, Math.abs(u.current.distanceX) > Math.abs(u.current.distanceY) && (u.current.distanceX < 0 ? o() : s());
|
|
64
|
+
}, [o, s]), C = i(() => {
|
|
65
65
|
const e = h.current;
|
|
66
66
|
if (!e) return;
|
|
67
67
|
const { scale: g, translateX: p, translateY: I } = m.current;
|
|
@@ -72,7 +72,7 @@ const O = M(({ images: n, lightboxClassName: c, closeLightbox: r, showThumbnails
|
|
|
72
72
|
const g = h.current, p = y.current;
|
|
73
73
|
if (!g || !p) return;
|
|
74
74
|
if (e.shiftKey) {
|
|
75
|
-
e.deltaY < 0 ? o() : e.deltaY > 0 &&
|
|
75
|
+
e.deltaY < 0 ? o() : e.deltaY > 0 && s();
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
const I = 2e-3, D = 1, B = 8, F = -e.deltaY * I, E = m.current.scale;
|
|
@@ -87,7 +87,7 @@ const O = M(({ images: n, lightboxClassName: c, closeLightbox: r, showThumbnails
|
|
|
87
87
|
translateX: Z,
|
|
88
88
|
translateY: J
|
|
89
89
|
}, C();
|
|
90
|
-
}, [o,
|
|
90
|
+
}, [o, s, C, b]);
|
|
91
91
|
return n.length === 0 ? null : /* @__PURE__ */ t.jsxs(
|
|
92
92
|
"div",
|
|
93
93
|
{
|
|
@@ -120,7 +120,7 @@ const O = M(({ images: n, lightboxClassName: c, closeLightbox: r, showThumbnails
|
|
|
120
120
|
{
|
|
121
121
|
className: "absolute left-0 lg:h-full items-center flex justify-center w-16 z-100 cursor-w-resize",
|
|
122
122
|
onClick: (e) => {
|
|
123
|
-
e.stopPropagation(),
|
|
123
|
+
e.stopPropagation(), s();
|
|
124
124
|
},
|
|
125
125
|
children: /* @__PURE__ */ t.jsx(
|
|
126
126
|
S,
|
|
@@ -129,11 +129,11 @@ const O = M(({ images: n, lightboxClassName: c, closeLightbox: r, showThumbnails
|
|
|
129
129
|
color: "secondary",
|
|
130
130
|
size: "small",
|
|
131
131
|
onClick: (e) => {
|
|
132
|
-
e.stopPropagation(),
|
|
132
|
+
e.stopPropagation(), s();
|
|
133
133
|
},
|
|
134
134
|
className: "text-white! hover:text-gray-300! w-auto! h-auto! p-2!",
|
|
135
135
|
"aria-label": "Previous image",
|
|
136
|
-
children: /* @__PURE__ */ t.jsx(
|
|
136
|
+
children: /* @__PURE__ */ t.jsx(se, { size: 24 })
|
|
137
137
|
}
|
|
138
138
|
)
|
|
139
139
|
}
|
|
@@ -156,7 +156,7 @@ const O = M(({ images: n, lightboxClassName: c, closeLightbox: r, showThumbnails
|
|
|
156
156
|
},
|
|
157
157
|
className: "text-white! hover:text-gray-300! w-auto! h-auto! p-2!",
|
|
158
158
|
"aria-label": "Next image",
|
|
159
|
-
children: /* @__PURE__ */ t.jsx(
|
|
159
|
+
children: /* @__PURE__ */ t.jsx(ae, { size: 24 })
|
|
160
160
|
}
|
|
161
161
|
)
|
|
162
162
|
}
|
|
@@ -194,7 +194,7 @@ const O = M(({ 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(_, { images: n, currentIndex: l, goToIndex: N, thumbnailsClassName:
|
|
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(_, { 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
|
" / ",
|
|
@@ -225,7 +225,7 @@ const le = (n, c) => {
|
|
|
225
225
|
display: none;
|
|
226
226
|
}
|
|
227
227
|
` }),
|
|
228
|
-
n.map((
|
|
228
|
+
n.map((a, l) => /* @__PURE__ */ t.jsx(
|
|
229
229
|
"button",
|
|
230
230
|
{
|
|
231
231
|
type: "button",
|
|
@@ -240,13 +240,13 @@ const le = (n, c) => {
|
|
|
240
240
|
children: /* @__PURE__ */ t.jsx(
|
|
241
241
|
"img",
|
|
242
242
|
{
|
|
243
|
-
src:
|
|
244
|
-
alt:
|
|
243
|
+
src: a.src,
|
|
244
|
+
alt: a.alt,
|
|
245
245
|
className: "w-full h-full object-cover select-none"
|
|
246
246
|
}
|
|
247
247
|
)
|
|
248
248
|
},
|
|
249
|
-
|
|
249
|
+
a.src
|
|
250
250
|
))
|
|
251
251
|
]
|
|
252
252
|
}
|
|
@@ -257,10 +257,10 @@ const oe = A(
|
|
|
257
257
|
const {
|
|
258
258
|
children: r,
|
|
259
259
|
className: d,
|
|
260
|
-
lightboxClassName:
|
|
260
|
+
lightboxClassName: a,
|
|
261
261
|
showThumbnails: l,
|
|
262
262
|
thumbnailsClassName: o
|
|
263
|
-
} = n, [
|
|
263
|
+
} = n, [s, N] = R([]), [h, y] = R(!1), [w, m] = R(0), u = r ? Array.isArray(r) ? r : [r] : [], k = i((f) => {
|
|
264
264
|
N((e) => e.some((p) => p.src === f.src) ? e : [...e, f]);
|
|
265
265
|
}, []), P = i((f = 0) => {
|
|
266
266
|
m(f), y(!0);
|
|
@@ -274,15 +274,15 @@ const oe = A(
|
|
|
274
274
|
closeLightbox: j,
|
|
275
275
|
isOpen: h,
|
|
276
276
|
addImage: k,
|
|
277
|
-
images:
|
|
277
|
+
images: s
|
|
278
278
|
}),
|
|
279
|
-
[
|
|
279
|
+
[s]
|
|
280
280
|
);
|
|
281
281
|
const z = i(() => {
|
|
282
|
-
m((f) => (f + 1) %
|
|
283
|
-
}, [
|
|
284
|
-
m((f) => (f - 1 +
|
|
285
|
-
}, [
|
|
282
|
+
m((f) => (f + 1) % s.length);
|
|
283
|
+
}, [s.length]), C = i(() => {
|
|
284
|
+
m((f) => (f - 1 + s.length) % s.length);
|
|
285
|
+
}, [s.length]), b = i((f) => {
|
|
286
286
|
m(f);
|
|
287
287
|
}, []);
|
|
288
288
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
@@ -297,10 +297,10 @@ const oe = A(
|
|
|
297
297
|
h && /* @__PURE__ */ t.jsx(
|
|
298
298
|
O,
|
|
299
299
|
{
|
|
300
|
-
images:
|
|
300
|
+
images: s,
|
|
301
301
|
closeLightbox: j,
|
|
302
302
|
showThumbnails: l,
|
|
303
|
-
lightboxClassName:
|
|
303
|
+
lightboxClassName: a,
|
|
304
304
|
thumbnailsClassName: o,
|
|
305
305
|
currentIndex: w,
|
|
306
306
|
goToNext: z,
|
package/dist/ImageGallery.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as r } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import {
|
|
2
|
+
import { EyeVisibility as _, EyeVisibilityOff as q, Close as V } from "./Icons.es.js";
|
|
3
3
|
import { c as t } from "./cn-B6yFEsav.js";
|
|
4
4
|
import { useRef as F, useLayoutEffect as ee, memo as te, forwardRef as re, useState as oe } from "react";
|
|
5
5
|
import le from "./Spinner.es.js";
|
|
6
|
-
import { H as se } from "./HelperComponent-
|
|
6
|
+
import { H as se } from "./HelperComponent-BeNlTMqI.js";
|
|
7
7
|
const ae = (o) => {
|
|
8
8
|
let e = o;
|
|
9
9
|
for (; e && e !== document.body; ) {
|
|
@@ -25,7 +25,7 @@ function ne() {
|
|
|
25
25
|
ref: o
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const b = {
|
|
29
29
|
default: {
|
|
30
30
|
container: "",
|
|
31
31
|
input: t(
|
|
@@ -59,14 +59,14 @@ const g = {
|
|
|
59
59
|
label: t("text-success", "peer-focus:text-success-light"),
|
|
60
60
|
icon: t("text-success-light", "peer-focus:text-success-light")
|
|
61
61
|
}
|
|
62
|
-
},
|
|
62
|
+
}, v = re(
|
|
63
63
|
({
|
|
64
64
|
label: o,
|
|
65
65
|
icon: e,
|
|
66
66
|
iconPosition: l = "left",
|
|
67
|
-
onChange:
|
|
67
|
+
onChange: N,
|
|
68
68
|
value: n,
|
|
69
|
-
name:
|
|
69
|
+
name: g,
|
|
70
70
|
width: x = "100%",
|
|
71
71
|
height: u,
|
|
72
72
|
variant: c = "default",
|
|
@@ -78,7 +78,7 @@ const g = {
|
|
|
78
78
|
errorComponent: h,
|
|
79
79
|
helperComponent: w,
|
|
80
80
|
placeholder: $,
|
|
81
|
-
required:
|
|
81
|
+
required: z = !1,
|
|
82
82
|
onFocus: k,
|
|
83
83
|
onBlur: I,
|
|
84
84
|
onKeyDown: L,
|
|
@@ -86,8 +86,8 @@ const g = {
|
|
|
86
86
|
className: B,
|
|
87
87
|
style: P,
|
|
88
88
|
readOnly: D = !1,
|
|
89
|
-
onClear:
|
|
90
|
-
...
|
|
89
|
+
onClear: C,
|
|
90
|
+
...E
|
|
91
91
|
}, A) => {
|
|
92
92
|
const [y, M] = oe(!1), { ref: O } = ne();
|
|
93
93
|
let d = H;
|
|
@@ -125,7 +125,7 @@ const g = {
|
|
|
125
125
|
M(!y);
|
|
126
126
|
}, j = {};
|
|
127
127
|
x && x !== "100%" && (j.width = x), u && (j.height = u);
|
|
128
|
-
const
|
|
128
|
+
const S = c === "error" && h, G = !S && w, J = s === "password", K = () => a === "static" ? "-top-1 -translate-y-full left-0 pl-3" : e ? `${m ? "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"}` : `${m ? "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`, Q = () => u ? i.customHeight.label : i[d].label, U = () => u ? { height: u } : {}, W = () => a === "default" ? o : $ || o || "", X = () => J ? e ? l === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : e ? l === "left" ? "pl-10 pr-3" : "pr-10 pl-3" : "", Y = a === "default" && "transition-all duration-200 ease-in-out", m = h || w;
|
|
129
129
|
return /* @__PURE__ */ r.jsxs(
|
|
130
130
|
"div",
|
|
131
131
|
{
|
|
@@ -142,8 +142,8 @@ const g = {
|
|
|
142
142
|
/* @__PURE__ */ r.jsx(
|
|
143
143
|
"input",
|
|
144
144
|
{
|
|
145
|
-
id:
|
|
146
|
-
name:
|
|
145
|
+
id: g,
|
|
146
|
+
name: g,
|
|
147
147
|
ref: A,
|
|
148
148
|
value: n,
|
|
149
149
|
placeholder: W(),
|
|
@@ -153,38 +153,38 @@ const g = {
|
|
|
153
153
|
"focus:outline-none px-3",
|
|
154
154
|
a === "default" && "placeholder:text-transparent",
|
|
155
155
|
a === "static" && "placeholder:text-neutral-medium-default ",
|
|
156
|
-
|
|
156
|
+
b[c].input,
|
|
157
157
|
i[d].input,
|
|
158
158
|
e && "pr-10",
|
|
159
159
|
f && "bg-transparent opacity-60 border-neutral-strong-default text-neutral-medium-disabled",
|
|
160
|
-
|
|
160
|
+
b[c].container,
|
|
161
161
|
X()
|
|
162
162
|
),
|
|
163
163
|
style: U(),
|
|
164
|
-
onChange:
|
|
164
|
+
onChange: N,
|
|
165
165
|
onFocus: k,
|
|
166
166
|
onBlur: I,
|
|
167
167
|
disabled: f,
|
|
168
|
-
required:
|
|
168
|
+
required: z,
|
|
169
169
|
onKeyDown: L,
|
|
170
170
|
onKeyUp: R,
|
|
171
|
-
defaultValue:
|
|
171
|
+
defaultValue: E.defaultValue,
|
|
172
172
|
readOnly: D,
|
|
173
|
-
...
|
|
173
|
+
...E
|
|
174
174
|
}
|
|
175
175
|
),
|
|
176
176
|
/* @__PURE__ */ r.jsx(
|
|
177
177
|
"label",
|
|
178
178
|
{
|
|
179
179
|
ref: O,
|
|
180
|
-
htmlFor:
|
|
180
|
+
htmlFor: g,
|
|
181
181
|
className: t(
|
|
182
182
|
"absolute left-3 pointer-events-none px-1 z-10",
|
|
183
183
|
Y,
|
|
184
184
|
Q(),
|
|
185
|
-
|
|
185
|
+
b[c].label,
|
|
186
186
|
K(),
|
|
187
|
-
|
|
187
|
+
z && "after:content-['*'] after:text-error-default after:ml-1",
|
|
188
188
|
f && "text-neutral-medium-disabled prometeo-fonts-label-large"
|
|
189
189
|
),
|
|
190
190
|
children: o
|
|
@@ -198,20 +198,19 @@ const g = {
|
|
|
198
198
|
className: t(
|
|
199
199
|
`absolute ${m ? "top-[calc(50%-12px)]" : "top-1/2"} -translate-y-1/2 flex items-center justify-center z-10`,
|
|
200
200
|
i[d].icon,
|
|
201
|
-
|
|
201
|
+
b[c].icon,
|
|
202
202
|
s === "password" && !p ? "cursor-pointer" : "pointer-events-none",
|
|
203
203
|
l === "right" ? "right-3" : "left-3"
|
|
204
204
|
),
|
|
205
205
|
onClick: s === "password" && !p ? T : void 0,
|
|
206
206
|
onMouseDown: (Z) => s === "password" && !p && Z.preventDefault(),
|
|
207
|
-
children: /* @__PURE__ */ r.jsxs("div", { children: [
|
|
208
|
-
p && s !== "password"
|
|
209
|
-
s === "password" && (y ? /* @__PURE__ */ r.jsx(_, { size: 24, className: "" }) : /* @__PURE__ */ r.jsx(q, { size: 24, className: "" }))
|
|
210
|
-
e
|
|
207
|
+
children: /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
|
|
208
|
+
p && s !== "password" ? /* @__PURE__ */ r.jsx(le, { variant: "sync", size: "small", className: "size-5" }) : e,
|
|
209
|
+
s === "password" && (y ? /* @__PURE__ */ r.jsx(_, { size: 24, className: "" }) : /* @__PURE__ */ r.jsx(q, { size: 24, className: "" }))
|
|
211
210
|
] })
|
|
212
211
|
}
|
|
213
212
|
),
|
|
214
|
-
|
|
213
|
+
C && /* @__PURE__ */ r.jsx(
|
|
215
214
|
"button",
|
|
216
215
|
{
|
|
217
216
|
type: "button",
|
|
@@ -222,18 +221,18 @@ const g = {
|
|
|
222
221
|
f && "opacity-50 cursor-not-allowed"
|
|
223
222
|
),
|
|
224
223
|
disabled: f,
|
|
225
|
-
onClick:
|
|
224
|
+
onClick: C,
|
|
226
225
|
children: /* @__PURE__ */ r.jsx(V, { size: 20, className: "" })
|
|
227
226
|
}
|
|
228
227
|
),
|
|
229
|
-
m && /* @__PURE__ */ r.jsx("div", { className: "min-h-6", children: (
|
|
228
|
+
m && /* @__PURE__ */ r.jsx("div", { className: "min-h-6", children: (S || G) && /* @__PURE__ */ r.jsx(se, { className: "absolute ", variant: c, children: h || w }) })
|
|
230
229
|
]
|
|
231
230
|
}
|
|
232
231
|
);
|
|
233
232
|
}
|
|
234
233
|
);
|
|
235
|
-
|
|
236
|
-
const me = te(
|
|
234
|
+
v.displayName = "Input";
|
|
235
|
+
const me = te(v);
|
|
237
236
|
export {
|
|
238
237
|
me as I,
|
|
239
238
|
ne as u
|
package/dist/Input.es.js
CHANGED