doct-ui-auth-kit 1.0.6 → 1.0.8

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 (81) 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 +2 -1
  4. package/dist/components/form/rhf-input-field.d.ts +2 -1
  5. package/dist/components/form/rhf-otp-input-field.d.ts +2 -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 +39 -3
  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/index.d.ts +1 -1
  12. package/dist/components/layout/main-layout.d.ts +2 -2
  13. package/dist/constants/layout-presets.d.ts +1 -5
  14. package/dist/core/auth-api-adapter.d.ts +1 -1
  15. package/dist/core/auth-context.d.ts +5 -5
  16. package/dist/core/auth-flow.d.ts +2 -2
  17. package/dist/core/auth-provider.d.ts +5 -3
  18. package/dist/core/auth-types.d.ts +1 -1
  19. package/dist/core/device-detection.d.ts +2 -6
  20. package/dist/core/sso-session.d.ts +2 -6
  21. package/dist/core/use-auth-flow.d.ts +2 -6
  22. package/dist/doct-ui-auth-kit.css +1 -1
  23. package/dist/hooks/use-login-entry-form.d.ts +8 -4
  24. package/dist/hooks/use-main-auth-page-handlers.d.ts +6 -5
  25. package/dist/hooks/use-otp-verification.d.ts +7 -4
  26. package/dist/hooks/use-repeat-login.d.ts +6 -4
  27. package/dist/hooks/use-signup-form.d.ts +8 -3
  28. package/dist/index.d.ts +11 -36
  29. package/dist/index.js +28 -27
  30. package/dist/pages/index.d.ts +4 -1
  31. package/dist/pages/login-entry/index.d.ts +3 -0
  32. package/dist/pages/login-entry/login-entry-page.d.ts +21 -0
  33. package/dist/pages/login-entry/login-entry.d.ts +21 -0
  34. package/dist/pages/main-login/index.d.ts +3 -0
  35. package/dist/pages/main-login/main-login-page.d.ts +16 -0
  36. package/dist/pages/main-login/main-login.d.ts +25 -0
  37. package/dist/pages/otp-verification/index.d.ts +3 -0
  38. package/dist/pages/otp-verification/otp-verification-page.d.ts +23 -0
  39. package/dist/pages/otp-verification/otp-verification.d.ts +22 -0
  40. package/dist/pages/repeat-login/index.d.ts +3 -0
  41. package/dist/pages/repeat-login/repeat-login-page.d.ts +24 -0
  42. package/dist/pages/repeat-login/repeat-login.d.ts +25 -0
  43. package/dist/pages/signup/index.d.ts +3 -0
  44. package/dist/pages/signup/signup-page.d.ts +6 -0
  45. package/dist/pages/signup/signup.d.ts +7 -0
  46. package/dist/pages.js +1 -1
  47. package/dist/signup-page-DBRzdhNj.js +1546 -0
  48. package/dist/types/{auth-api-adapter.d.ts → auth/auth-api-adapter.d.ts} +1 -5
  49. package/dist/types/{auth-provider.d.ts → auth/auth-provider.d.ts} +7 -4
  50. package/dist/types/auth/device-detection.d.ts +10 -0
  51. package/dist/types/{flow.d.ts → auth/flow.d.ts} +1 -4
  52. package/dist/types/auth/index.d.ts +9 -0
  53. package/dist/types/{auth-layout-types.d.ts → components/auth-layout-types.d.ts} +1 -1
  54. package/dist/types/components/forms.d.ts +68 -0
  55. package/dist/types/components/index.d.ts +7 -0
  56. package/dist/types/{layout-presets.d.ts → components/layout-presets.d.ts} +1 -6
  57. package/dist/types/{layout.d.ts → components/layout.d.ts} +1 -1
  58. package/dist/types/index.d.ts +4 -17
  59. package/dist/types/pages/index.d.ts +9 -0
  60. package/dist/types/{login-form.d.ts → pages/login-form.d.ts} +13 -6
  61. package/dist/types/{main-login.d.ts → pages/main-login.d.ts} +11 -0
  62. package/dist/types/{otp-verification.d.ts → pages/otp-verification.d.ts} +16 -6
  63. package/dist/types/{pages.d.ts → pages/pages.d.ts} +32 -35
  64. package/dist/types/{repeat-login.d.ts → pages/repeat-login.d.ts} +7 -6
  65. package/dist/types/{signup-form.d.ts → pages/signup-form.d.ts} +14 -7
  66. package/dist/utils/set-form-errors-from-zod.d.ts +1 -1
  67. package/dist/validations/schemas.d.ts +0 -4
  68. package/package.json +2 -2
  69. package/dist/pages/login-entry.d.ts +0 -42
  70. package/dist/pages/main-login.d.ts +0 -32
  71. package/dist/pages/otp-verification.d.ts +0 -45
  72. package/dist/pages/repeat-login.d.ts +0 -49
  73. package/dist/pages/signup.d.ts +0 -4
  74. package/dist/signup-DeeuWsoF.js +0 -1718
  75. package/dist/types/device-detection.d.ts +0 -7
  76. package/dist/types/forms.d.ts +0 -42
  77. /package/dist/{stories/components → components/common}/default-footer.d.ts +0 -0
  78. /package/dist/{stories/components → components/common}/enterprise-header.d.ts +0 -0
  79. /package/dist/{stories/components → components/common}/index.d.ts +0 -0
  80. /package/dist/types/{auth-types.d.ts → auth/auth-types.d.ts} +0 -0
  81. /package/dist/types/{sso-session.d.ts → auth/sso-session.d.ts} +0 -0
@@ -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,3 @@
1
- import type { RHFDoctPhoneInputFieldProps } from '@/types/forms';
1
+ import { RHFDoctPhoneInputFieldProps } from '../../types/components/forms';
2
+ /** RHF-controlled wrapper around `DoctPhoneInput` from docthub-core-components. Outputs "countryCode-nationalNumber" format for Zod schema validation. */
2
3
  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,3 @@
1
- import type { RHFInputFieldProps } from '@/types/forms';
1
+ import { RHFInputFieldProps } from '../../types/components/forms';
2
+ /** RHF-controlled wrapper around `DoctLabeledInput` from docthub-core-components. Handles validation errors, trimming, and optional numeric-only mode. */
2
3
  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,3 @@
1
- import type { RHFOtpInputFieldProps } from '@/types/forms';
1
+ import { RHFOtpInputFieldProps } from '../../types/components/forms';
2
+ /** RHF-controlled wrapper around `DoctOtpInput` from docthub-core-components. Manages a string[] field value for OTP digit inputs. */
2
3
  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/components/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,59 @@
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/components/auth-layout-types';
3
+ /** Layout mode: `'withSlider'` renders inside a split-screen with an image slider, `'standalone'` renders without. */
4
+ /** Layout mode: `'withSlider'` renders inside a split-screen with an image slider, `'standalone'` renders without. */
3
5
  export type AuthLayoutType = 'withSlider' | 'standalone';
6
+ /** Props for the AuthLayoutWrapper component that assembles the auth page shell. */
7
+ /** Props for the AuthLayoutWrapper component that assembles the auth page shell. */
4
8
  export interface AuthLayoutWrapperProps {
9
+ /** Main content (typically the form body) rendered inside the layout. */
10
+ /** Main content (typically the form body) rendered inside the layout. */
5
11
  children: ReactNode;
12
+ /** Layout mode controlling the outer chrome. @default `'withSlider'` */
13
+ /** Layout mode controlling the outer chrome. @default `'withSlider'` */
6
14
  layoutType?: AuthLayoutType;
15
+ /** Logo or back-button element rendered at the top of the content area. */
16
+ /** Logo or back-button element rendered at the top of the content area. */
7
17
  logo?: ReactNode;
18
+ /** Heading element or string rendered below the logo. */
19
+ /** Heading element or string rendered below the logo. */
8
20
  title?: ReactNode;
21
+ /** Descriptive text or element rendered below the title. */
22
+ /** Descriptive text or element rendered below the title. */
9
23
  description?: ReactNode;
24
+ /** Footer element rendered at the bottom of the content area. */
25
+ /** Footer element rendered at the bottom of the content area. */
10
26
  footer?: ReactNode;
27
+ /** Header element rendered above the main content area. */
28
+ /** Header element rendered above the main content area. */
11
29
  header?: ReactNode;
30
+ /** Called when the back button is clicked. Pass `null` to hide the back button explicitly. */
31
+ /** Called when the back button is clicked. Pass `null` to hide the back button explicitly. */
12
32
  onBack?: (() => void) | null;
33
+ /** Custom back button element. When provided, overrides the default back arrow button. */
34
+ /** Custom back button element. When provided, overrides the default back arrow button. */
13
35
  backButton?: ReactNode;
36
+ /** Image URLs for the slider panel (only used when `layoutType` is `'withSlider'`). */
37
+ /** Image URLs for the slider panel (only used when `layoutType` is `'withSlider'`). */
14
38
  sliderImages?: string[];
39
+ /** Auto-play interval in milliseconds for the slider. */
40
+ /** Auto-play interval in milliseconds for the slider. */
15
41
  sliderAutoPlayInterval?: number;
42
+ /** Titles displayed alongside each slider image. */
43
+ /** Titles displayed alongside each slider image. */
16
44
  sliderTitles?: (ReactNode | string)[];
17
- variant?: AuthLayoutVariant;
45
+ /** Layout variant controlling responsive behavior (e.g. `'desktop'`, `'mobile'`). */
46
+ variant?: AuthLayoutVariant | undefined;
47
+ /** Maximum width constraint for the content area (e.g. `'sm'`, `'md'`, `'lg'`). @default `'sm'` */
18
48
  maxWidth?: AuthLayoutMaxWidth;
49
+ /** Content width preset: `'sm'` for narrow forms, `'default'` for standard width. @default `'default'` */
50
+ /** Content width preset: `'sm'` for narrow forms, `'default'` for standard width. @default `'default'` */
19
51
  contentWidth?: 'sm' | 'default';
52
+ /** Horizontal alignment of logo, title, and description. @default `'center'` */
53
+ /** Horizontal alignment of logo, title, and description. @default `'center'` */
20
54
  align?: AuthLayoutAlign;
55
+ /** Additional CSS class name(s) applied to the outermost layout element. */
56
+ /** Additional CSS class name(s) applied to the outermost layout element. */
21
57
  className?: string;
22
58
  }
23
59
  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/components/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,4 +1,4 @@
1
- export type { AuthLayoutAlign, AuthLayoutBodyProps, AuthLayoutDescriptionProps, AuthLayoutFooterProps, AuthLayoutHeaderProps, AuthLayoutLogoProps, AuthLayoutMainProps, AuthLayoutMaxWidth, AuthLayoutRootProps, AuthLayoutTitleProps, AuthLayoutVariant, } from '../../types/auth-layout-types';
1
+ export type { AuthLayoutAlign, AuthLayoutBodyProps, AuthLayoutDescriptionProps, AuthLayoutFooterProps, AuthLayoutHeaderProps, AuthLayoutLogoProps, AuthLayoutMainProps, AuthLayoutMaxWidth, AuthLayoutRootProps, AuthLayoutTitleProps, AuthLayoutVariant, } from '../../types/components/auth-layout-types';
2
2
  export { AuthLayoutPreset, type AuthLayoutPresetProps, } from './auth-layout-preset';
3
3
  export { AuthLayout } from './auth-layout-public';
4
4
  export { type AuthLayoutType, AuthLayoutWrapper, type AuthLayoutWrapperProps, } from './auth-layout-wrapper';
@@ -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/components/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
1
  /**
2
- * Full auth flow orchestrator. Renders the correct page per flow state with appropriate layout.
3
- * Use inside SSOAuthProvider.
2
+ * Auth flow orchestrator ("auto" mode): renders the correct page component based on the current flow state.
3
+ * Consumer wraps with `SSOAuthProvider` and drops `AuthFlow` in — the SDK handles all transitions.
4
4
  */
5
5
  export declare function AuthFlow(): import("react/jsx-runtime").JSX.Element | null;
@@ -1,6 +1,8 @@
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
- * SSO Auth provider: runs session check on mount, holds flow state, and provides async actions.
4
+ * SSO Auth provider: manages the auth flow state machine and provides context to all child components.
5
+ * On mount, checks for an existing session (token or cookie-based via `validateSessionFromCookie`).
6
+ * Dispatches reducer actions and exposes async `AuthFlowActions` for each auth step.
5
7
  */
6
8
  export declare function SSOAuthProvider({ config, children }: SSOAuthProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -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 +1 @@
1
- *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--font-inter),Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-top-10{top:-2.5rem}.left-1\/2{left:50%}.top-2\.5{top:.625rem}.top-\[152\.5px\]{top:152.5px}.z-10{z-index:10}.z-20{z-index:20}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-1{height:.25rem}.h-10{height:2.5rem}.h-5{height:1.25rem}.h-\[100dvh\]{height:100dvh}.h-\[30px\]{height:30px}.h-full{height:100%}.min-h-0{min-height:0px}.min-h-svh{min-height:100svh}.w-10{width:2.5rem}.w-2{width:.5rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-\[140px\]{width:140px}.w-\[328px\]{width:328px}.w-auto{width:auto}.w-full{width:100%}.w-screen{width:100vw}.min-w-0{min-width:0px}.min-w-full{min-width:100%}.max-w-\[320px\]{max-width:320px}.max-w-\[360px\]{max-width:360px}.max-w-\[400px\]{max-width:400px}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-\[12px\]{gap:12px}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.whitespace-pre-line{white-space:pre-line}.rounded-\[10px\]{border-radius:10px}.rounded-\[3px\]{border-radius:3px}.border{border-width:1px}.border-\[rgba\(0\,0\,0\,0\.12\)\]{border-color:#0000001f}.bg-\[\#002830\]{--tw-bg-opacity: 1;background-color:rgb(0 40 48 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/40{background-color:#fff6}.bg-white\/50{background-color:#ffffff80}.object-cover{-o-object-fit:cover;object-fit:cover}.object-center{-o-object-position:center;object-position:center}.p-2{padding:.5rem}.p-8{padding:2rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-\[22px\]{padding-left:22px;padding-right:22px}.py-12{padding-top:3rem;padding-bottom:3rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[14px\]{padding-top:14px;padding-bottom:14px}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-bold{font-weight:700}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.text-\[\#002830\]{--tw-text-opacity: 1;color:rgb(0 40 48 / var(--tw-text-opacity, 1))}.text-\[\#1e595a\]{--tw-text-opacity: 1;color:rgb(30 89 90 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-black\/80{color:#000c}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-80{opacity:.8}.outline{outline-style:solid}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}:root{font-family:var( --font-inter, "Inter", system-ui, Avenir, Helvetica, Arial, sans-serif );line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{margin:0;min-width:320px;min-height:100vh}#root{min-height:100vh;width:100%}.hover\:bg-white\/60:hover{background-color:#fff9}@media(min-width:640px){.sm\:flex{display:flex}}@media(min-width:768px){.md\:mb-6{margin-bottom:1.5rem}.md\:px-\[20px\]{padding-left:20px;padding-right:20px}.md\:py-12{padding-top:3rem;padding-bottom:3rem}.md\:py-8{padding-top:2rem;padding-bottom:2rem}.md\:pt-\[20px\]{padding-top:20px}}@media(min-width:1024px){.lg\:block{display:block}.lg\:h-\[100dvh\]{height:100dvh}.lg\:w-\[432px\]{width:432px}.lg\:flex-shrink-0{flex-shrink:0}.lg\:flex-grow-0{flex-grow:0}.lg\:flex-row{flex-direction:row}}
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--font-inter),Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-top-10{top:-2.5rem}.left-1\/2{left:50%}.top-2\.5{top:.625rem}.top-\[152\.5px\]{top:152.5px}.z-10{z-index:10}.z-20{z-index:20}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-1{height:.25rem}.h-10{height:2.5rem}.h-5{height:1.25rem}.h-\[100dvh\]{height:100dvh}.h-\[30px\]{height:30px}.h-full{height:100%}.min-h-0{min-height:0px}.min-h-svh{min-height:100svh}.w-10{width:2.5rem}.w-2{width:.5rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-\[140px\]{width:140px}.w-\[328px\]{width:328px}.w-auto{width:auto}.w-full{width:100%}.w-screen{width:100vw}.min-w-0{min-width:0px}.min-w-full{min-width:100%}.max-w-\[320px\]{max-width:320px}.max-w-\[360px\]{max-width:360px}.max-w-\[400px\]{max-width:400px}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-\[12px\]{gap:12px}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.whitespace-pre-line{white-space:pre-line}.rounded-\[10px\]{border-radius:10px}.rounded-\[3px\]{border-radius:3px}.border{border-width:1px}.border-\[rgba\(0\,0\,0\,0\.12\)\]{border-color:#0000001f}.bg-\[\#002830\]{--tw-bg-opacity: 1;background-color:rgb(0 40 48 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/40{background-color:#fff6}.bg-white\/50{background-color:#ffffff80}.object-cover{-o-object-fit:cover;object-fit:cover}.object-center{-o-object-position:center;object-position:center}.p-2{padding:.5rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-\[22px\]{padding-left:22px;padding-right:22px}.py-12{padding-top:3rem;padding-bottom:3rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[14px\]{padding-top:14px;padding-bottom:14px}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-bold{font-weight:700}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.text-\[\#002830\]{--tw-text-opacity: 1;color:rgb(0 40 48 / var(--tw-text-opacity, 1))}.text-\[\#1e595a\]{--tw-text-opacity: 1;color:rgb(30 89 90 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-black\/80{color:#000c}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-80{opacity:.8}.outline{outline-style:solid}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}:root{font-family:var( --font-inter, "Inter", system-ui, Avenir, Helvetica, Arial, sans-serif );line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{margin:0;min-width:320px;min-height:100vh}#root{min-height:100vh;width:100%}.hover\:bg-white\/60:hover{background-color:#fff9}@media(min-width:640px){.sm\:flex{display:flex}}@media(min-width:768px){.md\:mb-6{margin-bottom:1.5rem}.md\:px-\[20px\]{padding-left:20px;padding-right:20px}.md\:py-12{padding-top:3rem;padding-bottom:3rem}.md\:py-8{padding-top:2rem;padding-bottom:2rem}.md\:pt-\[20px\]{padding-top:20px}}@media(min-width:1024px){.lg\:block{display:block}.lg\:h-\[100dvh\]{height:100dvh}.lg\:w-\[432px\]{width:432px}.lg\:flex-shrink-0{flex-shrink:0}.lg\:flex-grow-0{flex-grow:0}.lg\:flex-row{flex-direction:row}}
@@ -1,8 +1,12 @@
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
- * Business logic: when submitApi is provided, hook runs validate → submitApi(data) → onSuccess() (e.g. redirect).
6
- * Use with LoginEntry component or build a custom UI with the returned methods.
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.
7
11
  */
8
12
  export declare function useLoginEntryForm({ mode, onSubmit, submitApi, onSuccess, onError, }: UseLoginEntryFormOptions): UseLoginEntryFormReturn;
@@ -1,8 +1,9 @@
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
- * Main auth page business logic: resolves CTA handlers from optional overrides and optional provider config.
5
- * When providers.google / providers.apple are set, the lib runs Google/Apple OAuth and calls onCredential;
6
- * otherwise uses overrides or no-op defaults.
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.
7
8
  */
8
9
  export declare function useMainAuthPageHandlers(options?: Readonly<UseMainAuthPageHandlersOptions>): MainAuthPageHandlers;
@@ -1,12 +1,15 @@
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
- * When submitApi is provided, hook runs: validate → submitApi(otp) → onSuccess() (e.g. redirect).
10
+ *
11
+ * **Resend cooldown:** mode-dependent timer (60s phone / 120s email) blocks re-sends until elapsed.
12
+ * **Dual submission:** `submitApi` (async, hook owns flow) vs `onSubmit` (sync, caller owns flow).
13
+ * **Validation:** otpFormSchema ensures all 6 digits are present before submission.
11
14
  */
12
15
  export declare function useOtpVerification({ mode, onSubmit, onResendCode, submitApi, onSuccess, onError, }: UseOtpVerificationOptions): UseOtpVerificationReturn;
@@ -1,7 +1,9 @@
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
- * Business logic for repeat login: continue with last method (sync or async via continueApi).
5
- * When continueApi is provided, runs: continueApi() → onSuccess(); otherwise calls onContinueWithLastMethod.
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.
6
8
  */
7
9
  export declare function useRepeatLogin(options?: UseRepeatLoginOptions): UseRepeatLoginReturn;
@@ -1,7 +1,12 @@
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
- * When submitApi is provided, hook runs: validate → submitApi(data) → onSuccess() (e.g. redirect).
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.
6
11
  */
7
12
  export declare function useSignupForm({ mode, defaultPhone, onSubmit, submitApi, onSuccess, onError, }: UseSignupFormOptions): UseSignupFormReturn;
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';