import * as React from "react"; import { type Cell, type ColumnDef, type Header, type OnChangeFn, type Row, type RowSelectionState, type SortingState, type Table as TanStackTable, type VisibilityState, type ExpandedState, type ColumnPinningState } from "@tanstack/react-table"; import { type DataTableBulkAction } from "@/components/data-table/data-table-bulk-actions"; import { type DataTablePaginationProps } from "@/components/data-table/data-table-pagination"; import { type DataTableRowAction } from "@/components/data-table/data-table-row-actions"; import { type DataTableToolbarProps } from "@/components/data-table/data-table-toolbar"; import { type DataStateProps } from "@/components/display/data-state"; import { type StateViewProps } from "@/components/feedback/state-view"; import { type InputSearchProps } from "@/components/ui/input"; export type DataTableDensity = "compact" | "default" | "comfortable"; export type DataTableLoadingVariant = "skeleton" | "state"; export type DataTableMobileLayout = "auto" | "cards" | "scroll"; export type DataTableVirtualizationRange = { startIndex: number; endIndex: number; }; export type DataTableVirtualizationConfig = { enabled?: boolean; height?: number | string; estimateRowHeight?: number; overscan?: number; measureRows?: boolean; onRangeChange?: (range: DataTableVirtualizationRange) => void; }; export type DataTableFeatureConfig = { search?: boolean; columnVisibility?: boolean; rowActions?: boolean; bulkActions?: boolean; refresh?: boolean; export?: boolean; }; export type DataTableSearchConfig = Pick & { className?: string; wrapperClassName?: string; }; export type DataTableActionContext = { table: TanStackTable; data: TData[]; selectedRows: TData[]; }; export type DataTablePaginationConfig = Pick & { manual?: boolean; hidden?: boolean; onPageChange?: (pageIndex: number) => void; onPageSizeChange?: (pageSize: number) => void; }; export type DataTableProps = Omit, "children"> & { columns: ColumnDef[]; data: TData[]; title?: React.ReactNode; description?: React.ReactNode; features?: DataTableFeatureConfig; search?: DataTableSearchConfig; filters?: React.ReactNode | ((context: DataTableActionContext) => React.ReactNode); summary?: React.ReactNode | ((context: DataTableActionContext) => React.ReactNode); toolbarActions?: React.ReactNode | ((context: DataTableActionContext) => React.ReactNode); rowActions?: (row: Row, original: TData) => DataTableRowAction[]; bulkActions?: DataTableBulkAction[]; onRefresh?: (context: DataTableActionContext) => void; onExport?: (context: DataTableActionContext) => void; refreshLabel?: React.ReactNode; exportLabel?: React.ReactNode; getRowId?: (originalRow: TData, index: number, parent?: Row) => string; isLoading?: boolean; isError?: boolean; emptyState?: Omit; errorState?: Omit; loadingState?: Omit; loadingVariant?: DataTableLoadingVariant; toolbar?: React.ReactNode | ((table: TanStackTable) => React.ReactNode); toolbarProps?: DataTableToolbarProps | ((table: TanStackTable) => DataTableToolbarProps); pagination?: DataTablePaginationConfig | false; sorting?: SortingState; onSortingChange?: OnChangeFn; columnVisibility?: VisibilityState; onColumnVisibilityChange?: OnChangeFn; rowSelection?: RowSelectionState; onRowSelectionChange?: OnChangeFn; enableRowSelection?: boolean | ((row: Row) => boolean); renderMobileCard?: (row: Row) => React.ReactNode; mobileLayout?: DataTableMobileLayout; onRowClick?: (row: Row) => void; onRowDoubleClick?: (row: Row) => void; getRowDisabled?: (row: Row) => boolean; density?: DataTableDensity; striped?: boolean; bordered?: boolean; stickyHeader?: boolean; skeletonRows?: number; skeletonCellClassName?: string; cellFallback?: React.ReactNode; tableClassName?: string; tableWrapperClassName?: string; headerCellClassName?: string | ((header: Header) => string); cellClassName?: string | ((cell: Cell) => string); rowClassName?: string | ((row: Row) => string); renderExpandedRow?: (row: Row) => React.ReactNode; expanded?: ExpandedState; onExpandedChange?: OnChangeFn; getRowCanExpand?: (row: Row) => boolean; columnPinning?: ColumnPinningState; onColumnPinningChange?: OnChangeFn; virtualization?: DataTableVirtualizationConfig | false; }; declare function DataTable({ className, columns, data, title, description, features, search, filters, summary, toolbarActions, rowActions, bulkActions, onRefresh, onExport, refreshLabel, exportLabel, getRowId, isLoading, isError, emptyState, errorState, loadingState, loadingVariant, toolbar, toolbarProps, pagination, sorting, onSortingChange, columnVisibility, onColumnVisibilityChange, rowSelection, onRowSelectionChange, enableRowSelection, renderMobileCard, mobileLayout, onRowClick, onRowDoubleClick, getRowDisabled, density, striped, bordered, stickyHeader, skeletonRows, skeletonCellClassName, cellFallback, tableClassName, tableWrapperClassName, headerCellClassName, cellClassName, rowClassName, renderExpandedRow, expanded, onExpandedChange, getRowCanExpand, columnPinning, onColumnPinningChange, virtualization, ...props }: DataTableProps): React.JSX.Element; export { DataTable };