{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "air-vent",
  "type": "registry:ui",
  "title": "air-vent",
  "description": "Animated air vent icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/air-vent.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: 'AirVentIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// air keeps pushing out of the louvres, the middle jet leading the two side curls\n// authored from scripts/authored\nconst louvreVariants: Variants = {\n  normal: { transform: 'scaleX(1)' },\n  animate: {\n    transform: ['scaleX(1)', 'scaleX(0.96)', 'scaleX(1)'],\n    transition: {\n      duration: 1,\n      times: [0, 0.4, 1],\n      ease: [0.77, 0, 0.175, 1],\n      repeat: Infinity,\n      repeatDelay: 0.1,\n    },\n  },\n};\n\nconst jetRightVariants: Variants = {\n  normal: { transform: 'translate(0px, 0px)', opacity: 1 },\n  animate: {\n    transform: ['translate(0px, 0px)', 'translate(0.9px, 1.2px)', 'translate(0px, 0px)'],\n    opacity: [1, 0.28, 1],\n    transition: {\n      duration: 0.86,\n      delay: 0.2,\n      times: [0, 0.42, 1],\n      ease: [0.23, 1, 0.32, 1],\n      repeat: Infinity,\n      repeatDelay: 0.12,\n    },\n  },\n};\n\nconst jetLeftVariants: Variants = {\n  normal: { transform: 'translate(0px, 0px)', opacity: 1 },\n  animate: {\n    transform: ['translate(0px, 0px)', 'translate(-0.9px, 1.2px)', 'translate(0px, 0px)'],\n    opacity: [1, 0.28, 1],\n    transition: {\n      duration: 0.86,\n      delay: 0.2,\n      times: [0, 0.42, 1],\n      ease: [0.23, 1, 0.32, 1],\n      repeat: Infinity,\n      repeatDelay: 0.12,\n    },\n  },\n};\n\nconst jetMiddleVariants: Variants = {\n  normal: { transform: 'translateY(0px)', opacity: 1 },\n  animate: {\n    transform: ['translateY(0px)', 'translateY(1.8px)', 'translateY(0px)'],\n    opacity: [1, 0.28, 1],\n    transition: {\n      duration: 0.86,\n      times: [0, 0.42, 1],\n      ease: [0.23, 1, 0.32, 1],\n      repeat: Infinity,\n      repeatDelay: 0.12,\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            <path d=\"M4.00183 15C2.89726 15 2.00183 14.1046 2.00183 13V8C2.00183 6.11438 2.00183 5.17157 2.58762 4.58579C3.1734 4 4.11621 4 6.00183 4H18.0018C19.8874 4 20.8303 4 21.416 4.58579C22.0018 5.17157 22.0018 6.11438 22.0018 8V13C22.0018 14.1046 21.1064 15 20.0018 15\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" />\n            <motion.path d=\"M6.00183 10H18.0018\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"louvreVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 10px' }\" />\n            <motion.path d=\"M16.0018 15V16C16.0018 18.2091 17.7927 20 20.0018 20\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"jetRightVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '16px 15px' }\" />\n            <motion.path d=\"M8.00183 15V16C8.00183 18.2091 6.21097 20 4.00183 20\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"jetLeftVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '8px 15px' }\" />\n            <motion.path d=\"M12.0018 20V15\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"jetMiddleVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 15px' }\" />\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"
    }
  ]
}
