prometeo-design-system 5.7.3 → 5.7.4

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