@jobber/components-native 0.86.1 → 0.86.2-JOB-89949-ec4cb2a.11

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.86.1",
3
+ "version": "0.86.2-JOB-89949-ec4cb2a.11+ec4cb2ad1",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -95,5 +95,5 @@
95
95
  "react-native-safe-area-context": "^5.4.0",
96
96
  "react-native-svg": ">=12.0.0"
97
97
  },
98
- "gitHead": "ca472a375fdf3c6b8e8596c3c26a3958893093ec"
98
+ "gitHead": "ec4cb2ad125a2793e88b405dc0d53041a4c1dab6"
99
99
  }
@@ -38,7 +38,7 @@ function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, colo
38
38
  style.push(UNSAFE_style.textStyle);
39
39
  }
40
40
  const numberOfLinesForNativeText = maxNumberOfLines[maxLines];
41
- const text = getTransformedText(children, transform);
41
+ const content = transformChildren(children, transform);
42
42
  const accessibilityProps = hideFromScreenReader
43
43
  ? {
44
44
  accessibilityRole: "none",
@@ -50,7 +50,7 @@ function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, colo
50
50
  const textComponent = (React.createElement(Text, Object.assign({ allowFontScaling,
51
51
  adjustsFontSizeToFit,
52
52
  style,
53
- numberOfLines: numberOfLinesForNativeText }, accessibilityProps, { maxFontSizeMultiplier: getScaleMultiplier(maxFontScaleSize, sizeAndHeight.fontSize), selectable: selectable, selectionColor: tokens["color-brand--highlight"], onTextLayout: onTextLayout }), text));
53
+ numberOfLines: numberOfLinesForNativeText }, accessibilityProps, { maxFontSizeMultiplier: getScaleMultiplier(maxFontScaleSize, sizeAndHeight.fontSize), selectable: selectable, selectionColor: tokens["color-brand--highlight"], onTextLayout: onTextLayout }), content));
54
54
  // If text is not selectable, there's no need for TypographyGestureDetector
55
55
  // since it only prevents accidental highlighting of selectable text
56
56
  if (!selectable) {
@@ -80,15 +80,26 @@ function getFontStyle(fontFamily = "base", fontStyle = "regular", fontWeight = "
80
80
  function getTransformedText(text, transform) {
81
81
  switch (transform) {
82
82
  case "lowercase":
83
- return text === null || text === void 0 ? void 0 : text.toLocaleLowerCase();
83
+ return text.toLocaleLowerCase();
84
84
  case "uppercase":
85
- return text === null || text === void 0 ? void 0 : text.toLocaleUpperCase();
85
+ return text.toLocaleUpperCase();
86
86
  case "capitalize":
87
- return capitalize(text || "");
87
+ return capitalize(text);
88
88
  default:
89
89
  return text;
90
90
  }
91
91
  }
92
+ function transformChildren(children, transform) {
93
+ if (children == null || !transform || transform === "none")
94
+ return children;
95
+ return React.Children.map(children, child => {
96
+ if (typeof child === "string") {
97
+ return getTransformedText(child, transform);
98
+ }
99
+ // Keep non-string children (numbers, elements, fragments) unchanged
100
+ return child;
101
+ });
102
+ }
92
103
  function getColorStyle(styles, color, reverseTheme) {
93
104
  if (color === "default" || !color) {
94
105
  return styles.greyBlue;