@sqlrooms/recharts 0.10.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/LICENSE.md +9 -0
- package/README.md +1 -0
- package/dist/chart.d.ts +63 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +132 -0
- package/dist/chart.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/package.json +36 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright 2025 Ilya Boyandin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
A package that provides Recharts integration for SQLRooms based on [shadcn Chart component](https://ui.shadcn.com/docs/components/chart).
|
package/dist/chart.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RechartsPrimitive from 'recharts';
|
|
3
|
+
declare const THEMES: {
|
|
4
|
+
readonly light: "";
|
|
5
|
+
readonly dark: ".dark";
|
|
6
|
+
};
|
|
7
|
+
export type ChartConfig = {
|
|
8
|
+
[k in string]: {
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
icon?: React.ComponentType;
|
|
11
|
+
} & ({
|
|
12
|
+
color?: string;
|
|
13
|
+
theme?: never;
|
|
14
|
+
} | {
|
|
15
|
+
color?: never;
|
|
16
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
declare const ChartContainer: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
20
|
+
config: ChartConfig;
|
|
21
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
22
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const ChartStyle: ({ id, config }: {
|
|
24
|
+
id: string;
|
|
25
|
+
config: ChartConfig;
|
|
26
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
28
|
+
declare const ChartTooltipContent: React.ForwardRefExoticComponent<Omit<RechartsPrimitive.DefaultTooltipContentProps<import("recharts/types/component/DefaultTooltipContent").ValueType, import("recharts/types/component/DefaultTooltipContent").NameType> & {
|
|
29
|
+
accessibilityLayer?: boolean;
|
|
30
|
+
active?: boolean | undefined;
|
|
31
|
+
includeHidden?: boolean | undefined;
|
|
32
|
+
allowEscapeViewBox?: import("recharts/types/util/types").AllowInDimension;
|
|
33
|
+
animationDuration?: import("recharts/types/util/types").AnimationDuration;
|
|
34
|
+
animationEasing?: import("recharts/types/util/types").AnimationTiming;
|
|
35
|
+
content?: import("recharts/types/component/Tooltip").ContentType<import("recharts/types/component/DefaultTooltipContent").ValueType, import("recharts/types/component/DefaultTooltipContent").NameType> | undefined;
|
|
36
|
+
coordinate?: Partial<import("recharts/types/util/types").Coordinate>;
|
|
37
|
+
cursor?: boolean | React.ReactElement | React.SVGProps<SVGElement>;
|
|
38
|
+
filterNull?: boolean;
|
|
39
|
+
defaultIndex?: number;
|
|
40
|
+
isAnimationActive?: boolean;
|
|
41
|
+
offset?: number;
|
|
42
|
+
payloadUniqBy?: import("recharts/types/util/payload/getUniqPayload").UniqueOption<import("recharts/types/component/DefaultTooltipContent").Payload<import("recharts/types/component/DefaultTooltipContent").ValueType, import("recharts/types/component/DefaultTooltipContent").NameType>> | undefined;
|
|
43
|
+
position?: Partial<import("recharts/types/util/types").Coordinate>;
|
|
44
|
+
reverseDirection?: import("recharts/types/util/types").AllowInDimension;
|
|
45
|
+
shared?: boolean;
|
|
46
|
+
trigger?: "hover" | "click";
|
|
47
|
+
useTranslate3d?: boolean;
|
|
48
|
+
viewBox?: import("recharts/types/util/types").CartesianViewBox;
|
|
49
|
+
wrapperStyle?: React.CSSProperties;
|
|
50
|
+
} & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
51
|
+
hideLabel?: boolean;
|
|
52
|
+
hideIndicator?: boolean;
|
|
53
|
+
indicator?: "line" | "dot" | "dashed";
|
|
54
|
+
nameKey?: string;
|
|
55
|
+
labelKey?: string;
|
|
56
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
57
|
+
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
58
|
+
declare const ChartLegendContent: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
|
59
|
+
hideIcon?: boolean;
|
|
60
|
+
nameKey?: string;
|
|
61
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
62
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
|
63
|
+
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../src/chart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAC;AAK9C,QAAA,MAAM,MAAM;;;CAAsC,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG;KACvB,CAAC,IAAI,MAAM,GAAG;QACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACxB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC5B,GAAG,CACA;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAC,GAC/B;QAAC,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,OAAO,MAAM,EAAE,MAAM,CAAC,CAAA;KAAC,CAC9D;CACF,CAAC;AAkBF,QAAA,MAAM,cAAc;YAGR,WAAW;cACT,KAAK,CAAC,cAAc,CAC5B,OAAO,iBAAiB,CAAC,mBAAmB,CAC7C,CAAC,UAAU,CAAC;gDAwBf,CAAC;AAGH,QAAA,MAAM,UAAU,GAAI,gBAAc;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAC,mDA+BlE,CAAC;AAEF,QAAA,MAAM,YAAY,kCAA4B,CAAC;AAE/C,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;gBAIP,OAAO;oBACH,OAAO;gBACX,MAAM,GAAG,KAAK,GAAG,QAAQ;cAC3B,MAAM;eACL,MAAM;gDA+ItB,CAAC;AAGF,QAAA,MAAM,WAAW,iCAA2B,CAAC;AAE7C,QAAA,MAAM,kBAAkB;eAIP,OAAO;cACR,MAAM;gDAkDrB,CAAC;AA0CF,OAAO,EACL,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,UAAU,GACX,CAAC"}
|
package/dist/chart.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as RechartsPrimitive from 'recharts';
|
|
5
|
+
import { cn } from '@sqlrooms/ui';
|
|
6
|
+
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
7
|
+
const THEMES = { light: '', dark: '.dark' };
|
|
8
|
+
const ChartContext = React.createContext(null);
|
|
9
|
+
function useChart() {
|
|
10
|
+
const context = React.useContext(ChartContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error('useChart must be used within a <ChartContainer />');
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
const ChartContainer = React.forwardRef(({ id, className, children, config, ...props }, ref) => {
|
|
17
|
+
const uniqueId = React.useId();
|
|
18
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;
|
|
19
|
+
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-chart": chartId, ref: ref, className: cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] }) }));
|
|
20
|
+
});
|
|
21
|
+
ChartContainer.displayName = 'Chart';
|
|
22
|
+
const ChartStyle = ({ id, config }) => {
|
|
23
|
+
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
|
|
24
|
+
if (!colorConfig.length) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return (_jsx("style", { dangerouslySetInnerHTML: {
|
|
28
|
+
__html: Object.entries(THEMES)
|
|
29
|
+
.map(([theme, prefix]) => `
|
|
30
|
+
${prefix} [data-chart=${id}] {
|
|
31
|
+
${colorConfig
|
|
32
|
+
.map(([key, itemConfig]) => {
|
|
33
|
+
const color = itemConfig.theme?.[theme] ||
|
|
34
|
+
itemConfig.color;
|
|
35
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
36
|
+
})
|
|
37
|
+
.join('\n')}
|
|
38
|
+
}
|
|
39
|
+
`)
|
|
40
|
+
.join('\n'),
|
|
41
|
+
} }));
|
|
42
|
+
};
|
|
43
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
44
|
+
const ChartTooltipContent = React.forwardRef(({ active, payload, className, indicator = 'dot', hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }, ref) => {
|
|
45
|
+
const { config } = useChart();
|
|
46
|
+
const tooltipLabel = React.useMemo(() => {
|
|
47
|
+
if (hideLabel || !payload?.length) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
const [item] = payload;
|
|
51
|
+
const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;
|
|
52
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
53
|
+
const value = !labelKey && typeof label === 'string'
|
|
54
|
+
? config[label]?.label || label
|
|
55
|
+
: itemConfig?.label;
|
|
56
|
+
if (labelFormatter) {
|
|
57
|
+
return (_jsx("div", { className: cn('font-medium', labelClassName), children: labelFormatter(value, payload) }));
|
|
58
|
+
}
|
|
59
|
+
if (!value) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return _jsx("div", { className: cn('font-medium', labelClassName), children: value });
|
|
63
|
+
}, [
|
|
64
|
+
label,
|
|
65
|
+
labelFormatter,
|
|
66
|
+
payload,
|
|
67
|
+
hideLabel,
|
|
68
|
+
labelClassName,
|
|
69
|
+
config,
|
|
70
|
+
labelKey,
|
|
71
|
+
]);
|
|
72
|
+
if (!active || !payload?.length) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
const nestLabel = payload.length === 1 && indicator !== 'dot';
|
|
76
|
+
return (_jsxs("div", { ref: ref, className: cn('border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl', className), children: [!nestLabel ? tooltipLabel : null, _jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
|
|
77
|
+
const key = `${nameKey || item.name || item.dataKey || 'value'}`;
|
|
78
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
79
|
+
const indicatorColor = color || item.payload.fill || item.color;
|
|
80
|
+
return (_jsx("div", { className: cn('[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5', indicator === 'dot' && 'items-center'), children: formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (_jsxs(_Fragment, { children: [itemConfig?.icon ? (_jsx(itemConfig.icon, {})) : (!hideIndicator && (_jsx("div", { className: cn('shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]', {
|
|
81
|
+
'h-2.5 w-2.5': indicator === 'dot',
|
|
82
|
+
'w-1': indicator === 'line',
|
|
83
|
+
'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',
|
|
84
|
+
'my-0.5': nestLabel && indicator === 'dashed',
|
|
85
|
+
}), style: {
|
|
86
|
+
'--color-bg': indicatorColor,
|
|
87
|
+
'--color-border': indicatorColor,
|
|
88
|
+
} }))), _jsxs("div", { className: cn('flex flex-1 justify-between leading-none', nestLabel ? 'items-end' : 'items-center'), children: [_jsxs("div", { className: "grid gap-1.5", children: [nestLabel ? tooltipLabel : null, _jsx("span", { className: "text-muted-foreground", children: itemConfig?.label || item.name })] }), item.value && (_jsx("span", { className: "text-foreground font-mono font-medium tabular-nums", children: item.value.toLocaleString() }))] })] })) }, item.dataKey));
|
|
89
|
+
}) })] }));
|
|
90
|
+
});
|
|
91
|
+
ChartTooltipContent.displayName = 'ChartTooltip';
|
|
92
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
93
|
+
const ChartLegendContent = React.forwardRef(({ className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey }, ref) => {
|
|
94
|
+
const { config } = useChart();
|
|
95
|
+
if (!payload?.length) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
return (_jsx("div", { ref: ref, className: cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className), children: payload.map((item) => {
|
|
99
|
+
const key = `${nameKey || item.dataKey || 'value'}`;
|
|
100
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
101
|
+
return (_jsxs("div", { className: cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3'), children: [itemConfig?.icon && !hideIcon ? (_jsx(itemConfig.icon, {})) : (_jsx("div", { className: "h-2 w-2 shrink-0 rounded-[2px]", style: {
|
|
102
|
+
backgroundColor: item.color,
|
|
103
|
+
} })), itemConfig?.label] }, item.value));
|
|
104
|
+
}) }));
|
|
105
|
+
});
|
|
106
|
+
ChartLegendContent.displayName = 'ChartLegend';
|
|
107
|
+
// Helper to extract item config from a payload.
|
|
108
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
109
|
+
if (typeof payload !== 'object' || payload === null) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
const payloadPayload = 'payload' in payload &&
|
|
113
|
+
typeof payload.payload === 'object' &&
|
|
114
|
+
payload.payload !== null
|
|
115
|
+
? payload.payload
|
|
116
|
+
: undefined;
|
|
117
|
+
let configLabelKey = key;
|
|
118
|
+
if (key in payload &&
|
|
119
|
+
typeof payload[key] === 'string') {
|
|
120
|
+
configLabelKey = payload[key];
|
|
121
|
+
}
|
|
122
|
+
else if (payloadPayload &&
|
|
123
|
+
key in payloadPayload &&
|
|
124
|
+
typeof payloadPayload[key] === 'string') {
|
|
125
|
+
configLabelKey = payloadPayload[key];
|
|
126
|
+
}
|
|
127
|
+
return configLabelKey in config
|
|
128
|
+
? config[configLabelKey]
|
|
129
|
+
: config[key];
|
|
130
|
+
}
|
|
131
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
|
132
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","sourceRoot":"","sources":["../src/chart.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAC,EAAE,EAAC,MAAM,cAAc,CAAC;AAEhC,uCAAuC;AACvC,MAAM,MAAM,GAAG,EAAC,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAU,CAAC;AAgBnD,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAA2B,IAAI,CAAC,CAAC;AAEzE,SAAS,QAAQ;IACf,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAE/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAA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K,KAfb,IAAI,CAAC,KAAK,CAgBX,CACP,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,kBAAkB,CAAC,WAAW,GAAG,aAAa,CAAC;AAE/C,gDAAgD;AAChD,SAAS,2BAA2B,CAClC,MAAmB,EACnB,OAAgB,EAChB,GAAW;IAEX,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACpD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,cAAc,GAClB,SAAS,IAAI,OAAO;QACpB,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ;QACnC,OAAO,CAAC,OAAO,KAAK,IAAI;QACtB,CAAC,CAAC,OAAO,CAAC,OAAO;QACjB,CAAC,CAAC,SAAS,CAAC;IAEhB,IAAI,cAAc,GAAW,GAAG,CAAC;IAEjC,IACE,GAAG,IAAI,OAAO;QACd,OAAO,OAAO,CAAC,GAA2B,CAAC,KAAK,QAAQ,EACxD,CAAC;QACD,cAAc,GAAG,OAAO,CAAC,GAA2B,CAAW,CAAC;IAClE,CAAC;SAAM,IACL,cAAc;QACd,GAAG,IAAI,cAAc;QACrB,OAAO,cAAc,CAAC,GAAkC,CAAC,KAAK,QAAQ,EACtE,CAAC;QACD,cAAc,GAAG,cAAc,CAC7B,GAAkC,CACzB,CAAC;IACd,CAAC;IAED,OAAO,cAAc,IAAI,MAAM;QAC7B,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC;QACxB,CAAC,CAAC,MAAM,CAAC,GAA0B,CAAC,CAAC;AACzC,CAAC;AAED,OAAO,EACL,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,UAAU,GACX,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport {cn} from '@sqlrooms/ui';\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = {light: '', dark: '.dark'} as const;\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & (\n | {color?: string; theme?: never}\n | {color?: never; theme: Record<keyof typeof THEMES, string>}\n );\n};\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nconst ChartContainer = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & {\n config: ChartConfig;\n children: React.ComponentProps<\n typeof RechartsPrimitive.ResponsiveContainer\n >['children'];\n }\n>(({id, className, children, config, ...props}, ref) => {\n const uniqueId = React.useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{config}}>\n <div\n data-chart={chartId}\n ref={ref}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n});\nChartContainer.displayName = 'Chart';\n\nconst ChartStyle = ({id, config}: {id: string; config: ChartConfig}) => {\n const colorConfig = Object.entries(config).filter(\n ([, config]) => config.theme || config.color,\n );\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color =\n itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||\n itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n}\n`,\n )\n .join('\\n'),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nconst ChartTooltipContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n }\n>(\n (\n {\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n },\n ref,\n ) => {\n const {config} = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value =\n !labelKey && typeof label === 'string'\n ? config[label as keyof typeof config]?.label || label\n : itemConfig?.label;\n\n if (labelFormatter) {\n return (\n <div className={cn('font-medium', labelClassName)}>\n {labelFormatter(value, payload)}\n </div>\n );\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [\n label,\n labelFormatter,\n payload,\n hideLabel,\n labelClassName,\n config,\n labelKey,\n ]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n ref={ref}\n className={cn(\n 'border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || item.payload.fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\n 'shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]',\n {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent':\n indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n },\n )}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">\n {itemConfig?.label || item.name}\n </span>\n </div>\n {item.value && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n },\n);\nChartTooltipContent.displayName = 'ChartTooltip';\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nconst ChartLegendContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> &\n Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {\n hideIcon?: boolean;\n nameKey?: string;\n }\n>(\n (\n {className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey},\n ref,\n ) => {\n const {config} = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'flex items-center justify-center gap-4',\n verticalAlign === 'top' ? 'pb-3' : 'pt-3',\n className,\n )}\n >\n {payload.map((item) => {\n const key = `${nameKey || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={item.value}\n className={cn(\n '[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3',\n )}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n },\n);\nChartLegendContent.displayName = 'ChartLegend';\n\n// Helper to extract item config from a payload.\nfunction getPayloadConfigFromPayload(\n config: ChartConfig,\n payload: unknown,\n key: string,\n) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n 'payload' in payload &&\n typeof payload.payload === 'object' &&\n payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (\n key in payload &&\n typeof payload[key as keyof typeof payload] === 'string'\n ) {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[\n key as keyof typeof payloadPayload\n ] as string;\n }\n\n return configLabelKey in config\n ? config[configLabelKey]\n : config[key as keyof typeof config];\n}\n\nexport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n};\n"]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,KAAK,WAAW,GACjB,MAAM,SAAS,CAAC;AACjB,cAAc,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,UAAU,GAEX,MAAM,SAAS,CAAC;AACjB,cAAc,UAAU,CAAC","sourcesContent":["export {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n type ChartConfig,\n} from './chart';\nexport * from 'recharts';\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sqlrooms/recharts",
|
|
3
|
+
"version": "0.10.0",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"private": false,
|
|
9
|
+
"author": "Ilya Boyandin <ilya@boyandin.me>",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/sqlrooms/sqlrooms.git"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@sqlrooms/ui": "0.10.0",
|
|
23
|
+
"recharts": "^2.15.2"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"react": "*",
|
|
27
|
+
"react-dom": "*"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"dev": "tsc -w",
|
|
31
|
+
"build": "tsc",
|
|
32
|
+
"lint": "eslint .",
|
|
33
|
+
"typedoc": "typedoc"
|
|
34
|
+
},
|
|
35
|
+
"gitHead": "6d712cf47180d6fdcec05b4025b2eac26e9b63d5"
|
|
36
|
+
}
|