@theguild/components
Version:
44 lines (43 loc) • 1.21 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import { cn } from "@theguild/components";
const Table = ({ className, ...props }) => {
return /* @__PURE__ */ jsx(
"table",
{
className: cn(
"x:block x:overflow-x-auto nextra-scrollbar overflow-x-auto rounded-2xl border border-green-200",
className
),
...props
}
);
};
const TableRow = ({
highlight,
className,
...props
}) => {
return /* @__PURE__ */ jsx("tr", { className: cn(highlight && "bg-green-100", className), ...props });
};
const cellStyle = cn(
"border border-green-200 p-4 first:border-l-0 last:border-r-0",
"[tbody_&]:border-b-0 [thead_&]:border-t-0",
"first:sticky",
"first:left-0",
"max-sm:first:drop-shadow-2xl",
"first:bg-[rgb(var(--nextra-bg))]"
);
const TableHeader = ({ className, ...props }) => {
return /* @__PURE__ */ jsx("th", { className: cn(cellStyle, "font-medium", className), ...props });
};
const TableCell = ({ className, ...props }) => {
return /* @__PURE__ */ jsx("td", { className: cn(cellStyle, className), ...props });
};
const ComparisonTable = Object.assign(Table, {
Row: TableRow,
Header: TableHeader,
Cell: TableCell
});
export {
ComparisonTable
};