@dloizides/ui-feedback 1.26.1 → 1.27.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 +7 -0
- package/dist/index.d.mts +62 -1
- package/dist/index.d.ts +62 -1
- package/dist/index.js +136 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +131 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.27.0
|
|
4
|
+
|
|
5
|
+
- `CheckStatus({ title, detail?, status?, variant: tile|row, onPress?, accessibilityLabel, accessibilityHint, testID? })`: one check as a tile or a row; the status pill is a slot; pressable when `onPress` is set (44 px min height).
|
|
6
|
+
- `CheckPipeline({ items, breakpoint?, ... })`: checks as equal tiles in one row at or above `breakpoint` (default 768), one row per check below; `pipelineVariant(width, breakpoint)` exported.
|
|
7
|
+
- `ThresholdMeter({ value, threshold, max?, lowerPasses?, label, valueText, accessibilityHint, testID? })`: score fill against a threshold mark, success or error tone from the theme; role meter. `meterPercent`, `meetsThreshold` exported.
|
|
8
|
+
- `AttentionCard({ title, heading?, status?, message, evidence?, action?, testID? })`: the one item that needs a person first, with slots for status, evidence and the next action.
|
|
9
|
+
|
|
3
10
|
## 1.26.0
|
|
4
11
|
|
|
5
12
|
- `LocalModelGate` + `useLocalModel(model)` (INV-EXTRACT-1 W9): shows its children once a `@dloizides/text-generation` local model is ready, else the offer, download percent, failure retry or blocked reason; labels, test ids and the card/text/button slots come from the app.
|
package/dist/index.d.mts
CHANGED
|
@@ -738,4 +738,65 @@ declare const LocalModelGate: ({ model, labels, testIds, slots, children, }: Loc
|
|
|
738
738
|
/** Follows a local model and checks the browser on first use. */
|
|
739
739
|
declare function useLocalModel(model: LocalModel): LocalModelState;
|
|
740
740
|
|
|
741
|
-
|
|
741
|
+
type CheckStatusVariant = 'tile' | 'row';
|
|
742
|
+
interface CheckStatusProps {
|
|
743
|
+
title: string;
|
|
744
|
+
detail?: string;
|
|
745
|
+
status?: React.ReactNode;
|
|
746
|
+
variant?: CheckStatusVariant;
|
|
747
|
+
onPress?: () => void;
|
|
748
|
+
accessibilityLabel: string;
|
|
749
|
+
accessibilityHint: string;
|
|
750
|
+
testID?: string;
|
|
751
|
+
}
|
|
752
|
+
/** One check as a tile (equal share of a row) or a row (title left, status right); pressing it opens the check. */
|
|
753
|
+
declare const CheckStatus: (props: CheckStatusProps) => React.ReactElement;
|
|
754
|
+
|
|
755
|
+
interface CheckPipelineItem extends Omit<CheckStatusProps, 'variant'> {
|
|
756
|
+
id: string;
|
|
757
|
+
}
|
|
758
|
+
interface CheckPipelineProps {
|
|
759
|
+
items: readonly CheckPipelineItem[];
|
|
760
|
+
breakpoint?: number;
|
|
761
|
+
accessibilityLabel: string;
|
|
762
|
+
accessibilityHint: string;
|
|
763
|
+
testID?: string;
|
|
764
|
+
}
|
|
765
|
+
/** The checks as equal tiles in one row on a computer and one row per check on a phone. */
|
|
766
|
+
declare const CheckPipeline: ({ items, breakpoint, accessibilityLabel, accessibilityHint, testID }: CheckPipelineProps) => React.ReactElement;
|
|
767
|
+
|
|
768
|
+
declare const PIPELINE_COLLAPSE_BREAKPOINT = 768;
|
|
769
|
+
/** Tiles in one row at or above the breakpoint, one row per check below it. */
|
|
770
|
+
declare function pipelineVariant(width: number, breakpoint?: number): CheckStatusVariant;
|
|
771
|
+
|
|
772
|
+
interface ThresholdMeterProps {
|
|
773
|
+
value: number;
|
|
774
|
+
threshold: number;
|
|
775
|
+
max?: number;
|
|
776
|
+
lowerPasses?: boolean;
|
|
777
|
+
label: string;
|
|
778
|
+
valueText: string;
|
|
779
|
+
accessibilityHint: string;
|
|
780
|
+
testID?: string;
|
|
781
|
+
}
|
|
782
|
+
/** A score against its pass line: the fill is the score, the mark is the threshold, the fill tone says pass or fail. */
|
|
783
|
+
declare const ThresholdMeter: (props: ThresholdMeterProps) => React.ReactElement;
|
|
784
|
+
|
|
785
|
+
/** A value as a 0-100 share of max; a non-positive max gives 0. */
|
|
786
|
+
declare function meterPercent(value: number, max: number): number;
|
|
787
|
+
/** Whether a value meets its threshold: at or above it, or at or below it when lower passes. */
|
|
788
|
+
declare function meetsThreshold(value: number, threshold: number, lowerPasses: boolean): boolean;
|
|
789
|
+
|
|
790
|
+
interface AttentionCardProps {
|
|
791
|
+
title: string;
|
|
792
|
+
heading?: string;
|
|
793
|
+
status?: React.ReactNode;
|
|
794
|
+
message: string;
|
|
795
|
+
evidence?: React.ReactNode;
|
|
796
|
+
action?: React.ReactNode;
|
|
797
|
+
testID?: string;
|
|
798
|
+
}
|
|
799
|
+
/** The one item that needs a person first: its name and status, a line on why, optional evidence and the next action. */
|
|
800
|
+
declare const AttentionCard: ({ title, heading, status, message, evidence, action, testID }: AttentionCardProps) => React.ReactElement;
|
|
801
|
+
|
|
802
|
+
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, type StepSplit, ThresholdMeter, type ThresholdMeterProps, 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, pipelineVariant, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useLocalModel, useFeedbackUi as useUi };
|
package/dist/index.d.ts
CHANGED
|
@@ -738,4 +738,65 @@ declare const LocalModelGate: ({ model, labels, testIds, slots, children, }: Loc
|
|
|
738
738
|
/** Follows a local model and checks the browser on first use. */
|
|
739
739
|
declare function useLocalModel(model: LocalModel): LocalModelState;
|
|
740
740
|
|
|
741
|
-
|
|
741
|
+
type CheckStatusVariant = 'tile' | 'row';
|
|
742
|
+
interface CheckStatusProps {
|
|
743
|
+
title: string;
|
|
744
|
+
detail?: string;
|
|
745
|
+
status?: React.ReactNode;
|
|
746
|
+
variant?: CheckStatusVariant;
|
|
747
|
+
onPress?: () => void;
|
|
748
|
+
accessibilityLabel: string;
|
|
749
|
+
accessibilityHint: string;
|
|
750
|
+
testID?: string;
|
|
751
|
+
}
|
|
752
|
+
/** One check as a tile (equal share of a row) or a row (title left, status right); pressing it opens the check. */
|
|
753
|
+
declare const CheckStatus: (props: CheckStatusProps) => React.ReactElement;
|
|
754
|
+
|
|
755
|
+
interface CheckPipelineItem extends Omit<CheckStatusProps, 'variant'> {
|
|
756
|
+
id: string;
|
|
757
|
+
}
|
|
758
|
+
interface CheckPipelineProps {
|
|
759
|
+
items: readonly CheckPipelineItem[];
|
|
760
|
+
breakpoint?: number;
|
|
761
|
+
accessibilityLabel: string;
|
|
762
|
+
accessibilityHint: string;
|
|
763
|
+
testID?: string;
|
|
764
|
+
}
|
|
765
|
+
/** The checks as equal tiles in one row on a computer and one row per check on a phone. */
|
|
766
|
+
declare const CheckPipeline: ({ items, breakpoint, accessibilityLabel, accessibilityHint, testID }: CheckPipelineProps) => React.ReactElement;
|
|
767
|
+
|
|
768
|
+
declare const PIPELINE_COLLAPSE_BREAKPOINT = 768;
|
|
769
|
+
/** Tiles in one row at or above the breakpoint, one row per check below it. */
|
|
770
|
+
declare function pipelineVariant(width: number, breakpoint?: number): CheckStatusVariant;
|
|
771
|
+
|
|
772
|
+
interface ThresholdMeterProps {
|
|
773
|
+
value: number;
|
|
774
|
+
threshold: number;
|
|
775
|
+
max?: number;
|
|
776
|
+
lowerPasses?: boolean;
|
|
777
|
+
label: string;
|
|
778
|
+
valueText: string;
|
|
779
|
+
accessibilityHint: string;
|
|
780
|
+
testID?: string;
|
|
781
|
+
}
|
|
782
|
+
/** A score against its pass line: the fill is the score, the mark is the threshold, the fill tone says pass or fail. */
|
|
783
|
+
declare const ThresholdMeter: (props: ThresholdMeterProps) => React.ReactElement;
|
|
784
|
+
|
|
785
|
+
/** A value as a 0-100 share of max; a non-positive max gives 0. */
|
|
786
|
+
declare function meterPercent(value: number, max: number): number;
|
|
787
|
+
/** Whether a value meets its threshold: at or above it, or at or below it when lower passes. */
|
|
788
|
+
declare function meetsThreshold(value: number, threshold: number, lowerPasses: boolean): boolean;
|
|
789
|
+
|
|
790
|
+
interface AttentionCardProps {
|
|
791
|
+
title: string;
|
|
792
|
+
heading?: string;
|
|
793
|
+
status?: React.ReactNode;
|
|
794
|
+
message: string;
|
|
795
|
+
evidence?: React.ReactNode;
|
|
796
|
+
action?: React.ReactNode;
|
|
797
|
+
testID?: string;
|
|
798
|
+
}
|
|
799
|
+
/** The one item that needs a person first: its name and status, a line on why, optional evidence and the next action. */
|
|
800
|
+
declare const AttentionCard: ({ title, heading, status, message, evidence, action, testID }: AttentionCardProps) => React.ReactElement;
|
|
801
|
+
|
|
802
|
+
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, type StepSplit, ThresholdMeter, type ThresholdMeterProps, 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, pipelineVariant, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useLocalModel, useFeedbackUi as useUi };
|
package/dist/index.js
CHANGED
|
@@ -1819,23 +1819,23 @@ var LocalModelGate = ({
|
|
|
1819
1819
|
const consent = react.useCallback(() => {
|
|
1820
1820
|
model.consent().catch(() => void 0);
|
|
1821
1821
|
}, [model]);
|
|
1822
|
-
const { Card, Text:
|
|
1822
|
+
const { Card, Text: Text19, Button } = slots;
|
|
1823
1823
|
switch (phase) {
|
|
1824
1824
|
case textGeneration.LocalModelPhase.Checking:
|
|
1825
1825
|
return null;
|
|
1826
1826
|
case textGeneration.LocalModelPhase.Blocked:
|
|
1827
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Card, { testID: testIds.blocked, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1827
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Card, { testID: testIds.blocked, children: /* @__PURE__ */ jsxRuntime.jsx(Text19, { children: labels.blocked(block) }) });
|
|
1828
1828
|
case textGeneration.LocalModelPhase.Offer:
|
|
1829
1829
|
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { testID: testIds.offer, children: [
|
|
1830
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1831
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1830
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text19, { heading: true, children: labels.title }),
|
|
1831
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text19, { children: labels.offerBody }),
|
|
1832
1832
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { hint: labels.consentHint, label: labels.consent, testID: testIds.consent, onPress: consent })
|
|
1833
1833
|
] });
|
|
1834
1834
|
case textGeneration.LocalModelPhase.Loading:
|
|
1835
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Card, { testID: testIds.loading, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1835
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Card, { testID: testIds.loading, children: /* @__PURE__ */ jsxRuntime.jsx(Text19, { children: labels.loading(String(Math.round(progress * PERCENT2))) }) });
|
|
1836
1836
|
case textGeneration.LocalModelPhase.Failed:
|
|
1837
1837
|
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { testID: testIds.failed, children: [
|
|
1838
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1838
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text19, { children: labels.failed }),
|
|
1839
1839
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { hint: labels.consentHint, label: labels.retry, testID: testIds.consent, onPress: consent })
|
|
1840
1840
|
] });
|
|
1841
1841
|
case textGeneration.LocalModelPhase.Ready:
|
|
@@ -1843,10 +1843,135 @@ var LocalModelGate = ({
|
|
|
1843
1843
|
return children;
|
|
1844
1844
|
}
|
|
1845
1845
|
};
|
|
1846
|
+
var RADIUS2 = 8;
|
|
1847
|
+
var PAD = 12;
|
|
1848
|
+
var GAP = 8;
|
|
1849
|
+
var MIN_HIT = 44;
|
|
1850
|
+
var TITLE_FONT = 14;
|
|
1851
|
+
var DETAIL_FONT = 12;
|
|
1852
|
+
var styles19 = reactNative.StyleSheet.create({
|
|
1853
|
+
detail: { fontSize: DETAIL_FONT },
|
|
1854
|
+
row: { alignItems: "center", flexDirection: "row", justifyContent: "space-between" },
|
|
1855
|
+
tile: { flexBasis: 0, flexGrow: 1, minWidth: 0 },
|
|
1856
|
+
title: { fontSize: TITLE_FONT, fontWeight: "600" },
|
|
1857
|
+
words: { flexShrink: 1, gap: 2 },
|
|
1858
|
+
wrap: { borderRadius: RADIUS2, borderWidth: 1, gap: GAP, minHeight: MIN_HIT, padding: PAD }
|
|
1859
|
+
});
|
|
1860
|
+
var CheckStatus = (props) => {
|
|
1861
|
+
const { title, detail, status, variant = "tile", onPress, accessibilityLabel, accessibilityHint, testID } = props;
|
|
1862
|
+
const { theme } = useFeedbackUi();
|
|
1863
|
+
const style = [styles19.wrap, variant === "tile" ? styles19.tile : styles19.row, { backgroundColor: theme.colors.surface, borderColor: theme.colors.border }];
|
|
1864
|
+
const body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1865
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles19.words, children: [
|
|
1866
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles19.title, { color: theme.colors.text }], children: title }),
|
|
1867
|
+
detail === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles19.detail, { color: theme.colors.textSecondary }], children: detail })
|
|
1868
|
+
] }),
|
|
1869
|
+
status
|
|
1870
|
+
] });
|
|
1871
|
+
if (onPress === void 0) {
|
|
1872
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityHint, accessibilityLabel, style, testID, children: body });
|
|
1873
|
+
}
|
|
1874
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { accessibilityHint, accessibilityLabel, accessibilityRole: "button", style, testID, onPress, children: body });
|
|
1875
|
+
};
|
|
1876
|
+
|
|
1877
|
+
// src/CheckStatus/pipelineVariant.ts
|
|
1878
|
+
var PIPELINE_COLLAPSE_BREAKPOINT = 768;
|
|
1879
|
+
function pipelineVariant(width, breakpoint = PIPELINE_COLLAPSE_BREAKPOINT) {
|
|
1880
|
+
return width >= breakpoint ? "tile" : "row";
|
|
1881
|
+
}
|
|
1882
|
+
var styles20 = reactNative.StyleSheet.create({
|
|
1883
|
+
list: { gap: 8 },
|
|
1884
|
+
row: { flexDirection: "row", gap: 12 }
|
|
1885
|
+
});
|
|
1886
|
+
var CheckPipeline = ({ items, breakpoint, accessibilityLabel, accessibilityHint, testID }) => {
|
|
1887
|
+
const variant = pipelineVariant(reactNative.useWindowDimensions().width, breakpoint);
|
|
1888
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityHint, accessibilityLabel, accessibilityRole: "summary", style: variant === "tile" ? styles20.row : styles20.list, testID, children: items.map(({ id, ...item }) => /* @__PURE__ */ jsxRuntime.jsx(CheckStatus, { ...item, variant }, id)) });
|
|
1889
|
+
};
|
|
1890
|
+
|
|
1891
|
+
// src/CheckStatus/semanticScale.ts
|
|
1892
|
+
function semanticScale(theme, name) {
|
|
1893
|
+
const found = theme.semantic[name];
|
|
1894
|
+
return found?.["500"];
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
// src/ThresholdMeter/meterScale.ts
|
|
1898
|
+
var PERCENT3 = 100;
|
|
1899
|
+
function meterPercent(value, max) {
|
|
1900
|
+
return max > 0 ? clampPercent(value / max * PERCENT3) : 0;
|
|
1901
|
+
}
|
|
1902
|
+
function meetsThreshold(value, threshold, lowerPasses) {
|
|
1903
|
+
return lowerPasses ? value <= threshold : value >= threshold;
|
|
1904
|
+
}
|
|
1905
|
+
var TRACK_HEIGHT = 8;
|
|
1906
|
+
var MARKER_WIDTH = 2;
|
|
1907
|
+
var MARKER_HEIGHT = 16;
|
|
1908
|
+
var MARKER_TOP = -4;
|
|
1909
|
+
var RADIUS3 = 999;
|
|
1910
|
+
var FONT = 12;
|
|
1911
|
+
var styles21 = reactNative.StyleSheet.create({
|
|
1912
|
+
fill: { borderRadius: RADIUS3, height: "100%" },
|
|
1913
|
+
head: { flexDirection: "row", flexWrap: "wrap", gap: 8, justifyContent: "space-between" },
|
|
1914
|
+
marker: { height: MARKER_HEIGHT, marginLeft: -MARKER_WIDTH / 2, position: "absolute", top: MARKER_TOP, width: MARKER_WIDTH },
|
|
1915
|
+
text: { fontSize: FONT, fontVariant: ["tabular-nums"] },
|
|
1916
|
+
track: { borderRadius: RADIUS3, height: TRACK_HEIGHT },
|
|
1917
|
+
wrap: { gap: 6 }
|
|
1918
|
+
});
|
|
1919
|
+
function partId(testID, part) {
|
|
1920
|
+
return testID === void 0 ? void 0 : `${testID}-${part}`;
|
|
1921
|
+
}
|
|
1922
|
+
var ThresholdMeter = (props) => {
|
|
1923
|
+
const { value, threshold, max = 1, lowerPasses = false, label, valueText, accessibilityHint, testID } = props;
|
|
1924
|
+
const { theme } = useFeedbackUi();
|
|
1925
|
+
const passes = meetsThreshold(value, threshold, lowerPasses);
|
|
1926
|
+
const fill = passes ? semanticScale(theme, "success") ?? theme.palette.primary["500"] : theme.semantic.error["500"];
|
|
1927
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { accessibilityHint, accessibilityLabel: label, "aria-valuemax": max, "aria-valuemin": 0, "aria-valuenow": value, "aria-valuetext": valueText, role: "meter", style: styles21.wrap, testID, children: [
|
|
1928
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles21.head, children: [
|
|
1929
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles21.text, { color: theme.colors.textSecondary }], children: label }),
|
|
1930
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles21.text, { color: theme.colors.text }], children: valueText })
|
|
1931
|
+
] }),
|
|
1932
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles21.track, { backgroundColor: theme.colors.border }], children: [
|
|
1933
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles21.fill, { backgroundColor: fill, width: `${meterPercent(value, max)}%` }], testID: partId(testID, "fill") }),
|
|
1934
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles21.marker, { backgroundColor: theme.colors.text, left: `${meterPercent(threshold, max)}%` }], testID: partId(testID, "threshold") })
|
|
1935
|
+
] })
|
|
1936
|
+
] });
|
|
1937
|
+
};
|
|
1938
|
+
var RADIUS4 = 12;
|
|
1939
|
+
var PAD2 = 16;
|
|
1940
|
+
var GAP2 = 8;
|
|
1941
|
+
var STACK_GAP = 12;
|
|
1942
|
+
var TITLE_FONT2 = 15;
|
|
1943
|
+
var HEADING_FONT = 16;
|
|
1944
|
+
var MESSAGE_FONT = 14;
|
|
1945
|
+
var styles22 = reactNative.StyleSheet.create({
|
|
1946
|
+
card: { borderRadius: RADIUS4, borderWidth: 1, gap: GAP2, minWidth: 0, padding: PAD2 },
|
|
1947
|
+
head: { alignItems: "center", flexDirection: "row", flexWrap: "wrap", gap: GAP2, justifyContent: "space-between" },
|
|
1948
|
+
heading: { flexShrink: 1, fontSize: HEADING_FONT, fontWeight: "700" },
|
|
1949
|
+
message: { fontSize: MESSAGE_FONT },
|
|
1950
|
+
stack: { gap: STACK_GAP },
|
|
1951
|
+
title: { fontSize: TITLE_FONT2, fontWeight: "700" }
|
|
1952
|
+
});
|
|
1953
|
+
var AttentionCard = ({ title, heading, status, message, evidence, action, testID }) => {
|
|
1954
|
+
const { theme } = useFeedbackUi();
|
|
1955
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles22.card, { backgroundColor: theme.colors.surfaceElevated, borderColor: theme.colors.border }], testID, children: [
|
|
1956
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [styles22.title, { color: theme.colors.text }], children: title }),
|
|
1957
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles22.stack, children: [
|
|
1958
|
+
heading === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles22.head, testID: testID === void 0 ? void 0 : `${testID}-head`, children: [
|
|
1959
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles22.heading, { color: theme.colors.text }], children: heading }),
|
|
1960
|
+
status
|
|
1961
|
+
] }),
|
|
1962
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles22.message, { color: theme.colors.textSecondary }], children: message }),
|
|
1963
|
+
evidence,
|
|
1964
|
+
action
|
|
1965
|
+
] })
|
|
1966
|
+
] });
|
|
1967
|
+
};
|
|
1846
1968
|
|
|
1847
1969
|
exports.AppErrorBoundary = AppErrorBoundary;
|
|
1848
1970
|
exports.AsyncSurface = AsyncSurface;
|
|
1971
|
+
exports.AttentionCard = AttentionCard;
|
|
1849
1972
|
exports.COPY_FEEDBACK_MS = COPY_FEEDBACK_MS;
|
|
1973
|
+
exports.CheckPipeline = CheckPipeline;
|
|
1974
|
+
exports.CheckStatus = CheckStatus;
|
|
1850
1975
|
exports.ConfirmDialog = ConfirmDialog;
|
|
1851
1976
|
exports.CopyStatus = CopyStatus;
|
|
1852
1977
|
exports.DEFAULT_ERROR_BOUNDARY_LABELS = DEFAULT_ERROR_BOUNDARY_LABELS;
|
|
@@ -1862,8 +1987,10 @@ exports.LiveRunCard = LiveRunCard;
|
|
|
1862
1987
|
exports.LoadingFallback = LoadingFallback;
|
|
1863
1988
|
exports.LocalModelGate = LocalModelGate;
|
|
1864
1989
|
exports.MODAL_OVERLAY_COLOR = MODAL_OVERLAY_COLOR;
|
|
1990
|
+
exports.PIPELINE_COLLAPSE_BREAKPOINT = PIPELINE_COLLAPSE_BREAKPOINT;
|
|
1865
1991
|
exports.PageSkeleton = PageSkeleton;
|
|
1866
1992
|
exports.ProgressBar = ProgressBar;
|
|
1993
|
+
exports.ThresholdMeter = ThresholdMeter;
|
|
1867
1994
|
exports.ToastHost = ToastHost;
|
|
1868
1995
|
exports.UiProvider = FeedbackUiProvider;
|
|
1869
1996
|
exports.UiThemeOverride = UiThemeOverride;
|
|
@@ -1875,8 +2002,11 @@ exports.copyText = copyText;
|
|
|
1875
2002
|
exports.createToastBus = createToastBus;
|
|
1876
2003
|
exports.defaultGroupId = defaultGroupId;
|
|
1877
2004
|
exports.getWarmingSnapshot = getWarmingSnapshot;
|
|
2005
|
+
exports.meetsThreshold = meetsThreshold;
|
|
1878
2006
|
exports.mergeRunSteps = mergeRunSteps;
|
|
2007
|
+
exports.meterPercent = meterPercent;
|
|
1879
2008
|
exports.notifyWarming = notifyWarming;
|
|
2009
|
+
exports.pipelineVariant = pipelineVariant;
|
|
1880
2010
|
exports.progressPercent = progressPercent;
|
|
1881
2011
|
exports.readTraceId = readTraceId;
|
|
1882
2012
|
exports.runToneColor = runToneColor;
|