{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Auth Form component",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->\n<!--\n  The form of AuthCard: the fields of the mode (sign-in, sign-up, reset, magic link), remember me and the forgot\n  link, the terms, the submit button.\n-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import type { AuthLabels } from \"../blocks/auth-card.types\";\n\n  export type AuthFormProps = {\n    id: string;\n    mode?: \"signin\" | \"signup\" | \"reset\" | \"magic\";\n    labels: AuthLabels;\n    submit: string;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Button from \"../compose/Button.svelte\";\n  import Checkbox from \"../compose/Checkbox.svelte\";\n  import Form from \"../compose/Form.svelte\";\n  import Group from \"../compose/Group.svelte\";\n  import Input from \"../compose/Input.svelte\";\n  import Label from \"../compose/Label.svelte\";\n  import Field from \"../components/field.svelte\";\n  import { cn, tpl } from \"../utils\";\n\n  let { id, mode = \"signin\", labels, submit }: AuthFormProps = $props();\n</script>\n\n<Form method=\"dialog\" class=\"gap-4\" data-slot=\"auth-form\">\n  {#if ((mode as string) === \"signup\")}\n    <Field label={labels.name} htmlFor={tpl(\"{0}-name\", id)}>\n      <Input type=\"text\" name=\"name\" autocomplete=\"name\" id={tpl(\"{0}-name\", id)} data-slot=\"field\" />\n    </Field>\n  {/if}\n  <Field label={labels.email} htmlFor={tpl(\"{0}-email\", id)}>\n    <Input type=\"email\" name=\"email\" autocomplete=\"email\" id={tpl(\"{0}-email\", id)} data-slot=\"field\" />\n  </Field>\n  {#if (((mode as string) !== \"reset\") && ((mode as string) !== \"magic\"))}\n    <Field label={labels.password} htmlFor={tpl(\"{0}-password\", id)}>\n      <Input\n        type=\"password\"\n        name=\"password\"\n        autocomplete={(((mode as string) === \"signup\") ? \"new-password\" : \"current-password\")}\n        id={tpl(\"{0}-password\", id)}\n        data-slot=\"field\"\n      />\n    </Field>\n  {/if}\n  {#if ((mode as string) === \"signin\")}\n    <Group justify=\"between\" align=\"center\" class=\"flex-wrap gap-2\">\n      <Group gap=\"2\" align=\"center\" class={cn(\"w-fit\", \"\")}>\n        <Checkbox name=\"remember\" id={tpl(\"{0}-remember\", id)} />\n        <Label for={tpl(\"{0}-remember\", id)} class=\"text-sm\">\n          {labels.remember}\n        </Label>\n      </Group>\n      <Button variant=\"link\" size=\"sm\" class=\"px-0\">\n        {labels.forgot}\n      </Button>\n    </Group>\n  {/if}\n  {#if ((mode as string) === \"signup\")}\n    <Group gap=\"2\" align=\"center\" class={cn(\"w-fit\", \"\")}>\n      <Checkbox name=\"terms\" id={tpl(\"{0}-terms\", id)} />\n      <Label for={tpl(\"{0}-terms\", id)} class=\"text-sm\">\n        {labels.terms}\n      </Label>\n    </Group>\n  {/if}\n  <Button variant=\"default\" size=\"default\" type=\"submit\" class=\"w-full\">\n    {submit}\n  </Button>\n</Form>\n",
      "path": "components/auth-form.svelte",
      "target": "components/auth-form.svelte"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "svelte",
      "component"
    ]
  },
  "name": "auth-form",
  "registryDependencies": [
    "auth-card",
    "button",
    "checkbox",
    "field",
    "form",
    "group",
    "input",
    "label",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Auth Form",
  "type": "registry:component"
}
