prometeo-design-system 2.4.1 → 2.4.2

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