@jobber/components-native 0.76.1-JOB-116234-63c4467.27 → 0.76.1-JOB-116234-6cadae0.33

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.
Files changed (42) hide show
  1. package/dist/package.json +2 -2
  2. package/dist/src/BottomSheet/BottomSheet.style.js +1 -2
  3. package/dist/src/Button/Button.style.js +1 -1
  4. package/dist/src/Checkbox/Checkbox.style.js +1 -2
  5. package/dist/src/Chip/Chip.style.js +1 -2
  6. package/dist/src/ContentOverlay/ContentOverlay.style.js +2 -3
  7. package/dist/src/InputFieldWrapper/CommonInputStyles.style.js +42 -42
  8. package/dist/src/InputFieldWrapper/InputFieldWrapper.style.js +8 -8
  9. package/dist/src/InputFieldWrapper/index.js +1 -1
  10. package/dist/src/InputPressable/InputPressable.style.js +6 -6
  11. package/dist/src/InputText/InputText.style.js +6 -6
  12. package/dist/src/Menu/components/Overlay/Overlay.style.js +2 -11
  13. package/dist/src/Select/Select.style.js +17 -14
  14. package/dist/src/Typography/Typography.js +2 -2
  15. package/dist/src/Typography/Typography.style.js +4 -4
  16. package/dist/src/Typography/index.js +1 -1
  17. package/dist/tsconfig.tsbuildinfo +1 -1
  18. package/dist/types/src/Button/Button.style.d.ts +1 -0
  19. package/dist/types/src/InputFieldWrapper/CommonInputStyles.style.d.ts +2 -1
  20. package/dist/types/src/InputFieldWrapper/index.d.ts +1 -1
  21. package/dist/types/src/Menu/components/Overlay/Overlay.style.d.ts +5 -5
  22. package/dist/types/src/Select/Select.style.d.ts +1 -8
  23. package/dist/types/src/Typography/Typography.style.d.ts +2 -2
  24. package/dist/types/src/Typography/index.d.ts +1 -1
  25. package/package.json +2 -2
  26. package/src/AtlantisThemeContext/buildThemedStyles.test.tsx +0 -26
  27. package/src/BottomSheet/BottomSheet.style.ts +2 -2
  28. package/src/Button/Button.style.ts +1 -1
  29. package/src/Checkbox/Checkbox.style.ts +2 -4
  30. package/src/Chip/Chip.style.ts +2 -3
  31. package/src/ContentOverlay/ContentOverlay.style.ts +3 -4
  32. package/src/InputFieldWrapper/CommonInputStyles.style.ts +46 -47
  33. package/src/InputFieldWrapper/InputFieldWrapper.style.ts +9 -8
  34. package/src/InputFieldWrapper/components/Prefix/Prefix.test.tsx +0 -2
  35. package/src/InputFieldWrapper/index.ts +4 -1
  36. package/src/InputPressable/InputPressable.style.ts +6 -6
  37. package/src/InputText/InputText.style.ts +6 -6
  38. package/src/Menu/components/Overlay/Overlay.style.ts +2 -6
  39. package/src/Select/Select.style.ts +17 -14
  40. package/src/Typography/Typography.style.ts +4 -4
  41. package/src/Typography/Typography.tsx +3 -3
  42. package/src/Typography/index.ts +1 -1
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.76.1-JOB-116234-63c4467.27+63c44675",
3
+ "version": "0.76.1-JOB-116234-6cadae0.33+6cadae01",
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": "63c446753585b99a48ea4782613671ca6ff3c8b1"
83
+ "gitHead": "6cadae0138cf0633adc31d349b1f03dc50776679"
84
84
  }
@@ -1,9 +1,8 @@
1
1
  import { Dimensions, StyleSheet } from "react-native";
2
- import { tokens as staticTokens } from "../utils/design";
3
2
  import { buildThemedStyles } from "../AtlantisThemeContext";
4
3
  const { height } = Dimensions.get("window");
5
- const modalBorderRadius = staticTokens["radius-larger"];
6
4
  export const useStyles = buildThemedStyles(tokens => {
5
+ const modalBorderRadius = tokens["radius-larger"];
7
6
  return {
8
7
  overlayModalize: {
9
8
  backgroundColor: "transparent",
@@ -29,7 +29,7 @@ export const useStyles = buildThemedStyles(tokens => {
29
29
  },
30
30
  base: {
31
31
  minHeight: baseButtonHeight,
32
- // paddingHorizontal: tokens["space-base"],
32
+ paddingHorizontal: tokens["space-base"],
33
33
  },
34
34
  small: {
35
35
  minHeight: smallButtonHeight,
@@ -1,7 +1,6 @@
1
- import { tokens as staticTokens } from "../utils/design";
2
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
3
- const checkboxDimensions = staticTokens["space-large"] + staticTokens["space-smaller"];
4
2
  export const useStyles = buildThemedStyles(tokens => {
3
+ const checkboxDimensions = tokens["space-large"] + tokens["space-smaller"];
5
4
  return {
6
5
  container: {
7
6
  width: "100%",
@@ -1,7 +1,6 @@
1
- import { tokens as staticTokens } from "../utils/design";
2
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
3
- const chipHeight = staticTokens["space-larger"] + staticTokens["space-small"];
4
2
  export const useStyles = buildThemedStyles(tokens => {
3
+ const chipHeight = tokens["space-larger"] + tokens["space-small"];
5
4
  return {
6
5
  container: {
7
6
  alignItems: "center",
@@ -1,8 +1,7 @@
1
- import { tokens as staticTokens } from "../utils/design";
2
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
3
- const modalBorderRadius = staticTokens["radius-larger"];
4
- const titleOffsetFromHandle = staticTokens["space-base"];
5
2
  export const useStyles = buildThemedStyles(tokens => {
3
+ const modalBorderRadius = tokens["radius-larger"];
4
+ const titleOffsetFromHandle = tokens["space-base"];
6
5
  return {
7
6
  handle: {
8
7
  width: tokens["space-largest"],
@@ -1,49 +1,49 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { buildThemedStyles, } from "../AtlantisThemeContext";
3
- import {
4
- // eslint-disable-next-line import/no-deprecated
5
- typographyStyles as staticTypographyStyles, useTypographyStyles, } from "../Typography";
3
+ import { getTypographyStyles } from "../Typography";
6
4
  import { tokens as staticTokens } from "../utils/design";
7
- export const createCommonInputTokens = (tokens, typographyStyles) => ({
8
- input: {
9
- width: "100%",
10
- flexShrink: 1,
11
- flexGrow: 1,
12
- color: tokens["color-text"],
13
- fontFamily: typographyStyles.baseRegularRegular.fontFamily,
14
- fontSize: typographyStyles.defaultSize.fontSize,
15
- letterSpacing: typographyStyles.baseLetterSpacing.letterSpacing,
16
- minHeight: tokens["space-largest"] + tokens["space-small"],
17
- padding: 0,
18
- },
19
- inputEmpty: {
20
- paddingTop: 0,
21
- },
22
- inputDisabled: {
23
- color: typographyStyles.disabled.color,
24
- },
25
- container: {
26
- paddingLeft: tokens["space-base"],
27
- marginVertical: tokens["space-smaller"],
28
- backgroundColor: tokens["color-surface"],
29
- minHeight: tokens["space-largest"] + tokens["space-small"],
30
- flexDirection: "row",
31
- justifyContent: "space-between",
32
- width: "100%",
33
- borderColor: tokens["color-border"],
34
- borderStyle: "solid",
35
- borderWidth: tokens["border-base"],
36
- borderRadius: tokens["radius-base"],
37
- },
38
- });
5
+ export const createCommonInputTokens = (tokens) => {
6
+ const typographyStyles = getTypographyStyles(tokens);
7
+ return {
8
+ input: {
9
+ width: "100%",
10
+ flexShrink: 1,
11
+ flexGrow: 1,
12
+ color: tokens["color-text"],
13
+ fontFamily: typographyStyles.baseRegularRegular.fontFamily,
14
+ fontSize: typographyStyles.defaultSize.fontSize,
15
+ letterSpacing: typographyStyles.baseLetterSpacing.letterSpacing,
16
+ minHeight: tokens["space-largest"] + tokens["space-small"],
17
+ padding: 0,
18
+ },
19
+ inputEmpty: {
20
+ paddingTop: 0,
21
+ },
22
+ inputDisabled: {
23
+ color: typographyStyles.disabled.color,
24
+ },
25
+ container: {
26
+ paddingLeft: tokens["space-base"],
27
+ marginVertical: tokens["space-smaller"],
28
+ backgroundColor: tokens["color-surface"],
29
+ minHeight: tokens["space-largest"] + tokens["space-small"],
30
+ flexDirection: "row",
31
+ justifyContent: "space-between",
32
+ width: "100%",
33
+ borderColor: tokens["color-border"],
34
+ borderStyle: "solid",
35
+ borderWidth: tokens["border-base"],
36
+ borderRadius: tokens["radius-base"],
37
+ },
38
+ };
39
+ };
39
40
  /**
40
41
  * @deprecated Use useCommonInputStyles instead
41
42
  */
42
- export const commonInputStyles = StyleSheet.create(
43
- // eslint-disable-next-line import/no-deprecated
44
- createCommonInputTokens(staticTokens, staticTypographyStyles));
45
- export const useCommonInputStyles = () => {
46
- const typographyStyles = useTypographyStyles();
47
- const themedStyles = buildThemedStyles(tokens => createCommonInputTokens(tokens, typographyStyles))();
48
- return themedStyles;
43
+ export const commonInputStyles = StyleSheet.create(createCommonInputTokens(staticTokens));
44
+ export const getCommonInputStyles = (tokens) => {
45
+ return createCommonInputTokens(tokens);
49
46
  };
47
+ export const useCommonInputStyles = buildThemedStyles(tokens => {
48
+ return getCommonInputStyles(tokens);
49
+ });
@@ -1,11 +1,11 @@
1
1
  import { StyleSheet } from "react-native";
2
- import { useCommonInputStyles } from "./CommonInputStyles.style";
2
+ import { getCommonInputStyles } from "./CommonInputStyles.style";
3
3
  import { buildThemedStyles } from "../AtlantisThemeContext";
4
- import { useTypographyStyles } from "../Typography";
5
- export const useStyles = () => {
6
- const commonInputStyles = useCommonInputStyles();
7
- const typographyStyles = useTypographyStyles();
8
- return buildThemedStyles(tokens => ({
4
+ import { getTypographyStyles } from "../Typography";
5
+ export const useStyles = buildThemedStyles(tokens => {
6
+ const commonInputStyles = getCommonInputStyles(tokens);
7
+ const typographyStyles = getTypographyStyles(tokens);
8
+ return {
9
9
  container: StyleSheet.flatten([
10
10
  commonInputStyles.container,
11
11
  {
@@ -119,5 +119,5 @@ export const useStyles = () => {
119
119
  paddingTop: tokens["space-base"] - tokens["space-smaller"],
120
120
  bottom: tokens["space-smaller"],
121
121
  },
122
- }))();
123
- };
122
+ };
123
+ });
@@ -1,2 +1,2 @@
1
- export { useCommonInputStyles } from "./CommonInputStyles.style";
1
+ export { getCommonInputStyles, useCommonInputStyles, } from "./CommonInputStyles.style";
2
2
  export { InputFieldWrapper } from "./InputFieldWrapper";
@@ -1,8 +1,8 @@
1
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
2
- import { useTypographyStyles } from "../Typography";
3
- export const useStyles = () => {
4
- const typographyStyles = useTypographyStyles();
5
- return buildThemedStyles(tokens => ({
2
+ import { getTypographyStyles } from "../Typography";
3
+ export const useStyles = buildThemedStyles(tokens => {
4
+ const typographyStyles = getTypographyStyles(tokens);
5
+ return {
6
6
  pressable: {
7
7
  flex: 1,
8
8
  },
@@ -21,5 +21,5 @@ export const useStyles = () => {
21
21
  inputInvalid: {
22
22
  borderColor: tokens["color-critical"],
23
23
  },
24
- }))();
25
- };
24
+ };
25
+ });
@@ -1,8 +1,8 @@
1
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
2
- import { useTypographyStyles } from "../Typography";
3
- export const useStyles = () => {
4
- const typographyStyles = useTypographyStyles();
5
- return buildThemedStyles(tokens => ({
2
+ import { getTypographyStyles } from "../Typography";
3
+ export const useStyles = buildThemedStyles(tokens => {
4
+ const typographyStyles = getTypographyStyles(tokens);
5
+ return {
6
6
  inputPaddingTop: {
7
7
  paddingTop: (typographyStyles.smallSize.fontSize || 0) +
8
8
  tokens["space-smaller"] +
@@ -20,5 +20,5 @@ export const useStyles = () => {
20
20
  multilineInputiOS: {
21
21
  paddingTop: (typographyStyles.defaultSize.fontSize || 0) + tokens["space-smallest"],
22
22
  },
23
- }))();
24
- };
23
+ };
24
+ });
@@ -1,17 +1,8 @@
1
- import { Dimensions } from "react-native";
1
+ import { Dimensions, StyleSheet } from "react-native";
2
2
  import { buildThemedStyles } from "../../../AtlantisThemeContext";
3
3
  const { height } = Dimensions.get("window");
4
4
  export const useStyles = buildThemedStyles(tokens => {
5
5
  return {
6
- overlay: {
7
- position: "absolute",
8
- top: 0,
9
- left: 0,
10
- right: 0,
11
- bottom: 0,
12
- backgroundColor: tokens["color-overlay"],
13
- opacity: 0,
14
- height,
15
- },
6
+ overlay: Object.assign(Object.assign({}, StyleSheet.absoluteFillObject), { backgroundColor: tokens["color-overlay"], opacity: 0, height }),
16
7
  };
17
8
  });
@@ -1,9 +1,9 @@
1
1
  import { StyleSheet } from "react-native";
2
- import { useCommonInputStyles } from "../InputFieldWrapper";
2
+ import { getCommonInputStyles } from "../InputFieldWrapper";
3
3
  import { buildThemedStyles } from "../AtlantisThemeContext";
4
- export const useStyles = () => {
5
- const commonInputStyles = useCommonInputStyles();
6
- return buildThemedStyles(tokens => ({
4
+ export const useStyles = buildThemedStyles(tokens => {
5
+ const commonInputStyles = getCommonInputStyles(tokens);
6
+ return {
7
7
  container: StyleSheet.flatten([
8
8
  commonInputStyles.container,
9
9
  {
@@ -14,14 +14,17 @@ export const useStyles = () => {
14
14
  borderWidth: 0,
15
15
  },
16
16
  ]),
17
- input: {
18
- flexDirection: "row",
19
- flexGrow: 0,
20
- paddingTop: tokens["space-smaller"],
21
- minHeight: 0,
22
- minWidth: "100%",
23
- paddingRight: tokens["space-small"],
24
- },
17
+ input: StyleSheet.flatten([
18
+ commonInputStyles.input,
19
+ {
20
+ flexDirection: "row",
21
+ flexGrow: 0,
22
+ paddingTop: tokens["space-smaller"],
23
+ minHeight: 0,
24
+ minWidth: "100%",
25
+ paddingRight: tokens["space-small"],
26
+ },
27
+ ]),
25
28
  value: {
26
29
  flexGrow: 1,
27
30
  flexShrink: 1,
@@ -47,5 +50,5 @@ export const useStyles = () => {
47
50
  paddingTop: tokens["space-smaller"],
48
51
  flexDirection: "row",
49
52
  },
50
- }))();
51
- };
53
+ };
54
+ });
@@ -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, UNSAFE_style, selectable = true, }) {
17
+ function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, color, align, size = "default", children, maxLines = "unlimited", allowFontScaling = true, maxFontScaleSize, adjustsFontSizeToFit = false, lineHeight, letterSpacing = "base", reverseTheme = false, hideFromScreenReader = false, accessibilityRole = "text", strikeThrough = false, underline, UNSAFE_style, selectable = true, }) {
18
18
  const styles = useTypographyStyles();
19
19
  const sizeAndHeight = getSizeAndHeightStyle(size, styles, lineHeight);
20
20
  const style = [
@@ -102,6 +102,6 @@ function getSizeAndHeightStyle(textSize, styles, lineHeightOverwrite) {
102
102
  }
103
103
  return fontSize;
104
104
  }
105
- function getLetterSpacingStyle(letterSpacing = "base", styles) {
105
+ function getLetterSpacingStyle(letterSpacing, styles) {
106
106
  return styles[`${letterSpacing}LetterSpacing`];
107
107
  }
@@ -62,9 +62,9 @@ const fonts = Platform.select({
62
62
  default: deviceFonts,
63
63
  });
64
64
  /**
65
- * Reusable typography tokens to ensure consistency for any client facing texts.
65
+ * Reusable typography styles to ensure consistency for any client facing texts.
66
66
  */
67
- export const createTypographyTokens = (tokens) => (Object.assign(Object.assign({}, fonts), { italic: {
67
+ export const getTypographyStyles = (tokens) => (Object.assign(Object.assign({}, fonts), { italic: {
68
68
  fontStyle: "italic",
69
69
  }, underline: {
70
70
  textDecorationColor: tokens["color-text--secondary"],
@@ -356,5 +356,5 @@ export const createTypographyTokens = (tokens) => (Object.assign(Object.assign({
356
356
  /**
357
357
  * @deprecated Use useTypographyStyles instead
358
358
  */
359
- export const typographyStyles = StyleSheet.create(createTypographyTokens(staticTokens));
360
- export const useTypographyStyles = buildThemedStyles(createTypographyTokens);
359
+ export const typographyStyles = StyleSheet.create(getTypographyStyles(staticTokens));
360
+ export const useTypographyStyles = buildThemedStyles(getTypographyStyles);
@@ -1,4 +1,4 @@
1
1
  export { Typography } from "./Typography";
2
- export { useTypographyStyles } from "./Typography.style";
2
+ export { getTypographyStyles, useTypographyStyles } from "./Typography.style";
3
3
  export { typographyStyles } from "./Typography.style";
4
4
  export { TypographyGestureDetector } from "./TypographyGestureDetector";