{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "table",
  "title": "Table",
  "description": "Data table with a header, selectable rows, row headers and a footer.",
  "registryDependencies": [
    "https://indiacn.in/r/theme.json",
    "https://indiacn.in/r/typography.json"
  ],
  "files": [
    {
      "path": "components/ui/table.tsx",
      "content": "import { ComponentProps } from 'react';\n\nimport { Body2, Label1 } from '@/components/ui/typography';\nimport { cn } from '@/lib/utils';\n\n/*\n * UX4G table: a neutral-50 header at 40px over neutral-0 rows at 60px,\n * separated by a primary-100 rule — the separator is purple-tinted, not grey.\n * A selected row fills primary-50 and turns its text primary.\n *\n * Built on real table elements. A grid of divs loses the row and column\n * relationships a screen reader needs, and that is the whole reason a table\n * exists.\n */\n\n/** Table container. Scrolls horizontally rather than squashing columns. */\nfunction Table({ className, ...props }: ComponentProps<'table'>) {\n  return (\n    <div className='bg-neutral-0 w-full overflow-x-auto rounded-xl border border-neutral-100'>\n      <table className={cn('w-full border-collapse text-left', className)} {...props} />\n    </div>\n  );\n}\n\n/** Header group. Its cells should be `TableHead`, not `TableCell`. */\nfunction TableHeader({ className, ...props }: ComponentProps<'thead'>) {\n  return <thead className={cn('bg-neutral-50', className)} {...props} />;\n}\n\n/** Body group. */\nfunction TableBody({ className, ...props }: ComponentProps<'tbody'>) {\n  return <tbody className={className} {...props} />;\n}\n\n/** Footer group, for totals. */\nfunction TableFooter({ className, ...props }: ComponentProps<'tfoot'>) {\n  return (\n    <tfoot\n      className={cn('border-t border-neutral-100 bg-neutral-50 font-medium', className)}\n      {...props}\n    />\n  );\n}\n\ninterface ITableRowProps extends ComponentProps<'tr'> {\n  selected?: boolean;\n}\n\n/** A row. `selected` fills primary-50 and is announced through aria-selected. */\nfunction TableRow({ className, selected, ...props }: ITableRowProps) {\n  return (\n    <tr\n      aria-selected={selected || undefined}\n      className={cn(\n        'border-primary-100 border-b transition-colors last:border-b-0',\n        selected ? 'bg-primary-50 text-primary-800' : 'hover:bg-neutral-50',\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/**\n * Header cell.\n *\n * `scope` defaults to `col`. Leaving it off is the usual reason a table reads\n * as an unlabelled grid, so it is set rather than left to the caller.\n */\nfunction TableHead({ className, scope = 'col', children, ...props }: ComponentProps<'th'>) {\n  return (\n    <th scope={scope} className={cn('px-4 py-2.5 align-middle', className)} {...props}>\n      <Label1 className='text-neutral font-semibold'>{children}</Label1>\n    </th>\n  );\n}\n\n/** Body cell. Pass `scope='row'` on the cell that names the row. */\nfunction TableCell({ className, children, ...props }: ComponentProps<'td'>) {\n  return (\n    <td className={cn('px-4 py-5 align-middle', className)} {...props}>\n      <Body2 className='text-[inherit]'>{children}</Body2>\n    </td>\n  );\n}\n\n/**\n * Row header cell — the cell that names its row.\n *\n * Every row wants one. Without it a screen reader reads \"Owner, Your Friend\n * Buzz, Australia\" with no idea whose row that is.\n */\nfunction TableRowHeader({ className, children, ...props }: ComponentProps<'th'>) {\n  return (\n    <th scope='row' className={cn('px-4 py-5 text-left align-middle', className)} {...props}>\n      <Body2 className='font-normal text-[inherit]'>{children}</Body2>\n    </th>\n  );\n}\n\n/** Caption describing the table. Visible by default; add `sr-only` to hide it. */\nfunction TableCaption({ className, ...props }: ComponentProps<'caption'>) {\n  return (\n    <caption className={cn('px-4 py-3 text-left text-sm text-neutral-600', className)} {...props} />\n  );\n}\n\nexport {\n  Table,\n  TableHeader,\n  TableBody,\n  TableFooter,\n  TableRow,\n  TableHead,\n  TableCell,\n  TableRowHeader,\n  TableCaption,\n};\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}
