@deframe-sdk/components 0.1.18 → 0.1.20

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.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 SuccessBadge = ({ children }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "success-badge", className: "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-success)_12%,transparent)] 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: [
2423
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-2 h-2 rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-state-success)]" }),
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(SuccessBadge, { children: statusLabel })
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(SuccessBadge, { children: statusLabel })
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,
@@ -3557,6 +3660,55 @@ var SwapCrossChainProcessingView = ({
3557
3660
  }
3558
3661
  );
3559
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
+ };
3560
3712
  var SwapSignatureWarningView = ({
3561
3713
  fromTokenSymbol,
3562
3714
  fromTokenIcon,
@@ -7367,7 +7519,10 @@ var WalletBalances = ({ cards, variant = "subtle", className }) => {
7367
7519
  const bgClass = variant === "raised" ? "bg-[var(--deframe-widget-color-bg-raised)]" : "bg-[var(--deframe-widget-color-bg-subtle)]";
7368
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: [
7369
7521
  /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: card.label }),
7370
- /* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: card.value })
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 })
7371
7526
  ] }, card.label)) });
7372
7527
  };
7373
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: [
@@ -7460,6 +7615,8 @@ var EarnInvestmentSummaryView = ({
7460
7615
  totalInvestedValue,
7461
7616
  totalReturnLabel,
7462
7617
  totalReturnValue,
7618
+ processingBadgeLabel,
7619
+ processingBadgeTitle,
7463
7620
  className
7464
7621
  }) => {
7465
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: [
@@ -7468,7 +7625,17 @@ var EarnInvestmentSummaryView = ({
7468
7625
  WalletBalances,
7469
7626
  {
7470
7627
  cards: [
7471
- { label: totalInvestedLabel, value: totalInvestedValue },
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
+ },
7472
7639
  { label: totalReturnLabel, value: totalReturnValue }
7473
7640
  ],
7474
7641
  variant: "raised",
@@ -7968,7 +8135,15 @@ var HistoryListView = ({
7968
8135
  ) }),
7969
8136
  /* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { children: [
7970
8137
  /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-text-lg-mobile", children: item.title }),
7971
- /* @__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
7972
8147
  ] }),
7973
8148
  /* @__PURE__ */ jsxRuntime.jsx(ListItemRightSide, { children: /* @__PURE__ */ jsxRuntime.jsx(AmountDisplay, { amount: item.amountFormatted, usdAmount: item.amountUsd }) })
7974
8149
  ]
@@ -7982,12 +8157,15 @@ var HistoryListView = ({
7982
8157
  var EarnTokenSelectorView = ({
7983
8158
  selectedToken,
7984
8159
  onTokenClick,
8160
+ onNetworkClick,
7985
8161
  isLoading,
7986
8162
  selectTokenLabel,
7987
8163
  chainLabel,
7988
8164
  chainImage,
7989
8165
  chainDirectionLabel,
7990
- chainDisabledTitle
8166
+ chainDisabledTitle,
8167
+ isNetworkDisabled = false,
8168
+ currentNetworkSelected
7991
8169
  }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[10px]", children: [
7992
8170
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-[10px] w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
7993
8171
  "button",
@@ -8017,13 +8195,14 @@ var EarnTokenSelectorView = ({
8017
8195
  "button",
8018
8196
  {
8019
8197
  type: "button",
8020
- disabled: true,
8198
+ onClick: () => onNetworkClick == null ? void 0 : onNetworkClick(currentNetworkSelected),
8199
+ disabled: isNetworkDisabled,
8021
8200
  title: chainDisabledTitle,
8022
- 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)] opacity-60 cursor-not-allowed",
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)]"}`,
8023
8202
  children: [
8024
8203
  chainImage && /* @__PURE__ */ jsxRuntime.jsx("img", { src: chainImage, alt: "", className: "w-3 h-3 rounded-full" }),
8025
8204
  /* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: chainLabel }),
8026
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[18px] h-[18px] flex items-center justify-center opacity-50", children: /* @__PURE__ */ jsxRuntime.jsx(hi2.HiChevronDown, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-tertiary)]" }) })
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)]" }) })
8027
8206
  ]
8028
8207
  }
8029
8208
  )
@@ -8073,11 +8252,14 @@ var EarnPercentageButtonsView = ({
8073
8252
  var EarnWithdrawTokenSelectorView = ({
8074
8253
  selectedToken,
8075
8254
  onTokenClick,
8255
+ onNetworkClick,
8076
8256
  selectTokenLabel,
8077
8257
  chainLabel,
8078
8258
  chainImage,
8079
8259
  chainDirectionLabel,
8080
- chainDisabledTitle
8260
+ chainDisabledTitle,
8261
+ isNetworkDisabled = false,
8262
+ currentNetworkSelected
8081
8263
  }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[10px]", children: [
8082
8264
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-[10px] w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
8083
8265
  "button",
@@ -8107,13 +8289,14 @@ var EarnWithdrawTokenSelectorView = ({
8107
8289
  "button",
8108
8290
  {
8109
8291
  type: "button",
8110
- disabled: true,
8292
+ onClick: () => onNetworkClick == null ? void 0 : onNetworkClick(currentNetworkSelected),
8293
+ disabled: isNetworkDisabled,
8111
8294
  title: chainDisabledTitle,
8112
- 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)] opacity-60 cursor-not-allowed",
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)]"}`,
8113
8296
  children: [
8114
8297
  chainImage && /* @__PURE__ */ jsxRuntime.jsx("img", { src: chainImage, alt: "", className: "w-3 h-3 rounded-full" }),
8115
8298
  /* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: chainLabel }),
8116
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[18px] h-[18px] flex items-center justify-center opacity-50", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdArrowDropDown, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-tertiary)]" }) })
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)]" }) })
8117
8300
  ]
8118
8301
  }
8119
8302
  )
@@ -8201,6 +8384,9 @@ var EarnDepositFormView = ({
8201
8384
  chainImage,
8202
8385
  chainDirectionLabel,
8203
8386
  chainDisabledTitle,
8387
+ onNetworkClick,
8388
+ isNetworkDisabled,
8389
+ currentNetworkSelected,
8204
8390
  // Amount input
8205
8391
  amountValue,
8206
8392
  onAmountChange,
@@ -8253,7 +8439,10 @@ var EarnDepositFormView = ({
8253
8439
  chainLabel,
8254
8440
  chainImage,
8255
8441
  chainDirectionLabel,
8256
- chainDisabledTitle
8442
+ chainDisabledTitle,
8443
+ onNetworkClick,
8444
+ isNetworkDisabled,
8445
+ currentNetworkSelected
8257
8446
  }
8258
8447
  ),
8259
8448
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -8339,6 +8528,9 @@ var EarnWithdrawFormView = ({
8339
8528
  chainImage,
8340
8529
  chainDirectionLabel,
8341
8530
  chainDisabledTitle,
8531
+ onNetworkClick,
8532
+ isNetworkDisabled,
8533
+ currentNetworkSelected,
8342
8534
  // Amount input
8343
8535
  amountValue,
8344
8536
  onAmountChange,
@@ -8394,7 +8586,10 @@ var EarnWithdrawFormView = ({
8394
8586
  chainLabel,
8395
8587
  chainImage,
8396
8588
  chainDirectionLabel,
8397
- chainDisabledTitle
8589
+ chainDisabledTitle,
8590
+ onNetworkClick,
8591
+ isNetworkDisabled,
8592
+ currentNetworkSelected
8398
8593
  }
8399
8594
  ),
8400
8595
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -9026,6 +9221,7 @@ exports.InfoRowIconValue = InfoRowIconValue;
9026
9221
  exports.InfoRowWithIcon = InfoRowWithIcon;
9027
9222
  exports.InfoValue = InfoValue;
9028
9223
  exports.Input = Input2;
9224
+ exports.InvestmentCrossChainProcessingView = InvestmentCrossChainProcessingView;
9029
9225
  exports.Label = Label;
9030
9226
  exports.Link = Link;
9031
9227
  exports.ListItem = ListItem;
@@ -9038,6 +9234,7 @@ exports.MediumRiskBadge = MediumRiskBadge;
9038
9234
  exports.Navbar = Navbar;
9039
9235
  exports.PercentageButton = PercentageButton;
9040
9236
  exports.PrimaryButton = PrimaryButton;
9237
+ exports.ProcessingBadge = ProcessingBadge;
9041
9238
  exports.ProgressIndicator = ProgressIndicator;
9042
9239
  exports.ScrollableContent = ScrollableContent;
9043
9240
  exports.SearchEmptyState = SearchEmptyState;