doct-ui-auth-kit 1.0.3 → 1.0.5
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/README.md +15 -0
- package/dist/auth-methods/apple.d.ts +1 -1
- package/dist/auth-methods/index.d.ts +1 -0
- package/dist/components/form/rhf-doct-phone-input.d.ts +1 -1
- package/dist/components/form/rhf-input-field.d.ts +1 -1
- package/dist/components/form/rhf-otp-input-field.d.ts +1 -1
- package/dist/components/layout/image-slider.d.ts +2 -19
- package/dist/components/layout/main-layout.d.ts +2 -46
- package/dist/core/auth-api-adapter.d.ts +1 -39
- package/dist/core/auth-context.d.ts +4 -50
- package/dist/core/auth-provider.d.ts +2 -35
- package/dist/core/auth-types.d.ts +3 -68
- package/dist/core/device-detection.d.ts +2 -6
- package/dist/core/sso-session.d.ts +2 -30
- package/dist/core/use-auth-flow.d.ts +2 -75
- package/dist/doct-ui-auth-kit.css +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-login-entry-form.d.ts +4 -28
- package/dist/hooks/use-main-auth-page-handlers.d.ts +8 -0
- package/dist/hooks/use-otp-verification.d.ts +7 -31
- package/dist/hooks/use-repeat-login.d.ts +7 -0
- package/dist/hooks/use-signup-form.d.ts +4 -44
- package/dist/index.d.ts +18 -9
- package/dist/index.js +2943 -3452
- package/dist/pages/index.d.ts +5 -5
- package/dist/pages/login-entry.d.ts +40 -21
- package/dist/pages/main-login.d.ts +30 -14
- package/dist/pages/otp-verification.d.ts +43 -21
- package/dist/pages/repeat-login.d.ts +47 -18
- package/dist/pages/signup.d.ts +43 -23
- package/dist/pages.js +10 -5
- package/dist/signup-BJWKwg7j.js +1723 -0
- package/dist/types/auth-api-adapter.d.ts +43 -0
- package/dist/types/auth-provider.d.ts +37 -0
- package/dist/types/auth-types.d.ts +70 -0
- package/dist/types/device-detection.d.ts +7 -0
- package/dist/types/flow.d.ts +125 -0
- package/dist/types/forms.d.ts +2 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/layout.d.ts +57 -0
- package/dist/types/login-form.d.ts +39 -0
- package/dist/types/main-login.d.ts +29 -0
- package/dist/types/otp-verification.d.ts +28 -0
- package/dist/types/pages.d.ts +133 -0
- package/dist/types/repeat-login.d.ts +28 -0
- package/dist/types/signup-form.d.ts +41 -0
- package/dist/types/sso-session.d.ts +33 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/set-form-errors-from-zod.d.ts +11 -0
- package/dist/validations/index.d.ts +6 -0
- package/dist/validations/schemas.d.ts +76 -0
- package/package.json +105 -104
- package/dist/signup-x-Jm7XKn.js +0 -668
|
@@ -1,47 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
/** Signup mode: phone, email as second field, or foreign (full name + email + phone) */
|
|
4
|
-
export type SignupEntryMode = 'phone' | 'email' | 'foreign';
|
|
5
|
-
declare const signupPhoneFormSchema: z.ZodObject<{
|
|
6
|
-
fullName: z.ZodString;
|
|
7
|
-
phone: z.ZodString;
|
|
8
|
-
}, z.core.$strip>;
|
|
9
|
-
declare const signupEmailFormSchema: z.ZodObject<{
|
|
10
|
-
fullName: z.ZodString;
|
|
11
|
-
email: z.ZodString;
|
|
12
|
-
}, z.core.$strip>;
|
|
13
|
-
declare const signupForeignFormSchema: z.ZodObject<{
|
|
14
|
-
fullName: z.ZodString;
|
|
15
|
-
email: z.ZodString;
|
|
16
|
-
phone: z.ZodString;
|
|
17
|
-
}, z.core.$strip>;
|
|
18
|
-
export type SignupPhoneFormValues = z.infer<typeof signupPhoneFormSchema>;
|
|
19
|
-
export type SignupEmailFormValues = z.infer<typeof signupEmailFormSchema>;
|
|
20
|
-
export type SignupForeignFormValues = z.infer<typeof signupForeignFormSchema>;
|
|
21
|
-
export type SignupFormValues = SignupPhoneFormValues | SignupEmailFormValues | SignupForeignFormValues;
|
|
22
|
-
export interface UseSignupFormOptions {
|
|
23
|
-
/** Mode: phone, email as second field, or foreign (name + email + phone) */
|
|
24
|
-
mode: SignupEntryMode;
|
|
25
|
-
/** For foreign mode: pre-fill phone when user already entered it. */
|
|
26
|
-
defaultPhone?: string;
|
|
27
|
-
/** Called with valid form data on submit. */
|
|
28
|
-
onSubmit?: ((data: {
|
|
29
|
-
fullName: string;
|
|
30
|
-
phone?: string;
|
|
31
|
-
email?: string;
|
|
32
|
-
}) => void) | undefined;
|
|
33
|
-
}
|
|
34
|
-
export interface UseSignupFormReturn {
|
|
35
|
-
methods: UseFormReturn<SignupFormValues>;
|
|
36
|
-
handleSubmit: (data: SignupFormValues) => void;
|
|
37
|
-
/** True when mode is 'phone', false when mode is 'email'. For 'foreign' same as (mode === 'phone') for layout. */
|
|
38
|
-
isPhone: boolean;
|
|
39
|
-
/** True when mode is 'foreign' (full name + email + phone). */
|
|
40
|
-
isForeign: boolean;
|
|
41
|
-
}
|
|
1
|
+
import type { UseSignupFormOptions, UseSignupFormReturn } from '@/types';
|
|
2
|
+
export type { SignupEmailFormValues, SignupEntryMode, SignupForeignFormValues, SignupFormValues, SignupPhoneFormValues, SignupSubmitData, UseSignupFormOptions, UseSignupFormReturn, } from '@/types';
|
|
42
3
|
/**
|
|
43
4
|
* Form state and validation for the signup screen (full name + phone or email, or foreign: all three).
|
|
44
|
-
*
|
|
5
|
+
* When submitApi is provided, hook runs: validate → submitApi(data) → onSuccess() (e.g. redirect).
|
|
45
6
|
*/
|
|
46
|
-
export declare function useSignupForm({ mode, defaultPhone, onSubmit, }: UseSignupFormOptions): UseSignupFormReturn;
|
|
47
|
-
export {};
|
|
7
|
+
export declare function useSignupForm({ mode, defaultPhone, onSubmit, submitApi, onSuccess, onError, }: UseSignupFormOptions): UseSignupFormReturn;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auth SDK UI Kit – library entry point.
|
|
3
|
-
* Consumers can import components, layouts, hooks, core (SSO provider, flow, session), and auth methods.
|
|
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';`
|
|
4
7
|
*
|
|
5
8
|
* @example
|
|
6
9
|
* ```ts
|
|
@@ -11,17 +14,23 @@
|
|
|
11
14
|
* useAuthSession,
|
|
12
15
|
* MainLayout,
|
|
13
16
|
* AuthLayout,
|
|
17
|
+
* ImageSlider,
|
|
18
|
+
* AuthLayoutWrapper,
|
|
14
19
|
* LoginEntry,
|
|
15
20
|
* OtpVerification,
|
|
16
21
|
* useGoogleAuth,
|
|
17
22
|
* } from 'doct-ui-auth-kit';
|
|
18
23
|
* ```
|
|
19
24
|
*/
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export * from '
|
|
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';
|