"use client";
import * as React from 'react';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { jsxs, jsx } from 'react/jsx-runtime';

function cn(...inputs) {
  return twMerge(clsx(inputs));
}
function MenuGlyph({ open }) {
  return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", className: "size-5", children: open ? /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 6l12 12M18 6 6 18" }) : /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 7h16M4 12h16M4 17h16" }) });
}
function AppShell({ sidebar, header, children, className }) {
  const [open, setOpen] = React.useState(false);
  return /* @__PURE__ */ jsxs("div", { className: cn("min-h-screen bg-background", className), children: [
    open ? /* @__PURE__ */ jsxs("div", { className: "relative z-40 lg:hidden", children: [
      /* @__PURE__ */ jsx(
        "button",
        {
          type: "button",
          "aria-label": "Close menu",
          className: "fixed inset-0 bg-foreground/40",
          onClick: () => setOpen(false)
        }
      ),
      /* @__PURE__ */ jsx("aside", { className: "fixed inset-y-0 left-0 flex w-64 flex-col border-r border-border bg-card", children: sidebar })
    ] }) : null,
    /* @__PURE__ */ jsx("aside", { className: "hidden border-r border-border bg-card lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col", children: sidebar }),
    /* @__PURE__ */ jsxs("div", { className: "lg:pl-64", children: [
      /* @__PURE__ */ jsxs("header", { className: "sticky top-0 z-30 flex h-16 items-center gap-4 border-b border-border bg-background/95 px-4 backdrop-blur sm:px-6", children: [
        /* @__PURE__ */ jsx(
          "button",
          {
            type: "button",
            className: "inline-flex items-center justify-center rounded-md p-2 text-foreground transition-all duration-[var(--duration-normal,200ms)] ease-out hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 lg:hidden",
            "aria-label": "Open menu",
            "aria-expanded": open,
            onClick: () => setOpen(true),
            children: /* @__PURE__ */ jsx(MenuGlyph, { open: false })
          }
        ),
        /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center justify-between gap-4", children: header })
      ] }),
      /* @__PURE__ */ jsx("main", { className: "p-4 sm:p-6 lg:p-8", children })
    ] })
  ] });
}

export { AppShell };
//# sourceMappingURL=app-shell.js.map
//# sourceMappingURL=app-shell.js.map