@krizaka/charts 0.4.0 → 0.6.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 (75) hide show
  1. package/dist/bar.d.ts +4 -3
  2. package/dist/candlestick.d.ts +3 -2
  3. package/dist/card.d.ts +2 -1
  4. package/dist/card.js +2 -1
  5. package/dist/{cartesian-CEY_wwe_.d.ts → cartesian-XyEi00ub.d.ts} +2 -2
  6. package/dist/chart.d.ts +3 -2
  7. package/dist/chunk-3VCCSEVF.js +2 -0
  8. package/dist/chunk-3VCCSEVF.js.map +1 -0
  9. package/dist/chunk-6NYD3ROH.js +2 -0
  10. package/dist/chunk-6NYD3ROH.js.map +1 -0
  11. package/dist/{chunk-YHQFW2PR.js → chunk-AX3QU25V.js} +1 -1
  12. package/dist/{chunk-MK2ZFUWM.js → chunk-BHMUX6F5.js} +1 -1
  13. package/dist/context-CSEXYepn.d.ts +100 -0
  14. package/dist/credits.d.ts +2 -1
  15. package/dist/earnings.d.ts +4 -3
  16. package/dist/{frame-B1HDNm7c.d.ts → frame-7tt0uRS5.d.ts} +1 -1
  17. package/dist/funnel.d.ts +3 -2
  18. package/dist/gauge.d.ts +3 -2
  19. package/dist/genui.d.ts +11 -0
  20. package/dist/genui.js +122 -0
  21. package/dist/genui.js.map +1 -0
  22. package/dist/geo.d.ts +3 -2
  23. package/dist/globe.d.ts +3 -2
  24. package/dist/goal.d.ts +3 -2
  25. package/dist/heatmap.d.ts +3 -2
  26. package/dist/index.d.ts +4 -3
  27. package/dist/index.js +4 -2
  28. package/dist/latency.d.ts +4 -3
  29. package/dist/line.d.ts +4 -3
  30. package/dist/pie.d.ts +3 -2
  31. package/dist/pie.js +2 -1
  32. package/dist/provider.d.ts +3 -2
  33. package/dist/radar.d.ts +3 -2
  34. package/dist/sankey.d.ts +3 -2
  35. package/dist/scatter.d.ts +3 -2
  36. package/dist/sparkline.d.ts +3 -2
  37. package/dist/throughput.d.ts +4 -3
  38. package/dist/ticker.d.ts +4 -3
  39. package/dist/treemap.d.ts +3 -2
  40. package/dist/types-BL149CsX.d.ts +84 -0
  41. package/package.json +8 -4
  42. package/registry/area-chart.json +11 -0
  43. package/registry/bar-chart.json +11 -0
  44. package/registry/calendar-heatmap.json +13 -0
  45. package/registry/candlestick.json +13 -0
  46. package/registry/chart-card.json +13 -0
  47. package/registry/chart.json +13 -0
  48. package/registry/charts-provider.json +11 -0
  49. package/registry/credit-usage.json +11 -0
  50. package/registry/earnings-chart.json +11 -0
  51. package/registry/examples/genui-catalog/dashboard.d.ts +4 -0
  52. package/registry/examples/genui-catalog/dashboard.js +22 -0
  53. package/registry/examples/genui-catalog/dashboard.tsx +18 -0
  54. package/registry/funnel.json +13 -0
  55. package/registry/gauge.json +11 -0
  56. package/registry/genui-catalog.json +91 -0
  57. package/registry/geo-map.json +13 -0
  58. package/registry/globe.json +14 -0
  59. package/registry/goal-progress.json +11 -0
  60. package/registry/heatmap.json +13 -0
  61. package/registry/index.json +351 -1
  62. package/registry/job-throughput.json +11 -0
  63. package/registry/kpi-stat.json +13 -0
  64. package/registry/latency-chart.json +11 -0
  65. package/registry/line-chart.json +11 -0
  66. package/registry/pie-chart.json +11 -0
  67. package/registry/price-ticker.json +11 -0
  68. package/registry/radar-chart.json +13 -0
  69. package/registry/sankey.json +13 -0
  70. package/registry/scatter-chart.json +13 -0
  71. package/registry/sparkline.json +11 -0
  72. package/registry/treemap.json +13 -0
  73. package/dist/context-DNW7bJYw.d.ts +0 -182
  74. /package/dist/{chunk-YHQFW2PR.js.map → chunk-AX3QU25V.js.map} +0 -0
  75. /package/dist/{chunk-MK2ZFUWM.js.map → chunk-BHMUX6F5.js.map} +0 -0
@@ -8,6 +8,19 @@
8
8
  "status": "beta",
9
9
  "category": "charts",
10
10
  "platforms": "web",
11
+ "parity": {
12
+ "web": {
13
+ "state": "yes"
14
+ },
15
+ "native": {
16
+ "state": "gap",
17
+ "reason": "Advanced tier: no phone screen needs it yet.",
18
+ "issue": "krizaka/krizaka-ui#280"
19
+ },
20
+ "desktop": {
21
+ "state": "yes"
22
+ }
23
+ },
11
24
  "engine": "echarts",
12
25
  "tier": "advanced",
13
26
  "whenToUse": [
@@ -8,6 +8,17 @@
8
8
  "status": "beta",
9
9
  "category": "charts",
10
10
  "platforms": "both",
11
+ "parity": {
12
+ "web": {
13
+ "state": "yes"
14
+ },
15
+ "native": {
16
+ "state": "yes"
17
+ },
18
+ "desktop": {
19
+ "state": "yes"
20
+ }
21
+ },
11
22
  "engine": "svg",
12
23
  "tier": "core",
13
24
  "whenToUse": [
@@ -8,6 +8,19 @@
8
8
  "status": "beta",
9
9
  "category": "charts",
10
10
  "platforms": "web",
11
+ "parity": {
12
+ "web": {
13
+ "state": "yes"
14
+ },
15
+ "native": {
16
+ "state": "gap",
17
+ "reason": "Advanced tier: no phone screen needs it yet.",
18
+ "issue": "krizaka/krizaka-ui#280"
19
+ },
20
+ "desktop": {
21
+ "state": "yes"
22
+ }
23
+ },
11
24
  "engine": "echarts",
12
25
  "tier": "advanced",
13
26
  "whenToUse": [
@@ -1,182 +0,0 @@
1
- import * as react from 'react';
2
- import { ReactNode } from 'react';
3
-
4
- interface ChartLabels {
5
- /** The button that shows the data table. */
6
- showData: string;
7
- /** The button that hides it. */
8
- hideData: string;
9
- /** The caption of the data table: `{title}`. */
10
- tableCaption: string;
11
- /** The export buttons. */
12
- exportPng: string;
13
- exportSvg: string;
14
- exportCsv: string;
15
- /** The actions menu (⋯) of a chart: its accessible name, and its entries. */
16
- actions: string;
17
- viewTable: string;
18
- downloadCsv: string;
19
- downloadPng: string;
20
- downloadSvg: string;
21
- copyData: string;
22
- /** Announced once the data is on the clipboard. */
23
- copied: string;
24
- /** The close button of the table sheet. */
25
- close: string;
26
- /** The sheet's description: `{count}` rows. */
27
- tableRows: string;
28
- /** Legend chips filter: the chip's accessible name, `{label}`. */
29
- toggleSeries: string;
30
- /** Sparse data: under the chart, `{count}` periods with data out of `{total}`. */
31
- sparse: string;
32
- /** A KPI's change: `{change}` (`+12 %`) against the previous period. */
33
- trendVsPrevious: string;
34
- /** Announced while the data loads. */
35
- loading: string;
36
- /** Shown when there is nothing to draw. */
37
- empty: string;
38
- /** Shown when the data could not be loaded. */
39
- error: string;
40
- /** The keyboard hint, read once when the plot takes the focus. */
41
- keyboardHint: string;
42
- /** The role description of the plot (`chart`). */
43
- roleDescription: string;
44
- /** Summary pieces. `{kind}` is the chart's name (`Line chart`), `{count}` a number of points or series. */
45
- summaryIntro: string;
46
- summarySeries: string;
47
- summaryRange: string;
48
- summaryTrendUp: string;
49
- summaryTrendDown: string;
50
- summaryTrendFlat: string;
51
- summaryTotal: string;
52
- summaryThreshold: string;
53
- summaryShare: string;
54
- /** Scatter: the correlation of x and y (Pearson's r). */
55
- summaryCorrelation: string;
56
- /** Funnel: from one stage to the next, and from the first to the last. */
57
- summaryConversion: string;
58
- summaryOverall: string;
59
- /** Heatmap, calendar: the largest cell and the number of cells with a value. */
60
- summaryPeak: string;
61
- summaryActive: string;
62
- /** Candlestick: the period's range. */
63
- summaryOhlc: string;
64
- /** The names of the charts, read first in the summary. */
65
- kinds: Record<ChartKind, string>;
66
- /** The column of the values, when the chart has no value label. */
67
- value: string;
68
- /** The column of the categories in the data table, when the chart has no x label. */
69
- category: string;
70
- /** The total row of a stacked chart, a pie, a funnel. */
71
- total: string;
72
- /** What a missing value reads as. */
73
- noValue: string;
74
- }
75
- type ChartKind = "line" | "area" | "bar" | "pie" | "donut" | "gauge" | "sparkline" | "radar" | "heatmap" | "calendar" | "sankey" | "funnel" | "candlestick" | "treemap" | "scatter" | "map" | "globe" | "chart";
76
- declare const DEFAULT_LABELS: ChartLabels;
77
- /** The words an app or a chart passes: any of them, and any of the chart names. */
78
- type ChartLabelsInput = Partial<Omit<ChartLabels, "kinds">> & {
79
- kinds?: Partial<Record<ChartKind, string>>;
80
- };
81
-
82
- /** A row of data: any object; the chart reads the fields its `x`, `y` and `series` name. */
83
- type Datum = object;
84
- /** A field of a row (`"month"`) or a function that reads it. */
85
- type Accessor<T, V> = (keyof T & string) | ((datum: T, index: number) => V);
86
- /** A Krizaka brand: its palette leads with the brand's own hue (Krizaka blue, Orazaka orange, Orochia violet). */
87
- type BrandId = "krizaka" | "orazaka" | "orochia";
88
- /** A BCP 47 locale (`"en-US"`, `"fr-FR"`), always explicit: server and client write the same figures. */
89
- type Locale = string | readonly string[];
90
- /**
91
- * How a value is written, through `@krizaka/intl`:
92
- * - `"number"` (default) `12,345.6`, `"integer"` `12,346`, `"compact"` `12.3K`, `"percent"` (a ratio: `0.42` → `42%`);
93
- * - `{ style: "money", currency }`: the values are **integer minor units** (cents), as the ledger stores them;
94
- * - `{ style: "unit", unit }`: an `Intl` unit (`"second"`, `"megabyte"`);
95
- * - a function, for anything else.
96
- */
97
- type ValueFormat = "number" | "integer" | "compact" | "percent" | {
98
- readonly style: "money";
99
- readonly currency: string;
100
- readonly compact?: boolean;
101
- } | {
102
- readonly style: "unit";
103
- readonly unit: string;
104
- readonly compact?: boolean;
105
- } | {
106
- readonly style: "number";
107
- readonly options: Intl.NumberFormatOptions;
108
- } | ((value: number, locale: Locale) => string);
109
- /**
110
- * How a category of the x axis is written. A category that is a `Date`, an epoch or an ISO date (`"2026-04"`,
111
- * `"2026-04-12"`) is a date: `"month"` (`Apr 2026`), `"day"` (`Apr 12`), `"date"` (`Apr 12, 2026`), `"time"`
112
- * (`14:30`), `"datetime"`, `"year"`. `"text"` writes it as is (the default for anything that is not a date).
113
- */
114
- type CategoryFormat = "text" | "year" | "month" | "day" | "date" | "time" | "datetime" | ((category: unknown, locale: Locale) => string);
115
- /** A series to draw: the field holding its values and the words that name it. */
116
- interface SeriesSpec<T extends Datum = Datum> {
117
- /** The field (or a function) holding the series' value in each row. */
118
- readonly key: Accessor<T, number | null | undefined>;
119
- /** Its name: in the legend, the tooltip, the data table and the summary. */
120
- readonly label: string;
121
- /** A colour role instead of the next palette slot: `"accent"`, a status (`"success"`…) or a `var(--…)`. */
122
- readonly color?: SeriesColor;
123
- /** Draw it dashed (a forecast, a previous period). Lines and areas only. */
124
- readonly dashed?: boolean;
125
- }
126
- /** A status or brand role a series, a threshold or a marker may wear instead of a palette slot. */
127
- type Tone = "neutral" | "accent" | "success" | "warning" | "danger" | "info";
128
- /** A palette slot (1–8), a tone, or any CSS colour (`var(--kz-…)` preferred). */
129
- type SeriesColor = Tone | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | (string & {});
130
- /** A horizontal line at a value: a goal, a payout threshold, a quota. */
131
- interface Threshold {
132
- readonly value: number;
133
- /** What it means, written beside the line and in the summary: “Payout threshold”. */
134
- readonly label: string;
135
- /** Default `"neutral"`; a goal reads well in `"success"`, a limit in `"danger"`. */
136
- readonly tone?: Tone;
137
- }
138
- /** A vertical marker at a category: an event worth pointing at (“Campaign launch”). */
139
- interface Marker {
140
- /** The category it marks, as in the data (`"2026-04"`). */
141
- readonly x: unknown;
142
- readonly label: string;
143
- readonly tone?: Tone;
144
- }
145
- /** What a series says about itself, for the written summary. */
146
- interface SeriesSummary {
147
- readonly label: string;
148
- readonly count: number;
149
- readonly min: {
150
- readonly value: number;
151
- readonly category: string;
152
- } | null;
153
- readonly max: {
154
- readonly value: number;
155
- readonly category: string;
156
- } | null;
157
- readonly first: number | null;
158
- readonly last: number | null;
159
- readonly total: number;
160
- /** `last / first − 1`, or null when it cannot be said (no first value, a first value of 0). */
161
- readonly change: number | null;
162
- readonly trend: "up" | "down" | "flat" | "none";
163
- }
164
-
165
- interface ChartsSettings {
166
- /** The locale of every figure and date (`"fr-FR"`). Default `"en-US"`. */
167
- locale?: Locale;
168
- /**
169
- * The brand whose palette the charts use. Without it, a chart follows a `.brand-<id>` ancestor, else Krizaka. Set it
170
- * when the app loads a brand stylesheet on `:root` (`@krizaka/tokens/brands/orazaka.css`).
171
- */
172
- brand?: BrandId;
173
- /** The words, translated: the buttons, the states, the written summary. */
174
- labels?: ChartLabelsInput;
175
- }
176
- interface ChartsProviderProps extends ChartsSettings {
177
- children: ReactNode;
178
- }
179
- /** Sets the locale, the brand and the words of every chart below it. */
180
- declare function ChartsProvider({ locale, brand, labels, children }: ChartsProviderProps): react.JSX.Element;
181
-
182
- export { type Accessor as A, type BrandId as B, type CategoryFormat as C, DEFAULT_LABELS as D, type Locale as L, type Marker as M, type SeriesColor as S, type Threshold as T, type ValueFormat as V, type ChartKind as a, type ChartLabels as b, type ChartLabelsInput as c, ChartsProvider as d, type ChartsProviderProps as e, type ChartsSettings as f, type Datum as g, type SeriesSpec as h, type SeriesSummary as i, type Tone as j };