{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "table",
  "title": "Table",
  "description": "표 — 8종 하위 컴포넌트(Table/Header/Body/Footer/Row/Head/Cell/Caption). View+flex 이식, 표 시맨틱 role은 브리지 계약상 미지원(로드맵).",
  "dependencies": [
    "@unikit-bridge/ui",
    "class-variance-authority",
    "clsx",
    "tailwind-merge",
    "tailwindcss"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/ui/table.tsx",
      "content": "// Table — shadcn/ui new-york-v4 table 포팅（shadcn-ref/ui/table.tsx）. 8종 export.\n// 포팅 판단:\n// - 원본은 <table>/<thead>/<tr>/<th> 등 표 요소 + 자손 셀렉터（［&_tr］:border-b,\n//   ［&_tr:last-child］:border-0, has-aria-expanded:）로 스타일링한다. 브리지에는\n//   표 요소가 없으므로 전부 View（div）로 이식하되 시각 토큰（테두리·배경·여백·높이）은\n//   유지하고, 행/셀 배치는 flex（행=flex-row, 셀=flex-1 균등 폭）로 재구성했다.\n//   셀 폭 균등（flex-1）은 원본 table 자동 배치와 다르다 — 사용처에서 셀 className으로\n//   조절한다.\n// - role은 사이클 40 브리지 확장（§2.1）으로 소급 지정한다 — Table=table,\n//   Header/Body/Footer=rowgroup, TableRow=row, TableHead=columnheader,\n//   TableCell=cell. 네이티브 RN이 모르는 role은 무시되고（브리지 문서화된\n//   방침） 웹 스크린리더가 표 의미를 전달받는다.\n// - 셀（TableHead·TableCell）의 children은 문자열을 권장한다 — 내부 Text가 색·\n//   타이포를 담당한다（이중 지정）. 사용자 정의 콘텐츠는 직접 Text를 넣어야 한다.\n// - 자손 셀렉터 미지원으로 소실되는 원본 토큰: TableHeader의 ［&_tr］:border-b는\n//   TableRow 자체 border-b로 흡수, TableBody의 마지막 행 보더 제거（:last-child）와\n//   TableRow의 data-state=selected·has-aria-expanded 배경은 미지원.\n//   whitespace-nowrap·overflow-x-auto·transition·hover는 web: 접두.\n//   caption-bottom은 flex-col DOM 순서 배치로 대체（캡션을 마지막에 넣으면 하단）.\nimport { createContext, forwardRef, useContext } from \"react\";\nimport {\n  Text,\n  View,\n  type BridgeViewRef,\n  type ViewProps,\n} from \"@unikit-bridge/ui/primitives\";\nimport { cva } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\n\n// 가로 스크롤 컨테이너（원본 table-container div）\n// 표 구역 context — 푸터 여부를 셀 Text로 전달한다（alert.tsx의 variant context\n// 와 동일 패턴）. 컨테이너 font-medium은 웹에서만 텍스트로 상속되고 네이티브에서는\n// 무시되는 비대칭이라 이중 지정 원칙대로 내부 Text에 내린다（사소 4）.\nconst TableSectionContext = createContext<\"body\" | \"footer\">(\"body\");\n\nconst tableContainerVariants = cva(\"relative w-full web:overflow-x-auto\");\n// 표 본체 — 행이 쌓이는 열（원본 <table>의 w-full）\nconst tableVariants = cva(\"w-full flex-col\");\nconst tableHeaderVariants = cva(\"flex-col\");\nconst tableBodyVariants = cva(\"flex-col\");\nconst tableFooterVariants = cva(\"flex-col border-t bg-muted/50\");\nconst tableRowVariants = cva(\n  \"flex-row border-b web:transition-colors web:hover:bg-muted/50\",\n);\n// 셀 세로 중앙（원본 align-middle）은 flex-col 셀에서 justify-center로 표현 —\n// items-center는 브리지 flex-col 기본과 만나 가로 중앙 정렬로 해석되어 결함.\nconst tableHeadVariants = cva(\"h-10 flex-1 justify-center px-2 text-left\");\nconst tableHeadTextVariants = cva(\n  \"font-sans text-sm font-medium text-foreground web:whitespace-nowrap\",\n);\nconst tableCellVariants = cva(\"flex-1 justify-center p-2 text-left\");\nconst tableCellTextVariants = cva(\n  \"font-sans text-sm text-foreground web:whitespace-nowrap\",\n);\nconst tableCaptionVariants = cva(\"w-full mt-4\");\nconst tableCaptionTextVariants = cva(\"font-sans text-sm text-muted-foreground\");\n\nexport type TableProps = ViewProps;\nexport type TableHeaderProps = ViewProps;\nexport type TableBodyProps = ViewProps;\nexport type TableFooterProps = ViewProps;\nexport type TableRowProps = ViewProps;\nexport type TableHeadProps = ViewProps;\nexport type TableCellProps = ViewProps;\nexport type TableCaptionProps = ViewProps;\n\n// 원본과 같이 ref·className·props는 컨테이너가 아니라 표 본체（원본 <table>）에.\nconst Table = forwardRef<BridgeViewRef, TableProps>(\n  ({ className, ...props }, ref) => (\n    <View className={cn(tableContainerVariants())}>\n      <View\n        ref={ref}\n        accessibilityRole=\"table\"\n        className={cn(tableVariants(), className)}\n        {...props}\n      />\n    </View>\n  ),\n);\nTable.displayName = \"Table\";\n\nconst TableHeader = forwardRef<BridgeViewRef, TableHeaderProps>(\n  ({ className, ...props }, ref) => (\n    <View\n      ref={ref}\n      accessibilityRole=\"rowgroup\"\n      className={cn(tableHeaderVariants(), className)}\n      {...props}\n    />\n  ),\n);\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = forwardRef<BridgeViewRef, TableBodyProps>(\n  ({ className, ...props }, ref) => (\n    <View\n      ref={ref}\n      accessibilityRole=\"rowgroup\"\n      className={cn(tableBodyVariants(), className)}\n      {...props}\n    />\n  ),\n);\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = forwardRef<BridgeViewRef, TableFooterProps>(\n  ({ className, children, ...props }, ref) => (\n    <TableSectionContext.Provider value=\"footer\">\n      <View\n        ref={ref}\n        accessibilityRole=\"rowgroup\"\n        className={cn(tableFooterVariants(), className)}\n        {...props}\n      >\n        {children}\n      </View>\n    </TableSectionContext.Provider>\n  ),\n);\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = forwardRef<BridgeViewRef, TableRowProps>(\n  ({ className, ...props }, ref) => (\n    <View\n      ref={ref}\n      accessibilityRole=\"row\"\n      className={cn(tableRowVariants(), className)}\n      {...props}\n    />\n  ),\n);\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = forwardRef<BridgeViewRef, TableHeadProps>(\n  ({ className, children, ...props }, ref) => (\n    <View\n      ref={ref}\n      accessibilityRole=\"columnheader\"\n      className={cn(tableHeadVariants(), className)}\n      {...props}\n    >\n      <Text className={cn(tableHeadTextVariants())}>{children}</Text>\n    </View>\n  ),\n);\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = forwardRef<BridgeViewRef, TableCellProps>(\n  ({ className, children, ...props }, ref) => {\n    // 푸터 안 셀은 굵게 — 원본 font-medium 상속을 이중 지정으로 재현（사소 4）.\n    const inFooter = useContext(TableSectionContext) === \"footer\";\n    return (\n      <View\n        ref={ref}\n        accessibilityRole=\"cell\"\n        className={cn(tableCellVariants(), className)}\n        {...props}\n      >\n        <Text className={cn(tableCellTextVariants(), inFooter && \"font-medium\")}>\n          {children}\n        </Text>\n      </View>\n    );\n  },\n);\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = forwardRef<BridgeViewRef, TableCaptionProps>(\n  ({ className, children, ...props }, ref) => (\n    <View\n      ref={ref}\n      className={cn(tableCaptionVariants(), className)}\n      {...props}\n    >\n      <Text className={cn(tableCaptionTextVariants())}>{children}</Text>\n    </View>\n  ),\n);\nTableCaption.displayName = \"TableCaption\";\n\nexport {\n  Table,\n  TableHeader,\n  TableBody,\n  TableFooter,\n  TableRow,\n  TableHead,\n  TableCell,\n  TableCaption,\n  tableContainerVariants,\n  tableVariants,\n  tableHeaderVariants,\n  tableBodyVariants,\n  tableFooterVariants,\n  tableRowVariants,\n  tableHeadVariants,\n  tableHeadTextVariants,\n  tableCellVariants,\n  tableCellTextVariants,\n  tableCaptionVariants,\n  tableCaptionTextVariants,\n};\n",
      "type": "registry:ui",
      "target": "components/unikit/table.tsx"
    }
  ],
  "type": "registry:ui"
}
