@jobber/components-native 0.74.1-node22-3bf0edd.11 → 0.75.0
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/Divider/Divider.js +9 -6
- package/dist/src/Divider/{Divider.style.js → DividerHorizontal.style.js} +9 -4
- package/dist/src/Divider/DividerVertical.style.js +26 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/Divider/Divider.d.ts +12 -3
- package/dist/types/src/Divider/{Divider.style.d.ts → DividerHorizontal.style.d.ts} +7 -2
- package/dist/types/src/Divider/DividerVertical.style.d.ts +24 -0
- package/package.json +2 -2
- package/src/Divider/Divider.test.tsx +58 -19
- package/src/Divider/Divider.tsx +25 -7
- package/src/Divider/{Divider.style.ts → DividerHorizontal.style.ts} +9 -4
- package/src/Divider/DividerVertical.style.ts +27 -0
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.75.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"react-native-safe-area-context": "^4.5.2",
|
|
80
80
|
"react-native-svg": ">=12.0.0"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "7347ac364b98158eacf3e455e02ad3475aae83a9"
|
|
83
83
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { horizontalStyles } from "./DividerHorizontal.style";
|
|
4
|
+
import { verticalStyles } from "./DividerVertical.style";
|
|
5
|
+
export function Divider({ size = "base", direction = "horizontal", testID = "Divider", }) {
|
|
6
|
+
const directionalStyles = direction === "horizontal" ? horizontalStyles : verticalStyles;
|
|
5
7
|
const style = [
|
|
6
|
-
|
|
7
|
-
size === "large" &&
|
|
8
|
-
size === "
|
|
8
|
+
directionalStyles.base,
|
|
9
|
+
size === "large" && directionalStyles.large,
|
|
10
|
+
size === "larger" && directionalStyles.larger,
|
|
11
|
+
size === "largest" && directionalStyles.largest,
|
|
9
12
|
];
|
|
10
|
-
return React.createElement(View, { testID:
|
|
13
|
+
return React.createElement(View, { testID: testID, style: style });
|
|
11
14
|
}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { StyleSheet } from "react-native";
|
|
2
2
|
import { tokens } from "../utils/design";
|
|
3
|
-
export const
|
|
3
|
+
export const horizontalStyles = StyleSheet.create({
|
|
4
4
|
base: {
|
|
5
|
-
height:
|
|
5
|
+
height: 1,
|
|
6
6
|
margin: 0,
|
|
7
|
-
|
|
7
|
+
width: "auto",
|
|
8
8
|
borderBottomColor: tokens["color-border"],
|
|
9
|
+
borderBottomWidth: tokens["border-base"],
|
|
9
10
|
},
|
|
10
11
|
large: {
|
|
11
12
|
borderBottomWidth: tokens["border-thick"],
|
|
12
13
|
opacity: 0.875,
|
|
13
14
|
},
|
|
15
|
+
larger: {
|
|
16
|
+
borderBottomWidth: tokens["border-thicker"],
|
|
17
|
+
opacity: 0.625,
|
|
18
|
+
},
|
|
14
19
|
largest: {
|
|
15
|
-
borderBottomWidth: tokens["
|
|
20
|
+
borderBottomWidth: tokens["border-thickest"],
|
|
16
21
|
opacity: 0.375,
|
|
17
22
|
},
|
|
18
23
|
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { tokens } from "../utils/design";
|
|
3
|
+
export const verticalStyles = StyleSheet.create({
|
|
4
|
+
base: {
|
|
5
|
+
margin: 0,
|
|
6
|
+
height: "100%",
|
|
7
|
+
width: 1,
|
|
8
|
+
borderRightWidth: tokens["border-base"],
|
|
9
|
+
borderRightColor: tokens["color-border"],
|
|
10
|
+
},
|
|
11
|
+
large: {
|
|
12
|
+
borderRightWidth: tokens["border-thick"],
|
|
13
|
+
opacity: 0.875,
|
|
14
|
+
},
|
|
15
|
+
larger: {
|
|
16
|
+
borderRightWidth: tokens["border-thicker"],
|
|
17
|
+
opacity: 0.625,
|
|
18
|
+
},
|
|
19
|
+
largest: {
|
|
20
|
+
borderRightWidth: tokens["border-thickest"],
|
|
21
|
+
opacity: 0.375,
|
|
22
|
+
},
|
|
23
|
+
vertical: {
|
|
24
|
+
borderRightColor: tokens["color-border"],
|
|
25
|
+
},
|
|
26
|
+
});
|