doct-ui-auth-kit 1.0.26 → 1.0.28

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.
@@ -7,3 +7,4 @@ export { MainLogin, type MainLoginAppleProviderConfig, type MainLoginGoogleProvi
7
7
  export { OtpVerification, type OtpVerificationMode, OtpVerificationPage, type OtpVerificationPageProps, type OtpVerificationProps, } from './otp-verification';
8
8
  export { RepeatLogin, RepeatLoginPage, type RepeatLoginPageProps, type RepeatLoginProps, } from './repeat-login';
9
9
  export { Signup, SignupPage, type SignupPageFullProps, type SignupPageProps, } from './signup';
10
+ export { WelcomeSignup, WelcomeSignupPage, type WelcomeSignupPageFullProps, type WelcomeSignupPageProps, } from './welcome-signup';
@@ -0,0 +1,7 @@
1
+ export interface EditNameSheetProps {
2
+ open: boolean;
3
+ value: string;
4
+ onOpenChange: (open: boolean) => void;
5
+ onSave: (name: string) => void;
6
+ }
7
+ export declare function EditNameSheet({ open, value, onOpenChange, onSave, }: Readonly<EditNameSheetProps>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ export type { WelcomeSignupPageFullProps, WelcomeSignupPageProps, } from '../../types';
2
+ export { EditNameSheet, type EditNameSheetProps } from './edit-name-sheet';
3
+ export { WelcomeSignup } from './welcome-signup';
4
+ export { WelcomeSignupPage } from './welcome-signup-page';
@@ -0,0 +1,6 @@
1
+ import type { WelcomeSignupPageFullProps } from '../../types';
2
+ /**
3
+ * Welcome signup page for new SSO users (Google/Apple) adding an optional phone.
4
+ * Matches the Figma "Welcome to Docthub using email" responsive layout.
5
+ */
6
+ export declare function WelcomeSignupPage(props: Readonly<WelcomeSignupPageFullProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { WelcomeSignupPageProps } from '../../types';
2
+ /**
3
+ * Welcome signup form shown after SSO signup when optionally collecting a phone number.
4
+ * Displays the user's name with an edit sheet and a phone input.
5
+ */
6
+ export declare function WelcomeSignup(props: Readonly<WelcomeSignupPageProps>): import("react/jsx-runtime").JSX.Element;
package/dist/pages.js CHANGED
@@ -1,15 +1,20 @@
1
1
  "use client";
2
- import { L as i, a as n, b as g, M as s, c as o, O as t, d as r, R as L, e as p, S as P, f as c } from "./signup-page-CZ6M5DkH.js";
2
+ import { L as o, a as s, b as t, M as p, c as r, O as L, d as P, R as c, e as m, S as u, f as S, W as f, g as M } from "./welcome-signup-page-W45qOCrO.js";
3
+ import "react/jsx-runtime";
4
+ import "react";
5
+ import "docthub-core-components";
3
6
  export {
4
- i as LinkOrMergePage,
5
- n as LoginEntry,
6
- g as LoginEntryPage,
7
- s as MainLogin,
8
- o as MainLoginPage,
9
- t as OtpVerification,
10
- r as OtpVerificationPage,
11
- L as RepeatLogin,
12
- p as RepeatLoginPage,
13
- P as Signup,
14
- c as SignupPage
7
+ o as LinkOrMergePage,
8
+ s as LoginEntry,
9
+ t as LoginEntryPage,
10
+ p as MainLogin,
11
+ r as MainLoginPage,
12
+ L as OtpVerification,
13
+ P as OtpVerificationPage,
14
+ c as RepeatLogin,
15
+ m as RepeatLoginPage,
16
+ u as Signup,
17
+ S as SignupPage,
18
+ f as WelcomeSignup,
19
+ M as WelcomeSignupPage
15
20
  };
@@ -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. */
@@ -107,6 +109,10 @@ export type AuthFlowAction = {
107
109
  identifierType?: IdentifierType;
108
110
  identifierValue?: string;
109
111
  maskedRecipient?: string;
112
+ /** Prefilled name for welcome signup variant. */
113
+ prefilledFullName?: string;
114
+ /** When `sso`, show WelcomeSignupPage (optional phone) instead of SignupPage. */
115
+ signupOrigin?: 'sso';
110
116
  } | ({
111
117
  type: 'SET_STEP_LINK_OR_MERGE';
112
118
  } & LinkOrMergeSetupPayload) | {
@@ -162,6 +168,10 @@ export interface AuthFlowActions {
162
168
  email?: string;
163
169
  countryCode?: string;
164
170
  }) => void;
171
+ /** Welcome signup: skip optional phone/email and complete with verified identifier. */
172
+ skipSignupDetails: (data: {
173
+ fullName: string;
174
+ }) => void;
165
175
  /**
166
176
  * Verifies the OTP against the auth API. Resolves on success (after the
167
177
  * reducer has been advanced) and rejects with an `AuthError` whose
@@ -7,3 +7,4 @@ export * from './otp-verification';
7
7
  export * from './pages';
8
8
  export * from './repeat-login';
9
9
  export * from './signup-form';
10
+ export * from './welcome-signup-form';
@@ -151,3 +151,30 @@ export interface RepeatLoginPageProps extends RepeatLoginProps {
151
151
  layoutType?: 'withSlider' | 'standalone';
152
152
  variant?: 'desktop' | 'mobile';
153
153
  }
154
+ /** Data payload from the welcome signup form. */
155
+ export type WelcomeSignupData = {
156
+ fullName: string;
157
+ phone?: string | undefined;
158
+ email?: string | undefined;
159
+ countryCode?: string | undefined;
160
+ };
161
+ /** Props for WelcomeSignup (inner form without layout). */
162
+ export interface WelcomeSignupPageProps {
163
+ /** Prefilled display name from provider or prior step. */
164
+ fullName?: string | undefined;
165
+ /** Which secondary field the welcome screen is collecting. */
166
+ collectField?: 'phone' | 'email' | undefined;
167
+ onSubmit?: ((data: WelcomeSignupData) => void) | undefined;
168
+ submitApi?: ((data: WelcomeSignupData) => Promise<void>) | undefined;
169
+ onSuccess?: (() => void) | undefined;
170
+ onError?: ((error: unknown) => void) | undefined;
171
+ /** Skip adding the secondary field and complete profile with existing identifier. */
172
+ onSkip?: ((data: {
173
+ fullName: string;
174
+ }) => void) | undefined;
175
+ }
176
+ /** Props for the full WelcomeSignupPage (adds optional layout overrides). */
177
+ export interface WelcomeSignupPageFullProps extends WelcomeSignupPageProps {
178
+ layoutType?: 'withSlider' | 'standalone';
179
+ variant?: 'desktop' | 'mobile';
180
+ }
@@ -0,0 +1,23 @@
1
+ import type { UseFormReturn } from 'react-hook-form';
2
+ import type { z } from 'zod';
3
+ import type { welcomeSignupPhoneFormSchema } from '../../validations';
4
+ export type WelcomeSignupFormValues = z.infer<typeof welcomeSignupPhoneFormSchema>;
5
+ export type WelcomeSignupSubmitData = {
6
+ fullName: string;
7
+ phone?: string | undefined;
8
+ countryCode?: string | undefined;
9
+ };
10
+ export interface UseWelcomeSignupFormOptions {
11
+ initialFullName?: string | undefined;
12
+ onSubmit?: ((data: WelcomeSignupSubmitData) => void) | undefined;
13
+ submitApi?: ((data: WelcomeSignupSubmitData) => Promise<void>) | undefined;
14
+ onSuccess?: (() => void) | undefined;
15
+ onError?: ((error: unknown) => void) | undefined;
16
+ }
17
+ export interface UseWelcomeSignupFormReturn {
18
+ methods: UseFormReturn<WelcomeSignupFormValues>;
19
+ handleSubmit: (data: WelcomeSignupFormValues) => void;
20
+ isSubmitting: boolean;
21
+ fullName: string;
22
+ setFullName: (name: string) => void;
23
+ }
@@ -3,4 +3,4 @@
3
3
  * Import from here: import { signupSchemas, loginSchemas, otpFormSchema } from '../validations';
4
4
  */
5
5
  export type { OtpVerificationMode } from './schemas';
6
- export { capitalizeWords, emailSchema, fullNameSchema, getResendCooldownSeconds, loginEmailFormSchema, loginPhoneFormSchema, loginSchemas, OTP_LENGTH, otpFormSchema, phoneSchema, RESEND_COOLDOWN_EMAIL_SECONDS, RESEND_COOLDOWN_PHONE_SECONDS, signupEmailFormSchema, signupForeignFormSchema, signupPhoneFormSchema, signupSchemas, } from './schemas';
6
+ export { capitalizeWords, emailSchema, fullNameSchema, getResendCooldownSeconds, loginEmailFormSchema, loginPhoneFormSchema, loginSchemas, OTP_LENGTH, otpFormSchema, phoneSchema, RESEND_COOLDOWN_EMAIL_SECONDS, RESEND_COOLDOWN_PHONE_SECONDS, signupEmailFormSchema, signupForeignFormSchema, signupPhoneFormSchema, signupSchemas, welcomeSignupPhoneFormSchema, } from './schemas';
@@ -54,6 +54,12 @@ export declare const signupSchemas: {
54
54
  countryCode: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
55
55
  }, z.core.$strip>;
56
56
  };
57
+ /** Welcome signup: prefilled name + optional phone (Indian email-login flow). */
58
+ export declare const welcomeSignupPhoneFormSchema: z.ZodObject<{
59
+ fullName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
60
+ phone: z.ZodString;
61
+ countryCode: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
62
+ }, z.core.$strip>;
57
63
  /**
58
64
  * Phone validation per PRODUCT_PROTOCOLS #2, #5 and edge cases 3–5.
59
65
  */