{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-feature-addon-builder",
  "title": "Pricing Feature Addon Builder",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/pricing-feature-addon-builder/PricingFeatureAddonBuilder.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { ArrowRight, Calculator, Check, CreditCard } from 'lucide-react'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent } from '@/components/ui/card'\nimport { cn } from '@/lib/utils'\n\nexport interface PricingPlan {\n  id: string\n  name: string\n  monthlyPrice: number\n  description: string\n  includedSeats: number\n}\n\nexport interface PricingAddon {\n  id: string\n  name: string\n  monthlyPrice: number\n  description: string\n  category: string\n}\n\nexport interface PricingFeatureAddonBuilderProps {\n  title?: string\n  description?: string\n  plans?: PricingPlan[]\n  addons?: PricingAddon[]\n  className?: string\n}\n\nconst DEFAULT_PLANS: PricingPlan[] = [\n  {\n    id: 'starter',\n    name: 'Starter Tier',\n    monthlyPrice: 29,\n    description: 'For indie developers and early-stage prototypes needing unbundled speed.',\n    includedSeats: 2,\n  },\n  {\n    id: 'growth',\n    name: 'Growth Core',\n    monthlyPrice: 99,\n    description: 'For scaling product engineering teams building high-conversion platforms.',\n    includedSeats: 5,\n  },\n  {\n    id: 'scale',\n    name: 'Scale Enterprise',\n    monthlyPrice: 299,\n    description: 'For mission-critical production clusters requiring sub-10ms global edge delivery.',\n    includedSeats: 15,\n  },\n]\n\nconst DEFAULT_ADDONS: PricingAddon[] = [\n  {\n    id: 'dedicated-ip',\n    name: 'Dedicated Static Edge IP',\n    monthlyPrice: 49,\n    description: 'Static IPv4/IPv6 address allocations with zero-reputation penalty.',\n    category: 'Network',\n  },\n  {\n    id: 'audit-logs',\n    name: 'Immutable SOC2 Audit Logs',\n    monthlyPrice: 79,\n    description: 'Cryptographically signed telemetry logs with 365-day cold storage retention.',\n    category: 'Security',\n  },\n  {\n    id: 'multi-region',\n    name: 'Multi-Region Active-Active Mesh',\n    monthlyPrice: 129,\n    description: 'Synchronized cross-continental database replicas and automatic DNS failover.',\n    category: 'Reliability',\n  },\n  {\n    id: 'priority-sla',\n    name: '1-Hour Enterprise Response SLA',\n    monthlyPrice: 199,\n    description: 'Direct Slack / Discord hotline with senior design engineering staff.',\n    category: 'Support',\n  },\n]\n\nexport function PricingFeatureAddonBuilder({\n  title = 'Build your custom plan with transparent, zero-surprise pricing.',\n  description = 'Select your base tier, adjust seat allocations, and toggle modular enterprise add-ons with real-time invoice calculations.',\n  plans = DEFAULT_PLANS,\n  addons = DEFAULT_ADDONS,\n  className,\n}: PricingFeatureAddonBuilderProps) {\n  const [selectedPlanId, setSelectedPlanId] = React.useState('growth')\n  const [selectedAddonIds, setSelectedAddonIds] = React.useState<string[]>(['dedicated-ip', 'audit-logs'])\n  const [seatCount, setSeatCount] = React.useState(8)\n  const [isAnnual, setIsAnnual] = React.useState(true)\n\n  const selectedPlan = React.useMemo(() => {\n    return plans.find((p) => p.id === selectedPlanId) || plans[0]\n  }, [plans, selectedPlanId])\n\n  const extraSeats = React.useMemo(() => {\n    return Math.max(0, seatCount - selectedPlan.includedSeats)\n  }, [seatCount, selectedPlan])\n\n  const extraSeatCost = React.useMemo(() => extraSeats * 15, [extraSeats])\n\n  const totalAddonsCost = React.useMemo(() => {\n    return addons.filter((a) => selectedAddonIds.includes(a.id)).reduce((sum, a) => sum + a.monthlyPrice, 0)\n  }, [addons, selectedAddonIds])\n\n  const monthlySubtotal = React.useMemo(() => {\n    return selectedPlan.monthlyPrice + extraSeatCost + totalAddonsCost\n  }, [selectedPlan, extraSeatCost, totalAddonsCost])\n\n  const finalMonthlyRate = React.useMemo(() => {\n    if (isAnnual) {\n      return Math.round(monthlySubtotal * 0.8)\n    }\n    return monthlySubtotal\n  }, [isAnnual, monthlySubtotal])\n\n  const annualSavings = React.useMemo(() => {\n    return (monthlySubtotal - Math.round(monthlySubtotal * 0.8)) * 12\n  }, [monthlySubtotal])\n\n  function toggleAddon(addonId: string) {\n    if (selectedAddonIds.includes(addonId)) {\n      setSelectedAddonIds(selectedAddonIds.filter((id) => id !== addonId))\n    } else {\n      setSelectedAddonIds([...selectedAddonIds, addonId])\n    }\n  }\n\n  return (\n    <section\n      data-slot=\"pricing-feature-addon-builder\"\n      className={cn('bg-background relative overflow-hidden py-16 sm:py-24', className)}\n    >\n      <div className=\"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8\">\n        {/* Section Header */}\n        <div className=\"mx-auto max-w-3xl space-y-4 text-center\">\n          <a\n            href=\"#pricing-calculator\"\n            className=\"group border-border/80 bg-secondary/60 hover:bg-secondary text-foreground inline-flex items-center gap-2 rounded-full border px-3.5 py-1 text-xs font-medium shadow-2xs transition-colors\"\n          >\n            <Calculator className=\"text-primary size-3.5\" />\n            <span>Real-time Add-on Cost Synthesizer</span>\n            <ArrowRight className=\"text-muted-foreground size-3 transition-transform group-hover:translate-x-0.5\" />\n          </a>\n\n          <h2 className=\"text-foreground text-3xl font-bold tracking-tight sm:text-4xl\">{title}</h2>\n\n          <p className=\"text-muted-foreground text-base sm:text-lg\">{description}</p>\n\n          {/* Billing Cadence Toggle */}\n          <div className=\"flex items-center justify-center gap-3 pt-2\">\n            <span\n              className={cn(\n                'text-xs font-medium',\n                !isAnnual ? 'text-foreground font-semibold' : 'text-muted-foreground',\n              )}\n            >\n              Monthly Billing\n            </span>\n            <button\n              type=\"button\"\n              className={cn(\n                'focus-visible:ring-ring relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus-visible:ring-2 focus-visible:outline-none',\n                isAnnual ? 'bg-primary' : 'bg-muted',\n              )}\n              onClick={() => setIsAnnual(!isAnnual)}\n            >\n              <span\n                className={cn(\n                  'bg-background pointer-events-none inline-block size-5 transform rounded-full shadow-lg ring-0 transition duration-200 ease-in-out',\n                  isAnnual ? 'translate-x-5' : 'translate-x-0',\n                )}\n              />\n            </button>\n            <span\n              className={cn(\n                'flex items-center gap-1.5 text-xs font-medium',\n                isAnnual ? 'text-foreground font-semibold' : 'text-muted-foreground',\n              )}\n            >\n              <span>Annual Billing</span>\n              <Badge variant=\"outline\" className=\"border-success/30 bg-success/10 text-success text-xs\">\n                Save 20%\n              </Badge>\n            </span>\n          </div>\n        </div>\n\n        {/* Add-on Builder Workbench */}\n        <div className=\"mt-12 grid grid-cols-1 gap-6 lg:grid-cols-12\">\n          {/* Left: Plan Selection & Addon Toggles (7 Cols) */}\n          <div className=\"space-y-6 lg:col-span-7\">\n            {/* Step 1: Base Tier Cards */}\n            <div className=\"space-y-3\">\n              <div className=\"text-muted-foreground text-xs font-bold tracking-wider uppercase\">\n                Step 1: Choose Base Core Tier\n              </div>\n              <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-3\">\n                {plans.map((plan) => (\n                  <button\n                    key={plan.id}\n                    type=\"button\"\n                    className={cn(\n                      'flex flex-col justify-between rounded-xl border p-4 text-left transition-colors',\n                      selectedPlanId === plan.id\n                        ? 'border-primary bg-primary/5 ring-primary/20 shadow-xs ring-1'\n                        : 'border-border bg-card hover:bg-muted/40 text-muted-foreground hover:text-foreground',\n                    )}\n                    onClick={() => setSelectedPlanId(plan.id)}\n                  >\n                    <div>\n                      <div className=\"text-foreground text-xs font-bold\">{plan.name}</div>\n                      <div className=\"text-foreground mt-1 font-mono text-lg font-bold\">\n                        ${plan.monthlyPrice}\n                        <span className=\"text-muted-foreground text-xs font-normal\">/mo</span>\n                      </div>\n                    </div>\n                    <div className=\"text-muted-foreground mt-2 text-xs\">\n                      Includes {plan.includedSeats} engineer seats\n                    </div>\n                  </button>\n                ))}\n              </div>\n            </div>\n\n            {/* Step 2: Seat Allocation Slider */}\n            <Card className=\"border-border bg-card/60 shadow-2xs\">\n              <CardContent className=\"space-y-2.5 p-4\">\n                <div className=\"flex items-center justify-between text-xs\">\n                  <span className=\"text-foreground font-bold\">Engineer Team Seats</span>\n                  <span className=\"text-foreground font-mono text-sm font-bold\">\n                    {seatCount} seats (${extraSeatCost}/mo extra)\n                  </span>\n                </div>\n                <input\n                  type=\"range\"\n                  min=\"2\"\n                  max=\"50\"\n                  step=\"1\"\n                  value={seatCount}\n                  onChange={(e) => setSeatCount(parseInt(e.target.value))}\n                  className=\"accent-primary w-full cursor-pointer\"\n                />\n                <div className=\"text-muted-foreground flex justify-between font-mono text-xs\">\n                  <span>2 seats</span>\n                  <span>50 seats</span>\n                </div>\n              </CardContent>\n            </Card>\n\n            {/* Step 3: Enterprise Add-ons Checklist */}\n            <div className=\"space-y-3\">\n              <div className=\"text-muted-foreground text-xs font-bold tracking-wider uppercase\">\n                Step 3: Select Modular Capabilities\n              </div>\n              <div className=\"grid grid-cols-1 gap-2.5\">\n                {addons.map((addon) => (\n                  <button\n                    key={addon.id}\n                    type=\"button\"\n                    className={cn(\n                      'flex items-center justify-between rounded-xl border p-3.5 text-left transition-colors',\n                      selectedAddonIds.includes(addon.id)\n                        ? 'border-primary/60 bg-primary/5 shadow-2xs'\n                        : 'border-border bg-card hover:bg-muted/30 text-muted-foreground hover:text-foreground',\n                    )}\n                    onClick={() => toggleAddon(addon.id)}\n                  >\n                    <div className=\"flex min-w-0 items-center gap-3\">\n                      <div\n                        className={cn(\n                          'flex size-5 shrink-0 items-center justify-center rounded border transition-colors',\n                          selectedAddonIds.includes(addon.id)\n                            ? 'border-primary bg-primary text-primary-foreground'\n                            : 'border-border bg-background',\n                        )}\n                      >\n                        {selectedAddonIds.includes(addon.id) ? <Check className=\"size-3.5\" /> : null}\n                      </div>\n                      <div className=\"min-w-0 space-y-0.5\">\n                        <div className=\"flex items-center gap-2\">\n                          <span className=\"text-foreground text-xs font-bold\">{addon.name}</span>\n                          <Badge variant=\"outline\" className=\"border-border text-muted-foreground text-xs\">\n                            {addon.category}\n                          </Badge>\n                        </div>\n                        <div className=\"text-muted-foreground truncate text-xs\">{addon.description}</div>\n                      </div>\n                    </div>\n\n                    <div className=\"text-foreground shrink-0 pl-2 font-mono text-xs font-bold\">\n                      +${addon.monthlyPrice}\n                      <span className=\"text-muted-foreground text-xs font-normal\">/mo</span>\n                    </div>\n                  </button>\n                ))}\n              </div>\n            </div>\n          </div>\n\n          {/* Right: Real-time Invoice Estimate Card (5 Cols) */}\n          <div className=\"lg:col-span-5\">\n            <Card className=\"border-border bg-card sticky top-8 shadow-sm\">\n              <CardContent className=\"space-y-6 p-6\">\n                <div className=\"border-border flex items-center justify-between border-b pb-3\">\n                  <div className=\"flex items-center gap-2\">\n                    <CreditCard className=\"text-primary size-4\" />\n                    <span className=\"text-foreground text-sm font-semibold\">Estimated Monthly Invoice</span>\n                  </div>\n                  <Badge variant=\"outline\" className=\"border-border text-primary font-mono text-xs\">\n                    {isAnnual ? 'Annualized' : 'Monthly'}\n                  </Badge>\n                </div>\n\n                {/* Price Breakdown List */}\n                <div className=\"space-y-3 text-xs\">\n                  <div className=\"text-muted-foreground flex justify-between\">\n                    <span>{selectedPlan.name}</span>\n                    <span className=\"text-foreground font-mono\">${selectedPlan.monthlyPrice}.00</span>\n                  </div>\n\n                  {extraSeats > 0 ? (\n                    <div className=\"text-muted-foreground flex justify-between\">\n                      <span>Extra Seats ({extraSeats} &times; $15)</span>\n                      <span className=\"text-foreground font-mono\">${extraSeatCost}.00</span>\n                    </div>\n                  ) : null}\n\n                  {addons\n                    .filter((a) => selectedAddonIds.includes(a.id))\n                    .map((addon) => (\n                      <div key={addon.id} className=\"text-muted-foreground flex justify-between\">\n                        <span className=\"truncate pr-2\">{addon.name}</span>\n                        <span className=\"text-foreground font-mono\">${addon.monthlyPrice}.00</span>\n                      </div>\n                    ))}\n\n                  {isAnnual ? (\n                    <div className=\"border-border/60 text-success flex justify-between border-t pt-2 font-medium\">\n                      <span>Annual Billing Discount (20%)</span>\n                      <span className=\"font-mono\">&minus;${monthlySubtotal - finalMonthlyRate}.00</span>\n                    </div>\n                  ) : null}\n                </div>\n\n                {/* Total Sum Band */}\n                <div className=\"border-border bg-muted/40 space-y-1 rounded-lg border p-4\">\n                  <div className=\"text-muted-foreground text-xs font-medium\">Net Monthly Investment</div>\n                  <div className=\"flex items-baseline gap-1.5\">\n                    <span className=\"text-foreground font-mono text-3xl font-bold tracking-tight\">\n                      ${finalMonthlyRate}\n                    </span>\n                    <span className=\"text-muted-foreground font-mono text-xs\">/ month</span>\n                  </div>\n                  {isAnnual ? (\n                    <div className=\"text-success text-xs font-medium\">\n                      Billed annually (${finalMonthlyRate * 12}/yr &bull; Save ${annualSavings}/yr)\n                    </div>\n                  ) : null}\n                </div>\n\n                <Button className=\"w-full gap-2 shadow-xs\" size=\"lg\">\n                  <span>Start 14-Day Free Evaluation</span>\n                  <ArrowRight className=\"size-4\" />\n                </Button>\n              </CardContent>\n            </Card>\n          </div>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/pricing-feature-addon-builder/PricingFeatureAddonBuilder.tsx"
    },
    {
      "path": "packages/registry-react/blocks/pricing-feature-addon-builder/index.ts",
      "content": "export { PricingFeatureAddonBuilder } from './PricingFeatureAddonBuilder'\nexport type { PricingFeatureAddonBuilderProps, PricingPlan, PricingAddon } from './PricingFeatureAddonBuilder'\n",
      "type": "registry:block",
      "target": "~/components/blocks/pricing-feature-addon-builder/index.ts"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/card.json"
  ],
  "description": "Interactive add-on pricing calculator with tier bundling, seat scaling, and real-time invoice generation.",
  "categories": [
    "pricing",
    "marketing"
  ],
  "deprecated": true,
  "replacedBy": "pricing"
}