@totalsoft/rocket-ui
Version:
A set of reusable and composable React components built on top of Material UI core for developing fast and friendly web applications interfaces.
27 lines (26 loc) • 874 B
TypeScript
import { SvgIconComponent } from '@mui/icons-material';
import { BarChartProps, GaugeContainerProps, LineChartProps, PieChartProps, ScatterChartProps } from '@mui/x-charts';
import { Color } from 'components/types';
export type ChartType = 'line' | 'bar' | 'pie' | 'scatter' | 'gauge';
export type ChartProps = ({
type: 'line';
} & LineChartProps) | ({
type: 'bar';
} & BarChartProps) | ({
type: 'pie';
} & PieChartProps) | ({
type: 'scatter';
} & ScatterChartProps) | ({
type: 'gauge';
} & GaugeContainerProps);
export type StatsChartProps = {
chartColor?: Color;
iconColor?: StatsIconColor;
title: string;
text: string;
StatIcon?: SvgIconComponent;
statText?: string;
statAction?: React.ReactNode;
chart: ChartProps;
};
export type StatsIconColor = Exclude<Color, 'default' | 'white' | 'transparent' | 'dark' | 'rose'>;