@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.31.0
|
|
4
|
+
|
|
5
|
+
- MODC-1 D-850 "console parts to packages": ScoreBar + scorePercentOf (0..1 bar with threshold marker, colours as props), StatusCircle (decorative glyph ring). New parts.
|
|
6
|
+
|
|
3
7
|
## 1.30.0
|
|
4
8
|
|
|
5
9
|
- StatusTile: `muted` greys a tile for a check that cannot run (dashed border, page background, secondary text), still pressable; showcase shows it.
|
package/dist/index.d.mts
CHANGED
|
@@ -820,6 +820,7 @@ interface AttentionCardProps {
|
|
|
820
820
|
/** The one item that needs a person first: its name and status, a line on why, optional evidence and the next action. */
|
|
821
821
|
declare const AttentionCard: ({ title, heading, status, message, evidence, action, testID }: AttentionCardProps) => React.ReactElement;
|
|
822
822
|
|
|
823
|
+
declare const STATUS_TILE_TEST_ID = "status-tile";
|
|
823
824
|
interface StatusTileProps {
|
|
824
825
|
title: string;
|
|
825
826
|
icon?: React.ReactNode;
|
|
@@ -855,4 +856,31 @@ type TileMotionStyle = ViewStyle & {
|
|
|
855
856
|
/** The style a pressable tile takes for its hover, press and focus state under the user's motion setting. */
|
|
856
857
|
declare function tileMotionStyle(theme: FeedbackTheme, input: TileMotionInput): TileMotionStyle;
|
|
857
858
|
|
|
858
|
-
|
|
859
|
+
interface ScoreBarColors {
|
|
860
|
+
fill: string;
|
|
861
|
+
track: string;
|
|
862
|
+
mark: string;
|
|
863
|
+
}
|
|
864
|
+
interface ScoreBarProps {
|
|
865
|
+
value: number;
|
|
866
|
+
threshold: number | null;
|
|
867
|
+
colors: ScoreBarColors;
|
|
868
|
+
label: string;
|
|
869
|
+
hint: string;
|
|
870
|
+
testID: string;
|
|
871
|
+
}
|
|
872
|
+
/** A 0..1 score as a clamped percentage width. */
|
|
873
|
+
declare function scorePercentOf(value: number): `${number}%`;
|
|
874
|
+
/** A 0..1 score as a slim filled bar with an optional threshold marker (`${testID}-threshold`); no text, the label carries it. */
|
|
875
|
+
declare const ScoreBar: ({ value, threshold, colors, label, hint, testID }: ScoreBarProps) => React.ReactElement;
|
|
876
|
+
|
|
877
|
+
interface StatusCircleProps {
|
|
878
|
+
glyph: string;
|
|
879
|
+
color: string;
|
|
880
|
+
size?: number;
|
|
881
|
+
testID?: string;
|
|
882
|
+
}
|
|
883
|
+
/** A decorative round status mark: a glyph inside a ring of one colour; the row beside it carries the accessible text. */
|
|
884
|
+
declare const StatusCircle: ({ glyph, color, size, testID }: StatusCircleProps) => React.ReactElement;
|
|
885
|
+
|
|
886
|
+
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, AttentionCard, type AttentionCardProps, COPY_FEEDBACK_MS, CheckPipeline, type CheckPipelineItem, type CheckPipelineProps, CheckStatus, type CheckStatusProps, type CheckStatusVariant, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorNotice, type ErrorNoticeProps, ErrorReferenceRow, type ErrorReferenceRowProps, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackThemeSemanticText, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, LocalModelGate, type LocalModelGateLabels, type LocalModelGateProps, type LocalModelGateSlots, type LocalModelGateTestIds, MODAL_OVERLAY_COLOR, PIPELINE_COLLAPSE_BREAKPOINT, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, STATUS_TILE_TEST_ID, ScoreBar, type ScoreBarColors, type ScoreBarProps, type SkeletonLine, SkeletonLines, type SkeletonLinesProps, StatusCircle, type StatusCircleProps, StatusTile, type StatusTileProps, type StepSplit, TILE_MOTION_MS, ThresholdMeter, type ThresholdMeterProps, type TileInteraction, type TileMotionInput, type TileMotionStyle, type ToastActionSpec, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, UiThemeOverride, type UiThemeOverrideProps, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackThemeSemanticText as UiThemeSemanticText, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -820,6 +820,7 @@ interface AttentionCardProps {
|
|
|
820
820
|
/** The one item that needs a person first: its name and status, a line on why, optional evidence and the next action. */
|
|
821
821
|
declare const AttentionCard: ({ title, heading, status, message, evidence, action, testID }: AttentionCardProps) => React.ReactElement;
|
|
822
822
|
|
|
823
|
+
declare const STATUS_TILE_TEST_ID = "status-tile";
|
|
823
824
|
interface StatusTileProps {
|
|
824
825
|
title: string;
|
|
825
826
|
icon?: React.ReactNode;
|
|
@@ -855,4 +856,31 @@ type TileMotionStyle = ViewStyle & {
|
|
|
855
856
|
/** The style a pressable tile takes for its hover, press and focus state under the user's motion setting. */
|
|
856
857
|
declare function tileMotionStyle(theme: FeedbackTheme, input: TileMotionInput): TileMotionStyle;
|
|
857
858
|
|
|
858
|
-
|
|
859
|
+
interface ScoreBarColors {
|
|
860
|
+
fill: string;
|
|
861
|
+
track: string;
|
|
862
|
+
mark: string;
|
|
863
|
+
}
|
|
864
|
+
interface ScoreBarProps {
|
|
865
|
+
value: number;
|
|
866
|
+
threshold: number | null;
|
|
867
|
+
colors: ScoreBarColors;
|
|
868
|
+
label: string;
|
|
869
|
+
hint: string;
|
|
870
|
+
testID: string;
|
|
871
|
+
}
|
|
872
|
+
/** A 0..1 score as a clamped percentage width. */
|
|
873
|
+
declare function scorePercentOf(value: number): `${number}%`;
|
|
874
|
+
/** A 0..1 score as a slim filled bar with an optional threshold marker (`${testID}-threshold`); no text, the label carries it. */
|
|
875
|
+
declare const ScoreBar: ({ value, threshold, colors, label, hint, testID }: ScoreBarProps) => React.ReactElement;
|
|
876
|
+
|
|
877
|
+
interface StatusCircleProps {
|
|
878
|
+
glyph: string;
|
|
879
|
+
color: string;
|
|
880
|
+
size?: number;
|
|
881
|
+
testID?: string;
|
|
882
|
+
}
|
|
883
|
+
/** A decorative round status mark: a glyph inside a ring of one colour; the row beside it carries the accessible text. */
|
|
884
|
+
declare const StatusCircle: ({ glyph, color, size, testID }: StatusCircleProps) => React.ReactElement;
|
|
885
|
+
|
|
886
|
+
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, AttentionCard, type AttentionCardProps, COPY_FEEDBACK_MS, CheckPipeline, type CheckPipelineItem, type CheckPipelineProps, CheckStatus, type CheckStatusProps, type CheckStatusVariant, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorNotice, type ErrorNoticeProps, ErrorReferenceRow, type ErrorReferenceRowProps, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackThemeSemanticText, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, LocalModelGate, type LocalModelGateLabels, type LocalModelGateProps, type LocalModelGateSlots, type LocalModelGateTestIds, MODAL_OVERLAY_COLOR, PIPELINE_COLLAPSE_BREAKPOINT, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, STATUS_TILE_TEST_ID, ScoreBar, type ScoreBarColors, type ScoreBarProps, type SkeletonLine, SkeletonLines, type SkeletonLinesProps, StatusCircle, type StatusCircleProps, StatusTile, type StatusTileProps, type StepSplit, TILE_MOTION_MS, ThresholdMeter, type ThresholdMeterProps, type TileInteraction, type TileMotionInput, type TileMotionStyle, type ToastActionSpec, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, UiThemeOverride, type UiThemeOverrideProps, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackThemeSemanticText as UiThemeSemanticText, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, 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 };
|
package/dist/index.js
CHANGED
|
@@ -1849,23 +1849,23 @@ var LocalModelGate = ({
|
|
|
1849
1849
|
const consent = react.useCallback(() => {
|
|
1850
1850
|
model.consent().catch(() => void 0);
|
|
1851
1851
|
}, [model]);
|
|
1852
|
-
const { Card, Text:
|
|
1852
|
+
const { Card, Text: Text21, Button } = slots;
|
|
1853
1853
|
switch (phase) {
|
|
1854
1854
|
case textGeneration.LocalModelPhase.Checking:
|
|
1855
1855
|
return null;
|
|
1856
1856
|
case textGeneration.LocalModelPhase.Blocked:
|
|
1857
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Card, { testID: testIds.blocked, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1857
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Card, { testID: testIds.blocked, children: /* @__PURE__ */ jsxRuntime.jsx(Text21, { children: labels.blocked(block) }) });
|
|
1858
1858
|
case textGeneration.LocalModelPhase.Offer:
|
|
1859
1859
|
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { testID: testIds.offer, children: [
|
|
1860
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1861
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1860
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text21, { heading: true, children: labels.title }),
|
|
1861
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text21, { children: labels.offerBody }),
|
|
1862
1862
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { hint: labels.consentHint, label: labels.consent, testID: testIds.consent, onPress: consent })
|
|
1863
1863
|
] });
|
|
1864
1864
|
case textGeneration.LocalModelPhase.Loading:
|
|
1865
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Card, { testID: testIds.loading, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1865
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Card, { testID: testIds.loading, children: /* @__PURE__ */ jsxRuntime.jsx(Text21, { children: labels.loading(String(Math.round(progress * PERCENT2))) }) });
|
|
1866
1866
|
case textGeneration.LocalModelPhase.Failed:
|
|
1867
1867
|
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { testID: testIds.failed, children: [
|
|
1868
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1868
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text21, { children: labels.failed }),
|
|
1869
1869
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { hint: labels.consentHint, label: labels.retry, testID: testIds.consent, onPress: consent })
|
|
1870
1870
|
] });
|
|
1871
1871
|
case textGeneration.LocalModelPhase.Ready:
|
|
@@ -2045,6 +2045,7 @@ var RADIUS5 = 8;
|
|
|
2045
2045
|
var PAD3 = 12;
|
|
2046
2046
|
var ACCENT = 3;
|
|
2047
2047
|
var MIN_HIT2 = 44;
|
|
2048
|
+
var STATUS_TILE_TEST_ID = "status-tile";
|
|
2048
2049
|
var styles24 = reactNative.StyleSheet.create({
|
|
2049
2050
|
head: { alignItems: "center", flexDirection: "row", gap: 6 },
|
|
2050
2051
|
line: { fontSize: 13 },
|
|
@@ -2066,7 +2067,7 @@ var StatusTile = ({ title, icon, status, lines, accentColor, muted = false, onPr
|
|
|
2066
2067
|
muted ? styles24.muted : null,
|
|
2067
2068
|
tileMotionStyle(theme, { interaction: { hovered: state.hovered === true, pressed: state.pressed, focused: state.focused === true }, reduced, interactive, accentColor })
|
|
2068
2069
|
];
|
|
2069
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { accessibilityHint, accessibilityLabel, accessibilityRole: interactive ? "button" : void 0, disabled: !interactive, style: styleOf, testID, onPress, children: [
|
|
2070
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { accessibilityHint, accessibilityLabel, accessibilityRole: interactive ? "button" : void 0, disabled: !interactive, style: styleOf, testID: testID ?? STATUS_TILE_TEST_ID, onPress, children: [
|
|
2070
2071
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles24.head, children: [
|
|
2071
2072
|
icon,
|
|
2072
2073
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [styles24.title, { color: muted ? theme.colors.textSecondary : theme.colors.text }], children: title })
|
|
@@ -2075,6 +2076,30 @@ var StatusTile = ({ title, icon, status, lines, accentColor, muted = false, onPr
|
|
|
2075
2076
|
lines.map((line, index) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.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}`))
|
|
2076
2077
|
] });
|
|
2077
2078
|
};
|
|
2079
|
+
var PERCENT4 = 100;
|
|
2080
|
+
var BAR_HEIGHT3 = 6;
|
|
2081
|
+
var MARK_HEIGHT = 14;
|
|
2082
|
+
var MARK_WIDTH = 2;
|
|
2083
|
+
var styles25 = reactNative.StyleSheet.create({
|
|
2084
|
+
fill: { borderRadius: BAR_HEIGHT3 / 2, height: BAR_HEIGHT3 },
|
|
2085
|
+
mark: { height: MARK_HEIGHT, position: "absolute", top: (BAR_HEIGHT3 - MARK_HEIGHT) / 2, width: MARK_WIDTH },
|
|
2086
|
+
track: { borderRadius: BAR_HEIGHT3 / 2, height: BAR_HEIGHT3, overflow: "visible", width: "100%" }
|
|
2087
|
+
});
|
|
2088
|
+
function scorePercentOf(value) {
|
|
2089
|
+
const clamped = Math.min(PERCENT4, Math.max(0, value * PERCENT4));
|
|
2090
|
+
return `${clamped}%`;
|
|
2091
|
+
}
|
|
2092
|
+
var ScoreBar = ({ value, threshold, colors, label, hint, testID }) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { accessibilityHint: hint, accessibilityLabel: label, accessibilityRole: "progressbar", style: [styles25.track, { backgroundColor: colors.track }], testID, children: [
|
|
2093
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles25.fill, { backgroundColor: colors.fill, width: scorePercentOf(value) }] }),
|
|
2094
|
+
threshold === null ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles25.mark, { backgroundColor: colors.mark, left: scorePercentOf(threshold) }], testID: `${testID}-threshold` })
|
|
2095
|
+
] });
|
|
2096
|
+
var DEFAULT_SIZE = 18;
|
|
2097
|
+
var RING_WIDTH = 1.5;
|
|
2098
|
+
var styles26 = reactNative.StyleSheet.create({
|
|
2099
|
+
glyph: { fontSize: 10, fontWeight: "700", lineHeight: 12 },
|
|
2100
|
+
ring: { alignItems: "center", borderWidth: RING_WIDTH, justifyContent: "center" }
|
|
2101
|
+
});
|
|
2102
|
+
var StatusCircle = ({ glyph, color, size = DEFAULT_SIZE, testID }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: [styles26.ring, { borderColor: color, borderRadius: size / 2, height: size, width: size }], testID, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles26.glyph, { color }], children: glyph }) });
|
|
2078
2103
|
|
|
2079
2104
|
exports.AppErrorBoundary = AppErrorBoundary;
|
|
2080
2105
|
exports.AsyncSurface = AsyncSurface;
|
|
@@ -2100,7 +2125,10 @@ exports.MODAL_OVERLAY_COLOR = MODAL_OVERLAY_COLOR;
|
|
|
2100
2125
|
exports.PIPELINE_COLLAPSE_BREAKPOINT = PIPELINE_COLLAPSE_BREAKPOINT;
|
|
2101
2126
|
exports.PageSkeleton = PageSkeleton;
|
|
2102
2127
|
exports.ProgressBar = ProgressBar;
|
|
2128
|
+
exports.STATUS_TILE_TEST_ID = STATUS_TILE_TEST_ID;
|
|
2129
|
+
exports.ScoreBar = ScoreBar;
|
|
2103
2130
|
exports.SkeletonLines = SkeletonLines;
|
|
2131
|
+
exports.StatusCircle = StatusCircle;
|
|
2104
2132
|
exports.StatusTile = StatusTile;
|
|
2105
2133
|
exports.TILE_MOTION_MS = TILE_MOTION_MS;
|
|
2106
2134
|
exports.ThresholdMeter = ThresholdMeter;
|
|
@@ -2124,6 +2152,7 @@ exports.pipelineVariant = pipelineVariant;
|
|
|
2124
2152
|
exports.progressPercent = progressPercent;
|
|
2125
2153
|
exports.readTraceId = readTraceId;
|
|
2126
2154
|
exports.runToneColor = runToneColor;
|
|
2155
|
+
exports.scorePercentOf = scorePercentOf;
|
|
2127
2156
|
exports.settleWarming = settleWarming;
|
|
2128
2157
|
exports.splitShorterSteps = splitShorterSteps;
|
|
2129
2158
|
exports.subscribeWarming = subscribeWarming;
|