prometeo-design-system 2.8.1 → 2.8.2
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.es.js +5 -5
- package/dist/{CardProfile-CHUivLbW.js → CardProfile-WHoeSibd.js} +28 -28
- package/dist/CardProfile.es.js +1 -1
- package/dist/CheckBox.es.js +4 -4
- package/dist/DatePicker.es.js +68 -68
- package/dist/DrawerDesktop.es.js +9 -9
- package/dist/DropZone.es.js +32 -32
- package/dist/FAButton.es.js +2 -2
- package/dist/HelperComponent-BeNlTMqI.js +24 -0
- package/dist/Icons/Icons.d.ts +2 -2
- package/dist/Icons.es.js +1053 -2
- package/dist/{ImageGallery-TkgHO3JL.js → ImageGallery-WKzUevOQ.js} +43 -43
- package/dist/ImageGallery.es.js +1 -1
- package/dist/{Input-CsNlU1Hu.js → Input-Bdiozi8s.js} +7 -14
- package/dist/Input.es.js +1 -1
- package/dist/InputMultiple.es.js +51 -51
- package/dist/Logo.es.js +3 -3
- package/dist/Menu.es.js +2 -2
- package/dist/OtpInput.es.js +68 -68
- package/dist/Pagination.es.js +1 -1
- package/dist/RadioButton.es.js +1 -1
- package/dist/{Select-D7Cs1OlG.js → Select-DpnghyhT.js} +4 -4
- package/dist/Select.es.js +1 -1
- package/dist/SelectSearch.es.js +1 -1
- package/dist/Steps.es.js +14 -14
- package/dist/TabLinks.es.js +2 -2
- package/dist/Table.es.js +2 -2
- package/dist/Toast.es.js +23 -23
- package/dist/Tooltip.es.js +7 -7
- package/dist/components/Spinner/SpinnerV2.d.ts +12 -0
- package/dist/components/Toaster/Toaster.d.ts +3 -3
- package/dist/exports/Icons.d.ts +1 -1
- package/dist/index.d.ts +0 -12
- package/dist/prometeo-design-system.css +1 -1
- package/dist/prometeo-design-system.es.js +111 -122
- package/package.json +1 -23
- package/dist/CheckboxFormik.d.ts +0 -6
- package/dist/CheckboxFormik.es.js +0 -88
- package/dist/HelperComponent-CcGxM09g.js +0 -24
- package/dist/Icons-ChYkaR8R.js +0 -899
- package/dist/InputFormik.d.ts +0 -6
- package/dist/InputFormik.es.js +0 -213
- package/dist/InputFormikV2.d.ts +0 -6
- package/dist/InputFormikV2.es.js +0 -41
- package/dist/RadioButtonFormik.d.ts +0 -2
- package/dist/RadioButtonFormik.es.js +0 -30
- package/dist/SelectFormik.d.ts +0 -6
- package/dist/SelectFormik.es.js +0 -62
- package/dist/SelectFormikLegacy.d.ts +0 -6
- package/dist/SelectFormikLegacy.es.js +0 -194
- package/dist/components/CheckboxFormik/CheckboxFormik.d.ts +0 -12
- package/dist/components/InputFormik/InputFormik.d.ts +0 -23
- package/dist/components/InputFormik/InputFormikV2.d.ts +0 -6
- package/dist/components/RadioButtonFormik/RadioButtonFormik.d.ts +0 -8
- package/dist/components/SelectFormik/SelectFormik.d.ts +0 -8
- package/dist/components/SelectFormik/SelectFormikLegacy.d.ts +0 -21
- package/dist/exports/CheckboxFormik.d.ts +0 -2
- package/dist/exports/InputFormik.d.ts +0 -2
- package/dist/exports/InputFormikV2.d.ts +0 -2
- package/dist/exports/RadioButtonFormik.d.ts +0 -1
- package/dist/exports/SelectFormik.d.ts +0 -2
- package/dist/exports/SelectFormikLegacy.d.ts +0 -2
- package/dist/pages/Autocomplete.page.d.ts +0 -2
- package/dist/pages/ButtonsPage.d.ts +0 -2
- package/dist/pages/DatePicker.d.ts +0 -2
- package/dist/pages/DialogPage.d.ts +0 -2
- package/dist/pages/DrawersPage.d.ts +0 -2
- package/dist/pages/ImagesPage.d.ts +0 -2
- package/dist/pages/OtpPage.d.ts +0 -2
- package/dist/pages/RecurrentDatePicker.page.d.ts +0 -2
- package/dist/pages/SelectsPage.d.ts +0 -2
- package/dist/pages/Skeletons.d.ts +0 -2
- package/dist/pages/ToastsPage.d.ts +0 -2
- package/dist/preview/AutocompletePreview.d.ts +0 -2
- package/dist/preview/ButtonPreview.d.ts +0 -2
- package/dist/preview/DialogModalPreview.d.ts +0 -2
- package/dist/preview/DrawerMobilePreview.d.ts +0 -2
- package/dist/preview/Dropzone.d.ts +0 -2
- package/dist/preview/FABPreview.d.ts +0 -2
- package/dist/preview/IconsPreview.d.ts +0 -2
- package/dist/preview/ImagePreview.d.ts +0 -2
- package/dist/preview/InputsPreviews.d.ts +0 -2
- package/dist/preview/Layout.d.ts +0 -2
- package/dist/preview/OTPPreview.d.ts +0 -2
- package/dist/preview/RadioButtonPreview.d.ts +0 -2
- package/dist/preview/RecurrentDatePickerPreview.d.ts +0 -2
- package/dist/preview/SegmentedButtonPreview.d.ts +0 -2
- package/dist/preview/SelectPreview/CustomFooterExample.d.ts +0 -2
- package/dist/preview/SelectPreview/SelectGroupedOptionsPreview.d.ts +0 -2
- package/dist/preview/SelectPreview/SelectPreview.d.ts +0 -2
- package/dist/preview/SidebarPreview.d.ts +0 -2
- package/dist/preview/StepsPreview.d.ts +0 -2
- package/dist/preview/SwitchPreview.d.ts +0 -2
- package/dist/preview/TabLinks.d.ts +0 -2
- package/dist/preview/TablePreview.d.ts +0 -2
- package/dist/preview/TextArea.d.ts +0 -2
- package/dist/preview/ToastsPreview.d.ts +0 -2
package/dist/InputFormik.d.ts
DELETED
package/dist/InputFormik.es.js
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import { c as u } from "./cn-B6yFEsav.js";
|
|
3
|
-
import { FastField as q, ErrorMessage as G } from "formik";
|
|
4
|
-
import { memo as H, useState as S, useRef as J, useCallback as y, useLayoutEffect as Q } from "react";
|
|
5
|
-
import { I as N } from "./Icons-ChYkaR8R.js";
|
|
6
|
-
const W = ({
|
|
7
|
-
icon: t,
|
|
8
|
-
iconPosition: r = "left",
|
|
9
|
-
label: d,
|
|
10
|
-
className: B,
|
|
11
|
-
containerClassName: R,
|
|
12
|
-
id: w,
|
|
13
|
-
type: j = "text",
|
|
14
|
-
labelVariant: n = "default",
|
|
15
|
-
placeholder: p,
|
|
16
|
-
disabled: b = !1,
|
|
17
|
-
field: a,
|
|
18
|
-
innerRef: $,
|
|
19
|
-
form: z,
|
|
20
|
-
...l
|
|
21
|
-
}) => {
|
|
22
|
-
const [o, v] = S(!1), [C, K] = S(!1), i = J(null), F = z.getFieldMeta(a.name), k = F.touched && F.error, E = a.value && a.value.toString().length > 0, x = j === "password", M = x ? C ? "text" : "password" : j, P = () => n === "static" ? p || d : p || "", A = () => x ? t ? r === "left" ? "pl-10 pr-10" : "pr-16" : "pr-10" : t ? r === "left" ? "pl-10" : "pr-10" : "", D = y(() => {
|
|
23
|
-
v(!0), l.onFocus?.();
|
|
24
|
-
}, [l]), T = y(
|
|
25
|
-
(c) => {
|
|
26
|
-
v(!1), l.onBlur?.(), a.onBlur(c);
|
|
27
|
-
},
|
|
28
|
-
[a, l]
|
|
29
|
-
), U = y(() => {
|
|
30
|
-
K((c) => !c);
|
|
31
|
-
}, []);
|
|
32
|
-
Q(() => {
|
|
33
|
-
if (i.current) {
|
|
34
|
-
const L = ((O) => {
|
|
35
|
-
let s = O;
|
|
36
|
-
for (; s && s !== document.body; ) {
|
|
37
|
-
const f = window.getComputedStyle(s).backgroundColor;
|
|
38
|
-
if (f && f !== "transparent" && f !== "rgba(0, 0, 0, 0)")
|
|
39
|
-
return f;
|
|
40
|
-
s = s.parentElement;
|
|
41
|
-
}
|
|
42
|
-
const m = window.getComputedStyle(document.body).backgroundColor;
|
|
43
|
-
return m && m !== "transparent" && m !== "rgba(0, 0, 0, 0)" ? m : "rgb(255, 255, 255)";
|
|
44
|
-
})(
|
|
45
|
-
i.current.parentElement
|
|
46
|
-
);
|
|
47
|
-
i.current.style.backgroundColor = L;
|
|
48
|
-
}
|
|
49
|
-
}, []);
|
|
50
|
-
const g = {
|
|
51
|
-
default: {
|
|
52
|
-
input: `${o && "ring-primary-default-default ring-[1px] "} border-neutral-default-default hover:border-primary-default-default`,
|
|
53
|
-
label: `${o ? "text-primary-default-default" : "text-neutral-medium-default"}`,
|
|
54
|
-
icon: {},
|
|
55
|
-
placeholder: {}
|
|
56
|
-
},
|
|
57
|
-
disabled: {
|
|
58
|
-
input: "border-neutral-default-disabled text-neutral-default-disabled prometeo-fonts-body-large",
|
|
59
|
-
label: "text-neutral-medium-disabled",
|
|
60
|
-
icon: "text-neutral-medium-disabled",
|
|
61
|
-
placeholder: {}
|
|
62
|
-
},
|
|
63
|
-
error: {
|
|
64
|
-
input: "border-error-default-default ",
|
|
65
|
-
label: "text-error-medium-default",
|
|
66
|
-
icon: {},
|
|
67
|
-
placeholder: {}
|
|
68
|
-
},
|
|
69
|
-
success: {
|
|
70
|
-
input: {},
|
|
71
|
-
label: {},
|
|
72
|
-
icon: {},
|
|
73
|
-
placeholder: {}
|
|
74
|
-
},
|
|
75
|
-
warning: {
|
|
76
|
-
input: {},
|
|
77
|
-
label: {},
|
|
78
|
-
icon: {},
|
|
79
|
-
placeholder: {}
|
|
80
|
-
}
|
|
81
|
-
}, V = {
|
|
82
|
-
none: {
|
|
83
|
-
label: "left-2 "
|
|
84
|
-
},
|
|
85
|
-
left: {
|
|
86
|
-
label: `left-9 ${(o || E || n === "static") && "left-2"} `
|
|
87
|
-
},
|
|
88
|
-
right: {
|
|
89
|
-
label: "left-2"
|
|
90
|
-
}
|
|
91
|
-
}, I = {
|
|
92
|
-
static: {
|
|
93
|
-
input: "placeholder:text-neutral-medium-default placeholder:opacity-50",
|
|
94
|
-
label: "-top-1 -translate-y-full scale-90 px-0 "
|
|
95
|
-
},
|
|
96
|
-
default: {
|
|
97
|
-
input: `${p && o ? "placeholder:text-neutral-medium-default placeholder:opacity-50" : "placeholder:text-transparent"}`,
|
|
98
|
-
label: `top-1/2 -translate-y-1/2 scale-100 peer-focus:text-sm peer-placeholder-shown:text-base ${(o || E) && "top-0 scale-90"}`
|
|
99
|
-
}
|
|
100
|
-
}, h = b ? "disabled" : k ? "error" : "default";
|
|
101
|
-
return /* @__PURE__ */ e.jsxs(
|
|
102
|
-
"div",
|
|
103
|
-
{
|
|
104
|
-
className: u(
|
|
105
|
-
"relative w-full bg-inherit",
|
|
106
|
-
n === "static" && "mt-5",
|
|
107
|
-
R
|
|
108
|
-
),
|
|
109
|
-
children: [
|
|
110
|
-
/* @__PURE__ */ e.jsxs("div", { className: "relative bg-inherit", children: [
|
|
111
|
-
/* @__PURE__ */ e.jsx(
|
|
112
|
-
"input",
|
|
113
|
-
{
|
|
114
|
-
disabled: b,
|
|
115
|
-
id: w || a.name,
|
|
116
|
-
type: M,
|
|
117
|
-
name: a.name,
|
|
118
|
-
value: a.value || "",
|
|
119
|
-
placeholder: P(),
|
|
120
|
-
onChange: a.onChange,
|
|
121
|
-
onFocus: D,
|
|
122
|
-
onEmptied: l.onEmptied,
|
|
123
|
-
onKeyDown: l.onKeyDown,
|
|
124
|
-
onKeyUp: l.onKeyUp,
|
|
125
|
-
onBlur: T,
|
|
126
|
-
className: u(
|
|
127
|
-
"w-full px-3 h-12 text-left border-[1px] rounded-lg transition-all duration-200 ease-in-out text-neutral-default-default",
|
|
128
|
-
"bg-transparent focus:outline-none",
|
|
129
|
-
I[n].input,
|
|
130
|
-
g[h].input,
|
|
131
|
-
A(),
|
|
132
|
-
B
|
|
133
|
-
),
|
|
134
|
-
ref: $
|
|
135
|
-
}
|
|
136
|
-
),
|
|
137
|
-
/* @__PURE__ */ e.jsx(
|
|
138
|
-
"label",
|
|
139
|
-
{
|
|
140
|
-
ref: i,
|
|
141
|
-
htmlFor: w || l.name,
|
|
142
|
-
className: u(
|
|
143
|
-
"absolute transition-all duration-200 font-bold text-sm ease-in-out pointer-events-none bg-inherit px-1 z-10",
|
|
144
|
-
"prometeo-fonts-label-large text-sm",
|
|
145
|
-
V[t ? r : "none"].label,
|
|
146
|
-
I[n].label,
|
|
147
|
-
g[h].label
|
|
148
|
-
),
|
|
149
|
-
children: d
|
|
150
|
-
}
|
|
151
|
-
),
|
|
152
|
-
t && /* @__PURE__ */ e.jsx(
|
|
153
|
-
"div",
|
|
154
|
-
{
|
|
155
|
-
className: u(
|
|
156
|
-
"absolute top-1/2 -translate-y-1/2 text-neutral-medium-default",
|
|
157
|
-
g[h].icon,
|
|
158
|
-
r === "left" ? "left-3" : "right-3"
|
|
159
|
-
),
|
|
160
|
-
children: t
|
|
161
|
-
}
|
|
162
|
-
),
|
|
163
|
-
x && /* @__PURE__ */ e.jsx(
|
|
164
|
-
"button",
|
|
165
|
-
{
|
|
166
|
-
type: "button",
|
|
167
|
-
onClick: U,
|
|
168
|
-
className: u(
|
|
169
|
-
"absolute top-1/2 -translate-y-1/2 p-1 text-neutral-medium-default hover:text-neutral-strong-default",
|
|
170
|
-
"transition-colors duration-200 focus:outline-none focus:text-primary-default-default",
|
|
171
|
-
t && r === "right" ? "right-8" : "right-3"
|
|
172
|
-
),
|
|
173
|
-
tabIndex: -1,
|
|
174
|
-
disabled: b,
|
|
175
|
-
children: C ? /* @__PURE__ */ e.jsx(
|
|
176
|
-
N.EyeVisibility,
|
|
177
|
-
{
|
|
178
|
-
size: 24,
|
|
179
|
-
className: "text-neutral-default-default"
|
|
180
|
-
}
|
|
181
|
-
) : /* @__PURE__ */ e.jsx(
|
|
182
|
-
N.EyeVisibilityOff,
|
|
183
|
-
{
|
|
184
|
-
size: 24,
|
|
185
|
-
className: "text-neutral-default-default"
|
|
186
|
-
}
|
|
187
|
-
)
|
|
188
|
-
}
|
|
189
|
-
)
|
|
190
|
-
] }),
|
|
191
|
-
k && /* @__PURE__ */ e.jsx(
|
|
192
|
-
G,
|
|
193
|
-
{
|
|
194
|
-
name: a.name,
|
|
195
|
-
component: "span",
|
|
196
|
-
className: "block text-error-default-default text-xs mt-1"
|
|
197
|
-
}
|
|
198
|
-
)
|
|
199
|
-
]
|
|
200
|
-
}
|
|
201
|
-
);
|
|
202
|
-
}, X = H(W), le = (t) => /* @__PURE__ */ e.jsx(q, { name: t.name, children: ({ field: r, form: d }) => /* @__PURE__ */ e.jsx(
|
|
203
|
-
X,
|
|
204
|
-
{
|
|
205
|
-
...t,
|
|
206
|
-
field: r,
|
|
207
|
-
form: d,
|
|
208
|
-
innerRef: t.innerRef
|
|
209
|
-
}
|
|
210
|
-
) });
|
|
211
|
-
export {
|
|
212
|
-
le as default
|
|
213
|
-
};
|
package/dist/InputFormikV2.d.ts
DELETED
package/dist/InputFormikV2.es.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { j as i } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import { FastField as m, getIn as n } from "formik";
|
|
3
|
-
import { memo as s } from "react";
|
|
4
|
-
import { I as d } from "./Input-CsNlU1Hu.js";
|
|
5
|
-
const f = ({
|
|
6
|
-
field: a,
|
|
7
|
-
form: r,
|
|
8
|
-
...e
|
|
9
|
-
}) => {
|
|
10
|
-
const t = r.getFieldMeta(a.name), o = t.touched && t.error;
|
|
11
|
-
return /* @__PURE__ */ i.jsx(
|
|
12
|
-
d,
|
|
13
|
-
{
|
|
14
|
-
...e,
|
|
15
|
-
...a,
|
|
16
|
-
value: a.value,
|
|
17
|
-
onChange: (u) => {
|
|
18
|
-
a.onChange({ target: { value: u.target.value, name: a.name } });
|
|
19
|
-
},
|
|
20
|
-
variant: o ? "error" : "default",
|
|
21
|
-
errorComponent: t.error,
|
|
22
|
-
type: e.type,
|
|
23
|
-
ref: e.innerRef,
|
|
24
|
-
disabled: e.disabled
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
}, l = s(f), h = (a) => /* @__PURE__ */ i.jsx(
|
|
28
|
-
m,
|
|
29
|
-
{
|
|
30
|
-
name: a.name,
|
|
31
|
-
disabled: a.disabled,
|
|
32
|
-
shouldUpdate: (r, e) => {
|
|
33
|
-
const t = r.name;
|
|
34
|
-
return r.disabled !== e.disabled || t !== e.name || n(r.formik.values, t) !== n(e.formik.values, t) || n(r.formik.errors, t) !== n(e.formik.errors, t) || n(r.formik.touched, t) !== n(e.formik.touched, t) || r.formik.isSubmitting !== e.formik.isSubmitting || Object.keys(r).length !== Object.keys(e).length;
|
|
35
|
-
},
|
|
36
|
-
children: ({ field: r, form: e }) => /* @__PURE__ */ i.jsx(l, { ...a, field: r, form: e, disabled: a.disabled })
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
export {
|
|
40
|
-
h as default
|
|
41
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import { FastField as i } from "formik";
|
|
3
|
-
import { memo as s } from "react";
|
|
4
|
-
import { RadioButton as u } from "./RadioButton.es.js";
|
|
5
|
-
const c = ({
|
|
6
|
-
field: o,
|
|
7
|
-
form: t,
|
|
8
|
-
value: r,
|
|
9
|
-
// Este es el valor que representa ESTE radio button específico
|
|
10
|
-
...m
|
|
11
|
-
}) => {
|
|
12
|
-
const n = t.getFieldMeta(o.name), a = n.touched && n.error;
|
|
13
|
-
return /* @__PURE__ */ e.jsx(
|
|
14
|
-
u,
|
|
15
|
-
{
|
|
16
|
-
...m,
|
|
17
|
-
name: o.name,
|
|
18
|
-
value: r,
|
|
19
|
-
checked: o.value === r,
|
|
20
|
-
onChange: o.onChange,
|
|
21
|
-
onBlur: o.onBlur,
|
|
22
|
-
errorComponent: n.error,
|
|
23
|
-
variant: a ? "error" : "default"
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
}, d = s(c), B = (o) => /* @__PURE__ */ e.jsx(i, { name: o.name, children: ({ field: t, form: r }) => /* @__PURE__ */ e.jsx(d, { ...o, field: t, form: r }) });
|
|
27
|
-
B.displayName = "RadioButtonFormik";
|
|
28
|
-
export {
|
|
29
|
-
B as RadioButtonFormik
|
|
30
|
-
};
|
package/dist/SelectFormik.d.ts
DELETED
package/dist/SelectFormik.es.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { j as c } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import { useField as y } from "formik";
|
|
3
|
-
import { S as m } from "./Select-D7Cs1OlG.js";
|
|
4
|
-
import { useRef as p, useEffect as g } from "react";
|
|
5
|
-
function f(e) {
|
|
6
|
-
return Array.isArray(e) && e.every(
|
|
7
|
-
(l) => typeof l == "string" || typeof l == "number"
|
|
8
|
-
);
|
|
9
|
-
}
|
|
10
|
-
function v(e) {
|
|
11
|
-
return e == null || typeof e == "string" || typeof e == "number";
|
|
12
|
-
}
|
|
13
|
-
const S = (e) => {
|
|
14
|
-
const [l, a, r] = y(e.name), u = p(!1), o = Array.isArray(l.value);
|
|
15
|
-
if (g(() => {
|
|
16
|
-
u.current || (u.current = !0, o ? f(l.value) || (console.warn(
|
|
17
|
-
`SelectFormik: El valor del campo "${e.name}" no es un array válido de string | number. Valor recibido:`,
|
|
18
|
-
l.value,
|
|
19
|
-
"Inicializando como array vacío."
|
|
20
|
-
), r.setValue([])) : v(l.value) || (console.warn(
|
|
21
|
-
`SelectFormik: El valor del campo "${e.name}" no es un valor válido (string | number | null). Valor recibido:`,
|
|
22
|
-
l.value,
|
|
23
|
-
"Inicializando como null."
|
|
24
|
-
), r.setValue(null)));
|
|
25
|
-
}, [l.value, r, e.name, o]), o) {
|
|
26
|
-
const n = (d) => {
|
|
27
|
-
r.setValue(d.map((s) => s.value));
|
|
28
|
-
}, i = f(l.value) ? l.value : [], t = e?.displayMode || "chips";
|
|
29
|
-
return /* @__PURE__ */ c.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
|
-
r.setValue(s?.value ?? null);
|
|
44
|
-
}, i = v(l.value) ? l.value : void 0, { ...t } = e;
|
|
45
|
-
return /* @__PURE__ */ c.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
|
-
disabled: e.disabled
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
export {
|
|
61
|
-
S as default
|
|
62
|
-
};
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
-
import { I as g } from "./Icons-ChYkaR8R.js";
|
|
3
|
-
import { c as d } from "./cn-B6yFEsav.js";
|
|
4
|
-
import { useField as $, ErrorMessage as q } from "formik";
|
|
5
|
-
import { memo as G, useState as V, useRef as H, useEffect as J } from "react";
|
|
6
|
-
import K from "./Spinner.es.js";
|
|
7
|
-
const Q = ({
|
|
8
|
-
label: k,
|
|
9
|
-
name: C,
|
|
10
|
-
placeholder: b = "",
|
|
11
|
-
disabled: j,
|
|
12
|
-
containerClassName: S,
|
|
13
|
-
className: D,
|
|
14
|
-
options: c = [],
|
|
15
|
-
multiple: i = !1,
|
|
16
|
-
emptyMessage: z = "No hay opciones disponibles",
|
|
17
|
-
labelVariant: w = "default",
|
|
18
|
-
isFetching: E = !1,
|
|
19
|
-
returnFullObject: m = !1
|
|
20
|
-
// Por defecto false para mantener compatibilidad
|
|
21
|
-
}) => {
|
|
22
|
-
const [r, N, u] = $(C), [l, x] = V(!1), [p, A] = V(!1), h = H(null), v = N.touched && N.error, o = (e) => e ? typeof e == "object" && e.id !== void 0 ? e.id : e : null, I = () => 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
|
-
if (!r.value) return [];
|
|
24
|
-
const e = I();
|
|
25
|
-
return Array.isArray(e) ? c.filter((a) => e.includes(a.id)) : c.filter((a) => a.id === e);
|
|
26
|
-
}, P = (e) => {
|
|
27
|
-
if (i) {
|
|
28
|
-
const a = Array.isArray(r.value) ? r.value.map(o) : [], s = a.includes(e.id);
|
|
29
|
-
if (m) {
|
|
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
|
-
} else {
|
|
33
|
-
const n = s ? a.filter((y) => y !== e.id) : [...a, e.id];
|
|
34
|
-
u.setValue(n);
|
|
35
|
-
}
|
|
36
|
-
} else
|
|
37
|
-
u.setValue(m ? e : e.id), x(!1);
|
|
38
|
-
}, F = (e) => {
|
|
39
|
-
e.stopPropagation(), u.setValue(i ? [] : "");
|
|
40
|
-
}, M = (e, a) => {
|
|
41
|
-
if (a?.stopPropagation(), i && Array.isArray(r.value))
|
|
42
|
-
if (m) {
|
|
43
|
-
const s = r.value.filter(
|
|
44
|
-
(n) => o(n) !== e
|
|
45
|
-
);
|
|
46
|
-
u.setValue(s);
|
|
47
|
-
} else {
|
|
48
|
-
const s = r.value.filter(
|
|
49
|
-
(n) => n !== e
|
|
50
|
-
);
|
|
51
|
-
u.setValue(s);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
J(() => {
|
|
55
|
-
const e = (a) => {
|
|
56
|
-
h.current && !h.current.contains(a.target) && x(!1);
|
|
57
|
-
};
|
|
58
|
-
return l && document.addEventListener("mousedown", e), () => {
|
|
59
|
-
document.removeEventListener("mousedown", e);
|
|
60
|
-
};
|
|
61
|
-
}, [l]);
|
|
62
|
-
const R = () => {
|
|
63
|
-
const e = L();
|
|
64
|
-
return e.length === 0 ? b ? /* @__PURE__ */ t.jsx("span", { className: "text-neutral-medium-default opacity-50", children: b }) : null : i ? /* @__PURE__ */ t.jsx("div", { className: "flex items-center gap-1 flex-wrap py-1", children: e.map((a) => /* @__PURE__ */ t.jsxs(
|
|
65
|
-
"div",
|
|
66
|
-
{
|
|
67
|
-
className: "inline-flex items-center gap-1 px-2 py-1 bg-primary-default-default text-white text-xs rounded-md",
|
|
68
|
-
children: [
|
|
69
|
-
/* @__PURE__ */ t.jsx("span", { className: "truncate max-w-20", children: a.label }),
|
|
70
|
-
/* @__PURE__ */ t.jsx(
|
|
71
|
-
"button",
|
|
72
|
-
{
|
|
73
|
-
onMouseDown: (s) => {
|
|
74
|
-
s.preventDefault(), M(a.id, s);
|
|
75
|
-
},
|
|
76
|
-
className: "shrink-0 hover:bg-primary-strong-default rounded-sm p-0.5 transition-colors",
|
|
77
|
-
type: "button",
|
|
78
|
-
tabIndex: -1,
|
|
79
|
-
children: /* @__PURE__ */ t.jsx(g.Close, { size: 12, className: "" })
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
|
-
a.id
|
|
85
|
-
)) }) : /* @__PURE__ */ t.jsx("span", { children: e[0]?.label });
|
|
86
|
-
};
|
|
87
|
-
return /* @__PURE__ */ t.jsxs(
|
|
88
|
-
"div",
|
|
89
|
-
{
|
|
90
|
-
className: d("relative w-full bg-inherit", S),
|
|
91
|
-
ref: h,
|
|
92
|
-
children: [
|
|
93
|
-
/* @__PURE__ */ t.jsxs("div", { className: "relative bg-inherit", children: [
|
|
94
|
-
/* @__PURE__ */ t.jsxs(
|
|
95
|
-
"div",
|
|
96
|
-
{
|
|
97
|
-
onClick: () => !j && x(!l),
|
|
98
|
-
onFocus: () => A(!0),
|
|
99
|
-
onBlur: () => A(!1),
|
|
100
|
-
className: d(
|
|
101
|
-
"w-full px-3 h-12 text-left border rounded-lg transition-all duration-300 ease-in-out text-neutral-default-default",
|
|
102
|
-
"flex items-center justify-between bg-transparent focus:outline-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
|
-
D
|
|
106
|
-
),
|
|
107
|
-
children: [
|
|
108
|
-
/* @__PURE__ */ t.jsx(
|
|
109
|
-
"label",
|
|
110
|
-
{
|
|
111
|
-
className: d(
|
|
112
|
-
"absolute pointer-events-none bg-inherit px-1 z-10",
|
|
113
|
-
w === "default" && "transition-all duration-200 ease-in-out",
|
|
114
|
-
"text-md",
|
|
115
|
-
O(),
|
|
116
|
-
f || l || p ? "text-primary-default-default" : v ? "text-red-500" : "text-neutral-medium-default",
|
|
117
|
-
"left-3"
|
|
118
|
-
),
|
|
119
|
-
children: k
|
|
120
|
-
}
|
|
121
|
-
),
|
|
122
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex-1 min-w-0", children: R() }),
|
|
123
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 ml-2", children: [
|
|
124
|
-
f && /* @__PURE__ */ t.jsx(
|
|
125
|
-
"button",
|
|
126
|
-
{
|
|
127
|
-
onMouseDown: (e) => {
|
|
128
|
-
e.preventDefault(), e.stopPropagation(), F(e);
|
|
129
|
-
},
|
|
130
|
-
className: "text-neutral-medium-default hover:text-neutral-default-default transition-colors",
|
|
131
|
-
type: "button",
|
|
132
|
-
tabIndex: -1,
|
|
133
|
-
children: /* @__PURE__ */ t.jsx(g.Close, { size: 16, className: "" })
|
|
134
|
-
}
|
|
135
|
-
),
|
|
136
|
-
E ? /* @__PURE__ */ t.jsx(K, { size: 20, variant: "clip" }) : /* @__PURE__ */ t.jsx(
|
|
137
|
-
g.ChevronDown,
|
|
138
|
-
{
|
|
139
|
-
size: 20,
|
|
140
|
-
className: d(
|
|
141
|
-
"transition-transform text-neutral-default-default",
|
|
142
|
-
l ? "rotate-180" : ""
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
)
|
|
146
|
-
] })
|
|
147
|
-
]
|
|
148
|
-
}
|
|
149
|
-
),
|
|
150
|
-
l && /* @__PURE__ */ t.jsx("div", { className: "absolute z-50 w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-md shadow-lg max-h-60 overflow-auto", children: c.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: z }) : c.map((e) => {
|
|
151
|
-
const a = I(), s = i ? Array.isArray(a) && a.includes(e.id) : a === e.id;
|
|
152
|
-
return /* @__PURE__ */ t.jsxs(
|
|
153
|
-
"div",
|
|
154
|
-
{
|
|
155
|
-
onMouseDown: (n) => {
|
|
156
|
-
n.preventDefault(), P(e), n.stopPropagation();
|
|
157
|
-
},
|
|
158
|
-
className: d(
|
|
159
|
-
"px-3 py-2 cursor-pointer flex items-center transition-colors",
|
|
160
|
-
s ? "bg-primary-default-default text-white" : "hover:bg-neutral-medium-selected text-neutral-default-default"
|
|
161
|
-
),
|
|
162
|
-
children: [
|
|
163
|
-
i && /* @__PURE__ */ t.jsx(
|
|
164
|
-
"input",
|
|
165
|
-
{
|
|
166
|
-
type: "checkbox",
|
|
167
|
-
checked: s,
|
|
168
|
-
onChange: () => {
|
|
169
|
-
},
|
|
170
|
-
className: "mr-2 pointer-events-none"
|
|
171
|
-
}
|
|
172
|
-
),
|
|
173
|
-
/* @__PURE__ */ t.jsx("span", { children: e.label })
|
|
174
|
-
]
|
|
175
|
-
},
|
|
176
|
-
e.id
|
|
177
|
-
);
|
|
178
|
-
}) })
|
|
179
|
-
] }),
|
|
180
|
-
v && /* @__PURE__ */ t.jsx(
|
|
181
|
-
q,
|
|
182
|
-
{
|
|
183
|
-
name: r.name,
|
|
184
|
-
component: "span",
|
|
185
|
-
className: "block text-error-default-default text-xs mt-1"
|
|
186
|
-
}
|
|
187
|
-
)
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
);
|
|
191
|
-
}, _ = G(Q);
|
|
192
|
-
export {
|
|
193
|
-
_ as default
|
|
194
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface ICheckboxFormik {
|
|
2
|
-
label: string;
|
|
3
|
-
name: string;
|
|
4
|
-
className?: string;
|
|
5
|
-
containerClassName?: string;
|
|
6
|
-
id?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
onBlur?: () => void;
|
|
9
|
-
onFocus?: () => void;
|
|
10
|
-
}
|
|
11
|
-
declare const CheckboxFormik: ({ label, className, containerClassName, id, disabled, ...props }: ICheckboxFormik) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export default CheckboxFormik;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export type LabelVariant = "default" | "static";
|
|
3
|
-
export interface IInputFormik {
|
|
4
|
-
label: string;
|
|
5
|
-
icon?: ReactNode;
|
|
6
|
-
iconPosition?: "left" | "right";
|
|
7
|
-
className?: string;
|
|
8
|
-
containerClassName?: string;
|
|
9
|
-
id?: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
name: string;
|
|
12
|
-
labelVariant?: LabelVariant;
|
|
13
|
-
placeholder?: string;
|
|
14
|
-
onBlur?: () => void;
|
|
15
|
-
onFocus?: () => void;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
onEmptied?: () => void;
|
|
18
|
-
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
19
|
-
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
20
|
-
innerRef?: React.Ref<HTMLInputElement>;
|
|
21
|
-
}
|
|
22
|
-
declare const InputFormik: (props: IInputFormik) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export default InputFormik;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { InputProps } from '../../index';
|
|
2
|
-
export interface IInputFormikV2 extends Omit<InputProps, 'onChange' | 'form'> {
|
|
3
|
-
innerRef?: React.Ref<HTMLInputElement>;
|
|
4
|
-
}
|
|
5
|
-
declare const InputFormik: (props: IInputFormikV2) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export default InputFormik;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { RadioButtonProps } from '../RadioButton/RadioButton';
|
|
2
|
-
export interface RadioButtonFormikProps extends Omit<RadioButtonProps, 'onChange' | 'form'> {
|
|
3
|
-
}
|
|
4
|
-
declare const RadioButtonFormik: {
|
|
5
|
-
(props: RadioButtonFormikProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export default RadioButtonFormik;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseSelectProps } from '../Select/Select';
|
|
2
|
-
import { JSX } from 'react';
|
|
3
|
-
export interface SelectFormikProps<T> extends Omit<BaseSelectProps<T>, 'value' | 'onChange' | 'multiple'> {
|
|
4
|
-
name: string;
|
|
5
|
-
displayMode?: "chips" | "compact";
|
|
6
|
-
}
|
|
7
|
-
declare const SelectFormik: <T>(props: SelectFormikProps<T>) => JSX.Element;
|
|
8
|
-
export default SelectFormik;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface ISelectFormikOption {
|
|
2
|
-
id: number | string;
|
|
3
|
-
label: string;
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
}
|
|
6
|
-
export interface ISelectFormik {
|
|
7
|
-
label: string;
|
|
8
|
-
name: string;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
containerClassName: string;
|
|
12
|
-
className: string;
|
|
13
|
-
labelVariant?: "default" | "static";
|
|
14
|
-
options: ISelectFormikOption[];
|
|
15
|
-
multiple?: boolean;
|
|
16
|
-
emptyMessage?: string;
|
|
17
|
-
isFetching?: boolean;
|
|
18
|
-
returnFullObject?: boolean;
|
|
19
|
-
}
|
|
20
|
-
declare const _default: import('react').MemoExoticComponent<({ label, name, placeholder, disabled, containerClassName, className, options, multiple, emptyMessage, labelVariant, isFetching, returnFullObject, }: ISelectFormik) => import("react/jsx-runtime").JSX.Element>;
|
|
21
|
-
export default _default;
|