@b3dotfun/sdk 0.1.2-alpha.0 → 0.1.2-alpha.2
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/cjs/anyspend/react/components/AnySpend.d.ts +3 -0
- package/dist/cjs/anyspend/react/components/AnySpend.js +12 -6
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +10 -4
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +19 -4
- package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/QRDeposit.js +12 -4
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +7 -5
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +15 -6
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +7 -4
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +3 -2
- package/dist/cjs/anyspend/react/components/common/OrderHistory.js +2 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +3 -2
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +5 -2
- package/dist/cjs/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/TabSection.js +16 -7
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
- package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/cjs/anyspend/react/components/common/WarningText.js +5 -6
- package/dist/cjs/anyspend/react/components/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/cjs/anyspend/react/components/types/classes.js +6 -0
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +3 -0
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +3 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +12 -6
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +10 -4
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +4 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +19 -4
- package/dist/esm/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/esm/anyspend/react/components/QRDeposit.js +12 -4
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +7 -5
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +15 -6
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +7 -4
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +3 -2
- package/dist/esm/anyspend/react/components/common/OrderHistory.js +2 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -2
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +3 -2
- package/dist/esm/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/esm/anyspend/react/components/common/RecipientSelection.js +5 -2
- package/dist/esm/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/TabSection.js +16 -7
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
- package/dist/esm/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/esm/anyspend/react/components/common/WarningText.js +5 -6
- package/dist/esm/anyspend/react/components/index.d.ts +1 -0
- package/dist/esm/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/esm/anyspend/react/components/types/classes.js +5 -0
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +3 -0
- package/dist/types/anyspend/react/components/AnySpend.d.ts +3 -0
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +3 -0
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +4 -1
- package/dist/types/anyspend/react/components/QRDeposit.d.ts +4 -1
- package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +3 -0
- package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
- package/dist/types/anyspend/react/components/common/TabSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/WarningText.d.ts +8 -7
- package/dist/types/anyspend/react/components/index.d.ts +1 -0
- package/dist/types/anyspend/react/components/types/classes.d.ts +390 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +3 -0
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpend.tsx +41 -20
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +31 -13
- package/src/anyspend/react/components/AnySpendDeposit.tsx +171 -52
- package/src/anyspend/react/components/QRDeposit.tsx +91 -35
- package/src/anyspend/react/components/common/CryptoPaySection.tsx +31 -19
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +14 -4
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +43 -23
- package/src/anyspend/react/components/common/FeeDetailPanel.tsx +53 -32
- package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +26 -13
- package/src/anyspend/react/components/common/OrderDetails.tsx +16 -3
- package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +5 -1
- package/src/anyspend/react/components/common/OrderHistory.tsx +2 -1
- package/src/anyspend/react/components/common/PanelOnramp.tsx +4 -1
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +118 -40
- package/src/anyspend/react/components/common/PointsDetailPanel.tsx +28 -14
- package/src/anyspend/react/components/common/RecipientSelection.tsx +20 -5
- package/src/anyspend/react/components/common/TabSection.tsx +21 -12
- package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +12 -4
- package/src/anyspend/react/components/common/WarningText.tsx +10 -10
- package/src/anyspend/react/components/index.ts +16 -0
- package/src/anyspend/react/components/types/classes.ts +476 -0
- package/src/global-account/react/stores/useModalStore.ts +3 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
|
+
import type { OrderDetailsClasses } from "../types/classes";
|
|
2
3
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
3
4
|
interface OrderDetailsProps {
|
|
4
5
|
mode?: "modal" | "page";
|
|
@@ -17,6 +18,8 @@ interface OrderDetailsProps {
|
|
|
17
18
|
returnToHomeUrl?: string;
|
|
18
19
|
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
19
20
|
returnHomeLabel?: string;
|
|
21
|
+
/** Custom class names for styling specific elements */
|
|
22
|
+
classes?: OrderDetailsClasses;
|
|
20
23
|
}
|
|
21
24
|
export declare const OrderDetails: import("react").NamedExoticComponent<OrderDetailsProps>;
|
|
22
25
|
export declare const OrderDetailsLoadingView: import("react/jsx-runtime").JSX.Element;
|
|
@@ -131,7 +131,7 @@ function roundTokenAmount(amount) {
|
|
|
131
131
|
const roundedDecimalPart = digits.join("");
|
|
132
132
|
return `${wholePart}.${roundedDecimalPart}`;
|
|
133
133
|
}
|
|
134
|
-
export const OrderDetails = memo(function OrderDetails({ mode = "modal", order, depositTxs, relayTxs, executeTx, refundTxs, cryptoPaymentMethod, selectedCryptoPaymentMethod, onPaymentMethodChange, onBack, disableUrlParamManagement = false, points, returnToHomeUrl, returnHomeLabel, }) {
|
|
134
|
+
export const OrderDetails = memo(function OrderDetails({ mode = "modal", order, depositTxs, relayTxs, executeTx, refundTxs, cryptoPaymentMethod, selectedCryptoPaymentMethod, onPaymentMethodChange, onBack, disableUrlParamManagement = false, points, returnToHomeUrl, returnHomeLabel, classes, }) {
|
|
135
135
|
const router = useRouter();
|
|
136
136
|
const searchParams = useSearchParams();
|
|
137
137
|
// Get theme from B3Provider context
|
|
@@ -292,7 +292,8 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
292
292
|
}
|
|
293
293
|
}, [returnToHomeUrl, handleBack]);
|
|
294
294
|
// Reusable "Return to Home" / "Close" button
|
|
295
|
-
const returnHomeOrCloseButton = (_jsx("button", { className:
|
|
295
|
+
const returnHomeOrCloseButton = (_jsx("button", { className: classes?.returnButton ||
|
|
296
|
+
"order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white", onClick: returnToHomeUrl ? handleReturnToHome : mode === "page" ? handleBack : handleCloseModal, children: returnHomeLabel ? (returnHomeLabel) : mode === "page" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }));
|
|
296
297
|
useEffect(() => {
|
|
297
298
|
if (txSuccess) {
|
|
298
299
|
toast.success("Transaction successful! We are processing your order.", { duration: 10000 });
|
|
@@ -429,7 +430,8 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
429
430
|
? "Funding Tournament"
|
|
430
431
|
: "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
431
432
|
? `Waiting for payment`
|
|
432
|
-
: `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) }), depositTxs?.length > 0 && !depositEnoughAmount && order.status === "scanning_deposit_transaction" && (_jsx(InsufficientDepositPayment, { order: order, srcToken: srcToken, depositDeficit: depositDeficit, phantomWalletAddress: phantomWalletAddress, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, onPayment: handlePayment })), _jsxs("button", { className:
|
|
433
|
+
: `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) })] }) }), depositTxs?.length > 0 && !depositEnoughAmount && order.status === "scanning_deposit_transaction" && (_jsx(InsufficientDepositPayment, { order: order, srcToken: srcToken, depositDeficit: depositDeficit, phantomWalletAddress: phantomWalletAddress, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, onPayment: handlePayment })), _jsxs("button", { className: classes?.backButton ||
|
|
434
|
+
"text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline", onClick: handleBack, children: [_jsx(RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
|
|
433
435
|
}
|
|
434
436
|
return (_jsxs(_Fragment, { children: [_jsx(OrderStatus, { order: order, selectedCryptoPaymentMethod: effectiveCryptoPaymentMethod }), statusDisplay === "processing" && (_jsx(_Fragment, { children: order.onrampMetadata ? (_jsx(PaymentVendorUI, { order: order, dstTokenSymbol: dstToken.symbol })) : effectiveCryptoPaymentMethod === CryptoPaymentMethodType.CONNECT_WALLET ||
|
|
435
437
|
effectiveCryptoPaymentMethod === CryptoPaymentMethodType.GLOBAL_WALLET ? (_jsx(ConnectWalletPayment, { order: order, onPayment: handlePayment, onCancel: handleBack, txLoading: txLoading, isSwitchingOrExecuting: isSwitchingOrExecuting, phantomWalletAddress: phantomWalletAddress, tournament: tournament, nft: nft, cryptoPaymentMethod: effectiveCryptoPaymentMethod, onPaymentMethodChange: onPaymentMethodChange })) : effectiveCryptoPaymentMethod === CryptoPaymentMethodType.TRANSFER_CRYPTO ? (
|
|
@@ -444,7 +446,8 @@ export const OrderDetails = memo(function OrderDetails({ mode = "modal", order,
|
|
|
444
446
|
? centerTruncate(phantomWalletAddress, 6)
|
|
445
447
|
: centerTruncate(account?.address || "", 6)] })] }), _jsxs("div", { className: "flex w-full flex-col items-center gap-2", children: [_jsxs(ShinyButton, { accentColor: colorMode === "dark" ? "#ffffff" : "#000000", className: "flex w-5/6 items-center gap-2 sm:px-0", onClick: () => setShowQRCode(true), children: [_jsx("span", { className: "pl-4 text-lg md:text-sm", children: "Pay from a different wallet" }), _jsx(ChevronRight, { className: "h-4 w-4" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(WalletMetamask, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletPhantom, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletTrust, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletWalletConnect, { className: "h-5 w-5", variant: "branded" }), _jsx("span", { className: "label-style text-as-primary/30 text-xs", children: "& more" })] })] })] }) })) : (
|
|
446
448
|
// Default case - existing QR code flow
|
|
447
|
-
_jsx(motion.div, { initial: { opacity: 0, filter: "blur(10px)" }, animate: { opacity: 1, filter: "blur(0px)" }, transition: { duration: 0.5, ease: "easeInOut" }, className: "flex w-full items-center justify-evenly gap-4", children: _jsxs("div", { className: "order-details-qr-container mt-8 flex flex-col items-center rounded-lg bg-white p-6 pb-3", children: [_jsx(QRCodeSVG, { value: getPaymentUrl(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === ZERO_ADDRESS ? srcToken?.symbol || "ETH" : order.srcTokenAddress, order.srcChain, srcToken?.decimals), className: "order-details-qr-code max-w-[200px]" }), _jsxs("div", { className: "order-details-qr-wallets mt-3 flex items-center justify-center gap-2 text-sm", children: [_jsx("span", { className: "label-style text-as-brand/70 text-sm", children: "Scan with" }), _jsxs(TextLoop, { interval: 3, children: [_jsx(WalletMetamask, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletPhantom, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletTrust, { className: "h-5 w-5", variant: "branded" })] })] })] }) }))] })) })), _jsxs("div", { className: "order-details-time-remaining flex w-full items-center justify-center gap-1 text-sm", children: [_jsx("div", { className: "text-as-primary/30 order-details-time-label", children: "Time remaining:" }), _jsx("div", { className: "text-as-primary order-details-time-value", children: depositEnoughAmount ? ("Received") : order.status === "expired" ? ("Expired") : (_jsx(TimeAgo, { date: new Date(order.expiredAt), live: true })) })] }), statusDisplay !== "processing" && (_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points, isOpen: orderDetailsOpen, onOpenChange: setOrderDetailsOpen })), _jsxs("button", { className:
|
|
449
|
+
_jsx(motion.div, { initial: { opacity: 0, filter: "blur(10px)" }, animate: { opacity: 1, filter: "blur(0px)" }, transition: { duration: 0.5, ease: "easeInOut" }, className: "flex w-full items-center justify-evenly gap-4", children: _jsxs("div", { className: "order-details-qr-container mt-8 flex flex-col items-center rounded-lg bg-white p-6 pb-3", children: [_jsx(QRCodeSVG, { value: getPaymentUrl(order.globalAddress, BigInt(order.srcAmount), order.srcTokenAddress === ZERO_ADDRESS ? srcToken?.symbol || "ETH" : order.srcTokenAddress, order.srcChain, srcToken?.decimals), className: "order-details-qr-code max-w-[200px]" }), _jsxs("div", { className: "order-details-qr-wallets mt-3 flex items-center justify-center gap-2 text-sm", children: [_jsx("span", { className: "label-style text-as-brand/70 text-sm", children: "Scan with" }), _jsxs(TextLoop, { interval: 3, children: [_jsx(WalletMetamask, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletCoinbase, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletPhantom, { className: "h-5 w-5", variant: "branded" }), _jsx(WalletTrust, { className: "h-5 w-5", variant: "branded" })] })] })] }) }))] })) })), _jsxs("div", { className: "order-details-time-remaining flex w-full items-center justify-center gap-1 text-sm", children: [_jsx("div", { className: "text-as-primary/30 order-details-time-label", children: "Time remaining:" }), _jsx("div", { className: "text-as-primary order-details-time-value", children: depositEnoughAmount ? ("Received") : order.status === "expired" ? ("Expired") : (_jsx(TimeAgo, { date: new Date(order.expiredAt), live: true })) })] }), statusDisplay !== "processing" && (_jsx(OrderDetailsCollapsible, { order: order, dstToken: dstToken, tournament: tournament, nft: nft, recipientName: recipientName, formattedExpectedDstAmount: formattedExpectedDstAmount, points: points, isOpen: orderDetailsOpen, onOpenChange: setOrderDetailsOpen })), _jsxs("button", { className: classes?.backButton ||
|
|
450
|
+
"text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline", onClick: handleBack, children: [_jsx(RefreshCcw, { className: "ml-2 h-4 w-4" }), " Cancel and start over"] })] }));
|
|
448
451
|
});
|
|
449
452
|
function TransactionDetails({ title, chainId, tx, isProcessing, delay, }) {
|
|
450
453
|
return (_jsxs("div", { className: "order-details-transaction-item relative flex w-full flex-1 items-center justify-between gap-4", children: [_jsxs("div", { className: "order-details-transaction-content flex grow items-center gap-4", children: [_jsx(motion.div, { className: "bg-as-surface-secondary relative h-10 w-10 rounded-full", children: isProcessing ? (_jsx(motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeInOut", delay }, className: "border-as-border-secondary absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full border-2 shadow-lg backdrop-blur-sm", children: _jsx(Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }) })) : (_jsx(motion.div, { initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { duration: 0.5, ease: "easeOut", delay }, className: "bg-as-success-secondary absolute z-10 m-2 flex h-6 w-6 items-center justify-center rounded-full border border-white/30 shadow-lg backdrop-blur-sm", children: _jsx(CheckIcon, { className: "text-as-content-icon-success h-4 w-4" }) })) }), _jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay }, className: "shrink-0 text-base", children: isProcessing ? (_jsx(TextShimmer, { duration: 1, children: title })) : (_jsx("span", { className: "text-as-primary", children: title })) })] }), _jsx("div", { className: "flex flex-col gap-1", children: tx ? (_jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, ease: "easeInOut", delay: (delay || 0) + 0.3 }, className: "flex items-center gap-3", children: _jsx("a", { href: getExplorerTxUrl(chainId, tx.txHash), target: "_blank", children: _jsx("div", { className: "text-as-primary/30 font-mono text-xs", children: centerTruncate(tx?.txHash, 6) }) }) })) : null })] }));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
|
+
import type { OrderDetailsCollapsibleClasses } from "../types/classes";
|
|
2
3
|
type Order = components["schemas"]["Order"];
|
|
3
4
|
type Token = components["schemas"]["Token"];
|
|
4
5
|
type Tournament = components["schemas"]["Tournament"];
|
|
@@ -16,6 +17,7 @@ interface OrderDetailsCollapsibleProps {
|
|
|
16
17
|
points?: number;
|
|
17
18
|
isOpen?: boolean;
|
|
18
19
|
onOpenChange?: (isOpen: boolean) => void;
|
|
20
|
+
classes?: OrderDetailsCollapsibleClasses;
|
|
19
21
|
}
|
|
20
22
|
export declare const OrderDetailsCollapsible: import("react").NamedExoticComponent<OrderDetailsCollapsibleProps>;
|
|
21
23
|
export {};
|
|
@@ -10,7 +10,7 @@ import { ChevronDown, Copy } from "lucide-react";
|
|
|
10
10
|
import { motion } from "motion/react";
|
|
11
11
|
import { memo, useState } from "react";
|
|
12
12
|
import { b3 } from "viem/chains";
|
|
13
|
-
export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({ order, dstToken, tournament, nft, recipientName, formattedExpectedDstAmount, className, showTotal = false, totalAmount, points, isOpen, onOpenChange, }) {
|
|
13
|
+
export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({ order, dstToken, tournament, nft, recipientName, formattedExpectedDstAmount, className, showTotal = false, totalAmount, points, isOpen, onOpenChange, classes, }) {
|
|
14
14
|
const [internalOpen, setInternalOpen] = useState(true);
|
|
15
15
|
// Use controlled mode if isOpen is provided, otherwise use internal state
|
|
16
16
|
const showOrderDetails = isOpen !== undefined ? isOpen : internalOpen;
|
|
@@ -24,7 +24,8 @@ export const OrderDetailsCollapsible = memo(function OrderDetailsCollapsible({ o
|
|
|
24
24
|
? "0"
|
|
25
25
|
: order.payload.expectedDstAmount.toString();
|
|
26
26
|
const finalFormattedExpectedDstAmount = formattedExpectedDstAmount || formatTokenAmount(BigInt(expectedDstAmount), dstToken.decimals);
|
|
27
|
-
return (_jsx("div", { className: cn(
|
|
27
|
+
return (_jsx("div", { className: cn(classes?.container ||
|
|
28
|
+
"order-details-collapsible bg-as-surface-secondary border-as-border-secondary rounded-xl border px-4 py-2", className), children: showOrderDetails ? (_jsx(motion.div, { className: "order-details-expanded w-full", initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: _jsxs("div", { className: "order-details-content flex w-full flex-col items-center gap-3 whitespace-nowrap py-2 text-sm", children: [_jsxs("div", { className: "order-details-recipient-section flex w-full justify-between gap-4", children: [_jsx("div", { className: "order-details-recipient-label text-as-tertiarry", children: "Recipient" }), _jsxs("div", { className: "order-details-recipient-info flex flex-col items-end gap-1", children: [recipientName && (_jsx("div", { className: "order-details-recipient-name text-as-primary font-semibold", children: recipientName })), _jsx(CopyToClipboard, { text: order.recipientAddress, onCopy: () => {
|
|
28
29
|
toast.success("Copied recipient address to clipboard");
|
|
29
30
|
}, children: _jsxs("div", { className: "order-details-recipient-address text-as-primary flex items-center gap-2", children: [centerTruncate(order.recipientAddress, 10), _jsx(Copy, { className: "order-details-recipient-copy-icon text-as-primary/50 hover:text-as-primary h-4 w-4 cursor-pointer transition-all duration-200" })] }) })] })] }), _jsx("div", { className: "order-details-divider divider w-full" }), _jsxs("div", { className: "order-details-expected-section flex w-full items-start justify-between gap-2", children: [_jsx("div", { className: "order-details-expected-label text-as-tertiarry shrink-0", children: order.type === "swap" ||
|
|
30
31
|
order.type === "deposit_first" ||
|
|
@@ -6,7 +6,8 @@ import ModalHeader from "../../../../global-account/react/components/ModalHeader
|
|
|
6
6
|
import { RefreshCcw } from "lucide-react";
|
|
7
7
|
import { OrderHistoryItem } from "./OrderHistoryItem.js";
|
|
8
8
|
export function OrderHistory({ mode, onBack, onSelectOrder }) {
|
|
9
|
-
const { address } = useAccountWallet();
|
|
9
|
+
const { connectedEOAWallet, address: smartWalletAddress } = useAccountWallet();
|
|
10
|
+
const address = connectedEOAWallet?.getAccount()?.address || smartWalletAddress;
|
|
10
11
|
const { orderHistory, isLoadingOrderHistory, refetchOrderHistory } = useAnyspendOrderHistory(address);
|
|
11
12
|
return (_jsxs(_Fragment, { children: [_jsx(ModalHeader, { title: "Order History", showCloseButton: false, handleBack: onBack, className: "w-full", children: _jsx(Button, { variant: "ghost", size: "icon", className: "hover:bg-as-surface-secondary", onClick: () => {
|
|
12
13
|
refetchOrderHistory();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
import { GetQuoteResponse } from "../../../../anyspend/types/api_req_res";
|
|
3
3
|
import { FiatPaymentMethod } from "./FiatPaymentMethod";
|
|
4
|
-
|
|
4
|
+
import type { PanelOnrampClasses } from "../types/classes";
|
|
5
|
+
export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken, anyspendQuote, onShowPointsDetail, onShowFeeDetail, customUsdInputValues, customRecipientLabel, classes, }: {
|
|
5
6
|
srcAmountOnRamp: string;
|
|
6
7
|
setSrcAmountOnRamp: (amount: string) => void;
|
|
7
8
|
selectedPaymentMethod?: FiatPaymentMethod;
|
|
@@ -22,4 +23,5 @@ export declare function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selec
|
|
|
22
23
|
customUsdInputValues?: string[];
|
|
23
24
|
/** Custom label for recipient display (overrides recipientName) */
|
|
24
25
|
customRecipientLabel?: string;
|
|
26
|
+
classes?: PanelOnrampClasses;
|
|
25
27
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,7 +10,7 @@ import { FIAT_PAYMENT_METHOD_DISPLAY, FiatPaymentMethod } from "./FiatPaymentMet
|
|
|
10
10
|
import { OrderTokenAmountFiat } from "./OrderTokenAmountFiat.js";
|
|
11
11
|
import { PointsBadge } from "./PointsBadge.js";
|
|
12
12
|
const ONE_CHAR_WIDTH = 30;
|
|
13
|
-
export function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken = false, anyspendQuote, onShowPointsDetail, onShowFeeDetail, customUsdInputValues = ["5", "10", "20", "25"], customRecipientLabel, }) {
|
|
13
|
+
export function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPaymentMethod, setActivePanel, _recipientAddress, destinationToken, destinationChainId, destinationAmount, onDestinationTokenChange, onDestinationChainChange, fiatPaymentMethodIndex, recipientSelectionPanelIndex, dstTokenSymbol, hideDstToken = false, anyspendQuote, onShowPointsDetail, onShowFeeDetail, customUsdInputValues = ["5", "10", "20", "25"], customRecipientLabel, classes, }) {
|
|
14
14
|
// Helper function to get fees from anyspend quote
|
|
15
15
|
const getFeeFromApi = (paymentMethod) => {
|
|
16
16
|
// Try to get fee from anyspend quote first (most accurate)
|
|
@@ -75,7 +75,7 @@ export function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp, selectedPayme
|
|
|
75
75
|
const handleQuickAmount = (value) => {
|
|
76
76
|
setSrcAmountOnRamp(value);
|
|
77
77
|
};
|
|
78
|
-
return (_jsxs("div", { className: "panel-onramp bg-as-surface-primary flex w-full flex-col", children: [_jsxs("div", { className: "border-as-border-secondary bg-as-surface-secondary relative flex w-full flex-col rounded-2xl border p-4", children: [_jsxs("div", { className: "flex h-7 w-full items-center justify-between", children: [_jsx("span", { className: "text-as-tertiarry flex items-center text-sm font-bold", children: "Pay" }), _jsx("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm", onClick: () => setActivePanel(fiatPaymentMethodIndex), children: (() => {
|
|
78
|
+
return (_jsxs("div", { className: classes?.container || "panel-onramp bg-as-surface-primary flex w-full flex-col", children: [_jsxs("div", { className: "border-as-border-secondary bg-as-surface-secondary relative flex w-full flex-col rounded-2xl border p-4", children: [_jsxs("div", { className: "flex h-7 w-full items-center justify-between", children: [_jsx("span", { className: "text-as-tertiarry flex items-center text-sm font-bold", children: "Pay" }), _jsx("button", { className: "text-as-tertiarry flex h-7 items-center gap-1 text-sm", onClick: () => setActivePanel(fiatPaymentMethodIndex), children: (() => {
|
|
79
79
|
const config = selectedPaymentMethod ? FIAT_PAYMENT_METHOD_DISPLAY[selectedPaymentMethod] : null;
|
|
80
80
|
if (config) {
|
|
81
81
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-blue-600", children: _jsx("span", { className: "text-xs font-bold text-white", children: config.icon }) }), config.label] }), _jsx(ChevronRight, { className: "h-4 w-4" })] }));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
import { GetQuoteResponse } from "../../../../anyspend/types/api_req_res";
|
|
3
|
+
import type { PanelOnrampPaymentClasses } from "../types/classes";
|
|
3
4
|
interface PanelOnrampPaymentProps {
|
|
4
5
|
srcAmountOnRamp: string;
|
|
5
6
|
recipientName?: string;
|
|
@@ -24,6 +25,7 @@ interface PanelOnrampPaymentProps {
|
|
|
24
25
|
payload?: any;
|
|
25
26
|
recipientEnsName?: string;
|
|
26
27
|
recipientImageUrl?: string;
|
|
28
|
+
classes?: PanelOnrampPaymentClasses;
|
|
27
29
|
}
|
|
28
30
|
export declare function PanelOnrampPayment(props: PanelOnrampPaymentProps): import("react/jsx-runtime").JSX.Element;
|
|
29
31
|
export {};
|
|
@@ -11,7 +11,7 @@ export function PanelOnrampPayment(props) {
|
|
|
11
11
|
return (_jsx(AnySpendFingerprintWrapper, { fingerprint: fingerprintConfig, children: _jsx(PanelOnrampPaymentInner, { ...props }) }));
|
|
12
12
|
}
|
|
13
13
|
function PanelOnrampPaymentInner(props) {
|
|
14
|
-
const { srcAmountOnRamp, recipientAddress, isBuyMode, destinationTokenChainId, destinationTokenAddress, selectedDstChainId, selectedDstToken, anyspendQuote, globalAddress, onOrderCreated, onBack, orderType, nft, tournament, payload, recipientEnsName, recipientImageUrl, } = props;
|
|
14
|
+
const { srcAmountOnRamp, recipientAddress, isBuyMode, destinationTokenChainId, destinationTokenAddress, selectedDstChainId, selectedDstToken, anyspendQuote, globalAddress, onOrderCreated, onBack, orderType, nft, tournament, payload, recipientEnsName, recipientImageUrl, classes, } = props;
|
|
15
15
|
const { geoData, coinbaseOnrampOptions, coinbaseAvailablePaymentMethods, stripeOnrampSupport, stripeWeb2Support, isLoading: isLoadingGeoOnramp, } = useGeoOnrampOptions(srcAmountOnRamp);
|
|
16
16
|
const isLoading = isLoadingGeoOnramp;
|
|
17
17
|
const { createOrder, isCreatingOrder } = useAnyspendCreateOnrampOrder({
|
|
@@ -81,20 +81,24 @@ function PanelOnrampPaymentInner(props) {
|
|
|
81
81
|
toast.error("Failed to create order: " + err.message);
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
return (_jsxs("div", { className: "mx-auto flex w-full max-w-[460px] flex-col gap-6 px-5 pt-5", children: [_jsxs(_Fragment, { children: [_jsx("h2", { className: "-mb-3 text-lg font-semibold", children: "Order summary" }), _jsxs("div", { className:
|
|
84
|
+
return (_jsxs("div", { className: classes?.container || "mx-auto flex w-full max-w-[460px] flex-col gap-6 px-5 pt-5", children: [_jsxs(_Fragment, { children: [_jsx("h2", { className: classes?.summaryTitle || "-mb-3 text-lg font-semibold", children: "Order summary" }), _jsxs("div", { className: classes?.summaryCard ||
|
|
85
|
+
"bg-b3-react-background border-b3-react-border flex flex-col gap-3 rounded-lg border p-4", children: [recipientAddress && (_jsxs(motion.div, { initial: false, animate: {
|
|
85
86
|
opacity: 1,
|
|
86
87
|
y: 0,
|
|
87
88
|
filter: "blur(0px)",
|
|
88
|
-
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "flex items-center justify-between", children: [_jsx("p", { className: "text-b3-react-foreground/60", children: orderType === "swap"
|
|
89
|
+
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: classes?.summaryRow || "flex items-center justify-between", children: [_jsx("p", { className: classes?.summaryLabel || "text-b3-react-foreground/60", children: orderType === "swap"
|
|
89
90
|
? "Recipient"
|
|
90
91
|
: orderType === "mint_nft"
|
|
91
92
|
? "Receive NFT at"
|
|
92
93
|
: orderType === "join_tournament"
|
|
93
94
|
? "Join for"
|
|
94
|
-
: "Recipient" }), _jsxs("div", { className: "flex items-center gap-2", children: [recipientImageUrl && (_jsx("img", { src: recipientImageUrl, alt: recipientImageUrl, className: "bg-b3-react-foreground size-7 rounded-full object-cover opacity-100" })), _jsxs("div", { className: "flex flex-col items-end gap-1", children: [recipientEnsName && _jsxs("span", { className: "text-b3-react-foreground/80", children: ["@", recipientEnsName] }), _jsx("span", { className: "text-b3-react-foreground/80", children: centerTruncate(recipientAddress) })] })] })] })), _jsx("div", { className: "border-b3-react-border border-t pt-3", children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { className: "text-b3-react-foreground font-semibold", children: "Amount" }), _jsxs("div", { className: "flex flex-col items-end gap-0.5", children: [_jsxs("p", { className:
|
|
95
|
+
: "Recipient" }), _jsxs("div", { className: "flex items-center gap-2", children: [recipientImageUrl && (_jsx("img", { src: recipientImageUrl, alt: recipientImageUrl, className: "bg-b3-react-foreground size-7 rounded-full object-cover opacity-100" })), _jsxs("div", { className: "flex flex-col items-end gap-1", children: [recipientEnsName && (_jsxs("span", { className: classes?.summaryValue || "text-b3-react-foreground/80", children: ["@", recipientEnsName] })), _jsx("span", { className: classes?.summaryValue || "text-b3-react-foreground/80", children: centerTruncate(recipientAddress) })] })] })] })), _jsx("div", { className: classes?.summaryDivider || "border-b3-react-border border-t pt-3", children: _jsxs("div", { className: classes?.amountRow || "flex items-center justify-between", children: [_jsx("p", { className: classes?.summaryLabel || "text-b3-react-foreground font-semibold", children: "Amount" }), _jsxs("div", { className: "flex flex-col items-end gap-0.5", children: [_jsxs("p", { className: classes?.amountValue ||
|
|
96
|
+
"text-b3-react-foreground hover:text-b3-react-foreground/80 cursor-pointer text-xl font-semibold transition-colors", onClick: onBack, children: ["$", parseFloat(srcAmountOnRamp).toFixed(2)] }), anyspendQuote?.data?.fee?.type === "standard_fee" &&
|
|
95
97
|
anyspendQuote.data.currencyIn?.amountUsd &&
|
|
96
98
|
anyspendQuote.data.fee.finalFeeBps > 0 && (_jsxs("p", { className: "text-b3-react-foreground/60 text-xs", children: ["incl. $", ((Number(anyspendQuote.data.currencyIn.amountUsd) * anyspendQuote.data.fee.finalFeeBps) /
|
|
97
|
-
10000).toFixed(2), " ", "fee"] }))] })] }) })] })] }), isCreatingOrder ? (_jsxs("div", { className:
|
|
99
|
+
10000).toFixed(2), " ", "fee"] }))] })] }) })] })] }), isCreatingOrder ? (_jsxs("div", { className: classes?.loadingContainer ||
|
|
100
|
+
"bg-b3-react-background border-b3-react-border flex items-center justify-center gap-3 rounded-lg border p-6", children: [_jsx(Loader2, { className: classes?.loadingSpinner || "h-4 w-4 animate-spin" }), _jsx("span", { className: classes?.loadingText || "text-as-primary/70", children: "Creating onramp order..." })] })) : isLoading ? (_jsxs("div", { className: classes?.loadingContainer ||
|
|
101
|
+
"bg-b3-react-background border-b3-react-border flex items-center justify-center gap-3 rounded-lg border p-6", children: [_jsx(Loader2, { className: classes?.loadingSpinner || "h-4 w-4 animate-spin" }), _jsx("span", { className: classes?.loadingText || "text-as-primary/70", children: "Loading payment options..." })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mb-3 flex items-center justify-between", children: [_jsx("h2", { className: classes?.paymentMethodTitle || "text-lg font-semibold", children: "Payment method" }), _jsx("div", { className: "flex items-center gap-1", children: coinbaseAvailablePaymentMethods.length > 0 &&
|
|
98
102
|
(() => {
|
|
99
103
|
const hasCard = coinbaseAvailablePaymentMethods.some(m => m.id === "CARD");
|
|
100
104
|
const hasApplePay = coinbaseAvailablePaymentMethods.some(m => m.id === "APPLE_PAY");
|
|
@@ -103,6 +107,15 @@ function PanelOnrampPaymentInner(props) {
|
|
|
103
107
|
})() })] }), _jsxs("div", { className: "flex flex-col gap-3", children: [coinbaseAvailablePaymentMethods.length > 0 &&
|
|
104
108
|
(() => {
|
|
105
109
|
const method = coinbaseAvailablePaymentMethods[0];
|
|
106
|
-
return (_jsxs("button", { onClick: () => handlePaymentMethodClick("coinbase", method.id), disabled: isCreatingOrder, className:
|
|
107
|
-
|
|
110
|
+
return (_jsxs("button", { onClick: () => handlePaymentMethodClick("coinbase", method.id), disabled: isCreatingOrder, className: classes?.paymentOption ||
|
|
111
|
+
"bg-b3-react-background border-b3-react-border hover:border-as-brand disabled:hover:border-b3-react-border group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50", children: [_jsxs("div", { className: classes?.paymentOptionContent || "flex items-center gap-4", children: [_jsx("div", { className: classes?.paymentOptionIcon ||
|
|
112
|
+
"flex h-12 w-12 items-center justify-center rounded-full bg-blue-50", children: _jsx("img", { src: "https://cdn.b3.fun/coinbase-wordmark-blue.svg", alt: "Coinbase", className: "h-6" }) }), _jsxs("div", { className: "flex flex-col items-start text-left", children: [_jsx("h4", { className: classes?.paymentOptionTitle || "text-b3-react-foreground text-lg font-semibold", children: "Coinbase Pay" }), _jsxs("p", { className: classes?.paymentOptionDescription || "text-b3-react-foreground/60 text-sm", children: [method.id === "CARD" && "Debit card, bank account, or Coinbase Account", method.id === "FIAT_WALLET" && "Pay with your Coinbase account balance", method.id === "APPLE_PAY" && "Quick payment with Apple Pay", method.id === "ACH_BANK_ACCOUNT" && "Direct bank account transfer"] }), _jsx("div", { className: "mt-1 flex items-center gap-1", children: _jsx("span", { className: classes?.paymentOptionFee || "text-xs font-medium text-green-600", children: "Free" }) })] })] }), _jsx(ChevronRight, { className: classes?.paymentOptionChevron ||
|
|
113
|
+
"text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] }));
|
|
114
|
+
})(), stripeOnrampSupport && (_jsxs("button", { onClick: () => handlePaymentMethodClick("stripe"), className: classes?.paymentOption ||
|
|
115
|
+
"bg-b3-react-background border-b3-react-border hover:border-as-brand group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md", children: [_jsxs("div", { className: classes?.paymentOptionContent || "flex items-center gap-4", children: [_jsx("div", { className: classes?.paymentOptionIcon ||
|
|
116
|
+
"flex h-12 w-12 items-center justify-center rounded-full bg-purple-50", children: _jsx("img", { src: "https://raw.githubusercontent.com/stripe/stripe.github.io/455f506a628dc3f6c505e3001db45a64e29e9fc3/images/stripe-logo.svg", alt: "Stripe", className: "h-5" }) }), _jsxs("div", { className: "flex flex-col items-start text-left", children: [_jsx("h4", { className: classes?.paymentOptionTitle || "text-b3-react-foreground text-lg font-semibold", children: "Credit/Debit Card" }), _jsx("p", { className: classes?.paymentOptionDescription || "text-b3-react-foreground/60 text-sm", children: "Pay via Stripe checkout" }), stripeWeb2Support?.isSupport && stripeWeb2Support.formattedFeeUsd && (_jsx("div", { className: "mt-1", children: _jsxs("span", { className: classes?.paymentOptionFee || "text-xs text-gray-500", children: ["$", Number(stripeWeb2Support.formattedFeeUsd).toFixed(2), " fee"] }) }))] })] }), _jsx(ChevronRight, { className: classes?.paymentOptionChevron ||
|
|
117
|
+
"text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] })), stripeWeb2Support.isSupport && (_jsxs("button", { onClick: () => handlePaymentMethodClick("stripe-web2"), className: classes?.paymentOption ||
|
|
118
|
+
"bg-b3-react-background border-b3-react-border hover:border-as-brand group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md", children: [_jsxs("div", { className: classes?.paymentOptionContent || "flex items-center gap-4", children: [_jsx("div", { className: classes?.paymentOptionIcon ||
|
|
119
|
+
"flex h-12 w-12 items-center justify-center rounded-full bg-purple-50", children: _jsx("img", { src: "https://raw.githubusercontent.com/stripe/stripe.github.io/455f506a628dc3f6c505e3001db45a64e29e9fc3/images/stripe-logo.svg", alt: "Stripe", className: "h-5" }) }), _jsxs("div", { className: "flex flex-col items-start text-left", children: [_jsx("h4", { className: classes?.paymentOptionTitle || "text-b3-react-foreground text-lg font-semibold", children: "Quick Pay" }), _jsx("p", { className: classes?.paymentOptionDescription || "text-b3-react-foreground/60 text-sm", children: "Credit or debit card" }), stripeWeb2Support.formattedFeeUsd && (_jsx("div", { className: "mt-1", children: _jsxs("span", { className: classes?.paymentOptionFee || "text-xs text-gray-500", children: ["$", Number(stripeWeb2Support.formattedFeeUsd).toFixed(2), " fee"] }) }))] })] }), _jsx(ChevronRight, { className: classes?.paymentOptionChevron ||
|
|
120
|
+
"text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] })), _jsxs(Button, { variant: "link", onClick: onBack, className: classes?.backButton || "text-b3-react-foreground/70 hover:text-b3-react-foreground/90 mt-2 w-full", children: [_jsx(ChevronLeft, { className: "mr-2 h-4 w-4" }), "Back"] })] })] }))] }));
|
|
108
121
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { PointsDetailPanelClasses } from "../types/classes";
|
|
1
2
|
interface PointsDetailPanelProps {
|
|
2
3
|
pointsAmount?: number;
|
|
3
4
|
onBack: () => void;
|
|
5
|
+
classes?: PointsDetailPanelClasses;
|
|
4
6
|
}
|
|
5
|
-
export declare function PointsDetailPanel({ pointsAmount, onBack }: PointsDetailPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function PointsDetailPanel({ pointsAmount, onBack, classes }: PointsDetailPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export {};
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { ShinyButton } from "../../../../global-account/react/index.js";
|
|
3
3
|
import { cn } from "../../../../shared/utils/cn.js";
|
|
4
4
|
import Link from "next/link";
|
|
5
|
-
export function PointsDetailPanel({ pointsAmount = 0, onBack }) {
|
|
6
|
-
return (_jsx("div", { className: "mx-auto flex w-[460px] max-w-full flex-col items-center gap-4 px-5", children: _jsxs("div", { className: "flex flex-col items-center gap-4 text-center", children: [_jsx("h3", { className: "text-as-primary text-xl font-bold", children: "Earn Points with Every Swap" }), _jsxs("p", { className: "text-as-primary/70 text-balance text-sm leading-relaxed", children: ["You'll earn ", _jsxs("span", { className: "text-as-brand font-semibold", children: ["+", pointsAmount.toLocaleString(), " points"] }), " ", "towards the", " ", _jsx(Link, { href: "https://anyspend.com/points", target: "_blank", className: "text-as-brand underline", children: "next AnySpend airdrop" }), " ", "when you complete this transaction."] }), _jsxs("div", { className:
|
|
5
|
+
export function PointsDetailPanel({ pointsAmount = 0, onBack, classes }) {
|
|
6
|
+
return (_jsx("div", { className: classes?.container || "mx-auto flex w-[460px] max-w-full flex-col items-center gap-4 px-5", children: _jsxs("div", { className: "flex flex-col items-center gap-4 text-center", children: [_jsx("h3", { className: classes?.title || "text-as-primary text-xl font-bold", children: "Earn Points with Every Swap" }), _jsxs("p", { className: classes?.description || "text-as-primary/70 text-balance text-sm leading-relaxed", children: ["You'll earn", " ", _jsxs("span", { className: classes?.highlightText || "text-as-brand font-semibold", children: ["+", pointsAmount.toLocaleString(), " points"] }), " ", "towards the", " ", _jsx(Link, { href: "https://anyspend.com/points", target: "_blank", className: classes?.link || "text-as-brand underline", children: "next AnySpend airdrop" }), " ", "when you complete this transaction."] }), _jsxs("div", { className: classes?.infoCard ||
|
|
7
|
+
"bg-as-surface-primary border-as-border-secondary mt-2 w-full rounded-lg border p-4 text-left", children: [_jsx("h4", { className: classes?.infoCardTitle || "text-as-primary mb-2 font-semibold", children: "How it works:" }), _jsxs("ul", { className: classes?.infoList || "text-as-primary/70 space-y-1 text-sm", children: [_jsx("li", { className: classes?.infoListItem, children: "\u2022 Points are earned based on transaction volume" }), _jsx("li", { className: classes?.infoListItem, children: "\u2022 Higher volume = more points" }), _jsx("li", { className: classes?.infoListItem, children: "\u2022 Points contribute to future airdrops" }), _jsx("li", { className: classes?.infoListItem, children: "\u2022 Keep swapping to maximize your rewards" })] })] }), _jsx(ShinyButton, { accentColor: "hsl(var(--as-brand))", onClick: onBack, className: classes?.backButton || cn("as-main-button !bg-as-brand relative w-full"), textClassName: cn("text-white"), children: "Back to Swap" })] }) }));
|
|
7
8
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RecipientSelectionClasses } from "../types/classes";
|
|
1
2
|
export interface RecipientSelectionProps {
|
|
2
3
|
/**
|
|
3
4
|
* Initial recipient address value
|
|
@@ -38,5 +39,9 @@ export interface RecipientSelectionProps {
|
|
|
38
39
|
* @returns true if valid, false otherwise
|
|
39
40
|
*/
|
|
40
41
|
validateAddress?: (address: string) => boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Custom classes for styling
|
|
44
|
+
*/
|
|
45
|
+
classes?: RecipientSelectionClasses;
|
|
41
46
|
}
|
|
42
|
-
export declare function RecipientSelection({ initialValue, placeholder, title, description, confirmText, onBack, onConfirm, autoFocus, validateAddress, }: RecipientSelectionProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare function RecipientSelection({ initialValue, placeholder, title, description, confirmText, onBack, onConfirm, autoFocus, validateAddress, classes, }: RecipientSelectionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ChevronLeft } from "lucide-react";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
|
-
export function RecipientSelection({ initialValue = "", placeholder = "Enter recipient address", title = "Add recipient address or ENS", description = "Swap and send tokens to another address", confirmText = "Confirm recipient address", onBack, onConfirm, autoFocus = true, validateAddress, }) {
|
|
5
|
+
export function RecipientSelection({ initialValue = "", placeholder = "Enter recipient address", title = "Add recipient address or ENS", description = "Swap and send tokens to another address", confirmText = "Confirm recipient address", onBack, onConfirm, autoFocus = true, validateAddress, classes, }) {
|
|
6
6
|
const [recipientAddress, setRecipientAddress] = useState(initialValue);
|
|
7
7
|
// Update internal state when initialValue changes
|
|
8
8
|
useEffect(() => {
|
|
@@ -29,5 +29,8 @@ export function RecipientSelection({ initialValue = "", placeholder = "Enter rec
|
|
|
29
29
|
};
|
|
30
30
|
const isAddressValid = !validateAddress || !recipientAddress || validateAddress(recipientAddress);
|
|
31
31
|
const canConfirm = recipientAddress && isAddressValid;
|
|
32
|
-
return (_jsx("div", { className: "recipient-selection mx-auto w-[460px] max-w-full p-5", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("div", { className: "flex justify-around", children: [_jsx("button", { onClick: onBack, className:
|
|
32
|
+
return (_jsx("div", { className: classes?.container || "recipient-selection mx-auto w-[460px] max-w-full p-5", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("div", { className: classes?.header || "flex justify-around", children: [_jsx("button", { onClick: onBack, className: classes?.backButton ||
|
|
33
|
+
"text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors", children: _jsx(ChevronLeft, { className: "h-6 w-6" }) }), _jsxs("div", { className: "flex-1 text-center", children: [_jsx("h2", { className: "text-as-primary text-lg font-semibold", children: title }), _jsx("p", { className: "text-as-primary/60 text-sm", children: description })] })] }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "bg-as-surface-secondary border-as-border-secondary flex h-12 w-full overflow-hidden rounded-xl border", children: [_jsx("input", { type: "text", placeholder: placeholder, value: recipientAddress, onChange: e => setRecipientAddress(e.target.value), onKeyDown: handleKeyDown, className: classes?.searchInput ||
|
|
34
|
+
"text-as-primary placeholder:text-as-primary/50 flex-1 bg-transparent px-4 text-base focus:outline-none", autoFocus: autoFocus }), _jsx("div", { className: "border-as-border-secondary border-l", children: _jsx("button", { onClick: handlePaste, className: "text-as-primary/70 hover:text-as-primary hover:bg-as-surface-primary h-full px-4 font-semibold transition-colors", children: "Paste" }) })] }), recipientAddress && !isAddressValid && (_jsx("div", { className: "text-as-red text-sm", children: "Please enter a valid address" })), _jsx("button", { onClick: handleConfirm, disabled: !canConfirm, className: classes?.confirmButton ||
|
|
35
|
+
"bg-as-brand hover:bg-as-brand/90 disabled:bg-as-on-surface-2 disabled:text-as-secondary h-12 w-full rounded-xl font-medium text-white transition-colors disabled:cursor-not-allowed", children: confirmText })] })] }) }));
|
|
33
36
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
2
2
|
import { FiatPaymentMethod } from "./FiatPaymentMethod";
|
|
3
|
+
import type { TabSectionClasses } from "../types/classes";
|
|
3
4
|
interface TabSectionProps {
|
|
4
5
|
activeTab: "crypto" | "fiat";
|
|
5
6
|
setActiveTab: (tab: "crypto" | "fiat") => void;
|
|
6
7
|
setSelectedCryptoPaymentMethod: (method: CryptoPaymentMethodType) => void;
|
|
7
8
|
setSelectedFiatPaymentMethod: (method: FiatPaymentMethod) => void;
|
|
9
|
+
classes?: TabSectionClasses;
|
|
8
10
|
}
|
|
9
|
-
export declare function TabSection({ activeTab, setActiveTab, setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod, }: TabSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function TabSection({ activeTab, setActiveTab, setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod, classes, }: TabSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -2,14 +2,23 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from "../../../../shared/utils/cn.js";
|
|
3
3
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod.js";
|
|
4
4
|
import { FiatPaymentMethod } from "./FiatPaymentMethod.js";
|
|
5
|
-
export function TabSection({ activeTab, setActiveTab, setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod, }) {
|
|
6
|
-
return (_jsx("div", { className: "tab-section w-full", children: _jsxs("div", { className: "bg-as-surface-secondary relative mb-4 grid h-10 grid-cols-2 rounded-xl", children: [_jsx("div", { className: cn(
|
|
5
|
+
export function TabSection({ activeTab, setActiveTab, setSelectedCryptoPaymentMethod, setSelectedFiatPaymentMethod, classes, }) {
|
|
6
|
+
return (_jsx("div", { className: classes?.root || "tab-section w-full", children: _jsxs("div", { className: classes?.container || "bg-as-surface-secondary relative mb-4 grid h-10 grid-cols-2 rounded-xl", children: [_jsx("div", { className: cn(classes?.tabIndicator ||
|
|
7
|
+
"bg-as-brand absolute bottom-0 left-0 top-0 z-0 h-full w-1/2 rounded-xl transition-transform duration-100", activeTab === "fiat" ? "translate-x-full" : "translate-x-0"), style: { willChange: "transform" } }), _jsx("button", { className: cn(activeTab === "crypto"
|
|
8
|
+
? classes?.tabButtonActive ||
|
|
9
|
+
"relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium text-white transition-colors duration-100"
|
|
10
|
+
: classes?.tabButton ||
|
|
11
|
+
"text-as-primary/70 hover:bg-as-on-surface-2 relative z-10 h-full w-full rounded-xl bg-transparent px-3 text-sm font-medium transition-colors duration-100"), onClick: () => {
|
|
7
12
|
setActiveTab("crypto");
|
|
8
|
-
setSelectedCryptoPaymentMethod(CryptoPaymentMethodType.NONE);
|
|
9
|
-
setSelectedFiatPaymentMethod(FiatPaymentMethod.NONE);
|
|
10
|
-
}, children: "Pay with crypto" }), _jsx("button", { className: cn(
|
|
13
|
+
setSelectedCryptoPaymentMethod(CryptoPaymentMethodType.NONE);
|
|
14
|
+
setSelectedFiatPaymentMethod(FiatPaymentMethod.NONE);
|
|
15
|
+
}, children: "Pay with crypto" }), _jsx("button", { className: cn(activeTab === "fiat"
|
|
16
|
+
? classes?.tabButtonActive ||
|
|
17
|
+
"relative z-10 h-full w-full rounded-xl px-3 text-sm font-medium text-white transition-colors duration-100"
|
|
18
|
+
: classes?.tabButton ||
|
|
19
|
+
"text-as-primary/70 hover:bg-as-on-surface-2 relative z-10 h-full w-full rounded-xl bg-transparent px-3 text-sm font-medium transition-colors duration-100"), onClick: () => {
|
|
11
20
|
setActiveTab("fiat");
|
|
12
|
-
setSelectedCryptoPaymentMethod(CryptoPaymentMethodType.NONE);
|
|
13
|
-
setSelectedFiatPaymentMethod(FiatPaymentMethod.NONE);
|
|
21
|
+
setSelectedCryptoPaymentMethod(CryptoPaymentMethodType.NONE);
|
|
22
|
+
setSelectedFiatPaymentMethod(FiatPaymentMethod.NONE);
|
|
14
23
|
}, children: "Pay with Fiat" })] }) }));
|
|
15
24
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
|
|
3
|
+
import type { TransferCryptoDetailsClasses } from "../types/classes";
|
|
3
4
|
type Order = components["schemas"]["Order"];
|
|
4
5
|
type Token = components["schemas"]["Token"];
|
|
5
6
|
type Tournament = components["schemas"]["Tournament"];
|
|
@@ -13,6 +14,7 @@ interface TransferCryptoDetailsProps {
|
|
|
13
14
|
onBack: () => void;
|
|
14
15
|
recipientName?: string;
|
|
15
16
|
onPaymentMethodChange?: (method: CryptoPaymentMethodType) => void;
|
|
17
|
+
classes?: TransferCryptoDetailsClasses;
|
|
16
18
|
}
|
|
17
19
|
export declare const TransferCryptoDetails: import("react").NamedExoticComponent<TransferCryptoDetailsProps>;
|
|
18
20
|
export {};
|
|
@@ -12,7 +12,7 @@ import { b3 } from "viem/chains";
|
|
|
12
12
|
import { CryptoPaymentMethodType } from "./CryptoPaymentMethod.js";
|
|
13
13
|
import { OrderDetailsCollapsible } from "./OrderDetailsCollapsible.js";
|
|
14
14
|
import { PaymentMethodSwitch } from "./PaymentMethodSwitch.js";
|
|
15
|
-
export const TransferCryptoDetails = memo(function TransferCryptoDetails({ order, srcToken, dstToken, tournament, nft, onBack, recipientName, onPaymentMethodChange, }) {
|
|
15
|
+
export const TransferCryptoDetails = memo(function TransferCryptoDetails({ order, srcToken, dstToken, tournament, nft, onBack, recipientName, onPaymentMethodChange, classes, }) {
|
|
16
16
|
const [timeLeft, setTimeLeft] = useState(0);
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
const calculateTimeLeft = () => {
|
|
@@ -63,7 +63,8 @@ export const TransferCryptoDetails = memo(function TransferCryptoDetails({ order
|
|
|
63
63
|
navigator.clipboard.writeText(order.globalAddress);
|
|
64
64
|
toast.success("Deposit address copied to clipboard");
|
|
65
65
|
};
|
|
66
|
-
return (_jsxs("div", { className: "order-transfer-crypto flex w-full flex-col gap-6", children: [_jsxs("div", { className: "order-transfer-crypto-header flex items-center justify-between", children: [_jsx("button", { onClick: onBack, className:
|
|
66
|
+
return (_jsxs("div", { className: classes?.container || "order-transfer-crypto flex w-full flex-col gap-6", children: [_jsxs("div", { className: classes?.header || "order-transfer-crypto-header flex items-center justify-between", children: [_jsx("button", { onClick: onBack, className: classes?.backButton ||
|
|
67
|
+
"order-transfer-crypto-back-btn text-as-primary/60 hover:text-as-primary flex h-10 w-10 items-center justify-center rounded-full transition-colors", children: _jsx(ChevronLeft, { size: 24, className: "text-as-quaternary" }) }), _jsx("h2", { className: classes?.title || "order-transfer-crypto-title text-as-primary text-lg font-semibold", children: "Transfer crypto" }), _jsxs("div", { className: "order-transfer-crypto-timer relative flex h-11 w-11 items-center justify-center", children: [_jsxs("svg", { className: "order-transfer-crypto-timer-svg h-11 w-11 -rotate-90", viewBox: "0 0 44 44", children: [_jsx("circle", { cx: "22", cy: "22", r: "18", stroke: "currentColor", strokeWidth: "3", fill: "none", className: "order-transfer-crypto-timer-bg text-gray-200" }), _jsx("circle", { cx: "22", cy: "22", r: "18", stroke: "currentColor", strokeWidth: "3", fill: "none", strokeLinecap: "round", className: "order-transfer-crypto-timer-progress text-blue-500", strokeDasharray: `${2 * Math.PI * 18}`, strokeDashoffset: `${2 * Math.PI * 18 * (1 - timeLeft / totalTime)}`, style: {
|
|
67
68
|
transition: "stroke-dashoffset 1s linear",
|
|
68
69
|
} })] }), _jsx("div", { className: "order-transfer-crypto-timer-text absolute inset-0 flex items-center justify-center", children: _jsx("span", { className: "text-as-primary text-[10px] font-semibold", children: formatTime(timeLeft) }) })] })] }), _jsxs("div", { className: "order-transfer-crypto-content flex w-full flex-col gap-4", children: [_jsxs("div", { className: "order-transfer-crypto-cards flex items-center gap-4", children: [_jsxs("div", { className: "order-transfer-crypto-amount-card w-full", children: [_jsx("span", { className: "order-transfer-crypto-amount-label text-as-content-secondary text-sm font-medium", children: "Amount" }), _jsx("div", { className: "order-transfer-crypto-amount-container border-as-border-primary rounded-lg border p-2 shadow-sm", children: _jsx(CopyToClipboard, { text: roundedUpSrcAmount || "", onCopy: () => {
|
|
69
70
|
toast.success("Amount copied to clipboard");
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { ChainWarningTextClasses, WarningTextClasses } from "../types/classes";
|
|
1
2
|
export interface WarningTextProps {
|
|
2
3
|
/** The warning message content */
|
|
3
4
|
children: React.ReactNode;
|
|
4
|
-
/**
|
|
5
|
-
|
|
5
|
+
/** Custom classes for styling */
|
|
6
|
+
classes?: WarningTextClasses;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* A generic warning text component with consistent styling.
|
|
@@ -12,12 +13,12 @@ export interface WarningTextProps {
|
|
|
12
13
|
* Custom warning message
|
|
13
14
|
* </WarningText>
|
|
14
15
|
*/
|
|
15
|
-
export declare function WarningText({ children,
|
|
16
|
+
export declare function WarningText({ children, classes }: WarningTextProps): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export interface ChainWarningTextProps {
|
|
17
18
|
/** The chain ID to display warning for */
|
|
18
19
|
chainId: number;
|
|
19
|
-
/**
|
|
20
|
-
|
|
20
|
+
/** Custom classes for styling */
|
|
21
|
+
classes?: ChainWarningTextClasses;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* A chain-aware warning text component that displays chain-specific warnings.
|
|
@@ -27,6 +28,6 @@ export interface ChainWarningTextProps {
|
|
|
27
28
|
* <ChainWarningText chainId={HYPERLIQUID_CHAIN_ID} />
|
|
28
29
|
*
|
|
29
30
|
* @example
|
|
30
|
-
* <ChainWarningText chainId={destinationChainId}
|
|
31
|
+
* <ChainWarningText chainId={destinationChainId} classes={{ root: "my-custom-class" }} />
|
|
31
32
|
*/
|
|
32
|
-
export declare function ChainWarningText({ chainId,
|
|
33
|
+
export declare function ChainWarningText({ chainId, classes }: ChainWarningTextProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { HYPERLIQUID_CHAIN_ID } from "../../../../anyspend/index.js";
|
|
3
|
-
import { cn } from "../../../../shared/utils/cn.js";
|
|
4
3
|
/**
|
|
5
4
|
* A generic warning text component with consistent styling.
|
|
6
5
|
*
|
|
@@ -9,8 +8,8 @@ import { cn } from "../../../../shared/utils/cn.js";
|
|
|
9
8
|
* Custom warning message
|
|
10
9
|
* </WarningText>
|
|
11
10
|
*/
|
|
12
|
-
export function WarningText({ children,
|
|
13
|
-
return _jsx("p", { className:
|
|
11
|
+
export function WarningText({ children, classes }) {
|
|
12
|
+
return _jsx("p", { className: classes?.root || "anyspend-warning text-center text-xs italic text-red-500", children: children });
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
15
|
* A chain-aware warning text component that displays chain-specific warnings.
|
|
@@ -20,12 +19,12 @@ export function WarningText({ children, className }) {
|
|
|
20
19
|
* <ChainWarningText chainId={HYPERLIQUID_CHAIN_ID} />
|
|
21
20
|
*
|
|
22
21
|
* @example
|
|
23
|
-
* <ChainWarningText chainId={destinationChainId}
|
|
22
|
+
* <ChainWarningText chainId={destinationChainId} classes={{ root: "my-custom-class" }} />
|
|
24
23
|
*/
|
|
25
|
-
export function ChainWarningText({ chainId,
|
|
24
|
+
export function ChainWarningText({ chainId, classes }) {
|
|
26
25
|
// Chain-specific warning messages
|
|
27
26
|
if (chainId === HYPERLIQUID_CHAIN_ID) {
|
|
28
|
-
return (_jsxs(WarningText, {
|
|
27
|
+
return (_jsxs(WarningText, { classes: classes, children: ["Minimum deposit amount: ", _jsx("b", { children: "$1" })] }));
|
|
29
28
|
}
|
|
30
29
|
// No warning for this chain
|
|
31
30
|
return null;
|
|
@@ -6,6 +6,7 @@ export { AnySpendCustom } from "./AnySpendCustom";
|
|
|
6
6
|
export { AnySpendCustomExactIn } from "./AnySpendCustomExactIn";
|
|
7
7
|
export { AnySpendDeposit } from "./AnySpendDeposit";
|
|
8
8
|
export type { AnySpendDepositProps, ChainConfig, DepositContractConfig } from "./AnySpendDeposit";
|
|
9
|
+
export type { AnySpendAllClasses, AnySpendClasses, AnySpendCustomExactInClasses, AnySpendDepositClasses, CryptoPaymentMethodClasses, CryptoPaySectionClasses, CryptoReceiveSectionClasses, FiatPaymentMethodClasses, OrderDetailsClasses, PanelOnrampClasses, QRDepositClasses, RecipientSelectionClasses, } from "./types/classes";
|
|
9
10
|
export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
|
|
10
11
|
export * from "./AnySpendFingerprintWrapper";
|
|
11
12
|
export { AnySpendNFT } from "./AnySpendNFT";
|