prometeo-design-system 5.7.7 → 5.7.8

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.
Files changed (2) hide show
  1. package/dist/Select.es.js +476 -473
  2. package/package.json +1 -1
package/dist/Select.es.js CHANGED
@@ -1,29 +1,29 @@
1
- import { j as s } from "./jsx-runtime-GkKLlHH4.js";
1
+ import { j as a } from "./jsx-runtime-GkKLlHH4.js";
2
2
  import { c as d } from "./cn-B6yFEsav.js";
3
- import { c as st } from "./index-BOQuZ0gG.js";
4
- import Ke, { memo as ee, useState as Ne, useRef as ie, useMemo as q, useCallback as V, useEffect as be, useImperativeHandle as lt } from "react";
5
- import ot from "./Spinner.es.js";
6
- import { createPortal as it } from "react-dom";
7
- import { u as ct } from "./useDragScroll-CHN9OMwn.js";
8
- import { u as ut } from "./useLabelBackground-D5SzHhl_.js";
9
- import { H as dt } from "./HelperComponent-ljsn0xD6.js";
10
- import ft from "./Chip.es.js";
11
- import mt from "./CheckBox.es.js";
12
- import { g as G, h as Ze } from "./utils-X4-h3cum.js";
13
- import ht from "./Input.es.js";
14
- import et from "./Skeleton.es.js";
15
- import { Cancel as pt } from "./Icons/Cancel.es.js";
16
- import { ChevronDown as rt } from "./Icons/ChevronDown.es.js";
17
- import { Search as gt } from "./Icons/Search.es.js";
18
- const bt = (e) => {
19
- const n = [], x = (v) => {
3
+ import { c as lt } from "./index-BOQuZ0gG.js";
4
+ import We, { memo as Z, useState as we, useRef as ce, useMemo as $, useCallback as V, useEffect as xe, useImperativeHandle as ot } from "react";
5
+ import it from "./Spinner.es.js";
6
+ import { createPortal as ct } from "react-dom";
7
+ import { u as ut } from "./useDragScroll-CHN9OMwn.js";
8
+ import { u as dt } from "./useLabelBackground-D5SzHhl_.js";
9
+ import { H as ft } from "./HelperComponent-ljsn0xD6.js";
10
+ import mt from "./Chip.es.js";
11
+ import ht from "./CheckBox.es.js";
12
+ import { g as L, h as et } from "./utils-X4-h3cum.js";
13
+ import pt from "./Input.es.js";
14
+ import tt from "./Skeleton.es.js";
15
+ import { Cancel as gt } from "./Icons/Cancel.es.js";
16
+ import { ChevronDown as st } from "./Icons/ChevronDown.es.js";
17
+ import { Search as bt } from "./Icons/Search.es.js";
18
+ const xt = (e) => {
19
+ const n = [], y = (v) => {
20
20
  v.forEach((S) => {
21
- const j = S, y = typeof j == "object" ? j?.options : [];
22
- Array.isArray(y) && y.length > 0 ? x(y) : n.push(S);
21
+ const j = S, C = typeof j == "object" ? j?.options : [];
22
+ Array.isArray(C) && C.length > 0 ? y(C) : n.push(S);
23
23
  });
24
24
  };
25
- return x(e), n;
26
- }, tt = {
25
+ return y(e), n;
26
+ }, nt = {
27
27
  default: {
28
28
  label: d(
29
29
  "text-neutral-medium-default",
@@ -42,7 +42,7 @@ const bt = (e) => {
42
42
  label: d("text-success", "peer-focus:text-success-light"),
43
43
  icon: d("text-success-medium-default", "peer-focus:text-success-light")
44
44
  }
45
- }, nt = {
45
+ }, rt = {
46
46
  label: d(
47
47
  "text-neutral-medium-disabled",
48
48
  "peer-focus:text-neutral-medium-disabled"
@@ -51,7 +51,7 @@ const bt = (e) => {
51
51
  "text-neutral-medium-disabled",
52
52
  "peer-focus:text-neutral-medium-disabled"
53
53
  )
54
- }, xt = st(
54
+ }, yt = lt(
55
55
  "w-full text-left border rounded-lg transition-all duration-200 ease-in-out flex items-center bg-inherit justify-between gap-2 focus:outline-none",
56
56
  {
57
57
  variants: {
@@ -111,72 +111,72 @@ const bt = (e) => {
111
111
  }
112
112
  ]
113
113
  }
114
- ), yt = {
114
+ ), Ct = {
115
115
  small: "text-sm",
116
116
  medium: "text-base",
117
117
  large: "text-lg"
118
- }, Ct = {
118
+ }, vt = {
119
119
  small: 18,
120
120
  medium: 20,
121
121
  large: 24
122
122
  };
123
- function vt(e) {
124
- const [n, x] = Ne(!1), [v, S] = Ne([]), [j, y] = Ne(""), [te, m] = Ne(
123
+ function St(e) {
124
+ const [n, y] = we(!1), [v, S] = we([]), [j, C] = we(""), [ee, m] = we(
125
125
  () => /* @__PURE__ */ new Set()
126
- ), _ = ie(null), M = ie(null), T = ie(null), we = ie(null), xe = ie(
126
+ ), _ = ce(null), A = ce(null), M = ce(null), De = ce(null), ye = ce(
127
127
  () => {
128
128
  }
129
- ), z = ie(null), ne = ie(/* @__PURE__ */ new Set()), {
130
- id: ye,
129
+ ), G = ce(null), te = ce(/* @__PURE__ */ new Set()), {
130
+ id: Ce,
131
131
  name: H,
132
- label: ce,
133
- height: R,
134
- options: A,
135
- controls: P,
136
- tabIndex: ue,
137
- className: De,
132
+ label: ue,
133
+ height: q,
134
+ options: z,
135
+ controls: T,
136
+ tabIndex: de,
137
+ className: je,
138
138
  placeholder: B,
139
139
  optionValue: O,
140
- optionLabel: Ce,
141
- renderOption: de,
142
- renderOptionGroupHeader: je,
143
- renderSelection: J,
140
+ optionLabel: ve,
141
+ renderOption: fe,
142
+ renderOptionGroupHeader: He,
143
+ renderSelection: R,
144
144
  renderOptionContext: F,
145
- buttonClassName: He,
146
- dropdownClassName: re,
147
- containerClassName: Oe,
145
+ buttonClassName: Oe,
146
+ dropdownClassName: ne,
147
+ containerClassName: ke,
148
148
  dropdownOptions: N,
149
- helperComponent: ke,
150
- errorComponent: Ee,
151
- onRemoveOption: ve,
152
- onOptionClick: ae,
149
+ helperComponent: Ee,
150
+ errorComponent: Ie,
151
+ onRemoveOption: Se,
152
+ onOptionClick: re,
153
153
  onClose: se,
154
- onClear: Ie,
154
+ onClear: Le,
155
155
  disabled: K = !1,
156
- overflow: Le = "wrap",
157
- variant: Q = "default",
158
- isLoading: We = !1,
159
- attachToParent: Ye = !1,
160
- displayMode: X = "compact",
156
+ overflow: Ge = "wrap",
157
+ variant: J = "default",
158
+ isLoading: Ue = !1,
159
+ attachToParent: Ze = !1,
160
+ displayMode: Q = "compact",
161
161
  size: W = "medium",
162
- labelVariant: le = "default",
163
- disableOpenOnFocus: Ge = !1,
164
- emptyMessage: ze = "No hay opciones disponibles"
165
- } = e, { ref: Ae } = ut(), { bind: Y, ref: Ue } = ct({
162
+ labelVariant: ae = "default",
163
+ disableOpenOnFocus: ze = !1,
164
+ emptyMessage: Ae = "No hay opciones disponibles"
165
+ } = e, { ref: Me } = dt(), { bind: X, ref: qe } = ut({
166
166
  axis: "x",
167
167
  cursor: { idle: "default", dragging: "grabbing" }
168
- }), fe = 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 !== "", Me = d(
169
- xt({
170
- variant: Q,
168
+ }), me = 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 !== "", Te = d(
169
+ yt({
170
+ variant: J,
171
171
  size: W,
172
172
  disabled: K,
173
- chips: !!(X === "chips" && e.multiple && fe)
173
+ chips: !!(Q === "chips" && e.multiple && me)
174
174
  }),
175
- He
176
- ), qe = R ? { height: R } : void 0, Te = K ? nt.label : fe || n ? tt[Q].label : "text-neutral-medium-default", Pe = K ? nt.icon : tt[Q].icon, $e = Ct[W], Re = {}, Ve = q(() => le === "static" && B ? B : "", [le, B]), r = q(
175
+ Oe
176
+ ), Re = q ? { height: q } : void 0, Pe = K ? rt.label : me || n ? nt[J].label : "text-neutral-medium-default", $e = K ? rt.icon : nt[J].icon, Ve = vt[W], Je = {}, _e = $(() => ae === "static" && B ? B : "", [ae, B]), r = $(
177
177
  () => N?.controledSearchValue || j,
178
178
  [N?.controledSearchValue, j]
179
- ), a = q(() => !!N?.controledSearchValue, [N?.controledSearchValue]), h = () => {
179
+ ), s = $(() => !!N?.controledSearchValue, [N?.controledSearchValue]), h = () => {
180
180
  const t = {
181
181
  static: {
182
182
  active: "relative prometeo-fonts-label-large",
@@ -186,63 +186,63 @@ function vt(e) {
186
186
  active: "absolute top-0 -translate-y-1/2 left-3 px-1 prometeo-fonts-body-small",
187
187
  default: "absolute top-1/2 -translate-y-1/2 "
188
188
  }
189
- }, o = n || fe ? "active" : "default";
190
- return t[le][o];
189
+ }, o = n || me ? "active" : "default";
190
+ return t[ae][o];
191
191
  }, l = V(
192
192
  (t) => ({
193
- id: G(t, O),
194
- value: G(t, O),
195
- label: G(t, Ce)
193
+ id: L(t, O),
194
+ value: L(t, O),
195
+ label: L(t, ve)
196
196
  }),
197
- [O, Ce]
198
- ), i = q(() => bt(A), [A]), c = q(
197
+ [O, ve]
198
+ ), i = $(() => xt(z), [z]), c = $(
199
199
  () => i.map(l),
200
200
  [i, l]
201
- ), u = q(() => {
201
+ ), u = $(() => {
202
202
  const t = [];
203
203
  if (e.multiple)
204
204
  e.value?.forEach((o) => {
205
205
  const f = i?.find(
206
- (E) => G(E, O) === o
206
+ (b) => L(b, O) === o
207
207
  );
208
208
  f && t.push(f);
209
209
  });
210
210
  else {
211
211
  const o = i?.find(
212
- (f) => G(f, O) === e.value
212
+ (f) => L(f, O) === e.value
213
213
  );
214
214
  o && t.push(o);
215
215
  }
216
216
  return t;
217
- }, [e.value, O, i, e.multiple]), w = q(
217
+ }, [e.value, O, i, e.multiple]), w = $(
218
218
  () => u.map(l),
219
219
  [u, l]
220
- ), I = q(
220
+ ), I = $(
221
221
  () => new Set(w.map((t) => t.id)),
222
222
  [w]
223
- ), U = q(() => {
223
+ ), U = $(() => {
224
224
  const t = [];
225
- return A.forEach((o, f) => {
226
- const E = o, g = typeof E == "object" ? E?.options : [];
227
- if (Array.isArray(g) && g.length > 0) {
228
- const C = E.label, b = G(o, O), L = `__group-${String(b ?? f)}`, _e = {
229
- id: L,
230
- value: L,
231
- label: typeof C == "string" ? C : String(b ?? `Grupo ${f + 1}`),
225
+ return z.forEach((o, f) => {
226
+ const b = o, E = typeof b == "object" ? b?.options : [];
227
+ if (Array.isArray(E) && E.length > 0) {
228
+ const p = b.label, x = L(o, O), be = `__group-${String(x ?? f)}`, Be = {
229
+ id: be,
230
+ value: be,
231
+ label: typeof p == "string" ? p : String(x ?? `Grupo ${f + 1}`),
232
232
  isGroupHeader: !0,
233
- groupLabelNode: C,
233
+ groupLabelNode: p,
234
234
  originalOption: o,
235
235
  groupData: {
236
- groupOptions: g
236
+ groupOptions: E
237
237
  }
238
238
  };
239
- t.push(_e), g.forEach((Be) => {
240
- de ? t.push(Be) : t.push(l(Be));
239
+ t.push(Be), E.forEach((Fe) => {
240
+ fe ? t.push(Fe) : t.push(l(Fe));
241
241
  });
242
242
  } else
243
- de ? t.push(o) : t.push(l(o));
243
+ fe ? t.push(o) : t.push(l(o));
244
244
  }), t;
245
- }, [A, O, de, l]), me = V(
245
+ }, [z, O, fe, l]), he = V(
246
246
  (t, o) => {
247
247
  if (!t || t.length === 0) return;
248
248
  const f = t.map(
@@ -251,31 +251,31 @@ function vt(e) {
251
251
  if (!e.multiple) {
252
252
  const D = f[0];
253
253
  if (!D) return;
254
- const $ = I.has(D.id), Fe = o ?? "toggle";
255
- let Qe;
256
- Fe === "select" || Fe === "toggle" && !$ ? Qe = D : Qe = void 0, e.onChange?.(Qe, H);
254
+ const P = I.has(D.id), Ke = o ?? "toggle";
255
+ let Xe;
256
+ Ke === "select" || Ke === "toggle" && !P ? Xe = D : Xe = void 0, e.onChange?.(Xe, H);
257
257
  return;
258
258
  }
259
- const E = e.value || [], g = [];
260
- E.forEach((D) => {
261
- const $ = c.find((Fe) => Fe.value === D);
262
- $ && g.push($);
259
+ const b = e.value || [], E = [];
260
+ b.forEach((D) => {
261
+ const P = c.find((Ke) => Ke.value === D);
262
+ P && E.push(P);
263
263
  });
264
- const C = new Set(g.map((D) => D.id)), b = new Set(f.map((D) => D.id)), L = f.every(
265
- (D) => C.has(D.id)
266
- ), _e = o ?? "toggle", Be = _e === "select" || _e === "toggle" && !L;
267
- let Je;
268
- if (!Be)
269
- Je = g.filter((D) => !b.has(D.id));
264
+ const p = new Set(E.map((D) => D.id)), x = new Set(f.map((D) => D.id)), be = f.every(
265
+ (D) => p.has(D.id)
266
+ ), Be = o ?? "toggle", Fe = Be === "select" || Be === "toggle" && !be;
267
+ let Qe;
268
+ if (!Fe)
269
+ Qe = E.filter((D) => !x.has(D.id));
270
270
  else {
271
271
  const D = new Map(
272
- g.map(($) => [$.id, $])
272
+ E.map((P) => [P.id, P])
273
273
  );
274
- f.forEach(($) => {
275
- D.set($.id, $);
276
- }), Je = Array.from(D.values());
274
+ f.forEach((P) => {
275
+ D.set(P.id, P);
276
+ }), Qe = Array.from(D.values());
277
277
  }
278
- e.onChange?.(Je, H);
278
+ e.onChange?.(Qe, H);
279
279
  },
280
280
  [
281
281
  e.multiple,
@@ -286,50 +286,50 @@ function vt(e) {
286
286
  l,
287
287
  H
288
288
  ]
289
- ), he = V(() => {
290
- x((t) => !t);
289
+ ), pe = V(() => {
290
+ y((t) => !t);
291
291
  }, []);
292
- xe.current = (t) => {
292
+ ye.current = (t) => {
293
293
  if (!e.multiple)
294
294
  e.onChange?.(t, H);
295
295
  else {
296
- const o = e.value || [], f = [], E = o.includes(t.value);
297
- o.forEach((C) => {
298
- const b = c.find(
299
- (L) => L.value === C
296
+ const o = e.value || [], f = [], b = o.includes(t.value);
297
+ o.forEach((p) => {
298
+ const x = c.find(
299
+ (be) => be.value === p
300
300
  );
301
- b && f.push(b);
301
+ x && f.push(x);
302
302
  });
303
- const g = E ? f.filter((C) => C.value !== t.value) : [...f, t];
304
- e.onChange?.(g, H);
303
+ const E = b ? f.filter((p) => p.value !== t.value) : [...f, t];
304
+ e.onChange?.(E, H);
305
305
  }
306
306
  };
307
- const Z = V(
307
+ const Y = V(
308
308
  (t, o = !1) => {
309
- ae?.(t, H), xe.current?.(t), o && (x(!1), se?.());
309
+ re?.(t, H), ye.current?.(t), o && (y(!1), se?.());
310
310
  },
311
- [ae, se, H]
312
- ), oe = (t) => {
313
- if (t.preventDefault(), t.stopPropagation(), t.target.blur(), Ie?.(), e.multiple) {
311
+ [re, se, H]
312
+ ), le = (t) => {
313
+ if (t.preventDefault(), t.stopPropagation(), t.target.blur(), Le?.(), e.multiple) {
314
314
  const o = e.onChange;
315
315
  o?.([], H);
316
316
  } else {
317
317
  const o = e.onChange;
318
318
  o?.(void 0, H);
319
319
  }
320
- }, pe = V(
320
+ }, ge = V(
321
321
  (t) => {
322
322
  e.multiple || e.onChange?.(void 0, H);
323
323
  const o = i.find(
324
- (E) => G(E, O) === t
324
+ (b) => L(b, O) === t
325
325
  );
326
326
  if (!o) return;
327
327
  const f = l(o);
328
- ae?.(f, H), xe.current?.(f), ve?.(o);
328
+ re?.(f, H), ye.current?.(f), Se?.(o);
329
329
  },
330
330
  [
331
- ae,
332
- ve,
331
+ re,
332
+ Se,
333
333
  i,
334
334
  H,
335
335
  e.multiple,
@@ -337,126 +337,129 @@ function vt(e) {
337
337
  l,
338
338
  O
339
339
  ]
340
- ), p = V(
340
+ ), g = V(
341
341
  (t) => {
342
- pe(t);
342
+ ge(t);
343
343
  },
344
- [pe]
345
- ), k = (t) => t.tagName === "INPUT" && !["button", "submit", "checkbox", "file", "image"].includes(t.type) || t.hasAttribute("contenteditable");
346
- be(() => {
344
+ [ge]
345
+ ), k = (t) => t.tagName === "INPUT" && !["button", "submit", "checkbox", "file", "image"].includes(t.type) || t.hasAttribute("contenteditable"), oe = $(() => navigator.userAgent.includes("Mobile"), []);
346
+ xe(() => {
347
347
  if (!n) return;
348
348
  let t = !1, o = 0;
349
- const f = (C) => {
350
- const b = C.target;
351
- if (C.type === "mousedown") {
352
- if (_.current?.contains(b) || M.current?.contains(b)) return;
353
- x(!1);
349
+ const f = (p) => {
350
+ const x = p.target;
351
+ if (p.type === "mousedown") {
352
+ if (_.current?.contains(x) || A.current?.contains(x)) return;
353
+ y(!1);
354
354
  }
355
- if (C.type === "scroll") {
356
- if (t || Date.now() - o < 500 || M.current?.contains(b)) return;
357
- x(!1);
355
+ if (p.type === "scroll") {
356
+ if (oe || t || Date.now() - o < 500 || A.current?.contains(x)) return;
357
+ y(!1);
358
358
  }
359
- C.type === "resize" && x(!1);
360
- }, E = (C) => {
361
- const b = C.target;
362
- k(b) && (t = !0, o = Date.now());
363
- }, g = (C) => {
364
- const b = C.target;
365
- k(b) && (t = !1);
359
+ if (p.type === "resize") {
360
+ if (oe) return;
361
+ y(!1);
362
+ }
363
+ }, b = (p) => {
364
+ const x = p.target;
365
+ k(x) && (t = !0, o = Date.now());
366
+ }, E = (p) => {
367
+ const x = p.target;
368
+ k(x) && (t = !1);
366
369
  };
367
- return document.addEventListener("focusin", E), document.addEventListener("focusout", g), document.addEventListener("mousedown", f), window.addEventListener("scroll", f, !0), window.addEventListener("resize", f, !0), () => {
368
- document.removeEventListener("focusin", E), document.removeEventListener("focusout", g), document.removeEventListener("mousedown", f), window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f, !0);
370
+ return document.addEventListener("focusin", b), document.addEventListener("focusout", E), document.addEventListener("mousedown", f), window.addEventListener("scroll", f, !0), window.addEventListener("resize", f, !0), () => {
371
+ document.removeEventListener("focusin", b), document.removeEventListener("focusout", E), document.removeEventListener("mousedown", f), window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f, !0);
369
372
  };
370
- }, [n]), be(() => {
371
- ne.current.forEach((t) => {
373
+ }, [n]), xe(() => {
374
+ te.current.forEach((t) => {
372
375
  try {
373
376
  t(n);
374
377
  } catch {
375
378
  }
376
379
  });
377
- }, [n]), lt(
378
- P,
380
+ }, [n]), ot(
381
+ T,
379
382
  () => ({
380
383
  open: () => {
381
- x(!0);
384
+ y(!0);
382
385
  },
383
386
  close: () => {
384
- x(!1);
387
+ y(!1);
385
388
  },
386
- toggle: () => x((t) => !t),
387
- handleOptionSelect: Z,
388
- subscribeOpenChange: (t) => (ne.current.add(t), () => {
389
- ne.current.delete(t);
389
+ toggle: () => y((t) => !t),
390
+ handleOptionSelect: Y,
391
+ subscribeOpenChange: (t) => (te.current.add(t), () => {
392
+ te.current.delete(t);
390
393
  }),
391
- searchInputRef: T
394
+ searchInputRef: M
392
395
  }),
393
- [n, Z]
396
+ [n, Y]
394
397
  );
395
- const ge = (t) => {
396
- t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !Ge && !n && (x(!0), setTimeout(() => {
397
- T.current?.focus();
398
+ const Ne = (t) => {
399
+ t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !ze && !n && (y(!0), setTimeout(() => {
400
+ M.current?.focus();
398
401
  }, 10));
399
- }, Se = (t) => {
400
- t.key === "Tab" && n && x(!1), (t.keyCode === 32 || t.key === "ArrowDown") && (x(!0), setTimeout(() => {
401
- T.current?.focus();
402
+ }, ie = (t) => {
403
+ t.key === "Tab" && n && y(!1), (t.keyCode === 32 || t.key === "ArrowDown") && (y(!0), setTimeout(() => {
404
+ M.current?.focus();
402
405
  }, 10));
403
406
  };
404
- return /* @__PURE__ */ s.jsxs(
407
+ return /* @__PURE__ */ a.jsxs(
405
408
  "div",
406
409
  {
407
- className: d("relative bg-inherit select-none w-full", De),
410
+ className: d("relative bg-inherit select-none w-full", je),
408
411
  ref: _,
409
412
  draggable: !1,
410
- style: Re,
413
+ style: Je,
411
414
  children: [
412
- /* @__PURE__ */ s.jsxs("div", { className: d("relative bg-inherit ", Oe), children: [
413
- /* @__PURE__ */ s.jsx(
415
+ /* @__PURE__ */ a.jsxs("div", { className: d("relative bg-inherit ", ke), children: [
416
+ /* @__PURE__ */ a.jsx(
414
417
  "label",
415
418
  {
416
- htmlFor: `select-${ye}`,
417
- ref: Ae,
419
+ htmlFor: `select-${Ce}`,
420
+ ref: Me,
418
421
  className: d(
419
422
  "left-3 pointer-events-none bg-inherit z-10 line-clamp-1 max-w-[calc(100%-2.5rem)] ",
420
- le === "default" && "transition-all duration-200 ease-in-out",
423
+ ae === "default" && "transition-all duration-200 ease-in-out",
421
424
  h(),
422
- yt[W],
423
- Te,
425
+ Ct[W],
426
+ Pe,
424
427
  "mb-0.5"
425
428
  ),
426
- children: ce
429
+ children: ue
427
430
  }
428
431
  ),
429
- /* @__PURE__ */ s.jsxs(
432
+ /* @__PURE__ */ a.jsxs(
430
433
  "div",
431
434
  {
432
- id: ye,
433
- tabIndex: ue ?? 0,
435
+ id: Ce,
436
+ tabIndex: de ?? 0,
434
437
  role: "button",
435
- ref: we,
436
- onFocus: ge,
437
- onKeyDown: Se,
438
+ ref: De,
439
+ onFocus: Ne,
440
+ onKeyDown: ie,
438
441
  onClick: (t) => {
439
- t.preventDefault(), t.stopPropagation(), he();
442
+ t.preventDefault(), t.stopPropagation(), pe();
440
443
  },
441
- className: Me,
442
- style: qe,
444
+ className: Te,
445
+ style: Re,
443
446
  children: [
444
- /* @__PURE__ */ s.jsx(
447
+ /* @__PURE__ */ a.jsx(
445
448
  "div",
446
449
  {
447
450
  className: d(
448
451
  "flex-1 overflow-x-auto overflow-y-hidden px-1 prometeo-scrollbar-none! "
449
452
  ),
450
- ref: Ue,
451
- onPointerUp: Y.onPointerUp,
452
- onPointerDown: Y.onPointerDown,
453
- onPointerMove: Y.onPointerMove,
454
- onPointerLeave: Y.onPointerLeave,
455
- onPointerCancel: Y.onPointerCancel,
456
- onClickCapture: Y.onClickCapture,
457
- children: J ? Ke.createElement(
458
- ee(
459
- J,
453
+ ref: qe,
454
+ onPointerUp: X.onPointerUp,
455
+ onPointerDown: X.onPointerDown,
456
+ onPointerMove: X.onPointerMove,
457
+ onPointerLeave: X.onPointerLeave,
458
+ onPointerCancel: X.onPointerCancel,
459
+ onClickCapture: X.onClickCapture,
460
+ children: R ? We.createElement(
461
+ Z(
462
+ R,
460
463
  (t, o) => t.disabled === o.disabled && t.multiple === o.multiple
461
464
  ),
462
465
  {
@@ -464,18 +467,18 @@ function vt(e) {
464
467
  multiple: e.multiple || !1,
465
468
  placeholder: B,
466
469
  selectedOptions: u,
467
- onRemoveOption: p
470
+ onRemoveOption: g
468
471
  }
469
- ) : /* @__PURE__ */ s.jsx(
472
+ ) : /* @__PURE__ */ a.jsx(
470
473
  at,
471
474
  {
472
- displayMode: X,
475
+ displayMode: Q,
473
476
  selectedOptions: w,
474
- placeholder: Ve,
475
- onRemoveOption: pe,
477
+ placeholder: _e,
478
+ onRemoveOption: ge,
476
479
  multiple: e.multiple || !1,
477
480
  className: d(
478
- Le === "scroll" ? "flex-nowrap" : "flex-wrap"
481
+ Ge === "scroll" ? "flex-nowrap" : "flex-wrap"
479
482
  ),
480
483
  disabled: K,
481
484
  size: W
@@ -483,44 +486,44 @@ function vt(e) {
483
486
  )
484
487
  }
485
488
  ),
486
- /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
487
- We && /* @__PURE__ */ s.jsx(
488
- ot,
489
+ /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
490
+ Ue && /* @__PURE__ */ a.jsx(
491
+ it,
489
492
  {
490
493
  size: "small",
491
494
  variant: "sync",
492
495
  className: " opacity-90"
493
496
  }
494
497
  ),
495
- fe && Ie && /* @__PURE__ */ s.jsx(
498
+ me && Le && /* @__PURE__ */ a.jsx(
496
499
  "button",
497
500
  {
498
501
  className: "z-100",
499
502
  onClick: (t) => {
500
- t.preventDefault(), t.stopPropagation(), oe(t);
503
+ t.preventDefault(), t.stopPropagation(), le(t);
501
504
  },
502
505
  type: "button",
503
506
  tabIndex: -1,
504
- children: /* @__PURE__ */ s.jsx(
505
- pt,
507
+ children: /* @__PURE__ */ a.jsx(
508
+ gt,
506
509
  {
507
- size: $e,
510
+ size: Ve,
508
511
  className: d(
509
512
  "cursor-pointer transition-all",
510
- Pe
513
+ $e
511
514
  )
512
515
  }
513
516
  )
514
517
  }
515
518
  ),
516
- /* @__PURE__ */ s.jsx(
517
- rt,
519
+ /* @__PURE__ */ a.jsx(
520
+ st,
518
521
  {
519
- size: $e,
522
+ size: Ve,
520
523
  className: d(
521
524
  "transition-transform min-w-max",
522
525
  n ? "rotate-180" : "",
523
- Pe
526
+ $e
524
527
  )
525
528
  }
526
529
  )
@@ -529,37 +532,37 @@ function vt(e) {
529
532
  }
530
533
  )
531
534
  ] }),
532
- n && /* @__PURE__ */ s.jsx(
533
- wt,
535
+ n && /* @__PURE__ */ a.jsx(
536
+ Dt,
534
537
  {
535
- label: ce,
538
+ label: ue,
536
539
  isOpen: n,
537
540
  disabled: K,
538
541
  optionValue: O,
539
- optionLabel: Ce,
540
- emptyMessage: ze,
541
- labelVariant: le,
542
- renderOption: de,
543
- renderOptionGroupHeader: je,
544
- attachToParent: Ye,
542
+ optionLabel: ve,
543
+ emptyMessage: Ae,
544
+ labelVariant: ae,
545
+ renderOption: fe,
546
+ renderOptionGroupHeader: He,
547
+ attachToParent: Ze,
545
548
  filteredOptions: v,
546
549
  multiple: e.multiple || !1,
547
- dropdownClassName: re,
550
+ dropdownClassName: ne,
548
551
  selectedOptionsIds: I,
549
552
  setFilteredOptions: S,
550
553
  renderOptionContext: F,
551
554
  options: U,
552
555
  selectRef: _,
553
- dropdownRef: M,
554
- selectButtonRef: we,
555
- helperComponentRef: z,
556
- onOptionClick: Z,
557
- onCloseDropdown: () => x(!1),
556
+ dropdownRef: A,
557
+ selectButtonRef: De,
558
+ helperComponentRef: G,
559
+ onOptionClick: Y,
560
+ onCloseDropdown: () => y(!1),
558
561
  searchValue: r,
559
- setSearchValue: y,
560
- searchInputRef: T,
562
+ setSearchValue: C,
563
+ searchInputRef: M,
561
564
  isLoading: N?.isLoading,
562
- isControledSearchValue: a,
565
+ isControledSearchValue: s,
563
566
  onSearchClear: N?.onSearchClear,
564
567
  hideSearchBar: N?.hideSearchBar,
565
568
  dropdownHeight: N?.dropdownHeight,
@@ -572,146 +575,146 @@ function vt(e) {
572
575
  focusSearchInputOnOpen: N?.focusSearchInputOnOpen,
573
576
  optionContainerClassName: N?.optionContainerClassName,
574
577
  groupContainerClassName: N?.groupContainerClassName,
575
- collapsedGroups: te,
578
+ collapsedGroups: ee,
576
579
  setCollapsedGroups: m,
577
- onGroupSelectChange: me
580
+ onGroupSelectChange: he
578
581
  }
579
582
  ),
580
- (Ee || ke) && /* @__PURE__ */ s.jsx("div", { className: "min-h-6", children: /* @__PURE__ */ s.jsx(
581
- dt,
583
+ (Ie || Ee) && /* @__PURE__ */ a.jsx("div", { className: "min-h-6", children: /* @__PURE__ */ a.jsx(
584
+ ft,
582
585
  {
583
- ref: z,
584
- variant: Q,
586
+ ref: G,
587
+ variant: J,
585
588
  className: "absolute bottom-0 h-5 overflow-visible line-clamp-1!",
586
- children: Ee || ke
589
+ children: Ie || Ee
587
590
  }
588
591
  ) })
589
592
  ]
590
593
  }
591
594
  );
592
595
  }
593
- const St = ee(vt, (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), Bt = St;
594
- function Nt({
596
+ const Nt = Z(St, (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), Ft = Nt;
597
+ function wt({
595
598
  footer: e,
596
599
  isOpen: n,
597
- label: x,
600
+ label: y,
598
601
  options: v,
599
602
  multiple: S,
600
603
  disabled: j,
601
- selectRef: y,
602
- inputProps: te,
604
+ selectRef: C,
605
+ inputProps: ee,
603
606
  dropdownRef: m,
604
607
  optionLabel: _,
605
- optionValue: M,
606
- searchValue: T,
607
- labelVariant: we,
608
- emptyMessage: xe,
609
- renderOption: z,
610
- renderOptionContext: ne,
611
- renderOptionGroupHeader: ye,
608
+ optionValue: A,
609
+ searchValue: M,
610
+ labelVariant: De,
611
+ emptyMessage: ye,
612
+ renderOption: G,
613
+ renderOptionContext: te,
614
+ renderOptionGroupHeader: Ce,
612
615
  onOptionClick: H,
613
- onSearchClear: ce,
614
- searchInputRef: R,
615
- setSearchValue: A,
616
- dropdownHeight: P,
617
- attachToParent: ue,
618
- filteredOptions: De,
616
+ onSearchClear: ue,
617
+ searchInputRef: q,
618
+ setSearchValue: z,
619
+ dropdownHeight: T,
620
+ attachToParent: de,
621
+ filteredOptions: je,
619
622
  selectButtonRef: B,
620
623
  onCloseDropdown: O,
621
- loadingComponent: Ce,
622
- dropdownClassName: de,
623
- helperComponentRef: je,
624
- selectedOptionsIds: J,
624
+ loadingComponent: ve,
625
+ dropdownClassName: fe,
626
+ helperComponentRef: He,
627
+ selectedOptionsIds: R,
625
628
  setFilteredOptions: F,
626
- onSearchValueChange: He,
627
- isLoading: re = !1,
628
- hideSearchBar: Oe = !1,
629
+ onSearchValueChange: Oe,
630
+ isLoading: ne = !1,
631
+ hideSearchBar: ke = !1,
629
632
  inputSearchPlaceholder: N = "Buscar opciones",
630
- optionContainerClassName: ke,
631
- groupContainerClassName: Ee,
632
- collapsedGroups: ve,
633
- setCollapsedGroups: ae,
633
+ optionContainerClassName: Ee,
634
+ groupContainerClassName: Ie,
635
+ collapsedGroups: Se,
636
+ setCollapsedGroups: re,
634
637
  enableGroupToggle: se = !0,
635
- focusSearchInputOnOpen: Ie = !1,
638
+ focusSearchInputOnOpen: Le = !1,
636
639
  onGroupSelectChange: K,
637
- isControledSearchValue: Le
640
+ isControledSearchValue: Ge
638
641
  }) {
639
- const Q = e ? 380 : 320, We = we === "static" ? x !== "" ? -20 : 4 : 7, X = V(() => P ? P.endsWith("px") ? Number(P.replace("px", "")) : P.endsWith("vh") ? window.innerHeight * Number(P.replace("vh", "")) / 100 : P.endsWith("%") ? window.innerHeight * Number(P.replace("%", "")) / 100 : Q : Q, [P, Q])(), [W, le] = Ne({
642
+ const J = e ? 380 : 320, Ue = De === "static" ? y !== "" ? -20 : 4 : 7, Q = V(() => T ? T.endsWith("px") ? Number(T.replace("px", "")) : T.endsWith("vh") ? window.innerHeight * Number(T.replace("vh", "")) / 100 : T.endsWith("%") ? window.innerHeight * Number(T.replace("%", "")) / 100 : J : J, [T, J])(), [W, ae] = we({
640
643
  direction: "down",
641
- height: X
642
- }), Ge = V(
643
- (r) => !ve.has(r),
644
- [ve]
645
- ), ze = V(
646
- (r, a) => {
647
- ae((h) => {
644
+ height: Q
645
+ }), ze = V(
646
+ (r) => !Se.has(r),
647
+ [Se]
648
+ ), Ae = V(
649
+ (r, s) => {
650
+ re((h) => {
648
651
  const l = new Set(h), i = l.has(r);
649
- return (a === void 0 ? !i : !a) ? l.add(r) : l.delete(r), l;
652
+ return (s === void 0 ? !i : !s) ? l.add(r) : l.delete(r), l;
650
653
  });
651
654
  },
652
- [ae]
653
- ), Ae = (r) => {
654
- if (!m.current || !y.current) return;
655
- const a = y.current.getBoundingClientRect();
655
+ [re]
656
+ ), Me = (r) => {
657
+ if (!m.current || !C.current) return;
658
+ const s = C.current.getBoundingClientRect();
656
659
  switch (r || W.direction) {
657
660
  case "down":
658
- m.current.style.top = `${a.top + a.height - (je?.current?.offsetHeight ? je?.current?.offsetHeight + 4 : 0)}px`;
661
+ m.current.style.top = `${s.top + s.height - (He?.current?.offsetHeight ? He?.current?.offsetHeight + 4 : 0)}px`;
659
662
  break;
660
663
  case "up":
661
- m.current.style.top = "auto", m.current.style.bottom = `${window.innerHeight - a.top + We}px`;
664
+ m.current.style.top = "auto", m.current.style.bottom = `${window.innerHeight - s.top + Ue}px`;
662
665
  break;
663
666
  }
664
- m.current.style.left = `${a.left}px`, m.current.style.width = `${a.width}px`;
665
- }, Y = (r) => {
667
+ m.current.style.left = `${s.left}px`, m.current.style.width = `${s.width}px`;
668
+ }, X = (r) => {
666
669
  m.current && (m.current.style.maxHeight = `${r}px`);
667
- }, Ue = () => {
668
- if (!m.current || !y.current) return W;
669
- const r = y.current.getBoundingClientRect(), a = window.innerHeight - (window.innerHeight - r.top), h = window.innerHeight - r.bottom, l = h >= X, i = a >= X;
670
+ }, qe = () => {
671
+ if (!m.current || !C.current) return W;
672
+ const r = C.current.getBoundingClientRect(), s = window.innerHeight - (window.innerHeight - r.top), h = window.innerHeight - r.bottom, l = h >= Q, i = s >= Q;
670
673
  let c = "down", u;
671
- return l ? (c = "down", u = X) : i ? (c = "up", u = X) : h > a ? (c = "down", u = h - 16) : (c = "up", u = a - 16), { direction: c, height: u };
672
- }, fe = (r) => {
673
- if (!(!m.current || !y.current)) {
674
+ return l ? (c = "down", u = Q) : i ? (c = "up", u = Q) : h > s ? (c = "down", u = h - 16) : (c = "up", u = s - 16), { direction: c, height: u };
675
+ }, me = (r) => {
676
+ if (!(!m.current || !C.current)) {
674
677
  if (m.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !r) {
675
678
  m.current.style.maxHeight = "0", m.current.style.opacity = "0", m.current.style.pointerEvents = "none";
676
679
  return;
677
680
  }
678
- if (!ue) {
679
- const a = Ue();
680
- le(a), Ae(a.direction), Y(a.height);
681
+ if (!de) {
682
+ const s = qe();
683
+ ae(s), Me(s.direction), X(s.height);
681
684
  }
682
- m.current.style.opacity = "1", m.current.style.pointerEvents = "auto", Ie && R?.current && R.current?.focus();
685
+ m.current.style.opacity = "1", m.current.style.pointerEvents = "auto", Le && q?.current && q.current?.focus();
683
686
  }
684
687
  };
685
- be(() => {
686
- ue || !y.current || !n || Ae();
687
- }, [J]), be(() => {
688
- fe(n);
689
- }, [n]), be(() => {
688
+ xe(() => {
689
+ de || !C.current || !n || Me();
690
+ }, [R]), xe(() => {
691
+ me(n);
692
+ }, [n]), xe(() => {
690
693
  v && F(v);
691
- }, [v]), be(() => {
692
- if (re || !T || Le) return;
693
- const r = Me(v, T);
694
+ }, [v]), xe(() => {
695
+ if (ne || !M || Ge) return;
696
+ const r = Te(v, M);
694
697
  F(r);
695
698
  }, [v]);
696
- const Me = (r, a) => {
697
- if (!a) return r;
698
- if (z) {
699
+ const Te = (r, s) => {
700
+ if (!s) return r;
701
+ if (G) {
699
702
  const u = [];
700
703
  let w = null, I = [];
701
704
  const U = () => {
702
705
  w && I.length > 0 && u.push(w, ...I), w = null, I = [];
703
706
  };
704
- return r.forEach((me) => {
705
- const he = me;
706
- if (!!(he || {})?.isGroupHeader) {
707
- U(), w = he;
707
+ return r.forEach((he) => {
708
+ const pe = he;
709
+ if (!!(pe || {})?.isGroupHeader) {
710
+ U(), w = pe;
708
711
  return;
709
712
  }
710
- const oe = me, pe = G(
711
- oe,
713
+ const le = he, ge = L(
714
+ le,
712
715
  _
713
- ), p = Ze(String(pe ?? ""), a);
714
- w ? p && I.push(oe) : p && u.push(oe);
716
+ ), g = et(String(ge ?? ""), s);
717
+ w ? g && I.push(le) : g && u.push(le);
715
718
  }), U(), u;
716
719
  }
717
720
  const h = [];
@@ -725,49 +728,49 @@ function Nt({
725
728
  c(), l = u;
726
729
  return;
727
730
  }
728
- const w = Ze(u.label, a);
731
+ const w = et(u.label, s);
729
732
  l ? w && i.push(u) : w && h.push(u);
730
733
  }), c(), h;
731
- }, qe = (r) => {
732
- if (He) {
734
+ }, Re = (r) => {
735
+ if (Oe) {
733
736
  if (r === "") {
734
- Te();
737
+ Pe();
735
738
  return;
736
739
  }
737
- He(r);
740
+ Oe(r);
738
741
  return;
739
742
  }
740
- if (!Le) {
741
- const a = Me(v, r);
742
- F(a);
743
+ if (!Ge) {
744
+ const s = Te(v, r);
745
+ F(s);
743
746
  }
744
- A && v && A(r);
745
- }, Te = V(() => {
746
- if (ce) {
747
- ce(), F(
747
+ z && v && z(r);
748
+ }, Pe = V(() => {
749
+ if (ue) {
750
+ ue(), F(
748
751
  v.filter((r) => {
749
- const a = z ? G(r, M) : r.id;
750
- return J.has(a);
752
+ const s = G ? L(r, A) : r.id;
753
+ return R.has(s);
751
754
  })
752
755
  );
753
756
  return;
754
757
  }
755
- A && (A(""), F(v));
758
+ z && (z(""), F(v));
756
759
  }, [
757
760
  v,
758
- J,
759
- M,
760
- ce,
761
- F,
761
+ R,
762
762
  A,
763
- z
764
- ]), Pe = (r) => {
763
+ ue,
764
+ F,
765
+ z,
766
+ G
767
+ ]), $e = (r) => {
765
768
  r.key === "ArrowDown" ? (r.preventDefault(), m.current?.querySelector(
766
769
  "[role=listitem]"
767
770
  )?.focus()) : (r.key === "Tab" || r.key === "Escape") && setTimeout(() => {
768
771
  B.current?.focus(), O();
769
772
  }, 10);
770
- }, $e = (r, a) => {
773
+ }, Ve = (r, s) => {
771
774
  const h = Array.from(
772
775
  m.current?.querySelectorAll("[role=listitem]") || []
773
776
  ), l = h.indexOf(r.currentTarget);
@@ -777,14 +780,14 @@ function Nt({
777
780
  h[i]?.focus();
778
781
  } else if (r.key === "ArrowUp")
779
782
  if (r.preventDefault(), l === 0)
780
- R && R.current?.focus();
783
+ q && q.current?.focus();
781
784
  else {
782
785
  const i = l - 1;
783
786
  h[i]?.focus();
784
787
  }
785
788
  else if (r.key === "Enter" || r.key === " ") {
786
- if (r.preventDefault(), (a || {})?.isGroupHeader || j) return;
787
- H(a, !S), S || setTimeout(() => {
789
+ if (r.preventDefault(), (s || {})?.isGroupHeader || j) return;
790
+ H(s, !S), S || setTimeout(() => {
788
791
  B.current?.focus(), O();
789
792
  }, 10);
790
793
  } else r.key === "Escape" ? (r.preventDefault(), setTimeout(() => {
@@ -792,34 +795,34 @@ function Nt({
792
795
  }, 10)) : r.key === "Tab" && setTimeout(() => {
793
796
  B.current?.focus(), O();
794
797
  }, 10);
795
- }, Re = Array.from({ length: 5 }).map(
796
- (r, a) => z ? Ke.createElement(
797
- ee(z, (h, l) => h.isSelected === l.isSelected && h.option === l.option && h.disabled === l.disabled && h.multiple === l.multiple && h.renderContext === l.renderContext),
798
+ }, Je = Array.from({ length: 5 }).map(
799
+ (r, s) => G ? We.createElement(
800
+ Z(G, (h, l) => h.isSelected === l.isSelected && h.option === l.option && h.disabled === l.disabled && h.multiple === l.multiple && h.renderContext === l.renderContext),
798
801
  {
799
- key: `skeleton-option-${a}`,
800
- option: { id: a, label: "", value: "" },
802
+ key: `skeleton-option-${s}`,
803
+ option: { id: s, label: "", value: "" },
801
804
  isSelected: !1,
802
805
  multiple: !1,
803
806
  onSelect: () => {
804
807
  },
805
808
  disabled: !1,
806
809
  isLoading: !0,
807
- renderContext: ne
810
+ renderContext: te
808
811
  }
809
- ) : /* @__PURE__ */ s.jsx(
810
- Xe,
812
+ ) : /* @__PURE__ */ a.jsx(
813
+ Ye,
811
814
  {
812
815
  multiple: !1,
813
816
  isLoading: !0,
814
817
  onSelect: () => {
815
818
  },
816
819
  isSelected: !1,
817
- option: { id: a, label: "", value: "" }
820
+ option: { id: s, label: "", value: "" }
818
821
  },
819
822
  `skeleton-option-${// biome-ignore lint/suspicious/noArrayIndexKey: <>
820
- a}`
823
+ s}`
821
824
  )
822
- ), Ve = /* @__PURE__ */ s.jsx(
825
+ ), _e = /* @__PURE__ */ a.jsx(
823
826
  "div",
824
827
  {
825
828
  tabIndex: 0,
@@ -828,123 +831,123 @@ function Nt({
828
831
  className: d(
829
832
  " z-100! w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-lg shadow-lg",
830
833
  " overflow-hidden focus-visible:bg-neutral-default-hover ",
831
- ue ? "absolute z-50 " : "fixed z-100 top-0 left-0",
834
+ de ? "absolute z-50 " : "fixed z-100 top-0 left-0",
832
835
  W.direction === "up" ? "h-auto" : " h-max",
833
- de,
836
+ fe,
834
837
  "w-full max-w-[max(100%,20vw)] min-w-[min(100%,20vw)]"
835
838
  ),
836
- children: /* @__PURE__ */ s.jsxs(
839
+ children: /* @__PURE__ */ a.jsxs(
837
840
  "div",
838
841
  {
839
842
  className: d(
840
843
  "flex flex-col",
841
- Oe ? "p-0" : "p-2 pt-0 gap-2"
844
+ ke ? "p-0" : "p-2 pt-0 gap-2"
842
845
  ),
843
846
  style: {
844
847
  height: "auto",
845
848
  maxHeight: W.height
846
849
  },
847
850
  children: [
848
- !Oe && /* @__PURE__ */ s.jsx(
849
- ht,
851
+ !ke && /* @__PURE__ */ a.jsx(
852
+ pt,
850
853
  {
851
854
  name: "",
852
855
  label: "",
853
- size: "xsmall",
856
+ size: "small",
854
857
  tabIndex: 0,
855
- value: T,
858
+ value: M,
856
859
  disabled: j,
857
- ref: R,
860
+ ref: q,
858
861
  labelVariant: "static",
859
- icon: /* @__PURE__ */ s.jsx(gt, {}),
860
- isFetching: re,
861
- onKeyDown: Pe,
862
- onClear: Te,
863
- onChange: (r) => qe(r.target.value),
862
+ icon: /* @__PURE__ */ a.jsx(bt, {}),
863
+ isFetching: ne,
864
+ onKeyDown: $e,
865
+ onClear: Pe,
866
+ onChange: (r) => Re(r.target.value),
864
867
  placeholder: N,
865
868
  className: " bg-neutral-medium-pressed *:max-h-8",
866
- ...te
869
+ ...ee
867
870
  }
868
871
  ),
869
- /* @__PURE__ */ s.jsx("div", { className: d("overflow-y-auto flex-1 max-h-max ", ke), children: De.length === 0 ? re ? /* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: Ce || Re }) : /* @__PURE__ */ s.jsx("p", { className: "px-3 py-2 text-neutral-medium-default max-w-full text-pretty wrap-break-word ", children: T ? `No se encontraron resultados para "${T}"` : xe }) : (() => {
872
+ /* @__PURE__ */ a.jsx("div", { className: d("overflow-y-auto flex-1 max-h-max ", Ee), children: je.length === 0 ? ne ? /* @__PURE__ */ a.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: ve || Je }) : /* @__PURE__ */ a.jsx("p", { className: "px-3 py-2 text-neutral-medium-default max-w-full text-pretty wrap-break-word ", children: M ? `No se encontraron resultados para "${M}"` : ye }) : (() => {
870
873
  const r = [];
871
- let a = null;
874
+ let s = null;
872
875
  const h = (i) => {
873
- const c = i, u = !!(c || {}).isGroupHeader, w = z && !u ? G(i, M) : c.id, I = J.has(w), U = (p) => !z || u ? p : {
876
+ const c = i, u = !!(c || {}).isGroupHeader, w = G && !u ? L(i, A) : c.id, I = R.has(w), U = (g) => !G || u ? g : {
874
877
  id: w,
875
- label: String(G(p, _)),
876
- value: G(p, M)
877
- }, me = (p) => {
878
+ label: String(L(g, _)),
879
+ value: L(g, A)
880
+ }, he = (g) => {
878
881
  u || H(
879
882
  U(i),
880
- p === void 0 ? !S : p
883
+ g === void 0 ? !S : g
881
884
  );
882
- }, he = (p) => {
883
- if (H(p, !S), !S) {
884
- if (!A) return;
885
- A(""), F(v);
885
+ }, pe = (g) => {
886
+ if (H(g, !S), !S) {
887
+ if (!z) return;
888
+ z(""), F(v);
886
889
  }
887
- }, Z = (p, k) => {
888
- const ge = !!(k || {}).isGroupHeader;
890
+ }, Y = (g, k) => {
891
+ const oe = !!(k || {}).isGroupHeader;
889
892
  return (
890
893
  // biome-ignore lint/a11y/useSemanticElements: <>
891
- /* @__PURE__ */ s.jsx(
894
+ /* @__PURE__ */ a.jsx(
892
895
  "div",
893
896
  {
894
897
  tabIndex: 0,
895
898
  role: "listitem",
896
- onKeyDown: (Se) => $e(Se, k),
899
+ onKeyDown: (Ne) => Ve(Ne, k),
897
900
  className: d(
898
- !ge && !j && "focus-visible:bg-neutral-medium-hover outline-none hover:bg-neutral-medium-hover",
901
+ !oe && !j && "focus-visible:bg-neutral-medium-hover outline-none hover:bg-neutral-medium-hover",
899
902
  I && "bg-neutral-medium-selected",
900
903
  j && "cursor-default pointer-events-none"
901
904
  ),
902
- children: p
905
+ children: g
903
906
  },
904
907
  k.id
905
908
  )
906
909
  );
907
910
  };
908
911
  if (u) {
909
- const p = c.groupLabelNode ?? c.label, k = String(c.id), ge = se === !1 ? !0 : Ge(k), Se = c.originalOption, t = c.groupData?.groupOptions ?? [], o = (g) => {
910
- se && ze(k, g);
911
- }, f = (g) => {
912
- !t || t.length === 0 || K && K(t, g);
913
- }, E = t.filter(
914
- (g) => J.has(G(g, M))
915
- ).map((g) => String(G(g, M)));
916
- if (ye) {
917
- const g = ee(
918
- ye,
919
- (b, L) => b.label === L.label && b.group === L.group && b.groupOptions === L.groupOptions && b.disabled === L.disabled && b.multiple === L.multiple && b.expanded === L.expanded && b.renderContext === L.renderContext
920
- ), C = Ke.createElement(g, {
921
- group: Se,
922
- label: p,
923
- groupOptions: t,
912
+ const g = c.groupLabelNode ?? c.label, k = String(c.id), oe = se === !1 ? !0 : ze(k), Ne = c.originalOption, ie = c.groupData?.groupOptions ?? [], t = (b) => {
913
+ se && Ae(k, b);
914
+ }, o = (b) => {
915
+ !ie || ie.length === 0 || K && K(ie, b);
916
+ }, f = ie.filter(
917
+ (b) => R.has(L(b, A))
918
+ ).map((b) => String(L(b, A)));
919
+ if (Ce) {
920
+ const b = Z(
921
+ Ce,
922
+ (p, x) => p.label === x.label && p.group === x.group && p.groupOptions === x.groupOptions && p.disabled === x.disabled && p.multiple === x.multiple && p.expanded === x.expanded && p.renderContext === x.renderContext
923
+ ), E = We.createElement(b, {
924
+ group: Ne,
925
+ label: g,
926
+ groupOptions: ie,
924
927
  multiple: S,
925
928
  disabled: j,
926
- expanded: ge,
927
- toggleGroup: o,
928
- selectGroup: f,
929
- renderContext: ne,
930
- groupSelectedIds: E
929
+ expanded: oe,
930
+ toggleGroup: t,
931
+ selectGroup: o,
932
+ renderContext: te,
933
+ groupSelectedIds: f
931
934
  });
932
- return Z(C, c);
935
+ return Y(E, c);
933
936
  }
934
- return Z(
935
- /* @__PURE__ */ s.jsxs("div", { className: "px-3 py-2 text-neutral-medium-default font-medium text-sm w-full flex justify-between", children: [
936
- /* @__PURE__ */ s.jsx("div", { children: p }),
937
- se && /* @__PURE__ */ s.jsx(
937
+ return Y(
938
+ /* @__PURE__ */ a.jsxs("div", { className: "px-3 py-2 text-neutral-medium-default font-medium text-sm w-full flex justify-between", children: [
939
+ /* @__PURE__ */ a.jsx("div", { children: g }),
940
+ se && /* @__PURE__ */ a.jsx(
938
941
  "div",
939
942
  {
940
943
  className: "cursor-pointer",
941
- onClick: () => ze(k),
942
- children: /* @__PURE__ */ s.jsx(
943
- rt,
944
+ onClick: () => Ae(k),
945
+ children: /* @__PURE__ */ a.jsx(
946
+ st,
944
947
  {
945
948
  className: d(
946
949
  "transition-transform duration-300 ease-out",
947
- ge ? "rotate-180" : "rotate-0"
950
+ oe ? "rotate-180" : "rotate-0"
948
951
  )
949
952
  }
950
953
  )
@@ -954,42 +957,42 @@ function Nt({
954
957
  c
955
958
  );
956
959
  }
957
- const oe = z ? Ke.createElement(
958
- ee(
959
- z,
960
- (p, k) => p.isSelected === k.isSelected && p.option === k.option && p.disabled === k.disabled && p.multiple === k.multiple && p.renderContext === k.renderContext
960
+ const le = G ? We.createElement(
961
+ Z(
962
+ G,
963
+ (g, k) => g.isSelected === k.isSelected && g.option === k.option && g.disabled === k.disabled && g.multiple === k.multiple && g.renderContext === k.renderContext
961
964
  ),
962
965
  {
963
966
  key: w,
964
967
  option: i,
965
968
  isSelected: I,
966
969
  multiple: S,
967
- onSelect: me,
970
+ onSelect: he,
968
971
  disabled: j,
969
- isLoading: re,
970
- renderContext: ne
972
+ isLoading: ne,
973
+ renderContext: te
971
974
  }
972
- ) : /* @__PURE__ */ s.jsx(
973
- Xe,
975
+ ) : /* @__PURE__ */ a.jsx(
976
+ Ye,
974
977
  {
975
978
  disabled: j,
976
979
  multiple: S,
977
- isLoading: re,
980
+ isLoading: ne,
978
981
  isSelected: I,
979
- onSelect: he,
982
+ onSelect: pe,
980
983
  option: i
981
984
  },
982
985
  w
983
986
  );
984
- return Z(
985
- oe,
987
+ return Y(
988
+ le,
986
989
  U(i)
987
990
  );
988
991
  }, l = () => {
989
- if (!a) return;
990
- const i = String(a.header.id), c = se === !1 ? !0 : Ge(i), u = h(a.header), w = a.items.map(
992
+ if (!s) return;
993
+ const i = String(s.header.id), c = se === !1 ? !0 : ze(i), u = h(s.header), w = s.items.map(
991
994
  (U) => h(U)
992
- ), I = /* @__PURE__ */ s.jsx(
995
+ ), I = /* @__PURE__ */ a.jsx(
993
996
  "div",
994
997
  {
995
998
  className: d(
@@ -1001,27 +1004,27 @@ function Nt({
1001
1004
  }
1002
1005
  );
1003
1006
  r.push(
1004
- /* @__PURE__ */ s.jsxs(
1007
+ /* @__PURE__ */ a.jsxs(
1005
1008
  "div",
1006
1009
  {
1007
- className: d("flex flex-col", Ee),
1010
+ className: d("flex flex-col", Ie),
1008
1011
  children: [
1009
1012
  u,
1010
1013
  I
1011
1014
  ]
1012
1015
  },
1013
- `group-container-${a.header.id}`
1016
+ `group-container-${s.header.id}`
1014
1017
  )
1015
- ), a = null;
1018
+ ), s = null;
1016
1019
  };
1017
- return De.forEach((i) => {
1020
+ return je.forEach((i) => {
1018
1021
  const c = i;
1019
1022
  if (!!(c || {}).isGroupHeader) {
1020
- l(), a = { header: c, items: [] };
1023
+ l(), s = { header: c, items: [] };
1021
1024
  return;
1022
1025
  }
1023
- if (a) {
1024
- a.items.push(i);
1026
+ if (s) {
1027
+ s.items.push(i);
1025
1028
  return;
1026
1029
  }
1027
1030
  r.push(h(i));
@@ -1033,49 +1036,49 @@ function Nt({
1033
1036
  )
1034
1037
  }
1035
1038
  );
1036
- return ue ? Ve : it(Ve, document.body);
1039
+ return de ? _e : ct(_e, document.body);
1037
1040
  }
1038
- const wt = ee(
1039
- Nt,
1041
+ const Dt = Z(
1042
+ wt,
1040
1043
  (e, n) => e.options === n.options && e.selectedOptionsIds === n.selectedOptionsIds && e.multiple === n.multiple && e.disabled === n.disabled && e.emptyMessage === n.emptyMessage && e.renderOption === n.renderOption && e.renderOptionContext === n.renderOptionContext && e.isOpen === n.isOpen && e.attachToParent === n.attachToParent && e.optionValue === n.optionValue && e.optionLabel === n.optionLabel && e.filteredOptions === n.filteredOptions && e.isLoading === n.isLoading && e.optionContainerClassName === n.optionContainerClassName && e.groupContainerClassName === n.groupContainerClassName && e.collapsedGroups === n.collapsedGroups && e.setCollapsedGroups === n.setCollapsedGroups && e.isControledSearchValue === n.isControledSearchValue && e.searchValue === n.searchValue
1041
- ), Xe = ee(
1044
+ ), Ye = Z(
1042
1045
  ({
1043
1046
  option: e,
1044
1047
  isSelected: n,
1045
- onSelect: x,
1048
+ onSelect: y,
1046
1049
  multiple: v,
1047
1050
  disabled: S,
1048
1051
  isLoading: j
1049
1052
  }) => {
1050
- const y = (e || {})?.isGroupHeader;
1053
+ const C = (e || {})?.isGroupHeader;
1051
1054
  if (j)
1052
- return /* @__PURE__ */ s.jsxs(
1055
+ return /* @__PURE__ */ a.jsxs(
1053
1056
  "div",
1054
1057
  {
1055
1058
  className: "flex gap-2 w-full px-3 py-2 cursor-wait",
1056
1059
  children: [
1057
- /* @__PURE__ */ s.jsx(et, { className: "size-6 aspect-square" }),
1058
- /* @__PURE__ */ s.jsx(et, { className: "flex-1 h-6" })
1060
+ /* @__PURE__ */ a.jsx(tt, { className: "size-6 aspect-square" }),
1061
+ /* @__PURE__ */ a.jsx(tt, { className: "flex-1 h-6" })
1059
1062
  ]
1060
1063
  },
1061
1064
  e.id
1062
1065
  );
1063
- const te = (_) => {
1064
- _.preventDefault(), _.stopPropagation(), !(S || y) && x?.(e);
1065
- }, m = y && e.groupLabelNode ? e.groupLabelNode : e.label;
1066
- return /* @__PURE__ */ s.jsxs(
1066
+ const ee = (_) => {
1067
+ _.preventDefault(), _.stopPropagation(), !(S || C) && y?.(e);
1068
+ }, m = C && e.groupLabelNode ? e.groupLabelNode : e.label;
1069
+ return /* @__PURE__ */ a.jsxs(
1067
1070
  "div",
1068
1071
  {
1069
- onMouseDown: te,
1072
+ onMouseDown: ee,
1070
1073
  className: d(
1071
1074
  "px-3 py-2 flex items-center transition-colors text-neutral-default-default ",
1072
- y ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
1073
- !y && (n ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover"),
1074
- S && !y && "text-neutral-default-disabled hover:bg-neutral-default-default"
1075
+ C ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
1076
+ !C && (n ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover"),
1077
+ S && !C && "text-neutral-default-disabled hover:bg-neutral-default-default"
1075
1078
  ),
1076
1079
  children: [
1077
- v && !y && /* @__PURE__ */ s.jsx(mt, { checked: n, disabled: S }),
1078
- /* @__PURE__ */ s.jsx("span", { children: m })
1080
+ v && !C && /* @__PURE__ */ a.jsx(ht, { checked: n, disabled: S }),
1081
+ /* @__PURE__ */ a.jsx("span", { children: m })
1079
1082
  ]
1080
1083
  },
1081
1084
  e.id
@@ -1083,29 +1086,29 @@ const wt = ee(
1083
1086
  },
1084
1087
  (e, n) => e.isSelected === n.isSelected && e.disabled === n.disabled
1085
1088
  );
1086
- Xe.displayName = "DefaultOptionRenderer";
1087
- const at = ee(
1089
+ Ye.displayName = "DefaultOptionRenderer";
1090
+ const at = Z(
1088
1091
  ({
1089
1092
  selectedOptions: e,
1090
1093
  placeholder: n,
1091
- onRemoveOption: x,
1094
+ onRemoveOption: y,
1092
1095
  displayMode: v,
1093
1096
  multiple: S,
1094
1097
  className: j,
1095
- disabled: y,
1096
- size: te = "medium"
1097
- }) => e?.length === 0 ? n ? /* @__PURE__ */ s.jsx("span", { className: "text-neutral-medium-default line-clamp-1", children: n }) : null : v === "chips" && S ? /* @__PURE__ */ s.jsx("div", { className: d("flex items-center gap-1 ", j), children: e.map((m) => /* @__PURE__ */ s.jsx(
1098
- ft,
1098
+ disabled: C,
1099
+ size: ee = "medium"
1100
+ }) => e?.length === 0 ? n ? /* @__PURE__ */ a.jsx("span", { className: "text-neutral-medium-default line-clamp-1", children: n }) : null : v === "chips" && S ? /* @__PURE__ */ a.jsx("div", { className: d("flex items-center gap-1 ", j), children: e.map((m) => /* @__PURE__ */ a.jsx(
1101
+ mt,
1099
1102
  {
1100
1103
  tabIndex: -1,
1101
1104
  id: m.id,
1102
1105
  label: m.label,
1103
- onRemove: x,
1104
- disabled: y,
1105
- size: te
1106
+ onRemove: y,
1107
+ disabled: C,
1108
+ size: ee
1106
1109
  },
1107
1110
  m.id
1108
- )) }) : e?.length === 1 ? /* @__PURE__ */ s.jsx("span", { className: "line-clamp-1", children: e[0].label }) : /* @__PURE__ */ s.jsxs("span", { className: "line-clamp-1", children: [
1111
+ )) }) : e?.length === 1 ? /* @__PURE__ */ a.jsx("span", { className: "line-clamp-1", children: e[0].label }) : /* @__PURE__ */ a.jsxs("span", { className: "line-clamp-1", children: [
1109
1112
  e?.length,
1110
1113
  " seleccionados"
1111
1114
  ] }),
@@ -1113,5 +1116,5 @@ const at = ee(
1113
1116
  );
1114
1117
  at.displayName = "DefaultSelectionDisplay";
1115
1118
  export {
1116
- Bt as default
1119
+ Ft as default
1117
1120
  };