{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "glass-verification-code-card-shadcnui", "type": "registry:component", "title": "Glass Verification Code Card", "description": "Verification code entry with glassmorphic inputs, status messaging, and reduced-motion support", "registryDependencies": [ "button" ], "dependencies": [ "framer-motion", "react" ], "files": [ { "path": "@uitripled/react-shadcn/src/components/components/forms/glass-verification-code.tsx", "content": "\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { motion, useReducedMotion } from \"framer-motion\";\nimport { FormEvent, useMemo, useState } from \"react\";\n\nconst CODE_LENGTH = 6;\n\nexport function GlassVerificationCodeCard() {\n const shouldReduceMotion = useReducedMotion();\n const [code, setCode] = useState(Array(CODE_LENGTH).fill(\"\"));\n const [status, setStatus] = useState<\"idle\" | \"verified\" | \"error\">(\"idle\");\n\n const handleChange = (value: string, index: number) => {\n const sanitized = value.replace(/\\D/g, \"\").slice(-1);\n setCode((prev) => {\n const updated = [...prev];\n updated[index] = sanitized;\n return updated;\n });\n };\n\n const handleSubmit = (event: FormEvent) => {\n event.preventDefault();\n const hasEmpty = code.some((digit) => digit.trim().length === 0);\n setStatus(hasEmpty ? \"error\" : \"verified\");\n };\n\n const combinedCode = useMemo(() => code.join(\"\"), [code]);\n\n const resetCode = () => {\n setCode(Array(CODE_LENGTH).fill(\"\"));\n setStatus(\"idle\");\n };\n\n return (\n \n \n
\n
\n Verify Email\n
\n \n Enter verification code\n \n

\n We sent a 6-digit code to your inbox. Enter it below to confirm your\n email.\n

\n
\n\n
\n
\n {code.map((digit, index) => (\n handleChange(event.target.value, index)}\n className=\"h-14 w-full rounded-2xl border-border/60 bg-background/60 text-center text-lg font-semibold\"\n aria-label={`Verification digit ${index + 1}`}\n />\n ))}\n
\n\n \n Verify code\n \n \n\n \n Verification successful! Redirecting you now.\n \n \n Please fill every digit before verifying.\n \n\n
\n \n Resend code\n \n Code: {combinedCode || \"______\"}\n
\n \n );\n}\n", "type": "registry:component", "target": "components/uitripled/glass-verification-code-card-shadcnui.tsx" } ] }