import React, { type ReactNode } from 'react'; import { type Row } from '@tanstack/react-table'; export interface DataTableRowProps { row: Row; onClick?: (item: T) => void; href?: string | null; /** Dense row height. */ compact?: boolean; /** * Treat the design row height as a minimum: a cell rendering multi-line * content (e.g. a line-clamped description) grows the row instead of being * clipped. Default keeps the fixed height. */ autoHeight?: boolean; className?: string; /** Expandable content rendered below the cells, inside the same card. */ subRow?: ReactNode; } /** * Click-bubbling protocol: any element inside a cell that should NOT trigger * `onRowClick` / row navigation must carry the `data-no-row-click` attribute. * The row checks `target.closest('[data-no-row-click]')` and short-circuits: * in `onClick` mode it skips the consumer's handler; in link mode (when * `href` is set) it calls `e.preventDefault()` so `` does not navigate. * * Clicks originating from portaled descendants (e.g. `FloatingTooltip`, * dropdown menus rendered through `FloatingPortal`) bubble through React's * component tree and reach this handler, but their DOM target lives outside * the row subtree. The handler ignores any click whose target is not * physically contained within the row element — no `stopPropagation` * required at the source. * * In link mode the row IS the `` — content lives inside it, not under * an absolute overlay — so native browser link behaviour works: hover, * right-click "Open in new tab", middle-click, `Cmd+click`, focus outlines, * `:visited` styles, etc. * * Example column with action buttons: * ```tsx * { * id: 'actions', * cell: ({ row }) => ( *
* *
* ), * enableSorting: false, * meta: { width: 'w-[160px] shrink-0', align: 'right' }, * } * ``` * * Wrapped in `React.memo` — for best perf in long lists, pass stable references * for `onClick` and `className` (if function) via `useCallback` / `useMemo` in * the consumer. `href` and string `className` are compared by value. */ declare function DataTableRowImpl({ row, onClick, href, compact, autoHeight, className, subRow, }: DataTableRowProps): React.JSX.Element; export declare const DataTableRow: typeof DataTableRowImpl; export {}; //# sourceMappingURL=data-table-row.d.ts.map