{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "primitive-accordion-collapse",
  "type": "registry:ui",
  "title": "Accordion / Collapse",
  "description": "Coordinate height, opacity, and icon state for clear disclosure transitions.",
  "dependencies": [
    "motion"
  ],
  "categories": [
    "primitive",
    "state-transitions"
  ],
  "docs": "https://motion-lexicon.pages.dev/en/primitives/accordion-collapse/",
  "files": [
    {
      "path": "src/registry/primitives/accordion-collapse.tsx",
      "type": "registry:ui",
      "target": "components/motion-lexicon/primitives/accordion-collapse.tsx",
      "content": "\"use client\";\n\nimport { AnimatePresence, motion, useReducedMotion, type Transition } from \"motion/react\";\nimport type { ReactNode } from \"react\";\n\nconst EASE_OUT = [0.23, 1, 0.32, 1] as const;\n\nexport type AccordionCollapsePrimitiveProps = {\n  open: boolean;\n  children: ReactNode;\n  duration?: number;\n  easing?: Transition[\"ease\"];\n  maxHeight?: number;\n  className?: string;\n};\n\nexport function AccordionCollapsePrimitive({\n  open,\n  children,\n  duration = 0.22,\n  easing = EASE_OUT,\n  maxHeight = 320,\n  className,\n}: AccordionCollapsePrimitiveProps) {\n  const reduceMotion = useReducedMotion();\n\n  return (\n    <AnimatePresence initial={false}>\n      {open ? (\n        <motion.div\n          className={className}\n          style={{ overflow: \"hidden\", maxHeight }}\n          initial={reduceMotion ? false : { height: 0, opacity: 0 }}\n          animate={{ height: \"auto\", opacity: 1 }}\n          exit={reduceMotion ? { height: \"auto\", opacity: 1 } : { height: 0, opacity: 0 }}\n          transition={reduceMotion ? { duration: 0 } : { duration, ease: easing }}\n        >\n          {children}\n        </motion.div>\n      ) : null}\n    </AnimatePresence>\n  );\n}\n"
    }
  ]
}
