prometeo-design-system 4.3.5 → 4.4.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.
@@ -16,7 +16,7 @@ import Ye from "./UserCard.es.js";
16
16
  import pe from "./Button.es.js";
17
17
  import { Logout as St } from "./Icons/Logout.es.js";
18
18
  import jt from "./NotificationCard.es.js";
19
- import { T as kt, a as Dt } from "./TabLinks-DxqprStp.js";
19
+ import { T as kt, a as Dt } from "./TabLinks-BjGwvqR9.js";
20
20
  import { Notifications as Xe } from "./Icons/Notifications.es.js";
21
21
  import { Close as _e } from "./Icons/Close.es.js";
22
22
  import { Help as Je } from "./Icons/Help.es.js";
@@ -1,59 +1,59 @@
1
- import { j as o } from "./jsx-runtime-GkKLlHH4.js";
2
- import { motion as v } from "framer-motion";
3
- import { memo as I, isValidElement as z } from "react";
1
+ import { j as n } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { motion as I } from "framer-motion";
3
+ import { memo as $, useId as w, useRef as z, useEffect as E, isValidElement as L } from "react";
4
4
  import { c as d } from "./cn-B6yFEsav.js";
5
- import $ from "./PlainTooltip.es.js";
6
- const w = /* @__PURE__ */ Symbol.for("react.memo"), E = (e, a, l) => {
5
+ import M from "./PlainTooltip.es.js";
6
+ const R = /* @__PURE__ */ Symbol.for("react.memo"), S = (e, a, o) => {
7
7
  if (!e)
8
8
  return null;
9
9
  if (typeof e == "function") {
10
10
  const i = e;
11
- return /* @__PURE__ */ o.jsx(i, { size: l, className: a });
11
+ return /* @__PURE__ */ n.jsx(i, { size: o, className: a });
12
12
  }
13
13
  if (typeof e == "object") {
14
- if (z(e))
14
+ if (L(e))
15
15
  return e;
16
- if ("$$typeof" in e && e.$$typeof === w) {
16
+ if ("$$typeof" in e && e.$$typeof === R) {
17
17
  const i = e;
18
- return /* @__PURE__ */ o.jsx(i, { size: l, className: a });
18
+ return /* @__PURE__ */ n.jsx(i, { size: o, className: a });
19
19
  }
20
20
  }
21
21
  return e;
22
22
  };
23
- function j({
23
+ function v({
24
24
  items: e,
25
25
  activeTab: a,
26
- onTabChange: l,
26
+ onTabChange: o,
27
27
  className: i,
28
- tabClassName: n,
28
+ tabClassName: l,
29
29
  activeTabClassName: s,
30
- indicatorClassName: f,
30
+ indicatorClassName: b,
31
31
  animated: r = !0,
32
32
  renderTab: u
33
33
  }) {
34
- const b = (t) => {
35
- t.disabled || l?.(t.id, t);
36
- };
37
- return /* @__PURE__ */ o.jsx(
34
+ const p = (t) => {
35
+ t.disabled || o?.(t.id, t);
36
+ }, x = w();
37
+ return /* @__PURE__ */ n.jsx(
38
38
  "div",
39
39
  {
40
40
  className: d(
41
- "flex flex-row justify-around items-end relative border-b border-neutral-strong-default w-full md:justify-start md:px-10 md:gap-5",
41
+ "flex flex-row justify-around items-end relative border-b border-neutral-strong-default w-full md:justify-start md:px-10 md:gap-5 overflow-hidden",
42
42
  i
43
43
  ),
44
44
  role: "tablist",
45
45
  children: e?.map((t) => {
46
- const c = a === t.id, m = () => b(t), { iconPosition: p = "top", iconSize: x = 24 } = t;
47
- return u ? /* @__PURE__ */ o.jsx("div", { children: u(t, c, m, t.onIconClick, t.onIconHover, t.iconTooltipTitle, t.iconTooltipProps, t.iconSize) }, t.id) : /* @__PURE__ */ o.jsx(
48
- L,
46
+ const c = a === t.id, f = () => p(t), { iconPosition: h = "top", iconSize: m = 24 } = t;
47
+ return u ? /* @__PURE__ */ n.jsx("div", { children: u(t, c, f, t.onIconClick, t.onIconHover, t.iconTooltipTitle, t.iconTooltipProps, t.iconSize) }, t.id) : /* @__PURE__ */ n.jsx(
48
+ H,
49
49
  {
50
50
  id: t.id,
51
51
  title: t.title,
52
52
  icon: t.icon,
53
- iconPosition: p,
54
- onClick: m,
53
+ iconPosition: h,
54
+ onClick: f,
55
55
  disabled: t.disabled,
56
- className: n,
56
+ className: l,
57
57
  isActive: c,
58
58
  activeClassName: s,
59
59
  animated: r,
@@ -61,37 +61,43 @@ function j({
61
61
  onIconClick: t.onIconClick,
62
62
  iconTooltipTitle: t.iconTooltipTitle,
63
63
  iconTooltipProps: t.iconTooltipProps,
64
- iconSize: x,
65
- indicatorClassName: f
66
- }
64
+ iconSize: m,
65
+ indicatorClassName: b,
66
+ layoutId: x
67
+ },
68
+ t.id
67
69
  );
68
70
  })
69
71
  }
70
72
  );
71
73
  }
72
- j.displayName = "TabLinks";
73
- const W = I(j, (e, a) => {
74
+ v.displayName = "TabLinks";
75
+ const D = $(v, (e, a) => {
74
76
  if (e.activeTab !== a.activeTab || e.className !== a.className || e.tabClassName !== a.tabClassName || e.activeTabClassName !== a.activeTabClassName || e.indicatorClassName !== a.indicatorClassName || e.animated !== a.animated || e.onTabChange !== a.onTabChange || e.renderTab !== a.renderTab || e.items.length !== a.items.length)
75
77
  return !1;
76
- for (let l = 0; l < e.items.length; l++) {
77
- const i = e.items[l], n = a.items[l];
78
- if (i.id !== n.id || i.title !== n.title || i.disabled !== n.disabled || i.description !== n.description)
78
+ for (let o = 0; o < e.items.length; o++) {
79
+ const i = e.items[o], l = a.items[o];
80
+ if (i.id !== l.id || i.title !== l.title || i.disabled !== l.disabled || i.description !== l.description)
79
81
  return !1;
80
82
  }
81
83
  return !0;
82
- }), L = ({ id: e, title: a, icon: l, iconPosition: i = "top", onClick: n, disabled: s = !1, className: f, isActive: r = !1, activeClassName: u, animated: b = !0, onIconHover: t, onIconClick: c, iconTooltipTitle: m, iconTooltipProps: p, iconSize: x = 20, indicatorClassName: k }) => {
83
- const C = (h, y, T, N, g) => T ? /* @__PURE__ */ o.jsx($, { title: T, ...N, children: /* @__PURE__ */ o.jsx("div", { onMouseEnter: y, onClick: g, children: h }) }) : /* @__PURE__ */ o.jsx("div", { onMouseEnter: y, onClick: g, children: h });
84
- return /* @__PURE__ */ o.jsxs(
84
+ }), H = ({ id: e, title: a, icon: o, iconPosition: i = "top", onClick: l, disabled: s = !1, className: b, isActive: r, activeClassName: u, onIconHover: p, onIconClick: x, iconTooltipTitle: t, iconTooltipProps: c, iconSize: f = 20, indicatorClassName: h, layoutId: m }) => {
85
+ const y = z(!0);
86
+ E(() => {
87
+ y.current && (y.current = !1);
88
+ }, []);
89
+ const C = (T, g, j, N, k) => j ? /* @__PURE__ */ n.jsx(M, { title: j, ...N, children: /* @__PURE__ */ n.jsx("div", { onMouseEnter: g, onClick: k, children: T }) }) : /* @__PURE__ */ n.jsx("div", { onMouseEnter: g, onClick: k, children: T });
90
+ return /* @__PURE__ */ n.jsxs(
85
91
  "button",
86
92
  {
87
- onClick: n,
93
+ onClick: l,
88
94
  disabled: s,
89
95
  className: d(
90
96
  "group/tablink-item",
91
97
  "relative flex flex-col pb-[14px] justify-center items-center h-max px-4 font-medium focus:outline-none transition-colors pt-[14px]",
92
98
  s && "hover:text-primary-default-default cursor-pointer",
93
99
  s && "opacity-50 cursor-default",
94
- f,
100
+ b,
95
101
  r && u
96
102
  ),
97
103
  tabIndex: s ? -1 : 0,
@@ -99,12 +105,12 @@ const W = I(j, (e, a) => {
99
105
  role: "tab",
100
106
  "aria-selected": r,
101
107
  children: [
102
- /* @__PURE__ */ o.jsxs("div", { className: d(
108
+ /* @__PURE__ */ n.jsxs("div", { className: d(
103
109
  "flex items-center gap-0.5",
104
110
  i === "left" && "flex-row-reverse",
105
111
  i === "top" ? "flex-col-reverse" : "gap-1"
106
112
  ), children: [
107
- /* @__PURE__ */ o.jsx(
113
+ /* @__PURE__ */ n.jsx(
108
114
  "label",
109
115
  {
110
116
  className: d(
@@ -115,33 +121,34 @@ const W = I(j, (e, a) => {
115
121
  children: a
116
122
  }
117
123
  ),
118
- C(E(l, d(
124
+ C(S(o, d(
119
125
  "transition-all duration-300 ease-in-out group-hover/tablink-item:text-neutral-medium-hover ",
120
126
  r ? "text-primary-default-default prometeo-fonts-title-medium group-hover/tablink-item:text-primary-default-default" : "text-neutral-medium-default prometeo-fonts-body-large"
121
- ), x), t, m, p, c)
127
+ ), f), p, t, c, x)
122
128
  ] }),
123
- r && b && /* @__PURE__ */ o.jsx(
124
- v.div,
129
+ r ? /* @__PURE__ */ n.jsx(
130
+ I.div,
125
131
  {
126
- layoutId: "tab-indicator",
132
+ layoutId: m ? `tab-indicator-${m}` : "tab-indicator",
133
+ id: `tab-indicator-${e}`,
134
+ initial: y.current ? !1 : void 0,
127
135
  className: d(
128
- "absolute -bottom-px left-1/2 -translate-x-1/2 h-[4px] rounded-t-xl bg-primary-default-default z-0 w-[calc(100%-32px)]",
129
- k
136
+ "absolute bottom-0 left-1/2 -translate-x-1/2 h-[4px] rounded-t-xl bg-primary-default-default z-10 w-[calc(100%-32px)]",
137
+ h
130
138
  ),
131
139
  transition: {
132
140
  type: "spring",
133
141
  stiffness: 250,
134
142
  damping: 17
135
- },
136
- "aria-hidden": "true"
143
+ }
137
144
  }
138
- )
145
+ ) : null
139
146
  ]
140
147
  },
141
- e
148
+ `tablink-${e}`
142
149
  );
143
150
  };
144
151
  export {
145
- W as T,
146
- L as a
152
+ D as T,
153
+ H as a
147
154
  };
@@ -1,4 +1,4 @@
1
- import { T as f } from "./TabLinks-DxqprStp.js";
1
+ import { T as f } from "./TabLinks-BjGwvqR9.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/dist/Toast.es.js CHANGED
@@ -1,37 +1,37 @@
1
- import { j as t } from "./jsx-runtime-GkKLlHH4.js";
2
- import { c as l } from "./cn-B6yFEsav.js";
3
- import P, { useRef as b, useEffect as I } from "react";
4
- import { toast as h } from "sonner";
5
- import { Info as w } from "./Icons/Info.es.js";
6
- import { Error as v } from "./Icons/Error.es.js";
7
- import { Cancel as y } from "./Icons/Cancel.es.js";
8
- import { CheckCircle as j } from "./Icons/CheckCircle.es.js";
9
- import C from "./Button.es.js";
10
- import { Close as E } from "./Icons/Close.es.js";
11
- const p = {
1
+ import { j as r } from "./jsx-runtime-GkKLlHH4.js";
2
+ import { c as g } from "./cn-B6yFEsav.js";
3
+ import I, { useRef as j, useEffect as E } from "react";
4
+ import { toast as y } from "sonner";
5
+ import { Info as k } from "./Icons/Info.es.js";
6
+ import { Error as T } from "./Icons/Error.es.js";
7
+ import { Cancel as M } from "./Icons/Cancel.es.js";
8
+ import { CheckCircle as P } from "./Icons/CheckCircle.es.js";
9
+ import R from "./Button.es.js";
10
+ import { Close as L } from "./Icons/Close.es.js";
11
+ const v = {
12
12
  dark: {
13
13
  success: {
14
14
  container: "border-b-[2px] border-success-default-default",
15
15
  iconClass: "text-success-medium-default",
16
- icon: j,
16
+ icon: P,
17
17
  loading: "bg-success-default-default"
18
18
  },
19
19
  error: {
20
20
  container: "border-b-[2px] border-error-default-default",
21
21
  iconClass: "text-error-medium-default",
22
- icon: y,
22
+ icon: M,
23
23
  loading: "bg-error-default-default"
24
24
  },
25
25
  warning: {
26
26
  container: "border-b-[2px] border-warning-default-default",
27
27
  iconClass: "text-warning-medium-default",
28
- icon: v,
28
+ icon: T,
29
29
  loading: "bg-warning-default-default"
30
30
  },
31
31
  info: {
32
32
  container: " border-b-[2px] border-primary-default-default",
33
33
  iconClass: "text-primary-default-default",
34
- icon: w,
34
+ icon: k,
35
35
  loading: "bg-primary-default-default"
36
36
  }
37
37
  },
@@ -39,29 +39,29 @@ const p = {
39
39
  success: {
40
40
  container: "",
41
41
  iconClass: "text-success-default-pressed",
42
- icon: j,
42
+ icon: P,
43
43
  loading: "bg-success-default-pressed"
44
44
  },
45
45
  error: {
46
46
  container: "",
47
47
  iconClass: "text-error-medium-pressed",
48
- icon: y,
48
+ icon: M,
49
49
  loading: "bg-error-medium-pressed"
50
50
  },
51
51
  warning: {
52
52
  container: "",
53
53
  iconClass: "text-warning-medium-pressed",
54
- icon: v,
54
+ icon: T,
55
55
  loading: "bg-warning-medium-pressed"
56
56
  },
57
57
  info: {
58
58
  container: "",
59
59
  iconClass: "text-primary-default-pressed",
60
- icon: w,
60
+ icon: k,
61
61
  loading: "bg-primary-default-pressed"
62
62
  }
63
63
  }
64
- }, x = {
64
+ }, C = {
65
65
  dark: {
66
66
  container: "bg-neutral-default-default",
67
67
  title: "text-neutral-strong-default",
@@ -74,121 +74,238 @@ const p = {
74
74
  description: "text-neutral-medium-focused",
75
75
  shadow: "0px 0px 2px 0px rgba(0, 0, 0, 0.35),8px 8px 20px 0px rgba(0, 0, 0, 0.3),0px 0px 15px 0px rgba(0, 0, 0, 0.2),0px 0px 20px 0px rgba(21, 21, 21, 0.3) inset,6px 0px 100px 0px rgba(0, 0, 0, 0.05) inset"
76
76
  }
77
- }, T = (d) => {
78
- const { title: r, description: n, button: a, id: i, icon: s, variant: o = "info", colorMode: e = "dark", showClose: m = !1, loading: c = !1, loadingTimeout: g = 2500, finishLoader: u = !1 } = d;
79
- return /* @__PURE__ */ t.jsxs(
77
+ }, N = (x) => {
78
+ const { title: l, description: f, button: o, id: d, icon: n, variant: i = "info", colorMode: t = "dark", showClose: h = !1, loading: m = !1, loadingTimeout: p = 2500, finishLoader: c = !1, customContent: u } = x;
79
+ return /* @__PURE__ */ r.jsxs(
80
80
  "div",
81
81
  {
82
82
  style: {
83
- boxShadow: x[e].shadow
83
+ boxShadow: C[t].shadow
84
84
  },
85
- className: l(
86
- "flex p-3 pb-4 md:w-[485px] md:max-w-[485px] md:min-w-[485px] md:h-[68px] md:max-h-[68px] rounded-lg gap-2",
87
- "w-[345px] max-w-[345px] min-w-[345px] h-[68px] max-h-[68px] relative",
88
- x[e].container,
89
- p[e][o].container,
90
- c && "border-b-0"
85
+ className: g(
86
+ "flex p-3 pb-4 md:w-[485px] md:max-w-[485px] md:min-w-[485px] rounded-lg gap-2",
87
+ "w-[345px] max-w-[345px] min-w-[345px] relative",
88
+ // Altura fija solo cuando no hay customContent
89
+ !u && "md:h-[68px] md:max-h-[68px] h-[68px] max-h-[68px]",
90
+ // Cuando hay customContent, permitir crecimiento pero con mínimo
91
+ u && "md:min-h-[68px] min-h-[68px]",
92
+ C[t].container,
93
+ v[t][i].container,
94
+ m && "border-b-0"
91
95
  ),
92
96
  children: [
93
- /* @__PURE__ */ t.jsxs(
97
+ /* @__PURE__ */ r.jsxs(
94
98
  "div",
95
99
  {
96
- className: "flex items-center justify-start gap-2 max-h-[38px] h-[38px] overflow-hidden flex-1 ",
100
+ className: g(
101
+ "flex items-start gap-2 flex-1",
102
+ // Restricciones de altura solo cuando no hay customContent
103
+ !u && "justify-start items-center max-h-[38px] h-[38px] overflow-hidden",
104
+ // Cuando hay customContent, permitir crecimiento
105
+ u && "justify-start"
106
+ ),
97
107
  children: [
98
- /* @__PURE__ */ t.jsx("div", { className: "f", style: { color: "inherit" }, children: P.createElement(s || p[e][o].icon, { size: 24, className: p[e][o].iconClass }) }),
99
- /* @__PURE__ */ t.jsxs("div", { className: "flex-1 flex flex-col gap-1", children: [
100
- /* @__PURE__ */ t.jsx("p", { className: l("select-none prometeo-fonts-label-medium md:prometeo-fonts-label-xlarge", x[e].title), children: r }),
101
- n && /* @__PURE__ */ t.jsx("p", { className: l("select-none prometeo-fonts-body-xsmall md:prometeo-fonts-body-small text-nowrap overflow-ellipsis ", x[e].description), children: n })
108
+ /* @__PURE__ */ r.jsx("div", { className: "f shrink-0", style: { color: "inherit" }, children: I.createElement(n || v[t][i].icon, { size: 24, className: v[t][i].iconClass }) }),
109
+ u ? /* @__PURE__ */ r.jsx("div", { className: "flex-1 min-w-0", children: u }) : /* @__PURE__ */ r.jsxs("div", { className: "flex-1 flex flex-col gap-1", children: [
110
+ /* @__PURE__ */ r.jsx("p", { className: g("select-none prometeo-fonts-label-medium md:prometeo-fonts-label-xlarge", C[t].title), children: l }),
111
+ f && /* @__PURE__ */ r.jsx("p", { className: g("select-none prometeo-fonts-body-xsmall md:prometeo-fonts-body-small text-nowrap overflow-ellipsis ", C[t].description), children: f })
102
112
  ] })
103
113
  ]
104
114
  }
105
115
  ),
106
- c && /* @__PURE__ */ t.jsx(z, { color: o, timeOut: g, finished: u, colorMode: e }),
107
- a?.label && /* @__PURE__ */ t.jsx("div", { className: "shrink-0", children: /* @__PURE__ */ t.jsx(
108
- C,
116
+ m && /* @__PURE__ */ r.jsx(V, { color: i, timeOut: p, finished: c, colorMode: t }),
117
+ o?.label && /* @__PURE__ */ r.jsx("div", { className: "shrink-0", children: /* @__PURE__ */ r.jsx(
118
+ R,
109
119
  {
110
- label: a?.label,
120
+ label: o?.label,
111
121
  onClick: () => {
112
- a?.onClick(), h.dismiss(i);
122
+ o?.onClick(), y.dismiss(d);
113
123
  },
114
124
  size: "small",
115
125
  color: "secondary"
116
126
  }
117
127
  ) }),
118
- m && /* @__PURE__ */ t.jsx("div", { className: "shrink-0", children: /* @__PURE__ */ t.jsx(
119
- C,
128
+ h && /* @__PURE__ */ r.jsx("div", { className: "shrink-0", children: /* @__PURE__ */ r.jsx(
129
+ R,
120
130
  {
121
131
  onClick: () => {
122
- h.dismiss(i);
132
+ y.dismiss(d);
123
133
  },
124
134
  label: "",
125
135
  size: "small",
126
136
  color: "secondary",
127
- icon: /* @__PURE__ */ t.jsx(E, { className: l(e === "light" ? "text-neutral-medium-focused " : "") }),
137
+ icon: /* @__PURE__ */ r.jsx(L, { className: g(t === "light" ? "text-neutral-medium-focused " : "") }),
128
138
  variant: "text",
129
139
  animate: !1,
130
- className: l(e === "light" ? "hover:bg-neutral-default-hover-light focus:bg-inherit active:bg-neutral-weak-hover " : "")
140
+ className: g(t === "light" ? "hover:bg-neutral-default-hover-light focus:bg-inherit active:bg-neutral-weak-hover " : "")
131
141
  }
132
142
  ) })
133
143
  ]
134
144
  }
135
145
  );
136
- }, z = ({ className: d, color: r, timeOut: n, finished: a, colorMode: i }) => {
137
- const s = b(0), o = b(Date.now()), e = b(null);
138
- I(() => {
139
- if (a) {
140
- s.current = 1, e.current && (e.current.style.width = "100%");
146
+ }, V = ({ className: x, color: l, timeOut: f, finished: o, colorMode: d }) => {
147
+ const n = j(0), i = j(Date.now()), t = j(null);
148
+ E(() => {
149
+ if (o) {
150
+ n.current = 1, t.current && (t.current.style.width = "100%");
141
151
  return;
142
152
  }
143
- o.current = Date.now(), s.current = 0;
144
- const c = setInterval(() => {
145
- const g = Date.now() - o.current, u = Math.min(g / n, 1), N = u * 0.95, k = Math.sin(u * Math.PI * 2) * 0.15 + 0.05, M = Math.random() < k;
146
- let f;
147
- if (M)
148
- f = s.current;
153
+ i.current = Date.now(), n.current = 0;
154
+ const m = setInterval(() => {
155
+ const p = Date.now() - i.current, c = Math.min(p / f, 1), u = c * 0.95, b = Math.sin(c * Math.PI * 2) * 0.15 + 0.05, w = Math.random() < b;
156
+ let e;
157
+ if (w)
158
+ e = n.current;
149
159
  else {
150
- const R = (Math.random() - 0.5) * 0.25;
151
- f = Math.max(s.current, Math.min(0.95, N + R));
160
+ const a = (Math.random() - 0.5) * 0.25;
161
+ e = Math.max(n.current, Math.min(0.95, u + a));
152
162
  }
153
- s.current = f, e.current && (e.current.style.width = `${f * 100}%`), (u >= 1 || a) && clearInterval(c);
163
+ n.current = e, t.current && (t.current.style.width = `${e * 100}%`), (c >= 1 || o) && clearInterval(m);
154
164
  }, 50);
155
- return () => clearInterval(c);
156
- }, [n, a]);
157
- const m = p[i][r].loading;
158
- return /* @__PURE__ */ t.jsx("div", { className: l(
165
+ return () => clearInterval(m);
166
+ }, [f, o]);
167
+ const h = v[d][l].loading;
168
+ return /* @__PURE__ */ r.jsx("div", { className: g(
159
169
  "absolute bottom-0 translate-y-0 left-0 w-full h-2 overflow-hidden rounded-b-xl",
160
170
  'after:content-[""] after:w-[calc(100%-0px)] after:absolute after:bottom-0 after:left-1/2 after:bg-neutral-default-default after:h-2 after:-translate-x-1/2 after:-translate-y-[2px] after:rounded-b-full after:overflow-hidden',
161
- d
162
- ), children: /* @__PURE__ */ t.jsx(
171
+ x
172
+ ), children: /* @__PURE__ */ r.jsx(
163
173
  "div",
164
174
  {
165
- ref: e,
166
- className: l("h-full transition-all duration-300 ease-out", m),
175
+ ref: t,
176
+ className: g("h-full transition-all duration-300 ease-out", h),
167
177
  style: { width: "0%" }
168
178
  }
169
179
  ) });
170
180
  };
171
- function G(d, r) {
172
- const { duration: n = 2500, showClose: a = !1, colorMode: i = "dark", position: s } = r || {};
173
- return h.custom((o) => /* @__PURE__ */ t.jsx(
174
- T,
181
+ function G(x, l) {
182
+ const { duration: f = 2500, showClose: o = !1, colorMode: d = "dark", position: n } = l || {};
183
+ return y.custom((i) => /* @__PURE__ */ r.jsx(
184
+ N,
175
185
  {
176
- id: o,
177
- variant: r?.variant || "success",
178
- title: d,
179
- description: r?.description,
180
- icon: r?.icon,
181
- button: r?.button,
182
- showClose: a,
183
- colorMode: i
186
+ id: i,
187
+ variant: l?.variant || "success",
188
+ title: x,
189
+ description: l?.description,
190
+ icon: l?.icon,
191
+ button: l?.button,
192
+ showClose: o,
193
+ colorMode: d
184
194
  }
185
195
  ), {
186
- duration: n,
187
- position: s,
196
+ duration: f,
197
+ position: n,
188
198
  unstyled: !0
189
199
  });
190
200
  }
201
+ const H = (x, l = {}) => {
202
+ const {
203
+ loading: f,
204
+ success: o,
205
+ error: d,
206
+ colorMode: n = "dark",
207
+ position: i,
208
+ timeOut: t = 5e3
209
+ } = l, h = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null || e === void 0 || typeof e == "object" && ("$$typeof" in e || I.isValidElement(e)), m = { title: "Cargando...", variant: "info", ...f }, p = typeof o == "function" ? { variant: "success", showClose: !0 } : { variant: "success", showClose: !0, ...o }, c = typeof d == "function" ? { variant: "error", showClose: !0 } : { variant: "error", showClose: !0, ...d };
210
+ let u, b = !1;
211
+ const w = (e) => {
212
+ y.custom((a) => /* @__PURE__ */ r.jsx(
213
+ N,
214
+ {
215
+ id: a,
216
+ ...e,
217
+ colorMode: n
218
+ }
219
+ ), {
220
+ id: u,
221
+ // Usar el mismo id para reemplazar
222
+ duration: e.duration || 1 / 0,
223
+ position: i,
224
+ unstyled: !0
225
+ });
226
+ };
227
+ return u = y.custom((e) => /* @__PURE__ */ r.jsx(
228
+ N,
229
+ {
230
+ id: e,
231
+ loadingTimeout: t,
232
+ loading: !0,
233
+ ...m,
234
+ colorMode: n
235
+ }
236
+ ), {
237
+ duration: 1 / 0,
238
+ position: i,
239
+ unstyled: !0
240
+ }), x.then((e) => {
241
+ if (!b)
242
+ return b = !0, w({
243
+ ...m,
244
+ loadingTimeout: t,
245
+ loading: !0,
246
+ finishLoader: !0,
247
+ variant: "info",
248
+ duration: 1e3
249
+ }), setTimeout(() => {
250
+ let a;
251
+ if (typeof o == "function") {
252
+ const s = o(e);
253
+ h(s) ? a = {
254
+ ...p,
255
+ customContent: s,
256
+ duration: p.duration || 2500
257
+ } : a = {
258
+ variant: "success",
259
+ showClose: !0,
260
+ ...s,
261
+ duration: s.duration || 2500
262
+ };
263
+ } else {
264
+ const s = p.title || (typeof e == "string" ? e : "Operación completada con éxito!");
265
+ a = {
266
+ ...p,
267
+ title: s,
268
+ duration: p.duration || 2500
269
+ };
270
+ }
271
+ w(a);
272
+ }, 500), e;
273
+ }).catch((e) => {
274
+ b || (b = !0, w({
275
+ ...m,
276
+ loadingTimeout: t,
277
+ loading: !0,
278
+ finishLoader: !0,
279
+ variant: "info",
280
+ duration: 1e3
281
+ }), setTimeout(() => {
282
+ let a;
283
+ if (typeof d == "function") {
284
+ const s = d(e);
285
+ h(s) ? a = {
286
+ ...c,
287
+ customContent: s,
288
+ duration: c.duration || 2500
289
+ } : a = {
290
+ variant: "error",
291
+ showClose: !0,
292
+ ...s,
293
+ duration: s.duration || 2500
294
+ };
295
+ } else {
296
+ const s = c.title || (typeof e == "string" ? e : e.message || "Error!");
297
+ a = {
298
+ ...c,
299
+ title: s,
300
+ duration: c.duration || 2500
301
+ };
302
+ }
303
+ w(a);
304
+ }, 500));
305
+ }), x;
306
+ };
191
307
  export {
192
- T as default,
308
+ N as default,
309
+ H as toastPyrionPromise,
193
310
  G as toastpyrion
194
311
  };
@@ -47,5 +47,6 @@ interface TabLinkItemProps {
47
47
  iconTooltipTitle?: string;
48
48
  iconTooltipProps?: PlainTooltipProps;
49
49
  iconSize?: number;
50
+ layoutId?: string;
50
51
  }
51
- export declare const TabLinkItem: ({ id, title, icon, iconPosition, onClick, disabled, className, isActive, activeClassName, animated, onIconHover, onIconClick, iconTooltipTitle, iconTooltipProps, iconSize, indicatorClassName }: TabLinkItemProps) => import("react/jsx-runtime").JSX.Element;
52
+ export declare const TabLinkItem: ({ id, title, icon, iconPosition, onClick, disabled, className, isActive, activeClassName, onIconHover, onIconClick, iconTooltipTitle, iconTooltipProps, iconSize, indicatorClassName, layoutId }: TabLinkItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { IconComponent } from '../../Icons/types';
2
+ import { ReactNode } from 'react';
2
3
  import { ColorMode } from '../Shared/types';
3
4
  type ToastElementsProps = {
4
5
  container: string;
@@ -34,15 +35,16 @@ export interface PyrionToastProps {
34
35
  loading?: boolean;
35
36
  loadingTimeout?: number;
36
37
  finishLoader?: boolean;
38
+ customContent?: ReactNode;
37
39
  }
38
40
  declare const PyrionToast: (props: PyrionToastProps) => import("react/jsx-runtime").JSX.Element;
39
41
  export default PyrionToast;
40
42
  export declare function toastpyrion(title: string, options?: Omit<PyrionToastProps, 'id'>): string | number;
41
- export declare const toastPyrionPromise: (promise: Promise<any>, options?: {
43
+ export declare const toastPyrionPromise: <TData = any, TError = any>(promise: Promise<TData>, options?: {
42
44
  loading?: Omit<PyrionToastProps, "id">;
43
- success?: Omit<PyrionToastProps, "id">;
44
- error?: Omit<PyrionToastProps, "id">;
45
+ success?: Omit<PyrionToastProps, "id"> | ((data: TData) => Omit<PyrionToastProps, "id"> | ReactNode);
46
+ error?: Omit<PyrionToastProps, "id"> | ((error: TError) => Omit<PyrionToastProps, "id"> | ReactNode);
45
47
  colorMode?: ColorMode;
46
48
  position?: ToastPosition;
47
49
  timeOut?: number;
48
- }) => Promise<any>;
50
+ }) => Promise<TData>;
@@ -1,3 +1,3 @@
1
1
  export { default } from '../components/Toaster/Toaster';
2
2
  export type { PyrionToastProps } from '../components/Toaster/Toaster';
3
- export { toastpyrion } from '../components/Toaster/Toaster';
3
+ export { toastpyrion, toastPyrionPromise } from '../components/Toaster/Toaster';
@@ -21,7 +21,7 @@ import { D as ne } from "./DatePicker-QuBgR5DQ.js";
21
21
  import { RecurrentDatePicker as me } from "./RecurrentDatePicker.es.js";
22
22
  import { RecurrentDatePickerRRule as ie } from "./RecurrentDatePickerRRule.es.js";
23
23
  import { Table as ce, TableBody as be, TableCaption as De, TableCell as ve, TableFooter as Te, TableHead as ge, TableHeader as ke, TableRow as he } from "./Table.es.js";
24
- import { T as Ce } from "./TabLinks-DxqprStp.js";
24
+ import { T as Ce } from "./TabLinks-BjGwvqR9.js";
25
25
  import { default as Ee } from "./TextArea.es.js";
26
26
  import { default as Re } from "./Tooltip.es.js";
27
27
  import { default as Se } from "./Skeleton.es.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prometeo-design-system",
3
3
  "private": false,
4
- "version": "4.3.5",
4
+ "version": "4.4.0",
5
5
  "type": "module",
6
6
  "description": "design kit system",
7
7
  "main": "dist/prometeo-design-system.umd.js",