@keboola/design 9.1.0 → 10.1.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/AGENTS.md +117 -40
- package/COMPONENT-API.md +31 -9
- package/README.md +3 -3
- package/dist/MermaidDiagram-EOKJHQQV.js +10 -0
- package/dist/MermaidDiagram-EOKJHQQV.js.map +1 -0
- package/dist/charts.d.ts +31 -2
- package/dist/charts.js +6 -9
- package/dist/charts.js.map +1 -1
- package/dist/chunk-63NSN2VL.js +274 -0
- package/dist/chunk-63NSN2VL.js.map +1 -0
- package/dist/{rjsf.cjs → chunk-6FPEI4EM.js} +1491 -5701
- package/dist/chunk-6FPEI4EM.js.map +1 -0
- package/dist/chunk-7PUUHEJQ.js +1313 -0
- package/dist/chunk-7PUUHEJQ.js.map +1 -0
- package/dist/chunk-BOHNXTMM.js +606 -0
- package/dist/chunk-BOHNXTMM.js.map +1 -0
- package/dist/{testing.cjs → chunk-C3L3TBBT.js} +33 -164
- package/dist/chunk-C3L3TBBT.js.map +1 -0
- package/dist/chunk-CTCFYWJC.js +407 -0
- package/dist/chunk-CTCFYWJC.js.map +1 -0
- package/dist/chunk-ESBL3IPF.js +23 -0
- package/dist/chunk-ESBL3IPF.js.map +1 -0
- package/dist/chunk-IJTHFNNJ.js +261 -0
- package/dist/chunk-IJTHFNNJ.js.map +1 -0
- package/dist/chunk-JP7PNHLH.js +40 -0
- package/dist/chunk-JP7PNHLH.js.map +1 -0
- package/dist/chunk-KPNAW5MU.js +229 -0
- package/dist/chunk-KPNAW5MU.js.map +1 -0
- package/dist/chunk-L37JJ6MR.js +152 -0
- package/dist/chunk-L37JJ6MR.js.map +1 -0
- package/dist/chunk-Q7NWXLCT.js +90 -0
- package/dist/chunk-Q7NWXLCT.js.map +1 -0
- package/dist/chunk-SYIEF644.js +1016 -0
- package/dist/chunk-SYIEF644.js.map +1 -0
- package/dist/chunk-VMFSRV5H.js +16 -0
- package/dist/chunk-VMFSRV5H.js.map +1 -0
- package/dist/chunk-VPPM7UUQ.js +47 -0
- package/dist/chunk-VPPM7UUQ.js.map +1 -0
- package/dist/chunk-XV3UUOYF.js +845 -0
- package/dist/chunk-XV3UUOYF.js.map +1 -0
- package/dist/editors.d.ts +27 -3
- package/dist/editors.js +85 -2081
- package/dist/editors.js.map +1 -1
- package/dist/icons.d.ts +29 -8
- package/dist/icons.js +2 -361
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +709 -425
- package/dist/index.js +5042 -13885
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.js +41 -3426
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.js +8 -1129
- package/dist/mermaid.js.map +1 -1
- package/dist/rjsf.js +180 -9381
- package/dist/rjsf.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/testing.js +5 -357
- package/dist/testing.js.map +1 -1
- package/package.json +28 -73
- package/src/styles.css +60 -3
- package/src/theme.css +1 -0
- package/dist/charts.cjs +0 -268
- package/dist/charts.cjs.map +0 -1
- package/dist/charts.d.cts +0 -181
- package/dist/constants-D3gaMY-W.d.cts +0 -39
- package/dist/editors.cjs +0 -2440
- package/dist/editors.cjs.map +0 -1
- package/dist/editors.d.cts +0 -165
- package/dist/icons.cjs +0 -23888
- package/dist/icons.cjs.map +0 -1
- package/dist/icons.d.cts +0 -20
- package/dist/index.cjs +0 -24894
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -10438
- package/dist/markdown-editor.cjs +0 -4636
- package/dist/markdown-editor.cjs.map +0 -1
- package/dist/markdown-editor.d.cts +0 -75
- package/dist/mermaid.cjs +0 -1138
- package/dist/mermaid.cjs.map +0 -1
- package/dist/mermaid.d.cts +0 -15
- package/dist/rjsf.cjs.map +0 -1
- package/dist/rjsf.d.cts +0 -55
- package/dist/testing.cjs.map +0 -1
- package/dist/testing.d.cts +0 -25
package/src/styles.css
CHANGED
|
@@ -60,7 +60,10 @@
|
|
|
60
60
|
|
|
61
61
|
/* Border / Input / Ring */
|
|
62
62
|
--border: 229 231 235; /* #e5e7eb */
|
|
63
|
-
--input: 203 213 225; /* #cbd5e1 */
|
|
63
|
+
--input: 203 213 225; /* #cbd5e1 — the control's border, not its fill */
|
|
64
|
+
/* The fill of a form control. Its own token rather than `card`: a field is not
|
|
65
|
+
a raised container, and a brand tints the two independently. */
|
|
66
|
+
--input-background: 255 255 255; /* #ffffff */
|
|
64
67
|
--ring: var(--primary); /* follows brand primary (default #2563eb) */
|
|
65
68
|
--ring-offset: 255 255 255; /* #ffffff — focus-ring offset gap */
|
|
66
69
|
|
|
@@ -200,7 +203,11 @@
|
|
|
200
203
|
|
|
201
204
|
/* Border / Input / Ring */
|
|
202
205
|
--border: 52 53 62; /* #34353e */
|
|
203
|
-
--input: 60 61 71; /* #3c3d47 */
|
|
206
|
+
--input: 60 61 71; /* #3c3d47 — the control's border, not its fill */
|
|
207
|
+
/* Lighter than `background` (#131317), `card` (#222228) and `popover` (#26262d)
|
|
208
|
+
so a field stays legible as its own surface on all three — a single opaque
|
|
209
|
+
fill has to clear the lightest container it can sit in. */
|
|
210
|
+
--input-background: 47 48 55; /* #2f3037 */
|
|
204
211
|
--ring: var(--primary); /* follows brand primary (default #1f8fff) */
|
|
205
212
|
--ring-offset: 19 19 23; /* #131317 — focus-ring offset gap (dark background) */
|
|
206
213
|
|
|
@@ -368,11 +375,40 @@
|
|
|
368
375
|
}
|
|
369
376
|
}
|
|
370
377
|
|
|
371
|
-
|
|
378
|
+
/* Legacy (dark) tooltip chrome — invert nested prose for contrast. Must live in
|
|
379
|
+
* `utilities`: `.tw\:prose` declares the same `--tw-prose-*` variables from that
|
|
380
|
+
* layer, and the layer order at the top of this file makes `utilities` win over
|
|
381
|
+
* `components` regardless of specificity. */
|
|
382
|
+
@layer utilities {
|
|
372
383
|
[data-tooltip-content='true'] .tw\:prose {
|
|
373
384
|
@apply tw:prose-invert;
|
|
385
|
+
|
|
386
|
+
/* Typography's own `a`/`code` rules are `:where()`-wrapped (specificity 0), so
|
|
387
|
+
* the inverted variables never reach a link rendered by design's `Link`
|
|
388
|
+
* (`tw:text-primary`) nor an inline-code background a host's global CSS paints. */
|
|
389
|
+
a {
|
|
390
|
+
@apply tw:text-blue-300 tw:hover:text-blue-200;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* Inline code only — scoped the way AIKit's markdown prose does it
|
|
394
|
+
* (`tw:[&_:not(pre)>code]:…` in `blocks/AIKit/Markdown.tsx`) so a fenced
|
|
395
|
+
* block's `pre > code` keeps `--tw-prose-invert-pre-bg`. */
|
|
396
|
+
:not(pre) > code {
|
|
397
|
+
@apply tw:bg-white/10 tw:text-neutral-100;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* `.tw\:prose blockquote` (components layer, below) fills with the light
|
|
401
|
+
* `--muted`; on the dark tooltip that would put the now-inverted light text
|
|
402
|
+
* on a light fill. Re-fill with the same `white/10` wash the inline-code
|
|
403
|
+
* chip uses — the file's one translucent-overlay idiom, and the only fill
|
|
404
|
+
* that works against a fixed `bg-neutral-800` without a second token. */
|
|
405
|
+
blockquote {
|
|
406
|
+
@apply tw:bg-white/10;
|
|
407
|
+
}
|
|
374
408
|
}
|
|
409
|
+
}
|
|
375
410
|
|
|
411
|
+
@layer components {
|
|
376
412
|
.tw\:prose blockquote {
|
|
377
413
|
border-left: 4px solid rgb(var(--border));
|
|
378
414
|
background-color: rgb(var(--muted));
|
|
@@ -392,3 +428,24 @@
|
|
|
392
428
|
pointer-events: auto !important;
|
|
393
429
|
}
|
|
394
430
|
}
|
|
431
|
+
|
|
432
|
+
@layer utilities {
|
|
433
|
+
/* Tailwind Typography pins its own palette (`--tw-prose-bold`, `--tw-prose-headings`,
|
|
434
|
+
…) to light-mode values, so those elements stay near-black when the semantic tokens
|
|
435
|
+
flip — bold text in a Markdown answer renders dark-on-dark. `prose` has no awareness
|
|
436
|
+
of `[data-theme]`, so invert it here.
|
|
437
|
+
|
|
438
|
+
In `utilities`, not `components`: `.tw:prose` is itself a utility, and a v4 cascade
|
|
439
|
+
layer beats specificity outright — a more specific rule in `components` still loses
|
|
440
|
+
to the plain utility. Same layer, higher specificity, so this wins. */
|
|
441
|
+
[data-theme='dark'] .tw\:prose {
|
|
442
|
+
@apply tw:prose-invert;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
@layer utilities {
|
|
447
|
+
[data-header-span='full']
|
|
448
|
+
> [data-app-shell-slot]:has(> [data-collapsible='off-canvas'][data-state='collapsed']) {
|
|
449
|
+
overflow-x: clip;
|
|
450
|
+
}
|
|
451
|
+
}
|
package/src/theme.css
CHANGED
|
@@ -118,6 +118,7 @@
|
|
|
118
118
|
--color-accent-foreground: rgb(var(--accent-foreground));
|
|
119
119
|
--color-border: rgb(var(--border));
|
|
120
120
|
--color-input: rgb(var(--input));
|
|
121
|
+
--color-input-background: rgb(var(--input-background));
|
|
121
122
|
--color-ring: rgb(var(--ring));
|
|
122
123
|
--color-ring-offset: rgb(var(--ring-offset));
|
|
123
124
|
--color-chart-1: rgb(var(--chart-1));
|
package/dist/charts.cjs
DELETED
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var recharts = require('recharts');
|
|
4
|
-
var clsx = require('clsx');
|
|
5
|
-
var tailwindMerge = require('tailwind-merge');
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
|
|
8
|
-
// src/blocks/Charts/ChartContainer.tsx
|
|
9
|
-
var twMerge = tailwindMerge.extendTailwindMerge({
|
|
10
|
-
prefix: "tw"
|
|
11
|
-
});
|
|
12
|
-
var cn = (...classes) => twMerge(clsx.clsx(...classes));
|
|
13
|
-
var ChartContainer = ({
|
|
14
|
-
height = 300,
|
|
15
|
-
width = "100%",
|
|
16
|
-
className,
|
|
17
|
-
children,
|
|
18
|
-
...props
|
|
19
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
20
|
-
"div",
|
|
21
|
-
{
|
|
22
|
-
className: cn(
|
|
23
|
-
"tw:text-xs",
|
|
24
|
-
// Axis ticks and labels follow the muted foreground token.
|
|
25
|
-
"tw:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground",
|
|
26
|
-
"tw:[&_.recharts-polar-angle-axis-tick_text]:fill-muted-foreground",
|
|
27
|
-
"tw:[&_.recharts-label]:fill-muted-foreground",
|
|
28
|
-
"tw:[&_.recharts-legend-item-text]:!text-muted-foreground",
|
|
29
|
-
// Grid lines, axis lines and the hover cursor follow the border token.
|
|
30
|
-
"tw:[&_.recharts-cartesian-grid_line]:stroke-border/60",
|
|
31
|
-
"tw:[&_.recharts-cartesian-axis-line]:stroke-border",
|
|
32
|
-
"tw:[&_.recharts-cartesian-axis-tick-line]:stroke-border",
|
|
33
|
-
"tw:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border",
|
|
34
|
-
"tw:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted/60",
|
|
35
|
-
"tw:[&_.recharts-surface]:outline-hidden",
|
|
36
|
-
className
|
|
37
|
-
),
|
|
38
|
-
...props,
|
|
39
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { width, height, children })
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
var ChartTooltipContent = ({
|
|
43
|
-
active,
|
|
44
|
-
label,
|
|
45
|
-
payload,
|
|
46
|
-
valueFormatter,
|
|
47
|
-
className
|
|
48
|
-
}) => {
|
|
49
|
-
if (!active || !payload?.length) return null;
|
|
50
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
51
|
-
"div",
|
|
52
|
-
{
|
|
53
|
-
className: cn(
|
|
54
|
-
"tw:min-w-32 tw:rounded-md tw:border tw:border-border tw:bg-popover tw:px-2.5 tw:py-1.5 tw:text-xs tw:text-popover-foreground tw:shadow-md",
|
|
55
|
-
className
|
|
56
|
-
),
|
|
57
|
-
children: [
|
|
58
|
-
label != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw:mb-1 tw:font-medium", children: label }),
|
|
59
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw:flex tw:flex-col tw:gap-1", children: payload.map((entry) => {
|
|
60
|
-
const name = String(entry.name ?? entry.dataKey ?? "");
|
|
61
|
-
const value = entry.value;
|
|
62
|
-
const hasNumber = value != null && value !== "" && Number.isFinite(Number(value));
|
|
63
|
-
const display = hasNumber ? valueFormatter ? valueFormatter(Number(value), name) : String(Number(value)) : value ?? "";
|
|
64
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
65
|
-
"div",
|
|
66
|
-
{
|
|
67
|
-
className: "tw:flex tw:items-center tw:justify-between tw:gap-3",
|
|
68
|
-
children: [
|
|
69
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tw:flex tw:items-center tw:gap-1.5", children: [
|
|
70
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
71
|
-
"span",
|
|
72
|
-
{
|
|
73
|
-
className: "tw:size-2 tw:shrink-0 tw:rounded-[2px]",
|
|
74
|
-
style: { backgroundColor: entry.color }
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw:text-muted-foreground", children: name })
|
|
78
|
-
] }),
|
|
79
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw:font-medium tw:tabular-nums", children: display })
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
String(entry.dataKey ?? name)
|
|
83
|
-
);
|
|
84
|
-
}) })
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
};
|
|
89
|
-
var ChartTooltip = ({ valueFormatter, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
90
|
-
recharts.Tooltip,
|
|
91
|
-
{
|
|
92
|
-
cursor: { strokeWidth: 1 },
|
|
93
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, { valueFormatter }),
|
|
94
|
-
...props
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
// src/blocks/Charts/format.ts
|
|
99
|
-
var formatValue = (value, valueFormatter) => {
|
|
100
|
-
if (value == null || value === "") return "";
|
|
101
|
-
const num = Number(value);
|
|
102
|
-
if (!Number.isFinite(num)) return "";
|
|
103
|
-
return valueFormatter ? valueFormatter(num) : String(num);
|
|
104
|
-
};
|
|
105
|
-
var AXIS_PROPS = {
|
|
106
|
-
tickLine: false,
|
|
107
|
-
axisLine: false,
|
|
108
|
-
tick: { fontSize: 11 }
|
|
109
|
-
};
|
|
110
|
-
var cartesianChrome = ({
|
|
111
|
-
xKey,
|
|
112
|
-
showGrid = true,
|
|
113
|
-
showYAxis = true,
|
|
114
|
-
showLegend = false,
|
|
115
|
-
showTooltip = true,
|
|
116
|
-
valueFormatter
|
|
117
|
-
}) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
118
|
-
showGrid && /* @__PURE__ */ jsxRuntime.jsx(recharts.CartesianGrid, { strokeDasharray: "3 3", vertical: false }),
|
|
119
|
-
/* @__PURE__ */ jsxRuntime.jsx(recharts.XAxis, { dataKey: xKey, ...AXIS_PROPS }),
|
|
120
|
-
showYAxis && /* @__PURE__ */ jsxRuntime.jsx(
|
|
121
|
-
recharts.YAxis,
|
|
122
|
-
{
|
|
123
|
-
width: 48,
|
|
124
|
-
...AXIS_PROPS,
|
|
125
|
-
tickFormatter: valueFormatter ? (value) => formatValue(value, valueFormatter) : void 0
|
|
126
|
-
}
|
|
127
|
-
),
|
|
128
|
-
showTooltip && /* @__PURE__ */ jsxRuntime.jsx(
|
|
129
|
-
ChartTooltip,
|
|
130
|
-
{
|
|
131
|
-
valueFormatter: valueFormatter ? (value) => formatValue(value, valueFormatter) : void 0
|
|
132
|
-
}
|
|
133
|
-
),
|
|
134
|
-
showLegend && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, { wrapperStyle: { fontSize: 11 } })
|
|
135
|
-
] });
|
|
136
|
-
|
|
137
|
-
// src/blocks/Charts/theme.ts
|
|
138
|
-
var CHART_TOKEN_COUNT = 5;
|
|
139
|
-
var chartTokenColor = (index) => {
|
|
140
|
-
const slot = (index % CHART_TOKEN_COUNT + CHART_TOKEN_COUNT) % CHART_TOKEN_COUNT + 1;
|
|
141
|
-
return `rgb(var(--chart-${slot}))`;
|
|
142
|
-
};
|
|
143
|
-
var resolveSeriesColor = (index, token) => chartTokenColor(token ? token - 1 : index);
|
|
144
|
-
var LineChart = ({
|
|
145
|
-
data,
|
|
146
|
-
xKey,
|
|
147
|
-
series,
|
|
148
|
-
height,
|
|
149
|
-
width,
|
|
150
|
-
className,
|
|
151
|
-
...chrome
|
|
152
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { height, width, className, children: /* @__PURE__ */ jsxRuntime.jsxs(recharts.LineChart, { data, margin: { top: 8, right: 8, left: 0, bottom: 0 }, children: [
|
|
153
|
-
cartesianChrome({ xKey, ...chrome }),
|
|
154
|
-
series.map((s, index) => {
|
|
155
|
-
const color = resolveSeriesColor(index, s.color);
|
|
156
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
157
|
-
recharts.Line,
|
|
158
|
-
{
|
|
159
|
-
type: "monotone",
|
|
160
|
-
dataKey: s.dataKey,
|
|
161
|
-
name: s.name ?? s.dataKey,
|
|
162
|
-
stroke: color,
|
|
163
|
-
strokeWidth: 2,
|
|
164
|
-
dot: { r: 3, fill: color, stroke: color },
|
|
165
|
-
activeDot: { r: 4 },
|
|
166
|
-
isAnimationActive: false
|
|
167
|
-
},
|
|
168
|
-
s.dataKey
|
|
169
|
-
);
|
|
170
|
-
})
|
|
171
|
-
] }) });
|
|
172
|
-
var BarChart = ({
|
|
173
|
-
data,
|
|
174
|
-
xKey,
|
|
175
|
-
series,
|
|
176
|
-
height,
|
|
177
|
-
width,
|
|
178
|
-
className,
|
|
179
|
-
stacked = false,
|
|
180
|
-
...chrome
|
|
181
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { height, width, className, children: /* @__PURE__ */ jsxRuntime.jsxs(recharts.BarChart, { data, margin: { top: 8, right: 8, left: 0, bottom: 0 }, children: [
|
|
182
|
-
cartesianChrome({ xKey, ...chrome }),
|
|
183
|
-
series.map((s, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
184
|
-
recharts.Bar,
|
|
185
|
-
{
|
|
186
|
-
dataKey: s.dataKey,
|
|
187
|
-
name: s.name ?? s.dataKey,
|
|
188
|
-
fill: resolveSeriesColor(index, s.color),
|
|
189
|
-
radius: stacked ? 0 : [4, 4, 0, 0],
|
|
190
|
-
stackId: stacked ? "stack" : void 0,
|
|
191
|
-
isAnimationActive: false
|
|
192
|
-
},
|
|
193
|
-
s.dataKey
|
|
194
|
-
))
|
|
195
|
-
] }) });
|
|
196
|
-
var AreaChart = ({
|
|
197
|
-
data,
|
|
198
|
-
xKey,
|
|
199
|
-
series,
|
|
200
|
-
height,
|
|
201
|
-
width,
|
|
202
|
-
className,
|
|
203
|
-
stacked = false,
|
|
204
|
-
...chrome
|
|
205
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { height, width, className, children: /* @__PURE__ */ jsxRuntime.jsxs(recharts.AreaChart, { data, margin: { top: 8, right: 8, left: 0, bottom: 0 }, children: [
|
|
206
|
-
cartesianChrome({ xKey, ...chrome }),
|
|
207
|
-
series.map((s, index) => {
|
|
208
|
-
const color = resolveSeriesColor(index, s.color);
|
|
209
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
210
|
-
recharts.Area,
|
|
211
|
-
{
|
|
212
|
-
type: "monotone",
|
|
213
|
-
dataKey: s.dataKey,
|
|
214
|
-
name: s.name ?? s.dataKey,
|
|
215
|
-
stroke: color,
|
|
216
|
-
fill: color,
|
|
217
|
-
fillOpacity: 0.15,
|
|
218
|
-
strokeWidth: 2,
|
|
219
|
-
stackId: stacked ? "stack" : void 0,
|
|
220
|
-
isAnimationActive: false
|
|
221
|
-
},
|
|
222
|
-
s.dataKey
|
|
223
|
-
);
|
|
224
|
-
})
|
|
225
|
-
] }) });
|
|
226
|
-
var PieChart = ({
|
|
227
|
-
data,
|
|
228
|
-
nameKey,
|
|
229
|
-
dataKey,
|
|
230
|
-
innerRadius = 0,
|
|
231
|
-
height,
|
|
232
|
-
width,
|
|
233
|
-
className,
|
|
234
|
-
showLegend = true,
|
|
235
|
-
showTooltip = true,
|
|
236
|
-
valueFormatter
|
|
237
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { height, width, className, children: /* @__PURE__ */ jsxRuntime.jsxs(recharts.PieChart, { children: [
|
|
238
|
-
showTooltip && /* @__PURE__ */ jsxRuntime.jsx(
|
|
239
|
-
ChartTooltip,
|
|
240
|
-
{
|
|
241
|
-
valueFormatter: valueFormatter ? (value) => formatValue(value, valueFormatter) : void 0
|
|
242
|
-
}
|
|
243
|
-
),
|
|
244
|
-
showLegend && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, { wrapperStyle: { fontSize: 11 } }),
|
|
245
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
246
|
-
recharts.Pie,
|
|
247
|
-
{
|
|
248
|
-
data,
|
|
249
|
-
nameKey,
|
|
250
|
-
dataKey,
|
|
251
|
-
innerRadius,
|
|
252
|
-
stroke: "rgb(var(--background))",
|
|
253
|
-
isAnimationActive: false,
|
|
254
|
-
children: data.map((datum, index) => /* @__PURE__ */ jsxRuntime.jsx(recharts.Cell, { fill: chartTokenColor(index) }, String(datum[nameKey] ?? index)))
|
|
255
|
-
}
|
|
256
|
-
)
|
|
257
|
-
] }) });
|
|
258
|
-
|
|
259
|
-
exports.AreaChart = AreaChart;
|
|
260
|
-
exports.BarChart = BarChart;
|
|
261
|
-
exports.ChartContainer = ChartContainer;
|
|
262
|
-
exports.ChartTooltip = ChartTooltip;
|
|
263
|
-
exports.ChartTooltipContent = ChartTooltipContent;
|
|
264
|
-
exports.LineChart = LineChart;
|
|
265
|
-
exports.PieChart = PieChart;
|
|
266
|
-
exports.chartTokenColor = chartTokenColor;
|
|
267
|
-
//# sourceMappingURL=charts.cjs.map
|
|
268
|
-
//# sourceMappingURL=charts.cjs.map
|
package/dist/charts.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/classNames.ts","../src/blocks/Charts/ChartContainer.tsx","../src/blocks/Charts/ChartTooltip.tsx","../src/blocks/Charts/format.ts","../src/blocks/Charts/cartesian.tsx","../src/blocks/Charts/theme.ts","../src/blocks/Charts/LineChart.tsx","../src/blocks/Charts/BarChart.tsx","../src/blocks/Charts/AreaChart.tsx","../src/blocks/Charts/PieChart.tsx"],"names":["extendTailwindMerge","clsx","jsx","ResponsiveContainer","jsxs","RechartsTooltip","Fragment","CartesianGrid","XAxis","YAxis","Legend","RechartsLineChart","Line","RechartsBarChart","Bar","RechartsAreaChart","Area","RechartsPieChart","Pie","Cell"],"mappings":";;;;;;;;AAKA,IAAM,UAAUA,iCAAA,CAAoB;AAAA,EAClC,MAAA,EAAQ;AACV,CAAC,CAAA;AAEM,IAAM,KAAK,CAAA,GAAI,OAAA,KAA0B,QAAQC,SAAA,CAAK,GAAG,OAAO,CAAC,CAAA;ACkBjE,IAAM,iBAAiB,CAAC;AAAA,EAC7B,MAAA,GAAS,GAAA;AAAA,EACT,KAAA,GAAQ,MAAA;AAAA,EACR,SAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACEC,cAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,SAAA,EAAW,EAAA;AAAA,MACT,YAAA;AAAA;AAAA,MAEA,iEAAA;AAAA,MACA,mEAAA;AAAA,MACA,8CAAA;AAAA,MACA,0DAAA;AAAA;AAAA,MAEA,uDAAA;AAAA,MACA,oDAAA;AAAA,MACA,yDAAA;AAAA,MACA,8DAAA;AAAA,MACA,kEAAA;AAAA,MACA,yCAAA;AAAA,MACA;AAAA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EAAA,EACE,QAAA,EAAA;AAAA,EAAA,WAAA,oBACCf,cAAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,gBACE,cAAA,GAAiB,CAAC,UAAU,WAAA,CAAY,KAAA,EAAO,cAAc,CAAA,GAAI;AAAA;AAAA,GAErE;AAAA,EAED,UAAA,oBAAcA,cAAAA,CAACQ,eAAAA,EAAA,EAAO,YAAA,EAAc,EAAE,QAAA,EAAU,EAAA,EAAG,EAAG,CAAA;AAAA,kBACvDR,cAAAA;AAAA,IAACgB,YAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,WAAA;AAAA,MAGA,MAAA,EAAO,wBAAA;AAAA,MACP,iBAAA,EAAmB,KAAA;AAAA,MAElB,eAAK,GAAA,CAAI,CAAC,OAAO,KAAA,qBAChBhB,eAACiB,aAAA,EAAA,EAA2C,IAAA,EAAM,eAAA,CAAgB,KAAK,KAA5D,MAAA,CAAO,KAAA,CAAM,OAAO,CAAA,IAAK,KAAK,CAAiC,CAC3E;AAAA;AAAA;AACH,CAAA,EACF,CAAA,EACF","file":"charts.cjs","sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\n// tailwind-merge v3 (Tailwind v4): the prefix drops the trailing separator —\n// `tw:` → `tw` (the `:` separator is implied).\nconst twMerge = extendTailwindMerge({\n prefix: 'tw',\n});\n\nexport const cn = (...classes: ClassValue[]) => twMerge(clsx(...classes));\n","import { type ComponentProps, type ReactElement } from 'react';\nimport { ResponsiveContainer } from 'recharts';\n\nimport { cn } from '../../utils';\n\n/** A length that recharts' `<ResponsiveContainer>` accepts: px number or `\"NN%\"`. */\nexport type ChartDimension = number | `${number}%`;\n\nexport type ChartContainerProps = Omit<ComponentProps<'div'>, 'children'> & {\n /**\n * Height as a px number or percentage string. Charts have no intrinsic\n * height, so a container needs one either here or from a sized ancestor.\n * Defaults to 300.\n */\n height?: ChartDimension;\n /** Width as a px number or percentage. Defaults to `\"100%\"` (fills parent). */\n width?: ChartDimension;\n /** A single recharts chart element (`<LineChart>`, `<BarChart>`, …). */\n children: ReactElement;\n};\n\n/**\n * Responsive, brand-themed frame for a chart. Wraps the chart in recharts'\n * `<ResponsiveContainer>` and applies the semantic-token chrome (axis text,\n * grid, cursor) through CSS so every chart inside inherits it. Sizing is\n * intrinsic: give it a `height` (default 300) and it fills the parent width.\n */\nexport const ChartContainer = ({\n height = 300,\n width = '100%',\n className,\n children,\n ...props\n}: ChartContainerProps) => (\n <div\n className={cn(\n 'tw:text-xs',\n // Axis ticks and labels follow the muted foreground token.\n 'tw:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground',\n 'tw:[&_.recharts-polar-angle-axis-tick_text]:fill-muted-foreground',\n 'tw:[&_.recharts-label]:fill-muted-foreground',\n 'tw:[&_.recharts-legend-item-text]:!text-muted-foreground',\n // Grid lines, axis lines and the hover cursor follow the border token.\n 'tw:[&_.recharts-cartesian-grid_line]:stroke-border/60',\n 'tw:[&_.recharts-cartesian-axis-line]:stroke-border',\n 'tw:[&_.recharts-cartesian-axis-tick-line]:stroke-border',\n 'tw:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border',\n 'tw:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted/60',\n 'tw:[&_.recharts-surface]:outline-hidden',\n className,\n )}\n {...props}\n >\n <ResponsiveContainer width={width} height={height}>\n {children}\n </ResponsiveContainer>\n </div>\n);\n","import { type ComponentProps } from 'react';\nimport { Tooltip as RechartsTooltip } from 'recharts';\n\nimport { cn } from '../../utils';\n\ntype TooltipPayloadEntry = {\n name?: string | number;\n value?: string | number;\n color?: string;\n dataKey?: string | number;\n};\n\ntype ChartTooltipContentProps = {\n active?: boolean;\n label?: string | number;\n payload?: TooltipPayloadEntry[];\n /** Format a value for display (e.g. currency, percentage). */\n valueFormatter?: (value: string | number, name: string) => string;\n className?: string;\n};\n\n/**\n * Brand-themed tooltip body. Surfaces (background, border, text) resolve from\n * semantic tokens, and each series swatch reuses the recharts-provided series\n * `color` (already a `--chart-*` token from this package's charts).\n */\nexport const ChartTooltipContent = ({\n active,\n label,\n payload,\n valueFormatter,\n className,\n}: ChartTooltipContentProps) => {\n if (!active || !payload?.length) return null;\n\n return (\n <div\n className={cn(\n 'tw:min-w-32 tw:rounded-md tw:border tw:border-border tw:bg-popover tw:px-2.5 tw:py-1.5 tw:text-xs tw:text-popover-foreground tw:shadow-md',\n className,\n )}\n >\n {label != null && <div className=\"tw:mb-1 tw:font-medium\">{label}</div>}\n <div className=\"tw:flex tw:flex-col tw:gap-1\">\n {payload.map((entry) => {\n const name = String(entry.name ?? entry.dataKey ?? '');\n const value = entry.value;\n // Missing / non-numeric values render blank rather than \"NaN\"/\"0\";\n // only well-formed numbers reach the formatter.\n const hasNumber = value != null && value !== '' && Number.isFinite(Number(value));\n const display = hasNumber\n ? valueFormatter\n ? valueFormatter(Number(value), name)\n : String(Number(value))\n : (value ?? '');\n return (\n <div\n key={String(entry.dataKey ?? name)}\n className=\"tw:flex tw:items-center tw:justify-between tw:gap-3\"\n >\n <span className=\"tw:flex tw:items-center tw:gap-1.5\">\n <span\n className=\"tw:size-2 tw:shrink-0 tw:rounded-[2px]\"\n style={{ backgroundColor: entry.color }}\n />\n <span className=\"tw:text-muted-foreground\">{name}</span>\n </span>\n <span className=\"tw:font-medium tw:tabular-nums\">{display}</span>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport type ChartTooltipProps = ComponentProps<typeof RechartsTooltip> & {\n valueFormatter?: (value: string | number, name: string) => string;\n};\n\n/**\n * Drop-in recharts `<Tooltip>` pre-wired to render {@link ChartTooltipContent}.\n * Each chart mounts one by default; pass `showTooltip={false}` on the chart to omit.\n */\nexport const ChartTooltip = ({ valueFormatter, ...props }: ChartTooltipProps) => (\n <RechartsTooltip\n cursor={{ strokeWidth: 1 }}\n content={<ChartTooltipContent valueFormatter={valueFormatter} />}\n {...props}\n />\n);\n","/**\n * Apply a numeric `valueFormatter` safely. recharts hands axis ticks and\n * tooltip payload values as `string | number | null | undefined`, and partial\n * or streaming data can carry gaps. Coercing those straight through\n * `Number(value)` would render `$0` (empty string → 0) or `$NaN` (non-numeric),\n * so a missing / non-finite value is rendered as an empty string instead of\n * being fed to the formatter.\n */\nexport const formatValue = (\n value: string | number | null | undefined,\n valueFormatter?: (value: number) => string,\n): string => {\n if (value == null || value === '') return '';\n const num = Number(value);\n if (!Number.isFinite(num)) return '';\n return valueFormatter ? valueFormatter(num) : String(num);\n};\n","import { CartesianGrid, Legend, XAxis, YAxis } from 'recharts';\n\nimport { ChartTooltip } from './ChartTooltip';\nimport { formatValue } from './format';\nimport { type CartesianChartProps } from './types';\n\nconst AXIS_PROPS = {\n tickLine: false,\n axisLine: false,\n tick: { fontSize: 11 },\n} as const;\n\n/**\n * The grid + axes + tooltip + legend shared by the line, bar, and area charts.\n * Colors are applied via `ChartContainer`'s CSS chrome, not inline props, so\n * these stay brand-safe.\n */\nexport const cartesianChrome = ({\n xKey,\n showGrid = true,\n showYAxis = true,\n showLegend = false,\n showTooltip = true,\n valueFormatter,\n}: Pick<\n CartesianChartProps,\n 'xKey' | 'showGrid' | 'showYAxis' | 'showLegend' | 'showTooltip' | 'valueFormatter'\n>) => (\n <>\n {showGrid && <CartesianGrid strokeDasharray=\"3 3\" vertical={false} />}\n <XAxis dataKey={xKey} {...AXIS_PROPS} />\n {showYAxis && (\n <YAxis\n width={48}\n {...AXIS_PROPS}\n tickFormatter={\n valueFormatter\n ? (value: string | number) => formatValue(value, valueFormatter)\n : undefined\n }\n />\n )}\n {showTooltip && (\n <ChartTooltip\n valueFormatter={valueFormatter ? (value) => formatValue(value, valueFormatter) : undefined}\n />\n )}\n {showLegend && <Legend wrapperStyle={{ fontSize: 11 }} />}\n </>\n);\n","/**\n * The design system ships a five-slot categorical chart palette as CSS\n * variables (`--chart-1` … `--chart-5`). Charts resolve their\n * series colors from these tokens only — never from inline hex or a primitive\n * scale — so they follow both the active color scheme (light/dark, via\n * `data-theme` in `styles.css`) and the active brand: a brand reskins charts\n * by defining `colors.chart` (and `colorsDark.chart`) in its\n * `@keboola/brand-registry` definition, which `ThemeProvider` emits as the\n * `--chart-*` variables.\n *\n * The CSS variables hold raw `R G B` channels (for Tailwind's `<alpha-value>`\n * opacity modifiers), so they are wrapped in `rgb(...)` before handing them to\n * recharts as ordinary SVG `stroke` / `fill` strings.\n */\nconst CHART_TOKEN_COUNT = 5;\n\n/** Number of the semantic chart token (`1`–`5`) a series maps to. */\nexport type ChartColorToken = 1 | 2 | 3 | 4 | 5;\n\n/**\n * The CSS color for a chart token. `index` is 0-based (series position); it\n * wraps around the five-slot palette so any number of series stays on-brand.\n */\nexport const chartTokenColor = (index: number): string => {\n // Euclidean modulo so negative indices still land in 1..CHART_TOKEN_COUNT\n // (plain `%` would yield e.g. `--chart-0` for index -1).\n const slot = (((index % CHART_TOKEN_COUNT) + CHART_TOKEN_COUNT) % CHART_TOKEN_COUNT) + 1;\n return `rgb(var(--chart-${slot}))`;\n};\n\n/** Resolve an explicit token (1–5) or fall back to the series position. */\nexport const resolveSeriesColor = (index: number, token?: ChartColorToken): string =>\n chartTokenColor(token ? token - 1 : index);\n","import { Line, LineChart as RechartsLineChart } from 'recharts';\n\nimport { cartesianChrome } from './cartesian';\nimport { ChartContainer } from './ChartContainer';\nimport { resolveSeriesColor } from './theme';\nimport { type CartesianChartProps } from './types';\n\n/**\n * A themed multi-series line chart. Each series' color comes from the semantic\n * `--chart-*` palette (by order, or pinned via `series[].color`), which\n * follows the active color scheme and the active brand's `colors.chart` when it\n * defines one. Wrap-free — mounts its own {@link ChartContainer}.\n *\n * @example\n * <LineChart\n * data={data}\n * xKey=\"month\"\n * series={[{ dataKey: 'revenue', name: 'Revenue' }, { dataKey: 'cost' }]}\n * />\n */\nexport const LineChart = ({\n data,\n xKey,\n series,\n height,\n width,\n className,\n ...chrome\n}: CartesianChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsLineChart data={data} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>\n {cartesianChrome({ xKey, ...chrome })}\n {series.map((s, index) => {\n const color = resolveSeriesColor(index, s.color);\n return (\n <Line\n key={s.dataKey}\n type=\"monotone\"\n dataKey={s.dataKey}\n name={s.name ?? s.dataKey}\n stroke={color}\n strokeWidth={2}\n dot={{ r: 3, fill: color, stroke: color }}\n activeDot={{ r: 4 }}\n isAnimationActive={false}\n />\n );\n })}\n </RechartsLineChart>\n </ChartContainer>\n);\n","import { Bar, BarChart as RechartsBarChart } from 'recharts';\n\nimport { cartesianChrome } from './cartesian';\nimport { ChartContainer } from './ChartContainer';\nimport { resolveSeriesColor } from './theme';\nimport { type CartesianChartProps } from './types';\n\nexport type BarChartProps = CartesianChartProps & {\n /** Stack the series into a single bar per category. Defaults to grouped. */\n stacked?: boolean;\n};\n\n/**\n * A themed multi-series bar chart. Series colors come from the semantic\n * `--chart-*` palette (by order, or pinned via `series[].color`), which\n * follows the active color scheme and the active brand's `colors.chart` when it\n * defines one. Pass `stacked` to stack the series instead of grouping them.\n *\n * @example\n * <BarChart data={data} xKey=\"month\" series={[{ dataKey: 'revenue' }]} />\n */\nexport const BarChart = ({\n data,\n xKey,\n series,\n height,\n width,\n className,\n stacked = false,\n ...chrome\n}: BarChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsBarChart data={data} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>\n {cartesianChrome({ xKey, ...chrome })}\n {series.map((s, index) => (\n <Bar\n key={s.dataKey}\n dataKey={s.dataKey}\n name={s.name ?? s.dataKey}\n fill={resolveSeriesColor(index, s.color)}\n radius={stacked ? 0 : [4, 4, 0, 0]}\n stackId={stacked ? 'stack' : undefined}\n isAnimationActive={false}\n />\n ))}\n </RechartsBarChart>\n </ChartContainer>\n);\n","import { Area, AreaChart as RechartsAreaChart } from 'recharts';\n\nimport { cartesianChrome } from './cartesian';\nimport { ChartContainer } from './ChartContainer';\nimport { resolveSeriesColor } from './theme';\nimport { type CartesianChartProps } from './types';\n\nexport type AreaChartProps = CartesianChartProps & {\n /** Stack the series into a cumulative area. Defaults to overlaid. */\n stacked?: boolean;\n};\n\n/**\n * A themed multi-series area chart. Each series is stroked and softly filled\n * from the semantic `--chart-*` palette (by order, or pinned via\n * `series[].color`), which follows the active color scheme and the active\n * brand's `colors.chart` when it defines one. Pass `stacked` to stack the\n * series cumulatively.\n *\n * @example\n * <AreaChart data={data} xKey=\"month\" series={[{ dataKey: 'revenue' }]} />\n */\nexport const AreaChart = ({\n data,\n xKey,\n series,\n height,\n width,\n className,\n stacked = false,\n ...chrome\n}: AreaChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsAreaChart data={data} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>\n {cartesianChrome({ xKey, ...chrome })}\n {series.map((s, index) => {\n const color = resolveSeriesColor(index, s.color);\n return (\n <Area\n key={s.dataKey}\n type=\"monotone\"\n dataKey={s.dataKey}\n name={s.name ?? s.dataKey}\n stroke={color}\n fill={color}\n fillOpacity={0.15}\n strokeWidth={2}\n stackId={stacked ? 'stack' : undefined}\n isAnimationActive={false}\n />\n );\n })}\n </RechartsAreaChart>\n </ChartContainer>\n);\n","import { Cell, Legend, Pie, PieChart as RechartsPieChart } from 'recharts';\n\nimport { ChartContainer, type ChartDimension } from './ChartContainer';\nimport { ChartTooltip } from './ChartTooltip';\nimport { formatValue } from './format';\nimport { chartTokenColor } from './theme';\nimport { type ChartDatum } from './types';\n\nexport type PieChartProps = {\n /** The rows to plot — one sector per row. */\n data: ChartDatum[];\n /** Key into each datum for the sector label. */\n nameKey: string;\n /** Key into each datum for the sector value. */\n dataKey: string;\n /** Render as a donut with a hole of this inner radius (px or %). */\n innerRadius?: ChartDimension;\n /** Height as a px number or percentage. Defaults to 300. */\n height?: ChartDimension;\n /** Width as a px number or percentage. Defaults to `\"100%\"`. */\n width?: ChartDimension;\n /** Show a legend below the chart. Defaults to `true`. */\n showLegend?: boolean;\n /** Show the hover tooltip. Defaults to `true`. */\n showTooltip?: boolean;\n /** Format a sector value for the tooltip. */\n valueFormatter?: (value: number) => string;\n className?: string;\n};\n\n/**\n * A themed pie / donut chart. Each sector cycles through the semantic\n * `--chart-*` palette, which follows the active color scheme and the\n * active brand's `colors.chart` when it defines one. Pass `innerRadius` to make\n * a donut.\n *\n * @example\n * <PieChart data={data} nameKey=\"engine\" dataKey=\"rows\" innerRadius=\"60%\" />\n */\nexport const PieChart = ({\n data,\n nameKey,\n dataKey,\n innerRadius = 0,\n height,\n width,\n className,\n showLegend = true,\n showTooltip = true,\n valueFormatter,\n}: PieChartProps) => (\n <ChartContainer height={height} width={width} className={className}>\n <RechartsPieChart>\n {showTooltip && (\n <ChartTooltip\n valueFormatter={\n valueFormatter ? (value) => formatValue(value, valueFormatter) : undefined\n }\n />\n )}\n {showLegend && <Legend wrapperStyle={{ fontSize: 11 }} />}\n <Pie\n data={data}\n nameKey={nameKey}\n dataKey={dataKey}\n innerRadius={innerRadius}\n // Separate sectors with the brand surface color rather than recharts'\n // hardcoded white default.\n stroke=\"rgb(var(--background))\"\n isAnimationActive={false}\n >\n {data.map((datum, index) => (\n <Cell key={String(datum[nameKey] ?? index)} fill={chartTokenColor(index)} />\n ))}\n </Pie>\n </RechartsPieChart>\n </ChartContainer>\n);\n"]}
|
package/dist/charts.d.cts
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ComponentProps, ReactElement } from 'react';
|
|
3
|
-
import { Tooltip } from 'recharts';
|
|
4
|
-
|
|
5
|
-
/** A length that recharts' `<ResponsiveContainer>` accepts: px number or `"NN%"`. */
|
|
6
|
-
type ChartDimension = number | `${number}%`;
|
|
7
|
-
type ChartContainerProps = Omit<ComponentProps<'div'>, 'children'> & {
|
|
8
|
-
/**
|
|
9
|
-
* Height as a px number or percentage string. Charts have no intrinsic
|
|
10
|
-
* height, so a container needs one either here or from a sized ancestor.
|
|
11
|
-
* Defaults to 300.
|
|
12
|
-
*/
|
|
13
|
-
height?: ChartDimension;
|
|
14
|
-
/** Width as a px number or percentage. Defaults to `"100%"` (fills parent). */
|
|
15
|
-
width?: ChartDimension;
|
|
16
|
-
/** A single recharts chart element (`<LineChart>`, `<BarChart>`, …). */
|
|
17
|
-
children: ReactElement;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Responsive, brand-themed frame for a chart. Wraps the chart in recharts'
|
|
21
|
-
* `<ResponsiveContainer>` and applies the semantic-token chrome (axis text,
|
|
22
|
-
* grid, cursor) through CSS so every chart inside inherits it. Sizing is
|
|
23
|
-
* intrinsic: give it a `height` (default 300) and it fills the parent width.
|
|
24
|
-
*/
|
|
25
|
-
declare const ChartContainer: ({ height, width, className, children, ...props }: ChartContainerProps) => react_jsx_runtime.JSX.Element;
|
|
26
|
-
|
|
27
|
-
type TooltipPayloadEntry = {
|
|
28
|
-
name?: string | number;
|
|
29
|
-
value?: string | number;
|
|
30
|
-
color?: string;
|
|
31
|
-
dataKey?: string | number;
|
|
32
|
-
};
|
|
33
|
-
type ChartTooltipContentProps = {
|
|
34
|
-
active?: boolean;
|
|
35
|
-
label?: string | number;
|
|
36
|
-
payload?: TooltipPayloadEntry[];
|
|
37
|
-
/** Format a value for display (e.g. currency, percentage). */
|
|
38
|
-
valueFormatter?: (value: string | number, name: string) => string;
|
|
39
|
-
className?: string;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Brand-themed tooltip body. Surfaces (background, border, text) resolve from
|
|
43
|
-
* semantic tokens, and each series swatch reuses the recharts-provided series
|
|
44
|
-
* `color` (already a `--chart-*` token from this package's charts).
|
|
45
|
-
*/
|
|
46
|
-
declare const ChartTooltipContent: ({ active, label, payload, valueFormatter, className, }: ChartTooltipContentProps) => react_jsx_runtime.JSX.Element | null;
|
|
47
|
-
type ChartTooltipProps = ComponentProps<typeof Tooltip> & {
|
|
48
|
-
valueFormatter?: (value: string | number, name: string) => string;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Drop-in recharts `<Tooltip>` pre-wired to render {@link ChartTooltipContent}.
|
|
52
|
-
* Each chart mounts one by default; pass `showTooltip={false}` on the chart to omit.
|
|
53
|
-
*/
|
|
54
|
-
declare const ChartTooltip: ({ valueFormatter, ...props }: ChartTooltipProps) => react_jsx_runtime.JSX.Element;
|
|
55
|
-
|
|
56
|
-
/** Number of the semantic chart token (`1`–`5`) a series maps to. */
|
|
57
|
-
type ChartColorToken = 1 | 2 | 3 | 4 | 5;
|
|
58
|
-
/**
|
|
59
|
-
* The CSS color for a chart token. `index` is 0-based (series position); it
|
|
60
|
-
* wraps around the five-slot palette so any number of series stays on-brand.
|
|
61
|
-
*/
|
|
62
|
-
declare const chartTokenColor: (index: number) => string;
|
|
63
|
-
|
|
64
|
-
/** A single row of chart data — an object keyed by the axis + series keys. */
|
|
65
|
-
type ChartDatum = Record<string, string | number | null | undefined>;
|
|
66
|
-
/**
|
|
67
|
-
* One plotted series (a line, bar, or area). Its color comes from the semantic
|
|
68
|
-
* chart palette: by series order, or pinned to a specific token via `color`.
|
|
69
|
-
*/
|
|
70
|
-
type ChartSeries = {
|
|
71
|
-
/** Key into each datum for this series' value. */
|
|
72
|
-
dataKey: string;
|
|
73
|
-
/** Human label for legend/tooltip. Defaults to `dataKey`. */
|
|
74
|
-
name?: string;
|
|
75
|
-
/** Pin to a specific palette token (1–5). Defaults to the series position. */
|
|
76
|
-
color?: ChartColorToken;
|
|
77
|
-
};
|
|
78
|
-
/** Props shared by the cartesian charts (line / bar / area). */
|
|
79
|
-
type CartesianChartProps = {
|
|
80
|
-
/** The rows to plot. */
|
|
81
|
-
data: ChartDatum[];
|
|
82
|
-
/** Key into each datum for the category (x) axis. */
|
|
83
|
-
xKey: string;
|
|
84
|
-
/** Series to plot. */
|
|
85
|
-
series: ChartSeries[];
|
|
86
|
-
/** Height as a px number or percentage. Defaults to 300. */
|
|
87
|
-
height?: ChartDimension;
|
|
88
|
-
/** Width as a px number or percentage. Defaults to `"100%"`. */
|
|
89
|
-
width?: ChartDimension;
|
|
90
|
-
/** Show the cartesian background grid. Defaults to `true`. */
|
|
91
|
-
showGrid?: boolean;
|
|
92
|
-
/** Show the value (y) axis. Defaults to `true`. */
|
|
93
|
-
showYAxis?: boolean;
|
|
94
|
-
/** Show a legend below the chart. Defaults to `false`. */
|
|
95
|
-
showLegend?: boolean;
|
|
96
|
-
/** Show the hover tooltip. Defaults to `true`. */
|
|
97
|
-
showTooltip?: boolean;
|
|
98
|
-
/** Format a series value for the axis and tooltip. */
|
|
99
|
-
valueFormatter?: (value: number) => string;
|
|
100
|
-
className?: string;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* A themed multi-series line chart. Each series' color comes from the semantic
|
|
105
|
-
* `--chart-*` palette (by order, or pinned via `series[].color`), which
|
|
106
|
-
* follows the active color scheme and the active brand's `colors.chart` when it
|
|
107
|
-
* defines one. Wrap-free — mounts its own {@link ChartContainer}.
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* <LineChart
|
|
111
|
-
* data={data}
|
|
112
|
-
* xKey="month"
|
|
113
|
-
* series={[{ dataKey: 'revenue', name: 'Revenue' }, { dataKey: 'cost' }]}
|
|
114
|
-
* />
|
|
115
|
-
*/
|
|
116
|
-
declare const LineChart: ({ data, xKey, series, height, width, className, ...chrome }: CartesianChartProps) => react_jsx_runtime.JSX.Element;
|
|
117
|
-
|
|
118
|
-
type BarChartProps = CartesianChartProps & {
|
|
119
|
-
/** Stack the series into a single bar per category. Defaults to grouped. */
|
|
120
|
-
stacked?: boolean;
|
|
121
|
-
};
|
|
122
|
-
/**
|
|
123
|
-
* A themed multi-series bar chart. Series colors come from the semantic
|
|
124
|
-
* `--chart-*` palette (by order, or pinned via `series[].color`), which
|
|
125
|
-
* follows the active color scheme and the active brand's `colors.chart` when it
|
|
126
|
-
* defines one. Pass `stacked` to stack the series instead of grouping them.
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* <BarChart data={data} xKey="month" series={[{ dataKey: 'revenue' }]} />
|
|
130
|
-
*/
|
|
131
|
-
declare const BarChart: ({ data, xKey, series, height, width, className, stacked, ...chrome }: BarChartProps) => react_jsx_runtime.JSX.Element;
|
|
132
|
-
|
|
133
|
-
type AreaChartProps = CartesianChartProps & {
|
|
134
|
-
/** Stack the series into a cumulative area. Defaults to overlaid. */
|
|
135
|
-
stacked?: boolean;
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* A themed multi-series area chart. Each series is stroked and softly filled
|
|
139
|
-
* from the semantic `--chart-*` palette (by order, or pinned via
|
|
140
|
-
* `series[].color`), which follows the active color scheme and the active
|
|
141
|
-
* brand's `colors.chart` when it defines one. Pass `stacked` to stack the
|
|
142
|
-
* series cumulatively.
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* <AreaChart data={data} xKey="month" series={[{ dataKey: 'revenue' }]} />
|
|
146
|
-
*/
|
|
147
|
-
declare const AreaChart: ({ data, xKey, series, height, width, className, stacked, ...chrome }: AreaChartProps) => react_jsx_runtime.JSX.Element;
|
|
148
|
-
|
|
149
|
-
type PieChartProps = {
|
|
150
|
-
/** The rows to plot — one sector per row. */
|
|
151
|
-
data: ChartDatum[];
|
|
152
|
-
/** Key into each datum for the sector label. */
|
|
153
|
-
nameKey: string;
|
|
154
|
-
/** Key into each datum for the sector value. */
|
|
155
|
-
dataKey: string;
|
|
156
|
-
/** Render as a donut with a hole of this inner radius (px or %). */
|
|
157
|
-
innerRadius?: ChartDimension;
|
|
158
|
-
/** Height as a px number or percentage. Defaults to 300. */
|
|
159
|
-
height?: ChartDimension;
|
|
160
|
-
/** Width as a px number or percentage. Defaults to `"100%"`. */
|
|
161
|
-
width?: ChartDimension;
|
|
162
|
-
/** Show a legend below the chart. Defaults to `true`. */
|
|
163
|
-
showLegend?: boolean;
|
|
164
|
-
/** Show the hover tooltip. Defaults to `true`. */
|
|
165
|
-
showTooltip?: boolean;
|
|
166
|
-
/** Format a sector value for the tooltip. */
|
|
167
|
-
valueFormatter?: (value: number) => string;
|
|
168
|
-
className?: string;
|
|
169
|
-
};
|
|
170
|
-
/**
|
|
171
|
-
* A themed pie / donut chart. Each sector cycles through the semantic
|
|
172
|
-
* `--chart-*` palette, which follows the active color scheme and the
|
|
173
|
-
* active brand's `colors.chart` when it defines one. Pass `innerRadius` to make
|
|
174
|
-
* a donut.
|
|
175
|
-
*
|
|
176
|
-
* @example
|
|
177
|
-
* <PieChart data={data} nameKey="engine" dataKey="rows" innerRadius="60%" />
|
|
178
|
-
*/
|
|
179
|
-
declare const PieChart: ({ data, nameKey, dataKey, innerRadius, height, width, className, showLegend, showTooltip, valueFormatter, }: PieChartProps) => react_jsx_runtime.JSX.Element;
|
|
180
|
-
|
|
181
|
-
export { AreaChart, type AreaChartProps, BarChart, type BarChartProps, type CartesianChartProps, type ChartColorToken, ChartContainer, type ChartContainerProps, type ChartDatum, type ChartDimension, type ChartSeries, ChartTooltip, ChartTooltipContent, type ChartTooltipProps, LineChart, PieChart, type PieChartProps, chartTokenColor };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
declare const CHUNK_TYPE: {
|
|
2
|
-
readonly UNCHANGED: "unchanged";
|
|
3
|
-
readonly ADDED: "added";
|
|
4
|
-
readonly REMOVED: "removed";
|
|
5
|
-
};
|
|
6
|
-
type ChunkType = (typeof CHUNK_TYPE)[keyof typeof CHUNK_TYPE];
|
|
7
|
-
type DiffChunk = {
|
|
8
|
-
type: ChunkType;
|
|
9
|
-
value: string;
|
|
10
|
-
/** 1-indexed start line in the old (left) text */
|
|
11
|
-
oldStart: number;
|
|
12
|
-
/** 1-indexed end line in the old (left) text */
|
|
13
|
-
oldEnd: number;
|
|
14
|
-
/** 1-indexed start line in the new (right) text */
|
|
15
|
-
newStart: number;
|
|
16
|
-
/** 1-indexed end line in the new (right) text */
|
|
17
|
-
newEnd: number;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* A paired conflict: adjacent REMOVED + ADDED chunks from diffLines,
|
|
21
|
-
* representing a section that was modified. If only one side exists,
|
|
22
|
-
* the other is empty (pure insertion or deletion).
|
|
23
|
-
*/
|
|
24
|
-
type MergeConflict = {
|
|
25
|
-
id: string;
|
|
26
|
-
oldValue: string;
|
|
27
|
-
oldStartLine: number;
|
|
28
|
-
oldEndLine: number;
|
|
29
|
-
newValue: string;
|
|
30
|
-
newStartLine: number;
|
|
31
|
-
newEndLine: number;
|
|
32
|
-
};
|
|
33
|
-
declare const CHANGE_CLASS: {
|
|
34
|
-
readonly SAFE: "safe";
|
|
35
|
-
readonly CONFLICT: "conflict";
|
|
36
|
-
};
|
|
37
|
-
type ChangeClassification = (typeof CHANGE_CLASS)[keyof typeof CHANGE_CLASS];
|
|
38
|
-
|
|
39
|
-
export type { ChangeClassification as C, DiffChunk as D, MergeConflict as M };
|