@klyftig/mobile-ui 1.9.0 → 1.10.0
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
|
@@ -13,7 +13,8 @@ interface GlassButtonProps {
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
icon?: string;
|
|
15
15
|
fullWidth?: boolean;
|
|
16
|
-
|
|
16
|
+
/** normal = 56 pt, medium = 48 pt (same text, a slimmer bar), compact = 40 pt with smaller text. */
|
|
17
|
+
size?: 'normal' | 'medium' | 'compact';
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export const GlassButton: React.FC<GlassButtonProps> = ({
|
|
@@ -28,6 +29,7 @@ export const GlassButton: React.FC<GlassButtonProps> = ({
|
|
|
28
29
|
}) => {
|
|
29
30
|
const isDisabled = disabled || loading;
|
|
30
31
|
const isCompact = size === 'compact';
|
|
32
|
+
const isMedium = size === 'medium';
|
|
31
33
|
const scaleAnim = useRef(new Animated.Value(1)).current;
|
|
32
34
|
|
|
33
35
|
const handlePressIn = () => {
|
|
@@ -85,6 +87,7 @@ export const GlassButton: React.FC<GlassButtonProps> = ({
|
|
|
85
87
|
style={[
|
|
86
88
|
styles.primaryButton,
|
|
87
89
|
isDisabled && styles.primaryButtonDisabled,
|
|
90
|
+
isMedium && styles.primaryButtonMedium,
|
|
88
91
|
isCompact && styles.primaryButtonCompact,
|
|
89
92
|
]}
|
|
90
93
|
>
|
|
@@ -120,6 +123,7 @@ export const GlassButton: React.FC<GlassButtonProps> = ({
|
|
|
120
123
|
style={[
|
|
121
124
|
styles.dangerButton,
|
|
122
125
|
isDisabled && styles.primaryButtonDisabled,
|
|
126
|
+
isMedium && styles.buttonMedium,
|
|
123
127
|
isCompact && styles.primaryButtonCompact,
|
|
124
128
|
]}
|
|
125
129
|
>
|
|
@@ -155,6 +159,7 @@ export const GlassButton: React.FC<GlassButtonProps> = ({
|
|
|
155
159
|
style={[
|
|
156
160
|
styles.secondaryButton,
|
|
157
161
|
isDisabled && styles.primaryButtonDisabled,
|
|
162
|
+
isMedium && styles.buttonMedium,
|
|
158
163
|
isCompact && styles.secondaryButtonCompact,
|
|
159
164
|
]}
|
|
160
165
|
>
|
|
@@ -184,6 +189,13 @@ const styles = StyleSheet.create({
|
|
|
184
189
|
borderColor: 'rgba(255,255,255,0.15)',
|
|
185
190
|
...shadows.lg,
|
|
186
191
|
},
|
|
192
|
+
primaryButtonMedium: {
|
|
193
|
+
height: 48,
|
|
194
|
+
borderRadius: 24,
|
|
195
|
+
},
|
|
196
|
+
buttonMedium: {
|
|
197
|
+
height: 48,
|
|
198
|
+
},
|
|
187
199
|
primaryButtonCompact: {
|
|
188
200
|
height: 40,
|
|
189
201
|
borderRadius: theme.borderRadius.control,
|