prometeo-design-system 2.4.1 → 2.4.3

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