@cerberus-design/react
Version:
The Cerberus Design React component library.
25 lines (22 loc) • 753 B
JavaScript
import { jsx, jsxs } from 'react/jsx-runtime';
import { TableTrigger, Tfoot, Td, Tr, Tbody, Th, Thead, Caption, TableRoot, TableEl } from './primitives.js';
import { Show } from '../show/show.js';
function TableRootEl(props) {
const { sticky, caption, ...rootProps } = props;
return /* @__PURE__ */ jsx(TableRoot, { ...rootProps, "data-sticky": sticky ?? false, children: /* @__PURE__ */ jsxs(TableEl, { children: [
/* @__PURE__ */ jsx(Show, { when: caption, children: /* @__PURE__ */ jsx(Caption, { children: caption }) }),
rootProps.children
] }) });
}
const Table = {
Root: TableRootEl,
Caption,
Header: Thead,
HeaderCol: Th,
Body: Tbody,
Row: Tr,
Cell: Td,
Footer: Tfoot,
Trigger: TableTrigger
};
export { Table };