/** * Table — WealthX DS overrides (shadcn base) * * Changes from shadcn default: * - TableHead: `text-foreground` -- `text-muted-foreground` — header labels are secondary text * - TableHead: `px-2` -- `px-4` — wider horizontal padding per Figma spacing * - TableCell: `p-2` -- `px-4 py-3` — consistent cell padding per Figma * - TableRow: `transition-colors` -- `transition-[background-color,opacity]` — scoped animation * - TableRow: `data-[state=selected]:bg-muted` -- `data-[state=selected]:bg-primary/10` — selected tint matches Figma (primary + 10% opacity) * - TableFooter: inherits same cell padding via className */ import { type ReactElement } from "react"; import * as React from "react"; import { cn } from "@/lib/utils"; export type TableProps = React.ComponentProps<"table">; function Table({ className, ...props }: TableProps): ReactElement { return (
); } export type TableHeaderProps = React.ComponentProps<"thead">; function TableHeader({ className, ...props }: TableHeaderProps): ReactElement { return ( ); } export type TableBodyProps = React.ComponentProps<"tbody">; function TableBody({ className, ...props }: TableBodyProps): ReactElement { return ( ); } export type TableFooterProps = React.ComponentProps<"tfoot">; function TableFooter({ className, ...props }: TableFooterProps): ReactElement { return ( tr]:last:border-b-0", className, )} data-slot="table-footer" {...props} /> ); } export type TableRowProps = React.ComponentProps<"tr">; function TableRow({ className, ...props }: TableRowProps): ReactElement { return ( ); } export type TableHeadProps = React.ComponentProps<"th">; function TableHead({ className, ...props }: TableHeadProps): ReactElement { return (
[role=checkbox]]:translate-y-[2px]", className, )} data-slot="table-head" {...props} /> ); } export type TableCellProps = React.ComponentProps<"td">; function TableCell({ className, ...props }: TableCellProps): ReactElement { return ( [role=checkbox]]:translate-y-[2px]", className, )} data-slot="table-cell" {...props} /> ); } export type TableCaptionProps = React.ComponentProps<"caption">; function TableCaption({ className, ...props }: TableCaptionProps): ReactElement { return (
); } export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };