@jobber/components-native 0.115.2 → 0.115.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.
@@ -5,101 +5,79 @@ directly control or measure — loading, fetching, or waiting on an external
5
5
  system.
6
6
 
7
7
  Use `ActivityIndicator` when the loading time or fraction of progress is
8
- unknown. If you know the fraction of progress (for example, "3 of 4 files
9
- uploaded"), use `ProgressBar` instead. A `ProgressIndicator` counterpart that
10
- will subsume `ProgressBar` under the new Indicators naming is forthcoming.
8
+ unknown. When the amount completed is known, use `ProgressIndicator` instead.
11
9
 
12
10
  ## Design & usage guidelines
13
11
 
14
- The default `ActivityIndicator` size is `base` (44px) and can be used in most
15
- cases. The `small` size (28px) should be used on individual elements of an
16
- interface (e.g. inside a `Button` or `Card`) or when sitting next to short
17
- inline text.
12
+ Web and mobile share the same visual language: a non-interactive ring with a
13
+ muted track and an animated foreground arc. The platform implementations use
14
+ different sizes and motion timing so each reads appropriately in its context.
18
15
 
19
- Layout is the consumer's responsibility — `ActivityIndicator` does not expose an
20
- `inline` prop. Place it inside your own flex / inline-block container, or pass a
21
- `style`, to control surrounding layout.
16
+ ### Web
22
17
 
23
- ## Accessibility
24
-
25
- `ActivityIndicator` announces itself to assistive technology on every platform:
26
-
27
- * `accessibilityRole="progressbar"` and `accessibilityState={{ busy: true }}`
28
- mark the component as an ongoing indeterminate activity.
29
- * `accessibilityLabel` defaults to a localized `"Loading"` string via
30
- `useAtlantisI18n("loading")`. Pass a custom `accessibilityLabel` to describe
31
- the specific activity (e.g. `accessibilityLabel="Uploading file"`).
32
- * On mount and whenever the label changes, the component calls
33
- `AccessibilityInfo.announceForAccessibility` so VoiceOver and TalkBack
34
- announce the label once.
35
-
36
- The indicator is not focusable and is not in the accessibility navigation order
37
- beyond the mount-time announcement.
38
-
39
- ### Reduced motion
40
-
41
- When the operating system reports the Reduce Motion accessibility setting, the
42
- indicator hides the rocking and rotating layers, repaints a single static ring
43
- in the icon foreground colour, and gently pulses its opacity so the indicator
44
- still reads as "busy" without rotational motion. Detection is reactive — the
45
- component responds to OS toggles without requiring a remount.
46
-
47
- ## Cross-platform parity
48
-
49
- `ActivityIndicator` renders the same Material Design 3 three-layer indeterminate
50
- ring on iOS, Android, and web (`@jobber/components`). The visual identity,
51
- sizes, motion durations, and reduced-motion fallback are unified across
52
- platforms. Public prop names diverge to follow each platform's native
53
- conventions (`accessibilityLabel` here vs `ariaLabel` on web; `style` here vs
54
- `className` + `style` on web).
18
+ The default `base` size is 32px. Use the 16px `small` size beside short text or
19
+ inside compact interface elements such as buttons.
55
20
 
56
- Use `ActivityIndicator` when the loading time or fraction of progress is
57
- unknown. If you know the fraction of progress (for example, "3 of 4 files
58
- uploaded"), use `ProgressBar` instead. A `ProgressIndicator` counterpart that
59
- will subsume `ProgressBar` under the new naming is forthcoming.
21
+ Layout is the consumer's responsibility. Place the indicator in a suitable
22
+ container, or use `className` and `style`, to control alignment and spacing.
60
23
 
61
- ## Design & usage guidelines
24
+ ### Mobile
62
25
 
63
- The default `ActivityIndicator` size is `base` (32px) and can be used in most
64
- cases. The `small` size (16px) should be used on individual elements of an
65
- interface (e.g. inside a `Button` or `Card`) or when sitting next to short
66
- inline text.
26
+ The default `base` size is 44px. Use the 28px `small` size for compact mobile
27
+ interfaces. Layout is controlled by the surrounding `View` or by passing
28
+ `style`.
67
29
 
68
- Layout is the consumer's responsibility — `ActivityIndicator` does not expose an
69
- `inline` prop. Place it inside your own flex / inline-block container, or pass a
70
- `className` / `style`, to control surrounding layout.
30
+ Both implementations use `color-text--secondary` for the active arc and
31
+ `color-surface--active` for the track, allowing the indicator to adapt across
32
+ supported themes and surfaces.
71
33
 
72
34
  ## Accessibility
73
35
 
74
- `ActivityIndicator` announces itself politely to assistive technology:
36
+ ### Web
75
37
 
76
- * `role="status"` marks the element as a polite live region, appropriate for a
77
- non-urgent loading state.
78
- * `aria-label` defaults to the literal English string `"Loading"`. Pass a custom
79
- `ariaLabel` to localize or to describe the specific activity (e.g.
80
- `ariaLabel="Uploading file"`).
38
+ * `role="status"` creates a polite live region for non-urgent loading states.
39
+ * `ariaLabel` defaults to the localized `"Loading"` message. Override it when a
40
+ more specific description is helpful, such as `"Uploading file"`.
41
+ * Visually hidden label text ensures the status is announced when it mounts.
81
42
 
82
43
  The indicator does not participate in the keyboard tab order.
83
44
 
84
- ### Reduced motion
45
+ ### Mobile
85
46
 
86
- When the user's operating system reports
87
- [`prefers-reduced-motion: reduce`](https://developer.mozilla.org/docs/Web/CSS/@media/prefers-reduced-motion),
88
- the indicator hides its rocking and rotating layers, repaints a single static
89
- ring in the icon foreground colour, and gently pulses its opacity so the
90
- indicator still reads as "busy" without rotational motion.
47
+ * `accessibilityRole="progressbar"` and `accessibilityState={{ busy: true }}`
48
+ identify an ongoing indeterminate activity.
49
+ * `accessibilityLabel` defaults to the localized `"Loading"` message. Override
50
+ it to describe a specific activity.
51
+ * The resolved label is announced when the indicator mounts and whenever the
52
+ label changes.
91
53
 
92
- ## Relationship to Spinner
54
+ The indicator is non-interactive. It exposes one accessible progress element and
55
+ does not require an action from the user.
56
+
57
+ ## Reduced motion
58
+
59
+ The indicator automatically follows the operating system's reduced-motion
60
+ preference. Web reads `prefers-reduced-motion`; mobile reacts to the iOS Reduce
61
+ Motion or Android Remove Animations setting.
93
62
 
94
- The legacy [Spinner](/components/Spinner) component remains available and
95
- unchanged. New code should prefer `ActivityIndicator`. A follow-up change is
96
- expected to deprecate `Spinner` in favour of `ActivityIndicator`.
63
+ With reduced motion enabled, the rotating and rocking layers are replaced by a
64
+ single static ring that gently pulses its opacity. This preserves the busy state
65
+ without rotational motion.
97
66
 
98
- ## Mobile
67
+ ## Cross-platform behavior
68
+
69
+ | Aspect | Web | Mobile |
70
+ | ---------------- | ----------------------- | --------------------------------------- |
71
+ | Sizes | 16px small, 32px base | 28px small, 44px base |
72
+ | Accessible label | `ariaLabel` | `accessibilityLabel` |
73
+ | Default label | Localized `"Loading"` | Localized `"Loading"` |
74
+ | Styling | `className` and `style` | `style` |
75
+ | Reduced motion | CSS media query | Operating-system setting via Reanimated |
76
+
77
+ ## Relationship to Spinner
99
78
 
100
- On mobile (`@jobber/components-native`), `ActivityIndicator` uses the
101
- [ActivityIndicator](https://reactnative.dev/docs/activityIndicator) core
102
- component from React Native.
79
+ The legacy [Spinner](/components/Spinner) remains available during migration but
80
+ is deprecated. New code should use `ActivityIndicator`.
103
81
 
104
82
  ## Mockup
105
83
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.115.2",
3
+ "version": "0.115.3",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -123,5 +123,5 @@
123
123
  "react-native-screens": ">=4.18.0",
124
124
  "react-native-svg": ">=12.0.0"
125
125
  },
126
- "gitHead": "b608e2db83fa37ba3ceaa2d8cd521a806853701c"
126
+ "gitHead": "b499bb6c3219b55c6de2614a8d83b44a4800980b"
127
127
  }
@@ -61,7 +61,7 @@ function useAnnounceOnMount(label) {
61
61
  * Renders the Material Design 3 three-layer indeterminate ring,
62
62
  * matching the visual identity of the web `ActivityIndicator` from
63
63
  * `@jobber/components`. For determinate progress, use
64
- * `ProgressIndicator` (forthcoming).
64
+ * `ProgressIndicator`.
65
65
  */
66
66
  export function ActivityIndicator({ size = "base", accessibilityLabel, style, testID = "ActivityIndicator", }) {
67
67
  const resolvedSize = resolveLegacySize(size);
@@ -121,7 +121,7 @@ function FullMotionRing({ size, pixelSize, strokeWidth, arcColor, trackColor, st
121
121
  }));
122
122
  const arcAnimatedProps = useAnimatedProps(() => {
123
123
  "worklet";
124
- // Match web's indicatorExpandArc keyframe:
124
+ // Follow the original Material indicator arc progression:
125
125
  // 0% → dasharray (1, 200), offset 0
126
126
  // 50% → dasharray (90, 200), offset -35
127
127
  // 100% → dasharray (90, 200), offset -125
@@ -163,8 +163,8 @@ function FullMotionRing({ size, pixelSize, strokeWidth, arcColor, trackColor, st
163
163
  function ReducedMotionRing({ pixelSize, strokeWidth, ringColor, style, testID, a11yProps, }) {
164
164
  // Reduced motion: hide rotation entirely, render one static ring in the
165
165
  // active foreground colour, and pulse opacity 1.0 ↔ 0.35 over a 4s
166
- // ease-in-out alternate cycle (2s down, 2s up). Matches web's
167
- // reduced-motion fallback exactly.
166
+ // ease-in-out alternate cycle (2s down, 2s up). This matches the web
167
+ // reduced-motion fallback's presentation and rhythm.
168
168
  //
169
169
  // CRITICAL: Reanimated 3 automatically suppresses `withTiming` /
170
170
  // `withRepeat` when the OS reduce-motion setting is enabled, snapping