@main12/auth-login 0.2.1 → 0.2.2
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/auth/application/hooks/useLoginFlow.d.ts +1 -1
- package/dist/auth/application/hooks/useSetPasswordFlow.d.ts +1 -1
- package/dist/auth/application/services/authService.d.ts +1 -1
- package/dist/auth/domain/passwordRules.d.ts +1 -1
- package/dist/components/AuthLayout.d.ts +1 -1
- package/dist/components/AuthLayout.js +59 -35
- package/dist/components/PoweredBy.js +40 -23
- package/dist/components/email/baseTemplate.d.ts +2 -2
- package/dist/components/email/index.d.ts +7 -7
- package/dist/components/email/templates/otp.d.ts +3 -3
- package/dist/components/email/templates/passwordChanged.d.ts +3 -3
- package/dist/components/email/templates/passwordReset.d.ts +3 -3
- package/dist/components/email/templates/welcome.d.ts +3 -3
- package/dist/components/pages/ForgotPasswordPage.d.ts +1 -1
- package/dist/components/pages/ForgotPasswordPageHero.d.ts +1 -1
- package/dist/components/pages/ForgotPasswordPageHero.js +24 -15
- package/dist/components/pages/ForgotPasswordPageTailwind.d.ts +1 -1
- package/dist/components/pages/LoginPage.d.ts +1 -1
- package/dist/components/pages/LoginPageHero.d.ts +1 -1
- package/dist/components/pages/LoginPageHero.js +81 -51
- package/dist/components/pages/LoginPageTailwind.d.ts +1 -1
- package/dist/components/pages/LoginPageTailwind.js +11 -20
- package/dist/components/pages/SetPasswordPage.d.ts +1 -1
- package/dist/components/pages/SetPasswordPageHero.d.ts +1 -1
- package/dist/components/pages/SetPasswordPageHero.js +50 -33
- package/dist/components/pages/SetPasswordPageTailwind.d.ts +1 -1
- package/dist/components/pages/SignupPage.d.ts +1 -1
- package/dist/components/pages/SignupPageHero.d.ts +1 -1
- package/dist/components/pages/SignupPageHero.js +46 -34
- package/dist/components/pages/SignupPageTailwind.d.ts +1 -1
- package/dist/components/pages/VerifyOtpPage.d.ts +1 -1
- package/dist/components/pages/VerifyOtpPageHero.d.ts +1 -1
- package/dist/components/pages/VerifyOtpPageHero.js +46 -10
- package/dist/components/pages/VerifyOtpPageTailwind.d.ts +1 -1
- package/dist/components/ui/index.d.ts +2 -1
- package/dist/components/ui/index.js +3 -2
- package/dist/config.d.ts +7 -0
- package/dist/config.js +5 -4
- package/dist/exports/client.d.ts +25 -24
- package/dist/exports/client.js +2 -0
- package/dist/exports/rsc.d.ts +6 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -1
- package/package.json +18 -14
|
@@ -10,7 +10,7 @@ export declare function useSetPasswordFlow({ redirectTo }?: UseSetPasswordFlowOp
|
|
|
10
10
|
error: string | null;
|
|
11
11
|
isLoading: boolean;
|
|
12
12
|
showPassword: boolean;
|
|
13
|
-
strength: import("../../domain/types
|
|
13
|
+
strength: import("../../domain/types").PasswordStrengthResult;
|
|
14
14
|
setPassword: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
15
15
|
setConfirmPassword: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
16
16
|
setShowPassword: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CheckEmailResponse, SendOtpResponse, VerifyOtpResponse, SetPasswordResponse, SignupResponse } from '../../domain/types
|
|
1
|
+
import type { CheckEmailResponse, SendOtpResponse, VerifyOtpResponse, SetPasswordResponse, SignupResponse } from '../../domain/types';
|
|
2
2
|
/**
|
|
3
3
|
* Check if a user exists and whether they have a password set.
|
|
4
4
|
* Used in the two-step login flow.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface AuthLayoutConfig {
|
|
3
|
-
/**
|
|
3
|
+
/** Component or URL. Falls back to pluginConfig when omitted. */
|
|
4
4
|
logo?: React.ReactNode;
|
|
5
5
|
title?: string;
|
|
6
6
|
subtitle?: string;
|
|
@@ -5,57 +5,81 @@ import { Card, CardContent, CardFooter } from './ui/index.js';
|
|
|
5
5
|
import { PoweredBy } from './PoweredBy.js';
|
|
6
6
|
import { pluginConfig } from '../config.js';
|
|
7
7
|
function DefaultLogo() {
|
|
8
|
-
if (
|
|
9
|
-
|
|
8
|
+
if (pluginConfig.Logo) {
|
|
9
|
+
const L = pluginConfig.Logo;
|
|
10
|
+
return /*#__PURE__*/ _jsx(L, {});
|
|
11
|
+
}
|
|
12
|
+
if (pluginConfig.logoUrl) return /*#__PURE__*/ _jsx("img", {
|
|
10
13
|
src: pluginConfig.logoUrl,
|
|
11
14
|
alt: "",
|
|
12
15
|
width: 180,
|
|
13
16
|
height: 42,
|
|
14
17
|
className: "object-contain"
|
|
15
18
|
});
|
|
19
|
+
return null;
|
|
16
20
|
}
|
|
17
21
|
export const AuthLayout = ({ children, logo, title, subtitle, footer, poweredBy, cardClassName = '', backgroundClass = 'bg-white md:bg-[#191919]' })=>{
|
|
18
22
|
const displayLogo = logo || /*#__PURE__*/ _jsx(DefaultLogo, {});
|
|
19
|
-
|
|
23
|
+
const header = (displayLogo || title) && /*#__PURE__*/ _jsxs("div", {
|
|
24
|
+
className: "flex flex-col items-center gap-2 pt-6 pb-2 px-6",
|
|
25
|
+
children: [
|
|
26
|
+
displayLogo && /*#__PURE__*/ _jsx("div", {
|
|
27
|
+
className: "flex justify-center mb-2",
|
|
28
|
+
children: displayLogo
|
|
29
|
+
}),
|
|
30
|
+
title && /*#__PURE__*/ _jsx("h1", {
|
|
31
|
+
className: "text-xl font-semibold text-gray-900 text-center",
|
|
32
|
+
children: title
|
|
33
|
+
}),
|
|
34
|
+
subtitle && /*#__PURE__*/ _jsx("p", {
|
|
35
|
+
className: "text-gray-600 text-sm text-center",
|
|
36
|
+
children: subtitle
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
return /*#__PURE__*/ _jsxs("main", {
|
|
20
41
|
className: `flex flex-col min-h-screen ${backgroundClass}`,
|
|
21
|
-
children:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
className: "w-full max-w-[400px] animate-[fadeIn_0.5s_ease-out]",
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
44
|
+
className: "md:hidden flex flex-col",
|
|
25
45
|
children: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
children: displayLogo
|
|
35
|
-
}),
|
|
36
|
-
title && /*#__PURE__*/ _jsx("h1", {
|
|
37
|
-
className: "text-xl font-semibold text-gray-900 text-center",
|
|
38
|
-
children: title
|
|
39
|
-
}),
|
|
40
|
-
subtitle && /*#__PURE__*/ _jsx("p", {
|
|
41
|
-
className: "text-gray-600 text-sm text-center",
|
|
42
|
-
children: subtitle
|
|
43
|
-
})
|
|
44
|
-
]
|
|
45
|
-
}),
|
|
46
|
-
/*#__PURE__*/ _jsx(CardContent, {
|
|
47
|
-
children: children
|
|
48
|
-
}),
|
|
49
|
-
footer && /*#__PURE__*/ _jsx(CardFooter, {
|
|
50
|
-
children: footer
|
|
51
|
-
})
|
|
52
|
-
]
|
|
46
|
+
header,
|
|
47
|
+
/*#__PURE__*/ _jsx("div", {
|
|
48
|
+
className: "px-6 pb-4",
|
|
49
|
+
children: children
|
|
50
|
+
}),
|
|
51
|
+
footer && /*#__PURE__*/ _jsx("div", {
|
|
52
|
+
className: "px-6 pb-6 flex justify-center",
|
|
53
|
+
children: footer
|
|
53
54
|
}),
|
|
54
55
|
/*#__PURE__*/ _jsx(PoweredBy, {
|
|
55
56
|
...poweredBy
|
|
56
57
|
})
|
|
57
58
|
]
|
|
59
|
+
}),
|
|
60
|
+
/*#__PURE__*/ _jsx("div", {
|
|
61
|
+
className: "hidden md:flex min-h-screen items-center justify-center px-4 py-12",
|
|
62
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
63
|
+
className: "w-full max-w-[400px] animate-[fadeIn_0.5s_ease-out]",
|
|
64
|
+
children: [
|
|
65
|
+
/*#__PURE__*/ _jsxs(Card, {
|
|
66
|
+
className: cardClassName,
|
|
67
|
+
children: [
|
|
68
|
+
header,
|
|
69
|
+
/*#__PURE__*/ _jsx(CardContent, {
|
|
70
|
+
children: children
|
|
71
|
+
}),
|
|
72
|
+
footer && /*#__PURE__*/ _jsx(CardFooter, {
|
|
73
|
+
children: footer
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
}),
|
|
77
|
+
/*#__PURE__*/ _jsx(PoweredBy, {
|
|
78
|
+
...poweredBy
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
})
|
|
58
82
|
})
|
|
59
|
-
|
|
83
|
+
]
|
|
60
84
|
});
|
|
61
85
|
};
|
|
@@ -1,30 +1,47 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
const Main12LogoSVG = ({ width = 28, height = 28 })
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
// const Main12LogoSVG = ({ width = 28, height = 28 }: { width?: number; height?: number }) => (
|
|
5
|
+
// <svg width={width} height={height} viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
// <rect width="100" height="100" rx="20" fill="#D5E855" />
|
|
7
|
+
// <text x="50" y="68" textAnchor="middle" fontSize="52" fontWeight="700" fill="#1d1d1f" fontFamily="system-ui, sans-serif">12</text>
|
|
8
|
+
// </svg>
|
|
9
|
+
// )
|
|
10
|
+
const Main12LogoSVG = ({ width = 28, height = 28 })=>/*#__PURE__*/ _jsx("svg", {
|
|
11
|
+
viewBox: "0 0 7.938 7.937",
|
|
12
|
+
height: width,
|
|
13
|
+
width: height,
|
|
14
|
+
xmlSpace: "preserve",
|
|
9
15
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
children:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
children: /*#__PURE__*/ _jsxs("g", {
|
|
17
|
+
style: {
|
|
18
|
+
display: "inline"
|
|
19
|
+
},
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ _jsx("path", {
|
|
22
|
+
d: "M671.165-649.8h-7.867v7.867",
|
|
23
|
+
style: {
|
|
24
|
+
fill: "#4e5357",
|
|
25
|
+
fillOpacity: 1,
|
|
26
|
+
fillRule: "nonzero",
|
|
27
|
+
stroke: "none",
|
|
28
|
+
strokeWidth: 0.0516193
|
|
29
|
+
},
|
|
30
|
+
transform: "translate(-330.646 331.775)scale(.50447)"
|
|
31
|
+
}),
|
|
32
|
+
/*#__PURE__*/ _jsx("path", {
|
|
33
|
+
d: "M655.431-649.8h7.867v-7.868",
|
|
34
|
+
style: {
|
|
35
|
+
fill: "#3e86b0",
|
|
36
|
+
fillOpacity: 1,
|
|
37
|
+
fillRule: "nonzero",
|
|
38
|
+
stroke: "none",
|
|
39
|
+
strokeWidth: 0.0516193
|
|
40
|
+
},
|
|
41
|
+
transform: "translate(-330.646 331.775)scale(.50447)"
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
})
|
|
28
45
|
});
|
|
29
46
|
export const PoweredBy = ({ enabled = true, logoUrl, linkUrl = 'https://main12.com', width = 28, height = 28, className = '' })=>{
|
|
30
47
|
if (!enabled) return null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type EmailColors, type SocialLink } from './constants
|
|
2
|
-
import { type SupportedLanguage } from './translations
|
|
1
|
+
import { type EmailColors, type SocialLink } from './constants';
|
|
2
|
+
import { type SupportedLanguage } from './translations';
|
|
3
3
|
export interface BaseTemplateOptions {
|
|
4
4
|
logoUrl?: string;
|
|
5
5
|
projectName?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { wrapInBaseTemplate, type BaseTemplateOptions } from './baseTemplate
|
|
2
|
-
export { DEFAULT_COLORS, SOCIAL_ICONS, getBaseUrl, getSenderEmail, type EmailColors, type SocialLink, type SocialPlatform } from './constants
|
|
3
|
-
export { getEmailTranslations, type SupportedLanguage, type EmailTranslations } from './translations
|
|
4
|
-
export { generateOtpEmail, type OtpEmailParams, type OtpEmailResult } from './templates/otp
|
|
5
|
-
export { generateWelcomeEmail, type WelcomeEmailParams, type WelcomeEmailResult } from './templates/welcome
|
|
6
|
-
export { generatePasswordResetEmail, type PasswordResetEmailParams, type PasswordResetEmailResult } from './templates/passwordReset
|
|
7
|
-
export { generatePasswordChangedEmail, type PasswordChangedEmailParams, type PasswordChangedEmailResult } from './templates/passwordChanged
|
|
1
|
+
export { wrapInBaseTemplate, type BaseTemplateOptions } from './baseTemplate';
|
|
2
|
+
export { DEFAULT_COLORS, SOCIAL_ICONS, getBaseUrl, getSenderEmail, type EmailColors, type SocialLink, type SocialPlatform } from './constants';
|
|
3
|
+
export { getEmailTranslations, type SupportedLanguage, type EmailTranslations } from './translations';
|
|
4
|
+
export { generateOtpEmail, type OtpEmailParams, type OtpEmailResult } from './templates/otp';
|
|
5
|
+
export { generateWelcomeEmail, type WelcomeEmailParams, type WelcomeEmailResult } from './templates/welcome';
|
|
6
|
+
export { generatePasswordResetEmail, type PasswordResetEmailParams, type PasswordResetEmailResult } from './templates/passwordReset';
|
|
7
|
+
export { generatePasswordChangedEmail, type PasswordChangedEmailParams, type PasswordChangedEmailResult } from './templates/passwordChanged';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type SocialLink } from '../constants
|
|
2
|
-
import { type BaseTemplateOptions } from '../baseTemplate
|
|
3
|
-
import { type SupportedLanguage } from '../translations
|
|
1
|
+
import { type SocialLink } from '../constants';
|
|
2
|
+
import { type BaseTemplateOptions } from '../baseTemplate';
|
|
3
|
+
import { type SupportedLanguage } from '../translations';
|
|
4
4
|
export interface OtpEmailParams {
|
|
5
5
|
userName: string;
|
|
6
6
|
otp: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type SocialLink } from '../constants
|
|
2
|
-
import { type BaseTemplateOptions } from '../baseTemplate
|
|
3
|
-
import { type SupportedLanguage } from '../translations
|
|
1
|
+
import { type SocialLink } from '../constants';
|
|
2
|
+
import { type BaseTemplateOptions } from '../baseTemplate';
|
|
3
|
+
import { type SupportedLanguage } from '../translations';
|
|
4
4
|
export interface PasswordChangedEmailParams {
|
|
5
5
|
userName: string;
|
|
6
6
|
loginUrl?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type SocialLink } from '../constants
|
|
2
|
-
import { type BaseTemplateOptions } from '../baseTemplate
|
|
3
|
-
import { type SupportedLanguage } from '../translations
|
|
1
|
+
import { type SocialLink } from '../constants';
|
|
2
|
+
import { type BaseTemplateOptions } from '../baseTemplate';
|
|
3
|
+
import { type SupportedLanguage } from '../translations';
|
|
4
4
|
export interface PasswordResetEmailParams {
|
|
5
5
|
userName: string;
|
|
6
6
|
otp: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type SocialLink } from '../constants
|
|
2
|
-
import { type BaseTemplateOptions } from '../baseTemplate
|
|
3
|
-
import { type SupportedLanguage } from '../translations
|
|
1
|
+
import { type SocialLink } from '../constants';
|
|
2
|
+
import { type BaseTemplateOptions } from '../baseTemplate';
|
|
3
|
+
import { type SupportedLanguage } from '../translations';
|
|
4
4
|
export interface WelcomeEmailParams {
|
|
5
5
|
userName: string;
|
|
6
6
|
userEmail?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { Button, Input } from '@heroui/react';
|
|
4
|
+
import { Button, Input, Label, TextField, Spinner } from '@heroui/react';
|
|
5
5
|
import { Icon } from '@iconify/react';
|
|
6
6
|
import { motion } from 'framer-motion';
|
|
7
7
|
import { useForgotPasswordFlow } from '../../auth/application/hooks/useForgotPasswordFlow.js';
|
|
@@ -40,28 +40,37 @@ export default function ForgotPasswordPageHero({ loginUrl = '/login', logo, powe
|
|
|
40
40
|
},
|
|
41
41
|
children: error
|
|
42
42
|
}),
|
|
43
|
-
/*#__PURE__*/
|
|
43
|
+
/*#__PURE__*/ _jsxs(TextField, {
|
|
44
44
|
type: "email",
|
|
45
|
-
label: "Email",
|
|
46
45
|
value: email,
|
|
47
|
-
onChange:
|
|
48
|
-
variant: "bordered",
|
|
49
|
-
size: "lg",
|
|
46
|
+
onChange: setEmail,
|
|
50
47
|
isRequired: true,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
fullWidth: true,
|
|
49
|
+
children: [
|
|
50
|
+
/*#__PURE__*/ _jsx(Label, {
|
|
51
|
+
className: "text-gray-600",
|
|
52
|
+
children: "Email"
|
|
53
|
+
}),
|
|
54
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
55
|
+
className: "bg-white"
|
|
56
|
+
})
|
|
57
|
+
]
|
|
56
58
|
}),
|
|
57
59
|
/*#__PURE__*/ _jsx(Button, {
|
|
58
60
|
type: "submit",
|
|
59
61
|
fullWidth: true,
|
|
60
62
|
size: "lg",
|
|
61
|
-
|
|
62
|
-
isLoading: isLoading,
|
|
63
|
+
isPending: isLoading,
|
|
63
64
|
className: "h-12 font-semibold",
|
|
64
|
-
children:
|
|
65
|
+
children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
66
|
+
children: [
|
|
67
|
+
isPending && /*#__PURE__*/ _jsx(Spinner, {
|
|
68
|
+
color: "current",
|
|
69
|
+
size: "sm"
|
|
70
|
+
}),
|
|
71
|
+
"Send Reset Code"
|
|
72
|
+
]
|
|
73
|
+
})
|
|
65
74
|
})
|
|
66
75
|
]
|
|
67
76
|
})
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React, { Suspense } from 'react';
|
|
4
4
|
import { useSearchParams } from 'next/navigation';
|
|
5
|
-
import { Button, Input,
|
|
5
|
+
import { Button, Input, Label, TextField, Separator, Spinner } from '@heroui/react';
|
|
6
6
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
7
7
|
import { Icon } from '@iconify/react';
|
|
8
8
|
import { useLoginFlow } from '../../auth/application/hooks/useLoginFlow.js';
|
|
@@ -57,29 +57,29 @@ function LoginHeroContent({ onPasswordLogin, redirectTo = '/', showGoogleOAuth =
|
|
|
57
57
|
children: [
|
|
58
58
|
showGoogleOAuth && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
59
59
|
children: [
|
|
60
|
-
/*#__PURE__*/
|
|
60
|
+
/*#__PURE__*/ _jsxs(Button, {
|
|
61
61
|
fullWidth: true,
|
|
62
|
-
variant: "
|
|
63
|
-
size: "lg",
|
|
64
|
-
className: "mb-4 h-12 border-gray-300 rounded-full text-gray-700 hover:bg-gray-50",
|
|
65
|
-
startContent: /*#__PURE__*/ _jsx(Icon, {
|
|
66
|
-
icon: "flat-color-icons:google",
|
|
67
|
-
width: 20
|
|
68
|
-
}),
|
|
62
|
+
variant: "secondary",
|
|
69
63
|
onPress: handleGoogleLogin,
|
|
70
|
-
children:
|
|
64
|
+
children: [
|
|
65
|
+
/*#__PURE__*/ _jsx(Icon, {
|
|
66
|
+
icon: "flat-color-icons:google",
|
|
67
|
+
width: 20
|
|
68
|
+
}),
|
|
69
|
+
"Continue with Google"
|
|
70
|
+
]
|
|
71
71
|
}),
|
|
72
72
|
/*#__PURE__*/ _jsxs("div", {
|
|
73
73
|
className: "flex items-center gap-4 my-4",
|
|
74
74
|
children: [
|
|
75
|
-
/*#__PURE__*/ _jsx(
|
|
75
|
+
/*#__PURE__*/ _jsx(Separator, {
|
|
76
76
|
className: "flex-1"
|
|
77
77
|
}),
|
|
78
78
|
/*#__PURE__*/ _jsx("span", {
|
|
79
79
|
className: "text-gray-500 text-sm",
|
|
80
80
|
children: "or"
|
|
81
81
|
}),
|
|
82
|
-
/*#__PURE__*/ _jsx(
|
|
82
|
+
/*#__PURE__*/ _jsx(Separator, {
|
|
83
83
|
className: "flex-1"
|
|
84
84
|
})
|
|
85
85
|
]
|
|
@@ -100,28 +100,36 @@ function LoginHeroContent({ onPasswordLogin, redirectTo = '/', showGoogleOAuth =
|
|
|
100
100
|
},
|
|
101
101
|
children: error
|
|
102
102
|
}),
|
|
103
|
-
/*#__PURE__*/
|
|
103
|
+
/*#__PURE__*/ _jsxs(TextField, {
|
|
104
104
|
type: "email",
|
|
105
|
-
label: "Email",
|
|
106
105
|
value: email,
|
|
107
|
-
|
|
108
|
-
variant: "bordered",
|
|
109
|
-
size: "lg",
|
|
106
|
+
onChange: setEmail,
|
|
110
107
|
isRequired: true,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
108
|
+
fullWidth: true,
|
|
109
|
+
children: [
|
|
110
|
+
/*#__PURE__*/ _jsx(Label, {
|
|
111
|
+
className: "text-gray-600",
|
|
112
|
+
children: "Email"
|
|
113
|
+
}),
|
|
114
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
115
|
+
variant: "secondary"
|
|
116
|
+
})
|
|
117
|
+
]
|
|
116
118
|
}),
|
|
117
119
|
/*#__PURE__*/ _jsx(Button, {
|
|
118
120
|
type: "submit",
|
|
119
121
|
fullWidth: true,
|
|
120
122
|
size: "lg",
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
isPending: isLoading,
|
|
124
|
+
children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
125
|
+
children: [
|
|
126
|
+
isPending && /*#__PURE__*/ _jsx(Spinner, {
|
|
127
|
+
color: "current",
|
|
128
|
+
size: "sm"
|
|
129
|
+
}),
|
|
130
|
+
"Continue"
|
|
131
|
+
]
|
|
132
|
+
})
|
|
125
133
|
})
|
|
126
134
|
]
|
|
127
135
|
})
|
|
@@ -173,29 +181,37 @@ function LoginHeroContent({ onPasswordLogin, redirectTo = '/', showGoogleOAuth =
|
|
|
173
181
|
},
|
|
174
182
|
children: error
|
|
175
183
|
}),
|
|
176
|
-
/*#__PURE__*/
|
|
184
|
+
/*#__PURE__*/ _jsxs(TextField, {
|
|
177
185
|
type: showPassword ? 'text' : 'password',
|
|
178
|
-
label: "Password",
|
|
179
186
|
value: password,
|
|
180
|
-
|
|
181
|
-
variant: "bordered",
|
|
182
|
-
size: "lg",
|
|
187
|
+
onChange: setPassword,
|
|
183
188
|
isRequired: true,
|
|
184
189
|
autoFocus: true,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
190
|
+
fullWidth: true,
|
|
191
|
+
children: [
|
|
192
|
+
/*#__PURE__*/ _jsx(Label, {
|
|
193
|
+
className: "text-gray-600",
|
|
194
|
+
children: "Password"
|
|
195
|
+
}),
|
|
196
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
197
|
+
className: "relative",
|
|
198
|
+
children: [
|
|
199
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
200
|
+
variant: "secondary"
|
|
201
|
+
}),
|
|
202
|
+
/*#__PURE__*/ _jsx("button", {
|
|
203
|
+
type: "button",
|
|
204
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2",
|
|
205
|
+
onClick: ()=>setShowPassword(!showPassword),
|
|
206
|
+
children: /*#__PURE__*/ _jsx(Icon, {
|
|
207
|
+
icon: showPassword ? 'lucide:eye-off' : 'lucide:eye',
|
|
208
|
+
className: "text-gray-400",
|
|
209
|
+
width: 20
|
|
210
|
+
})
|
|
211
|
+
})
|
|
212
|
+
]
|
|
197
213
|
})
|
|
198
|
-
|
|
214
|
+
]
|
|
199
215
|
}),
|
|
200
216
|
/*#__PURE__*/ _jsx("div", {
|
|
201
217
|
className: "text-left",
|
|
@@ -209,10 +225,17 @@ function LoginHeroContent({ onPasswordLogin, redirectTo = '/', showGoogleOAuth =
|
|
|
209
225
|
type: "submit",
|
|
210
226
|
fullWidth: true,
|
|
211
227
|
size: "lg",
|
|
212
|
-
|
|
213
|
-
isLoading: isLoading,
|
|
228
|
+
isPending: isLoading,
|
|
214
229
|
className: "h-12 font-semibold",
|
|
215
|
-
children:
|
|
230
|
+
children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
231
|
+
children: [
|
|
232
|
+
isPending && /*#__PURE__*/ _jsx(Spinner, {
|
|
233
|
+
color: "current",
|
|
234
|
+
size: "sm"
|
|
235
|
+
}),
|
|
236
|
+
"Continue"
|
|
237
|
+
]
|
|
238
|
+
})
|
|
216
239
|
})
|
|
217
240
|
]
|
|
218
241
|
})
|
|
@@ -271,11 +294,18 @@ function LoginHeroContent({ onPasswordLogin, redirectTo = '/', showGoogleOAuth =
|
|
|
271
294
|
/*#__PURE__*/ _jsx(Button, {
|
|
272
295
|
fullWidth: true,
|
|
273
296
|
size: "lg",
|
|
274
|
-
|
|
275
|
-
isLoading: isSendingOtp,
|
|
297
|
+
isPending: isSendingOtp,
|
|
276
298
|
onPress: handleSendOtp,
|
|
277
299
|
className: "h-12 font-semibold",
|
|
278
|
-
children:
|
|
300
|
+
children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
301
|
+
children: [
|
|
302
|
+
isPending && /*#__PURE__*/ _jsx(Spinner, {
|
|
303
|
+
color: "current",
|
|
304
|
+
size: "sm"
|
|
305
|
+
}),
|
|
306
|
+
isPending ? 'Sending...' : 'Send Code'
|
|
307
|
+
]
|
|
308
|
+
})
|
|
279
309
|
})
|
|
280
310
|
]
|
|
281
311
|
}, "otp-prompt")
|
|
@@ -287,7 +317,7 @@ export default function LoginPageHero(props) {
|
|
|
287
317
|
return /*#__PURE__*/ _jsx(Suspense, {
|
|
288
318
|
fallback: /*#__PURE__*/ _jsx("div", {
|
|
289
319
|
className: "min-h-screen flex items-center justify-center",
|
|
290
|
-
children: /*#__PURE__*/ _jsx(
|
|
320
|
+
children: /*#__PURE__*/ _jsx(Spinner, {
|
|
291
321
|
size: "lg"
|
|
292
322
|
})
|
|
293
323
|
}),
|