{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "lamp-wall-down",
  "type": "registry:ui",
  "title": "lamp-wall-down",
  "description": "Animated lamp wall down icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/lamp-wall-down.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: 'LampWallDownIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after fire: the filament comes up to brightness and holds\n// generated from @hugeicons/core-free-icons\nconst iconVariants: Variants = {\n  normal: {\n    transform: 'scale(1) rotate(0deg)',\n  },\n  animate: {\n    transform: ['scale(1) rotate(0deg)', 'scale(1.08) rotate(-3.2deg)', 'scale(0.96) rotate(2.13deg)', 'scale(1.04) rotate(-1.07deg)', 'scale(1) rotate(0deg)'],\n    transition: {\n      duration: 0.58,\n      ease: [0.77, 0, 0.175, 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=\"M8.65938 21H19.3406C20.257 21 21 20.2571 21 19.3406C21 19.1159 20.9543 18.8935 20.8658 18.6869L19.039 14.4243C18.5351 13.2485 18.2831 12.6606 17.7822 12.3303C17.2812 12 16.6416 12 15.3624 12H12.6376C11.3583 12 10.7187 12 10.2178 12.3303C9.71686 12.6606 9.4649 13.2485 8.96099 14.4243L7.13416 18.6869C7.04563 18.8935 6.99998 19.1159 6.99998 19.3406C6.99998 20.2571 7.74292 21 8.65938 21Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '14px 21px' }\" />\n            <motion.path d=\"M8.99998 16H19\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '14px 21px' }\" />\n            <motion.path d=\"M2.99995 7.66667V4.33333C2.99995 4.02334 2.99995 3.86835 3.03403 3.74118C3.1265 3.39609 3.39604 3.12654 3.74114 3.03407C3.8683 3 4.0233 3 4.33329 3C4.95327 3 5.26326 3 5.51759 3.06815C6.20778 3.25308 6.74687 3.79218 6.93181 4.48236C6.99995 4.73669 6.99995 5.04669 6.99995 5.66667V6.33333C6.99995 6.95331 6.99995 7.26331 6.93181 7.51764C6.74687 8.20782 6.20778 8.74692 5.51759 8.93185C5.26326 9 4.95327 9 4.33329 9C4.0233 9 3.8683 9 3.74114 8.96593C3.39604 8.87346 3.1265 8.60391 3.03403 8.25882C2.99995 8.13165 2.99995 7.97666 2.99995 7.66667Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '14px 21px' }\" />\n            <motion.path d=\"M6.99998 6H7.99998C10.8284 6 12.2426 6 13.1213 6.87868C14 7.75736 14 9.17157 14 12\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '14px 21px' }\" />\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"
    }
  ]
}
