{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "feature-tour-base",
  "type": "registry:component",
  "title": "Feature Tour (base)",
  "description": "Theme-ready base variant of A premium guided tour component with blur animations, shining titles, and intuitive navigation..",
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "files": [
    {
      "path": "components/watermelon/feature-tour.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport React, { useState, useEffect, useRef, useCallback } from \"react\";\nimport {\n    motion,\n    AnimatePresence,\n    useReducedMotion,\n    type Transition,\n} from \"motion/react\";\nimport { X } from \"lucide-react\";\n\nexport interface TourStep {\n    id: string;\n    title: string;\n    description: string;\n    icon: React.ReactNode;\n}\n\ninterface FeatureTourProps {\n    steps: TourStep[];\n    onClose: () => void;\n    onLearnMore?: (step: TourStep) => void;\n    className?: string;\n    loop?: boolean;\n    closeOnBackdrop?: boolean;\n}\n\nconst EASE_OUT = [0.16, 1, 0.3, 1] as const;\nconst FAST_OUT = [0.22, 1, 0.36, 1] as const;\n\nconst SPRING_ICON: Transition = {\n    type: \"spring\",\n    stiffness: 420,\n    damping: 34,\n    mass: 0.7,\n};\n\nconst SPRING_BG: Transition = {\n    type: \"spring\",\n    stiffness: 340,\n    damping: 30,\n    mass: 0.8,\n};\n\nexport const FeatureTour: React.FC<FeatureTourProps> = ({\n    steps,\n    onClose,\n    onLearnMore,\n    className = \"\",\n    loop = false,\n    closeOnBackdrop = true,\n}) => {\n    const shouldReduceMotion = useReducedMotion();\n    const containerRef = useRef<HTMLDivElement>(null);\n    const [currentIndex, setCurrentIndex] = useState(0);\n\n    const goToStep = useCallback((index: number) => {\n        setCurrentIndex((prev) => (index === prev ? prev : index));\n    }, []);\n\n    const goNext = useCallback(() => {\n        setCurrentIndex((prev) =>\n            prev === steps.length - 1 ? (loop ? 0 : prev) : prev + 1\n        );\n    }, [loop, steps.length]);\n\n    const goPrev = useCallback(() => {\n        setCurrentIndex((prev) =>\n            prev === 0 ? (loop ? steps.length - 1 : prev) : prev - 1\n        );\n    }, [loop, steps.length]);\n\n    useEffect(() => {\n        const handleKeyDown = (e: KeyboardEvent) => {\n            if (e.key === \"ArrowRight\") goNext();\n            if (e.key === \"ArrowLeft\") goPrev();\n            if (e.key === \"Escape\") onClose();\n        };\n\n        window.addEventListener(\"keydown\", handleKeyDown);\n        return () => window.removeEventListener(\"keydown\", handleKeyDown);\n    }, [goNext, goPrev, onClose]);\n\n    useEffect(() => {\n        const btn = containerRef.current?.querySelector(\"button\");\n        btn?.focus();\n    }, []);\n\n    const currentStep = steps[currentIndex];\n\n    if (!steps || steps.length === 0) return null;\n\n    return (\n        <div\n            className=\"theme-injected flex items-center justify-center font-sans\"\n            onClick={closeOnBackdrop ? onClose : undefined}\n            role=\"dialog\"\n            aria-modal=\"true\"\n        >\n            <motion.div\n                ref={containerRef}\n                onClick={(e) => e.stopPropagation()}\n                initial={{\n                    opacity: 0,\n                    scale: 0.96,\n                    y: 16,\n                    filter: \"blur(4px)\",\n                }}\n                animate={{\n                    opacity: 1,\n                    scale: 1,\n                    y: 0,\n                    filter: \"blur(0px)\",\n                }}\n                exit={{\n                    opacity: 0,\n                    scale: 0.98,\n                    y: 12,\n                }}\n                transition={{\n                    duration: 0.18,\n                    ease: EASE_OUT,\n                }}\n                className={`relative flex w-full max-w-100 min-h-130 flex-col items-center overflow-hidden rounded-3xl border border-border bg-card p-6 font-sans shadow-sm transition-colors duration-300 sm:min-h-0 sm:aspect-[1/1.3] sm:p-8 ${className}`}\n            >\n                <button\n                    onClick={onClose}\n                    aria-label=\"Close tour\"\n                    className=\"absolute top-6 right-6 z-50 rounded-3xl bg-muted p-2 text-muted-foreground transition-colors hover:bg-background hover:text-foreground\"\n                >\n                    <X size={20} strokeWidth={3} className=\"text-current\" />\n                </button>\n\n                <div className=\"relative flex w-full flex-1 flex-col items-center justify-center\">\n                    <AnimatePresence mode=\"wait\">\n                        <motion.div\n                            key={currentStep.id}\n                            initial={{\n                                opacity: 0,\n                                scale: 0.92,\n                                y: 8,\n                                filter: \"blur(3px)\",\n                            }}\n                            animate={{\n                                opacity: 1,\n                                scale: 1,\n                                y: 0,\n                                filter: \"blur(0px)\",\n                            }}\n                            exit={{\n                                opacity: 0,\n                                scale: 0.92,\n                                y: -6,\n                                filter: \"blur(3px)\",\n                            }}\n                            transition={{\n                                duration: 0.16,\n                                ease: FAST_OUT,\n                            }}\n                            className=\"relative flex min-h-30 items-center justify-center\"\n                        >\n                            <motion.div\n                                layoutId=\"tour-icon-bg\"\n                                transition={SPRING_BG}\n                                className=\"absolute h-24 w-24 rounded-3xl bg-muted shadow-inner\"\n                            />\n\n                            <motion.div\n                                layoutId=\"tour-icon\"\n                                transition={SPRING_ICON}\n                                className=\"relative text-foreground drop-shadow-[0_4px_12px_rgba(0,0,0,0.12)]\"\n                            >\n                                {currentStep.icon}\n                            </motion.div>\n                        </motion.div>\n                    </AnimatePresence>\n\n                    <AnimatePresence mode=\"wait\">\n                        <motion.div\n                            key={`content-${currentStep.id}`}\n                            initial={{\n                                opacity: 0,\n                                y: shouldReduceMotion ? 0 : 20,\n                            }}\n                            animate={{\n                                opacity: 1,\n                                y: 0,\n                            }}\n                            exit={{\n                                opacity: 0,\n                                y: shouldReduceMotion ? 0 : -14,\n                            }}\n                            transition={{\n                                duration: 0.16,\n                                ease: EASE_OUT,\n                            }}\n                            className=\"mt-8 space-y-2 px-4 text-center sm:mt-12\"\n                        >\n                            <h2 className=\"font-sans text-[26px] font-bold text-foreground\">\n                                {currentStep.title}\n                            </h2>\n\n                            <p className=\"font-sans text-[20px] leading-tight font-medium text-muted-foreground\">\n                                {currentStep.description}\n                            </p>\n\n                            {onLearnMore && (\n                                <motion.button\n                                    whileHover={{ scale: 1.03 }}\n                                    whileTap={{ scale: 0.97 }}\n                                    transition={{\n                                        type: \"spring\",\n                                        stiffness: 400,\n                                        damping: 30,\n                                    }}\n                                    onClick={() => onLearnMore(currentStep)}\n                                    className=\"mt-6 rounded-3xl bg-primary px-10 py-3 font-sans text-lg font-semibold text-primary-foreground transition-colors hover:opacity-95 sm:mt-10\"\n                                >\n                                    Learn More\n                                </motion.button>\n                            )}\n                        </motion.div>\n                    </AnimatePresence>\n                </div>\n\n                <div className=\"mt-6 flex items-center gap-3 sm:mt-8\" role=\"tablist\">\n                    {steps.map((step, index) => (\n                        <button\n                            key={step.id}\n                            role=\"tab\"\n                            aria-selected={index === currentIndex}\n                            aria-label={`Go to ${step.title}`}\n                            onClick={() => goToStep(index)}\n                            className=\"relative h-2 focus:outline-none\"\n                        >\n                            <motion.div\n                                animate={{\n                                    scale: index === currentIndex ? 1.2 : 1,\n                                }}\n                                transition={{\n                                    type: \"spring\",\n                                    stiffness: 300,\n                                    damping: 20,\n                                }}\n                                className={`h-3 w-3 rounded-3xl ${\n                                    index === currentIndex\n                                        ? \"bg-primary\"\n                                        : \"bg-foreground/50\"\n                                }`}\n                            />\n                        </button>\n                    ))}\n                </div>\n\n                <div className=\"pointer-events-none absolute inset-0 rounded-5xl bg-linear-to-br from-background/30 via-transparent to-foreground/5\" />\n            </motion.div>\n        </div>\n    );\n};\n"
    }
  ]
}
