@dloizides/ui-feedback 1.20.0 → 1.22.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/dist/index.d.mts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +40 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -29,10 +29,18 @@ interface FeedbackThemeSemantic {
|
|
|
29
29
|
error: FeedbackColorScale;
|
|
30
30
|
[name: string]: FeedbackColorScale;
|
|
31
31
|
}
|
|
32
|
+
/** Text colours readable on the mode's surfaces; `semantic` stays the fill. */
|
|
33
|
+
interface FeedbackThemeSemanticText {
|
|
34
|
+
success: string;
|
|
35
|
+
warning: string;
|
|
36
|
+
error: string;
|
|
37
|
+
info: string;
|
|
38
|
+
}
|
|
32
39
|
interface FeedbackTheme {
|
|
33
40
|
colors: FeedbackThemeColors;
|
|
34
41
|
palette: FeedbackThemePalette;
|
|
35
42
|
semantic: FeedbackThemeSemantic;
|
|
43
|
+
semanticText?: FeedbackThemeSemanticText;
|
|
36
44
|
}
|
|
37
45
|
/** Translate function — mirrors the apps' `FM(key, p1?, p2?, p3?)` helper. */
|
|
38
46
|
type FeedbackTranslate = (key: string, p1?: string, p2?: string, p3?: string) => string;
|
|
@@ -437,6 +445,7 @@ declare const DEFAULT_ERROR_BOUNDARY_LABELS: ErrorBoundaryLabels;
|
|
|
437
445
|
|
|
438
446
|
/** What the `fallback` render-prop receives. */
|
|
439
447
|
interface ErrorFallbackState {
|
|
448
|
+
renderDefault: (logo?: ReactNode) => ReactNode;
|
|
440
449
|
/** The caught error, or `null` before anything has been caught. */
|
|
441
450
|
error: Error | null;
|
|
442
451
|
/** True while the caller's `recover` is handling the error. */
|
|
@@ -524,6 +533,7 @@ declare class AppErrorBoundary extends Component<AppErrorBoundaryProps, AppError
|
|
|
524
533
|
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
525
534
|
private readonly handleRetry;
|
|
526
535
|
render(): ReactNode;
|
|
536
|
+
private renderDefaultFallback;
|
|
527
537
|
}
|
|
528
538
|
|
|
529
539
|
interface ErrorReferenceRowProps {
|
|
@@ -658,4 +668,4 @@ declare function LiveRunCard(props: LiveRunCardProps): React.ReactElement;
|
|
|
658
668
|
/** The theme colour for a step or group state; falls back to primary/text when a semantic scale is absent. */
|
|
659
669
|
declare function runToneColor(theme: FeedbackTheme, state: RunStepState): string;
|
|
660
670
|
|
|
661
|
-
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorReferenceRow, type ErrorReferenceRowProps, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, type StepSplit, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useFeedbackUi as useUi };
|
|
671
|
+
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorReferenceRow, type ErrorReferenceRowProps, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackThemeSemanticText, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, type StepSplit, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackThemeSemanticText as UiThemeSemanticText, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useFeedbackUi as useUi };
|
package/dist/index.d.ts
CHANGED
|
@@ -29,10 +29,18 @@ interface FeedbackThemeSemantic {
|
|
|
29
29
|
error: FeedbackColorScale;
|
|
30
30
|
[name: string]: FeedbackColorScale;
|
|
31
31
|
}
|
|
32
|
+
/** Text colours readable on the mode's surfaces; `semantic` stays the fill. */
|
|
33
|
+
interface FeedbackThemeSemanticText {
|
|
34
|
+
success: string;
|
|
35
|
+
warning: string;
|
|
36
|
+
error: string;
|
|
37
|
+
info: string;
|
|
38
|
+
}
|
|
32
39
|
interface FeedbackTheme {
|
|
33
40
|
colors: FeedbackThemeColors;
|
|
34
41
|
palette: FeedbackThemePalette;
|
|
35
42
|
semantic: FeedbackThemeSemantic;
|
|
43
|
+
semanticText?: FeedbackThemeSemanticText;
|
|
36
44
|
}
|
|
37
45
|
/** Translate function — mirrors the apps' `FM(key, p1?, p2?, p3?)` helper. */
|
|
38
46
|
type FeedbackTranslate = (key: string, p1?: string, p2?: string, p3?: string) => string;
|
|
@@ -437,6 +445,7 @@ declare const DEFAULT_ERROR_BOUNDARY_LABELS: ErrorBoundaryLabels;
|
|
|
437
445
|
|
|
438
446
|
/** What the `fallback` render-prop receives. */
|
|
439
447
|
interface ErrorFallbackState {
|
|
448
|
+
renderDefault: (logo?: ReactNode) => ReactNode;
|
|
440
449
|
/** The caught error, or `null` before anything has been caught. */
|
|
441
450
|
error: Error | null;
|
|
442
451
|
/** True while the caller's `recover` is handling the error. */
|
|
@@ -524,6 +533,7 @@ declare class AppErrorBoundary extends Component<AppErrorBoundaryProps, AppError
|
|
|
524
533
|
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
525
534
|
private readonly handleRetry;
|
|
526
535
|
render(): ReactNode;
|
|
536
|
+
private renderDefaultFallback;
|
|
527
537
|
}
|
|
528
538
|
|
|
529
539
|
interface ErrorReferenceRowProps {
|
|
@@ -658,4 +668,4 @@ declare function LiveRunCard(props: LiveRunCardProps): React.ReactElement;
|
|
|
658
668
|
/** The theme colour for a step or group state; falls back to primary/text when a semantic scale is absent. */
|
|
659
669
|
declare function runToneColor(theme: FeedbackTheme, state: RunStepState): string;
|
|
660
670
|
|
|
661
|
-
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorReferenceRow, type ErrorReferenceRowProps, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, type StepSplit, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useFeedbackUi as useUi };
|
|
671
|
+
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorReferenceRow, type ErrorReferenceRowProps, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackThemeSemanticText, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, type StepSplit, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackThemeSemanticText as UiThemeSemanticText, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useFeedbackUi as useUi };
|
package/dist/index.js
CHANGED
|
@@ -332,7 +332,7 @@ var ErrorState = ({
|
|
|
332
332
|
const primary = theme.palette.primary["500"];
|
|
333
333
|
const hasTitle = typeof title === "string" && title !== "";
|
|
334
334
|
const hasIcon = icon !== void 0 && icon !== null;
|
|
335
|
-
const messageColor = hasTitle ? theme.colors.textSecondary : errorColor;
|
|
335
|
+
const messageColor = hasTitle ? theme.colors.textSecondary : theme.semanticText?.error ?? errorColor;
|
|
336
336
|
const retry = typeof onRetry === "function" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
337
337
|
reactNative.TouchableOpacity,
|
|
338
338
|
{
|
|
@@ -1144,6 +1144,10 @@ var styles10 = reactNative.StyleSheet.create({
|
|
|
1144
1144
|
maxWidth: CONTENT_MAX_WIDTH,
|
|
1145
1145
|
alignItems: "center"
|
|
1146
1146
|
},
|
|
1147
|
+
logo: {
|
|
1148
|
+
alignItems: "center",
|
|
1149
|
+
marginBottom: TITLE_MARGIN_BOTTOM2
|
|
1150
|
+
},
|
|
1147
1151
|
title: {
|
|
1148
1152
|
fontSize: TITLE_FONT_SIZE3,
|
|
1149
1153
|
fontWeight: "bold",
|
|
@@ -1185,10 +1189,12 @@ var ErrorBoundaryFallback = ({
|
|
|
1185
1189
|
showRetry,
|
|
1186
1190
|
reloadIsPrimary,
|
|
1187
1191
|
onRetry,
|
|
1188
|
-
onReload
|
|
1192
|
+
onReload,
|
|
1193
|
+
logo
|
|
1189
1194
|
}) => {
|
|
1190
1195
|
const { theme } = useFeedbackUi();
|
|
1191
1196
|
const warningColor = (theme.semantic.warning ?? theme.semantic.error)["500"];
|
|
1197
|
+
const warningText = theme.semanticText?.warning ?? warningColor;
|
|
1192
1198
|
const primaryColor = theme.palette.primary["500"];
|
|
1193
1199
|
const hasDetails = showDetails && error !== null;
|
|
1194
1200
|
const primaryFill = { backgroundColor: primaryColor };
|
|
@@ -1227,6 +1233,7 @@ var ErrorBoundaryFallback = ({
|
|
|
1227
1233
|
style: [styles10.container, { backgroundColor: theme.colors.background }],
|
|
1228
1234
|
testID: testIDPrefix,
|
|
1229
1235
|
children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles10.content, children: [
|
|
1236
|
+
logo !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles10.logo, testID: `${testIDPrefix}-logo`, children: logo }) : null,
|
|
1230
1237
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.title, { color: theme.colors.text }], children: labels.title }),
|
|
1231
1238
|
/* @__PURE__ */ jsxRuntime.jsx(ErrorState, { message: labels.message, testID: `${testIDPrefix}-message` }),
|
|
1232
1239
|
hasDetails ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1235,7 +1242,7 @@ var ErrorBoundaryFallback = ({
|
|
|
1235
1242
|
style: [styles10.details, { backgroundColor: theme.colors.surface, borderColor: warningColor }],
|
|
1236
1243
|
testID: `${testIDPrefix}-details`,
|
|
1237
1244
|
children: [
|
|
1238
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.detailsTitle, { color:
|
|
1245
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.detailsTitle, { color: warningText }], children: labels.errorDetails }),
|
|
1239
1246
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.detailsText, { color: theme.colors.textSecondary }], children: error.message })
|
|
1240
1247
|
]
|
|
1241
1248
|
}
|
|
@@ -1329,12 +1336,23 @@ var AppErrorBoundary = class extends react.Component {
|
|
|
1329
1336
|
if (isHandled) this.setState({ recovering: true });
|
|
1330
1337
|
}
|
|
1331
1338
|
render() {
|
|
1332
|
-
const { children, fallback
|
|
1339
|
+
const { children, fallback } = this.props;
|
|
1333
1340
|
const { hasError, error, recovering } = this.state;
|
|
1341
|
+
if (!hasError) return children;
|
|
1342
|
+
if (typeof fallback === "function")
|
|
1343
|
+
return fallback({
|
|
1344
|
+
error,
|
|
1345
|
+
recovering,
|
|
1346
|
+
retry: this.handleRetry,
|
|
1347
|
+
renderDefault: (logo) => this.renderDefaultFallback(logo)
|
|
1348
|
+
});
|
|
1349
|
+
return this.renderDefaultFallback();
|
|
1350
|
+
}
|
|
1351
|
+
renderDefaultFallback(logo) {
|
|
1352
|
+
const { labels, labelsFor, showDetails, onReload } = this.props;
|
|
1353
|
+
const { error, recovering } = this.state;
|
|
1334
1354
|
const testIDPrefix = this.props.testIDPrefix ?? FEEDBACK_TEST_IDS.errorBoundary;
|
|
1335
1355
|
const resolvedLabels = resolveLabels(labels, labelsFor, error);
|
|
1336
|
-
if (!hasError) return children;
|
|
1337
|
-
if (typeof fallback === "function") return fallback({ error, recovering, retry: this.handleRetry });
|
|
1338
1356
|
if (recovering)
|
|
1339
1357
|
return /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundaryRecovering, { message: resolvedLabels.updating, testID: `${testIDPrefix}-updating` });
|
|
1340
1358
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1342,6 +1360,7 @@ var AppErrorBoundary = class extends react.Component {
|
|
|
1342
1360
|
{
|
|
1343
1361
|
error,
|
|
1344
1362
|
labels: resolvedLabels,
|
|
1363
|
+
logo,
|
|
1345
1364
|
reloadIsPrimary: this.props.reloadIsPrimary === true,
|
|
1346
1365
|
showDetails: resolveShowDetails(showDetails, error),
|
|
1347
1366
|
showRetry: resolveRetryable(this.props.retryable, error),
|
|
@@ -1519,6 +1538,15 @@ function runToneColor(theme, state) {
|
|
|
1519
1538
|
if (state === "done") return scale(theme, "success") ?? theme.colors.text;
|
|
1520
1539
|
return theme.colors.textSecondary;
|
|
1521
1540
|
}
|
|
1541
|
+
function runToneTextColor(theme, state) {
|
|
1542
|
+
const inks = {
|
|
1543
|
+
failed: theme.semanticText?.error,
|
|
1544
|
+
running: theme.semanticText?.warning,
|
|
1545
|
+
done: theme.semanticText?.success,
|
|
1546
|
+
pending: void 0
|
|
1547
|
+
};
|
|
1548
|
+
return inks[state] ?? runToneColor(theme, state);
|
|
1549
|
+
}
|
|
1522
1550
|
var MARK = { done: "\u2713", running: "\u25CF", pending: "\u25CB", failed: "\u2715" };
|
|
1523
1551
|
var styles14 = reactNative.StyleSheet.create({
|
|
1524
1552
|
row: { flexDirection: "row", flexWrap: "wrap", gap: 6 },
|
|
@@ -1535,9 +1563,10 @@ function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect })
|
|
|
1535
1563
|
const { theme } = useFeedbackUi();
|
|
1536
1564
|
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles14.row, testID, children: groups.map((group) => {
|
|
1537
1565
|
const color = runToneColor(theme, group.state);
|
|
1566
|
+
const ink = runToneTextColor(theme, group.state);
|
|
1538
1567
|
const selected = group.id === selectedId;
|
|
1539
1568
|
const a11y = labels.groupA11y(group.label, group.state, labels.formatDuration(group.durationSec));
|
|
1540
|
-
const body = /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles14.text, { color }, selected || group.state === "running" ? styles14.strong : null], children: chipText(group, labels) });
|
|
1569
|
+
const body = /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles14.text, { color: ink }, selected || group.state === "running" ? styles14.strong : null], children: chipText(group, labels) });
|
|
1541
1570
|
const look = [styles14.chip, { borderColor: color, backgroundColor: selected ? theme.colors.surfaceElevated : theme.colors.surface }];
|
|
1542
1571
|
if (onSelect === void 0) {
|
|
1543
1572
|
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [look, styles14.still], accessible: true, accessibilityLabel: a11y, testID: `${testID}-${group.id}`, children: body }, group.id);
|
|
@@ -1565,7 +1594,7 @@ function RunGroupSummary({ groups, labels, testID }) {
|
|
|
1565
1594
|
const doneColor = runToneColor(theme, "done");
|
|
1566
1595
|
const doneText = labels.doneSummary(done.count, labels.formatDuration(done.durationSec));
|
|
1567
1596
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles14.row, testID, children: [
|
|
1568
|
-
done.count > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles14.chip, styles14.still, { borderColor: doneColor }], accessible: true, accessibilityLabel: doneText, testID: `${testID}-done`, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles14.text, { color:
|
|
1597
|
+
done.count > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles14.chip, styles14.still, { borderColor: doneColor }], accessible: true, accessibilityLabel: doneText, testID: `${testID}-done`, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles14.text, { color: runToneTextColor(theme, "done") }], children: `${MARK.done} ${doneText}` }) }) : null,
|
|
1569
1598
|
/* @__PURE__ */ jsxRuntime.jsx(RunGroupChips, { groups: open, labels, testID: `${testID}-open` })
|
|
1570
1599
|
] });
|
|
1571
1600
|
}
|
|
@@ -1651,17 +1680,18 @@ function LiveRunCard(props) {
|
|
|
1651
1680
|
const selectedId = groups.some((g) => g.id === picked) ? picked : defaultGroupId(groups);
|
|
1652
1681
|
const selected = groups.find((g) => g.id === selectedId);
|
|
1653
1682
|
const tone = runToneColor(theme, status);
|
|
1683
|
+
const toneText = runToneTextColor(theme, status);
|
|
1654
1684
|
const percent = progressPercent(progress);
|
|
1655
1685
|
const showTimings = !compact || open;
|
|
1656
1686
|
const muted = { color: theme.colors.textSecondary };
|
|
1657
1687
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles16.card, { borderColor: tone, backgroundColor: theme.colors.surface }], testID, children: [
|
|
1658
1688
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles16.head, children: [
|
|
1659
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles16.pill, { borderColor: tone }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles16.pillText, { color:
|
|
1689
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles16.pill, { borderColor: tone }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles16.pillText, { color: toneText }], testID: `${testID}-status`, children: labels.status }) }),
|
|
1660
1690
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles16.titleBox, children: [
|
|
1661
1691
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles16.title, { color: theme.colors.text }], testID: `${testID}-title`, children: title }),
|
|
1662
1692
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles16.meta, muted], testID: `${testID}-meta`, children: labels.meta })
|
|
1663
1693
|
] }),
|
|
1664
|
-
onCancel !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(RunCardButton, { label: labels.cancel, hint: labels.cancelHint, color: theme.semantic.error["500"], onPress: onCancel, disabled: cancelDisabled, testID: `${testID}-cancel` }) : null
|
|
1694
|
+
onCancel !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(RunCardButton, { label: labels.cancel, hint: labels.cancelHint, color: theme.semanticText?.error ?? theme.semantic.error["500"], onPress: onCancel, disabled: cancelDisabled, testID: `${testID}-cancel` }) : null
|
|
1665
1695
|
] }),
|
|
1666
1696
|
currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles16.step, { color: theme.colors.text }], testID: `${testID}-step`, children: currentStep }) : null,
|
|
1667
1697
|
percent !== null ? /* @__PURE__ */ jsxRuntime.jsx(ProgressBar, { percent, label: labels.progress, accessibilityLabel: labels.progressA11y, color: tone, testID: `${testID}-progress` }) : null,
|