{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "comp-329",
  "type": "registry:component",
  "title": "Comp 329",
  "description": "Comp 329",
  "files": [
    {
      "path": "registry/ui-basic/comp-329.tsx",
      "content": "\"use client\";\n\nimport { useEffect, useId, useRef, useState } from \"react\";\n\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogDescription,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { RadioGroup, RadioGroupItem } from \"@/components/ui/radio-group\";\nimport { CreditCardIcon, StoreIcon } from \"lucide-react\";\nimport { usePaymentInputs } from \"react-payment-inputs\";\nimport images, { type CardImages } from \"react-payment-inputs/images\";\n\nexport default function Component() {\n\tconst id = useId();\n\tconst {\n\t\tmeta,\n\t\tgetCardNumberProps,\n\t\tgetExpiryDateProps,\n\t\tgetCVCProps,\n\t\tgetCardImageProps,\n\t} = usePaymentInputs();\n\tconst couponInputRef = useRef<HTMLInputElement>(null);\n\tconst [showCouponInput, setShowCouponInput] = useState(false);\n\tconst [couponCode, setCouponCode] = useState(\"\");\n\n\t// Auto-focus the coupon input when it's shown\n\tuseEffect(() => {\n\t\tif (showCouponInput && couponInputRef.current) {\n\t\t\tcouponInputRef.current.focus();\n\t\t}\n\t}, [showCouponInput]);\n\n\treturn (\n\t\t<Dialog>\n\t\t\t<DialogTrigger asChild>\n\t\t\t\t<Button variant=\"outline\">Checkout</Button>\n\t\t\t</DialogTrigger>\n\t\t\t<DialogContent>\n\t\t\t\t<div className=\"mb-2 flex flex-col gap-2\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"flex size-11 shrink-0 items-center justify-center rounded-full border\"\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<StoreIcon className=\"opacity-80\" size={16} />\n\t\t\t\t\t</div>\n\t\t\t\t\t<DialogHeader>\n\t\t\t\t\t\t<DialogTitle className=\"text-left\">\n\t\t\t\t\t\t\tConfirm and pay\n\t\t\t\t\t\t</DialogTitle>\n\t\t\t\t\t\t<DialogDescription className=\"text-left\">\n\t\t\t\t\t\t\tPay securely and cancel any time.\n\t\t\t\t\t\t</DialogDescription>\n\t\t\t\t\t</DialogHeader>\n\t\t\t\t</div>\n\n\t\t\t\t<form className=\"space-y-5\">\n\t\t\t\t\t<div className=\"space-y-4\">\n\t\t\t\t\t\t<RadioGroup className=\"grid-cols-2\" defaultValue=\"yearly\">\n\t\t\t\t\t\t\t{/* Monthly */}\n\t\t\t\t\t\t\t<label className=\"border-input has-data-[state=checked]:border-primary/50 has-focus-visible:border-ring has-focus-visible:ring-ring/50 relative flex cursor-pointer flex-col gap-1 rounded-md border px-4 py-3 shadow-2xs transition-[color,box-shadow] outline-hidden has-focus-visible:ring-[3px]\">\n\t\t\t\t\t\t\t\t<RadioGroupItem\n\t\t\t\t\t\t\t\t\tid=\"radio-monthly\"\n\t\t\t\t\t\t\t\t\tvalue=\"monthly\"\n\t\t\t\t\t\t\t\t\tclassName=\"sr-only after:absolute after:inset-0\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<p className=\"text-foreground text-sm font-medium\">\n\t\t\t\t\t\t\t\t\tMonthly\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t<p className=\"text-muted-foreground text-sm\">\n\t\t\t\t\t\t\t\t\t$32/month\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t{/* Yearly */}\n\t\t\t\t\t\t\t<label className=\"border-input has-data-[state=checked]:border-primary/50 has-focus-visible:border-ring has-focus-visible:ring-ring/50 relative flex cursor-pointer flex-col gap-1 rounded-md border px-4 py-3 shadow-2xs transition-[color,box-shadow] outline-hidden has-focus-visible:ring-[3px]\">\n\t\t\t\t\t\t\t\t<RadioGroupItem\n\t\t\t\t\t\t\t\t\tid=\"radio-yearly\"\n\t\t\t\t\t\t\t\t\tvalue=\"yearly\"\n\t\t\t\t\t\t\t\t\tclassName=\"sr-only after:absolute after:inset-0\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<div className=\"inline-flex items-start justify-between gap-2\">\n\t\t\t\t\t\t\t\t\t<p className=\"text-foreground text-sm font-medium\">\n\t\t\t\t\t\t\t\t\t\tYearly\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<Badge>Popular</Badge>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<p className=\"text-muted-foreground text-sm\">\n\t\t\t\t\t\t\t\t\t$320/month\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</RadioGroup>\n\t\t\t\t\t\t<div className=\"not-first:*:mt-2\">\n\t\t\t\t\t\t\t<Label htmlFor={`name-${id}`}>Name on card</Label>\n\t\t\t\t\t\t\t<Input id={`name-${id}`} type=\"text\" required />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"not-first:*:mt-2\">\n\t\t\t\t\t\t\t<legend className=\"text-foreground text-sm font-medium\">\n\t\t\t\t\t\t\t\tCard Details\n\t\t\t\t\t\t\t</legend>\n\t\t\t\t\t\t\t<div className=\"rounded-md shadow-2xs\">\n\t\t\t\t\t\t\t\t<div className=\"relative focus-within:z-10\">\n\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\tclassName=\"peer rounded-b-none pe-9 shadow-none [direction:inherit]\"\n\t\t\t\t\t\t\t\t\t\t{...getCardNumberProps()}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<div className=\"text-muted-foreground/80 pointer-events-none absolute inset-y-0 inset-e-0 flex items-center justify-center pe-3 peer-disabled:opacity-50\">\n\t\t\t\t\t\t\t\t\t\t{meta.cardType ? (\n\t\t\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"overflow-hidden rounded-sm\"\n\t\t\t\t\t\t\t\t\t\t\t\t{...getCardImageProps({\n\t\t\t\t\t\t\t\t\t\t\t\t\timages: images as unknown as CardImages,\n\t\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t\t\twidth={20}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<CreditCardIcon size={16} aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div className=\"-mt-px flex\">\n\t\t\t\t\t\t\t\t\t<div className=\"min-w-0 flex-1 focus-within:z-10\">\n\t\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"rounded-e-none rounded-t-none shadow-none [direction:inherit]\"\n\t\t\t\t\t\t\t\t\t\t\t{...getExpiryDateProps()}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div className=\"-ms-px min-w-0 flex-1 focus-within:z-10\">\n\t\t\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"rounded-s-none rounded-t-none shadow-none [direction:inherit]\"\n\t\t\t\t\t\t\t\t\t\t\t{...getCVCProps()}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{!showCouponInput ? (\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tonClick={() => setShowCouponInput(true)}\n\t\t\t\t\t\t\t\tclassName=\"text-sm underline hover:no-underline\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t+ Add coupon\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className=\"not-first:*:mt-2\">\n\t\t\t\t\t\t\t\t<Label htmlFor={`coupon-${id}`}>Coupon code</Label>\n\t\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\t\tid={`coupon-${id}`}\n\t\t\t\t\t\t\t\t\tref={couponInputRef}\n\t\t\t\t\t\t\t\t\tplaceholder=\"Enter your code\"\n\t\t\t\t\t\t\t\t\tvalue={couponCode}\n\t\t\t\t\t\t\t\t\tonChange={(e) => setCouponCode(e.target.value)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t<Button type=\"button\" className=\"w-full\">\n\t\t\t\t\t\tSubscribe\n\t\t\t\t\t</Button>\n\t\t\t\t</form>\n\n\t\t\t\t<p className=\"text-muted-foreground text-center text-xs\">\n\t\t\t\t\tPayments are non-refundable. Cancel anytime.\n\t\t\t\t</p>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/badge.tsx",
      "content": "import React from \"react\";\r\n\r\nimport { cn } from \"@/registry/utilities/cn\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nconst badgeVariants = cva(\r\n\t\"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2\",\r\n\t{\r\n\t\tvariants: {\r\n\t\t\tvariant: {\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t\"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\r\n\t\t\t\tsecondary:\r\n\t\t\t\t\t\"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n\t\t\t\tdestructive:\r\n\t\t\t\t\t\"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\r\n\t\t\t\toutline: \"text-foreground\",\r\n\t\t\t},\r\n\t\t},\r\n\t\tdefaultVariants: {\r\n\t\t\tvariant: \"default\",\r\n\t\t},\r\n\t}\r\n);\r\n\r\nexport interface BadgeProps\r\n\textends React.HTMLAttributes<HTMLDivElement>,\r\n\t\tVariantProps<typeof badgeVariants> {}\r\n\r\nfunction Badge({ className, variant, ...props }: BadgeProps) {\r\n\treturn (\r\n\t\t<div className={cn(badgeVariants({ variant }), className)} {...props} />\r\n\t);\r\n}\r\n\r\nexport { Badge, badgeVariants };\r\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/utilities/cn.ts",
      "content": "import { ClassValue, clsx } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n\treturn twMerge(clsx(inputs));\r\n}\r\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/button.tsx",
      "content": "import * as React from \"react\";\r\n\r\nimport { cn } from \"@/registry/utilities/cn\";\r\nimport { Slot } from \"@radix-ui/react-slot\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nconst buttonVariants = cva(\r\n\t\"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm text-white hover:text-gray-400 font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\r\n\t{\r\n\t\tvariants: {\r\n\t\t\tvariant: {\r\n\t\t\t\tsimple:\r\n\t\t\t\t\t\"bg-secondary relative z-10 bg-transparent hover:border-secondary hover:bg-secondary/50  border border-transparent dark:text-white text-sm md:text-sm transition font-medium duration-200  rounded-md px-4 py-2  flex items-center justify-center\",\r\n\t\t\t\tdefault: \"bg-primary text-primary-foreground hover:bg-primary/90\",\r\n\t\t\t\tdestructive:\r\n\t\t\t\t\t\"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\r\n\t\t\t\toutline:\r\n\t\t\t\t\t\"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\r\n\t\t\t\tsecondary:\r\n\t\t\t\t\t\"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n\t\t\t\tghost: \"hover:bg-accent hover:text-black hover:stroke-black dark:text-white text-black\",\r\n\t\t\t\tlink: \"text-primary underline-offset-4 hover:underline\",\r\n\t\t\t},\r\n\t\t\tsize: {\r\n\t\t\t\tdefault: \"h-10 px-4 py-2\",\r\n\t\t\t\tsm: \"h-9 rounded-md px-3\",\r\n\t\t\t\tlg: \"h-11 rounded-md px-8\",\r\n\t\t\t\ticon: \"h-10 w-10\",\r\n\t\t\t},\r\n\t\t},\r\n\t\tdefaultVariants: {\r\n\t\t\tvariant: \"default\",\r\n\t\t\tsize: \"default\",\r\n\t\t},\r\n\t}\r\n);\r\n\r\nexport interface ButtonProps\r\n\textends React.ButtonHTMLAttributes<HTMLButtonElement>,\r\n\t\tVariantProps<typeof buttonVariants> {\r\n\tasChild?: boolean;\r\n}\r\n\r\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n\t({ className, variant, size, asChild = false, ...props }, ref) => {\r\n\t\tconst Comp = asChild ? Slot : \"button\";\r\n\t\treturn (\r\n\t\t\t<Comp\r\n\t\t\t\tclassName={cn(buttonVariants({ variant, size, className }))}\r\n\t\t\t\tref={ref}\r\n\t\t\t\t{...props}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\nButton.displayName = \"Button\";\r\n\r\nexport { Button, buttonVariants };\r\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/input.tsx",
      "content": "// SHADCN UI GENERATED CODE\n\nimport React from \"react\";\n\nimport { cn } from \"@/registry/utilities/cn\";\n\nexport interface InputProps\n\textends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n\t({ className, type, ...props }, ref) => {\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype={type}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t}\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/label.tsx",
      "content": "\"use client\";\n\nimport React from \"react\";\n\nimport { cn } from \"@/registry/utilities/cn\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst labelVariants = cva(\n\t\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n);\n\nconst Label = React.forwardRef<\n\tReact.ElementRef<typeof LabelPrimitive.Root>,\n\tReact.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n\t\tVariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n\t<LabelPrimitive.Root\n\t\tref={ref}\n\t\tclassName={cn(labelVariants(), className)}\n\t\t{...props}\n\t/>\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/radio-group.tsx",
      "content": "\"use client\";\r\n\r\nimport React from \"react\";\r\n\r\nimport { cn } from \"@/registry/utilities/cn\";\r\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\r\nimport { Circle } from \"lucide-react\";\r\n\r\nconst RadioGroup = React.forwardRef<\r\n\tReact.ElementRef<typeof RadioGroupPrimitive.Root>,\r\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\r\n>(({ className, ...props }, ref) => {\r\n\treturn (\r\n\t\t<RadioGroupPrimitive.Root\r\n\t\t\tclassName={cn(\"grid gap-2\", className)}\r\n\t\t\t{...props}\r\n\t\t\tref={ref}\r\n\t\t/>\r\n\t);\r\n});\r\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\r\n\r\nconst RadioGroupItem = React.forwardRef<\r\n\tReact.ElementRef<typeof RadioGroupPrimitive.Item>,\r\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\r\n>(({ className, ...props }, ref) => {\r\n\treturn (\r\n\t\t<RadioGroupPrimitive.Item\r\n\t\t\tref={ref}\r\n\t\t\tclassName={cn(\r\n\t\t\t\t\"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\r\n\t\t\t\tclassName\r\n\t\t\t)}\r\n\t\t\t{...props}\r\n\t\t>\r\n\t\t\t<RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\r\n\t\t\t\t<Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\r\n\t\t\t</RadioGroupPrimitive.Indicator>\r\n\t\t</RadioGroupPrimitive.Item>\r\n\t);\r\n});\r\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\r\n\r\nexport { RadioGroup, RadioGroupItem };\r\n",
      "type": "registry:ui"
    }
  ]
}