{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ds-register",
  "title": "Register",
  "description": "Formulário de cadastro com social — átomo base register.",
  "dependencies": [],
  "registryDependencies": [
    "@lema-ds/input",
    "@lema-ds/button",
    "@lema-ds/checkbox",
    "@lema-ds/label",
    "@lema-ds/ds-input-password",
    "@lema-ds/ds-social-auth-group",
    "@lema-ds/ds-auth-separator",
    "@lema-ds/skeleton",
    "@lema-ds/ui-i18n",
    "@lema-ds/field",
    "@lema-ds/ds-locale-provider"
  ],
  "files": [
    {
      "path": "components/ds/ds-register.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { UI_I18N, type UILocale } from \"@/lib/ui-i18n\"\nimport { useUILocale } from \"@/components/ui/ds-locale-provider\"\nimport { Button } from \"@/components/ui/button\"\nimport { Input } from \"@/components/ui/input\"\nimport { Label } from \"@/components/ui/label\"\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport { Skeleton } from \"@/components/ui/skeleton\"\nimport {\n  Field,\n  FieldGroup,\n  FieldLabel,\n  FieldDescription,\n} from \"@/components/ui/field\"\nimport { PasswordInput } from \"./ds-input-password\"\nimport { SocialAuthGroup } from \"./ds-social-auth-group\"\nimport { AuthSeparator } from \"./ds-auth-separator\"\n\n// ── Types ──────────────────────────────────────────────────────────────────\n\nexport interface RegisterProps extends Omit<\n  React.HTMLAttributes<HTMLDivElement>,\n  \"onSubmit\"\n> {\n  onSubmit?: (data: { name: string; email: string; password: string }) => void\n  showSocial?: boolean\n  socials?: (\"google\" | \"github\" | \"apple\" | \"microsoft\")[]\n  locale?: UILocale\n  loading?: boolean\n}\n\n// ── Component ──────────────────────────────────────────────────────────────\n\nexport function Register({\n  className,\n  onSubmit,\n  showSocial = true,\n  socials = [\"google\", \"github\"],\n  locale: localeProp,\n  loading = false,\n  ...props\n}: RegisterProps) {\n  const locale = useUILocale(localeProp)\n  const [name, setName] = React.useState(\"\")\n  const [email, setEmail] = React.useState(\"\")\n  const [password, setPassword] = React.useState(\"\")\n  const [agree, setAgree] = React.useState(false)\n\n  const t = UI_I18N[locale].auth\n\n  if (loading) {\n    return (\n      <div\n        data-slot=\"register-skeleton\"\n        className={cn(\n          \"flex flex-col gap-6 rounded-2xl border bg-card p-6\",\n          className\n        )}\n        {...props}\n      >\n        <Skeleton className=\"h-6 w-32\" />\n        <Skeleton className=\"h-4 w-full\" />\n        <Skeleton className=\"h-10 w-full\" />\n        <Skeleton className=\"h-10 w-full\" />\n        <Skeleton className=\"h-10 w-full\" />\n        <Skeleton className=\"h-10 w-full rounded-full\" />\n      </div>\n    )\n  }\n\n  const handleSubmit = (e: React.FormEvent) => {\n    e.preventDefault()\n    if (!agree) return\n    onSubmit?.({ name, email, password })\n  }\n\n  return (\n    <div\n      data-slot=\"register\"\n      className={cn(\n        \"flex flex-col gap-6 rounded-2xl border bg-card p-6\",\n        className\n      )}\n      {...props}\n    >\n      <div className=\"flex flex-col gap-2\">\n        <h2 className=\"text-lg font-semibold text-foreground\">\n          {t.createAccount}\n        </h2>\n        <p className=\"text-sm text-muted-foreground\">{t.termsAgreement}</p>\n      </div>\n\n      {showSocial && (\n        <>\n          <SocialAuthGroup providers={socials as never} locale={locale} />\n          <AuthSeparator>{t.orContinueWith}</AuthSeparator>\n        </>\n      )}\n\n      <form onSubmit={handleSubmit} className=\"flex flex-col gap-4\">\n        <FieldGroup>\n          <Field>\n            <FieldLabel htmlFor=\"register-name\">{t.name}</FieldLabel>\n            <Input\n              id=\"register-name\"\n              placeholder={t.namePlaceholder}\n              value={name}\n              onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n                setName(e.target.value)\n              }\n              required\n            />\n          </Field>\n          <Field>\n            <FieldLabel htmlFor=\"register-email\">{t.email}</FieldLabel>\n            <Input\n              id=\"register-email\"\n              type=\"email\"\n              placeholder={t.emailPlaceholder}\n              value={email}\n              onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n                setEmail(e.target.value)\n              }\n              required\n            />\n          </Field>\n          <Field>\n            <FieldLabel htmlFor=\"register-password\">{t.password}</FieldLabel>\n            <PasswordInput\n              id=\"register-password\"\n              placeholder={t.passwordPlaceholder}\n              value={password}\n              onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n                setPassword(e.target.value)\n              }\n              required\n            />\n            <FieldDescription className=\"text-xs\">\n              {t.ruleLength}\n            </FieldDescription>\n          </Field>\n          <Field orientation=\"horizontal\">\n            <Checkbox\n              id=\"register-terms\"\n              checked={agree}\n              onCheckedChange={(v) => setAgree(v === true)}\n              required\n            />\n            <Label\n              htmlFor=\"register-terms\"\n              className=\"text-xs leading-relaxed font-normal\"\n            >\n              {t.termsAgreement}{\" \"}\n              <a\n                href=\"#\"\n                className=\"font-medium text-primary underline-offset-4 hover:underline\"\n              >\n                {t.termsOfService}\n              </a>{\" \"}\n              {t.and}{\" \"}\n              <a\n                href=\"#\"\n                className=\"font-medium text-primary underline-offset-4 hover:underline\"\n              >\n                {t.privacyPolicy}\n              </a>\n            </Label>\n          </Field>\n        </FieldGroup>\n\n        <Button\n          type=\"submit\"\n          disabled={!agree}\n          className=\"w-full rounded-full font-semibold\"\n        >\n          {t.createAccount}\n        </Button>\n      </form>\n    </div>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}
