@mui/x-charts 7.0.0-alpha.1 → 7.0.0-alpha.2

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 (73) hide show
  1. package/BarChart/index.d.ts +2 -2
  2. package/BarChart/index.js +21 -13
  3. package/CHANGELOG.md +366 -188
  4. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
  5. package/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
  6. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +1 -1
  7. package/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
  8. package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
  9. package/ChartsTooltip/ChartsTooltip.js +13 -5
  10. package/ChartsTooltip/ChartsTooltipTable.js +3 -3
  11. package/ChartsTooltip/chartsTooltipClasses.d.ts +21 -0
  12. package/ChartsTooltip/chartsTooltipClasses.js +12 -0
  13. package/ChartsTooltip/index.d.ts +1 -0
  14. package/ChartsTooltip/index.js +11 -0
  15. package/ChartsTooltip/utils.d.ts +1 -1
  16. package/ChartsTooltip/utils.js +2 -2
  17. package/LineChart/index.d.ts +5 -5
  18. package/LineChart/index.js +50 -41
  19. package/PieChart/index.d.ts +2 -2
  20. package/PieChart/index.js +20 -18
  21. package/ScatterChart/index.d.ts +3 -3
  22. package/ScatterChart/index.js +31 -19
  23. package/SparkLineChart/index.d.ts +1 -1
  24. package/SparkLineChart/index.js +11 -7
  25. package/esm/BarChart/index.js +2 -2
  26. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
  27. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
  28. package/esm/ChartsTooltip/ChartsTooltip.js +15 -7
  29. package/esm/ChartsTooltip/ChartsTooltipTable.js +3 -3
  30. package/esm/ChartsTooltip/chartsTooltipClasses.js +5 -0
  31. package/esm/ChartsTooltip/index.js +2 -1
  32. package/esm/ChartsTooltip/utils.js +1 -1
  33. package/esm/LineChart/index.js +5 -5
  34. package/esm/PieChart/index.js +2 -2
  35. package/esm/ScatterChart/index.js +3 -3
  36. package/esm/SparkLineChart/index.js +1 -1
  37. package/index.js +1 -1
  38. package/legacy/BarChart/index.js +2 -2
  39. package/legacy/ChartsReferenceLine/common.js +3 -4
  40. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
  41. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
  42. package/legacy/ChartsTooltip/ChartsTooltip.js +20 -12
  43. package/legacy/ChartsTooltip/ChartsTooltipTable.js +7 -8
  44. package/legacy/ChartsTooltip/chartsTooltipClasses.js +5 -0
  45. package/legacy/ChartsTooltip/index.js +2 -1
  46. package/legacy/ChartsTooltip/utils.js +1 -1
  47. package/legacy/LineChart/index.js +5 -5
  48. package/legacy/PieChart/index.js +2 -2
  49. package/legacy/ScatterChart/index.js +3 -3
  50. package/legacy/SparkLineChart/index.js +1 -1
  51. package/legacy/index.js +1 -1
  52. package/legacy/internals/components/AxisSharedComponents.js +5 -6
  53. package/modern/BarChart/index.js +2 -2
  54. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
  55. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
  56. package/modern/ChartsTooltip/ChartsTooltip.js +15 -7
  57. package/modern/ChartsTooltip/ChartsTooltipTable.js +3 -3
  58. package/modern/ChartsTooltip/chartsTooltipClasses.js +5 -0
  59. package/modern/ChartsTooltip/index.js +2 -1
  60. package/modern/ChartsTooltip/utils.js +1 -1
  61. package/modern/LineChart/index.js +5 -5
  62. package/modern/PieChart/index.js +2 -2
  63. package/modern/ScatterChart/index.js +3 -3
  64. package/modern/SparkLineChart/index.js +1 -1
  65. package/modern/index.js +1 -1
  66. package/package.json +4 -3
  67. package/themeAugmentation/components.d.ts +1 -0
  68. package/themeAugmentation/overrides.d.ts +2 -0
  69. package/ChartsTooltip/tooltipClasses.d.ts +0 -13
  70. package/ChartsTooltip/tooltipClasses.js +0 -12
  71. package/esm/ChartsTooltip/tooltipClasses.js +0 -5
  72. package/legacy/ChartsTooltip/tooltipClasses.js +0 -5
  73. package/modern/ChartsTooltip/tooltipClasses.js +0 -5
@@ -2,15 +2,15 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import composeClasses from '@mui/utils/composeClasses';
5
- import { styled } from '@mui/material/styles';
5
+ import { styled, useThemeProps } from '@mui/material/styles';
6
6
  import { Popper } from '@mui/base/Popper';
7
7
  import { NoSsr } from '@mui/base/NoSsr';
8
8
  import { useSlotProps } from '@mui/base/utils';
9
9
  import { InteractionContext } from '../context/InteractionProvider';
10
- import { generateVirtualElement, useMouseTracker, getTootipHasData } from './utils';
10
+ import { generateVirtualElement, useMouseTracker, getTooltipHasData } from './utils';
11
11
  import { ChartsItemTooltipContent } from './ChartsItemTooltipContent';
12
12
  import { ChartsAxisTooltipContent } from './ChartsAxisTooltipContent';
13
- import { getTooltipUtilityClass } from './tooltipClasses';
13
+ import { getChartsTooltipUtilityClass } from './chartsTooltipClasses';
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  const useUtilityClasses = ownerState => {
16
16
  const {
@@ -18,11 +18,15 @@ const useUtilityClasses = ownerState => {
18
18
  } = ownerState;
19
19
  const slots = {
20
20
  root: ['root'],
21
+ table: ['table'],
22
+ row: ['row'],
23
+ cell: ['cell'],
24
+ mark: ['mark'],
21
25
  markCell: ['markCell'],
22
26
  labelCell: ['labelCell'],
23
27
  valueCell: ['valueCell']
24
28
  };
25
- return composeClasses(slots, getTooltipUtilityClass, classes);
29
+ return composeClasses(slots, getChartsTooltipUtilityClass, classes);
26
30
  };
27
31
  const ChartsTooltipRoot = styled(Popper, {
28
32
  name: 'MuiChartsTooltip',
@@ -46,23 +50,27 @@ const ChartsTooltipRoot = styled(Popper, {
46
50
  */
47
51
  function ChartsTooltip(props) {
48
52
  var _slots$popper, _slots$itemContent, _slots$axisContent;
53
+ const themeProps = useThemeProps({
54
+ props,
55
+ name: 'MuiChartsTooltip'
56
+ });
49
57
  const {
50
58
  trigger = 'axis',
51
59
  itemContent,
52
60
  axisContent,
53
61
  slots,
54
62
  slotProps
55
- } = props;
63
+ } = themeProps;
56
64
  const mousePosition = useMouseTracker();
57
65
  const {
58
66
  item,
59
67
  axis
60
68
  } = React.useContext(InteractionContext);
61
69
  const displayedData = trigger === 'item' ? item : axis;
62
- const tooltipHasData = getTootipHasData(trigger, displayedData);
70
+ const tooltipHasData = getTooltipHasData(trigger, displayedData);
63
71
  const popperOpen = mousePosition !== null && tooltipHasData;
64
72
  const classes = useUtilityClasses({
65
- classes: props.classes
73
+ classes: themeProps.classes
66
74
  });
67
75
  const PopperComponent = (_slots$popper = slots == null ? void 0 : slots.popper) != null ? _slots$popper : ChartsTooltipRoot;
68
76
  const popperProps = useSlotProps({
@@ -1,6 +1,6 @@
1
1
  import Box from '@mui/system/Box';
2
2
  import { styled } from '@mui/material/styles';
3
- import { tooltipClasses } from './tooltipClasses';
3
+ import { chartsTooltipClasses } from './chartsTooltipClasses';
4
4
  export const ChartsTooltipPaper = styled('div', {
5
5
  name: 'MuiChartsTooltip',
6
6
  slot: 'Container'
@@ -45,10 +45,10 @@ export const ChartsTooltipCell = styled('td', {
45
45
  }) => ({
46
46
  verticalAlign: 'middle',
47
47
  color: (theme.vars || theme).palette.text.secondary,
48
- [`&.${tooltipClasses.labelCell}`]: {
48
+ [`&.${chartsTooltipClasses.labelCell}`]: {
49
49
  paddingLeft: theme.spacing(1)
50
50
  },
51
- [`&.${tooltipClasses.valueCell}`]: {
51
+ [`&.${chartsTooltipClasses.valueCell}`]: {
52
52
  paddingLeft: theme.spacing(4),
53
53
  color: (theme.vars || theme).palette.text.primary
54
54
  },
@@ -0,0 +1,5 @@
1
+ import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
2
+ export function getChartsTooltipUtilityClass(slot) {
3
+ return generateUtilityClass('MuiChartsTooltip', slot);
4
+ }
5
+ export const chartsTooltipClasses = generateUtilityClasses('MuiChartsTooltip', ['root', 'table', 'row', 'cell', 'mark', 'markCell', 'labelCell', 'valueCell']);
@@ -1 +1,2 @@
1
- export * from './ChartsTooltip';
1
+ export * from './ChartsTooltip';
2
+ export * from './chartsTooltipClasses';
@@ -71,7 +71,7 @@ export function useMouseTracker() {
71
71
  }, [svgRef]);
72
72
  return mousePosition;
73
73
  }
74
- export function getTootipHasData(trigger, displayedData) {
74
+ export function getTooltipHasData(trigger, displayedData) {
75
75
  if (trigger === 'item') {
76
76
  return displayedData !== null;
77
77
  }
@@ -1,8 +1,8 @@
1
- export { LinePlot } from './LinePlot';
2
- export { AreaPlot } from './AreaPlot';
3
- export { MarkPlot } from './MarkPlot';
4
- export { LineHighlightPlot } from './LineHighlightPlot';
5
- export { LineChart } from './LineChart';
1
+ export * from './LinePlot';
2
+ export * from './AreaPlot';
3
+ export * from './MarkPlot';
4
+ export * from './LineHighlightPlot';
5
+ export * from './LineChart';
6
6
  export * from './AreaElement';
7
7
  export * from './LineElement';
8
8
  export * from './MarkElement';
@@ -1,4 +1,4 @@
1
- export { PiePlot } from './PiePlot';
2
- export { PieChart } from './PieChart';
1
+ export * from './PiePlot';
2
+ export * from './PieChart';
3
3
  export * from './PieArc';
4
4
  export * from './PieArcLabel';
@@ -1,3 +1,3 @@
1
- export { ScatterPlot } from './ScatterPlot';
2
- export { ScatterChart } from './ScatterChart';
3
- export { Scatter } from './Scatter';
1
+ export * from './ScatterPlot';
2
+ export * from './ScatterChart';
3
+ export * from './Scatter';
@@ -1 +1 @@
1
- export { SparkLineChart } from './SparkLineChart';
1
+ export * from './SparkLineChart';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.0.0-alpha.1
2
+ * @mui/x-charts v7.0.0-alpha.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,2 +1,2 @@
1
- export { BarPlot } from './BarPlot';
2
- export { BarChart } from './BarChart';
1
+ export * from './BarPlot';
2
+ export * from './BarChart';
@@ -3,18 +3,17 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import { styled } from '@mui/material/styles';
4
4
  import { referenceLineClasses } from './chartsReferenceLineClasses';
5
5
  export var ReferenceLineRoot = styled('g')(function (_ref) {
6
- var _ref2;
7
6
  var theme = _ref.theme;
8
- return _ref2 = {}, _defineProperty(_ref2, "& .".concat(referenceLineClasses.line), {
7
+ return _defineProperty(_defineProperty({}, "& .".concat(referenceLineClasses.line), {
9
8
  fill: 'none',
10
9
  stroke: (theme.vars || theme).palette.text.primary,
11
10
  shapeRendering: 'crispEdges',
12
11
  strokeWidth: 1,
13
12
  pointerEvents: 'none'
14
- }), _defineProperty(_ref2, "& .".concat(referenceLineClasses.label), _extends({
13
+ }), "& .".concat(referenceLineClasses.label), _extends({
15
14
  fill: (theme.vars || theme).palette.text.primary,
16
15
  stroke: 'none',
17
16
  pointerEvents: 'none',
18
17
  fontSize: 12
19
- }, theme.typography.body1)), _ref2;
18
+ }, theme.typography.body1));
20
19
  });
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
+ import clsx from 'clsx';
3
4
  import Typography from '@mui/material/Typography';
4
5
  import { useSlotProps } from '@mui/base/utils';
5
6
  import { SeriesContext } from '../context/SeriesContextProvider';
@@ -25,6 +26,7 @@ export function DefaultChartsAxisContent(props) {
25
26
  sx: sx,
26
27
  className: classes.root,
27
28
  children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
29
+ className: classes.table,
28
30
  children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/_jsx("thead", {
29
31
  children: /*#__PURE__*/_jsx(ChartsTooltipRow, {
30
32
  children: /*#__PURE__*/_jsx(ChartsTooltipCell, {
@@ -46,21 +48,23 @@ export function DefaultChartsAxisContent(props) {
46
48
  return null;
47
49
  }
48
50
  return /*#__PURE__*/_jsxs(ChartsTooltipRow, {
51
+ className: classes.row,
49
52
  children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
50
- className: classes.markCell,
53
+ className: clsx(classes.markCell, classes.cell),
51
54
  children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
52
55
  ownerState: {
53
56
  color: color
54
57
  },
55
- boxShadow: 1
58
+ boxShadow: 1,
59
+ className: classes.mark
56
60
  })
57
61
  }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
58
- className: classes.labelCell,
62
+ className: clsx(classes.labelCell, classes.cell),
59
63
  children: label ? /*#__PURE__*/_jsx(Typography, {
60
64
  children: label
61
65
  }) : null
62
66
  }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
63
- className: classes.valueCell,
67
+ className: clsx(classes.valueCell, classes.cell),
64
68
  children: /*#__PURE__*/_jsx(Typography, {
65
69
  children: formattedValue
66
70
  })
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
+ import clsx from 'clsx';
3
4
  import { useSlotProps } from '@mui/base/utils';
4
5
  import { SeriesContext } from '../context/SeriesContextProvider';
5
6
  import { ChartsTooltipTable, ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow } from './ChartsTooltipTable';
@@ -30,20 +31,23 @@ export function DefaultChartsItemContent(props) {
30
31
  sx: sx,
31
32
  className: classes.root,
32
33
  children: /*#__PURE__*/_jsx(ChartsTooltipTable, {
34
+ className: classes.table,
33
35
  children: /*#__PURE__*/_jsx("tbody", {
34
36
  children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
37
+ className: classes.row,
35
38
  children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
36
- className: classes.markCell,
39
+ className: clsx(classes.markCell, classes.cell),
37
40
  children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
38
41
  ownerState: {
39
42
  color: color
40
- }
43
+ },
44
+ className: classes.mark
41
45
  })
42
46
  }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
43
- className: classes.labelCell,
47
+ className: clsx(classes.labelCell, classes.cell),
44
48
  children: displayedLabel
45
49
  }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
46
- className: classes.valueCell,
50
+ className: clsx(classes.valueCell, classes.cell),
47
51
  children: formattedValue
48
52
  })]
49
53
  })
@@ -2,25 +2,29 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import composeClasses from '@mui/utils/composeClasses';
5
- import { styled } from '@mui/material/styles';
5
+ import { styled, useThemeProps } from '@mui/material/styles';
6
6
  import { Popper } from '@mui/base/Popper';
7
7
  import { NoSsr } from '@mui/base/NoSsr';
8
8
  import { useSlotProps } from '@mui/base/utils';
9
9
  import { InteractionContext } from '../context/InteractionProvider';
10
- import { generateVirtualElement, useMouseTracker, getTootipHasData } from './utils';
10
+ import { generateVirtualElement, useMouseTracker, getTooltipHasData } from './utils';
11
11
  import { ChartsItemTooltipContent } from './ChartsItemTooltipContent';
12
12
  import { ChartsAxisTooltipContent } from './ChartsAxisTooltipContent';
13
- import { getTooltipUtilityClass } from './tooltipClasses';
13
+ import { getChartsTooltipUtilityClass } from './chartsTooltipClasses';
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  var useUtilityClasses = function useUtilityClasses(ownerState) {
16
16
  var classes = ownerState.classes;
17
17
  var slots = {
18
18
  root: ['root'],
19
+ table: ['table'],
20
+ row: ['row'],
21
+ cell: ['cell'],
22
+ mark: ['mark'],
19
23
  markCell: ['markCell'],
20
24
  labelCell: ['labelCell'],
21
25
  valueCell: ['valueCell']
22
26
  };
23
- return composeClasses(slots, getTooltipUtilityClass, classes);
27
+ return composeClasses(slots, getChartsTooltipUtilityClass, classes);
24
28
  };
25
29
  var ChartsTooltipRoot = styled(Popper, {
26
30
  name: 'MuiChartsTooltip',
@@ -47,21 +51,25 @@ var ChartsTooltipRoot = styled(Popper, {
47
51
  */
48
52
  function ChartsTooltip(props) {
49
53
  var _slots$popper, _slots$itemContent, _slots$axisContent;
50
- var _props$trigger = props.trigger,
51
- trigger = _props$trigger === void 0 ? 'axis' : _props$trigger,
52
- itemContent = props.itemContent,
53
- axisContent = props.axisContent,
54
- slots = props.slots,
55
- slotProps = props.slotProps;
54
+ var themeProps = useThemeProps({
55
+ props: props,
56
+ name: 'MuiChartsTooltip'
57
+ });
58
+ var _themeProps$trigger = themeProps.trigger,
59
+ trigger = _themeProps$trigger === void 0 ? 'axis' : _themeProps$trigger,
60
+ itemContent = themeProps.itemContent,
61
+ axisContent = themeProps.axisContent,
62
+ slots = themeProps.slots,
63
+ slotProps = themeProps.slotProps;
56
64
  var mousePosition = useMouseTracker();
57
65
  var _React$useContext = React.useContext(InteractionContext),
58
66
  item = _React$useContext.item,
59
67
  axis = _React$useContext.axis;
60
68
  var displayedData = trigger === 'item' ? item : axis;
61
- var tooltipHasData = getTootipHasData(trigger, displayedData);
69
+ var tooltipHasData = getTooltipHasData(trigger, displayedData);
62
70
  var popperOpen = mousePosition !== null && tooltipHasData;
63
71
  var classes = useUtilityClasses({
64
- classes: props.classes
72
+ classes: themeProps.classes
65
73
  });
66
74
  var PopperComponent = (_slots$popper = slots == null ? void 0 : slots.popper) != null ? _slots$popper : ChartsTooltipRoot;
67
75
  var popperProps = useSlotProps({
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import Box from '@mui/system/Box';
3
3
  import { styled } from '@mui/material/styles';
4
- import { tooltipClasses } from './tooltipClasses';
4
+ import { chartsTooltipClasses } from './chartsTooltipClasses';
5
5
  export var ChartsTooltipPaper = styled('div', {
6
6
  name: 'MuiChartsTooltip',
7
7
  slot: 'Container'
@@ -45,21 +45,20 @@ export var ChartsTooltipCell = styled('td', {
45
45
  name: 'MuiChartsTooltip',
46
46
  slot: 'Cell'
47
47
  })(function (_ref4) {
48
- var _ref5;
49
48
  var theme = _ref4.theme;
50
- return _ref5 = {
49
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty({
51
50
  verticalAlign: 'middle',
52
51
  color: (theme.vars || theme).palette.text.secondary
53
- }, _defineProperty(_ref5, "&.".concat(tooltipClasses.labelCell), {
52
+ }, "&.".concat(chartsTooltipClasses.labelCell), {
54
53
  paddingLeft: theme.spacing(1)
55
- }), _defineProperty(_ref5, "&.".concat(tooltipClasses.valueCell), {
54
+ }), "&.".concat(chartsTooltipClasses.valueCell), {
56
55
  paddingLeft: theme.spacing(4),
57
56
  color: (theme.vars || theme).palette.text.primary
58
- }), _defineProperty(_ref5, 'td:first-of-type&', {
57
+ }), 'td:first-of-type&', {
59
58
  paddingLeft: theme.spacing(2)
60
- }), _defineProperty(_ref5, 'td:last-of-type&', {
59
+ }), 'td:last-of-type&', {
61
60
  paddingRight: theme.spacing(2)
62
- }), _ref5;
61
+ });
63
62
  });
64
63
  export var ChartsTooltipMark = styled(Box, {
65
64
  name: 'MuiChartsTooltip',
@@ -0,0 +1,5 @@
1
+ import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
2
+ export function getChartsTooltipUtilityClass(slot) {
3
+ return generateUtilityClass('MuiChartsTooltip', slot);
4
+ }
5
+ export var chartsTooltipClasses = generateUtilityClasses('MuiChartsTooltip', ['root', 'table', 'row', 'cell', 'mark', 'markCell', 'labelCell', 'valueCell']);
@@ -1 +1,2 @@
1
- export * from './ChartsTooltip';
1
+ export * from './ChartsTooltip';
2
+ export * from './chartsTooltipClasses';
@@ -81,7 +81,7 @@ export function useMouseTracker() {
81
81
  }, [svgRef]);
82
82
  return mousePosition;
83
83
  }
84
- export function getTootipHasData(trigger, displayedData) {
84
+ export function getTooltipHasData(trigger, displayedData) {
85
85
  if (trigger === 'item') {
86
86
  return displayedData !== null;
87
87
  }
@@ -1,8 +1,8 @@
1
- export { LinePlot } from './LinePlot';
2
- export { AreaPlot } from './AreaPlot';
3
- export { MarkPlot } from './MarkPlot';
4
- export { LineHighlightPlot } from './LineHighlightPlot';
5
- export { LineChart } from './LineChart';
1
+ export * from './LinePlot';
2
+ export * from './AreaPlot';
3
+ export * from './MarkPlot';
4
+ export * from './LineHighlightPlot';
5
+ export * from './LineChart';
6
6
  export * from './AreaElement';
7
7
  export * from './LineElement';
8
8
  export * from './MarkElement';
@@ -1,4 +1,4 @@
1
- export { PiePlot } from './PiePlot';
2
- export { PieChart } from './PieChart';
1
+ export * from './PiePlot';
2
+ export * from './PieChart';
3
3
  export * from './PieArc';
4
4
  export * from './PieArcLabel';
@@ -1,3 +1,3 @@
1
- export { ScatterPlot } from './ScatterPlot';
2
- export { ScatterChart } from './ScatterChart';
3
- export { Scatter } from './Scatter';
1
+ export * from './ScatterPlot';
2
+ export * from './ScatterChart';
3
+ export * from './Scatter';
@@ -1 +1 @@
1
- export { SparkLineChart } from './SparkLineChart';
1
+ export * from './SparkLineChart';
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.0.0-alpha.1
2
+ * @mui/x-charts v7.0.0-alpha.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -9,18 +9,17 @@ export var AxisRoot = styled('g', {
9
9
  return styles.root;
10
10
  }
11
11
  })(function (_ref) {
12
- var _ref2;
13
12
  var theme = _ref.theme;
14
- return _ref2 = {}, _defineProperty(_ref2, "& .".concat(axisClasses.tickLabel), _extends({}, theme.typography.caption, {
13
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "& .".concat(axisClasses.tickLabel), _extends({}, theme.typography.caption, {
15
14
  fill: (theme.vars || theme).palette.text.primary
16
- })), _defineProperty(_ref2, "& .".concat(axisClasses.label), _extends({}, theme.typography.body1, {
15
+ })), "& .".concat(axisClasses.label), _extends({}, theme.typography.body1, {
17
16
  fill: (theme.vars || theme).palette.text.primary
18
- })), _defineProperty(_ref2, "& .".concat(axisClasses.line), {
17
+ })), "& .".concat(axisClasses.line), {
19
18
  stroke: (theme.vars || theme).palette.text.primary,
20
19
  shapeRendering: 'crispEdges',
21
20
  strokeWidth: 1
22
- }), _defineProperty(_ref2, "& .".concat(axisClasses.tick), {
21
+ }), "& .".concat(axisClasses.tick), {
23
22
  stroke: (theme.vars || theme).palette.text.primary,
24
23
  shapeRendering: 'crispEdges'
25
- }), _ref2;
24
+ });
26
25
  });
@@ -1,2 +1,2 @@
1
- export { BarPlot } from './BarPlot';
2
- export { BarChart } from './BarChart';
1
+ export * from './BarPlot';
2
+ export * from './BarChart';
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
+ import clsx from 'clsx';
3
4
  import Typography from '@mui/material/Typography';
4
5
  import { useSlotProps } from '@mui/base/utils';
5
6
  import { SeriesContext } from '../context/SeriesContextProvider';
@@ -24,6 +25,7 @@ export function DefaultChartsAxisContent(props) {
24
25
  sx: sx,
25
26
  className: classes.root,
26
27
  children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
28
+ className: classes.table,
27
29
  children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/_jsx("thead", {
28
30
  children: /*#__PURE__*/_jsx(ChartsTooltipRow, {
29
31
  children: /*#__PURE__*/_jsx(ChartsTooltipCell, {
@@ -46,21 +48,23 @@ export function DefaultChartsAxisContent(props) {
46
48
  return null;
47
49
  }
48
50
  return /*#__PURE__*/_jsxs(ChartsTooltipRow, {
51
+ className: classes.row,
49
52
  children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
50
- className: classes.markCell,
53
+ className: clsx(classes.markCell, classes.cell),
51
54
  children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
52
55
  ownerState: {
53
56
  color
54
57
  },
55
- boxShadow: 1
58
+ boxShadow: 1,
59
+ className: classes.mark
56
60
  })
57
61
  }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
58
- className: classes.labelCell,
62
+ className: clsx(classes.labelCell, classes.cell),
59
63
  children: label ? /*#__PURE__*/_jsx(Typography, {
60
64
  children: label
61
65
  }) : null
62
66
  }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
63
- className: classes.valueCell,
67
+ className: clsx(classes.valueCell, classes.cell),
64
68
  children: /*#__PURE__*/_jsx(Typography, {
65
69
  children: formattedValue
66
70
  })
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
+ import clsx from 'clsx';
3
4
  import { useSlotProps } from '@mui/base/utils';
4
5
  import { SeriesContext } from '../context/SeriesContextProvider';
5
6
  import { ChartsTooltipTable, ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow } from './ChartsTooltipTable';
@@ -33,20 +34,23 @@ export function DefaultChartsItemContent(props) {
33
34
  sx: sx,
34
35
  className: classes.root,
35
36
  children: /*#__PURE__*/_jsx(ChartsTooltipTable, {
37
+ className: classes.table,
36
38
  children: /*#__PURE__*/_jsx("tbody", {
37
39
  children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
40
+ className: classes.row,
38
41
  children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
39
- className: classes.markCell,
42
+ className: clsx(classes.markCell, classes.cell),
40
43
  children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
41
44
  ownerState: {
42
45
  color
43
- }
46
+ },
47
+ className: classes.mark
44
48
  })
45
49
  }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
46
- className: classes.labelCell,
50
+ className: clsx(classes.labelCell, classes.cell),
47
51
  children: displayedLabel
48
52
  }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
49
- className: classes.valueCell,
53
+ className: clsx(classes.valueCell, classes.cell),
50
54
  children: formattedValue
51
55
  })]
52
56
  })
@@ -2,15 +2,15 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import composeClasses from '@mui/utils/composeClasses';
5
- import { styled } from '@mui/material/styles';
5
+ import { styled, useThemeProps } from '@mui/material/styles';
6
6
  import { Popper } from '@mui/base/Popper';
7
7
  import { NoSsr } from '@mui/base/NoSsr';
8
8
  import { useSlotProps } from '@mui/base/utils';
9
9
  import { InteractionContext } from '../context/InteractionProvider';
10
- import { generateVirtualElement, useMouseTracker, getTootipHasData } from './utils';
10
+ import { generateVirtualElement, useMouseTracker, getTooltipHasData } from './utils';
11
11
  import { ChartsItemTooltipContent } from './ChartsItemTooltipContent';
12
12
  import { ChartsAxisTooltipContent } from './ChartsAxisTooltipContent';
13
- import { getTooltipUtilityClass } from './tooltipClasses';
13
+ import { getChartsTooltipUtilityClass } from './chartsTooltipClasses';
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  const useUtilityClasses = ownerState => {
16
16
  const {
@@ -18,11 +18,15 @@ const useUtilityClasses = ownerState => {
18
18
  } = ownerState;
19
19
  const slots = {
20
20
  root: ['root'],
21
+ table: ['table'],
22
+ row: ['row'],
23
+ cell: ['cell'],
24
+ mark: ['mark'],
21
25
  markCell: ['markCell'],
22
26
  labelCell: ['labelCell'],
23
27
  valueCell: ['valueCell']
24
28
  };
25
- return composeClasses(slots, getTooltipUtilityClass, classes);
29
+ return composeClasses(slots, getChartsTooltipUtilityClass, classes);
26
30
  };
27
31
  const ChartsTooltipRoot = styled(Popper, {
28
32
  name: 'MuiChartsTooltip',
@@ -45,23 +49,27 @@ const ChartsTooltipRoot = styled(Popper, {
45
49
  * - [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/)
46
50
  */
47
51
  function ChartsTooltip(props) {
52
+ const themeProps = useThemeProps({
53
+ props,
54
+ name: 'MuiChartsTooltip'
55
+ });
48
56
  const {
49
57
  trigger = 'axis',
50
58
  itemContent,
51
59
  axisContent,
52
60
  slots,
53
61
  slotProps
54
- } = props;
62
+ } = themeProps;
55
63
  const mousePosition = useMouseTracker();
56
64
  const {
57
65
  item,
58
66
  axis
59
67
  } = React.useContext(InteractionContext);
60
68
  const displayedData = trigger === 'item' ? item : axis;
61
- const tooltipHasData = getTootipHasData(trigger, displayedData);
69
+ const tooltipHasData = getTooltipHasData(trigger, displayedData);
62
70
  const popperOpen = mousePosition !== null && tooltipHasData;
63
71
  const classes = useUtilityClasses({
64
- classes: props.classes
72
+ classes: themeProps.classes
65
73
  });
66
74
  const PopperComponent = slots?.popper ?? ChartsTooltipRoot;
67
75
  const popperProps = useSlotProps({
@@ -1,6 +1,6 @@
1
1
  import Box from '@mui/system/Box';
2
2
  import { styled } from '@mui/material/styles';
3
- import { tooltipClasses } from './tooltipClasses';
3
+ import { chartsTooltipClasses } from './chartsTooltipClasses';
4
4
  export const ChartsTooltipPaper = styled('div', {
5
5
  name: 'MuiChartsTooltip',
6
6
  slot: 'Container'
@@ -45,10 +45,10 @@ export const ChartsTooltipCell = styled('td', {
45
45
  }) => ({
46
46
  verticalAlign: 'middle',
47
47
  color: (theme.vars || theme).palette.text.secondary,
48
- [`&.${tooltipClasses.labelCell}`]: {
48
+ [`&.${chartsTooltipClasses.labelCell}`]: {
49
49
  paddingLeft: theme.spacing(1)
50
50
  },
51
- [`&.${tooltipClasses.valueCell}`]: {
51
+ [`&.${chartsTooltipClasses.valueCell}`]: {
52
52
  paddingLeft: theme.spacing(4),
53
53
  color: (theme.vars || theme).palette.text.primary
54
54
  },
@@ -0,0 +1,5 @@
1
+ import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
2
+ export function getChartsTooltipUtilityClass(slot) {
3
+ return generateUtilityClass('MuiChartsTooltip', slot);
4
+ }
5
+ export const chartsTooltipClasses = generateUtilityClasses('MuiChartsTooltip', ['root', 'table', 'row', 'cell', 'mark', 'markCell', 'labelCell', 'valueCell']);