prometeo-design-system 2.7.9 → 2.8.1

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.
@@ -1,15 +1,15 @@
1
1
  import { j as s } from "./jsx-runtime-DKDX3adD.js";
2
- import { Icons as je } from "./Icons.es.js";
2
+ import { I as Qe, b as Xe, c as Ue, S as Ye } from "./Icons-ChYkaR8R.js";
3
3
  import { c as f } from "./cn-B6yFEsav.js";
4
- import Ne, { memo as Z, useState as De, useRef as ce, useMemo as oe, useCallback as U, useEffect as ve, useImperativeHandle as Qe } from "react";
5
- import Xe from "./Spinner.es.js";
6
- import { createPortal as Ye } from "react-dom";
7
- import { u as Ze } from "./useDragScroll-CHN9OMwn.js";
8
- import { u as et, I as tt } from "./Input-60IT1aGF.js";
9
- import { H as nt } from "./HelperComponent-U6mPwuDH.js";
10
- import rt from "./CheckBox.es.js";
11
- import { Skeleton as Fe } from "./Skeleton.es.js";
12
- const lt = {
4
+ import Ne, { memo as Z, useState as De, useRef as ce, useMemo as oe, useCallback as U, useEffect as ve, useImperativeHandle as Ze } from "react";
5
+ import et from "./Spinner.es.js";
6
+ import { createPortal as tt } from "react-dom";
7
+ import { u as nt } from "./useDragScroll-CHN9OMwn.js";
8
+ import { u as rt, I as lt } from "./Input-CsNlU1Hu.js";
9
+ import { H as ot } from "./HelperComponent-CcGxM09g.js";
10
+ import st from "./CheckBox.es.js";
11
+ import { Skeleton as Ke } from "./Skeleton.es.js";
12
+ const at = {
13
13
  default: {
14
14
  container: "text-neutral-default-default border-neutral-default-default ",
15
15
  icon: ""
@@ -22,25 +22,25 @@ const lt = {
22
22
  container: "",
23
23
  icon: ""
24
24
  }
25
- }, qe = {
25
+ }, Fe = {
26
26
  icon: " text-neutral-default-disabled",
27
27
  container: " border-neutral-strong-default text-neutral-default-disabled"
28
- }, Ve = ({ id: e, label: n, onRemove: h, className: i, disabled: u, variant: v = "default", tabIndex: m }) => /* @__PURE__ */ s.jsxs(
28
+ }, Ve = ({ id: e, label: n, onRemove: m, className: i, disabled: u, variant: v = "default", tabIndex: h }) => /* @__PURE__ */ s.jsxs(
29
29
  "div",
30
30
  {
31
- tabIndex: m,
31
+ tabIndex: h,
32
32
  className: f(
33
33
  "inline-flex max-w-[calc(50%-0.25rem)] items-center gap-1 px-2 py-1 bg-inherit text-xs rounded-lg border h-[30px]",
34
- lt[v].container,
35
- u && qe.container
34
+ at[v].container,
35
+ u && Fe.container
36
36
  ),
37
37
  children: [
38
38
  /* @__PURE__ */ s.jsx("span", { className: "truncate w-max ", children: n }),
39
- h && /* @__PURE__ */ s.jsx(
39
+ m && /* @__PURE__ */ s.jsx(
40
40
  "button",
41
41
  {
42
42
  onMouseDown: (j) => {
43
- u || (j.stopPropagation(), j.preventDefault(), h?.(e));
43
+ u || (j.stopPropagation(), j.preventDefault(), m?.(e));
44
44
  },
45
45
  className: f(
46
46
  "shrink-0 p-0.5 transition-all duration-200 hover:text-neutral-default-hover cursor-pointer z-50 text-neutral-default-default hover:scale-105",
@@ -48,34 +48,34 @@ const lt = {
48
48
  i
49
49
  ),
50
50
  type: "button",
51
- tabIndex: m,
52
- children: /* @__PURE__ */ s.jsx(je.Close, { size: 18, className: f(u && qe.icon) })
51
+ tabIndex: h,
52
+ children: /* @__PURE__ */ s.jsx(Qe.Close, { size: 18, className: f(u && Fe.icon) })
53
53
  }
54
54
  )
55
55
  ]
56
56
  }
57
57
  );
58
58
  Ve.displayName = "Chip";
59
- const ot = Z(Ve);
59
+ const it = Z(Ve);
60
60
  function G(e, n) {
61
61
  if (typeof n == "function")
62
62
  return n(e);
63
- const h = n?.split(".");
63
+ const m = n?.split(".");
64
64
  let i = e;
65
- for (const u of h)
65
+ for (const u of m)
66
66
  if (i && typeof i == "object" && u in i)
67
67
  i = i[u];
68
68
  else
69
69
  return;
70
70
  return i;
71
71
  }
72
- const Ue = (e, n) => {
72
+ const qe = (e, n) => {
73
73
  if (!n) return !0;
74
- const h = 0.1, i = String(e).toLowerCase(), u = String(n).toLowerCase().trim();
74
+ const m = 0.1, i = String(e).toLowerCase(), u = String(n).toLowerCase().trim();
75
75
  if (i.includes(u)) return !0;
76
- const v = u.split(/\s+/).filter(Boolean), m = v.filter((b) => /^\d+$/.test(b));
77
- if (v.length > 1 || m.length > 0) {
78
- for (const b of m)
76
+ const v = u.split(/\s+/).filter(Boolean), h = v.filter((b) => /^\d+$/.test(b));
77
+ if (v.length > 1 || h.length > 0) {
78
+ for (const b of h)
79
79
  if (!new RegExp(`(^|\\D)${b}(\\D|$)`).test(i)) return !1;
80
80
  for (const b of v)
81
81
  if (!/^\d+$/.test(b) && !i.includes(b))
@@ -83,7 +83,7 @@ const Ue = (e, n) => {
83
83
  return !0;
84
84
  }
85
85
  if (u.length > i.length) return !1;
86
- const j = Math.floor(u.length * h);
86
+ const j = Math.floor(u.length * m);
87
87
  if (j <= 0) return !1;
88
88
  const p = (b, k) => {
89
89
  const I = b.length, W = k.length;
@@ -106,15 +106,15 @@ const Ue = (e, n) => {
106
106
  if (p(k, u) <= j) return !0;
107
107
  }
108
108
  return !1;
109
- }, st = (e) => {
110
- const n = [], h = (i) => {
109
+ }, ut = (e) => {
110
+ const n = [], m = (i) => {
111
111
  i.forEach((u) => {
112
- const m = u.options;
113
- Array.isArray(m) && m.length > 0 ? h(m) : n.push(u);
112
+ const h = u.options;
113
+ Array.isArray(h) && h.length > 0 ? m(h) : n.push(u);
114
114
  });
115
115
  };
116
- return h(e), n;
117
- }, Re = {
116
+ return m(e), n;
117
+ }, _e = {
118
118
  default: {
119
119
  container: "",
120
120
  input: f(
@@ -151,7 +151,7 @@ const Ue = (e, n) => {
151
151
  label: f("text-success", "peer-focus:text-success-light"),
152
152
  icon: f("text-success-medium-default", "peer-focus:text-success-light")
153
153
  }
154
- }, Be = {
154
+ }, Re = {
155
155
  input: f(
156
156
  "border-neutral-strong-default text-neutral-default-default pointer-events-none",
157
157
  "focus:ring-0 focus:border-primary-default-disabled ",
@@ -166,8 +166,8 @@ const Ue = (e, n) => {
166
166
  "peer-focus:text-primary-default-default"
167
167
  )
168
168
  };
169
- function at(e) {
170
- const [n, h] = De(!1), [i, u] = De([]), [v, m] = De(""), j = ce(null), p = ce(null), b = ce(null), k = ce(null), I = ce(
169
+ function ct(e) {
170
+ const [n, m] = De(!1), [i, u] = De([]), [v, h] = De(""), j = ce(null), p = ce(null), b = ce(null), k = ce(null), I = ce(
171
171
  () => {
172
172
  }
173
173
  ), W = ce(null), A = ce(/* @__PURE__ */ new Set()), {
@@ -183,34 +183,34 @@ function at(e) {
183
183
  optionLabel: de,
184
184
  renderOption: J,
185
185
  renderOptionGroupHeader: fe,
186
- renderSelection: He,
187
- renderOptionContext: Ae,
188
- buttonClassName: Ee,
186
+ renderSelection: je,
187
+ renderOptionContext: Ie,
188
+ buttonClassName: He,
189
189
  dropdownClassName: ae,
190
190
  containerClassName: Q,
191
191
  dropdownOptions: O,
192
192
  helperComponent: ee,
193
193
  errorComponent: Ce,
194
- onRemoveOption: ke,
194
+ onRemoveOption: Ee,
195
195
  onOptionClick: X,
196
196
  onClose: Se,
197
- onClear: he,
197
+ onClear: me,
198
198
  disabled: te = !1,
199
- overflow: Ke = "wrap",
199
+ overflow: We = "wrap",
200
200
  variant: F = "default",
201
- isLoading: me = !1,
202
- attachToParent: Me = !1,
201
+ isLoading: he = !1,
202
+ attachToParent: Ae = !1,
203
203
  displayMode: we = "compact",
204
204
  labelVariant: ie = "default",
205
- disableOpenOnFocus: ze = !1,
206
- emptyMessage: Oe = "No hay opciones disponibles"
207
- } = e, { ref: Le } = et(), { bind: ne, ref: Te } = Ze({
205
+ disableOpenOnFocus: Me = !1,
206
+ emptyMessage: ke = "No hay opciones disponibles"
207
+ } = e, { ref: Oe } = rt(), { bind: ne, ref: ze } = nt({
208
208
  axis: "x",
209
209
  cursor: { idle: "default", dragging: "grabbing" }
210
- }), pe = e.multiple ? Array.isArray(e.value) && e.value.length > 0 : e.value !== void 0 && e.value !== null && e.value !== "", Ge = {}, $e = oe(() => ie === "static" && N ? N : "", [ie, N]), Ie = oe(
210
+ }), pe = e.multiple ? Array.isArray(e.value) && e.value.length > 0 : e.value !== void 0 && e.value !== null && e.value !== "", Le = {}, Te = oe(() => ie === "static" && N ? N : "", [ie, N]), Ge = oe(
211
211
  () => O?.controledSearchValue || v,
212
212
  [O?.controledSearchValue, v]
213
- ), Pe = () => {
213
+ ), $e = () => {
214
214
  const t = {
215
215
  static: {
216
216
  active: "relative prometeo-fonts-label-large",
@@ -229,7 +229,7 @@ function at(e) {
229
229
  label: G(t, de)
230
230
  }),
231
231
  [E, de]
232
- ), Y = oe(() => st(K), [K]), ge = oe(
232
+ ), Y = oe(() => ut(K), [K]), ge = oe(
233
233
  () => Y.map(T),
234
234
  [Y, T]
235
235
  ), r = oe(() => {
@@ -286,8 +286,8 @@ function at(e) {
286
286
  const C = l[0];
287
287
  if (!C) return;
288
288
  const D = c.has(C.id), B = a ?? "toggle";
289
- let _e;
290
- B === "select" || B === "toggle" && !D ? _e = C : _e = void 0, e.onChange?.(_e, S);
289
+ let Pe;
290
+ B === "select" || B === "toggle" && !D ? Pe = C : Pe = void 0, e.onChange?.(Pe, S);
291
291
  return;
292
292
  }
293
293
  const g = e.value || [], H = [];
@@ -321,7 +321,7 @@ function at(e) {
321
321
  S
322
322
  ]
323
323
  ), L = U(() => {
324
- h((t) => !t);
324
+ m((t) => !t);
325
325
  }, []);
326
326
  I.current = (t) => {
327
327
  if (!e.multiple)
@@ -340,11 +340,11 @@ function at(e) {
340
340
  };
341
341
  const y = U(
342
342
  (t, a = !1) => {
343
- X?.(t, S), I.current?.(t), a && (h(!1), Se?.());
343
+ X?.(t, S), I.current?.(t), a && (m(!1), Se?.());
344
344
  },
345
345
  [X, Se, S]
346
346
  ), R = (t) => {
347
- t.preventDefault(), t.stopPropagation(), t.target.blur(), he?.(), e.multiple ? e.onChange?.([], S) : e.onChange?.(void 0, S);
347
+ t.preventDefault(), t.stopPropagation(), t.target.blur(), me?.(), e.multiple ? e.onChange?.([], S) : e.onChange?.(void 0, S);
348
348
  }, q = U(
349
349
  (t) => {
350
350
  e.multiple || e.onChange?.(void 0, S);
@@ -353,11 +353,11 @@ function at(e) {
353
353
  );
354
354
  if (!a) return;
355
355
  const l = T(a);
356
- X?.(l, S), I.current?.(l), ke?.(a);
356
+ X?.(l, S), I.current?.(l), Ee?.(a);
357
357
  },
358
358
  [
359
359
  X,
360
- ke,
360
+ Ee,
361
361
  Y,
362
362
  S,
363
363
  e.multiple,
@@ -377,13 +377,13 @@ function at(e) {
377
377
  const l = a.target;
378
378
  if (a.type === "mousedown") {
379
379
  if (j.current?.contains(l) || p.current?.contains(l)) return;
380
- h(!1);
380
+ m(!1);
381
381
  }
382
382
  if (a.type === "scroll") {
383
383
  if (p.current?.contains(l)) return;
384
- h(!1);
384
+ m(!1);
385
385
  }
386
- a.type === "resize" && h(!1);
386
+ a.type === "resize" && m(!1);
387
387
  };
388
388
  return document.addEventListener("mousedown", t), window.addEventListener("scroll", t, !0), window.addEventListener("resize", t, !0), () => {
389
389
  document.removeEventListener("mousedown", t), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t, !0);
@@ -395,16 +395,16 @@ function at(e) {
395
395
  } catch {
396
396
  }
397
397
  });
398
- }, [n]), Qe(
398
+ }, [n]), Ze(
399
399
  V,
400
400
  () => ({
401
401
  open: () => {
402
- !n && h(!0);
402
+ !n && m(!0);
403
403
  },
404
404
  close: () => {
405
- n && h(!1);
405
+ n && m(!1);
406
406
  },
407
- toggle: () => h((t) => !t),
407
+ toggle: () => m((t) => !t),
408
408
  handleOptionSelect: y,
409
409
  subscribeOpenChange: (t) => (A.current.add(t), () => {
410
410
  A.current.delete(t);
@@ -414,11 +414,11 @@ function at(e) {
414
414
  [n, y]
415
415
  );
416
416
  const be = (t) => {
417
- t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !ze && !n && (h(!0), setTimeout(() => {
417
+ t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !Me && !n && (m(!0), setTimeout(() => {
418
418
  b.current?.focus();
419
419
  }, 10));
420
420
  }, ue = (t) => {
421
- t.key === "Tab" && n && h(!1), (t.keyCode === 32 || t.key === "ArrowDown") && (h(!0), setTimeout(() => {
421
+ t.key === "Tab" && n && m(!1), (t.keyCode === 32 || t.key === "ArrowDown") && (m(!0), setTimeout(() => {
422
422
  b.current?.focus();
423
423
  }, 10));
424
424
  };
@@ -428,20 +428,20 @@ function at(e) {
428
428
  className: f("relative bg-inherit select-none w-full", z),
429
429
  ref: j,
430
430
  draggable: !1,
431
- style: Ge,
431
+ style: Le,
432
432
  children: [
433
433
  /* @__PURE__ */ s.jsxs("div", { className: f("relative bg-inherit ", Q), children: [
434
434
  /* @__PURE__ */ s.jsx(
435
435
  "label",
436
436
  {
437
437
  htmlFor: x,
438
- ref: Le,
438
+ ref: Oe,
439
439
  className: f(
440
440
  "left-3 pointer-events-none bg-inherit z-10",
441
441
  ie === "default" && "transition-all duration-200 ease-in-out",
442
- Pe(),
443
- pe || n ? Re[F].label : "text-neutral-medium-default",
444
- te && Be.label
442
+ $e(),
443
+ pe || n ? _e[F].label : "text-neutral-medium-default",
444
+ te && Re.label
445
445
  ),
446
446
  children: M
447
447
  }
@@ -463,9 +463,9 @@ function at(e) {
463
463
  "flex items-center justify-start bg-inherit ",
464
464
  "focus:outline-none",
465
465
  we === "chips" && e.multiple && pe ? "min-h-12 py-2 " : !se && "h-12 min-h-12",
466
- Re[F].input,
467
- te && Be.input,
468
- Ee
466
+ _e[F].input,
467
+ te && Re.input,
468
+ He
469
469
  ),
470
470
  children: [
471
471
  /* @__PURE__ */ s.jsx(
@@ -474,16 +474,16 @@ function at(e) {
474
474
  className: f(
475
475
  "flex-1 overflow-x-auto overflow-y-hidden px-1 prometeo-scrollbar-none "
476
476
  ),
477
- ref: Te,
477
+ ref: ze,
478
478
  onPointerUp: ne.onPointerUp,
479
479
  onPointerDown: ne.onPointerDown,
480
480
  onPointerMove: ne.onPointerMove,
481
481
  onPointerLeave: ne.onPointerLeave,
482
482
  onPointerCancel: ne.onPointerCancel,
483
483
  onClickCapture: ne.onClickCapture,
484
- children: He ? Ne.createElement(
484
+ children: je ? Ne.createElement(
485
485
  Z(
486
- He,
486
+ je,
487
487
  (t, a) => t.disabled === a.disabled && t.multiple === a.multiple
488
488
  ),
489
489
  {
@@ -498,11 +498,11 @@ function at(e) {
498
498
  {
499
499
  displayMode: we,
500
500
  selectedOptions: o,
501
- placeholder: $e,
501
+ placeholder: Te,
502
502
  onRemoveOption: q,
503
503
  multiple: e.multiple || !1,
504
504
  className: f(
505
- Ke === "scroll" ? "flex-nowrap" : "flex-wrap"
505
+ We === "scroll" ? "flex-nowrap" : "flex-wrap"
506
506
  ),
507
507
  disabled: te
508
508
  }
@@ -510,8 +510,8 @@ function at(e) {
510
510
  }
511
511
  ),
512
512
  /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
513
- me && /* @__PURE__ */ s.jsx(
514
- Xe,
513
+ he && /* @__PURE__ */ s.jsx(
514
+ et,
515
515
  {
516
516
  size: "small",
517
517
  variant: "clip",
@@ -519,7 +519,7 @@ function at(e) {
519
519
  speedMultiplier: 0.7
520
520
  }
521
521
  ),
522
- pe && he && /* @__PURE__ */ s.jsx(
522
+ pe && me && /* @__PURE__ */ s.jsx(
523
523
  "button",
524
524
  {
525
525
  onMouseDown: (t) => {
@@ -528,25 +528,25 @@ function at(e) {
528
528
  type: "button",
529
529
  tabIndex: -1,
530
530
  children: /* @__PURE__ */ s.jsx(
531
- je.Cancel,
531
+ Xe,
532
532
  {
533
533
  size: 20,
534
534
  className: f(
535
535
  " cursor-pointer transition-all",
536
- Re[F].icon
536
+ _e[F].icon
537
537
  )
538
538
  }
539
539
  )
540
540
  }
541
541
  ),
542
542
  /* @__PURE__ */ s.jsx(
543
- je.ChevronDown,
543
+ Ue,
544
544
  {
545
545
  size: 20,
546
546
  className: f(
547
547
  "transition-transform text-neutral-default-default",
548
548
  n ? "rotate-180" : "",
549
- te && Be.icon
549
+ te && Re.icon
550
550
  )
551
551
  }
552
552
  )
@@ -556,33 +556,33 @@ function at(e) {
556
556
  )
557
557
  ] }),
558
558
  n && /* @__PURE__ */ s.jsx(
559
- ct,
559
+ mt,
560
560
  {
561
561
  label: M,
562
562
  isOpen: n,
563
563
  disabled: te,
564
564
  optionValue: E,
565
565
  optionLabel: de,
566
- emptyMessage: Oe,
566
+ emptyMessage: ke,
567
567
  labelVariant: ie,
568
568
  renderOption: J,
569
569
  renderOptionGroupHeader: fe,
570
- attachToParent: Me,
570
+ attachToParent: Ae,
571
571
  filteredOptions: i,
572
572
  multiple: e.multiple || !1,
573
573
  dropdownClassName: ae,
574
574
  selectedOptionsIds: c,
575
575
  setFilteredOptions: u,
576
- renderOptionContext: Ae,
576
+ renderOptionContext: Ie,
577
577
  options: d,
578
578
  selectRef: j,
579
579
  dropdownRef: p,
580
580
  selectButtonRef: k,
581
581
  helperComponentRef: W,
582
582
  onOptionClick: y,
583
- onCloseDropdown: () => h(!1),
584
- searchValue: Ie,
585
- setSearchValue: m,
583
+ onCloseDropdown: () => m(!1),
584
+ searchValue: Ge,
585
+ setSearchValue: h,
586
586
  searchInputRef: b,
587
587
  isLoading: O?.isLoading,
588
588
  onSearchClear: O?.onSearchClear,
@@ -598,7 +598,7 @@ function at(e) {
598
598
  }
599
599
  ),
600
600
  (Ce || ee) && /* @__PURE__ */ s.jsx("div", { className: "min-h-6", children: /* @__PURE__ */ s.jsx(
601
- nt,
601
+ ot,
602
602
  {
603
603
  ref: W,
604
604
  variant: F,
@@ -610,15 +610,15 @@ function at(e) {
610
610
  }
611
611
  );
612
612
  }
613
- const it = Z(at, (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), St = it;
614
- function ut({
613
+ const dt = Z(ct, (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), Dt = dt;
614
+ function ft({
615
615
  footer: e,
616
616
  isOpen: n,
617
- label: h,
617
+ label: m,
618
618
  options: i,
619
619
  multiple: u,
620
620
  disabled: v,
621
- selectRef: m,
621
+ selectRef: h,
622
622
  inputProps: j,
623
623
  dropdownRef: p,
624
624
  optionLabel: b,
@@ -638,27 +638,27 @@ function ut({
638
638
  filteredOptions: de,
639
639
  selectButtonRef: J,
640
640
  onCloseDropdown: fe,
641
- loadingComponent: He,
642
- dropdownClassName: Ae,
643
- helperComponentRef: Ee,
641
+ loadingComponent: je,
642
+ dropdownClassName: Ie,
643
+ helperComponentRef: He,
644
644
  selectedOptionsIds: ae,
645
645
  setFilteredOptions: Q,
646
646
  onSearchValueChange: O,
647
647
  isLoading: ee = !1,
648
648
  hideSearchBar: Ce = !1,
649
- inputSearchPlaceholder: ke = "Buscar opciones",
649
+ inputSearchPlaceholder: Ee = "Buscar opciones",
650
650
  enableGroupToggle: X = !0,
651
651
  onGroupSelectChange: Se
652
652
  }) {
653
- const he = e ? 380 : 320, te = W === "static" ? h !== "" ? -20 : 4 : 7, F = U(() => N ? N.endsWith("px") ? Number(N.replace("px", "")) : N.endsWith("vh") ? window.innerHeight * Number(N.replace("vh", "")) / 100 : N.endsWith("%") ? window.innerHeight * Number(N.replace("%", "")) / 100 : he : he, [N, he])(), [me, Me] = De({
653
+ const me = e ? 380 : 320, te = W === "static" ? m !== "" ? -20 : 4 : 7, F = U(() => N ? N.endsWith("px") ? Number(N.replace("px", "")) : N.endsWith("vh") ? window.innerHeight * Number(N.replace("vh", "")) / 100 : N.endsWith("%") ? window.innerHeight * Number(N.replace("%", "")) / 100 : me : me, [N, me])(), [he, Ae] = De({
654
654
  direction: "down",
655
655
  height: F
656
656
  }), [we, ie] = De(
657
657
  () => /* @__PURE__ */ new Set()
658
- ), ze = U(
658
+ ), Me = U(
659
659
  (r) => !we.has(r),
660
660
  [we]
661
- ), Oe = U(
661
+ ), ke = U(
662
662
  (r, o) => {
663
663
  ie((c) => {
664
664
  const d = new Set(c), w = d.has(r);
@@ -666,12 +666,12 @@ function ut({
666
666
  });
667
667
  },
668
668
  []
669
- ), Le = (r) => {
670
- if (!p.current || !m.current) return;
671
- const o = m.current.getBoundingClientRect();
672
- switch (r || me.direction) {
669
+ ), Oe = (r) => {
670
+ if (!p.current || !h.current) return;
671
+ const o = h.current.getBoundingClientRect();
672
+ switch (r || he.direction) {
673
673
  case "down":
674
- p.current.style.top = `${o.top + o.height - (Ee?.current?.offsetHeight ? Ee?.current?.offsetHeight + 4 : 0)}px`;
674
+ p.current.style.top = `${o.top + o.height - (He?.current?.offsetHeight ? He?.current?.offsetHeight + 4 : 0)}px`;
675
675
  break;
676
676
  case "up":
677
677
  p.current.style.top = "auto", p.current.style.bottom = `${window.innerHeight - o.top + te}px`;
@@ -680,36 +680,36 @@ function ut({
680
680
  p.current.style.left = `${o.left}px`, p.current.style.width = `${o.width}px`;
681
681
  }, ne = (r) => {
682
682
  p.current && (p.current.style.maxHeight = `${r}px`);
683
- }, Te = () => {
684
- if (!p.current || !m.current) return me;
685
- const r = m.current.getBoundingClientRect(), o = window.innerHeight - (window.innerHeight - r.top), c = window.innerHeight - r.bottom, d = c >= F, w = o >= F;
683
+ }, ze = () => {
684
+ if (!p.current || !h.current) return he;
685
+ const r = h.current.getBoundingClientRect(), o = window.innerHeight - (window.innerHeight - r.top), c = window.innerHeight - r.bottom, d = c >= F, w = o >= F;
686
686
  let L = "down", y;
687
687
  return d ? (L = "down", y = F) : w ? (L = "up", y = F) : c > o ? (L = "down", y = c - 16) : (L = "up", y = o - 16), { direction: L, height: y };
688
688
  }, pe = (r) => {
689
- if (!(!p.current || !m.current)) {
689
+ if (!(!p.current || !h.current)) {
690
690
  if (p.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !r) {
691
691
  p.current.style.maxHeight = "0", p.current.style.opacity = "0", p.current.style.pointerEvents = "none";
692
692
  return;
693
693
  }
694
694
  if (!E) {
695
- const o = Te();
696
- Me(o), Le(o.direction), ne(o.height);
695
+ const o = ze();
696
+ Ae(o), Oe(o.direction), ne(o.height);
697
697
  }
698
698
  p.current.style.opacity = "1", p.current.style.pointerEvents = "auto";
699
699
  }
700
700
  };
701
701
  ve(() => {
702
- E || !m.current || !n || Le();
702
+ E || !h.current || !n || Oe();
703
703
  }, [ae]), ve(() => {
704
704
  pe(n);
705
705
  }, [n]), ve(() => {
706
706
  i && Q(i);
707
707
  }, [i]), ve(() => {
708
708
  if (ee || !I) return;
709
- const r = Ge(i, I);
709
+ const r = Le(i, I);
710
710
  Q(r);
711
711
  }, [i]);
712
- const Ge = (r, o) => {
712
+ const Le = (r, o) => {
713
713
  if (!o) return r;
714
714
  if (x) {
715
715
  const y = [];
@@ -726,7 +726,7 @@ function ut({
726
726
  const a = be, l = G(
727
727
  a,
728
728
  b
729
- ), g = Ue(String(l ?? ""), o);
729
+ ), g = qe(String(l ?? ""), o);
730
730
  R ? g && q.push(a) : g && y.push(a);
731
731
  }), re(), y;
732
732
  }
@@ -740,21 +740,21 @@ function ut({
740
740
  L(), d = y;
741
741
  return;
742
742
  }
743
- const R = Ue(y.label, o);
743
+ const R = qe(y.label, o);
744
744
  d ? R && w.push(y) : R && c.push(y);
745
745
  }), L(), c;
746
- }, $e = (r) => {
747
- const o = Ge(i, r);
746
+ }, Te = (r) => {
747
+ const o = Le(i, r);
748
748
  if (Q(o), O) {
749
749
  if (r === "") {
750
- Ie();
750
+ Ge();
751
751
  return;
752
752
  }
753
753
  O(r);
754
754
  return;
755
755
  }
756
756
  z && i && z(r);
757
- }, Ie = U(() => {
757
+ }, Ge = U(() => {
758
758
  if (K) {
759
759
  K(), Q(
760
760
  i.filter((r) => {
@@ -773,7 +773,7 @@ function ut({
773
773
  Q,
774
774
  z,
775
775
  x
776
- ]), Pe = (r) => {
776
+ ]), $e = (r) => {
777
777
  r.key === "ArrowDown" ? (r.preventDefault(), p.current?.querySelector(
778
778
  "[role=listitem]"
779
779
  )?.focus()) : (r.key === "Tab" || r.key === "Escape") && setTimeout(() => {
@@ -819,7 +819,7 @@ function ut({
819
819
  renderContext: S
820
820
  }
821
821
  ) : /* @__PURE__ */ s.jsx(
822
- We,
822
+ Be,
823
823
  {
824
824
  multiple: !1,
825
825
  isLoading: !0,
@@ -841,8 +841,8 @@ function ut({
841
841
  " z-100! w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-lg shadow-lg",
842
842
  " overflow-hidden focus-visible:bg-neutral-default-hover ",
843
843
  E ? "absolute z-50 " : "fixed z-100 top-0 left-0",
844
- me.direction === "up" ? "h-auto" : " h-max",
845
- Ae
844
+ he.direction === "up" ? "h-auto" : " h-max",
845
+ Ie
846
846
  ),
847
847
  children: /* @__PURE__ */ s.jsxs(
848
848
  "div",
@@ -853,11 +853,11 @@ function ut({
853
853
  ),
854
854
  style: {
855
855
  height: "auto",
856
- maxHeight: me.height
856
+ maxHeight: he.height
857
857
  },
858
858
  children: [
859
859
  !Ce && /* @__PURE__ */ s.jsx(
860
- tt,
860
+ lt,
861
861
  {
862
862
  name: "",
863
863
  label: "",
@@ -867,17 +867,17 @@ function ut({
867
867
  disabled: v,
868
868
  ref: V,
869
869
  labelVariant: "static",
870
- icon: /* @__PURE__ */ s.jsx(je.Search, {}),
870
+ icon: /* @__PURE__ */ s.jsx(Ye, {}),
871
871
  isFetching: ee,
872
- onKeyDown: Pe,
873
- onClear: Ie,
874
- onChange: (r) => $e(r.target.value),
875
- placeholder: ke,
872
+ onKeyDown: $e,
873
+ onClear: Ge,
874
+ onChange: (r) => Te(r.target.value),
875
+ placeholder: Ee,
876
876
  className: " bg-neutral-medium-pressed",
877
877
  ...j
878
878
  }
879
879
  ),
880
- /* @__PURE__ */ s.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: de.length === 0 ? ee ? /* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: He || Y }) : /* @__PURE__ */ s.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: I ? `No se encontraron resultados para "${I}"` : A }) : (() => {
880
+ /* @__PURE__ */ s.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: de.length === 0 ? ee ? /* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: je || Y }) : /* @__PURE__ */ s.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: I ? `No se encontraron resultados para "${I}"` : A }) : (() => {
881
881
  let r = !0;
882
882
  return de.map((o) => {
883
883
  const c = o, d = !!c.isGroupHeader, w = x && !d ? G(o, k) : c.id, L = ae.has(w), y = (l) => !x || d ? l : {
@@ -916,10 +916,10 @@ function ut({
916
916
  );
917
917
  };
918
918
  if (d) {
919
- const l = c.groupLabelNode ?? c.label, g = String(c.id), H = X === !1 ? !0 : ze(g);
919
+ const l = c.groupLabelNode ?? c.label, g = String(c.id), H = X === !1 ? !0 : Me(g);
920
920
  r = H;
921
921
  const $ = c.originalOption, P = c.groupData?.groupOptions ?? [], le = (_) => {
922
- X && Oe(g, _);
922
+ X && ke(g, _);
923
923
  }, xe = (_) => {
924
924
  !P || P.length === 0 || Se && Se(P, _);
925
925
  }, ye = P.filter(
@@ -950,9 +950,9 @@ function ut({
950
950
  "div",
951
951
  {
952
952
  className: "cursor-pointer",
953
- onClick: () => Oe(g),
953
+ onClick: () => ke(g),
954
954
  children: /* @__PURE__ */ s.jsx(
955
- je.ChevronDown,
955
+ Ue,
956
956
  {
957
957
  className: f(
958
958
  "transition-transform duration-300 ease-out",
@@ -982,7 +982,7 @@ function ut({
982
982
  renderContext: S
983
983
  }
984
984
  ) : /* @__PURE__ */ s.jsx(
985
- We,
985
+ Be,
986
986
  {
987
987
  disabled: v,
988
988
  multiple: u,
@@ -1014,36 +1014,36 @@ function ut({
1014
1014
  )
1015
1015
  }
1016
1016
  );
1017
- return E ? ge : Ye(ge, document.body);
1017
+ return E ? ge : tt(ge, document.body);
1018
1018
  }
1019
- const ct = Z(
1020
- ut,
1019
+ const mt = Z(
1020
+ ft,
1021
1021
  (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
1022
- ), We = Z(
1022
+ ), Be = Z(
1023
1023
  ({
1024
1024
  option: e,
1025
1025
  isSelected: n,
1026
- onSelect: h,
1026
+ onSelect: m,
1027
1027
  multiple: i,
1028
1028
  disabled: u,
1029
1029
  isLoading: v
1030
1030
  }) => {
1031
- const m = e.isGroupHeader;
1031
+ const h = e.isGroupHeader;
1032
1032
  if (v)
1033
1033
  return /* @__PURE__ */ s.jsxs(
1034
1034
  "div",
1035
1035
  {
1036
1036
  className: "flex gap-2 w-full px-3 py-2 cursor-wait",
1037
1037
  children: [
1038
- /* @__PURE__ */ s.jsx(Fe, { className: "size-6 aspect-square" }),
1039
- /* @__PURE__ */ s.jsx(Fe, { className: "flex-1 h-6" })
1038
+ /* @__PURE__ */ s.jsx(Ke, { className: "size-6 aspect-square" }),
1039
+ /* @__PURE__ */ s.jsx(Ke, { className: "flex-1 h-6" })
1040
1040
  ]
1041
1041
  },
1042
1042
  e.id
1043
1043
  );
1044
1044
  const j = (b) => {
1045
- b.preventDefault(), b.stopPropagation(), !(u || m) && h?.(e);
1046
- }, p = m && e.groupLabelNode ? e.groupLabelNode : e.label;
1045
+ b.preventDefault(), b.stopPropagation(), !(u || h) && m?.(e);
1046
+ }, p = h && e.groupLabelNode ? e.groupLabelNode : e.label;
1047
1047
  return (
1048
1048
  // biome-ignore lint/a11y/noStaticElementInteractions: no keyboard interaction needed
1049
1049
  /* @__PURE__ */ s.jsxs(
@@ -1052,12 +1052,12 @@ const ct = Z(
1052
1052
  onMouseDown: j,
1053
1053
  className: f(
1054
1054
  "px-3 py-2 flex items-center transition-colors text-neutral-default-default ",
1055
- m ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
1056
- !m && (n ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover"),
1057
- u && !m && "text-neutral-default-disabled hover:bg-neutral-default-default"
1055
+ h ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
1056
+ !h && (n ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover"),
1057
+ u && !h && "text-neutral-default-disabled hover:bg-neutral-default-default"
1058
1058
  ),
1059
1059
  children: [
1060
- i && !m && /* @__PURE__ */ s.jsx(rt, { checked: n, disabled: u }),
1060
+ i && !h && /* @__PURE__ */ s.jsx(st, { checked: n, disabled: u }),
1061
1061
  /* @__PURE__ */ s.jsx("span", { children: p })
1062
1062
  ]
1063
1063
  },
@@ -1067,24 +1067,24 @@ const ct = Z(
1067
1067
  },
1068
1068
  (e, n) => e.isSelected === n.isSelected && e.disabled === n.disabled
1069
1069
  );
1070
- We.displayName = "DefaultOptionRenderer";
1070
+ Be.displayName = "DefaultOptionRenderer";
1071
1071
  const Je = Z(
1072
1072
  ({
1073
1073
  selectedOptions: e,
1074
1074
  placeholder: n,
1075
- onRemoveOption: h,
1075
+ onRemoveOption: m,
1076
1076
  displayMode: i,
1077
1077
  multiple: u,
1078
1078
  className: v,
1079
- disabled: m
1079
+ disabled: h
1080
1080
  }) => e?.length === 0 ? n ? /* @__PURE__ */ s.jsx("span", { className: "text-neutral-medium-default opacity-50", children: n }) : null : i === "chips" && u ? /* @__PURE__ */ s.jsx("div", { className: f("flex items-center gap-1 ", v), children: e.map((j) => /* @__PURE__ */ s.jsx(
1081
- ot,
1081
+ it,
1082
1082
  {
1083
1083
  tabIndex: -1,
1084
1084
  id: j.id,
1085
1085
  label: j.label,
1086
- onRemove: h,
1087
- disabled: m
1086
+ onRemove: m,
1087
+ disabled: h
1088
1088
  },
1089
1089
  j.id
1090
1090
  )) }) : e?.length === 1 ? /* @__PURE__ */ s.jsx("span", { children: e[0].label }) : /* @__PURE__ */ s.jsxs("span", { children: [
@@ -1095,6 +1095,6 @@ const Je = Z(
1095
1095
  );
1096
1096
  Je.displayName = "DefaultSelectionDisplay";
1097
1097
  export {
1098
- St as S,
1098
+ Dt as S,
1099
1099
  G as g
1100
1100
  };