doct-ui-auth-kit 1.0.26 → 1.0.27
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.
- package/dist/doct-ui-auth-kit.css +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-media-query.d.ts +4 -0
- package/dist/hooks/use-welcome-signup-form.d.ts +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1292 -1237
- package/dist/pages/index.d.ts +1 -0
- package/dist/pages/welcome-signup/edit-name-sheet.d.ts +7 -0
- package/dist/pages/welcome-signup/index.d.ts +4 -0
- package/dist/pages/welcome-signup/welcome-signup-page.d.ts +6 -0
- package/dist/pages/welcome-signup/welcome-signup.d.ts +6 -0
- package/dist/pages.js +17 -12
- package/dist/types/auth/flow.d.ts +6 -0
- package/dist/types/pages/index.d.ts +1 -0
- package/dist/types/pages/pages.d.ts +27 -0
- package/dist/types/pages/welcome-signup-form.d.ts +23 -0
- package/dist/validations/index.d.ts +1 -1
- package/dist/validations/schemas.d.ts +6 -0
- package/dist/welcome-signup-page-W45qOCrO.js +2228 -0
- package/package.json +1 -1
- package/dist/signup-page-CZ6M5DkH.js +0 -1919
package/dist/pages/index.d.ts
CHANGED
|
@@ -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 Indian users who verified email and are adding a 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 email login when 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
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
};
|
|
@@ -107,6 +107,8 @@ export type AuthFlowAction = {
|
|
|
107
107
|
identifierType?: IdentifierType;
|
|
108
108
|
identifierValue?: string;
|
|
109
109
|
maskedRecipient?: string;
|
|
110
|
+
/** Prefilled name for welcome signup variant. */
|
|
111
|
+
prefilledFullName?: string;
|
|
110
112
|
} | ({
|
|
111
113
|
type: 'SET_STEP_LINK_OR_MERGE';
|
|
112
114
|
} & LinkOrMergeSetupPayload) | {
|
|
@@ -162,6 +164,10 @@ export interface AuthFlowActions {
|
|
|
162
164
|
email?: string;
|
|
163
165
|
countryCode?: string;
|
|
164
166
|
}) => void;
|
|
167
|
+
/** Welcome signup: skip optional phone/email and complete with verified identifier. */
|
|
168
|
+
skipSignupDetails: (data: {
|
|
169
|
+
fullName: string;
|
|
170
|
+
}) => void;
|
|
165
171
|
/**
|
|
166
172
|
* Verifies the OTP against the auth API. Resolves on success (after the
|
|
167
173
|
* reducer has been advanced) and rejects with an `AuthError` whose
|
|
@@ -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
|
*/
|