@bison-lab/ui 0.10.0 → 0.11.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/dist/charts.d.mts +143 -0
- package/dist/charts.d.mts.map +1 -0
- package/dist/charts.mjs +272 -0
- package/dist/charts.mjs.map +1 -0
- package/dist/index.d.mts +65 -153
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +117 -281
- package/dist/index.mjs.map +1 -1
- package/dist/utils-DPv8mMhD.mjs +11 -0
- package/dist/utils-DPv8mMhD.mjs.map +1 -0
- package/package.json +6 -2
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/chart-utils.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Shared utilities for chart components.
|
|
7
|
+
* Reads theme CSS custom properties to provide Recharts-compatible color strings.
|
|
8
|
+
*/
|
|
9
|
+
/** Default chart color tokens mapped to CSS custom properties */
|
|
10
|
+
declare const chartColorTokens: readonly ["--primary", "--secondary", "--brand-accent", "--highlight", "--destructive"];
|
|
11
|
+
/**
|
|
12
|
+
* Resolves a CSS custom property value to an `hsl(...)` string.
|
|
13
|
+
* Falls back to the raw token name if resolution fails (e.g. SSR).
|
|
14
|
+
*/
|
|
15
|
+
declare function resolveHslToken(token: string, el?: Element | null): string;
|
|
16
|
+
/**
|
|
17
|
+
* Returns an array of resolved theme colors for chart series.
|
|
18
|
+
* Consumers can override with explicit `colors` prop.
|
|
19
|
+
*/
|
|
20
|
+
declare function getThemeColors(el?: Element | null): string[];
|
|
21
|
+
/** Chart size presets (height in px) */
|
|
22
|
+
declare const chartSizeMap: {
|
|
23
|
+
readonly sm: 200;
|
|
24
|
+
readonly md: 300;
|
|
25
|
+
readonly lg: 400;
|
|
26
|
+
};
|
|
27
|
+
type ChartSize = keyof typeof chartSizeMap;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/area-chart.d.ts
|
|
30
|
+
interface AreaChartSeries {
|
|
31
|
+
/** Data key corresponding to a field in the data array */
|
|
32
|
+
dataKey: string;
|
|
33
|
+
/** Display name for legend/tooltip */
|
|
34
|
+
name?: string;
|
|
35
|
+
/** Override color (any CSS color string) */
|
|
36
|
+
color?: string;
|
|
37
|
+
/** Fill opacity for the area (0–1). Default: 0.15 */
|
|
38
|
+
fillOpacity?: number;
|
|
39
|
+
}
|
|
40
|
+
interface AreaChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
41
|
+
/** Chart data — array of objects with keys matching `categories`/`series` */
|
|
42
|
+
data: Record<string, unknown>[];
|
|
43
|
+
/** Key used for the X-axis category labels */
|
|
44
|
+
index: string;
|
|
45
|
+
/** Quick setup: data keys to render as area series (uses theme colors) */
|
|
46
|
+
categories?: string[];
|
|
47
|
+
/** Advanced setup: full series config (takes precedence over `categories`) */
|
|
48
|
+
series?: AreaChartSeries[];
|
|
49
|
+
/** Override theme colors (applied in order to series) */
|
|
50
|
+
colors?: string[];
|
|
51
|
+
/** Chart height preset */
|
|
52
|
+
size?: ChartSize;
|
|
53
|
+
/** Explicit height in px (overrides `size`) */
|
|
54
|
+
height?: number;
|
|
55
|
+
/** Show cartesian grid. Default: true */
|
|
56
|
+
showGrid?: boolean;
|
|
57
|
+
/** Show legend. Default: false */
|
|
58
|
+
showLegend?: boolean;
|
|
59
|
+
/** Show tooltip. Default: true */
|
|
60
|
+
showTooltip?: boolean;
|
|
61
|
+
/** Show Y-axis. Default: true */
|
|
62
|
+
showYAxis?: boolean;
|
|
63
|
+
/** Area curve type. Default: "monotone" */
|
|
64
|
+
curveType?: "monotone" | "linear" | "step" | "natural";
|
|
65
|
+
/** Stack areas. Default: false */
|
|
66
|
+
stacked?: boolean;
|
|
67
|
+
}
|
|
68
|
+
declare const AreaChart: React.ForwardRefExoticComponent<AreaChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/components/bar-chart.d.ts
|
|
71
|
+
interface BarChartSeries {
|
|
72
|
+
/** Data key corresponding to a field in the data array */
|
|
73
|
+
dataKey: string;
|
|
74
|
+
/** Display name for legend/tooltip */
|
|
75
|
+
name?: string;
|
|
76
|
+
/** Override color (any CSS color string) */
|
|
77
|
+
color?: string;
|
|
78
|
+
/** Bar radius. Default: [4, 4, 0, 0] */
|
|
79
|
+
radius?: [number, number, number, number];
|
|
80
|
+
}
|
|
81
|
+
interface BarChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
82
|
+
/** Chart data — array of objects with keys matching `categories`/`series` */
|
|
83
|
+
data: Record<string, unknown>[];
|
|
84
|
+
/** Key used for the X-axis category labels */
|
|
85
|
+
index: string;
|
|
86
|
+
/** Quick setup: data keys to render as bar series (uses theme colors) */
|
|
87
|
+
categories?: string[];
|
|
88
|
+
/** Advanced setup: full series config (takes precedence over `categories`) */
|
|
89
|
+
series?: BarChartSeries[];
|
|
90
|
+
/** Override theme colors (applied in order to series) */
|
|
91
|
+
colors?: string[];
|
|
92
|
+
/** Chart height preset */
|
|
93
|
+
size?: ChartSize;
|
|
94
|
+
/** Explicit height in px (overrides `size`) */
|
|
95
|
+
height?: number;
|
|
96
|
+
/** Show cartesian grid. Default: true */
|
|
97
|
+
showGrid?: boolean;
|
|
98
|
+
/** Show legend. Default: false */
|
|
99
|
+
showLegend?: boolean;
|
|
100
|
+
/** Show tooltip. Default: true */
|
|
101
|
+
showTooltip?: boolean;
|
|
102
|
+
/** Show Y-axis. Default: true */
|
|
103
|
+
showYAxis?: boolean;
|
|
104
|
+
/** Stack bars. Default: false */
|
|
105
|
+
stacked?: boolean;
|
|
106
|
+
/** Horizontal layout (bars go left-to-right). Default: false */
|
|
107
|
+
horizontal?: boolean;
|
|
108
|
+
}
|
|
109
|
+
declare const BarChart: React.ForwardRefExoticComponent<BarChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/components/donut-chart.d.ts
|
|
112
|
+
interface DonutChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
113
|
+
/** Chart data — array of objects with `name` and `value` keys (or custom keys via `nameKey`/`dataKey`) */
|
|
114
|
+
data: Record<string, unknown>[];
|
|
115
|
+
/** Key for segment labels. Default: "name" */
|
|
116
|
+
nameKey?: string;
|
|
117
|
+
/** Key for segment values. Default: "value" */
|
|
118
|
+
dataKey?: string;
|
|
119
|
+
/** Override theme colors (applied in order to segments) */
|
|
120
|
+
colors?: string[];
|
|
121
|
+
/** Chart height preset */
|
|
122
|
+
size?: ChartSize;
|
|
123
|
+
/** Explicit height in px (overrides `size`) */
|
|
124
|
+
height?: number;
|
|
125
|
+
/** Show legend. Default: false */
|
|
126
|
+
showLegend?: boolean;
|
|
127
|
+
/** Show tooltip. Default: true */
|
|
128
|
+
showTooltip?: boolean;
|
|
129
|
+
/** Show labels on segments. Default: false */
|
|
130
|
+
showLabels?: boolean;
|
|
131
|
+
/** Inner radius ratio (0 = pie, >0 = donut). Default: "60%" */
|
|
132
|
+
innerRadius?: string | number;
|
|
133
|
+
/** Outer radius. Default: "80%" */
|
|
134
|
+
outerRadius?: string | number;
|
|
135
|
+
/** Padding angle between segments in degrees. Default: 2 */
|
|
136
|
+
paddingAngle?: number;
|
|
137
|
+
/** Center label content */
|
|
138
|
+
centerLabel?: React.ReactNode;
|
|
139
|
+
}
|
|
140
|
+
declare const DonutChart: React.ForwardRefExoticComponent<DonutChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
141
|
+
//#endregion
|
|
142
|
+
export { AreaChart, type AreaChartProps, type AreaChartSeries, BarChart, type BarChartProps, type BarChartSeries, type ChartSize, DonutChart, type DonutChartProps, chartColorTokens, chartSizeMap, getThemeColors, resolveHslToken };
|
|
143
|
+
//# sourceMappingURL=charts.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"charts.d.mts","names":[],"sources":["../src/lib/chart-utils.ts","../src/components/area-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AA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;;;UC3CG,eAAA,SACP,IAAA,CAAK,KAAA,CAAM,cAAA,CAAe,cAAA;EHbvB;EGeX,IAAA,EAAM,MAAA;;EAEN,OAAA;EHXQ;EGaR,OAAA;EHP6B;EGS7B,MAAA;EHTyD;EGWzD,IAAA,GAAO,SAAA;EHX2C;EGalD,MAAA;EHbgE;EGehE,UAAA;EHAc;EGEd,WAAA;;EAEA,UAAA;EHJgD;EGMhD,WAAA;EHGQ;EGDR,WAAA;EHCQ;EGCR,YAAA;;EAEA,WAAA,GAAc,KAAA,CAAM,SAAA;AAAA;AAAA,cAGhB,UAAA,EAAU,KAAA,CAAA,yBAAA,CAAA,eAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA"}
|
package/dist/charts.mjs
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as cn } from "./utils-DPv8mMhD.mjs";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Area, AreaChart as AreaChart$1, Bar, BarChart as BarChart$1, CartesianGrid, Cell, Legend, Pie, PieChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts";
|
|
6
|
+
//#region src/lib/chart-utils.ts
|
|
7
|
+
/**
|
|
8
|
+
* Shared utilities for chart components.
|
|
9
|
+
* Reads theme CSS custom properties to provide Recharts-compatible color strings.
|
|
10
|
+
*/
|
|
11
|
+
/** Default chart color tokens mapped to CSS custom properties */
|
|
12
|
+
const chartColorTokens = [
|
|
13
|
+
"--primary",
|
|
14
|
+
"--secondary",
|
|
15
|
+
"--brand-accent",
|
|
16
|
+
"--highlight",
|
|
17
|
+
"--destructive"
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Resolves a CSS custom property value to an `hsl(...)` string.
|
|
21
|
+
* Falls back to the raw token name if resolution fails (e.g. SSR).
|
|
22
|
+
*/
|
|
23
|
+
function resolveHslToken(token, el) {
|
|
24
|
+
if (typeof window === "undefined") return `hsl(var(${token}))`;
|
|
25
|
+
const target = el ?? document.documentElement;
|
|
26
|
+
const raw = getComputedStyle(target).getPropertyValue(token).trim();
|
|
27
|
+
if (!raw) return `hsl(var(${token}))`;
|
|
28
|
+
if (raw.startsWith("hsl")) return raw;
|
|
29
|
+
return `hsl(${raw})`;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns an array of resolved theme colors for chart series.
|
|
33
|
+
* Consumers can override with explicit `colors` prop.
|
|
34
|
+
*/
|
|
35
|
+
function getThemeColors(el) {
|
|
36
|
+
return chartColorTokens.map((token) => resolveHslToken(token, el));
|
|
37
|
+
}
|
|
38
|
+
/** Chart size presets (height in px) */
|
|
39
|
+
const chartSizeMap = {
|
|
40
|
+
sm: 200,
|
|
41
|
+
md: 300,
|
|
42
|
+
lg: 400
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/components/area-chart.tsx
|
|
46
|
+
const AreaChart = React.forwardRef(({ className, data, index, categories, series, colors, size = "md", height, showGrid = true, showLegend = false, showTooltip = true, showYAxis = true, curveType = "monotone", stacked = false, ...props }, ref) => {
|
|
47
|
+
const containerRef = React.useRef(null);
|
|
48
|
+
const [themeColors, setThemeColors] = React.useState([]);
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
const el = containerRef.current;
|
|
51
|
+
setThemeColors(colors ?? getThemeColors(el));
|
|
52
|
+
}, [colors]);
|
|
53
|
+
const resolvedSeries = React.useMemo(() => {
|
|
54
|
+
if (series) return series;
|
|
55
|
+
return (categories ?? []).map((key) => ({
|
|
56
|
+
dataKey: key,
|
|
57
|
+
name: key
|
|
58
|
+
}));
|
|
59
|
+
}, [series, categories]);
|
|
60
|
+
const chartHeight = height ?? chartSizeMap[size];
|
|
61
|
+
const gridColor = themeColors.length > 0 ? void 0 : "hsl(var(--border-subtle))";
|
|
62
|
+
return /* @__PURE__ */ jsx("div", {
|
|
63
|
+
ref: (node) => {
|
|
64
|
+
containerRef.current = node;
|
|
65
|
+
if (typeof ref === "function") ref(node);
|
|
66
|
+
else if (ref) ref.current = node;
|
|
67
|
+
},
|
|
68
|
+
className: cn("w-full", className),
|
|
69
|
+
...props,
|
|
70
|
+
children: /* @__PURE__ */ jsx(ResponsiveContainer, {
|
|
71
|
+
width: "100%",
|
|
72
|
+
height: chartHeight,
|
|
73
|
+
children: /* @__PURE__ */ jsxs(AreaChart$1, {
|
|
74
|
+
data,
|
|
75
|
+
children: [
|
|
76
|
+
showGrid && /* @__PURE__ */ jsx(CartesianGrid, {
|
|
77
|
+
strokeDasharray: "3 3",
|
|
78
|
+
stroke: gridColor,
|
|
79
|
+
className: "stroke-border-subtle"
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ jsx(XAxis, {
|
|
82
|
+
dataKey: index,
|
|
83
|
+
tick: { fontSize: 12 },
|
|
84
|
+
tickLine: false,
|
|
85
|
+
axisLine: false,
|
|
86
|
+
className: "[&_text]:fill-content-secondary"
|
|
87
|
+
}),
|
|
88
|
+
showYAxis && /* @__PURE__ */ jsx(YAxis, {
|
|
89
|
+
tick: { fontSize: 12 },
|
|
90
|
+
tickLine: false,
|
|
91
|
+
axisLine: false,
|
|
92
|
+
width: 40,
|
|
93
|
+
className: "[&_text]:fill-content-secondary"
|
|
94
|
+
}),
|
|
95
|
+
showTooltip && /* @__PURE__ */ jsx(Tooltip, { contentStyle: {
|
|
96
|
+
backgroundColor: "hsl(var(--popover))",
|
|
97
|
+
border: "1px solid hsl(var(--border))",
|
|
98
|
+
borderRadius: "var(--radius-md)",
|
|
99
|
+
color: "hsl(var(--popover-foreground))",
|
|
100
|
+
fontSize: 12
|
|
101
|
+
} }),
|
|
102
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
103
|
+
resolvedSeries.map((s, i) => {
|
|
104
|
+
const color = s.color ?? themeColors[i % themeColors.length] ?? `hsl(var(--primary))`;
|
|
105
|
+
return /* @__PURE__ */ jsx(Area, {
|
|
106
|
+
type: curveType,
|
|
107
|
+
dataKey: s.dataKey,
|
|
108
|
+
name: s.name ?? s.dataKey,
|
|
109
|
+
stroke: color,
|
|
110
|
+
fill: color,
|
|
111
|
+
fillOpacity: s.fillOpacity ?? .15,
|
|
112
|
+
stackId: stacked ? "stack" : void 0
|
|
113
|
+
}, s.dataKey);
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
AreaChart.displayName = "AreaChart";
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/components/bar-chart.tsx
|
|
123
|
+
const BarChart = React.forwardRef(({ className, data, index, categories, series, colors, size = "md", height, showGrid = true, showLegend = false, showTooltip = true, showYAxis = true, stacked = false, horizontal = false, ...props }, ref) => {
|
|
124
|
+
const containerRef = React.useRef(null);
|
|
125
|
+
const [themeColors, setThemeColors] = React.useState([]);
|
|
126
|
+
React.useEffect(() => {
|
|
127
|
+
const el = containerRef.current;
|
|
128
|
+
setThemeColors(colors ?? getThemeColors(el));
|
|
129
|
+
}, [colors]);
|
|
130
|
+
const resolvedSeries = React.useMemo(() => {
|
|
131
|
+
if (series) return series;
|
|
132
|
+
return (categories ?? []).map((key) => ({
|
|
133
|
+
dataKey: key,
|
|
134
|
+
name: key
|
|
135
|
+
}));
|
|
136
|
+
}, [series, categories]);
|
|
137
|
+
const chartHeight = height ?? chartSizeMap[size];
|
|
138
|
+
const layout = horizontal ? "vertical" : "horizontal";
|
|
139
|
+
return /* @__PURE__ */ jsx("div", {
|
|
140
|
+
ref: (node) => {
|
|
141
|
+
containerRef.current = node;
|
|
142
|
+
if (typeof ref === "function") ref(node);
|
|
143
|
+
else if (ref) ref.current = node;
|
|
144
|
+
},
|
|
145
|
+
className: cn("w-full", className),
|
|
146
|
+
...props,
|
|
147
|
+
children: /* @__PURE__ */ jsx(ResponsiveContainer, {
|
|
148
|
+
width: "100%",
|
|
149
|
+
height: chartHeight,
|
|
150
|
+
children: /* @__PURE__ */ jsxs(BarChart$1, {
|
|
151
|
+
data,
|
|
152
|
+
layout,
|
|
153
|
+
children: [
|
|
154
|
+
showGrid && /* @__PURE__ */ jsx(CartesianGrid, {
|
|
155
|
+
strokeDasharray: "3 3",
|
|
156
|
+
className: "stroke-border-subtle"
|
|
157
|
+
}),
|
|
158
|
+
horizontal ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(XAxis, {
|
|
159
|
+
type: "number",
|
|
160
|
+
tick: { fontSize: 12 },
|
|
161
|
+
tickLine: false,
|
|
162
|
+
axisLine: false,
|
|
163
|
+
className: "[&_text]:fill-content-secondary"
|
|
164
|
+
}), /* @__PURE__ */ jsx(YAxis, {
|
|
165
|
+
dataKey: index,
|
|
166
|
+
type: "category",
|
|
167
|
+
tick: { fontSize: 12 },
|
|
168
|
+
tickLine: false,
|
|
169
|
+
axisLine: false,
|
|
170
|
+
width: 80,
|
|
171
|
+
className: "[&_text]:fill-content-secondary"
|
|
172
|
+
})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(XAxis, {
|
|
173
|
+
dataKey: index,
|
|
174
|
+
tick: { fontSize: 12 },
|
|
175
|
+
tickLine: false,
|
|
176
|
+
axisLine: false,
|
|
177
|
+
className: "[&_text]:fill-content-secondary"
|
|
178
|
+
}), showYAxis && /* @__PURE__ */ jsx(YAxis, {
|
|
179
|
+
tick: { fontSize: 12 },
|
|
180
|
+
tickLine: false,
|
|
181
|
+
axisLine: false,
|
|
182
|
+
width: 40,
|
|
183
|
+
className: "[&_text]:fill-content-secondary"
|
|
184
|
+
})] }),
|
|
185
|
+
showTooltip && /* @__PURE__ */ jsx(Tooltip, { contentStyle: {
|
|
186
|
+
backgroundColor: "hsl(var(--popover))",
|
|
187
|
+
border: "1px solid hsl(var(--border))",
|
|
188
|
+
borderRadius: "var(--radius-md)",
|
|
189
|
+
color: "hsl(var(--popover-foreground))",
|
|
190
|
+
fontSize: 12
|
|
191
|
+
} }),
|
|
192
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
193
|
+
resolvedSeries.map((s, i) => {
|
|
194
|
+
const color = s.color ?? themeColors[i % themeColors.length] ?? `hsl(var(--primary))`;
|
|
195
|
+
return /* @__PURE__ */ jsx(Bar, {
|
|
196
|
+
dataKey: s.dataKey,
|
|
197
|
+
name: s.name ?? s.dataKey,
|
|
198
|
+
fill: color,
|
|
199
|
+
radius: s.radius ?? [
|
|
200
|
+
4,
|
|
201
|
+
4,
|
|
202
|
+
0,
|
|
203
|
+
0
|
|
204
|
+
],
|
|
205
|
+
stackId: stacked ? "stack" : void 0
|
|
206
|
+
}, s.dataKey);
|
|
207
|
+
})
|
|
208
|
+
]
|
|
209
|
+
})
|
|
210
|
+
})
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
BarChart.displayName = "BarChart";
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/components/donut-chart.tsx
|
|
216
|
+
const DonutChart = React.forwardRef(({ className, data, nameKey = "name", dataKey = "value", colors, size = "md", height, showLegend = false, showTooltip = true, showLabels = false, innerRadius = "60%", outerRadius = "80%", paddingAngle = 2, centerLabel, ...props }, ref) => {
|
|
217
|
+
const containerRef = React.useRef(null);
|
|
218
|
+
const [themeColors, setThemeColors] = React.useState([]);
|
|
219
|
+
React.useEffect(() => {
|
|
220
|
+
const el = containerRef.current;
|
|
221
|
+
setThemeColors(colors ?? getThemeColors(el));
|
|
222
|
+
}, [colors]);
|
|
223
|
+
const chartHeight = height ?? chartSizeMap[size];
|
|
224
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
225
|
+
ref: (node) => {
|
|
226
|
+
containerRef.current = node;
|
|
227
|
+
if (typeof ref === "function") ref(node);
|
|
228
|
+
else if (ref) ref.current = node;
|
|
229
|
+
},
|
|
230
|
+
className: cn("relative w-full", className),
|
|
231
|
+
...props,
|
|
232
|
+
children: [centerLabel && /* @__PURE__ */ jsx("div", {
|
|
233
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
234
|
+
"aria-hidden": "true",
|
|
235
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
236
|
+
className: "text-center",
|
|
237
|
+
children: centerLabel
|
|
238
|
+
})
|
|
239
|
+
}), /* @__PURE__ */ jsx(ResponsiveContainer, {
|
|
240
|
+
width: "100%",
|
|
241
|
+
height: chartHeight,
|
|
242
|
+
children: /* @__PURE__ */ jsxs(PieChart, { children: [
|
|
243
|
+
/* @__PURE__ */ jsx(Pie, {
|
|
244
|
+
data,
|
|
245
|
+
nameKey,
|
|
246
|
+
dataKey,
|
|
247
|
+
innerRadius,
|
|
248
|
+
outerRadius,
|
|
249
|
+
paddingAngle,
|
|
250
|
+
label: showLabels,
|
|
251
|
+
strokeWidth: 0,
|
|
252
|
+
children: data.map((_, i) => {
|
|
253
|
+
return /* @__PURE__ */ jsx(Cell, { fill: themeColors[i % themeColors.length] ?? `hsl(var(--primary))` }, i);
|
|
254
|
+
})
|
|
255
|
+
}),
|
|
256
|
+
showTooltip && /* @__PURE__ */ jsx(Tooltip, { contentStyle: {
|
|
257
|
+
backgroundColor: "hsl(var(--popover))",
|
|
258
|
+
border: "1px solid hsl(var(--border))",
|
|
259
|
+
borderRadius: "var(--radius-md)",
|
|
260
|
+
color: "hsl(var(--popover-foreground))",
|
|
261
|
+
fontSize: 12
|
|
262
|
+
} }),
|
|
263
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {})
|
|
264
|
+
] })
|
|
265
|
+
})]
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
DonutChart.displayName = "DonutChart";
|
|
269
|
+
//#endregion
|
|
270
|
+
export { AreaChart, BarChart, DonutChart, chartColorTokens, chartSizeMap, getThemeColors, resolveHslToken };
|
|
271
|
+
|
|
272
|
+
//# sourceMappingURL=charts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"charts.mjs","names":["RechartsAreaChart","RechartsBarChart"],"sources":["../src/lib/chart-utils.ts","../src/components/area-chart.tsx","../src/components/bar-chart.tsx","../src/components/donut-chart.tsx"],"sourcesContent":["/**\n * Shared utilities for chart components.\n * Reads theme CSS custom properties to provide Recharts-compatible color strings.\n */\n\n/** Default chart color tokens mapped to CSS custom properties */\nexport const chartColorTokens = [\n \"--primary\",\n \"--secondary\",\n \"--brand-accent\",\n \"--highlight\",\n \"--destructive\",\n] as const;\n\n/**\n * Resolves a CSS custom property value to an `hsl(...)` string.\n * Falls back to the raw token name if resolution fails (e.g. SSR).\n */\nexport function resolveHslToken(token: string, el?: Element | null): string {\n if (typeof window === \"undefined\") return `hsl(var(${token}))`;\n const target = el ?? document.documentElement;\n const raw = getComputedStyle(target).getPropertyValue(token).trim();\n if (!raw) return `hsl(var(${token}))`;\n // If already in hsl() format, return as-is\n if (raw.startsWith(\"hsl\")) return raw;\n // Otherwise wrap the raw HSL values\n return `hsl(${raw})`;\n}\n\n/**\n * Returns an array of resolved theme colors for chart series.\n * Consumers can override with explicit `colors` prop.\n */\nexport function getThemeColors(el?: Element | null): string[] {\n return chartColorTokens.map((token) => resolveHslToken(token, el));\n}\n\n/** Chart size presets (height in px) */\nexport const chartSizeMap = {\n sm: 200,\n md: 300,\n lg: 400,\n} as const;\n\nexport type ChartSize = keyof typeof chartSizeMap;\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n AreaChart as RechartsAreaChart,\n Area,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n Legend,\n} from \"recharts\";\nimport { cn } from \"../lib/utils\";\nimport {\n getThemeColors,\n resolveHslToken,\n chartSizeMap,\n type ChartSize,\n} from \"../lib/chart-utils\";\n\nexport interface AreaChartSeries {\n /** Data key corresponding to a field in the data array */\n dataKey: string;\n /** Display name for legend/tooltip */\n name?: string;\n /** Override color (any CSS color string) */\n color?: string;\n /** Fill opacity for the area (0–1). Default: 0.15 */\n fillOpacity?: number;\n}\n\nexport interface AreaChartProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** Chart data — array of objects with keys matching `categories`/`series` */\n data: Record<string, unknown>[];\n /** Key used for the X-axis category labels */\n index: string;\n /** Quick setup: data keys to render as area series (uses theme colors) */\n categories?: string[];\n /** Advanced setup: full series config (takes precedence over `categories`) */\n series?: AreaChartSeries[];\n /** Override theme colors (applied in order to series) */\n colors?: string[];\n /** Chart height preset */\n size?: ChartSize;\n /** Explicit height in px (overrides `size`) */\n height?: number;\n /** Show cartesian grid. Default: true */\n showGrid?: boolean;\n /** Show legend. Default: false */\n showLegend?: boolean;\n /** Show tooltip. Default: true */\n showTooltip?: boolean;\n /** Show Y-axis. Default: true */\n showYAxis?: boolean;\n /** Area curve type. Default: \"monotone\" */\n curveType?: \"monotone\" | \"linear\" | \"step\" | \"natural\";\n /** Stack areas. Default: false */\n stacked?: boolean;\n}\n\nconst AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>(\n (\n {\n className,\n data,\n index,\n categories,\n series,\n colors,\n size = \"md\",\n height,\n showGrid = true,\n showLegend = false,\n showTooltip = true,\n showYAxis = true,\n curveType = \"monotone\",\n stacked = false,\n ...props\n },\n ref,\n ) => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const [themeColors, setThemeColors] = React.useState<string[]>([]);\n\n React.useEffect(() => {\n const el = containerRef.current;\n setThemeColors(colors ?? getThemeColors(el));\n }, [colors]);\n\n const resolvedSeries: AreaChartSeries[] = React.useMemo(() => {\n if (series) return series;\n return (categories ?? []).map((key) => ({ dataKey: key, name: key }));\n }, [series, categories]);\n\n const chartHeight = height ?? chartSizeMap[size];\n\n const gridColor =\n themeColors.length > 0\n ? undefined\n : \"hsl(var(--border-subtle))\";\n\n return (\n <div\n ref={(node) => {\n (containerRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }}\n className={cn(\"w-full\", className)}\n {...props}\n >\n <ResponsiveContainer width=\"100%\" height={chartHeight}>\n <RechartsAreaChart data={data}>\n {showGrid && (\n <CartesianGrid\n strokeDasharray=\"3 3\"\n stroke={gridColor}\n className=\"stroke-border-subtle\"\n />\n )}\n <XAxis\n dataKey={index}\n tick={{ fontSize: 12 }}\n tickLine={false}\n axisLine={false}\n className=\"[&_text]:fill-content-secondary\"\n />\n {showYAxis && (\n <YAxis\n tick={{ fontSize: 12 }}\n tickLine={false}\n axisLine={false}\n width={40}\n className=\"[&_text]:fill-content-secondary\"\n />\n )}\n {showTooltip && (\n <Tooltip\n contentStyle={{\n backgroundColor: \"hsl(var(--popover))\",\n border: \"1px solid hsl(var(--border))\",\n borderRadius: \"var(--radius-md)\",\n color: \"hsl(var(--popover-foreground))\",\n fontSize: 12,\n }}\n />\n )}\n {showLegend && <Legend />}\n {resolvedSeries.map((s, i) => {\n const color =\n s.color ?? themeColors[i % themeColors.length] ?? `hsl(var(--primary))`;\n return (\n <Area\n key={s.dataKey}\n type={curveType}\n dataKey={s.dataKey}\n name={s.name ?? s.dataKey}\n stroke={color}\n fill={color}\n fillOpacity={s.fillOpacity ?? 0.15}\n stackId={stacked ? \"stack\" : undefined}\n />\n );\n })}\n </RechartsAreaChart>\n </ResponsiveContainer>\n </div>\n );\n },\n);\nAreaChart.displayName = \"AreaChart\";\n\nexport { AreaChart };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n BarChart as RechartsBarChart,\n Bar,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n Legend,\n} from \"recharts\";\nimport { cn } from \"../lib/utils\";\nimport {\n getThemeColors,\n chartSizeMap,\n type ChartSize,\n} from \"../lib/chart-utils\";\n\nexport interface BarChartSeries {\n /** Data key corresponding to a field in the data array */\n dataKey: string;\n /** Display name for legend/tooltip */\n name?: string;\n /** Override color (any CSS color string) */\n color?: string;\n /** Bar radius. Default: [4, 4, 0, 0] */\n radius?: [number, number, number, number];\n}\n\nexport interface BarChartProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** Chart data — array of objects with keys matching `categories`/`series` */\n data: Record<string, unknown>[];\n /** Key used for the X-axis category labels */\n index: string;\n /** Quick setup: data keys to render as bar series (uses theme colors) */\n categories?: string[];\n /** Advanced setup: full series config (takes precedence over `categories`) */\n series?: BarChartSeries[];\n /** Override theme colors (applied in order to series) */\n colors?: string[];\n /** Chart height preset */\n size?: ChartSize;\n /** Explicit height in px (overrides `size`) */\n height?: number;\n /** Show cartesian grid. Default: true */\n showGrid?: boolean;\n /** Show legend. Default: false */\n showLegend?: boolean;\n /** Show tooltip. Default: true */\n showTooltip?: boolean;\n /** Show Y-axis. Default: true */\n showYAxis?: boolean;\n /** Stack bars. Default: false */\n stacked?: boolean;\n /** Horizontal layout (bars go left-to-right). Default: false */\n horizontal?: boolean;\n}\n\nconst BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(\n (\n {\n className,\n data,\n index,\n categories,\n series,\n colors,\n size = \"md\",\n height,\n showGrid = true,\n showLegend = false,\n showTooltip = true,\n showYAxis = true,\n stacked = false,\n horizontal = false,\n ...props\n },\n ref,\n ) => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const [themeColors, setThemeColors] = React.useState<string[]>([]);\n\n React.useEffect(() => {\n const el = containerRef.current;\n setThemeColors(colors ?? getThemeColors(el));\n }, [colors]);\n\n const resolvedSeries: BarChartSeries[] = React.useMemo(() => {\n if (series) return series;\n return (categories ?? []).map((key) => ({ dataKey: key, name: key }));\n }, [series, categories]);\n\n const chartHeight = height ?? chartSizeMap[size];\n const layout = horizontal ? \"vertical\" : \"horizontal\";\n\n return (\n <div\n ref={(node) => {\n (containerRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }}\n className={cn(\"w-full\", className)}\n {...props}\n >\n <ResponsiveContainer width=\"100%\" height={chartHeight}>\n <RechartsBarChart data={data} layout={layout}>\n {showGrid && (\n <CartesianGrid\n strokeDasharray=\"3 3\"\n className=\"stroke-border-subtle\"\n />\n )}\n {horizontal ? (\n <>\n <XAxis type=\"number\" tick={{ fontSize: 12 }} tickLine={false} axisLine={false} className=\"[&_text]:fill-content-secondary\" />\n <YAxis dataKey={index} type=\"category\" tick={{ fontSize: 12 }} tickLine={false} axisLine={false} width={80} className=\"[&_text]:fill-content-secondary\" />\n </>\n ) : (\n <>\n <XAxis dataKey={index} tick={{ fontSize: 12 }} tickLine={false} axisLine={false} className=\"[&_text]:fill-content-secondary\" />\n {showYAxis && (\n <YAxis tick={{ fontSize: 12 }} tickLine={false} axisLine={false} width={40} className=\"[&_text]:fill-content-secondary\" />\n )}\n </>\n )}\n {showTooltip && (\n <Tooltip\n contentStyle={{\n backgroundColor: \"hsl(var(--popover))\",\n border: \"1px solid hsl(var(--border))\",\n borderRadius: \"var(--radius-md)\",\n color: \"hsl(var(--popover-foreground))\",\n fontSize: 12,\n }}\n />\n )}\n {showLegend && <Legend />}\n {resolvedSeries.map((s, i) => {\n const color =\n s.color ?? themeColors[i % themeColors.length] ?? `hsl(var(--primary))`;\n return (\n <Bar\n key={s.dataKey}\n dataKey={s.dataKey}\n name={s.name ?? s.dataKey}\n fill={color}\n radius={s.radius ?? [4, 4, 0, 0]}\n stackId={stacked ? \"stack\" : undefined}\n />\n );\n })}\n </RechartsBarChart>\n </ResponsiveContainer>\n </div>\n );\n },\n);\nBarChart.displayName = \"BarChart\";\n\nexport { BarChart };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n PieChart,\n Pie,\n Cell,\n Tooltip,\n ResponsiveContainer,\n Legend,\n} from \"recharts\";\nimport { cn } from \"../lib/utils\";\nimport {\n getThemeColors,\n chartSizeMap,\n type ChartSize,\n} from \"../lib/chart-utils\";\n\nexport interface DonutChartProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n /** Chart data — array of objects with `name` and `value` keys (or custom keys via `nameKey`/`dataKey`) */\n data: Record<string, unknown>[];\n /** Key for segment labels. Default: \"name\" */\n nameKey?: string;\n /** Key for segment values. Default: \"value\" */\n dataKey?: string;\n /** Override theme colors (applied in order to segments) */\n colors?: string[];\n /** Chart height preset */\n size?: ChartSize;\n /** Explicit height in px (overrides `size`) */\n height?: number;\n /** Show legend. Default: false */\n showLegend?: boolean;\n /** Show tooltip. Default: true */\n showTooltip?: boolean;\n /** Show labels on segments. Default: false */\n showLabels?: boolean;\n /** Inner radius ratio (0 = pie, >0 = donut). Default: \"60%\" */\n innerRadius?: string | number;\n /** Outer radius. Default: \"80%\" */\n outerRadius?: string | number;\n /** Padding angle between segments in degrees. Default: 2 */\n paddingAngle?: number;\n /** Center label content */\n centerLabel?: React.ReactNode;\n}\n\nconst DonutChart = React.forwardRef<HTMLDivElement, DonutChartProps>(\n (\n {\n className,\n data,\n nameKey = \"name\",\n dataKey = \"value\",\n colors,\n size = \"md\",\n height,\n showLegend = false,\n showTooltip = true,\n showLabels = false,\n innerRadius = \"60%\",\n outerRadius = \"80%\",\n paddingAngle = 2,\n centerLabel,\n ...props\n },\n ref,\n ) => {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const [themeColors, setThemeColors] = React.useState<string[]>([]);\n\n React.useEffect(() => {\n const el = containerRef.current;\n setThemeColors(colors ?? getThemeColors(el));\n }, [colors]);\n\n const chartHeight = height ?? chartSizeMap[size];\n\n return (\n <div\n ref={(node) => {\n (containerRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }}\n className={cn(\"relative w-full\", className)}\n {...props}\n >\n {centerLabel && (\n <div\n className=\"pointer-events-none absolute inset-0 flex items-center justify-center\"\n aria-hidden=\"true\"\n >\n <div className=\"text-center\">{centerLabel}</div>\n </div>\n )}\n <ResponsiveContainer width=\"100%\" height={chartHeight}>\n <PieChart>\n <Pie\n data={data}\n nameKey={nameKey}\n dataKey={dataKey}\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n paddingAngle={paddingAngle}\n label={showLabels}\n strokeWidth={0}\n >\n {data.map((_, i) => {\n const color =\n themeColors[i % themeColors.length] ?? `hsl(var(--primary))`;\n return <Cell key={i} fill={color} />;\n })}\n </Pie>\n {showTooltip && (\n <Tooltip\n contentStyle={{\n backgroundColor: \"hsl(var(--popover))\",\n border: \"1px solid hsl(var(--border))\",\n borderRadius: \"var(--radius-md)\",\n color: \"hsl(var(--popover-foreground))\",\n fontSize: 12,\n }}\n />\n )}\n {showLegend && <Legend />}\n </PieChart>\n </ResponsiveContainer>\n </div>\n );\n },\n);\nDonutChart.displayName = \"DonutChart\";\n\nexport { DonutChart };\n"],"mappings":";;;;;;;;;;;AAMA,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACD;;;;;AAMD,SAAgB,gBAAgB,OAAe,IAA6B;AAC1E,KAAI,OAAO,WAAW,YAAa,QAAO,WAAW,MAAM;CAC3D,MAAM,SAAS,MAAM,SAAS;CAC9B,MAAM,MAAM,iBAAiB,OAAO,CAAC,iBAAiB,MAAM,CAAC,MAAM;AACnE,KAAI,CAAC,IAAK,QAAO,WAAW,MAAM;AAElC,KAAI,IAAI,WAAW,MAAM,CAAE,QAAO;AAElC,QAAO,OAAO,IAAI;;;;;;AAOpB,SAAgB,eAAe,IAA+B;AAC5D,QAAO,iBAAiB,KAAK,UAAU,gBAAgB,OAAO,GAAG,CAAC;;;AAIpE,MAAa,eAAe;CAC1B,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;;;ACoBD,MAAM,YAAY,MAAM,YAEpB,EACE,WACA,MACA,OACA,YACA,QACA,QACA,OAAO,MACP,QACA,WAAW,MACX,aAAa,OACb,cAAc,MACd,YAAY,MACZ,YAAY,YACZ,UAAU,OACV,GAAG,SAEL,QACG;CACH,MAAM,eAAe,MAAM,OAAuB,KAAK;CACvD,MAAM,CAAC,aAAa,kB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