{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "table",
  "type": "registry:ui",
  "title": "Table",
  "description": "Semantic Table primitive with native table anatomy, responsive overflow wrapping, density-aware cell spacing, caption placement, row state hooks, and token-backed alignment styles.",
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://components.dethink.co.uk/r/dethink-base.json"
  ],
  "files": [
    {
      "path": "packages/components/src/components/table/table.tsx",
      "type": "registry:file",
      "target": "~/components/dethink/components/table/table.tsx",
      "content": "import {\n  forwardRef,\n  type HTMLAttributes,\n  type TableHTMLAttributes,\n  type TdHTMLAttributes,\n  type ThHTMLAttributes,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\n\nexport type TableDensity = \"compact\" | \"default\" | \"comfortable\";\nexport type TableCaptionPlacement = \"top\" | \"bottom\";\nexport type TableCellAlign = \"start\" | \"center\" | \"end\";\nexport type TableRowTone = \"default\" | \"muted\";\n\nexport interface TableProps extends TableHTMLAttributes<HTMLTableElement> {\n  containerClassName?: string;\n  density?: TableDensity;\n}\n\nexport interface TableHeaderProps extends HTMLAttributes<HTMLTableSectionElement> {}\n\nexport interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {}\n\nexport interface TableFooterProps extends HTMLAttributes<HTMLTableSectionElement> {}\n\nexport interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {\n  hoverable?: boolean;\n  selected?: boolean;\n  tone?: TableRowTone;\n}\n\nexport type TableHeadProps = Omit<\n  ThHTMLAttributes<HTMLTableCellElement>,\n  \"align\"\n> & {\n  align?: TableCellAlign;\n};\n\nexport type TableCellProps = Omit<\n  TdHTMLAttributes<HTMLTableCellElement>,\n  \"align\"\n> & {\n  align?: TableCellAlign;\n  numeric?: boolean;\n};\n\nexport interface TableCaptionProps extends HTMLAttributes<HTMLTableCaptionElement> {\n  placement?: TableCaptionPlacement;\n}\n\nconst tableContainerBaseClasses =\n  \"relative w-full overflow-x-auto overscroll-x-contain\";\n\nconst tableDensityClasses: Record<TableDensity, string> = {\n  compact:\n    \"[--table-cell-px:var(--dt-space-2)] [--table-cell-py:var(--dt-space-1-5)] [--table-row-min-height:2rem]\",\n  default:\n    \"[--table-cell-px:var(--dt-space-3)] [--table-cell-py:var(--dt-space-2)] [--table-row-min-height:2.5rem]\",\n  comfortable:\n    \"[--table-cell-px:var(--dt-space-4)] [--table-cell-py:var(--dt-space-3)] [--table-row-min-height:3rem]\",\n};\n\nconst tableBaseClasses =\n  \"w-full min-w-full caption-bottom border-collapse text-sm text-foreground\";\n\nconst tableHeaderBaseClasses = \"[&_tr]:border-b\";\nconst tableBodyBaseClasses = \"[&_tr:last-child]:border-0\";\nconst tableFooterBaseClasses =\n  \"border-t border-border bg-muted/40 font-medium text-foreground [&>tr]:last:border-b-0\";\n\nconst tableRowBaseClasses =\n  \"min-h-[var(--table-row-min-height)] border-b border-border motion-safe:transition-colors motion-safe:duration-150 motion-safe:ease-out motion-reduce:transition-none data-[hoverable=true]:hover:bg-muted/50 data-[selected=true]:bg-muted data-[tone=muted]:bg-muted/30\";\n\nconst tableHeadBaseClasses =\n  \"h-[var(--table-row-min-height)] whitespace-nowrap px-[var(--table-cell-px)] py-[var(--table-cell-py)] text-start align-middle font-medium text-muted-foreground [&:has([data-slot=checkbox])]:pe-0 [&:has([data-slot=checkbox-input])]:pe-0 [&:has(input[type=checkbox])]:pe-0\";\n\nconst tableCellBaseClasses =\n  \"h-[var(--table-row-min-height)] px-[var(--table-cell-px)] py-[var(--table-cell-py)] align-middle text-foreground [&:has([data-slot=checkbox])]:pe-0 [&:has([data-slot=checkbox-input])]:pe-0 [&:has(input[type=checkbox])]:pe-0\";\n\nconst tableCaptionBaseClasses = \"text-sm text-muted-foreground\";\n\nconst tableCellAlignClasses: Record<TableCellAlign, string> = {\n  start: \"text-start\",\n  center: \"text-center\",\n  end: \"text-end\",\n};\n\nconst tableCaptionPlacementClasses: Record<TableCaptionPlacement, string> = {\n  top: \"caption-top mb-[var(--dt-space-3)] mt-0\",\n  bottom: \"caption-bottom mt-[var(--dt-space-3)]\",\n};\n\nexport function tableContainerClassNames({\n  className,\n  density = \"default\",\n}: Pick<TableProps, \"density\"> & { className?: string } = {}) {\n  return cn(tableContainerBaseClasses, tableDensityClasses[density], className);\n}\n\nexport function tableClassNames({\n  className,\n}: Pick<TableProps, \"className\"> = {}) {\n  return cn(tableBaseClasses, className);\n}\n\nexport function tableHeaderClassNames({\n  className,\n}: Pick<TableHeaderProps, \"className\"> = {}) {\n  return cn(tableHeaderBaseClasses, className);\n}\n\nexport function tableBodyClassNames({\n  className,\n}: Pick<TableBodyProps, \"className\"> = {}) {\n  return cn(tableBodyBaseClasses, className);\n}\n\nexport function tableFooterClassNames({\n  className,\n}: Pick<TableFooterProps, \"className\"> = {}) {\n  return cn(tableFooterBaseClasses, className);\n}\n\nexport function tableRowClassNames({\n  className,\n}: Pick<TableRowProps, \"className\"> = {}) {\n  return cn(tableRowBaseClasses, className);\n}\n\nexport function tableHeadClassNames({\n  align = \"start\",\n  className,\n}: Pick<TableHeadProps, \"align\" | \"className\"> = {}) {\n  return cn(tableHeadBaseClasses, tableCellAlignClasses[align], className);\n}\n\nexport function tableCellClassNames({\n  align = \"start\",\n  className,\n  numeric = false,\n}: Pick<TableCellProps, \"align\" | \"className\" | \"numeric\"> = {}) {\n  return cn(\n    tableCellBaseClasses,\n    tableCellAlignClasses[align],\n    numeric ? \"tabular-nums\" : undefined,\n    className,\n  );\n}\n\nexport function tableCaptionClassNames({\n  className,\n  placement = \"bottom\",\n}: Pick<TableCaptionProps, \"className\" | \"placement\"> = {}) {\n  return cn(\n    tableCaptionBaseClasses,\n    tableCaptionPlacementClasses[placement],\n    className,\n  );\n}\n\nexport const Table = forwardRef<HTMLTableElement, TableProps>(\n  (\n    { children, className, containerClassName, density = \"default\", ...props },\n    ref,\n  ) => (\n    <div\n      data-slot=\"table-container\"\n      data-density={density}\n      className={tableContainerClassNames({\n        className: containerClassName,\n        density,\n      })}\n    >\n      <table\n        {...props}\n        ref={ref}\n        data-slot=\"table\"\n        data-density={density}\n        className={tableClassNames({ className })}\n      >\n        {children}\n      </table>\n    </div>\n  ),\n);\n\nTable.displayName = \"Table\";\n\nexport const TableHeader = forwardRef<\n  HTMLTableSectionElement,\n  TableHeaderProps\n>(({ className, ...props }, ref) => (\n  <thead\n    {...props}\n    ref={ref}\n    data-slot=\"table-header\"\n    className={tableHeaderClassNames({ className })}\n  />\n));\n\nTableHeader.displayName = \"TableHeader\";\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n  ({ className, ...props }, ref) => (\n    <tbody\n      {...props}\n      ref={ref}\n      data-slot=\"table-body\"\n      className={tableBodyClassNames({ className })}\n    />\n  ),\n);\n\nTableBody.displayName = \"TableBody\";\n\nexport const TableFooter = forwardRef<\n  HTMLTableSectionElement,\n  TableFooterProps\n>(({ className, ...props }, ref) => (\n  <tfoot\n    {...props}\n    ref={ref}\n    data-slot=\"table-footer\"\n    className={tableFooterClassNames({ className })}\n  />\n));\n\nTableFooter.displayName = \"TableFooter\";\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(\n  (\n    {\n      className,\n      hoverable = true,\n      selected = false,\n      tone = \"default\",\n      ...props\n    },\n    ref,\n  ) => (\n    <tr\n      {...props}\n      ref={ref}\n      data-slot=\"table-row\"\n      data-hoverable={hoverable ? \"true\" : \"false\"}\n      data-selected={selected ? \"true\" : undefined}\n      data-tone={tone}\n      className={tableRowClassNames({ className })}\n    />\n  ),\n);\n\nTableRow.displayName = \"TableRow\";\n\nexport const TableHead = forwardRef<HTMLTableCellElement, TableHeadProps>(\n  ({ align = \"start\", className, scope = \"col\", ...props }, ref) => (\n    <th\n      {...props}\n      ref={ref}\n      scope={scope}\n      data-slot=\"table-head\"\n      data-align={align}\n      className={tableHeadClassNames({ align, className })}\n    />\n  ),\n);\n\nTableHead.displayName = \"TableHead\";\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(\n  ({ align = \"start\", className, numeric = false, ...props }, ref) => (\n    <td\n      {...props}\n      ref={ref}\n      data-slot=\"table-cell\"\n      data-align={align}\n      data-numeric={numeric ? \"true\" : undefined}\n      className={tableCellClassNames({ align, className, numeric })}\n    />\n  ),\n);\n\nTableCell.displayName = \"TableCell\";\n\nexport const TableCaption = forwardRef<\n  HTMLTableCaptionElement,\n  TableCaptionProps\n>(({ className, placement = \"bottom\", ...props }, ref) => (\n  <caption\n    {...props}\n    ref={ref}\n    data-slot=\"table-caption\"\n    data-placement={placement}\n    className={tableCaptionClassNames({ className, placement })}\n  />\n));\n\nTableCaption.displayName = \"TableCaption\";\n"
    },
    {
      "path": "packages/components/src/components/table/index.ts",
      "type": "registry:file",
      "target": "~/components/dethink/components/table/index.ts",
      "content": "export {\n  Table,\n  TableBody,\n  TableCaption,\n  TableCell,\n  TableFooter,\n  TableHead,\n  TableHeader,\n  TableRow,\n  tableBodyClassNames,\n  tableCaptionClassNames,\n  tableCellClassNames,\n  tableClassNames,\n  tableContainerClassNames,\n  tableFooterClassNames,\n  tableHeadClassNames,\n  tableHeaderClassNames,\n  tableRowClassNames,\n  type TableBodyProps,\n  type TableCaptionPlacement,\n  type TableCaptionProps,\n  type TableCellAlign,\n  type TableCellProps,\n  type TableDensity,\n  type TableFooterProps,\n  type TableHeadProps,\n  type TableHeaderProps,\n  type TableProps,\n  type TableRowProps,\n  type TableRowTone,\n} from \"./table\";\n"
    },
    {
      "path": "packages/components/src/utils/cn.ts",
      "type": "registry:file",
      "target": "~/components/dethink/utils/cn.ts",
      "content": "import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n"
    }
  ]
}
