@dloizides/ui-feedback 1.18.0 → 1.19.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 +7 -0
- package/dist/index.d.mts +43 -33
- package/dist/index.d.ts +43 -33
- package/dist/index.js +282 -109
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +279 -112
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createContext, useMemo, useContext,
|
|
1
|
+
import { createContext, useMemo, useContext, useState, useRef, useEffect, useCallback, useId, useSyncExternalStore, Component } from 'react';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { Platform, StyleSheet, TouchableOpacity, Text, View, ActivityIndicator, Modal, useWindowDimensions, Animated, Pressable } from 'react-native';
|
|
4
4
|
import { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';
|
|
5
5
|
import { Skeleton } from '@dloizides/ui-motion';
|
|
6
6
|
import { Z_INDEX, resolveOnBrand, UI_DEEP_STEP, UI_MAIN_STEP, isHexColor, canCarryAccessibleInk } from '@dloizides/design-tokens';
|
|
@@ -63,6 +63,147 @@ var FEEDBACK_TEST_IDS = {
|
|
|
63
63
|
progressBar: "progress-bar"
|
|
64
64
|
};
|
|
65
65
|
var MIN_TOUCH_TARGET = 44;
|
|
66
|
+
|
|
67
|
+
// src/ErrorReference/utils/copyText.ts
|
|
68
|
+
var OFFSCREEN_POSITION = "-9999px";
|
|
69
|
+
function hasDom() {
|
|
70
|
+
return typeof document !== "undefined" && document.body !== null;
|
|
71
|
+
}
|
|
72
|
+
function copyViaExecCommand(value) {
|
|
73
|
+
if (!hasDom()) return false;
|
|
74
|
+
const area = document.createElement("textarea");
|
|
75
|
+
area.value = value;
|
|
76
|
+
area.readOnly = true;
|
|
77
|
+
area.setAttribute("aria-hidden", "true");
|
|
78
|
+
area.style.position = "fixed";
|
|
79
|
+
area.style.top = OFFSCREEN_POSITION;
|
|
80
|
+
area.style.left = OFFSCREEN_POSITION;
|
|
81
|
+
area.style.opacity = "0";
|
|
82
|
+
document.body.appendChild(area);
|
|
83
|
+
try {
|
|
84
|
+
area.select();
|
|
85
|
+
area.setSelectionRange(0, value.length);
|
|
86
|
+
return document.execCommand("copy");
|
|
87
|
+
} catch {
|
|
88
|
+
return false;
|
|
89
|
+
} finally {
|
|
90
|
+
document.body.removeChild(area);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function hasAsyncClipboard() {
|
|
94
|
+
return typeof navigator !== "undefined" && typeof navigator.clipboard?.writeText === "function";
|
|
95
|
+
}
|
|
96
|
+
async function tryWrite(write) {
|
|
97
|
+
try {
|
|
98
|
+
await write();
|
|
99
|
+
return true;
|
|
100
|
+
} catch {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function copyText(value, writer) {
|
|
105
|
+
if (value === "") return false;
|
|
106
|
+
if (writer !== void 0 && await tryWrite(() => writer(value))) return true;
|
|
107
|
+
if (hasAsyncClipboard() && await tryWrite(() => navigator.clipboard.writeText(value))) return true;
|
|
108
|
+
return copyViaExecCommand(value);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// src/ErrorReference/utils/CopyStatus.ts
|
|
112
|
+
var CopyStatus = /* @__PURE__ */ ((CopyStatus2) => {
|
|
113
|
+
CopyStatus2["Idle"] = "idle";
|
|
114
|
+
CopyStatus2["Copied"] = "copied";
|
|
115
|
+
CopyStatus2["Failed"] = "failed";
|
|
116
|
+
return CopyStatus2;
|
|
117
|
+
})(CopyStatus || {});
|
|
118
|
+
|
|
119
|
+
// src/ErrorReference/hooks/useCopyToClipboard.ts
|
|
120
|
+
var COPY_FEEDBACK_MS = 1500;
|
|
121
|
+
function useCopyToClipboard(value, writer) {
|
|
122
|
+
const [status, setStatus] = useState("idle" /* Idle */);
|
|
123
|
+
const timerRef = useRef(null);
|
|
124
|
+
const mountedRef = useRef(true);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
mountedRef.current = true;
|
|
127
|
+
return () => {
|
|
128
|
+
mountedRef.current = false;
|
|
129
|
+
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
130
|
+
};
|
|
131
|
+
}, []);
|
|
132
|
+
const copy = useCallback(() => {
|
|
133
|
+
void copyText(value, writer).then((ok) => {
|
|
134
|
+
if (!mountedRef.current) return;
|
|
135
|
+
setStatus(ok ? "copied" /* Copied */ : "failed" /* Failed */);
|
|
136
|
+
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
137
|
+
timerRef.current = setTimeout(() => {
|
|
138
|
+
if (mountedRef.current) setStatus("idle" /* Idle */);
|
|
139
|
+
}, COPY_FEEDBACK_MS);
|
|
140
|
+
});
|
|
141
|
+
}, [value, writer]);
|
|
142
|
+
return { status, copy };
|
|
143
|
+
}
|
|
144
|
+
var REFERENCE_FONT_SIZE = 13;
|
|
145
|
+
var ROW_GAP = 8;
|
|
146
|
+
var COPY_MIN_WIDTH = 56;
|
|
147
|
+
var COPY_PADDING_H = 8;
|
|
148
|
+
var COPY_RADIUS = 6;
|
|
149
|
+
var MONO_FONT = Platform.select({
|
|
150
|
+
web: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
|
|
151
|
+
ios: "Menlo",
|
|
152
|
+
default: "monospace"
|
|
153
|
+
});
|
|
154
|
+
var styles = StyleSheet.create({
|
|
155
|
+
row: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: ROW_GAP },
|
|
156
|
+
label: { fontSize: REFERENCE_FONT_SIZE },
|
|
157
|
+
id: { fontSize: REFERENCE_FONT_SIZE, fontFamily: MONO_FONT },
|
|
158
|
+
copy: {
|
|
159
|
+
minWidth: COPY_MIN_WIDTH,
|
|
160
|
+
minHeight: MIN_TOUCH_TARGET_PX,
|
|
161
|
+
paddingHorizontal: COPY_PADDING_H,
|
|
162
|
+
borderRadius: COPY_RADIUS,
|
|
163
|
+
alignItems: "center",
|
|
164
|
+
justifyContent: "center"
|
|
165
|
+
},
|
|
166
|
+
copyText: { fontSize: REFERENCE_FONT_SIZE, fontWeight: "600" }
|
|
167
|
+
});
|
|
168
|
+
var STATUS_KEY = {
|
|
169
|
+
["idle" /* Idle */]: "common.copy",
|
|
170
|
+
["copied" /* Copied */]: "common.copied",
|
|
171
|
+
["failed" /* Failed */]: "common.copyFailed"
|
|
172
|
+
};
|
|
173
|
+
var Reference = ({ traceId, color, actionColor, testID, style }) => {
|
|
174
|
+
const { t } = useFeedbackUi();
|
|
175
|
+
const { status, copy } = useCopyToClipboard(traceId);
|
|
176
|
+
const copyLabel = t(STATUS_KEY[status]);
|
|
177
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.row, style], testID, children: [
|
|
178
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.label, { color }], children: t("common.errorReference") }),
|
|
179
|
+
/* @__PURE__ */ jsx(Text, { selectable: true, style: [styles.id, { color }], testID: `${testID}-id`, children: traceId }),
|
|
180
|
+
/* @__PURE__ */ jsx(
|
|
181
|
+
TouchableOpacity,
|
|
182
|
+
{
|
|
183
|
+
accessibilityHint: t("common.copyHint"),
|
|
184
|
+
accessibilityLabel: copyLabel,
|
|
185
|
+
accessibilityRole: "button",
|
|
186
|
+
style: styles.copy,
|
|
187
|
+
testID: `${testID}-copy`,
|
|
188
|
+
onPress: copy,
|
|
189
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles.copyText, { color: actionColor }], children: copyLabel })
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
] });
|
|
193
|
+
};
|
|
194
|
+
var ErrorReferenceRow = (props) => props.traceId === void 0 ? null : /* @__PURE__ */ jsx(Reference, { ...props, traceId: props.traceId });
|
|
195
|
+
|
|
196
|
+
// src/ErrorReference/utils/readTraceId.ts
|
|
197
|
+
function isRecord(value) {
|
|
198
|
+
return typeof value === "object" && value !== null;
|
|
199
|
+
}
|
|
200
|
+
function readTraceId(error) {
|
|
201
|
+
if (!isRecord(error)) return void 0;
|
|
202
|
+
const id = error.traceId;
|
|
203
|
+
if (typeof id !== "string") return void 0;
|
|
204
|
+
const trimmed = id.trim();
|
|
205
|
+
return trimmed === "" ? void 0 : trimmed;
|
|
206
|
+
}
|
|
66
207
|
var WELL_SIZE = 56;
|
|
67
208
|
var WELL_MARGIN_BOTTOM = 16;
|
|
68
209
|
var WELL_TINT_OPACITY = 0.12;
|
|
@@ -72,7 +213,7 @@ var BUTTON_PADDING_H = 16;
|
|
|
72
213
|
var BUTTON_BORDER_RADIUS = 6;
|
|
73
214
|
var BUTTON_BORDER_WIDTH = 1;
|
|
74
215
|
var BUTTON_FONT_SIZE = 14;
|
|
75
|
-
var
|
|
216
|
+
var styles2 = StyleSheet.create({
|
|
76
217
|
well: {
|
|
77
218
|
width: WELL_SIZE,
|
|
78
219
|
height: WELL_SIZE,
|
|
@@ -101,8 +242,8 @@ var styles = StyleSheet.create({
|
|
|
101
242
|
fontWeight: "600"
|
|
102
243
|
}
|
|
103
244
|
});
|
|
104
|
-
var ErrorStateIconWell = ({ icon, tint, testID }) => /* @__PURE__ */ jsxs(View, { "aria-hidden": true, style:
|
|
105
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
245
|
+
var ErrorStateIconWell = ({ icon, tint, testID }) => /* @__PURE__ */ jsxs(View, { "aria-hidden": true, style: styles2.well, testID, children: [
|
|
246
|
+
/* @__PURE__ */ jsx(View, { style: [styles2.wellTint, { backgroundColor: tint }] }),
|
|
106
247
|
icon
|
|
107
248
|
] });
|
|
108
249
|
var ErrorStateSecondaryButton = ({
|
|
@@ -114,10 +255,10 @@ var ErrorStateSecondaryButton = ({
|
|
|
114
255
|
accessibilityHint: action.hint,
|
|
115
256
|
accessibilityLabel: action.label,
|
|
116
257
|
accessibilityRole: "button",
|
|
117
|
-
style: [
|
|
258
|
+
style: [styles2.secondaryButton, { borderColor: theme.colors.border }],
|
|
118
259
|
testID: action.testID,
|
|
119
260
|
onPress: action.onPress,
|
|
120
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
261
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles2.secondaryText, { color: theme.colors.text }], children: action.label })
|
|
121
262
|
}
|
|
122
263
|
);
|
|
123
264
|
var MESSAGE_FONT_SIZE = 16;
|
|
@@ -130,7 +271,8 @@ var BUTTON_FONT_SIZE2 = 14;
|
|
|
130
271
|
var TITLE_FONT_SIZE = 20;
|
|
131
272
|
var TITLE_MARGIN_BOTTOM = 8;
|
|
132
273
|
var ACTION_GAP = 12;
|
|
133
|
-
var
|
|
274
|
+
var REFERENCE_MARGIN_TOP = 12;
|
|
275
|
+
var styles3 = StyleSheet.create({
|
|
134
276
|
container: {
|
|
135
277
|
flex: 1,
|
|
136
278
|
justifyContent: "center",
|
|
@@ -162,6 +304,10 @@ var styles2 = StyleSheet.create({
|
|
|
162
304
|
paddingHorizontal: BUTTON_PADDING_H2,
|
|
163
305
|
borderRadius: BUTTON_BORDER_RADIUS2
|
|
164
306
|
},
|
|
307
|
+
reference: {
|
|
308
|
+
justifyContent: "center",
|
|
309
|
+
marginTop: REFERENCE_MARGIN_TOP
|
|
310
|
+
},
|
|
165
311
|
retryText: {
|
|
166
312
|
fontSize: BUTTON_FONT_SIZE2,
|
|
167
313
|
fontWeight: "600"
|
|
@@ -173,7 +319,8 @@ var ErrorState = ({
|
|
|
173
319
|
testID = FEEDBACK_TEST_IDS.errorState,
|
|
174
320
|
title,
|
|
175
321
|
icon,
|
|
176
|
-
secondaryAction
|
|
322
|
+
secondaryAction,
|
|
323
|
+
error
|
|
177
324
|
}) => {
|
|
178
325
|
const { theme, t } = useFeedbackUi();
|
|
179
326
|
const errorColor = theme.semantic.error["500"];
|
|
@@ -187,28 +334,38 @@ var ErrorState = ({
|
|
|
187
334
|
accessibilityHint: t("common.retryHint"),
|
|
188
335
|
accessibilityLabel: t("common.retry"),
|
|
189
336
|
accessibilityRole: "button",
|
|
190
|
-
style: [
|
|
337
|
+
style: [styles3.retryButton, { backgroundColor: primary }],
|
|
191
338
|
testID: FEEDBACK_TEST_IDS.errorStateRetry,
|
|
192
339
|
onPress: onRetry,
|
|
193
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
340
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles3.retryText, { color: theme.colors.surfaceElevated }], children: t("common.retry") })
|
|
194
341
|
}
|
|
195
342
|
) : null;
|
|
196
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
343
|
+
return /* @__PURE__ */ jsxs(View, { style: styles3.container, testID, children: [
|
|
197
344
|
hasIcon ? /* @__PURE__ */ jsx(ErrorStateIconWell, { icon, testID: `${testID}-icon`, tint: errorColor }) : null,
|
|
198
345
|
hasTitle ? /* @__PURE__ */ jsx(
|
|
199
346
|
Text,
|
|
200
347
|
{
|
|
201
348
|
accessibilityRole: "header",
|
|
202
|
-
style: [
|
|
349
|
+
style: [styles3.title, { color: theme.colors.text }],
|
|
203
350
|
testID: `${testID}-title`,
|
|
204
351
|
children: title
|
|
205
352
|
}
|
|
206
353
|
) : null,
|
|
207
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
208
|
-
secondaryAction === void 0 ? retry : /* @__PURE__ */ jsxs(View, { style:
|
|
354
|
+
/* @__PURE__ */ jsx(Text, { style: [styles3.message, { color: messageColor }], children: message }),
|
|
355
|
+
secondaryAction === void 0 ? retry : /* @__PURE__ */ jsxs(View, { style: styles3.actions, children: [
|
|
209
356
|
retry,
|
|
210
357
|
/* @__PURE__ */ jsx(ErrorStateSecondaryButton, { action: secondaryAction, theme })
|
|
211
|
-
] })
|
|
358
|
+
] }),
|
|
359
|
+
/* @__PURE__ */ jsx(
|
|
360
|
+
ErrorReferenceRow,
|
|
361
|
+
{
|
|
362
|
+
actionColor: primary,
|
|
363
|
+
color: theme.colors.textSecondary,
|
|
364
|
+
style: styles3.reference,
|
|
365
|
+
testID: `${testID}-reference`,
|
|
366
|
+
traceId: readTraceId(error)
|
|
367
|
+
}
|
|
368
|
+
)
|
|
212
369
|
] });
|
|
213
370
|
};
|
|
214
371
|
var MESSAGE_FONT_SIZE2 = 16;
|
|
@@ -218,7 +375,7 @@ var CTA_PADDING_HORIZONTAL = 20;
|
|
|
218
375
|
var CTA_BORDER_RADIUS = 8;
|
|
219
376
|
var CTA_FONT_SIZE = 14;
|
|
220
377
|
var CONTAINER_PADDING2 = 32;
|
|
221
|
-
var
|
|
378
|
+
var styles4 = StyleSheet.create({
|
|
222
379
|
container: {
|
|
223
380
|
flex: 1,
|
|
224
381
|
justifyContent: "center",
|
|
@@ -254,25 +411,25 @@ var EmptyListState = ({
|
|
|
254
411
|
if (typeof ctaRoute === "string" && typeof navigate === "function") navigate(ctaRoute);
|
|
255
412
|
}, [navigate, ctaRoute]);
|
|
256
413
|
const showCta = typeof ctaTextKey === "string" && typeof ctaHintKey === "string" && typeof ctaRoute === "string";
|
|
257
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
258
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
414
|
+
return /* @__PURE__ */ jsxs(View, { style: styles4.container, testID, children: [
|
|
415
|
+
/* @__PURE__ */ jsx(Text, { style: [styles4.message, { color: colors.textSecondary }], children: t(messageKey) }),
|
|
259
416
|
showCta ? /* @__PURE__ */ jsx(
|
|
260
417
|
TouchableOpacity,
|
|
261
418
|
{
|
|
262
419
|
accessibilityHint: t(ctaHintKey),
|
|
263
420
|
accessibilityLabel: t(ctaTextKey),
|
|
264
421
|
accessibilityRole: "button",
|
|
265
|
-
style: [
|
|
422
|
+
style: [styles4.ctaButton, { backgroundColor: primary }],
|
|
266
423
|
testID: FEEDBACK_TEST_IDS.emptyListCta,
|
|
267
424
|
onPress: handlePress,
|
|
268
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
425
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles4.ctaText, { color: colors.background }], children: t(ctaTextKey) })
|
|
269
426
|
}
|
|
270
427
|
) : null
|
|
271
428
|
] });
|
|
272
429
|
};
|
|
273
430
|
var FULLSCREEN_MIN_HEIGHT = 300;
|
|
274
431
|
var CONTAINER_MIN_HEIGHT = 100;
|
|
275
|
-
var
|
|
432
|
+
var styles5 = StyleSheet.create({
|
|
276
433
|
container: {
|
|
277
434
|
flex: 1,
|
|
278
435
|
justifyContent: "center",
|
|
@@ -293,7 +450,7 @@ var LoadingFallback = ({ fullScreen = false, size = "large" }) => {
|
|
|
293
450
|
accessibilityHint: t("loadingFallback.hint"),
|
|
294
451
|
accessibilityLabel: t("loadingFallback.label"),
|
|
295
452
|
accessibilityRole: "progressbar",
|
|
296
|
-
style: [
|
|
453
|
+
style: [styles5.container, fullScreen && styles5.fullScreen, { backgroundColor: colors.background }],
|
|
297
454
|
testID: FEEDBACK_TEST_IDS.loadingFallback,
|
|
298
455
|
children: /* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size })
|
|
299
456
|
}
|
|
@@ -310,7 +467,7 @@ var TEXT_LINE_HEIGHT = 16;
|
|
|
310
467
|
var TEXT_LINE_FULL_WIDTH = "100%";
|
|
311
468
|
var TEXT_LINE_SHORT_WIDTH = "70%";
|
|
312
469
|
var CARD_HEIGHT = 120;
|
|
313
|
-
var
|
|
470
|
+
var styles6 = StyleSheet.create({
|
|
314
471
|
container: {
|
|
315
472
|
flex: 1,
|
|
316
473
|
padding: 16
|
|
@@ -344,25 +501,25 @@ var PageSkeleton = ({
|
|
|
344
501
|
const { theme, t } = useFeedbackUi();
|
|
345
502
|
const colors = theme.colors;
|
|
346
503
|
const skeletonColor = String(colors.border);
|
|
347
|
-
const renderListRow = (index) => /* @__PURE__ */ jsxs(View, { style:
|
|
504
|
+
const renderListRow = (index) => /* @__PURE__ */ jsxs(View, { style: styles6.row, children: [
|
|
348
505
|
/* @__PURE__ */ jsx(
|
|
349
506
|
Skeleton,
|
|
350
507
|
{
|
|
351
508
|
backgroundColor: skeletonColor,
|
|
352
509
|
borderRadius: AVATAR_BORDER_RADIUS,
|
|
353
510
|
height: AVATAR_SIZE,
|
|
354
|
-
style:
|
|
511
|
+
style: styles6.avatar,
|
|
355
512
|
width: AVATAR_SIZE
|
|
356
513
|
}
|
|
357
514
|
),
|
|
358
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
515
|
+
/* @__PURE__ */ jsxs(View, { style: styles6.textContainer, children: [
|
|
359
516
|
/* @__PURE__ */ jsx(
|
|
360
517
|
Skeleton,
|
|
361
518
|
{
|
|
362
519
|
backgroundColor: skeletonColor,
|
|
363
520
|
borderRadius: SKELETON_BORDER_RADIUS,
|
|
364
521
|
height: TEXT_LINE_HEIGHT,
|
|
365
|
-
style:
|
|
522
|
+
style: styles6.textLine,
|
|
366
523
|
width: TEXT_LINE_FULL_WIDTH
|
|
367
524
|
}
|
|
368
525
|
),
|
|
@@ -372,7 +529,7 @@ var PageSkeleton = ({
|
|
|
372
529
|
backgroundColor: skeletonColor,
|
|
373
530
|
borderRadius: SKELETON_BORDER_RADIUS,
|
|
374
531
|
height: TEXT_LINE_HEIGHT,
|
|
375
|
-
style:
|
|
532
|
+
style: styles6.textLine,
|
|
376
533
|
width: TEXT_LINE_SHORT_WIDTH
|
|
377
534
|
}
|
|
378
535
|
)
|
|
@@ -384,7 +541,7 @@ var PageSkeleton = ({
|
|
|
384
541
|
backgroundColor: skeletonColor,
|
|
385
542
|
borderRadius: CARD_BORDER_RADIUS,
|
|
386
543
|
height: CARD_HEIGHT,
|
|
387
|
-
style:
|
|
544
|
+
style: styles6.card
|
|
388
545
|
},
|
|
389
546
|
index
|
|
390
547
|
);
|
|
@@ -395,7 +552,7 @@ var PageSkeleton = ({
|
|
|
395
552
|
accessibilityHint: t("pageSkeleton.loadingHint"),
|
|
396
553
|
accessibilityLabel: t("pageSkeleton.loadingLabel"),
|
|
397
554
|
accessibilityState: { busy: true },
|
|
398
|
-
style: [
|
|
555
|
+
style: [styles6.container, { backgroundColor: colors.background }],
|
|
399
556
|
testID: FEEDBACK_TEST_IDS.pageSkeleton,
|
|
400
557
|
children: [
|
|
401
558
|
showHeader ? /* @__PURE__ */ jsx(
|
|
@@ -404,7 +561,7 @@ var PageSkeleton = ({
|
|
|
404
561
|
backgroundColor: skeletonColor,
|
|
405
562
|
borderRadius: SKELETON_BORDER_RADIUS,
|
|
406
563
|
height: HEADER_HEIGHT,
|
|
407
|
-
style:
|
|
564
|
+
style: styles6.header,
|
|
408
565
|
width: HEADER_WIDTH
|
|
409
566
|
}
|
|
410
567
|
) : null,
|
|
@@ -421,10 +578,11 @@ var AsyncSurface = ({
|
|
|
421
578
|
skeletonRows = DEFAULT_SKELETON_ROWS,
|
|
422
579
|
variant = "list",
|
|
423
580
|
message,
|
|
581
|
+
error,
|
|
424
582
|
children
|
|
425
583
|
}) => {
|
|
426
584
|
const { t } = useFeedbackUi();
|
|
427
|
-
if (isError) return /* @__PURE__ */ jsx(ErrorState, { message: message ?? t("common.loadFailed"), onRetry });
|
|
585
|
+
if (isError) return /* @__PURE__ */ jsx(ErrorState, { error, message: message ?? t("common.loadFailed"), onRetry });
|
|
428
586
|
if (loading) return /* @__PURE__ */ jsx(PageSkeleton, { showHeader: true, rows: skeletonRows, variant });
|
|
429
587
|
return children;
|
|
430
588
|
};
|
|
@@ -435,7 +593,7 @@ function confirmInk(theme, destructive) {
|
|
|
435
593
|
return resolveOnBrand(confirmFill(theme, destructive));
|
|
436
594
|
}
|
|
437
595
|
var DIALOG_MAX_WIDTH = 400;
|
|
438
|
-
var
|
|
596
|
+
var styles7 = StyleSheet.create({
|
|
439
597
|
overlay: {
|
|
440
598
|
flex: 1,
|
|
441
599
|
backgroundColor: MODAL_OVERLAY_COLOR,
|
|
@@ -527,17 +685,17 @@ var ConfirmDialog = ({
|
|
|
527
685
|
animationType: "fade",
|
|
528
686
|
visible,
|
|
529
687
|
onRequestClose: onCancel,
|
|
530
|
-
children: /* @__PURE__ */ jsx(View, { style:
|
|
688
|
+
children: /* @__PURE__ */ jsx(View, { style: styles7.overlay, testID: FEEDBACK_TEST_IDS.confirmDialog, children: /* @__PURE__ */ jsxs(
|
|
531
689
|
View,
|
|
532
690
|
{
|
|
533
691
|
accessibilityViewIsModal: true,
|
|
534
692
|
"aria-label": innerDialogRole === void 0 ? void 0 : title,
|
|
535
693
|
role: innerDialogRole,
|
|
536
|
-
style: [
|
|
694
|
+
style: [styles7.dialog, colorStyles.dialog],
|
|
537
695
|
children: [
|
|
538
|
-
/* @__PURE__ */ jsx(Text, { nativeID: titleId, style: [
|
|
539
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
540
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
696
|
+
/* @__PURE__ */ jsx(Text, { nativeID: titleId, style: [styles7.title, colorStyles.title], children: title }),
|
|
697
|
+
/* @__PURE__ */ jsx(Text, { style: [styles7.message, colorStyles.message], children: message }),
|
|
698
|
+
/* @__PURE__ */ jsxs(View, { style: styles7.buttonRow, children: [
|
|
541
699
|
/* @__PURE__ */ jsx(
|
|
542
700
|
TouchableOpacity,
|
|
543
701
|
{
|
|
@@ -545,13 +703,13 @@ var ConfirmDialog = ({
|
|
|
545
703
|
accessibilityLabel: resolvedCancelLabel,
|
|
546
704
|
accessibilityRole: "button",
|
|
547
705
|
style: [
|
|
548
|
-
|
|
549
|
-
|
|
706
|
+
styles7.button,
|
|
707
|
+
styles7.cancelButton,
|
|
550
708
|
colorStyles.cancelButton
|
|
551
709
|
],
|
|
552
710
|
testID: FEEDBACK_TEST_IDS.cancelConfirmButton,
|
|
553
711
|
onPress: onCancel,
|
|
554
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
712
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles7.buttonText, colorStyles.cancelButtonText], children: resolvedCancelLabel })
|
|
555
713
|
}
|
|
556
714
|
),
|
|
557
715
|
/* @__PURE__ */ jsx(
|
|
@@ -563,10 +721,10 @@ var ConfirmDialog = ({
|
|
|
563
721
|
accessibilityState: { disabled: isConfirmDisabled },
|
|
564
722
|
disabled: isConfirmDisabled,
|
|
565
723
|
style: [
|
|
566
|
-
|
|
567
|
-
|
|
724
|
+
styles7.button,
|
|
725
|
+
styles7.confirmButton,
|
|
568
726
|
colorStyles.confirmButton,
|
|
569
|
-
isConfirmDisabled &&
|
|
727
|
+
isConfirmDisabled && styles7.disabledButton
|
|
570
728
|
],
|
|
571
729
|
testID: FEEDBACK_TEST_IDS.confirmButton,
|
|
572
730
|
onPress: onConfirm,
|
|
@@ -580,7 +738,7 @@ var ConfirmDialog = ({
|
|
|
580
738
|
) : /* @__PURE__ */ jsx(
|
|
581
739
|
Text,
|
|
582
740
|
{
|
|
583
|
-
style: [
|
|
741
|
+
style: [styles7.buttonText, colorStyles.confirmButtonText],
|
|
584
742
|
children: resolvedConfirmLabel
|
|
585
743
|
}
|
|
586
744
|
)
|
|
@@ -648,7 +806,7 @@ var C1_CONTROL_END = 159;
|
|
|
648
806
|
var ZERO_WIDTH_START = 8203;
|
|
649
807
|
var ZERO_WIDTH_END = 8207;
|
|
650
808
|
var BYTE_ORDER_MARK = 65279;
|
|
651
|
-
var
|
|
809
|
+
var styles8 = StyleSheet.create({
|
|
652
810
|
container: {
|
|
653
811
|
position: "absolute",
|
|
654
812
|
left: TOAST_HORIZONTAL_MARGIN,
|
|
@@ -684,6 +842,7 @@ var styles7 = StyleSheet.create({
|
|
|
684
842
|
lineHeight: TOAST_GLYPH_LINE_HEIGHT,
|
|
685
843
|
fontWeight: "700"
|
|
686
844
|
},
|
|
845
|
+
body: { flexShrink: 1 },
|
|
687
846
|
text: { flexShrink: 1 }
|
|
688
847
|
});
|
|
689
848
|
function sanitizeToastText(input, maxLength) {
|
|
@@ -724,11 +883,14 @@ var ToastItem = ({ message, onDone, tone, durationMs, fadeMs, testID }) => {
|
|
|
724
883
|
{
|
|
725
884
|
accessibilityLiveRegion: isError ? "assertive" : "polite",
|
|
726
885
|
role: isError ? "alert" : "status",
|
|
727
|
-
style: [
|
|
886
|
+
style: [styles8.toast, { backgroundColor: tone.fill, borderColor: tone.border, transform: [{ translateY }], opacity }],
|
|
728
887
|
testID,
|
|
729
888
|
children: [
|
|
730
|
-
/* @__PURE__ */ jsx(View, { "aria-hidden": true, importantForAccessibility: "no-hide-descendants", style: [
|
|
731
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ jsx(View, { "aria-hidden": true, importantForAccessibility: "no-hide-descendants", style: [styles8.glyph, { borderColor: tone.ink }], children: /* @__PURE__ */ jsx(Text, { style: [styles8.glyphText, { color: tone.ink }], children: tone.glyph }) }),
|
|
890
|
+
/* @__PURE__ */ jsxs(View, { style: styles8.body, children: [
|
|
891
|
+
/* @__PURE__ */ jsx(Text, { style: [styles8.text, { color: tone.ink }], children: message.text }),
|
|
892
|
+
/* @__PURE__ */ jsx(ErrorReferenceRow, { actionColor: tone.ink, color: tone.ink, testID: `${testID}-reference`, traceId: message.traceId })
|
|
893
|
+
] })
|
|
732
894
|
]
|
|
733
895
|
}
|
|
734
896
|
);
|
|
@@ -758,7 +920,7 @@ var ToastHost = ({
|
|
|
758
920
|
);
|
|
759
921
|
const push = useCallback(
|
|
760
922
|
(toast) => {
|
|
761
|
-
setMessages((s) => [...s, { id: nextId(), type: toast.type, text: sanitizeToastText(toast.text, maxLength) }]);
|
|
923
|
+
setMessages((s) => [...s, { id: nextId(), type: toast.type, text: sanitizeToastText(toast.text, maxLength), traceId: toast.traceId }]);
|
|
762
924
|
},
|
|
763
925
|
[maxLength]
|
|
764
926
|
);
|
|
@@ -768,7 +930,7 @@ var ToastHost = ({
|
|
|
768
930
|
useEffect(() => subscribe(push), [subscribe, push]);
|
|
769
931
|
if (messages.length === 0) return null;
|
|
770
932
|
const canPortal = IS_WEB && typeof document !== "undefined";
|
|
771
|
-
const layer = /* @__PURE__ */ jsx(View, { style: [
|
|
933
|
+
const layer = /* @__PURE__ */ jsx(View, { style: [styles8.container, { top: toastTop(IS_WEB, topInset) }, canPortal ? WEB_FIXED_LAYER : null], children: messages.map((m) => /* @__PURE__ */ jsx(
|
|
772
934
|
ToastItem,
|
|
773
935
|
{
|
|
774
936
|
durationMs,
|
|
@@ -844,7 +1006,7 @@ var SUBTITLE_FONT_SIZE = 15;
|
|
|
844
1006
|
var ATTEMPT_FONT_SIZE = 13;
|
|
845
1007
|
var CARD_PADDING = 24;
|
|
846
1008
|
var NO_ATTEMPT = 0;
|
|
847
|
-
var
|
|
1009
|
+
var styles9 = StyleSheet.create({
|
|
848
1010
|
overlay: {
|
|
849
1011
|
position: "absolute",
|
|
850
1012
|
top: 0,
|
|
@@ -901,13 +1063,13 @@ var WarmingOverlay = ({
|
|
|
901
1063
|
{
|
|
902
1064
|
accessibilityLabel: mergedLabels.accessibilityLabel,
|
|
903
1065
|
accessibilityRole: "alert",
|
|
904
|
-
style: [
|
|
1066
|
+
style: [styles9.overlay, { backgroundColor: colors.background }],
|
|
905
1067
|
testID: testIdPrefix,
|
|
906
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
1068
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles9.card, children: [
|
|
907
1069
|
/* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size: "large" }),
|
|
908
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
909
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
910
|
-
showHint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1070
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.title, { color: colors.text }], testID: `${testIdPrefix}-title`, children: mergedLabels.title }),
|
|
1071
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.subtitle, { color: colors.textSecondary }], testID: `${testIdPrefix}-subtitle`, children: mergedLabels.subtitle }),
|
|
1072
|
+
showHint ? /* @__PURE__ */ jsx(Text, { style: [styles9.attempt, { color: colors.textSecondary }], testID: `${testIdPrefix}-attempt`, children: mergedLabels.attemptHint(snapshot2.attempt) }) : null
|
|
911
1073
|
] })
|
|
912
1074
|
}
|
|
913
1075
|
);
|
|
@@ -917,22 +1079,27 @@ var WarmingOverlay = ({
|
|
|
917
1079
|
var DEFAULT_TOAST_TYPE = "info";
|
|
918
1080
|
function createToastBus() {
|
|
919
1081
|
const listeners2 = /* @__PURE__ */ new Set();
|
|
1082
|
+
const push = (toast) => {
|
|
1083
|
+
for (const listener of [...listeners2]) listener(toast);
|
|
1084
|
+
};
|
|
920
1085
|
const emit2 = (text, type = DEFAULT_TOAST_TYPE) => {
|
|
921
|
-
|
|
1086
|
+
push({ text, type });
|
|
922
1087
|
};
|
|
923
1088
|
return {
|
|
924
|
-
subscribe(
|
|
925
|
-
listeners2.add(
|
|
1089
|
+
subscribe(push2) {
|
|
1090
|
+
listeners2.add(push2);
|
|
926
1091
|
return () => {
|
|
927
|
-
listeners2.delete(
|
|
1092
|
+
listeners2.delete(push2);
|
|
928
1093
|
};
|
|
929
1094
|
},
|
|
930
1095
|
emit: emit2,
|
|
931
1096
|
success(text) {
|
|
932
1097
|
emit2(text, "success");
|
|
933
1098
|
},
|
|
934
|
-
error(text) {
|
|
935
|
-
|
|
1099
|
+
error(text, cause) {
|
|
1100
|
+
const traceId = readTraceId(cause);
|
|
1101
|
+
if (traceId === void 0) emit2(text, "error");
|
|
1102
|
+
else push({ text, type: "error", traceId });
|
|
936
1103
|
},
|
|
937
1104
|
info(text) {
|
|
938
1105
|
emit2(text, "info");
|
|
@@ -955,7 +1122,7 @@ var BUTTON_PADDING_V3 = 12;
|
|
|
955
1122
|
var BUTTON_BORDER_RADIUS3 = 8;
|
|
956
1123
|
var BUTTON_MARGIN_TOP3 = 12;
|
|
957
1124
|
var BUTTON_FONT_SIZE3 = 16;
|
|
958
|
-
var
|
|
1125
|
+
var styles10 = StyleSheet.create({
|
|
959
1126
|
container: {
|
|
960
1127
|
flex: 1,
|
|
961
1128
|
justifyContent: "center",
|
|
@@ -1023,10 +1190,10 @@ var ErrorBoundaryFallback = ({
|
|
|
1023
1190
|
accessibilityHint: labels.tryAgainHint,
|
|
1024
1191
|
accessibilityLabel: labels.tryAgain,
|
|
1025
1192
|
accessibilityRole: "button",
|
|
1026
|
-
style: [
|
|
1193
|
+
style: [styles10.button, reloadIsPrimary ? secondaryFill : primaryFill],
|
|
1027
1194
|
testID: `${testIDPrefix}-retry-button`,
|
|
1028
1195
|
onPress: onRetry,
|
|
1029
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1196
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles10.buttonText, reloadIsPrimary ? secondaryInk : primaryInk], children: labels.tryAgain })
|
|
1030
1197
|
}
|
|
1031
1198
|
) : null;
|
|
1032
1199
|
const reloadButton = typeof onReload === "function" ? /* @__PURE__ */ jsx(
|
|
@@ -1035,10 +1202,10 @@ var ErrorBoundaryFallback = ({
|
|
|
1035
1202
|
accessibilityHint: labels.reloadHint,
|
|
1036
1203
|
accessibilityLabel: labels.reload,
|
|
1037
1204
|
accessibilityRole: "button",
|
|
1038
|
-
style: [
|
|
1205
|
+
style: [styles10.button, reloadIsPrimary ? primaryFill : secondaryFill],
|
|
1039
1206
|
testID: `${testIDPrefix}-reload-button`,
|
|
1040
1207
|
onPress: onReload,
|
|
1041
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1208
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles10.buttonText, reloadIsPrimary ? primaryInk : secondaryInk], children: labels.reload })
|
|
1042
1209
|
}
|
|
1043
1210
|
) : null;
|
|
1044
1211
|
return /* @__PURE__ */ jsx(
|
|
@@ -1046,19 +1213,19 @@ var ErrorBoundaryFallback = ({
|
|
|
1046
1213
|
{
|
|
1047
1214
|
accessibilityLiveRegion: "assertive",
|
|
1048
1215
|
role: "alert",
|
|
1049
|
-
style: [
|
|
1216
|
+
style: [styles10.container, { backgroundColor: theme.colors.background }],
|
|
1050
1217
|
testID: testIDPrefix,
|
|
1051
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
1052
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1218
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles10.content, children: [
|
|
1219
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.title, { color: theme.colors.text }], children: labels.title }),
|
|
1053
1220
|
/* @__PURE__ */ jsx(ErrorState, { message: labels.message, testID: `${testIDPrefix}-message` }),
|
|
1054
1221
|
hasDetails ? /* @__PURE__ */ jsxs(
|
|
1055
1222
|
View,
|
|
1056
1223
|
{
|
|
1057
|
-
style: [
|
|
1224
|
+
style: [styles10.details, { backgroundColor: theme.colors.surface, borderColor: warningColor }],
|
|
1058
1225
|
testID: `${testIDPrefix}-details`,
|
|
1059
1226
|
children: [
|
|
1060
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1061
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1227
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.detailsTitle, { color: warningColor }], children: labels.errorDetails }),
|
|
1228
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.detailsText, { color: theme.colors.textSecondary }], children: error.message })
|
|
1062
1229
|
]
|
|
1063
1230
|
}
|
|
1064
1231
|
) : null,
|
|
@@ -1071,7 +1238,7 @@ var ErrorBoundaryFallback = ({
|
|
|
1071
1238
|
var CONTAINER_PADDING4 = 20;
|
|
1072
1239
|
var MESSAGE_FONT_SIZE3 = 16;
|
|
1073
1240
|
var MESSAGE_MARGIN_TOP = 12;
|
|
1074
|
-
var
|
|
1241
|
+
var styles11 = StyleSheet.create({
|
|
1075
1242
|
container: {
|
|
1076
1243
|
flex: 1,
|
|
1077
1244
|
justifyContent: "center",
|
|
@@ -1094,11 +1261,11 @@ var ErrorBoundaryRecovering = ({
|
|
|
1094
1261
|
{
|
|
1095
1262
|
accessibilityLiveRegion: "polite",
|
|
1096
1263
|
role: "status",
|
|
1097
|
-
style: [
|
|
1264
|
+
style: [styles11.container, { backgroundColor: theme.colors.background }],
|
|
1098
1265
|
testID,
|
|
1099
1266
|
children: [
|
|
1100
1267
|
/* @__PURE__ */ jsx(ActivityIndicator, { color: theme.palette.primary["500"], size: "large" }),
|
|
1101
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1268
|
+
/* @__PURE__ */ jsx(Text, { style: [styles11.message, { color: theme.colors.textSecondary }], children: message })
|
|
1102
1269
|
]
|
|
1103
1270
|
}
|
|
1104
1271
|
);
|
|
@@ -1188,7 +1355,7 @@ var TRACK_MARGIN = 4;
|
|
|
1188
1355
|
var INDET_FRACTION = 0.35;
|
|
1189
1356
|
var INDET_DURATION_MS = 1300;
|
|
1190
1357
|
var LABEL_FONT_SIZE = 12;
|
|
1191
|
-
var
|
|
1358
|
+
var styles12 = StyleSheet.create({
|
|
1192
1359
|
track: { height: BAR_HEIGHT, borderRadius: RADIUS, overflow: "hidden", marginVertical: TRACK_MARGIN },
|
|
1193
1360
|
fill: { height: "100%", borderRadius: RADIUS },
|
|
1194
1361
|
label: { fontSize: LABEL_FONT_SIZE, textAlign: "right", fontVariant: ["tabular-nums"] }
|
|
@@ -1207,7 +1374,7 @@ function IndeterminateFill({ color, width, testID }) {
|
|
|
1207
1374
|
return /* @__PURE__ */ jsx(
|
|
1208
1375
|
Animated.View,
|
|
1209
1376
|
{
|
|
1210
|
-
style: [
|
|
1377
|
+
style: [styles12.fill, { backgroundColor: color, width: barWidth, transform: [{ translateX }] }],
|
|
1211
1378
|
testID
|
|
1212
1379
|
}
|
|
1213
1380
|
);
|
|
@@ -1242,13 +1409,13 @@ function ProgressBar(props) {
|
|
|
1242
1409
|
role: "progressbar",
|
|
1243
1410
|
testID,
|
|
1244
1411
|
children: [
|
|
1245
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
1246
|
-
!indeterminate && label !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1412
|
+
/* @__PURE__ */ jsx(View, { style: [styles12.track, { backgroundColor: trackColor }], onLayout, children: indeterminate ? /* @__PURE__ */ jsx(IndeterminateFill, { color, testID: fillTestID, width }) : /* @__PURE__ */ jsx(View, { style: [styles12.fill, { backgroundColor: color, width: `${safePct}%` }], testID: fillTestID }) }),
|
|
1413
|
+
!indeterminate && label !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [styles12.label, { color: textColor }], children: label }) : null
|
|
1247
1414
|
]
|
|
1248
1415
|
}
|
|
1249
1416
|
);
|
|
1250
1417
|
}
|
|
1251
|
-
var
|
|
1418
|
+
var styles13 = StyleSheet.create({
|
|
1252
1419
|
button: {
|
|
1253
1420
|
minHeight: MIN_TOUCH_TARGET_PX,
|
|
1254
1421
|
minWidth: MIN_TOUCH_TARGET_PX,
|
|
@@ -1271,9 +1438,9 @@ function RunCardButton({ label, hint, color, onPress, testID, disabled = false,
|
|
|
1271
1438
|
accessibilityState: { disabled, expanded },
|
|
1272
1439
|
disabled,
|
|
1273
1440
|
onPress,
|
|
1274
|
-
style: [
|
|
1441
|
+
style: [styles13.button, { borderColor: color }, disabled ? { opacity: DISABLED_OPACITY } : null],
|
|
1275
1442
|
testID,
|
|
1276
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1443
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles13.text, { color }], children: label })
|
|
1277
1444
|
}
|
|
1278
1445
|
);
|
|
1279
1446
|
}
|
|
@@ -1342,7 +1509,7 @@ function runToneColor(theme, state) {
|
|
|
1342
1509
|
return theme.colors.textSecondary;
|
|
1343
1510
|
}
|
|
1344
1511
|
var MARK = { done: "\u2713", running: "\u25CF", pending: "\u25CB", failed: "\u2715" };
|
|
1345
|
-
var
|
|
1512
|
+
var styles14 = StyleSheet.create({
|
|
1346
1513
|
row: { flexDirection: "row", flexWrap: "wrap", gap: 6 },
|
|
1347
1514
|
chip: { borderWidth: 1, borderRadius: 6, paddingHorizontal: 10, justifyContent: "center" },
|
|
1348
1515
|
tap: { minHeight: MIN_TOUCH_TARGET_PX },
|
|
@@ -1355,14 +1522,14 @@ function chipText(group, labels) {
|
|
|
1355
1522
|
}
|
|
1356
1523
|
function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect }) {
|
|
1357
1524
|
const { theme } = useFeedbackUi();
|
|
1358
|
-
return /* @__PURE__ */ jsx(View, { style:
|
|
1525
|
+
return /* @__PURE__ */ jsx(View, { style: styles14.row, testID, children: groups.map((group) => {
|
|
1359
1526
|
const color = runToneColor(theme, group.state);
|
|
1360
1527
|
const selected = group.id === selectedId;
|
|
1361
1528
|
const a11y = labels.groupA11y(group.label, group.state, labels.formatDuration(group.durationSec));
|
|
1362
|
-
const body = /* @__PURE__ */ jsx(Text, { style: [
|
|
1363
|
-
const look = [
|
|
1529
|
+
const body = /* @__PURE__ */ jsx(Text, { style: [styles14.text, { color }, selected || group.state === "running" ? styles14.strong : null], children: chipText(group, labels) });
|
|
1530
|
+
const look = [styles14.chip, { borderColor: color, backgroundColor: selected ? theme.colors.surfaceElevated : theme.colors.surface }];
|
|
1364
1531
|
if (onSelect === void 0) {
|
|
1365
|
-
return /* @__PURE__ */ jsx(View, { style: [look,
|
|
1532
|
+
return /* @__PURE__ */ jsx(View, { style: [look, styles14.still], accessible: true, accessibilityLabel: a11y, testID: `${testID}-${group.id}`, children: body }, group.id);
|
|
1366
1533
|
}
|
|
1367
1534
|
return /* @__PURE__ */ jsx(
|
|
1368
1535
|
Pressable,
|
|
@@ -1372,7 +1539,7 @@ function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect })
|
|
|
1372
1539
|
accessibilityHint: labels.groupHint,
|
|
1373
1540
|
accessibilityState: { selected },
|
|
1374
1541
|
onPress: () => onSelect(group.id),
|
|
1375
|
-
style: [look,
|
|
1542
|
+
style: [look, styles14.tap],
|
|
1376
1543
|
testID: `${testID}-${group.id}`,
|
|
1377
1544
|
children: body
|
|
1378
1545
|
},
|
|
@@ -1386,8 +1553,8 @@ function RunGroupSummary({ groups, labels, testID }) {
|
|
|
1386
1553
|
const open = groups.filter((g) => g.state !== "done");
|
|
1387
1554
|
const doneColor = runToneColor(theme, "done");
|
|
1388
1555
|
const doneText = labels.doneSummary(done.count, labels.formatDuration(done.durationSec));
|
|
1389
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1390
|
-
done.count > 0 ? /* @__PURE__ */ jsx(View, { style: [
|
|
1556
|
+
return /* @__PURE__ */ jsxs(View, { style: styles14.row, testID, children: [
|
|
1557
|
+
done.count > 0 ? /* @__PURE__ */ jsx(View, { style: [styles14.chip, styles14.still, { borderColor: doneColor }], accessible: true, accessibilityLabel: doneText, testID: `${testID}-done`, children: /* @__PURE__ */ jsx(Text, { style: [styles14.text, { color: doneColor }], children: `${MARK.done} ${doneText}` }) }) : null,
|
|
1391
1558
|
/* @__PURE__ */ jsx(RunGroupChips, { groups: open, labels, testID: `${testID}-open` })
|
|
1392
1559
|
] });
|
|
1393
1560
|
}
|
|
@@ -1397,7 +1564,7 @@ var LABEL_SHARE = "35%";
|
|
|
1397
1564
|
var LABEL_LINES = 2;
|
|
1398
1565
|
var DURATION_WIDTH = 64;
|
|
1399
1566
|
var PERCENT = 100;
|
|
1400
|
-
var
|
|
1567
|
+
var styles15 = StyleSheet.create({
|
|
1401
1568
|
list: { gap: 6 },
|
|
1402
1569
|
row: { flexDirection: "row", alignItems: "center", gap: 8 },
|
|
1403
1570
|
stack: { gap: 4 },
|
|
@@ -1416,22 +1583,22 @@ function RunStepBars({ steps, maxBars, labels, compact, testID }) {
|
|
|
1416
1583
|
const maxSec = steps.reduce((m, s) => Math.max(m, s.durationSec), 0);
|
|
1417
1584
|
const folded = split.hiddenCount > 0;
|
|
1418
1585
|
const canFold = all && steps.length > maxBars;
|
|
1419
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1586
|
+
return /* @__PURE__ */ jsxs(View, { style: styles15.list, testID, children: [
|
|
1420
1587
|
split.visible.map((step, i) => {
|
|
1421
1588
|
const color = runToneColor(theme, step.state);
|
|
1422
1589
|
const duration = labels.formatDuration(step.durationSec);
|
|
1423
|
-
const strong = step.state === "running" ?
|
|
1424
|
-
const name = /* @__PURE__ */ jsx(Text, { style: [compact ?
|
|
1425
|
-
const time = /* @__PURE__ */ jsx(Text, { style: [
|
|
1426
|
-
const bar = /* @__PURE__ */ jsx(View, { style: [compact ?
|
|
1590
|
+
const strong = step.state === "running" ? styles15.strong : null;
|
|
1591
|
+
const name = /* @__PURE__ */ jsx(Text, { style: [compact ? styles15.compactLabel : styles15.label, { color: theme.colors.text }, strong], numberOfLines: LABEL_LINES, testID: `${testID}-name-${String(i)}`, children: step.label });
|
|
1592
|
+
const time = /* @__PURE__ */ jsx(Text, { style: [styles15.duration, { color: theme.colors.textSecondary }, strong], children: duration });
|
|
1593
|
+
const bar = /* @__PURE__ */ jsx(View, { style: [compact ? styles15.fullTrack : styles15.track, { backgroundColor: theme.colors.border }], children: /* @__PURE__ */ jsx(View, { style: [styles15.fill, { backgroundColor: color, width: `${barFraction(step.durationSec, maxSec) * PERCENT}%` }] }) });
|
|
1427
1594
|
const a11y = { accessible: true, accessibilityLabel: labels.stepA11y(step.label, duration), testID: `${testID}-row-${String(i)}` };
|
|
1428
|
-
return compact ? /* @__PURE__ */ jsxs(View, { style:
|
|
1429
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1595
|
+
return compact ? /* @__PURE__ */ jsxs(View, { style: styles15.stack, ...a11y, children: [
|
|
1596
|
+
/* @__PURE__ */ jsxs(View, { style: styles15.row, children: [
|
|
1430
1597
|
name,
|
|
1431
1598
|
time
|
|
1432
1599
|
] }),
|
|
1433
1600
|
bar
|
|
1434
|
-
] }, `${step.label}-${String(i)}`) : /* @__PURE__ */ jsxs(View, { style:
|
|
1601
|
+
] }, `${step.label}-${String(i)}`) : /* @__PURE__ */ jsxs(View, { style: styles15.row, ...a11y, children: [
|
|
1435
1602
|
name,
|
|
1436
1603
|
bar,
|
|
1437
1604
|
time
|
|
@@ -1452,7 +1619,7 @@ function RunStepBars({ steps, maxBars, labels, compact, testID }) {
|
|
|
1452
1619
|
}
|
|
1453
1620
|
var LIVE_RUN_CARD_COMPACT_MAX_PX = 640;
|
|
1454
1621
|
var DEFAULT_MAX_BARS = 4;
|
|
1455
|
-
var
|
|
1622
|
+
var styles16 = StyleSheet.create({
|
|
1456
1623
|
card: { borderWidth: 1, borderRadius: 8, padding: 14, gap: 10 },
|
|
1457
1624
|
head: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 10 },
|
|
1458
1625
|
titleBox: { flexGrow: 1, flexShrink: 1, flexBasis: 200, minWidth: 0, gap: 2 },
|
|
@@ -1476,18 +1643,18 @@ function LiveRunCard(props) {
|
|
|
1476
1643
|
const percent = progressPercent(progress);
|
|
1477
1644
|
const showTimings = !compact || open;
|
|
1478
1645
|
const muted = { color: theme.colors.textSecondary };
|
|
1479
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
1480
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1481
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
1482
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1483
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1484
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1646
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles16.card, { borderColor: tone, backgroundColor: theme.colors.surface }], testID, children: [
|
|
1647
|
+
/* @__PURE__ */ jsxs(View, { style: styles16.head, children: [
|
|
1648
|
+
/* @__PURE__ */ jsx(View, { style: [styles16.pill, { borderColor: tone }], children: /* @__PURE__ */ jsx(Text, { style: [styles16.pillText, { color: tone }], testID: `${testID}-status`, children: labels.status }) }),
|
|
1649
|
+
/* @__PURE__ */ jsxs(View, { style: styles16.titleBox, children: [
|
|
1650
|
+
/* @__PURE__ */ jsx(Text, { style: [styles16.title, { color: theme.colors.text }], testID: `${testID}-title`, children: title }),
|
|
1651
|
+
/* @__PURE__ */ jsx(Text, { style: [styles16.meta, muted], testID: `${testID}-meta`, children: labels.meta })
|
|
1485
1652
|
] }),
|
|
1486
1653
|
onCancel !== void 0 ? /* @__PURE__ */ jsx(RunCardButton, { label: labels.cancel, hint: labels.cancelHint, color: theme.semantic.error["500"], onPress: onCancel, disabled: cancelDisabled, testID: `${testID}-cancel` }) : null
|
|
1487
1654
|
] }),
|
|
1488
|
-
currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1655
|
+
currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsx(Text, { style: [styles16.step, { color: theme.colors.text }], testID: `${testID}-step`, children: currentStep }) : null,
|
|
1489
1656
|
percent !== null ? /* @__PURE__ */ jsx(ProgressBar, { percent, label: labels.progress, accessibilityLabel: labels.progressA11y, color: tone, testID: `${testID}-progress` }) : null,
|
|
1490
|
-
percent === null && labels.progress !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1657
|
+
percent === null && labels.progress !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [styles16.meta, muted], testID: `${testID}-progress-text`, children: labels.progress }) : null,
|
|
1491
1658
|
compact && !open ? /* @__PURE__ */ jsx(RunGroupSummary, { groups, labels, testID: `${testID}-summary` }) : null,
|
|
1492
1659
|
compact ? /* @__PURE__ */ jsx(RunCardButton, { label: labels.stepTimings, hint: labels.stepTimingsHint, color: theme.colors.textSecondary, onPress: () => setOpen(!open), expanded: open, testID: `${testID}-timings-toggle` }) : null,
|
|
1493
1660
|
showTimings ? /* @__PURE__ */ jsx(RunGroupChips, { groups, labels, selectedId, onSelect: setPicked, testID: `${testID}-groups` }) : null,
|
|
@@ -1495,6 +1662,6 @@ function LiveRunCard(props) {
|
|
|
1495
1662
|
] });
|
|
1496
1663
|
}
|
|
1497
1664
|
|
|
1498
|
-
export { AppErrorBoundary, AsyncSurface, ConfirmDialog, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, ErrorState, FEEDBACK_TEST_IDS, FeedbackUiProvider, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, LoadingFallback, MODAL_OVERLAY_COLOR, PageSkeleton, ProgressBar, ToastHost, FeedbackUiProvider as UiProvider, WARMING_QUIET_PERIOD_MS, WarmingOverlay, barFraction, clampPercent, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useFeedbackUi, useFeedbackUi as useUi };
|
|
1665
|
+
export { AppErrorBoundary, AsyncSurface, COPY_FEEDBACK_MS, ConfirmDialog, CopyStatus, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, ErrorReferenceRow, ErrorState, FEEDBACK_TEST_IDS, FeedbackUiProvider, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, LoadingFallback, MODAL_OVERLAY_COLOR, PageSkeleton, ProgressBar, ToastHost, FeedbackUiProvider as UiProvider, WARMING_QUIET_PERIOD_MS, WarmingOverlay, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useFeedbackUi as useUi };
|
|
1499
1666
|
//# sourceMappingURL=index.mjs.map
|
|
1500
1667
|
//# sourceMappingURL=index.mjs.map
|