@namoidhq/react 0.1.0
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/LICENSE +21 -0
- package/README.md +27 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +159 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PolyMindsLabs Pvt. Ltd.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @namoidhq/react
|
|
2
|
+
|
|
3
|
+
React SDK for **NamoID** — enterprise identity for India (OAuth 2.1 / OpenID Connect). Wrap your app in a provider, then use the hooks and components for hosted sign-in, sign-up, and waitlist flows.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i @namoidhq/react @namoidhq/js
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { NamoIDProvider, useNamoID } from "@namoidhq/react";
|
|
11
|
+
|
|
12
|
+
export function App() {
|
|
13
|
+
return (
|
|
14
|
+
<NamoIDProvider publishableKey="pk_live_...">
|
|
15
|
+
<YourApp />
|
|
16
|
+
</NamoIDProvider>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Built on [`@namoidhq/js`](https://www.npmjs.com/package/@namoidhq/js).
|
|
22
|
+
|
|
23
|
+
Docs: <https://namoid.in> · Early access: hello@namoid.in
|
|
24
|
+
|
|
25
|
+
## License
|
|
26
|
+
|
|
27
|
+
MIT © PolyMindsLabs Pvt. Ltd.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type HostedLoginMode, type HostedLoginUrlOptions, type NamoIDAuthConfig, type NamoIDClient, type NamoIDClientOptions } from "@namoidhq/js";
|
|
2
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
3
|
+
export type NamoIDProviderProps = NamoIDClientOptions & {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare function NamoIDProvider({ children, publishableKey, apiBaseUrl, hostedLoginBaseUrl, fetcher, }: NamoIDProviderProps): import("react").JSX.Element;
|
|
7
|
+
export declare function useNamoID(): NamoIDClient;
|
|
8
|
+
export type UseAuthConfigState = {
|
|
9
|
+
config: NamoIDAuthConfig | null;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
error: Error | null;
|
|
12
|
+
reload: () => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export declare function useAuthConfig(): UseAuthConfigState;
|
|
15
|
+
export type HostedLoginButtonProps = Omit<HostedLoginUrlOptions, "mode"> & {
|
|
16
|
+
mode?: HostedLoginMode;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare function HostedLoginButton({ mode, children, className, style, disabled, ...options }: HostedLoginButtonProps): import("react").JSX.Element;
|
|
23
|
+
export type AuthFlowProps = {
|
|
24
|
+
clientId: string;
|
|
25
|
+
redirectUri: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
buttonLabel?: string;
|
|
30
|
+
loadingLabel?: string;
|
|
31
|
+
unavailableLabel?: string;
|
|
32
|
+
scope?: string | string[];
|
|
33
|
+
state?: string;
|
|
34
|
+
nonce?: string;
|
|
35
|
+
codeChallenge?: string;
|
|
36
|
+
codeChallengeMethod?: "S256" | "plain";
|
|
37
|
+
};
|
|
38
|
+
export declare function SignIn(props: AuthFlowProps): import("react").JSX.Element;
|
|
39
|
+
export declare function SignUp(props: AuthFlowProps): import("react").JSX.Element;
|
|
40
|
+
export type WaitlistProps = Omit<AuthFlowProps, "buttonLabel"> & {
|
|
41
|
+
buttonLabel?: string;
|
|
42
|
+
onSubmitEmail?: (email: string, config: NamoIDAuthConfig | null) => Promise<void> | void;
|
|
43
|
+
};
|
|
44
|
+
export declare function Waitlist({ onSubmitEmail, buttonLabel, title, description, ...props }: WaitlistProps): import("react").JSX.Element;
|
|
45
|
+
export declare function AuthCard(props: AuthFlowProps & {
|
|
46
|
+
mode?: HostedLoginMode;
|
|
47
|
+
}): import("react").JSX.Element;
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,q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IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACxC,CAAC;AAEF,wBAAgB,MAAM,CAAC,KAAK,EAAE,aAAa,+BAW1C;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,aAAa,+BAY1C;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC1F,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EACvB,aAAa,EACb,WAA6B,EAC7B,KAA2B,EAC3B,WAA0F,EAC1F,GAAG,KAAK,EACT,EAAE,aAAa,+BA2Cf;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,+BAIzE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createNamoIDClient, } from "@namoidhq/js";
|
|
4
|
+
import { createContext, useContext, useEffect, useMemo, useState, } from "react";
|
|
5
|
+
const NamoIDContext = createContext(null);
|
|
6
|
+
export function NamoIDProvider({ children, publishableKey, apiBaseUrl, hostedLoginBaseUrl, fetcher, }) {
|
|
7
|
+
const client = useMemo(() => createNamoIDClient({ publishableKey, apiBaseUrl, hostedLoginBaseUrl, fetcher }), [publishableKey, apiBaseUrl, hostedLoginBaseUrl, fetcher]);
|
|
8
|
+
return _jsx(NamoIDContext.Provider, { value: client, children: children });
|
|
9
|
+
}
|
|
10
|
+
export function useNamoID() {
|
|
11
|
+
const client = useContext(NamoIDContext);
|
|
12
|
+
if (!client) {
|
|
13
|
+
throw new Error("useNamoID must be used inside <NamoIDProvider>");
|
|
14
|
+
}
|
|
15
|
+
return client;
|
|
16
|
+
}
|
|
17
|
+
export function useAuthConfig() {
|
|
18
|
+
const client = useNamoID();
|
|
19
|
+
const [config, setConfig] = useState(null);
|
|
20
|
+
const [loading, setLoading] = useState(true);
|
|
21
|
+
const [error, setError] = useState(null);
|
|
22
|
+
const reload = useMemo(() => async () => {
|
|
23
|
+
setLoading(true);
|
|
24
|
+
setError(null);
|
|
25
|
+
try {
|
|
26
|
+
setConfig(await client.auth.getConfig());
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
setError(err instanceof Error ? err : new Error("Failed to load NamoID config"));
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
setLoading(false);
|
|
33
|
+
}
|
|
34
|
+
}, [client]);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
void reload();
|
|
37
|
+
}, [reload]);
|
|
38
|
+
return { config, loading, error, reload };
|
|
39
|
+
}
|
|
40
|
+
export function HostedLoginButton({ mode = "signin", children, className, style, disabled, ...options }) {
|
|
41
|
+
const client = useNamoID();
|
|
42
|
+
const ready = Boolean(options.clientId && options.redirectUri);
|
|
43
|
+
return (_jsx("button", { type: "button", className: className, style: { ...styles.button, ...style }, disabled: disabled || !ready, onClick: () => client.hostedLogin.redirect({ ...options, mode }), children: children ?? labelForMode(mode) }));
|
|
44
|
+
}
|
|
45
|
+
export function SignIn(props) {
|
|
46
|
+
return (_jsx(AuthPanel, { ...props, mode: "signin", title: props.title ?? "Sign in", description: props.description ?? "Continue with the sign-in methods enabled for this app.", buttonLabel: props.buttonLabel ?? "Sign in with NamoID", enabled: (config) => config.signin_methods.length > 0 }));
|
|
47
|
+
}
|
|
48
|
+
export function SignUp(props) {
|
|
49
|
+
return (_jsx(AuthPanel, { ...props, mode: "signup", title: props.title ?? "Create account", description: props.description ?? "Start the hosted signup flow for this app.", buttonLabel: props.buttonLabel ?? "Sign up with NamoID", unavailableLabel: props.unavailableLabel ?? "Signups are currently paused.", enabled: (config) => config.access_mode !== "closed" }));
|
|
50
|
+
}
|
|
51
|
+
export function Waitlist({ onSubmitEmail, buttonLabel = "Join waitlist", title = "Join the waitlist", description = "Leave your email and we will route you through the configured access flow.", ...props }) {
|
|
52
|
+
const { config, loading, error } = useAuthConfig();
|
|
53
|
+
const [email, setEmail] = useState("");
|
|
54
|
+
const [submitted, setSubmitted] = useState(false);
|
|
55
|
+
const canSubmitLocally = Boolean(onSubmitEmail);
|
|
56
|
+
const submit = async (event) => {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
if (onSubmitEmail) {
|
|
59
|
+
await onSubmitEmail(email, config);
|
|
60
|
+
setSubmitted(true);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return (_jsxs("section", { className: props.className, style: styles.card, children: [_jsx(PanelHeader, { title: title, description: description }), _jsx(StatusLine, { config: config, loading: loading, error: error }), submitted ? (_jsx("p", { style: styles.success, children: "You are on the list." })) : (_jsxs("form", { onSubmit: submit, style: styles.form, children: [_jsx("input", { type: "email", value: email, onChange: (event) => setEmail(event.target.value), placeholder: "you@example.com", required: true, style: styles.input }), canSubmitLocally ? (_jsx("button", { type: "submit", style: styles.button, children: buttonLabel })) : (_jsx(HostedLoginButton, { ...props, mode: "waitlist", children: buttonLabel }))] }))] }));
|
|
64
|
+
}
|
|
65
|
+
export function AuthCard(props) {
|
|
66
|
+
if (props.mode === "signup")
|
|
67
|
+
return _jsx(SignUp, { ...props });
|
|
68
|
+
if (props.mode === "waitlist")
|
|
69
|
+
return _jsx(Waitlist, { ...props });
|
|
70
|
+
return _jsx(SignIn, { ...props });
|
|
71
|
+
}
|
|
72
|
+
function AuthPanel({ mode, title, description, buttonLabel, loadingLabel = "Loading auth configuration...", unavailableLabel = "This flow is not enabled right now.", enabled, className, ...buttonOptions }) {
|
|
73
|
+
const { config, loading, error } = useAuthConfig();
|
|
74
|
+
const isEnabled = config ? enabled(config) : false;
|
|
75
|
+
return (_jsxs("section", { className: className, style: styles.card, children: [_jsx(PanelHeader, { title: title, description: description }), _jsx(StatusLine, { config: config, loading: loading, error: error, loadingLabel: loadingLabel }), _jsx(HostedLoginButton, { ...buttonOptions, mode: mode, disabled: loading || Boolean(error) || !isEnabled, children: isEnabled ? buttonLabel : unavailableLabel })] }));
|
|
76
|
+
}
|
|
77
|
+
function PanelHeader({ title, description }) {
|
|
78
|
+
return (_jsxs("div", { style: styles.header, children: [_jsx("h2", { style: styles.title, children: title }), _jsx("p", { style: styles.description, children: description })] }));
|
|
79
|
+
}
|
|
80
|
+
function StatusLine({ config, loading, error, loadingLabel = "Loading auth configuration...", }) {
|
|
81
|
+
if (loading)
|
|
82
|
+
return _jsx("p", { style: styles.meta, children: loadingLabel });
|
|
83
|
+
if (error)
|
|
84
|
+
return _jsx("p", { style: styles.error, children: error.message });
|
|
85
|
+
if (!config)
|
|
86
|
+
return null;
|
|
87
|
+
return (_jsxs("p", { style: styles.meta, children: [config.access_mode, " access \u00B7 ", config.signin_methods.length, " sign-in method", config.signin_methods.length === 1 ? "" : "s"] }));
|
|
88
|
+
}
|
|
89
|
+
function labelForMode(mode) {
|
|
90
|
+
if (mode === "signup")
|
|
91
|
+
return "Sign up with NamoID";
|
|
92
|
+
if (mode === "waitlist")
|
|
93
|
+
return "Join waitlist";
|
|
94
|
+
return "Sign in with NamoID";
|
|
95
|
+
}
|
|
96
|
+
const styles = {
|
|
97
|
+
card: {
|
|
98
|
+
border: "1px solid #deded8",
|
|
99
|
+
borderRadius: 8,
|
|
100
|
+
padding: 18,
|
|
101
|
+
background: "#ffffff",
|
|
102
|
+
color: "#111111",
|
|
103
|
+
display: "grid",
|
|
104
|
+
gap: 14,
|
|
105
|
+
},
|
|
106
|
+
header: {
|
|
107
|
+
display: "grid",
|
|
108
|
+
gap: 4,
|
|
109
|
+
},
|
|
110
|
+
title: {
|
|
111
|
+
margin: 0,
|
|
112
|
+
fontSize: 18,
|
|
113
|
+
lineHeight: 1.2,
|
|
114
|
+
fontWeight: 650,
|
|
115
|
+
},
|
|
116
|
+
description: {
|
|
117
|
+
margin: 0,
|
|
118
|
+
color: "#62645f",
|
|
119
|
+
fontSize: 14,
|
|
120
|
+
lineHeight: 1.45,
|
|
121
|
+
},
|
|
122
|
+
meta: {
|
|
123
|
+
margin: 0,
|
|
124
|
+
color: "#73756f",
|
|
125
|
+
fontSize: 12,
|
|
126
|
+
},
|
|
127
|
+
error: {
|
|
128
|
+
margin: 0,
|
|
129
|
+
color: "#9f1d1d",
|
|
130
|
+
fontSize: 12,
|
|
131
|
+
},
|
|
132
|
+
success: {
|
|
133
|
+
margin: 0,
|
|
134
|
+
color: "#17633e",
|
|
135
|
+
fontSize: 14,
|
|
136
|
+
},
|
|
137
|
+
form: {
|
|
138
|
+
display: "grid",
|
|
139
|
+
gap: 10,
|
|
140
|
+
},
|
|
141
|
+
input: {
|
|
142
|
+
border: "1px solid #c9cac2",
|
|
143
|
+
borderRadius: 7,
|
|
144
|
+
padding: "10px 12px",
|
|
145
|
+
fontSize: 14,
|
|
146
|
+
},
|
|
147
|
+
button: {
|
|
148
|
+
border: 0,
|
|
149
|
+
borderRadius: 7,
|
|
150
|
+
background: "#111111",
|
|
151
|
+
color: "#ffffff",
|
|
152
|
+
cursor: "pointer",
|
|
153
|
+
fontSize: 14,
|
|
154
|
+
fontWeight: 650,
|
|
155
|
+
minHeight: 42,
|
|
156
|
+
padding: "0 16px",
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
//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;QACf,GAAG,EAAE,CAAC;KACP;IACD,KAAK,EAAE;QACL,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,GAAG;KAChB;IACD,WAAW,EAAE;QACX,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,IAAI;KACjB;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;KACb;IACD,OAAO,EAAE;QACP,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;KACb;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM;QACf,GAAG,EAAE,EAAE;KACR;IACD,KAAK,EAAE;QACL,MAAM,EAAE,mBAAmB;QAC3B,YAAY,EAAE,CAAC;QACf,OAAO,EAAE,WAAW;QACpB,QAAQ,EAAE,EAAE;KACb;IACD,MAAM,EAAE;QACN,MAAM,EAAE,CAAC;QACT,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,SAAS;QACrB,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,GAAG;QACf,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,QAAQ;KAClB;CACF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@namoidhq/react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React SDK for NamoID, enterprise identity for India (OAuth 2.1 / OIDC): provider, hooks, and hosted sign-in, sign-up, and waitlist components.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"namoid",
|
|
7
|
+
"authentication",
|
|
8
|
+
"auth",
|
|
9
|
+
"oauth",
|
|
10
|
+
"oidc",
|
|
11
|
+
"openid-connect",
|
|
12
|
+
"identity",
|
|
13
|
+
"sso",
|
|
14
|
+
"passkeys",
|
|
15
|
+
"mfa",
|
|
16
|
+
"india",
|
|
17
|
+
"dpdp",
|
|
18
|
+
"digilocker",
|
|
19
|
+
"aadhaar",
|
|
20
|
+
"react"
|
|
21
|
+
],
|
|
22
|
+
"homepage": "https://namoid.in",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/namoidhq/namoid-js/issues",
|
|
25
|
+
"email": "hello@namoid.in"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/namoidhq/namoid-js.git",
|
|
30
|
+
"directory": "packages/react"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"author": "PolyMindsLabs Pvt. Ltd. <hello@namoid.in> (https://namoid.in)",
|
|
34
|
+
"type": "module",
|
|
35
|
+
"main": "./dist/index.js",
|
|
36
|
+
"module": "./dist/index.js",
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"import": "./dist/index.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"README.md",
|
|
47
|
+
"LICENSE"
|
|
48
|
+
],
|
|
49
|
+
"sideEffects": false,
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@namoidhq/js": "^0.1.0"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": ">=18",
|
|
58
|
+
"react-dom": ">=18"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@types/react": "^19.2.15",
|
|
62
|
+
"typescript": "^6.0.3"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"build": "tsc -p tsconfig.json",
|
|
66
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
67
|
+
}
|
|
68
|
+
}
|