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 CommerceCategoryFilters({
  groups,
  title,
  actions,
  className
}) {
  return /* @__PURE__ */ jsxs("aside", { className: cn("flex flex-col gap-2", className), "aria-label": "Filters", children: [
    title || actions ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 pb-2", children: [
      title ? /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold text-foreground", children: title }) : null,
      actions ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: actions }) : null
    ] }) : null,
    /* @__PURE__ */ jsx("div", { className: "flex flex-col divide-y divide-border border-y border-border", children: groups.map((group, index) => /* @__PURE__ */ jsxs(
      "details",
      {
        open: group.defaultOpen ?? true,
        className: "group flex flex-col py-3 [&[open]_svg]:rotate-180",
        children: [
          /* @__PURE__ */ jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between text-sm font-medium text-foreground", children: [
            group.title,
            /* @__PURE__ */ jsx(
              "svg",
              {
                viewBox: "0 0 20 20",
                fill: "currentColor",
                "aria-hidden": "true",
                className: "size-4 text-muted-foreground transition-transform duration-200 ease-out",
                children: /* @__PURE__ */ jsx(
                  "path",
                  {
                    fillRule: "evenodd",
                    d: "M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4Z",
                    clipRule: "evenodd"
                  }
                )
              }
            )
          ] }),
          /* @__PURE__ */ jsx("div", { className: "pt-3", children: group.content })
        ]
      },
      index
    )) })
  ] });
}

export { CommerceCategoryFilters };
//# sourceMappingURL=commerce-category-filters.js.map
//# sourceMappingURL=commerce-category-filters.js.map