@jobber/components-native 0.106.0 → 0.107.0
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 +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/ActivityIndicator/ActivityIndicator.stories.tsx +46 -1
- package/src/ActivityIndicator/ActivityIndicator.tsx +1 -1
- package/src/ActivityIndicator/guide.md +6 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.107.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"react-native-screens": ">=4.18.0",
|
|
125
125
|
"react-native-svg": ">=12.0.0"
|
|
126
126
|
},
|
|
127
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "5e02a8ecc5f282d152c92e18dde04a27d401ecf5"
|
|
128
128
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
2
3
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
3
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ActivityIndicator,
|
|
6
|
+
Text,
|
|
7
|
+
useAtlantisTheme,
|
|
8
|
+
} from "@jobber/components-native";
|
|
4
9
|
import { ActivityIndicatorBasicExample } from "./docs";
|
|
5
10
|
|
|
6
11
|
const meta = {
|
|
@@ -28,6 +33,46 @@ export const CustomAccessibilityLabel: Story = {
|
|
|
28
33
|
render: () => <ActivityIndicator accessibilityLabel="Uploading file" />,
|
|
29
34
|
};
|
|
30
35
|
|
|
36
|
+
/**
|
|
37
|
+
* The track ring uses `color-surface--active`, which is designed to read as
|
|
38
|
+
* a muted tint of the surface beneath it. This story renders the indicator
|
|
39
|
+
* on each of the standard application surfaces so the contrast between the
|
|
40
|
+
* track and its background can be reviewed at a glance.
|
|
41
|
+
*/
|
|
42
|
+
export const OnSurfaces: Story = {
|
|
43
|
+
render: () => <OnSurfacesExample />,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
function OnSurfacesExample() {
|
|
47
|
+
const { tokens } = useAtlantisTheme();
|
|
48
|
+
const surfaces = [
|
|
49
|
+
{ token: "color-surface", label: "surface" },
|
|
50
|
+
{ token: "color-surface--background", label: "surface--background" },
|
|
51
|
+
{
|
|
52
|
+
token: "color-surface--background--subtle",
|
|
53
|
+
label: "surface--background--subtle",
|
|
54
|
+
},
|
|
55
|
+
] as const;
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<View style={{ gap: tokens["space-base"] }}>
|
|
59
|
+
{surfaces.map(({ token, label }) => (
|
|
60
|
+
<View
|
|
61
|
+
key={token}
|
|
62
|
+
style={{
|
|
63
|
+
backgroundColor: tokens[token],
|
|
64
|
+
padding: tokens["space-large"],
|
|
65
|
+
gap: tokens["space-small"],
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<Text>{label}</Text>
|
|
69
|
+
<ActivityIndicator size="base" />
|
|
70
|
+
</View>
|
|
71
|
+
))}
|
|
72
|
+
</View>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
31
76
|
/**
|
|
32
77
|
* The reduced-motion presentation is driven by the OS-level
|
|
33
78
|
* "Reduce Motion" setting, not a Storybook control. To preview it:
|
|
@@ -146,7 +146,7 @@ export function ActivityIndicator({
|
|
|
146
146
|
pixelSize={pixelSize}
|
|
147
147
|
strokeWidth={strokeWidth}
|
|
148
148
|
arcColor={themeTokens["color-icon"]}
|
|
149
|
-
trackColor={themeTokens["color-
|
|
149
|
+
trackColor={themeTokens["color-surface--active"]}
|
|
150
150
|
style={style}
|
|
151
151
|
testID={testID}
|
|
152
152
|
a11yProps={a11yProps}
|
|
@@ -50,7 +50,7 @@ The previous wrapper accepted React Native's full `ActivityIndicatorProps` via
|
|
|
50
50
|
spread. The new public API drops the following intentionally:
|
|
51
51
|
|
|
52
52
|
- `color` — replaced by semantic theme tokens (`color-icon` for the arcs,
|
|
53
|
-
`color-
|
|
53
|
+
`color-surface--active` for the track). The single known consumer of
|
|
54
54
|
`color="white"` (`jobber-mobile/GalleryHeader`) is migrated as part of the
|
|
55
55
|
`migrate-activityindicator` change in the jobber-mobile repository.
|
|
56
56
|
- numeric `size` — sizing is constrained to the two design-system sizes (28px /
|
|
@@ -124,7 +124,9 @@ The three concurrent animations:
|
|
|
124
124
|
second arc renders 180° out of phase.
|
|
125
125
|
|
|
126
126
|
A static `<Circle>` of the same dimensions renders the track ring beneath the
|
|
127
|
-
active arcs, filled with `
|
|
127
|
+
active arcs, filled with `themeTokens["color-surface--active"]` so the track
|
|
128
|
+
adapts to whichever surface (`surface`, `surface--background`,
|
|
129
|
+
`surface--background--subtle`) the indicator is placed on.
|
|
128
130
|
|
|
129
131
|
The literal durations match Material Web's published progress motion spec; the
|
|
130
132
|
same values ship from `@jobber/design`'s `timing.tokens.json` to both web and
|
|
@@ -177,8 +179,8 @@ Both components share:
|
|
|
177
179
|
- Sizes (28 px small, 44 px base)
|
|
178
180
|
- Motion durations (`timing-indicator-arc`, `timing-indicator-cycle`,
|
|
179
181
|
`timing-indicator-linear-rotate`) from the same `@jobber/design` source
|
|
180
|
-
- Color tokens (`color-icon` for arcs, `color-
|
|
181
|
-
|
|
182
|
+
- Color tokens (`color-icon` for arcs, `color-surface--active` for track) from
|
|
183
|
+
the same `@jobber/design` source
|
|
182
184
|
- Reduced-motion fallback (opacity 1.0 ↔ 0.35, 2 s ease-in-out alternate)
|
|
183
185
|
|
|
184
186
|
Documented divergences:
|