@arolariu/components
Version:
🎨 70+ beautiful, accessible React components built on Radix UI. TypeScript-first, tree-shakeable, SSR-ready. Perfect for modern web apps, design systems & rapid prototyping. Zero config, maximum flexibility! ⚡
58 lines (57 loc) • 2.77 kB
JavaScript
"use client";
import { jsx } from "react/jsx-runtime";
import { forwardRef } from "react";
import { cn } from "../../lib/utilities.js";
const Table = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
className: "relative w-full overflow-auto",
children: /*#__PURE__*/ jsx("table", {
ref: ref,
className: cn("w-full caption-bottom text-sm", className),
...props
})
}));
Table.displayName = "Table";
const TableHeader = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("thead", {
ref: ref,
className: cn("[&_tr]:border-b", className),
...props
}));
TableHeader.displayName = "TableHeader";
const TableBody = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("tbody", {
ref: ref,
className: cn("[&_tr:last-child]:border-0", className),
...props
}));
TableBody.displayName = "TableBody";
const TableFooter = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("tfoot", {
ref: ref,
className: cn("border-t bg-neutral-100/50 font-medium dark:bg-neutral-800/50 [&>tr]:last:border-b-0", className),
...props
}));
TableFooter.displayName = "TableFooter";
const TableRow = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("tr", {
ref: ref,
className: cn("border-b transition-colors hover:bg-neutral-100/50 data-[state=selected]:bg-neutral-100 dark:hover:bg-neutral-800/50 dark:data-[state=selected]:bg-neutral-800", className),
...props
}));
TableRow.displayName = "TableRow";
const TableHead = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("th", {
ref: ref,
className: cn("h-10 px-2 text-left align-middle font-medium text-neutral-500 dark:text-neutral-400 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
...props
}));
TableHead.displayName = "TableHead";
const TableCell = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("td", {
ref: ref,
className: cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
...props
}));
TableCell.displayName = "TableCell";
const TableCaption = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("caption", {
ref: ref,
className: cn("mt-4 text-sm text-neutral-500 dark:text-neutral-400", className),
...props
}));
TableCaption.displayName = "TableCaption";
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
//# sourceMappingURL=table.js.map