@dloizides/ui-feedback 1.22.0 → 1.23.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 +6 -0
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +97 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +97 -62
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -754,6 +754,39 @@ var ConfirmDialog = ({
|
|
|
754
754
|
}
|
|
755
755
|
);
|
|
756
756
|
};
|
|
757
|
+
var ACTION_PADDING_HORIZONTAL = 12;
|
|
758
|
+
var ACTION_BORDER_RADIUS = 6;
|
|
759
|
+
var ACTION_FONT_SIZE = 14;
|
|
760
|
+
var styles8 = StyleSheet.create({
|
|
761
|
+
button: {
|
|
762
|
+
minWidth: MIN_TOUCH_TARGET,
|
|
763
|
+
minHeight: MIN_TOUCH_TARGET,
|
|
764
|
+
paddingHorizontal: ACTION_PADDING_HORIZONTAL,
|
|
765
|
+
borderRadius: ACTION_BORDER_RADIUS,
|
|
766
|
+
borderWidth: 1,
|
|
767
|
+
alignItems: "center",
|
|
768
|
+
justifyContent: "center"
|
|
769
|
+
},
|
|
770
|
+
label: { fontSize: ACTION_FONT_SIZE, fontWeight: "700" }
|
|
771
|
+
});
|
|
772
|
+
var ToastAction = ({ action, color, testID, onDismiss }) => {
|
|
773
|
+
const handlePress = () => {
|
|
774
|
+
action.onPress();
|
|
775
|
+
onDismiss();
|
|
776
|
+
};
|
|
777
|
+
return /* @__PURE__ */ jsx(
|
|
778
|
+
Pressable,
|
|
779
|
+
{
|
|
780
|
+
accessibilityHint: action.hint ?? action.label,
|
|
781
|
+
accessibilityLabel: action.label,
|
|
782
|
+
accessibilityRole: "button",
|
|
783
|
+
style: [styles8.button, { borderColor: color }],
|
|
784
|
+
testID,
|
|
785
|
+
onPress: handlePress,
|
|
786
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles8.label, { color }], children: action.label })
|
|
787
|
+
}
|
|
788
|
+
);
|
|
789
|
+
};
|
|
757
790
|
var APP_HEADER_HEIGHT = 64;
|
|
758
791
|
var HEADER_GAP = 8;
|
|
759
792
|
var TOAST_TOP_MOBILE = 40;
|
|
@@ -811,7 +844,7 @@ var C1_CONTROL_END = 159;
|
|
|
811
844
|
var ZERO_WIDTH_START = 8203;
|
|
812
845
|
var ZERO_WIDTH_END = 8207;
|
|
813
846
|
var BYTE_ORDER_MARK = 65279;
|
|
814
|
-
var
|
|
847
|
+
var styles9 = StyleSheet.create({
|
|
815
848
|
container: {
|
|
816
849
|
position: "absolute",
|
|
817
850
|
left: TOAST_HORIZONTAL_MARGIN,
|
|
@@ -888,14 +921,15 @@ var ToastItem = ({ message, onDone, tone, durationMs, fadeMs, testID }) => {
|
|
|
888
921
|
{
|
|
889
922
|
accessibilityLiveRegion: isError ? "assertive" : "polite",
|
|
890
923
|
role: isError ? "alert" : "status",
|
|
891
|
-
style: [
|
|
924
|
+
style: [styles9.toast, { backgroundColor: tone.fill, borderColor: tone.border, transform: [{ translateY }], opacity }],
|
|
892
925
|
testID,
|
|
893
926
|
children: [
|
|
894
|
-
/* @__PURE__ */ jsx(View, { "aria-hidden": true, importantForAccessibility: "no-hide-descendants", style: [
|
|
895
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
896
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
927
|
+
/* @__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 }) }),
|
|
928
|
+
/* @__PURE__ */ jsxs(View, { style: styles9.body, children: [
|
|
929
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.text, { color: tone.ink }], children: message.text }),
|
|
897
930
|
/* @__PURE__ */ jsx(ErrorReferenceRow, { actionColor: tone.ink, color: tone.ink, testID: `${testID}-reference`, traceId: message.traceId })
|
|
898
|
-
] })
|
|
931
|
+
] }),
|
|
932
|
+
message.action ? /* @__PURE__ */ jsx(ToastAction, { action: message.action, color: tone.ink, testID: `${testID}-action`, onDismiss: handleDone }) : null
|
|
899
933
|
]
|
|
900
934
|
}
|
|
901
935
|
);
|
|
@@ -926,7 +960,7 @@ var ToastHost = ({
|
|
|
926
960
|
);
|
|
927
961
|
const push = useCallback(
|
|
928
962
|
(toast) => {
|
|
929
|
-
setMessages((s) => [...s, { id: nextId(), type: toast.type, text: sanitizeToastText(toast.text, maxLength), traceId: toast.traceId }]);
|
|
963
|
+
setMessages((s) => [...s, { id: nextId(), type: toast.type, text: sanitizeToastText(toast.text, maxLength), traceId: toast.traceId, action: toast.action }]);
|
|
930
964
|
},
|
|
931
965
|
[maxLength]
|
|
932
966
|
);
|
|
@@ -936,7 +970,7 @@ var ToastHost = ({
|
|
|
936
970
|
useEffect(() => subscribe(push), [subscribe, push]);
|
|
937
971
|
if (messages.length === 0) return null;
|
|
938
972
|
const canPortal = IS_WEB && typeof document !== "undefined";
|
|
939
|
-
const layer = /* @__PURE__ */ jsx(View, { style: [
|
|
973
|
+
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
974
|
ToastItem,
|
|
941
975
|
{
|
|
942
976
|
durationMs,
|
|
@@ -1012,7 +1046,7 @@ var SUBTITLE_FONT_SIZE = 15;
|
|
|
1012
1046
|
var ATTEMPT_FONT_SIZE = 13;
|
|
1013
1047
|
var CARD_PADDING = 24;
|
|
1014
1048
|
var NO_ATTEMPT = 0;
|
|
1015
|
-
var
|
|
1049
|
+
var styles10 = StyleSheet.create({
|
|
1016
1050
|
overlay: {
|
|
1017
1051
|
position: "absolute",
|
|
1018
1052
|
top: 0,
|
|
@@ -1069,13 +1103,13 @@ var WarmingOverlay = ({
|
|
|
1069
1103
|
{
|
|
1070
1104
|
accessibilityLabel: mergedLabels.accessibilityLabel,
|
|
1071
1105
|
accessibilityRole: "alert",
|
|
1072
|
-
style: [
|
|
1106
|
+
style: [styles10.overlay, { backgroundColor: colors.background }],
|
|
1073
1107
|
testID: testIdPrefix,
|
|
1074
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
1108
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles10.card, children: [
|
|
1075
1109
|
/* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size: "large" }),
|
|
1076
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1077
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1078
|
-
showHint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1110
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.title, { color: colors.text }], testID: `${testIdPrefix}-title`, children: mergedLabels.title }),
|
|
1111
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.subtitle, { color: colors.textSecondary }], testID: `${testIdPrefix}-subtitle`, children: mergedLabels.subtitle }),
|
|
1112
|
+
showHint ? /* @__PURE__ */ jsx(Text, { style: [styles10.attempt, { color: colors.textSecondary }], testID: `${testIdPrefix}-attempt`, children: mergedLabels.attemptHint(snapshot2.attempt) }) : null
|
|
1079
1113
|
] })
|
|
1080
1114
|
}
|
|
1081
1115
|
);
|
|
@@ -1099,6 +1133,7 @@ function createToastBus() {
|
|
|
1099
1133
|
};
|
|
1100
1134
|
},
|
|
1101
1135
|
emit: emit2,
|
|
1136
|
+
show: push,
|
|
1102
1137
|
success(text) {
|
|
1103
1138
|
emit2(text, "success");
|
|
1104
1139
|
},
|
|
@@ -1131,7 +1166,7 @@ var BUTTON_PADDING_V3 = 12;
|
|
|
1131
1166
|
var BUTTON_BORDER_RADIUS3 = 8;
|
|
1132
1167
|
var BUTTON_MARGIN_TOP3 = 12;
|
|
1133
1168
|
var BUTTON_FONT_SIZE3 = 16;
|
|
1134
|
-
var
|
|
1169
|
+
var styles11 = StyleSheet.create({
|
|
1135
1170
|
container: {
|
|
1136
1171
|
flex: 1,
|
|
1137
1172
|
justifyContent: "center",
|
|
@@ -1205,10 +1240,10 @@ var ErrorBoundaryFallback = ({
|
|
|
1205
1240
|
accessibilityHint: labels.tryAgainHint,
|
|
1206
1241
|
accessibilityLabel: labels.tryAgain,
|
|
1207
1242
|
accessibilityRole: "button",
|
|
1208
|
-
style: [
|
|
1243
|
+
style: [styles11.button, reloadIsPrimary ? secondaryFill : primaryFill],
|
|
1209
1244
|
testID: `${testIDPrefix}-retry-button`,
|
|
1210
1245
|
onPress: onRetry,
|
|
1211
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1246
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles11.buttonText, reloadIsPrimary ? secondaryInk : primaryInk], children: labels.tryAgain })
|
|
1212
1247
|
}
|
|
1213
1248
|
) : null;
|
|
1214
1249
|
const reloadButton = typeof onReload === "function" ? /* @__PURE__ */ jsx(
|
|
@@ -1217,10 +1252,10 @@ var ErrorBoundaryFallback = ({
|
|
|
1217
1252
|
accessibilityHint: labels.reloadHint,
|
|
1218
1253
|
accessibilityLabel: labels.reload,
|
|
1219
1254
|
accessibilityRole: "button",
|
|
1220
|
-
style: [
|
|
1255
|
+
style: [styles11.button, reloadIsPrimary ? primaryFill : secondaryFill],
|
|
1221
1256
|
testID: `${testIDPrefix}-reload-button`,
|
|
1222
1257
|
onPress: onReload,
|
|
1223
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1258
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles11.buttonText, reloadIsPrimary ? primaryInk : secondaryInk], children: labels.reload })
|
|
1224
1259
|
}
|
|
1225
1260
|
) : null;
|
|
1226
1261
|
return /* @__PURE__ */ jsx(
|
|
@@ -1228,20 +1263,20 @@ var ErrorBoundaryFallback = ({
|
|
|
1228
1263
|
{
|
|
1229
1264
|
accessibilityLiveRegion: "assertive",
|
|
1230
1265
|
role: "alert",
|
|
1231
|
-
style: [
|
|
1266
|
+
style: [styles11.container, { backgroundColor: theme.colors.background }],
|
|
1232
1267
|
testID: testIDPrefix,
|
|
1233
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
1234
|
-
logo !== void 0 ? /* @__PURE__ */ jsx(View, { style:
|
|
1235
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1268
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles11.content, children: [
|
|
1269
|
+
logo !== void 0 ? /* @__PURE__ */ jsx(View, { style: styles11.logo, testID: `${testIDPrefix}-logo`, children: logo }) : null,
|
|
1270
|
+
/* @__PURE__ */ jsx(Text, { style: [styles11.title, { color: theme.colors.text }], children: labels.title }),
|
|
1236
1271
|
/* @__PURE__ */ jsx(ErrorState, { message: labels.message, testID: `${testIDPrefix}-message` }),
|
|
1237
1272
|
hasDetails ? /* @__PURE__ */ jsxs(
|
|
1238
1273
|
View,
|
|
1239
1274
|
{
|
|
1240
|
-
style: [
|
|
1275
|
+
style: [styles11.details, { backgroundColor: theme.colors.surface, borderColor: warningColor }],
|
|
1241
1276
|
testID: `${testIDPrefix}-details`,
|
|
1242
1277
|
children: [
|
|
1243
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1244
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1278
|
+
/* @__PURE__ */ jsx(Text, { style: [styles11.detailsTitle, { color: warningText }], children: labels.errorDetails }),
|
|
1279
|
+
/* @__PURE__ */ jsx(Text, { style: [styles11.detailsText, { color: theme.colors.textSecondary }], children: error.message })
|
|
1245
1280
|
]
|
|
1246
1281
|
}
|
|
1247
1282
|
) : null,
|
|
@@ -1254,7 +1289,7 @@ var ErrorBoundaryFallback = ({
|
|
|
1254
1289
|
var CONTAINER_PADDING4 = 20;
|
|
1255
1290
|
var MESSAGE_FONT_SIZE3 = 16;
|
|
1256
1291
|
var MESSAGE_MARGIN_TOP = 12;
|
|
1257
|
-
var
|
|
1292
|
+
var styles12 = StyleSheet.create({
|
|
1258
1293
|
container: {
|
|
1259
1294
|
flex: 1,
|
|
1260
1295
|
justifyContent: "center",
|
|
@@ -1277,11 +1312,11 @@ var ErrorBoundaryRecovering = ({
|
|
|
1277
1312
|
{
|
|
1278
1313
|
accessibilityLiveRegion: "polite",
|
|
1279
1314
|
role: "status",
|
|
1280
|
-
style: [
|
|
1315
|
+
style: [styles12.container, { backgroundColor: theme.colors.background }],
|
|
1281
1316
|
testID,
|
|
1282
1317
|
children: [
|
|
1283
1318
|
/* @__PURE__ */ jsx(ActivityIndicator, { color: theme.palette.primary["500"], size: "large" }),
|
|
1284
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1319
|
+
/* @__PURE__ */ jsx(Text, { style: [styles12.message, { color: theme.colors.textSecondary }], children: message })
|
|
1285
1320
|
]
|
|
1286
1321
|
}
|
|
1287
1322
|
);
|
|
@@ -1383,7 +1418,7 @@ var TRACK_MARGIN = 4;
|
|
|
1383
1418
|
var INDET_FRACTION = 0.35;
|
|
1384
1419
|
var INDET_DURATION_MS = 1300;
|
|
1385
1420
|
var LABEL_FONT_SIZE = 12;
|
|
1386
|
-
var
|
|
1421
|
+
var styles13 = StyleSheet.create({
|
|
1387
1422
|
track: { height: BAR_HEIGHT, borderRadius: RADIUS, overflow: "hidden", marginVertical: TRACK_MARGIN },
|
|
1388
1423
|
fill: { height: "100%", borderRadius: RADIUS },
|
|
1389
1424
|
label: { fontSize: LABEL_FONT_SIZE, textAlign: "right", fontVariant: ["tabular-nums"] }
|
|
@@ -1402,7 +1437,7 @@ function IndeterminateFill({ color, width, testID }) {
|
|
|
1402
1437
|
return /* @__PURE__ */ jsx(
|
|
1403
1438
|
Animated.View,
|
|
1404
1439
|
{
|
|
1405
|
-
style: [
|
|
1440
|
+
style: [styles13.fill, { backgroundColor: color, width: barWidth, transform: [{ translateX }] }],
|
|
1406
1441
|
testID
|
|
1407
1442
|
}
|
|
1408
1443
|
);
|
|
@@ -1437,13 +1472,13 @@ function ProgressBar(props) {
|
|
|
1437
1472
|
role: "progressbar",
|
|
1438
1473
|
testID,
|
|
1439
1474
|
children: [
|
|
1440
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
1441
|
-
!indeterminate && label !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1475
|
+
/* @__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 }) }),
|
|
1476
|
+
!indeterminate && label !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [styles13.label, { color: textColor }], children: label }) : null
|
|
1442
1477
|
]
|
|
1443
1478
|
}
|
|
1444
1479
|
);
|
|
1445
1480
|
}
|
|
1446
|
-
var
|
|
1481
|
+
var styles14 = StyleSheet.create({
|
|
1447
1482
|
button: {
|
|
1448
1483
|
minHeight: MIN_TOUCH_TARGET_PX,
|
|
1449
1484
|
minWidth: MIN_TOUCH_TARGET_PX,
|
|
@@ -1466,9 +1501,9 @@ function RunCardButton({ label, hint, color, onPress, testID, disabled = false,
|
|
|
1466
1501
|
accessibilityState: { disabled, expanded },
|
|
1467
1502
|
disabled,
|
|
1468
1503
|
onPress,
|
|
1469
|
-
style: [
|
|
1504
|
+
style: [styles14.button, { borderColor: color }, disabled ? { opacity: DISABLED_OPACITY } : null],
|
|
1470
1505
|
testID,
|
|
1471
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1506
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles14.text, { color }], children: label })
|
|
1472
1507
|
}
|
|
1473
1508
|
);
|
|
1474
1509
|
}
|
|
@@ -1546,7 +1581,7 @@ function runToneTextColor(theme, state) {
|
|
|
1546
1581
|
return inks[state] ?? runToneColor(theme, state);
|
|
1547
1582
|
}
|
|
1548
1583
|
var MARK = { done: "\u2713", running: "\u25CF", pending: "\u25CB", failed: "\u2715" };
|
|
1549
|
-
var
|
|
1584
|
+
var styles15 = StyleSheet.create({
|
|
1550
1585
|
row: { flexDirection: "row", flexWrap: "wrap", gap: 6 },
|
|
1551
1586
|
chip: { borderWidth: 1, borderRadius: 6, paddingHorizontal: 10, justifyContent: "center" },
|
|
1552
1587
|
tap: { minHeight: MIN_TOUCH_TARGET_PX },
|
|
@@ -1559,15 +1594,15 @@ function chipText(group, labels) {
|
|
|
1559
1594
|
}
|
|
1560
1595
|
function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect }) {
|
|
1561
1596
|
const { theme } = useFeedbackUi();
|
|
1562
|
-
return /* @__PURE__ */ jsx(View, { style:
|
|
1597
|
+
return /* @__PURE__ */ jsx(View, { style: styles15.row, testID, children: groups.map((group) => {
|
|
1563
1598
|
const color = runToneColor(theme, group.state);
|
|
1564
1599
|
const ink = runToneTextColor(theme, group.state);
|
|
1565
1600
|
const selected = group.id === selectedId;
|
|
1566
1601
|
const a11y = labels.groupA11y(group.label, group.state, labels.formatDuration(group.durationSec));
|
|
1567
|
-
const body = /* @__PURE__ */ jsx(Text, { style: [
|
|
1568
|
-
const look = [
|
|
1602
|
+
const body = /* @__PURE__ */ jsx(Text, { style: [styles15.text, { color: ink }, selected || group.state === "running" ? styles15.strong : null], children: chipText(group, labels) });
|
|
1603
|
+
const look = [styles15.chip, { borderColor: color, backgroundColor: selected ? theme.colors.surfaceElevated : theme.colors.surface }];
|
|
1569
1604
|
if (onSelect === void 0) {
|
|
1570
|
-
return /* @__PURE__ */ jsx(View, { style: [look,
|
|
1605
|
+
return /* @__PURE__ */ jsx(View, { style: [look, styles15.still], accessible: true, accessibilityLabel: a11y, testID: `${testID}-${group.id}`, children: body }, group.id);
|
|
1571
1606
|
}
|
|
1572
1607
|
return /* @__PURE__ */ jsx(
|
|
1573
1608
|
Pressable,
|
|
@@ -1577,7 +1612,7 @@ function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect })
|
|
|
1577
1612
|
accessibilityHint: labels.groupHint,
|
|
1578
1613
|
accessibilityState: { selected },
|
|
1579
1614
|
onPress: () => onSelect(group.id),
|
|
1580
|
-
style: [look,
|
|
1615
|
+
style: [look, styles15.tap],
|
|
1581
1616
|
testID: `${testID}-${group.id}`,
|
|
1582
1617
|
children: body
|
|
1583
1618
|
},
|
|
@@ -1591,8 +1626,8 @@ function RunGroupSummary({ groups, labels, testID }) {
|
|
|
1591
1626
|
const open = groups.filter((g) => g.state !== "done");
|
|
1592
1627
|
const doneColor = runToneColor(theme, "done");
|
|
1593
1628
|
const doneText = labels.doneSummary(done.count, labels.formatDuration(done.durationSec));
|
|
1594
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1595
|
-
done.count > 0 ? /* @__PURE__ */ jsx(View, { style: [
|
|
1629
|
+
return /* @__PURE__ */ jsxs(View, { style: styles15.row, testID, children: [
|
|
1630
|
+
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
1631
|
/* @__PURE__ */ jsx(RunGroupChips, { groups: open, labels, testID: `${testID}-open` })
|
|
1597
1632
|
] });
|
|
1598
1633
|
}
|
|
@@ -1602,7 +1637,7 @@ var LABEL_SHARE = "35%";
|
|
|
1602
1637
|
var LABEL_LINES = 2;
|
|
1603
1638
|
var DURATION_WIDTH = 64;
|
|
1604
1639
|
var PERCENT = 100;
|
|
1605
|
-
var
|
|
1640
|
+
var styles16 = StyleSheet.create({
|
|
1606
1641
|
list: { gap: 6 },
|
|
1607
1642
|
row: { flexDirection: "row", alignItems: "center", gap: 8 },
|
|
1608
1643
|
stack: { gap: 4 },
|
|
@@ -1621,22 +1656,22 @@ function RunStepBars({ steps, maxBars, labels, compact, testID }) {
|
|
|
1621
1656
|
const maxSec = steps.reduce((m, s) => Math.max(m, s.durationSec), 0);
|
|
1622
1657
|
const folded = split.hiddenCount > 0;
|
|
1623
1658
|
const canFold = all && steps.length > maxBars;
|
|
1624
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1659
|
+
return /* @__PURE__ */ jsxs(View, { style: styles16.list, testID, children: [
|
|
1625
1660
|
split.visible.map((step, i) => {
|
|
1626
1661
|
const color = runToneColor(theme, step.state);
|
|
1627
1662
|
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 ?
|
|
1663
|
+
const strong = step.state === "running" ? styles16.strong : null;
|
|
1664
|
+
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 });
|
|
1665
|
+
const time = /* @__PURE__ */ jsx(Text, { style: [styles16.duration, { color: theme.colors.textSecondary }, strong], children: duration });
|
|
1666
|
+
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
1667
|
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:
|
|
1668
|
+
return compact ? /* @__PURE__ */ jsxs(View, { style: styles16.stack, ...a11y, children: [
|
|
1669
|
+
/* @__PURE__ */ jsxs(View, { style: styles16.row, children: [
|
|
1635
1670
|
name,
|
|
1636
1671
|
time
|
|
1637
1672
|
] }),
|
|
1638
1673
|
bar
|
|
1639
|
-
] }, `${step.label}-${String(i)}`) : /* @__PURE__ */ jsxs(View, { style:
|
|
1674
|
+
] }, `${step.label}-${String(i)}`) : /* @__PURE__ */ jsxs(View, { style: styles16.row, ...a11y, children: [
|
|
1640
1675
|
name,
|
|
1641
1676
|
bar,
|
|
1642
1677
|
time
|
|
@@ -1657,7 +1692,7 @@ function RunStepBars({ steps, maxBars, labels, compact, testID }) {
|
|
|
1657
1692
|
}
|
|
1658
1693
|
var LIVE_RUN_CARD_COMPACT_MAX_PX = 640;
|
|
1659
1694
|
var DEFAULT_MAX_BARS = 4;
|
|
1660
|
-
var
|
|
1695
|
+
var styles17 = StyleSheet.create({
|
|
1661
1696
|
card: { borderWidth: 1, borderRadius: 8, padding: 14, gap: 10 },
|
|
1662
1697
|
head: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 10 },
|
|
1663
1698
|
titleBox: { flexGrow: 1, flexShrink: 1, flexBasis: 200, minWidth: 0, gap: 2 },
|
|
@@ -1682,18 +1717,18 @@ function LiveRunCard(props) {
|
|
|
1682
1717
|
const percent = progressPercent(progress);
|
|
1683
1718
|
const showTimings = !compact || open;
|
|
1684
1719
|
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: [
|
|
1720
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles17.card, { borderColor: tone, backgroundColor: theme.colors.surface }], testID, children: [
|
|
1721
|
+
/* @__PURE__ */ jsxs(View, { style: styles17.head, children: [
|
|
1722
|
+
/* @__PURE__ */ jsx(View, { style: [styles17.pill, { borderColor: tone }], children: /* @__PURE__ */ jsx(Text, { style: [styles17.pillText, { color: toneText }], testID: `${testID}-status`, children: labels.status }) }),
|
|
1723
|
+
/* @__PURE__ */ jsxs(View, { style: styles17.titleBox, children: [
|
|
1724
|
+
/* @__PURE__ */ jsx(Text, { style: [styles17.title, { color: theme.colors.text }], testID: `${testID}-title`, children: title }),
|
|
1725
|
+
/* @__PURE__ */ jsx(Text, { style: [styles17.meta, muted], testID: `${testID}-meta`, children: labels.meta })
|
|
1691
1726
|
] }),
|
|
1692
1727
|
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
1728
|
] }),
|
|
1694
|
-
currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1729
|
+
currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsx(Text, { style: [styles17.step, { color: theme.colors.text }], testID: `${testID}-step`, children: currentStep }) : null,
|
|
1695
1730
|
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: [
|
|
1731
|
+
percent === null && labels.progress !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [styles17.meta, muted], testID: `${testID}-progress-text`, children: labels.progress }) : null,
|
|
1697
1732
|
compact && !open ? /* @__PURE__ */ jsx(RunGroupSummary, { groups, labels, testID: `${testID}-summary` }) : null,
|
|
1698
1733
|
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
1734
|
showTimings ? /* @__PURE__ */ jsx(RunGroupChips, { groups, labels, selectedId, onSelect: setPicked, testID: `${testID}-groups` }) : null,
|