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 CHANGED
@@ -1,8 +1,9 @@
1
- import { j as t } from "./jsx-runtime-DKDX3adD.js";
2
- import { c as n } from "./cn-B6yFEsav.js";
3
- import { c as C } from "./index-BOQuZ0gG.js";
4
- import { useAnimationControls as N, motion as m } from "framer-motion";
5
- const z = C(
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 R({
79
- label: o = "Selene",
80
- onClick: p,
81
- icon: l,
82
- contentClassName: c,
83
- loadingText: f = "Cargando...",
84
- animate: a = !0,
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: b = "button",
89
- variant: v = "filled",
90
- color: x = "primary",
91
- size: i = "medium",
92
- children: u,
93
- Spinner: g,
94
- className: y,
95
- form: h,
96
- ...w
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 d = N(), j = () => {
99
- !a || r || e || !s || d.start({ rotate: 90 });
100
- }, H = () => {
101
- !a || r || e || !s || d.start({ rotate: 0 });
102
- }, S = n(
103
- z({
104
- variant: v,
105
- color: x,
106
- size: i,
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
- y
111
- );
112
- return /* @__PURE__ */ t.jsx(
113
- m.button,
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: h,
116
- onClick: p,
117
- className: S,
118
- whileHover: a && !r && !e ? { scale: 1.05 } : {},
119
- whileTap: a && !r && !e ? { scale: 0.98 } : {},
120
- transition: { type: "spring", stiffness: 400, damping: 17 },
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: b,
125
- ...w,
126
- children: e ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", 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
- R as default
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
- export default 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
- export {};
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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prometeo-design-system",
3
3
  "private": false,
4
- "version": "1.8.2",
4
+ "version": "1.8.3",
5
5
  "type": "module",
6
6
  "description": "design kit system",
7
7
  "main": "dist/prometeo-design-system.umd.js",