@jobber/components-native 0.84.4-match-mobi-55ef4ec.7 → 0.84.4-revert-269-4fbaea5.19
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 +3 -3
- package/dist/src/StatusLabel/StatusLabel.js +12 -6
- package/dist/src/StatusLabel/StatusLabel.style.js +13 -9
- package/dist/src/index.js +0 -1
- package/dist/src/utils/meta/meta.json +0 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/StatusLabel/StatusLabel.d.ts +3 -3
- package/dist/types/src/StatusLabel/StatusLabel.style.d.ts +10 -9
- package/dist/types/src/index.d.ts +0 -1
- package/package.json +3 -3
- package/src/StatusLabel/StatusLabel.style.ts +16 -9
- package/src/StatusLabel/StatusLabel.tsx +28 -15
- package/src/StatusLabel/__snapshots__/StatusLabel.test.tsx.snap +105 -126
- package/src/index.ts +0 -1
- package/src/utils/meta/meta.json +0 -1
- package/dist/src/StatusIndicator/StatusIndicator.js +0 -11
- package/dist/src/StatusIndicator/StatusIndicator.style.js +0 -12
- package/dist/src/StatusIndicator/StatusIndicator.type.js +0 -1
- package/dist/src/StatusIndicator/index.js +0 -1
- package/dist/types/src/StatusIndicator/StatusIndicator.d.ts +0 -6
- package/dist/types/src/StatusIndicator/StatusIndicator.style.d.ts +0 -8
- package/dist/types/src/StatusIndicator/StatusIndicator.type.d.ts +0 -1
- package/dist/types/src/StatusIndicator/index.d.ts +0 -2
- package/src/StatusIndicator/StatusIndicator.style.ts +0 -14
- package/src/StatusIndicator/StatusIndicator.test.tsx +0 -42
- package/src/StatusIndicator/StatusIndicator.tsx +0 -23
- package/src/StatusIndicator/StatusIndicator.type.ts +0 -6
- package/src/StatusIndicator/__snapshots__/StatusIndicator.test.tsx.snap +0 -96
- package/src/StatusIndicator/index.ts +0 -2
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@testing-library/react-native";
|
|
3
|
-
import { StatusIndicator } from "./StatusIndicator";
|
|
4
|
-
|
|
5
|
-
describe("StatusIndicator", () => {
|
|
6
|
-
describe("status", () => {
|
|
7
|
-
describe('when status prop set to default ("success")', () => {
|
|
8
|
-
it("should match snapshot", () => {
|
|
9
|
-
const view = render(<StatusIndicator status="success" />).toJSON();
|
|
10
|
-
expect(view).toMatchSnapshot();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
describe('when status prop set to "warning"', () => {
|
|
15
|
-
it("should match snapshot", () => {
|
|
16
|
-
const view = render(<StatusIndicator status="warning" />).toJSON();
|
|
17
|
-
expect(view).toMatchSnapshot();
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
describe('when status prop set to "critical"', () => {
|
|
22
|
-
it("should match snapshot", () => {
|
|
23
|
-
const view = render(<StatusIndicator status="critical" />).toJSON();
|
|
24
|
-
expect(view).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
describe('when status prop set to "inactive"', () => {
|
|
29
|
-
it("should match snapshot", () => {
|
|
30
|
-
const view = render(<StatusIndicator status="inactive" />).toJSON();
|
|
31
|
-
expect(view).toMatchSnapshot();
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
describe('when status prop set to "informative"', () => {
|
|
36
|
-
it("should match snapshot", () => {
|
|
37
|
-
const view = render(<StatusIndicator status="informative" />).toJSON();
|
|
38
|
-
expect(view).toMatchSnapshot();
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { View } from "react-native";
|
|
3
|
-
import { useStyles } from "./StatusIndicator.style";
|
|
4
|
-
import type { StatusIndicatorType } from "./StatusIndicator.type";
|
|
5
|
-
import { tokens } from "../utils/design";
|
|
6
|
-
|
|
7
|
-
export interface StatusIndicatorProps {
|
|
8
|
-
readonly status: StatusIndicatorType;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function StatusIndicator({ status }: StatusIndicatorProps) {
|
|
12
|
-
const styles = useStyles();
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<View
|
|
16
|
-
testID={`${status}Indicator`}
|
|
17
|
-
style={[
|
|
18
|
-
styles.statusIndicator,
|
|
19
|
-
{ backgroundColor: tokens[`color-${status}`] },
|
|
20
|
-
]}
|
|
21
|
-
/>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`StatusIndicator status when status prop set to "critical" should match snapshot 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
style={
|
|
6
|
-
[
|
|
7
|
-
{
|
|
8
|
-
"backgroundColor": "hsl(107, 58%, 33%)",
|
|
9
|
-
"borderRadius": 100,
|
|
10
|
-
"height": 8,
|
|
11
|
-
"width": 8,
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"backgroundColor": "hsl(6, 64%, 51%)",
|
|
15
|
-
},
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
testID="criticalIndicator"
|
|
19
|
-
/>
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
exports[`StatusIndicator status when status prop set to "inactive" should match snapshot 1`] = `
|
|
23
|
-
<View
|
|
24
|
-
style={
|
|
25
|
-
[
|
|
26
|
-
{
|
|
27
|
-
"backgroundColor": "hsl(107, 58%, 33%)",
|
|
28
|
-
"borderRadius": 100,
|
|
29
|
-
"height": 8,
|
|
30
|
-
"width": 8,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"backgroundColor": "hsl(198, 25%, 33%)",
|
|
34
|
-
},
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
testID="inactiveIndicator"
|
|
38
|
-
/>
|
|
39
|
-
`;
|
|
40
|
-
|
|
41
|
-
exports[`StatusIndicator status when status prop set to "informative" should match snapshot 1`] = `
|
|
42
|
-
<View
|
|
43
|
-
style={
|
|
44
|
-
[
|
|
45
|
-
{
|
|
46
|
-
"backgroundColor": "hsl(107, 58%, 33%)",
|
|
47
|
-
"borderRadius": 100,
|
|
48
|
-
"height": 8,
|
|
49
|
-
"width": 8,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"backgroundColor": "hsl(207, 79%, 57%)",
|
|
53
|
-
},
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
testID="informativeIndicator"
|
|
57
|
-
/>
|
|
58
|
-
`;
|
|
59
|
-
|
|
60
|
-
exports[`StatusIndicator status when status prop set to "warning" should match snapshot 1`] = `
|
|
61
|
-
<View
|
|
62
|
-
style={
|
|
63
|
-
[
|
|
64
|
-
{
|
|
65
|
-
"backgroundColor": "hsl(107, 58%, 33%)",
|
|
66
|
-
"borderRadius": 100,
|
|
67
|
-
"height": 8,
|
|
68
|
-
"width": 8,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"backgroundColor": "hsl(51, 64%, 49%)",
|
|
72
|
-
},
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
testID="warningIndicator"
|
|
76
|
-
/>
|
|
77
|
-
`;
|
|
78
|
-
|
|
79
|
-
exports[`StatusIndicator status when status prop set to default ("success") should match snapshot 1`] = `
|
|
80
|
-
<View
|
|
81
|
-
style={
|
|
82
|
-
[
|
|
83
|
-
{
|
|
84
|
-
"backgroundColor": "hsl(107, 58%, 33%)",
|
|
85
|
-
"borderRadius": 100,
|
|
86
|
-
"height": 8,
|
|
87
|
-
"width": 8,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"backgroundColor": "hsl(107, 58%, 33%)",
|
|
91
|
-
},
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
testID="successIndicator"
|
|
95
|
-
/>
|
|
96
|
-
`;
|