import React from 'react'; import type { KanbanCard, KanbanColumn, KanbanMove, WipLimitBehavior } from './kanban.types'; export interface KanbanProps extends Omit, 'onSelect'> { columns: KanbanColumn[]; /** * Fires with the requested move. The board is controlled: apply it with * `applyMove` and hand the new columns back. */ onMove?: (move: KanbanMove) => void; /** Fires when a card is opened — click without a drag, or Enter on a resting card. */ onCardActivate?: (cardId: string, card: KanbanCard) => void; /** Highlights a card, for pairing with a detail panel. */ selectedCardId?: string | null; onSelect?: (cardId: string | null) => void; /** Replaces the whole card body. */ renderCard?: (card: KanbanCard, column: KanbanColumn) => React.ReactNode; renderColumnHeader?: (column: KanbanColumn) => React.ReactNode; /** * What a drop past a column's WIP limit does. * `'warn'` marks the column and lets it through; `'block'` refuses. * @default 'warn' */ wipLimitBehavior?: WipLimitBehavior; /** @default '20rem' */ columnWidth?: string; /** @default '32rem' */ height?: string; /** Turns off dragging entirely, leaving a readable board. */ readOnly?: boolean; /** @default "Board" */ ariaLabel?: string; /** @default "No cards" */ emptyColumnLabel?: string; /** Accessible strings, in English by library convention. */ labels?: Partial; } export interface KanbanLabels { grabbed: (title: string, column: string, position: number, total: number) => string; moved: (title: string, column: string, position: number, total: number) => string; dropped: (title: string, column: string, position: number) => string; cancelled: (title: string) => string; blocked: (reason: 'locked-card' | 'locked-column' | 'wip-limit') => string; dragHandle: (title: string) => string; wipLimit: (count: number, limit: number) => string; } /** * Board with columns of draggable cards. * * @description * Controlled: the board reports a move and the consumer applies it, so ordering * lives with the data rather than inside a widget. `applyMove` is exported for * exactly that, and is pure. * * Dragging works by pointer **and** by keyboard, through one state machine. * That is why it does not use HTML5 drag-and-drop, which cannot be driven from * the keyboard at all — the accessible half would have had to be a separate, * lesser imitation. * * Work-in-progress limits are first-class, because capping work in progress is * what Kanban is for. * * @ai-rules * 1. Apply the move yourself: `onMove={m => setColumns(applyMove(columns, m))}`. Nothing happens otherwise. * 2. Set `limit` on columns that have one. A board with no WIP limits is a list of lists. * 3. Keep card ids stable — drag, selection and announcements all key off them. * 4. Never wrap the card in your own drag handlers; use `renderCard` for content only. */ export declare const Kanban: React.ForwardRefExoticComponent>;