prometeo-design-system 2.3.6 → 2.3.8
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/Avatar.es.js +1 -1
- package/dist/{Button-Bc0LYLfg.js → Button-DsbEyjth.js} +1 -1
- package/dist/Button.es.js +1 -1
- package/dist/{CardProfile-BhHJmvqs.js → CardProfile-Fn44kEnM.js} +1 -1
- package/dist/CardProfile.es.js +1 -1
- package/dist/CheckBox.es.js +1 -1
- package/dist/CheckboxFormik.es.js +1 -1
- package/dist/DatePicker.es.js +2 -2
- package/dist/DialogModal.es.js +51 -48
- package/dist/DrawerDesktop.es.js +2 -2
- package/dist/DrawerMobile.es.js +1 -1
- package/dist/DropZone.es.js +1 -1
- package/dist/Header.es.js +1 -1
- package/dist/Icons.es.js +1 -1
- package/dist/Image.es.js +1 -1
- package/dist/{ImageGallery-BeADef_g.js → ImageGallery-DnoRTpCr.js} +2 -2
- package/dist/ImageGallery.es.js +1 -1
- package/dist/Input.es.js +1 -1
- package/dist/InputFormik.es.js +1 -1
- package/dist/InputMultiple.es.js +1 -1
- package/dist/{LayoutGeneric-jDE96L2N.js → LayoutGeneric-p4Pll4Cm.js} +1 -1
- package/dist/LayoutGeneric.es.js +1 -1
- package/dist/Logo.es.js +1 -1
- package/dist/Menu.es.js +1 -1
- package/dist/OtpInput.es.js +1 -1
- package/dist/Pagination.es.js +1 -1
- package/dist/ProfilePictureUpload.es.js +1 -1
- package/dist/ProgressBar.es.js +1 -1
- package/dist/SegmentedButton.es.js +1 -1
- package/dist/Select.es.js +1 -1
- package/dist/SelectFormik.es.js +15 -188
- package/dist/SelectFormikLegacy.d.ts +6 -0
- package/dist/SelectFormikLegacy.es.js +194 -0
- package/dist/Skeleton.es.js +1 -1
- package/dist/Spinner.es.js +1 -1
- package/dist/Steps.es.js +1 -1
- package/dist/SwipeContainer.es.js +1 -1
- package/dist/Switch.es.js +1 -1
- package/dist/TabLinks.es.js +1 -1
- package/dist/Table.es.js +1 -1
- package/dist/TextArea.es.js +1 -1
- package/dist/Tooltip.es.js +1 -1
- package/dist/components/SelectFormik/SelectFormik.d.ts +4 -19
- package/dist/components/SelectFormik/SelectFormikLegacy.d.ts +21 -0
- package/dist/exports/SelectFormik.d.ts +1 -1
- package/dist/exports/SelectFormikLegacy.d.ts +2 -0
- package/dist/index.d.ts +3 -1
- package/dist/{jsx-runtime-ByW6EXIE.js → jsx-runtime-DKDX3adD.js} +94 -96
- package/dist/prometeo-design-system.es.js +50 -48
- package/package.json +1 -1
- package/dist/components/SelectFormik/SelectFormikV2.d.ts +0 -6
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
+
import { Icons as g } from "./Icons.es.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 k, useRef as H, useEffect as J } from "react";
|
|
6
|
+
import K from "./Spinner.es.js";
|
|
7
|
+
const Q = ({
|
|
8
|
+
label: C,
|
|
9
|
+
name: I,
|
|
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, 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 = () => {
|
|
23
|
+
if (!r.value) return [];
|
|
24
|
+
const e = V();
|
|
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(u) : [], s = a.includes(e.id);
|
|
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);
|
|
32
|
+
} else {
|
|
33
|
+
const n = s ? a.filter((y) => y !== e.id) : [...a, e.id];
|
|
34
|
+
o.setValue(n);
|
|
35
|
+
}
|
|
36
|
+
} else
|
|
37
|
+
o.setValue(m ? e : e.id), x(!1);
|
|
38
|
+
}, F = (e) => {
|
|
39
|
+
e.stopPropagation(), o.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) => u(n) !== e
|
|
45
|
+
);
|
|
46
|
+
o.setValue(s);
|
|
47
|
+
} else {
|
|
48
|
+
const s = r.value.filter(
|
|
49
|
+
(n) => n !== e
|
|
50
|
+
);
|
|
51
|
+
o.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: "flex-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-1 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-[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",
|
|
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: C
|
|
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 = V(), 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
|
+
};
|
package/dist/Skeleton.es.js
CHANGED
package/dist/Spinner.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-DKDX3adD.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
package/dist/Switch.es.js
CHANGED
package/dist/TabLinks.es.js
CHANGED
package/dist/Table.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as r } from "./jsx-runtime-
|
|
1
|
+
import { j as r } from "./jsx-runtime-DKDX3adD.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(
|
package/dist/TextArea.es.js
CHANGED
package/dist/Tooltip.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as e } from "./jsx-runtime-
|
|
1
|
+
import { j as e } from "./jsx-runtime-DKDX3adD.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,21 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
label: string;
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
}
|
|
6
|
-
export interface ISelectFormik {
|
|
7
|
-
label: string;
|
|
1
|
+
import { SelectProps } from '../Select/Select';
|
|
2
|
+
export interface SelectFormikProps<T> extends Omit<SelectProps<T>, 'value' | 'onChange'> {
|
|
8
3
|
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
4
|
}
|
|
20
|
-
declare const
|
|
21
|
-
export default
|
|
5
|
+
declare const SelectFormik: <T>(props: SelectFormikProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default SelectFormik;
|
|
@@ -0,0 +1,21 @@
|
|
|
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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from '../components/SelectFormik/SelectFormik';
|
|
2
|
-
export type {
|
|
2
|
+
export type { SelectFormikProps } from '../components/SelectFormik/SelectFormik';
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { default as Pagination } from './components/Pagination/Pagination';
|
|
|
16
16
|
export { ProfilePictureUpload } from './components/ProfilePictureUpload/ProfilePictureUpload';
|
|
17
17
|
export { default as ProgressBar } from './components/ProgressBar/ProgressBar';
|
|
18
18
|
export { default as Select } from './components/Select/Select';
|
|
19
|
+
export { default as SelectFormikLegacy } from './components/SelectFormik/SelectFormikLegacy';
|
|
19
20
|
export { default as SelectFormik } from './components/SelectFormik/SelectFormik';
|
|
20
21
|
export { default as ChangueAccount } from './components/Sidebar/components/changue-account';
|
|
21
22
|
export { default as Spinner } from './components/Spinner/Spinner';
|
|
@@ -71,7 +72,8 @@ export type { PaginationProps } from './components/Pagination/Pagination';
|
|
|
71
72
|
export type { ProfilePictureUploadProps } from './components/ProfilePictureUpload/ProfilePictureUpload';
|
|
72
73
|
export type { Step, StepsProps } from './components/Steps/Steps';
|
|
73
74
|
export type { SelectProps } from './components/Select/Select';
|
|
74
|
-
export type { ISelectFormik, ISelectFormikOption, } from './components/SelectFormik/
|
|
75
|
+
export type { ISelectFormik, ISelectFormikOption, } from './components/SelectFormik/SelectFormikLegacy';
|
|
76
|
+
export type { SelectFormikProps } from './components/SelectFormik/SelectFormik';
|
|
75
77
|
export type { DialogHandle } from './components/Dialog/Dialog';
|
|
76
78
|
export { DropZone } from './components/DropZone/DropZone';
|
|
77
79
|
export type { ToasterPrometeo } from './components/Toaster/Toaster';
|