@dloizides/ui-feedback 1.12.0 → 1.14.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 CHANGED
@@ -1,174 +1,194 @@
1
- # Changelog
2
-
3
- ## 1.12.0
4
-
5
- Opt-in additions to `ErrorState` for full-screen error surfaces (an import-error or
6
- load-error screen that needs a heading, an icon and a way out other than retry). Every
7
- prop is optional: a caller passing none of them renders the same element tree as 1.11.0,
8
- pinned by `ErrorState.test.tsx` baseline snapshots recorded before the change.
9
-
10
- - **Add `title?: string`** — rendered above the message with `accessibilityRole="header"`
11
- (`role="heading"` on web), testID `${testID}-title`. When a title is present the message
12
- uses `theme.colors.textSecondary` instead of the error colour.
13
- - **Add `icon?: React.ReactNode`** — rendered inside a circular well tinted with
14
- `theme.semantic.error['500']` at low opacity; the well is `aria-hidden`, testID `${testID}-icon`.
15
- - **Add `secondaryAction?: ErrorStateAction`** (`{ label, hint, onPress, testID }`) — an
16
- outline button (`theme.colors.border`) laid out in a row beside retry.
17
- - **Export type `ErrorStateAction`.** No new colour literals; no new dependencies.
18
-
19
- ## 1.11.0
20
-
21
- Adopts `@dloizides/ui-motion` for `PageSkeleton`: the loader now shows a moving
22
- **shimmer** (a highlight band sweeping across each block) instead of an opacity pulse,
23
- so loading states read as modern/ant-design-like. There is now ONE shimmer
24
- implementation in the kit — the ui-motion `<Skeleton>` primitive — and `PageSkeleton`
25
- owns only the page LAYOUT (how many bars/blocks, their sizes and spacing).
26
-
27
- - **Add runtime dependency `@dloizides/ui-motion` (`^1.0.1`).**
28
- - **`PageSkeleton` internals reimplemented on ui-motion `<Skeleton>`.** Each placeholder
29
- block (header bar, list-row avatar + text lines, card) is now a `<Skeleton>` with the
30
- same `width`/`height`/`borderRadius`/base colour it had before. The bespoke
31
- `Animated.loop` opacity pulse (and its `Animated`/`Easing`/`Platform` imports) is gone.
32
- - **Reduced-motion is now handled by `<Skeleton>`** (via `@dloizides/rn-web-hooks`
33
- `useReducedMotion`): the sweep is suppressed and a static block is shown.
34
- - **Public API unchanged.** `PageSkeletonProps` (`rows`, `showHeader`, `variant`), the
35
- rendered layout, and the `page-skeleton` testID are identical to 1.9.0. Only the
36
- internal animated primitive was swapped.
37
- - `ToastHost` (fade+slide) is intentionally left as-is — it remains the reference
38
- enter/exit pattern.
39
-
40
- ## 1.7.0
41
-
42
- Closes the API gap that kept `kefi-web`, `erevna-web` and `katalogos-web` on their
43
- local `ErrorBoundary` copies. Those three vary the boundary **by error class** — a
44
- stale-chunk failure after a deploy needs different wording, no retry button, and no
45
- stack dump — which 1.6.0's static `labels` / boolean `showDetails` could not express.
46
- Every addition is opt-in; the pre-1.7.0 test suite passes unmodified.
47
-
48
- **The kit still does not know what a "chunk" is.** Apps inject the classification;
49
- the boundary only learns *whether retry is meaningful* and *what to say*.
50
-
51
- - **Add `retryable?: (error) => boolean`.** When it returns `false` the retry action is
52
- not rendered at all. Offering a button that re-renders straight back into the same
53
- missing chunk is worse than offering nothing. Default: every error is retryable
54
- (1.6.0 behaviour).
55
- - **Add `labelsFor?: (error) => Partial<ErrorBoundaryLabels>`,** merged OVER the static
56
- `labels`. Lets an app say "Update available" for a stale chunk without the kit knowing
57
- why — it sees only the resulting strings.
58
- - **Widen `showDetails` to `boolean | ((error) => boolean)`.** A predicate can suppress
59
- the dev-only block per error class (a hashed filename is noise, not signal). **A plain
60
- boolean behaves exactly as before.**
61
- - **Add `onMount?: () => void`,** called from `componentDidMount` ONLY when the mount was
62
- clean. The three apps release their one-shot reload guard here: a clean mount proves the
63
- current chunks loaded, so a FUTURE deploy may auto-recover again. Deliberately not called
64
- on an errored mount — that would re-arm the guard during the very failure it bounds.
65
- - **Add `reloadIsPrimary?: boolean`** (default `false`). Gives Reload the filled emphasis
66
- and the first position instead of Try Again.
67
-
68
- **Why a flag rather than an unconditional swap:** `agora-web` and `zygos-web` both pass
69
- `onReload`, so simply inverting the priority would have silently restyled and reordered
70
- their error screens too. They have no chunk-recovery path, so retry is still the right
71
- primary there. The default preserves their rendering exactly; the three chunk-aware apps
72
- opt in.
73
-
74
- **Notably, `DEFAULT_ERROR_BOUNDARY_LABELS` gains no `updateTitle`/`updateMessage`.** Those
75
- are domain vocabulary — "an update is available" is a fact about the app's deploy model, not
76
- about error boundaries. `labelsFor` supplies them as ordinary `title`/`message` overrides,
77
- which keeps the kit's label bag domain-free.
78
-
79
- ### Fixed
80
-
81
- - **`AppErrorBoundary.test.tsx` had never actually run.** `jest.setup.ts` imports
82
- `@testing-library/jest-dom`, which registers matchers at runtime, but `tsconfig.test.json`
83
- listed no `types`, so ts-jest failed every `toBeInTheDocument()` with TS2339 and aborted the
84
- whole suite at compile time. It was the only suite using those matchers, so `npm test`
85
- reported a red SUITE while the other five stayed green and the true test count read 34.
86
- Adding `"types": ["jest", "node", "@testing-library/jest-dom"]` brings its 14 assertions
87
- online for the first time — unmodified, and passing against the 1.7.0 source.
88
-
89
- ## 1.6.0
90
-
91
- Two fleet-wide duplicates extracted (W1.2 + W1.3). Both are purely additive — every
92
- existing export is unchanged.
93
-
94
- - **Add `createToastBus()` — the shared toast EMIT half (W1.2).** Promoted from the three
95
- hand-rolled ~25-line twins in `aml-v2` (`components/toast.ts` — `emitToast`/`subscribeToasts`),
96
- `agora-web` and `zygos-web` (`lib/toastBus.ts` — `toastSuccess`/`toastError`). The returned
97
- bus is a superset: `subscribe` (the `<ToastHost>` port), `emit(text, type?)`, and the
98
- `success`/`error`/`info` shorthands.
99
-
100
- **Deliberately framework-agnostic — no React import, no hook, no provider.** Call sites are
101
- React Query mutation `onSuccess`/`onError` callbacks with no component context in scope, so a
102
- hook-based API would break every one of them. It carries no styling: `<ToastHost>` themes each
103
- toast from `UiProvider`. Text passed in is already localized by the caller.
104
-
105
- New exports: `createToastBus`, `ToastBus`, `ToastPush`.
106
-
107
- - **Add `<AppErrorBoundary>` — the shared top-level error boundary (W1.3).** Promoted from the
108
- SIX app-local copies (`agora-web` + `zygos-web` byte-identical, `kefi-web`, `erevna-web`,
109
- `katalogos-web`, `ichnos-web`); `aml-v2` had none at all. The axes that actually varied are now
110
- injected rather than baked in: `onError` (Sentry/logger), `recover` (the apps' chunk-load
111
- retry), `showDetails` (dev-only error text), `labels` (pre-localized bag), `testIDPrefix`,
112
- and `fallback` (escape hatch). An optional `onReload` renders the manual **Reload** action
113
- that kefi/erevna/katalogos shipped alongside **Try Again**.
114
-
115
- Two behaviour fixes come with the extraction:
116
- - **Themed.** The fallback renders through the shared `<ErrorState>`, so it reads
117
- `UiProvider` colours — this removes the 40+ hardcoded Bootstrap-4 hex literals
118
- (`#f8f9fa`, `#212529`, `#6c757d`, `#fff3cd`, `#856404`, `#007bff`, …) three copies carried.
119
- - **Announced.** The fallback ships `role="alert"` + `accessibilityLiveRegion="assertive"`;
120
- none of the six announced anything to a screen reader, and agora/zygos rendered only the
121
- app *name* with no message and no retry.
122
-
123
- New exports: `AppErrorBoundary`, `AppErrorBoundaryProps`, `ErrorFallbackState`,
124
- `ErrorBoundaryLabels`, `DEFAULT_ERROR_BOUNDARY_LABELS`, plus the `errorBoundary` id in
125
- `FEEDBACK_TEST_IDS` (default prefix `error-boundary`, preserving the existing
126
- `error-boundary-retry-button` / `-reload-button` / `-updating` Playwright selectors).
127
-
128
- ## 1.5.0
129
-
130
- - **Accessibility (WCAG 2.1 AA) — `ToastHost` announcements.** Each toast is now a live region so
131
- a screen reader announces it (WCAG 4.1.3): success/info toasts render as `role="status"` with
132
- `aria-live="polite"`, error toasts escalate to `role="alert"` with `aria-live="assertive"`
133
- (`accessibilityLiveRegion` set for native parity). Rendering, timing and testIDs are unchanged —
134
- additive + backward-compatible.
135
-
136
- ## 1.3.0
137
-
138
- - Add `ToastHost` — the shared, tokenized transient-toast overlay promoted from the
139
- byte-identical erevna-web / katalogos-web `ToastContainer` twins. Rendering (animated
140
- fade, positioning, theming) lives here; the emit pipeline stays in the app and is wired
141
- in via the `subscribe` port (`(push) => unsubscribe`). Colours come from the UiProvider
142
- theme. New exports: `ToastHost`, `ToastHostProps`, `ToastInput`, `ToastType`, plus the
143
- `notificationToast` id in `FEEDBACK_TEST_IDS` (default toast testID `notification-toast`,
144
- preserving existing Playwright selectors).
145
-
146
- ## 1.2.0
147
-
148
- - Broaden the injected theme so the settings-hub kit can consume it: colour scales are now
149
- addressable at any step (`[step]`), and `palette`/`semantic` accept named scales beyond
150
- `primary`/`error` (e.g. `secondary`, `accent`, `success`, `warning`, `info`) via index signatures.
151
- Purely additive — existing `{primary}`/`{error}` themes still satisfy the types. Default value now
152
- includes the common extra scales so no-provider rendering never reads `undefined`.
153
-
154
- ## 1.1.0
155
-
156
- - Add `colors.surface` to the injected theme (needed by the ui-forms kit; apps already pass it).
157
- - Export neutral aliases `UiProvider` / `useUi` (+ `Ui*` types) for the feedback-specific
158
- `FeedbackUiProvider` / `useFeedbackUi`. ui-feedback is now the shared UI context for the kit;
159
- sibling packages (ui-forms, ui-tables, …) consume `useUi` instead of duplicating the provider.
160
-
161
- ## 1.0.2
162
-
163
- - `useFeedbackUi` now falls back to a neutral default theme + identity translate when no
164
- `FeedbackUiProvider` is mounted (graceful degradation), instead of throwing. Apps still
165
- mount a provider for the real theme/i18n; isolated tests render without one.
166
-
167
- ## 1.0.0
168
-
169
- Initial release. Extracted the proven duplicated feedback components from erevna-web ↔
170
- katalogos-web (Capability Wave C1, batch 1).
171
-
172
- - `FeedbackUiProvider` + `useFeedbackUi` — injectable theme/translate/navigate context.
173
- - `ErrorState`, `EmptyListState`, `LoadingFallback`, `PageSkeleton`, `ConfirmDialog`.
174
- - `FEEDBACK_TEST_IDS`, `MODAL_OVERLAY_COLOR`, `DISABLED_OPACITY` constants.
1
+ # Changelog
2
+
3
+ ## 1.14.0
4
+
5
+ - **`ToastHost` portals to `document.body` on web (`position: fixed`, `Z_INDEX.toast`).** In-tree,
6
+ the layer sat inside RN-web Views that each carry `position: relative; z-index: 0`, so its 10100
7
+ was trapped and an open `ConfirmDialog` / RN `Modal` (9999, body-level) painted over the toast
8
+ (measured on ui.dloizides.com/feedback: `elementFromPoint` at the toast centre returned the
9
+ dialog). Same mechanism as `ui-forms` `menuPortal` and `ui-tables` `SizeDropdown`. Native is
10
+ unchanged (in-tree). `react-dom` is now an optional peer dependency.
11
+
12
+ ## 1.13.0
13
+
14
+ Overlay stacking now comes from the shared `@dloizides/design-tokens` `Z_INDEX` scale
15
+ (added as a dependency, `^1.13.0`) instead of local literals.
16
+
17
+ - **`ToastHost` layer: 9999 -> `Z_INDEX.toast` (10100).** A toast now paints above an open
18
+ portalled menu (`Z_INDEX.popover`, 10000) and above an RN-web `Modal` (9999). At 9999 an open
19
+ dropdown covered the toast. Pinned by a `ToastHost.test.tsx` case that reads the computed
20
+ `z-index` of the toast layer.
21
+ - **`WarmingOverlay`: literal 100000 -> `Z_INDEX.blocking`.** Same value, so nothing changes visually.
22
+
23
+ ## 1.12.0
24
+
25
+ Opt-in additions to `ErrorState` for full-screen error surfaces (an import-error or
26
+ load-error screen that needs a heading, an icon and a way out other than retry). Every
27
+ prop is optional: a caller passing none of them renders the same element tree as 1.11.0,
28
+ pinned by `ErrorState.test.tsx` baseline snapshots recorded before the change.
29
+
30
+ - **Add `title?: string`** — rendered above the message with `accessibilityRole="header"`
31
+ (`role="heading"` on web), testID `${testID}-title`. When a title is present the message
32
+ uses `theme.colors.textSecondary` instead of the error colour.
33
+ - **Add `icon?: React.ReactNode`** — rendered inside a circular well tinted with
34
+ `theme.semantic.error['500']` at low opacity; the well is `aria-hidden`, testID `${testID}-icon`.
35
+ - **Add `secondaryAction?: ErrorStateAction`** (`{ label, hint, onPress, testID }`) — an
36
+ outline button (`theme.colors.border`) laid out in a row beside retry.
37
+ - **Export type `ErrorStateAction`.** No new colour literals; no new dependencies.
38
+
39
+ ## 1.11.0
40
+
41
+ Adopts `@dloizides/ui-motion` for `PageSkeleton`: the loader now shows a moving
42
+ **shimmer** (a highlight band sweeping across each block) instead of an opacity pulse,
43
+ so loading states read as modern/ant-design-like. There is now ONE shimmer
44
+ implementation in the kit — the ui-motion `<Skeleton>` primitive — and `PageSkeleton`
45
+ owns only the page LAYOUT (how many bars/blocks, their sizes and spacing).
46
+
47
+ - **Add runtime dependency `@dloizides/ui-motion` (`^1.0.1`).**
48
+ - **`PageSkeleton` internals reimplemented on ui-motion `<Skeleton>`.** Each placeholder
49
+ block (header bar, list-row avatar + text lines, card) is now a `<Skeleton>` with the
50
+ same `width`/`height`/`borderRadius`/base colour it had before. The bespoke
51
+ `Animated.loop` opacity pulse (and its `Animated`/`Easing`/`Platform` imports) is gone.
52
+ - **Reduced-motion is now handled by `<Skeleton>`** (via `@dloizides/rn-web-hooks`
53
+ `useReducedMotion`): the sweep is suppressed and a static block is shown.
54
+ - **Public API unchanged.** `PageSkeletonProps` (`rows`, `showHeader`, `variant`), the
55
+ rendered layout, and the `page-skeleton` testID are identical to 1.9.0. Only the
56
+ internal animated primitive was swapped.
57
+ - `ToastHost` (fade+slide) is intentionally left as-is — it remains the reference
58
+ enter/exit pattern.
59
+
60
+ ## 1.7.0
61
+
62
+ Closes the API gap that kept `kefi-web`, `erevna-web` and `katalogos-web` on their
63
+ local `ErrorBoundary` copies. Those three vary the boundary **by error class** — a
64
+ stale-chunk failure after a deploy needs different wording, no retry button, and no
65
+ stack dump — which 1.6.0's static `labels` / boolean `showDetails` could not express.
66
+ Every addition is opt-in; the pre-1.7.0 test suite passes unmodified.
67
+
68
+ **The kit still does not know what a "chunk" is.** Apps inject the classification;
69
+ the boundary only learns *whether retry is meaningful* and *what to say*.
70
+
71
+ - **Add `retryable?: (error) => boolean`.** When it returns `false` the retry action is
72
+ not rendered at all. Offering a button that re-renders straight back into the same
73
+ missing chunk is worse than offering nothing. Default: every error is retryable
74
+ (1.6.0 behaviour).
75
+ - **Add `labelsFor?: (error) => Partial<ErrorBoundaryLabels>`,** merged OVER the static
76
+ `labels`. Lets an app say "Update available" for a stale chunk without the kit knowing
77
+ why — it sees only the resulting strings.
78
+ - **Widen `showDetails` to `boolean | ((error) => boolean)`.** A predicate can suppress
79
+ the dev-only block per error class (a hashed filename is noise, not signal). **A plain
80
+ boolean behaves exactly as before.**
81
+ - **Add `onMount?: () => void`,** called from `componentDidMount` ONLY when the mount was
82
+ clean. The three apps release their one-shot reload guard here: a clean mount proves the
83
+ current chunks loaded, so a FUTURE deploy may auto-recover again. Deliberately not called
84
+ on an errored mount — that would re-arm the guard during the very failure it bounds.
85
+ - **Add `reloadIsPrimary?: boolean`** (default `false`). Gives Reload the filled emphasis
86
+ and the first position instead of Try Again.
87
+
88
+ **Why a flag rather than an unconditional swap:** `agora-web` and `zygos-web` both pass
89
+ `onReload`, so simply inverting the priority would have silently restyled and reordered
90
+ their error screens too. They have no chunk-recovery path, so retry is still the right
91
+ primary there. The default preserves their rendering exactly; the three chunk-aware apps
92
+ opt in.
93
+
94
+ **Notably, `DEFAULT_ERROR_BOUNDARY_LABELS` gains no `updateTitle`/`updateMessage`.** Those
95
+ are domain vocabulary — "an update is available" is a fact about the app's deploy model, not
96
+ about error boundaries. `labelsFor` supplies them as ordinary `title`/`message` overrides,
97
+ which keeps the kit's label bag domain-free.
98
+
99
+ ### Fixed
100
+
101
+ - **`AppErrorBoundary.test.tsx` had never actually run.** `jest.setup.ts` imports
102
+ `@testing-library/jest-dom`, which registers matchers at runtime, but `tsconfig.test.json`
103
+ listed no `types`, so ts-jest failed every `toBeInTheDocument()` with TS2339 and aborted the
104
+ whole suite at compile time. It was the only suite using those matchers, so `npm test`
105
+ reported a red SUITE while the other five stayed green and the true test count read 34.
106
+ Adding `"types": ["jest", "node", "@testing-library/jest-dom"]` brings its 14 assertions
107
+ online for the first time — unmodified, and passing against the 1.7.0 source.
108
+
109
+ ## 1.6.0
110
+
111
+ Two fleet-wide duplicates extracted (W1.2 + W1.3). Both are purely additive — every
112
+ existing export is unchanged.
113
+
114
+ - **Add `createToastBus()` — the shared toast EMIT half (W1.2).** Promoted from the three
115
+ hand-rolled ~25-line twins in `aml-v2` (`components/toast.ts` — `emitToast`/`subscribeToasts`),
116
+ `agora-web` and `zygos-web` (`lib/toastBus.ts` — `toastSuccess`/`toastError`). The returned
117
+ bus is a superset: `subscribe` (the `<ToastHost>` port), `emit(text, type?)`, and the
118
+ `success`/`error`/`info` shorthands.
119
+
120
+ **Deliberately framework-agnostic — no React import, no hook, no provider.** Call sites are
121
+ React Query mutation `onSuccess`/`onError` callbacks with no component context in scope, so a
122
+ hook-based API would break every one of them. It carries no styling: `<ToastHost>` themes each
123
+ toast from `UiProvider`. Text passed in is already localized by the caller.
124
+
125
+ New exports: `createToastBus`, `ToastBus`, `ToastPush`.
126
+
127
+ - **Add `<AppErrorBoundary>` — the shared top-level error boundary (W1.3).** Promoted from the
128
+ SIX app-local copies (`agora-web` + `zygos-web` byte-identical, `kefi-web`, `erevna-web`,
129
+ `katalogos-web`, `ichnos-web`); `aml-v2` had none at all. The axes that actually varied are now
130
+ injected rather than baked in: `onError` (Sentry/logger), `recover` (the apps' chunk-load
131
+ retry), `showDetails` (dev-only error text), `labels` (pre-localized bag), `testIDPrefix`,
132
+ and `fallback` (escape hatch). An optional `onReload` renders the manual **Reload** action
133
+ that kefi/erevna/katalogos shipped alongside **Try Again**.
134
+
135
+ Two behaviour fixes come with the extraction:
136
+ - **Themed.** The fallback renders through the shared `<ErrorState>`, so it reads
137
+ `UiProvider` colours — this removes the 40+ hardcoded Bootstrap-4 hex literals
138
+ (`#f8f9fa`, `#212529`, `#6c757d`, `#fff3cd`, `#856404`, `#007bff`, …) three copies carried.
139
+ - **Announced.** The fallback ships `role="alert"` + `accessibilityLiveRegion="assertive"`;
140
+ none of the six announced anything to a screen reader, and agora/zygos rendered only the
141
+ app *name* with no message and no retry.
142
+
143
+ New exports: `AppErrorBoundary`, `AppErrorBoundaryProps`, `ErrorFallbackState`,
144
+ `ErrorBoundaryLabels`, `DEFAULT_ERROR_BOUNDARY_LABELS`, plus the `errorBoundary` id in
145
+ `FEEDBACK_TEST_IDS` (default prefix `error-boundary`, preserving the existing
146
+ `error-boundary-retry-button` / `-reload-button` / `-updating` Playwright selectors).
147
+
148
+ ## 1.5.0
149
+
150
+ - **Accessibility (WCAG 2.1 AA) — `ToastHost` announcements.** Each toast is now a live region so
151
+ a screen reader announces it (WCAG 4.1.3): success/info toasts render as `role="status"` with
152
+ `aria-live="polite"`, error toasts escalate to `role="alert"` with `aria-live="assertive"`
153
+ (`accessibilityLiveRegion` set for native parity). Rendering, timing and testIDs are unchanged —
154
+ additive + backward-compatible.
155
+
156
+ ## 1.3.0
157
+
158
+ - Add `ToastHost` — the shared, tokenized transient-toast overlay promoted from the
159
+ byte-identical erevna-web / katalogos-web `ToastContainer` twins. Rendering (animated
160
+ fade, positioning, theming) lives here; the emit pipeline stays in the app and is wired
161
+ in via the `subscribe` port (`(push) => unsubscribe`). Colours come from the UiProvider
162
+ theme. New exports: `ToastHost`, `ToastHostProps`, `ToastInput`, `ToastType`, plus the
163
+ `notificationToast` id in `FEEDBACK_TEST_IDS` (default toast testID `notification-toast`,
164
+ preserving existing Playwright selectors).
165
+
166
+ ## 1.2.0
167
+
168
+ - Broaden the injected theme so the settings-hub kit can consume it: colour scales are now
169
+ addressable at any step (`[step]`), and `palette`/`semantic` accept named scales beyond
170
+ `primary`/`error` (e.g. `secondary`, `accent`, `success`, `warning`, `info`) via index signatures.
171
+ Purely additive — existing `{primary}`/`{error}` themes still satisfy the types. Default value now
172
+ includes the common extra scales so no-provider rendering never reads `undefined`.
173
+
174
+ ## 1.1.0
175
+
176
+ - Add `colors.surface` to the injected theme (needed by the ui-forms kit; apps already pass it).
177
+ - Export neutral aliases `UiProvider` / `useUi` (+ `Ui*` types) for the feedback-specific
178
+ `FeedbackUiProvider` / `useFeedbackUi`. ui-feedback is now the shared UI context for the kit;
179
+ sibling packages (ui-forms, ui-tables, …) consume `useUi` instead of duplicating the provider.
180
+
181
+ ## 1.0.2
182
+
183
+ - `useFeedbackUi` now falls back to a neutral default theme + identity translate when no
184
+ `FeedbackUiProvider` is mounted (graceful degradation), instead of throwing. Apps still
185
+ mount a provider for the real theme/i18n; isolated tests render without one.
186
+
187
+ ## 1.0.0
188
+
189
+ Initial release. Extracted the proven duplicated feedback components from erevna-web ↔
190
+ katalogos-web (Capability Wave C1, batch 1).
191
+
192
+ - `FeedbackUiProvider` + `useFeedbackUi` — injectable theme/translate/navigate context.
193
+ - `ErrorState`, `EmptyListState`, `LoadingFallback`, `PageSkeleton`, `ConfirmDialog`.
194
+ - `FEEDBACK_TEST_IDS`, `MODAL_OVERLAY_COLOR`, `DISABLED_OPACITY` constants.
package/dist/index.d.mts CHANGED
@@ -238,6 +238,12 @@ declare const ConfirmDialog: ({ visible, title, message, onConfirm, onCancel, co
238
238
  * toast emitter). The app wires the two together via the `subscribe` port: a
239
239
  * function that registers a push callback and returns an unsubscribe. Colours
240
240
  * come from the UiProvider theme (`useUi`) — nothing hardcoded.
241
+ *
242
+ * STACKING (web): react-native-web gives every `View` `position: relative; z-index: 0`, so an
243
+ * in-tree absolute layer's `Z_INDEX.toast` is trapped inside its ancestors' stacking contexts and a
244
+ * body-level RN `Modal` / ConfirmDialog (`Z_INDEX.modal`) paints over it. On web the layer is
245
+ * therefore portalled to `document.body` with `position: fixed`, the same mechanism as
246
+ * `@dloizides/ui-forms` `menuPortal` and `@dloizides/ui-tables` `SizeDropdown`. Native stays in-tree.
241
247
  */
242
248
 
243
249
  type ToastType = 'success' | 'info' | 'error';
package/dist/index.d.ts CHANGED
@@ -238,6 +238,12 @@ declare const ConfirmDialog: ({ visible, title, message, onConfirm, onCancel, co
238
238
  * toast emitter). The app wires the two together via the `subscribe` port: a
239
239
  * function that registers a push callback and returns an unsubscribe. Colours
240
240
  * come from the UiProvider theme (`useUi`) — nothing hardcoded.
241
+ *
242
+ * STACKING (web): react-native-web gives every `View` `position: relative; z-index: 0`, so an
243
+ * in-tree absolute layer's `Z_INDEX.toast` is trapped inside its ancestors' stacking contexts and a
244
+ * body-level RN `Modal` / ConfirmDialog (`Z_INDEX.modal`) paints over it. On web the layer is
245
+ * therefore portalled to `document.body` with `position: fixed`, the same mechanism as
246
+ * `@dloizides/ui-forms` `menuPortal` and `@dloizides/ui-tables` `SizeDropdown`. Native stays in-tree.
241
247
  */
242
248
 
243
249
  type ToastType = 'success' | 'info' | 'error';
package/dist/index.js CHANGED
@@ -4,6 +4,8 @@ var react = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var reactNative = require('react-native');
6
6
  var uiMotion = require('@dloizides/ui-motion');
7
+ var reactDom = require('react-dom');
8
+ var designTokens = require('@dloizides/design-tokens');
7
9
 
8
10
  // src/context/FeedbackUiContext.tsx
9
11
  var DEFAULT_FEEDBACK_VALUE = {
@@ -576,13 +578,14 @@ var ConfirmDialog = ({
576
578
  }
577
579
  );
578
580
  };
581
+ var IS_WEB = reactNative.Platform.OS === "web";
582
+ var WEB_FIXED_LAYER = { position: "fixed" };
579
583
  var DEFAULT_DURATION_MS = 3e3;
580
584
  var DEFAULT_FADE_MS = 200;
581
585
  var DEFAULT_MAX_LENGTH = 500;
582
586
  var TOAST_TOP_WEB = 10;
583
587
  var TOAST_TOP_MOBILE = 40;
584
588
  var TOAST_HORIZONTAL_MARGIN = 10;
585
- var TOAST_Z_INDEX = 9999;
586
589
  var TOAST_INITIAL_TRANSLATE_Y = -6;
587
590
  var TOAST_MAX_WIDTH = 600;
588
591
  var TOAST_PADDING_HORIZONTAL = 16;
@@ -602,7 +605,7 @@ var styles7 = reactNative.StyleSheet.create({
602
605
  left: TOAST_HORIZONTAL_MARGIN,
603
606
  right: TOAST_HORIZONTAL_MARGIN,
604
607
  alignItems: "center",
605
- zIndex: TOAST_Z_INDEX,
608
+ zIndex: designTokens.Z_INDEX.toast,
606
609
  pointerEvents: "box-none"
607
610
  },
608
611
  toast: {
@@ -700,7 +703,8 @@ var ToastHost = ({
700
703
  }, []);
701
704
  react.useEffect(() => subscribe(push), [subscribe, push]);
702
705
  if (messages.length === 0) return null;
703
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles7.container, children: messages.map((m) => /* @__PURE__ */ jsxRuntime.jsx(
706
+ const canPortal = IS_WEB && typeof document !== "undefined";
707
+ const layer = /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles7.container, canPortal ? WEB_FIXED_LAYER : null], children: messages.map((m) => /* @__PURE__ */ jsxRuntime.jsx(
704
708
  ToastItem,
705
709
  {
706
710
  colors,
@@ -712,6 +716,7 @@ var ToastHost = ({
712
716
  },
713
717
  m.id
714
718
  )) });
719
+ return canPortal ? reactDom.createPortal(layer, document.body) : layer;
715
720
  };
716
721
 
717
722
  // src/Warming/warmingStore.ts
@@ -769,7 +774,6 @@ function subscribeWarming(listener) {
769
774
  function getWarmingSnapshot() {
770
775
  return snapshot;
771
776
  }
772
- var OVERLAY_Z_INDEX = 1e5;
773
777
  var CARD_GAP = 12;
774
778
  var TITLE_FONT_SIZE2 = 20;
775
779
  var SUBTITLE_FONT_SIZE = 15;
@@ -785,8 +789,8 @@ var styles8 = reactNative.StyleSheet.create({
785
789
  bottom: 0,
786
790
  alignItems: "center",
787
791
  justifyContent: "center",
788
- zIndex: OVERLAY_Z_INDEX,
789
- elevation: OVERLAY_Z_INDEX,
792
+ zIndex: designTokens.Z_INDEX.blocking,
793
+ elevation: designTokens.Z_INDEX.blocking,
790
794
  padding: CARD_PADDING
791
795
  },
792
796
  card: {