@deframe-sdk/components 0.1.17 → 0.1.18
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 +81 -15
- package/dist/index.d.ts +81 -15
- package/dist/index.js +2712 -183
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2708 -185
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +371 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3204,6 +3204,124 @@ var SwapProcessingView = ({
|
|
|
3204
3204
|
}
|
|
3205
3205
|
);
|
|
3206
3206
|
};
|
|
3207
|
+
|
|
3208
|
+
// src/stories/swap-form-view/constants.ts
|
|
3209
|
+
var SWAP_SIMPLE_MIN_HEIGHT = 520;
|
|
3210
|
+
var SWAP_SIMPLE_WIDTH = 480;
|
|
3211
|
+
function SwapFormSkeleton() {
|
|
3212
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3213
|
+
"div",
|
|
3214
|
+
{
|
|
3215
|
+
"data-test-id": "swap-form-skeleton",
|
|
3216
|
+
className: tailwindMerge.twMerge(
|
|
3217
|
+
"relative",
|
|
3218
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
3219
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
3220
|
+
"flex flex-col items-stretch gap-[var(--deframe-widget-size-gap-sm)]",
|
|
3221
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
3222
|
+
),
|
|
3223
|
+
style: { minHeight: SWAP_SIMPLE_MIN_HEIGHT },
|
|
3224
|
+
children: [
|
|
3225
|
+
/* @__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)]" }) }),
|
|
3226
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3227
|
+
SkeletonCard,
|
|
3228
|
+
{
|
|
3229
|
+
testId: "swap-form-skeleton-from",
|
|
3230
|
+
symbol: "USDC",
|
|
3231
|
+
network: "ARBITRUM",
|
|
3232
|
+
amount: "500",
|
|
3233
|
+
usd: "\u2248 $499.87",
|
|
3234
|
+
balance: "Saldo: 1 250.00 USDC"
|
|
3235
|
+
}
|
|
3236
|
+
),
|
|
3237
|
+
/* @__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(
|
|
3238
|
+
"div",
|
|
3239
|
+
{
|
|
3240
|
+
className: tailwindMerge.twMerge(
|
|
3241
|
+
"w-10 h-10",
|
|
3242
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
3243
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
3244
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
3245
|
+
"flex items-center justify-center",
|
|
3246
|
+
"text-[color:var(--deframe-widget-color-brand-primary)]"
|
|
3247
|
+
),
|
|
3248
|
+
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: [
|
|
3249
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
3250
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "19 12 12 19 5 12" })
|
|
3251
|
+
] })
|
|
3252
|
+
}
|
|
3253
|
+
) }),
|
|
3254
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3255
|
+
SkeletonCard,
|
|
3256
|
+
{
|
|
3257
|
+
testId: "swap-form-skeleton-to",
|
|
3258
|
+
symbol: "ETH",
|
|
3259
|
+
network: "ETHEREUM",
|
|
3260
|
+
amount: "0.2061",
|
|
3261
|
+
usd: "\u2248 $499.00",
|
|
3262
|
+
balance: "Saldo: 41 ETH"
|
|
3263
|
+
}
|
|
3264
|
+
),
|
|
3265
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
|
|
3266
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3267
|
+
"div",
|
|
3268
|
+
{
|
|
3269
|
+
"data-test-id": "swap-form-skeleton-submit",
|
|
3270
|
+
className: tailwindMerge.twMerge(
|
|
3271
|
+
"h-12",
|
|
3272
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
3273
|
+
"bg-[var(--deframe-widget-color-brand-primary)]",
|
|
3274
|
+
"flex items-center justify-center",
|
|
3275
|
+
"text-[15px] [font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
3276
|
+
"text-[color:var(--deframe-widget-color-text-primary-dark)]"
|
|
3277
|
+
),
|
|
3278
|
+
children: "Revisar Troca"
|
|
3279
|
+
}
|
|
3280
|
+
)
|
|
3281
|
+
]
|
|
3282
|
+
}
|
|
3283
|
+
);
|
|
3284
|
+
}
|
|
3285
|
+
function SkeletonCard({ testId, symbol, network, amount, usd, balance }) {
|
|
3286
|
+
const initials = symbol.slice(0, 2).toUpperCase();
|
|
3287
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3288
|
+
"div",
|
|
3289
|
+
{
|
|
3290
|
+
"data-test-id": testId,
|
|
3291
|
+
className: tailwindMerge.twMerge(
|
|
3292
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
3293
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
3294
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]"
|
|
3295
|
+
),
|
|
3296
|
+
children: [
|
|
3297
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
3298
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex items-center gap-[10px] flex-shrink-0", children: [
|
|
3299
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-shrink-0", style: { width: 38, height: 38 }, children: [
|
|
3300
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3301
|
+
"div",
|
|
3302
|
+
{
|
|
3303
|
+
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)]",
|
|
3304
|
+
children: initials
|
|
3305
|
+
}
|
|
3306
|
+
),
|
|
3307
|
+
/* @__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) })
|
|
3308
|
+
] }),
|
|
3309
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start", children: [
|
|
3310
|
+
/* @__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 }),
|
|
3311
|
+
/* @__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 })
|
|
3312
|
+
] })
|
|
3313
|
+
] }),
|
|
3314
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-10 bg-[var(--deframe-widget-color-border-secondary)] flex-shrink-0" }),
|
|
3315
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-end flex-1 min-w-0", children: [
|
|
3316
|
+
/* @__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 }),
|
|
3317
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)]", children: usd })
|
|
3318
|
+
] })
|
|
3319
|
+
] }),
|
|
3320
|
+
/* @__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 }) })
|
|
3321
|
+
]
|
|
3322
|
+
}
|
|
3323
|
+
);
|
|
3324
|
+
}
|
|
3207
3325
|
function LoadingIcon() {
|
|
3208
3326
|
const green = "var(--deframe-widget-color-brand-primary)";
|
|
3209
3327
|
const trackColor = "color-mix(in srgb, var(--deframe-widget-color-brand-primary) 12%, transparent)";
|
|
@@ -3264,72 +3382,68 @@ function LoadingIcon() {
|
|
|
3264
3382
|
}
|
|
3265
3383
|
);
|
|
3266
3384
|
}
|
|
3267
|
-
var SwapProcessingViewSimple = ({
|
|
3268
|
-
titleText,
|
|
3269
|
-
descriptionPrefix,
|
|
3270
|
-
activityHistoryText,
|
|
3271
|
-
onGoToHistory
|
|
3272
|
-
}) => {
|
|
3385
|
+
var SwapProcessingViewSimple = () => {
|
|
3273
3386
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3274
3387
|
"div",
|
|
3275
3388
|
{
|
|
3276
|
-
"data-test-id": "swap-processing-simple-
|
|
3389
|
+
"data-test-id": "swap-processing-simple-wrapper",
|
|
3277
3390
|
className: tailwindMerge.twMerge(
|
|
3278
|
-
"
|
|
3279
|
-
|
|
3280
|
-
"
|
|
3281
|
-
"
|
|
3282
|
-
"
|
|
3283
|
-
"
|
|
3284
|
-
"bg-[color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)]"
|
|
3391
|
+
"relative overflow-hidden",
|
|
3392
|
+
`w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] box-border`,
|
|
3393
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
3394
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
3395
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
3396
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
3285
3397
|
),
|
|
3398
|
+
style: { minHeight: SWAP_SIMPLE_MIN_HEIGHT },
|
|
3286
3399
|
children: [
|
|
3287
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3400
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-processing-simple-skeleton", children: /* @__PURE__ */ jsxRuntime.jsx(SwapFormSkeleton, {}) }),
|
|
3288
3401
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3289
3402
|
"div",
|
|
3290
3403
|
{
|
|
3291
|
-
"data-test-id": "swap-processing-simple-
|
|
3292
|
-
className:
|
|
3404
|
+
"data-test-id": "swap-processing-simple-screen",
|
|
3405
|
+
className: tailwindMerge.twMerge(
|
|
3406
|
+
"absolute inset-0 z-10",
|
|
3407
|
+
"flex flex-col items-center justify-center",
|
|
3408
|
+
"gap-[var(--deframe-widget-size-gap-lg)]",
|
|
3409
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-lg)]",
|
|
3410
|
+
"rounded-[inherit]",
|
|
3411
|
+
"backdrop-blur-[12px] [-webkit-backdrop-filter:blur(12px)]",
|
|
3412
|
+
"bg-[color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)]"
|
|
3413
|
+
),
|
|
3293
3414
|
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
|
-
),
|
|
3415
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingIcon, {}),
|
|
3307
3416
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3308
|
-
"
|
|
3417
|
+
"div",
|
|
3309
3418
|
{
|
|
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
|
-
),
|
|
3419
|
+
"data-test-id": "swap-processing-simple-copy",
|
|
3420
|
+
className: "flex flex-col items-center gap-[var(--deframe-widget-size-gap-sm)] text-center",
|
|
3318
3421
|
children: [
|
|
3319
|
-
descriptionPrefix,
|
|
3320
|
-
" ",
|
|
3321
3422
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3322
|
-
"
|
|
3423
|
+
"span",
|
|
3323
3424
|
{
|
|
3324
|
-
"data-test-id": "swap-processing-simple-
|
|
3325
|
-
onClick: onGoToHistory,
|
|
3326
|
-
"aria-label": activityHistoryText,
|
|
3425
|
+
"data-test-id": "swap-processing-simple-title",
|
|
3327
3426
|
className: tailwindMerge.twMerge(
|
|
3328
|
-
"
|
|
3427
|
+
"[font-size:12px] [line-height:1.25] [letter-spacing:0.10em] uppercase",
|
|
3329
3428
|
"[font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
3429
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
3330
3430
|
"text-[color:var(--deframe-widget-color-brand-primary)]"
|
|
3331
3431
|
),
|
|
3332
|
-
children:
|
|
3432
|
+
children: "PROCESSANDO TRANSA\xC7\xC3O..."
|
|
3433
|
+
}
|
|
3434
|
+
),
|
|
3435
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3436
|
+
"span",
|
|
3437
|
+
{
|
|
3438
|
+
"data-test-id": "swap-processing-simple-subtitle",
|
|
3439
|
+
className: tailwindMerge.twMerge(
|
|
3440
|
+
"[font-size:var(--deframe-widget-font-size-md)] [line-height:1.6]",
|
|
3441
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
3442
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
3443
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
3444
|
+
"max-w-[260px]"
|
|
3445
|
+
),
|
|
3446
|
+
children: "Aguarde enquanto sua troca \xE9 confirmada."
|
|
3333
3447
|
}
|
|
3334
3448
|
)
|
|
3335
3449
|
]
|
|
@@ -3515,6 +3629,162 @@ var SwapSignatureWarningView = ({
|
|
|
3515
3629
|
}
|
|
3516
3630
|
);
|
|
3517
3631
|
};
|
|
3632
|
+
function WarningIcon() {
|
|
3633
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3634
|
+
framerMotion.motion.div,
|
|
3635
|
+
{
|
|
3636
|
+
"data-test-id": "swap-signature-warning-simple-icon",
|
|
3637
|
+
initial: { scale: 0.55, opacity: 0 },
|
|
3638
|
+
animate: { scale: 1, opacity: 1 },
|
|
3639
|
+
transition: { type: "spring", stiffness: 300, damping: 20, delay: 0.05 },
|
|
3640
|
+
className: tailwindMerge.twMerge(
|
|
3641
|
+
"w-[84px] h-[84px] rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0",
|
|
3642
|
+
"flex items-center justify-center",
|
|
3643
|
+
"bg-[var(--deframe-widget-color-state-warning)]",
|
|
3644
|
+
"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)]"
|
|
3645
|
+
),
|
|
3646
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "44", height: "44", viewBox: "0 0 44 44", fill: "none", "aria-hidden": "true", children: [
|
|
3647
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3648
|
+
framerMotion.motion.line,
|
|
3649
|
+
{
|
|
3650
|
+
x1: "22",
|
|
3651
|
+
y1: "10",
|
|
3652
|
+
x2: "22",
|
|
3653
|
+
y2: "26",
|
|
3654
|
+
stroke: "white",
|
|
3655
|
+
strokeWidth: "3.5",
|
|
3656
|
+
strokeLinecap: "round",
|
|
3657
|
+
initial: { pathLength: 0 },
|
|
3658
|
+
animate: { pathLength: 1 },
|
|
3659
|
+
transition: { duration: 0.3, delay: 0.2, ease: "easeOut" }
|
|
3660
|
+
}
|
|
3661
|
+
),
|
|
3662
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3663
|
+
framerMotion.motion.circle,
|
|
3664
|
+
{
|
|
3665
|
+
cx: "22",
|
|
3666
|
+
cy: "33",
|
|
3667
|
+
r: "2",
|
|
3668
|
+
fill: "white",
|
|
3669
|
+
initial: { scale: 0, opacity: 0 },
|
|
3670
|
+
animate: { scale: 1, opacity: 1 },
|
|
3671
|
+
transition: { duration: 0.15, delay: 0.45, ease: "easeOut" }
|
|
3672
|
+
}
|
|
3673
|
+
)
|
|
3674
|
+
] })
|
|
3675
|
+
}
|
|
3676
|
+
);
|
|
3677
|
+
}
|
|
3678
|
+
var SwapSignatureWarningViewSimple = ({
|
|
3679
|
+
errorTitle,
|
|
3680
|
+
errorDescription,
|
|
3681
|
+
onCancel,
|
|
3682
|
+
onTryAgain,
|
|
3683
|
+
cancelButtonText,
|
|
3684
|
+
retryButtonText
|
|
3685
|
+
}) => {
|
|
3686
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3687
|
+
"div",
|
|
3688
|
+
{
|
|
3689
|
+
"data-test-id": "swap-signature-warning-simple-wrapper",
|
|
3690
|
+
className: tailwindMerge.twMerge(
|
|
3691
|
+
"relative overflow-hidden",
|
|
3692
|
+
`min-h-[${SWAP_SIMPLE_MIN_HEIGHT}px]`,
|
|
3693
|
+
`w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] box-border`,
|
|
3694
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
3695
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
3696
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
3697
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
3698
|
+
),
|
|
3699
|
+
children: [
|
|
3700
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-signature-warning-simple-skeleton", children: /* @__PURE__ */ jsxRuntime.jsx(SwapFormSkeleton, {}) }),
|
|
3701
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3702
|
+
"div",
|
|
3703
|
+
{
|
|
3704
|
+
"data-test-id": "swap-signature-warning-simple-screen",
|
|
3705
|
+
className: tailwindMerge.twMerge(
|
|
3706
|
+
"absolute inset-0 z-10",
|
|
3707
|
+
"flex flex-col items-center justify-center",
|
|
3708
|
+
"gap-[var(--deframe-widget-size-gap-lg)]",
|
|
3709
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-lg)]",
|
|
3710
|
+
"rounded-[inherit]",
|
|
3711
|
+
"backdrop-blur-[12px] [-webkit-backdrop-filter:blur(12px)]",
|
|
3712
|
+
"bg-[color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)]"
|
|
3713
|
+
),
|
|
3714
|
+
children: [
|
|
3715
|
+
/* @__PURE__ */ jsxRuntime.jsx(WarningIcon, {}),
|
|
3716
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3717
|
+
"div",
|
|
3718
|
+
{
|
|
3719
|
+
"data-test-id": "swap-signature-warning-simple-copy",
|
|
3720
|
+
className: "flex flex-col items-center gap-[var(--deframe-widget-size-gap-sm)] text-center",
|
|
3721
|
+
children: [
|
|
3722
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3723
|
+
"span",
|
|
3724
|
+
{
|
|
3725
|
+
"data-test-id": "swap-signature-warning-simple-title",
|
|
3726
|
+
className: tailwindMerge.twMerge(
|
|
3727
|
+
"[font-size:22px] [line-height:1.25]",
|
|
3728
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
3729
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
3730
|
+
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
3731
|
+
),
|
|
3732
|
+
children: errorTitle
|
|
3733
|
+
}
|
|
3734
|
+
),
|
|
3735
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3736
|
+
"span",
|
|
3737
|
+
{
|
|
3738
|
+
"data-test-id": "swap-signature-warning-simple-subtitle",
|
|
3739
|
+
className: tailwindMerge.twMerge(
|
|
3740
|
+
"[font-size:var(--deframe-widget-font-size-md)] [line-height:1.6]",
|
|
3741
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
3742
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
3743
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
3744
|
+
"max-w-[260px]"
|
|
3745
|
+
),
|
|
3746
|
+
children: errorDescription
|
|
3747
|
+
}
|
|
3748
|
+
)
|
|
3749
|
+
]
|
|
3750
|
+
}
|
|
3751
|
+
),
|
|
3752
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3753
|
+
"div",
|
|
3754
|
+
{
|
|
3755
|
+
"data-test-id": "swap-signature-warning-simple-actions",
|
|
3756
|
+
className: "flex gap-[var(--deframe-widget-size-gap-sm)] w-full max-w-[320px]",
|
|
3757
|
+
children: [
|
|
3758
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3759
|
+
SecondaryButton,
|
|
3760
|
+
{
|
|
3761
|
+
"data-test-id": "swap-signature-warning-simple-cancel",
|
|
3762
|
+
"aria-label": cancelButtonText != null ? cancelButtonText : "Cancel",
|
|
3763
|
+
className: "flex-1",
|
|
3764
|
+
onClick: onCancel,
|
|
3765
|
+
children: cancelButtonText
|
|
3766
|
+
}
|
|
3767
|
+
),
|
|
3768
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3769
|
+
PrimaryButton,
|
|
3770
|
+
{
|
|
3771
|
+
"data-test-id": "swap-signature-warning-simple-retry",
|
|
3772
|
+
"aria-label": retryButtonText != null ? retryButtonText : "Retry",
|
|
3773
|
+
className: "flex-1",
|
|
3774
|
+
onClick: onTryAgain,
|
|
3775
|
+
children: retryButtonText
|
|
3776
|
+
}
|
|
3777
|
+
)
|
|
3778
|
+
]
|
|
3779
|
+
}
|
|
3780
|
+
)
|
|
3781
|
+
]
|
|
3782
|
+
}
|
|
3783
|
+
)
|
|
3784
|
+
]
|
|
3785
|
+
}
|
|
3786
|
+
);
|
|
3787
|
+
};
|
|
3518
3788
|
var SwapSuccessView = ({
|
|
3519
3789
|
fromTokenSymbol,
|
|
3520
3790
|
fromTokenIcon,
|
|
@@ -3631,71 +3901,69 @@ function SuccessIcon() {
|
|
|
3631
3901
|
}
|
|
3632
3902
|
);
|
|
3633
3903
|
}
|
|
3634
|
-
var SwapSuccessViewSimple = ({
|
|
3635
|
-
onGoToWallet,
|
|
3636
|
-
labels
|
|
3637
|
-
}) => {
|
|
3904
|
+
var SwapSuccessViewSimple = () => {
|
|
3638
3905
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3639
3906
|
"div",
|
|
3640
3907
|
{
|
|
3641
|
-
"data-test-id": "swap-success-simple-
|
|
3908
|
+
"data-test-id": "swap-success-simple-wrapper",
|
|
3642
3909
|
className: tailwindMerge.twMerge(
|
|
3643
|
-
"
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
"
|
|
3647
|
-
"rounded-[
|
|
3648
|
-
"
|
|
3649
|
-
"
|
|
3910
|
+
"relative overflow-hidden",
|
|
3911
|
+
`min-h-[${SWAP_SIMPLE_MIN_HEIGHT}px]`,
|
|
3912
|
+
`w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] box-border`,
|
|
3913
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
3914
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
3915
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
3916
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
3650
3917
|
),
|
|
3651
3918
|
children: [
|
|
3652
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3919
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-success-simple-skeleton", children: /* @__PURE__ */ jsxRuntime.jsx(SwapFormSkeleton, {}) }),
|
|
3653
3920
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3654
3921
|
"div",
|
|
3655
3922
|
{
|
|
3656
|
-
"data-test-id": "swap-success-simple-
|
|
3657
|
-
className:
|
|
3923
|
+
"data-test-id": "swap-success-simple-screen",
|
|
3924
|
+
className: tailwindMerge.twMerge(
|
|
3925
|
+
"absolute inset-0 z-10",
|
|
3926
|
+
"flex flex-col items-center justify-center",
|
|
3927
|
+
"gap-[var(--deframe-widget-size-gap-lg)]",
|
|
3928
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-lg)]",
|
|
3929
|
+
"rounded-[inherit]",
|
|
3930
|
+
"backdrop-blur-[12px] [-webkit-backdrop-filter:blur(12px)]",
|
|
3931
|
+
"bg-[color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)]"
|
|
3932
|
+
),
|
|
3658
3933
|
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
|
-
),
|
|
3934
|
+
/* @__PURE__ */ jsxRuntime.jsx(SuccessIcon, {}),
|
|
3673
3935
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3674
|
-
"
|
|
3936
|
+
"div",
|
|
3675
3937
|
{
|
|
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
|
-
),
|
|
3938
|
+
"data-test-id": "swap-success-simple-copy",
|
|
3939
|
+
className: "flex flex-col items-center gap-[var(--deframe-widget-size-gap-sm)] text-center",
|
|
3684
3940
|
children: [
|
|
3685
|
-
labels == null ? void 0 : labels.descriptionSuffix,
|
|
3686
|
-
" ",
|
|
3687
3941
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3688
|
-
"
|
|
3942
|
+
"span",
|
|
3689
3943
|
{
|
|
3690
|
-
"data-test-id": "swap-success-simple-
|
|
3691
|
-
onClick: onGoToWallet,
|
|
3692
|
-
"aria-label": labels == null ? void 0 : labels.walletLinkText,
|
|
3944
|
+
"data-test-id": "swap-success-simple-title",
|
|
3693
3945
|
className: tailwindMerge.twMerge(
|
|
3694
|
-
"
|
|
3695
|
-
"[
|
|
3696
|
-
"
|
|
3946
|
+
"[font-size:var(--deframe-widget-font-size-xl)]",
|
|
3947
|
+
"[line-height:var(--deframe-widget-font-leading-xl)]",
|
|
3948
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
3949
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
3950
|
+
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
3951
|
+
),
|
|
3952
|
+
children: "Troca Aprovada!"
|
|
3953
|
+
}
|
|
3954
|
+
),
|
|
3955
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3956
|
+
"span",
|
|
3957
|
+
{
|
|
3958
|
+
"data-test-id": "swap-success-simple-subtitle",
|
|
3959
|
+
className: tailwindMerge.twMerge(
|
|
3960
|
+
"[font-size:var(--deframe-widget-font-size-md)] [line-height:1.6]",
|
|
3961
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
3962
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
3963
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
3964
|
+
"max-w-[260px]"
|
|
3697
3965
|
),
|
|
3698
|
-
children:
|
|
3966
|
+
children: "Seu saldo foi atualizado."
|
|
3699
3967
|
}
|
|
3700
3968
|
)
|
|
3701
3969
|
]
|
|
@@ -3840,49 +4108,67 @@ var SwapTransactionFailedViewSimple = ({
|
|
|
3840
4108
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3841
4109
|
"div",
|
|
3842
4110
|
{
|
|
3843
|
-
"data-test-id": "swap-failed-simple-
|
|
4111
|
+
"data-test-id": "swap-failed-simple-wrapper",
|
|
3844
4112
|
className: tailwindMerge.twMerge(
|
|
3845
|
-
"
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
"
|
|
3849
|
-
"rounded-[
|
|
3850
|
-
"
|
|
3851
|
-
"
|
|
4113
|
+
"relative overflow-hidden",
|
|
4114
|
+
`min-h-[${SWAP_SIMPLE_MIN_HEIGHT}px]`,
|
|
4115
|
+
`w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] box-border`,
|
|
4116
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
4117
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
4118
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
4119
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
3852
4120
|
),
|
|
3853
4121
|
children: [
|
|
3854
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4122
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-failed-simple-skeleton", children: /* @__PURE__ */ jsxRuntime.jsx(SwapFormSkeleton, {}) }),
|
|
3855
4123
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3856
4124
|
"div",
|
|
3857
4125
|
{
|
|
3858
|
-
"data-test-id": "swap-failed-simple-
|
|
3859
|
-
className:
|
|
4126
|
+
"data-test-id": "swap-failed-simple-screen",
|
|
4127
|
+
className: tailwindMerge.twMerge(
|
|
4128
|
+
"absolute inset-0 z-10",
|
|
4129
|
+
"flex flex-col items-center justify-center",
|
|
4130
|
+
"gap-[var(--deframe-widget-size-gap-lg)]",
|
|
4131
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-lg)]",
|
|
4132
|
+
"rounded-[inherit]",
|
|
4133
|
+
"backdrop-blur-[12px] [-webkit-backdrop-filter:blur(12px)]",
|
|
4134
|
+
"bg-[color-mix(in_srgb,var(--deframe-widget-color-bg-primary)_88%,transparent)]"
|
|
4135
|
+
),
|
|
3860
4136
|
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",
|
|
4137
|
+
/* @__PURE__ */ jsxRuntime.jsx(ErrorIcon, {}),
|
|
4138
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4139
|
+
"div",
|
|
3876
4140
|
{
|
|
3877
|
-
"data-test-id": "swap-failed-simple-
|
|
3878
|
-
className:
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
4141
|
+
"data-test-id": "swap-failed-simple-copy",
|
|
4142
|
+
className: "flex flex-col items-center gap-[var(--deframe-widget-size-gap-sm)] text-center",
|
|
4143
|
+
children: [
|
|
4144
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4145
|
+
"span",
|
|
4146
|
+
{
|
|
4147
|
+
"data-test-id": "swap-failed-simple-title",
|
|
4148
|
+
className: tailwindMerge.twMerge(
|
|
4149
|
+
"[font-size:22px] [line-height:1.25]",
|
|
4150
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
4151
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
4152
|
+
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
4153
|
+
),
|
|
4154
|
+
children: "Troca Falhou"
|
|
4155
|
+
}
|
|
4156
|
+
),
|
|
4157
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4158
|
+
"span",
|
|
4159
|
+
{
|
|
4160
|
+
"data-test-id": "swap-failed-simple-subtitle",
|
|
4161
|
+
className: tailwindMerge.twMerge(
|
|
4162
|
+
"[font-size:var(--deframe-widget-font-size-md)] [line-height:1.6]",
|
|
4163
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
4164
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
4165
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
4166
|
+
"max-w-[260px]"
|
|
4167
|
+
),
|
|
4168
|
+
children: "Tente novamente mais tarde."
|
|
4169
|
+
}
|
|
4170
|
+
)
|
|
4171
|
+
]
|
|
3886
4172
|
}
|
|
3887
4173
|
)
|
|
3888
4174
|
]
|
|
@@ -4535,70 +4821,2307 @@ var SwapFormView = ({
|
|
|
4535
4821
|
)
|
|
4536
4822
|
] });
|
|
4537
4823
|
};
|
|
4538
|
-
var
|
|
4824
|
+
var SwapFromCardViewSimple = ({
|
|
4539
4825
|
labels,
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4826
|
+
selectedToken,
|
|
4827
|
+
onTokenClick,
|
|
4828
|
+
onNetworkAndAssetClick,
|
|
4829
|
+
balanceFormatted,
|
|
4830
|
+
onBalanceClick,
|
|
4831
|
+
chainLabel,
|
|
4832
|
+
chainImage,
|
|
4833
|
+
amountValue,
|
|
4834
|
+
amountHasError,
|
|
4835
|
+
onAmountChange,
|
|
4836
|
+
amountUsdFormatted,
|
|
4837
|
+
isAmountUsdLoading,
|
|
4838
|
+
field,
|
|
4839
|
+
percentageOptions,
|
|
4840
|
+
onPercentageClick,
|
|
4841
|
+
selectedPercentage = null,
|
|
4842
|
+
maxLabel = "Max.",
|
|
4843
|
+
errorMessage = "Saldo insuficiente para realizar a troca.",
|
|
4844
|
+
errorActionLabel = "Adicionar via PIX",
|
|
4845
|
+
onErrorAction
|
|
4846
|
+
}) => {
|
|
4847
|
+
const [isHovered, setIsHovered] = React6.useState(false);
|
|
4848
|
+
const hideTimeout = React6.useRef(null);
|
|
4849
|
+
const handleMouseEnter = React6.useCallback(() => {
|
|
4850
|
+
if (hideTimeout.current) {
|
|
4851
|
+
clearTimeout(hideTimeout.current);
|
|
4852
|
+
hideTimeout.current = null;
|
|
4853
|
+
}
|
|
4854
|
+
setIsHovered(true);
|
|
4855
|
+
}, []);
|
|
4856
|
+
const handleMouseLeave = React6.useCallback(() => {
|
|
4857
|
+
hideTimeout.current = setTimeout(() => setIsHovered(false), 150);
|
|
4858
|
+
}, []);
|
|
4859
|
+
const wrapperClasses = tailwindMerge.twMerge(
|
|
4860
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
4861
|
+
"border",
|
|
4862
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
4863
|
+
"transition-[border-color,background] duration-200",
|
|
4864
|
+
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)]"
|
|
4865
|
+
);
|
|
4866
|
+
const isEmpty = !amountValue || Number(amountValue) === 0;
|
|
4867
|
+
const showChips = isHovered && percentageOptions && percentageOptions.length > 0 && onPercentageClick;
|
|
4868
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4869
|
+
"div",
|
|
4870
|
+
{
|
|
4871
|
+
"data-test-id": "swap-from-card-simple",
|
|
4872
|
+
className: wrapperClasses,
|
|
4873
|
+
onMouseEnter: handleMouseEnter,
|
|
4874
|
+
onMouseLeave: handleMouseLeave,
|
|
4875
|
+
children: [
|
|
4876
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4877
|
+
"div",
|
|
4878
|
+
{
|
|
4879
|
+
"data-test-id": "swap-from-card-simple-top-row",
|
|
4880
|
+
className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
4881
|
+
children: [
|
|
4882
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4883
|
+
TokenSelectorArea,
|
|
4884
|
+
{
|
|
4885
|
+
selectedToken,
|
|
4886
|
+
chainLabel,
|
|
4887
|
+
chainImage,
|
|
4888
|
+
onTokenClick: onNetworkAndAssetClick != null ? onNetworkAndAssetClick : onTokenClick,
|
|
4889
|
+
selectTokenLabel: labels.selectTokenLabel
|
|
4890
|
+
}
|
|
4891
|
+
),
|
|
4892
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4893
|
+
"div",
|
|
4894
|
+
{
|
|
4895
|
+
"data-test-id": "swap-from-card-simple-divider",
|
|
4896
|
+
className: "w-px h-10 bg-[var(--deframe-widget-color-border-secondary)] flex-shrink-0"
|
|
4897
|
+
}
|
|
4898
|
+
),
|
|
4899
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4900
|
+
"div",
|
|
4901
|
+
{
|
|
4902
|
+
"data-test-id": "swap-from-card-simple-amount-wrapper",
|
|
4903
|
+
className: "flex flex-col items-end flex-1 min-w-0",
|
|
4904
|
+
children: [
|
|
4905
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4906
|
+
"input",
|
|
4907
|
+
__spreadProps(__spreadValues({
|
|
4908
|
+
"data-test-id": "swap-from-card-simple-amount-input",
|
|
4909
|
+
type: "text",
|
|
4910
|
+
inputMode: "decimal",
|
|
4911
|
+
autoComplete: "off",
|
|
4912
|
+
placeholder: "0",
|
|
4913
|
+
"aria-label": labels.amountPlaceholder,
|
|
4914
|
+
value: amountValue || "",
|
|
4915
|
+
className: tailwindMerge.twMerge(
|
|
4916
|
+
"bg-transparent border-none outline-none",
|
|
4917
|
+
"text-right",
|
|
4918
|
+
"text-[36px] [font-weight:var(--deframe-widget-font-weight-semibold)] [line-height:1.1]",
|
|
4919
|
+
"w-full px-[var(--deframe-widget-size-padding-x-none)] py-[var(--deframe-widget-size-padding-y-none)]",
|
|
4920
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
4921
|
+
"placeholder:text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
4922
|
+
isEmpty ? "text-[color:var(--deframe-widget-color-text-tertiary)]" : "text-[color:var(--deframe-widget-color-text-primary)]"
|
|
4923
|
+
)
|
|
4924
|
+
}, field ? { name: field.name, onBlur: field.onBlur, ref: field.ref } : {}), {
|
|
4925
|
+
onChange: (e) => onAmountChange(e.target.value),
|
|
4926
|
+
onWheel: (e) => {
|
|
4927
|
+
e.currentTarget.blur();
|
|
4928
|
+
}
|
|
4929
|
+
})
|
|
4930
|
+
),
|
|
4931
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4932
|
+
"span",
|
|
4933
|
+
{
|
|
4934
|
+
"data-test-id": "swap-from-card-simple-usd-conversion",
|
|
4935
|
+
className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
4936
|
+
children: isAmountUsdLoading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {}) : amountUsdFormatted
|
|
4937
|
+
}
|
|
4938
|
+
)
|
|
4939
|
+
]
|
|
4940
|
+
}
|
|
4941
|
+
)
|
|
4942
|
+
]
|
|
4943
|
+
}
|
|
4944
|
+
),
|
|
4945
|
+
selectedToken && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4946
|
+
"div",
|
|
4947
|
+
{
|
|
4948
|
+
"data-test-id": "swap-from-card-simple-balance-row",
|
|
4949
|
+
className: "flex items-center justify-between mt-[var(--deframe-widget-size-gap-sm)]",
|
|
4950
|
+
children: onBalanceClick ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4951
|
+
"button",
|
|
4952
|
+
{
|
|
4953
|
+
"data-test-id": "swap-from-card-simple-balance",
|
|
4954
|
+
type: "button",
|
|
4955
|
+
onClick: onBalanceClick,
|
|
4956
|
+
"aria-label": `${labels.balanceLabel}: ${balanceFormatted}`,
|
|
4957
|
+
className: tailwindMerge.twMerge(
|
|
4958
|
+
"text-[13px] font-[var(--deframe-widget-font-family)] cursor-pointer",
|
|
4959
|
+
"bg-transparent border-none outline-none p-0",
|
|
4960
|
+
"text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
4961
|
+
"hover:text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
4962
|
+
"transition-colors duration-150"
|
|
4963
|
+
),
|
|
4964
|
+
children: [
|
|
4965
|
+
labels.balanceLabel,
|
|
4966
|
+
":",
|
|
4967
|
+
" ",
|
|
4968
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4969
|
+
"span",
|
|
4970
|
+
{
|
|
4971
|
+
"data-test-id": "swap-from-card-simple-balance-value",
|
|
4972
|
+
className: amountHasError ? "text-[color:var(--deframe-widget-color-state-error)]" : "text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
4973
|
+
children: balanceFormatted
|
|
4974
|
+
}
|
|
4975
|
+
)
|
|
4976
|
+
]
|
|
4977
|
+
}
|
|
4978
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4979
|
+
"span",
|
|
4980
|
+
{
|
|
4981
|
+
"data-test-id": "swap-from-card-simple-balance",
|
|
4982
|
+
className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
4983
|
+
children: [
|
|
4984
|
+
labels.balanceLabel,
|
|
4985
|
+
":",
|
|
4986
|
+
" ",
|
|
4987
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4988
|
+
"span",
|
|
4989
|
+
{
|
|
4990
|
+
"data-test-id": "swap-from-card-simple-balance-value",
|
|
4991
|
+
className: amountHasError ? "text-[color:var(--deframe-widget-color-state-error)]" : "text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
4992
|
+
children: balanceFormatted
|
|
4993
|
+
}
|
|
4994
|
+
)
|
|
4995
|
+
]
|
|
4996
|
+
}
|
|
4997
|
+
)
|
|
4998
|
+
}
|
|
4999
|
+
),
|
|
5000
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showChips && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5001
|
+
framerMotion.motion.div,
|
|
5002
|
+
{
|
|
5003
|
+
"data-test-id": "swap-from-card-simple-chips",
|
|
5004
|
+
initial: { opacity: 0, height: 0 },
|
|
5005
|
+
animate: { opacity: 1, height: "auto" },
|
|
5006
|
+
exit: { opacity: 0, height: 0 },
|
|
5007
|
+
transition: { duration: 0.15 },
|
|
5008
|
+
className: "overflow-hidden mt-[var(--deframe-widget-size-gap-sm)]",
|
|
5009
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5010
|
+
"div",
|
|
5011
|
+
{
|
|
5012
|
+
"data-test-id": "swap-from-card-simple-chips-row",
|
|
5013
|
+
className: "flex gap-[6px] items-center",
|
|
5014
|
+
children: percentageOptions.map((pct, i) => {
|
|
5015
|
+
const isLast = i === percentageOptions.length - 1;
|
|
5016
|
+
const isActive = pct === selectedPercentage;
|
|
5017
|
+
const chipLabel = isLast ? maxLabel : `${pct / 100}%`;
|
|
5018
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5019
|
+
ChipPill,
|
|
5020
|
+
{
|
|
5021
|
+
label: chipLabel,
|
|
5022
|
+
active: isActive,
|
|
5023
|
+
onClick: () => onPercentageClick(pct)
|
|
5024
|
+
},
|
|
5025
|
+
pct
|
|
5026
|
+
);
|
|
5027
|
+
})
|
|
5028
|
+
}
|
|
5029
|
+
)
|
|
5030
|
+
}
|
|
5031
|
+
) }),
|
|
5032
|
+
amountHasError && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5033
|
+
"div",
|
|
5034
|
+
{
|
|
5035
|
+
"data-test-id": "swap-from-card-simple-error",
|
|
5036
|
+
className: "mt-[var(--deframe-widget-size-gap-sm)]",
|
|
5037
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5038
|
+
InlineNotificationBar,
|
|
5039
|
+
{
|
|
5040
|
+
message: errorMessage,
|
|
5041
|
+
actionLabel: errorActionLabel,
|
|
5042
|
+
onAction: onErrorAction
|
|
5043
|
+
}
|
|
5044
|
+
)
|
|
5045
|
+
}
|
|
5046
|
+
)
|
|
5047
|
+
]
|
|
5048
|
+
}
|
|
5049
|
+
);
|
|
5050
|
+
};
|
|
5051
|
+
function TokenSelectorArea({
|
|
5052
|
+
selectedToken,
|
|
5053
|
+
chainLabel,
|
|
5054
|
+
chainImage,
|
|
5055
|
+
onTokenClick,
|
|
5056
|
+
selectTokenLabel
|
|
5057
|
+
}) {
|
|
5058
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5059
|
+
"button",
|
|
5060
|
+
{
|
|
5061
|
+
"data-test-id": "swap-from-card-simple-token-selector",
|
|
5062
|
+
type: "button",
|
|
5063
|
+
onClick: onTokenClick,
|
|
5064
|
+
"aria-label": selectedToken ? `Select token \u2014 currently ${selectedToken.symbol} on ${chainLabel}` : selectTokenLabel,
|
|
5065
|
+
className: tailwindMerge.twMerge(
|
|
5066
|
+
"inline-flex items-center gap-[10px]",
|
|
5067
|
+
"py-[var(--deframe-widget-size-padding-y-sm)] px-[10px]",
|
|
5068
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5069
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
5070
|
+
"border-none outline-none",
|
|
5071
|
+
"transition-[background] duration-150",
|
|
5072
|
+
"flex-shrink-0",
|
|
5073
|
+
"cursor-pointer hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_72%,transparent)]"
|
|
5074
|
+
),
|
|
5075
|
+
children: selectedToken ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5076
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5077
|
+
TokenIconWithBadge,
|
|
5078
|
+
{
|
|
5079
|
+
token: selectedToken,
|
|
5080
|
+
chainLabel,
|
|
5081
|
+
chainImage
|
|
5082
|
+
}
|
|
5083
|
+
),
|
|
5084
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5085
|
+
"div",
|
|
5086
|
+
{
|
|
5087
|
+
"data-test-id": "swap-from-card-simple-token-info",
|
|
5088
|
+
className: "flex flex-col items-start min-w-0",
|
|
5089
|
+
children: [
|
|
5090
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5091
|
+
"span",
|
|
5092
|
+
{
|
|
5093
|
+
"data-test-id": "swap-from-card-simple-token-symbol",
|
|
5094
|
+
className: tailwindMerge.twMerge(
|
|
5095
|
+
"text-[16px] [font-weight:var(--deframe-widget-font-weight-semibold)] leading-[1.2]",
|
|
5096
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5097
|
+
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
5098
|
+
),
|
|
5099
|
+
children: selectedToken.symbol
|
|
5100
|
+
}
|
|
5101
|
+
),
|
|
5102
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5103
|
+
"span",
|
|
5104
|
+
{
|
|
5105
|
+
"data-test-id": "swap-from-card-simple-token-network",
|
|
5106
|
+
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]",
|
|
5107
|
+
children: chainLabel
|
|
5108
|
+
}
|
|
5109
|
+
)
|
|
5110
|
+
]
|
|
5111
|
+
}
|
|
5112
|
+
),
|
|
5113
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, {})
|
|
5114
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5115
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5116
|
+
"div",
|
|
5117
|
+
{
|
|
5118
|
+
"data-test-id": "swap-from-card-simple-token-placeholder-icon",
|
|
5119
|
+
className: "w-[38px] h-[38px] rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-tertiary)] flex-shrink-0"
|
|
5120
|
+
}
|
|
5121
|
+
),
|
|
5122
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5123
|
+
"span",
|
|
5124
|
+
{
|
|
5125
|
+
"data-test-id": "swap-from-card-simple-token-placeholder-label",
|
|
5126
|
+
className: tailwindMerge.twMerge(
|
|
5127
|
+
"text-[16px] [font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
5128
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5129
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5130
|
+
"whitespace-nowrap"
|
|
5131
|
+
),
|
|
5132
|
+
children: selectTokenLabel
|
|
5133
|
+
}
|
|
5134
|
+
),
|
|
5135
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, {})
|
|
5136
|
+
] })
|
|
5137
|
+
}
|
|
5138
|
+
);
|
|
5139
|
+
}
|
|
5140
|
+
function TokenIconWithBadge({ token, chainLabel, chainImage }) {
|
|
5141
|
+
const [imgError, setImgError] = React6.useState(false);
|
|
5142
|
+
const [badgeError, setBadgeError] = React6.useState(false);
|
|
5143
|
+
const size = 38;
|
|
5144
|
+
const badgeSize = 16;
|
|
5145
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5146
|
+
"div",
|
|
5147
|
+
{
|
|
5148
|
+
"data-test-id": "swap-from-card-simple-token-icon",
|
|
5149
|
+
className: "relative flex-shrink-0",
|
|
5150
|
+
style: { width: size, height: size },
|
|
5151
|
+
children: [
|
|
5152
|
+
token.logoURI && !imgError ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5153
|
+
"img",
|
|
5154
|
+
{
|
|
5155
|
+
"data-test-id": "swap-from-card-simple-token-icon-img",
|
|
5156
|
+
src: token.logoURI,
|
|
5157
|
+
alt: token.symbol,
|
|
5158
|
+
width: size,
|
|
5159
|
+
height: size,
|
|
5160
|
+
className: "rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 object-cover",
|
|
5161
|
+
onError: () => setImgError(true)
|
|
5162
|
+
}
|
|
5163
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5164
|
+
"div",
|
|
5165
|
+
{
|
|
5166
|
+
"data-test-id": "swap-from-card-simple-token-icon-fallback",
|
|
5167
|
+
className: tailwindMerge.twMerge(
|
|
5168
|
+
"rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0",
|
|
5169
|
+
"flex items-center justify-center",
|
|
5170
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
5171
|
+
"text-[color:var(--deframe-widget-color-text-primary-dark)]",
|
|
5172
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]"
|
|
5173
|
+
),
|
|
5174
|
+
style: { width: size, height: size, fontSize: size * 0.33 },
|
|
5175
|
+
children: token.symbol.slice(0, 2).toUpperCase()
|
|
5176
|
+
}
|
|
5177
|
+
),
|
|
5178
|
+
chainImage && !badgeError ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5179
|
+
"div",
|
|
5180
|
+
{
|
|
5181
|
+
"data-test-id": "swap-from-card-simple-token-badge",
|
|
5182
|
+
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)]",
|
|
5183
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5184
|
+
"img",
|
|
5185
|
+
{
|
|
5186
|
+
"data-test-id": "swap-from-card-simple-token-badge-img",
|
|
5187
|
+
src: chainImage,
|
|
5188
|
+
alt: chainLabel,
|
|
5189
|
+
width: badgeSize,
|
|
5190
|
+
height: badgeSize,
|
|
5191
|
+
className: "rounded-[var(--deframe-widget-size-radius-full)] object-cover",
|
|
5192
|
+
onError: () => setBadgeError(true)
|
|
5193
|
+
}
|
|
5194
|
+
)
|
|
5195
|
+
}
|
|
5196
|
+
) : chainLabel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5197
|
+
"div",
|
|
5198
|
+
{
|
|
5199
|
+
"data-test-id": "swap-from-card-simple-token-badge",
|
|
5200
|
+
className: tailwindMerge.twMerge(
|
|
5201
|
+
"absolute -bottom-0.5 -right-0.5",
|
|
5202
|
+
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
5203
|
+
"shadow-[0_0_0_2px_var(--deframe-widget-color-bg-secondary)]",
|
|
5204
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
5205
|
+
"flex items-center justify-center",
|
|
5206
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)]",
|
|
5207
|
+
"text-[color:var(--deframe-widget-color-text-primary-dark)]"
|
|
5208
|
+
),
|
|
5209
|
+
style: { width: badgeSize, height: badgeSize, fontSize: badgeSize * 0.45 },
|
|
5210
|
+
children: chainLabel.slice(0, 1).toUpperCase()
|
|
5211
|
+
}
|
|
5212
|
+
) : null
|
|
5213
|
+
]
|
|
5214
|
+
}
|
|
5215
|
+
);
|
|
5216
|
+
}
|
|
5217
|
+
function ChevronDown() {
|
|
5218
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5219
|
+
"svg",
|
|
5220
|
+
{
|
|
5221
|
+
"data-test-id": "swap-from-card-simple-chevron",
|
|
5222
|
+
width: "14",
|
|
5223
|
+
height: "14",
|
|
5224
|
+
viewBox: "0 0 24 24",
|
|
5225
|
+
fill: "none",
|
|
5226
|
+
stroke: "currentColor",
|
|
5227
|
+
strokeWidth: "2.5",
|
|
5228
|
+
strokeLinecap: "round",
|
|
5229
|
+
strokeLinejoin: "round",
|
|
5230
|
+
className: "flex-shrink-0 text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5231
|
+
"aria-hidden": "true",
|
|
5232
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "6 9 12 15 18 9" })
|
|
5233
|
+
}
|
|
5234
|
+
);
|
|
5235
|
+
}
|
|
5236
|
+
function ChipPill({ label, active, onClick }) {
|
|
5237
|
+
const baseClasses = tailwindMerge.twMerge(
|
|
5238
|
+
"inline-flex items-center justify-center",
|
|
5239
|
+
"py-[3px] px-[10px]",
|
|
5240
|
+
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
5241
|
+
"cursor-pointer",
|
|
5242
|
+
"text-[12px]",
|
|
5243
|
+
"transition-all duration-150",
|
|
5244
|
+
"outline-none",
|
|
5245
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5246
|
+
"whitespace-nowrap",
|
|
5247
|
+
"border"
|
|
5248
|
+
);
|
|
5249
|
+
const stateClasses = active ? tailwindMerge.twMerge(
|
|
5250
|
+
"border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_32%,transparent)]",
|
|
5251
|
+
"bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)]",
|
|
5252
|
+
"text-[color:var(--deframe-widget-color-brand-primary)]",
|
|
5253
|
+
"[font-weight:var(--deframe-widget-font-weight-semibold)]"
|
|
5254
|
+
) : tailwindMerge.twMerge(
|
|
5255
|
+
"border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
5256
|
+
"bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_84%,transparent)]",
|
|
5257
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5258
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
5259
|
+
"hover:border-[color:var(--deframe-widget-color-border-primary)]",
|
|
5260
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
|
|
5261
|
+
"hover:text-[color:var(--deframe-widget-color-text-primary)]"
|
|
5262
|
+
);
|
|
5263
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5264
|
+
"button",
|
|
5265
|
+
{
|
|
5266
|
+
"data-test-id": "swap-from-card-simple-chip",
|
|
5267
|
+
type: "button",
|
|
5268
|
+
onClick,
|
|
5269
|
+
"aria-label": label,
|
|
5270
|
+
className: tailwindMerge.twMerge(baseClasses, stateClasses),
|
|
5271
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-test-id": "swap-from-card-simple-chip-label", children: label })
|
|
5272
|
+
}
|
|
5273
|
+
);
|
|
5274
|
+
}
|
|
5275
|
+
function InlineNotificationBar({ message, actionLabel, onAction }) {
|
|
5276
|
+
const wrapperClasses = tailwindMerge.twMerge(
|
|
5277
|
+
"relative flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
5278
|
+
"py-[7px] pr-[10px] pl-[14px]",
|
|
5279
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5280
|
+
"border",
|
|
5281
|
+
"overflow-hidden",
|
|
5282
|
+
"bg-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_16%,transparent)]",
|
|
5283
|
+
"border-[color:color-mix(in_srgb,var(--deframe-widget-color-state-error)_32%,transparent)]"
|
|
5284
|
+
);
|
|
5285
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5286
|
+
"div",
|
|
5287
|
+
{
|
|
5288
|
+
"data-test-id": "swap-from-card-simple-notification",
|
|
5289
|
+
role: "alert",
|
|
5290
|
+
className: wrapperClasses,
|
|
5291
|
+
children: [
|
|
5292
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5293
|
+
"div",
|
|
5294
|
+
{
|
|
5295
|
+
"data-test-id": "swap-from-card-simple-notification-accent",
|
|
5296
|
+
className: tailwindMerge.twMerge(
|
|
5297
|
+
"absolute left-0 top-0 bottom-0 w-[3px]",
|
|
5298
|
+
"rounded-[var(--deframe-widget-size-radius-sm)_0_0_var(--deframe-widget-size-radius-sm)]",
|
|
5299
|
+
"bg-[var(--deframe-widget-color-state-error)]"
|
|
5300
|
+
)
|
|
5301
|
+
}
|
|
5302
|
+
),
|
|
5303
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5304
|
+
"div",
|
|
5305
|
+
{
|
|
5306
|
+
"data-test-id": "swap-from-card-simple-notification-dot",
|
|
5307
|
+
className: "w-[6px] h-[6px] rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 bg-[var(--deframe-widget-color-state-error)]"
|
|
5308
|
+
}
|
|
5309
|
+
),
|
|
5310
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5311
|
+
"span",
|
|
5312
|
+
{
|
|
5313
|
+
"data-test-id": "swap-from-card-simple-notification-message",
|
|
5314
|
+
className: "flex-1 text-[13px] text-[color:var(--deframe-widget-color-text-secondary)] font-[var(--deframe-widget-font-family)] leading-[1.4]",
|
|
5315
|
+
children: message
|
|
5316
|
+
}
|
|
5317
|
+
),
|
|
5318
|
+
onAction && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5319
|
+
"button",
|
|
5320
|
+
{
|
|
5321
|
+
"data-test-id": "swap-from-card-simple-notification-action",
|
|
5322
|
+
type: "button",
|
|
5323
|
+
onClick: onAction,
|
|
5324
|
+
"aria-label": actionLabel,
|
|
5325
|
+
className: tailwindMerge.twMerge(
|
|
5326
|
+
"flex-shrink-0 bg-none border-none cursor-pointer",
|
|
5327
|
+
"text-[13px] [font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
5328
|
+
"py-[var(--deframe-widget-size-padding-y-none)] px-[var(--deframe-widget-size-padding-x-xs)]",
|
|
5329
|
+
"outline-none font-[var(--deframe-widget-font-family)] whitespace-nowrap",
|
|
5330
|
+
"text-[color:var(--deframe-widget-color-state-error)]"
|
|
5331
|
+
),
|
|
5332
|
+
children: [
|
|
5333
|
+
actionLabel,
|
|
5334
|
+
" \u2192"
|
|
5335
|
+
]
|
|
5336
|
+
}
|
|
5337
|
+
)
|
|
5338
|
+
]
|
|
5339
|
+
}
|
|
5340
|
+
);
|
|
5341
|
+
}
|
|
5342
|
+
function IconCircle({ item, size = 36 }) {
|
|
5343
|
+
const [imgError, setImgError] = React6__namespace.default.useState(false);
|
|
5344
|
+
if (item.iconUrl && !imgError) {
|
|
5345
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5346
|
+
"img",
|
|
5347
|
+
{
|
|
5348
|
+
"data-test-id": "icon-circle-img",
|
|
5349
|
+
src: item.iconUrl,
|
|
5350
|
+
alt: item.name,
|
|
5351
|
+
width: size,
|
|
5352
|
+
height: size,
|
|
5353
|
+
className: "rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 object-cover",
|
|
5354
|
+
onError: () => setImgError(true)
|
|
5355
|
+
}
|
|
5356
|
+
);
|
|
5357
|
+
}
|
|
5358
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5359
|
+
"div",
|
|
5360
|
+
{
|
|
5361
|
+
"data-test-id": "icon-circle-fallback",
|
|
5362
|
+
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)]",
|
|
5363
|
+
style: {
|
|
5364
|
+
width: size,
|
|
5365
|
+
height: size,
|
|
5366
|
+
background: item.color,
|
|
5367
|
+
fontSize: size * 0.33,
|
|
5368
|
+
letterSpacing: "-0.01em"
|
|
5369
|
+
},
|
|
5370
|
+
children: item.name.slice(0, 2).toUpperCase()
|
|
5371
|
+
}
|
|
5372
|
+
);
|
|
5373
|
+
}
|
|
5374
|
+
function TokenIcon2({
|
|
5375
|
+
token,
|
|
5376
|
+
size = 38,
|
|
5377
|
+
badge,
|
|
5378
|
+
badgeSize = 16
|
|
5379
|
+
}) {
|
|
5380
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5381
|
+
"div",
|
|
5382
|
+
{
|
|
5383
|
+
"data-test-id": "swap-to-simple-token-icon",
|
|
5384
|
+
className: "relative flex-shrink-0",
|
|
5385
|
+
style: { width: size, height: size },
|
|
5386
|
+
children: [
|
|
5387
|
+
/* @__PURE__ */ jsxRuntime.jsx(IconCircle, { item: token, size }),
|
|
5388
|
+
badge && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5389
|
+
"div",
|
|
5390
|
+
{
|
|
5391
|
+
"data-test-id": "swap-to-simple-token-badge",
|
|
5392
|
+
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)]",
|
|
5393
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(IconCircle, { item: badge, size: badgeSize })
|
|
5394
|
+
}
|
|
5395
|
+
)
|
|
5396
|
+
]
|
|
5397
|
+
}
|
|
5398
|
+
);
|
|
5399
|
+
}
|
|
5400
|
+
var SwapToCardViewSimple = ({
|
|
5401
|
+
labels,
|
|
5402
|
+
selectedToken,
|
|
5403
|
+
onTokenClick,
|
|
5404
|
+
onNetworkAndAssetClick,
|
|
5405
|
+
balanceFormatted,
|
|
5406
|
+
balanceUsdFormatted,
|
|
5407
|
+
chainLabel,
|
|
5408
|
+
chainImage,
|
|
5409
|
+
outputAmount,
|
|
5410
|
+
isOutputLoading,
|
|
5411
|
+
outputUsdFormatted,
|
|
5412
|
+
isOutputUsdLoading
|
|
5413
|
+
}) => {
|
|
5414
|
+
const handleTokenClick = onNetworkAndAssetClick != null ? onNetworkAndAssetClick : onTokenClick;
|
|
5415
|
+
const isEmpty = !outputAmount || Number(outputAmount) === 0;
|
|
5416
|
+
const wrapperClasses = tailwindMerge.twMerge(
|
|
5417
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5418
|
+
"border",
|
|
5419
|
+
"border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
5420
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
5421
|
+
"px-[var(--deframe-widget-size-padding-x-md)]",
|
|
5422
|
+
"py-[var(--deframe-widget-size-padding-y-md)]",
|
|
5423
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
5424
|
+
);
|
|
5425
|
+
const selectorBaseClasses = tailwindMerge.twMerge(
|
|
5426
|
+
"inline-flex items-center gap-[10px]",
|
|
5427
|
+
"py-[var(--deframe-widget-size-padding-y-sm)] px-[10px]",
|
|
5428
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5429
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
5430
|
+
"border-none",
|
|
5431
|
+
"outline-none",
|
|
5432
|
+
"transition-[background] duration-150",
|
|
5433
|
+
"flex-shrink-0",
|
|
5434
|
+
"cursor-pointer hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_72%,transparent)]"
|
|
5435
|
+
);
|
|
5436
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "swap-to-card-view-simple", className: wrapperClasses, children: [
|
|
5437
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5438
|
+
"div",
|
|
5439
|
+
{
|
|
5440
|
+
"data-test-id": "swap-to-simple-top-row",
|
|
5441
|
+
className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
5442
|
+
children: [
|
|
5443
|
+
selectedToken ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5444
|
+
"button",
|
|
5445
|
+
{
|
|
5446
|
+
type: "button",
|
|
5447
|
+
"data-test-id": "swap-to-simple-token-selector",
|
|
5448
|
+
onClick: handleTokenClick,
|
|
5449
|
+
"aria-label": `Select token \u2014 currently ${selectedToken.symbol} on ${chainLabel}`,
|
|
5450
|
+
className: selectorBaseClasses,
|
|
5451
|
+
children: [
|
|
5452
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5453
|
+
TokenIcon2,
|
|
5454
|
+
{
|
|
5455
|
+
token: {
|
|
5456
|
+
name: selectedToken.symbol,
|
|
5457
|
+
color: "var(--deframe-widget-color-brand-secondary)",
|
|
5458
|
+
iconUrl: selectedToken.logoURI
|
|
5459
|
+
},
|
|
5460
|
+
size: 38,
|
|
5461
|
+
badge: chainLabel ? {
|
|
5462
|
+
name: chainLabel,
|
|
5463
|
+
color: "var(--deframe-widget-color-brand-secondary)",
|
|
5464
|
+
iconUrl: chainImage
|
|
5465
|
+
} : void 0,
|
|
5466
|
+
badgeSize: 16
|
|
5467
|
+
}
|
|
5468
|
+
),
|
|
5469
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5470
|
+
"div",
|
|
5471
|
+
{
|
|
5472
|
+
"data-test-id": "swap-to-simple-token-info",
|
|
5473
|
+
className: "flex flex-col items-start min-w-0",
|
|
5474
|
+
children: [
|
|
5475
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5476
|
+
"span",
|
|
5477
|
+
{
|
|
5478
|
+
"data-test-id": "swap-to-simple-token-symbol",
|
|
5479
|
+
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)]",
|
|
5480
|
+
children: selectedToken.symbol
|
|
5481
|
+
}
|
|
5482
|
+
),
|
|
5483
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5484
|
+
"span",
|
|
5485
|
+
{
|
|
5486
|
+
"data-test-id": "swap-to-simple-token-network",
|
|
5487
|
+
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]",
|
|
5488
|
+
children: chainLabel
|
|
5489
|
+
}
|
|
5490
|
+
)
|
|
5491
|
+
]
|
|
5492
|
+
}
|
|
5493
|
+
),
|
|
5494
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5495
|
+
"svg",
|
|
5496
|
+
{
|
|
5497
|
+
"data-test-id": "swap-to-simple-chevron",
|
|
5498
|
+
width: "14",
|
|
5499
|
+
height: "14",
|
|
5500
|
+
viewBox: "0 0 24 24",
|
|
5501
|
+
fill: "none",
|
|
5502
|
+
stroke: "currentColor",
|
|
5503
|
+
strokeWidth: "2.5",
|
|
5504
|
+
strokeLinecap: "round",
|
|
5505
|
+
strokeLinejoin: "round",
|
|
5506
|
+
className: "flex-shrink-0 text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5507
|
+
"aria-hidden": "true",
|
|
5508
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "6 9 12 15 18 9" })
|
|
5509
|
+
}
|
|
5510
|
+
)
|
|
5511
|
+
]
|
|
5512
|
+
}
|
|
5513
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5514
|
+
"button",
|
|
5515
|
+
{
|
|
5516
|
+
type: "button",
|
|
5517
|
+
"data-test-id": "swap-to-simple-token-placeholder",
|
|
5518
|
+
onClick: handleTokenClick,
|
|
5519
|
+
"aria-label": labels.selectTokenLabel,
|
|
5520
|
+
className: selectorBaseClasses,
|
|
5521
|
+
children: [
|
|
5522
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5523
|
+
"div",
|
|
5524
|
+
{
|
|
5525
|
+
"data-test-id": "swap-to-simple-placeholder-circle",
|
|
5526
|
+
className: "rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
5527
|
+
style: { width: 38, height: 38 }
|
|
5528
|
+
}
|
|
5529
|
+
),
|
|
5530
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5531
|
+
"span",
|
|
5532
|
+
{
|
|
5533
|
+
"data-test-id": "swap-to-simple-placeholder-label",
|
|
5534
|
+
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",
|
|
5535
|
+
children: labels.selectTokenLabel
|
|
5536
|
+
}
|
|
5537
|
+
),
|
|
5538
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5539
|
+
"svg",
|
|
5540
|
+
{
|
|
5541
|
+
"data-test-id": "swap-to-simple-placeholder-chevron",
|
|
5542
|
+
width: "14",
|
|
5543
|
+
height: "14",
|
|
5544
|
+
viewBox: "0 0 24 24",
|
|
5545
|
+
fill: "none",
|
|
5546
|
+
stroke: "currentColor",
|
|
5547
|
+
strokeWidth: "2.5",
|
|
5548
|
+
strokeLinecap: "round",
|
|
5549
|
+
strokeLinejoin: "round",
|
|
5550
|
+
className: "flex-shrink-0 text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5551
|
+
"aria-hidden": "true",
|
|
5552
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "6 9 12 15 18 9" })
|
|
5553
|
+
}
|
|
5554
|
+
)
|
|
5555
|
+
]
|
|
5556
|
+
}
|
|
5557
|
+
),
|
|
5558
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5559
|
+
"div",
|
|
5560
|
+
{
|
|
5561
|
+
"data-test-id": "swap-to-simple-divider",
|
|
5562
|
+
className: "w-px h-10 bg-[var(--deframe-widget-color-border-secondary)] flex-shrink-0"
|
|
5563
|
+
}
|
|
5564
|
+
),
|
|
5565
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5566
|
+
"div",
|
|
5567
|
+
{
|
|
5568
|
+
"data-test-id": "swap-to-simple-output-wrapper",
|
|
5569
|
+
className: "flex flex-col items-end flex-1 min-w-0",
|
|
5570
|
+
children: [
|
|
5571
|
+
isOutputLoading ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5572
|
+
"span",
|
|
5573
|
+
{
|
|
5574
|
+
"data-test-id": "swap-to-simple-output-loading",
|
|
5575
|
+
className: tailwindMerge.twMerge(
|
|
5576
|
+
"text-[36px] [font-weight:var(--deframe-widget-font-weight-semibold)] [line-height:1.1]",
|
|
5577
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5578
|
+
"text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
5579
|
+
"text-right",
|
|
5580
|
+
"flex items-center"
|
|
5581
|
+
),
|
|
5582
|
+
children: [
|
|
5583
|
+
labels.searchingQuoteLabel,
|
|
5584
|
+
/* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {})
|
|
5585
|
+
]
|
|
5586
|
+
}
|
|
5587
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5588
|
+
"span",
|
|
5589
|
+
{
|
|
5590
|
+
"data-test-id": "swap-to-simple-output-amount",
|
|
5591
|
+
className: tailwindMerge.twMerge(
|
|
5592
|
+
"text-[36px] [font-weight:var(--deframe-widget-font-weight-semibold)] [line-height:1.1]",
|
|
5593
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5594
|
+
"text-right w-full",
|
|
5595
|
+
isEmpty ? "text-[color:var(--deframe-widget-color-text-tertiary)]" : "text-[color:var(--deframe-widget-color-text-primary)]"
|
|
5596
|
+
),
|
|
5597
|
+
children: isEmpty ? "0" : outputAmount
|
|
5598
|
+
}
|
|
5599
|
+
),
|
|
5600
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5601
|
+
"span",
|
|
5602
|
+
{
|
|
5603
|
+
"data-test-id": "swap-to-simple-output-usd",
|
|
5604
|
+
className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
5605
|
+
children: isOutputUsdLoading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {}) : outputUsdFormatted
|
|
5606
|
+
}
|
|
5607
|
+
)
|
|
5608
|
+
]
|
|
5609
|
+
}
|
|
5610
|
+
)
|
|
5611
|
+
]
|
|
5612
|
+
}
|
|
5613
|
+
),
|
|
5614
|
+
selectedToken && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5615
|
+
"div",
|
|
5616
|
+
{
|
|
5617
|
+
"data-test-id": "swap-to-simple-balance-row",
|
|
5618
|
+
className: "flex items-center justify-between mt-[var(--deframe-widget-size-gap-sm)]",
|
|
5619
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5620
|
+
"span",
|
|
5621
|
+
{
|
|
5622
|
+
"data-test-id": "swap-to-simple-balance",
|
|
5623
|
+
className: "text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)]",
|
|
5624
|
+
children: [
|
|
5625
|
+
labels.balanceLabel,
|
|
5626
|
+
":",
|
|
5627
|
+
" ",
|
|
5628
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5629
|
+
"span",
|
|
5630
|
+
{
|
|
5631
|
+
"data-test-id": "swap-to-simple-balance-value",
|
|
5632
|
+
className: "text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
5633
|
+
children: balanceFormatted
|
|
5634
|
+
}
|
|
5635
|
+
)
|
|
5636
|
+
]
|
|
5637
|
+
}
|
|
5638
|
+
)
|
|
5639
|
+
}
|
|
5640
|
+
)
|
|
5641
|
+
] });
|
|
5642
|
+
};
|
|
5643
|
+
function Spinner() {
|
|
5644
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5645
|
+
"svg",
|
|
5646
|
+
{
|
|
5647
|
+
"data-test-id": "confirm-swap-button-simple-spinner",
|
|
5648
|
+
width: "18",
|
|
5649
|
+
height: "18",
|
|
5650
|
+
viewBox: "0 0 24 24",
|
|
5651
|
+
fill: "none",
|
|
5652
|
+
stroke: "currentColor",
|
|
5653
|
+
strokeWidth: "2.5",
|
|
5654
|
+
strokeLinecap: "round",
|
|
5655
|
+
className: "animate-spin",
|
|
5656
|
+
"aria-hidden": "true",
|
|
5657
|
+
children: [
|
|
5658
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10", opacity: "0.3" }),
|
|
5659
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2 A10 10 0 0 1 22 12" })
|
|
5660
|
+
]
|
|
5661
|
+
}
|
|
5662
|
+
);
|
|
5663
|
+
}
|
|
5664
|
+
var ConfirmSwapButtonViewSimple = ({
|
|
5665
|
+
buttonLabel,
|
|
5666
|
+
disabled,
|
|
5667
|
+
isLoading,
|
|
5668
|
+
onClick
|
|
5669
|
+
}) => {
|
|
5670
|
+
const isDisabled = disabled || isLoading;
|
|
5671
|
+
const buttonClasses = tailwindMerge.twMerge(
|
|
5672
|
+
"w-full h-12",
|
|
5673
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5674
|
+
"border-none",
|
|
5675
|
+
"text-[15px] [font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
5676
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
5677
|
+
"transition-[background,color] duration-200",
|
|
5678
|
+
"flex items-center justify-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
5679
|
+
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"
|
|
5680
|
+
);
|
|
5681
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "confirm-swap-button-simple-wrapper", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5682
|
+
"button",
|
|
5683
|
+
{
|
|
5684
|
+
"data-test-id": "confirm-swap-button-simple",
|
|
5685
|
+
onClick: !isDisabled ? onClick : void 0,
|
|
5686
|
+
disabled: isDisabled,
|
|
5687
|
+
"aria-label": buttonLabel,
|
|
5688
|
+
className: buttonClasses,
|
|
5689
|
+
children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : buttonLabel
|
|
5690
|
+
}
|
|
5691
|
+
) });
|
|
5692
|
+
};
|
|
5693
|
+
var SwapFormViewSimple = ({
|
|
5694
|
+
onSubmit,
|
|
5695
|
+
formRef,
|
|
5696
|
+
labels,
|
|
5697
|
+
onHistoryClick,
|
|
5698
|
+
onSwitchTokens,
|
|
5699
|
+
switchTokensAriaLabel,
|
|
5700
|
+
fromCard,
|
|
5701
|
+
toCard,
|
|
5702
|
+
advancedSettings,
|
|
5703
|
+
transactionDetails,
|
|
5704
|
+
confirmButton
|
|
5705
|
+
}) => {
|
|
5706
|
+
const containerRef = React6.useRef(null);
|
|
5707
|
+
const [panelPos, setPanelPos] = React6.useState(null);
|
|
5708
|
+
const [showPanel, setShowPanel] = React6.useState(false);
|
|
5709
|
+
React6.useEffect(() => {
|
|
5710
|
+
if (!advancedSettings.isOpen) setShowPanel(false);
|
|
5711
|
+
}, [advancedSettings.isOpen]);
|
|
5712
|
+
const updatePanelPos = React6.useCallback(() => {
|
|
5713
|
+
if (containerRef.current && showPanel) {
|
|
5714
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
5715
|
+
setPanelPos({ top: rect.top, left: rect.right + 16 });
|
|
5716
|
+
}
|
|
5717
|
+
}, [showPanel]);
|
|
5718
|
+
React6.useEffect(() => {
|
|
5719
|
+
if (!showPanel) {
|
|
5720
|
+
setPanelPos(null);
|
|
5721
|
+
return;
|
|
5722
|
+
}
|
|
5723
|
+
updatePanelPos();
|
|
5724
|
+
window.addEventListener("scroll", updatePanelPos, true);
|
|
5725
|
+
window.addEventListener("resize", updatePanelPos);
|
|
5726
|
+
return () => {
|
|
5727
|
+
window.removeEventListener("scroll", updatePanelPos, true);
|
|
5728
|
+
window.removeEventListener("resize", updatePanelPos);
|
|
5729
|
+
};
|
|
5730
|
+
}, [showPanel, updatePanelPos]);
|
|
5731
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5732
|
+
"div",
|
|
5733
|
+
{
|
|
5734
|
+
ref: containerRef,
|
|
5735
|
+
"data-test-id": "swap-form-view-simple",
|
|
5736
|
+
className: tailwindMerge.twMerge(
|
|
5737
|
+
"relative",
|
|
5738
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
5739
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
5740
|
+
"px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
5741
|
+
"flex flex-col",
|
|
5742
|
+
`w-[${SWAP_SIMPLE_WIDTH}px] max-w-[calc(100%-32px)] shrink-0 box-border`,
|
|
5743
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
5744
|
+
),
|
|
5745
|
+
style: { minHeight: SWAP_SIMPLE_MIN_HEIGHT },
|
|
5746
|
+
children: [
|
|
5747
|
+
/* @__PURE__ */ jsxRuntime.jsxs("form", { ref: formRef, onSubmit, "data-test-id": "swap-form-simple-form", className: "flex flex-col flex-1", children: [
|
|
5748
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
5749
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5750
|
+
"div",
|
|
5751
|
+
{
|
|
5752
|
+
"data-test-id": "swap-form-simple-top-row",
|
|
5753
|
+
className: "flex items-center justify-end mb-[var(--deframe-widget-size-gap-sm)]",
|
|
5754
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(HistoryButton, { onClick: onHistoryClick, ariaLabel: labels.historyAriaLabel })
|
|
5755
|
+
}
|
|
5756
|
+
),
|
|
5757
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5758
|
+
SwapFromCardViewSimple,
|
|
5759
|
+
__spreadProps(__spreadValues({}, fromCard), {
|
|
5760
|
+
onNetworkAndAssetClick: fromCard.onNetworkAndAssetClick ? () => {
|
|
5761
|
+
setShowPanel(false);
|
|
5762
|
+
fromCard.onNetworkAndAssetClick();
|
|
5763
|
+
} : void 0,
|
|
5764
|
+
percentageOptions: advancedSettings.percentageOptions,
|
|
5765
|
+
onPercentageClick: (pct) => advancedSettings.onPercentageClick(pct),
|
|
5766
|
+
maxLabel: advancedSettings.maxLabel
|
|
5767
|
+
})
|
|
5768
|
+
),
|
|
5769
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5770
|
+
"div",
|
|
5771
|
+
{
|
|
5772
|
+
"data-test-id": "swap-form-simple-direction-row",
|
|
5773
|
+
className: "flex justify-center relative -my-[16px] z-[1]",
|
|
5774
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5775
|
+
SwapDirectionButton,
|
|
5776
|
+
{
|
|
5777
|
+
onClick: onSwitchTokens,
|
|
5778
|
+
ariaLabel: switchTokensAriaLabel
|
|
5779
|
+
}
|
|
5780
|
+
)
|
|
5781
|
+
}
|
|
5782
|
+
),
|
|
5783
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5784
|
+
SwapToCardViewSimple,
|
|
5785
|
+
__spreadProps(__spreadValues({}, toCard), {
|
|
5786
|
+
onNetworkAndAssetClick: toCard.onNetworkAndAssetClick ? () => {
|
|
5787
|
+
setShowPanel(false);
|
|
5788
|
+
toCard.onNetworkAndAssetClick();
|
|
5789
|
+
} : void 0
|
|
5790
|
+
})
|
|
5791
|
+
),
|
|
5792
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5793
|
+
"div",
|
|
5794
|
+
{
|
|
5795
|
+
"data-test-id": "swap-form-simple-advanced-wrapper",
|
|
5796
|
+
className: "flex justify-end mt-[var(--deframe-widget-size-gap-sm)]",
|
|
5797
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5798
|
+
AdvancedPill,
|
|
5799
|
+
{
|
|
5800
|
+
label: "Avan\xE7ado",
|
|
5801
|
+
isOpen: showPanel,
|
|
5802
|
+
onClick: () => {
|
|
5803
|
+
const next = !showPanel;
|
|
5804
|
+
setShowPanel(next);
|
|
5805
|
+
advancedSettings.onOpenChange(next);
|
|
5806
|
+
}
|
|
5807
|
+
}
|
|
5808
|
+
)
|
|
5809
|
+
}
|
|
5810
|
+
)
|
|
5811
|
+
] }),
|
|
5812
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
|
|
5813
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[var(--deframe-widget-size-gap-sm)]", children: /* @__PURE__ */ jsxRuntime.jsx(ConfirmSwapButtonViewSimple, __spreadValues({}, confirmButton)) })
|
|
5814
|
+
] }),
|
|
5815
|
+
showPanel && panelPos && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5816
|
+
"div",
|
|
5817
|
+
{
|
|
5818
|
+
"data-test-id": "swap-form-simple-advanced-panel",
|
|
5819
|
+
className: tailwindMerge.twMerge(
|
|
5820
|
+
"fixed",
|
|
5821
|
+
"w-[320px] z-[9999]",
|
|
5822
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
5823
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
5824
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
5825
|
+
"shadow-[0px_4px_24px_0px_#0000003D]",
|
|
5826
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
5827
|
+
),
|
|
5828
|
+
style: { top: panelPos.top, left: panelPos.left },
|
|
5829
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5830
|
+
AdvancedPanelContent,
|
|
5831
|
+
{
|
|
5832
|
+
advancedSettings: __spreadProps(__spreadValues({}, advancedSettings), {
|
|
5833
|
+
onOpenChange: (open) => {
|
|
5834
|
+
setShowPanel(open);
|
|
5835
|
+
advancedSettings.onOpenChange(open);
|
|
5836
|
+
}
|
|
5837
|
+
}),
|
|
5838
|
+
transactionDetails
|
|
5839
|
+
}
|
|
5840
|
+
)
|
|
5841
|
+
}
|
|
5842
|
+
)
|
|
5843
|
+
]
|
|
5844
|
+
}
|
|
5845
|
+
);
|
|
5846
|
+
};
|
|
5847
|
+
function HistoryButton({ onClick, ariaLabel }) {
|
|
5848
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5849
|
+
"button",
|
|
5850
|
+
{
|
|
5851
|
+
"data-test-id": "swap-form-simple-history-button",
|
|
5852
|
+
type: "button",
|
|
5853
|
+
onClick,
|
|
5854
|
+
"aria-label": ariaLabel,
|
|
5855
|
+
className: tailwindMerge.twMerge(
|
|
5856
|
+
"inline-flex items-center justify-center",
|
|
5857
|
+
"w-9 h-9",
|
|
5858
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5859
|
+
"border-none",
|
|
5860
|
+
"cursor-pointer",
|
|
5861
|
+
"bg-transparent",
|
|
5862
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
|
|
5863
|
+
"transition-[background] duration-150",
|
|
5864
|
+
"flex-shrink-0",
|
|
5865
|
+
"outline-none",
|
|
5866
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]"
|
|
5867
|
+
),
|
|
5868
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5869
|
+
"svg",
|
|
5870
|
+
{
|
|
5871
|
+
"data-test-id": "swap-form-simple-history-icon",
|
|
5872
|
+
viewBox: "0 0 24 24",
|
|
5873
|
+
width: "20",
|
|
5874
|
+
height: "20",
|
|
5875
|
+
fill: "none",
|
|
5876
|
+
stroke: "currentColor",
|
|
5877
|
+
strokeWidth: "2",
|
|
5878
|
+
strokeLinecap: "round",
|
|
5879
|
+
strokeLinejoin: "round",
|
|
5880
|
+
"aria-hidden": "true",
|
|
5881
|
+
children: [
|
|
5882
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
5883
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "12 6 12 12 16 14" })
|
|
5884
|
+
]
|
|
5885
|
+
}
|
|
5886
|
+
)
|
|
5887
|
+
}
|
|
5888
|
+
);
|
|
5889
|
+
}
|
|
5890
|
+
function SwapDirectionButton({ onClick, ariaLabel }) {
|
|
5891
|
+
const [isHovered, setIsHovered] = React6.useState(false);
|
|
5892
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5893
|
+
framerMotion.motion.button,
|
|
5894
|
+
{
|
|
5895
|
+
"data-test-id": "swap-form-simple-direction-button",
|
|
5896
|
+
type: "button",
|
|
5897
|
+
onClick,
|
|
5898
|
+
onMouseEnter: () => setIsHovered(true),
|
|
5899
|
+
onMouseLeave: () => setIsHovered(false),
|
|
5900
|
+
animate: { rotate: isHovered ? 180 : 0 },
|
|
5901
|
+
transition: { duration: 0.25, ease: "easeInOut" },
|
|
5902
|
+
"aria-label": ariaLabel,
|
|
5903
|
+
className: tailwindMerge.twMerge(
|
|
5904
|
+
"inline-flex items-center justify-center",
|
|
5905
|
+
"w-10 h-10",
|
|
5906
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
5907
|
+
"bg-[#12151c]",
|
|
5908
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
5909
|
+
"outline-none",
|
|
5910
|
+
"flex-shrink-0",
|
|
5911
|
+
"shadow-[0px_2px_8px_0px_#0000003D]",
|
|
5912
|
+
"cursor-pointer text-[color:var(--deframe-widget-color-brand-primary)]"
|
|
5913
|
+
),
|
|
5914
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5915
|
+
"svg",
|
|
5916
|
+
{
|
|
5917
|
+
"data-test-id": "swap-form-simple-direction-icon",
|
|
5918
|
+
width: "18",
|
|
5919
|
+
height: "18",
|
|
5920
|
+
viewBox: "0 0 24 24",
|
|
5921
|
+
fill: "none",
|
|
5922
|
+
stroke: "currentColor",
|
|
5923
|
+
strokeWidth: "2.5",
|
|
5924
|
+
strokeLinecap: "round",
|
|
5925
|
+
strokeLinejoin: "round",
|
|
5926
|
+
"aria-hidden": "true",
|
|
5927
|
+
children: [
|
|
5928
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
5929
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "19 12 12 19 5 12" })
|
|
5930
|
+
]
|
|
5931
|
+
}
|
|
5932
|
+
)
|
|
5933
|
+
}
|
|
5934
|
+
);
|
|
5935
|
+
}
|
|
5936
|
+
function AdvancedPill({ label, isOpen, onClick }) {
|
|
5937
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5938
|
+
"button",
|
|
5939
|
+
{
|
|
5940
|
+
"data-test-id": "swap-form-simple-advanced-pill",
|
|
5941
|
+
type: "button",
|
|
5942
|
+
onClick,
|
|
5943
|
+
className: tailwindMerge.twMerge(
|
|
5944
|
+
"inline-flex items-center gap-[5px]",
|
|
5945
|
+
"py-[5px] px-[var(--deframe-widget-size-padding-x-sm)]",
|
|
5946
|
+
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
5947
|
+
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",
|
|
5948
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)]",
|
|
5949
|
+
"cursor-pointer",
|
|
5950
|
+
"text-[color:var(--deframe-widget-color-brand-primary)]",
|
|
5951
|
+
"text-[13px] [font-weight:var(--deframe-widget-font-weight-medium)]",
|
|
5952
|
+
"outline-none",
|
|
5953
|
+
"font-[inherit]",
|
|
5954
|
+
"transition-[background] duration-150",
|
|
5955
|
+
"flex-shrink-0"
|
|
5956
|
+
),
|
|
5957
|
+
children: [
|
|
5958
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5959
|
+
"svg",
|
|
5960
|
+
{
|
|
5961
|
+
"data-test-id": "swap-form-simple-advanced-pill-icon",
|
|
5962
|
+
width: "13",
|
|
5963
|
+
height: "13",
|
|
5964
|
+
viewBox: "0 0 24 24",
|
|
5965
|
+
fill: "none",
|
|
5966
|
+
stroke: "currentColor",
|
|
5967
|
+
strokeWidth: "2.5",
|
|
5968
|
+
strokeLinecap: "round",
|
|
5969
|
+
strokeLinejoin: "round",
|
|
5970
|
+
"aria-hidden": "true",
|
|
5971
|
+
children: [
|
|
5972
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", y1: "6", x2: "20", y2: "6" }),
|
|
5973
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", y1: "12", x2: "20", y2: "12" }),
|
|
5974
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "4", y1: "18", x2: "20", y2: "18" }),
|
|
5975
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "6", r: "2", fill: "currentColor", stroke: "none" }),
|
|
5976
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "16", cy: "12", r: "2", fill: "currentColor", stroke: "none" }),
|
|
5977
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "10", cy: "18", r: "2", fill: "currentColor", stroke: "none" })
|
|
5978
|
+
]
|
|
5979
|
+
}
|
|
5980
|
+
),
|
|
5981
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-test-id": "swap-form-simple-advanced-pill-label", children: label })
|
|
5982
|
+
]
|
|
5983
|
+
}
|
|
5984
|
+
);
|
|
5985
|
+
}
|
|
5986
|
+
function AdvancedPanelContent({ advancedSettings, transactionDetails }) {
|
|
5987
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5988
|
+
"div",
|
|
5989
|
+
{
|
|
5990
|
+
"data-test-id": "swap-form-simple-advanced-panel-content",
|
|
5991
|
+
className: "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
|
|
5992
|
+
children: [
|
|
5993
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5994
|
+
"div",
|
|
5995
|
+
{
|
|
5996
|
+
"data-test-id": "swap-form-simple-advanced-panel-header",
|
|
5997
|
+
className: "flex justify-between items-center mb-[6px]",
|
|
5998
|
+
children: [
|
|
5999
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6000
|
+
"span",
|
|
6001
|
+
{
|
|
6002
|
+
"data-test-id": "swap-form-simple-advanced-panel-title",
|
|
6003
|
+
className: "text-[15px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)] font-[inherit]",
|
|
6004
|
+
children: "Avan\xE7ado"
|
|
6005
|
+
}
|
|
6006
|
+
),
|
|
6007
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6008
|
+
"button",
|
|
6009
|
+
{
|
|
6010
|
+
"data-test-id": "swap-form-simple-advanced-panel-close",
|
|
6011
|
+
type: "button",
|
|
6012
|
+
onClick: () => advancedSettings.onOpenChange(false),
|
|
6013
|
+
"aria-label": "Close advanced panel",
|
|
6014
|
+
className: tailwindMerge.twMerge(
|
|
6015
|
+
"inline-flex items-center justify-center",
|
|
6016
|
+
"w-7 h-7",
|
|
6017
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6018
|
+
"border-none cursor-pointer bg-transparent",
|
|
6019
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
|
|
6020
|
+
"transition-[background] duration-150",
|
|
6021
|
+
"flex-shrink-0 outline-none",
|
|
6022
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]"
|
|
6023
|
+
),
|
|
6024
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6025
|
+
"svg",
|
|
6026
|
+
{
|
|
6027
|
+
"data-test-id": "swap-form-simple-advanced-panel-close-icon",
|
|
6028
|
+
viewBox: "0 0 24 24",
|
|
6029
|
+
width: "16",
|
|
6030
|
+
height: "16",
|
|
6031
|
+
fill: "currentColor",
|
|
6032
|
+
"aria-hidden": "true",
|
|
6033
|
+
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" })
|
|
6034
|
+
}
|
|
6035
|
+
)
|
|
6036
|
+
}
|
|
6037
|
+
)
|
|
6038
|
+
]
|
|
6039
|
+
}
|
|
6040
|
+
),
|
|
6041
|
+
transactionDetails.exchangeRateFormatted && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6042
|
+
"p",
|
|
6043
|
+
{
|
|
6044
|
+
"data-test-id": "swap-form-simple-advanced-panel-subtitle",
|
|
6045
|
+
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]",
|
|
6046
|
+
children: transactionDetails.exchangeRateFormatted
|
|
6047
|
+
}
|
|
6048
|
+
),
|
|
6049
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6050
|
+
"div",
|
|
6051
|
+
{
|
|
6052
|
+
"data-test-id": "swap-form-simple-advanced-panel-divider",
|
|
6053
|
+
className: "h-px bg-[var(--deframe-widget-color-border-secondary)] mt-[var(--deframe-widget-size-gap-sm)]"
|
|
6054
|
+
}
|
|
6055
|
+
),
|
|
6056
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.exchangeRateLabel, value: transactionDetails.exchangeRateFormatted }),
|
|
6057
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.blockchainCostsLabel, value: transactionDetails.totalCostFormatted }),
|
|
6058
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.networkGasLabel, value: transactionDetails.gasCostFormatted }),
|
|
6059
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.protocolFeeLabel, value: transactionDetails.protocolFee }),
|
|
6060
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.slippageLabel, value: transactionDetails.slippageFormatted }),
|
|
6061
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.etaLabel, value: transactionDetails.etaFormatted }),
|
|
6062
|
+
transactionDetails.quoteId && /* @__PURE__ */ jsxRuntime.jsx(DetailRow, { label: transactionDetails.labels.quoteIdLabel, value: transactionDetails.quoteId }),
|
|
6063
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6064
|
+
"div",
|
|
6065
|
+
{
|
|
6066
|
+
"data-test-id": "swap-form-simple-advanced-panel-divider-2",
|
|
6067
|
+
className: "h-px bg-[var(--deframe-widget-color-border-secondary)] my-[var(--deframe-widget-size-gap-sm)]"
|
|
6068
|
+
}
|
|
6069
|
+
),
|
|
6070
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "swap-form-simple-advanced-panel-slippage", children: [
|
|
6071
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6072
|
+
"span",
|
|
6073
|
+
{
|
|
6074
|
+
"data-test-id": "swap-form-simple-advanced-panel-slippage-label",
|
|
6075
|
+
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)]",
|
|
6076
|
+
children: [
|
|
6077
|
+
"Slippage: ",
|
|
6078
|
+
advancedSettings.slippageFormatted
|
|
6079
|
+
]
|
|
6080
|
+
}
|
|
6081
|
+
),
|
|
6082
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6083
|
+
"div",
|
|
6084
|
+
{
|
|
6085
|
+
"data-test-id": "swap-form-simple-advanced-panel-slippage-buttons",
|
|
6086
|
+
className: "flex gap-[6px] mt-[var(--deframe-widget-size-gap-sm)]",
|
|
6087
|
+
children: [10, 50, 100].map((bps) => {
|
|
6088
|
+
const isActive = advancedSettings.slippageBps === bps;
|
|
6089
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6090
|
+
"button",
|
|
6091
|
+
{
|
|
6092
|
+
"data-test-id": "swap-form-simple-slippage-btn",
|
|
6093
|
+
type: "button",
|
|
6094
|
+
onClick: () => advancedSettings.onSlippageSelect(bps),
|
|
6095
|
+
className: tailwindMerge.twMerge(
|
|
6096
|
+
"py-[3px] px-[10px]",
|
|
6097
|
+
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
6098
|
+
"text-[12px] font-[var(--deframe-widget-font-family)]",
|
|
6099
|
+
"border cursor-pointer outline-none",
|
|
6100
|
+
"transition-all duration-150",
|
|
6101
|
+
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)]"
|
|
6102
|
+
),
|
|
6103
|
+
children: advancedSettings.formatPercentage(bps)
|
|
6104
|
+
},
|
|
6105
|
+
bps
|
|
6106
|
+
);
|
|
6107
|
+
})
|
|
6108
|
+
}
|
|
6109
|
+
)
|
|
6110
|
+
] })
|
|
6111
|
+
]
|
|
6112
|
+
}
|
|
6113
|
+
);
|
|
6114
|
+
}
|
|
6115
|
+
function DetailRow({ label, value }) {
|
|
6116
|
+
if (!label && !value) return null;
|
|
6117
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6118
|
+
"div",
|
|
6119
|
+
{
|
|
6120
|
+
"data-test-id": "swap-form-simple-detail-row",
|
|
6121
|
+
className: "flex justify-between items-center py-[10px] gap-[var(--deframe-widget-size-gap-sm)]",
|
|
6122
|
+
children: [
|
|
6123
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6124
|
+
"span",
|
|
6125
|
+
{
|
|
6126
|
+
"data-test-id": "swap-form-simple-detail-row-label",
|
|
6127
|
+
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",
|
|
6128
|
+
children: label
|
|
6129
|
+
}
|
|
6130
|
+
),
|
|
6131
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6132
|
+
"span",
|
|
6133
|
+
{
|
|
6134
|
+
"data-test-id": "swap-form-simple-detail-row-value",
|
|
6135
|
+
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)]",
|
|
6136
|
+
children: value
|
|
6137
|
+
}
|
|
6138
|
+
)
|
|
6139
|
+
]
|
|
6140
|
+
}
|
|
6141
|
+
);
|
|
6142
|
+
}
|
|
6143
|
+
var ChooseANetworkView = ({
|
|
6144
|
+
labels,
|
|
6145
|
+
autoFocus = true,
|
|
6146
|
+
chains,
|
|
6147
|
+
pageSize = 10,
|
|
6148
|
+
onChainClick
|
|
6149
|
+
}) => {
|
|
6150
|
+
const [searchValue, setSearchValue] = React6.useState("");
|
|
6151
|
+
const [page, setPage] = React6.useState(1);
|
|
6152
|
+
React6.useEffect(() => {
|
|
4548
6153
|
setPage(1);
|
|
4549
6154
|
}, [searchValue]);
|
|
4550
6155
|
const filteredChains = chains.filter(
|
|
4551
6156
|
(chain) => chain.name.toLowerCase().includes(searchValue.toLowerCase())
|
|
4552
6157
|
);
|
|
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,
|
|
6158
|
+
const displayedChains = filteredChains.slice(0, page * pageSize);
|
|
6159
|
+
const hasMore = filteredChains.length > page * pageSize;
|
|
6160
|
+
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: [
|
|
6161
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0", children: [
|
|
6162
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { children: labels.title }),
|
|
6163
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
6164
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6165
|
+
SearchInput,
|
|
6166
|
+
{
|
|
6167
|
+
value: searchValue,
|
|
6168
|
+
onChange: setSearchValue,
|
|
6169
|
+
placeholder: labels.searchPlaceholder,
|
|
6170
|
+
autoFocus
|
|
6171
|
+
}
|
|
6172
|
+
)
|
|
6173
|
+
] }),
|
|
6174
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6175
|
+
"div",
|
|
6176
|
+
{
|
|
6177
|
+
"data-testid": "choose-a-network-list",
|
|
6178
|
+
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",
|
|
6179
|
+
children: [
|
|
6180
|
+
displayedChains.map((chain) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6181
|
+
ListItem,
|
|
6182
|
+
{
|
|
6183
|
+
className: "w-full flex-shrink-0",
|
|
6184
|
+
onClick: () => onChainClick(chain.chainId),
|
|
6185
|
+
"data-testid": `choose-network-item-${chain.chainId}`,
|
|
6186
|
+
"data-chain-id": chain.chainId,
|
|
6187
|
+
children: [
|
|
6188
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6189
|
+
"img",
|
|
6190
|
+
{
|
|
6191
|
+
src: chain.imageUrl,
|
|
6192
|
+
alt: chain.name,
|
|
6193
|
+
className: "w-10 h-10 rounded-[var(--deframe-widget-size-radius-full)]"
|
|
6194
|
+
}
|
|
6195
|
+
) }),
|
|
6196
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemContent, { children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { children: chain.name }) })
|
|
6197
|
+
]
|
|
6198
|
+
},
|
|
6199
|
+
`chain-${chain.chainId}`
|
|
6200
|
+
)),
|
|
6201
|
+
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 }) })
|
|
6202
|
+
]
|
|
6203
|
+
}
|
|
6204
|
+
)
|
|
6205
|
+
] }) });
|
|
6206
|
+
};
|
|
6207
|
+
function useIsMobile(breakpoint = 640) {
|
|
6208
|
+
const [isMobile, setIsMobile] = React6.useState(
|
|
6209
|
+
typeof window !== "undefined" ? window.innerWidth < breakpoint : false
|
|
6210
|
+
);
|
|
6211
|
+
React6.useEffect(() => {
|
|
6212
|
+
const check = () => setIsMobile(window.innerWidth < breakpoint);
|
|
6213
|
+
check();
|
|
6214
|
+
window.addEventListener("resize", check);
|
|
6215
|
+
return () => window.removeEventListener("resize", check);
|
|
6216
|
+
}, [breakpoint]);
|
|
6217
|
+
return isMobile;
|
|
6218
|
+
}
|
|
6219
|
+
function CloseButtonInline({ onClick, ariaLabel }) {
|
|
6220
|
+
const baseClasses = [
|
|
6221
|
+
"inline-flex items-center justify-center",
|
|
6222
|
+
"w-9 h-9",
|
|
6223
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6224
|
+
"border-none",
|
|
6225
|
+
"cursor-pointer",
|
|
6226
|
+
"bg-transparent",
|
|
6227
|
+
"hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-tertiary)_92%,transparent)]",
|
|
6228
|
+
"transition-[background] duration-150",
|
|
6229
|
+
"flex-shrink-0",
|
|
6230
|
+
"outline-none",
|
|
6231
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]"
|
|
6232
|
+
].join(" ");
|
|
6233
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6234
|
+
"button",
|
|
6235
|
+
{
|
|
6236
|
+
"data-test-id": "close-button",
|
|
6237
|
+
onClick,
|
|
6238
|
+
"aria-label": ariaLabel,
|
|
6239
|
+
className: baseClasses,
|
|
6240
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6241
|
+
"svg",
|
|
6242
|
+
{
|
|
6243
|
+
"data-test-id": "close-button-icon",
|
|
6244
|
+
viewBox: "0 0 24 24",
|
|
6245
|
+
width: "20",
|
|
6246
|
+
height: "20",
|
|
6247
|
+
fill: "currentColor",
|
|
6248
|
+
"aria-hidden": "true",
|
|
6249
|
+
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" })
|
|
6250
|
+
}
|
|
6251
|
+
)
|
|
6252
|
+
}
|
|
6253
|
+
);
|
|
6254
|
+
}
|
|
6255
|
+
function IconCircle2({ iconUrl, name, size = 36, className }) {
|
|
6256
|
+
const [imgError, setImgError] = React6__namespace.useState(false);
|
|
6257
|
+
if (iconUrl && !imgError) {
|
|
6258
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6259
|
+
"img",
|
|
6260
|
+
{
|
|
6261
|
+
"data-test-id": "icon-circle-img",
|
|
6262
|
+
src: iconUrl,
|
|
6263
|
+
alt: name,
|
|
6264
|
+
width: size,
|
|
6265
|
+
height: size,
|
|
6266
|
+
className: tailwindMerge.twMerge("rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 object-cover", className),
|
|
6267
|
+
onError: () => setImgError(true)
|
|
6268
|
+
}
|
|
6269
|
+
);
|
|
6270
|
+
}
|
|
6271
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6272
|
+
"div",
|
|
6273
|
+
{
|
|
6274
|
+
"data-test-id": "icon-circle-fallback",
|
|
6275
|
+
className: tailwindMerge.twMerge(
|
|
6276
|
+
"rounded-[var(--deframe-widget-size-radius-full)] flex-shrink-0 flex items-center justify-center",
|
|
6277
|
+
"[font-weight:var(--deframe-widget-font-weight-bold)] text-[color:var(--deframe-widget-color-text-primary-dark)]",
|
|
6278
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
6279
|
+
className
|
|
6280
|
+
),
|
|
6281
|
+
style: {
|
|
6282
|
+
width: size,
|
|
6283
|
+
height: size,
|
|
6284
|
+
fontSize: size * 0.33,
|
|
6285
|
+
letterSpacing: "-0.01em"
|
|
6286
|
+
},
|
|
6287
|
+
children: name.slice(0, 2).toUpperCase()
|
|
6288
|
+
}
|
|
6289
|
+
);
|
|
6290
|
+
}
|
|
6291
|
+
|
|
6292
|
+
// src/stories/choose-network-and-asset-view/ChooseNetworkAndAssetViewSimple/hasSignificantBalance.ts
|
|
6293
|
+
function hasSignificantBalance(balanceUsd) {
|
|
6294
|
+
if (!balanceUsd) return false;
|
|
6295
|
+
const num = parseFloat(balanceUsd.replace(/[^0-9.-]/g, ""));
|
|
6296
|
+
return !isNaN(num) && num >= 0.01;
|
|
6297
|
+
}
|
|
6298
|
+
function NetworkRow({ network, selected, onClick, onKeyDown, index }) {
|
|
6299
|
+
const baseClasses = [
|
|
6300
|
+
"relative flex items-center gap-[10px]",
|
|
6301
|
+
"py-[9px] px-[var(--deframe-widget-size-padding-x-sm)] pl-[14px]",
|
|
6302
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6303
|
+
"cursor-pointer",
|
|
6304
|
+
"outline-none",
|
|
6305
|
+
"mb-[var(--deframe-widget-size-gap-none)].5",
|
|
6306
|
+
"transition-[background] duration-150"
|
|
6307
|
+
].join(" ");
|
|
6308
|
+
const stateClasses = {
|
|
6309
|
+
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)]",
|
|
6310
|
+
default: "bg-transparent hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-secondary)_72%,transparent)]"
|
|
6311
|
+
};
|
|
6312
|
+
const rowClasses = tailwindMerge.twMerge(baseClasses, stateClasses[selected ? "selected" : "default"]);
|
|
6313
|
+
const nameClasses = [
|
|
6314
|
+
"text-[14px] [font-weight:var(--deframe-widget-font-weight-medium)]",
|
|
6315
|
+
selected ? "text-[color:var(--deframe-widget-color-text-primary)]" : "text-[color:var(--deframe-widget-color-text-secondary)]"
|
|
6316
|
+
].join(" ");
|
|
6317
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6318
|
+
framerMotion.motion.div,
|
|
6319
|
+
{
|
|
6320
|
+
"data-test-id": "network-row",
|
|
6321
|
+
role: "option",
|
|
6322
|
+
"aria-selected": selected,
|
|
6323
|
+
"aria-label": network.name,
|
|
6324
|
+
tabIndex: 0,
|
|
6325
|
+
onClick,
|
|
6326
|
+
onKeyDown,
|
|
6327
|
+
"data-chain-index": index,
|
|
6328
|
+
className: rowClasses,
|
|
6329
|
+
children: [
|
|
6330
|
+
selected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6331
|
+
framerMotion.motion.div,
|
|
6332
|
+
{
|
|
6333
|
+
"data-test-id": "network-row-accent",
|
|
6334
|
+
layoutId: "chain-accent",
|
|
6335
|
+
className: "absolute left-0 top-2 bottom-2 w-[3px] rounded-[var(--deframe-widget-size-radius-xs)] bg-[var(--deframe-widget-color-brand-primary)]",
|
|
6336
|
+
transition: { type: "spring", stiffness: 400, damping: 30 }
|
|
6337
|
+
}
|
|
6338
|
+
),
|
|
6339
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6340
|
+
IconCircle2,
|
|
6341
|
+
{
|
|
6342
|
+
iconUrl: network.iconUrl,
|
|
6343
|
+
name: network.name,
|
|
6344
|
+
size: 34
|
|
6345
|
+
}
|
|
6346
|
+
),
|
|
6347
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6348
|
+
"div",
|
|
6349
|
+
{
|
|
6350
|
+
"data-test-id": "network-row-content",
|
|
6351
|
+
className: "flex-1 min-w-0",
|
|
6352
|
+
children: [
|
|
6353
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6354
|
+
"div",
|
|
6355
|
+
{
|
|
6356
|
+
"data-test-id": "network-row-name",
|
|
6357
|
+
className: nameClasses,
|
|
6358
|
+
children: network.name
|
|
6359
|
+
}
|
|
6360
|
+
),
|
|
6361
|
+
hasSignificantBalance(network.balanceUsd) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6362
|
+
"div",
|
|
6363
|
+
{
|
|
6364
|
+
"data-test-id": "network-row-balance",
|
|
6365
|
+
className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)] mt-px",
|
|
6366
|
+
children: network.balanceUsd
|
|
6367
|
+
}
|
|
6368
|
+
)
|
|
6369
|
+
]
|
|
6370
|
+
}
|
|
6371
|
+
)
|
|
6372
|
+
]
|
|
6373
|
+
}
|
|
6374
|
+
);
|
|
6375
|
+
}
|
|
6376
|
+
function NetworkChip({ network, selected, onClick }) {
|
|
6377
|
+
const baseClasses = [
|
|
6378
|
+
"inline-flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
6379
|
+
"py-[var(--deframe-widget-size-padding-y-sm)] pl-[var(--deframe-widget-size-padding-x-sm)] pr-[14px]",
|
|
6380
|
+
"rounded-[var(--deframe-widget-size-radius-full)]",
|
|
6381
|
+
"cursor-pointer",
|
|
6382
|
+
"whitespace-nowrap",
|
|
6383
|
+
"transition-all duration-150",
|
|
6384
|
+
"flex-shrink-0",
|
|
6385
|
+
"outline-none",
|
|
6386
|
+
"border"
|
|
6387
|
+
].join(" ");
|
|
6388
|
+
const stateClasses = {
|
|
6389
|
+
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)]",
|
|
6390
|
+
default: "border-[color:var(--deframe-widget-color-border-secondary)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-secondary)_72%,transparent)]"
|
|
6391
|
+
};
|
|
6392
|
+
const buttonClasses = tailwindMerge.twMerge(baseClasses, stateClasses[selected ? "selected" : "default"]);
|
|
6393
|
+
const nameLabelClasses = [
|
|
6394
|
+
"text-[13px] [font-weight:var(--deframe-widget-font-weight-medium)] leading-[1.2]",
|
|
6395
|
+
selected ? "text-[color:var(--deframe-widget-color-brand-primary)]" : "text-[color:var(--deframe-widget-color-text-secondary)]"
|
|
6396
|
+
].join(" ");
|
|
6397
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6398
|
+
"button",
|
|
6399
|
+
{
|
|
6400
|
+
"data-test-id": "network-chip",
|
|
6401
|
+
onClick,
|
|
6402
|
+
"aria-label": network.name,
|
|
6403
|
+
className: buttonClasses,
|
|
6404
|
+
children: [
|
|
6405
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6406
|
+
IconCircle2,
|
|
6407
|
+
{
|
|
6408
|
+
iconUrl: network.iconUrl,
|
|
6409
|
+
name: network.name,
|
|
6410
|
+
size: 24
|
|
6411
|
+
}
|
|
6412
|
+
),
|
|
6413
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6414
|
+
"div",
|
|
6415
|
+
{
|
|
6416
|
+
"data-test-id": "network-chip-content",
|
|
6417
|
+
className: "text-left",
|
|
6418
|
+
children: [
|
|
6419
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6420
|
+
"div",
|
|
6421
|
+
{
|
|
6422
|
+
"data-test-id": "network-chip-label",
|
|
6423
|
+
className: nameLabelClasses,
|
|
6424
|
+
children: network.name
|
|
6425
|
+
}
|
|
6426
|
+
),
|
|
6427
|
+
hasSignificantBalance(network.balanceUsd) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6428
|
+
"div",
|
|
6429
|
+
{
|
|
6430
|
+
"data-test-id": "network-chip-balance",
|
|
6431
|
+
className: "text-[11px] text-[color:var(--deframe-widget-color-text-tertiary)] leading-[1.4]",
|
|
6432
|
+
children: network.balanceUsd
|
|
6433
|
+
}
|
|
6434
|
+
)
|
|
6435
|
+
]
|
|
6436
|
+
}
|
|
6437
|
+
)
|
|
6438
|
+
]
|
|
6439
|
+
}
|
|
6440
|
+
);
|
|
6441
|
+
}
|
|
6442
|
+
var SearchInputInline = React6__namespace.forwardRef(
|
|
6443
|
+
({ value, onChange, placeholder, onArrowDown, autoFocus }, ref) => {
|
|
6444
|
+
const inputClasses = [
|
|
6445
|
+
"w-full box-border h-10",
|
|
6446
|
+
"bg-[var(--deframe-widget-color-bg-tertiary)]",
|
|
6447
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
6448
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6449
|
+
"py-[var(--deframe-widget-size-padding-y-none)] pr-[var(--deframe-widget-size-padding-x-xl)] pl-[14px]",
|
|
6450
|
+
"text-[14px] text-[color:var(--deframe-widget-color-text-primary)]",
|
|
6451
|
+
"outline-none focus:outline-none",
|
|
6452
|
+
"focus:border-[color:var(--deframe-widget-color-brand-primary)]",
|
|
6453
|
+
"transition-colors duration-150",
|
|
6454
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
6455
|
+
"placeholder:text-[color:var(--deframe-widget-color-text-tertiary)]"
|
|
6456
|
+
].join(" ");
|
|
6457
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6458
|
+
"div",
|
|
6459
|
+
{
|
|
6460
|
+
"data-test-id": "search-input-wrapper",
|
|
6461
|
+
className: "relative",
|
|
6462
|
+
children: [
|
|
6463
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6464
|
+
"input",
|
|
6465
|
+
{
|
|
6466
|
+
"data-test-id": "search-input",
|
|
6467
|
+
ref,
|
|
6468
|
+
type: "text",
|
|
6469
|
+
value,
|
|
6470
|
+
onChange: (e) => onChange(e.target.value),
|
|
6471
|
+
placeholder,
|
|
6472
|
+
"aria-label": placeholder,
|
|
6473
|
+
autoFocus,
|
|
6474
|
+
onKeyDown: (e) => {
|
|
6475
|
+
if (e.key === "ArrowDown") {
|
|
6476
|
+
e.preventDefault();
|
|
6477
|
+
onArrowDown == null ? void 0 : onArrowDown();
|
|
6478
|
+
}
|
|
6479
|
+
},
|
|
6480
|
+
className: inputClasses
|
|
6481
|
+
}
|
|
6482
|
+
),
|
|
6483
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6484
|
+
"div",
|
|
6485
|
+
{
|
|
6486
|
+
"data-test-id": "search-input-icon",
|
|
6487
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
6488
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6489
|
+
"svg",
|
|
6490
|
+
{
|
|
6491
|
+
width: "15",
|
|
6492
|
+
height: "15",
|
|
6493
|
+
viewBox: "0 0 24 24",
|
|
6494
|
+
fill: "none",
|
|
6495
|
+
stroke: "currentColor",
|
|
6496
|
+
strokeWidth: "2",
|
|
6497
|
+
strokeLinecap: "round",
|
|
6498
|
+
"aria-hidden": "true",
|
|
6499
|
+
children: [
|
|
6500
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
6501
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
6502
|
+
]
|
|
6503
|
+
}
|
|
6504
|
+
)
|
|
6505
|
+
}
|
|
6506
|
+
)
|
|
6507
|
+
]
|
|
6508
|
+
}
|
|
6509
|
+
);
|
|
6510
|
+
}
|
|
6511
|
+
);
|
|
6512
|
+
SearchInputInline.displayName = "SearchInputInline";
|
|
6513
|
+
function AssetRowInline({
|
|
6514
|
+
token,
|
|
6515
|
+
balance,
|
|
6516
|
+
formatTokenAmount,
|
|
6517
|
+
formatCurrencyValue,
|
|
6518
|
+
onClick,
|
|
6519
|
+
onKeyDown,
|
|
6520
|
+
index
|
|
6521
|
+
}) {
|
|
6522
|
+
var _a;
|
|
6523
|
+
const hasBalance = !!balance && parseFloat(balance.amountInUSD) >= 0.01;
|
|
6524
|
+
const formattedAmount = balance ? formatTokenAmount(balance.amountUI, (_a = token.priceInUSD) != null ? _a : 0, token.decimals) : void 0;
|
|
6525
|
+
const formattedUsd = balance ? formatCurrencyValue(parseFloat(balance.amountInUSD)) : void 0;
|
|
6526
|
+
const baseClasses = [
|
|
6527
|
+
"group",
|
|
6528
|
+
"relative flex items-center gap-[var(--deframe-widget-size-gap-sm)]",
|
|
6529
|
+
"py-[10px] px-[14px]",
|
|
6530
|
+
"rounded-[var(--deframe-widget-size-radius-sm)]",
|
|
6531
|
+
"cursor-pointer outline-none",
|
|
6532
|
+
"transition-[background] duration-150"
|
|
6533
|
+
].join(" ");
|
|
6534
|
+
const rowClasses = tailwindMerge.twMerge(baseClasses, "bg-transparent hover:bg-[color:color-mix(in_srgb,var(--deframe-widget-color-bg-secondary)_72%,transparent)]");
|
|
6535
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6536
|
+
"div",
|
|
6537
|
+
{
|
|
6538
|
+
"data-test-id": "asset-row",
|
|
6539
|
+
role: "option",
|
|
6540
|
+
"aria-selected": false,
|
|
6541
|
+
"aria-label": `${token.name} ${token.symbol}`,
|
|
6542
|
+
tabIndex: 0,
|
|
6543
|
+
onClick,
|
|
6544
|
+
onKeyDown,
|
|
6545
|
+
"data-asset-index": index,
|
|
6546
|
+
className: rowClasses,
|
|
6547
|
+
children: [
|
|
6548
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6549
|
+
IconCircle2,
|
|
6550
|
+
{
|
|
6551
|
+
iconUrl: token.logoURI,
|
|
6552
|
+
name: token.name,
|
|
6553
|
+
size: 38
|
|
6554
|
+
}
|
|
6555
|
+
),
|
|
6556
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6557
|
+
"div",
|
|
6558
|
+
{
|
|
6559
|
+
"data-test-id": "asset-row-content",
|
|
6560
|
+
className: "flex-1 min-w-0",
|
|
6561
|
+
children: [
|
|
6562
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6563
|
+
"div",
|
|
6564
|
+
{
|
|
6565
|
+
"data-test-id": "asset-row-symbol",
|
|
6566
|
+
className: "text-[14px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-primary)]",
|
|
6567
|
+
children: token.symbol
|
|
6568
|
+
}
|
|
6569
|
+
),
|
|
6570
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6571
|
+
"div",
|
|
6572
|
+
{
|
|
6573
|
+
"data-test-id": "asset-row-name",
|
|
6574
|
+
className: "text-[13px] text-[color:var(--deframe-widget-color-text-secondary)] mt-px",
|
|
6575
|
+
children: token.name
|
|
6576
|
+
}
|
|
6577
|
+
)
|
|
6578
|
+
]
|
|
6579
|
+
}
|
|
6580
|
+
),
|
|
6581
|
+
hasBalance ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6582
|
+
"div",
|
|
6583
|
+
{
|
|
6584
|
+
"data-test-id": "asset-row-balance",
|
|
6585
|
+
className: "flex-shrink-0 text-right",
|
|
6586
|
+
children: [
|
|
6587
|
+
formattedAmount && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6588
|
+
"div",
|
|
6589
|
+
{
|
|
6590
|
+
"data-test-id": "asset-row-balance-amount",
|
|
6591
|
+
className: "text-[13px] [font-weight:var(--deframe-widget-font-weight-medium)] text-[color:var(--deframe-widget-color-text-primary)]",
|
|
6592
|
+
children: [
|
|
6593
|
+
formattedAmount,
|
|
6594
|
+
" ",
|
|
6595
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6596
|
+
"span",
|
|
6597
|
+
{
|
|
6598
|
+
"data-test-id": "asset-row-balance-symbol",
|
|
6599
|
+
className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)] [font-weight:var(--deframe-widget-font-weight-regular)]",
|
|
6600
|
+
children: token.symbol
|
|
6601
|
+
}
|
|
6602
|
+
)
|
|
6603
|
+
]
|
|
6604
|
+
}
|
|
6605
|
+
),
|
|
6606
|
+
formattedUsd && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6607
|
+
"div",
|
|
6608
|
+
{
|
|
6609
|
+
"data-test-id": "asset-row-balance-usd",
|
|
6610
|
+
className: "text-[12px] text-[color:var(--deframe-widget-color-text-secondary)] mt-[var(--deframe-widget-size-gap-none)].5",
|
|
6611
|
+
children: formattedUsd
|
|
6612
|
+
}
|
|
6613
|
+
)
|
|
6614
|
+
]
|
|
6615
|
+
}
|
|
6616
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
6617
|
+
]
|
|
6618
|
+
}
|
|
6619
|
+
);
|
|
6620
|
+
}
|
|
6621
|
+
function TokensLoadingState({ label }) {
|
|
6622
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6623
|
+
"div",
|
|
6624
|
+
{
|
|
6625
|
+
"data-test-id": "tokens-loading-state",
|
|
6626
|
+
className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)] px-[14px] py-[var(--deframe-widget-size-padding-y-sm)]",
|
|
6627
|
+
children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6628
|
+
"div",
|
|
4561
6629
|
{
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
6630
|
+
"data-test-id": `tokens-loading-skeleton-${i}`,
|
|
6631
|
+
className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)] animate-pulse",
|
|
6632
|
+
children: [
|
|
6633
|
+
/* @__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" }),
|
|
6634
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0 flex flex-col gap-[6px]", children: [
|
|
6635
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[14px] w-[60%] rounded-[var(--deframe-widget-size-radius-xs)] bg-[var(--deframe-widget-color-bg-tertiary)]" }),
|
|
6636
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[12px] w-[40%] rounded-[var(--deframe-widget-size-radius-xs)] bg-[var(--deframe-widget-color-bg-tertiary)]" })
|
|
6637
|
+
] }),
|
|
6638
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0 flex flex-col items-end gap-[6px]", children: [
|
|
6639
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[13px] w-[50px] rounded-[var(--deframe-widget-size-radius-xs)] bg-[var(--deframe-widget-color-bg-tertiary)]" }),
|
|
6640
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[12px] w-[36px] rounded-[var(--deframe-widget-size-radius-xs)] bg-[var(--deframe-widget-color-bg-tertiary)]" })
|
|
6641
|
+
] })
|
|
6642
|
+
]
|
|
6643
|
+
},
|
|
6644
|
+
i
|
|
6645
|
+
))
|
|
6646
|
+
}
|
|
6647
|
+
);
|
|
6648
|
+
}
|
|
6649
|
+
function AssetSearchAndList({
|
|
6650
|
+
query,
|
|
6651
|
+
setQuery,
|
|
6652
|
+
searchRef,
|
|
6653
|
+
assetListRef,
|
|
6654
|
+
displayedTokens,
|
|
6655
|
+
findBalance,
|
|
6656
|
+
formatTokenAmount,
|
|
6657
|
+
formatCurrencyValue,
|
|
6658
|
+
isMobile,
|
|
6659
|
+
onAssetClick,
|
|
6660
|
+
handleAssetKeyDown,
|
|
6661
|
+
isFetching,
|
|
6662
|
+
hasMore,
|
|
6663
|
+
onLoadMore,
|
|
6664
|
+
labels,
|
|
6665
|
+
autoFocus
|
|
6666
|
+
}) {
|
|
6667
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6668
|
+
"div",
|
|
6669
|
+
{
|
|
6670
|
+
"data-test-id": "search-and-assets",
|
|
6671
|
+
className: "flex flex-col flex-1 overflow-hidden",
|
|
6672
|
+
children: [
|
|
6673
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6674
|
+
"div",
|
|
6675
|
+
{
|
|
6676
|
+
"data-test-id": "search-wrapper",
|
|
6677
|
+
className: tailwindMerge.twMerge(
|
|
6678
|
+
"px-[var(--deframe-widget-size-padding-x-md)] pb-[var(--deframe-widget-size-padding-y-sm)] flex-shrink-0",
|
|
6679
|
+
isMobile ? "pt-[var(--deframe-widget-size-padding-y-none)]" : "pt-[var(--deframe-widget-size-padding-y-sm)]"
|
|
6680
|
+
),
|
|
6681
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6682
|
+
SearchInputInline,
|
|
6683
|
+
{
|
|
6684
|
+
ref: searchRef,
|
|
6685
|
+
value: query,
|
|
6686
|
+
onChange: setQuery,
|
|
6687
|
+
placeholder: labels.searchPlaceholder,
|
|
6688
|
+
autoFocus,
|
|
6689
|
+
onArrowDown: () => {
|
|
6690
|
+
var _a, _b;
|
|
6691
|
+
(_b = (_a = assetListRef.current) == null ? void 0 : _a.querySelector("[data-asset-index='0']")) == null ? void 0 : _b.focus();
|
|
6692
|
+
}
|
|
6693
|
+
}
|
|
6694
|
+
)
|
|
6695
|
+
}
|
|
6696
|
+
),
|
|
6697
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6698
|
+
"div",
|
|
6699
|
+
{
|
|
6700
|
+
"data-test-id": "section-label",
|
|
6701
|
+
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",
|
|
6702
|
+
children: labels.assetsLabel
|
|
6703
|
+
}
|
|
6704
|
+
),
|
|
6705
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6706
|
+
"div",
|
|
6707
|
+
{
|
|
6708
|
+
ref: assetListRef,
|
|
6709
|
+
role: "listbox",
|
|
6710
|
+
"aria-label": labels.assetsLabel,
|
|
6711
|
+
"data-test-id": "asset-list",
|
|
6712
|
+
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)]",
|
|
6713
|
+
children: isFetching ? /* @__PURE__ */ jsxRuntime.jsx(TokensLoadingState, { label: labels.searchingText }) : displayedTokens.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6714
|
+
"div",
|
|
6715
|
+
{
|
|
6716
|
+
"data-test-id": "no-results",
|
|
6717
|
+
className: "py-[var(--deframe-widget-size-padding-y-xl)] px-[var(--deframe-widget-size-padding-x-md)] text-center",
|
|
6718
|
+
children: [
|
|
6719
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6720
|
+
"div",
|
|
6721
|
+
{
|
|
6722
|
+
"data-test-id": "no-results-title",
|
|
6723
|
+
className: "text-[14px] text-[color:var(--deframe-widget-color-text-secondary)] mb-[var(--deframe-widget-size-gap-xs)]",
|
|
6724
|
+
children: labels.searchEmptyTitle
|
|
6725
|
+
}
|
|
6726
|
+
),
|
|
6727
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6728
|
+
"div",
|
|
6729
|
+
{
|
|
6730
|
+
"data-test-id": "no-results-description",
|
|
6731
|
+
className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
6732
|
+
children: labels.searchEmptyDescription
|
|
6733
|
+
}
|
|
6734
|
+
)
|
|
6735
|
+
]
|
|
6736
|
+
}
|
|
6737
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6738
|
+
displayedTokens.map((token, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6739
|
+
AssetRowInline,
|
|
6740
|
+
{
|
|
6741
|
+
token,
|
|
6742
|
+
balance: findBalance(token),
|
|
6743
|
+
formatTokenAmount,
|
|
6744
|
+
formatCurrencyValue,
|
|
6745
|
+
onClick: () => onAssetClick(token),
|
|
6746
|
+
onKeyDown: (e) => handleAssetKeyDown(e, token, i),
|
|
6747
|
+
index: i
|
|
6748
|
+
},
|
|
6749
|
+
`${token.chainId}-${token.address}-${i}`
|
|
6750
|
+
)),
|
|
6751
|
+
hasMore && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6752
|
+
"div",
|
|
6753
|
+
{
|
|
6754
|
+
"data-test-id": "load-more-wrapper",
|
|
6755
|
+
className: "flex justify-center py-[var(--deframe-widget-size-padding-y-sm)]",
|
|
6756
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6757
|
+
"button",
|
|
6758
|
+
{
|
|
6759
|
+
"data-test-id": "load-more-button",
|
|
6760
|
+
"aria-label": labels.loadMoreButton,
|
|
6761
|
+
onClick: onLoadMore,
|
|
6762
|
+
className: [
|
|
6763
|
+
"text-[13px] [font-weight:var(--deframe-widget-font-weight-medium)]",
|
|
6764
|
+
"text-[color:var(--deframe-widget-color-brand-primary)]",
|
|
6765
|
+
"bg-transparent border-none cursor-pointer outline-none",
|
|
6766
|
+
"hover:underline",
|
|
6767
|
+
"font-[var(--deframe-widget-font-family)]"
|
|
6768
|
+
].join(" "),
|
|
6769
|
+
children: labels.loadMoreButton
|
|
6770
|
+
}
|
|
6771
|
+
)
|
|
6772
|
+
}
|
|
6773
|
+
)
|
|
6774
|
+
] })
|
|
6775
|
+
}
|
|
6776
|
+
)
|
|
6777
|
+
]
|
|
6778
|
+
}
|
|
6779
|
+
);
|
|
6780
|
+
}
|
|
6781
|
+
function ChooseNetworkAndAssetViewSimple({
|
|
6782
|
+
isOpen,
|
|
6783
|
+
onClose,
|
|
6784
|
+
networks,
|
|
6785
|
+
selectedNetwork,
|
|
6786
|
+
onNetworkSelect,
|
|
6787
|
+
displayedTokens,
|
|
6788
|
+
findBalance,
|
|
6789
|
+
formatTokenAmount,
|
|
6790
|
+
formatCurrencyValue,
|
|
6791
|
+
onAssetClick,
|
|
6792
|
+
onSearch,
|
|
6793
|
+
autoFocus,
|
|
6794
|
+
hasMore,
|
|
6795
|
+
onLoadMore,
|
|
6796
|
+
isFetching,
|
|
6797
|
+
labels
|
|
6798
|
+
}) {
|
|
6799
|
+
var _a;
|
|
6800
|
+
const [query, setQuery] = React6__namespace.useState("");
|
|
6801
|
+
const searchRef = React6__namespace.useRef(null);
|
|
6802
|
+
const chainListRef = React6__namespace.useRef(null);
|
|
6803
|
+
const assetListRef = React6__namespace.useRef(null);
|
|
6804
|
+
const isMobile = useIsMobile();
|
|
6805
|
+
const activeNetwork = (_a = selectedNetwork != null ? selectedNetwork : networks[0]) != null ? _a : null;
|
|
6806
|
+
const handleQueryChange = React6__namespace.useCallback((q) => {
|
|
6807
|
+
setQuery(q);
|
|
6808
|
+
onSearch(q);
|
|
6809
|
+
}, [onSearch]);
|
|
6810
|
+
const handleNetworkSelect = React6__namespace.useCallback((network) => {
|
|
6811
|
+
var _a2;
|
|
6812
|
+
setQuery("");
|
|
6813
|
+
onSearch("");
|
|
6814
|
+
onNetworkSelect(network);
|
|
6815
|
+
(_a2 = searchRef.current) == null ? void 0 : _a2.focus();
|
|
6816
|
+
}, [onSearch, onNetworkSelect]);
|
|
6817
|
+
React6__namespace.useEffect(() => {
|
|
6818
|
+
if (!isOpen) return;
|
|
6819
|
+
const onKey = (e) => {
|
|
6820
|
+
if (e.key === "Escape") onClose();
|
|
6821
|
+
};
|
|
6822
|
+
window.addEventListener("keydown", onKey);
|
|
6823
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
6824
|
+
}, [isOpen, onClose]);
|
|
6825
|
+
React6__namespace.useEffect(() => {
|
|
6826
|
+
if (isOpen && autoFocus) {
|
|
6827
|
+
const id = requestAnimationFrame(() => {
|
|
6828
|
+
var _a2;
|
|
6829
|
+
return (_a2 = searchRef.current) == null ? void 0 : _a2.focus();
|
|
6830
|
+
});
|
|
6831
|
+
return () => cancelAnimationFrame(id);
|
|
6832
|
+
}
|
|
6833
|
+
}, [isOpen, autoFocus]);
|
|
6834
|
+
const handleChainKeyDown = React6__namespace.useCallback((e, network, idx) => {
|
|
6835
|
+
var _a2, _b, _c, _d;
|
|
6836
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
6837
|
+
e.preventDefault();
|
|
6838
|
+
handleNetworkSelect(network);
|
|
6839
|
+
}
|
|
6840
|
+
if (e.key === "ArrowDown") {
|
|
6841
|
+
e.preventDefault();
|
|
6842
|
+
(_b = (_a2 = chainListRef.current) == null ? void 0 : _a2.querySelector(`[data-chain-index="${idx + 1}"]`)) == null ? void 0 : _b.focus();
|
|
6843
|
+
}
|
|
6844
|
+
if (e.key === "ArrowUp") {
|
|
6845
|
+
e.preventDefault();
|
|
6846
|
+
(_d = (_c = chainListRef.current) == null ? void 0 : _c.querySelector(`[data-chain-index="${idx - 1}"]`)) == null ? void 0 : _d.focus();
|
|
6847
|
+
}
|
|
6848
|
+
}, [handleNetworkSelect]);
|
|
6849
|
+
const handleAssetKeyDown = React6__namespace.useCallback((e, token, idx) => {
|
|
6850
|
+
var _a2, _b, _c, _d, _e;
|
|
6851
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
6852
|
+
e.preventDefault();
|
|
6853
|
+
onAssetClick(token);
|
|
6854
|
+
}
|
|
6855
|
+
if (e.key === "ArrowDown") {
|
|
6856
|
+
e.preventDefault();
|
|
6857
|
+
(_b = (_a2 = assetListRef.current) == null ? void 0 : _a2.querySelector(`[data-asset-index="${idx + 1}"]`)) == null ? void 0 : _b.focus();
|
|
6858
|
+
}
|
|
6859
|
+
if (e.key === "ArrowUp") {
|
|
6860
|
+
e.preventDefault();
|
|
6861
|
+
if (idx === 0) {
|
|
6862
|
+
(_c = searchRef.current) == null ? void 0 : _c.focus();
|
|
6863
|
+
return;
|
|
6864
|
+
}
|
|
6865
|
+
(_e = (_d = assetListRef.current) == null ? void 0 : _d.querySelector(`[data-asset-index="${idx - 1}"]`)) == null ? void 0 : _e.focus();
|
|
6866
|
+
}
|
|
6867
|
+
}, [onAssetClick]);
|
|
6868
|
+
const content = isOpen ? renderContent() : null;
|
|
6869
|
+
return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: content });
|
|
6870
|
+
function renderContent() {
|
|
6871
|
+
const sharedSearchAssets = /* @__PURE__ */ jsxRuntime.jsx(
|
|
6872
|
+
AssetSearchAndList,
|
|
4571
6873
|
{
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
6874
|
+
query,
|
|
6875
|
+
setQuery: handleQueryChange,
|
|
6876
|
+
searchRef,
|
|
6877
|
+
assetListRef,
|
|
6878
|
+
displayedTokens,
|
|
6879
|
+
findBalance,
|
|
6880
|
+
formatTokenAmount,
|
|
6881
|
+
formatCurrencyValue,
|
|
6882
|
+
isMobile,
|
|
6883
|
+
onAssetClick,
|
|
6884
|
+
handleAssetKeyDown,
|
|
6885
|
+
isFetching,
|
|
6886
|
+
hasMore,
|
|
6887
|
+
onLoadMore,
|
|
6888
|
+
labels,
|
|
6889
|
+
autoFocus
|
|
6890
|
+
}
|
|
6891
|
+
);
|
|
6892
|
+
if (isMobile) {
|
|
6893
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6894
|
+
framerMotion.motion.div,
|
|
6895
|
+
{
|
|
6896
|
+
initial: { opacity: 0 },
|
|
6897
|
+
animate: { opacity: 1 },
|
|
6898
|
+
exit: { opacity: 0 },
|
|
6899
|
+
transition: { duration: 0.2 },
|
|
6900
|
+
onClick: onClose,
|
|
6901
|
+
"data-test-id": "backdrop",
|
|
6902
|
+
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",
|
|
6903
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6904
|
+
framerMotion.motion.div,
|
|
4577
6905
|
{
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
"
|
|
4581
|
-
"
|
|
6906
|
+
role: "dialog",
|
|
6907
|
+
"aria-modal": "true",
|
|
6908
|
+
"aria-label": labels.title,
|
|
6909
|
+
initial: { y: "100%" },
|
|
6910
|
+
animate: { y: 0 },
|
|
6911
|
+
exit: { y: "100%" },
|
|
6912
|
+
transition: { type: "spring", stiffness: 320, damping: 32, mass: 0.8 },
|
|
6913
|
+
onClick: (e) => e.stopPropagation(),
|
|
6914
|
+
"data-test-id": "sheet",
|
|
6915
|
+
className: [
|
|
6916
|
+
"bg-[var(--deframe-widget-color-bg-secondary)] flex flex-col overflow-hidden",
|
|
6917
|
+
"rounded-t-[var(--deframe-widget-size-radius-lg)]",
|
|
6918
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)] border-b-0",
|
|
6919
|
+
"shadow-[0px_4px_16px_0px_#00000066,0px_24px_80px_0px_#00000099]",
|
|
6920
|
+
"max-h-[88vh]"
|
|
6921
|
+
].join(" "),
|
|
4582
6922
|
children: [
|
|
4583
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4584
|
-
"
|
|
6923
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6924
|
+
"div",
|
|
4585
6925
|
{
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
className: "w-
|
|
6926
|
+
"data-test-id": "drag-handle",
|
|
6927
|
+
className: "flex justify-center pt-[var(--deframe-widget-size-padding-y-sm)] pb-[var(--deframe-widget-size-padding-y-xs)].5 flex-shrink-0",
|
|
6928
|
+
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
6929
|
}
|
|
4590
|
-
)
|
|
4591
|
-
/* @__PURE__ */ jsxRuntime.
|
|
6930
|
+
),
|
|
6931
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6932
|
+
"div",
|
|
6933
|
+
{
|
|
6934
|
+
"data-test-id": "sheet-header",
|
|
6935
|
+
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",
|
|
6936
|
+
children: [
|
|
6937
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6938
|
+
"span",
|
|
6939
|
+
{
|
|
6940
|
+
"data-test-id": "sheet-title",
|
|
6941
|
+
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)]",
|
|
6942
|
+
children: labels.title
|
|
6943
|
+
}
|
|
6944
|
+
),
|
|
6945
|
+
/* @__PURE__ */ jsxRuntime.jsx(CloseButtonInline, { onClick: onClose, ariaLabel: labels.closeAriaLabel })
|
|
6946
|
+
]
|
|
6947
|
+
}
|
|
6948
|
+
),
|
|
6949
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6950
|
+
"div",
|
|
6951
|
+
{
|
|
6952
|
+
"data-test-id": "network-section",
|
|
6953
|
+
className: "flex-shrink-0 pb-[var(--deframe-widget-size-padding-y-sm)].5",
|
|
6954
|
+
children: [
|
|
6955
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6956
|
+
"div",
|
|
6957
|
+
{
|
|
6958
|
+
"data-test-id": "network-section-label",
|
|
6959
|
+
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)]",
|
|
6960
|
+
children: labels.networksLabel
|
|
6961
|
+
}
|
|
6962
|
+
),
|
|
6963
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6964
|
+
"div",
|
|
6965
|
+
{
|
|
6966
|
+
ref: chainListRef,
|
|
6967
|
+
role: "listbox",
|
|
6968
|
+
"aria-label": labels.networksLabel,
|
|
6969
|
+
"data-test-id": "network-chip-list",
|
|
6970
|
+
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]",
|
|
6971
|
+
children: networks.map((network) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6972
|
+
NetworkChip,
|
|
6973
|
+
{
|
|
6974
|
+
network,
|
|
6975
|
+
selected: (activeNetwork == null ? void 0 : activeNetwork.chainId) === network.chainId,
|
|
6976
|
+
onClick: () => handleNetworkSelect(network)
|
|
6977
|
+
},
|
|
6978
|
+
network.chainId
|
|
6979
|
+
))
|
|
6980
|
+
}
|
|
6981
|
+
)
|
|
6982
|
+
]
|
|
6983
|
+
}
|
|
6984
|
+
),
|
|
6985
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6986
|
+
"div",
|
|
6987
|
+
{
|
|
6988
|
+
"data-test-id": "divider",
|
|
6989
|
+
className: "h-px bg-[var(--deframe-widget-color-border-secondary)] flex-shrink-0"
|
|
6990
|
+
}
|
|
6991
|
+
),
|
|
6992
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6993
|
+
"div",
|
|
6994
|
+
{
|
|
6995
|
+
"data-test-id": "sheet-body",
|
|
6996
|
+
className: "flex-1 flex flex-col overflow-hidden pt-[var(--deframe-widget-size-padding-y-xs)]",
|
|
6997
|
+
children: sharedSearchAssets
|
|
6998
|
+
}
|
|
6999
|
+
)
|
|
4592
7000
|
]
|
|
4593
|
-
}
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
7001
|
+
}
|
|
7002
|
+
)
|
|
7003
|
+
},
|
|
7004
|
+
"mobile"
|
|
7005
|
+
);
|
|
7006
|
+
}
|
|
7007
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7008
|
+
framerMotion.motion.div,
|
|
7009
|
+
{
|
|
7010
|
+
initial: { opacity: 0 },
|
|
7011
|
+
animate: { opacity: 1 },
|
|
7012
|
+
exit: { opacity: 0 },
|
|
7013
|
+
transition: { duration: 0.2 },
|
|
7014
|
+
onClick: onClose,
|
|
7015
|
+
"data-test-id": "backdrop",
|
|
7016
|
+
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)]",
|
|
7017
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7018
|
+
framerMotion.motion.div,
|
|
7019
|
+
{
|
|
7020
|
+
role: "dialog",
|
|
7021
|
+
"aria-modal": "true",
|
|
7022
|
+
"aria-label": labels.title,
|
|
7023
|
+
initial: { opacity: 0, scale: 0.96 },
|
|
7024
|
+
animate: { opacity: 1, scale: 1 },
|
|
7025
|
+
exit: { opacity: 0, scale: 0.96 },
|
|
7026
|
+
transition: { duration: 0.2, ease: "easeOut" },
|
|
7027
|
+
onClick: (e) => e.stopPropagation(),
|
|
7028
|
+
"data-test-id": "modal",
|
|
7029
|
+
className: [
|
|
7030
|
+
"w-[min(680px,calc(100vw-32px))]",
|
|
7031
|
+
"h-[min(620px,calc(100vh-64px))]",
|
|
7032
|
+
"bg-[var(--deframe-widget-color-bg-secondary)]",
|
|
7033
|
+
"border border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
7034
|
+
"rounded-[var(--deframe-widget-size-radius-md)]",
|
|
7035
|
+
"shadow-[0px_4px_16px_0px_#00000066,0px_24px_80px_0px_#00000099]",
|
|
7036
|
+
"flex flex-col overflow-hidden"
|
|
7037
|
+
].join(" "),
|
|
7038
|
+
children: [
|
|
7039
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7040
|
+
"div",
|
|
7041
|
+
{
|
|
7042
|
+
"data-test-id": "modal-header",
|
|
7043
|
+
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",
|
|
7044
|
+
children: [
|
|
7045
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7046
|
+
"span",
|
|
7047
|
+
{
|
|
7048
|
+
"data-test-id": "modal-title",
|
|
7049
|
+
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)]",
|
|
7050
|
+
children: labels.title
|
|
7051
|
+
}
|
|
7052
|
+
),
|
|
7053
|
+
/* @__PURE__ */ jsxRuntime.jsx(CloseButtonInline, { onClick: onClose, ariaLabel: labels.closeAriaLabel })
|
|
7054
|
+
]
|
|
7055
|
+
}
|
|
7056
|
+
),
|
|
7057
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7058
|
+
"div",
|
|
7059
|
+
{
|
|
7060
|
+
"data-test-id": "modal-body",
|
|
7061
|
+
className: "flex flex-1 overflow-hidden",
|
|
7062
|
+
children: [
|
|
7063
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7064
|
+
"div",
|
|
7065
|
+
{
|
|
7066
|
+
"data-test-id": "network-sidebar",
|
|
7067
|
+
className: [
|
|
7068
|
+
"w-[210px] flex-shrink-0",
|
|
7069
|
+
"border-r border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
7070
|
+
"bg-[#12151C]",
|
|
7071
|
+
"flex flex-col overflow-hidden"
|
|
7072
|
+
].join(" "),
|
|
7073
|
+
children: [
|
|
7074
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7075
|
+
"div",
|
|
7076
|
+
{
|
|
7077
|
+
"data-test-id": "network-sidebar-label",
|
|
7078
|
+
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",
|
|
7079
|
+
children: labels.networksLabel
|
|
7080
|
+
}
|
|
7081
|
+
),
|
|
7082
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7083
|
+
"div",
|
|
7084
|
+
{
|
|
7085
|
+
ref: chainListRef,
|
|
7086
|
+
role: "listbox",
|
|
7087
|
+
"aria-label": labels.networksLabel,
|
|
7088
|
+
"data-test-id": "network-list",
|
|
7089
|
+
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)]",
|
|
7090
|
+
children: networks.map((network, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7091
|
+
NetworkRow,
|
|
7092
|
+
{
|
|
7093
|
+
network,
|
|
7094
|
+
selected: (activeNetwork == null ? void 0 : activeNetwork.chainId) === network.chainId,
|
|
7095
|
+
onClick: () => handleNetworkSelect(network),
|
|
7096
|
+
onKeyDown: (e) => handleChainKeyDown(e, network, i),
|
|
7097
|
+
index: i
|
|
7098
|
+
},
|
|
7099
|
+
network.chainId
|
|
7100
|
+
))
|
|
7101
|
+
}
|
|
7102
|
+
)
|
|
7103
|
+
]
|
|
7104
|
+
}
|
|
7105
|
+
),
|
|
7106
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7107
|
+
"div",
|
|
7108
|
+
{
|
|
7109
|
+
"data-test-id": "asset-panel",
|
|
7110
|
+
className: "flex-1 flex flex-col overflow-hidden",
|
|
7111
|
+
children: sharedSearchAssets
|
|
7112
|
+
}
|
|
7113
|
+
)
|
|
7114
|
+
]
|
|
7115
|
+
}
|
|
7116
|
+
)
|
|
7117
|
+
]
|
|
7118
|
+
}
|
|
7119
|
+
)
|
|
7120
|
+
},
|
|
7121
|
+
"desktop"
|
|
7122
|
+
);
|
|
7123
|
+
}
|
|
7124
|
+
}
|
|
4602
7125
|
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
7126
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)] flex-1 min-w-0", children: [
|
|
4604
7127
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-xl bg-[var(--deframe-widget-color-bg-tertiary)] animate-pulse flex-shrink-0" }),
|
|
@@ -5372,7 +7895,7 @@ var DateLabel = ({ children }) => {
|
|
|
5372
7895
|
var ArrowBadge = ({ isDeposit }) => {
|
|
5373
7896
|
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
7897
|
};
|
|
5375
|
-
var
|
|
7898
|
+
var TokenIconWithBadge2 = ({ src, alt, isDeposit }) => {
|
|
5376
7899
|
const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
|
|
5377
7900
|
const fallbackSrc = `https://placehold.co/40x40?text=${fallbackText}`;
|
|
5378
7901
|
const resolvedSrc = src || fallbackSrc;
|
|
@@ -5436,7 +7959,7 @@ var HistoryListView = ({
|
|
|
5436
7959
|
containerClassName: tailwindMerge.twMerge("!rounded-xs !border-0 !min-h-[72px]", itemClassName),
|
|
5437
7960
|
children: [
|
|
5438
7961
|
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: item.isSwap ? /* @__PURE__ */ jsxRuntime.jsx(SwapIconWithBadge, { src: item.iconUrl, alt: item.iconAlt }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5439
|
-
|
|
7962
|
+
TokenIconWithBadge2,
|
|
5440
7963
|
{
|
|
5441
7964
|
src: item.iconUrl,
|
|
5442
7965
|
alt: item.iconAlt,
|
|
@@ -6450,10 +8973,12 @@ exports.BannerNotification = BannerNotification;
|
|
|
6450
8973
|
exports.ChooseANetworkView = ChooseANetworkView;
|
|
6451
8974
|
exports.ChooseAStrategyActionsheetView = ChooseAStrategyActionsheetView;
|
|
6452
8975
|
exports.ChooseAnAssetSwapView = ChooseAnAssetSwapView;
|
|
8976
|
+
exports.ChooseNetworkAndAssetViewSimple = ChooseNetworkAndAssetViewSimple;
|
|
6453
8977
|
exports.CloseButton = CloseButton_default;
|
|
6454
8978
|
exports.CollapsibleInfoRow = CollapsibleInfoRow;
|
|
6455
8979
|
exports.CollapsibleSection = CollapsibleSection;
|
|
6456
8980
|
exports.ConfirmSwapButtonView = ConfirmSwapButtonView;
|
|
8981
|
+
exports.ConfirmSwapButtonViewSimple = ConfirmSwapButtonViewSimple;
|
|
6457
8982
|
exports.ConnectWalletList = ConnectWalletList;
|
|
6458
8983
|
exports.Currency = Currency;
|
|
6459
8984
|
exports.DeframeComponentsProvider = DeframeComponentsProvider;
|
|
@@ -6535,15 +9060,19 @@ exports.SwapAdvancedSettingsView = SwapAdvancedSettingsView;
|
|
|
6535
9060
|
exports.SwapAmountInputView = SwapAmountInputView;
|
|
6536
9061
|
exports.SwapCrossChainProcessingView = SwapCrossChainProcessingView;
|
|
6537
9062
|
exports.SwapFormView = SwapFormView;
|
|
9063
|
+
exports.SwapFormViewSimple = SwapFormViewSimple;
|
|
6538
9064
|
exports.SwapFromCardView = SwapFromCardView;
|
|
9065
|
+
exports.SwapFromCardViewSimple = SwapFromCardViewSimple;
|
|
6539
9066
|
exports.SwapHistoryView = SwapHistoryView;
|
|
6540
9067
|
exports.SwapProcessingView = SwapProcessingView;
|
|
6541
9068
|
exports.SwapProcessingViewSimple = SwapProcessingViewSimple;
|
|
6542
9069
|
exports.SwapQuoteDetailsView = SwapQuoteDetailsView;
|
|
6543
9070
|
exports.SwapSignatureWarningView = SwapSignatureWarningView;
|
|
9071
|
+
exports.SwapSignatureWarningViewSimple = SwapSignatureWarningViewSimple;
|
|
6544
9072
|
exports.SwapSuccessView = SwapSuccessView;
|
|
6545
9073
|
exports.SwapSuccessViewSimple = SwapSuccessViewSimple;
|
|
6546
9074
|
exports.SwapToCardView = SwapToCardView;
|
|
9075
|
+
exports.SwapToCardViewSimple = SwapToCardViewSimple;
|
|
6547
9076
|
exports.SwapTransactionFailedView = SwapTransactionFailedView;
|
|
6548
9077
|
exports.SwapTransactionFailedViewSimple = SwapTransactionFailedViewSimple;
|
|
6549
9078
|
exports.SwapWidgetFallbackView = SwapWidgetFallbackView;
|