@jobber/components-native 0.105.1 → 0.105.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.105.1",
3
+ "version": "0.105.3",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -71,7 +71,7 @@
71
71
  "devDependencies": {
72
72
  "@babel/runtime": "^7.29.2",
73
73
  "@gorhom/bottom-sheet": "^5.2.8",
74
- "@jobber/design": "0.102.0",
74
+ "@jobber/design": "0.103.0",
75
75
  "@jobber/hooks": "2.21.0",
76
76
  "@react-native-community/datetimepicker": "^8.4.5",
77
77
  "@react-native/babel-preset": "^0.82.1",
@@ -122,5 +122,5 @@
122
122
  "react-native-screens": ">=4.18.0",
123
123
  "react-native-svg": ">=12.0.0"
124
124
  },
125
- "gitHead": "fff8aa8019d89e4a0d517f1eb963c8442935a16d"
125
+ "gitHead": "85613843d134dfa6dee673b87293f5e0ceb3bfa5"
126
126
  }
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import { AccessibilityInfo } from "react-native";
3
3
  import { render } from "@testing-library/react-native";
4
4
  import { useReducedMotion } from "react-native-reanimated";
5
+ import type { ReactTestInstance } from "react-test-renderer";
5
6
  import { ActivityIndicator } from "./index";
6
7
 
7
8
  // `useReducedMotion` is mocked globally in src/__mocks__/__mocks.ts and
@@ -41,7 +42,7 @@ describe("ActivityIndicator", () => {
41
42
 
42
43
  it("renders at the base (44px) size by default", () => {
43
44
  const { getByTestId } = render(<ActivityIndicator />);
44
- const root = getByTestId(testId);
45
+ const root = getByTestId(testId).children[0] as ReactTestInstance;
45
46
  const flattenedStyle = Array.isArray(root.props.style)
46
47
  ? Object.assign({}, ...root.props.style.flat(Infinity).filter(Boolean))
47
48
  : root.props.style;
@@ -53,7 +54,7 @@ describe("ActivityIndicator", () => {
53
54
  describe("size variants", () => {
54
55
  it("renders the small ring at 28px", () => {
55
56
  const { getByTestId } = render(<ActivityIndicator size="small" />);
56
- const root = getByTestId(testId);
57
+ const root = getByTestId(testId).children[0] as ReactTestInstance;
57
58
  const flattenedStyle = Array.isArray(root.props.style)
58
59
  ? Object.assign({}, ...root.props.style.flat(Infinity).filter(Boolean))
59
60
  : root.props.style;
@@ -63,7 +64,7 @@ describe("ActivityIndicator", () => {
63
64
 
64
65
  it("renders the base ring at 44px when size is explicit", () => {
65
66
  const { getByTestId } = render(<ActivityIndicator size="base" />);
66
- const root = getByTestId(testId);
67
+ const root = getByTestId(testId).children[0] as ReactTestInstance;
67
68
  const flattenedStyle = Array.isArray(root.props.style)
68
69
  ? Object.assign({}, ...root.props.style.flat(Infinity).filter(Boolean))
69
70
  : root.props.style;
@@ -85,7 +86,7 @@ describe("ActivityIndicator", () => {
85
86
 
86
87
  it('maps size="large" to size="base" visually', () => {
87
88
  const { getByTestId } = render(<ActivityIndicator size="large" />);
88
- const root = getByTestId(testId);
89
+ const root = getByTestId(testId).children[0] as ReactTestInstance;
89
90
  const flattenedStyle = Array.isArray(root.props.style)
90
91
  ? Object.assign({}, ...root.props.style.flat(Infinity).filter(Boolean))
91
92
  : root.props.style;
@@ -172,7 +173,7 @@ describe("ActivityIndicator", () => {
172
173
  it("renders the reduced-motion ring when the OS setting is on", () => {
173
174
  (useReducedMotion as jest.Mock).mockReturnValue(true);
174
175
  const { getByTestId } = render(<ActivityIndicator />);
175
- const root = getByTestId(testId);
176
+ const root = getByTestId(testId).children[0] as ReactTestInstance;
176
177
  // The reduced-motion presentation renders a single static <Circle>
177
178
  // wrapped in one Animated.View — the full-motion presentation renders
178
179
  // three nested Animated.Views. We can distinguish by the children
@@ -270,9 +270,9 @@ function FullMotionRing({
270
270
 
271
271
  return (
272
272
  <Animated.View
273
- style={[{ width: pixelSize, height: pixelSize }, style]}
274
- testID={testID}
273
+ style={[{ justifyContent: "center", alignItems: "center" }, style]}
275
274
  {...a11yProps}
275
+ testID={testID}
276
276
  >
277
277
  <Animated.View
278
278
  style={[{ width: pixelSize, height: pixelSize }, outerStyle]}
@@ -369,24 +369,28 @@ function ReducedMotionRing({
369
369
 
370
370
  return (
371
371
  <Animated.View
372
- style={[{ width: pixelSize, height: pixelSize }, animatedStyle, style]}
372
+ style={[{ justifyContent: "center", alignItems: "center" }, style]}
373
373
  testID={testID}
374
374
  {...a11yProps}
375
375
  >
376
- <Svg
377
- width={pixelSize}
378
- height={pixelSize}
379
- viewBox={`0 0 ${VIEWBOX} ${VIEWBOX}`}
376
+ <Animated.View
377
+ style={[{ width: pixelSize, height: pixelSize }, animatedStyle]}
380
378
  >
381
- <Circle
382
- cx={CENTER}
383
- cy={CENTER}
384
- r={RADIUS}
385
- fill="none"
386
- stroke={ringColor}
387
- strokeWidth={strokeWidth}
388
- />
389
- </Svg>
379
+ <Svg
380
+ width={pixelSize}
381
+ height={pixelSize}
382
+ viewBox={`0 0 ${VIEWBOX} ${VIEWBOX}`}
383
+ >
384
+ <Circle
385
+ cx={CENTER}
386
+ cy={CENTER}
387
+ r={RADIUS}
388
+ fill="none"
389
+ stroke={ringColor}
390
+ strokeWidth={strokeWidth}
391
+ />
392
+ </Svg>
393
+ </Animated.View>
390
394
  </Animated.View>
391
395
  );
392
396
  }