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