@dloizides/ui-feedback 1.5.0 → 1.6.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 +39 -0
- package/README.md +73 -1
- package/dist/index.d.mts +145 -2
- package/dist/index.d.ts +145 -2
- package/dist/index.js +239 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +238 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React3, { createContext, useMemo, useContext, useCallback, useState, useEffect, useSyncExternalStore, useRef } from 'react';
|
|
1
|
+
import React3, { createContext, useMemo, useContext, useCallback, useState, useEffect, useSyncExternalStore, Component, 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
|
|
|
@@ -54,7 +54,8 @@ var FEEDBACK_TEST_IDS = {
|
|
|
54
54
|
confirmButton: "confirm-button",
|
|
55
55
|
cancelConfirmButton: "cancel-confirm-button",
|
|
56
56
|
notificationToast: "notification-toast",
|
|
57
|
-
warmingOverlay: "warming-overlay"
|
|
57
|
+
warmingOverlay: "warming-overlay",
|
|
58
|
+
errorBoundary: "error-boundary"
|
|
58
59
|
};
|
|
59
60
|
var MESSAGE_FONT_SIZE = 16;
|
|
60
61
|
var CONTAINER_PADDING = 20;
|
|
@@ -727,6 +728,240 @@ var WarmingOverlay = ({
|
|
|
727
728
|
);
|
|
728
729
|
};
|
|
729
730
|
|
|
730
|
-
|
|
731
|
+
// src/toastBus/createToastBus.ts
|
|
732
|
+
var DEFAULT_TOAST_TYPE = "info";
|
|
733
|
+
function createToastBus() {
|
|
734
|
+
const listeners2 = /* @__PURE__ */ new Set();
|
|
735
|
+
const emit2 = (text, type = DEFAULT_TOAST_TYPE) => {
|
|
736
|
+
for (const push of [...listeners2]) push({ text, type });
|
|
737
|
+
};
|
|
738
|
+
return {
|
|
739
|
+
subscribe(push) {
|
|
740
|
+
listeners2.add(push);
|
|
741
|
+
return () => {
|
|
742
|
+
listeners2.delete(push);
|
|
743
|
+
};
|
|
744
|
+
},
|
|
745
|
+
emit: emit2,
|
|
746
|
+
success(text) {
|
|
747
|
+
emit2(text, "success");
|
|
748
|
+
},
|
|
749
|
+
error(text) {
|
|
750
|
+
emit2(text, "error");
|
|
751
|
+
},
|
|
752
|
+
info(text) {
|
|
753
|
+
emit2(text, "info");
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
var CONTAINER_PADDING3 = 20;
|
|
758
|
+
var CONTENT_MAX_WIDTH = 400;
|
|
759
|
+
var TITLE_FONT_SIZE2 = 24;
|
|
760
|
+
var TITLE_MARGIN_BOTTOM = 12;
|
|
761
|
+
var DETAILS_PADDING = 12;
|
|
762
|
+
var DETAILS_BORDER_RADIUS = 8;
|
|
763
|
+
var DETAILS_BORDER_WIDTH = 1;
|
|
764
|
+
var DETAILS_MARGIN_VERTICAL = 16;
|
|
765
|
+
var DETAILS_TITLE_FONT_SIZE = 14;
|
|
766
|
+
var DETAILS_TITLE_MARGIN_BOTTOM = 4;
|
|
767
|
+
var DETAILS_TEXT_FONT_SIZE = 12;
|
|
768
|
+
var BUTTON_PADDING_H2 = 24;
|
|
769
|
+
var BUTTON_PADDING_V2 = 12;
|
|
770
|
+
var BUTTON_BORDER_RADIUS2 = 8;
|
|
771
|
+
var BUTTON_MARGIN_TOP2 = 12;
|
|
772
|
+
var BUTTON_FONT_SIZE2 = 16;
|
|
773
|
+
var styles8 = StyleSheet.create({
|
|
774
|
+
container: {
|
|
775
|
+
flex: 1,
|
|
776
|
+
justifyContent: "center",
|
|
777
|
+
alignItems: "center",
|
|
778
|
+
padding: CONTAINER_PADDING3
|
|
779
|
+
},
|
|
780
|
+
content: {
|
|
781
|
+
maxWidth: CONTENT_MAX_WIDTH,
|
|
782
|
+
alignItems: "center"
|
|
783
|
+
},
|
|
784
|
+
title: {
|
|
785
|
+
fontSize: TITLE_FONT_SIZE2,
|
|
786
|
+
fontWeight: "bold",
|
|
787
|
+
marginBottom: TITLE_MARGIN_BOTTOM,
|
|
788
|
+
textAlign: "center"
|
|
789
|
+
},
|
|
790
|
+
details: {
|
|
791
|
+
padding: DETAILS_PADDING,
|
|
792
|
+
borderRadius: DETAILS_BORDER_RADIUS,
|
|
793
|
+
borderWidth: DETAILS_BORDER_WIDTH,
|
|
794
|
+
marginVertical: DETAILS_MARGIN_VERTICAL,
|
|
795
|
+
width: "100%"
|
|
796
|
+
},
|
|
797
|
+
detailsTitle: {
|
|
798
|
+
fontSize: DETAILS_TITLE_FONT_SIZE,
|
|
799
|
+
fontWeight: "bold",
|
|
800
|
+
marginBottom: DETAILS_TITLE_MARGIN_BOTTOM
|
|
801
|
+
},
|
|
802
|
+
detailsText: {
|
|
803
|
+
fontSize: DETAILS_TEXT_FONT_SIZE,
|
|
804
|
+
fontFamily: "monospace"
|
|
805
|
+
},
|
|
806
|
+
button: {
|
|
807
|
+
paddingHorizontal: BUTTON_PADDING_H2,
|
|
808
|
+
paddingVertical: BUTTON_PADDING_V2,
|
|
809
|
+
borderRadius: BUTTON_BORDER_RADIUS2,
|
|
810
|
+
marginTop: BUTTON_MARGIN_TOP2
|
|
811
|
+
},
|
|
812
|
+
buttonText: {
|
|
813
|
+
fontSize: BUTTON_FONT_SIZE2,
|
|
814
|
+
fontWeight: "600"
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
var ErrorBoundaryFallback = ({
|
|
818
|
+
labels,
|
|
819
|
+
testIDPrefix,
|
|
820
|
+
error,
|
|
821
|
+
showDetails,
|
|
822
|
+
onRetry,
|
|
823
|
+
onReload
|
|
824
|
+
}) => {
|
|
825
|
+
const { theme } = useFeedbackUi();
|
|
826
|
+
const warningColor = (theme.semantic.warning ?? theme.semantic.error)["500"];
|
|
827
|
+
const primaryColor = theme.palette.primary["500"];
|
|
828
|
+
const hasDetails = showDetails && error !== null;
|
|
829
|
+
return /* @__PURE__ */ jsx(
|
|
830
|
+
View,
|
|
831
|
+
{
|
|
832
|
+
accessibilityLiveRegion: "assertive",
|
|
833
|
+
role: "alert",
|
|
834
|
+
style: [styles8.container, { backgroundColor: theme.colors.background }],
|
|
835
|
+
testID: testIDPrefix,
|
|
836
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles8.content, children: [
|
|
837
|
+
/* @__PURE__ */ jsx(Text, { style: [styles8.title, { color: theme.colors.text }], children: labels.title }),
|
|
838
|
+
/* @__PURE__ */ jsx(ErrorState, { message: labels.message, testID: `${testIDPrefix}-message` }),
|
|
839
|
+
hasDetails ? /* @__PURE__ */ jsxs(
|
|
840
|
+
View,
|
|
841
|
+
{
|
|
842
|
+
style: [styles8.details, { backgroundColor: theme.colors.surface, borderColor: warningColor }],
|
|
843
|
+
testID: `${testIDPrefix}-details`,
|
|
844
|
+
children: [
|
|
845
|
+
/* @__PURE__ */ jsx(Text, { style: [styles8.detailsTitle, { color: warningColor }], children: labels.errorDetails }),
|
|
846
|
+
/* @__PURE__ */ jsx(Text, { style: [styles8.detailsText, { color: theme.colors.textSecondary }], children: error.message })
|
|
847
|
+
]
|
|
848
|
+
}
|
|
849
|
+
) : null,
|
|
850
|
+
/* @__PURE__ */ jsx(
|
|
851
|
+
TouchableOpacity,
|
|
852
|
+
{
|
|
853
|
+
accessibilityHint: labels.tryAgainHint,
|
|
854
|
+
accessibilityLabel: labels.tryAgain,
|
|
855
|
+
accessibilityRole: "button",
|
|
856
|
+
style: [styles8.button, { backgroundColor: primaryColor }],
|
|
857
|
+
testID: `${testIDPrefix}-retry-button`,
|
|
858
|
+
onPress: onRetry,
|
|
859
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles8.buttonText, { color: theme.colors.surfaceElevated }], children: labels.tryAgain })
|
|
860
|
+
}
|
|
861
|
+
),
|
|
862
|
+
typeof onReload === "function" ? /* @__PURE__ */ jsx(
|
|
863
|
+
TouchableOpacity,
|
|
864
|
+
{
|
|
865
|
+
accessibilityHint: labels.reloadHint,
|
|
866
|
+
accessibilityLabel: labels.reload,
|
|
867
|
+
accessibilityRole: "button",
|
|
868
|
+
style: [styles8.button, { backgroundColor: theme.colors.surface }],
|
|
869
|
+
testID: `${testIDPrefix}-reload-button`,
|
|
870
|
+
onPress: onReload,
|
|
871
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles8.buttonText, { color: theme.colors.text }], children: labels.reload })
|
|
872
|
+
}
|
|
873
|
+
) : null
|
|
874
|
+
] })
|
|
875
|
+
}
|
|
876
|
+
);
|
|
877
|
+
};
|
|
878
|
+
var CONTAINER_PADDING4 = 20;
|
|
879
|
+
var MESSAGE_FONT_SIZE3 = 16;
|
|
880
|
+
var MESSAGE_MARGIN_TOP = 12;
|
|
881
|
+
var styles9 = StyleSheet.create({
|
|
882
|
+
container: {
|
|
883
|
+
flex: 1,
|
|
884
|
+
justifyContent: "center",
|
|
885
|
+
alignItems: "center",
|
|
886
|
+
padding: CONTAINER_PADDING4
|
|
887
|
+
},
|
|
888
|
+
message: {
|
|
889
|
+
fontSize: MESSAGE_FONT_SIZE3,
|
|
890
|
+
marginTop: MESSAGE_MARGIN_TOP,
|
|
891
|
+
textAlign: "center"
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
var ErrorBoundaryRecovering = ({
|
|
895
|
+
message,
|
|
896
|
+
testID
|
|
897
|
+
}) => {
|
|
898
|
+
const { theme } = useFeedbackUi();
|
|
899
|
+
return /* @__PURE__ */ jsxs(
|
|
900
|
+
View,
|
|
901
|
+
{
|
|
902
|
+
accessibilityLiveRegion: "polite",
|
|
903
|
+
role: "status",
|
|
904
|
+
style: [styles9.container, { backgroundColor: theme.colors.background }],
|
|
905
|
+
testID,
|
|
906
|
+
children: [
|
|
907
|
+
/* @__PURE__ */ jsx(ActivityIndicator, { color: theme.palette.primary["500"], size: "large" }),
|
|
908
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.message, { color: theme.colors.textSecondary }], children: message })
|
|
909
|
+
]
|
|
910
|
+
}
|
|
911
|
+
);
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
// src/AppErrorBoundary/labels.ts
|
|
915
|
+
var DEFAULT_ERROR_BOUNDARY_LABELS = {
|
|
916
|
+
title: "Something went wrong",
|
|
917
|
+
message: "An unexpected error occurred. Please try again.",
|
|
918
|
+
tryAgain: "Try again",
|
|
919
|
+
tryAgainHint: "Retries rendering this screen",
|
|
920
|
+
reload: "Reload",
|
|
921
|
+
reloadHint: "Reloads the application",
|
|
922
|
+
updating: "Updating\u2026",
|
|
923
|
+
errorDetails: "Error details"
|
|
924
|
+
};
|
|
925
|
+
var INITIAL_STATE = { hasError: false, error: null, recovering: false };
|
|
926
|
+
var AppErrorBoundary = class extends Component {
|
|
927
|
+
constructor(props) {
|
|
928
|
+
super(props);
|
|
929
|
+
this.handleRetry = () => {
|
|
930
|
+
this.setState(INITIAL_STATE);
|
|
931
|
+
};
|
|
932
|
+
this.state = INITIAL_STATE;
|
|
933
|
+
}
|
|
934
|
+
static getDerivedStateFromError(error) {
|
|
935
|
+
return { hasError: true, error };
|
|
936
|
+
}
|
|
937
|
+
componentDidCatch(error, info) {
|
|
938
|
+
if (typeof this.props.onError === "function") this.props.onError(error, info);
|
|
939
|
+
const isHandled = typeof this.props.recover === "function" && this.props.recover(error);
|
|
940
|
+
if (isHandled) this.setState({ recovering: true });
|
|
941
|
+
}
|
|
942
|
+
render() {
|
|
943
|
+
const { children, fallback, labels, showDetails = false, onReload } = this.props;
|
|
944
|
+
const { hasError, error, recovering } = this.state;
|
|
945
|
+
const testIDPrefix = this.props.testIDPrefix ?? FEEDBACK_TEST_IDS.errorBoundary;
|
|
946
|
+
const resolvedLabels = { ...DEFAULT_ERROR_BOUNDARY_LABELS, ...labels };
|
|
947
|
+
if (!hasError) return children;
|
|
948
|
+
if (typeof fallback === "function") return fallback({ error, recovering, retry: this.handleRetry });
|
|
949
|
+
if (recovering)
|
|
950
|
+
return /* @__PURE__ */ jsx(ErrorBoundaryRecovering, { message: resolvedLabels.updating, testID: `${testIDPrefix}-updating` });
|
|
951
|
+
return /* @__PURE__ */ jsx(
|
|
952
|
+
ErrorBoundaryFallback,
|
|
953
|
+
{
|
|
954
|
+
error,
|
|
955
|
+
labels: resolvedLabels,
|
|
956
|
+
showDetails,
|
|
957
|
+
testIDPrefix,
|
|
958
|
+
onReload,
|
|
959
|
+
onRetry: this.handleRetry
|
|
960
|
+
}
|
|
961
|
+
);
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
export { AppErrorBoundary, ConfirmDialog, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, ErrorState, FEEDBACK_TEST_IDS, FeedbackUiProvider, LoadingFallback, MODAL_OVERLAY_COLOR, PageSkeleton, ToastHost, FeedbackUiProvider as UiProvider, WARMING_QUIET_PERIOD_MS, WarmingOverlay, createToastBus, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|
|
731
966
|
//# sourceMappingURL=index.mjs.map
|
|
732
967
|
//# 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","../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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;AAAA,IAACM,IAAAA;AAAA,IAAA;AAAA,MACC,oBAAoB,YAAA,CAAa,kBAAA;AAAA,MACjC,iBAAA,EAAkB,OAAA;AAAA,MAClB,KAAA,EAAO,CAACH,OAAAA,CAAO,OAAA,EAAS,EAAE,eAAA,EAAiB,MAAA,CAAO,YAAY,CAAA;AAAA,MAC9D,MAAA,EAAQ,YAAA;AAAA,MAER,0BAAAE,IAAAA,CAACC,IAAAA,EAAA,EAAK,KAAA,EAAOH,QAAO,IAAA,EAClB,QAAA,EAAA;AAAA,wBAAAH,IAACW,iBAAAA,EAAA,EAAkB,KAAA,EAAO,OAAA,EAAS,MAAK,OAAA,EAAQ,CAAA;AAAA,wBAChDX,GAAAA,CAACO,IAAAA,EAAA,EAAK,KAAA,EAAO,CAACJ,QAAO,KAAA,EAAO,EAAE,OAAO,MAAA,CAAO,IAAA,EAAM,CAAA,EAAG,MAAA,EAAQ,GAAG,YAAY,CAAA,MAAA,CAAA,EACzE,uBAAa,KAAA,EAChB,CAAA;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"]}
|
|
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","../src/toastBus/createToastBus.ts","../src/AppErrorBoundary/ErrorBoundaryFallback.tsx","../src/AppErrorBoundary/ErrorBoundaryRecovering.tsx","../src/AppErrorBoundary/labels.ts","../src/AppErrorBoundary/AppErrorBoundary.tsx"],"names":["jsx","MESSAGE_FONT_SIZE","CONTAINER_PADDING","styles","StyleSheet","jsxs","View","Text","TouchableOpacity","React","useMemo","ActivityIndicator","Platform","Animated","useCallback","snapshot","listeners","emit","TITLE_FONT_SIZE","BUTTON_PADDING_H","BUTTON_PADDING_V","BUTTON_BORDER_RADIUS","BUTTON_MARGIN_TOP","BUTTON_FONT_SIZE"],"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,MA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,MAAM,CAAA;AAAA,EACnD;AAAA,EAMO,MAAA,GAAoB;AACzB,IAAA,MAAM,EAAE,UAAU,QAAA,EAAU,MAAA,EAAQ,cAAc,KAAA,EAAO,QAAA,KAAa,IAAA,CAAK,KAAA;AAC3E,IAAA,MAAM,EAAE,QAAA,EAAU,KAAA,EAAO,UAAA,KAAe,IAAA,CAAK,KAAA;AAC7C,IAAA,MAAM,YAAA,GAAe,IAAA,CAAK,KAAA,CAAM,YAAA,IAAgB,iBAAA,CAAkB,aAAA;AAClE,IAAA,MAAM,cAAA,GAAsC,EAAE,GAAG,6BAAA,EAA+B,GAAG,MAAA,EAAO;AAE1F,IAAA,IAAI,CAAC,UAAU,OAAO,QAAA;AAEtB,IAAA,IAAI,OAAO,QAAA,KAAa,UAAA,EAAY,OAAO,QAAA,CAAS,EAAE,KAAA,EAAO,UAAA,EAAY,KAAA,EAAO,IAAA,CAAK,WAAA,EAAa,CAAA;AAElG,IAAA,IAAI,UAAA;AACF,MAAA,uBACEH,IAAC,uBAAA,EAAA,EAAwB,OAAA,EAAS,eAAe,QAAA,EAAU,MAAA,EAAQ,CAAA,EAAG,YAAY,CAAA,SAAA,CAAA,EAAa,CAAA;AAGnG,IAAA,uBACEA,GAAAA;AAAA,MAAC,qBAAA;AAAA,MAAA;AAAA,QACC,KAAA;AAAA,QACA,MAAA,EAAQ,cAAA;AAAA,QACR,WAAA;AAAA,QACA,YAAA;AAAA,QACA,QAAA;AAAA,QACA,SAAS,IAAA,CAAK;AAAA;AAAA,KAChB;AAAA,EAEJ;AACF","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 errorBoundary: 'error-boundary',\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","/**\n * createToastBus — the shared EMIT half of the toast pipeline, promoted from the\n * hand-rolled twins in aml-v2 (`components/toast.ts`), agora-web and zygos-web\n * (`lib/toastBus.ts`). The RENDERING half is `<ToastHost>`; a bus instance's\n * {@link ToastBus.subscribe} IS the `ToastHost` `subscribe` port.\n *\n * Deliberately FRAMEWORK-AGNOSTIC — no React import, no hook, no provider. Call\n * sites are React Query mutation `onSuccess`/`onError` callbacks that have no\n * component context in scope, so a hook-based API would break every one of them.\n *\n * It carries no styling: `<ToastHost>` themes every toast from `UiProvider`.\n * Text arriving here is ALREADY localized by the caller (`FM()`); this bus never\n * sees a translation key.\n *\n * Usage — one module-level instance per app:\n * ```ts\n * // src/lib/toastBus.ts\n * import { createToastBus } from '@dloizides/ui-feedback';\n * export const toastBus = createToastBus();\n *\n * // anywhere, no provider needed:\n * toastBus.success(FM('menu.saved'));\n *\n * // once, in the shell:\n * <ToastHost subscribe={toastBus.subscribe} />\n * ```\n */\nimport type { ToastInput, ToastType } from '../ToastHost/ToastHost';\n\n/** A registered push callback — what `<ToastHost>` hands to {@link ToastBus.subscribe}. */\nexport type ToastPush = (toast: ToastInput) => void;\n\nexport interface ToastBus {\n /** Register a push callback; returns an unsubscribe. The `<ToastHost>` `subscribe` port. */\n subscribe(push: ToastPush): () => void;\n /** Emit a toast of an explicit type. Defaults to `info`. */\n emit(text: string, type?: ToastType): void;\n /** Emit a success toast. */\n success(text: string): void;\n /** Emit an error toast. */\n error(text: string): void;\n /** Emit an informational toast. */\n info(text: string): void;\n}\n\nconst DEFAULT_TOAST_TYPE: ToastType = 'info';\n\n/**\n * Create an independent toast bus. Emitting with no subscriber is a silent no-op\n * (the host simply isn't mounted yet), and every subscriber receives every emit.\n */\nexport function createToastBus(): ToastBus {\n const listeners = new Set<ToastPush>();\n\n const emit = (text: string, type: ToastType = DEFAULT_TOAST_TYPE): void => {\n // Iterate a snapshot so a listener that unsubscribes (or subscribes) while\n // handling a toast cannot mutate the set mid-iteration.\n for (const push of [...listeners]) push({ text, type });\n };\n\n return {\n subscribe(push: ToastPush): () => void {\n listeners.add(push);\n return (): void => {\n listeners.delete(push);\n };\n },\n emit,\n success(text: string): void {\n emit(text, 'success');\n },\n error(text: string): void {\n emit(text, 'error');\n },\n info(text: string): void {\n emit(text, 'info');\n },\n };\n}\n\nexport default createToastBus;\n","/**\n * ErrorBoundaryFallback — the presentational half of `<AppErrorBoundary>`.\n *\n * Split out of the class component so it can read the `UiProvider` theme through\n * `useFeedbackUi()` (a class cannot use hooks). The message itself renders through\n * the shared `<ErrorState>`, which is what replaces the 40+ hardcoded Bootstrap-4\n * hex literals the six app-local boundaries each carried.\n *\n * Announces itself: `role=\"alert\"` + `accessibilityLiveRegion=\"assertive\"` so a\n * screen reader reads the failure instead of the screen going silently blank.\n */\nimport React from 'react';\n\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\nimport { ErrorState } from '../ErrorState/ErrorState';\nimport type { ErrorBoundaryLabels } from './labels';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nconst CONTAINER_PADDING = 20;\nconst CONTENT_MAX_WIDTH = 400;\nconst TITLE_FONT_SIZE = 24;\nconst TITLE_MARGIN_BOTTOM = 12;\nconst DETAILS_PADDING = 12;\nconst DETAILS_BORDER_RADIUS = 8;\nconst DETAILS_BORDER_WIDTH = 1;\nconst DETAILS_MARGIN_VERTICAL = 16;\nconst DETAILS_TITLE_FONT_SIZE = 14;\nconst DETAILS_TITLE_MARGIN_BOTTOM = 4;\nconst DETAILS_TEXT_FONT_SIZE = 12;\nconst BUTTON_PADDING_H = 24;\nconst BUTTON_PADDING_V = 12;\nconst BUTTON_BORDER_RADIUS = 8;\nconst BUTTON_MARGIN_TOP = 12;\nconst BUTTON_FONT_SIZE = 16;\n\n// ---------------------------------------------------------------------------\n// Styles (layout only — every colour comes from the theme at render time)\n// ---------------------------------------------------------------------------\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n padding: CONTAINER_PADDING,\n },\n content: {\n maxWidth: CONTENT_MAX_WIDTH,\n alignItems: 'center',\n },\n title: {\n fontSize: TITLE_FONT_SIZE,\n fontWeight: 'bold',\n marginBottom: TITLE_MARGIN_BOTTOM,\n textAlign: 'center',\n },\n details: {\n padding: DETAILS_PADDING,\n borderRadius: DETAILS_BORDER_RADIUS,\n borderWidth: DETAILS_BORDER_WIDTH,\n marginVertical: DETAILS_MARGIN_VERTICAL,\n width: '100%',\n },\n detailsTitle: {\n fontSize: DETAILS_TITLE_FONT_SIZE,\n fontWeight: 'bold',\n marginBottom: DETAILS_TITLE_MARGIN_BOTTOM,\n },\n detailsText: {\n fontSize: DETAILS_TEXT_FONT_SIZE,\n fontFamily: 'monospace',\n },\n button: {\n paddingHorizontal: BUTTON_PADDING_H,\n paddingVertical: BUTTON_PADDING_V,\n borderRadius: BUTTON_BORDER_RADIUS,\n marginTop: BUTTON_MARGIN_TOP,\n },\n buttonText: {\n fontSize: BUTTON_FONT_SIZE,\n fontWeight: '600',\n },\n});\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport interface ErrorBoundaryFallbackProps {\n labels: ErrorBoundaryLabels;\n testIDPrefix: string;\n error: Error | null;\n showDetails: boolean;\n onRetry: () => void;\n onReload?: () => void;\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport const ErrorBoundaryFallback = ({\n labels,\n testIDPrefix,\n error,\n showDetails,\n onRetry,\n onReload,\n}: ErrorBoundaryFallbackProps): React.ReactElement => {\n const { theme } = useFeedbackUi();\n const warningColor = (theme.semantic.warning ?? theme.semantic.error)['500'];\n const primaryColor = theme.palette.primary['500'];\n const hasDetails = showDetails && error !== null;\n\n return (\n <View\n accessibilityLiveRegion=\"assertive\"\n role=\"alert\"\n style={[styles.container, { backgroundColor: theme.colors.background }]}\n testID={testIDPrefix}\n >\n <View style={styles.content}>\n <Text style={[styles.title, { color: theme.colors.text }]}>{labels.title}</Text>\n\n <ErrorState message={labels.message} testID={`${testIDPrefix}-message`} />\n\n {hasDetails ? (\n <View\n style={[styles.details, { backgroundColor: theme.colors.surface, borderColor: warningColor }]}\n testID={`${testIDPrefix}-details`}\n >\n <Text style={[styles.detailsTitle, { color: warningColor }]}>{labels.errorDetails}</Text>\n <Text style={[styles.detailsText, { color: theme.colors.textSecondary }]}>{error.message}</Text>\n </View>\n ) : null}\n\n <TouchableOpacity\n accessibilityHint={labels.tryAgainHint}\n accessibilityLabel={labels.tryAgain}\n accessibilityRole=\"button\"\n style={[styles.button, { backgroundColor: primaryColor }]}\n testID={`${testIDPrefix}-retry-button`}\n onPress={onRetry}\n >\n <Text style={[styles.buttonText, { color: theme.colors.surfaceElevated }]}>{labels.tryAgain}</Text>\n </TouchableOpacity>\n\n {typeof onReload === 'function' ? (\n <TouchableOpacity\n accessibilityHint={labels.reloadHint}\n accessibilityLabel={labels.reload}\n accessibilityRole=\"button\"\n style={[styles.button, { backgroundColor: theme.colors.surface }]}\n testID={`${testIDPrefix}-reload-button`}\n onPress={onReload}\n >\n <Text style={[styles.buttonText, { color: theme.colors.text }]}>{labels.reload}</Text>\n </TouchableOpacity>\n ) : null}\n </View>\n </View>\n );\n};\n\nexport default ErrorBoundaryFallback;\n","/**\n * ErrorBoundaryRecovering — the transient screen shown while the caller's\n * `recover(error)` handles the failure (in the apps: a one-shot guarded reload\n * after a stale-chunk `ChunkLoadError` following a deploy).\n *\n * It is NOT an error screen — the app is about to come back — so it announces\n * politely (`role=\"status\"`), unlike the assertive fallback.\n */\nimport React from 'react';\n\nimport { ActivityIndicator, StyleSheet, Text, View } from 'react-native';\n\nimport { useFeedbackUi } from '../context/FeedbackUiContext';\n\nconst CONTAINER_PADDING = 20;\nconst MESSAGE_FONT_SIZE = 16;\nconst MESSAGE_MARGIN_TOP = 12;\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 marginTop: MESSAGE_MARGIN_TOP,\n textAlign: 'center',\n },\n});\n\nexport interface ErrorBoundaryRecoveringProps {\n message: string;\n testID: string;\n}\n\nexport const ErrorBoundaryRecovering = ({\n message,\n testID,\n}: ErrorBoundaryRecoveringProps): React.ReactElement => {\n const { theme } = useFeedbackUi();\n\n return (\n <View\n accessibilityLiveRegion=\"polite\"\n role=\"status\"\n style={[styles.container, { backgroundColor: theme.colors.background }]}\n testID={testID}\n >\n <ActivityIndicator color={theme.palette.primary['500']} size=\"large\" />\n <Text style={[styles.message, { color: theme.colors.textSecondary }]}>{message}</Text>\n </View>\n );\n};\n\nexport default ErrorBoundaryRecovering;\n","/**\n * The i18n-agnostic label bag for `<AppErrorBoundary>`.\n *\n * The kit imports no `FM`/i18n runtime — callers localize at the call site and\n * pass PRE-LOCALIZED strings (`labels={{ title: FM('errorBoundary.title') }}`).\n * The defaults below are plain English so the boundary is never blank when a\n * caller omits the bag.\n */\nexport interface ErrorBoundaryLabels {\n /** Heading of the error screen. */\n title: string;\n /** Body copy under the heading. */\n message: string;\n /** Primary action: reset the boundary and re-render the children. */\n tryAgain: string;\n /** Accessibility hint for the try-again action. */\n tryAgainHint: string;\n /** Secondary action: full page reload (rendered only when `onReload` is given). */\n reload: string;\n /** Accessibility hint for the reload action. */\n reloadHint: string;\n /** Shown while `recover` is handling the error (e.g. a guarded chunk reload). */\n updating: string;\n /** Heading of the dev-only error-details block. */\n errorDetails: string;\n}\n\nexport const DEFAULT_ERROR_BOUNDARY_LABELS: ErrorBoundaryLabels = {\n title: 'Something went wrong',\n message: 'An unexpected error occurred. Please try again.',\n tryAgain: 'Try again',\n tryAgainHint: 'Retries rendering this screen',\n reload: 'Reload',\n reloadHint: 'Reloads the application',\n updating: 'Updating…',\n errorDetails: 'Error details',\n};\n","/**\n * AppErrorBoundary — the shared top-level React error boundary, promoted from the\n * SIX app-local copies (agora-web + zygos-web byte-identical, kefi-web, erevna-web,\n * katalogos-web, ichnos-web). aml-v2 had none at all.\n *\n * What varied between the copies — and is therefore injected, not baked in:\n * - **reporting** → `onError` (Sentry `captureException` / `loggingService.fatal`)\n * - **recovery** → `recover` (the apps' `isChunkLoadError() && attemptChunkRecovery()`)\n * - **test ids** → `testIDPrefix` (defaults to the value all six already used)\n * - **error text** → `showDetails` (the dev-only stack block)\n * - **wording** → `labels` (pre-localized by the caller; the kit imports no i18n)\n * - **everything else** → `fallback`, the escape hatch\n *\n * What is now uniform: the fallback renders through the shared `<ErrorState>`, so\n * it themes from `UiProvider` instead of the Bootstrap-4 hex literals three copies\n * hardcoded; and it announces via `role=\"alert\"` + `accessibilityLiveRegion`,\n * which none of the six did.\n */\nimport { Component, type ErrorInfo, type ReactNode } from 'react';\n\nimport { ErrorBoundaryFallback } from './ErrorBoundaryFallback';\nimport { ErrorBoundaryRecovering } from './ErrorBoundaryRecovering';\nimport { DEFAULT_ERROR_BOUNDARY_LABELS, type ErrorBoundaryLabels } from './labels';\nimport { FEEDBACK_TEST_IDS } from '../constants';\n\n/** What the `fallback` render-prop receives. */\nexport interface ErrorFallbackState {\n /** The caught error, or `null` before anything has been caught. */\n error: Error | null;\n /** True while the caller's `recover` is handling the error. */\n recovering: boolean;\n /** Resets the boundary and re-renders `children`. */\n retry: () => void;\n}\n\nexport interface AppErrorBoundaryProps {\n children: ReactNode;\n /** Reporting sink — Sentry / logger. Called for EVERY caught error, before `recover`. */\n onError?: (error: Error, info: ErrorInfo) => void;\n /**\n * Recovery attempt. Return `true` if the error is handled (e.g. a guarded page\n * reload is under way) — the boundary then shows the `updating` screen instead\n * of the error screen. Return `false`/omit to fall through to the fallback.\n */\n recover?: (error: Error) => boolean;\n /** Render the error message in the fallback (dev-only stack). Default `false`. */\n showDetails?: boolean;\n /** Pre-localized wording. Anything omitted falls back to the English defaults. */\n labels?: Partial<ErrorBoundaryLabels>;\n /** Prefix for every testID the boundary renders. Default `error-boundary`. */\n testIDPrefix?: string;\n /** Full escape hatch — replaces the built-in fallback entirely. */\n fallback?: (state: ErrorFallbackState) => ReactNode;\n /**\n * Optional secondary action: a full page reload. Rendered only when provided.\n * (kefi/erevna/katalogos shipped a manual **Reload** alongside **Try Again**;\n * the kit does not touch `window`, so the caller injects the reload itself.)\n */\n onReload?: () => void;\n}\n\ninterface AppErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n recovering: boolean;\n}\n\nconst INITIAL_STATE: AppErrorBoundaryState = { hasError: false, error: null, recovering: false };\n\nexport class AppErrorBoundary extends Component<AppErrorBoundaryProps, AppErrorBoundaryState> {\n public constructor(props: AppErrorBoundaryProps) {\n super(props);\n this.state = INITIAL_STATE;\n }\n\n public static getDerivedStateFromError(error: Error): Partial<AppErrorBoundaryState> {\n return { hasError: true, error };\n }\n\n public componentDidCatch(error: Error, info: ErrorInfo): void {\n // Report FIRST — every copy reported unconditionally, recovery or not.\n if (typeof this.props.onError === 'function') this.props.onError(error, info);\n\n const isHandled = typeof this.props.recover === 'function' && this.props.recover(error);\n if (isHandled) this.setState({ recovering: true });\n }\n\n private readonly handleRetry = (): void => {\n this.setState(INITIAL_STATE);\n };\n\n public render(): ReactNode {\n const { children, fallback, labels, showDetails = false, onReload } = this.props;\n const { hasError, error, recovering } = this.state;\n const testIDPrefix = this.props.testIDPrefix ?? FEEDBACK_TEST_IDS.errorBoundary;\n const resolvedLabels: ErrorBoundaryLabels = { ...DEFAULT_ERROR_BOUNDARY_LABELS, ...labels };\n\n if (!hasError) return children;\n\n if (typeof fallback === 'function') return fallback({ error, recovering, retry: this.handleRetry });\n\n if (recovering)\n return (\n <ErrorBoundaryRecovering message={resolvedLabels.updating} testID={`${testIDPrefix}-updating`} />\n );\n\n return (\n <ErrorBoundaryFallback\n error={error}\n labels={resolvedLabels}\n showDetails={showDetails}\n testIDPrefix={testIDPrefix}\n onReload={onReload}\n onRetry={this.handleRetry}\n />\n );\n }\n}\n\nexport default AppErrorBoundary;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dloizides/ui-feedback",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.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",
|