{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tick-double-01",
  "title": "tick-double-01",
  "description": "Animated tick double icon",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "icons/tick-double-01.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 TickDouble01IconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface TickDouble01IconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\n// rest-parity: split-source-path\n// The back tick is split at its gap so each piece can be written in pen order.\nconst BACK_SHORT_PATH =\n  'M3 13.3333C3 13.3333 4.5 14 6.5 17C6.5 17 6.78485 16.5192 7.32133 15.7526';\nconst BACK_LONG_PATH = 'M17 6C14.7085 7.14577 12.3119 9.55181 10.3879 11.8223';\nconst FRONT_PATH = 'M8 13.3333C8 13.3333 9.5 14 11.5 17C11.5 17 17 8.5 22 6';\n// The pen lifts along the end tangent of each long arm.\nconst BACK_LIFT_PATH = 'M17 6L17.62 5.69';\nconst FRONT_LIFT_PATH = 'M22 6L22.62 5.69';\n\n// The front tick is written a beat after the back tick.\nconst FRONT_DELAY = 0.08;\nconst STROKE_EASE: Easing = [0.77, 0, 0.175, 1];\n\nconst penLiftVariants: Variants = {\n  normal: { pathLength: 0, opacity: 0, visibility: 'hidden' },\n  animate: (delay: number) => ({\n    pathLength: [0, 0, 1, 1],\n    opacity: [0, 0, 0.72, 0],\n    visibility: ['hidden', 'hidden', 'visible', 'hidden'],\n    transition: {\n      duration: 0.9,\n      delay,\n      ease: [\n        'linear',\n        [0.23, 1, 0.32, 1],\n        [0.23, 1, 0.32, 1],\n      ],\n      times: [0, 0.765, 0.89, 1],\n    },\n  }),\n};\n\nconst generatedGeometryVariants: Variants = {\n  normal: { visibility: 'hidden', transition: { duration: 0.08 } },\n  animate: { visibility: 'visible', transition: { duration: 0 } },\n};\n\n// The completed strokes compress once as the front tick lands, then release\n// without a trailing bounce.\nconst impactVariants: Variants = {\n  normal: { transform: 'translateY(0px) rotate(0deg) scale(1)' },\n  animate: {\n    transform: [\n      'translateY(0px) rotate(0deg) scale(1)',\n      'translateY(0px) rotate(0deg) scale(1)',\n      'translateY(-0.35px) rotate(0.8deg) scale(1.08)',\n      'translateY(0px) rotate(0deg) scale(1)',\n    ],\n    transition: {\n      duration: 0.82,\n      delay: FRONT_DELAY,\n      ease: ['linear', [0.23, 1, 0.32, 1], [0.23, 1, 0.32, 1]],\n      times: [0, 0.78, 0.9, 1],\n    },\n  },\n};\n\n// Check, as in Tick 02: each tick is erased from its tail, written again with\n// a rest at the corner, and the pen lifts off the end of the long arm. The\n// offset resets while the path is hidden, so no cap or jump shows.\nconst frontVariants: Variants = {\n  normal: { pathLength: 1, pathOffset: 0, visibility: 'visible' },\n  animate: {\n    pathLength: [1, 1, 0.12, 0, 0, 0.12, 0.25, 0.25, 1, 1],\n    pathOffset: [0, 0, 0.88, 1, 0, 0, 0, 0, 0, 0],\n    visibility: [\n      'visible',\n      'visible',\n      'hidden',\n      'hidden',\n      'hidden',\n      'hidden',\n      'visible',\n      'visible',\n      'visible',\n      'visible',\n    ],\n    transition: {\n      duration: 0.82,\n      delay: FRONT_DELAY,\n      ease: [\n        'linear',\n        STROKE_EASE,\n        'linear',\n        'linear',\n        'linear',\n        STROKE_EASE,\n        'linear',\n        STROKE_EASE,\n        'linear',\n      ],\n      times: [0, 0.06, 0.25, 0.28, 0.35, 0.39, 0.5, 0.57, 0.84, 1],\n    },\n  },\n};\n\n// The back tick is the front tick shifted left, written with the same\n// keyframes as one stroke that jumps the gap. Its short piece holds the first\n// 0.323 of that stroke and its long piece the last 0.433. The keyframes are cut\n// where the eraser and the pen cross the gap, and each cut ease is the matching\n// part of the stroke ease, so the motion is the same as one stroke.\nconst backShortVariants: Variants = {\n  normal: { pathLength: 1, pathOffset: 0, visibility: 'visible' },\n  animate: {\n    pathLength: [1, 1, 0, 0.372, 0.774, 0.774, 1, 1],\n    pathOffset: [0, 0, 1, 0, 0, 0, 0, 0],\n    visibility: ['visible', 'visible', 'hidden', 'hidden', 'visible', 'visible', 'visible', 'visible'],\n    transition: {\n      duration: 0.82,\n      ease: [\n        'linear',\n        [0.701, 0, 0.892, 0.459],\n        'linear',\n        STROKE_EASE,\n        'linear',\n        [0.474, 0, 0.786, 0.383],\n        'linear',\n      ],\n      times: [0, 0.06, 0.146, 0.39, 0.5, 0.57, 0.655, 1],\n    },\n  },\n};\n\n// The pen writes this piece from its lower end, against the source direction,\n// so the visible part is kept at the end of the path.\nconst backLongVariants: Variants = {\n  normal: { pathLength: 1, pathOffset: 0, visibility: 'visible' },\n  animate: {\n    pathLength: [1, 1, 0.277, 0, 1, 1],\n    pathOffset: [0, 0, 0, 1, 0, 0],\n    visibility: ['visible', 'visible', 'hidden', 'hidden', 'visible', 'visible'],\n    transition: {\n      duration: 0.82,\n      ease: ['linear', [0.11, 0.544, 0.319, 1], 'linear', [0.109, 0.473, 0.151, 1], 'linear'],\n      times: [0, 0.157, 0.25, 0.695, 0.84, 1],\n    },\n  },\n};\n\nconst TickDouble01Icon = forwardRef<TickDouble01IconHandle, TickDouble01IconProps>(\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        <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={impactVariants}\n          animate={controls}\n          initial=\"normal\"\n          style={{ transformBox: 'fill-box' }}\n        >\n          <motion.path\n            d={BACK_SHORT_PATH}\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeWidth=\"1.5\"\n            variants={backShortVariants}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <motion.path\n            d={BACK_LONG_PATH}\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeWidth=\"1.5\"\n            variants={backLongVariants}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <motion.path\n            d={FRONT_PATH}\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeWidth=\"1.5\"\n            variants={frontVariants}\n            animate={controls}\n            initial=\"normal\"\n          />\n          <motion.g\n            variants={generatedGeometryVariants}\n            animate={controls}\n            initial=\"normal\"\n          >\n            <motion.path\n              d={BACK_LIFT_PATH}\n              stroke=\"currentColor\"\n              strokeLinecap=\"round\"\n              strokeLinejoin=\"round\"\n              strokeWidth=\"1.5\"\n              custom={0}\n              variants={penLiftVariants}\n              animate={controls}\n              initial=\"normal\"\n            />\n            <motion.path\n              d={FRONT_LIFT_PATH}\n              stroke=\"currentColor\"\n              strokeLinecap=\"round\"\n              strokeLinejoin=\"round\"\n              strokeWidth=\"1.5\"\n              custom={FRONT_DELAY}\n              variants={penLiftVariants}\n              animate={controls}\n              initial=\"normal\"\n            />\n          </motion.g>\n        </motion.svg>\n      </div>\n    );\n  }\n);\n\nTickDouble01Icon.displayName = 'TickDouble01Icon';\n\nexport { TickDouble01Icon };\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"
}