@jobber/components-native 0.105.1-MIKEfix-c-3095233.3 → 0.105.2
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/ActivityIndicator/ActivityIndicator.js +2 -8
- package/dist/src/Icon/Icon.js +2 -1
- package/dist/src/Icon/Icon.test.js +4 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/ActivityIndicator/ActivityIndicator.tsx +2 -8
- package/src/Icon/Icon.test.tsx +6 -1
- package/src/Icon/Icon.tsx +2 -1
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.105.
|
|
3
|
+
"version": "0.105.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -122,5 +122,5 @@
|
|
|
122
122
|
"react-native-screens": ">=4.18.0",
|
|
123
123
|
"react-native-svg": ">=12.0.0"
|
|
124
124
|
},
|
|
125
|
-
"gitHead": "
|
|
125
|
+
"gitHead": "c76d3cfd8af83d2700a0e78c3bc2fc549771a471"
|
|
126
126
|
}
|
|
@@ -123,10 +123,7 @@ function FullMotionRing({ pixelSize, strokeWidth, arcColor, trackColor, style, t
|
|
|
123
123
|
strokeDashoffset: offset,
|
|
124
124
|
};
|
|
125
125
|
});
|
|
126
|
-
return (React.createElement(Animated.View, Object.assign({ style: [
|
|
127
|
-
{ flex: 1, justifyContent: "center", alignItems: "center" },
|
|
128
|
-
style,
|
|
129
|
-
] }, a11yProps, { testID: testID }),
|
|
126
|
+
return (React.createElement(Animated.View, Object.assign({ style: [{ justifyContent: "center", alignItems: "center" }, style] }, a11yProps, { testID: testID }),
|
|
130
127
|
React.createElement(Animated.View, { style: [{ width: pixelSize, height: pixelSize }, outerStyle] },
|
|
131
128
|
React.createElement(Animated.View, { style: [{ width: pixelSize, height: pixelSize }, innerStyle] },
|
|
132
129
|
React.createElement(Svg, { width: pixelSize, height: pixelSize, viewBox: `0 0 ${VIEWBOX} ${VIEWBOX}` },
|
|
@@ -167,10 +164,7 @@ function ReducedMotionRing({ pixelSize, strokeWidth, ringColor, style, testID, a
|
|
|
167
164
|
const animatedStyle = useAnimatedStyle(() => ({
|
|
168
165
|
opacity: pulse.value,
|
|
169
166
|
}));
|
|
170
|
-
return (React.createElement(Animated.View, Object.assign({ style: [
|
|
171
|
-
{ flex: 1, justifyContent: "center", alignItems: "center" },
|
|
172
|
-
style,
|
|
173
|
-
], testID: testID }, a11yProps),
|
|
167
|
+
return (React.createElement(Animated.View, Object.assign({ style: [{ justifyContent: "center", alignItems: "center" }, style], testID: testID }, a11yProps),
|
|
174
168
|
React.createElement(Animated.View, { style: [{ width: pixelSize, height: pixelSize }, animatedStyle] },
|
|
175
169
|
React.createElement(Svg, { width: pixelSize, height: pixelSize, viewBox: `0 0 ${VIEWBOX} ${VIEWBOX}` },
|
|
176
170
|
React.createElement(Circle, { cx: CENTER, cy: CENTER, r: RADIUS, fill: "none", stroke: ringColor, strokeWidth: strokeWidth })))));
|
package/dist/src/Icon/Icon.js
CHANGED
|
@@ -12,7 +12,8 @@ export function Icon({ name, color, size = "base", customColor, testID, }) {
|
|
|
12
12
|
format: "js",
|
|
13
13
|
tokens,
|
|
14
14
|
});
|
|
15
|
-
|
|
15
|
+
// getIcon returns undefined paths for an unknown icon name; render nothing rather than crash.
|
|
16
|
+
const icon = (paths !== null && paths !== void 0 ? paths : []).map((path) => {
|
|
16
17
|
return React.createElement(Path, { key: path, d: path, fill: customColor || svgStyle.fill });
|
|
17
18
|
});
|
|
18
19
|
return (React.createElement(Svg, { style: Object.assign(Object.assign({}, svgStyle), { display: "flex" }), testID: testID || name, viewBox: viewBox }, icon));
|
|
@@ -41,6 +41,10 @@ it("applies name prop as testID when testID prop is not provided", () => {
|
|
|
41
41
|
const { getByTestId } = render(React.createElement(Icon, { name: "home" }));
|
|
42
42
|
expect(getByTestId("home")).toBeDefined();
|
|
43
43
|
});
|
|
44
|
+
it("renders an empty svg without throwing for an unknown icon name", () => {
|
|
45
|
+
const svg = render(React.createElement(Icon, { name: "someNonexistentIcon" }));
|
|
46
|
+
expect(svg.UNSAFE_root.findAllByType(Path)).toHaveLength(0);
|
|
47
|
+
});
|
|
44
48
|
describe("theme-aware fill", () => {
|
|
45
49
|
function getPathFills(svg) {
|
|
46
50
|
return svg.UNSAFE_root.findAllByType(Path).map(p => p.props.fill);
|