@jobber/components-native 0.76.1-JOB-116234-314c5ff.22 → 0.76.1-JOB-116234-4bc5afd.23

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.76.1-JOB-116234-314c5ff.22+314c5ff4",
3
+ "version": "0.76.1-JOB-116234-4bc5afd.23+4bc5afdb",
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": "314c5ff4e8322594d2fc7ffce54a204f4a6731cb"
83
+ "gitHead": "4bc5afdb99786f50a9ae8474ac282eb593dd9867"
84
84
  }
@@ -1,6 +1,8 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { buildThemedStyles, } from "../AtlantisThemeContext";
3
- import { typographyStyles as staticTypographyStyles, useTypographyStyles, } from "../Typography";
3
+ import {
4
+ // eslint-disable-next-line import/no-deprecated
5
+ typographyStyles as staticTypographyStyles, useTypographyStyles, } from "../Typography";
4
6
  import { tokens as staticTokens } from "../utils/design";
5
7
  export const createCommonInputTokens = (tokens, typographyStyles) => ({
6
8
  input: {
@@ -37,7 +39,9 @@ export const createCommonInputTokens = (tokens, typographyStyles) => ({
37
39
  /**
38
40
  * @deprecated Use useCommonInputStyles instead
39
41
  */
40
- export const commonInputStyles = StyleSheet.create(createCommonInputTokens(staticTokens, staticTypographyStyles));
42
+ export const commonInputStyles = StyleSheet.create(
43
+ // eslint-disable-next-line import/no-deprecated
44
+ createCommonInputTokens(staticTokens, staticTypographyStyles));
41
45
  export const useCommonInputStyles = () => {
42
46
  const typographyStyles = useTypographyStyles();
43
47
  const themedStyles = buildThemedStyles(tokens => createCommonInputTokens(tokens, typographyStyles))();
@@ -2,13 +2,14 @@ import React from "react";
2
2
  import { Pressable, Text as RNText, View, } from "react-native";
3
3
  import { Icon } from "../../../Icon";
4
4
  import { Text } from "../../../Text";
5
- import { typographyStyles } from "../../../Typography";
5
+ import { useTypographyStyles } from "../../../Typography";
6
6
  import { useAtlantisTheme } from "../../../AtlantisThemeContext";
7
7
  import { useStyles } from "../../InputFieldWrapper.style";
8
8
  export const suffixLabelTestId = "ATL-InputFieldWrapper-SuffixLabel";
9
9
  export const suffixIconTestId = "ATL-InputFieldWrapper-SuffixIcon";
10
10
  export function SuffixLabel({ focused, disabled, hasMiniLabel, inputInvalid, label, hasLeftMargin = true, styleOverride, }) {
11
11
  const styles = useStyles();
12
+ const typographyStyles = useTypographyStyles();
12
13
  return (React.createElement(View, { testID: suffixLabelTestId, style: [
13
14
  styles.fieldAffix,
14
15
  focused && styles.inputFocused,
@@ -1,7 +1,8 @@
1
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
2
- import { typographyStyles } from "../Typography/Typography.style";
3
- export const useStyles = buildThemedStyles(tokens => {
4
- return {
2
+ import { useTypographyStyles } from "../Typography";
3
+ export const useStyles = () => {
4
+ const typographyStyles = useTypographyStyles();
5
+ return buildThemedStyles(tokens => ({
5
6
  pressable: {
6
7
  flex: 1,
7
8
  },
@@ -20,5 +21,5 @@ export const useStyles = buildThemedStyles(tokens => {
20
21
  inputInvalid: {
21
22
  borderColor: tokens["color-critical"],
22
23
  },
23
- };
24
- });
24
+ }))();
25
+ };
@@ -1,7 +1,8 @@
1
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
2
- import { typographyStyles } from "../Typography";
3
- export const useStyles = buildThemedStyles(tokens => {
4
- return {
2
+ import { useTypographyStyles } from "../Typography";
3
+ export const useStyles = () => {
4
+ const typographyStyles = useTypographyStyles();
5
+ return buildThemedStyles(tokens => ({
5
6
  inputPaddingTop: {
6
7
  paddingTop: (typographyStyles.smallSize.fontSize || 0) +
7
8
  tokens["space-smaller"] +
@@ -17,8 +18,7 @@ export const useStyles = buildThemedStyles(tokens => {
17
18
  paddingBottom: tokens["space-small"] - tokens["space-smallest"],
18
19
  },
19
20
  multilineInputiOS: {
20
- // for placeholder
21
21
  paddingTop: (typographyStyles.defaultSize.fontSize || 0) + tokens["space-smallest"],
22
22
  },
23
- };
24
- });
23
+ }))();
24
+ };
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { I18nManager, StyleSheet, Text, } from "react-native";
3
3
  import { TypographyGestureDetector } from "./TypographyGestureDetector";
4
- import { typographyStyles as styles } from "./Typography.style";
4
+ import { useTypographyStyles } from "./Typography.style";
5
5
  import { capitalize } from "../utils/intl";
6
6
  import { useAtlantisTheme } from "../AtlantisThemeContext";
7
7
  const maxNumberOfLines = {
@@ -15,13 +15,14 @@ const maxNumberOfLines = {
15
15
  export const Typography = React.memo(InternalTypography);
16
16
  // eslint-disable-next-line max-statements
17
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
- const sizeAndHeight = getSizeAndHeightStyle(size, lineHeight);
18
+ const styles = useTypographyStyles();
19
+ const sizeAndHeight = getSizeAndHeightStyle(size, styles, lineHeight);
19
20
  const style = [
20
- getFontStyle(fontFamily, fontStyle, fontWeight),
21
- getColorStyle(color, reverseTheme),
22
- getAlignStyle(align),
21
+ getFontStyle(fontFamily, fontStyle, fontWeight, styles),
22
+ getColorStyle(styles, color, reverseTheme),
23
+ getAlignStyle(styles, align),
23
24
  sizeAndHeight,
24
- getLetterSpacingStyle(letterSpacing),
25
+ getLetterSpacingStyle(letterSpacing, styles),
25
26
  ];
26
27
  if (strikeThrough) {
27
28
  style.push(styles.strikeThrough);
@@ -57,7 +58,7 @@ function getScaleMultiplier(maxFontScaleSize = 0, size = 1) {
57
58
  return undefined;
58
59
  return maxFontScaleSize / size;
59
60
  }
60
- function getFontStyle(fontFamily = "base", fontStyle = "regular", fontWeight = "regular") {
61
+ function getFontStyle(fontFamily = "base", fontStyle = "regular", fontWeight = "regular", styles) {
61
62
  const defaultBaseFontStyling = styles.baseRegularRegular;
62
63
  const defaultDisplayFontStyling = styles.displayRegularBold;
63
64
  const styleKey = `${fontFamily}${capitalize(fontStyle)}${capitalize(fontWeight)}`;
@@ -83,17 +84,17 @@ function getTransformedText(text, transform) {
83
84
  return text;
84
85
  }
85
86
  }
86
- function getColorStyle(color, reverseTheme) {
87
+ function getColorStyle(styles, color, reverseTheme) {
87
88
  if (color === "default" || !color) {
88
89
  return styles.greyBlue;
89
90
  }
90
91
  const colorStyleKey = `${color}${reverseTheme ? "Reverse" : ""}`;
91
92
  return styles[`${colorStyleKey}`];
92
93
  }
93
- function getAlignStyle(alignStyle = I18nManager.isRTL ? "end" : "start") {
94
+ function getAlignStyle(styles, alignStyle = I18nManager.isRTL ? "end" : "start") {
94
95
  return styles[`${alignStyle}Align`];
95
96
  }
96
- function getSizeAndHeightStyle(textSize, lineHeightOverwrite) {
97
+ function getSizeAndHeightStyle(textSize, styles, lineHeightOverwrite) {
97
98
  const fontSize = styles[`${textSize}Size`];
98
99
  if (lineHeightOverwrite) {
99
100
  const lineHeight = styles[`${lineHeightOverwrite}LineHeight`];
@@ -101,6 +102,6 @@ function getSizeAndHeightStyle(textSize, lineHeightOverwrite) {
101
102
  }
102
103
  return fontSize;
103
104
  }
104
- function getLetterSpacingStyle(letterSpacing = "base") {
105
+ function getLetterSpacingStyle(letterSpacing = "base", styles) {
105
106
  return styles[`${letterSpacing}LetterSpacing`];
106
107
  }
@@ -354,7 +354,7 @@ export const createTypographyTokens = (tokens) => (Object.assign(Object.assign({
354
354
  textDecorationLine: "line-through",
355
355
  } }));
356
356
  /**
357
- * @deprecated Use useCommonInputStyles instead
357
+ * @deprecated Use useTypographyStyles instead
358
358
  */
359
359
  export const typographyStyles = StyleSheet.create(createTypographyTokens(staticTokens));
360
360
  export const useTypographyStyles = buildThemedStyles(createTypographyTokens);