{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "angry-bird",
  "type": "registry:ui",
  "title": "angry-bird",
  "description": "Animated angry bird icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/angry-bird.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: 'AngryBirdIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// the brows slam down, the beak snaps, and both pupils flare\n// authored from scripts/authored\nconst bodyVariants: Variants = {\n  normal: { transform: 'scale(1)' },\n  animate: {\n    transform: ['scale(1)', 'scale(0.96)', 'scale(1.03)', 'scale(1)'],\n    transition: { duration: 0.56, delay: 0.08, times: [0, 0.28, 0.62, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst crestVariants: Variants = {\n  normal: { transform: 'rotate(0deg)' },\n  animate: {\n    transform: ['rotate(0deg)', 'rotate(-10deg)', 'rotate(3deg)', 'rotate(0deg)'],\n    transition: { duration: 0.52, times: [0, 0.3, 0.66, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst beakVariants: Variants = {\n  normal: { transform: 'rotate(0deg) scale(1)' },\n  animate: {\n    transform: [\n      'rotate(0deg) scale(1)',\n      'rotate(8deg) scale(0.9)',\n      'rotate(-3deg) scale(1.08)',\n      'rotate(0deg) scale(1)',\n    ],\n    transition: { duration: 0.5, delay: 0.1, times: [0, 0.28, 0.62, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst browTopVariants: Variants = {\n  normal: { transform: 'translateY(0px)' },\n  animate: {\n    transform: ['translateY(0px)', 'translateY(1.2px)', 'translateY(-0.2px)', 'translateY(0px)'],\n    transition: { duration: 0.48, times: [0, 0.3, 0.66, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst browLowVariants: Variants = {\n  normal: { transform: 'translateY(0px)' },\n  animate: {\n    transform: ['translateY(0px)', 'translateY(1.2px)', 'translateY(-0.2px)', 'translateY(0px)'],\n    transition: { duration: 0.48, delay: 0.04, times: [0, 0.3, 0.66, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst tailVariants: Variants = {\n  normal: { transform: 'rotate(0deg)' },\n  animate: {\n    transform: ['rotate(0deg)', 'rotate(-12deg)', 'rotate(4deg)', 'rotate(0deg)'],\n    transition: { duration: 0.56, delay: 0.06, times: [0, 0.34, 0.7, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst eyeLeftVariants: Variants = {\n  normal: { transform: 'scale(1)' },\n  animate: {\n    transform: ['scale(1)', 'scale(0.4)', 'scale(1.28)', 'scale(1)'],\n    transition: { duration: 0.5, delay: 0.12, times: [0, 0.24, 0.58, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst eyeRightVariants: Variants = {\n  normal: { transform: 'scale(1)' },\n  animate: {\n    transform: ['scale(1)', 'scale(0.4)', 'scale(1.28)', 'scale(1)'],\n    transition: { duration: 0.5, delay: 0.16, times: [0, 0.24, 0.58, 1], ease: [0.23, 1, 0.32, 1] },\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=\"M18.5 9.19028C16.9878 7.3721 14.7872 6 12.5 6C8.35786 6 4.5 10.5 4.5 14C4.5 18.1421 8.35786 21 12.5 21C13.0064 21 13.5086 20.9573 14 20.8747\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"bodyVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12.5px 13.5px' }\" />\n            <motion.path d=\"M13 8.5L17.7059 10L21 8\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"crestVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '17px 9px' }\" />\n            <motion.path d=\"M20.6089 17.1305H22L20.1374 15.5872C18.8302 14.5041 18.1766 13.9625 17.4061 14.002C16.6357 14.0415 16.0515 14.6466 14.8831 15.8567L14.7463 15.9984C14.2628 16.4993 14.021 16.7497 14.0017 17.0446C13.9983 17.0956 14 17.1467 14.0066 17.1974C14.0447 17.4908 14.302 17.7278 14.8167 18.2016C16.1158 19.3976 16.7654 19.9957 17.527 20C17.6567 20.0007 17.7862 19.9889 17.9133 19.9648C18.6592 19.823 19.1688 19.1193 20.1879 17.7119L20.6089 17.1305ZM20.6089 17.1305H17.8266\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"beakVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '18px 16px' }\" />\n            <motion.path d=\"M13 6C12.7333 5 11.56 3 9 3\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"browTopVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '11px 4.5px' }\" />\n            <motion.path d=\"M11 6C10.5 5.47719 9 4.58841 7 5.21578\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"browLowVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '9px 5.3px' }\" />\n            <motion.path d=\"M2 11L4 14L2 15\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"tailVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '3px 13px' }\" />\n            <motion.path d=\"M13.125 12H13M13.25 12C13.25 12.1381 13.1381 12.25 13 12.25C12.8619 12.25 12.75 12.1381 12.75 12C12.75 11.8619 12.8619 11.75 13 11.75C13.1381 11.75 13.25 11.8619 13.25 12Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"eyeLeftVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '13px 12px' }\" />\n            <motion.path d=\"M20.125 12H20M20.25 12C20.25 12.1381 20.1381 12.25 20 12.25C19.8619 12.25 19.75 12.1381 19.75 12C19.75 11.8619 19.8619 11.75 20 11.75C20.1381 11.75 20.25 11.8619 20.25 12Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"eyeRightVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '20px 12px' }\" />\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"
    }
  ]
}
