@deframe-sdk/components 0.1.14 → 0.1.16
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 +69 -63
- package/dist/index.d.ts +69 -63
- package/dist/index.js +402 -338
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +404 -333
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +81 -126
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -189,14 +189,14 @@ function PrimaryButton(_a) {
|
|
|
189
189
|
/** enabled state */
|
|
190
190
|
enabled: [
|
|
191
191
|
"hover:opacity-90",
|
|
192
|
-
"text-[var(--deframe-widget-color-text-
|
|
192
|
+
"text-[color:var(--deframe-widget-color-text-inverse)]",
|
|
193
193
|
"bg-[var(--deframe-widget-color-brand-primary)]",
|
|
194
194
|
"border-[color:var(--deframe-widget-color-border-primary)]",
|
|
195
195
|
"cursor-pointer"
|
|
196
196
|
].join(" "),
|
|
197
197
|
/** disabled state */
|
|
198
198
|
disabled: [
|
|
199
|
-
"text-[var(--deframe-widget-color-text-
|
|
199
|
+
"text-[color:var(--deframe-widget-color-text-inverse-disabled)]",
|
|
200
200
|
"bg-[var(--deframe-widget-color-brand-primary-disabled)]",
|
|
201
201
|
"border-[color:var(--deframe-widget-color-border-primary-disabled)]",
|
|
202
202
|
"cursor-not-allowed"
|
|
@@ -252,7 +252,7 @@ function SecondaryButton(_a) {
|
|
|
252
252
|
].join(" ");
|
|
253
253
|
const stateClasses = {
|
|
254
254
|
enabled: [
|
|
255
|
-
"text-[color:var(--deframe-widget-color-
|
|
255
|
+
"text-[color:var(--deframe-widget-color-text-secondary)]",
|
|
256
256
|
"border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
257
257
|
"hover:opacity-90",
|
|
258
258
|
"cursor-pointer"
|
|
@@ -312,7 +312,7 @@ function TertiaryButton(_a) {
|
|
|
312
312
|
].join(" ");
|
|
313
313
|
const stateClasses = {
|
|
314
314
|
enabled: [
|
|
315
|
-
"text-[color:var(--deframe-widget-color-
|
|
315
|
+
"text-[color:var(--deframe-widget-color-text-tertiary)]",
|
|
316
316
|
"hover:opacity-90",
|
|
317
317
|
"cursor-pointer"
|
|
318
318
|
].join(" "),
|
|
@@ -439,12 +439,12 @@ function Link(_a) {
|
|
|
439
439
|
].join(" ");
|
|
440
440
|
const stateClasses = {
|
|
441
441
|
enabled: [
|
|
442
|
-
"text-[color:var(--deframe-widget-color-
|
|
442
|
+
"text-[color:var(--deframe-widget-color-text-highlight)]",
|
|
443
443
|
"underline",
|
|
444
444
|
"cursor-pointer"
|
|
445
445
|
].join(" "),
|
|
446
446
|
disabled: [
|
|
447
|
-
"text-[var(--deframe-widget-color-
|
|
447
|
+
"text-[color:var(--deframe-widget-color-text-highlight-disabled)]",
|
|
448
448
|
"cursor-not-allowed",
|
|
449
449
|
"pointer-events-none"
|
|
450
450
|
].join(" ")
|
|
@@ -906,25 +906,35 @@ var Text = React6__namespace.forwardRef(
|
|
|
906
906
|
var _b = _a, {
|
|
907
907
|
children,
|
|
908
908
|
as: Component = "p",
|
|
909
|
+
disabled = false,
|
|
909
910
|
className = ""
|
|
910
911
|
} = _b, props = __objRest(_b, [
|
|
911
912
|
"children",
|
|
912
913
|
"as",
|
|
914
|
+
"disabled",
|
|
913
915
|
"className"
|
|
914
916
|
]);
|
|
915
917
|
const baseClasses = [
|
|
916
918
|
"[font-family:var(--deframe-widget-font-family)]",
|
|
917
919
|
"[font-size:var(--deframe-widget-font-size-md)]",
|
|
918
920
|
"[line-height:var(--deframe-widget-font-leading-md)]",
|
|
919
|
-
"[font-weight:var(--deframe-widget-font-weight-regular)]"
|
|
920
|
-
"text-[color:var(--deframe-widget-color-text-primary)]"
|
|
921
|
+
"[font-weight:var(--deframe-widget-font-weight-regular)]"
|
|
921
922
|
].join(" ");
|
|
922
|
-
const
|
|
923
|
+
const stateClasses = {
|
|
924
|
+
enabled: "text-[color:var(--deframe-widget-color-text-primary)]",
|
|
925
|
+
disabled: "text-[color:var(--deframe-widget-color-text-primary-disabled)]"
|
|
926
|
+
};
|
|
927
|
+
const textClasses = tailwindMerge.twMerge(
|
|
928
|
+
baseClasses,
|
|
929
|
+
stateClasses[disabled ? "disabled" : "enabled"],
|
|
930
|
+
className
|
|
931
|
+
);
|
|
923
932
|
return React6__namespace.createElement(
|
|
924
933
|
Component,
|
|
925
934
|
__spreadValues({
|
|
926
935
|
ref,
|
|
927
|
-
className: textClasses
|
|
936
|
+
className: textClasses,
|
|
937
|
+
"aria-disabled": disabled || void 0
|
|
928
938
|
}, props),
|
|
929
939
|
children
|
|
930
940
|
);
|
|
@@ -937,10 +947,12 @@ var TextAccent = React6__namespace.forwardRef(
|
|
|
937
947
|
var _b = _a, {
|
|
938
948
|
as = "span",
|
|
939
949
|
variant = "accent-medium",
|
|
950
|
+
disabled = false,
|
|
940
951
|
className = ""
|
|
941
952
|
} = _b, props = __objRest(_b, [
|
|
942
953
|
"as",
|
|
943
954
|
"variant",
|
|
955
|
+
"disabled",
|
|
944
956
|
"className"
|
|
945
957
|
]);
|
|
946
958
|
const accentVariants = {
|
|
@@ -960,8 +972,16 @@ var TextAccent = React6__namespace.forwardRef(
|
|
|
960
972
|
"[font-weight:var(--deframe-widget-font-weight-semibold)]"
|
|
961
973
|
].join(" ")
|
|
962
974
|
};
|
|
975
|
+
const stateClasses = {
|
|
976
|
+
enabled: "text-[color:var(--deframe-widget-color-text-primary)]",
|
|
977
|
+
disabled: "text-[color:var(--deframe-widget-color-text-primary-disabled)]"
|
|
978
|
+
};
|
|
963
979
|
const variantClass = accentVariants[variant];
|
|
964
|
-
const accentClasses = tailwindMerge.twMerge(
|
|
980
|
+
const accentClasses = tailwindMerge.twMerge(
|
|
981
|
+
variantClass,
|
|
982
|
+
stateClasses[disabled ? "disabled" : "enabled"],
|
|
983
|
+
className
|
|
984
|
+
);
|
|
965
985
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
966
986
|
Text_default,
|
|
967
987
|
__spreadValues({
|
|
@@ -969,7 +989,8 @@ var TextAccent = React6__namespace.forwardRef(
|
|
|
969
989
|
as,
|
|
970
990
|
className: accentClasses,
|
|
971
991
|
"data-slot": "text-accent",
|
|
972
|
-
"data-test-id": "text-accent"
|
|
992
|
+
"data-test-id": "text-accent",
|
|
993
|
+
"aria-disabled": disabled || void 0
|
|
973
994
|
}, props)
|
|
974
995
|
);
|
|
975
996
|
}
|
|
@@ -980,18 +1001,15 @@ var TextBody = React6__namespace.forwardRef(
|
|
|
980
1001
|
var _b = _a, {
|
|
981
1002
|
as = "p",
|
|
982
1003
|
variant = "text-medium",
|
|
1004
|
+
disabled = false,
|
|
983
1005
|
className = ""
|
|
984
1006
|
} = _b, props = __objRest(_b, [
|
|
985
1007
|
"as",
|
|
986
1008
|
"variant",
|
|
1009
|
+
"disabled",
|
|
987
1010
|
"className"
|
|
988
1011
|
]);
|
|
989
1012
|
const bodyVariants = {
|
|
990
|
-
"[font-size:var(--deframe-widget-font-size-lg)] [line-height:var(--deframe-widget-font-leading-lg)]": [
|
|
991
|
-
"[font-size:var(--deframe-widget-font-size-lg)]",
|
|
992
|
-
"[line-height:var(--deframe-widget-font-leading-lg)]",
|
|
993
|
-
"[font-weight:var(--deframe-widget-font-weight-regular)]"
|
|
994
|
-
].join(" "),
|
|
995
1013
|
"text-large": [
|
|
996
1014
|
"[font-size:var(--deframe-widget-font-size-lg)]",
|
|
997
1015
|
"[line-height:var(--deframe-widget-font-leading-lg)]",
|
|
@@ -1008,8 +1026,16 @@ var TextBody = React6__namespace.forwardRef(
|
|
|
1008
1026
|
"[font-weight:var(--deframe-widget-font-weight-regular)]"
|
|
1009
1027
|
].join(" ")
|
|
1010
1028
|
};
|
|
1029
|
+
const stateClasses = {
|
|
1030
|
+
enabled: "text-[color:var(--deframe-widget-color-text-primary)]",
|
|
1031
|
+
disabled: "text-[color:var(--deframe-widget-color-text-primary-disabled)]"
|
|
1032
|
+
};
|
|
1011
1033
|
const variantClass = bodyVariants[variant];
|
|
1012
|
-
const bodyClasses = tailwindMerge.twMerge(
|
|
1034
|
+
const bodyClasses = tailwindMerge.twMerge(
|
|
1035
|
+
variantClass,
|
|
1036
|
+
stateClasses[disabled ? "disabled" : "enabled"],
|
|
1037
|
+
className
|
|
1038
|
+
);
|
|
1013
1039
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1014
1040
|
Text_default,
|
|
1015
1041
|
__spreadValues({
|
|
@@ -1017,7 +1043,8 @@ var TextBody = React6__namespace.forwardRef(
|
|
|
1017
1043
|
as,
|
|
1018
1044
|
className: bodyClasses,
|
|
1019
1045
|
"data-slot": "text-body",
|
|
1020
|
-
"data-test-id": "text-body"
|
|
1046
|
+
"data-test-id": "text-body",
|
|
1047
|
+
"aria-disabled": disabled || void 0
|
|
1021
1048
|
}, props)
|
|
1022
1049
|
);
|
|
1023
1050
|
}
|
|
@@ -1028,10 +1055,12 @@ var TextHeading = React6__namespace.forwardRef(
|
|
|
1028
1055
|
var _b = _a, {
|
|
1029
1056
|
as,
|
|
1030
1057
|
variant = "h2",
|
|
1058
|
+
disabled = false,
|
|
1031
1059
|
className = ""
|
|
1032
1060
|
} = _b, props = __objRest(_b, [
|
|
1033
1061
|
"as",
|
|
1034
1062
|
"variant",
|
|
1063
|
+
"disabled",
|
|
1035
1064
|
"className"
|
|
1036
1065
|
]);
|
|
1037
1066
|
const headingVariants = {
|
|
@@ -1066,8 +1095,16 @@ var TextHeading = React6__namespace.forwardRef(
|
|
|
1066
1095
|
"[font-weight:var(--deframe-widget-font-weight-bold)]"
|
|
1067
1096
|
].join(" ")
|
|
1068
1097
|
};
|
|
1098
|
+
const stateClasses = {
|
|
1099
|
+
enabled: "text-[color:var(--deframe-widget-color-text-primary)]",
|
|
1100
|
+
disabled: "text-[color:var(--deframe-widget-color-text-primary-disabled)]"
|
|
1101
|
+
};
|
|
1069
1102
|
const variantClass = headingVariants[variant];
|
|
1070
|
-
const headingClasses = tailwindMerge.twMerge(
|
|
1103
|
+
const headingClasses = tailwindMerge.twMerge(
|
|
1104
|
+
variantClass,
|
|
1105
|
+
stateClasses[disabled ? "disabled" : "enabled"],
|
|
1106
|
+
className
|
|
1107
|
+
);
|
|
1071
1108
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1072
1109
|
Text_default,
|
|
1073
1110
|
__spreadValues({
|
|
@@ -1075,7 +1112,8 @@ var TextHeading = React6__namespace.forwardRef(
|
|
|
1075
1112
|
as: variant === "h-large" ? "h1" : variant,
|
|
1076
1113
|
className: headingClasses,
|
|
1077
1114
|
"data-slot": "text-heading",
|
|
1078
|
-
"data-test-id": "text-heading"
|
|
1115
|
+
"data-test-id": "text-heading",
|
|
1116
|
+
"aria-disabled": disabled || void 0
|
|
1079
1117
|
}, props)
|
|
1080
1118
|
);
|
|
1081
1119
|
}
|
|
@@ -1594,7 +1632,7 @@ function BannerNotificationMessage(_a) {
|
|
|
1594
1632
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1595
1633
|
TextBody,
|
|
1596
1634
|
__spreadValues({
|
|
1597
|
-
variant: "
|
|
1635
|
+
variant: "text-medium",
|
|
1598
1636
|
"data-slot": "banner-notification-message",
|
|
1599
1637
|
"data-test-id": "banner-notification-message",
|
|
1600
1638
|
className: tailwindMerge.twMerge("text-inherit", className)
|
|
@@ -1900,7 +1938,7 @@ var SummaryDetails = ({
|
|
|
1900
1938
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1901
1939
|
TextBody,
|
|
1902
1940
|
{
|
|
1903
|
-
variant: "
|
|
1941
|
+
variant: "text-small",
|
|
1904
1942
|
className: tailwindMerge.twMerge("text-[color:var(--deframe-widget-color-text-tertiary)]", item.labelClassName),
|
|
1905
1943
|
children: item.label
|
|
1906
1944
|
}
|
|
@@ -1908,7 +1946,7 @@ var SummaryDetails = ({
|
|
|
1908
1946
|
typeof item.value === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1909
1947
|
TextBody,
|
|
1910
1948
|
{
|
|
1911
|
-
variant: "
|
|
1949
|
+
variant: "text-small",
|
|
1912
1950
|
className: tailwindMerge.twMerge("text-[color:var(--deframe-widget-color-text-primary)] [font-weight:var(--deframe-widget-font-weight-medium)]", item.valueClassName),
|
|
1913
1951
|
children: item.value
|
|
1914
1952
|
}
|
|
@@ -2594,45 +2632,6 @@ var HistoryWithdrawDetailsView = ({
|
|
|
2594
2632
|
] }) })
|
|
2595
2633
|
] });
|
|
2596
2634
|
};
|
|
2597
|
-
var SwapNetworkSelectorView = ({
|
|
2598
|
-
chainLabel,
|
|
2599
|
-
chainImage,
|
|
2600
|
-
onClick,
|
|
2601
|
-
directionLabel = "De",
|
|
2602
|
-
testId = "swap-network-selector",
|
|
2603
|
-
className
|
|
2604
|
-
}) => {
|
|
2605
|
-
const baseClasses = "flex flex-row items-center gap-[var(--deframe-widget-size-gap-xs)]";
|
|
2606
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": testId, className: tailwindMerge.twMerge(baseClasses, className), children: [
|
|
2607
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", variant: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)]", className: "tracking-wide text-[color:var(--deframe-widget-color-text-tertiary)]", children: directionLabel }),
|
|
2608
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2609
|
-
"button",
|
|
2610
|
-
{
|
|
2611
|
-
"data-testid": testId,
|
|
2612
|
-
type: "button",
|
|
2613
|
-
onClick,
|
|
2614
|
-
className: "ml-[var(--deframe-widget-size-gap-lg)] bg-[var(--deframe-widget-color-bg-tertiary)] border border-[color:var(--deframe-widget-color-border-tertiary)] rounded-[var(--deframe-widget-size-radius-md)] flex items-center gap-[var(--deframe-widget-size-gap-xs)] px-[var(--deframe-widget-size-padding-x-sm)] py-[var(--deframe-widget-size-padding-y-xs)] hover:border-[color:var(--deframe-widget-color-border-secondary)] transition-colors [font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-secondary)] cursor-pointer",
|
|
2615
|
-
"aria-label": `${directionLabel} ${chainLabel}`,
|
|
2616
|
-
children: [
|
|
2617
|
-
chainImage ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: chainImage, alt: chainLabel, className: "w-3 h-3 rounded-[var(--deframe-widget-size-radius-full)]" }) : null,
|
|
2618
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: chainLabel }),
|
|
2619
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-[18px] h-[18px]", children: /* @__PURE__ */ jsxRuntime.jsx(hi2.HiChevronDown, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-tertiary)]" }) })
|
|
2620
|
-
]
|
|
2621
|
-
}
|
|
2622
|
-
)
|
|
2623
|
-
] });
|
|
2624
|
-
};
|
|
2625
|
-
var SwapQuoteHeaderView = ({
|
|
2626
|
-
label,
|
|
2627
|
-
timerElement,
|
|
2628
|
-
className
|
|
2629
|
-
}) => {
|
|
2630
|
-
const baseClasses = "border-b border-[color:var(--deframe-widget-color-border-secondary)] pb-[var(--deframe-widget-size-padding-y-sm)]";
|
|
2631
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-quote-header", className: tailwindMerge.twMerge(baseClasses, className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2632
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", variant: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)]", className: "[font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-secondary)] inline-flex items-center", children: label }),
|
|
2633
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-md)]", children: timerElement })
|
|
2634
|
-
] }) });
|
|
2635
|
-
};
|
|
2636
2635
|
var SwapAmountInputView = ({
|
|
2637
2636
|
value,
|
|
2638
2637
|
hasError,
|
|
@@ -2690,127 +2689,6 @@ var SwapAmountInputView = ({
|
|
|
2690
2689
|
})
|
|
2691
2690
|
);
|
|
2692
2691
|
};
|
|
2693
|
-
var SwapOutputAmountView = ({
|
|
2694
|
-
displayOutput,
|
|
2695
|
-
isLoading,
|
|
2696
|
-
loadingElement,
|
|
2697
|
-
searchingQuoteLabel = "Searching quote...",
|
|
2698
|
-
className
|
|
2699
|
-
}) => {
|
|
2700
|
-
const baseClasses = "[font-size:var(--deframe-widget-font-size-xxl)] [line-height:var(--deframe-widget-font-leading-xxl)] [font-weight:var(--deframe-widget-font-weight-extrabold)] text-right w-full min-w-[120px] text-[color:var(--deframe-widget-color-text-primary)]";
|
|
2701
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-flow-output-amount", className: tailwindMerge.twMerge(baseClasses, className), children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", variant: "[font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)]", className: "text-[color:var(--deframe-widget-color-text-primary-disabled)] inline-flex items-center", children: loadingElement != null ? loadingElement : searchingQuoteLabel }) : displayOutput });
|
|
2702
|
-
};
|
|
2703
|
-
var SwapQuoteErrorsView = ({
|
|
2704
|
-
hasQuoteError,
|
|
2705
|
-
hasBytecodeError,
|
|
2706
|
-
quoteErrorMessage = "Unable to get quote for this transaction",
|
|
2707
|
-
bytecodeErrorMessage = "Error building transaction"
|
|
2708
|
-
}) => {
|
|
2709
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "swap-quote-errors", children: [
|
|
2710
|
-
hasQuoteError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-sm", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2711
|
-
BannerNotification,
|
|
2712
|
-
{
|
|
2713
|
-
type: "inline",
|
|
2714
|
-
variant: "error",
|
|
2715
|
-
message: quoteErrorMessage
|
|
2716
|
-
}
|
|
2717
|
-
) }),
|
|
2718
|
-
hasBytecodeError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-sm", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2719
|
-
BannerNotification,
|
|
2720
|
-
{
|
|
2721
|
-
type: "inline",
|
|
2722
|
-
variant: "error",
|
|
2723
|
-
message: bytecodeErrorMessage
|
|
2724
|
-
}
|
|
2725
|
-
) })
|
|
2726
|
-
] });
|
|
2727
|
-
};
|
|
2728
|
-
var SLIPPAGE_OPTIONS = [10, 50, 100];
|
|
2729
|
-
var SwapSlippageToleranceButtonsView = ({
|
|
2730
|
-
slippageBps,
|
|
2731
|
-
onSelect,
|
|
2732
|
-
formatPercentage,
|
|
2733
|
-
className
|
|
2734
|
-
}) => {
|
|
2735
|
-
const baseClasses = "flex gap-[var(--deframe-widget-size-gap-xs)]";
|
|
2736
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-slippage-tolerance-buttons", className: tailwindMerge.twMerge(baseClasses, className), children: SLIPPAGE_OPTIONS.map((option) => {
|
|
2737
|
-
const isActive = slippageBps === option;
|
|
2738
|
-
const activeClasses = "border-[color:var(--deframe-widget-color-brand-primary)] text-[color:var(--deframe-widget-color-brand-primary)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_18%,transparent)]";
|
|
2739
|
-
const inactiveClasses = "border-[color:var(--deframe-widget-color-border-tertiary)] text-[color:var(--deframe-widget-color-text-secondary)] bg-[var(--deframe-widget-color-bg-primary)]";
|
|
2740
|
-
const buttonBase = "px-[var(--deframe-widget-size-padding-x-sm)] py-[var(--deframe-widget-size-padding-y-xs)] rounded-[var(--deframe-widget-size-radius-xs)] border [font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] cursor-pointer";
|
|
2741
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2742
|
-
"button",
|
|
2743
|
-
{
|
|
2744
|
-
"data-test-id": `slippage-option-${option}`,
|
|
2745
|
-
type: "button",
|
|
2746
|
-
onClick: () => onSelect(option),
|
|
2747
|
-
className: tailwindMerge.twMerge(buttonBase, isActive ? activeClasses : inactiveClasses),
|
|
2748
|
-
"aria-label": `${formatPercentage(option)}% slippage`,
|
|
2749
|
-
"aria-pressed": isActive,
|
|
2750
|
-
children: formatPercentage(option)
|
|
2751
|
-
},
|
|
2752
|
-
option
|
|
2753
|
-
);
|
|
2754
|
-
}) });
|
|
2755
|
-
};
|
|
2756
|
-
var SwapTokenSelectorView = ({
|
|
2757
|
-
token,
|
|
2758
|
-
onClick,
|
|
2759
|
-
testId = "swap-token-selector",
|
|
2760
|
-
selectTokenLabel = "Select token",
|
|
2761
|
-
className
|
|
2762
|
-
}) => {
|
|
2763
|
-
const baseClasses = "h-[56px] border border-[color:var(--deframe-widget-color-border-secondary)] rounded-[var(--deframe-widget-size-radius-xs)] overflow-hidden hover:border-[color:var(--deframe-widget-color-border-primary)] transition-colors flex items-center px-[var(--deframe-widget-size-padding-x-sm)] py-[6px] w-full cursor-pointer";
|
|
2764
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2765
|
-
"button",
|
|
2766
|
-
{
|
|
2767
|
-
"data-test-id": testId,
|
|
2768
|
-
type: "button",
|
|
2769
|
-
onClick,
|
|
2770
|
-
className: tailwindMerge.twMerge(baseClasses, className),
|
|
2771
|
-
"aria-label": token ? token.symbol : selectTokenLabel,
|
|
2772
|
-
children: [
|
|
2773
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)] flex-1", children: token ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2774
|
-
token.logoURI ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: token.logoURI, alt: token.symbol, className: "w-6 h-6 rounded-[var(--deframe-widget-size-radius-full)]" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-secondary)] text-[color:var(--deframe-widget-color-text-secondary)] flex items-center justify-center text-[10px] [font-weight:var(--deframe-widget-font-weight-semibold)]", children: (token.symbol || "").slice(0, 3).toUpperCase() }),
|
|
2775
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", className: "text-[color:var(--deframe-widget-color-text-primary)]", children: token.symbol })
|
|
2776
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: selectTokenLabel }) }),
|
|
2777
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-[18px] h-[18px]", children: /* @__PURE__ */ jsxRuntime.jsx(hi2.HiChevronDown, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-tertiary)]" }) })
|
|
2778
|
-
]
|
|
2779
|
-
}
|
|
2780
|
-
);
|
|
2781
|
-
};
|
|
2782
|
-
var SwapQuoteBlockchainCostsView = ({
|
|
2783
|
-
totalCostFormatted,
|
|
2784
|
-
feePercentage,
|
|
2785
|
-
gasCostFormatted,
|
|
2786
|
-
protocolFee,
|
|
2787
|
-
blockchainCostsLabel = "Blockchain Costs",
|
|
2788
|
-
networkGasLabel = "Network Gas",
|
|
2789
|
-
protocolFeeLabel = "Protocol Fee",
|
|
2790
|
-
collapseLabel = "Collapse",
|
|
2791
|
-
expandLabel = "Expand"
|
|
2792
|
-
}) => {
|
|
2793
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-quote-blockchain-costs", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2794
|
-
CollapsibleInfoRow,
|
|
2795
|
-
{
|
|
2796
|
-
label: blockchainCostsLabel,
|
|
2797
|
-
value: `${totalCostFormatted} ~ ${feePercentage}%`,
|
|
2798
|
-
defaultOpen: true,
|
|
2799
|
-
collapseLabel,
|
|
2800
|
-
expandLabel,
|
|
2801
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
2802
|
-
/* @__PURE__ */ jsxRuntime.jsxs(InfoRowWithIcon, { children: [
|
|
2803
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconLabel, { children: networkGasLabel }),
|
|
2804
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconValue, { children: gasCostFormatted })
|
|
2805
|
-
] }),
|
|
2806
|
-
/* @__PURE__ */ jsxRuntime.jsxs(InfoRowWithIcon, { borderBottom: true, children: [
|
|
2807
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconLabel, { children: protocolFeeLabel }),
|
|
2808
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconValue, { children: protocolFee })
|
|
2809
|
-
] })
|
|
2810
|
-
] })
|
|
2811
|
-
}
|
|
2812
|
-
) });
|
|
2813
|
-
};
|
|
2814
2692
|
var ChooseAStrategyActionsheetView = ({
|
|
2815
2693
|
isOpen,
|
|
2816
2694
|
currentActionSheetId,
|
|
@@ -2853,7 +2731,7 @@ var ChooseAStrategyActionsheetView = ({
|
|
|
2853
2731
|
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoUrl, alt: assetName, className: "w-10 h-10 rounded-[var(--deframe-widget-size-radius-full)]" }) }),
|
|
2854
2732
|
/* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { className: "gap-[var(--deframe-widget-size-gap-xs)]", children: [
|
|
2855
2733
|
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { children: resolvedYieldLabel }),
|
|
2856
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "
|
|
2734
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: Badge })
|
|
2857
2735
|
] }),
|
|
2858
2736
|
/* @__PURE__ */ jsxRuntime.jsx(ListItemRightSide, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-center items-center gap-[var(--deframe-widget-size-gap-xs)]", children: [
|
|
2859
2737
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[color:var(--deframe-widget-color-state-success)]", children: [
|
|
@@ -2879,8 +2757,16 @@ var StrategyDetailsView = ({
|
|
|
2879
2757
|
headerTitle = "Details",
|
|
2880
2758
|
strategyInfoTitle = "Strategy Info",
|
|
2881
2759
|
depositButtonLabel = "Deposit",
|
|
2882
|
-
backAriaLabel = "Back"
|
|
2760
|
+
backAriaLabel = "Back",
|
|
2761
|
+
error,
|
|
2762
|
+
notFoundMessage
|
|
2883
2763
|
}) => {
|
|
2764
|
+
if (error) {
|
|
2765
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BackgroundContainer, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-text-secondary dark:text-text-secondary-dark p-md", children: error }) });
|
|
2766
|
+
}
|
|
2767
|
+
if (notFoundMessage) {
|
|
2768
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BackgroundContainer, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-text-secondary dark:text-text-secondary-dark p-md", children: notFoundMessage }) });
|
|
2769
|
+
}
|
|
2884
2770
|
return /* @__PURE__ */ jsxRuntime.jsxs(BackgroundContainer, { children: [
|
|
2885
2771
|
/* @__PURE__ */ jsxRuntime.jsx(DetailsHeader, { title: headerTitle, onBack, backAriaLabel }),
|
|
2886
2772
|
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "strategy-details-content", className: "flex-1 min-h-0 overflow-y-auto px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)] py-[var(--deframe-widget-size-padding-y-lg)] pb-[var(--deframe-widget-size-padding-y-xxl)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[var(--deframe-widget-size-gap-lg)] min-h-full", children: [
|
|
@@ -2888,7 +2774,7 @@ var StrategyDetailsView = ({
|
|
|
2888
2774
|
/* @__PURE__ */ jsxRuntime.jsx("img", { "data-test-id": "strategy-logo", src: logoUrl, alt: title, className: "w-20 h-20 rounded-[var(--deframe-widget-size-radius-full)]" }),
|
|
2889
2775
|
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h5", children: title })
|
|
2890
2776
|
] }),
|
|
2891
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "
|
|
2777
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: description }),
|
|
2892
2778
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2893
2779
|
SummaryDetails,
|
|
2894
2780
|
{
|
|
@@ -2981,7 +2867,7 @@ var SearchEmptyState = ({
|
|
|
2981
2867
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-20 h-20 bg-[var(--deframe-widget-color-bg-tertiary)] rounded-[var(--deframe-widget-size-radius-full)] flex justify-center items-center", children: /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSearchOff, { className: "w-10 h-10 text-[color:var(--deframe-widget-color-text-tertiary)]" }) }),
|
|
2982
2868
|
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h3", children: title })
|
|
2983
2869
|
] }),
|
|
2984
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "self-stretch text-center", children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "
|
|
2870
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "self-stretch text-center", children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: description }) })
|
|
2985
2871
|
] }) });
|
|
2986
2872
|
};
|
|
2987
2873
|
var CollapsibleSection = ({
|
|
@@ -3016,7 +2902,7 @@ var CollapsibleSection = ({
|
|
|
3016
2902
|
children: [
|
|
3017
2903
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-xs)]", children: /* @__PURE__ */ jsxRuntime.jsx(TextBody, { className: "text-[color:var(--deframe-widget-color-text-primary-dark)] [font-weight:var(--deframe-widget-font-weight-medium)]", children: title }) }),
|
|
3018
2904
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-xs)]", children: [
|
|
3019
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "
|
|
2905
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: subtitle }),
|
|
3020
2906
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3021
2907
|
framerMotion.motion.svg,
|
|
3022
2908
|
{
|
|
@@ -4051,7 +3937,7 @@ var ChooseAnAssetSwapView = ({
|
|
|
4051
3937
|
] }),
|
|
4052
3938
|
searchValue && displayedTokens.length === 0 && !isFetching ? /* @__PURE__ */ jsxRuntime.jsx(SearchEmptyState, { title: labels.searchEmptyTitle, description: labels.searchEmptyDescription }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)] w-full mt-[var(--deframe-widget-size-gap-md)] overflow-y-auto flex-1 min-h-0", children: [
|
|
4053
3939
|
isFetching && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center items-center w-full py-[var(--deframe-widget-size-padding-y-md)]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-xs)]", children: [
|
|
4054
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "
|
|
3940
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: labels.searchingText }),
|
|
4055
3941
|
/* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {})
|
|
4056
3942
|
] }) }),
|
|
4057
3943
|
displayedTokens.map((token, index) => {
|
|
@@ -4071,11 +3957,11 @@ var ChooseAnAssetSwapView = ({
|
|
|
4071
3957
|
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: token.logoURI || "", alt: token.name, className: "w-10 h-10 rounded-[var(--deframe-widget-size-radius-full)]" }) }),
|
|
4072
3958
|
/* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { children: [
|
|
4073
3959
|
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { children: token.name }),
|
|
4074
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "
|
|
3960
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: token.symbol })
|
|
4075
3961
|
] }),
|
|
4076
3962
|
/* @__PURE__ */ jsxRuntime.jsxs(ListItemRightSide, { children: [
|
|
4077
3963
|
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { children: formattedBalance }),
|
|
4078
|
-
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "
|
|
3964
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", children: formatCurrencyValue(Number(balance == null ? void 0 : balance.amountInUSD) || 0) })
|
|
4079
3965
|
] })
|
|
4080
3966
|
]
|
|
4081
3967
|
},
|
|
@@ -4089,77 +3975,77 @@ var ChooseAnAssetSwapView = ({
|
|
|
4089
3975
|
}
|
|
4090
3976
|
) });
|
|
4091
3977
|
};
|
|
4092
|
-
var
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
advancedSettings,
|
|
4099
|
-
transactionDetails,
|
|
4100
|
-
confirmButton
|
|
3978
|
+
var SwapTokenSelectorView = ({
|
|
3979
|
+
token,
|
|
3980
|
+
onClick,
|
|
3981
|
+
testId = "swap-token-selector",
|
|
3982
|
+
selectTokenLabel = "Select token",
|
|
3983
|
+
className
|
|
4101
3984
|
}) => {
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
className: "flex items-center justify-center w-12 h-12 transition-colors rounded-full cursor-pointer text-text-secondary dark:text-text-secondary-dark hover:text-brand-primary",
|
|
4121
|
-
"aria-label": labels.historyAriaLabel,
|
|
4122
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(md.MdHistory, { className: "w-6 h-6" })
|
|
4123
|
-
}
|
|
4124
|
-
)
|
|
4125
|
-
] }),
|
|
4126
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-col items-stretch gap-sm", children: [
|
|
4127
|
-
fromCard,
|
|
4128
|
-
switchButton,
|
|
4129
|
-
toCard
|
|
4130
|
-
] }),
|
|
4131
|
-
advancedSettings,
|
|
4132
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-xl", children: transactionDetails })
|
|
4133
|
-
] })
|
|
4134
|
-
}
|
|
4135
|
-
),
|
|
4136
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4137
|
-
"div",
|
|
4138
|
-
{
|
|
4139
|
-
"data-testid": "swap-flow-footer",
|
|
4140
|
-
className: "border-t p-md border-border-default dark:border-border-default-dark bg-bg-primary dark:bg-bg-primary-dark",
|
|
4141
|
-
children: confirmButton
|
|
4142
|
-
}
|
|
4143
|
-
)
|
|
4144
|
-
] });
|
|
3985
|
+
const baseClasses = "h-[56px] border border-[color:var(--deframe-widget-color-border-secondary)] rounded-[var(--deframe-widget-size-radius-xs)] overflow-hidden hover:border-[color:var(--deframe-widget-color-border-primary)] transition-colors flex items-center px-[var(--deframe-widget-size-padding-x-sm)] py-[6px] w-full cursor-pointer";
|
|
3986
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3987
|
+
"button",
|
|
3988
|
+
{
|
|
3989
|
+
"data-test-id": testId,
|
|
3990
|
+
type: "button",
|
|
3991
|
+
onClick,
|
|
3992
|
+
className: tailwindMerge.twMerge(baseClasses, className),
|
|
3993
|
+
"aria-label": token ? token.symbol : selectTokenLabel,
|
|
3994
|
+
children: [
|
|
3995
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-sm)] flex-1", children: token ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3996
|
+
token.logoURI ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: token.logoURI, alt: token.symbol, className: "w-6 h-6 rounded-[var(--deframe-widget-size-radius-full)]" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-bg-secondary)] text-[color:var(--deframe-widget-color-text-secondary)] flex items-center justify-center text-[10px] [font-weight:var(--deframe-widget-font-weight-semibold)]", children: (token.symbol || "").slice(0, 3).toUpperCase() }),
|
|
3997
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", className: "text-[color:var(--deframe-widget-color-text-primary)]", children: token.symbol })
|
|
3998
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", className: "text-[color:var(--deframe-widget-color-text-secondary)]", children: selectTokenLabel }) }),
|
|
3999
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-[18px] h-[18px]", children: /* @__PURE__ */ jsxRuntime.jsx(hi2.HiChevronDown, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-tertiary)]" }) })
|
|
4000
|
+
]
|
|
4001
|
+
}
|
|
4002
|
+
);
|
|
4145
4003
|
};
|
|
4146
|
-
var
|
|
4147
|
-
labels,
|
|
4148
|
-
selectedToken,
|
|
4149
|
-
onTokenClick,
|
|
4150
|
-
balanceFormatted,
|
|
4151
|
-
balanceUsdFormatted,
|
|
4152
|
-
onBalanceClick,
|
|
4004
|
+
var SwapNetworkSelectorView = ({
|
|
4153
4005
|
chainLabel,
|
|
4154
4006
|
chainImage,
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4007
|
+
onClick,
|
|
4008
|
+
directionLabel = "De",
|
|
4009
|
+
testId = "swap-network-selector",
|
|
4010
|
+
className
|
|
4011
|
+
}) => {
|
|
4012
|
+
const baseClasses = "flex flex-row items-center gap-[var(--deframe-widget-size-gap-xs)]";
|
|
4013
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": testId, className: tailwindMerge.twMerge(baseClasses, className), children: [
|
|
4014
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", variant: "text-small", className: "tracking-wide text-[color:var(--deframe-widget-color-text-tertiary)]", children: directionLabel }),
|
|
4015
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4016
|
+
"button",
|
|
4017
|
+
{
|
|
4018
|
+
"data-testid": testId,
|
|
4019
|
+
type: "button",
|
|
4020
|
+
onClick,
|
|
4021
|
+
className: "ml-[var(--deframe-widget-size-gap-lg)] bg-[var(--deframe-widget-color-bg-tertiary)] border border-[color:var(--deframe-widget-color-border-tertiary)] rounded-[var(--deframe-widget-size-radius-md)] flex items-center gap-[var(--deframe-widget-size-gap-xs)] px-[var(--deframe-widget-size-padding-x-sm)] py-[var(--deframe-widget-size-padding-y-xs)] hover:border-[color:var(--deframe-widget-color-border-secondary)] transition-colors [font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] text-[color:var(--deframe-widget-color-text-secondary)] cursor-pointer",
|
|
4022
|
+
"aria-label": `${directionLabel} ${chainLabel}`,
|
|
4023
|
+
children: [
|
|
4024
|
+
chainImage ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: chainImage, alt: chainLabel, className: "w-3 h-3 rounded-[var(--deframe-widget-size-radius-full)]" }) : null,
|
|
4025
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: chainLabel }),
|
|
4026
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-[18px] h-[18px]", children: /* @__PURE__ */ jsxRuntime.jsx(hi2.HiChevronDown, { className: "w-3 h-3 text-[color:var(--deframe-widget-color-text-tertiary)]" }) })
|
|
4027
|
+
]
|
|
4028
|
+
}
|
|
4029
|
+
)
|
|
4030
|
+
] });
|
|
4031
|
+
};
|
|
4032
|
+
var SwapFromCardView = ({
|
|
4033
|
+
labels,
|
|
4034
|
+
selectedToken,
|
|
4035
|
+
onTokenClick,
|
|
4036
|
+
balanceFormatted,
|
|
4037
|
+
balanceUsdFormatted,
|
|
4038
|
+
onBalanceClick,
|
|
4039
|
+
chainLabel,
|
|
4040
|
+
chainImage,
|
|
4041
|
+
onNetworkClick,
|
|
4042
|
+
amountValue,
|
|
4043
|
+
amountHasError,
|
|
4158
4044
|
onAmountChange,
|
|
4159
4045
|
maxFractionDigits,
|
|
4160
4046
|
amountUsdFormatted,
|
|
4161
4047
|
isAmountUsdLoading,
|
|
4162
|
-
|
|
4048
|
+
field
|
|
4163
4049
|
}) => {
|
|
4164
4050
|
return /* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "flex flex-col gap-sm", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-md items-center", children: [
|
|
4165
4051
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-sm flex-1", children: [
|
|
@@ -4214,7 +4100,7 @@ var SwapFromCardView = ({
|
|
|
4214
4100
|
}
|
|
4215
4101
|
)
|
|
4216
4102
|
] }),
|
|
4217
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4103
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col flex-1 items-end justify-center gap-xs", children: [
|
|
4218
4104
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4219
4105
|
SwapAmountInputView,
|
|
4220
4106
|
{
|
|
@@ -4222,7 +4108,8 @@ var SwapFromCardView = ({
|
|
|
4222
4108
|
hasError: amountHasError,
|
|
4223
4109
|
onChange: onAmountChange,
|
|
4224
4110
|
maxFractionDigits,
|
|
4225
|
-
ariaLabel: labels.amountPlaceholder
|
|
4111
|
+
ariaLabel: labels.amountPlaceholder,
|
|
4112
|
+
field
|
|
4226
4113
|
}
|
|
4227
4114
|
),
|
|
4228
4115
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4234,9 +4121,19 @@ var SwapFromCardView = ({
|
|
|
4234
4121
|
children: isAmountUsdLoading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingDots, {}) : amountUsdFormatted
|
|
4235
4122
|
}
|
|
4236
4123
|
)
|
|
4237
|
-
] })
|
|
4124
|
+
] })
|
|
4238
4125
|
] }) });
|
|
4239
4126
|
};
|
|
4127
|
+
var SwapOutputAmountView = ({
|
|
4128
|
+
displayOutput,
|
|
4129
|
+
isLoading,
|
|
4130
|
+
loadingElement,
|
|
4131
|
+
searchingQuoteLabel = "Searching quote...",
|
|
4132
|
+
className
|
|
4133
|
+
}) => {
|
|
4134
|
+
const baseClasses = "[font-size:var(--deframe-widget-font-size-xxl)] [line-height:var(--deframe-widget-font-leading-xxl)] [font-weight:var(--deframe-widget-font-weight-extrabold)] text-right w-full min-w-[120px] text-[color:var(--deframe-widget-color-text-primary)]";
|
|
4135
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-flow-output-amount", className: tailwindMerge.twMerge(baseClasses, className), children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", variant: "text-small", className: "text-[color:var(--deframe-widget-color-text-primary-disabled)] inline-flex items-center", children: loadingElement != null ? loadingElement : searchingQuoteLabel }) : displayOutput });
|
|
4136
|
+
};
|
|
4240
4137
|
var SwapToCardView = ({
|
|
4241
4138
|
labels,
|
|
4242
4139
|
selectedToken,
|
|
@@ -4314,6 +4211,152 @@ var SwapToCardView = ({
|
|
|
4314
4211
|
] })
|
|
4315
4212
|
] }) });
|
|
4316
4213
|
};
|
|
4214
|
+
var SLIPPAGE_OPTIONS = [10, 50, 100];
|
|
4215
|
+
var SwapSlippageToleranceButtonsView = ({
|
|
4216
|
+
slippageBps,
|
|
4217
|
+
onSelect,
|
|
4218
|
+
formatPercentage,
|
|
4219
|
+
className
|
|
4220
|
+
}) => {
|
|
4221
|
+
const baseClasses = "flex gap-[var(--deframe-widget-size-gap-xs)]";
|
|
4222
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-slippage-tolerance-buttons", className: tailwindMerge.twMerge(baseClasses, className), children: SLIPPAGE_OPTIONS.map((option) => {
|
|
4223
|
+
const isActive = slippageBps === option;
|
|
4224
|
+
const activeClasses = "border-[color:var(--deframe-widget-color-brand-primary)] text-[color:var(--deframe-widget-color-brand-primary)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_18%,transparent)]";
|
|
4225
|
+
const inactiveClasses = "border-[color:var(--deframe-widget-color-border-tertiary)] text-[color:var(--deframe-widget-color-text-secondary)] bg-[var(--deframe-widget-color-bg-primary)]";
|
|
4226
|
+
const buttonBase = "px-[var(--deframe-widget-size-padding-x-sm)] py-[var(--deframe-widget-size-padding-y-xs)] rounded-[var(--deframe-widget-size-radius-xs)] border [font-size:var(--deframe-widget-font-size-sm)] [line-height:var(--deframe-widget-font-leading-sm)] cursor-pointer";
|
|
4227
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4228
|
+
"button",
|
|
4229
|
+
{
|
|
4230
|
+
"data-test-id": `slippage-option-${option}`,
|
|
4231
|
+
type: "button",
|
|
4232
|
+
onClick: () => onSelect(option),
|
|
4233
|
+
className: tailwindMerge.twMerge(buttonBase, isActive ? activeClasses : inactiveClasses),
|
|
4234
|
+
"aria-label": `${formatPercentage(option)}% slippage`,
|
|
4235
|
+
"aria-pressed": isActive,
|
|
4236
|
+
children: formatPercentage(option)
|
|
4237
|
+
},
|
|
4238
|
+
option
|
|
4239
|
+
);
|
|
4240
|
+
}) });
|
|
4241
|
+
};
|
|
4242
|
+
var SwapAdvancedSettingsView = ({
|
|
4243
|
+
title,
|
|
4244
|
+
isOpen,
|
|
4245
|
+
onOpenChange,
|
|
4246
|
+
slippageBps,
|
|
4247
|
+
onSlippageSelect,
|
|
4248
|
+
formatPercentage,
|
|
4249
|
+
percentageOptions,
|
|
4250
|
+
onPercentageClick,
|
|
4251
|
+
slippageFormatted,
|
|
4252
|
+
collapseText,
|
|
4253
|
+
expandText,
|
|
4254
|
+
maxLabel
|
|
4255
|
+
}) => {
|
|
4256
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-2 mt-md", children: /* @__PURE__ */ jsxRuntime.jsx(SectionCard, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4257
|
+
CollapsibleSection,
|
|
4258
|
+
{
|
|
4259
|
+
title,
|
|
4260
|
+
subtitle: slippageFormatted,
|
|
4261
|
+
open: isOpen,
|
|
4262
|
+
onOpenChange,
|
|
4263
|
+
collapseText,
|
|
4264
|
+
expandText,
|
|
4265
|
+
children: [
|
|
4266
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4267
|
+
SwapSlippageToleranceButtonsView,
|
|
4268
|
+
{
|
|
4269
|
+
slippageBps,
|
|
4270
|
+
onSelect: onSlippageSelect,
|
|
4271
|
+
formatPercentage,
|
|
4272
|
+
className: "mt-md"
|
|
4273
|
+
}
|
|
4274
|
+
),
|
|
4275
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full mt-md", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full gap-sm", children: percentageOptions.map((pct, index) => {
|
|
4276
|
+
const isMax = index === percentageOptions.length - 1;
|
|
4277
|
+
const label = isMax ? maxLabel : `${pct / 100}%`;
|
|
4278
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4279
|
+
PercentageButton,
|
|
4280
|
+
{
|
|
4281
|
+
type: "button",
|
|
4282
|
+
onClick: () => onPercentageClick(pct),
|
|
4283
|
+
children: label
|
|
4284
|
+
},
|
|
4285
|
+
pct
|
|
4286
|
+
);
|
|
4287
|
+
}) }) })
|
|
4288
|
+
]
|
|
4289
|
+
}
|
|
4290
|
+
) }) });
|
|
4291
|
+
};
|
|
4292
|
+
var SwapQuoteHeaderView = ({
|
|
4293
|
+
label,
|
|
4294
|
+
timerElement,
|
|
4295
|
+
className
|
|
4296
|
+
}) => {
|
|
4297
|
+
const baseClasses = "border-b border-[color:var(--deframe-widget-color-border-secondary)] pb-[var(--deframe-widget-size-padding-y-sm)]";
|
|
4298
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-quote-header", className: tailwindMerge.twMerge(baseClasses, className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
4299
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody, { as: "span", variant: "text-small", className: "[font-weight:var(--deframe-widget-font-weight-semibold)] text-[color:var(--deframe-widget-color-text-secondary)] inline-flex items-center", children: label }),
|
|
4300
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-[var(--deframe-widget-size-gap-md)]", children: timerElement })
|
|
4301
|
+
] }) });
|
|
4302
|
+
};
|
|
4303
|
+
var SwapQuoteBlockchainCostsView = ({
|
|
4304
|
+
totalCostFormatted,
|
|
4305
|
+
feePercentage,
|
|
4306
|
+
gasCostFormatted,
|
|
4307
|
+
protocolFee,
|
|
4308
|
+
blockchainCostsLabel = "Blockchain Costs",
|
|
4309
|
+
networkGasLabel = "Network Gas",
|
|
4310
|
+
protocolFeeLabel = "Protocol Fee",
|
|
4311
|
+
collapseLabel = "Collapse",
|
|
4312
|
+
expandLabel = "Expand"
|
|
4313
|
+
}) => {
|
|
4314
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-quote-blockchain-costs", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4315
|
+
CollapsibleInfoRow,
|
|
4316
|
+
{
|
|
4317
|
+
label: blockchainCostsLabel,
|
|
4318
|
+
value: `${totalCostFormatted} ~ ${feePercentage}%`,
|
|
4319
|
+
defaultOpen: true,
|
|
4320
|
+
collapseLabel,
|
|
4321
|
+
expandLabel,
|
|
4322
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)]", children: [
|
|
4323
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRowWithIcon, { children: [
|
|
4324
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconLabel, { children: networkGasLabel }),
|
|
4325
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconValue, { children: gasCostFormatted })
|
|
4326
|
+
] }),
|
|
4327
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRowWithIcon, { borderBottom: true, children: [
|
|
4328
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconLabel, { children: protocolFeeLabel }),
|
|
4329
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconValue, { children: protocolFee })
|
|
4330
|
+
] })
|
|
4331
|
+
] })
|
|
4332
|
+
}
|
|
4333
|
+
) });
|
|
4334
|
+
};
|
|
4335
|
+
var SwapQuoteErrorsView = ({
|
|
4336
|
+
hasQuoteError,
|
|
4337
|
+
hasBytecodeError,
|
|
4338
|
+
quoteErrorMessage = "Unable to get quote for this transaction",
|
|
4339
|
+
bytecodeErrorMessage = "Error building transaction"
|
|
4340
|
+
}) => {
|
|
4341
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "swap-quote-errors", children: [
|
|
4342
|
+
hasQuoteError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-sm", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4343
|
+
BannerNotification,
|
|
4344
|
+
{
|
|
4345
|
+
type: "inline",
|
|
4346
|
+
variant: "error",
|
|
4347
|
+
message: quoteErrorMessage
|
|
4348
|
+
}
|
|
4349
|
+
) }),
|
|
4350
|
+
hasBytecodeError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-sm", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4351
|
+
BannerNotification,
|
|
4352
|
+
{
|
|
4353
|
+
type: "inline",
|
|
4354
|
+
variant: "error",
|
|
4355
|
+
message: bytecodeErrorMessage
|
|
4356
|
+
}
|
|
4357
|
+
) })
|
|
4358
|
+
] });
|
|
4359
|
+
};
|
|
4317
4360
|
var SwapQuoteDetailsView = ({
|
|
4318
4361
|
labels,
|
|
4319
4362
|
isVisible,
|
|
@@ -4399,56 +4442,6 @@ var SwapQuoteDetailsView = ({
|
|
|
4399
4442
|
)
|
|
4400
4443
|
] });
|
|
4401
4444
|
};
|
|
4402
|
-
var SwapAdvancedSettingsView = ({
|
|
4403
|
-
title,
|
|
4404
|
-
isOpen,
|
|
4405
|
-
onOpenChange,
|
|
4406
|
-
slippageBps,
|
|
4407
|
-
onSlippageSelect,
|
|
4408
|
-
formatPercentage,
|
|
4409
|
-
percentageOptions,
|
|
4410
|
-
onPercentageClick,
|
|
4411
|
-
slippageFormatted,
|
|
4412
|
-
collapseText,
|
|
4413
|
-
expandText,
|
|
4414
|
-
maxLabel
|
|
4415
|
-
}) => {
|
|
4416
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-2 mt-md", children: /* @__PURE__ */ jsxRuntime.jsx(SectionCard, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4417
|
-
CollapsibleSection,
|
|
4418
|
-
{
|
|
4419
|
-
title,
|
|
4420
|
-
subtitle: slippageFormatted,
|
|
4421
|
-
open: isOpen,
|
|
4422
|
-
onOpenChange,
|
|
4423
|
-
collapseText,
|
|
4424
|
-
expandText,
|
|
4425
|
-
children: [
|
|
4426
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4427
|
-
SwapSlippageToleranceButtonsView,
|
|
4428
|
-
{
|
|
4429
|
-
slippageBps,
|
|
4430
|
-
onSelect: onSlippageSelect,
|
|
4431
|
-
formatPercentage,
|
|
4432
|
-
className: "mt-md"
|
|
4433
|
-
}
|
|
4434
|
-
),
|
|
4435
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full mt-md", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full gap-sm", children: percentageOptions.map((pct, index) => {
|
|
4436
|
-
const isMax = index === percentageOptions.length - 1;
|
|
4437
|
-
const label = isMax ? maxLabel : `${pct / 100}%`;
|
|
4438
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4439
|
-
PercentageButton,
|
|
4440
|
-
{
|
|
4441
|
-
type: "button",
|
|
4442
|
-
onClick: () => onPercentageClick(pct),
|
|
4443
|
-
children: label
|
|
4444
|
-
},
|
|
4445
|
-
pct
|
|
4446
|
-
);
|
|
4447
|
-
}) }) })
|
|
4448
|
-
]
|
|
4449
|
-
}
|
|
4450
|
-
) }) });
|
|
4451
|
-
};
|
|
4452
4445
|
var ConfirmSwapButtonView = ({
|
|
4453
4446
|
buttonLabel,
|
|
4454
4447
|
disabled,
|
|
@@ -4468,6 +4461,73 @@ var ConfirmSwapButtonView = ({
|
|
|
4468
4461
|
}
|
|
4469
4462
|
) });
|
|
4470
4463
|
};
|
|
4464
|
+
var SwapFormView = ({
|
|
4465
|
+
onSubmit,
|
|
4466
|
+
formRef,
|
|
4467
|
+
labels,
|
|
4468
|
+
onHistoryClick,
|
|
4469
|
+
onSwitchTokens,
|
|
4470
|
+
switchTokensAriaLabel,
|
|
4471
|
+
fromCard,
|
|
4472
|
+
toCard,
|
|
4473
|
+
advancedSettings,
|
|
4474
|
+
transactionDetails,
|
|
4475
|
+
confirmButton
|
|
4476
|
+
}) => {
|
|
4477
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4478
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4479
|
+
"div",
|
|
4480
|
+
{
|
|
4481
|
+
"data-testid": "swap-form-view",
|
|
4482
|
+
className: "flex-1 min-h-0 overflow-y-auto swap-flow-content pr-sm",
|
|
4483
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("form", { ref: formRef, onSubmit, "data-testid": "swap-flow-form", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-md text-text-secondary dark:text-text-secondary-dark", children: [
|
|
4484
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-md", children: [
|
|
4485
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-sm", children: [
|
|
4486
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading, { variant: "h5", className: "!text-[21px]", children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-testid": "swap-flow-title", children: labels.title }) }),
|
|
4487
|
+
labels.subtitle && /* @__PURE__ */ jsxRuntime.jsx(TextBody, { variant: "text-small", className: "!text-[14px]", children: labels.subtitle })
|
|
4488
|
+
] }),
|
|
4489
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4490
|
+
"button",
|
|
4491
|
+
{
|
|
4492
|
+
"data-testid": "swap-history-button",
|
|
4493
|
+
type: "button",
|
|
4494
|
+
onClick: onHistoryClick,
|
|
4495
|
+
className: "flex items-center justify-center w-12 h-12 transition-colors rounded-full cursor-pointer text-text-secondary dark:text-text-secondary-dark hover:text-brand-primary",
|
|
4496
|
+
"aria-label": labels.historyAriaLabel,
|
|
4497
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(md.MdHistory, { className: "w-6 h-6" })
|
|
4498
|
+
}
|
|
4499
|
+
)
|
|
4500
|
+
] }),
|
|
4501
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-col items-stretch gap-sm", children: [
|
|
4502
|
+
/* @__PURE__ */ jsxRuntime.jsx(SwapFromCardView, __spreadValues({}, fromCard)),
|
|
4503
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center -my-5 relative z-10", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4504
|
+
"button",
|
|
4505
|
+
{
|
|
4506
|
+
"data-testid": "swap-switch-tokens-button",
|
|
4507
|
+
type: "button",
|
|
4508
|
+
onClick: onSwitchTokens,
|
|
4509
|
+
className: "w-10 h-10 rounded-full bg-brand-secondary shadow-md flex items-center justify-center text-text-primary hover:shadow-lg transition-shadow focus:outline-none focus:ring-2 focus:ring-brand-secondary cursor-pointer",
|
|
4510
|
+
"aria-label": switchTokensAriaLabel,
|
|
4511
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(md.MdOutlineSwapVert, { className: "w-5 h-5" })
|
|
4512
|
+
}
|
|
4513
|
+
) }),
|
|
4514
|
+
/* @__PURE__ */ jsxRuntime.jsx(SwapToCardView, __spreadValues({}, toCard))
|
|
4515
|
+
] }),
|
|
4516
|
+
/* @__PURE__ */ jsxRuntime.jsx(SwapAdvancedSettingsView, __spreadValues({}, advancedSettings)),
|
|
4517
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-xl", children: /* @__PURE__ */ jsxRuntime.jsx(SwapQuoteDetailsView, __spreadValues({}, transactionDetails)) })
|
|
4518
|
+
] }) })
|
|
4519
|
+
}
|
|
4520
|
+
),
|
|
4521
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4522
|
+
"div",
|
|
4523
|
+
{
|
|
4524
|
+
"data-testid": "swap-flow-footer",
|
|
4525
|
+
className: "border-t p-md border-border-default dark:border-border-default-dark bg-bg-primary dark:bg-bg-primary-dark",
|
|
4526
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ConfirmSwapButtonView, __spreadValues({}, confirmButton))
|
|
4527
|
+
}
|
|
4528
|
+
)
|
|
4529
|
+
] });
|
|
4530
|
+
};
|
|
4471
4531
|
var ChooseANetworkView = ({
|
|
4472
4532
|
labels,
|
|
4473
4533
|
autoFocus = true,
|
|
@@ -5080,7 +5140,14 @@ var EarnDesktopView = ({
|
|
|
5080
5140
|
transactions
|
|
5081
5141
|
}) => {
|
|
5082
5142
|
if (isLoading) {
|
|
5083
|
-
|
|
5143
|
+
if (loadingSkeleton) {
|
|
5144
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: loadingSkeleton });
|
|
5145
|
+
}
|
|
5146
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-[var(--deframe-widget-size-gap-md)] w-full flex-1 min-h-0 animate-pulse px-[var(--deframe-widget-size-padding-x-lg)] py-[var(--deframe-widget-size-padding-y-lg)]", children: [
|
|
5147
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-24 rounded bg-[var(--deframe-widget-color-bg-secondary)]" }),
|
|
5148
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-40 rounded bg-[var(--deframe-widget-color-bg-secondary)]" }),
|
|
5149
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-60 rounded bg-[var(--deframe-widget-color-bg-secondary)]" })
|
|
5150
|
+
] });
|
|
5084
5151
|
}
|
|
5085
5152
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[color:var(--deframe-widget-color-text-primary)] flex flex-col relative overflow-y-auto w-full flex-1 min-h-0 pb-[var(--deframe-widget-size-padding-y-lg)] gap-[var(--deframe-widget-size-gap-md)]", children: [
|
|
5086
5153
|
/* @__PURE__ */ jsxRuntime.jsx(EarnInvestmentSummaryView, __spreadValues({}, summary)),
|
|
@@ -5089,28 +5156,32 @@ var EarnDesktopView = ({
|
|
|
5089
5156
|
/* @__PURE__ */ jsxRuntime.jsx(EarnRecentTransactionsView, __spreadValues({}, transactions))
|
|
5090
5157
|
] });
|
|
5091
5158
|
};
|
|
5092
|
-
var EarnInvestmentDetailsView = ({
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5159
|
+
var EarnInvestmentDetailsView = (props) => {
|
|
5160
|
+
if (props.isLoading) {
|
|
5161
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BackgroundContainer, { children: props.loadingSkeleton });
|
|
5162
|
+
}
|
|
5163
|
+
const {
|
|
5164
|
+
title,
|
|
5165
|
+
onBack,
|
|
5166
|
+
tokenIcon,
|
|
5167
|
+
fiatBalance,
|
|
5168
|
+
profitAmount,
|
|
5169
|
+
tokenAmount,
|
|
5170
|
+
investedLabel,
|
|
5171
|
+
earningsLabel,
|
|
5172
|
+
summaryTitle,
|
|
5173
|
+
summaryItems,
|
|
5174
|
+
pastActivitiesTitle,
|
|
5175
|
+
transactions,
|
|
5176
|
+
onTransactionClick,
|
|
5177
|
+
showMoreButton,
|
|
5178
|
+
onLoadMore,
|
|
5179
|
+
loadMoreLabel,
|
|
5180
|
+
depositLabel,
|
|
5181
|
+
onDeposit,
|
|
5182
|
+
withdrawLabel,
|
|
5183
|
+
onWithdraw
|
|
5184
|
+
} = props;
|
|
5114
5185
|
return /* @__PURE__ */ jsxRuntime.jsxs(BackgroundContainer, { children: [
|
|
5115
5186
|
/* @__PURE__ */ jsxRuntime.jsxs(Navbar, { children: [
|
|
5116
5187
|
/* @__PURE__ */ jsxRuntime.jsx(BackButton, { onClick: onBack }),
|
|
@@ -6459,20 +6530,13 @@ exports.SwapCrossChainProcessingView = SwapCrossChainProcessingView;
|
|
|
6459
6530
|
exports.SwapFormView = SwapFormView;
|
|
6460
6531
|
exports.SwapFromCardView = SwapFromCardView;
|
|
6461
6532
|
exports.SwapHistoryView = SwapHistoryView;
|
|
6462
|
-
exports.SwapNetworkSelectorView = SwapNetworkSelectorView;
|
|
6463
|
-
exports.SwapOutputAmountView = SwapOutputAmountView;
|
|
6464
6533
|
exports.SwapProcessingView = SwapProcessingView;
|
|
6465
6534
|
exports.SwapProcessingViewSimple = SwapProcessingViewSimple;
|
|
6466
|
-
exports.SwapQuoteBlockchainCostsView = SwapQuoteBlockchainCostsView;
|
|
6467
6535
|
exports.SwapQuoteDetailsView = SwapQuoteDetailsView;
|
|
6468
|
-
exports.SwapQuoteErrorsView = SwapQuoteErrorsView;
|
|
6469
|
-
exports.SwapQuoteHeaderView = SwapQuoteHeaderView;
|
|
6470
6536
|
exports.SwapSignatureWarningView = SwapSignatureWarningView;
|
|
6471
|
-
exports.SwapSlippageToleranceButtonsView = SwapSlippageToleranceButtonsView;
|
|
6472
6537
|
exports.SwapSuccessView = SwapSuccessView;
|
|
6473
6538
|
exports.SwapSuccessViewSimple = SwapSuccessViewSimple;
|
|
6474
6539
|
exports.SwapToCardView = SwapToCardView;
|
|
6475
|
-
exports.SwapTokenSelectorView = SwapTokenSelectorView;
|
|
6476
6540
|
exports.SwapTransactionFailedView = SwapTransactionFailedView;
|
|
6477
6541
|
exports.SwapTransactionFailedViewSimple = SwapTransactionFailedViewSimple;
|
|
6478
6542
|
exports.SwapWidgetFallbackView = SwapWidgetFallbackView;
|