From d533964e284f1abf10255e1ff215d56673de1a94 Mon Sep 17 00:00:00 2001 From: Jose C Quintas Jr Date: Thu, 4 Apr 2024 16:53:40 +0200 Subject: [PATCH] [charts] Fix typescript error when using `sx` property on ChartsTooltip (#12659) --- packages/x-charts/src/ChartsTooltip/ChartsTooltip.tsx | 11 +++++++++-- scripts/x-charts.exports.json | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/x-charts/src/ChartsTooltip/ChartsTooltip.tsx b/packages/x-charts/src/ChartsTooltip/ChartsTooltip.tsx index 9af286fe77b62..937f3c79d542c 100644 --- a/packages/x-charts/src/ChartsTooltip/ChartsTooltip.tsx +++ b/packages/x-charts/src/ChartsTooltip/ChartsTooltip.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import composeClasses from '@mui/utils/composeClasses'; -import { styled, useThemeProps } from '@mui/material/styles'; -import { Popper, PopperProps } from '@mui/base/Popper'; +import { styled, useThemeProps, SxProps, Theme } from '@mui/material/styles'; +import { Popper, PopperProps as BasePopperProps } from '@mui/base/Popper'; import { NoSsr } from '@mui/base/NoSsr'; import { useSlotProps } from '@mui/base/utils'; import { @@ -21,6 +21,13 @@ import { ChartsItemContentProps, ChartsItemTooltipContent } from './ChartsItemTo import { ChartsAxisContentProps, ChartsAxisTooltipContent } from './ChartsAxisTooltipContent'; import { ChartsTooltipClasses, getChartsTooltipUtilityClass } from './chartsTooltipClasses'; +export type PopperProps = BasePopperProps & { + /** + * The system prop that allows defining system overrides as well as additional CSS styles. + */ + sx?: SxProps; +}; + export interface ChartsTooltipSlots { /** * Custom component for the tooltip popper. diff --git a/scripts/x-charts.exports.json b/scripts/x-charts.exports.json index 355468e12fa52..9e48f1f550495 100644 --- a/scripts/x-charts.exports.json +++ b/scripts/x-charts.exports.json @@ -227,6 +227,7 @@ { "name": "PiePlotSlots", "kind": "Interface" }, { "name": "PieSeriesType", "kind": "Interface" }, { "name": "PieValueType", "kind": "TypeAlias" }, + { "name": "PopperProps", "kind": "TypeAlias" }, { "name": "referenceLineClasses", "kind": "Variable" }, { "name": "ResponsiveChartContainer", "kind": "Variable" }, { "name": "ResponsiveChartContainerProps", "kind": "Interface" },