@jobber/components-native 0.52.0 → 0.53.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/dist/package.json +2 -2
- package/dist/src/ActionLabel/ActionLabel.js +1 -1
- package/dist/src/Button/Button.js +3 -2
- package/dist/src/Button/Button.style.js +9 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/Button/Button.style.d.ts +4 -0
- package/package.json +2 -2
- package/src/ActionLabel/ActionLabel.test.tsx +1 -1
- package/src/ActionLabel/ActionLabel.tsx +2 -1
- package/src/Button/Button.style.ts +10 -5
- package/src/Button/Button.test.tsx +6 -3
- package/src/Button/Button.tsx +3 -2
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"react-native-reanimated": "^2.17.0",
|
|
85
85
|
"react-native-safe-area-context": "^4.5.2"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "5e1ab691f54f32589367e99fc60cd05b749f5df6"
|
|
88
88
|
}
|
|
@@ -8,12 +8,13 @@ import { tokens } from "../utils/design";
|
|
|
8
8
|
export function Button({ label, onPress, variation = "work", type = "primary", fullHeight = false, fullWidth = true, disabled = false, loading = false, size = "base", accessibilityLabel, accessibilityHint, icon, testID, }) {
|
|
9
9
|
const buttonStyle = [
|
|
10
10
|
styles.button,
|
|
11
|
+
styles[size],
|
|
11
12
|
styles[variation],
|
|
12
13
|
styles[type],
|
|
13
|
-
styles
|
|
14
|
+
type === "secondary" && variation === "cancel" && styles.cancelSecondary,
|
|
14
15
|
disabled && styles.disabled,
|
|
15
|
-
fullHeight && styles.fullHeight,
|
|
16
16
|
fullWidth && styles.reducedPaddingForFullWidth,
|
|
17
|
+
fullHeight && styles.fullHeight,
|
|
17
18
|
];
|
|
18
19
|
// attempts to use Pressable caused problems. When a ScrollView contained
|
|
19
20
|
// an InputText that was focused, it required two presses to activate the
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { tokens } from "../utils/design";
|
|
3
3
|
const iconTranslateY = tokens["space-large"] / 2;
|
|
4
|
-
const buttonRadius = tokens["radius-
|
|
5
|
-
export const baseButtonHeight = tokens["space-base"] * 3
|
|
6
|
-
export const smallButtonHeight = tokens["space-base"] * 2.
|
|
4
|
+
const buttonRadius = tokens["radius-base"];
|
|
5
|
+
export const baseButtonHeight = tokens["space-base"] * 3;
|
|
6
|
+
export const smallButtonHeight = tokens["space-base"] * 2.5;
|
|
7
7
|
export const styles = StyleSheet.create({
|
|
8
8
|
fullHeight: {
|
|
9
9
|
flexGrow: 1,
|
|
@@ -73,16 +73,20 @@ export const styles = StyleSheet.create({
|
|
|
73
73
|
/* Cancel is special because, by default, it's styled as a secondary button */
|
|
74
74
|
cancel: {
|
|
75
75
|
backgroundColor: tokens["color-surface"],
|
|
76
|
-
borderColor: tokens["color-
|
|
76
|
+
borderColor: tokens["color-border"],
|
|
77
|
+
},
|
|
78
|
+
cancelSecondary: {
|
|
79
|
+
borderColor: "transparent",
|
|
77
80
|
},
|
|
78
81
|
/* Types */
|
|
79
82
|
primary: {},
|
|
80
83
|
secondary: {
|
|
81
84
|
backgroundColor: tokens["color-surface"],
|
|
85
|
+
borderColor: tokens["color-border"],
|
|
82
86
|
},
|
|
83
87
|
tertiary: {
|
|
84
88
|
backgroundColor: tokens["color-surface"],
|
|
85
|
-
borderColor:
|
|
89
|
+
borderColor: "transparent",
|
|
86
90
|
},
|
|
87
91
|
/* Disabled */
|
|
88
92
|
disabled: {
|