@carton-org/react-neumorphism
Version:
A React component library implementing the neumorphism design style
22 lines (21 loc) • 1.05 kB
JavaScript
import { jsx as e, jsxs as $ } from "@emotion/react/jsx-runtime";
import { withTheme as c } from "@emotion/react";
import { StyledTable as f, StyledTBody as g, StyledTr as S, StyledHeaderTd as s, StyledTd as u } from "./table.styles.js";
import a from "../Typography/Typography.js";
const j = ({
size: t = "sm",
columns: n,
data: m,
templates: l,
inset: h = !0,
tableStyle: y,
tableColumnLabelStyle: T,
tableRowValueStyle: p,
...b
}) => /* @__PURE__ */ e(f, { $inset: h, $tableStyle: y, ...b, children: /* @__PURE__ */ $(g, { $inset: h, children: [
/* @__PURE__ */ e(S, { children: n.map((r) => /* @__PURE__ */ e(s, { $size: t, children: /* @__PURE__ */ e(a, { size: t, bold: !0, labelStyle: T, children: String(r) }) }, String(r))) }),
m.map((r, d) => /* @__PURE__ */ e(S, { id: `row-${d}`, children: n.map((i, o) => /* @__PURE__ */ e(u, { $size: t, children: l && l[i] ? l[i](r, d, o) : /* @__PURE__ */ e(a, { size: t, labelStyle: p, children: String(r[i]) }) }, String(i))) }, d))
] }) }), k = c(j);
export {
k as default
};