import { FunnelProps, FunnelChart as RechartsFunnelChart, TooltipProps } from 'recharts'; import { BoxProps, ElementProps, Factory, MantineColor, StylesApiProps } from '@mantine/core'; import { ChartTooltipStylesNames } from '../ChartTooltip/ChartTooltip'; export interface FunnelChartCell { key?: string | number; name: string; value: number; color: MantineColor; } export type FunnelChartStylesNames = 'root' | ChartTooltipStylesNames; export type FunnelChartCssVariables = { root: '--chart-stroke-color' | '--chart-labels-color' | '--chart-size'; }; export interface FunnelChartProps extends BoxProps, StylesApiProps, ElementProps<'div'> { /** Data used to render chart */ data: FunnelChartCell[]; /** Determines whether the tooltip should be displayed when a section is hovered @default `true` */ withTooltip?: boolean; /** Tooltip animation duration in ms @default `0` */ tooltipAnimationDuration?: number; /** Props passed down to `Tooltip` recharts component */ tooltipProps?: Omit, 'ref'>; /** Props passed down to recharts `Pie` component */ funnelProps?: Partial>; /** Controls color of the segments stroke, by default depends on color scheme */ strokeColor?: MantineColor; /** Controls text color of all labels @default `'white'` */ labelColor?: MantineColor; /** Controls chart width and height @default `300` */ size?: number; /** Controls width of segments stroke @default `1` */ strokeWidth?: number; /** Determines whether each segment should have associated label @default `false` */ withLabels?: boolean; /** Controls labels position relative to the segment @default `'right'` */ labelsPosition?: 'right' | 'left' | 'inside'; /** A function to format values inside the tooltip and labels */ valueFormatter?: (value: number) => string; /** Determines which data is displayed in the tooltip. `'all'` – display all values, `'segment'` – display only hovered segment. @default `'all'` */ tooltipDataSource?: 'segment' | 'all'; /** Additional elements rendered inside `FunnelChart` component */ children?: React.ReactNode; /** Props passed down to recharts `FunnelChart` component */ funnelChartProps?: React.ComponentPropsWithoutRef; } export type FunnelChartFactory = Factory<{ props: FunnelChartProps; ref: HTMLDivElement; stylesNames: FunnelChartStylesNames; vars: FunnelChartCssVariables; }>; export declare const FunnelChart: import("@mantine/core").MantineComponent<{ props: FunnelChartProps; ref: HTMLDivElement; stylesNames: FunnelChartStylesNames; vars: FunnelChartCssVariables; }>;