import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { jsxs, jsx } from 'react/jsx-runtime';

// src/lib/utils.ts
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
function CommercePromo({
  title,
  description,
  actions,
  media,
  eyebrow,
  variant = "image-right",
  className
}) {
  const copy = /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-4", variant === "overlay" && "text-primary-foreground"), children: [
    eyebrow ? /* @__PURE__ */ jsx(
      "p",
      {
        className: cn(
          "text-sm font-semibold uppercase tracking-wide",
          variant === "overlay" ? "text-primary-foreground/80" : "text-primary"
        ),
        children: eyebrow
      }
    ) : null,
    /* @__PURE__ */ jsx(
      "h2",
      {
        className: cn(
          "text-balance text-3xl font-semibold tracking-tight sm:text-4xl",
          variant === "overlay" ? "text-primary-foreground" : "text-foreground"
        ),
        children: title
      }
    ),
    description ? /* @__PURE__ */ jsx(
      "p",
      {
        className: cn(
          "max-w-xl text-pretty text-base",
          variant === "overlay" ? "text-primary-foreground/80" : "text-muted-foreground"
        ),
        children: description
      }
    ) : null,
    actions ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-3", children: actions }) : null
  ] });
  if (variant === "overlay") {
    return /* @__PURE__ */ jsx("section", { className: cn("bg-background py-16 sm:py-20", className), children: /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-7xl px-6 lg:px-8", children: /* @__PURE__ */ jsxs("div", { className: "relative overflow-hidden rounded-3xl bg-primary [&_img]:absolute [&_img]:inset-0 [&_img]:size-full [&_img]:object-cover [&_img]:opacity-50", children: [
      media ? /* @__PURE__ */ jsx("div", { className: "absolute inset-0", children: media }) : null,
      /* @__PURE__ */ jsx("div", { className: "relative px-6 py-16 sm:px-12 sm:py-20", children: copy })
    ] }) }) });
  }
  return /* @__PURE__ */ jsx("section", { className: cn("bg-background py-16 sm:py-20", className), children: /* @__PURE__ */ jsxs("div", { className: "mx-auto grid max-w-7xl items-center gap-10 px-6 lg:grid-cols-2 lg:gap-16 lg:px-8", children: [
    variant === "image-left" && media ? /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-2xl bg-muted [&_img]:size-full [&_img]:object-cover", children: media }) : null,
    copy,
    variant === "image-right" && media ? /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-2xl bg-muted [&_img]:size-full [&_img]:object-cover", children: media }) : null
  ] }) });
}

export { CommercePromo };
//# sourceMappingURL=commerce-promo.js.map
//# sourceMappingURL=commerce-promo.js.map