doct-ui-auth-kit 1.0.13 → 1.0.15
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/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 +1 -1
- 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 +1 -1
- 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 +3 -3
- 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 +321 -313
- 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 → signup-page-LsYojX4-.js} +43 -38
- 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 +133 -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/otp-verification.d.ts +1 -1
- 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 +110 -109
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { type EmailFormValues, type LoginEntryFormValues, type LoginEntryMode, type PhoneFormValues, type UseLoginEntryFormOptions, type UseLoginEntryFormReturn, useLoginEntryForm, } from './use-login-entry-form';
|
|
2
|
+
export { type MainAuthPageHandlers, type MainLoginAppleProviderConfig, type MainLoginGoogleProviderConfig, type MainLoginPageProvidersConfig, type UseMainAuthPageHandlersOptions, useMainAuthPageHandlers, } from './use-main-auth-page-handlers';
|
|
3
|
+
export { DEFAULT_OTP_TITLES, OTP_LENGTH, type OtpFormValues, type OtpVerificationMode, RESEND_COOLDOWN_EMAIL_SECONDS, RESEND_COOLDOWN_PHONE_SECONDS, type UseOtpVerificationOptions, type UseOtpVerificationReturn, useOtpVerification, } from './use-otp-verification';
|
|
4
|
+
export { type UseRepeatLoginOptions, type UseRepeatLoginReturn, useRepeatLogin, } from './use-repeat-login';
|
|
5
|
+
export { type SignupEmailFormValues, type SignupEntryMode, type SignupFormValues, type SignupPhoneFormValues, type UseSignupFormOptions, type UseSignupFormReturn, useSignupForm, } from './use-signup-form';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { UseLoginEntryFormOptions, UseLoginEntryFormReturn } from '../types';
|
|
2
|
+
export type { EmailFormValues, LoginEntryFormValues, LoginEntryMode, LoginEntrySubmitData, LoginEntrySuccessParams, PhoneFormValues, UseLoginEntryFormOptions, UseLoginEntryFormReturn, } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Form state and validation for the login entry screen (phone or email).
|
|
5
|
+
*
|
|
6
|
+
* **Dual submission pattern:**
|
|
7
|
+
* - `submitApi` (async): hook owns the flow — validate → submitApi(data) → onSuccess(). Future SSO API integration plugs in here.
|
|
8
|
+
* - `onSubmit` (sync): caller owns the flow — hook validates then hands data back (used by AuthFlow).
|
|
9
|
+
*
|
|
10
|
+
* **Validation flow:** RHF form data → Zod schema (loginSchemas[mode]) → setFormErrorsFromZod → field-level errors.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useLoginEntryForm({ mode, onSubmit, submitApi, onSuccess, onError, }: UseLoginEntryFormOptions): UseLoginEntryFormReturn;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MainAuthPageHandlers, UseMainAuthPageHandlersOptions } from '../types';
|
|
2
|
+
export type { MainAuthPageHandlers, MainLoginAppleProviderConfig, MainLoginGoogleProviderConfig, MainLoginPageProvidersConfig, UseMainAuthPageHandlersOptions, } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Centralizes Google/Apple OAuth and auth-method CTA handlers for the main login page.
|
|
5
|
+
* When `providers.google` / `providers.apple` are configured, the SDK runs the OAuth flow internally
|
|
6
|
+
* and calls `onCredential`; otherwise falls back to consumer-supplied overrides or no-op defaults.
|
|
7
|
+
* Consumer apps pass callbacks (e.g. `onContinueWithMobile`) to wire navigation.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useMainAuthPageHandlers(options?: Readonly<UseMainAuthPageHandlersOptions>): MainAuthPageHandlers;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { OtpVerificationMode, UseOtpVerificationOptions, UseOtpVerificationReturn } from '
|
|
2
|
-
export type { OtpFormValues, OtpValidateFn, OtpVerificationMode, UseOtpVerificationOptions, UseOtpVerificationReturn, } from '
|
|
1
|
+
import type { OtpVerificationMode, UseOtpVerificationOptions, UseOtpVerificationReturn } from '../types';
|
|
2
|
+
export type { OtpFormValues, OtpValidateFn, OtpVerificationMode, UseOtpVerificationOptions, UseOtpVerificationReturn, } from '../types';
|
|
3
3
|
/** Instruction line below recipient (Figma: "Kindly check your Email Inbox."). */
|
|
4
4
|
export declare const DEFAULT_OTP_INSTRUCTIONS: Record<OtpVerificationMode, string>;
|
|
5
5
|
export declare const DEFAULT_OTP_TITLES: Record<OtpVerificationMode, string>;
|
|
6
6
|
/** Re-export for consumers who import from hooks. */
|
|
7
|
-
export { getResendCooldownSeconds, OTP_LENGTH, RESEND_COOLDOWN_EMAIL_SECONDS, RESEND_COOLDOWN_PHONE_SECONDS, } from '
|
|
7
|
+
export { getResendCooldownSeconds, OTP_LENGTH, RESEND_COOLDOWN_EMAIL_SECONDS, RESEND_COOLDOWN_PHONE_SECONDS, } from '../validations';
|
|
8
8
|
/**
|
|
9
9
|
* Form state, resend countdown, and validation for OTP verification.
|
|
10
10
|
*
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UseRepeatLoginOptions, UseRepeatLoginReturn } from '../types';
|
|
2
|
+
export type { UseRepeatLoginOptions, UseRepeatLoginReturn } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Business logic for repeat login (device-based returning-user detection).
|
|
5
|
+
*
|
|
6
|
+
* **Dual submission:** `continueApi` (async, hook owns flow) vs `onContinueWithLastMethod` (sync, caller owns flow).
|
|
7
|
+
* Last-used method is read from localStorage by the provider and passed down as a prop.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useRepeatLogin(options?: UseRepeatLoginOptions): UseRepeatLoginReturn;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { UseSignupFormOptions, UseSignupFormReturn } from '../types';
|
|
2
|
+
export type { SignupEmailFormValues, SignupEntryMode, SignupForeignFormValues, SignupFormValues, SignupPhoneFormValues, SignupSubmitData, UseSignupFormOptions, UseSignupFormReturn, } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Form state and validation for the signup screen (full name + phone or email, or foreign: all three).
|
|
5
|
+
*
|
|
6
|
+
* **Dual submission pattern:**
|
|
7
|
+
* - `submitApi` (async): hook owns the flow — validate → submitApi(data) → onSuccess(). Future SSO profile completion plugs in here.
|
|
8
|
+
* - `onSubmit` (sync): caller owns the flow — hook validates then hands data back (used by AuthFlow).
|
|
9
|
+
*
|
|
10
|
+
* **Validation flow:** RHF form data → Zod schema (signupSchemas[mode]) → setFormErrorsFromZod → field-level errors.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useSignupForm({ mode, defaultPhone, onSubmit, submitApi, onSuccess, onError, }: UseSignupFormOptions): UseSignupFormReturn;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth SDK UI Kit – library entry point.
|
|
3
|
+
* Consumers can import components, layouts (composition + preset), hooks, core (SSO provider, flow, session), and auth methods.
|
|
4
|
+
*
|
|
5
|
+
* Import the kit styles once globally in your app (e.g. in main.tsx):
|
|
6
|
+
* `import 'doct-ui-auth-kit/style.css';`
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import {
|
|
11
|
+
* SSOAuthProvider,
|
|
12
|
+
* AuthFlow,
|
|
13
|
+
* useAuthFlow,
|
|
14
|
+
* useAuthSession,
|
|
15
|
+
* MainLayout,
|
|
16
|
+
* AuthLayout,
|
|
17
|
+
* ImageSlider,
|
|
18
|
+
* AuthLayoutWrapper,
|
|
19
|
+
* LoginEntry,
|
|
20
|
+
* OtpVerification,
|
|
21
|
+
* useGoogleAuth,
|
|
22
|
+
* } from 'doct-ui-auth-kit';
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
import './index.css';
|
|
26
|
+
export { createHttpAuthAdapter } from './adapters';
|
|
27
|
+
export { Auth } from './auth';
|
|
28
|
+
export type { UseAppleSignInOptions, UseGoogleAuthOptions, UseGoogleAuthReturn, } from './auth-methods';
|
|
29
|
+
export { useAppleSignIn, useGoogleAuth } from './auth-methods';
|
|
30
|
+
export type { BackButtonProps } from './components/common';
|
|
31
|
+
export { BackButton, DefaultFooter, EnterpriseHeader, } from './components/common';
|
|
32
|
+
export type { AuthLayoutPresetProps, AuthLayoutType, AuthLayoutWrapperProps, } from './components/layout';
|
|
33
|
+
export { AuthLayout, AuthLayoutPreset, AuthLayoutWrapper, ImageSlider, MainLayout, } from './components/layout';
|
|
34
|
+
export * from './core';
|
|
35
|
+
export * from './hooks';
|
|
36
|
+
export type { LoginEntryPageProps, LoginEntryProps, MainLoginPageProps, MainLoginPageProvidersConfig, OtpVerificationPageProps, OtpVerificationProps, RepeatLoginPageProps, RepeatLoginProps, SignupPageFullProps, SignupPageProps, } from './pages/index';
|
|
37
|
+
export { LoginEntry, LoginEntryPage, MainLogin, MainLoginPage, OtpVerification, OtpVerificationPage, RepeatLogin, RepeatLoginPage, Signup, SignupPage, } from './pages/index';
|
|
38
|
+
export * from './types';
|