import { default as React, ReactNode } from 'react'; import { CategoryPalette } from '../utils/categoryPalette'; import { CategoryDef } from '../types'; export interface CategoryContextValue { /** Palette instance built from the provided categories. */ palette: CategoryPalette; /** All registered category definitions. */ categories: CategoryDef[]; /** * Human-readable label for the grouping dimension. * Defaults to `"Categories"`. Components that support a label override * (e.g. Timeline's `teamLabel`) should fall back to this when no * explicit prop is provided. */ categoryLabel: string; } export interface CategoryProviderProps { /** Category definitions — each must have `id`, `label`, and `color`. */ categories: CategoryDef[]; /** * Display label for the grouping dimension, e.g. `"Teams"`, `"Squads"`, * `"Subsystems"`. Defaults to `"Categories"`. */ categoryLabel?: string; /** * Optional custom fallback palette for auto-assigned unknown ids. * Defaults to the Astro data-viz palette built into `CategoryPalette`. */ fallbackPalette?: string[]; children: ReactNode; } /** * Provides a shared `CategoryPalette` to descendant components. * * Wrap a dashboard section (not the entire app) so sibling components * like Timeline + Map + Charts resolve the same colors for the same ids. */ export declare function CategoryProvider({ categories, categoryLabel, fallbackPalette, children, }: CategoryProviderProps): React.ReactElement; /** * Access the nearest `CategoryProvider`'s palette and label. * * Returns `null` when no provider is present — components should treat * this as "standalone mode" and fall back to explicit props / defaults. */ export declare function useCategoryPalette(): CategoryContextValue | null; /** * Like `useCategoryPalette()` but throws if no provider is found. * Use only when you know a provider is always present. */ export declare function useCategoryPaletteRequired(): CategoryContextValue;