mg-library 1.0.712 → 1.0.713
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 +2 -79
- package/package.json +1 -1
package/components.js
CHANGED
|
@@ -72,83 +72,6 @@ export function MGCard({ children, header = null, footer = null, style = {}, ...
|
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
/* export function MGButton({
|
|
76
|
-
title,
|
|
77
|
-
icon,
|
|
78
|
-
callback,
|
|
79
|
-
variant = "solid",
|
|
80
|
-
action = "primary",
|
|
81
|
-
isDisabled,
|
|
82
|
-
disabled,
|
|
83
|
-
isLoading,
|
|
84
|
-
style,
|
|
85
|
-
textProps = {},
|
|
86
|
-
size = "lg",
|
|
87
|
-
py,
|
|
88
|
-
minHeight,
|
|
89
|
-
iconSpacing = "$2",
|
|
90
|
-
iconSize,
|
|
91
|
-
iconColor,
|
|
92
|
-
...rest
|
|
93
|
-
}) {
|
|
94
|
-
const effectiveDisabled = !!(isDisabled || disabled || isLoading);
|
|
95
|
-
const isSolid = variant === "solid" || variant === "filled";
|
|
96
|
-
const gsVariant = variant === "ghost" ? "link" : variant;
|
|
97
|
-
const textColor = isSolid ? "$white" : `$${action}700`;
|
|
98
|
-
if (iconColor === undefined) iconColor = textColor;
|
|
99
|
-
const bgColor = isSolid ? `$${action}500` : "transparent";
|
|
100
|
-
const borderColor = `$${action}500`;
|
|
101
|
-
const SIZE_MAP = {
|
|
102
|
-
sm: { pyToken: "$2", icon: 16 },
|
|
103
|
-
md: { pyToken: "$3", icon: 18 },
|
|
104
|
-
lg: { pyToken: "$4", icon: 20 },
|
|
105
|
-
xl: { pyToken: "$5", icon: 22 },
|
|
106
|
-
};
|
|
107
|
-
const { pyToken, icon: defaultIconSize } = SIZE_MAP[size] || SIZE_MAP.lg;
|
|
108
|
-
const resolvedPy = py !== undefined ? py : pyToken;
|
|
109
|
-
const resolvedIconSize = iconSize ?? defaultIconSize;
|
|
110
|
-
return (
|
|
111
|
-
<Button
|
|
112
|
-
action={action}
|
|
113
|
-
variant={gsVariant}
|
|
114
|
-
isDisabled={effectiveDisabled}
|
|
115
|
-
onPress={callback}
|
|
116
|
-
bg={bgColor}
|
|
117
|
-
borderColor={borderColor}
|
|
118
|
-
size={size}
|
|
119
|
-
minHeight={minHeight}
|
|
120
|
-
style={[!effectiveDisabled && { opacity: 1 }, style]}
|
|
121
|
-
_pressed={{
|
|
122
|
-
bg: isSolid ? `$${action}600` : "$gray100",
|
|
123
|
-
opacity: 0.9,
|
|
124
|
-
}}
|
|
125
|
-
{...rest}
|
|
126
|
-
>
|
|
127
|
-
{icon ? (
|
|
128
|
-
<ButtonIcon
|
|
129
|
-
as={MaterialCommunityIcons}
|
|
130
|
-
name={icon}
|
|
131
|
-
color={iconColor}
|
|
132
|
-
mr={title ? iconSpacing : 0}
|
|
133
|
-
size={resolvedIconSize}
|
|
134
|
-
/>
|
|
135
|
-
) : null}
|
|
136
|
-
{title ? (
|
|
137
|
-
<ButtonText
|
|
138
|
-
color={textColor}
|
|
139
|
-
size="md"
|
|
140
|
-
fontWeight="$semibold"
|
|
141
|
-
textTransform="none"
|
|
142
|
-
{...textProps}
|
|
143
|
-
>
|
|
144
|
-
{title}
|
|
145
|
-
</ButtonText>
|
|
146
|
-
) : null}
|
|
147
|
-
</Button>
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
*/
|
|
151
|
-
|
|
152
75
|
export function MGButton({
|
|
153
76
|
title,
|
|
154
77
|
icon,
|
|
@@ -307,10 +230,10 @@ export function MGPopover(props) {
|
|
|
307
230
|
export function MGDivider({ style, ...props }) {
|
|
308
231
|
return (
|
|
309
232
|
<Divider
|
|
310
|
-
h="$0.
|
|
233
|
+
h="$0.75"
|
|
311
234
|
flexGrow={1}
|
|
312
235
|
alignSelf="stretch"
|
|
313
|
-
bg="$
|
|
236
|
+
bg="$gray500"
|
|
314
237
|
style={style}
|
|
315
238
|
{...props}
|
|
316
239
|
/>
|