create-better-t-stack 3.7.1 → 3.7.3-canary.53fc0031
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +108 -250
- package/dist/index.js +1 -1
- package/dist/{src-BmyCNYPk.js → src-B1ogWZqk.js} +205 -368
- package/package.json +3 -3
- package/templates/api/orpc/server/package.json.hbs +0 -3
- package/templates/api/trpc/server/package.json.hbs +1 -4
- package/templates/auth/better-auth/convex/native/base/lib/auth-client.ts.hbs +0 -2
- package/templates/auth/better-auth/server/base/package.json.hbs +1 -4
- package/templates/auth/better-auth/web/react/base/src/lib/auth-client.ts.hbs +6 -2
- package/templates/auth/better-auth/web/react/tanstack-router/src/components/sign-in-form.tsx +117 -121
- package/templates/auth/better-auth/web/react/tanstack-router/src/components/sign-up-form.tsx +141 -145
- package/templates/auth/better-auth/web/react/tanstack-start/src/components/sign-in-form.tsx +117 -121
- package/templates/auth/better-auth/web/react/tanstack-start/src/components/sign-up-form.tsx +141 -145
- package/templates/auth/better-auth/web/solid/src/components/sign-in-form.tsx +3 -11
- package/templates/auth/better-auth/web/solid/src/components/sign-up-form.tsx +4 -14
- package/templates/backend/convex/packages/backend/convex/healthCheck.ts +2 -2
- package/templates/backend/convex/packages/backend/package.json.hbs +1 -2
- package/templates/backend/server/base/package.json.hbs +1 -3
- package/templates/db/base/package.json.hbs +1 -4
- package/templates/examples/ai/native/bare/polyfills.js +3 -7
- package/templates/examples/ai/native/unistyles/polyfills.js +3 -6
- package/templates/examples/ai/native/uniwind/polyfills.js +3 -7
- package/templates/examples/todo/server/drizzle/postgres/src/schema/todo.ts +1 -1
- package/templates/frontend/native/bare/package.json.hbs +1 -2
- package/templates/frontend/native/unistyles/package.json.hbs +1 -2
- package/templates/frontend/native/uniwind/package.json.hbs +1 -2
- package/templates/frontend/nuxt/package.json.hbs +1 -3
- package/templates/frontend/react/next/package.json.hbs +1 -3
- package/templates/frontend/react/react-router/package.json.hbs +1 -3
- package/templates/frontend/react/react-router/src/components/mode-toggle.tsx +3 -9
- package/templates/frontend/react/tanstack-router/package.json.hbs +1 -3
- package/templates/frontend/react/tanstack-router/src/components/mode-toggle.tsx +3 -9
- package/templates/frontend/react/tanstack-start/package.json.hbs +1 -3
- package/templates/frontend/react/web-base/src/components/ui/button.tsx +13 -16
- package/templates/frontend/react/web-base/src/components/ui/card.tsx +13 -30
- package/templates/frontend/react/web-base/src/components/ui/checkbox.tsx +8 -11
- package/templates/frontend/react/web-base/src/components/ui/dropdown-menu.tsx +37 -66
- package/templates/frontend/react/web-base/src/components/ui/input.tsx +5 -5
- package/templates/frontend/react/web-base/src/components/ui/label.tsx +7 -10
- package/templates/frontend/react/web-base/src/components/ui/skeleton.tsx +3 -3
- package/templates/frontend/react/web-base/src/lib/utils.ts +3 -3
- package/templates/frontend/solid/package.json.hbs +1 -3
- package/templates/frontend/svelte/package.json.hbs +1 -3
- package/templates/frontend/svelte/src/app.d.ts +7 -7
- package/templates/frontend/svelte/src/lib/index.ts +1 -0
- package/templates/frontend/svelte/vite.config.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.3-canary.53fc0031",
|
|
4
4
|
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"build": "tsdown --publint",
|
|
52
52
|
"dev": "tsdown --watch",
|
|
53
53
|
"check-types": "tsc --noEmit",
|
|
54
|
-
"check": "biome check --write .",
|
|
55
54
|
"test": "bun run build && vitest run; rm -rf .smoke || true",
|
|
56
55
|
"test:ui": "bun run build && vitest --ui",
|
|
57
56
|
"prepublishOnly": "npm run build"
|
|
@@ -66,6 +65,7 @@
|
|
|
66
65
|
}
|
|
67
66
|
},
|
|
68
67
|
"dependencies": {
|
|
68
|
+
"@create-better-t-stack/types": "1.0.0",
|
|
69
69
|
"@biomejs/js-api": "^3.0.0",
|
|
70
70
|
"@biomejs/wasm-nodejs": "^2.2.6",
|
|
71
71
|
"@clack/prompts": "^1.0.0-alpha.6",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"trpc-cli": "^0.12.0",
|
|
82
82
|
"ts-morph": "^27.0.2",
|
|
83
83
|
"yaml": "^2.8.1",
|
|
84
|
-
"zod": "^4.1.
|
|
84
|
+
"zod": "^4.1.13"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createAuthClient } from "better-auth/react";
|
|
2
|
-
import { anonymousClient } from "better-auth/client/plugins";
|
|
3
2
|
import { convexClient } from "@convex-dev/better-auth/client/plugins";
|
|
4
3
|
import { expoClient } from "@better-auth/expo/client";
|
|
5
4
|
import Constants from "expo-constants";
|
|
@@ -8,7 +7,6 @@ import * as SecureStore from "expo-secure-store";
|
|
|
8
7
|
export const authClient = createAuthClient({
|
|
9
8
|
baseURL: process.env.EXPO_PUBLIC_CONVEX_SITE_URL,
|
|
10
9
|
plugins: [
|
|
11
|
-
anonymousClient(),
|
|
12
10
|
expoClient({
|
|
13
11
|
scheme: Constants.expoConfig?.scheme as string,
|
|
14
12
|
storagePrefix: Constants.expoConfig?.scheme as string,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { auth } from "@{{projectName}}/auth";
|
|
2
2
|
import { createAuthClient } from "better-auth/react";
|
|
3
|
-
|
|
3
|
+
{{#if (eq payments "polar")}}
|
|
4
|
+
import { polarClient } from "@polar-sh/better-auth";
|
|
5
|
+
{{/if}}
|
|
4
6
|
|
|
5
7
|
export const authClient = createAuthClient({
|
|
6
8
|
{{#unless (eq backend "self")}}
|
|
@@ -11,5 +13,7 @@ export const authClient = createAuthClient({
|
|
|
11
13
|
import.meta.env.VITE_SERVER_URL,
|
|
12
14
|
{{/if}}
|
|
13
15
|
{{/unless}}
|
|
14
|
-
|
|
16
|
+
{{#if (eq payments "polar")}}
|
|
17
|
+
plugins: [polarClient()]
|
|
18
|
+
{{/if}}
|
|
15
19
|
});
|
package/templates/auth/better-auth/web/react/tanstack-router/src/components/sign-in-form.tsx
CHANGED
|
@@ -8,132 +8,128 @@ import { Button } from "./ui/button";
|
|
|
8
8
|
import { Input } from "./ui/input";
|
|
9
9
|
import { Label } from "./ui/label";
|
|
10
10
|
|
|
11
|
-
export default function SignInForm({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
const navigate = useNavigate({
|
|
17
|
-
from: "/",
|
|
18
|
-
});
|
|
19
|
-
const { isPending } = authClient.useSession();
|
|
11
|
+
export default function SignInForm({ onSwitchToSignUp }: { onSwitchToSignUp: () => void }) {
|
|
12
|
+
const navigate = useNavigate({
|
|
13
|
+
from: "/",
|
|
14
|
+
});
|
|
15
|
+
const { isPending } = authClient.useSession();
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
17
|
+
const form = useForm({
|
|
18
|
+
defaultValues: {
|
|
19
|
+
email: "",
|
|
20
|
+
password: "",
|
|
21
|
+
},
|
|
22
|
+
onSubmit: async ({ value }) => {
|
|
23
|
+
await authClient.signIn.email(
|
|
24
|
+
{
|
|
25
|
+
email: value.email,
|
|
26
|
+
password: value.password,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
onSuccess: () => {
|
|
30
|
+
navigate({
|
|
31
|
+
to: "/dashboard",
|
|
32
|
+
});
|
|
33
|
+
toast.success("Sign in successful");
|
|
34
|
+
},
|
|
35
|
+
onError: (error) => {
|
|
36
|
+
toast.error(error.error.message || error.error.statusText);
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
},
|
|
41
|
+
validators: {
|
|
42
|
+
onSubmit: z.object({
|
|
43
|
+
email: z.email("Invalid email address"),
|
|
44
|
+
password: z.string().min(8, "Password must be at least 8 characters"),
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
});
|
|
52
48
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
if (isPending) {
|
|
50
|
+
return <Loader />;
|
|
51
|
+
}
|
|
56
52
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
return (
|
|
54
|
+
<div className="mx-auto w-full mt-10 max-w-md p-6">
|
|
55
|
+
<h1 className="mb-6 text-center text-3xl font-bold">Welcome Back</h1>
|
|
60
56
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
57
|
+
<form
|
|
58
|
+
onSubmit={(e) => {
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
form.handleSubmit();
|
|
62
|
+
}}
|
|
63
|
+
className="space-y-4"
|
|
64
|
+
>
|
|
65
|
+
<div>
|
|
66
|
+
<form.Field name="email">
|
|
67
|
+
{(field) => (
|
|
68
|
+
<div className="space-y-2">
|
|
69
|
+
<Label htmlFor={field.name}>Email</Label>
|
|
70
|
+
<Input
|
|
71
|
+
id={field.name}
|
|
72
|
+
name={field.name}
|
|
73
|
+
type="email"
|
|
74
|
+
value={field.state.value}
|
|
75
|
+
onBlur={field.handleBlur}
|
|
76
|
+
onChange={(e) => field.handleChange(e.target.value)}
|
|
77
|
+
/>
|
|
78
|
+
{field.state.meta.errors.map((error) => (
|
|
79
|
+
<p key={error?.message} className="text-red-500">
|
|
80
|
+
{error?.message}
|
|
81
|
+
</p>
|
|
82
|
+
))}
|
|
83
|
+
</div>
|
|
84
|
+
)}
|
|
85
|
+
</form.Field>
|
|
86
|
+
</div>
|
|
91
87
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
88
|
+
<div>
|
|
89
|
+
<form.Field name="password">
|
|
90
|
+
{(field) => (
|
|
91
|
+
<div className="space-y-2">
|
|
92
|
+
<Label htmlFor={field.name}>Password</Label>
|
|
93
|
+
<Input
|
|
94
|
+
id={field.name}
|
|
95
|
+
name={field.name}
|
|
96
|
+
type="password"
|
|
97
|
+
value={field.state.value}
|
|
98
|
+
onBlur={field.handleBlur}
|
|
99
|
+
onChange={(e) => field.handleChange(e.target.value)}
|
|
100
|
+
/>
|
|
101
|
+
{field.state.meta.errors.map((error) => (
|
|
102
|
+
<p key={error?.message} className="text-red-500">
|
|
103
|
+
{error?.message}
|
|
104
|
+
</p>
|
|
105
|
+
))}
|
|
106
|
+
</div>
|
|
107
|
+
)}
|
|
108
|
+
</form.Field>
|
|
109
|
+
</div>
|
|
114
110
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
111
|
+
<form.Subscribe>
|
|
112
|
+
{(state) => (
|
|
113
|
+
<Button
|
|
114
|
+
type="submit"
|
|
115
|
+
className="w-full"
|
|
116
|
+
disabled={!state.canSubmit || state.isSubmitting}
|
|
117
|
+
>
|
|
118
|
+
{state.isSubmitting ? "Submitting..." : "Sign In"}
|
|
119
|
+
</Button>
|
|
120
|
+
)}
|
|
121
|
+
</form.Subscribe>
|
|
122
|
+
</form>
|
|
127
123
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
124
|
+
<div className="mt-4 text-center">
|
|
125
|
+
<Button
|
|
126
|
+
variant="link"
|
|
127
|
+
onClick={onSwitchToSignUp}
|
|
128
|
+
className="text-indigo-600 hover:text-indigo-800"
|
|
129
|
+
>
|
|
130
|
+
Need an account? Sign Up
|
|
131
|
+
</Button>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
);
|
|
139
135
|
}
|
package/templates/auth/better-auth/web/react/tanstack-router/src/components/sign-up-form.tsx
CHANGED
|
@@ -8,157 +8,153 @@ import { Button } from "./ui/button";
|
|
|
8
8
|
import { Input } from "./ui/input";
|
|
9
9
|
import { Label } from "./ui/label";
|
|
10
10
|
|
|
11
|
-
export default function SignUpForm({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
const navigate = useNavigate({
|
|
17
|
-
from: "/",
|
|
18
|
-
});
|
|
19
|
-
const { isPending } = authClient.useSession();
|
|
11
|
+
export default function SignUpForm({ onSwitchToSignIn }: { onSwitchToSignIn: () => void }) {
|
|
12
|
+
const navigate = useNavigate({
|
|
13
|
+
from: "/",
|
|
14
|
+
});
|
|
15
|
+
const { isPending } = authClient.useSession();
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
17
|
+
const form = useForm({
|
|
18
|
+
defaultValues: {
|
|
19
|
+
email: "",
|
|
20
|
+
password: "",
|
|
21
|
+
name: "",
|
|
22
|
+
},
|
|
23
|
+
onSubmit: async ({ value }) => {
|
|
24
|
+
await authClient.signUp.email(
|
|
25
|
+
{
|
|
26
|
+
email: value.email,
|
|
27
|
+
password: value.password,
|
|
28
|
+
name: value.name,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
onSuccess: () => {
|
|
32
|
+
navigate({
|
|
33
|
+
to: "/dashboard",
|
|
34
|
+
});
|
|
35
|
+
toast.success("Sign up successful");
|
|
36
|
+
},
|
|
37
|
+
onError: (error) => {
|
|
38
|
+
toast.error(error.error.message || error.error.statusText);
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
validators: {
|
|
44
|
+
onSubmit: z.object({
|
|
45
|
+
name: z.string().min(2, "Name must be at least 2 characters"),
|
|
46
|
+
email: z.email("Invalid email address"),
|
|
47
|
+
password: z.string().min(8, "Password must be at least 8 characters"),
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
});
|
|
55
51
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
if (isPending) {
|
|
53
|
+
return <Loader />;
|
|
54
|
+
}
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
return (
|
|
57
|
+
<div className="mx-auto w-full mt-10 max-w-md p-6">
|
|
58
|
+
<h1 className="mb-6 text-center text-3xl font-bold">Create Account</h1>
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
60
|
+
<form
|
|
61
|
+
onSubmit={(e) => {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
form.handleSubmit();
|
|
65
|
+
}}
|
|
66
|
+
className="space-y-4"
|
|
67
|
+
>
|
|
68
|
+
<div>
|
|
69
|
+
<form.Field name="name">
|
|
70
|
+
{(field) => (
|
|
71
|
+
<div className="space-y-2">
|
|
72
|
+
<Label htmlFor={field.name}>Name</Label>
|
|
73
|
+
<Input
|
|
74
|
+
id={field.name}
|
|
75
|
+
name={field.name}
|
|
76
|
+
value={field.state.value}
|
|
77
|
+
onBlur={field.handleBlur}
|
|
78
|
+
onChange={(e) => field.handleChange(e.target.value)}
|
|
79
|
+
/>
|
|
80
|
+
{field.state.meta.errors.map((error) => (
|
|
81
|
+
<p key={error?.message} className="text-red-500">
|
|
82
|
+
{error?.message}
|
|
83
|
+
</p>
|
|
84
|
+
))}
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
</form.Field>
|
|
88
|
+
</div>
|
|
93
89
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
90
|
+
<div>
|
|
91
|
+
<form.Field name="email">
|
|
92
|
+
{(field) => (
|
|
93
|
+
<div className="space-y-2">
|
|
94
|
+
<Label htmlFor={field.name}>Email</Label>
|
|
95
|
+
<Input
|
|
96
|
+
id={field.name}
|
|
97
|
+
name={field.name}
|
|
98
|
+
type="email"
|
|
99
|
+
value={field.state.value}
|
|
100
|
+
onBlur={field.handleBlur}
|
|
101
|
+
onChange={(e) => field.handleChange(e.target.value)}
|
|
102
|
+
/>
|
|
103
|
+
{field.state.meta.errors.map((error) => (
|
|
104
|
+
<p key={error?.message} className="text-red-500">
|
|
105
|
+
{error?.message}
|
|
106
|
+
</p>
|
|
107
|
+
))}
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
110
|
+
</form.Field>
|
|
111
|
+
</div>
|
|
116
112
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
113
|
+
<div>
|
|
114
|
+
<form.Field name="password">
|
|
115
|
+
{(field) => (
|
|
116
|
+
<div className="space-y-2">
|
|
117
|
+
<Label htmlFor={field.name}>Password</Label>
|
|
118
|
+
<Input
|
|
119
|
+
id={field.name}
|
|
120
|
+
name={field.name}
|
|
121
|
+
type="password"
|
|
122
|
+
value={field.state.value}
|
|
123
|
+
onBlur={field.handleBlur}
|
|
124
|
+
onChange={(e) => field.handleChange(e.target.value)}
|
|
125
|
+
/>
|
|
126
|
+
{field.state.meta.errors.map((error) => (
|
|
127
|
+
<p key={error?.message} className="text-red-500">
|
|
128
|
+
{error?.message}
|
|
129
|
+
</p>
|
|
130
|
+
))}
|
|
131
|
+
</div>
|
|
132
|
+
)}
|
|
133
|
+
</form.Field>
|
|
134
|
+
</div>
|
|
139
135
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
136
|
+
<form.Subscribe>
|
|
137
|
+
{(state) => (
|
|
138
|
+
<Button
|
|
139
|
+
type="submit"
|
|
140
|
+
className="w-full"
|
|
141
|
+
disabled={!state.canSubmit || state.isSubmitting}
|
|
142
|
+
>
|
|
143
|
+
{state.isSubmitting ? "Submitting..." : "Sign Up"}
|
|
144
|
+
</Button>
|
|
145
|
+
)}
|
|
146
|
+
</form.Subscribe>
|
|
147
|
+
</form>
|
|
152
148
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
149
|
+
<div className="mt-4 text-center">
|
|
150
|
+
<Button
|
|
151
|
+
variant="link"
|
|
152
|
+
onClick={onSwitchToSignIn}
|
|
153
|
+
className="text-indigo-600 hover:text-indigo-800"
|
|
154
|
+
>
|
|
155
|
+
Already have an account? Sign In
|
|
156
|
+
</Button>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
);
|
|
164
160
|
}
|