prometeo-design-system 2.5.4 → 2.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/Avatar.es.js +1 -1
  2. package/dist/{Button-DsbEyjth.js → Button-Bc0LYLfg.js} +1 -1
  3. package/dist/Button.es.js +1 -1
  4. package/dist/{CardProfile-DV3gwvqE.js → CardProfile-DA-HDUpi.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 +3 -3
  9. package/dist/DialogModal.es.js +1 -1
  10. package/dist/DrawerDesktop.es.js +2 -2
  11. package/dist/DrawerMobile.es.js +102 -104
  12. package/dist/DropZone.es.js +1 -1
  13. package/dist/Header.es.js +1 -1
  14. package/dist/Icons.es.js +1 -1
  15. package/dist/Image.es.js +1 -1
  16. package/dist/{ImageGallery-DnoRTpCr.js → ImageGallery-BeADef_g.js} +2 -2
  17. package/dist/ImageGallery.es.js +1 -1
  18. package/dist/{Input-PNwH7rb6.js → Input-DwIAUqcc.js} +2 -2
  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-B6E-yOYJ.js +26 -0
  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-C1MxM6yq.js +813 -0
  32. package/dist/Select.es.js +1 -1
  33. package/dist/SelectFormik.es.js +55 -29
  34. package/dist/SelectFormikLegacy.es.js +1 -1
  35. package/dist/SelectSearch.es.js +167 -132
  36. package/dist/Skeleton.es.js +1 -1
  37. package/dist/Spinner.es.js +1 -1
  38. package/dist/Steps.es.js +1 -1
  39. package/dist/SwipeContainer.es.js +1 -1
  40. package/dist/Switch.es.js +1 -1
  41. package/dist/TabLinks.es.js +1 -1
  42. package/dist/Table.es.js +1 -1
  43. package/dist/TextArea.es.js +1 -1
  44. package/dist/Toast.es.js +2 -2
  45. package/dist/ToastProvider.es.js +1 -1
  46. package/dist/Tooltip.es.js +1 -1
  47. package/dist/components/Autocomplete/useAutocomplete.d.ts +14 -6
  48. package/dist/components/Drawer/DrawerMobile.d.ts +1 -1
  49. package/dist/components/Select/Select.d.ts +19 -7
  50. package/dist/components/SelectFormik/SelectFormik.d.ts +5 -3
  51. package/dist/components/SelectSearch/SelectSearch.d.ts +12 -4
  52. package/dist/components/Sidebar/context/SidebarContext.d.ts +2 -0
  53. package/dist/components/TabSwitch/TabSwitch.d.ts +1 -1
  54. package/dist/index.d.ts +1 -1
  55. package/dist/{jsx-runtime-DKDX3adD.js → jsx-runtime-ByW6EXIE.js} +96 -94
  56. package/dist/prometeo-design-system.es.js +141 -134
  57. package/package.json +1 -1
  58. package/dist/LayoutGeneric-p4Pll4Cm.js +0 -24
  59. package/dist/Select-C-aLaiJu.js +0 -804
package/dist/Select.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as f } from "./Select-C-aLaiJu.js";
1
+ import { S as f } from "./Select-C1MxM6yq.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,35 +1,61 @@
1
- import { j as m } from "./jsx-runtime-DKDX3adD.js";
2
- import { useField as c } from "formik";
3
- import { S as f } from "./Select-C-aLaiJu.js";
4
- import { useRef as d, useEffect as v } from "react";
5
- function n(r) {
6
- return Array.isArray(r) && r.every(
7
- (e) => typeof e == "string" || typeof e == "number"
1
+ import { j as d } from "./jsx-runtime-ByW6EXIE.js";
2
+ import { useField as y } from "formik";
3
+ import { S as m } from "./Select-C1MxM6yq.js";
4
+ import { useRef as p, useEffect as g } from "react";
5
+ function f(e) {
6
+ return Array.isArray(e) && e.every(
7
+ (r) => typeof r == "string" || typeof r == "number"
8
8
  );
9
9
  }
10
- const S = (r) => {
11
- const [e, o, a] = c(r.name), t = d(!1);
12
- v(() => {
13
- t.current || (t.current = !0, n(e.value) || (console.warn(
14
- `SelectFormik: El valor del campo "${r.name}" no es un array válido de string | number. Valor recibido:`,
15
- e.value,
10
+ function v(e) {
11
+ return e == null || typeof e == "string" || typeof e == "number";
12
+ }
13
+ const b = (e) => {
14
+ const [r, a, l] = y(e.name), u = p(!1), o = Array.isArray(r.value);
15
+ if (g(() => {
16
+ u.current || (u.current = !0, o ? f(r.value) || (console.warn(
17
+ `SelectFormik: El valor del campo "${e.name}" no es un array válido de string | number. Valor recibido:`,
18
+ r.value,
16
19
  "Inicializando como array vacío."
17
- ), a.setValue([])));
18
- }, [e.value, a, r.name]);
19
- const l = (u) => {
20
- a.setValue(u.map((s) => s.value));
21
- }, i = n(e.value) ? e.value : [];
22
- return /* @__PURE__ */ m.jsx(
23
- f,
24
- {
25
- ...r,
26
- value: i,
27
- onChange: l,
28
- variant: o.error ? "error" : "default",
29
- errorComponent: o.error || void 0
30
- }
31
- );
20
+ ), l.setValue([])) : v(r.value) || (console.warn(
21
+ `SelectFormik: El valor del campo "${e.name}" no es un valor válido (string | number | null). Valor recibido:`,
22
+ r.value,
23
+ "Inicializando como null."
24
+ ), l.setValue(null)));
25
+ }, [r.value, l, e.name, o]), o) {
26
+ const n = (c) => {
27
+ l.setValue(c.map((s) => s.value));
28
+ }, i = f(r.value) ? r.value : [], t = e?.displayMode || "chips";
29
+ return /* @__PURE__ */ d.jsx(
30
+ m,
31
+ {
32
+ ...e,
33
+ displayMode: t,
34
+ multiple: !0,
35
+ value: i,
36
+ onChange: n,
37
+ variant: a.error ? "error" : "default",
38
+ errorComponent: a.error || void 0
39
+ }
40
+ );
41
+ } else {
42
+ const n = (s) => {
43
+ l.setValue(s?.value ?? null);
44
+ }, i = v(r.value) ? r.value : void 0, { ...t } = e;
45
+ return /* @__PURE__ */ d.jsx(
46
+ m,
47
+ {
48
+ ...t,
49
+ displayMode: "compact",
50
+ multiple: !1,
51
+ value: i,
52
+ onChange: n,
53
+ variant: a.error ? "error" : "default",
54
+ errorComponent: a.error || void 0
55
+ }
56
+ );
57
+ }
32
58
  };
33
59
  export {
34
- S as default
60
+ b as default
35
61
  };
@@ -1,4 +1,4 @@
1
- import { j as t } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as t } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { Icons as g } from "./Icons.es.js";
3
3
  import { c as d } from "./cn-B6yFEsav.js";
4
4
  import { useField as $, ErrorMessage as q } from "formik";
@@ -1,195 +1,230 @@
1
- import { j as $ } from "./jsx-runtime-DKDX3adD.js";
2
- import { g as s, S as ee } from "./Select-C-aLaiJu.js";
3
- import { useState as y, useRef as O, useEffect as a, useMemo as q, useCallback as z } from "react";
1
+ import { j as G } from "./jsx-runtime-ByW6EXIE.js";
2
+ import { g as i, S as H } from "./Select-C1MxM6yq.js";
3
+ import { useState as w, useRef as T, useEffect as m, useMemo as Q, useCallback as X } from "react";
4
4
  function te(e) {
5
5
  const {
6
- options: f,
7
- multiple: l = !1,
8
- fetcher: C,
9
- asyncMode: g = "fetch_in_open",
10
- disabled: v = !1,
11
- debounceDelay: m = 500,
6
+ options: L,
7
+ fetcher: s,
8
+ asyncMode: V = "fetch_in_open",
9
+ disabled: x = !1,
10
+ debounceDelay: I = 500,
12
11
  minCharacters: S = 3,
13
- optionLabel: p,
14
- optionValue: d,
15
- controlledValue: u,
16
- isOpen: j,
17
- inputRef: L,
18
- name: k
19
- } = e || {}, [V, _] = y(f || []), [P, w] = y(f || []), [c, T] = y(""), [M, I] = y(!1), [h, A] = y([]), [G, H] = y(!1), R = O(null), D = O(null), J = O(!1), x = O(C), F = O([]);
20
- a(() => {
21
- x.current = C;
22
- }, [C]), a(() => {
23
- u !== void 0 && A(u);
24
- }, [u]), a(() => {
25
- F.current = u !== void 0 ? u : h;
26
- }, [u, h]), a(() => {
27
- e?.options && (_(e.options), w(e.options));
12
+ optionLabel: f,
13
+ optionValue: u,
14
+ controlledValue: h,
15
+ isOpen: F,
16
+ inputRef: R,
17
+ name: p
18
+ } = e || {}, [O, j] = w(L || []), [J, y] = w(L || []), [a, k] = w(""), [M, r] = w(!1), [C, b] = w(!1), g = T(null), D = T(null), N = T(!1), E = T(s), P = e?.multiple === !0 || !1, _ = T(P ? [] : void 0), [d, A] = w(P ? [] : void 0);
19
+ m(() => {
20
+ E.current = s;
21
+ }, [s]), m(() => {
22
+ h !== void 0 && A(h);
23
+ }, [h]), m(() => {
24
+ _.current = h !== void 0 ? h : d;
25
+ }, [h, d]), m(() => {
26
+ e?.options && (j(e.options), y(e.options));
28
27
  }, [e?.options]);
29
- const K = q(() => (t, n) => new Promise((r, o) => {
30
- R.current && clearTimeout(R.current), R.current = setTimeout(() => t(c).then(r).catch(o), n);
31
- }), [c]), Q = (t) => {
32
- const n = u !== void 0, r = F.current;
33
- let o;
34
- const i = (E) => d ? s(E, d) : s(E, "id");
35
- l ? r.some((b) => i(b) === i(t)) ? o = r.filter((b) => i(b) !== i(t)) : o = [...r, t] : o = [t], n ? (F.current = o, e?.onChange?.(o, k)) : (F.current = o, A(o), e?.onChange?.(o, k));
36
- }, N = (t) => (e?.onFetchingStart?.(), x.current?.(t) || Promise.resolve([])), B = z((t, n) => t.length === 0 ? n : d ? n.filter((r) => !t.some((o) => s(o, d) === s(r, d))) : n.filter((r) => !t.some((o) => s(o, "id") === s(r, "id"))), [d]);
37
- a(() => {
28
+ const U = Q(() => (t, n) => new Promise((o, l) => {
29
+ g.current && clearTimeout(g.current), g.current = setTimeout(() => t(a).then(o).catch(l), n);
30
+ }), [a]), Y = (t) => {
31
+ const n = h !== void 0, o = (l) => u ? i(l, u) : i(l, "id");
32
+ if (e?.multiple === !0) {
33
+ const l = _.current || [];
34
+ let c;
35
+ l.some((v) => o(v) === o(t)) ? c = l.filter((v) => o(v) !== o(t)) : c = [...l, t], n ? (_.current = c, e?.onChange?.(c, p)) : (_.current = c, A(c), e?.onChange?.(c, p));
36
+ } else
37
+ n ? (_.current = t, e?.onChange?.(t, p)) : (_.current = t, A(t), e?.onChange?.(t, p));
38
+ }, W = (t) => (e?.onFetchingStart?.(), E.current?.(t) || Promise.resolve([])), K = X((t, n) => t.length === 0 ? n : u ? n.filter((o) => !t.some((l) => i(l, u) === i(o, u))) : n.filter((o) => !t.some((l) => i(l, "id") === i(o, "id"))), [u]);
39
+ m(() => {
38
40
  const t = e?.subscribeOpenChange;
39
41
  if (!t) return;
40
- const n = t((r) => {
41
- H(r);
42
+ const n = t((o) => {
43
+ b(o);
42
44
  });
43
45
  return () => {
44
46
  n && n();
45
47
  };
46
48
  }, [e?.subscribeOpenChange]);
47
- const U = j !== void 0 ? j : G;
48
- a(() => {
49
- if (!v && x.current && g === "fetch_on_type") {
50
- if (!c || c === "" || c.length < S) {
51
- R.current && clearTimeout(R.current), I(!1);
49
+ const B = F !== void 0 ? F : C;
50
+ m(() => {
51
+ if (!x && E.current && V === "fetch_on_type") {
52
+ if (!a || a === "" || a.length < S) {
53
+ g.current && clearTimeout(g.current), r(!1);
52
54
  return;
53
55
  }
54
- const t = K(N, m);
55
- I(!0), t.then((n) => {
56
- _(n);
56
+ const t = U(W, I);
57
+ r(!0), t.then((n) => {
58
+ j(n);
57
59
  }).finally(() => {
58
- I(!1), e?.onFetchingEnd?.();
60
+ r(!1), e?.onFetchingEnd?.();
59
61
  });
60
62
  }
61
- }, [g, c, v, m, K, S]), a(() => {
62
- if (U) {
63
- if (e?.onOpen?.(), g === "fetch_in_open") {
64
- if (!x.current)
63
+ }, [V, a, x, I, U, S]), m(() => {
64
+ if (B) {
65
+ if (e?.onOpen?.(), V === "fetch_in_open") {
66
+ if (!E.current)
65
67
  return;
66
- I(!0), N().then((t) => {
67
- _(() => h.length > 0 ? [...B(h, t), ...h] : t);
68
+ r(!0), W().then((t) => {
69
+ j(() => P && d.length > 0 ? [...K(d, t), ...d] : t);
68
70
  }).finally(() => {
69
- I(!1), e?.onFetchingEnd?.();
71
+ r(!1), e?.onFetchingEnd?.();
70
72
  });
71
73
  }
72
74
  } else
73
75
  e?.onClose?.();
74
- }, [U, g]);
75
- const X = (t, n) => t.filter((r) => {
76
- if (p)
77
- return s(r, p).toLowerCase().includes(n.toLowerCase());
78
- switch (typeof r) {
76
+ }, [B, V]);
77
+ const q = (t, n) => t.filter((o) => {
78
+ if (f)
79
+ return i(o, f).toLowerCase().includes(n.toLowerCase());
80
+ switch (typeof o) {
79
81
  case "string":
80
- return r.toLowerCase().includes(n.toLowerCase());
82
+ return o.toLowerCase().includes(n.toLowerCase());
81
83
  case "number":
82
- return r.toString().includes(n);
84
+ return o.toString().includes(n);
83
85
  case "object":
84
- return Object.values(r).some((i) => i.toString().toLowerCase().includes(n.toLowerCase()));
86
+ return Object.values(o).some((c) => c.toString().toLowerCase().includes(n.toLowerCase()));
85
87
  default:
86
88
  return !1;
87
89
  }
88
- }), Y = (t) => t.sort((n, r) => {
89
- if (p)
90
- return s(n, p) < s(r, p) ? -1 : 1;
90
+ }), Z = (t) => t.sort((n, o) => {
91
+ if (f)
92
+ return i(n, f) < i(o, f) ? -1 : 1;
91
93
  {
92
- const i = ["label", "name", "value"].find((b) => typeof n == "object" && Object.keys(n).includes(b));
94
+ const c = ["label", "name", "value"].find((v) => typeof n == "object" && Object.keys(n).includes(v));
93
95
  switch (typeof n) {
94
96
  case "string":
95
- return n < r ? -1 : 1;
97
+ return n < o ? -1 : 1;
96
98
  case "number":
97
- return n < r ? -1 : 1;
99
+ return n < o ? -1 : 1;
98
100
  case "object":
99
- if (i) {
100
- const b = s(n, i), Z = s(r, i);
101
- return b < Z ? -1 : 1;
101
+ if (c) {
102
+ const v = i(n, c), ee = i(o, c);
103
+ return v < ee ? -1 : 1;
102
104
  } else
103
105
  return 1;
104
106
  default:
105
107
  return 1;
106
108
  }
107
109
  }
108
- }), W = (t) => {
109
- const n = typeof L == "function" ? L() : L;
110
- t.target === n?.current && (D.current && clearTimeout(D.current), J.current || (J.current = !0, e?.onTypeStart?.()), D.current = setTimeout(() => {
111
- J.current = !1;
112
- }, m));
110
+ }), z = (t) => {
111
+ const n = typeof R == "function" ? R() : R;
112
+ t.target === n?.current && (D.current && clearTimeout(D.current), N.current || (N.current = !0, e?.onTypeStart?.()), D.current = setTimeout(() => {
113
+ N.current = !1;
114
+ }, I));
113
115
  };
114
- return a(() => {
115
- if (c === "")
116
- w(Y(V));
117
- else {
118
- const t = B(h, V);
119
- w([...X(t, c), ...h]);
116
+ return m(() => {
117
+ if (a === "")
118
+ y(Z(O));
119
+ else if (P) {
120
+ const t = K(d, O);
121
+ y([...q(t, a), ...d]);
122
+ } else {
123
+ const t = K([d], O);
124
+ y([...q(t, a), d]);
120
125
  }
121
- }, [V]), a(() => (document.addEventListener("keydown", W), () => {
122
- document.removeEventListener("keydown", W);
126
+ }, [O]), m(() => (document.addEventListener("keydown", z), () => {
127
+ document.removeEventListener("keydown", z);
123
128
  }), []), {
124
- inputValue: c,
125
- setInputValue: T,
129
+ inputValue: a,
130
+ setInputValue: k,
126
131
  cleanInputValue: () => {
127
- T("");
132
+ k("");
128
133
  },
129
- filteredOptions: P,
134
+ filteredOptions: J,
130
135
  isLoading: M,
131
- value: h,
136
+ value: d,
132
137
  setValue: A,
133
- onOptionClick: Q
138
+ onOptionClick: Y
134
139
  };
135
140
  }
136
- const se = (e) => {
137
- const f = O(null), { asyncMode: l = "fetch_in_open" } = e, { inputValue: C, setInputValue: g, filteredOptions: v, isLoading: m, value: S, onOptionClick: p, cleanInputValue: d } = te({
138
- options: e.options,
139
- fetcher: e.fetcher,
140
- asyncMode: l,
141
- debounceDelay: e.debounceDelay,
142
- minCharacters: e.minCharacters,
143
- disabled: e.disabled,
144
- multiple: e.multiple,
145
- optionValue: e.optionValue,
146
- optionLabel: e.optionLabel,
147
- onFetchingStart: () => {
148
- l === "fetch_on_type" && f.current?.open();
149
- },
150
- onTypeStart: () => {
151
- !e?.fetcher && f.current?.open();
152
- },
153
- inputRef: () => f.current?.searchInputRef,
154
- //estado controlado
155
- controlledValue: e.value,
156
- subscribeOpenChange: f.current?.subscribeOpenChange,
157
- onChange: e.onChange,
158
- name: e.name
159
- }), u = q(() => S.map((c) => s(c, e.optionValue)), [S, e.optionValue]), j = z(() => l === "fetch_on_type" ? m : !1, [l, m]), L = (c) => {
160
- const T = v.find((M) => s(M, e.optionValue) === c.id);
161
- T && p(T);
162
- }, { displayMode: k = "chips", dropdownOptions: V, overflow: _ = "scroll", ...P } = e.selectComponentProps || {}, w = {
163
- controledSearchValue: C,
164
- onSearchValueChange: l === "fetch_on_type" ? g : void 0,
165
- onSearchClear: l === "fetch_on_type" ? d : void 0,
141
+ const ie = (e) => {
142
+ const L = T(null), { asyncMode: s = "fetch_in_open" } = e, V = (r, C, b) => {
143
+ const g = {
144
+ options: r.options,
145
+ fetcher: r.fetcher,
146
+ asyncMode: C,
147
+ debounceDelay: r.debounceDelay,
148
+ minCharacters: r.minCharacters,
149
+ disabled: r.disabled,
150
+ optionValue: r.optionValue,
151
+ optionLabel: r.optionLabel,
152
+ onFetchingStart: () => {
153
+ C === "fetch_on_type" && b.current?.open();
154
+ },
155
+ onTypeStart: () => {
156
+ !r?.fetcher && b.current?.open();
157
+ },
158
+ inputRef: () => b.current?.searchInputRef,
159
+ subscribeOpenChange: b.current?.subscribeOpenChange,
160
+ name: r.name
161
+ };
162
+ return r.multiple ? {
163
+ ...g,
164
+ multiple: !0,
165
+ controlledValue: r.value,
166
+ onChange: r.onChange
167
+ } : {
168
+ ...g,
169
+ multiple: !1,
170
+ controlledValue: r.value,
171
+ onChange: r.onChange
172
+ };
173
+ }, { inputValue: x, setInputValue: I, filteredOptions: S, isLoading: f, value: u, onOptionClick: h, cleanInputValue: F } = te(V(e, s, L)), R = X(() => s === "fetch_on_type" ? f : !1, [s, f]), p = Q(() => e.multiple ? u.map((r) => i(r, e.optionValue)) : u ? i(u, e.optionValue) : void 0, [u, e.optionValue, e.multiple]), O = (r) => {
174
+ const C = S.find((b) => i(b, e.optionValue) === r.id);
175
+ C && h(C);
176
+ }, { displayMode: j = e.multiple ? "chips" : "compact", dropdownOptions: J, overflow: y = "scroll", onChange: a, ...k } = e.selectComponentProps || {}, M = {
177
+ controledSearchValue: x,
178
+ onSearchValueChange: s === "fetch_on_type" ? I : void 0,
179
+ onSearchClear: s === "fetch_on_type" ? F : void 0,
166
180
  inputSearchPlaceholder: e.inputSearchPlaceholder,
167
- isLoading: j(),
168
- ...V || {}
181
+ isLoading: R(),
182
+ ...J || {}
169
183
  };
170
- return /* @__PURE__ */ $.jsx(
171
- ee,
184
+ return e.multiple ? /* @__PURE__ */ G.jsx(
185
+ H,
186
+ {
187
+ className: e.className,
188
+ name: e.name,
189
+ overflow: y,
190
+ ...k,
191
+ multiple: !0,
192
+ value: p,
193
+ label: e.label || "",
194
+ options: S,
195
+ optionValue: e.optionValue,
196
+ optionLabel: e.optionLabel,
197
+ renderOption: e.renderOption,
198
+ onOptionClick: O,
199
+ displayMode: j,
200
+ controls: L,
201
+ emptyMessage: "Use el buscador para obtener las opciones disponibles",
202
+ dropdownOptions: M,
203
+ isLoading: s === "fetch_in_open" ? f : !1
204
+ }
205
+ ) : /* @__PURE__ */ G.jsx(
206
+ H,
172
207
  {
208
+ ...k,
173
209
  className: e.className,
210
+ overflow: y,
174
211
  name: e.name,
175
- overflow: _,
176
- ...P,
212
+ multiple: !1,
213
+ value: p,
177
214
  label: e.label || "",
178
- value: u,
179
- options: v,
215
+ options: S,
180
216
  optionValue: e.optionValue,
181
217
  optionLabel: e.optionLabel,
182
218
  renderOption: e.renderOption,
183
- onOptionClick: L,
184
- multiple: e.multiple,
185
- displayMode: k,
186
- controls: f,
219
+ onOptionClick: O,
220
+ displayMode: "compact",
221
+ controls: L,
187
222
  emptyMessage: "Use el buscador para obtener las opciones disponibles",
188
- dropdownOptions: w,
189
- isLoading: l === "fetch_in_open" ? m : !1
223
+ dropdownOptions: M,
224
+ isLoading: s === "fetch_in_open" ? f : !1
190
225
  }
191
226
  );
192
227
  };
193
228
  export {
194
- se as default
229
+ ie as default
195
230
  };
@@ -1,4 +1,4 @@
1
- import { j as E } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as E } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as B } from "./cn-B6yFEsav.js";
3
3
  import { memo as N, useRef as R, useCallback as D, useLayoutEffect as M } from "react";
4
4
  const y = (n) => {
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { ClipLoader as l, SyncLoader as m, HashLoader as p, GridLoader as x, DotLoader as j, BounceLoader as f } from "react-spinners";
3
3
  import { c as L } from "./cn-B6yFEsav.js";
4
4
  const y = ({
package/dist/Steps.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as j } from "./cn-B6yFEsav.js";
3
3
  import { motion as r } from "framer-motion";
4
4
  import N from "react";
@@ -1,4 +1,4 @@
1
- import { j as o } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as o } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as i } from "./cn-B6yFEsav.js";
3
3
  import { useState as d, useRef as D, useEffect as L } from "react";
4
4
  const O = ({
package/dist/Switch.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as a } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as a } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as r } from "./cn-B6yFEsav.js";
3
3
  import { memo as w, useRef as b } from "react";
4
4
  import { motion as c } from "framer-motion";
@@ -1,4 +1,4 @@
1
- import { j as n } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as n } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { motion as x } from "framer-motion";
3
3
  import { memo as N } from "react";
4
4
  import { c as r } from "./cn-B6yFEsav.js";
package/dist/Table.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as r } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as r } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as l } from "./cn-B6yFEsav.js";
3
3
  import * as o from "react";
4
4
  const n = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r.jsx("div", { className: "w-full", children: /* @__PURE__ */ r.jsx(
@@ -1,4 +1,4 @@
1
- import { j as y } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as y } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { c as C } from "./cn-B6yFEsav.js";
3
3
  import * as s from "react";
4
4
  function M({
package/dist/Toast.es.js CHANGED
@@ -1,9 +1,9 @@
1
- import { j as e } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import b from "react";
3
3
  import { toast as p } from "sonner";
4
4
  import { Icons as m } from "./Icons.es.js";
5
5
  import { c as s } from "./cn-B6yFEsav.js";
6
- import { B as u } from "./Button-DsbEyjth.js";
6
+ import { B as u } from "./Button-Bc0LYLfg.js";
7
7
  const x = {
8
8
  dark: {
9
9
  success: {
@@ -1,4 +1,4 @@
1
- import { j as t } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as t } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { Toaster as r } from "sonner";
3
3
  const i = ({ ...o }) => /* @__PURE__ */ t.jsx(r, { ...o, position: "bottom-right", richColors: !1, theme: "light" });
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { j as e } from "./jsx-runtime-DKDX3adD.js";
1
+ import { j as e } from "./jsx-runtime-ByW6EXIE.js";
2
2
  import { AnimatePresence as f, motion as n } from "framer-motion";
3
3
  import { useState as p, cloneElement as x } from "react";
4
4
  import { Icons as b } from "./Icons.es.js";
@@ -1,7 +1,16 @@
1
1
  import { OptionAccessor } from '../Shared/types';
2
- export interface UseAutocompleteOptions<T> {
2
+ export interface UseAutocompleteOptionsMultiple<T> extends UseAutocompleteBaseOptions<T> {
3
+ multiple: true;
4
+ controlledValue?: T[];
5
+ onChange?: (newValue: T[], name?: string) => void;
6
+ }
7
+ export interface UseAutocompleteOptionsSingle<T> extends UseAutocompleteBaseOptions<T> {
8
+ multiple?: false;
9
+ controlledValue?: T;
10
+ onChange?: (newValue: T, name?: string) => void;
11
+ }
12
+ export interface UseAutocompleteBaseOptions<T> {
3
13
  options?: T[];
4
- multiple?: boolean;
5
14
  fetcher?: (input?: string) => Promise<T[]>;
6
15
  asyncMode?: 'fetch_in_open' | 'fetch_on_type';
7
16
  disabled?: boolean;
@@ -15,19 +24,18 @@ export interface UseAutocompleteOptions<T> {
15
24
  onTypeStart?: () => void;
16
25
  onOpen?: () => void;
17
26
  onClose?: () => void;
18
- controlledValue?: T[];
19
27
  isOpen?: boolean;
20
28
  subscribeOpenChange?: (cb: (open: boolean) => void) => (() => void) | undefined;
21
- onChange?: (newValue: T[], name?: string) => void;
22
29
  name?: string;
23
30
  }
31
+ export type UseAutocompleteOptions<T> = UseAutocompleteOptionsMultiple<T> | UseAutocompleteOptionsSingle<T>;
24
32
  export declare function useAutocomplete<T>(options?: UseAutocompleteOptions<T>): {
25
33
  inputValue: string;
26
34
  setInputValue: import('react').Dispatch<import('react').SetStateAction<string>>;
27
35
  cleanInputValue: () => void;
28
36
  filteredOptions: T[];
29
37
  isLoading: boolean;
30
- value: T[];
31
- setValue: import('react').Dispatch<import('react').SetStateAction<T[]>>;
38
+ value: T | T[] | undefined;
39
+ setValue: import('react').Dispatch<import('react').SetStateAction<T | T[] | undefined>>;
32
40
  onOptionClick: (option: T) => void;
33
41
  };
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export interface DrawerMobileProps<TContext = unknown> {
3
- children?: React.ReactNode | ((context: TContext | null) => React.ReactNode);
3
+ children?: React.ReactNode;
4
4
  defaultOpen?: boolean;
5
5
  onClose?: (context: TContext | null) => void;
6
6
  snap?: string | number | null;