{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ai-cloud",
  "type": "registry:ui",
  "title": "ai-cloud",
  "description": "Animated ai cloud icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/ai-cloud.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: 'AiCloudIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// the cloud lifts and the spark it carries flares underneath\n// authored from scripts/authored\nconst cloudVariants: Variants = {\n  normal: { transform: 'translateY(0px)' },\n  animate: {\n    transform: ['translateY(0px)', 'translateY(-1.2px)', 'translateY(0.2px)', 'translateY(0px)'],\n    transition: { duration: 0.76, times: [0, 0.36, 0.7, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst sparkVariants: Variants = {\n  normal: { transform: 'rotate(0deg) scale(1)', opacity: 1 },\n  animate: {\n    transform: [\n      'rotate(0deg) scale(1)',\n      'rotate(-26deg) scale(0.5)',\n      'rotate(9deg) scale(1.2)',\n      'rotate(0deg) scale(1)',\n    ],\n    opacity: [1, 0.5, 1, 1],\n    transition: { duration: 0.62, delay: 0.14, times: [0, 0.3, 0.66, 1], ease: [0.23, 1, 0.32, 1] },\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=\"M17.4776 9.00005C17.485 9.00002 17.4925 9 17.5 9C19.9853 9 22 11.0147 22 13.5C22 15.2415 21.0108 16.7519 19.5636 17.5M17.4776 9.00005C17.4924 8.83536 17.5 8.66856 17.5 8.5C17.5 5.46243 15.0376 3 12 3C9.12324 3 6.76233 5.20862 6.52042 8.0227M17.4776 9.00005C17.3753 10.1345 16.9286 11.1696 16.2428 12M6.52042 8.0227C3.98398 8.26407 2 10.4003 2 13C2 14.9791 3.14985 16.6896 4.81794 17.5M6.52042 8.0227C6.67826 8.00768 6.83823 8 7 8C8.12582 8 9.16474 8.37209 10.0005 9\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"cloudVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 10.3px' }\" />\n            <motion.path d=\"M12 14L12.2579 14.697C12.5961 15.611 12.7652 16.068 13.0986 16.4014C13.432 16.7348 13.889 16.9039 14.803 17.2421L15.5 17.5L14.803 17.7579C13.889 18.0961 13.432 18.2652 13.0986 18.5986C12.7652 18.932 12.5961 19.389 12.2579 20.303L12 21L11.7421 20.303C11.4039 19.389 11.2348 18.932 10.9014 18.5986C10.568 18.2652 10.111 18.0961 9.19703 17.7579L8.5 17.5L9.19703 17.2421C10.111 16.9039 10.568 16.7348 10.9014 16.4014C11.2348 16.068 11.4039 15.611 11.7421 14.697L12 14Z\" stroke=\"currentColor\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"sparkVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 17.5px' }\" />\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"
    }
  ]
}
