@dloizides/ui-feedback 1.22.0 → 1.24.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 +10 -0
- package/dist/index.d.mts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +106 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +106 -63
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -44,6 +44,14 @@ var FeedbackUiProvider = ({
|
|
|
44
44
|
function useFeedbackUi() {
|
|
45
45
|
return useContext(FeedbackUiContext);
|
|
46
46
|
}
|
|
47
|
+
function UiThemeOverride({
|
|
48
|
+
map,
|
|
49
|
+
children
|
|
50
|
+
}) {
|
|
51
|
+
const { theme, t, navigate } = useFeedbackUi();
|
|
52
|
+
const mapped = useMemo(() => map(theme), [map, theme]);
|
|
53
|
+
return /* @__PURE__ */ jsx(FeedbackUiProvider, { navigate, t, theme: mapped, children });
|
|
54
|
+
}
|
|
47
55
|
|
|
48
56
|
// src/constants.ts
|
|
49
57
|
var MODAL_OVERLAY_COLOR = "rgba(0, 0, 0, 0.5)";
|
|
@@ -754,6 +762,39 @@ var ConfirmDialog = ({
|
|
|
754
762
|
}
|
|
755
763
|
);
|
|
756
764
|
};
|
|
765
|
+
var ACTION_PADDING_HORIZONTAL = 12;
|
|
766
|
+
var ACTION_BORDER_RADIUS = 6;
|
|
767
|
+
var ACTION_FONT_SIZE = 14;
|
|
768
|
+
var styles8 = StyleSheet.create({
|
|
769
|
+
button: {
|
|
770
|
+
minWidth: MIN_TOUCH_TARGET,
|
|
771
|
+
minHeight: MIN_TOUCH_TARGET,
|
|
772
|
+
paddingHorizontal: ACTION_PADDING_HORIZONTAL,
|
|
773
|
+
borderRadius: ACTION_BORDER_RADIUS,
|
|
774
|
+
borderWidth: 1,
|
|
775
|
+
alignItems: "center",
|
|
776
|
+
justifyContent: "center"
|
|
777
|
+
},
|
|
778
|
+
label: { fontSize: ACTION_FONT_SIZE, fontWeight: "700" }
|
|
779
|
+
});
|
|
780
|
+
var ToastAction = ({ action, color, testID, onDismiss }) => {
|
|
781
|
+
const handlePress = () => {
|
|
782
|
+
action.onPress();
|
|
783
|
+
onDismiss();
|
|
784
|
+
};
|
|
785
|
+
return /* @__PURE__ */ jsx(
|
|
786
|
+
Pressable,
|
|
787
|
+
{
|
|
788
|
+
accessibilityHint: action.hint ?? action.label,
|
|
789
|
+
accessibilityLabel: action.label,
|
|
790
|
+
accessibilityRole: "button",
|
|
791
|
+
style: [styles8.button, { borderColor: color }],
|
|
792
|
+
testID,
|
|
793
|
+
onPress: handlePress,
|
|
794
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles8.label, { color }], children: action.label })
|
|
795
|
+
}
|
|
796
|
+
);
|
|
797
|
+
};
|
|
757
798
|
var APP_HEADER_HEIGHT = 64;
|
|
758
799
|
var HEADER_GAP = 8;
|
|
759
800
|
var TOAST_TOP_MOBILE = 40;
|
|
@@ -811,7 +852,7 @@ var C1_CONTROL_END = 159;
|
|
|
811
852
|
var ZERO_WIDTH_START = 8203;
|
|
812
853
|
var ZERO_WIDTH_END = 8207;
|
|
813
854
|
var BYTE_ORDER_MARK = 65279;
|
|
814
|
-
var
|
|
855
|
+
var styles9 = StyleSheet.create({
|
|
815
856
|
container: {
|
|
816
857
|
position: "absolute",
|
|
817
858
|
left: TOAST_HORIZONTAL_MARGIN,
|
|
@@ -888,14 +929,15 @@ var ToastItem = ({ message, onDone, tone, durationMs, fadeMs, testID }) => {
|
|
|
888
929
|
{
|
|
889
930
|
accessibilityLiveRegion: isError ? "assertive" : "polite",
|
|
890
931
|
role: isError ? "alert" : "status",
|
|
891
|
-
style: [
|
|
932
|
+
style: [styles9.toast, { backgroundColor: tone.fill, borderColor: tone.border, transform: [{ translateY }], opacity }],
|
|
892
933
|
testID,
|
|
893
934
|
children: [
|
|
894
|
-
/* @__PURE__ */ jsx(View, { "aria-hidden": true, importantForAccessibility: "no-hide-descendants", style: [
|
|
895
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
896
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
935
|
+
/* @__PURE__ */ jsx(View, { "aria-hidden": true, importantForAccessibility: "no-hide-descendants", style: [styles9.glyph, { borderColor: tone.ink }], children: /* @__PURE__ */ jsx(Text, { style: [styles9.glyphText, { color: tone.ink }], children: tone.glyph }) }),
|
|
936
|
+
/* @__PURE__ */ jsxs(View, { style: styles9.body, children: [
|
|
937
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.text, { color: tone.ink }], children: message.text }),
|
|
897
938
|
/* @__PURE__ */ jsx(ErrorReferenceRow, { actionColor: tone.ink, color: tone.ink, testID: `${testID}-reference`, traceId: message.traceId })
|
|
898
|
-
] })
|
|
939
|
+
] }),
|
|
940
|
+
message.action ? /* @__PURE__ */ jsx(ToastAction, { action: message.action, color: tone.ink, testID: `${testID}-action`, onDismiss: handleDone }) : null
|
|
899
941
|
]
|
|
900
942
|
}
|
|
901
943
|
);
|
|
@@ -926,7 +968,7 @@ var ToastHost = ({
|
|
|
926
968
|
);
|
|
927
969
|
const push = useCallback(
|
|
928
970
|
(toast) => {
|
|
929
|
-
setMessages((s) => [...s, { id: nextId(), type: toast.type, text: sanitizeToastText(toast.text, maxLength), traceId: toast.traceId }]);
|
|
971
|
+
setMessages((s) => [...s, { id: nextId(), type: toast.type, text: sanitizeToastText(toast.text, maxLength), traceId: toast.traceId, action: toast.action }]);
|
|
930
972
|
},
|
|
931
973
|
[maxLength]
|
|
932
974
|
);
|
|
@@ -936,7 +978,7 @@ var ToastHost = ({
|
|
|
936
978
|
useEffect(() => subscribe(push), [subscribe, push]);
|
|
937
979
|
if (messages.length === 0) return null;
|
|
938
980
|
const canPortal = IS_WEB && typeof document !== "undefined";
|
|
939
|
-
const layer = /* @__PURE__ */ jsx(View, { style: [
|
|
981
|
+
const layer = /* @__PURE__ */ jsx(View, { style: [styles9.container, { top: toastTop(IS_WEB, topInset) }, canPortal ? WEB_FIXED_LAYER : null], children: messages.map((m) => /* @__PURE__ */ jsx(
|
|
940
982
|
ToastItem,
|
|
941
983
|
{
|
|
942
984
|
durationMs,
|
|
@@ -1012,7 +1054,7 @@ var SUBTITLE_FONT_SIZE = 15;
|
|
|
1012
1054
|
var ATTEMPT_FONT_SIZE = 13;
|
|
1013
1055
|
var CARD_PADDING = 24;
|
|
1014
1056
|
var NO_ATTEMPT = 0;
|
|
1015
|
-
var
|
|
1057
|
+
var styles10 = StyleSheet.create({
|
|
1016
1058
|
overlay: {
|
|
1017
1059
|
position: "absolute",
|
|
1018
1060
|
top: 0,
|
|
@@ -1069,13 +1111,13 @@ var WarmingOverlay = ({
|
|
|
1069
1111
|
{
|
|
1070
1112
|
accessibilityLabel: mergedLabels.accessibilityLabel,
|
|
1071
1113
|
accessibilityRole: "alert",
|
|
1072
|
-
style: [
|
|
1114
|
+
style: [styles10.overlay, { backgroundColor: colors.background }],
|
|
1073
1115
|
testID: testIdPrefix,
|
|
1074
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
1116
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles10.card, children: [
|
|
1075
1117
|
/* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size: "large" }),
|
|
1076
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1077
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1078
|
-
showHint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1118
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.title, { color: colors.text }], testID: `${testIdPrefix}-title`, children: mergedLabels.title }),
|
|
1119
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.subtitle, { color: colors.textSecondary }], testID: `${testIdPrefix}-subtitle`, children: mergedLabels.subtitle }),
|
|
1120
|
+
showHint ? /* @__PURE__ */ jsx(Text, { style: [styles10.attempt, { color: colors.textSecondary }], testID: `${testIdPrefix}-attempt`, children: mergedLabels.attemptHint(snapshot2.attempt) }) : null
|
|
1079
1121
|
] })
|
|
1080
1122
|
}
|
|
1081
1123
|
);
|
|
@@ -1099,6 +1141,7 @@ function createToastBus() {
|
|
|
1099
1141
|
};
|
|
1100
1142
|
},
|
|
1101
1143
|
emit: emit2,
|
|
1144
|
+
show: push,
|
|
1102
1145
|
success(text) {
|
|
1103
1146
|
emit2(text, "success");
|
|
1104
1147
|
},
|
|
@@ -1131,7 +1174,7 @@ var BUTTON_PADDING_V3 = 12;
|
|
|
1131
1174
|
var BUTTON_BORDER_RADIUS3 = 8;
|
|
1132
1175
|
var BUTTON_MARGIN_TOP3 = 12;
|
|
1133
1176
|
var BUTTON_FONT_SIZE3 = 16;
|
|
1134
|
-
var
|
|
1177
|
+
var styles11 = StyleSheet.create({
|
|
1135
1178
|
container: {
|
|
1136
1179
|
flex: 1,
|
|
1137
1180
|
justifyContent: "center",
|
|
@@ -1205,10 +1248,10 @@ var ErrorBoundaryFallback = ({
|
|
|
1205
1248
|
accessibilityHint: labels.tryAgainHint,
|
|
1206
1249
|
accessibilityLabel: labels.tryAgain,
|
|
1207
1250
|
accessibilityRole: "button",
|
|
1208
|
-
style: [
|
|
1251
|
+
style: [styles11.button, reloadIsPrimary ? secondaryFill : primaryFill],
|
|
1209
1252
|
testID: `${testIDPrefix}-retry-button`,
|
|
1210
1253
|
onPress: onRetry,
|
|
1211
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1254
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles11.buttonText, reloadIsPrimary ? secondaryInk : primaryInk], children: labels.tryAgain })
|
|
1212
1255
|
}
|
|
1213
1256
|
) : null;
|
|
1214
1257
|
const reloadButton = typeof onReload === "function" ? /* @__PURE__ */ jsx(
|
|
@@ -1217,10 +1260,10 @@ var ErrorBoundaryFallback = ({
|
|
|
1217
1260
|
accessibilityHint: labels.reloadHint,
|
|
1218
1261
|
accessibilityLabel: labels.reload,
|
|
1219
1262
|
accessibilityRole: "button",
|
|
1220
|
-
style: [
|
|
1263
|
+
style: [styles11.button, reloadIsPrimary ? primaryFill : secondaryFill],
|
|
1221
1264
|
testID: `${testIDPrefix}-reload-button`,
|
|
1222
1265
|
onPress: onReload,
|
|
1223
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1266
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles11.buttonText, reloadIsPrimary ? primaryInk : secondaryInk], children: labels.reload })
|
|
1224
1267
|
}
|
|
1225
1268
|
) : null;
|
|
1226
1269
|
return /* @__PURE__ */ jsx(
|
|
@@ -1228,20 +1271,20 @@ var ErrorBoundaryFallback = ({
|
|
|
1228
1271
|
{
|
|
1229
1272
|
accessibilityLiveRegion: "assertive",
|
|
1230
1273
|
role: "alert",
|
|
1231
|
-
style: [
|
|
1274
|
+
style: [styles11.container, { backgroundColor: theme.colors.background }],
|
|
1232
1275
|
testID: testIDPrefix,
|
|
1233
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
1234
|
-
logo !== void 0 ? /* @__PURE__ */ jsx(View, { style:
|
|
1235
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1276
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles11.content, children: [
|
|
1277
|
+
logo !== void 0 ? /* @__PURE__ */ jsx(View, { style: styles11.logo, testID: `${testIDPrefix}-logo`, children: logo }) : null,
|
|
1278
|
+
/* @__PURE__ */ jsx(Text, { style: [styles11.title, { color: theme.colors.text }], children: labels.title }),
|
|
1236
1279
|
/* @__PURE__ */ jsx(ErrorState, { message: labels.message, testID: `${testIDPrefix}-message` }),
|
|
1237
1280
|
hasDetails ? /* @__PURE__ */ jsxs(
|
|
1238
1281
|
View,
|
|
1239
1282
|
{
|
|
1240
|
-
style: [
|
|
1283
|
+
style: [styles11.details, { backgroundColor: theme.colors.surface, borderColor: warningColor }],
|
|
1241
1284
|
testID: `${testIDPrefix}-details`,
|
|
1242
1285
|
children: [
|
|
1243
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1244
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1286
|
+
/* @__PURE__ */ jsx(Text, { style: [styles11.detailsTitle, { color: warningText }], children: labels.errorDetails }),
|
|
1287
|
+
/* @__PURE__ */ jsx(Text, { style: [styles11.detailsText, { color: theme.colors.textSecondary }], children: error.message })
|
|
1245
1288
|
]
|
|
1246
1289
|
}
|
|
1247
1290
|
) : null,
|
|
@@ -1254,7 +1297,7 @@ var ErrorBoundaryFallback = ({
|
|
|
1254
1297
|
var CONTAINER_PADDING4 = 20;
|
|
1255
1298
|
var MESSAGE_FONT_SIZE3 = 16;
|
|
1256
1299
|
var MESSAGE_MARGIN_TOP = 12;
|
|
1257
|
-
var
|
|
1300
|
+
var styles12 = StyleSheet.create({
|
|
1258
1301
|
container: {
|
|
1259
1302
|
flex: 1,
|
|
1260
1303
|
justifyContent: "center",
|
|
@@ -1277,11 +1320,11 @@ var ErrorBoundaryRecovering = ({
|
|
|
1277
1320
|
{
|
|
1278
1321
|
accessibilityLiveRegion: "polite",
|
|
1279
1322
|
role: "status",
|
|
1280
|
-
style: [
|
|
1323
|
+
style: [styles12.container, { backgroundColor: theme.colors.background }],
|
|
1281
1324
|
testID,
|
|
1282
1325
|
children: [
|
|
1283
1326
|
/* @__PURE__ */ jsx(ActivityIndicator, { color: theme.palette.primary["500"], size: "large" }),
|
|
1284
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1327
|
+
/* @__PURE__ */ jsx(Text, { style: [styles12.message, { color: theme.colors.textSecondary }], children: message })
|
|
1285
1328
|
]
|
|
1286
1329
|
}
|
|
1287
1330
|
);
|
|
@@ -1383,7 +1426,7 @@ var TRACK_MARGIN = 4;
|
|
|
1383
1426
|
var INDET_FRACTION = 0.35;
|
|
1384
1427
|
var INDET_DURATION_MS = 1300;
|
|
1385
1428
|
var LABEL_FONT_SIZE = 12;
|
|
1386
|
-
var
|
|
1429
|
+
var styles13 = StyleSheet.create({
|
|
1387
1430
|
track: { height: BAR_HEIGHT, borderRadius: RADIUS, overflow: "hidden", marginVertical: TRACK_MARGIN },
|
|
1388
1431
|
fill: { height: "100%", borderRadius: RADIUS },
|
|
1389
1432
|
label: { fontSize: LABEL_FONT_SIZE, textAlign: "right", fontVariant: ["tabular-nums"] }
|
|
@@ -1402,7 +1445,7 @@ function IndeterminateFill({ color, width, testID }) {
|
|
|
1402
1445
|
return /* @__PURE__ */ jsx(
|
|
1403
1446
|
Animated.View,
|
|
1404
1447
|
{
|
|
1405
|
-
style: [
|
|
1448
|
+
style: [styles13.fill, { backgroundColor: color, width: barWidth, transform: [{ translateX }] }],
|
|
1406
1449
|
testID
|
|
1407
1450
|
}
|
|
1408
1451
|
);
|
|
@@ -1437,13 +1480,13 @@ function ProgressBar(props) {
|
|
|
1437
1480
|
role: "progressbar",
|
|
1438
1481
|
testID,
|
|
1439
1482
|
children: [
|
|
1440
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
1441
|
-
!indeterminate && label !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1483
|
+
/* @__PURE__ */ jsx(View, { style: [styles13.track, { backgroundColor: trackColor }], onLayout, children: indeterminate ? /* @__PURE__ */ jsx(IndeterminateFill, { color, testID: fillTestID, width }) : /* @__PURE__ */ jsx(View, { style: [styles13.fill, { backgroundColor: color, width: `${safePct}%` }], testID: fillTestID }) }),
|
|
1484
|
+
!indeterminate && label !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [styles13.label, { color: textColor }], children: label }) : null
|
|
1442
1485
|
]
|
|
1443
1486
|
}
|
|
1444
1487
|
);
|
|
1445
1488
|
}
|
|
1446
|
-
var
|
|
1489
|
+
var styles14 = StyleSheet.create({
|
|
1447
1490
|
button: {
|
|
1448
1491
|
minHeight: MIN_TOUCH_TARGET_PX,
|
|
1449
1492
|
minWidth: MIN_TOUCH_TARGET_PX,
|
|
@@ -1466,9 +1509,9 @@ function RunCardButton({ label, hint, color, onPress, testID, disabled = false,
|
|
|
1466
1509
|
accessibilityState: { disabled, expanded },
|
|
1467
1510
|
disabled,
|
|
1468
1511
|
onPress,
|
|
1469
|
-
style: [
|
|
1512
|
+
style: [styles14.button, { borderColor: color }, disabled ? { opacity: DISABLED_OPACITY } : null],
|
|
1470
1513
|
testID,
|
|
1471
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1514
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles14.text, { color }], children: label })
|
|
1472
1515
|
}
|
|
1473
1516
|
);
|
|
1474
1517
|
}
|
|
@@ -1546,7 +1589,7 @@ function runToneTextColor(theme, state) {
|
|
|
1546
1589
|
return inks[state] ?? runToneColor(theme, state);
|
|
1547
1590
|
}
|
|
1548
1591
|
var MARK = { done: "\u2713", running: "\u25CF", pending: "\u25CB", failed: "\u2715" };
|
|
1549
|
-
var
|
|
1592
|
+
var styles15 = StyleSheet.create({
|
|
1550
1593
|
row: { flexDirection: "row", flexWrap: "wrap", gap: 6 },
|
|
1551
1594
|
chip: { borderWidth: 1, borderRadius: 6, paddingHorizontal: 10, justifyContent: "center" },
|
|
1552
1595
|
tap: { minHeight: MIN_TOUCH_TARGET_PX },
|
|
@@ -1559,15 +1602,15 @@ function chipText(group, labels) {
|
|
|
1559
1602
|
}
|
|
1560
1603
|
function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect }) {
|
|
1561
1604
|
const { theme } = useFeedbackUi();
|
|
1562
|
-
return /* @__PURE__ */ jsx(View, { style:
|
|
1605
|
+
return /* @__PURE__ */ jsx(View, { style: styles15.row, testID, children: groups.map((group) => {
|
|
1563
1606
|
const color = runToneColor(theme, group.state);
|
|
1564
1607
|
const ink = runToneTextColor(theme, group.state);
|
|
1565
1608
|
const selected = group.id === selectedId;
|
|
1566
1609
|
const a11y = labels.groupA11y(group.label, group.state, labels.formatDuration(group.durationSec));
|
|
1567
|
-
const body = /* @__PURE__ */ jsx(Text, { style: [
|
|
1568
|
-
const look = [
|
|
1610
|
+
const body = /* @__PURE__ */ jsx(Text, { style: [styles15.text, { color: ink }, selected || group.state === "running" ? styles15.strong : null], children: chipText(group, labels) });
|
|
1611
|
+
const look = [styles15.chip, { borderColor: color, backgroundColor: selected ? theme.colors.surfaceElevated : theme.colors.surface }];
|
|
1569
1612
|
if (onSelect === void 0) {
|
|
1570
|
-
return /* @__PURE__ */ jsx(View, { style: [look,
|
|
1613
|
+
return /* @__PURE__ */ jsx(View, { style: [look, styles15.still], accessible: true, accessibilityLabel: a11y, testID: `${testID}-${group.id}`, children: body }, group.id);
|
|
1571
1614
|
}
|
|
1572
1615
|
return /* @__PURE__ */ jsx(
|
|
1573
1616
|
Pressable,
|
|
@@ -1577,7 +1620,7 @@ function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect })
|
|
|
1577
1620
|
accessibilityHint: labels.groupHint,
|
|
1578
1621
|
accessibilityState: { selected },
|
|
1579
1622
|
onPress: () => onSelect(group.id),
|
|
1580
|
-
style: [look,
|
|
1623
|
+
style: [look, styles15.tap],
|
|
1581
1624
|
testID: `${testID}-${group.id}`,
|
|
1582
1625
|
children: body
|
|
1583
1626
|
},
|
|
@@ -1591,8 +1634,8 @@ function RunGroupSummary({ groups, labels, testID }) {
|
|
|
1591
1634
|
const open = groups.filter((g) => g.state !== "done");
|
|
1592
1635
|
const doneColor = runToneColor(theme, "done");
|
|
1593
1636
|
const doneText = labels.doneSummary(done.count, labels.formatDuration(done.durationSec));
|
|
1594
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1595
|
-
done.count > 0 ? /* @__PURE__ */ jsx(View, { style: [
|
|
1637
|
+
return /* @__PURE__ */ jsxs(View, { style: styles15.row, testID, children: [
|
|
1638
|
+
done.count > 0 ? /* @__PURE__ */ jsx(View, { style: [styles15.chip, styles15.still, { borderColor: doneColor }], accessible: true, accessibilityLabel: doneText, testID: `${testID}-done`, children: /* @__PURE__ */ jsx(Text, { style: [styles15.text, { color: runToneTextColor(theme, "done") }], children: `${MARK.done} ${doneText}` }) }) : null,
|
|
1596
1639
|
/* @__PURE__ */ jsx(RunGroupChips, { groups: open, labels, testID: `${testID}-open` })
|
|
1597
1640
|
] });
|
|
1598
1641
|
}
|
|
@@ -1602,7 +1645,7 @@ var LABEL_SHARE = "35%";
|
|
|
1602
1645
|
var LABEL_LINES = 2;
|
|
1603
1646
|
var DURATION_WIDTH = 64;
|
|
1604
1647
|
var PERCENT = 100;
|
|
1605
|
-
var
|
|
1648
|
+
var styles16 = StyleSheet.create({
|
|
1606
1649
|
list: { gap: 6 },
|
|
1607
1650
|
row: { flexDirection: "row", alignItems: "center", gap: 8 },
|
|
1608
1651
|
stack: { gap: 4 },
|
|
@@ -1621,22 +1664,22 @@ function RunStepBars({ steps, maxBars, labels, compact, testID }) {
|
|
|
1621
1664
|
const maxSec = steps.reduce((m, s) => Math.max(m, s.durationSec), 0);
|
|
1622
1665
|
const folded = split.hiddenCount > 0;
|
|
1623
1666
|
const canFold = all && steps.length > maxBars;
|
|
1624
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1667
|
+
return /* @__PURE__ */ jsxs(View, { style: styles16.list, testID, children: [
|
|
1625
1668
|
split.visible.map((step, i) => {
|
|
1626
1669
|
const color = runToneColor(theme, step.state);
|
|
1627
1670
|
const duration = labels.formatDuration(step.durationSec);
|
|
1628
|
-
const strong = step.state === "running" ?
|
|
1629
|
-
const name = /* @__PURE__ */ jsx(Text, { style: [compact ?
|
|
1630
|
-
const time = /* @__PURE__ */ jsx(Text, { style: [
|
|
1631
|
-
const bar = /* @__PURE__ */ jsx(View, { style: [compact ?
|
|
1671
|
+
const strong = step.state === "running" ? styles16.strong : null;
|
|
1672
|
+
const name = /* @__PURE__ */ jsx(Text, { style: [compact ? styles16.compactLabel : styles16.label, { color: theme.colors.text }, strong], numberOfLines: LABEL_LINES, testID: `${testID}-name-${String(i)}`, children: step.label });
|
|
1673
|
+
const time = /* @__PURE__ */ jsx(Text, { style: [styles16.duration, { color: theme.colors.textSecondary }, strong], children: duration });
|
|
1674
|
+
const bar = /* @__PURE__ */ jsx(View, { style: [compact ? styles16.fullTrack : styles16.track, { backgroundColor: theme.colors.border }], children: /* @__PURE__ */ jsx(View, { style: [styles16.fill, { backgroundColor: color, width: `${barFraction(step.durationSec, maxSec) * PERCENT}%` }] }) });
|
|
1632
1675
|
const a11y = { accessible: true, accessibilityLabel: labels.stepA11y(step.label, duration), testID: `${testID}-row-${String(i)}` };
|
|
1633
|
-
return compact ? /* @__PURE__ */ jsxs(View, { style:
|
|
1634
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1676
|
+
return compact ? /* @__PURE__ */ jsxs(View, { style: styles16.stack, ...a11y, children: [
|
|
1677
|
+
/* @__PURE__ */ jsxs(View, { style: styles16.row, children: [
|
|
1635
1678
|
name,
|
|
1636
1679
|
time
|
|
1637
1680
|
] }),
|
|
1638
1681
|
bar
|
|
1639
|
-
] }, `${step.label}-${String(i)}`) : /* @__PURE__ */ jsxs(View, { style:
|
|
1682
|
+
] }, `${step.label}-${String(i)}`) : /* @__PURE__ */ jsxs(View, { style: styles16.row, ...a11y, children: [
|
|
1640
1683
|
name,
|
|
1641
1684
|
bar,
|
|
1642
1685
|
time
|
|
@@ -1657,7 +1700,7 @@ function RunStepBars({ steps, maxBars, labels, compact, testID }) {
|
|
|
1657
1700
|
}
|
|
1658
1701
|
var LIVE_RUN_CARD_COMPACT_MAX_PX = 640;
|
|
1659
1702
|
var DEFAULT_MAX_BARS = 4;
|
|
1660
|
-
var
|
|
1703
|
+
var styles17 = StyleSheet.create({
|
|
1661
1704
|
card: { borderWidth: 1, borderRadius: 8, padding: 14, gap: 10 },
|
|
1662
1705
|
head: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 10 },
|
|
1663
1706
|
titleBox: { flexGrow: 1, flexShrink: 1, flexBasis: 200, minWidth: 0, gap: 2 },
|
|
@@ -1682,18 +1725,18 @@ function LiveRunCard(props) {
|
|
|
1682
1725
|
const percent = progressPercent(progress);
|
|
1683
1726
|
const showTimings = !compact || open;
|
|
1684
1727
|
const muted = { color: theme.colors.textSecondary };
|
|
1685
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
1686
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1687
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
1688
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1689
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1690
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1728
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles17.card, { borderColor: tone, backgroundColor: theme.colors.surface }], testID, children: [
|
|
1729
|
+
/* @__PURE__ */ jsxs(View, { style: styles17.head, children: [
|
|
1730
|
+
/* @__PURE__ */ jsx(View, { style: [styles17.pill, { borderColor: tone }], children: /* @__PURE__ */ jsx(Text, { style: [styles17.pillText, { color: toneText }], testID: `${testID}-status`, children: labels.status }) }),
|
|
1731
|
+
/* @__PURE__ */ jsxs(View, { style: styles17.titleBox, children: [
|
|
1732
|
+
/* @__PURE__ */ jsx(Text, { style: [styles17.title, { color: theme.colors.text }], testID: `${testID}-title`, children: title }),
|
|
1733
|
+
/* @__PURE__ */ jsx(Text, { style: [styles17.meta, muted], testID: `${testID}-meta`, children: labels.meta })
|
|
1691
1734
|
] }),
|
|
1692
1735
|
onCancel !== void 0 ? /* @__PURE__ */ jsx(RunCardButton, { label: labels.cancel, hint: labels.cancelHint, color: theme.semanticText?.error ?? theme.semantic.error["500"], onPress: onCancel, disabled: cancelDisabled, testID: `${testID}-cancel` }) : null
|
|
1693
1736
|
] }),
|
|
1694
|
-
currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1737
|
+
currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsx(Text, { style: [styles17.step, { color: theme.colors.text }], testID: `${testID}-step`, children: currentStep }) : null,
|
|
1695
1738
|
percent !== null ? /* @__PURE__ */ jsx(ProgressBar, { percent, label: labels.progress, accessibilityLabel: labels.progressA11y, color: tone, testID: `${testID}-progress` }) : null,
|
|
1696
|
-
percent === null && labels.progress !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1739
|
+
percent === null && labels.progress !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [styles17.meta, muted], testID: `${testID}-progress-text`, children: labels.progress }) : null,
|
|
1697
1740
|
compact && !open ? /* @__PURE__ */ jsx(RunGroupSummary, { groups, labels, testID: `${testID}-summary` }) : null,
|
|
1698
1741
|
compact ? /* @__PURE__ */ jsx(RunCardButton, { label: labels.stepTimings, hint: labels.stepTimingsHint, color: theme.colors.textSecondary, onPress: () => setOpen(!open), expanded: open, testID: `${testID}-timings-toggle` }) : null,
|
|
1699
1742
|
showTimings ? /* @__PURE__ */ jsx(RunGroupChips, { groups, labels, selectedId, onSelect: setPicked, testID: `${testID}-groups` }) : null,
|
|
@@ -1701,6 +1744,6 @@ function LiveRunCard(props) {
|
|
|
1701
1744
|
] });
|
|
1702
1745
|
}
|
|
1703
1746
|
|
|
1704
|
-
export { AppErrorBoundary, AsyncSurface, COPY_FEEDBACK_MS, ConfirmDialog, CopyStatus, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, ErrorReferenceRow, ErrorState, FEEDBACK_TEST_IDS, FeedbackUiProvider, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, LoadingFallback, MODAL_OVERLAY_COLOR, PageSkeleton, ProgressBar, ToastHost, FeedbackUiProvider as UiProvider, WARMING_QUIET_PERIOD_MS, WarmingOverlay, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useFeedbackUi as useUi };
|
|
1747
|
+
export { AppErrorBoundary, AsyncSurface, COPY_FEEDBACK_MS, ConfirmDialog, CopyStatus, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, ErrorReferenceRow, ErrorState, FEEDBACK_TEST_IDS, FeedbackUiProvider, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, LoadingFallback, MODAL_OVERLAY_COLOR, PageSkeleton, ProgressBar, ToastHost, FeedbackUiProvider as UiProvider, UiThemeOverride, WARMING_QUIET_PERIOD_MS, WarmingOverlay, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useFeedbackUi as useUi };
|
|
1705
1748
|
//# sourceMappingURL=index.mjs.map
|
|
1706
1749
|
//# sourceMappingURL=index.mjs.map
|