{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "mic-01",
  "title": "mic-01",
  "description": "Animated mic icon",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "icons/mic-01.tsx",
      "content": "'use client';\n\nimport type { Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\nimport type { HTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { useIconAnimation } from '@/lib/use-icon-animation';\nimport { cn } from '@/lib/utils';\n\nexport interface Mic01IconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface Mic01IconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\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\n\nconst Mic01Icon = forwardRef<Mic01IconHandle, Mic01IconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const controls = useAnimation();\n    const { handleMouseEnter, handleMouseLeave } = useIconAnimation({\n      controls,\n      loops: true,\n      onMouseEnter,\n      onMouseLeave,\n      ref,\n    });\n\n    return (\n      <div\n        className={cn(className)}\n        onMouseEnter={handleMouseEnter}\n        onMouseLeave={handleMouseLeave}\n        {...props}\n      >\n        <svg\n          xmlns=\"http://www.w3.org/2000/svg\"\n          width={size}\n          height={size}\n          viewBox=\"0 0 24 24\"\n          fill=\"none\"\n          overflow=\"visible\"\n        >\n          <path\n            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\"\n            stroke=\"currentColor\"\n            strokeWidth=\"1.5\"\n          />\n          <motion.path\n            d=\"M17 7H14M17 11H14\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={grilleBaseVariants}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <path\n            d=\"M20 11C20 15.4183 16.4183 19 12 19M12 19C7.58172 19 4 15.4183 4 11M12 19V22M12 22H15M12 22H9\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n          />\n          <motion.g\n            variants={generatedGeometryVariants}\n            animate={controls}\n            initial=\"normal\"\n          >\n          <motion.path\n            d=\"M17 7H14\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={grilleBarVariants}\n            custom={0}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <motion.path\n            d=\"M17 11H14\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={grilleBarVariants}\n            custom={1}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <motion.path\n            d=\"M4.8 3.2C3.9 4.4 3.4 5.9 3.4 7.5\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={waveVariants}\n            custom={[-1, 0]}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <motion.path\n            d=\"M19.2 3.2C20.1 4.4 20.6 5.9 20.6 7.5\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={waveVariants}\n            custom={[1, 0]}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <motion.path\n            d=\"M2.6 1.4C1.5 2.9 0.9 4.9 0.9 7\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={waveVariants}\n            custom={[-1, 0.35]}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <motion.path\n            d=\"M21.4 1.4C22.5 2.9 23.1 4.9 23.1 7\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={waveVariants}\n            custom={[1, 0.35]}\n            animate={controls}\n            initial=\"normal\"\n          />\n          </motion.g>\n        </svg>\n      </div>\n    );\n  }\n);\n\nMic01Icon.displayName = 'Mic01Icon';\n\nexport { Mic01Icon };\n",
      "type": "registry:ui"
    },
    {
      "path": "lib/use-icon-animation.ts",
      "content": "'use client';\n\nimport type { LegacyAnimationControls } from 'motion/react';\nimport { useReducedMotion } from 'motion/react';\nimport type {\n  ForwardedRef,\n  MouseEventHandler,\n} from 'react';\nimport { useCallback, useImperativeHandle, useRef } from 'react';\n\nexport interface AnimatedIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface UseIconAnimationOptions {\n  controls: LegacyAnimationControls;\n  loops?: boolean;\n  onMouseEnter?: MouseEventHandler<HTMLDivElement>;\n  onMouseLeave?: MouseEventHandler<HTMLDivElement>;\n  ref: ForwardedRef<AnimatedIconHandle>;\n}\n\nexport function useIconAnimation({\n  controls,\n  loops = false,\n  onMouseEnter,\n  onMouseLeave,\n  ref,\n}: UseIconAnimationOptions) {\n  const shouldReduceMotion = useReducedMotion();\n  const isControlledRef = useRef(false);\n  const isPlayingRef = useRef(false);\n  const runRef = useRef(0);\n\n  const startAnimation = useCallback(() => {\n    if (shouldReduceMotion || isPlayingRef.current) return;\n\n    isPlayingRef.current = true;\n    const run = ++runRef.current;\n    controls.set('normal');\n    void controls.start('animate').then(() => {\n      if (runRef.current === run) isPlayingRef.current = false;\n    });\n  }, [controls, shouldReduceMotion]);\n\n  const stopAnimation = useCallback(() => {\n    if (!loops) return;\n\n    runRef.current++;\n    isPlayingRef.current = false;\n    void controls.start('normal');\n  }, [controls, loops]);\n\n  useImperativeHandle(\n    ref,\n    () => {\n      isControlledRef.current = true;\n      return { startAnimation, stopAnimation };\n    },\n    [startAnimation, stopAnimation]\n  );\n\n  const handleMouseEnter = useCallback<MouseEventHandler<HTMLDivElement>>(\n    (event) => {\n      onMouseEnter?.(event);\n      if (!isControlledRef.current) startAnimation();\n    },\n    [onMouseEnter, startAnimation]\n  );\n\n  const handleMouseLeave = useCallback<MouseEventHandler<HTMLDivElement>>(\n    (event) => {\n      onMouseLeave?.(event);\n      if (!isControlledRef.current) stopAnimation();\n    },\n    [onMouseLeave, stopAnimation]\n  );\n\n  return { handleMouseEnter, handleMouseLeave };\n}\n",
      "type": "registry:lib"
    }
  ],
  "type": "registry:ui"
}