import React from 'react'; /** * Style configuration for chart axes (x, y, or radial). * Defines the visual appearance of axis lines, labels, ticks, and split lines. */ type AxisStyle = { /** Color of the main axis line */ lineColor: string; /** Width of the main axis line in pixels */ lineWidth: number; /** Color of the axis label text */ labelColor: string; /** Color of the tick marks */ tickColor: string; /** Width of the tick marks in pixels */ tickWidth: number; /** Color of the tick mark labels */ tickLabelColor: string; /** Color of the split lines (grid lines parallel to axis) */ splitLineColor: string; /** Width of the split lines in pixels */ splitLineWidth: number; }; /** * Style configuration for grid lines. * Defines the visual appearance of grid lines that help with data reading. */ type GridLineStyle = { /** Color of the grid lines */ lineColor: string; /** Width of the grid lines in pixels */ lineWidth: number; }; /** * Style configuration for tooltips. * Defines the visual appearance of tooltips that appear when hovering over chart elements. */ type TooltipStyle = { /** Background color of the tooltip */ backgroundColor: string; /** Color of the label text in the tooltip */ labelColor: string; /** Color of the value text in the tooltip */ valueColor: string; /** Color of the tooltip border */ borderColor: string; /** Width of the tooltip border in pixels */ borderWidth: number; /** Border radius of the tooltip corners in pixels */ borderRadius: number; /** Internal padding of the tooltip in pixels */ padding: number; }; /** * Style configuration for chart items (bars, lines, pie slices, etc.). * Defines the visual appearance of individual data elements in the chart. */ type Series = { /** Primary color for the data series */ color: string; /** Width of lines for line/area charts in pixels */ lineWidth?: number; /** Border radius for each corner [top-left, top-right, bottom-right, bottom-left] */ borderRadius?: number[]; /** Color of the border around chart items */ borderColor?: string; /** Width of the border around chart items in pixels */ borderWidth?: number; /** Style of the border: 'solid', 'dashed', or 'dotted' */ borderType?: 'solid' | 'dashed' | 'dotted'; }; /** * Style configuration for chart legends. * Defines the visual appearance of legends that identify data series in charts. */ type LegendStyle = { /** Color of the legend text */ textColor: string; /** Font size of the legend text in pixels */ fontSize: number; /** Color of the legend background */ backgroundColor: string; }; /** * Complete chart theme configuration. * Contains styling for all chart components: axes (x, y, radial), grid lines, tooltips, and item styles. * The series array provides a color palette that cycles through for multiple data series. */ export type ChartTheme = { /** Configuration for chart axes (x, y, and radial) */ axis: { /** X-axis styling configuration */ x: AxisStyle; /** Y-axis styling configuration */ y: AxisStyle; /** Radial axis styling configuration (for radar/polar charts) */ r: AxisStyle; }; /** Configuration for grid lines */ grid: { /** X-axis grid line styling */ x: GridLineStyle; /** Y-axis grid line styling */ y: GridLineStyle; /** Radial grid line styling (for radar/polar charts) */ r: GridLineStyle; }; legend: LegendStyle; /** Configuration for tooltip appearance */ tooltip: TooltipStyle; /** Array of series styles that cycle through for multiple data series */ series: Series[]; }; /** * Utility function to extend the default theme with custom overrides. * Useful for creating theme variants without using the React context system. * * @param theme - Partial theme configuration to merge with defaults * @returns A complete ChartTheme with defaults merged */ export declare const extendChartTheme: (...themes: Partial[]) => ChartTheme; /** * Default chart theme configuration. * Provides sensible defaults for all chart styling elements. * Uses a blue color palette for item styles that cycles through different shades. */ export declare const LIGHT_THEME: ChartTheme; export declare const DARK_THEME: ChartTheme; /** * Type definition for the chart theme context value. * Contains the current theme that can be accessed by chart components. */ interface ChartThemeContextType { /** The current chart theme configuration */ theme: ChartTheme; } /** * Hook to access and optionally extend the chart theme. * Merges the theme from context (if available) with any local theme overrides. * The local theme parameter takes precedence over the context theme. * * @param theme - Optional partial theme to merge with the context theme * @returns ChartThemeContextType with the merged theme * * @example * ```tsx * const { theme } = useChartTheme({ tooltip: { backgroundColor: '#000' } }); * ``` */ export declare const useChartTheme: (theme?: Partial, colors?: string[]) => ChartThemeContextType; /** * Props for the ChartThemeProvider component. */ interface ThemeProviderProps { /** Partial theme configuration to merge with parent theme or defaults */ theme: Partial; /** Child components that will have access to the theme */ children: React.ReactNode; } /** * Provider component that supplies chart theme configuration to child components. * Supports nested providers - child providers will merge their theme with the parent theme. * The parent theme serves as the base, and the current provider's theme overrides it. * * @example * ```tsx * * * * ``` */ export declare const ChartThemeProvider: React.FC; /** * Higher-order component (HOC) that wraps a component with ChartThemeProvider. * Allows passing a theme prop directly to a component, which will be applied * to that component and its children. * * @param Component - The component to wrap with theme provider * @returns A new component that accepts an optional theme prop * * @example * ```tsx * const ThemedChart = withChartTheme(MyChart); * * ``` */ export declare const withChartTheme: >(Component: T) => (props: React.ComponentProps & { theme?: Partial; }) => React.JSX.Element; export {}; //# sourceMappingURL=chart-theme.context.d.ts.map