{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "auth2",
  "title": "Split-Screen Sign Up",
  "description": "Two-column registration screen pairing a sign-up form (social providers, name, email, password with show/hide, terms checkbox) with a full-bleed image showcase and customer testimonial. Includes a left/right image position toggle.",
  "dependencies": [
    "clsx",
    "tailwind-merge",
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "input",
    "field",
    "checkbox",
    "avatar"
  ],
  "files": [
    {
      "path": "registry/auth2/auth2.tsx",
      "content": "\"use client\";\n\nimport { Eye, EyeOff } from \"lucide-react\";\nimport Link from \"next/link\";\nimport { useId, useState } from \"react\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\";\nimport { Button } from \"@/components/ui/button\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n  Field,\n  FieldDescription,\n  FieldGroup,\n  FieldLabel,\n  FieldSeparator,\n} from \"@/components/ui/field\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils\";\n\ninterface SocialProvider {\n  label: string;\n  icon: React.ReactNode;\n  href?: string;\n}\n\ninterface AuthField {\n  label: string;\n  placeholder: string;\n  type?: string;\n}\n\ninterface Auth2Props {\n  heading?: string;\n  description?: string;\n  socialProviders?: SocialProvider[];\n  fields?: AuthField[];\n  signinPrompt?: {\n    text: string;\n    linkLabel: string;\n    href: string;\n  };\n  labels?: {\n    divider?: string;\n    terms?: string;\n    submit?: string;\n    passwordToggle?: string;\n  };\n  showcase?: {\n    image: {\n      src: string;\n      alt: string;\n    };\n    quote?: string;\n    author?: {\n      name: string;\n      title: string;\n      avatar?: {\n        src: string;\n        alt: string;\n      };\n    };\n  };\n  mediaPosition?: \"left\" | \"right\";\n  className?: string;\n}\n\nconst GoogleIcon = (\n  <svg viewBox=\"0 0 24 24\" className=\"size-4\" aria-hidden=\"true\">\n    <path\n      fill=\"#4285F4\"\n      d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"\n    />\n    <path\n      fill=\"#34A853\"\n      d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n    />\n    <path\n      fill=\"#FBBC05\"\n      d=\"M5.84 14.1c-.22-.66-.35-1.36-.35-2.1s.13-1.44.35-2.1V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.83z\"\n    />\n    <path\n      fill=\"#EA4335\"\n      d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n    />\n  </svg>\n);\n\nconst GithubIcon = (\n  <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" className=\"size-4\" aria-hidden=\"true\">\n    <path d=\"M12 1C5.92 1 1 5.92 1 12c0 4.87 3.15 8.99 7.52 10.45.55.1.75-.24.75-.53 0-.26-.01-1.13-.02-2.04-3.06.66-3.71-1.3-3.71-1.3-.5-1.27-1.22-1.61-1.22-1.61-1-.68.07-.67.07-.67 1.1.08 1.69 1.13 1.69 1.13.98 1.69 2.58 1.2 3.21.92.1-.71.39-1.2.7-1.48-2.45-.28-5.02-1.22-5.02-5.45 0-1.2.43-2.18 1.13-2.95-.11-.28-.49-1.4.11-2.92 0 0 .92-.3 3.02 1.13a10.5 10.5 0 0 1 5.5 0c2.1-1.43 3.02-1.13 3.02-1.13.6 1.52.22 2.64.11 2.92.7.77 1.13 1.75 1.13 2.95 0 4.24-2.58 5.16-5.04 5.44.4.34.75 1.02.75 2.06 0 1.49-.01 2.69-.01 3.05 0 .29.2.64.76.53C19.85 20.99 23 16.87 23 12c0-6.08-4.92-11-11-11z\" />\n  </svg>\n);\n\nexport const auth2Demo: Auth2Props = {\n  heading: \"Create your account\",\n  description: \"Start your 14-day free trial. No credit card required.\",\n  socialProviders: [\n    { label: \"Google\", icon: GoogleIcon, href: \"https://beste.co\" },\n    { label: \"GitHub\", icon: GithubIcon, href: \"https://beste.co\" },\n  ],\n  fields: [\n    { label: \"Full name\", placeholder: \"Jane Cooper\", type: \"text\" },\n    { label: \"Email\", placeholder: \"you@example.com\", type: \"email\" },\n    { label: \"Password\", placeholder: \"Create a password\", type: \"password\" },\n  ],\n  signinPrompt: {\n    text: \"Already have an account?\",\n    linkLabel: \"Sign in\",\n    href: \"https://beste.co\",\n  },\n  labels: {\n    divider: \"or sign up with email\",\n    terms:\n      'I agree to the <a href=\"https://beste.co\">Terms of Service</a> and <a href=\"https://beste.co\">Privacy Policy</a>',\n    submit: \"Create account\",\n    passwordToggle: \"Toggle password visibility\",\n  },\n  showcase: {\n    image: {\n      src: \"https://images.unsplash.com/photo-1779243829348-85bf26cff23b?q=80&w=987&auto=format&fit=crop\",\n      alt: \"Team collaborating in a modern workspace\",\n    },\n    quote:\n      \"Switching to this platform cut our onboarding time in half. The whole team was up and running within a single afternoon.\",\n    author: {\n      name: \"Maria Santos\",\n      title: \"Head of Operations, Northwind\",\n      avatar: {\n        src: \"https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=100&h=100&fit=crop\",\n        alt: \"Maria Santos\",\n      },\n    },\n  },\n  mediaPosition: \"right\",\n};\n\nexport function Auth2({\n  heading,\n  description,\n  socialProviders = [],\n  fields = [],\n  signinPrompt,\n  labels = {},\n  showcase,\n  mediaPosition = \"right\",\n  className,\n}: Auth2Props) {\n  const [showPassword, setShowPassword] = useState(false);\n  const fieldId = useId();\n\n  const {\n    divider: dividerLabel,\n    terms: termsLabel,\n    submit: submitLabel,\n    passwordToggle: passwordToggleLabel,\n  } = labels;\n\n  return (\n    <section className={cn(\"min-h-screen w-full\", className)}>\n      <div className=\"grid min-h-screen lg:grid-cols-2\">\n        {/* Form column */}\n        <div\n          className={cn(\n            \"flex items-center justify-center px-4 py-16 md:px-6 md:py-24\",\n            mediaPosition === \"left\" ? \"lg:order-2\" : \"lg:order-1\"\n          )}\n        >\n          <div className=\"w-full max-w-md\">\n            <div className=\"mb-8\">\n              {heading && <h1 className=\"text-2xl font-bold md:text-3xl\">{heading}</h1>}\n              {description && <p className=\"mt-2 text-base text-muted-foreground\">{description}</p>}\n            </div>\n\n            <form onSubmit={(e) => e.preventDefault()}>\n              <FieldGroup>\n                {socialProviders.length > 0 && (\n                  <Field className=\"grid grid-cols-2 gap-4\">\n                    {socialProviders.map((provider, index) => (\n                      <Button key={index} variant=\"outline\" size=\"lg\" asChild>\n                        <Link href={provider.href ?? \"#\"}>\n                          {provider.icon}\n                          {provider.label}\n                        </Link>\n                      </Button>\n                    ))}\n                  </Field>\n                )}\n\n                {dividerLabel && <FieldSeparator>{dividerLabel}</FieldSeparator>}\n\n                {fields.map((field, index) => {\n                  const isPassword = field.type === \"password\";\n                  const inputId = `${fieldId}-${index}`;\n                  return (\n                    <Field key={index}>\n                      <FieldLabel htmlFor={inputId}>{field.label}</FieldLabel>\n                      {isPassword ? (\n                        <div className=\"relative\">\n                          <Input\n                            id={inputId}\n                            type={showPassword ? \"text\" : \"password\"}\n                            placeholder={field.placeholder}\n                            className=\"h-11 pr-11\"\n                          />\n                          <Button\n                            type=\"button\"\n                            variant=\"ghost\"\n                            size=\"icon\"\n                            aria-label={passwordToggleLabel}\n                            onClick={() => setShowPassword((value) => !value)}\n                            className=\"absolute right-1 top-1/2 size-9 -translate-y-1/2 text-muted-foreground\"\n                          >\n                            {showPassword ? (\n                              <EyeOff className=\"size-4\" />\n                            ) : (\n                              <Eye className=\"size-4\" />\n                            )}\n                          </Button>\n                        </div>\n                      ) : (\n                        <Input\n                          id={inputId}\n                          type={field.type ?? \"text\"}\n                          placeholder={field.placeholder}\n                          className=\"h-11\"\n                        />\n                      )}\n                    </Field>\n                  );\n                })}\n\n                {termsLabel && (\n                  <Field orientation=\"horizontal\">\n                    <Checkbox id={`${fieldId}-terms`} className=\"mt-0.5\" />\n                    <FieldLabel\n                      htmlFor={`${fieldId}-terms`}\n                      className=\"font-normal text-muted-foreground [&_a]:font-medium [&_a]:text-foreground [&_a]:underline\"\n                      dangerouslySetInnerHTML={{ __html: termsLabel }}\n                    />\n                  </Field>\n                )}\n\n                {submitLabel && (\n                  <Field>\n                    <Button type=\"submit\" size=\"lg\">\n                      {submitLabel}\n                    </Button>\n                  </Field>\n                )}\n              </FieldGroup>\n            </form>\n\n            {signinPrompt && (\n              <FieldDescription className=\"!mt-6 text-center\">\n                {signinPrompt.text}{\" \"}\n                <Link href={signinPrompt.href} className=\"font-medium text-foreground\">\n                  {signinPrompt.linkLabel}\n                </Link>\n              </FieldDescription>\n            )}\n          </div>\n        </div>\n\n        {/* Showcase column */}\n        {showcase && (\n          <div\n            className={cn(\n              \"relative hidden overflow-hidden lg:block\",\n              mediaPosition === \"left\" ? \"lg:order-1\" : \"lg:order-2\"\n            )}\n          >\n            <img\n              className=\"absolute inset-0 size-full object-cover\"\n              src={showcase.image.src}\n              alt={showcase.image.alt}\n            />\n            <div className=\"absolute inset-0 bg-foreground/50\" />\n\n            {(showcase.quote || showcase.author) && (\n              <div className=\"absolute inset-x-0 bottom-0 p-10 xl:p-14\">\n                {showcase.quote && (\n                  <blockquote className=\"text-xl font-medium text-background xl:text-2xl\">\n                    “{showcase.quote}”\n                  </blockquote>\n                )}\n                {showcase.author && (\n                  <div className=\"mt-6 flex items-center gap-3\">\n                    {showcase.author.avatar && (\n                      <Avatar className=\"size-11\">\n                        <AvatarImage\n                          src={showcase.author.avatar.src}\n                          alt={showcase.author.avatar.alt}\n                          className=\"object-cover\"\n                        />\n                        <AvatarFallback>\n                          {showcase.author.name\n                            .split(\" \")\n                            .map((part) => part[0])\n                            .join(\"\")}\n                        </AvatarFallback>\n                      </Avatar>\n                    )}\n                    <div>\n                      <p className=\"font-semibold text-background\">{showcase.author.name}</p>\n                      <p className=\"text-sm text-background/70\">{showcase.author.title}</p>\n                    </div>\n                  </div>\n                )}\n              </div>\n            )}\n          </div>\n        )}\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/beste/block/auth2.tsx"
    }
  ],
  "type": "registry:block"
}