import { styled } from "goober"; import React from "react"; const StyledTable = styled("table")` width: 100%; `; const StyledThead = styled("thead")` text-align: left; border-bottom: 1px solid var(--j-border-color); background-color: var(--j-neutral-100); @media (prefers-color-scheme: dark) { background-color: var(--j-neutral-925); } `; const StyledTbody = styled("tbody")` tr { border-bottom: 1px solid var(--j-border-color); &:last-child { border-bottom: none; } } `; const StyledTh = styled("th")` font-weight: 500; padding: 0.5rem 0.75rem; color: var(--j-text-color-strong); `; const StyledTd = styled("td")` padding: 0.5rem 0.75rem; `; export const Table = React.forwardRef< HTMLTableElement, React.HTMLAttributes >(({ children, ...props }, ref) => ( {children} )); export const TableHead = React.forwardRef< HTMLTableSectionElement, React.HTMLAttributes >(({ children, ...props }, ref) => ( {children} )); export const TableBody = React.forwardRef< HTMLTableSectionElement, React.HTMLAttributes >(({ children, ...props }, ref) => ( {children} )); export const TableRow = React.forwardRef< HTMLTableRowElement, React.HTMLAttributes >(({ children, ...props }, ref) => ( {children} )); export const TableHeader = React.forwardRef< HTMLTableCellElement, React.ThHTMLAttributes >(({ children, ...props }, ref) => ( {children} )); export const TableCell = React.forwardRef< HTMLTableCellElement, React.TdHTMLAttributes >(({ children, ...props }, ref) => ( {children} ));