@yamada-ui/charts 1.0.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 +21 -0
- package/README.md +28 -0
- package/dist/area-chart-gradient.d.mts +11 -0
- package/dist/area-chart-gradient.d.ts +11 -0
- package/dist/area-chart-gradient.js +47 -0
- package/dist/area-chart-gradient.js.map +1 -0
- package/dist/area-chart-gradient.mjs +8 -0
- package/dist/area-chart-gradient.mjs.map +1 -0
- package/dist/area-chart-split.d.mts +10 -0
- package/dist/area-chart-split.d.ts +10 -0
- package/dist/area-chart-split.js +52 -0
- package/dist/area-chart-split.js.map +1 -0
- package/dist/area-chart-split.mjs +8 -0
- package/dist/area-chart-split.mjs.map +1 -0
- package/dist/area-chart.d.mts +36 -0
- package/dist/area-chart.d.ts +36 -0
- package/dist/area-chart.js +1249 -0
- package/dist/area-chart.js.map +1 -0
- package/dist/area-chart.mjs +21 -0
- package/dist/area-chart.mjs.map +1 -0
- package/dist/bar-chart.d.mts +33 -0
- package/dist/bar-chart.d.ts +33 -0
- package/dist/bar-chart.js +1053 -0
- package/dist/bar-chart.js.map +1 -0
- package/dist/bar-chart.mjs +19 -0
- package/dist/bar-chart.mjs.map +1 -0
- package/dist/chart-legend.d.mts +12 -0
- package/dist/chart-legend.d.ts +12 -0
- package/dist/chart-legend.js +87 -0
- package/dist/chart-legend.js.map +1 -0
- package/dist/chart-legend.mjs +11 -0
- package/dist/chart-legend.mjs.map +1 -0
- package/dist/chart-tooltip.d.mts +12 -0
- package/dist/chart-tooltip.d.ts +12 -0
- package/dist/chart-tooltip.js +120 -0
- package/dist/chart-tooltip.js.map +1 -0
- package/dist/chart-tooltip.mjs +11 -0
- package/dist/chart-tooltip.mjs.map +1 -0
- package/dist/chart-utils.d.mts +9 -0
- package/dist/chart-utils.d.ts +9 -0
- package/dist/chart-utils.js +45 -0
- package/dist/chart-utils.js.map +1 -0
- package/dist/chart-utils.mjs +10 -0
- package/dist/chart-utils.mjs.map +1 -0
- package/dist/chart.types.d.mts +65 -0
- package/dist/chart.types.d.ts +65 -0
- package/dist/chart.types.js +20 -0
- package/dist/chart.types.js.map +1 -0
- package/dist/chart.types.mjs +2 -0
- package/dist/chart.types.mjs.map +1 -0
- package/dist/chunk-32BO2QEP.mjs +83 -0
- package/dist/chunk-32BO2QEP.mjs.map +1 -0
- package/dist/chunk-3CY3IFRN.mjs +42 -0
- package/dist/chunk-3CY3IFRN.mjs.map +1 -0
- package/dist/chunk-3IBGJT6F.mjs +341 -0
- package/dist/chunk-3IBGJT6F.mjs.map +1 -0
- package/dist/chunk-5QCKM3B3.mjs +438 -0
- package/dist/chunk-5QCKM3B3.mjs.map +1 -0
- package/dist/chunk-AURFFNDQ.mjs +114 -0
- package/dist/chunk-AURFFNDQ.mjs.map +1 -0
- package/dist/chunk-FGDWJUA3.mjs +56 -0
- package/dist/chunk-FGDWJUA3.mjs.map +1 -0
- package/dist/chunk-GZLE5XDS.mjs +227 -0
- package/dist/chunk-GZLE5XDS.mjs.map +1 -0
- package/dist/chunk-HE6SM47L.mjs +234 -0
- package/dist/chunk-HE6SM47L.mjs.map +1 -0
- package/dist/chunk-LXZCGIND.mjs +33 -0
- package/dist/chunk-LXZCGIND.mjs.map +1 -0
- package/dist/chunk-MSIOYYWR.mjs +24 -0
- package/dist/chunk-MSIOYYWR.mjs.map +1 -0
- package/dist/chunk-PNE3JG54.mjs +29 -0
- package/dist/chunk-PNE3JG54.mjs.map +1 -0
- package/dist/chunk-QL3DB7OJ.mjs +21 -0
- package/dist/chunk-QL3DB7OJ.mjs.map +1 -0
- package/dist/chunk-RG5JQJXE.mjs +249 -0
- package/dist/chunk-RG5JQJXE.mjs.map +1 -0
- package/dist/chunk-RTTZPOUT.mjs +50 -0
- package/dist/chunk-RTTZPOUT.mjs.map +1 -0
- package/dist/chunk-RXWD2EJ2.mjs +56 -0
- package/dist/chunk-RXWD2EJ2.mjs.map +1 -0
- package/dist/chunk-TKLHZBVY.mjs +206 -0
- package/dist/chunk-TKLHZBVY.mjs.map +1 -0
- package/dist/chunk-WDSR6B47.mjs +324 -0
- package/dist/chunk-WDSR6B47.mjs.map +1 -0
- package/dist/chunk-WF3BD34Y.mjs +74 -0
- package/dist/chunk-WF3BD34Y.mjs.map +1 -0
- package/dist/chunk-YBAGOHS5.mjs +204 -0
- package/dist/chunk-YBAGOHS5.mjs.map +1 -0
- package/dist/chunk-YRY7MUCR.mjs +258 -0
- package/dist/chunk-YRY7MUCR.mjs.map +1 -0
- package/dist/index.d.mts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +2725 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +36 -0
- package/dist/index.mjs.map +1 -0
- package/dist/line-chart.d.mts +33 -0
- package/dist/line-chart.d.ts +33 -0
- package/dist/line-chart.js +1114 -0
- package/dist/line-chart.js.map +1 -0
- package/dist/line-chart.mjs +19 -0
- package/dist/line-chart.mjs.map +1 -0
- package/dist/radar-chart.d.mts +52 -0
- package/dist/radar-chart.d.ts +52 -0
- package/dist/radar-chart.js +940 -0
- package/dist/radar-chart.js.map +1 -0
- package/dist/radar-chart.mjs +16 -0
- package/dist/radar-chart.mjs.map +1 -0
- package/dist/rechart-properties.d.mts +24 -0
- package/dist/rechart-properties.d.ts +24 -0
- package/dist/rechart-properties.js +479 -0
- package/dist/rechart-properties.js.map +1 -0
- package/dist/rechart-properties.mjs +44 -0
- package/dist/rechart-properties.mjs.map +1 -0
- package/dist/use-area-chart.d.mts +118 -0
- package/dist/use-area-chart.d.ts +118 -0
- package/dist/use-area-chart.js +418 -0
- package/dist/use-area-chart.js.map +1 -0
- package/dist/use-area-chart.mjs +10 -0
- package/dist/use-area-chart.mjs.map +1 -0
- package/dist/use-bar-chart.d.mts +68 -0
- package/dist/use-bar-chart.d.ts +68 -0
- package/dist/use-bar-chart.js +288 -0
- package/dist/use-bar-chart.js.map +1 -0
- package/dist/use-bar-chart.mjs +10 -0
- package/dist/use-bar-chart.mjs.map +1 -0
- package/dist/use-chart-axis.d.mts +73 -0
- package/dist/use-chart-axis.d.ts +73 -0
- package/dist/use-chart-axis.js +227 -0
- package/dist/use-chart-axis.js.map +1 -0
- package/dist/use-chart-axis.mjs +10 -0
- package/dist/use-chart-axis.mjs.map +1 -0
- package/dist/use-chart-grid.d.mts +32 -0
- package/dist/use-chart-grid.d.ts +32 -0
- package/dist/use-chart-grid.js +92 -0
- package/dist/use-chart-grid.js.map +1 -0
- package/dist/use-chart-grid.mjs +10 -0
- package/dist/use-chart-grid.mjs.map +1 -0
- package/dist/use-chart-legend.d.mts +18 -0
- package/dist/use-chart-legend.d.ts +18 -0
- package/dist/use-chart-legend.js +81 -0
- package/dist/use-chart-legend.js.map +1 -0
- package/dist/use-chart-legend.mjs +9 -0
- package/dist/use-chart-legend.mjs.map +1 -0
- package/dist/use-chart-reference-line.d.mts +22 -0
- package/dist/use-chart-reference-line.d.ts +22 -0
- package/dist/use-chart-reference-line.js +105 -0
- package/dist/use-chart-reference-line.js.map +1 -0
- package/dist/use-chart-reference-line.mjs +10 -0
- package/dist/use-chart-reference-line.mjs.map +1 -0
- package/dist/use-chart-tooltip.d.mts +35 -0
- package/dist/use-chart-tooltip.d.ts +35 -0
- package/dist/use-chart-tooltip.js +121 -0
- package/dist/use-chart-tooltip.js.map +1 -0
- package/dist/use-chart-tooltip.mjs +9 -0
- package/dist/use-chart-tooltip.mjs.map +1 -0
- package/dist/use-chart.d.mts +33 -0
- package/dist/use-chart.d.ts +33 -0
- package/dist/use-chart.js +104 -0
- package/dist/use-chart.js.map +1 -0
- package/dist/use-chart.mjs +18 -0
- package/dist/use-chart.mjs.map +1 -0
- package/dist/use-line-chart.d.mts +92 -0
- package/dist/use-line-chart.d.ts +92 -0
- package/dist/use-line-chart.js +342 -0
- package/dist/use-line-chart.js.map +1 -0
- package/dist/use-line-chart.mjs +10 -0
- package/dist/use-line-chart.mjs.map +1 -0
- package/dist/use-radar-chart.d.mts +93 -0
- package/dist/use-radar-chart.d.ts +93 -0
- package/dist/use-radar-chart.js +471 -0
- package/dist/use-radar-chart.js.map +1 -0
- package/dist/use-radar-chart.mjs +10 -0
- package/dist/use-radar-chart.mjs.map +1 -0
- package/package.json +84 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { CSSUIObject } from '@yamada-ui/core';
|
2
|
+
import { Dict } from '@yamada-ui/utils';
|
3
|
+
import * as Recharts from 'recharts';
|
4
|
+
import { ReferenceLineProps, RequiredChartPropGetter } from './chart.types.mjs';
|
5
|
+
import 'react';
|
6
|
+
|
7
|
+
type UseChartReferenceLineOptions = {
|
8
|
+
/**
|
9
|
+
* Reference lines that should be displayed on the chart.
|
10
|
+
*/
|
11
|
+
referenceLineProps?: ReferenceLineProps[];
|
12
|
+
};
|
13
|
+
type UseChartReferenceLineProps = UseChartReferenceLineOptions & {
|
14
|
+
styles: Dict<CSSUIObject>;
|
15
|
+
};
|
16
|
+
declare const useChartReferenceLine: ({ referenceLineProps, styles, }: UseChartReferenceLineProps) => {
|
17
|
+
getReferenceLineProps: RequiredChartPropGetter<"div", {
|
18
|
+
index: number;
|
19
|
+
}, Omit<Recharts.ReferenceLineProps, "ref">>;
|
20
|
+
};
|
21
|
+
|
22
|
+
export { type UseChartReferenceLineOptions, useChartReferenceLine };
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { CSSUIObject } from '@yamada-ui/core';
|
2
|
+
import { Dict } from '@yamada-ui/utils';
|
3
|
+
import * as Recharts from 'recharts';
|
4
|
+
import { ReferenceLineProps, RequiredChartPropGetter } from './chart.types.js';
|
5
|
+
import 'react';
|
6
|
+
|
7
|
+
type UseChartReferenceLineOptions = {
|
8
|
+
/**
|
9
|
+
* Reference lines that should be displayed on the chart.
|
10
|
+
*/
|
11
|
+
referenceLineProps?: ReferenceLineProps[];
|
12
|
+
};
|
13
|
+
type UseChartReferenceLineProps = UseChartReferenceLineOptions & {
|
14
|
+
styles: Dict<CSSUIObject>;
|
15
|
+
};
|
16
|
+
declare const useChartReferenceLine: ({ referenceLineProps, styles, }: UseChartReferenceLineProps) => {
|
17
|
+
getReferenceLineProps: RequiredChartPropGetter<"div", {
|
18
|
+
index: number;
|
19
|
+
}, Omit<Recharts.ReferenceLineProps, "ref">>;
|
20
|
+
};
|
21
|
+
|
22
|
+
export { type UseChartReferenceLineOptions, useChartReferenceLine };
|
@@ -0,0 +1,105 @@
|
|
1
|
+
"use client"
|
2
|
+
"use strict";
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
20
|
+
|
21
|
+
// src/use-chart-reference-line.ts
|
22
|
+
var use_chart_reference_line_exports = {};
|
23
|
+
__export(use_chart_reference_line_exports, {
|
24
|
+
useChartReferenceLine: () => useChartReferenceLine
|
25
|
+
});
|
26
|
+
module.exports = __toCommonJS(use_chart_reference_line_exports);
|
27
|
+
var import_core2 = require("@yamada-ui/core");
|
28
|
+
var import_utils2 = require("@yamada-ui/utils");
|
29
|
+
var import_react = require("react");
|
30
|
+
|
31
|
+
// src/chart-utils.ts
|
32
|
+
var import_core = require("@yamada-ui/core");
|
33
|
+
var import_utils = require("@yamada-ui/utils");
|
34
|
+
var getClassName = (...styles) => (theme) => (0, import_utils.cx)(
|
35
|
+
...styles.map(
|
36
|
+
(style) => (0, import_utils.isString)(style) ? style : (0, import_core.getCSS)(style)(theme)
|
37
|
+
)
|
38
|
+
);
|
39
|
+
var getComponentProps = ([obj, keys], ...props) => (theme, isContain) => {
|
40
|
+
const [pickedProps, omittedProps] = (0, import_utils.splitObject)(obj, keys);
|
41
|
+
const className = getClassName(...props, omittedProps)(theme);
|
42
|
+
return !isContain ? [pickedProps, className] : { ...pickedProps, className };
|
43
|
+
};
|
44
|
+
|
45
|
+
// src/rechart-properties.ts
|
46
|
+
var referenceLineProperties = [
|
47
|
+
"xAxisId",
|
48
|
+
"yAxisId",
|
49
|
+
"x",
|
50
|
+
"y",
|
51
|
+
"ifOverflow",
|
52
|
+
"viewBox",
|
53
|
+
"xAxis",
|
54
|
+
"yAxis",
|
55
|
+
"label",
|
56
|
+
"isFront",
|
57
|
+
"strokeWidth",
|
58
|
+
"segment"
|
59
|
+
];
|
60
|
+
|
61
|
+
// src/use-chart-reference-line.ts
|
62
|
+
var useChartReferenceLine = ({
|
63
|
+
referenceLineProps = [],
|
64
|
+
styles
|
65
|
+
}) => {
|
66
|
+
const { theme } = (0, import_core2.useTheme)();
|
67
|
+
const styleClassName = (0, import_core2.getCSS)(styles.referenceLine)(theme);
|
68
|
+
const propList = (0, import_react.useMemo)(
|
69
|
+
() => referenceLineProps.map((props, index) => {
|
70
|
+
const [{ label: labelProp, ...rest }, propClassName] = getComponentProps(
|
71
|
+
[props, referenceLineProperties],
|
72
|
+
styleClassName
|
73
|
+
)(theme);
|
74
|
+
const color = `var(--ui-reference-line-${index})`;
|
75
|
+
const label = {
|
76
|
+
value: labelProp,
|
77
|
+
fill: color,
|
78
|
+
position: "insideBottomLeft",
|
79
|
+
...(0, import_utils2.isObject)(labelProp) ? labelProp : {}
|
80
|
+
};
|
81
|
+
return { propClassName, color, label, ...rest };
|
82
|
+
}),
|
83
|
+
[referenceLineProps, styleClassName, theme]
|
84
|
+
);
|
85
|
+
const getReferenceLineProps = (0, import_react.useCallback)(
|
86
|
+
({ index, className, ...props }, ref = null) => {
|
87
|
+
const { propClassName, color, label, ...rest } = propList[index];
|
88
|
+
return {
|
89
|
+
ref,
|
90
|
+
className: (0, import_utils2.cx)(className, propClassName),
|
91
|
+
stroke: color,
|
92
|
+
label,
|
93
|
+
...props,
|
94
|
+
...rest
|
95
|
+
};
|
96
|
+
},
|
97
|
+
[propList]
|
98
|
+
);
|
99
|
+
return { getReferenceLineProps };
|
100
|
+
};
|
101
|
+
// Annotate the CommonJS export names for ESM import in node:
|
102
|
+
0 && (module.exports = {
|
103
|
+
useChartReferenceLine
|
104
|
+
});
|
105
|
+
//# sourceMappingURL=use-chart-reference-line.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-chart-reference-line.ts","../src/chart-utils.ts","../src/rechart-properties.ts"],"sourcesContent":["import { getCSS, useTheme } from \"@yamada-ui/core\"\nimport type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { isObject, cx } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ReferenceLineProps, RequiredChartPropGetter } from \"./chart.types\"\nimport { referenceLineProperties } from \"./rechart-properties\"\n\nexport type UseChartReferenceLineOptions = {\n /**\n * Reference lines that should be displayed on the chart.\n */\n referenceLineProps?: ReferenceLineProps[]\n}\n\ntype UseChartReferenceLineProps = UseChartReferenceLineOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartReferenceLine = ({\n referenceLineProps = [],\n styles,\n}: UseChartReferenceLineProps) => {\n const { theme } = useTheme()\n const styleClassName = getCSS(styles.referenceLine)(theme)\n const propList = useMemo(\n () =>\n referenceLineProps.map((props, index) => {\n const [{ label: labelProp, ...rest }, propClassName] =\n getComponentProps(\n [props, referenceLineProperties],\n styleClassName,\n )(theme)\n\n const color = `var(--ui-reference-line-${index})`\n const label: Recharts.ReferenceLineProps[\"label\"] = {\n value: labelProp as string,\n fill: color,\n position: \"insideBottomLeft\",\n ...(isObject(labelProp) ? labelProp : {}),\n }\n\n return { propClassName, color, label, ...rest }\n }),\n [referenceLineProps, styleClassName, theme],\n )\n\n const getReferenceLineProps: RequiredChartPropGetter<\n \"div\",\n {\n index: number\n },\n Omit<Recharts.ReferenceLineProps, \"ref\">\n > = useCallback(\n ({ index, className, ...props }, ref = null) => {\n const { propClassName, color, label, ...rest } = propList[index]\n\n return {\n ref,\n className: cx(className, propClassName),\n stroke: color,\n label,\n ...(props as Recharts.ReferenceLineProps),\n ...rest,\n }\n },\n [propList],\n )\n\n return { getReferenceLineProps }\n}\n","import type { StyledTheme } from \"@yamada-ui/core\"\nimport { getCSS } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { cx, isString, splitObject } from \"@yamada-ui/utils\"\n\nexport const getClassName =\n (...styles: (Dict | string | undefined)[]) =>\n (theme: StyledTheme) =>\n cx(\n ...styles.map((style) =>\n isString(style) ? style : getCSS(style)(theme),\n ),\n )\n\nexport const getComponentProps =\n <T extends Dict, K extends keyof T>(\n [obj, keys]: [T, K[]],\n ...props: (Dict | string | undefined)[]\n ) =>\n <P extends boolean = false>(theme: StyledTheme, isContain?: P) => {\n const [pickedProps, omittedProps] = splitObject<T, K>(obj, keys)\n const className = getClassName(...props, omittedProps)(theme)\n\n return (\n !isContain ? [pickedProps, className] : { ...pickedProps, className }\n ) as P extends false\n ? [{ [P in K]: T[P] }, string]\n : { [P in K]: T[P] } & { className: string }\n }\n","import type { ComponentPropsWithoutRef } from \"react\"\nimport type * as Recharts from \"recharts\"\n\nexport const areaChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.AreaChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"stackOffset\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const barChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.BarChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"barCategoryGap\",\n \"barGap\",\n \"barSize\",\n \"maxBarSize\",\n \"stackOffset\",\n \"reverseStackOrder\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const lineChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.LineChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const radarChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.RadarChart\n>)[] = [\n \"width\",\n \"height\",\n \"data\",\n \"cx\",\n \"cy\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"margin\",\n \"onMouseEnter\",\n \"onClick\",\n]\n\nexport const referenceLineProperties: (keyof Recharts.ReferenceLineProps)[] = [\n \"xAxisId\",\n \"yAxisId\",\n \"x\",\n \"y\",\n \"ifOverflow\",\n \"viewBox\",\n \"xAxis\",\n \"yAxis\",\n \"label\",\n \"isFront\",\n \"strokeWidth\",\n \"segment\",\n]\n\nexport const containerProperties: (keyof Omit<\n Recharts.ResponsiveContainerProps,\n \"children\"\n>)[] = [\n \"aspect\",\n \"width\",\n \"height\",\n \"minWidth\",\n \"minHeight\",\n \"debounce\",\n \"onResize\",\n]\n\nexport const gridProperties: (keyof Recharts.CartesianGridProps)[] = [\n \"x\",\n \"y\",\n \"width\",\n \"height\",\n \"horizontal\",\n \"vertical\",\n \"horizontalPoints\",\n \"horizontalCoordinatesGenerator\",\n \"verticalPoints\",\n \"verticalCoordinatesGenerator\",\n \"fill\",\n \"fillOpacity\",\n \"strokeDasharray\",\n]\n\nexport const xAxisProperties: (keyof Recharts.XAxisProps)[] = [\n \"hide\",\n \"dataKey\",\n \"xAxisId\",\n \"width\",\n \"height\",\n \"orientation\",\n \"type\",\n \"allowDecimals\",\n \"allowDataOverflow\",\n \"allowDuplicatedCategory\",\n \"angle\",\n \"tickCount\",\n \"domain\",\n \"includeHidden\",\n \"interval\",\n \"padding\",\n \"minTickGap\",\n \"axisLine\",\n \"tickLine\",\n \"tickSize\",\n \"tickFormatter\",\n \"ticks\",\n \"tick\",\n \"mirror\",\n \"reversed\",\n \"label\",\n \"scale\",\n \"unit\",\n \"name\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"tickMargin\",\n]\n\nexport const yAxisProperties: (keyof Recharts.YAxisProps)[] = [\n \"hide\",\n \"dataKey\",\n \"yAxisId\",\n \"width\",\n \"height\",\n \"orientation\",\n \"type\",\n \"tickCount\",\n \"domain\",\n \"includeHidden\",\n \"interval\",\n \"padding\",\n \"minTickGap\",\n \"allowDecimals\",\n \"allowDataOverflow\",\n \"allowDuplicatedCategory\",\n \"axisLine\",\n \"tickLine\",\n \"tickSize\",\n \"tickFormatter\",\n \"ticks\",\n \"tick\",\n \"mirror\",\n \"reversed\",\n \"label\",\n \"scale\",\n \"unit\",\n \"name\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"tickMargin\",\n]\n\nexport const legendProperties: (keyof Omit<Recharts.LegendProps, \"ref\">)[] = [\n \"width\",\n \"height\",\n \"layout\",\n \"align\",\n \"verticalAlign\",\n \"iconSize\",\n \"iconType\",\n \"payload\",\n \"chartWidth\",\n \"chartHeight\",\n \"margin\",\n \"content\",\n \"formatter\",\n \"wrapperStyle\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const tooltipProperties: (keyof Recharts.TooltipProps<any, any>)[] = [\n \"offset\",\n \"filterNull\",\n \"itemStyle\",\n \"wrapperStyle\",\n \"contentStyle\",\n \"labelStyle\",\n \"cursor\",\n \"viewBox\",\n \"allowEscapeViewBox\",\n \"active\",\n \"position\",\n \"coordinate\",\n \"payload\",\n \"label\",\n \"content\",\n \"formatter\",\n \"labelFormatter\",\n \"itemSorter\",\n \"isAnimationActive\",\n \"animationDuration\",\n \"animationEasing\",\n]\n\nexport const areaProperties: (keyof Omit<Recharts.AreaProps, \"ref\">)[] = [\n \"type\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"dot\",\n \"activeDot\",\n \"label\",\n \"stroke\",\n \"strokeWidth\",\n \"layout\",\n \"baseLine\",\n \"points\",\n \"stackId\",\n \"connectNulls\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const barProperties: (keyof Omit<Recharts.BarProps, \"ref\">)[] = [\n \"layout\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"label\",\n \"data\",\n \"barSize\",\n \"maxBarSize\",\n \"minPointSize\",\n \"background\",\n \"shape\",\n \"activeBar\",\n \"stackId\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"radius\",\n]\n\nexport const radarProperties: (keyof Omit<Recharts.RadarProps, \"ref\">)[] = [\n \"dataKey\",\n \"points\",\n \"shape\",\n \"dot\",\n \"activeDot\",\n \"legendType\",\n \"label\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n]\n\nexport const lineProperties: (keyof Omit<Recharts.LineProps, \"ref\">)[] = [\n \"type\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"dot\",\n \"activeDot\",\n \"label\",\n \"hide\",\n \"points\",\n \"stroke\",\n \"strokeWidth\",\n \"layout\",\n \"connectNulls\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"strokeDasharray\",\n]\n\nexport const dotProperties: (keyof Omit<Recharts.DotProps, \"ref\">)[] = [\n \"cx\",\n \"cy\",\n \"r\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const polarGridProperties: (keyof Recharts.PolarGridProps)[] = [\n \"cx\",\n \"cy\",\n \"innerRadius\",\n \"outerRadius\",\n \"polarAngles\",\n \"polarRadius\",\n \"gridType\",\n]\n\nexport const polarAngleAxisProperties: (keyof Recharts.PolarAngleAxisProps)[] =\n [\n \"dataKey\",\n \"cx\",\n \"cy\",\n \"radius\",\n \"axisLine\",\n \"axisLineType\",\n \"tickLine\",\n \"tickSize\",\n \"tick\",\n \"ticks\",\n \"orient\",\n \"tickFormatter\",\n \"type\",\n \"allowDuplicatedCategory\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n ]\nexport const polarRadiusAxisProperties: (keyof Recharts.PolarRadiusAxisProps)[] =\n [\n \"angle\",\n \"type\",\n \"allowDuplicatedCategory\",\n \"cx\",\n \"cy\",\n \"domain\",\n \"reversed\",\n \"label\",\n \"orientation\",\n \"axisLine\",\n \"tick\",\n \"tickSize\",\n \"tickFormatter\",\n \"tickCount\",\n \"scale\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n ]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,eAAiC;AAGjC,IAAAC,gBAA6B;AAC7B,mBAAqC;;;ACHrC,kBAAuB;AAEvB,mBAA0C;AAEnC,IAAM,eACX,IAAI,WACJ,CAAC,cACC;AAAA,EACE,GAAG,OAAO;AAAA,IAAI,CAAC,cACb,uBAAS,KAAK,IAAI,YAAQ,oBAAO,KAAK,EAAE,KAAK;AAAA,EAC/C;AACF;AAEG,IAAM,oBACX,CACE,CAAC,KAAK,IAAI,MACP,UAEL,CAA4B,OAAoB,cAAkB;AAChE,QAAM,CAAC,aAAa,YAAY,QAAI,0BAAkB,KAAK,IAAI;AAC/D,QAAM,YAAY,aAAa,GAAG,OAAO,YAAY,EAAE,KAAK;AAE5D,SACE,CAAC,YAAY,CAAC,aAAa,SAAS,IAAI,EAAE,GAAG,aAAa,UAAU;AAIxE;;;AC+CK,IAAM,0BAAiE;AAAA,EAC5E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;AFnEO,IAAM,wBAAwB,CAAC;AAAA,EACpC,qBAAqB,CAAC;AAAA,EACtB;AACF,MAAkC;AAChC,QAAM,EAAE,MAAM,QAAI,uBAAS;AAC3B,QAAM,qBAAiB,qBAAO,OAAO,aAAa,EAAE,KAAK;AACzD,QAAM,eAAW;AAAA,IACf,MACE,mBAAmB,IAAI,CAAC,OAAO,UAAU;AACvC,YAAM,CAAC,EAAE,OAAO,WAAW,GAAG,KAAK,GAAG,aAAa,IACjD;AAAA,QACE,CAAC,OAAO,uBAAuB;AAAA,QAC/B;AAAA,MACF,EAAE,KAAK;AAET,YAAM,QAAQ,2BAA2B,KAAK;AAC9C,YAAM,QAA8C;AAAA,QAClD,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,QACV,OAAI,wBAAS,SAAS,IAAI,YAAY,CAAC;AAAA,MACzC;AAEA,aAAO,EAAE,eAAe,OAAO,OAAO,GAAG,KAAK;AAAA,IAChD,CAAC;AAAA,IACH,CAAC,oBAAoB,gBAAgB,KAAK;AAAA,EAC5C;AAEA,QAAM,4BAMF;AAAA,IACF,CAAC,EAAE,OAAO,WAAW,GAAG,MAAM,GAAG,MAAM,SAAS;AAC9C,YAAM,EAAE,eAAe,OAAO,OAAO,GAAG,KAAK,IAAI,SAAS,KAAK;AAE/D,aAAO;AAAA,QACL;AAAA,QACA,eAAW,kBAAG,WAAW,aAAa;AAAA,QACtC,QAAQ;AAAA,QACR;AAAA,QACA,GAAI;AAAA,QACJ,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAO,EAAE,sBAAsB;AACjC;","names":["import_core","import_utils"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
2
|
+
import { CSSUIObject } from '@yamada-ui/core';
|
3
|
+
import * as _yamada_ui_utils from '@yamada-ui/utils';
|
4
|
+
import { Dict } from '@yamada-ui/utils';
|
5
|
+
import * as Recharts from 'recharts';
|
6
|
+
import { TooltipProps, ChartPropGetter } from './chart.types.mjs';
|
7
|
+
import 'react';
|
8
|
+
|
9
|
+
type UseChartTooltipOptions = {
|
10
|
+
/**
|
11
|
+
* Props passed down to recharts 'Tooltip' component.
|
12
|
+
*/
|
13
|
+
tooltipProps?: TooltipProps;
|
14
|
+
/**
|
15
|
+
* Specifies the duration of animation, the unit of this option is ms.
|
16
|
+
*
|
17
|
+
* @default 0
|
18
|
+
*/
|
19
|
+
tooltipAnimationDuration?: number;
|
20
|
+
};
|
21
|
+
type UseChartTooltipProps = UseChartTooltipOptions & {
|
22
|
+
styles: Dict<CSSUIObject>;
|
23
|
+
};
|
24
|
+
declare const useChartTooltip: ({ tooltipProps: _tooltipProps, tooltipAnimationDuration, styles, }: UseChartTooltipProps) => {
|
25
|
+
tooltipProps: Omit<Dict, string>;
|
26
|
+
getTooltipProps: ChartPropGetter<"div", Partial<Recharts.TooltipProps<any, any>>, Omit<Recharts.TooltipProps<any, any>, "ref">>;
|
27
|
+
tooltipVars: {
|
28
|
+
__prefix?: string | undefined;
|
29
|
+
name: string;
|
30
|
+
token?: "colors" | "transitionDuration" | "transitionProperty" | "animations" | "blurs" | "borders" | "breakpoints" | "fonts" | "fontSizes" | "fontWeights" | "gradients" | "layerStyles" | "letterSpacings" | "lineHeights" | "radii" | "shadows" | "sizes" | "spaces" | "textStyles" | "transitionEasing" | "zIndices" | undefined;
|
31
|
+
value?: (number | _yamada_ui_utils.StringLiteral | _yamada_ui_core.ResponsiveObject<number | _yamada_ui_utils.StringLiteral> | _yamada_ui_core.ColorModeArray<number | _yamada_ui_utils.StringLiteral>) | undefined;
|
32
|
+
}[];
|
33
|
+
};
|
34
|
+
|
35
|
+
export { type UseChartTooltipOptions, useChartTooltip };
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
2
|
+
import { CSSUIObject } from '@yamada-ui/core';
|
3
|
+
import * as _yamada_ui_utils from '@yamada-ui/utils';
|
4
|
+
import { Dict } from '@yamada-ui/utils';
|
5
|
+
import * as Recharts from 'recharts';
|
6
|
+
import { TooltipProps, ChartPropGetter } from './chart.types.js';
|
7
|
+
import 'react';
|
8
|
+
|
9
|
+
type UseChartTooltipOptions = {
|
10
|
+
/**
|
11
|
+
* Props passed down to recharts 'Tooltip' component.
|
12
|
+
*/
|
13
|
+
tooltipProps?: TooltipProps;
|
14
|
+
/**
|
15
|
+
* Specifies the duration of animation, the unit of this option is ms.
|
16
|
+
*
|
17
|
+
* @default 0
|
18
|
+
*/
|
19
|
+
tooltipAnimationDuration?: number;
|
20
|
+
};
|
21
|
+
type UseChartTooltipProps = UseChartTooltipOptions & {
|
22
|
+
styles: Dict<CSSUIObject>;
|
23
|
+
};
|
24
|
+
declare const useChartTooltip: ({ tooltipProps: _tooltipProps, tooltipAnimationDuration, styles, }: UseChartTooltipProps) => {
|
25
|
+
tooltipProps: Omit<Dict, string>;
|
26
|
+
getTooltipProps: ChartPropGetter<"div", Partial<Recharts.TooltipProps<any, any>>, Omit<Recharts.TooltipProps<any, any>, "ref">>;
|
27
|
+
tooltipVars: {
|
28
|
+
__prefix?: string | undefined;
|
29
|
+
name: string;
|
30
|
+
token?: "colors" | "transitionDuration" | "transitionProperty" | "animations" | "blurs" | "borders" | "breakpoints" | "fonts" | "fontSizes" | "fontWeights" | "gradients" | "layerStyles" | "letterSpacings" | "lineHeights" | "radii" | "shadows" | "sizes" | "spaces" | "textStyles" | "transitionEasing" | "zIndices" | undefined;
|
31
|
+
value?: (number | _yamada_ui_utils.StringLiteral | _yamada_ui_core.ResponsiveObject<number | _yamada_ui_utils.StringLiteral> | _yamada_ui_core.ColorModeArray<number | _yamada_ui_utils.StringLiteral>) | undefined;
|
32
|
+
}[];
|
33
|
+
};
|
34
|
+
|
35
|
+
export { type UseChartTooltipOptions, useChartTooltip };
|
@@ -0,0 +1,121 @@
|
|
1
|
+
"use client"
|
2
|
+
"use strict";
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
20
|
+
|
21
|
+
// src/use-chart-tooltip.ts
|
22
|
+
var use_chart_tooltip_exports = {};
|
23
|
+
__export(use_chart_tooltip_exports, {
|
24
|
+
useChartTooltip: () => useChartTooltip
|
25
|
+
});
|
26
|
+
module.exports = __toCommonJS(use_chart_tooltip_exports);
|
27
|
+
var import_utils = require("@yamada-ui/utils");
|
28
|
+
var import_react = require("react");
|
29
|
+
|
30
|
+
// src/rechart-properties.ts
|
31
|
+
var tooltipProperties = [
|
32
|
+
"offset",
|
33
|
+
"filterNull",
|
34
|
+
"itemStyle",
|
35
|
+
"wrapperStyle",
|
36
|
+
"contentStyle",
|
37
|
+
"labelStyle",
|
38
|
+
"cursor",
|
39
|
+
"viewBox",
|
40
|
+
"allowEscapeViewBox",
|
41
|
+
"active",
|
42
|
+
"position",
|
43
|
+
"coordinate",
|
44
|
+
"payload",
|
45
|
+
"label",
|
46
|
+
"content",
|
47
|
+
"formatter",
|
48
|
+
"labelFormatter",
|
49
|
+
"itemSorter",
|
50
|
+
"isAnimationActive",
|
51
|
+
"animationDuration",
|
52
|
+
"animationEasing"
|
53
|
+
];
|
54
|
+
|
55
|
+
// src/use-chart-tooltip.ts
|
56
|
+
var useChartTooltip = ({
|
57
|
+
tooltipProps: _tooltipProps = {},
|
58
|
+
tooltipAnimationDuration = 0,
|
59
|
+
styles
|
60
|
+
}) => {
|
61
|
+
const { cursor, ...rest } = _tooltipProps;
|
62
|
+
const resolvedCursor = (0, import_react.useMemo)(
|
63
|
+
() => ({ ...styles.cursor, ...cursor }),
|
64
|
+
[cursor, styles]
|
65
|
+
);
|
66
|
+
const tooltipVars = (0, import_react.useMemo)(
|
67
|
+
() => [
|
68
|
+
{
|
69
|
+
__prefix: "ui",
|
70
|
+
name: "cursor-fill",
|
71
|
+
token: "colors",
|
72
|
+
value: resolvedCursor.fill
|
73
|
+
},
|
74
|
+
{
|
75
|
+
__prefix: "ui",
|
76
|
+
name: "cursor-stroke",
|
77
|
+
token: "colors",
|
78
|
+
value: resolvedCursor.stroke
|
79
|
+
},
|
80
|
+
{
|
81
|
+
__prefix: "ui",
|
82
|
+
name: "cursor-stroke-width",
|
83
|
+
token: "colors",
|
84
|
+
value: resolvedCursor.strokeWidth
|
85
|
+
},
|
86
|
+
{
|
87
|
+
__prefix: "ui",
|
88
|
+
name: "cursor-stroke-dasharray",
|
89
|
+
token: "colors",
|
90
|
+
value: resolvedCursor.strokeDasharray
|
91
|
+
}
|
92
|
+
],
|
93
|
+
[resolvedCursor]
|
94
|
+
);
|
95
|
+
const [tooltipProps, tooltipUIProps] = (0, import_utils.splitObject)(
|
96
|
+
rest,
|
97
|
+
tooltipProperties
|
98
|
+
);
|
99
|
+
const getTooltipProps = (0, import_react.useCallback)(
|
100
|
+
(props, ref = null) => ({
|
101
|
+
ref,
|
102
|
+
animationDuration: tooltipAnimationDuration,
|
103
|
+
isAnimationActive: (tooltipAnimationDuration || 0) > 0,
|
104
|
+
cursor: {
|
105
|
+
fill: "var(--ui-cursor-fill)",
|
106
|
+
stroke: "var(--ui-cursor-stroke)",
|
107
|
+
strokeWidth: "var(--ui-cursor-stroke-width)",
|
108
|
+
strokeDasharray: "var(--ui-cursor-stroke-dasharray)"
|
109
|
+
},
|
110
|
+
...props,
|
111
|
+
...tooltipProps
|
112
|
+
}),
|
113
|
+
[tooltipAnimationDuration, tooltipProps]
|
114
|
+
);
|
115
|
+
return { tooltipProps: tooltipUIProps, getTooltipProps, tooltipVars };
|
116
|
+
};
|
117
|
+
// Annotate the CommonJS export names for ESM import in node:
|
118
|
+
0 && (module.exports = {
|
119
|
+
useChartTooltip
|
120
|
+
});
|
121
|
+
//# sourceMappingURL=use-chart-tooltip.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-chart-tooltip.ts","../src/rechart-properties.ts"],"sourcesContent":["import type { CSSUIObject, CSSUIProps } from \"@yamada-ui/core\"\nimport { splitObject, type Dict } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport type { ChartPropGetter, TooltipProps } from \"./chart.types\"\nimport { tooltipProperties } from \"./rechart-properties\"\n\nexport type UseChartTooltipOptions = {\n /**\n * Props passed down to recharts 'Tooltip' component.\n */\n tooltipProps?: TooltipProps\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n *\n * @default 0\n */\n tooltipAnimationDuration?: number\n}\n\ntype UseChartTooltipProps = UseChartTooltipOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartTooltip = ({\n tooltipProps: _tooltipProps = {},\n tooltipAnimationDuration = 0,\n styles,\n}: UseChartTooltipProps) => {\n const { cursor, ...rest } = _tooltipProps\n const resolvedCursor = useMemo(\n () => ({ ...styles.cursor, ...cursor }),\n [cursor, styles],\n )\n\n // TODO: replace `className`\n const tooltipVars: Required<CSSUIProps>[\"var\"] = useMemo(\n () =>\n [\n {\n __prefix: \"ui\",\n name: \"cursor-fill\",\n token: \"colors\",\n value: resolvedCursor.fill,\n },\n {\n __prefix: \"ui\",\n name: \"cursor-stroke\",\n token: \"colors\",\n value: resolvedCursor.stroke,\n },\n {\n __prefix: \"ui\",\n name: \"cursor-stroke-width\",\n token: \"colors\",\n value: resolvedCursor.strokeWidth,\n },\n {\n __prefix: \"ui\",\n name: \"cursor-stroke-dasharray\",\n token: \"colors\",\n value: resolvedCursor.strokeDasharray,\n },\n ] as Required<CSSUIProps>[\"var\"],\n [resolvedCursor],\n )\n\n const [tooltipProps, tooltipUIProps] = splitObject<Dict, string>(\n rest,\n tooltipProperties,\n )\n\n const getTooltipProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.TooltipProps<any, any>>,\n Omit<Recharts.TooltipProps<any, any>, \"ref\">\n > = useCallback(\n (props, ref = null) => ({\n ref,\n animationDuration: tooltipAnimationDuration,\n isAnimationActive: (tooltipAnimationDuration || 0) > 0,\n cursor: {\n fill: \"var(--ui-cursor-fill)\",\n stroke: \"var(--ui-cursor-stroke)\",\n strokeWidth: \"var(--ui-cursor-stroke-width)\",\n strokeDasharray: \"var(--ui-cursor-stroke-dasharray)\",\n },\n ...props,\n ...tooltipProps,\n }),\n [tooltipAnimationDuration, tooltipProps],\n )\n\n return { tooltipProps: tooltipUIProps, getTooltipProps, tooltipVars }\n}\n","import type { ComponentPropsWithoutRef } from \"react\"\nimport type * as Recharts from \"recharts\"\n\nexport const areaChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.AreaChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"stackOffset\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const barChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.BarChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"barCategoryGap\",\n \"barGap\",\n \"barSize\",\n \"maxBarSize\",\n \"stackOffset\",\n \"reverseStackOrder\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const lineChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.LineChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const radarChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.RadarChart\n>)[] = [\n \"width\",\n \"height\",\n \"data\",\n \"cx\",\n \"cy\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"margin\",\n \"onMouseEnter\",\n \"onClick\",\n]\n\nexport const referenceLineProperties: (keyof Recharts.ReferenceLineProps)[] = [\n \"xAxisId\",\n \"yAxisId\",\n \"x\",\n \"y\",\n \"ifOverflow\",\n \"viewBox\",\n \"xAxis\",\n \"yAxis\",\n \"label\",\n \"isFront\",\n \"strokeWidth\",\n \"segment\",\n]\n\nexport const containerProperties: (keyof Omit<\n Recharts.ResponsiveContainerProps,\n \"children\"\n>)[] = [\n \"aspect\",\n \"width\",\n \"height\",\n \"minWidth\",\n \"minHeight\",\n \"debounce\",\n \"onResize\",\n]\n\nexport const gridProperties: (keyof Recharts.CartesianGridProps)[] = [\n \"x\",\n \"y\",\n \"width\",\n \"height\",\n \"horizontal\",\n \"vertical\",\n \"horizontalPoints\",\n \"horizontalCoordinatesGenerator\",\n \"verticalPoints\",\n \"verticalCoordinatesGenerator\",\n \"fill\",\n \"fillOpacity\",\n \"strokeDasharray\",\n]\n\nexport const xAxisProperties: (keyof Recharts.XAxisProps)[] = [\n \"hide\",\n \"dataKey\",\n \"xAxisId\",\n \"width\",\n \"height\",\n \"orientation\",\n \"type\",\n \"allowDecimals\",\n \"allowDataOverflow\",\n \"allowDuplicatedCategory\",\n \"angle\",\n \"tickCount\",\n \"domain\",\n \"includeHidden\",\n \"interval\",\n \"padding\",\n \"minTickGap\",\n \"axisLine\",\n \"tickLine\",\n \"tickSize\",\n \"tickFormatter\",\n \"ticks\",\n \"tick\",\n \"mirror\",\n \"reversed\",\n \"label\",\n \"scale\",\n \"unit\",\n \"name\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"tickMargin\",\n]\n\nexport const yAxisProperties: (keyof Recharts.YAxisProps)[] = [\n \"hide\",\n \"dataKey\",\n \"yAxisId\",\n \"width\",\n \"height\",\n \"orientation\",\n \"type\",\n \"tickCount\",\n \"domain\",\n \"includeHidden\",\n \"interval\",\n \"padding\",\n \"minTickGap\",\n \"allowDecimals\",\n \"allowDataOverflow\",\n \"allowDuplicatedCategory\",\n \"axisLine\",\n \"tickLine\",\n \"tickSize\",\n \"tickFormatter\",\n \"ticks\",\n \"tick\",\n \"mirror\",\n \"reversed\",\n \"label\",\n \"scale\",\n \"unit\",\n \"name\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"tickMargin\",\n]\n\nexport const legendProperties: (keyof Omit<Recharts.LegendProps, \"ref\">)[] = [\n \"width\",\n \"height\",\n \"layout\",\n \"align\",\n \"verticalAlign\",\n \"iconSize\",\n \"iconType\",\n \"payload\",\n \"chartWidth\",\n \"chartHeight\",\n \"margin\",\n \"content\",\n \"formatter\",\n \"wrapperStyle\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const tooltipProperties: (keyof Recharts.TooltipProps<any, any>)[] = [\n \"offset\",\n \"filterNull\",\n \"itemStyle\",\n \"wrapperStyle\",\n \"contentStyle\",\n \"labelStyle\",\n \"cursor\",\n \"viewBox\",\n \"allowEscapeViewBox\",\n \"active\",\n \"position\",\n \"coordinate\",\n \"payload\",\n \"label\",\n \"content\",\n \"formatter\",\n \"labelFormatter\",\n \"itemSorter\",\n \"isAnimationActive\",\n \"animationDuration\",\n \"animationEasing\",\n]\n\nexport const areaProperties: (keyof Omit<Recharts.AreaProps, \"ref\">)[] = [\n \"type\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"dot\",\n \"activeDot\",\n \"label\",\n \"stroke\",\n \"strokeWidth\",\n \"layout\",\n \"baseLine\",\n \"points\",\n \"stackId\",\n \"connectNulls\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const barProperties: (keyof Omit<Recharts.BarProps, \"ref\">)[] = [\n \"layout\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"label\",\n \"data\",\n \"barSize\",\n \"maxBarSize\",\n \"minPointSize\",\n \"background\",\n \"shape\",\n \"activeBar\",\n \"stackId\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"radius\",\n]\n\nexport const radarProperties: (keyof Omit<Recharts.RadarProps, \"ref\">)[] = [\n \"dataKey\",\n \"points\",\n \"shape\",\n \"dot\",\n \"activeDot\",\n \"legendType\",\n \"label\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n]\n\nexport const lineProperties: (keyof Omit<Recharts.LineProps, \"ref\">)[] = [\n \"type\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"dot\",\n \"activeDot\",\n \"label\",\n \"hide\",\n \"points\",\n \"stroke\",\n \"strokeWidth\",\n \"layout\",\n \"connectNulls\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"strokeDasharray\",\n]\n\nexport const dotProperties: (keyof Omit<Recharts.DotProps, \"ref\">)[] = [\n \"cx\",\n \"cy\",\n \"r\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const polarGridProperties: (keyof Recharts.PolarGridProps)[] = [\n \"cx\",\n \"cy\",\n \"innerRadius\",\n \"outerRadius\",\n \"polarAngles\",\n \"polarRadius\",\n \"gridType\",\n]\n\nexport const polarAngleAxisProperties: (keyof Recharts.PolarAngleAxisProps)[] =\n [\n \"dataKey\",\n \"cx\",\n \"cy\",\n \"radius\",\n \"axisLine\",\n \"axisLineType\",\n \"tickLine\",\n \"tickSize\",\n \"tick\",\n \"ticks\",\n \"orient\",\n \"tickFormatter\",\n \"type\",\n \"allowDuplicatedCategory\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n ]\nexport const polarRadiusAxisProperties: (keyof Recharts.PolarRadiusAxisProps)[] =\n [\n \"angle\",\n \"type\",\n \"allowDuplicatedCategory\",\n \"cx\",\n \"cy\",\n \"domain\",\n \"reversed\",\n \"label\",\n \"orientation\",\n \"axisLine\",\n \"tick\",\n \"tickSize\",\n \"tickFormatter\",\n \"tickCount\",\n \"scale\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n ]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAuC;AACvC,mBAAqC;;;AC+N9B,IAAM,oBAA+D;AAAA,EAC1E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;AD/NO,IAAM,kBAAkB,CAAC;AAAA,EAC9B,cAAc,gBAAgB,CAAC;AAAA,EAC/B,2BAA2B;AAAA,EAC3B;AACF,MAA4B;AAC1B,QAAM,EAAE,QAAQ,GAAG,KAAK,IAAI;AAC5B,QAAM,qBAAiB;AAAA,IACrB,OAAO,EAAE,GAAG,OAAO,QAAQ,GAAG,OAAO;AAAA,IACrC,CAAC,QAAQ,MAAM;AAAA,EACjB;AAGA,QAAM,kBAA2C;AAAA,IAC/C,MACE;AAAA,MACE;AAAA,QACE,UAAU;AAAA,QACV,MAAM;AAAA,QACN,OAAO;AAAA,QACP,OAAO,eAAe;AAAA,MACxB;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,MAAM;AAAA,QACN,OAAO;AAAA,QACP,OAAO,eAAe;AAAA,MACxB;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,MAAM;AAAA,QACN,OAAO;AAAA,QACP,OAAO,eAAe;AAAA,MACxB;AAAA,MACA;AAAA,QACE,UAAU;AAAA,QACV,MAAM;AAAA,QACN,OAAO;AAAA,QACP,OAAO,eAAe;AAAA,MACxB;AAAA,IACF;AAAA,IACF,CAAC,cAAc;AAAA,EACjB;AAEA,QAAM,CAAC,cAAc,cAAc,QAAI;AAAA,IACrC;AAAA,IACA;AAAA,EACF;AAEA,QAAM,sBAIF;AAAA,IACF,CAAC,OAAO,MAAM,UAAU;AAAA,MACtB;AAAA,MACA,mBAAmB;AAAA,MACnB,oBAAoB,4BAA4B,KAAK;AAAA,MACrD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,iBAAiB;AAAA,MACnB;AAAA,MACA,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,CAAC,0BAA0B,YAAY;AAAA,EACzC;AAEA,SAAO,EAAE,cAAc,gBAAgB,iBAAiB,YAAY;AACtE;","names":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import * as react from 'react';
|
2
|
+
import { CSSUIObject } from '@yamada-ui/core';
|
3
|
+
import * as Recharts from 'recharts';
|
4
|
+
import { ResponsiveContainerProps, ChartPropGetter } from './chart.types.mjs';
|
5
|
+
import '@yamada-ui/utils';
|
6
|
+
|
7
|
+
type ChartContext = {
|
8
|
+
styles: Record<string, CSSUIObject>;
|
9
|
+
};
|
10
|
+
declare const ChartProvider: react.Provider<ChartContext>;
|
11
|
+
declare const useChartContext: () => ChartContext;
|
12
|
+
type UseChartProps = {
|
13
|
+
/**
|
14
|
+
* Props passed down to recharts `ResponsiveContainer` component.
|
15
|
+
*/
|
16
|
+
containerProps?: ResponsiveContainerProps;
|
17
|
+
};
|
18
|
+
declare const useChart: ({ containerProps }: UseChartProps) => {
|
19
|
+
getContainerProps: ChartPropGetter<"div", Partial<Omit<Recharts.ResponsiveContainerProps, "children">>, Omit<Recharts.ResponsiveContainerProps, "children">>;
|
20
|
+
};
|
21
|
+
type UseChartReturn = ReturnType<typeof useChart>;
|
22
|
+
type UseLegendProps = {};
|
23
|
+
declare const useLegend: ({}?: UseLegendProps) => {
|
24
|
+
styles: Record<string, CSSUIObject>;
|
25
|
+
};
|
26
|
+
type UseLegendReturn = ReturnType<typeof useLegend>;
|
27
|
+
type UseTooltipProps = {};
|
28
|
+
declare const useTooltip: ({}?: UseTooltipProps) => {
|
29
|
+
styles: Record<string, CSSUIObject>;
|
30
|
+
};
|
31
|
+
type UseTooltipReturn = ReturnType<typeof useTooltip>;
|
32
|
+
|
33
|
+
export { ChartProvider, type UseChartProps, type UseChartReturn, type UseLegendProps, type UseLegendReturn, type UseTooltipProps, type UseTooltipReturn, useChart, useChartContext, useLegend, useTooltip };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import * as react from 'react';
|
2
|
+
import { CSSUIObject } from '@yamada-ui/core';
|
3
|
+
import * as Recharts from 'recharts';
|
4
|
+
import { ResponsiveContainerProps, ChartPropGetter } from './chart.types.js';
|
5
|
+
import '@yamada-ui/utils';
|
6
|
+
|
7
|
+
type ChartContext = {
|
8
|
+
styles: Record<string, CSSUIObject>;
|
9
|
+
};
|
10
|
+
declare const ChartProvider: react.Provider<ChartContext>;
|
11
|
+
declare const useChartContext: () => ChartContext;
|
12
|
+
type UseChartProps = {
|
13
|
+
/**
|
14
|
+
* Props passed down to recharts `ResponsiveContainer` component.
|
15
|
+
*/
|
16
|
+
containerProps?: ResponsiveContainerProps;
|
17
|
+
};
|
18
|
+
declare const useChart: ({ containerProps }: UseChartProps) => {
|
19
|
+
getContainerProps: ChartPropGetter<"div", Partial<Omit<Recharts.ResponsiveContainerProps, "children">>, Omit<Recharts.ResponsiveContainerProps, "children">>;
|
20
|
+
};
|
21
|
+
type UseChartReturn = ReturnType<typeof useChart>;
|
22
|
+
type UseLegendProps = {};
|
23
|
+
declare const useLegend: ({}?: UseLegendProps) => {
|
24
|
+
styles: Record<string, CSSUIObject>;
|
25
|
+
};
|
26
|
+
type UseLegendReturn = ReturnType<typeof useLegend>;
|
27
|
+
type UseTooltipProps = {};
|
28
|
+
declare const useTooltip: ({}?: UseTooltipProps) => {
|
29
|
+
styles: Record<string, CSSUIObject>;
|
30
|
+
};
|
31
|
+
type UseTooltipReturn = ReturnType<typeof useTooltip>;
|
32
|
+
|
33
|
+
export { ChartProvider, type UseChartProps, type UseChartReturn, type UseLegendProps, type UseLegendReturn, type UseTooltipProps, type UseTooltipReturn, useChart, useChartContext, useLegend, useTooltip };
|
@@ -0,0 +1,104 @@
|
|
1
|
+
"use client"
|
2
|
+
"use strict";
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
20
|
+
|
21
|
+
// src/use-chart.ts
|
22
|
+
var use_chart_exports = {};
|
23
|
+
__export(use_chart_exports, {
|
24
|
+
ChartProvider: () => ChartProvider,
|
25
|
+
useChart: () => useChart,
|
26
|
+
useChartContext: () => useChartContext,
|
27
|
+
useLegend: () => useLegend,
|
28
|
+
useTooltip: () => useTooltip
|
29
|
+
});
|
30
|
+
module.exports = __toCommonJS(use_chart_exports);
|
31
|
+
var import_core2 = require("@yamada-ui/core");
|
32
|
+
var import_utils2 = require("@yamada-ui/utils");
|
33
|
+
var import_react = require("react");
|
34
|
+
|
35
|
+
// src/chart-utils.ts
|
36
|
+
var import_core = require("@yamada-ui/core");
|
37
|
+
var import_utils = require("@yamada-ui/utils");
|
38
|
+
var getClassName = (...styles) => (theme) => (0, import_utils.cx)(
|
39
|
+
...styles.map(
|
40
|
+
(style) => (0, import_utils.isString)(style) ? style : (0, import_core.getCSS)(style)(theme)
|
41
|
+
)
|
42
|
+
);
|
43
|
+
var getComponentProps = ([obj, keys], ...props) => (theme, isContain) => {
|
44
|
+
const [pickedProps, omittedProps] = (0, import_utils.splitObject)(obj, keys);
|
45
|
+
const className = getClassName(...props, omittedProps)(theme);
|
46
|
+
return !isContain ? [pickedProps, className] : { ...pickedProps, className };
|
47
|
+
};
|
48
|
+
|
49
|
+
// src/rechart-properties.ts
|
50
|
+
var containerProperties = [
|
51
|
+
"aspect",
|
52
|
+
"width",
|
53
|
+
"height",
|
54
|
+
"minWidth",
|
55
|
+
"minHeight",
|
56
|
+
"debounce",
|
57
|
+
"onResize"
|
58
|
+
];
|
59
|
+
|
60
|
+
// src/use-chart.ts
|
61
|
+
var [ChartProvider, useChartContext] = (0, import_utils2.createContext)({
|
62
|
+
name: "ChartContext",
|
63
|
+
errorMessage: `useChartContext returned is 'undefined'. Seems you forgot to wrap the components in "<LineChart />" or "<BarChart />" etc.`
|
64
|
+
});
|
65
|
+
var useChart = ({ containerProps = {} }) => {
|
66
|
+
const { theme } = (0, import_core2.useTheme)();
|
67
|
+
const [reChartsProps, propClassName] = getComponentProps([
|
68
|
+
containerProps,
|
69
|
+
containerProperties
|
70
|
+
])(theme);
|
71
|
+
const getContainerProps = (0, import_react.useCallback)(
|
72
|
+
({ className, ...props } = {}, ref = null) => ({
|
73
|
+
ref,
|
74
|
+
className: (0, import_utils2.cx)("ui-chart__container", className, propClassName),
|
75
|
+
...props,
|
76
|
+
...reChartsProps
|
77
|
+
}),
|
78
|
+
[propClassName, reChartsProps]
|
79
|
+
);
|
80
|
+
return {
|
81
|
+
getContainerProps
|
82
|
+
};
|
83
|
+
};
|
84
|
+
var useLegend = ({} = {}) => {
|
85
|
+
const { styles } = useChartContext();
|
86
|
+
return {
|
87
|
+
styles
|
88
|
+
};
|
89
|
+
};
|
90
|
+
var useTooltip = ({} = {}) => {
|
91
|
+
const { styles } = useChartContext();
|
92
|
+
return {
|
93
|
+
styles
|
94
|
+
};
|
95
|
+
};
|
96
|
+
// Annotate the CommonJS export names for ESM import in node:
|
97
|
+
0 && (module.exports = {
|
98
|
+
ChartProvider,
|
99
|
+
useChart,
|
100
|
+
useChartContext,
|
101
|
+
useLegend,
|
102
|
+
useTooltip
|
103
|
+
});
|
104
|
+
//# sourceMappingURL=use-chart.js.map
|