doct-ui-auth-kit 1.0.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.
- package/README.md +266 -0
- package/dist/adapters/http-auth-adapter.d.ts +11 -0
- package/dist/adapters/index.d.ts +1 -0
- package/dist/auth-methods/apple.d.ts +19 -0
- package/dist/auth-methods/google.d.ts +65 -0
- package/dist/auth-methods/index.d.ts +2 -0
- package/dist/components/auth/repeat-login.d.ts +24 -0
- package/dist/components/form/rhf-doct-phone-input.d.ts +2 -0
- package/dist/components/form/rhf-input-field.d.ts +2 -0
- package/dist/components/form/rhf-otp-input-field.d.ts +2 -0
- package/dist/components/form/rhf-password-field.d.ts +2 -0
- package/dist/components/layout/auth-layout.d.ts +89 -0
- package/dist/components/layout/image-slider.d.ts +45 -0
- package/dist/components/layout/index.d.ts +6 -0
- package/dist/components/layout/main-layout.d.ts +74 -0
- package/dist/constants/demo-slider.d.ts +16 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/core/auth-api-adapter.d.ts +38 -0
- package/dist/core/auth-context.d.ts +67 -0
- package/dist/core/auth-flow.d.ts +5 -0
- package/dist/core/auth-provider.d.ts +39 -0
- package/dist/core/auth-types.d.ts +68 -0
- package/dist/core/device-detection.d.ts +23 -0
- package/dist/core/index.d.ts +11 -0
- package/dist/core/sso-session.d.ts +35 -0
- package/dist/core/use-auth-flow.d.ts +79 -0
- package/dist/docthub.svg +5 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/use-login-entry-form.d.ts +32 -0
- package/dist/hooks/use-otp-verification.d.ts +29 -0
- package/dist/hooks/use-signup-form.d.ts +37 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +7405 -0
- package/dist/logo.png +0 -0
- package/dist/pages/conflict.d.ts +12 -0
- package/dist/pages/foreign-email-collect.d.ts +16 -0
- package/dist/pages/index.d.ts +7 -0
- package/dist/pages/login-entry.d.ts +23 -0
- package/dist/pages/main-login.d.ts +26 -0
- package/dist/pages/otp-verification.d.ts +21 -0
- package/dist/pages/repeat-login.d.ts +20 -0
- package/dist/pages/signup.d.ts +17 -0
- package/dist/pages.js +10 -0
- package/dist/signup-Cnybfnhd.js +720 -0
- package/dist/slider/slide-1.png +0 -0
- package/dist/slider/slide-2.png +0 -0
- package/dist/slider/slide-3.png +0 -0
- package/dist/slider/slide-4.png +0 -0
- package/dist/slider/slide-5.png +0 -0
- package/dist/types/auth-layout-types.d.ts +94 -0
- package/dist/types/common.d.ts +25 -0
- package/dist/types/forms.d.ts +124 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/user.d.ts +31 -0
- package/dist/vite.svg +1 -0
- package/package.json +104 -0
package/dist/logo.png
ADDED
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AuthError } from '@/core/auth-types';
|
|
2
|
+
export interface ConflictPageProps {
|
|
3
|
+
/** Conflict error with optional linked identifier (e.g. masked phone or email). */
|
|
4
|
+
error: AuthError | null;
|
|
5
|
+
/** Handler when user chooses to go back and edit input. */
|
|
6
|
+
onGoBack?: () => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Conflict error page: shown when identifier is already linked to another account.
|
|
10
|
+
* Slot into AuthLayout.Body; layout shell is provided by the consumer.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ConflictPage({ error, onGoBack }: Readonly<ConflictPageProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ForeignEmailCollectPageProps {
|
|
2
|
+
/** Masked phone (e.g. "+** ***1234") for display. */
|
|
3
|
+
maskedPhone?: string;
|
|
4
|
+
/** Handler when form is submitted with fullName and email. */
|
|
5
|
+
onSubmit?: (data: {
|
|
6
|
+
fullName: string;
|
|
7
|
+
email: string;
|
|
8
|
+
}) => void;
|
|
9
|
+
/** Handler when back is clicked. */
|
|
10
|
+
onBack?: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Foreign (non-Indian) phone flow: collect full name and email; OTP will be sent to email.
|
|
14
|
+
* Slot into AuthLayout.Body; layout shell is provided by the consumer.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ForeignEmailCollectPage({ maskedPhone, onSubmit, }: Readonly<ForeignEmailCollectPageProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ConflictPage, type ConflictPageProps } from './conflict';
|
|
2
|
+
export { ForeignEmailCollectPage, type ForeignEmailCollectPageProps, } from './foreign-email-collect';
|
|
3
|
+
export { LoginEntry, type LoginEntryMode, type LoginEntryProps, } from './login-entry';
|
|
4
|
+
export { MainLogin, type MainLoginProps } from './main-login';
|
|
5
|
+
export { OtpVerification, type OtpVerificationMode, type OtpVerificationProps, } from './otp-verification';
|
|
6
|
+
export { RepeatLogin, type RepeatLoginProps } from './repeat-login';
|
|
7
|
+
export { type SignupEntryMode, SignupPage, type SignupPageProps, } from './signup';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LoginEntryMode } from '@/hooks/use-login-entry-form';
|
|
2
|
+
export type { LoginEntryMode };
|
|
3
|
+
export interface LoginEntryProps {
|
|
4
|
+
/** Mode: phone number or email input */
|
|
5
|
+
mode: LoginEntryMode;
|
|
6
|
+
/** Override title (consumers render via AuthLayout.Title) */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** Override subtitle (consumers render via AuthLayout.Description) */
|
|
9
|
+
subtitle?: string;
|
|
10
|
+
/** Handler when back button is clicked (consumers render back button in AuthLayout.Logo) */
|
|
11
|
+
onBack?: () => void;
|
|
12
|
+
/** Handler when form is submitted with valid phone or email */
|
|
13
|
+
onSubmit?: (data: {
|
|
14
|
+
phone?: string;
|
|
15
|
+
email?: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Login entry screen: single form for phone or email based on mode.
|
|
20
|
+
* Uses FormProvider and react-hook-form. Slot into AuthLayout.Body;
|
|
21
|
+
* layout (MainLayout, AuthLayout with Logo, Title, etc.) is provided by the consumer.
|
|
22
|
+
*/
|
|
23
|
+
export declare function LoginEntry({ mode, onSubmit }: Readonly<LoginEntryProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface MainLoginProps {
|
|
2
|
+
/** Handler for "Continue with Mobile". */
|
|
3
|
+
onContinueWithMobile?: () => void;
|
|
4
|
+
/** Handler for "Continue with Email". */
|
|
5
|
+
onContinueWithEmail?: () => void;
|
|
6
|
+
/** Handler for "Continue with Google". */
|
|
7
|
+
onContinueWithGoogle?: () => void;
|
|
8
|
+
/** Handler for "Continue with Apple". */
|
|
9
|
+
onContinueWithApple?: () => void;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Google-branded button is no longer rendered from this component.
|
|
12
|
+
* Google One Tap and provider callbacks are handled via `AuthFlow` / `useGoogleOneTap`.
|
|
13
|
+
*/
|
|
14
|
+
googleClientId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Google-branded button is no longer rendered from this component.
|
|
17
|
+
* Google One Tap and provider callbacks are handled via `AuthFlow` / `useGoogleOneTap`.
|
|
18
|
+
*/
|
|
19
|
+
onGoogleCredential?: (credential: string) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Main login page body: four sign-in options (Mobile, Email, Google, Apple).
|
|
23
|
+
* Intended to be slotted into AuthLayout.Body. Layout shell (AuthLayout with
|
|
24
|
+
* Logo, Title, Description) is provided by the app or story.
|
|
25
|
+
*/
|
|
26
|
+
export declare function MainLogin({ onContinueWithMobile, onContinueWithEmail, onContinueWithGoogle, onContinueWithApple, }: Readonly<MainLoginProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { OtpVerificationMode } from '@/hooks/use-otp-verification';
|
|
2
|
+
export type { OtpVerificationMode };
|
|
3
|
+
export interface OtpVerificationProps {
|
|
4
|
+
/** Mode: mobile (phone) or email OTP */
|
|
5
|
+
mode: OtpVerificationMode;
|
|
6
|
+
/** Title override. Default: "6 digit OTP has been sent to your Mobile" | "..." Email */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** Masked phone (e.g. "+91 9825910X0X") or email (e.g. "j***@gmail.com") */
|
|
9
|
+
recipientDisplay: string;
|
|
10
|
+
/** Handler when back is clicked */
|
|
11
|
+
onBack?: () => void;
|
|
12
|
+
/** Handler when form is submitted with valid 6-digit OTP */
|
|
13
|
+
onSubmit?: (otp: string) => void;
|
|
14
|
+
/** Handler when user requests resend code */
|
|
15
|
+
onResendCode?: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* OTP verification screen: 6-digit OTP input, resend countdown, and submit.
|
|
19
|
+
* Slot into AuthLayout.Body; layout shell is provided by the consumer.
|
|
20
|
+
*/
|
|
21
|
+
export declare function OtpVerification({ mode, title, recipientDisplay, onSubmit, onResendCode, }: Readonly<OtpVerificationProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface RepeatLoginProps {
|
|
2
|
+
/**
|
|
3
|
+
* Last used authentication method shown in the primary button label.
|
|
4
|
+
* Example: "Mobile", "Email".
|
|
5
|
+
*
|
|
6
|
+
* @default "Mobile"
|
|
7
|
+
*/
|
|
8
|
+
lastUsedMethod?: string;
|
|
9
|
+
/** Handler for the primary action (continue with last used method). */
|
|
10
|
+
onContinueWithLastMethod?: () => void;
|
|
11
|
+
/** Handler for the secondary action (choose another method). */
|
|
12
|
+
onUseAnotherMethod?: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Repeat login page body: primary CTA (continue with last method) and secondary
|
|
16
|
+
* "Use another method" button. Intended to be slotted into AuthLayout.Body.
|
|
17
|
+
* Layout shell (AuthLayout with Logo, Title, Description) is provided by the
|
|
18
|
+
* app or story.
|
|
19
|
+
*/
|
|
20
|
+
export declare function RepeatLogin({ lastUsedMethod, onContinueWithLastMethod, onUseAnotherMethod, }: Readonly<RepeatLoginProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SignupEntryMode } from '@/hooks/use-signup-form';
|
|
2
|
+
export type { SignupEntryMode };
|
|
3
|
+
export interface SignupPageProps {
|
|
4
|
+
/** Mode: phone number or email as second field (after full name) */
|
|
5
|
+
mode: SignupEntryMode;
|
|
6
|
+
/** Handler when form is submitted with valid fullName and phone or email */
|
|
7
|
+
onSubmit?: (data: {
|
|
8
|
+
fullName: string;
|
|
9
|
+
phone?: string;
|
|
10
|
+
email?: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Signup screen: full name plus phone or email form with Continue button.
|
|
15
|
+
* Slot into AuthLayout.Body; layout shell is provided by the consumer.
|
|
16
|
+
*/
|
|
17
|
+
export declare function SignupPage({ mode, onSubmit }: Readonly<SignupPageProps>): import("react/jsx-runtime").JSX.Element;
|
package/dist/pages.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { C as e, F as n, L as o, M as g, O as s, R as t, S as r } from "./signup-Cnybfnhd.js";
|
|
2
|
+
export {
|
|
3
|
+
e as ConflictPage,
|
|
4
|
+
n as ForeignEmailCollectPage,
|
|
5
|
+
o as LoginEntry,
|
|
6
|
+
g as MainLogin,
|
|
7
|
+
s as OtpVerification,
|
|
8
|
+
t as RepeatLogin,
|
|
9
|
+
r as SignupPage
|
|
10
|
+
};
|