prometeo-design-system 2.6.6 → 2.6.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.
@@ -5,7 +5,7 @@ import je, { memo as q, useState as fe, useRef as V, useMemo as Z, useCallback a
5
5
  import Re from "./Spinner.es.js";
6
6
  import { createPortal as Be } from "react-dom";
7
7
  import { u as We } from "./useDragScroll-CHN9OMwn.js";
8
- import { u as Ke, I as qe } from "./Input-i6OzjjFo.js";
8
+ import { u as Ke, I as qe } from "./Input-R52CsX56.js";
9
9
  import { H as Ue } from "./HelperComponent-U6mPwuDH.js";
10
10
  import Fe from "./CheckBox.es.js";
11
11
  import { Skeleton as Oe } from "./Skeleton.es.js";
@@ -25,7 +25,7 @@ const Ge = {
25
25
  }, Ee = {
26
26
  icon: " text-neutral-default-disabled",
27
27
  container: " border-neutral-strong-default text-neutral-default-disabled"
28
- }, He = ({ id: e, label: t, onRemove: o, className: i, disabled: u, variant: p = "default", tabIndex: S }) => /* @__PURE__ */ l.jsxs(
28
+ }, He = ({ id: e, label: t, onRemove: a, className: i, disabled: u, variant: p = "default", tabIndex: S }) => /* @__PURE__ */ l.jsxs(
29
29
  "div",
30
30
  {
31
31
  tabIndex: S,
@@ -36,11 +36,11 @@ const Ge = {
36
36
  ),
37
37
  children: [
38
38
  /* @__PURE__ */ l.jsx("span", { className: "truncate w-max ", children: t }),
39
- o && /* @__PURE__ */ l.jsx(
39
+ a && /* @__PURE__ */ l.jsx(
40
40
  "button",
41
41
  {
42
42
  onMouseDown: (s) => {
43
- u || (s.stopPropagation(), s.preventDefault(), o?.(e));
43
+ u || (s.stopPropagation(), s.preventDefault(), a?.(e));
44
44
  },
45
45
  className: c(
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",
@@ -60,9 +60,9 @@ const Ve = q(He);
60
60
  function z(e, t) {
61
61
  if (typeof t == "function")
62
62
  return t(e);
63
- const o = t?.split(".");
63
+ const a = t?.split(".");
64
64
  let i = e;
65
- for (const u of o)
65
+ for (const u of a)
66
66
  if (i && typeof i == "object" && u in i)
67
67
  i = i[u];
68
68
  else
@@ -71,7 +71,7 @@ function z(e, t) {
71
71
  }
72
72
  const Le = (e, t) => {
73
73
  if (!t) return !0;
74
- const o = 0.1, i = String(e).toLowerCase(), u = String(t).toLowerCase().trim();
74
+ const a = 0.1, i = String(e).toLowerCase(), u = String(t).toLowerCase().trim();
75
75
  if (i.includes(u)) return !0;
76
76
  const p = u.split(/\s+/).filter(Boolean), S = p.filter((d) => /^\d+$/.test(d));
77
77
  if (p.length > 1 || S.length > 0) {
@@ -83,15 +83,15 @@ const Le = (e, t) => {
83
83
  return !0;
84
84
  }
85
85
  if (u.length > i.length) return !1;
86
- const s = Math.floor(u.length * o);
86
+ const s = Math.floor(u.length * a);
87
87
  if (s <= 0) return !1;
88
88
  const _ = (d, D) => {
89
- const M = d.length, L = D.length;
90
- if (M === 0) return L;
91
- if (L === 0) return M;
89
+ const $ = d.length, L = D.length;
90
+ if ($ === 0) return L;
91
+ if (L === 0) return $;
92
92
  const h = new Array(L + 1);
93
93
  for (let v = 0; v <= L; v++) h[v] = v;
94
- for (let v = 1; v <= M; v++) {
94
+ for (let v = 1; v <= $; v++) {
95
95
  let C = v - 1;
96
96
  h[0] = v;
97
97
  for (let k = 1; k <= L; k++) {
@@ -171,7 +171,7 @@ const Le = (e, t) => {
171
171
  )
172
172
  };
173
173
  function Je(e) {
174
- const [t, o] = fe(!1), [i, u] = fe([]), [p, S] = fe(""), s = V(null), _ = V(null), d = V(null), D = V(null), M = V(() => {
174
+ const [t, a] = fe(!1), [i, u] = fe([]), [p, S] = fe(""), s = V(null), _ = V(null), d = V(null), D = V(null), $ = V(() => {
175
175
  }), L = V(null), h = V(/* @__PURE__ */ new Set()), {
176
176
  id: v,
177
177
  name: C,
@@ -183,11 +183,11 @@ function Je(e) {
183
183
  placeholder: E,
184
184
  optionValue: N,
185
185
  optionLabel: R,
186
- renderOption: oe,
187
- renderSelection: ae,
186
+ renderOption: ae,
187
+ renderSelection: oe,
188
188
  renderOptionContext: se,
189
189
  buttonClassName: Q,
190
- dropdownClassName: P,
190
+ dropdownClassName: M,
191
191
  containerClassName: ie,
192
192
  dropdownOptions: y,
193
193
  helperComponent: te,
@@ -208,7 +208,7 @@ function Je(e) {
208
208
  } = e, { ref: ye } = Ke(), { bind: K, ref: ve } = We({
209
209
  axis: "x",
210
210
  cursor: { idle: "default", dragging: "grabbing" }
211
- }), G = e.multiple ? Array.isArray(e.value) && e.value.length > 0 : e.value !== void 0 && e.value !== null && e.value !== "", r = {}, a = Z(() => W === "static" && E ? E : "", [W, E]), f = Z(
211
+ }), G = e.multiple ? Array.isArray(e.value) && e.value.length > 0 : e.value !== void 0 && e.value !== null && e.value !== "", r = {}, o = Z(() => W === "static" && E ? E : "", [W, E]), f = Z(
212
212
  () => y?.controledSearchValue || p,
213
213
  [y?.controledSearchValue, p]
214
214
  ), x = () => {
@@ -251,24 +251,24 @@ function Je(e) {
251
251
  ), b = Z(
252
252
  () => new Set(ne.map((n) => n.id)),
253
253
  [ne]
254
- ), $ = J(() => {
255
- o((n) => !n);
254
+ ), P = J(() => {
255
+ a((n) => !n);
256
256
  }, []);
257
- M.current = (n) => {
257
+ $.current = (n) => {
258
258
  if (!e.multiple)
259
259
  e.onChange?.(n, C);
260
260
  else {
261
261
  const m = e.value || [], w = [], le = m.includes(n.value);
262
262
  m.forEach((we) => {
263
- const ke = T.find(($e) => $e.value === we);
263
+ const ke = T.find((Pe) => Pe.value === we);
264
264
  ke && w.push(ke);
265
265
  });
266
- const Pe = le ? w.filter((we) => we.value !== n.value) : [...w, n];
267
- e.onChange?.(Pe, C);
266
+ const Me = le ? w.filter((we) => we.value !== n.value) : [...w, n];
267
+ e.onChange?.(Me, C);
268
268
  }
269
269
  };
270
270
  const re = J((n, m = !1) => {
271
- Y?.(n, C), M.current?.(n), m && (o(!1), he?.());
271
+ Y?.(n, C), $.current?.(n), m && (a(!1), he?.());
272
272
  }, [Y, he, C]), ze = (n) => {
273
273
  n.preventDefault(), n.stopPropagation(), n.target.blur(), B?.(), e.multiple ? e.onChange?.([], C) : e.onChange?.(void 0, C);
274
274
  }, Ce = J((n) => {
@@ -276,7 +276,7 @@ function Je(e) {
276
276
  const m = g.find((le) => z(le, N) === n);
277
277
  if (!m) return;
278
278
  const w = O(m);
279
- Y?.(w, C), M.current?.(w), X?.(m);
279
+ Y?.(w, C), $.current?.(w), X?.(m);
280
280
  }, [Y, X, g, C, e.multiple, e.onChange, O, N]), Ae = J((n) => {
281
281
  Ce(n);
282
282
  }, [Ce]);
@@ -286,13 +286,13 @@ function Je(e) {
286
286
  const w = m.target;
287
287
  if (m.type === "mousedown") {
288
288
  if (s.current?.contains(w) || _.current?.contains(w)) return;
289
- o(!1);
289
+ a(!1);
290
290
  }
291
291
  if (m.type === "scroll") {
292
292
  if (_.current?.contains(w)) return;
293
- o(!1);
293
+ a(!1);
294
294
  }
295
- m.type === "resize" && o(!1);
295
+ m.type === "resize" && a(!1);
296
296
  };
297
297
  return document.addEventListener("mousedown", n), window.addEventListener("scroll", n, !0), window.addEventListener("resize", n, !0), () => {
298
298
  document.removeEventListener("mousedown", n), window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", n, !0);
@@ -306,12 +306,12 @@ function Je(e) {
306
306
  });
307
307
  }, [t]), _e(j, () => ({
308
308
  open: () => {
309
- !t && o(!0);
309
+ !t && a(!0);
310
310
  },
311
311
  close: () => {
312
- t && o(!1);
312
+ t && a(!1);
313
313
  },
314
- toggle: () => o((n) => !n),
314
+ toggle: () => a((n) => !n),
315
315
  handleOptionSelect: re,
316
316
  subscribeOpenChange: (n) => (h.current.add(n), () => {
317
317
  h.current.delete(n);
@@ -319,11 +319,11 @@ function Je(e) {
319
319
  searchInputRef: d
320
320
  }), [t, re]);
321
321
  const Te = (n) => {
322
- n.preventDefault(), n.stopPropagation(), n.target.matches(":focus-visible") && !be && !t && (o(!0), setTimeout(() => {
322
+ n.preventDefault(), n.stopPropagation(), n.target.matches(":focus-visible") && !be && !t && (a(!0), setTimeout(() => {
323
323
  d.current?.focus();
324
324
  }, 10));
325
- }, Me = (n) => {
326
- n.key === "Tab" && t && o(!1), (n.keyCode === 32 || n.key === "ArrowDown") && (o(!0), setTimeout(() => {
325
+ }, $e = (n) => {
326
+ n.key === "Tab" && t && a(!1), (n.keyCode === 32 || n.key === "ArrowDown") && (a(!0), setTimeout(() => {
327
327
  d.current?.focus();
328
328
  }, 10));
329
329
  };
@@ -363,9 +363,9 @@ function Je(e) {
363
363
  role: "button",
364
364
  ref: D,
365
365
  onFocus: Te,
366
- onKeyDown: Me,
366
+ onKeyDown: $e,
367
367
  onClick: (n) => {
368
- n.preventDefault(), n.stopPropagation(), $();
368
+ n.preventDefault(), n.stopPropagation(), P();
369
369
  },
370
370
  className: c(
371
371
  "w-full px-2 text-left border rounded-lg transition-all duration-200 ease-in-out",
@@ -389,9 +389,9 @@ function Je(e) {
389
389
  onPointerLeave: K.onPointerLeave,
390
390
  onPointerCancel: K.onPointerCancel,
391
391
  onClickCapture: K.onClickCapture,
392
- children: ae ? je.createElement(
392
+ children: oe ? je.createElement(
393
393
  q(
394
- ae,
394
+ oe,
395
395
  (n, m) => n.disabled === m.disabled && n.multiple === m.multiple
396
396
  ),
397
397
  {
@@ -406,7 +406,7 @@ function Je(e) {
406
406
  {
407
407
  displayMode: ce,
408
408
  selectedOptions: ne,
409
- placeholder: a,
409
+ placeholder: o,
410
410
  onRemoveOption: Ce,
411
411
  multiple: e.multiple || !1,
412
412
  className: c(pe === "scroll" ? "flex-nowrap" : "flex-wrap"),
@@ -453,21 +453,21 @@ function Je(e) {
453
453
  optionLabel: R,
454
454
  optionValue: N,
455
455
  labelVariant: W,
456
- renderOption: oe,
456
+ renderOption: ae,
457
457
  renderOptionContext: se,
458
458
  emptyMessage: de,
459
459
  attachToParent: xe,
460
460
  filteredOptions: i,
461
- dropdownClassName: P,
461
+ dropdownClassName: M,
462
462
  setFilteredOptions: u,
463
463
  selectedOptionsIds: b,
464
- options: oe ? g : T,
464
+ options: ae ? g : T,
465
465
  selectRef: s,
466
466
  dropdownRef: _,
467
467
  selectButtonRef: D,
468
468
  helperComponentRef: L,
469
469
  onOptionClick: re,
470
- onCloseDropdown: () => o(!1),
470
+ onCloseDropdown: () => a(!1),
471
471
  searchValue: f,
472
472
  setSearchValue: S,
473
473
  searchInputRef: d,
@@ -499,7 +499,7 @@ const Qe = q(Je, (e, t) => e.value === t.value && e.options === t.options && e.i
499
499
  function Xe({
500
500
  footer: e,
501
501
  isOpen: t,
502
- options: o,
502
+ options: a,
503
503
  multiple: i,
504
504
  disabled: u,
505
505
  selectRef: p,
@@ -508,7 +508,7 @@ function Xe({
508
508
  optionLabel: _,
509
509
  optionValue: d,
510
510
  searchValue: D,
511
- labelVariant: M,
511
+ labelVariant: $,
512
512
  emptyMessage: L,
513
513
  renderOption: h,
514
514
  renderOptionContext: v,
@@ -521,35 +521,35 @@ function Xe({
521
521
  filteredOptions: E,
522
522
  selectButtonRef: N,
523
523
  onCloseDropdown: R,
524
- loadingComponent: oe,
525
- dropdownClassName: ae,
524
+ loadingComponent: ae,
525
+ dropdownClassName: oe,
526
526
  helperComponentRef: se,
527
527
  selectedOptionsIds: Q,
528
- setFilteredOptions: P,
528
+ setFilteredOptions: M,
529
529
  onSearchValueChange: ie,
530
530
  isLoading: y = !1,
531
531
  hideSearchBar: te = !1,
532
532
  inputSearchPlaceholder: ue = "Buscar opciones"
533
533
  }) {
534
- const X = e ? 380 : 320, Y = M === "static" ? -20 : 7, B = J(() => j ? j.endsWith("px") ? Number(j.replace("px", "")) : j.endsWith("vh") ? window.innerHeight * Number(j.replace("vh", "")) / 100 : j.endsWith("%") ? window.innerHeight * Number(j.replace("%", "")) / 100 : X : X, [j, X])(), [H, pe] = fe({ direction: "down", height: B }), F = (r) => {
534
+ const X = e ? 380 : 320, Y = $ === "static" ? -20 : 7, B = J(() => j ? j.endsWith("px") ? Number(j.replace("px", "")) : j.endsWith("vh") ? window.innerHeight * Number(j.replace("vh", "")) / 100 : j.endsWith("%") ? window.innerHeight * Number(j.replace("%", "")) / 100 : X : X, [j, X])(), [H, pe] = fe({ direction: "down", height: B }), F = (r) => {
535
535
  if (!s.current || !p.current) return;
536
- const a = p.current.getBoundingClientRect();
536
+ const o = p.current.getBoundingClientRect();
537
537
  switch (r || H.direction) {
538
538
  case "down":
539
- s.current.style.top = `${a.top + a.height - (se?.current?.offsetHeight ? se?.current?.offsetHeight + 4 : 0)}px`;
539
+ s.current.style.top = `${o.top + o.height - (se?.current?.offsetHeight ? se?.current?.offsetHeight + 4 : 0)}px`;
540
540
  break;
541
541
  case "up":
542
- s.current.style.top = "auto", s.current.style.bottom = `${window.innerHeight - a.top + Y}px`;
542
+ s.current.style.top = "auto", s.current.style.bottom = `${window.innerHeight - o.top + Y}px`;
543
543
  break;
544
544
  }
545
- s.current.style.left = `${a.left}px`, s.current.style.width = `${a.width}px`;
545
+ s.current.style.left = `${o.left}px`, s.current.style.width = `${o.width}px`;
546
546
  }, ge = (r) => {
547
547
  s.current && (s.current.style.maxHeight = `${r}px`);
548
548
  }, xe = () => {
549
549
  if (!s.current || !p.current) return H;
550
- const r = p.current.getBoundingClientRect(), a = window.innerHeight - (window.innerHeight - r.top), f = window.innerHeight - r.bottom, x = f >= B, O = a >= B;
550
+ const r = p.current.getBoundingClientRect(), o = window.innerHeight - (window.innerHeight - r.top), f = window.innerHeight - r.bottom, x = f >= B, O = o >= B;
551
551
  let T = "down", I;
552
- return x ? (T = "down", I = B) : O ? (T = "up", I = B) : f > a ? (T = "down", I = f - 16) : (T = "up", I = a - 16), { direction: T, height: I };
552
+ return x ? (T = "down", I = B) : O ? (T = "up", I = B) : f > o ? (T = "down", I = f - 16) : (T = "up", I = o - 16), { direction: T, height: I };
553
553
  }, ce = (r) => {
554
554
  if (!(!s.current || !p.current)) {
555
555
  if (s.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !r) {
@@ -557,8 +557,8 @@ function Xe({
557
557
  return;
558
558
  }
559
559
  if (!A) {
560
- const a = xe();
561
- pe(a), F(a.direction), ge(a.height);
560
+ const o = xe();
561
+ pe(o), F(o.direction), ge(o.height);
562
562
  }
563
563
  s.current.style.opacity = "1", s.current.style.pointerEvents = "auto";
564
564
  }
@@ -568,15 +568,15 @@ function Xe({
568
568
  }, [Q]), ee(() => {
569
569
  ce(t);
570
570
  }, [t]), ee(() => {
571
- o && P(o);
572
- }, [o]), ee(() => {
571
+ a && M(a);
572
+ }, [a]), ee(() => {
573
573
  if (y || !D) return;
574
- const r = W(o, D);
575
- P(r);
576
- }, [o]);
577
- const W = (r, a) => r.filter((f) => Le(h ? z(f, _) : f.label, a)), be = (r) => {
578
- const a = W(o, r);
579
- if (P(a), ie) {
574
+ const r = W(a, D);
575
+ M(r);
576
+ }, [a]);
577
+ const W = (r, o) => r.filter((f) => Le(h ? z(f, _) : f.label, o)), be = (r) => {
578
+ const o = W(a, r);
579
+ if (M(o), ie) {
580
580
  if (r === "") {
581
581
  de();
582
582
  return;
@@ -584,23 +584,23 @@ function Xe({
584
584
  ie(r);
585
585
  return;
586
586
  }
587
- g && o && g(r);
587
+ g && a && g(r);
588
588
  }, de = J(() => {
589
589
  if (k) {
590
- k(), P(
591
- o.filter((r) => {
592
- const a = h ? z(r, d) : r.id;
593
- return Q.has(a);
590
+ k(), M(
591
+ a.filter((r) => {
592
+ const o = h ? z(r, d) : r.id;
593
+ return Q.has(o);
594
594
  })
595
595
  );
596
596
  return;
597
597
  }
598
- g && (g(""), P(o));
599
- }, [o, Q, d, k, P, g, h]), ye = (r) => {
598
+ g && (g(""), M(a));
599
+ }, [a, Q, d, k, M, g, h]), ye = (r) => {
600
600
  r.key === "ArrowDown" ? (r.preventDefault(), s.current?.querySelector("[role=listitem]")?.focus()) : (r.key === "Tab" || r.key === "Escape") && setTimeout(() => {
601
601
  N.current?.focus(), R();
602
602
  }, 10);
603
- }, K = (r, a) => {
603
+ }, K = (r, o) => {
604
604
  const f = Array.from(s.current?.querySelectorAll("[role=listitem]") || []), x = f.indexOf(r.currentTarget);
605
605
  if (r.key === "ArrowDown") {
606
606
  r.preventDefault();
@@ -615,7 +615,7 @@ function Xe({
615
615
  }
616
616
  else if (r.key === "Enter" || r.key === " ") {
617
617
  if (r.preventDefault(), u) return;
618
- C(a, !i), i || setTimeout(() => {
618
+ C(o, !i), i || setTimeout(() => {
619
619
  N.current?.focus(), R();
620
620
  }, 10);
621
621
  } else r.key === "Escape" ? (r.preventDefault(), setTimeout(() => {
@@ -623,14 +623,14 @@ function Xe({
623
623
  }, 10)) : r.key === "Tab" && setTimeout(() => {
624
624
  N.current?.focus(), R();
625
625
  }, 10);
626
- }, ve = Array.from({ length: 5 }).map((r, a) => h ? je.createElement(
626
+ }, ve = Array.from({ length: 5 }).map((r, o) => h ? je.createElement(
627
627
  q(
628
628
  h,
629
629
  (f, x) => f.isSelected === x.isSelected && f.option === x.option && f.disabled === x.disabled && f.multiple === x.multiple && f.renderContext === x.renderContext
630
630
  ),
631
631
  {
632
- key: `skeleton-option-${a}`,
633
- option: { id: a, label: "", value: "" },
632
+ key: `skeleton-option-${o}`,
633
+ option: { id: o, label: "", value: "" },
634
634
  isSelected: !1,
635
635
  multiple: !1,
636
636
  onSelect: () => {
@@ -647,10 +647,10 @@ function Xe({
647
647
  onSelect: () => {
648
648
  },
649
649
  isSelected: !1,
650
- option: { id: a, label: "", value: "" }
650
+ option: { id: o, label: "", value: "" }
651
651
  },
652
652
  `skeleton-option-${// biome-ignore lint/suspicious/noArrayIndexKey: <>
653
- a}`
653
+ o}`
654
654
  )), G = /* @__PURE__ */ l.jsx(
655
655
  "div",
656
656
  {
@@ -662,7 +662,7 @@ function Xe({
662
662
  " overflow-hidden focus-visible:bg-neutral-default-hover ",
663
663
  A ? "absolute z-50 " : "fixed z-100 top-0 left-0",
664
664
  H.direction === "up" ? "h-auto" : " h-max",
665
- ae
665
+ oe
666
666
  ),
667
667
  children: /* @__PURE__ */ l.jsxs(
668
668
  "div",
@@ -697,9 +697,9 @@ function Xe({
697
697
  ...S
698
698
  }
699
699
  ),
700
- /* @__PURE__ */ l.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: E.length === 0 ? y ? /* @__PURE__ */ l.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: oe || ve }) : /* @__PURE__ */ l.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: D ? `No se encontraron resultados para "${D}"` : L }) : E.map((r) => {
701
- const a = h ? z(r, d) : r.id, f = Q.has(a), x = (b) => h ? {
702
- id: a,
700
+ /* @__PURE__ */ l.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: E.length === 0 ? y ? /* @__PURE__ */ l.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: ae || ve }) : /* @__PURE__ */ l.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: D ? `No se encontraron resultados para "${D}"` : L }) : E.map((r) => {
701
+ const o = h ? z(r, d) : r.id, f = Q.has(o), x = (b) => h ? {
702
+ id: o,
703
703
  label: String(z(b, _)),
704
704
  value: z(b, d)
705
705
  } : b, O = (b) => {
@@ -707,18 +707,18 @@ function Xe({
707
707
  }, T = (b) => {
708
708
  if (C(b, !i), !i) {
709
709
  if (!g) return;
710
- g(""), P(o);
710
+ g(""), M(a);
711
711
  }
712
- }, I = (b, $) => (
712
+ }, I = (b, P) => (
713
713
  // biome-ignore lint/a11y/useSemanticElements: <>
714
714
  /* @__PURE__ */ l.jsx(
715
715
  "div",
716
716
  {
717
717
  tabIndex: 0,
718
718
  role: "listitem",
719
- onKeyDown: (re) => K(re, $),
719
+ onKeyDown: (re) => K(re, P),
720
720
  className: c(
721
- "focus-visible:bg-neutral-medium-hover outline-none hover:bg-neutral-medium-hover ",
721
+ `${!h && "focus-visible:bg-neutral-medium-hover outline-none hover:bg-neutral-medium-hover"}`,
722
722
  f && "bg-neutral-medium-selected"
723
723
  ),
724
724
  children: b
@@ -727,10 +727,10 @@ function Xe({
727
727
  ), ne = h ? je.createElement(
728
728
  q(
729
729
  h,
730
- (b, $) => b.isSelected === $.isSelected && b.option === $.option && b.disabled === $.disabled && b.multiple === $.multiple && b.renderContext === $.renderContext
730
+ (b, P) => b.isSelected === P.isSelected && b.option === P.option && b.disabled === P.disabled && b.multiple === P.multiple && b.renderContext === P.renderContext
731
731
  ),
732
732
  {
733
- key: a,
733
+ key: o,
734
734
  option: r,
735
735
  isSelected: f,
736
736
  multiple: i,
@@ -749,7 +749,7 @@ function Xe({
749
749
  onSelect: T,
750
750
  option: r
751
751
  },
752
- a
752
+ o
753
753
  );
754
754
  return I(ne, x(r));
755
755
  }) }),
@@ -761,7 +761,7 @@ function Xe({
761
761
  );
762
762
  return A ? G : Be(G, document.body);
763
763
  }
764
- const Ye = q(Xe, (e, t) => e.options === t.options && e.selectedOptionsIds === t.selectedOptionsIds && e.multiple === t.multiple && e.disabled === t.disabled && e.emptyMessage === t.emptyMessage && e.renderOption === t.renderOption && e.renderOptionContext === t.renderOptionContext && e.isOpen === t.isOpen && e.attachToParent === t.attachToParent && e.optionValue === t.optionValue && e.optionLabel === t.optionLabel && e.filteredOptions === t.filteredOptions && e.isLoading === t.isLoading), Ne = q(({ option: e, isSelected: t, onSelect: o, multiple: i, disabled: u, isLoading: p }) => p ? /* @__PURE__ */ l.jsxs("div", { className: "flex gap-2 w-full px-3 py-2 cursor-wait", children: [
764
+ const Ye = q(Xe, (e, t) => e.options === t.options && e.selectedOptionsIds === t.selectedOptionsIds && e.multiple === t.multiple && e.disabled === t.disabled && e.emptyMessage === t.emptyMessage && e.renderOption === t.renderOption && e.renderOptionContext === t.renderOptionContext && e.isOpen === t.isOpen && e.attachToParent === t.attachToParent && e.optionValue === t.optionValue && e.optionLabel === t.optionLabel && e.filteredOptions === t.filteredOptions && e.isLoading === t.isLoading), Ne = q(({ option: e, isSelected: t, onSelect: a, multiple: i, disabled: u, isLoading: p }) => p ? /* @__PURE__ */ l.jsxs("div", { className: "flex gap-2 w-full px-3 py-2 cursor-wait", children: [
765
765
  /* @__PURE__ */ l.jsx(Oe, { className: "size-6 aspect-square" }),
766
766
  /* @__PURE__ */ l.jsx(Oe, { className: "flex-1 h-6" })
767
767
  ] }) : (
@@ -770,7 +770,7 @@ const Ye = q(Xe, (e, t) => e.options === t.options && e.selectedOptionsIds === t
770
770
  "div",
771
771
  {
772
772
  onMouseDown: (S) => {
773
- S.preventDefault(), S.stopPropagation(), !u && o?.(e);
773
+ S.preventDefault(), S.stopPropagation(), !u && a?.(e);
774
774
  },
775
775
  className: c(
776
776
  "px-3 py-2 cursor-pointer flex items-center transition-colors text-neutral-default-default ",
@@ -791,13 +791,13 @@ const Ye = q(Xe, (e, t) => e.options === t.options && e.selectedOptionsIds === t
791
791
  )
792
792
  ), (e, t) => e.isSelected === t.isSelected);
793
793
  Ne.displayName = "DefaultOptionRenderer";
794
- const Ie = q(({ selectedOptions: e, placeholder: t, onRemoveOption: o, displayMode: i, multiple: u, className: p, disabled: S }) => e?.length === 0 ? t ? /* @__PURE__ */ l.jsx("span", { className: "text-neutral-medium-default opacity-50", children: t }) : null : i === "chips" && u ? /* @__PURE__ */ l.jsx("div", { className: c("flex items-center gap-1 ", p), children: e.map((s) => /* @__PURE__ */ l.jsx(
794
+ const Ie = q(({ selectedOptions: e, placeholder: t, onRemoveOption: a, displayMode: i, multiple: u, className: p, disabled: S }) => e?.length === 0 ? t ? /* @__PURE__ */ l.jsx("span", { className: "text-neutral-medium-default opacity-50", children: t }) : null : i === "chips" && u ? /* @__PURE__ */ l.jsx("div", { className: c("flex items-center gap-1 ", p), children: e.map((s) => /* @__PURE__ */ l.jsx(
795
795
  Ve,
796
796
  {
797
797
  tabIndex: -1,
798
798
  id: s.id,
799
799
  label: s.label,
800
- onRemove: o,
800
+ onRemove: a,
801
801
  disabled: S
802
802
  },
803
803
  s.id
package/dist/Select.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as f } from "./Select-D3aU7dXF.js";
1
+ import { S as f } from "./Select-CMjYSSZB.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { j as d } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { useField as y } from "formik";
3
- import { S as m } from "./Select-D3aU7dXF.js";
3
+ import { S as m } from "./Select-CMjYSSZB.js";
4
4
  import { useRef as p, useEffect as g } from "react";
5
5
  function f(e) {
6
6
  return Array.isArray(e) && e.every(
@@ -1,5 +1,5 @@
1
1
  import { j as G } from "./jsx-runtime-DKDX3adD.js";
2
- import { g as i, S as H } from "./Select-D3aU7dXF.js";
2
+ import { g as i, S as H } from "./Select-CMjYSSZB.js";
3
3
  import { useState as w, useRef as T, useEffect as h, useMemo as Q, useCallback as X } from "react";
4
4
  function te(e) {
5
5
  const {
@@ -0,0 +1,23 @@
1
+ import { ButtonVariant, ColorVariant, SizeVariant } from '../Shared/types';
2
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
+ label?: string;
4
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
5
+ icon?: React.ReactNode;
6
+ contentClassName?: string;
7
+ loadingText?: string;
8
+ animate?: boolean;
9
+ animateIcon?: boolean;
10
+ isLoading?: boolean;
11
+ children?: React.ReactNode;
12
+ spinner?: React.ReactNode;
13
+ type?: 'button' | "submit" | "reset";
14
+ className?: string;
15
+ disabled?: boolean;
16
+ variant?: ButtonVariant;
17
+ form?: string;
18
+ size?: SizeVariant;
19
+ color?: ColorVariant;
20
+ hideSpinner?: boolean;
21
+ }
22
+ declare const _default: import('react').MemoExoticComponent<({ label, onClick, icon, contentClassName, loadingText, animate, animateIcon, isLoading, children, hideSpinner, spinner, type, className, disabled, variant, form, size, color }: ButtonProps) => import("react/jsx-runtime").JSX.Element>;
23
+ export default _default;
@@ -5,8 +5,8 @@ export interface DrawerDesktopHandle<TContext = unknown> {
5
5
  getContext: () => TContext | null;
6
6
  }
7
7
  export interface DrawerDesktopProps<TContext = unknown> {
8
- children?: React.ReactNode;
9
- direction?: 'left' | 'right';
8
+ children?: React.ReactNode | ((context: TContext | null) => React.ReactNode);
9
+ direction?: "left" | "right";
10
10
  modal?: boolean;
11
11
  className?: string;
12
12
  onClose?: (context?: TContext) => void;
@@ -5,6 +5,7 @@ export interface IHeader {
5
5
  className?: string;
6
6
  subtitle?: string;
7
7
  subtitleClassName?: string;
8
+ titleClassName?: string;
8
9
  }
9
- declare const _default: import('react').MemoExoticComponent<({ title, subtitle, children, className, subtitleClassName }: IHeader) => import("react/jsx-runtime").JSX.Element>;
10
+ declare const _default: import('react').MemoExoticComponent<({ title, subtitle, children, className, subtitleClassName, titleClassName }: IHeader) => import("react/jsx-runtime").JSX.Element>;
10
11
  export default _default;
@@ -0,0 +1,2 @@
1
+ export { default } from '../components/Button/ButtonV2';
2
+ export type { ButtonProps } from '../components/Button/ButtonV2';
package/dist/index.d.ts CHANGED
@@ -41,6 +41,7 @@ export { default as FAButton } from './components/FAB/FAButton';
41
41
  export { default as InputFormikV2 } from './components/InputFormik/InputFormikV2';
42
42
  export { default as RadioButtonFormik } from './components/RadioButtonFormik/RadioButtonFormik';
43
43
  export { default as RadioButton } from './components/RadioButton/RadioButton';
44
+ export { default as ButtonV2 } from './components/Button/ButtonV2';
44
45
  export * from './components/Sidebar';
45
46
  export { SecondaryBar } from './components/Sidebar/SecondaryBar/SecondaryBar';
46
47
  export { Badge } from './components/Sidebar/components/badge';
@@ -108,4 +109,5 @@ export type { FAButtonProps } from './components/FAB/FAButton';
108
109
  export type { IInputFormikV2 } from './components/InputFormik/InputFormikV2';
109
110
  export type { RadioButtonProps } from './components/RadioButton/RadioButton';
110
111
  export type { RadioButtonFormikProps } from './components/RadioButtonFormik/RadioButtonFormik';
112
+ export type { ButtonProps as ButtonV2Props } from './components/Button/ButtonV2';
111
113
  export { Icons } from './Icons/Icons';
@@ -0,0 +1,2 @@
1
+ declare const ButtonPreview: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ButtonPreview;