prometeo-design-system 7.4.0 → 7.4.1

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.
@@ -1,14 +1,15 @@
1
- import { j as r } from "./jsx-runtime-GkKLlHH4.js";
2
- import { c as s } from "./cn-B6yFEsav.js";
3
- import { memo as T, forwardRef as P, useCallback as E } from "react";
4
- import { useDropzone as G } from "react-dropzone";
5
- import H from "./PlainTooltip.es.js";
6
- import _ from "./HelperComponent.es.js";
1
+ import { j as t } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { c as o } from "./cn-B6yFEsav.js";
3
+ import { memo as P, forwardRef as E, useCallback as G } from "react";
4
+ import { useDropzone as H } from "react-dropzone";
5
+ import _ from "./CardBackground.es.js";
6
+ import q from "./PlainTooltip.es.js";
7
+ import K from "./HelperComponent.es.js";
7
8
  import { c as i } from "./index-BOQuZ0gG.js";
8
- import { UploadCloud as q } from "./Icons/UploadCloud.es.js";
9
- import { Info as K } from "./Icons/Info.es.js";
10
- const O = i(
11
- "relative w-full radius-large transition-colors duration-200 overflow-hidden flex flex-col items-center justify-center text-center gap-1 p-3",
9
+ import { UploadCloud as O } from "./Icons/UploadCloud.es.js";
10
+ import { Info as U } from "./Icons/Info.es.js";
11
+ const W = i(
12
+ "relative w-full radius-large transition-colors duration-200 overflow-hidden flex flex-col items-center justify-center text-center gap-1 p-3 flex-1",
12
13
  {
13
14
  variants: {
14
15
  disabled: {
@@ -20,14 +21,14 @@ const O = i(
20
21
  disabled: !1
21
22
  }
22
23
  }
23
- ), U = {
24
+ ), J = {
24
25
  disabled: "text-[var(--border-disabled-ondisabled)]",
25
26
  "drag-active": "text-[var(--border-brand-secondary-default)]",
26
27
  "drag-reject": "text-[var(--border-error-onneutral-default)]",
27
28
  default: "text-[var(--border-neutral-primary-default)]",
28
29
  error: "text-[var(--border-error-onneutral-default)]",
29
30
  success: "text-[var(--border-success-onneutral-default)]"
30
- }, W = (t, e, n) => n ? "disabled" : e === "active" ? "drag-active" : e === "reject" ? "drag-reject" : t, J = i(
31
+ }, L = (r, e, n) => n ? "disabled" : e === "active" ? "drag-active" : e === "reject" ? "drag-reject" : r, Q = i(
31
32
  "prometeo-fonts-body-medium text-balanced text-neutral-secondary-default",
32
33
  {
33
34
  variants: {
@@ -40,14 +41,14 @@ const O = i(
40
41
  disabled: !1
41
42
  }
42
43
  }
43
- ), L = i("icon-neutral-tertiary-default", {
44
+ ), X = i("icon-neutral-tertiary-default", {
44
45
  variants: {
45
46
  disabled: {
46
47
  true: "icon-disabled-default!",
47
48
  false: ""
48
49
  }
49
50
  }
50
- }), Q = i(
51
+ }), Y = i(
51
52
  "prometeo-fonts-label-large flex items-center px-3 gap-0.5",
52
53
  {
53
54
  variants: {
@@ -66,81 +67,92 @@ const O = i(
66
67
  disabled: !1
67
68
  }
68
69
  }
69
- ), X = (t) => {
70
- const e = t / 1048576;
71
- return e < 1 ? `${Math.round(t / 1024)} KB` : e < 1024 ? `${e % 1 === 0 ? e : e.toFixed(1)} MB` : `${(e / 1024).toFixed(1)} GB`;
72
- }, y = (t) => Object.keys(t).map((e) => t[e].join(", ")).join(" "), Y = (t, e, n) => {
73
- if (t.some(
70
+ ), Z = (r) => {
71
+ const e = r / 1048576;
72
+ return e < 1 ? `${Math.round(r / 1024)} KB` : e < 1024 ? `${e % 1 === 0 ? e : e.toFixed(1)} MB` : `${(e / 1024).toFixed(1)} GB`;
73
+ }, N = (r) => Object.keys(r).map((e) => r[e].join(", ")).join(" "), F = (r, e, n) => {
74
+ if (r.some(
74
75
  (d) => d.errors.some((u) => u.code === "too-many-files")
75
76
  ))
76
77
  return `Máximo ${e} ${e === 1 ? "archivo" : "archivos"} permitido${e === 1 ? "" : "s"}`;
77
- const o = t.length;
78
- return o === 1 ? "El archivo no pudo cargarse" : `${o} archivos no pudieron cargarse`;
79
- }, Z = (t, e) => e ? "reject" : t ? "active" : "idle", N = P(
78
+ const s = r.length;
79
+ return s === 1 ? "El archivo no pudo cargarse" : `${s} archivos no pudieron cargarse`;
80
+ }, ee = (r, e) => e ? "reject" : r ? "active" : "idle", w = E(
80
81
  ({
81
- onFilesAccepted: t,
82
+ onFilesAccepted: r,
82
83
  onFilesRejected: e,
83
84
  className: n,
84
85
  label: c,
85
- subtitle: o = "Arrastra y suelta los archivos aquí, o haz clic para seleccionar",
86
+ subtitle: s = "Arrastra y suelta los archivos aquí, o haz clic para seleccionar",
86
87
  acceptedFormats: d,
87
88
  status: u,
88
89
  supportingText: f,
89
- showSupportingText: w,
90
+ showSupportingText: z,
90
91
  disabled: a = !1,
91
92
  accept: m,
92
93
  maxFiles: h = 1,
93
- maxSize: p,
94
- ...M
95
- }, C) => {
96
- const D = E(
97
- (g, j) => {
98
- g.length > 0 && t?.(g), j.length > 0 && e?.(j);
94
+ maxSize: v,
95
+ cardBackground: b,
96
+ ...C
97
+ }, M) => {
98
+ const D = G(
99
+ (j, y) => {
100
+ j.length > 0 && r?.(j), y.length > 0 && e?.(y);
99
101
  },
100
- [t, e]
102
+ [r, e]
101
103
  ), {
102
104
  getRootProps: V,
103
105
  getInputProps: $,
104
106
  isDragActive: k,
105
107
  isDragReject: A,
106
- fileRejections: b
107
- } = G({
108
+ fileRejections: g
109
+ } = H({
108
110
  onDrop: D,
109
111
  accept: m,
110
112
  maxFiles: h,
111
113
  disabled: a,
112
- maxSize: p,
113
- ...M
114
- }), v = b.length > 0, l = v ? "error" : u ?? "default", x = Z(k, A), R = W(l, x, a), S = U[R], I = v ? Y([...b], h) : typeof f == "function" ? f() : f, z = d ?? y(m ?? {}), B = y(m ?? {});
115
- return /* @__PURE__ */ r.jsxs("div", { className: s("w-full flex flex-col gap-1", n), children: [
116
- c && /* @__PURE__ */ r.jsx(
114
+ maxSize: v,
115
+ ...C
116
+ }), p = g.length > 0, l = p ? "error" : u ?? "default", x = ee(k, A), R = L(l, x, a), S = J[R], I = p ? F([...g], h) : typeof f == "function" ? f() : f, B = d ?? N(m ?? {}), T = N(m ?? {});
117
+ return /* @__PURE__ */ t.jsxs("div", { className: o("w-full flex flex-col gap-1 h-[136px]", n), children: [
118
+ c && /* @__PURE__ */ t.jsx(
117
119
  "label",
118
120
  {
119
- className: Q({
121
+ className: Y({
120
122
  visualStatus: l,
121
123
  disabled: a
122
124
  }),
123
125
  children: c
124
126
  }
125
127
  ),
126
- /* @__PURE__ */ r.jsxs(
128
+ /* @__PURE__ */ t.jsxs(
127
129
  "div",
128
130
  {
129
- ref: C,
131
+ ref: M,
130
132
  ...V(),
131
- className: O({ disabled: a }),
133
+ className: W({ disabled: a }),
132
134
  children: [
133
- /* @__PURE__ */ r.jsx("input", { ...$() }),
134
- /* @__PURE__ */ r.jsx(
135
+ /* @__PURE__ */ t.jsx("input", { ...$() }),
136
+ /* @__PURE__ */ t.jsx(
137
+ _,
138
+ {
139
+ color: "neutral",
140
+ variant: "default",
141
+ forced: "default",
142
+ ...b,
143
+ className: o("absolute inset-0", b?.className)
144
+ }
145
+ ),
146
+ /* @__PURE__ */ t.jsx(
135
147
  "svg",
136
148
  {
137
149
  "aria-hidden": !0,
138
- className: s(
139
- "absolute inset-0 w-full h-full pointer-events-none overflow-visible transition-colors duration-200",
150
+ className: o(
151
+ "absolute inset-0 z-[1] w-full h-full pointer-events-none overflow-visible transition-colors duration-200",
140
152
  S,
141
153
  !a && x === "idle" && "group-hover:text-[var(--border-brand-secondary-hover)] group-active:text-[var(--border-brand-secondary-pressed)]"
142
154
  ),
143
- children: /* @__PURE__ */ r.jsx(
155
+ children: /* @__PURE__ */ t.jsx(
144
156
  "rect",
145
157
  {
146
158
  x: "0.5",
@@ -156,51 +168,53 @@ const O = i(
156
168
  )
157
169
  }
158
170
  ),
159
- o && /* @__PURE__ */ r.jsx(
160
- "p",
161
- {
162
- className: J({
163
- disabled: a
164
- }),
165
- children: o
166
- }
167
- ),
168
- /* @__PURE__ */ r.jsx(
169
- q,
171
+ s && /* @__PURE__ */ t.jsx("p", { className: o(Q({ disabled: a }), "relative z-[1]"), children: s }),
172
+ /* @__PURE__ */ t.jsx(
173
+ O,
170
174
  {
171
175
  size: 20,
172
- className: L({
173
- disabled: a
174
- })
176
+ className: o(X({ disabled: a }), "relative z-[1]")
175
177
  }
176
178
  ),
177
- !v && /* @__PURE__ */ r.jsxs("div", { className: "w-full overflow-hidden flex justify-center items-center gap-0.5", children: [
178
- /* @__PURE__ */ r.jsxs("p", { className: s("prometeo-fonts-body-xsmall text-neutral-tertiary-default line-clamp-1", a && "text-disabled-default!"), children: [
179
- z,
180
- p !== void 0 && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
181
- " ",
182
- "· Máx. ",
183
- X(p)
184
- ] })
185
- ] }),
186
- /* @__PURE__ */ r.jsx(H, { title: B, children: /* @__PURE__ */ r.jsx(
187
- K,
179
+ !p && /* @__PURE__ */ t.jsxs("div", { className: "relative z-[1] w-full overflow-hidden flex justify-center items-center gap-0.5", children: [
180
+ /* @__PURE__ */ t.jsxs(
181
+ "p",
182
+ {
183
+ className: o(
184
+ "prometeo-fonts-body-xsmall text-neutral-tertiary-default line-clamp-1",
185
+ a && "text-disabled-default!"
186
+ ),
187
+ children: [
188
+ B,
189
+ v !== void 0 && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
190
+ " ",
191
+ "· Máx. ",
192
+ Z(v)
193
+ ] })
194
+ ]
195
+ }
196
+ ),
197
+ /* @__PURE__ */ t.jsx(q, { title: T, children: /* @__PURE__ */ t.jsx(
198
+ U,
188
199
  {
189
200
  size: 12,
190
- className: s("icon-neutral-tertiary-default shrink-0", a && "icon-disabled-default!")
201
+ className: o(
202
+ "icon-neutral-tertiary-default shrink-0",
203
+ a && "icon-disabled-default!"
204
+ )
191
205
  }
192
206
  ) })
193
207
  ] })
194
208
  ]
195
209
  }
196
210
  ),
197
- w && /* @__PURE__ */ r.jsx(_, { variant: l, disabled: a, className: s(l === "default" && !a && "[&>p]:text-neutral-tertiary-default! [&>svg]:icon-neutral-tertiary-default!"), children: I })
211
+ z && /* @__PURE__ */ t.jsx(K, { variant: l, disabled: a, className: o(l === "default" && !a && "[&>p]:text-neutral-tertiary-default! [&>svg]:icon-neutral-tertiary-default!"), children: I })
198
212
  ] });
199
213
  }
200
214
  );
201
- N.displayName = "AttachInput";
202
- const ie = T(N);
215
+ w.displayName = "AttachInput";
216
+ const ue = P(w);
203
217
  export {
204
- ie as AttachInput,
205
- ie as default
218
+ ue as AttachInput,
219
+ ue as default
206
220
  };
package/dist/Button.es.js CHANGED
@@ -16,7 +16,7 @@ const W = (r) => Q(r), B = {
16
16
  icon: ""
17
17
  },
18
18
  large: {
19
- container: "h-12 px-5 py-3 spacing-x-2 radius-medium ",
19
+ container: "h-12 px-5 py-3 spacing-x-2 radius-large ",
20
20
  icon: ""
21
21
  }
22
22
  }, e = {