laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
112 lines (111 loc) • 2.37 kB
JavaScript
"use client";
import { jsx as r } from "react/jsx-runtime";
import { cn as o } from "../../lib/utils.js";
function l({ className: e, ...t }) {
return /* @__PURE__ */ r(
"table",
{
"data-slot": "table-container",
className: o(
"relative w-full caption-bottom overflow-x-auto text-sm",
e
),
...t
}
);
}
function b({ className: e, ...t }) {
return /* @__PURE__ */ r(
"thead",
{
"data-slot": "table-header",
className: o("border-d-border [&_tr]:border-b", e),
...t
}
);
}
function n({ className: e, ...t }) {
return /* @__PURE__ */ r(
"tbody",
{
"data-slot": "table-body",
className: o("border-d-border [&_tr:last-child]:border-0", e),
...t
}
);
}
function s({ className: e, ...t }) {
return /* @__PURE__ */ r(
"tfoot",
{
"data-slot": "table-footer",
className: o(
"bg-d-secondary/50 border-d-border border-t font-medium [&>tr]:last:border-b-0",
e
),
...t
}
);
}
function c({ className: e, ...t }) {
return /* @__PURE__ */ r(
"tr",
{
"data-slot": "table-row",
className: o(
"hover:bg-d-secondary/50 data-[state=selected]:bg-d-secondary border-d-border border-b transition-colors",
e
),
...t
}
);
}
function i({ className: e, ...t }) {
return /* @__PURE__ */ r(
"th",
{
"data-slot": "table-head",
className: o(
"text-d-foreground border-d-border h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
e
),
...t
}
);
}
function u({ className: e, ...t }) {
return /* @__PURE__ */ r(
"td",
{
"data-slot": "table-cell",
className: o(
"border-d-border/50 border p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
e
),
...t
}
);
}
function m({
className: e,
...t
}) {
return /* @__PURE__ */ r(
"caption",
{
"data-slot": "table-caption",
className: o("text-d-secondary-foreground mt-4 text-sm", e),
...t
}
);
}
export {
l as Table,
n as TableBody,
m as TableCaption,
u as TableCell,
s as TableFooter,
i as TableHead,
b as TableHeader,
c as TableRow
};