@dloizides/ui-feedback 1.3.1 → 1.5.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 +8 -0
- package/dist/index.d.mts +89 -1
- package/dist/index.d.ts +89 -1
- package/dist/index.js +142 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +138 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.0
|
|
4
|
+
|
|
5
|
+
- **Accessibility (WCAG 2.1 AA) — `ToastHost` announcements.** Each toast is now a live region so
|
|
6
|
+
a screen reader announces it (WCAG 4.1.3): success/info toasts render as `role="status"` with
|
|
7
|
+
`aria-live="polite"`, error toasts escalate to `role="alert"` with `aria-live="assertive"`
|
|
8
|
+
(`accessibilityLiveRegion` set for native parity). Rendering, timing and testIDs are unchanged —
|
|
9
|
+
additive + backward-compatible.
|
|
10
|
+
|
|
3
11
|
## 1.3.0
|
|
4
12
|
|
|
5
13
|
- Add `ToastHost` — the shared, tokenized transient-toast overlay promoted from the
|
package/dist/index.d.mts
CHANGED
|
@@ -76,6 +76,7 @@ declare const FEEDBACK_TEST_IDS: {
|
|
|
76
76
|
readonly confirmButton: "confirm-button";
|
|
77
77
|
readonly cancelConfirmButton: "cancel-confirm-button";
|
|
78
78
|
readonly notificationToast: "notification-toast";
|
|
79
|
+
readonly warmingOverlay: "warming-overlay";
|
|
79
80
|
};
|
|
80
81
|
|
|
81
82
|
/**
|
|
@@ -189,4 +190,91 @@ interface ToastHostProps {
|
|
|
189
190
|
}
|
|
190
191
|
declare const ToastHost: ({ subscribe, durationMs, fadeMs, maxLength, toastTestID, }: ToastHostProps) => React.ReactElement | null;
|
|
191
192
|
|
|
192
|
-
|
|
193
|
+
/**
|
|
194
|
+
* WarmingOverlay — a calm, branded, full-screen "warming up…" overlay for the
|
|
195
|
+
* cold-start UX (Move 3a). It subscribes to the framework-agnostic warmingStore
|
|
196
|
+
* via `useSyncExternalStore` and renders ONLY while `isWarming`, then disappears
|
|
197
|
+
* on auto-settle (so it never permanently traps focus).
|
|
198
|
+
*
|
|
199
|
+
* This is intentionally NOT an error state: a title + subtitle + spinner, with an
|
|
200
|
+
* optional attempt hint. Colours come from the UiProvider theme (`useFeedbackUi`)
|
|
201
|
+
* or an explicit `theme` override — nothing hardcoded. Copy comes from `labels`,
|
|
202
|
+
* a typed bag with English defaults merged with a partial override, so consuming
|
|
203
|
+
* apps can localize but nothing breaks without it.
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
/** Copy for the overlay. All fields have English defaults; apps override any subset. */
|
|
207
|
+
interface WarmingOverlayLabels {
|
|
208
|
+
/** Big line, e.g. "Warming up…". */
|
|
209
|
+
title: string;
|
|
210
|
+
/** Reassuring second line, e.g. "This only takes a moment". */
|
|
211
|
+
subtitle: string;
|
|
212
|
+
/** Screen-reader label for the whole overlay. */
|
|
213
|
+
accessibilityLabel: string;
|
|
214
|
+
/** Optional per-attempt hint, given the current attempt number. */
|
|
215
|
+
attemptHint: (attempt: number) => string;
|
|
216
|
+
}
|
|
217
|
+
interface WarmingOverlayProps {
|
|
218
|
+
/** Partial copy override; unset fields fall back to English defaults. */
|
|
219
|
+
labels?: Partial<WarmingOverlayLabels>;
|
|
220
|
+
/** Theme override; defaults to the mounted UiProvider theme. */
|
|
221
|
+
theme?: FeedbackTheme;
|
|
222
|
+
/** testID for the overlay container (children derive `${prefix}-title`, etc.). */
|
|
223
|
+
testIdPrefix?: string;
|
|
224
|
+
/** Show the "Attempt N" hint under the subtitle (default: false). */
|
|
225
|
+
showAttempt?: boolean;
|
|
226
|
+
}
|
|
227
|
+
declare const WarmingOverlay: ({ labels, theme: themeOverride, testIdPrefix, showAttempt, }: WarmingOverlayProps) => React.ReactElement | null;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* warmingStore — a tiny, framework-agnostic (no React) store for the cold-start
|
|
231
|
+
* "warming up…" UX (Move 3a).
|
|
232
|
+
*
|
|
233
|
+
* On a resource-tight, scale-to-zero prod node the BFF/upstream can be cold on the
|
|
234
|
+
* FIRST request after idle. `@dloizides/bff-web-client`'s `warmupRetryInterceptor`
|
|
235
|
+
* transparently retries the 502/503/504 and fires `onWarmupRetry({ attempt, … })`
|
|
236
|
+
* per retry — but it has NO "recovered" signal (it only fires on retries, never on
|
|
237
|
+
* the eventual success). So an app wires its `onWarmupRetry` to `notifyWarming(...)`
|
|
238
|
+
* here, and this store AUTO-SETTLES `isWarming` back to false after a quiet period
|
|
239
|
+
* with no new notify (i.e. the request finally succeeded and retries stopped).
|
|
240
|
+
*
|
|
241
|
+
* Shaped for React's `useSyncExternalStore`: `subscribeWarming` + `getWarmingSnapshot`
|
|
242
|
+
* (the snapshot object identity only changes when the value changes, so no render loop).
|
|
243
|
+
* SSR/no-DOM safe (timer is guarded, no `window`) and deterministic (no `Date.now()` /
|
|
244
|
+
* `Math.random()`).
|
|
245
|
+
*/
|
|
246
|
+
/**
|
|
247
|
+
* How long (ms) the store stays "warming" after the LAST `notifyWarming` before it
|
|
248
|
+
* auto-clears. Sized a touch above the interceptor's largest backoff so a genuine
|
|
249
|
+
* retry storm keeps the overlay up, but a recovered request lets it settle.
|
|
250
|
+
*/
|
|
251
|
+
declare const WARMING_QUIET_PERIOD_MS = 2500;
|
|
252
|
+
/** What an app forwards from the interceptor's `onWarmupRetry` callback. */
|
|
253
|
+
interface WarmingInfo {
|
|
254
|
+
attempt: number;
|
|
255
|
+
maxRetries?: number;
|
|
256
|
+
status?: number;
|
|
257
|
+
}
|
|
258
|
+
/** Immutable snapshot read by `useSyncExternalStore`. */
|
|
259
|
+
interface WarmingSnapshot {
|
|
260
|
+
isWarming: boolean;
|
|
261
|
+
attempt: number;
|
|
262
|
+
}
|
|
263
|
+
type WarmingListener = () => void;
|
|
264
|
+
/**
|
|
265
|
+
* Mark the store "warming" and record the latest retry attempt. Resets the
|
|
266
|
+
* auto-settle timer, so as long as retries keep arriving the overlay stays up.
|
|
267
|
+
* Call this from an app's `onWarmupRetry`.
|
|
268
|
+
*/
|
|
269
|
+
declare function notifyWarming(info: WarmingInfo): void;
|
|
270
|
+
/**
|
|
271
|
+
* Force-clear the warming state (for tests, or to wire an explicit success signal
|
|
272
|
+
* later). Also cancels any pending auto-settle timer. No-op when already idle.
|
|
273
|
+
*/
|
|
274
|
+
declare function settleWarming(): void;
|
|
275
|
+
/** Register a listener; returns an unsubscribe. Shaped for `useSyncExternalStore`. */
|
|
276
|
+
declare function subscribeWarming(listener: WarmingListener): () => void;
|
|
277
|
+
/** Current immutable snapshot. Stable identity until the value changes. */
|
|
278
|
+
declare function getWarmingSnapshot(): WarmingSnapshot;
|
|
279
|
+
|
|
280
|
+
export { ConfirmDialog, type ConfirmDialogProps, DISABLED_OPACITY, EmptyListState, type EmptyListStateProps, 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, ToastHost, type ToastHostProps, type ToastInput, 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, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|
package/dist/index.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ declare const FEEDBACK_TEST_IDS: {
|
|
|
76
76
|
readonly confirmButton: "confirm-button";
|
|
77
77
|
readonly cancelConfirmButton: "cancel-confirm-button";
|
|
78
78
|
readonly notificationToast: "notification-toast";
|
|
79
|
+
readonly warmingOverlay: "warming-overlay";
|
|
79
80
|
};
|
|
80
81
|
|
|
81
82
|
/**
|
|
@@ -189,4 +190,91 @@ interface ToastHostProps {
|
|
|
189
190
|
}
|
|
190
191
|
declare const ToastHost: ({ subscribe, durationMs, fadeMs, maxLength, toastTestID, }: ToastHostProps) => React.ReactElement | null;
|
|
191
192
|
|
|
192
|
-
|
|
193
|
+
/**
|
|
194
|
+
* WarmingOverlay — a calm, branded, full-screen "warming up…" overlay for the
|
|
195
|
+
* cold-start UX (Move 3a). It subscribes to the framework-agnostic warmingStore
|
|
196
|
+
* via `useSyncExternalStore` and renders ONLY while `isWarming`, then disappears
|
|
197
|
+
* on auto-settle (so it never permanently traps focus).
|
|
198
|
+
*
|
|
199
|
+
* This is intentionally NOT an error state: a title + subtitle + spinner, with an
|
|
200
|
+
* optional attempt hint. Colours come from the UiProvider theme (`useFeedbackUi`)
|
|
201
|
+
* or an explicit `theme` override — nothing hardcoded. Copy comes from `labels`,
|
|
202
|
+
* a typed bag with English defaults merged with a partial override, so consuming
|
|
203
|
+
* apps can localize but nothing breaks without it.
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
/** Copy for the overlay. All fields have English defaults; apps override any subset. */
|
|
207
|
+
interface WarmingOverlayLabels {
|
|
208
|
+
/** Big line, e.g. "Warming up…". */
|
|
209
|
+
title: string;
|
|
210
|
+
/** Reassuring second line, e.g. "This only takes a moment". */
|
|
211
|
+
subtitle: string;
|
|
212
|
+
/** Screen-reader label for the whole overlay. */
|
|
213
|
+
accessibilityLabel: string;
|
|
214
|
+
/** Optional per-attempt hint, given the current attempt number. */
|
|
215
|
+
attemptHint: (attempt: number) => string;
|
|
216
|
+
}
|
|
217
|
+
interface WarmingOverlayProps {
|
|
218
|
+
/** Partial copy override; unset fields fall back to English defaults. */
|
|
219
|
+
labels?: Partial<WarmingOverlayLabels>;
|
|
220
|
+
/** Theme override; defaults to the mounted UiProvider theme. */
|
|
221
|
+
theme?: FeedbackTheme;
|
|
222
|
+
/** testID for the overlay container (children derive `${prefix}-title`, etc.). */
|
|
223
|
+
testIdPrefix?: string;
|
|
224
|
+
/** Show the "Attempt N" hint under the subtitle (default: false). */
|
|
225
|
+
showAttempt?: boolean;
|
|
226
|
+
}
|
|
227
|
+
declare const WarmingOverlay: ({ labels, theme: themeOverride, testIdPrefix, showAttempt, }: WarmingOverlayProps) => React.ReactElement | null;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* warmingStore — a tiny, framework-agnostic (no React) store for the cold-start
|
|
231
|
+
* "warming up…" UX (Move 3a).
|
|
232
|
+
*
|
|
233
|
+
* On a resource-tight, scale-to-zero prod node the BFF/upstream can be cold on the
|
|
234
|
+
* FIRST request after idle. `@dloizides/bff-web-client`'s `warmupRetryInterceptor`
|
|
235
|
+
* transparently retries the 502/503/504 and fires `onWarmupRetry({ attempt, … })`
|
|
236
|
+
* per retry — but it has NO "recovered" signal (it only fires on retries, never on
|
|
237
|
+
* the eventual success). So an app wires its `onWarmupRetry` to `notifyWarming(...)`
|
|
238
|
+
* here, and this store AUTO-SETTLES `isWarming` back to false after a quiet period
|
|
239
|
+
* with no new notify (i.e. the request finally succeeded and retries stopped).
|
|
240
|
+
*
|
|
241
|
+
* Shaped for React's `useSyncExternalStore`: `subscribeWarming` + `getWarmingSnapshot`
|
|
242
|
+
* (the snapshot object identity only changes when the value changes, so no render loop).
|
|
243
|
+
* SSR/no-DOM safe (timer is guarded, no `window`) and deterministic (no `Date.now()` /
|
|
244
|
+
* `Math.random()`).
|
|
245
|
+
*/
|
|
246
|
+
/**
|
|
247
|
+
* How long (ms) the store stays "warming" after the LAST `notifyWarming` before it
|
|
248
|
+
* auto-clears. Sized a touch above the interceptor's largest backoff so a genuine
|
|
249
|
+
* retry storm keeps the overlay up, but a recovered request lets it settle.
|
|
250
|
+
*/
|
|
251
|
+
declare const WARMING_QUIET_PERIOD_MS = 2500;
|
|
252
|
+
/** What an app forwards from the interceptor's `onWarmupRetry` callback. */
|
|
253
|
+
interface WarmingInfo {
|
|
254
|
+
attempt: number;
|
|
255
|
+
maxRetries?: number;
|
|
256
|
+
status?: number;
|
|
257
|
+
}
|
|
258
|
+
/** Immutable snapshot read by `useSyncExternalStore`. */
|
|
259
|
+
interface WarmingSnapshot {
|
|
260
|
+
isWarming: boolean;
|
|
261
|
+
attempt: number;
|
|
262
|
+
}
|
|
263
|
+
type WarmingListener = () => void;
|
|
264
|
+
/**
|
|
265
|
+
* Mark the store "warming" and record the latest retry attempt. Resets the
|
|
266
|
+
* auto-settle timer, so as long as retries keep arriving the overlay stays up.
|
|
267
|
+
* Call this from an app's `onWarmupRetry`.
|
|
268
|
+
*/
|
|
269
|
+
declare function notifyWarming(info: WarmingInfo): void;
|
|
270
|
+
/**
|
|
271
|
+
* Force-clear the warming state (for tests, or to wire an explicit success signal
|
|
272
|
+
* later). Also cancels any pending auto-settle timer. No-op when already idle.
|
|
273
|
+
*/
|
|
274
|
+
declare function settleWarming(): void;
|
|
275
|
+
/** Register a listener; returns an unsubscribe. Shaped for `useSyncExternalStore`. */
|
|
276
|
+
declare function subscribeWarming(listener: WarmingListener): () => void;
|
|
277
|
+
/** Current immutable snapshot. Stable identity until the value changes. */
|
|
278
|
+
declare function getWarmingSnapshot(): WarmingSnapshot;
|
|
279
|
+
|
|
280
|
+
export { ConfirmDialog, type ConfirmDialogProps, DISABLED_OPACITY, EmptyListState, type EmptyListStateProps, 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, ToastHost, type ToastHostProps, type ToastInput, 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, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,8 @@ var FEEDBACK_TEST_IDS = {
|
|
|
59
59
|
confirmDialog: "confirm-dialog",
|
|
60
60
|
confirmButton: "confirm-button",
|
|
61
61
|
cancelConfirmButton: "cancel-confirm-button",
|
|
62
|
-
notificationToast: "notification-toast"
|
|
62
|
+
notificationToast: "notification-toast",
|
|
63
|
+
warmingOverlay: "warming-overlay"
|
|
63
64
|
};
|
|
64
65
|
var MESSAGE_FONT_SIZE = 16;
|
|
65
66
|
var CONTAINER_PADDING = 20;
|
|
@@ -541,9 +542,12 @@ var ToastItem = ({ message, onDone, colors, durationMs, fadeMs, testID }) => {
|
|
|
541
542
|
}, durationMs);
|
|
542
543
|
return () => clearTimeout(hideTimer);
|
|
543
544
|
}, [handleDone, opacity, translateY, durationMs, fadeMs]);
|
|
545
|
+
const isError = message.type === "error";
|
|
544
546
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
545
547
|
reactNative.Animated.View,
|
|
546
548
|
{
|
|
549
|
+
accessibilityLiveRegion: isError ? "assertive" : "polite",
|
|
550
|
+
role: isError ? "alert" : "status",
|
|
547
551
|
style: [styles6.toast, { backgroundColor, transform: [{ translateY }], opacity }],
|
|
548
552
|
testID,
|
|
549
553
|
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.text, { color: colors.text }], children: message.text })
|
|
@@ -598,6 +602,137 @@ var ToastHost = ({
|
|
|
598
602
|
)) });
|
|
599
603
|
};
|
|
600
604
|
|
|
605
|
+
// src/Warming/warmingStore.ts
|
|
606
|
+
var WARMING_QUIET_PERIOD_MS = 2500;
|
|
607
|
+
var IDLE_ATTEMPT = 0;
|
|
608
|
+
var warming = false;
|
|
609
|
+
var currentAttempt = IDLE_ATTEMPT;
|
|
610
|
+
var snapshot = { isWarming: false, attempt: IDLE_ATTEMPT };
|
|
611
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
612
|
+
var quietTimer;
|
|
613
|
+
function refreshSnapshot() {
|
|
614
|
+
snapshot = { isWarming: warming, attempt: currentAttempt };
|
|
615
|
+
}
|
|
616
|
+
function emit() {
|
|
617
|
+
for (const listener of listeners) listener();
|
|
618
|
+
}
|
|
619
|
+
function clearQuietTimer() {
|
|
620
|
+
if (quietTimer !== void 0) {
|
|
621
|
+
clearTimeout(quietTimer);
|
|
622
|
+
quietTimer = void 0;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function scheduleSettle() {
|
|
626
|
+
clearQuietTimer();
|
|
627
|
+
if (typeof setTimeout !== "function") return;
|
|
628
|
+
quietTimer = setTimeout(() => {
|
|
629
|
+
quietTimer = void 0;
|
|
630
|
+
settleWarming();
|
|
631
|
+
}, WARMING_QUIET_PERIOD_MS);
|
|
632
|
+
}
|
|
633
|
+
function notifyWarming(info) {
|
|
634
|
+
const changed = !warming || currentAttempt !== info.attempt;
|
|
635
|
+
warming = true;
|
|
636
|
+
currentAttempt = info.attempt;
|
|
637
|
+
scheduleSettle();
|
|
638
|
+
if (changed) {
|
|
639
|
+
refreshSnapshot();
|
|
640
|
+
emit();
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
function settleWarming() {
|
|
644
|
+
clearQuietTimer();
|
|
645
|
+
if (!warming) return;
|
|
646
|
+
warming = false;
|
|
647
|
+
currentAttempt = IDLE_ATTEMPT;
|
|
648
|
+
refreshSnapshot();
|
|
649
|
+
emit();
|
|
650
|
+
}
|
|
651
|
+
function subscribeWarming(listener) {
|
|
652
|
+
listeners.add(listener);
|
|
653
|
+
return () => {
|
|
654
|
+
listeners.delete(listener);
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
function getWarmingSnapshot() {
|
|
658
|
+
return snapshot;
|
|
659
|
+
}
|
|
660
|
+
var OVERLAY_Z_INDEX = 1e5;
|
|
661
|
+
var CARD_GAP = 12;
|
|
662
|
+
var TITLE_FONT_SIZE = 20;
|
|
663
|
+
var SUBTITLE_FONT_SIZE = 15;
|
|
664
|
+
var ATTEMPT_FONT_SIZE = 13;
|
|
665
|
+
var CARD_PADDING = 24;
|
|
666
|
+
var NO_ATTEMPT = 0;
|
|
667
|
+
var styles7 = reactNative.StyleSheet.create({
|
|
668
|
+
overlay: {
|
|
669
|
+
position: "absolute",
|
|
670
|
+
top: 0,
|
|
671
|
+
left: 0,
|
|
672
|
+
right: 0,
|
|
673
|
+
bottom: 0,
|
|
674
|
+
alignItems: "center",
|
|
675
|
+
justifyContent: "center",
|
|
676
|
+
zIndex: OVERLAY_Z_INDEX,
|
|
677
|
+
elevation: OVERLAY_Z_INDEX,
|
|
678
|
+
padding: CARD_PADDING
|
|
679
|
+
},
|
|
680
|
+
card: {
|
|
681
|
+
alignItems: "center",
|
|
682
|
+
gap: CARD_GAP,
|
|
683
|
+
maxWidth: 320
|
|
684
|
+
},
|
|
685
|
+
title: {
|
|
686
|
+
fontSize: TITLE_FONT_SIZE,
|
|
687
|
+
fontWeight: "700",
|
|
688
|
+
textAlign: "center"
|
|
689
|
+
},
|
|
690
|
+
subtitle: {
|
|
691
|
+
fontSize: SUBTITLE_FONT_SIZE,
|
|
692
|
+
textAlign: "center"
|
|
693
|
+
},
|
|
694
|
+
attempt: {
|
|
695
|
+
fontSize: ATTEMPT_FONT_SIZE,
|
|
696
|
+
textAlign: "center"
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
var DEFAULT_WARMING_LABELS = {
|
|
700
|
+
title: "Warming up\u2026",
|
|
701
|
+
subtitle: "This only takes a moment",
|
|
702
|
+
accessibilityLabel: "Warming up, please wait",
|
|
703
|
+
attemptHint: (attempt) => `Attempt ${String(attempt)}`
|
|
704
|
+
};
|
|
705
|
+
var WarmingOverlay = ({
|
|
706
|
+
labels,
|
|
707
|
+
theme: themeOverride,
|
|
708
|
+
testIdPrefix = FEEDBACK_TEST_IDS.warmingOverlay,
|
|
709
|
+
showAttempt = false
|
|
710
|
+
}) => {
|
|
711
|
+
const ctx = useFeedbackUi();
|
|
712
|
+
const snapshot2 = React3.useSyncExternalStore(subscribeWarming, getWarmingSnapshot, getWarmingSnapshot);
|
|
713
|
+
const theme = themeOverride ?? ctx.theme;
|
|
714
|
+
const mergedLabels = { ...DEFAULT_WARMING_LABELS, ...labels };
|
|
715
|
+
if (!snapshot2.isWarming) return null;
|
|
716
|
+
const colors = theme.colors;
|
|
717
|
+
const primary = theme.palette.primary["500"];
|
|
718
|
+
const showHint = showAttempt && snapshot2.attempt > NO_ATTEMPT;
|
|
719
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
720
|
+
reactNative.View,
|
|
721
|
+
{
|
|
722
|
+
accessibilityLabel: mergedLabels.accessibilityLabel,
|
|
723
|
+
accessibilityRole: "alert",
|
|
724
|
+
style: [styles7.overlay, { backgroundColor: colors.background }],
|
|
725
|
+
testID: testIdPrefix,
|
|
726
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles7.card, children: [
|
|
727
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: primary, size: "large" }),
|
|
728
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles7.title, { color: colors.text }], testID: `${testIdPrefix}-title`, children: mergedLabels.title }),
|
|
729
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles7.subtitle, { color: colors.textSecondary }], testID: `${testIdPrefix}-subtitle`, children: mergedLabels.subtitle }),
|
|
730
|
+
showHint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles7.attempt, { color: colors.textSecondary }], testID: `${testIdPrefix}-attempt`, children: mergedLabels.attemptHint(snapshot2.attempt) }) : null
|
|
731
|
+
] })
|
|
732
|
+
}
|
|
733
|
+
);
|
|
734
|
+
};
|
|
735
|
+
|
|
601
736
|
exports.ConfirmDialog = ConfirmDialog;
|
|
602
737
|
exports.DISABLED_OPACITY = DISABLED_OPACITY;
|
|
603
738
|
exports.EmptyListState = EmptyListState;
|
|
@@ -609,6 +744,12 @@ exports.MODAL_OVERLAY_COLOR = MODAL_OVERLAY_COLOR;
|
|
|
609
744
|
exports.PageSkeleton = PageSkeleton;
|
|
610
745
|
exports.ToastHost = ToastHost;
|
|
611
746
|
exports.UiProvider = FeedbackUiProvider;
|
|
747
|
+
exports.WARMING_QUIET_PERIOD_MS = WARMING_QUIET_PERIOD_MS;
|
|
748
|
+
exports.WarmingOverlay = WarmingOverlay;
|
|
749
|
+
exports.getWarmingSnapshot = getWarmingSnapshot;
|
|
750
|
+
exports.notifyWarming = notifyWarming;
|
|
751
|
+
exports.settleWarming = settleWarming;
|
|
752
|
+
exports.subscribeWarming = subscribeWarming;
|
|
612
753
|
exports.useFeedbackUi = useFeedbackUi;
|
|
613
754
|
exports.useUi = useFeedbackUi;
|
|
614
755
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/context/FeedbackUiContext.tsx","../src/constants.ts","../src/ErrorState/ErrorState.tsx","../src/EmptyListState/EmptyListState.tsx","../src/LoadingFallback/LoadingFallback.tsx","../src/PageSkeleton/PageSkeleton.tsx","../src/ConfirmDialog/ConfirmDialog.tsx","../src/ToastHost/ToastHost.tsx"],"names":["createContext","useMemo","jsx","useContext","StyleSheet","jsxs","View","Text","TouchableOpacity","MESSAGE_FONT_SIZE","CONTAINER_PADDING","styles","useCallback","ActivityIndicator","React","Animated","Easing","Platform","Modal","useRef","useEffect","useState"],"mappings":";;;;;;;;;;;AAyDA,IAAM,sBAAA,GAA0C;AAAA,EAC9C,KAAA,EAAO;AAAA,IACL,MAAA,EAAQ;AAAA,MACN,UAAA,EAAY,SAAA;AAAA,MACZ,OAAA,EAAS,SAAA;AAAA,MACT,eAAA,EAAiB,SAAA;AAAA,MACjB,IAAA,EAAM,SAAA;AAAA,MACN,aAAA,EAAe,SAAA;AAAA,MACf,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,OAAA,EAAS;AAAA,MACP,SAAS,EAAE,KAAA,EAAO,WAAW,KAAA,EAAO,SAAA,EAAW,OAAO,SAAA,EAAU;AAAA,MAChE,SAAA,EAAW,EAAE,KAAA,EAAO,SAAA,EAAU;AAAA,MAC9B,MAAA,EAAQ,EAAE,KAAA,EAAO,SAAA;AAAU,KAC7B;AAAA,IACA,QAAA,EAAU;AAAA,MACR,KAAA,EAAO,EAAE,KAAA,EAAO,SAAA,EAAU;AAAA,MAC1B,OAAA,EAAS,EAAE,KAAA,EAAO,SAAA,EAAU;AAAA,MAC5B,OAAA,EAAS,EAAE,KAAA,EAAO,SAAA,EAAU;AAAA,MAC5B,IAAA,EAAM,EAAE,KAAA,EAAO,SAAA;AAAU;AAC3B,GACF;AAAA,EACA,CAAA,EAAG,CAAC,GAAA,KAAQ;AACd,CAAA;AAEA,IAAM,iBAAA,GAAoBA,qBAA+B,sBAAsB,CAAA;AAWxE,IAAM,qBAAqB,CAAC;AAAA,EACjC,KAAA;AAAA,EACA,CAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA,KAAmD;AACjD,EAAA,MAAM,KAAA,GAAQC,cAAA,CAAyB,OAAO,EAAE,KAAA,EAAO,CAAA,EAAG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AAA,EAAA,EAAK,KAAA,EAAOK,OAAAA,CAAO,SAAA,EACjB,QAAA,EAAA,QAAA,CAAS,GAAA,CAAI,CAAC,CAAA,qBACbT,cAAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MAEC,MAAA;AAAA,MACA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA,EAAS,CAAA;AAAA,MACT,MAAA,EAAQ,WAAA;AAAA,MACR,MAAA,EAAQ;AAAA,KAAA;AAAA,IANH,CAAA,CAAE;AAAA,GAQV,CAAA,EACH,CAAA;AAEJ","file":"index.js","sourcesContent":["import React, { createContext, useContext, useMemo } from 'react';\n\n/**\n * The minimal theme surface the feedback components read. Each consuming app's\n * resolved theme object is structurally compatible with this shape, so apps pass\n * their existing `useTheme().theme` straight through the provider.\n */\nexport interface FeedbackThemeColors {\n background: string;\n surface: string;\n surfaceElevated: string;\n text: string;\n textSecondary: string;\n border: string;\n}\n\n/** A colour scale. The `500` step is guaranteed; other steps (50–900) are addressable. */\nexport interface FeedbackColorScale {\n '500': string;\n [step: string]: string;\n}\n\n/** `primary` is guaranteed; apps typically also provide `secondary`/`accent` (addressable). */\nexport interface FeedbackThemePalette {\n primary: FeedbackColorScale;\n [name: string]: FeedbackColorScale;\n}\n\n/** `error` is guaranteed; apps typically also provide `success`/`warning`/`info` (addressable). */\nexport interface FeedbackThemeSemantic {\n error: FeedbackColorScale;\n [name: string]: FeedbackColorScale;\n}\n\nexport interface FeedbackTheme {\n colors: FeedbackThemeColors;\n palette: FeedbackThemePalette;\n semantic: FeedbackThemeSemantic;\n}\n\n/** Translate function — mirrors the apps' `FM(key, p1?, p2?, p3?)` helper. */\nexport type FeedbackTranslate = (key: string, p1?: string, p2?: string, p3?: string) => string;\n\n/** Navigation callback used by EmptyListState's optional call-to-action. */\nexport type FeedbackNavigate = (route: string) => void;\n\nexport interface FeedbackUiValue {\n theme: FeedbackTheme;\n t: FeedbackTranslate;\n navigate?: FeedbackNavigate;\n}\n\n/**\n * Neutral fallback used when no FeedbackUiProvider is mounted. Apps SHOULD mount a\n * provider so the components pick up the real theme + translations; the default keeps\n * the components rendering gracefully (e.g. in isolated tests) instead of throwing.\n */\nconst DEFAULT_FEEDBACK_VALUE: FeedbackUiValue = {\n theme: {\n colors: {\n background: '#ffffff',\n surface: '#f7f7f7',\n surfaceElevated: '#ffffff',\n text: '#111111',\n textSecondary: '#666666',\n border: '#dddddd',\n },\n palette: {\n primary: { '100': '#dbeafe', '500': '#2563eb', '700': '#1d4ed8' },\n secondary: { '500': '#64748b' },\n accent: { '500': '#f59e0b' },\n },\n semantic: {\n error: { '500': '#dc2626' },\n success: { '500': '#16a34a' },\n warning: { '500': '#d97706' },\n info: { '500': '#2563eb' },\n },\n },\n t: (key) => key,\n};\n\nconst FeedbackUiContext = createContext<FeedbackUiValue>(DEFAULT_FEEDBACK_VALUE);\n\nexport interface FeedbackUiProviderProps extends FeedbackUiValue {\n children: React.ReactNode;\n}\n\n/**\n * Supplies the host app's theme + translate (+ optional navigate) to the\n * `@dloizides/ui-feedback` components. Mount once, high in the app tree, below\n * the app's own ThemeProvider.\n */\nexport const FeedbackUiProvider = ({\n theme,\n t,\n navigate,\n children,\n}: FeedbackUiProviderProps): React.ReactElement => {\n const value = useMemo<FeedbackUiValue>(() => ({ theme, t, navigate }), [theme, t, navigate]);\n return <FeedbackUiContext.Provider value={value}>{children}</FeedbackUiContext.Provider>;\n};\n\n/**\n * Reads the feedback UI context. Returns the provider's value when one is mounted,\n * or a neutral default (see DEFAULT_FEEDBACK_VALUE) so components render gracefully\n * without a provider.\n */\nexport function useFeedbackUi(): FeedbackUiValue {\n return useContext(FeedbackUiContext);\n}\n","/** Semi-transparent scrim behind modal dialogs. */\nexport const MODAL_OVERLAY_COLOR = 'rgba(0, 0, 0, 0.5)';\n\n/** Opacity applied to disabled interactive controls. */\nexport const DISABLED_OPACITY = 0.5;\n\n/**\n * Default testID strings. These match the values the consuming apps already used\n * so existing Playwright selectors keep working after migration.\n */\nexport const FEEDBACK_TEST_IDS = {\n errorState: 'error-state',\n errorStateRetry: 'error-state-retry',\n emptyListCta: 'empty-list-cta',\n loadingFallback: 'loading-fallback',\n pageSkeleton: 'page-skeleton',\n confirmDialog: 'confirm-dialog',\n confirmButton: 'confirm-button',\n cancelConfirmButton: 'cancel-confirm-button',\n notificationToast: 'notification-toast',\n} as const;\n","/**\n * ErrorState - generic error display with optional retry button.\n */\nimport React from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nconst MESSAGE_FONT_SIZE = 16;\nconst CONTAINER_PADDING = 20;\nconst BUTTON_MARGIN_TOP = 12;\nconst BUTTON_PADDING_V = 8;\nconst BUTTON_PADDING_H = 16;\nconst BUTTON_BORDER_RADIUS = 6;\nconst BUTTON_FONT_SIZE = 14;\n\n// ---------------------------------------------------------------------------\n// Styles\n// ---------------------------------------------------------------------------\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: CONTAINER_PADDING,\n },\n message: {\n fontSize: MESSAGE_FONT_SIZE,\n textAlign: 'center',\n },\n retryButton: {\n marginTop: BUTTON_MARGIN_TOP,\n paddingVertical: BUTTON_PADDING_V,\n paddingHorizontal: BUTTON_PADDING_H,\n borderRadius: BUTTON_BORDER_RADIUS,\n },\n retryText: {\n fontSize: BUTTON_FONT_SIZE,\n fontWeight: '600',\n },\n});\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport interface ErrorStateProps {\n message: string;\n onRetry?: () => void;\n testID?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport const ErrorState = ({\n message,\n onRetry,\n testID = FEEDBACK_TEST_IDS.errorState,\n}: ErrorStateProps): React.ReactElement => {\n const { theme, t } = useFeedbackUi();\n const errorColor = theme.semantic.error['500'];\n const primary = theme.palette.primary['500'];\n\n return (\n <View style={styles.container} testID={testID}>\n <Text style={[styles.message, { color: errorColor }]}>{message}</Text>\n {typeof onRetry === 'function' ? (\n <TouchableOpacity\n accessibilityHint={t('common.retryHint')}\n accessibilityLabel={t('common.retry')}\n accessibilityRole=\"button\"\n style={[styles.retryButton, { backgroundColor: primary }]}\n testID={FEEDBACK_TEST_IDS.errorStateRetry}\n onPress={onRetry}\n >\n <Text style={[styles.retryText, { color: theme.colors.surfaceElevated }]}>\n {t('common.retry')}\n </Text>\n </TouchableOpacity>\n ) : null}\n </View>\n );\n};\n\nexport default ErrorState;\n","/**\n * EmptyListState - empty-collection message with an optional call-to-action.\n *\n * The CTA navigates via the `navigate` callback supplied through FeedbackUiProvider\n * (the host app adapts its router, e.g. expo-router's `router.push`).\n */\nimport React, { useCallback } from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst MESSAGE_FONT_SIZE = 16;\nconst CTA_MARGIN_TOP = 16;\nconst CTA_PADDING_VERTICAL = 10;\nconst CTA_PADDING_HORIZONTAL = 20;\nconst CTA_BORDER_RADIUS = 8;\nconst CTA_FONT_SIZE = 14;\nconst CONTAINER_PADDING = 32;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: CONTAINER_PADDING,\n },\n message: {\n fontSize: MESSAGE_FONT_SIZE,\n textAlign: 'center',\n },\n ctaButton: {\n marginTop: CTA_MARGIN_TOP,\n paddingVertical: CTA_PADDING_VERTICAL,\n paddingHorizontal: CTA_PADDING_HORIZONTAL,\n borderRadius: CTA_BORDER_RADIUS,\n },\n ctaText: {\n fontSize: CTA_FONT_SIZE,\n fontWeight: '600',\n },\n});\n\nexport interface EmptyListStateProps {\n messageKey: string;\n ctaTextKey?: string;\n ctaHintKey?: string;\n ctaRoute?: string;\n testID: string;\n}\n\nexport const EmptyListState = ({\n messageKey,\n ctaTextKey,\n ctaHintKey,\n ctaRoute,\n testID,\n}: EmptyListStateProps): React.ReactElement => {\n const { theme, t, navigate } = useFeedbackUi();\n const { colors } = theme;\n const primary = theme.palette.primary['500'];\n\n const handlePress = useCallback((): void => {\n if (typeof ctaRoute === 'string' && typeof navigate === 'function') navigate(ctaRoute);\n }, [navigate, ctaRoute]);\n\n const showCta = typeof ctaTextKey === 'string'\n && typeof ctaHintKey === 'string'\n && typeof ctaRoute === 'string';\n\n return (\n <View style={styles.container} testID={testID}>\n <Text style={[styles.message, { color: colors.textSecondary }]}>\n {t(messageKey)}\n </Text>\n {showCta ? (\n <TouchableOpacity\n accessibilityHint={t(ctaHintKey as string)}\n accessibilityLabel={t(ctaTextKey as string)}\n accessibilityRole=\"button\"\n style={[styles.ctaButton, { backgroundColor: primary }]}\n testID={FEEDBACK_TEST_IDS.emptyListCta}\n onPress={handlePress}\n >\n <Text style={[styles.ctaText, { color: colors.background }]}>\n {t(ctaTextKey as string)}\n </Text>\n </TouchableOpacity>\n ) : null}\n </View>\n );\n};\n\nexport default EmptyListState;\n","/**\n * LoadingFallback - lightweight loading indicator for lazy-loaded components.\n *\n * Used with React.lazy() and Suspense to show a loading state while heavy\n * components are loading. Optimized for minimal bundle impact.\n */\nimport React from 'react';\n\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst FULLSCREEN_MIN_HEIGHT = 300;\nconst CONTAINER_MIN_HEIGHT = 100;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n minHeight: CONTAINER_MIN_HEIGHT,\n },\n fullScreen: {\n minHeight: FULLSCREEN_MIN_HEIGHT,\n },\n});\n\nexport interface LoadingFallbackProps {\n /** Show as full-screen loader (default: false) */\n fullScreen?: boolean;\n /** Custom size for the spinner */\n size?: 'small' | 'large';\n}\n\nexport const LoadingFallback: React.FC<LoadingFallbackProps> = ({ fullScreen = false, size = 'large' }) => {\n const { theme, t } = useFeedbackUi();\n const colors = theme.colors;\n const primary = theme.palette.primary['500'];\n\n return (\n <View\n accessibilityHint={t('loadingFallback.hint')}\n accessibilityLabel={t('loadingFallback.label')}\n accessibilityRole=\"progressbar\"\n style={[styles.container, fullScreen && styles.fullScreen, { backgroundColor: colors.background }]}\n testID={FEEDBACK_TEST_IDS.loadingFallback}\n >\n <ActivityIndicator color={primary} size={size} />\n </View>\n );\n};\n\nexport default LoadingFallback;\n","/**\n * PageSkeleton - shimmer skeleton loader for full pages.\n *\n * Improves perceived performance (Speed Index) by showing immediate visual\n * feedback while page content loads.\n */\nimport React from 'react';\n\nimport { Animated, Easing, Platform, StyleSheet, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst ANIMATION_DURATION_MS = 1200;\nconst SKELETON_BORDER_RADIUS = 4;\nconst SKELETON_OPACITY_START = 0.3;\nconst SKELETON_OPACITY_END = 0.7;\nconst DEFAULT_ROWS = 5;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n padding: 16,\n },\n header: {\n height: 32,\n borderRadius: SKELETON_BORDER_RADIUS,\n marginBottom: 24,\n width: '60%',\n },\n row: {\n flexDirection: 'row',\n marginBottom: 16,\n },\n avatar: {\n width: 48,\n height: 48,\n borderRadius: 24,\n marginRight: 12,\n },\n textContainer: {\n flex: 1,\n justifyContent: 'center',\n },\n textLine: {\n height: 16,\n borderRadius: SKELETON_BORDER_RADIUS,\n marginBottom: 8,\n },\n textLineShort: {\n width: '70%',\n },\n textLineFull: {\n width: '100%',\n },\n card: {\n height: 120,\n borderRadius: 8,\n marginBottom: 16,\n },\n});\n\nexport interface PageSkeletonProps {\n /** Number of skeleton rows to show */\n rows?: number;\n /** Show header skeleton */\n showHeader?: boolean;\n /** Show card skeletons instead of rows */\n variant?: 'list' | 'cards';\n}\n\nexport const PageSkeleton: React.FC<PageSkeletonProps> = ({\n rows = DEFAULT_ROWS,\n showHeader = true,\n variant = 'list',\n}) => {\n const { theme, t } = useFeedbackUi();\n const colors = theme.colors;\n\n const animatedValue = React.useRef(new Animated.Value(0)).current;\n\n React.useEffect(() => {\n const animation = Animated.loop(\n Animated.sequence([\n Animated.timing(animatedValue, {\n toValue: 1,\n duration: ANIMATION_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: Platform.OS !== 'web',\n }),\n Animated.timing(animatedValue, {\n toValue: 0,\n duration: ANIMATION_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: Platform.OS !== 'web',\n }),\n ]),\n );\n animation.start();\n return () => animation.stop();\n }, [animatedValue]);\n\n const opacity = animatedValue.interpolate({\n inputRange: [0, 1],\n outputRange: [SKELETON_OPACITY_START, SKELETON_OPACITY_END],\n });\n\n const skeletonColor = String(colors.border);\n\n const renderListRow = (index: number): React.ReactElement => (\n <View key={index} style={styles.row}>\n <Animated.View style={[styles.avatar, { backgroundColor: skeletonColor, opacity }]} />\n <View style={styles.textContainer}>\n <Animated.View style={[styles.textLine, styles.textLineFull, { backgroundColor: skeletonColor, opacity }]} />\n <Animated.View style={[styles.textLine, styles.textLineShort, { backgroundColor: skeletonColor, opacity }]} />\n </View>\n </View>\n );\n\n const renderCard = (index: number): React.ReactElement => (\n <Animated.View key={index} style={[styles.card, { backgroundColor: skeletonColor, opacity }]} />\n );\n\n const rowElements = Array.from({ length: rows }, (_, i) => (variant === 'cards' ? renderCard(i) : renderListRow(i)));\n\n return (\n <View\n accessibilityHint={t('pageSkeleton.loadingHint')}\n accessibilityLabel={t('pageSkeleton.loadingLabel')}\n accessibilityState={{ busy: true }}\n style={[styles.container, { backgroundColor: colors.background }]}\n testID={FEEDBACK_TEST_IDS.pageSkeleton}\n >\n {showHeader ? <Animated.View style={[styles.header, { backgroundColor: skeletonColor, opacity }]} /> : null}\n {rowElements}\n </View>\n );\n};\n\nexport default PageSkeleton;\n","/**\n * ConfirmDialog - modal confirm/cancel dialog with optional destructive + loading states.\n */\nimport React, { useMemo } from 'react';\n\nimport {\n ActivityIndicator,\n Modal,\n StyleSheet,\n Text,\n TouchableOpacity,\n View,\n} from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { DISABLED_OPACITY, MODAL_OVERLAY_COLOR, FEEDBACK_TEST_IDS } from '../constants';\n\nconst DIALOG_MAX_WIDTH = 400;\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n backgroundColor: MODAL_OVERLAY_COLOR,\n justifyContent: 'center',\n alignItems: 'center',\n padding: 20,\n },\n dialog: {\n width: '100%',\n maxWidth: DIALOG_MAX_WIDTH,\n borderRadius: 12,\n padding: 20,\n boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.25)',\n elevation: 5,\n },\n title: {\n fontSize: 18,\n fontWeight: '600',\n marginBottom: 12,\n },\n message: {\n fontSize: 14,\n lineHeight: 20,\n marginBottom: 20,\n },\n buttonRow: {\n flexDirection: 'row',\n justifyContent: 'flex-end',\n gap: 12,\n },\n button: {\n paddingVertical: 10,\n paddingHorizontal: 20,\n borderRadius: 6,\n minWidth: 80,\n alignItems: 'center',\n justifyContent: 'center',\n },\n cancelButton: {\n borderWidth: 1,\n },\n confirmButton: {},\n buttonText: {\n fontSize: 14,\n fontWeight: '600',\n },\n disabledButton: {\n opacity: DISABLED_OPACITY,\n },\n});\n\nexport interface ConfirmDialogProps {\n visible: boolean;\n title: string;\n message: string;\n onConfirm: () => void;\n onCancel: () => void;\n confirmLabel?: string;\n cancelLabel?: string;\n confirmDisabled?: boolean;\n loading?: boolean;\n destructive?: boolean;\n}\n\nexport const ConfirmDialog = ({\n visible,\n title,\n message,\n onConfirm,\n onCancel,\n confirmLabel,\n cancelLabel,\n confirmDisabled = false,\n loading = false,\n destructive = false,\n}: ConfirmDialogProps): React.ReactElement | null => {\n const { theme, t } = useFeedbackUi();\n\n const colorStyles = useMemo(\n () => ({\n dialog: { backgroundColor: theme.colors.surfaceElevated },\n title: { color: theme.colors.text },\n message: { color: theme.colors.textSecondary },\n cancelButton: { borderColor: theme.colors.border },\n cancelButtonText: { color: theme.colors.text },\n confirmButton: {\n backgroundColor: destructive ? theme.semantic.error['500'] : theme.palette.primary['500'],\n },\n confirmButtonText: { color: theme.colors.surfaceElevated },\n }),\n [theme, destructive]\n );\n\n const resolvedConfirmLabel = confirmLabel ?? t('common.confirm');\n const resolvedCancelLabel = cancelLabel ?? t('common.cancel');\n\n const isConfirmDisabled = confirmDisabled || loading;\n\n if (!visible)\n return null;\n\n return (\n <Modal\n transparent\n animationType=\"fade\"\n visible={visible}\n onRequestClose={onCancel}\n >\n <View style={styles.overlay} testID={FEEDBACK_TEST_IDS.confirmDialog}>\n <View\n accessibilityViewIsModal\n aria-label={title}\n role=\"dialog\"\n style={[styles.dialog, colorStyles.dialog]}\n >\n <Text style={[styles.title, colorStyles.title]}>{title}</Text>\n <Text style={[styles.message, colorStyles.message]}>{message}</Text>\n\n <View style={styles.buttonRow}>\n <TouchableOpacity\n accessibilityHint={t('common.cancelHint')}\n accessibilityLabel={resolvedCancelLabel}\n accessibilityRole=\"button\"\n style={[\n styles.button,\n styles.cancelButton,\n colorStyles.cancelButton,\n ]}\n testID={FEEDBACK_TEST_IDS.cancelConfirmButton}\n onPress={onCancel}\n >\n <Text style={[styles.buttonText, colorStyles.cancelButtonText]}>\n {resolvedCancelLabel}\n </Text>\n </TouchableOpacity>\n\n <TouchableOpacity\n accessibilityHint={t('common.confirmHint')}\n accessibilityLabel={resolvedConfirmLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: isConfirmDisabled }}\n disabled={isConfirmDisabled}\n style={[\n styles.button,\n styles.confirmButton,\n colorStyles.confirmButton,\n isConfirmDisabled && styles.disabledButton,\n ]}\n testID={FEEDBACK_TEST_IDS.confirmButton}\n onPress={onConfirm}\n >\n {loading ? (\n <ActivityIndicator\n color={theme.colors.surfaceElevated}\n size=\"small\"\n testID=\"confirm-loading\"\n />\n ) : (\n <Text\n style={[styles.buttonText, colorStyles.confirmButtonText]}\n >\n {resolvedConfirmLabel}\n </Text>\n )}\n </TouchableOpacity>\n </View>\n </View>\n </View>\n </Modal>\n );\n};\n\nexport default ConfirmDialog;\n","/**\n * ToastHost — the shared, tokenized transient-toast overlay promoted from the\n * byte-identical erevna-web / katalogos-web `ToastContainer` twins.\n *\n * The RENDERING (animated fade-in/out, positioning, theming) lives here; the\n * EMIT pipeline stays in the app (its event bus / `@dloizides/bff-web-client`\n * toast emitter). The app wires the two together via the `subscribe` port: a\n * function that registers a push callback and returns an unsubscribe. Colours\n * come from the UiProvider theme (`useUi`) — nothing hardcoded.\n */\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Animated, Platform, StyleSheet, Text, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\n// --- Defaults (ported from the twins) ---------------------------------------\nconst DEFAULT_DURATION_MS = 3000;\nconst DEFAULT_FADE_MS = 200;\nconst DEFAULT_MAX_LENGTH = 500;\n\nconst TOAST_TOP_WEB = 10;\nconst TOAST_TOP_MOBILE = 40;\nconst TOAST_HORIZONTAL_MARGIN = 10;\nconst TOAST_Z_INDEX = 9999;\nconst TOAST_INITIAL_TRANSLATE_Y = -6;\nconst TOAST_MAX_WIDTH = 600;\nconst TOAST_PADDING_HORIZONTAL = 16;\nconst TOAST_PADDING_VERTICAL = 10;\nconst TOAST_BORDER_RADIUS = 8;\nconst TOAST_MARGIN_VERTICAL = 6;\n\n// Character-range bounds for the display sanitizer.\nconst C0_CONTROL_END = 0x1f;\nconst C1_CONTROL_START = 0x7f;\nconst C1_CONTROL_END = 0x9f;\nconst ZERO_WIDTH_START = 0x200b;\nconst ZERO_WIDTH_END = 0x200f;\nconst BYTE_ORDER_MARK = 0xfeff;\n\nexport type ToastType = 'success' | 'info' | 'error';\n\n/** What the app pushes through the `subscribe` port. */\nexport interface ToastInput {\n text: string;\n type?: ToastType;\n}\n\ninterface ToastMessage extends ToastInput {\n id: string;\n}\n\ninterface ToastColors {\n primary: string;\n success: string;\n error: string;\n text: string;\n}\n\nconst styles = StyleSheet.create({\n container: {\n position: 'absolute',\n top: Platform.OS === 'web' ? TOAST_TOP_WEB : TOAST_TOP_MOBILE,\n left: TOAST_HORIZONTAL_MARGIN,\n right: TOAST_HORIZONTAL_MARGIN,\n alignItems: 'center',\n zIndex: TOAST_Z_INDEX,\n pointerEvents: 'box-none',\n },\n toast: {\n paddingHorizontal: TOAST_PADDING_HORIZONTAL,\n paddingVertical: TOAST_PADDING_VERTICAL,\n borderRadius: TOAST_BORDER_RADIUS,\n marginVertical: TOAST_MARGIN_VERTICAL,\n minWidth: '40%',\n maxWidth: TOAST_MAX_WIDTH,\n boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.2)',\n elevation: 4,\n },\n text: {},\n});\n\n/** Truncate + strip control / zero-width characters before display. */\nfunction sanitizeToastText(input: string, maxLength: number): string {\n let stripped = '';\n for (const ch of input) {\n const code = ch.codePointAt(0) ?? 0;\n const isControl = code <= C0_CONTROL_END || (code >= C1_CONTROL_START && code <= C1_CONTROL_END);\n const isHidden = (code >= ZERO_WIDTH_START && code <= ZERO_WIDTH_END) || code === BYTE_ORDER_MARK;\n if (!isControl && !isHidden) stripped += ch;\n }\n return stripped.length > maxLength ? stripped.slice(0, maxLength) : stripped;\n}\n\ninterface ToastItemProps {\n message: ToastMessage;\n onDone: (id: string) => void;\n colors: ToastColors;\n durationMs: number;\n fadeMs: number;\n testID: string;\n}\n\nconst ToastItem = ({ message, onDone, colors, durationMs, fadeMs, testID }: ToastItemProps): React.ReactElement => {\n const opacityRef = useRef(new Animated.Value(0));\n const translateYRef = useRef(new Animated.Value(TOAST_INITIAL_TRANSLATE_Y));\n const opacity = opacityRef.current;\n const translateY = translateYRef.current;\n\n const backgroundColor = useMemo((): string => {\n if (message.type === 'success') return colors.success;\n if (message.type === 'error') return colors.error;\n return colors.primary;\n }, [colors.error, colors.primary, colors.success, message.type]);\n\n const handleDone = useCallback((): void => {\n onDone(message.id);\n }, [message.id, onDone]);\n\n useEffect(() => {\n const useNative = Platform.OS !== 'web';\n Animated.parallel([\n Animated.timing(opacity, { toValue: 1, duration: fadeMs, useNativeDriver: useNative }),\n Animated.timing(translateY, { toValue: 0, duration: fadeMs, useNativeDriver: useNative }),\n ]).start();\n\n const hideTimer = setTimeout(() => {\n Animated.parallel([\n Animated.timing(opacity, { toValue: 0, duration: fadeMs, useNativeDriver: useNative }),\n Animated.timing(translateY, { toValue: TOAST_INITIAL_TRANSLATE_Y, duration: fadeMs, useNativeDriver: useNative }),\n ]).start(handleDone);\n }, durationMs);\n\n return () => clearTimeout(hideTimer);\n }, [handleDone, opacity, translateY, durationMs, fadeMs]);\n\n return (\n <Animated.View\n style={[styles.toast, { backgroundColor, transform: [{ translateY }], opacity }]}\n testID={testID}\n >\n <Text style={[styles.text, { color: colors.text }]}>{message.text}</Text>\n </Animated.View>\n );\n};\n\nexport interface ToastHostProps {\n /**\n * Register a push callback; return an unsubscribe. The app adapts its own\n * event bus (e.g. `@dloizides/bff-web-client`'s toast emitter) to this port.\n */\n subscribe: (push: (toast: ToastInput) => void) => () => void;\n /** How long each toast stays before fading (ms). Default 3000. */\n durationMs?: number;\n /** Fade in/out animation duration (ms). Default 200. */\n fadeMs?: number;\n /** Max message length before truncation. Default 500. */\n maxLength?: number;\n /** testID for each toast (defaults to `notification-toast`). */\n toastTestID?: string;\n}\n\nlet toastSeq = 0;\nfunction nextId(): string {\n toastSeq += 1;\n return `${String(Date.now())}-${String(toastSeq)}`;\n}\n\nexport const ToastHost = ({\n subscribe,\n durationMs = DEFAULT_DURATION_MS,\n fadeMs = DEFAULT_FADE_MS,\n maxLength = DEFAULT_MAX_LENGTH,\n toastTestID = FEEDBACK_TEST_IDS.notificationToast,\n}: ToastHostProps): React.ReactElement | null => {\n const [messages, setMessages] = useState<ToastMessage[]>([]);\n const { theme } = useFeedbackUi();\n\n const colors = useMemo<ToastColors>(\n () => ({\n primary: theme.palette.primary['500'],\n success: (theme.semantic.success ?? theme.semantic.error)['500'],\n error: theme.semantic.error['500'],\n text: theme.colors.surfaceElevated,\n }),\n [theme],\n );\n\n const push = useCallback(\n (toast: ToastInput): void => {\n setMessages((s) => [...s, { id: nextId(), type: toast.type, text: sanitizeToastText(toast.text, maxLength) }]);\n },\n [maxLength],\n );\n\n const remove = useCallback((id: string): void => {\n setMessages((s) => s.filter((x) => x.id !== id));\n }, []);\n\n useEffect(() => subscribe(push), [subscribe, push]);\n\n if (messages.length === 0) return null;\n\n return (\n <View style={styles.container}>\n {messages.map((m) => (\n <ToastItem\n key={m.id}\n colors={colors}\n durationMs={durationMs}\n fadeMs={fadeMs}\n message={m}\n testID={toastTestID}\n onDone={remove}\n />\n ))}\n </View>\n );\n};\n\nexport default ToastHost;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/context/FeedbackUiContext.tsx","../src/constants.ts","../src/ErrorState/ErrorState.tsx","../src/EmptyListState/EmptyListState.tsx","../src/LoadingFallback/LoadingFallback.tsx","../src/PageSkeleton/PageSkeleton.tsx","../src/ConfirmDialog/ConfirmDialog.tsx","../src/ToastHost/ToastHost.tsx","../src/Warming/warmingStore.ts","../src/Warming/WarmingOverlay.tsx"],"names":["createContext","useMemo","jsx","useContext","StyleSheet","jsxs","View","Text","TouchableOpacity","MESSAGE_FONT_SIZE","CONTAINER_PADDING","styles","useCallback","ActivityIndicator","React","Animated","Easing","Platform","Modal","useRef","useEffect","useState","snapshot","useSyncExternalStore"],"mappings":";;;;;;;;;;;AAyDA,IAAM,sBAAA,GAA0C;AAAA,EAC9C,KAAA,EAAO;AAAA,IACL,MAAA,EAAQ;AAAA,MACN,UAAA,EAAY,SAAA;AAAA,MACZ,OAAA,EAAS,SAAA;AA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,IAACI,gBAAAA;AAAA,IAAA;AAAA,MACC,oBAAoB,YAAA,CAAa,kBAAA;AAAA,MACjC,iBAAA,EAAkB,OAAA;AAAA,MAClB,KAAA,EAAO,CAACK,OAAAA,CAAO,OAAA,EAAS,EAAE,eAAA,EAAiB,MAAA,CAAO,YAAY,CAAA;AAAA,MAC9D,MAAA,EAAQ,YAAA;AAAA,MAER,0BAAAN,eAAAA,CAACC,gBAAAA,EAAA,EAAK,KAAA,EAAOK,QAAO,IAAA,EAClB,QAAA,EAAA;AAAA,wBAAAT,eAACW,6BAAAA,EAAA,EAAkB,KAAA,EAAO,OAAA,EAAS,MAAK,OAAA,EAAQ,CAAA;AAAA,wBAChDX,cAAAA,CAACK,gBAAAA,EAAA,EAAK,KAAA,EAAO,CAACI,QAAO,KAAA,EAAO,EAAE,OAAO,MAAA,CAAO,IAAA,EAAM,CAAA,EAAG,MAAA,EAAQ,GAAG,YAAY,CAAA,MAAA,CAAA,EACzE,uBAAa,KAAA,EAChB,CAAA;AAAA,wBACAT,cAAAA,CAACK,gBAAAA,EAAA,EAAK,KAAA,EAAO,CAACI,QAAO,QAAA,EAAU,EAAE,OAAO,MAAA,CAAO,aAAA,EAAe,CAAA,EAAG,MAAA,EAAQ,GAAG,YAAY,CAAA,SAAA,CAAA,EACrF,uBAAa,QAAA,EAChB,CAAA;AAAA,QACC,QAAA,mBACCT,cAAAA,CAACK,gBAAAA,EAAA,EAAK,OAAO,CAACI,OAAAA,CAAO,OAAA,EAAS,EAAE,KAAA,EAAO,MAAA,CAAO,eAAe,CAAA,EAAG,MAAA,EAAQ,CAAA,EAAG,YAAY,CAAA,QAAA,CAAA,EACpF,uBAAa,WAAA,CAAYW,SAAAA,CAAS,OAAO,CAAA,EAC5C,CAAA,GACE;AAAA,OAAA,EACN;AAAA;AAAA,GACF;AAEJ","file":"index.js","sourcesContent":["import React, { createContext, useContext, useMemo } from 'react';\n\n/**\n * The minimal theme surface the feedback components read. Each consuming app's\n * resolved theme object is structurally compatible with this shape, so apps pass\n * their existing `useTheme().theme` straight through the provider.\n */\nexport interface FeedbackThemeColors {\n background: string;\n surface: string;\n surfaceElevated: string;\n text: string;\n textSecondary: string;\n border: string;\n}\n\n/** A colour scale. The `500` step is guaranteed; other steps (50–900) are addressable. */\nexport interface FeedbackColorScale {\n '500': string;\n [step: string]: string;\n}\n\n/** `primary` is guaranteed; apps typically also provide `secondary`/`accent` (addressable). */\nexport interface FeedbackThemePalette {\n primary: FeedbackColorScale;\n [name: string]: FeedbackColorScale;\n}\n\n/** `error` is guaranteed; apps typically also provide `success`/`warning`/`info` (addressable). */\nexport interface FeedbackThemeSemantic {\n error: FeedbackColorScale;\n [name: string]: FeedbackColorScale;\n}\n\nexport interface FeedbackTheme {\n colors: FeedbackThemeColors;\n palette: FeedbackThemePalette;\n semantic: FeedbackThemeSemantic;\n}\n\n/** Translate function — mirrors the apps' `FM(key, p1?, p2?, p3?)` helper. */\nexport type FeedbackTranslate = (key: string, p1?: string, p2?: string, p3?: string) => string;\n\n/** Navigation callback used by EmptyListState's optional call-to-action. */\nexport type FeedbackNavigate = (route: string) => void;\n\nexport interface FeedbackUiValue {\n theme: FeedbackTheme;\n t: FeedbackTranslate;\n navigate?: FeedbackNavigate;\n}\n\n/**\n * Neutral fallback used when no FeedbackUiProvider is mounted. Apps SHOULD mount a\n * provider so the components pick up the real theme + translations; the default keeps\n * the components rendering gracefully (e.g. in isolated tests) instead of throwing.\n */\nconst DEFAULT_FEEDBACK_VALUE: FeedbackUiValue = {\n theme: {\n colors: {\n background: '#ffffff',\n surface: '#f7f7f7',\n surfaceElevated: '#ffffff',\n text: '#111111',\n textSecondary: '#666666',\n border: '#dddddd',\n },\n palette: {\n primary: { '100': '#dbeafe', '500': '#2563eb', '700': '#1d4ed8' },\n secondary: { '500': '#64748b' },\n accent: { '500': '#f59e0b' },\n },\n semantic: {\n error: { '500': '#dc2626' },\n success: { '500': '#16a34a' },\n warning: { '500': '#d97706' },\n info: { '500': '#2563eb' },\n },\n },\n t: (key) => key,\n};\n\nconst FeedbackUiContext = createContext<FeedbackUiValue>(DEFAULT_FEEDBACK_VALUE);\n\nexport interface FeedbackUiProviderProps extends FeedbackUiValue {\n children: React.ReactNode;\n}\n\n/**\n * Supplies the host app's theme + translate (+ optional navigate) to the\n * `@dloizides/ui-feedback` components. Mount once, high in the app tree, below\n * the app's own ThemeProvider.\n */\nexport const FeedbackUiProvider = ({\n theme,\n t,\n navigate,\n children,\n}: FeedbackUiProviderProps): React.ReactElement => {\n const value = useMemo<FeedbackUiValue>(() => ({ theme, t, navigate }), [theme, t, navigate]);\n return <FeedbackUiContext.Provider value={value}>{children}</FeedbackUiContext.Provider>;\n};\n\n/**\n * Reads the feedback UI context. Returns the provider's value when one is mounted,\n * or a neutral default (see DEFAULT_FEEDBACK_VALUE) so components render gracefully\n * without a provider.\n */\nexport function useFeedbackUi(): FeedbackUiValue {\n return useContext(FeedbackUiContext);\n}\n","/** Semi-transparent scrim behind modal dialogs. */\nexport const MODAL_OVERLAY_COLOR = 'rgba(0, 0, 0, 0.5)';\n\n/** Opacity applied to disabled interactive controls. */\nexport const DISABLED_OPACITY = 0.5;\n\n/**\n * Default testID strings. These match the values the consuming apps already used\n * so existing Playwright selectors keep working after migration.\n */\nexport const FEEDBACK_TEST_IDS = {\n errorState: 'error-state',\n errorStateRetry: 'error-state-retry',\n emptyListCta: 'empty-list-cta',\n loadingFallback: 'loading-fallback',\n pageSkeleton: 'page-skeleton',\n confirmDialog: 'confirm-dialog',\n confirmButton: 'confirm-button',\n cancelConfirmButton: 'cancel-confirm-button',\n notificationToast: 'notification-toast',\n warmingOverlay: 'warming-overlay',\n} as const;\n","/**\n * ErrorState - generic error display with optional retry button.\n */\nimport React from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nconst MESSAGE_FONT_SIZE = 16;\nconst CONTAINER_PADDING = 20;\nconst BUTTON_MARGIN_TOP = 12;\nconst BUTTON_PADDING_V = 8;\nconst BUTTON_PADDING_H = 16;\nconst BUTTON_BORDER_RADIUS = 6;\nconst BUTTON_FONT_SIZE = 14;\n\n// ---------------------------------------------------------------------------\n// Styles\n// ---------------------------------------------------------------------------\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: CONTAINER_PADDING,\n },\n message: {\n fontSize: MESSAGE_FONT_SIZE,\n textAlign: 'center',\n },\n retryButton: {\n marginTop: BUTTON_MARGIN_TOP,\n paddingVertical: BUTTON_PADDING_V,\n paddingHorizontal: BUTTON_PADDING_H,\n borderRadius: BUTTON_BORDER_RADIUS,\n },\n retryText: {\n fontSize: BUTTON_FONT_SIZE,\n fontWeight: '600',\n },\n});\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport interface ErrorStateProps {\n message: string;\n onRetry?: () => void;\n testID?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport const ErrorState = ({\n message,\n onRetry,\n testID = FEEDBACK_TEST_IDS.errorState,\n}: ErrorStateProps): React.ReactElement => {\n const { theme, t } = useFeedbackUi();\n const errorColor = theme.semantic.error['500'];\n const primary = theme.palette.primary['500'];\n\n return (\n <View style={styles.container} testID={testID}>\n <Text style={[styles.message, { color: errorColor }]}>{message}</Text>\n {typeof onRetry === 'function' ? (\n <TouchableOpacity\n accessibilityHint={t('common.retryHint')}\n accessibilityLabel={t('common.retry')}\n accessibilityRole=\"button\"\n style={[styles.retryButton, { backgroundColor: primary }]}\n testID={FEEDBACK_TEST_IDS.errorStateRetry}\n onPress={onRetry}\n >\n <Text style={[styles.retryText, { color: theme.colors.surfaceElevated }]}>\n {t('common.retry')}\n </Text>\n </TouchableOpacity>\n ) : null}\n </View>\n );\n};\n\nexport default ErrorState;\n","/**\n * EmptyListState - empty-collection message with an optional call-to-action.\n *\n * The CTA navigates via the `navigate` callback supplied through FeedbackUiProvider\n * (the host app adapts its router, e.g. expo-router's `router.push`).\n */\nimport React, { useCallback } from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst MESSAGE_FONT_SIZE = 16;\nconst CTA_MARGIN_TOP = 16;\nconst CTA_PADDING_VERTICAL = 10;\nconst CTA_PADDING_HORIZONTAL = 20;\nconst CTA_BORDER_RADIUS = 8;\nconst CTA_FONT_SIZE = 14;\nconst CONTAINER_PADDING = 32;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: CONTAINER_PADDING,\n },\n message: {\n fontSize: MESSAGE_FONT_SIZE,\n textAlign: 'center',\n },\n ctaButton: {\n marginTop: CTA_MARGIN_TOP,\n paddingVertical: CTA_PADDING_VERTICAL,\n paddingHorizontal: CTA_PADDING_HORIZONTAL,\n borderRadius: CTA_BORDER_RADIUS,\n },\n ctaText: {\n fontSize: CTA_FONT_SIZE,\n fontWeight: '600',\n },\n});\n\nexport interface EmptyListStateProps {\n messageKey: string;\n ctaTextKey?: string;\n ctaHintKey?: string;\n ctaRoute?: string;\n testID: string;\n}\n\nexport const EmptyListState = ({\n messageKey,\n ctaTextKey,\n ctaHintKey,\n ctaRoute,\n testID,\n}: EmptyListStateProps): React.ReactElement => {\n const { theme, t, navigate } = useFeedbackUi();\n const { colors } = theme;\n const primary = theme.palette.primary['500'];\n\n const handlePress = useCallback((): void => {\n if (typeof ctaRoute === 'string' && typeof navigate === 'function') navigate(ctaRoute);\n }, [navigate, ctaRoute]);\n\n const showCta = typeof ctaTextKey === 'string'\n && typeof ctaHintKey === 'string'\n && typeof ctaRoute === 'string';\n\n return (\n <View style={styles.container} testID={testID}>\n <Text style={[styles.message, { color: colors.textSecondary }]}>\n {t(messageKey)}\n </Text>\n {showCta ? (\n <TouchableOpacity\n accessibilityHint={t(ctaHintKey as string)}\n accessibilityLabel={t(ctaTextKey as string)}\n accessibilityRole=\"button\"\n style={[styles.ctaButton, { backgroundColor: primary }]}\n testID={FEEDBACK_TEST_IDS.emptyListCta}\n onPress={handlePress}\n >\n <Text style={[styles.ctaText, { color: colors.background }]}>\n {t(ctaTextKey as string)}\n </Text>\n </TouchableOpacity>\n ) : null}\n </View>\n );\n};\n\nexport default EmptyListState;\n","/**\n * LoadingFallback - lightweight loading indicator for lazy-loaded components.\n *\n * Used with React.lazy() and Suspense to show a loading state while heavy\n * components are loading. Optimized for minimal bundle impact.\n */\nimport React from 'react';\n\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst FULLSCREEN_MIN_HEIGHT = 300;\nconst CONTAINER_MIN_HEIGHT = 100;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n minHeight: CONTAINER_MIN_HEIGHT,\n },\n fullScreen: {\n minHeight: FULLSCREEN_MIN_HEIGHT,\n },\n});\n\nexport interface LoadingFallbackProps {\n /** Show as full-screen loader (default: false) */\n fullScreen?: boolean;\n /** Custom size for the spinner */\n size?: 'small' | 'large';\n}\n\nexport const LoadingFallback: React.FC<LoadingFallbackProps> = ({ fullScreen = false, size = 'large' }) => {\n const { theme, t } = useFeedbackUi();\n const colors = theme.colors;\n const primary = theme.palette.primary['500'];\n\n return (\n <View\n accessibilityHint={t('loadingFallback.hint')}\n accessibilityLabel={t('loadingFallback.label')}\n accessibilityRole=\"progressbar\"\n style={[styles.container, fullScreen && styles.fullScreen, { backgroundColor: colors.background }]}\n testID={FEEDBACK_TEST_IDS.loadingFallback}\n >\n <ActivityIndicator color={primary} size={size} />\n </View>\n );\n};\n\nexport default LoadingFallback;\n","/**\n * PageSkeleton - shimmer skeleton loader for full pages.\n *\n * Improves perceived performance (Speed Index) by showing immediate visual\n * feedback while page content loads.\n */\nimport React from 'react';\n\nimport { Animated, Easing, Platform, StyleSheet, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst ANIMATION_DURATION_MS = 1200;\nconst SKELETON_BORDER_RADIUS = 4;\nconst SKELETON_OPACITY_START = 0.3;\nconst SKELETON_OPACITY_END = 0.7;\nconst DEFAULT_ROWS = 5;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n padding: 16,\n },\n header: {\n height: 32,\n borderRadius: SKELETON_BORDER_RADIUS,\n marginBottom: 24,\n width: '60%',\n },\n row: {\n flexDirection: 'row',\n marginBottom: 16,\n },\n avatar: {\n width: 48,\n height: 48,\n borderRadius: 24,\n marginRight: 12,\n },\n textContainer: {\n flex: 1,\n justifyContent: 'center',\n },\n textLine: {\n height: 16,\n borderRadius: SKELETON_BORDER_RADIUS,\n marginBottom: 8,\n },\n textLineShort: {\n width: '70%',\n },\n textLineFull: {\n width: '100%',\n },\n card: {\n height: 120,\n borderRadius: 8,\n marginBottom: 16,\n },\n});\n\nexport interface PageSkeletonProps {\n /** Number of skeleton rows to show */\n rows?: number;\n /** Show header skeleton */\n showHeader?: boolean;\n /** Show card skeletons instead of rows */\n variant?: 'list' | 'cards';\n}\n\nexport const PageSkeleton: React.FC<PageSkeletonProps> = ({\n rows = DEFAULT_ROWS,\n showHeader = true,\n variant = 'list',\n}) => {\n const { theme, t } = useFeedbackUi();\n const colors = theme.colors;\n\n const animatedValue = React.useRef(new Animated.Value(0)).current;\n\n React.useEffect(() => {\n const animation = Animated.loop(\n Animated.sequence([\n Animated.timing(animatedValue, {\n toValue: 1,\n duration: ANIMATION_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: Platform.OS !== 'web',\n }),\n Animated.timing(animatedValue, {\n toValue: 0,\n duration: ANIMATION_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: Platform.OS !== 'web',\n }),\n ]),\n );\n animation.start();\n return () => animation.stop();\n }, [animatedValue]);\n\n const opacity = animatedValue.interpolate({\n inputRange: [0, 1],\n outputRange: [SKELETON_OPACITY_START, SKELETON_OPACITY_END],\n });\n\n const skeletonColor = String(colors.border);\n\n const renderListRow = (index: number): React.ReactElement => (\n <View key={index} style={styles.row}>\n <Animated.View style={[styles.avatar, { backgroundColor: skeletonColor, opacity }]} />\n <View style={styles.textContainer}>\n <Animated.View style={[styles.textLine, styles.textLineFull, { backgroundColor: skeletonColor, opacity }]} />\n <Animated.View style={[styles.textLine, styles.textLineShort, { backgroundColor: skeletonColor, opacity }]} />\n </View>\n </View>\n );\n\n const renderCard = (index: number): React.ReactElement => (\n <Animated.View key={index} style={[styles.card, { backgroundColor: skeletonColor, opacity }]} />\n );\n\n const rowElements = Array.from({ length: rows }, (_, i) => (variant === 'cards' ? renderCard(i) : renderListRow(i)));\n\n return (\n <View\n accessibilityHint={t('pageSkeleton.loadingHint')}\n accessibilityLabel={t('pageSkeleton.loadingLabel')}\n accessibilityState={{ busy: true }}\n style={[styles.container, { backgroundColor: colors.background }]}\n testID={FEEDBACK_TEST_IDS.pageSkeleton}\n >\n {showHeader ? <Animated.View style={[styles.header, { backgroundColor: skeletonColor, opacity }]} /> : null}\n {rowElements}\n </View>\n );\n};\n\nexport default PageSkeleton;\n","/**\n * ConfirmDialog - modal confirm/cancel dialog with optional destructive + loading states.\n */\nimport React, { useMemo } from 'react';\n\nimport {\n ActivityIndicator,\n Modal,\n StyleSheet,\n Text,\n TouchableOpacity,\n View,\n} from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { DISABLED_OPACITY, MODAL_OVERLAY_COLOR, FEEDBACK_TEST_IDS } from '../constants';\n\nconst DIALOG_MAX_WIDTH = 400;\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n backgroundColor: MODAL_OVERLAY_COLOR,\n justifyContent: 'center',\n alignItems: 'center',\n padding: 20,\n },\n dialog: {\n width: '100%',\n maxWidth: DIALOG_MAX_WIDTH,\n borderRadius: 12,\n padding: 20,\n boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.25)',\n elevation: 5,\n },\n title: {\n fontSize: 18,\n fontWeight: '600',\n marginBottom: 12,\n },\n message: {\n fontSize: 14,\n lineHeight: 20,\n marginBottom: 20,\n },\n buttonRow: {\n flexDirection: 'row',\n justifyContent: 'flex-end',\n gap: 12,\n },\n button: {\n paddingVertical: 10,\n paddingHorizontal: 20,\n borderRadius: 6,\n minWidth: 80,\n alignItems: 'center',\n justifyContent: 'center',\n },\n cancelButton: {\n borderWidth: 1,\n },\n confirmButton: {},\n buttonText: {\n fontSize: 14,\n fontWeight: '600',\n },\n disabledButton: {\n opacity: DISABLED_OPACITY,\n },\n});\n\nexport interface ConfirmDialogProps {\n visible: boolean;\n title: string;\n message: string;\n onConfirm: () => void;\n onCancel: () => void;\n confirmLabel?: string;\n cancelLabel?: string;\n confirmDisabled?: boolean;\n loading?: boolean;\n destructive?: boolean;\n}\n\nexport const ConfirmDialog = ({\n visible,\n title,\n message,\n onConfirm,\n onCancel,\n confirmLabel,\n cancelLabel,\n confirmDisabled = false,\n loading = false,\n destructive = false,\n}: ConfirmDialogProps): React.ReactElement | null => {\n const { theme, t } = useFeedbackUi();\n\n const colorStyles = useMemo(\n () => ({\n dialog: { backgroundColor: theme.colors.surfaceElevated },\n title: { color: theme.colors.text },\n message: { color: theme.colors.textSecondary },\n cancelButton: { borderColor: theme.colors.border },\n cancelButtonText: { color: theme.colors.text },\n confirmButton: {\n backgroundColor: destructive ? theme.semantic.error['500'] : theme.palette.primary['500'],\n },\n confirmButtonText: { color: theme.colors.surfaceElevated },\n }),\n [theme, destructive]\n );\n\n const resolvedConfirmLabel = confirmLabel ?? t('common.confirm');\n const resolvedCancelLabel = cancelLabel ?? t('common.cancel');\n\n const isConfirmDisabled = confirmDisabled || loading;\n\n if (!visible)\n return null;\n\n return (\n <Modal\n transparent\n animationType=\"fade\"\n visible={visible}\n onRequestClose={onCancel}\n >\n <View style={styles.overlay} testID={FEEDBACK_TEST_IDS.confirmDialog}>\n <View\n accessibilityViewIsModal\n aria-label={title}\n role=\"dialog\"\n style={[styles.dialog, colorStyles.dialog]}\n >\n <Text style={[styles.title, colorStyles.title]}>{title}</Text>\n <Text style={[styles.message, colorStyles.message]}>{message}</Text>\n\n <View style={styles.buttonRow}>\n <TouchableOpacity\n accessibilityHint={t('common.cancelHint')}\n accessibilityLabel={resolvedCancelLabel}\n accessibilityRole=\"button\"\n style={[\n styles.button,\n styles.cancelButton,\n colorStyles.cancelButton,\n ]}\n testID={FEEDBACK_TEST_IDS.cancelConfirmButton}\n onPress={onCancel}\n >\n <Text style={[styles.buttonText, colorStyles.cancelButtonText]}>\n {resolvedCancelLabel}\n </Text>\n </TouchableOpacity>\n\n <TouchableOpacity\n accessibilityHint={t('common.confirmHint')}\n accessibilityLabel={resolvedConfirmLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: isConfirmDisabled }}\n disabled={isConfirmDisabled}\n style={[\n styles.button,\n styles.confirmButton,\n colorStyles.confirmButton,\n isConfirmDisabled && styles.disabledButton,\n ]}\n testID={FEEDBACK_TEST_IDS.confirmButton}\n onPress={onConfirm}\n >\n {loading ? (\n <ActivityIndicator\n color={theme.colors.surfaceElevated}\n size=\"small\"\n testID=\"confirm-loading\"\n />\n ) : (\n <Text\n style={[styles.buttonText, colorStyles.confirmButtonText]}\n >\n {resolvedConfirmLabel}\n </Text>\n )}\n </TouchableOpacity>\n </View>\n </View>\n </View>\n </Modal>\n );\n};\n\nexport default ConfirmDialog;\n","/**\n * ToastHost — the shared, tokenized transient-toast overlay promoted from the\n * byte-identical erevna-web / katalogos-web `ToastContainer` twins.\n *\n * The RENDERING (animated fade-in/out, positioning, theming) lives here; the\n * EMIT pipeline stays in the app (its event bus / `@dloizides/bff-web-client`\n * toast emitter). The app wires the two together via the `subscribe` port: a\n * function that registers a push callback and returns an unsubscribe. Colours\n * come from the UiProvider theme (`useUi`) — nothing hardcoded.\n */\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Animated, Platform, StyleSheet, Text, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\n// --- Defaults (ported from the twins) ---------------------------------------\nconst DEFAULT_DURATION_MS = 3000;\nconst DEFAULT_FADE_MS = 200;\nconst DEFAULT_MAX_LENGTH = 500;\n\nconst TOAST_TOP_WEB = 10;\nconst TOAST_TOP_MOBILE = 40;\nconst TOAST_HORIZONTAL_MARGIN = 10;\nconst TOAST_Z_INDEX = 9999;\nconst TOAST_INITIAL_TRANSLATE_Y = -6;\nconst TOAST_MAX_WIDTH = 600;\nconst TOAST_PADDING_HORIZONTAL = 16;\nconst TOAST_PADDING_VERTICAL = 10;\nconst TOAST_BORDER_RADIUS = 8;\nconst TOAST_MARGIN_VERTICAL = 6;\n\n// Character-range bounds for the display sanitizer.\nconst C0_CONTROL_END = 0x1f;\nconst C1_CONTROL_START = 0x7f;\nconst C1_CONTROL_END = 0x9f;\nconst ZERO_WIDTH_START = 0x200b;\nconst ZERO_WIDTH_END = 0x200f;\nconst BYTE_ORDER_MARK = 0xfeff;\n\nexport type ToastType = 'success' | 'info' | 'error';\n\n/** What the app pushes through the `subscribe` port. */\nexport interface ToastInput {\n text: string;\n type?: ToastType;\n}\n\ninterface ToastMessage extends ToastInput {\n id: string;\n}\n\ninterface ToastColors {\n primary: string;\n success: string;\n error: string;\n text: string;\n}\n\nconst styles = StyleSheet.create({\n container: {\n position: 'absolute',\n top: Platform.OS === 'web' ? TOAST_TOP_WEB : TOAST_TOP_MOBILE,\n left: TOAST_HORIZONTAL_MARGIN,\n right: TOAST_HORIZONTAL_MARGIN,\n alignItems: 'center',\n zIndex: TOAST_Z_INDEX,\n pointerEvents: 'box-none',\n },\n toast: {\n paddingHorizontal: TOAST_PADDING_HORIZONTAL,\n paddingVertical: TOAST_PADDING_VERTICAL,\n borderRadius: TOAST_BORDER_RADIUS,\n marginVertical: TOAST_MARGIN_VERTICAL,\n minWidth: '40%',\n maxWidth: TOAST_MAX_WIDTH,\n boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.2)',\n elevation: 4,\n },\n text: {},\n});\n\n/** Truncate + strip control / zero-width characters before display. */\nfunction sanitizeToastText(input: string, maxLength: number): string {\n let stripped = '';\n for (const ch of input) {\n const code = ch.codePointAt(0) ?? 0;\n const isControl = code <= C0_CONTROL_END || (code >= C1_CONTROL_START && code <= C1_CONTROL_END);\n const isHidden = (code >= ZERO_WIDTH_START && code <= ZERO_WIDTH_END) || code === BYTE_ORDER_MARK;\n if (!isControl && !isHidden) stripped += ch;\n }\n return stripped.length > maxLength ? stripped.slice(0, maxLength) : stripped;\n}\n\ninterface ToastItemProps {\n message: ToastMessage;\n onDone: (id: string) => void;\n colors: ToastColors;\n durationMs: number;\n fadeMs: number;\n testID: string;\n}\n\nconst ToastItem = ({ message, onDone, colors, durationMs, fadeMs, testID }: ToastItemProps): React.ReactElement => {\n const opacityRef = useRef(new Animated.Value(0));\n const translateYRef = useRef(new Animated.Value(TOAST_INITIAL_TRANSLATE_Y));\n const opacity = opacityRef.current;\n const translateY = translateYRef.current;\n\n const backgroundColor = useMemo((): string => {\n if (message.type === 'success') return colors.success;\n if (message.type === 'error') return colors.error;\n return colors.primary;\n }, [colors.error, colors.primary, colors.success, message.type]);\n\n const handleDone = useCallback((): void => {\n onDone(message.id);\n }, [message.id, onDone]);\n\n useEffect(() => {\n const useNative = Platform.OS !== 'web';\n Animated.parallel([\n Animated.timing(opacity, { toValue: 1, duration: fadeMs, useNativeDriver: useNative }),\n Animated.timing(translateY, { toValue: 0, duration: fadeMs, useNativeDriver: useNative }),\n ]).start();\n\n const hideTimer = setTimeout(() => {\n Animated.parallel([\n Animated.timing(opacity, { toValue: 0, duration: fadeMs, useNativeDriver: useNative }),\n Animated.timing(translateY, { toValue: TOAST_INITIAL_TRANSLATE_Y, duration: fadeMs, useNativeDriver: useNative }),\n ]).start(handleDone);\n }, durationMs);\n\n return () => clearTimeout(hideTimer);\n }, [handleDone, opacity, translateY, durationMs, fadeMs]);\n\n // An error toast is a `role=\"alert\"` (assertive insert); success/info are `status` — both\n // sit inside the host's live region so a screen reader announces the message. On native the\n // per-item live region escalates errors to `assertive`.\n const isError = message.type === 'error';\n\n return (\n <Animated.View\n accessibilityLiveRegion={isError ? 'assertive' : 'polite'}\n role={isError ? 'alert' : 'status'}\n style={[styles.toast, { backgroundColor, transform: [{ translateY }], opacity }]}\n testID={testID}\n >\n <Text style={[styles.text, { color: colors.text }]}>{message.text}</Text>\n </Animated.View>\n );\n};\n\nexport interface ToastHostProps {\n /**\n * Register a push callback; return an unsubscribe. The app adapts its own\n * event bus (e.g. `@dloizides/bff-web-client`'s toast emitter) to this port.\n */\n subscribe: (push: (toast: ToastInput) => void) => () => void;\n /** How long each toast stays before fading (ms). Default 3000. */\n durationMs?: number;\n /** Fade in/out animation duration (ms). Default 200. */\n fadeMs?: number;\n /** Max message length before truncation. Default 500. */\n maxLength?: number;\n /** testID for each toast (defaults to `notification-toast`). */\n toastTestID?: string;\n}\n\nlet toastSeq = 0;\nfunction nextId(): string {\n toastSeq += 1;\n return `${String(Date.now())}-${String(toastSeq)}`;\n}\n\nexport const ToastHost = ({\n subscribe,\n durationMs = DEFAULT_DURATION_MS,\n fadeMs = DEFAULT_FADE_MS,\n maxLength = DEFAULT_MAX_LENGTH,\n toastTestID = FEEDBACK_TEST_IDS.notificationToast,\n}: ToastHostProps): React.ReactElement | null => {\n const [messages, setMessages] = useState<ToastMessage[]>([]);\n const { theme } = useFeedbackUi();\n\n const colors = useMemo<ToastColors>(\n () => ({\n primary: theme.palette.primary['500'],\n success: (theme.semantic.success ?? theme.semantic.error)['500'],\n error: theme.semantic.error['500'],\n text: theme.colors.surfaceElevated,\n }),\n [theme],\n );\n\n const push = useCallback(\n (toast: ToastInput): void => {\n setMessages((s) => [...s, { id: nextId(), type: toast.type, text: sanitizeToastText(toast.text, maxLength) }]);\n },\n [maxLength],\n );\n\n const remove = useCallback((id: string): void => {\n setMessages((s) => s.filter((x) => x.id !== id));\n }, []);\n\n useEffect(() => subscribe(push), [subscribe, push]);\n\n if (messages.length === 0) return null;\n\n return (\n <View style={styles.container}>\n {messages.map((m) => (\n <ToastItem\n key={m.id}\n colors={colors}\n durationMs={durationMs}\n fadeMs={fadeMs}\n message={m}\n testID={toastTestID}\n onDone={remove}\n />\n ))}\n </View>\n );\n};\n\nexport default ToastHost;\n","/**\n * warmingStore — a tiny, framework-agnostic (no React) store for the cold-start\n * \"warming up…\" UX (Move 3a).\n *\n * On a resource-tight, scale-to-zero prod node the BFF/upstream can be cold on the\n * FIRST request after idle. `@dloizides/bff-web-client`'s `warmupRetryInterceptor`\n * transparently retries the 502/503/504 and fires `onWarmupRetry({ attempt, … })`\n * per retry — but it has NO \"recovered\" signal (it only fires on retries, never on\n * the eventual success). So an app wires its `onWarmupRetry` to `notifyWarming(...)`\n * here, and this store AUTO-SETTLES `isWarming` back to false after a quiet period\n * with no new notify (i.e. the request finally succeeded and retries stopped).\n *\n * Shaped for React's `useSyncExternalStore`: `subscribeWarming` + `getWarmingSnapshot`\n * (the snapshot object identity only changes when the value changes, so no render loop).\n * SSR/no-DOM safe (timer is guarded, no `window`) and deterministic (no `Date.now()` /\n * `Math.random()`).\n */\n\n/**\n * How long (ms) the store stays \"warming\" after the LAST `notifyWarming` before it\n * auto-clears. Sized a touch above the interceptor's largest backoff so a genuine\n * retry storm keeps the overlay up, but a recovered request lets it settle.\n */\nexport const WARMING_QUIET_PERIOD_MS = 2500;\n\n/** What an app forwards from the interceptor's `onWarmupRetry` callback. */\nexport interface WarmingInfo {\n attempt: number;\n maxRetries?: number;\n status?: number;\n}\n\n/** Immutable snapshot read by `useSyncExternalStore`. */\nexport interface WarmingSnapshot {\n isWarming: boolean;\n attempt: number;\n}\n\ntype WarmingListener = () => void;\n\nconst IDLE_ATTEMPT = 0;\n\nlet warming = false;\nlet currentAttempt = IDLE_ATTEMPT;\nlet snapshot: WarmingSnapshot = { isWarming: false, attempt: IDLE_ATTEMPT };\n\nconst listeners = new Set<WarmingListener>();\nlet quietTimer: ReturnType<typeof setTimeout> | undefined;\n\nfunction refreshSnapshot(): void {\n snapshot = { isWarming: warming, attempt: currentAttempt };\n}\n\nfunction emit(): void {\n for (const listener of listeners) listener();\n}\n\nfunction clearQuietTimer(): void {\n if (quietTimer !== undefined) {\n clearTimeout(quietTimer);\n quietTimer = undefined;\n }\n}\n\nfunction scheduleSettle(): void {\n clearQuietTimer();\n // SSR / no-DOM guard: environments without a real timer just stay warming until\n // an explicit settleWarming() (or never render the overlay at all).\n if (typeof setTimeout !== 'function') return;\n quietTimer = setTimeout(() => {\n quietTimer = undefined;\n settleWarming();\n }, WARMING_QUIET_PERIOD_MS);\n}\n\n/**\n * Mark the store \"warming\" and record the latest retry attempt. Resets the\n * auto-settle timer, so as long as retries keep arriving the overlay stays up.\n * Call this from an app's `onWarmupRetry`.\n */\nexport function notifyWarming(info: WarmingInfo): void {\n const changed = !warming || currentAttempt !== info.attempt;\n warming = true;\n currentAttempt = info.attempt;\n scheduleSettle();\n if (changed) {\n refreshSnapshot();\n emit();\n }\n}\n\n/**\n * Force-clear the warming state (for tests, or to wire an explicit success signal\n * later). Also cancels any pending auto-settle timer. No-op when already idle.\n */\nexport function settleWarming(): void {\n clearQuietTimer();\n if (!warming) return;\n warming = false;\n currentAttempt = IDLE_ATTEMPT;\n refreshSnapshot();\n emit();\n}\n\n/** Register a listener; returns an unsubscribe. Shaped for `useSyncExternalStore`. */\nexport function subscribeWarming(listener: WarmingListener): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\n/** Current immutable snapshot. Stable identity until the value changes. */\nexport function getWarmingSnapshot(): WarmingSnapshot {\n return snapshot;\n}\n","/**\n * WarmingOverlay — a calm, branded, full-screen \"warming up…\" overlay for the\n * cold-start UX (Move 3a). It subscribes to the framework-agnostic warmingStore\n * via `useSyncExternalStore` and renders ONLY while `isWarming`, then disappears\n * on auto-settle (so it never permanently traps focus).\n *\n * This is intentionally NOT an error state: a title + subtitle + spinner, with an\n * optional attempt hint. Colours come from the UiProvider theme (`useFeedbackUi`)\n * or an explicit `theme` override — nothing hardcoded. Copy comes from `labels`,\n * a typed bag with English defaults merged with a partial override, so consuming\n * apps can localize but nothing breaks without it.\n */\nimport React, { useSyncExternalStore } from 'react';\n\nimport { ActivityIndicator, StyleSheet, Text, View } from 'react-native';\n\nimport { useFeedbackUi, type FeedbackTheme } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\nimport { getWarmingSnapshot, subscribeWarming } from './warmingStore';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nconst OVERLAY_Z_INDEX = 100000;\nconst CARD_GAP = 12;\nconst TITLE_FONT_SIZE = 20;\nconst SUBTITLE_FONT_SIZE = 15;\nconst ATTEMPT_FONT_SIZE = 13;\nconst CARD_PADDING = 24;\nconst NO_ATTEMPT = 0;\n\n// ---------------------------------------------------------------------------\n// Styles\n// ---------------------------------------------------------------------------\n\nconst styles = StyleSheet.create({\n overlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: OVERLAY_Z_INDEX,\n elevation: OVERLAY_Z_INDEX,\n padding: CARD_PADDING,\n },\n card: {\n alignItems: 'center',\n gap: CARD_GAP,\n maxWidth: 320,\n },\n title: {\n fontSize: TITLE_FONT_SIZE,\n fontWeight: '700',\n textAlign: 'center',\n },\n subtitle: {\n fontSize: SUBTITLE_FONT_SIZE,\n textAlign: 'center',\n },\n attempt: {\n fontSize: ATTEMPT_FONT_SIZE,\n textAlign: 'center',\n },\n});\n\n// ---------------------------------------------------------------------------\n// Labels\n// ---------------------------------------------------------------------------\n\n/** Copy for the overlay. All fields have English defaults; apps override any subset. */\nexport interface WarmingOverlayLabels {\n /** Big line, e.g. \"Warming up…\". */\n title: string;\n /** Reassuring second line, e.g. \"This only takes a moment\". */\n subtitle: string;\n /** Screen-reader label for the whole overlay. */\n accessibilityLabel: string;\n /** Optional per-attempt hint, given the current attempt number. */\n attemptHint: (attempt: number) => string;\n}\n\nconst DEFAULT_WARMING_LABELS: WarmingOverlayLabels = {\n title: 'Warming up…',\n subtitle: 'This only takes a moment',\n accessibilityLabel: 'Warming up, please wait',\n attemptHint: (attempt) => `Attempt ${String(attempt)}`,\n};\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport interface WarmingOverlayProps {\n /** Partial copy override; unset fields fall back to English defaults. */\n labels?: Partial<WarmingOverlayLabels>;\n /** Theme override; defaults to the mounted UiProvider theme. */\n theme?: FeedbackTheme;\n /** testID for the overlay container (children derive `${prefix}-title`, etc.). */\n testIdPrefix?: string;\n /** Show the \"Attempt N\" hint under the subtitle (default: false). */\n showAttempt?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport const WarmingOverlay = ({\n labels,\n theme: themeOverride,\n testIdPrefix = FEEDBACK_TEST_IDS.warmingOverlay,\n showAttempt = false,\n}: WarmingOverlayProps): React.ReactElement | null => {\n const ctx = useFeedbackUi();\n const snapshot = useSyncExternalStore(subscribeWarming, getWarmingSnapshot, getWarmingSnapshot);\n\n const theme = themeOverride ?? ctx.theme;\n const mergedLabels = { ...DEFAULT_WARMING_LABELS, ...labels };\n\n if (!snapshot.isWarming) return null;\n\n const colors = theme.colors;\n const primary = theme.palette.primary['500'];\n const showHint = showAttempt && snapshot.attempt > NO_ATTEMPT;\n\n return (\n <View\n accessibilityLabel={mergedLabels.accessibilityLabel}\n accessibilityRole=\"alert\"\n style={[styles.overlay, { backgroundColor: colors.background }]}\n testID={testIdPrefix}\n >\n <View style={styles.card}>\n <ActivityIndicator color={primary} size=\"large\" />\n <Text style={[styles.title, { color: colors.text }]} testID={`${testIdPrefix}-title`}>\n {mergedLabels.title}\n </Text>\n <Text style={[styles.subtitle, { color: colors.textSecondary }]} testID={`${testIdPrefix}-subtitle`}>\n {mergedLabels.subtitle}\n </Text>\n {showHint ? (\n <Text style={[styles.attempt, { color: colors.textSecondary }]} testID={`${testIdPrefix}-attempt`}>\n {mergedLabels.attemptHint(snapshot.attempt)}\n </Text>\n ) : null}\n </View>\n </View>\n );\n};\n\nexport default WarmingOverlay;\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React3, { createContext, useMemo, useContext, useCallback, useState, useEffect, useRef } from 'react';
|
|
1
|
+
import React3, { createContext, useMemo, useContext, useCallback, useState, useEffect, useSyncExternalStore, useRef } from 'react';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { StyleSheet, Platform, View, Text, TouchableOpacity, ActivityIndicator, Animated, Easing, Modal } from 'react-native';
|
|
4
4
|
|
|
@@ -53,7 +53,8 @@ var FEEDBACK_TEST_IDS = {
|
|
|
53
53
|
confirmDialog: "confirm-dialog",
|
|
54
54
|
confirmButton: "confirm-button",
|
|
55
55
|
cancelConfirmButton: "cancel-confirm-button",
|
|
56
|
-
notificationToast: "notification-toast"
|
|
56
|
+
notificationToast: "notification-toast",
|
|
57
|
+
warmingOverlay: "warming-overlay"
|
|
57
58
|
};
|
|
58
59
|
var MESSAGE_FONT_SIZE = 16;
|
|
59
60
|
var CONTAINER_PADDING = 20;
|
|
@@ -535,9 +536,12 @@ var ToastItem = ({ message, onDone, colors, durationMs, fadeMs, testID }) => {
|
|
|
535
536
|
}, durationMs);
|
|
536
537
|
return () => clearTimeout(hideTimer);
|
|
537
538
|
}, [handleDone, opacity, translateY, durationMs, fadeMs]);
|
|
539
|
+
const isError = message.type === "error";
|
|
538
540
|
return /* @__PURE__ */ jsx(
|
|
539
541
|
Animated.View,
|
|
540
542
|
{
|
|
543
|
+
accessibilityLiveRegion: isError ? "assertive" : "polite",
|
|
544
|
+
role: isError ? "alert" : "status",
|
|
541
545
|
style: [styles6.toast, { backgroundColor, transform: [{ translateY }], opacity }],
|
|
542
546
|
testID,
|
|
543
547
|
children: /* @__PURE__ */ jsx(Text, { style: [styles6.text, { color: colors.text }], children: message.text })
|
|
@@ -592,6 +596,137 @@ var ToastHost = ({
|
|
|
592
596
|
)) });
|
|
593
597
|
};
|
|
594
598
|
|
|
595
|
-
|
|
599
|
+
// src/Warming/warmingStore.ts
|
|
600
|
+
var WARMING_QUIET_PERIOD_MS = 2500;
|
|
601
|
+
var IDLE_ATTEMPT = 0;
|
|
602
|
+
var warming = false;
|
|
603
|
+
var currentAttempt = IDLE_ATTEMPT;
|
|
604
|
+
var snapshot = { isWarming: false, attempt: IDLE_ATTEMPT };
|
|
605
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
606
|
+
var quietTimer;
|
|
607
|
+
function refreshSnapshot() {
|
|
608
|
+
snapshot = { isWarming: warming, attempt: currentAttempt };
|
|
609
|
+
}
|
|
610
|
+
function emit() {
|
|
611
|
+
for (const listener of listeners) listener();
|
|
612
|
+
}
|
|
613
|
+
function clearQuietTimer() {
|
|
614
|
+
if (quietTimer !== void 0) {
|
|
615
|
+
clearTimeout(quietTimer);
|
|
616
|
+
quietTimer = void 0;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
function scheduleSettle() {
|
|
620
|
+
clearQuietTimer();
|
|
621
|
+
if (typeof setTimeout !== "function") return;
|
|
622
|
+
quietTimer = setTimeout(() => {
|
|
623
|
+
quietTimer = void 0;
|
|
624
|
+
settleWarming();
|
|
625
|
+
}, WARMING_QUIET_PERIOD_MS);
|
|
626
|
+
}
|
|
627
|
+
function notifyWarming(info) {
|
|
628
|
+
const changed = !warming || currentAttempt !== info.attempt;
|
|
629
|
+
warming = true;
|
|
630
|
+
currentAttempt = info.attempt;
|
|
631
|
+
scheduleSettle();
|
|
632
|
+
if (changed) {
|
|
633
|
+
refreshSnapshot();
|
|
634
|
+
emit();
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
function settleWarming() {
|
|
638
|
+
clearQuietTimer();
|
|
639
|
+
if (!warming) return;
|
|
640
|
+
warming = false;
|
|
641
|
+
currentAttempt = IDLE_ATTEMPT;
|
|
642
|
+
refreshSnapshot();
|
|
643
|
+
emit();
|
|
644
|
+
}
|
|
645
|
+
function subscribeWarming(listener) {
|
|
646
|
+
listeners.add(listener);
|
|
647
|
+
return () => {
|
|
648
|
+
listeners.delete(listener);
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
function getWarmingSnapshot() {
|
|
652
|
+
return snapshot;
|
|
653
|
+
}
|
|
654
|
+
var OVERLAY_Z_INDEX = 1e5;
|
|
655
|
+
var CARD_GAP = 12;
|
|
656
|
+
var TITLE_FONT_SIZE = 20;
|
|
657
|
+
var SUBTITLE_FONT_SIZE = 15;
|
|
658
|
+
var ATTEMPT_FONT_SIZE = 13;
|
|
659
|
+
var CARD_PADDING = 24;
|
|
660
|
+
var NO_ATTEMPT = 0;
|
|
661
|
+
var styles7 = StyleSheet.create({
|
|
662
|
+
overlay: {
|
|
663
|
+
position: "absolute",
|
|
664
|
+
top: 0,
|
|
665
|
+
left: 0,
|
|
666
|
+
right: 0,
|
|
667
|
+
bottom: 0,
|
|
668
|
+
alignItems: "center",
|
|
669
|
+
justifyContent: "center",
|
|
670
|
+
zIndex: OVERLAY_Z_INDEX,
|
|
671
|
+
elevation: OVERLAY_Z_INDEX,
|
|
672
|
+
padding: CARD_PADDING
|
|
673
|
+
},
|
|
674
|
+
card: {
|
|
675
|
+
alignItems: "center",
|
|
676
|
+
gap: CARD_GAP,
|
|
677
|
+
maxWidth: 320
|
|
678
|
+
},
|
|
679
|
+
title: {
|
|
680
|
+
fontSize: TITLE_FONT_SIZE,
|
|
681
|
+
fontWeight: "700",
|
|
682
|
+
textAlign: "center"
|
|
683
|
+
},
|
|
684
|
+
subtitle: {
|
|
685
|
+
fontSize: SUBTITLE_FONT_SIZE,
|
|
686
|
+
textAlign: "center"
|
|
687
|
+
},
|
|
688
|
+
attempt: {
|
|
689
|
+
fontSize: ATTEMPT_FONT_SIZE,
|
|
690
|
+
textAlign: "center"
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
var DEFAULT_WARMING_LABELS = {
|
|
694
|
+
title: "Warming up\u2026",
|
|
695
|
+
subtitle: "This only takes a moment",
|
|
696
|
+
accessibilityLabel: "Warming up, please wait",
|
|
697
|
+
attemptHint: (attempt) => `Attempt ${String(attempt)}`
|
|
698
|
+
};
|
|
699
|
+
var WarmingOverlay = ({
|
|
700
|
+
labels,
|
|
701
|
+
theme: themeOverride,
|
|
702
|
+
testIdPrefix = FEEDBACK_TEST_IDS.warmingOverlay,
|
|
703
|
+
showAttempt = false
|
|
704
|
+
}) => {
|
|
705
|
+
const ctx = useFeedbackUi();
|
|
706
|
+
const snapshot2 = useSyncExternalStore(subscribeWarming, getWarmingSnapshot, getWarmingSnapshot);
|
|
707
|
+
const theme = themeOverride ?? ctx.theme;
|
|
708
|
+
const mergedLabels = { ...DEFAULT_WARMING_LABELS, ...labels };
|
|
709
|
+
if (!snapshot2.isWarming) return null;
|
|
710
|
+
const colors = theme.colors;
|
|
711
|
+
const primary = theme.palette.primary["500"];
|
|
712
|
+
const showHint = showAttempt && snapshot2.attempt > NO_ATTEMPT;
|
|
713
|
+
return /* @__PURE__ */ jsx(
|
|
714
|
+
View,
|
|
715
|
+
{
|
|
716
|
+
accessibilityLabel: mergedLabels.accessibilityLabel,
|
|
717
|
+
accessibilityRole: "alert",
|
|
718
|
+
style: [styles7.overlay, { backgroundColor: colors.background }],
|
|
719
|
+
testID: testIdPrefix,
|
|
720
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles7.card, children: [
|
|
721
|
+
/* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size: "large" }),
|
|
722
|
+
/* @__PURE__ */ jsx(Text, { style: [styles7.title, { color: colors.text }], testID: `${testIdPrefix}-title`, children: mergedLabels.title }),
|
|
723
|
+
/* @__PURE__ */ jsx(Text, { style: [styles7.subtitle, { color: colors.textSecondary }], testID: `${testIdPrefix}-subtitle`, children: mergedLabels.subtitle }),
|
|
724
|
+
showHint ? /* @__PURE__ */ jsx(Text, { style: [styles7.attempt, { color: colors.textSecondary }], testID: `${testIdPrefix}-attempt`, children: mergedLabels.attemptHint(snapshot2.attempt) }) : null
|
|
725
|
+
] })
|
|
726
|
+
}
|
|
727
|
+
);
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
export { ConfirmDialog, DISABLED_OPACITY, EmptyListState, ErrorState, FEEDBACK_TEST_IDS, FeedbackUiProvider, LoadingFallback, MODAL_OVERLAY_COLOR, PageSkeleton, ToastHost, FeedbackUiProvider as UiProvider, WARMING_QUIET_PERIOD_MS, WarmingOverlay, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|
|
596
731
|
//# sourceMappingURL=index.mjs.map
|
|
597
732
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/context/FeedbackUiContext.tsx","../src/constants.ts","../src/ErrorState/ErrorState.tsx","../src/EmptyListState/EmptyListState.tsx","../src/LoadingFallback/LoadingFallback.tsx","../src/PageSkeleton/PageSkeleton.tsx","../src/ConfirmDialog/ConfirmDialog.tsx","../src/ToastHost/ToastHost.tsx"],"names":["jsx","MESSAGE_FONT_SIZE","CONTAINER_PADDING","styles","StyleSheet","jsxs","View","Text","TouchableOpacity","React","useMemo","ActivityIndicator","Platform","Animated","useCallback"],"mappings":";;;;;AAyDA,IAAM,sBAAA,GAA0C;AAAA,EAC9C,KAAA,EAAO;AAAA,IACL,MAAA,EAAQ;AAAA,MACN,UAAA,EAAY,SAAA;AAAA,MACZ,OAAA,EAAS,SAAA;AAAA,MACT,eAAA,EAAi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CAAA;AAAA,IACA,CAAC,KAAK;AAAA,GACR;AAEA,EAAA,MAAM,IAAA,GAAOI,WAAAA;AAAA,IACX,CAAC,KAAA,KAA4B;AAC3B,MAAA,WAAA,CAAY,CAAC,CAAA,KAAM,CAAC,GAAG,CAAA,EAAG,EAAE,IAAI,MAAA,EAAO,EAAG,MAAM,KAAA,CAAM,IAAA,EAAM,MAAM,iBAAA,CAAkB,KAAA,CAAM,MAAM,SAAS,CAAA,EAAG,CAAC,CAAA;AAAA,IAC/G,CAAA;AAAA,IACA,CAAC,SAAS;AAAA,GACZ;AAEA,EAAA,MAAM,MAAA,GAASA,WAAAA,CAAY,CAAC,EAAA,KAAqB;AAC/C,IAAA,WAAA,CAAY,CAAC,MAAM,CAAA,CAAE,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,EAAA,KAAO,EAAE,CAAC,CAAA;AAAA,EACjD,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,SAAA,CAAU,MAAM,SAAA,CAAU,IAAI,GAAG,CAAC,SAAA,EAAW,IAAI,CAAC,CAAA;AAElD,EAAA,IAAI,QAAA,CAAS,MAAA,KAAW,CAAA,EAAG,OAAO,IAAA;AAElC,EAAA,uBACEd,GAAAA,CAACM,IAAAA,EAAA,EAAK,KAAA,EAAOH,OAAAA,CAAO,SAAA,EACjB,QAAA,EAAA,QAAA,CAAS,GAAA,CAAI,CAAC,CAAA,qBACbH,GAAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MAEC,MAAA;AAAA,MACA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA,EAAS,CAAA;AAAA,MACT,MAAA,EAAQ,WAAA;AAAA,MACR,MAAA,EAAQ;AAAA,KAAA;AAAA,IANH,CAAA,CAAE;AAAA,GAQV,CAAA,EACH,CAAA;AAEJ","file":"index.mjs","sourcesContent":["import React, { createContext, useContext, useMemo } from 'react';\n\n/**\n * The minimal theme surface the feedback components read. Each consuming app's\n * resolved theme object is structurally compatible with this shape, so apps pass\n * their existing `useTheme().theme` straight through the provider.\n */\nexport interface FeedbackThemeColors {\n background: string;\n surface: string;\n surfaceElevated: string;\n text: string;\n textSecondary: string;\n border: string;\n}\n\n/** A colour scale. The `500` step is guaranteed; other steps (50–900) are addressable. */\nexport interface FeedbackColorScale {\n '500': string;\n [step: string]: string;\n}\n\n/** `primary` is guaranteed; apps typically also provide `secondary`/`accent` (addressable). */\nexport interface FeedbackThemePalette {\n primary: FeedbackColorScale;\n [name: string]: FeedbackColorScale;\n}\n\n/** `error` is guaranteed; apps typically also provide `success`/`warning`/`info` (addressable). */\nexport interface FeedbackThemeSemantic {\n error: FeedbackColorScale;\n [name: string]: FeedbackColorScale;\n}\n\nexport interface FeedbackTheme {\n colors: FeedbackThemeColors;\n palette: FeedbackThemePalette;\n semantic: FeedbackThemeSemantic;\n}\n\n/** Translate function — mirrors the apps' `FM(key, p1?, p2?, p3?)` helper. */\nexport type FeedbackTranslate = (key: string, p1?: string, p2?: string, p3?: string) => string;\n\n/** Navigation callback used by EmptyListState's optional call-to-action. */\nexport type FeedbackNavigate = (route: string) => void;\n\nexport interface FeedbackUiValue {\n theme: FeedbackTheme;\n t: FeedbackTranslate;\n navigate?: FeedbackNavigate;\n}\n\n/**\n * Neutral fallback used when no FeedbackUiProvider is mounted. Apps SHOULD mount a\n * provider so the components pick up the real theme + translations; the default keeps\n * the components rendering gracefully (e.g. in isolated tests) instead of throwing.\n */\nconst DEFAULT_FEEDBACK_VALUE: FeedbackUiValue = {\n theme: {\n colors: {\n background: '#ffffff',\n surface: '#f7f7f7',\n surfaceElevated: '#ffffff',\n text: '#111111',\n textSecondary: '#666666',\n border: '#dddddd',\n },\n palette: {\n primary: { '100': '#dbeafe', '500': '#2563eb', '700': '#1d4ed8' },\n secondary: { '500': '#64748b' },\n accent: { '500': '#f59e0b' },\n },\n semantic: {\n error: { '500': '#dc2626' },\n success: { '500': '#16a34a' },\n warning: { '500': '#d97706' },\n info: { '500': '#2563eb' },\n },\n },\n t: (key) => key,\n};\n\nconst FeedbackUiContext = createContext<FeedbackUiValue>(DEFAULT_FEEDBACK_VALUE);\n\nexport interface FeedbackUiProviderProps extends FeedbackUiValue {\n children: React.ReactNode;\n}\n\n/**\n * Supplies the host app's theme + translate (+ optional navigate) to the\n * `@dloizides/ui-feedback` components. Mount once, high in the app tree, below\n * the app's own ThemeProvider.\n */\nexport const FeedbackUiProvider = ({\n theme,\n t,\n navigate,\n children,\n}: FeedbackUiProviderProps): React.ReactElement => {\n const value = useMemo<FeedbackUiValue>(() => ({ theme, t, navigate }), [theme, t, navigate]);\n return <FeedbackUiContext.Provider value={value}>{children}</FeedbackUiContext.Provider>;\n};\n\n/**\n * Reads the feedback UI context. Returns the provider's value when one is mounted,\n * or a neutral default (see DEFAULT_FEEDBACK_VALUE) so components render gracefully\n * without a provider.\n */\nexport function useFeedbackUi(): FeedbackUiValue {\n return useContext(FeedbackUiContext);\n}\n","/** Semi-transparent scrim behind modal dialogs. */\nexport const MODAL_OVERLAY_COLOR = 'rgba(0, 0, 0, 0.5)';\n\n/** Opacity applied to disabled interactive controls. */\nexport const DISABLED_OPACITY = 0.5;\n\n/**\n * Default testID strings. These match the values the consuming apps already used\n * so existing Playwright selectors keep working after migration.\n */\nexport const FEEDBACK_TEST_IDS = {\n errorState: 'error-state',\n errorStateRetry: 'error-state-retry',\n emptyListCta: 'empty-list-cta',\n loadingFallback: 'loading-fallback',\n pageSkeleton: 'page-skeleton',\n confirmDialog: 'confirm-dialog',\n confirmButton: 'confirm-button',\n cancelConfirmButton: 'cancel-confirm-button',\n notificationToast: 'notification-toast',\n} as const;\n","/**\n * ErrorState - generic error display with optional retry button.\n */\nimport React from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nconst MESSAGE_FONT_SIZE = 16;\nconst CONTAINER_PADDING = 20;\nconst BUTTON_MARGIN_TOP = 12;\nconst BUTTON_PADDING_V = 8;\nconst BUTTON_PADDING_H = 16;\nconst BUTTON_BORDER_RADIUS = 6;\nconst BUTTON_FONT_SIZE = 14;\n\n// ---------------------------------------------------------------------------\n// Styles\n// ---------------------------------------------------------------------------\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: CONTAINER_PADDING,\n },\n message: {\n fontSize: MESSAGE_FONT_SIZE,\n textAlign: 'center',\n },\n retryButton: {\n marginTop: BUTTON_MARGIN_TOP,\n paddingVertical: BUTTON_PADDING_V,\n paddingHorizontal: BUTTON_PADDING_H,\n borderRadius: BUTTON_BORDER_RADIUS,\n },\n retryText: {\n fontSize: BUTTON_FONT_SIZE,\n fontWeight: '600',\n },\n});\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport interface ErrorStateProps {\n message: string;\n onRetry?: () => void;\n testID?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport const ErrorState = ({\n message,\n onRetry,\n testID = FEEDBACK_TEST_IDS.errorState,\n}: ErrorStateProps): React.ReactElement => {\n const { theme, t } = useFeedbackUi();\n const errorColor = theme.semantic.error['500'];\n const primary = theme.palette.primary['500'];\n\n return (\n <View style={styles.container} testID={testID}>\n <Text style={[styles.message, { color: errorColor }]}>{message}</Text>\n {typeof onRetry === 'function' ? (\n <TouchableOpacity\n accessibilityHint={t('common.retryHint')}\n accessibilityLabel={t('common.retry')}\n accessibilityRole=\"button\"\n style={[styles.retryButton, { backgroundColor: primary }]}\n testID={FEEDBACK_TEST_IDS.errorStateRetry}\n onPress={onRetry}\n >\n <Text style={[styles.retryText, { color: theme.colors.surfaceElevated }]}>\n {t('common.retry')}\n </Text>\n </TouchableOpacity>\n ) : null}\n </View>\n );\n};\n\nexport default ErrorState;\n","/**\n * EmptyListState - empty-collection message with an optional call-to-action.\n *\n * The CTA navigates via the `navigate` callback supplied through FeedbackUiProvider\n * (the host app adapts its router, e.g. expo-router's `router.push`).\n */\nimport React, { useCallback } from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst MESSAGE_FONT_SIZE = 16;\nconst CTA_MARGIN_TOP = 16;\nconst CTA_PADDING_VERTICAL = 10;\nconst CTA_PADDING_HORIZONTAL = 20;\nconst CTA_BORDER_RADIUS = 8;\nconst CTA_FONT_SIZE = 14;\nconst CONTAINER_PADDING = 32;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: CONTAINER_PADDING,\n },\n message: {\n fontSize: MESSAGE_FONT_SIZE,\n textAlign: 'center',\n },\n ctaButton: {\n marginTop: CTA_MARGIN_TOP,\n paddingVertical: CTA_PADDING_VERTICAL,\n paddingHorizontal: CTA_PADDING_HORIZONTAL,\n borderRadius: CTA_BORDER_RADIUS,\n },\n ctaText: {\n fontSize: CTA_FONT_SIZE,\n fontWeight: '600',\n },\n});\n\nexport interface EmptyListStateProps {\n messageKey: string;\n ctaTextKey?: string;\n ctaHintKey?: string;\n ctaRoute?: string;\n testID: string;\n}\n\nexport const EmptyListState = ({\n messageKey,\n ctaTextKey,\n ctaHintKey,\n ctaRoute,\n testID,\n}: EmptyListStateProps): React.ReactElement => {\n const { theme, t, navigate } = useFeedbackUi();\n const { colors } = theme;\n const primary = theme.palette.primary['500'];\n\n const handlePress = useCallback((): void => {\n if (typeof ctaRoute === 'string' && typeof navigate === 'function') navigate(ctaRoute);\n }, [navigate, ctaRoute]);\n\n const showCta = typeof ctaTextKey === 'string'\n && typeof ctaHintKey === 'string'\n && typeof ctaRoute === 'string';\n\n return (\n <View style={styles.container} testID={testID}>\n <Text style={[styles.message, { color: colors.textSecondary }]}>\n {t(messageKey)}\n </Text>\n {showCta ? (\n <TouchableOpacity\n accessibilityHint={t(ctaHintKey as string)}\n accessibilityLabel={t(ctaTextKey as string)}\n accessibilityRole=\"button\"\n style={[styles.ctaButton, { backgroundColor: primary }]}\n testID={FEEDBACK_TEST_IDS.emptyListCta}\n onPress={handlePress}\n >\n <Text style={[styles.ctaText, { color: colors.background }]}>\n {t(ctaTextKey as string)}\n </Text>\n </TouchableOpacity>\n ) : null}\n </View>\n );\n};\n\nexport default EmptyListState;\n","/**\n * LoadingFallback - lightweight loading indicator for lazy-loaded components.\n *\n * Used with React.lazy() and Suspense to show a loading state while heavy\n * components are loading. Optimized for minimal bundle impact.\n */\nimport React from 'react';\n\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst FULLSCREEN_MIN_HEIGHT = 300;\nconst CONTAINER_MIN_HEIGHT = 100;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n minHeight: CONTAINER_MIN_HEIGHT,\n },\n fullScreen: {\n minHeight: FULLSCREEN_MIN_HEIGHT,\n },\n});\n\nexport interface LoadingFallbackProps {\n /** Show as full-screen loader (default: false) */\n fullScreen?: boolean;\n /** Custom size for the spinner */\n size?: 'small' | 'large';\n}\n\nexport const LoadingFallback: React.FC<LoadingFallbackProps> = ({ fullScreen = false, size = 'large' }) => {\n const { theme, t } = useFeedbackUi();\n const colors = theme.colors;\n const primary = theme.palette.primary['500'];\n\n return (\n <View\n accessibilityHint={t('loadingFallback.hint')}\n accessibilityLabel={t('loadingFallback.label')}\n accessibilityRole=\"progressbar\"\n style={[styles.container, fullScreen && styles.fullScreen, { backgroundColor: colors.background }]}\n testID={FEEDBACK_TEST_IDS.loadingFallback}\n >\n <ActivityIndicator color={primary} size={size} />\n </View>\n );\n};\n\nexport default LoadingFallback;\n","/**\n * PageSkeleton - shimmer skeleton loader for full pages.\n *\n * Improves perceived performance (Speed Index) by showing immediate visual\n * feedback while page content loads.\n */\nimport React from 'react';\n\nimport { Animated, Easing, Platform, StyleSheet, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst ANIMATION_DURATION_MS = 1200;\nconst SKELETON_BORDER_RADIUS = 4;\nconst SKELETON_OPACITY_START = 0.3;\nconst SKELETON_OPACITY_END = 0.7;\nconst DEFAULT_ROWS = 5;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n padding: 16,\n },\n header: {\n height: 32,\n borderRadius: SKELETON_BORDER_RADIUS,\n marginBottom: 24,\n width: '60%',\n },\n row: {\n flexDirection: 'row',\n marginBottom: 16,\n },\n avatar: {\n width: 48,\n height: 48,\n borderRadius: 24,\n marginRight: 12,\n },\n textContainer: {\n flex: 1,\n justifyContent: 'center',\n },\n textLine: {\n height: 16,\n borderRadius: SKELETON_BORDER_RADIUS,\n marginBottom: 8,\n },\n textLineShort: {\n width: '70%',\n },\n textLineFull: {\n width: '100%',\n },\n card: {\n height: 120,\n borderRadius: 8,\n marginBottom: 16,\n },\n});\n\nexport interface PageSkeletonProps {\n /** Number of skeleton rows to show */\n rows?: number;\n /** Show header skeleton */\n showHeader?: boolean;\n /** Show card skeletons instead of rows */\n variant?: 'list' | 'cards';\n}\n\nexport const PageSkeleton: React.FC<PageSkeletonProps> = ({\n rows = DEFAULT_ROWS,\n showHeader = true,\n variant = 'list',\n}) => {\n const { theme, t } = useFeedbackUi();\n const colors = theme.colors;\n\n const animatedValue = React.useRef(new Animated.Value(0)).current;\n\n React.useEffect(() => {\n const animation = Animated.loop(\n Animated.sequence([\n Animated.timing(animatedValue, {\n toValue: 1,\n duration: ANIMATION_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: Platform.OS !== 'web',\n }),\n Animated.timing(animatedValue, {\n toValue: 0,\n duration: ANIMATION_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: Platform.OS !== 'web',\n }),\n ]),\n );\n animation.start();\n return () => animation.stop();\n }, [animatedValue]);\n\n const opacity = animatedValue.interpolate({\n inputRange: [0, 1],\n outputRange: [SKELETON_OPACITY_START, SKELETON_OPACITY_END],\n });\n\n const skeletonColor = String(colors.border);\n\n const renderListRow = (index: number): React.ReactElement => (\n <View key={index} style={styles.row}>\n <Animated.View style={[styles.avatar, { backgroundColor: skeletonColor, opacity }]} />\n <View style={styles.textContainer}>\n <Animated.View style={[styles.textLine, styles.textLineFull, { backgroundColor: skeletonColor, opacity }]} />\n <Animated.View style={[styles.textLine, styles.textLineShort, { backgroundColor: skeletonColor, opacity }]} />\n </View>\n </View>\n );\n\n const renderCard = (index: number): React.ReactElement => (\n <Animated.View key={index} style={[styles.card, { backgroundColor: skeletonColor, opacity }]} />\n );\n\n const rowElements = Array.from({ length: rows }, (_, i) => (variant === 'cards' ? renderCard(i) : renderListRow(i)));\n\n return (\n <View\n accessibilityHint={t('pageSkeleton.loadingHint')}\n accessibilityLabel={t('pageSkeleton.loadingLabel')}\n accessibilityState={{ busy: true }}\n style={[styles.container, { backgroundColor: colors.background }]}\n testID={FEEDBACK_TEST_IDS.pageSkeleton}\n >\n {showHeader ? <Animated.View style={[styles.header, { backgroundColor: skeletonColor, opacity }]} /> : null}\n {rowElements}\n </View>\n );\n};\n\nexport default PageSkeleton;\n","/**\n * ConfirmDialog - modal confirm/cancel dialog with optional destructive + loading states.\n */\nimport React, { useMemo } from 'react';\n\nimport {\n ActivityIndicator,\n Modal,\n StyleSheet,\n Text,\n TouchableOpacity,\n View,\n} from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { DISABLED_OPACITY, MODAL_OVERLAY_COLOR, FEEDBACK_TEST_IDS } from '../constants';\n\nconst DIALOG_MAX_WIDTH = 400;\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n backgroundColor: MODAL_OVERLAY_COLOR,\n justifyContent: 'center',\n alignItems: 'center',\n padding: 20,\n },\n dialog: {\n width: '100%',\n maxWidth: DIALOG_MAX_WIDTH,\n borderRadius: 12,\n padding: 20,\n boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.25)',\n elevation: 5,\n },\n title: {\n fontSize: 18,\n fontWeight: '600',\n marginBottom: 12,\n },\n message: {\n fontSize: 14,\n lineHeight: 20,\n marginBottom: 20,\n },\n buttonRow: {\n flexDirection: 'row',\n justifyContent: 'flex-end',\n gap: 12,\n },\n button: {\n paddingVertical: 10,\n paddingHorizontal: 20,\n borderRadius: 6,\n minWidth: 80,\n alignItems: 'center',\n justifyContent: 'center',\n },\n cancelButton: {\n borderWidth: 1,\n },\n confirmButton: {},\n buttonText: {\n fontSize: 14,\n fontWeight: '600',\n },\n disabledButton: {\n opacity: DISABLED_OPACITY,\n },\n});\n\nexport interface ConfirmDialogProps {\n visible: boolean;\n title: string;\n message: string;\n onConfirm: () => void;\n onCancel: () => void;\n confirmLabel?: string;\n cancelLabel?: string;\n confirmDisabled?: boolean;\n loading?: boolean;\n destructive?: boolean;\n}\n\nexport const ConfirmDialog = ({\n visible,\n title,\n message,\n onConfirm,\n onCancel,\n confirmLabel,\n cancelLabel,\n confirmDisabled = false,\n loading = false,\n destructive = false,\n}: ConfirmDialogProps): React.ReactElement | null => {\n const { theme, t } = useFeedbackUi();\n\n const colorStyles = useMemo(\n () => ({\n dialog: { backgroundColor: theme.colors.surfaceElevated },\n title: { color: theme.colors.text },\n message: { color: theme.colors.textSecondary },\n cancelButton: { borderColor: theme.colors.border },\n cancelButtonText: { color: theme.colors.text },\n confirmButton: {\n backgroundColor: destructive ? theme.semantic.error['500'] : theme.palette.primary['500'],\n },\n confirmButtonText: { color: theme.colors.surfaceElevated },\n }),\n [theme, destructive]\n );\n\n const resolvedConfirmLabel = confirmLabel ?? t('common.confirm');\n const resolvedCancelLabel = cancelLabel ?? t('common.cancel');\n\n const isConfirmDisabled = confirmDisabled || loading;\n\n if (!visible)\n return null;\n\n return (\n <Modal\n transparent\n animationType=\"fade\"\n visible={visible}\n onRequestClose={onCancel}\n >\n <View style={styles.overlay} testID={FEEDBACK_TEST_IDS.confirmDialog}>\n <View\n accessibilityViewIsModal\n aria-label={title}\n role=\"dialog\"\n style={[styles.dialog, colorStyles.dialog]}\n >\n <Text style={[styles.title, colorStyles.title]}>{title}</Text>\n <Text style={[styles.message, colorStyles.message]}>{message}</Text>\n\n <View style={styles.buttonRow}>\n <TouchableOpacity\n accessibilityHint={t('common.cancelHint')}\n accessibilityLabel={resolvedCancelLabel}\n accessibilityRole=\"button\"\n style={[\n styles.button,\n styles.cancelButton,\n colorStyles.cancelButton,\n ]}\n testID={FEEDBACK_TEST_IDS.cancelConfirmButton}\n onPress={onCancel}\n >\n <Text style={[styles.buttonText, colorStyles.cancelButtonText]}>\n {resolvedCancelLabel}\n </Text>\n </TouchableOpacity>\n\n <TouchableOpacity\n accessibilityHint={t('common.confirmHint')}\n accessibilityLabel={resolvedConfirmLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: isConfirmDisabled }}\n disabled={isConfirmDisabled}\n style={[\n styles.button,\n styles.confirmButton,\n colorStyles.confirmButton,\n isConfirmDisabled && styles.disabledButton,\n ]}\n testID={FEEDBACK_TEST_IDS.confirmButton}\n onPress={onConfirm}\n >\n {loading ? (\n <ActivityIndicator\n color={theme.colors.surfaceElevated}\n size=\"small\"\n testID=\"confirm-loading\"\n />\n ) : (\n <Text\n style={[styles.buttonText, colorStyles.confirmButtonText]}\n >\n {resolvedConfirmLabel}\n </Text>\n )}\n </TouchableOpacity>\n </View>\n </View>\n </View>\n </Modal>\n );\n};\n\nexport default ConfirmDialog;\n","/**\n * ToastHost — the shared, tokenized transient-toast overlay promoted from the\n * byte-identical erevna-web / katalogos-web `ToastContainer` twins.\n *\n * The RENDERING (animated fade-in/out, positioning, theming) lives here; the\n * EMIT pipeline stays in the app (its event bus / `@dloizides/bff-web-client`\n * toast emitter). The app wires the two together via the `subscribe` port: a\n * function that registers a push callback and returns an unsubscribe. Colours\n * come from the UiProvider theme (`useUi`) — nothing hardcoded.\n */\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Animated, Platform, StyleSheet, Text, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\n// --- Defaults (ported from the twins) ---------------------------------------\nconst DEFAULT_DURATION_MS = 3000;\nconst DEFAULT_FADE_MS = 200;\nconst DEFAULT_MAX_LENGTH = 500;\n\nconst TOAST_TOP_WEB = 10;\nconst TOAST_TOP_MOBILE = 40;\nconst TOAST_HORIZONTAL_MARGIN = 10;\nconst TOAST_Z_INDEX = 9999;\nconst TOAST_INITIAL_TRANSLATE_Y = -6;\nconst TOAST_MAX_WIDTH = 600;\nconst TOAST_PADDING_HORIZONTAL = 16;\nconst TOAST_PADDING_VERTICAL = 10;\nconst TOAST_BORDER_RADIUS = 8;\nconst TOAST_MARGIN_VERTICAL = 6;\n\n// Character-range bounds for the display sanitizer.\nconst C0_CONTROL_END = 0x1f;\nconst C1_CONTROL_START = 0x7f;\nconst C1_CONTROL_END = 0x9f;\nconst ZERO_WIDTH_START = 0x200b;\nconst ZERO_WIDTH_END = 0x200f;\nconst BYTE_ORDER_MARK = 0xfeff;\n\nexport type ToastType = 'success' | 'info' | 'error';\n\n/** What the app pushes through the `subscribe` port. */\nexport interface ToastInput {\n text: string;\n type?: ToastType;\n}\n\ninterface ToastMessage extends ToastInput {\n id: string;\n}\n\ninterface ToastColors {\n primary: string;\n success: string;\n error: string;\n text: string;\n}\n\nconst styles = StyleSheet.create({\n container: {\n position: 'absolute',\n top: Platform.OS === 'web' ? TOAST_TOP_WEB : TOAST_TOP_MOBILE,\n left: TOAST_HORIZONTAL_MARGIN,\n right: TOAST_HORIZONTAL_MARGIN,\n alignItems: 'center',\n zIndex: TOAST_Z_INDEX,\n pointerEvents: 'box-none',\n },\n toast: {\n paddingHorizontal: TOAST_PADDING_HORIZONTAL,\n paddingVertical: TOAST_PADDING_VERTICAL,\n borderRadius: TOAST_BORDER_RADIUS,\n marginVertical: TOAST_MARGIN_VERTICAL,\n minWidth: '40%',\n maxWidth: TOAST_MAX_WIDTH,\n boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.2)',\n elevation: 4,\n },\n text: {},\n});\n\n/** Truncate + strip control / zero-width characters before display. */\nfunction sanitizeToastText(input: string, maxLength: number): string {\n let stripped = '';\n for (const ch of input) {\n const code = ch.codePointAt(0) ?? 0;\n const isControl = code <= C0_CONTROL_END || (code >= C1_CONTROL_START && code <= C1_CONTROL_END);\n const isHidden = (code >= ZERO_WIDTH_START && code <= ZERO_WIDTH_END) || code === BYTE_ORDER_MARK;\n if (!isControl && !isHidden) stripped += ch;\n }\n return stripped.length > maxLength ? stripped.slice(0, maxLength) : stripped;\n}\n\ninterface ToastItemProps {\n message: ToastMessage;\n onDone: (id: string) => void;\n colors: ToastColors;\n durationMs: number;\n fadeMs: number;\n testID: string;\n}\n\nconst ToastItem = ({ message, onDone, colors, durationMs, fadeMs, testID }: ToastItemProps): React.ReactElement => {\n const opacityRef = useRef(new Animated.Value(0));\n const translateYRef = useRef(new Animated.Value(TOAST_INITIAL_TRANSLATE_Y));\n const opacity = opacityRef.current;\n const translateY = translateYRef.current;\n\n const backgroundColor = useMemo((): string => {\n if (message.type === 'success') return colors.success;\n if (message.type === 'error') return colors.error;\n return colors.primary;\n }, [colors.error, colors.primary, colors.success, message.type]);\n\n const handleDone = useCallback((): void => {\n onDone(message.id);\n }, [message.id, onDone]);\n\n useEffect(() => {\n const useNative = Platform.OS !== 'web';\n Animated.parallel([\n Animated.timing(opacity, { toValue: 1, duration: fadeMs, useNativeDriver: useNative }),\n Animated.timing(translateY, { toValue: 0, duration: fadeMs, useNativeDriver: useNative }),\n ]).start();\n\n const hideTimer = setTimeout(() => {\n Animated.parallel([\n Animated.timing(opacity, { toValue: 0, duration: fadeMs, useNativeDriver: useNative }),\n Animated.timing(translateY, { toValue: TOAST_INITIAL_TRANSLATE_Y, duration: fadeMs, useNativeDriver: useNative }),\n ]).start(handleDone);\n }, durationMs);\n\n return () => clearTimeout(hideTimer);\n }, [handleDone, opacity, translateY, durationMs, fadeMs]);\n\n return (\n <Animated.View\n style={[styles.toast, { backgroundColor, transform: [{ translateY }], opacity }]}\n testID={testID}\n >\n <Text style={[styles.text, { color: colors.text }]}>{message.text}</Text>\n </Animated.View>\n );\n};\n\nexport interface ToastHostProps {\n /**\n * Register a push callback; return an unsubscribe. The app adapts its own\n * event bus (e.g. `@dloizides/bff-web-client`'s toast emitter) to this port.\n */\n subscribe: (push: (toast: ToastInput) => void) => () => void;\n /** How long each toast stays before fading (ms). Default 3000. */\n durationMs?: number;\n /** Fade in/out animation duration (ms). Default 200. */\n fadeMs?: number;\n /** Max message length before truncation. Default 500. */\n maxLength?: number;\n /** testID for each toast (defaults to `notification-toast`). */\n toastTestID?: string;\n}\n\nlet toastSeq = 0;\nfunction nextId(): string {\n toastSeq += 1;\n return `${String(Date.now())}-${String(toastSeq)}`;\n}\n\nexport const ToastHost = ({\n subscribe,\n durationMs = DEFAULT_DURATION_MS,\n fadeMs = DEFAULT_FADE_MS,\n maxLength = DEFAULT_MAX_LENGTH,\n toastTestID = FEEDBACK_TEST_IDS.notificationToast,\n}: ToastHostProps): React.ReactElement | null => {\n const [messages, setMessages] = useState<ToastMessage[]>([]);\n const { theme } = useFeedbackUi();\n\n const colors = useMemo<ToastColors>(\n () => ({\n primary: theme.palette.primary['500'],\n success: (theme.semantic.success ?? theme.semantic.error)['500'],\n error: theme.semantic.error['500'],\n text: theme.colors.surfaceElevated,\n }),\n [theme],\n );\n\n const push = useCallback(\n (toast: ToastInput): void => {\n setMessages((s) => [...s, { id: nextId(), type: toast.type, text: sanitizeToastText(toast.text, maxLength) }]);\n },\n [maxLength],\n );\n\n const remove = useCallback((id: string): void => {\n setMessages((s) => s.filter((x) => x.id !== id));\n }, []);\n\n useEffect(() => subscribe(push), [subscribe, push]);\n\n if (messages.length === 0) return null;\n\n return (\n <View style={styles.container}>\n {messages.map((m) => (\n <ToastItem\n key={m.id}\n colors={colors}\n durationMs={durationMs}\n fadeMs={fadeMs}\n message={m}\n testID={toastTestID}\n onDone={remove}\n />\n ))}\n </View>\n );\n};\n\nexport default ToastHost;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/context/FeedbackUiContext.tsx","../src/constants.ts","../src/ErrorState/ErrorState.tsx","../src/EmptyListState/EmptyListState.tsx","../src/LoadingFallback/LoadingFallback.tsx","../src/PageSkeleton/PageSkeleton.tsx","../src/ConfirmDialog/ConfirmDialog.tsx","../src/ToastHost/ToastHost.tsx","../src/Warming/warmingStore.ts","../src/Warming/WarmingOverlay.tsx"],"names":["jsx","MESSAGE_FONT_SIZE","CONTAINER_PADDING","styles","StyleSheet","jsxs","View","Text","TouchableOpacity","React","useMemo","ActivityIndicator","Platform","Animated","useCallback","snapshot"],"mappings":";;;;;AAyDA,IAAM,sBAAA,GAA0C;AAAA,EAC9C,KAAA,EAAO;AAAA,IACL,MAAA,EAAQ;AAAA,MACN,UAAA,EAAY,SAAA;AAAA,MACZ,OAAA,EAAS,SAAA;AAAA,MACT,eAAA,EAAiB,SAAA;AAAA,MACjB,IAAA,EAAM,SAAA;AAAA,MACN,aAAA,EAAe,SAAA;AAAA,MACf,MAAA,EAAQ;AAAA,KACV;AAAA,IACA,OAAA,EAAS;AAAA,MACP,SAAS,EAAE,KAAA,EAAO,WAAW,KAAA,EAAO,SAAA,EAAW,OAAO,SAAA,EAAU;AAAA,MAChE,SAAA,EAAW,EAAE,KAAA,EAAO,SAAA,EAAU;AAAA,MAC9B,MAAA,EAAQ,EAAE,KAAA,EAAO,SAAA;AAAU,KAC7B;AAAA,IACA,QAAA,EAAU;AAAA,MACR,KAAA,EAAO,EAAE,KAAA,EAAO,SAAA,EAAU;AAAA,MAC1B,OAAA,EAAS,EAAE,KAAA,EAAO,SAAA,EAAU;AAAA,MAC5B,OAAA,EAAS,EAAE,KAAA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AA;AAAA,wBACAH,GAAAA,CAACO,IAAAA,EAAA,EAAK,KAAA,EAAO,CAACJ,QAAO,QAAA,EAAU,EAAE,OAAO,MAAA,CAAO,aAAA,EAAe,CAAA,EAAG,MAAA,EAAQ,GAAG,YAAY,CAAA,SAAA,CAAA,EACrF,uBAAa,QAAA,EAChB,CAAA;AAAA,QACC,QAAA,mBACCH,GAAAA,CAACO,IAAAA,EAAA,EAAK,OAAO,CAACJ,OAAAA,CAAO,OAAA,EAAS,EAAE,KAAA,EAAO,MAAA,CAAO,eAAe,CAAA,EAAG,MAAA,EAAQ,CAAA,EAAG,YAAY,CAAA,QAAA,CAAA,EACpF,uBAAa,WAAA,CAAYY,SAAAA,CAAS,OAAO,CAAA,EAC5C,CAAA,GACE;AAAA,OAAA,EACN;AAAA;AAAA,GACF;AAEJ","file":"index.mjs","sourcesContent":["import React, { createContext, useContext, useMemo } from 'react';\n\n/**\n * The minimal theme surface the feedback components read. Each consuming app's\n * resolved theme object is structurally compatible with this shape, so apps pass\n * their existing `useTheme().theme` straight through the provider.\n */\nexport interface FeedbackThemeColors {\n background: string;\n surface: string;\n surfaceElevated: string;\n text: string;\n textSecondary: string;\n border: string;\n}\n\n/** A colour scale. The `500` step is guaranteed; other steps (50–900) are addressable. */\nexport interface FeedbackColorScale {\n '500': string;\n [step: string]: string;\n}\n\n/** `primary` is guaranteed; apps typically also provide `secondary`/`accent` (addressable). */\nexport interface FeedbackThemePalette {\n primary: FeedbackColorScale;\n [name: string]: FeedbackColorScale;\n}\n\n/** `error` is guaranteed; apps typically also provide `success`/`warning`/`info` (addressable). */\nexport interface FeedbackThemeSemantic {\n error: FeedbackColorScale;\n [name: string]: FeedbackColorScale;\n}\n\nexport interface FeedbackTheme {\n colors: FeedbackThemeColors;\n palette: FeedbackThemePalette;\n semantic: FeedbackThemeSemantic;\n}\n\n/** Translate function — mirrors the apps' `FM(key, p1?, p2?, p3?)` helper. */\nexport type FeedbackTranslate = (key: string, p1?: string, p2?: string, p3?: string) => string;\n\n/** Navigation callback used by EmptyListState's optional call-to-action. */\nexport type FeedbackNavigate = (route: string) => void;\n\nexport interface FeedbackUiValue {\n theme: FeedbackTheme;\n t: FeedbackTranslate;\n navigate?: FeedbackNavigate;\n}\n\n/**\n * Neutral fallback used when no FeedbackUiProvider is mounted. Apps SHOULD mount a\n * provider so the components pick up the real theme + translations; the default keeps\n * the components rendering gracefully (e.g. in isolated tests) instead of throwing.\n */\nconst DEFAULT_FEEDBACK_VALUE: FeedbackUiValue = {\n theme: {\n colors: {\n background: '#ffffff',\n surface: '#f7f7f7',\n surfaceElevated: '#ffffff',\n text: '#111111',\n textSecondary: '#666666',\n border: '#dddddd',\n },\n palette: {\n primary: { '100': '#dbeafe', '500': '#2563eb', '700': '#1d4ed8' },\n secondary: { '500': '#64748b' },\n accent: { '500': '#f59e0b' },\n },\n semantic: {\n error: { '500': '#dc2626' },\n success: { '500': '#16a34a' },\n warning: { '500': '#d97706' },\n info: { '500': '#2563eb' },\n },\n },\n t: (key) => key,\n};\n\nconst FeedbackUiContext = createContext<FeedbackUiValue>(DEFAULT_FEEDBACK_VALUE);\n\nexport interface FeedbackUiProviderProps extends FeedbackUiValue {\n children: React.ReactNode;\n}\n\n/**\n * Supplies the host app's theme + translate (+ optional navigate) to the\n * `@dloizides/ui-feedback` components. Mount once, high in the app tree, below\n * the app's own ThemeProvider.\n */\nexport const FeedbackUiProvider = ({\n theme,\n t,\n navigate,\n children,\n}: FeedbackUiProviderProps): React.ReactElement => {\n const value = useMemo<FeedbackUiValue>(() => ({ theme, t, navigate }), [theme, t, navigate]);\n return <FeedbackUiContext.Provider value={value}>{children}</FeedbackUiContext.Provider>;\n};\n\n/**\n * Reads the feedback UI context. Returns the provider's value when one is mounted,\n * or a neutral default (see DEFAULT_FEEDBACK_VALUE) so components render gracefully\n * without a provider.\n */\nexport function useFeedbackUi(): FeedbackUiValue {\n return useContext(FeedbackUiContext);\n}\n","/** Semi-transparent scrim behind modal dialogs. */\nexport const MODAL_OVERLAY_COLOR = 'rgba(0, 0, 0, 0.5)';\n\n/** Opacity applied to disabled interactive controls. */\nexport const DISABLED_OPACITY = 0.5;\n\n/**\n * Default testID strings. These match the values the consuming apps already used\n * so existing Playwright selectors keep working after migration.\n */\nexport const FEEDBACK_TEST_IDS = {\n errorState: 'error-state',\n errorStateRetry: 'error-state-retry',\n emptyListCta: 'empty-list-cta',\n loadingFallback: 'loading-fallback',\n pageSkeleton: 'page-skeleton',\n confirmDialog: 'confirm-dialog',\n confirmButton: 'confirm-button',\n cancelConfirmButton: 'cancel-confirm-button',\n notificationToast: 'notification-toast',\n warmingOverlay: 'warming-overlay',\n} as const;\n","/**\n * ErrorState - generic error display with optional retry button.\n */\nimport React from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nconst MESSAGE_FONT_SIZE = 16;\nconst CONTAINER_PADDING = 20;\nconst BUTTON_MARGIN_TOP = 12;\nconst BUTTON_PADDING_V = 8;\nconst BUTTON_PADDING_H = 16;\nconst BUTTON_BORDER_RADIUS = 6;\nconst BUTTON_FONT_SIZE = 14;\n\n// ---------------------------------------------------------------------------\n// Styles\n// ---------------------------------------------------------------------------\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: CONTAINER_PADDING,\n },\n message: {\n fontSize: MESSAGE_FONT_SIZE,\n textAlign: 'center',\n },\n retryButton: {\n marginTop: BUTTON_MARGIN_TOP,\n paddingVertical: BUTTON_PADDING_V,\n paddingHorizontal: BUTTON_PADDING_H,\n borderRadius: BUTTON_BORDER_RADIUS,\n },\n retryText: {\n fontSize: BUTTON_FONT_SIZE,\n fontWeight: '600',\n },\n});\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport interface ErrorStateProps {\n message: string;\n onRetry?: () => void;\n testID?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport const ErrorState = ({\n message,\n onRetry,\n testID = FEEDBACK_TEST_IDS.errorState,\n}: ErrorStateProps): React.ReactElement => {\n const { theme, t } = useFeedbackUi();\n const errorColor = theme.semantic.error['500'];\n const primary = theme.palette.primary['500'];\n\n return (\n <View style={styles.container} testID={testID}>\n <Text style={[styles.message, { color: errorColor }]}>{message}</Text>\n {typeof onRetry === 'function' ? (\n <TouchableOpacity\n accessibilityHint={t('common.retryHint')}\n accessibilityLabel={t('common.retry')}\n accessibilityRole=\"button\"\n style={[styles.retryButton, { backgroundColor: primary }]}\n testID={FEEDBACK_TEST_IDS.errorStateRetry}\n onPress={onRetry}\n >\n <Text style={[styles.retryText, { color: theme.colors.surfaceElevated }]}>\n {t('common.retry')}\n </Text>\n </TouchableOpacity>\n ) : null}\n </View>\n );\n};\n\nexport default ErrorState;\n","/**\n * EmptyListState - empty-collection message with an optional call-to-action.\n *\n * The CTA navigates via the `navigate` callback supplied through FeedbackUiProvider\n * (the host app adapts its router, e.g. expo-router's `router.push`).\n */\nimport React, { useCallback } from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst MESSAGE_FONT_SIZE = 16;\nconst CTA_MARGIN_TOP = 16;\nconst CTA_PADDING_VERTICAL = 10;\nconst CTA_PADDING_HORIZONTAL = 20;\nconst CTA_BORDER_RADIUS = 8;\nconst CTA_FONT_SIZE = 14;\nconst CONTAINER_PADDING = 32;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: CONTAINER_PADDING,\n },\n message: {\n fontSize: MESSAGE_FONT_SIZE,\n textAlign: 'center',\n },\n ctaButton: {\n marginTop: CTA_MARGIN_TOP,\n paddingVertical: CTA_PADDING_VERTICAL,\n paddingHorizontal: CTA_PADDING_HORIZONTAL,\n borderRadius: CTA_BORDER_RADIUS,\n },\n ctaText: {\n fontSize: CTA_FONT_SIZE,\n fontWeight: '600',\n },\n});\n\nexport interface EmptyListStateProps {\n messageKey: string;\n ctaTextKey?: string;\n ctaHintKey?: string;\n ctaRoute?: string;\n testID: string;\n}\n\nexport const EmptyListState = ({\n messageKey,\n ctaTextKey,\n ctaHintKey,\n ctaRoute,\n testID,\n}: EmptyListStateProps): React.ReactElement => {\n const { theme, t, navigate } = useFeedbackUi();\n const { colors } = theme;\n const primary = theme.palette.primary['500'];\n\n const handlePress = useCallback((): void => {\n if (typeof ctaRoute === 'string' && typeof navigate === 'function') navigate(ctaRoute);\n }, [navigate, ctaRoute]);\n\n const showCta = typeof ctaTextKey === 'string'\n && typeof ctaHintKey === 'string'\n && typeof ctaRoute === 'string';\n\n return (\n <View style={styles.container} testID={testID}>\n <Text style={[styles.message, { color: colors.textSecondary }]}>\n {t(messageKey)}\n </Text>\n {showCta ? (\n <TouchableOpacity\n accessibilityHint={t(ctaHintKey as string)}\n accessibilityLabel={t(ctaTextKey as string)}\n accessibilityRole=\"button\"\n style={[styles.ctaButton, { backgroundColor: primary }]}\n testID={FEEDBACK_TEST_IDS.emptyListCta}\n onPress={handlePress}\n >\n <Text style={[styles.ctaText, { color: colors.background }]}>\n {t(ctaTextKey as string)}\n </Text>\n </TouchableOpacity>\n ) : null}\n </View>\n );\n};\n\nexport default EmptyListState;\n","/**\n * LoadingFallback - lightweight loading indicator for lazy-loaded components.\n *\n * Used with React.lazy() and Suspense to show a loading state while heavy\n * components are loading. Optimized for minimal bundle impact.\n */\nimport React from 'react';\n\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst FULLSCREEN_MIN_HEIGHT = 300;\nconst CONTAINER_MIN_HEIGHT = 100;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n minHeight: CONTAINER_MIN_HEIGHT,\n },\n fullScreen: {\n minHeight: FULLSCREEN_MIN_HEIGHT,\n },\n});\n\nexport interface LoadingFallbackProps {\n /** Show as full-screen loader (default: false) */\n fullScreen?: boolean;\n /** Custom size for the spinner */\n size?: 'small' | 'large';\n}\n\nexport const LoadingFallback: React.FC<LoadingFallbackProps> = ({ fullScreen = false, size = 'large' }) => {\n const { theme, t } = useFeedbackUi();\n const colors = theme.colors;\n const primary = theme.palette.primary['500'];\n\n return (\n <View\n accessibilityHint={t('loadingFallback.hint')}\n accessibilityLabel={t('loadingFallback.label')}\n accessibilityRole=\"progressbar\"\n style={[styles.container, fullScreen && styles.fullScreen, { backgroundColor: colors.background }]}\n testID={FEEDBACK_TEST_IDS.loadingFallback}\n >\n <ActivityIndicator color={primary} size={size} />\n </View>\n );\n};\n\nexport default LoadingFallback;\n","/**\n * PageSkeleton - shimmer skeleton loader for full pages.\n *\n * Improves perceived performance (Speed Index) by showing immediate visual\n * feedback while page content loads.\n */\nimport React from 'react';\n\nimport { Animated, Easing, Platform, StyleSheet, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\nconst ANIMATION_DURATION_MS = 1200;\nconst SKELETON_BORDER_RADIUS = 4;\nconst SKELETON_OPACITY_START = 0.3;\nconst SKELETON_OPACITY_END = 0.7;\nconst DEFAULT_ROWS = 5;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n padding: 16,\n },\n header: {\n height: 32,\n borderRadius: SKELETON_BORDER_RADIUS,\n marginBottom: 24,\n width: '60%',\n },\n row: {\n flexDirection: 'row',\n marginBottom: 16,\n },\n avatar: {\n width: 48,\n height: 48,\n borderRadius: 24,\n marginRight: 12,\n },\n textContainer: {\n flex: 1,\n justifyContent: 'center',\n },\n textLine: {\n height: 16,\n borderRadius: SKELETON_BORDER_RADIUS,\n marginBottom: 8,\n },\n textLineShort: {\n width: '70%',\n },\n textLineFull: {\n width: '100%',\n },\n card: {\n height: 120,\n borderRadius: 8,\n marginBottom: 16,\n },\n});\n\nexport interface PageSkeletonProps {\n /** Number of skeleton rows to show */\n rows?: number;\n /** Show header skeleton */\n showHeader?: boolean;\n /** Show card skeletons instead of rows */\n variant?: 'list' | 'cards';\n}\n\nexport const PageSkeleton: React.FC<PageSkeletonProps> = ({\n rows = DEFAULT_ROWS,\n showHeader = true,\n variant = 'list',\n}) => {\n const { theme, t } = useFeedbackUi();\n const colors = theme.colors;\n\n const animatedValue = React.useRef(new Animated.Value(0)).current;\n\n React.useEffect(() => {\n const animation = Animated.loop(\n Animated.sequence([\n Animated.timing(animatedValue, {\n toValue: 1,\n duration: ANIMATION_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: Platform.OS !== 'web',\n }),\n Animated.timing(animatedValue, {\n toValue: 0,\n duration: ANIMATION_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n useNativeDriver: Platform.OS !== 'web',\n }),\n ]),\n );\n animation.start();\n return () => animation.stop();\n }, [animatedValue]);\n\n const opacity = animatedValue.interpolate({\n inputRange: [0, 1],\n outputRange: [SKELETON_OPACITY_START, SKELETON_OPACITY_END],\n });\n\n const skeletonColor = String(colors.border);\n\n const renderListRow = (index: number): React.ReactElement => (\n <View key={index} style={styles.row}>\n <Animated.View style={[styles.avatar, { backgroundColor: skeletonColor, opacity }]} />\n <View style={styles.textContainer}>\n <Animated.View style={[styles.textLine, styles.textLineFull, { backgroundColor: skeletonColor, opacity }]} />\n <Animated.View style={[styles.textLine, styles.textLineShort, { backgroundColor: skeletonColor, opacity }]} />\n </View>\n </View>\n );\n\n const renderCard = (index: number): React.ReactElement => (\n <Animated.View key={index} style={[styles.card, { backgroundColor: skeletonColor, opacity }]} />\n );\n\n const rowElements = Array.from({ length: rows }, (_, i) => (variant === 'cards' ? renderCard(i) : renderListRow(i)));\n\n return (\n <View\n accessibilityHint={t('pageSkeleton.loadingHint')}\n accessibilityLabel={t('pageSkeleton.loadingLabel')}\n accessibilityState={{ busy: true }}\n style={[styles.container, { backgroundColor: colors.background }]}\n testID={FEEDBACK_TEST_IDS.pageSkeleton}\n >\n {showHeader ? <Animated.View style={[styles.header, { backgroundColor: skeletonColor, opacity }]} /> : null}\n {rowElements}\n </View>\n );\n};\n\nexport default PageSkeleton;\n","/**\n * ConfirmDialog - modal confirm/cancel dialog with optional destructive + loading states.\n */\nimport React, { useMemo } from 'react';\n\nimport {\n ActivityIndicator,\n Modal,\n StyleSheet,\n Text,\n TouchableOpacity,\n View,\n} from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { DISABLED_OPACITY, MODAL_OVERLAY_COLOR, FEEDBACK_TEST_IDS } from '../constants';\n\nconst DIALOG_MAX_WIDTH = 400;\n\nconst styles = StyleSheet.create({\n overlay: {\n flex: 1,\n backgroundColor: MODAL_OVERLAY_COLOR,\n justifyContent: 'center',\n alignItems: 'center',\n padding: 20,\n },\n dialog: {\n width: '100%',\n maxWidth: DIALOG_MAX_WIDTH,\n borderRadius: 12,\n padding: 20,\n boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.25)',\n elevation: 5,\n },\n title: {\n fontSize: 18,\n fontWeight: '600',\n marginBottom: 12,\n },\n message: {\n fontSize: 14,\n lineHeight: 20,\n marginBottom: 20,\n },\n buttonRow: {\n flexDirection: 'row',\n justifyContent: 'flex-end',\n gap: 12,\n },\n button: {\n paddingVertical: 10,\n paddingHorizontal: 20,\n borderRadius: 6,\n minWidth: 80,\n alignItems: 'center',\n justifyContent: 'center',\n },\n cancelButton: {\n borderWidth: 1,\n },\n confirmButton: {},\n buttonText: {\n fontSize: 14,\n fontWeight: '600',\n },\n disabledButton: {\n opacity: DISABLED_OPACITY,\n },\n});\n\nexport interface ConfirmDialogProps {\n visible: boolean;\n title: string;\n message: string;\n onConfirm: () => void;\n onCancel: () => void;\n confirmLabel?: string;\n cancelLabel?: string;\n confirmDisabled?: boolean;\n loading?: boolean;\n destructive?: boolean;\n}\n\nexport const ConfirmDialog = ({\n visible,\n title,\n message,\n onConfirm,\n onCancel,\n confirmLabel,\n cancelLabel,\n confirmDisabled = false,\n loading = false,\n destructive = false,\n}: ConfirmDialogProps): React.ReactElement | null => {\n const { theme, t } = useFeedbackUi();\n\n const colorStyles = useMemo(\n () => ({\n dialog: { backgroundColor: theme.colors.surfaceElevated },\n title: { color: theme.colors.text },\n message: { color: theme.colors.textSecondary },\n cancelButton: { borderColor: theme.colors.border },\n cancelButtonText: { color: theme.colors.text },\n confirmButton: {\n backgroundColor: destructive ? theme.semantic.error['500'] : theme.palette.primary['500'],\n },\n confirmButtonText: { color: theme.colors.surfaceElevated },\n }),\n [theme, destructive]\n );\n\n const resolvedConfirmLabel = confirmLabel ?? t('common.confirm');\n const resolvedCancelLabel = cancelLabel ?? t('common.cancel');\n\n const isConfirmDisabled = confirmDisabled || loading;\n\n if (!visible)\n return null;\n\n return (\n <Modal\n transparent\n animationType=\"fade\"\n visible={visible}\n onRequestClose={onCancel}\n >\n <View style={styles.overlay} testID={FEEDBACK_TEST_IDS.confirmDialog}>\n <View\n accessibilityViewIsModal\n aria-label={title}\n role=\"dialog\"\n style={[styles.dialog, colorStyles.dialog]}\n >\n <Text style={[styles.title, colorStyles.title]}>{title}</Text>\n <Text style={[styles.message, colorStyles.message]}>{message}</Text>\n\n <View style={styles.buttonRow}>\n <TouchableOpacity\n accessibilityHint={t('common.cancelHint')}\n accessibilityLabel={resolvedCancelLabel}\n accessibilityRole=\"button\"\n style={[\n styles.button,\n styles.cancelButton,\n colorStyles.cancelButton,\n ]}\n testID={FEEDBACK_TEST_IDS.cancelConfirmButton}\n onPress={onCancel}\n >\n <Text style={[styles.buttonText, colorStyles.cancelButtonText]}>\n {resolvedCancelLabel}\n </Text>\n </TouchableOpacity>\n\n <TouchableOpacity\n accessibilityHint={t('common.confirmHint')}\n accessibilityLabel={resolvedConfirmLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: isConfirmDisabled }}\n disabled={isConfirmDisabled}\n style={[\n styles.button,\n styles.confirmButton,\n colorStyles.confirmButton,\n isConfirmDisabled && styles.disabledButton,\n ]}\n testID={FEEDBACK_TEST_IDS.confirmButton}\n onPress={onConfirm}\n >\n {loading ? (\n <ActivityIndicator\n color={theme.colors.surfaceElevated}\n size=\"small\"\n testID=\"confirm-loading\"\n />\n ) : (\n <Text\n style={[styles.buttonText, colorStyles.confirmButtonText]}\n >\n {resolvedConfirmLabel}\n </Text>\n )}\n </TouchableOpacity>\n </View>\n </View>\n </View>\n </Modal>\n );\n};\n\nexport default ConfirmDialog;\n","/**\n * ToastHost — the shared, tokenized transient-toast overlay promoted from the\n * byte-identical erevna-web / katalogos-web `ToastContainer` twins.\n *\n * The RENDERING (animated fade-in/out, positioning, theming) lives here; the\n * EMIT pipeline stays in the app (its event bus / `@dloizides/bff-web-client`\n * toast emitter). The app wires the two together via the `subscribe` port: a\n * function that registers a push callback and returns an unsubscribe. Colours\n * come from the UiProvider theme (`useUi`) — nothing hardcoded.\n */\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Animated, Platform, StyleSheet, Text, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\n// --- Defaults (ported from the twins) ---------------------------------------\nconst DEFAULT_DURATION_MS = 3000;\nconst DEFAULT_FADE_MS = 200;\nconst DEFAULT_MAX_LENGTH = 500;\n\nconst TOAST_TOP_WEB = 10;\nconst TOAST_TOP_MOBILE = 40;\nconst TOAST_HORIZONTAL_MARGIN = 10;\nconst TOAST_Z_INDEX = 9999;\nconst TOAST_INITIAL_TRANSLATE_Y = -6;\nconst TOAST_MAX_WIDTH = 600;\nconst TOAST_PADDING_HORIZONTAL = 16;\nconst TOAST_PADDING_VERTICAL = 10;\nconst TOAST_BORDER_RADIUS = 8;\nconst TOAST_MARGIN_VERTICAL = 6;\n\n// Character-range bounds for the display sanitizer.\nconst C0_CONTROL_END = 0x1f;\nconst C1_CONTROL_START = 0x7f;\nconst C1_CONTROL_END = 0x9f;\nconst ZERO_WIDTH_START = 0x200b;\nconst ZERO_WIDTH_END = 0x200f;\nconst BYTE_ORDER_MARK = 0xfeff;\n\nexport type ToastType = 'success' | 'info' | 'error';\n\n/** What the app pushes through the `subscribe` port. */\nexport interface ToastInput {\n text: string;\n type?: ToastType;\n}\n\ninterface ToastMessage extends ToastInput {\n id: string;\n}\n\ninterface ToastColors {\n primary: string;\n success: string;\n error: string;\n text: string;\n}\n\nconst styles = StyleSheet.create({\n container: {\n position: 'absolute',\n top: Platform.OS === 'web' ? TOAST_TOP_WEB : TOAST_TOP_MOBILE,\n left: TOAST_HORIZONTAL_MARGIN,\n right: TOAST_HORIZONTAL_MARGIN,\n alignItems: 'center',\n zIndex: TOAST_Z_INDEX,\n pointerEvents: 'box-none',\n },\n toast: {\n paddingHorizontal: TOAST_PADDING_HORIZONTAL,\n paddingVertical: TOAST_PADDING_VERTICAL,\n borderRadius: TOAST_BORDER_RADIUS,\n marginVertical: TOAST_MARGIN_VERTICAL,\n minWidth: '40%',\n maxWidth: TOAST_MAX_WIDTH,\n boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.2)',\n elevation: 4,\n },\n text: {},\n});\n\n/** Truncate + strip control / zero-width characters before display. */\nfunction sanitizeToastText(input: string, maxLength: number): string {\n let stripped = '';\n for (const ch of input) {\n const code = ch.codePointAt(0) ?? 0;\n const isControl = code <= C0_CONTROL_END || (code >= C1_CONTROL_START && code <= C1_CONTROL_END);\n const isHidden = (code >= ZERO_WIDTH_START && code <= ZERO_WIDTH_END) || code === BYTE_ORDER_MARK;\n if (!isControl && !isHidden) stripped += ch;\n }\n return stripped.length > maxLength ? stripped.slice(0, maxLength) : stripped;\n}\n\ninterface ToastItemProps {\n message: ToastMessage;\n onDone: (id: string) => void;\n colors: ToastColors;\n durationMs: number;\n fadeMs: number;\n testID: string;\n}\n\nconst ToastItem = ({ message, onDone, colors, durationMs, fadeMs, testID }: ToastItemProps): React.ReactElement => {\n const opacityRef = useRef(new Animated.Value(0));\n const translateYRef = useRef(new Animated.Value(TOAST_INITIAL_TRANSLATE_Y));\n const opacity = opacityRef.current;\n const translateY = translateYRef.current;\n\n const backgroundColor = useMemo((): string => {\n if (message.type === 'success') return colors.success;\n if (message.type === 'error') return colors.error;\n return colors.primary;\n }, [colors.error, colors.primary, colors.success, message.type]);\n\n const handleDone = useCallback((): void => {\n onDone(message.id);\n }, [message.id, onDone]);\n\n useEffect(() => {\n const useNative = Platform.OS !== 'web';\n Animated.parallel([\n Animated.timing(opacity, { toValue: 1, duration: fadeMs, useNativeDriver: useNative }),\n Animated.timing(translateY, { toValue: 0, duration: fadeMs, useNativeDriver: useNative }),\n ]).start();\n\n const hideTimer = setTimeout(() => {\n Animated.parallel([\n Animated.timing(opacity, { toValue: 0, duration: fadeMs, useNativeDriver: useNative }),\n Animated.timing(translateY, { toValue: TOAST_INITIAL_TRANSLATE_Y, duration: fadeMs, useNativeDriver: useNative }),\n ]).start(handleDone);\n }, durationMs);\n\n return () => clearTimeout(hideTimer);\n }, [handleDone, opacity, translateY, durationMs, fadeMs]);\n\n // An error toast is a `role=\"alert\"` (assertive insert); success/info are `status` — both\n // sit inside the host's live region so a screen reader announces the message. On native the\n // per-item live region escalates errors to `assertive`.\n const isError = message.type === 'error';\n\n return (\n <Animated.View\n accessibilityLiveRegion={isError ? 'assertive' : 'polite'}\n role={isError ? 'alert' : 'status'}\n style={[styles.toast, { backgroundColor, transform: [{ translateY }], opacity }]}\n testID={testID}\n >\n <Text style={[styles.text, { color: colors.text }]}>{message.text}</Text>\n </Animated.View>\n );\n};\n\nexport interface ToastHostProps {\n /**\n * Register a push callback; return an unsubscribe. The app adapts its own\n * event bus (e.g. `@dloizides/bff-web-client`'s toast emitter) to this port.\n */\n subscribe: (push: (toast: ToastInput) => void) => () => void;\n /** How long each toast stays before fading (ms). Default 3000. */\n durationMs?: number;\n /** Fade in/out animation duration (ms). Default 200. */\n fadeMs?: number;\n /** Max message length before truncation. Default 500. */\n maxLength?: number;\n /** testID for each toast (defaults to `notification-toast`). */\n toastTestID?: string;\n}\n\nlet toastSeq = 0;\nfunction nextId(): string {\n toastSeq += 1;\n return `${String(Date.now())}-${String(toastSeq)}`;\n}\n\nexport const ToastHost = ({\n subscribe,\n durationMs = DEFAULT_DURATION_MS,\n fadeMs = DEFAULT_FADE_MS,\n maxLength = DEFAULT_MAX_LENGTH,\n toastTestID = FEEDBACK_TEST_IDS.notificationToast,\n}: ToastHostProps): React.ReactElement | null => {\n const [messages, setMessages] = useState<ToastMessage[]>([]);\n const { theme } = useFeedbackUi();\n\n const colors = useMemo<ToastColors>(\n () => ({\n primary: theme.palette.primary['500'],\n success: (theme.semantic.success ?? theme.semantic.error)['500'],\n error: theme.semantic.error['500'],\n text: theme.colors.surfaceElevated,\n }),\n [theme],\n );\n\n const push = useCallback(\n (toast: ToastInput): void => {\n setMessages((s) => [...s, { id: nextId(), type: toast.type, text: sanitizeToastText(toast.text, maxLength) }]);\n },\n [maxLength],\n );\n\n const remove = useCallback((id: string): void => {\n setMessages((s) => s.filter((x) => x.id !== id));\n }, []);\n\n useEffect(() => subscribe(push), [subscribe, push]);\n\n if (messages.length === 0) return null;\n\n return (\n <View style={styles.container}>\n {messages.map((m) => (\n <ToastItem\n key={m.id}\n colors={colors}\n durationMs={durationMs}\n fadeMs={fadeMs}\n message={m}\n testID={toastTestID}\n onDone={remove}\n />\n ))}\n </View>\n );\n};\n\nexport default ToastHost;\n","/**\n * warmingStore — a tiny, framework-agnostic (no React) store for the cold-start\n * \"warming up…\" UX (Move 3a).\n *\n * On a resource-tight, scale-to-zero prod node the BFF/upstream can be cold on the\n * FIRST request after idle. `@dloizides/bff-web-client`'s `warmupRetryInterceptor`\n * transparently retries the 502/503/504 and fires `onWarmupRetry({ attempt, … })`\n * per retry — but it has NO \"recovered\" signal (it only fires on retries, never on\n * the eventual success). So an app wires its `onWarmupRetry` to `notifyWarming(...)`\n * here, and this store AUTO-SETTLES `isWarming` back to false after a quiet period\n * with no new notify (i.e. the request finally succeeded and retries stopped).\n *\n * Shaped for React's `useSyncExternalStore`: `subscribeWarming` + `getWarmingSnapshot`\n * (the snapshot object identity only changes when the value changes, so no render loop).\n * SSR/no-DOM safe (timer is guarded, no `window`) and deterministic (no `Date.now()` /\n * `Math.random()`).\n */\n\n/**\n * How long (ms) the store stays \"warming\" after the LAST `notifyWarming` before it\n * auto-clears. Sized a touch above the interceptor's largest backoff so a genuine\n * retry storm keeps the overlay up, but a recovered request lets it settle.\n */\nexport const WARMING_QUIET_PERIOD_MS = 2500;\n\n/** What an app forwards from the interceptor's `onWarmupRetry` callback. */\nexport interface WarmingInfo {\n attempt: number;\n maxRetries?: number;\n status?: number;\n}\n\n/** Immutable snapshot read by `useSyncExternalStore`. */\nexport interface WarmingSnapshot {\n isWarming: boolean;\n attempt: number;\n}\n\ntype WarmingListener = () => void;\n\nconst IDLE_ATTEMPT = 0;\n\nlet warming = false;\nlet currentAttempt = IDLE_ATTEMPT;\nlet snapshot: WarmingSnapshot = { isWarming: false, attempt: IDLE_ATTEMPT };\n\nconst listeners = new Set<WarmingListener>();\nlet quietTimer: ReturnType<typeof setTimeout> | undefined;\n\nfunction refreshSnapshot(): void {\n snapshot = { isWarming: warming, attempt: currentAttempt };\n}\n\nfunction emit(): void {\n for (const listener of listeners) listener();\n}\n\nfunction clearQuietTimer(): void {\n if (quietTimer !== undefined) {\n clearTimeout(quietTimer);\n quietTimer = undefined;\n }\n}\n\nfunction scheduleSettle(): void {\n clearQuietTimer();\n // SSR / no-DOM guard: environments without a real timer just stay warming until\n // an explicit settleWarming() (or never render the overlay at all).\n if (typeof setTimeout !== 'function') return;\n quietTimer = setTimeout(() => {\n quietTimer = undefined;\n settleWarming();\n }, WARMING_QUIET_PERIOD_MS);\n}\n\n/**\n * Mark the store \"warming\" and record the latest retry attempt. Resets the\n * auto-settle timer, so as long as retries keep arriving the overlay stays up.\n * Call this from an app's `onWarmupRetry`.\n */\nexport function notifyWarming(info: WarmingInfo): void {\n const changed = !warming || currentAttempt !== info.attempt;\n warming = true;\n currentAttempt = info.attempt;\n scheduleSettle();\n if (changed) {\n refreshSnapshot();\n emit();\n }\n}\n\n/**\n * Force-clear the warming state (for tests, or to wire an explicit success signal\n * later). Also cancels any pending auto-settle timer. No-op when already idle.\n */\nexport function settleWarming(): void {\n clearQuietTimer();\n if (!warming) return;\n warming = false;\n currentAttempt = IDLE_ATTEMPT;\n refreshSnapshot();\n emit();\n}\n\n/** Register a listener; returns an unsubscribe. Shaped for `useSyncExternalStore`. */\nexport function subscribeWarming(listener: WarmingListener): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\n/** Current immutable snapshot. Stable identity until the value changes. */\nexport function getWarmingSnapshot(): WarmingSnapshot {\n return snapshot;\n}\n","/**\n * WarmingOverlay — a calm, branded, full-screen \"warming up…\" overlay for the\n * cold-start UX (Move 3a). It subscribes to the framework-agnostic warmingStore\n * via `useSyncExternalStore` and renders ONLY while `isWarming`, then disappears\n * on auto-settle (so it never permanently traps focus).\n *\n * This is intentionally NOT an error state: a title + subtitle + spinner, with an\n * optional attempt hint. Colours come from the UiProvider theme (`useFeedbackUi`)\n * or an explicit `theme` override — nothing hardcoded. Copy comes from `labels`,\n * a typed bag with English defaults merged with a partial override, so consuming\n * apps can localize but nothing breaks without it.\n */\nimport React, { useSyncExternalStore } from 'react';\n\nimport { ActivityIndicator, StyleSheet, Text, View } from 'react-native';\n\nimport { useFeedbackUi, type FeedbackTheme } from '../context/FeedbackUiContext';\nimport { FEEDBACK_TEST_IDS } from '../constants';\nimport { getWarmingSnapshot, subscribeWarming } from './warmingStore';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nconst OVERLAY_Z_INDEX = 100000;\nconst CARD_GAP = 12;\nconst TITLE_FONT_SIZE = 20;\nconst SUBTITLE_FONT_SIZE = 15;\nconst ATTEMPT_FONT_SIZE = 13;\nconst CARD_PADDING = 24;\nconst NO_ATTEMPT = 0;\n\n// ---------------------------------------------------------------------------\n// Styles\n// ---------------------------------------------------------------------------\n\nconst styles = StyleSheet.create({\n overlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: OVERLAY_Z_INDEX,\n elevation: OVERLAY_Z_INDEX,\n padding: CARD_PADDING,\n },\n card: {\n alignItems: 'center',\n gap: CARD_GAP,\n maxWidth: 320,\n },\n title: {\n fontSize: TITLE_FONT_SIZE,\n fontWeight: '700',\n textAlign: 'center',\n },\n subtitle: {\n fontSize: SUBTITLE_FONT_SIZE,\n textAlign: 'center',\n },\n attempt: {\n fontSize: ATTEMPT_FONT_SIZE,\n textAlign: 'center',\n },\n});\n\n// ---------------------------------------------------------------------------\n// Labels\n// ---------------------------------------------------------------------------\n\n/** Copy for the overlay. All fields have English defaults; apps override any subset. */\nexport interface WarmingOverlayLabels {\n /** Big line, e.g. \"Warming up…\". */\n title: string;\n /** Reassuring second line, e.g. \"This only takes a moment\". */\n subtitle: string;\n /** Screen-reader label for the whole overlay. */\n accessibilityLabel: string;\n /** Optional per-attempt hint, given the current attempt number. */\n attemptHint: (attempt: number) => string;\n}\n\nconst DEFAULT_WARMING_LABELS: WarmingOverlayLabels = {\n title: 'Warming up…',\n subtitle: 'This only takes a moment',\n accessibilityLabel: 'Warming up, please wait',\n attemptHint: (attempt) => `Attempt ${String(attempt)}`,\n};\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport interface WarmingOverlayProps {\n /** Partial copy override; unset fields fall back to English defaults. */\n labels?: Partial<WarmingOverlayLabels>;\n /** Theme override; defaults to the mounted UiProvider theme. */\n theme?: FeedbackTheme;\n /** testID for the overlay container (children derive `${prefix}-title`, etc.). */\n testIdPrefix?: string;\n /** Show the \"Attempt N\" hint under the subtitle (default: false). */\n showAttempt?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport const WarmingOverlay = ({\n labels,\n theme: themeOverride,\n testIdPrefix = FEEDBACK_TEST_IDS.warmingOverlay,\n showAttempt = false,\n}: WarmingOverlayProps): React.ReactElement | null => {\n const ctx = useFeedbackUi();\n const snapshot = useSyncExternalStore(subscribeWarming, getWarmingSnapshot, getWarmingSnapshot);\n\n const theme = themeOverride ?? ctx.theme;\n const mergedLabels = { ...DEFAULT_WARMING_LABELS, ...labels };\n\n if (!snapshot.isWarming) return null;\n\n const colors = theme.colors;\n const primary = theme.palette.primary['500'];\n const showHint = showAttempt && snapshot.attempt > NO_ATTEMPT;\n\n return (\n <View\n accessibilityLabel={mergedLabels.accessibilityLabel}\n accessibilityRole=\"alert\"\n style={[styles.overlay, { backgroundColor: colors.background }]}\n testID={testIdPrefix}\n >\n <View style={styles.card}>\n <ActivityIndicator color={primary} size=\"large\" />\n <Text style={[styles.title, { color: colors.text }]} testID={`${testIdPrefix}-title`}>\n {mergedLabels.title}\n </Text>\n <Text style={[styles.subtitle, { color: colors.textSecondary }]} testID={`${testIdPrefix}-subtitle`}>\n {mergedLabels.subtitle}\n </Text>\n {showHint ? (\n <Text style={[styles.attempt, { color: colors.textSecondary }]} testID={`${testIdPrefix}-attempt`}>\n {mergedLabels.attemptHint(snapshot.attempt)}\n </Text>\n ) : null}\n </View>\n </View>\n );\n};\n\nexport default WarmingOverlay;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dloizides/ui-feedback",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Themable, brand-agnostic React Native (RN-web) feedback components — ErrorState, EmptyListState, LoadingFallback, PageSkeleton, ConfirmDialog — wired through a small injectable theme/translate provider. Part of the dloizides.com shared UI kit.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|