@better-auth-ui/core 1.6.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 (97) hide show
  1. package/dist/base-paths.d.ts +21 -0
  2. package/dist/base-paths.js +5 -0
  3. package/dist/config/appearance-config.d.ts +23 -0
  4. package/dist/config/appearance-config.js +1 -0
  5. package/dist/config/auth-config.d.ts +87 -0
  6. package/dist/config/auth-config.js +35 -0
  7. package/dist/config/avatar-config.d.ts +35 -0
  8. package/dist/config/avatar-config.js +1 -0
  9. package/dist/config/delete-user-config.d.ts +14 -0
  10. package/dist/config/delete-user-config.js +1 -0
  11. package/dist/config/email-and-password-config.d.ts +37 -0
  12. package/dist/config/email-and-password-config.js +1 -0
  13. package/dist/config/index.d.ts +5 -0
  14. package/dist/config/index.js +5 -0
  15. package/dist/config/settings-config.d.ts +17 -0
  16. package/dist/config/settings-config.js +1 -0
  17. package/dist/config/toast-config.d.ts +58 -0
  18. package/dist/config/toast-config.js +16 -0
  19. package/dist/index.d.ts +6 -0
  20. package/dist/index.js +6 -0
  21. package/dist/lib/auth-callback-options.d.ts +8 -0
  22. package/dist/lib/auth-callback-options.js +1 -0
  23. package/dist/lib/auth-config.d.ts +198 -0
  24. package/dist/lib/auth-config.js +36 -0
  25. package/dist/lib/auth-error.d.ts +9 -0
  26. package/dist/lib/auth-error.js +1 -0
  27. package/dist/lib/auth-hook-options.d.ts +8 -0
  28. package/dist/lib/auth-hook-options.js +1 -0
  29. package/dist/lib/auth-toast.d.ts +24 -0
  30. package/dist/lib/auth-toast.js +10 -0
  31. package/dist/lib/base-paths.d.ts +21 -0
  32. package/dist/lib/base-paths.js +5 -0
  33. package/dist/lib/config/appearance-config.d.ts +23 -0
  34. package/dist/lib/config/appearance-config.js +1 -0
  35. package/dist/lib/config/auth-config.d.ts +70 -0
  36. package/dist/lib/config/auth-config.js +36 -0
  37. package/dist/lib/config/avatar-config.d.ts +35 -0
  38. package/dist/lib/config/avatar-config.js +1 -0
  39. package/dist/lib/config/email-and-password-config.d.ts +37 -0
  40. package/dist/lib/config/email-and-password-config.js +1 -0
  41. package/dist/lib/config/index.d.ts +6 -0
  42. package/dist/lib/config/index.js +6 -0
  43. package/dist/lib/config/settings-config.d.ts +22 -0
  44. package/dist/lib/config/settings-config.js +1 -0
  45. package/dist/lib/config/toast-config.d.ts +24 -0
  46. package/dist/lib/config/toast-config.js +10 -0
  47. package/dist/lib/localization.d.ts +175 -0
  48. package/dist/lib/localization.js +172 -0
  49. package/dist/lib/provider-names.d.ts +12 -0
  50. package/dist/lib/provider-names.js +50 -0
  51. package/dist/lib/toast-config.d.ts +24 -0
  52. package/dist/lib/toast-config.js +10 -0
  53. package/dist/lib/utils.d.ts +32 -0
  54. package/dist/lib/utils.js +116 -0
  55. package/dist/lib/view-paths.d.ts +68 -0
  56. package/dist/lib/view-paths.js +14 -0
  57. package/dist/localization/index.d.ts +35 -0
  58. package/dist/localization/index.js +34 -0
  59. package/dist/localization/localization.d.ts +35 -0
  60. package/dist/localization/localization.js +34 -0
  61. package/dist/localization.d.ts +159 -0
  62. package/dist/localization.js +156 -0
  63. package/dist/provider-names.d.ts +12 -0
  64. package/dist/provider-names.js +50 -0
  65. package/dist/src/index.d.ts +7 -0
  66. package/dist/src/index.js +7 -0
  67. package/dist/src/lib/auth-config.d.ts +148 -0
  68. package/dist/src/lib/auth-config.js +28 -0
  69. package/dist/src/lib/auth-toast.d.ts +24 -0
  70. package/dist/src/lib/auth-toast.js +10 -0
  71. package/dist/src/lib/base-paths.d.ts +9 -0
  72. package/dist/src/lib/base-paths.js +9 -0
  73. package/dist/src/lib/localization.d.ts +145 -0
  74. package/dist/src/lib/localization.js +142 -0
  75. package/dist/src/lib/provider-names.d.ts +12 -0
  76. package/dist/src/lib/provider-names.js +49 -0
  77. package/dist/src/lib/utils.d.ts +1 -0
  78. package/dist/src/lib/utils.js +30 -0
  79. package/dist/src/lib/view-paths.d.ts +30 -0
  80. package/dist/src/lib/view-paths.js +17 -0
  81. package/dist/utils.d.ts +3 -0
  82. package/dist/utils.js +80 -0
  83. package/dist/view-paths.d.ts +30 -0
  84. package/dist/view-paths.js +17 -0
  85. package/package.json +32 -0
  86. package/src/config/appearance-config.ts +24 -0
  87. package/src/config/auth-config.ts +117 -0
  88. package/src/config/avatar-config.ts +39 -0
  89. package/src/config/delete-user-config.ts +14 -0
  90. package/src/config/email-and-password-config.ts +37 -0
  91. package/src/config/index.ts +5 -0
  92. package/src/index.ts +6 -0
  93. package/src/lib/base-paths.ts +26 -0
  94. package/src/lib/localization.ts +259 -0
  95. package/src/lib/provider-names.ts +55 -0
  96. package/src/lib/utils.ts +151 -0
  97. package/src/lib/view-paths.ts +86 -0
@@ -0,0 +1,172 @@
1
+ export const localization = {
2
+ auth: {
3
+ /** @remarks `"Account"` */
4
+ account: "Account",
5
+ /** @remarks `"Add Account"` */
6
+ addAccount: "Add Account",
7
+ /** @remarks `"Already have an account?"` */
8
+ alreadyHaveAnAccount: "Already have an account?",
9
+ /** @remarks `"Confirm password"` */
10
+ confirmPassword: "Confirm password",
11
+ /** @remarks `"Confirm your password"` */
12
+ confirmPasswordPlaceholder: "Confirm your password",
13
+ /** @remarks `"Continue with {{provider}}"` */
14
+ continueWith: "Continue with {{provider}}",
15
+ /** @remarks `"Email"` */
16
+ email: "Email",
17
+ /** @remarks `"Enter your email"` */
18
+ emailPlaceholder: "Enter your email",
19
+ /** @remarks `"Forgot Password"` */
20
+ forgotPassword: "Forgot Password",
21
+ /** @remarks `"Forgot password?"` */
22
+ forgotPasswordLink: "Forgot password?",
23
+ /** @remarks `"Hide password"` */
24
+ hidePassword: "Hide password",
25
+ /** @remarks `"Invalid reset password token"` */
26
+ invalidResetPasswordToken: "Invalid reset password token",
27
+ /** @remarks `"Magic Link"` */
28
+ magicLink: "Magic Link",
29
+ /** @remarks `"Magic link sent to your email"` */
30
+ magicLinkSent: "Magic link sent to your email",
31
+ /** @remarks `"Name"` */
32
+ name: "Name",
33
+ /** @remarks `"Enter your name"` */
34
+ namePlaceholder: "Enter your name",
35
+ /** @remarks `"Need to create an account?"` */
36
+ needToCreateAnAccount: "Need to create an account?",
37
+ /** @remarks `"New password"` */
38
+ newPassword: "New password",
39
+ /** @remarks `"Enter your new password"` */
40
+ newPasswordPlaceholder: "Enter your new password",
41
+ /** @remarks `"OR"` */
42
+ or: "OR",
43
+ /** @remarks `"Password"` */
44
+ password: "Password",
45
+ /** @remarks `"Enter your password"` */
46
+ passwordPlaceholder: "Enter your password",
47
+ /** @remarks `"Password reset email sent"` */
48
+ passwordResetEmailSent: "Password reset email sent",
49
+ /** @remarks `"Password reset successfully"` */
50
+ passwordResetSuccess: "Password reset successfully",
51
+ /** @remarks `"Passwords do not match"` */
52
+ passwordsDoNotMatch: "Passwords do not match",
53
+ /** @remarks `"Remember me"` */
54
+ rememberMe: "Remember me",
55
+ /** @remarks `"Remember your password?"` */
56
+ rememberYourPassword: "Remember your password?",
57
+ /** @remarks `"Resend"` */
58
+ resend: "Resend",
59
+ /** @remarks `"Reset Password"` */
60
+ resetPassword: "Reset Password",
61
+ /** @remarks `"Send Magic Link"` */
62
+ sendMagicLink: "Send Magic Link",
63
+ /** @remarks `"Send reset link"` */
64
+ sendResetLink: "Send reset link",
65
+ /** @remarks `"Show password"` */
66
+ showPassword: "Show password",
67
+ /** @remarks `"Sign In"` */
68
+ signIn: "Sign In",
69
+ /** @remarks `"Sign Out"` */
70
+ signOut: "Sign Out",
71
+ /** @remarks `"Sign Up"` */
72
+ signUp: "Sign Up",
73
+ /** @remarks `"Switch Account"` */
74
+ switchAccount: "Switch Account",
75
+ /** @remarks `"Verification email sent!"` */
76
+ verificationEmailSent: "Verification email sent!",
77
+ /** @remarks `"Verify your email"` */
78
+ verifyYourEmail: "Verify your email"
79
+ },
80
+ settings: {
81
+ /** @remarks `"Account"` */
82
+ account: "Account",
83
+ /** @remarks `"Account unlinked"` */
84
+ accountUnlinked: "Account unlinked",
85
+ /** @remarks `"Active"` */
86
+ active: "Active",
87
+ /** @remarks `"Active sessions"` */
88
+ activeSessions: "Active sessions",
89
+ /** @remarks `"Avatar"` */
90
+ avatar: "Avatar",
91
+ /** @remarks `"Current session"` */
92
+ currentSession: "Current session",
93
+ /** @remarks `"Avatar changed successfully"` */
94
+ avatarChangedSuccess: "Avatar changed successfully",
95
+ /** @remarks `"Avatar deleted successfully"` */
96
+ avatarDeletedSuccess: "Avatar deleted successfully",
97
+ /** @remarks `"Change avatar"` */
98
+ changeAvatar: "Change avatar",
99
+ /** @remarks `"Delete avatar"` */
100
+ deleteAvatar: "Delete avatar",
101
+ /** @remarks `"Link"` */
102
+ link: "Link",
103
+ /** @remarks `"Linked accounts"` */
104
+ linkedAccounts: "Linked accounts",
105
+ /** @remarks `"Link your {{provider}} account"` */
106
+ linkProvider: "Link your {{provider}} account",
107
+ /** @remarks `"Appearance"` */
108
+ appearance: "Appearance",
109
+ /** @remarks `"Cancel"` */
110
+ cancel: "Cancel",
111
+ /** @remarks `"Change email"` */
112
+ changeEmail: "Change email",
113
+ /** @remarks `"Check your email to confirm the change"` */
114
+ changeEmailSuccess: "Check your email to confirm the change",
115
+ /** @remarks `"Change password"` */
116
+ changePassword: "Change password",
117
+ /** @remarks `"Password changed successfully"` */
118
+ changePasswordSuccess: "Password changed successfully",
119
+ /** @remarks `"Current password"` */
120
+ currentPassword: "Current password",
121
+ /** @remarks `"Enter your current password"` */
122
+ currentPasswordPlaceholder: "Enter your current password",
123
+ /** @remarks `"Dark"` */
124
+ dark: "Dark",
125
+ /** @remarks `"Danger zone"` */
126
+ dangerZone: "Danger zone",
127
+ /** @remarks `"Delete user"` */
128
+ deleteUser: "Delete user",
129
+ /** @remarks `"Permanently remove your account and all associated data. This cannot be undone."` */
130
+ deleteUserDescription: "Permanently remove your account and all associated data. This cannot be undone.",
131
+ /** @remarks `"Check your email to confirm account deletion."` */
132
+ deleteUserVerificationSent: "Check your email to confirm account deletion.",
133
+ /** @remarks `"Your account has been deleted."` */
134
+ deleteUserSuccess: "Your account has been deleted.",
135
+ /** @remarks `"Light"` */
136
+ light: "Light",
137
+ /** @remarks `"Manage accounts"` */
138
+ manageAccounts: "Manage accounts",
139
+ /** @remarks `"Profile"` */
140
+ profile: "Profile",
141
+ /** @remarks `"Profile updated successfully"` */
142
+ profileUpdatedSuccess: "Profile updated successfully",
143
+ /** @remarks `"Revoke"` */
144
+ revoke: "Revoke",
145
+ /** @remarks `"Revoke session"` */
146
+ revokeSession: "Revoke session",
147
+ /** @remarks `"Session revoked successfully"` */
148
+ revokeSessionSuccess: "Session revoked successfully",
149
+ /** @remarks `"Save changes"` */
150
+ saveChanges: "Save changes",
151
+ /** @remarks `"Set password"` */
152
+ setPassword: "Set password",
153
+ /** @remarks `"You don't have a password yet. Request a reset link to set one up."` */
154
+ setPasswordDescription: "You don't have a password yet. Request a reset link to set one up.",
155
+ /** @remarks `"Security"` */
156
+ security: "Security",
157
+ /** @remarks `"Settings"` */
158
+ settings: "Settings",
159
+ /** @remarks `"System"` */
160
+ system: "System",
161
+ /** @remarks `"Theme"` */
162
+ theme: "Theme",
163
+ /** @remarks `"Unlink {{provider}}"` */
164
+ unlinkProvider: "Unlink {{provider}}",
165
+ /** @remarks `"Update email"` */
166
+ updateEmail: "Update email",
167
+ /** @remarks `"Update password"` */
168
+ updatePassword: "Update password",
169
+ /** @remarks `"Upload avatar"` */
170
+ uploadAvatar: "Upload avatar"
171
+ }
172
+ };
@@ -0,0 +1,12 @@
1
+ import type { SocialProvider } from "better-auth/social-providers";
2
+ /**
3
+ * Mapping of social authentication provider identifiers to their human-readable display names.
4
+ */
5
+ export declare const providerNames: Record<SocialProvider, string>;
6
+ /**
7
+ * Get the human-readable display name for an authentication provider.
8
+ *
9
+ * @param provider - The provider identifier (e.g., "github", "google").
10
+ * @returns The mapped display name for `provider` if available, otherwise `provider` with its first character capitalized.
11
+ */
12
+ export declare function getProviderName(provider: string): string;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Mapping of social authentication provider identifiers to their human-readable display names.
3
+ */
4
+ export const providerNames = {
5
+ apple: "Apple",
6
+ atlassian: "Atlassian",
7
+ cognito: "Cognito",
8
+ discord: "Discord",
9
+ dropbox: "Dropbox",
10
+ facebook: "Facebook",
11
+ figma: "Figma",
12
+ github: "GitHub",
13
+ gitlab: "GitLab",
14
+ google: "Google",
15
+ huggingface: "Hugging Face",
16
+ kakao: "Kakao",
17
+ kick: "Kick",
18
+ line: "LINE",
19
+ linear: "Linear",
20
+ linkedin: "LinkedIn",
21
+ microsoft: "Microsoft",
22
+ naver: "Naver",
23
+ notion: "Notion",
24
+ paybin: "Paybin",
25
+ paypal: "PayPal",
26
+ polar: "Polar",
27
+ railway: "Railway",
28
+ reddit: "Reddit",
29
+ roblox: "Roblox",
30
+ salesforce: "Salesforce",
31
+ slack: "Slack",
32
+ spotify: "Spotify",
33
+ tiktok: "TikTok",
34
+ twitch: "Twitch",
35
+ twitter: "X",
36
+ vercel: "Vercel",
37
+ vk: "VK",
38
+ wechat: "WeChat",
39
+ zoom: "Zoom"
40
+ };
41
+ /**
42
+ * Get the human-readable display name for an authentication provider.
43
+ *
44
+ * @param provider - The provider identifier (e.g., "github", "google").
45
+ * @returns The mapped display name for `provider` if available, otherwise `provider` with its first character capitalized.
46
+ */
47
+ export function getProviderName(provider) {
48
+ return (providerNames[provider] ||
49
+ provider.charAt(0).toUpperCase() + provider.slice(1));
50
+ }
@@ -0,0 +1,24 @@
1
+ export type RenderToast = (message?: string, options?: {
2
+ action?: {
3
+ label: string;
4
+ onClick: () => Promise<void> | void;
5
+ };
6
+ actionProps?: {
7
+ children: string;
8
+ onClick: () => Promise<void> | void;
9
+ };
10
+ }) => string | number | unknown;
11
+ export type DismissToast = (id?: number | string | unknown | any) => string | number | unknown;
12
+ export declare const defaultToast: RenderToast;
13
+ export type ToastConfig = {
14
+ /** Display an error toast notification */
15
+ error: RenderToast;
16
+ /** Display a danger toast notification */
17
+ danger?: RenderToast;
18
+ /** Display a success toast notification */
19
+ success: RenderToast;
20
+ /** Display an info toast notification */
21
+ info: RenderToast;
22
+ /** Optional function to dismiss a toast notification by its ID */
23
+ dismiss?: DismissToast;
24
+ };
@@ -0,0 +1,10 @@
1
+ export const defaultToast = (message, options) => {
2
+ if (options?.action) {
3
+ if (confirm(message)) {
4
+ options.action.onClick();
5
+ }
6
+ }
7
+ else {
8
+ alert(message);
9
+ }
10
+ };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Resize and square-crop an image file for use as an avatar.
3
+ *
4
+ * The image is center-cropped to a square, scaled down to at most {@link size} pixels,
5
+ * and converted to the specified output format.
6
+ *
7
+ * @param file - The source image file.
8
+ * @param size - Max dimension in pixels for the output image.
9
+ * @param extension - Output format. Use `"inherit"` to keep the original format.
10
+ * @returns A promise that resolves to the processed `File`.
11
+ */
12
+ export declare function resizeAvatar(file: File, size?: number, extension?: "png" | "jpg" | "webp" | "inherit"): Promise<File>;
13
+ /**
14
+ * Convert a `File` to a base64-encoded data URL string.
15
+ *
16
+ * @param file - The file to encode.
17
+ * @returns A promise that resolves to the base64 data URL.
18
+ */
19
+ export declare function fileToBase64(file: File): Promise<string>;
20
+ /**
21
+ * Recursively merge `source` into `target`, producing a new object.
22
+ *
23
+ * - Plain objects are merged key-by-key; nested objects are merged recursively.
24
+ * - `undefined` values in `source` are skipped (existing `target` values are preserved).
25
+ * - Non-plain values (arrays, `Date`, `RegExp`, primitives, functions) in `source`
26
+ * replace the corresponding `target` value outright.
27
+ *
28
+ * @param target - The base object.
29
+ * @param source - Partial overrides to apply on top of `target`.
30
+ * @returns A new merged object of type `T`.
31
+ */
32
+ export declare function deepmerge<T>(target: T, source: Partial<T>): T;
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Type guard that checks whether a value is a non-null, non-array object.
3
+ */
4
+ function isObject(item) {
5
+ return item !== null && typeof item === "object" && !Array.isArray(item);
6
+ }
7
+ /**
8
+ * Type guard that checks whether a value is a plain object suitable for deep merging.
9
+ * Excludes `Date`, `RegExp`, and other special object types.
10
+ */
11
+ function isPlainObject(item) {
12
+ if (!isObject(item))
13
+ return false;
14
+ // Handle special object types that should not be merged
15
+ if (item instanceof Date)
16
+ return false;
17
+ if (item instanceof RegExp)
18
+ return false;
19
+ return true;
20
+ }
21
+ /**
22
+ * Resize and square-crop an image file for use as an avatar.
23
+ *
24
+ * The image is center-cropped to a square, scaled down to at most {@link size} pixels,
25
+ * and converted to the specified output format.
26
+ *
27
+ * @param file - The source image file.
28
+ * @param size - Max dimension in pixels for the output image.
29
+ * @param extension - Output format. Use `"inherit"` to keep the original format.
30
+ * @returns A promise that resolves to the processed `File`.
31
+ */
32
+ export function resizeAvatar(file, size = 256, extension = "png") {
33
+ const MAX_SIZE = size;
34
+ const resolvedExtension = extension === "inherit" ? file.name.split(".").pop() : extension;
35
+ const mimeType = extension === "inherit"
36
+ ? file.type
37
+ : `image/${extension === "jpg" ? "jpeg" : extension}`;
38
+ return new Promise((resolve, reject) => {
39
+ const img = new Image();
40
+ const url = URL.createObjectURL(file);
41
+ img.onload = () => {
42
+ URL.revokeObjectURL(url);
43
+ const { naturalWidth: w, naturalHeight: h } = img;
44
+ const side = Math.min(w, h);
45
+ const cropX = (w - side) / 2;
46
+ const cropY = (h - side) / 2;
47
+ const outSize = Math.min(side, MAX_SIZE);
48
+ const canvas = document.createElement("canvas");
49
+ canvas.width = outSize;
50
+ canvas.height = outSize;
51
+ const ctx = canvas.getContext("2d");
52
+ if (!ctx) {
53
+ reject(new Error("Could not get canvas context"));
54
+ return;
55
+ }
56
+ ctx.drawImage(img, cropX, cropY, side, side, 0, 0, outSize, outSize);
57
+ canvas.toBlob((blob) => {
58
+ if (!blob) {
59
+ reject(new Error("Could not create blob from canvas"));
60
+ return;
61
+ }
62
+ resolve(new File([blob], file.name.replace(/\.[^.]+$/, `.${resolvedExtension}`), {
63
+ type: mimeType
64
+ }));
65
+ }, mimeType, 1);
66
+ };
67
+ img.onerror = () => {
68
+ URL.revokeObjectURL(url);
69
+ reject(new Error("Failed to load image"));
70
+ };
71
+ img.src = url;
72
+ });
73
+ }
74
+ /**
75
+ * Convert a `File` to a base64-encoded data URL string.
76
+ *
77
+ * @param file - The file to encode.
78
+ * @returns A promise that resolves to the base64 data URL.
79
+ */
80
+ export function fileToBase64(file) {
81
+ return new Promise((resolve, reject) => {
82
+ const reader = new FileReader();
83
+ reader.onload = () => resolve(reader.result);
84
+ reader.onerror = () => reject(new Error("Failed to read file"));
85
+ reader.readAsDataURL(file);
86
+ });
87
+ }
88
+ /**
89
+ * Recursively merge `source` into `target`, producing a new object.
90
+ *
91
+ * - Plain objects are merged key-by-key; nested objects are merged recursively.
92
+ * - `undefined` values in `source` are skipped (existing `target` values are preserved).
93
+ * - Non-plain values (arrays, `Date`, `RegExp`, primitives, functions) in `source`
94
+ * replace the corresponding `target` value outright.
95
+ *
96
+ * @param target - The base object.
97
+ * @param source - Partial overrides to apply on top of `target`.
98
+ * @returns A new merged object of type `T`.
99
+ */
100
+ export function deepmerge(target, source) {
101
+ if (isPlainObject(target) && isPlainObject(source)) {
102
+ const result = { ...target };
103
+ for (const [key, value] of Object.entries(source)) {
104
+ if (value === undefined)
105
+ continue; // skip undefineds
106
+ if (key in target) {
107
+ result[key] = deepmerge(target[key], value);
108
+ }
109
+ else {
110
+ result[key] = value;
111
+ }
112
+ }
113
+ return result;
114
+ }
115
+ return source;
116
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * View path segments for authentication routes.
3
+ */
4
+ export type AuthViewPaths = {
5
+ /**
6
+ * Path segment for the sign-in view
7
+ * @default "sign-in"
8
+ */
9
+ signIn: string;
10
+ /**
11
+ * Path segment for the sign-up view
12
+ * @default "sign-up"
13
+ */
14
+ signUp: string;
15
+ /**
16
+ * Path segment for the magic link authentication view
17
+ * @default "magic-link"
18
+ */
19
+ magicLink: string;
20
+ /**
21
+ * Path segment for the forgot password view
22
+ * @default "forgot-password"
23
+ */
24
+ forgotPassword: string;
25
+ /**
26
+ * Path segment for the reset password view
27
+ * @default "reset-password"
28
+ */
29
+ resetPassword: string;
30
+ /**
31
+ * Path segment for the sign-out view
32
+ * @default "sign-out"
33
+ */
34
+ signOut: string;
35
+ };
36
+ /**
37
+ * View path segments for settings routes.
38
+ */
39
+ export type SettingsViewPaths = {
40
+ /**
41
+ * Path segment for the account settings view
42
+ * @default "account"
43
+ */
44
+ account: string;
45
+ /**
46
+ * Path segment for the security settings view
47
+ * @default "security"
48
+ */
49
+ security: string;
50
+ };
51
+ /**
52
+ * View path configuration for authentication and settings routes.
53
+ */
54
+ export type ViewPaths = {
55
+ /** Auth view path segments */
56
+ auth: AuthViewPaths;
57
+ /** Settings view path segments */
58
+ settings: SettingsViewPaths;
59
+ };
60
+ export declare const viewPaths: ViewPaths;
61
+ /**
62
+ * Valid auth view key.
63
+ */
64
+ export type AuthView = keyof AuthViewPaths;
65
+ /**
66
+ * Valid settings view key.
67
+ */
68
+ export type SettingsView = keyof SettingsViewPaths;
@@ -0,0 +1,14 @@
1
+ export const viewPaths = {
2
+ auth: {
3
+ signIn: "sign-in",
4
+ signUp: "sign-up",
5
+ magicLink: "magic-link",
6
+ forgotPassword: "forgot-password",
7
+ resetPassword: "reset-password",
8
+ signOut: "sign-out"
9
+ },
10
+ settings: {
11
+ account: "account",
12
+ security: "security"
13
+ }
14
+ };
@@ -0,0 +1,35 @@
1
+ export declare const localization: {
2
+ auth: {
3
+ alreadyHaveAnAccount: string;
4
+ continueWith: string;
5
+ email: string;
6
+ emailPlaceholder: string;
7
+ forgotPassword: string;
8
+ invalidResetPasswordToken: string;
9
+ magicLink: string;
10
+ magicLinkSent: string;
11
+ name: string;
12
+ namePlaceholder: string;
13
+ newPassword: string;
14
+ newPasswordPlaceholder: string;
15
+ password: string;
16
+ passwordPlaceholder: string;
17
+ passwordResetEmailSent: string;
18
+ passwordResetSuccess: string;
19
+ needToCreateAnAccount: string;
20
+ or: string;
21
+ rememberYourPassword: string;
22
+ rememberMe: string;
23
+ resend: string;
24
+ resetPassword: string;
25
+ sendMagicLink: string;
26
+ sendResetLink: string;
27
+ /** @default "Sign In" */
28
+ signIn: string;
29
+ /** @default "Sign Up" */
30
+ signUp: string;
31
+ verificationEmailSent: string;
32
+ verifyYourEmail: string;
33
+ };
34
+ };
35
+ export type Localization = typeof localization;
@@ -0,0 +1,34 @@
1
+ export const localization = {
2
+ auth: {
3
+ alreadyHaveAnAccount: "Already have an account?",
4
+ continueWith: "Continue with {{provider}}",
5
+ email: "Email",
6
+ emailPlaceholder: "Enter your email",
7
+ forgotPassword: "Forgot password?",
8
+ invalidResetPasswordToken: "Invalid reset password token",
9
+ magicLink: "Magic link",
10
+ magicLinkSent: "Magic link sent to your email",
11
+ name: "Name",
12
+ namePlaceholder: "Enter your name",
13
+ newPassword: "New password",
14
+ newPasswordPlaceholder: "Enter your new password",
15
+ password: "Password",
16
+ passwordPlaceholder: "Enter your password",
17
+ passwordResetEmailSent: "Password reset email sent",
18
+ passwordResetSuccess: "Password reset successfully",
19
+ needToCreateAnAccount: "Need to create an account?",
20
+ or: "OR",
21
+ rememberYourPassword: "Remember your password?",
22
+ rememberMe: "Remember me",
23
+ resend: "Resend",
24
+ resetPassword: "Reset Password",
25
+ sendMagicLink: "Send Magic Link",
26
+ sendResetLink: "Send Reset Link",
27
+ /** @default "Sign In" */
28
+ signIn: "Sign In",
29
+ /** @default "Sign Up" */
30
+ signUp: "Sign Up",
31
+ verificationEmailSent: "Verification email sent!",
32
+ verifyYourEmail: "Verify your email"
33
+ }
34
+ };
@@ -0,0 +1,35 @@
1
+ export declare const localization: {
2
+ auth: {
3
+ alreadyHaveAnAccount: string;
4
+ continueWith: string;
5
+ email: string;
6
+ emailPlaceholder: string;
7
+ forgotPassword: string;
8
+ invalidResetPasswordToken: string;
9
+ magicLink: string;
10
+ magicLinkSent: string;
11
+ name: string;
12
+ namePlaceholder: string;
13
+ newPassword: string;
14
+ newPasswordPlaceholder: string;
15
+ password: string;
16
+ passwordPlaceholder: string;
17
+ passwordResetEmailSent: string;
18
+ passwordResetSuccess: string;
19
+ needToCreateAnAccount: string;
20
+ or: string;
21
+ rememberYourPassword: string;
22
+ rememberMe: string;
23
+ resend: string;
24
+ resetPassword: string;
25
+ sendMagicLink: string;
26
+ sendResetLink: string;
27
+ /** @default "Sign In" */
28
+ signIn: string;
29
+ /** @default "Sign Up" */
30
+ signUp: string;
31
+ verificationEmailSent: string;
32
+ verifyYourEmail: string;
33
+ };
34
+ };
35
+ export type Localization = typeof localization;
@@ -0,0 +1,34 @@
1
+ export const localization = {
2
+ auth: {
3
+ alreadyHaveAnAccount: "Already have an account?",
4
+ continueWith: "Continue with {{provider}}",
5
+ email: "Email",
6
+ emailPlaceholder: "Enter your email",
7
+ forgotPassword: "Forgot password?",
8
+ invalidResetPasswordToken: "Invalid reset password token",
9
+ magicLink: "Magic link",
10
+ magicLinkSent: "Magic link sent to your email",
11
+ name: "Name",
12
+ namePlaceholder: "Enter your name",
13
+ newPassword: "New password",
14
+ newPasswordPlaceholder: "Enter your new password",
15
+ password: "Password",
16
+ passwordPlaceholder: "Enter your password",
17
+ passwordResetEmailSent: "Password reset email sent",
18
+ passwordResetSuccess: "Password reset successfully",
19
+ needToCreateAnAccount: "Need to create an account?",
20
+ or: "OR",
21
+ rememberYourPassword: "Remember your password?",
22
+ rememberMe: "Remember me",
23
+ resend: "Resend",
24
+ resetPassword: "Reset Password",
25
+ sendMagicLink: "Send Magic Link",
26
+ sendResetLink: "Send Reset Link",
27
+ /** @default "Sign In" */
28
+ signIn: "Sign In",
29
+ /** @default "Sign Up" */
30
+ signUp: "Sign Up",
31
+ verificationEmailSent: "Verification email sent!",
32
+ verifyYourEmail: "Verify your email"
33
+ }
34
+ };