@jobber/components-native 0.75.5 → 0.76.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.75.5",
3
+ "version": "0.76.0",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -80,5 +80,5 @@
80
80
  "react-native-safe-area-context": "^4.5.2",
81
81
  "react-native-svg": ">=12.0.0"
82
82
  },
83
- "gitHead": "baec68accebefa70b2f1234d757473e67a713ced"
83
+ "gitHead": "3dbb361d102c6ae833d1dce373125b7bf68508c0"
84
84
  }
@@ -5,7 +5,7 @@ import { InternalButtonLoading } from "./components/InternalButtonLoading";
5
5
  import { ActionLabel } from "../ActionLabel";
6
6
  import { Icon } from "../Icon";
7
7
  import { tokens } from "../utils/design";
8
- export function Button({ label, onPress, variation = "work", type = "primary", fullHeight = false, fullWidth = true, disabled = false, loading = false, size = "base", accessibilityLabel, accessibilityHint, icon, testID, }) {
8
+ export function Button({ label, onPress, variation = "work", type = "primary", fullHeight = false, fullWidth = true, disabled = false, loading = false, size = "base", accessibilityLabel, accessibilityHint, icon, testID, UNSAFE_style, }) {
9
9
  const buttonStyle = [
10
10
  styles.button,
11
11
  styles[size],
@@ -25,12 +25,15 @@ export function Button({ label, onPress, variation = "work", type = "primary", f
25
25
  fullWidth && styles.fullWidth,
26
26
  fullHeight && styles.fullHeight,
27
27
  ] },
28
- React.createElement(View, { style: buttonStyle },
28
+ React.createElement(View, { style: [buttonStyle, UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.container] },
29
29
  loading && React.createElement(InternalButtonLoading, { variation: variation, type: type }),
30
- React.createElement(View, { style: getContentStyles(label, icon) },
31
- icon && (React.createElement(View, { style: styles.iconStyle },
30
+ React.createElement(View, { style: [
31
+ getContentStyles(label, icon),
32
+ UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.contentContainer,
33
+ ], testID: "contentContainer" },
34
+ icon && (React.createElement(View, { style: [styles.iconStyle, UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.iconContainer], testID: "iconContainer" },
32
35
  React.createElement(Icon, { name: icon, color: getIconColorVariation(variation, type, disabled) }))),
33
- label && (React.createElement(View, { style: styles.labelStyle },
36
+ label && (React.createElement(View, { style: [styles.labelStyle, UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.actionLabelContainer], testID: "actionLabelContainer" },
34
37
  React.createElement(ActionLabel, { variation: getActionLabelVariation(variation, type), disabled: disabled, align: icon ? "start" : undefined }, label)))))));
35
38
  }
36
39
  function getActionLabelVariation(variation, type) {
@@ -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, underline, 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, UNSAFE_style, 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, underline: underline }, levelStyles[level], { allowFontScaling,
21
+ return (React.createElement(Typography, Object.assign({ color: variation, UNSAFE_style: UNSAFE_style, fontFamily: "base", fontStyle: italic ? "italic" : "regular", fontWeight: getFontWeight({ level, emphasis }), maxFontScaleSize: maxFontScaleSize || TEXT_MAX_SCALED_FONT_SIZES[level], selectable: selectable, underline: underline }, levelStyles[level], { allowFontScaling,
22
22
  align,
23
23
  adjustsFontSizeToFit,
24
24
  accessibilityRole,
@@ -14,7 +14,7 @@ const maxNumberOfLines = {
14
14
  };
15
15
  export const Typography = React.memo(InternalTypography);
16
16
  // eslint-disable-next-line max-statements
17
- 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, }) {
17
+ 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, UNSAFE_style, selectable = true, }) {
18
18
  const sizeAndHeight = getSizeAndHeightStyle(size, lineHeight);
19
19
  const style = [
20
20
  getFontStyle(fontFamily, fontStyle, fontWeight),
@@ -33,6 +33,9 @@ function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, colo
33
33
  const underlineTextStyle = { textDecorationStyle: underline };
34
34
  style.push(underlineTextStyle, styles.underline);
35
35
  }
36
+ if (UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.textStyle) {
37
+ style.push(UNSAFE_style.textStyle);
38
+ }
36
39
  const numberOfLinesForNativeText = maxNumberOfLines[maxLines];
37
40
  const text = getTransformedText(children, transform);
38
41
  const accessibilityProps = hideFromScreenReader