signer-test-sdk-react 0.0.14 → 0.0.15
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/src/AbstraxnProvider.js +1 -2
- package/dist/src/AbstraxnProvider.js.map +1 -1
- package/dist/src/OnboardingUI.d.ts +1 -1
- package/dist/src/OnboardingUI.js +1 -1
- package/dist/src/components/OnboardingUI/OnboardingUI.css +227 -75
- package/dist/src/components/OnboardingUI/OnboardingUIReact.d.ts +3 -3
- package/dist/src/components/OnboardingUI/OnboardingUIReact.js +109 -55
- package/dist/src/components/OnboardingUI/OnboardingUIReact.js.map +1 -1
- package/dist/src/components/OnboardingUI/OnboardingUIWeb.d.ts +1 -2
- package/dist/src/components/OnboardingUI/OnboardingUIWeb.js +953 -861
- package/dist/src/components/OnboardingUI/OnboardingUIWeb.js.map +1 -1
- package/dist/src/components/OnboardingUI/components/EmailForm.d.ts +3 -3
- package/dist/src/components/OnboardingUI/components/EmailForm.js +13 -5
- package/dist/src/components/OnboardingUI/components/EmailForm.js.map +1 -1
- package/dist/src/components/OnboardingUI/components/Modal.d.ts +0 -1
- package/dist/src/components/OnboardingUI/components/Modal.js +4 -11
- package/dist/src/components/OnboardingUI/components/Modal.js.map +1 -1
- package/dist/src/components/OnboardingUI/components/OtpForm.d.ts +4 -3
- package/dist/src/components/OnboardingUI/components/OtpForm.js +19 -22
- package/dist/src/components/OnboardingUI/components/OtpForm.js.map +1 -1
- package/dist/src/types.d.ts +11 -16
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -2
|
@@ -3,24 +3,27 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
* OtpForm Component
|
|
4
4
|
* OTP input form for verification
|
|
5
5
|
*/
|
|
6
|
-
import { useRef, useEffect } from
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { useRef, useEffect } from "react";
|
|
7
|
+
import { TfiEmail } from "react-icons/tfi";
|
|
8
|
+
import "../OnboardingUI.css";
|
|
9
|
+
export const OtpForm = ({ email, otp, onChange, onSubmit, onResend, onBack, loading = false, error = null, resendCooldown = 0, config, }) => {
|
|
10
|
+
const theme = config?.theme || "light";
|
|
10
11
|
const labels = config?.labels || {};
|
|
11
12
|
const otpInputsRef = useRef([]);
|
|
12
13
|
// Split OTP into individual digits - ensure we always have 6 digits for rendering
|
|
13
|
-
const otpDigits = (otp ||
|
|
14
|
+
const otpDigits = (otp || "").split("").slice(0, 6);
|
|
14
15
|
// Pad to 6 digits with empty strings to ensure we always render 6 inputs
|
|
15
16
|
while (otpDigits.length < 6) {
|
|
16
|
-
otpDigits.push(
|
|
17
|
+
otpDigits.push("");
|
|
17
18
|
}
|
|
18
19
|
const handleOtpChange = (index, value) => {
|
|
19
20
|
// Only allow digits
|
|
20
21
|
if (value && !/^\d$/.test(value))
|
|
21
22
|
return;
|
|
22
|
-
const newOtp = otpDigits
|
|
23
|
-
|
|
23
|
+
const newOtp = otpDigits
|
|
24
|
+
.map((digit, i) => (i === index ? value : digit))
|
|
25
|
+
.join("");
|
|
26
|
+
onChange(newOtp.replace(/\s/g, ""));
|
|
24
27
|
// Auto-focus next input
|
|
25
28
|
if (value && index < 5) {
|
|
26
29
|
otpInputsRef.current[index + 1]?.focus();
|
|
@@ -28,14 +31,14 @@ export const OtpForm = ({ email, otp, onChange, onSubmit, onResend, loading = fa
|
|
|
28
31
|
};
|
|
29
32
|
const handleKeyDown = (index, e) => {
|
|
30
33
|
// Handle backspace
|
|
31
|
-
if (e.key ===
|
|
34
|
+
if (e.key === "Backspace" && !otpDigits[index] && index > 0) {
|
|
32
35
|
otpInputsRef.current[index - 1]?.focus();
|
|
33
36
|
}
|
|
34
37
|
// Handle paste
|
|
35
|
-
if (e.key ===
|
|
38
|
+
if (e.key === "v" && (e.ctrlKey || e.metaKey)) {
|
|
36
39
|
e.preventDefault();
|
|
37
40
|
navigator.clipboard.readText().then((text) => {
|
|
38
|
-
const digits = text.replace(/\D/g,
|
|
41
|
+
const digits = text.replace(/\D/g, "").slice(0, 6);
|
|
39
42
|
onChange(digits);
|
|
40
43
|
if (digits.length === 6) {
|
|
41
44
|
otpInputsRef.current[5]?.focus();
|
|
@@ -55,21 +58,15 @@ export const OtpForm = ({ email, otp, onChange, onSubmit, onResend, loading = fa
|
|
|
55
58
|
onSubmit();
|
|
56
59
|
}
|
|
57
60
|
}, [otp, loading, error, onSubmit]);
|
|
58
|
-
return (_jsxs("div", { className: "onboarding-otp-verification", children: [_jsx("
|
|
61
|
+
return (_jsxs("div", { className: "onboarding-otp-verification", children: [onBack && (_jsx("button", { type: "button", className: "onboarding-otp-back-button", onClick: onBack, "aria-label": "Go back to email input", disabled: loading, children: _jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) }) })), _jsx("div", { className: "onboarding-otp-icon-container", children: _jsx("div", { className: "onboarding-otp-icon-inner", children: _jsx(TfiEmail, { className: "onboarding-otp-icon", size: 28 }) }) }), _jsx("h1", { className: "onboarding-otp-title", children: labels.otpLabel || "Enter verification code" }), _jsx("p", { className: "onboarding-otp-instruction", children: "We sent a 6-digit code to" }), _jsx("p", { className: "onboarding-otp-email", children: email }), error && (_jsx("div", { className: "onboarding-error", role: "alert", children: error.startsWith("{") && error.endsWith("}")
|
|
62
|
+
? error
|
|
63
|
+
: `{ ${error} }` })), _jsxs("form", { onSubmit: handleSubmit, className: "onboarding-form", children: [_jsx("div", { className: "onboarding-otp-inputs-container", children: otpDigits.map((digit, index) => (_jsx("input", { ref: (el) => {
|
|
59
64
|
otpInputsRef.current[index] = el;
|
|
60
|
-
}, type: "text", inputMode: "numeric", pattern: "[0-9]*", maxLength: 1, className: "onboarding-otp-input", value: digit, onChange: (e) => handleOtpChange(index, e.target.value), onKeyDown: (e) => handleKeyDown(index, e), disabled: loading, autoFocus: index === 0, "aria-label": `OTP digit ${index + 1}
|
|
61
|
-
width: '44px',
|
|
62
|
-
height: '52px',
|
|
63
|
-
minWidth: '44px',
|
|
64
|
-
minHeight: '52px',
|
|
65
|
-
display: 'inline-block',
|
|
66
|
-
visibility: 'visible',
|
|
67
|
-
opacity: 1,
|
|
68
|
-
} }, `otp-input-${index}`))) }), _jsx("button", { type: "submit", className: "onboarding-button onboarding-button-primary", disabled: loading || otp.length !== 6, children: loading ? (_jsxs(_Fragment, { children: [_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { animation: 'spin 1s linear infinite' }, children: [_jsx("line", { x1: "12", y1: "2", x2: "12", y2: "6" }), _jsx("line", { x1: "12", y1: "18", x2: "12", y2: "22" }), _jsx("line", { x1: "4.93", y1: "4.93", x2: "7.76", y2: "7.76" }), _jsx("line", { x1: "16.24", y1: "16.24", x2: "19.07", y2: "19.07" }), _jsx("line", { x1: "2", y1: "12", x2: "6", y2: "12" }), _jsx("line", { x1: "18", y1: "12", x2: "22", y2: "12" }), _jsx("line", { x1: "4.93", y1: "19.07", x2: "7.76", y2: "16.24" }), _jsx("line", { x1: "16.24", y1: "7.76", x2: "19.07", y2: "4.93" })] }), "Verifying..."] })) : (labels.otpButton || 'Verify') })] }), _jsx("div", { className: "onboarding-otp-resend", children: _jsxs("p", { className: "onboarding-otp-resend-text", children: ["Didn't receive the code?", ' ', resendCooldown > 0 ? (_jsxs("span", { className: "onboarding-otp-resend-cooldown", children: ["Resend in ", resendCooldown, "s"] })) : (_jsx("a", { href: "#", className: "onboarding-otp-resend-link", onClick: (e) => {
|
|
65
|
+
}, type: "text", inputMode: "numeric", pattern: "[0-9]*", maxLength: 1, className: "onboarding-otp-input", value: digit, onChange: (e) => handleOtpChange(index, e.target.value), onKeyDown: (e) => handleKeyDown(index, e), disabled: loading, autoFocus: index === 0, "aria-label": `OTP digit ${index + 1}` }, `otp-input-${index}`))) }), _jsx("button", { type: "submit", className: "onboarding-button onboarding-button-primary", disabled: loading || otp.length !== 6, children: loading ? (_jsxs(_Fragment, { children: [_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { animation: "spin 1s linear infinite" }, children: [_jsx("line", { x1: "12", y1: "2", x2: "12", y2: "6" }), _jsx("line", { x1: "12", y1: "18", x2: "12", y2: "22" }), _jsx("line", { x1: "4.93", y1: "4.93", x2: "7.76", y2: "7.76" }), _jsx("line", { x1: "16.24", y1: "16.24", x2: "19.07", y2: "19.07" }), _jsx("line", { x1: "2", y1: "12", x2: "6", y2: "12" }), _jsx("line", { x1: "18", y1: "12", x2: "22", y2: "12" }), _jsx("line", { x1: "4.93", y1: "19.07", x2: "7.76", y2: "16.24" }), _jsx("line", { x1: "16.24", y1: "7.76", x2: "19.07", y2: "4.93" })] }), "Verifying..."] })) : (labels.otpButton || "Verify") })] }), _jsx("div", { className: "onboarding-otp-resend", children: _jsxs("p", { className: "onboarding-otp-resend-text", children: ["Didn't receive the code?", " ", resendCooldown > 0 ? (_jsxs("span", { className: "onboarding-otp-resend-cooldown", children: ["Resend in ", resendCooldown, "s"] })) : (_jsx("a", { href: "#", className: "onboarding-otp-resend-link", onClick: (e) => {
|
|
69
66
|
e.preventDefault();
|
|
70
67
|
if (!loading) {
|
|
71
68
|
onResend();
|
|
72
69
|
}
|
|
73
|
-
},
|
|
70
|
+
}, children: "Resend code" }))] }) })] }));
|
|
74
71
|
};
|
|
75
72
|
//# sourceMappingURL=OtpForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtpForm.js","sourceRoot":"","sources":["../../../../../src/components/OnboardingUI/components/OtpForm.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AACH,OAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC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cAAc,SACpB,CACR,CAAC,CAAC,CAAC,CACF,YACE,IAAI,EAAC,GAAG,EACR,SAAS,EAAC,4BAA4B,EACtC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gCACb,CAAC,CAAC,cAAc,EAAE,CAAC;gCACnB,IAAI,CAAC,OAAO,EAAE,CAAC;oCACb,QAAQ,EAAE,CAAC;gCACb,CAAC;4BACH,CAAC,4BAGC,CACL,IACC,GACA,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* React-specific types for Abstraxn Wallet SDK
|
|
3
3
|
*/
|
|
4
|
-
import type { AbstraxnWalletConfig, User, WhoamiResponse } from
|
|
5
|
-
import type { Theme } from
|
|
4
|
+
import type { AbstraxnWalletConfig, User, WhoamiResponse } from "signer-test-sdk-core";
|
|
5
|
+
import type { Theme } from "signer-test-sdk-core";
|
|
6
6
|
/**
|
|
7
7
|
* UI Configuration for the provider
|
|
8
8
|
*/
|
|
@@ -18,7 +18,7 @@ export interface AbstraxnUIConfig {
|
|
|
18
18
|
logo?: string;
|
|
19
19
|
/**
|
|
20
20
|
* Onboarding title/heading
|
|
21
|
-
* @default 'Sign
|
|
21
|
+
* @default 'Sign In'
|
|
22
22
|
*/
|
|
23
23
|
onboardTitle?: string;
|
|
24
24
|
/**
|
|
@@ -44,11 +44,6 @@ export interface AbstraxnUIConfig {
|
|
|
44
44
|
* @default true
|
|
45
45
|
*/
|
|
46
46
|
closeOnBackdropClick?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Show close button
|
|
49
|
-
* @default true
|
|
50
|
-
*/
|
|
51
|
-
showCloseButton?: boolean;
|
|
52
47
|
/**
|
|
53
48
|
* Custom CSS overrides (injected as style tag)
|
|
54
49
|
*/
|
|
@@ -85,7 +80,7 @@ export interface AbstraxnUIConfig {
|
|
|
85
80
|
* If not provided, shows both email and Google options
|
|
86
81
|
* @default ['otp', 'google']
|
|
87
82
|
*/
|
|
88
|
-
authMethods?: (
|
|
83
|
+
authMethods?: ("otp" | "google" | "passkey" | "twitter" | "discord")[];
|
|
89
84
|
}
|
|
90
85
|
/**
|
|
91
86
|
* External wallet configuration
|
|
@@ -104,7 +99,7 @@ export interface ExternalWalletConfig {
|
|
|
104
99
|
* Enabled connectors
|
|
105
100
|
* @default ['injected']
|
|
106
101
|
*/
|
|
107
|
-
connectors?: (
|
|
102
|
+
connectors?: ("injected" | "metaMask" | "walletConnect")[];
|
|
108
103
|
}
|
|
109
104
|
/**
|
|
110
105
|
* Chain Configuration
|
|
@@ -158,7 +153,7 @@ export interface AbstraxnProviderConfig extends AbstraxnWalletConfig {
|
|
|
158
153
|
* Context value type
|
|
159
154
|
*/
|
|
160
155
|
export interface AbstraxnContextValue {
|
|
161
|
-
wallet: import(
|
|
156
|
+
wallet: import("signer-test-sdk-core").AbstraxnWallet | null;
|
|
162
157
|
isInitialized: boolean;
|
|
163
158
|
isConnected: boolean;
|
|
164
159
|
address: string | null;
|
|
@@ -176,12 +171,12 @@ export interface AbstraxnContextValue {
|
|
|
176
171
|
getChainId: () => Promise<number>;
|
|
177
172
|
switchChain: (chainId: number) => Promise<void>;
|
|
178
173
|
signMessage: (message: string) => Promise<string>;
|
|
179
|
-
signTransaction: (tx: import(
|
|
180
|
-
sendTransaction: (tx: import(
|
|
174
|
+
signTransaction: (tx: import("signer-test-sdk-core").TransactionRequest) => Promise<string>;
|
|
175
|
+
sendTransaction: (tx: import("signer-test-sdk-core").TransactionRequest) => Promise<import("signer-test-sdk-core").TransactionResponse>;
|
|
181
176
|
signTransactionViaAPI: (unsignedTransaction: string, fromAddress: string) => Promise<{
|
|
182
177
|
signedTransaction: string;
|
|
183
178
|
}>;
|
|
184
|
-
signAndSendTransaction: (unsignedTransaction: string, fromAddress: string, rpcUrl?: string) => Promise<import(
|
|
179
|
+
signAndSendTransaction: (unsignedTransaction: string, fromAddress: string, rpcUrl?: string) => Promise<import("signer-test-sdk-core").TransactionResponse>;
|
|
185
180
|
loginWithOTP: (email: string) => Promise<{
|
|
186
181
|
otpId: string;
|
|
187
182
|
}>;
|
|
@@ -204,7 +199,7 @@ export interface AbstraxnContextValue {
|
|
|
204
199
|
switchExternalWalletChain?: (chainId: number) => Promise<void>;
|
|
205
200
|
uiConfig?: AbstraxnUIConfig;
|
|
206
201
|
switchChainEnhanced?: (chainId: number) => Promise<void>;
|
|
207
|
-
currentChain?: import(
|
|
208
|
-
availableChains?: import(
|
|
202
|
+
currentChain?: import("./chains").ChainData | null;
|
|
203
|
+
availableChains?: import("./chains").ChainData[];
|
|
209
204
|
walletBalance?: bigint | null;
|
|
210
205
|
}
|