@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.
@@ -71,9 +71,13 @@ export declare const styles: {
71
71
  backgroundColor: string;
72
72
  borderColor: string;
73
73
  };
74
+ cancelSecondary: {
75
+ borderColor: string;
76
+ };
74
77
  primary: {};
75
78
  secondary: {
76
79
  backgroundColor: string;
80
+ borderColor: string;
77
81
  };
78
82
  tertiary: {
79
83
  backgroundColor: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.52.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": "5554661baa9482140012e2e67c609484974fd12d"
87
+ "gitHead": "5e1ab691f54f32589367e99fc60cd05b749f5df6"
88
88
  }
@@ -5,7 +5,7 @@ import { ActionLabel } from "./ActionLabel";
5
5
  import { tokens } from "../utils/design";
6
6
 
7
7
  const defaultStyles = {
8
- fontFamily: "inter-extrabold",
8
+ fontFamily: "inter-semibold",
9
9
  color: tokens["color-interactive"],
10
10
  textAlign: "center",
11
11
  fontSize: tokens["typography--fontSize-base"],
@@ -64,6 +64,7 @@ function getColor(variation: ActionLabelVariation, disabled: boolean) {
64
64
  if (disabled) {
65
65
  return "disabled";
66
66
  }
67
+
67
68
  if (variation) {
68
69
  return variation;
69
70
  }
@@ -76,7 +77,7 @@ function getFontWeight(type: ActionLabelType) {
76
77
  return "bold";
77
78
  }
78
79
 
79
- return "extraBold";
80
+ return "semiBold";
80
81
  }
81
82
 
82
83
  function getLetterSpacing(type: ActionLabelType) {
@@ -2,9 +2,9 @@ import { StyleSheet } from "react-native";
2
2
  import { tokens } from "../utils/design";
3
3
 
4
4
  const iconTranslateY = tokens["space-large"] / 2;
5
- const buttonRadius = tokens["radius-large"];
6
- export const baseButtonHeight = tokens["space-base"] * 3.5;
7
- export const smallButtonHeight = tokens["space-base"] * 2.25;
5
+ const buttonRadius = tokens["radius-base"];
6
+ export const baseButtonHeight = tokens["space-base"] * 3;
7
+ export const smallButtonHeight = tokens["space-base"] * 2.5;
8
8
 
9
9
  export const styles = StyleSheet.create({
10
10
  fullHeight: {
@@ -91,7 +91,11 @@ export const styles = StyleSheet.create({
91
91
  /* Cancel is special because, by default, it's styled as a secondary button */
92
92
  cancel: {
93
93
  backgroundColor: tokens["color-surface"],
94
- borderColor: tokens["color-interactive--subtle"],
94
+ borderColor: tokens["color-border"],
95
+ },
96
+
97
+ cancelSecondary: {
98
+ borderColor: "transparent",
95
99
  },
96
100
 
97
101
  /* Types */
@@ -100,11 +104,12 @@ export const styles = StyleSheet.create({
100
104
 
101
105
  secondary: {
102
106
  backgroundColor: tokens["color-surface"],
107
+ borderColor: tokens["color-border"],
103
108
  },
104
109
 
105
110
  tertiary: {
106
111
  backgroundColor: tokens["color-surface"],
107
- borderColor: tokens["color-surface"],
112
+ borderColor: "transparent",
108
113
  },
109
114
 
110
115
  /* Disabled */
@@ -74,7 +74,7 @@ describe("Button", () => {
74
74
  "cancel",
75
75
  {
76
76
  bgColor: tokens["color-white"],
77
- borderColor: tokens["color-interactive--subtle"],
77
+ borderColor: tokens["color-border"],
78
78
  },
79
79
  ],
80
80
  ["destructive", { bgColor: tokens["color-destructive"] }],
@@ -96,10 +96,13 @@ describe("Button", () => {
96
96
  "secondary",
97
97
  {
98
98
  bgColor: tokens["color-white"],
99
- borderColor: tokens["color-interactive"],
99
+ borderColor: tokens["color-border"],
100
100
  },
101
101
  ],
102
- ["tertiary", { bgColor: tokens["color-white"] }],
102
+ [
103
+ "tertiary",
104
+ { bgColor: tokens["color-surface"], borderColor: "transparent" },
105
+ ],
103
106
  ])("renders a %s Button", (type, { bgColor, borderColor }) => {
104
107
  const { buttonStyle } = renderButton(
105
108
  <Button label={type} type={type} onPress={jest.fn()} />,
@@ -110,12 +110,13 @@ export function Button({
110
110
  }: ButtonProps): JSX.Element {
111
111
  const buttonStyle = [
112
112
  styles.button,
113
+ styles[size],
113
114
  styles[variation],
114
115
  styles[type],
115
- styles[size],
116
+ type === "secondary" && variation === "cancel" && styles.cancelSecondary,
116
117
  disabled && styles.disabled,
117
- fullHeight && styles.fullHeight,
118
118
  fullWidth && styles.reducedPaddingForFullWidth,
119
+ fullHeight && styles.fullHeight,
119
120
  ];
120
121
 
121
122
  // attempts to use Pressable caused problems. When a ScrollView contained