doct-ui-auth-kit 1.0.1 → 1.0.3

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 (44) hide show
  1. package/dist/adapters/http-auth-adapter.d.ts +2 -1
  2. package/dist/auth/index.d.ts +23 -0
  3. package/dist/auth-methods/google.d.ts +3 -63
  4. package/dist/auth-methods/index.d.ts +1 -2
  5. package/dist/auth-methods/use-google-auth.d.ts +69 -0
  6. package/dist/components/layout/auth-layout-preset.d.ts +25 -0
  7. package/dist/components/layout/auth-layout-public.d.ts +17 -0
  8. package/dist/components/layout/auth-layout-wrapper.d.ts +23 -0
  9. package/dist/components/layout/index.d.ts +5 -3
  10. package/dist/constants/demo-slider.d.ts +0 -2
  11. package/dist/constants/index.d.ts +2 -1
  12. package/dist/constants/layout-presets.d.ts +10 -0
  13. package/dist/core/auth-api-adapter.d.ts +6 -0
  14. package/dist/core/auth-context.d.ts +4 -8
  15. package/dist/core/auth-flow.d.ts +2 -2
  16. package/dist/core/auth-types.d.ts +3 -1
  17. package/dist/core/sso-session.d.ts +37 -11
  18. package/dist/core/use-auth-flow.d.ts +22 -19
  19. package/dist/hooks/index.d.ts +1 -1
  20. package/dist/hooks/use-otp-verification.d.ts +9 -2
  21. package/dist/hooks/use-signup-form.d.ts +18 -8
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.js +3438 -3091
  24. package/dist/main-logo.svg +3 -0
  25. package/dist/pages/index.d.ts +0 -2
  26. package/dist/pages/main-login.d.ts +2 -6
  27. package/dist/pages/otp-verification.d.ts +3 -1
  28. package/dist/pages/signup.d.ts +14 -6
  29. package/dist/pages.js +6 -8
  30. package/dist/signup-x-Jm7XKn.js +668 -0
  31. package/dist/stories/components/default-footer.d.ts +5 -0
  32. package/dist/stories/components/enterprise-header.d.ts +5 -0
  33. package/dist/stories/components/index.d.ts +2 -0
  34. package/dist/types/forms.d.ts +3 -87
  35. package/dist/types/index.d.ts +5 -4
  36. package/dist/types/layout-presets.d.ts +29 -0
  37. package/package.json +1 -1
  38. package/dist/components/auth/repeat-login.d.ts +0 -24
  39. package/dist/components/form/rhf-password-field.d.ts +0 -2
  40. package/dist/pages/conflict.d.ts +0 -12
  41. package/dist/pages/foreign-email-collect.d.ts +0 -16
  42. package/dist/signup-CHqsrPuW.js +0 -797
  43. package/dist/types/common.d.ts +0 -25
  44. package/dist/types/user.d.ts +0 -31
@@ -0,0 +1,3 @@
1
+ <svg width="140" height="30" viewBox="0 0 140 30" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M118.216 24.79V26.6679H114.218V2.87449H118.564V10.3866C120.143 8.98022 122.197 8.21097 124.32 8.23032C126.824 8.23032 128.952 9.16129 130.705 11.0232C132.463 12.8844 133.343 15.1384 133.343 17.7674C133.343 20.4131 132.463 22.6497 130.705 24.495C128.946 26.3403 126.824 27.2717 124.303 27.2717C123.172 27.2817 122.051 27.0673 121.006 26.6411C119.96 26.2149 119.012 25.5855 118.216 24.79ZM119.824 13.7184C118.796 14.7961 118.299 16.136 118.299 17.7351C118.299 19.3342 118.814 20.6749 119.824 21.7531C120.298 22.2807 120.881 22.7001 121.534 22.9823C122.187 23.2645 122.894 23.4026 123.606 23.3872C124.321 23.4023 125.032 23.2659 125.69 22.9872C126.348 22.7085 126.938 22.2939 127.421 21.771C128.45 20.6918 128.948 19.3534 128.948 17.7693C128.948 16.1685 128.434 14.8299 127.421 13.7351C126.934 13.2211 126.346 12.8111 125.694 12.5304C125.041 12.2497 124.338 12.1042 123.626 12.1027C122.915 12.1013 122.21 12.244 121.557 12.522C120.903 12.8001 120.313 13.2076 119.824 13.7196L119.824 13.7184ZM96.5855 25.1333C95.3255 23.6964 94.6955 21.7699 94.6955 19.3351V8.81906H99.0578V18.3557H99.0422C99.0422 19.9883 99.3577 21.2296 99.9712 22.0796C100.585 22.9296 101.496 23.353 102.691 23.353C103.951 23.353 104.914 22.9287 105.544 22.0625C106.174 21.1963 106.491 19.9232 106.491 18.1921V8.81921H110.835V26.6679H106.787V25.0837C106.147 25.7859 105.364 26.3445 104.488 26.7221C103.613 27.0996 102.666 27.2874 101.711 27.2728C99.5556 27.2723 97.8636 26.5539 96.5855 25.1333ZM45.5977 24.4956C43.7236 22.6503 42.7946 20.3966 42.7946 17.768C42.7946 15.1228 43.7236 12.885 45.5977 11.0239C46.4749 10.1224 47.5298 9.40929 48.6968 8.92873C49.8637 8.44818 51.1179 8.21045 52.3815 8.23032C54.5374 8.23032 56.445 8.81844 58.1045 9.99468C59.7436 11.1451 60.9465 12.8065 61.5211 14.7138H56.6774C56.3006 13.9252 55.7015 13.2615 54.9523 12.803C54.1612 12.3525 53.26 12.1266 52.3479 12.1503C50.9059 12.1503 49.695 12.6888 48.6827 13.7508C47.6703 14.8128 47.1738 16.1175 47.1738 17.6527C47.1738 19.2689 47.688 20.6422 48.7164 21.7358C49.1986 22.2666 49.7903 22.6886 50.4513 22.9732C51.1123 23.2578 51.8273 23.3983 52.5479 23.3853C53.3808 23.3857 54.1969 23.1534 54.9026 22.715C55.6233 22.274 56.2039 21.6405 56.5779 20.8873H61.4112C60.8442 22.7603 59.6631 24.3923 58.0547 25.5251C56.3994 26.6908 54.4118 27.3026 52.3813 27.2714C49.7272 27.2723 47.4556 26.3413 45.5977 24.4956ZM24.283 24.4956C23.3735 23.6252 22.654 22.5789 22.169 21.4217C21.6841 20.2645 21.4441 19.0209 21.4639 17.768C21.4639 15.1228 22.4089 12.885 24.283 11.0239C26.1571 9.16268 28.4301 8.23032 31.1002 8.23032C33.7881 8.23032 36.0595 9.16083 37.9349 11.0232C38.8436 11.8979 39.5624 12.9473 40.0472 14.1072C40.532 15.267 40.7725 16.5128 40.754 17.768C40.754 20.4137 39.809 22.6503 37.9347 24.4956C36.0604 26.3409 33.7702 27.2723 31.1001 27.2723C28.43 27.2723 26.1571 26.3413 24.283 24.4956ZM27.352 13.7673C26.3396 14.8447 25.8415 16.1844 25.8415 17.7682C25.8415 19.352 26.3393 20.6909 27.352 21.7528C27.8357 22.2583 28.4183 22.6609 29.0641 22.936C29.71 23.2111 30.4056 23.353 31.1086 23.353C31.8116 23.353 32.5073 23.2111 33.1531 22.936C33.799 22.6609 34.3815 22.2583 34.8653 21.7528C35.8776 20.6908 36.3742 19.3523 36.3742 17.7682C36.3742 16.1841 35.8775 14.8447 34.8653 13.7673C34.3842 13.2573 33.8025 12.8507 33.1563 12.5727C32.5101 12.2947 31.8131 12.1512 31.1086 12.1512C30.4041 12.1512 29.7072 12.2947 29.061 12.5727C28.4147 12.8507 27.833 13.2573 27.352 13.7673ZM89.6194 26.6679H87.4298V17.0828C87.4298 15.4641 87.1318 14.2248 86.5183 13.3746C85.9048 12.5244 85.0082 12.1175 83.8304 12.1175C82.5704 12.1175 81.641 12.542 81.0113 13.4079C80.3816 14.2739 80.0823 15.5472 80.0823 17.2774V26.6679H75.7192V2.87449H80.0823V10.0926C80.7055 9.4861 81.4446 9.009 82.2562 8.68923C83.0678 8.36945 83.9357 8.21344 84.8089 8.23032C86.9489 8.23032 88.6404 8.94901 89.901 10.3701C91.1616 11.7911 91.7933 13.7184 91.7933 16.1514V26.6679H89.6194ZM63.9928 26.6679V2.89068H68.3045V8.9817H72.9991V12.7215H68.3045V26.6679H63.9928ZM2.24 26.6679H0V2.87449H5.50667C9.83484 2.87449 13.2349 3.9142 15.7069 5.99361C18.1785 8.06747 19.4172 10.9199 19.4231 14.5509C19.4231 18.324 18.2346 21.2851 15.8575 23.434C13.4681 25.5909 10.1946 26.6689 6.03711 26.6679H2.24ZM4.4618 22.5689H6.02109C8.85765 22.5689 11.0455 21.8823 12.6058 20.5267C14.1486 19.1724 14.9284 17.2445 14.9284 14.7632C14.9284 12.2642 14.1148 10.3526 12.4731 8.98123C10.831 7.62694 8.50889 6.94077 5.50667 6.94077H4.46102L4.4618 22.5689ZM61.4119 20.8876C61.4154 20.8761 61.4188 20.8654 61.4225 20.8539V20.8876H61.4119ZM136.495 13.6683V6.15718H128.864V2.72681H139.811V13.6688L136.495 13.6683Z" fill="#00A0C0"/>
3
+ </svg>
@@ -1,5 +1,3 @@
1
- export { ConflictPage, type ConflictPageProps } from './conflict';
2
- export { ForeignEmailCollectPage, type ForeignEmailCollectPageProps, } from './foreign-email-collect';
3
1
  export { LoginEntry, type LoginEntryMode, type LoginEntryProps, } from './login-entry';
4
2
  export { MainLogin, type MainLoginProps } from './main-login';
5
3
  export { OtpVerification, type OtpVerificationMode, type OtpVerificationProps, } from './otp-verification';
@@ -3,18 +3,14 @@ export interface MainLoginProps {
3
3
  onContinueWithMobile?: () => void;
4
4
  /** Handler for "Continue with Email". */
5
5
  onContinueWithEmail?: () => void;
6
- /** Handler for "Continue with Google" (used when Google button is not rendered). */
6
+ /** Handler for "Continue with Google" (custom button; parent wires useGoogleAuth.loginWithGoogle when configured). */
7
7
  onContinueWithGoogle?: () => void;
8
8
  /** Handler for "Continue with Apple". */
9
9
  onContinueWithApple?: () => void;
10
- /** When set with onGoogleCredential, renders the official Google Sign-In button that opens the popup. */
11
- googleClientId?: string;
12
- /** Callback when Google credential is received; used with googleClientId. */
13
- onGoogleCredential?: (credential: string) => void;
14
10
  }
15
11
  /**
16
12
  * Main login page body: four sign-in options (Mobile, Email, Google, Apple).
17
13
  * Intended to be slotted into AuthLayout.Body. Layout shell (AuthLayout with
18
14
  * Logo, Title, Description) is provided by the app or story.
19
15
  */
20
- export declare function MainLogin({ onContinueWithMobile, onContinueWithEmail, onContinueWithGoogle, onContinueWithApple, googleClientId, onGoogleCredential, }: Readonly<MainLoginProps>): import("react/jsx-runtime").JSX.Element;
16
+ export declare function MainLogin({ onContinueWithMobile, onContinueWithEmail, onContinueWithGoogle, onContinueWithApple, }: Readonly<MainLoginProps>): import("react/jsx-runtime").JSX.Element;
@@ -7,6 +7,8 @@ export interface OtpVerificationProps {
7
7
  title?: string;
8
8
  /** Masked phone (e.g. "+91 9825910X0X") or email (e.g. "j***@gmail.com") */
9
9
  recipientDisplay: string;
10
+ /** When true, show instruction line ("Kindly check your Email Inbox."). Used for foreign user flow. */
11
+ isForeignUser?: boolean;
10
12
  /** Handler when back is clicked */
11
13
  onBack?: () => void;
12
14
  /** Handler when form is submitted with valid 6-digit OTP */
@@ -18,4 +20,4 @@ export interface OtpVerificationProps {
18
20
  * OTP verification screen: 6-digit OTP input, resend countdown, and submit.
19
21
  * Slot into AuthLayout.Body; layout shell is provided by the consumer.
20
22
  */
21
- export declare function OtpVerification({ mode, title, recipientDisplay, onSubmit, onResendCode, }: Readonly<OtpVerificationProps>): import("react/jsx-runtime").JSX.Element;
23
+ export declare function OtpVerification({ mode, title, recipientDisplay, isForeignUser, onSubmit, onResendCode, }: Readonly<OtpVerificationProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,17 @@
1
+ import type { UserType } from '@/core/auth-types';
2
+ import type { IdentifierType } from '@/core/use-auth-flow';
1
3
  import type { SignupEntryMode } from '@/hooks/use-signup-form';
2
4
  export type { SignupEntryMode };
3
5
  export interface SignupPageProps {
4
- /** Mode: phone number or email as second field (after full name) */
5
- mode: SignupEntryMode;
6
- /** Handler when form is submitted with valid fullName and phone or email */
6
+ /** Indian: which field to collect. Foreign: use 'foreign' mode (name + email + phone). */
7
+ userType: UserType;
8
+ /** How user started (phone or email). */
9
+ loginMethod: IdentifierType;
10
+ /** Indian only: which field to collect (phone or email). */
11
+ signupCollectField: IdentifierType;
12
+ /** Foreign only: phone when user entered phone before signup details. */
13
+ pendingPhone?: string;
14
+ /** Handler when form is submitted. */
7
15
  onSubmit?: (data: {
8
16
  fullName: string;
9
17
  phone?: string;
@@ -11,7 +19,7 @@ export interface SignupPageProps {
11
19
  }) => void;
12
20
  }
13
21
  /**
14
- * Signup screen: full name plus phone or email form with Continue button.
15
- * Slot into AuthLayout.Body; layout shell is provided by the consumer.
22
+ * Signup screen: full name plus phone/email (Indian) or full name + email + phone (Foreign).
23
+ * Always uses standalone layout when used in auth flow.
16
24
  */
17
- export declare function SignupPage({ mode, onSubmit }: Readonly<SignupPageProps>): import("react/jsx-runtime").JSX.Element;
25
+ export declare function SignupPage({ userType, signupCollectField, pendingPhone, onSubmit, }: Readonly<SignupPageProps>): import("react/jsx-runtime").JSX.Element;
package/dist/pages.js CHANGED
@@ -1,10 +1,8 @@
1
- import { C as e, F as n, L as o, M as g, O as s, R as t, S as r } from "./signup-CHqsrPuW.js";
1
+ import { L as n, M as o, O as e, R as g, S as s } from "./signup-x-Jm7XKn.js";
2
2
  export {
3
- e as ConflictPage,
4
- n as ForeignEmailCollectPage,
5
- o as LoginEntry,
6
- g as MainLogin,
7
- s as OtpVerification,
8
- t as RepeatLogin,
9
- r as SignupPage
3
+ n as LoginEntry,
4
+ o as MainLogin,
5
+ e as OtpVerification,
6
+ g as RepeatLogin,
7
+ s as SignupPage
10
8
  };