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