@gearbox-protocol/ui-kit 3.14.0-next.65 → 3.14.0-next.67
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/cjs/components/assets-list-cell/assets-list-cell.cjs +1 -1
- package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
- package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
- package/dist/cjs/components/breakpoint-provider.cjs +1 -0
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
- package/dist/cjs/components/composites/index.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-head.cjs +1 -1
- package/dist/cjs/components/composites/pool-credit-managers-table/pool-credit-managers-table-head.cjs +1 -1
- package/dist/cjs/components/composites/pool-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/cells/cells.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/cells/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/points-feature/points-feature.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/strategies-table.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/types/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/types/rewards-cell.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy-legacy.cjs +1 -0
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/compound-apy/index.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
- package/dist/cjs/components/pool-apy-tooltip/apy-tooltip.cjs +1 -0
- package/dist/cjs/components/pool-apy-tooltip/index.cjs +1 -1
- package/dist/cjs/components/pool-apy-tooltip/pool-apy-tooltip.cjs +1 -1
- package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
- package/dist/cjs/components/token-icon/token-icon.cjs +1 -1
- package/dist/cjs/components/token-symbol/index.cjs +1 -1
- package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
- package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/components/yield-breakdown-tooltip/index.cjs +1 -0
- package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -0
- package/dist/cjs/hooks/use-debounce-call.cjs +1 -1
- package/dist/cjs/hooks/use-media-query.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/types/common.cjs +1 -1
- package/dist/cjs/utils/apy-breakdown.cjs +1 -0
- package/dist/cjs/utils/bps.cjs +1 -0
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/token-icon-source.cjs +1 -0
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +132 -206
- package/dist/esm/components/block-sync/block-sync.js +5 -4
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +5 -4
- package/dist/esm/components/breakpoint-provider.js +67 -0
- package/dist/esm/components/checkbox/checkbox-labeled.js +3 -2
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +3 -2
- package/dist/esm/components/complex-input/complex-input.js +5 -4
- package/dist/esm/components/composites/index.js +86 -81
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-head.js +3 -2
- package/dist/esm/components/composites/pool-credit-managers-table/pool-credit-managers-table-head.js +3 -2
- package/dist/esm/components/composites/pool-table/columns.js +61 -60
- package/dist/esm/components/composites/strategies-table/columns.js +55 -86
- package/dist/esm/components/composites/strategies-table/components/cells/cells.js +150 -110
- package/dist/esm/components/composites/strategies-table/components/cells/index.js +7 -5
- package/dist/esm/components/composites/strategies-table/components/index.js +32 -30
- package/dist/esm/components/composites/strategies-table/components/points-feature/points-feature.js +35 -32
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.js +91 -224
- package/dist/esm/components/composites/strategies-table/components/strategies-table.js +26 -24
- package/dist/esm/components/composites/strategies-table/index.js +36 -31
- package/dist/esm/components/composites/strategies-table/types/index.js +5 -1
- package/dist/esm/components/composites/strategies-table/types/rewards-cell.js +40 -0
- package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +32 -189
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +5 -4
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.js +26 -26
- package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.js +40 -38
- package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.js +53 -47
- package/dist/esm/components/compound-apy/compound-apy-legacy.js +127 -0
- package/dist/esm/components/compound-apy/compound-apy.js +56 -245
- package/dist/esm/components/compound-apy/index.js +4 -2
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +25 -180
- package/dist/esm/components/index.js +805 -787
- package/dist/esm/components/markdown-viewer/markdown-viewer.js +5 -4
- package/dist/esm/components/pool-apy-tooltip/apy-tooltip.js +155 -0
- package/dist/esm/components/pool-apy-tooltip/index.js +4 -2
- package/dist/esm/components/pool-apy-tooltip/pool-apy-tooltip.js +3 -3
- package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +3 -2
- package/dist/esm/components/token-icon/token-icon.js +72 -58
- package/dist/esm/components/token-symbol/index.js +2 -3
- package/dist/esm/components/token-symbol/token-symbol.js +41 -62
- package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +35 -192
- package/dist/esm/components/with-copy/with-copy.js +5 -4
- package/dist/esm/components/yield-breakdown-tooltip/index.js +4 -0
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +222 -0
- package/dist/esm/hooks/use-debounce-call.js +3 -2
- package/dist/esm/hooks/use-media-query.js +49 -16
- package/dist/esm/index.js +974 -946
- package/dist/esm/locale/en.json.js +9 -2
- package/dist/esm/types/common.js +1 -6
- package/dist/esm/utils/apy-breakdown.js +18 -0
- package/dist/esm/utils/bps.js +4 -0
- package/dist/esm/utils/index.js +105 -95
- package/dist/esm/utils/token-icon-source.js +48 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/assets-list-cell/assets-list-cell.d.ts +44 -4
- package/dist/types/components/breakpoint-provider.d.ts +56 -0
- package/dist/types/components/composites/pool-table/pool-table-backend-contract.types.d.ts +1 -1
- package/dist/types/components/composites/strategies-table/components/cells/cells.d.ts +34 -3
- package/dist/types/components/composites/strategies-table/components/points-feature/points-feature.d.ts +14 -10
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.d.ts +10 -13
- package/dist/types/components/composites/strategies-table/index.d.ts +1 -1
- package/dist/types/components/composites/strategies-table/types/index.d.ts +1 -0
- package/dist/types/components/composites/strategies-table/types/rewards-cell.d.ts +48 -0
- package/dist/types/components/composites/strategies-table/types/rewards-tooltip.d.ts +37 -32
- package/dist/types/components/composites/strategies-table/types/table.d.ts +27 -12
- package/dist/types/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.d.ts +3 -3
- package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.d.ts +4 -0
- package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.d.ts +5 -0
- package/dist/types/components/compound-apy/compound-apy-legacy.d.ts +109 -0
- package/dist/types/components/compound-apy/compound-apy.d.ts +18 -94
- package/dist/types/components/compound-apy/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +3 -1
- package/dist/types/components/points-icon/index.d.ts +1 -1
- package/dist/types/components/points-icon/points-icon.d.ts +13 -2
- package/dist/types/components/pool-apy-tooltip/apy-tooltip.d.ts +20 -0
- package/dist/types/components/pool-apy-tooltip/index.d.ts +1 -0
- package/dist/types/components/pool-apy-tooltip/pool-apy-tooltip.d.ts +18 -1
- package/dist/types/components/token-icon/token-icon.d.ts +11 -2
- package/dist/types/components/token-symbol/token-symbol.d.ts +4 -4
- package/dist/types/components/yield-breakdown-tooltip/index.d.ts +1 -0
- package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +32 -0
- package/dist/types/hooks/use-media-query.d.ts +5 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/locale/en.json.d.ts +10 -2
- package/dist/types/types/common.d.ts +5 -11
- package/dist/types/utils/apy-breakdown.d.ts +18 -0
- package/dist/types/utils/bps.d.ts +3 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/token-icon-source.d.ts +28 -0
- package/package.json +2 -2
|
@@ -45,6 +45,7 @@ import "../auth/wallet-ui-context.js";
|
|
|
45
45
|
import "../avatar/avatar.js";
|
|
46
46
|
import "../badge/badge.js";
|
|
47
47
|
import "../navigation-context/navigation-context.js";
|
|
48
|
+
import "../breakpoint-provider.js";
|
|
48
49
|
import "../button-checkbox/button-checkbox.js";
|
|
49
50
|
import "../card-grid/card-grid.js";
|
|
50
51
|
import "../cards/card/card.js";
|
|
@@ -73,13 +74,12 @@ import "../dialog/dialog-modal-container.js";
|
|
|
73
74
|
import "../text-button/text-button.js";
|
|
74
75
|
import "../vertical-indicator/vertical-indicator.js";
|
|
75
76
|
import "../points-icon/points-icon.js";
|
|
76
|
-
import "../skeleton/skeleton.js";
|
|
77
77
|
import "../vertical-list/vertical-list.js";
|
|
78
|
+
import "../skeleton/skeleton.js";
|
|
78
79
|
import "../rounded-image/rounded-image.js";
|
|
79
80
|
import "../progress/progress.js";
|
|
80
81
|
import "../pool-indicator-icon/pool-indicator-icon.js";
|
|
81
82
|
import "../composites/strategies-table/components/feature/feature.styles.js";
|
|
82
|
-
import "viem";
|
|
83
83
|
import "../icon-button/icon-button.js";
|
|
84
84
|
import "../separate-line/separate-line.js";
|
|
85
85
|
import "../tip-card/tip-card.js";
|
|
@@ -101,6 +101,7 @@ import "../dialog/dialog-footer.js";
|
|
|
101
101
|
import "../dialog/dialog-header.js";
|
|
102
102
|
import "../dialog/dialog-title.js";
|
|
103
103
|
import "../dialog/dialog-overlay.js";
|
|
104
|
+
import "viem";
|
|
104
105
|
import "../label/label.js";
|
|
105
106
|
import "../dropdown-menu/dropdown-menu.js";
|
|
106
107
|
import "../dropdown-menu/dropdown-menu-checkbox-item.js";
|
|
@@ -187,7 +188,7 @@ function a(o) {
|
|
|
187
188
|
}
|
|
188
189
|
return { id: T(l), displayText: o };
|
|
189
190
|
}
|
|
190
|
-
function
|
|
191
|
+
function Br({
|
|
191
192
|
content: o,
|
|
192
193
|
title: l,
|
|
193
194
|
backButton: s,
|
|
@@ -399,5 +400,5 @@ function Vr({
|
|
|
399
400
|
return c ? d : /* @__PURE__ */ r(w, { title: l || "", backButton: s, children: d });
|
|
400
401
|
}
|
|
401
402
|
export {
|
|
402
|
-
|
|
403
|
+
Br as MarkdownViewer
|
|
403
404
|
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { faPlus as u } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { FaIcon as h } from "../icons/fa-icon.js";
|
|
4
|
+
import { PointsIcon as y } from "../points-icon/points-icon.js";
|
|
5
|
+
import { TokenIcon as g } from "../token-icon/token-icon.js";
|
|
6
|
+
import { SimpleTooltip as v } from "../tooltip/simple-tooltip.js";
|
|
7
|
+
import "../tooltip/tooltip.js";
|
|
8
|
+
import { FormattedMessageTyped as o } from "../typed-intl/index.js";
|
|
9
|
+
import { VerticalIndicator as i } from "../vertical-indicator/vertical-indicator.js";
|
|
10
|
+
import { VerticalList as a } from "../vertical-list/vertical-list.js";
|
|
11
|
+
import "react";
|
|
12
|
+
import { positiveTokenRewardsOf as P, pointProgramsOf as N, totalApyOf as A } from "../../utils/apy-breakdown.js";
|
|
13
|
+
import "@gearbox-protocol/sdk";
|
|
14
|
+
import { bpsToPercent as l } from "../../utils/bps.js";
|
|
15
|
+
import { cn as d } from "../../utils/cn.js";
|
|
16
|
+
import "sonner";
|
|
17
|
+
import { percentTemplate as m } from "../../utils/format-money.js";
|
|
18
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
19
|
+
import "luxon";
|
|
20
|
+
import "../../utils/z-index.js";
|
|
21
|
+
function D({ apy: s, children: c, className: n }) {
|
|
22
|
+
const f = P(s), p = N(s), b = /* @__PURE__ */ r(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: d(
|
|
26
|
+
"w-[370px] max-w-[calc(100vw-32px)] p-6",
|
|
27
|
+
"bg-popover",
|
|
28
|
+
"border border-border",
|
|
29
|
+
"rounded-lg",
|
|
30
|
+
"shadow-[0_4px_28px_4px_rgba(0,0,0,0.15)]",
|
|
31
|
+
"text-left font-normal"
|
|
32
|
+
),
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ r(a, { children: [
|
|
35
|
+
/* @__PURE__ */ e(
|
|
36
|
+
i,
|
|
37
|
+
{
|
|
38
|
+
size: "sm",
|
|
39
|
+
label: /* @__PURE__ */ e(
|
|
40
|
+
o,
|
|
41
|
+
{
|
|
42
|
+
messageId: "components.apyParts.supplyAPY"
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
description: /* @__PURE__ */ e(
|
|
46
|
+
o,
|
|
47
|
+
{
|
|
48
|
+
messageId: "components.apyParts.supplyAPY.tip"
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
value: m(l(s.organicApy))
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
f.map((t) => /* @__PURE__ */ e(
|
|
55
|
+
i,
|
|
56
|
+
{
|
|
57
|
+
size: "sm",
|
|
58
|
+
label: /* @__PURE__ */ r("span", { className: "inline-flex items-center", children: [
|
|
59
|
+
/* @__PURE__ */ e(
|
|
60
|
+
o,
|
|
61
|
+
{
|
|
62
|
+
messageId: "components.apyParts.extraAPY",
|
|
63
|
+
values: { symbol: t.token.symbol }
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ e("span", { className: "ml-1 inline-flex", children: /* @__PURE__ */ e(g, { token: t.token, size: 14 }) })
|
|
67
|
+
] }),
|
|
68
|
+
description: /* @__PURE__ */ e(
|
|
69
|
+
o,
|
|
70
|
+
{
|
|
71
|
+
messageId: "components.apyParts.extraAPY.tip"
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
value: m(l(t.supplyApr ?? 0))
|
|
75
|
+
},
|
|
76
|
+
`extra-${t.token.address}-${t.supplyApr ?? 0}`
|
|
77
|
+
))
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ e("div", { className: "my-5 border-t border-border" }),
|
|
80
|
+
/* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(
|
|
81
|
+
i,
|
|
82
|
+
{
|
|
83
|
+
size: "sm",
|
|
84
|
+
label: /* @__PURE__ */ e("span", { className: "font-bold", children: /* @__PURE__ */ e(
|
|
85
|
+
o,
|
|
86
|
+
{
|
|
87
|
+
messageId: "components.apyParts.totalAPY"
|
|
88
|
+
}
|
|
89
|
+
) }),
|
|
90
|
+
value: m(l(A(s)))
|
|
91
|
+
}
|
|
92
|
+
) }),
|
|
93
|
+
p.length > 0 && /* @__PURE__ */ r(x, { children: [
|
|
94
|
+
/* @__PURE__ */ e("div", { className: "relative my-2.5 mx-6 border-t-2 border-border", children: /* @__PURE__ */ e(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
className: d(
|
|
98
|
+
"absolute -top-2.5 left-1/2 -translate-x-1/2",
|
|
99
|
+
"w-5 h-5",
|
|
100
|
+
"flex items-center justify-center",
|
|
101
|
+
"rounded-full",
|
|
102
|
+
"bg-gray-20"
|
|
103
|
+
),
|
|
104
|
+
children: /* @__PURE__ */ e(h, { icon: u, className: "size-2.5 text-white" })
|
|
105
|
+
}
|
|
106
|
+
) }),
|
|
107
|
+
/* @__PURE__ */ e("div", { className: "h-6" }),
|
|
108
|
+
/* @__PURE__ */ e(a, { children: p.map((t) => /* @__PURE__ */ e(
|
|
109
|
+
i,
|
|
110
|
+
{
|
|
111
|
+
size: "sm",
|
|
112
|
+
label: /* @__PURE__ */ r("span", { className: "inline-flex items-center", children: [
|
|
113
|
+
/* @__PURE__ */ e(
|
|
114
|
+
o,
|
|
115
|
+
{
|
|
116
|
+
messageId: "components.apyParts.points",
|
|
117
|
+
values: { symbol: t.name }
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ e("span", { className: "ml-2 inline-flex", children: /* @__PURE__ */ e(
|
|
121
|
+
y,
|
|
122
|
+
{
|
|
123
|
+
reward: {
|
|
124
|
+
name: t.name,
|
|
125
|
+
type: t.id
|
|
126
|
+
},
|
|
127
|
+
size: 16
|
|
128
|
+
}
|
|
129
|
+
) })
|
|
130
|
+
] }),
|
|
131
|
+
value: t.multiplier != null ? `${t.multiplier}x` : "—"
|
|
132
|
+
},
|
|
133
|
+
`points-${t.id}`
|
|
134
|
+
)) })
|
|
135
|
+
] })
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
return /* @__PURE__ */ e(
|
|
140
|
+
v,
|
|
141
|
+
{
|
|
142
|
+
placement: "bottom",
|
|
143
|
+
triangle: !1,
|
|
144
|
+
type: "modal-tooltip",
|
|
145
|
+
minWidth: "100%",
|
|
146
|
+
maxWidth: "100%",
|
|
147
|
+
title: /* @__PURE__ */ e("span", { className: n, children: c }),
|
|
148
|
+
triggerClassName: n,
|
|
149
|
+
children: b
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
export {
|
|
154
|
+
D as ApyTooltip
|
|
155
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n, Fragment as b } from "react/jsx-runtime";
|
|
2
2
|
import { faPlus as P } from "@fortawesome/free-solid-svg-icons";
|
|
3
3
|
import { IconLighting as T } from "@gearbox-protocol/static";
|
|
4
|
-
import { getRewardTokenSymbol as k } from "../compound-apy/compound-apy.js";
|
|
4
|
+
import { getRewardTokenSymbol as k } from "../compound-apy/compound-apy-legacy.js";
|
|
5
5
|
import { FaIcon as S } from "../icons/fa-icon.js";
|
|
6
6
|
import { PointsIcon as _ } from "../points-icon/points-icon.js";
|
|
7
7
|
import { Skeleton as z } from "../skeleton/skeleton.js";
|
|
@@ -110,7 +110,7 @@ function oe({
|
|
|
110
110
|
/* @__PURE__ */ e("span", { className: "ml-1 inline-flex", children: /* @__PURE__ */ e(
|
|
111
111
|
C,
|
|
112
112
|
{
|
|
113
|
-
|
|
113
|
+
token: k(l, t.rewardTokenSymbol),
|
|
114
114
|
size: 14
|
|
115
115
|
}
|
|
116
116
|
) })
|
|
@@ -185,7 +185,7 @@ function oe({
|
|
|
185
185
|
"div",
|
|
186
186
|
{
|
|
187
187
|
className: u(
|
|
188
|
-
"absolute -top-[10px] left-
|
|
188
|
+
"absolute -top-[10px] left-1/2 -translate-x-1/2",
|
|
189
189
|
"w-5 h-5",
|
|
190
190
|
"flex items-center justify-center",
|
|
191
191
|
"rounded-full",
|
|
@@ -33,6 +33,7 @@ import "../avatar/avatar.js";
|
|
|
33
33
|
import "../badge/badge.js";
|
|
34
34
|
import "../base-link/base-link.js";
|
|
35
35
|
import "../navigation-context/navigation-context.js";
|
|
36
|
+
import "../breakpoint-provider.js";
|
|
36
37
|
import "../button-checkbox/button-checkbox.js";
|
|
37
38
|
import "../card-grid/card-grid.js";
|
|
38
39
|
import "../cards/card/card.js";
|
|
@@ -61,13 +62,12 @@ import "../dialog/dialog-modal-container.js";
|
|
|
61
62
|
import "../text-button/text-button.js";
|
|
62
63
|
import "../vertical-indicator/vertical-indicator.js";
|
|
63
64
|
import "../points-icon/points-icon.js";
|
|
64
|
-
import "../skeleton/skeleton.js";
|
|
65
65
|
import "../vertical-list/vertical-list.js";
|
|
66
|
+
import "../skeleton/skeleton.js";
|
|
66
67
|
import "../rounded-image/rounded-image.js";
|
|
67
68
|
import "../progress/progress.js";
|
|
68
69
|
import "../pool-indicator-icon/pool-indicator-icon.js";
|
|
69
70
|
import "../composites/strategies-table/components/feature/feature.styles.js";
|
|
70
|
-
import "viem";
|
|
71
71
|
import "../icon-button/icon-button.js";
|
|
72
72
|
import "../separate-line/separate-line.js";
|
|
73
73
|
import "../tip-card/tip-card.js";
|
|
@@ -89,6 +89,7 @@ import "../dialog/dialog-footer.js";
|
|
|
89
89
|
import "../dialog/dialog-header.js";
|
|
90
90
|
import "../dialog/dialog-title.js";
|
|
91
91
|
import "../dialog/dialog-overlay.js";
|
|
92
|
+
import "viem";
|
|
92
93
|
import "../label/label.js";
|
|
93
94
|
import "../dropdown-menu/dropdown-menu.js";
|
|
94
95
|
import "../dropdown-menu/dropdown-menu-checkbox-item.js";
|
|
@@ -1,80 +1,94 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as r, jsxs as R, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import N from "react";
|
|
3
3
|
import "@gearbox-protocol/sdk";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as T } from "../../utils/cn.js";
|
|
5
5
|
import "sonner";
|
|
6
6
|
import "@gearbox-protocol/sdk/common-utils";
|
|
7
|
-
import { getStatic as
|
|
7
|
+
import { getStatic as g } from "../../utils/static.js";
|
|
8
|
+
import { getTokenIcon as w } from "../../utils/token-icon-source.js";
|
|
8
9
|
import "luxon";
|
|
9
10
|
import "../../utils/z-index.js";
|
|
10
|
-
import { RoundedImage as
|
|
11
|
-
const s =
|
|
12
|
-
function
|
|
11
|
+
import { RoundedImage as u } from "../rounded-image/rounded-image.js";
|
|
12
|
+
const s = g("/tokens/default.svg");
|
|
13
|
+
function U(t) {
|
|
13
14
|
return t.replace("/", "").replace(" ", "").replace("-f", "").replace("-", "_").toLowerCase();
|
|
14
15
|
}
|
|
15
16
|
function j(t) {
|
|
16
17
|
return typeof t == "object" && t !== null && "icon" in t && !("kind" in t);
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function I(t) {
|
|
19
20
|
return typeof t == "object" && t !== null && "kind" in t && t.kind === "composite";
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function k(t) {
|
|
22
23
|
if (t.type === "url") return t.url;
|
|
23
|
-
const o =
|
|
24
|
-
return o ?
|
|
24
|
+
const o = U(t.symbol);
|
|
25
|
+
return o ? g(`/tokens/${o}.svg`) : s;
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
if (!t ||
|
|
27
|
+
function C(t) {
|
|
28
|
+
if (!t || I(t))
|
|
28
29
|
return s;
|
|
29
30
|
if (j(t))
|
|
30
31
|
return t.icon;
|
|
31
|
-
const o =
|
|
32
|
-
return o ?
|
|
32
|
+
const o = U(t);
|
|
33
|
+
return o ? g(`/tokens/${o}.svg`) : s;
|
|
33
34
|
}
|
|
34
35
|
function F(t) {
|
|
35
|
-
return t ?
|
|
36
|
+
return t ? I(t) ? t.layers.map(k) : [C(t)] : [s];
|
|
37
|
+
}
|
|
38
|
+
const L = 0.65;
|
|
39
|
+
function v(t, o) {
|
|
40
|
+
return t !== void 0 ? w(t) : typeof o == "string" ? w(o) : o;
|
|
36
41
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
42
|
+
const D = N.forwardRef(function({
|
|
43
|
+
token: o,
|
|
44
|
+
symbol: e,
|
|
45
|
+
size: n = 48,
|
|
46
|
+
fit: c = "contain",
|
|
47
|
+
rounded: a = !1,
|
|
48
|
+
className: l,
|
|
49
|
+
...f
|
|
50
|
+
}, m) {
|
|
51
|
+
const i = v(o, e);
|
|
52
|
+
if (I(i))
|
|
39
53
|
return /* @__PURE__ */ r(
|
|
40
|
-
|
|
54
|
+
S,
|
|
41
55
|
{
|
|
42
|
-
ref:
|
|
43
|
-
composite:
|
|
44
|
-
size:
|
|
45
|
-
fit:
|
|
46
|
-
rounded:
|
|
47
|
-
className:
|
|
56
|
+
ref: m,
|
|
57
|
+
composite: i,
|
|
58
|
+
size: n,
|
|
59
|
+
fit: c,
|
|
60
|
+
rounded: a,
|
|
61
|
+
className: l
|
|
48
62
|
}
|
|
49
63
|
);
|
|
50
|
-
const p =
|
|
64
|
+
const p = C(i);
|
|
51
65
|
return /* @__PURE__ */ r(
|
|
52
|
-
|
|
66
|
+
u,
|
|
53
67
|
{
|
|
54
|
-
ref:
|
|
55
|
-
className:
|
|
68
|
+
ref: m,
|
|
69
|
+
className: l,
|
|
56
70
|
src: p,
|
|
57
71
|
alt: "",
|
|
58
|
-
rounded:
|
|
59
|
-
fit:
|
|
60
|
-
width:
|
|
61
|
-
height:
|
|
62
|
-
size:
|
|
72
|
+
rounded: a,
|
|
73
|
+
fit: c,
|
|
74
|
+
width: n,
|
|
75
|
+
height: n,
|
|
76
|
+
size: n,
|
|
63
77
|
...f
|
|
64
78
|
}
|
|
65
79
|
);
|
|
66
|
-
}),
|
|
67
|
-
const { preset:
|
|
68
|
-
let
|
|
69
|
-
switch (
|
|
80
|
+
}), S = N.forwardRef(function({ composite: o, size: e, fit: n, rounded: c, className: a }, l) {
|
|
81
|
+
const { preset: f, layers: m, scaleFactor: i = L } = o, [p, b] = m, h = k(p), x = k(b), d = Math.round(e * i);
|
|
82
|
+
let y;
|
|
83
|
+
switch (f) {
|
|
70
84
|
case "centered_foreground":
|
|
71
|
-
|
|
85
|
+
y = /* @__PURE__ */ R(_, { children: [
|
|
72
86
|
/* @__PURE__ */ r(
|
|
73
|
-
|
|
87
|
+
u,
|
|
74
88
|
{
|
|
75
89
|
className: "absolute inset-0",
|
|
76
90
|
style: { zIndex: 0 },
|
|
77
|
-
src:
|
|
91
|
+
src: h,
|
|
78
92
|
alt: "background",
|
|
79
93
|
rounded: c,
|
|
80
94
|
fit: n,
|
|
@@ -84,22 +98,22 @@ const b = 0.65, L = w.forwardRef(function({ symbol: o, size: e = 48, fit: n = "c
|
|
|
84
98
|
/* @__PURE__ */ r(
|
|
85
99
|
"div",
|
|
86
100
|
{
|
|
87
|
-
className:
|
|
101
|
+
className: T(
|
|
88
102
|
"absolute left-1/2 top-1/2 z-[1] -translate-x-1/2 -translate-y-1/2",
|
|
89
103
|
"flex items-center justify-center"
|
|
90
104
|
),
|
|
91
105
|
style: {
|
|
92
|
-
width:
|
|
93
|
-
height:
|
|
106
|
+
width: d,
|
|
107
|
+
height: d
|
|
94
108
|
},
|
|
95
109
|
children: /* @__PURE__ */ r(
|
|
96
|
-
|
|
110
|
+
u,
|
|
97
111
|
{
|
|
98
|
-
src:
|
|
112
|
+
src: x,
|
|
99
113
|
alt: "foreground",
|
|
100
114
|
rounded: c,
|
|
101
115
|
fit: n,
|
|
102
|
-
size:
|
|
116
|
+
size: d
|
|
103
117
|
}
|
|
104
118
|
)
|
|
105
119
|
}
|
|
@@ -107,10 +121,10 @@ const b = 0.65, L = w.forwardRef(function({ symbol: o, size: e = 48, fit: n = "c
|
|
|
107
121
|
] });
|
|
108
122
|
break;
|
|
109
123
|
default:
|
|
110
|
-
return console.error("Unknown TokenIcon composite preset",
|
|
111
|
-
|
|
124
|
+
return console.error("Unknown TokenIcon composite preset", f), /* @__PURE__ */ r(
|
|
125
|
+
u,
|
|
112
126
|
{
|
|
113
|
-
src:
|
|
127
|
+
src: h,
|
|
114
128
|
alt: "error",
|
|
115
129
|
rounded: c,
|
|
116
130
|
fit: n,
|
|
@@ -121,16 +135,16 @@ const b = 0.65, L = w.forwardRef(function({ symbol: o, size: e = 48, fit: n = "c
|
|
|
121
135
|
return /* @__PURE__ */ r(
|
|
122
136
|
"div",
|
|
123
137
|
{
|
|
124
|
-
ref:
|
|
125
|
-
className:
|
|
138
|
+
ref: l,
|
|
139
|
+
className: T("relative inline-block shrink-0", a),
|
|
126
140
|
style: { width: e, height: e },
|
|
127
|
-
children:
|
|
141
|
+
children: y
|
|
128
142
|
}
|
|
129
143
|
);
|
|
130
144
|
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
function
|
|
145
|
+
S.displayName = "TokenIconComposite";
|
|
146
|
+
D.displayName = "TokenIcon";
|
|
147
|
+
function K(t) {
|
|
134
148
|
for (const o of t)
|
|
135
149
|
for (const e of F(o)) {
|
|
136
150
|
const n = new window.Image();
|
|
@@ -138,6 +152,6 @@ function B(t) {
|
|
|
138
152
|
}
|
|
139
153
|
}
|
|
140
154
|
export {
|
|
141
|
-
|
|
142
|
-
|
|
155
|
+
D as TokenIcon,
|
|
156
|
+
K as preloadTokenIcons
|
|
143
157
|
};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { jsxs as t, jsx as
|
|
2
|
-
import { cva as
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cva as v } from "class-variance-authority";
|
|
3
3
|
import N from "react";
|
|
4
4
|
import { RoundedImage as x } from "../rounded-image/rounded-image.js";
|
|
5
5
|
import { ShortString as S } from "../short-string/short-string.js";
|
|
6
|
-
import { TokenIcon as
|
|
7
|
-
import { SimpleTooltip as
|
|
6
|
+
import { TokenIcon as s } from "../token-icon/token-icon.js";
|
|
7
|
+
import { SimpleTooltip as T } from "../tooltip/simple-tooltip.js";
|
|
8
8
|
import "../tooltip/tooltip.js";
|
|
9
|
-
import { isIconComposite as b } from "../../types/common.js";
|
|
10
9
|
import "@gearbox-protocol/sdk";
|
|
11
|
-
import { cn as
|
|
10
|
+
import { cn as y } from "../../utils/cn.js";
|
|
12
11
|
import "sonner";
|
|
13
12
|
import "@gearbox-protocol/sdk/common-utils";
|
|
14
|
-
import { getNetworkIcon as
|
|
13
|
+
import { getNetworkIcon as I } from "../../utils/network-icons.js";
|
|
15
14
|
import "luxon";
|
|
16
15
|
import "../../utils/z-index.js";
|
|
17
|
-
const
|
|
16
|
+
const b = v("", {
|
|
18
17
|
variants: {
|
|
19
18
|
marginSize: {
|
|
20
19
|
sm: "gap-1",
|
|
@@ -26,83 +25,64 @@ const _ = y("", {
|
|
|
26
25
|
marginSize: "md"
|
|
27
26
|
}
|
|
28
27
|
});
|
|
29
|
-
function
|
|
30
|
-
if (r) {
|
|
31
|
-
if (typeof r == "string") return r;
|
|
32
|
-
if (r.icon !== void 0) {
|
|
33
|
-
if (typeof r.icon == "string")
|
|
34
|
-
return { icon: r.icon };
|
|
35
|
-
if (b(r.icon))
|
|
36
|
-
return r.icon;
|
|
37
|
-
}
|
|
38
|
-
return r.symbol;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function z(r) {
|
|
28
|
+
function R(r) {
|
|
42
29
|
if (r)
|
|
43
|
-
return typeof r == "string" ? r : r.title;
|
|
30
|
+
return typeof r == "string" ? r : "title" in r && r.title ? r.title : r.symbol;
|
|
44
31
|
}
|
|
45
|
-
const
|
|
32
|
+
const _ = N.forwardRef(
|
|
46
33
|
({
|
|
47
34
|
className: r,
|
|
48
|
-
marginSize:
|
|
49
|
-
token:
|
|
50
|
-
title:
|
|
51
|
-
size:
|
|
52
|
-
showSymbol:
|
|
35
|
+
marginSize: c = "lg",
|
|
36
|
+
token: m,
|
|
37
|
+
title: o,
|
|
38
|
+
size: a = 24,
|
|
39
|
+
showSymbol: d = !1,
|
|
53
40
|
showIcon: p = !0,
|
|
54
|
-
maxLength:
|
|
55
|
-
chainId:
|
|
56
|
-
comment:
|
|
57
|
-
network:
|
|
41
|
+
maxLength: f,
|
|
42
|
+
chainId: j,
|
|
43
|
+
comment: l,
|
|
44
|
+
network: i,
|
|
58
45
|
...g
|
|
59
|
-
},
|
|
60
|
-
const
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
46
|
+
}, u) => {
|
|
47
|
+
const h = o || R(m), n = () => i ? /* @__PURE__ */ t("div", { className: "relative", children: [
|
|
48
|
+
/* @__PURE__ */ e(
|
|
49
|
+
s,
|
|
63
50
|
{
|
|
64
|
-
|
|
65
|
-
size:
|
|
51
|
+
token: m,
|
|
52
|
+
size: a,
|
|
66
53
|
className: "shrink-0 self-center"
|
|
67
54
|
}
|
|
68
55
|
),
|
|
69
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ e("div", { className: "absolute -top-[10px] -right-[7px]", children: /* @__PURE__ */ e(
|
|
70
57
|
x,
|
|
71
58
|
{
|
|
72
|
-
src:
|
|
73
|
-
alt:
|
|
59
|
+
src: I(i),
|
|
60
|
+
alt: i,
|
|
74
61
|
size: 14,
|
|
75
62
|
rounded: !0
|
|
76
63
|
}
|
|
77
64
|
) })
|
|
78
|
-
] }) : /* @__PURE__ */
|
|
79
|
-
l,
|
|
80
|
-
{
|
|
81
|
-
symbol: o,
|
|
82
|
-
size: s,
|
|
83
|
-
className: "shrink-0 self-center"
|
|
84
|
-
}
|
|
85
|
-
);
|
|
65
|
+
] }) : /* @__PURE__ */ e(s, { token: m, size: a, className: "shrink-0 self-center" });
|
|
86
66
|
return /* @__PURE__ */ t(
|
|
87
67
|
"div",
|
|
88
68
|
{
|
|
89
|
-
ref:
|
|
90
|
-
className:
|
|
69
|
+
ref: u,
|
|
70
|
+
className: y(
|
|
91
71
|
"flex items-center",
|
|
92
|
-
|
|
72
|
+
b({ marginSize: c }),
|
|
93
73
|
r
|
|
94
74
|
),
|
|
95
75
|
...g,
|
|
96
76
|
children: [
|
|
97
|
-
p &&
|
|
77
|
+
p && m && (i !== void 0 ? /* @__PURE__ */ t(T, { title: n(), children: [
|
|
98
78
|
"Network: ",
|
|
99
|
-
|
|
100
|
-
] }) :
|
|
101
|
-
(
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
79
|
+
i
|
|
80
|
+
] }) : n()),
|
|
81
|
+
(o || d) && /* @__PURE__ */ t("div", { className: "flex items-center gap-1 self-center", children: [
|
|
82
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(S, { maxLength: f, children: h }) }),
|
|
83
|
+
l && /* @__PURE__ */ t("div", { className: "text-md text-muted-foreground leading-tight", children: [
|
|
104
84
|
"(",
|
|
105
|
-
|
|
85
|
+
l,
|
|
106
86
|
")"
|
|
107
87
|
] })
|
|
108
88
|
] })
|
|
@@ -111,8 +91,7 @@ const V = N.forwardRef(
|
|
|
111
91
|
);
|
|
112
92
|
}
|
|
113
93
|
);
|
|
114
|
-
|
|
94
|
+
_.displayName = "TokenSymbol";
|
|
115
95
|
export {
|
|
116
|
-
|
|
117
|
-
j as getSymbolOrIcon
|
|
96
|
+
_ as TokenSymbol
|
|
118
97
|
};
|