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

// src/lib/utils.ts
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
var COLUMN_CLASS = {
  two: "sm:grid-cols-2",
  three: "sm:grid-cols-2 lg:grid-cols-3"
};
function CardBody({ item }) {
  return /* @__PURE__ */ jsxs(Fragment, { children: [
    item.leading ? /* @__PURE__ */ jsx("div", { className: "flex-none", children: item.leading }) : null,
    /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-1", children: [
      /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-foreground", children: item.title }),
      item.meta ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: item.meta }) : null,
      item.description ? /* @__PURE__ */ jsx("p", { className: "text-pretty text-sm text-muted-foreground", children: item.description }) : null
    ] }),
    item.actions ? /* @__PURE__ */ jsx("div", { className: "mt-auto flex items-center gap-2 pt-2", children: item.actions }) : null
  ] });
}
function AppGridList({
  items,
  eyebrow,
  title,
  description,
  columns = "three",
  className
}) {
  const hasHeading = Boolean(eyebrow || title || description);
  return /* @__PURE__ */ jsxs("section", { className: cn("flex flex-col gap-4", className), children: [
    hasHeading ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
      eyebrow ? /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: eyebrow }) : null,
      title ? /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-foreground", children: title }) : null,
      description ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null
    ] }) : null,
    /* @__PURE__ */ jsx("div", { className: cn("grid grid-cols-1 gap-4", COLUMN_CLASS[columns]), children: items.map(
      (item, index) => item.href ? /* @__PURE__ */ jsx(
        "a",
        {
          href: item.href,
          className: "flex flex-col gap-3 rounded-xl border border-border bg-card p-4 text-card-foreground shadow-sm transition-all duration-[var(--duration-normal,200ms)] ease-out hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
          children: /* @__PURE__ */ jsx(CardBody, { item })
        },
        index
      ) : /* @__PURE__ */ jsx(
        "article",
        {
          className: "flex flex-col gap-3 rounded-xl border border-border bg-card p-4 text-card-foreground shadow-sm",
          children: /* @__PURE__ */ jsx(CardBody, { item })
        },
        index
      )
    ) })
  ] });
}

export { AppGridList };
//# sourceMappingURL=app-grid-list.js.map
//# sourceMappingURL=app-grid-list.js.map