@hoddy-ui/core 2.5.1 → 2.5.2
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ionicons, MaterialIcons } from "@expo/vector-icons";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
3
|
import { ActivityIndicator, Text, TouchableOpacity } from "react-native";
|
|
4
|
-
import { ScaledSheet, moderateScale } from "react-native-size-matters";
|
|
4
|
+
import { ScaledSheet, moderateScale, ms } from "react-native-size-matters";
|
|
5
5
|
import { getConfig } from "../config/KeyManager";
|
|
6
6
|
import { useColors, useTheme } from "../hooks";
|
|
7
7
|
import { ButtonProps, IconButtonProps, LinkButtonProps } from "../types";
|
|
@@ -20,7 +20,7 @@ export const LinkButton: React.FC<LinkButtonProps> = ({
|
|
|
20
20
|
const styles: any = ScaledSheet.create({
|
|
21
21
|
text: {
|
|
22
22
|
fontSize: moderateScale(fontSize),
|
|
23
|
-
fontWeight: fontWeight,
|
|
23
|
+
fontWeight: fontWeight as any,
|
|
24
24
|
fontFamily: getConfig().DEFAULT_FONT_FAMILY || "System",
|
|
25
25
|
color: disabled ? "#777" : colors[color].main,
|
|
26
26
|
},
|
|
@@ -51,7 +51,7 @@ export const IconButton: React.FC<IconButtonProps> = ({
|
|
|
51
51
|
container: {
|
|
52
52
|
alignSelf: "flex-start",
|
|
53
53
|
flexGrow: 0,
|
|
54
|
-
backgroundColor: bg ? bgColor : elevation! > 0 ? bgColor :
|
|
54
|
+
backgroundColor: bg ? bgColor : elevation! > 0 ? bgColor : undefined,
|
|
55
55
|
padding: "5@ms",
|
|
56
56
|
shadowColor: "#000",
|
|
57
57
|
shadowOpacity: 0.1,
|
|
@@ -59,8 +59,8 @@ export const IconButton: React.FC<IconButtonProps> = ({
|
|
|
59
59
|
height: 1,
|
|
60
60
|
width: 0,
|
|
61
61
|
},
|
|
62
|
-
height: bg ? size + 20
|
|
63
|
-
width: bg ? size + 20
|
|
62
|
+
height: bg ? ms(size + 20) : undefined,
|
|
63
|
+
width: bg ? ms(size + 20) : undefined,
|
|
64
64
|
alignItems: "center",
|
|
65
65
|
justifyContent: "center",
|
|
66
66
|
shadowRadius: elevation,
|
|
@@ -118,7 +118,7 @@ const Button: React.FC<ButtonProps> = forwardRef(
|
|
|
118
118
|
justifyContent: "center",
|
|
119
119
|
backgroundColor:
|
|
120
120
|
variant === "text" || variant === "outlined"
|
|
121
|
-
?
|
|
121
|
+
? undefined
|
|
122
122
|
: translucent
|
|
123
123
|
? translucent === "dark"
|
|
124
124
|
? colors.white[3] + "22"
|
|
@@ -143,7 +143,7 @@ const Button: React.FC<ButtonProps> = forwardRef(
|
|
|
143
143
|
width: 0,
|
|
144
144
|
},
|
|
145
145
|
shadowOpacity: variant === "text" ? 0 : 0.3,
|
|
146
|
-
width: fullWidth ? "100%" :
|
|
146
|
+
width: fullWidth ? "100%" : undefined,
|
|
147
147
|
...style,
|
|
148
148
|
},
|
|
149
149
|
text: {
|
|
@@ -155,7 +155,7 @@ const Button: React.FC<ButtonProps> = forwardRef(
|
|
|
155
155
|
variant === "text" || variant === "outlined" ? "main" : "text"
|
|
156
156
|
],
|
|
157
157
|
fontWeight: variant === "outlined" ? "700" : "500",
|
|
158
|
-
fontSize: size === "small" ? "12@ms" : "
|
|
158
|
+
fontSize: size === "small" ? "12@ms" : "14@ms",
|
|
159
159
|
fontFamily: getConfig().DEFAULT_FONT_FAMILY || "System",
|
|
160
160
|
},
|
|
161
161
|
});
|