@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.
Files changed (156) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +13 -0
  2. package/dist/components/AnomalyCard/AnomalyCard.chart.d.ts +64 -0
  3. package/dist/components/AnomalyCard/AnomalyCard.chart.js +341 -0
  4. package/dist/components/AnomalyCard/AnomalyCard.d.ts +169 -0
  5. package/dist/components/AnomalyCard/AnomalyCard.js +1019 -0
  6. package/dist/components/AnomalyCard/AnomalyCard.model.d.ts +508 -0
  7. package/dist/components/AnomalyCard/AnomalyCard.model.js +553 -0
  8. package/dist/components/AnomalyCard/index.d.ts +4 -0
  9. package/dist/components/AnomalyCard/index.js +4 -0
  10. package/dist/components/ChartCard/ChartCard.chart.d.ts +72 -0
  11. package/dist/components/ChartCard/ChartCard.chart.js +1333 -0
  12. package/dist/components/ChartCard/ChartCard.d.ts +206 -0
  13. package/dist/components/ChartCard/ChartCard.js +718 -0
  14. package/dist/components/ChartCard/ChartCard.model.d.ts +452 -0
  15. package/dist/components/ChartCard/ChartCard.model.js +1223 -0
  16. package/dist/components/ChartCard/index.d.ts +4 -0
  17. package/dist/components/ChartCard/index.js +4 -0
  18. package/dist/components/ComparisonCard/ComparisonCard.chart.d.ts +80 -0
  19. package/dist/components/ComparisonCard/ComparisonCard.chart.js +337 -0
  20. package/dist/components/ComparisonCard/ComparisonCard.d.ts +200 -0
  21. package/dist/components/ComparisonCard/ComparisonCard.js +1325 -0
  22. package/dist/components/ComparisonCard/ComparisonCard.model.d.ts +309 -0
  23. package/dist/components/ComparisonCard/ComparisonCard.model.js +263 -0
  24. package/dist/components/ComparisonCard/index.d.ts +4 -0
  25. package/dist/components/ComparisonCard/index.js +4 -0
  26. package/dist/components/ForecastCard/ForecastCard.chart.d.ts +82 -0
  27. package/dist/components/ForecastCard/ForecastCard.chart.js +416 -0
  28. package/dist/components/ForecastCard/ForecastCard.d.ts +148 -0
  29. package/dist/components/ForecastCard/ForecastCard.js +1029 -0
  30. package/dist/components/ForecastCard/ForecastCard.model.d.ts +497 -0
  31. package/dist/components/ForecastCard/ForecastCard.model.js +554 -0
  32. package/dist/components/ForecastCard/index.d.ts +4 -0
  33. package/dist/components/ForecastCard/index.js +4 -0
  34. package/dist/components/HighlightCard/HighlightCard.chart.d.ts +122 -0
  35. package/dist/components/HighlightCard/HighlightCard.chart.js +660 -0
  36. package/dist/components/HighlightCard/HighlightCard.d.ts +202 -0
  37. package/dist/components/HighlightCard/HighlightCard.js +1286 -0
  38. package/dist/components/HighlightCard/HighlightCard.model.d.ts +692 -0
  39. package/dist/components/HighlightCard/HighlightCard.model.js +875 -0
  40. package/dist/components/HighlightCard/index.d.ts +4 -0
  41. package/dist/components/HighlightCard/index.js +4 -0
  42. package/dist/components/InsightCard/InsightCard.chart.d.ts +91 -0
  43. package/dist/components/InsightCard/InsightCard.chart.js +471 -0
  44. package/dist/components/InsightCard/InsightCard.d.ts +161 -0
  45. package/dist/components/InsightCard/InsightCard.js +961 -0
  46. package/dist/components/InsightCard/InsightCard.model.d.ts +405 -0
  47. package/dist/components/InsightCard/InsightCard.model.js +421 -0
  48. package/dist/components/InsightCard/index.d.ts +4 -0
  49. package/dist/components/InsightCard/index.js +4 -0
  50. package/dist/components/MetricCard/MetricCard.chart.d.ts +79 -0
  51. package/dist/components/MetricCard/MetricCard.chart.js +435 -0
  52. package/dist/components/MetricCard/MetricCard.d.ts +227 -0
  53. package/dist/components/MetricCard/MetricCard.js +1293 -0
  54. package/dist/components/MetricCard/MetricCard.model.d.ts +521 -0
  55. package/dist/components/MetricCard/MetricCard.model.js +627 -0
  56. package/dist/components/MetricCard/index.d.ts +4 -0
  57. package/dist/components/MetricCard/index.js +4 -0
  58. package/dist/components/ProfileCard/ProfileCard.chart.d.ts +64 -0
  59. package/dist/components/ProfileCard/ProfileCard.chart.js +427 -0
  60. package/dist/components/ProfileCard/ProfileCard.d.ts +140 -0
  61. package/dist/components/ProfileCard/ProfileCard.js +735 -0
  62. package/dist/components/ProfileCard/ProfileCard.model.d.ts +279 -0
  63. package/dist/components/ProfileCard/ProfileCard.model.js +244 -0
  64. package/dist/components/ProfileCard/index.d.ts +4 -0
  65. package/dist/components/ProfileCard/index.js +4 -0
  66. package/dist/components/ProgressCard/ProgressCard.chart.d.ts +73 -0
  67. package/dist/components/ProgressCard/ProgressCard.chart.js +373 -0
  68. package/dist/components/ProgressCard/ProgressCard.d.ts +137 -0
  69. package/dist/components/ProgressCard/ProgressCard.js +908 -0
  70. package/dist/components/ProgressCard/ProgressCard.model.d.ts +385 -0
  71. package/dist/components/ProgressCard/ProgressCard.model.js +389 -0
  72. package/dist/components/ProgressCard/index.d.ts +4 -0
  73. package/dist/components/ProgressCard/index.js +4 -0
  74. package/dist/components/ReportCard/ReportCard.chart.d.ts +45 -0
  75. package/dist/components/ReportCard/ReportCard.chart.js +231 -0
  76. package/dist/components/ReportCard/ReportCard.d.ts +153 -0
  77. package/dist/components/ReportCard/ReportCard.js +1118 -0
  78. package/dist/components/ReportCard/ReportCard.model.d.ts +392 -0
  79. package/dist/components/ReportCard/ReportCard.model.js +399 -0
  80. package/dist/components/ReportCard/index.d.ts +4 -0
  81. package/dist/components/ReportCard/index.js +4 -0
  82. package/dist/components/SankeyCard/SankeyCard.chart.d.ts +75 -0
  83. package/dist/components/SankeyCard/SankeyCard.chart.js +249 -0
  84. package/dist/components/SankeyCard/SankeyCard.d.ts +185 -0
  85. package/dist/components/SankeyCard/SankeyCard.js +788 -0
  86. package/dist/components/SankeyCard/SankeyCard.model.d.ts +501 -0
  87. package/dist/components/SankeyCard/SankeyCard.model.js +789 -0
  88. package/dist/components/SankeyCard/index.d.ts +4 -0
  89. package/dist/components/SankeyCard/index.js +4 -0
  90. package/dist/components/StatusCard/StatusCard.chart.d.ts +60 -0
  91. package/dist/components/StatusCard/StatusCard.chart.js +188 -0
  92. package/dist/components/StatusCard/StatusCard.d.ts +176 -0
  93. package/dist/components/StatusCard/StatusCard.js +989 -0
  94. package/dist/components/StatusCard/StatusCard.model.d.ts +555 -0
  95. package/dist/components/StatusCard/StatusCard.model.js +776 -0
  96. package/dist/components/StatusCard/index.d.ts +4 -0
  97. package/dist/components/StatusCard/index.js +4 -0
  98. package/dist/components/TableCard/TableCard.chart.d.ts +53 -0
  99. package/dist/components/TableCard/TableCard.chart.js +192 -0
  100. package/dist/components/TableCard/TableCard.d.ts +140 -0
  101. package/dist/components/TableCard/TableCard.js +811 -0
  102. package/dist/components/TableCard/TableCard.model.d.ts +381 -0
  103. package/dist/components/TableCard/TableCard.model.js +475 -0
  104. package/dist/components/TableCard/index.d.ts +4 -0
  105. package/dist/components/TableCard/index.js +4 -0
  106. package/dist/components/TargetCard/TargetCard.chart.d.ts +52 -0
  107. package/dist/components/TargetCard/TargetCard.chart.js +273 -0
  108. package/dist/components/TargetCard/TargetCard.d.ts +143 -0
  109. package/dist/components/TargetCard/TargetCard.js +910 -0
  110. package/dist/components/TargetCard/TargetCard.model.d.ts +468 -0
  111. package/dist/components/TargetCard/TargetCard.model.js +581 -0
  112. package/dist/components/TargetCard/index.d.ts +4 -0
  113. package/dist/components/TargetCard/index.js +4 -0
  114. package/dist/components/TreeCard/TreeCard.chart.d.ts +80 -0
  115. package/dist/components/TreeCard/TreeCard.chart.js +178 -0
  116. package/dist/components/TreeCard/TreeCard.d.ts +182 -0
  117. package/dist/components/TreeCard/TreeCard.js +1187 -0
  118. package/dist/components/TreeCard/TreeCard.model.d.ts +330 -0
  119. package/dist/components/TreeCard/TreeCard.model.js +401 -0
  120. package/dist/components/TreeCard/index.d.ts +4 -0
  121. package/dist/components/TreeCard/index.js +4 -0
  122. package/dist/components/TrendCard/TrendCard.chart.d.ts +75 -0
  123. package/dist/components/TrendCard/TrendCard.chart.js +393 -0
  124. package/dist/components/TrendCard/TrendCard.d.ts +224 -0
  125. package/dist/components/TrendCard/TrendCard.js +1053 -0
  126. package/dist/components/TrendCard/TrendCard.model.d.ts +545 -0
  127. package/dist/components/TrendCard/TrendCard.model.js +623 -0
  128. package/dist/components/TrendCard/index.d.ts +4 -0
  129. package/dist/components/TrendCard/index.js +4 -0
  130. package/dist/index.d.ts +76 -0
  131. package/dist/index.js +57 -0
  132. package/dist/lib/vega/ArcVegaChart.d.ts +24 -0
  133. package/dist/lib/vega/ArcVegaChart.js +42 -0
  134. package/dist/lib/vega/ArcVegaSurface.d.ts +13 -0
  135. package/dist/lib/vega/ArcVegaSurface.js +38 -0
  136. package/dist/lib/vega/axisTicks.js +156 -0
  137. package/dist/lib/vega/config.d.ts +29 -0
  138. package/dist/lib/vega/config.js +113 -0
  139. package/dist/lib/vega/embed.d.ts +29 -0
  140. package/dist/lib/vega/embed.js +29 -0
  141. package/dist/lib/vega/engine.d.ts +10 -0
  142. package/dist/lib/vega/engine.js +6 -0
  143. package/dist/lib/vega/formatters.d.ts +125 -0
  144. package/dist/lib/vega/formatters.js +277 -0
  145. package/dist/lib/vega/index.d.ts +11 -0
  146. package/dist/lib/vega/load.d.ts +13 -0
  147. package/dist/lib/vega/load.js +21 -0
  148. package/dist/lib/vega/time.d.ts +45 -0
  149. package/dist/lib/vega/time.js +105 -0
  150. package/dist/lib/vega/tokens.d.ts +73 -0
  151. package/dist/lib/vega/tokens.js +137 -0
  152. package/dist/lib/vega/tooltip.d.ts +45 -0
  153. package/dist/lib/vega/tooltip.js +124 -0
  154. package/dist/lib/vega/useArcVega.d.ts +43 -0
  155. package/dist/lib/vega/useArcVega.js +121 -0
  156. 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 };