@dloizides/ui-feedback 1.16.0 → 1.16.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.
- package/CHANGELOG.md +235 -228
- package/dist/index.js +25 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,228 +1,235 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 1.16.
|
|
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
|
-
the
|
|
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
|
-
|
|
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
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
## 1.0
|
|
216
|
-
|
|
217
|
-
- `
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.16.1
|
|
4
|
+
|
|
5
|
+
- **LiveRunCard step names wrap to two lines instead of truncating** ("Phase A2: resolving offi..."). At wide
|
|
6
|
+
layouts the name column takes a 35% share with a 220px floor; the time no longer wraps onto its own line.
|
|
7
|
+
- **Compact step rows stack**: the name with its time right-aligned on the same line, then a full-width bar.
|
|
8
|
+
- **Compact summary chips hide while step timings are open**, so the done/open chips no longer show twice.
|
|
9
|
+
|
|
10
|
+
## 1.16.0
|
|
11
|
+
|
|
12
|
+
- **New `LiveRunCard`** (JOBS-LAYOUT-1 "Live run card above the table", owner decision D-JOBS-LAYOUT-1): a
|
|
13
|
+
presentational card for one active run - status pill, title, started/elapsed line, current step,
|
|
14
|
+
`ProgressBar` with an app-supplied caption, one chip per step group (done / running / pending / failed),
|
|
15
|
+
and step-time bars scaled to the longest step with the shorter ones behind "+N shorter steps". Below
|
|
16
|
+
`LIVE_RUN_CARD_COMPACT_MAX_PX` (640) it renders compact: finished groups fold into one chip and step
|
|
17
|
+
timings sit behind a toggle. Optional Cancel. Every button and tappable chip is 48px
|
|
18
|
+
(`MIN_TOUCH_TARGET_PX`); colours come from the UiProvider theme; all text comes from the `labels` prop.
|
|
19
|
+
- **Pure helpers** `mergeRunSteps` (flat steps to groups in first-seen order, 0s done rows dropped, group
|
|
20
|
+
time summed, worst state wins), `splitShorterSteps`, `defaultGroupId`, `summariseDoneGroups`,
|
|
21
|
+
`barFraction`, `progressPercent`, `runToneColor`.
|
|
22
|
+
|
|
23
|
+
## 1.15.2
|
|
24
|
+
|
|
25
|
+
- **ErrorState buttons take the kit hit-target floor from `@dloizides/a11y`** (`MIN_TOUCH_TARGET_PX`,
|
|
26
|
+
48px) instead of a local 44px constant, matching `ui-buttons`. `@dloizides/a11y` is now a dependency
|
|
27
|
+
(JOBS-LIVE-1 "Live job updates").
|
|
28
|
+
|
|
29
|
+
## 1.15.1
|
|
30
|
+
|
|
31
|
+
- **ErrorState retry and secondary buttons now have a 44px minimum height** (`MIN_TOUCH_TARGET`),
|
|
32
|
+
content centred. Padding alone rendered them 34px tall, below the mobile-first hit-box standard
|
|
33
|
+
(JOBS-LIVE-1 "Live job updates").
|
|
34
|
+
|
|
35
|
+
## 1.15.0
|
|
36
|
+
|
|
37
|
+
- **New `ProgressBar`** (promoted from aml-v2 `JobProgressBar`, RUPEP-5 "Upload a RuPEP file from the
|
|
38
|
+
Jobs tab"): determinate fill clamped to 0-100 (`clampPercent`, also exported) with an optional
|
|
39
|
+
right-aligned caption, or an indeterminate scanning bar. `role="progressbar"` with
|
|
40
|
+
`aria-valuemin/max/now/text` (`aria-valuenow` omitted and `aria-busy` set when indeterminate).
|
|
41
|
+
Colours default to the UiProvider theme (`palette.primary.500`, `colors.border`,
|
|
42
|
+
`colors.textSecondary`) and accept overrides. Default testID `progress-bar`, fill `<testID>-fill`.
|
|
43
|
+
|
|
44
|
+
## 1.14.0
|
|
45
|
+
|
|
46
|
+
- **`ToastHost` portals to `document.body` on web (`position: fixed`, `Z_INDEX.toast`).** In-tree,
|
|
47
|
+
the layer sat inside RN-web Views that each carry `position: relative; z-index: 0`, so its 10100
|
|
48
|
+
was trapped and an open `ConfirmDialog` / RN `Modal` (9999, body-level) painted over the toast
|
|
49
|
+
(measured on ui.dloizides.com/feedback: `elementFromPoint` at the toast centre returned the
|
|
50
|
+
dialog). Same mechanism as `ui-forms` `menuPortal` and `ui-tables` `SizeDropdown`. Native is
|
|
51
|
+
unchanged (in-tree). `react-dom` is now an optional peer dependency.
|
|
52
|
+
|
|
53
|
+
## 1.13.0
|
|
54
|
+
|
|
55
|
+
Overlay stacking now comes from the shared `@dloizides/design-tokens` `Z_INDEX` scale
|
|
56
|
+
(added as a dependency, `^1.13.0`) instead of local literals.
|
|
57
|
+
|
|
58
|
+
- **`ToastHost` layer: 9999 -> `Z_INDEX.toast` (10100).** A toast now paints above an open
|
|
59
|
+
portalled menu (`Z_INDEX.popover`, 10000) and above an RN-web `Modal` (9999). At 9999 an open
|
|
60
|
+
dropdown covered the toast. Pinned by a `ToastHost.test.tsx` case that reads the computed
|
|
61
|
+
`z-index` of the toast layer.
|
|
62
|
+
- **`WarmingOverlay`: literal 100000 -> `Z_INDEX.blocking`.** Same value, so nothing changes visually.
|
|
63
|
+
|
|
64
|
+
## 1.12.0
|
|
65
|
+
|
|
66
|
+
Opt-in additions to `ErrorState` for full-screen error surfaces (an import-error or
|
|
67
|
+
load-error screen that needs a heading, an icon and a way out other than retry). Every
|
|
68
|
+
prop is optional: a caller passing none of them renders the same element tree as 1.11.0,
|
|
69
|
+
pinned by `ErrorState.test.tsx` baseline snapshots recorded before the change.
|
|
70
|
+
|
|
71
|
+
- **Add `title?: string`** — rendered above the message with `accessibilityRole="header"`
|
|
72
|
+
(`role="heading"` on web), testID `${testID}-title`. When a title is present the message
|
|
73
|
+
uses `theme.colors.textSecondary` instead of the error colour.
|
|
74
|
+
- **Add `icon?: React.ReactNode`** — rendered inside a circular well tinted with
|
|
75
|
+
`theme.semantic.error['500']` at low opacity; the well is `aria-hidden`, testID `${testID}-icon`.
|
|
76
|
+
- **Add `secondaryAction?: ErrorStateAction`** (`{ label, hint, onPress, testID }`) — an
|
|
77
|
+
outline button (`theme.colors.border`) laid out in a row beside retry.
|
|
78
|
+
- **Export type `ErrorStateAction`.** No new colour literals; no new dependencies.
|
|
79
|
+
|
|
80
|
+
## 1.11.0
|
|
81
|
+
|
|
82
|
+
Adopts `@dloizides/ui-motion` for `PageSkeleton`: the loader now shows a moving
|
|
83
|
+
**shimmer** (a highlight band sweeping across each block) instead of an opacity pulse,
|
|
84
|
+
so loading states read as modern/ant-design-like. There is now ONE shimmer
|
|
85
|
+
implementation in the kit — the ui-motion `<Skeleton>` primitive — and `PageSkeleton`
|
|
86
|
+
owns only the page LAYOUT (how many bars/blocks, their sizes and spacing).
|
|
87
|
+
|
|
88
|
+
- **Add runtime dependency `@dloizides/ui-motion` (`^1.0.1`).**
|
|
89
|
+
- **`PageSkeleton` internals reimplemented on ui-motion `<Skeleton>`.** Each placeholder
|
|
90
|
+
block (header bar, list-row avatar + text lines, card) is now a `<Skeleton>` with the
|
|
91
|
+
same `width`/`height`/`borderRadius`/base colour it had before. The bespoke
|
|
92
|
+
`Animated.loop` opacity pulse (and its `Animated`/`Easing`/`Platform` imports) is gone.
|
|
93
|
+
- **Reduced-motion is now handled by `<Skeleton>`** (via `@dloizides/rn-web-hooks`
|
|
94
|
+
`useReducedMotion`): the sweep is suppressed and a static block is shown.
|
|
95
|
+
- **Public API unchanged.** `PageSkeletonProps` (`rows`, `showHeader`, `variant`), the
|
|
96
|
+
rendered layout, and the `page-skeleton` testID are identical to 1.9.0. Only the
|
|
97
|
+
internal animated primitive was swapped.
|
|
98
|
+
- `ToastHost` (fade+slide) is intentionally left as-is — it remains the reference
|
|
99
|
+
enter/exit pattern.
|
|
100
|
+
|
|
101
|
+
## 1.7.0
|
|
102
|
+
|
|
103
|
+
Closes the API gap that kept `kefi-web`, `erevna-web` and `katalogos-web` on their
|
|
104
|
+
local `ErrorBoundary` copies. Those three vary the boundary **by error class** — a
|
|
105
|
+
stale-chunk failure after a deploy needs different wording, no retry button, and no
|
|
106
|
+
stack dump — which 1.6.0's static `labels` / boolean `showDetails` could not express.
|
|
107
|
+
Every addition is opt-in; the pre-1.7.0 test suite passes unmodified.
|
|
108
|
+
|
|
109
|
+
**The kit still does not know what a "chunk" is.** Apps inject the classification;
|
|
110
|
+
the boundary only learns *whether retry is meaningful* and *what to say*.
|
|
111
|
+
|
|
112
|
+
- **Add `retryable?: (error) => boolean`.** When it returns `false` the retry action is
|
|
113
|
+
not rendered at all. Offering a button that re-renders straight back into the same
|
|
114
|
+
missing chunk is worse than offering nothing. Default: every error is retryable
|
|
115
|
+
(1.6.0 behaviour).
|
|
116
|
+
- **Add `labelsFor?: (error) => Partial<ErrorBoundaryLabels>`,** merged OVER the static
|
|
117
|
+
`labels`. Lets an app say "Update available" for a stale chunk without the kit knowing
|
|
118
|
+
why — it sees only the resulting strings.
|
|
119
|
+
- **Widen `showDetails` to `boolean | ((error) => boolean)`.** A predicate can suppress
|
|
120
|
+
the dev-only block per error class (a hashed filename is noise, not signal). **A plain
|
|
121
|
+
boolean behaves exactly as before.**
|
|
122
|
+
- **Add `onMount?: () => void`,** called from `componentDidMount` ONLY when the mount was
|
|
123
|
+
clean. The three apps release their one-shot reload guard here: a clean mount proves the
|
|
124
|
+
current chunks loaded, so a FUTURE deploy may auto-recover again. Deliberately not called
|
|
125
|
+
on an errored mount — that would re-arm the guard during the very failure it bounds.
|
|
126
|
+
- **Add `reloadIsPrimary?: boolean`** (default `false`). Gives Reload the filled emphasis
|
|
127
|
+
and the first position instead of Try Again.
|
|
128
|
+
|
|
129
|
+
**Why a flag rather than an unconditional swap:** `agora-web` and `zygos-web` both pass
|
|
130
|
+
`onReload`, so simply inverting the priority would have silently restyled and reordered
|
|
131
|
+
their error screens too. They have no chunk-recovery path, so retry is still the right
|
|
132
|
+
primary there. The default preserves their rendering exactly; the three chunk-aware apps
|
|
133
|
+
opt in.
|
|
134
|
+
|
|
135
|
+
**Notably, `DEFAULT_ERROR_BOUNDARY_LABELS` gains no `updateTitle`/`updateMessage`.** Those
|
|
136
|
+
are domain vocabulary — "an update is available" is a fact about the app's deploy model, not
|
|
137
|
+
about error boundaries. `labelsFor` supplies them as ordinary `title`/`message` overrides,
|
|
138
|
+
which keeps the kit's label bag domain-free.
|
|
139
|
+
|
|
140
|
+
### Fixed
|
|
141
|
+
|
|
142
|
+
- **`AppErrorBoundary.test.tsx` had never actually run.** `jest.setup.ts` imports
|
|
143
|
+
`@testing-library/jest-dom`, which registers matchers at runtime, but `tsconfig.test.json`
|
|
144
|
+
listed no `types`, so ts-jest failed every `toBeInTheDocument()` with TS2339 and aborted the
|
|
145
|
+
whole suite at compile time. It was the only suite using those matchers, so `npm test`
|
|
146
|
+
reported a red SUITE while the other five stayed green and the true test count read 34.
|
|
147
|
+
Adding `"types": ["jest", "node", "@testing-library/jest-dom"]` brings its 14 assertions
|
|
148
|
+
online for the first time — unmodified, and passing against the 1.7.0 source.
|
|
149
|
+
|
|
150
|
+
## 1.6.0
|
|
151
|
+
|
|
152
|
+
Two fleet-wide duplicates extracted (W1.2 + W1.3). Both are purely additive — every
|
|
153
|
+
existing export is unchanged.
|
|
154
|
+
|
|
155
|
+
- **Add `createToastBus()` — the shared toast EMIT half (W1.2).** Promoted from the three
|
|
156
|
+
hand-rolled ~25-line twins in `aml-v2` (`components/toast.ts` — `emitToast`/`subscribeToasts`),
|
|
157
|
+
`agora-web` and `zygos-web` (`lib/toastBus.ts` — `toastSuccess`/`toastError`). The returned
|
|
158
|
+
bus is a superset: `subscribe` (the `<ToastHost>` port), `emit(text, type?)`, and the
|
|
159
|
+
`success`/`error`/`info` shorthands.
|
|
160
|
+
|
|
161
|
+
**Deliberately framework-agnostic — no React import, no hook, no provider.** Call sites are
|
|
162
|
+
React Query mutation `onSuccess`/`onError` callbacks with no component context in scope, so a
|
|
163
|
+
hook-based API would break every one of them. It carries no styling: `<ToastHost>` themes each
|
|
164
|
+
toast from `UiProvider`. Text passed in is already localized by the caller.
|
|
165
|
+
|
|
166
|
+
New exports: `createToastBus`, `ToastBus`, `ToastPush`.
|
|
167
|
+
|
|
168
|
+
- **Add `<AppErrorBoundary>` — the shared top-level error boundary (W1.3).** Promoted from the
|
|
169
|
+
SIX app-local copies (`agora-web` + `zygos-web` byte-identical, `kefi-web`, `erevna-web`,
|
|
170
|
+
`katalogos-web`, `ichnos-web`); `aml-v2` had none at all. The axes that actually varied are now
|
|
171
|
+
injected rather than baked in: `onError` (Sentry/logger), `recover` (the apps' chunk-load
|
|
172
|
+
retry), `showDetails` (dev-only error text), `labels` (pre-localized bag), `testIDPrefix`,
|
|
173
|
+
and `fallback` (escape hatch). An optional `onReload` renders the manual **Reload** action
|
|
174
|
+
that kefi/erevna/katalogos shipped alongside **Try Again**.
|
|
175
|
+
|
|
176
|
+
Two behaviour fixes come with the extraction:
|
|
177
|
+
- **Themed.** The fallback renders through the shared `<ErrorState>`, so it reads
|
|
178
|
+
`UiProvider` colours — this removes the 40+ hardcoded Bootstrap-4 hex literals
|
|
179
|
+
(`#f8f9fa`, `#212529`, `#6c757d`, `#fff3cd`, `#856404`, `#007bff`, …) three copies carried.
|
|
180
|
+
- **Announced.** The fallback ships `role="alert"` + `accessibilityLiveRegion="assertive"`;
|
|
181
|
+
none of the six announced anything to a screen reader, and agora/zygos rendered only the
|
|
182
|
+
app *name* with no message and no retry.
|
|
183
|
+
|
|
184
|
+
New exports: `AppErrorBoundary`, `AppErrorBoundaryProps`, `ErrorFallbackState`,
|
|
185
|
+
`ErrorBoundaryLabels`, `DEFAULT_ERROR_BOUNDARY_LABELS`, plus the `errorBoundary` id in
|
|
186
|
+
`FEEDBACK_TEST_IDS` (default prefix `error-boundary`, preserving the existing
|
|
187
|
+
`error-boundary-retry-button` / `-reload-button` / `-updating` Playwright selectors).
|
|
188
|
+
|
|
189
|
+
## 1.5.0
|
|
190
|
+
|
|
191
|
+
- **Accessibility (WCAG 2.1 AA) — `ToastHost` announcements.** Each toast is now a live region so
|
|
192
|
+
a screen reader announces it (WCAG 4.1.3): success/info toasts render as `role="status"` with
|
|
193
|
+
`aria-live="polite"`, error toasts escalate to `role="alert"` with `aria-live="assertive"`
|
|
194
|
+
(`accessibilityLiveRegion` set for native parity). Rendering, timing and testIDs are unchanged —
|
|
195
|
+
additive + backward-compatible.
|
|
196
|
+
|
|
197
|
+
## 1.3.0
|
|
198
|
+
|
|
199
|
+
- Add `ToastHost` — the shared, tokenized transient-toast overlay promoted from the
|
|
200
|
+
byte-identical erevna-web / katalogos-web `ToastContainer` twins. Rendering (animated
|
|
201
|
+
fade, positioning, theming) lives here; the emit pipeline stays in the app and is wired
|
|
202
|
+
in via the `subscribe` port (`(push) => unsubscribe`). Colours come from the UiProvider
|
|
203
|
+
theme. New exports: `ToastHost`, `ToastHostProps`, `ToastInput`, `ToastType`, plus the
|
|
204
|
+
`notificationToast` id in `FEEDBACK_TEST_IDS` (default toast testID `notification-toast`,
|
|
205
|
+
preserving existing Playwright selectors).
|
|
206
|
+
|
|
207
|
+
## 1.2.0
|
|
208
|
+
|
|
209
|
+
- Broaden the injected theme so the settings-hub kit can consume it: colour scales are now
|
|
210
|
+
addressable at any step (`[step]`), and `palette`/`semantic` accept named scales beyond
|
|
211
|
+
`primary`/`error` (e.g. `secondary`, `accent`, `success`, `warning`, `info`) via index signatures.
|
|
212
|
+
Purely additive — existing `{primary}`/`{error}` themes still satisfy the types. Default value now
|
|
213
|
+
includes the common extra scales so no-provider rendering never reads `undefined`.
|
|
214
|
+
|
|
215
|
+
## 1.1.0
|
|
216
|
+
|
|
217
|
+
- Add `colors.surface` to the injected theme (needed by the ui-forms kit; apps already pass it).
|
|
218
|
+
- Export neutral aliases `UiProvider` / `useUi` (+ `Ui*` types) for the feedback-specific
|
|
219
|
+
`FeedbackUiProvider` / `useFeedbackUi`. ui-feedback is now the shared UI context for the kit;
|
|
220
|
+
sibling packages (ui-forms, ui-tables, …) consume `useUi` instead of duplicating the provider.
|
|
221
|
+
|
|
222
|
+
## 1.0.2
|
|
223
|
+
|
|
224
|
+
- `useFeedbackUi` now falls back to a neutral default theme + identity translate when no
|
|
225
|
+
`FeedbackUiProvider` is mounted (graceful degradation), instead of throwing. Apps still
|
|
226
|
+
mount a provider for the real theme/i18n; isolated tests render without one.
|
|
227
|
+
|
|
228
|
+
## 1.0.0
|
|
229
|
+
|
|
230
|
+
Initial release. Extracted the proven duplicated feedback components from erevna-web ↔
|
|
231
|
+
katalogos-web (Capability Wave C1, batch 1).
|
|
232
|
+
|
|
233
|
+
- `FeedbackUiProvider` + `useFeedbackUi` — injectable theme/translate/navigate context.
|
|
234
|
+
- `ErrorState`, `EmptyListState`, `LoadingFallback`, `PageSkeleton`, `ConfirmDialog`.
|
|
235
|
+
- `FEEDBACK_TEST_IDS`, `MODAL_OVERLAY_COLOR`, `DISABLED_OPACITY` constants.
|
package/dist/index.js
CHANGED
|
@@ -1336,19 +1336,24 @@ function RunGroupSummary({ groups, labels, testID }) {
|
|
|
1336
1336
|
] });
|
|
1337
1337
|
}
|
|
1338
1338
|
var BAR_HEIGHT2 = 8;
|
|
1339
|
-
var
|
|
1339
|
+
var LABEL_MIN_WIDTH = 220;
|
|
1340
|
+
var LABEL_SHARE = "35%";
|
|
1341
|
+
var LABEL_LINES = 2;
|
|
1340
1342
|
var DURATION_WIDTH = 64;
|
|
1341
1343
|
var PERCENT = 100;
|
|
1342
1344
|
var styles14 = reactNative.StyleSheet.create({
|
|
1343
1345
|
list: { gap: 6 },
|
|
1344
|
-
row: { flexDirection: "row", alignItems: "center", gap: 8
|
|
1345
|
-
|
|
1346
|
+
row: { flexDirection: "row", alignItems: "center", gap: 8 },
|
|
1347
|
+
stack: { gap: 4 },
|
|
1348
|
+
label: { fontSize: 13, flexBasis: LABEL_SHARE, flexGrow: 0, flexShrink: 0, minWidth: LABEL_MIN_WIDTH },
|
|
1349
|
+
compactLabel: { fontSize: 13, flexGrow: 1, flexShrink: 1, minWidth: 0 },
|
|
1346
1350
|
track: { flexGrow: 1, flexShrink: 1, flexBasis: 80, height: BAR_HEIGHT2, borderRadius: 2, overflow: "hidden" },
|
|
1351
|
+
fullTrack: { height: BAR_HEIGHT2, borderRadius: 2, overflow: "hidden" },
|
|
1347
1352
|
fill: { height: "100%", borderRadius: 2 },
|
|
1348
1353
|
duration: { fontSize: 13, width: DURATION_WIDTH, textAlign: "right", fontVariant: ["tabular-nums"] },
|
|
1349
1354
|
strong: { fontWeight: "700" }
|
|
1350
1355
|
});
|
|
1351
|
-
function RunStepBars({ steps, maxBars, labels, testID }) {
|
|
1356
|
+
function RunStepBars({ steps, maxBars, labels, compact, testID }) {
|
|
1352
1357
|
const { theme } = useFeedbackUi();
|
|
1353
1358
|
const [all, setAll] = react.useState(false);
|
|
1354
1359
|
const split = splitShorterSteps(steps, all ? steps.length : maxBars);
|
|
@@ -1360,10 +1365,20 @@ function RunStepBars({ steps, maxBars, labels, testID }) {
|
|
|
1360
1365
|
const color = runToneColor(theme, step.state);
|
|
1361
1366
|
const duration = labels.formatDuration(step.durationSec);
|
|
1362
1367
|
const strong = step.state === "running" ? styles14.strong : null;
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1368
|
+
const name = /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [compact ? styles14.compactLabel : styles14.label, { color: theme.colors.text }, strong], numberOfLines: LABEL_LINES, testID: `${testID}-name-${String(i)}`, children: step.label });
|
|
1369
|
+
const time = /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles14.duration, { color: theme.colors.textSecondary }, strong], children: duration });
|
|
1370
|
+
const bar = /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [compact ? styles14.fullTrack : styles14.track, { backgroundColor: theme.colors.border }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles14.fill, { backgroundColor: color, width: `${barFraction(step.durationSec, maxSec) * PERCENT}%` }] }) });
|
|
1371
|
+
const a11y = { accessible: true, accessibilityLabel: labels.stepA11y(step.label, duration), testID: `${testID}-row-${String(i)}` };
|
|
1372
|
+
return compact ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles14.stack, ...a11y, children: [
|
|
1373
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles14.row, children: [
|
|
1374
|
+
name,
|
|
1375
|
+
time
|
|
1376
|
+
] }),
|
|
1377
|
+
bar
|
|
1378
|
+
] }, `${step.label}-${String(i)}`) : /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles14.row, ...a11y, children: [
|
|
1379
|
+
name,
|
|
1380
|
+
bar,
|
|
1381
|
+
time
|
|
1367
1382
|
] }, `${step.label}-${String(i)}`);
|
|
1368
1383
|
}),
|
|
1369
1384
|
folded || canFold ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1417,10 +1432,10 @@ function LiveRunCard(props) {
|
|
|
1417
1432
|
currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles15.step, { color: theme.colors.text }], testID: `${testID}-step`, children: currentStep }) : null,
|
|
1418
1433
|
percent !== null ? /* @__PURE__ */ jsxRuntime.jsx(ProgressBar, { percent, label: labels.progress, accessibilityLabel: labels.progressA11y, color: tone, testID: `${testID}-progress` }) : null,
|
|
1419
1434
|
percent === null && labels.progress !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles15.meta, muted], testID: `${testID}-progress-text`, children: labels.progress }) : null,
|
|
1420
|
-
compact ? /* @__PURE__ */ jsxRuntime.jsx(RunGroupSummary, { groups, labels, testID: `${testID}-summary` }) : null,
|
|
1435
|
+
compact && !open ? /* @__PURE__ */ jsxRuntime.jsx(RunGroupSummary, { groups, labels, testID: `${testID}-summary` }) : null,
|
|
1421
1436
|
compact ? /* @__PURE__ */ jsxRuntime.jsx(RunCardButton, { label: labels.stepTimings, hint: labels.stepTimingsHint, color: theme.colors.textSecondary, onPress: () => setOpen(!open), expanded: open, testID: `${testID}-timings-toggle` }) : null,
|
|
1422
1437
|
showTimings ? /* @__PURE__ */ jsxRuntime.jsx(RunGroupChips, { groups, labels, selectedId, onSelect: setPicked, testID: `${testID}-groups` }) : null,
|
|
1423
|
-
showTimings && selected !== void 0 && selected.steps.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(RunStepBars, { steps: selected.steps, maxBars, labels, testID: `${testID}-steps` }, selected.id) : null
|
|
1438
|
+
showTimings && selected !== void 0 && selected.steps.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(RunStepBars, { steps: selected.steps, maxBars, labels, compact, testID: `${testID}-steps` }, selected.id) : null
|
|
1424
1439
|
] });
|
|
1425
1440
|
}
|
|
1426
1441
|
|