@dloizides/ui-feedback 1.17.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/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 styles = reactNative.StyleSheet.create({
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: styles.well, testID, children: [
107
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles.wellTint, { backgroundColor: tint }] }),
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: [styles.secondaryButton, { borderColor: theme.colors.border }],
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: [styles.secondaryText, { color: theme.colors.text }], children: action.label })
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 styles2 = reactNative.StyleSheet.create({
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: [styles2.retryButton, { backgroundColor: primary }],
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: [styles2.retryText, { color: theme.colors.surfaceElevated }], children: t("common.retry") })
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: styles2.container, testID, children: [
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: [styles2.title, { color: theme.colors.text }],
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: [styles2.message, { color: messageColor }], children: message }),
210
- secondaryAction === void 0 ? retry : /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles2.actions, children: [
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 styles3 = reactNative.StyleSheet.create({
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: styles3.container, testID, children: [
260
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles3.message, { color: colors.textSecondary }], children: t(messageKey) }),
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: [styles3.ctaButton, { backgroundColor: primary }],
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: [styles3.ctaText, { color: colors.background }], children: t(ctaTextKey) })
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 styles4 = reactNative.StyleSheet.create({
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: [styles4.container, fullScreen && styles4.fullScreen, { backgroundColor: colors.background }],
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 styles5 = reactNative.StyleSheet.create({
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: styles5.row, children: [
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: styles5.avatar,
513
+ style: styles6.avatar,
357
514
  width: AVATAR_SIZE
358
515
  }
359
516
  ),
360
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles5.textContainer, children: [
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: styles5.textLine,
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: styles5.textLine,
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: styles5.card
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: [styles5.container, { backgroundColor: colors.background }],
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: styles5.header,
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 styles6 = reactNative.StyleSheet.create({
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: styles6.overlay, testID: FEEDBACK_TEST_IDS.confirmDialog, children: /* @__PURE__ */ jsxRuntime.jsxs(
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: [styles6.dialog, colorStyles.dialog],
696
+ style: [styles7.dialog, colorStyles.dialog],
539
697
  children: [
540
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { nativeID: titleId, style: [styles6.title, colorStyles.title], children: title }),
541
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.message, colorStyles.message], children: message }),
542
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles6.buttonRow, children: [
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
- styles6.button,
551
- styles6.cancelButton,
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: [styles6.buttonText, colorStyles.cancelButtonText], children: resolvedCancelLabel })
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
- styles6.button,
569
- styles6.confirmButton,
726
+ styles7.button,
727
+ styles7.confirmButton,
570
728
  colorStyles.confirmButton,
571
- isConfirmDisabled && styles6.disabledButton
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: [styles6.buttonText, colorStyles.confirmButtonText],
743
+ style: [styles7.buttonText, colorStyles.confirmButtonText],
586
744
  children: resolvedConfirmLabel
587
745
  }
588
746
  )
@@ -595,13 +753,43 @@ var ConfirmDialog = ({
595
753
  }
596
754
  );
597
755
  };
756
+ var APP_HEADER_HEIGHT = 64;
757
+ var HEADER_GAP = 8;
758
+ var TOAST_TOP_MOBILE = 40;
759
+ var TOAST_TOP_WEB = APP_HEADER_HEIGHT + HEADER_GAP;
760
+ var GLYPHS = {
761
+ success: "\u2713",
762
+ error: "!",
763
+ info: "i"
764
+ };
765
+ function scaleFor(theme, type) {
766
+ if (type === "error") return theme.semantic.error;
767
+ if (type === "success") return theme.semantic.success ?? theme.palette.primary;
768
+ return theme.palette.primary;
769
+ }
770
+ function readableInk(fill) {
771
+ if (fill === void 0 || !designTokens.isHexColor(fill) || !designTokens.canCarryAccessibleInk(fill)) return null;
772
+ return designTokens.resolveOnBrand(fill);
773
+ }
774
+ function resolveToastTone(theme, type = "info") {
775
+ const scale2 = scaleFor(theme, type);
776
+ const glyph = GLYPHS[type];
777
+ const deep = scale2[designTokens.UI_DEEP_STEP];
778
+ for (const fill of [scale2[designTokens.UI_MAIN_STEP], deep]) {
779
+ const ink = readableInk(fill);
780
+ if (ink !== null && fill !== void 0) return { fill, ink, border: fill, glyph };
781
+ }
782
+ return { fill: theme.colors.surfaceElevated, ink: theme.colors.text, border: scale2[designTokens.UI_MAIN_STEP], glyph };
783
+ }
784
+ function toastTop(isWeb, topInset) {
785
+ if (topInset !== void 0) return topInset;
786
+ return isWeb ? TOAST_TOP_WEB : TOAST_TOP_MOBILE;
787
+ }
598
788
  var IS_WEB = reactNative.Platform.OS === "web";
599
789
  var WEB_FIXED_LAYER = { position: "fixed" };
600
790
  var DEFAULT_DURATION_MS = 3e3;
601
791
  var DEFAULT_FADE_MS = 200;
602
792
  var DEFAULT_MAX_LENGTH = 500;
603
- var TOAST_TOP_WEB = 10;
604
- var TOAST_TOP_MOBILE = 40;
605
793
  var TOAST_HORIZONTAL_MARGIN = 10;
606
794
  var TOAST_INITIAL_TRANSLATE_Y = -6;
607
795
  var TOAST_MAX_WIDTH = 600;
@@ -609,16 +797,20 @@ var TOAST_PADDING_HORIZONTAL = 16;
609
797
  var TOAST_PADDING_VERTICAL = 10;
610
798
  var TOAST_BORDER_RADIUS = 8;
611
799
  var TOAST_MARGIN_VERTICAL = 6;
800
+ var TOAST_GLYPH_SIZE = 20;
801
+ var TOAST_GLYPH_FONT_SIZE = 12;
802
+ var TOAST_GLYPH_LINE_HEIGHT = 18;
803
+ var TOAST_GLYPH_GAP = 10;
804
+ var TOAST_GLYPH_BORDER = 1.5;
612
805
  var C0_CONTROL_END = 31;
613
806
  var C1_CONTROL_START = 127;
614
807
  var C1_CONTROL_END = 159;
615
808
  var ZERO_WIDTH_START = 8203;
616
809
  var ZERO_WIDTH_END = 8207;
617
810
  var BYTE_ORDER_MARK = 65279;
618
- var styles7 = reactNative.StyleSheet.create({
811
+ var styles8 = reactNative.StyleSheet.create({
619
812
  container: {
620
813
  position: "absolute",
621
- top: reactNative.Platform.OS === "web" ? TOAST_TOP_WEB : TOAST_TOP_MOBILE,
622
814
  left: TOAST_HORIZONTAL_MARGIN,
623
815
  right: TOAST_HORIZONTAL_MARGIN,
624
816
  alignItems: "center",
@@ -633,9 +825,27 @@ var styles7 = reactNative.StyleSheet.create({
633
825
  minWidth: "40%",
634
826
  maxWidth: TOAST_MAX_WIDTH,
635
827
  boxShadow: "0px 2px 4px rgba(0, 0, 0, 0.2)",
636
- elevation: 4
828
+ elevation: 4,
829
+ flexDirection: "row",
830
+ alignItems: "center",
831
+ gap: TOAST_GLYPH_GAP,
832
+ borderWidth: 1
833
+ },
834
+ glyph: {
835
+ width: TOAST_GLYPH_SIZE,
836
+ height: TOAST_GLYPH_SIZE,
837
+ borderRadius: TOAST_GLYPH_SIZE / 2,
838
+ borderWidth: TOAST_GLYPH_BORDER,
839
+ alignItems: "center",
840
+ justifyContent: "center"
637
841
  },
638
- text: {}
842
+ glyphText: {
843
+ fontSize: TOAST_GLYPH_FONT_SIZE,
844
+ lineHeight: TOAST_GLYPH_LINE_HEIGHT,
845
+ fontWeight: "700"
846
+ },
847
+ body: { flexShrink: 1 },
848
+ text: { flexShrink: 1 }
639
849
  });
640
850
  function sanitizeToastText(input, maxLength) {
641
851
  let stripped = "";
@@ -647,16 +857,11 @@ function sanitizeToastText(input, maxLength) {
647
857
  }
648
858
  return stripped.length > maxLength ? stripped.slice(0, maxLength) : stripped;
649
859
  }
650
- var ToastItem = ({ message, onDone, colors, durationMs, fadeMs, testID }) => {
860
+ var ToastItem = ({ message, onDone, tone, durationMs, fadeMs, testID }) => {
651
861
  const opacityRef = react.useRef(new reactNative.Animated.Value(0));
652
862
  const translateYRef = react.useRef(new reactNative.Animated.Value(TOAST_INITIAL_TRANSLATE_Y));
653
863
  const opacity = opacityRef.current;
654
864
  const translateY = translateYRef.current;
655
- const backgroundColor = react.useMemo(() => {
656
- if (message.type === "success") return colors.success;
657
- if (message.type === "error") return colors.error;
658
- return colors.primary;
659
- }, [colors.error, colors.primary, colors.success, message.type]);
660
865
  const handleDone = react.useCallback(() => {
661
866
  onDone(message.id);
662
867
  }, [message.id, onDone]);
@@ -675,14 +880,20 @@ var ToastItem = ({ message, onDone, colors, durationMs, fadeMs, testID }) => {
675
880
  return () => clearTimeout(hideTimer);
676
881
  }, [handleDone, opacity, translateY, durationMs, fadeMs]);
677
882
  const isError = message.type === "error";
678
- return /* @__PURE__ */ jsxRuntime.jsx(
883
+ return /* @__PURE__ */ jsxRuntime.jsxs(
679
884
  reactNative.Animated.View,
680
885
  {
681
886
  accessibilityLiveRegion: isError ? "assertive" : "polite",
682
887
  role: isError ? "alert" : "status",
683
- style: [styles7.toast, { backgroundColor, transform: [{ translateY }], opacity }],
888
+ style: [styles8.toast, { backgroundColor: tone.fill, borderColor: tone.border, transform: [{ translateY }], opacity }],
684
889
  testID,
685
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles7.text, { color: colors.text }], children: message.text })
890
+ children: [
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
+ ] })
896
+ ]
686
897
  }
687
898
  );
688
899
  };
@@ -696,22 +907,22 @@ var ToastHost = ({
696
907
  durationMs = DEFAULT_DURATION_MS,
697
908
  fadeMs = DEFAULT_FADE_MS,
698
909
  maxLength = DEFAULT_MAX_LENGTH,
699
- toastTestID = FEEDBACK_TEST_IDS.notificationToast
910
+ toastTestID = FEEDBACK_TEST_IDS.notificationToast,
911
+ topInset
700
912
  }) => {
701
913
  const [messages, setMessages] = react.useState([]);
702
914
  const { theme } = useFeedbackUi();
703
- const colors = react.useMemo(
915
+ const tones = react.useMemo(
704
916
  () => ({
705
- primary: theme.palette.primary["500"],
706
- success: (theme.semantic.success ?? theme.semantic.error)["500"],
707
- error: theme.semantic.error["500"],
708
- text: theme.colors.surfaceElevated
917
+ success: resolveToastTone(theme, "success"),
918
+ error: resolveToastTone(theme, "error"),
919
+ info: resolveToastTone(theme, "info")
709
920
  }),
710
921
  [theme]
711
922
  );
712
923
  const push = react.useCallback(
713
924
  (toast) => {
714
- 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 }]);
715
926
  },
716
927
  [maxLength]
717
928
  );
@@ -721,14 +932,14 @@ var ToastHost = ({
721
932
  react.useEffect(() => subscribe(push), [subscribe, push]);
722
933
  if (messages.length === 0) return null;
723
934
  const canPortal = IS_WEB && typeof document !== "undefined";
724
- const layer = /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles7.container, canPortal ? WEB_FIXED_LAYER : null], children: messages.map((m) => /* @__PURE__ */ jsxRuntime.jsx(
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(
725
936
  ToastItem,
726
937
  {
727
- colors,
728
938
  durationMs,
729
939
  fadeMs,
730
940
  message: m,
731
941
  testID: toastTestID,
942
+ tone: tones[m.type ?? "info"],
732
943
  onDone: remove
733
944
  },
734
945
  m.id
@@ -797,7 +1008,7 @@ var SUBTITLE_FONT_SIZE = 15;
797
1008
  var ATTEMPT_FONT_SIZE = 13;
798
1009
  var CARD_PADDING = 24;
799
1010
  var NO_ATTEMPT = 0;
800
- var styles8 = reactNative.StyleSheet.create({
1011
+ var styles9 = reactNative.StyleSheet.create({
801
1012
  overlay: {
802
1013
  position: "absolute",
803
1014
  top: 0,
@@ -854,13 +1065,13 @@ var WarmingOverlay = ({
854
1065
  {
855
1066
  accessibilityLabel: mergedLabels.accessibilityLabel,
856
1067
  accessibilityRole: "alert",
857
- style: [styles8.overlay, { backgroundColor: colors.background }],
1068
+ style: [styles9.overlay, { backgroundColor: colors.background }],
858
1069
  testID: testIdPrefix,
859
- children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles8.card, children: [
1070
+ children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles9.card, children: [
860
1071
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: primary, size: "large" }),
861
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.title, { color: colors.text }], testID: `${testIdPrefix}-title`, children: mergedLabels.title }),
862
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.subtitle, { color: colors.textSecondary }], testID: `${testIdPrefix}-subtitle`, children: mergedLabels.subtitle }),
863
- showHint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.attempt, { color: colors.textSecondary }], testID: `${testIdPrefix}-attempt`, children: mergedLabels.attemptHint(snapshot2.attempt) }) : null
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
864
1075
  ] })
865
1076
  }
866
1077
  );
@@ -870,22 +1081,27 @@ var WarmingOverlay = ({
870
1081
  var DEFAULT_TOAST_TYPE = "info";
871
1082
  function createToastBus() {
872
1083
  const listeners2 = /* @__PURE__ */ new Set();
1084
+ const push = (toast) => {
1085
+ for (const listener of [...listeners2]) listener(toast);
1086
+ };
873
1087
  const emit2 = (text, type = DEFAULT_TOAST_TYPE) => {
874
- for (const push of [...listeners2]) push({ text, type });
1088
+ push({ text, type });
875
1089
  };
876
1090
  return {
877
- subscribe(push) {
878
- listeners2.add(push);
1091
+ subscribe(push2) {
1092
+ listeners2.add(push2);
879
1093
  return () => {
880
- listeners2.delete(push);
1094
+ listeners2.delete(push2);
881
1095
  };
882
1096
  },
883
1097
  emit: emit2,
884
1098
  success(text) {
885
1099
  emit2(text, "success");
886
1100
  },
887
- error(text) {
888
- emit2(text, "error");
1101
+ error(text, cause) {
1102
+ const traceId = readTraceId(cause);
1103
+ if (traceId === void 0) emit2(text, "error");
1104
+ else push({ text, type: "error", traceId });
889
1105
  },
890
1106
  info(text) {
891
1107
  emit2(text, "info");
@@ -908,7 +1124,7 @@ var BUTTON_PADDING_V3 = 12;
908
1124
  var BUTTON_BORDER_RADIUS3 = 8;
909
1125
  var BUTTON_MARGIN_TOP3 = 12;
910
1126
  var BUTTON_FONT_SIZE3 = 16;
911
- var styles9 = reactNative.StyleSheet.create({
1127
+ var styles10 = reactNative.StyleSheet.create({
912
1128
  container: {
913
1129
  flex: 1,
914
1130
  justifyContent: "center",
@@ -976,10 +1192,10 @@ var ErrorBoundaryFallback = ({
976
1192
  accessibilityHint: labels.tryAgainHint,
977
1193
  accessibilityLabel: labels.tryAgain,
978
1194
  accessibilityRole: "button",
979
- style: [styles9.button, reloadIsPrimary ? secondaryFill : primaryFill],
1195
+ style: [styles10.button, reloadIsPrimary ? secondaryFill : primaryFill],
980
1196
  testID: `${testIDPrefix}-retry-button`,
981
1197
  onPress: onRetry,
982
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.buttonText, reloadIsPrimary ? secondaryInk : primaryInk], children: labels.tryAgain })
1198
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.buttonText, reloadIsPrimary ? secondaryInk : primaryInk], children: labels.tryAgain })
983
1199
  }
984
1200
  ) : null;
985
1201
  const reloadButton = typeof onReload === "function" ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -988,10 +1204,10 @@ var ErrorBoundaryFallback = ({
988
1204
  accessibilityHint: labels.reloadHint,
989
1205
  accessibilityLabel: labels.reload,
990
1206
  accessibilityRole: "button",
991
- style: [styles9.button, reloadIsPrimary ? primaryFill : secondaryFill],
1207
+ style: [styles10.button, reloadIsPrimary ? primaryFill : secondaryFill],
992
1208
  testID: `${testIDPrefix}-reload-button`,
993
1209
  onPress: onReload,
994
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.buttonText, reloadIsPrimary ? primaryInk : secondaryInk], children: labels.reload })
1210
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.buttonText, reloadIsPrimary ? primaryInk : secondaryInk], children: labels.reload })
995
1211
  }
996
1212
  ) : null;
997
1213
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -999,19 +1215,19 @@ var ErrorBoundaryFallback = ({
999
1215
  {
1000
1216
  accessibilityLiveRegion: "assertive",
1001
1217
  role: "alert",
1002
- style: [styles9.container, { backgroundColor: theme.colors.background }],
1218
+ style: [styles10.container, { backgroundColor: theme.colors.background }],
1003
1219
  testID: testIDPrefix,
1004
- children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles9.content, children: [
1005
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.title, { color: theme.colors.text }], children: labels.title }),
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 }),
1006
1222
  /* @__PURE__ */ jsxRuntime.jsx(ErrorState, { message: labels.message, testID: `${testIDPrefix}-message` }),
1007
1223
  hasDetails ? /* @__PURE__ */ jsxRuntime.jsxs(
1008
1224
  reactNative.View,
1009
1225
  {
1010
- style: [styles9.details, { backgroundColor: theme.colors.surface, borderColor: warningColor }],
1226
+ style: [styles10.details, { backgroundColor: theme.colors.surface, borderColor: warningColor }],
1011
1227
  testID: `${testIDPrefix}-details`,
1012
1228
  children: [
1013
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.detailsTitle, { color: warningColor }], children: labels.errorDetails }),
1014
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.detailsText, { color: theme.colors.textSecondary }], children: error.message })
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 })
1015
1231
  ]
1016
1232
  }
1017
1233
  ) : null,
@@ -1024,7 +1240,7 @@ var ErrorBoundaryFallback = ({
1024
1240
  var CONTAINER_PADDING4 = 20;
1025
1241
  var MESSAGE_FONT_SIZE3 = 16;
1026
1242
  var MESSAGE_MARGIN_TOP = 12;
1027
- var styles10 = reactNative.StyleSheet.create({
1243
+ var styles11 = reactNative.StyleSheet.create({
1028
1244
  container: {
1029
1245
  flex: 1,
1030
1246
  justifyContent: "center",
@@ -1047,11 +1263,11 @@ var ErrorBoundaryRecovering = ({
1047
1263
  {
1048
1264
  accessibilityLiveRegion: "polite",
1049
1265
  role: "status",
1050
- style: [styles10.container, { backgroundColor: theme.colors.background }],
1266
+ style: [styles11.container, { backgroundColor: theme.colors.background }],
1051
1267
  testID,
1052
1268
  children: [
1053
1269
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.ActivityIndicator, { color: theme.palette.primary["500"], size: "large" }),
1054
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.message, { color: theme.colors.textSecondary }], children: message })
1270
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.message, { color: theme.colors.textSecondary }], children: message })
1055
1271
  ]
1056
1272
  }
1057
1273
  );
@@ -1141,7 +1357,7 @@ var TRACK_MARGIN = 4;
1141
1357
  var INDET_FRACTION = 0.35;
1142
1358
  var INDET_DURATION_MS = 1300;
1143
1359
  var LABEL_FONT_SIZE = 12;
1144
- var styles11 = reactNative.StyleSheet.create({
1360
+ var styles12 = reactNative.StyleSheet.create({
1145
1361
  track: { height: BAR_HEIGHT, borderRadius: RADIUS, overflow: "hidden", marginVertical: TRACK_MARGIN },
1146
1362
  fill: { height: "100%", borderRadius: RADIUS },
1147
1363
  label: { fontSize: LABEL_FONT_SIZE, textAlign: "right", fontVariant: ["tabular-nums"] }
@@ -1160,7 +1376,7 @@ function IndeterminateFill({ color, width, testID }) {
1160
1376
  return /* @__PURE__ */ jsxRuntime.jsx(
1161
1377
  reactNative.Animated.View,
1162
1378
  {
1163
- style: [styles11.fill, { backgroundColor: color, width: barWidth, transform: [{ translateX }] }],
1379
+ style: [styles12.fill, { backgroundColor: color, width: barWidth, transform: [{ translateX }] }],
1164
1380
  testID
1165
1381
  }
1166
1382
  );
@@ -1195,13 +1411,13 @@ function ProgressBar(props) {
1195
1411
  role: "progressbar",
1196
1412
  testID,
1197
1413
  children: [
1198
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles11.track, { backgroundColor: trackColor }], onLayout, children: indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(IndeterminateFill, { color, testID: fillTestID, width }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles11.fill, { backgroundColor: color, width: `${safePct}%` }], testID: fillTestID }) }),
1199
- !indeterminate && label !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.label, { color: textColor }], children: label }) : null
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
1200
1416
  ]
1201
1417
  }
1202
1418
  );
1203
1419
  }
1204
- var styles12 = reactNative.StyleSheet.create({
1420
+ var styles13 = reactNative.StyleSheet.create({
1205
1421
  button: {
1206
1422
  minHeight: a11y.MIN_TOUCH_TARGET_PX,
1207
1423
  minWidth: a11y.MIN_TOUCH_TARGET_PX,
@@ -1224,9 +1440,9 @@ function RunCardButton({ label, hint, color, onPress, testID, disabled = false,
1224
1440
  accessibilityState: { disabled, expanded },
1225
1441
  disabled,
1226
1442
  onPress,
1227
- style: [styles12.button, { borderColor: color }, disabled ? { opacity: DISABLED_OPACITY } : null],
1443
+ style: [styles13.button, { borderColor: color }, disabled ? { opacity: DISABLED_OPACITY } : null],
1228
1444
  testID,
1229
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles12.text, { color }], children: label })
1445
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles13.text, { color }], children: label })
1230
1446
  }
1231
1447
  );
1232
1448
  }
@@ -1295,7 +1511,7 @@ function runToneColor(theme, state) {
1295
1511
  return theme.colors.textSecondary;
1296
1512
  }
1297
1513
  var MARK = { done: "\u2713", running: "\u25CF", pending: "\u25CB", failed: "\u2715" };
1298
- var styles13 = reactNative.StyleSheet.create({
1514
+ var styles14 = reactNative.StyleSheet.create({
1299
1515
  row: { flexDirection: "row", flexWrap: "wrap", gap: 6 },
1300
1516
  chip: { borderWidth: 1, borderRadius: 6, paddingHorizontal: 10, justifyContent: "center" },
1301
1517
  tap: { minHeight: a11y.MIN_TOUCH_TARGET_PX },
@@ -1308,14 +1524,14 @@ function chipText(group, labels) {
1308
1524
  }
1309
1525
  function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect }) {
1310
1526
  const { theme } = useFeedbackUi();
1311
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles13.row, testID, children: groups.map((group) => {
1527
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles14.row, testID, children: groups.map((group) => {
1312
1528
  const color = runToneColor(theme, group.state);
1313
1529
  const selected = group.id === selectedId;
1314
1530
  const a11y = labels.groupA11y(group.label, group.state, labels.formatDuration(group.durationSec));
1315
- const body = /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles13.text, { color }, selected || group.state === "running" ? styles13.strong : null], children: chipText(group, labels) });
1316
- const look = [styles13.chip, { borderColor: color, backgroundColor: selected ? theme.colors.surfaceElevated : theme.colors.surface }];
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 }];
1317
1533
  if (onSelect === void 0) {
1318
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [look, styles13.still], accessible: true, accessibilityLabel: a11y, testID: `${testID}-${group.id}`, children: body }, group.id);
1534
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [look, styles14.still], accessible: true, accessibilityLabel: a11y, testID: `${testID}-${group.id}`, children: body }, group.id);
1319
1535
  }
1320
1536
  return /* @__PURE__ */ jsxRuntime.jsx(
1321
1537
  reactNative.Pressable,
@@ -1325,7 +1541,7 @@ function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect })
1325
1541
  accessibilityHint: labels.groupHint,
1326
1542
  accessibilityState: { selected },
1327
1543
  onPress: () => onSelect(group.id),
1328
- style: [look, styles13.tap],
1544
+ style: [look, styles14.tap],
1329
1545
  testID: `${testID}-${group.id}`,
1330
1546
  children: body
1331
1547
  },
@@ -1339,8 +1555,8 @@ function RunGroupSummary({ groups, labels, testID }) {
1339
1555
  const open = groups.filter((g) => g.state !== "done");
1340
1556
  const doneColor = runToneColor(theme, "done");
1341
1557
  const doneText = labels.doneSummary(done.count, labels.formatDuration(done.durationSec));
1342
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles13.row, testID, children: [
1343
- done.count > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles13.chip, styles13.still, { borderColor: doneColor }], accessible: true, accessibilityLabel: doneText, testID: `${testID}-done`, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles13.text, { color: doneColor }], children: `${MARK.done} ${doneText}` }) }) : null,
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,
1344
1560
  /* @__PURE__ */ jsxRuntime.jsx(RunGroupChips, { groups: open, labels, testID: `${testID}-open` })
1345
1561
  ] });
1346
1562
  }
@@ -1350,7 +1566,7 @@ var LABEL_SHARE = "35%";
1350
1566
  var LABEL_LINES = 2;
1351
1567
  var DURATION_WIDTH = 64;
1352
1568
  var PERCENT = 100;
1353
- var styles14 = reactNative.StyleSheet.create({
1569
+ var styles15 = reactNative.StyleSheet.create({
1354
1570
  list: { gap: 6 },
1355
1571
  row: { flexDirection: "row", alignItems: "center", gap: 8 },
1356
1572
  stack: { gap: 4 },
@@ -1369,22 +1585,22 @@ function RunStepBars({ steps, maxBars, labels, compact, testID }) {
1369
1585
  const maxSec = steps.reduce((m, s) => Math.max(m, s.durationSec), 0);
1370
1586
  const folded = split.hiddenCount > 0;
1371
1587
  const canFold = all && steps.length > maxBars;
1372
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles14.list, testID, children: [
1588
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles15.list, testID, children: [
1373
1589
  split.visible.map((step, i) => {
1374
1590
  const color = runToneColor(theme, step.state);
1375
1591
  const duration = labels.formatDuration(step.durationSec);
1376
- const strong = step.state === "running" ? styles14.strong : null;
1377
- const name = /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [compact ? styles14.compactLabel : styles14.label, { color: theme.colors.text }, strong], numberOfLines: LABEL_LINES, testID: `${testID}-name-${String(i)}`, children: step.label });
1378
- const time = /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles14.duration, { color: theme.colors.textSecondary }, strong], children: duration });
1379
- const bar = /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [compact ? styles14.fullTrack : styles14.track, { backgroundColor: theme.colors.border }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles14.fill, { backgroundColor: color, width: `${barFraction(step.durationSec, maxSec) * PERCENT}%` }] }) });
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}%` }] }) });
1380
1596
  const a11y = { accessible: true, accessibilityLabel: labels.stepA11y(step.label, duration), testID: `${testID}-row-${String(i)}` };
1381
- return compact ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles14.stack, ...a11y, children: [
1382
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles14.row, children: [
1597
+ return compact ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles15.stack, ...a11y, children: [
1598
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles15.row, children: [
1383
1599
  name,
1384
1600
  time
1385
1601
  ] }),
1386
1602
  bar
1387
- ] }, `${step.label}-${String(i)}`) : /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles14.row, ...a11y, children: [
1603
+ ] }, `${step.label}-${String(i)}`) : /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles15.row, ...a11y, children: [
1388
1604
  name,
1389
1605
  bar,
1390
1606
  time
@@ -1405,7 +1621,7 @@ function RunStepBars({ steps, maxBars, labels, compact, testID }) {
1405
1621
  }
1406
1622
  var LIVE_RUN_CARD_COMPACT_MAX_PX = 640;
1407
1623
  var DEFAULT_MAX_BARS = 4;
1408
- var styles15 = reactNative.StyleSheet.create({
1624
+ var styles16 = reactNative.StyleSheet.create({
1409
1625
  card: { borderWidth: 1, borderRadius: 8, padding: 14, gap: 10 },
1410
1626
  head: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 10 },
1411
1627
  titleBox: { flexGrow: 1, flexShrink: 1, flexBasis: 200, minWidth: 0, gap: 2 },
@@ -1429,18 +1645,18 @@ function LiveRunCard(props) {
1429
1645
  const percent = progressPercent(progress);
1430
1646
  const showTimings = !compact || open;
1431
1647
  const muted = { color: theme.colors.textSecondary };
1432
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles15.card, { borderColor: tone, backgroundColor: theme.colors.surface }], testID, children: [
1433
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles15.head, children: [
1434
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles15.pill, { borderColor: tone }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles15.pillText, { color: tone }], testID: `${testID}-status`, children: labels.status }) }),
1435
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles15.titleBox, children: [
1436
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles15.title, { color: theme.colors.text }], testID: `${testID}-title`, children: title }),
1437
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles15.meta, muted], testID: `${testID}-meta`, children: labels.meta })
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 })
1438
1654
  ] }),
1439
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
1440
1656
  ] }),
1441
- currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles15.step, { color: theme.colors.text }], testID: `${testID}-step`, children: currentStep }) : null,
1657
+ currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles16.step, { color: theme.colors.text }], testID: `${testID}-step`, children: currentStep }) : null,
1442
1658
  percent !== null ? /* @__PURE__ */ jsxRuntime.jsx(ProgressBar, { percent, label: labels.progress, accessibilityLabel: labels.progressA11y, color: tone, testID: `${testID}-progress` }) : null,
1443
- percent === null && labels.progress !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles15.meta, muted], testID: `${testID}-progress-text`, children: labels.progress }) : null,
1659
+ percent === null && labels.progress !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles16.meta, muted], testID: `${testID}-progress-text`, children: labels.progress }) : null,
1444
1660
  compact && !open ? /* @__PURE__ */ jsxRuntime.jsx(RunGroupSummary, { groups, labels, testID: `${testID}-summary` }) : null,
1445
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,
1446
1662
  showTimings ? /* @__PURE__ */ jsxRuntime.jsx(RunGroupChips, { groups, labels, selectedId, onSelect: setPicked, testID: `${testID}-groups` }) : null,
@@ -1450,10 +1666,13 @@ function LiveRunCard(props) {
1450
1666
 
1451
1667
  exports.AppErrorBoundary = AppErrorBoundary;
1452
1668
  exports.AsyncSurface = AsyncSurface;
1669
+ exports.COPY_FEEDBACK_MS = COPY_FEEDBACK_MS;
1453
1670
  exports.ConfirmDialog = ConfirmDialog;
1671
+ exports.CopyStatus = CopyStatus;
1454
1672
  exports.DEFAULT_ERROR_BOUNDARY_LABELS = DEFAULT_ERROR_BOUNDARY_LABELS;
1455
1673
  exports.DISABLED_OPACITY = DISABLED_OPACITY;
1456
1674
  exports.EmptyListState = EmptyListState;
1675
+ exports.ErrorReferenceRow = ErrorReferenceRow;
1457
1676
  exports.ErrorState = ErrorState;
1458
1677
  exports.FEEDBACK_TEST_IDS = FEEDBACK_TEST_IDS;
1459
1678
  exports.FeedbackUiProvider = FeedbackUiProvider;
@@ -1469,17 +1688,20 @@ exports.WARMING_QUIET_PERIOD_MS = WARMING_QUIET_PERIOD_MS;
1469
1688
  exports.WarmingOverlay = WarmingOverlay;
1470
1689
  exports.barFraction = barFraction;
1471
1690
  exports.clampPercent = clampPercent;
1691
+ exports.copyText = copyText;
1472
1692
  exports.createToastBus = createToastBus;
1473
1693
  exports.defaultGroupId = defaultGroupId;
1474
1694
  exports.getWarmingSnapshot = getWarmingSnapshot;
1475
1695
  exports.mergeRunSteps = mergeRunSteps;
1476
1696
  exports.notifyWarming = notifyWarming;
1477
1697
  exports.progressPercent = progressPercent;
1698
+ exports.readTraceId = readTraceId;
1478
1699
  exports.runToneColor = runToneColor;
1479
1700
  exports.settleWarming = settleWarming;
1480
1701
  exports.splitShorterSteps = splitShorterSteps;
1481
1702
  exports.subscribeWarming = subscribeWarming;
1482
1703
  exports.summariseDoneGroups = summariseDoneGroups;
1704
+ exports.useCopyToClipboard = useCopyToClipboard;
1483
1705
  exports.useFeedbackUi = useFeedbackUi;
1484
1706
  exports.useUi = useFeedbackUi;
1485
1707
  //# sourceMappingURL=index.js.map