{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "bandage",
  "type": "registry:ui",
  "title": "bandage",
  "description": "Animated bandage icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/bandage.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: 'BandageIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after checkmark-circle-01: the dressing presses on and the confirmation settles\n// generated from @hugeicons/core-free-icons\nconst frameVariants: Variants = {\n  normal: {\n    transform: 'translateY(0px) rotate(0deg) scale(1)',\n  },\n  animate: {\n    transform: ['translateY(0px) rotate(0deg) scale(1)', 'translateY(0px) rotate(0deg) scale(1)', 'translateY(-0.35px) rotate(0.79deg) scale(1.08)', 'translateY(0px) rotate(0deg) scale(1)'],\n    transition: {\n      duration: 0.8,\n      ease: [\n        'linear',\n        [0.23, 1, 0.32, 1],\n        [0.23, 1, 0.32, 1],\n      ],\n      times: [0, 0.78, 0.9, 1],\n    },\n  },\n}\n\nconst markVariants: Variants = {\n  normal: {\n    pathLength: 1,\n    pathOffset: 0,\n    visibility: 'visible',\n  },\n  animate: {\n    pathLength: [1, 1, 0.12, 0, 0, 0.12, 1, 1],\n    pathOffset: [0, 0, 0.88, 1, 0, 0, 0, 0],\n    visibility: ['visible', 'visible', 'hidden', 'hidden', 'hidden', 'hidden', 'visible', 'visible'],\n    transition: {\n      duration: 0.87,\n      ease: [\n        'linear',\n        [0.77, 0, 0.175, 1],\n        'linear',\n        'linear',\n        'linear',\n        [0.77, 0, 0.175, 1],\n        'linear',\n      ],\n      times: [0, 0.06, 0.25, 0.28, 0.35, 0.39, 0.84, 1],\n    },\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=\"M11.0251 19.7993L19.7993 11.0249C21.0551 9.7691 21.6829 9.14122 21.8901 8.40682C22.0366 7.88753 22.0366 7.33783 21.8901 6.81854C21.6829 6.08415 21.055 5.45629 19.7992 4.20057C18.5435 2.94488 17.9156 2.31704 17.1813 2.10987C16.662 1.96337 16.1123 1.96338 15.593 2.10988C14.8586 2.31707 14.2308 2.94493 12.9751 4.20063L4.20071 12.975C2.94494 14.2307 2.31705 14.8586 2.10987 15.593C1.96338 16.1123 1.96338 16.662 2.10987 17.1812C2.31705 17.9156 2.94494 18.5435 4.20071 19.7993C5.45649 21.0551 6.08438 21.683 6.81881 21.8901C7.33808 22.0366 7.88774 22.0366 8.407 21.8901C9.14143 21.6829 9.76932 21.055 11.0251 19.7993Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"frameVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\" />\n            <motion.path d=\"M13 5L19 11M5 13L11 19\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"frameVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\" />\n            <motion.path d=\"M14.5 11.875V12M14.25 12C14.25 12.1381 14.3619 12.25 14.5 12.25C14.6381 12.25 14.75 12.1381 14.75 12C14.75 11.8619 14.6381 11.75 14.5 11.75C14.3619 11.75 14.25 11.8619 14.25 12Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"frameVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '14.5px 12px' }\" />\n            <motion.path d=\"M12 9.375V9.5M11.75 9.5C11.75 9.63807 11.8619 9.75 12 9.75C12.1381 9.75 12.25 9.63807 12.25 9.5C12.25 9.36193 12.1381 9.25 12 9.25C11.8619 9.25 11.75 9.36193 11.75 9.5Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"frameVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 9.5px' }\" />\n            <motion.path d=\"M9.5 11.875V12M9.25 12C9.25 12.1381 9.36193 12.25 9.5 12.25C9.63807 12.25 9.75 12.1381 9.75 12C9.75 11.8619 9.63807 11.75 9.5 11.75C9.36193 11.75 9.25 11.8619 9.25 12Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"frameVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '9.5px 12px' }\" />\n            <motion.path d=\"M12 14.375V14.5M11.75 14.5C11.75 14.6381 11.8619 14.75 12 14.75C12.1381 14.75 12.25 14.6381 12.25 14.5C12.25 14.3619 12.1381 14.25 12 14.25C11.8619 14.25 11.75 14.3619 11.75 14.5Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"markVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 14.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"
    }
  ]
}
