@digilogiclabs/create-saas-app 2.8.0 → 2.9.0

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.
Files changed (94) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/generators/template-generator.js +8 -8
  3. package/dist/generators/template-generator.js.map +1 -1
  4. package/dist/templates/shared/quality/web/src/__tests__/accessibility.test.tsx +3 -3
  5. package/dist/templates/web/ai-platform/template/src/app/page.tsx +207 -207
  6. package/dist/templates/web/base/template/package.json +1 -3
  7. package/dist/templates/web/base/template/src/app/auth/callback/route.ts +32 -18
  8. package/dist/templates/web/base/template/src/app/dashboard/page.tsx +6 -43
  9. package/dist/templates/web/base/template/src/app/globals.css +158 -157
  10. package/dist/templates/web/base/template/src/app/page.tsx +2 -2
  11. package/dist/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +800 -800
  12. package/dist/templates/web/ui-auth/template/src/app/globals.css +96 -95
  13. package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +109 -109
  14. package/dist/templates/web/ui-auth/template/src/app/page.tsx +4 -3
  15. package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -128
  16. package/dist/templates/web/ui-auth-ai/template/src/app/globals.css +35 -40
  17. package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +1 -0
  18. package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +3 -3
  19. package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +10 -49
  20. package/dist/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +800 -800
  21. package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +212 -211
  22. package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -109
  23. package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +350 -350
  24. package/dist/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +506 -506
  25. package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -128
  26. package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +143 -143
  27. package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +184 -184
  28. package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +143 -233
  29. package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +10 -50
  30. package/dist/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +800 -800
  31. package/dist/templates/web/ui-auth-payments-ai/template/src/app/globals.css +97 -96
  32. package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +325 -364
  33. package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +1 -1
  34. package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +389 -532
  35. package/dist/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +644 -644
  36. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +119 -163
  37. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +158 -201
  38. package/dist/templates/web/ui-auth-payments-ai-rag/template/package.json +1 -2
  39. package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +10 -51
  40. package/dist/templates/web/ui-auth-payments-audio/template/src/app/globals.css +97 -96
  41. package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +402 -403
  42. package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +143 -143
  43. package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +184 -184
  44. package/dist/templates/web/ui-auth-payments-video/template/src/app/globals.css +229 -228
  45. package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +1 -1
  46. package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +4 -7
  47. package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +1 -1
  48. package/dist/templates/web/ui-only/template/src/app/globals.css +43 -42
  49. package/package.json +1 -1
  50. package/src/templates/shared/quality/web/src/__tests__/accessibility.test.tsx +3 -3
  51. package/src/templates/web/ai-platform/template/src/app/page.tsx +207 -207
  52. package/src/templates/web/base/template/package.json +1 -3
  53. package/src/templates/web/base/template/src/app/auth/callback/route.ts +32 -18
  54. package/src/templates/web/base/template/src/app/dashboard/page.tsx +6 -43
  55. package/src/templates/web/base/template/src/app/globals.css +158 -157
  56. package/src/templates/web/base/template/src/app/page.tsx +2 -2
  57. package/src/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +800 -800
  58. package/src/templates/web/ui-auth/template/src/app/globals.css +96 -95
  59. package/src/templates/web/ui-auth/template/src/app/login/page.tsx +109 -109
  60. package/src/templates/web/ui-auth/template/src/app/page.tsx +4 -3
  61. package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -128
  62. package/src/templates/web/ui-auth-ai/template/src/app/globals.css +35 -40
  63. package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +1 -0
  64. package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +3 -3
  65. package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +10 -49
  66. package/src/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +800 -800
  67. package/src/templates/web/ui-auth-payments/template/src/app/globals.css +212 -211
  68. package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -109
  69. package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +350 -350
  70. package/src/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +506 -506
  71. package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -128
  72. package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +143 -143
  73. package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +184 -184
  74. package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +143 -233
  75. package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +10 -50
  76. package/src/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +800 -800
  77. package/src/templates/web/ui-auth-payments-ai/template/src/app/globals.css +97 -96
  78. package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +325 -364
  79. package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +1 -1
  80. package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +389 -532
  81. package/src/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +644 -644
  82. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +119 -163
  83. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +158 -201
  84. package/src/templates/web/ui-auth-payments-ai-rag/template/package.json +1 -2
  85. package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +10 -51
  86. package/src/templates/web/ui-auth-payments-audio/template/src/app/globals.css +97 -96
  87. package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +402 -403
  88. package/src/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +143 -143
  89. package/src/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +184 -184
  90. package/src/templates/web/ui-auth-payments-video/template/src/app/globals.css +229 -228
  91. package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +1 -1
  92. package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +4 -7
  93. package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +1 -1
  94. package/src/templates/web/ui-only/template/src/app/globals.css +43 -42
@@ -1,163 +1,119 @@
1
- 'use client'
2
-
3
- import React, { useState, useActionState } from 'react'
4
- import {
5
- Button,
6
- Card,
7
- Input,
8
- Label,
9
- SingleStepForm,
10
- FormField,
11
- FormProvider
12
- } from '@digilogiclabs/saas-factory-ui'
13
- import { useAuth } from '@digilogiclabs/app-sdk'
14
- import { useRouter } from 'next/navigation'
15
- import { signInAction } from '@/lib/actions/auth'
16
-
17
- export function LoginForm() {
18
- const [email, setEmail] = useState('')
19
- const [password, setPassword] = useState('')
20
- const { signIn, signInWithOAuth, loading, error, user } = useAuth()
21
- const [actionState, formAction] = useActionState(signInAction, { success: false })
22
- const router = useRouter()
23
-
24
- // Redirect if already logged in
25
- React.useEffect(() => {
26
- if (user) {
27
- router.push('/')
28
- }
29
- }, [user, router])
30
-
31
- const handleLogin = async (e: React.FormEvent) => {
32
- e.preventDefault()
33
- try {
34
- await signIn(email, password)
35
- router.push('/')
36
- } catch (err) {
37
- console.error('Login error:', err)
38
- }
39
- }
40
-
41
- const handleGoogleLogin = async () => {
42
- try {
43
- await signInWithOAuth('google', window.location.origin)
44
- } catch (err) {
45
- console.error('Google login error:', err)
46
- }
47
- }
48
-
49
- // Enhanced form action that uses both server action validation and client auth
50
- const handleServerAction = async (formData: FormData) => {
51
- const result = await formAction(formData)
52
-
53
- if (result?.success) {
54
- // If server validation passes, proceed with client auth
55
- const emailValue = formData.get('email') as string
56
- const passwordValue = formData.get('password') as string
57
-
58
- try {
59
- await signIn(emailValue, passwordValue)
60
- router.push('/')
61
- } catch (err) {
62
- console.error('Login error:', err)
63
- }
64
- }
65
- }
66
-
67
- if (loading) {
68
- return (
69
- <div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
70
- <div>Loading...</div>
71
- </div>
72
- )
73
- }
74
-
75
- return (
76
- <div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
77
- <Card className="w-full max-w-md p-8">
78
- <h1 className="text-2xl font-bold text-center mb-6">Sign In</h1>
79
-
80
- {/* Enhanced form with enterprise form system */}
81
- <FormProvider>
82
- <SingleStepForm
83
- onSubmit={async (formData) => {
84
- try {
85
- const result = await formAction(formData)
86
- if (result?.success) {
87
- const emailValue = formData.get('email') as string
88
- const passwordValue = formData.get('password') as string
89
- await signIn(emailValue, passwordValue)
90
- router.push('/')
91
- }
92
- } catch (err) {
93
- console.error('Login error:', err)
94
- }
95
- }}
96
- className="space-y-4"
97
- submitButton={{
98
- text: loading ? 'Signing In...' : 'Sign In',
99
- disabled: loading,
100
- className: 'w-full'
101
- }}
102
- realTimeValidation={true}
103
- debounceMs={300}
104
- >
105
- <FormField
106
- name="email"
107
- type="email"
108
- label="Email"
109
- placeholder="Enter your email"
110
- validation={['required', 'email']}
111
- disabled={loading}
112
- className="mb-4"
113
- />
114
-
115
- <FormField
116
- name="password"
117
- type="password"
118
- label="Password"
119
- placeholder="Enter your password"
120
- validation={['required', 'minLength:6']}
121
- disabled={loading}
122
- className="mb-6"
123
- showPasswordStrength={false}
124
- />
125
- </SingleStepForm>
126
- </FormProvider>
127
-
128
- {/* Social Auth */}
129
- <Button
130
- type="button"
131
- variant="outline"
132
- className="w-full mt-4"
133
- onClick={handleGoogleLogin}
134
- disabled={loading}
135
- >
136
- Sign in with Google
137
- </Button>
138
-
139
- {/* Legacy error display */}
140
- {actionState?.error && (
141
- <div className="mt-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
142
- {actionState.error}
143
- </div>
144
- )}
145
-
146
- {error && (
147
- <div className="mt-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
148
- {error.message}
149
- </div>
150
- )}
151
-
152
- <div className="mt-6 text-center">
153
- <p className="text-sm text-gray-600 dark:text-gray-300">
154
- Don&apos;t have an account?{' '}
155
- <a href="/signup" className="text-blue-600 hover:underline dark:text-blue-400">
156
- Sign up
157
- </a>
158
- </p>
159
- </div>
160
- </Card>
161
- </div>
162
- )
163
- }
1
+ 'use client'
2
+
3
+ import React, { useState } from 'react'
4
+ import {
5
+ Button,
6
+ Card,
7
+ Input,
8
+ Label
9
+ } from '@digilogiclabs/saas-factory-ui'
10
+ import { useAuth } from '@digilogiclabs/app-sdk'
11
+ import { useRouter } from 'next/navigation'
12
+
13
+ export function LoginForm() {
14
+ const [email, setEmail] = useState('')
15
+ const [password, setPassword] = useState('')
16
+ const { signIn, signInWithOAuth, loading, error, user } = useAuth()
17
+ const router = useRouter()
18
+
19
+ // Redirect if already logged in
20
+ React.useEffect(() => {
21
+ if (user) {
22
+ router.push('/')
23
+ }
24
+ }, [user, router])
25
+
26
+ const handleLogin = async (e: React.FormEvent) => {
27
+ e.preventDefault()
28
+ try {
29
+ await signIn(email, password)
30
+ router.push('/')
31
+ } catch (err) {
32
+ console.error('Login error:', err)
33
+ }
34
+ }
35
+
36
+ const handleGoogleLogin = async () => {
37
+ try {
38
+ await signInWithOAuth('google')
39
+ } catch (err) {
40
+ console.error('Google login error:', err)
41
+ }
42
+ }
43
+
44
+ if (loading) {
45
+ return (
46
+ <div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
47
+ <div>Loading...</div>
48
+ </div>
49
+ )
50
+ }
51
+
52
+ return (
53
+ <div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
54
+ <Card className="w-full max-w-md p-8">
55
+ <h1 className="text-2xl font-bold text-center mb-6">Sign In</h1>
56
+
57
+ <form onSubmit={handleLogin} className="space-y-4">
58
+ <div>
59
+ <Label htmlFor="email">Email</Label>
60
+ <Input
61
+ id="email"
62
+ name="email"
63
+ type="email"
64
+ value={email}
65
+ onChange={(e) => setEmail(e.target.value)}
66
+ placeholder="Enter your email"
67
+ required
68
+ disabled={loading}
69
+ />
70
+ </div>
71
+
72
+ <div>
73
+ <Label htmlFor="password">Password</Label>
74
+ <Input
75
+ id="password"
76
+ name="password"
77
+ type="password"
78
+ value={password}
79
+ onChange={(e) => setPassword(e.target.value)}
80
+ placeholder="Enter your password"
81
+ required
82
+ disabled={loading}
83
+ />
84
+ </div>
85
+
86
+ <Button type="submit" className="w-full" disabled={loading}>
87
+ {loading ? 'Signing In...' : 'Sign In'}
88
+ </Button>
89
+ </form>
90
+
91
+ {/* Social Auth */}
92
+ <Button
93
+ type="button"
94
+ variant="outline"
95
+ className="w-full mt-4"
96
+ onClick={handleGoogleLogin}
97
+ disabled={loading}
98
+ >
99
+ Sign in with Google
100
+ </Button>
101
+
102
+ {error && (
103
+ <div className="mt-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
104
+ {error.message}
105
+ </div>
106
+ )}
107
+
108
+ <div className="mt-6 text-center">
109
+ <p className="text-sm text-gray-600 dark:text-gray-300">
110
+ Don&apos;t have an account?{' '}
111
+ <a href="/signup" className="text-blue-600 hover:underline dark:text-blue-400">
112
+ Sign up
113
+ </a>
114
+ </p>
115
+ </div>
116
+ </Card>
117
+ </div>
118
+ )
119
+ }
@@ -1,201 +1,158 @@
1
- 'use client'
2
-
3
- import React, { useState, useActionState } from 'react'
4
- import {
5
- Button,
6
- Card,
7
- Input,
8
- Label,
9
- SingleStepForm,
10
- FormField,
11
- FormProvider
12
- } from '@digilogiclabs/saas-factory-ui'
13
- import { useAuth } from '@digilogiclabs/app-sdk'
14
- import { useRouter } from 'next/navigation'
15
- import { signUpAction } from '@/lib/actions/auth'
16
-
17
- export function SignupForm() {
18
- const [name, setName] = useState('')
19
- const [email, setEmail] = useState('')
20
- const [password, setPassword] = useState('')
21
- const [confirmPassword, setConfirmPassword] = useState('')
22
- const { signUp, signInWithOAuth, loading, error, user } = useAuth()
23
- const [actionState, formAction] = useActionState(signUpAction, { success: false })
24
- const router = useRouter()
25
-
26
- // Redirect if already logged in
27
- React.useEffect(() => {
28
- if (user) {
29
- router.push('/')
30
- }
31
- }, [user, router])
32
-
33
- const handleSignUp = async (e: React.FormEvent) => {
34
- e.preventDefault()
35
-
36
- if (password !== confirmPassword) {
37
- console.error('Passwords do not match')
38
- return
39
- }
40
-
41
- try {
42
- await signUp(email, password)
43
- router.push('/')
44
- } catch (err) {
45
- console.error('Sign up error:', err)
46
- }
47
- }
48
-
49
- const handleGoogleSignUp = async () => {
50
- try {
51
- await signInWithOAuth('google', window.location.origin)
52
- } catch (err) {
53
- console.error('Google sign up error:', err)
54
- }
55
- }
56
-
57
- // Enhanced form action that uses both server action validation and client auth
58
- const handleServerAction = async (formData: FormData) => {
59
- const result = await formAction(formData)
60
-
61
- if (result?.success) {
62
- // If server validation passes, proceed with client auth
63
- const emailValue = formData.get('email') as string
64
- const passwordValue = formData.get('password') as string
65
- const nameValue = formData.get('name') as string
66
-
67
- try {
68
- await signUp(emailValue, passwordValue)
69
- router.push('/')
70
- } catch (err) {
71
- console.error('Sign up error:', err)
72
- }
73
- }
74
- }
75
-
76
- if (loading) {
77
- return (
78
- <div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
79
- <div>Loading...</div>
80
- </div>
81
- )
82
- }
83
-
84
- return (
85
- <div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
86
- <Card className="w-full max-w-md p-8">
87
- <h1 className="text-2xl font-bold text-center mb-6">Sign Up</h1>
88
-
89
- {/* Server action errors */}
90
- {actionState?.error && (
91
- <div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
92
- {actionState.error}
93
- </div>
94
- )}
95
-
96
- {/* Client auth errors */}
97
- {error && (
98
- <div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
99
- {error.message}
100
- </div>
101
- )}
102
-
103
- {/* Enhanced form with enterprise form system */}
104
- <FormProvider>
105
- <SingleStepForm
106
- onSubmit={async (formData) => {
107
- try {
108
- const result = await formAction(formData)
109
- if (result?.success) {
110
- const emailValue = formData.get('email') as string
111
- const passwordValue = formData.get('password') as string
112
- await signUp(emailValue, passwordValue)
113
- router.push('/')
114
- }
115
- } catch (err) {
116
- console.error('Sign up error:', err)
117
- }
118
- }}
119
- className="space-y-4"
120
- submitButton={{
121
- text: loading ? 'Signing Up...' : 'Sign Up',
122
- disabled: loading,
123
- className: 'w-full'
124
- }}
125
- realTimeValidation={true}
126
- debounceMs={300}
127
- crossFieldValidation={{
128
- passwordMatch: {
129
- fields: ['password', 'confirmPassword'],
130
- validator: (values) => values.password === values.confirmPassword,
131
- message: 'Passwords must match'
132
- }
133
- }}
134
- >
135
- <FormField
136
- name="name"
137
- type="text"
138
- label="Name"
139
- placeholder="Enter your full name"
140
- validation={['required', 'minLength:2']}
141
- disabled={loading}
142
- className="mb-4"
143
- />
144
-
145
- <FormField
146
- name="email"
147
- type="email"
148
- label="Email"
149
- placeholder="Enter your email"
150
- validation={['required', 'email']}
151
- disabled={loading}
152
- className="mb-4"
153
- />
154
-
155
- <FormField
156
- name="password"
157
- type="password"
158
- label="Password"
159
- placeholder="Enter your password"
160
- validation={['required', 'minLength:8', 'hasUppercase', 'hasLowercase', 'hasNumber']}
161
- disabled={loading}
162
- className="mb-4"
163
- showPasswordStrength={true}
164
- helpText="Password must be at least 8 characters with uppercase, lowercase, and number"
165
- />
166
-
167
- <FormField
168
- name="confirmPassword"
169
- type="password"
170
- label="Confirm Password"
171
- placeholder="Confirm your password"
172
- validation={['required']}
173
- disabled={loading}
174
- className="mb-6"
175
- />
176
- </SingleStepForm>
177
- </FormProvider>
178
-
179
- {/* Social Auth */}
180
- <Button
181
- type="button"
182
- variant="outline"
183
- className="w-full mt-4"
184
- onClick={handleGoogleSignUp}
185
- disabled={loading}
186
- >
187
- Sign up with Google
188
- </Button>
189
-
190
- <div className="mt-4 text-center">
191
- <p className="text-sm text-gray-600 dark:text-gray-300">
192
- Already have an account?{' '}
193
- <a href="/login" className="text-blue-600 hover:underline dark:text-blue-400">
194
- Sign in
195
- </a>
196
- </p>
197
- </div>
198
- </Card>
199
- </div>
200
- )
201
- }
1
+ 'use client'
2
+
3
+ import React, { useState } from 'react'
4
+ import {
5
+ Button,
6
+ Card,
7
+ Input,
8
+ Label
9
+ } from '@digilogiclabs/saas-factory-ui'
10
+ import { useAuth } from '@digilogiclabs/app-sdk'
11
+ import { useRouter } from 'next/navigation'
12
+
13
+ export function SignupForm() {
14
+ const [name, setName] = useState('')
15
+ const [email, setEmail] = useState('')
16
+ const [password, setPassword] = useState('')
17
+ const [confirmPassword, setConfirmPassword] = useState('')
18
+ const { signUp, signInWithOAuth, loading, error, user } = useAuth()
19
+ const router = useRouter()
20
+
21
+ // Redirect if already logged in
22
+ React.useEffect(() => {
23
+ if (user) {
24
+ router.push('/')
25
+ }
26
+ }, [user, router])
27
+
28
+ const handleSignUp = async (e: React.FormEvent) => {
29
+ e.preventDefault()
30
+
31
+ if (password !== confirmPassword) {
32
+ console.error('Passwords do not match')
33
+ return
34
+ }
35
+
36
+ try {
37
+ await signUp(email, password)
38
+ router.push('/')
39
+ } catch (err) {
40
+ console.error('Sign up error:', err)
41
+ }
42
+ }
43
+
44
+ const handleGoogleSignUp = async () => {
45
+ try {
46
+ await signInWithOAuth('google')
47
+ } catch (err) {
48
+ console.error('Google sign up error:', err)
49
+ }
50
+ }
51
+
52
+ if (loading) {
53
+ return (
54
+ <div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
55
+ <div>Loading...</div>
56
+ </div>
57
+ )
58
+ }
59
+
60
+ return (
61
+ <div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
62
+ <Card className="w-full max-w-md p-8">
63
+ <h1 className="text-2xl font-bold text-center mb-6">Sign Up</h1>
64
+
65
+ {error && (
66
+ <div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
67
+ {error.message}
68
+ </div>
69
+ )}
70
+
71
+ <form onSubmit={handleSignUp} className="space-y-4">
72
+ <div>
73
+ <Label htmlFor="name">Name</Label>
74
+ <Input
75
+ id="name"
76
+ name="name"
77
+ type="text"
78
+ value={name}
79
+ onChange={(e) => setName(e.target.value)}
80
+ placeholder="Enter your full name"
81
+ required
82
+ disabled={loading}
83
+ />
84
+ </div>
85
+
86
+ <div>
87
+ <Label htmlFor="email">Email</Label>
88
+ <Input
89
+ id="email"
90
+ name="email"
91
+ type="email"
92
+ value={email}
93
+ onChange={(e) => setEmail(e.target.value)}
94
+ placeholder="Enter your email"
95
+ required
96
+ disabled={loading}
97
+ />
98
+ </div>
99
+
100
+ <div>
101
+ <Label htmlFor="password">Password</Label>
102
+ <Input
103
+ id="password"
104
+ name="password"
105
+ type="password"
106
+ value={password}
107
+ onChange={(e) => setPassword(e.target.value)}
108
+ placeholder="Enter your password"
109
+ required
110
+ disabled={loading}
111
+ />
112
+ <p className="text-xs text-gray-500 mt-1">
113
+ Password must be at least 8 characters with uppercase, lowercase, and number
114
+ </p>
115
+ </div>
116
+
117
+ <div>
118
+ <Label htmlFor="confirmPassword">Confirm Password</Label>
119
+ <Input
120
+ id="confirmPassword"
121
+ name="confirmPassword"
122
+ type="password"
123
+ value={confirmPassword}
124
+ onChange={(e) => setConfirmPassword(e.target.value)}
125
+ placeholder="Confirm your password"
126
+ required
127
+ disabled={loading}
128
+ />
129
+ </div>
130
+
131
+ <Button type="submit" className="w-full" disabled={loading}>
132
+ {loading ? 'Signing Up...' : 'Sign Up'}
133
+ </Button>
134
+ </form>
135
+
136
+ {/* Social Auth */}
137
+ <Button
138
+ type="button"
139
+ variant="outline"
140
+ className="w-full mt-4"
141
+ onClick={handleGoogleSignUp}
142
+ disabled={loading}
143
+ >
144
+ Sign up with Google
145
+ </Button>
146
+
147
+ <div className="mt-4 text-center">
148
+ <p className="text-sm text-gray-600 dark:text-gray-300">
149
+ Already have an account?{' '}
150
+ <a href="/login" className="text-blue-600 hover:underline dark:text-blue-400">
151
+ Sign in
152
+ </a>
153
+ </p>
154
+ </div>
155
+ </Card>
156
+ </div>
157
+ )
158
+ }
@@ -50,8 +50,7 @@
50
50
  "@radix-ui/react-toast": "^1.1.5",
51
51
  "@radix-ui/react-tooltip": "^1.0.7",
52
52
  "@radix-ui/react-progress": "^1.0.3",
53
- "@radix-ui/react-separator": "^1.0.3",
54
- "@radix-ui/react-badge": "^1.0.4"
53
+ "@radix-ui/react-separator": "^1.0.3"
55
54
  },
56
55
  "devDependencies": {
57
56
  "typescript": "^5.0.0",