@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AuthLayoutConfig } from '../AuthLayout';
|
|
2
|
-
|
|
2
|
+
import type { AuthCardConfig } from '../AuthCard';
|
|
3
|
+
export interface ForgotPasswordPageHeroProps extends AuthLayoutConfig, AuthCardConfig {
|
|
3
4
|
loginUrl?: string;
|
|
4
5
|
}
|
|
5
|
-
export default function ForgotPasswordPageHero({ loginUrl, logo, poweredBy, cardClassName, backgroundClass, locale, messages }: ForgotPasswordPageHeroProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default function ForgotPasswordPageHero({ loginUrl, logo, poweredBy, cardClassName, removeBorder, removeShadow, mobileVariant, backgroundClass, locale, messages }: ForgotPasswordPageHeroProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,75 +6,81 @@ import { Icon } from '@iconify/react';
|
|
|
6
6
|
import { motion } from 'framer-motion';
|
|
7
7
|
import { useForgotPasswordFlow } from '../../auth/application/hooks/useForgotPasswordFlow.js';
|
|
8
8
|
import { AuthLayout } from '../AuthLayout.js';
|
|
9
|
+
import { AuthCard } from '../AuthCard.js';
|
|
9
10
|
import { getUiTranslations } from '../ui/translations.js';
|
|
10
|
-
export default function ForgotPasswordPageHero({ loginUrl = '/login', logo, poweredBy, cardClassName, backgroundClass, locale, messages }) {
|
|
11
|
+
export default function ForgotPasswordPageHero({ loginUrl = '/login', logo, poweredBy, cardClassName, removeBorder, removeShadow, mobileVariant, backgroundClass, locale, messages }) {
|
|
11
12
|
const { email, error, isLoading, setEmail, handleSubmit } = useForgotPasswordFlow();
|
|
12
13
|
const t = getUiTranslations(locale, messages).forgotPassword;
|
|
13
14
|
return /*#__PURE__*/ _jsx(AuthLayout, {
|
|
14
|
-
logo: logo,
|
|
15
|
-
title: t.title,
|
|
16
|
-
subtitle: t.subtitle,
|
|
17
|
-
poweredBy: poweredBy,
|
|
18
|
-
cardClassName: cardClassName,
|
|
19
15
|
backgroundClass: backgroundClass,
|
|
20
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
16
|
+
children: /*#__PURE__*/ _jsx(AuthCard, {
|
|
17
|
+
logo: logo,
|
|
18
|
+
title: t.title,
|
|
19
|
+
subtitle: t.subtitle,
|
|
20
|
+
poweredBy: poweredBy,
|
|
21
|
+
cardClassName: cardClassName,
|
|
22
|
+
removeBorder: removeBorder,
|
|
23
|
+
removeShadow: removeShadow,
|
|
24
|
+
mobileVariant: mobileVariant,
|
|
25
|
+
footer: /*#__PURE__*/ _jsxs("a", {
|
|
26
|
+
href: loginUrl,
|
|
27
|
+
className: "text-sm text-gray-600 hover:text-gray-900 inline-flex items-center gap-1",
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ _jsx(Icon, {
|
|
30
|
+
icon: "lucide:arrow-left",
|
|
31
|
+
width: 16
|
|
32
|
+
}),
|
|
33
|
+
t.backToLogin
|
|
34
|
+
]
|
|
35
|
+
}),
|
|
36
|
+
children: /*#__PURE__*/ _jsxs("form", {
|
|
37
|
+
onSubmit: handleSubmit,
|
|
38
|
+
className: "space-y-4",
|
|
39
|
+
children: [
|
|
40
|
+
error && /*#__PURE__*/ _jsx(motion.div, {
|
|
41
|
+
className: "bg-red-50 text-red-600 border border-red-200 rounded-lg p-3 text-sm",
|
|
42
|
+
initial: {
|
|
43
|
+
opacity: 0
|
|
44
|
+
},
|
|
45
|
+
animate: {
|
|
46
|
+
opacity: 1
|
|
47
|
+
},
|
|
48
|
+
children: error
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ _jsxs(TextField, {
|
|
51
|
+
type: "email",
|
|
52
|
+
value: email,
|
|
53
|
+
onChange: setEmail,
|
|
54
|
+
isRequired: true,
|
|
55
|
+
fullWidth: true,
|
|
56
|
+
children: [
|
|
57
|
+
/*#__PURE__*/ _jsx(Label, {
|
|
58
|
+
className: "text-gray-600",
|
|
59
|
+
children: t.emailLabel
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
62
|
+
variant: "secondary"
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
}),
|
|
66
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
67
|
+
type: "submit",
|
|
68
|
+
fullWidth: true,
|
|
69
|
+
size: "lg",
|
|
70
|
+
isPending: isLoading,
|
|
71
|
+
className: "h-12 font-semibold",
|
|
72
|
+
children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
73
|
+
children: [
|
|
74
|
+
isPending && /*#__PURE__*/ _jsx(Spinner, {
|
|
75
|
+
color: "current",
|
|
76
|
+
size: "sm"
|
|
77
|
+
}),
|
|
78
|
+
t.sendResetCode
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
})
|
|
78
84
|
})
|
|
79
85
|
});
|
|
80
86
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AuthLayoutConfig } from '../AuthLayout';
|
|
2
|
-
|
|
2
|
+
import type { AuthCardConfig } from '../AuthCard';
|
|
3
|
+
export interface ForgotPasswordPageProps extends AuthLayoutConfig, AuthCardConfig {
|
|
3
4
|
loginUrl?: string;
|
|
4
5
|
}
|
|
5
|
-
export default function ForgotPasswordPage({ loginUrl, logo, poweredBy, cardClassName, backgroundClass, locale, messages, }: ForgotPasswordPageProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default function ForgotPasswordPage({ loginUrl, logo, poweredBy, cardClassName, removeBorder, removeShadow, mobileVariant, backgroundClass, locale, messages, }: ForgotPasswordPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,47 +4,53 @@ import React from 'react';
|
|
|
4
4
|
import { Button, Input } from '../ui/index.js';
|
|
5
5
|
import { useForgotPasswordFlow } from '../../auth/application/hooks/useForgotPasswordFlow.js';
|
|
6
6
|
import { AuthLayout } from '../AuthLayout.js';
|
|
7
|
+
import { AuthCard } from '../AuthCard.js';
|
|
7
8
|
import { getUiTranslations } from '../ui/translations.js';
|
|
8
|
-
export default function ForgotPasswordPage({ loginUrl = '/login', logo, poweredBy, cardClassName, backgroundClass, locale, messages }) {
|
|
9
|
+
export default function ForgotPasswordPage({ loginUrl = '/login', logo, poweredBy, cardClassName, removeBorder, removeShadow, mobileVariant, backgroundClass, locale, messages }) {
|
|
9
10
|
const { email, error, isLoading, setEmail, handleSubmit } = useForgotPasswordFlow();
|
|
10
11
|
const t = getUiTranslations(locale, messages).forgotPassword;
|
|
11
12
|
return /*#__PURE__*/ _jsx(AuthLayout, {
|
|
12
|
-
logo: logo,
|
|
13
|
-
title: t.title,
|
|
14
|
-
subtitle: t.subtitle,
|
|
15
|
-
poweredBy: poweredBy,
|
|
16
|
-
cardClassName: cardClassName,
|
|
17
13
|
backgroundClass: backgroundClass,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
14
|
+
children: /*#__PURE__*/ _jsx(AuthCard, {
|
|
15
|
+
logo: logo,
|
|
16
|
+
title: t.title,
|
|
17
|
+
subtitle: t.subtitle,
|
|
18
|
+
poweredBy: poweredBy,
|
|
19
|
+
cardClassName: cardClassName,
|
|
20
|
+
removeBorder: removeBorder,
|
|
21
|
+
removeShadow: removeShadow,
|
|
22
|
+
mobileVariant: mobileVariant,
|
|
23
|
+
footer: /*#__PURE__*/ _jsxs("a", {
|
|
24
|
+
href: loginUrl,
|
|
25
|
+
className: "text-sm text-gray-600 hover:text-gray-900 inline-flex items-center gap-1",
|
|
26
|
+
children: [
|
|
27
|
+
"← ",
|
|
28
|
+
t.backToLogin
|
|
29
|
+
]
|
|
30
|
+
}),
|
|
31
|
+
children: /*#__PURE__*/ _jsxs("form", {
|
|
32
|
+
onSubmit: handleSubmit,
|
|
33
|
+
className: "space-y-4",
|
|
34
|
+
children: [
|
|
35
|
+
error && /*#__PURE__*/ _jsx("div", {
|
|
36
|
+
className: "bg-red-50 text-red-600 border border-red-200 rounded-lg p-3 text-sm animate-[fadeIn_0.2s_ease-out]",
|
|
37
|
+
children: error
|
|
38
|
+
}),
|
|
39
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
40
|
+
type: "email",
|
|
41
|
+
label: t.emailLabel,
|
|
42
|
+
value: email,
|
|
43
|
+
onChange: (e)=>setEmail(e.target.value),
|
|
44
|
+
isRequired: true
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
47
|
+
type: "submit",
|
|
48
|
+
variant: "primary",
|
|
49
|
+
isLoading: isLoading,
|
|
50
|
+
children: t.sendResetCode
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
})
|
|
48
54
|
})
|
|
49
55
|
});
|
|
50
56
|
}
|
|
@@ -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;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AuthLayoutConfig } from '../AuthLayout';
|
|
2
|
-
|
|
2
|
+
import type { AuthCardConfig } from '../AuthCard';
|
|
3
|
+
export interface LoginPageHeroProps extends AuthLayoutConfig, AuthCardConfig {
|
|
3
4
|
onPasswordLogin: (credentials: {
|
|
4
5
|
email: string;
|
|
5
6
|
password: string;
|