@main12/auth-login 0.4.2 → 1.0.1
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/README.md +54 -7
- package/dist/components/AuthCard.d.ts +41 -0
- package/dist/components/AuthCard.js +28 -0
- package/dist/components/AuthCardServer.d.ts +29 -0
- package/dist/components/AuthCardServer.js +57 -0
- package/dist/components/AuthLayout.d.ts +23 -13
- package/dist/components/AuthLayout.js +26 -87
- package/dist/components/AuthPages.d.ts +4 -29
- package/dist/components/AuthPages.js +23 -105
- package/dist/components/AuthPagesServer.d.ts +3 -4
- package/dist/components/AuthPagesServer.js +15 -8
- package/dist/components/auth-card/AuthCardShell.d.ts +21 -0
- package/dist/components/auth-card/AuthCardShell.js +104 -0
- package/dist/components/auth-card/FormRenderer.d.ts +32 -0
- package/dist/components/auth-card/FormRenderer.js +88 -0
- package/dist/components/auth-card/formConfigs.d.ts +25 -0
- package/dist/components/auth-card/formConfigs.js +56 -0
- package/dist/components/auth-card/index.d.ts +3 -0
- package/dist/components/auth-card/index.js +3 -0
- package/dist/components/forms/ForgotPasswordForm.d.ts +7 -0
- package/dist/components/forms/ForgotPasswordForm.js +56 -0
- package/dist/components/forms/LoginForm.d.ts +15 -0
- package/dist/components/forms/LoginForm.js +247 -0
- package/dist/components/forms/SetPasswordForm.d.ts +7 -0
- package/dist/components/forms/SetPasswordForm.js +75 -0
- package/dist/components/forms/SignupForm.d.ts +13 -0
- package/dist/components/forms/SignupForm.js +152 -0
- package/dist/components/forms/VerifyOtpForm.d.ts +9 -0
- package/dist/components/forms/VerifyOtpForm.js +107 -0
- package/dist/components/forms/index.d.ts +19 -0
- package/dist/components/forms/index.js +21 -0
- package/dist/components/pages/ForgotPasswordPage.d.ts +2 -1
- package/dist/components/pages/ForgotPasswordPageHero.d.ts +3 -2
- package/dist/components/pages/ForgotPasswordPageHero.js +70 -64
- package/dist/components/pages/ForgotPasswordPageTailwind.d.ts +3 -2
- package/dist/components/pages/ForgotPasswordPageTailwind.js +42 -36
- package/dist/components/pages/LoginPage.d.ts +2 -1
- package/dist/components/pages/LoginPageHero.d.ts +2 -1
- package/dist/components/pages/LoginPageHero.js +297 -291
- package/dist/components/pages/LoginPageTailwind.d.ts +2 -1
- package/dist/components/pages/LoginPageTailwind.js +197 -191
- package/dist/components/pages/SetPasswordPage.d.ts +2 -1
- package/dist/components/pages/SetPasswordPageHero.d.ts +3 -2
- package/dist/components/pages/SetPasswordPageHero.js +98 -92
- package/dist/components/pages/SetPasswordPageTailwind.d.ts +3 -2
- package/dist/components/pages/SetPasswordPageTailwind.js +63 -57
- package/dist/components/pages/SignupPage.d.ts +2 -1
- package/dist/components/pages/SignupPageHero.d.ts +3 -2
- package/dist/components/pages/SignupPageHero.js +139 -133
- package/dist/components/pages/SignupPageTailwind.d.ts +3 -2
- package/dist/components/pages/SignupPageTailwind.js +123 -117
- package/dist/components/pages/VerifyOtpPage.d.ts +2 -1
- package/dist/components/pages/VerifyOtpPageHero.d.ts +2 -1
- package/dist/components/pages/VerifyOtpPageHero.js +110 -104
- package/dist/components/pages/VerifyOtpPageTailwind.d.ts +2 -1
- package/dist/components/pages/VerifyOtpPageTailwind.js +60 -54
- package/dist/components/ui/translations.d.ts +9 -0
- package/dist/components/ui/translations.js +18 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.js +11 -0
- package/dist/exports/client.d.ts +5 -0
- package/dist/exports/client.js +5 -0
- package/dist/exports/rsc.d.ts +7 -0
- package/dist/exports/rsc.js +8 -0
- package/dist/index.js +12 -2
- package/package.json +3 -2
|
@@ -7,8 +7,9 @@ import { motion, AnimatePresence } from 'framer-motion';
|
|
|
7
7
|
import { Icon } from '@iconify/react';
|
|
8
8
|
import { useLoginFlow } from '../../auth/application/hooks/useLoginFlow.js';
|
|
9
9
|
import { AuthLayout } from '../AuthLayout.js';
|
|
10
|
+
import { AuthCard } from '../AuthCard.js';
|
|
10
11
|
import { getUiTranslations } from '../ui/translations.js';
|
|
11
|
-
function LoginHeroContent({ onPasswordLogin, redirectTo = '/', showGoogleOAuth = true, signupUrl = '/signup', logo, poweredBy, cardClassName, backgroundClass, locale, messages }) {
|
|
12
|
+
function LoginHeroContent({ onPasswordLogin, redirectTo = '/', showGoogleOAuth = true, signupUrl = '/signup', logo, poweredBy, cardClassName, removeBorder, removeShadow, mobileVariant, backgroundClass, locale, messages }) {
|
|
12
13
|
const searchParams = useSearchParams();
|
|
13
14
|
const resolvedRedirect = searchParams.get('redirect') || redirectTo;
|
|
14
15
|
const t = getUiTranslations(locale, messages).login;
|
|
@@ -19,300 +20,305 @@ function LoginHeroContent({ onPasswordLogin, redirectTo = '/', showGoogleOAuth =
|
|
|
19
20
|
const stepTitle = step === 'otp-prompt' ? t.otpPromptTitle : step === 'email' ? t.title : t.passwordStepTitle;
|
|
20
21
|
const stepSubtitle = step === 'otp-prompt' ? t.otpPromptSubtitle : step === 'email' ? t.subtitle : t.passwordStepSubtitle;
|
|
21
22
|
return /*#__PURE__*/ _jsx(AuthLayout, {
|
|
22
|
-
logo: logo,
|
|
23
|
-
title: stepTitle,
|
|
24
|
-
subtitle: stepSubtitle,
|
|
25
|
-
poweredBy: poweredBy,
|
|
26
|
-
cardClassName: cardClassName,
|
|
27
23
|
backgroundClass: backgroundClass,
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
24
|
+
children: /*#__PURE__*/ _jsx(AuthCard, {
|
|
25
|
+
logo: logo,
|
|
26
|
+
title: stepTitle,
|
|
27
|
+
subtitle: stepSubtitle,
|
|
28
|
+
poweredBy: poweredBy,
|
|
29
|
+
cardClassName: cardClassName,
|
|
30
|
+
removeBorder: removeBorder,
|
|
31
|
+
removeShadow: removeShadow,
|
|
32
|
+
mobileVariant: mobileVariant,
|
|
33
|
+
footer: signupUrl ? /*#__PURE__*/ _jsxs("p", {
|
|
34
|
+
className: "text-center text-gray-600 text-sm",
|
|
35
|
+
children: [
|
|
36
|
+
t.noAccount,
|
|
37
|
+
' ',
|
|
38
|
+
/*#__PURE__*/ _jsx("a", {
|
|
39
|
+
href: signupUrl,
|
|
40
|
+
className: "text-gray-900 font-medium hover:underline",
|
|
41
|
+
children: t.signUpLink
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
}) : undefined,
|
|
45
|
+
children: /*#__PURE__*/ _jsxs(AnimatePresence, {
|
|
46
|
+
mode: "wait",
|
|
47
|
+
children: [
|
|
48
|
+
step === 'email' && /*#__PURE__*/ _jsxs(motion.div, {
|
|
49
|
+
initial: {
|
|
50
|
+
opacity: 0,
|
|
51
|
+
x: -20
|
|
52
|
+
},
|
|
53
|
+
animate: {
|
|
54
|
+
opacity: 1,
|
|
55
|
+
x: 0
|
|
56
|
+
},
|
|
57
|
+
exit: {
|
|
58
|
+
opacity: 0,
|
|
59
|
+
x: 20
|
|
60
|
+
},
|
|
61
|
+
transition: {
|
|
62
|
+
duration: 0.3
|
|
63
|
+
},
|
|
64
|
+
children: [
|
|
65
|
+
showGoogleOAuth && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
66
|
+
children: [
|
|
67
|
+
/*#__PURE__*/ _jsxs(Button, {
|
|
68
|
+
fullWidth: true,
|
|
69
|
+
variant: "secondary",
|
|
70
|
+
onPress: handleGoogleLogin,
|
|
71
|
+
className: "[--button-fg:var(--foreground)]",
|
|
72
|
+
children: [
|
|
73
|
+
/*#__PURE__*/ _jsx(Icon, {
|
|
74
|
+
icon: "flat-color-icons:google",
|
|
75
|
+
width: 20
|
|
76
|
+
}),
|
|
77
|
+
t.continueWithGoogle
|
|
78
|
+
]
|
|
79
|
+
}),
|
|
80
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
81
|
+
className: "flex items-center gap-4 my-4",
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ _jsx(Separator, {
|
|
84
|
+
className: "flex-1"
|
|
85
|
+
}),
|
|
86
|
+
/*#__PURE__*/ _jsx("span", {
|
|
87
|
+
className: "text-gray-500 text-sm",
|
|
88
|
+
children: t.or
|
|
89
|
+
}),
|
|
90
|
+
/*#__PURE__*/ _jsx(Separator, {
|
|
91
|
+
className: "flex-1"
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ _jsxs("form", {
|
|
98
|
+
onSubmit: handleEmailSubmit,
|
|
99
|
+
className: "space-y-4",
|
|
100
|
+
children: [
|
|
101
|
+
error && /*#__PURE__*/ _jsx(motion.div, {
|
|
102
|
+
className: "bg-red-50 text-red-600 border border-red-200 rounded-lg p-3 text-sm",
|
|
103
|
+
initial: {
|
|
104
|
+
opacity: 0
|
|
105
|
+
},
|
|
106
|
+
animate: {
|
|
107
|
+
opacity: 1
|
|
108
|
+
},
|
|
109
|
+
children: error
|
|
110
|
+
}),
|
|
111
|
+
/*#__PURE__*/ _jsxs(TextField, {
|
|
112
|
+
type: "email",
|
|
113
|
+
value: email,
|
|
114
|
+
onChange: setEmail,
|
|
115
|
+
isRequired: true,
|
|
116
|
+
fullWidth: true,
|
|
117
|
+
children: [
|
|
118
|
+
/*#__PURE__*/ _jsx(Label, {
|
|
119
|
+
className: "text-gray-600",
|
|
120
|
+
children: t.emailLabel
|
|
121
|
+
}),
|
|
122
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
123
|
+
variant: "secondary"
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
}),
|
|
127
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
128
|
+
type: "submit",
|
|
129
|
+
fullWidth: true,
|
|
130
|
+
size: "lg",
|
|
131
|
+
isPending: isLoading,
|
|
132
|
+
children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
133
|
+
children: [
|
|
134
|
+
isPending && /*#__PURE__*/ _jsx(Spinner, {
|
|
135
|
+
color: "current",
|
|
136
|
+
size: "sm"
|
|
137
|
+
}),
|
|
138
|
+
t.continue
|
|
139
|
+
]
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
]
|
|
143
|
+
})
|
|
144
|
+
]
|
|
145
|
+
}, "email"),
|
|
146
|
+
step === 'password' && /*#__PURE__*/ _jsxs(motion.div, {
|
|
147
|
+
initial: {
|
|
148
|
+
opacity: 0,
|
|
149
|
+
x: 20
|
|
150
|
+
},
|
|
151
|
+
animate: {
|
|
152
|
+
opacity: 1,
|
|
153
|
+
x: 0
|
|
154
|
+
},
|
|
155
|
+
exit: {
|
|
156
|
+
opacity: 0,
|
|
157
|
+
x: -20
|
|
158
|
+
},
|
|
159
|
+
transition: {
|
|
160
|
+
duration: 0.3
|
|
161
|
+
},
|
|
162
|
+
children: [
|
|
163
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
164
|
+
className: "flex items-center justify-between border border-gray-300 rounded-xl px-4 py-3 mb-4",
|
|
165
|
+
children: [
|
|
166
|
+
/*#__PURE__*/ _jsx("span", {
|
|
167
|
+
className: "text-gray-900 text-sm",
|
|
168
|
+
children: email
|
|
169
|
+
}),
|
|
170
|
+
/*#__PURE__*/ _jsx("button", {
|
|
171
|
+
type: "button",
|
|
172
|
+
onClick: handleEditEmail,
|
|
173
|
+
className: "text-gray-600 text-sm font-medium hover:text-gray-900",
|
|
174
|
+
children: t.edit
|
|
175
|
+
})
|
|
176
|
+
]
|
|
177
|
+
}),
|
|
178
|
+
/*#__PURE__*/ _jsxs("form", {
|
|
179
|
+
onSubmit: handlePasswordSubmit,
|
|
180
|
+
className: "space-y-4",
|
|
181
|
+
children: [
|
|
182
|
+
error && /*#__PURE__*/ _jsx(motion.div, {
|
|
183
|
+
className: "bg-red-50 text-red-600 border border-red-200 rounded-lg p-3 text-sm",
|
|
184
|
+
initial: {
|
|
185
|
+
opacity: 0
|
|
186
|
+
},
|
|
187
|
+
animate: {
|
|
188
|
+
opacity: 1
|
|
189
|
+
},
|
|
190
|
+
children: error
|
|
191
|
+
}),
|
|
192
|
+
/*#__PURE__*/ _jsxs(TextField, {
|
|
193
|
+
type: showPassword ? 'text' : 'password',
|
|
194
|
+
value: password,
|
|
195
|
+
onChange: setPassword,
|
|
196
|
+
isRequired: true,
|
|
197
|
+
autoFocus: true,
|
|
198
|
+
fullWidth: true,
|
|
199
|
+
children: [
|
|
200
|
+
/*#__PURE__*/ _jsx(Label, {
|
|
201
|
+
className: "text-gray-600",
|
|
202
|
+
children: t.passwordLabel
|
|
203
|
+
}),
|
|
204
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
205
|
+
className: "relative",
|
|
206
|
+
children: [
|
|
207
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
208
|
+
variant: "secondary"
|
|
209
|
+
}),
|
|
210
|
+
/*#__PURE__*/ _jsx("button", {
|
|
211
|
+
type: "button",
|
|
212
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2",
|
|
213
|
+
onClick: ()=>setShowPassword(!showPassword),
|
|
214
|
+
children: /*#__PURE__*/ _jsx(Icon, {
|
|
215
|
+
icon: showPassword ? 'lucide:eye-off' : 'lucide:eye',
|
|
216
|
+
className: "text-gray-400",
|
|
217
|
+
width: 20
|
|
218
|
+
})
|
|
213
219
|
})
|
|
214
|
-
|
|
215
|
-
|
|
220
|
+
]
|
|
221
|
+
})
|
|
222
|
+
]
|
|
223
|
+
}),
|
|
224
|
+
/*#__PURE__*/ _jsx("div", {
|
|
225
|
+
className: "text-left",
|
|
226
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
227
|
+
href: "/forgot-password",
|
|
228
|
+
className: "text-sm text-gray-700 hover:underline",
|
|
229
|
+
children: t.forgotPassword
|
|
216
230
|
})
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
className: "
|
|
224
|
-
children:
|
|
231
|
+
}),
|
|
232
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
233
|
+
type: "submit",
|
|
234
|
+
fullWidth: true,
|
|
235
|
+
size: "lg",
|
|
236
|
+
isPending: isLoading,
|
|
237
|
+
className: "h-12 font-semibold",
|
|
238
|
+
children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
239
|
+
children: [
|
|
240
|
+
isPending && /*#__PURE__*/ _jsx(Spinner, {
|
|
241
|
+
color: "current",
|
|
242
|
+
size: "sm"
|
|
243
|
+
}),
|
|
244
|
+
t.continue
|
|
245
|
+
]
|
|
246
|
+
})
|
|
225
247
|
})
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
isPending: isSendingOtp,
|
|
301
|
-
onPress: handleSendOtp,
|
|
302
|
-
className: "h-12 font-semibold",
|
|
303
|
-
children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
304
|
-
children: [
|
|
305
|
-
isPending && /*#__PURE__*/ _jsx(Spinner, {
|
|
306
|
-
color: "current",
|
|
307
|
-
size: "sm"
|
|
308
|
-
}),
|
|
309
|
-
isPending ? t.sendingCode : t.sendCode
|
|
310
|
-
]
|
|
311
|
-
})
|
|
312
|
-
})
|
|
313
|
-
]
|
|
314
|
-
}, "otp-prompt")
|
|
315
|
-
]
|
|
248
|
+
]
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
}, "password"),
|
|
252
|
+
step === 'otp-prompt' && /*#__PURE__*/ _jsxs(motion.div, {
|
|
253
|
+
initial: {
|
|
254
|
+
opacity: 0,
|
|
255
|
+
x: 20
|
|
256
|
+
},
|
|
257
|
+
animate: {
|
|
258
|
+
opacity: 1,
|
|
259
|
+
x: 0
|
|
260
|
+
},
|
|
261
|
+
exit: {
|
|
262
|
+
opacity: 0,
|
|
263
|
+
x: -20
|
|
264
|
+
},
|
|
265
|
+
transition: {
|
|
266
|
+
duration: 0.3
|
|
267
|
+
},
|
|
268
|
+
children: [
|
|
269
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
270
|
+
className: "flex items-center justify-between border border-gray-300 rounded-xl px-4 py-3 mb-4",
|
|
271
|
+
children: [
|
|
272
|
+
/*#__PURE__*/ _jsx("span", {
|
|
273
|
+
className: "text-gray-900 text-sm",
|
|
274
|
+
children: email
|
|
275
|
+
}),
|
|
276
|
+
/*#__PURE__*/ _jsx("button", {
|
|
277
|
+
type: "button",
|
|
278
|
+
onClick: handleEditEmail,
|
|
279
|
+
className: "text-gray-600 text-sm font-medium hover:text-gray-900",
|
|
280
|
+
children: t.edit
|
|
281
|
+
})
|
|
282
|
+
]
|
|
283
|
+
}),
|
|
284
|
+
error && /*#__PURE__*/ _jsx("div", {
|
|
285
|
+
className: "bg-red-50 text-red-600 border border-red-200 rounded-lg p-3 text-sm mb-4",
|
|
286
|
+
children: error
|
|
287
|
+
}),
|
|
288
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
289
|
+
className: "bg-blue-50 border border-blue-200 rounded-lg p-4 mb-4 flex gap-3",
|
|
290
|
+
children: [
|
|
291
|
+
/*#__PURE__*/ _jsx(Icon, {
|
|
292
|
+
icon: "lucide:mail",
|
|
293
|
+
className: "text-blue-500 mt-0.5",
|
|
294
|
+
width: 20
|
|
295
|
+
}),
|
|
296
|
+
/*#__PURE__*/ _jsx("p", {
|
|
297
|
+
className: "text-sm text-blue-700",
|
|
298
|
+
children: t.verificationNotice
|
|
299
|
+
})
|
|
300
|
+
]
|
|
301
|
+
}),
|
|
302
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
303
|
+
fullWidth: true,
|
|
304
|
+
size: "lg",
|
|
305
|
+
isPending: isSendingOtp,
|
|
306
|
+
onPress: handleSendOtp,
|
|
307
|
+
className: "h-12 font-semibold",
|
|
308
|
+
children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
309
|
+
children: [
|
|
310
|
+
isPending && /*#__PURE__*/ _jsx(Spinner, {
|
|
311
|
+
color: "current",
|
|
312
|
+
size: "sm"
|
|
313
|
+
}),
|
|
314
|
+
isPending ? t.sendingCode : t.sendCode
|
|
315
|
+
]
|
|
316
|
+
})
|
|
317
|
+
})
|
|
318
|
+
]
|
|
319
|
+
}, "otp-prompt")
|
|
320
|
+
]
|
|
321
|
+
})
|
|
316
322
|
})
|
|
317
323
|
});
|
|
318
324
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AuthLayoutConfig } from '../AuthLayout';
|
|
2
|
-
|
|
2
|
+
import type { AuthCardConfig } from '../AuthCard';
|
|
3
|
+
export interface LoginPageProps extends AuthLayoutConfig, AuthCardConfig {
|
|
3
4
|
onPasswordLogin: (credentials: {
|
|
4
5
|
email: string;
|
|
5
6
|
password: string;
|