@deframe-sdk/components 0.1.4 → 0.1.6
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 +295 -18
- package/dist/index.d.ts +295 -18
- package/dist/index.js +992 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +964 -43
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +470 -100
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
5
5
|
var React6 = require('react');
|
|
6
6
|
var framerMotion = require('framer-motion');
|
|
7
7
|
var md = require('react-icons/md');
|
|
8
|
+
var hi2 = require('react-icons/hi2');
|
|
8
9
|
|
|
9
10
|
function _interopNamespace(e) {
|
|
10
11
|
if (e && e.__esModule) return e;
|
|
@@ -140,11 +141,50 @@ function PrimaryButton(_a) {
|
|
|
140
141
|
"className",
|
|
141
142
|
"type"
|
|
142
143
|
]);
|
|
143
|
-
const
|
|
144
|
-
|
|
144
|
+
const baseClasses = [
|
|
145
|
+
/** layout */
|
|
146
|
+
"overflow-hidden w-full flex items-center justify-center transition-all duration-200",
|
|
147
|
+
/** typography */
|
|
148
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
149
|
+
"[font-size:var(--deframe-widget-font-size-md)]",
|
|
150
|
+
"[line-height:var(--deframe-widget-font-leading-md)]",
|
|
151
|
+
"[font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
152
|
+
/** spacing */
|
|
153
|
+
"px-[var(--deframe-widget-size-padding-x-xl)]",
|
|
154
|
+
"py-[var(--deframe-widget-size-padding-y-md)]",
|
|
155
|
+
/** container */
|
|
156
|
+
"rounded-[var(--deframe-widget-size-radius-xs)]",
|
|
157
|
+
"border-solid border-[length:var(--deframe-widget-size-border-xs)]",
|
|
158
|
+
"gap-[var(--deframe-widget-size-gap-sm)]"
|
|
159
|
+
].join(" ");
|
|
160
|
+
const stateClasses = {
|
|
161
|
+
/** enabled state */
|
|
162
|
+
enabled: [
|
|
163
|
+
"hover:opacity-90",
|
|
164
|
+
"text-[var(--deframe-widget-color-text-primary)]",
|
|
165
|
+
"bg-[var(--deframe-widget-color-brand-primary)]",
|
|
166
|
+
"border-[color:var(--deframe-widget-color-border-primary)]",
|
|
167
|
+
"cursor-pointer"
|
|
168
|
+
].join(" "),
|
|
169
|
+
/** disabled state */
|
|
170
|
+
disabled: [
|
|
171
|
+
"text-[var(--deframe-widget-color-text-primary-disabled)]",
|
|
172
|
+
"bg-[var(--deframe-widget-color-brand-primary-disabled)]",
|
|
173
|
+
"border-[color:var(--deframe-widget-color-border-primary-disabled)]",
|
|
174
|
+
"cursor-not-allowed"
|
|
175
|
+
].join(" ")
|
|
176
|
+
};
|
|
177
|
+
const buttonClasses = tailwindMerge.twMerge(
|
|
178
|
+
baseClasses,
|
|
179
|
+
stateClasses[disabled ? "disabled" : "enabled"],
|
|
180
|
+
className
|
|
181
|
+
);
|
|
145
182
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
146
183
|
"button",
|
|
147
184
|
__spreadProps(__spreadValues({
|
|
185
|
+
"data-slot": "primary-button",
|
|
186
|
+
"data-test-id": "primary-button",
|
|
187
|
+
"aria-label": "primary action",
|
|
148
188
|
type,
|
|
149
189
|
className: buttonClasses,
|
|
150
190
|
disabled
|
|
@@ -165,34 +205,52 @@ function SecondaryButton(_a) {
|
|
|
165
205
|
"className",
|
|
166
206
|
"type"
|
|
167
207
|
]);
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
208
|
+
const baseClasses = [
|
|
209
|
+
/** layout */
|
|
210
|
+
"overflow-hidden w-full flex items-center justify-center transition-all duration-200",
|
|
211
|
+
/** typography */
|
|
212
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
213
|
+
"[font-size:var(--deframe-widget-font-size-md)]",
|
|
214
|
+
"[line-height:var(--deframe-widget-font-leading-md)]",
|
|
215
|
+
"[font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
216
|
+
/** spacing */
|
|
217
|
+
"px-[var(--deframe-widget-size-padding-x-xl)]",
|
|
218
|
+
"py-[var(--deframe-widget-size-padding-y-md)]",
|
|
219
|
+
/** container */
|
|
220
|
+
"bg-transparent",
|
|
221
|
+
"rounded-[var(--deframe-widget-size-radius-xs)]",
|
|
222
|
+
"border-solid border-[length:var(--deframe-widget-size-border-xs)]",
|
|
223
|
+
"gap-[var(--deframe-widget-size-gap-sm)]"
|
|
224
|
+
].join(" ");
|
|
225
|
+
const stateClasses = {
|
|
226
|
+
enabled: [
|
|
227
|
+
"text-[color:var(--deframe-widget-color-brand-secondary)]",
|
|
228
|
+
"border-[color:var(--deframe-widget-color-border-secondary)]",
|
|
229
|
+
"hover:opacity-90",
|
|
230
|
+
"cursor-pointer"
|
|
231
|
+
].join(" "),
|
|
232
|
+
disabled: [
|
|
233
|
+
"text-[color:var(--deframe-widget-color-text-secondary-disabled)]",
|
|
234
|
+
"border-[color:var(--deframe-widget-color-border-secondary-disabled)]",
|
|
235
|
+
"cursor-not-allowed"
|
|
236
|
+
].join(" ")
|
|
181
237
|
};
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
disabled && "cursor-not-allowed",
|
|
238
|
+
const buttonClasses = tailwindMerge.twMerge(
|
|
239
|
+
baseClasses,
|
|
240
|
+
stateClasses[disabled ? "disabled" : "enabled"],
|
|
186
241
|
className
|
|
187
242
|
);
|
|
188
243
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
189
244
|
"button",
|
|
190
245
|
__spreadProps(__spreadValues({
|
|
246
|
+
"data-slot": "secondary-button",
|
|
247
|
+
"data-test-id": "secondary-button",
|
|
248
|
+
"aria-label": "secondary action",
|
|
191
249
|
type,
|
|
192
|
-
className:
|
|
250
|
+
className: buttonClasses,
|
|
193
251
|
disabled
|
|
194
252
|
}, props), {
|
|
195
|
-
children
|
|
253
|
+
children
|
|
196
254
|
})
|
|
197
255
|
);
|
|
198
256
|
}
|
|
@@ -208,34 +266,49 @@ function TertiaryButton(_a) {
|
|
|
208
266
|
"className",
|
|
209
267
|
"type"
|
|
210
268
|
]);
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
269
|
+
const baseClasses = [
|
|
270
|
+
/** layout */
|
|
271
|
+
"overflow-hidden w-full flex items-center justify-center transition-all duration-200",
|
|
272
|
+
/** typography */
|
|
273
|
+
"font-[var(--deframe-widget-font-family)]",
|
|
274
|
+
"[font-size:var(--deframe-widget-font-size-md)]",
|
|
275
|
+
"[line-height:var(--deframe-widget-font-leading-md)]",
|
|
276
|
+
"[font-weight:var(--deframe-widget-font-weight-semibold)]",
|
|
277
|
+
/** spacing */
|
|
278
|
+
"px-[var(--deframe-widget-size-padding-x-xl)]",
|
|
279
|
+
"py-[var(--deframe-widget-size-padding-y-md)]",
|
|
280
|
+
/** container */
|
|
281
|
+
"bg-transparent border-none",
|
|
282
|
+
"rounded-[var(--deframe-widget-size-radius-xs)]",
|
|
283
|
+
"gap-[var(--deframe-widget-size-gap-sm)]"
|
|
284
|
+
].join(" ");
|
|
285
|
+
const stateClasses = {
|
|
286
|
+
enabled: [
|
|
287
|
+
"text-[color:var(--deframe-widget-color-brand-tertiary)]",
|
|
288
|
+
"hover:opacity-90",
|
|
289
|
+
"cursor-pointer"
|
|
290
|
+
].join(" "),
|
|
291
|
+
disabled: [
|
|
292
|
+
"text-[color:var(--deframe-widget-color-text-tertiary-disabled)]",
|
|
293
|
+
"cursor-not-allowed"
|
|
294
|
+
].join(" ")
|
|
224
295
|
};
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
disabled && "cursor-not-allowed",
|
|
296
|
+
const buttonClasses = tailwindMerge.twMerge(
|
|
297
|
+
baseClasses,
|
|
298
|
+
stateClasses[disabled ? "disabled" : "enabled"],
|
|
229
299
|
className
|
|
230
300
|
);
|
|
231
301
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
232
302
|
"button",
|
|
233
303
|
__spreadProps(__spreadValues({
|
|
304
|
+
"data-slot": "tertiary-button",
|
|
305
|
+
"data-test-id": "tertiary-button",
|
|
306
|
+
"aria-label": "tertiary action",
|
|
234
307
|
type,
|
|
235
|
-
className:
|
|
308
|
+
className: buttonClasses,
|
|
236
309
|
disabled
|
|
237
310
|
}, props), {
|
|
238
|
-
children
|
|
311
|
+
children
|
|
239
312
|
})
|
|
240
313
|
);
|
|
241
314
|
}
|
|
@@ -1371,6 +1444,130 @@ var SummaryDetails = ({
|
|
|
1371
1444
|
}
|
|
1372
1445
|
);
|
|
1373
1446
|
};
|
|
1447
|
+
var SummaryDetailsCryptoControlV2 = ({
|
|
1448
|
+
title,
|
|
1449
|
+
items,
|
|
1450
|
+
defaultOpen = false,
|
|
1451
|
+
className = "",
|
|
1452
|
+
summaryClassName = "",
|
|
1453
|
+
contentClassName = "",
|
|
1454
|
+
showDividers = true
|
|
1455
|
+
}) => {
|
|
1456
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1457
|
+
"details",
|
|
1458
|
+
{
|
|
1459
|
+
"data-test-id": "summary-details-v2",
|
|
1460
|
+
"data-slot": "summary-details-v2",
|
|
1461
|
+
className: tailwindMerge.twMerge(
|
|
1462
|
+
"bg-[var(--color-bg-subtle,#1a1a1a)] rounded-lg border border-border-default dark:border-border-default-dark p-4 w-full max-w-[320px] group",
|
|
1463
|
+
className
|
|
1464
|
+
),
|
|
1465
|
+
open: defaultOpen,
|
|
1466
|
+
children: [
|
|
1467
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1468
|
+
"summary",
|
|
1469
|
+
{
|
|
1470
|
+
"data-test-id": "summary-details-v2-summary",
|
|
1471
|
+
"data-slot": "summary-details-v2-summary",
|
|
1472
|
+
className: tailwindMerge.twMerge("cursor-pointer list-none", summaryClassName),
|
|
1473
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
1474
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1475
|
+
"span",
|
|
1476
|
+
{
|
|
1477
|
+
"data-test-id": "summary-details-v2-title",
|
|
1478
|
+
"data-slot": "summary-details-v2-title",
|
|
1479
|
+
className: "text-[15px] font-semibold text-text-primary dark:text-text-primary-dark",
|
|
1480
|
+
children: title
|
|
1481
|
+
}
|
|
1482
|
+
),
|
|
1483
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1484
|
+
"svg",
|
|
1485
|
+
{
|
|
1486
|
+
"data-test-id": "summary-details-v2-chevron",
|
|
1487
|
+
"data-slot": "summary-details-v2-chevron",
|
|
1488
|
+
className: "w-4 h-4 text-text-secondary dark:text-text-secondary-dark transition-transform duration-300 group-open:rotate-180 flex-shrink-0",
|
|
1489
|
+
viewBox: "0 0 24 24",
|
|
1490
|
+
fill: "none",
|
|
1491
|
+
stroke: "currentColor",
|
|
1492
|
+
"aria-hidden": "true",
|
|
1493
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 9l7 7 7-7" })
|
|
1494
|
+
}
|
|
1495
|
+
)
|
|
1496
|
+
] })
|
|
1497
|
+
}
|
|
1498
|
+
),
|
|
1499
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1500
|
+
"div",
|
|
1501
|
+
{
|
|
1502
|
+
"data-test-id": "summary-details-v2-top-divider",
|
|
1503
|
+
"data-slot": "summary-details-v2-top-divider",
|
|
1504
|
+
className: "h-px bg-border-default dark:bg-border-default-dark mt-3"
|
|
1505
|
+
}
|
|
1506
|
+
),
|
|
1507
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1508
|
+
"div",
|
|
1509
|
+
{
|
|
1510
|
+
"data-test-id": "summary-details-v2-content",
|
|
1511
|
+
"data-slot": "summary-details-v2-content",
|
|
1512
|
+
className: tailwindMerge.twMerge("mt-0", contentClassName),
|
|
1513
|
+
children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(React6__namespace.Fragment, { children: [
|
|
1514
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1515
|
+
"div",
|
|
1516
|
+
{
|
|
1517
|
+
"data-test-id": "summary-details-v2-row",
|
|
1518
|
+
"data-slot": "summary-details-v2-row",
|
|
1519
|
+
className: "flex justify-between items-center py-[10px] gap-3",
|
|
1520
|
+
children: [
|
|
1521
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1522
|
+
"span",
|
|
1523
|
+
{
|
|
1524
|
+
"data-test-id": "summary-details-v2-row-label",
|
|
1525
|
+
"data-slot": "summary-details-v2-row-label",
|
|
1526
|
+
className: tailwindMerge.twMerge(
|
|
1527
|
+
"text-[11px] font-medium uppercase tracking-[0.07em] text-text-tertiary dark:text-text-tertiary-dark flex-shrink-0",
|
|
1528
|
+
item.labelClassName
|
|
1529
|
+
),
|
|
1530
|
+
children: item.label
|
|
1531
|
+
}
|
|
1532
|
+
),
|
|
1533
|
+
typeof item.value === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1534
|
+
"span",
|
|
1535
|
+
{
|
|
1536
|
+
"data-test-id": "summary-details-v2-row-value",
|
|
1537
|
+
"data-slot": "summary-details-v2-row-value",
|
|
1538
|
+
className: tailwindMerge.twMerge(
|
|
1539
|
+
"text-[13px] font-semibold text-text-primary dark:text-text-primary-dark text-right",
|
|
1540
|
+
item.valueClassName
|
|
1541
|
+
),
|
|
1542
|
+
children: item.value
|
|
1543
|
+
}
|
|
1544
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1545
|
+
"div",
|
|
1546
|
+
{
|
|
1547
|
+
"data-test-id": "summary-details-v2-row-value",
|
|
1548
|
+
"data-slot": "summary-details-v2-row-value",
|
|
1549
|
+
className: tailwindMerge.twMerge("text-right", item.valueClassName),
|
|
1550
|
+
children: item.value
|
|
1551
|
+
}
|
|
1552
|
+
)
|
|
1553
|
+
]
|
|
1554
|
+
}
|
|
1555
|
+
),
|
|
1556
|
+
showDividers && i < items.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1557
|
+
"div",
|
|
1558
|
+
{
|
|
1559
|
+
"data-test-id": "summary-details-v2-row-divider",
|
|
1560
|
+
"data-slot": "summary-details-v2-row-divider",
|
|
1561
|
+
className: "h-px bg-border-default dark:bg-border-default-dark"
|
|
1562
|
+
}
|
|
1563
|
+
)
|
|
1564
|
+
] }, i))
|
|
1565
|
+
}
|
|
1566
|
+
)
|
|
1567
|
+
]
|
|
1568
|
+
}
|
|
1569
|
+
);
|
|
1570
|
+
};
|
|
1374
1571
|
var ActionSheet = ({
|
|
1375
1572
|
id,
|
|
1376
1573
|
currentActionSheetId,
|
|
@@ -1637,30 +1834,785 @@ function DeframeComponentsProvider({
|
|
|
1637
1834
|
}
|
|
1638
1835
|
);
|
|
1639
1836
|
}
|
|
1837
|
+
var InfoRow = ({ children, borderBottom, className }) => {
|
|
1838
|
+
const baseClasses = "self-stretch inline-flex justify-between items-start";
|
|
1839
|
+
const borderClasses = borderBottom ? "border-b border-border-default dark:border-border-default-dark pb-sm" : "";
|
|
1840
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "info-row", className: tailwindMerge.twMerge(baseClasses, borderClasses, className), children });
|
|
1841
|
+
};
|
|
1842
|
+
var InfoLabel = ({ children, className }) => {
|
|
1843
|
+
const baseClasses = "text-sm text-text-secondary dark:text-text-secondary-dark";
|
|
1844
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "info-label", className: tailwindMerge.twMerge(baseClasses, className), children });
|
|
1845
|
+
};
|
|
1846
|
+
var variantClasses = {
|
|
1847
|
+
default: "text-text-primary dark:text-text-primary-dark",
|
|
1848
|
+
success: "text-state-success",
|
|
1849
|
+
warning: "text-state-warning",
|
|
1850
|
+
error: "text-state-error"
|
|
1851
|
+
};
|
|
1852
|
+
var InfoValue = ({ children, variant = "default", className }) => {
|
|
1853
|
+
const baseClasses = "text-sm font-semibold";
|
|
1854
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "info-value", className: tailwindMerge.twMerge(baseClasses, variantClasses[variant], className), children });
|
|
1855
|
+
};
|
|
1856
|
+
var InfoRowWithIcon = ({ children, borderBottom, className }) => {
|
|
1857
|
+
const baseClasses = "flex items-start justify-between h-[17px]";
|
|
1858
|
+
const borderClasses = borderBottom ? "border-b border-border-default dark:border-border-default-dark pb-sm" : "";
|
|
1859
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "info-row-with-icon", className: tailwindMerge.twMerge(baseClasses, borderClasses, className), children });
|
|
1860
|
+
};
|
|
1861
|
+
var InfoRowIconLabel = ({ children, className }) => {
|
|
1862
|
+
const baseClasses = "text-sm text-text-secondary dark:text-text-secondary-dark";
|
|
1863
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "info-row-icon-label", className: tailwindMerge.twMerge(baseClasses, className), children: [
|
|
1864
|
+
"\u2022 ",
|
|
1865
|
+
children
|
|
1866
|
+
] });
|
|
1867
|
+
};
|
|
1868
|
+
var InfoRowIconValue = ({ children, className }) => {
|
|
1869
|
+
const baseClasses = "text-sm font-semibold text-text-primary dark:text-text-primary-dark";
|
|
1870
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "info-row-icon-value", className: tailwindMerge.twMerge(baseClasses, className), children });
|
|
1871
|
+
};
|
|
1872
|
+
var CollapsibleInfoRow = ({
|
|
1873
|
+
label,
|
|
1874
|
+
value,
|
|
1875
|
+
children,
|
|
1876
|
+
defaultOpen = false,
|
|
1877
|
+
className,
|
|
1878
|
+
collapseLabel,
|
|
1879
|
+
expandLabel
|
|
1880
|
+
}) => {
|
|
1881
|
+
const [isOpen, setIsOpen] = React6__namespace.default.useState(defaultOpen);
|
|
1882
|
+
const baseClasses = "flex flex-col gap-sm w-full";
|
|
1883
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "collapsible-info-row", className: tailwindMerge.twMerge(baseClasses, className), children: [
|
|
1884
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1885
|
+
"button",
|
|
1886
|
+
{
|
|
1887
|
+
type: "button",
|
|
1888
|
+
onClick: () => setIsOpen(!isOpen),
|
|
1889
|
+
className: "flex items-start justify-between w-full text-left h-[18px] cursor-pointer",
|
|
1890
|
+
"aria-expanded": isOpen,
|
|
1891
|
+
"aria-label": `${isOpen ? collapseLabel : expandLabel} ${label}`,
|
|
1892
|
+
children: [
|
|
1893
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-[2px]", children: [
|
|
1894
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-text-sm text-text-secondary dark:text-text-secondary-dark", children: label }),
|
|
1895
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-[18px] h-[18px]", children: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(hi2.HiChevronUp, { className: "w-3 h-3 text-text-secondary dark:text-text-secondary-dark" }) : /* @__PURE__ */ jsxRuntime.jsx(hi2.HiChevronDown, { className: "w-3 h-3 text-text-secondary dark:text-text-secondary-dark" }) })
|
|
1896
|
+
] }),
|
|
1897
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-text-sm font-semibold text-text-secondary dark:text-text-secondary-dark", children: value })
|
|
1898
|
+
]
|
|
1899
|
+
}
|
|
1900
|
+
),
|
|
1901
|
+
isOpen && children
|
|
1902
|
+
] });
|
|
1903
|
+
};
|
|
1904
|
+
var BackgroundContainer = ({ children, className }) => {
|
|
1905
|
+
const baseClasses = "w-full flex-1 min-h-0 px-md bg-bg-default lg:bg-bg-subtle dark:bg-bg-default-dark lg:dark:bg-bg-subtle-dark text-text-primary dark:text-text-primary-dark flex flex-col relative overflow-y-auto";
|
|
1906
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "background-container", className: tailwindMerge.twMerge(baseClasses, className), children });
|
|
1907
|
+
};
|
|
1908
|
+
var SectionCard = ({ children, className }) => {
|
|
1909
|
+
const baseClasses = "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised rounded shadow-sm p-md flex flex-col gap-sm";
|
|
1910
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "section-card", className: tailwindMerge.twMerge(baseClasses, className), children });
|
|
1911
|
+
};
|
|
1912
|
+
var Navbar = ({ children, className }) => {
|
|
1913
|
+
const baseClasses = "w-full px-sm pr-md pt-sm pb-md border-b items-center border-border-subtle dark:border-border-subtle-dark flex";
|
|
1914
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "data-test-id": "navbar", className: tailwindMerge.twMerge(baseClasses, className), children });
|
|
1915
|
+
};
|
|
1916
|
+
var gapClasses = {
|
|
1917
|
+
xs: "gap-xs",
|
|
1918
|
+
sm: "gap-sm",
|
|
1919
|
+
md: "gap-md",
|
|
1920
|
+
lg: "gap-lg"
|
|
1921
|
+
};
|
|
1922
|
+
var FlexCol = ({ children, className, gap = "xs" }) => {
|
|
1923
|
+
const baseClasses = "flex flex-col";
|
|
1924
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "flex-col", className: tailwindMerge.twMerge(baseClasses, gapClasses[gap], className), children });
|
|
1925
|
+
};
|
|
1926
|
+
var gapClasses2 = {
|
|
1927
|
+
xs: "gap-xs",
|
|
1928
|
+
sm: "gap-sm",
|
|
1929
|
+
md: "gap-md",
|
|
1930
|
+
lg: "gap-lg"
|
|
1931
|
+
};
|
|
1932
|
+
var FlexRow = ({ children, className, gap = "xs" }) => {
|
|
1933
|
+
const baseClasses = "flex items-center";
|
|
1934
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "flex-row", className: tailwindMerge.twMerge(baseClasses, gapClasses2[gap], className), children });
|
|
1935
|
+
};
|
|
1936
|
+
var ScrollableContent = ({ children, className }) => {
|
|
1937
|
+
const baseClasses = "flex-1 overflow-y-auto px-md py-lg";
|
|
1938
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "scrollable-content", className: tailwindMerge.twMerge(baseClasses, className), children });
|
|
1939
|
+
};
|
|
1940
|
+
var DetailsHeader = ({ title, onBack, className, backAriaLabel = "Back" }) => {
|
|
1941
|
+
const baseClasses = "w-full px-sm pr-md pt-sm pb-md border-b border-border-subtle dark:border-border-subtle-dark flex items-center";
|
|
1942
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "details-header", className: tailwindMerge.twMerge(baseClasses, className), children: [
|
|
1943
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1944
|
+
"button",
|
|
1945
|
+
{
|
|
1946
|
+
"data-test-id": "details-header-back-button",
|
|
1947
|
+
onClick: onBack,
|
|
1948
|
+
className: "w-12 h-12 rounded-full flex items-center justify-center text-text-secondary dark:text-text-secondary-dark hover:text-brand-primary cursor-pointer",
|
|
1949
|
+
"aria-label": backAriaLabel,
|
|
1950
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(hi2.HiChevronLeft, { className: "w-6 h-6 text-text-tertiary dark:text-text-tertiary-dark" })
|
|
1951
|
+
}
|
|
1952
|
+
),
|
|
1953
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(TextHeading_default, { variant: "h-large", children: title }) })
|
|
1954
|
+
] });
|
|
1955
|
+
};
|
|
1956
|
+
var CloseButton = ({ onClick, testId, ariaLabel = "Close", className }) => {
|
|
1957
|
+
const baseClasses = "w-12 h-12 rounded-full flex items-center justify-center text-text-secondary dark:text-text-secondary-dark hover:text-brand-primary transition-colors cursor-pointer";
|
|
1958
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1959
|
+
"button",
|
|
1960
|
+
{
|
|
1961
|
+
"data-test-id": testId != null ? testId : "close-button",
|
|
1962
|
+
onClick,
|
|
1963
|
+
className: tailwindMerge.twMerge(baseClasses, className),
|
|
1964
|
+
"aria-label": ariaLabel,
|
|
1965
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(hi2.HiXMark, { className: "w-6 h-6" })
|
|
1966
|
+
}
|
|
1967
|
+
);
|
|
1968
|
+
};
|
|
1969
|
+
var HighRiskBadge = ({ className, label }) => {
|
|
1970
|
+
const baseClasses = "inline-flex justify-start items-start gap-1";
|
|
1971
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "high-risk-badge", className: tailwindMerge.twMerge(baseClasses, className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1972
|
+
"div",
|
|
1973
|
+
{
|
|
1974
|
+
"data-size": "Small",
|
|
1975
|
+
"data-type": "Failed",
|
|
1976
|
+
className: "h-6 px-2 py-1 opacity-95 bg-red-500/20 rounded-lg outline outline-1 outline-offset-[-1px] outline-state-error flex justify-center items-center gap-1",
|
|
1977
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-start items-center gap-2.5", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "justify-start text-state-error text-xs font-normal font-poppins leading-4", children: label }) })
|
|
1978
|
+
}
|
|
1979
|
+
) });
|
|
1980
|
+
};
|
|
1981
|
+
var MediumRiskBadge = ({ className, label }) => {
|
|
1982
|
+
const baseClasses = "inline-flex justify-start items-start gap-1";
|
|
1983
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "medium-risk-badge", className: tailwindMerge.twMerge(baseClasses, className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1984
|
+
"div",
|
|
1985
|
+
{
|
|
1986
|
+
"data-size": "Small",
|
|
1987
|
+
"data-type": "Warning",
|
|
1988
|
+
className: "h-6 px-2 py-1 opacity-95 bg-amber-500/20 rounded-lg outline outline-1 outline-offset-[-1px] outline-state-warning flex justify-center items-center gap-1",
|
|
1989
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-start items-center gap-2.5", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "justify-start text-state-warning text-xs font-normal font-poppins leading-4", children: label }) })
|
|
1990
|
+
}
|
|
1991
|
+
) });
|
|
1992
|
+
};
|
|
1993
|
+
var LowRiskBadge = ({ className, label }) => {
|
|
1994
|
+
const baseClasses = "inline-flex justify-start items-start gap-1";
|
|
1995
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "low-risk-badge", className: tailwindMerge.twMerge(baseClasses, className), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1996
|
+
"div",
|
|
1997
|
+
{
|
|
1998
|
+
"data-size": "Small",
|
|
1999
|
+
"data-type": "Completed",
|
|
2000
|
+
className: "h-6 px-2 py-1 opacity-95 bg-teal-600/20 rounded-lg outline outline-1 outline-offset-[-1px] outline-state-success flex justify-center items-center gap-1",
|
|
2001
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-start items-center gap-2.5", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "justify-start text-state-success text-xs font-normal font-poppins leading-4", children: label }) })
|
|
2002
|
+
}
|
|
2003
|
+
) });
|
|
2004
|
+
};
|
|
2005
|
+
var gapClasses3 = {
|
|
2006
|
+
xs: "gap-xs",
|
|
2007
|
+
sm: "gap-sm",
|
|
2008
|
+
md: "gap-md",
|
|
2009
|
+
lg: "gap-lg"
|
|
2010
|
+
};
|
|
2011
|
+
var HistoryFlexCol = ({ children, className, gap = "xs" }) => /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "history-flex-col", className: tailwindMerge.twMerge("flex flex-col", gapClasses3[gap], className), children });
|
|
2012
|
+
var TransactionTypeLabel = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-test-id": "transaction-type-label", className: "text-text-sm-mobile text-text-secondary dark:text-text-secondary-dark", children });
|
|
2013
|
+
var Amount = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-test-id": "amount", className: "text-accent-md-mobile text-text-secondary dark:text-text-secondary-dark", children });
|
|
2014
|
+
var AmountInUsd = ({ children }) => /* @__PURE__ */ jsxRuntime.jsxs("p", { "data-test-id": "amount-in-usd", className: "text-text-sm-mobile text-text-secondary dark:text-text-secondary-dark", children: [
|
|
2015
|
+
"~ ",
|
|
2016
|
+
children
|
|
2017
|
+
] });
|
|
2018
|
+
var TokenIcon = ({ src, alt }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2019
|
+
"img",
|
|
2020
|
+
{
|
|
2021
|
+
"data-test-id": "token-icon",
|
|
2022
|
+
src,
|
|
2023
|
+
alt,
|
|
2024
|
+
className: "w-8 h-8 rounded-full",
|
|
2025
|
+
onError: (e) => {
|
|
2026
|
+
const fallbackText = encodeURIComponent((alt || "TOK").slice(0, 3).toUpperCase());
|
|
2027
|
+
e.target.src = `https://placehold.co/40x40?text=${fallbackText}`;
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
);
|
|
2031
|
+
var SuccessBadge = ({ children }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "success-badge", className: "bg-[rgba(43,161,118,0.12)] flex items-center gap-xs px-[8px] py-[2px] rounded-[24px]", children: [
|
|
2032
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-2 h-2 rounded-full bg-state-success" }),
|
|
2033
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-text-sm-mobile text-text-primary dark:text-text-primary-dark", children })
|
|
2034
|
+
] });
|
|
2035
|
+
var truncateHash = (hash, chars = 6) => {
|
|
2036
|
+
if (hash.length <= chars * 2 + 3) return hash;
|
|
2037
|
+
return `${hash.slice(0, chars + 2)}...${hash.slice(-chars)}`;
|
|
2038
|
+
};
|
|
2039
|
+
var TransactionId = ({ hash }) => {
|
|
2040
|
+
if (!hash) {
|
|
2041
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-test-id": "transaction-id", className: "text-text-sm-mobile text-text-primary dark:text-text-primary-dark", children: "-" });
|
|
2042
|
+
}
|
|
2043
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "transaction-id", className: "flex items-center gap-xs", children: [
|
|
2044
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-text-sm-mobile text-text-primary dark:text-text-primary-dark", children: truncateHash(hash) }),
|
|
2045
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2046
|
+
AddressDisplay,
|
|
2047
|
+
{
|
|
2048
|
+
address: hash,
|
|
2049
|
+
className: "border-none bg-transparent p-0 gap-0",
|
|
2050
|
+
textClassName: "hidden"
|
|
2051
|
+
}
|
|
2052
|
+
)
|
|
2053
|
+
] });
|
|
2054
|
+
};
|
|
2055
|
+
var ExplorerLink = ({ href, children }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2056
|
+
"a",
|
|
2057
|
+
{
|
|
2058
|
+
"data-test-id": "explorer-link",
|
|
2059
|
+
href,
|
|
2060
|
+
target: "_blank",
|
|
2061
|
+
rel: "noopener noreferrer",
|
|
2062
|
+
className: "text-brand-primary underline text-sm font-semibold font-poppins",
|
|
2063
|
+
children
|
|
2064
|
+
}
|
|
2065
|
+
);
|
|
2066
|
+
var TwoLineValue = ({ primary, secondary }) => /* @__PURE__ */ jsxRuntime.jsxs(HistoryFlexCol, { className: "items-end", children: [
|
|
2067
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { "data-test-id": "two-line-value-primary", className: "text-text-sm-mobile text-text-secondary dark:text-text-secondary-dark font-semibold", children: primary }),
|
|
2068
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { "data-test-id": "two-line-value-secondary", className: "text-text-sm-mobile text-text-secondary dark:text-text-secondary-dark", children: secondary })
|
|
2069
|
+
] });
|
|
2070
|
+
var HistoryDepositDetailsView = ({
|
|
2071
|
+
transactionTypeLabel,
|
|
2072
|
+
symbol,
|
|
2073
|
+
amountWithSymbol,
|
|
2074
|
+
amountInUsdFormatted,
|
|
2075
|
+
shouldShowFlow,
|
|
2076
|
+
assetIn,
|
|
2077
|
+
assetOut,
|
|
2078
|
+
primaryAssetIconUrl,
|
|
2079
|
+
protocolLabel,
|
|
2080
|
+
statusLabel,
|
|
2081
|
+
txHash,
|
|
2082
|
+
date,
|
|
2083
|
+
explorerUrl,
|
|
2084
|
+
onClose,
|
|
2085
|
+
labels
|
|
2086
|
+
}) => {
|
|
2087
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(BackgroundContainer, { children: [
|
|
2088
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailsHeader, { title: labels.transactionDetailsTitle, onBack: onClose }),
|
|
2089
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollableContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { gap: "lg", children: [
|
|
2090
|
+
/* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "!p-[24px]", children: /* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { gap: "xs", children: [
|
|
2091
|
+
/* @__PURE__ */ jsxRuntime.jsx(TransactionTypeLabel, { children: transactionTypeLabel }),
|
|
2092
|
+
shouldShowFlow && assetIn && assetOut ? /* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { gap: "sm", children: [
|
|
2093
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FlexRow, { gap: "sm", children: [
|
|
2094
|
+
/* @__PURE__ */ jsxRuntime.jsx(TokenIcon, { src: assetIn.iconUrl, alt: assetIn.symbol }),
|
|
2095
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { children: [
|
|
2096
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Amount, { children: [
|
|
2097
|
+
assetIn.amount,
|
|
2098
|
+
" ",
|
|
2099
|
+
assetIn.symbol
|
|
2100
|
+
] }),
|
|
2101
|
+
assetIn.amountInUSD ? /* @__PURE__ */ jsxRuntime.jsx(AmountInUsd, { children: assetIn.amountInUSD }) : null
|
|
2102
|
+
] })
|
|
2103
|
+
] }),
|
|
2104
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FlexRow, { gap: "sm", children: [
|
|
2105
|
+
/* @__PURE__ */ jsxRuntime.jsx(TokenIcon, { src: assetOut.iconUrl, alt: assetOut.symbol }),
|
|
2106
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { children: [
|
|
2107
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Amount, { children: [
|
|
2108
|
+
assetOut.amount,
|
|
2109
|
+
" ",
|
|
2110
|
+
assetOut.symbol
|
|
2111
|
+
] }),
|
|
2112
|
+
assetOut.amountInUSD ? /* @__PURE__ */ jsxRuntime.jsx(AmountInUsd, { children: assetOut.amountInUSD }) : null
|
|
2113
|
+
] })
|
|
2114
|
+
] })
|
|
2115
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(FlexRow, { gap: "sm", children: [
|
|
2116
|
+
/* @__PURE__ */ jsxRuntime.jsx(TokenIcon, { src: primaryAssetIconUrl, alt: symbol }),
|
|
2117
|
+
/* @__PURE__ */ jsxRuntime.jsx(FlexCol, { children: /* @__PURE__ */ jsxRuntime.jsxs(FlexRow, { gap: "xs", children: [
|
|
2118
|
+
/* @__PURE__ */ jsxRuntime.jsx(Amount, { children: amountWithSymbol }),
|
|
2119
|
+
amountInUsdFormatted !== "-" ? /* @__PURE__ */ jsxRuntime.jsx(AmountInUsd, { children: amountInUsdFormatted }) : null
|
|
2120
|
+
] }) })
|
|
2121
|
+
] })
|
|
2122
|
+
] }) }),
|
|
2123
|
+
/* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "!p-md", children: /* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { gap: "sm", children: [
|
|
2124
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2125
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.currencyLabel }),
|
|
2126
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoValue, { children: symbol })
|
|
2127
|
+
] }),
|
|
2128
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2129
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.totalAmountLabel }),
|
|
2130
|
+
/* @__PURE__ */ jsxRuntime.jsx(TwoLineValue, { primary: amountInUsdFormatted, secondary: amountWithSymbol })
|
|
2131
|
+
] }),
|
|
2132
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2133
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.operationCostLabel }),
|
|
2134
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoValue, { children: labels.operationCostSponsoredLabel })
|
|
2135
|
+
] }),
|
|
2136
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2137
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.protocolLabel }),
|
|
2138
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoValue, { children: protocolLabel })
|
|
2139
|
+
] }),
|
|
2140
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2141
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.statusLabel }),
|
|
2142
|
+
/* @__PURE__ */ jsxRuntime.jsx(SuccessBadge, { children: statusLabel })
|
|
2143
|
+
] }),
|
|
2144
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2145
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.transactionIdLabel }),
|
|
2146
|
+
/* @__PURE__ */ jsxRuntime.jsx(TransactionId, { hash: txHash })
|
|
2147
|
+
] }),
|
|
2148
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2149
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.dateLabel }),
|
|
2150
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoValue, { children: date })
|
|
2151
|
+
] }),
|
|
2152
|
+
explorerUrl && /* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { children: [
|
|
2153
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.transactionLabel }),
|
|
2154
|
+
/* @__PURE__ */ jsxRuntime.jsx(ExplorerLink, { href: explorerUrl, children: labels.viewOnExplorerLabel })
|
|
2155
|
+
] })
|
|
2156
|
+
] }) })
|
|
2157
|
+
] }) })
|
|
2158
|
+
] });
|
|
2159
|
+
};
|
|
2160
|
+
var HistoryWithdrawDetailsView = ({
|
|
2161
|
+
transactionTypeLabel,
|
|
2162
|
+
symbol,
|
|
2163
|
+
amountWithSymbol,
|
|
2164
|
+
amountInUsdFormatted,
|
|
2165
|
+
shouldShowFlow,
|
|
2166
|
+
assetIn,
|
|
2167
|
+
assetOut,
|
|
2168
|
+
primaryAssetIconUrl,
|
|
2169
|
+
protocolLabel,
|
|
2170
|
+
statusLabel,
|
|
2171
|
+
txHash,
|
|
2172
|
+
date,
|
|
2173
|
+
explorerUrl,
|
|
2174
|
+
onClose,
|
|
2175
|
+
labels
|
|
2176
|
+
}) => {
|
|
2177
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(BackgroundContainer, { children: [
|
|
2178
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailsHeader, { title: labels.transactionDetailsTitle, onBack: onClose }),
|
|
2179
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollableContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { gap: "lg", children: [
|
|
2180
|
+
/* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "!p-[24px]", children: /* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { gap: "xs", children: [
|
|
2181
|
+
/* @__PURE__ */ jsxRuntime.jsx(TransactionTypeLabel, { children: transactionTypeLabel }),
|
|
2182
|
+
shouldShowFlow && assetIn && assetOut ? /* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { gap: "sm", children: [
|
|
2183
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FlexRow, { gap: "sm", children: [
|
|
2184
|
+
/* @__PURE__ */ jsxRuntime.jsx(TokenIcon, { src: assetIn.iconUrl, alt: assetIn.symbol }),
|
|
2185
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { children: [
|
|
2186
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Amount, { children: [
|
|
2187
|
+
assetIn.amount,
|
|
2188
|
+
" ",
|
|
2189
|
+
assetIn.symbol
|
|
2190
|
+
] }),
|
|
2191
|
+
assetIn.amountInUSD ? /* @__PURE__ */ jsxRuntime.jsx(AmountInUsd, { children: assetIn.amountInUSD }) : null
|
|
2192
|
+
] })
|
|
2193
|
+
] }),
|
|
2194
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FlexRow, { gap: "sm", children: [
|
|
2195
|
+
/* @__PURE__ */ jsxRuntime.jsx(TokenIcon, { src: assetOut.iconUrl, alt: assetOut.symbol }),
|
|
2196
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { children: [
|
|
2197
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Amount, { children: [
|
|
2198
|
+
assetOut.amount,
|
|
2199
|
+
" ",
|
|
2200
|
+
assetOut.symbol
|
|
2201
|
+
] }),
|
|
2202
|
+
assetOut.amountInUSD ? /* @__PURE__ */ jsxRuntime.jsx(AmountInUsd, { children: assetOut.amountInUSD }) : null
|
|
2203
|
+
] })
|
|
2204
|
+
] })
|
|
2205
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(FlexRow, { gap: "sm", children: [
|
|
2206
|
+
/* @__PURE__ */ jsxRuntime.jsx(TokenIcon, { src: primaryAssetIconUrl, alt: symbol }),
|
|
2207
|
+
/* @__PURE__ */ jsxRuntime.jsx(FlexCol, { children: /* @__PURE__ */ jsxRuntime.jsxs(FlexRow, { gap: "xs", children: [
|
|
2208
|
+
/* @__PURE__ */ jsxRuntime.jsx(Amount, { children: amountWithSymbol }),
|
|
2209
|
+
amountInUsdFormatted !== "-" ? /* @__PURE__ */ jsxRuntime.jsx(AmountInUsd, { children: amountInUsdFormatted }) : null
|
|
2210
|
+
] }) })
|
|
2211
|
+
] })
|
|
2212
|
+
] }) }),
|
|
2213
|
+
/* @__PURE__ */ jsxRuntime.jsx(SectionCard, { className: "!p-md", children: /* @__PURE__ */ jsxRuntime.jsxs(FlexCol, { gap: "sm", children: [
|
|
2214
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2215
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.currencyLabel }),
|
|
2216
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoValue, { children: symbol })
|
|
2217
|
+
] }),
|
|
2218
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2219
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.totalAmountLabel }),
|
|
2220
|
+
/* @__PURE__ */ jsxRuntime.jsx(TwoLineValue, { primary: amountInUsdFormatted, secondary: amountWithSymbol })
|
|
2221
|
+
] }),
|
|
2222
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2223
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.operationCostLabel }),
|
|
2224
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoValue, { children: labels.operationCostSponsoredLabel })
|
|
2225
|
+
] }),
|
|
2226
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2227
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.protocolLabel }),
|
|
2228
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoValue, { children: protocolLabel })
|
|
2229
|
+
] }),
|
|
2230
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2231
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.statusLabel }),
|
|
2232
|
+
/* @__PURE__ */ jsxRuntime.jsx(SuccessBadge, { children: statusLabel })
|
|
2233
|
+
] }),
|
|
2234
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2235
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.transactionIdLabel }),
|
|
2236
|
+
/* @__PURE__ */ jsxRuntime.jsx(TransactionId, { hash: txHash })
|
|
2237
|
+
] }),
|
|
2238
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { borderBottom: true, children: [
|
|
2239
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.dateLabel }),
|
|
2240
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoValue, { children: date })
|
|
2241
|
+
] }),
|
|
2242
|
+
explorerUrl && /* @__PURE__ */ jsxRuntime.jsxs(InfoRow, { children: [
|
|
2243
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoLabel, { children: labels.transactionLabel }),
|
|
2244
|
+
/* @__PURE__ */ jsxRuntime.jsx(ExplorerLink, { href: explorerUrl, children: labels.viewOnExplorerLabel })
|
|
2245
|
+
] })
|
|
2246
|
+
] }) })
|
|
2247
|
+
] }) })
|
|
2248
|
+
] });
|
|
2249
|
+
};
|
|
2250
|
+
var SwapNetworkSelectorView = ({
|
|
2251
|
+
chainLabel,
|
|
2252
|
+
chainImage,
|
|
2253
|
+
onClick,
|
|
2254
|
+
directionLabel = "De",
|
|
2255
|
+
testId = "swap-network-selector",
|
|
2256
|
+
className
|
|
2257
|
+
}) => {
|
|
2258
|
+
const baseClasses = "flex flex-row items-center gap-xs";
|
|
2259
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": testId, className: tailwindMerge.twMerge(baseClasses, className), children: [
|
|
2260
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { as: "span", variant: "text-small", className: "tracking-wide text-text-tertiary dark:text-text-tertiary-dark", children: directionLabel }),
|
|
2261
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2262
|
+
"button",
|
|
2263
|
+
{
|
|
2264
|
+
"data-testid": testId,
|
|
2265
|
+
type: "button",
|
|
2266
|
+
onClick,
|
|
2267
|
+
className: "ml-6 bg-bg-muted dark:bg-bg-muted-dark border border-border-subtle dark:border-border-subtle-dark rounded-lg flex items-center gap-xs px-sm py-xs hover:border-border-default dark:hover:border-border-default-dark transition-colors text-text-sm text-text-secondary dark:text-text-secondary-dark cursor-pointer",
|
|
2268
|
+
"aria-label": `${directionLabel} ${chainLabel}`,
|
|
2269
|
+
children: [
|
|
2270
|
+
chainImage ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: chainImage, alt: chainLabel, className: "w-3 h-3 rounded-full" }) : null,
|
|
2271
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: chainLabel }),
|
|
2272
|
+
/* @__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-text-tertiary dark:text-text-tertiary-dark" }) })
|
|
2273
|
+
]
|
|
2274
|
+
}
|
|
2275
|
+
)
|
|
2276
|
+
] });
|
|
2277
|
+
};
|
|
2278
|
+
var SwapQuoteHeaderView = ({
|
|
2279
|
+
label,
|
|
2280
|
+
timerElement,
|
|
2281
|
+
className
|
|
2282
|
+
}) => {
|
|
2283
|
+
const baseClasses = "border-b border-border-default dark:border-border-default-dark pb-sm";
|
|
2284
|
+
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: [
|
|
2285
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { as: "span", variant: "text-small", className: "font-semibold text-text-secondary dark:text-text-secondary-dark inline-flex items-center", children: label }),
|
|
2286
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-md", children: timerElement })
|
|
2287
|
+
] }) });
|
|
2288
|
+
};
|
|
2289
|
+
var SwapAmountInputView = ({
|
|
2290
|
+
value,
|
|
2291
|
+
hasError,
|
|
2292
|
+
onChange,
|
|
2293
|
+
maxFractionDigits = 6,
|
|
2294
|
+
field,
|
|
2295
|
+
ariaLabel = "Amount to swap",
|
|
2296
|
+
className
|
|
2297
|
+
}) => {
|
|
2298
|
+
const normalizeAmountInput = (raw) => {
|
|
2299
|
+
let val = raw.replace(/[^\d.,]/g, "");
|
|
2300
|
+
const endsWithSeparator = /[.,]$/.test(val);
|
|
2301
|
+
val = val.replace(/,/g, ".");
|
|
2302
|
+
const firstDot = val.indexOf(".");
|
|
2303
|
+
if (firstDot !== -1) {
|
|
2304
|
+
const intPart = val.slice(0, firstDot);
|
|
2305
|
+
const fractional = val.slice(firstDot + 1).replace(/\./g, "").slice(0, maxFractionDigits);
|
|
2306
|
+
if (fractional.length > 0) {
|
|
2307
|
+
val = `${intPart}.${fractional}`;
|
|
2308
|
+
} else {
|
|
2309
|
+
val = endsWithSeparator ? `${intPart}.` : intPart;
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
if (val.startsWith(".")) {
|
|
2313
|
+
val = `0${val}`;
|
|
2314
|
+
}
|
|
2315
|
+
return val;
|
|
2316
|
+
};
|
|
2317
|
+
const baseClasses = "text-h2-mobile font-extrabold bg-transparent outline-none text-right w-full min-w-[120px] placeholder:text-text-disabled dark:placeholder:text-text-disabled-dark";
|
|
2318
|
+
const colorClasses = hasError ? "text-state-error dark:text-state-error" : "text-text-primary dark:text-text-primary-dark";
|
|
2319
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2320
|
+
"input",
|
|
2321
|
+
__spreadProps(__spreadValues({
|
|
2322
|
+
"data-test-id": "swap-flow-amount-input",
|
|
2323
|
+
placeholder: "0.00",
|
|
2324
|
+
type: "text",
|
|
2325
|
+
inputMode: "decimal",
|
|
2326
|
+
autoComplete: "off",
|
|
2327
|
+
"aria-label": ariaLabel,
|
|
2328
|
+
min: "0",
|
|
2329
|
+
step: "any",
|
|
2330
|
+
value,
|
|
2331
|
+
className: tailwindMerge.twMerge(baseClasses, colorClasses, className)
|
|
2332
|
+
}, field), {
|
|
2333
|
+
onChange: (event) => {
|
|
2334
|
+
let normalized = normalizeAmountInput(event.target.value);
|
|
2335
|
+
if (normalized && parseFloat(normalized) < 0) {
|
|
2336
|
+
normalized = "0";
|
|
2337
|
+
}
|
|
2338
|
+
onChange(normalized);
|
|
2339
|
+
},
|
|
2340
|
+
onWheel: (event) => {
|
|
2341
|
+
event.currentTarget.blur();
|
|
2342
|
+
}
|
|
2343
|
+
})
|
|
2344
|
+
);
|
|
2345
|
+
};
|
|
2346
|
+
var SwapOutputAmountView = ({
|
|
2347
|
+
displayOutput,
|
|
2348
|
+
isLoading,
|
|
2349
|
+
loadingElement,
|
|
2350
|
+
searchingQuoteLabel = "Searching quote...",
|
|
2351
|
+
className
|
|
2352
|
+
}) => {
|
|
2353
|
+
const baseClasses = "text-h2-mobile font-extrabold text-right w-full min-w-[120px] text-text-primary dark:text-text-primary-dark";
|
|
2354
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-flow-output-amount", className: tailwindMerge.twMerge(baseClasses, className), children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { as: "span", variant: "text-small", className: "text-text-disabled dark:text-text-disabled-dark inline-flex items-center", children: loadingElement != null ? loadingElement : searchingQuoteLabel }) : displayOutput });
|
|
2355
|
+
};
|
|
2356
|
+
var SwapQuoteErrorsView = ({
|
|
2357
|
+
hasQuoteError,
|
|
2358
|
+
hasBytecodeError,
|
|
2359
|
+
quoteErrorMessage = "Unable to get quote for this transaction",
|
|
2360
|
+
bytecodeErrorMessage = "Error building transaction"
|
|
2361
|
+
}) => {
|
|
2362
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-test-id": "swap-quote-errors", children: [
|
|
2363
|
+
hasQuoteError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-sm", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2364
|
+
BannerNotification,
|
|
2365
|
+
{
|
|
2366
|
+
type: "inline",
|
|
2367
|
+
variant: "error",
|
|
2368
|
+
message: quoteErrorMessage
|
|
2369
|
+
}
|
|
2370
|
+
) }),
|
|
2371
|
+
hasBytecodeError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-sm", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2372
|
+
BannerNotification,
|
|
2373
|
+
{
|
|
2374
|
+
type: "inline",
|
|
2375
|
+
variant: "error",
|
|
2376
|
+
message: bytecodeErrorMessage
|
|
2377
|
+
}
|
|
2378
|
+
) })
|
|
2379
|
+
] });
|
|
2380
|
+
};
|
|
2381
|
+
var SLIPPAGE_OPTIONS = [10, 50, 100];
|
|
2382
|
+
var SwapSlippageToleranceButtonsView = ({
|
|
2383
|
+
slippageBps,
|
|
2384
|
+
onSelect,
|
|
2385
|
+
formatPercentage,
|
|
2386
|
+
className
|
|
2387
|
+
}) => {
|
|
2388
|
+
const baseClasses = "flex gap-xs";
|
|
2389
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-slippage-tolerance-buttons", className: tailwindMerge.twMerge(baseClasses, className), children: SLIPPAGE_OPTIONS.map((option) => {
|
|
2390
|
+
const isActive = slippageBps === option;
|
|
2391
|
+
const activeClasses = "border-brand-primary text-brand-primary bg-brand-tint dark:bg-brand-tint-dark";
|
|
2392
|
+
const inactiveClasses = "border-border-subtle dark:border-border-subtle-dark text-text-secondary dark:text-text-secondary-dark bg-bg-default dark:bg-bg-default-dark";
|
|
2393
|
+
const buttonBase = "px-sm py-xs rounded border text-text-sm cursor-pointer";
|
|
2394
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2395
|
+
"button",
|
|
2396
|
+
{
|
|
2397
|
+
"data-test-id": `slippage-option-${option}`,
|
|
2398
|
+
type: "button",
|
|
2399
|
+
onClick: () => onSelect(option),
|
|
2400
|
+
className: tailwindMerge.twMerge(buttonBase, isActive ? activeClasses : inactiveClasses),
|
|
2401
|
+
"aria-label": `${formatPercentage(option)}% slippage`,
|
|
2402
|
+
"aria-pressed": isActive,
|
|
2403
|
+
children: [
|
|
2404
|
+
formatPercentage(option),
|
|
2405
|
+
"%"
|
|
2406
|
+
]
|
|
2407
|
+
},
|
|
2408
|
+
option
|
|
2409
|
+
);
|
|
2410
|
+
}) });
|
|
2411
|
+
};
|
|
2412
|
+
var SwapTokenSelectorView = ({
|
|
2413
|
+
token,
|
|
2414
|
+
onClick,
|
|
2415
|
+
testId = "swap-token-selector",
|
|
2416
|
+
selectTokenLabel = "Select token",
|
|
2417
|
+
className
|
|
2418
|
+
}) => {
|
|
2419
|
+
const baseClasses = "h-[56px] border border-border-default dark:border-border-default-dark rounded overflow-hidden hover:border-border-strong dark:hover:border-border-strong-dark transition-colors flex items-center px-sm py-[6px] w-full cursor-pointer";
|
|
2420
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2421
|
+
"button",
|
|
2422
|
+
{
|
|
2423
|
+
"data-test-id": testId,
|
|
2424
|
+
type: "button",
|
|
2425
|
+
onClick,
|
|
2426
|
+
className: tailwindMerge.twMerge(baseClasses, className),
|
|
2427
|
+
"aria-label": token ? token.symbol : selectTokenLabel,
|
|
2428
|
+
children: [
|
|
2429
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-sm flex-1", children: token ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2430
|
+
token.logoURI ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: token.logoURI, alt: token.symbol, className: "w-6 h-6 rounded-full" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-6 h-6 rounded-full bg-bg-raised dark:bg-bg-raised-dark text-text-secondary dark:text-text-secondary-dark flex items-center justify-center text-[10px] font-semibold", children: (token.symbol || "").slice(0, 3).toUpperCase() }),
|
|
2431
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { as: "span", className: "text-text-primary dark:text-text-primary-dark", children: token.symbol })
|
|
2432
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { as: "span", className: "text-text-secondary dark:text-text-secondary-dark", children: selectTokenLabel }) }),
|
|
2433
|
+
/* @__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-text-tertiary dark:text-text-tertiary-dark" }) })
|
|
2434
|
+
]
|
|
2435
|
+
}
|
|
2436
|
+
);
|
|
2437
|
+
};
|
|
2438
|
+
var SwapQuoteBlockchainCostsView = ({
|
|
2439
|
+
totalCostFormatted,
|
|
2440
|
+
feePercentage,
|
|
2441
|
+
gasCostFormatted,
|
|
2442
|
+
protocolFee,
|
|
2443
|
+
blockchainCostsLabel = "Blockchain Costs",
|
|
2444
|
+
networkGasLabel = "Network Gas",
|
|
2445
|
+
protocolFeeLabel = "Protocol Fee",
|
|
2446
|
+
collapseLabel = "Collapse",
|
|
2447
|
+
expandLabel = "Expand"
|
|
2448
|
+
}) => {
|
|
2449
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "swap-quote-blockchain-costs", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2450
|
+
CollapsibleInfoRow,
|
|
2451
|
+
{
|
|
2452
|
+
label: blockchainCostsLabel,
|
|
2453
|
+
value: `${totalCostFormatted} ~ ${feePercentage}%`,
|
|
2454
|
+
defaultOpen: true,
|
|
2455
|
+
collapseLabel,
|
|
2456
|
+
expandLabel,
|
|
2457
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-sm", children: [
|
|
2458
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRowWithIcon, { children: [
|
|
2459
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconLabel, { children: networkGasLabel }),
|
|
2460
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconValue, { children: gasCostFormatted })
|
|
2461
|
+
] }),
|
|
2462
|
+
/* @__PURE__ */ jsxRuntime.jsxs(InfoRowWithIcon, { borderBottom: true, children: [
|
|
2463
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconLabel, { children: protocolFeeLabel }),
|
|
2464
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoRowIconValue, { children: protocolFee })
|
|
2465
|
+
] })
|
|
2466
|
+
] })
|
|
2467
|
+
}
|
|
2468
|
+
) });
|
|
2469
|
+
};
|
|
2470
|
+
var ChooseAStrategyActionsheetView = ({
|
|
2471
|
+
isOpen,
|
|
2472
|
+
currentActionSheetId,
|
|
2473
|
+
assetName,
|
|
2474
|
+
apy,
|
|
2475
|
+
logoUrl,
|
|
2476
|
+
riskLevel,
|
|
2477
|
+
onStrategyClick,
|
|
2478
|
+
onClose,
|
|
2479
|
+
yieldLabel,
|
|
2480
|
+
apyLabel = "APY",
|
|
2481
|
+
riskBadgeLabels,
|
|
2482
|
+
closeAriaLabel = "Close"
|
|
2483
|
+
}) => {
|
|
2484
|
+
const resolvedYieldLabel = yieldLabel != null ? yieldLabel : `Yield ${assetName}`;
|
|
2485
|
+
const badges = {
|
|
2486
|
+
low: /* @__PURE__ */ jsxRuntime.jsx(LowRiskBadge, { label: riskBadgeLabels.low }),
|
|
2487
|
+
medium: /* @__PURE__ */ jsxRuntime.jsx(MediumRiskBadge, { label: riskBadgeLabels.medium }),
|
|
2488
|
+
high: /* @__PURE__ */ jsxRuntime.jsx(HighRiskBadge, { label: riskBadgeLabels.high })
|
|
2489
|
+
};
|
|
2490
|
+
const Badge = badges[riskLevel];
|
|
2491
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "choose-strategy-actionsheet", className: "flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2492
|
+
ActionSheet,
|
|
2493
|
+
{
|
|
2494
|
+
id: "choose-strategy",
|
|
2495
|
+
currentActionSheetId,
|
|
2496
|
+
isOpen,
|
|
2497
|
+
onClose,
|
|
2498
|
+
position: "bottom",
|
|
2499
|
+
height: "full",
|
|
2500
|
+
contentClassName: "w-full max-w-[620px] mx-auto",
|
|
2501
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(BackgroundContainer, { className: "flex flex-col h-full", children: [
|
|
2502
|
+
/* @__PURE__ */ jsxRuntime.jsx(Navbar, { children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClick: onClose, ariaLabel: closeAriaLabel }) }),
|
|
2503
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col flex-1 w-full p-6 overflow-hidden", children: [
|
|
2504
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0", children: [
|
|
2505
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading_default, { children: resolvedYieldLabel }),
|
|
2506
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {})
|
|
2507
|
+
] }),
|
|
2508
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2 w-full mt-4 overflow-y-auto flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntime.jsxs(ListItem, { className: "flex-shrink-0", onClick: onStrategyClick, children: [
|
|
2509
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemLeftSide, { children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoUrl, alt: assetName, className: "w-10 h-10 rounded-full" }) }),
|
|
2510
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ListItemContent, { className: "gap-1", children: [
|
|
2511
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { children: resolvedYieldLabel }),
|
|
2512
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { variant: "text-small", children: Badge })
|
|
2513
|
+
] }),
|
|
2514
|
+
/* @__PURE__ */ jsxRuntime.jsx(ListItemRightSide, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-center items-center gap-1", children: [
|
|
2515
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-state-success", children: [
|
|
2516
|
+
apy,
|
|
2517
|
+
"% ",
|
|
2518
|
+
apyLabel
|
|
2519
|
+
] }),
|
|
2520
|
+
/* @__PURE__ */ jsxRuntime.jsx(hi2.HiArrowRight, { className: "w-4 h-4" })
|
|
2521
|
+
] }) })
|
|
2522
|
+
] }) })
|
|
2523
|
+
] })
|
|
2524
|
+
] })
|
|
2525
|
+
}
|
|
2526
|
+
) });
|
|
2527
|
+
};
|
|
2528
|
+
var StrategyDetailsView = ({
|
|
2529
|
+
logoUrl,
|
|
2530
|
+
title,
|
|
2531
|
+
description,
|
|
2532
|
+
strategyInfo,
|
|
2533
|
+
onBack,
|
|
2534
|
+
onDeposit,
|
|
2535
|
+
headerTitle = "Details",
|
|
2536
|
+
strategyInfoTitle = "Strategy Info",
|
|
2537
|
+
depositButtonLabel = "Deposit",
|
|
2538
|
+
backAriaLabel = "Back"
|
|
2539
|
+
}) => {
|
|
2540
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(BackgroundContainer, { children: [
|
|
2541
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailsHeader, { title: headerTitle, onBack, backAriaLabel }),
|
|
2542
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "strategy-details-content", className: "flex-1 min-h-0 overflow-y-auto p-md py-lg pb-24", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-lg min-h-full", children: [
|
|
2543
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex flex-col items-start gap-sm", children: [
|
|
2544
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { "data-test-id": "strategy-logo", src: logoUrl, alt: title, className: "w-20 h-20 rounded-full" }),
|
|
2545
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextHeading_default, { variant: "h5", children: title })
|
|
2546
|
+
] }),
|
|
2547
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextBody_default, { variant: "text-small", children: description }),
|
|
2548
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2549
|
+
SummaryDetails,
|
|
2550
|
+
{
|
|
2551
|
+
title: strategyInfoTitle,
|
|
2552
|
+
items: strategyInfo,
|
|
2553
|
+
defaultOpen: true,
|
|
2554
|
+
className: "bg-bg-subtle dark:bg-bg-subtle-dark lg:!bg-bg-raised"
|
|
2555
|
+
}
|
|
2556
|
+
)
|
|
2557
|
+
] }) }),
|
|
2558
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-test-id": "strategy-details-footer", className: "sticky bottom-0 left-0 right-0 border-t border-border-subtle dark:border-border-subtle-dark px-md py-md", children: /* @__PURE__ */ jsxRuntime.jsx(PrimaryButton, { onClick: onDeposit, className: "w-full", children: depositButtonLabel }) })
|
|
2559
|
+
] });
|
|
2560
|
+
};
|
|
1640
2561
|
|
|
1641
2562
|
exports.ActionButton = ActionButton;
|
|
1642
2563
|
exports.ActionSheet = ActionSheet;
|
|
1643
2564
|
exports.AddressDisplay = AddressDisplay;
|
|
2565
|
+
exports.BackgroundContainer = BackgroundContainer;
|
|
1644
2566
|
exports.BannerNotification = BannerNotification;
|
|
2567
|
+
exports.ChooseAStrategyActionsheetView = ChooseAStrategyActionsheetView;
|
|
2568
|
+
exports.CloseButton = CloseButton;
|
|
2569
|
+
exports.CollapsibleInfoRow = CollapsibleInfoRow;
|
|
1645
2570
|
exports.ConnectWalletList = ConnectWalletList;
|
|
1646
2571
|
exports.Currency = Currency;
|
|
1647
2572
|
exports.DeframeComponentsProvider = DeframeComponentsProvider;
|
|
2573
|
+
exports.DetailsHeader = DetailsHeader;
|
|
1648
2574
|
exports.Fiat = Currency;
|
|
2575
|
+
exports.FlexCol = FlexCol;
|
|
2576
|
+
exports.FlexRow = FlexRow;
|
|
2577
|
+
exports.HighRiskBadge = HighRiskBadge;
|
|
2578
|
+
exports.HistoryDepositDetailsView = HistoryDepositDetailsView;
|
|
2579
|
+
exports.HistoryWithdrawDetailsView = HistoryWithdrawDetailsView;
|
|
2580
|
+
exports.InfoLabel = InfoLabel;
|
|
2581
|
+
exports.InfoRow = InfoRow;
|
|
2582
|
+
exports.InfoRowIconLabel = InfoRowIconLabel;
|
|
2583
|
+
exports.InfoRowIconValue = InfoRowIconValue;
|
|
2584
|
+
exports.InfoRowWithIcon = InfoRowWithIcon;
|
|
2585
|
+
exports.InfoValue = InfoValue;
|
|
1649
2586
|
exports.Input = Input;
|
|
1650
2587
|
exports.Link = Link;
|
|
1651
2588
|
exports.ListItem = ListItem;
|
|
1652
2589
|
exports.ListItemContent = ListItemContent;
|
|
1653
2590
|
exports.ListItemLeftSide = ListItemLeftSide;
|
|
1654
2591
|
exports.ListItemRightSide = ListItemRightSide;
|
|
2592
|
+
exports.LowRiskBadge = LowRiskBadge;
|
|
2593
|
+
exports.MediumRiskBadge = MediumRiskBadge;
|
|
2594
|
+
exports.Navbar = Navbar;
|
|
1655
2595
|
exports.PercentageButton = PercentageButton;
|
|
1656
2596
|
exports.PrimaryButton = PrimaryButton;
|
|
2597
|
+
exports.ScrollableContent = ScrollableContent;
|
|
1657
2598
|
exports.SecondaryButton = SecondaryButton;
|
|
2599
|
+
exports.SectionCard = SectionCard;
|
|
1658
2600
|
exports.Select = Select;
|
|
1659
2601
|
exports.SelectContent = SelectContent;
|
|
1660
2602
|
exports.SelectItem = SelectItem;
|
|
1661
2603
|
exports.SelectTrigger = SelectTrigger;
|
|
1662
2604
|
exports.Skeleton = Skeleton;
|
|
2605
|
+
exports.StrategyDetailsView = StrategyDetailsView;
|
|
1663
2606
|
exports.SummaryDetails = SummaryDetails;
|
|
2607
|
+
exports.SummaryDetailsCryptoControlV2 = SummaryDetailsCryptoControlV2;
|
|
2608
|
+
exports.SwapAmountInputView = SwapAmountInputView;
|
|
2609
|
+
exports.SwapNetworkSelectorView = SwapNetworkSelectorView;
|
|
2610
|
+
exports.SwapOutputAmountView = SwapOutputAmountView;
|
|
2611
|
+
exports.SwapQuoteBlockchainCostsView = SwapQuoteBlockchainCostsView;
|
|
2612
|
+
exports.SwapQuoteErrorsView = SwapQuoteErrorsView;
|
|
2613
|
+
exports.SwapQuoteHeaderView = SwapQuoteHeaderView;
|
|
2614
|
+
exports.SwapSlippageToleranceButtonsView = SwapSlippageToleranceButtonsView;
|
|
2615
|
+
exports.SwapTokenSelectorView = SwapTokenSelectorView;
|
|
1664
2616
|
exports.Tabs = Tabs;
|
|
1665
2617
|
exports.TabsContent = TabsContent;
|
|
1666
2618
|
exports.TabsList = TabsList;
|