@mui/x-charts 9.0.0-alpha.0 → 9.0.0-alpha.1

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 (194) hide show
  1. package/BarChart/BarChart.d.ts +1 -1
  2. package/BarChart/BarChart.js +23 -6
  3. package/BarChart/seriesConfig/bar/keyboardFocusHandler.d.ts +1 -1
  4. package/BarChart/seriesConfig/bar/keyboardFocusHandler.js +2 -14
  5. package/CHANGELOG.md +118 -0
  6. package/ChartContainer/useChartContainerProps.d.ts +1 -2
  7. package/ChartContainer/useChartContainerProps.js +2 -2
  8. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +2 -2
  9. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +2 -2
  10. package/ChartsContainer/ChartsContainer.js +25 -8
  11. package/ChartsContainer/useChartsContainerProps.d.ts +2 -5
  12. package/ChartsContainer/useChartsContainerProps.js +7 -4
  13. package/ChartsLegend/ChartsLegend.js +13 -7
  14. package/ChartsLegend/legendContext.types.d.ts +11 -0
  15. package/ChartsOverlay/ChartsLoadingOverlay.js +3 -15
  16. package/ChartsOverlay/ChartsNoDataOverlay.js +3 -15
  17. package/ChartsOverlay/common.d.ts +1 -0
  18. package/ChartsOverlay/common.js +22 -0
  19. package/ChartsSurface/ChartsSurface.js +1 -1
  20. package/ChartsTooltip/ChartTooltip.types.d.ts +5 -4
  21. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +6 -0
  22. package/ChartsTooltip/ChartsAxisTooltipContent.js +22 -2
  23. package/ChartsTooltip/ChartsTooltip.d.ts +10 -2
  24. package/ChartsTooltip/ChartsTooltip.js +18 -5
  25. package/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
  26. package/ChartsTooltip/ChartsTooltipContainer.js +20 -4
  27. package/ChartsWrapper/ChartsWrapper.d.ts +1 -4
  28. package/ChartsWrapper/ChartsWrapper.js +7 -4
  29. package/LineChart/LineChart.d.ts +1 -1
  30. package/LineChart/LineChart.js +23 -6
  31. package/LineChart/LineHighlightElement.d.ts +2 -2
  32. package/LineChart/LineHighlightPlot.js +2 -2
  33. package/LineChart/seriesConfig/keyboardFocusHandler.d.ts +1 -1
  34. package/LineChart/seriesConfig/keyboardFocusHandler.js +2 -14
  35. package/LineChart/useMarkPlotData.js +2 -2
  36. package/PieChart/PieChart.d.ts +3 -3
  37. package/PieChart/PieChart.js +7 -6
  38. package/PieChart/seriesConfig/keyboardFocusHandler.js +2 -15
  39. package/RadarChart/RadarChart.d.ts +1 -1
  40. package/RadarChart/RadarChart.js +6 -6
  41. package/RadarChart/index.d.ts +1 -1
  42. package/RadarChart/seriesConfig/keyboardFocusHandler.js +2 -15
  43. package/ScatterChart/BatchScatter.js +7 -7
  44. package/ScatterChart/ScatterChart.d.ts +1 -1
  45. package/ScatterChart/ScatterChart.js +23 -6
  46. package/ScatterChart/seriesConfig/keyboardFocusHandler.d.ts +1 -1
  47. package/ScatterChart/seriesConfig/keyboardFocusHandler.js +2 -14
  48. package/SparkLineChart/SparkLineChart.js +41 -25
  49. package/esm/BarChart/BarChart.d.ts +1 -1
  50. package/esm/BarChart/BarChart.js +23 -6
  51. package/esm/BarChart/seriesConfig/bar/keyboardFocusHandler.d.ts +1 -1
  52. package/esm/BarChart/seriesConfig/bar/keyboardFocusHandler.js +3 -15
  53. package/esm/ChartContainer/useChartContainerProps.d.ts +1 -2
  54. package/esm/ChartContainer/useChartContainerProps.js +2 -2
  55. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +1 -1
  56. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +1 -1
  57. package/esm/ChartsContainer/ChartsContainer.js +25 -8
  58. package/esm/ChartsContainer/useChartsContainerProps.d.ts +2 -5
  59. package/esm/ChartsContainer/useChartsContainerProps.js +7 -4
  60. package/esm/ChartsLegend/ChartsLegend.js +13 -7
  61. package/esm/ChartsLegend/legendContext.types.d.ts +11 -0
  62. package/esm/ChartsOverlay/ChartsLoadingOverlay.js +2 -14
  63. package/esm/ChartsOverlay/ChartsNoDataOverlay.js +2 -14
  64. package/esm/ChartsOverlay/common.d.ts +1 -0
  65. package/esm/ChartsOverlay/common.js +16 -0
  66. package/esm/ChartsSurface/ChartsSurface.js +1 -1
  67. package/esm/ChartsTooltip/ChartTooltip.types.d.ts +5 -4
  68. package/esm/ChartsTooltip/ChartsAxisTooltipContent.d.ts +6 -0
  69. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +22 -2
  70. package/esm/ChartsTooltip/ChartsTooltip.d.ts +10 -2
  71. package/esm/ChartsTooltip/ChartsTooltip.js +18 -5
  72. package/esm/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
  73. package/esm/ChartsTooltip/ChartsTooltipContainer.js +19 -3
  74. package/esm/ChartsWrapper/ChartsWrapper.d.ts +1 -4
  75. package/esm/ChartsWrapper/ChartsWrapper.js +6 -3
  76. package/esm/LineChart/LineChart.d.ts +1 -1
  77. package/esm/LineChart/LineChart.js +23 -6
  78. package/esm/LineChart/LineHighlightElement.d.ts +2 -2
  79. package/esm/LineChart/LineHighlightPlot.js +1 -1
  80. package/esm/LineChart/seriesConfig/keyboardFocusHandler.d.ts +1 -1
  81. package/esm/LineChart/seriesConfig/keyboardFocusHandler.js +3 -15
  82. package/esm/LineChart/useMarkPlotData.js +2 -2
  83. package/esm/PieChart/PieChart.d.ts +3 -3
  84. package/esm/PieChart/PieChart.js +7 -6
  85. package/esm/PieChart/seriesConfig/keyboardFocusHandler.js +2 -15
  86. package/esm/RadarChart/RadarChart.d.ts +1 -1
  87. package/esm/RadarChart/RadarChart.js +6 -6
  88. package/esm/RadarChart/index.d.ts +1 -1
  89. package/esm/RadarChart/seriesConfig/keyboardFocusHandler.js +2 -15
  90. package/esm/ScatterChart/BatchScatter.js +1 -1
  91. package/esm/ScatterChart/ScatterChart.d.ts +1 -1
  92. package/esm/ScatterChart/ScatterChart.js +23 -6
  93. package/esm/ScatterChart/seriesConfig/keyboardFocusHandler.d.ts +1 -1
  94. package/esm/ScatterChart/seriesConfig/keyboardFocusHandler.js +3 -15
  95. package/esm/SparkLineChart/SparkLineChart.js +41 -25
  96. package/esm/hooks/getValueToPositionMapper.d.ts +12 -0
  97. package/esm/hooks/getValueToPositionMapper.js +21 -0
  98. package/esm/hooks/index.d.ts +2 -1
  99. package/esm/hooks/index.js +2 -1
  100. package/esm/hooks/useInteractionItemProps.d.ts +2 -2
  101. package/esm/hooks/useLegend.d.ts +2 -2
  102. package/esm/hooks/useScale.d.ts +1 -12
  103. package/esm/hooks/useScale.js +0 -20
  104. package/esm/index.js +1 -1
  105. package/esm/internals/createCommonKeyboardFocusHandler.d.ts +25 -0
  106. package/esm/internals/createCommonKeyboardFocusHandler.js +22 -0
  107. package/esm/internals/getGraphemeCount.js +3 -1
  108. package/esm/internals/identifierCleaner.d.ts +2 -2
  109. package/esm/internals/index.d.ts +1 -0
  110. package/esm/internals/index.js +1 -0
  111. package/esm/internals/plugins/corePlugins/useChartSeries/index.d.ts +1 -1
  112. package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +5 -2
  113. package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.js +9 -1
  114. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.d.ts +12 -2
  115. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +41 -11
  116. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +20 -2
  117. package/esm/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemAtPosition.types.d.ts +2 -2
  118. package/esm/internals/plugins/corePlugins/useChartSeriesConfig/types/identifierCleaner.types.d.ts +2 -2
  119. package/esm/internals/plugins/corePlugins/useChartSeriesConfig/types/identifierSerializer.types.d.ts +2 -2
  120. package/esm/internals/plugins/corePlugins/useChartSeriesConfig/types/legendGetter.types.d.ts +2 -2
  121. package/esm/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +3 -3
  122. package/esm/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.ts +3 -3
  123. package/esm/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.ts +2 -2
  124. package/esm/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.d.ts +2 -2
  125. package/esm/internals/plugins/corePlugins/useChartSeriesConfig/utils/cleanIdentifier.d.ts +2 -2
  126. package/esm/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.d.ts +2 -2
  127. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
  128. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -0
  129. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +20 -3
  130. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +17 -0
  131. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +1 -19
  132. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +2 -53
  133. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianTooltip.selectors.d.ts +25 -0
  134. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianTooltip.selectors.js +149 -0
  135. package/esm/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.ts +3 -3
  136. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.d.ts +2 -2
  137. package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.js +14 -7
  138. package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.types.d.ts +4 -4
  139. package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.js +7 -6
  140. package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.d.ts +1 -2
  141. package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.d.ts +6 -3
  142. package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.d.ts +2 -2
  143. package/esm/internals/sliceUntil.js +3 -1
  144. package/esm/models/seriesType/index.d.ts +4 -1
  145. package/hooks/getValueToPositionMapper.d.ts +12 -0
  146. package/hooks/getValueToPositionMapper.js +26 -0
  147. package/hooks/index.d.ts +2 -1
  148. package/hooks/index.js +12 -0
  149. package/hooks/useInteractionItemProps.d.ts +2 -2
  150. package/hooks/useLegend.d.ts +2 -2
  151. package/hooks/useScale.d.ts +1 -12
  152. package/hooks/useScale.js +0 -21
  153. package/index.js +1 -1
  154. package/internals/createCommonKeyboardFocusHandler.d.ts +25 -0
  155. package/internals/createCommonKeyboardFocusHandler.js +27 -0
  156. package/internals/getGraphemeCount.js +3 -1
  157. package/internals/identifierCleaner.d.ts +2 -2
  158. package/internals/index.d.ts +1 -0
  159. package/internals/index.js +8 -0
  160. package/internals/plugins/corePlugins/useChartSeries/index.d.ts +1 -1
  161. package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +5 -2
  162. package/internals/plugins/corePlugins/useChartSeries/processSeries.js +9 -1
  163. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.d.ts +12 -2
  164. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +42 -11
  165. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +20 -2
  166. package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemAtPosition.types.d.ts +2 -2
  167. package/internals/plugins/corePlugins/useChartSeriesConfig/types/identifierCleaner.types.d.ts +2 -2
  168. package/internals/plugins/corePlugins/useChartSeriesConfig/types/identifierSerializer.types.d.ts +2 -2
  169. package/internals/plugins/corePlugins/useChartSeriesConfig/types/legendGetter.types.d.ts +2 -2
  170. package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +3 -3
  171. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.ts +3 -3
  172. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.ts +2 -2
  173. package/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.d.ts +2 -2
  174. package/internals/plugins/corePlugins/useChartSeriesConfig/utils/cleanIdentifier.d.ts +2 -2
  175. package/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.d.ts +2 -2
  176. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
  177. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +12 -0
  178. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +20 -3
  179. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +17 -0
  180. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +1 -19
  181. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +2 -53
  182. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianTooltip.selectors.d.ts +25 -0
  183. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianTooltip.selectors.js +155 -0
  184. package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.ts +3 -3
  185. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.d.ts +2 -2
  186. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.js +14 -7
  187. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.types.d.ts +4 -4
  188. package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.js +7 -6
  189. package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.d.ts +1 -2
  190. package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.d.ts +6 -3
  191. package/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.d.ts +2 -2
  192. package/internals/sliceUntil.js +3 -1
  193. package/models/seriesType/index.d.ts +4 -1
  194. package/package.json +16 -4
@@ -70,5 +70,5 @@ export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartP
70
70
  *
71
71
  * - [BarChart API](https://mui.com/x/api/charts/bar-chart/)
72
72
  */
73
- declare const BarChart: React.ForwardRefExoticComponent<BarChartProps & React.RefAttributes<SVGSVGElement>>;
73
+ declare const BarChart: React.ForwardRefExoticComponent<BarChartProps & React.RefAttributes<HTMLDivElement>>;
74
74
  export { BarChart };
@@ -58,11 +58,12 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
58
58
  const {
59
59
  chartDataProviderProps,
60
60
  chartsSurfaceProps
61
- } = (0, _useChartContainerProps.useChartContainerProps)(chartContainerProps, ref);
61
+ } = (0, _useChartContainerProps.useChartContainerProps)(chartContainerProps);
62
62
  const Tooltip = props.slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
63
63
  const Toolbar = props.slots?.toolbar;
64
64
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProvider.ChartDataProvider, (0, _extends2.default)({}, chartDataProviderProps, {
65
65
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
66
+ ref: ref,
66
67
  children: [props.showToolbar && Toolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
67
68
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, clipPathGroupProps, {
68
69
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, (0, _extends2.default)({}, barPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FocusedBar.FocusedBar, {})]
@@ -168,8 +169,8 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
168
169
  */
169
170
  hiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
170
171
  dataIndex: _propTypes.default.number,
171
- seriesId: _propTypes.default.string,
172
- type: _propTypes.default.oneOf(['bar']).isRequired
172
+ seriesId: _propTypes.default.string.isRequired,
173
+ type: _propTypes.default.oneOf(['bar'])
173
174
  })),
174
175
  /**
175
176
  * If `true`, the legend is not rendered.
@@ -219,8 +220,8 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
219
220
  */
220
221
  initialHiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
221
222
  dataIndex: _propTypes.default.number,
222
- seriesId: _propTypes.default.string,
223
- type: _propTypes.default.oneOf(['bar']).isRequired
223
+ seriesId: _propTypes.default.string.isRequired,
224
+ type: _propTypes.default.oneOf(['bar'])
224
225
  })),
225
226
  /**
226
227
  * The direction of the bar elements.
@@ -280,6 +281,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
280
281
  * @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
281
282
  */
282
283
  onItemClick: _propTypes.default.func,
284
+ /**
285
+ * The function called when the pointer position corresponds to a new axis data item.
286
+ * This update can either be caused by a pointer movement, or an axis update.
287
+ * In case of multiple axes, the function is called if at least one axis is updated.
288
+ * The argument contains the identifier for all axes with a `data` property.
289
+ * @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
290
+ */
291
+ onTooltipAxisChange: _propTypes.default.func,
283
292
  /**
284
293
  * The callback fired when the tooltip item changes.
285
294
  *
@@ -323,6 +332,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
323
332
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
324
333
  theme: _propTypes.default.oneOf(['dark', 'light']),
325
334
  title: _propTypes.default.string,
335
+ /**
336
+ * The controlled axis tooltip.
337
+ * Identified by the axis id, and data index.
338
+ */
339
+ tooltipAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
340
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
341
+ dataIndex: _propTypes.default.number.isRequired
342
+ })),
326
343
  /**
327
344
  * The tooltip item.
328
345
  * Used when the tooltip is controlled.
@@ -330,7 +347,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
330
347
  tooltipItem: _propTypes.default.shape({
331
348
  dataIndex: _propTypes.default.number.isRequired,
332
349
  seriesId: _propTypes.default.string.isRequired,
333
- type: _propTypes.default.oneOf(['bar']).isRequired
350
+ type: _propTypes.default.oneOf(['bar'])
334
351
  }),
335
352
  /**
336
353
  * The width of the chart in px. If not defined, it takes the width of the parent element.
@@ -1,4 +1,4 @@
1
- import { type ComposableCartesianChartSeriesType } from "../../../internals/commonNextFocusItem.js";
2
1
  import type { KeyboardFocusHandler } from "../../../internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js";
2
+ import { type ComposableCartesianChartSeriesType } from "../../../internals/commonNextFocusItem.js";
3
3
  declare const keyboardFocusHandler: KeyboardFocusHandler<'bar', ComposableCartesianChartSeriesType>;
4
4
  export default keyboardFocusHandler;
@@ -4,19 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _createCommonKeyboardFocusHandler = require("../../../internals/createCommonKeyboardFocusHandler");
7
8
  var _commonNextFocusItem = require("../../../internals/commonNextFocusItem");
8
- const keyboardFocusHandler = event => {
9
- switch (event.key) {
10
- case 'ArrowRight':
11
- return (0, _commonNextFocusItem.createGetNextIndexFocusedItem)(_commonNextFocusItem.composableCartesianSeriesTypes);
12
- case 'ArrowLeft':
13
- return (0, _commonNextFocusItem.createGetPreviousIndexFocusedItem)(_commonNextFocusItem.composableCartesianSeriesTypes);
14
- case 'ArrowDown':
15
- return (0, _commonNextFocusItem.createGetPreviousSeriesFocusedItem)(_commonNextFocusItem.composableCartesianSeriesTypes);
16
- case 'ArrowUp':
17
- return (0, _commonNextFocusItem.createGetNextSeriesFocusedItem)(_commonNextFocusItem.composableCartesianSeriesTypes);
18
- default:
19
- return null;
20
- }
21
- };
9
+ const keyboardFocusHandler = (0, _createCommonKeyboardFocusHandler.createCommonKeyboardFocusHandler)(_commonNextFocusItem.composableCartesianSeriesTypes);
22
10
  var _default = exports.default = keyboardFocusHandler;
package/CHANGELOG.md CHANGED
@@ -1,5 +1,123 @@
1
1
  # Changelog
2
2
 
3
+ ## 9.0.0-alpha.1
4
+
5
+ _Feb 26, 2026_
6
+
7
+ We'd like to extend a big thank you to the 18 contributors who made this release possible. Here are some highlights ✨:
8
+
9
+ - ⚡️ Improved dynamic data support and cache invalidation in lazy loading for Data Grid Pro
10
+ - ⌨️ Keyboard support for selecting day, month, and year in Date Pickers
11
+ - 📊 Axis tooltip sorting and control improvements in Charts
12
+ - 🐞 Bugfixes and internal improvements
13
+
14
+ Special thanks go out to these community members for their valuable contributions:
15
+ @EllGree, @lion1963
16
+
17
+ The following team members contributed to this release:
18
+ @alexfauquette, @arminmeh, @brijeshb42, @cherniavskii, @dav-is, @flaviendelangle, @Janpot, @JCQuintas, @mapache-salvaje, @MBilalShafi, @michelengelen, @noraleonte, @rita-codes, @sai6855, @siriwatknp, @ZeeshanTamboli
19
+
20
+ ### Data Grid
21
+
22
+ #### `@mui/x-data-grid@9.0.0-alpha.1`
23
+
24
+ - [DataGrid] Forward rest props in `GridFilterInputMultipleValue` (#21407) @siriwatknp
25
+ - [DataGrid] Preserve key input during row edit when using `rowModesModel` (#20759) @michelengelen
26
+ - [DataGrid] Remove double rtl inversion logic for columns pinning (#21371) @siriwatknp
27
+
28
+ #### `@mui/x-data-grid-pro@9.0.0-alpha.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
29
+
30
+ Same changes as in `@mui/x-data-grid@9.0.0-alpha.1`, plus:
31
+
32
+ - [DataGridPro] Fix number input visibility in header filters (#21328) @michelengelen
33
+ - [DataGridPro] Improve dynamic data support and cache invalidation in lazy loading (#21282) @MBilalShafi
34
+
35
+ #### `@mui/x-data-grid-premium@9.0.0-alpha.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
36
+
37
+ Same changes as in `@mui/x-data-grid-pro@9.0.0-alpha.1`.
38
+
39
+ ### Date and Time Pickers
40
+
41
+ #### `@mui/x-date-pickers@9.0.0-alpha.1`
42
+
43
+ - [DatePicker] Add keyboard support for selecting day, month, and year (#20859) @michelengelen
44
+
45
+ #### `@mui/x-date-pickers-pro@9.0.0-alpha.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
46
+
47
+ Same changes as in `@mui/x-date-pickers@9.0.0-alpha.1`, plus:
48
+
49
+ - [DateRangePicker] Fix timezone update issue leading to `invalidRange` error (#20863) @michelengelen
50
+
51
+ ### Charts
52
+
53
+ #### `@mui/x-charts@9.0.0-alpha.1`
54
+
55
+ - [charts] Add `sort` props to the axis tooltip (#21293) @alexfauquette
56
+ - [charts] Controll axis tooltip (#21351) @alexfauquette
57
+ - [charts] De duplicate keyboard focus handler function (#21267) @sai6855
58
+ - [charts] Make `type` optional in identifiers (#21311) @alexfauquette
59
+ - [charts] Move ref to the root component (#21396) @alexfauquette
60
+ - [charts] Refactor loading and no data overlays to use a shared OverlayText component (#21414) @sai6855
61
+ - [charts] Require series ids to be unique (#21330) @alexfauquette
62
+ - [charts] Set `showMark` as `false` by default (#21373) @alexfauquette
63
+ - [charts] Use `createGetNextIndexFocusedItem()` util in Funnel and RangeBar charts (#21390) @sai6855
64
+ - [charts] Remove unnecessary string concatenation (#21418) @sai6855
65
+
66
+ #### `@mui/x-charts-pro@9.0.0-alpha.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
67
+
68
+ Same changes as in `@mui/x-charts@9.0.0-alpha.1`.
69
+
70
+ #### `@mui/x-charts-premium@9.0.0-alpha.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
71
+
72
+ Same changes as in `@mui/x-charts-pro@9.0.0-alpha.1`.
73
+
74
+ ### Tree View
75
+
76
+ #### `@mui/x-tree-view@9.0.0-alpha.1`
77
+
78
+ - [tree view] Focus item sibling on unmount instead of the 1st item (#21254) @flaviendelangle
79
+
80
+ #### `@mui/x-tree-view-pro@9.0.0-alpha.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
81
+
82
+ Same changes as in `@mui/x-tree-view@9.0.0-alpha.1`.
83
+
84
+ ### Codemod
85
+
86
+ #### `@mui/x-codemod@9.0.0-alpha.1`
87
+
88
+ Internal changes.
89
+
90
+ ### Docs
91
+
92
+ - [docs] Fix external 301s (#21377) @Janpot
93
+ - [docs] Show premium in the overview (#21343) @alexfauquette
94
+ - [docs][charts] Revise the useLegend hook doc (#21352) @mapache-salvaje
95
+ - [docs][charts] Revise the axis hooks doc (#21317) @mapache-salvaje
96
+ - [docs][charts] Revise the scale hooks doc (#21316) @mapache-salvaje
97
+ - [docs][charts] Revise the series hooks doc (#21353) @mapache-salvaje
98
+ - [docs][charts] Revise the useDataset doc (#21336) @mapache-salvaje
99
+ - [docs][charts] Revise the useDrawingArea doc (#21333) @mapache-salvaje
100
+
101
+ ### Core
102
+
103
+ - [core] Update docs deploy script to the `docs-next` branch (#21341) @siriwatknp
104
+ - [code-infra] Cleanup unused babel plugins (#21453) @brijeshb42
105
+ - [code-infra] Do not append `x` to the last version for the compare API (#21408) @arminmeh
106
+ - [code-infra] Upgrade react-docgen to v8 X (#21155) @JCQuintas
107
+ - [code-infra] Modernize codemod (#21096) @JCQuintas
108
+ - [docs-infra] Fix current version detection logic (#21417) @cherniavskii
109
+ - [docs-infra] Reapply Cookie Banner (#21281) @dav-is
110
+ - [internal] Headless filtering plugin (#21302) @arminmeh
111
+ - [internal] Headless pagination plugin (#21183) @arminmeh
112
+ - [internal] Headless virtualization followups (#21327) @cherniavskii
113
+ - [internal] Keep cached data for disabled pipe processors (#21348) @arminmeh
114
+ - [internal] Remove autoprefixer package (#21440) @ZeeshanTamboli
115
+
116
+ ### Miscellaneous
117
+
118
+ - [l10n] Fix Czech (csCZ) locale: sort/filter labels are swapped (#21400) @EllGree
119
+ - [l10n] Improve Ukrainian (uk-UA) locale (#21366) @lion1963
120
+
3
121
  ## 9.0.0-alpha.0
4
122
 
5
123
  _Feb 16, 2026_
@@ -1,4 +1,3 @@
1
- import type * as React from 'react';
2
1
  import { type ChartSeriesType } from "../models/seriesType/config.js";
3
2
  import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
4
3
  import { type ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
@@ -11,4 +10,4 @@ export type UseChartContainerPropsReturnValue<TSeries extends ChartSeriesType, T
11
10
  /**
12
11
  * @deprecated Use `useChartsContainerProps` instead.
13
12
  */
14
- export declare const useChartContainerProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartContainerProps<TSeries, TSignatures>, ref: React.Ref<SVGSVGElement>) => UseChartContainerPropsReturnValue<TSeries, TSignatures>;
13
+ export declare const useChartContainerProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartContainerProps<TSeries, TSignatures>) => UseChartContainerPropsReturnValue<TSeries, TSignatures>;
@@ -13,7 +13,7 @@ var _useChartsContainerProps = require("../ChartsContainer/useChartsContainerPro
13
13
  /**
14
14
  * @deprecated Use `useChartsContainerProps` instead.
15
15
  */
16
- const useChartContainerProps = (props, ref) => {
17
- return (0, _useChartsContainerProps.useChartsContainerProps)(props, ref);
16
+ const useChartContainerProps = props => {
17
+ return (0, _useChartsContainerProps.useChartsContainerProps)(props);
18
18
  };
19
19
  exports.useChartContainerProps = useChartContainerProps;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = ChartsXHighlight;
9
9
  var React = _interopRequireWildcard(require("react"));
10
- var _useScale = require("../hooks/useScale");
10
+ var _getValueToPositionMapper = require("../hooks/getValueToPositionMapper");
11
11
  var _scaleGuards = require("../internals/scaleGuards");
12
12
  var _useStore = require("../internals/store/useStore");
13
13
  var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
@@ -38,7 +38,7 @@ function ChartsXHighlight(props) {
38
38
  }) => {
39
39
  const xAxis = xAxes.axis[axisId];
40
40
  const xScale = xAxis.scale;
41
- const getXPosition = (0, _useScale.getValueToPositionMapper)(xScale);
41
+ const getXPosition = (0, _getValueToPositionMapper.getValueToPositionMapper)(xScale);
42
42
  const isXScaleOrdinal = type === 'band' && value !== null && (0, _scaleGuards.isOrdinalScale)(xScale);
43
43
  if (process.env.NODE_ENV !== 'production') {
44
44
  const isError = isXScaleOrdinal && xScale(value) === undefined;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = ChartsYHighlight;
9
9
  var React = _interopRequireWildcard(require("react"));
10
- var _useScale = require("../hooks/useScale");
10
+ var _getValueToPositionMapper = require("../hooks/getValueToPositionMapper");
11
11
  var _scaleGuards = require("../internals/scaleGuards");
12
12
  var _useStore = require("../internals/store/useStore");
13
13
  var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
@@ -38,7 +38,7 @@ function ChartsYHighlight(props) {
38
38
  }) => {
39
39
  const yAxis = yAxes.axis[axisId];
40
40
  const yScale = yAxis.scale;
41
- const getYPosition = (0, _useScale.getValueToPositionMapper)(yScale);
41
+ const getYPosition = (0, _getValueToPositionMapper.getValueToPositionMapper)(yScale);
42
42
  const isYScaleOrdinal = type === 'band' && value !== null && (0, _scaleGuards.isOrdinalScale)(yScale);
43
43
  if (process.env.NODE_ENV !== 'production') {
44
44
  const isError = isYScaleOrdinal && yScale(value) === undefined;
@@ -43,9 +43,10 @@ const ChartsContainer = exports.ChartsContainer = /*#__PURE__*/React.forwardRef(
43
43
  chartDataProviderProps,
44
44
  children,
45
45
  chartsSurfaceProps
46
- } = (0, _useChartsContainerProps.useChartsContainerProps)(props, ref);
46
+ } = (0, _useChartsContainerProps.useChartsContainerProps)(props);
47
47
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProvider.ChartDataProvider, (0, _extends2.default)({}, chartDataProviderProps, {
48
48
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
49
+ ref: ref,
49
50
  children: children
50
51
  }))
51
52
  }));
@@ -128,9 +129,9 @@ process.env.NODE_ENV !== "production" ? ChartsContainer.propTypes = {
128
129
  * ```
129
130
  */
130
131
  hiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
131
- dataIndex: _propTypes.default.number,
132
- seriesId: _propTypes.default.string,
133
- type: _propTypes.default.object.isRequired
132
+ dataIndex: _propTypes.default.any,
133
+ seriesId: _propTypes.default.object.isRequired,
134
+ type: _propTypes.default.object
134
135
  })),
135
136
  /**
136
137
  * The controlled axis highlight.
@@ -175,9 +176,9 @@ process.env.NODE_ENV !== "production" ? ChartsContainer.propTypes = {
175
176
  * ```
176
177
  */
177
178
  initialHiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
178
- dataIndex: _propTypes.default.number,
179
- seriesId: _propTypes.default.string,
180
- type: _propTypes.default.object.isRequired
179
+ dataIndex: _propTypes.default.any,
180
+ seriesId: _propTypes.default.object.isRequired,
181
+ type: _propTypes.default.object
181
182
  })),
182
183
  /**
183
184
  * Localized text for chart components.
@@ -228,6 +229,14 @@ process.env.NODE_ENV !== "production" ? ChartsContainer.propTypes = {
228
229
  * @param {ScatterItemIdentifier} scatterItemIdentifier Identify which item got clicked
229
230
  */
230
231
  onItemClick: _propTypes.default.func,
232
+ /**
233
+ * The function called when the pointer position corresponds to a new axis data item.
234
+ * This update can either be caused by a pointer movement, or an axis update.
235
+ * In case of multiple axes, the function is called if at least one axis is updated.
236
+ * The argument contains the identifier for all axes with a `data` property.
237
+ * @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
238
+ */
239
+ onTooltipAxisChange: _propTypes.default.func,
231
240
  /**
232
241
  * The callback fired when the tooltip item changes.
233
242
  *
@@ -764,6 +773,14 @@ process.env.NODE_ENV !== "production" ? ChartsContainer.propTypes = {
764
773
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
765
774
  theme: _propTypes.default.oneOf(['dark', 'light']),
766
775
  title: _propTypes.default.string,
776
+ /**
777
+ * The controlled axis tooltip.
778
+ * Identified by the axis id, and data index.
779
+ */
780
+ tooltipAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
781
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
782
+ dataIndex: _propTypes.default.number.isRequired
783
+ })),
767
784
  /**
768
785
  * The tooltip item.
769
786
  * Used when the tooltip is controlled.
@@ -771,7 +788,7 @@ process.env.NODE_ENV !== "production" ? ChartsContainer.propTypes = {
771
788
  tooltipItem: _propTypes.default.shape({
772
789
  dataIndex: _propTypes.default.number,
773
790
  seriesId: _propTypes.default.string.isRequired,
774
- type: _propTypes.default.oneOf(['bar', 'line', 'pie', 'radar', 'scatter']).isRequired
791
+ type: _propTypes.default.oneOf(['bar', 'line', 'pie', 'radar', 'scatter'])
775
792
  }),
776
793
  /**
777
794
  * Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
@@ -1,4 +1,3 @@
1
- import type * as React from 'react';
2
1
  import { type ChartsSurfaceProps } from "../ChartsSurface/index.js";
3
2
  import { type ChartDataProviderProps } from "../ChartDataProvider/index.js";
4
3
  import type { ChartsContainerProps } from "./ChartsContainer.js";
@@ -7,9 +6,7 @@ import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
7
6
  import { type ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
8
7
  export type UseChartsContainerPropsReturnValue<TSeries extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]> = {
9
8
  chartDataProviderProps: ChartDataProviderProps<TSeries, TSignatures>;
10
- chartsSurfaceProps: ChartsSurfaceProps & {
11
- ref: React.Ref<SVGSVGElement>;
12
- };
9
+ chartsSurfaceProps: ChartsSurfaceProps;
13
10
  children: React.ReactNode;
14
11
  };
15
- export declare const useChartsContainerProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartsContainerProps<TSeries, TSignatures>, ref: React.Ref<SVGSVGElement>) => UseChartsContainerPropsReturnValue<TSeries, TSignatures>;
12
+ export declare const useChartsContainerProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartsContainerProps<TSeries, TSignatures>) => UseChartsContainerPropsReturnValue<TSeries, TSignatures>;
@@ -9,8 +9,8 @@ exports.useChartsContainerProps = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
  var _allPlugins = require("../internals/plugins/allPlugins");
12
- const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "highlightedAxis", "onHighlightedAxisChange", "tooltipItem", "onTooltipItemChange", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "axesGap", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps", "experimentalFeatures", "enableKeyboardNavigation", "brushConfig", "onHiddenItemsChange", "hiddenItems", "initialHiddenItems"];
13
- const useChartsContainerProps = (props, ref) => {
12
+ const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "highlightedAxis", "onHighlightedAxisChange", "tooltipAxis", "onTooltipAxisChange", "tooltipItem", "onTooltipItemChange", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "axesGap", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps", "experimentalFeatures", "enableKeyboardNavigation", "brushConfig", "onHiddenItemsChange", "hiddenItems", "initialHiddenItems"];
13
+ const useChartsContainerProps = props => {
14
14
  const _ref = props,
15
15
  {
16
16
  width,
@@ -24,6 +24,8 @@ const useChartsContainerProps = (props, ref) => {
24
24
  onAxisClick,
25
25
  highlightedAxis,
26
26
  onHighlightedAxisChange,
27
+ tooltipAxis,
28
+ onTooltipAxisChange,
27
29
  tooltipItem,
28
30
  onTooltipItemChange,
29
31
  disableVoronoi,
@@ -57,8 +59,7 @@ const useChartsContainerProps = (props, ref) => {
57
59
  const chartsSurfaceProps = (0, _extends2.default)({
58
60
  title,
59
61
  desc,
60
- sx,
61
- ref
62
+ sx
62
63
  }, other);
63
64
  const chartDataProviderProps = {
64
65
  margin,
@@ -71,6 +72,8 @@ const useChartsContainerProps = (props, ref) => {
71
72
  onAxisClick,
72
73
  highlightedAxis,
73
74
  onHighlightedAxisChange,
75
+ tooltipAxis,
76
+ onTooltipAxisChange,
74
77
  tooltipItem,
75
78
  onTooltipItemChange,
76
79
  disableVoronoi,
@@ -92,7 +92,6 @@ const ChartsLegend = exports.ChartsLegend = (0, _consumeSlots.consumeSlots)('Mui
92
92
  } = props,
93
93
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
94
94
  const isButton = Boolean(onItemClick || toggleVisibilityOnClick);
95
- const Element = isButton ? 'button' : 'div';
96
95
  const handleClick = (0, _useEventCallback.default)((item, i) => event => {
97
96
  if (onItemClick && item) {
98
97
  onItemClick(event, (0, _onClickContextBuilder.seriesContextBuilder)(item), i);
@@ -123,13 +122,20 @@ const ChartsLegend = exports.ChartsLegend = (0, _consumeSlots.consumeSlots)('Mui
123
122
  className: classes?.item,
124
123
  "data-series": item.seriesId,
125
124
  "data-index": item.dataIndex,
126
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Element, {
125
+ children: isButton ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
126
+ className: (0, _clsx.default)(classes?.series, !isVisible && classes?.hidden),
127
+ onClick: handleClick(item, i),
128
+ type: "button",
129
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLabelMark.ChartsLabelMark, {
130
+ className: classes?.mark,
131
+ color: item.color,
132
+ type: item.markType
133
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLabel.ChartsLabel, {
134
+ className: classes?.label,
135
+ children: item.label
136
+ })]
137
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
127
138
  className: (0, _clsx.default)(classes?.series, !isVisible && classes?.hidden),
128
- role: isButton ? 'button' : undefined,
129
- type: isButton ? 'button' : undefined
130
- // @ts-expect-error onClick is only attached to a button
131
- ,
132
- onClick: isButton ? handleClick(item, i) : undefined,
133
139
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLabelMark.ChartsLabelMark, {
134
140
  className: classes?.mark,
135
141
  color: item.color,
@@ -19,6 +19,17 @@ export interface LegendItemParams extends Partial<Omit<SeriesLegendItemContext,
19
19
  type: ChartSeriesType;
20
20
  markType: ChartsLabelMarkProps['type'];
21
21
  }
22
+ export interface SeriesLegendItemParams extends Partial<Omit<SeriesLegendItemContext, 'type' | keyof LegendItemContextBase>>, LegendItemContextBase {
23
+ /**
24
+ * The identifier of the series
25
+ */
26
+ seriesId: SeriesId;
27
+ /**
28
+ * The type of the series
29
+ */
30
+ type: ChartSeriesType;
31
+ markType: ChartsLabelMarkProps['type'];
32
+ }
22
33
  export interface SeriesLegendItemContext extends LegendItemContextBase {
23
34
  /**
24
35
  * The type of the legend item
@@ -6,25 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.ChartsLoadingOverlay = ChartsLoadingOverlay;
9
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
- var _styles = require("@mui/material/styles");
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
11
  var _useDrawingArea = require("../hooks/useDrawingArea");
13
12
  var _useChartsLocalization = require("../hooks/useChartsLocalization");
13
+ var _common = require("./common");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
  const _excluded = ["message"];
16
- const StyledText = (0, _styles.styled)('text', {
17
- slot: 'internal',
18
- shouldForwardProp: undefined
19
- })(({
20
- theme
21
- }) => (0, _extends2.default)({}, theme.typography.body2, {
22
- stroke: 'none',
23
- fill: (theme.vars || theme).palette.text.primary,
24
- shapeRendering: 'crispEdges',
25
- textAnchor: 'middle',
26
- dominantBaseline: 'middle'
27
- }));
28
16
  function ChartsLoadingOverlay(props) {
29
17
  const {
30
18
  message
@@ -39,7 +27,7 @@ function ChartsLoadingOverlay(props) {
39
27
  const {
40
28
  localeText
41
29
  } = (0, _useChartsLocalization.useChartsLocalization)();
42
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledText, (0, _extends2.default)({
30
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.StyledText, (0, _extends2.default)({
43
31
  x: left + width / 2,
44
32
  y: top + height / 2
45
33
  }, other, {
@@ -6,25 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.ChartsNoDataOverlay = ChartsNoDataOverlay;
9
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
- var _styles = require("@mui/material/styles");
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
11
  var _useDrawingArea = require("../hooks/useDrawingArea");
13
12
  var _useChartsLocalization = require("../hooks/useChartsLocalization");
13
+ var _common = require("./common");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
  const _excluded = ["message"];
16
- const StyledText = (0, _styles.styled)('text', {
17
- slot: 'internal',
18
- shouldForwardProp: undefined
19
- })(({
20
- theme
21
- }) => (0, _extends2.default)({}, theme.typography.body2, {
22
- stroke: 'none',
23
- fill: (theme.vars || theme).palette.text.primary,
24
- shapeRendering: 'crispEdges',
25
- textAnchor: 'middle',
26
- dominantBaseline: 'middle'
27
- }));
28
16
  function ChartsNoDataOverlay(props) {
29
17
  const {
30
18
  message
@@ -39,7 +27,7 @@ function ChartsNoDataOverlay(props) {
39
27
  const {
40
28
  localeText
41
29
  } = (0, _useChartsLocalization.useChartsLocalization)();
42
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledText, (0, _extends2.default)({
30
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.StyledText, (0, _extends2.default)({
43
31
  x: left + width / 2,
44
32
  y: top + height / 2
45
33
  }, other, {
@@ -0,0 +1 @@
1
+ export declare const StyledText: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").SVGTextElementAttributes<SVGTextElement>, keyof import("react").SVGTextElementAttributes<SVGTextElement>>, {}>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.StyledText = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _styles = require("@mui/material/styles");
11
+ const StyledText = exports.StyledText = (0, _styles.styled)('text', {
12
+ slot: 'internal',
13
+ shouldForwardProp: undefined
14
+ })(({
15
+ theme
16
+ }) => (0, _extends2.default)({}, theme.typography.body2, {
17
+ stroke: 'none',
18
+ fill: (theme.vars || theme).palette.text.primary,
19
+ shapeRendering: 'crispEdges',
20
+ textAnchor: 'middle',
21
+ dominantBaseline: 'middle'
22
+ }));
@@ -88,7 +88,7 @@ const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(func
88
88
  width: propsWidth,
89
89
  height: propsHeight
90
90
  },
91
- viewBox: `${0} ${0} ${svgWidth} ${svgHeight}`,
91
+ viewBox: `0 0 ${svgWidth} ${svgHeight}`,
92
92
  className: (0, _clsx.default)(classes.root, className),
93
93
  tabIndex: isKeyboardNavigationEnabled ? 0 : undefined
94
94
  }, other, {
@@ -1,15 +1,16 @@
1
1
  import { type ChartsTooltipProps } from "./ChartsTooltip.js";
2
- export interface ChartsTooltipSlots {
2
+ import { type TriggerOptions } from "./utils.js";
3
+ export interface ChartsTooltipSlots<T extends TriggerOptions = TriggerOptions> {
3
4
  /**
4
5
  * Custom component for the tooltip popper.
5
6
  * @default ChartsTooltipRoot
6
7
  */
7
- tooltip?: React.ElementType<ChartsTooltipProps>;
8
+ tooltip?: React.ElementType<ChartsTooltipProps<T>>;
8
9
  }
9
- export interface ChartsTooltipSlotProps {
10
+ export interface ChartsTooltipSlotProps<T extends TriggerOptions = TriggerOptions> {
10
11
  /**
11
12
  * Custom component for the tooltip popper.
12
13
  * @default ChartsTooltipRoot
13
14
  */
14
- tooltip?: Partial<ChartsTooltipProps>;
15
+ tooltip?: Partial<ChartsTooltipProps<T>>;
15
16
  }
@@ -7,6 +7,12 @@ export interface ChartsAxisTooltipContentProps {
7
7
  */
8
8
  classes?: Partial<ChartsTooltipClasses>;
9
9
  sx?: SxProps<Theme>;
10
+ /**
11
+ * The sort in which series items are displayed in the tooltip.
12
+ * When set to `none`, series are sorted as they are provided in the series property. Otherwise they are sorted by their value.
13
+ * @default 'none'
14
+ */
15
+ sort?: 'none' | 'asc' | 'desc';
10
16
  }
11
17
  declare function ChartsAxisTooltipContent(props: ChartsAxisTooltipContentProps): import("react/jsx-runtime").JSX.Element | null;
12
18
  declare namespace ChartsAxisTooltipContent {