mg-library 1.0.708 → 1.0.710
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/components.js +4 -13
- package/package.json +1 -1
package/components.js
CHANGED
|
@@ -169,30 +169,25 @@ export function MGButton({
|
|
|
169
169
|
...rest
|
|
170
170
|
}) {
|
|
171
171
|
const scale = useRef(new Animated.Value(1)).current;
|
|
172
|
-
|
|
173
172
|
const animateIn = () =>
|
|
174
173
|
Animated.spring(scale, {
|
|
175
|
-
toValue: 0.
|
|
174
|
+
toValue: 0.95,
|
|
176
175
|
friction: 7,
|
|
177
176
|
useNativeDriver: true,
|
|
178
177
|
}).start();
|
|
179
|
-
|
|
180
178
|
const animateOut = () =>
|
|
181
179
|
Animated.spring(scale, {
|
|
182
180
|
toValue: 1,
|
|
183
181
|
friction: 7,
|
|
184
182
|
useNativeDriver: true,
|
|
185
183
|
}).start();
|
|
186
|
-
|
|
187
184
|
const effectiveDisabled = !!(isDisabled || disabled || isLoading);
|
|
188
185
|
const isSolid = variant === "solid" || variant === "filled";
|
|
189
186
|
const gsVariant = variant === "ghost" ? "link" : variant;
|
|
190
|
-
|
|
191
187
|
const textColor = isSolid ? "$white" : `$${action}700`;
|
|
192
188
|
if (iconColor === undefined) iconColor = textColor;
|
|
193
|
-
const bgColor = isSolid ? `$${action}500` : "$white";
|
|
194
|
-
const borderColor = `$${action}500`;
|
|
195
|
-
|
|
189
|
+
const bgColor = isSolid ? `$${action}500` : (isGhost ? "transparent" : "$white");
|
|
190
|
+
const borderColor = isGhost ? "transparent" : `$${action}500`;
|
|
196
191
|
const SIZE_MAP = {
|
|
197
192
|
sm: { pyToken: "$2", icon: 16 },
|
|
198
193
|
md: { pyToken: "$3", icon: 18 },
|
|
@@ -202,12 +197,9 @@ export function MGButton({
|
|
|
202
197
|
const { pyToken, icon: defaultIconSize } = SIZE_MAP[size] || SIZE_MAP.lg;
|
|
203
198
|
const resolvedPy = py !== undefined ? py : pyToken;
|
|
204
199
|
const resolvedIconSize = iconSize ?? defaultIconSize;
|
|
205
|
-
|
|
206
|
-
// 🎯 Diferenciar pressed según tipo
|
|
207
200
|
const pressedStyles = isSolid
|
|
208
201
|
? { bg: `$${action}600`, opacity: 0.9 }
|
|
209
202
|
: { bg: "$gray200", opacity: 0.95, borderColor: `$${action}600` };
|
|
210
|
-
|
|
211
203
|
return (
|
|
212
204
|
<Animated.View style={[{ transform: [{ scale }] }]}>
|
|
213
205
|
<Button
|
|
@@ -235,7 +227,6 @@ export function MGButton({
|
|
|
235
227
|
size={resolvedIconSize}
|
|
236
228
|
/>
|
|
237
229
|
) : null}
|
|
238
|
-
|
|
239
230
|
{title ? (
|
|
240
231
|
<ButtonText
|
|
241
232
|
color={textColor}
|
|
@@ -318,7 +309,7 @@ export function MGDivider({ style, ...props }) {
|
|
|
318
309
|
h="$0.25"
|
|
319
310
|
flexGrow={1}
|
|
320
311
|
alignSelf="stretch"
|
|
321
|
-
bg="$
|
|
312
|
+
bg="$gray400"
|
|
322
313
|
style={style}
|
|
323
314
|
{...props}
|
|
324
315
|
/>
|