doct-ui-auth-kit 1.0.27 → 1.0.29

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.
@@ -1,6 +1,6 @@
1
1
  import type { WelcomeSignupPageFullProps } from '../../types';
2
2
  /**
3
- * Welcome signup page for Indian users who verified email and are adding a phone.
3
+ * Welcome signup page for new SSO users (Google/Apple) adding an optional phone.
4
4
  * Matches the Figma "Welcome to Docthub using email" responsive layout.
5
5
  */
6
6
  export declare function WelcomeSignupPage(props: Readonly<WelcomeSignupPageFullProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import type { WelcomeSignupPageProps } from '../../types';
2
2
  /**
3
- * Welcome signup form shown after email login when collecting a phone number.
3
+ * Welcome signup form shown after SSO signup when optionally collecting a phone number.
4
4
  * Displays the user's name with an edit sheet and a phone input.
5
5
  */
6
6
  export declare function WelcomeSignup(props: Readonly<WelcomeSignupPageProps>): import("react/jsx-runtime").JSX.Element;
@@ -49,6 +49,10 @@ export interface VerifyOtpResponse {
49
49
  isNewUser: boolean;
50
50
  /** When isNewUser and conflict (e.g. email already linked), masked linked identifier. */
51
51
  conflict?: AuthError;
52
+ /** Name from verify-otp / SSO for new-user profile completion. */
53
+ prefilledFullName?: string;
54
+ /** Verified email from SSO for new-user profile completion. */
55
+ prefilledEmail?: string;
52
56
  }
53
57
  /** Input for completeProfile (new users). */
54
58
  export interface CompleteProfileParams {
@@ -60,6 +60,8 @@ export interface AuthFlowState {
60
60
  maskedRecipient: string;
61
61
  /** For SIGNUP_DETAILS (Indian): which field to collect (phone or email). */
62
62
  signupCollectField: IdentifierType;
63
+ /** When set to `sso`, SIGNUP_DETAILS uses the optional WelcomeSignup phone step. */
64
+ signupOrigin?: 'sso';
63
65
  /** For REPEAT_LOGIN: last used method label. */
64
66
  lastMethod: string;
65
67
  /** Set when step is AUTHENTICATED. */
@@ -109,6 +111,8 @@ export type AuthFlowAction = {
109
111
  maskedRecipient?: string;
110
112
  /** Prefilled name for welcome signup variant. */
111
113
  prefilledFullName?: string;
114
+ /** When `sso`, show WelcomeSignupPage (optional phone) instead of SignupPage. */
115
+ signupOrigin?: 'sso';
112
116
  } | ({
113
117
  type: 'SET_STEP_LINK_OR_MERGE';
114
118
  } & LinkOrMergeSetupPayload) | {
@@ -5,3 +5,4 @@ export { buildPhoneRecipient } from './build-phone-recipient';
5
5
  export { clearFlowState, readFlowState, writeFlowState, } from './flow-state-storage';
6
6
  export { clearAllFormState, clearFormState, readFormState, writeFormState, } from './form-state-storage';
7
7
  export { setFormErrorsFromZod } from './set-form-errors-from-zod';
8
+ export { buildSsoWelcomeSignupFlowState, type SsoWelcomeSignupSeed, seedSsoWelcomeSignupFlow, } from './sso-welcome-signup';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Builds persisted flow state for new SSO users who still need the optional
3
+ * WelcomeSignup phone step. Consumers call {@link seedSsoWelcomeSignupFlow}
4
+ * before navigating to `/auth/signup` so the kit restores SIGNUP_DETAILS on
5
+ * mount instead of bouncing to METHOD_SELECT.
6
+ */
7
+ import type { AuthFlowState } from '../types';
8
+ export interface SsoWelcomeSignupSeed {
9
+ fullName?: string;
10
+ email?: string;
11
+ }
12
+ /** Flow snapshot for SIGNUP_DETAILS + WelcomeSignupPage (SSO origin). */
13
+ export declare function buildSsoWelcomeSignupFlowState(params?: SsoWelcomeSignupSeed): AuthFlowState;
14
+ /** Persist SSO welcome-signup state for the next `/auth/signup` load. */
15
+ export declare function seedSsoWelcomeSignupFlow(params?: SsoWelcomeSignupSeed): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doct-ui-auth-kit",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "description": "Composable React auth SDK – layouts, login/signup/OTP pages, SSO provider, and auth flow hooks for Docthub",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",