import { jsx } from "react/jsx-runtime";
import * as React from "react";
import { cn } from "../../../lib/utils.js";
import { typographyColorVariants, textVariants } from "../../../lib/variants.js";
const lineClampClasses = {
  1: "line-clamp-1",
  2: "line-clamp-2",
  3: "line-clamp-3",
  4: "line-clamp-4",
  5: "line-clamp-5",
  6: "line-clamp-6"
};
const wrapClasses = {
  pretty: "text-pretty",
  balance: "text-balance"
};
function Text({
  size,
  weight,
  color,
  align,
  transform,
  wrap,
  lineClamp,
  as,
  render,
  className,
  children,
  ...props
}) {
  const classes = cn(
    textVariants({ size, weight, align, transform }),
    typographyColorVariants({ color }),
    wrap && wrapClasses[wrap],
    lineClamp && lineClampClasses[lineClamp],
    className
  );
  if (render) {
    return React.cloneElement(render, {
      className: cn(classes, render.props.className),
      children,
      ...props
    });
  }
  const Component = as ?? "p";
  return /* @__PURE__ */ jsx(Component, { "data-slot": "text", className: classes, ...props, children });
}
function Caption(props) {
  return /* @__PURE__ */ jsx(Text, { size: "xs", color: "muted", ...props });
}
function Overline(props) {
  return /* @__PURE__ */ jsx(Text, { size: "xs", transform: "uppercase", ...props });
}
export {
  Caption,
  Overline,
  Text
};
//# sourceMappingURL=text.js.map
