/** * @usevyre/react — DataGrid * * AI CONTEXT: * ┌─────────────────────────────────────────────────────────┐ * │ Component: DataGrid │ * │ Import: import { DataGrid } from "@usevyre/react" │ * │ │ * │ Props: │ * │ columns = { key: string; label: string; │ * │ sortable?: boolean; │ * │ width?: string }[] │ * │ rows = Record[] │ * │ sortKey? = string (controlled) │ * │ sortDir? = "asc"|"desc" (controlled) │ * │ onSort? = (key: string, dir: "asc"|"desc") => │ * │ void │ * │ loading? = boolean — shows 5 skeleton rows │ * │ emptyText? = string (default: "No data") │ * │ stickyHeader? = boolean (default: false) │ * │ │ * │ Sort icons: ↕ unsorted, ↑ asc, ↓ desc │ * │ Intentionally excludes: filtering, pagination │ * │ → Use Pagination component for page navigation │ * └─────────────────────────────────────────────────────────┘ * * @example * const [sortKey, setSortKey] = useState(); * const [sortDir, setSortDir] = useState<"asc" | "desc">("asc"); * * { setSortKey(key); setSortDir(dir); }} * stickyHeader * /> * * // With Pagination (filtering/pagination intentionally out of scope) * * */ import React from "react"; import type { BaseProps } from "../../types"; export interface DataGridColumn { key: string; label: string; sortable?: boolean; width?: string; } export interface DataGridProps extends BaseProps { columns: DataGridColumn[]; rows: Record[]; sortKey?: string; sortDir?: "asc" | "desc"; onSort?: (key: string, dir: "asc" | "desc") => void; loading?: boolean; emptyText?: string; stickyHeader?: boolean; } export declare const DataGrid: React.ForwardRefExoticComponent>;