doct-ui-auth-kit 1.0.5 → 1.0.6
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 +11 -0
- package/dist/hooks/use-login-entry-form.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/pages/login-entry.d.ts +2 -2
- package/dist/pages/signup.d.ts +0 -41
- package/dist/pages.js +6 -5
- package/dist/signup-DeeuWsoF.js +1718 -0
- package/dist/types/login-form.d.ts +14 -4
- package/dist/types/otp-verification.d.ts +2 -0
- package/dist/types/pages.d.ts +5 -2
- package/dist/validations/schemas.d.ts +4 -3
- package/package.json +3 -3
- package/dist/signup-BJWKwg7j.js +0 -1723
package/README.md
CHANGED
|
@@ -29,6 +29,17 @@ import 'docthub-core-components/style.css';
|
|
|
29
29
|
import 'doct-ui-auth-kit/style.css';
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
## Required static assets
|
|
33
|
+
|
|
34
|
+
When using **`MainLoginPage`** or **`AuthLayoutWrapper`** with `layoutType="withSlider"`, the kit references static paths that are served from **your app’s** `public/` folder. The published npm package does not include these files, so you must add them yourself.
|
|
35
|
+
|
|
36
|
+
| Asset | Path in your app | Used for |
|
|
37
|
+
|-------|------------------|----------|
|
|
38
|
+
| Logo | `public/main-logo.svg` | Main login page logo (or pass a custom `logo` prop to `AuthLayoutWrapper`) |
|
|
39
|
+
| Slider images | `public/slider/slide-1.png` … `public/slider/slide-5.png` | Marketing slider on the left panel (or pass custom `sliderImages` to `AuthLayoutWrapper`) |
|
|
40
|
+
|
|
41
|
+
**To get the default assets:** copy from this repo’s `public/main-logo.svg` and `public/slider/*.png` into your app’s `public/` (and `public/slider/`) if you have the kit source. Otherwise use your own logo and slider images. You can also override at runtime by passing the `logo` and `sliderImages` props to `AuthLayoutWrapper` (or equivalent) where the API supports it.
|
|
42
|
+
|
|
32
43
|
## Consumer imports
|
|
33
44
|
|
|
34
45
|
Install the package and import components, layouts, and types from the library:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UseLoginEntryFormOptions, UseLoginEntryFormReturn } from '@/types';
|
|
2
|
-
export type { EmailFormValues, LoginEntryFormValues, LoginEntryMode, LoginEntrySubmitData, PhoneFormValues, UseLoginEntryFormOptions, UseLoginEntryFormReturn, } from '@/types';
|
|
2
|
+
export type { EmailFormValues, LoginEntryFormValues, LoginEntryMode, LoginEntrySubmitData, LoginEntrySuccessParams, PhoneFormValues, UseLoginEntryFormOptions, UseLoginEntryFormReturn, } from '@/types';
|
|
3
3
|
/**
|
|
4
4
|
* Form state and validation for the login entry screen (phone or email).
|
|
5
5
|
* Business logic: when submitApi is provided, hook runs validate → submitApi(data) → onSuccess() (e.g. redirect).
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as G, Fragment as Kt } from "react/jsx-runtime";
|
|
2
|
-
import { f as le, A as Zr, g as Xr, u as Jr, d as zr, e as Qr, c as ei, a as Yt, b as ti, O as ni, S as ri } from "./signup-
|
|
3
|
-
import { D as a1, I as o1, L as d1, h as u1, M as l1, i as s1, j as c1, k as f1, R as $1, l as p1, m as y1, n as h1, o as m1, p as g1, q as v1 } from "./signup-
|
|
3
|
+
import { f as le, A as Zr, g as Xr, u as Jr, d as zr, e as Qr, c as ei, a as Yt, b as ti, O as ni, S as ri } from "./signup-DeeuWsoF.js";
|
|
4
|
+
import { D as a1, I as o1, L as d1, h as u1, M as l1, i as s1, j as c1, k as f1, R as $1, l as p1, m as y1, n as h1, o as m1, p as g1, q as v1 } from "./signup-DeeuWsoF.js";
|
|
4
5
|
import N, { createContext as ii, useContext as tr, useRef as nr, useCallback as ae, useMemo as We, useReducer as ai, useEffect as oi } from "react";
|
|
5
6
|
import { DoctCircularProgress as di } from "docthub-core-components";
|
|
6
7
|
function Ft(e) {
|
|
@@ -4,13 +4,13 @@ export type { LoginEntryMode, LoginEntryPageProps, LoginEntryProps, } from '@/ty
|
|
|
4
4
|
* Full LoginEntry page with AuthLayoutWrapper, back button, and slider/standalone layout.
|
|
5
5
|
* Use when rendering the login entry screen as a standalone page.
|
|
6
6
|
*
|
|
7
|
-
* @example Next.js: API call in hook, redirect
|
|
7
|
+
* @example Next.js: API call in hook, redirect with mode + recipient for OTP page
|
|
8
8
|
* ```tsx
|
|
9
9
|
* <LoginEntryPage
|
|
10
10
|
* mode="phone"
|
|
11
11
|
* onBack={() => router.back()}
|
|
12
12
|
* submitApi={(data) => api.sendOtp(data)}
|
|
13
|
-
* onSuccess={() => router.push(
|
|
13
|
+
* onSuccess={(params) => router.push(`/otp?mode=${params.mode}&recipient=${encodeURIComponent(params.recipient)}`)}
|
|
14
14
|
* />
|
|
15
15
|
* ```
|
|
16
16
|
*
|
package/dist/pages/signup.d.ts
CHANGED
|
@@ -1,45 +1,4 @@
|
|
|
1
1
|
import type { SignupPageFullProps, SignupPageProps } from '@/types';
|
|
2
2
|
export type { SignupEntryMode, SignupPageFullProps, SignupPageProps, } from '@/types';
|
|
3
|
-
/**
|
|
4
|
-
* Full Signup page with AuthLayoutWrapper, logo, and default welcome copy.
|
|
5
|
-
* Use when rendering the signup screen as a standalone page.
|
|
6
|
-
*
|
|
7
|
-
* @example Next.js: API in hook, redirect from consumer
|
|
8
|
-
* ```tsx
|
|
9
|
-
* <SignupPage
|
|
10
|
-
* userType="INDIAN"
|
|
11
|
-
* loginMethod="phone"
|
|
12
|
-
* signupCollectField="email"
|
|
13
|
-
* submitApi={(data) => api.completeProfile(data)}
|
|
14
|
-
* onSuccess={() => router.push('/otp')}
|
|
15
|
-
* />
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @example Sync onSubmit (AuthFlow)
|
|
19
|
-
* ```tsx
|
|
20
|
-
* <SignupPage onSubmit={(data) => actions.submitSignupDetails(data)} ... />
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
3
|
export declare function SignupPage(props: Readonly<SignupPageFullProps>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
/**
|
|
25
|
-
* Signup form body without layout wrapper.
|
|
26
|
-
* Full name plus phone/email (Indian) or full name + email + phone (Foreign).
|
|
27
|
-
* Validation per PRODUCT_PROTOCOLS #1, #25 and edge cases 9, 10, 16, 19; cursor focus on first field (#26).
|
|
28
|
-
* Use inside your own layout or AuthFlow.
|
|
29
|
-
*
|
|
30
|
-
* @example With submitApi + onSuccess (consumer redirect)
|
|
31
|
-
* ```tsx
|
|
32
|
-
* <Signup
|
|
33
|
-
* userType="INDIAN"
|
|
34
|
-
* signupCollectField="email"
|
|
35
|
-
* submitApi={(data) => api.completeProfile(data)}
|
|
36
|
-
* onSuccess={() => router.push('/otp')}
|
|
37
|
-
* />
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @example Sync onSubmit (AuthFlow)
|
|
41
|
-
* ```tsx
|
|
42
|
-
* <Signup onSubmit={(data) => actions.submitSignupDetails(data)} ... />
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
4
|
export declare function Signup(props: Readonly<SignupPageProps>): import("react/jsx-runtime").JSX.Element;
|
package/dist/pages.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { L as e, a as n, M as g, b as s, O as o, c as t, R as p, d as L, S as r, e as P } from "./signup-DeeuWsoF.js";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
e as LoginEntry,
|
|
5
|
+
n as LoginEntryPage,
|
|
5
6
|
g as MainLogin,
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
s as MainLoginPage,
|
|
8
|
+
o as OtpVerification,
|
|
8
9
|
t as OtpVerificationPage,
|
|
9
10
|
p as RepeatLogin,
|
|
10
11
|
L as RepeatLoginPage,
|