import { JSX } from 'react/jsx-runtime';

declare const APPEARANCE_SPEC_VERSION: 1;

declare type AppearanceColorToken = 'background' | 'foreground' | 'muted' | 'mutedForeground' | 'border' | 'input' | 'primary' | 'primaryForeground' | 'accent' | 'accentForeground' | 'card' | 'cardForeground' | 'positive' | 'negative' | 'warning' | 'info' | 'destructive' | 'destructiveForeground';

declare type AppearanceColorTokens = Partial<Record<AppearanceColorToken, string>>;

declare type AppearanceColorTokens_2 = NonNullable<AppearanceTokens_2['color']>;

declare type AppearanceComponents = NonNullable<AppearanceScheme_2['components']>;

declare type AppearanceDensity = 'compact' | 'comfortable' | 'spacious';

declare type AppearanceDensity_2 = 'compact' | 'comfortable' | 'spacious';

declare type AppearanceMode = 'light' | 'dark' | 'system';

declare type AppearanceMode_2 = 'light' | 'dark' | 'system';

declare type AppearanceScheme = {
    tokens?: AppearanceTokens;
    components?: {
        dashboard?: BaseSurfaceAppearance;
        card?: BaseSurfaceAppearance;
        interactive?: InteractiveSurfaceAppearance;
        chart?: ChartAppearance;
        table?: TableAppearance;
        pivotTable?: TableAppearance;
        aggregateTable?: TableAppearance;
        pagination?: BaseSurfaceAppearance;
    };
};

declare type AppearanceScheme_2 = NonNullable<NonNullable<AppearanceSpec['schemes']>[AppearanceSchemeName]>;

declare type AppearanceSchemeName = 'light' | 'dark';

declare type AppearanceSpec = {
    version: typeof APPEARANCE_SPEC_VERSION;
    mode?: AppearanceMode;
    schemes?: {
        light?: AppearanceScheme;
        dark?: AppearanceScheme;
    };
};

declare type AppearanceTable = NonNullable<AppearanceComponents['table']>;

declare type AppearanceTokens = {
    color?: AppearanceColorTokens;
    typography?: {
        fontFamily?: string;
        headingFontFamily?: string;
        monoFontFamily?: string;
        baseFontSize?: number;
        density?: AppearanceDensity;
    };
    radius?: {
        control?: number;
        card?: number;
        table?: number;
        badge?: number;
    };
    spacing?: {
        dashboardPadding?: number;
        gridGap?: number;
        cardPadding?: number;
        controlGap?: number;
        tableCellX?: number;
        tableCellY?: number;
    };
    shadow?: {
        card?: string;
        popover?: string;
        focusRing?: string;
    };
};

declare type AppearanceTokens_2 = NonNullable<AppearanceScheme_2['tokens']>;

export declare function applyBrandStudioPreset(draft: BrandStudioDraft, presetId: string): BrandStudioDraft;

declare type BaseSurfaceAppearance = {
    background?: string;
    foreground?: string;
    borderColor?: string;
    borderRadius?: number;
    shadow?: string;
    padding?: number;
};

export declare const BRAND_STUDIO_PRESETS: BrandStudioPreset[];

export declare type BrandStudioDraft = {
    version: typeof APPEARANCE_SPEC_VERSION;
    mode: AppearanceMode_2;
    schemes: {
        light: RequiredBrandStudioScheme;
        dark: RequiredBrandStudioScheme;
    };
};

export declare function BrandStudioEditor({ appearance, previewTitle, isLoading, isSaving, error, className, onDraftChange, onSave, onClearConfig, onCancel, }: BrandStudioEditorProps): JSX.Element;

export declare type BrandStudioEditorProps = {
    appearance?: AppearanceSpec | null;
    previewTitle?: string;
    isLoading?: boolean;
    isSaving?: boolean;
    error?: string | null;
    className?: string;
    onDraftChange?: (appearance: AppearanceSpec) => void;
    onSave?: (appearance: AppearanceSpec) => void | Promise<void>;
    onClearConfig?: () => void | Promise<void>;
    onCancel?: () => void;
};

declare type BrandStudioPreset = {
    id: string;
    name: string;
    description: string;
    primary: string;
    accent: string;
    light: PresetScheme;
    dark: PresetScheme;
};

export declare function buildAppearanceSpecFromDraft(draft: BrandStudioDraft): AppearanceSpec;

declare type ChartAppearance = {
    palette?: string[];
    background?: string;
    foreground?: string;
    gridColor?: string;
    axisColor?: string;
};

export declare function createBrandStudioDraft(appearance?: AppearanceSpec | null): BrandStudioDraft;

declare type InteractiveSurfaceAppearance = BaseSurfaceAppearance & {
    toolbarBackground?: string;
};

export declare function mirrorTableAppearance(scheme: RequiredBrandStudioScheme, target: 'aggregateTable' | 'pivotTable'): void;

declare type PresetScheme = {
    background: string;
    foreground: string;
    muted: string;
    mutedForeground: string;
    border: string;
    primary: string;
    primaryForeground: string;
    accent: string;
    accentForeground: string;
    card: string;
    cardForeground: string;
    chartPalette: string[];
};

declare type RequiredAppearanceTokens = {
    color: Required<AppearanceColorTokens_2>;
    typography: Required<NonNullable<AppearanceTokens_2['typography']>>;
    radius: Required<NonNullable<AppearanceTokens_2['radius']>>;
    spacing: Required<NonNullable<AppearanceTokens_2['spacing']>>;
    shadow: Required<NonNullable<AppearanceTokens_2['shadow']>>;
};

declare type RequiredBrandStudioComponents = {
    dashboard: NonNullable<AppearanceComponents['dashboard']>;
    card: NonNullable<AppearanceComponents['card']>;
    interactive: NonNullable<AppearanceComponents['interactive']>;
    chart: Required<NonNullable<AppearanceComponents['chart']>>;
    table: RequiredTableAppearance;
    aggregateTable: RequiredTableAppearance;
    pivotTable: RequiredTableAppearance;
    pagination: NonNullable<AppearanceComponents['pagination']>;
};

export declare type RequiredBrandStudioScheme = {
    tokens: RequiredAppearanceTokens;
    components: RequiredBrandStudioComponents;
};

declare type RequiredTableAppearance = {
    density: AppearanceDensity_2;
    container: NonNullable<AppearanceTable['container']>;
    header: Required<NonNullable<AppearanceTable['header']>>;
    row: Required<NonNullable<AppearanceTable['row']>>;
    cell: Required<NonNullable<AppearanceTable['cell']>>;
    subtotal: Required<NonNullable<AppearanceTable['subtotal']>>;
    grandTotal: Required<NonNullable<AppearanceTable['grandTotal']>>;
    pagination: Required<NonNullable<AppearanceTable['pagination']>>;
};

declare type TableAppearance = {
    density?: AppearanceDensity;
    container?: {
        background?: string;
        borderColor?: string;
        borderRadius?: number;
        shadow?: string;
    };
    header?: {
        background?: string;
        foreground?: string;
        dividerColor?: string;
        fontWeight?: number;
        uppercase?: boolean;
        sticky?: boolean;
    };
    row?: {
        height?: number;
        dividerColor?: string;
        zebra?: boolean;
        zebraBackground?: string;
        hoverBackground?: string;
        selectedBackground?: string;
    };
    cell?: {
        paddingX?: number;
        paddingY?: number;
        verticalAlign?: 'top' | 'middle' | 'bottom';
        wrap?: 'wrap' | 'nowrap';
    };
    subtotal?: {
        background?: string;
        foreground?: string;
        fontWeight?: number;
    };
    grandTotal?: {
        background?: string;
        foreground?: string;
        fontWeight?: number;
        borderColor?: string;
    };
    pagination?: {
        background?: string;
        foreground?: string;
        borderColor?: string;
    };
};

export { }
