{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "piano",
  "type": "registry:ui",
  "addGlobalCss": false,
  "registryDependencies": [],
  "dependencies": [
    "motion"
  ],
  "devDependencies": [],
  "files": [
    {
      "path": "piano-icon.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport type { Variants } from \"motion/react\";\nimport {\n LazyMotion,\n domMin,\n m,\n useAnimation,\n useReducedMotion,\n} from \"motion/react\";\nimport {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useRef,\n type HTMLAttributes,\n} from \"react\";\n\nexport interface PianoIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\ninterface PianoIconProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n | \"color\"\n | \"onDrag\"\n | \"onDragStart\"\n | \"onDragEnd\"\n | \"onAnimationStart\"\n | \"onAnimationEnd\"\n | \"onAnimationIteration\"\n> {\n size?: number;\n duration?: number;\n isAnimated?: boolean;\n color?: string;\n}\n\nconst PianoIcon = forwardRef<PianoIconHandle, PianoIconProps>(\n (\n  {\n   onMouseEnter,\n   onMouseLeave,\n   className,\n   size = 24,\n   duration = 1,\n   isAnimated = true,\n   color,\n   ...props\n  },\n  ref,\n ) => {\n  const keyControls = useAnimation();\n  const reduced = useReducedMotion();\n  const isControlled = useRef(false);\n\n  const start = useCallback(() => {\n   keyControls.start(reduced ? \"normal\" : \"animate\");\n  }, [keyControls, reduced]);\n\n  const stop = useCallback(() => {\n   keyControls.start(\"normal\");\n  }, [keyControls]);\n\n  useImperativeHandle(ref, () => {\n   isControlled.current = true;\n   return {\n    startAnimation: start,\n    stopAnimation: stop,\n   };\n  });\n\n  const handleEnter = useCallback(\n   (e?: React.MouseEvent<HTMLDivElement>) => {\n    if (!isAnimated || reduced) return;\n    if (!isControlled.current) start();\n    else onMouseEnter?.(e as any);\n   },\n   [isAnimated, reduced, start, onMouseEnter],\n  );\n\n  const handleLeave = useCallback(\n   (e: React.MouseEvent<HTMLDivElement>) => {\n    if (!isControlled.current) stop();\n    else onMouseLeave?.(e);\n   },\n   [stop, onMouseLeave],\n  );\n\n  const keyVariants = (i: number): Variants => ({\n   normal: { scaleY: 1 },\n   animate: {\n    scaleY: [1, 1.22, 1],\n    transition: {\n     duration: 0.8 * duration,\n     ease: \"easeInOut\",\n     delay: i * 0.12 * duration,\n    },\n   },\n  });\n\n  return (\n   <LazyMotion features={domMin} strict>\n    <m.div\n     className={cn(\"inline-flex items-center justify-center\", className)}\n     onMouseEnter={handleEnter}\n     onMouseLeave={handleLeave}\n     {...props}\n     style={{ color, ...props.style }}\n    >\n     <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width={size}\n      height={size}\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth={2}\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n     >\n      <path d=\"M18.5 8c-1.4 0-2.6-.8-3.2-2A6.87 6.87 0 0 0 2 9v11a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-8.5C22 9.6 20.4 8 18.5 8\" />\n      <path d=\"M2 14h20\" />\n      <m.path\n       d=\"M6 14v4\"\n       animate={keyControls}\n       initial=\"normal\"\n       variants={keyVariants(0)}\n       style={{ transformBox: \"fill-box\", originX: \"50%\", originY: \"0%\" }}\n      />\n      <m.path\n       d=\"M10 14v4\"\n       animate={keyControls}\n       initial=\"normal\"\n       variants={keyVariants(1)}\n       style={{ transformBox: \"fill-box\", originX: \"50%\", originY: \"0%\" }}\n      />\n      <m.path\n       d=\"M14 14v4\"\n       animate={keyControls}\n       initial=\"normal\"\n       variants={keyVariants(2)}\n       style={{ transformBox: \"fill-box\", originX: \"50%\", originY: \"0%\" }}\n      />\n      <m.path\n       d=\"M18 14v4\"\n       animate={keyControls}\n       initial=\"normal\"\n       variants={keyVariants(3)}\n       style={{ transformBox: \"fill-box\", originX: \"50%\", originY: \"0%\" }}\n      />\n     </svg>\n    </m.div>\n   </LazyMotion>\n  );\n },\n);\n\nPianoIcon.displayName = \"PianoIcon\";\nexport { PianoIcon };\n",
      "type": "registry:ui"
    }
  ]
}