@jobber/components-native 0.66.0 → 0.66.1-JOB-101940.4

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.66.0",
3
+ "version": "0.66.1-JOB-101940.4+9be6e610",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -84,5 +84,5 @@
84
84
  "react-native-safe-area-context": "^4.5.2",
85
85
  "react-native-svg": ">=12.0.0"
86
86
  },
87
- "gitHead": "dc84fb83c993bf0e03e707a7958afbb57500b791"
87
+ "gitHead": "9be6e610f02772de62d13a01a945a74f89b0c184"
88
88
  }
@@ -64,6 +64,10 @@ export const typographyTokens: { [index: string]: TextStyle } = {
64
64
  // { fontFamily }{ fontStyle }{ fontWeight }
65
65
  ...fonts,
66
66
 
67
+ italic: {
68
+ fontStyle: "italic",
69
+ },
70
+
67
71
  startAlign: {
68
72
  textAlign: "left",
69
73
  },
@@ -146,7 +146,7 @@ function InternalTypography<T extends FontFamily = "base">({
146
146
  }: TypographyProps<T>): JSX.Element {
147
147
  const sizeAndHeight = getSizeAndHeightStyle(size, lineHeight);
148
148
  const style: StyleProp<ViewStyle>[] = [
149
- getFontStyle(fontFamily, fontStyle, fontWeight),
149
+ getFontStyle(fontFamily, fontWeight),
150
150
  getColorStyle(color, reverseTheme),
151
151
  getAlignStyle(align),
152
152
  sizeAndHeight,
@@ -156,6 +156,11 @@ function InternalTypography<T extends FontFamily = "base">({
156
156
  if (strikeThrough) {
157
157
  style.push(styles.strikeThrough);
158
158
  }
159
+
160
+ if (fontStyle === "italic") {
161
+ style.push(styles.italic);
162
+ }
163
+
159
164
  const numberOfLinesForNativeText = maxNumberOfLines[maxLines];
160
165
 
161
166
  const text = getTransformedText(children, transform);
@@ -198,14 +203,11 @@ function getScaleMultiplier(maxFontScaleSize = 0, size = 1) {
198
203
 
199
204
  function getFontStyle(
200
205
  fontFamily: FontFamily = "base",
201
- fontStyle: FontStyle = "regular",
202
206
  fontWeight: FontWeight = "regular",
203
207
  ) {
204
208
  const defaultBaseFontStyling = styles.baseRegularRegular;
205
209
  const defaultDisplayFontStyling = styles.displayRegularBold;
206
- const styleKey = `${fontFamily}${capitalize(fontStyle)}${capitalize(
207
- fontWeight,
208
- )}`;
210
+ const styleKey = `${fontFamily}Regular${capitalize(fontWeight)}`;
209
211
  const fontStyling = styles[styleKey];
210
212
 
211
213
  if (fontStyling) {
@@ -211,7 +211,7 @@ exports[`renders text with bold weight and italic style 1`] = `
211
211
  style={
212
212
  [
213
213
  {
214
- "fontFamily": "inter-regular",
214
+ "fontFamily": "inter-bold",
215
215
  },
216
216
  {
217
217
  "color": "hsl(197, 15%, 45%)",
@@ -226,6 +226,9 @@ exports[`renders text with bold weight and italic style 1`] = `
226
226
  {
227
227
  "letterSpacing": 0,
228
228
  },
229
+ {
230
+ "fontStyle": "italic",
231
+ },
229
232
  ]
230
233
  }
231
234
  >
@@ -424,6 +427,9 @@ exports[`renders text with italic style 1`] = `
424
427
  {
425
428
  "letterSpacing": 0,
426
429
  },
430
+ {
431
+ "fontStyle": "italic",
432
+ },
427
433
  ]
428
434
  }
429
435
  >