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