@jobber/components-native 0.80.1-upgrade-to-64048d8.25 → 0.80.1-upgrade-to-2ee92b7.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 +2 -2
- package/dist/src/Chip/Chip.js +1 -1
- package/dist/src/Form/Form.js +0 -1
- package/dist/src/FormatFile/components/ProgressBar/ProgressBar.style.js +1 -1
- package/dist/src/ProgressBar/ProgressBar.js +2 -2
- package/dist/src/Switch/components/BaseSwitch/BaseSwitch.js +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/ThumbnailList/types.d.ts +1 -1
- package/package.json +2 -2
- package/src/Chip/Chip.test.tsx +1 -1
- package/src/Chip/Chip.tsx +1 -1
- package/src/Form/Form.tsx +0 -1
- package/src/FormatFile/components/ProgressBar/ProgressBar.style.tsx +1 -1
- package/src/ProgressBar/ProgressBar.tsx +4 -2
- package/src/ProgressBar/__snapshots__/ProgressBar.test.tsx.snap +2 -2
- package/src/Switch/components/BaseSwitch/BaseSwitch.test.tsx +75 -50
- package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +3 -3
- package/src/ThumbnailList/types.ts +1 -1
- package/src/Switch/components/BaseSwitch/__snapshots__/BaseSwitch.test.tsx.snap +0 -217
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.80.1-upgrade-to-
|
|
3
|
+
"version": "0.80.1-upgrade-to-2ee92b7.19+2ee92b75",
|
|
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": "2ee92b753e53fd4b5235e27553378ad899192068"
|
|
84
84
|
}
|
package/src/Chip/Chip.test.tsx
CHANGED
|
@@ -35,7 +35,7 @@ it("renders an inactive Chip with a default backgroundColor", () => {
|
|
|
35
35
|
backgroundColor: tokens["color-surface--reverse"],
|
|
36
36
|
});
|
|
37
37
|
expect(getByTestId("chipTest").props.style).toContainEqual({
|
|
38
|
-
backgroundColor: tokens["color-
|
|
38
|
+
backgroundColor: tokens["color-interactive--background"],
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
41
|
|
package/src/Chip/Chip.tsx
CHANGED
|
@@ -82,7 +82,7 @@ export function Chip({
|
|
|
82
82
|
backgroundColor:
|
|
83
83
|
inactiveBackgroundColor === "surface"
|
|
84
84
|
? tokens["color-surface"]
|
|
85
|
-
: tokens["color-
|
|
85
|
+
: tokens["color-interactive--background"],
|
|
86
86
|
},
|
|
87
87
|
isActive && { backgroundColor: accentColor },
|
|
88
88
|
];
|
package/src/Form/Form.tsx
CHANGED
|
@@ -7,7 +7,7 @@ export const useStyles = buildThemedStyles(tokens => {
|
|
|
7
7
|
height: 8,
|
|
8
8
|
borderRadius: tokens["radius-circle"],
|
|
9
9
|
overflow: "hidden",
|
|
10
|
-
backgroundColor: tokens["color-
|
|
10
|
+
backgroundColor: tokens["color-interactive--background"],
|
|
11
11
|
},
|
|
12
12
|
progress: {
|
|
13
13
|
height: "100%",
|
|
@@ -33,7 +33,9 @@ export function ProgressBar({
|
|
|
33
33
|
<ProgressBarStepped
|
|
34
34
|
total={total}
|
|
35
35
|
current={current}
|
|
36
|
-
color={
|
|
36
|
+
color={
|
|
37
|
+
reverseTheme ? undefined : tokens["color-interactive--background"]
|
|
38
|
+
}
|
|
37
39
|
loading={loading}
|
|
38
40
|
inProgress={inProgress}
|
|
39
41
|
/>
|
|
@@ -43,7 +45,7 @@ export function ProgressBar({
|
|
|
43
45
|
width={100}
|
|
44
46
|
animationDuration={0}
|
|
45
47
|
color={
|
|
46
|
-
reverseTheme ? undefined : tokens["color-
|
|
48
|
+
reverseTheme ? undefined : tokens["color-interactive--background"]
|
|
47
49
|
}
|
|
48
50
|
/>
|
|
49
51
|
{!loading && (
|
|
@@ -34,7 +34,7 @@ exports[`renders blue inProgress bar when 1 or more jobs is in progress 1`] = `
|
|
|
34
34
|
"width": "100%",
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
"backgroundColor": "hsl(
|
|
37
|
+
"backgroundColor": "hsl(51, 17%, 85%)",
|
|
38
38
|
"width": "100%",
|
|
39
39
|
},
|
|
40
40
|
]
|
|
@@ -116,7 +116,7 @@ exports[`renders green CompletedProgress bar when 1 or more jobs is completed 1`
|
|
|
116
116
|
"width": "100%",
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
"backgroundColor": "hsl(
|
|
119
|
+
"backgroundColor": "hsl(51, 17%, 85%)",
|
|
120
120
|
"width": "100%",
|
|
121
121
|
},
|
|
122
122
|
]
|
|
@@ -2,61 +2,86 @@ import React from "react";
|
|
|
2
2
|
import { fireEvent, render } from "@testing-library/react-native";
|
|
3
3
|
import { BaseSwitch } from "./BaseSwitch";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
5
|
+
describe("BaseSwitch", () => {
|
|
6
|
+
describe("rendering", () => {
|
|
7
|
+
it("renders with value true", () => {
|
|
8
|
+
const { getByRole } = render(<BaseSwitch value={true} />);
|
|
9
|
+
const switchElement = getByRole("switch");
|
|
10
|
+
expect(switchElement).toBeDefined();
|
|
11
|
+
expect(switchElement.props.accessibilityState.checked).toBe(true);
|
|
12
|
+
});
|
|
9
13
|
|
|
10
|
-
it("renders
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
it("renders with defaultValue true", () => {
|
|
15
|
+
const { getByRole } = render(<BaseSwitch defaultValue={true} />);
|
|
16
|
+
const switchElement = getByRole("switch");
|
|
17
|
+
expect(switchElement).toBeDefined();
|
|
18
|
+
expect(switchElement.props.accessibilityState.checked).toBe(true);
|
|
19
|
+
});
|
|
14
20
|
|
|
15
|
-
it("renders
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
it("renders with value false", () => {
|
|
22
|
+
const { getByRole } = render(<BaseSwitch value={false} />);
|
|
23
|
+
const switchElement = getByRole("switch");
|
|
24
|
+
expect(switchElement).toBeDefined();
|
|
25
|
+
expect(switchElement.props.accessibilityState.checked).toBe(false);
|
|
26
|
+
});
|
|
19
27
|
|
|
20
|
-
it("renders
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
it("renders with defaultValue false", () => {
|
|
29
|
+
const { getByRole } = render(<BaseSwitch defaultValue={false} />);
|
|
30
|
+
const switchElement = getByRole("switch");
|
|
31
|
+
expect(switchElement).toBeDefined();
|
|
32
|
+
expect(switchElement.props.accessibilityState.checked).toBe(false);
|
|
33
|
+
});
|
|
24
34
|
|
|
25
|
-
it("renders
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
it("renders correctly when disabled with value true", () => {
|
|
36
|
+
const { getByRole } = render(<BaseSwitch value={true} disabled={true} />);
|
|
37
|
+
const switchElement = getByRole("switch");
|
|
38
|
+
expect(switchElement).toBeDefined();
|
|
39
|
+
expect(switchElement.props.accessibilityState.checked).toBe(true);
|
|
40
|
+
expect(switchElement.props.accessibilityState.disabled).toBe(true);
|
|
41
|
+
});
|
|
29
42
|
|
|
30
|
-
it("renders
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
it("renders correctly when disabled with value false", () => {
|
|
44
|
+
const { getByRole } = render(
|
|
45
|
+
<BaseSwitch value={false} disabled={true} />,
|
|
46
|
+
);
|
|
47
|
+
const switchElement = getByRole("switch");
|
|
48
|
+
expect(switchElement).toBeDefined();
|
|
49
|
+
expect(switchElement.props.accessibilityState.checked).toBe(false);
|
|
50
|
+
expect(switchElement.props.accessibilityState.disabled).toBe(true);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
34
53
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
describe("behavior", () => {
|
|
55
|
+
it("invokes the valueChange callback", () => {
|
|
56
|
+
const valueChangedCallback = jest.fn();
|
|
57
|
+
const { getByLabelText } = render(
|
|
58
|
+
<BaseSwitch
|
|
59
|
+
value={false}
|
|
60
|
+
onValueChange={valueChangedCallback}
|
|
61
|
+
accessibilityLabel={"test switch"}
|
|
62
|
+
/>,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
fireEvent(getByLabelText("test switch"), "valueChange", true);
|
|
66
|
+
expect(valueChangedCallback).toHaveBeenCalledWith(true);
|
|
67
|
+
|
|
68
|
+
fireEvent(getByLabelText("test switch"), "valueChange", false);
|
|
69
|
+
expect(valueChangedCallback).toHaveBeenCalledWith(false);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("doesn't invoke the valueChange callback if disabled", () => {
|
|
73
|
+
const valueChangedCallback = jest.fn();
|
|
74
|
+
const { getByLabelText } = render(
|
|
75
|
+
<BaseSwitch
|
|
76
|
+
value={false}
|
|
77
|
+
disabled={true}
|
|
78
|
+
onValueChange={valueChangedCallback}
|
|
79
|
+
accessibilityLabel={"test switch"}
|
|
80
|
+
/>,
|
|
81
|
+
);
|
|
49
82
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
value={false}
|
|
55
|
-
disabled={true}
|
|
56
|
-
onValueChange={valueChangedCallback}
|
|
57
|
-
accessibilityLabel={"test switch"}
|
|
58
|
-
/>,
|
|
59
|
-
);
|
|
60
|
-
fireEvent(tree.getByLabelText("test switch"), "valueChange", true);
|
|
61
|
-
expect(valueChangedCallback).not.toHaveBeenCalled();
|
|
83
|
+
fireEvent(getByLabelText("test switch"), "valueChange", true);
|
|
84
|
+
expect(valueChangedCallback).not.toHaveBeenCalled();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
62
87
|
});
|
|
@@ -60,7 +60,7 @@ export function BaseSwitch({
|
|
|
60
60
|
} else if (internalValue) {
|
|
61
61
|
return tokens["color-interactive"];
|
|
62
62
|
} else {
|
|
63
|
-
return tokens["color-
|
|
63
|
+
return tokens["color-interactive--background"];
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -81,7 +81,7 @@ export function BaseSwitch({
|
|
|
81
81
|
//iOS
|
|
82
82
|
return {
|
|
83
83
|
true: tokens["color-interactive"],
|
|
84
|
-
false: tokens["color-
|
|
84
|
+
false: tokens["color-interactive--background"],
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -98,7 +98,7 @@ export function BaseSwitch({
|
|
|
98
98
|
disabled={disabled}
|
|
99
99
|
thumbColor={getThumbColor()}
|
|
100
100
|
trackColor={getTrackColors()}
|
|
101
|
-
ios_backgroundColor={tokens["color-
|
|
101
|
+
ios_backgroundColor={tokens["color-interactive--background"]}
|
|
102
102
|
accessibilityLabel={accessibilityLabel}
|
|
103
103
|
accessibilityRole={"switch"}
|
|
104
104
|
accessibilityState={{
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`renders a Switch with defaultValue false 1`] = `
|
|
4
|
-
<RCTSwitch
|
|
5
|
-
accessibilityRole="switch"
|
|
6
|
-
accessibilityState={
|
|
7
|
-
{
|
|
8
|
-
"checked": false,
|
|
9
|
-
"disabled": false,
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
collapsable={false}
|
|
13
|
-
disabled={false}
|
|
14
|
-
handlerTag={-1}
|
|
15
|
-
handlerType="NativeViewGestureHandler"
|
|
16
|
-
onChange={[Function]}
|
|
17
|
-
onGestureHandlerEvent={[Function]}
|
|
18
|
-
onGestureHandlerStateChange={[Function]}
|
|
19
|
-
onResponderTerminationRequest={[Function]}
|
|
20
|
-
onStartShouldSetResponder={[Function]}
|
|
21
|
-
onTintColor="hsl(107, 58%, 33%)"
|
|
22
|
-
style={
|
|
23
|
-
[
|
|
24
|
-
{
|
|
25
|
-
"height": 31,
|
|
26
|
-
"width": 51,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"backgroundColor": "hsl(53, 21%, 93%)",
|
|
30
|
-
"borderRadius": 16,
|
|
31
|
-
},
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
tintColor="hsl(53, 21%, 93%)"
|
|
35
|
-
value={false}
|
|
36
|
-
/>
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
|
-
exports[`renders a Switch with defaultValue true 1`] = `
|
|
40
|
-
<RCTSwitch
|
|
41
|
-
accessibilityRole="switch"
|
|
42
|
-
accessibilityState={
|
|
43
|
-
{
|
|
44
|
-
"checked": true,
|
|
45
|
-
"disabled": false,
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
collapsable={false}
|
|
49
|
-
disabled={false}
|
|
50
|
-
handlerTag={-1}
|
|
51
|
-
handlerType="NativeViewGestureHandler"
|
|
52
|
-
onChange={[Function]}
|
|
53
|
-
onGestureHandlerEvent={[Function]}
|
|
54
|
-
onGestureHandlerStateChange={[Function]}
|
|
55
|
-
onResponderTerminationRequest={[Function]}
|
|
56
|
-
onStartShouldSetResponder={[Function]}
|
|
57
|
-
onTintColor="hsl(107, 58%, 33%)"
|
|
58
|
-
style={
|
|
59
|
-
[
|
|
60
|
-
{
|
|
61
|
-
"height": 31,
|
|
62
|
-
"width": 51,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"backgroundColor": "hsl(53, 21%, 93%)",
|
|
66
|
-
"borderRadius": 16,
|
|
67
|
-
},
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
tintColor="hsl(53, 21%, 93%)"
|
|
71
|
-
value={true}
|
|
72
|
-
/>
|
|
73
|
-
`;
|
|
74
|
-
|
|
75
|
-
exports[`renders a Switch with value false 1`] = `
|
|
76
|
-
<RCTSwitch
|
|
77
|
-
accessibilityRole="switch"
|
|
78
|
-
accessibilityState={
|
|
79
|
-
{
|
|
80
|
-
"checked": false,
|
|
81
|
-
"disabled": false,
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
collapsable={false}
|
|
85
|
-
disabled={false}
|
|
86
|
-
handlerTag={-1}
|
|
87
|
-
handlerType="NativeViewGestureHandler"
|
|
88
|
-
onChange={[Function]}
|
|
89
|
-
onGestureHandlerEvent={[Function]}
|
|
90
|
-
onGestureHandlerStateChange={[Function]}
|
|
91
|
-
onResponderTerminationRequest={[Function]}
|
|
92
|
-
onStartShouldSetResponder={[Function]}
|
|
93
|
-
onTintColor="hsl(107, 58%, 33%)"
|
|
94
|
-
style={
|
|
95
|
-
[
|
|
96
|
-
{
|
|
97
|
-
"height": 31,
|
|
98
|
-
"width": 51,
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"backgroundColor": "hsl(53, 21%, 93%)",
|
|
102
|
-
"borderRadius": 16,
|
|
103
|
-
},
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
tintColor="hsl(53, 21%, 93%)"
|
|
107
|
-
value={false}
|
|
108
|
-
/>
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
exports[`renders a Switch with value true 1`] = `
|
|
112
|
-
<RCTSwitch
|
|
113
|
-
accessibilityRole="switch"
|
|
114
|
-
accessibilityState={
|
|
115
|
-
{
|
|
116
|
-
"checked": true,
|
|
117
|
-
"disabled": false,
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
collapsable={false}
|
|
121
|
-
disabled={false}
|
|
122
|
-
handlerTag={-1}
|
|
123
|
-
handlerType="NativeViewGestureHandler"
|
|
124
|
-
onChange={[Function]}
|
|
125
|
-
onGestureHandlerEvent={[Function]}
|
|
126
|
-
onGestureHandlerStateChange={[Function]}
|
|
127
|
-
onResponderTerminationRequest={[Function]}
|
|
128
|
-
onStartShouldSetResponder={[Function]}
|
|
129
|
-
onTintColor="hsl(107, 58%, 33%)"
|
|
130
|
-
style={
|
|
131
|
-
[
|
|
132
|
-
{
|
|
133
|
-
"height": 31,
|
|
134
|
-
"width": 51,
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"backgroundColor": "hsl(53, 21%, 93%)",
|
|
138
|
-
"borderRadius": 16,
|
|
139
|
-
},
|
|
140
|
-
]
|
|
141
|
-
}
|
|
142
|
-
tintColor="hsl(53, 21%, 93%)"
|
|
143
|
-
value={true}
|
|
144
|
-
/>
|
|
145
|
-
`;
|
|
146
|
-
|
|
147
|
-
exports[`renders a disabled Switch with value false 1`] = `
|
|
148
|
-
<RCTSwitch
|
|
149
|
-
accessibilityRole="switch"
|
|
150
|
-
accessibilityState={
|
|
151
|
-
{
|
|
152
|
-
"checked": false,
|
|
153
|
-
"disabled": true,
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
collapsable={false}
|
|
157
|
-
disabled={true}
|
|
158
|
-
handlerTag={-1}
|
|
159
|
-
handlerType="NativeViewGestureHandler"
|
|
160
|
-
onChange={[Function]}
|
|
161
|
-
onGestureHandlerEvent={[Function]}
|
|
162
|
-
onGestureHandlerStateChange={[Function]}
|
|
163
|
-
onResponderTerminationRequest={[Function]}
|
|
164
|
-
onStartShouldSetResponder={[Function]}
|
|
165
|
-
onTintColor="hsl(107, 58%, 33%)"
|
|
166
|
-
style={
|
|
167
|
-
[
|
|
168
|
-
{
|
|
169
|
-
"height": 31,
|
|
170
|
-
"width": 51,
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
"backgroundColor": "hsl(53, 21%, 93%)",
|
|
174
|
-
"borderRadius": 16,
|
|
175
|
-
},
|
|
176
|
-
]
|
|
177
|
-
}
|
|
178
|
-
tintColor="hsl(53, 21%, 93%)"
|
|
179
|
-
value={false}
|
|
180
|
-
/>
|
|
181
|
-
`;
|
|
182
|
-
|
|
183
|
-
exports[`renders a disabled Switch with value true 1`] = `
|
|
184
|
-
<RCTSwitch
|
|
185
|
-
accessibilityRole="switch"
|
|
186
|
-
accessibilityState={
|
|
187
|
-
{
|
|
188
|
-
"checked": true,
|
|
189
|
-
"disabled": true,
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
collapsable={false}
|
|
193
|
-
disabled={true}
|
|
194
|
-
handlerTag={-1}
|
|
195
|
-
handlerType="NativeViewGestureHandler"
|
|
196
|
-
onChange={[Function]}
|
|
197
|
-
onGestureHandlerEvent={[Function]}
|
|
198
|
-
onGestureHandlerStateChange={[Function]}
|
|
199
|
-
onResponderTerminationRequest={[Function]}
|
|
200
|
-
onStartShouldSetResponder={[Function]}
|
|
201
|
-
onTintColor="hsl(107, 58%, 33%)"
|
|
202
|
-
style={
|
|
203
|
-
[
|
|
204
|
-
{
|
|
205
|
-
"height": 31,
|
|
206
|
-
"width": 51,
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"backgroundColor": "hsl(53, 21%, 93%)",
|
|
210
|
-
"borderRadius": 16,
|
|
211
|
-
},
|
|
212
|
-
]
|
|
213
|
-
}
|
|
214
|
-
tintColor="hsl(53, 21%, 93%)"
|
|
215
|
-
value={true}
|
|
216
|
-
/>
|
|
217
|
-
`;
|