prometeo-design-system 2.7.8 → 2.7.9
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 +5 -5
- package/dist/{CardProfile-WHoeSibd.js → CardProfile-DV3gwvqE.js} +24 -24
- package/dist/CardProfile.es.js +1 -1
- package/dist/CheckBox.es.js +60 -60
- package/dist/CheckboxFormik.es.js +2 -2
- package/dist/DatePicker.es.js +68 -68
- package/dist/DrawerDesktop.es.js +4 -4
- package/dist/DropZone.es.js +32 -32
- package/dist/FAButton.es.js +2 -2
- package/dist/HelperComponent-U6mPwuDH.js +24 -0
- package/dist/Icons/Icons.d.ts +1 -61
- package/dist/Icons.es.js +8 -68
- package/dist/{ImageGallery-WKzUevOQ.js → ImageGallery-D8nIvBpV.js} +43 -43
- package/dist/ImageGallery.es.js +1 -1
- package/dist/{Input-D6as6xD-.js → Input-60IT1aGF.js} +61 -61
- package/dist/Input.es.js +1 -1
- package/dist/InputFormik.es.js +32 -32
- package/dist/InputFormikV2.es.js +1 -1
- package/dist/InputMultiple.es.js +51 -51
- package/dist/Logo.es.js +3 -3
- package/dist/Menu.es.js +2 -2
- package/dist/OtpInput.es.js +42 -42
- package/dist/Pagination.es.js +1 -1
- package/dist/RadioButton.es.js +1 -1
- package/dist/{Select-sdfP2TL0.js → Select-C4UvSsof.js} +164 -164
- package/dist/Select.es.js +1 -1
- package/dist/SelectFormik.es.js +1 -1
- package/dist/SelectFormikLegacy.es.js +25 -25
- package/dist/SelectSearch.es.js +1 -1
- package/dist/Steps.es.js +14 -14
- package/dist/TabLinks.es.js +2 -2
- package/dist/Table.es.js +2 -2
- package/dist/Toast.es.js +23 -23
- package/dist/Tooltip.es.js +7 -7
- package/dist/components/CheckBox/CheckBox.d.ts +5 -4
- package/dist/components/Toaster/Toaster.d.ts +3 -3
- package/dist/exports/Icons.d.ts +1 -1
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +125 -126
- package/package.json +1 -1
- package/dist/HelperComponent-BeNlTMqI.js +0 -24
- package/dist/components/Spinner/SpinnerV2.d.ts +0 -12
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Icons as je } from "./Icons.es.js";
|
|
3
3
|
import { c as f } from "./cn-B6yFEsav.js";
|
|
4
|
-
import Ne, { memo as Z, useState as De, useRef as ce, useMemo as oe, useCallback as U, useEffect as ve, useImperativeHandle as
|
|
5
|
-
import
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import { H as
|
|
10
|
-
import
|
|
11
|
-
import { Skeleton as
|
|
12
|
-
const
|
|
4
|
+
import Ne, { memo as Z, useState as De, useRef as ce, useMemo as oe, useCallback as U, useEffect as ve, useImperativeHandle as Qe } from "react";
|
|
5
|
+
import Xe from "./Spinner.es.js";
|
|
6
|
+
import { createPortal as Ye } from "react-dom";
|
|
7
|
+
import { u as Ze } from "./useDragScroll-CHN9OMwn.js";
|
|
8
|
+
import { u as et, I as tt } from "./Input-60IT1aGF.js";
|
|
9
|
+
import { H as nt } from "./HelperComponent-U6mPwuDH.js";
|
|
10
|
+
import rt from "./CheckBox.es.js";
|
|
11
|
+
import { Skeleton as Fe } from "./Skeleton.es.js";
|
|
12
|
+
const lt = {
|
|
13
13
|
default: {
|
|
14
14
|
container: "text-neutral-default-default border-neutral-default-default ",
|
|
15
15
|
icon: ""
|
|
@@ -22,25 +22,25 @@ const at = {
|
|
|
22
22
|
container: "",
|
|
23
23
|
icon: ""
|
|
24
24
|
}
|
|
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
|
-
|
|
35
|
-
u &&
|
|
34
|
+
lt[v].container,
|
|
35
|
+
u && qe.container
|
|
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,34 +48,34 @@ const at = {
|
|
|
48
48
|
i
|
|
49
49
|
),
|
|
50
50
|
type: "button",
|
|
51
|
-
tabIndex:
|
|
52
|
-
children: /* @__PURE__ */ s.jsx(
|
|
51
|
+
tabIndex: m,
|
|
52
|
+
children: /* @__PURE__ */ s.jsx(je.Close, { size: 18, className: f(u && qe.icon) })
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
55
|
]
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
Ve.displayName = "Chip";
|
|
59
|
-
const
|
|
59
|
+
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
|
|
69
69
|
return;
|
|
70
70
|
return i;
|
|
71
71
|
}
|
|
72
|
-
const
|
|
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 qe = (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;
|
|
@@ -106,15 +106,15 @@ const qe = (e, n) => {
|
|
|
106
106
|
if (p(k, u) <= j) return !0;
|
|
107
107
|
}
|
|
108
108
|
return !1;
|
|
109
|
-
},
|
|
110
|
-
const n = [],
|
|
109
|
+
}, st = (e) => {
|
|
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
|
|
117
|
-
},
|
|
116
|
+
return h(e), n;
|
|
117
|
+
}, Re = {
|
|
118
118
|
default: {
|
|
119
119
|
container: "",
|
|
120
120
|
input: f(
|
|
@@ -151,7 +151,7 @@ const qe = (e, n) => {
|
|
|
151
151
|
label: f("text-success", "peer-focus:text-success-light"),
|
|
152
152
|
icon: f("text-success-medium-default", "peer-focus:text-success-light")
|
|
153
153
|
}
|
|
154
|
-
},
|
|
154
|
+
}, Be = {
|
|
155
155
|
input: f(
|
|
156
156
|
"border-neutral-strong-default text-neutral-default-default pointer-events-none",
|
|
157
157
|
"focus:ring-0 focus:border-primary-default-disabled ",
|
|
@@ -166,8 +166,8 @@ const qe = (e, n) => {
|
|
|
166
166
|
"peer-focus:text-primary-default-default"
|
|
167
167
|
)
|
|
168
168
|
};
|
|
169
|
-
function
|
|
170
|
-
const [n,
|
|
169
|
+
function at(e) {
|
|
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()), {
|
|
@@ -183,34 +183,34 @@ function ct(e) {
|
|
|
183
183
|
optionLabel: de,
|
|
184
184
|
renderOption: J,
|
|
185
185
|
renderOptionGroupHeader: fe,
|
|
186
|
-
renderSelection:
|
|
187
|
-
renderOptionContext:
|
|
188
|
-
buttonClassName:
|
|
186
|
+
renderSelection: He,
|
|
187
|
+
renderOptionContext: Ae,
|
|
188
|
+
buttonClassName: Ee,
|
|
189
189
|
dropdownClassName: ae,
|
|
190
190
|
containerClassName: Q,
|
|
191
191
|
dropdownOptions: O,
|
|
192
192
|
helperComponent: ee,
|
|
193
193
|
errorComponent: Ce,
|
|
194
|
-
onRemoveOption:
|
|
194
|
+
onRemoveOption: ke,
|
|
195
195
|
onOptionClick: X,
|
|
196
196
|
onClose: Se,
|
|
197
|
-
onClear:
|
|
197
|
+
onClear: he,
|
|
198
198
|
disabled: te = !1,
|
|
199
|
-
overflow:
|
|
199
|
+
overflow: Ke = "wrap",
|
|
200
200
|
variant: F = "default",
|
|
201
|
-
isLoading:
|
|
202
|
-
attachToParent:
|
|
201
|
+
isLoading: me = !1,
|
|
202
|
+
attachToParent: Me = !1,
|
|
203
203
|
displayMode: we = "compact",
|
|
204
204
|
labelVariant: ie = "default",
|
|
205
|
-
disableOpenOnFocus:
|
|
206
|
-
emptyMessage:
|
|
207
|
-
} = e, { ref:
|
|
205
|
+
disableOpenOnFocus: ze = !1,
|
|
206
|
+
emptyMessage: Oe = "No hay opciones disponibles"
|
|
207
|
+
} = e, { ref: Le } = et(), { bind: ne, ref: Te } = Ze({
|
|
208
208
|
axis: "x",
|
|
209
209
|
cursor: { idle: "default", dragging: "grabbing" }
|
|
210
|
-
}), pe = e.multiple ? Array.isArray(e.value) && e.value.length > 0 : e.value !== void 0 && e.value !== null && e.value !== "",
|
|
210
|
+
}), pe = e.multiple ? Array.isArray(e.value) && e.value.length > 0 : e.value !== void 0 && e.value !== null && e.value !== "", Ge = {}, $e = oe(() => ie === "static" && N ? N : "", [ie, N]), Ie = oe(
|
|
211
211
|
() => O?.controledSearchValue || v,
|
|
212
212
|
[O?.controledSearchValue, v]
|
|
213
|
-
),
|
|
213
|
+
), Pe = () => {
|
|
214
214
|
const t = {
|
|
215
215
|
static: {
|
|
216
216
|
active: "relative prometeo-fonts-label-large",
|
|
@@ -229,7 +229,7 @@ function ct(e) {
|
|
|
229
229
|
label: G(t, de)
|
|
230
230
|
}),
|
|
231
231
|
[E, de]
|
|
232
|
-
), Y = oe(() =>
|
|
232
|
+
), Y = oe(() => st(K), [K]), ge = oe(
|
|
233
233
|
() => Y.map(T),
|
|
234
234
|
[Y, T]
|
|
235
235
|
), r = oe(() => {
|
|
@@ -286,8 +286,8 @@ function ct(e) {
|
|
|
286
286
|
const C = l[0];
|
|
287
287
|
if (!C) return;
|
|
288
288
|
const D = c.has(C.id), B = a ?? "toggle";
|
|
289
|
-
let
|
|
290
|
-
B === "select" || B === "toggle" && !D ?
|
|
289
|
+
let _e;
|
|
290
|
+
B === "select" || B === "toggle" && !D ? _e = C : _e = void 0, e.onChange?.(_e, S);
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
293
|
const g = e.value || [], H = [];
|
|
@@ -321,7 +321,7 @@ function ct(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 ct(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);
|
|
@@ -353,11 +353,11 @@ function ct(e) {
|
|
|
353
353
|
);
|
|
354
354
|
if (!a) return;
|
|
355
355
|
const l = T(a);
|
|
356
|
-
X?.(l, S), I.current?.(l),
|
|
356
|
+
X?.(l, S), I.current?.(l), ke?.(a);
|
|
357
357
|
},
|
|
358
358
|
[
|
|
359
359
|
X,
|
|
360
|
-
|
|
360
|
+
ke,
|
|
361
361
|
Y,
|
|
362
362
|
S,
|
|
363
363
|
e.multiple,
|
|
@@ -377,13 +377,13 @@ function ct(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);
|
|
@@ -395,16 +395,16 @@ function ct(e) {
|
|
|
395
395
|
} catch {
|
|
396
396
|
}
|
|
397
397
|
});
|
|
398
|
-
}, [n]),
|
|
398
|
+
}, [n]), Qe(
|
|
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 ct(e) {
|
|
|
414
414
|
[n, y]
|
|
415
415
|
);
|
|
416
416
|
const be = (t) => {
|
|
417
|
-
t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !
|
|
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
|
};
|
|
@@ -428,20 +428,20 @@ function ct(e) {
|
|
|
428
428
|
className: f("relative bg-inherit select-none w-full", z),
|
|
429
429
|
ref: j,
|
|
430
430
|
draggable: !1,
|
|
431
|
-
style:
|
|
431
|
+
style: Ge,
|
|
432
432
|
children: [
|
|
433
433
|
/* @__PURE__ */ s.jsxs("div", { className: f("relative bg-inherit ", Q), children: [
|
|
434
434
|
/* @__PURE__ */ s.jsx(
|
|
435
435
|
"label",
|
|
436
436
|
{
|
|
437
437
|
htmlFor: x,
|
|
438
|
-
ref:
|
|
438
|
+
ref: Le,
|
|
439
439
|
className: f(
|
|
440
440
|
"left-3 pointer-events-none bg-inherit z-10",
|
|
441
441
|
ie === "default" && "transition-all duration-200 ease-in-out",
|
|
442
|
-
|
|
443
|
-
pe || n ?
|
|
444
|
-
te &&
|
|
442
|
+
Pe(),
|
|
443
|
+
pe || n ? Re[F].label : "text-neutral-medium-default",
|
|
444
|
+
te && Be.label
|
|
445
445
|
),
|
|
446
446
|
children: M
|
|
447
447
|
}
|
|
@@ -463,9 +463,9 @@ function ct(e) {
|
|
|
463
463
|
"flex items-center justify-start bg-inherit ",
|
|
464
464
|
"focus:outline-none",
|
|
465
465
|
we === "chips" && e.multiple && pe ? "min-h-12 py-2 " : !se && "h-12 min-h-12",
|
|
466
|
-
|
|
467
|
-
te &&
|
|
468
|
-
|
|
466
|
+
Re[F].input,
|
|
467
|
+
te && Be.input,
|
|
468
|
+
Ee
|
|
469
469
|
),
|
|
470
470
|
children: [
|
|
471
471
|
/* @__PURE__ */ s.jsx(
|
|
@@ -474,16 +474,16 @@ function ct(e) {
|
|
|
474
474
|
className: f(
|
|
475
475
|
"flex-1 overflow-x-auto overflow-y-hidden px-1 prometeo-scrollbar-none "
|
|
476
476
|
),
|
|
477
|
-
ref:
|
|
477
|
+
ref: Te,
|
|
478
478
|
onPointerUp: ne.onPointerUp,
|
|
479
479
|
onPointerDown: ne.onPointerDown,
|
|
480
480
|
onPointerMove: ne.onPointerMove,
|
|
481
481
|
onPointerLeave: ne.onPointerLeave,
|
|
482
482
|
onPointerCancel: ne.onPointerCancel,
|
|
483
483
|
onClickCapture: ne.onClickCapture,
|
|
484
|
-
children:
|
|
484
|
+
children: He ? Ne.createElement(
|
|
485
485
|
Z(
|
|
486
|
-
|
|
486
|
+
He,
|
|
487
487
|
(t, a) => t.disabled === a.disabled && t.multiple === a.multiple
|
|
488
488
|
),
|
|
489
489
|
{
|
|
@@ -498,11 +498,11 @@ function ct(e) {
|
|
|
498
498
|
{
|
|
499
499
|
displayMode: we,
|
|
500
500
|
selectedOptions: o,
|
|
501
|
-
placeholder:
|
|
501
|
+
placeholder: $e,
|
|
502
502
|
onRemoveOption: q,
|
|
503
503
|
multiple: e.multiple || !1,
|
|
504
504
|
className: f(
|
|
505
|
-
|
|
505
|
+
Ke === "scroll" ? "flex-nowrap" : "flex-wrap"
|
|
506
506
|
),
|
|
507
507
|
disabled: te
|
|
508
508
|
}
|
|
@@ -510,8 +510,8 @@ function ct(e) {
|
|
|
510
510
|
}
|
|
511
511
|
),
|
|
512
512
|
/* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
513
|
-
|
|
514
|
-
|
|
513
|
+
me && /* @__PURE__ */ s.jsx(
|
|
514
|
+
Xe,
|
|
515
515
|
{
|
|
516
516
|
size: "small",
|
|
517
517
|
variant: "clip",
|
|
@@ -519,7 +519,7 @@ function ct(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) => {
|
|
@@ -528,25 +528,25 @@ function ct(e) {
|
|
|
528
528
|
type: "button",
|
|
529
529
|
tabIndex: -1,
|
|
530
530
|
children: /* @__PURE__ */ s.jsx(
|
|
531
|
-
|
|
531
|
+
je.Cancel,
|
|
532
532
|
{
|
|
533
533
|
size: 20,
|
|
534
534
|
className: f(
|
|
535
535
|
" cursor-pointer transition-all",
|
|
536
|
-
|
|
536
|
+
Re[F].icon
|
|
537
537
|
)
|
|
538
538
|
}
|
|
539
539
|
)
|
|
540
540
|
}
|
|
541
541
|
),
|
|
542
542
|
/* @__PURE__ */ s.jsx(
|
|
543
|
-
|
|
543
|
+
je.ChevronDown,
|
|
544
544
|
{
|
|
545
545
|
size: 20,
|
|
546
546
|
className: f(
|
|
547
547
|
"transition-transform text-neutral-default-default",
|
|
548
548
|
n ? "rotate-180" : "",
|
|
549
|
-
te &&
|
|
549
|
+
te && Be.icon
|
|
550
550
|
)
|
|
551
551
|
}
|
|
552
552
|
)
|
|
@@ -556,33 +556,33 @@ function ct(e) {
|
|
|
556
556
|
)
|
|
557
557
|
] }),
|
|
558
558
|
n && /* @__PURE__ */ s.jsx(
|
|
559
|
-
|
|
559
|
+
ct,
|
|
560
560
|
{
|
|
561
561
|
label: M,
|
|
562
562
|
isOpen: n,
|
|
563
563
|
disabled: te,
|
|
564
564
|
optionValue: E,
|
|
565
565
|
optionLabel: de,
|
|
566
|
-
emptyMessage:
|
|
566
|
+
emptyMessage: Oe,
|
|
567
567
|
labelVariant: ie,
|
|
568
568
|
renderOption: J,
|
|
569
569
|
renderOptionGroupHeader: fe,
|
|
570
|
-
attachToParent:
|
|
570
|
+
attachToParent: Me,
|
|
571
571
|
filteredOptions: i,
|
|
572
572
|
multiple: e.multiple || !1,
|
|
573
573
|
dropdownClassName: ae,
|
|
574
574
|
selectedOptionsIds: c,
|
|
575
575
|
setFilteredOptions: u,
|
|
576
|
-
renderOptionContext:
|
|
576
|
+
renderOptionContext: Ae,
|
|
577
577
|
options: d,
|
|
578
578
|
selectRef: j,
|
|
579
579
|
dropdownRef: p,
|
|
580
580
|
selectButtonRef: k,
|
|
581
581
|
helperComponentRef: W,
|
|
582
582
|
onOptionClick: y,
|
|
583
|
-
onCloseDropdown: () =>
|
|
584
|
-
searchValue:
|
|
585
|
-
setSearchValue:
|
|
583
|
+
onCloseDropdown: () => h(!1),
|
|
584
|
+
searchValue: Ie,
|
|
585
|
+
setSearchValue: m,
|
|
586
586
|
searchInputRef: b,
|
|
587
587
|
isLoading: O?.isLoading,
|
|
588
588
|
onSearchClear: O?.onSearchClear,
|
|
@@ -598,7 +598,7 @@ function ct(e) {
|
|
|
598
598
|
}
|
|
599
599
|
),
|
|
600
600
|
(Ce || ee) && /* @__PURE__ */ s.jsx("div", { className: "min-h-6", children: /* @__PURE__ */ s.jsx(
|
|
601
|
-
|
|
601
|
+
nt,
|
|
602
602
|
{
|
|
603
603
|
ref: W,
|
|
604
604
|
variant: F,
|
|
@@ -610,15 +610,15 @@ function ct(e) {
|
|
|
610
610
|
}
|
|
611
611
|
);
|
|
612
612
|
}
|
|
613
|
-
const
|
|
614
|
-
function
|
|
613
|
+
const it = Z(at, (e, n) => e.value === n.value && e.options === n.options && e.isLoading === n.isLoading && e.disabled === n.disabled && e.errorComponent === n.errorComponent && e.helperComponent === n.helperComponent && e.variant === n.variant && e.label === n.label && e.id === n.id && e.name === n.name && e.placeholder === n.placeholder && e.renderOptionContext === n.renderOptionContext && e.dropdownOptions?.controledSearchValue === n.dropdownOptions?.controledSearchValue && e.dropdownOptions?.isLoading === n.dropdownOptions?.isLoading), St = it;
|
|
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,
|
|
@@ -638,27 +638,27 @@ function ft({
|
|
|
638
638
|
filteredOptions: de,
|
|
639
639
|
selectButtonRef: J,
|
|
640
640
|
onCloseDropdown: fe,
|
|
641
|
-
loadingComponent:
|
|
642
|
-
dropdownClassName:
|
|
643
|
-
helperComponentRef:
|
|
641
|
+
loadingComponent: He,
|
|
642
|
+
dropdownClassName: Ae,
|
|
643
|
+
helperComponentRef: Ee,
|
|
644
644
|
selectedOptionsIds: ae,
|
|
645
645
|
setFilteredOptions: Q,
|
|
646
646
|
onSearchValueChange: O,
|
|
647
647
|
isLoading: ee = !1,
|
|
648
648
|
hideSearchBar: Ce = !1,
|
|
649
|
-
inputSearchPlaceholder:
|
|
649
|
+
inputSearchPlaceholder: ke = "Buscar opciones",
|
|
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(
|
|
657
657
|
() => /* @__PURE__ */ new Set()
|
|
658
|
-
),
|
|
658
|
+
), ze = U(
|
|
659
659
|
(r) => !we.has(r),
|
|
660
660
|
[we]
|
|
661
|
-
),
|
|
661
|
+
), Oe = U(
|
|
662
662
|
(r, o) => {
|
|
663
663
|
ie((c) => {
|
|
664
664
|
const d = new Set(c), w = d.has(r);
|
|
@@ -666,12 +666,12 @@ function ft({
|
|
|
666
666
|
});
|
|
667
667
|
},
|
|
668
668
|
[]
|
|
669
|
-
),
|
|
670
|
-
if (!p.current || !
|
|
671
|
-
const o =
|
|
672
|
-
switch (r ||
|
|
669
|
+
), Le = (r) => {
|
|
670
|
+
if (!p.current || !m.current) return;
|
|
671
|
+
const o = m.current.getBoundingClientRect();
|
|
672
|
+
switch (r || me.direction) {
|
|
673
673
|
case "down":
|
|
674
|
-
p.current.style.top = `${o.top + o.height - (
|
|
674
|
+
p.current.style.top = `${o.top + o.height - (Ee?.current?.offsetHeight ? Ee?.current?.offsetHeight + 4 : 0)}px`;
|
|
675
675
|
break;
|
|
676
676
|
case "up":
|
|
677
677
|
p.current.style.top = "auto", p.current.style.bottom = `${window.innerHeight - o.top + te}px`;
|
|
@@ -680,36 +680,36 @@ function ft({
|
|
|
680
680
|
p.current.style.left = `${o.left}px`, p.current.style.width = `${o.width}px`;
|
|
681
681
|
}, ne = (r) => {
|
|
682
682
|
p.current && (p.current.style.maxHeight = `${r}px`);
|
|
683
|
-
},
|
|
684
|
-
if (!p.current || !
|
|
685
|
-
const r =
|
|
683
|
+
}, Te = () => {
|
|
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;
|
|
693
693
|
}
|
|
694
694
|
if (!E) {
|
|
695
|
-
const o =
|
|
696
|
-
|
|
695
|
+
const o = Te();
|
|
696
|
+
Me(o), Le(o.direction), ne(o.height);
|
|
697
697
|
}
|
|
698
698
|
p.current.style.opacity = "1", p.current.style.pointerEvents = "auto";
|
|
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(() => {
|
|
706
706
|
i && Q(i);
|
|
707
707
|
}, [i]), ve(() => {
|
|
708
708
|
if (ee || !I) return;
|
|
709
|
-
const r =
|
|
709
|
+
const r = Ge(i, I);
|
|
710
710
|
Q(r);
|
|
711
711
|
}, [i]);
|
|
712
|
-
const
|
|
712
|
+
const Ge = (r, o) => {
|
|
713
713
|
if (!o) return r;
|
|
714
714
|
if (x) {
|
|
715
715
|
const y = [];
|
|
@@ -726,7 +726,7 @@ function ft({
|
|
|
726
726
|
const a = be, l = G(
|
|
727
727
|
a,
|
|
728
728
|
b
|
|
729
|
-
), g =
|
|
729
|
+
), g = Ue(String(l ?? ""), o);
|
|
730
730
|
R ? g && q.push(a) : g && y.push(a);
|
|
731
731
|
}), re(), y;
|
|
732
732
|
}
|
|
@@ -740,21 +740,21 @@ function ft({
|
|
|
740
740
|
L(), d = y;
|
|
741
741
|
return;
|
|
742
742
|
}
|
|
743
|
-
const R =
|
|
743
|
+
const R = Ue(y.label, o);
|
|
744
744
|
d ? R && w.push(y) : R && c.push(y);
|
|
745
745
|
}), L(), c;
|
|
746
|
-
},
|
|
747
|
-
const o =
|
|
746
|
+
}, $e = (r) => {
|
|
747
|
+
const o = Ge(i, r);
|
|
748
748
|
if (Q(o), O) {
|
|
749
749
|
if (r === "") {
|
|
750
|
-
|
|
750
|
+
Ie();
|
|
751
751
|
return;
|
|
752
752
|
}
|
|
753
753
|
O(r);
|
|
754
754
|
return;
|
|
755
755
|
}
|
|
756
756
|
z && i && z(r);
|
|
757
|
-
},
|
|
757
|
+
}, Ie = U(() => {
|
|
758
758
|
if (K) {
|
|
759
759
|
K(), Q(
|
|
760
760
|
i.filter((r) => {
|
|
@@ -773,7 +773,7 @@ function ft({
|
|
|
773
773
|
Q,
|
|
774
774
|
z,
|
|
775
775
|
x
|
|
776
|
-
]),
|
|
776
|
+
]), Pe = (r) => {
|
|
777
777
|
r.key === "ArrowDown" ? (r.preventDefault(), p.current?.querySelector(
|
|
778
778
|
"[role=listitem]"
|
|
779
779
|
)?.focus()) : (r.key === "Tab" || r.key === "Escape") && setTimeout(() => {
|
|
@@ -819,7 +819,7 @@ function ft({
|
|
|
819
819
|
renderContext: S
|
|
820
820
|
}
|
|
821
821
|
) : /* @__PURE__ */ s.jsx(
|
|
822
|
-
|
|
822
|
+
We,
|
|
823
823
|
{
|
|
824
824
|
multiple: !1,
|
|
825
825
|
isLoading: !0,
|
|
@@ -841,8 +841,8 @@ function ft({
|
|
|
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
|
-
|
|
845
|
-
|
|
844
|
+
me.direction === "up" ? "h-auto" : " h-max",
|
|
845
|
+
Ae
|
|
846
846
|
),
|
|
847
847
|
children: /* @__PURE__ */ s.jsxs(
|
|
848
848
|
"div",
|
|
@@ -853,11 +853,11 @@ function ft({
|
|
|
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(
|
|
860
|
-
|
|
860
|
+
tt,
|
|
861
861
|
{
|
|
862
862
|
name: "",
|
|
863
863
|
label: "",
|
|
@@ -867,17 +867,17 @@ function ft({
|
|
|
867
867
|
disabled: v,
|
|
868
868
|
ref: V,
|
|
869
869
|
labelVariant: "static",
|
|
870
|
-
icon: /* @__PURE__ */ s.jsx(
|
|
870
|
+
icon: /* @__PURE__ */ s.jsx(je.Search, {}),
|
|
871
871
|
isFetching: ee,
|
|
872
|
-
onKeyDown:
|
|
873
|
-
onClear:
|
|
874
|
-
onChange: (r) =>
|
|
875
|
-
placeholder:
|
|
872
|
+
onKeyDown: Pe,
|
|
873
|
+
onClear: Ie,
|
|
874
|
+
onChange: (r) => $e(r.target.value),
|
|
875
|
+
placeholder: ke,
|
|
876
876
|
className: " bg-neutral-medium-pressed",
|
|
877
877
|
...j
|
|
878
878
|
}
|
|
879
879
|
),
|
|
880
|
-
/* @__PURE__ */ s.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: de.length === 0 ? ee ? /* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children:
|
|
880
|
+
/* @__PURE__ */ s.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: de.length === 0 ? ee ? /* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: He || Y }) : /* @__PURE__ */ s.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: I ? `No se encontraron resultados para "${I}"` : A }) : (() => {
|
|
881
881
|
let r = !0;
|
|
882
882
|
return de.map((o) => {
|
|
883
883
|
const c = o, d = !!c.isGroupHeader, w = x && !d ? G(o, k) : c.id, L = ae.has(w), y = (l) => !x || d ? l : {
|
|
@@ -916,10 +916,10 @@ function ft({
|
|
|
916
916
|
);
|
|
917
917
|
};
|
|
918
918
|
if (d) {
|
|
919
|
-
const l = c.groupLabelNode ?? c.label, g = String(c.id), H = X === !1 ? !0 :
|
|
919
|
+
const l = c.groupLabelNode ?? c.label, g = String(c.id), H = X === !1 ? !0 : ze(g);
|
|
920
920
|
r = H;
|
|
921
921
|
const $ = c.originalOption, P = c.groupData?.groupOptions ?? [], le = (_) => {
|
|
922
|
-
X &&
|
|
922
|
+
X && Oe(g, _);
|
|
923
923
|
}, xe = (_) => {
|
|
924
924
|
!P || P.length === 0 || Se && Se(P, _);
|
|
925
925
|
}, ye = P.filter(
|
|
@@ -950,9 +950,9 @@ function ft({
|
|
|
950
950
|
"div",
|
|
951
951
|
{
|
|
952
952
|
className: "cursor-pointer",
|
|
953
|
-
onClick: () =>
|
|
953
|
+
onClick: () => Oe(g),
|
|
954
954
|
children: /* @__PURE__ */ s.jsx(
|
|
955
|
-
|
|
955
|
+
je.ChevronDown,
|
|
956
956
|
{
|
|
957
957
|
className: f(
|
|
958
958
|
"transition-transform duration-300 ease-out",
|
|
@@ -982,7 +982,7 @@ function ft({
|
|
|
982
982
|
renderContext: S
|
|
983
983
|
}
|
|
984
984
|
) : /* @__PURE__ */ s.jsx(
|
|
985
|
-
|
|
985
|
+
We,
|
|
986
986
|
{
|
|
987
987
|
disabled: v,
|
|
988
988
|
multiple: u,
|
|
@@ -1014,36 +1014,36 @@ function ft({
|
|
|
1014
1014
|
)
|
|
1015
1015
|
}
|
|
1016
1016
|
);
|
|
1017
|
-
return E ? ge :
|
|
1017
|
+
return E ? ge : Ye(ge, document.body);
|
|
1018
1018
|
}
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1019
|
+
const ct = Z(
|
|
1020
|
+
ut,
|
|
1021
1021
|
(e, n) => e.options === n.options && e.selectedOptionsIds === n.selectedOptionsIds && e.multiple === n.multiple && e.disabled === n.disabled && e.emptyMessage === n.emptyMessage && e.renderOption === n.renderOption && e.renderOptionContext === n.renderOptionContext && e.isOpen === n.isOpen && e.attachToParent === n.attachToParent && e.optionValue === n.optionValue && e.optionLabel === n.optionLabel && e.filteredOptions === n.filteredOptions && e.isLoading === n.isLoading
|
|
1022
|
-
),
|
|
1022
|
+
), We = 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",
|
|
1035
1035
|
{
|
|
1036
1036
|
className: "flex gap-2 w-full px-3 py-2 cursor-wait",
|
|
1037
1037
|
children: [
|
|
1038
|
-
/* @__PURE__ */ s.jsx(
|
|
1039
|
-
/* @__PURE__ */ s.jsx(
|
|
1038
|
+
/* @__PURE__ */ s.jsx(Fe, { className: "size-6 aspect-square" }),
|
|
1039
|
+
/* @__PURE__ */ s.jsx(Fe, { className: "flex-1 h-6" })
|
|
1040
1040
|
]
|
|
1041
1041
|
},
|
|
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 mt = 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
|
},
|
|
@@ -1067,24 +1067,24 @@ const mt = Z(
|
|
|
1067
1067
|
},
|
|
1068
1068
|
(e, n) => e.isSelected === n.isSelected && e.disabled === n.disabled
|
|
1069
1069
|
);
|
|
1070
|
-
|
|
1070
|
+
We.displayName = "DefaultOptionRenderer";
|
|
1071
1071
|
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: [
|
|
@@ -1095,6 +1095,6 @@ const Je = Z(
|
|
|
1095
1095
|
);
|
|
1096
1096
|
Je.displayName = "DefaultSelectionDisplay";
|
|
1097
1097
|
export {
|
|
1098
|
-
|
|
1098
|
+
St as S,
|
|
1099
1099
|
G as g
|
|
1100
1100
|
};
|