@jobber/components-native 0.76.1-JOB-116234-c33b316.30 → 0.76.1-JOB-116234-50e11a8.34

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 (33) 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 +38 -40
  8. package/dist/src/Menu/components/Overlay/Overlay.style.js +2 -11
  9. package/dist/src/Select/Select.style.js +11 -8
  10. package/dist/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.js +1 -2
  11. package/dist/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.js +1 -2
  12. package/dist/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.style.js +28 -32
  13. package/dist/src/Typography/Typography.js +2 -2
  14. package/dist/tsconfig.tsbuildinfo +1 -1
  15. package/dist/types/src/Button/Button.style.d.ts +1 -0
  16. package/dist/types/src/InputFieldWrapper/CommonInputStyles.style.d.ts +1 -1
  17. package/dist/types/src/Menu/components/Overlay/Overlay.style.d.ts +5 -5
  18. package/dist/types/src/Select/Select.style.d.ts +1 -8
  19. package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.style.d.ts +1 -1
  20. package/package.json +2 -2
  21. package/src/BottomSheet/BottomSheet.style.ts +2 -2
  22. package/src/Button/Button.style.ts +1 -1
  23. package/src/Checkbox/Checkbox.style.ts +2 -4
  24. package/src/Chip/Chip.style.ts +2 -3
  25. package/src/ContentOverlay/ContentOverlay.style.ts +3 -4
  26. package/src/InputFieldWrapper/CommonInputStyles.style.ts +39 -43
  27. package/src/InputFieldWrapper/InputFieldWrapper.style.ts +1 -0
  28. package/src/Menu/components/Overlay/Overlay.style.ts +2 -6
  29. package/src/Select/Select.style.ts +11 -8
  30. package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.tsx +1 -2
  31. package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.style.ts +28 -32
  32. package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.tsx +1 -2
  33. package/src/Typography/Typography.tsx +7 -7
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.76.1-JOB-116234-c33b316.30+c33b3167",
3
+ "version": "0.76.1-JOB-116234-50e11a8.34+50e11a8a",
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": "c33b3167c0b220f060d1fe7ad6f48db97af8ea15"
83
+ "gitHead": "50e11a8ac73483bb0be9fd7b4e9fa72ad637a45a"
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,50 +1,48 @@
1
1
  import { StyleSheet } from "react-native";
2
2
  import { buildThemedStyles, } from "../AtlantisThemeContext";
3
- import { getTypographyStyles,
4
- // eslint-disable-next-line import/no-deprecated
5
- typographyStyles as staticTypographyStyles, } 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));
43
+ export const commonInputStyles = StyleSheet.create(createCommonInputTokens(staticTokens));
45
44
  export const getCommonInputStyles = (tokens) => {
46
- const typographyStyles = getTypographyStyles(tokens);
47
- return createCommonInputTokens(tokens, typographyStyles);
45
+ return createCommonInputTokens(tokens);
48
46
  };
49
47
  export const useCommonInputStyles = buildThemedStyles(tokens => {
50
48
  return getCommonInputStyles(tokens);
@@ -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
  });
@@ -14,14 +14,17 @@ export const useStyles = buildThemedStyles(tokens => {
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,
@@ -4,14 +4,13 @@ import {
4
4
  Button, Modal, TouchableOpacity, View, } from "react-native";
5
5
  import { Picker } from "@react-native-picker/picker";
6
6
  import { SafeAreaView } from "react-native-safe-area-context";
7
- import { useStyles } from "./SelectDefaultPicker.style";
7
+ import { styles } from "./SelectDefaultPicker.style";
8
8
  import { SelectPressable } from "../SelectPressable/SelectPressable";
9
9
  import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
10
10
  export function SelectDefaultPicker({ children, options, onChange, }) {
11
11
  const [show, setShow] = useState(false);
12
12
  const { t } = useAtlantisI18n();
13
13
  const selectedLanguage = options.find(option => option.isActive);
14
- const styles = useStyles();
15
14
  return (React.createElement(React.Fragment, null,
16
15
  React.createElement(SelectPressable, { onPress: showPicker }, children),
17
16
  React.createElement(Modal, { visible: show, transparent: true, animationType: "slide", onRequestClose: hidePicker },
@@ -1,13 +1,12 @@
1
1
  import React, { useRef } from "react";
2
2
  import { Picker } from "@react-native-picker/picker";
3
- import { useStyles } from "./SelectDefaultPicker.style";
3
+ import { styles } from "./SelectDefaultPicker.style";
4
4
  import { SelectPressable } from "../SelectPressable";
5
5
  import { useAtlantisTheme } from "../../../AtlantisThemeContext";
6
6
  export function SelectDefaultPicker({ children, options, disabled, onChange, }) {
7
7
  var _a;
8
8
  const selectedItem = options.find(option => option.isActive);
9
9
  const pickerRef = useRef(null);
10
- const styles = useStyles();
11
10
  const { tokens } = useAtlantisTheme();
12
11
  return (React.createElement(SelectPressable, { onPress: (_a = pickerRef.current) === null || _a === void 0 ? void 0 : _a.focus },
13
12
  children,
@@ -1,33 +1,29 @@
1
- import { buildThemedStyles } from "../../../AtlantisThemeContext";
2
- export const useStyles = buildThemedStyles(tokens => {
3
- return {
4
- overlay: {
5
- flex: 1,
6
- },
7
- actionBar: {
8
- flexDirection: "row",
9
- height: 45,
10
- justifyContent: "flex-end",
11
- alignItems: "center",
12
- paddingHorizontal: tokens["space-small"],
13
- backgroundColor: tokens["color-surface--background"],
14
- borderTopWidth: tokens["border-base"],
15
- borderTopColor: tokens["color-border"],
16
- zIndex: 2,
17
- },
18
- pickerContainer: {
19
- justifyContent: "center",
20
- backgroundColor: tokens["color-surface--background"],
21
- },
22
- androidPickerContainer: {
23
- position: "absolute",
24
- top: 0,
25
- left: 0,
26
- width: "100%",
27
- height: "100%",
28
- color: "transparent",
29
- backgroundColor: "transparent",
30
- opacity: 0,
31
- },
32
- };
1
+ import { StyleSheet } from "react-native";
2
+ export const styles = StyleSheet.create({
3
+ overlay: { flex: 1 },
4
+ actionBar: {
5
+ flexDirection: "row",
6
+ height: 45,
7
+ justifyContent: "flex-end",
8
+ alignItems: "center",
9
+ paddingHorizontal: 10,
10
+ backgroundColor: "#f8f8f8",
11
+ borderTopWidth: 1,
12
+ borderTopColor: "#dedede",
13
+ zIndex: 2,
14
+ },
15
+ pickerContainer: {
16
+ justifyContent: "center",
17
+ backgroundColor: "#d0d4da",
18
+ },
19
+ androidPickerContainer: {
20
+ position: "absolute",
21
+ top: 0,
22
+ left: 0,
23
+ width: "100%",
24
+ height: "100%",
25
+ color: "transparent",
26
+ backgroundColor: "transparent",
27
+ opacity: 0,
28
+ },
33
29
  });
@@ -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
  }