{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "move-01",
  "type": "registry:ui",
  "title": "move-01",
  "description": "Animated move icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/move-01.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: 'Move01Icon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after cursor-pointer-01: the object travels along the direction encoded by its handles and returns\n// generated from @hugeicons/core-free-icons\nconst iconVariants: Variants = {\n  normal: {\n    transform: 'translateX(0px) rotate(0deg)',\n  },\n  animate: {\n    transform: ['translateX(0px) rotate(0deg)', 'translateX(3.48px) rotate(4.35deg)', 'translateX(-0.43px) rotate(-1.09deg)', 'translateX(0px) rotate(0deg)'],\n    transition: {\n      duration: 0.65,\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=\"M6.84064 22.2493V21.2993C6.84064 20.653 6.63169 20.0238 6.24476 19.5051L2.58276 14.5957C2.16041 14.0295 1.82308 13.327 2.10192 12.6785C2.55331 11.6287 3.82679 10.9467 5.38552 12.5207L6.98467 14.2323L6.98466 3.79543C7.04095 1.74958 10.3329 1.64816 10.4737 3.79543V9.74332C11.9555 9.55193 18.9359 10.5968 17.9185 15.0228C17.8701 15.2331 17.8219 15.4465 17.7748 15.6571C17.5688 16.5771 16.9603 18.2167 16.2892 19.1752C15.5905 20.1731 15.837 21.167 15.837 22.2493\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '10.38px 22.25px' }\" />\n            <motion.path d=\"M16.9252 2.61721L17.7298 1.86064C17.8063 1.7887 17.9042 1.75241 18.0022 1.75196M19.1103 2.61721L18.2734 1.8561C18.1964 1.78616 18.0992 1.75151 18.0022 1.75196M19.1103 8.85223L18.3057 9.6088C18.2211 9.68838 18.1104 9.72433 18.0022 9.71642M16.9252 8.85223L17.7622 9.61334C17.8309 9.67578 17.9157 9.7101 18.0022 9.71642M18.0022 1.75196V9.71642M21.1359 4.64178L21.8922 5.44665C21.9641 5.52318 22.0004 5.62105 22.0008 5.71912M21.1359 6.82767L21.8967 5.99039C21.9666 5.91345 22.0013 5.81619 22.0008 5.71912M14.903 6.82765L14.1467 6.02279C14.0672 5.93813 14.0312 5.82737 14.0392 5.71912M14.903 4.64176L14.1422 5.47905C14.0798 5.54774 14.0455 5.63263 14.0392 5.71912M22.0008 5.71912L14.0392 5.71912\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '10.38px 22.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"
    }
  ]
}
