{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "biohazard",
  "type": "registry:ui",
  "title": "biohazard",
  "description": "Animated biohazard icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/biohazard.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: 'BiohazardIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after bug-01: the body jitters the way a live culture does under the lens\n// generated from @hugeicons/core-free-icons\nconst iconVariants: Variants = {\n  normal: {\n    transform: 'translate(0px, 0px) rotate(0deg)',\n  },\n  animate: {\n    transform: ['translate(0px, 0px) rotate(0deg)', 'translate(0.6px, -0.5px) rotate(2.98deg)', 'translate(-0.5px, 0.4px) rotate(-2.98deg)', 'translate(0.4px, 0.5px) rotate(1.99deg)', 'translate(-0.3px, -0.4px) rotate(-0.99deg)', 'translate(0px, 0px) rotate(0deg)'],\n    transition: {\n      duration: 0.45,\n      ease: 'linear',\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=\"M13.8661 12.127C13.8661 13.2315 12.9707 14.127 11.8661 14.127C10.7615 14.127 9.86612 13.2315 9.86612 12.127C9.86612 11.0224 10.7615 10.127 11.8661 10.127C12.9707 10.127 13.8661 11.0224 13.8661 12.127Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 11.11px' }\" />\n            <motion.path d=\"M2.15463 14.3883C2.70573 12.226 4.66613 10.627 7.00002 10.627C8.09928 10.627 9.11569 10.9817 9.94101 11.5829M5.81568 20.4859C6.19535 20.5781 6.59198 20.627 7.00002 20.627C9.76144 20.627 12 18.3884 12 15.627C12 15.1035 11.9196 14.5989 11.7704 14.1247\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 11.11px' }\" />\n            <motion.path d=\"M21.8454 14.3883C21.2943 12.226 19.3339 10.627 17 10.627C15.7978 10.627 14.6947 11.0513 13.8322 11.7583M18.1844 20.4859C17.8047 20.5781 17.4081 20.627 17 20.627C14.2386 20.627 12 18.3884 12 15.627C12 15.0915 12.0842 14.5757 12.24 14.0921\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 11.11px' }\" />\n            <motion.path d=\"M15.7961 3.37305C16.5466 4.24764 17 5.38454 17 6.62736C17 8.7915 15.6251 10.6345 13.7011 11.3306M8.20393 3.37305C7.45347 4.24764 7.00003 5.38454 7.00003 6.62736C7.00003 8.70549 8.26784 10.4875 10.0722 11.2422\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 11.11px' }\" />\n            <motion.path d=\"M17.8113 15.0421C17.5256 15.6105 17.159 16.1312 16.7266 16.5891M7.27362 16.5891C6.84119 16.1312 6.47456 15.6105 6.18887 15.0421M11.0029 5.70296C11.328 5.65292 11.661 5.62695 12.0001 5.62695C12.3392 5.62695 12.6722 5.65292 12.9973 5.70296\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 11.11px' }\" />\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"
    }
  ]
}
