{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "online-learning-04",
  "type": "registry:ui",
  "title": "online-learning-04",
  "description": "Animated online learning icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/online-learning-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: 'OnlineLearning04Icon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after wifi-01: the status signal expands from source to outer ring\n// generated from @hugeicons/core-free-icons\nconst arcVariants: Variants = {\n  normal: {\n    transform: 'translateY(0px) scale(1)',\n  },\n  animate: (i: number) => ({\n    transform: ['translateY(0.88px) scale(0.82)', 'translateY(0px) scale(1.06)', 'translateY(0px) scale(1)'],\n    transition: { duration: 1, ease: [0.23, 1, 0.32, 1], delay: i * 0.12 },\n  }),\n}\n\nconst sourceVariants: Variants = {\n  normal: {\n    transform: 'scale(1)',\n  },\n  animate: {\n    transform: ['scale(1)', 'scale(0.86)', 'scale(1.18)', 'scale(1)'],\n    transition: {\n      duration: 0.92,\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: true,\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 6C4.90328 6.05476 4.2191 6.21819 3.73223 6.7059C3 7.43939 3 8.61994 3 10.981V16.9914C3 19.3525 3 20.533 3.73223 21.2665C4.46447 22 5.64298 22 8 22H9C11.357 22 12.5355 22 13.2678 21.2665C14 20.533 14 19.3525 14 16.9914V15\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"arcVariants\" :custom=\"1\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '8.5px 19px' }\" />\n            <motion.path d=\"M15 4V11.5M9.77631 2.08242C13.178 1.58922 15 3.47059 15 3.47059C15 3.47059 16.822 1.58922 20.2237 2.08242C20.6819 2.14885 21 2.55824 21 3.02124V9.49465C21 10.1407 20.3935 10.6121 19.7499 10.5572C16.6531 10.293 15 12 15 12C15 12 13.3469 10.293 10.2501 10.5572C9.60646 10.6121 9 10.1407 9 9.49465V3.02124C9 2.55824 9.3181 2.14885 9.77631 2.08242Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"arcVariants\" :custom=\"0\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '8.5px 19px' }\" />\n            <motion.path d=\"M8.625 19H8.5M8.75 19C8.75 19.1381 8.63807 19.25 8.5 19.25C8.36193 19.25 8.25 19.1381 8.25 19C8.25 18.8619 8.36193 18.75 8.5 18.75C8.63807 18.75 8.75 18.8619 8.75 19Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"sourceVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '8.5px 19px' }\" />\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"
    }
  ]
}
