{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "guitar",
  "type": "registry:ui",
  "title": "guitar",
  "description": "Animated guitar icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/guitar.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: 'GuitarIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after copy-01: the nested parts of the guitar separate in depth and stack again\n// generated from @hugeicons/core-free-icons\nconst fileVariants: Variants = {\n  normal: {\n    transform: 'translateY(0px) rotate(0deg)',\n  },\n  animate: {\n    transform: ['translateY(0px) rotate(0deg)', 'translateY(-0.81px) rotate(-1.01deg)', 'translateY(0.46px) rotate(0.51deg)', 'translateY(0px) rotate(0deg)'],\n    transition: {\n      duration: 0.58,\n      ease: [0.23, 1, 0.32, 1],\n    },\n  },\n}\n\nconst frontVariants: Variants = {\n  normal: {\n    transform: 'translate(0px, 0px)',\n  },\n  animate: {\n    transform: ['translate(0px, 0px)', 'translate(1.42px, -1.21px)', 'translate(0.2px, -0.2px)', 'translate(0px, 0px)'],\n    transition: {\n      duration: 0.52,\n      ease: [0.23, 1, 0.32, 1],\n    },\n  },\n}\n\nconst controls = useAnimationControls()\nconst { onMouseEnter, onMouseLeave, startAnimation, stopAnimation } = useIconAnimation({\n  controls,\n  loops: false,\n})\n\ndefineExpose<AnimatedIconHandle>({ startAnimation, stopAnimation })\n</script>\n\n<template>\n  <div class=\"hia-icon\" @mouseenter=\"onMouseEnter\" @mouseleave=\"onMouseLeave\" v-bind=\"$attrs\">\n          <svg xmlns=\"http://www.w3.org/2000/svg\" :width=\"size\" :height=\"size\" viewBox=\"0 0 24 24\" fill=\"none\" overflow=\"visible\">\n            <motion.path d=\"M11.5505 12.447L11.1881 12.8094L18.4362 5.5625M6.83923 15.7079L8.28885 17.1574M11.9129 13.5341C11.5126 13.9344 10.8636 13.9344 10.4633 13.5341C10.063 13.1338 10.063 12.4849 10.4633 12.0846C10.8636 11.6843 11.5126 11.6843 11.9129 12.0846C12.3132 12.4849 12.3132 13.1338 11.9129 13.5341ZM14.8122 9.18631C17.7114 12.0853 17.5172 13.3406 16.9866 14.2595C16.6863 14.7797 16.0853 15.2894 15.1176 15.6714C14.3091 15.9906 13.6733 16.6521 13.4915 17.5019C13.2667 18.5521 12.8333 19.862 11.9129 20.7823C10.1009 22.5941 7.92649 22.5941 4.66485 19.3328C1.40321 16.0714 1.40321 13.8972 3.21524 12.0853C4.13562 11.165 5.44559 10.7316 6.49584 10.5069C7.3458 10.3251 8.00733 9.6893 8.32652 8.88091C8.70857 7.91334 9.21833 7.31237 9.73852 7.01207C10.6575 6.48152 11.9129 6.28732 14.8122 9.18631Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"fileVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '9.92px 14.08px' }\" />\n            <motion.path d=\"M21.5193 4.48223L20.5193 5.48223C20.4115 5.59007 20.3576 5.64399 20.3075 5.68469C19.8483 6.05773 19.1904 6.05773 18.7312 5.68469C18.6811 5.64399 18.6272 5.59006 18.5193 5.48223C18.4115 5.3744 18.3576 5.32048 18.3169 5.27038C17.9438 4.81116 17.9438 4.15331 18.3169 3.69409C18.3576 3.64399 18.4115 3.59007 18.5193 3.48223L19.5193 2.48223C19.6272 2.3744 19.6811 2.32048 19.7312 2.27978C20.1904 1.90674 20.8483 1.90674 21.3075 2.27978C21.3576 2.32048 21.4115 2.3744 21.5193 2.48223C21.6272 2.59006 21.6811 2.64399 21.7218 2.69409C22.0948 3.15331 22.0948 3.81116 21.7218 4.27038C21.6811 4.32048 21.6272 4.3744 21.5193 4.48223Z\" stroke=\"currentColor\" stroke-width=\"1.5\" :variants=\"frontVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '20.02px 3.98px' }\" />\n          </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"
    }
  ]
}
