@better-auth-ui/core 1.6.0 → 1.6.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/config/auth-config.d.ts +18 -10
- package/dist/config/auth-config.js +41 -34
- package/dist/config/index.d.ts +6 -5
- package/dist/config/username-config.d.ts +18 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +7 -6
- package/dist/lib/base-paths.js +7 -4
- package/dist/lib/localization.d.ts +22 -0
- package/dist/lib/localization.js +102 -171
- package/dist/lib/provider-names.d.ts +1 -1
- package/dist/lib/provider-names.js +41 -48
- package/dist/lib/utils.js +43 -111
- package/dist/lib/view-paths.js +16 -13
- package/package.json +11 -6
- package/src/config/auth-config.ts +17 -2
- package/src/config/index.ts +1 -0
- package/src/config/username-config.ts +18 -0
- package/src/lib/localization.ts +33 -0
- package/dist/base-paths.d.ts +0 -21
- package/dist/base-paths.js +0 -5
- package/dist/config/appearance-config.js +0 -1
- package/dist/config/avatar-config.js +0 -1
- package/dist/config/delete-user-config.js +0 -1
- package/dist/config/email-and-password-config.js +0 -1
- package/dist/config/index.js +0 -5
- package/dist/config/settings-config.d.ts +0 -17
- package/dist/config/settings-config.js +0 -1
- package/dist/config/toast-config.d.ts +0 -58
- package/dist/config/toast-config.js +0 -16
- package/dist/lib/auth-callback-options.d.ts +0 -8
- package/dist/lib/auth-callback-options.js +0 -1
- package/dist/lib/auth-config.d.ts +0 -198
- package/dist/lib/auth-config.js +0 -36
- package/dist/lib/auth-error.d.ts +0 -9
- package/dist/lib/auth-error.js +0 -1
- package/dist/lib/auth-hook-options.d.ts +0 -8
- package/dist/lib/auth-hook-options.js +0 -1
- package/dist/lib/auth-toast.d.ts +0 -24
- package/dist/lib/auth-toast.js +0 -10
- package/dist/lib/config/appearance-config.d.ts +0 -23
- package/dist/lib/config/appearance-config.js +0 -1
- package/dist/lib/config/auth-config.d.ts +0 -70
- package/dist/lib/config/auth-config.js +0 -36
- package/dist/lib/config/avatar-config.d.ts +0 -35
- package/dist/lib/config/avatar-config.js +0 -1
- package/dist/lib/config/email-and-password-config.d.ts +0 -37
- package/dist/lib/config/email-and-password-config.js +0 -1
- package/dist/lib/config/index.d.ts +0 -6
- package/dist/lib/config/index.js +0 -6
- package/dist/lib/config/settings-config.d.ts +0 -22
- package/dist/lib/config/settings-config.js +0 -1
- package/dist/lib/config/toast-config.d.ts +0 -24
- package/dist/lib/config/toast-config.js +0 -10
- package/dist/lib/toast-config.d.ts +0 -24
- package/dist/lib/toast-config.js +0 -10
- package/dist/localization/index.d.ts +0 -35
- package/dist/localization/index.js +0 -34
- package/dist/localization/localization.d.ts +0 -35
- package/dist/localization/localization.js +0 -34
- package/dist/localization.d.ts +0 -159
- package/dist/localization.js +0 -156
- package/dist/provider-names.d.ts +0 -12
- package/dist/provider-names.js +0 -50
- package/dist/src/index.d.ts +0 -7
- package/dist/src/index.js +0 -7
- package/dist/src/lib/auth-config.d.ts +0 -148
- package/dist/src/lib/auth-config.js +0 -28
- package/dist/src/lib/auth-toast.d.ts +0 -24
- package/dist/src/lib/auth-toast.js +0 -10
- package/dist/src/lib/base-paths.d.ts +0 -9
- package/dist/src/lib/base-paths.js +0 -9
- package/dist/src/lib/localization.d.ts +0 -145
- package/dist/src/lib/localization.js +0 -142
- package/dist/src/lib/provider-names.d.ts +0 -12
- package/dist/src/lib/provider-names.js +0 -49
- package/dist/src/lib/utils.d.ts +0 -1
- package/dist/src/lib/utils.js +0 -30
- package/dist/src/lib/view-paths.d.ts +0 -30
- package/dist/src/lib/view-paths.js +0 -17
- package/dist/utils.d.ts +0 -3
- package/dist/utils.js +0 -80
- package/dist/view-paths.d.ts +0 -30
- package/dist/view-paths.js +0 -17
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import type { SocialProvider } from "better-auth/social-providers";
|
|
2
|
-
import { type Toast } from "./auth-toast";
|
|
3
|
-
import { type Localization } from "./localization";
|
|
4
|
-
import { type ViewPaths } from "./view-paths";
|
|
5
|
-
/**
|
|
6
|
-
* Configuration options for email and password authentication.
|
|
7
|
-
*/
|
|
8
|
-
export type EmailAndPasswordConfig = {
|
|
9
|
-
/**
|
|
10
|
-
* Whether email/password authentication is enabled
|
|
11
|
-
* @default true
|
|
12
|
-
*/
|
|
13
|
-
enabled: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Whether to show a confirm password field on sign-up forms
|
|
16
|
-
*/
|
|
17
|
-
confirmPassword?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Whether users can reset forgotten passwords
|
|
20
|
-
* @default true
|
|
21
|
-
*/
|
|
22
|
-
forgotPassword: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Maximum password length
|
|
25
|
-
* @default 128
|
|
26
|
-
*/
|
|
27
|
-
maxPasswordLength?: number;
|
|
28
|
-
/**
|
|
29
|
-
* Minimum password length
|
|
30
|
-
* @default 8
|
|
31
|
-
*/
|
|
32
|
-
minPasswordLength?: number;
|
|
33
|
-
/**
|
|
34
|
-
* Maximum password length
|
|
35
|
-
* @default 128
|
|
36
|
-
*/
|
|
37
|
-
/** Whether to show a "Remember me" checkbox on sign-in forms */
|
|
38
|
-
rememberMe?: boolean;
|
|
39
|
-
/** Whether email verification is required before account activation */
|
|
40
|
-
requireEmailVerification?: boolean;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Configuration options for avatar handling.
|
|
44
|
-
*/
|
|
45
|
-
export type AvatarConfig = {
|
|
46
|
-
/**
|
|
47
|
-
* Delete the current avatar (e.g. remove from storage).
|
|
48
|
-
* When undefined, avatar deletion is disabled.
|
|
49
|
-
*/
|
|
50
|
-
delete?: (url: string) => Promise<void>;
|
|
51
|
-
/**
|
|
52
|
-
* Whether avatar changing is enabled.
|
|
53
|
-
* @default true
|
|
54
|
-
*/
|
|
55
|
-
enabled?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Output image format.
|
|
58
|
-
* @default "png"
|
|
59
|
-
*/
|
|
60
|
-
extension?: "png" | "jpg" | "webp" | "inherit";
|
|
61
|
-
/**
|
|
62
|
-
* Resize an image file before upload.
|
|
63
|
-
* @default Resizes to max size, square-cropped, output as configured extension.
|
|
64
|
-
*/
|
|
65
|
-
resize?: (file: File, size?: number, extension?: "png" | "jpg" | "webp" | "inherit") => Promise<File>;
|
|
66
|
-
/**
|
|
67
|
-
* Max dimension in pixels for the optimized avatar.
|
|
68
|
-
* @default 256
|
|
69
|
-
*/
|
|
70
|
-
size?: number;
|
|
71
|
-
/**
|
|
72
|
-
* Upload a file and return the URL where it was stored.
|
|
73
|
-
* When undefined, the image is base64-encoded and saved directly to `user.image`.
|
|
74
|
-
*/
|
|
75
|
-
upload?: (file: File) => Promise<string>;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Available theme options for the application.
|
|
79
|
-
*/
|
|
80
|
-
export type Theme = "system" | "light" | "dark";
|
|
81
|
-
/**
|
|
82
|
-
* Configuration options for appearance/theme settings.
|
|
83
|
-
*/
|
|
84
|
-
export type AppearanceConfig = {
|
|
85
|
-
/**
|
|
86
|
-
* Function to set the application theme
|
|
87
|
-
* @param theme - The theme value to set
|
|
88
|
-
*/
|
|
89
|
-
setTheme?: (theme: string) => void;
|
|
90
|
-
/**
|
|
91
|
-
* Current theme value
|
|
92
|
-
*/
|
|
93
|
-
theme?: string;
|
|
94
|
-
/**
|
|
95
|
-
* Available theme options to display in the theme switcher
|
|
96
|
-
* @default ["system", "light", "dark"]
|
|
97
|
-
*/
|
|
98
|
-
themes?: Theme[];
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* Configuration options for user settings.
|
|
102
|
-
*/
|
|
103
|
-
export type SettingsConfig = {
|
|
104
|
-
/**
|
|
105
|
-
* Appearance/theme configuration
|
|
106
|
-
* @default { themes: ["system", "light", "dark"] }
|
|
107
|
-
*/
|
|
108
|
-
appearance: AppearanceConfig;
|
|
109
|
-
/**
|
|
110
|
-
* Avatar upload, optimization, and deletion configuration.
|
|
111
|
-
* @default { enabled: true, optimize: optimizeAvatar, size: 256 }
|
|
112
|
-
*/
|
|
113
|
-
avatar: AvatarConfig;
|
|
114
|
-
/**
|
|
115
|
-
* Whether the settings section is enabled
|
|
116
|
-
* @default true
|
|
117
|
-
*/
|
|
118
|
-
enabled?: boolean;
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Core authentication configuration interface.
|
|
122
|
-
*
|
|
123
|
-
* Defines the base structure for authentication settings including paths,
|
|
124
|
-
* providers, navigation functions, and feature flags.
|
|
125
|
-
*/
|
|
126
|
-
export interface AuthConfig {
|
|
127
|
-
/** Base paths for different application sections */
|
|
128
|
-
basePaths: {
|
|
129
|
-
/**
|
|
130
|
-
* Base path for authentication routes
|
|
131
|
-
* @default "/auth"
|
|
132
|
-
*/
|
|
133
|
-
auth: string;
|
|
134
|
-
/**
|
|
135
|
-
* Base path for settings routes
|
|
136
|
-
* @default "/settings"
|
|
137
|
-
*/
|
|
138
|
-
settings: string;
|
|
139
|
-
/**
|
|
140
|
-
* Base path for organization management routes
|
|
141
|
-
* @default "/organization"
|
|
142
|
-
*/
|
|
143
|
-
organization: string;
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* Base URL for API endpoints (optional)
|
|
147
|
-
* @default ""
|
|
148
|
-
*/
|
|
149
|
-
baseURL: string;
|
|
150
|
-
/**
|
|
151
|
-
* Email and password authentication configuration
|
|
152
|
-
* @default { enabled: true, forgotPassword: true, minPasswordLength: 8, maxPasswordLength: 128 }
|
|
153
|
-
*/
|
|
154
|
-
emailAndPassword: EmailAndPasswordConfig;
|
|
155
|
-
/** Localization strings for UI components. */
|
|
156
|
-
localization: Localization;
|
|
157
|
-
/** Whether magic link (passwordless) authentication is enabled */
|
|
158
|
-
magicLink?: boolean;
|
|
159
|
-
/** Whether multi-session support is enabled */
|
|
160
|
-
multiSession?: boolean;
|
|
161
|
-
/**
|
|
162
|
-
* Default redirect path after successful authentication
|
|
163
|
-
* @default "/"
|
|
164
|
-
*/
|
|
165
|
-
redirectTo: string;
|
|
166
|
-
/**
|
|
167
|
-
* Settings section configuration
|
|
168
|
-
* @default { enabled: true }
|
|
169
|
-
*/
|
|
170
|
-
settings: SettingsConfig;
|
|
171
|
-
/**
|
|
172
|
-
* List of enabled social authentication providers
|
|
173
|
-
* @remarks `SocialProvider[]`
|
|
174
|
-
*/
|
|
175
|
-
socialProviders?: SocialProvider[];
|
|
176
|
-
/** View path mappings for different authentication views */
|
|
177
|
-
viewPaths: ViewPaths;
|
|
178
|
-
/**
|
|
179
|
-
* Toast notification configuration for user feedback.
|
|
180
|
-
* @remarks `Toast`
|
|
181
|
-
*/
|
|
182
|
-
toast: Toast;
|
|
183
|
-
/**
|
|
184
|
-
* Function to navigate to a new path
|
|
185
|
-
* @param options - Navigation options with href and optional replace flag
|
|
186
|
-
* @default window.location.href = href (or window.location.replace if replace: true)
|
|
187
|
-
* @example
|
|
188
|
-
* // TanStack Router
|
|
189
|
-
* navigate={navigate}
|
|
190
|
-
* // Next.js
|
|
191
|
-
* navigate={({href, replace}) => replace ? router.replace(href) : router.push(href)}
|
|
192
|
-
*/
|
|
193
|
-
navigate: (options: {
|
|
194
|
-
to: string;
|
|
195
|
-
replace?: boolean;
|
|
196
|
-
}) => void;
|
|
197
|
-
}
|
|
198
|
-
export declare const defaultConfig: AuthConfig;
|
package/dist/lib/auth-config.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { defaultToast } from "./auth-toast";
|
|
2
|
-
import { basePaths } from "./base-paths";
|
|
3
|
-
import { localization } from "./localization";
|
|
4
|
-
import { resizeAvatar } from "./utils";
|
|
5
|
-
import { viewPaths } from "./view-paths";
|
|
6
|
-
export const defaultConfig = {
|
|
7
|
-
basePaths,
|
|
8
|
-
baseURL: "",
|
|
9
|
-
emailAndPassword: {
|
|
10
|
-
enabled: true,
|
|
11
|
-
forgotPassword: true,
|
|
12
|
-
rememberMe: false,
|
|
13
|
-
minPasswordLength: 8,
|
|
14
|
-
maxPasswordLength: 128
|
|
15
|
-
},
|
|
16
|
-
redirectTo: "/",
|
|
17
|
-
settings: {
|
|
18
|
-
appearance: {
|
|
19
|
-
themes: ["system", "light", "dark"]
|
|
20
|
-
},
|
|
21
|
-
avatar: {
|
|
22
|
-
enabled: true,
|
|
23
|
-
resize: resizeAvatar,
|
|
24
|
-
size: 256
|
|
25
|
-
},
|
|
26
|
-
enabled: true
|
|
27
|
-
},
|
|
28
|
-
viewPaths,
|
|
29
|
-
localization,
|
|
30
|
-
navigate: () => { },
|
|
31
|
-
toast: {
|
|
32
|
-
error: defaultToast,
|
|
33
|
-
success: defaultToast,
|
|
34
|
-
info: defaultToast
|
|
35
|
-
}
|
|
36
|
-
};
|
package/dist/lib/auth-error.d.ts
DELETED
package/dist/lib/auth-error.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/lib/auth-toast.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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 Toast = {
|
|
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
|
-
};
|
package/dist/lib/auth-toast.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Available theme options for the application.
|
|
3
|
-
*/
|
|
4
|
-
export type Theme = "system" | "light" | "dark";
|
|
5
|
-
/**
|
|
6
|
-
* Configuration options for appearance/theme settings.
|
|
7
|
-
*/
|
|
8
|
-
export type AppearanceConfig = {
|
|
9
|
-
/**
|
|
10
|
-
* Function to set the application theme
|
|
11
|
-
* @param theme - The theme value to set
|
|
12
|
-
*/
|
|
13
|
-
setTheme?: (theme: string) => void;
|
|
14
|
-
/**
|
|
15
|
-
* Current theme value
|
|
16
|
-
*/
|
|
17
|
-
theme?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Available theme options to display in the theme switcher
|
|
20
|
-
* @default ["system", "light", "dark"]
|
|
21
|
-
*/
|
|
22
|
-
themes?: Theme[];
|
|
23
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { SocialProvider } from "better-auth/social-providers";
|
|
2
|
-
import { type ToastConfig } from "./toast-config";
|
|
3
|
-
import { type BasePaths } from "../base-paths";
|
|
4
|
-
import { type Localization } from "../localization";
|
|
5
|
-
import { type ViewPaths } from "../view-paths";
|
|
6
|
-
import type { EmailAndPasswordConfig } from "./email-and-password-config";
|
|
7
|
-
import type { SettingsConfig } from "./settings-config";
|
|
8
|
-
/**
|
|
9
|
-
* Core authentication configuration interface.
|
|
10
|
-
*
|
|
11
|
-
* Defines the base structure for authentication settings including paths,
|
|
12
|
-
* providers, navigation functions, and feature flags.
|
|
13
|
-
*/
|
|
14
|
-
export interface AuthConfig {
|
|
15
|
-
/** Base paths for different application sections */
|
|
16
|
-
basePaths: BasePaths;
|
|
17
|
-
/**
|
|
18
|
-
* Base URL for API endpoints (optional)
|
|
19
|
-
* @default ""
|
|
20
|
-
*/
|
|
21
|
-
baseURL: string;
|
|
22
|
-
/**
|
|
23
|
-
* Email and password authentication configuration
|
|
24
|
-
* @default { enabled: true, forgotPassword: true, minPasswordLength: 8, maxPasswordLength: 128 }
|
|
25
|
-
*/
|
|
26
|
-
emailAndPassword: EmailAndPasswordConfig;
|
|
27
|
-
/** Localization strings for UI components. */
|
|
28
|
-
localization: Localization;
|
|
29
|
-
/** Whether magic link (passwordless) authentication is enabled */
|
|
30
|
-
magicLink?: boolean;
|
|
31
|
-
/** Whether multi-session support is enabled */
|
|
32
|
-
multiSession?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Default redirect path after successful authentication
|
|
35
|
-
* @default "/"
|
|
36
|
-
*/
|
|
37
|
-
redirectTo: string;
|
|
38
|
-
/**
|
|
39
|
-
* Settings section configuration
|
|
40
|
-
* @default { enabled: true }
|
|
41
|
-
*/
|
|
42
|
-
settings: SettingsConfig;
|
|
43
|
-
/**
|
|
44
|
-
* List of enabled social authentication providers
|
|
45
|
-
* @remarks `SocialProvider[]`
|
|
46
|
-
*/
|
|
47
|
-
socialProviders?: SocialProvider[];
|
|
48
|
-
/** View path mappings for different authentication views */
|
|
49
|
-
viewPaths: ViewPaths;
|
|
50
|
-
/**
|
|
51
|
-
* Toast notification configuration for user feedback.
|
|
52
|
-
* @remarks `ToastConfig`
|
|
53
|
-
*/
|
|
54
|
-
toast: ToastConfig;
|
|
55
|
-
/**
|
|
56
|
-
* Function to navigate to a new path
|
|
57
|
-
* @param options - Navigation options with href and optional replace flag
|
|
58
|
-
* @default window.location.href = href (or window.location.replace if replace: true)
|
|
59
|
-
* @example
|
|
60
|
-
* // TanStack Router
|
|
61
|
-
* navigate={navigate}
|
|
62
|
-
* // Next.js
|
|
63
|
-
* navigate={({href, replace}) => replace ? router.replace(href) : router.push(href)}
|
|
64
|
-
*/
|
|
65
|
-
navigate: (options: {
|
|
66
|
-
to: string;
|
|
67
|
-
replace?: boolean;
|
|
68
|
-
}) => void;
|
|
69
|
-
}
|
|
70
|
-
export declare const defaultConfig: AuthConfig;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { defaultToast } from "./toast-config";
|
|
2
|
-
import { basePaths } from "../base-paths";
|
|
3
|
-
import { localization } from "../localization";
|
|
4
|
-
import { resizeAvatar } from "../utils";
|
|
5
|
-
import { viewPaths } from "../view-paths";
|
|
6
|
-
export const defaultConfig = {
|
|
7
|
-
basePaths,
|
|
8
|
-
baseURL: "",
|
|
9
|
-
emailAndPassword: {
|
|
10
|
-
enabled: true,
|
|
11
|
-
forgotPassword: true,
|
|
12
|
-
rememberMe: false,
|
|
13
|
-
minPasswordLength: 8,
|
|
14
|
-
maxPasswordLength: 128
|
|
15
|
-
},
|
|
16
|
-
redirectTo: "/",
|
|
17
|
-
settings: {
|
|
18
|
-
appearance: {
|
|
19
|
-
themes: ["system", "light", "dark"]
|
|
20
|
-
},
|
|
21
|
-
avatar: {
|
|
22
|
-
enabled: true,
|
|
23
|
-
resize: resizeAvatar,
|
|
24
|
-
size: 256
|
|
25
|
-
},
|
|
26
|
-
enabled: true
|
|
27
|
-
},
|
|
28
|
-
viewPaths,
|
|
29
|
-
localization,
|
|
30
|
-
navigate: () => { },
|
|
31
|
-
toast: {
|
|
32
|
-
error: defaultToast,
|
|
33
|
-
success: defaultToast,
|
|
34
|
-
info: defaultToast
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration options for avatar handling.
|
|
3
|
-
*/
|
|
4
|
-
export type AvatarConfig = {
|
|
5
|
-
/**
|
|
6
|
-
* Delete the current avatar (e.g. remove from storage).
|
|
7
|
-
* When undefined, avatar deletion is disabled.
|
|
8
|
-
*/
|
|
9
|
-
delete?: (url: string) => Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Whether avatar changing is enabled.
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
enabled?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Output image format.
|
|
17
|
-
* @default "png"
|
|
18
|
-
*/
|
|
19
|
-
extension?: "png" | "jpg" | "webp" | "inherit";
|
|
20
|
-
/**
|
|
21
|
-
* Resize an image file before upload.
|
|
22
|
-
* @default Resizes to max size, square-cropped, output as configured extension.
|
|
23
|
-
*/
|
|
24
|
-
resize?: (file: File, size?: number, extension?: "png" | "jpg" | "webp" | "inherit") => Promise<File>;
|
|
25
|
-
/**
|
|
26
|
-
* Max dimension in pixels for the optimized avatar.
|
|
27
|
-
* @default 256
|
|
28
|
-
*/
|
|
29
|
-
size?: number;
|
|
30
|
-
/**
|
|
31
|
-
* Upload a file and return the URL where it was stored.
|
|
32
|
-
* When undefined, the image is base64-encoded and saved directly to `user.image`.
|
|
33
|
-
*/
|
|
34
|
-
upload?: (file: File) => Promise<string>;
|
|
35
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration options for email and password authentication.
|
|
3
|
-
*/
|
|
4
|
-
export type EmailAndPasswordConfig = {
|
|
5
|
-
/**
|
|
6
|
-
* Whether email/password authentication is enabled
|
|
7
|
-
* @default true
|
|
8
|
-
*/
|
|
9
|
-
enabled: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Whether to show a confirm password field on sign-up forms
|
|
12
|
-
*/
|
|
13
|
-
confirmPassword?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Whether users can reset forgotten passwords
|
|
16
|
-
* @default true
|
|
17
|
-
*/
|
|
18
|
-
forgotPassword: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Maximum password length
|
|
21
|
-
* @default 128
|
|
22
|
-
*/
|
|
23
|
-
maxPasswordLength?: number;
|
|
24
|
-
/**
|
|
25
|
-
* Minimum password length
|
|
26
|
-
* @default 8
|
|
27
|
-
*/
|
|
28
|
-
minPasswordLength?: number;
|
|
29
|
-
/**
|
|
30
|
-
* Maximum password length
|
|
31
|
-
* @default 128
|
|
32
|
-
*/
|
|
33
|
-
/** Whether to show a "Remember me" checkbox on sign-in forms */
|
|
34
|
-
rememberMe?: boolean;
|
|
35
|
-
/** Whether email verification is required before account activation */
|
|
36
|
-
requireEmailVerification?: boolean;
|
|
37
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/lib/config/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { AppearanceConfig } from "./appearance-config";
|
|
2
|
-
import type { AvatarConfig } from "./avatar-config";
|
|
3
|
-
/**
|
|
4
|
-
* Configuration options for user settings.
|
|
5
|
-
*/
|
|
6
|
-
export type SettingsConfig = {
|
|
7
|
-
/**
|
|
8
|
-
* Appearance/theme configuration
|
|
9
|
-
* @default { themes: ["system", "light", "dark"] }
|
|
10
|
-
*/
|
|
11
|
-
appearance: AppearanceConfig;
|
|
12
|
-
/**
|
|
13
|
-
* Avatar upload, optimization, and deletion configuration.
|
|
14
|
-
* @default { enabled: true, optimize: optimizeAvatar, size: 256 }
|
|
15
|
-
*/
|
|
16
|
-
avatar: AvatarConfig;
|
|
17
|
-
/**
|
|
18
|
-
* Whether the settings section is enabled
|
|
19
|
-
* @default true
|
|
20
|
-
*/
|
|
21
|
-
enabled?: boolean;
|
|
22
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
};
|
package/dist/lib/toast-config.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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;
|