/** * components — pure factories returning an immutable `Node` (declarative * immediate mode, ADR-0002). No JSX, no classes, no hidden state. Painting each * type lives in the renderer. */ import type { Attr } from '../ansi/index.js'; import type { ColorRef } from '../frame/index.js'; import type { LayoutProps } from '../layout/index.js'; export interface Node { readonly type: string; readonly props: Readonly>; readonly children: readonly Node[]; readonly key?: string; } export interface TextStyle { readonly color?: ColorRef; readonly background?: ColorRef; readonly attrs?: Attr; readonly bold?: boolean; readonly dim?: boolean; readonly italic?: boolean; readonly underline?: boolean; readonly inverse?: boolean; readonly wrap?: boolean; readonly align?: 'left' | 'center' | 'right'; } export type BorderStyle = 'none' | 'single' | 'double' | 'round' | 'bold' | 'ascii'; export interface BoxProps extends LayoutProps { readonly border?: BorderStyle; readonly borderColor?: ColorRef; readonly title?: string; readonly background?: ColorRef; } export interface PanelProps extends BoxProps { readonly footer?: string; } export interface CardProps extends BoxProps { readonly subtitle?: string; } export interface SeparatorProps { readonly orientation?: 'horizontal' | 'vertical'; readonly char?: string; readonly color?: ColorRef; readonly label?: string; } export interface HeaderProps { readonly title: string; readonly subtitle?: string; readonly badge?: string; readonly align?: 'left' | 'center' | 'right'; } export interface FooterProps { readonly items: readonly string[]; readonly color?: ColorRef; } export interface EmptyStateProps { readonly icon?: string; readonly title: string; readonly description?: string; readonly hint?: string; } export interface BannerProps { readonly lines: readonly string[]; readonly colors?: readonly string[]; readonly align?: 'left' | 'center'; } export interface GradientTextProps { readonly content: string; readonly colors?: readonly string[]; readonly align?: 'left' | 'center' | 'right'; readonly bold?: boolean; } export interface SpinnerProps { readonly variant?: 'dots' | 'line' | 'arc' | 'bounce'; readonly label?: string; readonly color?: ColorRef; readonly frame?: number; readonly glyph?: string; readonly key?: string; } export interface ProgressProps { readonly value: number; readonly width?: number; readonly label?: string; readonly showPercent?: boolean; readonly color?: ColorRef; } export type StatusKind = 'ok' | 'warn' | 'error' | 'info' | 'pending'; export interface BadgeProps { readonly text: string; readonly kind?: StatusKind; readonly color?: ColorRef; } export interface StatusProps { readonly kind: StatusKind; readonly label: string; } export interface LogEntry { readonly level?: 'debug' | 'info' | 'warn' | 'error'; readonly text: string; } export interface LogsProps { readonly source: readonly LogEntry[] | readonly string[]; readonly max?: number; readonly follow?: boolean; } export interface TreeNodeData { readonly label: string; readonly children?: readonly TreeNodeData[]; readonly expanded?: boolean; } export interface TreeProps { readonly root: TreeNodeData; readonly indent?: number; } export interface TableColumn { readonly header: string; readonly width?: number; readonly align?: 'left' | 'center' | 'right'; } export interface TableProps { readonly columns: readonly TableColumn[]; readonly rows: readonly (readonly string[])[]; readonly border?: BorderStyle; } export interface ListProps { readonly items: readonly string[]; readonly bullet?: string; readonly ordered?: boolean; } export interface InputProps { readonly key: string; readonly value: string; readonly placeholder?: string; readonly label?: string; readonly onChange?: (value: string) => void; readonly onSubmit?: (value: string) => void; } export interface PasswordProps extends InputProps { readonly mask?: string; } export interface SelectOption { readonly label: string; readonly value: string; readonly disabled?: boolean; } export interface SelectProps { readonly key: string; readonly options: readonly SelectOption[]; readonly value?: string; readonly label?: string; readonly onChange?: (value: string) => void; } export interface ConfirmProps { readonly key: string; readonly message: string; readonly value?: boolean; readonly onChange?: (value: boolean) => void; } export interface CheckboxProps { readonly key: string; readonly label: string; readonly checked: boolean; readonly onChange?: (checked: boolean) => void; } export interface TextareaProps { readonly key: string; readonly value: string; readonly rows?: number; readonly placeholder?: string; readonly onChange?: (value: string) => void; } export declare function text(content: string, style?: TextStyle): Node; export declare function box(props?: BoxProps, ...children: Node[]): Node; export declare function panel(props?: PanelProps, ...children: Node[]): Node; export declare function card(props?: CardProps, ...children: Node[]): Node; export declare function separator(props?: SeparatorProps): Node; export declare function header(props: HeaderProps): Node; export declare function footer(props: FooterProps): Node; export declare function emptyState(props: EmptyStateProps): Node; export declare function banner(props: BannerProps): Node; export declare function gradientText(content: string, colors?: readonly string[], opts?: { align?: 'left' | 'center' | 'right'; bold?: boolean; }): Node; export declare function stack(props?: LayoutProps, ...children: Node[]): Node; export declare function row(props?: LayoutProps, ...children: Node[]): Node; export declare function column(props?: LayoutProps, ...children: Node[]): Node; export declare function center(props?: LayoutProps, ...children: Node[]): Node; export declare function spacer(props?: { readonly flexGrow?: number; }): Node; export declare function grid(props?: LayoutProps & { readonly columns: number; }, ...children: Node[]): Node; export declare function spinner(props?: SpinnerProps): Node; export declare function progressBar(props: ProgressProps): Node; export declare function badge(props: BadgeProps): Node; export declare function status(props: StatusProps): Node; export declare function logs(props: LogsProps): Node; export declare function tree(props: TreeProps): Node; export declare function table(props: TableProps): Node; export declare function list(props: ListProps): Node; export declare function input(props: InputProps): Node; export declare function password(props: PasswordProps): Node; export declare function select(props: SelectProps): Node; export declare function confirm(props: ConfirmProps): Node; export declare function checkbox(props: CheckboxProps): Node; export declare function textarea(props: TextareaProps): Node; export declare function screen(...children: Node[]): Node; //# sourceMappingURL=index.d.ts.map