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