import { T as ThemeTokens } from './loadPage-BElEkA_J.js';
import './Layout-CHG77dhK.js';
import { T as Theme, H as HydratedTheme, e as ExpandedPalette } from './types-5XdVD2J1.js';
import './schema-Bpy9N5ZI.js';
import z, { z as z$1 } from 'zod';
import * as React from 'react';
import React__default from 'react';
import * as react_jsx_runtime from 'react/jsx-runtime';

declare const mediaSchema: z.ZodObject<{
    type: z.ZodEnum<{
        image: "image";
        video: "video";
    }>;
    purpose: z.ZodOptional<z.ZodString>;
    placeholder: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
    assetId: z.ZodOptional<z.ZodString>;
    src: z.ZodOptional<z.ZodString>;
    alt: z.ZodOptional<z.ZodString>;
    width: z.ZodOptional<z.ZodNumber>;
    height: z.ZodOptional<z.ZodNumber>;
    storageBucket: z.ZodOptional<z.ZodString>;
    storagePath: z.ZodOptional<z.ZodString>;
    transform: z.ZodOptional<z.ZodObject<{
        rect: z.ZodOptional<z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>>;
        hotspot: z.ZodOptional<z.ZodOptional<z.ZodObject<{
            x: z.ZodNumber;
            y: z.ZodNumber;
            radius: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>;
    }, z.core.$strip>>;
}, z.core.$strip>;
type Media = z.infer<typeof mediaSchema>;

/**
 * Gradient configuration types and schemas
 */

/**
 * Gradient configuration
 */
declare const gradientConfigSchema: z$1.ZodObject<{
    type: z$1.ZodEnum<{
        linear: "linear";
        radial: "radial";
    }>;
    angle: z$1.ZodOptional<z$1.ZodNumber>;
    position: z$1.ZodOptional<z$1.ZodString>;
    stops: z$1.ZodArray<z$1.ZodObject<{
        color: z$1.ZodString;
        position: z$1.ZodNumber;
    }, z$1.core.$strip>>;
}, z$1.core.$strip>;
type GradientConfig = z$1.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;

/**
 * Build Zod validation schema for rich text fields
 *
 * @param options - Optional configuration
 * @param options.required - If true, validates that content is not empty
 * @param options.label - Field label for error messages (defaults to 'This field')
 * @returns Zod schema for rich text validation
 *
 * @example
 * // Basic usage
 * const schema = buildRichTextSchema()
 *
 * @example
 * // Required field with custom label
 * const schema = buildRichTextSchema({ required: true, label: 'Description' })
 */
/**
 * TypeScript type for a TipTap document node
 *
 * Use this type for rich text content fields in block definitions.
 * Defined explicitly (rather than inferred) because recursive Zod schemas
 * require `z.ZodType<any>` which loses type information.
 */
type TipTapNode = {
    type: string;
    content?: TipTapNode[];
    text?: string;
    attrs?: Record<string, unknown>;
    marks?: Array<{
        type: string;
        attrs?: Record<string, unknown>;
    }>;
};

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;
    cardCss?: string;
    accordionCss?: string;
    inputCss?: string;
    layoutCss?: string;
    statusCss?: string;
    progressCss?: 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;

type ResolveImageUrlOptions = {
    /**
     * Preview API key for accessing unpublished images.
     * When provided, appended as ?preview_key=xxx to the image URL.
     */
    previewKey?: string | null;
};
declare function resolveImageUrl(value: Media, options?: ResolveImageUrlOptions): 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, type Media as M, RichText as R, SectionBackground as S, type TipTapNode as T, type HeroMedia as a, buildThemeRuntime as b, type RichTextPrimitiveProps as c, resolveBackground as d, type BackgroundInput as e, type ResolvedBackground as f, type SectionBackgroundProps as g, resolveImageUrl as r };
