@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,373 @@
1
+ import { AXIS_LABEL_LIMIT_EXPR } from "../../lib/vega/axisTicks.js";
2
+ import { arcVegaConfig } from "../../lib/vega/config.js";
3
+ //#region src/components/ProgressCard/ProgressCard.chart.ts
4
+ /** The completion series: `{ t, y }` per reading, `y` null for a missed one. */
5
+ const PROGRESS_COMPLETED_DATASET = "table";
6
+ /** The scope at each reading: `{ t, y }`, drawn `step-after` — scope moves at moments, not gradually. */
7
+ const PROGRESS_SCOPE_DATASET = "scope";
8
+ /** The remaining band: `{ t, y, y2 }` per reading — completion up to the scope above it. */
9
+ const PROGRESS_GAP_DATASET = "gap";
10
+ /** The required pace: two rows `{ t, y }` from the run's start to the deadline. */
11
+ const PROGRESS_IDEAL_DATASET = "ideal";
12
+ /** The projection: two rows `{ t, y, tone }` from the last reading to where the rate crosses the scope. */
13
+ const PROGRESS_PROJECTION_DATASET = "projection";
14
+ /** Zero or one row `{ t }` — the deadline's vertical rule. */
15
+ const PROGRESS_DUE_DATASET = "due";
16
+ /** One row `{ t, y }` — the last reading, dotted. */
17
+ const PROGRESS_LATEST_DATASET = "latest";
18
+ /** Zero or one row `{ t, y, tone }` — where the projection meets the scope. */
19
+ const PROGRESS_FINISH_DATASET = "finish";
20
+ /** Responsive x tick values, recomputed by Vega when the domain or width changes. */
21
+ const PROGRESS_X_TICKS_PARAM = "progress_x_ticks";
22
+ /** The nearest-reading hover selection. */
23
+ const PROGRESS_HOVER_PARAM = "hover";
24
+ const POINT_SIZE = 64;
25
+ const AREA_OPACITY = .16;
26
+ const GAP_OPACITY = .05;
27
+ const IDEAL_DASH = [4, 3];
28
+ const PROJECTION_DASH = [3, 3];
29
+ const PLOT_PADDING = 6;
30
+ const DUE_LABEL_ROW_PX = 13;
31
+ const Y_AXIS_TICKS = 3;
32
+ /**
33
+ * A stroke or fill that follows the projection's standing through the row's
34
+ * `tone`: the positive hue when the rate lands on or before the deadline, the
35
+ * negative hue when it lands after — two token values in the spec, so the
36
+ * spec stays structural while the data decides.
37
+ */
38
+ function toneColor(tokens) {
39
+ return {
40
+ condition: [{
41
+ test: "datum.tone === 'positive'",
42
+ value: tokens.divergingPositive
43
+ }],
44
+ value: tokens.divergingNegative
45
+ };
46
+ }
47
+ /**
48
+ * Builds the burn-up: the work remaining as a quiet band between completion
49
+ * and scope, the scope as a stepped context line, the required pace as a
50
+ * dashed reference from the run's start to the deadline, cumulative completion
51
+ * as an area and a 2px line from zero (a count, so zero is meaningful and the
52
+ * ink stays proportional), the deadline as a vertical rule, the projection as
53
+ * a dashed continuation in its own polarity hue ending in a hollow dot at the
54
+ * crossing, and a nearest-reading hover carrying the tooltip. Gaps stay gaps:
55
+ * Vega-Lite's default `invalid` handling breaks the path at a null reading.
56
+ */
57
+ function buildProgressBurnUpSpec(options, tokens) {
58
+ const { height, axes, ideal, projection, due, dueLabel, gap, tooltip, dateTitle, completedTitle, scopeTitle, valueFormat, timeFormat, axisTimeFormat, locale } = options;
59
+ const xScale = { nice: false };
60
+ const axisArgs = `domain('x'), width, false, ${JSON.stringify(axisTimeFormat)}, "time"`;
61
+ const xAxis = axes ? {
62
+ title: null,
63
+ orient: "bottom",
64
+ domain: true,
65
+ ticks: false,
66
+ grid: false,
67
+ values: { expr: PROGRESS_X_TICKS_PARAM },
68
+ labelAngle: 0,
69
+ labelAlign: { expr: `arcAxisLabelAlign(datum.value, ${axisArgs})` },
70
+ labelFlush: false,
71
+ labelOverlap: false,
72
+ labelLimit: { expr: AXIS_LABEL_LIMIT_EXPR },
73
+ labelPadding: 4,
74
+ format: axisTimeFormat,
75
+ formatType: "arcTime"
76
+ } : null;
77
+ const yAxis = axes ? {
78
+ title: null,
79
+ orient: "left",
80
+ domain: false,
81
+ ticks: false,
82
+ grid: true,
83
+ tickCount: Y_AXIS_TICKS,
84
+ labelOverlap: true,
85
+ labelPadding: 6,
86
+ format: valueFormat,
87
+ formatType: "arcNumber"
88
+ } : null;
89
+ const xField = {
90
+ field: "t",
91
+ type: "temporal",
92
+ axis: xAxis,
93
+ scale: xScale
94
+ };
95
+ const yField = {
96
+ field: "y",
97
+ type: "quantitative",
98
+ axis: yAxis,
99
+ scale: {
100
+ zero: true,
101
+ nice: axes
102
+ }
103
+ };
104
+ const tooltipChannel = [
105
+ {
106
+ field: "t",
107
+ type: "temporal",
108
+ title: dateTitle,
109
+ format: timeFormat,
110
+ formatType: "arcTime"
111
+ },
112
+ {
113
+ field: "y",
114
+ type: "quantitative",
115
+ title: completedTitle,
116
+ format: valueFormat,
117
+ formatType: "arcNumber"
118
+ },
119
+ {
120
+ field: "total",
121
+ type: "quantitative",
122
+ title: scopeTitle,
123
+ format: valueFormat,
124
+ formatType: "arcNumber"
125
+ }
126
+ ];
127
+ const layers = [];
128
+ if (gap) layers.push({
129
+ data: { name: "gap" },
130
+ mark: {
131
+ type: "area",
132
+ fill: tokens.context,
133
+ fillOpacity: GAP_OPACITY,
134
+ line: false,
135
+ interpolate: "step-after",
136
+ aria: false
137
+ },
138
+ encoding: {
139
+ x: xField,
140
+ y: yField,
141
+ y2: { field: "y2" }
142
+ }
143
+ });
144
+ layers.push({
145
+ data: { name: PROGRESS_SCOPE_DATASET },
146
+ mark: {
147
+ type: "line",
148
+ stroke: tokens.context,
149
+ strokeWidth: 1.5,
150
+ interpolate: "step-after",
151
+ ariaRoleDescription: "scope"
152
+ },
153
+ encoding: {
154
+ x: xField,
155
+ y: yField,
156
+ description: {
157
+ field: "aria",
158
+ type: "nominal"
159
+ }
160
+ }
161
+ });
162
+ if (ideal) layers.push({
163
+ data: { name: PROGRESS_IDEAL_DATASET },
164
+ mark: {
165
+ type: "line",
166
+ stroke: tokens.reference,
167
+ strokeWidth: 1.5,
168
+ strokeDash: IDEAL_DASH,
169
+ ariaRoleDescription: "required pace"
170
+ },
171
+ encoding: {
172
+ x: xField,
173
+ y: yField
174
+ }
175
+ });
176
+ layers.push({
177
+ data: { name: PROGRESS_COMPLETED_DATASET },
178
+ mark: {
179
+ type: "area",
180
+ fill: tokens.emphasis,
181
+ fillOpacity: AREA_OPACITY,
182
+ line: false,
183
+ aria: false
184
+ },
185
+ encoding: {
186
+ x: xField,
187
+ y: yField
188
+ }
189
+ });
190
+ layers.push({
191
+ data: { name: PROGRESS_COMPLETED_DATASET },
192
+ mark: {
193
+ type: "line",
194
+ stroke: tokens.emphasis,
195
+ strokeWidth: 2,
196
+ strokeCap: "round",
197
+ strokeJoin: "round",
198
+ ariaRoleDescription: "completed"
199
+ },
200
+ encoding: {
201
+ x: xField,
202
+ y: yField,
203
+ description: {
204
+ field: "aria",
205
+ type: "nominal"
206
+ }
207
+ }
208
+ });
209
+ if (projection) layers.push({
210
+ data: { name: PROGRESS_PROJECTION_DATASET },
211
+ mark: {
212
+ type: "line",
213
+ strokeWidth: 2,
214
+ strokeDash: PROJECTION_DASH,
215
+ strokeCap: "round",
216
+ ariaRoleDescription: "projection"
217
+ },
218
+ encoding: {
219
+ x: xField,
220
+ y: yField,
221
+ stroke: toneColor(tokens),
222
+ description: {
223
+ field: "aria",
224
+ type: "nominal"
225
+ }
226
+ }
227
+ });
228
+ if (due) {
229
+ layers.push({
230
+ data: { name: "due" },
231
+ mark: {
232
+ type: "rule",
233
+ stroke: tokens.foreground,
234
+ strokeWidth: 1,
235
+ strokeDash: IDEAL_DASH,
236
+ aria: false
237
+ },
238
+ encoding: { x: xField }
239
+ });
240
+ layers.push({
241
+ data: { name: "due" },
242
+ mark: {
243
+ type: "text",
244
+ text: dueLabel,
245
+ baseline: "bottom",
246
+ dy: -2,
247
+ align: { expr: "scale('x', datum.t) > width - 28 ? 'right' : 'left'" },
248
+ dx: { expr: "scale('x', datum.t) > width - 28 ? -4 : 4" },
249
+ fontSize: 10,
250
+ font: tokens.fontSans,
251
+ fill: tokens.axisLabel,
252
+ aria: false
253
+ },
254
+ encoding: {
255
+ x: xField,
256
+ y: { value: 0 }
257
+ }
258
+ });
259
+ }
260
+ layers.push({
261
+ data: { name: PROGRESS_LATEST_DATASET },
262
+ mark: {
263
+ type: "point",
264
+ filled: true,
265
+ size: POINT_SIZE,
266
+ fill: tokens.emphasis,
267
+ stroke: tokens.background,
268
+ strokeWidth: 2,
269
+ aria: false
270
+ },
271
+ encoding: {
272
+ x: xField,
273
+ y: yField
274
+ }
275
+ });
276
+ if (projection) layers.push({
277
+ data: { name: PROGRESS_FINISH_DATASET },
278
+ mark: {
279
+ type: "point",
280
+ filled: false,
281
+ size: POINT_SIZE,
282
+ strokeWidth: 2,
283
+ fill: tokens.background,
284
+ aria: false
285
+ },
286
+ encoding: {
287
+ x: xField,
288
+ y: yField,
289
+ stroke: toneColor(tokens)
290
+ }
291
+ });
292
+ if (tooltip) {
293
+ layers.push({
294
+ data: { name: PROGRESS_COMPLETED_DATASET },
295
+ params: [{
296
+ name: PROGRESS_HOVER_PARAM,
297
+ select: {
298
+ type: "point",
299
+ on: "pointerover",
300
+ clear: "pointerout",
301
+ nearest: true,
302
+ encodings: ["x"]
303
+ }
304
+ }],
305
+ mark: {
306
+ type: "rule",
307
+ strokeWidth: 12,
308
+ opacity: 0,
309
+ aria: false
310
+ },
311
+ encoding: {
312
+ x: xField,
313
+ tooltip: tooltipChannel
314
+ }
315
+ });
316
+ layers.push({
317
+ data: { name: PROGRESS_COMPLETED_DATASET },
318
+ mark: {
319
+ type: "point",
320
+ filled: true,
321
+ size: POINT_SIZE,
322
+ fill: tokens.emphasis,
323
+ stroke: tokens.background,
324
+ strokeWidth: 2,
325
+ aria: false
326
+ },
327
+ encoding: {
328
+ x: xField,
329
+ y: yField,
330
+ opacity: {
331
+ condition: {
332
+ param: PROGRESS_HOVER_PARAM,
333
+ empty: false,
334
+ value: 1
335
+ },
336
+ value: 0
337
+ }
338
+ }
339
+ });
340
+ }
341
+ const params = [];
342
+ if (axes) params.push({
343
+ name: PROGRESS_X_TICKS_PARAM,
344
+ expr: `arcAxisTicks(${axisArgs})`
345
+ });
346
+ return {
347
+ $schema: "https://vega.github.io/schema/vega-lite/v6.json",
348
+ width: 240,
349
+ height,
350
+ autosize: {
351
+ type: "fit",
352
+ contains: "padding"
353
+ },
354
+ padding: axes ? {
355
+ left: 0,
356
+ right: PLOT_PADDING,
357
+ top: due ? DUE_LABEL_ROW_PX : PLOT_PADDING,
358
+ bottom: 0
359
+ } : {
360
+ left: PLOT_PADDING,
361
+ right: PLOT_PADDING,
362
+ top: due ? DUE_LABEL_ROW_PX : PLOT_PADDING,
363
+ bottom: PLOT_PADDING
364
+ },
365
+ background: "transparent",
366
+ data: { name: PROGRESS_COMPLETED_DATASET },
367
+ params,
368
+ layer: layers,
369
+ config: arcVegaConfig(tokens, { locale })
370
+ };
371
+ }
372
+ //#endregion
373
+ export { PROGRESS_COMPLETED_DATASET, PROGRESS_DUE_DATASET, PROGRESS_FINISH_DATASET, PROGRESS_GAP_DATASET, PROGRESS_HOVER_PARAM, PROGRESS_IDEAL_DATASET, PROGRESS_LATEST_DATASET, PROGRESS_PROJECTION_DATASET, PROGRESS_SCOPE_DATASET, PROGRESS_X_TICKS_PARAM, buildProgressBurnUpSpec };
@@ -0,0 +1,137 @@
1
+ import { ArcTimeGranularity } from "../../lib/vega/formatters.js";
2
+ import { ProgressCardLabels, ProgressCardSize, ProgressCardStatus, ProgressHeadline, ProgressSnapshot, ProgressStageInput } from "./ProgressCard.model.js";
3
+ import { ReactNode } from "react";
4
+ import { BoxProps } from "@arcfusionz/arc-primitive-ui";
5
+ import { TopLevelSpec } from "vega-lite";
6
+ import { Result } from "vega-embed";
7
+ //#region src/components/ProgressCard/ProgressCard.d.ts
8
+ interface ProgressCardProps extends Omit<BoxProps, "children" | "padding" | "title"> {
9
+ /** What is being finished — the tile's heading. Pass `name` too when this is not plain text. */
10
+ label: ReactNode;
11
+ /** Plain-text name used in the generated descriptions and control labels. Defaults to `label` when it is a string. */
12
+ name?: string;
13
+ /** Definition of the work, shown in a tooltip behind an info control beside the label and exposed to assistive technology as the control's description. */
14
+ hint?: string;
15
+ /**
16
+ * The run's readings, as `{ date, completed, total? }` records — the
17
+ * **cumulative** count finished by each date, not the per-period delta. Any
18
+ * order: they are sorted. `completed: null` is a reading the transport
19
+ * missed, and the line breaks at it rather than drawing through it. Give a
20
+ * reading its own `total` whenever the scope moved, which is what makes the
21
+ * change visible instead of hidden. Two readings are the minimum for a
22
+ * trajectory; one renders the `insufficient` state. Pass `[]` while loading.
23
+ */
24
+ snapshots: readonly ProgressSnapshot[];
25
+ /** The whole, for readings that do not carry their own. A reading past it raises it, so the run never draws through its own ceiling. */
26
+ total?: number | null;
27
+ /**
28
+ * The deadline. It draws the required-pace line and the vertical rule, and
29
+ * it is what the projection is judged against — without it the card still
30
+ * projects a finish date but reaches no verdict, because there is nothing to
31
+ * be late against.
32
+ */
33
+ due?: Date | string | number | null;
34
+ /** The product's own forecast finish, replacing the one derived from the observed rate. */
35
+ projected?: Date | string | number | null;
36
+ /**
37
+ * Days of recent history the rate is measured over. Omit to use the whole
38
+ * run (`completed / elapsed`), which is steadier; pass a window when a
39
+ * recent change of pace is the point. A stall is always read from the most
40
+ * recent interval, whatever this says.
41
+ */
42
+ rateWindow?: number;
43
+ /** Days past the deadline that still count as `at-risk` rather than `late`. Default 2. */
44
+ tolerance?: number;
45
+ /**
46
+ * An optional breakdown of where the work sits right now, drawn as a
47
+ * composed `Progress` bar above the plot — `{ key?, label, value, tone? }`
48
+ * in the order the work moves through the stages. `tone` (`complete`,
49
+ * `active`, `blocked`, `remaining`) is the only colour decision it takes.
50
+ * Six or fewer.
51
+ */
52
+ stages?: readonly ProgressStageInput[];
53
+ /**
54
+ * Number format for every count — the headline, the axis, the legend, the
55
+ * table and the tooltip — as one grammar so nothing rounds two ways:
56
+ * `number[:digits]`, `integer` (default), `compact[:digits]`,
57
+ * `percent[:digits]`, `currency:CODE[:digits|compact]`.
58
+ */
59
+ format?: string;
60
+ /** Custom formatter for counts. Takes precedence over `format` everywhere a count is rendered. */
61
+ formatValue?: (value: number) => string;
62
+ /** Fraction digits for every share the card shows. Default 0. */
63
+ percentDigits?: number;
64
+ /** Unit shown after a `remaining` headline in the muted role (`tables`, `tickets`); it follows the counts line under a `percent` headline. */
65
+ unit?: ReactNode;
66
+ /**
67
+ * What the big number is: `percent` (default) — the finished share, counts
68
+ * beneath; `date` — the projected finish, the share beneath, for a delivery
69
+ * dashboard whose question is when; `remaining` — how much is left, for a
70
+ * burn-down framing. Stamped as `data-headline`.
71
+ */
72
+ headline?: ProgressHeadline;
73
+ /**
74
+ * How dates are written — a time-grammar granularity (`day` by default,
75
+ * `month`, `year`, `datetime`, `time`) or a formatter. Applies to the
76
+ * projection, the deadline, the as-of line, the table and the description
77
+ * alike, in the card's `locale` and `timeZone`.
78
+ */
79
+ dateFormat?: ArcTimeGranularity | ((date: Date) => string);
80
+ /** Draw the plot's x and y axes. Default `true`; `false` shrinks it toward a sparkline — the table still carries the figures. */
81
+ axes?: boolean;
82
+ /** Draw the required-pace line from the run's start to the deadline. Default `true`. */
83
+ showIdeal?: boolean;
84
+ /** Draw the dashed projection to where the rate crosses the scope. Default `true`. */
85
+ showProjection?: boolean;
86
+ /** Shade the gap between completion and scope as the work remaining. Default `true`. */
87
+ showGap?: boolean;
88
+ /** The plot's legend of mark keys. Default `true`; `false` for a dense grid — the tooltip, table and description still name every series. */
89
+ legend?: boolean;
90
+ /** Plot height in pixels, overriding the one `size` implies. */
91
+ plotHeight?: number;
92
+ /** The takeaway in a sentence, rendered beside the AI mark under the plot. Wrap values in `<strong>` to set them in bold. */
93
+ insight?: ReactNode;
94
+ /** The transport's status. `loading` with readings already present is a refresh: the previous render stays under the veil. Default `ready`. */
95
+ status?: ProgressCardStatus;
96
+ /** The consumer's filter is active — no readings then reads as no-match rather than empty, with a clear-filters action when `onClearFilters` is set. */
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
+ /** Recovery action for the error state; renders a retry button when set. */
101
+ onRetry?: () => void;
102
+ /** Recovery action for the no-match state; renders a clear-filters button when set. */
103
+ onClearFilters?: () => void;
104
+ /** Density: `sm` for dense grids, `md` (default), `lg` for a hero. Scales type, padding and the plot's height (88 / 116 / 148px). */
105
+ size?: ProgressCardSize;
106
+ /** Heading level of the label for the document outline. Default 3. */
107
+ titleLevel?: 2 | 3 | 4 | 5 | 6;
108
+ /** BCP 47 locale for every number and date. Thai products on the Gregorian calendar pass `th-TH-u-ca-gregory`. */
109
+ locale?: string;
110
+ /** IANA time zone. Date-only reading and deadline strings are midnight in it, and whole days are counted between calendar dates in it — so a daylight-saving change never shifts "2 days late". */
111
+ timeZone?: string;
112
+ /** Overrides for every rendered or announced string. */
113
+ labels?: Partial<ProgressCardLabels>;
114
+ /** Replaces the generated accessible description of the whole card (the figure's `aria-describedby` text). */
115
+ description?: string;
116
+ /** Trailing header slot — a ghost `Button` or `Menu` for drill-through, export, or settings. */
117
+ action?: ReactNode;
118
+ /** Open the details popover on first render, anchored to the card. */
119
+ defaultTableOpen?: boolean;
120
+ /** Hide the header info button for the details popover. Only when another surface exposes the same figures to keyboard and screen-reader users. */
121
+ hideTableToggle?: boolean;
122
+ /** Called with vega-embed's result once the burn-up mounts — for `view` access in advanced compositions. */
123
+ onEmbed?: (result: Result) => void;
124
+ /** Escape hatch: transform the burn-up's spec before it renders. Voids the token and accessibility guarantees for whatever it changes. */
125
+ patchSpec?: (spec: TopLevelSpec) => TopLevelSpec;
126
+ }
127
+ /**
128
+ * A delivery tile for dashboard grids: how much of a finite body of work is
129
+ * finished, the rate it is being finished at, when that rate lands it, and
130
+ * whether that is before the deadline — on a burn-up chart (completion rising
131
+ * from zero, the scope it is chasing, the pace the deadline requires, and a
132
+ * dashed projection to the crossing) with every loading, empty, error and
133
+ * stale state, a generated text equivalent and a reading-by-reading table.
134
+ */
135
+ declare const ProgressCard: import("react").ForwardRefExoticComponent<ProgressCardProps & import("react").RefAttributes<HTMLElement>>;
136
+ //#endregion
137
+ export { ProgressCard, ProgressCardProps };