# RegisterForm

> Presentational sign-up form with name, email, password with strength meter, confirmation, terms consent and provider buttons; en and ar built in.

Source: https://docs.nasaqui.com/components/register-form

## Install

```bash
npx shadcn@latest add https://docs.nasaqui.com/r/register-form.json
```

A sign-up form that owns no auth logic. It checks required fields, email shape, minimum password length, matching
confirmation and the terms box, then calls `onSubmit(values)`. Provider buttons sit on top with a divider.

## When to use

- The create-account screen, inside `AuthLayout`.

## When not to use

- Inviting a team member: use an invite form.
- Confirming the email afterwards: use `VerifyOtpForm`.

## Import

```tsx
import { RegisterForm } from "@fadymondy/nasaq/web";
// inside this monorepo: "@nasaq/web"
```

## Quick start

```tsx
import { RegisterForm } from "@fadymondy/nasaq/web";

export function SignUp() {
  return (
    <RegisterForm
      terms={<>I agree to the <a href="/terms">Terms</a> and <a href="/privacy">Privacy Policy</a></>}
      onSubmit={async (values) => {
        const res = await api.register(values);
        if (res.taken) return { fieldErrors: { email: "This email is already registered." } };
      }}
    />
  );
}

declare const api: { register(v: unknown): Promise<{ taken: boolean }> };
```

## Anatomy

```
RegisterForm                     data-slot="register-form" (form, noValidate)
├─ OAuthButtons + divider        (optional, on top)
├─ error summary                 role="alert"
├─ Field: name                   autocomplete="name"
├─ Field: email                  autocomplete="email"
├─ Field: password               autocomplete="new-password", strength meter, hint
├─ Field: confirm                autocomplete="new-password"
├─ terms checkbox
└─ submit Button
```

## API

**RegisterForm**: every `form` prop except `onSubmit` and `children`, plus:

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `onSubmit` | `(values: RegisterValues) => Promise<AuthSubmitResult> \| AuthSubmitResult` | required | `RegisterValues` is `{ name, email, password, acceptTerms }`. |
| `minPasswordLength` | `number` | `8` | Checked before `onSubmit`. |
| `requireTerms` | `boolean` | `true` | Require the terms checkbox. |
| `terms` | `ReactNode` | `labels.terms` | The terms sentence, with links. |
| `oauthProviders` | `OAuthProvider[]` | | Show provider buttons. |
| `onOAuth` | `(id: string) => void \| Promise<unknown>` | | Provider click handler. |
| `labels` | `Partial<RegisterFormLabels>` | English or Arabic | Every string. `passwordHint` uses `{min}`. |

`fieldErrors` keys: `name`, `email`, `password`, `confirm`, `terms`.

## Examples

**Terms optional, longer passwords**

```tsx
import { RegisterForm } from "@fadymondy/nasaq/web";

export function Strict() {
  return <RegisterForm requireTerms={false} minPasswordLength={12} onSubmit={async () => {}} />;
}
```

## Accessibility

- The form is `noValidate` and validates itself, so messages are yours to localise and read in one place. Every field
  has a visible `<label>`; an invalid field gets `aria-invalid` and its message is linked with `aria-describedby`.
- On a failed submit focus moves to the first invalid field. When the failure is for the whole form (`error`) the
  summary at the top of the form (`role="alert"`) is focused instead, so it is announced.
- The submit button shows a spinner and is `aria-busy` while `onSubmit` runs; a second submit is ignored.
- Autocomplete: `name`, `email`, and `new-password` on both password fields so managers offer to generate one.
- The strength meter is `role="meter"` with a live level word; it is a hint, not a policy. Enforce rules on the server.
- The terms checkbox is a real checkbox with its sentence as the label; links inside the sentence stay focusable.

## RTL & i18n

- Built-in English and Arabic strings follow the Nasaq locale (`useNasaq`). Pass `labels` to change any of them or to
  add another language; keys you omit keep the built-in text.
- Layout uses logical properties, so it mirrors under `dir="rtl"` with no extra work.
- The email keeps left-to-right entry. The name field follows the page direction so Arabic names type naturally.

## Styling & tokens

- Built from `Field`, `Input`, `PasswordInput`, `Checkbox`, `Button` and `OAuthButtons`; tokens only.

## Do / Don't

- Do link the terms and privacy policy through the `terms` prop.
- Do map server conflicts to `fieldErrors`.
- Don't rely on the client strength meter for policy.
- Don't ask for more than you need at sign-up.

## Related

- [`auth-layout`](https://docs.nasaqui.com/components/auth-layout)
- [`oauth-buttons`](https://docs.nasaqui.com/components/oauth-buttons)
- [`login-form`](https://docs.nasaqui.com/components/login-form)
- [`verify-otp-form`](https://docs.nasaqui.com/components/verify-otp-form)
- [`password-input`](https://docs.nasaqui.com/components/password-input)

## Lab

https://docs.nasaqui.com/?path=/docs/components-auth-register-form--docs

## Code

### React

```tsx
import { RegisterForm } from "@fadymondy/nasaq/web";

export function SignUp() {
  return (
    <RegisterForm
      terms={<>I agree to the <a href="/terms">Terms</a> and <a href="/privacy">Privacy Policy</a></>}
      onSubmit={async (values) => {
        const res = await api.register(values);
        if (res.taken) return { fieldErrors: { email: "This email is already registered." } };
      }}
    />
  );
}

declare const api: { register(v: unknown): Promise<{ taken: boolean }> };
```

### shadcn

```tsx
import { RegisterForm } from "@/components/ui/register-form";

export function SignUp() {
  return (
    <RegisterForm
      terms={<>I agree to the <a href="/terms">Terms</a> and <a href="/privacy">Privacy Policy</a></>}
      onSubmit={async (values) => {
        const res = await api.register(values);
        if (res.taken) return { fieldErrors: { email: "This email is already registered." } };
      }}
    />
  );
}

declare const api: { register(v: unknown): Promise<{ taken: boolean }> };
```

### Vue

```vue
<script setup lang="ts">
import { NqRegisterForm, type RegisterValues } from "@fadymondy/nasaq/vue";

// Your API call. Return { fieldErrors: { email: "..." } } when the address is taken.
async function register(values: RegisterValues) {
  await new Promise((r) => setTimeout(r, 400));
  if (values.email === "taken@example.com") return { fieldErrors: { email: "This email is already registered." } };
}
</script>

<template>
  <div class="w-80">
    <NqRegisterForm :on-submit="register" :oauth-providers="['google', 'github']">
      <template #terms>I agree to the <a href="/terms" class="underline underline-offset-2">Terms</a> and <a href="/privacy" class="underline underline-offset-2">Privacy Policy</a></template>
    </NqRegisterForm>
  </div>
</template>
```

### Blade

```blade
{{-- Your sign-up call. Resolve { fieldErrors: { email: "…" } } when the address is taken. --}}
<div class="w-80">
    <x-nq::register-form :oauth-providers="['google', 'github']"
        x-on:nq-register="$event.detail.waitUntil(new Promise((done) => setTimeout(() => done($event.detail.email === 'taken@example.com' ? { fieldErrors: { email: 'This email is already registered.' } } : undefined), 300)))">
        <x-slot:terms>I agree to the <a href="/terms" class="underline underline-offset-2">Terms</a> and <a href="/privacy" class="underline underline-offset-2">Privacy Policy</a></x-slot:terms>
    </x-nq::register-form>
</div>
```

### HTML + Alpine

```html
<div class="w-80">
    <form data-slot="register-form" novalidate x-data="nqRegisterForm(JSON.parse('{\u0022minLength\u0022:8,\u0022requireTerms\u0022:true,\u0022names\u0022:[\u0022name\u0022,\u0022email\u0022,\u0022password\u0022,\u0022confirm\u0022,\u0022terms\u0022],\u0022fieldLabels\u0022:{\u0022name\u0022:\u0022Full name\u0022,\u0022email\u0022:\u0022Email\u0022,\u0022password\u0022:\u0022Password\u0022,\u0022confirm\u0022:\u0022Confirm password\u0022},\u0022errorTitle\u0022:\u0022Fix these to create your account\u0022,\u0022failed\u0022:\u0022Something went wrong. Try again.\u0022,\u0022labels\u0022:{\u0022name\u0022:\u0022Full name\u0022,\u0022namePlaceholder\u0022:\u0022Your name\u0022,\u0022email\u0022:\u0022Email\u0022,\u0022emailPlaceholder\u0022:\u0022you@example.com\u0022,\u0022password\u0022:\u0022Password\u0022,\u0022passwordHint\u0022:\u0022At least {min} characters.\u0022,\u0022confirm\u0022:\u0022Confirm password\u0022,\u0022terms\u0022:\u0022I agree to the terms of service and privacy policy\u0022,\u0022submit\u0022:\u0022Create account\u0022,\u0022divider\u0022:\u0022or sign up with email\u0022,\u0022nameRequired\u0022:\u0022Enter your name.\u0022,\u0022emailRequired\u0022:\u0022Enter your email address.\u0022,\u0022emailInvalid\u0022:\u0022Enter a valid email address.\u0022,\u0022passwordShort\u0022:\u0022Use at least {min} characters.\u0022,\u0022confirmMismatch\u0022:\u0022The passwords do not match.\u0022,\u0022termsRequired\u0022:\u0022Accept the terms to continue.\u0022,\u0022errorTitle\u0022:\u0022Fix these to create your account\u0022,\u0022failed\u0022:\u0022Something went wrong. Try again.\u0022}}'))" x-bind:aria-busy="pending ? 'true' : null"
    x-on:submit.prevent="onSubmit()" x-on:input="clear($event.target.name)" x-on:nq-register="$event.detail.waitUntil(new Promise((done) =&gt; setTimeout(() =&gt; done($event.detail.email === &#039;taken@example.com&#039; ? { fieldErrors: { email: &#039;This email is already registered.&#039; } } : undefined), 300)))" class="flex w-full flex-col gap-4">
            <div role="group" aria-label="Sign in with a provider" data-slot="oauth-buttons" data-layout="stack"
    x-data="nqOAuthButtons(null, false)" x-modelable="pending"
    class="flex w-full flex-col gap-2">
                    <button data-slot="oauth-button"
     type="button"                         data-provider="google" x-on:click="select(&#039;google&#039;)" x-bind:disabled="isDisabled(&#039;google&#039;)" x-bind:aria-busy="isBusy(&#039;google&#039;) ? &#039;true&#039; : null" x-bind:data-disabled="(disabled || isBusy(&#039;google&#039;)) ? &#039;&#039; : null" class="inline-flex shrink-0 select-none items-center whitespace-nowrap rounded-control border font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 border-border bg-card text-foreground hover:bg-nq-hover h-control px-[var(--nq-control-pad)] relative w-full min-w-0 justify-center gap-3 [&_svg]:size-auto">
        <span class="contents" x-show="! isBusy('google')" >
                                    <svg viewBox="10 10 20 20" width="20" height="20" aria-hidden="true" focusable="false" >
    <path d="M29.6 20.2273C29.6 19.5182 29.5364 18.8364 29.4182 18.1818H20V22.05H25.3818C25.15 23.3 24.4455 24.3591 23.3864 25.0682V27.5773H26.6182C28.5091 25.8364 29.6 23.2727 29.6 20.2273Z" fill="#4285F4" />
    <path d="M20 30C22.7 30 24.9636 29.1045 26.6181 27.5773L23.3863 25.0682C22.4909 25.6682 21.3454 26.0227 20 26.0227C17.3954 26.0227 15.1909 24.2636 14.4045 21.9H11.0636V24.4909C12.7091 27.7591 16.0909 30 20 30Z" fill="#34A853" />
    <path d="M14.4045 21.9C14.2045 21.3 14.0909 20.6591 14.0909 20C14.0909 19.3409 14.2045 18.7 14.4045 18.1V15.5091H11.0636C10.3864 16.8591 10 18.3864 10 20C10 21.6136 10.3864 23.1409 11.0636 24.4909L14.4045 21.9Z" fill="#FBBC04" />
    <path d="M20 13.9773C21.4681 13.9773 22.7863 14.4818 23.8227 15.4727L26.6909 12.6045C24.9591 10.9909 22.6954 10 20 10C16.0909 10 12.7091 12.2409 11.0636 15.5091L14.4045 18.1C15.1909 15.7364 17.3954 13.9773 20 13.9773Z" fill="#E94235" />
</svg>
                            </span>
            <span class="contents" x-show="isBusy('google')"  style="display: none" >
                <svg data-slot="spinner" aria-hidden="true" class="animate-spin motion-reduce:animate-none size-4!" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M21 12a9 9 0 1 1-6.219-8.56"/>
</svg>            </span>
                                                <span class="truncate">Sign up with <bdi>Google</bdi></span></button>
                    <button data-slot="oauth-button"
     type="button"                         data-provider="github" x-on:click="select(&#039;github&#039;)" x-bind:disabled="isDisabled(&#039;github&#039;)" x-bind:aria-busy="isBusy(&#039;github&#039;) ? &#039;true&#039; : null" x-bind:data-disabled="(disabled || isBusy(&#039;github&#039;)) ? &#039;&#039; : null" class="inline-flex shrink-0 select-none items-center whitespace-nowrap rounded-control border font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 border-border bg-card text-foreground hover:bg-nq-hover h-control px-[var(--nq-control-pad)] relative w-full min-w-0 justify-center gap-3 [&_svg]:size-auto">
        <span class="contents" x-show="! isBusy('github')" >
                                    <svg viewBox="0 0 98 96" width="20" height="20" aria-hidden="true" focusable="false" >
    <path d="M41.4395 69.3848C28.8066 67.8535 19.9062 58.7617 19.9062 46.9902C19.9062 42.2051 21.6289 37.0371 24.5 33.5918C23.2559 30.4336 23.4473 23.7344 24.8828 20.959C28.7109 20.4805 33.8789 22.4902 36.9414 25.2656C40.5781 24.1172 44.4062 23.543 49.0957 23.543C53.7852 23.543 57.6133 24.1172 61.0586 25.1699C64.0254 22.4902 69.2891 20.4805 73.1172 20.959C74.457 23.543 74.6484 30.2422 73.4043 33.4961C76.4668 37.1328 78.0937 42.0137 78.0937 46.9902C78.0937 58.7617 69.1934 67.6621 56.3691 69.2891C59.623 71.3945 61.8242 75.9883 61.8242 81.252L61.8242 91.2051C61.8242 94.0762 64.2168 95.7031 67.0879 94.5547C84.4102 87.9512 98 70.6289 98 49.1914C98 22.1074 75.9883 6.69539e-07 48.9043 4.309e-07C21.8203 1.92261e-07 -1.9479e-07 22.1074 -4.3343e-07 49.1914C-6.20631e-07 70.4375 13.4941 88.0469 31.6777 94.6504C34.2617 95.6074 36.75 93.8848 36.75 91.3008L36.75 83.6445C35.4102 84.2188 33.6875 84.6016 32.1562 84.6016C25.8398 84.6016 22.1074 81.1563 19.4277 74.7441C18.375 72.1602 17.2266 70.6289 15.0254 70.3418C13.877 70.2461 13.4941 69.7676 13.4941 69.1934C13.4941 68.0449 15.4082 67.1836 17.3223 67.1836C20.0977 67.1836 22.4902 68.9063 24.9785 72.4473C26.8926 75.2227 28.9023 76.4668 31.2949 76.4668C33.6875 76.4668 35.2187 75.6055 37.4199 73.4043C39.0469 71.7773 40.291 70.3418 41.4395 69.3848Z"  class="fill-black dark:fill-white"  />
</svg>
                            </span>
            <span class="contents" x-show="isBusy('github')"  style="display: none" >
                <svg data-slot="spinner" aria-hidden="true" class="animate-spin motion-reduce:animate-none size-4!" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M21 12a9 9 0 1 1-6.219-8.56"/>
</svg>            </span>
                                                <span class="truncate">Sign up with <bdi>GitHub</bdi></span></button>
    </div>
        <div data-slot="oauth-divider" role="separator" class="flex items-center gap-3 text-caption text-muted-foreground">
    <span aria-hidden="true" class="h-px flex-1 bg-border"></span>
    <span>or sign up with email</span>
    <span aria-hidden="true" class="h-px flex-1 bg-border"></span>
</div>
        <div tabindex="-1" class="sr-only" x-show="! problems()"></div>
<div tabindex="-1" data-slot="auth-error-summary" class="outline-none" x-show="problems()" style="display: none">
    <div data-slot="alert" data-tone="danger" role="alert" class="relative grid grid-cols-[auto_1fr_auto] items-start gap-x-3 rounded-card border p-3 text-start border-nq-danger/30 bg-nq-danger-soft">
        <svg aria-hidden="true" data-slot="alert-icon" class="mt-0.5 size-4 text-nq-danger-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <circle cx="12" cy="12" r="10"/>
  <path d="m15 9-6 6"/>
  <path d="m9 9 6 6"/>
</svg>        <div data-slot="alert-body" class="flex min-w-0 flex-col gap-0.5">
            <div data-slot="alert-title" class="text-label text-foreground" x-text="summaryTitle()"></div>
            <div data-slot="alert-description" class="text-body-sm text-muted-foreground" x-show="! error && entries().length" style="display: none">
                <ul class="flex list-disc flex-col gap-0.5 ps-4">
                    <template x-for="e in entries()" :key="e.name">
                        <li><button type="button" class="text-start underline underline-offset-2" x-on:click="focusField(e.name)" x-text="(e.label ? e.label + ': ' : '') + e.message"></button></li>
                    </template>
                </ul>
            </div>
        </div>
    </div>
</div>
    <div data-slot="field" x-data="nqField(false)" x-modelable="invalid" x-id="['nq-field']"
         data-valid     x-model="bad.name" class="flex flex-col gap-1.5">
    <label data-slot="field-label"  for="nq-register-000001-name" class="text-label text-foreground data-disabled:opacity-50">Full name</label>
        <input data-slot="input" type="text"
         name="name"             id="nq-register-000001-name" autocomplete="name" placeholder="Your name" aria-describedby="nq-register-000001-name-error" x-bind:aria-invalid="bad.name ? &#039;true&#039; : null" class="w-full min-w-0 rounded-control border border-input bg-card px-3 text-body text-foreground min-h-[var(--nq-touch-min,0px)] transition-colors duration-150 ease-nq outline-none placeholder:text-muted-foreground focus-visible:border-nq-focus focus-visible:outline-1 focus-visible:outline-nq-focus data-invalid:border-nq-danger aria-invalid:border-nq-danger disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:text-[16px] h-control">
        <div data-slot="field-error" role="alert" x-show="invalid"  style="display: none"  id="nq-register-000001-name-error" class="text-caption text-nq-danger-text"><span x-text="fe.name"></span></div>
</div>
    <div data-slot="field" x-data="nqField(false)" x-modelable="invalid" x-id="['nq-field']"
         data-valid     x-model="bad.email" class="flex flex-col gap-1.5">
    <label data-slot="field-label"  for="nq-register-000001-email" class="text-label text-foreground data-disabled:opacity-50">Email</label>
        <input data-slot="input" type="email"
     dir="ltr"      name="email"             id="nq-register-000001-email" autocomplete="email" inputmode="email" placeholder="you@example.com" aria-describedby="nq-register-000001-email-error" x-bind:aria-invalid="bad.email ? &#039;true&#039; : null" class="w-full min-w-0 rounded-control border border-input bg-card px-3 text-body text-foreground min-h-[var(--nq-touch-min,0px)] transition-colors duration-150 ease-nq outline-none placeholder:text-muted-foreground focus-visible:border-nq-focus focus-visible:outline-1 focus-visible:outline-nq-focus data-invalid:border-nq-danger aria-invalid:border-nq-danger disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:text-[16px] h-control text-start">
        <div data-slot="field-error" role="alert" x-show="invalid"  style="display: none"  id="nq-register-000001-email-error" class="text-caption text-nq-danger-text"><span x-text="fe.email"></span></div>
</div>
    <div data-slot="field" x-data="nqField(false)" x-modelable="invalid" x-id="['nq-field']"
         data-valid     x-model="bad.password" class="flex flex-col gap-1.5">
    <label data-slot="field-label"  for="nq-register-000001-password" class="text-label text-foreground data-disabled:opacity-50">Password</label>
        <div data-slot="password-input" x-data="nqPasswordInput('', JSON.parse('{\u0022visible\u0022:false,\u0022score\u0022:null,\u0022rules\u0022:null,\u0022levels\u0022:[\u0022Very weak\u0022,\u0022Weak\u0022,\u0022Fair\u0022,\u0022Good\u0022,\u0022Strong\u0022]}'))" x-modelable="value"
    class="flex w-full flex-col gap-2">
    <div role="group" data-slot="input-group"
    class="group/input-group flex h-control min-h-[var(--nq-touch-min,0px)] w-full min-w-0 items-center overflow-hidden rounded-control border border-input bg-card text-body text-foreground transition-colors duration-150 ease-nq focus-within:border-nq-focus focus-within:outline-1 focus-within:outline-nq-focus has-[[data-invalid]]:border-nq-danger has-[[aria-invalid=true]]:border-nq-danger has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50"><input data-slot="input-group-input"     x-model="value" x-bind:type="shown ? &#039;text&#039; : &#039;password&#039;" type="password" value="" autocapitalize="none" autocorrect="off" spellcheck="false" id="nq-register-000001-password" name="password" autocomplete="new-password" aria-describedby="nq-register-000001-password-hint nq-register-000001-password-error" x-bind:aria-invalid="bad.password ? &#039;true&#039; : null" class="h-full min-w-0 flex-1 border-0 bg-transparent px-3 text-body text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed pointer-coarse:text-[16px]" />
        <div data-slot="input-group-addon" data-align="end"
    class="flex h-full shrink-0 items-center gap-1.5 text-body-sm text-muted-foreground [&_svg]:size-4 order-last ps-1 pe-1.5"><button data-slot="password-input-toggle"
     type="button"                         x-bind="toggle" aria-label="Show password" aria-pressed="false" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-foreground hover:bg-nq-hover size-control-sm p-0">
        <svg x-show="shown" x-cloak="1" style="display: none" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"/>
  <path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"/>
  <path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"/>
  <path d="m2 2 20 20"/>
</svg>                <svg x-show="!shown" x-cloak="1" style="" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/>
  <circle cx="12" cy="12" r="3"/>
</svg></button></div></div>
            <div data-slot="password-input-strength" data-score="0" class="flex flex-col gap-1 opacity-60" x-bind="strengthBox">
            <div data-slot="meter" role="meter" aria-label="Password strength" aria-valuemin="0" aria-valuemax="4" aria-valuenow="0"
                data-tone="danger" x-bind="meter" class="flex w-full flex-col gap-1.5">
                <div data-slot="meter-track" class="relative block h-1 w-full overflow-hidden rounded-full bg-nq-surface-soft">
                    <div data-slot="meter-indicator" style="inset-inline-start:0;width:0%" x-bind="meterFill"
                        class="block h-full rounded-full transition-[width] duration-300 ease-nq motion-reduce:transition-none bg-nq-danger"></div>
                </div>
            </div>
            <div class="flex items-baseline justify-between gap-3 text-caption text-muted-foreground">
                <span>Password strength</span>
                <span aria-live="polite" class="text-foreground" x-text="levelText()"></span>
            </div>
        </div>
        </div>
        <div data-slot="field-error" role="alert" x-show="invalid"  style="display: none"  id="nq-register-000001-password-error" class="text-caption text-nq-danger-text"><span x-text="fe.password"></span></div>
        <p data-slot="field-description" id="nq-register-000001-password-hint" x-show="! bad.password" class="text-caption text-muted-foreground">At least 8 characters.</p>
</div>
    <div data-slot="field" x-data="nqField(false)" x-modelable="invalid" x-id="['nq-field']"
         data-valid     x-model="bad.confirm" class="flex flex-col gap-1.5">
    <label data-slot="field-label"  for="nq-register-000001-confirm" class="text-label text-foreground data-disabled:opacity-50">Confirm password</label>
        <div data-slot="password-input" x-data="nqPasswordInput('', JSON.parse('{\u0022visible\u0022:false,\u0022score\u0022:null,\u0022rules\u0022:null,\u0022levels\u0022:[\u0022Very weak\u0022,\u0022Weak\u0022,\u0022Fair\u0022,\u0022Good\u0022,\u0022Strong\u0022]}'))" x-modelable="value"
    class="flex w-full flex-col gap-2">
    <div role="group" data-slot="input-group"
    class="group/input-group flex h-control min-h-[var(--nq-touch-min,0px)] w-full min-w-0 items-center overflow-hidden rounded-control border border-input bg-card text-body text-foreground transition-colors duration-150 ease-nq focus-within:border-nq-focus focus-within:outline-1 focus-within:outline-nq-focus has-[[data-invalid]]:border-nq-danger has-[[aria-invalid=true]]:border-nq-danger has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50"><input data-slot="input-group-input"     x-model="value" x-bind:type="shown ? &#039;text&#039; : &#039;password&#039;" type="password" value="" autocapitalize="none" autocorrect="off" spellcheck="false" id="nq-register-000001-confirm" name="confirm" autocomplete="new-password" aria-describedby="nq-register-000001-confirm-error" x-bind:aria-invalid="bad.confirm ? &#039;true&#039; : null" class="h-full min-w-0 flex-1 border-0 bg-transparent px-3 text-body text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed pointer-coarse:text-[16px]" />
        <div data-slot="input-group-addon" data-align="end"
    class="flex h-full shrink-0 items-center gap-1.5 text-body-sm text-muted-foreground [&_svg]:size-4 order-last ps-1 pe-1.5"><button data-slot="password-input-toggle"
     type="button"                         x-bind="toggle" aria-label="Show password" aria-pressed="false" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-foreground hover:bg-nq-hover size-control-sm p-0">
        <svg x-show="shown" x-cloak="1" style="display: none" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"/>
  <path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"/>
  <path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"/>
  <path d="m2 2 20 20"/>
</svg>                <svg x-show="!shown" x-cloak="1" style="" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/>
  <circle cx="12" cy="12" r="3"/>
</svg></button></div></div>
        </div>
        <div data-slot="field-error" role="alert" x-show="invalid"  style="display: none"  id="nq-register-000001-confirm-error" class="text-caption text-nq-danger-text"><span x-text="fe.confirm"></span></div>
</div>
            <div data-slot="field" x-data="nqField(false)" x-modelable="invalid" x-id="['nq-field']"
         data-valid     x-model="bad.terms" class="flex flex-col gap-1.5">
    <label class="flex items-start gap-2 text-body-sm text-foreground">
                <button type="button" role="checkbox" data-slot="checkbox" x-data="nqCheckbox(false, false)" x-modelable="checked" x-bind="root"
    aria-checked="false"
     data-unchecked                 x-model="accepted" x-bind:aria-invalid="bad.terms ? &#039;true&#039; : null" class="relative inline-flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-nq-line-strong bg-card text-primary-foreground outline-none transition-colors duration-150 ease-nq data-checked:border-primary data-checked:bg-primary data-indeterminate:border-primary data-indeterminate:bg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-disabled:cursor-not-allowed data-disabled:opacity-50 after:absolute after:-inset-1 mt-0.5">
    <span data-slot="checkbox-indicator" class="flex items-center justify-center [&_svg]:size-3 [&_svg]:stroke-3" x-show="checked || indeterminate"  style="display: none" >
        <svg aria-hidden="true" x-show="indeterminate" style="display: none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M5 12h14"/>
</svg>        <svg aria-hidden="true" x-show="! indeterminate" style="" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M20 6 9 17l-5-5"/>
</svg>    </span>
    <input type="hidden" name="terms" value="1" x-bind:disabled="! checked"  disabled ></button>
                <span>I agree to the <a href="/terms" class="underline underline-offset-2">Terms</a> and <a href="/privacy" class="underline underline-offset-2">Privacy Policy</a></span>
            </label>
            <div data-slot="field-error" role="alert" x-show="invalid"  style="display: none"  class="text-caption text-nq-danger-text"><span x-text="fe.terms"></span></div>
</div>
        <button data-slot="button"
     type="submit"                         x-bind:disabled="pending" x-bind:data-disabled="pending ? &#039;&#039; : null" x-bind:aria-busy="pending ? &#039;true&#039; : null" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary text-primary-foreground hover:bg-[color-mix(in_oklab,var(--nq-action)_88%,var(--nq-fg))] h-[calc(var(--nq-control)+8px)] px-5 text-body">
        <template x-if="pending"><svg data-slot="spinner" aria-hidden="true" class="size-4 animate-spin motion-reduce:animate-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M21 12a9 9 0 1 1-6.219-8.56"/>
</svg></template>
        Create account</button>
</form>
</div>
```
