@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/dist/package.json +2 -2
- package/dist/src/Typography/Typography.js +6 -3
- package/dist/src/Typography/Typography.style.js +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/Typography/Typography.style.ts +4 -0
- package/src/Typography/Typography.tsx +7 -5
- package/src/Typography/__snapshots__/Typography.test.tsx.snap +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.66.
|
|
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": "
|
|
87
|
+
"gitHead": "9be6e610f02772de62d13a01a945a74f89b0c184"
|
|
88
88
|
}
|
|
@@ -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,
|
|
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(
|
|
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-
|
|
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
|
>
|