@jobber/components 9.16.3 → 9.16.5
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/ActivityIndicator/ActivityIndicator.d.ts +4 -3
- package/dist/ActivityIndicator-cjs.js +1 -1
- package/dist/ActivityIndicator-es.js +1 -1
- package/dist/docs/ActivityIndicator/ActivityIndicator.md +53 -75
- package/dist/docs/Banner/Banner.md +7 -0
- package/dist/docs/ProgressIndicator/ProgressIndicator.md +3 -6
- package/dist/styles.css +8 -5
- package/package.json +2 -2
|
@@ -8,8 +8,9 @@ export interface ActivityIndicatorProps {
|
|
|
8
8
|
*/
|
|
9
9
|
readonly size?: "small" | "base";
|
|
10
10
|
/**
|
|
11
|
-
* Accessible label exposed via `aria-label` on the root element.
|
|
12
|
-
* to
|
|
11
|
+
* Accessible label exposed via `aria-label` on the root element. Defaults
|
|
12
|
+
* to the localized "Loading" message. Override it to describe the specific
|
|
13
|
+
* activity (e.g. "Uploading file").
|
|
13
14
|
*
|
|
14
15
|
* @default "Loading"
|
|
15
16
|
*/
|
|
@@ -30,7 +31,7 @@ export interface ActivityIndicatorProps {
|
|
|
30
31
|
* external system.
|
|
31
32
|
*
|
|
32
33
|
* For determinate progress (a known fraction completed), use
|
|
33
|
-
* `ProgressIndicator` instead
|
|
34
|
+
* `ProgressIndicator` instead.
|
|
34
35
|
*
|
|
35
36
|
* For now, the legacy `Spinner` component also remains available; new code
|
|
36
37
|
* should prefer `ActivityIndicator`.
|
|
@@ -14,7 +14,7 @@ var styles = {"indicator":"YST686vLR3c-","screenReaderOnly":"MmNHh-oCyxc-","smal
|
|
|
14
14
|
* external system.
|
|
15
15
|
*
|
|
16
16
|
* For determinate progress (a known fraction completed), use
|
|
17
|
-
* `ProgressIndicator` instead
|
|
17
|
+
* `ProgressIndicator` instead.
|
|
18
18
|
*
|
|
19
19
|
* For now, the legacy `Spinner` component also remains available; new code
|
|
20
20
|
* should prefer `ActivityIndicator`.
|
|
@@ -12,7 +12,7 @@ var styles = {"indicator":"YST686vLR3c-","screenReaderOnly":"MmNHh-oCyxc-","smal
|
|
|
12
12
|
* external system.
|
|
13
13
|
*
|
|
14
14
|
* For determinate progress (a known fraction completed), use
|
|
15
|
-
* `ProgressIndicator` instead
|
|
15
|
+
* `ProgressIndicator` instead.
|
|
16
16
|
*
|
|
17
17
|
* For now, the legacy `Spinner` component also remains available; new code
|
|
18
18
|
* should prefer `ActivityIndicator`.
|
|
@@ -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.
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
20
|
-
`inline` prop. Place it inside your own flex / inline-block container, or pass a
|
|
21
|
-
`style`, to control surrounding layout.
|
|
22
|
-
|
|
23
|
-
## Accessibility
|
|
24
|
-
|
|
25
|
-
`ActivityIndicator` announces itself to assistive technology on every platform:
|
|
16
|
+
### Web
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
57
|
-
|
|
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
|
-
|
|
24
|
+
### Mobile
|
|
62
25
|
|
|
63
|
-
The default `
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
69
|
-
`
|
|
70
|
-
|
|
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
|
-
|
|
36
|
+
### Web
|
|
75
37
|
|
|
76
|
-
* `role="status"`
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
###
|
|
45
|
+
### Mobile
|
|
85
46
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
component from React Native.
|
|
79
|
+
The legacy [Spinner](../Spinner/Spinner.md) remains available during migration but
|
|
80
|
+
is deprecated. New code should use `ActivityIndicator`.
|
|
103
81
|
|
|
104
82
|
## Mockup
|
|
105
83
|
|
|
@@ -110,7 +88,7 @@ component from React Native.
|
|
|
110
88
|
|
|
111
89
|
| Prop | Type | Required | Default | Description |
|
|
112
90
|
|------|------|----------|---------|-------------|
|
|
113
|
-
| `ariaLabel` | `string` | No | `"Loading"` | Accessible label exposed via `aria-label` on the root element.
|
|
91
|
+
| `ariaLabel` | `string` | No | `"Loading"` | Accessible label exposed via `aria-label` on the root element. Defaults to the localized "Loading" message. Override ... |
|
|
114
92
|
| `className` | `string` | No | — | Custom class name merged onto the root element alongside the component's own classes. |
|
|
115
93
|
| `size` | `"base" | "small"` | No | `base` | Visual size. `base` renders at 32px, `small` renders at 16px. |
|
|
116
94
|
| `style` | `CSSProperties` | No | — | Custom inline styles applied to the root element. |
|
|
@@ -166,6 +166,13 @@ See
|
|
|
166
166
|
[Actions in Banners](/storybook/mobile/?path=/story/components-status-and-feedback-banner--actions-in-banners)
|
|
167
167
|
for an example.
|
|
168
168
|
|
|
169
|
+
### Dismissal (mobile)
|
|
170
|
+
|
|
171
|
+
Set `dismissible` to render a dismiss button in the top-right corner of the
|
|
172
|
+
Banner. The dismiss button hides the Banner and calls `onDismiss` when pressed.
|
|
173
|
+
If the Banner also has an `action`, pressing the dismiss button does not trigger
|
|
174
|
+
the action.
|
|
175
|
+
|
|
169
176
|
## Component customization
|
|
170
177
|
|
|
171
178
|
### Composable usage
|
|
@@ -58,13 +58,10 @@ The indicator does not participate in the keyboard tab order.
|
|
|
58
58
|
|
|
59
59
|
### Reduced motion
|
|
60
60
|
|
|
61
|
-
The width transition between `value` updates is
|
|
62
|
-
under
|
|
61
|
+
The width transition between `value` updates is disabled under
|
|
63
62
|
[`prefers-reduced-motion: reduce`](https://developer.mozilla.org/docs/Web/CSS/@media/prefers-reduced-motion).
|
|
64
|
-
The
|
|
65
|
-
|
|
66
|
-
[WCAG 2.3.3 ("Animation from Interactions")](https://www.w3.org/WAI/WCAG21/Understanding/animation-from-interactions.html).
|
|
67
|
-
Removing the transition would make progress harder to perceive, not easier.
|
|
63
|
+
The fill updates immediately to the new value, so current progress remains
|
|
64
|
+
visible without interpolation. The stepped variation does not animate.
|
|
68
65
|
|
|
69
66
|
## Relationship to ProgressBar
|
|
70
67
|
|
package/dist/styles.css
CHANGED
|
@@ -15046,11 +15046,8 @@ input.oOrjwubmsVA- {
|
|
|
15046
15046
|
* --color-interactive--subtle; track / empty segments use
|
|
15047
15047
|
* --color-surface--active.
|
|
15048
15048
|
*
|
|
15049
|
-
* The width transition is
|
|
15050
|
-
*
|
|
15051
|
-
* conveys functional information about progress (WCAG 2.3.3, "Animation from
|
|
15052
|
-
* Interactions"). Removing it would make progress harder to perceive, not
|
|
15053
|
-
* easier.
|
|
15049
|
+
* The width transition is disabled when the user prefers reduced motion. The
|
|
15050
|
+
* fill still updates to the current value without interpolating between values.
|
|
15054
15051
|
*/
|
|
15055
15052
|
|
|
15056
15053
|
/*
|
|
@@ -15103,6 +15100,12 @@ input.oOrjwubmsVA- {
|
|
|
15103
15100
|
transition: width var(--timing-base) ease-out;
|
|
15104
15101
|
}
|
|
15105
15102
|
|
|
15103
|
+
@media (prefers-reduced-motion: reduce) {
|
|
15104
|
+
.Hsuq8zT-KzY- {
|
|
15105
|
+
transition: none;
|
|
15106
|
+
}
|
|
15107
|
+
}
|
|
15108
|
+
|
|
15106
15109
|
/* Stepped: the indicator IS the flex container; segments are direct children. */
|
|
15107
15110
|
.FB1e9bL90tI- {
|
|
15108
15111
|
display: -ms-flexbox;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "9.16.
|
|
3
|
+
"version": "9.16.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -553,5 +553,5 @@
|
|
|
553
553
|
"> 1%",
|
|
554
554
|
"IE 10"
|
|
555
555
|
],
|
|
556
|
-
"gitHead": "
|
|
556
|
+
"gitHead": "b499bb6c3219b55c6de2614a8d83b44a4800980b"
|
|
557
557
|
}
|