prometeo-design-system 2.5.7 → 2.6.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.
Files changed (55) 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-DV3gwvqE.js → CardProfile-DA-HDUpi.js} +1 -1
  5. package/dist/CardProfile.es.js +1 -1
  6. package/dist/CheckBox.es.js +1 -1
  7. package/dist/CheckboxFormik.es.js +1 -1
  8. package/dist/DatePicker.es.js +3 -3
  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-DHdy-pWf.js +295 -0
  19. package/dist/Input.es.js +1 -1
  20. package/dist/InputFormik.es.js +1 -1
  21. package/dist/InputMultiple.es.js +1 -1
  22. package/dist/{LayoutGeneric-CbaoatQB.js → LayoutGeneric-B6E-yOYJ.js} +1 -1
  23. package/dist/LayoutGeneric.es.js +1 -1
  24. package/dist/Logo.es.js +1 -1
  25. package/dist/Menu.es.js +1 -1
  26. package/dist/OtpInput.es.js +1 -1
  27. package/dist/Pagination.es.js +1 -1
  28. package/dist/ProfilePictureUpload.es.js +1 -1
  29. package/dist/ProgressBar.es.js +1 -1
  30. package/dist/SegmentedButton.es.js +1 -1
  31. package/dist/{Select-CrTtTmXZ.js → Select-B5hkJ8Oy.js} +222 -238
  32. package/dist/Select.es.js +1 -1
  33. package/dist/SelectFormik.es.js +2 -2
  34. package/dist/SelectFormikLegacy.es.js +1 -1
  35. package/dist/SelectSearch.es.js +2 -2
  36. package/dist/Skeleton.es.js +1 -1
  37. package/dist/Spinner.es.js +1 -1
  38. package/dist/Steps.es.js +1 -1
  39. package/dist/SwipeContainer.es.js +1 -1
  40. package/dist/Switch.es.js +1 -1
  41. package/dist/TabLinks.es.js +1 -1
  42. package/dist/Table.es.js +1 -1
  43. package/dist/TextArea.es.js +1 -1
  44. package/dist/Toast.es.js +2 -2
  45. package/dist/ToastProvider.es.js +1 -1
  46. package/dist/Tooltip.es.js +1 -1
  47. package/dist/components/Input/Input.d.ts +2 -2
  48. package/dist/components/InputFormik/InputFormikV2.d.ts +6 -0
  49. package/dist/exports/InputFormikV2.d.ts +2 -0
  50. package/dist/index.d.ts +2 -0
  51. package/dist/{jsx-runtime-DKDX3adD.js → jsx-runtime-ByW6EXIE.js} +96 -94
  52. package/dist/prometeo-design-system.css +1 -1
  53. package/dist/prometeo-design-system.es.js +280 -257
  54. package/package.json +17 -1
  55. package/dist/Input-PNwH7rb6.js +0 -270
@@ -1,30 +1,14 @@
1
- import { j as l } from "./jsx-runtime-DKDX3adD.js";
2
- import { Icons as Q } from "./Icons.es.js";
1
+ import { j as l } from "./jsx-runtime-ByW6EXIE.js";
2
+ import { Icons as ce } from "./Icons.es.js";
3
3
  import { c as u } from "./cn-B6yFEsav.js";
4
- import we, { memo as R, useState as ce, useRef as V, useMemo as Z, useCallback as J, useEffect as ee, useImperativeHandle as _e } from "react";
5
- import Re from "./Spinner.es.js";
6
- import { createPortal as We } from "react-dom";
7
- import { u as Be } from "./useDragScroll-CHN9OMwn.js";
8
- import { u as Ke, I as Ue } from "./Input-PNwH7rb6.js";
4
+ import we, { memo as F, useState as ue, useRef as V, useMemo as Y, useCallback as J, useEffect as Z, useImperativeHandle as $e } from "react";
5
+ import _e from "./Spinner.es.js";
6
+ import { createPortal as Re } from "react-dom";
7
+ import { u as We } from "./useDragScroll-CHN9OMwn.js";
8
+ import { u as Be, H as Ke, I as Ue } from "./Input-DHdy-pWf.js";
9
9
  import Fe from "./CheckBox.es.js";
10
- import { Skeleton as Ne } from "./Skeleton.es.js";
11
- const ke = (e) => {
12
- const { variant: t, className: i } = e, c = {
13
- default: "text-neutral-medium-default pt-[1px]",
14
- error: "text-error-medium-default pt-[1px]",
15
- success: "text-success-medium-default"
16
- }, s = {
17
- default: /* @__PURE__ */ l.jsx(Q.Info, { size: 16, className: "text-neutral-medium-default " }),
18
- error: /* @__PURE__ */ l.jsx(Q.Error, { size: 16, className: "text-error-medium-default" }),
19
- success: /* @__PURE__ */ l.jsx(Q.Check, { size: 16, className: "text-success-medium-default" })
20
- };
21
- return /* @__PURE__ */ l.jsx("div", { ref: e.ref, className: u("pl-3", i), children: typeof e.children == "string" ? /* @__PURE__ */ l.jsxs("div", { className: "flex gap-0.5 items-start", children: [
22
- s[t],
23
- /* @__PURE__ */ l.jsx("p", { className: u(" prometeo-fonts-body-small", c[t]), children: e.children })
24
- ] }) : e.children });
25
- };
26
- ke.displayName = "HelperText";
27
- const qe = R(ke), Ge = {
10
+ import { Skeleton as Se } from "./Skeleton.es.js";
11
+ const qe = {
28
12
  default: {
29
13
  container: "text-neutral-default-default border-neutral-default-default ",
30
14
  icon: ""
@@ -37,17 +21,17 @@ const qe = R(ke), Ge = {
37
21
  container: "",
38
22
  icon: ""
39
23
  }
40
- }, Se = {
24
+ }, Ne = {
41
25
  icon: " text-neutral-default-disabled",
42
26
  container: " border-neutral-strong-default text-neutral-default-disabled"
43
- }, Oe = ({ id: e, label: t, onRemove: i, className: c, disabled: s, variant: o = "default", tabIndex: v }) => /* @__PURE__ */ l.jsxs(
27
+ }, ke = ({ id: e, label: t, onRemove: i, className: c, disabled: s, variant: o = "default", tabIndex: v }) => /* @__PURE__ */ l.jsxs(
44
28
  "div",
45
29
  {
46
30
  tabIndex: v,
47
31
  className: u(
48
32
  "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]",
49
- Ge[o].container,
50
- s && Se.container
33
+ qe[o].container,
34
+ s && Ne.container
51
35
  ),
52
36
  children: [
53
37
  /* @__PURE__ */ l.jsx("span", { className: "truncate w-max ", children: t }),
@@ -64,14 +48,14 @@ const qe = R(ke), Ge = {
64
48
  ),
65
49
  type: "button",
66
50
  tabIndex: v,
67
- children: /* @__PURE__ */ l.jsx(Q.Close, { size: 18, className: u(s && Se.icon) })
51
+ children: /* @__PURE__ */ l.jsx(ce.Close, { size: 18, className: u(s && Ne.icon) })
68
52
  }
69
53
  )
70
54
  ]
71
55
  }
72
56
  );
73
- Oe.displayName = "Chip";
74
- const Ve = R(Oe);
57
+ ke.displayName = "Chip";
58
+ const Ge = F(ke);
75
59
  function E(e, t) {
76
60
  if (typeof t == "function")
77
61
  return t(e);
@@ -100,25 +84,25 @@ const je = (e, t) => {
100
84
  if (s.length > c.length) return !1;
101
85
  const p = Math.floor(s.length * i);
102
86
  if (p <= 0) return !1;
103
- const k = (m, H) => {
104
- const x = m.length, N = H.length;
105
- if (x === 0) return N;
106
- if (N === 0) return x;
107
- const w = new Array(N + 1);
108
- for (let b = 0; b <= N; b++) w[b] = b;
109
- for (let b = 1; b <= x; b++) {
110
- let h = b - 1;
111
- w[0] = b;
112
- for (let g = 1; g <= N; g++) {
113
- const W = w[g], S = m.charCodeAt(b - 1) === H.charCodeAt(g - 1) ? 0 : 1, L = w[g] + 1, I = w[g - 1] + 1, O = h + S;
114
- w[g] = L < I ? L < O ? L : O : I < O ? I : O, h = W;
87
+ const k = (m, L) => {
88
+ const b = m.length, S = L.length;
89
+ if (b === 0) return S;
90
+ if (S === 0) return b;
91
+ const w = new Array(S + 1);
92
+ for (let x = 0; x <= S; x++) w[x] = x;
93
+ for (let x = 1; x <= b; x++) {
94
+ let h = x - 1;
95
+ w[0] = x;
96
+ for (let g = 1; g <= S; g++) {
97
+ const R = w[g], N = m.charCodeAt(x - 1) === L.charCodeAt(g - 1) ? 0 : 1, H = w[g] + 1, I = w[g - 1] + 1, O = h + N;
98
+ w[g] = H < I ? H < O ? H : O : I < O ? I : O, h = R;
115
99
  }
116
100
  }
117
- return w[N];
101
+ return w[S];
118
102
  };
119
103
  for (let m = 0; m <= c.length - s.length; m++) {
120
- const H = c.slice(m, m + s.length);
121
- if (k(H, s) <= p) return !0;
104
+ const L = c.slice(m, m + s.length);
105
+ if (k(L, s) <= p) return !0;
122
106
  }
123
107
  return !1;
124
108
  }, ye = {
@@ -185,46 +169,46 @@ const je = (e, t) => {
185
169
  "peer-focus:text-primary-default-default"
186
170
  )
187
171
  };
188
- function Je(e) {
189
- const [t, i] = ce(!1), [c, s] = ce([]), [o, v] = ce(""), p = V(null), k = V(null), m = V(null), H = V(null), x = V(() => {
190
- }), N = V(null), w = V(/* @__PURE__ */ new Set()), {
191
- id: b,
172
+ function Ve(e) {
173
+ const [t, i] = ue(!1), [c, s] = ue([]), [o, v] = ue(""), p = V(null), k = V(null), m = V(null), L = V(null), b = V(() => {
174
+ }), S = V(null), w = V(/* @__PURE__ */ new Set()), {
175
+ id: x,
192
176
  name: h,
193
177
  label: g,
194
- height: W,
195
- options: S,
196
- controls: L,
178
+ height: R,
179
+ options: N,
180
+ controls: H,
197
181
  className: I,
198
182
  placeholder: O,
199
183
  optionValue: j,
200
- optionLabel: B,
184
+ optionLabel: W,
201
185
  renderOption: T,
202
- renderSelection: te,
186
+ renderSelection: ee,
203
187
  buttonClassName: q,
204
- dropdownClassName: ae,
188
+ dropdownClassName: le,
205
189
  containerClassName: de,
206
- dropdownOptions: A,
207
- helperComponent: se,
190
+ dropdownOptions: z,
191
+ helperComponent: ae,
208
192
  errorComponent: fe,
209
- onRemoveOption: K,
193
+ onRemoveOption: B,
210
194
  onOptionClick: P,
211
195
  onClose: oe,
212
- onClear: ne,
213
- disabled: U = !1,
196
+ onClear: te,
197
+ disabled: K = !1,
214
198
  overflow: me = "wrap",
215
- variant: X = "default",
216
- isLoading: ie = !1,
199
+ variant: Q = "default",
200
+ isLoading: se = !1,
217
201
  attachToParent: he = !1,
218
- displayMode: Y = "compact",
219
- labelVariant: F = "default",
202
+ displayMode: X = "compact",
203
+ labelVariant: U = "default",
220
204
  disableOpenOnFocus: pe = !1,
221
205
  emptyMessage: ge = "No hay opciones disponibles"
222
- } = e, { ref: ue } = Ke(), { bind: r, ref: a } = Be({
206
+ } = e, { ref: ie } = Be(), { bind: r, ref: a } = We({
223
207
  axis: "x",
224
208
  cursor: { idle: "default", dragging: "grabbing" }
225
- }), d = e.multiple ? Array.isArray(e.value) && e.value.length > 0 : e.value !== void 0 && e.value !== null && e.value !== "", y = {}, $ = Z(() => F === "static" && O ? O : "", [F, O]), M = Z(
226
- () => A?.controledSearchValue || o,
227
- [A?.controledSearchValue, o]
209
+ }), d = e.multiple ? Array.isArray(e.value) && e.value.length > 0 : e.value !== void 0 && e.value !== null && e.value !== "", y = {}, M = Y(() => U === "static" && O ? O : "", [U, O]), $ = Y(
210
+ () => z?.controledSearchValue || o,
211
+ [z?.controledSearchValue, o]
228
212
  ), _ = () => {
229
213
  const n = {
230
214
  static: {
@@ -236,65 +220,65 @@ function Je(e) {
236
220
  default: "absolute top-1/2 -translate-y-1/2 "
237
221
  }
238
222
  }, f = t || d ? "active" : "default";
239
- return n[F][f];
223
+ return n[U][f];
240
224
  }, G = J((n) => ({
241
225
  id: E(n, j),
242
226
  value: E(n, j),
243
- label: E(n, B)
244
- }), [j, B]), C = Z(
245
- () => S.map(G),
246
- [S]
247
- ), z = Z(
227
+ label: E(n, W)
228
+ }), [j, W]), C = Y(
229
+ () => N.map(G),
230
+ [N]
231
+ ), A = Y(
248
232
  () => {
249
233
  const n = [];
250
234
  if (e.multiple)
251
235
  e.value?.forEach((f) => {
252
- const D = S?.find((le) => E(le, j) === f);
236
+ const D = N?.find((re) => E(re, j) === f);
253
237
  D && n.push(D);
254
238
  });
255
239
  else {
256
- const f = S?.find((D) => E(D, j) === e.value);
240
+ const f = N?.find((D) => E(D, j) === e.value);
257
241
  f && n.push(f);
258
242
  }
259
243
  return n;
260
244
  },
261
- [e.value, j, S, e.multiple]
262
- ), re = Z(
263
- () => z.map(G),
264
- [z, G]
265
- ), He = Z(
266
- () => new Set(re.map((n) => n.id)),
267
- [re]
245
+ [e.value, j, N, e.multiple]
246
+ ), ne = Y(
247
+ () => A.map(G),
248
+ [A, G]
249
+ ), Ee = Y(
250
+ () => new Set(ne.map((n) => n.id)),
251
+ [ne]
268
252
  ), Le = J(() => {
269
253
  i((n) => !n);
270
254
  }, []);
271
- x.current = (n) => {
255
+ b.current = (n) => {
272
256
  if (!e.multiple)
273
257
  e.onChange?.(n, h);
274
258
  else {
275
- const f = e.value || [], D = [], le = f.includes(n.value);
276
- f.forEach((be) => {
277
- const De = C.find((Me) => Me.value === be);
259
+ const f = e.value || [], D = [], re = f.includes(n.value);
260
+ f.forEach((xe) => {
261
+ const De = C.find((Me) => Me.value === xe);
278
262
  De && D.push(De);
279
263
  });
280
- const $e = le ? D.filter((be) => be.value !== n.value) : [...D, n];
281
- e.onChange?.($e, h);
264
+ const Pe = re ? D.filter((xe) => xe.value !== n.value) : [...D, n];
265
+ e.onChange?.(Pe, h);
282
266
  }
283
267
  };
284
- const Ie = J((n) => {
285
- P?.(n, h), x.current?.(n), e.multiple || (i(!1), oe?.());
286
- }, [e.multiple, P, oe, h]), Te = (n) => {
287
- n.preventDefault(), n.stopPropagation(), n.target.blur(), ne?.(), e.multiple ? e.onChange?.([], h) : e.onChange?.(void 0, h);
288
- }, xe = J((n) => {
268
+ const He = J((n) => {
269
+ P?.(n, h), b.current?.(n), e.multiple || (i(!1), oe?.());
270
+ }, [e.multiple, P, oe, h]), Ie = (n) => {
271
+ n.preventDefault(), n.stopPropagation(), n.target.blur(), te?.(), e.multiple ? e.onChange?.([], h) : e.onChange?.(void 0, h);
272
+ }, be = J((n) => {
289
273
  e.multiple || e.onChange?.(void 0, h);
290
- const f = S.find((le) => E(le, j) === n);
274
+ const f = N.find((re) => E(re, j) === n);
291
275
  if (!f) return;
292
276
  const D = G(f);
293
- P?.(D, h), x.current?.(D), K?.(f);
294
- }, [P, K, S, h, e.multiple, e.onChange, G, j]), ze = J((n) => {
295
- xe(n);
296
- }, [xe]);
297
- ee(() => {
277
+ P?.(D, h), b.current?.(D), B?.(f);
278
+ }, [P, B, N, h, e.multiple, e.onChange, G, j]), Te = J((n) => {
279
+ be(n);
280
+ }, [be]);
281
+ Z(() => {
298
282
  if (!t) return;
299
283
  const n = (f) => {
300
284
  const D = f.target;
@@ -311,14 +295,14 @@ function Je(e) {
311
295
  return document.addEventListener("mousedown", n), window.addEventListener("scroll", n, !0), window.addEventListener("resize", n, !0), () => {
312
296
  document.removeEventListener("mousedown", n), window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", n, !0);
313
297
  };
314
- }, [t]), ee(() => {
298
+ }, [t]), Z(() => {
315
299
  w.current.forEach((n) => {
316
300
  try {
317
301
  n(t);
318
302
  } catch {
319
303
  }
320
304
  });
321
- }, [t]), _e(L, () => ({
305
+ }, [t]), $e(H, () => ({
322
306
  open: () => {
323
307
  !t && i(!0);
324
308
  },
@@ -335,7 +319,7 @@ function Je(e) {
335
319
  n.preventDefault(), n.stopPropagation(), n.target.matches(":focus-visible") && !pe && !t && (i(!0), setTimeout(() => {
336
320
  m.current?.focus();
337
321
  }, 10));
338
- }, Pe = (n) => {
322
+ }, ze = (n) => {
339
323
  n.key === "Tab" && t && i(!1), (n.keyCode === 32 || n.key === "ArrowDown") && (i(!0), setTimeout(() => {
340
324
  m.current?.focus();
341
325
  }, 10));
@@ -346,7 +330,7 @@ function Je(e) {
346
330
  className: u(
347
331
  "relative bg-inherit select-none w-full",
348
332
  I,
349
- F === "static" && "mt-2"
333
+ U === "static" && "mt-2"
350
334
  ),
351
335
  ref: p,
352
336
  draggable: !1,
@@ -356,14 +340,14 @@ function Je(e) {
356
340
  /* @__PURE__ */ l.jsx(
357
341
  "label",
358
342
  {
359
- htmlFor: b,
360
- ref: ue,
343
+ htmlFor: x,
344
+ ref: ie,
361
345
  className: u(
362
346
  "left-3 pointer-events-none bg-inherit z-10",
363
- F === "default" && "transition-all duration-200 ease-in-out",
347
+ U === "default" && "transition-all duration-200 ease-in-out",
364
348
  _(),
365
- d || t ? ye[X].label : "text-neutral-medium-default",
366
- U && ve.label
349
+ d || t ? ye[Q].label : "text-neutral-medium-default",
350
+ K && ve.label
367
351
  ),
368
352
  children: g
369
353
  }
@@ -371,12 +355,12 @@ function Je(e) {
371
355
  /* @__PURE__ */ l.jsxs(
372
356
  "div",
373
357
  {
374
- id: b,
358
+ id: x,
375
359
  tabIndex: 0,
376
360
  role: "button",
377
- ref: H,
361
+ ref: L,
378
362
  onFocus: Ae,
379
- onKeyDown: Pe,
363
+ onKeyDown: ze,
380
364
  onClick: (n) => {
381
365
  n.preventDefault(), n.stopPropagation(), Le();
382
366
  },
@@ -384,10 +368,10 @@ function Je(e) {
384
368
  "w-full px-2 text-left border rounded-lg transition-all duration-200 ease-in-out",
385
369
  "flex items-center justify-start bg-inherit ",
386
370
  "focus:outline-none",
387
- Y === "chips" && "mt-1.5",
388
- Y === "chips" && e.multiple && d ? "min-h-14 py-3 " : !W && "h-14 min-h-14",
389
- ye[X].input,
390
- U && ve.input,
371
+ X === "chips" && "mt-1.5",
372
+ X === "chips" && e.multiple && d ? "min-h-14 py-3 " : !R && "h-14 min-h-14",
373
+ ye[Q].input,
374
+ K && ve.input,
391
375
  q
392
376
  ),
393
377
  children: [
@@ -402,53 +386,53 @@ function Je(e) {
402
386
  onPointerLeave: r.onPointerLeave,
403
387
  onPointerCancel: r.onPointerCancel,
404
388
  onClickCapture: r.onClickCapture,
405
- children: te ? we.createElement(
406
- R(
407
- te,
389
+ children: ee ? we.createElement(
390
+ F(
391
+ ee,
408
392
  (n, f) => n.disabled === f.disabled && n.multiple === f.multiple
409
393
  ),
410
394
  {
411
- disabled: U,
395
+ disabled: K,
412
396
  multiple: e.multiple || !1,
413
397
  placeholder: O,
414
- selectedOptions: z,
415
- onRemoveOption: ze
398
+ selectedOptions: A,
399
+ onRemoveOption: Te
416
400
  }
417
401
  ) : /* @__PURE__ */ l.jsx(
418
- Ee,
402
+ Oe,
419
403
  {
420
- displayMode: Y,
421
- selectedOptions: re,
422
- placeholder: $,
423
- onRemoveOption: xe,
404
+ displayMode: X,
405
+ selectedOptions: ne,
406
+ placeholder: M,
407
+ onRemoveOption: be,
424
408
  multiple: e.multiple || !1,
425
409
  className: u(me === "scroll" ? "flex-nowrap" : "flex-wrap"),
426
- disabled: U
410
+ disabled: K
427
411
  }
428
412
  )
429
413
  }
430
414
  ),
431
415
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
432
- ie && /* @__PURE__ */ l.jsx(Re, { size: "small", variant: "clip", className: " translate-y-1", speedMultiplier: 0.7 }),
433
- d && ne && /* @__PURE__ */ l.jsx(
416
+ se && /* @__PURE__ */ l.jsx(_e, { size: "small", variant: "clip", className: " translate-y-1", speedMultiplier: 0.7 }),
417
+ d && te && /* @__PURE__ */ l.jsx(
434
418
  "button",
435
419
  {
436
420
  onMouseDown: (n) => {
437
- n.preventDefault(), n.stopPropagation(), Te(n);
421
+ n.preventDefault(), n.stopPropagation(), Ie(n);
438
422
  },
439
423
  type: "button",
440
424
  tabIndex: -1,
441
- children: /* @__PURE__ */ l.jsx(Q.Cancel, { size: 20, className: u(" cursor-pointer transition-all", ye[X].icon) })
425
+ children: /* @__PURE__ */ l.jsx(ce.Cancel, { size: 20, className: u(" cursor-pointer transition-all", ye[Q].icon) })
442
426
  }
443
427
  ),
444
428
  /* @__PURE__ */ l.jsx(
445
- Q.ChevronDown,
429
+ ce.ChevronDown,
446
430
  {
447
431
  size: 20,
448
432
  className: u(
449
433
  "transition-transform text-neutral-default-default",
450
434
  t ? "rotate-180" : "",
451
- U && ve.icon
435
+ K && ve.icon
452
436
  )
453
437
  }
454
438
  )
@@ -458,54 +442,54 @@ function Je(e) {
458
442
  )
459
443
  ] }),
460
444
  t && /* @__PURE__ */ l.jsx(
461
- Ye,
445
+ Xe,
462
446
  {
463
447
  isOpen: t,
464
448
  multiple: e.multiple || !1,
465
- disabled: U,
466
- optionLabel: B,
449
+ disabled: K,
450
+ optionLabel: W,
467
451
  optionValue: j,
468
- labelVariant: F,
452
+ labelVariant: U,
469
453
  renderOption: T,
470
454
  emptyMessage: ge,
471
455
  attachToParent: he,
472
456
  filteredOptions: c,
473
- dropdownClassName: ae,
457
+ dropdownClassName: le,
474
458
  setFilteredOptions: s,
475
- selectedOptionsIds: He,
476
- options: T ? S : C,
459
+ selectedOptionsIds: Ee,
460
+ options: T ? N : C,
477
461
  selectRef: p,
478
462
  dropdownRef: k,
479
- selectButtonRef: H,
480
- helperComponentRef: N,
481
- onOptionClick: Ie,
463
+ selectButtonRef: L,
464
+ helperComponentRef: S,
465
+ onOptionClick: He,
482
466
  onCloseDropdown: () => i(!1),
483
- searchValue: M,
467
+ searchValue: $,
484
468
  setSearchValue: v,
485
469
  searchInputRef: m,
486
- isLoading: A?.isLoading,
487
- onSearchClear: A?.onSearchClear,
488
- hideSearchBar: A?.hideSearchBar,
489
- dropdownHeight: A?.dropdownHeight,
490
- onSearchValueChange: A?.onSearchValueChange,
491
- inputSearchPlaceholder: A?.inputSearchPlaceholder
470
+ isLoading: z?.isLoading,
471
+ onSearchClear: z?.onSearchClear,
472
+ hideSearchBar: z?.hideSearchBar,
473
+ dropdownHeight: z?.dropdownHeight,
474
+ onSearchValueChange: z?.onSearchValueChange,
475
+ inputSearchPlaceholder: z?.inputSearchPlaceholder
492
476
  }
493
477
  ),
494
- (fe || se) && /* @__PURE__ */ l.jsx(
495
- qe,
478
+ (fe || ae) && /* @__PURE__ */ l.jsx(
479
+ Ke,
496
480
  {
497
- ref: N,
498
- variant: X,
481
+ ref: S,
482
+ variant: Q,
499
483
  className: "mt-1",
500
- children: fe || se
484
+ children: fe || ae
501
485
  }
502
486
  )
503
487
  ]
504
488
  }
505
489
  );
506
490
  }
507
- const Qe = R(Je, (e, t) => e.value === t.value && e.options === t.options && e.isLoading === t.isLoading && e.disabled === t.disabled && e.errorComponent === t.errorComponent && e.helperComponent === t.helperComponent && e.variant === t.variant && e.label === t.label && e.id === t.id && e.name === t.name && e.placeholder === t.placeholder && e.dropdownOptions?.controledSearchValue === t.dropdownOptions?.controledSearchValue && e.dropdownOptions?.isLoading === t.dropdownOptions?.isLoading), ut = Qe;
508
- function Xe({
491
+ const Je = F(Ve, (e, t) => e.value === t.value && e.options === t.options && e.isLoading === t.isLoading && e.disabled === t.disabled && e.errorComponent === t.errorComponent && e.helperComponent === t.helperComponent && e.variant === t.variant && e.label === t.label && e.id === t.id && e.name === t.name && e.placeholder === t.placeholder && e.dropdownOptions?.controledSearchValue === t.dropdownOptions?.controledSearchValue && e.dropdownOptions?.isLoading === t.dropdownOptions?.isLoading), it = Je;
492
+ function Qe({
509
493
  isOpen: e,
510
494
  options: t,
511
495
  multiple: i,
@@ -516,27 +500,27 @@ function Xe({
516
500
  optionValue: p,
517
501
  searchValue: k,
518
502
  labelVariant: m,
519
- emptyMessage: H,
520
- renderOption: x,
521
- onOptionClick: N,
503
+ emptyMessage: L,
504
+ renderOption: b,
505
+ onOptionClick: S,
522
506
  onSearchClear: w,
523
- searchInputRef: b,
507
+ searchInputRef: x,
524
508
  setSearchValue: h,
525
509
  dropdownHeight: g,
526
- attachToParent: W,
527
- filteredOptions: S,
528
- selectButtonRef: L,
510
+ attachToParent: R,
511
+ filteredOptions: N,
512
+ selectButtonRef: H,
529
513
  onCloseDropdown: I,
530
514
  dropdownClassName: O,
531
515
  helperComponentRef: j,
532
- selectedOptionsIds: B,
516
+ selectedOptionsIds: W,
533
517
  setFilteredOptions: T,
534
- onSearchValueChange: te,
518
+ onSearchValueChange: ee,
535
519
  isLoading: q = !1,
536
- hideSearchBar: ae = !1,
520
+ hideSearchBar: le = !1,
537
521
  inputSearchPlaceholder: de = "Buscar opciones"
538
522
  }) {
539
- const se = m === "static" ? -20 : 7, K = J(() => g ? g.endsWith("px") ? Number(g.replace("px", "")) : g.endsWith("vh") ? window.innerHeight * Number(g.replace("vh", "")) / 100 : g.endsWith("%") ? window.innerHeight * Number(g.replace("%", "")) / 100 : 320 : 320, [g])(), [P, oe] = ce({ direction: "down", height: K }), ne = (r) => {
523
+ const ae = m === "static" ? -20 : 7, B = J(() => g ? g.endsWith("px") ? Number(g.replace("px", "")) : g.endsWith("vh") ? window.innerHeight * Number(g.replace("vh", "")) / 100 : g.endsWith("%") ? window.innerHeight * Number(g.replace("%", "")) / 100 : 320 : 320, [g])(), [P, oe] = ue({ direction: "down", height: B }), te = (r) => {
540
524
  if (!o.current || !s.current) return;
541
525
  const a = s.current.getBoundingClientRect();
542
526
  switch (r || P.direction) {
@@ -544,93 +528,93 @@ function Xe({
544
528
  o.current.style.top = `${a.top + a.height - (j?.current?.offsetHeight ? j?.current?.offsetHeight + 4 : 0)}px`;
545
529
  break;
546
530
  case "up":
547
- o.current.style.top = "auto", o.current.style.bottom = `${window.innerHeight - a.top + se}px`;
531
+ o.current.style.top = "auto", o.current.style.bottom = `${window.innerHeight - a.top + ae}px`;
548
532
  break;
549
533
  }
550
534
  o.current.style.left = `${a.left}px`, o.current.style.width = `${a.width}px`;
551
- }, U = (r) => {
535
+ }, K = (r) => {
552
536
  o.current && (o.current.style.maxHeight = `${r}px`);
553
537
  }, me = () => {
554
538
  if (!o.current || !s.current) return P;
555
- const r = s.current.getBoundingClientRect(), a = window.innerHeight - (window.innerHeight - r.top), d = window.innerHeight - r.bottom, y = d >= K, $ = a >= K;
556
- let M = "down", _;
557
- return y ? (M = "down", _ = K) : $ ? (M = "up", _ = K) : d > a ? (M = "down", _ = d - 16) : (M = "up", _ = a - 16), { direction: M, height: _ };
558
- }, X = (r) => {
539
+ const r = s.current.getBoundingClientRect(), a = window.innerHeight - (window.innerHeight - r.top), d = window.innerHeight - r.bottom, y = d >= B, M = a >= B;
540
+ let $ = "down", _;
541
+ return y ? ($ = "down", _ = B) : M ? ($ = "up", _ = B) : d > a ? ($ = "down", _ = d - 16) : ($ = "up", _ = a - 16), { direction: $, height: _ };
542
+ }, Q = (r) => {
559
543
  if (!(!o.current || !s.current)) {
560
544
  if (o.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !r) {
561
545
  o.current.style.maxHeight = "0", o.current.style.opacity = "0", o.current.style.pointerEvents = "none";
562
546
  return;
563
547
  }
564
- if (!W) {
548
+ if (!R) {
565
549
  const a = me();
566
- oe(a), ne(a.direction), U(a.height);
550
+ oe(a), te(a.direction), K(a.height);
567
551
  }
568
552
  o.current.style.opacity = "1", o.current.style.pointerEvents = "auto";
569
553
  }
570
554
  };
571
- ee(() => {
572
- W || !s.current || !e || ne();
573
- }, [B]), ee(() => {
574
- X(e);
575
- }, [e]), ee(() => {
555
+ Z(() => {
556
+ R || !s.current || !e || te();
557
+ }, [W]), Z(() => {
558
+ Q(e);
559
+ }, [e]), Z(() => {
576
560
  t && T(t);
577
- }, [t]), ee(() => {
561
+ }, [t]), Z(() => {
578
562
  if (q || !k) return;
579
- const r = ie(t, k);
563
+ const r = se(t, k);
580
564
  T(r);
581
565
  }, [t]);
582
- const ie = (r, a) => r.filter((d) => je(x ? E(d, v) : d.label, a)), he = (r) => {
583
- const a = ie(t, r);
584
- if (T(a), te) {
566
+ const se = (r, a) => r.filter((d) => je(b ? E(d, v) : d.label, a)), he = (r) => {
567
+ const a = se(t, r);
568
+ if (T(a), ee) {
585
569
  if (r === "") {
586
- Y();
570
+ X();
587
571
  return;
588
572
  }
589
- te(r);
573
+ ee(r);
590
574
  return;
591
575
  }
592
576
  h && t && h(r);
593
- }, Y = J(() => {
577
+ }, X = J(() => {
594
578
  if (w) {
595
579
  w(), T(
596
580
  t.filter((r) => {
597
- const a = x ? E(r, p) : r.id;
598
- return B.has(a);
581
+ const a = b ? E(r, p) : r.id;
582
+ return W.has(a);
599
583
  })
600
584
  );
601
585
  return;
602
586
  }
603
587
  h && (h(""), T(t));
604
- }, [t, B, p, w, T, h, x]), F = (r) => {
588
+ }, [t, W, p, w, T, h, b]), U = (r) => {
605
589
  r.key === "ArrowDown" ? (r.preventDefault(), o.current?.querySelector("[role=listitem]")?.focus()) : (r.key === "Tab" || r.key === "Escape") && setTimeout(() => {
606
- L.current?.focus(), I();
590
+ H.current?.focus(), I();
607
591
  }, 10);
608
592
  }, pe = (r, a) => {
609
593
  const d = Array.from(o.current?.querySelectorAll("[role=listitem]") || []), y = d.indexOf(r.currentTarget);
610
594
  if (r.key === "ArrowDown") {
611
595
  r.preventDefault();
612
- const $ = y < d.length - 1 ? y + 1 : y;
613
- d[$]?.focus();
596
+ const M = y < d.length - 1 ? y + 1 : y;
597
+ d[M]?.focus();
614
598
  } else if (r.key === "ArrowUp")
615
599
  if (r.preventDefault(), y === 0)
616
- b && b.current?.focus();
600
+ x && x.current?.focus();
617
601
  else {
618
- const $ = y - 1;
619
- d[$]?.focus();
602
+ const M = y - 1;
603
+ d[M]?.focus();
620
604
  }
621
605
  else if (r.key === "Enter" || r.key === " ") {
622
606
  if (r.preventDefault(), c) return;
623
- N(a), i || setTimeout(() => {
624
- L.current?.focus(), I();
607
+ S(a), i || setTimeout(() => {
608
+ H.current?.focus(), I();
625
609
  }, 10);
626
610
  } else r.key === "Escape" ? (r.preventDefault(), setTimeout(() => {
627
- L.current?.focus(), I();
611
+ H.current?.focus(), I();
628
612
  }, 10)) : r.key === "Tab" && setTimeout(() => {
629
- L.current?.focus(), I();
613
+ H.current?.focus(), I();
630
614
  }, 10);
631
- }, ge = Array.from({ length: 5 }).map((r, a) => x ? we.createElement(
632
- R(
633
- x,
615
+ }, ge = Array.from({ length: 5 }).map((r, a) => b ? we.createElement(
616
+ F(
617
+ b,
634
618
  (d, y) => d.isSelected === y.isSelected && d.option === y.option && d.disabled === y.disabled && d.multiple === y.multiple
635
619
  ),
636
620
  {
@@ -655,7 +639,7 @@ function Xe({
655
639
  },
656
640
  `skeleton-option-${// biome-ignore lint/suspicious/noArrayIndexKey: <>
657
641
  a}`
658
- )), ue = /* @__PURE__ */ l.jsx(
642
+ )), ie = /* @__PURE__ */ l.jsx(
659
643
  "div",
660
644
  {
661
645
  tabIndex: 0,
@@ -664,7 +648,7 @@ function Xe({
664
648
  className: u(
665
649
  " z-50 w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-lg shadow-lg",
666
650
  " overflow-hidden focus-visible:bg-neutral-default-hover ",
667
- W ? "absolute z-50 " : "fixed z-100 top-0 left-0",
651
+ R ? "absolute z-50 " : "fixed z-100 top-0 left-0",
668
652
  P.direction === "up" ? "h-auto" : " h-max",
669
653
  O
670
654
  ),
@@ -673,14 +657,14 @@ function Xe({
673
657
  {
674
658
  className: u(
675
659
  "flex flex-col ",
676
- ae ? "p-0" : "p-2 pt-0 gap-2"
660
+ le ? "p-0" : "p-2 pt-0 gap-2"
677
661
  ),
678
662
  style: {
679
663
  height: "auto",
680
664
  maxHeight: P.height
681
665
  },
682
666
  children: [
683
- !ae && /* @__PURE__ */ l.jsx(
667
+ !le && /* @__PURE__ */ l.jsx(
684
668
  Ue,
685
669
  {
686
670
  name: "",
@@ -689,37 +673,37 @@ function Xe({
689
673
  tabIndex: 0,
690
674
  value: k,
691
675
  disabled: c,
692
- ref: b,
676
+ ref: x,
693
677
  labelVariant: "static",
694
- icon: /* @__PURE__ */ l.jsx(Q.Search, {}),
678
+ icon: /* @__PURE__ */ l.jsx(ce.Search, {}),
695
679
  isFetching: q,
696
- onKeyDown: F,
697
- onClear: Y,
680
+ onKeyDown: U,
681
+ onClear: X,
698
682
  onChange: he,
699
683
  placeholder: de,
700
684
  className: " bg-neutral-medium-pressed"
701
685
  }
702
686
  ),
703
- /* @__PURE__ */ l.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: S.length === 0 ? q ? /* @__PURE__ */ l.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: ge }) : /* @__PURE__ */ l.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: k ? `No se encontraron resultados para "${k}"` : H }) : S.map((r) => {
704
- const a = x ? E(r, p) : r.id, d = B.has(a), y = (C) => x ? {
687
+ /* @__PURE__ */ l.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: N.length === 0 ? q ? /* @__PURE__ */ l.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: ge }) : /* @__PURE__ */ l.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: k ? `No se encontraron resultados para "${k}"` : L }) : N.map((r) => {
688
+ const a = b ? E(r, p) : r.id, d = W.has(a), y = (C) => b ? {
705
689
  id: a,
706
690
  label: String(E(C, v)),
707
691
  value: E(C, p)
708
- } : C, $ = () => {
709
- N(y(r));
710
- }, M = (C) => {
711
- if (N(C), !i) {
692
+ } : C, M = () => {
693
+ S(y(r));
694
+ }, $ = (C) => {
695
+ if (S(C), !i) {
712
696
  if (!h) return;
713
697
  h(""), T(t);
714
698
  }
715
- }, _ = (C, z) => (
699
+ }, _ = (C, A) => (
716
700
  // biome-ignore lint/a11y/useSemanticElements: <>
717
701
  /* @__PURE__ */ l.jsx(
718
702
  "div",
719
703
  {
720
704
  tabIndex: 0,
721
705
  role: "listitem",
722
- onKeyDown: (re) => pe(re, z),
706
+ onKeyDown: (ne) => pe(ne, A),
723
707
  className: u(
724
708
  "focus-visible:bg-neutral-medium-hover outline-none hover:bg-neutral-medium-hover ",
725
709
  d && "bg-neutral-medium-selected"
@@ -727,17 +711,17 @@ function Xe({
727
711
  children: C
728
712
  }
729
713
  )
730
- ), G = x ? we.createElement(
731
- R(
732
- x,
733
- (C, z) => C.isSelected === z.isSelected && C.option === z.option && C.disabled === z.disabled && C.multiple === z.multiple
714
+ ), G = b ? we.createElement(
715
+ F(
716
+ b,
717
+ (C, A) => C.isSelected === A.isSelected && C.option === A.option && C.disabled === A.disabled && C.multiple === A.multiple
734
718
  ),
735
719
  {
736
720
  key: a,
737
721
  option: r,
738
722
  isSelected: d,
739
723
  multiple: i,
740
- onSelect: $,
724
+ onSelect: M,
741
725
  disabled: c,
742
726
  isLoading: q
743
727
  }
@@ -748,7 +732,7 @@ function Xe({
748
732
  multiple: i,
749
733
  isLoading: q,
750
734
  isSelected: d,
751
- onSelect: M,
735
+ onSelect: $,
752
736
  option: r
753
737
  },
754
738
  a
@@ -760,11 +744,11 @@ function Xe({
760
744
  )
761
745
  }
762
746
  );
763
- return W ? ue : We(ue, document.body);
747
+ return R ? ie : Re(ie, document.body);
764
748
  }
765
- const Ye = R(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.isOpen === t.isOpen && e.attachToParent === t.attachToParent && e.optionValue === t.optionValue && e.optionLabel === t.optionLabel && e.filteredOptions === t.filteredOptions && e.isLoading === t.isLoading), Ce = R(({ option: e, isSelected: t, onSelect: i, multiple: c, disabled: s, isLoading: o }) => o ? /* @__PURE__ */ l.jsxs("div", { className: "flex gap-2 w-full px-3 py-2 cursor-wait", children: [
766
- /* @__PURE__ */ l.jsx(Ne, { className: "size-6 aspect-square" }),
767
- /* @__PURE__ */ l.jsx(Ne, { className: "flex-1 h-6" })
749
+ const Xe = F(Qe, (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.isOpen === t.isOpen && e.attachToParent === t.attachToParent && e.optionValue === t.optionValue && e.optionLabel === t.optionLabel && e.filteredOptions === t.filteredOptions && e.isLoading === t.isLoading), Ce = F(({ option: e, isSelected: t, onSelect: i, multiple: c, disabled: s, isLoading: o }) => o ? /* @__PURE__ */ l.jsxs("div", { className: "flex gap-2 w-full px-3 py-2 cursor-wait", children: [
750
+ /* @__PURE__ */ l.jsx(Se, { className: "size-6 aspect-square" }),
751
+ /* @__PURE__ */ l.jsx(Se, { className: "flex-1 h-6" })
768
752
  ] }) : (
769
753
  // biome-ignore lint/a11y/noStaticElementInteractions: no keyboard interaction needed
770
754
  /* @__PURE__ */ l.jsxs(
@@ -792,8 +776,8 @@ const Ye = R(Xe, (e, t) => e.options === t.options && e.selectedOptionsIds === t
792
776
  )
793
777
  ), (e, t) => e.isSelected === t.isSelected);
794
778
  Ce.displayName = "DefaultOptionRenderer";
795
- const Ee = R(({ selectedOptions: e, placeholder: t, onRemoveOption: i, displayMode: c, multiple: s, className: o, disabled: v }) => e?.length === 0 ? t ? /* @__PURE__ */ l.jsx("span", { className: "text-neutral-medium-default opacity-50", children: t }) : null : c === "chips" && s ? /* @__PURE__ */ l.jsx("div", { className: u("flex items-center gap-1 ", o), children: e.map((p) => /* @__PURE__ */ l.jsx(
796
- Ve,
779
+ const Oe = F(({ selectedOptions: e, placeholder: t, onRemoveOption: i, displayMode: c, multiple: s, className: o, disabled: v }) => e?.length === 0 ? t ? /* @__PURE__ */ l.jsx("span", { className: "text-neutral-medium-default opacity-50", children: t }) : null : c === "chips" && s ? /* @__PURE__ */ l.jsx("div", { className: u("flex items-center gap-1 ", o), children: e.map((p) => /* @__PURE__ */ l.jsx(
780
+ Ge,
797
781
  {
798
782
  tabIndex: -1,
799
783
  id: p.id,
@@ -806,8 +790,8 @@ const Ee = R(({ selectedOptions: e, placeholder: t, onRemoveOption: i, displayMo
806
790
  e?.length,
807
791
  " seleccionados"
808
792
  ] }), (e, t) => e.selectedOptions === t.selectedOptions);
809
- Ee.displayName = "DefaultSelectionDisplay";
793
+ Oe.displayName = "DefaultSelectionDisplay";
810
794
  export {
811
- ut as S,
795
+ it as S,
812
796
  E as g
813
797
  };