import { ReactNode } from 'react'; import { ColumnDef, SortingState, RowSelectionState, OnChangeFn } from '@tanstack/react-table'; import { LucideIcon } from 'lucide-react'; import { RowAction } from './DataTable/RowActionsCell'; export type { RowAction } from './DataTable/RowActionsCell'; export { DataTableColumnHeader, type DataTableColumnHeaderProps } from './DataTable/DataTableColumnHeader'; export interface BulkAction { /** Optional stable id; falls back to `label` for the React key and separator logic. */ id?: string; label: string; icon?: LucideIcon; onClick: (selectedIds: string[]) => void; /** @deprecated Prefer `variant: "destructive"`. Still honored for back-compat. */ destructive?: boolean; /** Button emphasis in the bulk bar. `"default"` resolves to the current outline look. */ variant?: "default" | "primary" | "destructive"; /** Disable this action, optionally derived from the current selection. */ disabled?: boolean | ((selectedIds: string[]) => boolean); /** Hide this action, optionally derived from the current selection. */ hidden?: boolean | ((selectedIds: string[]) => boolean); /** Render a divider before this action — visual grouping (mirrors `RowAction.separator`). */ separator?: boolean; } /** Server-pagination summary — alternative to the flat `page`/`pageSize`/`total` * props below; pass whichever shape your API already returns. When both are * given, `pagination` takes precedence. */ export interface PaginationInfo { page: number; size: number; totalElements: number; totalPages: number; hasNext: boolean; hasPrevious: boolean; } /** Density variant for row height scaling. Inherits from closest * `[data-density]` ancestor (usually ThemeProvider on :root) when omitted. */ export type DataTableDensity = "compact" | "comfortable" | "spacious"; /** Toolbar color variant — tints the toolbar bar's background/border/accent * color when `toolbarStart`/`toolbarEnd` is used (does not affect the table * header or rows). */ export type ToolbarVariant = "dark" | "navy" | "cherry" | "emerald" | "amber" | "teal" | "violet" | "rose" | "indigo" | "orange"; export interface DataTableProps { columns: ColumnDef[]; data: TData[]; loading?: boolean; emptyTitle?: string; emptyDescription?: string; emptyAction?: { label: string; onClick: () => void; }; enableSorting?: boolean; enableSelection?: boolean; enableVirtualScroll?: boolean; onRowClick?: (row: TData) => void; bulkActions?: BulkAction[]; sorting?: SortingState; onSortingChange?: OnChangeFn; /** Single-column server-sort alternative to `sorting`/`onSortingChange` — * when provided, takes precedence. Pair with `` in * a column's `header` render function. */ sortBy?: string; sortDirection?: "ASC" | "DESC"; onSortChange?: (sortBy: string, sortDirection: "ASC" | "DESC") => void; rowSelection?: RowSelectionState; onRowSelectionChange?: OnChangeFn; page?: number; pageSize?: number; total?: number; /** Alternative to `page`/`pageSize`/`total` — see {@link PaginationInfo}. */ pagination?: PaginationInfo; onPageChange?: (page: number) => void; onPageSizeChange?: (size: number) => void; stickyHeader?: boolean; getRowId?: (row: TData) => string; /** Per-row accessible label, set as `aria-label` on each row's `` (e.g. * screen-reader context on clickable rows). Omit for no label. */ getRowAriaLabel?: (row: TData) => string; className?: string; /** Optional accessible caption exposed via `` for screen readers. */ caption?: string; /** Override the density inherited from the nearest `[data-density]` ancestor. */ density?: DataTableDensity; /** Per-row "…" actions menu, appended as a trailing column. */ rowActions?: RowAction[]; /** Left-aligned toolbar slot rendered above the table (e.g. an entity label). */ toolbarStart?: ReactNode; /** Right-aligned toolbar slot rendered above the table. */ toolbarEnd?: ReactNode; /** Tints the toolbar bar — no-op unless `toolbarStart`/`toolbarEnd` is set. */ toolbarVariant?: ToolbarVariant; /** Custom renderer for the "N selected" count label in the bulk bar. * Receives the selected row count; defaults to the i18n `table.secili: N`. */ bulkActionsLabel?: (count: number) => ReactNode; /** Arbitrary content injected into the bulk bar, before the action buttons. * Receives the current selected ids. Mirrors the `toolbarStart`/`toolbarEnd` slot pattern. */ bulkActionsContent?: ReactNode | ((selectedIds: string[]) => ReactNode); } export declare function DataTable({ columns, data, loading, emptyTitle, emptyDescription, emptyAction, enableSorting, enableSelection, enableVirtualScroll, onRowClick, bulkActions, sorting, onSortingChange, sortBy, sortDirection, onSortChange, rowSelection, onRowSelectionChange, page, pageSize, total, pagination, onPageChange, onPageSizeChange, stickyHeader, getRowId, getRowAriaLabel, className, caption, density, rowActions, toolbarStart, toolbarEnd, toolbarVariant, bulkActionsLabel, bulkActionsContent, }: DataTableProps): import("react").JSX.Element; //# sourceMappingURL=DataTable.d.ts.map