{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "bow-arrow",
  "type": "registry:ui",
  "title": "bow-arrow",
  "description": "Animated bow arrow icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/bow-arrow.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: 'BowArrowIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after arrow-right-02: the mark commits right along its own axis\n// generated from @hugeicons/core-free-icons\nconst arrowVariants: Variants = {\n  normal: {\n    transform: 'translateX(0px) scaleY(1)',\n  },\n  animate: {\n    transform: ['translateX(0px) scaleY(1)', 'translateX(2.83px) scaleY(0.94)', 'translateX(-0.33px) scaleY(1.02)', 'translateX(0.49px) scaleY(0.99)', 'translateX(0px) scaleY(1)'],\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=\"M10 14L20 4\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"arrowVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\" />\n            <motion.path d=\"M5.24299 15.1543C4.7142 15.68 4.15657 16.232 3.66853 16.7143C3.23749 17.1402 3.02197 17.3532 3.00283 17.5346C2.98465 17.7068 3.05493 17.8761 3.19001 17.9854C3.3323 18.1007 3.63618 18.1007 4.24396 18.1007C4.80191 18.1007 5.08089 18.1007 5.29552 18.2051C5.50131 18.3052 5.66771 18.4705 5.76847 18.675C5.87356 18.8883 5.87358 19.1705 5.87362 19.7349C5.87367 20.3641 5.87369 20.6786 5.9997 20.8231C6.10363 20.9423 6.25695 21.0073 6.41543 20.9994C6.60759 20.9897 6.83179 20.7762 7.2802 20.349L8.74318 18.9552C9.3558 18.3716 9.66211 18.0798 9.82722 17.7045C9.83213 17.6933 9.83693 17.6821 9.84164 17.6709C10 17.2927 10 16.8711 10 16.0277V15.9499C10 15.0807 10 14.6461 9.75179 14.3582C9.71731 14.3182 9.67978 14.2809 9.63954 14.2466C9.34982 14 8.91248 14 8.03779 14C7.27234 14 6.88961 14 6.54321 14.1274C6.49316 14.1458 6.4449 14.1656 6.39642 14.1878C6.0609 14.3412 5.78826 14.6123 5.24299 15.1543Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"arrowVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\" />\n            <motion.path d=\"M17 3.22126C17 3.22126 20.2808 2.72341 20.7787 3.22129C21.2766 3.71917 20.7787 7 20.7787 7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"arrowVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\" />\n            <motion.path d=\"M18.2396 11C19.0904 13.2868 19.0543 15.8774 18.1635 18.1685C17.617 19.5741 17.3438 20.2769 16.2839 20.4999C15.224 20.7228 14.5402 20.0391 13.1728 18.6718M5.32864 10.8285C3.95727 9.45733 3.27159 8.77172 3.48591 7.71854C3.70024 6.66535 4.4056 6.38049 5.81632 5.81077C8.11856 4.88101 10.7129 4.8173 13 5.68707\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"arrowVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 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"
    }
  ]
}
