@yamada-ui/charts 2.0.0-next-20240704080818 → 2.0.0-next-20240706053520

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. package/dist/area-chart.js +112 -16
  2. package/dist/area-chart.js.map +1 -1
  3. package/dist/area-chart.mjs +11 -11
  4. package/dist/bar-chart.js +112 -16
  5. package/dist/bar-chart.js.map +1 -1
  6. package/dist/bar-chart.mjs +11 -11
  7. package/dist/chart-legend.mjs +3 -3
  8. package/dist/chart-tooltip.mjs +3 -3
  9. package/dist/chart.types.d.mts +2 -1
  10. package/dist/chart.types.d.ts +2 -1
  11. package/dist/chart.types.js.map +1 -1
  12. package/dist/{chunk-LM2DQK2P.mjs → chunk-5Q6O726L.mjs} +2 -2
  13. package/dist/{chunk-SEBQBOCB.mjs → chunk-B7M3YMES.mjs} +2 -2
  14. package/dist/{chunk-LGMALZCN.mjs → chunk-D7EZKGCJ.mjs} +2 -2
  15. package/dist/{chunk-NEGDEVRX.mjs → chunk-DGOXJ373.mjs} +2 -2
  16. package/dist/{chunk-LAYNVROX.mjs → chunk-DWLZIGGL.mjs} +44 -14
  17. package/dist/chunk-DWLZIGGL.mjs.map +1 -0
  18. package/dist/{chunk-AIM5FCJI.mjs → chunk-F2RBOLDY.mjs} +7 -7
  19. package/dist/{chunk-OSNFBRHL.mjs → chunk-F34FV5DY.mjs} +13 -2
  20. package/dist/{chunk-OSNFBRHL.mjs.map → chunk-F34FV5DY.mjs.map} +1 -1
  21. package/dist/{chunk-JXZPTLLZ.mjs → chunk-HZSEVGCR.mjs} +19 -3
  22. package/dist/chunk-HZSEVGCR.mjs.map +1 -0
  23. package/dist/{chunk-OS3525CT.mjs → chunk-IOVOXWUL.mjs} +44 -14
  24. package/dist/chunk-IOVOXWUL.mjs.map +1 -0
  25. package/dist/{chunk-SAP2SGIZ.mjs → chunk-K6OUXJQK.mjs} +44 -14
  26. package/dist/chunk-K6OUXJQK.mjs.map +1 -0
  27. package/dist/{chunk-D3YZFAFO.mjs → chunk-MVKJVXAK.mjs} +19 -3
  28. package/dist/chunk-MVKJVXAK.mjs.map +1 -0
  29. package/dist/{chunk-JSDS6QWX.mjs → chunk-OSSQ2IHJ.mjs} +7 -7
  30. package/dist/{chunk-K6OJ62SA.mjs → chunk-P4MMHTAP.mjs} +7 -7
  31. package/dist/{chunk-LBC2B6UX.mjs → chunk-PSJKBKOF.mjs} +2 -2
  32. package/dist/{chunk-MWPICUEW.mjs → chunk-Q7CCSKX3.mjs} +2 -2
  33. package/dist/{chunk-XIFDRM7J.mjs → chunk-STBYN5JW.mjs} +2 -2
  34. package/dist/{chunk-RN6PXJAD.mjs → chunk-UK6B6KJ7.mjs} +2 -2
  35. package/dist/{chunk-P7AFSM5W.mjs → chunk-XHDDK4ZU.mjs} +56 -14
  36. package/dist/chunk-XHDDK4ZU.mjs.map +1 -0
  37. package/dist/{chunk-IIBF2GUV.mjs → chunk-XZVWGY4J.mjs} +18 -3
  38. package/dist/chunk-XZVWGY4J.mjs.map +1 -0
  39. package/dist/{chunk-MFYRHF3O.mjs → chunk-YGKNNA34.mjs} +2 -2
  40. package/dist/donut-chart.js.map +1 -1
  41. package/dist/donut-chart.mjs +8 -8
  42. package/dist/index.js +209 -24
  43. package/dist/index.js.map +1 -1
  44. package/dist/index.mjs +20 -20
  45. package/dist/line-chart.js +111 -16
  46. package/dist/line-chart.js.map +1 -1
  47. package/dist/line-chart.mjs +11 -11
  48. package/dist/pie-chart.js.map +1 -1
  49. package/dist/pie-chart.mjs +8 -8
  50. package/dist/radar-chart.js.map +1 -1
  51. package/dist/radar-chart.mjs +8 -8
  52. package/dist/rechart-properties.d.mts +2 -1
  53. package/dist/rechart-properties.d.ts +2 -1
  54. package/dist/rechart-properties.js +12 -0
  55. package/dist/rechart-properties.js.map +1 -1
  56. package/dist/rechart-properties.mjs +3 -1
  57. package/dist/use-area-chart.d.mts +9 -1
  58. package/dist/use-area-chart.d.ts +9 -1
  59. package/dist/use-area-chart.js +17 -1
  60. package/dist/use-area-chart.js.map +1 -1
  61. package/dist/use-area-chart.mjs +2 -2
  62. package/dist/use-bar-chart.d.mts +9 -1
  63. package/dist/use-bar-chart.d.ts +9 -1
  64. package/dist/use-bar-chart.js +17 -1
  65. package/dist/use-bar-chart.js.map +1 -1
  66. package/dist/use-bar-chart.mjs +2 -2
  67. package/dist/use-chart-axis.d.mts +20 -2
  68. package/dist/use-chart-axis.d.ts +20 -2
  69. package/dist/use-chart-axis.js +63 -12
  70. package/dist/use-chart-axis.js.map +1 -1
  71. package/dist/use-chart-axis.mjs +2 -2
  72. package/dist/use-chart-grid.js.map +1 -1
  73. package/dist/use-chart-grid.mjs +2 -2
  74. package/dist/use-chart-legend.js.map +1 -1
  75. package/dist/use-chart-legend.mjs +2 -2
  76. package/dist/use-chart-reference-line.js.map +1 -1
  77. package/dist/use-chart-reference-line.mjs +2 -2
  78. package/dist/use-chart-tooltip.js.map +1 -1
  79. package/dist/use-chart-tooltip.mjs +2 -2
  80. package/dist/use-chart.js.map +1 -1
  81. package/dist/use-chart.mjs +2 -2
  82. package/dist/use-line-chart.d.mts +9 -1
  83. package/dist/use-line-chart.d.ts +9 -1
  84. package/dist/use-line-chart.js +16 -1
  85. package/dist/use-line-chart.js.map +1 -1
  86. package/dist/use-line-chart.mjs +2 -2
  87. package/dist/use-pie-chart.js.map +1 -1
  88. package/dist/use-pie-chart.mjs +2 -2
  89. package/dist/use-radar-chart.js.map +1 -1
  90. package/dist/use-radar-chart.mjs +2 -2
  91. package/package.json +3 -3
  92. package/dist/chunk-D3YZFAFO.mjs.map +0 -1
  93. package/dist/chunk-IIBF2GUV.mjs.map +0 -1
  94. package/dist/chunk-JXZPTLLZ.mjs.map +0 -1
  95. package/dist/chunk-LAYNVROX.mjs.map +0 -1
  96. package/dist/chunk-OS3525CT.mjs.map +0 -1
  97. package/dist/chunk-P7AFSM5W.mjs.map +0 -1
  98. package/dist/chunk-SAP2SGIZ.mjs.map +0 -1
  99. /package/dist/{chunk-LM2DQK2P.mjs.map → chunk-5Q6O726L.mjs.map} +0 -0
  100. /package/dist/{chunk-SEBQBOCB.mjs.map → chunk-B7M3YMES.mjs.map} +0 -0
  101. /package/dist/{chunk-LGMALZCN.mjs.map → chunk-D7EZKGCJ.mjs.map} +0 -0
  102. /package/dist/{chunk-NEGDEVRX.mjs.map → chunk-DGOXJ373.mjs.map} +0 -0
  103. /package/dist/{chunk-AIM5FCJI.mjs.map → chunk-F2RBOLDY.mjs.map} +0 -0
  104. /package/dist/{chunk-JSDS6QWX.mjs.map → chunk-OSSQ2IHJ.mjs.map} +0 -0
  105. /package/dist/{chunk-K6OJ62SA.mjs.map → chunk-P4MMHTAP.mjs.map} +0 -0
  106. /package/dist/{chunk-LBC2B6UX.mjs.map → chunk-PSJKBKOF.mjs.map} +0 -0
  107. /package/dist/{chunk-MWPICUEW.mjs.map → chunk-Q7CCSKX3.mjs.map} +0 -0
  108. /package/dist/{chunk-XIFDRM7J.mjs.map → chunk-STBYN5JW.mjs.map} +0 -0
  109. /package/dist/{chunk-RN6PXJAD.mjs.map → chunk-UK6B6KJ7.mjs.map} +0 -0
  110. /package/dist/{chunk-MFYRHF3O.mjs.map → chunk-YGKNNA34.mjs.map} +0 -0
package/dist/index.js CHANGED
@@ -506,6 +506,16 @@ var polarRadiusAxisProperties = [
506
506
  "onMouseEnter",
507
507
  "onMouseLeave"
508
508
  ];
509
+ var labelProperties = [
510
+ "viewBox",
511
+ "formatter",
512
+ "value",
513
+ "position",
514
+ "offset",
515
+ "children",
516
+ "content",
517
+ "id"
518
+ ];
509
519
 
510
520
  // src/use-chart.ts
511
521
  var [ChartProvider, useChartContext] = (0, import_utils2.createContext)({
@@ -673,12 +683,14 @@ var useChartAxis = ({
673
683
  gridAxis = "x",
674
684
  withXAxis = true,
675
685
  withYAxis = true,
676
- xAxisProps: _xAxisProps = {},
677
- yAxisProps: _yAxisProps = {},
686
+ xAxisLabel: xAxisLabelProp,
687
+ yAxisLabel: yAxisLabelProp,
678
688
  unit,
679
689
  valueFormatter,
680
- styles
690
+ styles,
691
+ ...rest
681
692
  }) => {
693
+ var _a, _b, _c, _d;
682
694
  const { theme } = (0, import_core5.useTheme)();
683
695
  const xAxisKey = (0, import_react2.useMemo)(
684
696
  () => layoutType === "vertical" ? { type: "number" } : { dataKey },
@@ -695,14 +707,24 @@ var useChartAxis = ({
695
707
  const yTickLine = getTickLine(withYTickLine);
696
708
  const yAxisTickFormatter = type === "percent" && layoutType !== "vertical" ? valueToPercent : valueFormatter;
697
709
  const xAxisTickFormatter = type === "percent" && layoutType === "vertical" ? valueToPercent : valueFormatter;
698
- const [xAxisReChartsProps, xAxisClassName] = getComponentProps(
699
- [_xAxisProps, xAxisProperties],
710
+ const xAxisLabel = layoutType === "vertical" ? yAxisLabelProp : xAxisLabelProp;
711
+ const yAxisLabel = layoutType === "vertical" ? xAxisLabelProp : yAxisLabelProp;
712
+ const [xAxisProps, xAxisClassName] = getComponentProps(
713
+ [(_a = rest.xAxisProps) != null ? _a : {}, xAxisProperties],
700
714
  styles.xAxis
701
715
  )(theme);
702
- const [yAxisReChartsProps, yAxisClassName] = getComponentProps(
703
- [_yAxisProps, yAxisProperties],
716
+ const [yAxisProps, yAxisClassName] = getComponentProps(
717
+ [(_b = rest.yAxisProps) != null ? _b : {}, yAxisProperties],
704
718
  styles.yAxis
705
719
  )(theme);
720
+ const [xAxisLabelProps, xAxisLabelClassName] = getComponentProps(
721
+ [(_c = rest.xAxisLabelProps) != null ? _c : {}, labelProperties],
722
+ styles.xAxisLabel
723
+ )(theme);
724
+ const [yAxisLabelProps, yAxisLabelClassName] = getComponentProps(
725
+ [(_d = rest.yAxisLabelProps) != null ? _d : {}, labelProperties],
726
+ styles.yAxisLabel
727
+ )(theme);
706
728
  const getXAxisProps = (0, import_react2.useCallback)(
707
729
  ({ className, ...props } = {}) => ({
708
730
  className: (0, import_utils5.cx)(className, xAxisClassName),
@@ -718,7 +740,7 @@ var useChartAxis = ({
718
740
  minTickGap: 5,
719
741
  tickFormatter: xAxisTickFormatter,
720
742
  ...props,
721
- ...xAxisReChartsProps
743
+ ...xAxisProps
722
744
  }),
723
745
  [
724
746
  xAxisClassName,
@@ -726,7 +748,7 @@ var useChartAxis = ({
726
748
  xAxisKey,
727
749
  xTickLine,
728
750
  xAxisTickFormatter,
729
- xAxisReChartsProps
751
+ xAxisProps
730
752
  ]
731
753
  );
732
754
  const getYAxisProps = (0, import_react2.useCallback)(
@@ -744,7 +766,7 @@ var useChartAxis = ({
744
766
  unit,
745
767
  tickFormatter: yAxisTickFormatter,
746
768
  ...props,
747
- ...yAxisReChartsProps
769
+ ...yAxisProps
748
770
  }),
749
771
  [
750
772
  yAxisClassName,
@@ -753,10 +775,39 @@ var useChartAxis = ({
753
775
  yTickLine,
754
776
  unit,
755
777
  yAxisTickFormatter,
756
- yAxisReChartsProps
778
+ yAxisProps
757
779
  ]
758
780
  );
759
- return { getXAxisProps, getYAxisProps };
781
+ const getXAxisLabelProps = (0, import_react2.useCallback)(
782
+ ({ className, ...props } = {}) => ({
783
+ className: (0, import_utils5.cx)(className, xAxisLabelClassName),
784
+ value: xAxisLabel,
785
+ position: "insideBottom",
786
+ offset: -20,
787
+ ...props,
788
+ ...xAxisLabelProps
789
+ }),
790
+ [xAxisLabel, xAxisLabelClassName, xAxisLabelProps]
791
+ );
792
+ const getYAxisLabelProps = (0, import_react2.useCallback)(
793
+ ({ className, ...props } = {}) => ({
794
+ className: (0, import_utils5.cx)(className, yAxisLabelClassName),
795
+ value: yAxisLabel,
796
+ position: "insideLeft",
797
+ angle: -90,
798
+ textAnchor: "middle",
799
+ offset: -5,
800
+ ...props,
801
+ ...yAxisLabelProps
802
+ }),
803
+ [yAxisLabel, yAxisLabelClassName, yAxisLabelProps]
804
+ );
805
+ return {
806
+ getXAxisProps,
807
+ getYAxisProps,
808
+ getXAxisLabelProps,
809
+ getYAxisLabelProps
810
+ };
760
811
  };
761
812
  var valueToPercent = (value) => {
762
813
  return `${(value * 100).toFixed(0)}%`;
@@ -911,6 +962,8 @@ var useLineChart = ({
911
962
  referenceLineProps,
912
963
  fillOpacity = 1,
913
964
  syncId,
965
+ xAxisLabel,
966
+ yAxisLabel,
914
967
  styles,
915
968
  ...rest
916
969
  }) => {
@@ -1092,10 +1145,23 @@ var useLineChart = ({
1092
1145
  data,
1093
1146
  layout: layoutType,
1094
1147
  syncId,
1148
+ margin: {
1149
+ bottom: xAxisLabel ? 30 : void 0,
1150
+ left: yAxisLabel ? 10 : void 0,
1151
+ right: yAxisLabel ? 5 : void 0
1152
+ },
1095
1153
  ...props,
1096
1154
  ...chartProps
1097
1155
  }),
1098
- [data, layoutType, syncId, lineChartClassName, chartProps]
1156
+ [
1157
+ lineChartClassName,
1158
+ data,
1159
+ layoutType,
1160
+ syncId,
1161
+ xAxisLabel,
1162
+ yAxisLabel,
1163
+ chartProps
1164
+ ]
1099
1165
  );
1100
1166
  const getLineProps = (0, import_react7.useCallback)(
1101
1167
  ({ index, className: classNameProp, ...props }, ref = null) => {
@@ -1145,6 +1211,10 @@ var LineChart = (0, import_core10.forwardRef)((props, ref) => {
1145
1211
  withYAxis,
1146
1212
  xAxisProps,
1147
1213
  yAxisProps,
1214
+ xAxisLabel,
1215
+ yAxisLabel,
1216
+ xAxisLabelProps,
1217
+ yAxisLabelProps,
1148
1218
  unit,
1149
1219
  valueFormatter,
1150
1220
  referenceLineProps,
@@ -1180,10 +1250,17 @@ var LineChart = (0, import_core10.forwardRef)((props, ref) => {
1180
1250
  connectNulls,
1181
1251
  fillOpacity,
1182
1252
  syncId,
1253
+ xAxisLabel,
1254
+ yAxisLabel,
1183
1255
  styles
1184
1256
  });
1185
1257
  const { getContainerProps } = useChart({ containerProps });
1186
- const { getXAxisProps, getYAxisProps } = useChartAxis({
1258
+ const {
1259
+ getXAxisProps,
1260
+ getYAxisProps,
1261
+ getXAxisLabelProps,
1262
+ getYAxisLabelProps
1263
+ } = useChartAxis({
1187
1264
  dataKey,
1188
1265
  type,
1189
1266
  layoutType,
@@ -1193,6 +1270,10 @@ var LineChart = (0, import_core10.forwardRef)((props, ref) => {
1193
1270
  withYAxis,
1194
1271
  xAxisProps,
1195
1272
  yAxisProps,
1273
+ xAxisLabel,
1274
+ yAxisLabel,
1275
+ xAxisLabelProps,
1276
+ yAxisLabelProps,
1196
1277
  unit,
1197
1278
  valueFormatter,
1198
1279
  styles
@@ -1261,8 +1342,22 @@ var LineChart = (0, import_core10.forwardRef)((props, ref) => {
1261
1342
  ...getGridProps({ className: "ui-line-chart__grid" })
1262
1343
  }
1263
1344
  ),
1264
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.XAxis, { ...getXAxisProps({ className: "ui-line-chart__x-axis" }) }),
1265
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.YAxis, { ...getYAxisProps({ className: "ui-line-chart__y-axis" }) }),
1345
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.XAxis, { ...getXAxisProps({ className: "ui-line-chart__x-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1346
+ import_recharts.Label,
1347
+ {
1348
+ ...getXAxisLabelProps({
1349
+ className: "ui-line-chart__x-axis-label"
1350
+ })
1351
+ }
1352
+ ) }),
1353
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.YAxis, { ...getYAxisProps({ className: "ui-line-chart__y-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1354
+ import_recharts.Label,
1355
+ {
1356
+ ...getYAxisLabelProps({
1357
+ className: "ui-line-chart__y-axis-label"
1358
+ })
1359
+ }
1360
+ ) }),
1266
1361
  withLegend ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1267
1362
  import_recharts.Legend,
1268
1363
  {
@@ -1324,6 +1419,8 @@ var useBarChart = ({
1324
1419
  referenceLineProps = [],
1325
1420
  fillOpacity = 1,
1326
1421
  syncId,
1422
+ xAxisLabel,
1423
+ yAxisLabel,
1327
1424
  styles,
1328
1425
  ...rest
1329
1426
  }) => {
@@ -1489,10 +1586,24 @@ var useBarChart = ({
1489
1586
  stackOffset: type === "percent" ? "expand" : void 0,
1490
1587
  layout: layoutType,
1491
1588
  syncId,
1589
+ margin: {
1590
+ bottom: xAxisLabel ? 30 : void 0,
1591
+ left: yAxisLabel ? 10 : void 0,
1592
+ right: yAxisLabel ? 5 : void 0
1593
+ },
1492
1594
  ...props,
1493
1595
  ...chartProps
1494
1596
  }),
1495
- [barChartClassName, chartProps, data, syncId, layoutType, type]
1597
+ [
1598
+ barChartClassName,
1599
+ data,
1600
+ type,
1601
+ layoutType,
1602
+ syncId,
1603
+ xAxisLabel,
1604
+ yAxisLabel,
1605
+ chartProps
1606
+ ]
1496
1607
  );
1497
1608
  return {
1498
1609
  barVars,
@@ -1518,6 +1629,10 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
1518
1629
  barProps,
1519
1630
  xAxisProps,
1520
1631
  yAxisProps,
1632
+ xAxisLabel,
1633
+ yAxisLabel,
1634
+ xAxisLabelProps,
1635
+ yAxisLabelProps,
1521
1636
  type = "default",
1522
1637
  withTooltip = true,
1523
1638
  withLegend = false,
@@ -1546,10 +1661,17 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
1546
1661
  referenceLineProps,
1547
1662
  fillOpacity,
1548
1663
  syncId,
1664
+ xAxisLabel,
1665
+ yAxisLabel,
1549
1666
  styles
1550
1667
  });
1551
1668
  const { getContainerProps } = useChart({ containerProps });
1552
- const { getXAxisProps, getYAxisProps } = useChartAxis({
1669
+ const {
1670
+ getXAxisProps,
1671
+ getYAxisProps,
1672
+ getXAxisLabelProps,
1673
+ getYAxisLabelProps
1674
+ } = useChartAxis({
1553
1675
  dataKey,
1554
1676
  type,
1555
1677
  layoutType,
@@ -1559,6 +1681,10 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
1559
1681
  withYAxis,
1560
1682
  xAxisProps,
1561
1683
  yAxisProps,
1684
+ xAxisLabel,
1685
+ yAxisLabel,
1686
+ xAxisLabelProps,
1687
+ yAxisLabelProps,
1562
1688
  unit,
1563
1689
  valueFormatter,
1564
1690
  styles
@@ -1629,8 +1755,22 @@ var BarChart = (0, import_core12.forwardRef)((props, ref) => {
1629
1755
  ...getGridProps({ className: "ui-bar-chart__grid" })
1630
1756
  }
1631
1757
  ),
1632
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts2.XAxis, { ...getXAxisProps({ className: "ui-bar-chart__x-axis" }) }),
1633
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts2.YAxis, { ...getYAxisProps({ className: "ui-bar-chart__y-axis" }) }),
1758
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts2.XAxis, { ...getXAxisProps({ className: "ui-bar-chart__x-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1759
+ import_recharts2.Label,
1760
+ {
1761
+ ...getXAxisLabelProps({
1762
+ className: "ui-bar-chart__x-axis-label"
1763
+ })
1764
+ }
1765
+ ) }),
1766
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_recharts2.YAxis, { ...getYAxisProps({ className: "ui-bar-chart__y-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1767
+ import_recharts2.Label,
1768
+ {
1769
+ ...getYAxisLabelProps({
1770
+ className: "ui-bar-chart__y-axis-label"
1771
+ })
1772
+ }
1773
+ ) }),
1634
1774
  withLegend ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1635
1775
  import_recharts2.Legend,
1636
1776
  {
@@ -1741,6 +1881,8 @@ var useAreaChart = ({
1741
1881
  splitOffset,
1742
1882
  referenceLineProps,
1743
1883
  syncId,
1884
+ xAxisLabel,
1885
+ yAxisLabel,
1744
1886
  styles,
1745
1887
  ...rest
1746
1888
  }) => {
@@ -1950,10 +2092,24 @@ var useAreaChart = ({
1950
2092
  stackOffset: type === "percent" ? "expand" : void 0,
1951
2093
  layout: layoutType,
1952
2094
  syncId,
2095
+ margin: {
2096
+ bottom: xAxisLabel ? 30 : void 0,
2097
+ left: yAxisLabel ? 10 : void 0,
2098
+ right: yAxisLabel ? 5 : void 0
2099
+ },
1953
2100
  ...props,
1954
2101
  ...chartProps
1955
2102
  }),
1956
- [areaChartClassName, data, type, layoutType, syncId, chartProps]
2103
+ [
2104
+ areaChartClassName,
2105
+ data,
2106
+ type,
2107
+ layoutType,
2108
+ syncId,
2109
+ xAxisLabel,
2110
+ yAxisLabel,
2111
+ chartProps
2112
+ ]
1957
2113
  );
1958
2114
  const getAreaSplitProps = (0, import_react11.useCallback)(
1959
2115
  (props = {}) => ({
@@ -2039,6 +2195,10 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
2039
2195
  withYAxis,
2040
2196
  xAxisProps,
2041
2197
  yAxisProps,
2198
+ xAxisLabel,
2199
+ yAxisLabel,
2200
+ xAxisLabelProps,
2201
+ yAxisLabelProps,
2042
2202
  type = "default",
2043
2203
  withTooltip = true,
2044
2204
  withLegend = false,
@@ -2091,10 +2251,17 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
2091
2251
  splitColors,
2092
2252
  splitOffset,
2093
2253
  syncId,
2254
+ xAxisLabel,
2255
+ yAxisLabel,
2094
2256
  styles
2095
2257
  });
2096
2258
  const { getContainerProps } = useChart({ containerProps });
2097
- const { getXAxisProps, getYAxisProps } = useChartAxis({
2259
+ const {
2260
+ getXAxisProps,
2261
+ getYAxisProps,
2262
+ getXAxisLabelProps,
2263
+ getYAxisLabelProps
2264
+ } = useChartAxis({
2098
2265
  dataKey,
2099
2266
  type,
2100
2267
  layoutType,
@@ -2104,6 +2271,10 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
2104
2271
  withYAxis,
2105
2272
  xAxisProps,
2106
2273
  yAxisProps,
2274
+ xAxisLabel,
2275
+ yAxisLabel,
2276
+ xAxisLabelProps,
2277
+ yAxisLabelProps,
2107
2278
  unit,
2108
2279
  valueFormatter,
2109
2280
  styles
@@ -2175,8 +2346,22 @@ var AreaChart = (0, import_core14.forwardRef)((props, ref) => {
2175
2346
  ...getGridProps({ className: "ui-area-chart__grid" })
2176
2347
  }
2177
2348
  ),
2178
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_recharts3.XAxis, { ...getXAxisProps({ className: "ui-area-chart__x-axis" }) }),
2179
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_recharts3.YAxis, { ...getYAxisProps({ className: "ui-area-chart__y-axis" }) }),
2349
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_recharts3.XAxis, { ...getXAxisProps({ className: "ui-area-chart__x-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2350
+ import_recharts3.Label,
2351
+ {
2352
+ ...getXAxisLabelProps({
2353
+ className: "ui-area-chart__x-axis-label"
2354
+ })
2355
+ }
2356
+ ) }),
2357
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_recharts3.YAxis, { ...getYAxisProps({ className: "ui-area-chart__y-axis" }), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2358
+ import_recharts3.Label,
2359
+ {
2360
+ ...getYAxisLabelProps({
2361
+ className: "ui-area-chart__y-axis-label"
2362
+ })
2363
+ }
2364
+ ) }),
2180
2365
  withLegend ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2181
2366
  import_recharts3.Legend,
2182
2367
  {