@lotics/ui 7.16.0 → 7.17.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/AGENTS.md +2 -1
- package/package.json +1 -1
- package/src/finding.tsx +13 -7
- package/src/locale.tsx +5 -0
package/AGENTS.md
CHANGED
|
@@ -532,7 +532,8 @@ controls — while **status/severity/diffs use functional colour** the way the r
|
|
|
532
532
|
- **Confidence** — a 3-tick meter + the full phrase ("High confidence" / "Medium" / "Low"), emerald /
|
|
533
533
|
amber / zinc by level; `labels` to translate (one phrase per level).
|
|
534
534
|
- **Finding severity** — a coloured dot `Badge` + metric: red critical, amber warning, blue note,
|
|
535
|
-
emerald on-track (+ stacking order, most severe first).
|
|
535
|
+
emerald on-track (+ stacking order, most severe first). The badge words localize through
|
|
536
|
+
`LoticsLocaleProvider` (`locale.finding`, override per-instance via `labels`) — never hardcode them.
|
|
536
537
|
- **Stepper / AgentRun nodes** — progress dots on a spine: `current` a **pulsing accent ring** (white
|
|
537
538
|
centre), `done` a filled accent dot + **white check**, `upcoming` a faint **grey** ring, the terminal
|
|
538
539
|
`complete` a **blackish ring + black check**, `warning` **amber**. Default accent is neutral ink
|
package/package.json
CHANGED
package/src/finding.tsx
CHANGED
|
@@ -4,11 +4,14 @@ import { Text } from "./text";
|
|
|
4
4
|
import { Badge } from "./badge";
|
|
5
5
|
import { Button } from "./button";
|
|
6
6
|
import { Sources, type SourceRef } from "./sources";
|
|
7
|
+
import { useLoticsLocale } from "./locale";
|
|
7
8
|
|
|
8
9
|
export type FindingSeverity = "critical" | "warning" | "info" | "positive";
|
|
9
10
|
|
|
10
11
|
export interface FindingProps {
|
|
11
12
|
severity?: FindingSeverity;
|
|
13
|
+
/** Translated severity words. Defaults resolve through the locale ("Critical" …). */
|
|
14
|
+
labels?: Partial<FindingLabels>;
|
|
12
15
|
/** The headline — what the agent found. */
|
|
13
16
|
title: string;
|
|
14
17
|
/** One or two lines explaining it. */
|
|
@@ -28,12 +31,13 @@ export interface FindingProps {
|
|
|
28
31
|
|
|
29
32
|
// Severity reads through a coloured dot badge + the order it's stacked in (most
|
|
30
33
|
// severe first): red critical, amber warning, blue note, emerald on-track. The
|
|
31
|
-
// metric takes the same colour.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
// metric takes the same colour. Words resolve prop → locale → English default.
|
|
35
|
+
export type FindingLabels = Record<FindingSeverity, string>;
|
|
36
|
+
const SEV_COLOR: Record<FindingSeverity, ColorName> = {
|
|
37
|
+
critical: "red",
|
|
38
|
+
warning: "amber",
|
|
39
|
+
info: "blue",
|
|
40
|
+
positive: "emerald",
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
/**
|
|
@@ -45,7 +49,9 @@ const SEV: Record<FindingSeverity, { word: string; color: ColorName }> = {
|
|
|
45
49
|
* carries its own next action.
|
|
46
50
|
*/
|
|
47
51
|
export function Finding(props: FindingProps) {
|
|
48
|
-
const
|
|
52
|
+
const severity = props.severity ?? "info";
|
|
53
|
+
const words = { ...useLoticsLocale().finding, ...props.labels };
|
|
54
|
+
const sev = { word: words[severity], color: SEV_COLOR[severity] };
|
|
49
55
|
return (
|
|
50
56
|
<View style={styles.card}>
|
|
51
57
|
<View style={styles.header}>
|
package/src/locale.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { createContext, useContext, type ReactNode } from "react";
|
|
|
2
2
|
import { type PaginationLabels } from "./pagination";
|
|
3
3
|
import { type SortHeaderLabels } from "./sort_header";
|
|
4
4
|
import { type ConfidenceLabels } from "./confidence";
|
|
5
|
+
import { type FindingLabels } from "./finding";
|
|
5
6
|
import { type RemainderMeterLabels } from "./remainder_meter";
|
|
6
7
|
import { type DateRangeFilterFieldLabels } from "./date_range_filter_field";
|
|
7
8
|
|
|
@@ -36,6 +37,8 @@ export interface LoticsLocale {
|
|
|
36
37
|
drawer: { previous: string; next: string; close: string };
|
|
37
38
|
/** `Confidence`: the full level phrase ("High confidence" …). */
|
|
38
39
|
confidence: ConfidenceLabels;
|
|
40
|
+
/** `Finding`: the severity badge word ("Critical" …). */
|
|
41
|
+
finding: FindingLabels;
|
|
39
42
|
/** `RemainderMeter`: the applied / remaining / over / exact captions. */
|
|
40
43
|
remainderMeter: Required<RemainderMeterLabels>;
|
|
41
44
|
/** `ChangeReview` (+ `ChangeReviewActions`): the review-card chrome — the
|
|
@@ -81,6 +84,7 @@ export const en: LoticsLocale = {
|
|
|
81
84
|
formField: { optional: "Optional" },
|
|
82
85
|
drawer: { previous: "Previous record", next: "Next record", close: "Close" },
|
|
83
86
|
confidence: { high: "High confidence", medium: "Medium confidence", low: "Low confidence" },
|
|
87
|
+
finding: { critical: "Critical", warning: "Warning", info: "Note", positive: "On track" },
|
|
84
88
|
remainderMeter: {
|
|
85
89
|
applied: (allocated, total) => `${allocated} of ${total} applied`,
|
|
86
90
|
remaining: (remainder) => `${remainder} unapplied`,
|
|
@@ -131,6 +135,7 @@ export const vi: LoticsLocale = {
|
|
|
131
135
|
formField: { optional: "Tùy chọn" },
|
|
132
136
|
drawer: { previous: "Bản ghi trước", next: "Bản ghi sau", close: "Đóng" },
|
|
133
137
|
confidence: { high: "Độ tin cậy cao", medium: "Độ tin cậy trung bình", low: "Độ tin cậy thấp" },
|
|
138
|
+
finding: { critical: "Nghiêm trọng", warning: "Cảnh báo", info: "Ghi chú", positive: "Đúng tiến độ" },
|
|
134
139
|
remainderMeter: {
|
|
135
140
|
applied: (allocated, total) => `Đã phân bổ ${allocated}/${total}`,
|
|
136
141
|
remaining: (remainder) => `Còn ${remainder}`,
|