@deframe-sdk/components 0.1.17 → 0.1.19
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 +151 -37
- package/dist/index.d.ts +151 -37
- package/dist/index.js +3080 -354
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3075 -357
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +477 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2393,6 +2393,69 @@ var LowRiskBadge = ({ className, label }) => {
|
|
|
2393
2393
|
}
|
|
2394
2394
|
) });
|
|
2395
2395
|
};
|
|
2396
|
+
var LoadingDots = ({ className = "" }) => {
|
|
2397
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: `flex gap-[var(--deframe-widget-size-gap-none)].5 ${className}`, children: [
|
|
2398
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "0ms", animationDuration: "1.4s" }, children: "." }),
|
|
2399
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "200ms", animationDuration: "1.4s" }, children: "." }),
|
|
2400
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "400ms", animationDuration: "1.4s" }, children: "." })
|
|
2401
|
+
] });
|
|
2402
|
+
};
|
|
2403
|
+
var ProcessingBadge = ({
|
|
2404
|
+
label = "Processing",
|
|
2405
|
+
className = "",
|
|
2406
|
+
title,
|
|
2407
|
+
size = "default"
|
|
2408
|
+
}) => {
|
|
2409
|
+
const isCompact = size === "compact";
|
|
2410
|
+
const baseClasses = [
|
|
2411
|
+
"inline-flex max-w-fit items-center gap-[var(--deframe-widget-size-gap-xs)] rounded-[var(--deframe-widget-size-radius-full)] border",
|
|
2412
|
+
"text-[color:var(--deframe-widget-color-state-info)]",
|
|
2413
|
+
"bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-info)_18%,transparent)]",
|
|
2414
|
+
"border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-info)_28%,transparent)]"
|
|
2415
|
+
].join(" ");
|
|
2416
|
+
const sizeClasses = {
|
|
2417
|
+
default: "px-[var(--deframe-widget-size-padding-x-sm)] py-[var(--deframe-widget-size-padding-y-xs)]",
|
|
2418
|
+
compact: "px-[calc(var(--deframe-widget-size-padding-x-xs)+2px)] py-[2px]"
|
|
2419
|
+
};
|
|
2420
|
+
const processingBadgeClasses = tailwindMerge.twMerge(
|
|
2421
|
+
baseClasses,
|
|
2422
|
+
sizeClasses[isCompact ? "compact" : "default"],
|
|
2423
|
+
className
|
|
2424
|
+
);
|
|
2425
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2426
|
+
"div",
|
|
2427
|
+
{
|
|
2428
|
+
"data-test-id": "processing-badge",
|
|
2429
|
+
title,
|
|
2430
|
+
className: processingBadgeClasses,
|
|
2431
|
+
children: [
|
|
2432
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-[6px]", children: [
|
|
2433
|
+
/* @__PURE__ */ jsxRuntime.jsx(hi2.HiOutlineClock, { className: isCompact ? "h-[12px] w-[12px] shrink-0" : "h-[14px] w-[14px] shrink-0" }),
|
|
2434
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2435
|
+
TextBody,
|
|
2436
|
+
{
|
|
2437
|
+
as: "span",
|
|
2438
|
+
variant: "text-small",
|
|
2439
|
+
className: tailwindMerge.twMerge(
|
|
2440
|
+
"truncate text-[color:var(--deframe-widget-color-state-info)]",
|
|
2441
|
+
isCompact ? "text-[11px] leading-[14px]" : ""
|
|
2442
|
+
),
|
|
2443
|
+
children: label
|
|
2444
|
+
}
|
|
2445
|
+
)
|
|
2446
|
+
] }),
|
|
2447
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2448
|
+
"span",
|
|
2449
|
+
{
|
|
2450
|
+
"aria-hidden": "true",
|
|
2451
|
+
className: "flex shrink-0 items-center text-[color:var(--deframe-widget-color-state-info)] opacity-80",
|
|
2452
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(LoadingDots, { className: tailwindMerge.twMerge(isCompact ? "text-[11px] leading-[14px]" : "text-[12px] leading-[16px]") })
|
|
2453
|
+
}
|
|
2454
|
+
)
|
|
2455
|
+
]
|
|
2456
|
+
}
|
|
2457
|
+
);
|
|
2458
|
+
};
|
|
2396
2459
|
var gapClasses3 = {
|
|
2397
2460
|
xs: "gap-[var(--deframe-widget-size-gap-xs)]",
|
|
2398
2461
|
sm: "gap-[var(--deframe-widget-size-gap-sm)]",
|
|
@@ -2419,10 +2482,35 @@ var TokenIcon = ({ src, alt }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
2419
2482
|
}
|
|
2420
2483
|
}
|
|
2421
2484
|
);
|
|
2422
|
-
var
|
|
2423
|
-
|
|
2485
|
+
var STATUS_STYLES = {
|
|
2486
|
+
success: {
|
|
2487
|
+
bg: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-success)_12%,transparent)]",
|
|
2488
|
+
dot: "bg-[var(--deframe-widget-color-state-success)]"
|
|
2489
|
+
},
|
|
2490
|
+
pending: {
|
|
2491
|
+
bg: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-warning)_12%,transparent)]",
|
|
2492
|
+
dot: "bg-[var(--deframe-widget-color-state-warning)]"
|
|
2493
|
+
},
|
|
2494
|
+
failed: {
|
|
2495
|
+
bg: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_12%,transparent)]",
|
|
2496
|
+
dot: "bg-[var(--deframe-widget-color-state-error)]"
|
|
2497
|
+
},
|
|
2498
|
+
refunded: {
|
|
2499
|
+
bg: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-text-secondary)_12%,transparent)]",
|
|
2500
|
+
dot: "bg-[var(--deframe-widget-color-text-secondary)]"
|
|
2501
|
+
}
|
|
2502
|
+
};
|
|
2503
|
+
function resolveStatusBadgeTone(status = "SUCCESS") {
|
|
2504
|
+
if (status === "PENDING") return "pending";
|
|
2505
|
+
if (status === "FAILED") return "failed";
|
|
2506
|
+
if (status === "REFUNDED") return "refunded";
|
|
2507
|
+
return "success";
|
|
2508
|
+
}
|
|
2509
|
+
var StatusBadge = ({ children, tone = "success" }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "status-badge", className: `${STATUS_STYLES[tone].bg} flex items-center gap-[var(--deframe-widget-size-gap-xs)] px-[var(--deframe-widget-size-padding-x-sm)] py-[var(--deframe-widget-size-padding-y-xs)] rounded-[var(--deframe-widget-size-radius-lg)]`, children: [
|
|
2510
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `w-2 h-2 rounded-[var(--deframe-widget-size-radius-full)] ${STATUS_STYLES[tone].dot}` }),
|
|
2424
2511
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-primary)]", children })
|
|
2425
2512
|
] });
|
|
2513
|
+
var SuccessBadge = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { tone: "success", children });
|
|
2426
2514
|
var truncateHash = (hash, chars = 6) => {
|
|
2427
2515
|
if (hash.length <= chars * 2 + 3) return hash;
|
|
2428
2516
|
return `${hash.slice(0, chars + 2)}...${hash.slice(-chars)}`;
|
|
@@ -2459,6 +2547,84 @@ var TwoLineValue = ({ primary, secondary }) => /* @__PURE__ */ jsxRuntime.jsxs(H
|
|
|
2459
2547
|
/* @__PURE__ */ jsxRuntime.jsx("p", { "data-test-id": "two-line-value-secondary", className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-secondary)]", children: secondary })
|
|
2460
2548
|
] });
|
|
2461
2549
|
var NotFoundMessage = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "not-found-message", className: "flex flex-col items-center justify-center h-full", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[color:var(--deframe-widget-color-text-primary)]", children }) });
|
|
2550
|
+
function StepStatusIcon({ status }) {
|
|
2551
|
+
switch (status) {
|
|
2552
|
+
case "completed":
|
|
2553
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-tertiary)] flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(io5.IoCheckmarkOutline, { className: "w-4 h-4 text-[color:var(--deframe-widget-color-state-success)]" }) });
|
|
2554
|
+
case "processing":
|
|
2555
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-tertiary)] flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(io5.IoTimeOutline, { className: "w-4 h-4 text-[color:var(--deframe-widget-color-state-warning)]" }) });
|
|
2556
|
+
case "failed":
|
|
2557
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-tertiary)] flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(io5.IoAlertCircleOutline, { className: "w-4 h-4 text-[color:var(--deframe-widget-color-state-error)]" }) });
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
function StepStatusText({
|
|
2561
|
+
step,
|
|
2562
|
+
completedText,
|
|
2563
|
+
processingText,
|
|
2564
|
+
failedText,
|
|
2565
|
+
viewOnExplorerText
|
|
2566
|
+
}) {
|
|
2567
|
+
if (step.statusText) {
|
|
2568
|
+
const textColorClass2 = step.status === "completed" ? "text-[color:var(--deframe-widget-color-text-primary)]" : step.status === "processing" ? "text-[color:var(--deframe-widget-color-text-secondary)]" : step.status === "failed" ? "text-[color:var(--deframe-widget-color-state-error)]" : "text-[color:var(--deframe-widget-color-text-primary-disabled)]";
|
|
2569
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] ${textColorClass2}`, children: step.statusText });
|
|
2570
|
+
}
|
|
2571
|
+
if (step.status === "completed" && step.explorerUrl) {
|
|
2572
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2573
|
+
"a",
|
|
2574
|
+
{
|
|
2575
|
+
href: step.explorerUrl,
|
|
2576
|
+
target: "_blank",
|
|
2577
|
+
rel: "noopener noreferrer",
|
|
2578
|
+
className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-brand-primary)] underline hover:no-underline",
|
|
2579
|
+
children: viewOnExplorerText
|
|
2580
|
+
}
|
|
2581
|
+
);
|
|
2582
|
+
}
|
|
2583
|
+
const defaultText = step.status === "completed" ? completedText : step.status === "processing" ? processingText : failedText;
|
|
2584
|
+
const textColorClass = step.status === "completed" ? "text-[color:var(--deframe-widget-color-text-primary)]" : step.status === "processing" ? "text-[color:var(--deframe-widget-color-text-secondary)]" : "text-[color:var(--deframe-widget-color-state-error)]";
|
|
2585
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] ${textColorClass}`, children: defaultText });
|
|
2586
|
+
}
|
|
2587
|
+
function StepDisplay({ step, completedText, processingText, failedText, viewOnExplorerText }) {
|
|
2588
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-[var(--deframe-widget-size-gap-md)] w-full", children: [
|
|
2589
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-primary)] [font-weight:var(--deframe-widget-font-weight-medium)]", children: step.label }) }),
|
|
2590
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: step.value ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-secondary)]", children: step.value }) : /* @__PURE__ */ jsxRuntime.jsx(StepStatusText, { step, completedText, processingText, failedText, viewOnExplorerText }) })
|
|
2591
|
+
] });
|
|
2592
|
+
}
|
|
2593
|
+
function TransactionProcessingDetails({
|
|
2594
|
+
steps,
|
|
2595
|
+
className = "bg-[var(--deframe-widget-color-bg-secondary)] lg:!bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
2596
|
+
defaultOpen = true,
|
|
2597
|
+
labels
|
|
2598
|
+
}) {
|
|
2599
|
+
if (!steps || steps.length === 0) {
|
|
2600
|
+
return null;
|
|
2601
|
+
}
|
|
2602
|
+
const getProcessingSteps = () => {
|
|
2603
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col w-full", children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
2604
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
2605
|
+
step.status && /* @__PURE__ */ jsxRuntime.jsx(StepStatusIcon, { status: step.status }),
|
|
2606
|
+
index < steps.length - 1 && step.status && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px flex-1 min-h-[16px] bg-[var(--deframe-widget-color-bg-primary-dark)] my-[var(--deframe-widget-size-gap-xs)]" })
|
|
2607
|
+
] }),
|
|
2608
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 pb-[var(--deframe-widget-size-padding-y-sm)] min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(StepDisplay, { step, completedText: labels.completedText, processingText: labels.processingText, failedText: labels.failedText, viewOnExplorerText: labels.viewOnExplorerText }) })
|
|
2609
|
+
] }, `step-${index}`)) });
|
|
2610
|
+
};
|
|
2611
|
+
const items = [
|
|
2612
|
+
{
|
|
2613
|
+
label: "",
|
|
2614
|
+
value: getProcessingSteps(),
|
|
2615
|
+
valueClassName: "flex flex-col gap-[var(--deframe-widget-size-gap-none)] w-full"
|
|
2616
|
+
}
|
|
2617
|
+
];
|
|
2618
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2619
|
+
SummaryDetails,
|
|
2620
|
+
{
|
|
2621
|
+
title: labels.title,
|
|
2622
|
+
items,
|
|
2623
|
+
defaultOpen,
|
|
2624
|
+
className
|
|
2625
|
+
}
|
|
2626
|
+
);
|
|
2627
|
+
}
|
|
2462
2628
|
var HistoryDepositDetailsView = ({
|
|
2463
2629
|
transactionTypeLabel,
|
|
2464
2630
|
symbol,
|
|
@@ -2473,6 +2639,9 @@ var HistoryDepositDetailsView = ({
|
|
|
2473
2639
|
txHash,
|
|
2474
2640
|
date,
|
|
2475
2641
|
explorerUrl,
|
|
2642
|
+
status = "SUCCESS",
|
|
2643
|
+
processingSteps,
|
|
2644
|
+
processingDetailsLabels,
|
|
2476
2645
|
onClose,
|
|
2477
2646
|
labels
|
|
2478
2647
|
}) => {
|
|
@@ -2531,7 +2700,7 @@ var HistoryDepositDetailsView = ({
|
|
|
2531
2700
|
] }),
|
|
2532
2701
|
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2533
2702
|
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.statusLabel }),
|
|
2534
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2703
|
+
/* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { tone: resolveStatusBadgeTone(status), children: statusLabel })
|
|
2535
2704
|
] }),
|
|
2536
2705
|
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2537
2706
|
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.transactionIdLabel }),
|
|
@@ -2545,7 +2714,15 @@ var HistoryDepositDetailsView = ({
|
|
|
2545
2714
|
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.transactionLabel }),
|
|
2546
2715
|
/* @__PURE__ */ jsxRuntime.jsx(ExplorerLink, { href: explorerUrl, children: labels.viewOnExplorerLabel })
|
|
2547
2716
|
] })
|
|
2548
|
-
] }) })
|
|
2717
|
+
] }) }),
|
|
2718
|
+
(processingSteps == null ? void 0 : processingSteps.length) && processingDetailsLabels ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2719
|
+
TransactionProcessingDetails,
|
|
2720
|
+
{
|
|
2721
|
+
steps: processingSteps,
|
|
2722
|
+
labels: processingDetailsLabels,
|
|
2723
|
+
defaultOpen: true
|
|
2724
|
+
}
|
|
2725
|
+
) : null
|
|
2549
2726
|
] }) })
|
|
2550
2727
|
] });
|
|
2551
2728
|
};
|
|
@@ -2563,6 +2740,9 @@ var HistoryWithdrawDetailsView = ({
|
|
|
2563
2740
|
txHash,
|
|
2564
2741
|
date,
|
|
2565
2742
|
explorerUrl,
|
|
2743
|
+
status = "SUCCESS",
|
|
2744
|
+
processingSteps,
|
|
2745
|
+
processingDetailsLabels,
|
|
2566
2746
|
onClose,
|
|
2567
2747
|
labels
|
|
2568
2748
|
}) => {
|
|
@@ -2621,7 +2801,7 @@ var HistoryWithdrawDetailsView = ({
|
|
|
2621
2801
|
] }),
|
|
2622
2802
|
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2623
2803
|
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.statusLabel }),
|
|
2624
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2804
|
+
/* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { tone: resolveStatusBadgeTone(status), children: statusLabel })
|
|
2625
2805
|
] }),
|
|
2626
2806
|
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2627
2807
|
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.transactionIdLabel }),
|
|
@@ -2635,7 +2815,15 @@ var HistoryWithdrawDetailsView = ({
|
|
|
2635
2815
|
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.transactionLabel }),
|
|
2636
2816
|
/* @__PURE__ */ jsxRuntime.jsx(ExplorerLink, { href: explorerUrl, children: labels.viewOnExplorerLabel })
|
|
2637
2817
|
] })
|
|
2638
|
-
] }) })
|
|
2818
|
+
] }) }),
|
|
2819
|
+
(processingSteps == null ? void 0 : processingSteps.length) && processingDetailsLabels ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2820
|
+
TransactionProcessingDetails,
|
|
2821
|
+
{
|
|
2822
|
+
steps: processingSteps,
|
|
2823
|
+
labels: processingDetailsLabels,
|
|
2824
|
+
defaultOpen: true
|
|
2825
|
+
}
|
|
2826
|
+
) : null
|
|
2639
2827
|
] }) })
|
|
2640
2828
|
] });
|
|
2641
2829
|
};
|
|
@@ -2811,13 +2999,6 @@ var ProgressIndicator = ({
|
|
|
2811
2999
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 h-[4px] bg-[var(--deframe-widget-color-bg-tertiary)] rounded-[var(--deframe-widget-size-radius-md)] ml-[var(--deframe-widget-size-gap-xs)]" })
|
|
2812
3000
|
] }) });
|
|
2813
3001
|
};
|
|
2814
|
-
var LoadingDots = ({ className = "" }) => {
|
|
2815
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: `flex gap-[var(--deframe-widget-size-gap-none)].5 ${className}`, children: [
|
|
2816
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "0ms", animationDuration: "1.4s" }, children: "." }),
|
|
2817
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "200ms", animationDuration: "1.4s" }, children: "." }),
|
|
2818
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-bounce", style: { animationDelay: "400ms", animationDuration: "1.4s" }, children: "." })
|
|
2819
|
-
] });
|
|
2820
|
-
};
|
|
2821
3002
|
var SearchInput = ({
|
|
2822
3003
|
placeholder = "Search",
|
|
2823
3004
|
value: controlledValue,
|
|
@@ -3013,84 +3194,6 @@ var TransactionScreenInvestmentCard = ({
|
|
|
3013
3194
|
] })
|
|
3014
3195
|
] }) });
|
|
3015
3196
|
};
|
|
3016
|
-
function StepStatusIcon({ status }) {
|
|
3017
|
-
switch (status) {
|
|
3018
|
-
case "completed":
|
|
3019
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-tertiary)] flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(io5.IoCheckmarkOutline, { className: "w-4 h-4 text-[color:var(--deframe-widget-color-state-success)]" }) });
|
|
3020
|
-
case "processing":
|
|
3021
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-tertiary)] flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(io5.IoTimeOutline, { className: "w-4 h-4 text-[color:var(--deframe-widget-color-state-warning)]" }) });
|
|
3022
|
-
case "failed":
|
|
3023
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-tertiary)] flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(io5.IoAlertCircleOutline, { className: "w-4 h-4 text-[color:var(--deframe-widget-color-state-error)]" }) });
|
|
3024
|
-
}
|
|
3025
|
-
}
|
|
3026
|
-
function StepStatusText({
|
|
3027
|
-
step,
|
|
3028
|
-
completedText,
|
|
3029
|
-
processingText,
|
|
3030
|
-
failedText,
|
|
3031
|
-
viewOnExplorerText
|
|
3032
|
-
}) {
|
|
3033
|
-
if (step.statusText) {
|
|
3034
|
-
const textColorClass2 = step.status === "completed" ? "text-[color:var(--deframe-widget-color-text-primary)]" : step.status === "processing" ? "text-[color:var(--deframe-widget-color-text-secondary)]" : step.status === "failed" ? "text-[color:var(--deframe-widget-color-state-error)]" : "text-[color:var(--deframe-widget-color-text-primary-disabled)]";
|
|
3035
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] ${textColorClass2}`, children: step.statusText });
|
|
3036
|
-
}
|
|
3037
|
-
if (step.status === "completed" && step.explorerUrl) {
|
|
3038
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3039
|
-
"a",
|
|
3040
|
-
{
|
|
3041
|
-
href: step.explorerUrl,
|
|
3042
|
-
target: "_blank",
|
|
3043
|
-
rel: "noopener noreferrer",
|
|
3044
|
-
className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-brand-primary)] underline hover:no-underline",
|
|
3045
|
-
children: viewOnExplorerText
|
|
3046
|
-
}
|
|
3047
|
-
);
|
|
3048
|
-
}
|
|
3049
|
-
const defaultText = step.status === "completed" ? completedText : step.status === "processing" ? processingText : failedText;
|
|
3050
|
-
const textColorClass = step.status === "completed" ? "text-[color:var(--deframe-widget-color-text-primary)]" : step.status === "processing" ? "text-[color:var(--deframe-widget-color-text-secondary)]" : "text-[color:var(--deframe-widget-color-state-error)]";
|
|
3051
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] ${textColorClass}`, children: defaultText });
|
|
3052
|
-
}
|
|
3053
|
-
function StepDisplay({ step, completedText, processingText, failedText, viewOnExplorerText }) {
|
|
3054
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-[var(--deframe-widget-size-gap-md)] w-full", children: [
|
|
3055
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-primary)] [font-weight:var(--deframe-widget-font-weight-medium)]", children: step.label }) }),
|
|
3056
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: step.value ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-secondary)]", children: step.value }) : /* @__PURE__ */ jsxRuntime.jsx(StepStatusText, { step, completedText, processingText, failedText, viewOnExplorerText }) })
|
|
3057
|
-
] });
|
|
3058
|
-
}
|
|
3059
|
-
function TransactionProcessingDetails({
|
|
3060
|
-
steps,
|
|
3061
|
-
className = "bg-[var(--deframe-widget-color-bg-secondary)] lg:!bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
3062
|
-
defaultOpen = true,
|
|
3063
|
-
labels
|
|
3064
|
-
}) {
|
|
3065
|
-
if (!steps || steps.length === 0) {
|
|
3066
|
-
return null;
|
|
3067
|
-
}
|
|
3068
|
-
const getProcessingSteps = () => {
|
|
3069
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col w-full", children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
3070
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
3071
|
-
step.status && /* @__PURE__ */ jsxRuntime.jsx(StepStatusIcon, { status: step.status }),
|
|
3072
|
-
index < steps.length - 1 && step.status && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px flex-1 min-h-[16px] bg-[var(--deframe-widget-color-bg-primary-dark)] my-[var(--deframe-widget-size-gap-xs)]" })
|
|
3073
|
-
] }),
|
|
3074
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 pb-[var(--deframe-widget-size-padding-y-sm)] min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(StepDisplay, { step, completedText: labels.completedText, processingText: labels.processingText, failedText: labels.failedText, viewOnExplorerText: labels.viewOnExplorerText }) })
|
|
3075
|
-
] }, `step-${index}`)) });
|
|
3076
|
-
};
|
|
3077
|
-
const items = [
|
|
3078
|
-
{
|
|
3079
|
-
label: "",
|
|
3080
|
-
value: getProcessingSteps(),
|
|
3081
|
-
valueClassName: "flex flex-col gap-[var(--deframe-widget-size-gap-none)] w-full"
|
|
3082
|
-
}
|
|
3083
|
-
];
|
|
3084
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3085
|
-
SummaryDetails,
|
|
3086
|
-
{
|
|
3087
|
-
title: labels.title,
|
|
3088
|
-
items,
|
|
3089
|
-
defaultOpen,
|
|
3090
|
-
className
|
|
3091
|
-
}
|
|
3092
|
-
);
|
|
3093
|
-
}
|
|
3094
3197
|
var TokenWithChainBadge = ({
|
|
3095
3198
|
tokenLogoUrl,
|
|
3096
3199
|
tokenAlt,
|
|
@@ -3204,41 +3307,159 @@ var SwapProcessingView = ({
|
|
|
3204
3307
|
}
|
|
3205
3308
|
);
|
|
3206
3309
|
};
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3310
|
+
|
|
3311
|
+
// src/stories/swap-form-view/constants.ts
|
|
3312
|
+
var SWAP_SIMPLE_MIN_HEIGHT = 520;
|
|
3313
|
+
var SWAP_SIMPLE_WIDTH = 480;
|
|
3314
|
+
function SwapFormSkeleton() {
|
|
3212
3315
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3213
|
-
|
|
3316
|
+
"div",
|
|
3214
3317
|
{
|
|
3215
|
-
"data-test-id": "swap-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3318
|
+
"data-test-id": "swap-form-skeleton",
|
|
3319
|
+
className: tailwindMerge.twMerge(
|
|
3320
|
+
"relative",
|
|
3321
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
3322
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
3323
|
+
"flex flex-col items-stretch gap-[var(--deframe-widget-size-gap-sm)]",
|
|
3324
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
3325
|
+
),
|
|
3326
|
+
style: { minHeight: SWAP_SIMPLE_MIN_HEIGHT },
|
|
3223
3327
|
children: [
|
|
3224
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
3328
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-form-skeleton-history", className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-9 h-9 rounded-[var(--deframe-widget-size-radius-full)] border border-[color:var(--deframe-widget-color-border-secondary)]" }) }),
|
|
3225
3329
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3226
|
-
|
|
3330
|
+
SkeletonCard,
|
|
3227
3331
|
{
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3332
|
+
testId: "swap-form-skeleton-from",
|
|
3333
|
+
symbol: "USDC",
|
|
3334
|
+
network: "ARBITRUM",
|
|
3335
|
+
amount: "500",
|
|
3336
|
+
usd: "\u2248 $499.87",
|
|
3337
|
+
balance: "Saldo: 1 250.00 USDC"
|
|
3232
3338
|
}
|
|
3233
3339
|
),
|
|
3340
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-form-skeleton-swap-btn-wrapper", className: "flex justify-center -my-[16px] relative z-[1]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3341
|
+
"div",
|
|
3342
|
+
{
|
|
3343
|
+
className: tailwindMerge.twMerge(
|
|
3344
|
+
"w-10 h-10",
|
|
3345
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
3346
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
3347
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
3348
|
+
"flex items-center justify-center",
|
|
3349
|
+
"text-[color:var(--deframe-widget-color-brand-primary)]"
|
|
3350
|
+
),
|
|
3351
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
3352
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
3353
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "19 12 12 19 5 12" })
|
|
3354
|
+
] })
|
|
3355
|
+
}
|
|
3356
|
+
) }),
|
|
3234
3357
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3235
|
-
|
|
3358
|
+
SkeletonCard,
|
|
3236
3359
|
{
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3360
|
+
testId: "swap-form-skeleton-to",
|
|
3361
|
+
symbol: "ETH",
|
|
3362
|
+
network: "ETHEREUM",
|
|
3363
|
+
amount: "0.2061",
|
|
3364
|
+
usd: "\u2248 $499.00",
|
|
3365
|
+
balance: "Saldo: 41 ETH"
|
|
3366
|
+
}
|
|
3367
|
+
),
|
|
3368
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
|
|
3369
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3370
|
+
"div",
|
|
3371
|
+
{
|
|
3372
|
+
"data-test-id": "swap-form-skeleton-submit",
|
|
3373
|
+
className: tailwindMerge.twMerge(
|
|
3374
|
+
"h-12",
|
|
3375
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
3376
|
+
"bg-[var(--deframe-widget-color-brand-primary)]",
|
|
3377
|
+
"flex items-center justify-center",
|
|
3378
|
+
"text-[15px] [font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
3379
|
+
"text-[color:var(--deframe-widget-color-text-primary-dark)]"
|
|
3380
|
+
),
|
|
3381
|
+
children: "Revisar Troca"
|
|
3382
|
+
}
|
|
3383
|
+
)
|
|
3384
|
+
]
|
|
3385
|
+
}
|
|
3386
|
+
);
|
|
3387
|
+
}
|
|
3388
|
+
function SkeletonCard({ testId, symbol, network, amount, usd, balance }) {
|
|
3389
|
+
const initials = symbol.slice(0, 2).toUpperCase();
|
|
3390
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3391
|
+
"div",
|
|
3392
|
+
{
|
|
3393
|
+
"data-test-id": testId,
|
|
3394
|
+
className: tailwindMerge.twMerge(
|
|
3395
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
3396
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
3397
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]"
|
|
3398
|
+
),
|
|
3399
|
+
children: [
|
|
3400
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
3401
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex items-center gap-[10px] flex-shrink-0", children: [
|
|
3402
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-shrink-0", style: { width: 38, height: 38 }, children: [
|
|
3403
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3404
|
+
"div",
|
|
3405
|
+
{
|
|
3406
|
+
className: "w-[38px] h-[38px] rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-brand-primary)] flex items-center justify-center text-[13px] [font-weight:var(--deframe-widget-font-weight-bold)] text-[color:var(--deframe-widget-color-text-primary-dark)]",
|
|
3407
|
+
children: initials
|
|
3408
|
+
}
|
|
3409
|
+
),
|
|
3410
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute -bottom-0.5 -right-0.5 w-4 h-4 rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-tertiary)] shadow-[0_0_0_2px_var(--deframe-widget-color-bg-secondary)] flex items-center justify-center text-[7px] [font-weight:var(--deframe-widget-font-weight-bold)] text-[color:var(--deframe-widget-color-text-primary-dark)]", children: network.slice(0, 2) })
|
|
3411
|
+
] }),
|
|
3412
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start", children: [
|
|
3413
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[16px] [font-weight:var(--deframe-widget-font-weight-semibold)] leading-[1.2] text-[color:var(--deframe-widget-color-text-primary)]", children: symbol }),
|
|
3414
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] text-[color:var(--deframe-widget-color-text-tertiary)] uppercase tracking-[0.04em] leading-[1.2]", children: network })
|
|
3415
|
+
] })
|
|
3416
|
+
] }),
|
|
3417
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-10 bg-[var(--deframe-widget-color-border-secondary)] flex-shrink-0" }),
|
|
3418
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-end flex-1 min-w-0", children: [
|
|
3419
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[36px] [font-weight:var(--deframe-widget-font-weight-semibold)] [line-height:1.1] text-[color:var(--deframe-widget-color-text-primary)] text-right w-full", children: amount }),
|
|
3420
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)]", children: usd })
|
|
3421
|
+
] })
|
|
3422
|
+
] }),
|
|
3423
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)]", children: balance }) })
|
|
3424
|
+
]
|
|
3425
|
+
}
|
|
3426
|
+
);
|
|
3427
|
+
}
|
|
3428
|
+
function LoadingIcon() {
|
|
3429
|
+
const green = "var(--deframe-widget-color-brand-primary)";
|
|
3430
|
+
const trackColor = "color-mix(in srgb, var(--deframe-widget-color-brand-primary) 12%, transparent)";
|
|
3431
|
+
const sw = 2.8;
|
|
3432
|
+
const aw = 2.4;
|
|
3433
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3434
|
+
framerMotion.motion.svg,
|
|
3435
|
+
{
|
|
3436
|
+
"data-test-id": "swap-processing-simple-loading-icon",
|
|
3437
|
+
width: "56",
|
|
3438
|
+
height: "56",
|
|
3439
|
+
viewBox: "0 0 56 56",
|
|
3440
|
+
fill: "none",
|
|
3441
|
+
"aria-hidden": "true",
|
|
3442
|
+
animate: { rotate: 360 },
|
|
3443
|
+
transition: { duration: 1.6, repeat: Infinity, ease: "linear" },
|
|
3444
|
+
children: [
|
|
3445
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "28", cy: "28", r: "22", stroke: trackColor, strokeWidth: sw }),
|
|
3446
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3447
|
+
"path",
|
|
3448
|
+
{
|
|
3449
|
+
d: "M 6.75 22.31 A 22 22 0 0 1 49.25 22.31",
|
|
3450
|
+
stroke: green,
|
|
3451
|
+
strokeWidth: sw,
|
|
3452
|
+
strokeLinecap: "round"
|
|
3453
|
+
}
|
|
3454
|
+
),
|
|
3455
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3456
|
+
"path",
|
|
3457
|
+
{
|
|
3458
|
+
d: "M 45.0 18.1 L 49.25 22.31 L 51.0 16.5",
|
|
3459
|
+
stroke: green,
|
|
3460
|
+
strokeWidth: aw,
|
|
3461
|
+
strokeLinecap: "round",
|
|
3462
|
+
strokeLinejoin: "round"
|
|
3242
3463
|
}
|
|
3243
3464
|
),
|
|
3244
3465
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3264,72 +3485,68 @@ function LoadingIcon() {
|
|
|
3264
3485
|
}
|
|
3265
3486
|
);
|
|
3266
3487
|
}
|
|
3267
|
-
var SwapProcessingViewSimple = ({
|
|
3268
|
-
titleText,
|
|
3269
|
-
descriptionPrefix,
|
|
3270
|
-
activityHistoryText,
|
|
3271
|
-
onGoToHistory
|
|
3272
|
-
}) => {
|
|
3488
|
+
var SwapProcessingViewSimple = () => {
|
|
3273
3489
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3274
3490
|
"div",
|
|
3275
3491
|
{
|
|
3276
|
-
"data-test-id": "swap-processing-simple-
|
|
3492
|
+
"data-test-id": "swap-processing-simple-wrapper",
|
|
3277
3493
|
className: tailwindMerge.twMerge(
|
|
3278
|
-
"
|
|
3279
|
-
|
|
3280
|
-
"
|
|
3281
|
-
"
|
|
3282
|
-
"
|
|
3283
|
-
"
|
|
3284
|
-
"bg-[color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)]"
|
|
3494
|
+
"relative overflow-hidden",
|
|
3495
|
+
`w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] box-border`,
|
|
3496
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
3497
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
3498
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
3499
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
3285
3500
|
),
|
|
3501
|
+
style: { minHeight: SWAP_SIMPLE_MIN_HEIGHT },
|
|
3286
3502
|
children: [
|
|
3287
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3503
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-processing-simple-skeleton", children: /* @__PURE__ */ jsxRuntime.jsx(SwapFormSkeleton, {}) }),
|
|
3288
3504
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3289
3505
|
"div",
|
|
3290
3506
|
{
|
|
3291
|
-
"data-test-id": "swap-processing-simple-
|
|
3292
|
-
className:
|
|
3507
|
+
"data-test-id": "swap-processing-simple-screen",
|
|
3508
|
+
className: tailwindMerge.twMerge(
|
|
3509
|
+
"absolute inset-0 z-10",
|
|
3510
|
+
"flex flex-col items-center justify-center",
|
|
3511
|
+
"gap-[var(--deframe-widget-size-gap-lg)]",
|
|
3512
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-lg)]",
|
|
3513
|
+
"rounded-[inherit]",
|
|
3514
|
+
"backdrop-blur-[12px] [-webkit-backdrop-filter:blur(12px)]",
|
|
3515
|
+
"bg-[color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)]"
|
|
3516
|
+
),
|
|
3293
3517
|
children: [
|
|
3294
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3295
|
-
"span",
|
|
3296
|
-
{
|
|
3297
|
-
"data-test-id": "swap-processing-simple-title",
|
|
3298
|
-
className: tailwindMerge.twMerge(
|
|
3299
|
-
"[font-size:12px] [line-height:1.25] [letter-spacing:0.10em] uppercase",
|
|
3300
|
-
"[font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
3301
|
-
"font-[var(--deframe-widget-font-family)]",
|
|
3302
|
-
"text-[color:var(--deframe-widget-color-brand-primary)]"
|
|
3303
|
-
),
|
|
3304
|
-
children: titleText
|
|
3305
|
-
}
|
|
3306
|
-
),
|
|
3518
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingIcon, {}),
|
|
3307
3519
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3308
|
-
"
|
|
3520
|
+
"div",
|
|
3309
3521
|
{
|
|
3310
|
-
"data-test-id": "swap-processing-simple-
|
|
3311
|
-
className:
|
|
3312
|
-
"[font-size:var(--deframe-widget-font-size-md)] [line-height:1.6]",
|
|
3313
|
-
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
3314
|
-
"font-[var(--deframe-widget-font-family)]",
|
|
3315
|
-
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
3316
|
-
"max-w-[260px]"
|
|
3317
|
-
),
|
|
3522
|
+
"data-test-id": "swap-processing-simple-copy",
|
|
3523
|
+
className: "flex flex-col items-center gap-[var(--deframe-widget-size-gap-sm)] text-center",
|
|
3318
3524
|
children: [
|
|
3319
|
-
descriptionPrefix,
|
|
3320
|
-
" ",
|
|
3321
3525
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3322
|
-
"
|
|
3526
|
+
"span",
|
|
3323
3527
|
{
|
|
3324
|
-
"data-test-id": "swap-processing-simple-
|
|
3325
|
-
onClick: onGoToHistory,
|
|
3326
|
-
"aria-label": activityHistoryText,
|
|
3528
|
+
"data-test-id": "swap-processing-simple-title",
|
|
3327
3529
|
className: tailwindMerge.twMerge(
|
|
3328
|
-
"
|
|
3530
|
+
"[font-size:12px] [line-height:1.25] [letter-spacing:0.10em] uppercase",
|
|
3329
3531
|
"[font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
3532
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
3330
3533
|
"text-[color:var(--deframe-widget-color-brand-primary)]"
|
|
3331
3534
|
),
|
|
3332
|
-
children:
|
|
3535
|
+
children: "PROCESSANDO TRANSA\xC7\xC3O..."
|
|
3536
|
+
}
|
|
3537
|
+
),
|
|
3538
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3539
|
+
"span",
|
|
3540
|
+
{
|
|
3541
|
+
"data-test-id": "swap-processing-simple-subtitle",
|
|
3542
|
+
className: tailwindMerge.twMerge(
|
|
3543
|
+
"[font-size:var(--deframe-widget-font-size-md)] [line-height:1.6]",
|
|
3544
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
3545
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
3546
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
3547
|
+
"max-w-[260px]"
|
|
3548
|
+
),
|
|
3549
|
+
children: "Aguarde enquanto sua troca \xE9 confirmada."
|
|
3333
3550
|
}
|
|
3334
3551
|
)
|
|
3335
3552
|
]
|
|
@@ -3443,6 +3660,55 @@ var SwapCrossChainProcessingView = ({
|
|
|
3443
3660
|
}
|
|
3444
3661
|
);
|
|
3445
3662
|
};
|
|
3663
|
+
var InvestmentCrossChainProcessingView = ({
|
|
3664
|
+
title,
|
|
3665
|
+
description,
|
|
3666
|
+
progress,
|
|
3667
|
+
strategyName,
|
|
3668
|
+
strategyIcon,
|
|
3669
|
+
strategySymbol,
|
|
3670
|
+
apyLabel,
|
|
3671
|
+
apyValue,
|
|
3672
|
+
amountUSD,
|
|
3673
|
+
amountToken,
|
|
3674
|
+
onClose,
|
|
3675
|
+
transactionSteps,
|
|
3676
|
+
processingDetailsLabels
|
|
3677
|
+
}) => {
|
|
3678
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3679
|
+
TransactionScreen,
|
|
3680
|
+
{
|
|
3681
|
+
progress,
|
|
3682
|
+
iconType: "processing",
|
|
3683
|
+
title,
|
|
3684
|
+
description,
|
|
3685
|
+
onClose,
|
|
3686
|
+
children: [
|
|
3687
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3688
|
+
TransactionScreenInvestmentCard,
|
|
3689
|
+
{
|
|
3690
|
+
strategyName,
|
|
3691
|
+
apyLabel,
|
|
3692
|
+
apyValue,
|
|
3693
|
+
iconSrc: strategyIcon,
|
|
3694
|
+
iconAlt: strategySymbol,
|
|
3695
|
+
amountUSD,
|
|
3696
|
+
amountToken
|
|
3697
|
+
}
|
|
3698
|
+
),
|
|
3699
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3700
|
+
TransactionProcessingDetails,
|
|
3701
|
+
{
|
|
3702
|
+
steps: transactionSteps,
|
|
3703
|
+
defaultOpen: true,
|
|
3704
|
+
className: "bg-[var(--deframe-widget-color-bg-secondary)] lg:!bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
3705
|
+
labels: processingDetailsLabels
|
|
3706
|
+
}
|
|
3707
|
+
)
|
|
3708
|
+
]
|
|
3709
|
+
}
|
|
3710
|
+
);
|
|
3711
|
+
};
|
|
3446
3712
|
var SwapSignatureWarningView = ({
|
|
3447
3713
|
fromTokenSymbol,
|
|
3448
3714
|
fromTokenIcon,
|
|
@@ -3515,6 +3781,162 @@ var SwapSignatureWarningView = ({
|
|
|
3515
3781
|
}
|
|
3516
3782
|
);
|
|
3517
3783
|
};
|
|
3784
|
+
function WarningIcon() {
|
|
3785
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3786
|
+
framerMotion.motion.div,
|
|
3787
|
+
{
|
|
3788
|
+
"data-test-id": "swap-signature-warning-simple-icon",
|
|
3789
|
+
initial: { scale: 0.55, opacity: 0 },
|
|
3790
|
+
animate: { scale: 1, opacity: 1 },
|
|
3791
|
+
transition: { type: "spring", stiffness: 300, damping: 20, delay: 0.05 },
|
|
3792
|
+
className: tailwindMerge.twMerge(
|
|
3793
|
+
"w-[84px] h-[84px] rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0",
|
|
3794
|
+
"flex items-center justify-center",
|
|
3795
|
+
"bg-[var(--deframe-widget-color-state-warning)]",
|
|
3796
|
+
"shadow-[0_0_0_10px_color-mix(in_srgb,var(--deframe-widget-color-state-warning)_12%,transparent),0_0_32px_color-mix(in_srgb,var(--deframe-widget-color-state-warning)_22%,transparent)]"
|
|
3797
|
+
),
|
|
3798
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "44", height: "44", viewBox: "0 0 44 44", fill: "none", "aria-hidden": "true", children: [
|
|
3799
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3800
|
+
framerMotion.motion.line,
|
|
3801
|
+
{
|
|
3802
|
+
x1: "22",
|
|
3803
|
+
y1: "10",
|
|
3804
|
+
x2: "22",
|
|
3805
|
+
y2: "26",
|
|
3806
|
+
stroke: "white",
|
|
3807
|
+
strokeWidth: "3.5",
|
|
3808
|
+
strokeLinecap: "round",
|
|
3809
|
+
initial: { pathLength: 0 },
|
|
3810
|
+
animate: { pathLength: 1 },
|
|
3811
|
+
transition: { duration: 0.3, delay: 0.2, ease: "easeOut" }
|
|
3812
|
+
}
|
|
3813
|
+
),
|
|
3814
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3815
|
+
framerMotion.motion.circle,
|
|
3816
|
+
{
|
|
3817
|
+
cx: "22",
|
|
3818
|
+
cy: "33",
|
|
3819
|
+
r: "2",
|
|
3820
|
+
fill: "white",
|
|
3821
|
+
initial: { scale: 0, opacity: 0 },
|
|
3822
|
+
animate: { scale: 1, opacity: 1 },
|
|
3823
|
+
transition: { duration: 0.15, delay: 0.45, ease: "easeOut" }
|
|
3824
|
+
}
|
|
3825
|
+
)
|
|
3826
|
+
] })
|
|
3827
|
+
}
|
|
3828
|
+
);
|
|
3829
|
+
}
|
|
3830
|
+
var SwapSignatureWarningViewSimple = ({
|
|
3831
|
+
errorTitle,
|
|
3832
|
+
errorDescription,
|
|
3833
|
+
onCancel,
|
|
3834
|
+
onTryAgain,
|
|
3835
|
+
cancelButtonText,
|
|
3836
|
+
retryButtonText
|
|
3837
|
+
}) => {
|
|
3838
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3839
|
+
"div",
|
|
3840
|
+
{
|
|
3841
|
+
"data-test-id": "swap-signature-warning-simple-wrapper",
|
|
3842
|
+
className: tailwindMerge.twMerge(
|
|
3843
|
+
"relative overflow-hidden",
|
|
3844
|
+
`min-h-[${SWAP_SIMPLE_MIN_HEIGHT}px]`,
|
|
3845
|
+
`w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] box-border`,
|
|
3846
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
3847
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
3848
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
3849
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
3850
|
+
),
|
|
3851
|
+
children: [
|
|
3852
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-signature-warning-simple-skeleton", children: /* @__PURE__ */ jsxRuntime.jsx(SwapFormSkeleton, {}) }),
|
|
3853
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3854
|
+
"div",
|
|
3855
|
+
{
|
|
3856
|
+
"data-test-id": "swap-signature-warning-simple-screen",
|
|
3857
|
+
className: tailwindMerge.twMerge(
|
|
3858
|
+
"absolute inset-0 z-10",
|
|
3859
|
+
"flex flex-col items-center justify-center",
|
|
3860
|
+
"gap-[var(--deframe-widget-size-gap-lg)]",
|
|
3861
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-lg)]",
|
|
3862
|
+
"rounded-[inherit]",
|
|
3863
|
+
"backdrop-blur-[12px] [-webkit-backdrop-filter:blur(12px)]",
|
|
3864
|
+
"bg-[color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)]"
|
|
3865
|
+
),
|
|
3866
|
+
children: [
|
|
3867
|
+
/* @__PURE__ */ jsxRuntime.jsx(WarningIcon, {}),
|
|
3868
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3869
|
+
"div",
|
|
3870
|
+
{
|
|
3871
|
+
"data-test-id": "swap-signature-warning-simple-copy",
|
|
3872
|
+
className: "flex flex-col items-center gap-[var(--deframe-widget-size-gap-sm)] text-center",
|
|
3873
|
+
children: [
|
|
3874
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3875
|
+
"span",
|
|
3876
|
+
{
|
|
3877
|
+
"data-test-id": "swap-signature-warning-simple-title",
|
|
3878
|
+
className: tailwindMerge.twMerge(
|
|
3879
|
+
"[font-size:22px] [line-height:1.25]",
|
|
3880
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
3881
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
3882
|
+
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
3883
|
+
),
|
|
3884
|
+
children: errorTitle
|
|
3885
|
+
}
|
|
3886
|
+
),
|
|
3887
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3888
|
+
"span",
|
|
3889
|
+
{
|
|
3890
|
+
"data-test-id": "swap-signature-warning-simple-subtitle",
|
|
3891
|
+
className: tailwindMerge.twMerge(
|
|
3892
|
+
"[font-size:var(--deframe-widget-font-size-md)] [line-height:1.6]",
|
|
3893
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
3894
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
3895
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
3896
|
+
"max-w-[260px]"
|
|
3897
|
+
),
|
|
3898
|
+
children: errorDescription
|
|
3899
|
+
}
|
|
3900
|
+
)
|
|
3901
|
+
]
|
|
3902
|
+
}
|
|
3903
|
+
),
|
|
3904
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3905
|
+
"div",
|
|
3906
|
+
{
|
|
3907
|
+
"data-test-id": "swap-signature-warning-simple-actions",
|
|
3908
|
+
className: "flex gap-[var(--deframe-widget-size-gap-sm)] w-full max-w-[320px]",
|
|
3909
|
+
children: [
|
|
3910
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3911
|
+
SecondaryButton,
|
|
3912
|
+
{
|
|
3913
|
+
"data-test-id": "swap-signature-warning-simple-cancel",
|
|
3914
|
+
"aria-label": cancelButtonText != null ? cancelButtonText : "Cancel",
|
|
3915
|
+
className: "flex-1",
|
|
3916
|
+
onClick: onCancel,
|
|
3917
|
+
children: cancelButtonText
|
|
3918
|
+
}
|
|
3919
|
+
),
|
|
3920
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3921
|
+
PrimaryButton,
|
|
3922
|
+
{
|
|
3923
|
+
"data-test-id": "swap-signature-warning-simple-retry",
|
|
3924
|
+
"aria-label": retryButtonText != null ? retryButtonText : "Retry",
|
|
3925
|
+
className: "flex-1",
|
|
3926
|
+
onClick: onTryAgain,
|
|
3927
|
+
children: retryButtonText
|
|
3928
|
+
}
|
|
3929
|
+
)
|
|
3930
|
+
]
|
|
3931
|
+
}
|
|
3932
|
+
)
|
|
3933
|
+
]
|
|
3934
|
+
}
|
|
3935
|
+
)
|
|
3936
|
+
]
|
|
3937
|
+
}
|
|
3938
|
+
);
|
|
3939
|
+
};
|
|
3518
3940
|
var SwapSuccessView = ({
|
|
3519
3941
|
fromTokenSymbol,
|
|
3520
3942
|
fromTokenIcon,
|
|
@@ -3631,71 +4053,69 @@ function SuccessIcon() {
|
|
|
3631
4053
|
}
|
|
3632
4054
|
);
|
|
3633
4055
|
}
|
|
3634
|
-
var SwapSuccessViewSimple = ({
|
|
3635
|
-
onGoToWallet,
|
|
3636
|
-
labels
|
|
3637
|
-
}) => {
|
|
4056
|
+
var SwapSuccessViewSimple = () => {
|
|
3638
4057
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3639
4058
|
"div",
|
|
3640
4059
|
{
|
|
3641
|
-
"data-test-id": "swap-success-simple-
|
|
4060
|
+
"data-test-id": "swap-success-simple-wrapper",
|
|
3642
4061
|
className: tailwindMerge.twMerge(
|
|
3643
|
-
"
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
"
|
|
3647
|
-
"rounded-[
|
|
3648
|
-
"
|
|
3649
|
-
"
|
|
4062
|
+
"relative overflow-hidden",
|
|
4063
|
+
`min-h-[${SWAP_SIMPLE_MIN_HEIGHT}px]`,
|
|
4064
|
+
`w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] box-border`,
|
|
4065
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
4066
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
4067
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
4068
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
3650
4069
|
),
|
|
3651
4070
|
children: [
|
|
3652
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4071
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-success-simple-skeleton", children: /* @__PURE__ */ jsxRuntime.jsx(SwapFormSkeleton, {}) }),
|
|
3653
4072
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3654
4073
|
"div",
|
|
3655
4074
|
{
|
|
3656
|
-
"data-test-id": "swap-success-simple-
|
|
3657
|
-
className:
|
|
4075
|
+
"data-test-id": "swap-success-simple-screen",
|
|
4076
|
+
className: tailwindMerge.twMerge(
|
|
4077
|
+
"absolute inset-0 z-10",
|
|
4078
|
+
"flex flex-col items-center justify-center",
|
|
4079
|
+
"gap-[var(--deframe-widget-size-gap-lg)]",
|
|
4080
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-lg)]",
|
|
4081
|
+
"rounded-[inherit]",
|
|
4082
|
+
"backdrop-blur-[12px] [-webkit-backdrop-filter:blur(12px)]",
|
|
4083
|
+
"bg-[color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)]"
|
|
4084
|
+
),
|
|
3658
4085
|
children: [
|
|
3659
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3660
|
-
"span",
|
|
3661
|
-
{
|
|
3662
|
-
"data-test-id": "swap-success-simple-title",
|
|
3663
|
-
className: tailwindMerge.twMerge(
|
|
3664
|
-
"[font-size:var(--deframe-widget-font-size-xl)]",
|
|
3665
|
-
"[line-height:var(--deframe-widget-font-leading-xl)]",
|
|
3666
|
-
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
3667
|
-
"font-[var(--deframe-widget-font-family)]",
|
|
3668
|
-
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
3669
|
-
),
|
|
3670
|
-
children: labels == null ? void 0 : labels.title
|
|
3671
|
-
}
|
|
3672
|
-
),
|
|
4086
|
+
/* @__PURE__ */ jsxRuntime.jsx(SuccessIcon, {}),
|
|
3673
4087
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3674
|
-
"
|
|
4088
|
+
"div",
|
|
3675
4089
|
{
|
|
3676
|
-
"data-test-id": "swap-success-simple-
|
|
3677
|
-
className:
|
|
3678
|
-
"[font-size:var(--deframe-widget-font-size-md)] [line-height:1.6]",
|
|
3679
|
-
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
3680
|
-
"font-[var(--deframe-widget-font-family)]",
|
|
3681
|
-
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
3682
|
-
"max-w-[260px]"
|
|
3683
|
-
),
|
|
4090
|
+
"data-test-id": "swap-success-simple-copy",
|
|
4091
|
+
className: "flex flex-col items-center gap-[var(--deframe-widget-size-gap-sm)] text-center",
|
|
3684
4092
|
children: [
|
|
3685
|
-
labels == null ? void 0 : labels.descriptionSuffix,
|
|
3686
|
-
" ",
|
|
3687
4093
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3688
|
-
"
|
|
4094
|
+
"span",
|
|
3689
4095
|
{
|
|
3690
|
-
"data-test-id": "swap-success-simple-
|
|
3691
|
-
onClick: onGoToWallet,
|
|
3692
|
-
"aria-label": labels == null ? void 0 : labels.walletLinkText,
|
|
4096
|
+
"data-test-id": "swap-success-simple-title",
|
|
3693
4097
|
className: tailwindMerge.twMerge(
|
|
3694
|
-
"
|
|
3695
|
-
"[
|
|
3696
|
-
"
|
|
4098
|
+
"[font-size:var(--deframe-widget-font-size-xl)]",
|
|
4099
|
+
"[line-height:var(--deframe-widget-font-leading-xl)]",
|
|
4100
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
4101
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
4102
|
+
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
4103
|
+
),
|
|
4104
|
+
children: "Troca Aprovada!"
|
|
4105
|
+
}
|
|
4106
|
+
),
|
|
4107
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4108
|
+
"span",
|
|
4109
|
+
{
|
|
4110
|
+
"data-test-id": "swap-success-simple-subtitle",
|
|
4111
|
+
className: tailwindMerge.twMerge(
|
|
4112
|
+
"[font-size:var(--deframe-widget-font-size-md)] [line-height:1.6]",
|
|
4113
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
4114
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
4115
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
4116
|
+
"max-w-[260px]"
|
|
3697
4117
|
),
|
|
3698
|
-
children:
|
|
4118
|
+
children: "Seu saldo foi atualizado."
|
|
3699
4119
|
}
|
|
3700
4120
|
)
|
|
3701
4121
|
]
|
|
@@ -3840,49 +4260,67 @@ var SwapTransactionFailedViewSimple = ({
|
|
|
3840
4260
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3841
4261
|
"div",
|
|
3842
4262
|
{
|
|
3843
|
-
"data-test-id": "swap-failed-simple-
|
|
4263
|
+
"data-test-id": "swap-failed-simple-wrapper",
|
|
3844
4264
|
className: tailwindMerge.twMerge(
|
|
3845
|
-
"
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
"
|
|
3849
|
-
"rounded-[
|
|
3850
|
-
"
|
|
3851
|
-
"
|
|
4265
|
+
"relative overflow-hidden",
|
|
4266
|
+
`min-h-[${SWAP_SIMPLE_MIN_HEIGHT}px]`,
|
|
4267
|
+
`w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] box-border`,
|
|
4268
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
4269
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
4270
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
4271
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
3852
4272
|
),
|
|
3853
4273
|
children: [
|
|
3854
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4274
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-failed-simple-skeleton", children: /* @__PURE__ */ jsxRuntime.jsx(SwapFormSkeleton, {}) }),
|
|
3855
4275
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3856
4276
|
"div",
|
|
3857
4277
|
{
|
|
3858
|
-
"data-test-id": "swap-failed-simple-
|
|
3859
|
-
className:
|
|
4278
|
+
"data-test-id": "swap-failed-simple-screen",
|
|
4279
|
+
className: tailwindMerge.twMerge(
|
|
4280
|
+
"absolute inset-0 z-10",
|
|
4281
|
+
"flex flex-col items-center justify-center",
|
|
4282
|
+
"gap-[var(--deframe-widget-size-gap-lg)]",
|
|
4283
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-lg)]",
|
|
4284
|
+
"rounded-[inherit]",
|
|
4285
|
+
"backdrop-blur-[12px] [-webkit-backdrop-filter:blur(12px)]",
|
|
4286
|
+
"bg-[color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)]"
|
|
4287
|
+
),
|
|
3860
4288
|
children: [
|
|
3861
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
"data-test-id": "swap-failed-simple-title",
|
|
3865
|
-
className: tailwindMerge.twMerge(
|
|
3866
|
-
"[font-size:22px] [line-height:1.25]",
|
|
3867
|
-
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
3868
|
-
"font-[var(--deframe-widget-font-family)]",
|
|
3869
|
-
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
3870
|
-
),
|
|
3871
|
-
children: errorTitle
|
|
3872
|
-
}
|
|
3873
|
-
),
|
|
3874
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3875
|
-
"span",
|
|
4289
|
+
/* @__PURE__ */ jsxRuntime.jsx(ErrorIcon, {}),
|
|
4290
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4291
|
+
"div",
|
|
3876
4292
|
{
|
|
3877
|
-
"data-test-id": "swap-failed-simple-
|
|
3878
|
-
className:
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
4293
|
+
"data-test-id": "swap-failed-simple-copy",
|
|
4294
|
+
className: "flex flex-col items-center gap-[var(--deframe-widget-size-gap-sm)] text-center",
|
|
4295
|
+
children: [
|
|
4296
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4297
|
+
"span",
|
|
4298
|
+
{
|
|
4299
|
+
"data-test-id": "swap-failed-simple-title",
|
|
4300
|
+
className: tailwindMerge.twMerge(
|
|
4301
|
+
"[font-size:22px] [line-height:1.25]",
|
|
4302
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
4303
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
4304
|
+
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
4305
|
+
),
|
|
4306
|
+
children: "Troca Falhou"
|
|
4307
|
+
}
|
|
4308
|
+
),
|
|
4309
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4310
|
+
"span",
|
|
4311
|
+
{
|
|
4312
|
+
"data-test-id": "swap-failed-simple-subtitle",
|
|
4313
|
+
className: tailwindMerge.twMerge(
|
|
4314
|
+
"[font-size:var(--deframe-widget-font-size-md)] [line-height:1.6]",
|
|
4315
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
4316
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
4317
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
4318
|
+
"max-w-[260px]"
|
|
4319
|
+
),
|
|
4320
|
+
children: "Tente novamente mais tarde."
|
|
4321
|
+
}
|
|
4322
|
+
)
|
|
4323
|
+
]
|
|
3886
4324
|
}
|
|
3887
4325
|
)
|
|
3888
4326
|
]
|
|
@@ -4493,112 +4931,2349 @@ var SwapFormView = ({
|
|
|
4493
4931
|
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h5", className: "!text-[21px]", children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "swap-flow-title", children: labels.title }) }),
|
|
4494
4932
|
labels.subtitle && /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "!text-[14px]", children: labels.subtitle })
|
|
4495
4933
|
] }),
|
|
4496
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4497
|
-
"button",
|
|
4934
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4935
|
+
"button",
|
|
4936
|
+
{
|
|
4937
|
+
"data-testid": "swap-history-button",
|
|
4938
|
+
type: "button",
|
|
4939
|
+
onClick: onHistoryClick,
|
|
4940
|
+
className: "flex items-center justify-center w-12 h-12 transition-colors rounded-full cursor-pointer text-text-secondary dark:text-text-secondary-dark hover:text-brand-primary",
|
|
4941
|
+
"aria-label": labels.historyAriaLabel,
|
|
4942
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(md.MdHistory, { className: "w-6 h-6" })
|
|
4943
|
+
}
|
|
4944
|
+
)
|
|
4945
|
+
] }),
|
|
4946
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-col items-stretch gap-sm", children: [
|
|
4947
|
+
/* @__PURE__ */ jsxRuntime.jsx(SwapFromCardView, __spreadValues({}, fromCard)),
|
|
4948
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center -my-5 relative z-10", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4949
|
+
"button",
|
|
4950
|
+
{
|
|
4951
|
+
"data-testid": "swap-switch-tokens-button",
|
|
4952
|
+
type: "button",
|
|
4953
|
+
onClick: onSwitchTokens,
|
|
4954
|
+
className: "w-10 h-10 rounded-full bg-brand-secondary shadow-md flex items-center justify-center text-text-primary hover:shadow-lg transition-shadow focus:outline-none focus:ring-2 focus:ring-brand-secondary cursor-pointer",
|
|
4955
|
+
"aria-label": switchTokensAriaLabel,
|
|
4956
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSwapVert, { className: "w-5 h-5" })
|
|
4957
|
+
}
|
|
4958
|
+
) }),
|
|
4959
|
+
/* @__PURE__ */ jsxRuntime.jsx(SwapToCardView, __spreadValues({}, toCard))
|
|
4960
|
+
] }),
|
|
4961
|
+
/* @__PURE__ */ jsxRuntime.jsx(SwapAdvancedSettingsView, __spreadValues({}, advancedSettings)),
|
|
4962
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-xl", children: /* @__PURE__ */ jsxRuntime.jsx(SwapQuoteDetailsView, __spreadValues({}, transactionDetails)) })
|
|
4963
|
+
] }) })
|
|
4964
|
+
}
|
|
4965
|
+
),
|
|
4966
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4967
|
+
"div",
|
|
4968
|
+
{
|
|
4969
|
+
"data-testid": "swap-flow-footer",
|
|
4970
|
+
className: "border-t p-md border-border-default dark:border-border-default-dark bg-bg-primary dark:bg-bg-primary-dark",
|
|
4971
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ConfirmSwapButtonView, __spreadValues({}, confirmButton))
|
|
4972
|
+
}
|
|
4973
|
+
)
|
|
4974
|
+
] });
|
|
4975
|
+
};
|
|
4976
|
+
var SwapFromCardViewSimple = ({
|
|
4977
|
+
labels,
|
|
4978
|
+
selectedToken,
|
|
4979
|
+
onTokenClick,
|
|
4980
|
+
onNetworkAndAssetClick,
|
|
4981
|
+
balanceFormatted,
|
|
4982
|
+
onBalanceClick,
|
|
4983
|
+
chainLabel,
|
|
4984
|
+
chainImage,
|
|
4985
|
+
amountValue,
|
|
4986
|
+
amountHasError,
|
|
4987
|
+
onAmountChange,
|
|
4988
|
+
amountUsdFormatted,
|
|
4989
|
+
isAmountUsdLoading,
|
|
4990
|
+
field,
|
|
4991
|
+
percentageOptions,
|
|
4992
|
+
onPercentageClick,
|
|
4993
|
+
selectedPercentage = null,
|
|
4994
|
+
maxLabel = "Max.",
|
|
4995
|
+
errorMessage = "Saldo insuficiente para realizar a troca.",
|
|
4996
|
+
errorActionLabel = "Adicionar via PIX",
|
|
4997
|
+
onErrorAction
|
|
4998
|
+
}) => {
|
|
4999
|
+
const [isHovered, setIsHovered] = React6.useState(false);
|
|
5000
|
+
const hideTimeout = React6.useRef(null);
|
|
5001
|
+
const handleMouseEnter = React6.useCallback(() => {
|
|
5002
|
+
if (hideTimeout.current) {
|
|
5003
|
+
clearTimeout(hideTimeout.current);
|
|
5004
|
+
hideTimeout.current = null;
|
|
5005
|
+
}
|
|
5006
|
+
setIsHovered(true);
|
|
5007
|
+
}, []);
|
|
5008
|
+
const handleMouseLeave = React6.useCallback(() => {
|
|
5009
|
+
hideTimeout.current = setTimeout(() => setIsHovered(false), 150);
|
|
5010
|
+
}, []);
|
|
5011
|
+
const wrapperClasses = tailwindMerge.twMerge(
|
|
5012
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5013
|
+
"border",
|
|
5014
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
5015
|
+
"transition-[border-color,background] duration-200",
|
|
5016
|
+
amountHasError ? "border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_32%,transparent)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_16%,transparent)]" : "border-[color:var(--deframe-widget-color-border-secondary)] bg-[var(--deframe-widget-color-bg-secondary)]"
|
|
5017
|
+
);
|
|
5018
|
+
const isEmpty = !amountValue || Number(amountValue) === 0;
|
|
5019
|
+
const showChips = isHovered && percentageOptions && percentageOptions.length > 0 && onPercentageClick;
|
|
5020
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5021
|
+
"div",
|
|
5022
|
+
{
|
|
5023
|
+
"data-test-id": "swap-from-card-simple",
|
|
5024
|
+
className: wrapperClasses,
|
|
5025
|
+
onMouseEnter: handleMouseEnter,
|
|
5026
|
+
onMouseLeave: handleMouseLeave,
|
|
5027
|
+
children: [
|
|
5028
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5029
|
+
"div",
|
|
5030
|
+
{
|
|
5031
|
+
"data-test-id": "swap-from-card-simple-top-row",
|
|
5032
|
+
className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
5033
|
+
children: [
|
|
5034
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5035
|
+
TokenSelectorArea,
|
|
5036
|
+
{
|
|
5037
|
+
selectedToken,
|
|
5038
|
+
chainLabel,
|
|
5039
|
+
chainImage,
|
|
5040
|
+
onTokenClick: onNetworkAndAssetClick != null ? onNetworkAndAssetClick : onTokenClick,
|
|
5041
|
+
selectTokenLabel: labels.selectTokenLabel
|
|
5042
|
+
}
|
|
5043
|
+
),
|
|
5044
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5045
|
+
"div",
|
|
5046
|
+
{
|
|
5047
|
+
"data-test-id": "swap-from-card-simple-divider",
|
|
5048
|
+
className: "w-px h-10 bg-[var(--deframe-widget-color-border-secondary)] flex-shrink-0"
|
|
5049
|
+
}
|
|
5050
|
+
),
|
|
5051
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5052
|
+
"div",
|
|
5053
|
+
{
|
|
5054
|
+
"data-test-id": "swap-from-card-simple-amount-wrapper",
|
|
5055
|
+
className: "flex flex-col items-end flex-1 min-w-0",
|
|
5056
|
+
children: [
|
|
5057
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5058
|
+
"input",
|
|
5059
|
+
__spreadProps(__spreadValues({
|
|
5060
|
+
"data-test-id": "swap-from-card-simple-amount-input",
|
|
5061
|
+
type: "text",
|
|
5062
|
+
inputMode: "decimal",
|
|
5063
|
+
autoComplete: "off",
|
|
5064
|
+
placeholder: "0",
|
|
5065
|
+
"aria-label": labels.amountPlaceholder,
|
|
5066
|
+
value: amountValue || "",
|
|
5067
|
+
className: tailwindMerge.twMerge(
|
|
5068
|
+
"bg-transparent border-none outline-none",
|
|
5069
|
+
"text-right",
|
|
5070
|
+
"text-[36px] [font-weight:var(--deframe-widget-font-weight-semibold)] [line-height:1.1]",
|
|
5071
|
+
"w-full px-[var(--deframe-widget-size-padding-x-none)] py-[var(--deframe-widget-size-padding-y-none)]",
|
|
5072
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5073
|
+
"placeholder:text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
5074
|
+
isEmpty ? "text-[color:var(--deframe-widget-color-text-tertiary)]" : "text-[color:var(--deframe-widget-color-text-primary)]"
|
|
5075
|
+
)
|
|
5076
|
+
}, field ? { name: field.name, onBlur: field.onBlur, ref: field.ref } : {}), {
|
|
5077
|
+
onChange: (e) => onAmountChange(e.target.value),
|
|
5078
|
+
onWheel: (e) => {
|
|
5079
|
+
e.currentTarget.blur();
|
|
5080
|
+
}
|
|
5081
|
+
})
|
|
5082
|
+
),
|
|
5083
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5084
|
+
"span",
|
|
5085
|
+
{
|
|
5086
|
+
"data-test-id": "swap-from-card-simple-usd-conversion",
|
|
5087
|
+
className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
5088
|
+
children: isAmountUsdLoading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {}) : amountUsdFormatted
|
|
5089
|
+
}
|
|
5090
|
+
)
|
|
5091
|
+
]
|
|
5092
|
+
}
|
|
5093
|
+
)
|
|
5094
|
+
]
|
|
5095
|
+
}
|
|
5096
|
+
),
|
|
5097
|
+
selectedToken && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5098
|
+
"div",
|
|
5099
|
+
{
|
|
5100
|
+
"data-test-id": "swap-from-card-simple-balance-row",
|
|
5101
|
+
className: "flex items-center justify-between mt-[var(--deframe-widget-size-gap-sm)]",
|
|
5102
|
+
children: onBalanceClick ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5103
|
+
"button",
|
|
5104
|
+
{
|
|
5105
|
+
"data-test-id": "swap-from-card-simple-balance",
|
|
5106
|
+
type: "button",
|
|
5107
|
+
onClick: onBalanceClick,
|
|
5108
|
+
"aria-label": `${labels.balanceLabel}: ${balanceFormatted}`,
|
|
5109
|
+
className: tailwindMerge.twMerge(
|
|
5110
|
+
"text-[13px] font-[var(--deframe-widget-font-family)] cursor-pointer",
|
|
5111
|
+
"bg-transparent border-none outline-none p-0",
|
|
5112
|
+
"text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
5113
|
+
"hover:text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5114
|
+
"transition-colors duration-150"
|
|
5115
|
+
),
|
|
5116
|
+
children: [
|
|
5117
|
+
labels.balanceLabel,
|
|
5118
|
+
":",
|
|
5119
|
+
" ",
|
|
5120
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5121
|
+
"span",
|
|
5122
|
+
{
|
|
5123
|
+
"data-test-id": "swap-from-card-simple-balance-value",
|
|
5124
|
+
className: amountHasError ? "text-[color:var(--deframe-widget-color-state-error)]" : "text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5125
|
+
children: balanceFormatted
|
|
5126
|
+
}
|
|
5127
|
+
)
|
|
5128
|
+
]
|
|
5129
|
+
}
|
|
5130
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5131
|
+
"span",
|
|
5132
|
+
{
|
|
5133
|
+
"data-test-id": "swap-from-card-simple-balance",
|
|
5134
|
+
className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
5135
|
+
children: [
|
|
5136
|
+
labels.balanceLabel,
|
|
5137
|
+
":",
|
|
5138
|
+
" ",
|
|
5139
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5140
|
+
"span",
|
|
5141
|
+
{
|
|
5142
|
+
"data-test-id": "swap-from-card-simple-balance-value",
|
|
5143
|
+
className: amountHasError ? "text-[color:var(--deframe-widget-color-state-error)]" : "text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5144
|
+
children: balanceFormatted
|
|
5145
|
+
}
|
|
5146
|
+
)
|
|
5147
|
+
]
|
|
5148
|
+
}
|
|
5149
|
+
)
|
|
5150
|
+
}
|
|
5151
|
+
),
|
|
5152
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showChips && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5153
|
+
framerMotion.motion.div,
|
|
5154
|
+
{
|
|
5155
|
+
"data-test-id": "swap-from-card-simple-chips",
|
|
5156
|
+
initial: { opacity: 0, height: 0 },
|
|
5157
|
+
animate: { opacity: 1, height: "auto" },
|
|
5158
|
+
exit: { opacity: 0, height: 0 },
|
|
5159
|
+
transition: { duration: 0.15 },
|
|
5160
|
+
className: "overflow-hidden mt-[var(--deframe-widget-size-gap-sm)]",
|
|
5161
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5162
|
+
"div",
|
|
5163
|
+
{
|
|
5164
|
+
"data-test-id": "swap-from-card-simple-chips-row",
|
|
5165
|
+
className: "flex gap-[6px] items-center",
|
|
5166
|
+
children: percentageOptions.map((pct, i) => {
|
|
5167
|
+
const isLast = i === percentageOptions.length - 1;
|
|
5168
|
+
const isActive = pct === selectedPercentage;
|
|
5169
|
+
const chipLabel = isLast ? maxLabel : `${pct / 100}%`;
|
|
5170
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5171
|
+
ChipPill,
|
|
5172
|
+
{
|
|
5173
|
+
label: chipLabel,
|
|
5174
|
+
active: isActive,
|
|
5175
|
+
onClick: () => onPercentageClick(pct)
|
|
5176
|
+
},
|
|
5177
|
+
pct
|
|
5178
|
+
);
|
|
5179
|
+
})
|
|
5180
|
+
}
|
|
5181
|
+
)
|
|
5182
|
+
}
|
|
5183
|
+
) }),
|
|
5184
|
+
amountHasError && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5185
|
+
"div",
|
|
5186
|
+
{
|
|
5187
|
+
"data-test-id": "swap-from-card-simple-error",
|
|
5188
|
+
className: "mt-[var(--deframe-widget-size-gap-sm)]",
|
|
5189
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5190
|
+
InlineNotificationBar,
|
|
5191
|
+
{
|
|
5192
|
+
message: errorMessage,
|
|
5193
|
+
actionLabel: errorActionLabel,
|
|
5194
|
+
onAction: onErrorAction
|
|
5195
|
+
}
|
|
5196
|
+
)
|
|
5197
|
+
}
|
|
5198
|
+
)
|
|
5199
|
+
]
|
|
5200
|
+
}
|
|
5201
|
+
);
|
|
5202
|
+
};
|
|
5203
|
+
function TokenSelectorArea({
|
|
5204
|
+
selectedToken,
|
|
5205
|
+
chainLabel,
|
|
5206
|
+
chainImage,
|
|
5207
|
+
onTokenClick,
|
|
5208
|
+
selectTokenLabel
|
|
5209
|
+
}) {
|
|
5210
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5211
|
+
"button",
|
|
5212
|
+
{
|
|
5213
|
+
"data-test-id": "swap-from-card-simple-token-selector",
|
|
5214
|
+
type: "button",
|
|
5215
|
+
onClick: onTokenClick,
|
|
5216
|
+
"aria-label": selectedToken ? `Select token \u2014 currently ${selectedToken.symbol} on ${chainLabel}` : selectTokenLabel,
|
|
5217
|
+
className: tailwindMerge.twMerge(
|
|
5218
|
+
"inline-flex items-center gap-[10px]",
|
|
5219
|
+
"py-[var(--deframe-widget-size-padding-y-sm)] px-[10px]",
|
|
5220
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5221
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
5222
|
+
"border-none outline-none",
|
|
5223
|
+
"transition-[background] duration-150",
|
|
5224
|
+
"flex-shrink-0",
|
|
5225
|
+
"cursor-pointer hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_72%,transparent)]"
|
|
5226
|
+
),
|
|
5227
|
+
children: selectedToken ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5228
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5229
|
+
TokenIconWithBadge,
|
|
5230
|
+
{
|
|
5231
|
+
token: selectedToken,
|
|
5232
|
+
chainLabel,
|
|
5233
|
+
chainImage
|
|
5234
|
+
}
|
|
5235
|
+
),
|
|
5236
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5237
|
+
"div",
|
|
5238
|
+
{
|
|
5239
|
+
"data-test-id": "swap-from-card-simple-token-info",
|
|
5240
|
+
className: "flex flex-col items-start min-w-0",
|
|
5241
|
+
children: [
|
|
5242
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5243
|
+
"span",
|
|
5244
|
+
{
|
|
5245
|
+
"data-test-id": "swap-from-card-simple-token-symbol",
|
|
5246
|
+
className: tailwindMerge.twMerge(
|
|
5247
|
+
"text-[16px] [font-weight:var(--deframe-widget-font-weight-semibold)] leading-[1.2]",
|
|
5248
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5249
|
+
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
5250
|
+
),
|
|
5251
|
+
children: selectedToken.symbol
|
|
5252
|
+
}
|
|
5253
|
+
),
|
|
5254
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5255
|
+
"span",
|
|
5256
|
+
{
|
|
5257
|
+
"data-test-id": "swap-from-card-simple-token-network",
|
|
5258
|
+
className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] text-[color:var(--deframe-widget-color-text-tertiary)] uppercase tracking-[0.04em] font-[var(--deframe-widget-font-family)] leading-[1.2]",
|
|
5259
|
+
children: chainLabel
|
|
5260
|
+
}
|
|
5261
|
+
)
|
|
5262
|
+
]
|
|
5263
|
+
}
|
|
5264
|
+
),
|
|
5265
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, {})
|
|
5266
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5267
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5268
|
+
"div",
|
|
5269
|
+
{
|
|
5270
|
+
"data-test-id": "swap-from-card-simple-token-placeholder-icon",
|
|
5271
|
+
className: "w-[38px] h-[38px] rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-tertiary)] flex-shrink-0"
|
|
5272
|
+
}
|
|
5273
|
+
),
|
|
5274
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5275
|
+
"span",
|
|
5276
|
+
{
|
|
5277
|
+
"data-test-id": "swap-from-card-simple-token-placeholder-label",
|
|
5278
|
+
className: tailwindMerge.twMerge(
|
|
5279
|
+
"text-[16px] [font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
5280
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5281
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5282
|
+
"whitespace-nowrap"
|
|
5283
|
+
),
|
|
5284
|
+
children: selectTokenLabel
|
|
5285
|
+
}
|
|
5286
|
+
),
|
|
5287
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, {})
|
|
5288
|
+
] })
|
|
5289
|
+
}
|
|
5290
|
+
);
|
|
5291
|
+
}
|
|
5292
|
+
function TokenIconWithBadge({ token, chainLabel, chainImage }) {
|
|
5293
|
+
const [imgError, setImgError] = React6.useState(false);
|
|
5294
|
+
const [badgeError, setBadgeError] = React6.useState(false);
|
|
5295
|
+
const size = 38;
|
|
5296
|
+
const badgeSize = 16;
|
|
5297
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5298
|
+
"div",
|
|
5299
|
+
{
|
|
5300
|
+
"data-test-id": "swap-from-card-simple-token-icon",
|
|
5301
|
+
className: "relative flex-shrink-0",
|
|
5302
|
+
style: { width: size, height: size },
|
|
5303
|
+
children: [
|
|
5304
|
+
token.logoURI && !imgError ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5305
|
+
"img",
|
|
5306
|
+
{
|
|
5307
|
+
"data-test-id": "swap-from-card-simple-token-icon-img",
|
|
5308
|
+
src: token.logoURI,
|
|
5309
|
+
alt: token.symbol,
|
|
5310
|
+
width: size,
|
|
5311
|
+
height: size,
|
|
5312
|
+
className: "rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 object-cover",
|
|
5313
|
+
onError: () => setImgError(true)
|
|
5314
|
+
}
|
|
5315
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5316
|
+
"div",
|
|
5317
|
+
{
|
|
5318
|
+
"data-test-id": "swap-from-card-simple-token-icon-fallback",
|
|
5319
|
+
className: tailwindMerge.twMerge(
|
|
5320
|
+
"rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0",
|
|
5321
|
+
"flex items-center justify-center",
|
|
5322
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
5323
|
+
"text-[color:var(--deframe-widget-color-text-primary-dark)]",
|
|
5324
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]"
|
|
5325
|
+
),
|
|
5326
|
+
style: { width: size, height: size, fontSize: size * 0.33 },
|
|
5327
|
+
children: token.symbol.slice(0, 2).toUpperCase()
|
|
5328
|
+
}
|
|
5329
|
+
),
|
|
5330
|
+
chainImage && !badgeError ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5331
|
+
"div",
|
|
5332
|
+
{
|
|
5333
|
+
"data-test-id": "swap-from-card-simple-token-badge",
|
|
5334
|
+
className: "absolute -bottom-0.5 -right-0.5 rounded-[var(--deframe-widget-size-radius-full)] shadow-[0_0_0_2px_var(--deframe-widget-color-bg-secondary)]",
|
|
5335
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5336
|
+
"img",
|
|
5337
|
+
{
|
|
5338
|
+
"data-test-id": "swap-from-card-simple-token-badge-img",
|
|
5339
|
+
src: chainImage,
|
|
5340
|
+
alt: chainLabel,
|
|
5341
|
+
width: badgeSize,
|
|
5342
|
+
height: badgeSize,
|
|
5343
|
+
className: "rounded-[var(--deframe-widget-size-radius-full)] object-cover",
|
|
5344
|
+
onError: () => setBadgeError(true)
|
|
5345
|
+
}
|
|
5346
|
+
)
|
|
5347
|
+
}
|
|
5348
|
+
) : chainLabel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5349
|
+
"div",
|
|
5350
|
+
{
|
|
5351
|
+
"data-test-id": "swap-from-card-simple-token-badge",
|
|
5352
|
+
className: tailwindMerge.twMerge(
|
|
5353
|
+
"absolute -bottom-0.5 -right-0.5",
|
|
5354
|
+
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
5355
|
+
"shadow-[0_0_0_2px_var(--deframe-widget-color-bg-secondary)]",
|
|
5356
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
5357
|
+
"flex items-center justify-center",
|
|
5358
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
5359
|
+
"text-[color:var(--deframe-widget-color-text-primary-dark)]"
|
|
5360
|
+
),
|
|
5361
|
+
style: { width: badgeSize, height: badgeSize, fontSize: badgeSize * 0.45 },
|
|
5362
|
+
children: chainLabel.slice(0, 1).toUpperCase()
|
|
5363
|
+
}
|
|
5364
|
+
) : null
|
|
5365
|
+
]
|
|
5366
|
+
}
|
|
5367
|
+
);
|
|
5368
|
+
}
|
|
5369
|
+
function ChevronDown() {
|
|
5370
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5371
|
+
"svg",
|
|
5372
|
+
{
|
|
5373
|
+
"data-test-id": "swap-from-card-simple-chevron",
|
|
5374
|
+
width: "14",
|
|
5375
|
+
height: "14",
|
|
5376
|
+
viewBox: "0 0 24 24",
|
|
5377
|
+
fill: "none",
|
|
5378
|
+
stroke: "currentColor",
|
|
5379
|
+
strokeWidth: "2.5",
|
|
5380
|
+
strokeLinecap: "round",
|
|
5381
|
+
strokeLinejoin: "round",
|
|
5382
|
+
className: "flex-shrink-0 text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5383
|
+
"aria-hidden": "true",
|
|
5384
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "6 9 12 15 18 9" })
|
|
5385
|
+
}
|
|
5386
|
+
);
|
|
5387
|
+
}
|
|
5388
|
+
function ChipPill({ label, active, onClick }) {
|
|
5389
|
+
const baseClasses = tailwindMerge.twMerge(
|
|
5390
|
+
"inline-flex items-center justify-center",
|
|
5391
|
+
"py-[3px] px-[10px]",
|
|
5392
|
+
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
5393
|
+
"cursor-pointer",
|
|
5394
|
+
"text-[12px]",
|
|
5395
|
+
"transition-all duration-150",
|
|
5396
|
+
"outline-none",
|
|
5397
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5398
|
+
"whitespace-nowrap",
|
|
5399
|
+
"border"
|
|
5400
|
+
);
|
|
5401
|
+
const stateClasses = active ? tailwindMerge.twMerge(
|
|
5402
|
+
"border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_32%,transparent)]",
|
|
5403
|
+
"bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)]",
|
|
5404
|
+
"text-[color:var(--deframe-widget-color-brand-primary)]",
|
|
5405
|
+
"[font-weight:var(--deframe-widget-font-weight-semibold)]"
|
|
5406
|
+
) : tailwindMerge.twMerge(
|
|
5407
|
+
"border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
5408
|
+
"bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_84%,transparent)]",
|
|
5409
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5410
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
5411
|
+
"hover:border-[color:var(--deframe-widget-color-border-primary)]",
|
|
5412
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
|
|
5413
|
+
"hover:text-[color:var(--deframe-widget-color-text-primary)]"
|
|
5414
|
+
);
|
|
5415
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5416
|
+
"button",
|
|
5417
|
+
{
|
|
5418
|
+
"data-test-id": "swap-from-card-simple-chip",
|
|
5419
|
+
type: "button",
|
|
5420
|
+
onClick,
|
|
5421
|
+
"aria-label": label,
|
|
5422
|
+
className: tailwindMerge.twMerge(baseClasses, stateClasses),
|
|
5423
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-test-id": "swap-from-card-simple-chip-label", children: label })
|
|
5424
|
+
}
|
|
5425
|
+
);
|
|
5426
|
+
}
|
|
5427
|
+
function InlineNotificationBar({ message, actionLabel, onAction }) {
|
|
5428
|
+
const wrapperClasses = tailwindMerge.twMerge(
|
|
5429
|
+
"relative flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
5430
|
+
"py-[7px] pr-[10px] pl-[14px]",
|
|
5431
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5432
|
+
"border",
|
|
5433
|
+
"overflow-hidden",
|
|
5434
|
+
"bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_16%,transparent)]",
|
|
5435
|
+
"border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_32%,transparent)]"
|
|
5436
|
+
);
|
|
5437
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5438
|
+
"div",
|
|
5439
|
+
{
|
|
5440
|
+
"data-test-id": "swap-from-card-simple-notification",
|
|
5441
|
+
role: "alert",
|
|
5442
|
+
className: wrapperClasses,
|
|
5443
|
+
children: [
|
|
5444
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5445
|
+
"div",
|
|
5446
|
+
{
|
|
5447
|
+
"data-test-id": "swap-from-card-simple-notification-accent",
|
|
5448
|
+
className: tailwindMerge.twMerge(
|
|
5449
|
+
"absolute left-0 top-0 bottom-0 w-[3px]",
|
|
5450
|
+
"rounded-[var(--deframe-widget-size-radius-sm)_0_0_var(--deframe-widget-size-radius-sm)]",
|
|
5451
|
+
"bg-[var(--deframe-widget-color-state-error)]"
|
|
5452
|
+
)
|
|
5453
|
+
}
|
|
5454
|
+
),
|
|
5455
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5456
|
+
"div",
|
|
5457
|
+
{
|
|
5458
|
+
"data-test-id": "swap-from-card-simple-notification-dot",
|
|
5459
|
+
className: "w-[6px] h-[6px] rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 bg-[var(--deframe-widget-color-state-error)]"
|
|
5460
|
+
}
|
|
5461
|
+
),
|
|
5462
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5463
|
+
"span",
|
|
5464
|
+
{
|
|
5465
|
+
"data-test-id": "swap-from-card-simple-notification-message",
|
|
5466
|
+
className: "flex-1 text-[13px] text-[color:var(--deframe-widget-color-text-secondary)] font-[var(--deframe-widget-font-family)] leading-[1.4]",
|
|
5467
|
+
children: message
|
|
5468
|
+
}
|
|
5469
|
+
),
|
|
5470
|
+
onAction && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5471
|
+
"button",
|
|
5472
|
+
{
|
|
5473
|
+
"data-test-id": "swap-from-card-simple-notification-action",
|
|
5474
|
+
type: "button",
|
|
5475
|
+
onClick: onAction,
|
|
5476
|
+
"aria-label": actionLabel,
|
|
5477
|
+
className: tailwindMerge.twMerge(
|
|
5478
|
+
"flex-shrink-0 bg-none border-none cursor-pointer",
|
|
5479
|
+
"text-[13px] [font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
5480
|
+
"py-[var(--deframe-widget-size-padding-y-none)] px-[var(--deframe-widget-size-padding-x-xs)]",
|
|
5481
|
+
"outline-none font-[var(--deframe-widget-font-family)] whitespace-nowrap",
|
|
5482
|
+
"text-[color:var(--deframe-widget-color-state-error)]"
|
|
5483
|
+
),
|
|
5484
|
+
children: [
|
|
5485
|
+
actionLabel,
|
|
5486
|
+
" \u2192"
|
|
5487
|
+
]
|
|
5488
|
+
}
|
|
5489
|
+
)
|
|
5490
|
+
]
|
|
5491
|
+
}
|
|
5492
|
+
);
|
|
5493
|
+
}
|
|
5494
|
+
function IconCircle({ item, size = 36 }) {
|
|
5495
|
+
const [imgError, setImgError] = React6__namespace.default.useState(false);
|
|
5496
|
+
if (item.iconUrl && !imgError) {
|
|
5497
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5498
|
+
"img",
|
|
5499
|
+
{
|
|
5500
|
+
"data-test-id": "icon-circle-img",
|
|
5501
|
+
src: item.iconUrl,
|
|
5502
|
+
alt: item.name,
|
|
5503
|
+
width: size,
|
|
5504
|
+
height: size,
|
|
5505
|
+
className: "rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 object-cover",
|
|
5506
|
+
onError: () => setImgError(true)
|
|
5507
|
+
}
|
|
5508
|
+
);
|
|
5509
|
+
}
|
|
5510
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5511
|
+
"div",
|
|
5512
|
+
{
|
|
5513
|
+
"data-test-id": "icon-circle-fallback",
|
|
5514
|
+
className: "rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 flex items-center justify-center [font-weight:var(--deframe-widget-font-weight-bold)] text-[color:var(--deframe-widget-color-text-primary-dark)]",
|
|
5515
|
+
style: {
|
|
5516
|
+
width: size,
|
|
5517
|
+
height: size,
|
|
5518
|
+
background: item.color,
|
|
5519
|
+
fontSize: size * 0.33,
|
|
5520
|
+
letterSpacing: "-0.01em"
|
|
5521
|
+
},
|
|
5522
|
+
children: item.name.slice(0, 2).toUpperCase()
|
|
5523
|
+
}
|
|
5524
|
+
);
|
|
5525
|
+
}
|
|
5526
|
+
function TokenIcon2({
|
|
5527
|
+
token,
|
|
5528
|
+
size = 38,
|
|
5529
|
+
badge,
|
|
5530
|
+
badgeSize = 16
|
|
5531
|
+
}) {
|
|
5532
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5533
|
+
"div",
|
|
5534
|
+
{
|
|
5535
|
+
"data-test-id": "swap-to-simple-token-icon",
|
|
5536
|
+
className: "relative flex-shrink-0",
|
|
5537
|
+
style: { width: size, height: size },
|
|
5538
|
+
children: [
|
|
5539
|
+
/* @__PURE__ */ jsxRuntime.jsx(IconCircle, { item: token, size }),
|
|
5540
|
+
badge && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5541
|
+
"div",
|
|
5542
|
+
{
|
|
5543
|
+
"data-test-id": "swap-to-simple-token-badge",
|
|
5544
|
+
className: "absolute -bottom-0.5 -right-0.5 rounded-[var(--deframe-widget-size-radius-full)] shadow-[0_0_0_2px_var(--deframe-widget-color-bg-secondary)]",
|
|
5545
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(IconCircle, { item: badge, size: badgeSize })
|
|
5546
|
+
}
|
|
5547
|
+
)
|
|
5548
|
+
]
|
|
5549
|
+
}
|
|
5550
|
+
);
|
|
5551
|
+
}
|
|
5552
|
+
var SwapToCardViewSimple = ({
|
|
5553
|
+
labels,
|
|
5554
|
+
selectedToken,
|
|
5555
|
+
onTokenClick,
|
|
5556
|
+
onNetworkAndAssetClick,
|
|
5557
|
+
balanceFormatted,
|
|
5558
|
+
balanceUsdFormatted,
|
|
5559
|
+
chainLabel,
|
|
5560
|
+
chainImage,
|
|
5561
|
+
outputAmount,
|
|
5562
|
+
isOutputLoading,
|
|
5563
|
+
outputUsdFormatted,
|
|
5564
|
+
isOutputUsdLoading
|
|
5565
|
+
}) => {
|
|
5566
|
+
const handleTokenClick = onNetworkAndAssetClick != null ? onNetworkAndAssetClick : onTokenClick;
|
|
5567
|
+
const isEmpty = !outputAmount || Number(outputAmount) === 0;
|
|
5568
|
+
const wrapperClasses = tailwindMerge.twMerge(
|
|
5569
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5570
|
+
"border",
|
|
5571
|
+
"border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
5572
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
5573
|
+
"px-[var(--deframe-widget-size-padding-x-md)]",
|
|
5574
|
+
"py-[var(--deframe-widget-size-padding-y-md)]",
|
|
5575
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
5576
|
+
);
|
|
5577
|
+
const selectorBaseClasses = tailwindMerge.twMerge(
|
|
5578
|
+
"inline-flex items-center gap-[10px]",
|
|
5579
|
+
"py-[var(--deframe-widget-size-padding-y-sm)] px-[10px]",
|
|
5580
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5581
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
5582
|
+
"border-none",
|
|
5583
|
+
"outline-none",
|
|
5584
|
+
"transition-[background] duration-150",
|
|
5585
|
+
"flex-shrink-0",
|
|
5586
|
+
"cursor-pointer hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_72%,transparent)]"
|
|
5587
|
+
);
|
|
5588
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "swap-to-card-view-simple", className: wrapperClasses, children: [
|
|
5589
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5590
|
+
"div",
|
|
5591
|
+
{
|
|
5592
|
+
"data-test-id": "swap-to-simple-top-row",
|
|
5593
|
+
className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
5594
|
+
children: [
|
|
5595
|
+
selectedToken ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5596
|
+
"button",
|
|
5597
|
+
{
|
|
5598
|
+
type: "button",
|
|
5599
|
+
"data-test-id": "swap-to-simple-token-selector",
|
|
5600
|
+
onClick: handleTokenClick,
|
|
5601
|
+
"aria-label": `Select token \u2014 currently ${selectedToken.symbol} on ${chainLabel}`,
|
|
5602
|
+
className: selectorBaseClasses,
|
|
5603
|
+
children: [
|
|
5604
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5605
|
+
TokenIcon2,
|
|
5606
|
+
{
|
|
5607
|
+
token: {
|
|
5608
|
+
name: selectedToken.symbol,
|
|
5609
|
+
color: "var(--deframe-widget-color-brand-secondary)",
|
|
5610
|
+
iconUrl: selectedToken.logoURI
|
|
5611
|
+
},
|
|
5612
|
+
size: 38,
|
|
5613
|
+
badge: chainLabel ? {
|
|
5614
|
+
name: chainLabel,
|
|
5615
|
+
color: "var(--deframe-widget-color-brand-secondary)",
|
|
5616
|
+
iconUrl: chainImage
|
|
5617
|
+
} : void 0,
|
|
5618
|
+
badgeSize: 16
|
|
5619
|
+
}
|
|
5620
|
+
),
|
|
5621
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5622
|
+
"div",
|
|
5623
|
+
{
|
|
5624
|
+
"data-test-id": "swap-to-simple-token-info",
|
|
5625
|
+
className: "flex flex-col items-start min-w-0",
|
|
5626
|
+
children: [
|
|
5627
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5628
|
+
"span",
|
|
5629
|
+
{
|
|
5630
|
+
"data-test-id": "swap-to-simple-token-symbol",
|
|
5631
|
+
className: "text-[16px] [font-weight:var(--deframe-widget-font-weight-semibold)] leading-[1.2] font-[var(--deframe-widget-font-family)] text-[color:var(--deframe-widget-color-text-primary)]",
|
|
5632
|
+
children: selectedToken.symbol
|
|
5633
|
+
}
|
|
5634
|
+
),
|
|
5635
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5636
|
+
"span",
|
|
5637
|
+
{
|
|
5638
|
+
"data-test-id": "swap-to-simple-token-network",
|
|
5639
|
+
className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] text-[color:var(--deframe-widget-color-text-tertiary)] uppercase tracking-[0.04em] font-[var(--deframe-widget-font-family)] leading-[1.2]",
|
|
5640
|
+
children: chainLabel
|
|
5641
|
+
}
|
|
5642
|
+
)
|
|
5643
|
+
]
|
|
5644
|
+
}
|
|
5645
|
+
),
|
|
5646
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5647
|
+
"svg",
|
|
5648
|
+
{
|
|
5649
|
+
"data-test-id": "swap-to-simple-chevron",
|
|
5650
|
+
width: "14",
|
|
5651
|
+
height: "14",
|
|
5652
|
+
viewBox: "0 0 24 24",
|
|
5653
|
+
fill: "none",
|
|
5654
|
+
stroke: "currentColor",
|
|
5655
|
+
strokeWidth: "2.5",
|
|
5656
|
+
strokeLinecap: "round",
|
|
5657
|
+
strokeLinejoin: "round",
|
|
5658
|
+
className: "flex-shrink-0 text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5659
|
+
"aria-hidden": "true",
|
|
5660
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "6 9 12 15 18 9" })
|
|
5661
|
+
}
|
|
5662
|
+
)
|
|
5663
|
+
]
|
|
5664
|
+
}
|
|
5665
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5666
|
+
"button",
|
|
5667
|
+
{
|
|
5668
|
+
type: "button",
|
|
5669
|
+
"data-test-id": "swap-to-simple-token-placeholder",
|
|
5670
|
+
onClick: handleTokenClick,
|
|
5671
|
+
"aria-label": labels.selectTokenLabel,
|
|
5672
|
+
className: selectorBaseClasses,
|
|
5673
|
+
children: [
|
|
5674
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5675
|
+
"div",
|
|
5676
|
+
{
|
|
5677
|
+
"data-test-id": "swap-to-simple-placeholder-circle",
|
|
5678
|
+
className: "rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
5679
|
+
style: { width: 38, height: 38 }
|
|
5680
|
+
}
|
|
5681
|
+
),
|
|
5682
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5683
|
+
"span",
|
|
5684
|
+
{
|
|
5685
|
+
"data-test-id": "swap-to-simple-placeholder-label",
|
|
5686
|
+
className: "text-[16px] [font-weight:var(--deframe-widget-font-weight-semibold)] leading-[1.2] font-[var(--deframe-widget-font-family)] text-[color:var(--deframe-widget-color-text-secondary)] whitespace-nowrap",
|
|
5687
|
+
children: labels.selectTokenLabel
|
|
5688
|
+
}
|
|
5689
|
+
),
|
|
5690
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5691
|
+
"svg",
|
|
5692
|
+
{
|
|
5693
|
+
"data-test-id": "swap-to-simple-placeholder-chevron",
|
|
5694
|
+
width: "14",
|
|
5695
|
+
height: "14",
|
|
5696
|
+
viewBox: "0 0 24 24",
|
|
5697
|
+
fill: "none",
|
|
5698
|
+
stroke: "currentColor",
|
|
5699
|
+
strokeWidth: "2.5",
|
|
5700
|
+
strokeLinecap: "round",
|
|
5701
|
+
strokeLinejoin: "round",
|
|
5702
|
+
className: "flex-shrink-0 text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5703
|
+
"aria-hidden": "true",
|
|
5704
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "6 9 12 15 18 9" })
|
|
5705
|
+
}
|
|
5706
|
+
)
|
|
5707
|
+
]
|
|
5708
|
+
}
|
|
5709
|
+
),
|
|
5710
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5711
|
+
"div",
|
|
5712
|
+
{
|
|
5713
|
+
"data-test-id": "swap-to-simple-divider",
|
|
5714
|
+
className: "w-px h-10 bg-[var(--deframe-widget-color-border-secondary)] flex-shrink-0"
|
|
5715
|
+
}
|
|
5716
|
+
),
|
|
5717
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5718
|
+
"div",
|
|
5719
|
+
{
|
|
5720
|
+
"data-test-id": "swap-to-simple-output-wrapper",
|
|
5721
|
+
className: "flex flex-col items-end flex-1 min-w-0",
|
|
5722
|
+
children: [
|
|
5723
|
+
isOutputLoading ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5724
|
+
"span",
|
|
5725
|
+
{
|
|
5726
|
+
"data-test-id": "swap-to-simple-output-loading",
|
|
5727
|
+
className: tailwindMerge.twMerge(
|
|
5728
|
+
"text-[36px] [font-weight:var(--deframe-widget-font-weight-semibold)] [line-height:1.1]",
|
|
5729
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5730
|
+
"text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
5731
|
+
"text-right",
|
|
5732
|
+
"flex items-center"
|
|
5733
|
+
),
|
|
5734
|
+
children: [
|
|
5735
|
+
labels.searchingQuoteLabel,
|
|
5736
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {})
|
|
5737
|
+
]
|
|
5738
|
+
}
|
|
5739
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5740
|
+
"span",
|
|
5741
|
+
{
|
|
5742
|
+
"data-test-id": "swap-to-simple-output-amount",
|
|
5743
|
+
className: tailwindMerge.twMerge(
|
|
5744
|
+
"text-[36px] [font-weight:var(--deframe-widget-font-weight-semibold)] [line-height:1.1]",
|
|
5745
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5746
|
+
"text-right w-full",
|
|
5747
|
+
isEmpty ? "text-[color:var(--deframe-widget-color-text-tertiary)]" : "text-[color:var(--deframe-widget-color-text-primary)]"
|
|
5748
|
+
),
|
|
5749
|
+
children: isEmpty ? "0" : outputAmount
|
|
5750
|
+
}
|
|
5751
|
+
),
|
|
5752
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5753
|
+
"span",
|
|
5754
|
+
{
|
|
5755
|
+
"data-test-id": "swap-to-simple-output-usd",
|
|
5756
|
+
className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
5757
|
+
children: isOutputUsdLoading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {}) : outputUsdFormatted
|
|
5758
|
+
}
|
|
5759
|
+
)
|
|
5760
|
+
]
|
|
5761
|
+
}
|
|
5762
|
+
)
|
|
5763
|
+
]
|
|
5764
|
+
}
|
|
5765
|
+
),
|
|
5766
|
+
selectedToken && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5767
|
+
"div",
|
|
5768
|
+
{
|
|
5769
|
+
"data-test-id": "swap-to-simple-balance-row",
|
|
5770
|
+
className: "flex items-center justify-between mt-[var(--deframe-widget-size-gap-sm)]",
|
|
5771
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5772
|
+
"span",
|
|
5773
|
+
{
|
|
5774
|
+
"data-test-id": "swap-to-simple-balance",
|
|
5775
|
+
className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
5776
|
+
children: [
|
|
5777
|
+
labels.balanceLabel,
|
|
5778
|
+
":",
|
|
5779
|
+
" ",
|
|
5780
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5781
|
+
"span",
|
|
5782
|
+
{
|
|
5783
|
+
"data-test-id": "swap-to-simple-balance-value",
|
|
5784
|
+
className: "text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5785
|
+
children: balanceFormatted
|
|
5786
|
+
}
|
|
5787
|
+
)
|
|
5788
|
+
]
|
|
5789
|
+
}
|
|
5790
|
+
)
|
|
5791
|
+
}
|
|
5792
|
+
)
|
|
5793
|
+
] });
|
|
5794
|
+
};
|
|
5795
|
+
function Spinner() {
|
|
5796
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5797
|
+
"svg",
|
|
5798
|
+
{
|
|
5799
|
+
"data-test-id": "confirm-swap-button-simple-spinner",
|
|
5800
|
+
width: "18",
|
|
5801
|
+
height: "18",
|
|
5802
|
+
viewBox: "0 0 24 24",
|
|
5803
|
+
fill: "none",
|
|
5804
|
+
stroke: "currentColor",
|
|
5805
|
+
strokeWidth: "2.5",
|
|
5806
|
+
strokeLinecap: "round",
|
|
5807
|
+
className: "animate-spin",
|
|
5808
|
+
"aria-hidden": "true",
|
|
5809
|
+
children: [
|
|
5810
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10", opacity: "0.3" }),
|
|
5811
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2 A10 10 0 0 1 22 12" })
|
|
5812
|
+
]
|
|
5813
|
+
}
|
|
5814
|
+
);
|
|
5815
|
+
}
|
|
5816
|
+
var ConfirmSwapButtonViewSimple = ({
|
|
5817
|
+
buttonLabel,
|
|
5818
|
+
disabled,
|
|
5819
|
+
isLoading,
|
|
5820
|
+
onClick
|
|
5821
|
+
}) => {
|
|
5822
|
+
const isDisabled = disabled || isLoading;
|
|
5823
|
+
const buttonClasses = tailwindMerge.twMerge(
|
|
5824
|
+
"w-full h-12",
|
|
5825
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5826
|
+
"border-none",
|
|
5827
|
+
"text-[15px] [font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
5828
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5829
|
+
"transition-[background,color] duration-200",
|
|
5830
|
+
"flex items-center justify-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
5831
|
+
isDisabled ? "bg-[var(--deframe-widget-color-brand-primary-disabled)] text-[color:var(--deframe-widget-color-text-primary-disabled)] cursor-not-allowed" : "bg-[var(--deframe-widget-color-brand-primary)] text-[color:var(--deframe-widget-color-text-primary-dark)] cursor-pointer"
|
|
5832
|
+
);
|
|
5833
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "confirm-swap-button-simple-wrapper", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5834
|
+
"button",
|
|
5835
|
+
{
|
|
5836
|
+
"data-test-id": "confirm-swap-button-simple",
|
|
5837
|
+
onClick: !isDisabled ? onClick : void 0,
|
|
5838
|
+
disabled: isDisabled,
|
|
5839
|
+
"aria-label": buttonLabel,
|
|
5840
|
+
className: buttonClasses,
|
|
5841
|
+
children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : buttonLabel
|
|
5842
|
+
}
|
|
5843
|
+
) });
|
|
5844
|
+
};
|
|
5845
|
+
var SwapFormViewSimple = ({
|
|
5846
|
+
onSubmit,
|
|
5847
|
+
formRef,
|
|
5848
|
+
labels,
|
|
5849
|
+
onHistoryClick,
|
|
5850
|
+
onSwitchTokens,
|
|
5851
|
+
switchTokensAriaLabel,
|
|
5852
|
+
fromCard,
|
|
5853
|
+
toCard,
|
|
5854
|
+
advancedSettings,
|
|
5855
|
+
transactionDetails,
|
|
5856
|
+
confirmButton
|
|
5857
|
+
}) => {
|
|
5858
|
+
const containerRef = React6.useRef(null);
|
|
5859
|
+
const [panelPos, setPanelPos] = React6.useState(null);
|
|
5860
|
+
const [showPanel, setShowPanel] = React6.useState(false);
|
|
5861
|
+
React6.useEffect(() => {
|
|
5862
|
+
if (!advancedSettings.isOpen) setShowPanel(false);
|
|
5863
|
+
}, [advancedSettings.isOpen]);
|
|
5864
|
+
const updatePanelPos = React6.useCallback(() => {
|
|
5865
|
+
if (containerRef.current && showPanel) {
|
|
5866
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
5867
|
+
setPanelPos({ top: rect.top, left: rect.right + 16 });
|
|
5868
|
+
}
|
|
5869
|
+
}, [showPanel]);
|
|
5870
|
+
React6.useEffect(() => {
|
|
5871
|
+
if (!showPanel) {
|
|
5872
|
+
setPanelPos(null);
|
|
5873
|
+
return;
|
|
5874
|
+
}
|
|
5875
|
+
updatePanelPos();
|
|
5876
|
+
window.addEventListener("scroll", updatePanelPos, true);
|
|
5877
|
+
window.addEventListener("resize", updatePanelPos);
|
|
5878
|
+
return () => {
|
|
5879
|
+
window.removeEventListener("scroll", updatePanelPos, true);
|
|
5880
|
+
window.removeEventListener("resize", updatePanelPos);
|
|
5881
|
+
};
|
|
5882
|
+
}, [showPanel, updatePanelPos]);
|
|
5883
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5884
|
+
"div",
|
|
5885
|
+
{
|
|
5886
|
+
ref: containerRef,
|
|
5887
|
+
"data-test-id": "swap-form-view-simple",
|
|
5888
|
+
className: tailwindMerge.twMerge(
|
|
5889
|
+
"relative",
|
|
5890
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
5891
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
5892
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
5893
|
+
"flex flex-col",
|
|
5894
|
+
`w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] shrink-0 box-border`,
|
|
5895
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
5896
|
+
),
|
|
5897
|
+
style: { minHeight: SWAP_SIMPLE_MIN_HEIGHT },
|
|
5898
|
+
children: [
|
|
5899
|
+
/* @__PURE__ */ jsxRuntime.jsxs("form", { ref: formRef, onSubmit, "data-test-id": "swap-form-simple-form", className: "flex flex-col flex-1", children: [
|
|
5900
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
5901
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5902
|
+
"div",
|
|
5903
|
+
{
|
|
5904
|
+
"data-test-id": "swap-form-simple-top-row",
|
|
5905
|
+
className: "flex items-center justify-end mb-[var(--deframe-widget-size-gap-sm)]",
|
|
5906
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(HistoryButton, { onClick: onHistoryClick, ariaLabel: labels.historyAriaLabel })
|
|
5907
|
+
}
|
|
5908
|
+
),
|
|
5909
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5910
|
+
SwapFromCardViewSimple,
|
|
5911
|
+
__spreadProps(__spreadValues({}, fromCard), {
|
|
5912
|
+
onNetworkAndAssetClick: fromCard.onNetworkAndAssetClick ? () => {
|
|
5913
|
+
setShowPanel(false);
|
|
5914
|
+
fromCard.onNetworkAndAssetClick();
|
|
5915
|
+
} : void 0,
|
|
5916
|
+
percentageOptions: advancedSettings.percentageOptions,
|
|
5917
|
+
onPercentageClick: (pct) => advancedSettings.onPercentageClick(pct),
|
|
5918
|
+
maxLabel: advancedSettings.maxLabel
|
|
5919
|
+
})
|
|
5920
|
+
),
|
|
5921
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5922
|
+
"div",
|
|
5923
|
+
{
|
|
5924
|
+
"data-test-id": "swap-form-simple-direction-row",
|
|
5925
|
+
className: "flex justify-center relative -my-[16px] z-[1]",
|
|
5926
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5927
|
+
SwapDirectionButton,
|
|
5928
|
+
{
|
|
5929
|
+
onClick: onSwitchTokens,
|
|
5930
|
+
ariaLabel: switchTokensAriaLabel
|
|
5931
|
+
}
|
|
5932
|
+
)
|
|
5933
|
+
}
|
|
5934
|
+
),
|
|
5935
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5936
|
+
SwapToCardViewSimple,
|
|
5937
|
+
__spreadProps(__spreadValues({}, toCard), {
|
|
5938
|
+
onNetworkAndAssetClick: toCard.onNetworkAndAssetClick ? () => {
|
|
5939
|
+
setShowPanel(false);
|
|
5940
|
+
toCard.onNetworkAndAssetClick();
|
|
5941
|
+
} : void 0
|
|
5942
|
+
})
|
|
5943
|
+
),
|
|
5944
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5945
|
+
"div",
|
|
5946
|
+
{
|
|
5947
|
+
"data-test-id": "swap-form-simple-advanced-wrapper",
|
|
5948
|
+
className: "flex justify-end mt-[var(--deframe-widget-size-gap-sm)]",
|
|
5949
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5950
|
+
AdvancedPill,
|
|
5951
|
+
{
|
|
5952
|
+
label: "Avan\xE7ado",
|
|
5953
|
+
isOpen: showPanel,
|
|
5954
|
+
onClick: () => {
|
|
5955
|
+
const next = !showPanel;
|
|
5956
|
+
setShowPanel(next);
|
|
5957
|
+
advancedSettings.onOpenChange(next);
|
|
5958
|
+
}
|
|
5959
|
+
}
|
|
5960
|
+
)
|
|
5961
|
+
}
|
|
5962
|
+
)
|
|
5963
|
+
] }),
|
|
5964
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
|
|
5965
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(ConfirmSwapButtonViewSimple, __spreadValues({}, confirmButton)) })
|
|
5966
|
+
] }),
|
|
5967
|
+
showPanel && panelPos && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5968
|
+
"div",
|
|
5969
|
+
{
|
|
5970
|
+
"data-test-id": "swap-form-simple-advanced-panel",
|
|
5971
|
+
className: tailwindMerge.twMerge(
|
|
5972
|
+
"fixed",
|
|
5973
|
+
"w-[320px] z-[9999]",
|
|
5974
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
5975
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
5976
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
5977
|
+
"shadow-[0px_4px_24px_0px_#0000003D]",
|
|
5978
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
5979
|
+
),
|
|
5980
|
+
style: { top: panelPos.top, left: panelPos.left },
|
|
5981
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5982
|
+
AdvancedPanelContent,
|
|
5983
|
+
{
|
|
5984
|
+
advancedSettings: __spreadProps(__spreadValues({}, advancedSettings), {
|
|
5985
|
+
onOpenChange: (open) => {
|
|
5986
|
+
setShowPanel(open);
|
|
5987
|
+
advancedSettings.onOpenChange(open);
|
|
5988
|
+
}
|
|
5989
|
+
}),
|
|
5990
|
+
transactionDetails
|
|
5991
|
+
}
|
|
5992
|
+
)
|
|
5993
|
+
}
|
|
5994
|
+
)
|
|
5995
|
+
]
|
|
5996
|
+
}
|
|
5997
|
+
);
|
|
5998
|
+
};
|
|
5999
|
+
function HistoryButton({ onClick, ariaLabel }) {
|
|
6000
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6001
|
+
"button",
|
|
6002
|
+
{
|
|
6003
|
+
"data-test-id": "swap-form-simple-history-button",
|
|
6004
|
+
type: "button",
|
|
6005
|
+
onClick,
|
|
6006
|
+
"aria-label": ariaLabel,
|
|
6007
|
+
className: tailwindMerge.twMerge(
|
|
6008
|
+
"inline-flex items-center justify-center",
|
|
6009
|
+
"w-9 h-9",
|
|
6010
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6011
|
+
"border-none",
|
|
6012
|
+
"cursor-pointer",
|
|
6013
|
+
"bg-transparent",
|
|
6014
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
|
|
6015
|
+
"transition-[background] duration-150",
|
|
6016
|
+
"flex-shrink-0",
|
|
6017
|
+
"outline-none",
|
|
6018
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]"
|
|
6019
|
+
),
|
|
6020
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6021
|
+
"svg",
|
|
6022
|
+
{
|
|
6023
|
+
"data-test-id": "swap-form-simple-history-icon",
|
|
6024
|
+
viewBox: "0 0 24 24",
|
|
6025
|
+
width: "20",
|
|
6026
|
+
height: "20",
|
|
6027
|
+
fill: "none",
|
|
6028
|
+
stroke: "currentColor",
|
|
6029
|
+
strokeWidth: "2",
|
|
6030
|
+
strokeLinecap: "round",
|
|
6031
|
+
strokeLinejoin: "round",
|
|
6032
|
+
"aria-hidden": "true",
|
|
6033
|
+
children: [
|
|
6034
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
6035
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "12 6 12 12 16 14" })
|
|
6036
|
+
]
|
|
6037
|
+
}
|
|
6038
|
+
)
|
|
6039
|
+
}
|
|
6040
|
+
);
|
|
6041
|
+
}
|
|
6042
|
+
function SwapDirectionButton({ onClick, ariaLabel }) {
|
|
6043
|
+
const [isHovered, setIsHovered] = React6.useState(false);
|
|
6044
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6045
|
+
framerMotion.motion.button,
|
|
6046
|
+
{
|
|
6047
|
+
"data-test-id": "swap-form-simple-direction-button",
|
|
6048
|
+
type: "button",
|
|
6049
|
+
onClick,
|
|
6050
|
+
onMouseEnter: () => setIsHovered(true),
|
|
6051
|
+
onMouseLeave: () => setIsHovered(false),
|
|
6052
|
+
animate: { rotate: isHovered ? 180 : 0 },
|
|
6053
|
+
transition: { duration: 0.25, ease: "easeInOut" },
|
|
6054
|
+
"aria-label": ariaLabel,
|
|
6055
|
+
className: tailwindMerge.twMerge(
|
|
6056
|
+
"inline-flex items-center justify-center",
|
|
6057
|
+
"w-10 h-10",
|
|
6058
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6059
|
+
"bg-[#12151c]",
|
|
6060
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
6061
|
+
"outline-none",
|
|
6062
|
+
"flex-shrink-0",
|
|
6063
|
+
"shadow-[0px_2px_8px_0px_#0000003D]",
|
|
6064
|
+
"cursor-pointer text-[color:var(--deframe-widget-color-brand-primary)]"
|
|
6065
|
+
),
|
|
6066
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6067
|
+
"svg",
|
|
6068
|
+
{
|
|
6069
|
+
"data-test-id": "swap-form-simple-direction-icon",
|
|
6070
|
+
width: "18",
|
|
6071
|
+
height: "18",
|
|
6072
|
+
viewBox: "0 0 24 24",
|
|
6073
|
+
fill: "none",
|
|
6074
|
+
stroke: "currentColor",
|
|
6075
|
+
strokeWidth: "2.5",
|
|
6076
|
+
strokeLinecap: "round",
|
|
6077
|
+
strokeLinejoin: "round",
|
|
6078
|
+
"aria-hidden": "true",
|
|
6079
|
+
children: [
|
|
6080
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
6081
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "19 12 12 19 5 12" })
|
|
6082
|
+
]
|
|
6083
|
+
}
|
|
6084
|
+
)
|
|
6085
|
+
}
|
|
6086
|
+
);
|
|
6087
|
+
}
|
|
6088
|
+
function AdvancedPill({ label, isOpen, onClick }) {
|
|
6089
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6090
|
+
"button",
|
|
6091
|
+
{
|
|
6092
|
+
"data-test-id": "swap-form-simple-advanced-pill",
|
|
6093
|
+
type: "button",
|
|
6094
|
+
onClick,
|
|
6095
|
+
className: tailwindMerge.twMerge(
|
|
6096
|
+
"inline-flex items-center gap-[5px]",
|
|
6097
|
+
"py-[5px] px-[var(--deframe-widget-size-padding-x-sm)]",
|
|
6098
|
+
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
6099
|
+
isOpen ? "border border-[color:var(--deframe-widget-color-brand-primary)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)]" : "border border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_32%,transparent)] bg-transparent",
|
|
6100
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)]",
|
|
6101
|
+
"cursor-pointer",
|
|
6102
|
+
"text-[color:var(--deframe-widget-color-brand-primary)]",
|
|
6103
|
+
"text-[13px] [font-weight:var(--deframe-widget-font-weight-medium)]",
|
|
6104
|
+
"outline-none",
|
|
6105
|
+
"font-[inherit]",
|
|
6106
|
+
"transition-[background] duration-150",
|
|
6107
|
+
"flex-shrink-0"
|
|
6108
|
+
),
|
|
6109
|
+
children: [
|
|
6110
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6111
|
+
"svg",
|
|
6112
|
+
{
|
|
6113
|
+
"data-test-id": "swap-form-simple-advanced-pill-icon",
|
|
6114
|
+
width: "13",
|
|
6115
|
+
height: "13",
|
|
6116
|
+
viewBox: "0 0 24 24",
|
|
6117
|
+
fill: "none",
|
|
6118
|
+
stroke: "currentColor",
|
|
6119
|
+
strokeWidth: "2.5",
|
|
6120
|
+
strokeLinecap: "round",
|
|
6121
|
+
strokeLinejoin: "round",
|
|
6122
|
+
"aria-hidden": "true",
|
|
6123
|
+
children: [
|
|
6124
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", y1: "6", x2: "20", y2: "6" }),
|
|
6125
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", y1: "12", x2: "20", y2: "12" }),
|
|
6126
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", y1: "18", x2: "20", y2: "18" }),
|
|
6127
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "6", r: "2", fill: "currentColor", stroke: "none" }),
|
|
6128
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "16", cy: "12", r: "2", fill: "currentColor", stroke: "none" }),
|
|
6129
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "10", cy: "18", r: "2", fill: "currentColor", stroke: "none" })
|
|
6130
|
+
]
|
|
6131
|
+
}
|
|
6132
|
+
),
|
|
6133
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-test-id": "swap-form-simple-advanced-pill-label", children: label })
|
|
6134
|
+
]
|
|
6135
|
+
}
|
|
6136
|
+
);
|
|
6137
|
+
}
|
|
6138
|
+
function AdvancedPanelContent({ advancedSettings, transactionDetails }) {
|
|
6139
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6140
|
+
"div",
|
|
6141
|
+
{
|
|
6142
|
+
"data-test-id": "swap-form-simple-advanced-panel-content",
|
|
6143
|
+
className: "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
6144
|
+
children: [
|
|
6145
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6146
|
+
"div",
|
|
6147
|
+
{
|
|
6148
|
+
"data-test-id": "swap-form-simple-advanced-panel-header",
|
|
6149
|
+
className: "flex justify-between items-center mb-[6px]",
|
|
6150
|
+
children: [
|
|
6151
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6152
|
+
"span",
|
|
6153
|
+
{
|
|
6154
|
+
"data-test-id": "swap-form-simple-advanced-panel-title",
|
|
6155
|
+
className: "text-[15px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] font-[inherit]",
|
|
6156
|
+
children: "Avan\xE7ado"
|
|
6157
|
+
}
|
|
6158
|
+
),
|
|
6159
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6160
|
+
"button",
|
|
6161
|
+
{
|
|
6162
|
+
"data-test-id": "swap-form-simple-advanced-panel-close",
|
|
6163
|
+
type: "button",
|
|
6164
|
+
onClick: () => advancedSettings.onOpenChange(false),
|
|
6165
|
+
"aria-label": "Close advanced panel",
|
|
6166
|
+
className: tailwindMerge.twMerge(
|
|
6167
|
+
"inline-flex items-center justify-center",
|
|
6168
|
+
"w-7 h-7",
|
|
6169
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6170
|
+
"border-none cursor-pointer bg-transparent",
|
|
6171
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
|
|
6172
|
+
"transition-[background] duration-150",
|
|
6173
|
+
"flex-shrink-0 outline-none",
|
|
6174
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]"
|
|
6175
|
+
),
|
|
6176
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6177
|
+
"svg",
|
|
6178
|
+
{
|
|
6179
|
+
"data-test-id": "swap-form-simple-advanced-panel-close-icon",
|
|
6180
|
+
viewBox: "0 0 24 24",
|
|
6181
|
+
width: "16",
|
|
6182
|
+
height: "16",
|
|
6183
|
+
fill: "currentColor",
|
|
6184
|
+
"aria-hidden": "true",
|
|
6185
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z" })
|
|
6186
|
+
}
|
|
6187
|
+
)
|
|
6188
|
+
}
|
|
6189
|
+
)
|
|
6190
|
+
]
|
|
6191
|
+
}
|
|
6192
|
+
),
|
|
6193
|
+
transactionDetails.exchangeRateFormatted && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6194
|
+
"p",
|
|
6195
|
+
{
|
|
6196
|
+
"data-test-id": "swap-form-simple-advanced-panel-subtitle",
|
|
6197
|
+
className: "text-[13px] text-[color:var(--deframe-widget-color-text-secondary)] m-0 mb-[var(--deframe-widget-size-gap-sm)] leading-[1.4] font-[inherit]",
|
|
6198
|
+
children: transactionDetails.exchangeRateFormatted
|
|
6199
|
+
}
|
|
6200
|
+
),
|
|
6201
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6202
|
+
"div",
|
|
6203
|
+
{
|
|
6204
|
+
"data-test-id": "swap-form-simple-advanced-panel-divider",
|
|
6205
|
+
className: "h-px bg-[var(--deframe-widget-color-border-secondary)] mt-[var(--deframe-widget-size-gap-sm)]"
|
|
6206
|
+
}
|
|
6207
|
+
),
|
|
6208
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.exchangeRateLabel, value: transactionDetails.exchangeRateFormatted }),
|
|
6209
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.blockchainCostsLabel, value: transactionDetails.totalCostFormatted }),
|
|
6210
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.networkGasLabel, value: transactionDetails.gasCostFormatted }),
|
|
6211
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.protocolFeeLabel, value: transactionDetails.protocolFee }),
|
|
6212
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.slippageLabel, value: transactionDetails.slippageFormatted }),
|
|
6213
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.etaLabel, value: transactionDetails.etaFormatted }),
|
|
6214
|
+
transactionDetails.quoteId && /* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.quoteIdLabel, value: transactionDetails.quoteId }),
|
|
6215
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6216
|
+
"div",
|
|
6217
|
+
{
|
|
6218
|
+
"data-test-id": "swap-form-simple-advanced-panel-divider-2",
|
|
6219
|
+
className: "h-px bg-[var(--deframe-widget-color-border-secondary)] my-[var(--deframe-widget-size-gap-sm)]"
|
|
6220
|
+
}
|
|
6221
|
+
),
|
|
6222
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "swap-form-simple-advanced-panel-slippage", children: [
|
|
6223
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6224
|
+
"span",
|
|
6225
|
+
{
|
|
6226
|
+
"data-test-id": "swap-form-simple-advanced-panel-slippage-label",
|
|
6227
|
+
className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] uppercase tracking-[0.07em] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
6228
|
+
children: [
|
|
6229
|
+
"Slippage: ",
|
|
6230
|
+
advancedSettings.slippageFormatted
|
|
6231
|
+
]
|
|
6232
|
+
}
|
|
6233
|
+
),
|
|
6234
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6235
|
+
"div",
|
|
6236
|
+
{
|
|
6237
|
+
"data-test-id": "swap-form-simple-advanced-panel-slippage-buttons",
|
|
6238
|
+
className: "flex gap-[6px] mt-[var(--deframe-widget-size-gap-sm)]",
|
|
6239
|
+
children: [10, 50, 100].map((bps) => {
|
|
6240
|
+
const isActive = advancedSettings.slippageBps === bps;
|
|
6241
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6242
|
+
"button",
|
|
6243
|
+
{
|
|
6244
|
+
"data-test-id": "swap-form-simple-slippage-btn",
|
|
6245
|
+
type: "button",
|
|
6246
|
+
onClick: () => advancedSettings.onSlippageSelect(bps),
|
|
6247
|
+
className: tailwindMerge.twMerge(
|
|
6248
|
+
"py-[3px] px-[10px]",
|
|
6249
|
+
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
6250
|
+
"text-[12px] font-[var(--deframe-widget-font-family)]",
|
|
6251
|
+
"border cursor-pointer outline-none",
|
|
6252
|
+
"transition-all duration-150",
|
|
6253
|
+
isActive ? "border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_32%,transparent)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)] text-[color:var(--deframe-widget-color-brand-primary)] [font-weight:var(--deframe-widget-font-weight-semibold)]" : "border-[color:var(--deframe-widget-color-border-secondary)] bg-transparent text-[color:var(--deframe-widget-color-text-secondary)] hover:border-[color:var(--deframe-widget-color-border-primary)]"
|
|
6254
|
+
),
|
|
6255
|
+
children: advancedSettings.formatPercentage(bps)
|
|
6256
|
+
},
|
|
6257
|
+
bps
|
|
6258
|
+
);
|
|
6259
|
+
})
|
|
6260
|
+
}
|
|
6261
|
+
)
|
|
6262
|
+
] })
|
|
6263
|
+
]
|
|
6264
|
+
}
|
|
6265
|
+
);
|
|
6266
|
+
}
|
|
6267
|
+
function DetailRow({ label, value }) {
|
|
6268
|
+
if (!label && !value) return null;
|
|
6269
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6270
|
+
"div",
|
|
6271
|
+
{
|
|
6272
|
+
"data-test-id": "swap-form-simple-detail-row",
|
|
6273
|
+
className: "flex justify-between items-center py-[10px] gap-[var(--deframe-widget-size-gap-sm)]",
|
|
6274
|
+
children: [
|
|
6275
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6276
|
+
"span",
|
|
6277
|
+
{
|
|
6278
|
+
"data-test-id": "swap-form-simple-detail-row-label",
|
|
6279
|
+
className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] uppercase tracking-[0.07em] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)] flex-shrink-0",
|
|
6280
|
+
children: label
|
|
6281
|
+
}
|
|
6282
|
+
),
|
|
6283
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6284
|
+
"span",
|
|
6285
|
+
{
|
|
6286
|
+
"data-test-id": "swap-form-simple-detail-row-value",
|
|
6287
|
+
className: "text-[13px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-right font-[var(--deframe-widget-font-family)] text-[color:var(--deframe-widget-color-text-primary)]",
|
|
6288
|
+
children: value
|
|
6289
|
+
}
|
|
6290
|
+
)
|
|
6291
|
+
]
|
|
6292
|
+
}
|
|
6293
|
+
);
|
|
6294
|
+
}
|
|
6295
|
+
var ChooseANetworkView = ({
|
|
6296
|
+
labels,
|
|
6297
|
+
autoFocus = true,
|
|
6298
|
+
chains,
|
|
6299
|
+
pageSize = 10,
|
|
6300
|
+
onChainClick
|
|
6301
|
+
}) => {
|
|
6302
|
+
const [searchValue, setSearchValue] = React6.useState("");
|
|
6303
|
+
const [page, setPage] = React6.useState(1);
|
|
6304
|
+
React6.useEffect(() => {
|
|
6305
|
+
setPage(1);
|
|
6306
|
+
}, [searchValue]);
|
|
6307
|
+
const filteredChains = chains.filter(
|
|
6308
|
+
(chain) => chain.name.toLowerCase().includes(searchValue.toLowerCase())
|
|
6309
|
+
);
|
|
6310
|
+
const displayedChains = filteredChains.slice(0, page * pageSize);
|
|
6311
|
+
const hasMore = filteredChains.length > page * pageSize;
|
|
6312
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BackgroundContainer, { className: "flex flex-col h-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col flex-1 w-full p-[var(--deframe-widget-size-padding-x-lg)] overflow-hidden", children: [
|
|
6313
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0", children: [
|
|
6314
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { children: labels.title }),
|
|
6315
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
6316
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6317
|
+
SearchInput,
|
|
6318
|
+
{
|
|
6319
|
+
value: searchValue,
|
|
6320
|
+
onChange: setSearchValue,
|
|
6321
|
+
placeholder: labels.searchPlaceholder,
|
|
6322
|
+
autoFocus
|
|
6323
|
+
}
|
|
6324
|
+
)
|
|
6325
|
+
] }),
|
|
6326
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6327
|
+
"div",
|
|
6328
|
+
{
|
|
6329
|
+
"data-testid": "choose-a-network-list",
|
|
6330
|
+
className: "flex flex-col gap-[var(--deframe-widget-size-gap-xs)] w-full mt-[var(--deframe-widget-size-gap-md)] overflow-y-auto flex-1 min-h-0",
|
|
6331
|
+
children: [
|
|
6332
|
+
displayedChains.map((chain) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6333
|
+
ListItem,
|
|
6334
|
+
{
|
|
6335
|
+
className: "w-full flex-shrink-0",
|
|
6336
|
+
onClick: () => onChainClick(chain.chainId),
|
|
6337
|
+
"data-testid": `choose-network-item-${chain.chainId}`,
|
|
6338
|
+
"data-chain-id": chain.chainId,
|
|
6339
|
+
children: [
|
|
6340
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6341
|
+
"img",
|
|
6342
|
+
{
|
|
6343
|
+
src: chain.imageUrl,
|
|
6344
|
+
alt: chain.name,
|
|
6345
|
+
className: "w-10 h-10 rounded-[var(--deframe-widget-size-radius-full)]"
|
|
6346
|
+
}
|
|
6347
|
+
) }),
|
|
6348
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemContent, { children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { children: chain.name }) })
|
|
6349
|
+
]
|
|
6350
|
+
},
|
|
6351
|
+
`chain-${chain.chainId}`
|
|
6352
|
+
)),
|
|
6353
|
+
hasMore && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center items-center w-full py-[var(--deframe-widget-size-padding-y-md)] flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(TertiaryButton, { onClick: () => setPage(page + 1), children: labels.loadMoreLabel }) })
|
|
6354
|
+
]
|
|
6355
|
+
}
|
|
6356
|
+
)
|
|
6357
|
+
] }) });
|
|
6358
|
+
};
|
|
6359
|
+
function useIsMobile(breakpoint = 640) {
|
|
6360
|
+
const [isMobile, setIsMobile] = React6.useState(
|
|
6361
|
+
typeof window !== "undefined" ? window.innerWidth < breakpoint : false
|
|
6362
|
+
);
|
|
6363
|
+
React6.useEffect(() => {
|
|
6364
|
+
const check = () => setIsMobile(window.innerWidth < breakpoint);
|
|
6365
|
+
check();
|
|
6366
|
+
window.addEventListener("resize", check);
|
|
6367
|
+
return () => window.removeEventListener("resize", check);
|
|
6368
|
+
}, [breakpoint]);
|
|
6369
|
+
return isMobile;
|
|
6370
|
+
}
|
|
6371
|
+
function CloseButtonInline({ onClick, ariaLabel }) {
|
|
6372
|
+
const baseClasses = [
|
|
6373
|
+
"inline-flex items-center justify-center",
|
|
6374
|
+
"w-9 h-9",
|
|
6375
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6376
|
+
"border-none",
|
|
6377
|
+
"cursor-pointer",
|
|
6378
|
+
"bg-transparent",
|
|
6379
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
|
|
6380
|
+
"transition-[background] duration-150",
|
|
6381
|
+
"flex-shrink-0",
|
|
6382
|
+
"outline-none",
|
|
6383
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]"
|
|
6384
|
+
].join(" ");
|
|
6385
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6386
|
+
"button",
|
|
6387
|
+
{
|
|
6388
|
+
"data-test-id": "close-button",
|
|
6389
|
+
onClick,
|
|
6390
|
+
"aria-label": ariaLabel,
|
|
6391
|
+
className: baseClasses,
|
|
6392
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6393
|
+
"svg",
|
|
6394
|
+
{
|
|
6395
|
+
"data-test-id": "close-button-icon",
|
|
6396
|
+
viewBox: "0 0 24 24",
|
|
6397
|
+
width: "20",
|
|
6398
|
+
height: "20",
|
|
6399
|
+
fill: "currentColor",
|
|
6400
|
+
"aria-hidden": "true",
|
|
6401
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z" })
|
|
6402
|
+
}
|
|
6403
|
+
)
|
|
6404
|
+
}
|
|
6405
|
+
);
|
|
6406
|
+
}
|
|
6407
|
+
function IconCircle2({ iconUrl, name, size = 36, className }) {
|
|
6408
|
+
const [imgError, setImgError] = React6__namespace.useState(false);
|
|
6409
|
+
if (iconUrl && !imgError) {
|
|
6410
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6411
|
+
"img",
|
|
6412
|
+
{
|
|
6413
|
+
"data-test-id": "icon-circle-img",
|
|
6414
|
+
src: iconUrl,
|
|
6415
|
+
alt: name,
|
|
6416
|
+
width: size,
|
|
6417
|
+
height: size,
|
|
6418
|
+
className: tailwindMerge.twMerge("rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 object-cover", className),
|
|
6419
|
+
onError: () => setImgError(true)
|
|
6420
|
+
}
|
|
6421
|
+
);
|
|
6422
|
+
}
|
|
6423
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6424
|
+
"div",
|
|
6425
|
+
{
|
|
6426
|
+
"data-test-id": "icon-circle-fallback",
|
|
6427
|
+
className: tailwindMerge.twMerge(
|
|
6428
|
+
"rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 flex items-center justify-center",
|
|
6429
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)] text-[color:var(--deframe-widget-color-text-primary-dark)]",
|
|
6430
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
6431
|
+
className
|
|
6432
|
+
),
|
|
6433
|
+
style: {
|
|
6434
|
+
width: size,
|
|
6435
|
+
height: size,
|
|
6436
|
+
fontSize: size * 0.33,
|
|
6437
|
+
letterSpacing: "-0.01em"
|
|
6438
|
+
},
|
|
6439
|
+
children: name.slice(0, 2).toUpperCase()
|
|
6440
|
+
}
|
|
6441
|
+
);
|
|
6442
|
+
}
|
|
6443
|
+
|
|
6444
|
+
// src/stories/choose-network-and-asset-view/ChooseNetworkAndAssetViewSimple/hasSignificantBalance.ts
|
|
6445
|
+
function hasSignificantBalance(balanceUsd) {
|
|
6446
|
+
if (!balanceUsd) return false;
|
|
6447
|
+
const num = parseFloat(balanceUsd.replace(/[^0-9.-]/g, ""));
|
|
6448
|
+
return !isNaN(num) && num >= 0.01;
|
|
6449
|
+
}
|
|
6450
|
+
function NetworkRow({ network, selected, onClick, onKeyDown, index }) {
|
|
6451
|
+
const baseClasses = [
|
|
6452
|
+
"relative flex items-center gap-[10px]",
|
|
6453
|
+
"py-[9px] px-[var(--deframe-widget-size-padding-x-sm)] pl-[14px]",
|
|
6454
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6455
|
+
"cursor-pointer",
|
|
6456
|
+
"outline-none",
|
|
6457
|
+
"mb-[var(--deframe-widget-size-gap-none)].5",
|
|
6458
|
+
"transition-[background] duration-150"
|
|
6459
|
+
].join(" ");
|
|
6460
|
+
const stateClasses = {
|
|
6461
|
+
selected: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)] hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)]",
|
|
6462
|
+
default: "bg-transparent hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-secondary)_72%,transparent)]"
|
|
6463
|
+
};
|
|
6464
|
+
const rowClasses = tailwindMerge.twMerge(baseClasses, stateClasses[selected ? "selected" : "default"]);
|
|
6465
|
+
const nameClasses = [
|
|
6466
|
+
"text-[14px] [font-weight:var(--deframe-widget-font-weight-medium)]",
|
|
6467
|
+
selected ? "text-[color:var(--deframe-widget-color-text-primary)]" : "text-[color:var(--deframe-widget-color-text-secondary)]"
|
|
6468
|
+
].join(" ");
|
|
6469
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6470
|
+
framerMotion.motion.div,
|
|
6471
|
+
{
|
|
6472
|
+
"data-test-id": "network-row",
|
|
6473
|
+
role: "option",
|
|
6474
|
+
"aria-selected": selected,
|
|
6475
|
+
"aria-label": network.name,
|
|
6476
|
+
tabIndex: 0,
|
|
6477
|
+
onClick,
|
|
6478
|
+
onKeyDown,
|
|
6479
|
+
"data-chain-index": index,
|
|
6480
|
+
className: rowClasses,
|
|
6481
|
+
children: [
|
|
6482
|
+
selected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6483
|
+
framerMotion.motion.div,
|
|
6484
|
+
{
|
|
6485
|
+
"data-test-id": "network-row-accent",
|
|
6486
|
+
layoutId: "chain-accent",
|
|
6487
|
+
className: "absolute left-0 top-2 bottom-2 w-[3px] rounded-[var(--deframe-widget-size-radius-xs)] bg-[var(--deframe-widget-color-brand-primary)]",
|
|
6488
|
+
transition: { type: "spring", stiffness: 400, damping: 30 }
|
|
6489
|
+
}
|
|
6490
|
+
),
|
|
6491
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6492
|
+
IconCircle2,
|
|
6493
|
+
{
|
|
6494
|
+
iconUrl: network.iconUrl,
|
|
6495
|
+
name: network.name,
|
|
6496
|
+
size: 34
|
|
6497
|
+
}
|
|
6498
|
+
),
|
|
6499
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6500
|
+
"div",
|
|
6501
|
+
{
|
|
6502
|
+
"data-test-id": "network-row-content",
|
|
6503
|
+
className: "flex-1 min-w-0",
|
|
6504
|
+
children: [
|
|
6505
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6506
|
+
"div",
|
|
6507
|
+
{
|
|
6508
|
+
"data-test-id": "network-row-name",
|
|
6509
|
+
className: nameClasses,
|
|
6510
|
+
children: network.name
|
|
6511
|
+
}
|
|
6512
|
+
),
|
|
6513
|
+
hasSignificantBalance(network.balanceUsd) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6514
|
+
"div",
|
|
6515
|
+
{
|
|
6516
|
+
"data-test-id": "network-row-balance",
|
|
6517
|
+
className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)] mt-px",
|
|
6518
|
+
children: network.balanceUsd
|
|
6519
|
+
}
|
|
6520
|
+
)
|
|
6521
|
+
]
|
|
6522
|
+
}
|
|
6523
|
+
)
|
|
6524
|
+
]
|
|
6525
|
+
}
|
|
6526
|
+
);
|
|
6527
|
+
}
|
|
6528
|
+
function NetworkChip({ network, selected, onClick }) {
|
|
6529
|
+
const baseClasses = [
|
|
6530
|
+
"inline-flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
6531
|
+
"py-[var(--deframe-widget-size-padding-y-sm)] pl-[var(--deframe-widget-size-padding-x-sm)] pr-[14px]",
|
|
6532
|
+
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
6533
|
+
"cursor-pointer",
|
|
6534
|
+
"whitespace-nowrap",
|
|
6535
|
+
"transition-all duration-150",
|
|
6536
|
+
"flex-shrink-0",
|
|
6537
|
+
"outline-none",
|
|
6538
|
+
"border"
|
|
6539
|
+
].join(" ");
|
|
6540
|
+
const stateClasses = {
|
|
6541
|
+
selected: "border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_32%,transparent)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)]",
|
|
6542
|
+
default: "border-[color:var(--deframe-widget-color-border-secondary)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-secondary)_72%,transparent)]"
|
|
6543
|
+
};
|
|
6544
|
+
const buttonClasses = tailwindMerge.twMerge(baseClasses, stateClasses[selected ? "selected" : "default"]);
|
|
6545
|
+
const nameLabelClasses = [
|
|
6546
|
+
"text-[13px] [font-weight:var(--deframe-widget-font-weight-medium)] leading-[1.2]",
|
|
6547
|
+
selected ? "text-[color:var(--deframe-widget-color-brand-primary)]" : "text-[color:var(--deframe-widget-color-text-secondary)]"
|
|
6548
|
+
].join(" ");
|
|
6549
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6550
|
+
"button",
|
|
6551
|
+
{
|
|
6552
|
+
"data-test-id": "network-chip",
|
|
6553
|
+
onClick,
|
|
6554
|
+
"aria-label": network.name,
|
|
6555
|
+
className: buttonClasses,
|
|
6556
|
+
children: [
|
|
6557
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6558
|
+
IconCircle2,
|
|
6559
|
+
{
|
|
6560
|
+
iconUrl: network.iconUrl,
|
|
6561
|
+
name: network.name,
|
|
6562
|
+
size: 24
|
|
6563
|
+
}
|
|
6564
|
+
),
|
|
6565
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6566
|
+
"div",
|
|
6567
|
+
{
|
|
6568
|
+
"data-test-id": "network-chip-content",
|
|
6569
|
+
className: "text-left",
|
|
6570
|
+
children: [
|
|
6571
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6572
|
+
"div",
|
|
6573
|
+
{
|
|
6574
|
+
"data-test-id": "network-chip-label",
|
|
6575
|
+
className: nameLabelClasses,
|
|
6576
|
+
children: network.name
|
|
6577
|
+
}
|
|
6578
|
+
),
|
|
6579
|
+
hasSignificantBalance(network.balanceUsd) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6580
|
+
"div",
|
|
6581
|
+
{
|
|
6582
|
+
"data-test-id": "network-chip-balance",
|
|
6583
|
+
className: "text-[11px] text-[color:var(--deframe-widget-color-text-tertiary)] leading-[1.4]",
|
|
6584
|
+
children: network.balanceUsd
|
|
6585
|
+
}
|
|
6586
|
+
)
|
|
6587
|
+
]
|
|
6588
|
+
}
|
|
6589
|
+
)
|
|
6590
|
+
]
|
|
6591
|
+
}
|
|
6592
|
+
);
|
|
6593
|
+
}
|
|
6594
|
+
var SearchInputInline = React6__namespace.forwardRef(
|
|
6595
|
+
({ value, onChange, placeholder, onArrowDown, autoFocus }, ref) => {
|
|
6596
|
+
const inputClasses = [
|
|
6597
|
+
"w-full box-border h-10",
|
|
6598
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
6599
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
6600
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6601
|
+
"py-[var(--deframe-widget-size-padding-y-none)] pr-[var(--deframe-widget-size-padding-x-xl)] pl-[14px]",
|
|
6602
|
+
"text-[14px] text-[color:var(--deframe-widget-color-text-primary)]",
|
|
6603
|
+
"outline-none focus:outline-none",
|
|
6604
|
+
"focus:border-[color:var(--deframe-widget-color-brand-primary)]",
|
|
6605
|
+
"transition-colors duration-150",
|
|
6606
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
6607
|
+
"placeholder:text-[color:var(--deframe-widget-color-text-tertiary)]"
|
|
6608
|
+
].join(" ");
|
|
6609
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6610
|
+
"div",
|
|
6611
|
+
{
|
|
6612
|
+
"data-test-id": "search-input-wrapper",
|
|
6613
|
+
className: "relative",
|
|
6614
|
+
children: [
|
|
6615
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6616
|
+
"input",
|
|
6617
|
+
{
|
|
6618
|
+
"data-test-id": "search-input",
|
|
6619
|
+
ref,
|
|
6620
|
+
type: "text",
|
|
6621
|
+
value,
|
|
6622
|
+
onChange: (e) => onChange(e.target.value),
|
|
6623
|
+
placeholder,
|
|
6624
|
+
"aria-label": placeholder,
|
|
6625
|
+
autoFocus,
|
|
6626
|
+
onKeyDown: (e) => {
|
|
6627
|
+
if (e.key === "ArrowDown") {
|
|
6628
|
+
e.preventDefault();
|
|
6629
|
+
onArrowDown == null ? void 0 : onArrowDown();
|
|
6630
|
+
}
|
|
6631
|
+
},
|
|
6632
|
+
className: inputClasses
|
|
6633
|
+
}
|
|
6634
|
+
),
|
|
6635
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6636
|
+
"div",
|
|
6637
|
+
{
|
|
6638
|
+
"data-test-id": "search-input-icon",
|
|
6639
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
6640
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6641
|
+
"svg",
|
|
6642
|
+
{
|
|
6643
|
+
width: "15",
|
|
6644
|
+
height: "15",
|
|
6645
|
+
viewBox: "0 0 24 24",
|
|
6646
|
+
fill: "none",
|
|
6647
|
+
stroke: "currentColor",
|
|
6648
|
+
strokeWidth: "2",
|
|
6649
|
+
strokeLinecap: "round",
|
|
6650
|
+
"aria-hidden": "true",
|
|
6651
|
+
children: [
|
|
6652
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
6653
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
6654
|
+
]
|
|
6655
|
+
}
|
|
6656
|
+
)
|
|
6657
|
+
}
|
|
6658
|
+
)
|
|
6659
|
+
]
|
|
6660
|
+
}
|
|
6661
|
+
);
|
|
6662
|
+
}
|
|
6663
|
+
);
|
|
6664
|
+
SearchInputInline.displayName = "SearchInputInline";
|
|
6665
|
+
function AssetRowInline({
|
|
6666
|
+
token,
|
|
6667
|
+
balance,
|
|
6668
|
+
formatTokenAmount,
|
|
6669
|
+
formatCurrencyValue,
|
|
6670
|
+
onClick,
|
|
6671
|
+
onKeyDown,
|
|
6672
|
+
index
|
|
6673
|
+
}) {
|
|
6674
|
+
var _a;
|
|
6675
|
+
const hasBalance = !!balance && parseFloat(balance.amountInUSD) >= 0.01;
|
|
6676
|
+
const formattedAmount = balance ? formatTokenAmount(balance.amountUI, (_a = token.priceInUSD) != null ? _a : 0, token.decimals) : void 0;
|
|
6677
|
+
const formattedUsd = balance ? formatCurrencyValue(parseFloat(balance.amountInUSD)) : void 0;
|
|
6678
|
+
const baseClasses = [
|
|
6679
|
+
"group",
|
|
6680
|
+
"relative flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
6681
|
+
"py-[10px] px-[14px]",
|
|
6682
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6683
|
+
"cursor-pointer outline-none",
|
|
6684
|
+
"transition-[background] duration-150"
|
|
6685
|
+
].join(" ");
|
|
6686
|
+
const rowClasses = tailwindMerge.twMerge(baseClasses, "bg-transparent hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-secondary)_72%,transparent)]");
|
|
6687
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6688
|
+
"div",
|
|
6689
|
+
{
|
|
6690
|
+
"data-test-id": "asset-row",
|
|
6691
|
+
role: "option",
|
|
6692
|
+
"aria-selected": false,
|
|
6693
|
+
"aria-label": `${token.name} ${token.symbol}`,
|
|
6694
|
+
tabIndex: 0,
|
|
6695
|
+
onClick,
|
|
6696
|
+
onKeyDown,
|
|
6697
|
+
"data-asset-index": index,
|
|
6698
|
+
className: rowClasses,
|
|
6699
|
+
children: [
|
|
6700
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6701
|
+
IconCircle2,
|
|
6702
|
+
{
|
|
6703
|
+
iconUrl: token.logoURI,
|
|
6704
|
+
name: token.name,
|
|
6705
|
+
size: 38
|
|
6706
|
+
}
|
|
6707
|
+
),
|
|
6708
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6709
|
+
"div",
|
|
6710
|
+
{
|
|
6711
|
+
"data-test-id": "asset-row-content",
|
|
6712
|
+
className: "flex-1 min-w-0",
|
|
6713
|
+
children: [
|
|
6714
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6715
|
+
"div",
|
|
6716
|
+
{
|
|
6717
|
+
"data-test-id": "asset-row-symbol",
|
|
6718
|
+
className: "text-[14px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)]",
|
|
6719
|
+
children: token.symbol
|
|
6720
|
+
}
|
|
6721
|
+
),
|
|
6722
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6723
|
+
"div",
|
|
6724
|
+
{
|
|
6725
|
+
"data-test-id": "asset-row-name",
|
|
6726
|
+
className: "text-[13px] text-[color:var(--deframe-widget-color-text-secondary)] mt-px",
|
|
6727
|
+
children: token.name
|
|
6728
|
+
}
|
|
6729
|
+
)
|
|
6730
|
+
]
|
|
6731
|
+
}
|
|
6732
|
+
),
|
|
6733
|
+
hasBalance ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6734
|
+
"div",
|
|
6735
|
+
{
|
|
6736
|
+
"data-test-id": "asset-row-balance",
|
|
6737
|
+
className: "flex-shrink-0 text-right",
|
|
6738
|
+
children: [
|
|
6739
|
+
formattedAmount && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6740
|
+
"div",
|
|
6741
|
+
{
|
|
6742
|
+
"data-test-id": "asset-row-balance-amount",
|
|
6743
|
+
className: "text-[13px] [font-weight:var(--deframe-widget-font-weight-medium)] text-[color:var(--deframe-widget-color-text-primary)]",
|
|
6744
|
+
children: [
|
|
6745
|
+
formattedAmount,
|
|
6746
|
+
" ",
|
|
6747
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6748
|
+
"span",
|
|
6749
|
+
{
|
|
6750
|
+
"data-test-id": "asset-row-balance-symbol",
|
|
6751
|
+
className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)] [font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
6752
|
+
children: token.symbol
|
|
6753
|
+
}
|
|
6754
|
+
)
|
|
6755
|
+
]
|
|
6756
|
+
}
|
|
6757
|
+
),
|
|
6758
|
+
formattedUsd && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6759
|
+
"div",
|
|
6760
|
+
{
|
|
6761
|
+
"data-test-id": "asset-row-balance-usd",
|
|
6762
|
+
className: "text-[12px] text-[color:var(--deframe-widget-color-text-secondary)] mt-[var(--deframe-widget-size-gap-none)].5",
|
|
6763
|
+
children: formattedUsd
|
|
6764
|
+
}
|
|
6765
|
+
)
|
|
6766
|
+
]
|
|
6767
|
+
}
|
|
6768
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
6769
|
+
]
|
|
6770
|
+
}
|
|
6771
|
+
);
|
|
6772
|
+
}
|
|
6773
|
+
function TokensLoadingState({ label }) {
|
|
6774
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6775
|
+
"div",
|
|
6776
|
+
{
|
|
6777
|
+
"data-test-id": "tokens-loading-state",
|
|
6778
|
+
className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)] px-[14px] py-[var(--deframe-widget-size-padding-y-sm)]",
|
|
6779
|
+
children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6780
|
+
"div",
|
|
6781
|
+
{
|
|
6782
|
+
"data-test-id": `tokens-loading-skeleton-${i}`,
|
|
6783
|
+
className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)] animate-pulse",
|
|
6784
|
+
children: [
|
|
6785
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[38px] h-[38px] rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-tertiary)] flex-shrink-0" }),
|
|
6786
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0 flex flex-col gap-[6px]", children: [
|
|
6787
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[14px] w-[60%] rounded-[var(--deframe-widget-size-radius-xs)] bg-[var(--deframe-widget-color-bg-tertiary)]" }),
|
|
6788
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[12px] w-[40%] rounded-[var(--deframe-widget-size-radius-xs)] bg-[var(--deframe-widget-color-bg-tertiary)]" })
|
|
6789
|
+
] }),
|
|
6790
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0 flex flex-col items-end gap-[6px]", children: [
|
|
6791
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[13px] w-[50px] rounded-[var(--deframe-widget-size-radius-xs)] bg-[var(--deframe-widget-color-bg-tertiary)]" }),
|
|
6792
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[12px] w-[36px] rounded-[var(--deframe-widget-size-radius-xs)] bg-[var(--deframe-widget-color-bg-tertiary)]" })
|
|
6793
|
+
] })
|
|
6794
|
+
]
|
|
6795
|
+
},
|
|
6796
|
+
i
|
|
6797
|
+
))
|
|
6798
|
+
}
|
|
6799
|
+
);
|
|
6800
|
+
}
|
|
6801
|
+
function AssetSearchAndList({
|
|
6802
|
+
query,
|
|
6803
|
+
setQuery,
|
|
6804
|
+
searchRef,
|
|
6805
|
+
assetListRef,
|
|
6806
|
+
displayedTokens,
|
|
6807
|
+
findBalance,
|
|
6808
|
+
formatTokenAmount,
|
|
6809
|
+
formatCurrencyValue,
|
|
6810
|
+
isMobile,
|
|
6811
|
+
onAssetClick,
|
|
6812
|
+
handleAssetKeyDown,
|
|
6813
|
+
isFetching,
|
|
6814
|
+
hasMore,
|
|
6815
|
+
onLoadMore,
|
|
6816
|
+
labels,
|
|
6817
|
+
autoFocus
|
|
6818
|
+
}) {
|
|
6819
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6820
|
+
"div",
|
|
6821
|
+
{
|
|
6822
|
+
"data-test-id": "search-and-assets",
|
|
6823
|
+
className: "flex flex-col flex-1 overflow-hidden",
|
|
6824
|
+
children: [
|
|
6825
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6826
|
+
"div",
|
|
6827
|
+
{
|
|
6828
|
+
"data-test-id": "search-wrapper",
|
|
6829
|
+
className: tailwindMerge.twMerge(
|
|
6830
|
+
"px-[var(--deframe-widget-size-padding-x-md)] pb-[var(--deframe-widget-size-padding-y-sm)] flex-shrink-0",
|
|
6831
|
+
isMobile ? "pt-[var(--deframe-widget-size-padding-y-none)]" : "pt-[var(--deframe-widget-size-padding-y-sm)]"
|
|
6832
|
+
),
|
|
6833
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6834
|
+
SearchInputInline,
|
|
4498
6835
|
{
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
6836
|
+
ref: searchRef,
|
|
6837
|
+
value: query,
|
|
6838
|
+
onChange: setQuery,
|
|
6839
|
+
placeholder: labels.searchPlaceholder,
|
|
6840
|
+
autoFocus,
|
|
6841
|
+
onArrowDown: () => {
|
|
6842
|
+
var _a, _b;
|
|
6843
|
+
(_b = (_a = assetListRef.current) == null ? void 0 : _a.querySelector("[data-asset-index='0']")) == null ? void 0 : _b.focus();
|
|
6844
|
+
}
|
|
4505
6845
|
}
|
|
4506
6846
|
)
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
6847
|
+
}
|
|
6848
|
+
),
|
|
6849
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6850
|
+
"div",
|
|
6851
|
+
{
|
|
6852
|
+
"data-test-id": "section-label",
|
|
6853
|
+
className: "px-[var(--deframe-widget-size-padding-x-md)] pb-[var(--deframe-widget-size-padding-y-xs)] flex-shrink-0 text-[11px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-tertiary)] tracking-[0.06em] uppercase",
|
|
6854
|
+
children: labels.assetsLabel
|
|
6855
|
+
}
|
|
6856
|
+
),
|
|
6857
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6858
|
+
"div",
|
|
6859
|
+
{
|
|
6860
|
+
ref: assetListRef,
|
|
6861
|
+
role: "listbox",
|
|
6862
|
+
"aria-label": labels.assetsLabel,
|
|
6863
|
+
"data-test-id": "asset-list",
|
|
6864
|
+
className: "flex-1 overflow-y-auto px-[var(--deframe-widget-size-padding-x-sm)] pb-[var(--deframe-widget-size-padding-y-sm)] pt-[var(--deframe-widget-size-padding-y-xs)]",
|
|
6865
|
+
children: isFetching ? /* @__PURE__ */ jsxRuntime.jsx(TokensLoadingState, { label: labels.searchingText }) : displayedTokens.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6866
|
+
"div",
|
|
4512
6867
|
{
|
|
4513
|
-
"data-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
6868
|
+
"data-test-id": "no-results",
|
|
6869
|
+
className: "py-[var(--deframe-widget-size-padding-y-xl)] px-[var(--deframe-widget-size-padding-x-md)] text-center",
|
|
6870
|
+
children: [
|
|
6871
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6872
|
+
"div",
|
|
6873
|
+
{
|
|
6874
|
+
"data-test-id": "no-results-title",
|
|
6875
|
+
className: "text-[14px] text-[color:var(--deframe-widget-color-text-secondary)] mb-[var(--deframe-widget-size-gap-xs)]",
|
|
6876
|
+
children: labels.searchEmptyTitle
|
|
6877
|
+
}
|
|
6878
|
+
),
|
|
6879
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6880
|
+
"div",
|
|
6881
|
+
{
|
|
6882
|
+
"data-test-id": "no-results-description",
|
|
6883
|
+
className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
6884
|
+
children: labels.searchEmptyDescription
|
|
6885
|
+
}
|
|
6886
|
+
)
|
|
6887
|
+
]
|
|
4519
6888
|
}
|
|
4520
|
-
)
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
6889
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6890
|
+
displayedTokens.map((token, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6891
|
+
AssetRowInline,
|
|
6892
|
+
{
|
|
6893
|
+
token,
|
|
6894
|
+
balance: findBalance(token),
|
|
6895
|
+
formatTokenAmount,
|
|
6896
|
+
formatCurrencyValue,
|
|
6897
|
+
onClick: () => onAssetClick(token),
|
|
6898
|
+
onKeyDown: (e) => handleAssetKeyDown(e, token, i),
|
|
6899
|
+
index: i
|
|
6900
|
+
},
|
|
6901
|
+
`${token.chainId}-${token.address}-${i}`
|
|
6902
|
+
)),
|
|
6903
|
+
hasMore && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6904
|
+
"div",
|
|
6905
|
+
{
|
|
6906
|
+
"data-test-id": "load-more-wrapper",
|
|
6907
|
+
className: "flex justify-center py-[var(--deframe-widget-size-padding-y-sm)]",
|
|
6908
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6909
|
+
"button",
|
|
6910
|
+
{
|
|
6911
|
+
"data-test-id": "load-more-button",
|
|
6912
|
+
"aria-label": labels.loadMoreButton,
|
|
6913
|
+
onClick: onLoadMore,
|
|
6914
|
+
className: [
|
|
6915
|
+
"text-[13px] [font-weight:var(--deframe-widget-font-weight-medium)]",
|
|
6916
|
+
"text-[color:var(--deframe-widget-color-brand-primary)]",
|
|
6917
|
+
"bg-transparent border-none cursor-pointer outline-none",
|
|
6918
|
+
"hover:underline",
|
|
6919
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
6920
|
+
].join(" "),
|
|
6921
|
+
children: labels.loadMoreButton
|
|
6922
|
+
}
|
|
6923
|
+
)
|
|
6924
|
+
}
|
|
6925
|
+
)
|
|
6926
|
+
] })
|
|
6927
|
+
}
|
|
6928
|
+
)
|
|
6929
|
+
]
|
|
6930
|
+
}
|
|
6931
|
+
);
|
|
6932
|
+
}
|
|
6933
|
+
function ChooseNetworkAndAssetViewSimple({
|
|
6934
|
+
isOpen,
|
|
6935
|
+
onClose,
|
|
6936
|
+
networks,
|
|
6937
|
+
selectedNetwork,
|
|
6938
|
+
onNetworkSelect,
|
|
6939
|
+
displayedTokens,
|
|
6940
|
+
findBalance,
|
|
6941
|
+
formatTokenAmount,
|
|
6942
|
+
formatCurrencyValue,
|
|
6943
|
+
onAssetClick,
|
|
6944
|
+
onSearch,
|
|
6945
|
+
autoFocus,
|
|
6946
|
+
hasMore,
|
|
6947
|
+
onLoadMore,
|
|
6948
|
+
isFetching,
|
|
6949
|
+
labels
|
|
6950
|
+
}) {
|
|
6951
|
+
var _a;
|
|
6952
|
+
const [query, setQuery] = React6__namespace.useState("");
|
|
6953
|
+
const searchRef = React6__namespace.useRef(null);
|
|
6954
|
+
const chainListRef = React6__namespace.useRef(null);
|
|
6955
|
+
const assetListRef = React6__namespace.useRef(null);
|
|
6956
|
+
const isMobile = useIsMobile();
|
|
6957
|
+
const activeNetwork = (_a = selectedNetwork != null ? selectedNetwork : networks[0]) != null ? _a : null;
|
|
6958
|
+
const handleQueryChange = React6__namespace.useCallback((q) => {
|
|
6959
|
+
setQuery(q);
|
|
6960
|
+
onSearch(q);
|
|
6961
|
+
}, [onSearch]);
|
|
6962
|
+
const handleNetworkSelect = React6__namespace.useCallback((network) => {
|
|
6963
|
+
var _a2;
|
|
6964
|
+
setQuery("");
|
|
6965
|
+
onSearch("");
|
|
6966
|
+
onNetworkSelect(network);
|
|
6967
|
+
(_a2 = searchRef.current) == null ? void 0 : _a2.focus();
|
|
6968
|
+
}, [onSearch, onNetworkSelect]);
|
|
6969
|
+
React6__namespace.useEffect(() => {
|
|
6970
|
+
if (!isOpen) return;
|
|
6971
|
+
const onKey = (e) => {
|
|
6972
|
+
if (e.key === "Escape") onClose();
|
|
6973
|
+
};
|
|
6974
|
+
window.addEventListener("keydown", onKey);
|
|
6975
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
6976
|
+
}, [isOpen, onClose]);
|
|
6977
|
+
React6__namespace.useEffect(() => {
|
|
6978
|
+
if (isOpen && autoFocus) {
|
|
6979
|
+
const id = requestAnimationFrame(() => {
|
|
6980
|
+
var _a2;
|
|
6981
|
+
return (_a2 = searchRef.current) == null ? void 0 : _a2.focus();
|
|
6982
|
+
});
|
|
6983
|
+
return () => cancelAnimationFrame(id);
|
|
6984
|
+
}
|
|
6985
|
+
}, [isOpen, autoFocus]);
|
|
6986
|
+
const handleChainKeyDown = React6__namespace.useCallback((e, network, idx) => {
|
|
6987
|
+
var _a2, _b, _c, _d;
|
|
6988
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
6989
|
+
e.preventDefault();
|
|
6990
|
+
handleNetworkSelect(network);
|
|
6991
|
+
}
|
|
6992
|
+
if (e.key === "ArrowDown") {
|
|
6993
|
+
e.preventDefault();
|
|
6994
|
+
(_b = (_a2 = chainListRef.current) == null ? void 0 : _a2.querySelector(`[data-chain-index="${idx + 1}"]`)) == null ? void 0 : _b.focus();
|
|
6995
|
+
}
|
|
6996
|
+
if (e.key === "ArrowUp") {
|
|
6997
|
+
e.preventDefault();
|
|
6998
|
+
(_d = (_c = chainListRef.current) == null ? void 0 : _c.querySelector(`[data-chain-index="${idx - 1}"]`)) == null ? void 0 : _d.focus();
|
|
6999
|
+
}
|
|
7000
|
+
}, [handleNetworkSelect]);
|
|
7001
|
+
const handleAssetKeyDown = React6__namespace.useCallback((e, token, idx) => {
|
|
7002
|
+
var _a2, _b, _c, _d, _e;
|
|
7003
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
7004
|
+
e.preventDefault();
|
|
7005
|
+
onAssetClick(token);
|
|
7006
|
+
}
|
|
7007
|
+
if (e.key === "ArrowDown") {
|
|
7008
|
+
e.preventDefault();
|
|
7009
|
+
(_b = (_a2 = assetListRef.current) == null ? void 0 : _a2.querySelector(`[data-asset-index="${idx + 1}"]`)) == null ? void 0 : _b.focus();
|
|
7010
|
+
}
|
|
7011
|
+
if (e.key === "ArrowUp") {
|
|
7012
|
+
e.preventDefault();
|
|
7013
|
+
if (idx === 0) {
|
|
7014
|
+
(_c = searchRef.current) == null ? void 0 : _c.focus();
|
|
7015
|
+
return;
|
|
4526
7016
|
}
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
7017
|
+
(_e = (_d = assetListRef.current) == null ? void 0 : _d.querySelector(`[data-asset-index="${idx - 1}"]`)) == null ? void 0 : _e.focus();
|
|
7018
|
+
}
|
|
7019
|
+
}, [onAssetClick]);
|
|
7020
|
+
const content = isOpen ? renderContent() : null;
|
|
7021
|
+
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: content });
|
|
7022
|
+
function renderContent() {
|
|
7023
|
+
const sharedSearchAssets = /* @__PURE__ */ jsxRuntime.jsx(
|
|
7024
|
+
AssetSearchAndList,
|
|
4530
7025
|
{
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
7026
|
+
query,
|
|
7027
|
+
setQuery: handleQueryChange,
|
|
7028
|
+
searchRef,
|
|
7029
|
+
assetListRef,
|
|
7030
|
+
displayedTokens,
|
|
7031
|
+
findBalance,
|
|
7032
|
+
formatTokenAmount,
|
|
7033
|
+
formatCurrencyValue,
|
|
7034
|
+
isMobile,
|
|
7035
|
+
onAssetClick,
|
|
7036
|
+
handleAssetKeyDown,
|
|
7037
|
+
isFetching,
|
|
7038
|
+
hasMore,
|
|
7039
|
+
onLoadMore,
|
|
7040
|
+
labels,
|
|
7041
|
+
autoFocus
|
|
4534
7042
|
}
|
|
4535
|
-
)
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
labels,
|
|
4540
|
-
autoFocus = true,
|
|
4541
|
-
chains,
|
|
4542
|
-
pageSize = 10,
|
|
4543
|
-
onChainClick
|
|
4544
|
-
}) => {
|
|
4545
|
-
const [searchValue, setSearchValue] = React6.useState("");
|
|
4546
|
-
const [page, setPage] = React6.useState(1);
|
|
4547
|
-
React6.useEffect(() => {
|
|
4548
|
-
setPage(1);
|
|
4549
|
-
}, [searchValue]);
|
|
4550
|
-
const filteredChains = chains.filter(
|
|
4551
|
-
(chain) => chain.name.toLowerCase().includes(searchValue.toLowerCase())
|
|
4552
|
-
);
|
|
4553
|
-
const displayedChains = filteredChains.slice(0, page * pageSize);
|
|
4554
|
-
const hasMore = filteredChains.length > page * pageSize;
|
|
4555
|
-
return /* @__PURE__ */ jsxRuntime.jsx(BackgroundContainer, { className: "flex flex-col h-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col flex-1 w-full p-[var(--deframe-widget-size-padding-x-lg)] overflow-hidden", children: [
|
|
4556
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0", children: [
|
|
4557
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { children: labels.title }),
|
|
4558
|
-
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
4559
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4560
|
-
SearchInput,
|
|
7043
|
+
);
|
|
7044
|
+
if (isMobile) {
|
|
7045
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7046
|
+
framerMotion.motion.div,
|
|
4561
7047
|
{
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
{
|
|
4572
|
-
"data-testid": "choose-a-network-list",
|
|
4573
|
-
className: "flex flex-col gap-[var(--deframe-widget-size-gap-xs)] w-full mt-[var(--deframe-widget-size-gap-md)] overflow-y-auto flex-1 min-h-0",
|
|
4574
|
-
children: [
|
|
4575
|
-
displayedChains.map((chain) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4576
|
-
ListItem,
|
|
7048
|
+
initial: { opacity: 0 },
|
|
7049
|
+
animate: { opacity: 1 },
|
|
7050
|
+
exit: { opacity: 0 },
|
|
7051
|
+
transition: { duration: 0.2 },
|
|
7052
|
+
onClick: onClose,
|
|
7053
|
+
"data-test-id": "backdrop",
|
|
7054
|
+
className: "fixed inset-0 bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)] backdrop-blur-[4px] z-50 flex flex-col justify-end",
|
|
7055
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7056
|
+
framerMotion.motion.div,
|
|
4577
7057
|
{
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
"
|
|
4581
|
-
"
|
|
7058
|
+
role: "dialog",
|
|
7059
|
+
"aria-modal": "true",
|
|
7060
|
+
"aria-label": labels.title,
|
|
7061
|
+
initial: { y: "100%" },
|
|
7062
|
+
animate: { y: 0 },
|
|
7063
|
+
exit: { y: "100%" },
|
|
7064
|
+
transition: { type: "spring", stiffness: 320, damping: 32, mass: 0.8 },
|
|
7065
|
+
onClick: (e) => e.stopPropagation(),
|
|
7066
|
+
"data-test-id": "sheet",
|
|
7067
|
+
className: [
|
|
7068
|
+
"bg-[var(--deframe-widget-color-bg-secondary)] flex flex-col overflow-hidden",
|
|
7069
|
+
"rounded-t-[var(--deframe-widget-size-radius-lg)]",
|
|
7070
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)] border-b-0",
|
|
7071
|
+
"shadow-[0px_4px_16px_0px_#00000066,0px_24px_80px_0px_#00000099]",
|
|
7072
|
+
"max-h-[88vh]"
|
|
7073
|
+
].join(" "),
|
|
4582
7074
|
children: [
|
|
4583
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4584
|
-
"
|
|
7075
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7076
|
+
"div",
|
|
4585
7077
|
{
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
className: "w-
|
|
7078
|
+
"data-test-id": "drag-handle",
|
|
7079
|
+
className: "flex justify-center pt-[var(--deframe-widget-size-padding-y-sm)] pb-[var(--deframe-widget-size-padding-y-xs)].5 flex-shrink-0",
|
|
7080
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-9 h-1 rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-border-primary)]" })
|
|
4589
7081
|
}
|
|
4590
|
-
)
|
|
4591
|
-
/* @__PURE__ */ jsxRuntime.
|
|
7082
|
+
),
|
|
7083
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7084
|
+
"div",
|
|
7085
|
+
{
|
|
7086
|
+
"data-test-id": "sheet-header",
|
|
7087
|
+
className: "flex items-center justify-between pt-[var(--deframe-widget-size-padding-y-xs)].5 pr-[var(--deframe-widget-size-padding-x-md)] pb-[var(--deframe-widget-size-padding-y-sm)].5 pl-[var(--deframe-widget-size-padding-x-md)] flex-shrink-0",
|
|
7088
|
+
children: [
|
|
7089
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7090
|
+
"span",
|
|
7091
|
+
{
|
|
7092
|
+
"data-test-id": "sheet-title",
|
|
7093
|
+
className: "text-[16px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] font-[var(--deframe-widget-font-family)]",
|
|
7094
|
+
children: labels.title
|
|
7095
|
+
}
|
|
7096
|
+
),
|
|
7097
|
+
/* @__PURE__ */ jsxRuntime.jsx(CloseButtonInline, { onClick: onClose, ariaLabel: labels.closeAriaLabel })
|
|
7098
|
+
]
|
|
7099
|
+
}
|
|
7100
|
+
),
|
|
7101
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7102
|
+
"div",
|
|
7103
|
+
{
|
|
7104
|
+
"data-test-id": "network-section",
|
|
7105
|
+
className: "flex-shrink-0 pb-[var(--deframe-widget-size-padding-y-sm)].5",
|
|
7106
|
+
children: [
|
|
7107
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7108
|
+
"div",
|
|
7109
|
+
{
|
|
7110
|
+
"data-test-id": "network-section-label",
|
|
7111
|
+
className: "text-[11px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-tertiary)] tracking-[0.06em] uppercase px-[var(--deframe-widget-size-padding-x-md)] pb-[var(--deframe-widget-size-padding-y-sm)]",
|
|
7112
|
+
children: labels.networksLabel
|
|
7113
|
+
}
|
|
7114
|
+
),
|
|
7115
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7116
|
+
"div",
|
|
7117
|
+
{
|
|
7118
|
+
ref: chainListRef,
|
|
7119
|
+
role: "listbox",
|
|
7120
|
+
"aria-label": labels.networksLabel,
|
|
7121
|
+
"data-test-id": "network-chip-list",
|
|
7122
|
+
className: "flex gap-[var(--deframe-widget-size-gap-sm)] overflow-x-auto px-[var(--deframe-widget-size-padding-x-md)] pb-[var(--deframe-widget-size-padding-y-xs)] [scrollbar-width:none]",
|
|
7123
|
+
children: networks.map((network) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7124
|
+
NetworkChip,
|
|
7125
|
+
{
|
|
7126
|
+
network,
|
|
7127
|
+
selected: (activeNetwork == null ? void 0 : activeNetwork.chainId) === network.chainId,
|
|
7128
|
+
onClick: () => handleNetworkSelect(network)
|
|
7129
|
+
},
|
|
7130
|
+
network.chainId
|
|
7131
|
+
))
|
|
7132
|
+
}
|
|
7133
|
+
)
|
|
7134
|
+
]
|
|
7135
|
+
}
|
|
7136
|
+
),
|
|
7137
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7138
|
+
"div",
|
|
7139
|
+
{
|
|
7140
|
+
"data-test-id": "divider",
|
|
7141
|
+
className: "h-px bg-[var(--deframe-widget-color-border-secondary)] flex-shrink-0"
|
|
7142
|
+
}
|
|
7143
|
+
),
|
|
7144
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7145
|
+
"div",
|
|
7146
|
+
{
|
|
7147
|
+
"data-test-id": "sheet-body",
|
|
7148
|
+
className: "flex-1 flex flex-col overflow-hidden pt-[var(--deframe-widget-size-padding-y-xs)]",
|
|
7149
|
+
children: sharedSearchAssets
|
|
7150
|
+
}
|
|
7151
|
+
)
|
|
4592
7152
|
]
|
|
4593
|
-
}
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
7153
|
+
}
|
|
7154
|
+
)
|
|
7155
|
+
},
|
|
7156
|
+
"mobile"
|
|
7157
|
+
);
|
|
7158
|
+
}
|
|
7159
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7160
|
+
framerMotion.motion.div,
|
|
7161
|
+
{
|
|
7162
|
+
initial: { opacity: 0 },
|
|
7163
|
+
animate: { opacity: 1 },
|
|
7164
|
+
exit: { opacity: 0 },
|
|
7165
|
+
transition: { duration: 0.2 },
|
|
7166
|
+
onClick: onClose,
|
|
7167
|
+
"data-test-id": "backdrop",
|
|
7168
|
+
className: "fixed inset-0 bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)] backdrop-blur-[4px] z-50 flex items-center justify-center px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
7169
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7170
|
+
framerMotion.motion.div,
|
|
7171
|
+
{
|
|
7172
|
+
role: "dialog",
|
|
7173
|
+
"aria-modal": "true",
|
|
7174
|
+
"aria-label": labels.title,
|
|
7175
|
+
initial: { opacity: 0, scale: 0.96 },
|
|
7176
|
+
animate: { opacity: 1, scale: 1 },
|
|
7177
|
+
exit: { opacity: 0, scale: 0.96 },
|
|
7178
|
+
transition: { duration: 0.2, ease: "easeOut" },
|
|
7179
|
+
onClick: (e) => e.stopPropagation(),
|
|
7180
|
+
"data-test-id": "modal",
|
|
7181
|
+
className: [
|
|
7182
|
+
"w-[min(680px,calc(100vw-32px))]",
|
|
7183
|
+
"h-[min(620px,calc(100vh-64px))]",
|
|
7184
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
7185
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
7186
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
7187
|
+
"shadow-[0px_4px_16px_0px_#00000066,0px_24px_80px_0px_#00000099]",
|
|
7188
|
+
"flex flex-col overflow-hidden"
|
|
7189
|
+
].join(" "),
|
|
7190
|
+
children: [
|
|
7191
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7192
|
+
"div",
|
|
7193
|
+
{
|
|
7194
|
+
"data-test-id": "modal-header",
|
|
7195
|
+
className: "flex items-center justify-between pt-[var(--deframe-widget-size-padding-y-md)] pr-[var(--deframe-widget-size-padding-x-md)] pb-[14px] pl-[var(--deframe-widget-size-padding-x-md)] border-b border-[color:var(--deframe-widget-color-border-secondary)] flex-shrink-0",
|
|
7196
|
+
children: [
|
|
7197
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7198
|
+
"span",
|
|
7199
|
+
{
|
|
7200
|
+
"data-test-id": "modal-title",
|
|
7201
|
+
className: "text-[16px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] font-[var(--deframe-widget-font-family)]",
|
|
7202
|
+
children: labels.title
|
|
7203
|
+
}
|
|
7204
|
+
),
|
|
7205
|
+
/* @__PURE__ */ jsxRuntime.jsx(CloseButtonInline, { onClick: onClose, ariaLabel: labels.closeAriaLabel })
|
|
7206
|
+
]
|
|
7207
|
+
}
|
|
7208
|
+
),
|
|
7209
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7210
|
+
"div",
|
|
7211
|
+
{
|
|
7212
|
+
"data-test-id": "modal-body",
|
|
7213
|
+
className: "flex flex-1 overflow-hidden",
|
|
7214
|
+
children: [
|
|
7215
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7216
|
+
"div",
|
|
7217
|
+
{
|
|
7218
|
+
"data-test-id": "network-sidebar",
|
|
7219
|
+
className: [
|
|
7220
|
+
"w-[210px] flex-shrink-0",
|
|
7221
|
+
"border-r border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
7222
|
+
"bg-[#12151C]",
|
|
7223
|
+
"flex flex-col overflow-hidden"
|
|
7224
|
+
].join(" "),
|
|
7225
|
+
children: [
|
|
7226
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7227
|
+
"div",
|
|
7228
|
+
{
|
|
7229
|
+
"data-test-id": "network-sidebar-label",
|
|
7230
|
+
className: "px-[var(--deframe-widget-size-padding-x-md)] pt-[var(--deframe-widget-size-padding-y-sm)] pb-[var(--deframe-widget-size-padding-y-xs)].5 text-[11px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-tertiary)] tracking-[0.06em] uppercase",
|
|
7231
|
+
children: labels.networksLabel
|
|
7232
|
+
}
|
|
7233
|
+
),
|
|
7234
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7235
|
+
"div",
|
|
7236
|
+
{
|
|
7237
|
+
ref: chainListRef,
|
|
7238
|
+
role: "listbox",
|
|
7239
|
+
"aria-label": labels.networksLabel,
|
|
7240
|
+
"data-test-id": "network-list",
|
|
7241
|
+
className: "flex-1 overflow-y-auto px-[var(--deframe-widget-size-padding-x-sm)] pb-[var(--deframe-widget-size-padding-y-sm)] pt-[var(--deframe-widget-size-padding-y-xs)]",
|
|
7242
|
+
children: networks.map((network, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7243
|
+
NetworkRow,
|
|
7244
|
+
{
|
|
7245
|
+
network,
|
|
7246
|
+
selected: (activeNetwork == null ? void 0 : activeNetwork.chainId) === network.chainId,
|
|
7247
|
+
onClick: () => handleNetworkSelect(network),
|
|
7248
|
+
onKeyDown: (e) => handleChainKeyDown(e, network, i),
|
|
7249
|
+
index: i
|
|
7250
|
+
},
|
|
7251
|
+
network.chainId
|
|
7252
|
+
))
|
|
7253
|
+
}
|
|
7254
|
+
)
|
|
7255
|
+
]
|
|
7256
|
+
}
|
|
7257
|
+
),
|
|
7258
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7259
|
+
"div",
|
|
7260
|
+
{
|
|
7261
|
+
"data-test-id": "asset-panel",
|
|
7262
|
+
className: "flex-1 flex flex-col overflow-hidden",
|
|
7263
|
+
children: sharedSearchAssets
|
|
7264
|
+
}
|
|
7265
|
+
)
|
|
7266
|
+
]
|
|
7267
|
+
}
|
|
7268
|
+
)
|
|
7269
|
+
]
|
|
7270
|
+
}
|
|
7271
|
+
)
|
|
7272
|
+
},
|
|
7273
|
+
"desktop"
|
|
7274
|
+
);
|
|
7275
|
+
}
|
|
7276
|
+
}
|
|
4602
7277
|
var SkeletonItem = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full bg-[var(--deframe-widget-color-bg-secondary)] rounded-[var(--deframe-widget-size-radius-xs)] min-h-[72px] flex items-center justify-between px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-sm)]", children: [
|
|
4603
7278
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)] flex-1 min-w-0", children: [
|
|
4604
7279
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-xl bg-[var(--deframe-widget-color-bg-tertiary)] animate-pulse flex-shrink-0" }),
|
|
@@ -4844,7 +7519,10 @@ var WalletBalances = ({ cards, variant = "subtle", className }) => {
|
|
|
4844
7519
|
const bgClass = variant === "raised" ? "bg-[var(--deframe-widget-color-bg-raised)]" : "bg-[var(--deframe-widget-color-bg-subtle)]";
|
|
4845
7520
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("w-full flex flex-row gap-4 mt-md", className), children: cards.map((card) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex-1 h-auto px-6 py-4 rounded shadow-sm flex flex-col items-start justify-start gap-xs", bgClass), children: [
|
|
4846
7521
|
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: card.label }),
|
|
4847
|
-
/* @__PURE__ */ jsxRuntime.
|
|
7522
|
+
card.badge ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full flex-col gap-xs md:flex-row md:items-end md:gap-[var(--deframe-widget-size-gap-md)]", children: [
|
|
7523
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: card.value }),
|
|
7524
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:pl-[var(--deframe-widget-size-padding-x-md)]", children: card.badge })
|
|
7525
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: card.value })
|
|
4848
7526
|
] }, card.label)) });
|
|
4849
7527
|
};
|
|
4850
7528
|
var HistoryTabEmpty = ({ title, description }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-[90vh] py-md bg-bg-default dark:bg-bg-default-dark rounded-lg flex flex-col justify-center items-center gap-sm overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex flex-col justify-center items-center gap-md", children: [
|
|
@@ -4937,6 +7615,8 @@ var EarnInvestmentSummaryView = ({
|
|
|
4937
7615
|
totalInvestedValue,
|
|
4938
7616
|
totalReturnLabel,
|
|
4939
7617
|
totalReturnValue,
|
|
7618
|
+
processingBadgeLabel,
|
|
7619
|
+
processingBadgeTitle,
|
|
4940
7620
|
className
|
|
4941
7621
|
}) => {
|
|
4942
7622
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: tailwindMerge.twMerge("flex flex-col gap-md p-lg bg-bg-subtle dark:bg-bg-subtle-dark rounded", className), children: [
|
|
@@ -4945,7 +7625,17 @@ var EarnInvestmentSummaryView = ({
|
|
|
4945
7625
|
WalletBalances,
|
|
4946
7626
|
{
|
|
4947
7627
|
cards: [
|
|
4948
|
-
{
|
|
7628
|
+
{
|
|
7629
|
+
label: totalInvestedLabel,
|
|
7630
|
+
value: totalInvestedValue,
|
|
7631
|
+
badge: processingBadgeLabel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7632
|
+
ProcessingBadge,
|
|
7633
|
+
{
|
|
7634
|
+
label: processingBadgeLabel,
|
|
7635
|
+
title: processingBadgeTitle
|
|
7636
|
+
}
|
|
7637
|
+
) : void 0
|
|
7638
|
+
},
|
|
4949
7639
|
{ label: totalReturnLabel, value: totalReturnValue }
|
|
4950
7640
|
],
|
|
4951
7641
|
variant: "raised",
|
|
@@ -5372,7 +8062,7 @@ var DateLabel = ({ children }) => {
|
|
|
5372
8062
|
var ArrowBadge = ({ isDeposit }) => {
|
|
5373
8063
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-[-2px] right-[-2px] w-[15px] h-[15px] rounded-full bg-bg-subtle dark:bg-bg-subtle-dark flex items-center justify-center border border-bg-subtle dark:border-bg-subtle-dark", children: isDeposit ? /* @__PURE__ */ jsxRuntime.jsx(md.MdArrowDownward, { className: "w-3 h-3 text-text-primary dark:text-text-primary-dark" }) : /* @__PURE__ */ jsxRuntime.jsx(md.MdArrowUpward, { className: "w-3 h-3 text-text-primary dark:text-text-primary-dark" }) });
|
|
5374
8064
|
};
|
|
5375
|
-
var
|
|
8065
|
+
var TokenIconWithBadge2 = ({ src, alt, isDeposit }) => {
|
|
5376
8066
|
const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
|
|
5377
8067
|
const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
|
|
5378
8068
|
const resolvedSrc = src || fallbackSrc;
|
|
@@ -5436,7 +8126,7 @@ var HistoryListView = ({
|
|
|
5436
8126
|
containerClassName: tailwindMerge.twMerge("!rounded-xs !border-0 !min-h-[72px]", itemClassName),
|
|
5437
8127
|
children: [
|
|
5438
8128
|
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: item.isSwap ? /* @__PURE__ */ jsxRuntime.jsx(SwapIconWithBadge, { src: item.iconUrl, alt: item.iconAlt }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5439
|
-
|
|
8129
|
+
TokenIconWithBadge2,
|
|
5440
8130
|
{
|
|
5441
8131
|
src: item.iconUrl,
|
|
5442
8132
|
alt: item.iconAlt,
|
|
@@ -5445,7 +8135,15 @@ var HistoryListView = ({
|
|
|
5445
8135
|
) }),
|
|
5446
8136
|
/* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { children: [
|
|
5447
8137
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-text-lg-mobile", children: item.title }),
|
|
5448
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { variant: "secondary", className: "text-text-tertiary dark:text-text-tertiary-dark", children: item.subtitle })
|
|
8138
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { variant: "secondary", className: "text-text-tertiary dark:text-text-tertiary-dark", children: item.subtitle }),
|
|
8139
|
+
item.status === "PENDING" && item.statusLabel ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[6px]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8140
|
+
ProcessingBadge,
|
|
8141
|
+
{
|
|
8142
|
+
label: item.statusLabel,
|
|
8143
|
+
title: item.statusTitle,
|
|
8144
|
+
size: "compact"
|
|
8145
|
+
}
|
|
8146
|
+
) }) : null
|
|
5449
8147
|
] }),
|
|
5450
8148
|
/* @__PURE__ */ jsxRuntime.jsx(ListItemRightSide, { children: /* @__PURE__ */ jsxRuntime.jsx(AmountDisplay, { amount: item.amountFormatted, usdAmount: item.amountUsd }) })
|
|
5451
8149
|
]
|
|
@@ -5459,12 +8157,15 @@ var HistoryListView = ({
|
|
|
5459
8157
|
var EarnTokenSelectorView = ({
|
|
5460
8158
|
selectedToken,
|
|
5461
8159
|
onTokenClick,
|
|
8160
|
+
onNetworkClick,
|
|
5462
8161
|
isLoading,
|
|
5463
8162
|
selectTokenLabel,
|
|
5464
8163
|
chainLabel,
|
|
5465
8164
|
chainImage,
|
|
5466
8165
|
chainDirectionLabel,
|
|
5467
|
-
chainDisabledTitle
|
|
8166
|
+
chainDisabledTitle,
|
|
8167
|
+
isNetworkDisabled = false,
|
|
8168
|
+
currentNetworkSelected
|
|
5468
8169
|
}) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[10px]", children: [
|
|
5469
8170
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-[10px] w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5470
8171
|
"button",
|
|
@@ -5494,13 +8195,14 @@ var EarnTokenSelectorView = ({
|
|
|
5494
8195
|
"button",
|
|
5495
8196
|
{
|
|
5496
8197
|
type: "button",
|
|
5497
|
-
|
|
8198
|
+
onClick: () => onNetworkClick == null ? void 0 : onNetworkClick(currentNetworkSelected),
|
|
8199
|
+
disabled: isNetworkDisabled,
|
|
5498
8200
|
title: chainDisabledTitle,
|
|
5499
|
-
className:
|
|
8201
|
+
className: `bg-[var(--deframe-widget-color-bg-tertiary)] border border-[var(--deframe-widget-color-border-secondary)] rounded-lg flex gap-[var(--deframe-widget-size-gap-xs)] items-center px-[var(--deframe-widget-size-padding-x-sm)] py-[var(--deframe-widget-size-padding-y-xs)] transition-colors ${isNetworkDisabled ? "opacity-60 cursor-not-allowed" : "cursor-pointer hover:border-[var(--deframe-widget-color-border-primary)]"}`,
|
|
5500
8202
|
children: [
|
|
5501
8203
|
chainImage && /* @__PURE__ */ jsxRuntime.jsx("img", { src: chainImage, alt: "", className: "w-3 h-3 rounded-full" }),
|
|
5502
8204
|
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: chainLabel }),
|
|
5503
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
8205
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-[18px] h-[18px] flex items-center justify-center ${isNetworkDisabled ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(hi2.HiChevronDown, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-tertiary)]" }) })
|
|
5504
8206
|
]
|
|
5505
8207
|
}
|
|
5506
8208
|
)
|
|
@@ -5550,11 +8252,14 @@ var EarnPercentageButtonsView = ({
|
|
|
5550
8252
|
var EarnWithdrawTokenSelectorView = ({
|
|
5551
8253
|
selectedToken,
|
|
5552
8254
|
onTokenClick,
|
|
8255
|
+
onNetworkClick,
|
|
5553
8256
|
selectTokenLabel,
|
|
5554
8257
|
chainLabel,
|
|
5555
8258
|
chainImage,
|
|
5556
8259
|
chainDirectionLabel,
|
|
5557
|
-
chainDisabledTitle
|
|
8260
|
+
chainDisabledTitle,
|
|
8261
|
+
isNetworkDisabled = false,
|
|
8262
|
+
currentNetworkSelected
|
|
5558
8263
|
}) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[10px]", children: [
|
|
5559
8264
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-[10px] w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5560
8265
|
"button",
|
|
@@ -5584,13 +8289,14 @@ var EarnWithdrawTokenSelectorView = ({
|
|
|
5584
8289
|
"button",
|
|
5585
8290
|
{
|
|
5586
8291
|
type: "button",
|
|
5587
|
-
|
|
8292
|
+
onClick: () => onNetworkClick == null ? void 0 : onNetworkClick(currentNetworkSelected),
|
|
8293
|
+
disabled: isNetworkDisabled,
|
|
5588
8294
|
title: chainDisabledTitle,
|
|
5589
|
-
className:
|
|
8295
|
+
className: `bg-[var(--deframe-widget-color-bg-tertiary)] border border-[var(--deframe-widget-color-border-secondary)] rounded-lg flex gap-[var(--deframe-widget-size-gap-xs)] items-center px-[var(--deframe-widget-size-padding-x-sm)] py-[var(--deframe-widget-size-padding-y-xs)] transition-colors ${isNetworkDisabled ? "opacity-60 cursor-not-allowed" : "cursor-pointer hover:border-[var(--deframe-widget-color-border-primary)]"}`,
|
|
5590
8296
|
children: [
|
|
5591
8297
|
chainImage && /* @__PURE__ */ jsxRuntime.jsx("img", { src: chainImage, alt: "", className: "w-3 h-3 rounded-full" }),
|
|
5592
8298
|
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: chainLabel }),
|
|
5593
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
8299
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-[18px] h-[18px] flex items-center justify-center ${isNetworkDisabled ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(md.MdArrowDropDown, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-tertiary)]" }) })
|
|
5594
8300
|
]
|
|
5595
8301
|
}
|
|
5596
8302
|
)
|
|
@@ -5678,6 +8384,9 @@ var EarnDepositFormView = ({
|
|
|
5678
8384
|
chainImage,
|
|
5679
8385
|
chainDirectionLabel,
|
|
5680
8386
|
chainDisabledTitle,
|
|
8387
|
+
onNetworkClick,
|
|
8388
|
+
isNetworkDisabled,
|
|
8389
|
+
currentNetworkSelected,
|
|
5681
8390
|
// Amount input
|
|
5682
8391
|
amountValue,
|
|
5683
8392
|
onAmountChange,
|
|
@@ -5730,7 +8439,10 @@ var EarnDepositFormView = ({
|
|
|
5730
8439
|
chainLabel,
|
|
5731
8440
|
chainImage,
|
|
5732
8441
|
chainDirectionLabel,
|
|
5733
|
-
chainDisabledTitle
|
|
8442
|
+
chainDisabledTitle,
|
|
8443
|
+
onNetworkClick,
|
|
8444
|
+
isNetworkDisabled,
|
|
8445
|
+
currentNetworkSelected
|
|
5734
8446
|
}
|
|
5735
8447
|
),
|
|
5736
8448
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5816,6 +8528,9 @@ var EarnWithdrawFormView = ({
|
|
|
5816
8528
|
chainImage,
|
|
5817
8529
|
chainDirectionLabel,
|
|
5818
8530
|
chainDisabledTitle,
|
|
8531
|
+
onNetworkClick,
|
|
8532
|
+
isNetworkDisabled,
|
|
8533
|
+
currentNetworkSelected,
|
|
5819
8534
|
// Amount input
|
|
5820
8535
|
amountValue,
|
|
5821
8536
|
onAmountChange,
|
|
@@ -5871,7 +8586,10 @@ var EarnWithdrawFormView = ({
|
|
|
5871
8586
|
chainLabel,
|
|
5872
8587
|
chainImage,
|
|
5873
8588
|
chainDirectionLabel,
|
|
5874
|
-
chainDisabledTitle
|
|
8589
|
+
chainDisabledTitle,
|
|
8590
|
+
onNetworkClick,
|
|
8591
|
+
isNetworkDisabled,
|
|
8592
|
+
currentNetworkSelected
|
|
5875
8593
|
}
|
|
5876
8594
|
),
|
|
5877
8595
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6450,10 +9168,12 @@ exports.BannerNotification = BannerNotification;
|
|
|
6450
9168
|
exports.ChooseANetworkView = ChooseANetworkView;
|
|
6451
9169
|
exports.ChooseAStrategyActionsheetView = ChooseAStrategyActionsheetView;
|
|
6452
9170
|
exports.ChooseAnAssetSwapView = ChooseAnAssetSwapView;
|
|
9171
|
+
exports.ChooseNetworkAndAssetViewSimple = ChooseNetworkAndAssetViewSimple;
|
|
6453
9172
|
exports.CloseButton = CloseButton_default;
|
|
6454
9173
|
exports.CollapsibleInfoRow = CollapsibleInfoRow;
|
|
6455
9174
|
exports.CollapsibleSection = CollapsibleSection;
|
|
6456
9175
|
exports.ConfirmSwapButtonView = ConfirmSwapButtonView;
|
|
9176
|
+
exports.ConfirmSwapButtonViewSimple = ConfirmSwapButtonViewSimple;
|
|
6457
9177
|
exports.ConnectWalletList = ConnectWalletList;
|
|
6458
9178
|
exports.Currency = Currency;
|
|
6459
9179
|
exports.DeframeComponentsProvider = DeframeComponentsProvider;
|
|
@@ -6501,6 +9221,7 @@ exports.InfoRowIconValue = InfoRowIconValue;
|
|
|
6501
9221
|
exports.InfoRowWithIcon = InfoRowWithIcon;
|
|
6502
9222
|
exports.InfoValue = InfoValue;
|
|
6503
9223
|
exports.Input = Input2;
|
|
9224
|
+
exports.InvestmentCrossChainProcessingView = InvestmentCrossChainProcessingView;
|
|
6504
9225
|
exports.Label = Label;
|
|
6505
9226
|
exports.Link = Link;
|
|
6506
9227
|
exports.ListItem = ListItem;
|
|
@@ -6513,6 +9234,7 @@ exports.MediumRiskBadge = MediumRiskBadge;
|
|
|
6513
9234
|
exports.Navbar = Navbar;
|
|
6514
9235
|
exports.PercentageButton = PercentageButton;
|
|
6515
9236
|
exports.PrimaryButton = PrimaryButton;
|
|
9237
|
+
exports.ProcessingBadge = ProcessingBadge;
|
|
6516
9238
|
exports.ProgressIndicator = ProgressIndicator;
|
|
6517
9239
|
exports.ScrollableContent = ScrollableContent;
|
|
6518
9240
|
exports.SearchEmptyState = SearchEmptyState;
|
|
@@ -6535,15 +9257,19 @@ exports.SwapAdvancedSettingsView = SwapAdvancedSettingsView;
|
|
|
6535
9257
|
exports.SwapAmountInputView = SwapAmountInputView;
|
|
6536
9258
|
exports.SwapCrossChainProcessingView = SwapCrossChainProcessingView;
|
|
6537
9259
|
exports.SwapFormView = SwapFormView;
|
|
9260
|
+
exports.SwapFormViewSimple = SwapFormViewSimple;
|
|
6538
9261
|
exports.SwapFromCardView = SwapFromCardView;
|
|
9262
|
+
exports.SwapFromCardViewSimple = SwapFromCardViewSimple;
|
|
6539
9263
|
exports.SwapHistoryView = SwapHistoryView;
|
|
6540
9264
|
exports.SwapProcessingView = SwapProcessingView;
|
|
6541
9265
|
exports.SwapProcessingViewSimple = SwapProcessingViewSimple;
|
|
6542
9266
|
exports.SwapQuoteDetailsView = SwapQuoteDetailsView;
|
|
6543
9267
|
exports.SwapSignatureWarningView = SwapSignatureWarningView;
|
|
9268
|
+
exports.SwapSignatureWarningViewSimple = SwapSignatureWarningViewSimple;
|
|
6544
9269
|
exports.SwapSuccessView = SwapSuccessView;
|
|
6545
9270
|
exports.SwapSuccessViewSimple = SwapSuccessViewSimple;
|
|
6546
9271
|
exports.SwapToCardView = SwapToCardView;
|
|
9272
|
+
exports.SwapToCardViewSimple = SwapToCardViewSimple;
|
|
6547
9273
|
exports.SwapTransactionFailedView = SwapTransactionFailedView;
|
|
6548
9274
|
exports.SwapTransactionFailedViewSimple = SwapTransactionFailedViewSimple;
|
|
6549
9275
|
exports.SwapWidgetFallbackView = SwapWidgetFallbackView;
|