{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "contact-round",
  "type": "registry:ui",
  "title": "contact-round",
  "description": "Animated contact round icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/contact-round.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: 'ContactRoundIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after user: the contact gives a short nod while its detail follows\n// generated from @hugeicons/core-free-icons\nconst frameVariants: Variants = {\n  normal: {\n    transform: 'scale(1)',\n  },\n  animate: {\n    transform: ['scale(1)', 'scale(0.96)', 'scale(1.025)', 'scale(1)'],\n    transition: {\n      duration: 0.48,\n      ease: [0.23, 1, 0.32, 1],\n    },\n  },\n}\n\nconst headVariants: Variants = {\n  normal: {\n    transform: 'rotate(0deg)',\n  },\n  animate: {\n    transform: ['rotate(0deg)', 'rotate(16.38deg)', 'rotate(-4.1deg)', 'rotate(0deg)'],\n    transition: {\n      duration: 0.6,\n      ease: 'easeInOut',\n      times: [0, 0.4, 0.7, 1],\n    },\n  },\n}\n\nconst bodyVariants: Variants = {\n  normal: {\n    transform: 'translateY(0px)',\n  },\n  animate: {\n    transform: ['translateY(0px)', 'translateY(0.92px)', 'translateY(0px)'],\n    transition: {\n      duration: 0.3,\n      ease: 'easeOut',\n      delay: 0.28,\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=\"M15 2.25195H9C6.17157 2.25195 4.75736 2.25195 3.87868 3.13063C3 4.00931 3 5.42353 3 8.25195V13.6297C3 16.0927 3 17.3241 3.67959 18.1535C3.80506 18.3066 3.94539 18.4469 4.0985 18.5724C4.92781 19.252 6.15928 19.252 8.62223 19.252C9.02437 19.252 9.22543 19.252 9.40521 19.3244C9.43933 19.3381 9.47266 19.3537 9.50506 19.3711C9.67577 19.4629 9.80449 19.6173 10.0619 19.9263L10.4636 20.4082C11.1756 21.2627 11.5316 21.752 12 21.752C12.4684 21.752 12.8244 21.2627 13.5364 20.4082L13.9381 19.9263C14.1955 19.6173 14.3242 19.4629 14.4949 19.3711C14.5273 19.3537 14.5607 19.3381 14.5948 19.3244C14.7746 19.252 14.9756 19.252 15.3778 19.252C17.8407 19.252 19.0722 19.252 19.9015 18.5724C20.0546 18.4469 20.1949 18.3066 20.3204 18.1535C21 17.3241 21 16.0927 21 13.6297V8.25195C21 5.42353 21 4.00931 20.1213 3.13063C19.2426 2.25195 17.8284 2.25195 15 2.25195Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"frameVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\" />\n            <motion.path d=\"M14.5 8.75195C14.5 10.1327 13.3807 11.252 12 11.252C10.6193 11.252 9.5 10.1327 9.5 8.75195C9.5 7.37124 10.6193 6.25195 12 6.25195C13.3807 6.25195 14.5 7.37124 14.5 8.75195Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"headVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 11.25px' }\" />\n            <motion.path d=\"M16 15.252C16 13.0428 14.2091 11.252 12 11.252C9.79086 11.252 8 13.0428 8 15.252\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"bodyVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 13.25px' }\" />\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"
    }
  ]
}
