@mui/x-charts-pro 8.27.5 → 8.28.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 (86) hide show
  1. package/BarChartPro/BarChartPro.js +2 -2
  2. package/CHANGELOG.md +155 -0
  3. package/ChartsDataProviderPro/ChartsDataProviderPro.js +1 -1
  4. package/FunnelChart/FunnelPlot.js +8 -3
  5. package/FunnelChart/FunnelSection.js +7 -3
  6. package/FunnelChart/FunnelSectionLabel.d.ts +6 -0
  7. package/FunnelChart/FunnelSectionLabel.js +18 -5
  8. package/FunnelChart/funnelClasses.d.ts +29 -0
  9. package/FunnelChart/funnelClasses.js +29 -0
  10. package/FunnelChart/funnelSectionClasses.d.ts +13 -0
  11. package/FunnelChart/funnelSectionClasses.js +19 -0
  12. package/FunnelChart/index.d.ts +2 -0
  13. package/FunnelChart/index.js +8 -0
  14. package/Heatmap/Heatmap.js +2 -2
  15. package/Heatmap/HeatmapCell.d.ts +34 -0
  16. package/Heatmap/HeatmapCell.js +64 -0
  17. package/Heatmap/HeatmapItem.d.ts +1 -8
  18. package/Heatmap/HeatmapItem.js +4 -19
  19. package/Heatmap/heatmapClasses.d.ts +6 -1
  20. package/Heatmap/heatmapClasses.js +18 -3
  21. package/Heatmap/index.d.ts +4 -2
  22. package/Heatmap/index.js +17 -13
  23. package/Heatmap/shouldRegisterPointerInteractionsGlobally.js +1 -1
  24. package/LineChartPro/LineChartPro.js +2 -2
  25. package/SankeyChart/SankeyLinkElement.js +4 -2
  26. package/SankeyChart/SankeyLinkLabel.js +3 -0
  27. package/SankeyChart/SankeyNodeElement.d.ts +1 -1
  28. package/SankeyChart/SankeyNodeElement.js +5 -3
  29. package/SankeyChart/SankeyNodeLabel.js +3 -0
  30. package/SankeyChart/SankeyPlot.js +2 -2
  31. package/SankeyChart/index.d.ts +2 -1
  32. package/SankeyChart/index.js +7 -0
  33. package/SankeyChart/sankeyClasses.d.ts +27 -6
  34. package/SankeyChart/sankeyClasses.js +27 -8
  35. package/ScatterChartPro/ScatterChartPro.js +2 -2
  36. package/esm/BarChartPro/BarChartPro.js +2 -2
  37. package/esm/ChartsDataProviderPro/ChartsDataProviderPro.js +1 -1
  38. package/esm/FunnelChart/FunnelPlot.js +8 -3
  39. package/esm/FunnelChart/FunnelSection.js +9 -5
  40. package/esm/FunnelChart/FunnelSectionLabel.d.ts +6 -0
  41. package/esm/FunnelChart/FunnelSectionLabel.js +20 -7
  42. package/esm/FunnelChart/funnelClasses.d.ts +29 -0
  43. package/esm/FunnelChart/funnelClasses.js +19 -0
  44. package/esm/FunnelChart/funnelSectionClasses.d.ts +13 -0
  45. package/esm/FunnelChart/funnelSectionClasses.js +20 -0
  46. package/esm/FunnelChart/index.d.ts +2 -0
  47. package/esm/FunnelChart/index.js +1 -0
  48. package/esm/Heatmap/Heatmap.js +2 -2
  49. package/esm/Heatmap/HeatmapCell.d.ts +34 -0
  50. package/esm/Heatmap/HeatmapCell.js +58 -0
  51. package/esm/Heatmap/HeatmapItem.d.ts +1 -8
  52. package/esm/Heatmap/HeatmapItem.js +4 -19
  53. package/esm/Heatmap/heatmapClasses.d.ts +6 -1
  54. package/esm/Heatmap/heatmapClasses.js +16 -2
  55. package/esm/Heatmap/index.d.ts +4 -2
  56. package/esm/Heatmap/index.js +2 -1
  57. package/esm/Heatmap/shouldRegisterPointerInteractionsGlobally.js +1 -1
  58. package/esm/LineChartPro/LineChartPro.js +2 -2
  59. package/esm/SankeyChart/SankeyLinkElement.js +4 -2
  60. package/esm/SankeyChart/SankeyLinkLabel.js +3 -0
  61. package/esm/SankeyChart/SankeyNodeElement.d.ts +1 -1
  62. package/esm/SankeyChart/SankeyNodeElement.js +5 -3
  63. package/esm/SankeyChart/SankeyNodeLabel.js +3 -0
  64. package/esm/SankeyChart/SankeyPlot.js +2 -2
  65. package/esm/SankeyChart/index.d.ts +2 -1
  66. package/esm/SankeyChart/index.js +1 -1
  67. package/esm/SankeyChart/sankeyClasses.d.ts +27 -6
  68. package/esm/SankeyChart/sankeyClasses.js +25 -6
  69. package/esm/ScatterChartPro/ScatterChartPro.js +2 -2
  70. package/esm/index.js +1 -1
  71. package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +1 -1
  72. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +13 -0
  73. package/esm/themeAugmentation/components.d.ts +19 -1
  74. package/esm/themeAugmentation/overrides.d.ts +5 -2
  75. package/esm/themeAugmentation/props.d.ts +8 -0
  76. package/index.js +1 -1
  77. package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +1 -1
  78. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +13 -0
  79. package/package.json +2 -2
  80. package/themeAugmentation/components.d.ts +19 -1
  81. package/themeAugmentation/overrides.d.ts +5 -2
  82. package/themeAugmentation/props.d.ts +8 -0
  83. package/Heatmap/internals/HeatmapCell.d.ts +0 -21
  84. package/Heatmap/internals/HeatmapCell.js +0 -18
  85. package/esm/Heatmap/internals/HeatmapCell.d.ts +0 -21
  86. package/esm/Heatmap/internals/HeatmapCell.js +0 -12
@@ -11,26 +11,12 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _useSlotProps = _interopRequireDefault(require("@mui/utils/useSlotProps"));
14
- var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
15
14
  var _internals = require("@mui/x-charts/internals");
16
15
  var _heatmapClasses = require("./heatmapClasses");
17
- var _HeatmapCell = require("./internals/HeatmapCell");
16
+ var _HeatmapCell = require("./HeatmapCell");
18
17
  var _shouldRegisterPointerInteractionsGlobally = require("./shouldRegisterPointerInteractionsGlobally");
19
18
  var _jsxRuntime = require("react/jsx-runtime");
20
19
  const _excluded = ["seriesId", "dataIndex", "color", "value", "isHighlighted", "isFaded", "slotProps", "slots"];
21
- const useUtilityClasses = ownerState => {
22
- const {
23
- classes,
24
- seriesId,
25
- isFaded,
26
- isHighlighted
27
- } = ownerState;
28
- const slots = {
29
- cell: ['cell', `series-${seriesId}`, isFaded && 'faded', isHighlighted && 'highlighted']
30
- };
31
- return (0, _composeClasses.default)(slots, _heatmapClasses.getHeatmapUtilityClass, classes);
32
- };
33
-
34
20
  /**
35
21
  * @ignore - internal component.
36
22
  */
@@ -59,11 +45,11 @@ function HeatmapItem(props) {
59
45
  seriesId,
60
46
  dataIndex,
61
47
  color,
62
- value,
63
48
  isFaded,
64
- isHighlighted
49
+ isHighlighted,
50
+ value
65
51
  };
66
- const classes = useUtilityClasses(ownerState);
52
+ const classes = (0, _heatmapClasses.useUtilityClasses)(ownerState);
67
53
  const Cell = slots?.cell ?? _HeatmapCell.HeatmapCell;
68
54
  const cellProps = (0, _useSlotProps.default)({
69
55
  elementType: Cell,
@@ -81,7 +67,6 @@ process.env.NODE_ENV !== "production" ? HeatmapItem.propTypes = {
81
67
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
82
68
  // ----------------------------------------------------------------------
83
69
  color: _propTypes.default.string.isRequired,
84
- dataIndex: _propTypes.default.number.isRequired,
85
70
  height: _propTypes.default.number.isRequired,
86
71
  seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
87
72
  /**
@@ -1,4 +1,7 @@
1
+ import type { HeatmapCellOwnerState } from "./HeatmapCell.js";
1
2
  export interface HeatmapClasses {
3
+ /** Styles applied to the heatmap plot root element. */
4
+ root: string;
2
5
  /** Styles applied to the heatmap cells. */
3
6
  cell: string;
4
7
  /** Styles applied to the cell element if highlighted. */
@@ -8,9 +11,11 @@ export interface HeatmapClasses {
8
11
  /**
9
12
  * Styles applied to the root element for a specified series.
10
13
  * Needs to be suffixed with the series ID: `.${heatmapClasses.series}-${seriesId}`.
14
+ * @deprecated Use `[data-series="${seriesId}"]` selector instead.
11
15
  */
12
16
  series: string;
13
17
  }
14
18
  export type HeatmapClassKey = keyof HeatmapClasses;
15
19
  export declare function getHeatmapUtilityClass(slot: string): string;
16
- export declare const heatmapClasses: HeatmapClasses;
20
+ export declare const heatmapClasses: HeatmapClasses;
21
+ export declare const useUtilityClasses: (ownerState: HeatmapCellOwnerState) => Record<"cell" | "root", string>;
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.getHeatmapUtilityClass = getHeatmapUtilityClass;
8
- exports.heatmapClasses = void 0;
8
+ exports.useUtilityClasses = exports.heatmapClasses = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
11
+ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
11
12
  var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
12
13
  function getHeatmapUtilityClass(slot) {
13
14
  // Those should be common to all charts
@@ -16,7 +17,21 @@ function getHeatmapUtilityClass(slot) {
16
17
  }
17
18
  return (0, _generateUtilityClass.default)('MuiHeatmap', slot);
18
19
  }
19
- const heatmapClasses = exports.heatmapClasses = (0, _extends2.default)({}, (0, _generateUtilityClasses.default)('MuiHeatmap', ['cell', 'series']), {
20
+ const heatmapClasses = exports.heatmapClasses = (0, _extends2.default)({}, (0, _generateUtilityClasses.default)('MuiHeatmap', ['root', 'cell', 'series']), {
20
21
  highlighted: 'Charts-highlighted',
21
22
  faded: 'Charts-faded'
22
- });
23
+ });
24
+ const useUtilityClasses = ownerState => {
25
+ const {
26
+ classes,
27
+ seriesId,
28
+ isFaded,
29
+ isHighlighted
30
+ } = ownerState;
31
+ const slots = {
32
+ root: ['root'],
33
+ cell: ['cell', `series-${seriesId}`, isFaded && 'faded', isHighlighted && 'highlighted']
34
+ };
35
+ return (0, _composeClasses.default)(slots, getHeatmapUtilityClass, classes);
36
+ };
37
+ exports.useUtilityClasses = useUtilityClasses;
@@ -2,7 +2,9 @@ export { Heatmap } from "./Heatmap.js";
2
2
  export type { HeatmapSeries, HeatmapProps } from "./Heatmap.js";
3
3
  export { HeatmapPlot } from "./HeatmapPlot.js";
4
4
  export * from "./FocusedHeatmapCell.js";
5
- export type { HeatmapCellProps } from "./internals/HeatmapCell.js";
5
+ export { HeatmapCell } from "./HeatmapCell.js";
6
+ export type { HeatmapCellProps, HeatmapCellOwnerState } from "./HeatmapCell.js";
6
7
  export * from "./HeatmapTooltip/index.js";
7
8
  export * from "./Heatmap.plugins.js";
8
- export * from "./heatmapClasses.js";
9
+ export { heatmapClasses } from "./heatmapClasses.js";
10
+ export type { HeatmapClasses, HeatmapClassKey } from "./heatmapClasses.js";
package/Heatmap/index.js CHANGED
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  var _exportNames = {
7
7
  Heatmap: true,
8
- HeatmapPlot: true
8
+ HeatmapPlot: true,
9
+ HeatmapCell: true,
10
+ heatmapClasses: true
9
11
  };
10
12
  Object.defineProperty(exports, "Heatmap", {
11
13
  enumerable: true,
@@ -13,12 +15,24 @@ Object.defineProperty(exports, "Heatmap", {
13
15
  return _Heatmap.Heatmap;
14
16
  }
15
17
  });
18
+ Object.defineProperty(exports, "HeatmapCell", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _HeatmapCell.HeatmapCell;
22
+ }
23
+ });
16
24
  Object.defineProperty(exports, "HeatmapPlot", {
17
25
  enumerable: true,
18
26
  get: function () {
19
27
  return _HeatmapPlot.HeatmapPlot;
20
28
  }
21
29
  });
30
+ Object.defineProperty(exports, "heatmapClasses", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _heatmapClasses.heatmapClasses;
34
+ }
35
+ });
22
36
  var _Heatmap = require("./Heatmap");
23
37
  var _HeatmapPlot = require("./HeatmapPlot");
24
38
  var _FocusedHeatmapCell = require("./FocusedHeatmapCell");
@@ -33,6 +47,7 @@ Object.keys(_FocusedHeatmapCell).forEach(function (key) {
33
47
  }
34
48
  });
35
49
  });
50
+ var _HeatmapCell = require("./HeatmapCell");
36
51
  var _HeatmapTooltip = require("./HeatmapTooltip");
37
52
  Object.keys(_HeatmapTooltip).forEach(function (key) {
38
53
  if (key === "default" || key === "__esModule") return;
@@ -57,15 +72,4 @@ Object.keys(_Heatmap2).forEach(function (key) {
57
72
  }
58
73
  });
59
74
  });
60
- var _heatmapClasses = require("./heatmapClasses");
61
- Object.keys(_heatmapClasses).forEach(function (key) {
62
- if (key === "default" || key === "__esModule") return;
63
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
64
- if (key in exports && exports[key] === _heatmapClasses[key]) return;
65
- Object.defineProperty(exports, key, {
66
- enumerable: true,
67
- get: function () {
68
- return _heatmapClasses[key];
69
- }
70
- });
71
- });
75
+ var _heatmapClasses = require("./heatmapClasses");
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.shouldRegisterPointerInteractionsGlobally = shouldRegisterPointerInteractionsGlobally;
7
- var _HeatmapCell = require("./internals/HeatmapCell");
7
+ var _HeatmapCell = require("./HeatmapCell");
8
8
  /* Global pointer interactions should be registered when we're using the default HeatmapCell.
9
9
  * We only want to return false when a custom slot is being used to avoid breaking changes.
10
10
  *
@@ -1588,8 +1588,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
1588
1588
  requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
1589
1589
  type: _propTypes.default.oneOf(['doubleTapReset']).isRequired
1590
1590
  }), _propTypes.default.shape({
1591
- pointerMode: _propTypes.default.any,
1592
- requiredKeys: _propTypes.default.array,
1591
+ pointerMode: _propTypes.default.oneOf(['mouse', 'touch']),
1592
+ requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
1593
1593
  type: _propTypes.default.oneOf(['brush']).isRequired
1594
1594
  })]).isRequired)
1595
1595
  })
@@ -11,8 +11,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
13
13
  var _internals = require("@mui/x-charts/internals");
14
- var _plugins = require("./plugins");
15
14
  var _useSankeyHighlight = require("./plugins/useSankeyHighlight.selectors");
15
+ var _sankeyClasses = require("./sankeyClasses");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
  /**
18
18
  * @ignore - internal component.
@@ -33,11 +33,12 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
33
33
  sourceId: link.source.id,
34
34
  link
35
35
  };
36
- const isHighlighted = store.use(_plugins.selectorIsLinkHighlighted, link);
36
+ const isHighlighted = store.use(_useSankeyHighlight.selectorIsLinkHighlighted, link);
37
37
  const isFaded = store.use(_useSankeyHighlight.selectorIsSankeyItemFaded, isHighlighted);
38
38
 
39
39
  // Add interaction props for tooltips
40
40
  const interactionProps = (0, _internals.useInteractionItemProps)(identifier);
41
+ const classes = (0, _sankeyClasses.useUtilityClasses)();
41
42
  const handleClick = (0, _useEventCallback.default)(event => {
42
43
  onClick?.(event, identifier);
43
44
  });
@@ -52,6 +53,7 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
52
53
  }
53
54
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("path", (0, _extends2.default)({
54
55
  ref: ref,
56
+ className: classes.link,
55
57
  d: link.path,
56
58
  fill: link.color,
57
59
  opacity: finalOpacity,
@@ -9,6 +9,7 @@ exports.SankeyLinkLabel = void 0;
9
9
  var React = _interopRequireWildcard(require("react"));
10
10
  var _styles = require("@mui/material/styles");
11
11
  var _useSankeySeries = require("../hooks/useSankeySeries");
12
+ var _sankeyClasses = require("./sankeyClasses");
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  const getLinkMidpoint = link => {
14
15
  if (link.y0 === undefined || link.y1 === undefined) {
@@ -38,6 +39,7 @@ const SankeyLinkLabel = exports.SankeyLinkLabel = /*#__PURE__*/React.forwardRef(
38
39
  } = props;
39
40
  const theme = (0, _styles.useTheme)();
40
41
  const series = (0, _useSankeySeries.useSankeySeries)()[0];
42
+ const classes = (0, _sankeyClasses.useUtilityClasses)();
41
43
  if (!link.path || link.y0 === undefined || link.y1 === undefined) {
42
44
  return null; // No path defined or invalid coordinates, nothing to render
43
45
  }
@@ -52,6 +54,7 @@ const SankeyLinkLabel = exports.SankeyLinkLabel = /*#__PURE__*/React.forwardRef(
52
54
  }) : link.value;
53
55
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("text", {
54
56
  ref: ref,
57
+ className: classes.linkLabel,
55
58
  x: midpoint.x,
56
59
  y: midpoint.y,
57
60
  textAnchor: "middle",
@@ -20,4 +20,4 @@ export interface SankeyNodeElementProps {
20
20
  /**
21
21
  * @ignore - internal component.
22
22
  */
23
- export declare const SankeyNodeElement: React.ForwardRefExoticComponent<SankeyNodeElementProps & React.RefAttributes<SVGGElement>>;
23
+ export declare const SankeyNodeElement: React.ForwardRefExoticComponent<SankeyNodeElementProps & React.RefAttributes<SVGRectElement>>;
@@ -11,8 +11,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
13
13
  var _internals = require("@mui/x-charts/internals");
14
- var _plugins = require("./plugins");
15
14
  var _useSankeyHighlight = require("./plugins/useSankeyHighlight.selectors");
15
+ var _sankeyClasses = require("./sankeyClasses");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
  /**
18
18
  * @ignore - internal component.
@@ -37,11 +37,12 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
37
37
  nodeId: node.id,
38
38
  node
39
39
  };
40
- const isHighlighted = store.use(_plugins.selectorIsNodeHighlighted, node.id);
40
+ const isHighlighted = store.use(_useSankeyHighlight.selectorIsNodeHighlighted, node.id);
41
41
  const isFaded = store.use(_useSankeyHighlight.selectorIsSankeyItemFaded, isHighlighted);
42
42
 
43
43
  // Add interaction props for tooltips
44
44
  const interactionProps = (0, _internals.useInteractionItemProps)(identifier);
45
+ const classes = (0, _sankeyClasses.useUtilityClasses)();
45
46
  const handleClick = (0, _useEventCallback.default)(event => {
46
47
  onClick?.(event, identifier);
47
48
  });
@@ -65,7 +66,8 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
65
66
  cursor: onClick ? 'pointer' : 'default',
66
67
  stroke: "none",
67
68
  "data-highlighted": isHighlighted || undefined,
68
- "data-faded": isFaded || undefined
69
+ "data-faded": isFaded || undefined,
70
+ className: classes.node
69
71
  }, interactionProps))
70
72
  });
71
73
  });
@@ -9,6 +9,7 @@ exports.SankeyNodeLabel = void 0;
9
9
  var React = _interopRequireWildcard(require("react"));
10
10
  var _styles = require("@mui/material/styles");
11
11
  var _sankeyHighlightHooks = require("./sankeyHighlightHooks");
12
+ var _sankeyClasses = require("./sankeyClasses");
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  /**
14
15
  * @ignore - internal component.
@@ -29,6 +30,7 @@ const SankeyNodeLabel = exports.SankeyNodeLabel = /*#__PURE__*/React.forwardRef(
29
30
  : x0 - 6; // Left side for other columns
30
31
 
31
32
  const labelAnchor = isRightSide ? 'start' : 'end';
33
+ const classes = (0, _sankeyClasses.useUtilityClasses)();
32
34
  const highlightState = (0, _sankeyHighlightHooks.useSankeyNodeHighlightState)(node.id);
33
35
  let opacity = 1;
34
36
  if (highlightState === 'faded') {
@@ -41,6 +43,7 @@ const SankeyNodeLabel = exports.SankeyNodeLabel = /*#__PURE__*/React.forwardRef(
41
43
  }
42
44
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("text", {
43
45
  ref: ref,
46
+ className: classes.nodeLabel,
44
47
  x: labelX,
45
48
  y: (y0 + y1) / 2,
46
49
  textAnchor: labelAnchor,
@@ -18,8 +18,8 @@ var _SankeyNodeLabelPlot = require("./SankeyNodeLabelPlot");
18
18
  var _SankeyLinkLabelPlot = require("./SankeyLinkLabelPlot");
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
20
  const SankeyPlotRoot = (0, _styles.styled)('g', {
21
- slot: 'internal',
22
- shouldForwardProp: undefined
21
+ name: 'MuiSankeyPlot',
22
+ slot: 'Root'
23
23
  })({});
24
24
 
25
25
  /**
@@ -12,6 +12,7 @@ export * from "./sankey.types.js";
12
12
  export * from "./sankeySlots.types.js";
13
13
  export * from "./sankeyHighlightHooks.js";
14
14
  export * from "../hooks/useSankeySeries.js";
15
- export { type SankeyPlotClasses, sankeyPlotClasses } from "./sankeyClasses.js";
15
+ export { type SankeyPlotClasses, sankeyPlotClasses, sankeyClasses } from "./sankeyClasses.js";
16
+ export type { SankeyClassKey, SankeyClasses } from "./sankeyClasses.js";
16
17
  export { SankeyTooltip, SankeyTooltipContent } from "./SankeyTooltip/index.js";
17
18
  export type { SankeyTooltipProps } from "./SankeyTooltip/index.js";
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  var _exportNames = {
7
7
  Unstable_SankeyChart: true,
8
8
  sankeyPlotClasses: true,
9
+ sankeyClasses: true,
9
10
  SankeyTooltip: true,
10
11
  SankeyTooltipContent: true
11
12
  };
@@ -27,6 +28,12 @@ Object.defineProperty(exports, "Unstable_SankeyChart", {
27
28
  return _SankeyChart.SankeyChart;
28
29
  }
29
30
  });
31
+ Object.defineProperty(exports, "sankeyClasses", {
32
+ enumerable: true,
33
+ get: function () {
34
+ return _sankeyClasses.sankeyClasses;
35
+ }
36
+ });
30
37
  Object.defineProperty(exports, "sankeyPlotClasses", {
31
38
  enumerable: true,
32
39
  get: function () {
@@ -1,4 +1,4 @@
1
- export interface SankeyPlotClasses {
1
+ export interface SankeyClasses {
2
2
  /** Styles applied to the root element. */
3
3
  root: string;
4
4
  /** Styles applied to the nodes container. */
@@ -9,9 +9,30 @@ export interface SankeyPlotClasses {
9
9
  links: string;
10
10
  /** Styles applied to the link label container. */
11
11
  linkLabels: string;
12
+ /** Styles applied to an individual node element. */
13
+ node: string;
14
+ /** Styles applied to an individual link element. */
15
+ link: string;
16
+ /** Styles applied to an individual node label element. */
17
+ nodeLabel: string;
18
+ /** Styles applied to an individual link label element. */
19
+ linkLabel: string;
12
20
  }
13
- export declare function getSankeyPlotUtilityClass(slot: string): string;
14
- export declare const sankeyPlotClasses: SankeyPlotClasses;
15
- export declare const useUtilityClasses: (ownerState: {
16
- classes?: Partial<SankeyPlotClasses>;
17
- }) => Record<"nodes" | "links" | "root" | "nodeLabels" | "linkLabels", string>;
21
+ export type SankeyClassKey = keyof SankeyClasses;
22
+ /**
23
+ * @deprecated Use `SankeyClasses` instead.
24
+ */
25
+ export type SankeyPlotClasses = SankeyClasses;
26
+ export declare function getSankeyUtilityClass(slot: string): string;
27
+ /**
28
+ * @deprecated Use `getSankeyUtilityClass` instead.
29
+ */
30
+ export declare const getSankeyPlotUtilityClass: typeof getSankeyUtilityClass;
31
+ export declare const sankeyClasses: SankeyClasses;
32
+ /**
33
+ * @deprecated Use `sankeyClasses` instead.
34
+ */
35
+ export declare const sankeyPlotClasses: SankeyClasses;
36
+ export declare const useUtilityClasses: (options?: {
37
+ classes?: Partial<SankeyClasses>;
38
+ }) => Record<"nodes" | "links" | "node" | "link" | "root" | "nodeLabels" | "linkLabels" | "nodeLabel" | "linkLabel", string>;
@@ -4,26 +4,45 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.getSankeyPlotUtilityClass = getSankeyPlotUtilityClass;
8
- exports.useUtilityClasses = exports.sankeyPlotClasses = void 0;
7
+ exports.getSankeyPlotUtilityClass = void 0;
8
+ exports.getSankeyUtilityClass = getSankeyUtilityClass;
9
+ exports.useUtilityClasses = exports.sankeyPlotClasses = exports.sankeyClasses = void 0;
9
10
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
10
11
  var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
11
12
  var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
12
- function getSankeyPlotUtilityClass(slot) {
13
+ /**
14
+ * @deprecated Use `SankeyClasses` instead.
15
+ */
16
+
17
+ function getSankeyUtilityClass(slot) {
13
18
  return (0, _generateUtilityClass.default)('MuiSankeyChart', slot);
14
19
  }
15
- const sankeyPlotClasses = exports.sankeyPlotClasses = (0, _generateUtilityClasses.default)('MuiSankeyChart', ['root', 'nodes', 'nodeLabels', 'links', 'linkLabels']);
16
- const useUtilityClasses = ownerState => {
20
+
21
+ /**
22
+ * @deprecated Use `getSankeyUtilityClass` instead.
23
+ */
24
+ const getSankeyPlotUtilityClass = exports.getSankeyPlotUtilityClass = getSankeyUtilityClass;
25
+ const sankeyClasses = exports.sankeyClasses = (0, _generateUtilityClasses.default)('MuiSankeyChart', ['root', 'nodes', 'nodeLabels', 'links', 'linkLabels', 'node', 'link', 'nodeLabel', 'linkLabel']);
26
+
27
+ /**
28
+ * @deprecated Use `sankeyClasses` instead.
29
+ */
30
+ const sankeyPlotClasses = exports.sankeyPlotClasses = sankeyClasses;
31
+ const useUtilityClasses = options => {
17
32
  const {
18
33
  classes
19
- } = ownerState;
34
+ } = options ?? {};
20
35
  const slots = {
21
36
  root: ['root'],
22
37
  nodes: ['nodes'],
23
38
  nodeLabels: ['nodeLabels'],
24
39
  links: ['links'],
25
- linkLabels: ['linkLabels']
40
+ linkLabels: ['linkLabels'],
41
+ node: ['node'],
42
+ link: ['link'],
43
+ nodeLabel: ['nodeLabel'],
44
+ linkLabel: ['linkLabel']
26
45
  };
27
- return (0, _composeClasses.default)(slots, getSankeyPlotUtilityClass, classes);
46
+ return (0, _composeClasses.default)(slots, getSankeyUtilityClass, classes);
28
47
  };
29
48
  exports.useUtilityClasses = useUtilityClasses;
@@ -1570,8 +1570,8 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
1570
1570
  requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
1571
1571
  type: _propTypes.default.oneOf(['doubleTapReset']).isRequired
1572
1572
  }), _propTypes.default.shape({
1573
- pointerMode: _propTypes.default.any,
1574
- requiredKeys: _propTypes.default.array,
1573
+ pointerMode: _propTypes.default.oneOf(['mouse', 'touch']),
1574
+ requiredKeys: _propTypes.default.arrayOf(_propTypes.default.string),
1575
1575
  type: _propTypes.default.oneOf(['brush']).isRequired
1576
1576
  })]).isRequired)
1577
1577
  })
@@ -1588,8 +1588,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
1588
1588
  requiredKeys: PropTypes.arrayOf(PropTypes.string),
1589
1589
  type: PropTypes.oneOf(['doubleTapReset']).isRequired
1590
1590
  }), PropTypes.shape({
1591
- pointerMode: PropTypes.any,
1592
- requiredKeys: PropTypes.array,
1591
+ pointerMode: PropTypes.oneOf(['mouse', 'touch']),
1592
+ requiredKeys: PropTypes.arrayOf(PropTypes.string),
1593
1593
  type: PropTypes.oneOf(['brush']).isRequired
1594
1594
  })]).isRequired)
1595
1595
  })
@@ -10,7 +10,7 @@ import { defaultSlotsMaterial } from "../internals/material/index.js";
10
10
  import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
11
11
  import { useChartsDataProviderProProps } from "./useChartsDataProviderProProps.js";
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- const releaseInfo = "MTc3MzE4NzIwMDAwMA==";
13
+ const releaseInfo = "MTc3NTAwMTYwMDAwMA==";
14
14
  const packageIdentifier = 'x-charts-pro';
15
15
  export const defaultSeriesConfigPro = defaultSeriesConfig;
16
16
 
@@ -7,6 +7,7 @@ import { line as d3Line } from '@mui/x-charts-vendor/d3-shape';
7
7
  import { cartesianSeriesTypes, useStore } from '@mui/x-charts/internals';
8
8
  import { FunnelSection } from "./FunnelSection.js";
9
9
  import { alignLabel, positionLabel } from "./labelUtils.js";
10
+ import { useUtilityClasses } from "./funnelClasses.js";
10
11
  import { useFunnelSeriesContext } from "../hooks/useFunnelSeries.js";
11
12
  import { getFunnelCurve } from "./curves/index.js";
12
13
  import { FunnelSectionLabel } from "./FunnelSectionLabel.js";
@@ -102,7 +103,9 @@ function FunnelPlot(props) {
102
103
  } = props,
103
104
  other = _objectWithoutPropertiesLoose(props, _excluded);
104
105
  const data = useAggregatedData();
105
- return /*#__PURE__*/_jsxs(React.Fragment, {
106
+ const classes = useUtilityClasses();
107
+ return /*#__PURE__*/_jsxs("g", {
108
+ className: classes.root,
106
109
  children: [data.map(series => {
107
110
  if (series.length === 0) {
108
111
  return null;
@@ -142,7 +145,8 @@ function FunnelPlot(props) {
142
145
  id,
143
146
  label,
144
147
  seriesId,
145
- dataIndex
148
+ dataIndex,
149
+ variant
146
150
  }) => {
147
151
  if (!label || !label.value) {
148
152
  return null;
@@ -150,7 +154,8 @@ function FunnelPlot(props) {
150
154
  return /*#__PURE__*/_jsx(FunnelSectionLabel, _extends({
151
155
  label: label,
152
156
  dataIndex: dataIndex,
153
- seriesId: seriesId
157
+ seriesId: seriesId,
158
+ variant: variant
154
159
  }, other), id);
155
160
  })
156
161
  }, series[0].seriesId);
@@ -8,11 +8,12 @@ import { styled } from '@mui/material/styles';
8
8
  import { useInteractionItemProps, consumeSlots } from '@mui/x-charts/internals';
9
9
  import { useItemHighlighted } from '@mui/x-charts/hooks';
10
10
  import clsx from 'clsx';
11
- import { useUtilityClasses } from "./funnelSectionClasses.js";
11
+ import { useUtilityClasses as useDeprecatedUtilityClasses } from "./funnelSectionClasses.js";
12
+ import { useUtilityClasses } from "./funnelClasses.js";
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  export const FunnelSectionPath = styled('path', {
14
- slot: 'internal',
15
- shouldForwardProp: undefined
15
+ name: 'MuiFunnelChart',
16
+ slot: 'Section'
16
17
  })(() => ({
17
18
  transition: 'opacity 0.2s ease-in, fill 0.2s ease-in, fill-opacity 0.2s ease-in, filter 0.2s ease-in'
18
19
  }));
@@ -21,7 +22,7 @@ export const FunnelSectionPath = styled('path', {
21
22
  * @ignore - internal component.
22
23
  */
23
24
  const FunnelSection = consumeSlots('MuiFunnelSection', 'funnelSection', {
24
- classesResolver: useUtilityClasses
25
+ classesResolver: useDeprecatedUtilityClasses
25
26
  }, /*#__PURE__*/React.forwardRef(function FunnelSection(props, ref) {
26
27
  const {
27
28
  seriesId,
@@ -45,6 +46,9 @@ const FunnelSection = consumeSlots('MuiFunnelSection', 'funnelSection', {
45
46
  seriesId,
46
47
  dataIndex
47
48
  });
49
+ const newClasses = useUtilityClasses({
50
+ variant
51
+ });
48
52
  const isOutlined = variant === 'outlined';
49
53
  return /*#__PURE__*/_jsx(FunnelSectionPath, _extends({}, interactionProps, {
50
54
  filter: isHighlighted && !isOutlined ? 'brightness(120%)' : undefined,
@@ -58,7 +62,7 @@ const FunnelSection = consumeSlots('MuiFunnelSection', 'funnelSection', {
58
62
  onClick: onClick,
59
63
  "data-highlighted": isHighlighted || undefined,
60
64
  "data-faded": isFaded || undefined,
61
- className: clsx(classes?.root, className, isOutlined ? classes?.outlined : classes?.filled, isHighlighted && classes?.highlighted, isFaded && classes?.faded)
65
+ className: clsx(newClasses.section, classes?.root, className, isOutlined ? classes?.outlined : classes?.filled, isHighlighted && classes?.highlighted, isFaded && classes?.faded)
62
66
  }, other, {
63
67
  ref: ref
64
68
  }));
@@ -11,9 +11,15 @@ export interface FunnelSectionLabelConfig {
11
11
  export interface FunnelSectionLabelProps extends Omit<React.SVGProps<SVGTextElement>, 'ref' | 'id'> {
12
12
  classes?: Partial<FunnelSectionClasses>;
13
13
  label: FunnelSectionLabelConfig;
14
+ /**
15
+ * Indicate if the section is filled or outlined.
16
+ * Can be used to apply different styles to the label.
17
+ */
18
+ variant?: 'filled' | 'outlined';
14
19
  seriesId: SeriesId;
15
20
  dataIndex: number;
16
21
  }
22
+ export declare const FunnelSectionLabelText: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<React.SVGTextElementAttributes<SVGTextElement>, keyof React.SVGTextElementAttributes<SVGTextElement>>, {}>;
17
23
  /**
18
24
  * @ignore - internal component.
19
25
  */