@jobber/components-native 0.76.1-JOB-116234-4bc5afd.23 → 0.76.1-JOB-116234-63c4467.27
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/Flex/Flex.js +2 -3
- package/dist/src/Flex/Flex.styles.js +9 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/Flex/Flex.styles.d.ts +1 -0
- package/package.json +2 -2
- package/src/Flex/Flex.styles.tsx +13 -1
- package/src/Flex/Flex.tsx +2 -3
- package/dist/src/Flex/Flex.gap.styles.js +0 -9
- package/dist/types/src/Flex/Flex.gap.styles.d.ts +0 -2
- package/src/Flex/Flex.gap.styles.tsx +0 -14
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-63c4467.27+63c44675",
|
|
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": "63c446753585b99a48ea4782613671ca6ff3c8b1"
|
|
84
84
|
}
|
package/src/Flex/Flex.styles.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StyleSheet, ViewStyle } from "react-native";
|
|
2
|
-
import { ColumnKeys } from "./types";
|
|
2
|
+
import { ColumnKeys, Spacing, spacing } from "./types";
|
|
3
|
+
import { tokens as staticTokens } from "../utils/design";
|
|
3
4
|
|
|
4
5
|
export const styles = StyleSheet.create({
|
|
5
6
|
row: { flexDirection: "row" },
|
|
@@ -16,3 +17,14 @@ export const columnStyles: Record<ColumnKeys, ViewStyle> = StyleSheet.create({
|
|
|
16
17
|
flexBasis: 0,
|
|
17
18
|
},
|
|
18
19
|
});
|
|
20
|
+
|
|
21
|
+
export const gapStyles = StyleSheet.create(
|
|
22
|
+
spacing.reduce((gapObj, space) => {
|
|
23
|
+
let paddingLeft = 0;
|
|
24
|
+
if (space !== "none") paddingLeft = staticTokens[`space-${space}`];
|
|
25
|
+
|
|
26
|
+
gapObj[space] = { paddingLeft };
|
|
27
|
+
|
|
28
|
+
return gapObj;
|
|
29
|
+
}, {} as Record<Spacing, ViewStyle>),
|
|
30
|
+
);
|
package/src/Flex/Flex.tsx
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { Children, PropsWithChildren } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import chunk from "lodash/chunk";
|
|
4
|
-
import { columnStyles, styles } from "./Flex.styles";
|
|
5
|
-
import { useGapStyles } from "./Flex.gap.styles";
|
|
4
|
+
import { columnStyles, gapStyles, styles } from "./Flex.styles";
|
|
6
5
|
import { FlexProps } from "./types";
|
|
7
6
|
import { Content } from "../Content";
|
|
8
7
|
|
|
@@ -61,7 +60,7 @@ function Row({
|
|
|
61
60
|
<View
|
|
62
61
|
style={[
|
|
63
62
|
columnStyles[template[index]] || columnStyles.grow,
|
|
64
|
-
index > 0 && gap &&
|
|
63
|
+
index > 0 && gap && gapStyles[gap],
|
|
65
64
|
]}
|
|
66
65
|
>
|
|
67
66
|
{child}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { spacing } from "./types";
|
|
2
|
-
import { buildThemedStyles } from "../AtlantisThemeContext";
|
|
3
|
-
export const useGapStyles = buildThemedStyles(tokens => spacing.reduce((gapObj, space) => {
|
|
4
|
-
let paddingLeft = 0;
|
|
5
|
-
if (space !== "none")
|
|
6
|
-
paddingLeft = tokens[`space-${space}`];
|
|
7
|
-
gapObj[space] = { paddingLeft };
|
|
8
|
-
return gapObj;
|
|
9
|
-
}, {}));
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ViewStyle } from "react-native";
|
|
2
|
-
import { Spacing, spacing } from "./types";
|
|
3
|
-
import { buildThemedStyles } from "../AtlantisThemeContext";
|
|
4
|
-
|
|
5
|
-
export const useGapStyles = buildThemedStyles(tokens =>
|
|
6
|
-
spacing.reduce((gapObj, space) => {
|
|
7
|
-
let paddingLeft = 0;
|
|
8
|
-
if (space !== "none") paddingLeft = tokens[`space-${space}`];
|
|
9
|
-
|
|
10
|
-
gapObj[space] = { paddingLeft };
|
|
11
|
-
|
|
12
|
-
return gapObj;
|
|
13
|
-
}, {} as Record<Spacing, ViewStyle>),
|
|
14
|
-
);
|