{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "help-circle",
  "title": "help-circle",
  "description": "Animated help circle icon",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "icons/help-circle.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 HelpCircleIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface HelpCircleIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst circleVariants: Variants = {\n  normal: { transform: 'scale(1)' },\n  animate: {\n    transform: ['scale(1)', 'scale(0.98)', 'scale(1.018)', 'scale(0.996)', 'scale(1)'],\n    transition: {\n      duration: 0.62,\n      ease: [0.23, 1, 0.32, 1],\n      times: [0, 0.2, 0.5, 0.76, 1],\n    },\n  },\n};\n\nconst questionVariants: Variants = {\n  normal: { transform: 'rotate(0deg) translateY(0px)' },\n  animate: {\n    transform: ['rotate(0deg) translateY(0px)', 'rotate(-10deg) translateY(-0.2px)', 'rotate(7deg) translateY(0.1px)', 'rotate(-2deg) translateY(0px)', 'rotate(0deg) translateY(0px)'],\n    transition: {\n      duration: 0.62,\n      ease: [0.23, 1, 0.32, 1],\n      times: [0, 0.2, 0.48, 0.74, 1],\n    },\n  },\n};\n\nconst questionDotVariants: Variants = {\n  normal: { transform: 'scale(1)' },\n  animate: {\n    transform: ['scale(1)', 'scale(0.88)', 'scale(1.16)', 'scale(0.94)', 'scale(1)'],\n    transition: {\n      duration: 0.62,\n      ease: [0.23, 1, 0.32, 1],\n      times: [0, 0.2, 0.48, 0.74, 1],\n    },\n  },\n};\n\nconst HelpCircleIcon = forwardRef<HelpCircleIconHandle, HelpCircleIconProps>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n  const controls = useAnimation();\n  const { handleMouseEnter, handleMouseLeave } = useIconAnimation({\n    controls,\n    onMouseEnter,\n    onMouseLeave,\n    ref,\n  });\n\n  return (\n    <div className={cn(className)} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave} {...props}>\n      <svg xmlns=\"http://www.w3.org/2000/svg\" width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" overflow=\"visible\">\n        <motion.circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.5\" variants={circleVariants} style={{ transformOrigin: '12px 12px' }} animate={controls} initial=\"normal\" />\n        <motion.path d=\"M9.5 9.5C9.5 8.11929 10.6193 7 12 7C13.3807 7 14.5 8.11929 14.5 9.5C14.5 10.3569 14.0689 11.1131 13.4117 11.5636C12.7283 12.0319 12 12.6716 12 13.5\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.5\" variants={questionVariants} style={{ transformOrigin: '12px 16.75px' }} animate={controls} initial=\"normal\" />\n        <motion.path d=\"M12.125 16.75H12M12.25 16.75C12.25 16.8881 12.1381 17 12 17C11.8619 17 11.75 16.8881 11.75 16.75C11.75 16.6119 11.8619 16.5 12 16.5C12.1381 16.5 12.25 16.6119 12.25 16.75Z\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.5\" variants={questionDotVariants} style={{ transformOrigin: '12px 16.75px' }} animate={controls} initial=\"normal\" />\n      </svg>\n    </div>\n  );\n});\n\nHelpCircleIcon.displayName = 'HelpCircleIcon';\n\nexport { HelpCircleIcon };\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"
}