{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "mic-01",
  "type": "registry:ui",
  "title": "mic-01",
  "description": "Animated mic icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/mic-01.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: 'Mic01Icon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// while you hover, it's live — the grille bars pulse like an input meter\n// and drawn sound arcs broadcast off both sides. The built-in grille (one\n// path, two lockstep bars) hides during hover and hands off to two\n// independently clocked bars, so the meter doesn't blink as one flat unit.\nconst grilleBaseVariants: Variants = {\n  normal: { visibility: 'visible', transition: { duration: 0.3, delay: 0.1 } },\n  animate: { visibility: 'hidden', transition: { duration: 0.15 } },\n};\n\n// pathLength retract from the mic-body edge, like a VU bar\nconst grilleBarVariants: Variants = {\n  normal: { pathLength: 1, visibility: 'hidden', transition: { duration: 0.15 } },\n  animate: (i: number) => ({\n    visibility: 'visible',\n    pathLength: [1, 0.3, 1],\n    transition: {\n      duration: 1 + i * 0.2,\n      ease: 'easeInOut',\n      repeat: Infinity,\n      delay: i * 0.25,\n    },\n  }),\n};\n\n// custom: [direction, delay] — arcs drift outward as they fade\nconst waveVariants: Variants = {\n  normal: { visibility: 'hidden', transition: { duration: 0.15 } },\n  animate: (c: [number, number]) => ({\n    visibility: ['hidden', 'visible', 'hidden'],\n    translateX: [0, c[0] * 1.6],\n    transition: {\n      duration: 1.2,\n      ease: 'easeOut',\n      repeat: Infinity,\n      delay: c[1],\n    },\n  }),\n};\nconst generatedGeometryVariants: Variants = {\n  normal: { visibility: 'hidden', transition: { duration: 0.08 } },\n  animate: { visibility: 'visible', transition: { duration: 0.08 } },\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=\"M17 7V11C17 13.7614 14.7614 16 12 16C9.23858 16 7 13.7614 7 11V7C7 4.23858 9.23858 2 12 2C14.7614 2 17 4.23858 17 7Z\" stroke=\"currentColor\" stroke-width=\"1.5\" />\n            <motion.path d=\"M17 7H14M17 11H14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"grilleBaseVariants\" :animate=\"controls\" initial=\"normal\" />\n            <path d=\"M20 11C20 15.4183 16.4183 19 12 19M12 19C7.58172 19 4 15.4183 4 11M12 19V22M12 22H15M12 22H9\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" />\n            <motion.g :variants=\"generatedGeometryVariants\" :animate=\"controls\" initial=\"normal\">\n            <motion.path d=\"M17 7H14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"grilleBarVariants\" :custom=\"0\" :animate=\"controls\" initial=\"normal\" />\n            <motion.path d=\"M17 11H14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"grilleBarVariants\" :custom=\"1\" :animate=\"controls\" initial=\"normal\" />\n            <motion.path d=\"M4.8 3.2C3.9 4.4 3.4 5.9 3.4 7.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"waveVariants\" :custom=\"[-1, 0]\" :animate=\"controls\" initial=\"normal\" />\n            <motion.path d=\"M19.2 3.2C20.1 4.4 20.6 5.9 20.6 7.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"waveVariants\" :custom=\"[1, 0]\" :animate=\"controls\" initial=\"normal\" />\n            <motion.path d=\"M2.6 1.4C1.5 2.9 0.9 4.9 0.9 7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"waveVariants\" :custom=\"[-1, 0.35]\" :animate=\"controls\" initial=\"normal\" />\n            <motion.path d=\"M21.4 1.4C22.5 2.9 23.1 4.9 23.1 7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"waveVariants\" :custom=\"[1, 0.35]\" :animate=\"controls\" initial=\"normal\" />\n            </motion.g>\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"
    }
  ]
}
