{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "rotate-left-04",
  "type": "registry:ui",
  "title": "rotate-left-04",
  "description": "Animated rotate left icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/rotate-left-04.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: 'RotateLeft04Icon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after refresh: the glyph winds back and completes the named turn\n// generated from @hugeicons/core-free-icons\nconst iconVariants: Variants = {\n  normal: {\n    transform: 'rotate(0deg)',\n  },\n  animate: {\n    transform: ['rotate(0deg)', 'rotate(-25.31deg)', 'rotate(360deg)'],\n    transition: {\n      duration: 0.89,\n      times: [0, 0.2, 1],\n      ease: ['easeIn', 'easeOut'],\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=\"M5.14735 11.9194C4.52418 11.5654 3.7212 11.7864 3.35385 12.4132C2.98649 13.0399 3.19387 13.835 3.81703 14.1891L5.32148 15.0439M5.14735 11.9194L3.64289 11.0646C3.01973 10.7105 2.81236 9.91547 3.17971 9.28871C3.54707 8.66196 4.35004 8.44091 4.9732 8.79499L6.10145 9.43626M5.14735 11.9194L9.28456 14.2702M5.32148 15.0439C4.69832 14.6899 3.89534 14.9109 3.52799 15.5377C3.16063 16.1644 3.368 16.9595 3.99117 17.3136L8.63 19.9494C10.2648 20.8783 11.0822 21.3427 11.8798 21.462C12.3425 21.5313 13.0486 21.4215 13.5761 21.3127C14.0324 21.2186 14.5093 21.273 14.9093 21.5003L15.7854 21.998M5.32148 15.0439L8.70648 16.9673M6.10145 9.43626C5.47866 9.08205 5.27148 8.28717 5.63874 7.66058C6.0061 7.03382 6.80907 6.81278 7.43223 7.16685L13.7974 10.7833L13.2933 8.86278C13.0721 8.02011 13.6403 7.16195 14.5112 7.02339C15.1776 6.91736 15.8247 7.27166 16.0845 7.88474L17.9471 12.5734C18.3035 13.4705 19.1576 14.3331 19.998 14.8107M6.10145 9.43626L9.86257 11.5733\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\" />\n            <motion.path d=\"M9.36287 4.96465C9.75977 5.3603 11.4864 5.24616 12.1233 5.16671M9.36287 4.96465C8.96598 4.56901 8.95462 2.63697 9.03431 2.00208M9.36287 4.96465C10.3839 3.19642 14.4435 0.375874 18.4719 3.19642C20.4185 4.55942 20.6932 5.41838 21.0011 5.99381\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :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"
    }
  ]
}
