export interface ThemeColors { /** Action color for buttons, links, and active states. @defaultValue `#1355ff` */ action?: string; /** Hover color for action elements. @defaultValue `#0f44cc` */ actionHover?: string; /** Text color shown on action-colored elements. @defaultValue `#ffffff` */ actionText?: string; /** Shared background for UI surfaces such as panels, cards, and dropdowns. @defaultValue `#ffffff` */ bg?: string; /** Background for hovered controls. @defaultValue `#dbdbdb` */ hoverBg?: string; /** Background for active and pressed controls. @defaultValue `#c8d0d8` */ activeBg?: string; /** Background for disabled controls. @defaultValue `#f5f5f5` */ disabledBg?: string; /** Primary UI text color. @defaultValue `#47484a` */ text?: string; /** Secondary UI text color. @defaultValue `#666666` */ textMuted?: string; /** Text color for disabled controls. @defaultValue `#ababab` */ textDisabled?: string; /** Shared UI border color. @defaultValue `#dbdbdb` */ border?: string; } /** SuperDoc CSS variable overrides applied after the semantic theme values. */ export type ThemeVariableOverrides = { readonly [name: `--sd-${string}`]: string | null | undefined; }; export interface ThemeConfig { /** Name used in the generated class, such as `product` for `sd-theme-product`. */ name?: string; /** * Font family for SuperDoc UI surfaces that inherit the theme, such as body-mounted dialogs * and floating surfaces. The Editor root and the external toolbar set `--sd-ui-font-family` * inline from `uiDisplayFallbackFont`, and an inline declaration outranks the theme class — * set `uiDisplayFallbackFont` to the same value to change those surfaces too. */ font?: string; /** Shared UI border radius, such as `8px`. */ radius?: string; /** Shared UI box shadow. */ shadow?: string; /** Semantic colors shared by SuperDoc UI components. */ colors?: ThemeColors; /** Component-specific overrides, such as `{ '--sd-ui-toolbar-bg': '#f8fafc' }`. */ vars?: ThemeVariableOverrides; } /** CSS generated by {@link buildTheme}. */ export interface ThemeResult { /** Class that activates the generated theme. */ className: string; /** CSS rule containing the generated SuperDoc variables. */ css: string; } /** * Create a SuperDoc theme from a config object. * * Returns a CSS class name. Apply it to `` to activate the theme. * The style element is injected into the document automatically. * * For strict CSP environments that require a nonce, use {@link buildTheme} instead * and inject the CSS yourself with the appropriate nonce attribute. * * @example * ```ts * import { createTheme } from 'superdoc'; * * const theme = createTheme({ * colors: { action: '#6366f1', bg: '#ffffff', text: '#1e293b' }, * font: 'Inter, sans-serif', * vars: { '--sd-ui-toolbar-bg': '#f8fafc' }, * }); * * document.documentElement.classList.add(theme); * ``` */ export declare function createTheme(config: ThemeConfig): string; /** * Build a SuperDoc theme and return both the class name and raw CSS. * This function does not access the DOM. Use it for server rendering or when * your application controls style injection, such as with a CSP nonce. * * @example * ```ts * import { buildTheme } from 'superdoc'; * * const { className, css } = buildTheme({ * colors: { action: '#6366f1', bg: '#ffffff', text: '#1e293b' }, * }); * * const html = `
...`; * ``` */ export declare function buildTheme(config: ThemeConfig): ThemeResult;