@sudobility/building_blocks 0.0.27 → 0.0.29
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/components/pages/index.d.ts +1 -1
- package/dist/components/pages/login-page.d.ts +14 -23
- package/dist/index.js +56 -6334
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,4 +3,4 @@ export type { AppSitemapPageProps, SitemapPageText, SitemapSection, SitemapLink,
|
|
|
3
3
|
export { AppTextPage } from './app-text-page';
|
|
4
4
|
export type { AppTextPageProps, TextPageContent, TextSection, TextSectionWithContent, TextSectionWithList, TextSectionWithSubsections, TextPageContact, TextPageContactInfo, GdprNotice, } from './app-text-page';
|
|
5
5
|
export { LoginPage } from './login-page';
|
|
6
|
-
export type { LoginPageProps, LoginPageText } from './login-page';
|
|
6
|
+
export type { LoginPageProps, LoginPageText, AuthErrorInfo, } from './login-page';
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type Auth } from 'firebase/auth';
|
|
3
|
+
/**
|
|
4
|
+
* Auth error info passed to onAuthError callback
|
|
5
|
+
*/
|
|
6
|
+
export interface AuthErrorInfo {
|
|
7
|
+
/** Firebase error code (e.g., 'auth/popup-closed-by-user') */
|
|
8
|
+
code: string;
|
|
9
|
+
/** Error message */
|
|
10
|
+
message: string;
|
|
11
|
+
/** Whether this is a user-initiated action (like closing popup) vs actual error */
|
|
12
|
+
isUserAction: boolean;
|
|
13
|
+
}
|
|
3
14
|
/**
|
|
4
15
|
* Props for the LoginPage component
|
|
5
16
|
*/
|
|
@@ -12,6 +23,8 @@ export interface LoginPageProps {
|
|
|
12
23
|
auth: Auth;
|
|
13
24
|
/** Callback fired on successful authentication */
|
|
14
25
|
onSuccess: () => void;
|
|
26
|
+
/** Callback fired on auth errors - if provided, errors won't be shown inline */
|
|
27
|
+
onAuthError?: (error: AuthErrorInfo) => void;
|
|
15
28
|
/** Whether to show Google sign-in option (default: true) */
|
|
16
29
|
showGoogleSignIn?: boolean;
|
|
17
30
|
/** Whether to show sign-up option (default: true) */
|
|
@@ -38,26 +51,4 @@ export interface LoginPageText {
|
|
|
38
51
|
alreadyHaveAccount: string;
|
|
39
52
|
dontHaveAccount: string;
|
|
40
53
|
}
|
|
41
|
-
|
|
42
|
-
* A reusable login page component with email/password and Google sign-in support.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```tsx
|
|
46
|
-
* import { LoginPage } from '@sudobility/building_blocks';
|
|
47
|
-
* import { getFirebaseAuth } from '@sudobility/auth_lib';
|
|
48
|
-
*
|
|
49
|
-
* function MyLoginPage() {
|
|
50
|
-
* const navigate = useNavigate();
|
|
51
|
-
* const auth = getFirebaseAuth();
|
|
52
|
-
*
|
|
53
|
-
* return (
|
|
54
|
-
* <LoginPage
|
|
55
|
-
* appName="My App"
|
|
56
|
-
* auth={auth}
|
|
57
|
-
* onSuccess={() => navigate('/')}
|
|
58
|
-
* />
|
|
59
|
-
* );
|
|
60
|
-
* }
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
export declare function LoginPage({ appName, logo, auth, onSuccess, showGoogleSignIn, showSignUp, className, primaryColorClass, }: LoginPageProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare function LoginPage({ appName, logo, auth, onSuccess, onAuthError, showGoogleSignIn, showSignUp, className, primaryColorClass, }: LoginPageProps): import("react/jsx-runtime").JSX.Element;
|