@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,153 @@
1
+ import { ArcTimeGranularity } from "../../lib/vega/formatters.js";
2
+ import { ReportBandPaint } from "./ReportCard.chart.js";
3
+ import { ReportBand, ReportCardLabels, ReportCardSize, ReportCardStatus, ReportCriterion, ReportGoodDirection, ReportHeadline, ReportOverallMode, ReportScoreDomain, ReportSort } from "./ReportCard.model.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/ReportCard/ReportCard.d.ts
9
+ interface ReportCardProps extends Omit<BoxProps, "children" | "padding" | "title"> {
10
+ /** What is being graded — the panel's heading. Pass `name` too when this is not plain text. */
11
+ label: ReactNode;
12
+ /** Plain-text name used in the generated descriptions and control labels. Defaults to `label` when it is a string. */
13
+ name?: string;
14
+ /** How the grade is arrived at, shown in a tooltip behind an info control beside the label and exposed to assistive technology as the control's description. */
15
+ hint?: string;
16
+ /**
17
+ * What the subject is graded on, in the order they should read. Each
18
+ * criterion resolves to one score on `scoreDomain` by one of three routes,
19
+ * checked in order: `score` as given; `value` against `target` (attainment,
20
+ * where a `down` criterion inverts the ratio); `value` inside `range`
21
+ * (`[worst, best]`, reversed for lower-is-better). A criterion with none of
22
+ * those is unscored — its row stays, with no bar, and it is left out of the
23
+ * roll-up and counted as not measured rather than scored zero. Pass `[]`
24
+ * while loading; `expectedCriteria` rows are reserved.
25
+ */
26
+ criteria: readonly ReportCriterion[];
27
+ /**
28
+ * The grade ladder, low to high — each band runs from its `min` up to the
29
+ * next band's, so the ladder can never leave a gap. `tone` says what the
30
+ * grade means and paints the band and the bars in it. Default: Excellent
31
+ * (90) · Good (75) · Fair (60) · Poor (0), lettered A–D for the row column.
32
+ */
33
+ bands?: readonly ReportBand[];
34
+ /** How the ladder is painted: `neutral` (default) is one gray at four intensities, worst band darkest — Few's quiet qualitative ranges; `status` gives each band its own tone, the traffic-light scorecard. */
35
+ bandPaint?: ReportBandPaint;
36
+ /** The score scale, `[floor, ceiling]`. Default `[0, 100]`. The floor is the bars' baseline and the ceiling is a perfect score; a score past either end widens the plotted scale rather than clipping the bar. */
37
+ scoreDomain?: ReportScoreDomain;
38
+ /** Number format for every score — the headline, the rows, the detail line, the table and the tooltip. Default `number:0`. */
39
+ scoreFormat?: string;
40
+ /** Custom formatter for scores. Takes precedence over `scoreFormat`. */
41
+ formatScore?: (score: number) => string;
42
+ /** Number format for a criterion's raw reading when it names none of its own. Default `compact`. */
43
+ format?: string;
44
+ /** Custom formatter for raw readings. Takes precedence over `format` and a criterion's own. */
45
+ formatValue?: (value: number) => string;
46
+ /** Which way is good for a reading when a criterion does not say — `up` (a quota) or `down` (a budget, a defect rate). Only used where a score is derived from `value` and `target`. Default `up`. */
47
+ goodDirection?: ReportGoodDirection;
48
+ /** The score every criterion is expected to reach, drawn as each row's comparative tick. A criterion's own `targetScore` overrides it; `null` draws no ticks. */
49
+ passing?: number | null;
50
+ /** How the overall score is reached: `weighted` (default) is the weight-weighted mean of the scored criteria, `min` is the weakest one (a compliance scorecard), `none` leaves the roll-up to the consumer. Stamped as `data-overall-source`. */
51
+ overallMode?: ReportOverallMode;
52
+ /** The composite the product computed itself, which replaces the roll-up entirely. `null` while unknown. */
53
+ overall?: number | null;
54
+ /** The same subject's overall score last time — draws the change in points beside the headline. */
55
+ previousScore?: number | null;
56
+ /** What the change is against, under the delta badge. Default `vs previous` (`labels.versusPrevious`). */
57
+ previousLabel?: ReactNode;
58
+ /**
59
+ * What the big number is. `score` (default) is the overall score with its
60
+ * grade in a chip beneath — the KPI-tile convention. `grade` puts the grade
61
+ * word in the value role with the score beneath, for letter ladders.
62
+ * `none` leaves the rows to carry the panel. Stamped as `data-headline`.
63
+ */
64
+ headline?: ReportHeadline;
65
+ /** Write the score's ceiling after the headline value (`/100`) — only on a scale that starts at zero, where `score / ceiling` is a true reading. Default `true`; `false` when the scale is obvious from the product. */
66
+ showCeiling?: boolean;
67
+ /** Write each row's grade after its score, as a swatch and the band's short label. Default `true`; `false` for a very narrow panel — the tooltip, the table and the description still carry it. */
68
+ showGrades?: boolean;
69
+ /** Write the scale under the plot: `ends` (default) is the floor and the ceiling, `bands` adds every band boundary that fits, `none` writes nothing. */
70
+ scaleTicks?: "ends" | "bands" | "none";
71
+ /** Row order: `none` (default) keeps the consumer's order, `worst` puts the lowest score first (the action list), `best` the highest, `impact` ranks by the weighted points a criterion costs the overall. Unscored criteria always sort last. */
72
+ sort?: ReportSort;
73
+ /**
74
+ * Fold every criterion past this count (after sorting) into one `Other
75
+ * criteria` row whose score is the *weighted mean* of the folded rows and
76
+ * whose weight is their total — a mean folds honestly where a sum would
77
+ * not. Default: no fold.
78
+ */
79
+ maxCriteria?: number;
80
+ /** Rows the skeleton reserves before `criteria` arrive, so the panel is already its final height. Default 4. */
81
+ expectedCriteria?: number;
82
+ /**
83
+ * Let the reader choose a criterion: the rows become a radio group (click,
84
+ * or arrow keys once a row has focus) and the selected row's detail line
85
+ * under the headline names its reading, its target, its weight and its
86
+ * note. Default `true`; `false` for a static panel. Stamped as
87
+ * `data-selectable`.
88
+ */
89
+ selectable?: boolean;
90
+ /** Key of the selected criterion, controlled — pair with `onSelectedChange`. Omit for the uncontrolled panel (`defaultSelected`, else the weakest scored criterion); `null` selects none. */
91
+ selected?: string | null;
92
+ /** The criterion selected on first render when `selected` is uncontrolled. Default: the weakest scored one — the row the reader is here for. */
93
+ defaultSelected?: string | null;
94
+ /** Called with the chosen criterion's key when the reader selects another row. */
95
+ onSelectedChange?: (key: string) => void;
96
+ /** The takeaway in a sentence, rendered beside the AI mark under the rows. Wrap values in `<strong>` to set them in bold. */
97
+ insight?: ReactNode;
98
+ /** The transport's status. `loading` with criteria already present is a refresh: the previous render stays under the veil. Default `ready`. */
99
+ status?: ReportCardStatus;
100
+ /** The consumer's filter is active — no criteria then reads as no-match rather than empty, with a clear-filters action when `onClearFilters` is set. */
101
+ filtered?: boolean;
102
+ /** The data is older than the product's freshness rule (TanStack Query's `isStale`). Shows a badge and stamps `data-stale`. */
103
+ stale?: boolean;
104
+ /** When the report was last true. Rendered as an "as of" line (the date by default — see `updatedAtFormat`) and included in the description. */
105
+ updatedAt?: Date | string | number;
106
+ /**
107
+ * How `updatedAt` is written, as a time-grammar granularity — `day`
108
+ * (default, `Sep 8, 2026`), `datetime`, `time`, `month`, `year` — or a
109
+ * formatter for a custom form. Applies to the as-of line and the
110
+ * description alike, in the card's `locale` and `timeZone`.
111
+ */
112
+ updatedAtFormat?: ArcTimeGranularity | ((date: Date) => string);
113
+ /** Recovery action for the error state; renders a retry button when set. */
114
+ onRetry?: () => void;
115
+ /** Recovery action for the no-match state; renders a clear-filters button when set. */
116
+ onClearFilters?: () => void;
117
+ /** Density: `sm` for dense grids, `md` (default), `lg` for a hero report. Scales type, padding, the row height (24 / 28 / 32px) and the bar thickness. */
118
+ size?: ReportCardSize;
119
+ /** Heading level of the label for the document outline. Default 3 — panels usually sit under a page's h2. */
120
+ titleLevel?: 2 | 3 | 4 | 5 | 6;
121
+ /** BCP 47 locale for every number and date. Defaults to the runtime's. Thai products on the Gregorian calendar pass `th-TH-u-ca-gregory`. */
122
+ locale?: string;
123
+ /** IANA time zone for the as-of date. Defaults to the runtime's — pass it for deterministic output. */
124
+ timeZone?: string;
125
+ /** Overrides for every rendered or announced string. */
126
+ labels?: Partial<ReportCardLabels>;
127
+ /** Replaces the generated accessible description of the whole card (the figure's `aria-describedby` text). */
128
+ description?: string;
129
+ /** Trailing header slot — a ghost `Button` or `Menu` for drill-through, export, or settings. */
130
+ action?: ReactNode;
131
+ /** Open the data popover on first render, anchored to the card. */
132
+ defaultTableOpen?: boolean;
133
+ /** Hide the header info button for the data popover. Only when another surface exposes the same values to keyboard and screen-reader users. */
134
+ hideTableToggle?: boolean;
135
+ /** Called with vega-embed's result once the bullet rows mount — for `view` access in advanced compositions. */
136
+ onEmbed?: (result: Result) => void;
137
+ /** Escape hatch: transform the plot's spec before it renders. Voids the token and accessibility guarantees for whatever it changes. */
138
+ patchSpec?: (spec: TopLevelSpec) => TopLevelSpec;
139
+ }
140
+ /**
141
+ * A scorecard panel — the roll-up subtype of the KPI card family: several
142
+ * criteria in their own units, each normalised to a score on one declared
143
+ * scale and graded against a ladder of bands, drawn as Few-style bullet rows
144
+ * over quiet qualitative ranges with a comparative tick, rolled up into one
145
+ * overall grade in the headline, with every name, score and grade as text
146
+ * beside the plot, a detail line for the selected criterion, and every
147
+ * loading, empty, insufficient, error and stale state — layout-stable inside
148
+ * one `Box` frame, with a generated text equivalent and a data table in an
149
+ * info popover.
150
+ */
151
+ declare const ReportCard: import("react").ForwardRefExoticComponent<ReportCardProps & import("react").RefAttributes<HTMLElement>>;
152
+ //#endregion
153
+ export { ReportCard, ReportCardProps };