@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
@@ -24,6 +24,7 @@ export declare const useStyles: () => {
24
24
  };
25
25
  base: {
26
26
  minHeight: number;
27
+ paddingHorizontal: number;
27
28
  };
28
29
  small: {
29
30
  minHeight: number;
@@ -1,7 +1,7 @@
1
1
  import { TextStyle, ViewStyle } from "react-native";
2
2
  import { AtlantisThemeContextValue } from "../AtlantisThemeContext";
3
3
  import { tokens as staticTokens } from "../utils/design";
4
- export declare const createCommonInputTokens: (tokens: AtlantisThemeContextValue["tokens"] | typeof staticTokens, typographyStyles: Record<string, TextStyle>) => Record<string, ViewStyle | TextStyle>;
4
+ export declare const createCommonInputTokens: (tokens: AtlantisThemeContextValue["tokens"] | typeof staticTokens) => Record<string, ViewStyle | TextStyle>;
5
5
  /**
6
6
  * @deprecated Use useCommonInputStyles instead
7
7
  */
@@ -1,12 +1,12 @@
1
1
  export declare const useStyles: () => {
2
2
  overlay: {
3
- position: "absolute";
4
- top: number;
5
- left: number;
6
- right: number;
7
- bottom: number;
8
3
  backgroundColor: string;
9
4
  opacity: number;
10
5
  height: number;
6
+ position: "absolute";
7
+ left: 0;
8
+ right: 0;
9
+ top: 0;
10
+ bottom: 0;
11
11
  };
12
12
  };
@@ -1,13 +1,6 @@
1
1
  export declare const useStyles: () => {
2
2
  container: import("react-native").ViewStyle;
3
- input: {
4
- flexDirection: "row";
5
- flexGrow: number;
6
- paddingTop: number;
7
- minHeight: number;
8
- minWidth: "100%";
9
- paddingRight: number;
10
- };
3
+ input: import("react-native").ViewStyle;
11
4
  value: {
12
5
  flexGrow: number;
13
6
  flexShrink: number;
@@ -1,4 +1,4 @@
1
- export declare const useStyles: () => {
1
+ export declare const styles: {
2
2
  overlay: {
3
3
  flex: number;
4
4
  };
package/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,11 +1,11 @@
1
1
  import { Dimensions, StyleSheet } from "react-native";
2
- import { tokens as staticTokens } from "../utils/design";
3
2
  import { buildThemedStyles } from "../AtlantisThemeContext";
4
3
 
5
4
  const { height } = Dimensions.get("window");
6
- const modalBorderRadius = staticTokens["radius-larger"];
7
5
 
8
6
  export const useStyles = buildThemedStyles(tokens => {
7
+ const modalBorderRadius = tokens["radius-larger"];
8
+
9
9
  return {
10
10
  overlayModalize: {
11
11
  backgroundColor: "transparent",
@@ -35,7 +35,7 @@ export const useStyles = buildThemedStyles(tokens => {
35
35
 
36
36
  base: {
37
37
  minHeight: baseButtonHeight,
38
- // paddingHorizontal: tokens["space-base"],
38
+ paddingHorizontal: tokens["space-base"],
39
39
  },
40
40
 
41
41
  small: {
@@ -1,10 +1,8 @@
1
- import { tokens as staticTokens } from "../utils/design";
2
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
3
2
 
4
- const checkboxDimensions =
5
- staticTokens["space-large"] + staticTokens["space-smaller"];
6
-
7
3
  export const useStyles = buildThemedStyles(tokens => {
4
+ const checkboxDimensions = tokens["space-large"] + tokens["space-smaller"];
5
+
8
6
  return {
9
7
  container: {
10
8
  width: "100%",
@@ -1,9 +1,8 @@
1
- import { tokens as staticTokens } from "../utils/design";
2
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
3
2
 
4
- const chipHeight = staticTokens["space-larger"] + staticTokens["space-small"];
5
-
6
3
  export const useStyles = buildThemedStyles(tokens => {
4
+ const chipHeight = tokens["space-larger"] + tokens["space-small"];
5
+
7
6
  return {
8
7
  container: {
9
8
  alignItems: "center",
@@ -1,10 +1,9 @@
1
- import { tokens as staticTokens } from "../utils/design";
2
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
3
2
 
4
- const modalBorderRadius = staticTokens["radius-larger"];
5
- const titleOffsetFromHandle = staticTokens["space-base"];
6
-
7
3
  export const useStyles = buildThemedStyles(tokens => {
4
+ const modalBorderRadius = tokens["radius-larger"];
5
+ const titleOffsetFromHandle = tokens["space-base"];
6
+
8
7
  return {
9
8
  handle: {
10
9
  width: tokens["space-largest"],
@@ -3,66 +3,62 @@ import {
3
3
  AtlantisThemeContextValue,
4
4
  buildThemedStyles,
5
5
  } from "../AtlantisThemeContext";
6
- import {
7
- getTypographyStyles,
8
- // eslint-disable-next-line import/no-deprecated
9
- typographyStyles as staticTypographyStyles,
10
- } from "../Typography";
6
+ import { getTypographyStyles } from "../Typography";
11
7
  import { tokens as staticTokens } from "../utils/design";
12
8
 
13
9
  export const createCommonInputTokens = (
14
10
  tokens: AtlantisThemeContextValue["tokens"] | typeof staticTokens,
15
- typographyStyles: Record<string, TextStyle>,
16
- ): Record<string, ViewStyle | TextStyle> => ({
17
- input: {
18
- width: "100%" as const,
19
- flexShrink: 1,
20
- flexGrow: 1,
21
- color: tokens["color-text"],
22
- fontFamily: typographyStyles.baseRegularRegular.fontFamily,
23
- fontSize: typographyStyles.defaultSize.fontSize,
24
- letterSpacing: typographyStyles.baseLetterSpacing.letterSpacing,
25
- minHeight: tokens["space-largest"] + tokens["space-small"],
26
- padding: 0,
27
- },
11
+ ): Record<string, ViewStyle | TextStyle> => {
12
+ const typographyStyles = getTypographyStyles(tokens);
28
13
 
29
- inputEmpty: {
30
- paddingTop: 0,
31
- },
14
+ return {
15
+ input: {
16
+ width: "100%",
17
+ flexShrink: 1,
18
+ flexGrow: 1,
19
+ color: tokens["color-text"],
20
+ fontFamily: typographyStyles.baseRegularRegular.fontFamily,
21
+ fontSize: typographyStyles.defaultSize.fontSize,
22
+ letterSpacing: typographyStyles.baseLetterSpacing.letterSpacing,
23
+ minHeight: tokens["space-largest"] + tokens["space-small"],
24
+ padding: 0,
25
+ },
32
26
 
33
- inputDisabled: {
34
- color: typographyStyles.disabled.color,
35
- },
27
+ inputEmpty: {
28
+ paddingTop: 0,
29
+ },
36
30
 
37
- container: {
38
- paddingLeft: tokens["space-base"],
39
- marginVertical: tokens["space-smaller"],
40
- backgroundColor: tokens["color-surface"],
41
- minHeight: tokens["space-largest"] + tokens["space-small"],
42
- flexDirection: "row",
43
- justifyContent: "space-between",
44
- width: "100%",
45
- borderColor: tokens["color-border"],
46
- borderStyle: "solid",
47
- borderWidth: tokens["border-base"],
48
- borderRadius: tokens["radius-base"],
49
- },
50
- });
31
+ inputDisabled: {
32
+ color: typographyStyles.disabled.color,
33
+ },
34
+
35
+ container: {
36
+ paddingLeft: tokens["space-base"],
37
+ marginVertical: tokens["space-smaller"],
38
+ backgroundColor: tokens["color-surface"],
39
+ minHeight: tokens["space-largest"] + tokens["space-small"],
40
+ flexDirection: "row",
41
+ justifyContent: "space-between",
42
+ width: "100%",
43
+ borderColor: tokens["color-border"],
44
+ borderStyle: "solid",
45
+ borderWidth: tokens["border-base"],
46
+ borderRadius: tokens["radius-base"],
47
+ },
48
+ };
49
+ };
51
50
 
52
51
  /**
53
52
  * @deprecated Use useCommonInputStyles instead
54
53
  */
55
54
  export const commonInputStyles = StyleSheet.create(
56
- // eslint-disable-next-line import/no-deprecated
57
- createCommonInputTokens(staticTokens, staticTypographyStyles),
55
+ createCommonInputTokens(staticTokens),
58
56
  );
59
57
 
60
58
  export const getCommonInputStyles = (
61
59
  tokens: AtlantisThemeContextValue["tokens"],
62
60
  ) => {
63
- const typographyStyles = getTypographyStyles(tokens);
64
-
65
- return createCommonInputTokens(tokens, typographyStyles);
61
+ return createCommonInputTokens(tokens);
66
62
  };
67
63
 
68
64
  export const useCommonInputStyles = buildThemedStyles(tokens => {
@@ -14,6 +14,7 @@ export const useStyles = buildThemedStyles(tokens => {
14
14
  flexDirection: "column",
15
15
  },
16
16
  ]),
17
+
17
18
  field: {
18
19
  flexDirection: "row",
19
20
  alignItems: "center",
@@ -1,4 +1,4 @@
1
- import { Dimensions } from "react-native";
1
+ import { Dimensions, StyleSheet } from "react-native";
2
2
  import { buildThemedStyles } from "../../../AtlantisThemeContext";
3
3
 
4
4
  const { height } = Dimensions.get("window");
@@ -6,11 +6,7 @@ const { height } = Dimensions.get("window");
6
6
  export const useStyles = buildThemedStyles(tokens => {
7
7
  return {
8
8
  overlay: {
9
- position: "absolute",
10
- top: 0,
11
- left: 0,
12
- right: 0,
13
- bottom: 0,
9
+ ...StyleSheet.absoluteFillObject,
14
10
  backgroundColor: tokens["color-overlay"],
15
11
  opacity: 0,
16
12
  height,
@@ -17,14 +17,17 @@ export const useStyles = buildThemedStyles(tokens => {
17
17
  },
18
18
  ]),
19
19
 
20
- input: {
21
- flexDirection: "row",
22
- flexGrow: 0,
23
- paddingTop: tokens["space-smaller"],
24
- minHeight: 0,
25
- minWidth: "100%",
26
- paddingRight: tokens["space-small"],
27
- },
20
+ input: StyleSheet.flatten([
21
+ commonInputStyles.input,
22
+ {
23
+ flexDirection: "row",
24
+ flexGrow: 0,
25
+ paddingTop: tokens["space-smaller"],
26
+ minHeight: 0,
27
+ minWidth: "100%",
28
+ paddingRight: tokens["space-small"],
29
+ },
30
+ ]),
28
31
 
29
32
  value: {
30
33
  flexGrow: 1,
@@ -8,7 +8,7 @@ import {
8
8
  } from "react-native";
9
9
  import { Picker } from "@react-native-picker/picker";
10
10
  import { SafeAreaView } from "react-native-safe-area-context";
11
- import { useStyles } from "./SelectDefaultPicker.style";
11
+ import { styles } from "./SelectDefaultPicker.style";
12
12
  import { SelectInternalPickerProps } from "../../types";
13
13
  import { SelectPressable } from "../SelectPressable/SelectPressable";
14
14
  import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
@@ -23,7 +23,6 @@ export function SelectDefaultPicker({
23
23
  const [show, setShow] = useState(false);
24
24
  const { t } = useAtlantisI18n();
25
25
  const selectedLanguage = options.find(option => option.isActive);
26
- const styles = useStyles();
27
26
 
28
27
  return (
29
28
  <>
@@ -1,34 +1,30 @@
1
- import { buildThemedStyles } from "../../../AtlantisThemeContext";
1
+ import { StyleSheet } from "react-native";
2
2
 
3
- export const useStyles = buildThemedStyles(tokens => {
4
- return {
5
- overlay: {
6
- flex: 1,
7
- },
8
- actionBar: {
9
- flexDirection: "row",
10
- height: 45,
11
- justifyContent: "flex-end",
12
- alignItems: "center",
13
- paddingHorizontal: tokens["space-small"],
14
- backgroundColor: tokens["color-surface--background"],
15
- borderTopWidth: tokens["border-base"],
16
- borderTopColor: tokens["color-border"],
17
- zIndex: 2,
18
- },
19
- pickerContainer: {
20
- justifyContent: "center",
21
- backgroundColor: tokens["color-surface--background"],
22
- },
23
- androidPickerContainer: {
24
- position: "absolute",
25
- top: 0,
26
- left: 0,
27
- width: "100%",
28
- height: "100%",
29
- color: "transparent",
30
- backgroundColor: "transparent",
31
- opacity: 0,
32
- },
33
- };
3
+ export const styles = StyleSheet.create({
4
+ overlay: { flex: 1 },
5
+ actionBar: {
6
+ flexDirection: "row",
7
+ height: 45,
8
+ justifyContent: "flex-end",
9
+ alignItems: "center",
10
+ paddingHorizontal: 10,
11
+ backgroundColor: "#f8f8f8",
12
+ borderTopWidth: 1,
13
+ borderTopColor: "#dedede",
14
+ zIndex: 2,
15
+ },
16
+ pickerContainer: {
17
+ justifyContent: "center",
18
+ backgroundColor: "#d0d4da",
19
+ },
20
+ androidPickerContainer: {
21
+ position: "absolute",
22
+ top: 0,
23
+ left: 0,
24
+ width: "100%",
25
+ height: "100%",
26
+ color: "transparent",
27
+ backgroundColor: "transparent",
28
+ opacity: 0,
29
+ },
34
30
  });
@@ -1,6 +1,6 @@
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 { SelectInternalPickerProps } from "../../types";
5
5
  import { SelectPressable } from "../SelectPressable";
6
6
  import { useAtlantisTheme } from "../../../AtlantisThemeContext";
@@ -15,7 +15,6 @@ export function SelectDefaultPicker({
15
15
  }: SelectDefaultPickerProps): JSX.Element {
16
16
  const selectedItem = options.find(option => option.isActive);
17
17
  const pickerRef = useRef<Picker<string>>(null);
18
- const styles = useStyles();
19
18
  const { tokens } = useAtlantisTheme();
20
19
 
21
20
  return (
@@ -152,7 +152,7 @@ function InternalTypography<T extends FontFamily = "base">({
152
152
  maxFontScaleSize,
153
153
  adjustsFontSizeToFit = false,
154
154
  lineHeight,
155
- letterSpacing,
155
+ letterSpacing = "base",
156
156
  reverseTheme = false,
157
157
  hideFromScreenReader = false,
158
158
  accessibilityRole = "text",
@@ -234,7 +234,7 @@ function getFontStyle(
234
234
  fontFamily: FontFamily = "base",
235
235
  fontStyle: FontStyle = "regular",
236
236
  fontWeight: FontWeight = "regular",
237
- styles: Record<string, TextStyle>,
237
+ styles: ReturnType<typeof useTypographyStyles>,
238
238
  ) {
239
239
  const defaultBaseFontStyling = styles.baseRegularRegular;
240
240
  const defaultDisplayFontStyling = styles.displayRegularBold;
@@ -266,7 +266,7 @@ function getTransformedText(text?: string, transform?: TextTransform) {
266
266
  }
267
267
 
268
268
  function getColorStyle(
269
- styles: Record<string, TextStyle>,
269
+ styles: ReturnType<typeof useTypographyStyles>,
270
270
  color?: TextColor,
271
271
  reverseTheme?: boolean,
272
272
  ) {
@@ -279,7 +279,7 @@ function getColorStyle(
279
279
  }
280
280
 
281
281
  function getAlignStyle(
282
- styles: Record<string, TextStyle>,
282
+ styles: ReturnType<typeof useTypographyStyles>,
283
283
  alignStyle: TextAlign = I18nManager.isRTL ? "end" : "start",
284
284
  ) {
285
285
  return styles[`${alignStyle}Align`];
@@ -287,7 +287,7 @@ function getAlignStyle(
287
287
 
288
288
  function getSizeAndHeightStyle(
289
289
  textSize: TextSize,
290
- styles: Record<string, TextStyle>,
290
+ styles: ReturnType<typeof useTypographyStyles>,
291
291
  lineHeightOverwrite?: LineHeight,
292
292
  ) {
293
293
  const fontSize = styles[`${textSize}Size`];
@@ -302,8 +302,8 @@ function getSizeAndHeightStyle(
302
302
  }
303
303
 
304
304
  function getLetterSpacingStyle(
305
- letterSpacing: LetterSpacing = "base",
306
- styles: Record<string, TextStyle>,
305
+ letterSpacing: LetterSpacing,
306
+ styles: ReturnType<typeof useTypographyStyles>,
307
307
  ) {
308
308
  return styles[`${letterSpacing}LetterSpacing`];
309
309
  }