Files
fn-design-system/components/chart_container.tsx
T
Egutierrez 5a824c2eee initial: mirror of @fn_library from fn_registry
75 components + DESIGN_SYSTEM.md + sync script.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 19:06:49 +02:00

34 lines
1.1 KiB
TypeScript

import { Paper } from '@mantine/core'
export const defaultColors = ['#3b82f6', '#22c55e', '#f59e0b', '#8b5cf6', '#ec4899']
export interface Series {
key: string
name: string
color?: string
}
export function getSeriesColor(index: number, color?: string): string {
return color || defaultColors[index % defaultColors.length]!
}
interface ChartContainerProps {
children: React.ReactNode
height?: number | string
}
export function ChartContainer({ children, height = 300 }: ChartContainerProps) {
return (
<Paper p="md" style={{ height, minWidth: 100, minHeight: typeof height === 'number' ? Math.min(height, 100) : 100 }}>
{children}
</Paper>
)
}
/** @deprecated Mantine charts handle tooltips internally. Kept for index.ts compat. */
export function ChartTooltipContent() { return null }
/** @deprecated Mantine charts handle tooltips internally. Kept for index.ts compat. */
export function ChartTooltip() { return null }
/** @deprecated Mantine charts handle legends internally. Kept for index.ts compat. */
export function ChartLegend() { return null }