doct-ui-auth-kit 1.0.7 → 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 (65) hide show
  1. package/dist/components/common/default-footer.d.ts +5 -0
  2. package/dist/components/common/enterprise-header.d.ts +5 -0
  3. package/dist/components/common/index.d.ts +2 -0
  4. package/dist/components/form/rhf-doct-phone-input.d.ts +2 -1
  5. package/dist/components/form/rhf-input-field.d.ts +2 -1
  6. package/dist/components/form/rhf-otp-input-field.d.ts +2 -1
  7. package/dist/components/layout/auth-layout-preset.d.ts +1 -1
  8. package/dist/components/layout/auth-layout-wrapper.d.ts +19 -2
  9. package/dist/components/layout/auth-layout.d.ts +1 -1
  10. package/dist/components/layout/index.d.ts +1 -1
  11. package/dist/constants/layout-presets.d.ts +1 -1
  12. package/dist/core/auth-flow.d.ts +2 -2
  13. package/dist/core/auth-provider.d.ts +3 -1
  14. package/dist/doct-ui-auth-kit.css +1 -1
  15. package/dist/hooks/use-login-entry-form.d.ts +6 -2
  16. package/dist/hooks/use-main-auth-page-handlers.d.ts +4 -3
  17. package/dist/hooks/use-otp-verification.d.ts +4 -1
  18. package/dist/hooks/use-repeat-login.d.ts +4 -2
  19. package/dist/hooks/use-signup-form.d.ts +6 -1
  20. package/dist/index.js +28 -27
  21. package/dist/pages/index.d.ts +4 -1
  22. package/dist/pages/login-entry/index.d.ts +3 -0
  23. package/dist/pages/login-entry/login-entry-page.d.ts +21 -0
  24. package/dist/pages/login-entry/login-entry.d.ts +21 -0
  25. package/dist/pages/main-login/index.d.ts +3 -0
  26. package/dist/pages/main-login/main-login-page.d.ts +16 -0
  27. package/dist/pages/main-login/main-login.d.ts +25 -0
  28. package/dist/pages/otp-verification/index.d.ts +3 -0
  29. package/dist/pages/otp-verification/otp-verification-page.d.ts +23 -0
  30. package/dist/pages/otp-verification/otp-verification.d.ts +22 -0
  31. package/dist/pages/repeat-login/index.d.ts +3 -0
  32. package/dist/pages/repeat-login/repeat-login-page.d.ts +24 -0
  33. package/dist/pages/repeat-login/repeat-login.d.ts +25 -0
  34. package/dist/pages/signup/index.d.ts +3 -0
  35. package/dist/pages/signup/signup-page.d.ts +6 -0
  36. package/dist/pages/signup/signup.d.ts +7 -0
  37. package/dist/pages.js +1 -1
  38. package/dist/signup-page-DBRzdhNj.js +1546 -0
  39. package/dist/types/auth/index.d.ts +9 -0
  40. package/dist/types/components/index.d.ts +7 -0
  41. package/dist/types/index.d.ts +4 -17
  42. package/dist/types/pages/index.d.ts +9 -0
  43. package/dist/types/{login-form.d.ts → pages/login-form.d.ts} +4 -4
  44. package/dist/types/{otp-verification.d.ts → pages/otp-verification.d.ts} +4 -4
  45. package/dist/types/{pages.d.ts → pages/pages.d.ts} +29 -29
  46. package/dist/types/{repeat-login.d.ts → pages/repeat-login.d.ts} +6 -6
  47. package/dist/types/{signup-form.d.ts → pages/signup-form.d.ts} +5 -5
  48. package/package.json +1 -1
  49. package/dist/pages/login-entry.d.ts +0 -42
  50. package/dist/pages/main-login.d.ts +0 -32
  51. package/dist/pages/otp-verification.d.ts +0 -45
  52. package/dist/pages/repeat-login.d.ts +0 -49
  53. package/dist/pages/signup.d.ts +0 -6
  54. package/dist/signup-DeeuWsoF.js +0 -1718
  55. /package/dist/types/{auth-api-adapter.d.ts → auth/auth-api-adapter.d.ts} +0 -0
  56. /package/dist/types/{auth-provider.d.ts → auth/auth-provider.d.ts} +0 -0
  57. /package/dist/types/{auth-types.d.ts → auth/auth-types.d.ts} +0 -0
  58. /package/dist/types/{device-detection.d.ts → auth/device-detection.d.ts} +0 -0
  59. /package/dist/types/{flow.d.ts → auth/flow.d.ts} +0 -0
  60. /package/dist/types/{sso-session.d.ts → auth/sso-session.d.ts} +0 -0
  61. /package/dist/types/{auth-layout-types.d.ts → components/auth-layout-types.d.ts} +0 -0
  62. /package/dist/types/{forms.d.ts → components/forms.d.ts} +0 -0
  63. /package/dist/types/{layout-presets.d.ts → components/layout-presets.d.ts} +0 -0
  64. /package/dist/types/{layout.d.ts → components/layout.d.ts} +0 -0
  65. /package/dist/types/{main-login.d.ts → pages/main-login.d.ts} +0 -0
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,2 @@
1
+ export { DefaultFooter } from './default-footer';
2
+ export { EnterpriseHeader } from './enterprise-header';
@@ -1,2 +1,3 @@
1
- import { 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 { 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 { 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
1
  import { ReactNode } from 'react';
2
- import { LayoutPresetName } from '../../types/layout-presets';
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).
@@ -1,42 +1,59 @@
1
1
  import { ReactNode } from 'react';
2
- import { AuthLayoutAlign, AuthLayoutMaxWidth, AuthLayoutVariant } from '../../types/auth-layout-types';
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. */
3
4
  /** Layout mode: `'withSlider'` renders inside a split-screen with an image slider, `'standalone'` renders without. */
4
5
  export type AuthLayoutType = 'withSlider' | 'standalone';
5
6
  /** Props for the AuthLayoutWrapper component that assembles the auth page shell. */
7
+ /** Props for the AuthLayoutWrapper component that assembles the auth page shell. */
6
8
  export interface AuthLayoutWrapperProps {
9
+ /** Main content (typically the form body) rendered inside the layout. */
7
10
  /** Main content (typically the form body) rendered inside the layout. */
8
11
  children: ReactNode;
9
12
  /** Layout mode controlling the outer chrome. @default `'withSlider'` */
13
+ /** Layout mode controlling the outer chrome. @default `'withSlider'` */
10
14
  layoutType?: AuthLayoutType;
11
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. */
12
17
  logo?: ReactNode;
13
18
  /** Heading element or string rendered below the logo. */
19
+ /** Heading element or string rendered below the logo. */
14
20
  title?: ReactNode;
15
21
  /** Descriptive text or element rendered below the title. */
22
+ /** Descriptive text or element rendered below the title. */
16
23
  description?: ReactNode;
17
24
  /** Footer element rendered at the bottom of the content area. */
25
+ /** Footer element rendered at the bottom of the content area. */
18
26
  footer?: ReactNode;
19
27
  /** Header element rendered above the main content area. */
28
+ /** Header element rendered above the main content area. */
20
29
  header?: ReactNode;
21
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. */
22
32
  onBack?: (() => void) | null;
23
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. */
24
35
  backButton?: ReactNode;
25
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'`). */
26
38
  sliderImages?: string[];
27
39
  /** Auto-play interval in milliseconds for the slider. */
40
+ /** Auto-play interval in milliseconds for the slider. */
28
41
  sliderAutoPlayInterval?: number;
29
42
  /** Titles displayed alongside each slider image. */
43
+ /** Titles displayed alongside each slider image. */
30
44
  sliderTitles?: (ReactNode | string)[];
31
45
  /** Layout variant controlling responsive behavior (e.g. `'desktop'`, `'mobile'`). */
32
- variant?: AuthLayoutVariant;
46
+ variant?: AuthLayoutVariant | undefined;
33
47
  /** Maximum width constraint for the content area (e.g. `'sm'`, `'md'`, `'lg'`). @default `'sm'` */
34
48
  maxWidth?: AuthLayoutMaxWidth;
35
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'` */
36
51
  contentWidth?: 'sm' | 'default';
37
52
  /** Horizontal alignment of logo, title, and description. @default `'center'` */
53
+ /** Horizontal alignment of logo, title, and description. @default `'center'` */
38
54
  align?: AuthLayoutAlign;
39
55
  /** Additional CSS class name(s) applied to the outermost layout element. */
56
+ /** Additional CSS class name(s) applied to the outermost layout element. */
40
57
  className?: string;
41
58
  }
42
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 { 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,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,4 +1,4 @@
1
- import { LayoutPresetConfig, LayoutPresetName } from '../types/layout-presets';
1
+ import { LayoutPresetConfig, LayoutPresetName } from '../types/components/layout-presets';
2
2
  /**
3
3
  * Returns layout structure config for a preset name.
4
4
  * Empty string returns undefined (caller uses full composition / no preset).
@@ -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
1
  import { SSOAuthProviderProps } from '../types';
2
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;
@@ -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}}
@@ -2,7 +2,11 @@ import { UseLoginEntryFormOptions, UseLoginEntryFormReturn } from '../types';
2
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
1
  import { MainAuthPageHandlers, UseMainAuthPageHandlersOptions } from '../types';
2
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;
@@ -7,6 +7,9 @@ export declare const DEFAULT_OTP_TITLES: Record<OtpVerificationMode, string>;
7
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
1
  import { UseRepeatLoginOptions, UseRepeatLoginReturn } from '../types';
2
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;
@@ -2,6 +2,11 @@ import { UseSignupFormOptions, UseSignupFormReturn } from '../types';
2
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.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
  import { jsx as G, Fragment as Kt } from "react/jsx-runtime";
3
- import { f as le, A as Zr, g as Xr, u as Jr, d as zr, e as Qr, c as ei, a as Yt, b as ti, O as ni, S as ri } from "./signup-DeeuWsoF.js";
4
- import { D as a1, I as o1, L as d1, h as u1, M as l1, i as s1, j as c1, k as f1, R as $1, l as p1, m as y1, n as h1, o as m1, p as g1, q as v1 } from "./signup-DeeuWsoF.js";
3
+ import { f as le, A as Zr, g as Xr, u as Jr, d as zr, e as Qr, c as ei, a as Yt, b as ti, O as ni, S as ri } from "./signup-page-DBRzdhNj.js";
4
+ import { D as o1, I as d1, L as u1, h as l1, M as s1, i as c1, j as f1, k as $1, R as p1, l as y1, m as h1, n as m1, o as g1, p as v1, q as b1 } from "./signup-page-DBRzdhNj.js";
5
5
  import N, { createContext as ii, useContext as tr, useRef as nr, useCallback as ae, useMemo as We, useReducer as ai, useEffect as oi } from "react";
6
6
  import { DoctCircularProgress as di } from "docthub-core-components";
7
+ import "react-hook-form";
7
8
  function Ft(e) {
8
9
  return e.replace(/\/+$/, "");
9
10
  }
@@ -32,7 +33,7 @@ async function ui(e, t) {
32
33
  }
33
34
  return r.json();
34
35
  }
35
- function zl(e) {
36
+ function Ql(e) {
36
37
  const t = Ft(e), r = `${t.endsWith("/api") ? t : `${t}/api`}/auth`;
37
38
  return {
38
39
  async sendOtp(i) {
@@ -132,7 +133,7 @@ function fi() {
132
133
  throw new Error("useAuthFlow must be used within SSOAuthProvider");
133
134
  return e;
134
135
  }
135
- function Ql() {
136
+ function e1() {
136
137
  const e = le.c(6), t = tr(Mt);
137
138
  if (!t)
138
139
  throw new Error("useAuthSession must be used within SSOAuthProvider");
@@ -6569,7 +6570,7 @@ function Gl() {
6569
6570
  }
6570
6571
  };
6571
6572
  }
6572
- function e1() {
6573
+ function t1() {
6573
6574
  return {
6574
6575
  get() {
6575
6576
  return null;
@@ -6580,7 +6581,7 @@ function e1() {
6580
6581
  }
6581
6582
  };
6582
6583
  }
6583
- function t1(e, t) {
6584
+ function n1(e, t) {
6584
6585
  e.defaults.withCredentials = !0, e.interceptors.request.use((n) => {
6585
6586
  const r = {
6586
6587
  ...n
@@ -7113,53 +7114,53 @@ function Yl(e) {
7113
7114
  let n;
7114
7115
  return t[0] !== e ? (n = /* @__PURE__ */ G(ir.Preset, { preset: "verification", children: /* @__PURE__ */ G(ni, { ...e }) }), t[0] = e, t[1] = n) : n = t[1], n;
7115
7116
  }
7116
- const n1 = {
7117
+ const r1 = {
7117
7118
  Provider: Hl,
7118
7119
  Login: Vl,
7119
7120
  Signup: Kl,
7120
7121
  Otp: Yl
7121
7122
  };
7122
7123
  export {
7123
- n1 as Auth,
7124
+ r1 as Auth,
7124
7125
  $i as AuthFlow,
7125
7126
  Mt as AuthFlowContext,
7126
7127
  ir as AuthLayout,
7127
7128
  ci as AuthLayoutPreset,
7128
7129
  Zr as AuthLayoutWrapper,
7129
- a1 as DEFAULT_OTP_TITLES,
7130
+ o1 as DEFAULT_OTP_TITLES,
7130
7131
  Bl as INITIAL_STEP,
7131
- o1 as ImageSlider,
7132
- d1 as LoginEntry,
7132
+ d1 as ImageSlider,
7133
+ u1 as LoginEntry,
7133
7134
  Yt as LoginEntryPage,
7134
- u1 as MainLayout,
7135
- l1 as MainLogin,
7135
+ l1 as MainLayout,
7136
+ s1 as MainLogin,
7136
7137
  ti as MainLoginPage,
7137
- s1 as OTP_LENGTH,
7138
+ c1 as OTP_LENGTH,
7138
7139
  ni as OtpVerification,
7139
7140
  ei as OtpVerificationPage,
7140
- c1 as RESEND_COOLDOWN_EMAIL_SECONDS,
7141
- f1 as RESEND_COOLDOWN_PHONE_SECONDS,
7142
- $1 as RepeatLogin,
7141
+ f1 as RESEND_COOLDOWN_EMAIL_SECONDS,
7142
+ $1 as RESEND_COOLDOWN_PHONE_SECONDS,
7143
+ p1 as RepeatLogin,
7143
7144
  zr as RepeatLoginPage,
7144
7145
  Hl as SSOAuthProvider,
7145
7146
  ri as Signup,
7146
7147
  Qr as SignupPage,
7147
7148
  Wl as authFlowReducer,
7148
7149
  kl as clearRepeatLoginInfo,
7149
- t1 as createAxiosAuthInterceptors,
7150
- zl as createHttpAuthAdapter,
7150
+ n1 as createAxiosAuthInterceptors,
7151
+ Ql as createHttpAuthAdapter,
7151
7152
  Ul as getInitialAuthFlowState,
7152
7153
  pt as getRepeatLoginInfo,
7153
7154
  Gl as localStorageTokenStorage,
7154
- e1 as serverCookieTokenStorage,
7155
+ t1 as serverCookieTokenStorage,
7155
7156
  jl as setRepeatLoginInfo,
7156
- p1 as useAppleSignIn,
7157
+ y1 as useAppleSignIn,
7157
7158
  fi as useAuthFlow,
7158
- Ql as useAuthSession,
7159
+ e1 as useAuthSession,
7159
7160
  Jr as useGoogleAuth,
7160
- y1 as useLoginEntryForm,
7161
- h1 as useMainAuthPageHandlers,
7162
- m1 as useOtpVerification,
7163
- g1 as useRepeatLogin,
7164
- v1 as useSignupForm
7161
+ h1 as useLoginEntryForm,
7162
+ m1 as useMainAuthPageHandlers,
7163
+ g1 as useOtpVerification,
7164
+ v1 as useRepeatLogin,
7165
+ b1 as useSignupForm
7165
7166
  };
@@ -1,4 +1,7 @@
1
- export { LoginEntry, type LoginEntryMode, LoginEntryPage, type LoginEntryPageProps, type LoginEntryProps, } from './login-entry';
1
+ /**
2
+ * Page components barrel: *Page = full page with layout, bare name = form-only for composition.
3
+ */
4
+ export { LoginEntry, LoginEntryPage, type LoginEntryMode, type LoginEntryPageProps, type LoginEntryProps, } from './login-entry';
2
5
  export { MainLogin, type MainLoginAppleProviderConfig, type MainLoginGoogleProviderConfig, MainLoginPage, type MainLoginPageProps, type MainLoginPageProvidersConfig, } from './main-login';
3
6
  export { OtpVerification, type OtpVerificationMode, OtpVerificationPage, type OtpVerificationPageProps, type OtpVerificationProps, } from './otp-verification';
4
7
  export { RepeatLogin, RepeatLoginPage, type RepeatLoginPageProps, type RepeatLoginProps, } from './repeat-login';
@@ -0,0 +1,3 @@
1
+ export type { LoginEntryMode, LoginEntryPageProps, LoginEntryProps, } from '../../types';
2
+ export { LoginEntry } from './login-entry';
3
+ export { LoginEntryPage } from './login-entry-page';
@@ -0,0 +1,21 @@
1
+ import { LoginEntryPageProps } from '../../types';
2
+ /**
3
+ * Full LoginEntry page with AuthLayoutWrapper, back button, and slider/standalone layout.
4
+ * Use when rendering the login entry screen as a standalone page.
5
+ *
6
+ * @example Next.js: API call in hook, redirect with mode + recipient for OTP page
7
+ * ```tsx
8
+ * <LoginEntryPage
9
+ * mode="phone"
10
+ * onBack={() => router.back()}
11
+ * submitApi={(data) => api.sendOtp(data)}
12
+ * onSuccess={(params) => router.push(`/otp?mode=${params.mode}&recipient=${encodeURIComponent(params.recipient)}`)}
13
+ * />
14
+ * ```
15
+ *
16
+ * @example Sync callback (caller owns API)
17
+ * ```tsx
18
+ * <LoginEntryPage mode="phone" onSubmit={(data) => sendOtp(data)} />
19
+ * ```
20
+ */
21
+ export declare function LoginEntryPage(props: Readonly<LoginEntryPageProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { LoginEntryProps } from '../../types';
2
+ /**
3
+ * Login entry form body without layout wrapper.
4
+ * Single form for phone or email based on mode. Use inside your own layout or AuthFlow.
5
+ * Validation per PRODUCT_PROTOCOLS and edge cases 3–5, 18; cursor focus on first field (#26).
6
+ *
7
+ * @example With AuthFlow (sync onSubmit)
8
+ * ```tsx
9
+ * <LoginEntry mode="phone" onSubmit={(data) => actions.submitIdentifier(data)} />
10
+ * ```
11
+ *
12
+ * @example Standalone Next.js (API + redirect in hook)
13
+ * ```tsx
14
+ * <LoginEntry
15
+ * mode="phone"
16
+ * submitApi={(data) => api.sendOtp(data)}
17
+ * onSuccess={() => router.push('/otp')}
18
+ * />
19
+ * ```
20
+ */
21
+ export declare function LoginEntry(props: Readonly<LoginEntryProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export { MainLoginPage } from './main-login-page';
2
+ export { MainLogin } from './main-login';
3
+ export type { MainLoginAppleProviderConfig, MainLoginGoogleProviderConfig, MainLoginPageProps, MainLoginPageProvidersConfig, } from '../../types';
@@ -0,0 +1,16 @@
1
+ import { MainLoginPageProps } from '../../types';
2
+ /**
3
+ * Full MainLogin page with AuthLayoutWrapper, header, footer, and slider layout.
4
+ * Includes default branding and layout configuration.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <MainLoginPage
9
+ * onContinueWithMobile={() => navigate('/auth/phone')}
10
+ * onContinueWithEmail={() => navigate('/auth/email')}
11
+ * onContinueWithGoogle={() => navigate('/auth/google')}
12
+ * onContinueWithApple={() => navigate('/auth/apple')}
13
+ * />
14
+ * ```
15
+ */
16
+ export declare const MainLoginPage: (props: Readonly<MainLoginPageProps>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { MainAuthPageHandlers, MainLoginPageProps } from '../../types';
2
+ interface MainLoginPageBodyProps {
3
+ handlers: MainAuthPageHandlers;
4
+ }
5
+ /**
6
+ * Renders the main login form body with four authentication options.
7
+ * Each button triggers its corresponding handler from the handlers prop.
8
+ */
9
+ export declare const MainLoginPageBody: ({ handlers, }: Readonly<MainLoginPageBodyProps>) => import("react/jsx-runtime").JSX.Element;
10
+ /**
11
+ * Login body component without layout wrapper.
12
+ * Displays four authentication method buttons (Mobile, Email, Google, Apple).
13
+ *
14
+ * Use this when you need custom layout or when integrating with AuthFlow.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <MainLogin
19
+ * onContinueWithMobile={() => navigate('/auth/phone')}
20
+ * onContinueWithEmail={() => navigate('/auth/email')}
21
+ * />
22
+ * ```
23
+ */
24
+ export declare function MainLogin(props: Readonly<MainLoginPageProps>): import("react/jsx-runtime").JSX.Element;
25
+ export {};
@@ -0,0 +1,3 @@
1
+ export type { OtpVerificationMode, OtpVerificationPageProps, OtpVerificationProps, } from '../../types';
2
+ export { OtpVerification } from './otp-verification';
3
+ export { OtpVerificationPage } from './otp-verification-page';
@@ -0,0 +1,23 @@
1
+ import { OtpVerificationPageProps } from '../../types';
2
+ /**
3
+ * Full OTP verification page with AuthLayoutWrapper and back button.
4
+ * Use when rendering the OTP screen as a standalone page.
5
+ *
6
+ * @example Next.js: API in hook, redirect from consumer
7
+ * ```tsx
8
+ * <OtpVerificationPage
9
+ * mode="phone"
10
+ * recipientDisplay="+91 9825910X0X"
11
+ * onBack={() => router.back()}
12
+ * submitApi={(otp) => api.verifyOtp(otp)}
13
+ * onSuccess={() => router.push('/dashboard')}
14
+ * onResendCode={() => api.resendOtp()}
15
+ * />
16
+ * ```
17
+ *
18
+ * @example Sync callback (AuthFlow)
19
+ * ```tsx
20
+ * <OtpVerificationPage onSubmit={(otp) => actions.verifyOtp(otp)} ... />
21
+ * ```
22
+ */
23
+ export declare function OtpVerificationPage(props: Readonly<OtpVerificationPageProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { OtpVerificationProps } from '../../types';
2
+ /**
3
+ * OTP verification form body without layout wrapper.
4
+ * 6-digit OTP input, resend countdown, and submit. Use inside your own layout or AuthFlow.
5
+ * Validation per edge cases 6, 7 (invalid/expired OTP); cursor focus on first OTP box (#26).
6
+ *
7
+ * @example With submitApi + onSuccess (consumer redirect)
8
+ * ```tsx
9
+ * <OtpVerification
10
+ * mode="phone"
11
+ * recipientDisplay="+91 9825910X0X"
12
+ * submitApi={(otp) => api.verifyOtp(otp)}
13
+ * onSuccess={() => router.push('/dashboard')}
14
+ * />
15
+ * ```
16
+ *
17
+ * @example Sync onSubmit (AuthFlow)
18
+ * ```tsx
19
+ * <OtpVerification onSubmit={(otp) => actions.verifyOtp(otp)} ... />
20
+ * ```
21
+ */
22
+ export declare function OtpVerification(props: Readonly<OtpVerificationProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export { RepeatLoginPage } from './repeat-login-page';
2
+ export { RepeatLogin } from './repeat-login';
3
+ export type { RepeatLoginPageProps, RepeatLoginProps } from '../../types';
@@ -0,0 +1,24 @@
1
+ import { RepeatLoginPageProps } from '../../types';
2
+ /**
3
+ * Full Repeat Login page with AuthLayoutWrapper, logo, title, description, and footer.
4
+ * Use when rendering the repeat login screen as a standalone page.
5
+ *
6
+ * @example Next.js: API in lib, redirect from consumer
7
+ * ```tsx
8
+ * <RepeatLoginPage
9
+ * lastUsedMethod="Mobile"
10
+ * continueApi={() => api.validateSession()}
11
+ * onSuccess={() => router.push('/dashboard')}
12
+ * onUseAnotherMethod={() => resetFlow()}
13
+ * />
14
+ * ```
15
+ *
16
+ * @example Sync (AuthFlow)
17
+ * ```tsx
18
+ * <RepeatLoginPage
19
+ * onContinueWithLastMethod={() => actions.continueWithLastMethod()}
20
+ * onUseAnotherMethod={() => actions.reset()}
21
+ * />
22
+ * ```
23
+ */
24
+ export declare function RepeatLoginPage(props: Readonly<RepeatLoginPageProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { RepeatLoginProps } from '../../types';
2
+ /**
3
+ * Repeat login body without layout wrapper.
4
+ * Primary CTA (continue with last method) and secondary "Use another method" button.
5
+ * When continueApi is provided, primary runs: continueApi() → onSuccess() (e.g. redirect).
6
+ *
7
+ * @example With continueApi + onSuccess (consumer redirect)
8
+ * ```tsx
9
+ * <RepeatLogin
10
+ * lastUsedMethod="Mobile"
11
+ * continueApi={() => api.validateSession()}
12
+ * onSuccess={() => router.push('/dashboard')}
13
+ * onUseAnotherMethod={() => resetFlow()}
14
+ * />
15
+ * ```
16
+ *
17
+ * @example Sync (AuthFlow)
18
+ * ```tsx
19
+ * <RepeatLogin
20
+ * onContinueWithLastMethod={() => actions.continueWithLastMethod()}
21
+ * onUseAnotherMethod={() => actions.reset()}
22
+ * />
23
+ * ```
24
+ */
25
+ export declare function RepeatLogin(props: Readonly<RepeatLoginProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export type { SignupEntryMode, SignupPageFullProps, SignupPageProps, } from '../../types';
2
+ export { Signup } from './signup';
3
+ export { SignupPage } from './signup-page';