{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "delete-03",
  "title": "delete-03",
  "description": "Animated delete icon",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "icons/delete-03.tsx",
      "content": "'use client';\n\nimport type { Easing, 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 Delete03IconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface Delete03IconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\n// Page, as in delete-02: the bin crouches, the lid flips open on its right\n// hinge as the bin stretches up, hangs open for a beat, then slams shut. The\n// bin squashes from its base under the slam, the lid bounces once on the rim,\n// and both settle.\nconst TRASH_DURATION = 1;\nconst SNAP: Easing = [0.23, 1, 0.32, 1];\nconst SLAM: Easing = [0.55, 0, 1, 0.45];\n\nconst lidVariants: Variants = {\n  normal: { transform: 'translateY(0px) rotate(0deg)' },\n  animate: {\n    transform: [\n      'translateY(0px) rotate(0deg)',\n      'translateY(0.3px) rotate(-3deg)',\n      'translateY(-1px) rotate(24deg)',\n      'translateY(-0.8px) rotate(19deg)',\n      'translateY(0px) rotate(-2deg)',\n      'translateY(-0.3px) rotate(4deg)',\n      'translateY(0px) rotate(-1deg)',\n      'translateY(0px) rotate(0deg)',\n    ],\n    transition: {\n      duration: TRASH_DURATION,\n      times: [0, 0.12, 0.34, 0.5, 0.6, 0.7, 0.82, 1],\n      ease: [SNAP, SNAP, 'easeInOut', SLAM, SNAP, 'easeInOut', 'easeInOut'],\n    },\n  },\n};\n\nconst binVariants: Variants = {\n  normal: { transform: 'scaleX(1) scaleY(1)' },\n  animate: {\n    transform: [\n      'scaleX(1) scaleY(1)',\n      'scaleX(1.02) scaleY(0.96)',\n      'scaleX(0.985) scaleY(1.03)',\n      'scaleX(1) scaleY(1)',\n      'scaleX(1.05) scaleY(0.92)',\n      'scaleX(0.985) scaleY(1.03)',\n      'scaleX(1.005) scaleY(0.99)',\n      'scaleX(1) scaleY(1)',\n    ],\n    transition: {\n      duration: TRASH_DURATION,\n      times: [0, 0.12, 0.34, 0.5, 0.6, 0.72, 0.86, 1],\n      ease: [SNAP, SNAP, 'easeInOut', SLAM, SNAP, 'easeInOut', 'easeInOut'],\n    },\n  },\n};\n\nconst Delete03Icon = forwardRef<Delete03IconHandle, Delete03IconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const controls = useAnimation();\n    const { handleMouseEnter, handleMouseLeave } = useIconAnimation({\n      controls,\n      loops: false,\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          <motion.path\n            d=\"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={binVariants}\n            animate={controls}\n            initial=\"normal\"\n            style={{ transformBox: 'view-box', originX: 12 / 24, originY: 22 / 24 }}\n          />\n          <motion.path\n            d=\"M9 11.7349H15\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={binVariants}\n            animate={controls}\n            initial=\"normal\"\n            style={{ transformBox: 'view-box', originX: 12 / 24, originY: 22 / 24 }}\n          />\n          <motion.path\n            d=\"M10.5 15.6543H13.5\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={binVariants}\n            animate={controls}\n            initial=\"normal\"\n            style={{ transformBox: 'view-box', originX: 12 / 24, originY: 22 / 24 }}\n          />\n          <motion.path\n            d=\"M3 5.5H21M16.0555 5.5L15.3729 4.09173C14.9194 3.15626 14.6926 2.68852 14.3015 2.39681C14.2148 2.3321 14.1229 2.27454 14.0268 2.2247C13.5937 2 13.0739 2 12.0343 2C10.9686 2 10.4358 2 9.99549 2.23412C9.89791 2.28601 9.80479 2.3459 9.7171 2.41317C9.32145 2.7167 9.10044 3.20155 8.65842 4.17126L8.05273 5.5\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeWidth=\"1.5\"\n            variants={lidVariants}\n            animate={controls}\n            initial=\"normal\"\n            style={{ transformBox: 'view-box', originX: 20.5 / 24, originY: 5.5 / 24 }}\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nDelete03Icon.displayName = 'Delete03Icon';\n\nexport { Delete03Icon };\n",
      "type": "registry:ui"
    },
    {
      "path": "lib/use-icon-animation.ts",
      "content": "'use client';\n\nimport type { LegacyAnimationControls } from 'motion/react';\nimport { spring, useReducedMotion } from 'motion/react';\nimport type {\n  ForwardedRef,\n  MouseEventHandler,\n} from 'react';\nimport { useCallback, useImperativeHandle, useRef } from 'react';\n\n/**\n * A damped spring as the easing of one keyframe segment: the value overshoots\n * its target and settles on it. Use it for landings so every icon shares the\n * same physical bounce. Higher `bounce` gives more oscillation.\n */\nexport function springEase(bounce = 0.45, visualDuration = 0.35) {\n  const generator = spring({ keyframes: [0, 1], bounce, visualDuration });\n  let settle = 0;\n  while (!generator.next(settle).done && settle < 5000) settle += 10;\n  return (progress: number) =>\n    progress >= 1 ? 1 : generator.next(progress * settle).value;\n}\n\nconst NUMBER = /-?\\d*\\.?\\d+/g;\n\n/**\n * The path at position `t` along a row of poses that share the same path\n * commands: `t = 1` is the second pose, `t = 1.5` is halfway to the third.\n * Waves use it to move along their own curvature instead of scaling, so the\n * stroke keeps its width.\n */\nexport function pathAt(poses: string[], t: number) {\n  const i = Math.min(Math.max(Math.floor(t), 0), poses.length - 2);\n  const to = poses[i + 1].match(NUMBER) ?? [];\n  let k = 0;\n  return poses[i].replace(NUMBER, (from) => {\n    const value = Number(from) + (Number(to[k++]) - Number(from)) * (t - i);\n    return String(Math.round(value * 10000) / 10000);\n  });\n}\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"
}