export const themeValues = ['auto', 'light', 'dark'];
export const buttonVariantValues = ['primary', 'secondary', 'tertiary', 'outline', 'ghost'];
export const iconPositionValues = ['before', 'after'];
export const stringField = (options = {}) => ({
    kind: 'string',
    ...options,
});
export const booleanField = (options = {}) => ({
    kind: 'boolean',
    ...options,
});
export const imageField = (options = {}) => ({
    kind: 'image',
    ...options,
});
export const enumField = (values, options = {}) => ({
    kind: 'enum',
    values,
    ...options,
});
export const arrayField = (items, options = {}) => ({
    kind: 'array',
    items,
    ...options,
});
export const objectField = (fields, options = {}) => ({
    kind: 'object',
    fields,
    ...options,
});
export const richTextField = (options = {}) => ({
    kind: 'richText',
    ...options,
});
export const atomicBlocksField = (options = {}) => ({
    kind: 'atomicBlocks',
    ...options,
});
export const classNameField = (options = {}) => ({
    kind: 'className',
    ...options,
});
export const componentClassNameField = (options = {}) => ({
    kind: 'componentClassName',
    ...options,
});
const themeFields = {
    theme: enumField(themeValues, { optional: true }),
    className: componentClassNameField({ optional: true }),
};
export const defaultAtomicBlockContracts = [
    {
        component: 'button',
        displayName: 'Button',
        description: 'Inline link styled as a button.',
        props: {
            label: stringField({ minLength: 1 }),
            href: stringField({ minLength: 1 }),
            variant: enumField(buttonVariantValues, { optional: true }),
            newWindow: booleanField({ optional: true }),
            icon: stringField({ optional: true }),
            iconPosition: enumField(iconPositionValues, { optional: true }),
            className: componentClassNameField({ optional: true }),
        },
    },
];
export const defaultBlockContracts = [
    {
        component: 'home_hero',
        displayName: 'Home Hero',
        description: 'Full-width hero section with headline, description, CTA, and image.',
        props: {
            eyebrow: stringField({ optional: true }),
            headline: stringField({ minLength: 1 }),
            description: stringField({ optional: true }),
            ctaLabel: stringField({ minLength: 1 }),
            ctaHref: stringField({ minLength: 1 }),
            image: imageField(),
        },
    },
    {
        component: 'container',
        displayName: 'Container',
        description: 'Themed section wrapper that renders a stack of atomic content blocks.',
        props: {
            ...themeFields,
            blocks: atomicBlocksField(),
        },
    },
    {
        component: 'ssr_probe',
        displayName: 'SSR Probe',
        description: 'Server-rendered proof section used by render/publish smoke tests.',
        props: {
            label: stringField({ optional: true }),
            message: stringField({ optional: true }),
            mode: stringField({ optional: true }),
        },
    },
];
export const blockContracts = defaultBlockContracts;
export const atomicBlockContracts = defaultAtomicBlockContracts;
export const supportedBlockComponents = defaultBlockContracts.map((block) => block.component);
export const supportedAtomicBlockComponents = defaultAtomicBlockContracts.map((block) => block.component);
