prometeo-design-system 2.3.3 → 2.3.5

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