@mui/x-charts 8.0.0-alpha.0 → 8.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 (335) hide show
  1. package/BarChart/AnimatedBarElement.d.ts +15 -0
  2. package/BarChart/AnimatedBarElement.js +21 -0
  3. package/BarChart/BarChart.d.ts +4 -9
  4. package/BarChart/BarChart.js +3 -31
  5. package/BarChart/BarElement.d.ts +5 -1342
  6. package/BarChart/BarElement.js +10 -20
  7. package/BarChart/BarPlot.js +12 -2
  8. package/BarChart/useBarChartProps.d.ts +0 -2
  9. package/BarChart/useBarChartProps.js +2 -8
  10. package/CHANGELOG.md +429 -5
  11. package/ChartContainer/ChartContainer.d.ts +2 -19
  12. package/ChartContainer/ChartContainer.js +10 -20
  13. package/ChartContainer/ResizableContainer.d.ts +17 -4
  14. package/ChartContainer/ResizableContainer.js +36 -2
  15. package/ChartContainer/useChartContainerProps.d.ts +6 -7
  16. package/ChartContainer/useChartContainerProps.js +14 -28
  17. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -17
  18. package/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
  19. package/ChartsAxisHighlight/ChartsAxisHighlight.types.d.ts +5 -0
  20. package/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
  21. package/ChartsAxisHighlight/ChartsAxisHighlightPath.d.ts +6 -0
  22. package/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
  23. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +10 -0
  24. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
  25. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +10 -0
  26. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
  27. package/ChartsAxisHighlight/chartsAxisHighlightClasses.d.ts +7 -0
  28. package/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
  29. package/ChartsAxisHighlight/index.d.ts +3 -0
  30. package/ChartsAxisHighlight/index.js +4 -1
  31. package/ChartsGrid/ChartsGrid.js +1 -1
  32. package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -2
  33. package/ChartsGrid/ChartsHorizontalGrid.js +3 -3
  34. package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -2
  35. package/ChartsGrid/ChartsVerticalGrid.js +3 -3
  36. package/ChartsLegend/LegendPerItem.d.ts +2 -2
  37. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
  38. package/ChartsSurface/ChartsSurface.d.ts +0 -15
  39. package/ChartsSurface/ChartsSurface.js +35 -34
  40. package/ChartsTooltip/ChartTooltip.types.d.ts +15 -0
  41. package/ChartsTooltip/ChartTooltip.types.js +1 -0
  42. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +7 -39
  43. package/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
  44. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +5 -28
  45. package/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
  46. package/ChartsTooltip/ChartsTooltip.d.ts +3 -69
  47. package/ChartsTooltip/ChartsTooltip.js +161 -145
  48. package/ChartsTooltip/ChartsTooltipContainer.d.ts +33 -0
  49. package/ChartsTooltip/ChartsTooltipContainer.js +298 -0
  50. package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -0
  51. package/ChartsTooltip/chartsTooltipClasses.js +18 -2
  52. package/ChartsTooltip/index.d.ts +3 -3
  53. package/ChartsTooltip/index.js +2 -3
  54. package/ChartsTooltip/useAxisTooltip.d.ts +2 -2
  55. package/ChartsTooltip/useAxisTooltip.js +19 -19
  56. package/ChartsTooltip/useItemTooltip.d.ts +1 -1
  57. package/ChartsTooltip/useItemTooltip.js +5 -4
  58. package/ChartsTooltip/utils.d.ts +0 -3
  59. package/ChartsTooltip/utils.js +0 -8
  60. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +47 -34
  61. package/Gauge/Gauge.d.ts +1 -1
  62. package/Gauge/Gauge.js +0 -6
  63. package/Gauge/GaugeContainer.d.ts +3 -3
  64. package/Gauge/GaugeContainer.js +60 -61
  65. package/LineChart/AnimatedArea.d.ts +0 -1333
  66. package/LineChart/AnimatedArea.js +9 -18
  67. package/LineChart/AnimatedLine.d.ts +0 -1333
  68. package/LineChart/AnimatedLine.js +9 -20
  69. package/LineChart/AreaPlot.js +12 -2
  70. package/LineChart/CircleMarkElement.js +6 -5
  71. package/LineChart/LineChart.d.ts +4 -10
  72. package/LineChart/LineChart.js +3 -32
  73. package/LineChart/LineHighlightPlot.js +6 -5
  74. package/LineChart/LinePlot.js +12 -2
  75. package/LineChart/MarkElement.js +6 -5
  76. package/LineChart/useLineChartProps.d.ts +0 -2
  77. package/LineChart/useLineChartProps.js +2 -8
  78. package/PieChart/PieChart.d.ts +3 -9
  79. package/PieChart/PieChart.js +5 -37
  80. package/PieChart/PiePlot.js +2 -2
  81. package/PieChart/getPieCoordinates.d.ts +2 -2
  82. package/README.md +2 -2
  83. package/ScatterChart/Scatter.js +6 -5
  84. package/ScatterChart/ScatterChart.d.ts +4 -10
  85. package/ScatterChart/ScatterChart.js +5 -32
  86. package/ScatterChart/useScatterChartProps.d.ts +0 -2
  87. package/ScatterChart/useScatterChartProps.js +1 -9
  88. package/SparkLineChart/SparkLineChart.d.ts +3 -4
  89. package/SparkLineChart/SparkLineChart.js +4 -31
  90. package/context/ChartDataProvider/ChartDataProvider.d.ts +9 -19
  91. package/context/ChartDataProvider/ChartDataProvider.js +30 -43
  92. package/context/ChartDataProvider/useChartDataProviderProps.d.ts +7 -10
  93. package/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
  94. package/context/{DrawingProvider.d.ts → DrawingAreaProvider/DrawingArea.types.d.ts} +3 -14
  95. package/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
  96. package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +8 -0
  97. package/context/DrawingAreaProvider/DrawingAreaContext.js +16 -0
  98. package/context/DrawingAreaProvider/DrawingAreaProvider.d.ts +3 -0
  99. package/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
  100. package/context/DrawingAreaProvider/index.d.ts +3 -0
  101. package/context/DrawingAreaProvider/index.js +3 -0
  102. package/context/InteractionProvider.d.ts +5 -48
  103. package/context/InteractionProvider.js +8 -64
  104. package/context/InteractionSelectors.d.ts +359 -0
  105. package/context/InteractionSelectors.js +12 -0
  106. package/context/SizeProvider/Size.types.d.ts +30 -0
  107. package/context/SizeProvider/Size.types.js +1 -0
  108. package/context/SizeProvider/SizeContext.d.ts +4 -0
  109. package/context/SizeProvider/SizeContext.js +13 -0
  110. package/context/SizeProvider/SizeProvider.d.ts +11 -0
  111. package/context/SizeProvider/SizeProvider.js +26 -0
  112. package/context/SizeProvider/index.d.ts +4 -0
  113. package/context/SizeProvider/index.js +4 -0
  114. package/{ChartContainer → context/SizeProvider}/useChartContainerDimensions.d.ts +4 -1
  115. package/{modern/ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +11 -5
  116. package/context/SizeProvider/useSize.d.ts +5 -0
  117. package/context/SizeProvider/useSize.js +13 -0
  118. package/context/SvgRefProvider/SvgRef.types.d.ts +8 -0
  119. package/context/SvgRefProvider/SvgRef.types.js +1 -0
  120. package/context/SvgRefProvider/SvgRefContext.d.ts +4 -0
  121. package/context/SvgRefProvider/SvgRefContext.js +17 -0
  122. package/context/SvgRefProvider/SvgRefProvider.d.ts +3 -0
  123. package/context/SvgRefProvider/SvgRefProvider.js +24 -0
  124. package/context/SvgRefProvider/index.d.ts +4 -0
  125. package/context/SvgRefProvider/index.js +4 -0
  126. package/context/SvgRefProvider/useSurfaceRef.d.ts +2 -0
  127. package/context/SvgRefProvider/useSurfaceRef.js +14 -0
  128. package/context/index.d.ts +2 -0
  129. package/context/index.js +2 -1
  130. package/hooks/useAxisEvents.js +32 -19
  131. package/hooks/useChartId.js +2 -2
  132. package/hooks/useDrawingArea.d.ts +2 -2
  133. package/hooks/useDrawingArea.js +2 -2
  134. package/hooks/useInteractionItemProps.js +19 -12
  135. package/hooks/useSvgRef.js +3 -3
  136. package/index.js +1 -1
  137. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
  138. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
  139. package/internals/computeAxisValue.d.ts +2 -2
  140. package/internals/index.d.ts +3 -2
  141. package/internals/index.js +3 -2
  142. package/internals/plugins/models/index.d.ts +35 -0
  143. package/internals/plugins/models/index.js +1 -0
  144. package/internals/plugins/utils/ChartStore.d.ts +12 -0
  145. package/internals/plugins/utils/ChartStore.js +26 -0
  146. package/internals/plugins/utils/ChartsStore.d.ts +12 -0
  147. package/internals/plugins/utils/ChartsStore.js +26 -0
  148. package/internals/plugins/utils/selectors.d.ts +9 -0
  149. package/internals/plugins/utils/selectors.js +37 -0
  150. package/internals/useCharts.d.ts +6 -0
  151. package/internals/useCharts.js +29 -0
  152. package/internals/useSelector.d.ts +4 -0
  153. package/internals/useSelector.js +6 -0
  154. package/internals/useStore.d.ts +2 -0
  155. package/internals/useStore.js +17 -0
  156. package/modern/BarChart/AnimatedBarElement.js +21 -0
  157. package/modern/BarChart/BarChart.js +3 -31
  158. package/modern/BarChart/BarElement.js +10 -20
  159. package/modern/BarChart/BarPlot.js +12 -2
  160. package/modern/BarChart/useBarChartProps.js +2 -8
  161. package/modern/ChartContainer/ChartContainer.js +10 -20
  162. package/modern/ChartContainer/ResizableContainer.js +36 -2
  163. package/modern/ChartContainer/useChartContainerProps.js +14 -28
  164. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
  165. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
  166. package/modern/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
  167. package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
  168. package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
  169. package/modern/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
  170. package/modern/ChartsAxisHighlight/index.js +4 -1
  171. package/modern/ChartsGrid/ChartsGrid.js +1 -1
  172. package/modern/ChartsGrid/ChartsHorizontalGrid.js +3 -3
  173. package/modern/ChartsGrid/ChartsVerticalGrid.js +3 -3
  174. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
  175. package/modern/ChartsSurface/ChartsSurface.js +35 -34
  176. package/modern/ChartsTooltip/ChartTooltip.types.js +1 -0
  177. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
  178. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
  179. package/modern/ChartsTooltip/ChartsTooltip.js +161 -145
  180. package/modern/ChartsTooltip/ChartsTooltipContainer.js +298 -0
  181. package/modern/ChartsTooltip/chartsTooltipClasses.js +18 -2
  182. package/modern/ChartsTooltip/index.js +2 -3
  183. package/modern/ChartsTooltip/useAxisTooltip.js +19 -19
  184. package/modern/ChartsTooltip/useItemTooltip.js +5 -4
  185. package/modern/ChartsTooltip/utils.js +0 -8
  186. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +47 -34
  187. package/modern/Gauge/Gauge.js +0 -6
  188. package/modern/Gauge/GaugeContainer.js +60 -61
  189. package/modern/LineChart/AnimatedArea.js +9 -18
  190. package/modern/LineChart/AnimatedLine.js +9 -20
  191. package/modern/LineChart/AreaPlot.js +12 -2
  192. package/modern/LineChart/CircleMarkElement.js +6 -5
  193. package/modern/LineChart/LineChart.js +3 -32
  194. package/modern/LineChart/LineHighlightPlot.js +6 -5
  195. package/modern/LineChart/LinePlot.js +12 -2
  196. package/modern/LineChart/MarkElement.js +6 -5
  197. package/modern/LineChart/useLineChartProps.js +2 -8
  198. package/modern/PieChart/PieChart.js +5 -37
  199. package/modern/PieChart/PiePlot.js +2 -2
  200. package/modern/ScatterChart/Scatter.js +6 -5
  201. package/modern/ScatterChart/ScatterChart.js +5 -32
  202. package/modern/ScatterChart/useScatterChartProps.js +1 -9
  203. package/modern/SparkLineChart/SparkLineChart.js +4 -31
  204. package/modern/context/ChartDataProvider/ChartDataProvider.js +30 -43
  205. package/modern/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
  206. package/modern/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
  207. package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +16 -0
  208. package/modern/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
  209. package/modern/context/DrawingAreaProvider/index.js +3 -0
  210. package/modern/context/InteractionProvider.js +8 -64
  211. package/modern/context/InteractionSelectors.js +12 -0
  212. package/modern/context/SizeProvider/Size.types.js +1 -0
  213. package/modern/context/SizeProvider/SizeContext.js +13 -0
  214. package/modern/context/SizeProvider/SizeProvider.js +26 -0
  215. package/modern/context/SizeProvider/index.js +4 -0
  216. package/{ChartContainer → modern/context/SizeProvider}/useChartContainerDimensions.js +11 -5
  217. package/modern/context/SizeProvider/useSize.js +13 -0
  218. package/modern/context/SvgRefProvider/SvgRef.types.js +1 -0
  219. package/modern/context/SvgRefProvider/SvgRefContext.js +17 -0
  220. package/modern/context/SvgRefProvider/SvgRefProvider.js +24 -0
  221. package/modern/context/SvgRefProvider/index.js +4 -0
  222. package/modern/context/SvgRefProvider/useSurfaceRef.js +14 -0
  223. package/modern/context/index.js +2 -1
  224. package/modern/hooks/useAxisEvents.js +32 -19
  225. package/modern/hooks/useChartId.js +2 -2
  226. package/modern/hooks/useDrawingArea.js +2 -2
  227. package/modern/hooks/useInteractionItemProps.js +19 -12
  228. package/modern/hooks/useSvgRef.js +3 -3
  229. package/modern/index.js +1 -1
  230. package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
  231. package/modern/internals/index.js +3 -2
  232. package/modern/internals/plugins/models/index.js +1 -0
  233. package/modern/internals/plugins/utils/ChartStore.js +26 -0
  234. package/modern/internals/plugins/utils/ChartsStore.js +26 -0
  235. package/modern/internals/plugins/utils/selectors.js +37 -0
  236. package/modern/internals/useCharts.js +29 -0
  237. package/modern/internals/useSelector.js +6 -0
  238. package/modern/internals/useStore.js +17 -0
  239. package/node/BarChart/AnimatedBarElement.js +28 -0
  240. package/node/BarChart/BarChart.js +3 -31
  241. package/node/BarChart/BarElement.js +11 -21
  242. package/node/BarChart/BarPlot.js +11 -1
  243. package/node/BarChart/useBarChartProps.js +2 -8
  244. package/node/ChartContainer/ChartContainer.js +10 -20
  245. package/node/ChartContainer/ResizableContainer.js +39 -3
  246. package/node/ChartContainer/useChartContainerProps.js +14 -28
  247. package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +12 -100
  248. package/node/ChartsAxisHighlight/ChartsAxisHighlight.types.js +5 -0
  249. package/node/ChartsAxisHighlight/ChartsAxisHighlightPath.js +40 -0
  250. package/node/ChartsAxisHighlight/ChartsXAxisHighlight.js +57 -0
  251. package/node/ChartsAxisHighlight/ChartsYAxisHighlight.js +57 -0
  252. package/node/ChartsAxisHighlight/chartsAxisHighlightClasses.js +14 -0
  253. package/node/ChartsAxisHighlight/index.js +33 -0
  254. package/node/ChartsGrid/ChartsGrid.js +2 -2
  255. package/node/ChartsGrid/ChartsHorizontalGrid.js +4 -4
  256. package/node/ChartsGrid/ChartsVerticalGrid.js +4 -4
  257. package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
  258. package/node/ChartsSurface/ChartsSurface.js +35 -34
  259. package/node/ChartsTooltip/ChartTooltip.types.js +5 -0
  260. package/node/ChartsTooltip/ChartsAxisTooltipContent.js +83 -73
  261. package/node/ChartsTooltip/ChartsItemTooltipContent.js +54 -45
  262. package/node/ChartsTooltip/ChartsTooltip.js +160 -144
  263. package/node/ChartsTooltip/ChartsTooltipContainer.js +304 -0
  264. package/node/ChartsTooltip/chartsTooltipClasses.js +22 -3
  265. package/node/ChartsTooltip/index.js +19 -28
  266. package/node/ChartsTooltip/useAxisTooltip.js +19 -19
  267. package/node/ChartsTooltip/useItemTooltip.js +5 -4
  268. package/node/ChartsTooltip/utils.js +0 -9
  269. package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +48 -35
  270. package/node/Gauge/Gauge.js +0 -6
  271. package/node/Gauge/GaugeContainer.js +60 -61
  272. package/node/LineChart/AnimatedArea.js +9 -19
  273. package/node/LineChart/AnimatedLine.js +9 -21
  274. package/node/LineChart/AreaPlot.js +11 -1
  275. package/node/LineChart/CircleMarkElement.js +6 -5
  276. package/node/LineChart/LineChart.js +3 -32
  277. package/node/LineChart/LineHighlightPlot.js +6 -5
  278. package/node/LineChart/LinePlot.js +11 -1
  279. package/node/LineChart/MarkElement.js +6 -5
  280. package/node/LineChart/useLineChartProps.js +2 -8
  281. package/node/PieChart/PieChart.js +5 -37
  282. package/node/PieChart/PiePlot.js +2 -2
  283. package/node/ScatterChart/Scatter.js +6 -5
  284. package/node/ScatterChart/ScatterChart.js +5 -32
  285. package/node/ScatterChart/useScatterChartProps.js +1 -9
  286. package/node/SparkLineChart/SparkLineChart.js +4 -31
  287. package/node/context/ChartDataProvider/ChartDataProvider.js +30 -43
  288. package/node/context/ChartDataProvider/useChartDataProviderProps.js +22 -44
  289. package/node/context/DrawingAreaProvider/DrawingArea.types.js +5 -0
  290. package/node/context/DrawingAreaProvider/DrawingAreaContext.js +22 -0
  291. package/node/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +12 -44
  292. package/node/context/DrawingAreaProvider/index.js +38 -0
  293. package/node/context/InteractionProvider.js +9 -66
  294. package/node/context/InteractionSelectors.js +18 -0
  295. package/node/context/SizeProvider/Size.types.js +5 -0
  296. package/node/context/SizeProvider/SizeContext.js +20 -0
  297. package/node/context/SizeProvider/SizeProvider.js +29 -0
  298. package/node/context/SizeProvider/index.js +49 -0
  299. package/node/{ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +11 -5
  300. package/node/context/SizeProvider/useSize.js +20 -0
  301. package/node/context/SvgRefProvider/SvgRef.types.js +5 -0
  302. package/node/context/SvgRefProvider/SvgRefContext.js +23 -0
  303. package/node/context/SvgRefProvider/SvgRefProvider.js +31 -0
  304. package/node/context/SvgRefProvider/index.js +49 -0
  305. package/node/context/SvgRefProvider/useSurfaceRef.js +20 -0
  306. package/node/context/index.js +10 -2
  307. package/node/hooks/useAxisEvents.js +33 -19
  308. package/node/hooks/useChartId.js +2 -2
  309. package/node/hooks/useDrawingArea.js +2 -2
  310. package/node/hooks/useInteractionItemProps.js +20 -13
  311. package/node/hooks/useSvgRef.js +3 -3
  312. package/node/index.js +1 -1
  313. package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
  314. package/node/internals/index.js +28 -16
  315. package/node/internals/plugins/models/index.js +5 -0
  316. package/node/internals/plugins/utils/ChartStore.js +33 -0
  317. package/node/internals/plugins/utils/ChartsStore.js +33 -0
  318. package/node/internals/plugins/utils/selectors.js +44 -0
  319. package/node/internals/useCharts.js +36 -0
  320. package/node/internals/useSelector.js +13 -0
  321. package/node/internals/useStore.js +24 -0
  322. package/package.json +7 -5
  323. package/themeAugmentation/props.d.ts +1 -2
  324. package/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +0 -7
  325. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
  326. package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +0 -8
  327. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
  328. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
  329. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
  330. package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -129
  331. package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -98
  332. /package/ChartsGrid/{styledCommonents.d.ts → styledComponents.d.ts} +0 -0
  333. /package/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
  334. /package/modern/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
  335. /package/node/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
@@ -1,80 +1,91 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
1
+ 'use client';
2
+
2
3
  import * as React from 'react';
3
- import useSlotProps from '@mui/utils/useSlotProps';
4
- import { useCartesianContext } from "../context/CartesianProvider/index.js";
5
- import { DefaultChartsAxisTooltipContent } from "./DefaultChartsAxisTooltipContent.js";
6
- import { ZAxisContext } from "../context/ZAxisContextProvider.js";
7
- import { useColorProcessor } from "../context/PluginProvider/useColorProcessor.js";
8
- import { isCartesianSeriesType } from "../internals/isCartesian.js";
9
- import { useSeries } from "../hooks/useSeries.js";
10
- import { jsx as _jsx } from "react/jsx-runtime";
11
- /**
12
- * @ignore - internal component.
13
- */
4
+ import PropTypes from 'prop-types';
5
+ import Typography from '@mui/material/Typography';
6
+ import clsx from 'clsx';
7
+ import { useUtilityClasses } from "./chartsTooltipClasses.js";
8
+ import { ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow, ChartsTooltipTable } from "./ChartsTooltipTable.js";
9
+ import { useAxisTooltip } from "./useAxisTooltip.js";
10
+ import { useXAxis, useYAxis } from "../hooks/index.js";
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
12
  function ChartsAxisTooltipContent(props) {
15
13
  const {
16
- content,
17
- contentProps,
18
- axisData,
19
- sx,
20
- classes
14
+ classes: propClasses,
15
+ sx
21
16
  } = props;
22
- const isXaxis = axisData.x && axisData.x.index !== -1;
23
- const dataIndex = isXaxis ? axisData.x && axisData.x.index : axisData.y && axisData.y.index;
24
- const axisValue = isXaxis ? axisData.x && axisData.x.value : axisData.y && axisData.y.value;
17
+ const tootlipData = useAxisTooltip();
18
+ const xAxis = useXAxis();
19
+ const yAxis = useYAxis();
20
+ const classes = useUtilityClasses(propClasses);
21
+ if (tootlipData === null) {
22
+ return null;
23
+ }
25
24
  const {
26
- xAxisIds,
27
- xAxis,
28
- yAxisIds,
29
- yAxis
30
- } = useCartesianContext();
31
- const {
32
- zAxisIds,
33
- zAxis
34
- } = React.useContext(ZAxisContext);
35
- const series = useSeries();
36
- const colorProcessors = useColorProcessor();
37
- const USED_AXIS_ID = isXaxis ? xAxisIds[0] : yAxisIds[0];
38
- const relevantSeries = React.useMemo(() => {
39
- const rep = [];
40
- Object.keys(series).filter(isCartesianSeriesType).forEach(seriesType => {
41
- series[seriesType].seriesOrder.forEach(seriesId => {
42
- const item = series[seriesType].series[seriesId];
43
- const providedXAxisId = item.xAxisId;
44
- const providedYAxisId = item.yAxisId;
45
- const axisKey = isXaxis ? providedXAxisId : providedYAxisId;
46
- if (axisKey === undefined || axisKey === USED_AXIS_ID) {
47
- const seriesToAdd = series[seriesType].series[seriesId];
48
- const xAxisId = providedXAxisId ?? xAxisIds[0];
49
- const yAxisId = providedYAxisId ?? yAxisIds[0];
50
- const zAxisId = seriesToAdd.zAxisId ?? zAxisIds[0];
51
- const getColor = colorProcessors[seriesType]?.(seriesToAdd, xAxis[xAxisId], yAxis[yAxisId], zAxisId && zAxis[zAxisId]) ?? (() => '');
52
- rep.push(_extends({}, seriesToAdd, {
53
- getColor
54
- }));
55
- }
56
- });
57
- });
58
- return rep;
59
- }, [USED_AXIS_ID, colorProcessors, isXaxis, series, xAxis, xAxisIds, yAxis, yAxisIds, zAxis, zAxisIds]);
60
- const relevantAxis = React.useMemo(() => {
61
- return isXaxis ? xAxis[USED_AXIS_ID] : yAxis[USED_AXIS_ID];
62
- }, [USED_AXIS_ID, isXaxis, xAxis, yAxis]);
63
- const Content = content ?? DefaultChartsAxisTooltipContent;
64
- const chartTooltipContentProps = useSlotProps({
65
- elementType: Content,
66
- externalSlotProps: contentProps,
67
- additionalProps: {
68
- axisData,
69
- series: relevantSeries,
70
- axis: relevantAxis,
71
- dataIndex,
72
- axisValue,
73
- sx,
74
- classes
75
- },
76
- ownerState: {}
25
+ axisDirection,
26
+ axisValue,
27
+ axisFormattedValue,
28
+ seriesItems
29
+ } = tootlipData;
30
+ const axis = axisDirection === 'x' ? xAxis : yAxis;
31
+ return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
32
+ sx: sx,
33
+ className: classes.paper,
34
+ children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
35
+ className: classes.table,
36
+ children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/_jsx("thead", {
37
+ children: /*#__PURE__*/_jsx(ChartsTooltipRow, {
38
+ children: /*#__PURE__*/_jsx(ChartsTooltipCell, {
39
+ colSpan: 3,
40
+ children: /*#__PURE__*/_jsx(Typography, {
41
+ children: axisFormattedValue
42
+ })
43
+ })
44
+ })
45
+ }), /*#__PURE__*/_jsx("tbody", {
46
+ children: seriesItems.map(({
47
+ seriesId,
48
+ color,
49
+ formattedValue,
50
+ formattedLabel
51
+ }) => {
52
+ if (formattedValue == null) {
53
+ return null;
54
+ }
55
+ return /*#__PURE__*/_jsxs(ChartsTooltipRow, {
56
+ className: classes.row,
57
+ children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
58
+ className: clsx(classes.markCell, classes.cell),
59
+ children: color && /*#__PURE__*/_jsx(ChartsTooltipMark, {
60
+ color: color,
61
+ className: classes.mark
62
+ })
63
+ }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
64
+ className: clsx(classes.labelCell, classes.cell),
65
+ children: formattedLabel ? /*#__PURE__*/_jsx(Typography, {
66
+ children: formattedLabel
67
+ }) : null
68
+ }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
69
+ className: clsx(classes.valueCell, classes.cell),
70
+ children: /*#__PURE__*/_jsx(Typography, {
71
+ children: formattedValue
72
+ })
73
+ })]
74
+ }, seriesId);
75
+ })
76
+ })]
77
+ })
77
78
  });
78
- return /*#__PURE__*/_jsx(Content, _extends({}, chartTooltipContentProps));
79
79
  }
80
+ process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
81
+ // ----------------------------- Warning --------------------------------
82
+ // | These PropTypes are generated from the TypeScript type definitions |
83
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
84
+ // ----------------------------------------------------------------------
85
+ /**
86
+ * Override or extend the styles applied to the component.
87
+ */
88
+ classes: PropTypes.object,
89
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
90
+ } : void 0;
80
91
  export { ChartsAxisTooltipContent };
@@ -1,52 +1,62 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
1
+ 'use client';
2
+
2
3
  import * as React from 'react';
3
- import useSlotProps from '@mui/utils/useSlotProps';
4
- import { DefaultChartsItemTooltipContent } from "./DefaultChartsItemTooltipContent.js";
5
- import { useCartesianContext } from "../context/CartesianProvider/index.js";
6
- import { ZAxisContext } from "../context/ZAxisContextProvider.js";
7
- import { useColorProcessor } from "../context/PluginProvider/useColorProcessor.js";
8
- import { useSeries } from "../hooks/useSeries.js";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- /**
11
- * @ignore - internal component.
12
- */
4
+ import PropTypes from 'prop-types';
5
+ import clsx from 'clsx';
6
+ import { useUtilityClasses } from "./chartsTooltipClasses.js";
7
+ import { useItemTooltip } from "./useItemTooltip.js";
8
+ import { ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow, ChartsTooltipTable } from "./ChartsTooltipTable.js";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
10
  function ChartsItemTooltipContent(props) {
14
11
  const {
15
- content,
16
- itemData,
17
- sx,
18
- classes,
19
- contentProps
12
+ classes: propClasses,
13
+ sx
20
14
  } = props;
21
- const series = useSeries()[itemData.type].series[itemData.seriesId];
15
+ const tooltipData = useItemTooltip();
16
+ const classes = useUtilityClasses(propClasses);
17
+ if (!tooltipData) {
18
+ return null;
19
+ }
22
20
  const {
23
- xAxis,
24
- yAxis,
25
- xAxisIds,
26
- yAxisIds
27
- } = useCartesianContext();
28
- const {
29
- zAxis,
30
- zAxisIds
31
- } = React.useContext(ZAxisContext);
32
- const colorProcessors = useColorProcessor();
33
- const xAxisId = series.xAxisId ?? xAxisIds[0];
34
- const yAxisId = series.yAxisId ?? yAxisIds[0];
35
- const zAxisId = series.zAxisId ?? zAxisIds[0];
36
- const getColor = colorProcessors[series.type]?.(series, xAxisId && xAxis[xAxisId], yAxisId && yAxis[yAxisId], zAxisId && zAxis[zAxisId]) ?? (() => '');
37
- const Content = content ?? DefaultChartsItemTooltipContent;
38
- const chartTooltipContentProps = useSlotProps({
39
- elementType: Content,
40
- externalSlotProps: contentProps,
41
- additionalProps: {
42
- itemData,
43
- series,
44
- sx,
45
- classes,
46
- getColor
47
- },
48
- ownerState: {}
21
+ color,
22
+ label,
23
+ formattedValue
24
+ } = tooltipData;
25
+ return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
26
+ sx: sx,
27
+ className: classes.paper,
28
+ children: /*#__PURE__*/_jsx(ChartsTooltipTable, {
29
+ className: classes.table,
30
+ children: /*#__PURE__*/_jsx("tbody", {
31
+ children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
32
+ className: classes.row,
33
+ children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
34
+ className: clsx(classes.markCell, classes.cell),
35
+ children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
36
+ color: color,
37
+ className: classes.mark
38
+ })
39
+ }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
40
+ className: clsx(classes.labelCell, classes.cell),
41
+ children: label
42
+ }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
43
+ className: clsx(classes.valueCell, classes.cell),
44
+ children: formattedValue
45
+ })]
46
+ })
47
+ })
48
+ })
49
49
  });
50
- return /*#__PURE__*/_jsx(Content, _extends({}, chartTooltipContentProps));
51
50
  }
51
+ process.env.NODE_ENV !== "production" ? ChartsItemTooltipContent.propTypes = {
52
+ // ----------------------------- Warning --------------------------------
53
+ // | These PropTypes are generated from the TypeScript type definitions |
54
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
55
+ // ----------------------------------------------------------------------
56
+ /**
57
+ * Override or extend the styles applied to the component.
58
+ */
59
+ classes: PropTypes.object,
60
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
61
+ } : void 0;
52
62
  export { ChartsItemTooltipContent };
@@ -3,47 +3,11 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import composeClasses from '@mui/utils/composeClasses';
7
- import useLazyRef from '@mui/utils/useLazyRef';
8
- import { styled, useThemeProps } from '@mui/material/styles';
9
- import Popper from '@mui/material/Popper';
10
- import NoSsr from '@mui/material/NoSsr';
11
- import useSlotProps from '@mui/utils/useSlotProps';
12
- import { InteractionContext } from "../context/InteractionProvider.js";
13
- import { useSvgRef } from "../hooks/useSvgRef.js";
14
- import { getTooltipHasData, usePointerType } from "./utils.js";
15
6
  import { ChartsItemTooltipContent } from "./ChartsItemTooltipContent.js";
16
7
  import { ChartsAxisTooltipContent } from "./ChartsAxisTooltipContent.js";
17
- import { getChartsTooltipUtilityClass } from "./chartsTooltipClasses.js";
8
+ import { ChartsTooltipContainer } from "./ChartsTooltipContainer.js";
9
+ import { useUtilityClasses } from "./chartsTooltipClasses.js";
18
10
  import { jsx as _jsx } from "react/jsx-runtime";
19
- const useUtilityClasses = ownerState => {
20
- const {
21
- classes
22
- } = ownerState;
23
- const slots = {
24
- root: ['root'],
25
- paper: ['paper'],
26
- table: ['table'],
27
- row: ['row'],
28
- cell: ['cell'],
29
- mark: ['mark'],
30
- markCell: ['markCell'],
31
- labelCell: ['labelCell'],
32
- valueCell: ['valueCell']
33
- };
34
- return composeClasses(slots, getChartsTooltipUtilityClass, classes);
35
- };
36
- const ChartsTooltipRoot = styled(Popper, {
37
- name: 'MuiChartsTooltip',
38
- slot: 'Root',
39
- overridesResolver: (_, styles) => styles.root
40
- })(({
41
- theme
42
- }) => ({
43
- pointerEvents: 'none',
44
- zIndex: theme.zIndex.modal
45
- }));
46
-
47
11
  /**
48
12
  * Demos:
49
13
  *
@@ -53,108 +17,20 @@ const ChartsTooltipRoot = styled(Popper, {
53
17
  *
54
18
  * - [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/)
55
19
  */
56
- function ChartsTooltip(inProps) {
57
- const props = useThemeProps({
58
- props: inProps,
59
- name: 'MuiChartsTooltip'
60
- });
20
+ function ChartsTooltip(props) {
61
21
  const {
62
- trigger = 'axis',
63
- itemContent,
64
- axisContent,
65
- slots,
66
- slotProps
22
+ classes: propClasses,
23
+ trigger = 'axis'
67
24
  } = props;
68
- const svgRef = useSvgRef();
69
- const pointerType = usePointerType();
70
- const popperRef = React.useRef(null);
71
- const positionRef = useLazyRef(() => ({
72
- x: 0,
73
- y: 0
25
+ const classes = useUtilityClasses(propClasses);
26
+ return /*#__PURE__*/_jsx(ChartsTooltipContainer, _extends({}, props, {
27
+ classes: classes,
28
+ children: trigger === 'axis' ? /*#__PURE__*/_jsx(ChartsAxisTooltipContent, {
29
+ classes: classes
30
+ }) : /*#__PURE__*/_jsx(ChartsItemTooltipContent, {
31
+ classes: classes
32
+ })
74
33
  }));
75
- const {
76
- item,
77
- axis
78
- } = React.useContext(InteractionContext);
79
- const displayedData = trigger === 'item' ? item : axis;
80
- const tooltipHasData = getTooltipHasData(trigger, displayedData);
81
- const popperOpen = pointerType !== null && tooltipHasData;
82
- const classes = useUtilityClasses({
83
- classes: props.classes
84
- });
85
- const PopperComponent = slots?.popper ?? ChartsTooltipRoot;
86
- const popperProps = useSlotProps({
87
- elementType: PopperComponent,
88
- externalSlotProps: slotProps?.popper,
89
- additionalProps: {
90
- open: popperOpen,
91
- placement: pointerType?.pointerType === 'mouse' ? 'right-start' : 'top',
92
- popperRef,
93
- anchorEl: {
94
- getBoundingClientRect: () => ({
95
- x: positionRef.current.x,
96
- y: positionRef.current.y,
97
- top: positionRef.current.y,
98
- left: positionRef.current.x,
99
- right: positionRef.current.x,
100
- bottom: positionRef.current.y,
101
- width: 0,
102
- height: 0,
103
- toJSON: () => ''
104
- })
105
- },
106
- modifiers: [{
107
- name: 'offset',
108
- options: {
109
- offset: [0, pointerType?.pointerType === 'touch' ? 40 - pointerType.height : 0]
110
- }
111
- }]
112
- },
113
- ownerState: {}
114
- });
115
- React.useEffect(() => {
116
- const element = svgRef.current;
117
- if (element === null) {
118
- return () => {};
119
- }
120
- const handleMove = event => {
121
- // eslint-disable-next-line react-compiler/react-compiler
122
- positionRef.current = {
123
- x: event.clientX,
124
- y: event.clientY
125
- };
126
- popperRef.current?.update();
127
- };
128
- element.addEventListener('pointermove', handleMove);
129
- return () => {
130
- element.removeEventListener('pointermove', handleMove);
131
- };
132
- }, [svgRef, positionRef]);
133
- if (trigger === 'none') {
134
- return null;
135
- }
136
- return /*#__PURE__*/_jsx(NoSsr, {
137
- children: popperOpen && /*#__PURE__*/_jsx(PopperComponent, _extends({}, popperProps, {
138
- className: classes.root,
139
- children: trigger === 'item' ? /*#__PURE__*/_jsx(ChartsItemTooltipContent, {
140
- itemData: displayedData,
141
- content: slots?.itemContent ?? itemContent,
142
- contentProps: slotProps?.itemContent,
143
- sx: {
144
- mx: 2
145
- },
146
- classes: classes
147
- }) : /*#__PURE__*/_jsx(ChartsAxisTooltipContent, {
148
- axisData: displayedData,
149
- content: slots?.axisContent ?? axisContent,
150
- contentProps: slotProps?.axisContent,
151
- sx: {
152
- mx: 2
153
- },
154
- classes: classes
155
- })
156
- }))
157
- });
158
34
  }
159
35
  process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
160
36
  // ----------------------------- Warning --------------------------------
@@ -162,29 +38,169 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
162
38
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
163
39
  // ----------------------------------------------------------------------
164
40
  /**
165
- * Component to override the tooltip content when trigger is set to 'axis'.
166
- * @deprecated Use slots.axisContent instead
41
+ * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
42
+ * or a function that returns either.
43
+ * It's used to set the position of the popper.
44
+ * The return value will passed as the reference object of the Popper instance.
167
45
  */
168
- axisContent: PropTypes.elementType,
46
+ anchorEl: PropTypes.oneOfType([(props, propName) => {
47
+ if (props[propName] == null) {
48
+ return new Error(`Prop '${propName}' is required but wasn't specified`);
49
+ }
50
+ if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
51
+ return new Error(`Expected prop '${propName}' to be of type Element`);
52
+ }
53
+ return null;
54
+ }, PropTypes.func, PropTypes.shape({
55
+ contextElement: (props, propName) => {
56
+ if (props[propName] == null) {
57
+ return null;
58
+ }
59
+ if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
60
+ return new Error(`Expected prop '${propName}' to be of type Element`);
61
+ }
62
+ return null;
63
+ },
64
+ getBoundingClientRect: PropTypes.func.isRequired
65
+ })]),
169
66
  /**
170
67
  * Override or extend the styles applied to the component.
171
68
  */
172
69
  classes: PropTypes.object,
173
70
  /**
174
- * Component to override the tooltip content when trigger is set to 'item'.
175
- * @deprecated Use slots.itemContent instead
71
+ * The component used for the root node.
72
+ * Either a string to use a HTML element or a component.
73
+ */
74
+ component: PropTypes.elementType,
75
+ /**
76
+ * The components used for each slot inside the Popper.
77
+ * Either a string to use a HTML element or a component.
78
+ * @default {}
79
+ */
80
+ components: PropTypes.shape({
81
+ Root: PropTypes.elementType
82
+ }),
83
+ /**
84
+ * The props used for each slot inside the Popper.
85
+ * @default {}
86
+ */
87
+ componentsProps: PropTypes.shape({
88
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
89
+ }),
90
+ /**
91
+ * An HTML element or function that returns one.
92
+ * The `container` will have the portal children appended to it.
93
+ *
94
+ * You can also provide a callback, which is called in a React layout effect.
95
+ * This lets you set the container from a ref, and also makes server-side rendering possible.
96
+ *
97
+ * By default, it uses the body of the top-level document object,
98
+ * so it's simply `document.body` most of the time.
99
+ */
100
+ container: PropTypes.oneOfType([(props, propName) => {
101
+ if (props[propName] == null) {
102
+ return new Error(`Prop '${propName}' is required but wasn't specified`);
103
+ }
104
+ if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
105
+ return new Error(`Expected prop '${propName}' to be of type Element`);
106
+ }
107
+ return null;
108
+ }, PropTypes.func]),
109
+ /**
110
+ * The `children` will be under the DOM hierarchy of the parent component.
111
+ * @default false
112
+ */
113
+ disablePortal: PropTypes.bool,
114
+ /**
115
+ * Always keep the children in the DOM.
116
+ * This prop can be useful in SEO situation or
117
+ * when you want to maximize the responsiveness of the Popper.
118
+ * @default false
119
+ */
120
+ keepMounted: PropTypes.bool,
121
+ /**
122
+ * Popper.js is based on a "plugin-like" architecture,
123
+ * most of its features are fully encapsulated "modifiers".
124
+ *
125
+ * A modifier is a function that is called each time Popper.js needs to
126
+ * compute the position of the popper.
127
+ * For this reason, modifiers should be very performant to avoid bottlenecks.
128
+ * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
129
+ */
130
+ modifiers: PropTypes.arrayOf(PropTypes.shape({
131
+ data: PropTypes.object,
132
+ effect: PropTypes.func,
133
+ enabled: PropTypes.bool,
134
+ fn: PropTypes.func,
135
+ name: PropTypes.any,
136
+ options: PropTypes.object,
137
+ phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
138
+ requires: PropTypes.arrayOf(PropTypes.string),
139
+ requiresIfExists: PropTypes.arrayOf(PropTypes.string)
140
+ })),
141
+ /**
142
+ * If `true`, the component is shown.
143
+ */
144
+ open: PropTypes.bool,
145
+ /**
146
+ * Popper placement.
147
+ * @default 'bottom'
148
+ */
149
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
150
+ /**
151
+ * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
152
+ * @default {}
153
+ */
154
+ popperOptions: PropTypes.shape({
155
+ modifiers: PropTypes.array,
156
+ onFirstUpdate: PropTypes.func,
157
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
158
+ strategy: PropTypes.oneOf(['absolute', 'fixed'])
159
+ }),
160
+ /**
161
+ * A ref that points to the used popper instance.
176
162
  */
177
- itemContent: PropTypes.elementType,
163
+ popperRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
164
+ current: PropTypes.shape({
165
+ destroy: PropTypes.func.isRequired,
166
+ forceUpdate: PropTypes.func.isRequired,
167
+ setOptions: PropTypes.func.isRequired,
168
+ state: PropTypes.shape({
169
+ attributes: PropTypes.object.isRequired,
170
+ elements: PropTypes.object.isRequired,
171
+ modifiersData: PropTypes.object.isRequired,
172
+ options: PropTypes.object.isRequired,
173
+ orderedModifiers: PropTypes.arrayOf(PropTypes.object).isRequired,
174
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']).isRequired,
175
+ rects: PropTypes.object.isRequired,
176
+ reset: PropTypes.bool.isRequired,
177
+ scrollParents: PropTypes.object.isRequired,
178
+ strategy: PropTypes.oneOf(['absolute', 'fixed']).isRequired,
179
+ styles: PropTypes.object.isRequired
180
+ }).isRequired,
181
+ update: PropTypes.func.isRequired
182
+ })
183
+ })]),
178
184
  /**
179
- * The props used for each component slot.
185
+ * The props used for each slot inside the Popper.
180
186
  * @default {}
181
187
  */
182
188
  slotProps: PropTypes.object,
183
189
  /**
184
- * Overridable component slots.
190
+ * The components used for each slot inside the Popper.
191
+ * Either a string to use a HTML element or a component.
185
192
  * @default {}
186
193
  */
187
194
  slots: PropTypes.object,
195
+ /**
196
+ * The system prop that allows defining system overrides as well as additional CSS styles.
197
+ */
198
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
199
+ /**
200
+ * Help supporting a react-transition-group/Transition component.
201
+ * @default false
202
+ */
203
+ transition: PropTypes.bool,
188
204
  /**
189
205
  * Select the kind of tooltip to display
190
206
  * - 'item': Shows data about the item below the mouse.