prometeo-design-system 2.3.1 → 2.3.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.
Files changed (62) hide show
  1. package/dist/Avatar.es.js +1 -1
  2. package/dist/{Button-Bc0LYLfg.js → Button-DsbEyjth.js} +1 -1
  3. package/dist/Button.es.js +1 -1
  4. package/dist/{CardProfile-BiYr6kY9.js → CardProfile-BhFog7j5.js} +1 -1
  5. package/dist/CardProfile.es.js +1 -1
  6. package/dist/CheckBox.es.js +1 -1
  7. package/dist/CheckboxFormik.es.js +1 -1
  8. package/dist/DatePicker.es.js +2 -2
  9. package/dist/DialogModal.es.js +35 -31
  10. package/dist/DrawerDesktop.es.js +2 -2
  11. package/dist/DrawerMobile.es.js +1 -1
  12. package/dist/DropZone.es.js +1 -1
  13. package/dist/Header.es.js +1 -1
  14. package/dist/Icons/Icons.d.ts +48 -46
  15. package/dist/Icons.es.js +93 -90
  16. package/dist/Image.es.js +1 -1
  17. package/dist/ImageGallery-DnoRTpCr.js +317 -0
  18. package/dist/ImageGallery.es.js +1 -1
  19. package/dist/Input.es.js +1 -1
  20. package/dist/InputFormik.es.js +1 -1
  21. package/dist/InputMultiple.es.js +1 -1
  22. package/dist/{LayoutGeneric-jDE96L2N.js → LayoutGeneric-p4Pll4Cm.js} +1 -1
  23. package/dist/LayoutGeneric.es.js +1 -1
  24. package/dist/Logo.es.js +1 -1
  25. package/dist/Menu.es.js +1 -1
  26. package/dist/OtpInput.es.js +1 -1
  27. package/dist/Pagination.es.js +1 -1
  28. package/dist/ProfilePictureUpload.es.js +1 -1
  29. package/dist/ProgressBar.es.js +1 -1
  30. package/dist/SegmentedButton.es.js +1 -1
  31. package/dist/Select.es.js +368 -185
  32. package/dist/SelectFormik.es.js +90 -72
  33. package/dist/Skeleton.es.js +35 -34
  34. package/dist/Spinner.es.js +1 -1
  35. package/dist/Steps.es.js +1 -1
  36. package/dist/SwipeContainer.es.js +1 -1
  37. package/dist/Switch.es.js +31 -28
  38. package/dist/TabLinks.es.js +35 -33
  39. package/dist/Table.es.js +1 -1
  40. package/dist/TextArea.es.js +1 -1
  41. package/dist/Tooltip.es.js +1 -1
  42. package/dist/components/Dialog/Dialog.d.ts +7 -6
  43. package/dist/components/Dialog/useDialogControl.d.ts +4 -3
  44. package/dist/components/Select/Select.d.ts +33 -13
  45. package/dist/components/SelectFormik/SelectFormik.d.ts +4 -2
  46. package/dist/components/Skeleton/Skeleton.d.ts +5 -2
  47. package/dist/components/Switch/Switch.d.ts +5 -2
  48. package/dist/components/TabLinks/TabLinks.d.ts +2 -2
  49. package/dist/exports/Select.d.ts +1 -1
  50. package/dist/hooks/useDragScroll.d.ts +29 -0
  51. package/dist/hooks/useLabelBackground.d.ts +5 -0
  52. package/dist/index.d.ts +8 -8
  53. package/dist/{jsx-runtime-ByW6EXIE.js → jsx-runtime-DKDX3adD.js} +94 -96
  54. package/dist/pages/SelectsPage.d.ts +2 -0
  55. package/dist/prometeo-design-system.css +1 -1
  56. package/dist/prometeo-design-system.es.js +6 -6
  57. package/dist/useDragScroll-CHN9OMwn.js +165 -0
  58. package/package.json +4 -4
  59. package/src/styles/intellisense.css +5 -0
  60. package/dist/ImageGallery-O5Y4oBrD.js +0 -352
  61. package/dist/lib/utils.d.ts +0 -1
  62. package/dist/preview/Select.d.ts +0 -2
package/dist/Select.es.js CHANGED
@@ -1,211 +1,394 @@
1
- import { j as t } from "./jsx-runtime-ByW6EXIE.js";
2
- import { Icons as w } from "./Icons.es.js";
3
- import { c as o } from "./cn-B6yFEsav.js";
4
- import { memo as se, useState as y, useRef as re, useEffect as oe } from "react";
5
- import le from "./Spinner.es.js";
6
- const ae = ({
7
- label: I,
8
- onOptionClick: z,
9
- value: u = [],
10
- isFetching: O = !1,
11
- options: p,
12
- multiple: d = !0,
13
- onClear: N,
14
- onClose: P,
15
- className: k,
16
- id: D,
17
- emptyMessage: B = "No hay opciones disponibles",
18
- optionValue: a,
19
- optionLabel: x,
20
- renderOption: E,
21
- placeholder: F,
22
- renderSelection: H,
23
- containerClassName: M,
24
- buttonClassName: L,
25
- dropdownClassName: A,
26
- displayMode: C = "compact",
27
- onRemoveOption: T,
28
- width: f = "100%",
1
+ import { j as r } from "./jsx-runtime-DKDX3adD.js";
2
+ import { Icons as T } from "./Icons.es.js";
3
+ import { c as p } from "./cn-B6yFEsav.js";
4
+ import Z, { useRef as $, useLayoutEffect as me, memo as S, useState as V, useMemo as Y, useEffect as U, useCallback as R } from "react";
5
+ import xe from "./Spinner.es.js";
6
+ import { createPortal as ge } from "react-dom";
7
+ import { u as pe } from "./useDragScroll-CHN9OMwn.js";
8
+ const ye = (n) => {
9
+ let t = n;
10
+ for (; t && t !== document.body; ) {
11
+ const s = window.getComputedStyle(t).backgroundColor;
12
+ if (s && s !== "transparent" && s !== "rgba(0, 0, 0, 0)")
13
+ return s;
14
+ t = t.parentElement;
15
+ }
16
+ const o = window.getComputedStyle(document.body).backgroundColor;
17
+ return o && o !== "transparent" && o !== "rgba(0, 0, 0, 0)" ? o : "rgb(255, 255, 255)";
18
+ };
19
+ function he() {
20
+ const n = $(null);
21
+ return me(() => {
22
+ if (!n.current || !n.current.parentElement) return;
23
+ const t = ye(n.current.parentElement);
24
+ n.current.style.backgroundColor = t;
25
+ }, []), {
26
+ ref: n
27
+ };
28
+ }
29
+ function x(n, t) {
30
+ if (typeof t == "function")
31
+ return t(n);
32
+ const o = t.split(".");
33
+ let c = n;
34
+ for (const s of o)
35
+ if (c && typeof c == "object" && s in c)
36
+ c = c[s];
37
+ else
38
+ return;
39
+ return c;
40
+ }
41
+ const be = ({
42
+ label: n,
43
+ onOptionClick: t,
44
+ value: o = [],
45
+ isFetching: c = !1,
46
+ options: s,
47
+ multiple: i = !1,
48
+ onClear: g,
49
+ onClose: y,
50
+ className: u,
51
+ id: w,
52
+ emptyMessage: C = "No hay opciones disponibles",
53
+ optionValue: d,
54
+ optionLabel: h,
55
+ renderOption: M,
56
+ placeholder: j,
57
+ renderSelection: P,
58
+ containerClassName: B,
59
+ buttonClassName: k,
60
+ dropdownClassName: G,
61
+ displayMode: H = "compact",
62
+ onRemoveOption: E,
63
+ width: a = "100%",
29
64
  height: l,
30
- labelVariant: c = "default"
65
+ labelVariant: f = "default",
66
+ attachToParent: D = !1,
67
+ name: b,
68
+ overflow: ne = "wrap",
69
+ onChange: O
31
70
  }) => {
32
- const [r, h] = y(!1), [g, b] = y(!1), [$, R] = y("down"), i = re(null), m = u && u.length > 0, q = p?.filter((e) => u.includes(a(e))), G = () => c === "static" || r || m || g ? "-top-2 left-2 scale-90" : "top-1/2 -translate-y-1/2 scale-100", j = {};
33
- f && f !== "100%" && (j.width = f), l && (j.height = l);
34
- const J = () => c === "static" ? l ? "text-sm" : "text-xs" : "text-sm", K = () => l ? { height: l } : {};
35
- oe(() => {
36
- const e = (n) => {
37
- i.current && !i.current.contains(n.target) && h(!1);
71
+ const [v, W] = V(!1), I = $(null), F = $(null), { ref: se } = he(), { bind: N, ref: le } = pe({
72
+ axis: "x",
73
+ cursor: { idle: "default", dragging: "grabbing" }
74
+ }), _ = o && o.length > 0, K = s?.filter((e) => o.includes(x(e, d))), oe = () => f === "static" || v || _ ? "-top-2 left-2 scale-90" : "top-1/2 -translate-y-1/2 scale-100", L = {}, z = Y(() => s.map((e) => ({
75
+ id: x(e, d),
76
+ value: x(e, d),
77
+ label: x(e, h)
78
+ })), [s, d, h]);
79
+ a && a !== "100%" && (L.width = a), l && (L.height = l);
80
+ const ae = () => f === "static" ? l ? "text-sm" : "text-xs" : "text-sm", ce = () => l ? { height: l } : {};
81
+ U(() => {
82
+ const e = (m) => {
83
+ if (I.current) {
84
+ if (m.type === "mousedown" && I.current.contains(m.target) || m.type === "scroll" && F.current?.contains(m.target))
85
+ return;
86
+ W(!1);
87
+ }
38
88
  };
39
- return r && document.addEventListener("mousedown", e), () => {
40
- document.removeEventListener("mousedown", e);
89
+ return document.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e, !0), () => {
90
+ document.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e, !0);
41
91
  };
42
- }, [r]);
43
- const Q = () => {
44
- r || Z(), h(!r);
45
- }, U = (e) => {
46
- const n = a(e);
47
- z(n, e), d || (h(!1), P?.());
48
- }, W = (e) => {
49
- e.stopPropagation(), b(!1), e.target.blur(), N?.();
50
- }, X = (e, n) => {
51
- n?.stopPropagation();
52
- const s = a(e);
53
- T?.(s);
54
- }, Y = ({ option: e, onRemove: n }) => /* @__PURE__ */ t.jsxs("div", { className: "inline-flex items-center gap-1 px-2 py-1 bg-primary-default-default text-white text-xs rounded-md", children: [
55
- /* @__PURE__ */ t.jsx("span", { className: "truncate max-w-20", children: x(e) }),
56
- /* @__PURE__ */ t.jsx(
57
- "button",
58
- {
59
- onMouseDown: (s) => {
60
- s.preventDefault(), n(e, s);
61
- },
62
- className: "flex-shrink-0 hover:bg-primary-strong-default rounded-sm p-0.5 transition-colors",
63
- type: "button",
64
- tabIndex: -1,
65
- children: /* @__PURE__ */ t.jsx(w.Close, { size: 12, className: "" })
92
+ }, []);
93
+ const q = () => {
94
+ W(!v);
95
+ }, J = R((e) => {
96
+ if (console.log("onchange en el select, is multiple", i), i) {
97
+ const A = [...z.filter((fe) => o.includes(fe.id)), e];
98
+ O?.(A, b);
99
+ } else
100
+ O?.([e], b);
101
+ }, [i, O, b, z, o]), ie = R((e) => {
102
+ t?.(e, b), J(e), i || (W(!1), y?.());
103
+ }, [i, t, y, b, J]), ue = (e) => {
104
+ e.stopPropagation(), e.target.blur(), g?.();
105
+ }, Q = R((e) => {
106
+ i || O?.([], b);
107
+ const m = s.find((A) => x(A, d) === e);
108
+ m && (t?.({ id: x(m, d), label: x(m, h), value: x(m, d) }, b), E?.(m));
109
+ }, [t, E, h, d, s, b, i, O]), de = Y(() => f === "static" && j ? j : "", [f, j]), X = K.map((e) => x(e, d));
110
+ return /* @__PURE__ */ r.jsxs(
111
+ "div",
112
+ {
113
+ className: p(
114
+ "relative bg-inherit select-none",
115
+ B,
116
+ !a && "w-full",
117
+ f === "static" && "mt-2"
118
+ ),
119
+ ref: I,
120
+ style: L,
121
+ draggable: !1,
122
+ children: [
123
+ /* @__PURE__ */ r.jsxs("div", { className: p("relative bg-inherit ", u), children: [
124
+ /* @__PURE__ */ r.jsx(
125
+ "label",
126
+ {
127
+ htmlFor: w,
128
+ ref: se,
129
+ className: p(
130
+ "absolute left-3 pointer-events-none bg-inherit px-1 z-10",
131
+ f === "default" && "transition-all duration-200 ease-in-out",
132
+ ae(),
133
+ oe(),
134
+ _ || v ? "text-primary-default-default" : "text-neutral-medium-default"
135
+ ),
136
+ children: n
137
+ }
138
+ ),
139
+ /* @__PURE__ */ r.jsxs(
140
+ "div",
141
+ {
142
+ role: "button",
143
+ id: w,
144
+ onClick: q,
145
+ onKeyDown: (e) => {
146
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), q());
147
+ },
148
+ tabIndex: 0,
149
+ className: p(
150
+ "w-full px-2 text-left border rounded-lg transition-all duration-200 ease-in-out",
151
+ "flex items-center justify-start bg-inherit gap-2 ",
152
+ "focus:outline-none",
153
+ H === "chips" && i && _ ? "min-h-12 py-2" : !l && "h-12",
154
+ v ? "border-primary-default-default ring-[1px] ring-primary-default-default" : "border-neutral-default-default hover:border-neutral-strong-default",
155
+ k
156
+ ),
157
+ style: ce(),
158
+ children: [
159
+ /* @__PURE__ */ r.jsx(
160
+ "div",
161
+ {
162
+ className: p("flex-1 overflow-x-auto overflow-y-hidden px-1 prometeo-scrollbar-none"),
163
+ ref: le,
164
+ onPointerDown: N.onPointerDown,
165
+ onPointerMove: N.onPointerMove,
166
+ onPointerUp: N.onPointerUp,
167
+ onPointerLeave: N.onPointerLeave,
168
+ onPointerCancel: N.onPointerCancel,
169
+ onClickCapture: N.onClickCapture,
170
+ children: P ? Z.createElement(P, {
171
+ selectedOptions: K,
172
+ placeholder: j,
173
+ multiple: i,
174
+ onRemoveOption: (e) => {
175
+ Q(e);
176
+ }
177
+ }) : /* @__PURE__ */ r.jsx(
178
+ te,
179
+ {
180
+ displayMode: H,
181
+ selectedOptions: z.filter((e) => X.includes(e.id)),
182
+ placeholder: de,
183
+ onRemoveOption: Q,
184
+ multiple: i,
185
+ className: p(ne === "scroll" ? "flex-nowrap" : "flex-wrap")
186
+ }
187
+ )
188
+ }
189
+ ),
190
+ /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
191
+ c && /* @__PURE__ */ r.jsx(xe, { size: "small" }),
192
+ _ && g && /* @__PURE__ */ r.jsx(
193
+ "button",
194
+ {
195
+ onMouseDown: (e) => {
196
+ e.preventDefault(), e.stopPropagation(), ue(e);
197
+ },
198
+ className: "text-neutral-medium-default hover:text-neutral-default-default transition-colors",
199
+ type: "button",
200
+ tabIndex: -1,
201
+ children: /* @__PURE__ */ r.jsx(T.Close, { size: 16, className: "" })
202
+ }
203
+ ),
204
+ /* @__PURE__ */ r.jsx(
205
+ T.ChevronDown,
206
+ {
207
+ size: 20,
208
+ className: p(
209
+ "transition-transform text-neutral-default-default",
210
+ v ? "rotate-180" : ""
211
+ )
212
+ }
213
+ )
214
+ ] })
215
+ ]
216
+ }
217
+ )
218
+ ] }),
219
+ /* @__PURE__ */ r.jsx(
220
+ we,
221
+ {
222
+ options: M ? s : z,
223
+ selectedOptionsIds: X,
224
+ onOptionClick: ie,
225
+ emptyMessage: C,
226
+ dropdownClassName: G,
227
+ multiple: i,
228
+ attachToParent: D,
229
+ selectRef: I,
230
+ dropdownRef: F,
231
+ isOpen: v,
232
+ renderOption: M,
233
+ optionLabel: h,
234
+ optionValue: d
235
+ }
236
+ )
237
+ ]
238
+ }
239
+ );
240
+ }, Ce = S(be);
241
+ function De({
242
+ options: n,
243
+ onOptionClick: t,
244
+ dropdownClassName: o,
245
+ emptyMessage: c,
246
+ selectedOptionsIds: s,
247
+ multiple: i,
248
+ attachToParent: g,
249
+ selectRef: y,
250
+ dropdownRef: u,
251
+ isOpen: w,
252
+ renderOption: C,
253
+ optionValue: d,
254
+ optionLabel: h
255
+ }) {
256
+ const [P, B] = V("down"), k = (a) => {
257
+ if (!u.current || !y.current) return;
258
+ const l = y.current.getBoundingClientRect();
259
+ switch (a || P) {
260
+ case "down":
261
+ u.current.style.top = `${l.top + l.height}px`;
262
+ break;
263
+ case "up":
264
+ u.current.style.top = `${l.top - 240 - 16}px`;
265
+ break;
266
+ }
267
+ u.current.style.left = `${l.left}px`, u.current.style.width = `${l.width}px`;
268
+ }, G = () => {
269
+ if (!u.current || !y.current) return P;
270
+ const a = y.current.getBoundingClientRect(), l = a.bottom + 240 < window.innerHeight, f = a.top - 240 - 16 > 0;
271
+ let D = "down";
272
+ return l ? D = "down" : f && (D = "up"), D;
273
+ }, H = (a) => {
274
+ if (!(!u.current || !y.current)) {
275
+ if (u.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !a) {
276
+ u.current.style.maxHeight = "0", u.current.style.opacity = "0";
277
+ return;
278
+ }
279
+ if (!g) {
280
+ const l = G();
281
+ B(l), k(l);
66
282
  }
67
- )
68
- ] }), Z = () => {
69
- if (i.current) {
70
- const e = i.current.getBoundingClientRect(), n = 250, s = window.innerHeight - e.bottom, v = e.top;
71
- s < n && v > n ? R("up") : R("down");
283
+ u.current.style.maxHeight = "240px", u.current.style.opacity = "1";
72
284
  }
73
- }, _ = ({ option: e, isSelected: n, onSelect: s, isMultiple: v }) => /* @__PURE__ */ t.jsxs(
285
+ };
286
+ U(() => {
287
+ g || !y.current || !w || k();
288
+ }, [s]), U(() => {
289
+ H(w);
290
+ }, [w]);
291
+ const E = /* @__PURE__ */ r.jsx(
74
292
  "div",
75
293
  {
76
- onMouseDown: (S) => {
77
- S.preventDefault(), s(), S.stopPropagation();
294
+ ref: u,
295
+ style: {
296
+ opacity: "0",
297
+ maxHeight: "0"
78
298
  },
79
- className: o(
299
+ className: p(
300
+ " z-50 w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-md shadow-lg",
301
+ "max-h-60 overflow-auto",
302
+ g ? "absolute z-50 " : "fixed z-100 top-0 left-0",
303
+ o
304
+ ),
305
+ children: n.length === 0 ? /* @__PURE__ */ r.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: c }) : n.map((a) => {
306
+ const l = typeof a.id < "u" ? a.id : x(a, d), f = s.includes(l), D = R(() => {
307
+ t({
308
+ id: l,
309
+ label: String(x(a, h)),
310
+ value: x(a, d)
311
+ });
312
+ }, [t, l, h, d, a]);
313
+ return C ? Z.createElement(C, {
314
+ key: l,
315
+ option: a,
316
+ isSelected: f,
317
+ multiple: i,
318
+ onSelect: D
319
+ }) : /* @__PURE__ */ r.jsx(
320
+ ee,
321
+ {
322
+ option: a,
323
+ multiple: i,
324
+ isSelected: f,
325
+ onSelect: t
326
+ },
327
+ l
328
+ );
329
+ })
330
+ }
331
+ );
332
+ return g ? E : ge(E, document.body);
333
+ }
334
+ const we = S(De), ee = S(({ option: n, isSelected: t, onSelect: o, multiple: c }) => (
335
+ // biome-ignore lint/a11y/noStaticElementInteractions: no keyboard interaction needed
336
+ /* @__PURE__ */ r.jsxs(
337
+ "div",
338
+ {
339
+ onMouseDown: (s) => {
340
+ s.preventDefault(), o?.(n), s.stopPropagation();
341
+ },
342
+ className: p(
80
343
  "px-3 py-2 cursor-pointer flex items-center transition-colors",
81
- n ? "bg-primary-default-default text-white" : "hover:bg-neutral-medium-selected text-neutral-default-default"
344
+ t ? "bg-primary-default-default text-white" : "hover:bg-neutral-medium-selected text-neutral-default-default"
82
345
  ),
83
346
  children: [
84
- v && /* @__PURE__ */ t.jsx(
347
+ c && /* @__PURE__ */ r.jsx(
85
348
  "input",
86
349
  {
87
350
  type: "checkbox",
88
- checked: n,
351
+ checked: t,
89
352
  onChange: () => {
90
353
  },
91
354
  className: "mr-2 pointer-events-none"
92
355
  }
93
356
  ),
94
- /* @__PURE__ */ t.jsx("span", { children: x(e) })
357
+ /* @__PURE__ */ r.jsx("span", { children: n.label })
95
358
  ]
96
359
  }
97
- ), V = () => c === "static" ? F : "", ee = ({ selectedOptions: e, placeholder: n }) => e?.length === 0 ? n ? /* @__PURE__ */ t.jsx("span", { className: "text-neutral-medium-default opacity-50", children: n }) : null : C === "chips" && d ? /* @__PURE__ */ t.jsx("div", { className: "flex items-center gap-1 flex-wrap py-1", children: e.map((s) => /* @__PURE__ */ t.jsx(
98
- Y,
99
- {
100
- option: s,
101
- onRemove: X
102
- },
103
- a(s)
104
- )) }) : e?.length === 1 ? /* @__PURE__ */ t.jsx("span", { children: x(e[0]) }) : /* @__PURE__ */ t.jsxs("span", { children: [
105
- e?.length,
106
- " seleccionados"
107
- ] }), te = E || _, ne = H || ee;
108
- return /* @__PURE__ */ t.jsx(
109
- "div",
360
+ )
361
+ ));
362
+ ee.displayName = "DefaultOptionRenderer";
363
+ const te = S(({ selectedOptions: n, placeholder: t, onRemoveOption: o, displayMode: c, multiple: s, className: i }) => n?.length === 0 ? t ? /* @__PURE__ */ r.jsx("span", { className: "text-neutral-medium-default opacity-50", children: t }) : null : c === "chips" && s ? /* @__PURE__ */ r.jsx("div", { className: p("flex items-center gap-1 ", i), children: n.map((g) => /* @__PURE__ */ r.jsx(
364
+ re,
365
+ {
366
+ id: g.id,
367
+ label: g.label,
368
+ onRemove: o
369
+ },
370
+ g.id
371
+ )) }) : n?.length === 1 ? /* @__PURE__ */ r.jsx("span", { children: n[0].label }) : /* @__PURE__ */ r.jsxs("span", { children: [
372
+ n?.length,
373
+ " seleccionados"
374
+ ] }));
375
+ te.displayName = "DefaultSelectionDisplay";
376
+ const re = S(({ id: n, label: t, onRemove: o, className: c }) => /* @__PURE__ */ r.jsxs("div", { className: "inline-flex max-w-[calc(50%-0.25rem)] items-center gap-1 px-2 py-1 bg-primary-default-default text-white text-xs rounded-md", children: [
377
+ /* @__PURE__ */ r.jsx("span", { className: "truncate w-max ", children: t }),
378
+ /* @__PURE__ */ r.jsx(
379
+ "button",
110
380
  {
111
- className: o(
112
- "relative bg-inherit select-none",
113
- M,
114
- !f && "w-full",
115
- c === "static" && "mt-2"
116
- ),
117
- ref: i,
118
- style: j,
119
- children: /* @__PURE__ */ t.jsxs("div", { className: o("relative bg-inherit", k), children: [
120
- /* @__PURE__ */ t.jsxs(
121
- "button",
122
- {
123
- id: D,
124
- type: "button",
125
- onClick: Q,
126
- onFocus: () => b(!0),
127
- onBlur: () => b(!1),
128
- className: o(
129
- "w-full px-3 text-left border-1 rounded-lg transition-all duration-200 ease-in-out",
130
- "flex items-center justify-between bg-inherit",
131
- "focus:outline-none",
132
- C === "chips" && d && m ? "min-h-12 py-2" : !l && "h-12",
133
- r || g ? "border-primary-default-default border-2" : "border-neutral-default-default hover:border-neutral-strong-default",
134
- L
135
- ),
136
- style: K(),
137
- children: [
138
- /* @__PURE__ */ t.jsx(
139
- "label",
140
- {
141
- htmlFor: D,
142
- className: o(
143
- "absolute left-3 pointer-events-none bg-inherit px-1 z-10",
144
- c === "default" && "transition-all duration-200 ease-in-out",
145
- J(),
146
- G(),
147
- m || r || g ? "text-primary-default-default" : "text-neutral-medium-default"
148
- ),
149
- children: I
150
- }
151
- ),
152
- /* @__PURE__ */ t.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ t.jsx(ne, { selectedOptions: q, placeholder: V() }) }),
153
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 ml-2", children: [
154
- O && /* @__PURE__ */ t.jsx(le, { size: "small" }),
155
- m && N && /* @__PURE__ */ t.jsx(
156
- "button",
157
- {
158
- onMouseDown: (e) => {
159
- e.preventDefault(), e.stopPropagation(), W(e);
160
- },
161
- className: "text-neutral-medium-default hover:text-neutral-default-default transition-colors",
162
- type: "button",
163
- tabIndex: -1,
164
- children: /* @__PURE__ */ t.jsx(w.Close, { size: 16, className: "" })
165
- }
166
- ),
167
- /* @__PURE__ */ t.jsx(
168
- w.ChevronDown,
169
- {
170
- size: 20,
171
- className: o(
172
- "transition-transform text-neutral-default-default",
173
- r ? "rotate-180" : ""
174
- )
175
- }
176
- )
177
- ] })
178
- ]
179
- }
180
- ),
181
- r && /* @__PURE__ */ t.jsx(
182
- "div",
183
- {
184
- className: o(
185
- "absolute z-50 w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-md shadow-lg",
186
- "max-h-60 overflow-auto",
187
- $ === "up" ? "bottom-full mb-1" : "top-full mt-1",
188
- A
189
- ),
190
- children: p.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: B }) : p.map((e) => {
191
- const n = a(e), s = u.includes(n);
192
- return /* @__PURE__ */ t.jsx(
193
- te,
194
- {
195
- option: e,
196
- isSelected: s,
197
- onSelect: () => U(e),
198
- isMultiple: d
199
- },
200
- n
201
- );
202
- })
203
- }
204
- )
205
- ] })
381
+ onMouseDown: (s) => {
382
+ s.preventDefault(), o?.(n);
383
+ },
384
+ className: p("shrink-0 hover:bg-primary-strong-default rounded-sm p-0.5 transition-colors", c),
385
+ type: "button",
386
+ tabIndex: -1,
387
+ children: /* @__PURE__ */ r.jsx(T.Close, { size: 12, className: "" })
206
388
  }
207
- );
208
- }, me = se(ae);
389
+ )
390
+ ] }));
391
+ re.displayName = "Chip";
209
392
  export {
210
- me as default
393
+ Ce as default
211
394
  };