prometeo-design-system 4.4.0 → 4.4.3

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