@loafmarkets/ui 0.1.346 → 0.1.348
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/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +211 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +211 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6431,13 +6431,19 @@ var LoginPopup = ({
|
|
|
6431
6431
|
renderKycWidget,
|
|
6432
6432
|
onFundWallet,
|
|
6433
6433
|
initialView,
|
|
6434
|
-
kycStatus: kycStatusProp
|
|
6434
|
+
kycStatus: kycStatusProp,
|
|
6435
|
+
walletAddress,
|
|
6436
|
+
onSubmitReferralCode
|
|
6435
6437
|
}) => {
|
|
6436
6438
|
const [view, setView] = useState(() => initialView ?? "main");
|
|
6437
6439
|
const [email, setEmail] = useState("");
|
|
6438
6440
|
const [handle, setHandle] = useState("");
|
|
6439
6441
|
const [otp, setOtp] = useState(Array(OTP_INPUT_LENGTH).fill(""));
|
|
6440
6442
|
const [error, setError] = useState("");
|
|
6443
|
+
const [copied, setCopied] = useState(false);
|
|
6444
|
+
const [referralCode, setReferralCode] = useState("");
|
|
6445
|
+
const [referralLoading, setReferralLoading] = useState(false);
|
|
6446
|
+
const [referralError, setReferralError] = useState("");
|
|
6441
6447
|
const [loading, setLoading] = useState(false);
|
|
6442
6448
|
const [isSignUp, setIsSignUp] = useState(false);
|
|
6443
6449
|
const [fundingAmount] = useState("");
|
|
@@ -6494,7 +6500,7 @@ var LoginPopup = ({
|
|
|
6494
6500
|
if (suppressAutoCloseRef.current) {
|
|
6495
6501
|
return;
|
|
6496
6502
|
}
|
|
6497
|
-
if (view === "kyc" || view === "kyc-success" || view === "kyc-failed" || view === "funding") {
|
|
6503
|
+
if (view === "kyc" || view === "kyc-success" || view === "kyc-failed" || view === "funding" || view === "receive" || view === "referral") {
|
|
6498
6504
|
return;
|
|
6499
6505
|
}
|
|
6500
6506
|
if (isAuthenticated || currentUser) {
|
|
@@ -6657,7 +6663,7 @@ var LoginPopup = ({
|
|
|
6657
6663
|
try {
|
|
6658
6664
|
await onVerifyEmailCode({ code, email });
|
|
6659
6665
|
if (isSignUp) {
|
|
6660
|
-
setView("funding");
|
|
6666
|
+
setView(onSubmitReferralCode ? "referral" : "funding");
|
|
6661
6667
|
setLoading(false);
|
|
6662
6668
|
return;
|
|
6663
6669
|
}
|
|
@@ -7020,7 +7026,13 @@ var LoginPopup = ({
|
|
|
7020
7026
|
/* @__PURE__ */ jsx(OnboardingHeading, { style: { textAlign: "center" }, children: "Deposit Funds" }),
|
|
7021
7027
|
/* @__PURE__ */ jsx(OnboardingSubtext, { style: { textAlign: "center", marginBottom: "1rem" }, children: "Choose how you'd like to fund your account." }),
|
|
7022
7028
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem" }, children: [
|
|
7023
|
-
/* @__PURE__ */ jsxs(ModalOptionCard, { onClick:
|
|
7029
|
+
/* @__PURE__ */ jsxs(ModalOptionCard, { onClick: () => {
|
|
7030
|
+
if (walletAddress) {
|
|
7031
|
+
setView("receive");
|
|
7032
|
+
} else {
|
|
7033
|
+
void handleCryptoFund();
|
|
7034
|
+
}
|
|
7035
|
+
}, disabled: cryptoFundingLoading, children: [
|
|
7024
7036
|
/* @__PURE__ */ jsxs("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", style: { color: "rgba(255,255,255,0.6)", flexShrink: 0 }, children: [
|
|
7025
7037
|
/* @__PURE__ */ jsx("rect", { x: "2", y: "6", width: "20", height: "12", rx: "2" }),
|
|
7026
7038
|
/* @__PURE__ */ jsx("path", { d: "M22 10H18a2 2 0 0 0 0 4h4" })
|
|
@@ -7052,6 +7064,193 @@ var LoginPopup = ({
|
|
|
7052
7064
|
}
|
|
7053
7065
|
) });
|
|
7054
7066
|
}
|
|
7067
|
+
if (view === "referral") {
|
|
7068
|
+
const handleReferralSubmit = async () => {
|
|
7069
|
+
const trimmed = referralCode.trim();
|
|
7070
|
+
if (!trimmed) {
|
|
7071
|
+
setReferralError("Please enter a referral code");
|
|
7072
|
+
return;
|
|
7073
|
+
}
|
|
7074
|
+
setReferralError("");
|
|
7075
|
+
setReferralLoading(true);
|
|
7076
|
+
try {
|
|
7077
|
+
await onSubmitReferralCode?.(trimmed);
|
|
7078
|
+
setView("funding");
|
|
7079
|
+
} catch (err) {
|
|
7080
|
+
setReferralError(err instanceof Error ? err.message : "Invalid referral code. Please try again.");
|
|
7081
|
+
} finally {
|
|
7082
|
+
setReferralLoading(false);
|
|
7083
|
+
}
|
|
7084
|
+
};
|
|
7085
|
+
return /* @__PURE__ */ jsx(Overlay2, { onClick: onClose, children: /* @__PURE__ */ jsxs(PopupContainer, { onClick: (event) => event.stopPropagation(), children: [
|
|
7086
|
+
/* @__PURE__ */ jsx(CloseButton, { onClick: onClose, "aria-label": "Close login popup", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }) }) }),
|
|
7087
|
+
/* @__PURE__ */ jsxs(OnboardingStepContainer, { children: [
|
|
7088
|
+
/* @__PURE__ */ jsx("div", { style: {
|
|
7089
|
+
width: 52,
|
|
7090
|
+
height: 52,
|
|
7091
|
+
borderRadius: 14,
|
|
7092
|
+
background: "linear-gradient(135deg, rgba(230,200,126,0.15) 0%, rgba(230,200,126,0.08) 100%)",
|
|
7093
|
+
border: "1px solid rgba(230,200,126,0.25)",
|
|
7094
|
+
display: "flex",
|
|
7095
|
+
alignItems: "center",
|
|
7096
|
+
justifyContent: "center",
|
|
7097
|
+
marginBottom: "1.1rem"
|
|
7098
|
+
}, children: /* @__PURE__ */ jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#e6c87e", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
7099
|
+
/* @__PURE__ */ jsx("path", { d: "M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }),
|
|
7100
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "7", r: "4" }),
|
|
7101
|
+
/* @__PURE__ */ jsx("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }),
|
|
7102
|
+
/* @__PURE__ */ jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
|
|
7103
|
+
] }) }),
|
|
7104
|
+
/* @__PURE__ */ jsx(OnboardingHeading, { children: "Do you have a referral code?" }),
|
|
7105
|
+
/* @__PURE__ */ jsx(OnboardingSubtext, { style: { marginBottom: "1.5rem" }, children: "Enter your code to unlock full access, or skip to continue." }),
|
|
7106
|
+
/* @__PURE__ */ jsxs(EmailFormContainer, { style: { width: "100%", marginBottom: 0 }, children: [
|
|
7107
|
+
/* @__PURE__ */ jsx(
|
|
7108
|
+
EmailInput,
|
|
7109
|
+
{
|
|
7110
|
+
type: "text",
|
|
7111
|
+
placeholder: "e.g. LOAF-XXXX",
|
|
7112
|
+
value: referralCode,
|
|
7113
|
+
onChange: (e) => {
|
|
7114
|
+
setReferralCode(e.target.value.toUpperCase());
|
|
7115
|
+
setReferralError("");
|
|
7116
|
+
},
|
|
7117
|
+
onKeyDown: (e) => {
|
|
7118
|
+
if (e.key === "Enter") void handleReferralSubmit();
|
|
7119
|
+
},
|
|
7120
|
+
autoFocus: true
|
|
7121
|
+
}
|
|
7122
|
+
),
|
|
7123
|
+
/* @__PURE__ */ jsx(
|
|
7124
|
+
SubmitButton,
|
|
7125
|
+
{
|
|
7126
|
+
type: "button",
|
|
7127
|
+
onClick: () => void handleReferralSubmit(),
|
|
7128
|
+
disabled: referralLoading || !referralCode.trim(),
|
|
7129
|
+
children: referralLoading ? "Verifying\u2026" : "Apply Code"
|
|
7130
|
+
}
|
|
7131
|
+
),
|
|
7132
|
+
referralError && /* @__PURE__ */ jsx(StatusMessage, { $error: true, children: referralError })
|
|
7133
|
+
] }),
|
|
7134
|
+
/* @__PURE__ */ jsx(
|
|
7135
|
+
OnboardingSkipButton,
|
|
7136
|
+
{
|
|
7137
|
+
type: "button",
|
|
7138
|
+
onClick: () => setView("funding"),
|
|
7139
|
+
style: { marginTop: "0.75rem" },
|
|
7140
|
+
children: "Skip for now"
|
|
7141
|
+
}
|
|
7142
|
+
)
|
|
7143
|
+
] })
|
|
7144
|
+
] }) });
|
|
7145
|
+
}
|
|
7146
|
+
if (view === "receive") {
|
|
7147
|
+
const handleCopy = () => {
|
|
7148
|
+
if (walletAddress) {
|
|
7149
|
+
navigator.clipboard.writeText(walletAddress).then(() => {
|
|
7150
|
+
setCopied(true);
|
|
7151
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
7152
|
+
}).catch(() => {
|
|
7153
|
+
});
|
|
7154
|
+
}
|
|
7155
|
+
};
|
|
7156
|
+
return /* @__PURE__ */ jsx(Overlay2, { onClick: onClose, children: /* @__PURE__ */ jsxs(PopupContainer, { onClick: (event) => event.stopPropagation(), children: [
|
|
7157
|
+
/* @__PURE__ */ jsx(CloseButton, { onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }) }) }),
|
|
7158
|
+
/* @__PURE__ */ jsxs(BackButton, { onClick: () => setView("funding"), children: [
|
|
7159
|
+
/* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" }) }),
|
|
7160
|
+
"Back"
|
|
7161
|
+
] }),
|
|
7162
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", paddingTop: "0.5rem" }, children: [
|
|
7163
|
+
/* @__PURE__ */ jsx("div", { style: {
|
|
7164
|
+
width: 52,
|
|
7165
|
+
height: 52,
|
|
7166
|
+
borderRadius: 14,
|
|
7167
|
+
background: "linear-gradient(135deg, rgba(230,200,126,0.15) 0%, rgba(230,200,126,0.08) 100%)",
|
|
7168
|
+
border: "1px solid rgba(230,200,126,0.25)",
|
|
7169
|
+
display: "flex",
|
|
7170
|
+
alignItems: "center",
|
|
7171
|
+
justifyContent: "center",
|
|
7172
|
+
marginBottom: "1.1rem"
|
|
7173
|
+
}, children: /* @__PURE__ */ jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#e6c87e", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
7174
|
+
/* @__PURE__ */ jsx("path", { d: "M12 2L12 16M12 16L7 11M12 16L17 11" }),
|
|
7175
|
+
/* @__PURE__ */ jsx("path", { d: "M3 20H21" })
|
|
7176
|
+
] }) }),
|
|
7177
|
+
/* @__PURE__ */ jsx(OnboardingHeading, { style: { marginBottom: "0.35rem" }, children: "Receive USDC" }),
|
|
7178
|
+
/* @__PURE__ */ jsxs("div", { style: {
|
|
7179
|
+
display: "inline-flex",
|
|
7180
|
+
alignItems: "center",
|
|
7181
|
+
gap: "0.35rem",
|
|
7182
|
+
background: "rgba(0,82,255,0.12)",
|
|
7183
|
+
border: "1px solid rgba(0,82,255,0.3)",
|
|
7184
|
+
borderRadius: 20,
|
|
7185
|
+
padding: "0.2rem 0.65rem",
|
|
7186
|
+
marginBottom: "1.25rem"
|
|
7187
|
+
}, children: [
|
|
7188
|
+
/* @__PURE__ */ jsx("div", { style: { width: 7, height: 7, borderRadius: "50%", background: "#0052FF", flexShrink: 0 } }),
|
|
7189
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "0.72rem", fontWeight: 600, color: "#6b9fff", letterSpacing: "0.02em" }, children: "Base Sepolia" })
|
|
7190
|
+
] }),
|
|
7191
|
+
/* @__PURE__ */ jsxs("p", { style: { fontSize: "0.82rem", color: "rgba(255,255,255,0.5)", textAlign: "center", marginBottom: "1.1rem", lineHeight: 1.5, maxWidth: 320 }, children: [
|
|
7192
|
+
"Send ",
|
|
7193
|
+
/* @__PURE__ */ jsx("strong", { style: { color: "rgba(255,255,255,0.8)" }, children: "USDC" }),
|
|
7194
|
+
" on Base Sepolia to the address below. Only send on this network."
|
|
7195
|
+
] }),
|
|
7196
|
+
/* @__PURE__ */ jsxs("div", { style: {
|
|
7197
|
+
width: "100%",
|
|
7198
|
+
background: "rgba(255,255,255,0.03)",
|
|
7199
|
+
border: "1px solid rgba(255,255,255,0.09)",
|
|
7200
|
+
borderRadius: 10,
|
|
7201
|
+
padding: "0.85rem 1rem",
|
|
7202
|
+
marginBottom: "0.75rem"
|
|
7203
|
+
}, children: [
|
|
7204
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: "0.65rem", color: "rgba(255,255,255,0.35)", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: "0.4rem", fontWeight: 600 }, children: "Your wallet address" }),
|
|
7205
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.75rem" }, children: [
|
|
7206
|
+
/* @__PURE__ */ jsx("span", { style: {
|
|
7207
|
+
flex: 1,
|
|
7208
|
+
fontFamily: "monospace",
|
|
7209
|
+
fontSize: "0.76rem",
|
|
7210
|
+
color: "#eaecef",
|
|
7211
|
+
wordBreak: "break-all",
|
|
7212
|
+
lineHeight: 1.6
|
|
7213
|
+
}, children: walletAddress }),
|
|
7214
|
+
/* @__PURE__ */ jsx(
|
|
7215
|
+
"button",
|
|
7216
|
+
{
|
|
7217
|
+
type: "button",
|
|
7218
|
+
onClick: handleCopy,
|
|
7219
|
+
style: {
|
|
7220
|
+
background: copied ? "rgba(14,203,129,0.15)" : "rgba(230,200,126,0.1)",
|
|
7221
|
+
border: "1px solid " + (copied ? "rgba(14,203,129,0.35)" : "rgba(230,200,126,0.3)"),
|
|
7222
|
+
borderRadius: 6,
|
|
7223
|
+
padding: "0.4rem 0.8rem",
|
|
7224
|
+
color: copied ? "#0ecb81" : "#e6c87e",
|
|
7225
|
+
fontSize: "0.78rem",
|
|
7226
|
+
fontWeight: 600,
|
|
7227
|
+
cursor: "pointer",
|
|
7228
|
+
whiteSpace: "nowrap",
|
|
7229
|
+
flexShrink: 0,
|
|
7230
|
+
transition: "all 0.15s ease"
|
|
7231
|
+
},
|
|
7232
|
+
children: copied ? "\u2713 Copied" : "Copy"
|
|
7233
|
+
}
|
|
7234
|
+
)
|
|
7235
|
+
] })
|
|
7236
|
+
] }),
|
|
7237
|
+
/* @__PURE__ */ jsx(SubmitButton, { onClick: onClose, style: { marginBottom: "1.1rem" }, children: "Done" }),
|
|
7238
|
+
/* @__PURE__ */ jsxs("div", { style: {
|
|
7239
|
+
display: "flex",
|
|
7240
|
+
alignItems: "center",
|
|
7241
|
+
gap: "0.4rem",
|
|
7242
|
+
color: "rgba(255,255,255,0.28)",
|
|
7243
|
+
fontSize: "0.72rem"
|
|
7244
|
+
}, children: [
|
|
7245
|
+
/* @__PURE__ */ jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }) }),
|
|
7246
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
7247
|
+
"Wallet secured by ",
|
|
7248
|
+
/* @__PURE__ */ jsx("strong", { style: { color: "rgba(255,255,255,0.45)", fontWeight: 600 }, children: "Privy" })
|
|
7249
|
+
] })
|
|
7250
|
+
] })
|
|
7251
|
+
] })
|
|
7252
|
+
] }) });
|
|
7253
|
+
}
|
|
7055
7254
|
return null;
|
|
7056
7255
|
};
|
|
7057
7256
|
var Overlay2 = styled9.div`
|
|
@@ -13882,7 +14081,10 @@ function PortfolioActivityPanel({
|
|
|
13882
14081
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatNumber2(order.quantity) }) }),
|
|
13883
14082
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatCurrency4(order.price) }) }),
|
|
13884
14083
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatCurrency4(order.price * order.quantity) }) }),
|
|
13885
|
-
/* @__PURE__ */
|
|
14084
|
+
/* @__PURE__ */ jsxs(GridCell, { children: [
|
|
14085
|
+
/* @__PURE__ */ jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, title: order.status === "REJECTED" && order.rejectionReason ? order.rejectionReason : void 0, children: prettyLabel(order.status) }),
|
|
14086
|
+
order.status === "REJECTED" && order.rejectionReason && /* @__PURE__ */ jsx(CellText, { $muted: true, style: { fontSize: "0.62rem", marginTop: "0.2rem", maxWidth: "120px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: order.rejectionReason, children: order.rejectionReason })
|
|
14087
|
+
] }),
|
|
13886
14088
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatTimestamp(order.createdAt) }) }),
|
|
13887
14089
|
/* @__PURE__ */ jsx(GridCell, { children: order.txHash && /* @__PURE__ */ jsx(TxLink, { href: `${_blockExplorerBaseUrl}/${order.txHash}`, target: "_blank", rel: "noopener noreferrer", title: "View on BaseScan", children: /* @__PURE__ */ jsxs("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
13888
14090
|
/* @__PURE__ */ jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
@@ -17841,10 +18043,13 @@ function ToastProvider({ children }) {
|
|
|
17841
18043
|
setToasts((prev) => [...prev, { ...data, id }]);
|
|
17842
18044
|
return id;
|
|
17843
18045
|
}, []);
|
|
18046
|
+
const update = useCallback((id, patch) => {
|
|
18047
|
+
setToasts((prev) => prev.map((t) => t.id === id ? { ...t, ...patch } : t));
|
|
18048
|
+
}, []);
|
|
17844
18049
|
const dismiss = useCallback((id) => {
|
|
17845
18050
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
17846
18051
|
}, []);
|
|
17847
|
-
return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: { toast: addToast, dismiss }, children: [
|
|
18052
|
+
return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: { toast: addToast, update, dismiss }, children: [
|
|
17848
18053
|
children,
|
|
17849
18054
|
/* @__PURE__ */ jsx(Container3, { children: toasts.map((t) => /* @__PURE__ */ jsx(ToastItem, { toast: t, onDismiss: dismiss }, t.id)) })
|
|
17850
18055
|
] });
|