{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "music-note-01",
  "type": "registry:ui",
  "title": "music-note-01",
  "description": "Animated music note icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/music-note-01.vue",
      "type": "registry:ui",
      "content": "<script setup lang=\"ts\">\nimport { motion, useAnimationControls } from 'motion-v'\nimport type { Variants } from 'motion-v'\nimport { useIconAnimation } from '../composables/useIconAnimation'\nimport type { AnimatedIconHandle } from '../types'\n\ndefineOptions({ inheritAttrs: false, name: 'MusicNote01Icon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\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\nconst controls = useAnimationControls()\nconst { onMouseEnter, onMouseLeave, startAnimation, stopAnimation } = useIconAnimation({\n  controls,\n  loops: true,\n})\n\ndefineExpose<AnimatedIconHandle>({ startAnimation, stopAnimation })\n</script>\n\n<template>\n  <div class=\"hia-icon\" @mouseenter=\"onMouseEnter\" @mouseleave=\"onMouseLeave\" v-bind=\"$attrs\">\n          <motion.svg xmlns=\"http://www.w3.org/2000/svg\" :width=\"size\" :height=\"size\" viewBox=\"0 0 24 24\" fill=\"none\" overflow=\"visible\" :variants=\"svgVariants\" :animate=\"controls\" initial=\"normal\">\n            <motion.path 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\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"smallNoteVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformBox: 'fill-box', transformOrigin: 'center' }\" />\n            <motion.circle cx=\"10.5\" cy=\"19.5\" r=\"2.5\" stroke=\"currentColor\" stroke-width=\"1.5\" :variants=\"headLeftVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformBox: 'fill-box', transformOrigin: 'center' }\" />\n            <motion.circle cx=\"20\" cy=\"18\" r=\"2\" stroke=\"currentColor\" stroke-width=\"1.5\" :variants=\"headRightVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformBox: 'fill-box', transformOrigin: 'center' }\" />\n            <path 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\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" />\n            <path d=\"M13 13C17.8 13 21 10.6667 22 10\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" />\n            <motion.g :variants=\"generatedGeometryVariants\" :animate=\"controls\" initial=\"normal\">\n            <motion.g :variants=\"floatNoteVariants\" :custom=\"0\" :animate=\"controls\" initial=\"normal\">\n              <circle cx=\"15.2\" cy=\"4.6\" r=\"0.8\" fill=\"currentColor\" />\n              <path d=\"M16 4.6V2.1\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.2\" />\n            </motion.g>\n            <motion.g :variants=\"floatNoteVariants\" :custom=\"1\" :animate=\"controls\" initial=\"normal\">\n              <circle cx=\"18.8\" cy=\"3.2\" r=\"0.65\" fill=\"currentColor\" />\n              <path d=\"M19.45 3.2V1\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.2\" />\n            </motion.g>\n            </motion.g>\n          </motion.svg>\n        </div>\n</template>\n"
    },
    {
      "path": "composables/useIconAnimation.ts",
      "type": "registry:lib",
      "content": "import { ref, toValue, type MaybeRefOrGetter } from 'vue'\nimport type { AnimatedIconHandle } from '../types'\n\nexport type IconPose = 'normal' | 'animate'\n\ntype AnimationControls = {\n  set: (variant: IconPose | Record<string, unknown>) => void\n  start: (variant: IconPose | Record<string, unknown>) => Promise<unknown>\n}\n\nexport function useReducedMotionFlag(\n  reduced?: MaybeRefOrGetter<boolean | undefined>,\n) {\n  if (typeof window === 'undefined') return () => false\n  return () => {\n    const override = reduced === undefined ? undefined : toValue(reduced)\n    if (override !== undefined) return override\n    return window.matchMedia('(prefers-reduced-motion: reduce)').matches\n  }\n}\n\nexport function useIconAnimation(options: {\n  controls: AnimationControls\n  loops?: boolean\n}): AnimatedIconHandle & {\n  onMouseEnter: () => void\n  onMouseLeave: () => void\n} {\n  const { controls, loops = false } = options\n  const isPlaying = ref(false)\n  let run = 0\n\n  const prefersReduced = () =>\n    typeof window !== 'undefined' &&\n    window.matchMedia('(prefers-reduced-motion: reduce)').matches\n\n  async function startAnimation() {\n    if (prefersReduced() || isPlaying.value) return\n\n    isPlaying.value = true\n    const current = ++run\n    controls.set('normal')\n    await controls.start('animate')\n    if (run === current) isPlaying.value = false\n  }\n\n  function stopAnimation() {\n    if (!loops) return\n    run += 1\n    isPlaying.value = false\n    void controls.start('normal')\n  }\n\n  return {\n    startAnimation,\n    stopAnimation,\n    onMouseEnter: () => {\n      void startAnimation()\n    },\n    onMouseLeave: () => {\n      stopAnimation()\n    },\n  }\n}\n"
    },
    {
      "path": "types/animated-icon.ts",
      "type": "registry:lib",
      "content": "export interface AnimatedIconHandle {\n  startAnimation: () => void\n  stopAnimation: () => void\n}\n\nexport interface AnimatedIconProps {\n  size?: number\n}\n"
    }
  ]
}
