@jobber/components 8.24.1 → 8.25.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.
@@ -1,5 +1,14 @@
1
1
  # Progress Bar
2
2
 
3
+ > **Deprecated.** Use [ProgressIndicator](../ProgressIndicator/ProgressIndicator.md) for new
4
+ > work. `ProgressIndicator` is the supported determinate progress indicator
5
+ > going forward — it offers the same semantic with a cleaner prop surface
6
+ > (`value` / `max` instead of `currentStep` / `totalSteps`,
7
+ > `variation="continuous"` instead of `"progress"`, plain `className` / `style`
8
+ > instead of `UNSAFE_*`), theme-adaptive tokens, and a unified
9
+ > `<div role="progressbar">` structure across continuous and stepped variations.
10
+ > `ProgressBar` continues to work unchanged for existing call sites.
11
+
3
12
  A ProgressBar is a visual indicator of how close something is to completion.
4
13
 
5
14
  ## Design & usage guidelines
@@ -0,0 +1,105 @@
1
+ # Progress Indicator
2
+
3
+ `ProgressIndicator` communicates **determinate** progress — a known fraction of
4
+ a task that has been completed. Use it when you can express progress as
5
+ `value / max`, such as a multi-step setup wizard or a file upload with a known
6
+ total size.
7
+
8
+ For indeterminate activity (loading time or fraction unknown), use
9
+ [ActivityIndicator](../ActivityIndicator/ActivityIndicator.md) instead.
10
+
11
+ Some great use cases for a `ProgressIndicator` include:
12
+
13
+ * Setup wizards, where we know how many steps the user has completed and how
14
+ many steps remain (use `variation="stepped"`).
15
+ * File uploads, where we know the total file size and how much data has already
16
+ been sent (use the default `variation="continuous"`).
17
+
18
+ ## Design & usage guidelines
19
+
20
+ The default `ProgressIndicator` size is `base` (16px tall) and can be used in
21
+ most cases. The `small` (8px) and `smaller` (4px) sizes should be used when the
22
+ indicator sits inline with text or in tight surface layouts.
23
+
24
+ `ProgressIndicator` always fills the width of its parent. Layout — including
25
+ inline-vs-block placement — is the consumer's responsibility. Wrap the indicator
26
+ with your own flex / `<Stack>` / `<Box>` container, or pass a `className` /
27
+ `style`, to control the surrounding layout.
28
+
29
+ ### Continuous vs. stepped
30
+
31
+ Use `variation="continuous"` (the default) when progress is a smooth value
32
+ between `0` and `max` — for example, a file upload where any percentage is
33
+ meaningful.
34
+
35
+ Use `variation="stepped"` when progress is naturally segmented — for example, a
36
+ multi-step wizard where the user is on step 2 of 5. Stepped renders `max`
37
+ discrete segments and fills the first `value` of them.
38
+
39
+ ## Accessibility
40
+
41
+ `ProgressIndicator` announces itself politely to assistive technology:
42
+
43
+ * `role="progressbar"` marks the root element as a progress bar.
44
+ * `aria-valuenow`, `aria-valuemin`, and `aria-valuemax` reflect the current
45
+ progress so screen readers can announce the value as a percentage or ratio
46
+ appropriately.
47
+ * `aria-label` defaults to a localized-as-English template: `"{value}%"` when
48
+ `max === 100` (or `max` is omitted), and `"{value} / {max}"` otherwise. Pass a
49
+ custom `ariaLabel` to localize or to describe the specific activity (e.g.
50
+ `ariaLabel="Uploading file"`).
51
+
52
+ In the stepped variation, the individual segments are presentational `<div>`s
53
+ with no `role` or `aria-*` attributes. The whole indicator announces once as a
54
+ single progressbar — the outer `aria-valuenow` / `aria-valuemax` already carry
55
+ the progress information.
56
+
57
+ The indicator does not participate in the keyboard tab order.
58
+
59
+ ### Reduced motion
60
+
61
+ The width transition between `value` updates is intentionally **preserved**
62
+ under
63
+ [`prefers-reduced-motion: reduce`](https://developer.mozilla.org/docs/Web/CSS/@media/prefers-reduced-motion).
64
+ The slide between progress values conveys functional information about progress,
65
+ direction, and magnitude — it is exempt under
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.
68
+
69
+ ## Relationship to ProgressBar
70
+
71
+ The legacy [ProgressBar](../ProgressBar/ProgressBar.md) component remains available
72
+ and unchanged. New code should prefer `ProgressIndicator`. A follow-up change is
73
+ expected to consolidate `ProgressBar` onto `ProgressIndicator`.
74
+
75
+ `ProgressIndicator` renames `ProgressBar`'s props to align with HTML5
76
+ `<progress>` semantics and mobile naming:
77
+
78
+ | `ProgressBar` (legacy) | `ProgressIndicator` (new) |
79
+ | ---------------------- | ------------------------- |
80
+ | `currentStep` | `value` |
81
+ | `totalSteps` | `max` |
82
+ | `variation="progress"` | `variation="continuous"` |
83
+ | `UNSAFE_className` | `className` |
84
+ | `UNSAFE_style` | `style` |
85
+
86
+ ## Mobile
87
+
88
+ Mobile (`@jobber/components-native`) has its own `ProgressBar` with a richer
89
+ API. The mobile `ProgressIndicator` counterpart is forthcoming as a separate
90
+ deliverable.
91
+
92
+
93
+ ## Props
94
+
95
+ ### Web
96
+
97
+ | Prop | Type | Required | Default | Description |
98
+ |------|------|----------|---------|-------------|
99
+ | `value` | `number` | Yes | — | Current progress. Expected to be in the range `0..max` inclusive. |
100
+ | `ariaLabel` | `string` | No | — | Accessible label exposed via `aria-label` on the root element. When omitted, defaults to `"{value}%"` when `max === 1... |
101
+ | `className` | `string` | No | — | Custom class name merged onto the root element alongside the component's own classes. |
102
+ | `max` | `number` | No | `100` | Maximum value. Pass `max={4}` with `value={2}` for "2 of 4 steps"; pass `value={75}` for "75%". |
103
+ | `size` | `"base" | "small" | "smaller"` | No | `base` | Visual size. `smaller` renders at 4px tall, `small` at 8px, `base` at 16px. |
104
+ | `style` | `CSSProperties` | No | — | Custom inline styles applied to the root element. |
105
+ | `variation` | `"continuous" | "stepped"` | No | `continuous` | Visual variation: - `continuous` renders a single fill bar driven by `value / max`. - `stepped` renders `max` segment... |
@@ -28,6 +28,7 @@
28
28
  [Datepicker](./Datepicker/Datepicker.md)
29
29
  [DatePickerNotes](./DatePickerNotes/DatePickerNotes.md)
30
30
  [DescriptionList](./DescriptionList/DescriptionList.md)
31
+ [Dialog](./Dialog/Dialog.md)
31
32
  [disabled-states](./disabled-states/disabled-states.md)
32
33
  [Disclosure](./Disclosure/Disclosure.md)
33
34
  [Divider](./Divider/Divider.md)
@@ -73,6 +74,7 @@
73
74
  [Popover](./Popover/Popover.md)
74
75
  [product-vocabulary](./product-vocabulary/product-vocabulary.md)
75
76
  [ProgressBar](./ProgressBar/ProgressBar.md)
77
+ [ProgressIndicator](./ProgressIndicator/ProgressIndicator.md)
76
78
  [Radii](./Radii/Radii.md)
77
79
  [RadioGroup](./RadioGroup/RadioGroup.md)
78
80
  [ResponsiveBreakpoint](./ResponsiveBreakpoint/ResponsiveBreakpoint.md)
package/dist/index.cjs CHANGED
@@ -70,6 +70,7 @@ var MultiSelect = require('./MultiSelect-cjs.js');
70
70
  var Page = require('./Page-cjs.js');
71
71
  var Popover = require('./Popover-cjs.js');
72
72
  var ProgressBar = require('./ProgressBar-cjs.js');
73
+ var ProgressIndicator = require('./ProgressIndicator-cjs.js');
73
74
  var RadioGroup = require('./RadioGroup-cjs.js');
74
75
  var ResponsiveSwitcher = require('./ResponsiveSwitcher-cjs.js');
75
76
  var LegacySelect = require('./LegacySelect-cjs.js');
@@ -316,6 +317,7 @@ exports.Popover = Popover.Popover;
316
317
  exports.usePopoverContext = Popover.usePopoverContext;
317
318
  exports.usePopoverStyles = Popover.usePopoverStyles;
318
319
  exports.ProgressBar = ProgressBar.ProgressBar;
320
+ exports.ProgressIndicator = ProgressIndicator.ProgressIndicator;
319
321
  exports.RadioGroup = RadioGroup.RadioGroup;
320
322
  exports.RadioOption = RadioGroup.RadioOption;
321
323
  exports.ResponsiveSwitcher = ResponsiveSwitcher.ResponsiveSwitcher;
package/dist/index.d.mts CHANGED
@@ -60,6 +60,7 @@ export * from "./MultiSelect";
60
60
  export * from "./Page";
61
61
  export * from "./Popover";
62
62
  export * from "./ProgressBar";
63
+ export * from "./ProgressIndicator";
63
64
  export * from "./RadioGroup";
64
65
  export * from "./ResponsiveSwitcher";
65
66
  export * from "./LegacySelect";
package/dist/index.d.ts CHANGED
@@ -60,6 +60,7 @@ export * from "./MultiSelect";
60
60
  export * from "./Page";
61
61
  export * from "./Popover";
62
62
  export * from "./ProgressBar";
63
+ export * from "./ProgressIndicator";
63
64
  export * from "./RadioGroup";
64
65
  export * from "./ResponsiveSwitcher";
65
66
  export * from "./LegacySelect";
package/dist/index.mjs CHANGED
@@ -68,6 +68,7 @@ export { M as MultiSelect } from './MultiSelect-es.js';
68
68
  export { P as Page } from './Page-es.js';
69
69
  export { P as Popover, u as usePopoverContext, a as usePopoverStyles } from './Popover-es.js';
70
70
  export { P as ProgressBar } from './ProgressBar-es.js';
71
+ export { P as ProgressIndicator } from './ProgressIndicator-es.js';
71
72
  export { R as RadioGroup, a as RadioOption } from './RadioGroup-es.js';
72
73
  export { R as ResponsiveSwitcher } from './ResponsiveSwitcher-es.js';
73
74
  export { L as LegacySelect, S as Option } from './LegacySelect-es.js';
package/dist/styles.css CHANGED
@@ -13104,6 +13104,107 @@ input.oOrjwubmsVA- {
13104
13104
  transform: rotate(-45deg);
13105
13105
  }
13106
13106
 
13107
+ /*
13108
+ * ProgressIndicator
13109
+ *
13110
+ * Determinate progress, rendered as a horizontal bar. The component supports
13111
+ * two variations:
13112
+ *
13113
+ * - `continuous` — a single fill element whose width is driven by the
13114
+ * CSS-registered custom property `--progress-indicator--fill-amount` (a <number> from
13115
+ * 0 to 100). The browser interpolates the number during a
13116
+ * `transition: width var(--timing-base) ease-out`.
13117
+ * - `stepped` — N presentational segment children, the first `value` of
13118
+ * which are filled. The outer shell is the flex container.
13119
+ *
13120
+ * Colour tokens mirror ActivityIndicator: fill / filled segments use
13121
+ * --color-interactive--subtle; track / empty segments use
13122
+ * --color-surface--active.
13123
+ *
13124
+ * The width transition is intentionally preserved under
13125
+ * prefers-reduced-motion: reduce because the slide between progress values
13126
+ * conveys functional information about progress (WCAG 2.3.3, "Animation from
13127
+ * Interactions"). Removing it would make progress harder to perceive, not
13128
+ * easier.
13129
+ */
13130
+
13131
+ /*
13132
+ * Register --progress-indicator--fill-amount so the browser knows it is a real <number>
13133
+ * and can interpolate between values during the width transition. Without
13134
+ * this @property declaration the custom property is treated as an opaque
13135
+ * string and the transition would snap rather than animate smoothly.
13136
+ */
13137
+
13138
+ @property --progress-indicator--fill-amount {
13139
+ syntax: "<number>";
13140
+ inherits: false;
13141
+ initial-value: 0;
13142
+ }
13143
+
13144
+ .-TBRV1VUsfc- {
13145
+ --progress-indicator--height: 16px;
13146
+
13147
+ width: 100%;
13148
+ height: 16px;
13149
+ height: var(--progress-indicator--height);
13150
+ }
13151
+
13152
+ .MStgN8AhV3s- {
13153
+ --progress-indicator--height: 4px;
13154
+ }
13155
+
13156
+ .iAlYWHjs6JQ- {
13157
+ --progress-indicator--height: 8px;
13158
+ }
13159
+
13160
+ .WWEzA1-OjSM- {
13161
+ --progress-indicator--height: 16px;
13162
+ }
13163
+
13164
+ /* Continuous: the indicator IS the track; the .fill child sits on top. */
13165
+
13166
+ .r9ShSj58V6w- {
13167
+ border-radius: calc(var(--progress-indicator--height) / 2);
13168
+ overflow: hidden;
13169
+ background-color: hsl(40, 9%, 85%);
13170
+ background-color: var(--color-surface--active);
13171
+ }
13172
+
13173
+ .Hsuq8zT-KzY- {
13174
+ width: calc(var(--progress-indicator--fill-amount) * 1%);
13175
+ height: 100%;
13176
+ border-radius: inherit;
13177
+ background-color: hsl(198, 35%, 21%);
13178
+ background-color: var(--color-interactive--subtle);
13179
+ transition: width 200ms ease-out;
13180
+ transition: width var(--timing-base) ease-out;
13181
+ }
13182
+
13183
+ /* Stepped: the indicator IS the flex container; segments are direct children. */
13184
+
13185
+ .FB1e9bL90tI- {
13186
+ display: -ms-flexbox;
13187
+ display: flex;
13188
+ -ms-flex-direction: row;
13189
+ flex-direction: row;
13190
+ gap: 8px;
13191
+ gap: var(--space-small);
13192
+ }
13193
+
13194
+ .bpLIiDGlsCs- {
13195
+ height: 100%;
13196
+ border-radius: calc(var(--progress-indicator--height) / 2);
13197
+ background-color: hsl(40, 9%, 85%);
13198
+ background-color: var(--color-surface--active);
13199
+ -ms-flex: 1 1 0px;
13200
+ flex: 1 1 0;
13201
+ }
13202
+
13203
+ .bpLIiDGlsCs-._0FxmImvY-04- {
13204
+ background-color: hsl(198, 35%, 21%);
13205
+ background-color: var(--color-interactive--subtle);
13206
+ }
13207
+
13107
13208
  .KZfSK2vhTyI- {
13108
13209
  --radio--checked-thickness: 6px;
13109
13210
  --radio-diameter: 20px;
@@ -203,6 +203,7 @@
203
203
  "Popover.DismissButton",
204
204
  "Popover.Provider",
205
205
  "ProgressBar",
206
+ "ProgressIndicator",
206
207
  "RadioGroup",
207
208
  "RadioOption",
208
209
  "ResponsiveSwitcher",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "8.24.1",
3
+ "version": "8.25.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -155,6 +155,11 @@
155
155
  "import": "./dist/DescriptionList/index.mjs",
156
156
  "require": "./dist/DescriptionList/index.cjs"
157
157
  },
158
+ "./Dialog": {
159
+ "types": "./dist/Dialog/index.d.ts",
160
+ "import": "./dist/Dialog/index.mjs",
161
+ "require": "./dist/Dialog/index.cjs"
162
+ },
158
163
  "./Disclosure": {
159
164
  "types": "./dist/Disclosure/index.d.ts",
160
165
  "import": "./dist/Disclosure/index.mjs",
@@ -540,5 +545,5 @@
540
545
  "> 1%",
541
546
  "IE 10"
542
547
  ],
543
- "gitHead": "b17211eb3d332daef1d38c66b5677c30598331f3"
548
+ "gitHead": "1ad8858948625e5d646ba969560948576dc5e721"
544
549
  }