laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
112 lines (111 loc) • 2.35 kB
JavaScript
"use client";
import { jsx as r } from "react/jsx-runtime";
import { cn as a } from "../../lib/utils.js";
function d({ className: e, ...t }) {
return /* @__PURE__ */ r(
"table",
{
"data-slot": "table-container",
className: a(
"relative w-full caption-bottom overflow-x-auto text-sm",
e
),
...t
}
);
}
function n({ className: e, ...t }) {
return /* @__PURE__ */ r(
"thead",
{
"data-slot": "table-header",
className: a("border-d-border [&_tr]:border-b", e),
...t
}
);
}
function b({ className: e, ...t }) {
return /* @__PURE__ */ r(
"tbody",
{
"data-slot": "table-body",
className: a("border-d-border [&_tr:last-child]:border-0", e),
...t
}
);
}
function s({ className: e, ...t }) {
return /* @__PURE__ */ r(
"tfoot",
{
"data-slot": "table-footer",
className: a(
"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: a(
"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: a(
"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: a(
"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: a("text-d-secondary-foreground mt-4 text-sm", e),
...t
}
);
}
export {
d as Table,
b as TableBody,
m as TableCaption,
u as TableCell,
s as TableFooter,
i as TableHead,
n as TableHeader,
c as TableRow
};