@jobber/components-native 0.71.2 → 0.72.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.71.2",
3
+ "version": "0.72.0",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -82,5 +82,5 @@
82
82
  "react-native-safe-area-context": "^4.5.2",
83
83
  "react-native-svg": ">=12.0.0"
84
84
  },
85
- "gitHead": "88ff540bdd1af6f58af44e60d20fe00921084adb"
85
+ "gitHead": "26cb076b2f8a8cbdaee1df6be72b211987a4e5eb"
86
86
  }
@@ -16,9 +16,9 @@ export const TEXT_MAX_SCALED_FONT_SIZES = {
16
16
  text: MAX_TEXT_FONT_SIZE_SCALE,
17
17
  textSupporting: tokens["typography--fontSize-base"],
18
18
  };
19
- export function Text({ level = "text", variation = "base", emphasis, allowFontScaling = true, adjustsFontSizeToFit = false, maxLines = "unlimited", align, children, reverseTheme = false, strikeThrough = false, italic = false, hideFromScreenReader = false, maxFontScaleSize, selectable, }) {
19
+ export function Text({ level = "text", variation = "base", emphasis, allowFontScaling = true, adjustsFontSizeToFit = false, maxLines = "unlimited", align, children, reverseTheme = false, strikeThrough = false, italic = false, hideFromScreenReader = false, maxFontScaleSize, underline, selectable, }) {
20
20
  const accessibilityRole = "text";
21
- return (React.createElement(Typography, Object.assign({ color: variation, fontFamily: "base", fontStyle: italic ? "italic" : "regular", fontWeight: getFontWeight({ level, emphasis }), maxFontScaleSize: maxFontScaleSize || TEXT_MAX_SCALED_FONT_SIZES[level], selectable: selectable }, Object.assign(Object.assign({}, levelStyles[level]), { allowFontScaling,
21
+ return (React.createElement(Typography, Object.assign({ color: variation, fontFamily: "base", fontStyle: italic ? "italic" : "regular", fontWeight: getFontWeight({ level, emphasis }), maxFontScaleSize: maxFontScaleSize || TEXT_MAX_SCALED_FONT_SIZES[level], selectable: selectable, underline: underline }, Object.assign(Object.assign({}, levelStyles[level]), { allowFontScaling,
22
22
  align,
23
23
  adjustsFontSizeToFit,
24
24
  accessibilityRole,
@@ -15,7 +15,8 @@ const maxNumberOfLines = {
15
15
  unlimited: undefined,
16
16
  };
17
17
  export const Typography = React.memo(InternalTypography);
18
- function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, color, align, size = "default", children, maxLines = "unlimited", allowFontScaling = true, maxFontScaleSize, adjustsFontSizeToFit = false, lineHeight, letterSpacing, reverseTheme = false, hideFromScreenReader = false, accessibilityRole = "text", strikeThrough = false, selectable = true, }) {
18
+ // eslint-disable-next-line max-statements
19
+ function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, color, align, size = "default", children, maxLines = "unlimited", allowFontScaling = true, maxFontScaleSize, adjustsFontSizeToFit = false, lineHeight, letterSpacing, reverseTheme = false, hideFromScreenReader = false, accessibilityRole = "text", strikeThrough = false, underline, selectable = true, }) {
19
20
  const sizeAndHeight = getSizeAndHeightStyle(size, lineHeight);
20
21
  const style = [
21
22
  getFontStyle(fontFamily, fontStyle, fontWeight),
@@ -30,6 +31,10 @@ function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, colo
30
31
  if (fontStyle === "italic") {
31
32
  style.push(styles.italic);
32
33
  }
34
+ if (underline) {
35
+ const underlineTextStyle = { textDecorationStyle: underline };
36
+ style.push(underlineTextStyle, styles.underline);
37
+ }
33
38
  const numberOfLinesForNativeText = maxNumberOfLines[maxLines];
34
39
  const text = getTransformedText(children, transform);
35
40
  const accessibilityProps = hideFromScreenReader
@@ -65,6 +65,9 @@ const fonts = Platform.select({
65
65
  */
66
66
  export const typographyTokens = Object.assign(Object.assign({}, fonts), { italic: {
67
67
  fontStyle: "italic",
68
+ }, underline: {
69
+ textDecorationColor: tokens["color-text--secondary"],
70
+ textDecorationLine: "underline",
68
71
  }, startAlign: {
69
72
  textAlign: "left",
70
73
  }, endAlign: {