import { cs } from "../utils/styles.js";
import { useStyleConfig } from "../core/theme.js";
import styled from "../core/styled.js";
import vui from "../core/vui.js";
import T from "../t/t.js";
import { useTableContext } from "./context.js";
import { jsx, jsxs } from "react/jsx-runtime";

//#region src/table/td.tsx
const TdBase = styled.tdBox`
  transition-duration: fast;
`;
/** Displays a cell inside Table row. */
const Td = vui((props, ref) => {
	const { className, level = 0, children, ...rest } = props;
	const styles = useStyleConfig("Table", useTableContext());
	return /* @__PURE__ */ jsxs(TdBase, {
		className: cs("vui-td", className),
		px: 2,
		ref,
		...styles.td,
		...rest,
		children: [!!level && /* @__PURE__ */ jsx(T, {
			mr: 1,
			children: Array.from({ length: level }).map((_i, key) => /* @__PURE__ */ jsx(T, { children: "—" }, key))
		}), children]
	});
});
Td.displayName = "Td";

//#endregion
export { TdBase, Td as default };
globalThis.__vuiVersion__ = "4.0.0-beta.1"
//# sourceMappingURL=td.js.map