prometeo-design-system 2.7.1 → 2.7.3
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 +12 -0
- package/dist/Icons.es.js +567 -346
- package/dist/{ImageGallery-DKzJg3un.js → ImageGallery-D8nIvBpV.js} +7 -7
- package/dist/ImageGallery.es.js +1 -1
- package/dist/{Input-C22kKz7U.js → Input-CnXDg2s7.js} +90 -92
- package/dist/Input.es.js +1 -1
- package/dist/InputFormikV2.es.js +30 -18
- package/dist/{Select-C2-CCMwC.js → Select-CiaBY4E0.js} +62 -62
- 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 +5 -6
- package/dist/index-BOQuZ0gG.js +34 -0
- package/dist/index.d.ts +0 -2
- 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/components/Button/ButtonV2.d.ts +0 -23
- package/dist/exports/ButtonV2.d.ts +0 -2
|
@@ -5,7 +5,7 @@ import Ne, { memo as Z, useState as De, useRef as ce, useMemo as oe, useCallback
|
|
|
5
5
|
import Xe from "./Spinner.es.js";
|
|
6
6
|
import { createPortal as Ye } from "react-dom";
|
|
7
7
|
import { u as Ze } from "./useDragScroll-CHN9OMwn.js";
|
|
8
|
-
import { u as et, I as tt } from "./Input-
|
|
8
|
+
import { u as et, I as tt } from "./Input-CnXDg2s7.js";
|
|
9
9
|
import { H as nt } from "./HelperComponent-U6mPwuDH.js";
|
|
10
10
|
import rt from "./CheckBox.es.js";
|
|
11
11
|
import { Skeleton as Fe } from "./Skeleton.es.js";
|
|
@@ -25,10 +25,10 @@ const lt = {
|
|
|
25
25
|
}, qe = {
|
|
26
26
|
icon: " text-neutral-default-disabled",
|
|
27
27
|
container: " border-neutral-strong-default text-neutral-default-disabled"
|
|
28
|
-
}, Ve = ({ id: e, label: n, onRemove:
|
|
28
|
+
}, Ve = ({ id: e, label: n, onRemove: h, className: i, disabled: u, variant: v = "default", tabIndex: m }) => /* @__PURE__ */ s.jsxs(
|
|
29
29
|
"div",
|
|
30
30
|
{
|
|
31
|
-
tabIndex:
|
|
31
|
+
tabIndex: m,
|
|
32
32
|
className: f(
|
|
33
33
|
"inline-flex max-w-[calc(50%-0.25rem)] items-center gap-1 px-2 py-1 bg-inherit text-xs rounded-lg border h-[30px]",
|
|
34
34
|
lt[v].container,
|
|
@@ -36,11 +36,11 @@ const lt = {
|
|
|
36
36
|
),
|
|
37
37
|
children: [
|
|
38
38
|
/* @__PURE__ */ s.jsx("span", { className: "truncate w-max ", children: n }),
|
|
39
|
-
|
|
39
|
+
h && /* @__PURE__ */ s.jsx(
|
|
40
40
|
"button",
|
|
41
41
|
{
|
|
42
42
|
onMouseDown: (j) => {
|
|
43
|
-
u || (j.stopPropagation(), j.preventDefault(),
|
|
43
|
+
u || (j.stopPropagation(), j.preventDefault(), h?.(e));
|
|
44
44
|
},
|
|
45
45
|
className: f(
|
|
46
46
|
"shrink-0 p-0.5 transition-all duration-200 hover:text-neutral-default-hover cursor-pointer z-50 text-neutral-default-default hover:scale-105",
|
|
@@ -48,7 +48,7 @@ const lt = {
|
|
|
48
48
|
i
|
|
49
49
|
),
|
|
50
50
|
type: "button",
|
|
51
|
-
tabIndex:
|
|
51
|
+
tabIndex: m,
|
|
52
52
|
children: /* @__PURE__ */ s.jsx(je.Close, { size: 18, className: f(u && qe.icon) })
|
|
53
53
|
}
|
|
54
54
|
)
|
|
@@ -60,9 +60,9 @@ const ot = Z(Ve);
|
|
|
60
60
|
function G(e, n) {
|
|
61
61
|
if (typeof n == "function")
|
|
62
62
|
return n(e);
|
|
63
|
-
const
|
|
63
|
+
const h = n?.split(".");
|
|
64
64
|
let i = e;
|
|
65
|
-
for (const u of
|
|
65
|
+
for (const u of h)
|
|
66
66
|
if (i && typeof i == "object" && u in i)
|
|
67
67
|
i = i[u];
|
|
68
68
|
else
|
|
@@ -71,11 +71,11 @@ function G(e, n) {
|
|
|
71
71
|
}
|
|
72
72
|
const Ue = (e, n) => {
|
|
73
73
|
if (!n) return !0;
|
|
74
|
-
const
|
|
74
|
+
const h = 0.1, i = String(e).toLowerCase(), u = String(n).toLowerCase().trim();
|
|
75
75
|
if (i.includes(u)) return !0;
|
|
76
|
-
const v = u.split(/\s+/).filter(Boolean),
|
|
77
|
-
if (v.length > 1 ||
|
|
78
|
-
for (const b of
|
|
76
|
+
const v = u.split(/\s+/).filter(Boolean), m = v.filter((b) => /^\d+$/.test(b));
|
|
77
|
+
if (v.length > 1 || m.length > 0) {
|
|
78
|
+
for (const b of m)
|
|
79
79
|
if (!new RegExp(`(^|\\D)${b}(\\D|$)`).test(i)) return !1;
|
|
80
80
|
for (const b of v)
|
|
81
81
|
if (!/^\d+$/.test(b) && !i.includes(b))
|
|
@@ -83,7 +83,7 @@ const Ue = (e, n) => {
|
|
|
83
83
|
return !0;
|
|
84
84
|
}
|
|
85
85
|
if (u.length > i.length) return !1;
|
|
86
|
-
const j = Math.floor(u.length *
|
|
86
|
+
const j = Math.floor(u.length * h);
|
|
87
87
|
if (j <= 0) return !1;
|
|
88
88
|
const p = (b, k) => {
|
|
89
89
|
const I = b.length, W = k.length;
|
|
@@ -107,13 +107,13 @@ const Ue = (e, n) => {
|
|
|
107
107
|
}
|
|
108
108
|
return !1;
|
|
109
109
|
}, st = (e) => {
|
|
110
|
-
const n = [],
|
|
110
|
+
const n = [], h = (i) => {
|
|
111
111
|
i.forEach((u) => {
|
|
112
|
-
const
|
|
113
|
-
Array.isArray(
|
|
112
|
+
const m = u.options;
|
|
113
|
+
Array.isArray(m) && m.length > 0 ? h(m) : n.push(u);
|
|
114
114
|
});
|
|
115
115
|
};
|
|
116
|
-
return
|
|
116
|
+
return h(e), n;
|
|
117
117
|
}, Re = {
|
|
118
118
|
default: {
|
|
119
119
|
container: "",
|
|
@@ -153,9 +153,9 @@ const Ue = (e, n) => {
|
|
|
153
153
|
}
|
|
154
154
|
}, Be = {
|
|
155
155
|
input: f(
|
|
156
|
-
"border-neutral-strong-default text-neutral-default-default",
|
|
157
|
-
"focus:ring-
|
|
158
|
-
"hover:border-
|
|
156
|
+
"border-neutral-strong-default text-neutral-default-default pointer-events-none",
|
|
157
|
+
"focus:ring-0 focus:border-primary-default-disabled ",
|
|
158
|
+
"hover:border-neutral-default-disabled"
|
|
159
159
|
),
|
|
160
160
|
label: f(
|
|
161
161
|
"text-neutral-medium-disabled",
|
|
@@ -167,7 +167,7 @@ const Ue = (e, n) => {
|
|
|
167
167
|
)
|
|
168
168
|
};
|
|
169
169
|
function at(e) {
|
|
170
|
-
const [n,
|
|
170
|
+
const [n, h] = De(!1), [i, u] = De([]), [v, m] = De(""), j = ce(null), p = ce(null), b = ce(null), k = ce(null), I = ce(
|
|
171
171
|
() => {
|
|
172
172
|
}
|
|
173
173
|
), W = ce(null), A = ce(/* @__PURE__ */ new Set()), {
|
|
@@ -194,11 +194,11 @@ function at(e) {
|
|
|
194
194
|
onRemoveOption: ke,
|
|
195
195
|
onOptionClick: X,
|
|
196
196
|
onClose: Se,
|
|
197
|
-
onClear:
|
|
197
|
+
onClear: he,
|
|
198
198
|
disabled: te = !1,
|
|
199
199
|
overflow: Ke = "wrap",
|
|
200
200
|
variant: F = "default",
|
|
201
|
-
isLoading:
|
|
201
|
+
isLoading: me = !1,
|
|
202
202
|
attachToParent: Me = !1,
|
|
203
203
|
displayMode: we = "compact",
|
|
204
204
|
labelVariant: ie = "default",
|
|
@@ -321,7 +321,7 @@ function at(e) {
|
|
|
321
321
|
S
|
|
322
322
|
]
|
|
323
323
|
), L = U(() => {
|
|
324
|
-
|
|
324
|
+
h((t) => !t);
|
|
325
325
|
}, []);
|
|
326
326
|
I.current = (t) => {
|
|
327
327
|
if (!e.multiple)
|
|
@@ -340,11 +340,11 @@ function at(e) {
|
|
|
340
340
|
};
|
|
341
341
|
const y = U(
|
|
342
342
|
(t, a = !1) => {
|
|
343
|
-
X?.(t, S), I.current?.(t), a && (
|
|
343
|
+
X?.(t, S), I.current?.(t), a && (h(!1), Se?.());
|
|
344
344
|
},
|
|
345
345
|
[X, Se, S]
|
|
346
346
|
), R = (t) => {
|
|
347
|
-
t.preventDefault(), t.stopPropagation(), t.target.blur(),
|
|
347
|
+
t.preventDefault(), t.stopPropagation(), t.target.blur(), he?.(), e.multiple ? e.onChange?.([], S) : e.onChange?.(void 0, S);
|
|
348
348
|
}, q = U(
|
|
349
349
|
(t) => {
|
|
350
350
|
e.multiple || e.onChange?.(void 0, S);
|
|
@@ -377,13 +377,13 @@ function at(e) {
|
|
|
377
377
|
const l = a.target;
|
|
378
378
|
if (a.type === "mousedown") {
|
|
379
379
|
if (j.current?.contains(l) || p.current?.contains(l)) return;
|
|
380
|
-
|
|
380
|
+
h(!1);
|
|
381
381
|
}
|
|
382
382
|
if (a.type === "scroll") {
|
|
383
383
|
if (p.current?.contains(l)) return;
|
|
384
|
-
|
|
384
|
+
h(!1);
|
|
385
385
|
}
|
|
386
|
-
a.type === "resize" &&
|
|
386
|
+
a.type === "resize" && h(!1);
|
|
387
387
|
};
|
|
388
388
|
return document.addEventListener("mousedown", t), window.addEventListener("scroll", t, !0), window.addEventListener("resize", t, !0), () => {
|
|
389
389
|
document.removeEventListener("mousedown", t), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t, !0);
|
|
@@ -399,12 +399,12 @@ function at(e) {
|
|
|
399
399
|
V,
|
|
400
400
|
() => ({
|
|
401
401
|
open: () => {
|
|
402
|
-
!n &&
|
|
402
|
+
!n && h(!0);
|
|
403
403
|
},
|
|
404
404
|
close: () => {
|
|
405
|
-
n &&
|
|
405
|
+
n && h(!1);
|
|
406
406
|
},
|
|
407
|
-
toggle: () =>
|
|
407
|
+
toggle: () => h((t) => !t),
|
|
408
408
|
handleOptionSelect: y,
|
|
409
409
|
subscribeOpenChange: (t) => (A.current.add(t), () => {
|
|
410
410
|
A.current.delete(t);
|
|
@@ -414,11 +414,11 @@ function at(e) {
|
|
|
414
414
|
[n, y]
|
|
415
415
|
);
|
|
416
416
|
const be = (t) => {
|
|
417
|
-
t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !ze && !n && (
|
|
417
|
+
t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !ze && !n && (h(!0), setTimeout(() => {
|
|
418
418
|
b.current?.focus();
|
|
419
419
|
}, 10));
|
|
420
420
|
}, ue = (t) => {
|
|
421
|
-
t.key === "Tab" && n &&
|
|
421
|
+
t.key === "Tab" && n && h(!1), (t.keyCode === 32 || t.key === "ArrowDown") && (h(!0), setTimeout(() => {
|
|
422
422
|
b.current?.focus();
|
|
423
423
|
}, 10));
|
|
424
424
|
};
|
|
@@ -510,7 +510,7 @@ function at(e) {
|
|
|
510
510
|
}
|
|
511
511
|
),
|
|
512
512
|
/* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
513
|
-
|
|
513
|
+
me && /* @__PURE__ */ s.jsx(
|
|
514
514
|
Xe,
|
|
515
515
|
{
|
|
516
516
|
size: "small",
|
|
@@ -519,7 +519,7 @@ function at(e) {
|
|
|
519
519
|
speedMultiplier: 0.7
|
|
520
520
|
}
|
|
521
521
|
),
|
|
522
|
-
pe &&
|
|
522
|
+
pe && he && /* @__PURE__ */ s.jsx(
|
|
523
523
|
"button",
|
|
524
524
|
{
|
|
525
525
|
onMouseDown: (t) => {
|
|
@@ -580,9 +580,9 @@ function at(e) {
|
|
|
580
580
|
selectButtonRef: k,
|
|
581
581
|
helperComponentRef: W,
|
|
582
582
|
onOptionClick: y,
|
|
583
|
-
onCloseDropdown: () =>
|
|
583
|
+
onCloseDropdown: () => h(!1),
|
|
584
584
|
searchValue: Ie,
|
|
585
|
-
setSearchValue:
|
|
585
|
+
setSearchValue: m,
|
|
586
586
|
searchInputRef: b,
|
|
587
587
|
isLoading: O?.isLoading,
|
|
588
588
|
onSearchClear: O?.onSearchClear,
|
|
@@ -614,11 +614,11 @@ const it = Z(at, (e, n) => e.value === n.value && e.options === n.options && e.i
|
|
|
614
614
|
function ut({
|
|
615
615
|
footer: e,
|
|
616
616
|
isOpen: n,
|
|
617
|
-
label:
|
|
617
|
+
label: h,
|
|
618
618
|
options: i,
|
|
619
619
|
multiple: u,
|
|
620
620
|
disabled: v,
|
|
621
|
-
selectRef:
|
|
621
|
+
selectRef: m,
|
|
622
622
|
inputProps: j,
|
|
623
623
|
dropdownRef: p,
|
|
624
624
|
optionLabel: b,
|
|
@@ -650,7 +650,7 @@ function ut({
|
|
|
650
650
|
enableGroupToggle: X = !0,
|
|
651
651
|
onGroupSelectChange: Se
|
|
652
652
|
}) {
|
|
653
|
-
const
|
|
653
|
+
const he = e ? 380 : 320, te = W === "static" ? h !== "" ? -20 : 4 : 7, F = U(() => N ? N.endsWith("px") ? Number(N.replace("px", "")) : N.endsWith("vh") ? window.innerHeight * Number(N.replace("vh", "")) / 100 : N.endsWith("%") ? window.innerHeight * Number(N.replace("%", "")) / 100 : he : he, [N, he])(), [me, Me] = De({
|
|
654
654
|
direction: "down",
|
|
655
655
|
height: F
|
|
656
656
|
}), [we, ie] = De(
|
|
@@ -667,9 +667,9 @@ function ut({
|
|
|
667
667
|
},
|
|
668
668
|
[]
|
|
669
669
|
), Le = (r) => {
|
|
670
|
-
if (!p.current || !
|
|
671
|
-
const o =
|
|
672
|
-
switch (r ||
|
|
670
|
+
if (!p.current || !m.current) return;
|
|
671
|
+
const o = m.current.getBoundingClientRect();
|
|
672
|
+
switch (r || me.direction) {
|
|
673
673
|
case "down":
|
|
674
674
|
p.current.style.top = `${o.top + o.height - (Ee?.current?.offsetHeight ? Ee?.current?.offsetHeight + 4 : 0)}px`;
|
|
675
675
|
break;
|
|
@@ -681,12 +681,12 @@ function ut({
|
|
|
681
681
|
}, ne = (r) => {
|
|
682
682
|
p.current && (p.current.style.maxHeight = `${r}px`);
|
|
683
683
|
}, Te = () => {
|
|
684
|
-
if (!p.current || !
|
|
685
|
-
const r =
|
|
684
|
+
if (!p.current || !m.current) return me;
|
|
685
|
+
const r = m.current.getBoundingClientRect(), o = window.innerHeight - (window.innerHeight - r.top), c = window.innerHeight - r.bottom, d = c >= F, w = o >= F;
|
|
686
686
|
let L = "down", y;
|
|
687
687
|
return d ? (L = "down", y = F) : w ? (L = "up", y = F) : c > o ? (L = "down", y = c - 16) : (L = "up", y = o - 16), { direction: L, height: y };
|
|
688
688
|
}, pe = (r) => {
|
|
689
|
-
if (!(!p.current || !
|
|
689
|
+
if (!(!p.current || !m.current)) {
|
|
690
690
|
if (p.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !r) {
|
|
691
691
|
p.current.style.maxHeight = "0", p.current.style.opacity = "0", p.current.style.pointerEvents = "none";
|
|
692
692
|
return;
|
|
@@ -699,7 +699,7 @@ function ut({
|
|
|
699
699
|
}
|
|
700
700
|
};
|
|
701
701
|
ve(() => {
|
|
702
|
-
E || !
|
|
702
|
+
E || !m.current || !n || Le();
|
|
703
703
|
}, [ae]), ve(() => {
|
|
704
704
|
pe(n);
|
|
705
705
|
}, [n]), ve(() => {
|
|
@@ -841,7 +841,7 @@ function ut({
|
|
|
841
841
|
" z-100! w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-lg shadow-lg",
|
|
842
842
|
" overflow-hidden focus-visible:bg-neutral-default-hover ",
|
|
843
843
|
E ? "absolute z-50 " : "fixed z-100 top-0 left-0",
|
|
844
|
-
|
|
844
|
+
me.direction === "up" ? "h-auto" : " h-max",
|
|
845
845
|
Ae
|
|
846
846
|
),
|
|
847
847
|
children: /* @__PURE__ */ s.jsxs(
|
|
@@ -853,7 +853,7 @@ function ut({
|
|
|
853
853
|
),
|
|
854
854
|
style: {
|
|
855
855
|
height: "auto",
|
|
856
|
-
maxHeight:
|
|
856
|
+
maxHeight: me.height
|
|
857
857
|
},
|
|
858
858
|
children: [
|
|
859
859
|
!Ce && /* @__PURE__ */ s.jsx(
|
|
@@ -1023,12 +1023,12 @@ const ct = Z(
|
|
|
1023
1023
|
({
|
|
1024
1024
|
option: e,
|
|
1025
1025
|
isSelected: n,
|
|
1026
|
-
onSelect:
|
|
1026
|
+
onSelect: h,
|
|
1027
1027
|
multiple: i,
|
|
1028
1028
|
disabled: u,
|
|
1029
1029
|
isLoading: v
|
|
1030
1030
|
}) => {
|
|
1031
|
-
const
|
|
1031
|
+
const m = e.isGroupHeader;
|
|
1032
1032
|
if (v)
|
|
1033
1033
|
return /* @__PURE__ */ s.jsxs(
|
|
1034
1034
|
"div",
|
|
@@ -1042,8 +1042,8 @@ const ct = Z(
|
|
|
1042
1042
|
e.id
|
|
1043
1043
|
);
|
|
1044
1044
|
const j = (b) => {
|
|
1045
|
-
b.preventDefault(), b.stopPropagation(), !(u ||
|
|
1046
|
-
}, p =
|
|
1045
|
+
b.preventDefault(), b.stopPropagation(), !(u || m) && h?.(e);
|
|
1046
|
+
}, p = m && e.groupLabelNode ? e.groupLabelNode : e.label;
|
|
1047
1047
|
return (
|
|
1048
1048
|
// biome-ignore lint/a11y/noStaticElementInteractions: no keyboard interaction needed
|
|
1049
1049
|
/* @__PURE__ */ s.jsxs(
|
|
@@ -1052,12 +1052,12 @@ const ct = Z(
|
|
|
1052
1052
|
onMouseDown: j,
|
|
1053
1053
|
className: f(
|
|
1054
1054
|
"px-3 py-2 flex items-center transition-colors text-neutral-default-default ",
|
|
1055
|
-
|
|
1056
|
-
!
|
|
1057
|
-
u && !
|
|
1055
|
+
m ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
|
|
1056
|
+
!m && (n ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover"),
|
|
1057
|
+
u && !m && "text-neutral-default-disabled hover:bg-neutral-default-default"
|
|
1058
1058
|
),
|
|
1059
1059
|
children: [
|
|
1060
|
-
i && !
|
|
1060
|
+
i && !m && /* @__PURE__ */ s.jsx(rt, { checked: n, disabled: u }),
|
|
1061
1061
|
/* @__PURE__ */ s.jsx("span", { children: p })
|
|
1062
1062
|
]
|
|
1063
1063
|
},
|
|
@@ -1072,19 +1072,19 @@ const Je = Z(
|
|
|
1072
1072
|
({
|
|
1073
1073
|
selectedOptions: e,
|
|
1074
1074
|
placeholder: n,
|
|
1075
|
-
onRemoveOption:
|
|
1075
|
+
onRemoveOption: h,
|
|
1076
1076
|
displayMode: i,
|
|
1077
1077
|
multiple: u,
|
|
1078
1078
|
className: v,
|
|
1079
|
-
disabled:
|
|
1079
|
+
disabled: m
|
|
1080
1080
|
}) => e?.length === 0 ? n ? /* @__PURE__ */ s.jsx("span", { className: "text-neutral-medium-default opacity-50", children: n }) : null : i === "chips" && u ? /* @__PURE__ */ s.jsx("div", { className: f("flex items-center gap-1 ", v), children: e.map((j) => /* @__PURE__ */ s.jsx(
|
|
1081
1081
|
ot,
|
|
1082
1082
|
{
|
|
1083
1083
|
tabIndex: -1,
|
|
1084
1084
|
id: j.id,
|
|
1085
1085
|
label: j.label,
|
|
1086
|
-
onRemove:
|
|
1087
|
-
disabled:
|
|
1086
|
+
onRemove: h,
|
|
1087
|
+
disabled: m
|
|
1088
1088
|
},
|
|
1089
1089
|
j.id
|
|
1090
1090
|
)) }) : e?.length === 1 ? /* @__PURE__ */ s.jsx("span", { children: e[0].label }) : /* @__PURE__ */ s.jsxs("span", { children: [
|
package/dist/Select.es.js
CHANGED
package/dist/SelectFormik.es.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as c } from "./jsx-runtime-DKDX3adD.js";
|
|
2
2
|
import { useField as y } from "formik";
|
|
3
|
-
import { S as m } from "./Select-
|
|
3
|
+
import { S as m } from "./Select-CiaBY4E0.js";
|
|
4
4
|
import { useRef as p, useEffect as g } from "react";
|
|
5
5
|
function f(e) {
|
|
6
6
|
return Array.isArray(e) && e.every(
|
|
7
|
-
(
|
|
7
|
+
(l) => typeof l == "string" || typeof l == "number"
|
|
8
8
|
);
|
|
9
9
|
}
|
|
10
10
|
function v(e) {
|
|
11
11
|
return e == null || typeof e == "string" || typeof e == "number";
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
const [
|
|
13
|
+
const S = (e) => {
|
|
14
|
+
const [l, a, r] = y(e.name), u = p(!1), o = Array.isArray(l.value);
|
|
15
15
|
if (g(() => {
|
|
16
|
-
u.current || (u.current = !0, o ? f(
|
|
16
|
+
u.current || (u.current = !0, o ? f(l.value) || (console.warn(
|
|
17
17
|
`SelectFormik: El valor del campo "${e.name}" no es un array válido de string | number. Valor recibido:`,
|
|
18
|
-
|
|
18
|
+
l.value,
|
|
19
19
|
"Inicializando como array vacío."
|
|
20
|
-
),
|
|
20
|
+
), r.setValue([])) : v(l.value) || (console.warn(
|
|
21
21
|
`SelectFormik: El valor del campo "${e.name}" no es un valor válido (string | number | null). Valor recibido:`,
|
|
22
|
-
|
|
22
|
+
l.value,
|
|
23
23
|
"Inicializando como null."
|
|
24
|
-
),
|
|
25
|
-
}, [
|
|
26
|
-
const n = (
|
|
27
|
-
|
|
28
|
-
}, i = f(
|
|
29
|
-
return /* @__PURE__ */
|
|
24
|
+
), r.setValue(null)));
|
|
25
|
+
}, [l.value, r, e.name, o]), o) {
|
|
26
|
+
const n = (d) => {
|
|
27
|
+
r.setValue(d.map((s) => s.value));
|
|
28
|
+
}, i = f(l.value) ? l.value : [], t = e?.displayMode || "chips";
|
|
29
|
+
return /* @__PURE__ */ c.jsx(
|
|
30
30
|
m,
|
|
31
31
|
{
|
|
32
32
|
...e,
|
|
@@ -40,9 +40,9 @@ const b = (e) => {
|
|
|
40
40
|
);
|
|
41
41
|
} else {
|
|
42
42
|
const n = (s) => {
|
|
43
|
-
|
|
44
|
-
}, i = v(
|
|
45
|
-
return /* @__PURE__ */
|
|
43
|
+
r.setValue(s?.value ?? null);
|
|
44
|
+
}, i = v(l.value) ? l.value : void 0, { ...t } = e;
|
|
45
|
+
return /* @__PURE__ */ c.jsx(
|
|
46
46
|
m,
|
|
47
47
|
{
|
|
48
48
|
...t,
|
|
@@ -51,11 +51,12 @@ const b = (e) => {
|
|
|
51
51
|
value: i,
|
|
52
52
|
onChange: n,
|
|
53
53
|
variant: a.error ? "error" : "default",
|
|
54
|
-
errorComponent: a.error || void 0
|
|
54
|
+
errorComponent: a.error || void 0,
|
|
55
|
+
disabled: e.disabled
|
|
55
56
|
}
|
|
56
57
|
);
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
+
S as default
|
|
61
62
|
};
|
package/dist/SelectSearch.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as G } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import { g as i, S as H } from "./Select-
|
|
2
|
+
import { g as i, S as H } from "./Select-CiaBY4E0.js";
|
|
3
3
|
import { useState as T, useRef as I, useEffect as h, useMemo as Q, useCallback as X } from "react";
|
|
4
4
|
function te(e) {
|
|
5
5
|
const {
|
package/dist/Switch.es.js
CHANGED
|
@@ -52,22 +52,22 @@ const l = ({ name: d, value: o, onChange: f, disabled: t = !1 }) => {
|
|
|
52
52
|
/* @__PURE__ */ a.jsx(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
|
+
onClick: h,
|
|
55
56
|
className: r(
|
|
56
|
-
"w-14 h-8 rounded-full relative px-2",
|
|
57
|
+
"w-14 h-8 rounded-full relative px-2 cursor-pointer",
|
|
58
|
+
t && "cursor-default",
|
|
57
59
|
i[e][s].container
|
|
58
60
|
),
|
|
59
61
|
children: /* @__PURE__ */ a.jsx(
|
|
60
62
|
c.span,
|
|
61
63
|
{
|
|
62
|
-
onClick: h,
|
|
63
64
|
animate: m[e],
|
|
64
65
|
whileHover: t ? {} : {
|
|
65
66
|
background: e === "off" ? "rgba(29, 27, 32, 0.08)" : "rgba(101, 85, 143, 0.12)"
|
|
66
67
|
},
|
|
67
68
|
className: r(
|
|
68
69
|
"absolute top-1/2 -translate-y-1/2 grid place-items-center ",
|
|
69
|
-
"size-10 aspect-square rounded-full absolute top-1/2 -translate-y-1/2"
|
|
70
|
-
"cursor-pointer"
|
|
70
|
+
"size-10 aspect-square rounded-full absolute top-1/2 -translate-y-1/2"
|
|
71
71
|
),
|
|
72
72
|
children: /* @__PURE__ */ a.jsx(
|
|
73
73
|
c.span,
|
package/dist/Toast.es.js
CHANGED
|
@@ -3,7 +3,7 @@ import b from "react";
|
|
|
3
3
|
import { toast as p } from "sonner";
|
|
4
4
|
import { Icons as m } from "./Icons.es.js";
|
|
5
5
|
import { c as s } from "./cn-B6yFEsav.js";
|
|
6
|
-
import
|
|
6
|
+
import u from "./Button.es.js";
|
|
7
7
|
const x = {
|
|
8
8
|
dark: {
|
|
9
9
|
success: {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type SizeVariant = "xxxs" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
2
|
+
interface IAvatar {
|
|
2
3
|
imageUrl?: string;
|
|
3
|
-
sizeImage?:
|
|
4
|
-
sizeFallback?:
|
|
4
|
+
sizeImage?: SizeVariant;
|
|
5
|
+
sizeFallback?: SizeVariant;
|
|
5
6
|
fallbackText?: string;
|
|
6
|
-
|
|
7
|
+
subImageUrl?: string;
|
|
8
|
+
borderColor?: string;
|
|
9
|
+
}
|
|
10
|
+
export default function Avatar({ imageUrl, sizeImage, sizeFallback, fallbackText, subImageUrl, borderColor, }: IAvatar): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
variant?: "text" | "outline" | "filled" | null | undefined;
|
|
4
|
-
color?: "primary" | "secondary" | null | undefined;
|
|
5
|
-
size?: "small" | "medium" | "large" | null | undefined;
|
|
6
|
-
disabled?: boolean | null | undefined;
|
|
7
|
-
loading?: boolean | null | undefined;
|
|
8
|
-
customSize?: boolean | null | undefined;
|
|
9
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
-
export interface ButtonProps extends VariantProps<typeof buttonVariants> {
|
|
1
|
+
import { ButtonVariant, ColorVariant, SizeVariant } from '../Shared/types';
|
|
2
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
11
3
|
label?: string;
|
|
12
4
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
5
|
icon?: React.ReactNode;
|
|
@@ -17,13 +9,15 @@ export interface ButtonProps extends VariantProps<typeof buttonVariants> {
|
|
|
17
9
|
animateIcon?: boolean;
|
|
18
10
|
isLoading?: boolean;
|
|
19
11
|
children?: React.ReactNode;
|
|
20
|
-
|
|
12
|
+
spinner?: React.ReactNode;
|
|
21
13
|
type?: 'button' | "submit" | "reset";
|
|
22
14
|
className?: string;
|
|
23
15
|
disabled?: boolean;
|
|
24
|
-
variant?:
|
|
16
|
+
variant?: ButtonVariant;
|
|
25
17
|
form?: string;
|
|
18
|
+
size?: SizeVariant;
|
|
19
|
+
color?: ColorVariant;
|
|
20
|
+
hideSpinner?: boolean;
|
|
26
21
|
}
|
|
27
|
-
declare
|
|
28
|
-
declare const _default: import('react').MemoExoticComponent<typeof Button>;
|
|
22
|
+
declare const _default: import('react').MemoExoticComponent<({ label, onClick, icon, contentClassName, loadingText, animate, animateIcon, isLoading, children, hideSpinner, spinner, type, className, disabled, variant, form, size, color }: ButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
29
23
|
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const buttonVariants: (props?: ({
|
|
3
|
+
variant?: "text" | "outline" | "filled" | null | undefined;
|
|
4
|
+
color?: "primary" | "secondary" | null | undefined;
|
|
5
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
|
6
|
+
disabled?: boolean | null | undefined;
|
|
7
|
+
loading?: boolean | null | undefined;
|
|
8
|
+
customSize?: boolean | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
export interface ButtonProps extends VariantProps<typeof buttonVariants> {
|
|
11
|
+
label?: string;
|
|
12
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
contentClassName?: string;
|
|
15
|
+
loadingText?: string;
|
|
16
|
+
animate?: boolean;
|
|
17
|
+
animateIcon?: boolean;
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
Spinner?: React.ReactNode;
|
|
21
|
+
type?: 'button' | "submit" | "reset";
|
|
22
|
+
className?: string;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
variant?: "filled" | "outline" | "text";
|
|
25
|
+
form?: string;
|
|
26
|
+
}
|
|
27
|
+
declare function Button({ label, onClick, icon, contentClassName, loadingText, animate, animateIcon, isLoading, disabled, type, variant, color, size, children, Spinner, className, form, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare const _default: import('react').MemoExoticComponent<typeof Button>;
|
|
29
|
+
export default _default;
|
|
@@ -7,11 +7,10 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
7
7
|
iconPosition?: "left" | "right";
|
|
8
8
|
isFetching?: boolean;
|
|
9
9
|
id?: string;
|
|
10
|
-
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
10
|
value?: string;
|
|
12
11
|
width?: string;
|
|
13
12
|
height?: string;
|
|
14
|
-
name
|
|
13
|
+
name?: string;
|
|
15
14
|
variant?: InputVariant;
|
|
16
15
|
labelVariant?: LabelVariant;
|
|
17
16
|
size?: InputSize;
|
|
@@ -22,14 +21,14 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
22
21
|
placeholder?: string;
|
|
23
22
|
required?: boolean;
|
|
24
23
|
className?: string;
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
readOnly?: boolean;
|
|
26
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
27
|
+
onClear?: () => void;
|
|
25
28
|
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
26
29
|
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
27
30
|
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
28
31
|
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
29
|
-
isActive?: boolean;
|
|
30
|
-
style?: React.CSSProperties;
|
|
31
|
-
readOnly?: boolean;
|
|
32
|
-
onClear?: () => void;
|
|
33
32
|
}
|
|
34
33
|
declare const _default: import('react').NamedExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
35
34
|
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { clsx as O } from "clsx";
|
|
2
|
+
const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j = (e, l) => (n) => {
|
|
3
|
+
var u;
|
|
4
|
+
if (l?.variants == null) return y(e, n?.class, n?.className);
|
|
5
|
+
const { variants: r, defaultVariants: d } = l, V = Object.keys(r).map((t) => {
|
|
6
|
+
const a = n?.[t], s = d?.[t];
|
|
7
|
+
if (a === null) return null;
|
|
8
|
+
const i = m(a) || m(s);
|
|
9
|
+
return r[t][i];
|
|
10
|
+
}), v = n && Object.entries(n).reduce((t, a) => {
|
|
11
|
+
let [s, i] = a;
|
|
12
|
+
return i === void 0 || (t[s] = i), t;
|
|
13
|
+
}, {}), N = l == null || (u = l.compoundVariants) === null || u === void 0 ? void 0 : u.reduce((t, a) => {
|
|
14
|
+
let { class: s, className: i, ...f } = a;
|
|
15
|
+
return Object.entries(f).every((C) => {
|
|
16
|
+
let [c, o] = C;
|
|
17
|
+
return Array.isArray(o) ? o.includes({
|
|
18
|
+
...d,
|
|
19
|
+
...v
|
|
20
|
+
}[c]) : {
|
|
21
|
+
...d,
|
|
22
|
+
...v
|
|
23
|
+
}[c] === o;
|
|
24
|
+
}) ? [
|
|
25
|
+
...t,
|
|
26
|
+
s,
|
|
27
|
+
i
|
|
28
|
+
] : t;
|
|
29
|
+
}, []);
|
|
30
|
+
return y(e, V, N, n?.class, n?.className);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
j as c
|
|
34
|
+
};
|