{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-widget-base",
  "type": "registry:component",
  "title": "Pricing Widget (base)",
  "description": "Theme-ready base variant of An animated pricing widget with smooth transitions and dynamic value updates..",
  "dependencies": [
    "@number-flow/react",
    "lucide-react",
    "motion"
  ],
  "files": [
    {
      "path": "components/watermelon/pricing-widget.tsx",
      "type": "registry:component",
      "content": "'use client';\n\nimport { useState, type FC } from 'react';\nimport { motion, AnimatePresence, type Transition } from 'motion/react';\nimport { Check } from 'lucide-react';\nimport NumberFlow from '@number-flow/react';\n\nexport type BillingCycle = 'monthly' | 'yearly';\n\nexport interface PricingPlan {\n  id: string;\n  title: string;\n  price: number;\n  popular: boolean;\n}\n\ninterface PricingWidgetProps {\n  initialBilling?: BillingCycle;\n  initialActivePlanId?: string;\n  plansData?: Record<BillingCycle, PricingPlan[]>;\n}\n\nconst SPRING: Transition = {\n  stiffness: 260,\n  damping: 22,\n};\n\nconst DEFAULT_DATA: Record<BillingCycle, PricingPlan[]> = {\n  monthly: [\n    { id: 'free', title: 'Free', price: 0.0, popular: false },\n    { id: 'starter', title: 'Starter', price: 9.99, popular: true },\n    { id: 'pro', title: 'Pro', price: 19.99, popular: false },\n  ],\n  yearly: [\n    { id: 'free', title: 'Free', price: 0.0, popular: false },\n    { id: 'starter', title: 'Starter', price: 7.49, popular: true },\n    { id: 'pro', title: 'Pro', price: 17.49, popular: false },\n  ],\n};\n\nexport const PricingWidget: FC<PricingWidgetProps> = ({\n  initialBilling = 'monthly',\n  initialActivePlanId = 'starter',\n  plansData = DEFAULT_DATA,\n}) => {\n  const [billing, setBilling] = useState<BillingCycle>(initialBilling);\n  const [active, setActive] = useState<string>(initialActivePlanId);\n\n  return (\n    <div className=\"theme-injected border-border bg-card w-[380px] rounded-lg border-[1.6px] p-4 shadow-xl transition-colors\">\n      <div className=\"border-border bg-muted relative mb-4 flex rounded-lg border px-2 py-2\">\n        <motion.div\n          layout\n          transition={SPRING}\n          className=\"border-border bg-card absolute inset-y-1 my-[0.5px] w-[48%] rounded-lg border shadow-sm\"\n          animate={{ x: billing === 'monthly' ? '0%' : '100%' }}\n        />\n        {(['monthly', 'yearly'] as const).map((t) => (\n          <button\n            key={t}\n            onClick={() => setBilling(t)}\n            className=\"text-foreground relative z-10 w-1/2 py-1 text-base font-bold transition-colors focus:outline-none\"\n          >\n            {t === 'monthly' ? 'Monthly' : 'Yearly'}\n          </button>\n        ))}\n      </div>\n\n      <div className=\"space-y-3\">\n        {plansData[billing].map((item) => {\n          const isActive = active === item.id;\n          return (\n            <motion.button\n              layout\n              key={item.id}\n              onClick={() => setActive(item.id)}\n              className=\"border-border bg-card relative flex h-[82px] w-full items-center justify-between rounded-lg border-[1.6px] px-4 text-left transition-all focus:outline-none\"\n            >\n              {isActive && (\n                <motion.div\n                  layoutId=\"active-border\"\n                  transition={SPRING}\n                  className=\"border-foreground pointer-events-none absolute inset-0 z-20 rounded-lg border-[2.5px]\"\n                />\n              )}\n\n              <div className=\"relative z-10\">\n                <div className=\"flex items-center gap-2\">\n                  <span className=\"text-foreground text-[18px] font-bold transition-colors\">\n                    {item.title}\n                  </span>\n                  {item.popular && (\n                    <span className=\"bg-accent text-accent-foreground rounded-lg px-2.5 py-0.5 text-[14px] font-bold\">\n                      Popular\n                    </span>\n                  )}\n                </div>\n                <motion.p className=\"text-foreground flex items-center gap-1 text-sm font-bold transition-colors\">\n                  <NumberFlow\n                    value={item.price}\n                    format={{ style: 'currency', currency: 'USD' }}\n                  />\n                  <motion.span\n                    layout\n                    className=\"text-muted-foreground font-semibold\"\n                  >\n                    {' '}\n                    / month\n                  </motion.span>\n                </motion.p>\n              </div>\n\n              <div className=\"border-border relative z-10 flex size-6 items-center justify-center overflow-hidden rounded-lg border-2\">\n                <AnimatePresence>\n                  {isActive && (\n                    <motion.div\n                      initial={{ opacity: 0 }}\n                      animate={{ opacity: 1 }}\n                      exit={{ opacity: 0 }}\n                      transition={SPRING}\n                      className=\"bg-foreground flex size-full items-center justify-center\"\n                    >\n                      <Check className=\"text-background size-full\" />\n                    </motion.div>\n                  )}\n                </AnimatePresence>\n              </div>\n            </motion.button>\n          );\n        })}\n      </div>\n\n      <button className=\"bg-primary text-primary-foreground mt-5 w-full rounded-lg py-3 font-semibold transition-all hover:opacity-90\">\n        Get Started\n      </button>\n    </div>\n  );\n};\n"
    }
  ]
}
