@dloizides/ui-feedback 1.11.0 → 1.13.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 +185 -158
- package/dist/index.d.mts +32 -6
- package/dist/index.d.ts +32 -6
- package/dist/index.js +182 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +183 -95
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,158 +1,185 @@
|
|
|
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
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.13.0
|
|
4
|
+
|
|
5
|
+
Overlay stacking now comes from the shared `@dloizides/design-tokens` `Z_INDEX` scale
|
|
6
|
+
(added as a dependency, `^1.13.0`) instead of local literals.
|
|
7
|
+
|
|
8
|
+
- **`ToastHost` layer: 9999 -> `Z_INDEX.toast` (10100).** A toast now paints above an open
|
|
9
|
+
portalled menu (`Z_INDEX.popover`, 10000) and above an RN-web `Modal` (9999). At 9999 an open
|
|
10
|
+
dropdown covered the toast. Pinned by a `ToastHost.test.tsx` case that reads the computed
|
|
11
|
+
`z-index` of the toast layer.
|
|
12
|
+
- **`WarmingOverlay`: literal 100000 -> `Z_INDEX.blocking`.** Same value, so nothing changes visually.
|
|
13
|
+
|
|
14
|
+
## 1.12.0
|
|
15
|
+
|
|
16
|
+
Opt-in additions to `ErrorState` for full-screen error surfaces (an import-error or
|
|
17
|
+
load-error screen that needs a heading, an icon and a way out other than retry). Every
|
|
18
|
+
prop is optional: a caller passing none of them renders the same element tree as 1.11.0,
|
|
19
|
+
pinned by `ErrorState.test.tsx` baseline snapshots recorded before the change.
|
|
20
|
+
|
|
21
|
+
- **Add `title?: string`** — rendered above the message with `accessibilityRole="header"`
|
|
22
|
+
(`role="heading"` on web), testID `${testID}-title`. When a title is present the message
|
|
23
|
+
uses `theme.colors.textSecondary` instead of the error colour.
|
|
24
|
+
- **Add `icon?: React.ReactNode`** — rendered inside a circular well tinted with
|
|
25
|
+
`theme.semantic.error['500']` at low opacity; the well is `aria-hidden`, testID `${testID}-icon`.
|
|
26
|
+
- **Add `secondaryAction?: ErrorStateAction`** (`{ label, hint, onPress, testID }`) — an
|
|
27
|
+
outline button (`theme.colors.border`) laid out in a row beside retry.
|
|
28
|
+
- **Export type `ErrorStateAction`.** No new colour literals; no new dependencies.
|
|
29
|
+
|
|
30
|
+
## 1.11.0
|
|
31
|
+
|
|
32
|
+
Adopts `@dloizides/ui-motion` for `PageSkeleton`: the loader now shows a moving
|
|
33
|
+
**shimmer** (a highlight band sweeping across each block) instead of an opacity pulse,
|
|
34
|
+
so loading states read as modern/ant-design-like. There is now ONE shimmer
|
|
35
|
+
implementation in the kit — the ui-motion `<Skeleton>` primitive — and `PageSkeleton`
|
|
36
|
+
owns only the page LAYOUT (how many bars/blocks, their sizes and spacing).
|
|
37
|
+
|
|
38
|
+
- **Add runtime dependency `@dloizides/ui-motion` (`^1.0.1`).**
|
|
39
|
+
- **`PageSkeleton` internals reimplemented on ui-motion `<Skeleton>`.** Each placeholder
|
|
40
|
+
block (header bar, list-row avatar + text lines, card) is now a `<Skeleton>` with the
|
|
41
|
+
same `width`/`height`/`borderRadius`/base colour it had before. The bespoke
|
|
42
|
+
`Animated.loop` opacity pulse (and its `Animated`/`Easing`/`Platform` imports) is gone.
|
|
43
|
+
- **Reduced-motion is now handled by `<Skeleton>`** (via `@dloizides/rn-web-hooks`
|
|
44
|
+
`useReducedMotion`): the sweep is suppressed and a static block is shown.
|
|
45
|
+
- **Public API unchanged.** `PageSkeletonProps` (`rows`, `showHeader`, `variant`), the
|
|
46
|
+
rendered layout, and the `page-skeleton` testID are identical to 1.9.0. Only the
|
|
47
|
+
internal animated primitive was swapped.
|
|
48
|
+
- `ToastHost` (fade+slide) is intentionally left as-is — it remains the reference
|
|
49
|
+
enter/exit pattern.
|
|
50
|
+
|
|
51
|
+
## 1.7.0
|
|
52
|
+
|
|
53
|
+
Closes the API gap that kept `kefi-web`, `erevna-web` and `katalogos-web` on their
|
|
54
|
+
local `ErrorBoundary` copies. Those three vary the boundary **by error class** — a
|
|
55
|
+
stale-chunk failure after a deploy needs different wording, no retry button, and no
|
|
56
|
+
stack dump — which 1.6.0's static `labels` / boolean `showDetails` could not express.
|
|
57
|
+
Every addition is opt-in; the pre-1.7.0 test suite passes unmodified.
|
|
58
|
+
|
|
59
|
+
**The kit still does not know what a "chunk" is.** Apps inject the classification;
|
|
60
|
+
the boundary only learns *whether retry is meaningful* and *what to say*.
|
|
61
|
+
|
|
62
|
+
- **Add `retryable?: (error) => boolean`.** When it returns `false` the retry action is
|
|
63
|
+
not rendered at all. Offering a button that re-renders straight back into the same
|
|
64
|
+
missing chunk is worse than offering nothing. Default: every error is retryable
|
|
65
|
+
(1.6.0 behaviour).
|
|
66
|
+
- **Add `labelsFor?: (error) => Partial<ErrorBoundaryLabels>`,** merged OVER the static
|
|
67
|
+
`labels`. Lets an app say "Update available" for a stale chunk without the kit knowing
|
|
68
|
+
why — it sees only the resulting strings.
|
|
69
|
+
- **Widen `showDetails` to `boolean | ((error) => boolean)`.** A predicate can suppress
|
|
70
|
+
the dev-only block per error class (a hashed filename is noise, not signal). **A plain
|
|
71
|
+
boolean behaves exactly as before.**
|
|
72
|
+
- **Add `onMount?: () => void`,** called from `componentDidMount` ONLY when the mount was
|
|
73
|
+
clean. The three apps release their one-shot reload guard here: a clean mount proves the
|
|
74
|
+
current chunks loaded, so a FUTURE deploy may auto-recover again. Deliberately not called
|
|
75
|
+
on an errored mount — that would re-arm the guard during the very failure it bounds.
|
|
76
|
+
- **Add `reloadIsPrimary?: boolean`** (default `false`). Gives Reload the filled emphasis
|
|
77
|
+
and the first position instead of Try Again.
|
|
78
|
+
|
|
79
|
+
**Why a flag rather than an unconditional swap:** `agora-web` and `zygos-web` both pass
|
|
80
|
+
`onReload`, so simply inverting the priority would have silently restyled and reordered
|
|
81
|
+
their error screens too. They have no chunk-recovery path, so retry is still the right
|
|
82
|
+
primary there. The default preserves their rendering exactly; the three chunk-aware apps
|
|
83
|
+
opt in.
|
|
84
|
+
|
|
85
|
+
**Notably, `DEFAULT_ERROR_BOUNDARY_LABELS` gains no `updateTitle`/`updateMessage`.** Those
|
|
86
|
+
are domain vocabulary — "an update is available" is a fact about the app's deploy model, not
|
|
87
|
+
about error boundaries. `labelsFor` supplies them as ordinary `title`/`message` overrides,
|
|
88
|
+
which keeps the kit's label bag domain-free.
|
|
89
|
+
|
|
90
|
+
### Fixed
|
|
91
|
+
|
|
92
|
+
- **`AppErrorBoundary.test.tsx` had never actually run.** `jest.setup.ts` imports
|
|
93
|
+
`@testing-library/jest-dom`, which registers matchers at runtime, but `tsconfig.test.json`
|
|
94
|
+
listed no `types`, so ts-jest failed every `toBeInTheDocument()` with TS2339 and aborted the
|
|
95
|
+
whole suite at compile time. It was the only suite using those matchers, so `npm test`
|
|
96
|
+
reported a red SUITE while the other five stayed green and the true test count read 34.
|
|
97
|
+
Adding `"types": ["jest", "node", "@testing-library/jest-dom"]` brings its 14 assertions
|
|
98
|
+
online for the first time — unmodified, and passing against the 1.7.0 source.
|
|
99
|
+
|
|
100
|
+
## 1.6.0
|
|
101
|
+
|
|
102
|
+
Two fleet-wide duplicates extracted (W1.2 + W1.3). Both are purely additive — every
|
|
103
|
+
existing export is unchanged.
|
|
104
|
+
|
|
105
|
+
- **Add `createToastBus()` — the shared toast EMIT half (W1.2).** Promoted from the three
|
|
106
|
+
hand-rolled ~25-line twins in `aml-v2` (`components/toast.ts` — `emitToast`/`subscribeToasts`),
|
|
107
|
+
`agora-web` and `zygos-web` (`lib/toastBus.ts` — `toastSuccess`/`toastError`). The returned
|
|
108
|
+
bus is a superset: `subscribe` (the `<ToastHost>` port), `emit(text, type?)`, and the
|
|
109
|
+
`success`/`error`/`info` shorthands.
|
|
110
|
+
|
|
111
|
+
**Deliberately framework-agnostic — no React import, no hook, no provider.** Call sites are
|
|
112
|
+
React Query mutation `onSuccess`/`onError` callbacks with no component context in scope, so a
|
|
113
|
+
hook-based API would break every one of them. It carries no styling: `<ToastHost>` themes each
|
|
114
|
+
toast from `UiProvider`. Text passed in is already localized by the caller.
|
|
115
|
+
|
|
116
|
+
New exports: `createToastBus`, `ToastBus`, `ToastPush`.
|
|
117
|
+
|
|
118
|
+
- **Add `<AppErrorBoundary>` — the shared top-level error boundary (W1.3).** Promoted from the
|
|
119
|
+
SIX app-local copies (`agora-web` + `zygos-web` byte-identical, `kefi-web`, `erevna-web`,
|
|
120
|
+
`katalogos-web`, `ichnos-web`); `aml-v2` had none at all. The axes that actually varied are now
|
|
121
|
+
injected rather than baked in: `onError` (Sentry/logger), `recover` (the apps' chunk-load
|
|
122
|
+
retry), `showDetails` (dev-only error text), `labels` (pre-localized bag), `testIDPrefix`,
|
|
123
|
+
and `fallback` (escape hatch). An optional `onReload` renders the manual **Reload** action
|
|
124
|
+
that kefi/erevna/katalogos shipped alongside **Try Again**.
|
|
125
|
+
|
|
126
|
+
Two behaviour fixes come with the extraction:
|
|
127
|
+
- **Themed.** The fallback renders through the shared `<ErrorState>`, so it reads
|
|
128
|
+
`UiProvider` colours — this removes the 40+ hardcoded Bootstrap-4 hex literals
|
|
129
|
+
(`#f8f9fa`, `#212529`, `#6c757d`, `#fff3cd`, `#856404`, `#007bff`, …) three copies carried.
|
|
130
|
+
- **Announced.** The fallback ships `role="alert"` + `accessibilityLiveRegion="assertive"`;
|
|
131
|
+
none of the six announced anything to a screen reader, and agora/zygos rendered only the
|
|
132
|
+
app *name* with no message and no retry.
|
|
133
|
+
|
|
134
|
+
New exports: `AppErrorBoundary`, `AppErrorBoundaryProps`, `ErrorFallbackState`,
|
|
135
|
+
`ErrorBoundaryLabels`, `DEFAULT_ERROR_BOUNDARY_LABELS`, plus the `errorBoundary` id in
|
|
136
|
+
`FEEDBACK_TEST_IDS` (default prefix `error-boundary`, preserving the existing
|
|
137
|
+
`error-boundary-retry-button` / `-reload-button` / `-updating` Playwright selectors).
|
|
138
|
+
|
|
139
|
+
## 1.5.0
|
|
140
|
+
|
|
141
|
+
- **Accessibility (WCAG 2.1 AA) — `ToastHost` announcements.** Each toast is now a live region so
|
|
142
|
+
a screen reader announces it (WCAG 4.1.3): success/info toasts render as `role="status"` with
|
|
143
|
+
`aria-live="polite"`, error toasts escalate to `role="alert"` with `aria-live="assertive"`
|
|
144
|
+
(`accessibilityLiveRegion` set for native parity). Rendering, timing and testIDs are unchanged —
|
|
145
|
+
additive + backward-compatible.
|
|
146
|
+
|
|
147
|
+
## 1.3.0
|
|
148
|
+
|
|
149
|
+
- Add `ToastHost` — the shared, tokenized transient-toast overlay promoted from the
|
|
150
|
+
byte-identical erevna-web / katalogos-web `ToastContainer` twins. Rendering (animated
|
|
151
|
+
fade, positioning, theming) lives here; the emit pipeline stays in the app and is wired
|
|
152
|
+
in via the `subscribe` port (`(push) => unsubscribe`). Colours come from the UiProvider
|
|
153
|
+
theme. New exports: `ToastHost`, `ToastHostProps`, `ToastInput`, `ToastType`, plus the
|
|
154
|
+
`notificationToast` id in `FEEDBACK_TEST_IDS` (default toast testID `notification-toast`,
|
|
155
|
+
preserving existing Playwright selectors).
|
|
156
|
+
|
|
157
|
+
## 1.2.0
|
|
158
|
+
|
|
159
|
+
- Broaden the injected theme so the settings-hub kit can consume it: colour scales are now
|
|
160
|
+
addressable at any step (`[step]`), and `palette`/`semantic` accept named scales beyond
|
|
161
|
+
`primary`/`error` (e.g. `secondary`, `accent`, `success`, `warning`, `info`) via index signatures.
|
|
162
|
+
Purely additive — existing `{primary}`/`{error}` themes still satisfy the types. Default value now
|
|
163
|
+
includes the common extra scales so no-provider rendering never reads `undefined`.
|
|
164
|
+
|
|
165
|
+
## 1.1.0
|
|
166
|
+
|
|
167
|
+
- Add `colors.surface` to the injected theme (needed by the ui-forms kit; apps already pass it).
|
|
168
|
+
- Export neutral aliases `UiProvider` / `useUi` (+ `Ui*` types) for the feedback-specific
|
|
169
|
+
`FeedbackUiProvider` / `useFeedbackUi`. ui-feedback is now the shared UI context for the kit;
|
|
170
|
+
sibling packages (ui-forms, ui-tables, …) consume `useUi` instead of duplicating the provider.
|
|
171
|
+
|
|
172
|
+
## 1.0.2
|
|
173
|
+
|
|
174
|
+
- `useFeedbackUi` now falls back to a neutral default theme + identity translate when no
|
|
175
|
+
`FeedbackUiProvider` is mounted (graceful degradation), instead of throwing. Apps still
|
|
176
|
+
mount a provider for the real theme/i18n; isolated tests render without one.
|
|
177
|
+
|
|
178
|
+
## 1.0.0
|
|
179
|
+
|
|
180
|
+
Initial release. Extracted the proven duplicated feedback components from erevna-web ↔
|
|
181
|
+
katalogos-web (Capability Wave C1, batch 1).
|
|
182
|
+
|
|
183
|
+
- `FeedbackUiProvider` + `useFeedbackUi` — injectable theme/translate/navigate context.
|
|
184
|
+
- `ErrorState`, `EmptyListState`, `LoadingFallback`, `PageSkeleton`, `ConfirmDialog`.
|
|
185
|
+
- `FEEDBACK_TEST_IDS`, `MODAL_OVERLAY_COLOR`, `DISABLED_OPACITY` constants.
|
package/dist/index.d.mts
CHANGED
|
@@ -80,16 +80,37 @@ declare const FEEDBACK_TEST_IDS: {
|
|
|
80
80
|
readonly errorBoundary: "error-boundary";
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Opt-in pieces of ErrorState: the decorative icon well and the outline secondary action.
|
|
85
|
+
* Both read colours only from the injected theme.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
interface ErrorStateAction {
|
|
89
|
+
label: string;
|
|
90
|
+
hint: string;
|
|
91
|
+
onPress: () => void;
|
|
92
|
+
testID: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
83
95
|
/**
|
|
84
96
|
* ErrorState - generic error display with optional retry button.
|
|
97
|
+
*
|
|
98
|
+
* Opt-in (1.12.0): `title`, a decorative `icon` well and a `secondaryAction`. A caller
|
|
99
|
+
* passing none of them renders the same element tree as before.
|
|
85
100
|
*/
|
|
86
101
|
|
|
87
102
|
interface ErrorStateProps {
|
|
88
103
|
message: string;
|
|
89
104
|
onRetry?: () => void;
|
|
90
105
|
testID?: string;
|
|
106
|
+
/** Heading above the message (role="heading" on web). */
|
|
107
|
+
title?: string;
|
|
108
|
+
/** Rendered inside a circular well above the title; decorative (aria-hidden). */
|
|
109
|
+
icon?: React.ReactNode;
|
|
110
|
+
/** Outline button beside retry, e.g. "Back to library". */
|
|
111
|
+
secondaryAction?: ErrorStateAction;
|
|
91
112
|
}
|
|
92
|
-
declare const ErrorState: ({ message, onRetry, testID, }: ErrorStateProps) => React.ReactElement;
|
|
113
|
+
declare const ErrorState: ({ message, onRetry, testID, title, icon, secondaryAction, }: ErrorStateProps) => React.ReactElement;
|
|
93
114
|
|
|
94
115
|
/**
|
|
95
116
|
* EmptyListState - empty-collection message with an optional call-to-action.
|
|
@@ -469,10 +490,15 @@ interface AppErrorBoundaryProps {
|
|
|
469
490
|
retryable?: (error: Error) => boolean;
|
|
470
491
|
/**
|
|
471
492
|
* Called from `componentDidMount` ONLY when the mount was clean (nothing caught).
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
493
|
+
* Deliberately NOT called on an errored mount.
|
|
494
|
+
*
|
|
495
|
+
* ⚠️ A CLEAN MOUNT DOES NOT PROVE THE PAGE LOADED. On a lazy route the boundary commits
|
|
496
|
+
* clean because a Suspense fallback rendered, and the dynamic import rejects AFTER this
|
|
497
|
+
* fires. A guard released here is therefore released mid-failure, which is how the
|
|
498
|
+
* chunk-reload loop went unbounded. Anything wired here must be safe to call during the
|
|
499
|
+
* failure it bounds — `clearChunkRecoveryFlag` from `@dloizides/utils` >= 1.8.0 is
|
|
500
|
+
* (it refuses to release a record still inside its cooldown); a plain "reset my
|
|
501
|
+
* counter" callback is not.
|
|
476
502
|
*/
|
|
477
503
|
onMount?: () => void;
|
|
478
504
|
/**
|
|
@@ -510,4 +536,4 @@ declare class AppErrorBoundary extends Component<AppErrorBoundaryProps, AppError
|
|
|
510
536
|
render(): ReactNode;
|
|
511
537
|
}
|
|
512
538
|
|
|
513
|
-
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, ConfirmDialog, type ConfirmDialogProps, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorState, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, 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, createToastBus, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|
|
539
|
+
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, ConfirmDialog, type ConfirmDialogProps, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, 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, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, 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, createToastBus, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|
package/dist/index.d.ts
CHANGED
|
@@ -80,16 +80,37 @@ declare const FEEDBACK_TEST_IDS: {
|
|
|
80
80
|
readonly errorBoundary: "error-boundary";
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Opt-in pieces of ErrorState: the decorative icon well and the outline secondary action.
|
|
85
|
+
* Both read colours only from the injected theme.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
interface ErrorStateAction {
|
|
89
|
+
label: string;
|
|
90
|
+
hint: string;
|
|
91
|
+
onPress: () => void;
|
|
92
|
+
testID: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
83
95
|
/**
|
|
84
96
|
* ErrorState - generic error display with optional retry button.
|
|
97
|
+
*
|
|
98
|
+
* Opt-in (1.12.0): `title`, a decorative `icon` well and a `secondaryAction`. A caller
|
|
99
|
+
* passing none of them renders the same element tree as before.
|
|
85
100
|
*/
|
|
86
101
|
|
|
87
102
|
interface ErrorStateProps {
|
|
88
103
|
message: string;
|
|
89
104
|
onRetry?: () => void;
|
|
90
105
|
testID?: string;
|
|
106
|
+
/** Heading above the message (role="heading" on web). */
|
|
107
|
+
title?: string;
|
|
108
|
+
/** Rendered inside a circular well above the title; decorative (aria-hidden). */
|
|
109
|
+
icon?: React.ReactNode;
|
|
110
|
+
/** Outline button beside retry, e.g. "Back to library". */
|
|
111
|
+
secondaryAction?: ErrorStateAction;
|
|
91
112
|
}
|
|
92
|
-
declare const ErrorState: ({ message, onRetry, testID, }: ErrorStateProps) => React.ReactElement;
|
|
113
|
+
declare const ErrorState: ({ message, onRetry, testID, title, icon, secondaryAction, }: ErrorStateProps) => React.ReactElement;
|
|
93
114
|
|
|
94
115
|
/**
|
|
95
116
|
* EmptyListState - empty-collection message with an optional call-to-action.
|
|
@@ -469,10 +490,15 @@ interface AppErrorBoundaryProps {
|
|
|
469
490
|
retryable?: (error: Error) => boolean;
|
|
470
491
|
/**
|
|
471
492
|
* Called from `componentDidMount` ONLY when the mount was clean (nothing caught).
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
493
|
+
* Deliberately NOT called on an errored mount.
|
|
494
|
+
*
|
|
495
|
+
* ⚠️ A CLEAN MOUNT DOES NOT PROVE THE PAGE LOADED. On a lazy route the boundary commits
|
|
496
|
+
* clean because a Suspense fallback rendered, and the dynamic import rejects AFTER this
|
|
497
|
+
* fires. A guard released here is therefore released mid-failure, which is how the
|
|
498
|
+
* chunk-reload loop went unbounded. Anything wired here must be safe to call during the
|
|
499
|
+
* failure it bounds — `clearChunkRecoveryFlag` from `@dloizides/utils` >= 1.8.0 is
|
|
500
|
+
* (it refuses to release a record still inside its cooldown); a plain "reset my
|
|
501
|
+
* counter" callback is not.
|
|
476
502
|
*/
|
|
477
503
|
onMount?: () => void;
|
|
478
504
|
/**
|
|
@@ -510,4 +536,4 @@ declare class AppErrorBoundary extends Component<AppErrorBoundaryProps, AppError
|
|
|
510
536
|
render(): ReactNode;
|
|
511
537
|
}
|
|
512
538
|
|
|
513
|
-
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, ConfirmDialog, type ConfirmDialogProps, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorState, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, 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, createToastBus, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|
|
539
|
+
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, ConfirmDialog, type ConfirmDialogProps, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, 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, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, 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, createToastBus, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|