@arcfusionz/arc-analytic-ui 0.0.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/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/AnomalyCard/AnomalyCard.chart.d.ts +64 -0
- package/dist/components/AnomalyCard/AnomalyCard.chart.js +341 -0
- package/dist/components/AnomalyCard/AnomalyCard.d.ts +169 -0
- package/dist/components/AnomalyCard/AnomalyCard.js +1019 -0
- package/dist/components/AnomalyCard/AnomalyCard.model.d.ts +508 -0
- package/dist/components/AnomalyCard/AnomalyCard.model.js +553 -0
- package/dist/components/AnomalyCard/index.d.ts +4 -0
- package/dist/components/AnomalyCard/index.js +4 -0
- package/dist/components/ChartCard/ChartCard.chart.d.ts +72 -0
- package/dist/components/ChartCard/ChartCard.chart.js +1333 -0
- package/dist/components/ChartCard/ChartCard.d.ts +206 -0
- package/dist/components/ChartCard/ChartCard.js +718 -0
- package/dist/components/ChartCard/ChartCard.model.d.ts +452 -0
- package/dist/components/ChartCard/ChartCard.model.js +1223 -0
- package/dist/components/ChartCard/index.d.ts +4 -0
- package/dist/components/ChartCard/index.js +4 -0
- package/dist/components/ComparisonCard/ComparisonCard.chart.d.ts +80 -0
- package/dist/components/ComparisonCard/ComparisonCard.chart.js +337 -0
- package/dist/components/ComparisonCard/ComparisonCard.d.ts +200 -0
- package/dist/components/ComparisonCard/ComparisonCard.js +1325 -0
- package/dist/components/ComparisonCard/ComparisonCard.model.d.ts +309 -0
- package/dist/components/ComparisonCard/ComparisonCard.model.js +263 -0
- package/dist/components/ComparisonCard/index.d.ts +4 -0
- package/dist/components/ComparisonCard/index.js +4 -0
- package/dist/components/ForecastCard/ForecastCard.chart.d.ts +82 -0
- package/dist/components/ForecastCard/ForecastCard.chart.js +416 -0
- package/dist/components/ForecastCard/ForecastCard.d.ts +148 -0
- package/dist/components/ForecastCard/ForecastCard.js +1029 -0
- package/dist/components/ForecastCard/ForecastCard.model.d.ts +497 -0
- package/dist/components/ForecastCard/ForecastCard.model.js +554 -0
- package/dist/components/ForecastCard/index.d.ts +4 -0
- package/dist/components/ForecastCard/index.js +4 -0
- package/dist/components/HighlightCard/HighlightCard.chart.d.ts +122 -0
- package/dist/components/HighlightCard/HighlightCard.chart.js +660 -0
- package/dist/components/HighlightCard/HighlightCard.d.ts +202 -0
- package/dist/components/HighlightCard/HighlightCard.js +1286 -0
- package/dist/components/HighlightCard/HighlightCard.model.d.ts +692 -0
- package/dist/components/HighlightCard/HighlightCard.model.js +875 -0
- package/dist/components/HighlightCard/index.d.ts +4 -0
- package/dist/components/HighlightCard/index.js +4 -0
- package/dist/components/InsightCard/InsightCard.chart.d.ts +91 -0
- package/dist/components/InsightCard/InsightCard.chart.js +471 -0
- package/dist/components/InsightCard/InsightCard.d.ts +161 -0
- package/dist/components/InsightCard/InsightCard.js +961 -0
- package/dist/components/InsightCard/InsightCard.model.d.ts +405 -0
- package/dist/components/InsightCard/InsightCard.model.js +421 -0
- package/dist/components/InsightCard/index.d.ts +4 -0
- package/dist/components/InsightCard/index.js +4 -0
- package/dist/components/MetricCard/MetricCard.chart.d.ts +79 -0
- package/dist/components/MetricCard/MetricCard.chart.js +435 -0
- package/dist/components/MetricCard/MetricCard.d.ts +227 -0
- package/dist/components/MetricCard/MetricCard.js +1293 -0
- package/dist/components/MetricCard/MetricCard.model.d.ts +521 -0
- package/dist/components/MetricCard/MetricCard.model.js +627 -0
- package/dist/components/MetricCard/index.d.ts +4 -0
- package/dist/components/MetricCard/index.js +4 -0
- package/dist/components/ProfileCard/ProfileCard.chart.d.ts +64 -0
- package/dist/components/ProfileCard/ProfileCard.chart.js +427 -0
- package/dist/components/ProfileCard/ProfileCard.d.ts +140 -0
- package/dist/components/ProfileCard/ProfileCard.js +735 -0
- package/dist/components/ProfileCard/ProfileCard.model.d.ts +279 -0
- package/dist/components/ProfileCard/ProfileCard.model.js +244 -0
- package/dist/components/ProfileCard/index.d.ts +4 -0
- package/dist/components/ProfileCard/index.js +4 -0
- package/dist/components/ProgressCard/ProgressCard.chart.d.ts +73 -0
- package/dist/components/ProgressCard/ProgressCard.chart.js +373 -0
- package/dist/components/ProgressCard/ProgressCard.d.ts +137 -0
- package/dist/components/ProgressCard/ProgressCard.js +908 -0
- package/dist/components/ProgressCard/ProgressCard.model.d.ts +385 -0
- package/dist/components/ProgressCard/ProgressCard.model.js +389 -0
- package/dist/components/ProgressCard/index.d.ts +4 -0
- package/dist/components/ProgressCard/index.js +4 -0
- package/dist/components/ReportCard/ReportCard.chart.d.ts +45 -0
- package/dist/components/ReportCard/ReportCard.chart.js +231 -0
- package/dist/components/ReportCard/ReportCard.d.ts +153 -0
- package/dist/components/ReportCard/ReportCard.js +1118 -0
- package/dist/components/ReportCard/ReportCard.model.d.ts +392 -0
- package/dist/components/ReportCard/ReportCard.model.js +399 -0
- package/dist/components/ReportCard/index.d.ts +4 -0
- package/dist/components/ReportCard/index.js +4 -0
- package/dist/components/SankeyCard/SankeyCard.chart.d.ts +75 -0
- package/dist/components/SankeyCard/SankeyCard.chart.js +249 -0
- package/dist/components/SankeyCard/SankeyCard.d.ts +185 -0
- package/dist/components/SankeyCard/SankeyCard.js +788 -0
- package/dist/components/SankeyCard/SankeyCard.model.d.ts +501 -0
- package/dist/components/SankeyCard/SankeyCard.model.js +789 -0
- package/dist/components/SankeyCard/index.d.ts +4 -0
- package/dist/components/SankeyCard/index.js +4 -0
- package/dist/components/StatusCard/StatusCard.chart.d.ts +60 -0
- package/dist/components/StatusCard/StatusCard.chart.js +188 -0
- package/dist/components/StatusCard/StatusCard.d.ts +176 -0
- package/dist/components/StatusCard/StatusCard.js +989 -0
- package/dist/components/StatusCard/StatusCard.model.d.ts +555 -0
- package/dist/components/StatusCard/StatusCard.model.js +776 -0
- package/dist/components/StatusCard/index.d.ts +4 -0
- package/dist/components/StatusCard/index.js +4 -0
- package/dist/components/TableCard/TableCard.chart.d.ts +53 -0
- package/dist/components/TableCard/TableCard.chart.js +192 -0
- package/dist/components/TableCard/TableCard.d.ts +140 -0
- package/dist/components/TableCard/TableCard.js +811 -0
- package/dist/components/TableCard/TableCard.model.d.ts +381 -0
- package/dist/components/TableCard/TableCard.model.js +475 -0
- package/dist/components/TableCard/index.d.ts +4 -0
- package/dist/components/TableCard/index.js +4 -0
- package/dist/components/TargetCard/TargetCard.chart.d.ts +52 -0
- package/dist/components/TargetCard/TargetCard.chart.js +273 -0
- package/dist/components/TargetCard/TargetCard.d.ts +143 -0
- package/dist/components/TargetCard/TargetCard.js +910 -0
- package/dist/components/TargetCard/TargetCard.model.d.ts +468 -0
- package/dist/components/TargetCard/TargetCard.model.js +581 -0
- package/dist/components/TargetCard/index.d.ts +4 -0
- package/dist/components/TargetCard/index.js +4 -0
- package/dist/components/TreeCard/TreeCard.chart.d.ts +80 -0
- package/dist/components/TreeCard/TreeCard.chart.js +178 -0
- package/dist/components/TreeCard/TreeCard.d.ts +182 -0
- package/dist/components/TreeCard/TreeCard.js +1187 -0
- package/dist/components/TreeCard/TreeCard.model.d.ts +330 -0
- package/dist/components/TreeCard/TreeCard.model.js +401 -0
- package/dist/components/TreeCard/index.d.ts +4 -0
- package/dist/components/TreeCard/index.js +4 -0
- package/dist/components/TrendCard/TrendCard.chart.d.ts +75 -0
- package/dist/components/TrendCard/TrendCard.chart.js +393 -0
- package/dist/components/TrendCard/TrendCard.d.ts +224 -0
- package/dist/components/TrendCard/TrendCard.js +1053 -0
- package/dist/components/TrendCard/TrendCard.model.d.ts +545 -0
- package/dist/components/TrendCard/TrendCard.model.js +623 -0
- package/dist/components/TrendCard/index.d.ts +4 -0
- package/dist/components/TrendCard/index.js +4 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.js +57 -0
- package/dist/lib/vega/ArcVegaChart.d.ts +24 -0
- package/dist/lib/vega/ArcVegaChart.js +42 -0
- package/dist/lib/vega/ArcVegaSurface.d.ts +13 -0
- package/dist/lib/vega/ArcVegaSurface.js +38 -0
- package/dist/lib/vega/axisTicks.js +156 -0
- package/dist/lib/vega/config.d.ts +29 -0
- package/dist/lib/vega/config.js +113 -0
- package/dist/lib/vega/embed.d.ts +29 -0
- package/dist/lib/vega/embed.js +29 -0
- package/dist/lib/vega/engine.d.ts +10 -0
- package/dist/lib/vega/engine.js +6 -0
- package/dist/lib/vega/formatters.d.ts +125 -0
- package/dist/lib/vega/formatters.js +277 -0
- package/dist/lib/vega/index.d.ts +11 -0
- package/dist/lib/vega/load.d.ts +13 -0
- package/dist/lib/vega/load.js +21 -0
- package/dist/lib/vega/time.d.ts +45 -0
- package/dist/lib/vega/time.js +105 -0
- package/dist/lib/vega/tokens.d.ts +73 -0
- package/dist/lib/vega/tokens.js +137 -0
- package/dist/lib/vega/tooltip.d.ts +45 -0
- package/dist/lib/vega/tooltip.js +124 -0
- package/dist/lib/vega/useArcVega.d.ts +43 -0
- package/dist/lib/vega/useArcVega.js +121 -0
- package/package.json +60 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { ArcTimeGranularity } from "../../lib/vega/formatters.js";
|
|
2
|
+
import { InsightCardLabels, InsightCardSize, InsightCardStatus, InsightDeltaMode, InsightEvidence, InsightFeedback, InsightGoodDirection, InsightKind, InsightObservation, InsightPoint, InsightSeverity, InsightSeverityThresholds, InsightXType } from "./InsightCard.model.js";
|
|
3
|
+
import { InsightAxes } from "./InsightCard.chart.js";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
import { BoxProps } from "@arcfusionz/arc-primitive-ui";
|
|
6
|
+
import { TopLevelSpec } from "vega-lite";
|
|
7
|
+
import { Result } from "vega-embed";
|
|
8
|
+
//#region src/components/InsightCard/InsightCard.d.ts
|
|
9
|
+
interface InsightCardProps extends Omit<BoxProps, "children" | "padding" | "title"> {
|
|
10
|
+
/** What the finding is about — the measure, the slice, the subject. The panel's heading. Pass `name` too when this is not plain text. */
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
/** Plain-text subject used in the generated descriptions and control labels. Defaults to `label` when it is a string. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The finding itself, as a sentence — the card's primary content and the
|
|
16
|
+
* most prominent thing on it. Wrap the values in `<strong>`. Pass
|
|
17
|
+
* `statementText` too when this is not plain text, or the description
|
|
18
|
+
* falls back to a sentence generated from the observation.
|
|
19
|
+
*/
|
|
20
|
+
statement?: ReactNode;
|
|
21
|
+
/** Plain-text form of `statement`, for the generated description. Defaults to `statement` when it is a string. */
|
|
22
|
+
statementText?: string;
|
|
23
|
+
/** What the finding means, shown in a tooltip behind a help control beside the label and exposed to assistive technology as its description. */
|
|
24
|
+
hint?: string;
|
|
25
|
+
/**
|
|
26
|
+
* What kind of finding this is. It drives the badge's word and glyph and
|
|
27
|
+
* nothing else — the encoding underneath never changes with the kind, so a
|
|
28
|
+
* rail of mixed kinds still reads as one medium. Stamped as `data-kind`.
|
|
29
|
+
*/
|
|
30
|
+
kind?: InsightKind;
|
|
31
|
+
/**
|
|
32
|
+
* The finding's numbers: the reading it is about and what was expected of
|
|
33
|
+
* it. This is what makes the claim checkable — without it the card renders
|
|
34
|
+
* the statement as the assertion it is, with no evidence row and no plot.
|
|
35
|
+
*/
|
|
36
|
+
observation?: InsightObservation | null;
|
|
37
|
+
/**
|
|
38
|
+
* The measure's history, for the evidence spark. `{ x, y }` at minimum;
|
|
39
|
+
* `expected`, `lower` and `upper` per point draw the corridor a detector
|
|
40
|
+
* that reports one per period produces. A reading the card has no value
|
|
41
|
+
* for is a gap, not a zero — omit `y` or pass `null`. Pass `[]` while
|
|
42
|
+
* loading, or for a finding with no history.
|
|
43
|
+
*/
|
|
44
|
+
points?: readonly InsightPoint[];
|
|
45
|
+
/** Axis kind for `points`. Inferred from the first reading when omitted. */
|
|
46
|
+
xType?: InsightXType;
|
|
47
|
+
/**
|
|
48
|
+
* The evidence form. `auto` (default) takes the fullest the data supports —
|
|
49
|
+
* `spark` when there is history, then `range`, then `none`. Stamped as
|
|
50
|
+
* `data-evidence` with what was actually resolved.
|
|
51
|
+
*/
|
|
52
|
+
evidence?: InsightEvidence;
|
|
53
|
+
/** Which axes the spark draws. `none` (default) is the sparkline convention: the key row above the plot carries the numbers. The range strip never draws one. */
|
|
54
|
+
axes?: InsightAxes;
|
|
55
|
+
/** Include zero in the spark's value scale. Default `false` — a line may crop, and the key row prints the readings. */
|
|
56
|
+
zeroScale?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* How much the finding matters — a different axis from polarity. Derived
|
|
59
|
+
* from how far the reading is from expectation, on whichever scale the
|
|
60
|
+
* detector's data establishes; pass it to override with a detector's own
|
|
61
|
+
* score. Stamped as `data-severity`.
|
|
62
|
+
*/
|
|
63
|
+
severity?: InsightSeverity;
|
|
64
|
+
/**
|
|
65
|
+
* Overrides the severity ladder, **in the units of the active strength
|
|
66
|
+
* scale** — σ when the observation carries `sd` (defaults 2 and 3),
|
|
67
|
+
* half-widths of the expected range when it carries a band (1 and 2), a
|
|
68
|
+
* share of the expectation otherwise (0.1 and 0.25). Which one is active is
|
|
69
|
+
* stamped as `data-strength`.
|
|
70
|
+
*/
|
|
71
|
+
severityThresholds?: InsightSeverityThresholds;
|
|
72
|
+
/** Which way is good for this measure: revenue up, churn down, headcount neither. Drives the delta's polarity and the marker's hue. Default `none`. */
|
|
73
|
+
goodDirection?: InsightGoodDirection;
|
|
74
|
+
/** How the deviation is written: `percent` (default) is relative to the expectation, `absolute` is the difference in the measure's own units. */
|
|
75
|
+
deltaMode?: InsightDeltaMode;
|
|
76
|
+
/** The measure's number grammar: `number[:digits]`, `integer`, `compact[:digits]`, `percent[:digits]`, `currency:CODE[:digits|compact]`. */
|
|
77
|
+
format?: string;
|
|
78
|
+
/** Custom formatter for every reading. Takes precedence over `format`. */
|
|
79
|
+
formatValue?: (value: number) => string;
|
|
80
|
+
/** Granularity for the period labels in the table, the tooltip and the description. Default `day`. */
|
|
81
|
+
granularity?: ArcTimeGranularity;
|
|
82
|
+
/** How the finding was made — "Seasonal decomposition", "3σ control chart", "Claude Opus 4.5". Rendered in the provenance line and read out in the description. */
|
|
83
|
+
method?: string;
|
|
84
|
+
/** How much the detector trusts the finding, 0–1. Rendered as a word and the number, never as a bare bar. */
|
|
85
|
+
confidence?: number;
|
|
86
|
+
/** How many readings the finding was made from. Rendered in the provenance line. */
|
|
87
|
+
sampleSize?: number;
|
|
88
|
+
/** When the finding was made — distinct from `updatedAt`, which is when the data was last true. */
|
|
89
|
+
detectedAt?: Date | string | number;
|
|
90
|
+
/** How `detectedAt` is written, in the card's `locale` and `timeZone`. Default `day`. */
|
|
91
|
+
detectedAtFormat?: ArcTimeGranularity | ((date: Date) => string);
|
|
92
|
+
/** This finding came from a model or a detector rather than a person; shows the AI mark beside the statement. Default `true`. */
|
|
93
|
+
generated?: boolean;
|
|
94
|
+
/** The transport's status. `loading` with a finding already present is a refresh: the previous render stays under the veil. Default `ready`. */
|
|
95
|
+
status?: InsightCardStatus;
|
|
96
|
+
/** The consumer's filter is active — no finding then reads as no-match rather than empty. */
|
|
97
|
+
filtered?: boolean;
|
|
98
|
+
/** The data is older than the product's freshness rule (TanStack Query's `isStale`). Shows a badge and stamps `data-stale`. */
|
|
99
|
+
stale?: boolean;
|
|
100
|
+
/** When the data was last true. Rendered as an "as of" line and included in the description. */
|
|
101
|
+
updatedAt?: Date | string | number;
|
|
102
|
+
/** How `updatedAt` is written, in the card's `locale` and `timeZone`. Default `day`. */
|
|
103
|
+
updatedAtFormat?: ArcTimeGranularity | ((date: Date) => string);
|
|
104
|
+
/** Recovery action for the error state; renders a retry button when set. */
|
|
105
|
+
onRetry?: () => void;
|
|
106
|
+
/** Recovery action for the no-match state; renders a clear-filters button when set. */
|
|
107
|
+
onClearFilters?: () => void;
|
|
108
|
+
/** Renders the dismiss control in the header. The consumer removes the card — this card never hides itself. */
|
|
109
|
+
onDismiss?: () => void;
|
|
110
|
+
/** What the reader said about the finding, controlled — pair with `onFeedback`. */
|
|
111
|
+
feedback?: InsightFeedback | null;
|
|
112
|
+
/** The choice on first render when `feedback` is uncontrolled. */
|
|
113
|
+
defaultFeedback?: InsightFeedback | null;
|
|
114
|
+
/** Called with the reader's verdict, or `null` when they take it back. Renders the feedback controls when set. */
|
|
115
|
+
onFeedback?: (feedback: InsightFeedback | null) => void;
|
|
116
|
+
/** The act-on-it control, rendered in the footer — a `Button` or a `Menu`. This is where "Investigate" belongs. */
|
|
117
|
+
primaryAction?: ReactNode;
|
|
118
|
+
/** Trailing header slot — a ghost `Button` or `Menu`. */
|
|
119
|
+
action?: ReactNode;
|
|
120
|
+
/** Lines the statement reserves before it arrives, so a rail of cards is already its final height. Default 2. */
|
|
121
|
+
expectedLines?: number;
|
|
122
|
+
/** Density: `sm` for a dense rail, `md` (default), `lg` for a hero panel. */
|
|
123
|
+
size?: InsightCardSize;
|
|
124
|
+
/** Heading level of the label for the document outline. Default 3. */
|
|
125
|
+
titleLevel?: 2 | 3 | 4 | 5 | 6;
|
|
126
|
+
/** BCP 47 locale for every number and date. Thai products on the Gregorian calendar pass `th-TH-u-ca-gregory`. */
|
|
127
|
+
locale?: string;
|
|
128
|
+
/** IANA time zone for every date. Defaults to the runtime's — pass it for deterministic output. */
|
|
129
|
+
timeZone?: string;
|
|
130
|
+
/** Overrides for every rendered or announced string. */
|
|
131
|
+
labels?: Partial<InsightCardLabels>;
|
|
132
|
+
/** Replaces the generated accessible description of the whole card. */
|
|
133
|
+
description?: string;
|
|
134
|
+
/** Open the data popover on first render. */
|
|
135
|
+
defaultTableOpen?: boolean;
|
|
136
|
+
/** Hide the header data button. Only when another surface exposes the same values to keyboard and screen-reader users. */
|
|
137
|
+
hideTableToggle?: boolean;
|
|
138
|
+
/** Called with vega-embed's result once the plot mounts — for `view` access in advanced compositions. */
|
|
139
|
+
onEmbed?: (result: Result) => void;
|
|
140
|
+
/** Escape hatch: transform the spec before it renders. Voids the token and accessibility guarantees for whatever it changes. */
|
|
141
|
+
patchSpec?: (spec: TopLevelSpec) => TopLevelSpec;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* A finding, stated — the tenth member of the analytics card family, and the
|
|
145
|
+
* only one whose primary content is a **claim** rather than a reading.
|
|
146
|
+
* Everything else here takes data and computes something; this takes a finding
|
|
147
|
+
* a detector or a model already made and lays it out so a person can judge it:
|
|
148
|
+
* the statement, the observed reading against what was expected, the evidence
|
|
149
|
+
* plot, the provenance behind the claim, and the triage — act, dismiss, or say
|
|
150
|
+
* it was wrong.
|
|
151
|
+
*
|
|
152
|
+
* The evidence resolves itself: a `spark` when there is history to plot, a
|
|
153
|
+
* `range` strip when there is only a reading and an expectation, `none` when
|
|
154
|
+
* the finding is not a number on a scale. Severity is derived on whichever
|
|
155
|
+
* scale the detector's own data establishes and stamped with which one that
|
|
156
|
+
* was, polarity is separate and rides `goodDirection`, and every value the
|
|
157
|
+
* plot shows is also in the key row, the description and the popover table.
|
|
158
|
+
*/
|
|
159
|
+
declare const InsightCard: import("react").ForwardRefExoticComponent<InsightCardProps & import("react").RefAttributes<HTMLElement>>;
|
|
160
|
+
//#endregion
|
|
161
|
+
export { InsightCard, InsightCardProps };
|