{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "music-note-01",
  "title": "music-note-01",
  "description": "Animated music note icon",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "icons/music-note-01.tsx",
      "content": "'use client';\n\nimport type { Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\nimport type { HTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { useIconAnimation } from '@/lib/use-icon-animation';\nimport { cn } from '@/lib/utils';\n\nexport interface MusicNote01IconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface MusicNote01IconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\n// while you hover, the band plays: the sheet sways, the two note heads\n// pulse on alternating beats, and the small note bobs its own eighth-note\n// rhythm on top\nconst svgVariants: Variants = {\n  normal: {\n    rotate: 0,\n    translateY: 0,\n    transition: { duration: 0.35, ease: 'easeOut' },\n  },\n  animate: {\n    rotate: [0, -4, 3.5, -4, 3.5, 0],\n    translateY: [0, -0.8, 0, -0.8, 0],\n    transition: {\n      rotate: { duration: 1.8, ease: 'easeInOut', repeat: Infinity },\n      translateY: { duration: 0.9, ease: 'easeInOut', repeat: Infinity },\n    },\n  },\n};\n\n// downbeat — left head lands on 1 and 3\nconst headLeftVariants: Variants = {\n  normal: { scale: 1, transition: { duration: 0.3, ease: 'easeOut' } },\n  animate: {\n    scale: [1, 1.22, 1],\n    transition: { duration: 0.45, ease: 'easeInOut', repeat: Infinity, repeatDelay: 0.45 },\n  },\n};\n\n// backbeat — right head answers on 2 and 4\nconst headRightVariants: Variants = {\n  normal: { scale: 1, transition: { duration: 0.3, ease: 'easeOut' } },\n  animate: {\n    scale: [1, 1.22, 1],\n    transition: {\n      duration: 0.45,\n      ease: 'easeInOut',\n      repeat: Infinity,\n      repeatDelay: 0.45,\n      delay: 0.45,\n    },\n  },\n};\n\n// the little grace note noodles over the top in eighth notes\nconst smallNoteVariants: Variants = {\n  normal: {\n    rotate: 0,\n    translateY: 0,\n    transition: { duration: 0.3, ease: 'easeOut' },\n  },\n  animate: {\n    rotate: [0, -9, 7, 0],\n    translateY: [0, -1.5, 0, -0.8, 0],\n    transition: {\n      rotate: { duration: 0.9, ease: 'easeInOut', repeat: Infinity },\n      translateY: { duration: 0.9, ease: 'easeInOut', repeat: Infinity },\n    },\n  },\n};\n\n// tiny notes escape the tune, float up, and dissolve — one per bar\nconst floatNoteVariants: Variants = {\n  normal: { visibility: 'hidden', translateY: 0, rotate: 0, transition: { duration: 0.2 } },\n  animate: (i: number) => ({\n    visibility: ['hidden', 'visible', 'hidden'],\n    translateY: [1.5, -3.5],\n    rotate: [0, i === 0 ? -12 : 12],\n    transition: {\n      duration: 1.4,\n      ease: 'easeOut',\n      repeat: Infinity,\n      repeatDelay: 0.4,\n      delay: i * 0.9,\n    },\n  }),\n};\nconst generatedGeometryVariants: Variants = {\n  normal: { visibility: 'hidden', transition: { duration: 0.08 } },\n  animate: { visibility: 'visible', transition: { duration: 0.08 } },\n};\n\n\nconst MusicNote01Icon = forwardRef<MusicNote01IconHandle, MusicNote01IconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const controls = useAnimation();\n    const { handleMouseEnter, handleMouseLeave } = useIconAnimation({\n      controls,\n      loops: true,\n      onMouseEnter,\n      onMouseLeave,\n      ref,\n    });\n\n    return (\n      <div\n        className={cn(className)}\n        onMouseEnter={handleMouseEnter}\n        onMouseLeave={handleMouseLeave}\n        {...props}\n      >\n        <motion.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          overflow=\"visible\"\n          variants={svgVariants}\n          animate={controls}\n          initial=\"normal\"\n        >\n          <motion.path\n            d=\"M7 9.5C7 10.8807 5.88071 12 4.5 12C3.11929 12 2 10.8807 2 9.5C2 8.11929 3.11929 7 4.5 7C5.88071 7 7 8.11929 7 9.5ZM7 9.5V2C7.33333 2.5 7.6 4.6 10 5\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeWidth=\"1.5\"\n            variants={smallNoteVariants}\n            animate={controls}\n            initial=\"normal\"\n            style={{ transformBox: 'fill-box', transformOrigin: 'center' }}\n          />\n          <motion.circle\n            cx=\"10.5\"\n            cy=\"19.5\"\n            r=\"2.5\"\n            stroke=\"currentColor\"\n            strokeWidth=\"1.5\"\n            variants={headLeftVariants}\n            animate={controls}\n            initial=\"normal\"\n            style={{ transformBox: 'fill-box', transformOrigin: 'center' }}\n          />\n          <motion.circle\n            cx=\"20\"\n            cy=\"18\"\n            r=\"2\"\n            stroke=\"currentColor\"\n            strokeWidth=\"1.5\"\n            variants={headRightVariants}\n            animate={controls}\n            initial=\"normal\"\n            style={{ transformBox: 'fill-box', transformOrigin: 'center' }}\n          />\n          <path\n            d=\"M13 19.5L13 11C13 10.09 13 9.63502 13.2466 9.35248C13.4932 9.06993 13.9938 9.00163 14.9949 8.86504C18.0085 8.45385 20.2013 7.19797 21.3696 6.42937C21.6498 6.24509 21.7898 6.15295 21.8949 6.20961C22 6.26627 22 6.43179 22 6.76283V17.9259\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeWidth=\"1.5\"\n          />\n          <path\n            d=\"M13 13C17.8 13 21 10.6667 22 10\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeWidth=\"1.5\"\n          />\n          <motion.g\n            variants={generatedGeometryVariants}\n            animate={controls}\n            initial=\"normal\"\n          >\n          <motion.g\n            variants={floatNoteVariants}\n            custom={0}\n            animate={controls}\n            initial=\"normal\"\n          >\n            <circle cx=\"15.2\" cy=\"4.6\" r=\"0.8\" fill=\"currentColor\" />\n            <path d=\"M16 4.6V2.1\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeWidth=\"1.2\" />\n          </motion.g>\n          <motion.g\n            variants={floatNoteVariants}\n            custom={1}\n            animate={controls}\n            initial=\"normal\"\n          >\n            <circle cx=\"18.8\" cy=\"3.2\" r=\"0.65\" fill=\"currentColor\" />\n            <path d=\"M19.45 3.2V1\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeWidth=\"1.2\" />\n          </motion.g>\n          </motion.g>\n        </motion.svg>\n      </div>\n    );\n  }\n);\n\nMusicNote01Icon.displayName = 'MusicNote01Icon';\n\nexport { MusicNote01Icon };\n",
      "type": "registry:ui"
    },
    {
      "path": "lib/use-icon-animation.ts",
      "content": "'use client';\n\nimport type { LegacyAnimationControls } from 'motion/react';\nimport { useReducedMotion } from 'motion/react';\nimport type {\n  ForwardedRef,\n  MouseEventHandler,\n} from 'react';\nimport { useCallback, useImperativeHandle, useRef } from 'react';\n\nexport interface AnimatedIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface UseIconAnimationOptions {\n  controls: LegacyAnimationControls;\n  loops?: boolean;\n  onMouseEnter?: MouseEventHandler<HTMLDivElement>;\n  onMouseLeave?: MouseEventHandler<HTMLDivElement>;\n  ref: ForwardedRef<AnimatedIconHandle>;\n}\n\nexport function useIconAnimation({\n  controls,\n  loops = false,\n  onMouseEnter,\n  onMouseLeave,\n  ref,\n}: UseIconAnimationOptions) {\n  const shouldReduceMotion = useReducedMotion();\n  const isControlledRef = useRef(false);\n  const isPlayingRef = useRef(false);\n  const runRef = useRef(0);\n\n  const startAnimation = useCallback(() => {\n    if (shouldReduceMotion || isPlayingRef.current) return;\n\n    isPlayingRef.current = true;\n    const run = ++runRef.current;\n    controls.set('normal');\n    void controls.start('animate').then(() => {\n      if (runRef.current === run) isPlayingRef.current = false;\n    });\n  }, [controls, shouldReduceMotion]);\n\n  const stopAnimation = useCallback(() => {\n    if (!loops) return;\n\n    runRef.current++;\n    isPlayingRef.current = false;\n    void controls.start('normal');\n  }, [controls, loops]);\n\n  useImperativeHandle(\n    ref,\n    () => {\n      isControlledRef.current = true;\n      return { startAnimation, stopAnimation };\n    },\n    [startAnimation, stopAnimation]\n  );\n\n  const handleMouseEnter = useCallback<MouseEventHandler<HTMLDivElement>>(\n    (event) => {\n      onMouseEnter?.(event);\n      if (!isControlledRef.current) startAnimation();\n    },\n    [onMouseEnter, startAnimation]\n  );\n\n  const handleMouseLeave = useCallback<MouseEventHandler<HTMLDivElement>>(\n    (event) => {\n      onMouseLeave?.(event);\n      if (!isControlledRef.current) stopAnimation();\n    },\n    [onMouseLeave, stopAnimation]\n  );\n\n  return { handleMouseEnter, handleMouseLeave };\n}\n",
      "type": "registry:lib"
    }
  ],
  "type": "registry:ui"
}