@dloizides/ui-feedback 1.26.0 → 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 +172 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +168 -12
- 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
|
@@ -626,6 +626,32 @@ function confirmFill(theme, destructive) {
|
|
|
626
626
|
function confirmInk(theme, destructive) {
|
|
627
627
|
return designTokens.resolveOnBrand(confirmFill(theme, destructive));
|
|
628
628
|
}
|
|
629
|
+
var LIGHT_BRAND_STEP = "300";
|
|
630
|
+
var NO_RING = { outlineWidth: 0 };
|
|
631
|
+
var NATIVE_RING = {};
|
|
632
|
+
function buildDialogRingStyle(visible, color, isWeb) {
|
|
633
|
+
if (!isWeb) return NATIVE_RING;
|
|
634
|
+
return visible ? designTokens.focusRingOutline(color) : NO_RING;
|
|
635
|
+
}
|
|
636
|
+
function dialogRingColor(theme) {
|
|
637
|
+
const colors = theme.colors;
|
|
638
|
+
return designTokens.resolveFocusRingColor({
|
|
639
|
+
focusRing: colors.focusRing,
|
|
640
|
+
primary: theme.palette.primary["500"],
|
|
641
|
+
primaryLight: theme.palette.primary[LIGHT_BRAND_STEP],
|
|
642
|
+
text: colors.text,
|
|
643
|
+
background: colors.background
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
function useDialogFocusRing(color) {
|
|
647
|
+
const [visible, setVisible] = react.useState(false);
|
|
648
|
+
const onFocus = react.useCallback((event) => {
|
|
649
|
+
setVisible(designTokens.isFocusVisible(event?.target));
|
|
650
|
+
}, []);
|
|
651
|
+
const onBlur = react.useCallback(() => setVisible(false), []);
|
|
652
|
+
const ringStyle = react.useMemo(() => buildDialogRingStyle(visible, color, reactNative.Platform.OS === "web"), [visible, color]);
|
|
653
|
+
return { ringStyle, onFocus, onBlur };
|
|
654
|
+
}
|
|
629
655
|
var DIALOG_MAX_WIDTH = 400;
|
|
630
656
|
var styles8 = reactNative.StyleSheet.create({
|
|
631
657
|
overlay: {
|
|
@@ -694,6 +720,8 @@ var ConfirmDialog = ({
|
|
|
694
720
|
const { theme, t } = useFeedbackUi();
|
|
695
721
|
const titleId = react.useId();
|
|
696
722
|
const innerDialogRole = reactNative.Platform.OS === "web" ? void 0 : "dialog";
|
|
723
|
+
const cancelRing = useDialogFocusRing(dialogRingColor(theme));
|
|
724
|
+
const confirmRing = useDialogFocusRing(dialogRingColor(theme));
|
|
697
725
|
const colorStyles = react.useMemo(
|
|
698
726
|
() => ({
|
|
699
727
|
dialog: { backgroundColor: theme.colors.surfaceElevated },
|
|
@@ -739,9 +767,12 @@ var ConfirmDialog = ({
|
|
|
739
767
|
style: [
|
|
740
768
|
styles8.button,
|
|
741
769
|
styles8.cancelButton,
|
|
742
|
-
colorStyles.cancelButton
|
|
770
|
+
colorStyles.cancelButton,
|
|
771
|
+
cancelRing.ringStyle
|
|
743
772
|
],
|
|
744
773
|
testID: FEEDBACK_TEST_IDS.cancelConfirmButton,
|
|
774
|
+
onBlur: cancelRing.onBlur,
|
|
775
|
+
onFocus: cancelRing.onFocus,
|
|
745
776
|
onPress: onCancel,
|
|
746
777
|
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.buttonText, colorStyles.cancelButtonText], children: resolvedCancelLabel })
|
|
747
778
|
}
|
|
@@ -758,9 +789,12 @@ var ConfirmDialog = ({
|
|
|
758
789
|
styles8.button,
|
|
759
790
|
styles8.confirmButton,
|
|
760
791
|
colorStyles.confirmButton,
|
|
761
|
-
isConfirmDisabled && styles8.disabledButton
|
|
792
|
+
isConfirmDisabled && styles8.disabledButton,
|
|
793
|
+
confirmRing.ringStyle
|
|
762
794
|
],
|
|
763
795
|
testID: FEEDBACK_TEST_IDS.confirmButton,
|
|
796
|
+
onBlur: confirmRing.onBlur,
|
|
797
|
+
onFocus: confirmRing.onFocus,
|
|
764
798
|
onPress: onConfirm,
|
|
765
799
|
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
766
800
|
reactNative.ActivityIndicator,
|
|
@@ -1785,23 +1819,23 @@ var LocalModelGate = ({
|
|
|
1785
1819
|
const consent = react.useCallback(() => {
|
|
1786
1820
|
model.consent().catch(() => void 0);
|
|
1787
1821
|
}, [model]);
|
|
1788
|
-
const { Card, Text:
|
|
1822
|
+
const { Card, Text: Text19, Button } = slots;
|
|
1789
1823
|
switch (phase) {
|
|
1790
1824
|
case textGeneration.LocalModelPhase.Checking:
|
|
1791
1825
|
return null;
|
|
1792
1826
|
case textGeneration.LocalModelPhase.Blocked:
|
|
1793
|
-
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) }) });
|
|
1794
1828
|
case textGeneration.LocalModelPhase.Offer:
|
|
1795
1829
|
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { testID: testIds.offer, children: [
|
|
1796
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1797
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1830
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text19, { heading: true, children: labels.title }),
|
|
1831
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text19, { children: labels.offerBody }),
|
|
1798
1832
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { hint: labels.consentHint, label: labels.consent, testID: testIds.consent, onPress: consent })
|
|
1799
1833
|
] });
|
|
1800
1834
|
case textGeneration.LocalModelPhase.Loading:
|
|
1801
|
-
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))) }) });
|
|
1802
1836
|
case textGeneration.LocalModelPhase.Failed:
|
|
1803
1837
|
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { testID: testIds.failed, children: [
|
|
1804
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1838
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text19, { children: labels.failed }),
|
|
1805
1839
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { hint: labels.consentHint, label: labels.retry, testID: testIds.consent, onPress: consent })
|
|
1806
1840
|
] });
|
|
1807
1841
|
case textGeneration.LocalModelPhase.Ready:
|
|
@@ -1809,10 +1843,135 @@ var LocalModelGate = ({
|
|
|
1809
1843
|
return children;
|
|
1810
1844
|
}
|
|
1811
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
|
+
};
|
|
1812
1968
|
|
|
1813
1969
|
exports.AppErrorBoundary = AppErrorBoundary;
|
|
1814
1970
|
exports.AsyncSurface = AsyncSurface;
|
|
1971
|
+
exports.AttentionCard = AttentionCard;
|
|
1815
1972
|
exports.COPY_FEEDBACK_MS = COPY_FEEDBACK_MS;
|
|
1973
|
+
exports.CheckPipeline = CheckPipeline;
|
|
1974
|
+
exports.CheckStatus = CheckStatus;
|
|
1816
1975
|
exports.ConfirmDialog = ConfirmDialog;
|
|
1817
1976
|
exports.CopyStatus = CopyStatus;
|
|
1818
1977
|
exports.DEFAULT_ERROR_BOUNDARY_LABELS = DEFAULT_ERROR_BOUNDARY_LABELS;
|
|
@@ -1828,8 +1987,10 @@ exports.LiveRunCard = LiveRunCard;
|
|
|
1828
1987
|
exports.LoadingFallback = LoadingFallback;
|
|
1829
1988
|
exports.LocalModelGate = LocalModelGate;
|
|
1830
1989
|
exports.MODAL_OVERLAY_COLOR = MODAL_OVERLAY_COLOR;
|
|
1990
|
+
exports.PIPELINE_COLLAPSE_BREAKPOINT = PIPELINE_COLLAPSE_BREAKPOINT;
|
|
1831
1991
|
exports.PageSkeleton = PageSkeleton;
|
|
1832
1992
|
exports.ProgressBar = ProgressBar;
|
|
1993
|
+
exports.ThresholdMeter = ThresholdMeter;
|
|
1833
1994
|
exports.ToastHost = ToastHost;
|
|
1834
1995
|
exports.UiProvider = FeedbackUiProvider;
|
|
1835
1996
|
exports.UiThemeOverride = UiThemeOverride;
|
|
@@ -1841,8 +2002,11 @@ exports.copyText = copyText;
|
|
|
1841
2002
|
exports.createToastBus = createToastBus;
|
|
1842
2003
|
exports.defaultGroupId = defaultGroupId;
|
|
1843
2004
|
exports.getWarmingSnapshot = getWarmingSnapshot;
|
|
2005
|
+
exports.meetsThreshold = meetsThreshold;
|
|
1844
2006
|
exports.mergeRunSteps = mergeRunSteps;
|
|
2007
|
+
exports.meterPercent = meterPercent;
|
|
1845
2008
|
exports.notifyWarming = notifyWarming;
|
|
2009
|
+
exports.pipelineVariant = pipelineVariant;
|
|
1846
2010
|
exports.progressPercent = progressPercent;
|
|
1847
2011
|
exports.readTraceId = readTraceId;
|
|
1848
2012
|
exports.runToneColor = runToneColor;
|