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