@yamada-ui/charts 1.5.0-dev-20240825090212 → 1.5.0-dev-20240825095648
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/area-chart-split.js +2 -4
- package/dist/area-chart-split.js.map +1 -1
- package/dist/area-chart-split.mjs +1 -1
- package/dist/area-chart.js +47 -47
- package/dist/area-chart.js.map +1 -1
- package/dist/area-chart.mjs +4 -4
- package/dist/bar-chart.js +6 -4
- package/dist/bar-chart.js.map +1 -1
- package/dist/bar-chart.mjs +3 -3
- package/dist/{chunk-NHJDUFKO.mjs → chunk-6ICKO7GY.mjs} +7 -5
- package/dist/chunk-6ICKO7GY.mjs.map +1 -0
- package/dist/{chunk-WDGSALCA.mjs → chunk-7HKRIEAT.mjs} +2 -2
- package/dist/{chunk-PKRKJQQL.mjs → chunk-BNTTQQFO.mjs} +2 -2
- package/dist/{chunk-RXQNFP7K.mjs → chunk-DKZISSE6.mjs} +4 -4
- package/dist/{chunk-BRSSQCO4.mjs → chunk-FIWHBTKQ.mjs} +8 -6
- package/dist/chunk-FIWHBTKQ.mjs.map +1 -0
- package/dist/{chunk-TZ62XGYL.mjs → chunk-IF4O4CBA.mjs} +6 -8
- package/dist/chunk-IF4O4CBA.mjs.map +1 -0
- package/dist/{chunk-UCZQ22IS.mjs → chunk-LF3ENX7Z.mjs} +2 -2
- package/dist/{chunk-WRKSJCFE.mjs → chunk-LHW3WK3C.mjs} +6 -5
- package/dist/chunk-LHW3WK3C.mjs.map +1 -0
- package/dist/{chunk-MGTMKKSH.mjs → chunk-PNE3JG54.mjs} +3 -5
- package/dist/chunk-PNE3JG54.mjs.map +1 -0
- package/dist/{chunk-LOXFDA6Z.mjs → chunk-Q7CCSKX3.mjs} +3 -3
- package/dist/chunk-Q7CCSKX3.mjs.map +1 -0
- package/dist/{chunk-VO2I73WT.mjs → chunk-QNX4DJVS.mjs} +3 -3
- package/dist/{chunk-WAKQGKGK.mjs → chunk-WPJDHMPD.mjs} +11 -9
- package/dist/chunk-WPJDHMPD.mjs.map +1 -0
- package/dist/{chunk-ZHM6LP7J.mjs → chunk-WY5PI2CR.mjs} +3 -3
- package/dist/donut-chart.js +4 -3
- package/dist/donut-chart.js.map +1 -1
- package/dist/donut-chart.mjs +2 -2
- package/dist/index.js +62 -56
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -13
- package/dist/line-chart.js +7 -5
- package/dist/line-chart.js.map +1 -1
- package/dist/line-chart.mjs +3 -3
- package/dist/pie-chart.js +4 -3
- package/dist/pie-chart.js.map +1 -1
- package/dist/pie-chart.mjs +2 -2
- package/dist/radar-chart.js +4 -3
- package/dist/radar-chart.js.map +1 -1
- package/dist/radar-chart.mjs +2 -2
- package/dist/use-area-chart.js +9 -7
- package/dist/use-area-chart.js.map +1 -1
- package/dist/use-area-chart.mjs +1 -1
- package/dist/use-bar-chart.js +5 -3
- package/dist/use-bar-chart.js.map +1 -1
- package/dist/use-bar-chart.mjs +1 -1
- package/dist/use-chart-reference-line.js +1 -1
- package/dist/use-chart-reference-line.js.map +1 -1
- package/dist/use-chart-reference-line.mjs +1 -1
- package/dist/use-line-chart.js +6 -4
- package/dist/use-line-chart.js.map +1 -1
- package/dist/use-line-chart.mjs +1 -1
- package/dist/use-pie-chart.js +4 -3
- package/dist/use-pie-chart.js.map +1 -1
- package/dist/use-pie-chart.mjs +1 -1
- package/dist/use-radar-chart.js +4 -3
- package/dist/use-radar-chart.js.map +1 -1
- package/dist/use-radar-chart.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-BRSSQCO4.mjs.map +0 -1
- package/dist/chunk-LOXFDA6Z.mjs.map +0 -1
- package/dist/chunk-MGTMKKSH.mjs.map +0 -1
- package/dist/chunk-NHJDUFKO.mjs.map +0 -1
- package/dist/chunk-TZ62XGYL.mjs.map +0 -1
- package/dist/chunk-WAKQGKGK.mjs.map +0 -1
- package/dist/chunk-WRKSJCFE.mjs.map +0 -1
- /package/dist/{chunk-WDGSALCA.mjs.map → chunk-7HKRIEAT.mjs.map} +0 -0
- /package/dist/{chunk-PKRKJQQL.mjs.map → chunk-BNTTQQFO.mjs.map} +0 -0
- /package/dist/{chunk-RXQNFP7K.mjs.map → chunk-DKZISSE6.mjs.map} +0 -0
- /package/dist/{chunk-UCZQ22IS.mjs.map → chunk-LF3ENX7Z.mjs.map} +0 -0
- /package/dist/{chunk-VO2I73WT.mjs.map → chunk-QNX4DJVS.mjs.map} +0 -0
- /package/dist/{chunk-ZHM6LP7J.mjs.map → chunk-WY5PI2CR.mjs.map} +0 -0
package/dist/area-chart-split.js
CHANGED
@@ -24,16 +24,14 @@ __export(area_chart_split_exports, {
|
|
24
24
|
AreaSplit: () => AreaSplit
|
25
25
|
});
|
26
26
|
module.exports = __toCommonJS(area_chart_split_exports);
|
27
|
-
var import_core = require("@yamada-ui/core");
|
28
27
|
var import_jsx_runtime = require("react/jsx-runtime");
|
29
28
|
var AreaSplit = ({ offset, id, fillOpacity }) => {
|
30
|
-
const { theme } = (0, import_core.useTheme)();
|
31
29
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
32
30
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
33
31
|
"stop",
|
34
32
|
{
|
35
33
|
offset,
|
36
|
-
stopColor: (
|
34
|
+
stopColor: "var(--ui-area-split-0)",
|
37
35
|
stopOpacity: fillOpacity != null ? fillOpacity : 0.4
|
38
36
|
}
|
39
37
|
),
|
@@ -41,7 +39,7 @@ var AreaSplit = ({ offset, id, fillOpacity }) => {
|
|
41
39
|
"stop",
|
42
40
|
{
|
43
41
|
offset,
|
44
|
-
stopColor: (
|
42
|
+
stopColor: "var(--ui-area-split-1)",
|
45
43
|
stopOpacity: fillOpacity != null ? fillOpacity : 0.4
|
46
44
|
}
|
47
45
|
)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/area-chart-split.tsx"],"sourcesContent":["
|
1
|
+
{"version":3,"sources":["../src/area-chart-split.tsx"],"sourcesContent":["export type AreaSplitProps = {\n offset: number\n id?: string\n fillOpacity: number | string | undefined\n}\n\nexport const AreaSplit = ({ offset, id, fillOpacity }: AreaSplitProps) => {\n return (\n <linearGradient id={id} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop\n offset={offset}\n stopColor=\"var(--ui-area-split-0)\"\n stopOpacity={fillOpacity ?? 0.4}\n />\n <stop\n offset={offset}\n stopColor=\"var(--ui-area-split-1)\"\n stopOpacity={fillOpacity ?? 0.4}\n />\n </linearGradient>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQI;AAFG,IAAM,YAAY,CAAC,EAAE,QAAQ,IAAI,YAAY,MAAsB;AACxE,SACE,6CAAC,oBAAe,IAAQ,IAAG,KAAI,IAAG,KAAI,IAAG,KAAI,IAAG,KAC9C;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAU;AAAA,QACV,aAAa,oCAAe;AAAA;AAAA,IAC9B;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAU;AAAA,QACV,aAAa,oCAAe;AAAA;AAAA,IAC9B;AAAA,KACF;AAEJ;","names":[]}
|
package/dist/area-chart.js
CHANGED
@@ -24,7 +24,7 @@ __export(area_chart_exports, {
|
|
24
24
|
AreaChart: () => AreaChart
|
25
25
|
});
|
26
26
|
module.exports = __toCommonJS(area_chart_exports);
|
27
|
-
var
|
27
|
+
var import_core10 = require("@yamada-ui/core");
|
28
28
|
var import_utils11 = require("@yamada-ui/utils");
|
29
29
|
var import_react8 = require("react");
|
30
30
|
var import_recharts = require("recharts");
|
@@ -48,16 +48,14 @@ var AreaGradient = ({
|
|
48
48
|
};
|
49
49
|
|
50
50
|
// src/area-chart-split.tsx
|
51
|
-
var import_core = require("@yamada-ui/core");
|
52
51
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
53
52
|
var AreaSplit = ({ offset, id, fillOpacity }) => {
|
54
|
-
const { theme } = (0, import_core.useTheme)();
|
55
53
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
56
54
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
57
55
|
"stop",
|
58
56
|
{
|
59
57
|
offset,
|
60
|
-
stopColor: (
|
58
|
+
stopColor: "var(--ui-area-split-0)",
|
61
59
|
stopOpacity: fillOpacity != null ? fillOpacity : 0.4
|
62
60
|
}
|
63
61
|
),
|
@@ -65,7 +63,7 @@ var AreaSplit = ({ offset, id, fillOpacity }) => {
|
|
65
63
|
"stop",
|
66
64
|
{
|
67
65
|
offset,
|
68
|
-
stopColor: (
|
66
|
+
stopColor: "var(--ui-area-split-1)",
|
69
67
|
stopOpacity: fillOpacity != null ? fillOpacity : 0.4
|
70
68
|
}
|
71
69
|
)
|
@@ -73,20 +71,20 @@ var AreaSplit = ({ offset, id, fillOpacity }) => {
|
|
73
71
|
};
|
74
72
|
|
75
73
|
// src/chart-legend.tsx
|
76
|
-
var
|
74
|
+
var import_core3 = require("@yamada-ui/core");
|
77
75
|
var import_utils3 = require("@yamada-ui/utils");
|
78
76
|
|
79
77
|
// src/use-chart.ts
|
80
|
-
var
|
78
|
+
var import_core2 = require("@yamada-ui/core");
|
81
79
|
var import_utils2 = require("@yamada-ui/utils");
|
82
80
|
var import_react = require("react");
|
83
81
|
|
84
82
|
// src/chart-utils.ts
|
85
|
-
var
|
83
|
+
var import_core = require("@yamada-ui/core");
|
86
84
|
var import_utils = require("@yamada-ui/utils");
|
87
85
|
var getClassName = (...styles) => (theme) => (0, import_utils.cx)(
|
88
86
|
...styles.map(
|
89
|
-
(style) => (0, import_utils.isString)(style) ? style : (0,
|
87
|
+
(style) => (0, import_utils.isString)(style) ? style : (0, import_core.getCSS)(style)(theme)
|
90
88
|
)
|
91
89
|
);
|
92
90
|
var getComponentProps = ([obj, keys], ...props) => (theme, isContain) => {
|
@@ -338,7 +336,7 @@ var [ChartProvider, useChartContext] = (0, import_utils2.createContext)({
|
|
338
336
|
errorMessage: `useChartContext returned is 'undefined'. Seems you forgot to wrap the components in "<LineChart />" or "<BarChart />" etc.`
|
339
337
|
});
|
340
338
|
var useChart = ({ containerProps = {} }) => {
|
341
|
-
const { theme } = (0,
|
339
|
+
const { theme } = (0, import_core2.useTheme)();
|
342
340
|
const [reChartsProps, propClassName] = getComponentProps([
|
343
341
|
containerProps,
|
344
342
|
containerProperties
|
@@ -371,13 +369,13 @@ var useTooltip = ({} = {}) => {
|
|
371
369
|
|
372
370
|
// src/chart-legend.tsx
|
373
371
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
374
|
-
var ChartLegend = (0,
|
372
|
+
var ChartLegend = (0, import_core3.forwardRef)(
|
375
373
|
({ className, payload = [], onHighlight, ...rest }, ref) => {
|
376
374
|
const { styles } = useLegend();
|
377
375
|
const items = payload.map(({ dataKey, value: valueProp, color }, index) => {
|
378
376
|
const value = dataKey != null ? dataKey : valueProp;
|
379
377
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
380
|
-
|
378
|
+
import_core3.ui.div,
|
381
379
|
{
|
382
380
|
className: "ui-chart__legend-item",
|
383
381
|
onMouseEnter: () => onHighlight(value),
|
@@ -385,21 +383,21 @@ var ChartLegend = (0, import_core4.forwardRef)(
|
|
385
383
|
__css: styles.legendItem,
|
386
384
|
children: [
|
387
385
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
388
|
-
|
386
|
+
import_core3.ui.div,
|
389
387
|
{
|
390
388
|
className: "ui-chart__legend-swatch",
|
391
389
|
background: color,
|
392
390
|
__css: styles.legendSwatch
|
393
391
|
}
|
394
392
|
),
|
395
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
393
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.ui.span, { className: "ui-chart__legend-label", children: value })
|
396
394
|
]
|
397
395
|
},
|
398
396
|
`legend-${index}`
|
399
397
|
);
|
400
398
|
});
|
401
399
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
402
|
-
|
400
|
+
import_core3.ui.div,
|
403
401
|
{
|
404
402
|
ref,
|
405
403
|
className: (0, import_utils3.cx)("ui-chart__legend", className),
|
@@ -412,10 +410,10 @@ var ChartLegend = (0, import_core4.forwardRef)(
|
|
412
410
|
);
|
413
411
|
|
414
412
|
// src/chart-tooltip.tsx
|
415
|
-
var
|
413
|
+
var import_core4 = require("@yamada-ui/core");
|
416
414
|
var import_utils4 = require("@yamada-ui/utils");
|
417
415
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
418
|
-
var ChartTooltip = (0,
|
416
|
+
var ChartTooltip = (0, import_core4.forwardRef)(
|
419
417
|
({
|
420
418
|
label,
|
421
419
|
className,
|
@@ -441,13 +439,13 @@ var ChartTooltip = (0, import_core5.forwardRef)(
|
|
441
439
|
value = (_a2 = valueFormatter == null ? void 0 : valueFormatter(valueProp)) != null ? _a2 : valueProp;
|
442
440
|
}
|
443
441
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
444
|
-
|
442
|
+
import_core4.ui.div,
|
445
443
|
{
|
446
444
|
className: "ui-chart__tooltip-item",
|
447
445
|
__css: styles.tooltipItem,
|
448
446
|
children: [
|
449
447
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
450
|
-
|
448
|
+
import_core4.ui.div,
|
451
449
|
{
|
452
450
|
className: "ui-chart__tooltip-swatch",
|
453
451
|
background: color,
|
@@ -455,7 +453,7 @@ var ChartTooltip = (0, import_core5.forwardRef)(
|
|
455
453
|
}
|
456
454
|
),
|
457
455
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
458
|
-
|
456
|
+
import_core4.ui.span,
|
459
457
|
{
|
460
458
|
className: "ui-chart__tooltip-label",
|
461
459
|
__css: styles.tooltipLabel,
|
@@ -463,7 +461,7 @@ var ChartTooltip = (0, import_core5.forwardRef)(
|
|
463
461
|
}
|
464
462
|
),
|
465
463
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
466
|
-
|
464
|
+
import_core4.ui.span,
|
467
465
|
{
|
468
466
|
className: "ui-chart__tooltip-value",
|
469
467
|
__css: styles.tooltipValue,
|
@@ -480,15 +478,15 @@ var ChartTooltip = (0, import_core5.forwardRef)(
|
|
480
478
|
}
|
481
479
|
);
|
482
480
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
483
|
-
|
481
|
+
import_core4.ui.div,
|
484
482
|
{
|
485
483
|
ref,
|
486
484
|
className: (0, import_utils4.cx)("ui-chart__tooltip", className),
|
487
485
|
__css: styles.tooltip,
|
488
486
|
...rest,
|
489
487
|
children: [
|
490
|
-
label ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
491
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
488
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.ui.p, { className: "ui-chart__tooltip-title", __css: styles.tooltipTitle, children: (_a = labelFormatter == null ? void 0 : labelFormatter(label)) != null ? _a : label }) : null,
|
489
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.ui.div, { className: "ui-chart__tooltip-list", __css: styles.tooltipList, children: items })
|
492
490
|
]
|
493
491
|
}
|
494
492
|
);
|
@@ -496,7 +494,7 @@ var ChartTooltip = (0, import_core5.forwardRef)(
|
|
496
494
|
);
|
497
495
|
|
498
496
|
// src/use-area-chart.ts
|
499
|
-
var
|
497
|
+
var import_core5 = require("@yamada-ui/core");
|
500
498
|
var import_utils5 = require("@yamada-ui/utils");
|
501
499
|
var import_react2 = require("react");
|
502
500
|
var useAreaChart = ({
|
@@ -522,7 +520,7 @@ var useAreaChart = ({
|
|
522
520
|
}) => {
|
523
521
|
var _a;
|
524
522
|
const uuid = (0, import_react2.useId)();
|
525
|
-
const { theme } = (0,
|
523
|
+
const { theme } = (0, import_core5.useTheme)();
|
526
524
|
const [highlightedArea, setHighlightedArea] = (0, import_react2.useState)(null);
|
527
525
|
const splitId = `${uuid}-split`;
|
528
526
|
const stacked = type === "stacked" || type === "percent";
|
@@ -537,6 +535,7 @@ var useAreaChart = ({
|
|
537
535
|
} = (_a = rest.areaProps) != null ? _a : {};
|
538
536
|
const areaColors = (0, import_react2.useMemo)(
|
539
537
|
() => series.map(({ color }, index) => ({
|
538
|
+
__prefix: "ui",
|
540
539
|
name: `area-${index}`,
|
541
540
|
token: "colors",
|
542
541
|
value: color != null ? color : "transparent"
|
@@ -545,6 +544,7 @@ var useAreaChart = ({
|
|
545
544
|
);
|
546
545
|
const areaSplitColors = (0, import_react2.useMemo)(
|
547
546
|
() => splitColors.map((color, index) => ({
|
547
|
+
__prefix: "ui",
|
548
548
|
name: `area-split-${index}`,
|
549
549
|
token: "colors",
|
550
550
|
value: color != null ? color : "transparent"
|
@@ -553,6 +553,7 @@ var useAreaChart = ({
|
|
553
553
|
);
|
554
554
|
const referenceLineColors = (0, import_react2.useMemo)(
|
555
555
|
() => referenceLineProps ? referenceLineProps.map(({ color }, index) => ({
|
556
|
+
__prefix: "ui",
|
556
557
|
name: `reference-line-${index}`,
|
557
558
|
token: "colors",
|
558
559
|
value: color != null ? color : "transparent"
|
@@ -564,10 +565,9 @@ var useAreaChart = ({
|
|
564
565
|
...areaColors,
|
565
566
|
...areaSplitColors,
|
566
567
|
...referenceLineColors,
|
567
|
-
{ name: "fill-opacity", value: fillOpacity }
|
568
|
+
{ __prefix: "ui", name: "fill-opacity", value: fillOpacity }
|
568
569
|
];
|
569
570
|
}, [areaColors, areaSplitColors, referenceLineColors, fillOpacity]);
|
570
|
-
const fillOpacityVar = (0, import_react2.useMemo)(() => (0, import_core6.getVar)("fill-opacity")(theme), [theme]);
|
571
571
|
const [chartProps, areaChartClassName] = (0, import_react2.useMemo)(
|
572
572
|
() => {
|
573
573
|
var _a2;
|
@@ -642,7 +642,7 @@ var useAreaChart = ({
|
|
642
642
|
...computedProps
|
643
643
|
} = props;
|
644
644
|
const id = `${uuid}-${dataKey}`;
|
645
|
-
const color = (
|
645
|
+
const color = `var(--ui-area-${index})`;
|
646
646
|
const dimmed = shouldHighlight && highlightedArea !== dataKey;
|
647
647
|
const computedDimArea = { ...dimAreaProps, ...dimArea2 };
|
648
648
|
const resolvedProps = {
|
@@ -754,10 +754,10 @@ var useAreaChart = ({
|
|
754
754
|
(props = {}) => ({
|
755
755
|
id: splitId,
|
756
756
|
offset: splitOffset != null ? splitOffset : defaultSplitOffset,
|
757
|
-
fillOpacity:
|
757
|
+
fillOpacity: "var(--ui-fill-opacity)",
|
758
758
|
...props
|
759
759
|
}),
|
760
|
-
[defaultSplitOffset, splitId, splitOffset
|
760
|
+
[defaultSplitOffset, splitId, splitOffset]
|
761
761
|
);
|
762
762
|
const getAreaProps = (0, import_react2.useCallback)(
|
763
763
|
({ index, className: classNameProp, ...props }, ref = null) => {
|
@@ -804,10 +804,10 @@ var useAreaChart = ({
|
|
804
804
|
const getAreaGradientProps = (0, import_react2.useCallback)(
|
805
805
|
(props = {}) => ({
|
806
806
|
withGradient,
|
807
|
-
fillOpacity:
|
807
|
+
fillOpacity: "var(--ui-fill-opacity)",
|
808
808
|
...props
|
809
809
|
}),
|
810
|
-
[withGradient
|
810
|
+
[withGradient]
|
811
811
|
);
|
812
812
|
return {
|
813
813
|
getAreaChartProps,
|
@@ -820,7 +820,7 @@ var useAreaChart = ({
|
|
820
820
|
};
|
821
821
|
|
822
822
|
// src/use-chart-axis.ts
|
823
|
-
var
|
823
|
+
var import_core6 = require("@yamada-ui/core");
|
824
824
|
var import_utils6 = require("@yamada-ui/utils");
|
825
825
|
var import_react3 = require("react");
|
826
826
|
var useChartAxis = ({
|
@@ -840,7 +840,7 @@ var useChartAxis = ({
|
|
840
840
|
...rest
|
841
841
|
}) => {
|
842
842
|
var _a, _b, _c, _d;
|
843
|
-
const { theme } = (0,
|
843
|
+
const { theme } = (0, import_core6.useTheme)();
|
844
844
|
const xAxisKey = (0, import_react3.useMemo)(
|
845
845
|
() => layoutType === "vertical" ? { type: "number" } : { dataKey },
|
846
846
|
[dataKey, layoutType]
|
@@ -961,7 +961,7 @@ var valueToPercent = (value) => {
|
|
961
961
|
};
|
962
962
|
|
963
963
|
// src/use-chart-grid.ts
|
964
|
-
var
|
964
|
+
var import_core7 = require("@yamada-ui/core");
|
965
965
|
var import_utils7 = require("@yamada-ui/utils");
|
966
966
|
var import_react4 = require("react");
|
967
967
|
var useChartGrid = ({
|
@@ -970,7 +970,7 @@ var useChartGrid = ({
|
|
970
970
|
strokeDasharray = "5 5",
|
971
971
|
styles
|
972
972
|
}) => {
|
973
|
-
const { theme } = (0,
|
973
|
+
const { theme } = (0, import_core7.useTheme)();
|
974
974
|
const [reChartsProps, propClassName] = getComponentProps(
|
975
975
|
[gridProps, gridProperties],
|
976
976
|
styles.grid
|
@@ -1015,22 +1015,22 @@ var useChartLegend = ({
|
|
1015
1015
|
};
|
1016
1016
|
|
1017
1017
|
// src/use-chart-reference-line.ts
|
1018
|
-
var
|
1018
|
+
var import_core8 = require("@yamada-ui/core");
|
1019
1019
|
var import_utils9 = require("@yamada-ui/utils");
|
1020
1020
|
var import_react6 = require("react");
|
1021
1021
|
var useChartReferenceLine = ({
|
1022
1022
|
referenceLineProps = [],
|
1023
1023
|
styles
|
1024
1024
|
}) => {
|
1025
|
-
const { theme } = (0,
|
1026
|
-
const styleClassName = (0,
|
1025
|
+
const { theme } = (0, import_core8.useTheme)();
|
1026
|
+
const styleClassName = (0, import_core8.getCSS)(styles.referenceLine)(theme);
|
1027
1027
|
const propList = (0, import_react6.useMemo)(
|
1028
1028
|
() => referenceLineProps.map((props, index) => {
|
1029
1029
|
const [{ label: labelProp, ...rest }, propClassName] = getComponentProps(
|
1030
1030
|
[props, referenceLineProperties],
|
1031
1031
|
styleClassName
|
1032
1032
|
)(theme);
|
1033
|
-
const color = (
|
1033
|
+
const color = `var(--ui-reference-line-${index})`;
|
1034
1034
|
const label = {
|
1035
1035
|
value: labelProp,
|
1036
1036
|
fill: color,
|
@@ -1059,7 +1059,7 @@ var useChartReferenceLine = ({
|
|
1059
1059
|
};
|
1060
1060
|
|
1061
1061
|
// src/use-chart-tooltip.ts
|
1062
|
-
var
|
1062
|
+
var import_core9 = require("@yamada-ui/core");
|
1063
1063
|
var import_utils10 = require("@yamada-ui/utils");
|
1064
1064
|
var import_react7 = require("react");
|
1065
1065
|
var useChartTooltip = ({
|
@@ -1067,7 +1067,7 @@ var useChartTooltip = ({
|
|
1067
1067
|
tooltipAnimationDuration = 0,
|
1068
1068
|
styles
|
1069
1069
|
}) => {
|
1070
|
-
const { theme } = (0,
|
1070
|
+
const { theme } = (0, import_core9.useTheme)();
|
1071
1071
|
const { cursor, ...rest } = _tooltipProps;
|
1072
1072
|
const cursorClassName = (0, import_react7.useMemo)(
|
1073
1073
|
() => getClassName({ ...styles.cursor, ...cursor })(theme),
|
@@ -1095,8 +1095,8 @@ var useChartTooltip = ({
|
|
1095
1095
|
|
1096
1096
|
// src/area-chart.tsx
|
1097
1097
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
1098
|
-
var AreaChart = (0,
|
1099
|
-
const [styles, mergedProps] = (0,
|
1098
|
+
var AreaChart = (0, import_core10.forwardRef)((props, ref) => {
|
1099
|
+
const [styles, mergedProps] = (0, import_core10.useMultiComponentStyle)("AreaChart", props);
|
1100
1100
|
const {
|
1101
1101
|
className,
|
1102
1102
|
series,
|
@@ -1141,7 +1141,7 @@ var AreaChart = (0, import_core11.forwardRef)((props, ref) => {
|
|
1141
1141
|
splitOffset,
|
1142
1142
|
syncId,
|
1143
1143
|
...rest
|
1144
|
-
} = (0,
|
1144
|
+
} = (0, import_core10.omitThemeProps)(mergedProps);
|
1145
1145
|
const {
|
1146
1146
|
getAreaChartProps,
|
1147
1147
|
getAreaSplitProps,
|
@@ -1241,7 +1241,7 @@ var AreaChart = (0, import_core11.forwardRef)((props, ref) => {
|
|
1241
1241
|
[getReferenceLineProps, referenceLineProps]
|
1242
1242
|
);
|
1243
1243
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
1244
|
-
|
1244
|
+
import_core10.ui.div,
|
1245
1245
|
{
|
1246
1246
|
ref,
|
1247
1247
|
className: (0, import_utils11.cx)("ui-area-chart", className),
|