prometeo-design-system 2.6.7 → 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.
- package/dist/{Button-DsbEyjth.js → Button-CvBWH1HX.js} +8 -8
- package/dist/Button.es.js +1 -1
- package/dist/ButtonV2.d.ts +6 -0
- package/dist/ButtonV2.es.js +217 -0
- package/dist/CheckboxFormik.es.js +10 -10
- package/dist/DatePicker.es.js +2 -2
- package/dist/DrawerDesktop.es.js +1 -1
- package/dist/DropZone.es.js +5 -5
- package/dist/FAButton.es.js +1 -1
- package/dist/Header.es.js +11 -11
- package/dist/{ImageGallery-DnoRTpCr.js → ImageGallery-DKzJg3un.js} +1 -1
- package/dist/ImageGallery.es.js +1 -1
- package/dist/Input-BTsR-vNF.js +281 -0
- package/dist/Input.es.js +1 -1
- package/dist/InputFormikV2.es.js +1 -1
- package/dist/Pagination.es.js +8 -8
- package/dist/ProfilePictureUpload.es.js +3 -3
- package/dist/Select-BQMdfu1n.js +1003 -0
- package/dist/Select.es.js +1 -1
- package/dist/SelectFormik.es.js +1 -1
- package/dist/SelectFormikLegacy.es.js +14 -14
- package/dist/SelectSearch.es.js +66 -63
- package/dist/TabLinks.es.js +8 -8
- package/dist/TextArea.es.js +28 -26
- package/dist/Toast.es.js +1 -1
- package/dist/components/Button/ButtonV2.d.ts +23 -0
- package/dist/components/Header/Header.d.ts +2 -1
- package/dist/components/RecurrentDatePicker/CustomFrequencySettings.d.ts +29 -3
- package/dist/components/RecurrentDatePicker/FrequencySettings.d.ts +2 -1
- package/dist/components/RecurrentDatePicker/MonthlyFrequencySettings.d.ts +9 -3
- package/dist/components/RecurrentDatePicker/RecurrentDatePicker.d.ts +28 -1
- package/dist/components/RecurrentDatePicker/WeekdaysSelector.d.ts +1 -0
- package/dist/components/RecurrentDatePicker/WeeklyFrequencySetting.d.ts +2 -1
- package/dist/components/RecurrentDatePicker/YearlyFrequencySettings.d.ts +13 -2
- package/dist/components/RecurrentDatePicker/recurrentDatePicker.validations.d.ts +69 -0
- package/dist/components/Select/Select.d.ts +18 -0
- package/dist/components/TextArea/TextArea.d.ts +2 -1
- package/dist/exports/ButtonV2.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/preview/ButtonPreview.d.ts +2 -0
- package/dist/preview/SelectPreview/SelectGroupedOptionsPreview.d.ts +2 -0
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +21 -19
- package/package.json +5 -2
- package/src/styles/intellisense.css +2 -1
- package/dist/Input-i6OzjjFo.js +0 -280
- package/dist/Select-D3aU7dXF.js +0 -812
- package/dist/components/Drawer/DrawerDesktop_old.d.ts +0 -15
- package/dist/components/Drawer/DrawerMobile_old.d.ts +0 -18
package/dist/Select.es.js
CHANGED
package/dist/SelectFormik.es.js
CHANGED
|
@@ -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-
|
|
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,
|
|
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(
|
|
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) =>
|
|
31
|
-
|
|
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
|
-
|
|
34
|
+
u.setValue(n);
|
|
35
35
|
}
|
|
36
36
|
} else
|
|
37
|
-
|
|
37
|
+
u.setValue(m ? e : e.id), x(!1);
|
|
38
38
|
}, F = (e) => {
|
|
39
|
-
e.stopPropagation(),
|
|
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) =>
|
|
44
|
+
(n) => o(n) !== e
|
|
45
45
|
);
|
|
46
|
-
|
|
46
|
+
u.setValue(s);
|
|
47
47
|
} else {
|
|
48
48
|
const s = r.value.filter(
|
|
49
49
|
(n) => n !== e
|
|
50
50
|
);
|
|
51
|
-
|
|
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: "
|
|
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
|
|
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-
|
|
104
|
-
j && "opacity-50 cursor-
|
|
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: [
|
package/dist/SelectSearch.es.js
CHANGED
|
@@ -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-
|
|
3
|
-
import { useState as
|
|
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:
|
|
6
|
+
options: O,
|
|
7
7
|
fetcher: s,
|
|
8
8
|
asyncMode: V = "fetch_in_open",
|
|
9
|
-
disabled:
|
|
10
|
-
debounceDelay:
|
|
11
|
-
minCharacters:
|
|
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:
|
|
17
|
-
name:
|
|
18
|
-
} = e || {}, [
|
|
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
|
-
|
|
24
|
+
w.current = m !== void 0 ? m : d;
|
|
25
25
|
}, [m, d]), h(() => {
|
|
26
|
-
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 =
|
|
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 ? (
|
|
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 ? (
|
|
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 (!
|
|
52
|
-
if (!a || a === "" || a.length <
|
|
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,
|
|
56
|
+
const t = U(W, R);
|
|
57
57
|
r(!0), t.then((n) => {
|
|
58
|
-
|
|
58
|
+
k(n);
|
|
59
59
|
}).finally(() => {
|
|
60
60
|
r(!1), e?.onFetchingEnd?.();
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
}, [V, a,
|
|
64
|
-
if (
|
|
65
|
-
if (
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
|
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
|
-
},
|
|
115
|
+
}, R));
|
|
115
116
|
};
|
|
116
117
|
return h(() => {
|
|
117
118
|
if (a === "")
|
|
118
|
-
|
|
119
|
+
p(Z(C));
|
|
119
120
|
else if (P) {
|
|
120
|
-
const t = K(d,
|
|
121
|
-
|
|
121
|
+
const t = K(d, C);
|
|
122
|
+
p([...q(t, a), ...d]);
|
|
122
123
|
} else {
|
|
123
|
-
const t = K([d],
|
|
124
|
-
|
|
124
|
+
const t = K([d], C);
|
|
125
|
+
p([...q(t, a), d]);
|
|
125
126
|
}
|
|
126
|
-
}, [
|
|
127
|
+
}, [C]), h(() => (document.addEventListener("keydown", z), () => {
|
|
127
128
|
document.removeEventListener("keydown", z);
|
|
128
129
|
}), []), {
|
|
129
130
|
inputValue: a,
|
|
130
|
-
setInputValue:
|
|
131
|
+
setInputValue: x,
|
|
131
132
|
cleanInputValue: () => {
|
|
132
|
-
|
|
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
|
|
143
|
+
const O = I(null);
|
|
143
144
|
h(() => {
|
|
144
|
-
e.controls && (e.controls.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:
|
|
178
|
-
const v =
|
|
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:
|
|
181
|
-
controledSearchValue:
|
|
182
|
-
onSearchValueChange: s === "fetch_on_type" ?
|
|
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:
|
|
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:
|
|
194
|
-
...
|
|
195
|
+
overflow: p,
|
|
196
|
+
...x,
|
|
195
197
|
multiple: !0,
|
|
196
|
-
value:
|
|
198
|
+
value: y,
|
|
197
199
|
label: e.label || "",
|
|
198
|
-
options:
|
|
200
|
+
options: _,
|
|
199
201
|
optionValue: e.optionValue,
|
|
200
202
|
optionLabel: e.optionLabel,
|
|
201
203
|
renderOption: e.renderOption,
|
|
202
|
-
onOptionClick:
|
|
203
|
-
displayMode:
|
|
204
|
-
controls:
|
|
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
|
-
|
|
214
|
+
disabled: e.disabled,
|
|
215
|
+
...x,
|
|
213
216
|
className: e.className,
|
|
214
|
-
overflow:
|
|
217
|
+
overflow: p,
|
|
215
218
|
name: e.name,
|
|
216
219
|
multiple: !1,
|
|
217
|
-
value:
|
|
220
|
+
value: y,
|
|
218
221
|
label: e.label || "",
|
|
219
|
-
options:
|
|
222
|
+
options: _,
|
|
220
223
|
optionValue: e.optionValue,
|
|
221
224
|
optionLabel: e.optionLabel,
|
|
222
225
|
renderOption: e.renderOption,
|
|
223
|
-
onOptionClick:
|
|
226
|
+
onOptionClick: C,
|
|
224
227
|
displayMode: "compact",
|
|
225
|
-
controls:
|
|
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
|
package/dist/TabLinks.es.js
CHANGED
|
@@ -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
|
|
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:
|
|
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,
|
|
29
|
-
return
|
|
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:
|
|
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-
|
|
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
|
-
|
|
82
|
-
const C = N(
|
|
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++) {
|
package/dist/TextArea.es.js
CHANGED
|
@@ -1,52 +1,54 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { c as
|
|
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
|
|
4
|
+
function N({
|
|
5
5
|
className: i,
|
|
6
6
|
autoResize: t = !1,
|
|
7
|
-
userResize:
|
|
7
|
+
userResize: f = !0,
|
|
8
8
|
minRows: r = 3,
|
|
9
9
|
maxRows: a,
|
|
10
|
-
placeholder:
|
|
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
|
|
16
|
-
const e =
|
|
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
|
|
20
|
-
let
|
|
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
|
|
23
|
-
|
|
23
|
+
const y = a * o + 16;
|
|
24
|
+
n = Math.min(n, y);
|
|
24
25
|
}
|
|
25
|
-
e.style.height = `${
|
|
26
|
-
}, [t, r, a]),
|
|
27
|
-
c?.(e),
|
|
26
|
+
e.style.height = `${n}px`;
|
|
27
|
+
}, [t, r, a]), p = (e) => {
|
|
28
|
+
c?.(e), l();
|
|
28
29
|
};
|
|
29
30
|
s.useEffect(() => {
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
const
|
|
33
|
-
return /* @__PURE__ */
|
|
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:
|
|
37
|
+
ref: u,
|
|
37
38
|
"data-slot": "textarea",
|
|
38
|
-
className:
|
|
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-
|
|
40
|
-
|
|
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:
|
|
44
|
+
onChange: p,
|
|
44
45
|
rows: t ? r : m,
|
|
45
46
|
value: h,
|
|
46
|
-
placeholder:
|
|
47
|
+
placeholder: d,
|
|
48
|
+
disabled: x
|
|
47
49
|
}
|
|
48
50
|
);
|
|
49
51
|
}
|
|
50
52
|
export {
|
|
51
|
-
|
|
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-
|
|
6
|
+
import { B as u } from "./Button-CvBWH1HX.js";
|
|
7
7
|
const x = {
|
|
8
8
|
dark: {
|
|
9
9
|
success: {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ButtonVariant, ColorVariant, SizeVariant } from '../Shared/types';
|
|
2
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
contentClassName?: string;
|
|
7
|
+
loadingText?: string;
|
|
8
|
+
animate?: boolean;
|
|
9
|
+
animateIcon?: boolean;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
spinner?: React.ReactNode;
|
|
13
|
+
type?: 'button' | "submit" | "reset";
|
|
14
|
+
className?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
variant?: ButtonVariant;
|
|
17
|
+
form?: string;
|
|
18
|
+
size?: SizeVariant;
|
|
19
|
+
color?: ColorVariant;
|
|
20
|
+
hideSpinner?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const _default: import('react').MemoExoticComponent<({ label, onClick, icon, contentClassName, loadingText, animate, animateIcon, isLoading, children, hideSpinner, spinner, type, className, disabled, variant, form, size, color }: ButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
23
|
+
export default _default;
|
|
@@ -5,6 +5,7 @@ export interface IHeader {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
subtitle?: string;
|
|
7
7
|
subtitleClassName?: string;
|
|
8
|
+
titleClassName?: string;
|
|
8
9
|
}
|
|
9
|
-
declare const _default: import('react').MemoExoticComponent<({ title, subtitle, children, className, subtitleClassName }: IHeader) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
declare const _default: import('react').MemoExoticComponent<({ title, subtitle, children, className, subtitleClassName, titleClassName }: IHeader) => import("react/jsx-runtime").JSX.Element>;
|
|
10
11
|
export default _default;
|
|
@@ -1,14 +1,40 @@
|
|
|
1
1
|
import { weekDay } from './WeekdaysSelector';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
-
type CustomFrequency = "
|
|
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: (
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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;
|