@jobber/components-native 0.105.1-MIKEfix-c-3095233.3 → 0.105.1
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 +4 -11
- package/dist/src/ActivityIndicator/ActivityIndicator.test.js +5 -5
- 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.test.tsx +5 -6
- package/src/ActivityIndicator/ActivityIndicator.tsx +16 -26
- 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.1
|
|
3
|
+
"version": "0.105.1",
|
|
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": "fff8aa8019d89e4a0d517f1eb963c8442935a16d"
|
|
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: [{ width: pixelSize, height: pixelSize }, style], testID: testID }, a11yProps),
|
|
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,11 +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
|
-
|
|
172
|
-
|
|
173
|
-
], testID: testID }, a11yProps),
|
|
174
|
-
React.createElement(Animated.View, { style: [{ width: pixelSize, height: pixelSize }, animatedStyle] },
|
|
175
|
-
React.createElement(Svg, { width: pixelSize, height: pixelSize, viewBox: `0 0 ${VIEWBOX} ${VIEWBOX}` },
|
|
176
|
-
React.createElement(Circle, { cx: CENTER, cy: CENTER, r: RADIUS, fill: "none", stroke: ringColor, strokeWidth: strokeWidth })))));
|
|
167
|
+
return (React.createElement(Animated.View, Object.assign({ style: [{ width: pixelSize, height: pixelSize }, animatedStyle, style], testID: testID }, a11yProps),
|
|
168
|
+
React.createElement(Svg, { width: pixelSize, height: pixelSize, viewBox: `0 0 ${VIEWBOX} ${VIEWBOX}` },
|
|
169
|
+
React.createElement(Circle, { cx: CENTER, cy: CENTER, r: RADIUS, fill: "none", stroke: ringColor, strokeWidth: strokeWidth }))));
|
|
177
170
|
}
|
|
@@ -33,7 +33,7 @@ describe("ActivityIndicator", () => {
|
|
|
33
33
|
});
|
|
34
34
|
it("renders at the base (44px) size by default", () => {
|
|
35
35
|
const { getByTestId } = render(React.createElement(ActivityIndicator, null));
|
|
36
|
-
const root = getByTestId(testId)
|
|
36
|
+
const root = getByTestId(testId);
|
|
37
37
|
const flattenedStyle = Array.isArray(root.props.style)
|
|
38
38
|
? Object.assign({}, ...root.props.style.flat(Infinity).filter(Boolean))
|
|
39
39
|
: root.props.style;
|
|
@@ -44,7 +44,7 @@ describe("ActivityIndicator", () => {
|
|
|
44
44
|
describe("size variants", () => {
|
|
45
45
|
it("renders the small ring at 28px", () => {
|
|
46
46
|
const { getByTestId } = render(React.createElement(ActivityIndicator, { size: "small" }));
|
|
47
|
-
const root = getByTestId(testId)
|
|
47
|
+
const root = getByTestId(testId);
|
|
48
48
|
const flattenedStyle = Array.isArray(root.props.style)
|
|
49
49
|
? Object.assign({}, ...root.props.style.flat(Infinity).filter(Boolean))
|
|
50
50
|
: root.props.style;
|
|
@@ -53,7 +53,7 @@ describe("ActivityIndicator", () => {
|
|
|
53
53
|
});
|
|
54
54
|
it("renders the base ring at 44px when size is explicit", () => {
|
|
55
55
|
const { getByTestId } = render(React.createElement(ActivityIndicator, { size: "base" }));
|
|
56
|
-
const root = getByTestId(testId)
|
|
56
|
+
const root = getByTestId(testId);
|
|
57
57
|
const flattenedStyle = Array.isArray(root.props.style)
|
|
58
58
|
? Object.assign({}, ...root.props.style.flat(Infinity).filter(Boolean))
|
|
59
59
|
: root.props.style;
|
|
@@ -71,7 +71,7 @@ describe("ActivityIndicator", () => {
|
|
|
71
71
|
});
|
|
72
72
|
it('maps size="large" to size="base" visually', () => {
|
|
73
73
|
const { getByTestId } = render(React.createElement(ActivityIndicator, { size: "large" }));
|
|
74
|
-
const root = getByTestId(testId)
|
|
74
|
+
const root = getByTestId(testId);
|
|
75
75
|
const flattenedStyle = Array.isArray(root.props.style)
|
|
76
76
|
? Object.assign({}, ...root.props.style.flat(Infinity).filter(Boolean))
|
|
77
77
|
: root.props.style;
|
|
@@ -131,7 +131,7 @@ describe("ActivityIndicator", () => {
|
|
|
131
131
|
it("renders the reduced-motion ring when the OS setting is on", () => {
|
|
132
132
|
useReducedMotion.mockReturnValue(true);
|
|
133
133
|
const { getByTestId } = render(React.createElement(ActivityIndicator, null));
|
|
134
|
-
const root = getByTestId(testId)
|
|
134
|
+
const root = getByTestId(testId);
|
|
135
135
|
// The reduced-motion presentation renders a single static <Circle>
|
|
136
136
|
// wrapped in one Animated.View — the full-motion presentation renders
|
|
137
137
|
// three nested Animated.Views. We can distinguish by the children
|
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);
|