koval-ui
Version:
React components collection with minimalistic design. Supports theming, layout, and input validation.
45 lines (44 loc) • 1.13 kB
JavaScript
"use client";
import { jsx as i } from "react/jsx-runtime";
import { forwardRef as u, useMemo as n } from "react";
import { useLocalTheme as R } from "css-vars-hook";
import b from "classnames";
import { useLinkRefs as d } from "../../internal/hooks/useLinkRefs.js";
import e from "./DataTable.module.css.js";
const C = u(
({ children: r, isPinned: o, leftMargin: l, rightMargin: m, classname: a, as: t = "th", isHighlighted: s = !1 }, f) => {
const { LocalRoot: c, ref: p } = R();
d(f, p);
const h = n(
() => ({
...l && { "left-margin": l },
...m && { "right-margin": m }
}),
[l, m]
);
return /* @__PURE__ */ i(
c,
{
theme: h,
as: t,
className: b(
e.tableCell,
{
[e.highlighted]: s,
[e.pinned]: !!o,
[e.pinnedHeader]: !!o && t === "th",
[e.left]: o === "left",
[e.right]: o === "right"
},
a
),
children: r
}
);
}
);
C.displayName = "TableCell";
export {
C as TableCell
};
//# sourceMappingURL=TableCell.js.map