@dloizides/ui-feedback 1.30.0 → 1.31.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 +4 -0
- package/dist/index.d.mts +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +36 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1847,23 +1847,23 @@ var LocalModelGate = ({
|
|
|
1847
1847
|
const consent = useCallback(() => {
|
|
1848
1848
|
model.consent().catch(() => void 0);
|
|
1849
1849
|
}, [model]);
|
|
1850
|
-
const { Card, Text:
|
|
1850
|
+
const { Card, Text: Text21, Button } = slots;
|
|
1851
1851
|
switch (phase) {
|
|
1852
1852
|
case LocalModelPhase.Checking:
|
|
1853
1853
|
return null;
|
|
1854
1854
|
case LocalModelPhase.Blocked:
|
|
1855
|
-
return /* @__PURE__ */ jsx(Card, { testID: testIds.blocked, children: /* @__PURE__ */ jsx(
|
|
1855
|
+
return /* @__PURE__ */ jsx(Card, { testID: testIds.blocked, children: /* @__PURE__ */ jsx(Text21, { children: labels.blocked(block) }) });
|
|
1856
1856
|
case LocalModelPhase.Offer:
|
|
1857
1857
|
return /* @__PURE__ */ jsxs(Card, { testID: testIds.offer, children: [
|
|
1858
|
-
/* @__PURE__ */ jsx(
|
|
1859
|
-
/* @__PURE__ */ jsx(
|
|
1858
|
+
/* @__PURE__ */ jsx(Text21, { heading: true, children: labels.title }),
|
|
1859
|
+
/* @__PURE__ */ jsx(Text21, { children: labels.offerBody }),
|
|
1860
1860
|
/* @__PURE__ */ jsx(Button, { hint: labels.consentHint, label: labels.consent, testID: testIds.consent, onPress: consent })
|
|
1861
1861
|
] });
|
|
1862
1862
|
case LocalModelPhase.Loading:
|
|
1863
|
-
return /* @__PURE__ */ jsx(Card, { testID: testIds.loading, children: /* @__PURE__ */ jsx(
|
|
1863
|
+
return /* @__PURE__ */ jsx(Card, { testID: testIds.loading, children: /* @__PURE__ */ jsx(Text21, { children: labels.loading(String(Math.round(progress * PERCENT2))) }) });
|
|
1864
1864
|
case LocalModelPhase.Failed:
|
|
1865
1865
|
return /* @__PURE__ */ jsxs(Card, { testID: testIds.failed, children: [
|
|
1866
|
-
/* @__PURE__ */ jsx(
|
|
1866
|
+
/* @__PURE__ */ jsx(Text21, { children: labels.failed }),
|
|
1867
1867
|
/* @__PURE__ */ jsx(Button, { hint: labels.consentHint, label: labels.retry, testID: testIds.consent, onPress: consent })
|
|
1868
1868
|
] });
|
|
1869
1869
|
case LocalModelPhase.Ready:
|
|
@@ -2043,6 +2043,7 @@ var RADIUS5 = 8;
|
|
|
2043
2043
|
var PAD3 = 12;
|
|
2044
2044
|
var ACCENT = 3;
|
|
2045
2045
|
var MIN_HIT2 = 44;
|
|
2046
|
+
var STATUS_TILE_TEST_ID = "status-tile";
|
|
2046
2047
|
var styles24 = StyleSheet.create({
|
|
2047
2048
|
head: { alignItems: "center", flexDirection: "row", gap: 6 },
|
|
2048
2049
|
line: { fontSize: 13 },
|
|
@@ -2064,7 +2065,7 @@ var StatusTile = ({ title, icon, status, lines, accentColor, muted = false, onPr
|
|
|
2064
2065
|
muted ? styles24.muted : null,
|
|
2065
2066
|
tileMotionStyle(theme, { interaction: { hovered: state.hovered === true, pressed: state.pressed, focused: state.focused === true }, reduced, interactive, accentColor })
|
|
2066
2067
|
];
|
|
2067
|
-
return /* @__PURE__ */ jsxs(Pressable, { accessibilityHint, accessibilityLabel, accessibilityRole: interactive ? "button" : void 0, disabled: !interactive, style: styleOf, testID, onPress, children: [
|
|
2068
|
+
return /* @__PURE__ */ jsxs(Pressable, { accessibilityHint, accessibilityLabel, accessibilityRole: interactive ? "button" : void 0, disabled: !interactive, style: styleOf, testID: testID ?? STATUS_TILE_TEST_ID, onPress, children: [
|
|
2068
2069
|
/* @__PURE__ */ jsxs(View, { style: styles24.head, children: [
|
|
2069
2070
|
icon,
|
|
2070
2071
|
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles24.title, { color: muted ? theme.colors.textSecondary : theme.colors.text }], children: title })
|
|
@@ -2073,7 +2074,31 @@ var StatusTile = ({ title, icon, status, lines, accentColor, muted = false, onPr
|
|
|
2073
2074
|
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
|
] });
|
|
2075
2076
|
};
|
|
2077
|
+
var PERCENT4 = 100;
|
|
2078
|
+
var BAR_HEIGHT3 = 6;
|
|
2079
|
+
var MARK_HEIGHT = 14;
|
|
2080
|
+
var MARK_WIDTH = 2;
|
|
2081
|
+
var styles25 = StyleSheet.create({
|
|
2082
|
+
fill: { borderRadius: BAR_HEIGHT3 / 2, height: BAR_HEIGHT3 },
|
|
2083
|
+
mark: { height: MARK_HEIGHT, position: "absolute", top: (BAR_HEIGHT3 - MARK_HEIGHT) / 2, width: MARK_WIDTH },
|
|
2084
|
+
track: { borderRadius: BAR_HEIGHT3 / 2, height: BAR_HEIGHT3, overflow: "visible", width: "100%" }
|
|
2085
|
+
});
|
|
2086
|
+
function scorePercentOf(value) {
|
|
2087
|
+
const clamped = Math.min(PERCENT4, Math.max(0, value * PERCENT4));
|
|
2088
|
+
return `${clamped}%`;
|
|
2089
|
+
}
|
|
2090
|
+
var ScoreBar = ({ value, threshold, colors, label, hint, testID }) => /* @__PURE__ */ jsxs(View, { accessibilityHint: hint, accessibilityLabel: label, accessibilityRole: "progressbar", style: [styles25.track, { backgroundColor: colors.track }], testID, children: [
|
|
2091
|
+
/* @__PURE__ */ jsx(View, { style: [styles25.fill, { backgroundColor: colors.fill, width: scorePercentOf(value) }] }),
|
|
2092
|
+
threshold === null ? null : /* @__PURE__ */ jsx(View, { style: [styles25.mark, { backgroundColor: colors.mark, left: scorePercentOf(threshold) }], testID: `${testID}-threshold` })
|
|
2093
|
+
] });
|
|
2094
|
+
var DEFAULT_SIZE = 18;
|
|
2095
|
+
var RING_WIDTH = 1.5;
|
|
2096
|
+
var styles26 = StyleSheet.create({
|
|
2097
|
+
glyph: { fontSize: 10, fontWeight: "700", lineHeight: 12 },
|
|
2098
|
+
ring: { alignItems: "center", borderWidth: RING_WIDTH, justifyContent: "center" }
|
|
2099
|
+
});
|
|
2100
|
+
var StatusCircle = ({ glyph, color, size = DEFAULT_SIZE, testID }) => /* @__PURE__ */ jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: [styles26.ring, { borderColor: color, borderRadius: size / 2, height: size, width: size }], testID, children: /* @__PURE__ */ jsx(Text, { style: [styles26.glyph, { color }], children: glyph }) });
|
|
2076
2101
|
|
|
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 };
|
|
2102
|
+
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, STATUS_TILE_TEST_ID, ScoreBar, SkeletonLines, StatusCircle, 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, scorePercentOf, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, tileMotionStyle, useCopyToClipboard, useFeedbackUi, useLocalModel, useFeedbackUi as useUi };
|
|
2078
2103
|
//# sourceMappingURL=index.mjs.map
|
|
2079
2104
|
//# sourceMappingURL=index.mjs.map
|