@jobber/components-native 0.76.1-JOB-116234-63c4467.27 → 0.76.1-JOB-116234-c33b316.30
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 +2 -2
- package/dist/src/InputFieldWrapper/CommonInputStyles.style.js +8 -6
- package/dist/src/InputFieldWrapper/InputFieldWrapper.style.js +8 -8
- package/dist/src/InputFieldWrapper/index.js +1 -1
- package/dist/src/InputPressable/InputPressable.style.js +6 -6
- package/dist/src/InputText/InputText.style.js +6 -6
- package/dist/src/Select/Select.style.js +6 -6
- package/dist/src/Typography/Typography.style.js +4 -4
- package/dist/src/Typography/index.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/InputFieldWrapper/CommonInputStyles.style.d.ts +1 -0
- package/dist/types/src/InputFieldWrapper/index.d.ts +1 -1
- package/dist/types/src/Typography/Typography.style.d.ts +2 -2
- package/dist/types/src/Typography/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/AtlantisThemeContext/buildThemedStyles.test.tsx +0 -26
- package/src/InputFieldWrapper/CommonInputStyles.style.ts +10 -7
- package/src/InputFieldWrapper/InputFieldWrapper.style.ts +8 -8
- package/src/InputFieldWrapper/components/Prefix/Prefix.test.tsx +0 -2
- package/src/InputFieldWrapper/index.ts +4 -1
- package/src/InputPressable/InputPressable.style.ts +6 -6
- package/src/InputText/InputText.style.ts +6 -6
- package/src/Select/Select.style.ts +6 -6
- package/src/Typography/Typography.style.ts +4 -4
- package/src/Typography/index.ts +1 -1
|
@@ -6,4 +6,5 @@ export declare const createCommonInputTokens: (tokens: AtlantisThemeContextValue
|
|
|
6
6
|
* @deprecated Use useCommonInputStyles instead
|
|
7
7
|
*/
|
|
8
8
|
export declare const commonInputStyles: Record<string, ViewStyle | TextStyle>;
|
|
9
|
+
export declare const getCommonInputStyles: (tokens: AtlantisThemeContextValue["tokens"]) => Record<string, ViewStyle | TextStyle>;
|
|
9
10
|
export declare const useCommonInputStyles: () => Record<string, ViewStyle | TextStyle>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { useCommonInputStyles } from "./CommonInputStyles.style";
|
|
1
|
+
export { getCommonInputStyles, useCommonInputStyles, } from "./CommonInputStyles.style";
|
|
2
2
|
export { InputFieldWrapper } from "./InputFieldWrapper";
|
|
3
3
|
export type { InputFieldWrapperProps } from "./InputFieldWrapper";
|
|
@@ -2,9 +2,9 @@ import { TextStyle } from "react-native";
|
|
|
2
2
|
import { tokens as staticTokens } from "../utils/design";
|
|
3
3
|
import { AtlantisThemeContextValue } from "../AtlantisThemeContext";
|
|
4
4
|
/**
|
|
5
|
-
* Reusable typography
|
|
5
|
+
* Reusable typography styles to ensure consistency for any client facing texts.
|
|
6
6
|
*/
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const getTypographyStyles: (tokens: AtlantisThemeContextValue["tokens"] | typeof staticTokens) => {
|
|
8
8
|
[index: string]: TextStyle;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Typography } from "./Typography";
|
|
2
2
|
export type { FontFamily, FontStyle, FontWeight, BaseWeight, DisplayWeight, BaseStyle, DisplayStyle, TextColor, TextTransform, TextSize, TextAlign, LineHeight, LetterSpacing, TextAccessibilityRole, TextVariation, TypographyProps, TruncateLength, } from "./Typography";
|
|
3
|
-
export { useTypographyStyles } from "./Typography.style";
|
|
3
|
+
export { getTypographyStyles, useTypographyStyles } from "./Typography.style";
|
|
4
4
|
export { typographyStyles } from "./Typography.style";
|
|
5
5
|
export { TypographyGestureDetector } from "./TypographyGestureDetector";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.76.1-JOB-116234-
|
|
3
|
+
"version": "0.76.1-JOB-116234-c33b316.30+c33b3167",
|
|
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": "
|
|
83
|
+
"gitHead": "c33b3167c0b220f060d1fe7ad6f48db97af8ea15"
|
|
84
84
|
}
|
|
@@ -47,32 +47,6 @@ describe("buildThemedStyles", () => {
|
|
|
47
47
|
expect(result.current).toBe(initialResult);
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
it("creates styles with dependent hooks", () => {
|
|
51
|
-
const useDependentStyles = () => ({
|
|
52
|
-
text: { color: "red" },
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const useTestStyles = () => {
|
|
56
|
-
const dependentStyles = useDependentStyles();
|
|
57
|
-
|
|
58
|
-
return buildThemedStyles(tokens => ({
|
|
59
|
-
container: {
|
|
60
|
-
...dependentStyles.text,
|
|
61
|
-
padding: tokens["space-base"],
|
|
62
|
-
},
|
|
63
|
-
}))();
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const { result } = renderHook(() => useTestStyles(), { wrapper });
|
|
67
|
-
|
|
68
|
-
expect(result.current).toEqual({
|
|
69
|
-
container: {
|
|
70
|
-
color: "red",
|
|
71
|
-
padding: expect.any(Number),
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
50
|
it("handles empty style objects", () => {
|
|
77
51
|
const useTestStyles = buildThemedStyles(() => ({}));
|
|
78
52
|
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
buildThemedStyles,
|
|
5
5
|
} from "../AtlantisThemeContext";
|
|
6
6
|
import {
|
|
7
|
+
getTypographyStyles,
|
|
7
8
|
// eslint-disable-next-line import/no-deprecated
|
|
8
9
|
typographyStyles as staticTypographyStyles,
|
|
9
|
-
useTypographyStyles,
|
|
10
10
|
} from "../Typography";
|
|
11
11
|
import { tokens as staticTokens } from "../utils/design";
|
|
12
12
|
|
|
@@ -57,11 +57,14 @@ export const commonInputStyles = StyleSheet.create(
|
|
|
57
57
|
createCommonInputTokens(staticTokens, staticTypographyStyles),
|
|
58
58
|
);
|
|
59
59
|
|
|
60
|
-
export const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
)();
|
|
60
|
+
export const getCommonInputStyles = (
|
|
61
|
+
tokens: AtlantisThemeContextValue["tokens"],
|
|
62
|
+
) => {
|
|
63
|
+
const typographyStyles = getTypographyStyles(tokens);
|
|
65
64
|
|
|
66
|
-
return
|
|
65
|
+
return createCommonInputTokens(tokens, typographyStyles);
|
|
67
66
|
};
|
|
67
|
+
|
|
68
|
+
export const useCommonInputStyles = buildThemedStyles(tokens => {
|
|
69
|
+
return getCommonInputStyles(tokens);
|
|
70
|
+
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
|
-
import {
|
|
2
|
+
import { getCommonInputStyles } from "./CommonInputStyles.style";
|
|
3
3
|
import { buildThemedStyles } from "../AtlantisThemeContext";
|
|
4
|
-
import {
|
|
4
|
+
import { getTypographyStyles } from "../Typography";
|
|
5
5
|
|
|
6
|
-
export const useStyles = (
|
|
7
|
-
const commonInputStyles =
|
|
8
|
-
const typographyStyles =
|
|
6
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
7
|
+
const commonInputStyles = getCommonInputStyles(tokens);
|
|
8
|
+
const typographyStyles = getTypographyStyles(tokens);
|
|
9
9
|
|
|
10
|
-
return
|
|
10
|
+
return {
|
|
11
11
|
container: StyleSheet.flatten([
|
|
12
12
|
commonInputStyles.container,
|
|
13
13
|
{
|
|
@@ -141,5 +141,5 @@ export const useStyles = () => {
|
|
|
141
141
|
paddingTop: tokens["space-base"] - tokens["space-smaller"],
|
|
142
142
|
bottom: tokens["space-smaller"],
|
|
143
143
|
},
|
|
144
|
-
}
|
|
145
|
-
};
|
|
144
|
+
};
|
|
145
|
+
});
|
|
@@ -167,8 +167,6 @@ describe("Prefix", () => {
|
|
|
167
167
|
disabled: true,
|
|
168
168
|
});
|
|
169
169
|
const prefixLabel = tree.getByText(mockLabel);
|
|
170
|
-
// console.log(tree.debug());
|
|
171
|
-
console.log(prefixLabel.props.style);
|
|
172
170
|
const expectedStyle = [
|
|
173
171
|
typographyStyles.baseRegularRegular,
|
|
174
172
|
typographyStyles.disabled,
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
getCommonInputStyles,
|
|
3
|
+
useCommonInputStyles,
|
|
4
|
+
} from "./CommonInputStyles.style";
|
|
2
5
|
export { InputFieldWrapper } from "./InputFieldWrapper";
|
|
3
6
|
export type { InputFieldWrapperProps } from "./InputFieldWrapper";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { buildThemedStyles } from "../AtlantisThemeContext";
|
|
2
|
-
import {
|
|
2
|
+
import { getTypographyStyles } from "../Typography";
|
|
3
3
|
|
|
4
|
-
export const useStyles = (
|
|
5
|
-
const typographyStyles =
|
|
4
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
5
|
+
const typographyStyles = getTypographyStyles(tokens);
|
|
6
6
|
|
|
7
|
-
return
|
|
7
|
+
return {
|
|
8
8
|
pressable: {
|
|
9
9
|
flex: 1,
|
|
10
10
|
},
|
|
@@ -28,5 +28,5 @@ export const useStyles = () => {
|
|
|
28
28
|
inputInvalid: {
|
|
29
29
|
borderColor: tokens["color-critical"],
|
|
30
30
|
},
|
|
31
|
-
}
|
|
32
|
-
};
|
|
31
|
+
};
|
|
32
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { buildThemedStyles } from "../AtlantisThemeContext";
|
|
2
|
-
import {
|
|
2
|
+
import { getTypographyStyles } from "../Typography";
|
|
3
3
|
|
|
4
|
-
export const useStyles = (
|
|
5
|
-
const typographyStyles =
|
|
4
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
5
|
+
const typographyStyles = getTypographyStyles(tokens);
|
|
6
6
|
|
|
7
|
-
return
|
|
7
|
+
return {
|
|
8
8
|
inputPaddingTop: {
|
|
9
9
|
paddingTop:
|
|
10
10
|
(typographyStyles.smallSize.fontSize || 0) +
|
|
@@ -27,5 +27,5 @@ export const useStyles = () => {
|
|
|
27
27
|
paddingTop:
|
|
28
28
|
(typographyStyles.defaultSize.fontSize || 0) + tokens["space-smallest"],
|
|
29
29
|
},
|
|
30
|
-
}
|
|
31
|
-
};
|
|
30
|
+
};
|
|
31
|
+
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
|
-
import {
|
|
2
|
+
import { getCommonInputStyles } from "../InputFieldWrapper";
|
|
3
3
|
import { buildThemedStyles } from "../AtlantisThemeContext";
|
|
4
4
|
|
|
5
|
-
export const useStyles = (
|
|
6
|
-
const commonInputStyles =
|
|
5
|
+
export const useStyles = buildThemedStyles(tokens => {
|
|
6
|
+
const commonInputStyles = getCommonInputStyles(tokens);
|
|
7
7
|
|
|
8
|
-
return
|
|
8
|
+
return {
|
|
9
9
|
container: StyleSheet.flatten([
|
|
10
10
|
commonInputStyles.container,
|
|
11
11
|
{
|
|
@@ -54,5 +54,5 @@ export const useStyles = () => {
|
|
|
54
54
|
paddingTop: tokens["space-smaller"],
|
|
55
55
|
flexDirection: "row",
|
|
56
56
|
},
|
|
57
|
-
}
|
|
58
|
-
};
|
|
57
|
+
};
|
|
58
|
+
});
|
|
@@ -82,9 +82,9 @@ const fonts = Platform.select({
|
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
* Reusable typography
|
|
85
|
+
* Reusable typography styles to ensure consistency for any client facing texts.
|
|
86
86
|
*/
|
|
87
|
-
export const
|
|
87
|
+
export const getTypographyStyles = (
|
|
88
88
|
tokens: AtlantisThemeContextValue["tokens"] | typeof staticTokens,
|
|
89
89
|
): { [index: string]: TextStyle } => ({
|
|
90
90
|
// This follows a pattern of
|
|
@@ -623,7 +623,7 @@ export const createTypographyTokens = (
|
|
|
623
623
|
* @deprecated Use useTypographyStyles instead
|
|
624
624
|
*/
|
|
625
625
|
export const typographyStyles: Record<string, TextStyle> = StyleSheet.create(
|
|
626
|
-
|
|
626
|
+
getTypographyStyles(staticTokens),
|
|
627
627
|
);
|
|
628
628
|
|
|
629
|
-
export const useTypographyStyles = buildThemedStyles(
|
|
629
|
+
export const useTypographyStyles = buildThemedStyles(getTypographyStyles);
|
package/src/Typography/index.ts
CHANGED
|
@@ -18,6 +18,6 @@ export type {
|
|
|
18
18
|
TypographyProps,
|
|
19
19
|
TruncateLength,
|
|
20
20
|
} from "./Typography";
|
|
21
|
-
export { useTypographyStyles } from "./Typography.style";
|
|
21
|
+
export { getTypographyStyles, useTypographyStyles } from "./Typography.style";
|
|
22
22
|
export { typographyStyles } from "./Typography.style";
|
|
23
23
|
export { TypographyGestureDetector } from "./TypographyGestureDetector";
|