{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "native-start-now-baseui",
  "type": "registry:component",
  "title": "Native Start Now",
  "description": "Animated button with sparkle effects, loading states, and smooth transitions for starting actions. (Base UI)",
  "registryDependencies": [
    "button"
  ],
  "dependencies": [
    "framer-motion",
    "react"
  ],
  "files": [
    {
      "path": "@uitripled/react-baseui/src/components/native/native-start-now-baseui.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport {\n  AnimatePresence,\n  motion,\n  MotionConfig,\n  useReducedMotion,\n} from \"framer-motion\";\nimport { ArrowRight, Loader2, Rocket } from \"lucide-react\";\nimport { ReactNode, useEffect, useRef, useState } from \"react\";\nimport { NativeButton } from \"@/components/uitripled/native-button-baseui\";\n\nexport interface NativeStartNowProps {\n  /**\n   * Callback when start button is clicked\n   */\n  onStart: () => void | Promise<void>;\n  /**\n   * Text to show on the button\n   * Default: \"Start Now\"\n   */\n  label?: string;\n  /**\n   * Loading text during async action\n   * Default: \"Starting...\"\n   */\n  loadingLabel?: string;\n  /**\n   * Success text after completion\n   * Default: \"Let's Go!\"\n   */\n  successLabel?: string;\n  /**\n   * Size variant\n   * Default: \"md\"\n   */\n  size?: \"sm\" | \"md\" | \"lg\";\n  /**\n   * Show sparkle animation on hover\n   * Default: true\n   */\n  showRocket?: boolean;\n  /**\n   * Icon to use for Rocket and success state\n   * Default: Rocket icon\n   */\n  icon?: ReactNode;\n  /**\n   * Additional class names for the container\n   */\n  className?: string;\n  /**\n   * Disable the button\n   */\n  disabled?: boolean;\n  /**\n   * Variant style\n   * Default: \"gradient\"\n   */\n  variant?: \"gradient\" | \"solid\" | \"outline\";\n}\n\nconst sizeVariants = {\n  sm: \"h-9 px-4 text-sm\",\n  default: \"h-11 px-6 text-base\",\n  lg: \"h-14 px-8 text-lg\",\n};\n\nconst sizeMap = {\n  sm: \"sm\" as const,\n  md: \"default\" as const,\n  lg: \"lg\" as const,\n};\n\nconst iconSizeVariants = {\n  sm: \"h-3.5 w-3.5\",\n  md: \"h-4 w-4\",\n  lg: \"h-5 w-5\",\n};\n\nexport function NativeStartNow({\n  onStart,\n  label = \"Start Now\",\n  loadingLabel = \"Starting...\",\n  successLabel = \"Let's Go!\",\n  size = \"md\",\n  showRocket = true,\n  icon,\n  className,\n  disabled = false,\n  variant = \"gradient\",\n}: NativeStartNowProps) {\n  const [status, setStatus] = useState<\"idle\" | \"loading\" | \"success\">(\"idle\");\n  const [isHovered, setIsHovered] = useState(false);\n  const shouldReduceMotion = useReducedMotion();\n  const resetTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n  useEffect(\n    () => () => {\n      if (resetTimeoutRef.current) clearTimeout(resetTimeoutRef.current);\n    },\n    []\n  );\n\n  const buttonSize = sizeMap[size];\n  const iconSize = iconSizeVariants[size];\n\n  const handleClick = async () => {\n    if (disabled || status !== \"idle\") return;\n\n    setStatus(\"loading\");\n    try {\n      await onStart();\n      setStatus(\"success\");\n      resetTimeoutRef.current = setTimeout(() => setStatus(\"idle\"), 2000);\n    } catch {\n      setStatus(\"idle\");\n    }\n  };\n\n  const getButtonStyles = () => {\n    const baseStyles =\n      \"relative overflow-hidden font-semibold transition-[box-shadow,background-color,border-color,color] duration-300\";\n\n    switch (variant) {\n      case \"gradient\":\n        return cn(\n          baseStyles,\n          \"bg-gradient-to-r from-primary via-primary/90 to-primary text-primary-foreground\",\n          \"hover:shadow-lg hover:shadow-primary/50\",\n          \"border-0\"\n        );\n      case \"solid\":\n        return cn(\n          baseStyles,\n          \"bg-primary text-primary-foreground\",\n          \"hover:bg-primary/90\"\n        );\n      case \"outline\":\n        return cn(\n          baseStyles,\n          \"border-2 border-primary text-primary bg-background\",\n          \"hover:bg-primary hover:text-primary-foreground\"\n        );\n      default:\n        return baseStyles;\n    }\n  };\n\n  return (\n    <MotionConfig reducedMotion=\"user\">\n      <motion.div\n        className={cn(\"relative inline-flex\", className)}\n        onHoverStart={() => setIsHovered(true)}\n        onHoverEnd={() => setIsHovered(false)}\n      >\n        {/* Sparkle particles */}\n        <AnimatePresence>\n          {showRocket &&\n            isHovered &&\n            status === \"idle\" &&\n            !shouldReduceMotion && (\n              <>\n                {[...Array(6)].map((_, i) => (\n                  <motion.div\n                    key={i}\n                    aria-hidden=\"true\"\n                    initial={{\n                      opacity: 0,\n                      scale: 0,\n                      x: 0,\n                      y: 0,\n                    }}\n                    animate={{\n                      opacity: [0, 1, 0],\n                      scale: [0, 1, 0],\n                      x: Math.cos((i * Math.PI) / 3) * 40,\n                      y: Math.sin((i * Math.PI) / 3) * 40,\n                    }}\n                    exit={{ opacity: 0 }}\n                    transition={{\n                      duration: 1,\n                      repeat: Number.POSITIVE_INFINITY,\n                      delay: i * 0.1,\n                      ease: \"easeOut\",\n                    }}\n                    className=\"pointer-events-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\"\n                  >\n                    <div className=\"h-3 w-3 text-primary fill-primary\">\n                      {icon || (\n                        <Rocket className=\"h-3 w-3 text-primary fill-primary\" />\n                      )}\n                    </div>\n                  </motion.div>\n                ))}\n              </>\n            )}\n        </AnimatePresence>\n\n        <NativeButton\n          onClick={handleClick}\n          disabled={disabled || status !== \"idle\"}\n          loading={false}\n          size={buttonSize}\n          variant={variant === \"outline\" ? \"outline\" : \"default\"}\n          aria-busy={status === \"loading\"}\n          aria-live=\"polite\"\n          className={cn(\n            sizeVariants[buttonSize],\n            getButtonStyles(),\n            disabled && \"opacity-50 cursor-not-allowed\",\n            \"rounded-md shadow-md\"\n          )}\n        >\n          {/* Shimmer effect */}\n          {variant === \"gradient\" && status === \"idle\" && (\n            <motion.div\n              aria-hidden=\"true\"\n              className=\"pointer-events-none absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent\"\n              animate={{\n                x: [\"-200%\", \"200%\"],\n              }}\n              transition={{\n                duration: 2,\n                repeat: Number.POSITIVE_INFINITY,\n                repeatDelay: 1,\n                ease: \"easeInOut\",\n              }}\n            />\n          )}\n\n          {/* Button content */}\n          <AnimatePresence mode=\"wait\">\n            {status === \"idle\" && (\n              <motion.div\n                key=\"idle\"\n                initial={{ opacity: 0, y: 10, filter: \"blur(4px)\" }}\n                animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n                exit={{ opacity: 0, y: -10, filter: \"blur(4px)\" }}\n                transition={{ duration: 0.2 }}\n                className=\"flex items-center gap-2 relative z-10\"\n              >\n                {label}\n                <motion.div\n                  animate={{\n                    x: [0, 3, 0],\n                  }}\n                  transition={{\n                    duration: 1.2,\n                    repeat: Number.POSITIVE_INFINITY,\n                    ease: \"easeInOut\",\n                  }}\n                >\n                  <ArrowRight aria-hidden=\"true\" className={iconSize} />\n                </motion.div>\n              </motion.div>\n            )}\n\n            {status === \"loading\" && (\n              <motion.div\n                key=\"loading\"\n                initial={{ opacity: 0, y: 10, filter: \"blur(4px)\" }}\n                animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n                exit={{ opacity: 0, y: -10, filter: \"blur(4px)\" }}\n                transition={{ duration: 0.2 }}\n                className=\"flex items-center gap-2 relative z-10\"\n              >\n                <Loader2\n                  aria-hidden=\"true\"\n                  className={cn(iconSize, \"animate-spin\")}\n                />\n                {loadingLabel}\n              </motion.div>\n            )}\n\n            {status === \"success\" && (\n              <motion.div\n                key=\"success\"\n                initial={{ opacity: 0, scale: 0.8, filter: \"blur(4px)\" }}\n                animate={{ opacity: 1, scale: 1, filter: \"blur(0px)\" }}\n                exit={{ opacity: 0, scale: 0.8, filter: \"blur(4px)\" }}\n                transition={{\n                  type: \"spring\",\n                  stiffness: 300,\n                  damping: 20,\n                }}\n                className=\"flex items-center gap-2 relative z-10\"\n              >\n                <motion.div\n                  aria-hidden=\"true\"\n                  animate={{\n                    rotate: [0, 360],\n                  }}\n                  transition={{\n                    duration: 0.5,\n                  }}\n                  className={cn(iconSize, \"fill-current\")}\n                >\n                  {icon || <Rocket className={cn(iconSize, \"fill-current\")} />}\n                </motion.div>\n                {successLabel}\n              </motion.div>\n            )}\n          </AnimatePresence>\n        </NativeButton>\n      </motion.div>\n    </MotionConfig>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/uitripled/native-start-now-baseui.tsx"
    }
  ]
}