@dloizides/ui-feedback 1.15.1 → 1.16.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/CHANGELOG.md +228 -209
- package/dist/index.d.mts +85 -1
- package/dist/index.d.ts +85 -1
- package/dist/index.js +243 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +236 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,209 +1,228 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 1.
|
|
4
|
-
|
|
5
|
-
- **
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
`
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
(
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
`
|
|
67
|
-
- **
|
|
68
|
-
`
|
|
69
|
-
- **
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
- **
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
`
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
`
|
|
179
|
-
preserving existing
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.16.0
|
|
4
|
+
|
|
5
|
+
- **New `LiveRunCard`** (JOBS-LAYOUT-1 "Live run card above the table", owner decision D-JOBS-LAYOUT-1): a
|
|
6
|
+
presentational card for one active run - status pill, title, started/elapsed line, current step,
|
|
7
|
+
`ProgressBar` with an app-supplied caption, one chip per step group (done / running / pending / failed),
|
|
8
|
+
and step-time bars scaled to the longest step with the shorter ones behind "+N shorter steps". Below
|
|
9
|
+
`LIVE_RUN_CARD_COMPACT_MAX_PX` (640) it renders compact: finished groups fold into one chip and step
|
|
10
|
+
timings sit behind a toggle. Optional Cancel. Every button and tappable chip is 48px
|
|
11
|
+
(`MIN_TOUCH_TARGET_PX`); colours come from the UiProvider theme; all text comes from the `labels` prop.
|
|
12
|
+
- **Pure helpers** `mergeRunSteps` (flat steps to groups in first-seen order, 0s done rows dropped, group
|
|
13
|
+
time summed, worst state wins), `splitShorterSteps`, `defaultGroupId`, `summariseDoneGroups`,
|
|
14
|
+
`barFraction`, `progressPercent`, `runToneColor`.
|
|
15
|
+
|
|
16
|
+
## 1.15.2
|
|
17
|
+
|
|
18
|
+
- **ErrorState buttons take the kit hit-target floor from `@dloizides/a11y`** (`MIN_TOUCH_TARGET_PX`,
|
|
19
|
+
48px) instead of a local 44px constant, matching `ui-buttons`. `@dloizides/a11y` is now a dependency
|
|
20
|
+
(JOBS-LIVE-1 "Live job updates").
|
|
21
|
+
|
|
22
|
+
## 1.15.1
|
|
23
|
+
|
|
24
|
+
- **ErrorState retry and secondary buttons now have a 44px minimum height** (`MIN_TOUCH_TARGET`),
|
|
25
|
+
content centred. Padding alone rendered them 34px tall, below the mobile-first hit-box standard
|
|
26
|
+
(JOBS-LIVE-1 "Live job updates").
|
|
27
|
+
|
|
28
|
+
## 1.15.0
|
|
29
|
+
|
|
30
|
+
- **New `ProgressBar`** (promoted from aml-v2 `JobProgressBar`, RUPEP-5 "Upload a RuPEP file from the
|
|
31
|
+
Jobs tab"): determinate fill clamped to 0-100 (`clampPercent`, also exported) with an optional
|
|
32
|
+
right-aligned caption, or an indeterminate scanning bar. `role="progressbar"` with
|
|
33
|
+
`aria-valuemin/max/now/text` (`aria-valuenow` omitted and `aria-busy` set when indeterminate).
|
|
34
|
+
Colours default to the UiProvider theme (`palette.primary.500`, `colors.border`,
|
|
35
|
+
`colors.textSecondary`) and accept overrides. Default testID `progress-bar`, fill `<testID>-fill`.
|
|
36
|
+
|
|
37
|
+
## 1.14.0
|
|
38
|
+
|
|
39
|
+
- **`ToastHost` portals to `document.body` on web (`position: fixed`, `Z_INDEX.toast`).** In-tree,
|
|
40
|
+
the layer sat inside RN-web Views that each carry `position: relative; z-index: 0`, so its 10100
|
|
41
|
+
was trapped and an open `ConfirmDialog` / RN `Modal` (9999, body-level) painted over the toast
|
|
42
|
+
(measured on ui.dloizides.com/feedback: `elementFromPoint` at the toast centre returned the
|
|
43
|
+
dialog). Same mechanism as `ui-forms` `menuPortal` and `ui-tables` `SizeDropdown`. Native is
|
|
44
|
+
unchanged (in-tree). `react-dom` is now an optional peer dependency.
|
|
45
|
+
|
|
46
|
+
## 1.13.0
|
|
47
|
+
|
|
48
|
+
Overlay stacking now comes from the shared `@dloizides/design-tokens` `Z_INDEX` scale
|
|
49
|
+
(added as a dependency, `^1.13.0`) instead of local literals.
|
|
50
|
+
|
|
51
|
+
- **`ToastHost` layer: 9999 -> `Z_INDEX.toast` (10100).** A toast now paints above an open
|
|
52
|
+
portalled menu (`Z_INDEX.popover`, 10000) and above an RN-web `Modal` (9999). At 9999 an open
|
|
53
|
+
dropdown covered the toast. Pinned by a `ToastHost.test.tsx` case that reads the computed
|
|
54
|
+
`z-index` of the toast layer.
|
|
55
|
+
- **`WarmingOverlay`: literal 100000 -> `Z_INDEX.blocking`.** Same value, so nothing changes visually.
|
|
56
|
+
|
|
57
|
+
## 1.12.0
|
|
58
|
+
|
|
59
|
+
Opt-in additions to `ErrorState` for full-screen error surfaces (an import-error or
|
|
60
|
+
load-error screen that needs a heading, an icon and a way out other than retry). Every
|
|
61
|
+
prop is optional: a caller passing none of them renders the same element tree as 1.11.0,
|
|
62
|
+
pinned by `ErrorState.test.tsx` baseline snapshots recorded before the change.
|
|
63
|
+
|
|
64
|
+
- **Add `title?: string`** — rendered above the message with `accessibilityRole="header"`
|
|
65
|
+
(`role="heading"` on web), testID `${testID}-title`. When a title is present the message
|
|
66
|
+
uses `theme.colors.textSecondary` instead of the error colour.
|
|
67
|
+
- **Add `icon?: React.ReactNode`** — rendered inside a circular well tinted with
|
|
68
|
+
`theme.semantic.error['500']` at low opacity; the well is `aria-hidden`, testID `${testID}-icon`.
|
|
69
|
+
- **Add `secondaryAction?: ErrorStateAction`** (`{ label, hint, onPress, testID }`) — an
|
|
70
|
+
outline button (`theme.colors.border`) laid out in a row beside retry.
|
|
71
|
+
- **Export type `ErrorStateAction`.** No new colour literals; no new dependencies.
|
|
72
|
+
|
|
73
|
+
## 1.11.0
|
|
74
|
+
|
|
75
|
+
Adopts `@dloizides/ui-motion` for `PageSkeleton`: the loader now shows a moving
|
|
76
|
+
**shimmer** (a highlight band sweeping across each block) instead of an opacity pulse,
|
|
77
|
+
so loading states read as modern/ant-design-like. There is now ONE shimmer
|
|
78
|
+
implementation in the kit — the ui-motion `<Skeleton>` primitive — and `PageSkeleton`
|
|
79
|
+
owns only the page LAYOUT (how many bars/blocks, their sizes and spacing).
|
|
80
|
+
|
|
81
|
+
- **Add runtime dependency `@dloizides/ui-motion` (`^1.0.1`).**
|
|
82
|
+
- **`PageSkeleton` internals reimplemented on ui-motion `<Skeleton>`.** Each placeholder
|
|
83
|
+
block (header bar, list-row avatar + text lines, card) is now a `<Skeleton>` with the
|
|
84
|
+
same `width`/`height`/`borderRadius`/base colour it had before. The bespoke
|
|
85
|
+
`Animated.loop` opacity pulse (and its `Animated`/`Easing`/`Platform` imports) is gone.
|
|
86
|
+
- **Reduced-motion is now handled by `<Skeleton>`** (via `@dloizides/rn-web-hooks`
|
|
87
|
+
`useReducedMotion`): the sweep is suppressed and a static block is shown.
|
|
88
|
+
- **Public API unchanged.** `PageSkeletonProps` (`rows`, `showHeader`, `variant`), the
|
|
89
|
+
rendered layout, and the `page-skeleton` testID are identical to 1.9.0. Only the
|
|
90
|
+
internal animated primitive was swapped.
|
|
91
|
+
- `ToastHost` (fade+slide) is intentionally left as-is — it remains the reference
|
|
92
|
+
enter/exit pattern.
|
|
93
|
+
|
|
94
|
+
## 1.7.0
|
|
95
|
+
|
|
96
|
+
Closes the API gap that kept `kefi-web`, `erevna-web` and `katalogos-web` on their
|
|
97
|
+
local `ErrorBoundary` copies. Those three vary the boundary **by error class** — a
|
|
98
|
+
stale-chunk failure after a deploy needs different wording, no retry button, and no
|
|
99
|
+
stack dump — which 1.6.0's static `labels` / boolean `showDetails` could not express.
|
|
100
|
+
Every addition is opt-in; the pre-1.7.0 test suite passes unmodified.
|
|
101
|
+
|
|
102
|
+
**The kit still does not know what a "chunk" is.** Apps inject the classification;
|
|
103
|
+
the boundary only learns *whether retry is meaningful* and *what to say*.
|
|
104
|
+
|
|
105
|
+
- **Add `retryable?: (error) => boolean`.** When it returns `false` the retry action is
|
|
106
|
+
not rendered at all. Offering a button that re-renders straight back into the same
|
|
107
|
+
missing chunk is worse than offering nothing. Default: every error is retryable
|
|
108
|
+
(1.6.0 behaviour).
|
|
109
|
+
- **Add `labelsFor?: (error) => Partial<ErrorBoundaryLabels>`,** merged OVER the static
|
|
110
|
+
`labels`. Lets an app say "Update available" for a stale chunk without the kit knowing
|
|
111
|
+
why — it sees only the resulting strings.
|
|
112
|
+
- **Widen `showDetails` to `boolean | ((error) => boolean)`.** A predicate can suppress
|
|
113
|
+
the dev-only block per error class (a hashed filename is noise, not signal). **A plain
|
|
114
|
+
boolean behaves exactly as before.**
|
|
115
|
+
- **Add `onMount?: () => void`,** called from `componentDidMount` ONLY when the mount was
|
|
116
|
+
clean. The three apps release their one-shot reload guard here: a clean mount proves the
|
|
117
|
+
current chunks loaded, so a FUTURE deploy may auto-recover again. Deliberately not called
|
|
118
|
+
on an errored mount — that would re-arm the guard during the very failure it bounds.
|
|
119
|
+
- **Add `reloadIsPrimary?: boolean`** (default `false`). Gives Reload the filled emphasis
|
|
120
|
+
and the first position instead of Try Again.
|
|
121
|
+
|
|
122
|
+
**Why a flag rather than an unconditional swap:** `agora-web` and `zygos-web` both pass
|
|
123
|
+
`onReload`, so simply inverting the priority would have silently restyled and reordered
|
|
124
|
+
their error screens too. They have no chunk-recovery path, so retry is still the right
|
|
125
|
+
primary there. The default preserves their rendering exactly; the three chunk-aware apps
|
|
126
|
+
opt in.
|
|
127
|
+
|
|
128
|
+
**Notably, `DEFAULT_ERROR_BOUNDARY_LABELS` gains no `updateTitle`/`updateMessage`.** Those
|
|
129
|
+
are domain vocabulary — "an update is available" is a fact about the app's deploy model, not
|
|
130
|
+
about error boundaries. `labelsFor` supplies them as ordinary `title`/`message` overrides,
|
|
131
|
+
which keeps the kit's label bag domain-free.
|
|
132
|
+
|
|
133
|
+
### Fixed
|
|
134
|
+
|
|
135
|
+
- **`AppErrorBoundary.test.tsx` had never actually run.** `jest.setup.ts` imports
|
|
136
|
+
`@testing-library/jest-dom`, which registers matchers at runtime, but `tsconfig.test.json`
|
|
137
|
+
listed no `types`, so ts-jest failed every `toBeInTheDocument()` with TS2339 and aborted the
|
|
138
|
+
whole suite at compile time. It was the only suite using those matchers, so `npm test`
|
|
139
|
+
reported a red SUITE while the other five stayed green and the true test count read 34.
|
|
140
|
+
Adding `"types": ["jest", "node", "@testing-library/jest-dom"]` brings its 14 assertions
|
|
141
|
+
online for the first time — unmodified, and passing against the 1.7.0 source.
|
|
142
|
+
|
|
143
|
+
## 1.6.0
|
|
144
|
+
|
|
145
|
+
Two fleet-wide duplicates extracted (W1.2 + W1.3). Both are purely additive — every
|
|
146
|
+
existing export is unchanged.
|
|
147
|
+
|
|
148
|
+
- **Add `createToastBus()` — the shared toast EMIT half (W1.2).** Promoted from the three
|
|
149
|
+
hand-rolled ~25-line twins in `aml-v2` (`components/toast.ts` — `emitToast`/`subscribeToasts`),
|
|
150
|
+
`agora-web` and `zygos-web` (`lib/toastBus.ts` — `toastSuccess`/`toastError`). The returned
|
|
151
|
+
bus is a superset: `subscribe` (the `<ToastHost>` port), `emit(text, type?)`, and the
|
|
152
|
+
`success`/`error`/`info` shorthands.
|
|
153
|
+
|
|
154
|
+
**Deliberately framework-agnostic — no React import, no hook, no provider.** Call sites are
|
|
155
|
+
React Query mutation `onSuccess`/`onError` callbacks with no component context in scope, so a
|
|
156
|
+
hook-based API would break every one of them. It carries no styling: `<ToastHost>` themes each
|
|
157
|
+
toast from `UiProvider`. Text passed in is already localized by the caller.
|
|
158
|
+
|
|
159
|
+
New exports: `createToastBus`, `ToastBus`, `ToastPush`.
|
|
160
|
+
|
|
161
|
+
- **Add `<AppErrorBoundary>` — the shared top-level error boundary (W1.3).** Promoted from the
|
|
162
|
+
SIX app-local copies (`agora-web` + `zygos-web` byte-identical, `kefi-web`, `erevna-web`,
|
|
163
|
+
`katalogos-web`, `ichnos-web`); `aml-v2` had none at all. The axes that actually varied are now
|
|
164
|
+
injected rather than baked in: `onError` (Sentry/logger), `recover` (the apps' chunk-load
|
|
165
|
+
retry), `showDetails` (dev-only error text), `labels` (pre-localized bag), `testIDPrefix`,
|
|
166
|
+
and `fallback` (escape hatch). An optional `onReload` renders the manual **Reload** action
|
|
167
|
+
that kefi/erevna/katalogos shipped alongside **Try Again**.
|
|
168
|
+
|
|
169
|
+
Two behaviour fixes come with the extraction:
|
|
170
|
+
- **Themed.** The fallback renders through the shared `<ErrorState>`, so it reads
|
|
171
|
+
`UiProvider` colours — this removes the 40+ hardcoded Bootstrap-4 hex literals
|
|
172
|
+
(`#f8f9fa`, `#212529`, `#6c757d`, `#fff3cd`, `#856404`, `#007bff`, …) three copies carried.
|
|
173
|
+
- **Announced.** The fallback ships `role="alert"` + `accessibilityLiveRegion="assertive"`;
|
|
174
|
+
none of the six announced anything to a screen reader, and agora/zygos rendered only the
|
|
175
|
+
app *name* with no message and no retry.
|
|
176
|
+
|
|
177
|
+
New exports: `AppErrorBoundary`, `AppErrorBoundaryProps`, `ErrorFallbackState`,
|
|
178
|
+
`ErrorBoundaryLabels`, `DEFAULT_ERROR_BOUNDARY_LABELS`, plus the `errorBoundary` id in
|
|
179
|
+
`FEEDBACK_TEST_IDS` (default prefix `error-boundary`, preserving the existing
|
|
180
|
+
`error-boundary-retry-button` / `-reload-button` / `-updating` Playwright selectors).
|
|
181
|
+
|
|
182
|
+
## 1.5.0
|
|
183
|
+
|
|
184
|
+
- **Accessibility (WCAG 2.1 AA) — `ToastHost` announcements.** Each toast is now a live region so
|
|
185
|
+
a screen reader announces it (WCAG 4.1.3): success/info toasts render as `role="status"` with
|
|
186
|
+
`aria-live="polite"`, error toasts escalate to `role="alert"` with `aria-live="assertive"`
|
|
187
|
+
(`accessibilityLiveRegion` set for native parity). Rendering, timing and testIDs are unchanged —
|
|
188
|
+
additive + backward-compatible.
|
|
189
|
+
|
|
190
|
+
## 1.3.0
|
|
191
|
+
|
|
192
|
+
- Add `ToastHost` — the shared, tokenized transient-toast overlay promoted from the
|
|
193
|
+
byte-identical erevna-web / katalogos-web `ToastContainer` twins. Rendering (animated
|
|
194
|
+
fade, positioning, theming) lives here; the emit pipeline stays in the app and is wired
|
|
195
|
+
in via the `subscribe` port (`(push) => unsubscribe`). Colours come from the UiProvider
|
|
196
|
+
theme. New exports: `ToastHost`, `ToastHostProps`, `ToastInput`, `ToastType`, plus the
|
|
197
|
+
`notificationToast` id in `FEEDBACK_TEST_IDS` (default toast testID `notification-toast`,
|
|
198
|
+
preserving existing Playwright selectors).
|
|
199
|
+
|
|
200
|
+
## 1.2.0
|
|
201
|
+
|
|
202
|
+
- Broaden the injected theme so the settings-hub kit can consume it: colour scales are now
|
|
203
|
+
addressable at any step (`[step]`), and `palette`/`semantic` accept named scales beyond
|
|
204
|
+
`primary`/`error` (e.g. `secondary`, `accent`, `success`, `warning`, `info`) via index signatures.
|
|
205
|
+
Purely additive — existing `{primary}`/`{error}` themes still satisfy the types. Default value now
|
|
206
|
+
includes the common extra scales so no-provider rendering never reads `undefined`.
|
|
207
|
+
|
|
208
|
+
## 1.1.0
|
|
209
|
+
|
|
210
|
+
- Add `colors.surface` to the injected theme (needed by the ui-forms kit; apps already pass it).
|
|
211
|
+
- Export neutral aliases `UiProvider` / `useUi` (+ `Ui*` types) for the feedback-specific
|
|
212
|
+
`FeedbackUiProvider` / `useFeedbackUi`. ui-feedback is now the shared UI context for the kit;
|
|
213
|
+
sibling packages (ui-forms, ui-tables, …) consume `useUi` instead of duplicating the provider.
|
|
214
|
+
|
|
215
|
+
## 1.0.2
|
|
216
|
+
|
|
217
|
+
- `useFeedbackUi` now falls back to a neutral default theme + identity translate when no
|
|
218
|
+
`FeedbackUiProvider` is mounted (graceful degradation), instead of throwing. Apps still
|
|
219
|
+
mount a provider for the real theme/i18n; isolated tests render without one.
|
|
220
|
+
|
|
221
|
+
## 1.0.0
|
|
222
|
+
|
|
223
|
+
Initial release. Extracted the proven duplicated feedback components from erevna-web ↔
|
|
224
|
+
katalogos-web (Capability Wave C1, batch 1).
|
|
225
|
+
|
|
226
|
+
- `FeedbackUiProvider` + `useFeedbackUi` — injectable theme/translate/navigate context.
|
|
227
|
+
- `ErrorState`, `EmptyListState`, `LoadingFallback`, `PageSkeleton`, `ConfirmDialog`.
|
|
228
|
+
- `FEEDBACK_TEST_IDS`, `MODAL_OVERLAY_COLOR`, `DISABLED_OPACITY` constants.
|
package/dist/index.d.mts
CHANGED
|
@@ -560,4 +560,88 @@ declare function ProgressBar(props: ProgressBarProps): React.ReactElement;
|
|
|
560
560
|
/** Clamps a possibly missing or non-finite percent into the 0-100 range. */
|
|
561
561
|
declare function clampPercent(value: number | null | undefined): number;
|
|
562
562
|
|
|
563
|
-
|
|
563
|
+
type RunStepState = 'done' | 'running' | 'pending' | 'failed';
|
|
564
|
+
interface RunStep {
|
|
565
|
+
label: string;
|
|
566
|
+
durationSec: number;
|
|
567
|
+
state: RunStepState;
|
|
568
|
+
}
|
|
569
|
+
interface RunGroup {
|
|
570
|
+
id: string;
|
|
571
|
+
label: string;
|
|
572
|
+
state: RunStepState;
|
|
573
|
+
durationSec: number;
|
|
574
|
+
steps: RunStep[];
|
|
575
|
+
}
|
|
576
|
+
interface FlatRunStep extends RunStep {
|
|
577
|
+
groupId: string;
|
|
578
|
+
groupLabel: string;
|
|
579
|
+
}
|
|
580
|
+
interface StepSplit {
|
|
581
|
+
visible: RunStep[];
|
|
582
|
+
hiddenCount: number;
|
|
583
|
+
}
|
|
584
|
+
interface DoneSummary {
|
|
585
|
+
count: number;
|
|
586
|
+
durationSec: number;
|
|
587
|
+
}
|
|
588
|
+
/** Folds flat steps into groups in first-seen order: sums each group's time, drops 0s done rows, worst state wins. */
|
|
589
|
+
declare function mergeRunSteps(flat: readonly FlatRunStep[]): RunGroup[];
|
|
590
|
+
/** Keeps the `keep` longest steps (and any running one) in their original order; counts the rest. */
|
|
591
|
+
declare function splitShorterSteps(steps: readonly RunStep[], keep: number): StepSplit;
|
|
592
|
+
/** The group whose steps show first: the running one, else a failed one, else the last. */
|
|
593
|
+
declare function defaultGroupId(groups: readonly RunGroup[]): string | null;
|
|
594
|
+
/** How many groups finished and their total time, for the compact one-chip summary. */
|
|
595
|
+
declare function summariseDoneGroups(groups: readonly RunGroup[]): DoneSummary;
|
|
596
|
+
/** A step bar's width as a 0-1 fraction of the longest step; a non-zero step never draws invisibly thin. */
|
|
597
|
+
declare function barFraction(durationSec: number, maxSec: number): number;
|
|
598
|
+
/** 0-100 from done/total, or null when the total is unknown. */
|
|
599
|
+
declare function progressPercent(progress: {
|
|
600
|
+
done: number;
|
|
601
|
+
total: number;
|
|
602
|
+
} | null | undefined): number | null;
|
|
603
|
+
|
|
604
|
+
interface LiveRunCardLabels {
|
|
605
|
+
status: string;
|
|
606
|
+
meta: string;
|
|
607
|
+
progress?: string;
|
|
608
|
+
progressA11y: string;
|
|
609
|
+
cancel: string;
|
|
610
|
+
cancelHint: string;
|
|
611
|
+
stepTimings: string;
|
|
612
|
+
stepTimingsHint: string;
|
|
613
|
+
groupHint: string;
|
|
614
|
+
moreStepsHint: string;
|
|
615
|
+
fewerSteps: string;
|
|
616
|
+
formatDuration: (sec: number) => string;
|
|
617
|
+
moreSteps: (count: number) => string;
|
|
618
|
+
doneSummary: (count: number, duration: string) => string;
|
|
619
|
+
groupA11y: (label: string, state: RunStepState, duration: string) => string;
|
|
620
|
+
stepA11y: (label: string, duration: string) => string;
|
|
621
|
+
}
|
|
622
|
+
interface LiveRunCardProps {
|
|
623
|
+
title: string;
|
|
624
|
+
status?: RunStepState;
|
|
625
|
+
currentStep?: string | null;
|
|
626
|
+
progress?: {
|
|
627
|
+
done: number;
|
|
628
|
+
total: number;
|
|
629
|
+
} | null;
|
|
630
|
+
groups: readonly RunGroup[];
|
|
631
|
+
labels: LiveRunCardLabels;
|
|
632
|
+
onCancel?: () => void;
|
|
633
|
+
cancelDisabled?: boolean;
|
|
634
|
+
compact?: boolean;
|
|
635
|
+
maxBars?: number;
|
|
636
|
+
testID?: string;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/** Below this window width the card renders compact: summary chips, step timings behind a toggle. */
|
|
640
|
+
declare const LIVE_RUN_CARD_COMPACT_MAX_PX = 640;
|
|
641
|
+
/** Presentational card for one active run: status, progress, per-group chips and step-time bars. */
|
|
642
|
+
declare function LiveRunCard(props: LiveRunCardProps): React.ReactElement;
|
|
643
|
+
|
|
644
|
+
/** The theme colour for a step or group state; falls back to primary/text when a semantic scale is absent. */
|
|
645
|
+
declare function runToneColor(theme: FeedbackTheme, state: RunStepState): string;
|
|
646
|
+
|
|
647
|
+
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, ConfirmDialog, type ConfirmDialogProps, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, type StepSplit, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, barFraction, clampPercent, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useFeedbackUi, useFeedbackUi as useUi };
|