{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "umbrella",
  "title": "umbrella",
  "description": "Animated umbrella icon",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "icons/umbrella.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 UmbrellaIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface UmbrellaIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\n// drops reach the canopy and make a small connected splash at contact\nconst svgVariants: Variants = {\n  normal: { rotate: 0, transition: { duration: 0.3 } },\n  animate: {\n    rotate: [0, -5, 3.5, -1.5, 0],\n    transition: { duration: 1.8, ease: 'easeInOut', repeat: Infinity },\n  },\n};\n\nconst dropVariants: Variants = {\n  normal: { opacity: 0, visibility: 'hidden', transition: { duration: 0.15 } },\n  animate: (i: number) => ({\n    opacity: [0, 1, 1, 0],\n    visibility: ['hidden', 'visible', 'visible', 'hidden'],\n    translateY: [0, 5, 10.5, 14],\n    transition: {\n      duration: 0.9,\n      ease: 'easeIn',\n      times: [0, 0.2, 0.8, 1],\n      repeat: Infinity,\n      delay: i * 0.3,\n    },\n  }),\n};\n\nconst impactVariants: Variants = {\n  normal: { opacity: 0, visibility: 'hidden', transform: 'scale(0.3)' },\n  animate: (i: number) => ({\n    opacity: [0, 0, 1, 0],\n    visibility: ['hidden', 'hidden', 'visible', 'hidden'],\n    transform: ['scale(0.3)', 'scale(0.3)', 'scale(1)', 'scale(1.25)'],\n    transition: { duration: 0.9, delay: i * 0.3, times: [0, 0.78, 0.88, 1], ease: [0.23, 1, 0.32, 1], repeat: Infinity },\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 UmbrellaIcon = forwardRef<UmbrellaIconHandle, UmbrellaIconProps>(\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        <motion.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          variants={svgVariants}\n          animate={controls}\n          initial=\"normal\"\n          style={{ transformOrigin: '12px 14px' }}\n        >\n          <path\n            d=\"M12 3.5V2\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeWidth=\"1.5\"\n          />\n          <path\n            d=\"M12 3.5C11.0608 3.5 7.52791 7.29323 6.97182 12.2037M12 3.5C12.9392 3.5 16.4721 7.29322 17.0282 12.2037M12 3.5C16.9367 3.5 21.0545 6.93552 22 11.5C20.6123 12.7 18.1073 12.4691 17.0282 12.2037M12 3.5C7.06333 3.5 2.94545 6.93552 2 11.5C3.38792 12.7 5.89285 12.4691 6.97182 12.2037M6.97182 12.2037C8.4559 13.0288 10.1718 13.5 12 13.5C13.8282 13.5 15.5441 13.0288 17.0282 12.2037\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeWidth=\"1.5\"\n          />\n          <path\n            d=\"M12 13.5V20.5C12 21.3284 11.3284 22 10.5 22C9.67157 22 9 21.3284 9 20.5V20\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeWidth=\"1.5\"\n          />\n          <motion.g\n            variants={generatedGeometryVariants}\n            animate={controls}\n            initial=\"normal\"\n          >\n          <motion.path\n            d=\"M5.5 -2.5V-0.5\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={dropVariants}\n            custom={0}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <motion.path\n            d=\"M12 -4V-2\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={dropVariants}\n            custom={1}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <motion.path\n            d=\"M18.5 -2.5V-0.5\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={dropVariants}\n            custom={2}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <motion.path d=\"M4.5 11.7L5.5 10.9L6.5 11.7\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1\" variants={impactVariants} custom={0} animate={controls} initial=\"normal\" style={{ transformOrigin: '5.5px 11.5px' }} />\n          <motion.path d=\"M11 12.8L12 12L13 12.8\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1\" variants={impactVariants} custom={1} animate={controls} initial=\"normal\" style={{ transformOrigin: '12px 12.5px' }} />\n          <motion.path d=\"M17.5 11.7L18.5 10.9L19.5 11.7\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1\" variants={impactVariants} custom={2} animate={controls} initial=\"normal\" style={{ transformOrigin: '18.5px 11.5px' }} />\n          </motion.g>\n        </motion.svg>\n      </div>\n    );\n  }\n);\n\nUmbrellaIcon.displayName = 'UmbrellaIcon';\n\nexport { UmbrellaIcon };\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"
}