@mantine/charts 8.3.13 → 9.0.0-alpha.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.
Files changed (112) hide show
  1. package/cjs/AreaChart/AreaChart.cjs +152 -162
  2. package/cjs/AreaChart/AreaChart.cjs.map +1 -1
  3. package/cjs/BarChart/BarChart.cjs +4 -5
  4. package/cjs/BarChart/BarChart.cjs.map +1 -1
  5. package/cjs/BarsList/BarsList.cjs +121 -0
  6. package/cjs/BarsList/BarsList.cjs.map +1 -0
  7. package/cjs/BarsList/BarsList.module.css.cjs +7 -0
  8. package/cjs/BarsList/BarsList.module.css.cjs.map +1 -0
  9. package/cjs/BubbleChart/BubbleChart.cjs +3 -2
  10. package/cjs/BubbleChart/BubbleChart.cjs.map +1 -1
  11. package/cjs/ChartLegend/ChartLegend.cjs +5 -12
  12. package/cjs/ChartLegend/ChartLegend.cjs.map +1 -1
  13. package/cjs/ChartTooltip/ChartTooltip.cjs +2 -2
  14. package/cjs/ChartTooltip/ChartTooltip.cjs.map +1 -1
  15. package/cjs/CompositeChart/CompositeChart.cjs +141 -151
  16. package/cjs/CompositeChart/CompositeChart.cjs.map +1 -1
  17. package/cjs/DonutChart/DonutChart.cjs +5 -4
  18. package/cjs/DonutChart/DonutChart.cjs.map +1 -1
  19. package/cjs/FunnelChart/FunnelChart.cjs +4 -3
  20. package/cjs/FunnelChart/FunnelChart.cjs.map +1 -1
  21. package/cjs/Heatmap/Heatmap.cjs +1 -2
  22. package/cjs/Heatmap/Heatmap.cjs.map +1 -1
  23. package/cjs/LineChart/LineChart.cjs +142 -153
  24. package/cjs/LineChart/LineChart.cjs.map +1 -1
  25. package/cjs/PieChart/PieChart.cjs +10 -9
  26. package/cjs/PieChart/PieChart.cjs.map +1 -1
  27. package/cjs/RadarChart/RadarChart.cjs +3 -2
  28. package/cjs/RadarChart/RadarChart.cjs.map +1 -1
  29. package/cjs/RadialBarChart/RadialBarChart.cjs +3 -2
  30. package/cjs/RadialBarChart/RadialBarChart.cjs.map +1 -1
  31. package/cjs/ScatterChart/ScatterChart.cjs +127 -136
  32. package/cjs/ScatterChart/ScatterChart.cjs.map +1 -1
  33. package/cjs/Sparkline/Sparkline.cjs +7 -5
  34. package/cjs/Sparkline/Sparkline.cjs.map +1 -1
  35. package/cjs/Sparkline/Sparkline.module.css.cjs +7 -0
  36. package/cjs/Sparkline/Sparkline.module.css.cjs.map +1 -0
  37. package/cjs/index.cjs +2 -0
  38. package/cjs/index.cjs.map +1 -1
  39. package/esm/AreaChart/AreaChart.mjs +152 -162
  40. package/esm/AreaChart/AreaChart.mjs.map +1 -1
  41. package/esm/BarChart/BarChart.mjs +4 -5
  42. package/esm/BarChart/BarChart.mjs.map +1 -1
  43. package/esm/BarsList/BarsList.mjs +119 -0
  44. package/esm/BarsList/BarsList.mjs.map +1 -0
  45. package/esm/BarsList/BarsList.module.css.mjs +5 -0
  46. package/esm/BarsList/BarsList.module.css.mjs.map +1 -0
  47. package/esm/BubbleChart/BubbleChart.mjs +3 -2
  48. package/esm/BubbleChart/BubbleChart.mjs.map +1 -1
  49. package/esm/ChartLegend/ChartLegend.mjs +5 -12
  50. package/esm/ChartLegend/ChartLegend.mjs.map +1 -1
  51. package/esm/ChartTooltip/ChartTooltip.mjs +2 -2
  52. package/esm/ChartTooltip/ChartTooltip.mjs.map +1 -1
  53. package/esm/CompositeChart/CompositeChart.mjs +141 -151
  54. package/esm/CompositeChart/CompositeChart.mjs.map +1 -1
  55. package/esm/DonutChart/DonutChart.mjs +5 -4
  56. package/esm/DonutChart/DonutChart.mjs.map +1 -1
  57. package/esm/FunnelChart/FunnelChart.mjs +4 -3
  58. package/esm/FunnelChart/FunnelChart.mjs.map +1 -1
  59. package/esm/Heatmap/Heatmap.mjs +1 -2
  60. package/esm/Heatmap/Heatmap.mjs.map +1 -1
  61. package/esm/LineChart/LineChart.mjs +142 -153
  62. package/esm/LineChart/LineChart.mjs.map +1 -1
  63. package/esm/PieChart/PieChart.mjs +10 -9
  64. package/esm/PieChart/PieChart.mjs.map +1 -1
  65. package/esm/RadarChart/RadarChart.mjs +3 -2
  66. package/esm/RadarChart/RadarChart.mjs.map +1 -1
  67. package/esm/RadialBarChart/RadialBarChart.mjs +3 -2
  68. package/esm/RadialBarChart/RadialBarChart.mjs.map +1 -1
  69. package/esm/ScatterChart/ScatterChart.mjs +127 -136
  70. package/esm/ScatterChart/ScatterChart.mjs.map +1 -1
  71. package/esm/Sparkline/Sparkline.mjs +5 -3
  72. package/esm/Sparkline/Sparkline.mjs.map +1 -1
  73. package/esm/Sparkline/Sparkline.module.css.mjs +5 -0
  74. package/esm/Sparkline/Sparkline.module.css.mjs.map +1 -0
  75. package/esm/index.mjs +1 -0
  76. package/esm/index.mjs.map +1 -1
  77. package/lib/AreaChart/AreaChart.d.ts +10 -10
  78. package/lib/AreaChart/index.d.ts +10 -1
  79. package/lib/BarChart/BarChart.d.ts +6 -6
  80. package/lib/BarChart/index.d.ts +10 -1
  81. package/lib/BarsList/BarsList.d.ts +55 -0
  82. package/lib/BarsList/index.d.ts +9 -0
  83. package/lib/BubbleChart/BubbleChart.d.ts +3 -3
  84. package/lib/BubbleChart/index.d.ts +9 -1
  85. package/lib/ChartLegend/ChartLegend.d.ts +2 -2
  86. package/lib/ChartTooltip/ChartTooltip.d.ts +4 -4
  87. package/lib/CompositeChart/CompositeChart.d.ts +8 -8
  88. package/lib/CompositeChart/index.d.ts +10 -1
  89. package/lib/DonutChart/DonutChart.d.ts +12 -12
  90. package/lib/DonutChart/index.d.ts +9 -1
  91. package/lib/FunnelChart/FunnelChart.d.ts +9 -9
  92. package/lib/FunnelChart/index.d.ts +9 -1
  93. package/lib/Heatmap/Heatmap.d.ts +6 -6
  94. package/lib/Heatmap/HeatmapWeeks.types.d.ts +1 -1
  95. package/lib/Heatmap/index.d.ts +7 -1
  96. package/lib/LineChart/LineChart.d.ts +9 -9
  97. package/lib/LineChart/index.d.ts +10 -1
  98. package/lib/PieChart/PieChart.d.ts +13 -13
  99. package/lib/PieChart/index.d.ts +9 -1
  100. package/lib/RadarChart/RadarChart.d.ts +8 -8
  101. package/lib/RadarChart/index.d.ts +9 -1
  102. package/lib/RadialBarChart/RadialBarChart.d.ts +7 -7
  103. package/lib/RadialBarChart/index.d.ts +8 -1
  104. package/lib/ScatterChart/ScatterChart.d.ts +1 -1
  105. package/lib/ScatterChart/index.d.ts +9 -1
  106. package/lib/Sparkline/Sparkline.d.ts +6 -6
  107. package/lib/Sparkline/index.d.ts +8 -1
  108. package/lib/index.d.mts +1 -0
  109. package/lib/index.d.ts +1 -0
  110. package/package.json +6 -6
  111. package/styles.css +64 -1
  112. package/styles.layer.css +64 -1
@@ -31,7 +31,7 @@ const varsResolver = core.createVarsResolver(
31
31
  }
32
32
  })
33
33
  );
34
- const CompositeChart = core.factory((_props, ref) => {
34
+ const CompositeChart = core.factory((_props) => {
35
35
  const props = core.useProps("CompositeChart", defaultProps, _props);
36
36
  const {
37
37
  classNames,
@@ -140,7 +140,7 @@ const CompositeChart = core.factory((_props, ref) => {
140
140
  connectNulls,
141
141
  type: curveType,
142
142
  strokeDasharray: item.strokeDasharray,
143
- yAxisId: item.yAxisId || "left",
143
+ yAxisId: item.yAxisId || void 0,
144
144
  label: withPointLabels ? /* @__PURE__ */ jsxRuntime.jsx(PointLabel.PointLabel, { valueFormatter }) : void 0,
145
145
  ...typeof lineProps === "function" ? lineProps(item) : lineProps
146
146
  }
@@ -178,7 +178,7 @@ const CompositeChart = core.factory((_props, ref) => {
178
178
  fillOpacity: dimmed ? 0 : 0.2,
179
179
  strokeOpacity: dimmed ? 0.5 : 1,
180
180
  strokeDasharray: item.strokeDasharray,
181
- yAxisId: item.yAxisId || "left",
181
+ yAxisId: item.yAxisId || void 0,
182
182
  label: withPointLabels ? /* @__PURE__ */ jsxRuntime.jsx(PointLabel.PointLabel, { valueFormatter }) : void 0,
183
183
  ...typeof areaProps === "function" ? areaProps(item) : areaProps
184
184
  }
@@ -197,7 +197,7 @@ const CompositeChart = core.factory((_props, ref) => {
197
197
  isAnimationActive: false,
198
198
  fillOpacity: dimmed ? 0.1 : 1,
199
199
  strokeOpacity: dimmed ? 0.2 : 0,
200
- yAxisId: item.yAxisId || "left",
200
+ yAxisId: item.yAxisId || void 0,
201
201
  minPointSize: minBarSize,
202
202
  ...typeof barProps === "function" ? barProps(item) : barProps
203
203
  },
@@ -221,7 +221,7 @@ const CompositeChart = core.factory((_props, ref) => {
221
221
  {
222
222
  stroke: line.color ? color : "var(--chart-grid-color)",
223
223
  strokeWidth: 1,
224
- yAxisId: line.yAxisId || "left",
224
+ yAxisId: line.yAxisId || void 0,
225
225
  ...line,
226
226
  label: {
227
227
  value: line.label,
@@ -243,163 +243,153 @@ const CompositeChart = core.factory((_props, ref) => {
243
243
  tickFormatter: valueFormatter,
244
244
  ...getStyles("axis")
245
245
  };
246
- return /* @__PURE__ */ jsxRuntime.jsx(
247
- core.Box,
246
+ return /* @__PURE__ */ jsxRuntime.jsx(core.Box, { ...getStyles("root"), onMouseLeave: handleMouseLeave, dir: dir || "ltr", ...others, children: /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { ...getStyles("container"), children: /* @__PURE__ */ jsxRuntime.jsxs(
247
+ recharts.ComposedChart,
248
248
  {
249
- ref,
250
- ...getStyles("root"),
251
- onMouseLeave: handleMouseLeave,
252
- dir: dir || "ltr",
253
- ...others,
254
- children: /* @__PURE__ */ jsxRuntime.jsx(recharts.ResponsiveContainer, { ...getStyles("container"), children: /* @__PURE__ */ jsxRuntime.jsxs(
255
- recharts.ComposedChart,
256
- {
257
- data,
258
- maxBarSize: maxBarWidth,
259
- margin: {
260
- bottom: xAxisLabel ? 30 : void 0,
261
- left: yAxisLabel ? 10 : void 0,
262
- right: yAxisLabel ? 5 : void 0
263
- },
264
- ...composedChartProps,
265
- children: [
266
- withLegend && /* @__PURE__ */ jsxRuntime.jsx(
267
- recharts.Legend,
268
- {
269
- verticalAlign: "top",
270
- content: (payload) => /* @__PURE__ */ jsxRuntime.jsx(
271
- ChartLegend.ChartLegend,
272
- {
273
- payload: payload.payload,
274
- onHighlight: setHighlightedArea,
275
- legendPosition: legendProps?.verticalAlign || "top",
276
- classNames: resolvedClassNames,
277
- styles: resolvedStyles,
278
- series,
279
- attributes
280
- }
281
- ),
282
- ...legendProps
283
- }
284
- ),
285
- /* @__PURE__ */ jsxRuntime.jsxs(
286
- recharts.XAxis,
287
- {
288
- hide: !withXAxis,
289
- dataKey,
290
- tick: { transform: "translate(0, 10)", fontSize: 12, fill: "currentColor" },
291
- stroke: "",
292
- interval: "preserveStartEnd",
293
- tickLine: withXTickLine ? { stroke: "currentColor" } : false,
294
- minTickGap: 5,
295
- ...getStyles("axis"),
296
- ...xAxisProps,
297
- children: [
298
- xAxisLabel && /* @__PURE__ */ jsxRuntime.jsx(recharts.Label, { position: "insideBottom", offset: -20, fontSize: 12, ...getStyles("axisLabel"), children: xAxisLabel }),
299
- xAxisProps?.children
300
- ]
301
- }
302
- ),
303
- /* @__PURE__ */ jsxRuntime.jsxs(
304
- recharts.YAxis,
305
- {
306
- yAxisId: "left",
307
- orientation: "left",
308
- tick: { transform: "translate(-10, 0)", fontSize: 12, fill: "currentColor" },
309
- hide: !withYAxis,
310
- ...sharedYAxisProps,
311
- ...yAxisProps,
312
- children: [
313
- yAxisLabel && /* @__PURE__ */ jsxRuntime.jsx(
314
- recharts.Label,
315
- {
316
- position: "insideLeft",
317
- angle: -90,
318
- textAnchor: "middle",
319
- fontSize: 12,
320
- offset: -5,
321
- ...getStyles("axisLabel"),
322
- children: yAxisLabel
323
- }
324
- ),
325
- yAxisProps?.children
326
- ]
327
- }
328
- ),
329
- /* @__PURE__ */ jsxRuntime.jsxs(
330
- recharts.YAxis,
331
- {
332
- yAxisId: "right",
333
- orientation: "right",
334
- tick: { transform: "translate(10, 0)", fontSize: 12, fill: "currentColor" },
335
- hide: !withRightYAxis,
336
- ...sharedYAxisProps,
337
- ...rightYAxisProps,
338
- children: [
339
- rightYAxisLabel && /* @__PURE__ */ jsxRuntime.jsx(
340
- recharts.Label,
341
- {
342
- position: "insideRight",
343
- angle: 90,
344
- textAnchor: "middle",
345
- fontSize: 12,
346
- offset: -5,
347
- ...getStyles("axisLabel"),
348
- children: rightYAxisLabel
349
- }
350
- ),
351
- yAxisProps?.children
352
- ]
353
- }
354
- ),
355
- /* @__PURE__ */ jsxRuntime.jsx(
356
- recharts.CartesianGrid,
249
+ data,
250
+ maxBarSize: maxBarWidth,
251
+ margin: {
252
+ bottom: xAxisLabel ? 30 : void 0,
253
+ left: yAxisLabel ? 10 : void 0,
254
+ right: yAxisLabel ? 5 : void 0
255
+ },
256
+ ...composedChartProps,
257
+ children: [
258
+ withLegend && /* @__PURE__ */ jsxRuntime.jsx(
259
+ recharts.Legend,
260
+ {
261
+ verticalAlign: "top",
262
+ content: (payload) => /* @__PURE__ */ jsxRuntime.jsx(
263
+ ChartLegend.ChartLegend,
357
264
  {
358
- strokeDasharray,
359
- vertical: gridAxis === "y" || gridAxis === "xy",
360
- horizontal: gridAxis === "x" || gridAxis === "xy",
361
- ...getStyles("grid"),
362
- ...gridProps
265
+ payload: payload.payload,
266
+ onHighlight: setHighlightedArea,
267
+ legendPosition: legendProps?.verticalAlign || "top",
268
+ classNames: resolvedClassNames,
269
+ styles: resolvedStyles,
270
+ series,
271
+ attributes
363
272
  }
364
273
  ),
365
- withTooltip && /* @__PURE__ */ jsxRuntime.jsx(
366
- recharts.Tooltip,
274
+ ...legendProps
275
+ }
276
+ ),
277
+ /* @__PURE__ */ jsxRuntime.jsxs(
278
+ recharts.XAxis,
279
+ {
280
+ hide: !withXAxis,
281
+ dataKey,
282
+ tick: { transform: "translate(0, 10)", fontSize: 12, fill: "currentColor" },
283
+ stroke: "",
284
+ interval: "preserveStartEnd",
285
+ tickLine: withXTickLine ? { stroke: "currentColor" } : false,
286
+ minTickGap: 5,
287
+ ...getStyles("axis"),
288
+ ...xAxisProps,
289
+ children: [
290
+ xAxisLabel && /* @__PURE__ */ jsxRuntime.jsx(recharts.Label, { position: "insideBottom", offset: -20, fontSize: 12, ...getStyles("axisLabel"), children: xAxisLabel }),
291
+ xAxisProps?.children
292
+ ]
293
+ }
294
+ ),
295
+ /* @__PURE__ */ jsxRuntime.jsxs(
296
+ recharts.YAxis,
297
+ {
298
+ orientation: "left",
299
+ tick: { transform: "translate(-10, 0)", fontSize: 12, fill: "currentColor" },
300
+ hide: !withYAxis,
301
+ ...sharedYAxisProps,
302
+ ...yAxisProps,
303
+ children: [
304
+ yAxisLabel && /* @__PURE__ */ jsxRuntime.jsx(
305
+ recharts.Label,
306
+ {
307
+ position: "insideLeft",
308
+ angle: -90,
309
+ textAnchor: "middle",
310
+ fontSize: 12,
311
+ offset: -5,
312
+ ...getStyles("axisLabel"),
313
+ children: yAxisLabel
314
+ }
315
+ ),
316
+ yAxisProps?.children
317
+ ]
318
+ }
319
+ ),
320
+ /* @__PURE__ */ jsxRuntime.jsxs(
321
+ recharts.YAxis,
322
+ {
323
+ yAxisId: "right",
324
+ orientation: "right",
325
+ tick: { transform: "translate(10, 0)", fontSize: 12, fill: "currentColor" },
326
+ hide: !withRightYAxis,
327
+ ...sharedYAxisProps,
328
+ ...rightYAxisProps,
329
+ children: [
330
+ rightYAxisLabel && /* @__PURE__ */ jsxRuntime.jsx(
331
+ recharts.Label,
332
+ {
333
+ position: "insideRight",
334
+ angle: 90,
335
+ textAnchor: "middle",
336
+ fontSize: 12,
337
+ offset: -5,
338
+ ...getStyles("axisLabel"),
339
+ children: rightYAxisLabel
340
+ }
341
+ ),
342
+ yAxisProps?.children
343
+ ]
344
+ }
345
+ ),
346
+ /* @__PURE__ */ jsxRuntime.jsx(
347
+ recharts.CartesianGrid,
348
+ {
349
+ strokeDasharray,
350
+ vertical: gridAxis === "y" || gridAxis === "xy",
351
+ horizontal: gridAxis === "x" || gridAxis === "xy",
352
+ ...getStyles("grid"),
353
+ ...gridProps
354
+ }
355
+ ),
356
+ withTooltip && /* @__PURE__ */ jsxRuntime.jsx(
357
+ recharts.Tooltip,
358
+ {
359
+ animationDuration: tooltipAnimationDuration,
360
+ isAnimationActive: tooltipAnimationDuration !== 0,
361
+ position: { y: 0 },
362
+ cursor: {
363
+ stroke: "var(--chart-grid-color)",
364
+ strokeWidth: 1,
365
+ strokeDasharray
366
+ },
367
+ content: ({ label, payload, labelFormatter }) => /* @__PURE__ */ jsxRuntime.jsx(
368
+ ChartTooltip.ChartTooltip,
367
369
  {
368
- animationDuration: tooltipAnimationDuration,
369
- isAnimationActive: tooltipAnimationDuration !== 0,
370
- position: { y: 0 },
371
- cursor: {
372
- stroke: "var(--chart-grid-color)",
373
- strokeWidth: 1,
374
- strokeDasharray
375
- },
376
- content: ({ label, payload, labelFormatter }) => /* @__PURE__ */ jsxRuntime.jsx(
377
- ChartTooltip.ChartTooltip,
378
- {
379
- label: labelFormatter && payload ? labelFormatter(label, payload) : label,
380
- payload,
381
- unit,
382
- classNames: resolvedClassNames,
383
- styles: resolvedStyles,
384
- series,
385
- valueFormatter,
386
- attributes
387
- }
388
- ),
389
- ...tooltipProps
370
+ label: labelFormatter && payload ? labelFormatter(label, payload) : label,
371
+ payload,
372
+ unit,
373
+ classNames: resolvedClassNames,
374
+ styles: resolvedStyles,
375
+ series,
376
+ valueFormatter,
377
+ attributes
390
378
  }
391
379
  ),
392
- lines,
393
- referenceLinesItems,
394
- children
395
- ]
396
- }
397
- ) })
380
+ ...tooltipProps
381
+ }
382
+ ),
383
+ lines,
384
+ referenceLinesItems,
385
+ children
386
+ ]
398
387
  }
399
- );
388
+ ) }) });
400
389
  });
401
390
  CompositeChart.displayName = "@mantine/charts/CompositeChart";
402
391
  CompositeChart.classes = gridChart_module;
392
+ CompositeChart.varsResolver = varsResolver;
403
393
 
404
394
  exports.CompositeChart = CompositeChart;
405
395
  //# sourceMappingURL=CompositeChart.cjs.map