{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The form of AuthCard: the fields of the mode (sign-in, sign-up, reset, magic link), remember me and the forgot link, the terms, the submit button.",
  "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 */\nimport { For, type JSX } from \"solid-js\";\nimport { Button, Checkbox, Form, Group, Input, Label } from \"../compose\";\nimport { Field } from \"../components/field\";\nimport { cn, tpl } from \"../utils\";\nimport type { AuthLabels } from \"../blocks/auth-card.types\";\n\nexport type AuthFormProps = {\n  id: string;\n  mode?: \"signin\" | \"signup\" | \"reset\" | \"magic\";\n  labels: AuthLabels;\n  submit: string;\n};\n\nexport function AuthForm({ id, mode = \"signin\", labels, submit }: AuthFormProps) {\n  return (\n    <Form method=\"dialog\" class=\"gap-4\" data-slot=\"auth-form\">\n      {((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      ) : null}\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      {(((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      ) : null}\n      {((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      ) : null}\n      {((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      ) : null}\n      <Button variant=\"default\" size=\"default\" type=\"submit\" class=\"w-full\">\n        {submit}\n      </Button>\n    </Form>\n  );\n}\n",
      "path": "components/auth-form.tsx",
      "target": "components/auth-form.tsx"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "solid",
      "component"
    ]
  },
  "name": "auth-form",
  "registryDependencies": [
    "auth-card",
    "compose",
    "field",
    "utils"
  ],
  "runtime": "solid",
  "title": "Auth Form",
  "type": "registry:component"
}
