import { f as ResolverContext } from './loadPage-DP3nrHBi.js';
import './Layout-UXGjXv8M.js';
import { T as Theme, H as HydratedTheme, E as ExpandedPalette } from './types-CVykEqXN.js';
import './schema-Z6-afHJG.js';
import { a as ThemeTokens, T as TransformRegistry } from './core-DsNWrl3o.js';
import { M as Media, T as TipTapNode } from './richTextSchema-DURiozvD.js';
import { z } from 'zod';
import * as React from 'react';
import React__default from 'react';
import * as react_jsx_runtime from 'react/jsx-runtime';

type SystemBlockComponentProps<TContent = Record<string, unknown>> = {
    content: TContent;
    theme?: ThemeTokens;
    themeConfig?: Theme;
    registry?: ResolverContext["registry"];
    transforms?: TransformRegistry;
    viewModelOverrides?: Record<string, unknown>;
    data?: Record<string, unknown>;
    pathBase?: string;
    blockId?: string | null;
    blockKind?: string;
    blockBindings?: Record<string, unknown>;
    fragmentRegistry?: ResolverContext["fragmentRegistry"];
};

/**
 * Gradient configuration types and schemas
 */

/**
 * Gradient configuration
 */
declare const gradientConfigSchema: z.ZodObject<{
    type: z.ZodEnum<{
        linear: "linear";
        radial: "radial";
    }>;
    angle: z.ZodOptional<z.ZodNumber>;
    position: z.ZodOptional<z.ZodString>;
    stops: z.ZodArray<z.ZodObject<{
        color: z.ZodString;
        position: z.ZodNumber;
    }, z.core.$strip>>;
}, z.core.$strip>;
type GradientConfig = z.infer<typeof gradientConfigSchema>;

type HeroCta = {
    label: string;
    href: string;
    variant?: 'primary' | 'secondary' | 'outline';
    iconLeft?: Media | null;
    iconRight?: Media | null;
};
type HeroCtaInput = Partial<HeroCta>;
type HeroContent = {
    eyebrow?: string;
    headline: string;
    subheadline?: string;
    _sectionStyles?: {
        background?: {
            type: 'color' | 'gradient' | 'image';
            color?: string | null;
            gradient?: GradientConfig | null;
            image?: HeroMedia | null;
            textColor?: string | null;
        } | null;
        spacing?: string | null;
    } | null;
    ctas?: HeroCtaInput[];
};
type HeroMedia = Media;

type BodyTextAlignment = "left" | "center";
type BodyTextContent = {
    heading?: string | null;
    body: TipTapNode;
    alignment?: BodyTextAlignment | null;
};

type ThemeCssVars = Record<string, string | number>;
type ThemeRuntime = {
    hydrated: HydratedTheme;
    cssVars: ThemeCssVars;
    tokens: ThemeTokens;
    paletteTokens: ExpandedPalette;
    buttonCss?: string;
    headerCss?: string;
    footerCss?: string;
    cardCss?: string;
    accordionCss?: string;
    inputCss?: string;
    layoutCss?: string;
    statusCss?: string;
    progressCss?: string;
    typographyCss?: string;
};
declare function buildThemeRuntime(theme: Theme, options?: {
    themeId?: string;
}): ThemeRuntime;

declare function RichText$1({ as: Comp, className, doc, path }: RichTextPrimitiveProps): react_jsx_runtime.JSX.Element;

type RichTextPrimitiveProps = {
    as?: React__default.ElementType;
    className?: string;
    path?: string;
    doc?: TipTapNode | null;
    variant?: RichTextVariant;
    blockData?: Record<string, unknown> | null;
};
type RichTextVariant = "full" | "inline" | "limited" | "media";
declare const RichText: typeof RichText$1;

declare function resolveImageUrl(value: Media): string | undefined;

/**
 * Helper utilities for resolving background data in custom block components.
 *
 * These helpers allow custom block overrides to apply section backgrounds
 * (color, gradient, image) with full theme token support, matching the
 * behavior of the default declarative block system.
 */

/**
 * Raw background data from CMS content fields.
 * This is the shape of `_sectionStyles.background`, `_containerStyles.background`, etc.
 */
type BackgroundInput = {
    /** Color token name (e.g., "primary") or raw hex value */
    color?: string | null;
    /** CSS gradient string */
    gradient?: string | null;
    /** Background image media object */
    image?: Media | null;
    /** Image sizing mode: 'fill' (cover), 'fit' (contain), 'original', 'custom' */
    objectFit?: string | null;
    /** Image position: preset keyword or custom CSS value */
    position?: string | null;
    /** Image scale value (e.g., "150%", "200px") - only for 'custom'/'original' modes */
    scale?: string | null;
    /** Background opacity (0-100) */
    opacity?: number | null;
    /** Whether background should overflow container bounds */
    overflow?: boolean | null;
};
/**
 * Resolved background ready for rendering.
 * Token names are converted to actual hex values.
 */
type ResolvedBackground = {
    /** Resolved background color (hex value or null) */
    color: string | null;
    /** CSS gradient string */
    gradient: string | null;
    /** Opacity value (0-1) */
    opacity: number | null;
    /** Whether background should overflow */
    overflow: boolean;
    /** Resolved image data */
    image: {
        /** Image URL */
        url: string;
        /** Alt text */
        alt: string;
        /** Original width */
        width?: number;
        /** Original height */
        height?: number;
    } | null;
    /** Inline styles for the image element */
    imageStyle: React.CSSProperties;
    /** CSS classes for the image element */
    imageClassName: string;
};
/**
 * Resolves background data from CMS content to render-ready values.
 *
 * This helper converts raw background field data (with token names like "primary")
 * into resolved values (with actual hex colors from the theme palette).
 *
 * @param background - Raw background data from content (e.g., content._sectionStyles?.background)
 * @param theme - Theme tokens containing the palette for token resolution
 * @returns Resolved background with all values ready for rendering
 *
 * @example
 * ```tsx
 * import { resolveBackground } from '@riverbankcms/blocks';
 * // or from SDK: import { resolveBackground } from '@riverbankcms/sdk/rendering';
 *
 * function CustomBlock({ content, theme }: CustomBlockProps) {
 *   const bg = resolveBackground(content._sectionStyles?.background, theme);
 *
 *   return (
 *     <section
 *       className="relative"
 *       style={{ backgroundColor: bg.color ?? undefined }}
 *     >
 *       {bg.image && (
 *         <img
 *           src={bg.image.url}
 *           alt={bg.image.alt}
 *           className={bg.imageClassName}
 *           style={bg.imageStyle}
 *         />
 *       )}
 *       {content.heading}
 *     </section>
 *   );
 * }
 * ```
 */
declare function resolveBackground(background: BackgroundInput | null | undefined, theme?: ThemeTokens): ResolvedBackground;
type SectionBackgroundProps = {
    /** Raw background data from content (e.g., content._sectionStyles?.background) */
    background: BackgroundInput | null | undefined;
    /** Theme tokens for resolving color tokens to hex values */
    theme?: ThemeTokens;
    /**
     * Additional className applied to background layers.
     *
     * **Note**: This className is applied to BOTH the color/gradient layer AND the
     * image layer when both exist. If you need different classes for each layer,
     * use the `resolveBackground()` helper directly for more control.
     */
    className?: string;
};
/**
 * Renders a complete background layer (color, gradient, and/or image).
 *
 * This component handles all the complexity of rendering backgrounds from
 * CMS content, including theme token resolution, image positioning, and opacity.
 *
 * Use this component in custom block overrides to easily apply section backgrounds.
 *
 * @example
 * ```tsx
 * import { SectionBackground } from '@riverbankcms/blocks';
 * // or from SDK: import { SectionBackground } from '@riverbankcms/sdk/rendering';
 *
 * function CustomBlock({ content, theme }: CustomBlockProps) {
 *   return (
 *     <section className="relative py-16">
 *       <SectionBackground
 *         background={content._sectionStyles?.background}
 *         theme={theme}
 *       />
 *       <div className="container mx-auto relative z-10">
 *         {content.heading}
 *       </div>
 *     </section>
 *   );
 * }
 * ```
 */
declare function SectionBackground({ background, theme, className, }: SectionBackgroundProps): React.ReactElement | null;

export { type BodyTextContent as B, type GradientConfig as G, type HeroContent as H, RichText as R, type SystemBlockComponentProps as S, type HeroMedia as a, buildThemeRuntime as b, type RichTextPrimitiveProps as c, resolveBackground as d, SectionBackground as e, type BackgroundInput as f, type ResolvedBackground as g, type SectionBackgroundProps as h, resolveImageUrl as r };
