prometeo-design-system 2.3.1 → 2.3.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 +1 -1
- package/dist/{Button-Bc0LYLfg.js → Button-DsbEyjth.js} +1 -1
- package/dist/Button.es.js +1 -1
- package/dist/{CardProfile-BiYr6kY9.js → CardProfile-BhFog7j5.js} +1 -1
- package/dist/CardProfile.es.js +1 -1
- package/dist/CheckBox.es.js +1 -1
- package/dist/CheckboxFormik.es.js +1 -1
- package/dist/DatePicker.es.js +2 -2
- package/dist/DialogModal.es.js +35 -31
- 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/Icons.d.ts +48 -46
- package/dist/Icons.es.js +93 -90
- package/dist/Image.es.js +1 -1
- package/dist/ImageGallery-DnoRTpCr.js +317 -0
- 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-jDE96L2N.js → LayoutGeneric-p4Pll4Cm.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 +368 -185
- package/dist/SelectFormik.es.js +90 -72
- package/dist/Skeleton.es.js +35 -34
- 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 +31 -28
- package/dist/TabLinks.es.js +35 -33
- package/dist/Table.es.js +1 -1
- package/dist/TextArea.es.js +1 -1
- package/dist/Tooltip.es.js +1 -1
- package/dist/components/Dialog/Dialog.d.ts +7 -6
- package/dist/components/Dialog/useDialogControl.d.ts +4 -3
- package/dist/components/Select/Select.d.ts +33 -13
- package/dist/components/SelectFormik/SelectFormik.d.ts +4 -2
- package/dist/components/Skeleton/Skeleton.d.ts +5 -2
- package/dist/components/Switch/Switch.d.ts +5 -2
- package/dist/components/TabLinks/TabLinks.d.ts +2 -2
- package/dist/exports/Select.d.ts +1 -1
- package/dist/hooks/useDragScroll.d.ts +29 -0
- package/dist/hooks/useLabelBackground.d.ts +5 -0
- package/dist/index.d.ts +8 -8
- package/dist/{jsx-runtime-ByW6EXIE.js → jsx-runtime-DKDX3adD.js} +94 -96
- package/dist/pages/SelectsPage.d.ts +2 -0
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +6 -6
- package/dist/useDragScroll-CHN9OMwn.js +165 -0
- package/package.json +4 -4
- package/src/styles/intellisense.css +5 -0
- package/dist/ImageGallery-O5Y4oBrD.js +0 -352
- package/dist/lib/utils.d.ts +0 -1
- package/dist/preview/Select.d.ts +0 -2
package/dist/Select.es.js
CHANGED
|
@@ -1,211 +1,394 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { Icons as
|
|
3
|
-
import { c as
|
|
4
|
-
import { memo as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { j as r } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
+
import { Icons as T } from "./Icons.es.js";
|
|
3
|
+
import { c as p } from "./cn-B6yFEsav.js";
|
|
4
|
+
import Z, { useRef as $, useLayoutEffect as me, memo as S, useState as V, useMemo as Y, useEffect as U, useCallback as R } from "react";
|
|
5
|
+
import xe from "./Spinner.es.js";
|
|
6
|
+
import { createPortal as ge } from "react-dom";
|
|
7
|
+
import { u as pe } from "./useDragScroll-CHN9OMwn.js";
|
|
8
|
+
const ye = (n) => {
|
|
9
|
+
let t = n;
|
|
10
|
+
for (; t && t !== document.body; ) {
|
|
11
|
+
const s = window.getComputedStyle(t).backgroundColor;
|
|
12
|
+
if (s && s !== "transparent" && s !== "rgba(0, 0, 0, 0)")
|
|
13
|
+
return s;
|
|
14
|
+
t = t.parentElement;
|
|
15
|
+
}
|
|
16
|
+
const o = window.getComputedStyle(document.body).backgroundColor;
|
|
17
|
+
return o && o !== "transparent" && o !== "rgba(0, 0, 0, 0)" ? o : "rgb(255, 255, 255)";
|
|
18
|
+
};
|
|
19
|
+
function he() {
|
|
20
|
+
const n = $(null);
|
|
21
|
+
return me(() => {
|
|
22
|
+
if (!n.current || !n.current.parentElement) return;
|
|
23
|
+
const t = ye(n.current.parentElement);
|
|
24
|
+
n.current.style.backgroundColor = t;
|
|
25
|
+
}, []), {
|
|
26
|
+
ref: n
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function x(n, t) {
|
|
30
|
+
if (typeof t == "function")
|
|
31
|
+
return t(n);
|
|
32
|
+
const o = t.split(".");
|
|
33
|
+
let c = n;
|
|
34
|
+
for (const s of o)
|
|
35
|
+
if (c && typeof c == "object" && s in c)
|
|
36
|
+
c = c[s];
|
|
37
|
+
else
|
|
38
|
+
return;
|
|
39
|
+
return c;
|
|
40
|
+
}
|
|
41
|
+
const be = ({
|
|
42
|
+
label: n,
|
|
43
|
+
onOptionClick: t,
|
|
44
|
+
value: o = [],
|
|
45
|
+
isFetching: c = !1,
|
|
46
|
+
options: s,
|
|
47
|
+
multiple: i = !1,
|
|
48
|
+
onClear: g,
|
|
49
|
+
onClose: y,
|
|
50
|
+
className: u,
|
|
51
|
+
id: w,
|
|
52
|
+
emptyMessage: C = "No hay opciones disponibles",
|
|
53
|
+
optionValue: d,
|
|
54
|
+
optionLabel: h,
|
|
55
|
+
renderOption: M,
|
|
56
|
+
placeholder: j,
|
|
57
|
+
renderSelection: P,
|
|
58
|
+
containerClassName: B,
|
|
59
|
+
buttonClassName: k,
|
|
60
|
+
dropdownClassName: G,
|
|
61
|
+
displayMode: H = "compact",
|
|
62
|
+
onRemoveOption: E,
|
|
63
|
+
width: a = "100%",
|
|
29
64
|
height: l,
|
|
30
|
-
labelVariant:
|
|
65
|
+
labelVariant: f = "default",
|
|
66
|
+
attachToParent: D = !1,
|
|
67
|
+
name: b,
|
|
68
|
+
overflow: ne = "wrap",
|
|
69
|
+
onChange: O
|
|
31
70
|
}) => {
|
|
32
|
-
const [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
oe(() => {
|
|
36
|
-
|
|
37
|
-
|
|
71
|
+
const [v, W] = V(!1), I = $(null), F = $(null), { ref: se } = he(), { bind: N, ref: le } = pe({
|
|
72
|
+
axis: "x",
|
|
73
|
+
cursor: { idle: "default", dragging: "grabbing" }
|
|
74
|
+
}), _ = o && o.length > 0, K = s?.filter((e) => o.includes(x(e, d))), oe = () => f === "static" || v || _ ? "-top-2 left-2 scale-90" : "top-1/2 -translate-y-1/2 scale-100", L = {}, z = Y(() => s.map((e) => ({
|
|
75
|
+
id: x(e, d),
|
|
76
|
+
value: x(e, d),
|
|
77
|
+
label: x(e, h)
|
|
78
|
+
})), [s, d, h]);
|
|
79
|
+
a && a !== "100%" && (L.width = a), l && (L.height = l);
|
|
80
|
+
const ae = () => f === "static" ? l ? "text-sm" : "text-xs" : "text-sm", ce = () => l ? { height: l } : {};
|
|
81
|
+
U(() => {
|
|
82
|
+
const e = (m) => {
|
|
83
|
+
if (I.current) {
|
|
84
|
+
if (m.type === "mousedown" && I.current.contains(m.target) || m.type === "scroll" && F.current?.contains(m.target))
|
|
85
|
+
return;
|
|
86
|
+
W(!1);
|
|
87
|
+
}
|
|
38
88
|
};
|
|
39
|
-
return
|
|
40
|
-
document.removeEventListener("mousedown", e);
|
|
89
|
+
return document.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e, !0), () => {
|
|
90
|
+
document.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e, !0);
|
|
41
91
|
};
|
|
42
|
-
}, [
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
92
|
+
}, []);
|
|
93
|
+
const q = () => {
|
|
94
|
+
W(!v);
|
|
95
|
+
}, J = R((e) => {
|
|
96
|
+
if (console.log("onchange en el select, is multiple", i), i) {
|
|
97
|
+
const A = [...z.filter((fe) => o.includes(fe.id)), e];
|
|
98
|
+
O?.(A, b);
|
|
99
|
+
} else
|
|
100
|
+
O?.([e], b);
|
|
101
|
+
}, [i, O, b, z, o]), ie = R((e) => {
|
|
102
|
+
t?.(e, b), J(e), i || (W(!1), y?.());
|
|
103
|
+
}, [i, t, y, b, J]), ue = (e) => {
|
|
104
|
+
e.stopPropagation(), e.target.blur(), g?.();
|
|
105
|
+
}, Q = R((e) => {
|
|
106
|
+
i || O?.([], b);
|
|
107
|
+
const m = s.find((A) => x(A, d) === e);
|
|
108
|
+
m && (t?.({ id: x(m, d), label: x(m, h), value: x(m, d) }, b), E?.(m));
|
|
109
|
+
}, [t, E, h, d, s, b, i, O]), de = Y(() => f === "static" && j ? j : "", [f, j]), X = K.map((e) => x(e, d));
|
|
110
|
+
return /* @__PURE__ */ r.jsxs(
|
|
111
|
+
"div",
|
|
112
|
+
{
|
|
113
|
+
className: p(
|
|
114
|
+
"relative bg-inherit select-none",
|
|
115
|
+
B,
|
|
116
|
+
!a && "w-full",
|
|
117
|
+
f === "static" && "mt-2"
|
|
118
|
+
),
|
|
119
|
+
ref: I,
|
|
120
|
+
style: L,
|
|
121
|
+
draggable: !1,
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ r.jsxs("div", { className: p("relative bg-inherit ", u), children: [
|
|
124
|
+
/* @__PURE__ */ r.jsx(
|
|
125
|
+
"label",
|
|
126
|
+
{
|
|
127
|
+
htmlFor: w,
|
|
128
|
+
ref: se,
|
|
129
|
+
className: p(
|
|
130
|
+
"absolute left-3 pointer-events-none bg-inherit px-1 z-10",
|
|
131
|
+
f === "default" && "transition-all duration-200 ease-in-out",
|
|
132
|
+
ae(),
|
|
133
|
+
oe(),
|
|
134
|
+
_ || v ? "text-primary-default-default" : "text-neutral-medium-default"
|
|
135
|
+
),
|
|
136
|
+
children: n
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ r.jsxs(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
role: "button",
|
|
143
|
+
id: w,
|
|
144
|
+
onClick: q,
|
|
145
|
+
onKeyDown: (e) => {
|
|
146
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), q());
|
|
147
|
+
},
|
|
148
|
+
tabIndex: 0,
|
|
149
|
+
className: p(
|
|
150
|
+
"w-full px-2 text-left border rounded-lg transition-all duration-200 ease-in-out",
|
|
151
|
+
"flex items-center justify-start bg-inherit gap-2 ",
|
|
152
|
+
"focus:outline-none",
|
|
153
|
+
H === "chips" && i && _ ? "min-h-12 py-2" : !l && "h-12",
|
|
154
|
+
v ? "border-primary-default-default ring-[1px] ring-primary-default-default" : "border-neutral-default-default hover:border-neutral-strong-default",
|
|
155
|
+
k
|
|
156
|
+
),
|
|
157
|
+
style: ce(),
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ r.jsx(
|
|
160
|
+
"div",
|
|
161
|
+
{
|
|
162
|
+
className: p("flex-1 overflow-x-auto overflow-y-hidden px-1 prometeo-scrollbar-none"),
|
|
163
|
+
ref: le,
|
|
164
|
+
onPointerDown: N.onPointerDown,
|
|
165
|
+
onPointerMove: N.onPointerMove,
|
|
166
|
+
onPointerUp: N.onPointerUp,
|
|
167
|
+
onPointerLeave: N.onPointerLeave,
|
|
168
|
+
onPointerCancel: N.onPointerCancel,
|
|
169
|
+
onClickCapture: N.onClickCapture,
|
|
170
|
+
children: P ? Z.createElement(P, {
|
|
171
|
+
selectedOptions: K,
|
|
172
|
+
placeholder: j,
|
|
173
|
+
multiple: i,
|
|
174
|
+
onRemoveOption: (e) => {
|
|
175
|
+
Q(e);
|
|
176
|
+
}
|
|
177
|
+
}) : /* @__PURE__ */ r.jsx(
|
|
178
|
+
te,
|
|
179
|
+
{
|
|
180
|
+
displayMode: H,
|
|
181
|
+
selectedOptions: z.filter((e) => X.includes(e.id)),
|
|
182
|
+
placeholder: de,
|
|
183
|
+
onRemoveOption: Q,
|
|
184
|
+
multiple: i,
|
|
185
|
+
className: p(ne === "scroll" ? "flex-nowrap" : "flex-wrap")
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
191
|
+
c && /* @__PURE__ */ r.jsx(xe, { size: "small" }),
|
|
192
|
+
_ && g && /* @__PURE__ */ r.jsx(
|
|
193
|
+
"button",
|
|
194
|
+
{
|
|
195
|
+
onMouseDown: (e) => {
|
|
196
|
+
e.preventDefault(), e.stopPropagation(), ue(e);
|
|
197
|
+
},
|
|
198
|
+
className: "text-neutral-medium-default hover:text-neutral-default-default transition-colors",
|
|
199
|
+
type: "button",
|
|
200
|
+
tabIndex: -1,
|
|
201
|
+
children: /* @__PURE__ */ r.jsx(T.Close, { size: 16, className: "" })
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
/* @__PURE__ */ r.jsx(
|
|
205
|
+
T.ChevronDown,
|
|
206
|
+
{
|
|
207
|
+
size: 20,
|
|
208
|
+
className: p(
|
|
209
|
+
"transition-transform text-neutral-default-default",
|
|
210
|
+
v ? "rotate-180" : ""
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
] })
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
] }),
|
|
219
|
+
/* @__PURE__ */ r.jsx(
|
|
220
|
+
we,
|
|
221
|
+
{
|
|
222
|
+
options: M ? s : z,
|
|
223
|
+
selectedOptionsIds: X,
|
|
224
|
+
onOptionClick: ie,
|
|
225
|
+
emptyMessage: C,
|
|
226
|
+
dropdownClassName: G,
|
|
227
|
+
multiple: i,
|
|
228
|
+
attachToParent: D,
|
|
229
|
+
selectRef: I,
|
|
230
|
+
dropdownRef: F,
|
|
231
|
+
isOpen: v,
|
|
232
|
+
renderOption: M,
|
|
233
|
+
optionLabel: h,
|
|
234
|
+
optionValue: d
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
}, Ce = S(be);
|
|
241
|
+
function De({
|
|
242
|
+
options: n,
|
|
243
|
+
onOptionClick: t,
|
|
244
|
+
dropdownClassName: o,
|
|
245
|
+
emptyMessage: c,
|
|
246
|
+
selectedOptionsIds: s,
|
|
247
|
+
multiple: i,
|
|
248
|
+
attachToParent: g,
|
|
249
|
+
selectRef: y,
|
|
250
|
+
dropdownRef: u,
|
|
251
|
+
isOpen: w,
|
|
252
|
+
renderOption: C,
|
|
253
|
+
optionValue: d,
|
|
254
|
+
optionLabel: h
|
|
255
|
+
}) {
|
|
256
|
+
const [P, B] = V("down"), k = (a) => {
|
|
257
|
+
if (!u.current || !y.current) return;
|
|
258
|
+
const l = y.current.getBoundingClientRect();
|
|
259
|
+
switch (a || P) {
|
|
260
|
+
case "down":
|
|
261
|
+
u.current.style.top = `${l.top + l.height}px`;
|
|
262
|
+
break;
|
|
263
|
+
case "up":
|
|
264
|
+
u.current.style.top = `${l.top - 240 - 16}px`;
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
u.current.style.left = `${l.left}px`, u.current.style.width = `${l.width}px`;
|
|
268
|
+
}, G = () => {
|
|
269
|
+
if (!u.current || !y.current) return P;
|
|
270
|
+
const a = y.current.getBoundingClientRect(), l = a.bottom + 240 < window.innerHeight, f = a.top - 240 - 16 > 0;
|
|
271
|
+
let D = "down";
|
|
272
|
+
return l ? D = "down" : f && (D = "up"), D;
|
|
273
|
+
}, H = (a) => {
|
|
274
|
+
if (!(!u.current || !y.current)) {
|
|
275
|
+
if (u.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !a) {
|
|
276
|
+
u.current.style.maxHeight = "0", u.current.style.opacity = "0";
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
if (!g) {
|
|
280
|
+
const l = G();
|
|
281
|
+
B(l), k(l);
|
|
66
282
|
}
|
|
67
|
-
|
|
68
|
-
] }), Z = () => {
|
|
69
|
-
if (i.current) {
|
|
70
|
-
const e = i.current.getBoundingClientRect(), n = 250, s = window.innerHeight - e.bottom, v = e.top;
|
|
71
|
-
s < n && v > n ? R("up") : R("down");
|
|
283
|
+
u.current.style.maxHeight = "240px", u.current.style.opacity = "1";
|
|
72
284
|
}
|
|
73
|
-
}
|
|
285
|
+
};
|
|
286
|
+
U(() => {
|
|
287
|
+
g || !y.current || !w || k();
|
|
288
|
+
}, [s]), U(() => {
|
|
289
|
+
H(w);
|
|
290
|
+
}, [w]);
|
|
291
|
+
const E = /* @__PURE__ */ r.jsx(
|
|
74
292
|
"div",
|
|
75
293
|
{
|
|
76
|
-
|
|
77
|
-
|
|
294
|
+
ref: u,
|
|
295
|
+
style: {
|
|
296
|
+
opacity: "0",
|
|
297
|
+
maxHeight: "0"
|
|
78
298
|
},
|
|
79
|
-
className:
|
|
299
|
+
className: p(
|
|
300
|
+
" z-50 w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-md shadow-lg",
|
|
301
|
+
"max-h-60 overflow-auto",
|
|
302
|
+
g ? "absolute z-50 " : "fixed z-100 top-0 left-0",
|
|
303
|
+
o
|
|
304
|
+
),
|
|
305
|
+
children: n.length === 0 ? /* @__PURE__ */ r.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: c }) : n.map((a) => {
|
|
306
|
+
const l = typeof a.id < "u" ? a.id : x(a, d), f = s.includes(l), D = R(() => {
|
|
307
|
+
t({
|
|
308
|
+
id: l,
|
|
309
|
+
label: String(x(a, h)),
|
|
310
|
+
value: x(a, d)
|
|
311
|
+
});
|
|
312
|
+
}, [t, l, h, d, a]);
|
|
313
|
+
return C ? Z.createElement(C, {
|
|
314
|
+
key: l,
|
|
315
|
+
option: a,
|
|
316
|
+
isSelected: f,
|
|
317
|
+
multiple: i,
|
|
318
|
+
onSelect: D
|
|
319
|
+
}) : /* @__PURE__ */ r.jsx(
|
|
320
|
+
ee,
|
|
321
|
+
{
|
|
322
|
+
option: a,
|
|
323
|
+
multiple: i,
|
|
324
|
+
isSelected: f,
|
|
325
|
+
onSelect: t
|
|
326
|
+
},
|
|
327
|
+
l
|
|
328
|
+
);
|
|
329
|
+
})
|
|
330
|
+
}
|
|
331
|
+
);
|
|
332
|
+
return g ? E : ge(E, document.body);
|
|
333
|
+
}
|
|
334
|
+
const we = S(De), ee = S(({ option: n, isSelected: t, onSelect: o, multiple: c }) => (
|
|
335
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: no keyboard interaction needed
|
|
336
|
+
/* @__PURE__ */ r.jsxs(
|
|
337
|
+
"div",
|
|
338
|
+
{
|
|
339
|
+
onMouseDown: (s) => {
|
|
340
|
+
s.preventDefault(), o?.(n), s.stopPropagation();
|
|
341
|
+
},
|
|
342
|
+
className: p(
|
|
80
343
|
"px-3 py-2 cursor-pointer flex items-center transition-colors",
|
|
81
|
-
|
|
344
|
+
t ? "bg-primary-default-default text-white" : "hover:bg-neutral-medium-selected text-neutral-default-default"
|
|
82
345
|
),
|
|
83
346
|
children: [
|
|
84
|
-
|
|
347
|
+
c && /* @__PURE__ */ r.jsx(
|
|
85
348
|
"input",
|
|
86
349
|
{
|
|
87
350
|
type: "checkbox",
|
|
88
|
-
checked:
|
|
351
|
+
checked: t,
|
|
89
352
|
onChange: () => {
|
|
90
353
|
},
|
|
91
354
|
className: "mr-2 pointer-events-none"
|
|
92
355
|
}
|
|
93
356
|
),
|
|
94
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ r.jsx("span", { children: n.label })
|
|
95
358
|
]
|
|
96
359
|
}
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
360
|
+
)
|
|
361
|
+
));
|
|
362
|
+
ee.displayName = "DefaultOptionRenderer";
|
|
363
|
+
const te = S(({ selectedOptions: n, placeholder: t, onRemoveOption: o, displayMode: c, multiple: s, className: i }) => n?.length === 0 ? t ? /* @__PURE__ */ r.jsx("span", { className: "text-neutral-medium-default opacity-50", children: t }) : null : c === "chips" && s ? /* @__PURE__ */ r.jsx("div", { className: p("flex items-center gap-1 ", i), children: n.map((g) => /* @__PURE__ */ r.jsx(
|
|
364
|
+
re,
|
|
365
|
+
{
|
|
366
|
+
id: g.id,
|
|
367
|
+
label: g.label,
|
|
368
|
+
onRemove: o
|
|
369
|
+
},
|
|
370
|
+
g.id
|
|
371
|
+
)) }) : n?.length === 1 ? /* @__PURE__ */ r.jsx("span", { children: n[0].label }) : /* @__PURE__ */ r.jsxs("span", { children: [
|
|
372
|
+
n?.length,
|
|
373
|
+
" seleccionados"
|
|
374
|
+
] }));
|
|
375
|
+
te.displayName = "DefaultSelectionDisplay";
|
|
376
|
+
const re = S(({ id: n, label: t, onRemove: o, className: c }) => /* @__PURE__ */ r.jsxs("div", { className: "inline-flex max-w-[calc(50%-0.25rem)] items-center gap-1 px-2 py-1 bg-primary-default-default text-white text-xs rounded-md", children: [
|
|
377
|
+
/* @__PURE__ */ r.jsx("span", { className: "truncate w-max ", children: t }),
|
|
378
|
+
/* @__PURE__ */ r.jsx(
|
|
379
|
+
"button",
|
|
110
380
|
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
style: j,
|
|
119
|
-
children: /* @__PURE__ */ t.jsxs("div", { className: o("relative bg-inherit", k), children: [
|
|
120
|
-
/* @__PURE__ */ t.jsxs(
|
|
121
|
-
"button",
|
|
122
|
-
{
|
|
123
|
-
id: D,
|
|
124
|
-
type: "button",
|
|
125
|
-
onClick: Q,
|
|
126
|
-
onFocus: () => b(!0),
|
|
127
|
-
onBlur: () => b(!1),
|
|
128
|
-
className: o(
|
|
129
|
-
"w-full px-3 text-left border-1 rounded-lg transition-all duration-200 ease-in-out",
|
|
130
|
-
"flex items-center justify-between bg-inherit",
|
|
131
|
-
"focus:outline-none",
|
|
132
|
-
C === "chips" && d && m ? "min-h-12 py-2" : !l && "h-12",
|
|
133
|
-
r || g ? "border-primary-default-default border-2" : "border-neutral-default-default hover:border-neutral-strong-default",
|
|
134
|
-
L
|
|
135
|
-
),
|
|
136
|
-
style: K(),
|
|
137
|
-
children: [
|
|
138
|
-
/* @__PURE__ */ t.jsx(
|
|
139
|
-
"label",
|
|
140
|
-
{
|
|
141
|
-
htmlFor: D,
|
|
142
|
-
className: o(
|
|
143
|
-
"absolute left-3 pointer-events-none bg-inherit px-1 z-10",
|
|
144
|
-
c === "default" && "transition-all duration-200 ease-in-out",
|
|
145
|
-
J(),
|
|
146
|
-
G(),
|
|
147
|
-
m || r || g ? "text-primary-default-default" : "text-neutral-medium-default"
|
|
148
|
-
),
|
|
149
|
-
children: I
|
|
150
|
-
}
|
|
151
|
-
),
|
|
152
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ t.jsx(ne, { selectedOptions: q, placeholder: V() }) }),
|
|
153
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 ml-2", children: [
|
|
154
|
-
O && /* @__PURE__ */ t.jsx(le, { size: "small" }),
|
|
155
|
-
m && N && /* @__PURE__ */ t.jsx(
|
|
156
|
-
"button",
|
|
157
|
-
{
|
|
158
|
-
onMouseDown: (e) => {
|
|
159
|
-
e.preventDefault(), e.stopPropagation(), W(e);
|
|
160
|
-
},
|
|
161
|
-
className: "text-neutral-medium-default hover:text-neutral-default-default transition-colors",
|
|
162
|
-
type: "button",
|
|
163
|
-
tabIndex: -1,
|
|
164
|
-
children: /* @__PURE__ */ t.jsx(w.Close, { size: 16, className: "" })
|
|
165
|
-
}
|
|
166
|
-
),
|
|
167
|
-
/* @__PURE__ */ t.jsx(
|
|
168
|
-
w.ChevronDown,
|
|
169
|
-
{
|
|
170
|
-
size: 20,
|
|
171
|
-
className: o(
|
|
172
|
-
"transition-transform text-neutral-default-default",
|
|
173
|
-
r ? "rotate-180" : ""
|
|
174
|
-
)
|
|
175
|
-
}
|
|
176
|
-
)
|
|
177
|
-
] })
|
|
178
|
-
]
|
|
179
|
-
}
|
|
180
|
-
),
|
|
181
|
-
r && /* @__PURE__ */ t.jsx(
|
|
182
|
-
"div",
|
|
183
|
-
{
|
|
184
|
-
className: o(
|
|
185
|
-
"absolute z-50 w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-md shadow-lg",
|
|
186
|
-
"max-h-60 overflow-auto",
|
|
187
|
-
$ === "up" ? "bottom-full mb-1" : "top-full mt-1",
|
|
188
|
-
A
|
|
189
|
-
),
|
|
190
|
-
children: p.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: B }) : p.map((e) => {
|
|
191
|
-
const n = a(e), s = u.includes(n);
|
|
192
|
-
return /* @__PURE__ */ t.jsx(
|
|
193
|
-
te,
|
|
194
|
-
{
|
|
195
|
-
option: e,
|
|
196
|
-
isSelected: s,
|
|
197
|
-
onSelect: () => U(e),
|
|
198
|
-
isMultiple: d
|
|
199
|
-
},
|
|
200
|
-
n
|
|
201
|
-
);
|
|
202
|
-
})
|
|
203
|
-
}
|
|
204
|
-
)
|
|
205
|
-
] })
|
|
381
|
+
onMouseDown: (s) => {
|
|
382
|
+
s.preventDefault(), o?.(n);
|
|
383
|
+
},
|
|
384
|
+
className: p("shrink-0 hover:bg-primary-strong-default rounded-sm p-0.5 transition-colors", c),
|
|
385
|
+
type: "button",
|
|
386
|
+
tabIndex: -1,
|
|
387
|
+
children: /* @__PURE__ */ r.jsx(T.Close, { size: 12, className: "" })
|
|
206
388
|
}
|
|
207
|
-
)
|
|
208
|
-
}
|
|
389
|
+
)
|
|
390
|
+
] }));
|
|
391
|
+
re.displayName = "Chip";
|
|
209
392
|
export {
|
|
210
|
-
|
|
393
|
+
Ce as default
|
|
211
394
|
};
|