{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "rotate-left-03",
  "type": "registry:ui",
  "title": "rotate-left-03",
  "description": "Animated rotate left icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/rotate-left-03.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: 'RotateLeft03Icon' })\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(-27.24deg)', 'rotate(360deg)'],\n    transition: {\n      duration: 0.94,\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=\"M7.6239 10.4588L7.18 11.2239C6.68968 12.069 6.98066 13.1495 7.82992 13.6374M7.82992 13.6374L8.59878 14.0792M7.82992 13.6374C7.40529 13.3935 6.86231 13.5383 6.61715 13.9608C6.12683 14.8059 6.41781 15.8865 7.26707 16.3744M7.26707 16.3744L8.03593 16.8161M7.26707 16.3744C6.86459 16.1431 6.34979 16.3269 6.18675 16.7599L6.07863 17.0471C5.77412 17.8559 6.10188 18.7652 6.85358 19.1971L7.98598 19.8472C9.65697 20.8072 10.4925 21.2872 11.3046 21.4161C11.7757 21.4908 12.4927 21.3859 13.0281 21.2803C13.4912 21.1889 13.9767 21.2487 14.3855 21.4836L15.2809 21.998M9.16172 11.3421L4.16412 8.47101C3.52717 8.10508 3.30894 7.29463 3.67668 6.66083C4.04442 6.02703 4.85888 5.80987 5.49582 6.1758L13.1556 10.5761L12.6252 8.61856C12.3924 7.75964 12.9623 6.89245 13.8466 6.75981C14.5233 6.65832 15.1846 7.02469 15.4543 7.65053L17.3918 12.4356C17.7625 13.3511 18.639 14.2364 19.498 14.7299\" 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=\"M8.86287 4.96465C9.25977 5.3603 10.9864 5.24616 11.6233 5.16671M8.86287 4.96465C8.46598 4.56901 8.45462 2.63697 8.53431 2.00208M8.86287 4.96465C9.88394 3.19642 13.9435 0.375875 17.9719 3.19642C19.9185 4.55942 20.1932 5.41838 20.5011 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"
    }
  ]
}
