{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "message-edit-02",
  "type": "registry:ui",
  "title": "message-edit-02",
  "description": "Animated message edit icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/message-edit-02.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: 'MessageEdit02Icon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after message-01: the speech tail anchors the bubble as it answers\n// generated from @hugeicons/core-free-icons\nconst iconVariants: Variants = {\n  normal: {\n    transform: 'scale(1)',\n  },\n  animate: {\n    transform: ['scale(1)', 'scale(0.92)', 'scale(1.08)', 'scale(1)'],\n    transition: {\n      duration: 0.47,\n      ease: [0.23, 1, 0.32, 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=\"M14 3.09119C13.3796 3.03118 12.714 3.00012 12 3.00012C4.13281 3.00012 2 7.02956 2 12.0001C2 14.0714 2.37034 15.9792 3.37161 17.5001C4.63281 19.5001 3.99253 21.3335 3 22.0001C4.61547 22.0001 5.70211 21.4859 6.39239 20.9767C6.88252 20.6152 7.50688 20.4365 8.0984 20.5816C9.20689 20.8535 10.4991 21.0001 12 21.0001C19.1328 21.0001 22 16.9707 22 12.0001C22 10.9482 21.9164 9.93846 21.7074 9.00012\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12.5px' }\" />\n            <motion.path d=\"M12.1248 12.0001H11.9998M8.125 12.0001H8M12.2498 12.0001C12.2498 12.1382 12.1379 12.2501 11.9998 12.2501C11.8618 12.2501 11.7498 12.1382 11.7498 12.0001C11.7498 11.8621 11.8618 11.7501 11.9998 11.7501C12.1379 11.7501 12.2498 11.8621 12.2498 12.0001ZM8.25 12.0001C8.25 12.1382 8.13807 12.2501 8 12.2501C7.86193 12.2501 7.75 12.1382 7.75 12.0001C7.75 11.8621 7.86193 11.7501 8 11.7501C8.13807 11.7501 8.25 11.8621 8.25 12.0001Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12.5px' }\" />\n            <motion.path d=\"M15.7844 6.08469L19.5505 2.32961C19.9916 1.89029 20.7068 1.89029 21.1478 2.32962L21.6692 2.84888C22.1103 3.2882 22.1103 4.00049 21.6692 4.43982L17.9378 8.21148C17.723 8.42549 17.4481 8.56975 17.1494 8.62531L15.4566 8.99134C15.1893 9.04913 14.9513 8.81276 15.0086 8.54639L15.3689 6.86995C15.4247 6.57244 15.5695 6.2987 15.7844 6.08469Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12.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"
    }
  ]
}
