@optilogic/charts 1.0.0-beta.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/index.js ADDED
@@ -0,0 +1,302 @@
1
+ import * as React from 'react';
2
+ import { ResponsiveContainer, LineChart as LineChart$1, CartesianGrid, XAxis, YAxis, Tooltip, Legend, Line, BarChart as BarChart$1, Bar } from 'recharts';
3
+ import { cn } from '@optilogic/core';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
5
+
6
+ // src/line-chart.tsx
7
+ var CHART_COLORS = [
8
+ "hsl(var(--chart-1))",
9
+ "hsl(var(--chart-2))",
10
+ "hsl(var(--chart-3))",
11
+ "hsl(var(--chart-4))",
12
+ "hsl(var(--chart-5))"
13
+ ];
14
+ function getChartColor(index, custom) {
15
+ if (custom) return custom;
16
+ return CHART_COLORS[index % CHART_COLORS.length] ?? "hsl(var(--chart-1))";
17
+ }
18
+ var LineChart = React.forwardRef(
19
+ ({
20
+ data,
21
+ series,
22
+ xAxis,
23
+ yAxis,
24
+ grid = true,
25
+ tooltip = true,
26
+ legend = false,
27
+ animate = false,
28
+ className,
29
+ height = "100%",
30
+ margin = { top: 8, right: 12, left: 0, bottom: 4 }
31
+ }, ref) => {
32
+ const gridConfig = React.useMemo(() => {
33
+ if (grid === false) return null;
34
+ if (grid === true) return { vertical: false, horizontal: true };
35
+ return grid;
36
+ }, [grid]);
37
+ const legendConfig = React.useMemo(() => {
38
+ if (legend === false) return null;
39
+ if (legend === true)
40
+ return { position: "top", align: "right" };
41
+ return legend;
42
+ }, [legend]);
43
+ return /* @__PURE__ */ jsx("div", { ref, className: cn("w-full", className), style: { height }, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(LineChart$1, { data, margin, children: [
44
+ gridConfig && /* @__PURE__ */ jsx(
45
+ CartesianGrid,
46
+ {
47
+ strokeDasharray: "3 3",
48
+ stroke: "hsl(var(--divider))",
49
+ vertical: gridConfig.vertical ?? false,
50
+ horizontal: gridConfig.horizontal ?? true
51
+ }
52
+ ),
53
+ /* @__PURE__ */ jsx(
54
+ XAxis,
55
+ {
56
+ dataKey: xAxis.dataKey,
57
+ tick: { fontSize: 10, fill: "hsl(var(--muted-foreground))" },
58
+ tickLine: false,
59
+ axisLine: false,
60
+ minTickGap: xAxis.minTickGap ?? 24,
61
+ tickFormatter: xAxis.tickFormatter,
62
+ label: xAxis.label ? {
63
+ value: xAxis.label,
64
+ position: "insideBottom",
65
+ offset: -4,
66
+ fontSize: 11,
67
+ fill: "hsl(var(--muted-foreground))"
68
+ } : void 0
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsx(
72
+ YAxis,
73
+ {
74
+ domain: yAxis?.domain ?? ["auto", "auto"],
75
+ tick: { fontSize: 10, fill: "hsl(var(--muted-foreground))" },
76
+ tickLine: false,
77
+ axisLine: false,
78
+ width: yAxis?.width ?? 30,
79
+ tickFormatter: yAxis?.tickFormatter,
80
+ label: yAxis?.label ? {
81
+ value: yAxis.label,
82
+ angle: -90,
83
+ position: "insideLeft",
84
+ fontSize: 11,
85
+ fill: "hsl(var(--muted-foreground))"
86
+ } : void 0
87
+ }
88
+ ),
89
+ tooltip && /* @__PURE__ */ jsx(
90
+ Tooltip,
91
+ {
92
+ contentStyle: {
93
+ background: "hsl(var(--card))",
94
+ border: "1px solid hsl(var(--border))",
95
+ borderRadius: 6,
96
+ fontSize: 11
97
+ },
98
+ labelStyle: {
99
+ color: "hsl(var(--foreground))",
100
+ fontWeight: 500,
101
+ marginBottom: 4
102
+ },
103
+ itemStyle: {
104
+ color: "hsl(var(--foreground))"
105
+ }
106
+ }
107
+ ),
108
+ legendConfig && /* @__PURE__ */ jsx(
109
+ Legend,
110
+ {
111
+ verticalAlign: legendConfig.position ?? "top",
112
+ align: legendConfig.align ?? "right",
113
+ wrapperStyle: { fontSize: 11, paddingBottom: 4 }
114
+ }
115
+ ),
116
+ series.map((s, index) => /* @__PURE__ */ jsx(
117
+ Line,
118
+ {
119
+ type: s.type ?? "monotone",
120
+ dataKey: s.dataKey,
121
+ name: s.name,
122
+ stroke: getChartColor(index, s.color),
123
+ strokeWidth: s.strokeWidth ?? 2,
124
+ dot: s.dot ?? false,
125
+ isAnimationActive: animate
126
+ },
127
+ s.dataKey
128
+ ))
129
+ ] }) }) });
130
+ }
131
+ );
132
+ LineChart.displayName = "LineChart";
133
+ var BarChart = React.forwardRef(
134
+ ({
135
+ data,
136
+ series,
137
+ layout = "vertical",
138
+ xAxis,
139
+ yAxis,
140
+ grid = true,
141
+ tooltip = true,
142
+ legend = false,
143
+ animate = true,
144
+ barSize,
145
+ barGap,
146
+ barCategoryGap,
147
+ className,
148
+ height = "100%",
149
+ margin = { top: 8, right: 12, left: 0, bottom: 4 }
150
+ }, ref) => {
151
+ const gridConfig = React.useMemo(() => {
152
+ if (grid === false) return null;
153
+ if (grid === true) return { vertical: false, horizontal: true };
154
+ return grid;
155
+ }, [grid]);
156
+ const legendConfig = React.useMemo(() => {
157
+ if (legend === false) return null;
158
+ if (legend === true)
159
+ return { position: "top", align: "right" };
160
+ return legend;
161
+ }, [legend]);
162
+ const isHorizontal = layout === "horizontal";
163
+ return /* @__PURE__ */ jsx("div", { ref, className: cn("w-full", className), style: { height }, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(
164
+ BarChart$1,
165
+ {
166
+ data,
167
+ layout: isHorizontal ? "vertical" : "horizontal",
168
+ margin,
169
+ barSize,
170
+ barGap,
171
+ barCategoryGap,
172
+ children: [
173
+ gridConfig && /* @__PURE__ */ jsx(
174
+ CartesianGrid,
175
+ {
176
+ strokeDasharray: "3 3",
177
+ stroke: "hsl(var(--divider))",
178
+ vertical: isHorizontal ? gridConfig.horizontal ?? true : gridConfig.vertical ?? false,
179
+ horizontal: isHorizontal ? gridConfig.vertical ?? false : gridConfig.horizontal ?? true
180
+ }
181
+ ),
182
+ isHorizontal ? /* @__PURE__ */ jsx(
183
+ XAxis,
184
+ {
185
+ type: "number",
186
+ domain: yAxis?.domain ?? ["auto", "auto"],
187
+ tick: { fontSize: 10, fill: "hsl(var(--muted-foreground))" },
188
+ tickLine: false,
189
+ axisLine: false,
190
+ tickFormatter: yAxis?.tickFormatter,
191
+ label: yAxis?.label ? {
192
+ value: yAxis.label,
193
+ position: "insideBottom",
194
+ offset: -4,
195
+ fontSize: 11,
196
+ fill: "hsl(var(--muted-foreground))"
197
+ } : void 0
198
+ }
199
+ ) : /* @__PURE__ */ jsx(
200
+ XAxis,
201
+ {
202
+ dataKey: xAxis.dataKey,
203
+ tick: { fontSize: 10, fill: "hsl(var(--muted-foreground))" },
204
+ tickLine: false,
205
+ axisLine: false,
206
+ minTickGap: xAxis.minTickGap ?? 24,
207
+ tickFormatter: xAxis.tickFormatter,
208
+ label: xAxis.label ? {
209
+ value: xAxis.label,
210
+ position: "insideBottom",
211
+ offset: -4,
212
+ fontSize: 11,
213
+ fill: "hsl(var(--muted-foreground))"
214
+ } : void 0
215
+ }
216
+ ),
217
+ isHorizontal ? /* @__PURE__ */ jsx(
218
+ YAxis,
219
+ {
220
+ type: "category",
221
+ dataKey: xAxis.dataKey,
222
+ tick: { fontSize: 10, fill: "hsl(var(--muted-foreground))" },
223
+ tickLine: false,
224
+ axisLine: false,
225
+ width: yAxis?.width ?? 80,
226
+ tickFormatter: xAxis.tickFormatter,
227
+ label: xAxis.label ? {
228
+ value: xAxis.label,
229
+ angle: -90,
230
+ position: "insideLeft",
231
+ fontSize: 11,
232
+ fill: "hsl(var(--muted-foreground))"
233
+ } : void 0
234
+ }
235
+ ) : /* @__PURE__ */ jsx(
236
+ YAxis,
237
+ {
238
+ domain: yAxis?.domain ?? ["auto", "auto"],
239
+ tick: { fontSize: 10, fill: "hsl(var(--muted-foreground))" },
240
+ tickLine: false,
241
+ axisLine: false,
242
+ width: yAxis?.width ?? 30,
243
+ tickFormatter: yAxis?.tickFormatter,
244
+ label: yAxis?.label ? {
245
+ value: yAxis.label,
246
+ angle: -90,
247
+ position: "insideLeft",
248
+ fontSize: 11,
249
+ fill: "hsl(var(--muted-foreground))"
250
+ } : void 0
251
+ }
252
+ ),
253
+ tooltip && /* @__PURE__ */ jsx(
254
+ Tooltip,
255
+ {
256
+ contentStyle: {
257
+ background: "hsl(var(--card))",
258
+ border: "1px solid hsl(var(--border))",
259
+ borderRadius: 6,
260
+ fontSize: 11
261
+ },
262
+ labelStyle: {
263
+ color: "hsl(var(--foreground))",
264
+ fontWeight: 500,
265
+ marginBottom: 4
266
+ },
267
+ itemStyle: {
268
+ color: "hsl(var(--foreground))"
269
+ },
270
+ cursor: { fill: "hsl(var(--accent))", fillOpacity: 0.3 }
271
+ }
272
+ ),
273
+ legendConfig && /* @__PURE__ */ jsx(
274
+ Legend,
275
+ {
276
+ verticalAlign: legendConfig.position ?? "top",
277
+ align: legendConfig.align ?? "right",
278
+ wrapperStyle: { fontSize: 11, paddingBottom: 4 }
279
+ }
280
+ ),
281
+ series.map((s, index) => /* @__PURE__ */ jsx(
282
+ Bar,
283
+ {
284
+ dataKey: s.dataKey,
285
+ name: s.name,
286
+ fill: getChartColor(index, s.color),
287
+ stackId: s.stackId,
288
+ radius: s.radius ?? 0,
289
+ isAnimationActive: animate
290
+ },
291
+ s.dataKey
292
+ ))
293
+ ]
294
+ }
295
+ ) }) });
296
+ }
297
+ );
298
+ BarChart.displayName = "BarChart";
299
+
300
+ export { BarChart, CHART_COLORS, LineChart, getChartColor };
301
+ //# sourceMappingURL=index.js.map
302
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/line-chart.tsx","../src/bar-chart.tsx"],"names":["RechartsLineChart","React2","jsx","cn","ResponsiveContainer","jsxs","RechartsBarChart","CartesianGrid","XAxis","YAxis","Tooltip","Legend"],"mappings":";;;;;;AAsBO,IAAM,YAAA,GAAe;AAAA,EAC1B,qBAAA;AAAA,EACA,qBAAA;AAAA,EACA,qBAAA;AA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,QAAA,EAAU,EAAA,EAAI,eAAe,CAAA;AAAE;AAAA,WACjD;AAAA,UAGD,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA,EAAG,0BACdT,GAAAA;AAAA,YAAC,GAAA;AAAA,YAAA;AAAA,cAEC,SAAS,CAAA,CAAE,OAAA;AAAA,cACX,MAAM,CAAA,CAAE,IAAA;AAAA,cACR,IAAA,EAAM,aAAA,CAAc,KAAA,EAAO,CAAA,CAAE,KAAK,CAAA;AAAA,cAClC,SAAS,CAAA,CAAE,OAAA;AAAA,cACX,MAAA,EAAQ,EAAE,MAAA,IAAU,CAAA;AAAA,cACpB,iBAAA,EAAmB;AAAA,aAAA;AAAA,YANd,CAAA,CAAE;AAAA,WAQV;AAAA;AAAA;AAAA,OAEL,CAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEA,QAAA,CAAS,WAAA,GAAc,UAAA","file":"index.js","sourcesContent":["/**\n * LineChart\n *\n * A reusable, theme-aware line chart component built on Recharts.\n * Supports multiple series, configurable axes, animations, and styling\n * that integrates with the project's CSS variable theming system.\n */\n\nimport * as React from \"react\";\nimport {\n LineChart as RechartsLineChart,\n Line,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n Legend,\n ResponsiveContainer,\n} from \"recharts\";\nimport { cn } from \"@optilogic/core\";\n\n/** Theme-aware chart colors from CSS variables */\nexport const CHART_COLORS = [\n \"hsl(var(--chart-1))\",\n \"hsl(var(--chart-2))\",\n \"hsl(var(--chart-3))\",\n \"hsl(var(--chart-4))\",\n \"hsl(var(--chart-5))\",\n];\n\nexport function getChartColor(index: number, custom?: string): string {\n if (custom) return custom;\n return CHART_COLORS[index % CHART_COLORS.length] ?? \"hsl(var(--chart-1))\";\n}\n\n/** Configuration for a single line series */\nexport interface LineChartSeries {\n /** Key in data objects for this series' values */\n dataKey: string;\n /** Display name shown in legend/tooltip */\n name: string;\n /** Custom color (defaults to theme chart colors) */\n color?: string;\n /** Line stroke width (default: 2) */\n strokeWidth?: number;\n /** Show dots on data points (default: false) */\n dot?: boolean;\n /** Line interpolation type */\n type?: \"monotone\" | \"linear\" | \"step\" | \"basis\" | \"natural\";\n}\n\n/** X-axis configuration */\nexport interface LineChartXAxis {\n /** Key in data objects for x-axis values */\n dataKey: string;\n /** Axis label */\n label?: string;\n /** Custom tick formatter */\n tickFormatter?: (value: unknown) => string;\n /** Minimum gap between ticks in pixels */\n minTickGap?: number;\n}\n\n/** Y-axis configuration */\nexport interface LineChartYAxis {\n /** Domain bounds [min, max] - use \"auto\" for automatic */\n domain?: [\n number | \"auto\" | \"dataMin\" | \"dataMax\",\n number | \"auto\" | \"dataMin\" | \"dataMax\"\n ];\n /** Axis label */\n label?: string;\n /** Custom tick formatter */\n tickFormatter?: (value: unknown) => string;\n /** Axis width in pixels */\n width?: number;\n}\n\n/** Grid configuration */\nexport interface LineChartGrid {\n /** Show vertical grid lines */\n vertical?: boolean;\n /** Show horizontal grid lines */\n horizontal?: boolean;\n}\n\n/** Legend configuration */\nexport interface LineChartLegend {\n /** Vertical position */\n position?: \"top\" | \"bottom\";\n /** Horizontal alignment */\n align?: \"left\" | \"center\" | \"right\";\n}\n\nexport interface LineChartProps {\n /** Array of data points */\n data: Record<string, unknown>[];\n /** Series configurations */\n series: LineChartSeries[];\n /** X-axis configuration */\n xAxis: LineChartXAxis;\n /** Y-axis configuration */\n yAxis?: LineChartYAxis;\n /** Grid configuration (true for default, false to hide, or object for fine control) */\n grid?: boolean | LineChartGrid;\n /** Show tooltip on hover */\n tooltip?: boolean;\n /** Legend configuration (true for default, false to hide, or object for fine control) */\n legend?: boolean | LineChartLegend;\n /** Enable animations */\n animate?: boolean;\n /** Additional CSS classes */\n className?: string;\n /** Chart height (default: 100%) */\n height?: number | string;\n /** Chart margins */\n margin?: { top?: number; right?: number; bottom?: number; left?: number };\n}\n\n/**\n * A flexible, theme-aware line chart component.\n *\n * @example\n * <LineChart\n * data={metrics}\n * series={[\n * { dataKey: \"cpu\", name: \"CPU %\" },\n * { dataKey: \"memory\", name: \"Memory %\", color: \"hsl(var(--success))\" }\n * ]}\n * xAxis={{ dataKey: \"time\", tickFormatter: formatTime }}\n * yAxis={{ domain: [0, 100] }}\n * animate\n * />\n */\nconst LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(\n (\n {\n data,\n series,\n xAxis,\n yAxis,\n grid = true,\n tooltip = true,\n legend = false,\n animate = false,\n className,\n height = \"100%\",\n margin = { top: 8, right: 12, left: 0, bottom: 4 },\n },\n ref\n ) => {\n const gridConfig = React.useMemo(() => {\n if (grid === false) return null;\n if (grid === true) return { vertical: false, horizontal: true };\n return grid;\n }, [grid]);\n\n const legendConfig = React.useMemo(() => {\n if (legend === false) return null;\n if (legend === true)\n return { position: \"top\" as const, align: \"right\" as const };\n return legend;\n }, [legend]);\n\n return (\n <div ref={ref} className={cn(\"w-full\", className)} style={{ height }}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsLineChart data={data} margin={margin}>\n {gridConfig && (\n <CartesianGrid\n strokeDasharray=\"3 3\"\n stroke=\"hsl(var(--divider))\"\n vertical={gridConfig.vertical ?? false}\n horizontal={gridConfig.horizontal ?? true}\n />\n )}\n\n <XAxis\n dataKey={xAxis.dataKey}\n tick={{ fontSize: 10, fill: \"hsl(var(--muted-foreground))\" }}\n tickLine={false}\n axisLine={false}\n minTickGap={xAxis.minTickGap ?? 24}\n tickFormatter={xAxis.tickFormatter}\n label={\n xAxis.label\n ? {\n value: xAxis.label,\n position: \"insideBottom\",\n offset: -4,\n fontSize: 11,\n fill: \"hsl(var(--muted-foreground))\",\n }\n : undefined\n }\n />\n\n <YAxis\n domain={yAxis?.domain ?? [\"auto\", \"auto\"]}\n tick={{ fontSize: 10, fill: \"hsl(var(--muted-foreground))\" }}\n tickLine={false}\n axisLine={false}\n width={yAxis?.width ?? 30}\n tickFormatter={yAxis?.tickFormatter}\n label={\n yAxis?.label\n ? {\n value: yAxis.label,\n angle: -90,\n position: \"insideLeft\",\n fontSize: 11,\n fill: \"hsl(var(--muted-foreground))\",\n }\n : undefined\n }\n />\n\n {tooltip && (\n <Tooltip\n contentStyle={{\n background: \"hsl(var(--card))\",\n border: \"1px solid hsl(var(--border))\",\n borderRadius: 6,\n fontSize: 11,\n }}\n labelStyle={{\n color: \"hsl(var(--foreground))\",\n fontWeight: 500,\n marginBottom: 4,\n }}\n itemStyle={{\n color: \"hsl(var(--foreground))\",\n }}\n />\n )}\n\n {legendConfig && (\n <Legend\n verticalAlign={legendConfig.position ?? \"top\"}\n align={legendConfig.align ?? \"right\"}\n wrapperStyle={{ fontSize: 11, paddingBottom: 4 }}\n />\n )}\n\n {series.map((s, index) => (\n <Line\n key={s.dataKey}\n type={s.type ?? \"monotone\"}\n dataKey={s.dataKey}\n name={s.name}\n stroke={getChartColor(index, s.color)}\n strokeWidth={s.strokeWidth ?? 2}\n dot={s.dot ?? false}\n isAnimationActive={animate}\n />\n ))}\n </RechartsLineChart>\n </ResponsiveContainer>\n </div>\n );\n }\n);\n\nLineChart.displayName = \"LineChart\";\n\nexport { LineChart };\n","/**\n * BarChart\n *\n * A reusable, theme-aware bar chart component built on Recharts.\n * Supports vertical/horizontal layouts, stacked/grouped bars,\n * configurable axes, animations, and styling that integrates\n * with the project's CSS variable theming system.\n */\n\nimport * as React from \"react\";\nimport {\n BarChart as RechartsBarChart,\n Bar,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n Legend,\n ResponsiveContainer,\n} from \"recharts\";\nimport { cn } from \"@optilogic/core\";\nimport { CHART_COLORS, getChartColor } from \"./line-chart\";\n\n/** Configuration for a single bar series */\nexport interface BarChartSeries {\n /** Key in data objects for this series' values */\n dataKey: string;\n /** Display name shown in legend/tooltip */\n name: string;\n /** Custom color (defaults to theme chart colors) */\n color?: string;\n /** Stack ID - bars with the same stackId will be stacked */\n stackId?: string;\n /** Border radius for bars */\n radius?: number | [number, number, number, number];\n}\n\n/** X-axis configuration */\nexport interface BarChartXAxis {\n /** Key in data objects for x-axis values (category axis in vertical layout) */\n dataKey: string;\n /** Axis label */\n label?: string;\n /** Custom tick formatter */\n tickFormatter?: (value: unknown) => string;\n /** Minimum gap between ticks in pixels */\n minTickGap?: number;\n}\n\n/** Y-axis configuration */\nexport interface BarChartYAxis {\n /** Domain bounds [min, max] - use \"auto\" for automatic */\n domain?: [\n number | \"auto\" | \"dataMin\" | \"dataMax\",\n number | \"auto\" | \"dataMin\" | \"dataMax\"\n ];\n /** Axis label */\n label?: string;\n /** Custom tick formatter */\n tickFormatter?: (value: unknown) => string;\n /** Axis width in pixels */\n width?: number;\n}\n\n/** Grid configuration */\nexport interface BarChartGrid {\n /** Show vertical grid lines */\n vertical?: boolean;\n /** Show horizontal grid lines */\n horizontal?: boolean;\n}\n\n/** Legend configuration */\nexport interface BarChartLegend {\n /** Vertical position */\n position?: \"top\" | \"bottom\";\n /** Horizontal alignment */\n align?: \"left\" | \"center\" | \"right\";\n}\n\nexport interface BarChartProps {\n /** Array of data points */\n data: Record<string, unknown>[];\n /** Series configurations */\n series: BarChartSeries[];\n /** Chart layout orientation */\n layout?: \"vertical\" | \"horizontal\";\n /** X-axis configuration */\n xAxis: BarChartXAxis;\n /** Y-axis configuration */\n yAxis?: BarChartYAxis;\n /** Grid configuration (true for default, false to hide, or object for fine control) */\n grid?: boolean | BarChartGrid;\n /** Show tooltip on hover */\n tooltip?: boolean;\n /** Legend configuration (true for default, false to hide, or object for fine control) */\n legend?: boolean | BarChartLegend;\n /** Enable animations */\n animate?: boolean;\n /** Bar width in pixels */\n barSize?: number;\n /** Gap between bars in a group (pixels) */\n barGap?: number;\n /** Gap between bar groups (pixels or percentage) */\n barCategoryGap?: number | string;\n /** Additional CSS classes */\n className?: string;\n /** Chart height (default: 100%) */\n height?: number | string;\n /** Chart margins */\n margin?: { top?: number; right?: number; bottom?: number; left?: number };\n}\n\n/**\n * A flexible, theme-aware bar chart component.\n *\n * @example\n * // Grouped bar chart\n * <BarChart\n * data={salesData}\n * series={[\n * { dataKey: \"revenue\", name: \"Revenue\" },\n * { dataKey: \"profit\", name: \"Profit\" }\n * ]}\n * xAxis={{ dataKey: \"month\" }}\n * legend={{ position: \"top\" }}\n * />\n *\n * @example\n * // Stacked bar chart\n * <BarChart\n * data={salesData}\n * series={[\n * { dataKey: \"q1\", name: \"Q1\", stackId: \"revenue\" },\n * { dataKey: \"q2\", name: \"Q2\", stackId: \"revenue\" }\n * ]}\n * xAxis={{ dataKey: \"category\" }}\n * />\n */\nconst BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(\n (\n {\n data,\n series,\n layout = \"vertical\",\n xAxis,\n yAxis,\n grid = true,\n tooltip = true,\n legend = false,\n animate = true,\n barSize,\n barGap,\n barCategoryGap,\n className,\n height = \"100%\",\n margin = { top: 8, right: 12, left: 0, bottom: 4 },\n },\n ref\n ) => {\n const gridConfig = React.useMemo(() => {\n if (grid === false) return null;\n if (grid === true) return { vertical: false, horizontal: true };\n return grid;\n }, [grid]);\n\n const legendConfig = React.useMemo(() => {\n if (legend === false) return null;\n if (legend === true)\n return { position: \"top\" as const, align: \"right\" as const };\n return legend;\n }, [legend]);\n\n const isHorizontal = layout === \"horizontal\";\n\n return (\n <div ref={ref} className={cn(\"w-full\", className)} style={{ height }}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsBarChart\n data={data}\n layout={isHorizontal ? \"vertical\" : \"horizontal\"}\n margin={margin}\n barSize={barSize}\n barGap={barGap}\n barCategoryGap={barCategoryGap}\n >\n {gridConfig && (\n <CartesianGrid\n strokeDasharray=\"3 3\"\n stroke=\"hsl(var(--divider))\"\n vertical={\n isHorizontal\n ? (gridConfig.horizontal ?? true)\n : (gridConfig.vertical ?? false)\n }\n horizontal={\n isHorizontal\n ? (gridConfig.vertical ?? false)\n : (gridConfig.horizontal ?? true)\n }\n />\n )}\n\n {isHorizontal ? (\n <XAxis\n type=\"number\"\n domain={yAxis?.domain ?? [\"auto\", \"auto\"]}\n tick={{ fontSize: 10, fill: \"hsl(var(--muted-foreground))\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={yAxis?.tickFormatter}\n label={\n yAxis?.label\n ? {\n value: yAxis.label,\n position: \"insideBottom\",\n offset: -4,\n fontSize: 11,\n fill: \"hsl(var(--muted-foreground))\",\n }\n : undefined\n }\n />\n ) : (\n <XAxis\n dataKey={xAxis.dataKey}\n tick={{ fontSize: 10, fill: \"hsl(var(--muted-foreground))\" }}\n tickLine={false}\n axisLine={false}\n minTickGap={xAxis.minTickGap ?? 24}\n tickFormatter={xAxis.tickFormatter}\n label={\n xAxis.label\n ? {\n value: xAxis.label,\n position: \"insideBottom\",\n offset: -4,\n fontSize: 11,\n fill: \"hsl(var(--muted-foreground))\",\n }\n : undefined\n }\n />\n )}\n\n {isHorizontal ? (\n <YAxis\n type=\"category\"\n dataKey={xAxis.dataKey}\n tick={{ fontSize: 10, fill: \"hsl(var(--muted-foreground))\" }}\n tickLine={false}\n axisLine={false}\n width={yAxis?.width ?? 80}\n tickFormatter={xAxis.tickFormatter}\n label={\n xAxis.label\n ? {\n value: xAxis.label,\n angle: -90,\n position: \"insideLeft\",\n fontSize: 11,\n fill: \"hsl(var(--muted-foreground))\",\n }\n : undefined\n }\n />\n ) : (\n <YAxis\n domain={yAxis?.domain ?? [\"auto\", \"auto\"]}\n tick={{ fontSize: 10, fill: \"hsl(var(--muted-foreground))\" }}\n tickLine={false}\n axisLine={false}\n width={yAxis?.width ?? 30}\n tickFormatter={yAxis?.tickFormatter}\n label={\n yAxis?.label\n ? {\n value: yAxis.label,\n angle: -90,\n position: \"insideLeft\",\n fontSize: 11,\n fill: \"hsl(var(--muted-foreground))\",\n }\n : undefined\n }\n />\n )}\n\n {tooltip && (\n <Tooltip\n contentStyle={{\n background: \"hsl(var(--card))\",\n border: \"1px solid hsl(var(--border))\",\n borderRadius: 6,\n fontSize: 11,\n }}\n labelStyle={{\n color: \"hsl(var(--foreground))\",\n fontWeight: 500,\n marginBottom: 4,\n }}\n itemStyle={{\n color: \"hsl(var(--foreground))\",\n }}\n cursor={{ fill: \"hsl(var(--accent))\", fillOpacity: 0.3 }}\n />\n )}\n\n {legendConfig && (\n <Legend\n verticalAlign={legendConfig.position ?? \"top\"}\n align={legendConfig.align ?? \"right\"}\n wrapperStyle={{ fontSize: 11, paddingBottom: 4 }}\n />\n )}\n\n {series.map((s, index) => (\n <Bar\n key={s.dataKey}\n dataKey={s.dataKey}\n name={s.name}\n fill={getChartColor(index, s.color)}\n stackId={s.stackId}\n radius={s.radius ?? 0}\n isAnimationActive={animate}\n />\n ))}\n </RechartsBarChart>\n </ResponsiveContainer>\n </div>\n );\n }\n);\n\nBarChart.displayName = \"BarChart\";\n\nexport { BarChart };\n"]}
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@optilogic/charts",
3
+ "version": "1.0.0-beta.0",
4
+ "description": "Chart components for Optilogic - LineChart and BarChart built on Recharts",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/index.d.cts",
17
+ "default": "./dist/index.cjs"
18
+ }
19
+ }
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "src",
24
+ "README.md"
25
+ ],
26
+ "dependencies": {
27
+ "@optilogic/core": "1.0.0-beta.0"
28
+ },
29
+ "peerDependencies": {
30
+ "react": "^18.0.0 || ^19.0.0",
31
+ "react-dom": "^18.0.0 || ^19.0.0",
32
+ "recharts": "^2.12.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/react": "^18.3.0",
36
+ "@types/react-dom": "^18.3.0",
37
+ "react": "^18.3.1",
38
+ "react-dom": "^18.3.1",
39
+ "recharts": "^2.14.1",
40
+ "tsup": "^8.3.5",
41
+ "typescript": "^5.7.2"
42
+ },
43
+ "keywords": [
44
+ "react",
45
+ "charts",
46
+ "recharts",
47
+ "line-chart",
48
+ "bar-chart",
49
+ "optilogic"
50
+ ],
51
+ "license": "MIT",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "https://github.com/optilogic/opti-ui"
55
+ },
56
+ "publishConfig": {
57
+ "access": "public"
58
+ },
59
+ "scripts": {
60
+ "build": "tsup",
61
+ "dev": "tsup --watch",
62
+ "typecheck": "tsc --noEmit",
63
+ "lint": "eslint src --ext .ts,.tsx",
64
+ "clean": "rm -rf dist .turbo"
65
+ }
66
+ }