Def
import { SPACE_DEFAULTS } from '@hanzo/ui/blocks'
No examples yet.
Types
export interface Block {blockType: string}
export interface ElementBlock extends Block {blockType: 'element'element: ReactNode}
export interface HeadingBlock extends Block {blockType: 'heading'heading: stringbyline?: stringlevel?: numberbylineLevel?: numberspaceBetween?: numberspaceAfter?: number}
export interface EnhHeadingBlock extends Block {blockType: 'enh-heading'specifiers?: string/** A node, or a url string to an asset. */icon?: ReactNode/** Sizes the icon when it is given as a url. */iconSize?: numberpreheading?: { text: string; level?: number; mb?: number }heading: { text: string; level?: number; mb?: number }byline?: { text: string; level?: number }}
export interface ImageBlock extends Block, ImageDef {blockType: 'image'/*** `left` (default) / `right` / `center` (needs a column parent).* `mobile-no-scale` — by default an image scales to 3/4 height below `md`.* `mobile-full-width` — overrides dim and fills the width, keeping the ratio.*/specifiers?: string/** @deprecated Use `mobile-full-width` in specifiers. */fullWidthOnMobile?: booleanprops?: {sizes?: string/** When true, alignment specifiers are ignored. */fill?: booleanstyle?: React.CSSProperties}}
export interface VideoBlock extends VideoDef {blockType: 'video'}
export type SpaceUnit = number
export type HeadingLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6
export interface SpaceBlock extends Block {blockType: 'space'/*** Vertical space in spacing units, per rung and merged over SPACE_DEFAULTS —* or one number to use at every rung.*/sizes?: { [k in Breakpoint]?: SpaceUnit } | SpaceUnit/*** The space the matching heading tag WOULD occupy, as `<ApplyTypography>`* renders it, plus any gap. 0 is 1rem. Default 3.*/level?: HeadingLeveltest?: boolean}
export interface GroupBlock extends Block {blockType: 'group'specifiers?: stringelements: Block[]}
export interface GridBlock extends Block {blockType: 'grid'specifiers?: stringgrid: GridDef/** Ignored when children are passed to the component instead. */cells?: Block[]}
export interface AccordianBlock extends Block {blockType: 'accordian'items: { trigger: string; content: ReactNode }[]}
export interface BulletCardsBlock extends Block {blockType: 'bullet-cards'/** `no-card-border` · `mobile-small-text` · `borders-muted-1|3` (default 2). */specifiers?: stringgrid: GridDefcards: BulletItem[]/** In px. */iconSize?: number}
export interface CTABlock extends Block {blockType: 'cta'specifiers?: stringelements: (LinkDef | ButtonDef)[]}
export interface CardBlock extends Block {blockType: 'card'/** e.g. `media-left`, `appear-disabled`, `no-borders` — combinable. */specifiers?: stringtitle?: stringbyline?: string/** For the title area. */icon?: ReactNodeiconAfter?: booleanmedia?: ImageBlock | VideoBlockcontent?: ReactNodecta?: CTABlock}
export interface CarteBlancheBlock extends Block {blockType: 'carte-blanche'specifiers?: stringtopContent?: Block[]heading?: EnhHeadingBlockcontent?: Block[]cta?: CTABlock}
export interface ScreenfulBlock extends Block {blockType: 'screenful'/** An image url, or a video. */banner?: string | VideoBlock/** Layout hints for the block as a whole. */specifiers?: string/** Layout hints for the matching column. */columnSpecifiers?: string[]/*** The order columns appear in once stacked on a phone, overriding their* written order — e.g. `[1, 0, 2]` puts the second of three on top.*/mobileOrder?: number[]/** Content per column. More than three is allowed but rarely readable. */contentColumns: Block[][]footer?: ReactNode/** For linking to this screenful. */anchorId?: string}
Exports
SPACE_DEFAULTStype Blocktype ElementBlocktype HeadingBlocktype EnhHeadingBlocktype ImageBlocktype VideoBlocktype SpaceUnittype HeadingLeveltype SpaceBlocktype GroupBlocktype GridBlocktype AccordianBlocktype BulletCardsBlocktype CTABlocktype CardBlocktype CarteBlancheBlocktype ScreenfulBlock