/** * @usevyre/react — Kanban * * AI CONTEXT: * ┌─────────────────────────────────────────────────────────────────┐ * │ Component: Kanban (board with drag-and-drop between columns) │ * │ Import: import { Kanban } from "@usevyre/react" │ * │ │ * │ CONTROLLED & data-driven (like DataGrid). No internal data │ * │ state — you own `value`, update it in `onChange`. │ * │ │ * │ Props: │ * │ value = KanbanColumn[] (required, controlled) │ * │ onChange = (next: KanbanColumn[]) => void (required) │ * │ renderCard?= (card, column) => ReactNode (custom card body) │ * │ onCardClick? = (card, column) => void │ * │ className? = string │ * │ │ * │ KanbanColumn = { id; title; cards: KanbanCard[]; │ * │ color?: KanbanColor } │ * │ KanbanCard = { id; title; description?; │ * │ color?: KanbanColor } │ * │ KanbanColor = "default" | "accent" | "teal" | │ * │ "success" | "warning" | "danger" │ * │ → tints the column/card background (token-based). │ * │ │ * │ Drag a card to another column (or reorder within a column); │ * │ Kanban calls onChange with the next columns array. While │ * │ dragging, a placeholder shows the exact drop position. Card │ * │ ids must be unique across the whole board. │ * │ │ * │ Each card is wrapped in a (variant="outlined"); the │ * │ default body is title + description, but renderCard can return │ * │ ANY content — including complex components (avatars, badges, │ * │ progress) — placed inside the Card's body. │ * │ │ * │ Native HTML5 drag-and-drop — zero dependencies. │ * └─────────────────────────────────────────────────────────────────┘ * * @example * const [columns, setColumns] = useState([ * { id: "todo", title: "To Do", cards: [{ id: "1", title: "Spec API" }] }, * { id: "doing", title: "In Progress", cards: [] }, * { id: "done", title: "Done", cards: [{ id: "2", title: "Kickoff" }] }, * ]); * */ import React from "react"; import type { BaseProps } from "../../types"; /** Semantic tint applied to a column or card background. */ export type KanbanColor = "default" | "accent" | "teal" | "success" | "warning" | "danger"; export interface KanbanCard { id: string; title: string; description?: string; /** Tints the card background (token-based). Default: "default". */ color?: KanbanColor; } export interface KanbanColumn { id: string; title: string; cards: KanbanCard[]; /** Tints the column background (token-based). Default: "default". */ color?: KanbanColor; } export interface KanbanProps extends BaseProps { /** Controlled board data. */ value: KanbanColumn[]; /** Called with the next columns array after any drag move. */ onChange: (next: KanbanColumn[]) => void; /** Custom card body renderer. Defaults to title + optional description. */ renderCard?: (card: KanbanCard, column: KanbanColumn) => React.ReactNode; /** Called when a card is clicked (not fired while dragging). */ onCardClick?: (card: KanbanCard, column: KanbanColumn) => void; } export declare const Kanban: React.ForwardRefExoticComponent>;