{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hands-clapping",
  "type": "registry:ui",
  "title": "hands-clapping",
  "description": "Animated hands clapping icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/hands-clapping.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: 'HandsClappingIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after thumbs-up: both hands drive together and rebound from the contact\n// generated from @hugeicons/core-free-icons\nconst leftVehicleVariants: Variants = {\n  normal: {\n    transform: 'translateX(0px) rotate(0deg)',\n  },\n  animate: {\n    transform: ['translateX(0px) rotate(0deg)', 'translateX(1.07px) rotate(0deg)', 'translateX(3.33px) rotate(1.61deg)', 'translateX(2.04px) rotate(-3.22deg)', 'translateX(-0.86px) rotate(-1.07deg)', 'translateX(0px) rotate(0deg)'],\n    transition: {\n      duration: 0.81,\n      times: [0, 0.18, 0.38, 0.48, 0.72, 1],\n      ease: [\n        'easeIn',\n        'easeIn',\n        [0.23, 1, 0.32, 1],\n        [0.23, 1, 0.32, 1],\n        [0.23, 1, 0.32, 1],\n      ],\n    },\n  },\n}\n\nconst rightVehicleVariants: Variants = {\n  normal: {\n    transform: 'translateX(0px) rotate(0deg)',\n  },\n  animate: {\n    transform: ['translateX(0px) rotate(0deg)', 'translateX(-0.92px) rotate(0deg)', 'translateX(-2.86px) rotate(-1.39deg)', 'translateX(-1.75px) rotate(2.77deg)', 'translateX(0.74px) rotate(0.92deg)', 'translateX(0px) rotate(0deg)'],\n    transition: {\n      duration: 0.83,\n      times: [0, 0.18, 0.38, 0.48, 0.72, 1],\n      ease: [\n        'easeIn',\n        'easeIn',\n        [0.23, 1, 0.32, 1],\n        [0.23, 1, 0.32, 1],\n        [0.23, 1, 0.32, 1],\n      ],\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=\"M14 13V9.5C14 8.67157 14.6716 8 15.5 8C16.3284 8 17 8.67157 17 9.5V16C17 19.3137 14.3137 22 11 22H10.3137C8.19198 22 6.15715 21.1571 4.65685 19.6569L2.41421 17.4142C2.149 17.149 2 16.7893 2 16.4142C2 15.6332 2.63317 15 3.41421 15C3.78929 15 4.149 15.149 4.41421 15.4142L6 17L2.41421 13.4142C2.149 13.149 2 12.7893 2 12.4142C2 11.6332 2.63317 11 3.41421 11C3.78929 11 4.149 11.149 4.41421 11.4142L8 15L3.41421 10.4142C3.149 10.149 3 9.78929 3 9.41421C3 8.63317 3.63317 8 4.41421 8C4.78929 8 5.149 8.149 5.41421 8.41421L10 13L6.41421 9.41421C6.149 9.149 6 8.78929 6 8.41421C6 7.63317 6.63317 7 7.41421 7C7.78929 7 8.149 7.149 8.41421 7.41421L14 13Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"leftVehicleVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '17px 14.5px' }\" />\n            <motion.path d=\"M7 2V3.5M3 5H4.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"leftVehicleVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '7px 3.5px' }\" />\n            <motion.path d=\"M16 20C19.3137 20 22 17.3137 22 14V7.5C22 6.67157 21.3284 6 20.5 6C19.8469 6 19.2913 6.4174 19.0854 7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"rightVehicleVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '16px 13px' }\" />\n            <motion.path d=\"M14 5.5L13 4.50015C12.7348 4.23493 12.3751 4.08594 12 4.08594C11.219 4.08594 10.5858 4.7191 10.5858 5.50015\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"rightVehicleVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '10.59px 4.79px' }\" />\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"
    }
  ]
}
