{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "primitive-spring",
  "type": "registry:ui",
  "title": "Spring",
  "description": "Tune a physical spring response with stiffness, damping, mass, and initial velocity.",
  "dependencies": [
    "motion"
  ],
  "categories": [
    "primitive",
    "springs"
  ],
  "docs": "https://motion-lexicon.pages.dev/en/primitives/spring/",
  "files": [
    {
      "path": "src/registry/primitives/spring.tsx",
      "type": "registry:ui",
      "target": "components/motion-lexicon/primitives/spring.tsx",
      "content": "\"use client\";\n\nimport { motion, useReducedMotion } from \"motion/react\";\nimport type { ReactNode } from \"react\";\n\nexport type SpringPrimitiveProps = {\n  active: boolean;\n  children: ReactNode;\n  distance?: number;\n  stiffness?: number;\n  damping?: number;\n  mass?: number;\n  velocity?: number;\n  className?: string;\n};\n\nexport function SpringPrimitive({\n  active,\n  children,\n  distance = 48,\n  stiffness = 220,\n  damping = 24,\n  mass = 1,\n  velocity = 0,\n  className,\n}: SpringPrimitiveProps) {\n  const reduceMotion = useReducedMotion();\n\n  return (\n    <motion.div\n      className={className}\n      initial={false}\n      animate={{ transform: reduceMotion || !active ? \"translate3d(0, 0, 0)\" : `translate3d(${distance}px, 0, 0)` }}\n      transition={reduceMotion ? { duration: 0.12 } : { type: \"spring\", stiffness, damping, mass, velocity }}\n    >\n      {children}\n    </motion.div>\n  );\n}\n"
    }
  ]
}
