prometeo-design-system 7.2.0 → 7.2.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/DropZone.es.js +47 -47
- package/dist/Table.es.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/intellisense.css +345 -0
- package/src/styles/utilities.css +1568 -0
package/dist/DropZone.es.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as t } from "./cn-B6yFEsav.js";
|
|
3
3
|
import R, { useCallback as _ } from "react";
|
|
4
4
|
import { useDropzone as D } from "react-dropzone";
|
|
5
5
|
import $ from "./PlainTooltip.es.js";
|
|
6
6
|
import { Error as Y } from "./Icons/Error.es.js";
|
|
7
7
|
import { UploadCloud as z } from "./Icons/UploadCloud.es.js";
|
|
8
8
|
import { Info as P } from "./Icons/Info.es.js";
|
|
9
|
-
const
|
|
9
|
+
const a = {
|
|
10
10
|
FILE_INVALID_TYPE: "file-invalid-type",
|
|
11
11
|
FILE_TOO_LARGE: "file-too-large",
|
|
12
12
|
FILE_TOO_SMALL: "file-too-small",
|
|
13
13
|
TOO_MANY_FILES: "too-many-files"
|
|
14
|
-
}, h = (
|
|
15
|
-
const r =
|
|
14
|
+
}, h = (o) => {
|
|
15
|
+
const r = o / 1024 / 1024;
|
|
16
16
|
return r < 0.2 ? `${r * 1024} KB` : r < 1024 ? `${r} MB` : `${r / 1024} GB`;
|
|
17
|
-
}, E = (
|
|
17
|
+
}, E = (o) => Object.keys(o).map((r) => `${o[r].join(", ")}`).join(" "), S = R.forwardRef(
|
|
18
18
|
({
|
|
19
|
-
onFilesAccepted:
|
|
19
|
+
onFilesAccepted: o,
|
|
20
20
|
onFilesRejected: r,
|
|
21
21
|
className: L,
|
|
22
|
-
subtitle:
|
|
22
|
+
subtitle: b = "Arrastra y suelta el archivo aquí o haz clic para cargarlo desde tu computadora",
|
|
23
23
|
acceptedFormats: I,
|
|
24
|
-
variant:
|
|
24
|
+
variant: d = "default",
|
|
25
25
|
disabled: m = !1,
|
|
26
26
|
showIcon: O = !0,
|
|
27
|
-
accept:
|
|
28
|
-
maxFiles:
|
|
29
|
-
maxSize:
|
|
30
|
-
...
|
|
27
|
+
accept: c,
|
|
28
|
+
maxFiles: j = 1,
|
|
29
|
+
maxSize: u,
|
|
30
|
+
...v
|
|
31
31
|
}, M) => {
|
|
32
|
-
const
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
}, T = _((
|
|
38
|
-
|
|
39
|
-
}, [
|
|
32
|
+
const y = {
|
|
33
|
+
[a.FILE_INVALID_TYPE]: "Tipo de archivo no válido",
|
|
34
|
+
[a.FILE_TOO_LARGE]: `El archivo es demasiado grande, máx ${h(u ?? 0)}`,
|
|
35
|
+
[a.FILE_TOO_SMALL]: `El archivo es demasiado pequeño, mín ${h(v.minSize ?? 0)}`,
|
|
36
|
+
[a.TOO_MANY_FILES]: `Has llegado al límite de archivos permitidos, máximo ${j} archivos`
|
|
37
|
+
}, T = _((s, p) => {
|
|
38
|
+
s.length > 0 && o?.(s), p.length > 0 && r?.(p);
|
|
39
|
+
}, [o, r]), {
|
|
40
40
|
getRootProps: A,
|
|
41
41
|
getInputProps: w,
|
|
42
42
|
isDragActive: l,
|
|
@@ -44,60 +44,60 @@ const o = {
|
|
|
44
44
|
fileRejections: N
|
|
45
45
|
} = D({
|
|
46
46
|
onDrop: T,
|
|
47
|
-
accept:
|
|
48
|
-
maxFiles:
|
|
47
|
+
accept: c,
|
|
48
|
+
maxFiles: j,
|
|
49
49
|
disabled: m,
|
|
50
|
-
maxSize:
|
|
51
|
-
...
|
|
52
|
-
}),
|
|
53
|
-
/* @__PURE__ */ e.jsx("p", { className: "
|
|
54
|
-
x.map((
|
|
55
|
-
] },
|
|
56
|
-
return /* @__PURE__ */ e.jsx("div", { className:
|
|
50
|
+
maxSize: u,
|
|
51
|
+
...v
|
|
52
|
+
}), n = N.length > 0, F = _((s) => s.some((i) => i.errors.some((x) => x.code === a.TOO_MANY_FILES)) ? /* @__PURE__ */ e.jsx("div", { className: t("text-semantic-error-onneutral-default pyrion-fonts-body-medium space-y-1", d === "compact" && "max-h-14 *:line-clamp-1"), children: /* @__PURE__ */ e.jsx("p", { className: "pyrion-fonts-body-medium text-semantic-error-onneutral-default", children: y[a.TOO_MANY_FILES] }) }) : s.map(({ file: i, errors: x }) => /* @__PURE__ */ e.jsxs("div", { className: t("w-full p-1 rounded-lg border border-neutral-default-default bg-neutral-default-default", d === "compact" && "max-h-14 *:line-clamp-1 rounded-md"), children: [
|
|
53
|
+
/* @__PURE__ */ e.jsx("p", { className: "pyrion-fonts-label-small text-neutral-default-default", children: i.name }),
|
|
54
|
+
x.map((g) => /* @__PURE__ */ e.jsx("p", { className: "pyrion-fonts-body-xsmall text-semantic-error-onneutral-default", children: y[g.code] }, g.code))
|
|
55
|
+
] }, i.name)), []);
|
|
56
|
+
return /* @__PURE__ */ e.jsx("div", { className: t("w-full", L), children: /* @__PURE__ */ e.jsxs(
|
|
57
57
|
"div",
|
|
58
58
|
{
|
|
59
59
|
ref: M,
|
|
60
60
|
...A(),
|
|
61
|
-
className:
|
|
61
|
+
className: t(
|
|
62
62
|
"relative rounded-lg border border-dashed transition-all duration-200 h-full",
|
|
63
63
|
"flex flex-col items-center justify-center text-center gap-2",
|
|
64
|
-
|
|
65
|
-
!l && !
|
|
64
|
+
d === "default" ? "p-8 min-h-[250px] gap-3 " : "p-3 min-h-[120px]",
|
|
65
|
+
!l && !n && !m && [
|
|
66
66
|
"border-neutral-default-default",
|
|
67
|
-
"hover:border-
|
|
68
|
-
"hover:*:*:text-
|
|
67
|
+
"hover:border-brand-onneutral-hover! hover:cursor-pointer! ",
|
|
68
|
+
"hover:*:*:text-brand-onneutral-default! hover:*:text-brand-onneutral-hover *:duration-200 *:transition-all *:*:transition-all *:*:duration-200! "
|
|
69
69
|
],
|
|
70
70
|
"overflow-hidden",
|
|
71
71
|
l && !f && [
|
|
72
|
-
"border-
|
|
72
|
+
"border-brand-onneutral-default! *:*:text-brand-onneutral-pressed! "
|
|
73
73
|
],
|
|
74
|
-
(f ||
|
|
75
|
-
"border-error-
|
|
74
|
+
(f || n) && [
|
|
75
|
+
"border-semantic-error-onneutral-default"
|
|
76
76
|
],
|
|
77
77
|
m && [
|
|
78
78
|
"cursor-default opacity-60",
|
|
79
|
-
"border-
|
|
79
|
+
"border-disabled-default *:*:text-disabled-default! "
|
|
80
80
|
]
|
|
81
81
|
),
|
|
82
82
|
children: [
|
|
83
83
|
/* @__PURE__ */ e.jsx("input", { ...w() }),
|
|
84
|
-
|
|
85
|
-
O && /* @__PURE__ */ e.jsx("div", { children: (
|
|
84
|
+
b && /* @__PURE__ */ e.jsx("p", { className: "pyrion-fonts-body-medium text-pretty w-fit mx-3 ", children: b }),
|
|
85
|
+
O && /* @__PURE__ */ e.jsx("div", { children: (n || f) && !l ? /* @__PURE__ */ e.jsx(Y, { size: 32, className: " icon-semantic-error-onneutral-default" }) : /* @__PURE__ */ e.jsx(z, { size: 32, className: t(
|
|
86
86
|
"ransition-colors",
|
|
87
|
-
l ? "
|
|
87
|
+
l ? "icon-brand-onneutral-pressed" : "icon-neutral-default-default"
|
|
88
88
|
) }) }),
|
|
89
|
-
!
|
|
90
|
-
/* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-body-small text-neutral-medium-default line-clamp-1", children: I ?? `Formatos: ${E(
|
|
89
|
+
!n && /* @__PURE__ */ e.jsx("div", { className: "w-full overflow-hidden flex justify-center py-2 border border-transparent", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-0.5 w-[min(20rem,100%)]", children: [
|
|
90
|
+
/* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-body-small text-neutral-medium-default line-clamp-1", children: I ?? `Formatos: ${E(c ?? {})}` }),
|
|
91
91
|
/* @__PURE__ */ e.jsxs("p", { className: " prometeo-fonts-body-small text-neutral-medium-default shrink-0 ", children: [
|
|
92
92
|
"Máx. ",
|
|
93
|
-
h(
|
|
93
|
+
h(u ?? 0)
|
|
94
94
|
] }),
|
|
95
|
-
/* @__PURE__ */ e.jsx($, { title: E(
|
|
95
|
+
/* @__PURE__ */ e.jsx($, { title: E(c ?? {}), children: /* @__PURE__ */ e.jsx(P, { size: 16, className: "text-neutral-medium-default" }) })
|
|
96
96
|
] }) }),
|
|
97
|
-
|
|
97
|
+
n && /* @__PURE__ */ e.jsx("div", { className: t(
|
|
98
98
|
"w-full space-y-2 overflow-auto prometeo-scrollbar-thin transition-all duration-200",
|
|
99
99
|
l && "opacity-0",
|
|
100
|
-
|
|
100
|
+
d === "compact" && "grid place-items-center overflow-auto"
|
|
101
101
|
), children: F(N) })
|
|
102
102
|
]
|
|
103
103
|
}
|
package/dist/Table.es.js
CHANGED
|
@@ -134,7 +134,7 @@ const q = ({ className: e, children: r }) => /* @__PURE__ */ a.jsx(
|
|
|
134
134
|
{
|
|
135
135
|
role: "rowgroup",
|
|
136
136
|
className: s(
|
|
137
|
-
"grid [grid-template-columns:subgrid] [grid-column:1/-1] overflow-y-auto overflow-x-hidden min-h-0 pr-3 gap-y-2 pyrion-scrollbar-thin!",
|
|
137
|
+
"grid [grid-template-columns:subgrid] [grid-column:1/-1] content-start auto-rows-min overflow-y-auto overflow-x-hidden min-h-0 pr-3 gap-y-2 pyrion-scrollbar-thin!",
|
|
138
138
|
e
|
|
139
139
|
),
|
|
140
140
|
children: r
|