@yamada-ui/charts 1.5.0-dev-20240825090212 → 1.5.0-dev-20240825095648
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/index.js
CHANGED
@@ -892,7 +892,7 @@ var useChartReferenceLine = ({
|
|
892
892
|
[props, referenceLineProperties],
|
893
893
|
styleClassName
|
894
894
|
)(theme);
|
895
|
-
const color = (
|
895
|
+
const color = `var(--ui-reference-line-${index})`;
|
896
896
|
const label = {
|
897
897
|
value: labelProp,
|
898
898
|
fill: color,
|
@@ -989,6 +989,7 @@ var useLineChart = ({
|
|
989
989
|
} = (_a = rest.lineProps) != null ? _a : {};
|
990
990
|
const lineColors = (0, import_react7.useMemo)(
|
991
991
|
() => series.map(({ color }, index) => ({
|
992
|
+
__prefix: "ui",
|
992
993
|
name: `line-${index}`,
|
993
994
|
token: "colors",
|
994
995
|
value: color != null ? color : "transparent"
|
@@ -997,6 +998,7 @@ var useLineChart = ({
|
|
997
998
|
);
|
998
999
|
const referenceLineColors = (0, import_react7.useMemo)(
|
999
1000
|
() => referenceLineProps ? referenceLineProps.map(({ color }, index) => ({
|
1001
|
+
__prefix: "ui",
|
1000
1002
|
name: `reference-line-${index}`,
|
1001
1003
|
token: "colors",
|
1002
1004
|
value: color != null ? color : "transparent"
|
@@ -1007,7 +1009,7 @@ var useLineChart = ({
|
|
1007
1009
|
() => [
|
1008
1010
|
...lineColors,
|
1009
1011
|
...referenceLineColors,
|
1010
|
-
{ name: "fill-opacity", value: fillOpacity }
|
1012
|
+
{ __prefix: "ui", name: "fill-opacity", value: fillOpacity }
|
1011
1013
|
],
|
1012
1014
|
[fillOpacity, lineColors, referenceLineColors]
|
1013
1015
|
);
|
@@ -1023,8 +1025,8 @@ var useLineChart = ({
|
|
1023
1025
|
);
|
1024
1026
|
const [lineProps, lineClassName] = (0, import_react7.useMemo)(() => {
|
1025
1027
|
const resolvedLineProps = {
|
1026
|
-
fillOpacity: "
|
1027
|
-
strokeOpacity: "
|
1028
|
+
fillOpacity: "var(--ui-fill-opacity)",
|
1029
|
+
strokeOpacity: "var(--ui-fill-opacity)",
|
1028
1030
|
...computedLineProps
|
1029
1031
|
};
|
1030
1032
|
return getComponentProps(
|
@@ -1072,7 +1074,7 @@ var useLineChart = ({
|
|
1072
1074
|
dimLine: dimLine2 = {},
|
1073
1075
|
...computedProps
|
1074
1076
|
} = props;
|
1075
|
-
const color = (
|
1077
|
+
const color = `var(--ui-line-${index})`;
|
1076
1078
|
const dimmed = shouldHighlight && highlightedArea !== dataKey;
|
1077
1079
|
const computedDimLine = { ...dimLineProps, ...dimLine2 };
|
1078
1080
|
const resolvedProps = {
|
@@ -1458,6 +1460,7 @@ var useBarChart = ({
|
|
1458
1460
|
} = (_a = rest.barProps) != null ? _a : {};
|
1459
1461
|
const barColors = (0, import_react9.useMemo)(
|
1460
1462
|
() => series.map(({ color }, index) => ({
|
1463
|
+
__prefix: "ui",
|
1461
1464
|
name: `bar-${index}`,
|
1462
1465
|
token: "colors",
|
1463
1466
|
value: color != null ? color : "transparent"
|
@@ -1466,6 +1469,7 @@ var useBarChart = ({
|
|
1466
1469
|
);
|
1467
1470
|
const referenceLineColors = (0, import_react9.useMemo)(
|
1468
1471
|
() => referenceLineProps.map(({ color }, index) => ({
|
1472
|
+
__prefix: "ui",
|
1469
1473
|
name: `reference-line-${index}`,
|
1470
1474
|
token: "colors",
|
1471
1475
|
value: color != null ? color : "transparent"
|
@@ -1476,7 +1480,7 @@ var useBarChart = ({
|
|
1476
1480
|
return [
|
1477
1481
|
...barColors,
|
1478
1482
|
...referenceLineColors,
|
1479
|
-
{ name: "fill-opacity", value: fillOpacity }
|
1483
|
+
{ __prefix: "ui", name: "fill-opacity", value: fillOpacity }
|
1480
1484
|
];
|
1481
1485
|
}, [barColors, fillOpacity, referenceLineColors]);
|
1482
1486
|
const [chartProps, barChartClassName] = (0, import_react9.useMemo)(() => {
|
@@ -1488,7 +1492,7 @@ var useBarChart = ({
|
|
1488
1492
|
}, [rest.chartProps, styles.chart, theme]);
|
1489
1493
|
const [barProps, barClassName] = (0, import_react9.useMemo)(() => {
|
1490
1494
|
const resolvedBarProps = {
|
1491
|
-
fillOpacity: "
|
1495
|
+
fillOpacity: "var(--ui-fill-opacity)",
|
1492
1496
|
strokeOpacity: 1,
|
1493
1497
|
...computedBarProps
|
1494
1498
|
};
|
@@ -1527,7 +1531,7 @@ var useBarChart = ({
|
|
1527
1531
|
...computedProps
|
1528
1532
|
} = props;
|
1529
1533
|
const id = `${uuid}-${dataKey}`;
|
1530
|
-
const color = (
|
1534
|
+
const color = `var(--ui-bar-${index})`;
|
1531
1535
|
const dimmed = shouldHighlight && highlightedArea !== dataKey;
|
1532
1536
|
const computedDimBar = { ...dimBarProps, ...dimBar2 };
|
1533
1537
|
const resolvedProps = {
|
@@ -1861,7 +1865,7 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
|
|
1861
1865
|
});
|
1862
1866
|
|
1863
1867
|
// src/area-chart.tsx
|
1864
|
-
var
|
1868
|
+
var import_core14 = require("@yamada-ui/core");
|
1865
1869
|
var import_utils15 = require("@yamada-ui/utils");
|
1866
1870
|
var import_react12 = require("react");
|
1867
1871
|
var import_recharts4 = require("recharts");
|
@@ -1885,16 +1889,14 @@ var AreaGradient = ({
|
|
1885
1889
|
};
|
1886
1890
|
|
1887
1891
|
// src/area-chart-split.tsx
|
1888
|
-
var import_core13 = require("@yamada-ui/core");
|
1889
1892
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
1890
1893
|
var AreaSplit = ({ offset, id, fillOpacity }) => {
|
1891
|
-
const { theme } = (0, import_core13.useTheme)();
|
1892
1894
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
1893
1895
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
1894
1896
|
"stop",
|
1895
1897
|
{
|
1896
1898
|
offset,
|
1897
|
-
stopColor: (
|
1899
|
+
stopColor: "var(--ui-area-split-0)",
|
1898
1900
|
stopOpacity: fillOpacity != null ? fillOpacity : 0.4
|
1899
1901
|
}
|
1900
1902
|
),
|
@@ -1902,7 +1904,7 @@ var AreaSplit = ({ offset, id, fillOpacity }) => {
|
|
1902
1904
|
"stop",
|
1903
1905
|
{
|
1904
1906
|
offset,
|
1905
|
-
stopColor: (
|
1907
|
+
stopColor: "var(--ui-area-split-1)",
|
1906
1908
|
stopOpacity: fillOpacity != null ? fillOpacity : 0.4
|
1907
1909
|
}
|
1908
1910
|
)
|
@@ -1910,7 +1912,7 @@ var AreaSplit = ({ offset, id, fillOpacity }) => {
|
|
1910
1912
|
};
|
1911
1913
|
|
1912
1914
|
// src/use-area-chart.ts
|
1913
|
-
var
|
1915
|
+
var import_core13 = require("@yamada-ui/core");
|
1914
1916
|
var import_utils14 = require("@yamada-ui/utils");
|
1915
1917
|
var import_react11 = require("react");
|
1916
1918
|
var useAreaChart = ({
|
@@ -1936,7 +1938,7 @@ var useAreaChart = ({
|
|
1936
1938
|
}) => {
|
1937
1939
|
var _a;
|
1938
1940
|
const uuid = (0, import_react11.useId)();
|
1939
|
-
const { theme } = (0,
|
1941
|
+
const { theme } = (0, import_core13.useTheme)();
|
1940
1942
|
const [highlightedArea, setHighlightedArea] = (0, import_react11.useState)(null);
|
1941
1943
|
const splitId = `${uuid}-split`;
|
1942
1944
|
const stacked = type === "stacked" || type === "percent";
|
@@ -1951,6 +1953,7 @@ var useAreaChart = ({
|
|
1951
1953
|
} = (_a = rest.areaProps) != null ? _a : {};
|
1952
1954
|
const areaColors = (0, import_react11.useMemo)(
|
1953
1955
|
() => series.map(({ color }, index) => ({
|
1956
|
+
__prefix: "ui",
|
1954
1957
|
name: `area-${index}`,
|
1955
1958
|
token: "colors",
|
1956
1959
|
value: color != null ? color : "transparent"
|
@@ -1959,6 +1962,7 @@ var useAreaChart = ({
|
|
1959
1962
|
);
|
1960
1963
|
const areaSplitColors = (0, import_react11.useMemo)(
|
1961
1964
|
() => splitColors.map((color, index) => ({
|
1965
|
+
__prefix: "ui",
|
1962
1966
|
name: `area-split-${index}`,
|
1963
1967
|
token: "colors",
|
1964
1968
|
value: color != null ? color : "transparent"
|
@@ -1967,6 +1971,7 @@ var useAreaChart = ({
|
|
1967
1971
|
);
|
1968
1972
|
const referenceLineColors = (0, import_react11.useMemo)(
|
1969
1973
|
() => referenceLineProps ? referenceLineProps.map(({ color }, index) => ({
|
1974
|
+
__prefix: "ui",
|
1970
1975
|
name: `reference-line-${index}`,
|
1971
1976
|
token: "colors",
|
1972
1977
|
value: color != null ? color : "transparent"
|
@@ -1978,10 +1983,9 @@ var useAreaChart = ({
|
|
1978
1983
|
...areaColors,
|
1979
1984
|
...areaSplitColors,
|
1980
1985
|
...referenceLineColors,
|
1981
|
-
{ name: "fill-opacity", value: fillOpacity }
|
1986
|
+
{ __prefix: "ui", name: "fill-opacity", value: fillOpacity }
|
1982
1987
|
];
|
1983
1988
|
}, [areaColors, areaSplitColors, referenceLineColors, fillOpacity]);
|
1984
|
-
const fillOpacityVar = (0, import_react11.useMemo)(() => (0, import_core14.getVar)("fill-opacity")(theme), [theme]);
|
1985
1989
|
const [chartProps, areaChartClassName] = (0, import_react11.useMemo)(
|
1986
1990
|
() => {
|
1987
1991
|
var _a2;
|
@@ -2056,7 +2060,7 @@ var useAreaChart = ({
|
|
2056
2060
|
...computedProps
|
2057
2061
|
} = props;
|
2058
2062
|
const id = `${uuid}-${dataKey}`;
|
2059
|
-
const color = (
|
2063
|
+
const color = `var(--ui-area-${index})`;
|
2060
2064
|
const dimmed = shouldHighlight && highlightedArea !== dataKey;
|
2061
2065
|
const computedDimArea = { ...dimAreaProps, ...dimArea2 };
|
2062
2066
|
const resolvedProps = {
|
@@ -2168,10 +2172,10 @@ var useAreaChart = ({
|
|
2168
2172
|
(props = {}) => ({
|
2169
2173
|
id: splitId,
|
2170
2174
|
offset: splitOffset != null ? splitOffset : defaultSplitOffset,
|
2171
|
-
fillOpacity:
|
2175
|
+
fillOpacity: "var(--ui-fill-opacity)",
|
2172
2176
|
...props
|
2173
2177
|
}),
|
2174
|
-
[defaultSplitOffset, splitId, splitOffset
|
2178
|
+
[defaultSplitOffset, splitId, splitOffset]
|
2175
2179
|
);
|
2176
2180
|
const getAreaProps = (0, import_react11.useCallback)(
|
2177
2181
|
({ index, className: classNameProp, ...props }, ref = null) => {
|
@@ -2218,10 +2222,10 @@ var useAreaChart = ({
|
|
2218
2222
|
const getAreaGradientProps = (0, import_react11.useCallback)(
|
2219
2223
|
(props = {}) => ({
|
2220
2224
|
withGradient,
|
2221
|
-
fillOpacity:
|
2225
|
+
fillOpacity: "var(--ui-fill-opacity)",
|
2222
2226
|
...props
|
2223
2227
|
}),
|
2224
|
-
[withGradient
|
2228
|
+
[withGradient]
|
2225
2229
|
);
|
2226
2230
|
return {
|
2227
2231
|
getAreaChartProps,
|
@@ -2235,8 +2239,8 @@ var useAreaChart = ({
|
|
2235
2239
|
|
2236
2240
|
// src/area-chart.tsx
|
2237
2241
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
2238
|
-
var AreaChart = (0,
|
2239
|
-
const [styles, mergedProps] = (0,
|
2242
|
+
var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
|
2243
|
+
const [styles, mergedProps] = (0, import_core14.useMultiComponentStyle)("AreaChart", props);
|
2240
2244
|
const {
|
2241
2245
|
className,
|
2242
2246
|
series,
|
@@ -2281,7 +2285,7 @@ var AreaChart = (0, import_core15.forwardRef)((props, ref) => {
|
|
2281
2285
|
splitOffset,
|
2282
2286
|
syncId,
|
2283
2287
|
...rest
|
2284
|
-
} = (0,
|
2288
|
+
} = (0, import_core14.omitThemeProps)(mergedProps);
|
2285
2289
|
const {
|
2286
2290
|
getAreaChartProps,
|
2287
2291
|
getAreaSplitProps,
|
@@ -2381,7 +2385,7 @@ var AreaChart = (0, import_core15.forwardRef)((props, ref) => {
|
|
2381
2385
|
[getReferenceLineProps, referenceLineProps]
|
2382
2386
|
);
|
2383
2387
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
2384
|
-
|
2388
|
+
import_core14.ui.div,
|
2385
2389
|
{
|
2386
2390
|
ref,
|
2387
2391
|
className: (0, import_utils15.cx)("ui-area-chart", className),
|
@@ -2465,13 +2469,13 @@ var AreaChart = (0, import_core15.forwardRef)((props, ref) => {
|
|
2465
2469
|
});
|
2466
2470
|
|
2467
2471
|
// src/radar-chart.tsx
|
2468
|
-
var
|
2472
|
+
var import_core16 = require("@yamada-ui/core");
|
2469
2473
|
var import_utils17 = require("@yamada-ui/utils");
|
2470
2474
|
var import_react14 = require("react");
|
2471
2475
|
var import_recharts5 = require("recharts");
|
2472
2476
|
|
2473
2477
|
// src/use-radar-chart.ts
|
2474
|
-
var
|
2478
|
+
var import_core15 = require("@yamada-ui/core");
|
2475
2479
|
var import_utils16 = require("@yamada-ui/utils");
|
2476
2480
|
var import_react13 = require("react");
|
2477
2481
|
var useRadarChart = ({
|
@@ -2489,7 +2493,7 @@ var useRadarChart = ({
|
|
2489
2493
|
...rest
|
2490
2494
|
}) => {
|
2491
2495
|
var _a;
|
2492
|
-
const { theme } = (0,
|
2496
|
+
const { theme } = (0, import_core15.useTheme)();
|
2493
2497
|
const [highlightedArea, setHighlightedArea] = (0, import_react13.useState)(null);
|
2494
2498
|
const shouldHighlight = highlightedArea !== null;
|
2495
2499
|
const {
|
@@ -2501,6 +2505,7 @@ var useRadarChart = ({
|
|
2501
2505
|
} = (_a = rest.radarProps) != null ? _a : {};
|
2502
2506
|
const radarColors = (0, import_react13.useMemo)(
|
2503
2507
|
() => series.map(({ color }, index) => ({
|
2508
|
+
__prefix: "ui",
|
2504
2509
|
name: `radar-${index}`,
|
2505
2510
|
token: "colors",
|
2506
2511
|
value: color != null ? color : "transparent"
|
@@ -2510,7 +2515,7 @@ var useRadarChart = ({
|
|
2510
2515
|
const radarVars = (0, import_react13.useMemo)(
|
2511
2516
|
() => [
|
2512
2517
|
...radarColors,
|
2513
|
-
{ name: "fill-opacity", value: fillOpacity }
|
2518
|
+
{ __prefix: "ui", name: "fill-opacity", value: fillOpacity }
|
2514
2519
|
],
|
2515
2520
|
[fillOpacity, radarColors]
|
2516
2521
|
);
|
@@ -2570,7 +2575,7 @@ var useRadarChart = ({
|
|
2570
2575
|
);
|
2571
2576
|
const [radarProps, radarClassName] = (0, import_react13.useMemo)(() => {
|
2572
2577
|
const resolvedRadarProps = {
|
2573
|
-
fillOpacity: "
|
2578
|
+
fillOpacity: "var(--ui-fill-opacity)",
|
2574
2579
|
...computedRadarProps
|
2575
2580
|
};
|
2576
2581
|
return getComponentProps(
|
@@ -2618,7 +2623,7 @@ var useRadarChart = ({
|
|
2618
2623
|
dimRadar: dimRadar2 = {},
|
2619
2624
|
...computedProps
|
2620
2625
|
} = props;
|
2621
|
-
const color = (
|
2626
|
+
const color = `var(--ui-radar-${index})`;
|
2622
2627
|
const dimmed = shouldHighlight && highlightedArea !== dataKey2;
|
2623
2628
|
const computedDimRadar = { ...dimRadarProps, ...dimRadar2 };
|
2624
2629
|
const resolvedProps = {
|
@@ -2798,8 +2803,8 @@ var useRadarChart = ({
|
|
2798
2803
|
|
2799
2804
|
// src/radar-chart.tsx
|
2800
2805
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
2801
|
-
var RadarChart = (0,
|
2802
|
-
const [styles, mergedProps] = (0,
|
2806
|
+
var RadarChart = (0, import_core16.forwardRef)((props, ref) => {
|
2807
|
+
const [styles, mergedProps] = (0, import_core16.useMultiComponentStyle)("RadarChart", props);
|
2803
2808
|
const {
|
2804
2809
|
className,
|
2805
2810
|
data,
|
@@ -2831,7 +2836,7 @@ var RadarChart = (0, import_core17.forwardRef)((props, ref) => {
|
|
2831
2836
|
withPolarAngleAxis = true,
|
2832
2837
|
withPolarRadiusAxis = false,
|
2833
2838
|
...rest
|
2834
|
-
} = (0,
|
2839
|
+
} = (0, import_core16.omitThemeProps)(mergedProps);
|
2835
2840
|
const {
|
2836
2841
|
getRadarProps,
|
2837
2842
|
getRadarChartProps,
|
@@ -2880,7 +2885,7 @@ var RadarChart = (0, import_core17.forwardRef)((props, ref) => {
|
|
2880
2885
|
[getRadarProps, series]
|
2881
2886
|
);
|
2882
2887
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
2883
|
-
|
2888
|
+
import_core16.ui.div,
|
2884
2889
|
{
|
2885
2890
|
ref,
|
2886
2891
|
className: (0, import_utils17.cx)("ui-radar-chart", className),
|
@@ -2963,18 +2968,18 @@ var RadarChart = (0, import_core17.forwardRef)((props, ref) => {
|
|
2963
2968
|
});
|
2964
2969
|
|
2965
2970
|
// src/donut-chart.tsx
|
2966
|
-
var
|
2971
|
+
var import_core20 = require("@yamada-ui/core");
|
2967
2972
|
var import_utils21 = require("@yamada-ui/utils");
|
2968
2973
|
var import_react17 = require("react");
|
2969
2974
|
var import_recharts6 = require("recharts");
|
2970
2975
|
|
2971
2976
|
// src/use-chart-label.ts
|
2972
|
-
var
|
2977
|
+
var import_core17 = require("@yamada-ui/core");
|
2973
2978
|
var import_utils18 = require("@yamada-ui/utils");
|
2974
2979
|
var import_react15 = require("react");
|
2975
2980
|
var useChartLabel = ({ styles, ...rest }) => {
|
2976
2981
|
var _a;
|
2977
|
-
const { theme } = (0,
|
2982
|
+
const { theme } = (0, import_core17.useTheme)();
|
2978
2983
|
const [labelProps, labelClassName] = getComponentProps(
|
2979
2984
|
[(_a = rest.labelProps) != null ? _a : {}, labelProperties],
|
2980
2985
|
styles.label
|
@@ -2994,12 +2999,12 @@ var useChartLabel = ({ styles, ...rest }) => {
|
|
2994
2999
|
};
|
2995
3000
|
|
2996
3001
|
// src/use-pie-chart.ts
|
2997
|
-
var
|
3002
|
+
var import_core19 = require("@yamada-ui/core");
|
2998
3003
|
var import_utils20 = require("@yamada-ui/utils");
|
2999
3004
|
var import_react16 = require("react");
|
3000
3005
|
|
3001
3006
|
// src/pie-chart-label.tsx
|
3002
|
-
var
|
3007
|
+
var import_core18 = require("@yamada-ui/core");
|
3003
3008
|
var import_utils19 = require("@yamada-ui/utils");
|
3004
3009
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
3005
3010
|
var RADIAN = Math.PI / 180;
|
@@ -3034,7 +3039,7 @@ var pieChartLabel = ({
|
|
3034
3039
|
}
|
3035
3040
|
};
|
3036
3041
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
3037
|
-
|
3042
|
+
import_core18.ui.text,
|
3038
3043
|
{
|
3039
3044
|
className: (0, import_utils19.cx)(cellClassName, "ui-chart__label"),
|
3040
3045
|
x,
|
@@ -3065,7 +3070,7 @@ var pieChartLabelLine = ({
|
|
3065
3070
|
const y = cyProp + (middleRadius + labelOffset) * Math.sin(-midAngle * RADIAN);
|
3066
3071
|
const d = `M ${points[0].x} ${points[0].y} L ${x} ${y}`;
|
3067
3072
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
3068
|
-
|
3073
|
+
import_core18.ui.path,
|
3069
3074
|
{
|
3070
3075
|
className: (0, import_utils19.cx)(cellClassName, "ui-chart__label-line"),
|
3071
3076
|
d,
|
@@ -3094,7 +3099,7 @@ var usePieChart = ({
|
|
3094
3099
|
...rest
|
3095
3100
|
}) => {
|
3096
3101
|
var _a, _b;
|
3097
|
-
const { theme } = (0,
|
3102
|
+
const { theme } = (0, import_core19.useTheme)();
|
3098
3103
|
const [highlightedArea, setHighlightedArea] = (0, import_react16.useState)(null);
|
3099
3104
|
const shouldHighlight = highlightedArea !== null;
|
3100
3105
|
const { dimCell, ...computedCellProps } = (_a = rest.cellProps) != null ? _a : {};
|
@@ -3107,6 +3112,7 @@ var usePieChart = ({
|
|
3107
3112
|
} = (_b = rest.pieProps) != null ? _b : {};
|
3108
3113
|
const cellColors = (0, import_react16.useMemo)(
|
3109
3114
|
() => data.map(({ color }, index) => ({
|
3115
|
+
__prefix: "ui",
|
3110
3116
|
name: `cell-${index}`,
|
3111
3117
|
token: "colors",
|
3112
3118
|
value: color != null ? color : "transparent"
|
@@ -3116,7 +3122,7 @@ var usePieChart = ({
|
|
3116
3122
|
const pieVars = (0, import_react16.useMemo)(
|
3117
3123
|
() => [
|
3118
3124
|
...cellColors,
|
3119
|
-
{ name: "fill-opacity", value: fillOpacity }
|
3125
|
+
{ __prefix: "ui", name: "fill-opacity", value: fillOpacity }
|
3120
3126
|
],
|
3121
3127
|
[fillOpacity, cellColors]
|
3122
3128
|
);
|
@@ -3139,7 +3145,7 @@ var usePieChart = ({
|
|
3139
3145
|
);
|
3140
3146
|
const cellClassName = (0, import_react16.useMemo)(() => {
|
3141
3147
|
const resolvedCellProps = {
|
3142
|
-
fillOpacity: "
|
3148
|
+
fillOpacity: "var(--ui-fill-opacity)",
|
3143
3149
|
...styles.cell,
|
3144
3150
|
...computedCellProps
|
3145
3151
|
};
|
@@ -3188,7 +3194,7 @@ var usePieChart = ({
|
|
3188
3194
|
const cellPropList = (0, import_react16.useMemo)(
|
3189
3195
|
() => data.map((props, index) => {
|
3190
3196
|
const { name, dimCell: dimCell2 = {}, ...computedProps } = props;
|
3191
|
-
const color = (
|
3197
|
+
const color = `var(--ui-cell-${index})`;
|
3192
3198
|
const dimmed = shouldHighlight && highlightedArea !== name;
|
3193
3199
|
const resolvedProps = {
|
3194
3200
|
...computedProps,
|
@@ -3286,8 +3292,8 @@ var usePieChart = ({
|
|
3286
3292
|
|
3287
3293
|
// src/donut-chart.tsx
|
3288
3294
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
3289
|
-
var DonutChart = (0,
|
3290
|
-
const [styles, mergedProps] = (0,
|
3295
|
+
var DonutChart = (0, import_core20.forwardRef)((props, ref) => {
|
3296
|
+
const [styles, mergedProps] = (0, import_core20.useMultiComponentStyle)("DonutChart", props);
|
3291
3297
|
const {
|
3292
3298
|
className,
|
3293
3299
|
data,
|
@@ -3316,7 +3322,7 @@ var DonutChart = (0, import_core21.forwardRef)((props, ref) => {
|
|
3316
3322
|
legendProps,
|
3317
3323
|
labelProps,
|
3318
3324
|
...rest
|
3319
|
-
} = (0,
|
3325
|
+
} = (0, import_core20.omitThemeProps)(mergedProps);
|
3320
3326
|
const {
|
3321
3327
|
pieVars,
|
3322
3328
|
getPieProps,
|
@@ -3362,7 +3368,7 @@ var DonutChart = (0, import_core21.forwardRef)((props, ref) => {
|
|
3362
3368
|
[data, getCellProps]
|
3363
3369
|
);
|
3364
3370
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
3365
|
-
|
3371
|
+
import_core20.ui.div,
|
3366
3372
|
{
|
3367
3373
|
ref,
|
3368
3374
|
className: (0, import_utils21.cx)("ui-donut-chart", className),
|
@@ -3437,13 +3443,13 @@ var DonutChart = (0, import_core21.forwardRef)((props, ref) => {
|
|
3437
3443
|
});
|
3438
3444
|
|
3439
3445
|
// src/pie-chart.tsx
|
3440
|
-
var
|
3446
|
+
var import_core21 = require("@yamada-ui/core");
|
3441
3447
|
var import_utils22 = require("@yamada-ui/utils");
|
3442
3448
|
var import_react18 = require("react");
|
3443
3449
|
var import_recharts7 = require("recharts");
|
3444
3450
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
3445
|
-
var PieChart = (0,
|
3446
|
-
const [styles, mergedProps] = (0,
|
3451
|
+
var PieChart = (0, import_core21.forwardRef)((props, ref) => {
|
3452
|
+
const [styles, mergedProps] = (0, import_core21.useMultiComponentStyle)("PieChart", props);
|
3447
3453
|
const {
|
3448
3454
|
className,
|
3449
3455
|
data,
|
@@ -3471,7 +3477,7 @@ var PieChart = (0, import_core22.forwardRef)((props, ref) => {
|
|
3471
3477
|
strokeWidth,
|
3472
3478
|
legendProps,
|
3473
3479
|
...rest
|
3474
|
-
} = (0,
|
3480
|
+
} = (0, import_core21.omitThemeProps)(mergedProps);
|
3475
3481
|
const {
|
3476
3482
|
pieVars,
|
3477
3483
|
getPieProps,
|
@@ -3516,7 +3522,7 @@ var PieChart = (0, import_core22.forwardRef)((props, ref) => {
|
|
3516
3522
|
[data, getCellProps]
|
3517
3523
|
);
|
3518
3524
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
3519
|
-
|
3525
|
+
import_core21.ui.div,
|
3520
3526
|
{
|
3521
3527
|
ref,
|
3522
3528
|
className: (0, import_utils22.cx)("ui-pie-chart", className),
|