doct-ui-auth-kit 1.0.6 → 1.0.7

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.
Files changed (50) hide show
  1. package/dist/adapters/http-auth-adapter.d.ts +1 -5
  2. package/dist/auth/index.d.ts +2 -2
  3. package/dist/components/form/rhf-doct-phone-input.d.ts +1 -1
  4. package/dist/components/form/rhf-input-field.d.ts +1 -1
  5. package/dist/components/form/rhf-otp-input-field.d.ts +1 -1
  6. package/dist/components/layout/auth-layout-preset.d.ts +7 -2
  7. package/dist/components/layout/auth-layout-public.d.ts +8 -12
  8. package/dist/components/layout/auth-layout-wrapper.d.ts +21 -2
  9. package/dist/components/layout/auth-layout.d.ts +1 -1
  10. package/dist/components/layout/image-slider.d.ts +2 -2
  11. package/dist/components/layout/main-layout.d.ts +2 -2
  12. package/dist/constants/layout-presets.d.ts +1 -5
  13. package/dist/core/auth-api-adapter.d.ts +1 -1
  14. package/dist/core/auth-context.d.ts +5 -5
  15. package/dist/core/auth-provider.d.ts +2 -2
  16. package/dist/core/auth-types.d.ts +1 -1
  17. package/dist/core/device-detection.d.ts +2 -6
  18. package/dist/core/sso-session.d.ts +2 -6
  19. package/dist/core/use-auth-flow.d.ts +2 -6
  20. package/dist/hooks/use-login-entry-form.d.ts +2 -2
  21. package/dist/hooks/use-main-auth-page-handlers.d.ts +2 -2
  22. package/dist/hooks/use-otp-verification.d.ts +3 -3
  23. package/dist/hooks/use-repeat-login.d.ts +2 -2
  24. package/dist/hooks/use-signup-form.d.ts +2 -2
  25. package/dist/index.d.ts +11 -36
  26. package/dist/pages/login-entry.d.ts +2 -2
  27. package/dist/pages/main-login.d.ts +2 -2
  28. package/dist/pages/otp-verification.d.ts +2 -2
  29. package/dist/pages/repeat-login.d.ts +2 -2
  30. package/dist/pages/signup.d.ts +4 -2
  31. package/dist/types/auth-api-adapter.d.ts +1 -5
  32. package/dist/types/auth-layout-types.d.ts +1 -1
  33. package/dist/types/auth-provider.d.ts +7 -4
  34. package/dist/types/device-detection.d.ts +4 -1
  35. package/dist/types/flow.d.ts +1 -4
  36. package/dist/types/forms.d.ts +28 -2
  37. package/dist/types/layout-presets.d.ts +1 -6
  38. package/dist/types/layout.d.ts +1 -1
  39. package/dist/types/login-form.d.ts +10 -3
  40. package/dist/types/main-login.d.ts +11 -0
  41. package/dist/types/otp-verification.d.ts +13 -3
  42. package/dist/types/pages.d.ts +5 -8
  43. package/dist/types/repeat-login.d.ts +1 -0
  44. package/dist/types/signup-form.d.ts +10 -3
  45. package/dist/utils/set-form-errors-from-zod.d.ts +1 -1
  46. package/dist/validations/schemas.d.ts +0 -4
  47. package/package.json +2 -2
  48. package/dist/stories/components/default-footer.d.ts +0 -5
  49. package/dist/stories/components/enterprise-header.d.ts +0 -5
  50. package/dist/stories/components/index.d.ts +0 -2
@@ -1,8 +1,4 @@
1
- /**
2
- * HTTP adapter that calls a compatible auth API (e.g. doct-auth-mock-api).
3
- * Use with SSOAuthProvider: apiAdapter: createHttpAuthAdapter('http://localhost:3001')
4
- */
5
- import type { AuthApiAdapter } from '@/core/auth-api-adapter';
1
+ import { AuthApiAdapter } from '../core/auth-api-adapter';
6
2
  /**
7
3
  * Creates an AuthApiAdapter that calls the given API base URL.
8
4
  * Expects routes: POST /api/auth/send-otp, verify-otp, complete-profile,
@@ -1,6 +1,6 @@
1
1
  import { SSOAuthProvider } from '../core/auth-provider';
2
- import type { OtpVerificationProps } from '../pages/otp-verification';
3
- import type { SignupPageProps } from '../pages/signup';
2
+ import { OtpVerificationProps } from '../pages/otp-verification';
3
+ import { SignupPageProps } from '../pages/signup';
4
4
  /** Simple API: full login/signup flow (method select → identifier → OTP → profile). Use inside Auth.Provider. */
5
5
  declare function AuthLogin(): React.ReactElement;
6
6
  /** Simple API: signup (profile completion) screen with signup layout preset. Layout only; pass props for behavior. */
@@ -1,2 +1,2 @@
1
- import type { RHFDoctPhoneInputFieldProps } from '@/types/forms';
1
+ import { RHFDoctPhoneInputFieldProps } from '../../types/forms';
2
2
  export declare function RHFDoctPhoneInputField({ name, label, placeholder, helperText, defaultCountry, variant, required, disabled, control, error, autoFocus, }: RHFDoctPhoneInputFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import type { RHFInputFieldProps } from '@/types/forms';
1
+ import { RHFInputFieldProps } from '../../types/forms';
2
2
  export declare function RHFInputField({ name, label, placeholder, className, control, required, type, disabled, onKeyDown, maxLength, numericOnly, autoFocus, }: RHFInputFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import type { RHFOtpInputFieldProps } from '@/types/forms';
1
+ import { RHFOtpInputFieldProps } from '../../types/forms';
2
2
  export declare function RHFOtpInputField({ name, label, className, control, length, inputClassName, autoFocus, }: RHFOtpInputFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
- import type { ReactNode } from 'react';
2
- import type { LayoutPresetName } from '../../types/layout-presets';
1
+ import { ReactNode } from 'react';
2
+ import { LayoutPresetName } from '../../types/layout-presets';
3
3
  export interface AuthLayoutPresetProps {
4
4
  /**
5
5
  * Preset name. Controls structure only (layoutType, variant, maxWidth, contentWidth, align).
@@ -10,10 +10,15 @@ export interface AuthLayoutPresetProps {
10
10
  children: ReactNode;
11
11
  /** Optional slot overrides. When not provided, slot is empty. */
12
12
  logo?: ReactNode;
13
+ /** Title element or string rendered below the logo. */
13
14
  title?: ReactNode;
15
+ /** Description element or string rendered below the title. */
14
16
  description?: ReactNode;
17
+ /** Footer element rendered at the bottom of the layout. */
15
18
  footer?: ReactNode;
19
+ /** Header element rendered above the main content area. */
16
20
  header?: ReactNode;
21
+ /** Custom back button element rendered in place of the logo slot. */
17
22
  backButton?: ReactNode;
18
23
  /** Extra class for root. */
19
24
  className?: string;
@@ -1,17 +1,13 @@
1
- /**
2
- * Public AuthLayout API: compound components + preset-based layout.
3
- * Merged here to avoid circular dependencies (preset uses wrapper, wrapper uses compound).
4
- */
5
1
  import { AuthLayoutPreset } from './auth-layout-preset';
6
2
  /** Compound layout + preset-based layout. Use .Root/.Header/... for composition, .Preset for preset. */
7
3
  export declare const AuthLayout: {
8
4
  Preset: typeof AuthLayoutPreset;
9
- Root: ({ children, variant, maxWidth, className, contentClassName, }: Readonly<import(".").AuthLayoutRootProps>) => import("react/jsx-runtime").JSX.Element;
10
- Header: ({ children, className, }: Readonly<import(".").AuthLayoutHeaderProps>) => import("react/jsx-runtime").JSX.Element;
11
- Main: ({ children, sm, className, }: Readonly<import(".").AuthLayoutMainProps>) => import("react/jsx-runtime").JSX.Element;
12
- Logo: ({ children, align, className, }: Readonly<import(".").AuthLayoutLogoProps>) => import("react/jsx-runtime").JSX.Element;
13
- Title: ({ children, align, className, }: Readonly<import(".").AuthLayoutTitleProps>) => import("react/jsx-runtime").JSX.Element;
14
- Description: ({ children, align, className, }: Readonly<import(".").AuthLayoutDescriptionProps>) => import("react/jsx-runtime").JSX.Element;
15
- Body: ({ children, className, }: Readonly<import(".").AuthLayoutBodyProps>) => import("react/jsx-runtime").JSX.Element;
16
- Footer: ({ children, className, }: Readonly<import(".").AuthLayoutFooterProps>) => import("react/jsx-runtime").JSX.Element;
5
+ Root: ({ children, variant, maxWidth, className, contentClassName, }: Readonly<import('.').AuthLayoutRootProps>) => import("react/jsx-runtime").JSX.Element;
6
+ Header: ({ children, className, }: Readonly<import('.').AuthLayoutHeaderProps>) => import("react/jsx-runtime").JSX.Element;
7
+ Main: ({ children, sm, className, }: Readonly<import('.').AuthLayoutMainProps>) => import("react/jsx-runtime").JSX.Element;
8
+ Logo: ({ children, align, className, }: Readonly<import('.').AuthLayoutLogoProps>) => import("react/jsx-runtime").JSX.Element;
9
+ Title: ({ children, align, className, }: Readonly<import('.').AuthLayoutTitleProps>) => import("react/jsx-runtime").JSX.Element;
10
+ Description: ({ children, align, className, }: Readonly<import('.').AuthLayoutDescriptionProps>) => import("react/jsx-runtime").JSX.Element;
11
+ Body: ({ children, className, }: Readonly<import('.').AuthLayoutBodyProps>) => import("react/jsx-runtime").JSX.Element;
12
+ Footer: ({ children, className, }: Readonly<import('.').AuthLayoutFooterProps>) => import("react/jsx-runtime").JSX.Element;
17
13
  };
@@ -1,23 +1,42 @@
1
- import { type ReactNode } from 'react';
2
- import type { AuthLayoutAlign, AuthLayoutMaxWidth, AuthLayoutVariant } from '../../types/auth-layout-types';
1
+ import { ReactNode } from 'react';
2
+ import { AuthLayoutAlign, AuthLayoutMaxWidth, AuthLayoutVariant } from '../../types/auth-layout-types';
3
+ /** Layout mode: `'withSlider'` renders inside a split-screen with an image slider, `'standalone'` renders without. */
3
4
  export type AuthLayoutType = 'withSlider' | 'standalone';
5
+ /** Props for the AuthLayoutWrapper component that assembles the auth page shell. */
4
6
  export interface AuthLayoutWrapperProps {
7
+ /** Main content (typically the form body) rendered inside the layout. */
5
8
  children: ReactNode;
9
+ /** Layout mode controlling the outer chrome. @default `'withSlider'` */
6
10
  layoutType?: AuthLayoutType;
11
+ /** Logo or back-button element rendered at the top of the content area. */
7
12
  logo?: ReactNode;
13
+ /** Heading element or string rendered below the logo. */
8
14
  title?: ReactNode;
15
+ /** Descriptive text or element rendered below the title. */
9
16
  description?: ReactNode;
17
+ /** Footer element rendered at the bottom of the content area. */
10
18
  footer?: ReactNode;
19
+ /** Header element rendered above the main content area. */
11
20
  header?: ReactNode;
21
+ /** Called when the back button is clicked. Pass `null` to hide the back button explicitly. */
12
22
  onBack?: (() => void) | null;
23
+ /** Custom back button element. When provided, overrides the default back arrow button. */
13
24
  backButton?: ReactNode;
25
+ /** Image URLs for the slider panel (only used when `layoutType` is `'withSlider'`). */
14
26
  sliderImages?: string[];
27
+ /** Auto-play interval in milliseconds for the slider. */
15
28
  sliderAutoPlayInterval?: number;
29
+ /** Titles displayed alongside each slider image. */
16
30
  sliderTitles?: (ReactNode | string)[];
31
+ /** Layout variant controlling responsive behavior (e.g. `'desktop'`, `'mobile'`). */
17
32
  variant?: AuthLayoutVariant;
33
+ /** Maximum width constraint for the content area (e.g. `'sm'`, `'md'`, `'lg'`). @default `'sm'` */
18
34
  maxWidth?: AuthLayoutMaxWidth;
35
+ /** Content width preset: `'sm'` for narrow forms, `'default'` for standard width. @default `'default'` */
19
36
  contentWidth?: 'sm' | 'default';
37
+ /** Horizontal alignment of logo, title, and description. @default `'center'` */
20
38
  align?: AuthLayoutAlign;
39
+ /** Additional CSS class name(s) applied to the outermost layout element. */
21
40
  className?: string;
22
41
  }
23
42
  export declare function AuthLayoutWrapper({ children, layoutType, logo, title, description, footer, header, onBack, backButton, sliderImages, sliderAutoPlayInterval, sliderTitles, variant, maxWidth, contentWidth, align, className, }: AuthLayoutWrapperProps): React.ReactElement;
@@ -1,4 +1,4 @@
1
- import type { AuthLayoutBodyProps, AuthLayoutDescriptionProps, AuthLayoutFooterProps, AuthLayoutHeaderProps, AuthLayoutLogoProps, AuthLayoutMainProps, AuthLayoutRootProps, AuthLayoutTitleProps } from '../../types/auth-layout-types';
1
+ import { AuthLayoutBodyProps, AuthLayoutDescriptionProps, AuthLayoutFooterProps, AuthLayoutHeaderProps, AuthLayoutLogoProps, AuthLayoutMainProps, AuthLayoutRootProps, AuthLayoutTitleProps } from '../../types/auth-layout-types';
2
2
  /**
3
3
  * Root container component for auth layouts.
4
4
  * Provides layout context to child slot components.
@@ -1,5 +1,5 @@
1
- import type { ImageSliderProps } from '@/types';
2
- export type { ImageSliderProps } from '@/types';
1
+ import { ImageSliderProps } from '../../types';
2
+ export type { ImageSliderProps } from '../../types';
3
3
  /**
4
4
  * Image slider component with indicator dots.
5
5
  * Supports both controlled and uncontrolled modes.
@@ -1,5 +1,5 @@
1
- import type { MainLayoutProps, MarketingPanelProps } from '@/types';
2
- export type { MainLayoutProps, MarketingPanelProps } from '@/types';
1
+ import { MainLayoutProps, MarketingPanelProps } from '../../types';
2
+ export type { MainLayoutProps, MarketingPanelProps } from '../../types';
3
3
  /**
4
4
  * Marketing panel component - displays CTA, image slider, and indicators
5
5
  */
@@ -1,8 +1,4 @@
1
- /**
2
- * Layout preset configurations. Structure only — no auth behavior.
3
- * Used by AuthLayout when preset="login" | "signup" | "verification".
4
- */
5
- import type { LayoutPresetConfig, LayoutPresetName } from '../types/layout-presets';
1
+ import { LayoutPresetConfig, LayoutPresetName } from '../types/layout-presets';
6
2
  /**
7
3
  * Returns layout structure config for a preset name.
8
4
  * Empty string returns undefined (caller uses full composition / no preset).
@@ -3,4 +3,4 @@
3
3
  * Consumers implement this to connect the SDK to their central auth service.
4
4
  * The SDK never performs HTTP calls directly.
5
5
  */
6
- export type { AuthApiAdapter, SendOtpParams, VerifyOtpParams, } from '@/types';
6
+ export type { AuthApiAdapter, SendOtpParams, VerifyOtpParams, } from '../types';
@@ -1,6 +1,6 @@
1
- import type { AuthFlowContextValue } from '@/types';
2
- export type { AuthFlowActions, AuthFlowContextValue, AuthFlowProviderConfig, } from '@/types';
3
- export declare const AuthFlowContext: import("react").Context<AuthFlowContextValue | null>;
1
+ import { AuthFlowContextValue } from '../types';
2
+ export type { AuthFlowActions, AuthFlowContextValue, AuthFlowProviderConfig, } from '../types';
3
+ export declare const AuthFlowContext: import('react').Context<AuthFlowContextValue | null>;
4
4
  /**
5
5
  * Hook to access auth flow state and actions. Must be used within SSOAuthProvider.
6
6
  */
@@ -9,9 +9,9 @@ export declare function useAuthFlow(): AuthFlowContextValue;
9
9
  * Hook to access SSO session state only. Must be used within SSOAuthProvider.
10
10
  */
11
11
  export declare function useAuthSession(): {
12
- session: import("@/types").SSOSession | null;
12
+ session: import('../types').SSOSession | null;
13
13
  isAuthenticated: boolean;
14
14
  isLoading: boolean;
15
15
  signOut: () => void;
16
- authMethod: import("@/types").AuthMethod | null;
16
+ authMethod: import('../types').AuthMethod | null;
17
17
  };
@@ -1,5 +1,5 @@
1
- import type { SSOAuthProviderProps } from '@/types';
2
- export type { SSOAuthConfig, SSOAuthProviderProps } from '@/types';
1
+ import { SSOAuthProviderProps } from '../types';
2
+ export type { SSOAuthConfig, SSOAuthProviderProps } from '../types';
3
3
  /**
4
4
  * SSO Auth provider: runs session check on mount, holds flow state, and provides async actions.
5
5
  */
@@ -2,4 +2,4 @@
2
2
  * Re-export of auth domain types from central types folder.
3
3
  * Prefer importing from @/types; this file keeps @/core/auth-types working.
4
4
  */
5
- export type { AuthError, AuthErrorCode, AuthenticateWithProviderParams, AuthMethod, AuthStep, CompleteProfileParams, RepeatLoginInfo, SendOtpResponse, SSOSession, SSOUser, UserType, VerifyOtpResponse, } from '@/types';
5
+ export type { AuthError, AuthErrorCode, AuthenticateWithProviderParams, AuthMethod, AuthStep, CompleteProfileParams, RepeatLoginInfo, SendOtpResponse, SSOSession, SSOUser, UserType, VerifyOtpResponse, } from '../types';
@@ -1,9 +1,5 @@
1
- /**
2
- * Device-based repeat login detection.
3
- * Stores last-used method and masked identifier in localStorage (device-local UX only).
4
- */
5
- import type { StoredRepeatLogin } from '@/types';
6
- export type { StoredRepeatLogin } from '@/types';
1
+ import { StoredRepeatLogin } from '../types';
2
+ export type { StoredRepeatLogin } from '../types';
7
3
  /**
8
4
  * Reads repeat-login info from localStorage if present.
9
5
  * Safe to call in browser; returns null in SSR or when not found.
@@ -1,9 +1,5 @@
1
- /**
2
- * SSO session management: token persistence strategies and useAuthSession hook.
3
- * Token storage is consumer-configurable for cross-app SSO (e.g. shared cookie domain).
4
- */
5
- import type { AxiosAuthInterceptorInstance, TokenStorageStrategy } from '@/types';
6
- export type { AxiosAuthInterceptorInstance, AxiosRequestConfig, TokenStorageStrategy, } from '@/types';
1
+ import { AxiosAuthInterceptorInstance, TokenStorageStrategy } from '../types';
2
+ export type { AxiosAuthInterceptorInstance, AxiosRequestConfig, TokenStorageStrategy, } from '../types';
7
3
  /**
8
4
  * Token storage using localStorage (single-origin).
9
5
  * Suitable for dev or when all Docthub apps share the same origin.
@@ -1,9 +1,5 @@
1
- /**
2
- * Auth flow state machine: reducer and state type.
3
- * Side effects (API calls, token persistence) are performed by the provider; this module is pure.
4
- */
5
- import type { AuthFlowAction, AuthFlowState, AuthStep } from '@/types';
6
- export type { AuthFlowAction, AuthFlowState, IdentifierType } from '@/types';
1
+ import { AuthFlowAction, AuthFlowState, AuthStep } from '../types';
2
+ export type { AuthFlowAction, AuthFlowState, IdentifierType } from '../types';
7
3
  export declare const INITIAL_STEP: AuthStep;
8
4
  export declare function getInitialAuthFlowState(): AuthFlowState;
9
5
  export declare function authFlowReducer(state: AuthFlowState, action: AuthFlowAction): AuthFlowState;
@@ -1,5 +1,5 @@
1
- import type { UseLoginEntryFormOptions, UseLoginEntryFormReturn } from '@/types';
2
- export type { EmailFormValues, LoginEntryFormValues, LoginEntryMode, LoginEntrySubmitData, LoginEntrySuccessParams, PhoneFormValues, UseLoginEntryFormOptions, UseLoginEntryFormReturn, } from '@/types';
1
+ import { UseLoginEntryFormOptions, UseLoginEntryFormReturn } from '../types';
2
+ export type { EmailFormValues, LoginEntryFormValues, LoginEntryMode, LoginEntrySubmitData, LoginEntrySuccessParams, PhoneFormValues, UseLoginEntryFormOptions, UseLoginEntryFormReturn, } from '../types';
3
3
  /**
4
4
  * Form state and validation for the login entry screen (phone or email).
5
5
  * Business logic: when submitApi is provided, hook runs validate → submitApi(data) → onSuccess() (e.g. redirect).
@@ -1,5 +1,5 @@
1
- import type { MainAuthPageHandlers, UseMainAuthPageHandlersOptions } from '@/types';
2
- export type { MainAuthPageHandlers, MainLoginAppleProviderConfig, MainLoginGoogleProviderConfig, MainLoginPageProvidersConfig, UseMainAuthPageHandlersOptions, } from '@/types';
1
+ import { MainAuthPageHandlers, UseMainAuthPageHandlersOptions } from '../types';
2
+ export type { MainAuthPageHandlers, MainLoginAppleProviderConfig, MainLoginGoogleProviderConfig, MainLoginPageProvidersConfig, UseMainAuthPageHandlersOptions, } from '../types';
3
3
  /**
4
4
  * Main auth page business logic: resolves CTA handlers from optional overrides and optional provider config.
5
5
  * When providers.google / providers.apple are set, the lib runs Google/Apple OAuth and calls onCredential;
@@ -1,10 +1,10 @@
1
- import type { OtpVerificationMode, UseOtpVerificationOptions, UseOtpVerificationReturn } from '@/types';
2
- export type { OtpFormValues, OtpVerificationMode, UseOtpVerificationOptions, UseOtpVerificationReturn, } from '@/types';
1
+ import { OtpVerificationMode, UseOtpVerificationOptions, UseOtpVerificationReturn } from '../types';
2
+ export type { OtpFormValues, 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 '@/validations';
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
  * When submitApi is provided, hook runs: validate → submitApi(otp) → onSuccess() (e.g. redirect).
@@ -1,5 +1,5 @@
1
- import type { UseRepeatLoginOptions, UseRepeatLoginReturn } from '@/types';
2
- export type { UseRepeatLoginOptions, UseRepeatLoginReturn } from '@/types';
1
+ import { UseRepeatLoginOptions, UseRepeatLoginReturn } from '../types';
2
+ export type { UseRepeatLoginOptions, UseRepeatLoginReturn } from '../types';
3
3
  /**
4
4
  * Business logic for repeat login: continue with last method (sync or async via continueApi).
5
5
  * When continueApi is provided, runs: continueApi() → onSuccess(); otherwise calls onContinueWithLastMethod.
@@ -1,5 +1,5 @@
1
- import type { UseSignupFormOptions, UseSignupFormReturn } from '@/types';
2
- export type { SignupEmailFormValues, SignupEntryMode, SignupForeignFormValues, SignupFormValues, SignupPhoneFormValues, SignupSubmitData, UseSignupFormOptions, UseSignupFormReturn, } from '@/types';
1
+ import { UseSignupFormOptions, UseSignupFormReturn } from '../types';
2
+ export type { SignupEmailFormValues, SignupEntryMode, SignupForeignFormValues, SignupFormValues, SignupPhoneFormValues, SignupSubmitData, UseSignupFormOptions, UseSignupFormReturn, } from '../types';
3
3
  /**
4
4
  * Form state and validation for the signup screen (full name + phone or email, or foreign: all three).
5
5
  * When submitApi is provided, hook runs: validate → submitApi(data) → onSuccess() (e.g. redirect).
package/dist/index.d.ts CHANGED
@@ -1,36 +1,11 @@
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 { AuthLayoutPresetProps, AuthLayoutType, AuthLayoutWrapperProps, } from '@/components/layout';
31
- export { AuthLayout, AuthLayoutPreset, AuthLayoutWrapper, ImageSlider, MainLayout, } from '@/components/layout';
32
- export * from '@/core';
33
- export * from '@/hooks';
34
- export type { LoginEntryPageProps, LoginEntryProps, MainLoginPageProps, MainLoginPageProvidersConfig, OtpVerificationPageProps, OtpVerificationProps, RepeatLoginPageProps, RepeatLoginProps, SignupPageFullProps, SignupPageProps, } from '@/pages';
35
- export { LoginEntry, LoginEntryPage, MainLogin, MainLoginPage, OtpVerification, OtpVerificationPage, RepeatLogin, RepeatLoginPage, Signup, SignupPage, } from '@/pages';
36
- export * from '@/types';
1
+ export { createHttpAuthAdapter } from './adapters';
2
+ export { Auth } from './auth';
3
+ export type { UseAppleSignInOptions, UseGoogleAuthOptions, UseGoogleAuthReturn, } from './auth-methods';
4
+ export { useAppleSignIn, useGoogleAuth } from './auth-methods';
5
+ export type { AuthLayoutPresetProps, AuthLayoutType, AuthLayoutWrapperProps, } from './components/layout';
6
+ export { AuthLayout, AuthLayoutPreset, AuthLayoutWrapper, ImageSlider, MainLayout, } from './components/layout';
7
+ export * from './core';
8
+ export * from './hooks';
9
+ export type { LoginEntryPageProps, LoginEntryProps, MainLoginPageProps, MainLoginPageProvidersConfig, OtpVerificationPageProps, OtpVerificationProps, RepeatLoginPageProps, RepeatLoginProps, SignupPageFullProps, SignupPageProps, } from './pages';
10
+ export { LoginEntry, LoginEntryPage, MainLogin, MainLoginPage, OtpVerification, OtpVerificationPage, RepeatLogin, RepeatLoginPage, Signup, SignupPage, } from './pages';
11
+ export * from './types';
@@ -1,5 +1,5 @@
1
- import type { LoginEntryPageProps, LoginEntryProps } from '@/types';
2
- export type { LoginEntryMode, LoginEntryPageProps, LoginEntryProps, } from '@/types';
1
+ import { LoginEntryPageProps, LoginEntryProps } from '../types';
2
+ export type { LoginEntryMode, LoginEntryPageProps, LoginEntryProps, } from '../types';
3
3
  /**
4
4
  * Full LoginEntry page with AuthLayoutWrapper, back button, and slider/standalone layout.
5
5
  * Use when rendering the login entry screen as a standalone page.
@@ -1,5 +1,5 @@
1
- import type { MainLoginPageProps } from '@/types';
2
- export type { MainLoginAppleProviderConfig, MainLoginGoogleProviderConfig, MainLoginPageProps, MainLoginPageProvidersConfig, } from '@/types';
1
+ import { MainLoginPageProps } from '../types';
2
+ export type { MainLoginAppleProviderConfig, MainLoginGoogleProviderConfig, MainLoginPageProps, MainLoginPageProvidersConfig, } from '../types';
3
3
  /**
4
4
  * Full MainLogin page with AuthLayoutWrapper, header, footer, and slider layout.
5
5
  * Includes default branding and layout configuration.
@@ -1,5 +1,5 @@
1
- import type { OtpVerificationPageProps, OtpVerificationProps } from '@/types';
2
- export type { OtpVerificationMode, OtpVerificationPageProps, OtpVerificationProps, } from '@/types';
1
+ import { OtpVerificationPageProps, OtpVerificationProps } from '../types';
2
+ export type { OtpVerificationMode, OtpVerificationPageProps, OtpVerificationProps, } from '../types';
3
3
  /**
4
4
  * Full OTP verification page with AuthLayoutWrapper and back button.
5
5
  * Use when rendering the OTP screen as a standalone page.
@@ -1,5 +1,5 @@
1
- import type { RepeatLoginPageProps, RepeatLoginProps } from '@/types';
2
- export type { RepeatLoginPageProps, RepeatLoginProps } from '@/types';
1
+ import { RepeatLoginPageProps, RepeatLoginProps } from '../types';
2
+ export type { RepeatLoginPageProps, RepeatLoginProps } from '../types';
3
3
  /**
4
4
  * Full Repeat Login page with AuthLayoutWrapper, logo, title, description, and footer.
5
5
  * Use when rendering the repeat login screen as a standalone page.
@@ -1,4 +1,6 @@
1
- import type { SignupPageFullProps, SignupPageProps } from '@/types';
2
- export type { SignupEntryMode, SignupPageFullProps, SignupPageProps, } from '@/types';
1
+ import { SignupPageFullProps, SignupPageProps } from '../types';
2
+ export type { SignupEntryMode, SignupPageFullProps, SignupPageProps, } from '../types';
3
+ /** Full signup page with layout wrapper, logo, title, and description. Renders the {@link Signup} form body inside an `AuthLayoutWrapper`. */
3
4
  export declare function SignupPage(props: Readonly<SignupPageFullProps>): import("react/jsx-runtime").JSX.Element;
5
+ /** Standalone signup form component (without layout). Use inside a custom layout or when layout is handled externally. */
4
6
  export declare function Signup(props: Readonly<SignupPageProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,4 @@
1
- /**
2
- * API adapter types for the SSO auth SDK.
3
- * Consumers implement AuthApiAdapter to connect the SDK to their central auth service.
4
- */
5
- import type { AuthenticateWithProviderParams, CompleteProfileParams, SendOtpResponse, SSOSession, VerifyOtpResponse } from './auth-types';
1
+ import { AuthenticateWithProviderParams, CompleteProfileParams, SendOtpResponse, SSOSession, VerifyOtpResponse } from './auth-types';
6
2
  /** Parameters for sending OTP to phone or email. */
7
3
  export interface SendOtpParams {
8
4
  type: 'phone' | 'email';
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  /**
3
3
  * Layout configuration types
4
4
  */
@@ -1,7 +1,7 @@
1
- import type { ReactNode } from 'react';
2
- import type { AuthApiAdapter } from './auth-api-adapter';
3
- import type { AuthError, SSOSession } from './auth-types';
4
- import type { TokenStorageStrategy } from './sso-session';
1
+ import { ReactNode } from 'react';
2
+ import { AuthApiAdapter } from './auth-api-adapter';
3
+ import { AuthError, SSOSession } from './auth-types';
4
+ import { TokenStorageStrategy } from './sso-session';
5
5
  /** Consumer-provided config for SSOAuthProvider. */
6
6
  export interface SSOAuthConfig {
7
7
  /** Consumer-provided adapter to their central auth service. */
@@ -31,7 +31,10 @@ export interface SSOAuthConfig {
31
31
  sliderImages?: string[];
32
32
  };
33
33
  }
34
+ /** Props for the SSOAuthProvider context wrapper that supplies auth state to the component tree. */
34
35
  export interface SSOAuthProviderProps {
36
+ /** Auth configuration including API adapter, provider settings, and callbacks. */
35
37
  config: SSOAuthConfig;
38
+ /** Child components that will have access to the SSO auth context. */
36
39
  children: ReactNode;
37
40
  }
@@ -1,7 +1,10 @@
1
- import type { AuthMethod } from './auth-types';
1
+ import { AuthMethod } from './auth-types';
2
2
  /** Stored repeat-login info (method + masked identifier). */
3
3
  export interface StoredRepeatLogin {
4
+ /** The authentication method used in the previous login (e.g. `'phone'`, `'email'`, `'google'`). */
4
5
  method: AuthMethod;
6
+ /** Partially masked identifier shown to the user (e.g. `"****1234"` or `"j***@example.com"`). */
5
7
  maskedIdentifier: string;
8
+ /** Unix epoch (ms) when this login record was stored. Used for expiry checks. */
6
9
  timestamp: number;
7
10
  }
@@ -1,7 +1,4 @@
1
- /**
2
- * Auth flow state machine types: state, actions, and context.
3
- */
4
- import type { AuthStep, SSOSession, UserType } from './auth-types';
1
+ import { AuthStep, SSOSession, UserType } from './auth-types';
5
2
  /** Identifier type for OTP / profile steps. */
6
3
  export type IdentifierType = 'phone' | 'email';
7
4
  /** Full state for the auth flow. */
@@ -1,42 +1,68 @@
1
- import type { KeyboardEvent } from 'react';
2
- import type { Control, FieldValues } from 'react-hook-form';
1
+ import { KeyboardEvent } from 'react';
2
+ import { Control, FieldValues } from 'react-hook-form';
3
3
  /** Base props shared by RHF form field components. */
4
4
  export interface BaseFormFieldProps {
5
+ /** Field name used by react-hook-form for registration and validation. */
5
6
  name: string;
7
+ /** Visible label rendered above or beside the input. */
6
8
  label?: string;
9
+ /** Placeholder text shown when the input is empty. */
7
10
  placeholder?: string;
11
+ /** Whether the field is required for form submission. */
8
12
  required?: boolean;
13
+ /** Whether the field is disabled (non-interactive). */
9
14
  disabled?: boolean;
15
+ /** Additional CSS class name(s) applied to the field wrapper. */
10
16
  className?: string;
17
+ /** Validation error message to display below the input. */
11
18
  error?: string;
19
+ /** Supplementary helper text shown below the input when there is no error. */
12
20
  helperText?: string;
13
21
  /** Focus this field when form/screen opens (PRODUCT_PROTOCOLS #26). */
14
22
  autoFocus?: boolean;
15
23
  }
16
24
  /** Props for the text/email/number input field component. */
17
25
  export interface RHFInputFieldProps extends BaseFormFieldProps {
26
+ /** HTML input type. Allowed: `'text'`, `'email'`, `'password'`, `'number'`, `'tel'`, `'url'`, `'search'`. */
18
27
  type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search';
28
+ /** HTML `autocomplete` attribute value (e.g. `'email'`, `'tel'`). */
19
29
  autoComplete?: string;
30
+ /** Maximum character length enforced on the input. */
20
31
  maxLength?: number;
32
+ /** Minimum character length enforced on the input. */
21
33
  minLength?: number;
34
+ /** Regex pattern string for native HTML validation. */
22
35
  pattern?: string;
36
+ /** react-hook-form `Control` instance. When omitted, the field uses the nearest `FormProvider`. */
23
37
  control?: Control<FieldValues>;
38
+ /** Called when a key is pressed while the input is focused. */
24
39
  onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
40
+ /** When true, restricts input to numeric characters only. */
25
41
  numericOnly?: boolean;
26
42
  }
27
43
  /** Props for RHF wrapper around DoctPhoneInput (docthub-core-components). */
28
44
  export interface RHFDoctPhoneInputFieldProps extends BaseFormFieldProps {
45
+ /** ISO 3166-1 alpha-2 country code pre-selected in the phone input (e.g. `'IN'`, `'US'`). */
29
46
  defaultCountry?: string;
47
+ /** Display variant: `'default'` shows full country selector, `'flag'` shows flag icon only. */
30
48
  variant?: 'default' | 'flag';
49
+ /** react-hook-form `Control` instance. When omitted, the field uses the nearest `FormProvider`. */
31
50
  control?: Control<FieldValues>;
32
51
  }
33
52
  /** Props for the OTP input field component. */
34
53
  export interface RHFOtpInputFieldProps extends BaseFormFieldProps {
54
+ /** Number of OTP digit boxes to render. @default 6 */
35
55
  length?: number;
56
+ /** Input type for each OTP box: `'text'`, `'number'`, or `'password'` (masked). */
36
57
  type?: 'text' | 'number' | 'password';
58
+ /** Focus the first OTP box on mount. */
37
59
  autoFocus?: boolean;
60
+ /** Automatically trigger submission when all boxes are filled. */
38
61
  autoSubmit?: boolean;
62
+ /** Called with the complete OTP string once all boxes are filled. */
39
63
  onComplete?: (otp: string) => void;
64
+ /** CSS class name(s) applied to each individual OTP input box. */
40
65
  inputClassName?: string;
66
+ /** react-hook-form `Control` instance. When omitted, the field uses the nearest `FormProvider`. */
41
67
  control?: Control<FieldValues>;
42
68
  }
@@ -1,9 +1,4 @@
1
- /**
2
- * Layout preset types for the Auth SDK.
3
- * Presets control structure only: width, alignment, slider vs standalone.
4
- * They do NOT control auth methods, MFA, or flow behavior.
5
- */
6
- import type { AuthLayoutAlign, AuthLayoutMaxWidth, AuthLayoutVariant } from './auth-layout-types';
1
+ import { AuthLayoutAlign, AuthLayoutMaxWidth, AuthLayoutVariant } from './auth-layout-types';
7
2
  /** Layout type: two-panel with slider vs single centered column. */
8
3
  export type LayoutType = 'withSlider' | 'standalone';
9
4
  /**
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  /** Props for the ImageSlider component. */
3
3
  export interface ImageSliderProps {
4
4
  /** Array of image URLs to display */
@@ -1,10 +1,13 @@
1
- import type { UseFormReturn } from 'react-hook-form';
2
- import type { z } from 'zod';
3
- import type { loginEmailFormSchema, loginPhoneFormSchema } from '@/validations';
1
+ import { UseFormReturn } from 'react-hook-form';
2
+ import { z } from 'zod';
3
+ import { loginEmailFormSchema, loginPhoneFormSchema } from '../validations';
4
4
  /** Login mode: phone number or email */
5
5
  export type LoginEntryMode = 'phone' | 'email';
6
+ /** Form values for phone-based login, inferred from the Zod schema. */
6
7
  export type PhoneFormValues = z.infer<typeof loginPhoneFormSchema>;
8
+ /** Form values for email-based login, inferred from the Zod schema. */
7
9
  export type EmailFormValues = z.infer<typeof loginEmailFormSchema>;
10
+ /** Discriminated union of phone or email login form values. */
8
11
  export type LoginEntryFormValues = PhoneFormValues | EmailFormValues;
9
12
  /** Payload when login entry form is valid (phone or email). */
10
13
  export type LoginEntrySubmitData = {
@@ -38,9 +41,13 @@ export interface UseLoginEntryFormOptions {
38
41
  /** Called when submitApi rejects or throws. */
39
42
  onError?: (error: unknown) => void;
40
43
  }
44
+ /** Return value of the `useLoginEntryForm` hook, providing form state and mode info. */
41
45
  export interface UseLoginEntryFormReturn {
46
+ /** react-hook-form methods bound to the current login mode's schema. */
42
47
  methods: UseFormReturn<LoginEntryFormValues>;
48
+ /** Submit handler to pass to the form's `onSubmit`. Validates and dispatches the login data. */
43
49
  handleSubmit: (data: LoginEntryFormValues) => void;
50
+ /** True when the current mode is `'phone'`; use for conditional field rendering. */
44
51
  isPhone: boolean;
45
52
  /** True when current form values pass validation (for disabling Continue until valid – edge cases 3, 4). */
46
53
  isFormValid: (data: LoginEntryFormValues) => boolean;
@@ -1,26 +1,37 @@
1
1
  /** Handlers exposed by the main auth page (method select). */
2
2
  export interface MainAuthPageHandlers {
3
+ /** Called when the user selects "Continue with Mobile". */
3
4
  onContinueWithMobile: () => void;
5
+ /** Called when the user selects "Continue with Email". */
4
6
  onContinueWithEmail: () => void;
7
+ /** Called when the user selects "Continue with Google". */
5
8
  onContinueWithGoogle: () => void;
9
+ /** Called when the user selects "Continue with Apple". */
6
10
  onContinueWithApple: () => void;
7
11
  }
8
12
  /** Config for lib-handled Google sign-in. When set, the lib runs the OAuth flow and calls onCredential. */
9
13
  export interface MainLoginGoogleProviderConfig {
14
+ /** Google OAuth 2.0 client ID. */
10
15
  clientId: string;
11
16
  /** Called with ID token (One Tap) or auth code (button popup). Send to your backend to verify. */
12
17
  onCredential: (credential: string) => void;
18
+ /** Enable Google One Tap prompt for automatic sign-in. */
13
19
  enableOneTap?: boolean;
14
20
  }
15
21
  /** Config for lib-handled Apple sign-in (stub). When set, the lib will run the flow and call onCredential when implemented. */
16
22
  export interface MainLoginAppleProviderConfig {
23
+ /** Apple Services ID (client ID) configured in the Apple Developer portal. */
17
24
  clientId: string;
25
+ /** OAuth redirect URI registered with Apple for the sign-in flow. */
18
26
  redirectUri: string;
27
+ /** Called with the Apple identity token after a successful sign-in. Send to your backend to verify. */
19
28
  onCredential: (credential: string) => void;
20
29
  }
21
30
  /** Optional provider config so the lib handles Google/Apple API calls. */
22
31
  export interface MainLoginPageProvidersConfig {
32
+ /** Google sign-in configuration. When set, the lib handles the Google OAuth flow. */
23
33
  google?: MainLoginGoogleProviderConfig;
34
+ /** Apple sign-in configuration. When set, the lib handles the Apple OAuth flow. */
24
35
  apple?: MainLoginAppleProviderConfig;
25
36
  }
26
37
  /** Options for useMainAuthPageHandlers: optional callback overrides + optional provider config for lib-handled OAuth. */
@@ -1,13 +1,16 @@
1
- import type { UseFormReturn } from 'react-hook-form';
2
- import type { z } from 'zod';
3
- import type { OtpVerificationMode, otpFormSchema } from '@/validations';
1
+ import { UseFormReturn } from 'react-hook-form';
2
+ import { z } from 'zod';
3
+ import { OtpVerificationMode, otpFormSchema } from '../validations';
4
4
  export type { OtpVerificationMode };
5
+ /** Form values for the OTP verification form, inferred from the Zod schema. */
5
6
  export type OtpFormValues = z.infer<typeof otpFormSchema>;
7
+ /** Options for the `useOtpVerification` hook controlling mode, submission, and callbacks. */
6
8
  export interface UseOtpVerificationOptions {
7
9
  /** OTP mode: phone (60s cooldown) or email (2 min cooldown). */
8
10
  mode: OtpVerificationMode;
9
11
  /** Sync callback with OTP string. Use when parent owns API (e.g. AuthFlow). Ignored when submitApi is provided. */
10
12
  onSubmit?: ((otp: string) => void) | undefined;
13
+ /** Called when the user requests a new OTP code (resend). Ignored when submitApi is provided. */
11
14
  onResendCode?: (() => void) | undefined;
12
15
  /** When provided, hook runs: validate → submitApi(otp) → onSuccess(). Consumer passes redirect in onSuccess. */
13
16
  submitApi?: (otp: string) => Promise<void>;
@@ -16,14 +19,21 @@ export interface UseOtpVerificationOptions {
16
19
  /** Called when submitApi rejects or throws. */
17
20
  onError?: (error: unknown) => void;
18
21
  }
22
+ /** Return value of the `useOtpVerification` hook, providing form state and resend controls. */
19
23
  export interface UseOtpVerificationReturn {
24
+ /** react-hook-form methods bound to the OTP form. */
20
25
  methods: UseFormReturn<OtpFormValues>;
26
+ /** Submit handler to pass to the form's `onSubmit`. Validates and dispatches the OTP. */
21
27
  handleSubmit: (data: OtpFormValues) => void;
22
28
  /** True when current form values pass validation (for disabling Submit until valid – edge case 6). */
23
29
  isFormValid: (data: OtpFormValues) => boolean;
30
+ /** Triggers a resend of the OTP code and resets the cooldown timer. */
24
31
  handleResend: () => void;
32
+ /** Seconds remaining before the user can request another OTP code. */
25
33
  resendSecondsLeft: number;
34
+ /** True when the resend cooldown has elapsed and the user may request a new code. */
26
35
  canResend: boolean;
36
+ /** Human-readable countdown string (e.g. `"00:45"`) for display next to the resend button. */
27
37
  timerText: string;
28
38
  /** True while submitApi is in flight. */
29
39
  isSubmitting: boolean;
@@ -1,11 +1,8 @@
1
- /**
2
- * Props and public types for auth page components.
3
- */
4
- import type { UserType } from './auth-types';
5
- import type { IdentifierType } from './flow';
6
- import type { LoginEntryMode } from './login-form';
7
- import type { UseMainAuthPageHandlersOptions } from './main-login';
8
- import type { OtpVerificationMode } from './otp-verification';
1
+ import { UserType } from './auth-types';
2
+ import { IdentifierType } from './flow';
3
+ import { LoginEntryMode } from './login-form';
4
+ import { UseMainAuthPageHandlersOptions } from './main-login';
5
+ import { OtpVerificationMode } from './otp-verification';
9
6
  /** Props for MainLoginPage and MainLogin components. */
10
7
  export type MainLoginPageProps = UseMainAuthPageHandlersOptions;
11
8
  /** Props for LoginEntry (inner form without layout). */
@@ -18,6 +18,7 @@ export interface UseRepeatLoginOptions {
18
18
  /** Called when continueApi fails. */
19
19
  onError?: (error: unknown) => void;
20
20
  }
21
+ /** Return value of the `useRepeatLogin` hook, providing continue handler and display state. */
21
22
  export interface UseRepeatLoginReturn {
22
23
  /** Call this when the user clicks "Continue with {lastUsedMethod}". */
23
24
  handleContinue: () => void;
@@ -1,11 +1,15 @@
1
- import type { UseFormReturn } from 'react-hook-form';
2
- import type { z } from 'zod';
3
- import type { signupEmailFormSchema, signupForeignFormSchema, signupPhoneFormSchema } from '@/validations';
1
+ import { UseFormReturn } from 'react-hook-form';
2
+ import { z } from 'zod';
3
+ import { signupEmailFormSchema, signupForeignFormSchema, signupPhoneFormSchema } from '../validations';
4
4
  /** Signup mode: phone, email as second field, or foreign (full name + email + phone). */
5
5
  export type SignupEntryMode = 'phone' | 'email' | 'foreign';
6
+ /** Form values for phone-based signup, inferred from the Zod schema. */
6
7
  export type SignupPhoneFormValues = z.infer<typeof signupPhoneFormSchema>;
8
+ /** Form values for email-based signup, inferred from the Zod schema. */
7
9
  export type SignupEmailFormValues = z.infer<typeof signupEmailFormSchema>;
10
+ /** Form values for foreign signup (full name + email + phone), inferred from the Zod schema. */
8
11
  export type SignupForeignFormValues = z.infer<typeof signupForeignFormSchema>;
12
+ /** Discriminated union of all signup form value shapes. */
9
13
  export type SignupFormValues = SignupPhoneFormValues | SignupEmailFormValues | SignupForeignFormValues;
10
14
  /** Payload when signup form is valid. */
11
15
  export type SignupSubmitData = {
@@ -27,8 +31,11 @@ export interface UseSignupFormOptions {
27
31
  /** Called when submitApi rejects or throws. */
28
32
  onError?: (error: unknown) => void;
29
33
  }
34
+ /** Return value of the `useSignupForm` hook, providing form state and mode flags. */
30
35
  export interface UseSignupFormReturn {
36
+ /** react-hook-form methods bound to the current signup mode's schema. */
31
37
  methods: UseFormReturn<SignupFormValues>;
38
+ /** Submit handler to pass to the form's `onSubmit`. Validates and dispatches signup data. */
32
39
  handleSubmit: (data: SignupFormValues) => void;
33
40
  /** True when mode is 'phone', false when mode is 'email'. For 'foreign' same as (mode === 'phone') for layout. */
34
41
  isPhone: boolean;
@@ -1,4 +1,4 @@
1
- import type { ZodError } from 'zod';
1
+ import { ZodError } from 'zod';
2
2
  /**
3
3
  * Applies Zod validation errors to a React Hook Form setError function.
4
4
  * Used by form submit handlers to display field-level errors from schema validation.
@@ -1,7 +1,3 @@
1
- /**
2
- * Centralized Zod schemas for auth forms (signup, login, OTP).
3
- * Single source of truth for validation rules per PRODUCT_PROTOCOLS.
4
- */
5
1
  import { z } from 'zod';
6
2
  /** Capitalize first letter of each word (PRODUCT_PROTOCOLS #25 – Naming conventions). */
7
3
  export declare function capitalizeWords(value: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doct-ui-auth-kit",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Composable React auth SDK – layouts, login/signup/OTP pages, SSO provider, and auth flow hooks for Docthub",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "scripts": {
25
25
  "dev": "vite",
26
- "build": "tsc -b && vite build && tsc -p tsconfig.build.json",
26
+ "build": "tsc -b && vite build",
27
27
  "prepublishOnly": "npm run build",
28
28
  "lint": "biome lint .",
29
29
  "preview": "vite preview",
@@ -1,5 +0,0 @@
1
- /**
2
- * Shared demo footer with Docthub terms and privacy links.
3
- * Used in auth flow and stories (MainLogin, RepeatLogin, AuthLayout, etc.).
4
- */
5
- export declare function DefaultFooter(): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- /**
2
- * Shared demo header for auth layouts (e.g. "Enterprise Login" with chevron).
3
- * Used in stories and auth flow demo. Hidden on small screens (sm:flex).
4
- */
5
- export declare function EnterpriseHeader(): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- export { DefaultFooter } from './default-footer';
2
- export { EnterpriseHeader } from './enterprise-header';