import { type CSSProperties, type HTMLAttributes, type ImgHTMLAttributes, type ReactNode } from 'react';
import { type CssLength } from '../../../utils/css';
export type MagazinePageView = 'grid' | 'list';
export type MagazinePageImage = {
src: string;
alt?: string;
caption?: ReactNode;
srcSet?: string;
sizes?: string;
objectPosition?: string;
loading?: ImgHTMLAttributes['loading'];
fetchPriority?: ImgHTMLAttributes['fetchPriority'];
frameSrc?: string;
framePosition?: string;
frameSize?: string;
};
export type MagazinePageTag = {
id?: string | number;
label: ReactNode;
featured?: boolean;
};
export type MagazinePageMeta = {
avatar?: ReactNode;
byline?: ReactNode;
date?: ReactNode;
tags?: readonly (MagazinePageTag | string)[];
};
export type MagazinePageCover = {
headline: ReactNode;
subhead: ReactNode;
image: MagazinePageImage;
meta?: MagazinePageMeta;
};
type MagazinePageBlockBase = {
id?: string | number;
className?: string;
};
export type MagazinePageParagraphBlock = MagazinePageBlockBase & {
type: 'paragraph';
content: ReactNode;
strongFirstLine?: boolean;
};
export type MagazinePageHeadingBlock = MagazinePageBlockBase & {
type: 'heading';
content: ReactNode;
level?: 2 | 3;
align?: 'left' | 'center';
};
export type MagazinePageImageBlock = MagazinePageBlockBase & {
type: 'image';
image: MagazinePageImage;
framed?: boolean;
bleed?: boolean;
};
export type MagazinePageAsideBlock = MagazinePageBlockBase & {
type: 'aside';
content: ReactNode;
};
export type MagazinePageColumnsBlock = MagazinePageBlockBase & {
type: 'columns';
columns?: 1 | 2;
blocks: readonly MagazinePageBlock[];
};
export type MagazinePageSplitBlock = MagazinePageBlockBase & {
type: 'split';
left: readonly MagazinePageBlock[];
right: readonly MagazinePageBlock[];
align?: 'start' | 'center' | 'end' | 'stretch';
};
export type MagazinePageGroupBlock = MagazinePageBlockBase & {
type: 'group';
blocks: readonly MagazinePageBlock[];
};
export type MagazinePageBlock = MagazinePageAsideBlock | MagazinePageColumnsBlock | MagazinePageGroupBlock | MagazinePageHeadingBlock | MagazinePageImageBlock | MagazinePageParagraphBlock | MagazinePageSplitBlock;
export type MagazinePageContentLayout = 'feature' | 'text' | 'wide-image' | 'title-split' | 'double-feature' | 'finale' | 'copy';
export type MagazinePageDefinition = {
id?: string | number;
type: 'cover';
cover: MagazinePageCover;
preview?: boolean;
hiddenInList?: boolean;
className?: string;
style?: CSSProperties;
} | {
id?: string | number;
type: 'content';
layout?: MagazinePageContentLayout;
blocks: readonly MagazinePageBlock[];
ariaLabel?: string;
hiddenInList?: boolean;
className?: string;
style?: CSSProperties;
};
export type MagazinePageProps = Omit, 'children' | 'onChange'> & {
ariaLabel?: string;
pages?: readonly MagazinePageDefinition[];
view?: MagazinePageView;
defaultView?: MagazinePageView;
onViewChange?: (view: MagazinePageView) => void;
showViewControls?: boolean;
gridViewLabel?: string;
listViewLabel?: string;
boardWidth?: CssLength;
boardHeight?: CssLength;
gap?: CssLength;
primaryColor?: string;
backgroundColor?: string;
paperColor?: string;
textColor?: string;
mutedColor?: string;
};
export declare const MagazinePage: ({ className, style, ariaLabel, pages, view, defaultView, onViewChange, showViewControls, gridViewLabel, listViewLabel, boardWidth, boardHeight, gap, primaryColor, backgroundColor, paperColor, textColor, mutedColor, ...props }: MagazinePageProps) => import("react/jsx-runtime").JSX.Element;
export {};