prometeo-design-system 4.0.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/{CardProfile-y9Knsg26.js → CardProfile-C1F83KJV.js} +1 -1
  2. package/dist/CardProfile.es.js +1 -1
  3. package/dist/{DatePicker-6eb-0Ns5.js → DatePicker-QuBgR5DQ.js} +799 -794
  4. package/dist/DatePicker.es.js +1 -1
  5. package/dist/DialogModal.es.js +25 -22
  6. package/dist/PlainTooltip.d.ts +6 -0
  7. package/dist/PlainTooltip.es.js +72 -0
  8. package/dist/PyrionLayout.es.js +791 -742
  9. package/dist/RecurrentDatePicker.es.js +1 -1
  10. package/dist/RecurrentDatePickerRRule.es.js +1 -1
  11. package/dist/Scrollable.es.js +1 -1
  12. package/dist/Select.es.js +524 -524
  13. package/dist/SelectSearch.es.js +44 -43
  14. package/dist/TabLinks.d.ts +2 -0
  15. package/dist/TabLinks.es.js +81 -52
  16. package/dist/{badge-B1IK_-i5.js → badge-CbqYNrl4.js} +28 -28
  17. package/dist/components/DatePicker/DatePicker.d.ts +1 -0
  18. package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +2 -1
  19. package/dist/components/NavigationDrawer/NavigationDrawerActionItem.d.ts +4 -3
  20. package/dist/components/NavigationDrawer/NavigationDrawerActions.d.ts +3 -4
  21. package/dist/components/NavigationDrawer/NavigationDrawerItemBase.d.ts +1 -0
  22. package/dist/components/NavigationDrawer/NavigationDrawerLinkItem.d.ts +3 -2
  23. package/dist/components/NavigationDrawer/NavigationDrawerNavlinks.d.ts +2 -2
  24. package/dist/components/PlainTooltip/PlainTooltip.d.ts +11 -0
  25. package/dist/components/PyrionNavigationDrawer/PLContent.d.ts +4 -4
  26. package/dist/components/PyrionNavigationDrawer/PLFooter.d.ts +3 -2
  27. package/dist/components/PyrionNavigationDrawer/PLSidebarContent.d.ts +2 -2
  28. package/dist/components/PyrionNavigationDrawer/PLayoutBase.d.ts +7 -6
  29. package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +15 -12
  30. package/dist/components/PyrionNavigationDrawer/index.d.ts +2 -2
  31. package/dist/components/Select/Select.d.ts +1 -0
  32. package/dist/components/TabLinks/TabLinks.d.ts +10 -1
  33. package/dist/components/TabSwitch/TabSwitch.d.ts +2 -0
  34. package/dist/exports/PlainTooltip.d.ts +2 -0
  35. package/dist/exports/TabLinks.d.ts +1 -0
  36. package/dist/hooks/useDevice.d.ts +1 -0
  37. package/dist/index.d.ts +0 -1
  38. package/dist/prometeo-design-system.es.js +50 -52
  39. package/dist/styles.css +1 -1
  40. package/dist/useDevice-vwn4GLwK.js +16 -0
  41. package/dist/useDevice.es.js +2 -11
  42. package/package.json +6 -6
  43. package/src/styles/base.css +1 -0
  44. package/dist/SwipeContainer.d.ts +0 -4
  45. package/dist/SwipeContainer.es.js +0 -185
  46. package/dist/components/SwipeContainer/SwipeContainer.d.ts +0 -19
  47. package/dist/exports/SwipeContainer.d.ts +0 -1
package/dist/Select.es.js CHANGED
@@ -1,6 +1,6 @@
1
- import { j as s } from "./jsx-runtime-GkKLlHH4.js";
2
- import { c } from "./cn-B6yFEsav.js";
3
- import we, { memo as V, useState as Ne, useRef as ae, useMemo as te, useCallback as _, useEffect as pe, useImperativeHandle as Qe } from "react";
1
+ import { j as a } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { c as d } from "./cn-B6yFEsav.js";
3
+ import we, { memo as J, useState as Ne, useRef as ae, useMemo as te, useCallback as _, useEffect as he, useImperativeHandle as Qe } from "react";
4
4
  import Xe from "./Spinner.es.js";
5
5
  import { createPortal as Ye } from "react-dom";
6
6
  import { u as Ze } from "./useDragScroll-CHN9OMwn.js";
@@ -12,7 +12,7 @@ import { g as k, h as Fe } from "./utils-X4-h3cum.js";
12
12
  import lt from "./Input.es.js";
13
13
  import Ue from "./Skeleton.es.js";
14
14
  import { Cancel as at } from "./Icons/Cancel.es.js";
15
- import { ChevronDown as Re } from "./Icons/ChevronDown.es.js";
15
+ import { ChevronDown as Ve } from "./Icons/ChevronDown.es.js";
16
16
  import { Search as ot } from "./Icons/Search.es.js";
17
17
  const st = {
18
18
  default: {
@@ -30,108 +30,108 @@ const st = {
30
30
  }, qe = {
31
31
  icon: " text-neutral-default-disabled",
32
32
  container: " border-neutral-strong-default text-neutral-default-disabled"
33
- }, Ve = ({ id: e, label: n, onRemove: f, className: b, disabled: h, variant: y = "default", tabIndex: p }) => /* @__PURE__ */ s.jsxs(
33
+ }, Re = ({ id: e, label: n, onRemove: h, className: y, disabled: g, variant: v = "default", tabIndex: b }) => /* @__PURE__ */ a.jsxs(
34
34
  "div",
35
35
  {
36
- tabIndex: p,
37
- className: c(
36
+ tabIndex: b,
37
+ className: d(
38
38
  "inline-flex max-w-[calc(50%-0.25rem)] items-center gap-1 px-2 py-1 bg-inherit text-xs rounded-lg border h-[30px]",
39
- st[y].container,
40
- h && qe.container
39
+ st[v].container,
40
+ g && qe.container
41
41
  ),
42
42
  children: [
43
- /* @__PURE__ */ s.jsx("span", { className: "truncate w-max ", children: n }),
44
- f && /* @__PURE__ */ s.jsx(
43
+ /* @__PURE__ */ a.jsx("span", { className: "truncate w-max ", children: n }),
44
+ h && /* @__PURE__ */ a.jsx(
45
45
  "button",
46
46
  {
47
47
  onMouseDown: (H) => {
48
- h || (H.stopPropagation(), H.preventDefault(), f?.(e));
48
+ g || (H.stopPropagation(), H.preventDefault(), h?.(e));
49
49
  },
50
- className: c(
50
+ className: d(
51
51
  "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",
52
- h && "cursor-default hover:scale-100",
53
- b
52
+ g && "cursor-default hover:scale-100",
53
+ y
54
54
  ),
55
55
  type: "button",
56
- tabIndex: p,
57
- children: /* @__PURE__ */ s.jsx(nt, { size: 18, className: c(h && qe.icon) })
56
+ tabIndex: b,
57
+ children: /* @__PURE__ */ a.jsx(nt, { size: 18, className: d(g && qe.icon) })
58
58
  }
59
59
  )
60
60
  ]
61
61
  }
62
62
  );
63
- Ve.displayName = "Chip";
64
- const it = V(Ve), ut = (e) => {
65
- const n = [], f = (b) => {
66
- b.forEach((h) => {
67
- const y = h, p = typeof y == "object" ? y?.options : [];
68
- Array.isArray(p) && p.length > 0 ? f(p) : n.push(h);
63
+ Re.displayName = "Chip";
64
+ const it = J(Re), ut = (e) => {
65
+ const n = [], h = (y) => {
66
+ y.forEach((g) => {
67
+ const v = g, b = typeof v == "object" ? v?.options : [];
68
+ Array.isArray(b) && b.length > 0 ? h(b) : n.push(g);
69
69
  });
70
70
  };
71
- return f(e), n;
72
- }, _e = {
71
+ return h(e), n;
72
+ }, We = {
73
73
  default: {
74
74
  container: "",
75
- input: c(
75
+ input: d(
76
76
  "border-neutral-default-default text-neutral-default-default",
77
77
  "focus:ring-primary-default-default focus:ring-[1px] focus:border-primary-default-default ",
78
78
  "hover:border-primary-default-default"
79
79
  ),
80
- label: c(
80
+ label: d(
81
81
  "text-neutral-medium-default",
82
82
  "peer-focus:text-primary-default-default"
83
83
  ),
84
- icon: c(
84
+ icon: d(
85
85
  "text-neutral-medium-default",
86
86
  "peer-focus:text-primary-default-default"
87
87
  )
88
88
  },
89
89
  error: {
90
90
  container: "",
91
- input: c(
91
+ input: d(
92
92
  "border-error-default-default text-neutral-default-default hover:border-error-default-hover",
93
93
  "focus:border-error-default focus:border-2",
94
94
  "focus:ring-0 focus:ring-error-default/20"
95
95
  ),
96
- label: c("text-error-light", "peer-focus:text-error-light"),
97
- icon: c("text-error-medium-default", "peer-focus:text-error-light")
96
+ label: d("text-error-light", "peer-focus:text-error-light"),
97
+ icon: d("text-error-medium-default", "peer-focus:text-error-light")
98
98
  },
99
99
  success: {
100
100
  container: "",
101
- input: c(
101
+ input: d(
102
102
  "border-success-default-default text-neutral-default-default",
103
103
  "focus:border-success-default focus:border-2",
104
104
  "focus:ring-0 focus:ring-success-default/20"
105
105
  ),
106
- label: c("text-success", "peer-focus:text-success-light"),
107
- icon: c("text-success-medium-default", "peer-focus:text-success-light")
106
+ label: d("text-success", "peer-focus:text-success-light"),
107
+ icon: d("text-success-medium-default", "peer-focus:text-success-light")
108
108
  }
109
- }, We = {
110
- input: c(
109
+ }, Be = {
110
+ input: d(
111
111
  "border-neutral-strong-default text-neutral-default-default pointer-events-none",
112
112
  "focus:ring-0 focus:border-primary-default-disabled ",
113
113
  "hover:border-neutral-default-disabled"
114
114
  ),
115
- label: c(
115
+ label: d(
116
116
  "text-neutral-medium-disabled",
117
117
  "peer-focus:text-primary-default-default"
118
118
  ),
119
- icon: c(
119
+ icon: d(
120
120
  "text-neutral-medium-disabled",
121
121
  "peer-focus:text-primary-default-default"
122
122
  )
123
123
  };
124
124
  function ct(e) {
125
- const [n, f] = Ne(!1), [b, h] = Ne([]), [y, p] = Ne(""), H = ae(null), m = ae(null), T = ae(null), W = ae(null), B = ae(
125
+ const [n, h] = Ne(!1), [y, g] = Ne([]), [v, b] = Ne(""), H = ae(null), p = ae(null), P = ae(null), W = ae(null), B = ae(
126
126
  () => {
127
127
  }
128
- ), je = ae(null), ge = ae(/* @__PURE__ */ new Set()), {
129
- id: z,
128
+ ), je = ae(null), pe = ae(/* @__PURE__ */ new Set()), {
129
+ id: G,
130
130
  name: w,
131
- label: be,
132
- height: xe,
133
- options: J,
134
- controls: ye,
131
+ label: ge,
132
+ height: be,
133
+ options: Q,
134
+ controls: ne,
135
135
  className: K,
136
136
  placeholder: E,
137
137
  optionValue: N,
@@ -139,33 +139,33 @@ function ct(e) {
139
139
  renderOption: F,
140
140
  renderOptionGroupHeader: se,
141
141
  renderSelection: De,
142
- renderOptionContext: Ie,
142
+ renderOptionContext: ze,
143
143
  buttonClassName: He,
144
- dropdownClassName: ne,
144
+ dropdownClassName: re,
145
145
  containerClassName: U,
146
146
  dropdownOptions: j,
147
- helperComponent: Q,
148
- errorComponent: ve,
149
- onRemoveOption: ke,
147
+ helperComponent: X,
148
+ errorComponent: xe,
149
+ onRemoveOption: Oe,
150
150
  onOptionClick: q,
151
- onClose: Ce,
152
- onClear: ie,
153
- disabled: X = !1,
154
- overflow: Ke = "wrap",
155
- variant: P = "default",
156
- isLoading: ue = !1,
157
- attachToParent: ze = !1,
158
- displayMode: Se = "compact",
159
- labelVariant: re = "default",
160
- disableOpenOnFocus: Ae = !1,
161
- emptyMessage: Ee = "No hay opciones disponibles"
162
- } = e, { ref: Oe } = et(), { bind: Y, ref: Me } = Ze({
151
+ onClose: ke,
152
+ onClear: ye,
153
+ disabled: $ = !1,
154
+ overflow: Ae = "wrap",
155
+ variant: ve = "default",
156
+ isLoading: le = !1,
157
+ attachToParent: ie = !1,
158
+ displayMode: Ee = "compact",
159
+ labelVariant: Y = "default",
160
+ disableOpenOnFocus: Me = !1,
161
+ emptyMessage: Te = "No hay opciones disponibles"
162
+ } = e, { ref: Le } = et(), { bind: V, ref: Pe } = Ze({
163
163
  axis: "x",
164
164
  cursor: { idle: "default", dragging: "grabbing" }
165
- }), ce = e.multiple ? Array.isArray(e.value) && e.value.length > 0 && e.value.every((t) => t != null && t !== "") : e.value !== void 0 && e.value !== null && e.value !== "", Le = {}, Te = te(() => re === "static" && E ? E : "", [re, E]), Ge = te(
166
- () => j?.controledSearchValue || y,
167
- [j?.controledSearchValue, y]
168
- ), Pe = () => {
165
+ }), ue = e.multiple ? Array.isArray(e.value) && e.value.length > 0 && e.value.every((t) => t != null && t !== "") : e.value !== void 0 && e.value !== null && e.value !== "", $e = {}, Ge = te(() => Y === "static" && E ? E : "", [Y, E]), _e = te(
166
+ () => j?.controledSearchValue || v,
167
+ [j?.controledSearchValue, v]
168
+ ), Ie = () => {
169
169
  const t = {
170
170
  static: {
171
171
  active: "relative prometeo-fonts-label-large",
@@ -175,303 +175,303 @@ function ct(e) {
175
175
  active: "absolute top-0 -translate-y-1/2 left-3 px-1 prometeo-fonts-body-small",
176
176
  default: "absolute top-1/2 -translate-y-1/2 "
177
177
  }
178
- }, o = n || ce ? "active" : "default";
179
- return t[re][o];
180
- }, O = _(
178
+ }, o = n || ue ? "active" : "default";
179
+ return t[Y][o];
180
+ }, L = _(
181
181
  (t) => ({
182
182
  id: k(t, N),
183
183
  value: k(t, N),
184
184
  label: k(t, oe)
185
185
  }),
186
186
  [N, oe]
187
- ), R = te(() => ut(J), [J]), de = te(
188
- () => R.map(O),
189
- [R, O]
190
- ), r = te(() => {
187
+ ), R = te(() => ut(Q), [Q]), Ce = te(
188
+ () => R.map(L),
189
+ [R, L]
190
+ ), ce = te(() => {
191
191
  const t = [];
192
192
  if (e.multiple)
193
193
  e.value?.forEach((o) => {
194
- const l = R?.find(
195
- (d) => k(d, N) === o
194
+ const c = R?.find(
195
+ (i) => k(i, N) === o
196
196
  );
197
- l && t.push(l);
197
+ c && t.push(c);
198
198
  });
199
199
  else {
200
200
  const o = R?.find(
201
- (l) => k(l, N) === e.value
201
+ (c) => k(c, N) === e.value
202
202
  );
203
203
  o && t.push(o);
204
204
  }
205
205
  return t;
206
- }, [e.value, N, R, e.multiple]), a = te(
207
- () => r.map(O),
208
- [r, O]
209
- ), i = te(
210
- () => new Set(a.map((t) => t.id)),
211
- [a]
212
- ), u = te(() => {
206
+ }, [e.value, N, R, e.multiple]), r = te(
207
+ () => ce.map(L),
208
+ [ce, L]
209
+ ), l = te(
210
+ () => new Set(r.map((t) => t.id)),
211
+ [r]
212
+ ), s = te(() => {
213
213
  const t = [];
214
- return J.forEach((o, l) => {
215
- const d = o, S = typeof d == "object" ? d?.options : [];
216
- if (Array.isArray(S) && S.length > 0) {
217
- const L = d.label, G = k(o, N), ee = `__group-${String(G ?? l)}`, me = {
218
- id: ee,
219
- value: ee,
220
- label: typeof L == "string" ? L : String(G ?? `Grupo ${l + 1}`),
214
+ return Q.forEach((o, c) => {
215
+ const i = o, f = typeof i == "object" ? i?.options : [];
216
+ if (Array.isArray(f) && f.length > 0) {
217
+ const D = i.label, M = k(o, N), I = `__group-${String(M ?? c)}`, fe = {
218
+ id: I,
219
+ value: I,
220
+ label: typeof D == "string" ? D : String(M ?? `Grupo ${c + 1}`),
221
221
  isGroupHeader: !0,
222
- groupLabelNode: L,
222
+ groupLabelNode: D,
223
223
  originalOption: o,
224
224
  groupData: {
225
- groupOptions: S
225
+ groupOptions: f
226
226
  }
227
227
  };
228
- t.push(me), S.forEach((he) => {
229
- F ? t.push(he) : t.push(O(he));
228
+ t.push(fe), f.forEach((me) => {
229
+ F ? t.push(me) : t.push(L(me));
230
230
  });
231
231
  } else
232
- F ? t.push(o) : t.push(O(o));
232
+ F ? t.push(o) : t.push(L(o));
233
233
  }), t;
234
- }, [J, N, F, O]), v = _(
234
+ }, [Q, N, F, L]), u = _(
235
235
  (t, o) => {
236
236
  if (!t || t.length === 0) return;
237
- const l = t.map(
238
- (x) => O(x)
237
+ const c = t.map(
238
+ (m) => L(m)
239
239
  );
240
240
  if (!e.multiple) {
241
- const x = l[0];
242
- if (!x) return;
243
- const C = i.has(x.id), M = o ?? "toggle";
244
- let $e;
245
- M === "select" || M === "toggle" && !C ? $e = x : $e = void 0, e.onChange?.($e, w);
241
+ const m = c[0];
242
+ if (!m) return;
243
+ const z = l.has(m.id), A = o ?? "toggle";
244
+ let T;
245
+ A === "select" || A === "toggle" && !z ? T = m : T = void 0, e.onChange?.(T, w);
246
246
  return;
247
247
  }
248
- const d = e.value || [], S = [];
249
- d.forEach((x) => {
250
- const C = de.find((M) => M.value === x);
251
- C && S.push(C);
248
+ const i = e.value || [], f = [];
249
+ i.forEach((m) => {
250
+ const z = Ce.find((A) => A.value === m);
251
+ z && f.push(z);
252
252
  });
253
- const L = new Set(S.map((x) => x.id)), G = new Set(l.map((x) => x.id)), ee = l.every(
254
- (x) => L.has(x.id)
255
- ), me = o ?? "toggle", he = me === "select" || me === "toggle" && !ee;
256
- let I;
257
- if (!he)
258
- I = S.filter((x) => !G.has(x.id));
253
+ const D = new Set(f.map((m) => m.id)), M = new Set(c.map((m) => m.id)), I = c.every(
254
+ (m) => D.has(m.id)
255
+ ), fe = o ?? "toggle", me = fe === "select" || fe === "toggle" && !I;
256
+ let Se;
257
+ if (!me)
258
+ Se = f.filter((m) => !M.has(m.id));
259
259
  else {
260
- const x = new Map(
261
- S.map((C) => [C.id, C])
260
+ const m = new Map(
261
+ f.map((z) => [z.id, z])
262
262
  );
263
- l.forEach((C) => {
264
- x.set(C.id, C);
265
- }), I = Array.from(x.values());
263
+ c.forEach((z) => {
264
+ m.set(z.id, z);
265
+ }), Se = Array.from(m.values());
266
266
  }
267
- e.onChange?.(I, w);
267
+ e.onChange?.(Se, w);
268
268
  },
269
269
  [
270
270
  e.multiple,
271
271
  e.value,
272
272
  e.onChange,
273
- de,
274
- i,
275
- O,
273
+ Ce,
274
+ l,
275
+ L,
276
276
  w
277
277
  ]
278
- ), D = _(() => {
279
- f((t) => !t);
278
+ ), C = _(() => {
279
+ h((t) => !t);
280
280
  }, []);
281
281
  B.current = (t) => {
282
282
  if (!e.multiple)
283
283
  e.onChange?.(t, w);
284
284
  else {
285
- const o = e.value || [], l = [], d = o.includes(t.value);
286
- o.forEach((L) => {
287
- const G = de.find(
288
- (ee) => ee.value === L
285
+ const o = e.value || [], c = [], i = o.includes(t.value);
286
+ o.forEach((D) => {
287
+ const M = Ce.find(
288
+ (I) => I.value === D
289
289
  );
290
- G && l.push(G);
290
+ M && c.push(M);
291
291
  });
292
- const S = d ? l.filter((L) => L.value !== t.value) : [...l, t];
293
- e.onChange?.(S, w);
292
+ const f = i ? c.filter((D) => D.value !== t.value) : [...c, t];
293
+ e.onChange?.(f, w);
294
294
  }
295
295
  };
296
- const g = _(
296
+ const S = _(
297
297
  (t, o = !1) => {
298
- q?.(t, w), B.current?.(t), o && (f(!1), Ce?.());
298
+ q?.(t, w), B.current?.(t), o && (h(!1), ke?.());
299
299
  },
300
- [q, Ce, w]
301
- ), A = (t) => {
302
- if (t.preventDefault(), t.stopPropagation(), t.target.blur(), ie?.(), e.multiple) {
300
+ [q, ke, w]
301
+ ), x = (t) => {
302
+ if (t.preventDefault(), t.stopPropagation(), t.target.blur(), ye?.(), e.multiple) {
303
303
  const o = e.onChange;
304
304
  o?.([], w);
305
305
  } else {
306
306
  const o = e.onChange;
307
307
  o?.(void 0, w);
308
308
  }
309
- }, $ = _(
309
+ }, O = _(
310
310
  (t) => {
311
311
  e.multiple || e.onChange?.(void 0, w);
312
312
  const o = R.find(
313
- (d) => k(d, N) === t
313
+ (i) => k(i, N) === t
314
314
  );
315
315
  if (!o) return;
316
- const l = O(o);
317
- q?.(l, w), B.current?.(l), ke?.(o);
316
+ const c = L(o);
317
+ q?.(c, w), B.current?.(c), Oe?.(o);
318
318
  },
319
319
  [
320
320
  q,
321
- ke,
321
+ Oe,
322
322
  R,
323
323
  w,
324
324
  e.multiple,
325
325
  e.onChange,
326
- O,
326
+ L,
327
327
  N
328
328
  ]
329
329
  ), Z = _(
330
330
  (t) => {
331
- $(t);
331
+ O(t);
332
332
  },
333
- [$]
333
+ [O]
334
334
  );
335
- pe(() => {
335
+ he(() => {
336
336
  if (!n) return;
337
337
  const t = (o) => {
338
- const l = o.target;
338
+ const c = o.target;
339
339
  if (o.type === "mousedown") {
340
- if (H.current?.contains(l) || m.current?.contains(l)) return;
341
- f(!1);
340
+ if (H.current?.contains(c) || p.current?.contains(c)) return;
341
+ h(!1);
342
342
  }
343
343
  if (o.type === "scroll") {
344
- if (m.current?.contains(l)) return;
345
- f(!1);
344
+ if (p.current?.contains(c)) return;
345
+ h(!1);
346
346
  }
347
- o.type === "resize" && f(!1);
347
+ o.type === "resize" && h(!1);
348
348
  };
349
349
  return document.addEventListener("mousedown", t), window.addEventListener("scroll", t, !0), window.addEventListener("resize", t, !0), () => {
350
350
  document.removeEventListener("mousedown", t), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t, !0);
351
351
  };
352
- }, [n]), pe(() => {
353
- ge.current.forEach((t) => {
352
+ }, [n]), he(() => {
353
+ pe.current.forEach((t) => {
354
354
  try {
355
355
  t(n);
356
356
  } catch {
357
357
  }
358
358
  });
359
359
  }, [n]), Qe(
360
- ye,
360
+ ne,
361
361
  () => ({
362
362
  open: () => {
363
- f(!0);
363
+ h(!0);
364
364
  },
365
365
  close: () => {
366
- f(!1);
366
+ h(!1);
367
367
  },
368
- toggle: () => f((t) => !t),
369
- handleOptionSelect: g,
370
- subscribeOpenChange: (t) => (ge.current.add(t), () => {
371
- ge.current.delete(t);
368
+ toggle: () => h((t) => !t),
369
+ handleOptionSelect: S,
370
+ subscribeOpenChange: (t) => (pe.current.add(t), () => {
371
+ pe.current.delete(t);
372
372
  }),
373
- searchInputRef: T
373
+ searchInputRef: P
374
374
  }),
375
- [n, g]
375
+ [n, S]
376
376
  );
377
- const fe = (t) => {
378
- t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !Ae && !n && (f(!0), setTimeout(() => {
379
- T.current?.focus();
377
+ const ee = (t) => {
378
+ t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !Me && !n && (h(!0), setTimeout(() => {
379
+ P.current?.focus();
380
380
  }, 10));
381
- }, le = (t) => {
382
- t.key === "Tab" && n && f(!1), (t.keyCode === 32 || t.key === "ArrowDown") && (f(!0), setTimeout(() => {
383
- T.current?.focus();
381
+ }, de = (t) => {
382
+ t.key === "Tab" && n && h(!1), (t.keyCode === 32 || t.key === "ArrowDown") && (h(!0), setTimeout(() => {
383
+ P.current?.focus();
384
384
  }, 10));
385
385
  };
386
- return /* @__PURE__ */ s.jsxs(
386
+ return /* @__PURE__ */ a.jsxs(
387
387
  "div",
388
388
  {
389
- className: c("relative bg-inherit select-none w-full", K),
389
+ className: d("relative bg-inherit select-none w-full", K),
390
390
  ref: H,
391
391
  draggable: !1,
392
- style: Le,
392
+ style: $e,
393
393
  children: [
394
- /* @__PURE__ */ s.jsxs("div", { className: c("relative bg-inherit ", U), children: [
395
- /* @__PURE__ */ s.jsx(
394
+ /* @__PURE__ */ a.jsxs("div", { className: d("relative bg-inherit ", U), children: [
395
+ /* @__PURE__ */ a.jsx(
396
396
  "label",
397
397
  {
398
- htmlFor: z,
399
- ref: Oe,
400
- className: c(
401
- "left-3 pointer-events-none bg-inherit z-10",
402
- re === "default" && "transition-all duration-200 ease-in-out",
403
- Pe(),
404
- ce || n ? _e[P].label : "text-neutral-medium-default",
405
- X && We.label
398
+ htmlFor: G,
399
+ ref: Le,
400
+ className: d(
401
+ "left-3 pointer-events-none bg-inherit z-10 line-clamp-1 max-w-[calc(100%-2.5rem)] ",
402
+ Y === "default" && "transition-all duration-200 ease-in-out",
403
+ Ie(),
404
+ ue || n ? We[ve].label : "text-neutral-medium-default",
405
+ $ && Be.label
406
406
  ),
407
- children: be
407
+ children: ge
408
408
  }
409
409
  ),
410
- /* @__PURE__ */ s.jsxs(
410
+ /* @__PURE__ */ a.jsxs(
411
411
  "div",
412
412
  {
413
- id: z,
413
+ id: G,
414
414
  tabIndex: 0,
415
415
  role: "button",
416
416
  ref: W,
417
- onFocus: fe,
418
- onKeyDown: le,
417
+ onFocus: ee,
418
+ onKeyDown: de,
419
419
  onClick: (t) => {
420
- t.preventDefault(), t.stopPropagation(), D();
420
+ t.preventDefault(), t.stopPropagation(), C();
421
421
  },
422
- className: c(
422
+ className: d(
423
423
  "w-full px-2 text-left border rounded-lg transition-all duration-200 ease-in-out",
424
424
  "flex items-center justify-start bg-inherit ",
425
425
  "focus:outline-none",
426
- Se === "chips" && e.multiple && ce ? "min-h-12 py-2 " : !xe && "h-12 min-h-12",
427
- _e[P].input,
428
- X && We.input,
426
+ Ee === "chips" && e.multiple && ue ? "min-h-12 py-2 " : !be && "h-12 min-h-12",
427
+ We[ve].input,
428
+ $ && Be.input,
429
429
  He
430
430
  ),
431
431
  children: [
432
- /* @__PURE__ */ s.jsx(
432
+ /* @__PURE__ */ a.jsx(
433
433
  "div",
434
434
  {
435
- className: c(
435
+ className: d(
436
436
  "flex-1 overflow-x-auto overflow-y-hidden px-1 prometeo-scrollbar-none "
437
437
  ),
438
- ref: Me,
439
- onPointerUp: Y.onPointerUp,
440
- onPointerDown: Y.onPointerDown,
441
- onPointerMove: Y.onPointerMove,
442
- onPointerLeave: Y.onPointerLeave,
443
- onPointerCancel: Y.onPointerCancel,
444
- onClickCapture: Y.onClickCapture,
438
+ ref: Pe,
439
+ onPointerUp: V.onPointerUp,
440
+ onPointerDown: V.onPointerDown,
441
+ onPointerMove: V.onPointerMove,
442
+ onPointerLeave: V.onPointerLeave,
443
+ onPointerCancel: V.onPointerCancel,
444
+ onClickCapture: V.onClickCapture,
445
445
  children: De ? we.createElement(
446
- V(
446
+ J(
447
447
  De,
448
448
  (t, o) => t.disabled === o.disabled && t.multiple === o.multiple
449
449
  ),
450
450
  {
451
- disabled: X,
451
+ disabled: $,
452
452
  multiple: e.multiple || !1,
453
453
  placeholder: E,
454
- selectedOptions: r,
454
+ selectedOptions: ce,
455
455
  onRemoveOption: Z
456
456
  }
457
- ) : /* @__PURE__ */ s.jsx(
457
+ ) : /* @__PURE__ */ a.jsx(
458
458
  Je,
459
459
  {
460
- displayMode: Se,
461
- selectedOptions: a,
462
- placeholder: Te,
463
- onRemoveOption: $,
460
+ displayMode: Ee,
461
+ selectedOptions: r,
462
+ placeholder: Ge,
463
+ onRemoveOption: O,
464
464
  multiple: e.multiple || !1,
465
- className: c(
466
- Ke === "scroll" ? "flex-nowrap" : "flex-wrap"
465
+ className: d(
466
+ Ae === "scroll" ? "flex-nowrap" : "flex-wrap"
467
467
  ),
468
- disabled: X
468
+ disabled: $
469
469
  }
470
470
  )
471
471
  }
472
472
  ),
473
- /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
474
- ue && /* @__PURE__ */ s.jsx(
473
+ /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
474
+ le && /* @__PURE__ */ a.jsx(
475
475
  Xe,
476
476
  {
477
477
  size: "small",
@@ -479,35 +479,35 @@ function ct(e) {
479
479
  className: " opacity-90"
480
480
  }
481
481
  ),
482
- ce && ie && /* @__PURE__ */ s.jsx(
482
+ ue && ye && /* @__PURE__ */ a.jsx(
483
483
  "button",
484
484
  {
485
485
  className: "z-100",
486
486
  onClick: (t) => {
487
- t.preventDefault(), t.stopPropagation(), A(t);
487
+ t.preventDefault(), t.stopPropagation(), x(t);
488
488
  },
489
489
  type: "button",
490
490
  tabIndex: -1,
491
- children: /* @__PURE__ */ s.jsx(
491
+ children: /* @__PURE__ */ a.jsx(
492
492
  at,
493
493
  {
494
494
  size: 20,
495
- className: c(
495
+ className: d(
496
496
  " cursor-pointer transition-all",
497
- _e[P].icon
497
+ We[ve].icon
498
498
  )
499
499
  }
500
500
  )
501
501
  }
502
502
  ),
503
- /* @__PURE__ */ s.jsx(
504
- Re,
503
+ /* @__PURE__ */ a.jsx(
504
+ Ve,
505
505
  {
506
506
  size: 20,
507
- className: c(
508
- "transition-transform text-neutral-default-default",
507
+ className: d(
508
+ "transition-transform text-neutral-default-default min-w-max",
509
509
  n ? "rotate-180" : "",
510
- X && We.icon
510
+ $ && Be.icon
511
511
  )
512
512
  }
513
513
  )
@@ -516,35 +516,35 @@ function ct(e) {
516
516
  }
517
517
  )
518
518
  ] }),
519
- n && /* @__PURE__ */ s.jsx(
519
+ n && /* @__PURE__ */ a.jsx(
520
520
  mt,
521
521
  {
522
- label: be,
522
+ label: ge,
523
523
  isOpen: n,
524
- disabled: X,
524
+ disabled: $,
525
525
  optionValue: N,
526
526
  optionLabel: oe,
527
- emptyMessage: Ee,
528
- labelVariant: re,
527
+ emptyMessage: Te,
528
+ labelVariant: Y,
529
529
  renderOption: F,
530
530
  renderOptionGroupHeader: se,
531
- attachToParent: ze,
532
- filteredOptions: b,
531
+ attachToParent: ie,
532
+ filteredOptions: y,
533
533
  multiple: e.multiple || !1,
534
- dropdownClassName: ne,
535
- selectedOptionsIds: i,
536
- setFilteredOptions: h,
537
- renderOptionContext: Ie,
538
- options: u,
534
+ dropdownClassName: re,
535
+ selectedOptionsIds: l,
536
+ setFilteredOptions: g,
537
+ renderOptionContext: ze,
538
+ options: s,
539
539
  selectRef: H,
540
- dropdownRef: m,
540
+ dropdownRef: p,
541
541
  selectButtonRef: W,
542
542
  helperComponentRef: je,
543
- onOptionClick: g,
544
- onCloseDropdown: () => f(!1),
545
- searchValue: Ge,
546
- setSearchValue: p,
547
- searchInputRef: T,
543
+ onOptionClick: S,
544
+ onCloseDropdown: () => h(!1),
545
+ searchValue: _e,
546
+ setSearchValue: b,
547
+ searchInputRef: P,
548
548
  isLoading: j?.isLoading,
549
549
  onSearchClear: j?.onSearchClear,
550
550
  hideSearchBar: j?.hideSearchBar,
@@ -555,44 +555,45 @@ function ct(e) {
555
555
  loadingComponent: j?.loadingComponent,
556
556
  inputProps: j?.inputProps,
557
557
  enableGroupToggle: j?.enableGroupToggle,
558
- onGroupSelectChange: v
558
+ focusSearchInputOnOpen: j?.focusSearchInputOnOpen,
559
+ onGroupSelectChange: u
559
560
  }
560
561
  ),
561
- (ve || Q) && /* @__PURE__ */ s.jsx("div", { className: "min-h-6", children: /* @__PURE__ */ s.jsx(
562
+ (xe || X) && /* @__PURE__ */ a.jsx("div", { className: "min-h-6", children: /* @__PURE__ */ a.jsx(
562
563
  tt,
563
564
  {
564
565
  ref: je,
565
- variant: P,
566
- className: "absolute bottom-0 h-5 overflow-visible ",
567
- children: ve || Q
566
+ variant: ve,
567
+ className: "absolute bottom-0 h-5 overflow-visible line-clamp-1!",
568
+ children: xe || X
568
569
  }
569
570
  ) })
570
571
  ]
571
572
  }
572
573
  );
573
574
  }
574
- const dt = V(ct, (e, n) => e.value === n.value && e.options === n.options && e.isLoading === n.isLoading && e.disabled === n.disabled && e.errorComponent === n.errorComponent && e.helperComponent === n.helperComponent && e.variant === n.variant && e.label === n.label && e.id === n.id && e.name === n.name && e.placeholder === n.placeholder && e.renderOptionContext === n.renderOptionContext && e.dropdownOptions?.controledSearchValue === n.dropdownOptions?.controledSearchValue && e.dropdownOptions?.isLoading === n.dropdownOptions?.isLoading), Ot = dt;
575
+ const dt = J(ct, (e, n) => e.value === n.value && e.options === n.options && e.isLoading === n.isLoading && e.disabled === n.disabled && e.errorComponent === n.errorComponent && e.helperComponent === n.helperComponent && e.variant === n.variant && e.label === n.label && e.id === n.id && e.name === n.name && e.placeholder === n.placeholder && e.renderOptionContext === n.renderOptionContext && e.dropdownOptions?.controledSearchValue === n.dropdownOptions?.controledSearchValue && e.dropdownOptions?.isLoading === n.dropdownOptions?.isLoading), Et = dt;
575
576
  function ft({
576
577
  footer: e,
577
578
  isOpen: n,
578
- label: f,
579
- options: b,
580
- multiple: h,
581
- disabled: y,
582
- selectRef: p,
579
+ label: h,
580
+ options: y,
581
+ multiple: g,
582
+ disabled: v,
583
+ selectRef: b,
583
584
  inputProps: H,
584
- dropdownRef: m,
585
- optionLabel: T,
585
+ dropdownRef: p,
586
+ optionLabel: P,
586
587
  optionValue: W,
587
588
  searchValue: B,
588
589
  labelVariant: je,
589
- emptyMessage: ge,
590
- renderOption: z,
590
+ emptyMessage: pe,
591
+ renderOption: G,
591
592
  renderOptionContext: w,
592
- renderOptionGroupHeader: be,
593
- onOptionClick: xe,
594
- onSearchClear: J,
595
- searchInputRef: ye,
593
+ renderOptionGroupHeader: ge,
594
+ onOptionClick: be,
595
+ onSearchClear: Q,
596
+ searchInputRef: ne,
596
597
  setSearchValue: K,
597
598
  dropdownHeight: E,
598
599
  attachToParent: N,
@@ -600,165 +601,166 @@ function ft({
600
601
  selectButtonRef: F,
601
602
  onCloseDropdown: se,
602
603
  loadingComponent: De,
603
- dropdownClassName: Ie,
604
+ dropdownClassName: ze,
604
605
  helperComponentRef: He,
605
- selectedOptionsIds: ne,
606
+ selectedOptionsIds: re,
606
607
  setFilteredOptions: U,
607
608
  onSearchValueChange: j,
608
- isLoading: Q = !1,
609
- hideSearchBar: ve = !1,
610
- inputSearchPlaceholder: ke = "Buscar opciones",
609
+ isLoading: X = !1,
610
+ hideSearchBar: xe = !1,
611
+ inputSearchPlaceholder: Oe = "Buscar opciones",
611
612
  enableGroupToggle: q = !0,
612
- onGroupSelectChange: Ce
613
+ focusSearchInputOnOpen: ke = !1,
614
+ onGroupSelectChange: ye
613
615
  }) {
614
- const ie = e ? 380 : 320, X = je === "static" ? f !== "" ? -20 : 4 : 7, P = _(() => E ? E.endsWith("px") ? Number(E.replace("px", "")) : E.endsWith("vh") ? window.innerHeight * Number(E.replace("vh", "")) / 100 : E.endsWith("%") ? window.innerHeight * Number(E.replace("%", "")) / 100 : ie : ie, [E, ie])(), [ue, ze] = Ne({
616
+ const $ = e ? 380 : 320, Ae = je === "static" ? h !== "" ? -20 : 4 : 7, le = _(() => E ? E.endsWith("px") ? Number(E.replace("px", "")) : E.endsWith("vh") ? window.innerHeight * Number(E.replace("vh", "")) / 100 : E.endsWith("%") ? window.innerHeight * Number(E.replace("%", "")) / 100 : $ : $, [E, $])(), [ie, Ee] = Ne({
615
617
  direction: "down",
616
- height: P
617
- }), [Se, re] = Ne(
618
+ height: le
619
+ }), [Y, Me] = Ne(
618
620
  () => /* @__PURE__ */ new Set()
619
- ), Ae = _(
620
- (r) => !Se.has(r),
621
- [Se]
622
- ), Ee = _(
623
- (r, a) => {
624
- re((i) => {
625
- const u = new Set(i), v = u.has(r);
626
- return (a === void 0 ? !v : !a) ? u.add(r) : u.delete(r), u;
621
+ ), Te = _(
622
+ (r) => !Y.has(r),
623
+ [Y]
624
+ ), Le = _(
625
+ (r, l) => {
626
+ Me((s) => {
627
+ const u = new Set(s), C = u.has(r);
628
+ return (l === void 0 ? !C : !l) ? u.add(r) : u.delete(r), u;
627
629
  });
628
630
  },
629
631
  []
630
- ), Oe = (r) => {
631
- if (!m.current || !p.current) return;
632
- const a = p.current.getBoundingClientRect();
633
- switch (r || ue.direction) {
632
+ ), V = (r) => {
633
+ if (!p.current || !b.current) return;
634
+ const l = b.current.getBoundingClientRect();
635
+ switch (r || ie.direction) {
634
636
  case "down":
635
- m.current.style.top = `${a.top + a.height - (He?.current?.offsetHeight ? He?.current?.offsetHeight + 4 : 0)}px`;
637
+ p.current.style.top = `${l.top + l.height - (He?.current?.offsetHeight ? He?.current?.offsetHeight + 4 : 0)}px`;
636
638
  break;
637
639
  case "up":
638
- m.current.style.top = "auto", m.current.style.bottom = `${window.innerHeight - a.top + X}px`;
640
+ p.current.style.top = "auto", p.current.style.bottom = `${window.innerHeight - l.top + Ae}px`;
639
641
  break;
640
642
  }
641
- m.current.style.left = `${a.left}px`, m.current.style.width = `${a.width}px`;
642
- }, Y = (r) => {
643
- m.current && (m.current.style.maxHeight = `${r}px`);
644
- }, Me = () => {
645
- if (!m.current || !p.current) return ue;
646
- const r = p.current.getBoundingClientRect(), a = window.innerHeight - (window.innerHeight - r.top), i = window.innerHeight - r.bottom, u = i >= P, v = a >= P;
647
- let D = "down", g;
648
- return u ? (D = "down", g = P) : v ? (D = "up", g = P) : i > a ? (D = "down", g = i - 16) : (D = "up", g = a - 16), { direction: D, height: g };
649
- }, ce = (r) => {
650
- if (!(!m.current || !p.current)) {
651
- if (m.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !r) {
652
- m.current.style.maxHeight = "0", m.current.style.opacity = "0", m.current.style.pointerEvents = "none";
643
+ p.current.style.left = `${l.left}px`, p.current.style.width = `${l.width}px`;
644
+ }, Pe = (r) => {
645
+ p.current && (p.current.style.maxHeight = `${r}px`);
646
+ }, ue = () => {
647
+ if (!p.current || !b.current) return ie;
648
+ const r = b.current.getBoundingClientRect(), l = window.innerHeight - (window.innerHeight - r.top), s = window.innerHeight - r.bottom, u = s >= le, C = l >= le;
649
+ let S = "down", x;
650
+ return u ? (S = "down", x = le) : C ? (S = "up", x = le) : s > l ? (S = "down", x = s - 16) : (S = "up", x = l - 16), { direction: S, height: x };
651
+ }, $e = (r) => {
652
+ if (!(!p.current || !b.current)) {
653
+ if (p.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !r) {
654
+ p.current.style.maxHeight = "0", p.current.style.opacity = "0", p.current.style.pointerEvents = "none";
653
655
  return;
654
656
  }
655
657
  if (!N) {
656
- const a = Me();
657
- ze(a), Oe(a.direction), Y(a.height);
658
+ const l = ue();
659
+ Ee(l), V(l.direction), Pe(l.height);
658
660
  }
659
- m.current.style.opacity = "1", m.current.style.pointerEvents = "auto";
661
+ p.current.style.opacity = "1", p.current.style.pointerEvents = "auto", ke && ne?.current && ne.current?.focus();
660
662
  }
661
663
  };
662
- pe(() => {
663
- N || !p.current || !n || Oe();
664
- }, [ne]), pe(() => {
665
- ce(n);
666
- }, [n]), pe(() => {
667
- b && U(b);
668
- }, [b]), pe(() => {
669
- if (Q || !B) return;
670
- const r = Le(b, B);
664
+ he(() => {
665
+ N || !b.current || !n || V();
666
+ }, [re]), he(() => {
667
+ $e(n);
668
+ }, [n]), he(() => {
669
+ y && U(y);
670
+ }, [y]), he(() => {
671
+ if (X || !B) return;
672
+ const r = Ge(y, B);
671
673
  U(r);
672
- }, [b]);
673
- const Le = (r, a) => {
674
- if (!a) return r;
675
- if (z) {
676
- const g = [];
677
- let A = null, $ = [];
678
- const Z = () => {
679
- A && $.length > 0 && g.push(A, ...$), A = null, $ = [];
674
+ }, [y]);
675
+ const Ge = (r, l) => {
676
+ if (!l) return r;
677
+ if (G) {
678
+ const x = [];
679
+ let O = null, Z = [];
680
+ const ee = () => {
681
+ O && Z.length > 0 && x.push(O, ...Z), O = null, Z = [];
680
682
  };
681
- return r.forEach((fe) => {
682
- const le = fe;
683
- if (!!(le || {})?.isGroupHeader) {
684
- Z(), A = le;
683
+ return r.forEach((de) => {
684
+ const t = de;
685
+ if (!!(t || {})?.isGroupHeader) {
686
+ ee(), O = t;
685
687
  return;
686
688
  }
687
- const o = fe, l = k(
688
- o,
689
- T
690
- ), d = Fe(String(l ?? ""), a);
691
- A ? d && $.push(o) : d && g.push(o);
692
- }), Z(), g;
689
+ const c = de, i = k(
690
+ c,
691
+ P
692
+ ), f = Fe(String(i ?? ""), l);
693
+ O ? f && Z.push(c) : f && x.push(c);
694
+ }), ee(), x;
693
695
  }
694
- const i = [];
695
- let u = null, v = [];
696
- const D = () => {
697
- u && v.length > 0 && i.push(u, ...v), u = null, v = [];
696
+ const s = [];
697
+ let u = null, C = [];
698
+ const S = () => {
699
+ u && C.length > 0 && s.push(u, ...C), u = null, C = [];
698
700
  };
699
- return r.forEach((g) => {
700
- if (typeof g != "object" || g === null) return;
701
- if ((g || {})?.isGroupHeader) {
702
- D(), u = g;
701
+ return r.forEach((x) => {
702
+ if (typeof x != "object" || x === null) return;
703
+ if ((x || {})?.isGroupHeader) {
704
+ S(), u = x;
703
705
  return;
704
706
  }
705
- const A = Fe(g.label, a);
706
- u ? A && v.push(g) : A && i.push(g);
707
- }), D(), i;
708
- }, Te = (r) => {
709
- const a = Le(b, r);
710
- if (U(a), j) {
707
+ const O = Fe(x.label, l);
708
+ u ? O && C.push(x) : O && s.push(x);
709
+ }), S(), s;
710
+ }, _e = (r) => {
711
+ const l = Ge(y, r);
712
+ if (U(l), j) {
711
713
  if (r === "") {
712
- Ge();
714
+ Ie();
713
715
  return;
714
716
  }
715
717
  j(r);
716
718
  return;
717
719
  }
718
- K && b && K(r);
719
- }, Ge = _(() => {
720
- if (J) {
721
- J(), U(
722
- b.filter((r) => {
723
- const a = z ? k(r, W) : r.id;
724
- return ne.has(a);
720
+ K && y && K(r);
721
+ }, Ie = _(() => {
722
+ if (Q) {
723
+ Q(), U(
724
+ y.filter((r) => {
725
+ const l = G ? k(r, W) : r.id;
726
+ return re.has(l);
725
727
  })
726
728
  );
727
729
  return;
728
730
  }
729
- K && (K(""), U(b));
731
+ K && (K(""), U(y));
730
732
  }, [
731
- b,
732
- ne,
733
+ y,
734
+ re,
733
735
  W,
734
- J,
736
+ Q,
735
737
  U,
736
738
  K,
737
- z
738
- ]), Pe = (r) => {
739
- r.key === "ArrowDown" ? (r.preventDefault(), m.current?.querySelector(
739
+ G
740
+ ]), L = (r) => {
741
+ r.key === "ArrowDown" ? (r.preventDefault(), p.current?.querySelector(
740
742
  "[role=listitem]"
741
743
  )?.focus()) : (r.key === "Tab" || r.key === "Escape") && setTimeout(() => {
742
744
  F.current?.focus(), se();
743
745
  }, 10);
744
- }, O = (r, a) => {
745
- const i = Array.from(
746
- m.current?.querySelectorAll("[role=listitem]") || []
747
- ), u = i.indexOf(r.currentTarget);
746
+ }, R = (r, l) => {
747
+ const s = Array.from(
748
+ p.current?.querySelectorAll("[role=listitem]") || []
749
+ ), u = s.indexOf(r.currentTarget);
748
750
  if (r.key === "ArrowDown") {
749
751
  r.preventDefault();
750
- const v = u < i.length - 1 ? u + 1 : u;
751
- i[v]?.focus();
752
+ const C = u < s.length - 1 ? u + 1 : u;
753
+ s[C]?.focus();
752
754
  } else if (r.key === "ArrowUp")
753
755
  if (r.preventDefault(), u === 0)
754
- ye && ye.current?.focus();
756
+ ne && ne.current?.focus();
755
757
  else {
756
- const v = u - 1;
757
- i[v]?.focus();
758
+ const C = u - 1;
759
+ s[C]?.focus();
758
760
  }
759
761
  else if (r.key === "Enter" || r.key === " ") {
760
- if (r.preventDefault(), (a || {})?.isGroupHeader || y) return;
761
- xe(a, !h), h || setTimeout(() => {
762
+ if (r.preventDefault(), (l || {})?.isGroupHeader || v) return;
763
+ be(l, !g), g || setTimeout(() => {
762
764
  F.current?.focus(), se();
763
765
  }, 10);
764
766
  } else r.key === "Escape" ? (r.preventDefault(), setTimeout(() => {
@@ -766,12 +768,12 @@ function ft({
766
768
  }, 10)) : r.key === "Tab" && setTimeout(() => {
767
769
  F.current?.focus(), se();
768
770
  }, 10);
769
- }, R = Array.from({ length: 5 }).map(
770
- (r, a) => z ? we.createElement(
771
- V(z, (i, u) => i.isSelected === u.isSelected && i.option === u.option && i.disabled === u.disabled && i.multiple === u.multiple && i.renderContext === u.renderContext),
771
+ }, Ce = Array.from({ length: 5 }).map(
772
+ (r, l) => G ? we.createElement(
773
+ J(G, (s, u) => s.isSelected === u.isSelected && s.option === u.option && s.disabled === u.disabled && s.multiple === u.multiple && s.renderContext === u.renderContext),
772
774
  {
773
- key: `skeleton-option-${a}`,
774
- option: { id: a, label: "", value: "" },
775
+ key: `skeleton-option-${l}`,
776
+ option: { id: l, label: "", value: "" },
775
777
  isSelected: !1,
776
778
  multiple: !1,
777
779
  onSelect: () => {
@@ -780,45 +782,46 @@ function ft({
780
782
  isLoading: !0,
781
783
  renderContext: w
782
784
  }
783
- ) : /* @__PURE__ */ s.jsx(
784
- Be,
785
+ ) : /* @__PURE__ */ a.jsx(
786
+ Ke,
785
787
  {
786
788
  multiple: !1,
787
789
  isLoading: !0,
788
790
  onSelect: () => {
789
791
  },
790
792
  isSelected: !1,
791
- option: { id: a, label: "", value: "" }
793
+ option: { id: l, label: "", value: "" }
792
794
  },
793
795
  `skeleton-option-${// biome-ignore lint/suspicious/noArrayIndexKey: <>
794
- a}`
796
+ l}`
795
797
  )
796
- ), de = /* @__PURE__ */ s.jsx(
798
+ ), ce = /* @__PURE__ */ a.jsx(
797
799
  "div",
798
800
  {
799
801
  tabIndex: 0,
800
- ref: m,
802
+ ref: p,
801
803
  style: { opacity: "0" },
802
- className: c(
804
+ className: d(
803
805
  " z-100! w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-lg shadow-lg",
804
806
  " overflow-hidden focus-visible:bg-neutral-default-hover ",
805
807
  N ? "absolute z-50 " : "fixed z-100 top-0 left-0",
806
- ue.direction === "up" ? "h-auto" : " h-max",
807
- Ie
808
+ ie.direction === "up" ? "h-auto" : " h-max",
809
+ ze,
810
+ "min-w-max"
808
811
  ),
809
- children: /* @__PURE__ */ s.jsxs(
812
+ children: /* @__PURE__ */ a.jsxs(
810
813
  "div",
811
814
  {
812
- className: c(
815
+ className: d(
813
816
  "flex flex-col ",
814
- ve ? "p-0" : "p-2 pt-0 gap-2"
817
+ xe ? "p-0" : "p-2 pt-0 gap-2"
815
818
  ),
816
819
  style: {
817
820
  height: "auto",
818
- maxHeight: ue.height
821
+ maxHeight: ie.height
819
822
  },
820
823
  children: [
821
- !ve && /* @__PURE__ */ s.jsx(
824
+ !xe && /* @__PURE__ */ a.jsx(
822
825
  lt,
823
826
  {
824
827
  name: "",
@@ -826,146 +829,146 @@ function ft({
826
829
  size: "small",
827
830
  tabIndex: 0,
828
831
  value: B,
829
- disabled: y,
830
- ref: ye,
832
+ disabled: v,
833
+ ref: ne,
831
834
  labelVariant: "static",
832
- icon: /* @__PURE__ */ s.jsx(ot, { size: 22 }),
833
- isFetching: Q,
834
- onKeyDown: Pe,
835
- onClear: Ge,
836
- onChange: (r) => Te(r.target.value),
837
- placeholder: ke,
835
+ icon: /* @__PURE__ */ a.jsx(ot, { size: 22 }),
836
+ isFetching: X,
837
+ onKeyDown: L,
838
+ onClear: Ie,
839
+ onChange: (r) => _e(r.target.value),
840
+ placeholder: Oe,
838
841
  className: " bg-neutral-medium-pressed",
839
842
  ...H
840
843
  }
841
844
  ),
842
- /* @__PURE__ */ s.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: oe.length === 0 ? Q ? /* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: De || R }) : /* @__PURE__ */ s.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: B ? `No se encontraron resultados para "${B}"` : ge }) : (() => {
845
+ /* @__PURE__ */ a.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: oe.length === 0 ? X ? /* @__PURE__ */ a.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: De || Ce }) : /* @__PURE__ */ a.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: B ? `No se encontraron resultados para "${B}"` : pe }) : (() => {
843
846
  let r = !0;
844
- return oe.map((a) => {
845
- const i = a, u = !!(i || {}).isGroupHeader, v = z && !u ? k(a, W) : i.id, D = ne.has(v), g = (l) => !z || u ? l : {
846
- id: v,
847
- label: String(k(l, T)),
848
- value: k(l, W)
849
- }, A = (l) => {
850
- u || xe(
851
- g(a),
852
- l === void 0 ? !h : l
847
+ return oe.map((l) => {
848
+ const s = l, u = !!(s || {}).isGroupHeader, C = G && !u ? k(l, W) : s.id, S = re.has(C), x = (i) => !G || u ? i : {
849
+ id: C,
850
+ label: String(k(i, P)),
851
+ value: k(i, W)
852
+ }, O = (i) => {
853
+ u || be(
854
+ x(l),
855
+ i === void 0 ? !g : i
853
856
  );
854
- }, $ = (l) => {
855
- if (xe(l, !h), !h) {
857
+ }, Z = (i) => {
858
+ if (be(i, !g), !g) {
856
859
  if (!K) return;
857
- K(""), U(b);
860
+ K(""), U(y);
858
861
  }
859
- }, Z = (l, d) => {
860
- const S = !!(d || {}).isGroupHeader;
862
+ }, ee = (i, f) => {
863
+ const D = !!(f || {}).isGroupHeader;
861
864
  return (
862
865
  // biome-ignore lint/a11y/useSemanticElements: <>
863
- /* @__PURE__ */ s.jsx(
866
+ /* @__PURE__ */ a.jsx(
864
867
  "div",
865
868
  {
866
869
  tabIndex: 0,
867
870
  role: "listitem",
868
- onKeyDown: (L) => O(L, d),
869
- className: c(
870
- !S && !y && "focus-visible:bg-neutral-medium-hover outline-none hover:bg-neutral-medium-hover",
871
- D && "bg-neutral-medium-selected",
872
- y && "cursor-default pointer-events-none"
871
+ onKeyDown: (M) => R(M, f),
872
+ className: d(
873
+ !D && !v && "focus-visible:bg-neutral-medium-hover outline-none hover:bg-neutral-medium-hover",
874
+ S && "bg-neutral-medium-selected",
875
+ v && "cursor-default pointer-events-none"
873
876
  ),
874
- children: l
877
+ children: i
875
878
  },
876
- d.id
879
+ f.id
877
880
  )
878
881
  );
879
882
  };
880
883
  if (u) {
881
- const l = i.groupLabelNode ?? i.label, d = String(i.id), S = q === !1 ? !0 : Ae(d);
882
- r = S;
883
- const L = i.originalOption, G = i.groupData?.groupOptions ?? [], ee = (I) => {
884
- q && Ee(d, I);
885
- }, me = (I) => {
886
- !G || G.length === 0 || Ce && Ce(G, I);
887
- }, he = G.filter(
888
- (I) => ne.has(k(I, W))
889
- ).map((I) => String(k(I, W)));
890
- if (be) {
891
- const I = V(
892
- be,
893
- (C, M) => C.label === M.label && C.group === M.group && C.groupOptions === M.groupOptions && C.disabled === M.disabled && C.multiple === M.multiple && C.expanded === M.expanded && C.renderContext === M.renderContext
894
- ), x = we.createElement(I, {
895
- group: L,
896
- label: l,
897
- groupOptions: G,
898
- multiple: h,
899
- disabled: y,
900
- expanded: S,
901
- toggleGroup: ee,
884
+ const i = s.groupLabelNode ?? s.label, f = String(s.id), D = q === !1 ? !0 : Te(f);
885
+ r = D;
886
+ const M = s.originalOption, I = s.groupData?.groupOptions ?? [], fe = (m) => {
887
+ q && Le(f, m);
888
+ }, me = (m) => {
889
+ !I || I.length === 0 || ye && ye(I, m);
890
+ }, Se = I.filter(
891
+ (m) => re.has(k(m, W))
892
+ ).map((m) => String(k(m, W)));
893
+ if (ge) {
894
+ const m = J(
895
+ ge,
896
+ (A, T) => A.label === T.label && A.group === T.group && A.groupOptions === T.groupOptions && A.disabled === T.disabled && A.multiple === T.multiple && A.expanded === T.expanded && A.renderContext === T.renderContext
897
+ ), z = we.createElement(m, {
898
+ group: M,
899
+ label: i,
900
+ groupOptions: I,
901
+ multiple: g,
902
+ disabled: v,
903
+ expanded: D,
904
+ toggleGroup: fe,
902
905
  selectGroup: me,
903
906
  renderContext: w,
904
- groupSelectedIds: he
907
+ groupSelectedIds: Se
905
908
  });
906
- return Z(x, i);
909
+ return ee(z, s);
907
910
  }
908
- return Z(
909
- /* @__PURE__ */ s.jsxs("div", { className: "px-3 py-2 text-neutral-medium-default font-medium text-sm w-full flex justify-between", children: [
910
- /* @__PURE__ */ s.jsx("div", { children: l }),
911
- q && /* @__PURE__ */ s.jsx(
911
+ return ee(
912
+ /* @__PURE__ */ a.jsxs("div", { className: "px-3 py-2 text-neutral-medium-default font-medium text-sm w-full flex justify-between", children: [
913
+ /* @__PURE__ */ a.jsx("div", { children: i }),
914
+ q && /* @__PURE__ */ a.jsx(
912
915
  "div",
913
916
  {
914
917
  className: "cursor-pointer",
915
- onClick: () => Ee(d),
916
- children: /* @__PURE__ */ s.jsx(
917
- Re,
918
+ onClick: () => Le(f),
919
+ children: /* @__PURE__ */ a.jsx(
920
+ Ve,
918
921
  {
919
- className: c(
922
+ className: d(
920
923
  "transition-transform duration-300 ease-out",
921
- S ? "rotate-180" : "rotate-0"
924
+ D ? "rotate-180" : "rotate-0"
922
925
  )
923
926
  }
924
927
  )
925
928
  }
926
929
  )
927
930
  ] }),
928
- i
931
+ s
929
932
  );
930
933
  }
931
- const fe = z ? we.createElement(
932
- V(
933
- z,
934
- (l, d) => l.isSelected === d.isSelected && l.option === d.option && l.disabled === d.disabled && l.multiple === d.multiple && l.renderContext === d.renderContext
934
+ const de = G ? we.createElement(
935
+ J(
936
+ G,
937
+ (i, f) => i.isSelected === f.isSelected && i.option === f.option && i.disabled === f.disabled && i.multiple === f.multiple && i.renderContext === f.renderContext
935
938
  ),
936
939
  {
937
- key: v,
938
- option: a,
939
- isSelected: D,
940
- multiple: h,
941
- onSelect: A,
942
- disabled: y,
943
- isLoading: Q,
940
+ key: C,
941
+ option: l,
942
+ isSelected: S,
943
+ multiple: g,
944
+ onSelect: O,
945
+ disabled: v,
946
+ isLoading: X,
944
947
  renderContext: w
945
948
  }
946
- ) : /* @__PURE__ */ s.jsx(
947
- Be,
949
+ ) : /* @__PURE__ */ a.jsx(
950
+ Ke,
948
951
  {
949
- disabled: y,
950
- multiple: h,
951
- isLoading: Q,
952
- isSelected: D,
953
- onSelect: $,
954
- option: a
952
+ disabled: v,
953
+ multiple: g,
954
+ isLoading: X,
955
+ isSelected: S,
956
+ onSelect: Z,
957
+ option: l
955
958
  },
956
- v
957
- ), le = Z(
958
- fe,
959
- g(a)
959
+ C
960
+ ), t = ee(
961
+ de,
962
+ x(l)
960
963
  );
961
964
  if (!q)
962
- return le;
963
- const t = !r, o = le;
964
- return we.cloneElement(o, {
965
- className: c(
966
- o.props.className,
965
+ return t;
966
+ const o = !r, c = t;
967
+ return we.cloneElement(c, {
968
+ className: d(
969
+ c.props.className,
967
970
  "overflow-hidden transition-[max-height] duration-300 ease-out",
968
- t ? "max-h-0" : "max-h-[999px]"
971
+ o ? "max-h-0" : "max-h-[999px]"
969
972
  )
970
973
  });
971
974
  });
@@ -976,80 +979,77 @@ function ft({
976
979
  )
977
980
  }
978
981
  );
979
- return N ? de : Ye(de, document.body);
982
+ return N ? ce : Ye(ce, document.body);
980
983
  }
981
- const mt = V(
984
+ const mt = J(
982
985
  ft,
983
986
  (e, n) => e.options === n.options && e.selectedOptionsIds === n.selectedOptionsIds && e.multiple === n.multiple && e.disabled === n.disabled && e.emptyMessage === n.emptyMessage && e.renderOption === n.renderOption && e.renderOptionContext === n.renderOptionContext && e.isOpen === n.isOpen && e.attachToParent === n.attachToParent && e.optionValue === n.optionValue && e.optionLabel === n.optionLabel && e.filteredOptions === n.filteredOptions && e.isLoading === n.isLoading
984
- ), Be = V(
987
+ ), Ke = J(
985
988
  ({
986
989
  option: e,
987
990
  isSelected: n,
988
- onSelect: f,
989
- multiple: b,
990
- disabled: h,
991
- isLoading: y
991
+ onSelect: h,
992
+ multiple: y,
993
+ disabled: g,
994
+ isLoading: v
992
995
  }) => {
993
- const p = (e || {})?.isGroupHeader;
994
- if (y)
995
- return /* @__PURE__ */ s.jsxs(
996
+ const b = (e || {})?.isGroupHeader;
997
+ if (v)
998
+ return /* @__PURE__ */ a.jsxs(
996
999
  "div",
997
1000
  {
998
1001
  className: "flex gap-2 w-full px-3 py-2 cursor-wait",
999
1002
  children: [
1000
- /* @__PURE__ */ s.jsx(Ue, { className: "size-6 aspect-square" }),
1001
- /* @__PURE__ */ s.jsx(Ue, { className: "flex-1 h-6" })
1003
+ /* @__PURE__ */ a.jsx(Ue, { className: "size-6 aspect-square" }),
1004
+ /* @__PURE__ */ a.jsx(Ue, { className: "flex-1 h-6" })
1002
1005
  ]
1003
1006
  },
1004
1007
  e.id
1005
1008
  );
1006
- const H = (T) => {
1007
- T.preventDefault(), T.stopPropagation(), !(h || p) && f?.(e);
1008
- }, m = p && e.groupLabelNode ? e.groupLabelNode : e.label;
1009
- return (
1010
- // biome-ignore lint/a11y/noStaticElementInteractions: no keyboard interaction needed
1011
- /* @__PURE__ */ s.jsxs(
1012
- "div",
1013
- {
1014
- onMouseDown: H,
1015
- className: c(
1016
- "px-3 py-2 flex items-center transition-colors text-neutral-default-default ",
1017
- p ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
1018
- !p && (n ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover"),
1019
- h && !p && "text-neutral-default-disabled hover:bg-neutral-default-default"
1020
- ),
1021
- children: [
1022
- b && !p && /* @__PURE__ */ s.jsx(rt, { checked: n, disabled: h }),
1023
- /* @__PURE__ */ s.jsx("span", { children: m })
1024
- ]
1025
- },
1026
- e.id
1027
- )
1009
+ const H = (P) => {
1010
+ P.preventDefault(), P.stopPropagation(), !(g || b) && h?.(e);
1011
+ }, p = b && e.groupLabelNode ? e.groupLabelNode : e.label;
1012
+ return /* @__PURE__ */ a.jsxs(
1013
+ "div",
1014
+ {
1015
+ onMouseDown: H,
1016
+ className: d(
1017
+ "px-3 py-2 flex items-center transition-colors text-neutral-default-default ",
1018
+ b ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
1019
+ !b && (n ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover"),
1020
+ g && !b && "text-neutral-default-disabled hover:bg-neutral-default-default"
1021
+ ),
1022
+ children: [
1023
+ y && !b && /* @__PURE__ */ a.jsx(rt, { checked: n, disabled: g }),
1024
+ /* @__PURE__ */ a.jsx("span", { children: p })
1025
+ ]
1026
+ },
1027
+ e.id
1028
1028
  );
1029
1029
  },
1030
1030
  (e, n) => e.isSelected === n.isSelected && e.disabled === n.disabled
1031
1031
  );
1032
- Be.displayName = "DefaultOptionRenderer";
1033
- const Je = V(
1032
+ Ke.displayName = "DefaultOptionRenderer";
1033
+ const Je = J(
1034
1034
  ({
1035
1035
  selectedOptions: e,
1036
1036
  placeholder: n,
1037
- onRemoveOption: f,
1038
- displayMode: b,
1039
- multiple: h,
1040
- className: y,
1041
- disabled: p
1042
- }) => e?.length === 0 ? n ? /* @__PURE__ */ s.jsx("span", { className: "text-neutral-medium-default opacity-50", children: n }) : null : b === "chips" && h ? /* @__PURE__ */ s.jsx("div", { className: c("flex items-center gap-1 ", y), children: e.map((H) => /* @__PURE__ */ s.jsx(
1037
+ onRemoveOption: h,
1038
+ displayMode: y,
1039
+ multiple: g,
1040
+ className: v,
1041
+ disabled: b
1042
+ }) => e?.length === 0 ? n ? /* @__PURE__ */ a.jsx("span", { className: "text-neutral-medium-default opacity-50 line-clamp-1", children: n }) : null : y === "chips" && g ? /* @__PURE__ */ a.jsx("div", { className: d("flex items-center gap-1 ", v), children: e.map((H) => /* @__PURE__ */ a.jsx(
1043
1043
  it,
1044
1044
  {
1045
1045
  tabIndex: -1,
1046
1046
  id: H.id,
1047
1047
  label: H.label,
1048
- onRemove: f,
1049
- disabled: p
1048
+ onRemove: h,
1049
+ disabled: b
1050
1050
  },
1051
1051
  H.id
1052
- )) }) : e?.length === 1 ? /* @__PURE__ */ s.jsx("span", { children: e[0].label }) : /* @__PURE__ */ s.jsxs("span", { children: [
1052
+ )) }) : e?.length === 1 ? /* @__PURE__ */ a.jsx("span", { className: "line-clamp-1", children: e[0].label }) : /* @__PURE__ */ a.jsxs("span", { className: "line-clamp-1", children: [
1053
1053
  e?.length,
1054
1054
  " seleccionados"
1055
1055
  ] }),
@@ -1057,5 +1057,5 @@ const Je = V(
1057
1057
  );
1058
1058
  Je.displayName = "DefaultSelectionDisplay";
1059
1059
  export {
1060
- Ot as default
1060
+ Et as default
1061
1061
  };