@dloizides/ui-feedback 1.28.0 → 1.30.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 +9 -0
- package/dist/index.d.mts +52 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.js +203 -105
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -107
- package/dist/index.mjs.map +1 -1
- package/package.json +119 -119
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { createContext, useMemo, useContext, useState, useRef, useEffect, useCal
|
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { Platform, StyleSheet, TouchableOpacity, Text, View, ActivityIndicator, Modal, useWindowDimensions, Pressable, Animated } from 'react-native';
|
|
4
4
|
import { MIN_TOUCH_TARGET_PX } from '@dloizides/a11y';
|
|
5
|
-
import { Skeleton } from '@dloizides/ui-motion';
|
|
5
|
+
import { Skeleton, useReducedMotion } from '@dloizides/ui-motion';
|
|
6
6
|
import { Z_INDEX, isFocusVisible, resolveFocusRingColor, resolveOnBrand, UI_DEEP_STEP, UI_MAIN_STEP, focusRingOutline, isHexColor, canCarryAccessibleInk } from '@dloizides/design-tokens';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { LocalModelPhase } from '@dloizides/text-generation';
|
|
@@ -63,6 +63,7 @@ var FEEDBACK_TEST_IDS = {
|
|
|
63
63
|
emptyListCta: "empty-list-cta",
|
|
64
64
|
loadingFallback: "loading-fallback",
|
|
65
65
|
pageSkeleton: "page-skeleton",
|
|
66
|
+
skeletonLines: "skeleton-lines",
|
|
66
67
|
confirmDialog: "confirm-dialog",
|
|
67
68
|
confirmButton: "confirm-button",
|
|
68
69
|
cancelConfirmButton: "cancel-confirm-button",
|
|
@@ -602,6 +603,35 @@ var PageSkeleton = ({
|
|
|
602
603
|
}
|
|
603
604
|
);
|
|
604
605
|
};
|
|
606
|
+
var DEFAULT_GAP = 8;
|
|
607
|
+
var DEFAULT_RADIUS = 4;
|
|
608
|
+
var styles8 = StyleSheet.create({
|
|
609
|
+
stack: { minWidth: 0 }
|
|
610
|
+
});
|
|
611
|
+
var SkeletonLines = ({ lines, gap = DEFAULT_GAP, style, testID = FEEDBACK_TEST_IDS.skeletonLines }) => {
|
|
612
|
+
const { theme, t } = useFeedbackUi();
|
|
613
|
+
const blockColor = String(theme.colors.border);
|
|
614
|
+
return /* @__PURE__ */ jsx(
|
|
615
|
+
View,
|
|
616
|
+
{
|
|
617
|
+
accessibilityHint: t("pageSkeleton.loadingHint"),
|
|
618
|
+
accessibilityLabel: t("pageSkeleton.loadingLabel"),
|
|
619
|
+
"aria-busy": true,
|
|
620
|
+
style: [styles8.stack, { gap }, style],
|
|
621
|
+
testID,
|
|
622
|
+
children: lines.map((line, index) => /* @__PURE__ */ jsx(
|
|
623
|
+
Skeleton,
|
|
624
|
+
{
|
|
625
|
+
backgroundColor: blockColor,
|
|
626
|
+
borderRadius: line.radius ?? DEFAULT_RADIUS,
|
|
627
|
+
height: line.height,
|
|
628
|
+
width: line.width ?? "100%"
|
|
629
|
+
},
|
|
630
|
+
`${String(index)}-${String(line.height)}`
|
|
631
|
+
))
|
|
632
|
+
}
|
|
633
|
+
);
|
|
634
|
+
};
|
|
605
635
|
var DEFAULT_SKELETON_ROWS = 6;
|
|
606
636
|
var AsyncSurface = ({
|
|
607
637
|
loading,
|
|
@@ -651,7 +681,7 @@ function useDialogFocusRing(color) {
|
|
|
651
681
|
return { ringStyle, onFocus, onBlur };
|
|
652
682
|
}
|
|
653
683
|
var DIALOG_MAX_WIDTH = 400;
|
|
654
|
-
var
|
|
684
|
+
var styles9 = StyleSheet.create({
|
|
655
685
|
overlay: {
|
|
656
686
|
flex: 1,
|
|
657
687
|
backgroundColor: MODAL_OVERLAY_COLOR,
|
|
@@ -745,17 +775,17 @@ var ConfirmDialog = ({
|
|
|
745
775
|
animationType: "fade",
|
|
746
776
|
visible,
|
|
747
777
|
onRequestClose: onCancel,
|
|
748
|
-
children: /* @__PURE__ */ jsx(View, { style:
|
|
778
|
+
children: /* @__PURE__ */ jsx(View, { style: styles9.overlay, testID: FEEDBACK_TEST_IDS.confirmDialog, children: /* @__PURE__ */ jsxs(
|
|
749
779
|
View,
|
|
750
780
|
{
|
|
751
781
|
accessibilityViewIsModal: true,
|
|
752
782
|
"aria-label": innerDialogRole === void 0 ? void 0 : title,
|
|
753
783
|
role: innerDialogRole,
|
|
754
|
-
style: [
|
|
784
|
+
style: [styles9.dialog, colorStyles.dialog],
|
|
755
785
|
children: [
|
|
756
|
-
/* @__PURE__ */ jsx(Text, { nativeID: titleId, style: [
|
|
757
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
758
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
786
|
+
/* @__PURE__ */ jsx(Text, { nativeID: titleId, style: [styles9.title, colorStyles.title], children: title }),
|
|
787
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.message, colorStyles.message], children: message }),
|
|
788
|
+
/* @__PURE__ */ jsxs(View, { style: styles9.buttonRow, children: [
|
|
759
789
|
/* @__PURE__ */ jsx(
|
|
760
790
|
TouchableOpacity,
|
|
761
791
|
{
|
|
@@ -763,8 +793,8 @@ var ConfirmDialog = ({
|
|
|
763
793
|
accessibilityLabel: resolvedCancelLabel,
|
|
764
794
|
accessibilityRole: "button",
|
|
765
795
|
style: [
|
|
766
|
-
|
|
767
|
-
|
|
796
|
+
styles9.button,
|
|
797
|
+
styles9.cancelButton,
|
|
768
798
|
colorStyles.cancelButton,
|
|
769
799
|
cancelRing.ringStyle
|
|
770
800
|
],
|
|
@@ -772,7 +802,7 @@ var ConfirmDialog = ({
|
|
|
772
802
|
onBlur: cancelRing.onBlur,
|
|
773
803
|
onFocus: cancelRing.onFocus,
|
|
774
804
|
onPress: onCancel,
|
|
775
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
805
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles9.buttonText, colorStyles.cancelButtonText], children: resolvedCancelLabel })
|
|
776
806
|
}
|
|
777
807
|
),
|
|
778
808
|
/* @__PURE__ */ jsx(
|
|
@@ -784,10 +814,10 @@ var ConfirmDialog = ({
|
|
|
784
814
|
accessibilityState: { disabled: isConfirmDisabled },
|
|
785
815
|
disabled: isConfirmDisabled,
|
|
786
816
|
style: [
|
|
787
|
-
|
|
788
|
-
|
|
817
|
+
styles9.button,
|
|
818
|
+
styles9.confirmButton,
|
|
789
819
|
colorStyles.confirmButton,
|
|
790
|
-
isConfirmDisabled &&
|
|
820
|
+
isConfirmDisabled && styles9.disabledButton,
|
|
791
821
|
confirmRing.ringStyle
|
|
792
822
|
],
|
|
793
823
|
testID: FEEDBACK_TEST_IDS.confirmButton,
|
|
@@ -804,7 +834,7 @@ var ConfirmDialog = ({
|
|
|
804
834
|
) : /* @__PURE__ */ jsx(
|
|
805
835
|
Text,
|
|
806
836
|
{
|
|
807
|
-
style: [
|
|
837
|
+
style: [styles9.buttonText, colorStyles.confirmButtonText],
|
|
808
838
|
children: resolvedConfirmLabel
|
|
809
839
|
}
|
|
810
840
|
)
|
|
@@ -820,7 +850,7 @@ var ConfirmDialog = ({
|
|
|
820
850
|
var ACTION_PADDING_HORIZONTAL = 12;
|
|
821
851
|
var ACTION_BORDER_RADIUS = 6;
|
|
822
852
|
var ACTION_FONT_SIZE = 14;
|
|
823
|
-
var
|
|
853
|
+
var styles10 = StyleSheet.create({
|
|
824
854
|
button: {
|
|
825
855
|
minWidth: MIN_TOUCH_TARGET,
|
|
826
856
|
minHeight: MIN_TOUCH_TARGET,
|
|
@@ -843,10 +873,10 @@ var ToastAction = ({ action, color, testID, onDismiss }) => {
|
|
|
843
873
|
accessibilityHint: action.hint ?? action.label,
|
|
844
874
|
accessibilityLabel: action.label,
|
|
845
875
|
accessibilityRole: "button",
|
|
846
|
-
style: [
|
|
876
|
+
style: [styles10.button, { borderColor: color }],
|
|
847
877
|
testID,
|
|
848
878
|
onPress: handlePress,
|
|
849
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
879
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles10.label, { color }], children: action.label })
|
|
850
880
|
}
|
|
851
881
|
);
|
|
852
882
|
};
|
|
@@ -907,7 +937,7 @@ var C1_CONTROL_END = 159;
|
|
|
907
937
|
var ZERO_WIDTH_START = 8203;
|
|
908
938
|
var ZERO_WIDTH_END = 8207;
|
|
909
939
|
var BYTE_ORDER_MARK = 65279;
|
|
910
|
-
var
|
|
940
|
+
var styles11 = StyleSheet.create({
|
|
911
941
|
container: {
|
|
912
942
|
position: "absolute",
|
|
913
943
|
left: TOAST_HORIZONTAL_MARGIN,
|
|
@@ -984,12 +1014,12 @@ var ToastItem = ({ message, onDone, tone, durationMs, fadeMs, testID }) => {
|
|
|
984
1014
|
{
|
|
985
1015
|
accessibilityLiveRegion: isError ? "assertive" : "polite",
|
|
986
1016
|
role: isError ? "alert" : "status",
|
|
987
|
-
style: [
|
|
1017
|
+
style: [styles11.toast, { backgroundColor: tone.fill, borderColor: tone.border, transform: [{ translateY }], opacity }],
|
|
988
1018
|
testID,
|
|
989
1019
|
children: [
|
|
990
|
-
/* @__PURE__ */ jsx(View, { "aria-hidden": true, importantForAccessibility: "no-hide-descendants", style: [
|
|
991
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
992
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1020
|
+
/* @__PURE__ */ jsx(View, { "aria-hidden": true, importantForAccessibility: "no-hide-descendants", style: [styles11.glyph, { borderColor: tone.ink }], children: /* @__PURE__ */ jsx(Text, { style: [styles11.glyphText, { color: tone.ink }], children: tone.glyph }) }),
|
|
1021
|
+
/* @__PURE__ */ jsxs(View, { style: styles11.body, children: [
|
|
1022
|
+
/* @__PURE__ */ jsx(Text, { style: [styles11.text, { color: tone.ink }], children: message.text }),
|
|
993
1023
|
/* @__PURE__ */ jsx(ErrorReferenceRow, { actionColor: tone.ink, color: tone.ink, testID: `${testID}-reference`, traceId: message.traceId })
|
|
994
1024
|
] }),
|
|
995
1025
|
message.action ? /* @__PURE__ */ jsx(ToastAction, { action: message.action, color: tone.ink, testID: `${testID}-action`, onDismiss: handleDone }) : null
|
|
@@ -1033,7 +1063,7 @@ var ToastHost = ({
|
|
|
1033
1063
|
useEffect(() => subscribe(push), [subscribe, push]);
|
|
1034
1064
|
if (messages.length === 0) return null;
|
|
1035
1065
|
const canPortal = IS_WEB && typeof document !== "undefined";
|
|
1036
|
-
const layer = /* @__PURE__ */ jsx(View, { style: [
|
|
1066
|
+
const layer = /* @__PURE__ */ jsx(View, { style: [styles11.container, { top: toastTop(IS_WEB, topInset) }, canPortal ? WEB_FIXED_LAYER : null], children: messages.map((m) => /* @__PURE__ */ jsx(
|
|
1037
1067
|
ToastItem,
|
|
1038
1068
|
{
|
|
1039
1069
|
durationMs,
|
|
@@ -1109,7 +1139,7 @@ var SUBTITLE_FONT_SIZE = 15;
|
|
|
1109
1139
|
var ATTEMPT_FONT_SIZE = 13;
|
|
1110
1140
|
var CARD_PADDING = 24;
|
|
1111
1141
|
var NO_ATTEMPT = 0;
|
|
1112
|
-
var
|
|
1142
|
+
var styles12 = StyleSheet.create({
|
|
1113
1143
|
overlay: {
|
|
1114
1144
|
position: "absolute",
|
|
1115
1145
|
top: 0,
|
|
@@ -1166,13 +1196,13 @@ var WarmingOverlay = ({
|
|
|
1166
1196
|
{
|
|
1167
1197
|
accessibilityLabel: mergedLabels.accessibilityLabel,
|
|
1168
1198
|
accessibilityRole: "alert",
|
|
1169
|
-
style: [
|
|
1199
|
+
style: [styles12.overlay, { backgroundColor: colors.background }],
|
|
1170
1200
|
testID: testIdPrefix,
|
|
1171
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
1201
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles12.card, children: [
|
|
1172
1202
|
/* @__PURE__ */ jsx(ActivityIndicator, { color: primary, size: "large" }),
|
|
1173
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1174
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1175
|
-
showHint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1203
|
+
/* @__PURE__ */ jsx(Text, { style: [styles12.title, { color: colors.text }], testID: `${testIdPrefix}-title`, children: mergedLabels.title }),
|
|
1204
|
+
/* @__PURE__ */ jsx(Text, { style: [styles12.subtitle, { color: colors.textSecondary }], testID: `${testIdPrefix}-subtitle`, children: mergedLabels.subtitle }),
|
|
1205
|
+
showHint ? /* @__PURE__ */ jsx(Text, { style: [styles12.attempt, { color: colors.textSecondary }], testID: `${testIdPrefix}-attempt`, children: mergedLabels.attemptHint(snapshot2.attempt) }) : null
|
|
1176
1206
|
] })
|
|
1177
1207
|
}
|
|
1178
1208
|
);
|
|
@@ -1229,7 +1259,7 @@ var BUTTON_PADDING_V3 = 12;
|
|
|
1229
1259
|
var BUTTON_BORDER_RADIUS3 = 8;
|
|
1230
1260
|
var BUTTON_MARGIN_TOP3 = 12;
|
|
1231
1261
|
var BUTTON_FONT_SIZE3 = 16;
|
|
1232
|
-
var
|
|
1262
|
+
var styles13 = StyleSheet.create({
|
|
1233
1263
|
container: {
|
|
1234
1264
|
flex: 1,
|
|
1235
1265
|
justifyContent: "center",
|
|
@@ -1303,10 +1333,10 @@ var ErrorBoundaryFallback = ({
|
|
|
1303
1333
|
accessibilityHint: labels.tryAgainHint,
|
|
1304
1334
|
accessibilityLabel: labels.tryAgain,
|
|
1305
1335
|
accessibilityRole: "button",
|
|
1306
|
-
style: [
|
|
1336
|
+
style: [styles13.button, reloadIsPrimary ? secondaryFill : primaryFill],
|
|
1307
1337
|
testID: `${testIDPrefix}-retry-button`,
|
|
1308
1338
|
onPress: onRetry,
|
|
1309
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1339
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles13.buttonText, reloadIsPrimary ? secondaryInk : primaryInk], children: labels.tryAgain })
|
|
1310
1340
|
}
|
|
1311
1341
|
) : null;
|
|
1312
1342
|
const reloadButton = typeof onReload === "function" ? /* @__PURE__ */ jsx(
|
|
@@ -1315,10 +1345,10 @@ var ErrorBoundaryFallback = ({
|
|
|
1315
1345
|
accessibilityHint: labels.reloadHint,
|
|
1316
1346
|
accessibilityLabel: labels.reload,
|
|
1317
1347
|
accessibilityRole: "button",
|
|
1318
|
-
style: [
|
|
1348
|
+
style: [styles13.button, reloadIsPrimary ? primaryFill : secondaryFill],
|
|
1319
1349
|
testID: `${testIDPrefix}-reload-button`,
|
|
1320
1350
|
onPress: onReload,
|
|
1321
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1351
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles13.buttonText, reloadIsPrimary ? primaryInk : secondaryInk], children: labels.reload })
|
|
1322
1352
|
}
|
|
1323
1353
|
) : null;
|
|
1324
1354
|
return /* @__PURE__ */ jsx(
|
|
@@ -1326,20 +1356,20 @@ var ErrorBoundaryFallback = ({
|
|
|
1326
1356
|
{
|
|
1327
1357
|
accessibilityLiveRegion: "assertive",
|
|
1328
1358
|
role: "alert",
|
|
1329
|
-
style: [
|
|
1359
|
+
style: [styles13.container, { backgroundColor: theme.colors.background }],
|
|
1330
1360
|
testID: testIDPrefix,
|
|
1331
|
-
children: /* @__PURE__ */ jsxs(View, { style:
|
|
1332
|
-
logo !== void 0 ? /* @__PURE__ */ jsx(View, { style:
|
|
1333
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1361
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles13.content, children: [
|
|
1362
|
+
logo !== void 0 ? /* @__PURE__ */ jsx(View, { style: styles13.logo, testID: `${testIDPrefix}-logo`, children: logo }) : null,
|
|
1363
|
+
/* @__PURE__ */ jsx(Text, { style: [styles13.title, { color: theme.colors.text }], children: labels.title }),
|
|
1334
1364
|
/* @__PURE__ */ jsx(ErrorState, { message: labels.message, testID: `${testIDPrefix}-message` }),
|
|
1335
1365
|
hasDetails ? /* @__PURE__ */ jsxs(
|
|
1336
1366
|
View,
|
|
1337
1367
|
{
|
|
1338
|
-
style: [
|
|
1368
|
+
style: [styles13.details, { backgroundColor: theme.colors.surface, borderColor: warningColor }],
|
|
1339
1369
|
testID: `${testIDPrefix}-details`,
|
|
1340
1370
|
children: [
|
|
1341
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1342
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1371
|
+
/* @__PURE__ */ jsx(Text, { style: [styles13.detailsTitle, { color: warningText }], children: labels.errorDetails }),
|
|
1372
|
+
/* @__PURE__ */ jsx(Text, { style: [styles13.detailsText, { color: theme.colors.textSecondary }], children: error.message })
|
|
1343
1373
|
]
|
|
1344
1374
|
}
|
|
1345
1375
|
) : null,
|
|
@@ -1352,7 +1382,7 @@ var ErrorBoundaryFallback = ({
|
|
|
1352
1382
|
var CONTAINER_PADDING4 = 20;
|
|
1353
1383
|
var MESSAGE_FONT_SIZE3 = 16;
|
|
1354
1384
|
var MESSAGE_MARGIN_TOP = 12;
|
|
1355
|
-
var
|
|
1385
|
+
var styles14 = StyleSheet.create({
|
|
1356
1386
|
container: {
|
|
1357
1387
|
flex: 1,
|
|
1358
1388
|
justifyContent: "center",
|
|
@@ -1375,11 +1405,11 @@ var ErrorBoundaryRecovering = ({
|
|
|
1375
1405
|
{
|
|
1376
1406
|
accessibilityLiveRegion: "polite",
|
|
1377
1407
|
role: "status",
|
|
1378
|
-
style: [
|
|
1408
|
+
style: [styles14.container, { backgroundColor: theme.colors.background }],
|
|
1379
1409
|
testID,
|
|
1380
1410
|
children: [
|
|
1381
1411
|
/* @__PURE__ */ jsx(ActivityIndicator, { color: theme.palette.primary["500"], size: "large" }),
|
|
1382
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1412
|
+
/* @__PURE__ */ jsx(Text, { style: [styles14.message, { color: theme.colors.textSecondary }], children: message })
|
|
1383
1413
|
]
|
|
1384
1414
|
}
|
|
1385
1415
|
);
|
|
@@ -1481,7 +1511,7 @@ var TRACK_MARGIN = 4;
|
|
|
1481
1511
|
var INDET_FRACTION = 0.35;
|
|
1482
1512
|
var INDET_DURATION_MS = 1300;
|
|
1483
1513
|
var LABEL_FONT_SIZE = 12;
|
|
1484
|
-
var
|
|
1514
|
+
var styles15 = StyleSheet.create({
|
|
1485
1515
|
track: { height: BAR_HEIGHT, borderRadius: RADIUS, overflow: "hidden", marginVertical: TRACK_MARGIN },
|
|
1486
1516
|
fill: { height: "100%", borderRadius: RADIUS },
|
|
1487
1517
|
label: { fontSize: LABEL_FONT_SIZE, textAlign: "right", fontVariant: ["tabular-nums"] }
|
|
@@ -1500,7 +1530,7 @@ function IndeterminateFill({ color, width, testID }) {
|
|
|
1500
1530
|
return /* @__PURE__ */ jsx(
|
|
1501
1531
|
Animated.View,
|
|
1502
1532
|
{
|
|
1503
|
-
style: [
|
|
1533
|
+
style: [styles15.fill, { backgroundColor: color, width: barWidth, transform: [{ translateX }] }],
|
|
1504
1534
|
testID
|
|
1505
1535
|
}
|
|
1506
1536
|
);
|
|
@@ -1535,13 +1565,13 @@ function ProgressBar(props) {
|
|
|
1535
1565
|
role: "progressbar",
|
|
1536
1566
|
testID,
|
|
1537
1567
|
children: [
|
|
1538
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
1539
|
-
!indeterminate && label !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1568
|
+
/* @__PURE__ */ jsx(View, { style: [styles15.track, { backgroundColor: trackColor }], onLayout, children: indeterminate ? /* @__PURE__ */ jsx(IndeterminateFill, { color, testID: fillTestID, width }) : /* @__PURE__ */ jsx(View, { style: [styles15.fill, { backgroundColor: color, width: `${safePct}%` }], testID: fillTestID }) }),
|
|
1569
|
+
!indeterminate && label !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [styles15.label, { color: textColor }], children: label }) : null
|
|
1540
1570
|
]
|
|
1541
1571
|
}
|
|
1542
1572
|
);
|
|
1543
1573
|
}
|
|
1544
|
-
var
|
|
1574
|
+
var styles16 = StyleSheet.create({
|
|
1545
1575
|
button: {
|
|
1546
1576
|
minHeight: MIN_TOUCH_TARGET_PX,
|
|
1547
1577
|
minWidth: MIN_TOUCH_TARGET_PX,
|
|
@@ -1564,9 +1594,9 @@ function RunCardButton({ label, hint, color, onPress, testID, disabled = false,
|
|
|
1564
1594
|
accessibilityState: { disabled, expanded },
|
|
1565
1595
|
disabled,
|
|
1566
1596
|
onPress,
|
|
1567
|
-
style: [
|
|
1597
|
+
style: [styles16.button, { borderColor: color }, disabled ? { opacity: DISABLED_OPACITY } : null],
|
|
1568
1598
|
testID,
|
|
1569
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
1599
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles16.text, { color }], children: label })
|
|
1570
1600
|
}
|
|
1571
1601
|
);
|
|
1572
1602
|
}
|
|
@@ -1644,7 +1674,7 @@ function runToneTextColor(theme, state) {
|
|
|
1644
1674
|
return inks[state] ?? runToneColor(theme, state);
|
|
1645
1675
|
}
|
|
1646
1676
|
var MARK = { done: "\u2713", running: "\u25CF", pending: "\u25CB", failed: "\u2715" };
|
|
1647
|
-
var
|
|
1677
|
+
var styles17 = StyleSheet.create({
|
|
1648
1678
|
row: { flexDirection: "row", flexWrap: "wrap", gap: 6 },
|
|
1649
1679
|
chip: { borderWidth: 1, borderRadius: 6, paddingHorizontal: 10, justifyContent: "center" },
|
|
1650
1680
|
tap: { minHeight: MIN_TOUCH_TARGET_PX },
|
|
@@ -1657,15 +1687,15 @@ function chipText(group, labels) {
|
|
|
1657
1687
|
}
|
|
1658
1688
|
function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect }) {
|
|
1659
1689
|
const { theme } = useFeedbackUi();
|
|
1660
|
-
return /* @__PURE__ */ jsx(View, { style:
|
|
1690
|
+
return /* @__PURE__ */ jsx(View, { style: styles17.row, testID, children: groups.map((group) => {
|
|
1661
1691
|
const color = runToneColor(theme, group.state);
|
|
1662
1692
|
const ink = runToneTextColor(theme, group.state);
|
|
1663
1693
|
const selected = group.id === selectedId;
|
|
1664
1694
|
const a11y = labels.groupA11y(group.label, group.state, labels.formatDuration(group.durationSec));
|
|
1665
|
-
const body = /* @__PURE__ */ jsx(Text, { style: [
|
|
1666
|
-
const look = [
|
|
1695
|
+
const body = /* @__PURE__ */ jsx(Text, { style: [styles17.text, { color: ink }, selected || group.state === "running" ? styles17.strong : null], children: chipText(group, labels) });
|
|
1696
|
+
const look = [styles17.chip, { borderColor: color, backgroundColor: selected ? theme.colors.surfaceElevated : theme.colors.surface }];
|
|
1667
1697
|
if (onSelect === void 0) {
|
|
1668
|
-
return /* @__PURE__ */ jsx(View, { style: [look,
|
|
1698
|
+
return /* @__PURE__ */ jsx(View, { style: [look, styles17.still], accessible: true, accessibilityLabel: a11y, testID: `${testID}-${group.id}`, children: body }, group.id);
|
|
1669
1699
|
}
|
|
1670
1700
|
return /* @__PURE__ */ jsx(
|
|
1671
1701
|
Pressable,
|
|
@@ -1675,7 +1705,7 @@ function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect })
|
|
|
1675
1705
|
accessibilityHint: labels.groupHint,
|
|
1676
1706
|
accessibilityState: { selected },
|
|
1677
1707
|
onPress: () => onSelect(group.id),
|
|
1678
|
-
style: [look,
|
|
1708
|
+
style: [look, styles17.tap],
|
|
1679
1709
|
testID: `${testID}-${group.id}`,
|
|
1680
1710
|
children: body
|
|
1681
1711
|
},
|
|
@@ -1689,8 +1719,8 @@ function RunGroupSummary({ groups, labels, testID }) {
|
|
|
1689
1719
|
const open = groups.filter((g) => g.state !== "done");
|
|
1690
1720
|
const doneColor = runToneColor(theme, "done");
|
|
1691
1721
|
const doneText = labels.doneSummary(done.count, labels.formatDuration(done.durationSec));
|
|
1692
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1693
|
-
done.count > 0 ? /* @__PURE__ */ jsx(View, { style: [
|
|
1722
|
+
return /* @__PURE__ */ jsxs(View, { style: styles17.row, testID, children: [
|
|
1723
|
+
done.count > 0 ? /* @__PURE__ */ jsx(View, { style: [styles17.chip, styles17.still, { borderColor: doneColor }], accessible: true, accessibilityLabel: doneText, testID: `${testID}-done`, children: /* @__PURE__ */ jsx(Text, { style: [styles17.text, { color: runToneTextColor(theme, "done") }], children: `${MARK.done} ${doneText}` }) }) : null,
|
|
1694
1724
|
/* @__PURE__ */ jsx(RunGroupChips, { groups: open, labels, testID: `${testID}-open` })
|
|
1695
1725
|
] });
|
|
1696
1726
|
}
|
|
@@ -1700,7 +1730,7 @@ var LABEL_SHARE = "35%";
|
|
|
1700
1730
|
var LABEL_LINES = 2;
|
|
1701
1731
|
var DURATION_WIDTH = 64;
|
|
1702
1732
|
var PERCENT = 100;
|
|
1703
|
-
var
|
|
1733
|
+
var styles18 = StyleSheet.create({
|
|
1704
1734
|
list: { gap: 6 },
|
|
1705
1735
|
row: { flexDirection: "row", alignItems: "center", gap: 8 },
|
|
1706
1736
|
stack: { gap: 4 },
|
|
@@ -1719,22 +1749,22 @@ function RunStepBars({ steps, maxBars, labels, compact, testID }) {
|
|
|
1719
1749
|
const maxSec = steps.reduce((m, s) => Math.max(m, s.durationSec), 0);
|
|
1720
1750
|
const folded = split.hiddenCount > 0;
|
|
1721
1751
|
const canFold = all && steps.length > maxBars;
|
|
1722
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1752
|
+
return /* @__PURE__ */ jsxs(View, { style: styles18.list, testID, children: [
|
|
1723
1753
|
split.visible.map((step, i) => {
|
|
1724
1754
|
const color = runToneColor(theme, step.state);
|
|
1725
1755
|
const duration = labels.formatDuration(step.durationSec);
|
|
1726
|
-
const strong = step.state === "running" ?
|
|
1727
|
-
const name = /* @__PURE__ */ jsx(Text, { style: [compact ?
|
|
1728
|
-
const time = /* @__PURE__ */ jsx(Text, { style: [
|
|
1729
|
-
const bar = /* @__PURE__ */ jsx(View, { style: [compact ?
|
|
1756
|
+
const strong = step.state === "running" ? styles18.strong : null;
|
|
1757
|
+
const name = /* @__PURE__ */ jsx(Text, { style: [compact ? styles18.compactLabel : styles18.label, { color: theme.colors.text }, strong], numberOfLines: LABEL_LINES, testID: `${testID}-name-${String(i)}`, children: step.label });
|
|
1758
|
+
const time = /* @__PURE__ */ jsx(Text, { style: [styles18.duration, { color: theme.colors.textSecondary }, strong], children: duration });
|
|
1759
|
+
const bar = /* @__PURE__ */ jsx(View, { style: [compact ? styles18.fullTrack : styles18.track, { backgroundColor: theme.colors.border }], children: /* @__PURE__ */ jsx(View, { style: [styles18.fill, { backgroundColor: color, width: `${barFraction(step.durationSec, maxSec) * PERCENT}%` }] }) });
|
|
1730
1760
|
const a11y = { accessible: true, accessibilityLabel: labels.stepA11y(step.label, duration), testID: `${testID}-row-${String(i)}` };
|
|
1731
|
-
return compact ? /* @__PURE__ */ jsxs(View, { style:
|
|
1732
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1761
|
+
return compact ? /* @__PURE__ */ jsxs(View, { style: styles18.stack, ...a11y, children: [
|
|
1762
|
+
/* @__PURE__ */ jsxs(View, { style: styles18.row, children: [
|
|
1733
1763
|
name,
|
|
1734
1764
|
time
|
|
1735
1765
|
] }),
|
|
1736
1766
|
bar
|
|
1737
|
-
] }, `${step.label}-${String(i)}`) : /* @__PURE__ */ jsxs(View, { style:
|
|
1767
|
+
] }, `${step.label}-${String(i)}`) : /* @__PURE__ */ jsxs(View, { style: styles18.row, ...a11y, children: [
|
|
1738
1768
|
name,
|
|
1739
1769
|
bar,
|
|
1740
1770
|
time
|
|
@@ -1755,7 +1785,7 @@ function RunStepBars({ steps, maxBars, labels, compact, testID }) {
|
|
|
1755
1785
|
}
|
|
1756
1786
|
var LIVE_RUN_CARD_COMPACT_MAX_PX = 640;
|
|
1757
1787
|
var DEFAULT_MAX_BARS = 4;
|
|
1758
|
-
var
|
|
1788
|
+
var styles19 = StyleSheet.create({
|
|
1759
1789
|
card: { borderWidth: 1, borderRadius: 8, padding: 14, gap: 10 },
|
|
1760
1790
|
head: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 10 },
|
|
1761
1791
|
titleBox: { flexGrow: 1, flexShrink: 1, flexBasis: 200, minWidth: 0, gap: 2 },
|
|
@@ -1780,18 +1810,18 @@ function LiveRunCard(props) {
|
|
|
1780
1810
|
const percent = progressPercent(progress);
|
|
1781
1811
|
const showTimings = !compact || open;
|
|
1782
1812
|
const muted = { color: theme.colors.textSecondary };
|
|
1783
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
1784
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1785
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
1786
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1787
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1788
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1813
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles19.card, { borderColor: tone, backgroundColor: theme.colors.surface }], testID, children: [
|
|
1814
|
+
/* @__PURE__ */ jsxs(View, { style: styles19.head, children: [
|
|
1815
|
+
/* @__PURE__ */ jsx(View, { style: [styles19.pill, { borderColor: tone }], children: /* @__PURE__ */ jsx(Text, { style: [styles19.pillText, { color: toneText }], testID: `${testID}-status`, children: labels.status }) }),
|
|
1816
|
+
/* @__PURE__ */ jsxs(View, { style: styles19.titleBox, children: [
|
|
1817
|
+
/* @__PURE__ */ jsx(Text, { style: [styles19.title, { color: theme.colors.text }], testID: `${testID}-title`, children: title }),
|
|
1818
|
+
/* @__PURE__ */ jsx(Text, { style: [styles19.meta, muted], testID: `${testID}-meta`, children: labels.meta })
|
|
1789
1819
|
] }),
|
|
1790
1820
|
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
|
|
1791
1821
|
] }),
|
|
1792
|
-
currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1822
|
+
currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsx(Text, { style: [styles19.step, { color: theme.colors.text }], testID: `${testID}-step`, children: currentStep }) : null,
|
|
1793
1823
|
percent !== null ? /* @__PURE__ */ jsx(ProgressBar, { percent, label: labels.progress, accessibilityLabel: labels.progressA11y, color: tone, testID: `${testID}-progress` }) : null,
|
|
1794
|
-
percent === null && labels.progress !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1824
|
+
percent === null && labels.progress !== void 0 ? /* @__PURE__ */ jsx(Text, { style: [styles19.meta, muted], testID: `${testID}-progress-text`, children: labels.progress }) : null,
|
|
1795
1825
|
compact && !open ? /* @__PURE__ */ jsx(RunGroupSummary, { groups, labels, testID: `${testID}-summary` }) : null,
|
|
1796
1826
|
compact ? /* @__PURE__ */ jsx(RunCardButton, { label: labels.stepTimings, hint: labels.stepTimingsHint, color: theme.colors.textSecondary, onPress: () => setOpen(!open), expanded: open, testID: `${testID}-timings-toggle` }) : null,
|
|
1797
1827
|
showTimings ? /* @__PURE__ */ jsx(RunGroupChips, { groups, labels, selectedId, onSelect: setPicked, testID: `${testID}-groups` }) : null,
|
|
@@ -1817,23 +1847,23 @@ var LocalModelGate = ({
|
|
|
1817
1847
|
const consent = useCallback(() => {
|
|
1818
1848
|
model.consent().catch(() => void 0);
|
|
1819
1849
|
}, [model]);
|
|
1820
|
-
const { Card, Text:
|
|
1850
|
+
const { Card, Text: Text20, Button } = slots;
|
|
1821
1851
|
switch (phase) {
|
|
1822
1852
|
case LocalModelPhase.Checking:
|
|
1823
1853
|
return null;
|
|
1824
1854
|
case LocalModelPhase.Blocked:
|
|
1825
|
-
return /* @__PURE__ */ jsx(Card, { testID: testIds.blocked, children: /* @__PURE__ */ jsx(
|
|
1855
|
+
return /* @__PURE__ */ jsx(Card, { testID: testIds.blocked, children: /* @__PURE__ */ jsx(Text20, { children: labels.blocked(block) }) });
|
|
1826
1856
|
case LocalModelPhase.Offer:
|
|
1827
1857
|
return /* @__PURE__ */ jsxs(Card, { testID: testIds.offer, children: [
|
|
1828
|
-
/* @__PURE__ */ jsx(
|
|
1829
|
-
/* @__PURE__ */ jsx(
|
|
1858
|
+
/* @__PURE__ */ jsx(Text20, { heading: true, children: labels.title }),
|
|
1859
|
+
/* @__PURE__ */ jsx(Text20, { children: labels.offerBody }),
|
|
1830
1860
|
/* @__PURE__ */ jsx(Button, { hint: labels.consentHint, label: labels.consent, testID: testIds.consent, onPress: consent })
|
|
1831
1861
|
] });
|
|
1832
1862
|
case LocalModelPhase.Loading:
|
|
1833
|
-
return /* @__PURE__ */ jsx(Card, { testID: testIds.loading, children: /* @__PURE__ */ jsx(
|
|
1863
|
+
return /* @__PURE__ */ jsx(Card, { testID: testIds.loading, children: /* @__PURE__ */ jsx(Text20, { children: labels.loading(String(Math.round(progress * PERCENT2))) }) });
|
|
1834
1864
|
case LocalModelPhase.Failed:
|
|
1835
1865
|
return /* @__PURE__ */ jsxs(Card, { testID: testIds.failed, children: [
|
|
1836
|
-
/* @__PURE__ */ jsx(
|
|
1866
|
+
/* @__PURE__ */ jsx(Text20, { children: labels.failed }),
|
|
1837
1867
|
/* @__PURE__ */ jsx(Button, { hint: labels.consentHint, label: labels.retry, testID: testIds.consent, onPress: consent })
|
|
1838
1868
|
] });
|
|
1839
1869
|
case LocalModelPhase.Ready:
|
|
@@ -1847,7 +1877,7 @@ var GAP = 8;
|
|
|
1847
1877
|
var MIN_HIT = 44;
|
|
1848
1878
|
var TITLE_FONT = 14;
|
|
1849
1879
|
var DETAIL_FONT = 12;
|
|
1850
|
-
var
|
|
1880
|
+
var styles20 = StyleSheet.create({
|
|
1851
1881
|
detail: { fontSize: DETAIL_FONT },
|
|
1852
1882
|
row: { alignItems: "center", flexDirection: "row", justifyContent: "space-between" },
|
|
1853
1883
|
statusUnder: { alignSelf: "flex-start" },
|
|
@@ -1859,12 +1889,12 @@ var styles19 = StyleSheet.create({
|
|
|
1859
1889
|
var CheckStatus = (props) => {
|
|
1860
1890
|
const { title, detail, status, variant = "tile", statusUnderTitleEnabled = false, onPress, accessibilityLabel, accessibilityHint, testID } = props;
|
|
1861
1891
|
const { theme } = useFeedbackUi();
|
|
1862
|
-
const style = [
|
|
1892
|
+
const style = [styles20.wrap, variant === "tile" ? styles20.tile : styles20.row, { backgroundColor: theme.colors.surface, borderColor: theme.colors.border }];
|
|
1863
1893
|
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1864
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1865
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1866
|
-
statusUnderTitleEnabled ? /* @__PURE__ */ jsx(View, { style:
|
|
1867
|
-
detail === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [
|
|
1894
|
+
/* @__PURE__ */ jsxs(View, { style: styles20.words, children: [
|
|
1895
|
+
/* @__PURE__ */ jsx(Text, { style: [styles20.title, { color: theme.colors.text }], children: title }),
|
|
1896
|
+
statusUnderTitleEnabled ? /* @__PURE__ */ jsx(View, { style: styles20.statusUnder, children: status }) : null,
|
|
1897
|
+
detail === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [styles20.detail, { color: theme.colors.textSecondary }], children: detail })
|
|
1868
1898
|
] }),
|
|
1869
1899
|
statusUnderTitleEnabled ? null : status
|
|
1870
1900
|
] });
|
|
@@ -1884,7 +1914,7 @@ function pipelineItemVariant(width, breakpoint = PIPELINE_COLLAPSE_BREAKPOINT, p
|
|
|
1884
1914
|
return variant === "row" && phoneColumns > 1 ? "tile" : variant;
|
|
1885
1915
|
}
|
|
1886
1916
|
var GRID_GAP_SHARE = 2;
|
|
1887
|
-
var
|
|
1917
|
+
var styles21 = StyleSheet.create({
|
|
1888
1918
|
grid: { flexDirection: "row", flexWrap: "wrap", gap: 8 },
|
|
1889
1919
|
list: { gap: 8 },
|
|
1890
1920
|
row: { flexDirection: "row", gap: 12 }
|
|
@@ -1895,7 +1925,7 @@ var CheckPipeline = ({ items, breakpoint, accessibilityLabel, accessibilityHint,
|
|
|
1895
1925
|
const itemVariant = pipelineItemVariant(width, breakpoint, phoneColumns);
|
|
1896
1926
|
const grid = variant !== itemVariant;
|
|
1897
1927
|
const cell = { flexBasis: `${Math.floor(100 / phoneColumns) - GRID_GAP_SHARE}%`, flexGrow: 1 };
|
|
1898
|
-
const containerStyle = variant === "tile" ?
|
|
1928
|
+
const containerStyle = variant === "tile" ? styles21.row : grid ? styles21.grid : styles21.list;
|
|
1899
1929
|
return /* @__PURE__ */ jsx(View, { accessibilityHint, accessibilityLabel, accessibilityRole: "summary", style: containerStyle, testID, children: items.map(({ id, ...item }) => {
|
|
1900
1930
|
const check = /* @__PURE__ */ jsx(CheckStatus, { ...item, statusUnderTitleEnabled, variant: itemVariant }, id);
|
|
1901
1931
|
return grid ? /* @__PURE__ */ jsx(View, { style: cell, children: check }, id) : check;
|
|
@@ -1922,7 +1952,7 @@ var MARKER_HEIGHT = 16;
|
|
|
1922
1952
|
var MARKER_TOP = -4;
|
|
1923
1953
|
var RADIUS3 = 999;
|
|
1924
1954
|
var FONT = 12;
|
|
1925
|
-
var
|
|
1955
|
+
var styles22 = StyleSheet.create({
|
|
1926
1956
|
fill: { borderRadius: RADIUS3, height: "100%" },
|
|
1927
1957
|
head: { flexDirection: "row", flexWrap: "wrap", gap: 8, justifyContent: "space-between" },
|
|
1928
1958
|
marker: { height: MARKER_HEIGHT, marginLeft: -MARKER_WIDTH / 2, position: "absolute", top: MARKER_TOP, width: MARKER_WIDTH },
|
|
@@ -1938,14 +1968,14 @@ var ThresholdMeter = (props) => {
|
|
|
1938
1968
|
const { theme } = useFeedbackUi();
|
|
1939
1969
|
const passes = meetsThreshold(value, threshold, lowerPasses);
|
|
1940
1970
|
const fill = passes ? semanticScale(theme, "success") ?? theme.palette.primary["500"] : theme.semantic.error["500"];
|
|
1941
|
-
return /* @__PURE__ */ jsxs(View, { accessibilityHint, accessibilityLabel: label, "aria-valuemax": max, "aria-valuemin": 0, "aria-valuenow": value, "aria-valuetext": valueText, role: "meter", style:
|
|
1942
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1943
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1944
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1971
|
+
return /* @__PURE__ */ jsxs(View, { accessibilityHint, accessibilityLabel: label, "aria-valuemax": max, "aria-valuemin": 0, "aria-valuenow": value, "aria-valuetext": valueText, role: "meter", style: styles22.wrap, testID, children: [
|
|
1972
|
+
/* @__PURE__ */ jsxs(View, { style: styles22.head, children: [
|
|
1973
|
+
/* @__PURE__ */ jsx(Text, { style: [styles22.text, { color: theme.colors.textSecondary }], children: label }),
|
|
1974
|
+
/* @__PURE__ */ jsx(Text, { style: [styles22.text, { color: theme.colors.text }], children: valueText })
|
|
1945
1975
|
] }),
|
|
1946
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
1947
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
1948
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
1976
|
+
/* @__PURE__ */ jsxs(View, { style: [styles22.track, { backgroundColor: theme.colors.border }], children: [
|
|
1977
|
+
/* @__PURE__ */ jsx(View, { style: [styles22.fill, { backgroundColor: fill, width: `${meterPercent(value, max)}%` }], testID: partId(testID, "fill") }),
|
|
1978
|
+
/* @__PURE__ */ jsx(View, { style: [styles22.marker, { backgroundColor: theme.colors.text, left: `${meterPercent(threshold, max)}%` }], testID: partId(testID, "threshold") })
|
|
1949
1979
|
] })
|
|
1950
1980
|
] });
|
|
1951
1981
|
};
|
|
@@ -1956,7 +1986,7 @@ var STACK_GAP = 12;
|
|
|
1956
1986
|
var TITLE_FONT2 = 15;
|
|
1957
1987
|
var HEADING_FONT = 16;
|
|
1958
1988
|
var MESSAGE_FONT = 14;
|
|
1959
|
-
var
|
|
1989
|
+
var styles23 = StyleSheet.create({
|
|
1960
1990
|
card: { borderRadius: RADIUS4, borderWidth: 1, gap: GAP2, minWidth: 0, padding: PAD2 },
|
|
1961
1991
|
head: { alignItems: "center", flexDirection: "row", flexWrap: "wrap", gap: GAP2, justifyContent: "space-between" },
|
|
1962
1992
|
heading: { flexShrink: 1, fontSize: HEADING_FONT, fontWeight: "700" },
|
|
@@ -1966,20 +1996,84 @@ var styles22 = StyleSheet.create({
|
|
|
1966
1996
|
});
|
|
1967
1997
|
var AttentionCard = ({ title, heading, status, message, evidence, action, testID }) => {
|
|
1968
1998
|
const { theme } = useFeedbackUi();
|
|
1969
|
-
return /* @__PURE__ */ jsxs(View, { style: [
|
|
1970
|
-
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [
|
|
1971
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1972
|
-
heading === void 0 ? null : /* @__PURE__ */ jsxs(View, { style:
|
|
1973
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
1999
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles23.card, { backgroundColor: theme.colors.surfaceElevated, borderColor: theme.colors.border }], testID, children: [
|
|
2000
|
+
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles23.title, { color: theme.colors.text }], children: title }),
|
|
2001
|
+
/* @__PURE__ */ jsxs(View, { style: styles23.stack, children: [
|
|
2002
|
+
heading === void 0 ? null : /* @__PURE__ */ jsxs(View, { style: styles23.head, testID: testID === void 0 ? void 0 : `${testID}-head`, children: [
|
|
2003
|
+
/* @__PURE__ */ jsx(Text, { style: [styles23.heading, { color: theme.colors.text }], children: heading }),
|
|
1974
2004
|
status
|
|
1975
2005
|
] }),
|
|
1976
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2006
|
+
/* @__PURE__ */ jsx(Text, { style: [styles23.message, { color: theme.colors.textSecondary }], children: message }),
|
|
1977
2007
|
evidence,
|
|
1978
2008
|
action
|
|
1979
2009
|
] })
|
|
1980
2010
|
] });
|
|
1981
2011
|
};
|
|
1982
2012
|
|
|
1983
|
-
|
|
2013
|
+
// src/StatusTile/tileMotion.ts
|
|
2014
|
+
var TILE_MOTION_MS = 160;
|
|
2015
|
+
var LIFT = -2;
|
|
2016
|
+
var EASE_OUT = "cubic-bezier(0.23, 1, 0.32, 1)";
|
|
2017
|
+
var RAISED_OPACITY = 0.12;
|
|
2018
|
+
var PRESSED_OPACITY = 0.06;
|
|
2019
|
+
var RAISED_RADIUS = 10;
|
|
2020
|
+
var PRESSED_RADIUS = 4;
|
|
2021
|
+
var RAISED_OFFSET = 4;
|
|
2022
|
+
var PRESSED_OFFSET = 1;
|
|
2023
|
+
var FOCUS_RING = 2;
|
|
2024
|
+
function shadowOf(theme, pressed) {
|
|
2025
|
+
return {
|
|
2026
|
+
shadowColor: theme.colors.text,
|
|
2027
|
+
shadowOffset: { width: 0, height: pressed ? PRESSED_OFFSET : RAISED_OFFSET },
|
|
2028
|
+
shadowOpacity: pressed ? PRESSED_OPACITY : RAISED_OPACITY,
|
|
2029
|
+
shadowRadius: pressed ? PRESSED_RADIUS : RAISED_RADIUS
|
|
2030
|
+
};
|
|
2031
|
+
}
|
|
2032
|
+
function tileMotionStyle(theme, input) {
|
|
2033
|
+
const { interaction, reduced, interactive, accentColor } = input;
|
|
2034
|
+
if (!interactive) return {};
|
|
2035
|
+
const active = interaction.hovered || interaction.focused || interaction.pressed;
|
|
2036
|
+
const transition = reduced ? {} : { transitionDuration: `${String(TILE_MOTION_MS)}ms`, transitionProperty: "transform, box-shadow, border-color", transitionTimingFunction: EASE_OUT };
|
|
2037
|
+
const lift = reduced || !active || interaction.pressed ? {} : { transform: [{ translateY: LIFT }] };
|
|
2038
|
+
const tone = !active || accentColor !== void 0 ? {} : { borderColor: theme.colors.textSecondary };
|
|
2039
|
+
const ring = !interaction.focused ? {} : { outlineColor: theme.palette.primary["500"], outlineStyle: "solid", outlineWidth: FOCUS_RING };
|
|
2040
|
+
return { ...transition, ...active ? shadowOf(theme, interaction.pressed) : {}, ...lift, ...tone, ...ring };
|
|
2041
|
+
}
|
|
2042
|
+
var RADIUS5 = 8;
|
|
2043
|
+
var PAD3 = 12;
|
|
2044
|
+
var ACCENT = 3;
|
|
2045
|
+
var MIN_HIT2 = 44;
|
|
2046
|
+
var styles24 = StyleSheet.create({
|
|
2047
|
+
head: { alignItems: "center", flexDirection: "row", gap: 6 },
|
|
2048
|
+
line: { fontSize: 13 },
|
|
2049
|
+
meta: { fontSize: 12 },
|
|
2050
|
+
status: { alignSelf: "flex-start" },
|
|
2051
|
+
muted: { borderStyle: "dashed" },
|
|
2052
|
+
title: { flexShrink: 1, fontSize: 14, fontWeight: "700" },
|
|
2053
|
+
wrap: { borderRadius: RADIUS5, borderWidth: 1, gap: 6, minHeight: MIN_HIT2, minWidth: 0, padding: PAD3 }
|
|
2054
|
+
});
|
|
2055
|
+
var StatusTile = ({ title, icon, status, lines, accentColor, muted = false, onPress, accessibilityLabel, accessibilityHint, testID }) => {
|
|
2056
|
+
const { theme } = useFeedbackUi();
|
|
2057
|
+
const reduced = useReducedMotion();
|
|
2058
|
+
const accent = accentColor === void 0 ? { borderColor: theme.colors.border } : { borderColor: accentColor, borderTopWidth: ACCENT, paddingTop: PAD3 - ACCENT + 1 };
|
|
2059
|
+
const interactive = onPress !== void 0;
|
|
2060
|
+
const styleOf = (state) => [
|
|
2061
|
+
styles24.wrap,
|
|
2062
|
+
{ backgroundColor: muted ? theme.colors.background : theme.colors.surface },
|
|
2063
|
+
accent,
|
|
2064
|
+
muted ? styles24.muted : null,
|
|
2065
|
+
tileMotionStyle(theme, { interaction: { hovered: state.hovered === true, pressed: state.pressed, focused: state.focused === true }, reduced, interactive, accentColor })
|
|
2066
|
+
];
|
|
2067
|
+
return /* @__PURE__ */ jsxs(Pressable, { accessibilityHint, accessibilityLabel, accessibilityRole: interactive ? "button" : void 0, disabled: !interactive, style: styleOf, testID, onPress, children: [
|
|
2068
|
+
/* @__PURE__ */ jsxs(View, { style: styles24.head, children: [
|
|
2069
|
+
icon,
|
|
2070
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles24.title, { color: muted ? theme.colors.textSecondary : theme.colors.text }], children: title })
|
|
2071
|
+
] }),
|
|
2072
|
+
status === void 0 ? null : /* @__PURE__ */ jsx(View, { style: styles24.status, children: status }),
|
|
2073
|
+
lines.map((line, index) => /* @__PURE__ */ jsx(Text, { numberOfLines: 2, style: [index === 0 ? styles24.line : styles24.meta, { color: index === 0 && !muted ? theme.colors.text : theme.colors.textSecondary }], children: line }, `${String(index)}-${line}`))
|
|
2074
|
+
] });
|
|
2075
|
+
};
|
|
2076
|
+
|
|
2077
|
+
export { AppErrorBoundary, AsyncSurface, AttentionCard, COPY_FEEDBACK_MS, CheckPipeline, CheckStatus, ConfirmDialog, CopyStatus, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, ErrorNotice, ErrorReferenceRow, ErrorState, FEEDBACK_TEST_IDS, FeedbackUiProvider, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, LoadingFallback, LocalModelGate, MODAL_OVERLAY_COLOR, PIPELINE_COLLAPSE_BREAKPOINT, PageSkeleton, ProgressBar, SkeletonLines, StatusTile, TILE_MOTION_MS, ThresholdMeter, ToastHost, FeedbackUiProvider as UiProvider, UiThemeOverride, WARMING_QUIET_PERIOD_MS, WarmingOverlay, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, meetsThreshold, mergeRunSteps, meterPercent, notifyWarming, pipelineItemVariant, pipelineVariant, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, tileMotionStyle, useCopyToClipboard, useFeedbackUi, useLocalModel, useFeedbackUi as useUi };
|
|
1984
2078
|
//# sourceMappingURL=index.mjs.map
|
|
1985
2079
|
//# sourceMappingURL=index.mjs.map
|