{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "calendar-date-range",
  "title": "calendar-date-range",
  "description": "Animated calendar-date-range icon for React",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "files": [
    {
      "path": "calendar-date-range.tsx",
      "content": "\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface CalendarDateRangeIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface CalendarDateRangeIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst FIRST_DOT_VARIANTS: Variants = {\n  normal: {\n    opacity: 1,\n    transition: {\n      duration: 0.2,\n    },\n  },\n  animate: {\n    opacity: [1, 0.3, 1],\n    transition: {\n      delay: 0,\n      duration: 0.4,\n      times: [0, 0.5, 1],\n    },\n  },\n};\n\nconst LINE_VARIANTS: Variants = {\n  normal: {\n    pathLength: 1,\n    opacity: 1,\n    transition: {\n      duration: 0.2,\n    },\n  },\n  animate: (custom: number) => ({\n    pathLength: [0, 1],\n    opacity: [0, 1],\n    transition: {\n      delay: 0.4 + custom * 0.15,\n      duration: 0.3,\n      ease: \"easeOut\",\n    },\n  }),\n};\n\nconst DOT_VARIANTS: Variants = {\n  normal: {\n    opacity: 1,\n    transition: {\n      duration: 0.2,\n    },\n  },\n  animate: (custom: number) => ({\n    opacity: [1, 0.3, 1],\n    transition: {\n      delay: 0.7 + custom * 0.1,\n      duration: 0.4,\n      times: [0, 0.5, 1],\n    },\n  }),\n};\n\nconst RANGE_LINES = [\n  { d: \"M14.25 12.75h2.25\", index: 0 },\n  { d: \"M7.5 15h4.5\", index: 1 },\n] as const;\n\nconst FIRST_DOT = { d: \"M12 12.75h.005v.006H12v-.006Z\" };\n\nconst DOTS = [\n  { d: \"M14.25 15h.005v.005h-.005v-.005Z\", index: 0 },\n  { d: \"M16.5 15h.006v.005H16.5v-.005Z\", index: 1 },\n  { d: \"M7.5 17.25h.005v.005h-.006v-.005Z\", index: 2 },\n  { d: \"M9.75 17.25h.005v.006H9.75v-.006Z\", index: 3 },\n  { d: \"M12 17.25h.006v.006h-.006v-.005Z\", index: 4 },\n  { d: \"M14.25 17.25h.006v.006h-.006v-.006Z\", index: 5 },\n] as const;\n\nconst CalendarDateRangeIcon = forwardRef<\n  CalendarDateRangeIconHandle,\n  CalendarDateRangeIconProps\n>(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n  const controls = useAnimation();\n  const isControlledRef = useRef(false);\n\n  useImperativeHandle(ref, () => {\n    isControlledRef.current = true;\n\n    return {\n      startAnimation: () => controls.start(\"animate\"),\n      stopAnimation: () => controls.start(\"normal\"),\n    };\n  });\n\n  const handleMouseEnter = useCallback(\n    (e: React.MouseEvent<HTMLDivElement>) => {\n      if (isControlledRef.current) {\n        onMouseEnter?.(e);\n      } else {\n        controls.start(\"animate\");\n      }\n    },\n    [controls, onMouseEnter]\n  );\n\n  const handleMouseLeave = useCallback(\n    (e: React.MouseEvent<HTMLDivElement>) => {\n      if (isControlledRef.current) {\n        onMouseLeave?.(e);\n      } else {\n        controls.start(\"normal\");\n      }\n    },\n    [controls, onMouseLeave]\n  );\n\n  return (\n    <div\n      className={cn(className)}\n      onMouseEnter={handleMouseEnter}\n      onMouseLeave={handleMouseLeave}\n      {...props}\n    >\n      <svg\n        fill=\"none\"\n        height={size}\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.5\"\n        viewBox=\"0 0 24 24\"\n        width={size}\n        xmlns=\"http://www.w3.org/2000/svg\"\n      >\n        <path d=\"M6.75 2.994v2.25m10.5-2.25v2.25m-14.252 13.5V7.491a2.25 2.25 0 0 1 2.25-2.25h13.5a2.25 2.25 0 0 1 2.25 2.25v11.251m-18 0a2.25 2.25 0 0 0 2.25 2.25h13.5a2.25 2.25 0 0 0 2.25-2.25m-18 0v-7.5a2.25 2.25 0 0 1 2.25-2.25h13.5a2.25 2.25 0 0 1 2.25 2.25v7.5\" />\n        <motion.path\n          animate={controls}\n          d={FIRST_DOT.d}\n          initial=\"normal\"\n          variants={FIRST_DOT_VARIANTS}\n        />\n        {RANGE_LINES.map((line) => (\n          <motion.path\n            animate={controls}\n            custom={line.index}\n            d={line.d}\n            initial=\"normal\"\n            key={`line-${line.index}`}\n            variants={LINE_VARIANTS}\n          />\n        ))}\n        {DOTS.map((dot) => (\n          <motion.path\n            animate={controls}\n            custom={dot.index}\n            d={dot.d}\n            initial=\"normal\"\n            key={`dot-${dot.index}`}\n            variants={DOT_VARIANTS}\n          />\n        ))}\n      </svg>\n    </div>\n  );\n});\n\nCalendarDateRangeIcon.displayName = \"CalendarDateRangeIcon\";\n\nexport { CalendarDateRangeIcon };\n",
      "type": "registry:ui"
    }
  ]
}
