{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"drop-nav","type":"registry:ui","title":"Drop Nav","description":"A compact navbar that springs open downward into a row of colorful link cards.","dependencies":["motion","lucide-react"],"registryDependencies":[],"files":[{"path":"registry/ui/drop-nav.tsx","type":"registry:ui","content":"\"use client\";\n\nimport { useId, useState, type ReactNode } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { ArrowUpRight } from \"lucide-react\";\n\nexport interface DropNavLink {\n  label: string;\n  href: string;\n}\n\nexport interface DropNavItem {\n  label: string;\n  links: DropNavLink[];\n  /** Card background. */\n  bgColor?: string;\n  /** Card text color. */\n  textColor?: string;\n}\n\nexport interface DropNavProps {\n  items: DropNavItem[];\n  logo?: ReactNode;\n  /** Label of the call-to-action button. Empty hides it. */\n  ctaLabel?: string;\n  ctaHref?: string;\n  /** Height of the closed bar in px. */\n  barHeight?: number;\n  /** Seconds between cards sliding in. */\n  stagger?: number;\n  /** Expanded height of the card row in px. */\n  cardHeight?: number;\n  /** Start expanded. */\n  defaultOpen?: boolean;\n  className?: string;\n}\n\nexport function DropNav({\n  items,\n  logo = \"logo\",\n  ctaLabel = \"Get started\",\n  ctaHref = \"#\",\n  barHeight = 60,\n  stagger = 0.08,\n  cardHeight = 200,\n  defaultOpen = false,\n  className,\n}: DropNavProps) {\n  const [open, setOpen] = useState(defaultOpen);\n  const reduce = useReducedMotion();\n  const id = useId();\n  const spring = reduce ? { duration: 0 } : { type: \"spring\" as const, stiffness: 260, damping: 30 };\n\n  return (\n    <motion.nav\n      aria-label=\"Main\"\n      className={`w-full overflow-hidden rounded-2xl border border-border bg-card/90 shadow-[0_20px_50px_-20px_rgba(0,0,0,.6)] backdrop-blur-xl ${className ?? \"\"}`}\n      initial={false}\n      animate={{ height: open ? \"auto\" : barHeight }}\n      transition={spring}\n      onKeyDown={(e) => e.key === \"Escape\" && setOpen(false)}\n    >\n      <div className=\"relative flex items-center justify-between px-2\" style={{ height: barHeight }}>\n        <button\n          type=\"button\"\n          aria-expanded={open}\n          aria-controls={id}\n          aria-label={open ? \"Close menu\" : \"Open menu\"}\n          onClick={() => setOpen((o) => !o)}\n          className=\"group relative grid size-11 place-items-center rounded-xl text-foreground outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring\"\n        >\n          {[-1, 1].map((s) => (\n            <motion.span\n              key={s}\n              aria-hidden\n              className=\"absolute h-[2px] w-5 rounded-full bg-current\"\n              initial={false}\n              animate={open ? { y: 0, rotate: s * 45 } : { y: s * 3.5, rotate: 0 }}\n              transition={{ type: \"spring\", stiffness: 400, damping: 24 }}\n            />\n          ))}\n        </button>\n        <div className=\"absolute left-1/2 -translate-x-1/2 text-lg font-semibold tracking-tight text-foreground\">{logo}</div>\n        {ctaLabel ? (\n          <a\n            href={ctaHref}\n            className=\"hidden h-11 items-center rounded-xl bg-foreground px-4 text-sm font-medium text-background outline-none transition-opacity hover:opacity-85 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card sm:flex\"\n          >\n            {ctaLabel}\n          </a>\n        ) : (\n          <span className=\"size-11\" />\n        )}\n      </div>\n\n      <AnimatePresence initial={false}>\n        {open && (\n          <motion.ul id={id} className=\"grid gap-2 p-2 pt-0 sm:auto-cols-fr sm:grid-flow-col\" exit={{ opacity: 0, transition: { duration: 0.15 } }}>\n            {items.map((item, i) => (\n              <motion.li\n                key={item.label}\n                className=\"flex flex-col justify-between gap-6 rounded-xl p-4\"\n                style={{ background: item.bgColor ?? \"var(--muted)\", color: item.textColor ?? \"var(--foreground)\", minHeight: cardHeight }}\n                initial={reduce ? false : { opacity: 0, y: 40, scale: 0.96 }}\n                animate={{ opacity: 1, y: 0, scale: 1 }}\n                transition={{ type: \"spring\", stiffness: 300, damping: 26, delay: 0.05 + i * stagger }}\n              >\n                <p className=\"text-2xl font-medium tracking-tight\">{item.label}</p>\n                <ul className=\"flex flex-col gap-1\">\n                  {item.links.map((link) => (\n                    <li key={link.label}>\n                      <a\n                        href={link.href}\n                        className=\"group inline-flex items-center gap-1 rounded text-[15px] opacity-85 outline-none transition-opacity hover:opacity-100 focus-visible:underline focus-visible:opacity-100\"\n                      >\n                        <ArrowUpRight aria-hidden className=\"size-4 transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5\" />\n                        {link.label}\n                      </a>\n                    </li>\n                  ))}\n                </ul>\n              </motion.li>\n            ))}\n          </motion.ul>\n        )}\n      </AnimatePresence>\n    </motion.nav>\n  );\n}\n"}]}