{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "handshake",
  "type": "registry:ui",
  "title": "handshake",
  "description": "Animated handshake icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/handshake.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: 'HandshakeIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after folder-01: the parts of the handshake move from their own mass and settle together\n// generated from @hugeicons/core-free-icons\nconst folderVariants: Variants = {\n  normal: {\n    transform: 'translateY(0px) rotate(0deg)',\n  },\n  animate: {\n    transform: ['translateY(0px) rotate(0deg)', 'translateY(-1.82px) rotate(-2.14deg)', 'translateY(0.43px) rotate(0.75deg)', 'translateY(0px) rotate(0deg)'],\n    transition: {\n      duration: 0.58,\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=\"M14.5 8.48584C13.6329 8.91937 11.1118 9.65364 8.63166 9.58043C7.98001 9.56119 7.5 9.00159 7.5 8.34966C7.5 7.82561 7.81029 7.34974 8.28079 7.11896C9.28416 6.62682 10.867 5.80431 12.2709 5.04501C13.1233 4.58403 13.5495 4.35353 13.8726 4.24442C14.7383 3.95206 15.4351 3.94086 16.3097 4.20526C16.6362 4.30393 17.0283 4.49997 17.8124 4.89206L18.7167 5.34419C18.7884 5.38005 18.8243 5.39798 18.861 5.41284C18.9555 5.45108 19.0553 5.47463 19.1569 5.4827C19.1964 5.48583 19.2365 5.48583 19.3167 5.48583C19.9522 5.48583 20.2699 5.48583 20.5302 5.5574C21.2102 5.74437 21.7415 6.27562 21.9284 6.9556C22 7.21589 22 7.53363 22 8.16912V13.7001C22 14.4102 21.4244 14.9858 20.7143 14.9858C20.5752 14.9858 20.4398 15.0309 20.3286 15.1144L20 15.3608C19.3066 15.8809 18.9599 16.1409 18.5624 16.2914C18.4871 16.3199 18.4108 16.3454 18.3335 16.3677C17.9251 16.4858 17.4917 16.4858 16.625 16.4858H14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"folderVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '10.05px 19.98px' }\" />\n            <motion.path d=\"M14.5 8.48438L17.5713 11.9628C18.0912 12.5347 18.0703 13.4141 17.5238 13.9606C16.9584 14.526 16.0416 14.526 15.4762 13.9606C16.0285 14.5129 16.0523 15.4321 15.5 15.9844C14.9477 16.5367 14.0523 16.5367 13.5 15.9844L13 15.4844C13.5523 16.0367 13.5523 16.9321 13 17.4844C12.4477 18.0367 11.5523 18.0367 11 17.4844C11.5523 18.0367 11.5523 18.9321 11 19.4844L10.9393 19.545C10.658 19.8263 10.2765 19.9844 9.87868 19.9844H9.75C9.26978 19.9844 8.80923 19.7936 8.46967 19.454L4.41421 15.3986C4.149 15.1334 3.78929 14.9844 3.41421 14.9844C2.63317 14.9844 2 14.3512 2 13.5702V9.48438C2 7.59876 2 6.65595 2.58579 6.07016C3.17157 5.48438 4.11438 5.48438 6 5.48438H11\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"folderVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '10.05px 19.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"
    }
  ]
}
