{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "accordion",
  "type": "registry:ui",
  "title": "Accordion",
  "author": "Rishabh Bose <https://theb0se.vercel.app/>",
  "description": "Smooth collapsible disclosure panels with spring-rotated chevron indicators, single or multiple expansion modes, and full keyboard accessibility.",
  "dependencies": [
    "framer-motion",
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/ui/accordion.tsx",
      "content": "\"use client\";\n\nimport React, { useState } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"framer-motion\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface AccordionItem {\n  id: string;\n  title: string;\n  subtitle?: string;\n  content: React.ReactNode;\n}\n\nexport interface AccordionProps {\n  /** Array of collapsible items */\n  items?: AccordionItem[];\n  /** Allow multiple items to stay open simultaneously */\n  allowMultiple?: boolean;\n  /** Default open item IDs */\n  defaultOpenIds?: string[];\n  /** Additional container class names */\n  className?: string;\n}\n\nconst DEFAULT_ITEMS: AccordionItem[] = [\n  {\n    id: \"item-1\",\n    title: \"How do I install BoseUI components?\",\n    subtitle: \"CLI & Manual Copy\",\n    content:\n      \"Run npx shadcn@latest add https://boseui.site/r/<slug>.json in your project terminal, or copy the TypeScript code directly from any component page.\",\n  },\n  {\n    id: \"item-2\",\n    title: \"Can I customize the Tailwind styles and animations?\",\n    subtitle: \"100% Source Ownership\",\n    content:\n      \"Yes. Because the source file lives directly inside your src/components/ui/ folder, you can edit every Tailwind class, Framer Motion spring parameter, or TypeScript prop.\",\n  },\n  {\n    id: \"item-3\",\n    title: \"Does it support Light Mode, Dark Mode, and Reduced Motion?\",\n    subtitle: \"Built-in Accessibility\",\n    content:\n      \"Every component is designed for high-contrast Light and Dark themes and automatically respects system prefers-reduced-motion settings.\",\n  },\n];\n\nexport function Accordion({\n  items = DEFAULT_ITEMS,\n  allowMultiple = false,\n  defaultOpenIds = [\"item-1\"],\n  className,\n}: AccordionProps) {\n  const shouldReduceMotion = useReducedMotion();\n  const [openIds, setOpenIds] = useState<string[]>(defaultOpenIds);\n\n  const toggleItem = (id: string) => {\n    setOpenIds((prev) => {\n      const isOpen = prev.includes(id);\n      if (allowMultiple) {\n        return isOpen ? prev.filter((i) => i !== id) : [...prev, id];\n      }\n      return isOpen ? [] : [id];\n    });\n  };\n\n  return (\n    <div\n      className={cn(\n        \"w-full max-w-md divide-y divide-neutral-200 overflow-hidden rounded-2xl border border-neutral-200 bg-white dark:divide-[#1F1F1F] dark:border-[#222222] dark:bg-[#0A0A0A]\",\n        className\n      )}\n    >\n      {items.map((item) => {\n        const isOpen = openIds.includes(item.id);\n        return (\n          <div key={item.id} className=\"flex flex-col\">\n            <button\n              type=\"button\"\n              aria-expanded={isOpen}\n              onClick={() => toggleItem(item.id)}\n              className=\"flex w-full cursor-pointer items-center justify-between gap-4 px-5 py-4 text-left transition-colors hover:bg-neutral-50 dark:hover:bg-[#111111]\"\n            >\n              <div className=\"min-w-0\">\n                <div className=\"text-xs font-semibold text-black dark:text-white sm:text-sm\">\n                  {item.title}\n                </div>\n                {item.subtitle && (\n                  <div className=\"mt-0.5 font-mono text-[10px] uppercase tracking-wider text-neutral-400\">\n                    {item.subtitle}\n                  </div>\n                )}\n              </div>\n\n              <motion.span\n                animate={{ rotate: isOpen ? 180 : 0 }}\n                transition={\n                  shouldReduceMotion\n                    ? { duration: 0 }\n                    : { type: \"spring\", stiffness: 360, damping: 26 }\n                }\n                className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-neutral-200 text-neutral-500 dark:border-[#262626] dark:text-neutral-400\"\n              >\n                <ChevronDown className=\"h-3.5 w-3.5\" />\n              </motion.span>\n            </button>\n\n            <AnimatePresence initial={false}>\n              {isOpen && (\n                <motion.div\n                  initial={\n                    shouldReduceMotion ? { opacity: 0 } : { height: 0, opacity: 0 }\n                  }\n                  animate={\n                    shouldReduceMotion\n                      ? { opacity: 1 }\n                      : { height: \"auto\", opacity: 1 }\n                  }\n                  exit={\n                    shouldReduceMotion ? { opacity: 0 } : { height: 0, opacity: 0 }\n                  }\n                  transition={{\n                    duration: shouldReduceMotion ? 0 : 0.22,\n                    ease: [0.22, 1, 0.36, 1],\n                  }}\n                  className=\"overflow-hidden\"\n                >\n                  <div className=\"px-5 pb-4 text-xs leading-relaxed text-neutral-600 dark:text-neutral-400\">\n                    {item.content}\n                  </div>\n                </motion.div>\n              )}\n            </AnimatePresence>\n          </div>\n        );\n      })}\n    </div>\n  );\n}\n\nexport default Accordion;\n",
      "type": "registry:ui",
      "target": "components/ui/accordion.tsx"
    },
    {
      "path": "lib/utils.ts",
      "content": "import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport async function copyToClipboard(text: string): Promise<boolean> {\n  if (typeof window === \"undefined\") return false;\n\n  try {\n    if (navigator.clipboard && window.isSecureContext) {\n      await navigator.clipboard.writeText(text);\n      return true;\n    }\n\n    const textArea = document.createElement(\"textarea\");\n    textArea.value = text;\n    textArea.style.position = \"fixed\";\n    textArea.style.left = \"-999999px\";\n    textArea.style.top = \"-999999px\";\n    document.body.appendChild(textArea);\n    textArea.focus();\n    textArea.select();\n    const succeeded = document.execCommand(\"copy\");\n    textArea.remove();\n    return succeeded;\n  } catch {\n    return false;\n  }\n}\n",
      "type": "registry:lib",
      "target": "lib/utils.ts"
    }
  ]
}
