prometeo-design-system 2.4.1 → 2.4.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 +1 -1
- package/dist/{Button-DsbEyjth.js → Button-Bc0LYLfg.js} +1 -1
- package/dist/Button.es.js +1 -1
- package/dist/{CardProfile-Fn44kEnM.js → CardProfile-BhHJmvqs.js} +1 -1
- package/dist/CardProfile.es.js +1 -1
- package/dist/CheckBox.es.js +13 -12
- package/dist/CheckboxFormik.es.js +1 -1
- package/dist/DatePicker.es.js +2 -2
- package/dist/DialogModal.es.js +1 -1
- package/dist/DrawerDesktop.es.js +2 -2
- package/dist/DrawerMobile.es.js +1 -1
- package/dist/DropZone.es.js +1 -1
- package/dist/Header.es.js +1 -1
- package/dist/Icons.es.js +1 -1
- package/dist/Image.es.js +1 -1
- package/dist/{ImageGallery-DnoRTpCr.js → ImageGallery-BeADef_g.js} +2 -2
- package/dist/ImageGallery.es.js +1 -1
- package/dist/Input.es.js +1 -1
- package/dist/InputFormik.es.js +1 -1
- package/dist/InputMultiple.es.js +1 -1
- package/dist/{LayoutGeneric-p4Pll4Cm.js → LayoutGeneric-jDE96L2N.js} +1 -1
- package/dist/LayoutGeneric.es.js +1 -1
- package/dist/Logo.es.js +1 -1
- package/dist/Menu.es.js +1 -1
- package/dist/OtpInput.es.js +1 -1
- package/dist/Pagination.es.js +1 -1
- package/dist/ProfilePictureUpload.es.js +1 -1
- package/dist/ProgressBar.es.js +1 -1
- package/dist/SegmentedButton.es.js +1 -1
- package/dist/Select.es.js +271 -264
- package/dist/SelectFormik.es.js +1 -1
- package/dist/SelectFormikLegacy.es.js +1 -1
- package/dist/Skeleton.es.js +1 -1
- package/dist/Spinner.es.js +1 -1
- package/dist/Steps.es.js +1 -1
- package/dist/SwipeContainer.es.js +1 -1
- package/dist/Switch.es.js +1 -1
- package/dist/TabLinks.es.js +2 -3
- package/dist/Table.es.js +1 -1
- package/dist/TextArea.es.js +1 -1
- package/dist/Toast.d.ts +6 -0
- package/dist/Toast.es.js +145 -0
- package/dist/ToastProvider.d.ts +6 -0
- package/dist/ToastProvider.es.js +6 -0
- package/dist/Tooltip.es.js +1 -1
- package/dist/components/Toaster/ToastProvider.d.ts +5 -0
- package/dist/components/Toaster/Toaster.d.ts +23 -31
- package/dist/exports/Toast.d.ts +3 -0
- package/dist/exports/ToastProvider.d.ts +2 -0
- package/dist/index.d.ts +4 -1
- package/dist/{jsx-runtime-DKDX3adD.js → jsx-runtime-ByW6EXIE.js} +96 -94
- package/dist/pages/ToastsPage.d.ts +2 -0
- package/dist/preview/ToastsPreview.d.ts +2 -0
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +43 -38
- package/package.json +1 -1
- package/src/styles/intellisense.css +3 -0
- package/dist/components/Toaster/PrometeoProviderToas.d.ts +0 -6
- package/dist/components/Toaster/Toast.d.ts +0 -3
package/dist/Select.es.js
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { Icons as
|
|
1
|
+
import { j as n } from "./jsx-runtime-ByW6EXIE.js";
|
|
2
|
+
import { Icons as z } from "./Icons.es.js";
|
|
3
3
|
import { c as a } from "./cn-B6yFEsav.js";
|
|
4
|
-
import ce, { useRef as F, useLayoutEffect as we, memo as
|
|
5
|
-
import
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import { u as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
let
|
|
11
|
-
for (;
|
|
12
|
-
const s = window.getComputedStyle(
|
|
4
|
+
import ce, { useRef as F, useLayoutEffect as we, memo as I, useState as ie, useMemo as B, useCallback as k, useEffect as ee } from "react";
|
|
5
|
+
import Ce from "./Spinner.es.js";
|
|
6
|
+
import { createPortal as Ee } from "react-dom";
|
|
7
|
+
import { u as He } from "./useDragScroll-CHN9OMwn.js";
|
|
8
|
+
import Se from "./CheckBox.es.js";
|
|
9
|
+
const ke = (e) => {
|
|
10
|
+
let r = e;
|
|
11
|
+
for (; r && r !== document.body; ) {
|
|
12
|
+
const s = window.getComputedStyle(r).backgroundColor;
|
|
13
13
|
if (s && s !== "transparent" && s !== "rgba(0, 0, 0, 0)")
|
|
14
14
|
return s;
|
|
15
|
-
|
|
15
|
+
r = r.parentElement;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
return
|
|
17
|
+
const l = window.getComputedStyle(document.body).backgroundColor;
|
|
18
|
+
return l && l !== "transparent" && l !== "rgba(0, 0, 0, 0)" ? l : "rgb(255, 255, 255)";
|
|
19
19
|
};
|
|
20
|
-
function
|
|
21
|
-
const
|
|
20
|
+
function ze() {
|
|
21
|
+
const e = F(null);
|
|
22
22
|
return we(() => {
|
|
23
|
-
if (!
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
if (!e.current || !e.current.parentElement) return;
|
|
24
|
+
const r = ke(e.current.parentElement);
|
|
25
|
+
e.current.style.backgroundColor = r;
|
|
26
26
|
}, []), {
|
|
27
|
-
ref:
|
|
27
|
+
ref: e
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
const de = (
|
|
31
|
-
const { variant:
|
|
30
|
+
const de = (e) => {
|
|
31
|
+
const { variant: r, className: l } = e, c = {
|
|
32
32
|
default: "text-neutral-medium-default pt-[1px]",
|
|
33
33
|
error: "text-error-medium-default pt-[1px]",
|
|
34
34
|
success: "text-success-medium-default"
|
|
35
35
|
}, s = {
|
|
36
|
-
default: /* @__PURE__ */
|
|
37
|
-
error: /* @__PURE__ */
|
|
38
|
-
success: /* @__PURE__ */
|
|
36
|
+
default: /* @__PURE__ */ n.jsx(z.Info, { size: 16, className: "text-neutral-medium-default " }),
|
|
37
|
+
error: /* @__PURE__ */ n.jsx(z.Error, { size: 16, className: "text-error-medium-default" }),
|
|
38
|
+
success: /* @__PURE__ */ n.jsx(z.Check, { size: 16, className: "text-success-medium-default" })
|
|
39
39
|
};
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
s[
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
] }) :
|
|
40
|
+
return /* @__PURE__ */ n.jsx("div", { ref: e.ref, className: a("pl-3", l), children: typeof e.children == "string" ? /* @__PURE__ */ n.jsxs("div", { className: "flex gap-0.5 items-start", children: [
|
|
41
|
+
s[r],
|
|
42
|
+
/* @__PURE__ */ n.jsx("p", { className: a(" prometeo-fonts-body-small", c[r]), children: e.children })
|
|
43
|
+
] }) : e.children });
|
|
44
44
|
};
|
|
45
45
|
de.displayName = "HelperText";
|
|
46
|
-
const
|
|
46
|
+
const Ie = I(de), Oe = {
|
|
47
47
|
default: {
|
|
48
48
|
container: "text-neutral-default-default border-neutral-default-default ",
|
|
49
49
|
icon: ""
|
|
@@ -59,21 +59,21 @@ const ke = z(de), ze = {
|
|
|
59
59
|
}, oe = {
|
|
60
60
|
icon: " text-neutral-default-disabled",
|
|
61
61
|
container: " border-neutral-strong-default text-neutral-default-disabled"
|
|
62
|
-
}, fe = ({ id:
|
|
62
|
+
}, fe = ({ id: e, label: r, onRemove: l, className: c, disabled: s, variant: o = "default" }) => /* @__PURE__ */ n.jsxs(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
65
|
className: a(
|
|
66
66
|
"inline-flex max-w-[calc(50%-0.25rem)] items-center gap-1 px-2 py-1 bg-inherit text-xs rounded-lg border",
|
|
67
|
-
|
|
67
|
+
Oe[o].container,
|
|
68
68
|
s && oe.container
|
|
69
69
|
),
|
|
70
70
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
71
|
+
/* @__PURE__ */ n.jsx("span", { className: "truncate w-max ", children: r }),
|
|
72
|
+
l && /* @__PURE__ */ n.jsx(
|
|
73
73
|
"button",
|
|
74
74
|
{
|
|
75
|
-
onMouseDown: (
|
|
76
|
-
s || (
|
|
75
|
+
onMouseDown: (g) => {
|
|
76
|
+
s || (g.stopPropagation(), g.preventDefault(), l?.(e));
|
|
77
77
|
},
|
|
78
78
|
className: a(
|
|
79
79
|
"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",
|
|
@@ -82,27 +82,27 @@ const ke = z(de), ze = {
|
|
|
82
82
|
),
|
|
83
83
|
type: "button",
|
|
84
84
|
tabIndex: -1,
|
|
85
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ n.jsx(z.Close, { size: 18, className: a(s && oe.icon) })
|
|
86
86
|
}
|
|
87
87
|
)
|
|
88
88
|
]
|
|
89
89
|
}
|
|
90
90
|
);
|
|
91
91
|
fe.displayName = "Chip";
|
|
92
|
-
const
|
|
93
|
-
function
|
|
94
|
-
if (typeof
|
|
95
|
-
return
|
|
96
|
-
const
|
|
97
|
-
let c =
|
|
98
|
-
for (const s of
|
|
92
|
+
const _e = I(fe);
|
|
93
|
+
function m(e, r) {
|
|
94
|
+
if (typeof r == "function")
|
|
95
|
+
return r(e);
|
|
96
|
+
const l = r?.split(".");
|
|
97
|
+
let c = e;
|
|
98
|
+
for (const s of l)
|
|
99
99
|
if (c && typeof c == "object" && s in c)
|
|
100
100
|
c = c[s];
|
|
101
101
|
else
|
|
102
102
|
return;
|
|
103
103
|
return c;
|
|
104
104
|
}
|
|
105
|
-
const
|
|
105
|
+
const Z = {
|
|
106
106
|
default: {
|
|
107
107
|
container: "",
|
|
108
108
|
input: a(
|
|
@@ -151,7 +151,7 @@ const X = {
|
|
|
151
151
|
"peer-focus:text-success-light"
|
|
152
152
|
)
|
|
153
153
|
}
|
|
154
|
-
},
|
|
154
|
+
}, V = {
|
|
155
155
|
input: a(
|
|
156
156
|
"border-neutral-strong-default text-neutral-default-default",
|
|
157
157
|
"focus:ring-primary-default-default focus:ring-[1px] focus:border-primary-default-default ",
|
|
@@ -165,199 +165,206 @@ const X = {
|
|
|
165
165
|
"text-neutral-medium-disabled",
|
|
166
166
|
"peer-focus:text-primary-default-default"
|
|
167
167
|
)
|
|
168
|
-
},
|
|
169
|
-
label:
|
|
170
|
-
onOptionClick:
|
|
171
|
-
value:
|
|
168
|
+
}, Me = ({
|
|
169
|
+
label: e,
|
|
170
|
+
onOptionClick: r,
|
|
171
|
+
value: l,
|
|
172
172
|
isLoading: c = !1,
|
|
173
173
|
options: s,
|
|
174
174
|
multiple: o = !1,
|
|
175
|
-
onClear:
|
|
176
|
-
onClose:
|
|
175
|
+
onClear: g,
|
|
176
|
+
onClose: x,
|
|
177
177
|
className: i,
|
|
178
|
-
id:
|
|
179
|
-
emptyMessage:
|
|
180
|
-
optionValue:
|
|
181
|
-
optionLabel:
|
|
182
|
-
renderOption:
|
|
183
|
-
placeholder:
|
|
184
|
-
renderSelection:
|
|
185
|
-
containerClassName:
|
|
186
|
-
buttonClassName:
|
|
187
|
-
dropdownClassName:
|
|
188
|
-
displayMode:
|
|
189
|
-
onRemoveOption:
|
|
190
|
-
width:
|
|
178
|
+
id: E,
|
|
179
|
+
emptyMessage: P = "No hay opciones disponibles",
|
|
180
|
+
optionValue: d,
|
|
181
|
+
optionLabel: b,
|
|
182
|
+
renderOption: O,
|
|
183
|
+
placeholder: j,
|
|
184
|
+
renderSelection: w,
|
|
185
|
+
containerClassName: te,
|
|
186
|
+
buttonClassName: L,
|
|
187
|
+
dropdownClassName: _,
|
|
188
|
+
displayMode: G = "compact",
|
|
189
|
+
onRemoveOption: M,
|
|
190
|
+
width: $ = "100%",
|
|
191
191
|
height: D,
|
|
192
|
-
labelVariant:
|
|
193
|
-
attachToParent:
|
|
194
|
-
name:
|
|
195
|
-
overflow:
|
|
196
|
-
onChange:
|
|
197
|
-
helperComponent:
|
|
198
|
-
errorComponent:
|
|
199
|
-
disabled:
|
|
200
|
-
variant:
|
|
192
|
+
labelVariant: y = "default",
|
|
193
|
+
attachToParent: f = !1,
|
|
194
|
+
name: u,
|
|
195
|
+
overflow: v = "wrap",
|
|
196
|
+
onChange: h,
|
|
197
|
+
helperComponent: re,
|
|
198
|
+
errorComponent: ne,
|
|
199
|
+
disabled: H = !1,
|
|
200
|
+
variant: W = "default"
|
|
201
201
|
}) => {
|
|
202
|
-
const [
|
|
202
|
+
const [A, K] = ie(!1), R = F(null), se = F(null), ae = F(null), { ref: pe } = ze(), { bind: S, ref: ge } = He({
|
|
203
203
|
axis: "x",
|
|
204
204
|
cursor: { idle: "default", dragging: "grabbing" }
|
|
205
|
-
}),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
Z(() => {
|
|
213
|
-
const e = (x) => {
|
|
214
|
-
if (W.current) {
|
|
215
|
-
if (x.type === "mousedown" && W.current.contains(x.target) || x.type === "scroll" && re.current?.contains(x.target))
|
|
205
|
+
}), T = l && l.length > 0, q = B(() => s?.filter((t) => l?.includes(m(t, d))), [l, d, s]), he = () => y === "static" ? "relative prometeo-fonts-label-large" : A || T ? "absolute top-0 -translate-y-1/2 left-2 scale-90 px-1 prometeo-fonts-body-medium" : "absolute top-1/2 -translate-y-1/2 scale-100 prometeo-fonts-body-large", J = {};
|
|
206
|
+
$ && $ !== "100%" && (J.width = $), D && (J.height = D);
|
|
207
|
+
const be = k(() => w ? { height: v === "scroll" ? "48px" : "max-content" } : D ? { height: D } : {}, [D, v, w]);
|
|
208
|
+
ee(() => {
|
|
209
|
+
const t = (p) => {
|
|
210
|
+
if (R.current) {
|
|
211
|
+
if (p.type === "mousedown" && R.current.contains(p.target) || p.type === "scroll" && se.current?.contains(p.target))
|
|
216
212
|
return;
|
|
217
213
|
K(!1);
|
|
218
214
|
}
|
|
219
215
|
};
|
|
220
|
-
return document.addEventListener("mousedown",
|
|
221
|
-
document.removeEventListener("mousedown",
|
|
216
|
+
return document.addEventListener("mousedown", t), window.addEventListener("scroll", t, !0), window.addEventListener("resize", t, !0), () => {
|
|
217
|
+
document.removeEventListener("mousedown", t), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t, !0);
|
|
222
218
|
};
|
|
223
219
|
}, []);
|
|
224
|
-
const
|
|
225
|
-
K((
|
|
226
|
-
}, []),
|
|
220
|
+
const le = k(() => {
|
|
221
|
+
K((t) => !t);
|
|
222
|
+
}, []), Q = B(() => s.map((t) => ({
|
|
223
|
+
id: m(t, d),
|
|
224
|
+
value: m(t, d),
|
|
225
|
+
label: m(t, b)
|
|
226
|
+
})), [s, d, b]), U = k((t) => {
|
|
227
227
|
if (o) {
|
|
228
|
-
const
|
|
229
|
-
let
|
|
230
|
-
const ue =
|
|
231
|
-
|
|
228
|
+
const p = l?.includes(t.id);
|
|
229
|
+
let N = [];
|
|
230
|
+
const ue = s.map((C) => ({
|
|
231
|
+
id: m(C, d),
|
|
232
|
+
value: m(C, d),
|
|
233
|
+
label: m(C, b)
|
|
234
|
+
})).filter((C) => l?.includes(C.id));
|
|
235
|
+
p ? N = ue.filter((C) => C.id !== t.id) : N = [...ue, t], h?.(N, u);
|
|
232
236
|
} else
|
|
233
|
-
|
|
234
|
-
}, [o,
|
|
235
|
-
|
|
236
|
-
}, [o,
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
o ||
|
|
240
|
-
const
|
|
241
|
-
if (
|
|
242
|
-
const
|
|
243
|
-
id:
|
|
244
|
-
label:
|
|
245
|
-
value:
|
|
237
|
+
h?.([t], u);
|
|
238
|
+
}, [o, h, u, s, d, b, l]), ye = k((t) => {
|
|
239
|
+
r?.(t, u), U?.(t), o || (K(!1), x?.());
|
|
240
|
+
}, [o, r, x, u, U]), ve = (t) => {
|
|
241
|
+
t.preventDefault(), t.stopPropagation(), t.target.blur(), g?.(), h?.([], u);
|
|
242
|
+
}, X = k((t) => {
|
|
243
|
+
o || h?.([], u);
|
|
244
|
+
const p = s.find((N) => m(N, d) === t);
|
|
245
|
+
if (p) {
|
|
246
|
+
const N = {
|
|
247
|
+
id: m(p, d),
|
|
248
|
+
label: m(p, b),
|
|
249
|
+
value: m(p, d)
|
|
246
250
|
};
|
|
247
|
-
|
|
251
|
+
r?.(N, u), U(N), M?.(p);
|
|
248
252
|
}
|
|
249
|
-
}, [
|
|
250
|
-
()
|
|
251
|
-
|
|
253
|
+
}, [r, M, b, d, s, u, o, h, U]), De = k((t) => {
|
|
254
|
+
X(t);
|
|
255
|
+
}, [X]), Ne = B(() => y === "static" && j ? j : "", [y, j]), Y = B(
|
|
256
|
+
() => new Set(q.map((t) => m(t, d))),
|
|
257
|
+
[q, d]
|
|
258
|
+
), je = B(
|
|
259
|
+
() => Q.filter((t) => Y.has(t.id)),
|
|
260
|
+
[Q, Y]
|
|
252
261
|
);
|
|
253
|
-
return /* @__PURE__ */
|
|
262
|
+
return /* @__PURE__ */ n.jsxs(
|
|
254
263
|
"div",
|
|
255
264
|
{
|
|
256
265
|
className: a(
|
|
257
266
|
"relative bg-inherit select-none w-full",
|
|
258
267
|
i,
|
|
259
|
-
|
|
268
|
+
y === "static" && "mt-2"
|
|
260
269
|
),
|
|
261
|
-
ref:
|
|
270
|
+
ref: R,
|
|
262
271
|
style: J,
|
|
263
272
|
draggable: !1,
|
|
264
273
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ n.jsxs("div", { className: a("relative bg-inherit ", te), children: [
|
|
275
|
+
/* @__PURE__ */ n.jsx(
|
|
267
276
|
"label",
|
|
268
277
|
{
|
|
269
|
-
htmlFor:
|
|
278
|
+
htmlFor: E,
|
|
270
279
|
ref: pe,
|
|
271
280
|
className: a(
|
|
272
281
|
"left-3 pointer-events-none bg-inherit z-10",
|
|
273
|
-
|
|
282
|
+
y === "default" && "transition-all duration-200 ease-in-out",
|
|
274
283
|
he(),
|
|
275
|
-
|
|
276
|
-
|
|
284
|
+
T || A ? Z[W].label : "text-neutral-medium-default",
|
|
285
|
+
H && V.label
|
|
277
286
|
),
|
|
278
|
-
children:
|
|
287
|
+
children: e
|
|
279
288
|
}
|
|
280
289
|
),
|
|
281
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ n.jsxs(
|
|
282
291
|
"div",
|
|
283
292
|
{
|
|
284
293
|
role: "button",
|
|
285
|
-
id:
|
|
286
|
-
onClick: (
|
|
287
|
-
|
|
294
|
+
id: E,
|
|
295
|
+
onClick: (t) => {
|
|
296
|
+
t.preventDefault(), t.stopPropagation(), le();
|
|
288
297
|
},
|
|
289
|
-
onKeyDown: (
|
|
290
|
-
(
|
|
298
|
+
onKeyDown: (t) => {
|
|
299
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), le());
|
|
291
300
|
},
|
|
292
301
|
tabIndex: 0,
|
|
293
302
|
className: a(
|
|
294
303
|
"w-full px-2 text-left border rounded-lg transition-all duration-200 ease-in-out",
|
|
295
304
|
"flex items-center justify-start bg-inherit gap-2 ",
|
|
296
305
|
"focus:outline-none",
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
306
|
+
G === "chips" && o && T ? "min-h-12 py-2" : !D && "h-12 min-h-12",
|
|
307
|
+
Z[W].input,
|
|
308
|
+
H && V.input,
|
|
309
|
+
L
|
|
301
310
|
),
|
|
302
311
|
style: be(),
|
|
303
312
|
children: [
|
|
304
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ n.jsx(
|
|
305
314
|
"div",
|
|
306
315
|
{
|
|
307
316
|
className: a(
|
|
308
317
|
"flex-1 overflow-x-auto overflow-y-hidden px-1 prometeo-scrollbar-none ",
|
|
309
|
-
|
|
318
|
+
w ? " " : ""
|
|
310
319
|
),
|
|
311
320
|
ref: ge,
|
|
312
|
-
onPointerDown:
|
|
313
|
-
onPointerMove:
|
|
314
|
-
onPointerUp:
|
|
315
|
-
onPointerLeave:
|
|
316
|
-
onPointerCancel:
|
|
317
|
-
onClickCapture:
|
|
318
|
-
children:
|
|
321
|
+
onPointerDown: S.onPointerDown,
|
|
322
|
+
onPointerMove: S.onPointerMove,
|
|
323
|
+
onPointerUp: S.onPointerUp,
|
|
324
|
+
onPointerLeave: S.onPointerLeave,
|
|
325
|
+
onPointerCancel: S.onPointerCancel,
|
|
326
|
+
onClickCapture: S.onClickCapture,
|
|
327
|
+
children: w ? ce.createElement(w, {
|
|
319
328
|
selectedOptions: q,
|
|
320
|
-
placeholder:
|
|
329
|
+
placeholder: j,
|
|
321
330
|
multiple: o,
|
|
322
|
-
onRemoveOption:
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
disabled: E
|
|
326
|
-
}) : /* @__PURE__ */ t.jsx(
|
|
331
|
+
onRemoveOption: De,
|
|
332
|
+
disabled: H
|
|
333
|
+
}) : /* @__PURE__ */ n.jsx(
|
|
327
334
|
xe,
|
|
328
335
|
{
|
|
329
|
-
displayMode:
|
|
330
|
-
selectedOptions:
|
|
331
|
-
placeholder:
|
|
332
|
-
onRemoveOption:
|
|
336
|
+
displayMode: G,
|
|
337
|
+
selectedOptions: je,
|
|
338
|
+
placeholder: Ne,
|
|
339
|
+
onRemoveOption: X,
|
|
333
340
|
multiple: o,
|
|
334
|
-
className: a(
|
|
335
|
-
disabled:
|
|
341
|
+
className: a(v === "scroll" ? "flex-nowrap" : "flex-wrap"),
|
|
342
|
+
disabled: H
|
|
336
343
|
}
|
|
337
344
|
)
|
|
338
345
|
}
|
|
339
346
|
),
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
c && /* @__PURE__ */
|
|
342
|
-
|
|
347
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
348
|
+
c && /* @__PURE__ */ n.jsx(Ce, { size: "small", variant: "clip", className: "mt-2", speedMultiplier: 0.7 }),
|
|
349
|
+
T && g && /* @__PURE__ */ n.jsx(
|
|
343
350
|
"button",
|
|
344
351
|
{
|
|
345
|
-
onMouseDown: (
|
|
346
|
-
|
|
352
|
+
onMouseDown: (t) => {
|
|
353
|
+
t.preventDefault(), t.stopPropagation(), ve(t);
|
|
347
354
|
},
|
|
348
355
|
type: "button",
|
|
349
356
|
tabIndex: -1,
|
|
350
|
-
children: /* @__PURE__ */
|
|
357
|
+
children: /* @__PURE__ */ n.jsx(z.Cancel, { size: 24, className: a(" cursor-pointer transition-all", Z[W].icon) })
|
|
351
358
|
}
|
|
352
359
|
),
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
-
|
|
360
|
+
/* @__PURE__ */ n.jsx(
|
|
361
|
+
z.ChevronDown,
|
|
355
362
|
{
|
|
356
363
|
size: 20,
|
|
357
364
|
className: a(
|
|
358
365
|
"transition-transform text-neutral-default-default",
|
|
359
|
-
|
|
360
|
-
|
|
366
|
+
A ? "rotate-180" : "",
|
|
367
|
+
H && V.icon
|
|
361
368
|
)
|
|
362
369
|
}
|
|
363
370
|
)
|
|
@@ -366,94 +373,94 @@ const X = {
|
|
|
366
373
|
}
|
|
367
374
|
)
|
|
368
375
|
] }),
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
|
|
376
|
+
/* @__PURE__ */ n.jsx(
|
|
377
|
+
Be,
|
|
371
378
|
{
|
|
372
|
-
options:
|
|
373
|
-
selectedOptionsIds:
|
|
379
|
+
options: O ? s : Q,
|
|
380
|
+
selectedOptionsIds: Y,
|
|
374
381
|
onOptionClick: ye,
|
|
375
|
-
emptyMessage:
|
|
376
|
-
dropdownClassName:
|
|
382
|
+
emptyMessage: P,
|
|
383
|
+
dropdownClassName: _,
|
|
377
384
|
multiple: o,
|
|
378
|
-
attachToParent:
|
|
379
|
-
selectRef:
|
|
380
|
-
dropdownRef:
|
|
381
|
-
isOpen:
|
|
382
|
-
renderOption:
|
|
383
|
-
optionLabel:
|
|
384
|
-
optionValue:
|
|
385
|
-
helperComponentRef:
|
|
386
|
-
disabled:
|
|
387
|
-
labelVariant:
|
|
385
|
+
attachToParent: f,
|
|
386
|
+
selectRef: R,
|
|
387
|
+
dropdownRef: se,
|
|
388
|
+
isOpen: A,
|
|
389
|
+
renderOption: O,
|
|
390
|
+
optionLabel: b,
|
|
391
|
+
optionValue: d,
|
|
392
|
+
helperComponentRef: ae,
|
|
393
|
+
disabled: H,
|
|
394
|
+
labelVariant: y
|
|
388
395
|
}
|
|
389
396
|
),
|
|
390
|
-
(
|
|
391
|
-
|
|
397
|
+
(ne || re) && /* @__PURE__ */ n.jsx(
|
|
398
|
+
Ie,
|
|
392
399
|
{
|
|
393
|
-
ref:
|
|
394
|
-
variant:
|
|
400
|
+
ref: ae,
|
|
401
|
+
variant: W,
|
|
395
402
|
className: "mt-1",
|
|
396
|
-
children:
|
|
403
|
+
children: ne || re
|
|
397
404
|
}
|
|
398
405
|
)
|
|
399
406
|
]
|
|
400
407
|
}
|
|
401
408
|
);
|
|
402
|
-
},
|
|
403
|
-
function
|
|
404
|
-
options:
|
|
405
|
-
onOptionClick:
|
|
406
|
-
dropdownClassName:
|
|
409
|
+
}, Fe = I(Me, (e, r) => e.value === r.value && e.options === r.options && e.isLoading === r.isLoading && e.disabled === r.disabled && e.errorComponent === r.errorComponent && e.helperComponent === r.helperComponent && e.variant === r.variant && e.label === r.label && e.id === r.id && e.name === r.name && e.placeholder === r.placeholder);
|
|
410
|
+
function $e({
|
|
411
|
+
options: e,
|
|
412
|
+
onOptionClick: r,
|
|
413
|
+
dropdownClassName: l,
|
|
407
414
|
emptyMessage: c,
|
|
408
415
|
selectedOptionsIds: s,
|
|
409
416
|
multiple: o,
|
|
410
|
-
attachToParent:
|
|
411
|
-
selectRef:
|
|
417
|
+
attachToParent: g,
|
|
418
|
+
selectRef: x,
|
|
412
419
|
dropdownRef: i,
|
|
413
|
-
isOpen:
|
|
414
|
-
renderOption:
|
|
415
|
-
optionValue:
|
|
416
|
-
optionLabel:
|
|
417
|
-
helperComponentRef:
|
|
418
|
-
disabled:
|
|
419
|
-
labelVariant:
|
|
420
|
+
isOpen: E,
|
|
421
|
+
renderOption: P,
|
|
422
|
+
optionValue: d,
|
|
423
|
+
optionLabel: b,
|
|
424
|
+
helperComponentRef: O,
|
|
425
|
+
disabled: j,
|
|
426
|
+
labelVariant: w
|
|
420
427
|
}) {
|
|
421
|
-
const
|
|
422
|
-
if (!i.current || !
|
|
423
|
-
const
|
|
424
|
-
switch (
|
|
428
|
+
const L = w === "static" ? -24 : 4, [_, G] = ie("down"), M = (f) => {
|
|
429
|
+
if (!i.current || !x.current) return;
|
|
430
|
+
const u = x.current.getBoundingClientRect();
|
|
431
|
+
switch (f || _) {
|
|
425
432
|
case "down":
|
|
426
|
-
i.current.style.top = `${
|
|
433
|
+
i.current.style.top = `${u.top + u.height - (O?.current?.offsetHeight ? O?.current?.offsetHeight + 4 : 0)}px`;
|
|
427
434
|
break;
|
|
428
435
|
case "up":
|
|
429
|
-
i.current.style.top = "auto", i.current.style.bottom = `${window.innerHeight -
|
|
436
|
+
i.current.style.top = "auto", i.current.style.bottom = `${window.innerHeight - u.top + L}px`;
|
|
430
437
|
break;
|
|
431
438
|
}
|
|
432
|
-
i.current.style.left = `${
|
|
433
|
-
},
|
|
434
|
-
if (!i.current || !
|
|
435
|
-
const
|
|
436
|
-
let
|
|
437
|
-
return
|
|
438
|
-
}, D = (
|
|
439
|
-
if (!(!i.current || !
|
|
440
|
-
if (i.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !
|
|
439
|
+
i.current.style.left = `${u.left}px`, i.current.style.width = `${u.width}px`;
|
|
440
|
+
}, $ = () => {
|
|
441
|
+
if (!i.current || !x.current) return _;
|
|
442
|
+
const f = x.current.getBoundingClientRect(), u = f.bottom + 240 < window.innerHeight, v = f.top - 240 - L > 0;
|
|
443
|
+
let h = "down";
|
|
444
|
+
return u ? h = "down" : v && (h = "up"), h;
|
|
445
|
+
}, D = (f) => {
|
|
446
|
+
if (!(!i.current || !x.current)) {
|
|
447
|
+
if (i.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !f) {
|
|
441
448
|
i.current.style.maxHeight = "0", i.current.style.opacity = "0", i.current.style.pointerEvents = "none";
|
|
442
449
|
return;
|
|
443
450
|
}
|
|
444
|
-
if (!
|
|
445
|
-
const
|
|
446
|
-
|
|
451
|
+
if (!g) {
|
|
452
|
+
const u = $();
|
|
453
|
+
G(u), M(u);
|
|
447
454
|
}
|
|
448
455
|
i.current.style.maxHeight = "240px", i.current.style.opacity = "1", i.current.style.pointerEvents = "auto";
|
|
449
456
|
}
|
|
450
457
|
};
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}, [s]),
|
|
454
|
-
D(
|
|
455
|
-
}, [
|
|
456
|
-
const
|
|
458
|
+
ee(() => {
|
|
459
|
+
g || !x.current || !E || M();
|
|
460
|
+
}, [s]), ee(() => {
|
|
461
|
+
D(E);
|
|
462
|
+
}, [E]);
|
|
463
|
+
const y = /* @__PURE__ */ n.jsx(
|
|
457
464
|
"div",
|
|
458
465
|
{
|
|
459
466
|
ref: i,
|
|
@@ -464,82 +471,82 @@ function _e({
|
|
|
464
471
|
className: a(
|
|
465
472
|
" z-50 w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-md shadow-lg",
|
|
466
473
|
"max-h-60 overflow-auto",
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
474
|
+
g ? "absolute z-50 " : "fixed z-100 top-0 left-0",
|
|
475
|
+
_ === "up" ? "h-auto" : "min-h-52",
|
|
476
|
+
l
|
|
470
477
|
),
|
|
471
|
-
children:
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
id:
|
|
475
|
-
label: String(
|
|
476
|
-
value:
|
|
478
|
+
children: e.length === 0 ? /* @__PURE__ */ n.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: c }) : e.map((f) => {
|
|
479
|
+
const u = typeof f.id < "u" ? f.id : m(f, d), v = s.has(u), h = () => {
|
|
480
|
+
r({
|
|
481
|
+
id: u,
|
|
482
|
+
label: String(m(f, b)),
|
|
483
|
+
value: m(f, d)
|
|
477
484
|
});
|
|
478
|
-
}
|
|
479
|
-
return
|
|
480
|
-
key:
|
|
481
|
-
option:
|
|
482
|
-
isSelected:
|
|
485
|
+
};
|
|
486
|
+
return P ? ce.createElement(P, {
|
|
487
|
+
key: u,
|
|
488
|
+
option: f,
|
|
489
|
+
isSelected: v,
|
|
483
490
|
multiple: o,
|
|
484
|
-
onSelect:
|
|
485
|
-
disabled:
|
|
486
|
-
}) : /* @__PURE__ */
|
|
491
|
+
onSelect: h,
|
|
492
|
+
disabled: j
|
|
493
|
+
}) : /* @__PURE__ */ n.jsx(
|
|
487
494
|
me,
|
|
488
495
|
{
|
|
489
|
-
option:
|
|
496
|
+
option: f,
|
|
490
497
|
multiple: o,
|
|
491
|
-
isSelected:
|
|
492
|
-
onSelect:
|
|
493
|
-
disabled:
|
|
498
|
+
isSelected: v,
|
|
499
|
+
onSelect: r,
|
|
500
|
+
disabled: j
|
|
494
501
|
},
|
|
495
|
-
|
|
502
|
+
u
|
|
496
503
|
);
|
|
497
504
|
})
|
|
498
505
|
}
|
|
499
506
|
);
|
|
500
|
-
return
|
|
507
|
+
return g ? y : Ee(y, document.body);
|
|
501
508
|
}
|
|
502
|
-
const
|
|
509
|
+
const Be = I($e), me = I(({ option: e, isSelected: r, onSelect: l, multiple: c, disabled: s }) => (
|
|
503
510
|
// biome-ignore lint/a11y/noStaticElementInteractions: no keyboard interaction needed
|
|
504
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ n.jsxs(
|
|
505
512
|
"div",
|
|
506
513
|
{
|
|
507
514
|
onMouseDown: (o) => {
|
|
508
|
-
o.preventDefault(), o.stopPropagation(), !s &&
|
|
515
|
+
o.preventDefault(), o.stopPropagation(), !s && l?.(e);
|
|
509
516
|
},
|
|
510
517
|
className: a(
|
|
511
518
|
"px-3 py-2 cursor-pointer flex items-center transition-colors text-neutral-default-default ",
|
|
512
|
-
|
|
519
|
+
r ? "bg-neutral-medium-selected text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover",
|
|
513
520
|
s && "text-neutral-default-disabled hover:bg-neutral-default-default"
|
|
514
521
|
),
|
|
515
522
|
children: [
|
|
516
|
-
c && /* @__PURE__ */
|
|
517
|
-
|
|
523
|
+
c && /* @__PURE__ */ n.jsx(
|
|
524
|
+
Se,
|
|
518
525
|
{
|
|
519
|
-
checked:
|
|
526
|
+
checked: r,
|
|
520
527
|
disabled: s
|
|
521
528
|
}
|
|
522
529
|
),
|
|
523
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ n.jsx("span", { children: e.label })
|
|
524
531
|
]
|
|
525
532
|
}
|
|
526
533
|
)
|
|
527
|
-
));
|
|
534
|
+
), (e, r) => e.isSelected === r.isSelected);
|
|
528
535
|
me.displayName = "DefaultOptionRenderer";
|
|
529
|
-
const xe =
|
|
530
|
-
|
|
536
|
+
const xe = I(({ selectedOptions: e, placeholder: r, onRemoveOption: l, displayMode: c, multiple: s, className: o, disabled: g }) => e?.length === 0 ? r ? /* @__PURE__ */ n.jsx("span", { className: "text-neutral-medium-default opacity-50", children: r }) : null : c === "chips" && s ? /* @__PURE__ */ n.jsx("div", { className: a("flex items-center gap-1 ", o), children: e.map((x) => /* @__PURE__ */ n.jsx(
|
|
537
|
+
_e,
|
|
531
538
|
{
|
|
532
|
-
id:
|
|
533
|
-
label:
|
|
534
|
-
onRemove:
|
|
535
|
-
disabled:
|
|
539
|
+
id: x.id,
|
|
540
|
+
label: x.label,
|
|
541
|
+
onRemove: l,
|
|
542
|
+
disabled: g
|
|
536
543
|
},
|
|
537
|
-
|
|
538
|
-
)) }) :
|
|
539
|
-
|
|
544
|
+
x.id
|
|
545
|
+
)) }) : e?.length === 1 ? /* @__PURE__ */ n.jsx("span", { children: e[0].label }) : /* @__PURE__ */ n.jsxs("span", { children: [
|
|
546
|
+
e?.length,
|
|
540
547
|
" seleccionados"
|
|
541
548
|
] }));
|
|
542
549
|
xe.displayName = "DefaultSelectionDisplay";
|
|
543
550
|
export {
|
|
544
|
-
|
|
551
|
+
Fe as default
|
|
545
552
|
};
|