{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"hamburger-menu-with-full-width-dropdown-panel","type":"registry:component","title":"Hamburger Menu With Full-Width Dropdown Panel","description":"","dependencies":[],"files":[{"path":"components/we-inc/hamburger-menu-with-full-width-dropdown-panel.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\n\n// Columns shown in the dropdown panel. Edit titles and links here.\nconst columns = [\n  { title: \"Shop\", links: [\"Mugs and cups\", \"Plates and bowls\", \"Vases\", \"Seconds sale\"] },\n  { title: \"Studio\", links: [\"Book a wheel class\", \"Commissions\", \"Our glazes\"] },\n  { title: \"Help\", links: [\"Delivery\", \"Returns\", \"Care guide\"] },\n];\n\nexport default function HamburgerMenuWithFullWidthDropdownPanel() {\n  const [open, setOpen] = useState(true);\n  const button = useRef<HTMLButtonElement>(null);\n\n  useEffect(() => {\n    if (!open) return;\n    const onKey = (e: KeyboardEvent) => {\n      if (e.key === \"Escape\") {\n        setOpen(false);\n        button.current?.focus();\n      }\n    };\n    document.addEventListener(\"keydown\", onKey);\n    return () => document.removeEventListener(\"keydown\", onKey);\n  }, [open]);\n\n  const line = \"absolute left-0 h-[2px] rounded-full bg-current transition-all duration-300 motion-reduce:transition-none\";\n\n  return (\n    <div className=\"bg-stone-100 px-4 py-10 sm:px-8\">\n      <div className=\"relative mx-auto h-[500px] max-w-5xl overflow-hidden rounded-xl bg-[#faf7f2] ring-1 ring-stone-300/60\">\n        <header className=\"relative z-10 flex h-16 items-center gap-3 border-b border-stone-200 bg-[#faf7f2] px-4 sm:px-6\">\n          <button\n            ref={button}\n            type=\"button\"\n            aria-expanded={open}\n            aria-controls=\"hmf-panel\"\n            onClick={() => setOpen((v) => !v)}\n            className=\"flex h-11 items-center gap-3 rounded-md px-2 text-sm font-medium text-stone-900 hover:bg-stone-200/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-700\"\n          >\n            <span className=\"relative block h-4 w-5\" aria-hidden=\"true\">\n              <span className={`${line} top-0 w-5 ${open ? \"top-[7px] rotate-45\" : \"\"}`} />\n              <span className={`${line} top-[7px] ${open ? \"w-0 opacity-0\" : \"w-3.5\"}`} />\n              <span className={`${line} top-[14px] w-5 ${open ? \"top-[7px] -rotate-45\" : \"\"}`} />\n            </span>\n            <span>{open ? \"Close\" : \"Menu\"}</span>\n          </button>\n          <a href=\"#\" className=\"mx-auto rounded font-serif text-xl tracking-tight text-stone-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-700\">Copper &amp; Clay</a>\n          <a href=\"#\" className=\"flex h-11 items-center rounded-md px-2 text-sm font-medium text-stone-900 hover:bg-stone-200/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-700\">Bag (2)</a>\n        </header>\n\n        <div className=\"px-6 pt-16 text-center\">\n          <h2 className=\"font-serif text-4xl text-stone-900\">Autumn glazes are in</h2>\n          <p className=\"mt-3 text-stone-600\">Thrown by hand in a small studio by the river.</p>\n        </div>\n\n        <div\n          id=\"hmf-panel\"\n          className={`absolute inset-x-0 top-16 max-h-[calc(100%-4rem)] overflow-y-auto border-b border-stone-200 bg-white shadow-lg transition duration-300 ease-out motion-reduce:transition-none ${open ? \"visible translate-y-0 opacity-100\" : \"invisible -translate-y-3 opacity-0\"}`}\n        >\n          <nav aria-label=\"Main\" className=\"grid grid-cols-2 gap-x-6 gap-y-8 px-6 py-8 sm:grid-cols-[1fr_1fr_1fr_1.2fr]\">\n            {columns.map((c) => (\n              <div key={c.title}>\n                <p className=\"text-xs font-semibold uppercase tracking-widest text-rose-800\">{c.title}</p>\n                <ul className=\"mt-3 space-y-1\">\n                  {c.links.map((l) => (\n                    <li key={l}>\n                      <a href=\"#\" className=\"block rounded py-1.5 text-[15px] text-stone-800 hover:text-rose-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-700\">{l}</a>\n                    </li>\n                  ))}\n                </ul>\n              </div>\n            ))}\n            <a href=\"#\" className=\"group hidden flex-col justify-end rounded-lg bg-gradient-to-br from-rose-200 via-orange-100 to-amber-100 p-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-rose-700 sm:flex\">\n              <span className=\"text-xs font-semibold uppercase tracking-widest text-rose-900\">New</span>\n              <span className=\"mt-1 font-serif text-xl text-stone-900\">Ember speckle collection</span>\n              <span className=\"mt-1 text-sm text-stone-700 group-hover:underline\">Shop the range</span>\n            </a>\n          </nav>\n        </div>\n      </div>\n    </div>\n  );\n}\n"}]}
