@main12/auth-login 0.2.0 → 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.
Files changed (45) hide show
  1. package/README.md +14 -0
  2. package/dist/auth/application/hooks/useLoginFlow.d.ts +1 -1
  3. package/dist/auth/application/hooks/useSetPasswordFlow.d.ts +1 -1
  4. package/dist/auth/application/services/authService.d.ts +1 -1
  5. package/dist/auth/domain/passwordRules.d.ts +1 -1
  6. package/dist/components/AuthLayout.d.ts +1 -1
  7. package/dist/components/AuthLayout.js +59 -35
  8. package/dist/components/PoweredBy.js +40 -23
  9. package/dist/components/email/baseTemplate.d.ts +2 -2
  10. package/dist/components/email/index.d.ts +7 -7
  11. package/dist/components/email/templates/otp.d.ts +3 -3
  12. package/dist/components/email/templates/passwordChanged.d.ts +3 -3
  13. package/dist/components/email/templates/passwordReset.d.ts +3 -3
  14. package/dist/components/email/templates/welcome.d.ts +3 -3
  15. package/dist/components/pages/ForgotPasswordPage.d.ts +1 -1
  16. package/dist/components/pages/ForgotPasswordPageHero.d.ts +1 -1
  17. package/dist/components/pages/ForgotPasswordPageHero.js +24 -15
  18. package/dist/components/pages/ForgotPasswordPageTailwind.d.ts +1 -1
  19. package/dist/components/pages/LoginPage.d.ts +1 -1
  20. package/dist/components/pages/LoginPageHero.d.ts +1 -1
  21. package/dist/components/pages/LoginPageHero.js +81 -51
  22. package/dist/components/pages/LoginPageTailwind.d.ts +1 -1
  23. package/dist/components/pages/LoginPageTailwind.js +11 -20
  24. package/dist/components/pages/SetPasswordPage.d.ts +1 -1
  25. package/dist/components/pages/SetPasswordPageHero.d.ts +1 -1
  26. package/dist/components/pages/SetPasswordPageHero.js +50 -33
  27. package/dist/components/pages/SetPasswordPageTailwind.d.ts +1 -1
  28. package/dist/components/pages/SignupPage.d.ts +1 -1
  29. package/dist/components/pages/SignupPageHero.d.ts +1 -1
  30. package/dist/components/pages/SignupPageHero.js +46 -34
  31. package/dist/components/pages/SignupPageTailwind.d.ts +1 -1
  32. package/dist/components/pages/VerifyOtpPage.d.ts +1 -1
  33. package/dist/components/pages/VerifyOtpPageHero.d.ts +1 -1
  34. package/dist/components/pages/VerifyOtpPageHero.js +46 -10
  35. package/dist/components/pages/VerifyOtpPageTailwind.d.ts +1 -1
  36. package/dist/components/ui/index.d.ts +2 -1
  37. package/dist/components/ui/index.js +3 -2
  38. package/dist/config.d.ts +7 -0
  39. package/dist/config.js +5 -4
  40. package/dist/exports/client.d.ts +25 -24
  41. package/dist/exports/client.js +2 -0
  42. package/dist/exports/rsc.d.ts +6 -6
  43. package/dist/index.d.ts +2 -2
  44. package/dist/index.js +5 -1
  45. package/package.json +18 -14
@@ -1,4 +1,4 @@
1
- import type { AuthLayoutConfig } from '../AuthLayout.js';
1
+ import type { AuthLayoutConfig } from '../AuthLayout';
2
2
  export interface LoginPageProps extends AuthLayoutConfig {
3
3
  onPasswordLogin: (credentials: {
4
4
  email: string;
@@ -41,7 +41,7 @@ function LoginContent({ onPasswordLogin, redirectTo = '/', showGoogleOAuth = tru
41
41
  children: [
42
42
  /*#__PURE__*/ _jsxs(Button, {
43
43
  fullWidth: true,
44
- variant: "bordered",
44
+ variant: "secondary",
45
45
  size: "lg",
46
46
  className: "mb-4",
47
47
  onPress: handleGoogleLogin,
@@ -83,7 +83,8 @@ function LoginContent({ onPasswordLogin, redirectTo = '/', showGoogleOAuth = tru
83
83
  label: "Email",
84
84
  value: email,
85
85
  onValueChange: setEmail,
86
- isRequired: true
86
+ isRequired: true,
87
+ variant: "secondary"
87
88
  }),
88
89
  /*#__PURE__*/ _jsx(Button, {
89
90
  type: "submit",
@@ -121,24 +122,14 @@ function LoginContent({ onPasswordLogin, redirectTo = '/', showGoogleOAuth = tru
121
122
  className: "bg-red-50 text-red-600 border border-red-200 rounded-lg p-3 text-sm",
122
123
  children: error
123
124
  }),
124
- /*#__PURE__*/ _jsxs("div", {
125
- className: "relative",
126
- children: [
127
- /*#__PURE__*/ _jsx(Input, {
128
- type: showPassword ? 'text' : 'password',
129
- label: "Password",
130
- value: password,
131
- onValueChange: setPassword,
132
- isRequired: true,
133
- autoFocus: true
134
- }),
135
- /*#__PURE__*/ _jsx("button", {
136
- type: "button",
137
- onClick: ()=>setShowPassword(!showPassword),
138
- className: "absolute right-4 top-9 text-gray-400 hover:text-gray-600",
139
- children: showPassword ? '🙈' : '👁'
140
- })
141
- ]
125
+ /*#__PURE__*/ _jsx(Input, {
126
+ type: showPassword ? 'text' : 'password',
127
+ label: "Password",
128
+ value: password,
129
+ onValueChange: setPassword,
130
+ isRequired: true,
131
+ autoFocus: true,
132
+ variant: "secondary"
142
133
  }),
143
134
  /*#__PURE__*/ _jsx("div", {
144
135
  className: "text-left",
@@ -1,4 +1,4 @@
1
- import type { AuthLayoutConfig } from '../AuthLayout.js';
1
+ import type { AuthLayoutConfig } from '../AuthLayout';
2
2
  export interface SetPasswordPageProps extends AuthLayoutConfig {
3
3
  redirectTo?: string;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { AuthLayoutConfig } from '../AuthLayout.js';
1
+ import type { AuthLayoutConfig } from '../AuthLayout';
2
2
  export interface SetPasswordPageHeroProps extends AuthLayoutConfig {
3
3
  redirectTo?: string;
4
4
  }
@@ -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 { useSetPasswordFlow } from '../../auth/application/hooks/useSetPasswordFlow.js';
@@ -34,29 +34,37 @@ export default function SetPasswordPageHero({ redirectTo = '/', logo, poweredBy,
34
34
  },
35
35
  children: error
36
36
  }),
37
- /*#__PURE__*/ _jsx(Input, {
37
+ /*#__PURE__*/ _jsxs(TextField, {
38
38
  type: showPassword ? 'text' : 'password',
39
- label: "New Password",
40
39
  value: password,
41
- onValueChange: setPassword,
42
- variant: "bordered",
43
- size: "lg",
40
+ onChange: setPassword,
44
41
  isRequired: true,
45
42
  autoFocus: true,
46
- classNames: {
47
- input: 'text-gray-900',
48
- label: 'text-gray-600',
49
- inputWrapper: 'border-gray-300 bg-white'
50
- },
51
- endContent: /*#__PURE__*/ _jsx("button", {
52
- type: "button",
53
- onClick: ()=>setShowPassword(!showPassword),
54
- children: /*#__PURE__*/ _jsx(Icon, {
55
- icon: showPassword ? 'lucide:eye-off' : 'lucide:eye',
56
- className: "text-gray-400",
57
- width: 20
43
+ fullWidth: true,
44
+ children: [
45
+ /*#__PURE__*/ _jsx(Label, {
46
+ className: "text-gray-600",
47
+ children: "New Password"
48
+ }),
49
+ /*#__PURE__*/ _jsxs("div", {
50
+ className: "relative",
51
+ children: [
52
+ /*#__PURE__*/ _jsx(Input, {
53
+ className: "w-full pr-10 bg-white"
54
+ }),
55
+ /*#__PURE__*/ _jsx("button", {
56
+ type: "button",
57
+ className: "absolute right-3 top-1/2 -translate-y-1/2",
58
+ onClick: ()=>setShowPassword(!showPassword),
59
+ children: /*#__PURE__*/ _jsx(Icon, {
60
+ icon: showPassword ? 'lucide:eye-off' : 'lucide:eye',
61
+ className: "text-gray-400",
62
+ width: 20
63
+ })
64
+ })
65
+ ]
58
66
  })
59
- })
67
+ ]
60
68
  }),
61
69
  password.length > 0 && /*#__PURE__*/ _jsx("div", {
62
70
  className: "flex gap-1",
@@ -64,28 +72,37 @@ export default function SetPasswordPageHero({ redirectTo = '/', logo, poweredBy,
64
72
  className: `h-1 flex-1 rounded-full ${a ? 'bg-[#D5E855]' : 'bg-gray-200'}`
65
73
  }, i))
66
74
  }),
67
- /*#__PURE__*/ _jsx(Input, {
75
+ /*#__PURE__*/ _jsxs(TextField, {
68
76
  type: showPassword ? 'text' : 'password',
69
- label: "Confirm Password",
70
77
  value: confirmPassword,
71
- onValueChange: setConfirmPassword,
72
- variant: "bordered",
73
- size: "lg",
78
+ onChange: setConfirmPassword,
74
79
  isRequired: true,
75
- classNames: {
76
- input: 'text-gray-900',
77
- label: 'text-gray-600',
78
- inputWrapper: 'border-gray-300 bg-white'
79
- }
80
+ fullWidth: true,
81
+ children: [
82
+ /*#__PURE__*/ _jsx(Label, {
83
+ className: "text-gray-600",
84
+ children: "Confirm Password"
85
+ }),
86
+ /*#__PURE__*/ _jsx(Input, {
87
+ className: "w-full bg-white"
88
+ })
89
+ ]
80
90
  }),
81
91
  /*#__PURE__*/ _jsx(Button, {
82
92
  type: "submit",
83
93
  fullWidth: true,
84
94
  size: "lg",
85
- color: "primary",
86
- isLoading: isLoading,
95
+ isPending: isLoading,
87
96
  className: "h-12 font-semibold",
88
- children: "Set Password"
97
+ children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
98
+ children: [
99
+ isPending && /*#__PURE__*/ _jsx(Spinner, {
100
+ color: "current",
101
+ size: "sm"
102
+ }),
103
+ "Set Password"
104
+ ]
105
+ })
89
106
  })
90
107
  ]
91
108
  })
@@ -1,4 +1,4 @@
1
- import type { AuthLayoutConfig } from '../AuthLayout.js';
1
+ import type { AuthLayoutConfig } from '../AuthLayout';
2
2
  export interface SetPasswordPageProps extends AuthLayoutConfig {
3
3
  redirectTo?: string;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { AuthLayoutConfig } from '../AuthLayout.js';
1
+ import type { AuthLayoutConfig } from '../AuthLayout';
2
2
  export interface SignupPageProps extends AuthLayoutConfig {
3
3
  onSignup: (data: {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import type { AuthLayoutConfig } from '../AuthLayout.js';
1
+ import type { AuthLayoutConfig } from '../AuthLayout';
2
2
  export interface SignupPageHeroProps extends AuthLayoutConfig {
3
3
  onSignup: (data: {
4
4
  name: string;
@@ -1,7 +1,7 @@
1
1
  'use client';
2
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, Divider } from '@heroui/react';
4
+ import { Button, Input, Label, TextField, Separator, Spinner } from '@heroui/react';
5
5
  import { Icon } from '@iconify/react';
6
6
  import { motion } from 'framer-motion';
7
7
  import { AuthLayout } from '../AuthLayout.js';
@@ -47,28 +47,29 @@ export default function SignupPageHero({ onSignup, showGoogleOAuth = true, login
47
47
  children: [
48
48
  showGoogleOAuth && /*#__PURE__*/ _jsxs(_Fragment, {
49
49
  children: [
50
- /*#__PURE__*/ _jsx(Button, {
50
+ /*#__PURE__*/ _jsxs(Button, {
51
51
  fullWidth: true,
52
- variant: "bordered",
53
52
  size: "lg",
54
- className: "mb-4 h-12 border-gray-300 rounded-full text-gray-700 hover:bg-gray-50",
55
- startContent: /*#__PURE__*/ _jsx(Icon, {
56
- icon: "flat-color-icons:google",
57
- width: 20
58
- }),
59
- children: "Continue with Google"
53
+ className: "mb-4 h-12 rounded-full",
54
+ children: [
55
+ /*#__PURE__*/ _jsx(Icon, {
56
+ icon: "flat-color-icons:google",
57
+ width: 20
58
+ }),
59
+ "Continue with Google"
60
+ ]
60
61
  }),
61
62
  /*#__PURE__*/ _jsxs("div", {
62
63
  className: "flex items-center gap-4 my-4",
63
64
  children: [
64
- /*#__PURE__*/ _jsx(Divider, {
65
+ /*#__PURE__*/ _jsx(Separator, {
65
66
  className: "flex-1"
66
67
  }),
67
68
  /*#__PURE__*/ _jsx("span", {
68
69
  className: "text-gray-500 text-sm",
69
70
  children: "or"
70
71
  }),
71
- /*#__PURE__*/ _jsx(Divider, {
72
+ /*#__PURE__*/ _jsx(Separator, {
72
73
  className: "flex-1"
73
74
  })
74
75
  ]
@@ -89,33 +90,37 @@ export default function SignupPageHero({ onSignup, showGoogleOAuth = true, login
89
90
  },
90
91
  children: error
91
92
  }),
92
- /*#__PURE__*/ _jsx(Input, {
93
+ /*#__PURE__*/ _jsxs(TextField, {
93
94
  type: "text",
94
- label: "Full Name",
95
95
  value: name,
96
- onValueChange: setName,
97
- variant: "bordered",
98
- size: "lg",
96
+ onChange: setName,
99
97
  isRequired: true,
100
- classNames: {
101
- input: 'text-gray-900',
102
- label: 'text-gray-600',
103
- inputWrapper: 'border-gray-300 bg-white'
104
- }
98
+ fullWidth: true,
99
+ children: [
100
+ /*#__PURE__*/ _jsx(Label, {
101
+ className: "text-gray-600",
102
+ children: "Full Name"
103
+ }),
104
+ /*#__PURE__*/ _jsx(Input, {
105
+ variant: "secondary"
106
+ })
107
+ ]
105
108
  }),
106
- /*#__PURE__*/ _jsx(Input, {
109
+ /*#__PURE__*/ _jsxs(TextField, {
107
110
  type: "email",
108
- label: "Email",
109
111
  value: email,
110
- onValueChange: setEmail,
111
- variant: "bordered",
112
- size: "lg",
112
+ onChange: setEmail,
113
113
  isRequired: true,
114
- classNames: {
115
- input: 'text-gray-900',
116
- label: 'text-gray-600',
117
- inputWrapper: 'border-gray-300 bg-white'
118
- }
114
+ fullWidth: true,
115
+ children: [
116
+ /*#__PURE__*/ _jsx(Label, {
117
+ className: "text-gray-600",
118
+ children: "Email"
119
+ }),
120
+ /*#__PURE__*/ _jsx(Input, {
121
+ variant: "secondary"
122
+ })
123
+ ]
119
124
  }),
120
125
  /*#__PURE__*/ _jsxs("p", {
121
126
  className: "text-xs text-gray-600 text-center",
@@ -138,10 +143,17 @@ export default function SignupPageHero({ onSignup, showGoogleOAuth = true, login
138
143
  type: "submit",
139
144
  fullWidth: true,
140
145
  size: "lg",
141
- color: "primary",
142
- isLoading: isLoading,
146
+ isPending: isLoading,
143
147
  className: "h-12 font-semibold",
144
- children: "Create Account"
148
+ children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
149
+ children: [
150
+ isPending && /*#__PURE__*/ _jsx(Spinner, {
151
+ color: "current",
152
+ size: "sm"
153
+ }),
154
+ "Create Account"
155
+ ]
156
+ })
145
157
  })
146
158
  ]
147
159
  })
@@ -1,4 +1,4 @@
1
- import type { AuthLayoutConfig } from '../AuthLayout.js';
1
+ import type { AuthLayoutConfig } from '../AuthLayout';
2
2
  export interface SignupPageProps extends AuthLayoutConfig {
3
3
  onSignup: (data: {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import type { AuthLayoutConfig } from '../AuthLayout.js';
1
+ import type { AuthLayoutConfig } from '../AuthLayout';
2
2
  export interface VerifyOtpPageProps extends AuthLayoutConfig {
3
3
  loginUrl?: string;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { AuthLayoutConfig } from '../AuthLayout.js';
1
+ import type { AuthLayoutConfig } from '../AuthLayout';
2
2
  export interface VerifyOtpPageHeroProps extends AuthLayoutConfig {
3
3
  loginUrl?: string;
4
4
  }
@@ -1,8 +1,8 @@
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, { Suspense } from 'react';
4
4
  import { useSearchParams } from 'next/navigation';
5
- import { Button, InputOtp, Spinner as HSpinner } from '@heroui/react';
5
+ import { Button, InputOTP, Spinner } from '@heroui/react';
6
6
  import { Icon } from '@iconify/react';
7
7
  import { motion } from 'framer-motion';
8
8
  import { useVerifyOtpFlow } from '../../auth/application/hooks/useVerifyOtpFlow.js';
@@ -43,12 +43,41 @@ function VerifyOtpHeroContent({ loginUrl = '/login', logo, poweredBy, cardClassN
43
43
  className: "text-gray-700 text-sm font-medium",
44
44
  children: email
45
45
  }),
46
- /*#__PURE__*/ _jsx(InputOtp, {
47
- length: 6,
46
+ /*#__PURE__*/ _jsxs(InputOTP, {
47
+ maxLength: 6,
48
48
  value: otp,
49
- onValueChange: setOtp,
49
+ onChange: setOtp,
50
50
  isDisabled: isLoading,
51
- autoFocus: true
51
+ autoFocus: true,
52
+ children: [
53
+ /*#__PURE__*/ _jsxs(InputOTP.Group, {
54
+ children: [
55
+ /*#__PURE__*/ _jsx(InputOTP.Slot, {
56
+ index: 0
57
+ }),
58
+ /*#__PURE__*/ _jsx(InputOTP.Slot, {
59
+ index: 1
60
+ }),
61
+ /*#__PURE__*/ _jsx(InputOTP.Slot, {
62
+ index: 2
63
+ })
64
+ ]
65
+ }),
66
+ /*#__PURE__*/ _jsx(InputOTP.Separator, {}),
67
+ /*#__PURE__*/ _jsxs(InputOTP.Group, {
68
+ children: [
69
+ /*#__PURE__*/ _jsx(InputOTP.Slot, {
70
+ index: 3
71
+ }),
72
+ /*#__PURE__*/ _jsx(InputOTP.Slot, {
73
+ index: 4
74
+ }),
75
+ /*#__PURE__*/ _jsx(InputOTP.Slot, {
76
+ index: 5
77
+ })
78
+ ]
79
+ })
80
+ ]
52
81
  }),
53
82
  error && /*#__PURE__*/ _jsx(motion.div, {
54
83
  className: "w-full bg-red-50 text-red-600 border border-red-200 rounded-lg p-3 text-sm",
@@ -63,12 +92,19 @@ function VerifyOtpHeroContent({ loginUrl = '/login', logo, poweredBy, cardClassN
63
92
  /*#__PURE__*/ _jsx(Button, {
64
93
  fullWidth: true,
65
94
  size: "lg",
66
- color: "primary",
67
- isLoading: isLoading,
95
+ isPending: isLoading,
68
96
  isDisabled: otp.length !== 6,
69
97
  onPress: handleSubmit,
70
98
  className: "h-12 font-semibold",
71
- children: "Verify"
99
+ children: ({ isPending })=>/*#__PURE__*/ _jsxs(_Fragment, {
100
+ children: [
101
+ isPending && /*#__PURE__*/ _jsx(Spinner, {
102
+ color: "current",
103
+ size: "sm"
104
+ }),
105
+ "Verify"
106
+ ]
107
+ })
72
108
  }),
73
109
  /*#__PURE__*/ _jsxs("div", {
74
110
  className: "text-center",
@@ -93,7 +129,7 @@ export default function VerifyOtpPageHero(props) {
93
129
  return /*#__PURE__*/ _jsx(Suspense, {
94
130
  fallback: /*#__PURE__*/ _jsx("div", {
95
131
  className: "min-h-screen flex items-center justify-center",
96
- children: /*#__PURE__*/ _jsx(HSpinner, {
132
+ children: /*#__PURE__*/ _jsx(Spinner, {
97
133
  size: "lg"
98
134
  })
99
135
  }),
@@ -1,4 +1,4 @@
1
- import type { AuthLayoutConfig } from '../AuthLayout.js';
1
+ import type { AuthLayoutConfig } from '../AuthLayout';
2
2
  export interface VerifyOtpPageProps extends AuthLayoutConfig {
3
3
  loginUrl?: string;
4
4
  }
@@ -8,7 +8,7 @@ interface ButtonProps {
8
8
  isDisabled?: boolean;
9
9
  onPress?: () => void;
10
10
  onClick?: () => void;
11
- variant?: 'primary' | 'bordered' | 'ghost' | 'tertiary';
11
+ variant?: 'primary' | 'secondary' | 'bordered' | 'ghost' | 'tertiary';
12
12
  className?: string;
13
13
  }
14
14
  export declare const Button: React.FC<ButtonProps>;
@@ -25,6 +25,7 @@ interface InputProps {
25
25
  placeholder?: string;
26
26
  className?: string;
27
27
  name?: string;
28
+ variant?: 'default' | 'secondary';
28
29
  }
29
30
  export declare const Input: React.FC<InputProps>;
30
31
  interface CardProps {
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  const variantClasses = {
4
4
  primary: 'bg-[#D5E855] text-gray-900 hover:bg-[#C9DC4A] font-semibold',
5
+ secondary: 'bg-gray-100 text-gray-900 hover:bg-gray-200 font-medium',
5
6
  bordered: 'border border-gray-300 text-gray-700 hover:bg-gray-50 bg-white',
6
7
  ghost: 'text-gray-600 hover:text-gray-900 bg-transparent',
7
8
  tertiary: 'text-gray-600 hover:text-gray-900 bg-transparent underline'
@@ -25,7 +26,7 @@ export const Button = ({ children, type = 'button', fullWidth = true, size = 'lg
25
26
  children
26
27
  ]
27
28
  });
28
- export const Input = ({ type = 'text', label, value, onChange, onValueChange, isRequired, isDisabled, autoFocus, autoComplete, placeholder, className = '', name })=>/*#__PURE__*/ _jsxs("div", {
29
+ export const Input = ({ type = 'text', label, value, onChange, onValueChange, isRequired, isDisabled, autoFocus, autoComplete, placeholder, className = '', name, variant = 'default' })=>/*#__PURE__*/ _jsxs("div", {
29
30
  className: "w-full",
30
31
  children: [
31
32
  label && /*#__PURE__*/ _jsxs("label", {
@@ -45,7 +46,7 @@ export const Input = ({ type = 'text', label, value, onChange, onValueChange, is
45
46
  autoComplete: autoComplete,
46
47
  placeholder: placeholder,
47
48
  name: name,
48
- className: `w-full h-12 px-4 bg-white border border-gray-300 hover:border-gray-400 rounded-xl text-gray-900 text-base transition-colors outline-none focus:border-[#D5E855] focus:ring-2 focus:ring-[#D5E855]/30 ${className}`
49
+ className: `w-full h-12 px-4 ${variant === 'secondary' ? 'bg-gray-100' : 'bg-white'} border border-gray-300 hover:border-gray-400 rounded-xl text-gray-900 text-base transition-colors outline-none focus:border-[#D5E855] focus:ring-2 focus:ring-[#D5E855]/30 ${className}`
49
50
  })
50
51
  ]
51
52
  });
package/dist/config.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type React from 'react';
1
2
  /**
2
3
  * Shared plugin configuration — set by the plugin factory at init time,
3
4
  * read by all client components at render time.
@@ -6,5 +7,11 @@ export type AuthStyle = 'tailwind' | 'hero-ui';
6
7
  export declare const pluginConfig: {
7
8
  style: AuthStyle;
8
9
  logoUrl?: string;
10
+ Logo?: React.ComponentType;
9
11
  googleOAuthEnabled: boolean;
10
12
  };
13
+ /** Call this client-side to mirror the server plugin config. */
14
+ export declare function initClientConfig(opts: {
15
+ style?: AuthStyle;
16
+ googleOAuthEnabled?: boolean;
17
+ }): void;
package/dist/config.js CHANGED
@@ -1,7 +1,8 @@
1
- /**
2
- * Shared plugin configuration — set by the plugin factory at init time,
3
- * read by all client components at render time.
4
- */ export const pluginConfig = {
1
+ export const pluginConfig = {
5
2
  style: 'tailwind',
6
3
  googleOAuthEnabled: true
7
4
  };
5
+ /** Call this client-side to mirror the server plugin config. */ export function initClientConfig(opts) {
6
+ if (opts.style) pluginConfig.style = opts.style;
7
+ if (opts.googleOAuthEnabled !== undefined) pluginConfig.googleOAuthEnabled = opts.googleOAuthEnabled;
8
+ }
@@ -1,24 +1,25 @@
1
- export { useLoginFlow } from '../auth/application/hooks/useLoginFlow.js';
2
- export { useVerifyOtpFlow } from '../auth/application/hooks/useVerifyOtpFlow.js';
3
- export { useForgotPasswordFlow } from '../auth/application/hooks/useForgotPasswordFlow.js';
4
- export { useSetPasswordFlow } from '../auth/application/hooks/useSetPasswordFlow.js';
5
- export { checkEmail, sendOtp, verifyOtp, setUserPassword, signup, initiateGoogleLogin, } from '../auth/application/services/authService.js';
6
- export { evaluatePasswordStrength, isPasswordValid, MIN_PASSWORD_LENGTH } from '../auth/domain/passwordRules.js';
7
- export { default as LoginPage } from '../components/pages/LoginPage.js';
8
- export { default as SignupPage } from '../components/pages/SignupPage.js';
9
- export { default as ForgotPasswordPage } from '../components/pages/ForgotPasswordPage.js';
10
- export { default as VerifyOtpPage } from '../components/pages/VerifyOtpPage.js';
11
- export { default as SetPasswordPage } from '../components/pages/SetPasswordPage.js';
12
- export { AuthLayout } from '../components/AuthLayout.js';
13
- export { PoweredBy } from '../components/PoweredBy.js';
14
- export type { LoginStep, OTPPurpose, CheckEmailResponse, SendOtpResponse, VerifyOtpResponse, SetPasswordResponse, SignupResponse, PasswordStrengthResult, } from '../auth/domain/types.js';
15
- export type { UseLoginFlowOptions } from '../auth/application/hooks/useLoginFlow.js';
16
- export type { UseVerifyOtpFlowOptions } from '../auth/application/hooks/useVerifyOtpFlow.js';
17
- export type { UseSetPasswordFlowOptions } from '../auth/application/hooks/useSetPasswordFlow.js';
18
- export type { LoginPageProps } from '../components/pages/LoginPage.js';
19
- export type { SignupPageProps } from '../components/pages/SignupPage.js';
20
- export type { ForgotPasswordPageProps } from '../components/pages/ForgotPasswordPage.js';
21
- export type { VerifyOtpPageProps } from '../components/pages/VerifyOtpPage.js';
22
- export type { SetPasswordPageProps } from '../components/pages/SetPasswordPage.js';
23
- export type { AuthLayoutConfig, AuthLayoutProps } from '../components/AuthLayout.js';
24
- export type { PoweredByProps } from '../components/PoweredBy.js';
1
+ export { initClientConfig } from '../config';
2
+ export { useLoginFlow } from '../auth/application/hooks/useLoginFlow';
3
+ export { useVerifyOtpFlow } from '../auth/application/hooks/useVerifyOtpFlow';
4
+ export { useForgotPasswordFlow } from '../auth/application/hooks/useForgotPasswordFlow';
5
+ export { useSetPasswordFlow } from '../auth/application/hooks/useSetPasswordFlow';
6
+ export { checkEmail, sendOtp, verifyOtp, setUserPassword, signup, initiateGoogleLogin, } from '../auth/application/services/authService';
7
+ export { evaluatePasswordStrength, isPasswordValid, MIN_PASSWORD_LENGTH } from '../auth/domain/passwordRules';
8
+ export { default as LoginPage } from '../components/pages/LoginPage';
9
+ export { default as SignupPage } from '../components/pages/SignupPage';
10
+ export { default as ForgotPasswordPage } from '../components/pages/ForgotPasswordPage';
11
+ export { default as VerifyOtpPage } from '../components/pages/VerifyOtpPage';
12
+ export { default as SetPasswordPage } from '../components/pages/SetPasswordPage';
13
+ export { AuthLayout } from '../components/AuthLayout';
14
+ export { PoweredBy } from '../components/PoweredBy';
15
+ export type { LoginStep, OTPPurpose, CheckEmailResponse, SendOtpResponse, VerifyOtpResponse, SetPasswordResponse, SignupResponse, PasswordStrengthResult, } from '../auth/domain/types';
16
+ export type { UseLoginFlowOptions } from '../auth/application/hooks/useLoginFlow';
17
+ export type { UseVerifyOtpFlowOptions } from '../auth/application/hooks/useVerifyOtpFlow';
18
+ export type { UseSetPasswordFlowOptions } from '../auth/application/hooks/useSetPasswordFlow';
19
+ export type { LoginPageProps } from '../components/pages/LoginPage';
20
+ export type { SignupPageProps } from '../components/pages/SignupPage';
21
+ export type { ForgotPasswordPageProps } from '../components/pages/ForgotPasswordPage';
22
+ export type { VerifyOtpPageProps } from '../components/pages/VerifyOtpPage';
23
+ export type { SetPasswordPageProps } from '../components/pages/SetPasswordPage';
24
+ export type { AuthLayoutConfig, AuthLayoutProps } from '../components/AuthLayout';
25
+ export type { PoweredByProps } from '../components/PoweredBy';
@@ -2,6 +2,8 @@
2
2
  // ============================================================
3
3
  // Client-side exports for @main12/auth-login/client
4
4
  // ============================================================
5
+ // Plugin client config initializer
6
+ export { initClientConfig } from '../config.js';
5
7
  // Auth hooks
6
8
  export { useLoginFlow } from '../auth/application/hooks/useLoginFlow.js';
7
9
  export { useVerifyOtpFlow } from '../auth/application/hooks/useVerifyOtpFlow.js';
@@ -1,6 +1,6 @@
1
- export { wrapInBaseTemplate, DEFAULT_COLORS, SOCIAL_ICONS, getBaseUrl, getSenderEmail, getEmailTranslations, generateOtpEmail, generateWelcomeEmail, generatePasswordResetEmail, generatePasswordChangedEmail, } from '../components/email/index.js';
2
- export type { BaseTemplateOptions, } from '../components/email/baseTemplate.js';
3
- export type { EmailColors, SocialLink, SocialPlatform, } from '../components/email/constants.js';
4
- export type { SupportedLanguage, EmailTranslations, } from '../components/email/translations.js';
5
- export type { OtpEmailParams, OtpEmailResult, WelcomeEmailParams, WelcomeEmailResult, PasswordResetEmailParams, PasswordResetEmailResult, PasswordChangedEmailParams, PasswordChangedEmailResult, } from '../components/email/index.js';
6
- export type { AuthLoginPluginOptions } from '../index.js';
1
+ export { wrapInBaseTemplate, DEFAULT_COLORS, SOCIAL_ICONS, getBaseUrl, getSenderEmail, getEmailTranslations, generateOtpEmail, generateWelcomeEmail, generatePasswordResetEmail, generatePasswordChangedEmail, } from '../components/email/index';
2
+ export type { BaseTemplateOptions, } from '../components/email/baseTemplate';
3
+ export type { EmailColors, SocialLink, SocialPlatform, } from '../components/email/constants';
4
+ export type { SupportedLanguage, EmailTranslations, } from '../components/email/translations';
5
+ export type { OtpEmailParams, OtpEmailResult, WelcomeEmailParams, WelcomeEmailResult, PasswordResetEmailParams, PasswordResetEmailResult, PasswordChangedEmailParams, PasswordChangedEmailResult, } from '../components/email/index';
6
+ export type { AuthLoginPluginOptions } from '../index';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Config } from 'payload';
2
- import { pluginConfig, type AuthStyle } from './config.js';
2
+ import { pluginConfig, type AuthStyle } from './config';
3
3
  export interface GoogleOAuthConfig {
4
4
  /** Client ID from Google Cloud Console */
5
5
  clientId?: string;
@@ -17,7 +17,7 @@ export interface AuthLoginPluginOptions {
17
17
  contactEmail?: string;
18
18
  domain?: string;
19
19
  style?: AuthStyle;
20
- logo?: string;
20
+ logo?: string | React.ComponentType;
21
21
  /**
22
22
  * OAuth providers configuration.
23
23
  * - Omit entirely → auto-detect from env vars (GOOGLE_CLIENT_ID, etc.)