@dloizides/ui-feedback 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +18 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -330,7 +330,7 @@ var ErrorState = ({
|
|
|
330
330
|
const primary = theme.palette.primary["500"];
|
|
331
331
|
const hasTitle = typeof title === "string" && title !== "";
|
|
332
332
|
const hasIcon = icon !== void 0 && icon !== null;
|
|
333
|
-
const messageColor = hasTitle ? theme.colors.textSecondary : errorColor;
|
|
333
|
+
const messageColor = hasTitle ? theme.colors.textSecondary : theme.semanticText?.error ?? errorColor;
|
|
334
334
|
const retry = typeof onRetry === "function" ? /* @__PURE__ */ jsx(
|
|
335
335
|
TouchableOpacity,
|
|
336
336
|
{
|
|
@@ -1192,6 +1192,7 @@ var ErrorBoundaryFallback = ({
|
|
|
1192
1192
|
}) => {
|
|
1193
1193
|
const { theme } = useFeedbackUi();
|
|
1194
1194
|
const warningColor = (theme.semantic.warning ?? theme.semantic.error)["500"];
|
|
1195
|
+
const warningText = theme.semanticText?.warning ?? warningColor;
|
|
1195
1196
|
const primaryColor = theme.palette.primary["500"];
|
|
1196
1197
|
const hasDetails = showDetails && error !== null;
|
|
1197
1198
|
const primaryFill = { backgroundColor: primaryColor };
|
|
@@ -1239,7 +1240,7 @@ var ErrorBoundaryFallback = ({
|
|
|
1239
1240
|
style: [styles10.details, { backgroundColor: theme.colors.surface, borderColor: warningColor }],
|
|
1240
1241
|
testID: `${testIDPrefix}-details`,
|
|
1241
1242
|
children: [
|
|
1242
|
-
/* @__PURE__ */ jsx(Text, { style: [styles10.detailsTitle, { color:
|
|
1243
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.detailsTitle, { color: warningText }], children: labels.errorDetails }),
|
|
1243
1244
|
/* @__PURE__ */ jsx(Text, { style: [styles10.detailsText, { color: theme.colors.textSecondary }], children: error.message })
|
|
1244
1245
|
]
|
|
1245
1246
|
}
|
|
@@ -1535,6 +1536,15 @@ function runToneColor(theme, state) {
|
|
|
1535
1536
|
if (state === "done") return scale(theme, "success") ?? theme.colors.text;
|
|
1536
1537
|
return theme.colors.textSecondary;
|
|
1537
1538
|
}
|
|
1539
|
+
function runToneTextColor(theme, state) {
|
|
1540
|
+
const inks = {
|
|
1541
|
+
failed: theme.semanticText?.error,
|
|
1542
|
+
running: theme.semanticText?.warning,
|
|
1543
|
+
done: theme.semanticText?.success,
|
|
1544
|
+
pending: void 0
|
|
1545
|
+
};
|
|
1546
|
+
return inks[state] ?? runToneColor(theme, state);
|
|
1547
|
+
}
|
|
1538
1548
|
var MARK = { done: "\u2713", running: "\u25CF", pending: "\u25CB", failed: "\u2715" };
|
|
1539
1549
|
var styles14 = StyleSheet.create({
|
|
1540
1550
|
row: { flexDirection: "row", flexWrap: "wrap", gap: 6 },
|
|
@@ -1551,9 +1561,10 @@ function RunGroupChips({ groups, labels, testID, selectedId = null, onSelect })
|
|
|
1551
1561
|
const { theme } = useFeedbackUi();
|
|
1552
1562
|
return /* @__PURE__ */ jsx(View, { style: styles14.row, testID, children: groups.map((group) => {
|
|
1553
1563
|
const color = runToneColor(theme, group.state);
|
|
1564
|
+
const ink = runToneTextColor(theme, group.state);
|
|
1554
1565
|
const selected = group.id === selectedId;
|
|
1555
1566
|
const a11y = labels.groupA11y(group.label, group.state, labels.formatDuration(group.durationSec));
|
|
1556
|
-
const body = /* @__PURE__ */ jsx(Text, { style: [styles14.text, { color }, selected || group.state === "running" ? styles14.strong : null], children: chipText(group, labels) });
|
|
1567
|
+
const body = /* @__PURE__ */ jsx(Text, { style: [styles14.text, { color: ink }, selected || group.state === "running" ? styles14.strong : null], children: chipText(group, labels) });
|
|
1557
1568
|
const look = [styles14.chip, { borderColor: color, backgroundColor: selected ? theme.colors.surfaceElevated : theme.colors.surface }];
|
|
1558
1569
|
if (onSelect === void 0) {
|
|
1559
1570
|
return /* @__PURE__ */ jsx(View, { style: [look, styles14.still], accessible: true, accessibilityLabel: a11y, testID: `${testID}-${group.id}`, children: body }, group.id);
|
|
@@ -1581,7 +1592,7 @@ function RunGroupSummary({ groups, labels, testID }) {
|
|
|
1581
1592
|
const doneColor = runToneColor(theme, "done");
|
|
1582
1593
|
const doneText = labels.doneSummary(done.count, labels.formatDuration(done.durationSec));
|
|
1583
1594
|
return /* @__PURE__ */ jsxs(View, { style: styles14.row, testID, children: [
|
|
1584
|
-
done.count > 0 ? /* @__PURE__ */ jsx(View, { style: [styles14.chip, styles14.still, { borderColor: doneColor }], accessible: true, accessibilityLabel: doneText, testID: `${testID}-done`, children: /* @__PURE__ */ jsx(Text, { style: [styles14.text, { color:
|
|
1595
|
+
done.count > 0 ? /* @__PURE__ */ jsx(View, { style: [styles14.chip, styles14.still, { borderColor: doneColor }], accessible: true, accessibilityLabel: doneText, testID: `${testID}-done`, children: /* @__PURE__ */ jsx(Text, { style: [styles14.text, { color: runToneTextColor(theme, "done") }], children: `${MARK.done} ${doneText}` }) }) : null,
|
|
1585
1596
|
/* @__PURE__ */ jsx(RunGroupChips, { groups: open, labels, testID: `${testID}-open` })
|
|
1586
1597
|
] });
|
|
1587
1598
|
}
|
|
@@ -1667,17 +1678,18 @@ function LiveRunCard(props) {
|
|
|
1667
1678
|
const selectedId = groups.some((g) => g.id === picked) ? picked : defaultGroupId(groups);
|
|
1668
1679
|
const selected = groups.find((g) => g.id === selectedId);
|
|
1669
1680
|
const tone = runToneColor(theme, status);
|
|
1681
|
+
const toneText = runToneTextColor(theme, status);
|
|
1670
1682
|
const percent = progressPercent(progress);
|
|
1671
1683
|
const showTimings = !compact || open;
|
|
1672
1684
|
const muted = { color: theme.colors.textSecondary };
|
|
1673
1685
|
return /* @__PURE__ */ jsxs(View, { style: [styles16.card, { borderColor: tone, backgroundColor: theme.colors.surface }], testID, children: [
|
|
1674
1686
|
/* @__PURE__ */ jsxs(View, { style: styles16.head, children: [
|
|
1675
|
-
/* @__PURE__ */ jsx(View, { style: [styles16.pill, { borderColor: tone }], children: /* @__PURE__ */ jsx(Text, { style: [styles16.pillText, { color:
|
|
1687
|
+
/* @__PURE__ */ jsx(View, { style: [styles16.pill, { borderColor: tone }], children: /* @__PURE__ */ jsx(Text, { style: [styles16.pillText, { color: toneText }], testID: `${testID}-status`, children: labels.status }) }),
|
|
1676
1688
|
/* @__PURE__ */ jsxs(View, { style: styles16.titleBox, children: [
|
|
1677
1689
|
/* @__PURE__ */ jsx(Text, { style: [styles16.title, { color: theme.colors.text }], testID: `${testID}-title`, children: title }),
|
|
1678
1690
|
/* @__PURE__ */ jsx(Text, { style: [styles16.meta, muted], testID: `${testID}-meta`, children: labels.meta })
|
|
1679
1691
|
] }),
|
|
1680
|
-
onCancel !== void 0 ? /* @__PURE__ */ jsx(RunCardButton, { label: labels.cancel, hint: labels.cancelHint, color: theme.semantic.error["500"], onPress: onCancel, disabled: cancelDisabled, testID: `${testID}-cancel` }) : null
|
|
1692
|
+
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
|
|
1681
1693
|
] }),
|
|
1682
1694
|
currentStep !== null && currentStep !== "" ? /* @__PURE__ */ jsx(Text, { style: [styles16.step, { color: theme.colors.text }], testID: `${testID}-step`, children: currentStep }) : null,
|
|
1683
1695
|
percent !== null ? /* @__PURE__ */ jsx(ProgressBar, { percent, label: labels.progress, accessibilityLabel: labels.progressA11y, color: tone, testID: `${testID}-progress` }) : null,
|