prometeo-design-system 2.6.8 → 2.7.0

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 (40) hide show
  1. package/dist/{Button-DsbEyjth.js → Button-CvBWH1HX.js} +8 -8
  2. package/dist/Button.es.js +1 -1
  3. package/dist/ButtonV2.es.js +12 -12
  4. package/dist/CheckboxFormik.es.js +10 -10
  5. package/dist/DatePicker.es.js +2 -2
  6. package/dist/DrawerDesktop.es.js +1 -1
  7. package/dist/DropZone.es.js +5 -5
  8. package/dist/FAButton.es.js +1 -1
  9. package/dist/{ImageGallery-DnoRTpCr.js → ImageGallery-DKzJg3un.js} +1 -1
  10. package/dist/ImageGallery.es.js +1 -1
  11. package/dist/Input-BTsR-vNF.js +281 -0
  12. package/dist/Input.es.js +1 -1
  13. package/dist/InputFormikV2.es.js +1 -1
  14. package/dist/Pagination.es.js +8 -8
  15. package/dist/ProfilePictureUpload.es.js +3 -3
  16. package/dist/Select-BQMdfu1n.js +1003 -0
  17. package/dist/Select.es.js +1 -1
  18. package/dist/SelectFormik.es.js +1 -1
  19. package/dist/SelectFormikLegacy.es.js +14 -14
  20. package/dist/SelectSearch.es.js +66 -63
  21. package/dist/TabLinks.es.js +8 -8
  22. package/dist/TextArea.es.js +28 -26
  23. package/dist/Toast.es.js +1 -1
  24. package/dist/components/RecurrentDatePicker/CustomFrequencySettings.d.ts +29 -3
  25. package/dist/components/RecurrentDatePicker/FrequencySettings.d.ts +2 -1
  26. package/dist/components/RecurrentDatePicker/MonthlyFrequencySettings.d.ts +9 -3
  27. package/dist/components/RecurrentDatePicker/RecurrentDatePicker.d.ts +28 -1
  28. package/dist/components/RecurrentDatePicker/WeekdaysSelector.d.ts +1 -0
  29. package/dist/components/RecurrentDatePicker/WeeklyFrequencySetting.d.ts +2 -1
  30. package/dist/components/RecurrentDatePicker/YearlyFrequencySettings.d.ts +13 -2
  31. package/dist/components/RecurrentDatePicker/recurrentDatePicker.validations.d.ts +69 -0
  32. package/dist/components/Select/Select.d.ts +18 -0
  33. package/dist/components/TextArea/TextArea.d.ts +2 -1
  34. package/dist/index.d.ts +1 -0
  35. package/dist/preview/SelectPreview/SelectGroupedOptionsPreview.d.ts +2 -0
  36. package/dist/prometeo-design-system.css +1 -1
  37. package/dist/prometeo-design-system.es.js +4 -4
  38. package/package.json +1 -1
  39. package/dist/Input-R52CsX56.js +0 -280
  40. package/dist/Select-CMjYSSZB.js +0 -812
package/dist/Select.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as f } from "./Select-CMjYSSZB.js";
1
+ import { S as f } from "./Select-BQMdfu1n.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { j as d } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { useField as y } from "formik";
3
- import { S as m } from "./Select-CMjYSSZB.js";
3
+ import { S as m } from "./Select-BQMdfu1n.js";
4
4
  import { useRef as p, useEffect as g } from "react";
5
5
  function f(e) {
6
6
  return Array.isArray(e) && e.every(
@@ -19,36 +19,36 @@ const Q = ({
19
19
  returnFullObject: m = !1
20
20
  // Por defecto false para mantener compatibilidad
21
21
  }) => {
22
- const [r, N, o] = $(I), [l, x] = k(!1), [p, A] = k(!1), h = H(null), v = N.touched && N.error, u = (e) => e ? typeof e == "object" && e.id !== void 0 ? e.id : e : null, V = () => r.value ? Array.isArray(r.value) ? r.value.map(u) : u(r.value) : i ? [] : null, f = r.value && (Array.isArray(r.value) ? r.value.length > 0 : typeof r.value == "object" ? r.value.id : r.value?.toString().length > 0), O = () => w === "static" || f || l || p ? "-top-3 left-2 scale-90" : "top-1/2 -translate-y-1/2 scale-100", L = () => {
22
+ const [r, N, u] = $(I), [l, x] = k(!1), [p, A] = k(!1), h = H(null), v = N.touched && N.error, o = (e) => e ? typeof e == "object" && e.id !== void 0 ? e.id : e : null, V = () => r.value ? Array.isArray(r.value) ? r.value.map(o) : o(r.value) : i ? [] : null, f = r.value && (Array.isArray(r.value) ? r.value.length > 0 : typeof r.value == "object" ? r.value.id : r.value?.toString().length > 0), O = () => w === "static" || f || l || p ? "-top-3 left-2 scale-90" : "top-1/2 -translate-y-1/2 scale-100", L = () => {
23
23
  if (!r.value) return [];
24
24
  const e = V();
25
25
  return Array.isArray(e) ? c.filter((a) => e.includes(a.id)) : c.filter((a) => a.id === e);
26
26
  }, P = (e) => {
27
27
  if (i) {
28
- const a = Array.isArray(r.value) ? r.value.map(u) : [], s = a.includes(e.id);
28
+ const a = Array.isArray(r.value) ? r.value.map(o) : [], s = a.includes(e.id);
29
29
  if (m) {
30
- const n = Array.isArray(r.value) ? r.value : [], y = s ? n.filter((B) => u(B) !== e.id) : [...n, e];
31
- o.setValue(y);
30
+ const n = Array.isArray(r.value) ? r.value : [], y = s ? n.filter((B) => o(B) !== e.id) : [...n, e];
31
+ u.setValue(y);
32
32
  } else {
33
33
  const n = s ? a.filter((y) => y !== e.id) : [...a, e.id];
34
- o.setValue(n);
34
+ u.setValue(n);
35
35
  }
36
36
  } else
37
- o.setValue(m ? e : e.id), x(!1);
37
+ u.setValue(m ? e : e.id), x(!1);
38
38
  }, F = (e) => {
39
- e.stopPropagation(), o.setValue(i ? [] : "");
39
+ e.stopPropagation(), u.setValue(i ? [] : "");
40
40
  }, M = (e, a) => {
41
41
  if (a?.stopPropagation(), i && Array.isArray(r.value))
42
42
  if (m) {
43
43
  const s = r.value.filter(
44
- (n) => u(n) !== e
44
+ (n) => o(n) !== e
45
45
  );
46
- o.setValue(s);
46
+ u.setValue(s);
47
47
  } else {
48
48
  const s = r.value.filter(
49
49
  (n) => n !== e
50
50
  );
51
- o.setValue(s);
51
+ u.setValue(s);
52
52
  }
53
53
  };
54
54
  J(() => {
@@ -73,7 +73,7 @@ const Q = ({
73
73
  onMouseDown: (s) => {
74
74
  s.preventDefault(), M(a.id, s);
75
75
  },
76
- className: "flex-shrink-0 hover:bg-primary-strong-default rounded-sm p-0.5 transition-colors",
76
+ className: "shrink-0 hover:bg-primary-strong-default rounded-sm p-0.5 transition-colors",
77
77
  type: "button",
78
78
  tabIndex: -1,
79
79
  children: /* @__PURE__ */ t.jsx(g.Close, { size: 12, className: "" })
@@ -98,10 +98,10 @@ const Q = ({
98
98
  onFocus: () => A(!0),
99
99
  onBlur: () => A(!1),
100
100
  className: d(
101
- "w-full px-3 h-12 text-left border-1 rounded-lg transition-all duration-300 ease-in-out text-neutral-default-default",
101
+ "w-full px-3 h-12 text-left border rounded-lg transition-all duration-300 ease-in-out text-neutral-default-default",
102
102
  "flex items-center justify-between bg-transparent focus:outline-none",
103
- f || l || p ? " border-primary-default-focused ring-primary-default-focused ring-[2px]" : v ? "ring-error-default-default ring-[2px]" : "border-neutral-default-default hover:border-primary-default-hover",
104
- j && "opacity-50 cursor-not-allowed pointer-events-none",
103
+ f || l || p ? " border-primary-default-focused ring-primary-default-focused ring-2" : v ? "ring-error-default-default ring-2" : "border-neutral-default-default hover:border-primary-default-hover",
104
+ j && "opacity-50 cursor-default pointer-events-none",
105
105
  D
106
106
  ),
107
107
  children: [
@@ -1,40 +1,40 @@
1
1
  import { j as G } from "./jsx-runtime-DKDX3adD.js";
2
- import { g as i, S as H } from "./Select-CMjYSSZB.js";
3
- import { useState as w, useRef as T, useEffect as h, useMemo as Q, useCallback as X } from "react";
2
+ import { g as i, S as H } from "./Select-BQMdfu1n.js";
3
+ import { useState as T, useRef as I, useEffect as h, useMemo as Q, useCallback as X } from "react";
4
4
  function te(e) {
5
5
  const {
6
- options: p,
6
+ options: O,
7
7
  fetcher: s,
8
8
  asyncMode: V = "fetch_in_open",
9
- disabled: x = !1,
10
- debounceDelay: I = 500,
11
- minCharacters: S = 3,
9
+ disabled: S = !1,
10
+ debounceDelay: R = 500,
11
+ minCharacters: _ = 3,
12
12
  optionLabel: f,
13
13
  optionValue: u,
14
14
  controlledValue: m,
15
15
  isOpen: F,
16
- inputRef: R,
17
- name: O
18
- } = e || {}, [y, j] = w(p || []), [J, C] = w(p || []), [a, k] = w(""), [M, r] = w(!1), [v, 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);
16
+ inputRef: j,
17
+ name: y
18
+ } = e || {}, [C, k] = T(O || []), [J, p] = T(O || []), [a, x] = T(""), [M, r] = T(!1), [v, b] = T(!1), g = I(null), D = I(null), N = I(!1), E = I(s), P = e?.multiple === !0 || !1, w = I(P ? [] : void 0), [d, A] = T(P ? [] : void 0);
19
19
  h(() => {
20
20
  E.current = s;
21
21
  }, [s]), h(() => {
22
22
  m !== void 0 && A(m);
23
23
  }, [m]), h(() => {
24
- _.current = m !== void 0 ? m : d;
24
+ w.current = m !== void 0 ? m : d;
25
25
  }, [m, d]), h(() => {
26
- e?.options && (j(e.options), C(e.options));
26
+ e?.options && (k(e.options), p(e.options));
27
27
  }, [e?.options]);
28
28
  const U = Q(() => (t, n) => new Promise((o, l) => {
29
29
  g.current && clearTimeout(g.current), g.current = setTimeout(() => t(a).then(o).catch(l), n);
30
30
  }), [a]), Y = (t) => {
31
31
  const n = m !== void 0, o = (l) => u ? i(l, u) : i(l, "id");
32
32
  if (e?.multiple === !0) {
33
- const l = _.current || [];
33
+ const l = w.current || [];
34
34
  let c;
35
- l.some((L) => o(L) === o(t)) ? c = l.filter((L) => o(L) !== o(t)) : c = [...l, t], n ? (_.current = c, e?.onChange?.(c, O)) : (_.current = c, A(c), e?.onChange?.(c, O));
35
+ l.some((L) => o(L) === o(t)) ? c = l.filter((L) => o(L) !== o(t)) : c = [...l, t], n ? (w.current = c, e?.onChange?.(c, y)) : (w.current = c, A(c), e?.onChange?.(c, y));
36
36
  } else
37
- n ? (_.current = t, e?.onChange?.(t, O)) : (_.current = t, A(t), e?.onChange?.(t, O));
37
+ n ? (w.current = t, e?.onChange?.(t, y)) : (w.current = t, A(t), e?.onChange?.(t, y));
38
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
39
  h(() => {
40
40
  const t = e?.subscribeOpenChange;
@@ -48,32 +48,33 @@ function te(e) {
48
48
  }, [e?.subscribeOpenChange]);
49
49
  const B = F !== void 0 ? F : v;
50
50
  h(() => {
51
- if (!x && E.current && V === "fetch_on_type") {
52
- if (!a || a === "" || a.length < S) {
51
+ if (!S && E.current && V === "fetch_on_type") {
52
+ if (!a || a === "" || a.length < _) {
53
53
  g.current && clearTimeout(g.current), r(!1);
54
54
  return;
55
55
  }
56
- const t = U(W, I);
56
+ const t = U(W, R);
57
57
  r(!0), t.then((n) => {
58
- j(n);
58
+ k(n);
59
59
  }).finally(() => {
60
60
  r(!1), e?.onFetchingEnd?.();
61
61
  });
62
62
  }
63
- }, [V, a, x, I, U, S]), h(() => {
64
- if (B) {
65
- if (e?.onOpen?.(), V === "fetch_in_open") {
66
- if (!E.current)
67
- return;
68
- r(!0), W().then((t) => {
69
- j(() => P && d.length > 0 ? [...K(d, t), ...d] : t);
70
- }).finally(() => {
71
- r(!1), e?.onFetchingEnd?.();
72
- });
73
- }
74
- } else
75
- e?.onClose?.();
76
- }, [B, V]);
63
+ }, [V, a, S, R, U, _]), h(() => {
64
+ if (!S)
65
+ if (B) {
66
+ if (e?.onOpen?.(), V === "fetch_in_open") {
67
+ if (!E.current)
68
+ return;
69
+ r(!0), W().then((t) => {
70
+ k(() => P && d.length > 0 ? [...K(d, t), ...d] : t);
71
+ }).finally(() => {
72
+ r(!1), e?.onFetchingEnd?.();
73
+ });
74
+ }
75
+ } else
76
+ e?.onClose?.();
77
+ }, [B, V, S]);
77
78
  const q = (t, n) => t.filter((o) => {
78
79
  if (f)
79
80
  return i(o, f).toLowerCase().includes(n.toLowerCase());
@@ -108,28 +109,28 @@ function te(e) {
108
109
  }
109
110
  }
110
111
  }), z = (t) => {
111
- const n = typeof R == "function" ? R() : R;
112
+ const n = typeof j == "function" ? j() : j;
112
113
  t.target === n?.current && (D.current && clearTimeout(D.current), N.current || (N.current = !0, e?.onTypeStart?.()), D.current = setTimeout(() => {
113
114
  N.current = !1;
114
- }, I));
115
+ }, R));
115
116
  };
116
117
  return h(() => {
117
118
  if (a === "")
118
- C(Z(y));
119
+ p(Z(C));
119
120
  else if (P) {
120
- const t = K(d, y);
121
- C([...q(t, a), ...d]);
121
+ const t = K(d, C);
122
+ p([...q(t, a), ...d]);
122
123
  } else {
123
- const t = K([d], y);
124
- C([...q(t, a), d]);
124
+ const t = K([d], C);
125
+ p([...q(t, a), d]);
125
126
  }
126
- }, [y]), h(() => (document.addEventListener("keydown", z), () => {
127
+ }, [C]), h(() => (document.addEventListener("keydown", z), () => {
127
128
  document.removeEventListener("keydown", z);
128
129
  }), []), {
129
130
  inputValue: a,
130
- setInputValue: k,
131
+ setInputValue: x,
131
132
  cleanInputValue: () => {
132
- k("");
133
+ x("");
133
134
  },
134
135
  filteredOptions: J,
135
136
  isLoading: M,
@@ -139,9 +140,9 @@ function te(e) {
139
140
  };
140
141
  }
141
142
  const ie = (e) => {
142
- const p = T(null);
143
+ const O = I(null);
143
144
  h(() => {
144
- e.controls && (e.controls.current = p.current);
145
+ e.controls && (e.controls.current = O.current);
145
146
  }, [e.controls]);
146
147
  const { asyncMode: s = "fetch_in_open" } = e, V = (r, v, b) => {
147
148
  const g = {
@@ -174,34 +175,35 @@ const ie = (e) => {
174
175
  controlledValue: r.value,
175
176
  onChange: r.onChange
176
177
  };
177
- }, { inputValue: x, setInputValue: I, filteredOptions: S, isLoading: f, value: u, onOptionClick: m, cleanInputValue: F } = te(V(e, s, p)), R = X(() => s === "fetch_on_type" ? f : !1, [s, f]), O = Q(() => e.multiple ? u.map((r) => i(r, e.optionValue)) : u ? i(u, e.optionValue) : void 0, [u, e.optionValue, e.multiple]), y = (r) => {
178
- const v = S.find((b) => i(b, e.optionValue) === r.id);
178
+ }, { inputValue: S, setInputValue: R, filteredOptions: _, isLoading: f, value: u, onOptionClick: m, cleanInputValue: F } = te(V(e, s, O)), j = X(() => s === "fetch_on_type" ? f : !1, [s, f]), y = Q(() => e.multiple ? u.map((r) => i(r, e.optionValue)) : u ? i(u, e.optionValue) : void 0, [u, e.optionValue, e.multiple]), C = (r) => {
179
+ const v = _.find((b) => i(b, e.optionValue) === r.id);
179
180
  v && m(v);
180
- }, { displayMode: j = e.multiple ? "chips" : "compact", dropdownOptions: J, overflow: C = "scroll", onChange: a, ...k } = e.selectComponentProps || {}, M = {
181
- controledSearchValue: x,
182
- onSearchValueChange: s === "fetch_on_type" ? I : void 0,
181
+ }, { displayMode: k = e.multiple ? "chips" : "compact", dropdownOptions: J, overflow: p = "scroll", onChange: a, ...x } = e.selectComponentProps || {}, M = {
182
+ controledSearchValue: S,
183
+ onSearchValueChange: s === "fetch_on_type" ? R : void 0,
183
184
  onSearchClear: s === "fetch_on_type" ? F : void 0,
184
185
  inputSearchPlaceholder: e.inputSearchPlaceholder,
185
- isLoading: R(),
186
+ isLoading: j(),
186
187
  ...J || {}
187
188
  };
188
189
  return e.multiple ? /* @__PURE__ */ G.jsx(
189
190
  H,
190
191
  {
192
+ disabled: e.disabled,
191
193
  className: e.className,
192
194
  name: e.name,
193
- overflow: C,
194
- ...k,
195
+ overflow: p,
196
+ ...x,
195
197
  multiple: !0,
196
- value: O,
198
+ value: y,
197
199
  label: e.label || "",
198
- options: S,
200
+ options: _,
199
201
  optionValue: e.optionValue,
200
202
  optionLabel: e.optionLabel,
201
203
  renderOption: e.renderOption,
202
- onOptionClick: y,
203
- displayMode: j,
204
- controls: p,
204
+ onOptionClick: C,
205
+ displayMode: k,
206
+ controls: O,
205
207
  emptyMessage: "Use el buscador para obtener las opciones disponibles",
206
208
  dropdownOptions: M,
207
209
  isLoading: s === "fetch_in_open" ? f : !1
@@ -209,20 +211,21 @@ const ie = (e) => {
209
211
  ) : /* @__PURE__ */ G.jsx(
210
212
  H,
211
213
  {
212
- ...k,
214
+ disabled: e.disabled,
215
+ ...x,
213
216
  className: e.className,
214
- overflow: C,
217
+ overflow: p,
215
218
  name: e.name,
216
219
  multiple: !1,
217
- value: O,
220
+ value: y,
218
221
  label: e.label || "",
219
- options: S,
222
+ options: _,
220
223
  optionValue: e.optionValue,
221
224
  optionLabel: e.optionLabel,
222
225
  renderOption: e.renderOption,
223
- onOptionClick: y,
226
+ onOptionClick: C,
224
227
  displayMode: "compact",
225
- controls: p,
228
+ controls: O,
226
229
  emptyMessage: "Use el buscador para obtener las opciones disponibles",
227
230
  dropdownOptions: M,
228
231
  isLoading: s === "fetch_in_open" ? f : !1
@@ -2,7 +2,7 @@ import { j as n } from "./jsx-runtime-DKDX3adD.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";
5
- function c({
5
+ function o({
6
6
  items: t,
7
7
  activeTab: e,
8
8
  onTabChange: i,
@@ -11,7 +11,7 @@ function c({
11
11
  activeTabClassName: u,
12
12
  indicatorClassName: f,
13
13
  animated: b = !0,
14
- renderTab: o
14
+ renderTab: m
15
15
  }) {
16
16
  const h = (a) => {
17
17
  a.disabled || i?.(a.id, a);
@@ -25,16 +25,16 @@ function c({
25
25
  ),
26
26
  role: "tablist",
27
27
  children: t?.map((a) => {
28
- const s = e === a.id, m = () => h(a);
29
- return o ? /* @__PURE__ */ n.jsx("div", { children: o(a, s, m) }, a.id) : /* @__PURE__ */ n.jsxs(
28
+ const s = e === a.id, c = () => h(a);
29
+ return m ? /* @__PURE__ */ n.jsx("div", { children: m(a, s, c) }, a.id) : /* @__PURE__ */ n.jsxs(
30
30
  "button",
31
31
  {
32
- onClick: m,
32
+ onClick: c,
33
33
  disabled: a.disabled,
34
34
  className: r(
35
35
  "relative flex justify-center items-center h-10 px-4 font-medium focus:outline-none transition-colors",
36
36
  !a.disabled && "hover:text-primary-default-default cursor-pointer",
37
- a.disabled && "opacity-50 cursor-not-allowed",
37
+ a.disabled && "opacity-50 cursor-default",
38
38
  d,
39
39
  s && u
40
40
  ),
@@ -78,8 +78,8 @@ function c({
78
78
  }
79
79
  );
80
80
  }
81
- c.displayName = "TabLinks";
82
- const C = N(c, (t, e) => {
81
+ o.displayName = "TabLinks";
82
+ const C = N(o, (t, e) => {
83
83
  if (t.activeTab !== e.activeTab || t.className !== e.className || t.tabClassName !== e.tabClassName || t.activeTabClassName !== e.activeTabClassName || t.indicatorClassName !== e.indicatorClassName || t.animated !== e.animated || t.onTabChange !== e.onTabChange || t.renderTab !== e.renderTab || t.items.length !== e.items.length)
84
84
  return !1;
85
85
  for (let i = 0; i < t.items.length; i++) {
@@ -1,52 +1,54 @@
1
- import { j as y } from "./jsx-runtime-DKDX3adD.js";
2
- import { c as C } from "./cn-B6yFEsav.js";
1
+ import { j as C } from "./jsx-runtime-DKDX3adD.js";
2
+ import { c as j } from "./cn-B6yFEsav.js";
3
3
  import * as s from "react";
4
- function M({
4
+ function N({
5
5
  className: i,
6
6
  autoResize: t = !1,
7
- userResize: d = !0,
7
+ userResize: f = !0,
8
8
  minRows: r = 3,
9
9
  maxRows: a,
10
- placeholder: f,
10
+ placeholder: d,
11
11
  onChange: c,
12
12
  value: h,
13
- rows: m
13
+ rows: m,
14
+ disabled: x = !1
14
15
  }) {
15
- const o = s.useRef(null), n = s.useCallback(() => {
16
- const e = o.current;
16
+ const u = s.useRef(null), l = s.useCallback(() => {
17
+ const e = u.current;
17
18
  if (!e || !t) return;
18
19
  e.style.height = "auto";
19
- const g = e.scrollHeight, u = Number.parseInt(getComputedStyle(e).lineHeight) || 20, H = r * u + 16;
20
- let l = Math.max(g, H);
20
+ const H = e.scrollHeight, o = Number.parseInt(getComputedStyle(e).lineHeight) || 20, b = r * o + 16;
21
+ let n = Math.max(H, b);
21
22
  if (a) {
22
- const b = a * u + 16;
23
- l = Math.min(l, b);
23
+ const y = a * o + 16;
24
+ n = Math.min(n, y);
24
25
  }
25
- e.style.height = `${l}px`;
26
- }, [t, r, a]), x = (e) => {
27
- c?.(e), n();
26
+ e.style.height = `${n}px`;
27
+ }, [t, r, a]), p = (e) => {
28
+ c?.(e), l();
28
29
  };
29
30
  s.useEffect(() => {
30
- n();
31
- }, [n]);
32
- const p = () => d ? t ? "resize-x" : "resize" : "resize-none";
33
- return /* @__PURE__ */ y.jsx(
31
+ l();
32
+ }, [l]);
33
+ const g = () => f ? t ? "resize-x" : "resize" : "resize-none";
34
+ return /* @__PURE__ */ C.jsx(
34
35
  "textarea",
35
36
  {
36
- ref: o,
37
+ ref: u,
37
38
  "data-slot": "textarea",
38
- className: C(
39
- "placeholder:text-neutral-medium-default text-neutral-default-default appearance-none border border-neutral-default-default focus:border-primary-default-default flex w-full rounded-md px-3 py-2 outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
40
- p(),
39
+ className: j(
40
+ "placeholder:text-neutral-medium-default text-neutral-default-default appearance-none border border-neutral-default-default focus:border-primary-default-default flex w-full rounded-md px-3 py-2 outline-none disabled:cursor-default disabled:opacity-50 md:text-sm",
41
+ g(),
41
42
  i
42
43
  ),
43
- onChange: x,
44
+ onChange: p,
44
45
  rows: t ? r : m,
45
46
  value: h,
46
- placeholder: f
47
+ placeholder: d,
48
+ disabled: x
47
49
  }
48
50
  );
49
51
  }
50
52
  export {
51
- M as default
53
+ N as default
52
54
  };
package/dist/Toast.es.js CHANGED
@@ -3,7 +3,7 @@ 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-CvBWH1HX.js";
7
7
  const x = {
8
8
  dark: {
9
9
  success: {
@@ -1,14 +1,40 @@
1
1
  import { weekDay } from './WeekdaysSelector';
2
2
  import { default as React } from 'react';
3
- type CustomFrequency = "daily" | "weekly" | "monthly";
3
+ type CustomFrequency = "weekly" | "monthly";
4
4
  export type CustomFrequencySettingsValue = {
5
5
  interval: number;
6
6
  frequency: CustomFrequency;
7
+ weekdays?: weekDay[];
8
+ dayOfMonth?: string;
9
+ };
10
+ type CustomFrequencySettingsValueDeltaBase = {
11
+ kind: 'setInterval' | 'setFrequency' | 'setWeekdays' | 'setDayOfMonth';
12
+ };
13
+ type CustomFrequencySettingsValueDeltaInterval = CustomFrequencySettingsValueDeltaBase & {
14
+ kind: 'setInterval';
15
+ interval: number;
16
+ };
17
+ type CustomFrequencySettingsValueDeltaFrequency = CustomFrequencySettingsValueDeltaBase & {
18
+ kind: 'setFrequency';
19
+ frequency: CustomFrequency;
20
+ };
21
+ type CustomFrequencySettingsValueDeltaWeekdays = CustomFrequencySettingsValueDeltaBase & {
22
+ kind: 'setWeekdays';
7
23
  weekdays: weekDay[];
8
24
  };
25
+ type CustomFrequencySettingsValueDeltaDayOfMonth = CustomFrequencySettingsValueDeltaBase & {
26
+ kind: 'setDayOfMonth';
27
+ dayOfMonth: string;
28
+ };
29
+ export type CustomFrequencySettingsValueDelta = CustomFrequencySettingsValueDeltaInterval | CustomFrequencySettingsValueDeltaFrequency | CustomFrequencySettingsValueDeltaWeekdays | CustomFrequencySettingsValueDeltaDayOfMonth;
9
30
  interface CustomSettingsProps {
10
31
  value?: CustomFrequencySettingsValue;
11
- onChange: (value: CustomFrequencySettingsValue) => void;
32
+ onChange: (delta: CustomFrequencySettingsValueDelta) => void;
33
+ errors?: {
34
+ interval?: string;
35
+ weekdays?: string;
36
+ dayOfMonth?: string;
37
+ };
12
38
  }
13
- declare const CustomFrequencySettings: React.MemoExoticComponent<({ value, onChange }: CustomSettingsProps) => import("react/jsx-runtime").JSX.Element>;
39
+ declare const CustomFrequencySettings: React.MemoExoticComponent<({ value, onChange, errors }: CustomSettingsProps) => import("react/jsx-runtime").JSX.Element>;
14
40
  export default CustomFrequencySettings;
@@ -1,12 +1,13 @@
1
1
  import { CustomFrequencySettingsValue } from './CustomFrequencySettings';
2
2
  import { MonthlySettingsValue } from './MonthlyFrequencySettings';
3
- import { FrequencySettingsValue, RecurrenceFrequencyType } from './RecurrentDatePicker';
3
+ import { FrequencySettingsErrors, FrequencySettingsValue, RecurrenceFrequencyType } from './RecurrentDatePicker';
4
4
  import { WeeklyFrequencySettingsValue } from './WeeklyFrequencySetting';
5
5
  import { YearlyFrequencySettingsValue } from './YearlyFrequencySettings';
6
6
  export interface IFrequencySettingsProps {
7
7
  frequency: RecurrenceFrequencyType;
8
8
  frequencySettings?: MonthlySettingsValue | WeeklyFrequencySettingsValue | YearlyFrequencySettingsValue | CustomFrequencySettingsValue;
9
9
  onChange: (cb: ((pv: FrequencySettingsValue) => FrequencySettingsValue) | FrequencySettingsValue) => void;
10
+ errors?: FrequencySettingsErrors;
10
11
  }
11
12
  declare const FrequencySettings: import('react').MemoExoticComponent<(props: IFrequencySettingsProps) => import("react/jsx-runtime").JSX.Element>;
12
13
  export default FrequencySettings;
@@ -6,7 +6,7 @@ export type MonthlySettingsValue = {
6
6
  weekDay: weekDay;
7
7
  } | {
8
8
  type: 'absolute';
9
- dayOfMonth: number;
9
+ dayOfMonth: string;
10
10
  };
11
11
  export type MonthlySettingsDelta = {
12
12
  kind: 'setType';
@@ -19,11 +19,17 @@ export type MonthlySettingsDelta = {
19
19
  newWeekDay: weekDay;
20
20
  } | {
21
21
  kind: 'setAbsoluteDayOfMonth';
22
- newDayOfMonth: number;
22
+ newDayOfMonth: string;
23
+ };
24
+ export type MonthlySettingsErrors = {
25
+ dayOrder?: string;
26
+ weekDay?: string;
27
+ dayOfMonth?: string;
23
28
  };
24
29
  interface MonthlySettingsProps {
25
30
  value?: MonthlySettingsValue;
26
31
  onChange: (delta: MonthlySettingsDelta) => void;
32
+ errors?: MonthlySettingsErrors;
27
33
  }
28
- declare const MonthlyFrequencySettings: import('react').MemoExoticComponent<({ value, onChange }: MonthlySettingsProps) => import("react/jsx-runtime").JSX.Element>;
34
+ declare const MonthlyFrequencySettings: import('react').MemoExoticComponent<({ value, onChange, errors }: MonthlySettingsProps) => import("react/jsx-runtime").JSX.Element>;
29
35
  export default MonthlyFrequencySettings;
@@ -7,6 +7,33 @@ export declare const RecurrenceFrecuencyOptions: {
7
7
  label: string;
8
8
  value: string;
9
9
  }[];
10
+ export interface RecurrentDatePickerValue {
11
+ frequency: RecurrenceFrequencyType;
12
+ startDate: Date;
13
+ frequencySettings: FrequencySettingsValue;
14
+ }
10
15
  export type FrequencySettingsValue = WeeklyFrequencySettingsValue | MonthlySettingsValue | YearlyFrequencySettingsValue | CustomFrequencySettingsValue;
11
- declare const RecurrentDatePicker: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
16
+ export interface FrequencyFieldErrors {
17
+ weeklyWeekdays?: string;
18
+ monthlyDayOrder?: string;
19
+ monthlyWeekDay?: string;
20
+ monthlyDayOfMonth?: string;
21
+ yearlyMonth?: string;
22
+ yearlyDay?: string;
23
+ customInterval?: string;
24
+ customWeekdays?: string;
25
+ customDayOfMonth?: string;
26
+ }
27
+ export type FrequencySettingsErrors = FrequencyFieldErrors;
28
+ export interface RecurrentDatePickerErrors {
29
+ startDate?: string;
30
+ frequencySettings?: FrequencySettingsErrors;
31
+ }
32
+ export type RecurrentDatePickerProps = {
33
+ value?: RecurrentDatePickerValue;
34
+ defaultValue?: RecurrentDatePickerValue;
35
+ onChange?: (value: RecurrentDatePickerValue) => void;
36
+ errors?: RecurrentDatePickerErrors;
37
+ };
38
+ declare const RecurrentDatePicker: import('react').MemoExoticComponent<(props: RecurrentDatePickerProps) => import("react/jsx-runtime").JSX.Element>;
12
39
  export default RecurrentDatePicker;
@@ -7,6 +7,7 @@ type WeekdaySelectorProps = {
7
7
  onChange: (newValue: weekDay[]) => void;
8
8
  label?: string;
9
9
  required?: boolean;
10
+ error?: string;
10
11
  };
11
12
  declare const WeekdaysSelector: React.MemoExoticComponent<(props: WeekdaySelectorProps) => import("react/jsx-runtime").JSX.Element>;
12
13
  export default WeekdaysSelector;
@@ -3,6 +3,7 @@ export type WeeklyFrequencySettingsValue = weekDay[];
3
3
  interface WeeklyFrequencySettingsProps {
4
4
  value?: WeeklyFrequencySettingsValue;
5
5
  onChange: (value: WeeklyFrequencySettingsValue) => void;
6
+ error?: string;
6
7
  }
7
- declare const WeeklyFrequencySettings: import('react').MemoExoticComponent<({ value, onChange }: WeeklyFrequencySettingsProps) => import("react/jsx-runtime").JSX.Element>;
8
+ declare const WeeklyFrequencySettings: import('react').MemoExoticComponent<({ value, onChange, error }: WeeklyFrequencySettingsProps) => import("react/jsx-runtime").JSX.Element>;
8
9
  export default WeeklyFrequencySettings;
@@ -1,10 +1,21 @@
1
+ type monthValue = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
1
2
  export interface YearlyFrequencySettingsValue {
2
3
  month: number;
3
4
  day?: number;
4
5
  }
6
+ export interface YearlyFrequencySettingsErrors {
7
+ month?: string;
8
+ day?: string;
9
+ }
5
10
  interface YearlyFrequencySettingsProps {
6
11
  value?: YearlyFrequencySettingsValue;
7
- onChange: (value: YearlyFrequencySettingsValue) => void;
12
+ onChange: (delta: YearlyFequencyValueDelta) => void;
13
+ errors?: YearlyFrequencySettingsErrors;
14
+ }
15
+ export interface YearlyFequencyValueDelta {
16
+ kind: 'setMonth' | 'setDay';
17
+ newMonth?: monthValue;
18
+ newDay?: number;
8
19
  }
9
- declare const YearlyFrequencySettings: import('react').MemoExoticComponent<({ value, onChange }: YearlyFrequencySettingsProps) => import("react/jsx-runtime").JSX.Element>;
20
+ declare const YearlyFrequencySettings: import('react').MemoExoticComponent<({ value, onChange, errors }: YearlyFrequencySettingsProps) => import("react/jsx-runtime").JSX.Element>;
10
21
  export default YearlyFrequencySettings;