doct-ui-auth-kit 1.0.12 → 1.0.14
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/adapters/http-auth-adapter.d.ts +13 -0
- package/dist/adapters/index.d.ts +1 -0
- package/dist/auth/index.d.ts +28 -0
- package/dist/auth-methods/apple.d.ts +19 -0
- package/dist/auth-methods/google.d.ts +5 -0
- package/dist/auth-methods/index.d.ts +2 -0
- package/dist/auth-methods/use-google-auth.d.ts +69 -0
- package/dist/components/common/back-button.d.ts +13 -0
- package/dist/components/common/default-footer.d.ts +5 -0
- package/dist/components/common/enterprise-header.d.ts +22 -0
- package/dist/components/common/index.d.ts +3 -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 +3 -0
- package/dist/components/layout/auth-layout-preset.d.ts +30 -0
- package/dist/components/layout/auth-layout-public.d.ts +17 -0
- package/dist/components/layout/auth-layout-wrapper.d.ts +42 -0
- package/dist/components/layout/auth-layout.d.ts +89 -0
- package/dist/components/layout/image-slider.d.ts +28 -0
- package/dist/components/layout/index.d.ts +8 -0
- package/dist/components/layout/main-layout.d.ts +30 -0
- package/dist/constants/brand.d.ts +9 -0
- package/dist/constants/demo-slider.d.ts +14 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/layout-classes.d.ts +10 -0
- package/dist/constants/layout-presets.d.ts +10 -0
- package/dist/core/auth-api-adapter.d.ts +6 -0
- package/dist/core/auth-context.d.ts +21 -0
- package/dist/core/auth-flow.d.ts +35 -0
- package/dist/core/auth-provider.d.ts +8 -0
- package/dist/core/auth-types.d.ts +5 -0
- package/dist/core/device-detection.d.ts +19 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/sso-session.d.ts +35 -0
- package/dist/core/use-auth-flow-router-sync.d.ts +28 -0
- package/dist/core/use-auth-flow.d.ts +9 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/use-login-entry-form.d.ts +12 -0
- package/dist/hooks/use-main-auth-page-handlers.d.ts +9 -0
- package/dist/hooks/use-otp-verification.d.ts +15 -0
- package/dist/hooks/use-repeat-login.d.ts +9 -0
- package/dist/hooks/use-signup-form.d.ts +12 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +1364 -1346
- package/dist/pages/index.d.ts +8 -0
- package/dist/pages/login-entry/index.d.ts +3 -0
- package/dist/pages/login-entry/login-entry-page.d.ts +21 -0
- package/dist/pages/login-entry/login-entry.d.ts +21 -0
- package/dist/pages/main-login/index.d.ts +3 -0
- package/dist/pages/main-login/main-login-page.d.ts +16 -0
- package/dist/pages/main-login/main-login.d.ts +25 -0
- package/dist/pages/otp-verification/index.d.ts +3 -0
- package/dist/pages/otp-verification/otp-verification-page.d.ts +23 -0
- package/dist/pages/otp-verification/otp-verification.d.ts +22 -0
- package/dist/pages/repeat-login/index.d.ts +3 -0
- package/dist/pages/repeat-login/repeat-login-page.d.ts +24 -0
- package/dist/pages/repeat-login/repeat-login.d.ts +25 -0
- package/dist/pages/signup/index.d.ts +3 -0
- package/dist/pages/signup/signup-page.d.ts +6 -0
- package/dist/pages/signup/signup.d.ts +7 -0
- package/dist/pages.js +1 -1
- package/dist/signup-page-ChXnxtSS.js +1683 -0
- package/dist/types/auth/auth-api-adapter.d.ts +57 -0
- package/dist/types/auth/auth-provider.d.ts +40 -0
- package/dist/types/auth/auth-types.d.ts +70 -0
- package/dist/types/auth/device-detection.d.ts +13 -0
- package/dist/types/auth/flow.d.ts +127 -0
- package/dist/types/auth/index.d.ts +10 -0
- package/dist/types/auth/router.d.ts +60 -0
- package/dist/types/auth/sso-session.d.ts +33 -0
- package/dist/types/components/auth-layout-types.d.ts +92 -0
- package/dist/types/components/forms.d.ts +77 -0
- package/dist/types/components/index.d.ts +7 -0
- package/dist/types/components/layout-presets.d.ts +29 -0
- package/dist/types/components/layout.d.ts +57 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/pages/index.d.ts +9 -0
- package/dist/types/pages/login-form.d.ts +57 -0
- package/dist/types/pages/main-login.d.ts +51 -0
- package/dist/types/pages/otp-verification.d.ts +53 -0
- package/dist/types/pages/pages.d.ts +146 -0
- package/dist/types/pages/repeat-login.d.ts +29 -0
- package/dist/types/pages/signup-form.d.ts +49 -0
- package/dist/utils/build-phone-recipient.d.ts +12 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/set-form-errors-from-zod.d.ts +11 -0
- package/dist/validations/index.d.ts +6 -0
- package/dist/validations/schemas.d.ts +87 -0
- package/package.json +9 -5
- package/dist/signup-page-x-C4j5YV.js +0 -1629
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page components barrel: *Page = full page with layout, bare name = form-only for composition.
|
|
3
|
+
*/
|
|
4
|
+
export { LoginEntry, type LoginEntryMode, LoginEntryPage, type LoginEntryPageProps, type LoginEntryProps, } from './login-entry';
|
|
5
|
+
export { MainLogin, type MainLoginAppleProviderConfig, type MainLoginGoogleProviderConfig, MainLoginPage, type MainLoginPageProps, type MainLoginPageProvidersConfig, } from './main-login';
|
|
6
|
+
export { OtpVerification, type OtpVerificationMode, OtpVerificationPage, type OtpVerificationPageProps, type OtpVerificationProps, } from './otp-verification';
|
|
7
|
+
export { RepeatLogin, RepeatLoginPage, type RepeatLoginPageProps, type RepeatLoginProps, } from './repeat-login';
|
|
8
|
+
export { Signup, SignupPage, type SignupPageFullProps, type SignupPageProps, } from './signup';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { LoginEntryPageProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Full LoginEntry page with AuthLayoutWrapper, back button, and slider/standalone layout.
|
|
4
|
+
* Use when rendering the login entry screen as a standalone page.
|
|
5
|
+
*
|
|
6
|
+
* @example Next.js: API call in hook, redirect with mode + recipient for OTP page
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <LoginEntryPage
|
|
9
|
+
* mode="phone"
|
|
10
|
+
* onBack={() => router.back()}
|
|
11
|
+
* submitApi={(data) => api.sendOtp(data)}
|
|
12
|
+
* onSuccess={(params) => router.push(`/otp?mode=${params.mode}&recipient=${encodeURIComponent(params.recipient)}`)}
|
|
13
|
+
* />
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @example Sync callback (caller owns API)
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <LoginEntryPage mode="phone" onSubmit={(data) => sendOtp(data)} />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function LoginEntryPage(props: Readonly<LoginEntryPageProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { LoginEntryProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Login entry form body without layout wrapper.
|
|
4
|
+
* Single form for phone or email based on mode. Use inside your own layout or AuthFlow.
|
|
5
|
+
* Validation per PRODUCT_PROTOCOLS and edge cases 3–5, 18; cursor focus on first field (#26).
|
|
6
|
+
*
|
|
7
|
+
* @example With AuthFlow (sync onSubmit)
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <LoginEntry mode="phone" onSubmit={(data) => actions.submitIdentifier(data)} />
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @example Standalone Next.js (API + redirect in hook)
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <LoginEntry
|
|
15
|
+
* mode="phone"
|
|
16
|
+
* submitApi={(data) => api.sendOtp(data)}
|
|
17
|
+
* onSuccess={() => router.push('/otp')}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function LoginEntry(props: Readonly<LoginEntryProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MainLoginPageProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Full MainLogin page with AuthLayoutWrapper, header, footer, and slider layout.
|
|
4
|
+
* Includes default branding and layout configuration.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <MainLoginPage
|
|
9
|
+
* onContinueWithMobile={() => navigate('/auth/phone')}
|
|
10
|
+
* onContinueWithEmail={() => navigate('/auth/email')}
|
|
11
|
+
* onContinueWithGoogle={() => navigate('/auth/google')}
|
|
12
|
+
* onContinueWithApple={() => navigate('/auth/apple')}
|
|
13
|
+
* />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const MainLoginPage: (props: Readonly<MainLoginPageProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MainAuthPageHandlers, MainLoginPageProps } from '../../types';
|
|
2
|
+
interface MainLoginPageBodyProps {
|
|
3
|
+
handlers: MainAuthPageHandlers;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Renders the main login form body with four authentication options.
|
|
7
|
+
* Each button triggers its corresponding handler from the handlers prop.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MainLoginPageBody: ({ handlers, }: Readonly<MainLoginPageBodyProps>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Login body component without layout wrapper.
|
|
12
|
+
* Displays four authentication method buttons (Mobile, Email, Google, Apple).
|
|
13
|
+
*
|
|
14
|
+
* Use this when you need custom layout or when integrating with AuthFlow.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <MainLogin
|
|
19
|
+
* onContinueWithMobile={() => navigate('/auth/phone')}
|
|
20
|
+
* onContinueWithEmail={() => navigate('/auth/email')}
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function MainLogin(props: Readonly<MainLoginPageProps>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { OtpVerificationPageProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Full OTP verification page with AuthLayoutWrapper and back button.
|
|
4
|
+
* Use when rendering the OTP screen as a standalone page.
|
|
5
|
+
*
|
|
6
|
+
* @example Next.js: API in hook, redirect from consumer
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <OtpVerificationPage
|
|
9
|
+
* mode="phone"
|
|
10
|
+
* recipientDisplay="+91 9825910X0X"
|
|
11
|
+
* onBack={() => router.back()}
|
|
12
|
+
* submitApi={(otp) => api.verifyOtp(otp)}
|
|
13
|
+
* onSuccess={() => router.push('/dashboard')}
|
|
14
|
+
* onResendCode={() => api.resendOtp()}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example Sync callback (AuthFlow)
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <OtpVerificationPage onSubmit={(otp) => actions.verifyOtp(otp)} ... />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function OtpVerificationPage(props: Readonly<OtpVerificationPageProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { OtpVerificationProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* OTP verification form body without layout wrapper.
|
|
4
|
+
* 6-digit OTP input, resend countdown, and submit. Use inside your own layout or AuthFlow.
|
|
5
|
+
* Validation per edge cases 6, 7 (invalid/expired OTP); cursor focus on first OTP box (#26).
|
|
6
|
+
*
|
|
7
|
+
* @example With submitApi + onSuccess (consumer redirect)
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <OtpVerification
|
|
10
|
+
* mode="phone"
|
|
11
|
+
* recipientDisplay="+91 9825910X0X"
|
|
12
|
+
* submitApi={(otp) => api.verifyOtp(otp)}
|
|
13
|
+
* onSuccess={() => router.push('/dashboard')}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Sync onSubmit (AuthFlow)
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <OtpVerification onSubmit={(otp) => actions.verifyOtp(otp)} ... />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function OtpVerification(props: Readonly<OtpVerificationProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RepeatLoginPageProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Full Repeat Login page with AuthLayoutWrapper, logo, title, description, and footer.
|
|
4
|
+
* Use when rendering the repeat login screen as a standalone page.
|
|
5
|
+
*
|
|
6
|
+
* @example Next.js: API in lib, redirect from consumer
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <RepeatLoginPage
|
|
9
|
+
* lastUsedMethod="Mobile"
|
|
10
|
+
* continueApi={() => api.validateSession()}
|
|
11
|
+
* onSuccess={() => router.push('/dashboard')}
|
|
12
|
+
* onUseAnotherMethod={() => resetFlow()}
|
|
13
|
+
* />
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @example Sync (AuthFlow)
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <RepeatLoginPage
|
|
19
|
+
* onContinueWithLastMethod={() => actions.continueWithLastMethod()}
|
|
20
|
+
* onUseAnotherMethod={() => actions.reset()}
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function RepeatLoginPage(props: Readonly<RepeatLoginPageProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RepeatLoginProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Repeat login body without layout wrapper.
|
|
4
|
+
* Primary CTA (continue with last method) and secondary "Use another method" button.
|
|
5
|
+
* When continueApi is provided, primary runs: continueApi() → onSuccess() (e.g. redirect).
|
|
6
|
+
*
|
|
7
|
+
* @example With continueApi + onSuccess (consumer redirect)
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <RepeatLogin
|
|
10
|
+
* lastUsedMethod="Mobile"
|
|
11
|
+
* continueApi={() => api.validateSession()}
|
|
12
|
+
* onSuccess={() => router.push('/dashboard')}
|
|
13
|
+
* onUseAnotherMethod={() => resetFlow()}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Sync (AuthFlow)
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <RepeatLogin
|
|
20
|
+
* onContinueWithLastMethod={() => actions.continueWithLastMethod()}
|
|
21
|
+
* onUseAnotherMethod={() => actions.reset()}
|
|
22
|
+
* />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function RepeatLogin(props: Readonly<RepeatLoginProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SignupPageFullProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Full signup page: AuthLayoutWrapper + logo + title + description + {@link Signup} form.
|
|
4
|
+
* Use when rendering signup as a standalone route. For embedding in a custom layout, use {@link Signup} directly.
|
|
5
|
+
*/
|
|
6
|
+
export declare function SignupPage(props: Readonly<SignupPageFullProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SignupPageProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Form-only signup component (no layout wrapper). Use inside a custom layout or AuthFlow.
|
|
4
|
+
* Supports `submitApi` (async, hook-driven — future SSO profile completion plugs in here)
|
|
5
|
+
* and `onSubmit` (sync, caller-driven via AuthFlow actions).
|
|
6
|
+
*/
|
|
7
|
+
export declare function Signup(props: Readonly<SignupPageProps>): import("react/jsx-runtime").JSX.Element;
|
package/dist/pages.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { L as e, a as n, M as g, b as s, O as o, c as t, R as p, d as L, S as r, e as P } from "./signup-page-
|
|
2
|
+
import { L as e, a as n, M as g, b as s, O as o, c as t, R as p, d as L, S as r, e as P } from "./signup-page-ChXnxtSS.js";
|
|
3
3
|
export {
|
|
4
4
|
e as LoginEntry,
|
|
5
5
|
n as LoginEntryPage,
|