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));
}
function RowBody({ item }) {
  return /* @__PURE__ */ jsxs(Fragment, { children: [
    item.leading ? /* @__PURE__ */ jsx("div", { className: "flex-none", children: item.leading }) : null,
    /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
      /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
        /* @__PURE__ */ jsx("h3", { className: "truncate text-sm font-medium text-foreground", children: item.title }),
        item.meta ? /* @__PURE__ */ jsx("span", { className: "flex-none text-xs text-muted-foreground", children: item.meta }) : null
      ] }),
      item.description ? /* @__PURE__ */ jsx("p", { className: "truncate text-sm text-muted-foreground", children: item.description }) : null
    ] }),
    item.actions ? /* @__PURE__ */ jsx("div", { className: "flex-none", children: item.actions }) : null
  ] });
}
function AppStackedList({
  items,
  eyebrow,
  title,
  description,
  divided = true,
  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(
      "ul",
      {
        className: cn(
          "flex flex-col overflow-hidden rounded-xl border border-border bg-card",
          divided && "divide-y divide-border"
        ),
        children: items.map(
          (item, index) => item.href ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
            "a",
            {
              href: item.href,
              className: "flex items-center gap-4 px-4 py-3 text-card-foreground 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 focus-visible:ring-inset",
              children: /* @__PURE__ */ jsx(RowBody, { item })
            }
          ) }, index) : /* @__PURE__ */ jsx(
            "li",
            {
              className: "flex items-center gap-4 px-4 py-3 text-card-foreground",
              children: /* @__PURE__ */ jsx(RowBody, { item })
            },
            index
          )
        )
      }
    )
  ] });
}

export { AppStackedList };
//# sourceMappingURL=app-stacked-list.js.map
//# sourceMappingURL=app-stacked-list.js.map