prometeo-design-system 2.7.0 → 2.7.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.
@@ -5,7 +5,7 @@ import Ne, { memo as Z, useState as De, useRef as ce, useMemo as oe, useCallback
5
5
  import Xe from "./Spinner.es.js";
6
6
  import { createPortal as Ye } from "react-dom";
7
7
  import { u as Ze } from "./useDragScroll-CHN9OMwn.js";
8
- import { u as et, I as tt } from "./Input-BTsR-vNF.js";
8
+ import { u as et, I as tt } from "./Input-C22kKz7U.js";
9
9
  import { H as nt } from "./HelperComponent-U6mPwuDH.js";
10
10
  import rt from "./CheckBox.es.js";
11
11
  import { Skeleton as Fe } from "./Skeleton.es.js";
@@ -138,14 +138,8 @@ const Ue = (e, n) => {
138
138
  "focus:border-error-default focus:border-2",
139
139
  "focus:ring-0 focus:ring-error-default/20"
140
140
  ),
141
- label: f(
142
- "text-error-light",
143
- "peer-focus:text-error-light"
144
- ),
145
- icon: f(
146
- "text-error-medium-default",
147
- "peer-focus:text-error-light"
148
- )
141
+ label: f("text-error-light", "peer-focus:text-error-light"),
142
+ icon: f("text-error-medium-default", "peer-focus:text-error-light")
149
143
  },
150
144
  success: {
151
145
  container: "",
@@ -154,14 +148,8 @@ const Ue = (e, n) => {
154
148
  "focus:border-success-default focus:border-2",
155
149
  "focus:ring-0 focus:ring-success-default/20"
156
150
  ),
157
- label: f(
158
- "text-success",
159
- "peer-focus:text-success-light"
160
- ),
161
- icon: f(
162
- "text-success-medium-default",
163
- "peer-focus:text-success-light"
164
- )
151
+ label: f("text-success", "peer-focus:text-success-light"),
152
+ icon: f("text-success-medium-default", "peer-focus:text-success-light")
165
153
  }
166
154
  }, Be = {
167
155
  input: f(
@@ -179,8 +167,10 @@ const Ue = (e, n) => {
179
167
  )
180
168
  };
181
169
  function at(e) {
182
- const [n, m] = De(!1), [i, u] = De([]), [v, h] = De(""), j = ce(null), p = ce(null), b = ce(null), k = ce(null), I = ce(() => {
183
- }), W = ce(null), A = ce(/* @__PURE__ */ new Set()), {
170
+ const [n, m] = De(!1), [i, u] = De([]), [v, h] = De(""), j = ce(null), p = ce(null), b = ce(null), k = ce(null), I = ce(
171
+ () => {
172
+ }
173
+ ), W = ce(null), A = ce(/* @__PURE__ */ new Set()), {
184
174
  id: x,
185
175
  name: S,
186
176
  label: M,
@@ -232,32 +222,33 @@ function at(e) {
232
222
  }
233
223
  }, a = n || pe ? "active" : "default";
234
224
  return t[ie][a];
235
- }, T = U((t) => ({
236
- id: G(t, E),
237
- value: G(t, E),
238
- label: G(t, de)
239
- }), [E, de]), Y = oe(
240
- () => st(K),
241
- [K]
242
- ), ge = oe(
225
+ }, T = U(
226
+ (t) => ({
227
+ id: G(t, E),
228
+ value: G(t, E),
229
+ label: G(t, de)
230
+ }),
231
+ [E, de]
232
+ ), Y = oe(() => st(K), [K]), ge = oe(
243
233
  () => Y.map(T),
244
234
  [Y, T]
245
- ), r = oe(
246
- () => {
247
- const t = [];
248
- if (e.multiple)
249
- e.value?.forEach((a) => {
250
- const l = Y?.find((g) => G(g, E) === a);
251
- l && t.push(l);
252
- });
253
- else {
254
- const a = Y?.find((l) => G(l, E) === e.value);
255
- a && t.push(a);
256
- }
257
- return t;
258
- },
259
- [e.value, E, Y, e.multiple]
260
- ), o = oe(
235
+ ), r = oe(() => {
236
+ const t = [];
237
+ if (e.multiple)
238
+ e.value?.forEach((a) => {
239
+ const l = Y?.find(
240
+ (g) => G(g, E) === a
241
+ );
242
+ l && t.push(l);
243
+ });
244
+ else {
245
+ const a = Y?.find(
246
+ (l) => G(l, E) === e.value
247
+ );
248
+ a && t.push(a);
249
+ }
250
+ return t;
251
+ }, [e.value, E, Y, e.multiple]), o = oe(
261
252
  () => r.map(T),
262
253
  [r, T]
263
254
  ), c = oe(
@@ -288,7 +279,9 @@ function at(e) {
288
279
  }, [K, E, J, T]), w = U(
289
280
  (t, a) => {
290
281
  if (!t || t.length === 0) return;
291
- const l = t.map((C) => T(C));
282
+ const l = t.map(
283
+ (C) => T(C)
284
+ );
292
285
  if (!e.multiple) {
293
286
  const C = l[0];
294
287
  if (!C) return;
@@ -302,12 +295,16 @@ function at(e) {
302
295
  const D = ge.find((B) => B.value === C);
303
296
  D && H.push(D);
304
297
  });
305
- const $ = new Set(H.map((C) => C.id)), P = new Set(l.map((C) => C.id)), le = l.every((C) => $.has(C.id)), xe = a ?? "toggle", ye = xe === "select" || xe === "toggle" && !le;
298
+ const $ = new Set(H.map((C) => C.id)), P = new Set(l.map((C) => C.id)), le = l.every(
299
+ (C) => $.has(C.id)
300
+ ), xe = a ?? "toggle", ye = xe === "select" || xe === "toggle" && !le;
306
301
  let _;
307
302
  if (!ye)
308
303
  _ = H.filter((C) => !P.has(C.id));
309
304
  else {
310
- const C = new Map(H.map((D) => [D.id, D]));
305
+ const C = new Map(
306
+ H.map((D) => [D.id, D])
307
+ );
311
308
  l.forEach((D) => {
312
309
  C.set(D.id, D);
313
310
  }), _ = Array.from(C.values());
@@ -332,26 +329,48 @@ function at(e) {
332
329
  else {
333
330
  const a = e.value || [], l = [], g = a.includes(t.value);
334
331
  a.forEach(($) => {
335
- const P = ge.find((le) => le.value === $);
332
+ const P = ge.find(
333
+ (le) => le.value === $
334
+ );
336
335
  P && l.push(P);
337
336
  });
338
337
  const H = g ? l.filter(($) => $.value !== t.value) : [...l, t];
339
338
  e.onChange?.(H, S);
340
339
  }
341
340
  };
342
- const y = U((t, a = !1) => {
343
- X?.(t, S), I.current?.(t), a && (m(!1), Se?.());
344
- }, [X, Se, S]), R = (t) => {
341
+ const y = U(
342
+ (t, a = !1) => {
343
+ X?.(t, S), I.current?.(t), a && (m(!1), Se?.());
344
+ },
345
+ [X, Se, S]
346
+ ), R = (t) => {
345
347
  t.preventDefault(), t.stopPropagation(), t.target.blur(), me?.(), e.multiple ? e.onChange?.([], S) : e.onChange?.(void 0, S);
346
- }, q = U((t) => {
347
- e.multiple || e.onChange?.(void 0, S);
348
- const a = Y.find((g) => G(g, E) === t);
349
- if (!a) return;
350
- const l = T(a);
351
- X?.(l, S), I.current?.(l), ke?.(a);
352
- }, [X, ke, Y, S, e.multiple, e.onChange, T, E]), re = U((t) => {
353
- q(t);
354
- }, [q]);
348
+ }, q = U(
349
+ (t) => {
350
+ e.multiple || e.onChange?.(void 0, S);
351
+ const a = Y.find(
352
+ (g) => G(g, E) === t
353
+ );
354
+ if (!a) return;
355
+ const l = T(a);
356
+ X?.(l, S), I.current?.(l), ke?.(a);
357
+ },
358
+ [
359
+ X,
360
+ ke,
361
+ Y,
362
+ S,
363
+ e.multiple,
364
+ e.onChange,
365
+ T,
366
+ E
367
+ ]
368
+ ), re = U(
369
+ (t) => {
370
+ q(t);
371
+ },
372
+ [q]
373
+ );
355
374
  ve(() => {
356
375
  if (!n) return;
357
376
  const t = (a) => {
@@ -376,20 +395,24 @@ function at(e) {
376
395
  } catch {
377
396
  }
378
397
  });
379
- }, [n]), Qe(V, () => ({
380
- open: () => {
381
- !n && m(!0);
382
- },
383
- close: () => {
384
- n && m(!1);
385
- },
386
- toggle: () => m((t) => !t),
387
- handleOptionSelect: y,
388
- subscribeOpenChange: (t) => (A.current.add(t), () => {
389
- A.current.delete(t);
398
+ }, [n]), Qe(
399
+ V,
400
+ () => ({
401
+ open: () => {
402
+ !n && m(!0);
403
+ },
404
+ close: () => {
405
+ n && m(!1);
406
+ },
407
+ toggle: () => m((t) => !t),
408
+ handleOptionSelect: y,
409
+ subscribeOpenChange: (t) => (A.current.add(t), () => {
410
+ A.current.delete(t);
411
+ }),
412
+ searchInputRef: b
390
413
  }),
391
- searchInputRef: b
392
- }), [n, y]);
414
+ [n, y]
415
+ );
393
416
  const be = (t) => {
394
417
  t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !ze && !n && (m(!0), setTimeout(() => {
395
418
  b.current?.focus();
@@ -402,10 +425,7 @@ function at(e) {
402
425
  return /* @__PURE__ */ s.jsxs(
403
426
  "div",
404
427
  {
405
- className: f(
406
- "relative bg-inherit select-none w-full",
407
- z
408
- ),
428
+ className: f("relative bg-inherit select-none w-full", z),
409
429
  ref: j,
410
430
  draggable: !1,
411
431
  style: Ge,
@@ -451,7 +471,9 @@ function at(e) {
451
471
  /* @__PURE__ */ s.jsx(
452
472
  "div",
453
473
  {
454
- className: f("flex-1 overflow-x-auto overflow-y-hidden px-1 prometeo-scrollbar-none "),
474
+ className: f(
475
+ "flex-1 overflow-x-auto overflow-y-hidden px-1 prometeo-scrollbar-none "
476
+ ),
455
477
  ref: Te,
456
478
  onPointerUp: ne.onPointerUp,
457
479
  onPointerDown: ne.onPointerDown,
@@ -479,14 +501,24 @@ function at(e) {
479
501
  placeholder: $e,
480
502
  onRemoveOption: q,
481
503
  multiple: e.multiple || !1,
482
- className: f(Ke === "scroll" ? "flex-nowrap" : "flex-wrap"),
504
+ className: f(
505
+ Ke === "scroll" ? "flex-nowrap" : "flex-wrap"
506
+ ),
483
507
  disabled: te
484
508
  }
485
509
  )
486
510
  }
487
511
  ),
488
512
  /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
489
- he && /* @__PURE__ */ s.jsx(Xe, { size: "small", variant: "clip", className: " translate-y-1", speedMultiplier: 0.7 }),
513
+ he && /* @__PURE__ */ s.jsx(
514
+ Xe,
515
+ {
516
+ size: "small",
517
+ variant: "clip",
518
+ className: " translate-y-1",
519
+ speedMultiplier: 0.7
520
+ }
521
+ ),
490
522
  pe && me && /* @__PURE__ */ s.jsx(
491
523
  "button",
492
524
  {
@@ -495,7 +527,16 @@ function at(e) {
495
527
  },
496
528
  type: "button",
497
529
  tabIndex: -1,
498
- children: /* @__PURE__ */ s.jsx(je.Cancel, { size: 20, className: f(" cursor-pointer transition-all", Re[F].icon) })
530
+ children: /* @__PURE__ */ s.jsx(
531
+ je.Cancel,
532
+ {
533
+ size: 20,
534
+ className: f(
535
+ " cursor-pointer transition-all",
536
+ Re[F].icon
537
+ )
538
+ }
539
+ )
499
540
  }
500
541
  ),
501
542
  /* @__PURE__ */ s.jsx(
@@ -609,12 +650,23 @@ function ut({
609
650
  enableGroupToggle: X = !0,
610
651
  onGroupSelectChange: Se
611
652
  }) {
612
- const me = e ? 380 : 320, te = W === "static" ? m !== "" ? -20 : 4 : 7, F = U(() => N ? N.endsWith("px") ? Number(N.replace("px", "")) : N.endsWith("vh") ? window.innerHeight * Number(N.replace("vh", "")) / 100 : N.endsWith("%") ? window.innerHeight * Number(N.replace("%", "")) / 100 : me : me, [N, me])(), [he, Me] = De({ direction: "down", height: F }), [we, ie] = De(() => /* @__PURE__ */ new Set()), ze = U((r) => !we.has(r), [we]), Oe = U((r, o) => {
613
- ie((c) => {
614
- const d = new Set(c), w = d.has(r);
615
- return (o === void 0 ? !w : !o) ? d.add(r) : d.delete(r), d;
616
- });
617
- }, []), Le = (r) => {
653
+ const me = e ? 380 : 320, te = W === "static" ? m !== "" ? -20 : 4 : 7, F = U(() => N ? N.endsWith("px") ? Number(N.replace("px", "")) : N.endsWith("vh") ? window.innerHeight * Number(N.replace("vh", "")) / 100 : N.endsWith("%") ? window.innerHeight * Number(N.replace("%", "")) / 100 : me : me, [N, me])(), [he, Me] = De({
654
+ direction: "down",
655
+ height: F
656
+ }), [we, ie] = De(
657
+ () => /* @__PURE__ */ new Set()
658
+ ), ze = U(
659
+ (r) => !we.has(r),
660
+ [we]
661
+ ), Oe = U(
662
+ (r, o) => {
663
+ ie((c) => {
664
+ const d = new Set(c), w = d.has(r);
665
+ return (o === void 0 ? !w : !o) ? d.add(r) : d.delete(r), d;
666
+ });
667
+ },
668
+ []
669
+ ), Le = (r) => {
618
670
  if (!p.current || !h.current) return;
619
671
  const o = h.current.getBoundingClientRect();
620
672
  switch (r || he.direction) {
@@ -671,7 +723,10 @@ function ut({
671
723
  re(), R = ue;
672
724
  return;
673
725
  }
674
- const a = be, l = G(a, b), g = Ue(String(l ?? ""), o);
726
+ const a = be, l = G(
727
+ a,
728
+ b
729
+ ), g = Ue(String(l ?? ""), o);
675
730
  R ? g && q.push(a) : g && y.push(a);
676
731
  }), re(), y;
677
732
  }
@@ -710,12 +765,24 @@ function ut({
710
765
  return;
711
766
  }
712
767
  z && (z(""), Q(i));
713
- }, [i, ae, k, K, Q, z, x]), Pe = (r) => {
714
- r.key === "ArrowDown" ? (r.preventDefault(), p.current?.querySelector("[role=listitem]")?.focus()) : (r.key === "Tab" || r.key === "Escape") && setTimeout(() => {
768
+ }, [
769
+ i,
770
+ ae,
771
+ k,
772
+ K,
773
+ Q,
774
+ z,
775
+ x
776
+ ]), Pe = (r) => {
777
+ r.key === "ArrowDown" ? (r.preventDefault(), p.current?.querySelector(
778
+ "[role=listitem]"
779
+ )?.focus()) : (r.key === "Tab" || r.key === "Escape") && setTimeout(() => {
715
780
  J.current?.focus(), fe();
716
781
  }, 10);
717
782
  }, T = (r, o) => {
718
- const c = Array.from(p.current?.querySelectorAll("[role=listitem]") || []), d = c.indexOf(r.currentTarget);
783
+ const c = Array.from(
784
+ p.current?.querySelectorAll("[role=listitem]") || []
785
+ ), d = c.indexOf(r.currentTarget);
719
786
  if (r.key === "ArrowDown") {
720
787
  r.preventDefault();
721
788
  const w = d < c.length - 1 ? d + 1 : d;
@@ -737,35 +804,34 @@ function ut({
737
804
  }, 10)) : r.key === "Tab" && setTimeout(() => {
738
805
  J.current?.focus(), fe();
739
806
  }, 10);
740
- }, Y = Array.from({ length: 5 }).map((r, o) => x ? Ne.createElement(
741
- Z(
742
- x,
743
- (c, d) => c.isSelected === d.isSelected && c.option === d.option && c.disabled === d.disabled && c.multiple === d.multiple && c.renderContext === d.renderContext
744
- ),
745
- {
746
- key: `skeleton-option-${o}`,
747
- option: { id: o, label: "", value: "" },
748
- isSelected: !1,
749
- multiple: !1,
750
- onSelect: () => {
751
- },
752
- disabled: !1,
753
- isLoading: !0,
754
- renderContext: S
755
- }
756
- ) : /* @__PURE__ */ s.jsx(
757
- We,
758
- {
759
- multiple: !1,
760
- isLoading: !0,
761
- onSelect: () => {
807
+ }, Y = Array.from({ length: 5 }).map(
808
+ (r, o) => x ? Ne.createElement(
809
+ Z(x, (c, d) => c.isSelected === d.isSelected && c.option === d.option && c.disabled === d.disabled && c.multiple === d.multiple && c.renderContext === d.renderContext),
810
+ {
811
+ key: `skeleton-option-${o}`,
812
+ option: { id: o, label: "", value: "" },
813
+ isSelected: !1,
814
+ multiple: !1,
815
+ onSelect: () => {
816
+ },
817
+ disabled: !1,
818
+ isLoading: !0,
819
+ renderContext: S
820
+ }
821
+ ) : /* @__PURE__ */ s.jsx(
822
+ We,
823
+ {
824
+ multiple: !1,
825
+ isLoading: !0,
826
+ onSelect: () => {
827
+ },
828
+ isSelected: !1,
829
+ option: { id: o, label: "", value: "" }
762
830
  },
763
- isSelected: !1,
764
- option: { id: o, label: "", value: "" }
765
- },
766
- `skeleton-option-${// biome-ignore lint/suspicious/noArrayIndexKey: <>
767
- o}`
768
- )), ge = /* @__PURE__ */ s.jsx(
831
+ `skeleton-option-${// biome-ignore lint/suspicious/noArrayIndexKey: <>
832
+ o}`
833
+ )
834
+ ), ge = /* @__PURE__ */ s.jsx(
769
835
  "div",
770
836
  {
771
837
  tabIndex: 0,
@@ -805,7 +871,7 @@ function ut({
805
871
  isFetching: ee,
806
872
  onKeyDown: Pe,
807
873
  onClear: Ie,
808
- onChange: $e,
874
+ onChange: (r) => $e(r.target.value),
809
875
  placeholder: ke,
810
876
  className: " bg-neutral-medium-pressed",
811
877
  ...j
@@ -819,7 +885,10 @@ function ut({
819
885
  label: String(G(l, b)),
820
886
  value: G(l, k)
821
887
  }, R = (l) => {
822
- d || se(y(o), l === void 0 ? !u : l);
888
+ d || se(
889
+ y(o),
890
+ l === void 0 ? !u : l
891
+ );
823
892
  }, q = (l) => {
824
893
  if (se(l, !u), !u) {
825
894
  if (!z) return;
@@ -853,7 +922,9 @@ function ut({
853
922
  X && Oe(g, _);
854
923
  }, xe = (_) => {
855
924
  !P || P.length === 0 || Se && Se(P, _);
856
- }, ye = P.filter((_) => ae.has(G(_, k))).map((_) => String(G(_, k)));
925
+ }, ye = P.filter(
926
+ (_) => ae.has(G(_, k))
927
+ ).map((_) => String(G(_, k)));
857
928
  if (M) {
858
929
  const _ = Z(
859
930
  M,
@@ -873,13 +944,14 @@ function ut({
873
944
  return re(C, c);
874
945
  }
875
946
  return re(
876
- /* @__PURE__ */ s.jsxs(
877
- "div",
878
- {
879
- className: "px-3 py-2 text-neutral-medium-default font-medium text-sm w-full flex justify-between",
880
- children: [
881
- /* @__PURE__ */ s.jsx("div", { children: l }),
882
- X && /* @__PURE__ */ s.jsx("div", { className: "cursor-pointer", onClick: () => Oe(g), children: /* @__PURE__ */ s.jsx(
947
+ /* @__PURE__ */ s.jsxs("div", { className: "px-3 py-2 text-neutral-medium-default font-medium text-sm w-full flex justify-between", children: [
948
+ /* @__PURE__ */ s.jsx("div", { children: l }),
949
+ X && /* @__PURE__ */ s.jsx(
950
+ "div",
951
+ {
952
+ className: "cursor-pointer",
953
+ onClick: () => Oe(g),
954
+ children: /* @__PURE__ */ s.jsx(
883
955
  je.ChevronDown,
884
956
  {
885
957
  className: f(
@@ -887,10 +959,10 @@ function ut({
887
959
  H ? "rotate-180" : "rotate-0"
888
960
  )
889
961
  }
890
- ) })
891
- ]
892
- }
893
- ),
962
+ )
963
+ }
964
+ )
965
+ ] }),
894
966
  c
895
967
  );
896
968
  }
@@ -920,20 +992,20 @@ function ut({
920
992
  option: o
921
993
  },
922
994
  w
923
- ), ue = re(be, y(o));
995
+ ), ue = re(
996
+ be,
997
+ y(o)
998
+ );
924
999
  if (!X)
925
1000
  return ue;
926
1001
  const t = !r, a = ue;
927
- return Ne.cloneElement(
928
- a,
929
- {
930
- className: f(
931
- a.props.className,
932
- "overflow-hidden transition-[max-height] duration-300 ease-out",
933
- t ? "max-h-0" : "max-h-[999px]"
934
- )
935
- }
936
- );
1002
+ return Ne.cloneElement(a, {
1003
+ className: f(
1004
+ a.props.className,
1005
+ "overflow-hidden transition-[max-height] duration-300 ease-out",
1006
+ t ? "max-h-0" : "max-h-[999px]"
1007
+ )
1008
+ });
937
1009
  });
938
1010
  })() }),
939
1011
  e && /* @__PURE__ */ s.jsx("div", { className: "border-t border-neutral-strong-default p-2", children: e })
@@ -944,58 +1016,83 @@ function ut({
944
1016
  );
945
1017
  return E ? ge : Ye(ge, document.body);
946
1018
  }
947
- const ct = Z(ut, (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), We = Z(({ option: e, isSelected: n, onSelect: m, multiple: i, disabled: u, isLoading: v }) => {
948
- const h = e.isGroupHeader;
949
- if (v)
950
- return /* @__PURE__ */ s.jsxs("div", { className: "flex gap-2 w-full px-3 py-2 cursor-wait", children: [
951
- /* @__PURE__ */ s.jsx(Fe, { className: "size-6 aspect-square" }),
952
- /* @__PURE__ */ s.jsx(Fe, { className: "flex-1 h-6" })
953
- ] }, e.id);
954
- const j = (b) => {
955
- b.preventDefault(), b.stopPropagation(), !(u || h) && m?.(e);
956
- }, p = h && e.groupLabelNode ? e.groupLabelNode : e.label;
957
- return (
958
- // biome-ignore lint/a11y/noStaticElementInteractions: no keyboard interaction needed
959
- /* @__PURE__ */ s.jsxs(
960
- "div",
961
- {
962
- onMouseDown: j,
963
- className: f(
964
- "px-3 py-2 flex items-center transition-colors text-neutral-default-default ",
965
- h ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
966
- !h && (n ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover"),
967
- u && !h && "text-neutral-default-disabled hover:bg-neutral-default-default"
968
- ),
969
- children: [
970
- i && !h && /* @__PURE__ */ s.jsx(
971
- rt,
972
- {
973
- checked: n,
974
- disabled: u
975
- }
1019
+ const ct = Z(
1020
+ ut,
1021
+ (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
1022
+ ), We = Z(
1023
+ ({
1024
+ option: e,
1025
+ isSelected: n,
1026
+ onSelect: m,
1027
+ multiple: i,
1028
+ disabled: u,
1029
+ isLoading: v
1030
+ }) => {
1031
+ const h = e.isGroupHeader;
1032
+ if (v)
1033
+ return /* @__PURE__ */ s.jsxs(
1034
+ "div",
1035
+ {
1036
+ className: "flex gap-2 w-full px-3 py-2 cursor-wait",
1037
+ children: [
1038
+ /* @__PURE__ */ s.jsx(Fe, { className: "size-6 aspect-square" }),
1039
+ /* @__PURE__ */ s.jsx(Fe, { className: "flex-1 h-6" })
1040
+ ]
1041
+ },
1042
+ e.id
1043
+ );
1044
+ const j = (b) => {
1045
+ b.preventDefault(), b.stopPropagation(), !(u || h) && m?.(e);
1046
+ }, p = h && e.groupLabelNode ? e.groupLabelNode : e.label;
1047
+ return (
1048
+ // biome-ignore lint/a11y/noStaticElementInteractions: no keyboard interaction needed
1049
+ /* @__PURE__ */ s.jsxs(
1050
+ "div",
1051
+ {
1052
+ onMouseDown: j,
1053
+ className: f(
1054
+ "px-3 py-2 flex items-center transition-colors text-neutral-default-default ",
1055
+ h ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
1056
+ !h && (n ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover"),
1057
+ u && !h && "text-neutral-default-disabled hover:bg-neutral-default-default"
976
1058
  ),
977
- /* @__PURE__ */ s.jsx("span", { children: p })
978
- ]
979
- },
980
- e.id
981
- )
982
- );
983
- }, (e, n) => e.isSelected === n.isSelected && e.disabled === n.disabled);
1059
+ children: [
1060
+ i && !h && /* @__PURE__ */ s.jsx(rt, { checked: n, disabled: u }),
1061
+ /* @__PURE__ */ s.jsx("span", { children: p })
1062
+ ]
1063
+ },
1064
+ e.id
1065
+ )
1066
+ );
1067
+ },
1068
+ (e, n) => e.isSelected === n.isSelected && e.disabled === n.disabled
1069
+ );
984
1070
  We.displayName = "DefaultOptionRenderer";
985
- const Je = Z(({ selectedOptions: e, placeholder: n, onRemoveOption: m, displayMode: i, multiple: u, className: v, disabled: h }) => e?.length === 0 ? n ? /* @__PURE__ */ s.jsx("span", { className: "text-neutral-medium-default opacity-50", children: n }) : null : i === "chips" && u ? /* @__PURE__ */ s.jsx("div", { className: f("flex items-center gap-1 ", v), children: e.map((j) => /* @__PURE__ */ s.jsx(
986
- ot,
987
- {
988
- tabIndex: -1,
989
- id: j.id,
990
- label: j.label,
991
- onRemove: m,
1071
+ const Je = Z(
1072
+ ({
1073
+ selectedOptions: e,
1074
+ placeholder: n,
1075
+ onRemoveOption: m,
1076
+ displayMode: i,
1077
+ multiple: u,
1078
+ className: v,
992
1079
  disabled: h
993
- },
994
- j.id
995
- )) }) : e?.length === 1 ? /* @__PURE__ */ s.jsx("span", { children: e[0].label }) : /* @__PURE__ */ s.jsxs("span", { children: [
996
- e?.length,
997
- " seleccionados"
998
- ] }), (e, n) => e.selectedOptions === n.selectedOptions && e.disabled === n.disabled);
1080
+ }) => e?.length === 0 ? n ? /* @__PURE__ */ s.jsx("span", { className: "text-neutral-medium-default opacity-50", children: n }) : null : i === "chips" && u ? /* @__PURE__ */ s.jsx("div", { className: f("flex items-center gap-1 ", v), children: e.map((j) => /* @__PURE__ */ s.jsx(
1081
+ ot,
1082
+ {
1083
+ tabIndex: -1,
1084
+ id: j.id,
1085
+ label: j.label,
1086
+ onRemove: m,
1087
+ disabled: h
1088
+ },
1089
+ j.id
1090
+ )) }) : e?.length === 1 ? /* @__PURE__ */ s.jsx("span", { children: e[0].label }) : /* @__PURE__ */ s.jsxs("span", { children: [
1091
+ e?.length,
1092
+ " seleccionados"
1093
+ ] }),
1094
+ (e, n) => e.selectedOptions === n.selectedOptions && e.disabled === n.disabled
1095
+ );
999
1096
  Je.displayName = "DefaultSelectionDisplay";
1000
1097
  export {
1001
1098
  St as S,