{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "table",
  "title": "Table",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-react/components/table/table.tsx",
      "content": "import * as React from 'react'\nimport { cn } from '@/lib/utils'\n\nexport interface TableProps extends React.HTMLAttributes<HTMLTableElement> {\n  // Match DataTable's density enum so consumers can opt into the same\n  // runtime feel without wiring DataTable. `cozy` is the canonical default\n  // for bare tables (cells: py-2, head: h-10); the other two are escape\n  // hatches for high-density admin lists and roomy patient-facing views.\n  density?: 'compact' | 'cozy' | 'comfortable'\n}\n\nconst Table = React.forwardRef<HTMLTableElement, TableProps>(({ className, density, ...props }, ref) => {\n  const densityClass =\n    density === 'compact'\n      ? '[&_td]:py-1.5 [&_td]:text-xs [&_th]:h-8 [&_th]:text-xs'\n      : density === 'comfortable'\n        ? '[&_td]:py-3 [&_th]:h-12'\n        : // cozy is the new TableCell/TableHead baseline (py-2 / h-10) -- no override.\n          ''\n\n  return (\n    <div data-uipkge=\"\" data-slot=\"table-container\" className=\"relative w-full overflow-auto\">\n      <table\n        ref={ref}\n        data-uipkge=\"\"\n        data-slot=\"table\"\n        className={cn('w-full caption-bottom text-sm', densityClass, className)}\n        {...props}\n      />\n    </div>\n  )\n})\nTable.displayName = 'Table'\n\nconst TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n  ({ className, ...props }, ref) => (\n    <thead ref={ref} data-uipkge=\"\" data-slot=\"table-header\" className={cn('bg-muted/50 [&_tr]:border-b', className)} {...props} />\n  ),\n)\nTableHeader.displayName = 'TableHeader'\n\nconst TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n  ({ className, ...props }, ref) => (\n    <tbody ref={ref} data-uipkge=\"\" data-slot=\"table-body\" className={cn('[&_tr:last-child]:border-0', className)} {...props} />\n  ),\n)\nTableBody.displayName = 'TableBody'\n\nconst TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n  ({ className, ...props }, ref) => (\n    <tfoot\n      ref={ref}\n      data-uipkge=\"\"\n      data-slot=\"table-footer\"\n      className={cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className)}\n      {...props}\n    />\n  ),\n)\nTableFooter.displayName = 'TableFooter'\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(\n  ({ className, ...props }, ref) => (\n    <tr\n      ref={ref}\n      data-uipkge=\"\"\n      data-slot=\"table-row\"\n      className={cn('hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors duration-150', className)}\n      {...props}\n    />\n  ),\n)\nTableRow.displayName = 'TableRow'\n\nconst TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<HTMLTableCellElement>>(\n  ({ className, ...props }, ref) => (\n    <th\n      ref={ref}\n      data-uipkge=\"\"\n      data-slot=\"table-head\"\n      className={cn(\n        'text-foreground h-10 px-3 text-left align-middle text-sm font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n        className,\n      )}\n      {...props}\n    />\n  ),\n)\nTableHead.displayName = 'TableHead'\n\nconst TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(\n  ({ className, ...props }, ref) => (\n    <td\n      ref={ref}\n      data-uipkge=\"\"\n      data-slot=\"table-cell\"\n      className={cn(\n        'px-3 py-2 align-middle text-sm whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n        className,\n      )}\n      {...props}\n    />\n  ),\n)\nTableCell.displayName = 'TableCell'\n\nconst TableCaption = React.forwardRef<HTMLTableCaptionElement, React.HTMLAttributes<HTMLTableCaptionElement>>(\n  ({ className, ...props }, ref) => (\n    <caption\n      ref={ref}\n      data-uipkge=\"\"\n      data-slot=\"table-caption\"\n      className={cn('text-muted-foreground mt-4 text-sm', className)}\n      {...props}\n    />\n  ),\n)\nTableCaption.displayName = 'TableCaption'\n\nexport interface TableEmptyProps extends React.TdHTMLAttributes<HTMLTableCellElement> {\n  colSpan?: number\n}\n\nconst TableEmpty = React.forwardRef<HTMLTableCellElement, TableEmptyProps>(\n  ({ className, colSpan = 1, children, ...props }, ref) => (\n    <TableRow>\n      <TableCell\n        ref={ref}\n        colSpan={colSpan}\n        className={cn('text-foreground p-4 align-middle text-sm whitespace-nowrap', className)}\n        {...props}\n      >\n        <div className=\"flex items-center justify-center py-10\">{children}</div>\n      </TableCell>\n    </TableRow>\n  ),\n)\nTableEmpty.displayName = 'TableEmpty'\n\nexport {\n  Table,\n  TableHeader,\n  TableBody,\n  TableFooter,\n  TableHead,\n  TableRow,\n  TableCell,\n  TableCaption,\n  TableEmpty,\n}\n",
      "type": "registry:ui",
      "target": "~/components/ui/table/table.tsx"
    },
    {
      "path": "packages/registry-react/components/table/utils.ts",
      "content": "import type { Updater } from '@tanstack/react-table'\nimport type { Dispatch, SetStateAction } from 'react'\n\nexport function valueUpdater<T>(updaterOrValue: Updater<T>, setValue: Dispatch<SetStateAction<T>>) {\n  setValue((old) => (typeof updaterOrValue === 'function' ? (updaterOrValue as (old: T) => T)(old) : updaterOrValue))\n}\n",
      "type": "registry:ui",
      "target": "~/components/ui/table/utils.ts"
    },
    {
      "path": "packages/registry-react/components/table/index.ts",
      "content": "export {\n  Table,\n  TableHeader,\n  TableBody,\n  TableFooter,\n  TableHead,\n  TableRow,\n  TableCell,\n  TableCaption,\n  TableEmpty,\n  type TableProps,\n  type TableEmptyProps,\n} from './table'\n",
      "type": "registry:ui",
      "target": "~/components/ui/table/index.ts"
    }
  ],
  "dependencies": [
    "@tanstack/react-table"
  ],
  "devDependencies": [],
  "registryDependencies": [],
  "description": "Plain HTML table primitives — `<Table>`, `<TableHeader>`, `<TableRow>`, `<TableCell>` — with the registry’s borders, padding, and tokens already applied. Use this when Data Table is too heavy.",
  "categories": [
    "data-display"
  ]
}