prometeo-design-system 1.8.2 → 1.8.3
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 +67 -63
- package/dist/components/Button/Button.d.ts +3 -2
- package/package.json +1 -1
package/dist/Button.es.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { c as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useAnimationControls as
|
|
5
|
-
|
|
1
|
+
import { j as o } from "./jsx-runtime-DKDX3adD.js";
|
|
2
|
+
import { c as x } from "./cn-B6yFEsav.js";
|
|
3
|
+
import { c as N } from "./index-BOQuZ0gG.js";
|
|
4
|
+
import { useAnimationControls as k, motion as y } from "framer-motion";
|
|
5
|
+
import { memo as z, useCallback as g, useMemo as i } from "react";
|
|
6
|
+
const A = N(
|
|
6
7
|
"flex items-center justify-center cursor-pointer focus:outline-none font-semibold rounded-md transition-colors",
|
|
7
8
|
{
|
|
8
9
|
variants: {
|
|
@@ -75,75 +76,78 @@ const z = C(
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
);
|
|
78
|
-
function
|
|
79
|
-
label:
|
|
80
|
-
onClick:
|
|
81
|
-
icon:
|
|
82
|
-
contentClassName:
|
|
83
|
-
loadingText:
|
|
84
|
-
animate:
|
|
79
|
+
function M({
|
|
80
|
+
label: l = "Selene",
|
|
81
|
+
onClick: h,
|
|
82
|
+
icon: u,
|
|
83
|
+
contentClassName: m,
|
|
84
|
+
loadingText: p = "Cargando...",
|
|
85
|
+
animate: t = !0,
|
|
85
86
|
animateIcon: s = !0,
|
|
86
87
|
isLoading: e = !1,
|
|
87
88
|
disabled: r = !1,
|
|
88
|
-
type:
|
|
89
|
-
variant:
|
|
90
|
-
color:
|
|
91
|
-
size:
|
|
92
|
-
children:
|
|
93
|
-
Spinner:
|
|
94
|
-
className:
|
|
95
|
-
form:
|
|
96
|
-
...
|
|
89
|
+
type: w = "button",
|
|
90
|
+
variant: f = "filled",
|
|
91
|
+
color: c = "primary",
|
|
92
|
+
size: d = "medium",
|
|
93
|
+
children: n,
|
|
94
|
+
Spinner: b,
|
|
95
|
+
className: v,
|
|
96
|
+
form: j,
|
|
97
|
+
...C
|
|
97
98
|
}) {
|
|
98
|
-
const
|
|
99
|
-
!
|
|
100
|
-
},
|
|
101
|
-
!
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
variant:
|
|
105
|
-
color:
|
|
106
|
-
size:
|
|
99
|
+
const a = k(), H = g(() => {
|
|
100
|
+
!t || r || e || !s || a.start({ rotate: 90 });
|
|
101
|
+
}, [t, r, e, s, a]), S = g(() => {
|
|
102
|
+
!t || r || e || !s || a.start({ rotate: 0 });
|
|
103
|
+
}, [t, r, e, s, a]), E = i(() => x(
|
|
104
|
+
A({
|
|
105
|
+
variant: f,
|
|
106
|
+
color: c,
|
|
107
|
+
size: d,
|
|
107
108
|
disabled: r || e,
|
|
108
109
|
loading: e
|
|
109
110
|
}),
|
|
110
|
-
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
v
|
|
112
|
+
), [f, c, d, r, e, v]), V = i(() => ({
|
|
113
|
+
whileHover: t && !r && !e ? { scale: 1.05 } : {},
|
|
114
|
+
whileTap: t && !r && !e ? { scale: 0.98 } : {},
|
|
115
|
+
transition: { type: "spring", stiffness: 400, damping: 17 }
|
|
116
|
+
}), [t, r, e]), B = i(() => e ? /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
117
|
+
b,
|
|
118
|
+
d !== "small" && /* @__PURE__ */ o.jsx("span", { children: p })
|
|
119
|
+
] }) : n || /* @__PURE__ */ o.jsxs("span", { className: x("flex items-center gap-2", m), children: [
|
|
120
|
+
u && /* @__PURE__ */ o.jsx(
|
|
121
|
+
y.div,
|
|
122
|
+
{
|
|
123
|
+
animate: s ? a : void 0,
|
|
124
|
+
transition: {
|
|
125
|
+
type: "spring",
|
|
126
|
+
stiffness: 400,
|
|
127
|
+
damping: 17
|
|
128
|
+
},
|
|
129
|
+
children: u
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
l && /* @__PURE__ */ o.jsx("span", { children: l })
|
|
133
|
+
] }), [e, n, u, l, b, d, p, s, a, m]);
|
|
134
|
+
return /* @__PURE__ */ o.jsx(
|
|
135
|
+
y.button,
|
|
114
136
|
{
|
|
115
|
-
form:
|
|
116
|
-
onClick:
|
|
117
|
-
className:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
onHoverStart: j,
|
|
122
|
-
onHoverEnd: H,
|
|
137
|
+
form: j,
|
|
138
|
+
onClick: h,
|
|
139
|
+
className: E,
|
|
140
|
+
...V,
|
|
141
|
+
onHoverStart: H,
|
|
142
|
+
onHoverEnd: S,
|
|
123
143
|
disabled: r || e,
|
|
124
|
-
type:
|
|
125
|
-
...
|
|
126
|
-
children:
|
|
127
|
-
g,
|
|
128
|
-
i !== "small" && /* @__PURE__ */ t.jsx("span", { children: f })
|
|
129
|
-
] }) : u || /* @__PURE__ */ t.jsxs("span", { className: n("flex items-center gap-2", c), children: [
|
|
130
|
-
l && /* @__PURE__ */ t.jsx(
|
|
131
|
-
m.div,
|
|
132
|
-
{
|
|
133
|
-
animate: s ? d : void 0,
|
|
134
|
-
transition: {
|
|
135
|
-
type: "spring",
|
|
136
|
-
stiffness: 400,
|
|
137
|
-
damping: 17
|
|
138
|
-
},
|
|
139
|
-
children: l
|
|
140
|
-
}
|
|
141
|
-
),
|
|
142
|
-
o && /* @__PURE__ */ t.jsx("span", { children: o })
|
|
143
|
-
] })
|
|
144
|
+
type: w,
|
|
145
|
+
...C,
|
|
146
|
+
children: B
|
|
144
147
|
}
|
|
145
148
|
);
|
|
146
149
|
}
|
|
150
|
+
const F = z(M);
|
|
147
151
|
export {
|
|
148
|
-
|
|
152
|
+
F as default
|
|
149
153
|
};
|
|
@@ -24,5 +24,6 @@ export interface ButtonProps extends VariantProps<typeof buttonVariants> {
|
|
|
24
24
|
variant?: "filled" | "outline" | "text";
|
|
25
25
|
form?: string;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
declare function Button({ label, onClick, icon, contentClassName, loadingText, animate, animateIcon, isLoading, disabled, type, variant, color, size, children, Spinner, className, form, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare const _default: import('react').MemoExoticComponent<typeof Button>;
|
|
29
|
+
export default _default;
|