prometeo-design-system 4.7.1 → 4.7.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/Header.es.js +6 -6
- package/dist/IconButton.es.js +1 -1
- package/dist/Input.es.js +3 -3
- package/dist/Select.es.js +159 -163
- package/dist/TextArea.es.js +84 -60
- package/package.json +1 -1
package/dist/Header.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
2
|
import { c as i } from "./cn-B6yFEsav.js";
|
|
3
|
-
import { motion as
|
|
3
|
+
import { motion as n } from "framer-motion";
|
|
4
4
|
import { memo as f } from "react";
|
|
5
|
-
const c = ({ title: e, subtitle: l, children: m, className: d, subtitleClassName: r, titleClassName:
|
|
6
|
-
|
|
5
|
+
const c = ({ title: e, subtitle: l, children: m, className: d, subtitleClassName: r, titleClassName: o, mainActionSlot: a, secondarySlot: t }) => /* @__PURE__ */ s.jsxs(
|
|
6
|
+
n.header,
|
|
7
7
|
{
|
|
8
8
|
initial: { opacity: 0, y: -10 },
|
|
9
9
|
animate: { opacity: 1, y: 0 },
|
|
@@ -13,14 +13,14 @@ const c = ({ title: e, subtitle: l, children: m, className: d, subtitleClassName
|
|
|
13
13
|
d
|
|
14
14
|
),
|
|
15
15
|
children: [
|
|
16
|
-
/* @__PURE__ */ s.jsxs("div", { className: "md:w-full
|
|
16
|
+
/* @__PURE__ */ s.jsxs("div", { className: "md:w-full md:px-3 flex justify-between", children: [
|
|
17
17
|
a && /* @__PURE__ */ s.jsx("div", { className: "", children: typeof a == "function" ? a() : a }),
|
|
18
18
|
t && /* @__PURE__ */ s.jsx("div", { className: "hidden md:flex", children: typeof t == "function" ? t() : t })
|
|
19
19
|
] }),
|
|
20
|
-
/* @__PURE__ */ s.jsxs("div", { className: "w-full
|
|
20
|
+
/* @__PURE__ */ s.jsxs("div", { className: "w-full flex justify-between md:px-6", children: [
|
|
21
21
|
/* @__PURE__ */ s.jsxs("div", { className: i("flex flex-col leading-6 justify-center relative overflow-hidden"), children: [
|
|
22
22
|
l && /* @__PURE__ */ s.jsx("h3", { className: i(" prometeo-fonts-body-small md:prometeo-fonts-body-medium text-neutral-medium-default line-clamp-1 text-nowrap overflow-hidden text-ellipsis w-full", r), children: l }),
|
|
23
|
-
e && /* @__PURE__ */ s.jsx("h1", { className: i("prometeo-fonts-headline-xsmall md:prometeo-fonts-headline-small text-neutral-strong-default line-clamp-1 text-nowrap overflow-hidden text-ellipsis w-full wrap-break-word",
|
|
23
|
+
e && /* @__PURE__ */ s.jsx("h1", { className: i("prometeo-fonts-headline-xsmall md:prometeo-fonts-headline-small text-neutral-strong-default line-clamp-1 text-nowrap overflow-hidden text-ellipsis w-full wrap-break-word", o), children: e })
|
|
24
24
|
] }),
|
|
25
25
|
m,
|
|
26
26
|
t && /* @__PURE__ */ s.jsx("div", { className: "md:hidden", children: typeof t == "function" ? t() : t })
|
package/dist/IconButton.es.js
CHANGED
|
@@ -255,7 +255,7 @@ const g = {
|
|
|
255
255
|
if (n)
|
|
256
256
|
return /* @__PURE__ */ a.jsx("div", { className: "flex items-center justify-center", children: !b && x });
|
|
257
257
|
let t = null;
|
|
258
|
-
if (
|
|
258
|
+
if (r)
|
|
259
259
|
if (h(r))
|
|
260
260
|
v(r.type) ? t = t = /* @__PURE__ */ a.jsx(
|
|
261
261
|
"span",
|
package/dist/Input.es.js
CHANGED
|
@@ -14,7 +14,7 @@ const x = {
|
|
|
14
14
|
input: e(
|
|
15
15
|
"border-neutral-default-default text-neutral-default-default!",
|
|
16
16
|
"focus:ring-primary-default-default focus:ring-[1px] focus:border-primary-default-default ",
|
|
17
|
-
"hover:border-
|
|
17
|
+
"hover:border-primary-default-default"
|
|
18
18
|
),
|
|
19
19
|
label: e("text-neutral-medium-default"),
|
|
20
20
|
icon: e(
|
|
@@ -122,7 +122,7 @@ const x = {
|
|
|
122
122
|
T(!j);
|
|
123
123
|
}, N = {};
|
|
124
124
|
m && m !== "100%" && (N.width = m), a && (N.height = a);
|
|
125
|
-
const H = u === "error" && w, C = !H && y, G = r === "password", J = () => o === "static" ? "-top-1 -translate-y-full left-0 pl-3" : l ? `${d ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1 peer-focus:ml-0 peer-focus:mr-0 ${s === "left" ? "peer-placeholder-shown:ml-6" : "peer-placeholder-shown:mr-6"}` : `${d ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1`, K = () => a ? f.customHeight.label : f[p].label, Q = () => a ? { height: a } : {}, U = () => o === "default" ? b : E || b || "", W = () => G ? !l && !i ? "pr-10" : s === "left" ? "pl-10 pr-10" : "pr-16" : i ? l ? s === "left" ? `pl-10 pr-7 ${g === "xsmall" && "pl-8"}` : "pr-10 pl-3" : "pr-7" : l ? s === "left" ? `pl-10 pr-7 ${g === "xsmall" && "pl-[31px]"}` : "pr-10 pl-3" : "", X = o === "default" && "transition-all duration-
|
|
125
|
+
const H = u === "error" && w, C = !H && y, G = r === "password", J = () => o === "static" ? "-top-1 -translate-y-full left-0 pl-3" : l ? `${d ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1 peer-focus:ml-0 peer-focus:mr-0 ${s === "left" ? "peer-placeholder-shown:ml-6" : "peer-placeholder-shown:mr-6"}` : `${d ? "peer-placeholder-shown:top-[calc(50%-12px)]" : "peer-placeholder-shown:top-1/2"} -translate-y-1/2 peer-focus:top-0 peer-focus:left-3 peer-focus:px-1`, K = () => a ? f.customHeight.label : f[p].label, Q = () => a ? { height: a } : {}, U = () => o === "default" ? b : E || b || "", W = () => G ? !l && !i ? "pr-10" : s === "left" ? "pl-10 pr-10" : "pr-16" : i ? l ? s === "left" ? `pl-10 pr-7 ${g === "xsmall" && "pl-8"}` : "pr-10 pl-3" : "pr-7" : l ? s === "left" ? `pl-10 pr-7 ${g === "xsmall" && "pl-[31px]"}` : "pr-10 pl-3" : "", X = o === "default" && "transition-all duration-300 ease-in-out", d = w || y;
|
|
126
126
|
return /* @__PURE__ */ t.jsxs(
|
|
127
127
|
"div",
|
|
128
128
|
{
|
|
@@ -146,7 +146,7 @@ const x = {
|
|
|
146
146
|
placeholder: U(),
|
|
147
147
|
type: r === "password" && j ? "text" : r,
|
|
148
148
|
className: e(
|
|
149
|
-
"peer w-full border rounded-lg bg-transparent appearance-none transition-all duration-
|
|
149
|
+
"peer w-full border rounded-lg bg-transparent appearance-none transition-all duration-300 ease-in-out",
|
|
150
150
|
"focus:outline-none px-3",
|
|
151
151
|
o === "default" && "placeholder:text-transparent",
|
|
152
152
|
o === "static" && "placeholder:text-neutral-medium-default ",
|
package/dist/Select.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
2
|
import { c } from "./cn-B6yFEsav.js";
|
|
3
|
-
import
|
|
3
|
+
import Se, { memo as ee, useState as we, useRef as se, useMemo as Z, useCallback as _, useEffect as he, useImperativeHandle as Qe } from "react";
|
|
4
4
|
import Xe from "./Spinner.es.js";
|
|
5
5
|
import { createPortal as Ye } from "react-dom";
|
|
6
6
|
import { u as Ze } from "./useDragScroll-CHN9OMwn.js";
|
|
@@ -8,7 +8,7 @@ import { u as et } from "./useLabelBackground-D5SzHhl_.js";
|
|
|
8
8
|
import { H as tt } from "./HelperComponent-ljsn0xD6.js";
|
|
9
9
|
import nt from "./Chip.es.js";
|
|
10
10
|
import rt from "./CheckBox.es.js";
|
|
11
|
-
import { g as
|
|
11
|
+
import { g as k, h as qe } from "./utils-X4-h3cum.js";
|
|
12
12
|
import lt from "./Input.es.js";
|
|
13
13
|
import Re from "./Skeleton.es.js";
|
|
14
14
|
import { Cancel as ot } from "./Icons/Cancel.es.js";
|
|
@@ -75,7 +75,7 @@ const st = (e) => {
|
|
|
75
75
|
)
|
|
76
76
|
};
|
|
77
77
|
function it(e) {
|
|
78
|
-
const [n, p] =
|
|
78
|
+
const [n, p] = we(!1), [x, y] = we([]), [N, g] = we(""), A = se(null), f = se(null), z = se(null), $ = se(null), F = se(
|
|
79
79
|
() => {
|
|
80
80
|
}
|
|
81
81
|
), Ne = se(null), pe = se(/* @__PURE__ */ new Set()), {
|
|
@@ -88,10 +88,10 @@ function it(e) {
|
|
|
88
88
|
tabIndex: K,
|
|
89
89
|
className: M,
|
|
90
90
|
placeholder: W,
|
|
91
|
-
optionValue:
|
|
91
|
+
optionValue: O,
|
|
92
92
|
optionLabel: V,
|
|
93
93
|
renderOption: B,
|
|
94
|
-
renderOptionGroupHeader:
|
|
94
|
+
renderOptionGroupHeader: ze,
|
|
95
95
|
renderSelection: De,
|
|
96
96
|
renderOptionContext: je,
|
|
97
97
|
buttonClassName: ne,
|
|
@@ -99,7 +99,7 @@ function it(e) {
|
|
|
99
99
|
containerClassName: He,
|
|
100
100
|
dropdownOptions: v,
|
|
101
101
|
helperComponent: xe,
|
|
102
|
-
errorComponent:
|
|
102
|
+
errorComponent: Oe,
|
|
103
103
|
onRemoveOption: re,
|
|
104
104
|
onOptionClick: ie,
|
|
105
105
|
onClose: ye,
|
|
@@ -112,8 +112,8 @@ function it(e) {
|
|
|
112
112
|
displayMode: ve = "compact",
|
|
113
113
|
labelVariant: le = "default",
|
|
114
114
|
disableOpenOnFocus: Te = !1,
|
|
115
|
-
emptyMessage:
|
|
116
|
-
} = e, { ref:
|
|
115
|
+
emptyMessage: Ee = "No hay opciones disponibles"
|
|
116
|
+
} = e, { ref: ke } = et(), { bind: Q, ref: Pe } = Ze({
|
|
117
117
|
axis: "x",
|
|
118
118
|
cursor: { idle: "default", dragging: "grabbing" }
|
|
119
119
|
}), de = e.multiple ? Array.isArray(e.value) && e.value.length > 0 && e.value.every((t) => t != null && t !== "") : e.value !== void 0 && e.value !== null && e.value !== "", Le = {}, _e = Z(() => le === "static" && W ? W : "", [le, W]), Ie = Z(
|
|
@@ -133,11 +133,11 @@ function it(e) {
|
|
|
133
133
|
return t[le][l];
|
|
134
134
|
}, L = _(
|
|
135
135
|
(t) => ({
|
|
136
|
-
id:
|
|
137
|
-
value:
|
|
138
|
-
label:
|
|
136
|
+
id: k(t, O),
|
|
137
|
+
value: k(t, O),
|
|
138
|
+
label: k(t, V)
|
|
139
139
|
}),
|
|
140
|
-
[
|
|
140
|
+
[O, V]
|
|
141
141
|
), q = Z(() => st(R), [R]), fe = Z(
|
|
142
142
|
() => q.map(L),
|
|
143
143
|
[q, L]
|
|
@@ -146,18 +146,18 @@ function it(e) {
|
|
|
146
146
|
if (e.multiple)
|
|
147
147
|
e.value?.forEach((l) => {
|
|
148
148
|
const a = q?.find(
|
|
149
|
-
(b) =>
|
|
149
|
+
(b) => k(b, O) === l
|
|
150
150
|
);
|
|
151
151
|
a && t.push(a);
|
|
152
152
|
});
|
|
153
153
|
else {
|
|
154
154
|
const l = q?.find(
|
|
155
|
-
(a) =>
|
|
155
|
+
(a) => k(a, O) === e.value
|
|
156
156
|
);
|
|
157
157
|
l && t.push(l);
|
|
158
158
|
}
|
|
159
159
|
return t;
|
|
160
|
-
}, [e.value,
|
|
160
|
+
}, [e.value, O, q, e.multiple]), o = Z(
|
|
161
161
|
() => r.map(L),
|
|
162
162
|
[r, L]
|
|
163
163
|
), i = Z(
|
|
@@ -166,57 +166,57 @@ function it(e) {
|
|
|
166
166
|
), u = Z(() => {
|
|
167
167
|
const t = [];
|
|
168
168
|
return R.forEach((l, a) => {
|
|
169
|
-
const b = l,
|
|
170
|
-
if (Array.isArray(
|
|
171
|
-
const
|
|
169
|
+
const b = l, S = typeof b == "object" ? b?.options : [];
|
|
170
|
+
if (Array.isArray(S) && S.length > 0) {
|
|
171
|
+
const h = b.label, D = k(l, O), Y = `__group-${String(D ?? a)}`, me = {
|
|
172
172
|
id: Y,
|
|
173
173
|
value: Y,
|
|
174
|
-
label: typeof
|
|
174
|
+
label: typeof h == "string" ? h : String(D ?? `Grupo ${a + 1}`),
|
|
175
175
|
isGroupHeader: !0,
|
|
176
|
-
groupLabelNode:
|
|
176
|
+
groupLabelNode: h,
|
|
177
177
|
originalOption: l,
|
|
178
178
|
groupData: {
|
|
179
|
-
groupOptions:
|
|
179
|
+
groupOptions: S
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
|
-
t.push(me),
|
|
183
|
-
B ? t.push(
|
|
182
|
+
t.push(me), S.forEach((E) => {
|
|
183
|
+
B ? t.push(E) : t.push(L(E));
|
|
184
184
|
});
|
|
185
185
|
} else
|
|
186
186
|
B ? t.push(l) : t.push(L(l));
|
|
187
187
|
}), t;
|
|
188
|
-
}, [R,
|
|
188
|
+
}, [R, O, B, L]), C = _(
|
|
189
189
|
(t, l) => {
|
|
190
190
|
if (!t || t.length === 0) return;
|
|
191
191
|
const a = t.map(
|
|
192
|
-
(
|
|
192
|
+
(d) => L(d)
|
|
193
193
|
);
|
|
194
194
|
if (!e.multiple) {
|
|
195
|
-
const
|
|
196
|
-
if (!
|
|
197
|
-
const
|
|
195
|
+
const d = a[0];
|
|
196
|
+
if (!d) return;
|
|
197
|
+
const w = i.has(d.id), Ae = l ?? "toggle";
|
|
198
198
|
let Fe;
|
|
199
|
-
|
|
199
|
+
Ae === "select" || Ae === "toggle" && !w ? Fe = d : Fe = void 0, e.onChange?.(Fe, j);
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
|
-
const b = e.value || [],
|
|
203
|
-
b.forEach((
|
|
204
|
-
const
|
|
205
|
-
|
|
202
|
+
const b = e.value || [], S = [];
|
|
203
|
+
b.forEach((d) => {
|
|
204
|
+
const w = fe.find((Ae) => Ae.value === d);
|
|
205
|
+
w && S.push(w);
|
|
206
206
|
});
|
|
207
|
-
const
|
|
208
|
-
(
|
|
209
|
-
), me = l ?? "toggle",
|
|
207
|
+
const h = new Set(S.map((d) => d.id)), D = new Set(a.map((d) => d.id)), Y = a.every(
|
|
208
|
+
(d) => h.has(d.id)
|
|
209
|
+
), me = l ?? "toggle", E = me === "select" || me === "toggle" && !Y;
|
|
210
210
|
let Ce;
|
|
211
|
-
if (!
|
|
212
|
-
Ce =
|
|
211
|
+
if (!E)
|
|
212
|
+
Ce = S.filter((d) => !D.has(d.id));
|
|
213
213
|
else {
|
|
214
|
-
const
|
|
215
|
-
|
|
214
|
+
const d = new Map(
|
|
215
|
+
S.map((w) => [w.id, w])
|
|
216
216
|
);
|
|
217
|
-
a.forEach((
|
|
218
|
-
|
|
219
|
-
}), Ce = Array.from(
|
|
217
|
+
a.forEach((w) => {
|
|
218
|
+
d.set(w.id, w);
|
|
219
|
+
}), Ce = Array.from(d.values());
|
|
220
220
|
}
|
|
221
221
|
e.onChange?.(Ce, j);
|
|
222
222
|
},
|
|
@@ -237,17 +237,17 @@ function it(e) {
|
|
|
237
237
|
e.onChange?.(t, j);
|
|
238
238
|
else {
|
|
239
239
|
const l = e.value || [], a = [], b = l.includes(t.value);
|
|
240
|
-
l.forEach((
|
|
240
|
+
l.forEach((h) => {
|
|
241
241
|
const D = fe.find(
|
|
242
|
-
(Y) => Y.value ===
|
|
242
|
+
(Y) => Y.value === h
|
|
243
243
|
);
|
|
244
244
|
D && a.push(D);
|
|
245
245
|
});
|
|
246
|
-
const
|
|
247
|
-
e.onChange?.(
|
|
246
|
+
const S = b ? a.filter((h) => h.value !== t.value) : [...a, t];
|
|
247
|
+
e.onChange?.(S, j);
|
|
248
248
|
}
|
|
249
249
|
};
|
|
250
|
-
const
|
|
250
|
+
const m = _(
|
|
251
251
|
(t, l = !1) => {
|
|
252
252
|
ie?.(t, j), F.current?.(t), l && (p(!1), ye?.());
|
|
253
253
|
},
|
|
@@ -264,7 +264,7 @@ function it(e) {
|
|
|
264
264
|
(t) => {
|
|
265
265
|
e.multiple || e.onChange?.(void 0, j);
|
|
266
266
|
const l = q.find(
|
|
267
|
-
(b) =>
|
|
267
|
+
(b) => k(b, O) === t
|
|
268
268
|
);
|
|
269
269
|
if (!l) return;
|
|
270
270
|
const a = L(l);
|
|
@@ -278,7 +278,7 @@ function it(e) {
|
|
|
278
278
|
e.multiple,
|
|
279
279
|
e.onChange,
|
|
280
280
|
L,
|
|
281
|
-
|
|
281
|
+
O
|
|
282
282
|
]
|
|
283
283
|
), X = _(
|
|
284
284
|
(t) => {
|
|
@@ -289,30 +289,26 @@ function it(e) {
|
|
|
289
289
|
he(() => {
|
|
290
290
|
if (!n) return;
|
|
291
291
|
let t = !1, l = 0;
|
|
292
|
-
const a = (
|
|
293
|
-
const D =
|
|
294
|
-
if (
|
|
295
|
-
if (
|
|
292
|
+
const a = (h) => {
|
|
293
|
+
const D = h.target;
|
|
294
|
+
if (h.type === "mousedown") {
|
|
295
|
+
if (A.current?.contains(D) || f.current?.contains(D)) return;
|
|
296
296
|
p(!1);
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
299
|
-
if (
|
|
300
|
-
console.log("ignoring scroll - keyboard related");
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
if (m.current?.contains(D)) return;
|
|
298
|
+
if (h.type === "scroll") {
|
|
299
|
+
if (t || Date.now() - l < 500 || f.current?.contains(D)) return;
|
|
304
300
|
p(!1);
|
|
305
301
|
}
|
|
306
|
-
|
|
307
|
-
}, b = (
|
|
308
|
-
const D =
|
|
309
|
-
oe(D) && (
|
|
310
|
-
},
|
|
311
|
-
const D =
|
|
312
|
-
oe(D) && (
|
|
302
|
+
h.type === "resize" && p(!1);
|
|
303
|
+
}, b = (h) => {
|
|
304
|
+
const D = h.target;
|
|
305
|
+
oe(D) && (t = !0, l = Date.now());
|
|
306
|
+
}, S = (h) => {
|
|
307
|
+
const D = h.target;
|
|
308
|
+
oe(D) && (t = !1);
|
|
313
309
|
};
|
|
314
|
-
return document.addEventListener("focusin", b), document.addEventListener("focusout",
|
|
315
|
-
document.removeEventListener("focusin", b), document.removeEventListener("focusout",
|
|
310
|
+
return document.addEventListener("focusin", b), document.addEventListener("focusout", S), document.addEventListener("mousedown", a), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a, !0), () => {
|
|
311
|
+
document.removeEventListener("focusin", b), document.removeEventListener("focusout", S), document.removeEventListener("mousedown", a), window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a, !0);
|
|
316
312
|
};
|
|
317
313
|
}, [n]), he(() => {
|
|
318
314
|
pe.current.forEach((t) => {
|
|
@@ -331,28 +327,28 @@ function it(e) {
|
|
|
331
327
|
p(!1);
|
|
332
328
|
},
|
|
333
329
|
toggle: () => p((t) => !t),
|
|
334
|
-
handleOptionSelect:
|
|
330
|
+
handleOptionSelect: m,
|
|
335
331
|
subscribeOpenChange: (t) => (pe.current.add(t), () => {
|
|
336
332
|
pe.current.delete(t);
|
|
337
333
|
}),
|
|
338
|
-
searchInputRef:
|
|
334
|
+
searchInputRef: z
|
|
339
335
|
}),
|
|
340
|
-
[n,
|
|
336
|
+
[n, m]
|
|
341
337
|
);
|
|
342
338
|
const ae = (t) => {
|
|
343
339
|
t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !Te && !n && (p(!0), setTimeout(() => {
|
|
344
|
-
|
|
340
|
+
z.current?.focus();
|
|
345
341
|
}, 10));
|
|
346
342
|
}, Ge = (t) => {
|
|
347
343
|
t.key === "Tab" && n && p(!1), (t.keyCode === 32 || t.key === "ArrowDown") && (p(!0), setTimeout(() => {
|
|
348
|
-
|
|
344
|
+
z.current?.focus();
|
|
349
345
|
}, 10));
|
|
350
346
|
};
|
|
351
347
|
return /* @__PURE__ */ s.jsxs(
|
|
352
348
|
"div",
|
|
353
349
|
{
|
|
354
350
|
className: c("relative bg-inherit select-none w-full", M),
|
|
355
|
-
ref:
|
|
351
|
+
ref: A,
|
|
356
352
|
draggable: !1,
|
|
357
353
|
style: Le,
|
|
358
354
|
children: [
|
|
@@ -361,7 +357,7 @@ function it(e) {
|
|
|
361
357
|
"label",
|
|
362
358
|
{
|
|
363
359
|
htmlFor: `select-${I}`,
|
|
364
|
-
ref:
|
|
360
|
+
ref: ke,
|
|
365
361
|
className: c(
|
|
366
362
|
"left-3 pointer-events-none bg-inherit z-10 line-clamp-1 max-w-[calc(100%-2.5rem)] ",
|
|
367
363
|
le === "default" && "transition-all duration-200 ease-in-out",
|
|
@@ -408,7 +404,7 @@ function it(e) {
|
|
|
408
404
|
onPointerLeave: Q.onPointerLeave,
|
|
409
405
|
onPointerCancel: Q.onPointerCancel,
|
|
410
406
|
onClickCapture: Q.onClickCapture,
|
|
411
|
-
children: De ?
|
|
407
|
+
children: De ? Se.createElement(
|
|
412
408
|
ee(
|
|
413
409
|
De,
|
|
414
410
|
(t, l) => t.disabled === l.disabled && t.multiple === l.multiple
|
|
@@ -488,12 +484,12 @@ function it(e) {
|
|
|
488
484
|
label: ge,
|
|
489
485
|
isOpen: n,
|
|
490
486
|
disabled: J,
|
|
491
|
-
optionValue:
|
|
487
|
+
optionValue: O,
|
|
492
488
|
optionLabel: V,
|
|
493
|
-
emptyMessage:
|
|
489
|
+
emptyMessage: Ee,
|
|
494
490
|
labelVariant: le,
|
|
495
491
|
renderOption: B,
|
|
496
|
-
renderOptionGroupHeader:
|
|
492
|
+
renderOptionGroupHeader: ze,
|
|
497
493
|
attachToParent: Me,
|
|
498
494
|
filteredOptions: x,
|
|
499
495
|
multiple: e.multiple || !1,
|
|
@@ -502,15 +498,15 @@ function it(e) {
|
|
|
502
498
|
setFilteredOptions: y,
|
|
503
499
|
renderOptionContext: je,
|
|
504
500
|
options: u,
|
|
505
|
-
selectRef:
|
|
506
|
-
dropdownRef:
|
|
501
|
+
selectRef: A,
|
|
502
|
+
dropdownRef: f,
|
|
507
503
|
selectButtonRef: $,
|
|
508
504
|
helperComponentRef: Ne,
|
|
509
|
-
onOptionClick:
|
|
505
|
+
onOptionClick: m,
|
|
510
506
|
onCloseDropdown: () => p(!1),
|
|
511
507
|
searchValue: Ie,
|
|
512
508
|
setSearchValue: g,
|
|
513
|
-
searchInputRef:
|
|
509
|
+
searchInputRef: z,
|
|
514
510
|
isLoading: v?.isLoading,
|
|
515
511
|
onSearchClear: v?.onSearchClear,
|
|
516
512
|
hideSearchBar: v?.hideSearchBar,
|
|
@@ -525,20 +521,20 @@ function it(e) {
|
|
|
525
521
|
onGroupSelectChange: C
|
|
526
522
|
}
|
|
527
523
|
),
|
|
528
|
-
(
|
|
524
|
+
(Oe || xe) && /* @__PURE__ */ s.jsx("div", { className: "min-h-6", children: /* @__PURE__ */ s.jsx(
|
|
529
525
|
tt,
|
|
530
526
|
{
|
|
531
527
|
ref: Ne,
|
|
532
528
|
variant: T,
|
|
533
529
|
className: "absolute bottom-0 h-5 overflow-visible line-clamp-1!",
|
|
534
|
-
children:
|
|
530
|
+
children: Oe || xe
|
|
535
531
|
}
|
|
536
532
|
) })
|
|
537
533
|
]
|
|
538
534
|
}
|
|
539
535
|
);
|
|
540
536
|
}
|
|
541
|
-
const ut = ee(it, (e, n) => e.value === n.value && e.options === n.options && e.isLoading === n.isLoading && e.disabled === n.disabled && e.errorComponent === n.errorComponent && e.helperComponent === n.helperComponent && e.variant === n.variant && e.label === n.label && e.id === n.id && e.name === n.name && e.placeholder === n.placeholder && e.renderOptionContext === n.renderOptionContext && e.dropdownOptions?.controledSearchValue === n.dropdownOptions?.controledSearchValue && e.dropdownOptions?.isLoading === n.dropdownOptions?.isLoading),
|
|
537
|
+
const ut = ee(it, (e, n) => e.value === n.value && e.options === n.options && e.isLoading === n.isLoading && e.disabled === n.disabled && e.errorComponent === n.errorComponent && e.helperComponent === n.helperComponent && e.variant === n.variant && e.label === n.label && e.id === n.id && e.name === n.name && e.placeholder === n.placeholder && e.renderOptionContext === n.renderOptionContext && e.dropdownOptions?.controledSearchValue === n.dropdownOptions?.controledSearchValue && e.dropdownOptions?.isLoading === n.dropdownOptions?.isLoading), Ot = ut;
|
|
542
538
|
function ct({
|
|
543
539
|
footer: e,
|
|
544
540
|
isOpen: n,
|
|
@@ -547,9 +543,9 @@ function ct({
|
|
|
547
543
|
multiple: y,
|
|
548
544
|
disabled: N,
|
|
549
545
|
selectRef: g,
|
|
550
|
-
inputProps:
|
|
551
|
-
dropdownRef:
|
|
552
|
-
optionLabel:
|
|
546
|
+
inputProps: A,
|
|
547
|
+
dropdownRef: f,
|
|
548
|
+
optionLabel: z,
|
|
553
549
|
optionValue: $,
|
|
554
550
|
searchValue: F,
|
|
555
551
|
labelVariant: Ne,
|
|
@@ -563,10 +559,10 @@ function ct({
|
|
|
563
559
|
setSearchValue: K,
|
|
564
560
|
dropdownHeight: M,
|
|
565
561
|
attachToParent: W,
|
|
566
|
-
filteredOptions:
|
|
562
|
+
filteredOptions: O,
|
|
567
563
|
selectButtonRef: V,
|
|
568
564
|
onCloseDropdown: B,
|
|
569
|
-
loadingComponent:
|
|
565
|
+
loadingComponent: ze,
|
|
570
566
|
dropdownClassName: De,
|
|
571
567
|
helperComponentRef: je,
|
|
572
568
|
selectedOptionsIds: ne,
|
|
@@ -574,20 +570,20 @@ function ct({
|
|
|
574
570
|
onSearchValueChange: He,
|
|
575
571
|
isLoading: v = !1,
|
|
576
572
|
hideSearchBar: xe = !1,
|
|
577
|
-
inputSearchPlaceholder:
|
|
573
|
+
inputSearchPlaceholder: Oe = "Buscar opciones",
|
|
578
574
|
enableGroupToggle: re = !0,
|
|
579
575
|
focusSearchInputOnOpen: ie = !1,
|
|
580
576
|
onGroupSelectChange: ye
|
|
581
577
|
}) {
|
|
582
|
-
const ue = e ? 380 : 320, J = Ne === "static" ? p !== "" ? -20 : 4 : 7, T = _(() => M ? M.endsWith("px") ? Number(M.replace("px", "")) : M.endsWith("vh") ? window.innerHeight * Number(M.replace("vh", "")) / 100 : M.endsWith("%") ? window.innerHeight * Number(M.replace("%", "")) / 100 : ue : ue, [M, ue])(), [ce, Me] =
|
|
578
|
+
const ue = e ? 380 : 320, J = Ne === "static" ? p !== "" ? -20 : 4 : 7, T = _(() => M ? M.endsWith("px") ? Number(M.replace("px", "")) : M.endsWith("vh") ? window.innerHeight * Number(M.replace("vh", "")) / 100 : M.endsWith("%") ? window.innerHeight * Number(M.replace("%", "")) / 100 : ue : ue, [M, ue])(), [ce, Me] = we({
|
|
583
579
|
direction: "down",
|
|
584
580
|
height: T
|
|
585
|
-
}), [ve, le] =
|
|
581
|
+
}), [ve, le] = we(
|
|
586
582
|
() => /* @__PURE__ */ new Set()
|
|
587
583
|
), Te = _(
|
|
588
584
|
(r) => !ve.has(r),
|
|
589
585
|
[ve]
|
|
590
|
-
),
|
|
586
|
+
), Ee = _(
|
|
591
587
|
(r, o) => {
|
|
592
588
|
le((i) => {
|
|
593
589
|
const u = new Set(i), C = u.has(r);
|
|
@@ -595,40 +591,40 @@ function ct({
|
|
|
595
591
|
});
|
|
596
592
|
},
|
|
597
593
|
[]
|
|
598
|
-
),
|
|
599
|
-
if (!
|
|
594
|
+
), ke = (r) => {
|
|
595
|
+
if (!f.current || !g.current) return;
|
|
600
596
|
const o = g.current.getBoundingClientRect();
|
|
601
597
|
switch (r || ce.direction) {
|
|
602
598
|
case "down":
|
|
603
|
-
|
|
599
|
+
f.current.style.top = `${o.top + o.height - (je?.current?.offsetHeight ? je?.current?.offsetHeight + 4 : 0)}px`;
|
|
604
600
|
break;
|
|
605
601
|
case "up":
|
|
606
|
-
|
|
602
|
+
f.current.style.top = "auto", f.current.style.bottom = `${window.innerHeight - o.top + J}px`;
|
|
607
603
|
break;
|
|
608
604
|
}
|
|
609
|
-
|
|
605
|
+
f.current.style.left = `${o.left}px`, f.current.style.width = `${o.width}px`;
|
|
610
606
|
}, Q = (r) => {
|
|
611
|
-
|
|
607
|
+
f.current && (f.current.style.maxHeight = `${r}px`);
|
|
612
608
|
}, Pe = () => {
|
|
613
|
-
if (!
|
|
609
|
+
if (!f.current || !g.current) return ce;
|
|
614
610
|
const r = g.current.getBoundingClientRect(), o = window.innerHeight - (window.innerHeight - r.top), i = window.innerHeight - r.bottom, u = i >= T, C = o >= T;
|
|
615
|
-
let H = "down",
|
|
616
|
-
return u ? (H = "down",
|
|
611
|
+
let H = "down", m;
|
|
612
|
+
return u ? (H = "down", m = T) : C ? (H = "up", m = T) : i > o ? (H = "down", m = i - 16) : (H = "up", m = o - 16), { direction: H, height: m };
|
|
617
613
|
}, de = (r) => {
|
|
618
|
-
if (!(!
|
|
619
|
-
if (
|
|
620
|
-
|
|
614
|
+
if (!(!f.current || !g.current)) {
|
|
615
|
+
if (f.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !r) {
|
|
616
|
+
f.current.style.maxHeight = "0", f.current.style.opacity = "0", f.current.style.pointerEvents = "none";
|
|
621
617
|
return;
|
|
622
618
|
}
|
|
623
619
|
if (!W) {
|
|
624
620
|
const o = Pe();
|
|
625
|
-
Me(o),
|
|
621
|
+
Me(o), ke(o.direction), Q(o.height);
|
|
626
622
|
}
|
|
627
|
-
|
|
623
|
+
f.current.style.opacity = "1", f.current.style.pointerEvents = "auto", ie && te?.current && te.current?.focus();
|
|
628
624
|
}
|
|
629
625
|
};
|
|
630
626
|
he(() => {
|
|
631
|
-
W || !g.current || !n ||
|
|
627
|
+
W || !g.current || !n || ke();
|
|
632
628
|
}, [ne]), he(() => {
|
|
633
629
|
de(n);
|
|
634
630
|
}, [n]), he(() => {
|
|
@@ -641,10 +637,10 @@ function ct({
|
|
|
641
637
|
const Le = (r, o) => {
|
|
642
638
|
if (!o) return r;
|
|
643
639
|
if (I) {
|
|
644
|
-
const
|
|
640
|
+
const m = [];
|
|
645
641
|
let G = null, P = [];
|
|
646
642
|
const X = () => {
|
|
647
|
-
G && P.length > 0 &&
|
|
643
|
+
G && P.length > 0 && m.push(G, ...P), G = null, P = [];
|
|
648
644
|
};
|
|
649
645
|
return r.forEach((oe) => {
|
|
650
646
|
const ae = oe;
|
|
@@ -652,26 +648,26 @@ function ct({
|
|
|
652
648
|
X(), G = ae;
|
|
653
649
|
return;
|
|
654
650
|
}
|
|
655
|
-
const t = oe, l =
|
|
651
|
+
const t = oe, l = k(
|
|
656
652
|
t,
|
|
657
|
-
|
|
653
|
+
z
|
|
658
654
|
), a = qe(String(l ?? ""), o);
|
|
659
|
-
G ? a && P.push(t) : a &&
|
|
660
|
-
}), X(),
|
|
655
|
+
G ? a && P.push(t) : a && m.push(t);
|
|
656
|
+
}), X(), m;
|
|
661
657
|
}
|
|
662
658
|
const i = [];
|
|
663
659
|
let u = null, C = [];
|
|
664
660
|
const H = () => {
|
|
665
661
|
u && C.length > 0 && i.push(u, ...C), u = null, C = [];
|
|
666
662
|
};
|
|
667
|
-
return r.forEach((
|
|
668
|
-
if (typeof
|
|
669
|
-
if ((
|
|
670
|
-
H(), u =
|
|
663
|
+
return r.forEach((m) => {
|
|
664
|
+
if (typeof m != "object" || m === null) return;
|
|
665
|
+
if ((m || {})?.isGroupHeader) {
|
|
666
|
+
H(), u = m;
|
|
671
667
|
return;
|
|
672
668
|
}
|
|
673
|
-
const G = qe(
|
|
674
|
-
u ? G && C.push(
|
|
669
|
+
const G = qe(m.label, o);
|
|
670
|
+
u ? G && C.push(m) : G && i.push(m);
|
|
675
671
|
}), H(), i;
|
|
676
672
|
}, _e = (r) => {
|
|
677
673
|
const o = Le(x, r);
|
|
@@ -688,7 +684,7 @@ function ct({
|
|
|
688
684
|
if (R) {
|
|
689
685
|
R(), U(
|
|
690
686
|
x.filter((r) => {
|
|
691
|
-
const o = I ?
|
|
687
|
+
const o = I ? k(r, $) : r.id;
|
|
692
688
|
return ne.has(o);
|
|
693
689
|
})
|
|
694
690
|
);
|
|
@@ -704,14 +700,14 @@ function ct({
|
|
|
704
700
|
K,
|
|
705
701
|
I
|
|
706
702
|
]), $e = (r) => {
|
|
707
|
-
r.key === "ArrowDown" ? (r.preventDefault(),
|
|
703
|
+
r.key === "ArrowDown" ? (r.preventDefault(), f.current?.querySelector(
|
|
708
704
|
"[role=listitem]"
|
|
709
705
|
)?.focus()) : (r.key === "Tab" || r.key === "Escape") && setTimeout(() => {
|
|
710
706
|
V.current?.focus(), B();
|
|
711
707
|
}, 10);
|
|
712
708
|
}, L = (r, o) => {
|
|
713
709
|
const i = Array.from(
|
|
714
|
-
|
|
710
|
+
f.current?.querySelectorAll("[role=listitem]") || []
|
|
715
711
|
), u = i.indexOf(r.currentTarget);
|
|
716
712
|
if (r.key === "ArrowDown") {
|
|
717
713
|
r.preventDefault();
|
|
@@ -735,7 +731,7 @@ function ct({
|
|
|
735
731
|
V.current?.focus(), B();
|
|
736
732
|
}, 10);
|
|
737
733
|
}, q = Array.from({ length: 5 }).map(
|
|
738
|
-
(r, o) => I ?
|
|
734
|
+
(r, o) => I ? Se.createElement(
|
|
739
735
|
ee(I, (i, u) => i.isSelected === u.isSelected && i.option === u.option && i.disabled === u.disabled && i.multiple === u.multiple && i.renderContext === u.renderContext),
|
|
740
736
|
{
|
|
741
737
|
key: `skeleton-option-${o}`,
|
|
@@ -765,7 +761,7 @@ function ct({
|
|
|
765
761
|
"div",
|
|
766
762
|
{
|
|
767
763
|
tabIndex: 0,
|
|
768
|
-
ref:
|
|
764
|
+
ref: f,
|
|
769
765
|
style: { opacity: "0" },
|
|
770
766
|
className: c(
|
|
771
767
|
" z-100! w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-lg shadow-lg",
|
|
@@ -803,21 +799,21 @@ function ct({
|
|
|
803
799
|
onKeyDown: $e,
|
|
804
800
|
onClear: Ie,
|
|
805
801
|
onChange: (r) => _e(r.target.value),
|
|
806
|
-
placeholder:
|
|
802
|
+
placeholder: Oe,
|
|
807
803
|
className: " bg-neutral-medium-pressed *:max-h-8",
|
|
808
|
-
...
|
|
804
|
+
...A
|
|
809
805
|
}
|
|
810
806
|
),
|
|
811
|
-
/* @__PURE__ */ s.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children:
|
|
807
|
+
/* @__PURE__ */ s.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: O.length === 0 ? v ? /* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: ze || q }) : /* @__PURE__ */ s.jsx("p", { className: "px-3 py-2 text-neutral-medium-default max-w-full text-pretty wrap-break-word ", children: F ? `No se encontraron resultados para "${F}"` : pe }) : (() => {
|
|
812
808
|
let r = !0;
|
|
813
|
-
return
|
|
814
|
-
const i = o, u = !!(i || {}).isGroupHeader, C = I && !u ?
|
|
809
|
+
return O.map((o) => {
|
|
810
|
+
const i = o, u = !!(i || {}).isGroupHeader, C = I && !u ? k(o, $) : i.id, H = ne.has(C), m = (l) => !I || u ? l : {
|
|
815
811
|
id: C,
|
|
816
|
-
label: String(
|
|
817
|
-
value:
|
|
812
|
+
label: String(k(l, z)),
|
|
813
|
+
value: k(l, $)
|
|
818
814
|
}, G = (l) => {
|
|
819
815
|
u || be(
|
|
820
|
-
|
|
816
|
+
m(o),
|
|
821
817
|
l === void 0 ? !y : l
|
|
822
818
|
);
|
|
823
819
|
}, P = (l) => {
|
|
@@ -834,7 +830,7 @@ function ct({
|
|
|
834
830
|
{
|
|
835
831
|
tabIndex: 0,
|
|
836
832
|
role: "listitem",
|
|
837
|
-
onKeyDown: (
|
|
833
|
+
onKeyDown: (S) => L(S, a),
|
|
838
834
|
className: c(
|
|
839
835
|
!b && !N && "focus-visible:bg-neutral-medium-hover outline-none hover:bg-neutral-medium-hover",
|
|
840
836
|
H && "bg-neutral-medium-selected",
|
|
@@ -849,21 +845,21 @@ function ct({
|
|
|
849
845
|
if (u) {
|
|
850
846
|
const l = i.groupLabelNode ?? i.label, a = String(i.id), b = re === !1 ? !0 : Te(a);
|
|
851
847
|
r = b;
|
|
852
|
-
const
|
|
853
|
-
re &&
|
|
854
|
-
}, Y = (
|
|
855
|
-
!
|
|
856
|
-
}, me =
|
|
857
|
-
(
|
|
858
|
-
).map((
|
|
848
|
+
const S = i.originalOption, h = i.groupData?.groupOptions ?? [], D = (E) => {
|
|
849
|
+
re && Ee(a, E);
|
|
850
|
+
}, Y = (E) => {
|
|
851
|
+
!h || h.length === 0 || ye && ye(h, E);
|
|
852
|
+
}, me = h.filter(
|
|
853
|
+
(E) => ne.has(k(E, $))
|
|
854
|
+
).map((E) => String(k(E, $)));
|
|
859
855
|
if (ge) {
|
|
860
|
-
const
|
|
856
|
+
const E = ee(
|
|
861
857
|
ge,
|
|
862
|
-
(
|
|
863
|
-
), Ce =
|
|
864
|
-
group:
|
|
858
|
+
(d, w) => d.label === w.label && d.group === w.group && d.groupOptions === w.groupOptions && d.disabled === w.disabled && d.multiple === w.multiple && d.expanded === w.expanded && d.renderContext === w.renderContext
|
|
859
|
+
), Ce = Se.createElement(E, {
|
|
860
|
+
group: S,
|
|
865
861
|
label: l,
|
|
866
|
-
groupOptions:
|
|
862
|
+
groupOptions: h,
|
|
867
863
|
multiple: y,
|
|
868
864
|
disabled: N,
|
|
869
865
|
expanded: b,
|
|
@@ -881,7 +877,7 @@ function ct({
|
|
|
881
877
|
"div",
|
|
882
878
|
{
|
|
883
879
|
className: "cursor-pointer",
|
|
884
|
-
onClick: () =>
|
|
880
|
+
onClick: () => Ee(a),
|
|
885
881
|
children: /* @__PURE__ */ s.jsx(
|
|
886
882
|
Ve,
|
|
887
883
|
{
|
|
@@ -897,7 +893,7 @@ function ct({
|
|
|
897
893
|
i
|
|
898
894
|
);
|
|
899
895
|
}
|
|
900
|
-
const oe = I ?
|
|
896
|
+
const oe = I ? Se.createElement(
|
|
901
897
|
ee(
|
|
902
898
|
I,
|
|
903
899
|
(l, a) => l.isSelected === a.isSelected && l.option === a.option && l.disabled === a.disabled && l.multiple === a.multiple && l.renderContext === a.renderContext
|
|
@@ -925,12 +921,12 @@ function ct({
|
|
|
925
921
|
C
|
|
926
922
|
), ae = X(
|
|
927
923
|
oe,
|
|
928
|
-
|
|
924
|
+
m(o)
|
|
929
925
|
);
|
|
930
926
|
if (!re)
|
|
931
927
|
return ae;
|
|
932
928
|
const Ge = !r, t = ae;
|
|
933
|
-
return
|
|
929
|
+
return Se.cloneElement(t, {
|
|
934
930
|
className: c(
|
|
935
931
|
t.props.className,
|
|
936
932
|
"overflow-hidden transition-[max-height] duration-300 ease-out",
|
|
@@ -972,13 +968,13 @@ const dt = ee(
|
|
|
972
968
|
},
|
|
973
969
|
e.id
|
|
974
970
|
);
|
|
975
|
-
const
|
|
976
|
-
|
|
977
|
-
},
|
|
971
|
+
const A = (z) => {
|
|
972
|
+
z.preventDefault(), z.stopPropagation(), !(y || g) && p?.(e);
|
|
973
|
+
}, f = g && e.groupLabelNode ? e.groupLabelNode : e.label;
|
|
978
974
|
return /* @__PURE__ */ s.jsxs(
|
|
979
975
|
"div",
|
|
980
976
|
{
|
|
981
|
-
onMouseDown:
|
|
977
|
+
onMouseDown: A,
|
|
982
978
|
className: c(
|
|
983
979
|
"px-3 py-2 flex items-center transition-colors text-neutral-default-default ",
|
|
984
980
|
g ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
|
|
@@ -987,7 +983,7 @@ const dt = ee(
|
|
|
987
983
|
),
|
|
988
984
|
children: [
|
|
989
985
|
x && !g && /* @__PURE__ */ s.jsx(rt, { checked: n, disabled: y }),
|
|
990
|
-
/* @__PURE__ */ s.jsx("span", { children:
|
|
986
|
+
/* @__PURE__ */ s.jsx("span", { children: f })
|
|
991
987
|
]
|
|
992
988
|
},
|
|
993
989
|
e.id
|
|
@@ -1005,16 +1001,16 @@ const Je = ee(
|
|
|
1005
1001
|
multiple: y,
|
|
1006
1002
|
className: N,
|
|
1007
1003
|
disabled: g
|
|
1008
|
-
}) => e?.length === 0 ? n ? /* @__PURE__ */ s.jsx("span", { className: "text-neutral-medium-default line-clamp-1", children: n }) : null : x === "chips" && y ? /* @__PURE__ */ s.jsx("div", { className: c("flex items-center gap-1 ", N), children: e.map((
|
|
1004
|
+
}) => e?.length === 0 ? n ? /* @__PURE__ */ s.jsx("span", { className: "text-neutral-medium-default line-clamp-1", children: n }) : null : x === "chips" && y ? /* @__PURE__ */ s.jsx("div", { className: c("flex items-center gap-1 ", N), children: e.map((A) => /* @__PURE__ */ s.jsx(
|
|
1009
1005
|
nt,
|
|
1010
1006
|
{
|
|
1011
1007
|
tabIndex: -1,
|
|
1012
|
-
id:
|
|
1013
|
-
label:
|
|
1008
|
+
id: A.id,
|
|
1009
|
+
label: A.label,
|
|
1014
1010
|
onRemove: p,
|
|
1015
1011
|
disabled: g
|
|
1016
1012
|
},
|
|
1017
|
-
|
|
1013
|
+
A.id
|
|
1018
1014
|
)) }) : e?.length === 1 ? /* @__PURE__ */ s.jsx("span", { className: "line-clamp-1", children: e[0].label }) : /* @__PURE__ */ s.jsxs("span", { className: "line-clamp-1", children: [
|
|
1019
1015
|
e?.length,
|
|
1020
1016
|
" seleccionados"
|
|
@@ -1023,5 +1019,5 @@ const Je = ee(
|
|
|
1023
1019
|
);
|
|
1024
1020
|
Je.displayName = "DefaultSelectionDisplay";
|
|
1025
1021
|
export {
|
|
1026
|
-
|
|
1022
|
+
Ot as default
|
|
1027
1023
|
};
|
package/dist/TextArea.es.js
CHANGED
|
@@ -1,84 +1,106 @@
|
|
|
1
1
|
import { j as r } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
2
|
import { c as a } from "./cn-B6yFEsav.js";
|
|
3
3
|
import * as o from "react";
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { c as
|
|
4
|
+
import { forwardRef as $, Children as q, isValidElement as B } from "react";
|
|
5
|
+
import { c as y } from "./index-BOQuZ0gG.js";
|
|
6
6
|
import { H as D } from "./HelperComponent-ljsn0xD6.js";
|
|
7
|
-
const F =
|
|
7
|
+
const F = y(
|
|
8
8
|
"transition-all duration-300 ease-in-out border px-3 rounded-lg flex gap-1 items-stretch relative overflow-auto prometeo-scrollbar-thin-weak",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default: "border-neutral-default-default focus-within:border-primary-default-default",
|
|
13
|
-
error: "border-error-default-default focus-within:border-error-default",
|
|
14
|
-
success: "border-success-default-default focus-within:border-success-default"
|
|
12
|
+
default: "border-neutral-default-default hover:border-primary-default-default focus-within:border-primary-default-default focus-within:ring-1 focus-within:ring-primary-default-default focus-within:hover:border-primary-default-default",
|
|
13
|
+
error: "border-error-default-default hover:border-error-strong-default focus-within:border-error-default focus-within:ring-1 focus-within:ring-error-default-default focus-within:hover:border-error-default",
|
|
14
|
+
success: "border-success-default-default hover:border-success-strong-default focus-within:border-success-default focus-within:ring-1 focus-within:ring-success-default-default focus-within:hover:border-success-default"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: {
|
|
18
18
|
variant: "default"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
),
|
|
21
|
+
), G = y(
|
|
22
|
+
"",
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
disabled: {
|
|
26
|
+
true: "border-neutral-strong-default hover:border-neutral-strong-default "
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
), J = y(
|
|
31
|
+
"",
|
|
32
|
+
{
|
|
33
|
+
variants: {
|
|
34
|
+
disabled: {
|
|
35
|
+
true: "placeholder:text-neutral-medium-disabled text-neutral-medium-disabled"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
), j = $(
|
|
22
40
|
({
|
|
23
41
|
className: t,
|
|
24
42
|
autoResize: s = !0,
|
|
25
|
-
userResize:
|
|
26
|
-
minRows:
|
|
43
|
+
userResize: c = !1,
|
|
44
|
+
minRows: d = 1,
|
|
27
45
|
maxRows: i,
|
|
28
|
-
placeholder:
|
|
29
|
-
onChange:
|
|
30
|
-
value:
|
|
31
|
-
rows:
|
|
32
|
-
disabled:
|
|
33
|
-
children:
|
|
34
|
-
variant:
|
|
35
|
-
helperComponent:
|
|
46
|
+
placeholder: A,
|
|
47
|
+
onChange: S,
|
|
48
|
+
value: k,
|
|
49
|
+
rows: n,
|
|
50
|
+
disabled: u = !1,
|
|
51
|
+
children: m,
|
|
52
|
+
variant: v = "default",
|
|
53
|
+
helperComponent: h,
|
|
36
54
|
...R
|
|
37
55
|
// ← Para pasar las props nativas
|
|
38
|
-
},
|
|
39
|
-
const
|
|
56
|
+
}, l) => {
|
|
57
|
+
const N = o.useRef(null), V = o.useRef(null), E = o.useCallback(
|
|
40
58
|
(e) => {
|
|
41
|
-
|
|
59
|
+
N.current = e, typeof l == "function" ? l(e) : l && (l.current = e);
|
|
42
60
|
},
|
|
43
|
-
[
|
|
44
|
-
),
|
|
45
|
-
const e =
|
|
61
|
+
[l]
|
|
62
|
+
), g = o.useCallback(() => {
|
|
63
|
+
const e = N.current;
|
|
46
64
|
if (!e || !s) return;
|
|
47
65
|
e.style.height = "auto";
|
|
48
|
-
const
|
|
49
|
-
let
|
|
50
|
-
if (i ||
|
|
51
|
-
const
|
|
52
|
-
|
|
66
|
+
const L = e.scrollHeight, p = Number.parseInt(getComputedStyle(e).lineHeight) || 16, O = Math.min((n ?? d) * p, V.current?.clientHeight || 0);
|
|
67
|
+
let f = Math.max(L, O);
|
|
68
|
+
if (i || n) {
|
|
69
|
+
const _ = (i || n || 1) * p;
|
|
70
|
+
f = Math.min(f, _);
|
|
53
71
|
}
|
|
54
|
-
e.style.height = `${
|
|
55
|
-
}, [s,
|
|
56
|
-
|
|
72
|
+
e.style.height = `${f}px`, f > p + 12 && (e.style.alignContent = "start");
|
|
73
|
+
}, [s, d, i]), T = (e) => {
|
|
74
|
+
S?.(e), g();
|
|
57
75
|
};
|
|
58
76
|
o.useEffect(() => {
|
|
59
|
-
|
|
60
|
-
}, [
|
|
61
|
-
const
|
|
62
|
-
let x = null,
|
|
63
|
-
return
|
|
64
|
-
if (
|
|
65
|
-
if (e.type ===
|
|
77
|
+
g();
|
|
78
|
+
}, [g]);
|
|
79
|
+
const z = () => c ? s ? "resize-x" : "resize" : "resize-none", M = typeof m == "function" ? m() : m, I = q.toArray(M);
|
|
80
|
+
let x = null, b = null;
|
|
81
|
+
return I.forEach((e) => {
|
|
82
|
+
if (B(e)) {
|
|
83
|
+
if (e.type === w && !x) {
|
|
66
84
|
x = e;
|
|
67
85
|
return;
|
|
68
86
|
}
|
|
69
|
-
if (e.type ===
|
|
70
|
-
|
|
87
|
+
if (e.type === C && !b) {
|
|
88
|
+
b = e;
|
|
71
89
|
return;
|
|
72
90
|
}
|
|
73
91
|
}
|
|
74
|
-
}), /* @__PURE__ */ r.jsxs("div", { className: a("relative",
|
|
75
|
-
/* @__PURE__ */ r.jsxs("div", { className: a(
|
|
92
|
+
}), /* @__PURE__ */ r.jsxs("div", { className: a("relative", h && "mb-6"), children: [
|
|
93
|
+
/* @__PURE__ */ r.jsxs("div", { className: a(
|
|
94
|
+
F({ variant: v, className: t }),
|
|
95
|
+
G({ disabled: u })
|
|
96
|
+
), children: [
|
|
76
97
|
x,
|
|
77
98
|
/* @__PURE__ */ r.jsx(
|
|
78
99
|
"textarea",
|
|
79
100
|
{
|
|
80
|
-
ref:
|
|
101
|
+
ref: E,
|
|
81
102
|
"data-slot": "textarea",
|
|
103
|
+
"aria-disabled": u,
|
|
82
104
|
className: a(
|
|
83
105
|
// 'border border-amber-400/30',
|
|
84
106
|
"flex-2 shrink-0 min-w-min h-fit my-3 ",
|
|
@@ -87,30 +109,32 @@ const F = B(
|
|
|
87
109
|
"content-center",
|
|
88
110
|
"outline-none",
|
|
89
111
|
"prometeo-scrollbar-thin-weak",
|
|
90
|
-
|
|
112
|
+
"disabled:text-neutral-medium-disabled",
|
|
113
|
+
z(),
|
|
114
|
+
J({ disabled: u })
|
|
91
115
|
),
|
|
92
|
-
onChange:
|
|
93
|
-
rows:
|
|
94
|
-
value:
|
|
95
|
-
placeholder:
|
|
96
|
-
disabled:
|
|
116
|
+
onChange: T,
|
|
117
|
+
rows: n ?? d,
|
|
118
|
+
value: k,
|
|
119
|
+
placeholder: A,
|
|
120
|
+
disabled: u,
|
|
97
121
|
...R
|
|
98
122
|
}
|
|
99
123
|
),
|
|
100
|
-
|
|
124
|
+
b
|
|
101
125
|
] }),
|
|
102
|
-
|
|
126
|
+
h && /* @__PURE__ */ r.jsx(D, { className: "absolute -bottom-1 left-0 translate-y-full", variant: v, children: h })
|
|
103
127
|
] });
|
|
104
128
|
}
|
|
105
|
-
),
|
|
106
|
-
const { children: s, className:
|
|
107
|
-
return /* @__PURE__ */ r.jsx("div", { className: a("slot",
|
|
108
|
-
},
|
|
109
|
-
Root:
|
|
110
|
-
LeftSlot:
|
|
111
|
-
RightSlot:
|
|
129
|
+
), H = (t) => {
|
|
130
|
+
const { children: s, className: c } = t;
|
|
131
|
+
return /* @__PURE__ */ r.jsx("div", { className: a("slot", c), children: s });
|
|
132
|
+
}, w = (t) => /* @__PURE__ */ r.jsx(H, { ...t, className: a("left-slot flex gap-1 items-center py-3", t?.className) }), C = (t) => /* @__PURE__ */ r.jsx(H, { ...t, className: a("right-slot flex gap-1 items-end py-3", t?.className) }), K = Object.assign(j, {
|
|
133
|
+
Root: j,
|
|
134
|
+
LeftSlot: w,
|
|
135
|
+
RightSlot: C
|
|
112
136
|
});
|
|
113
|
-
|
|
137
|
+
K.displayName = "TextArea";
|
|
114
138
|
export {
|
|
115
|
-
|
|
139
|
+
K as default
|
|
116
140
|
};
|