@gearbox-protocol/permissionless-ui 1.15.3 → 1.15.4
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/block-sync/block-sync.cjs +1 -1
- package/dist/cjs/components/buttons/copy-button/copy-button.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/graph/graph.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/layout/app-logo/app-logo.cjs +1 -1
- package/dist/cjs/components/liquidation/liquidation-assets-table/liquidation-assets-table.cjs +1 -1
- package/dist/cjs/components/liquidation/liquidation-graph/liquidation-graph.cjs +1 -1
- package/dist/cjs/components/next/index.cjs +1 -1
- package/dist/cjs/components/next/token-icon.cjs +1 -1
- package/dist/cjs/components/page-title/page-title.cjs +1 -1
- package/dist/cjs/components/select/select.cjs +1 -1
- package/dist/cjs/components/tab-control/tab-control.cjs +1 -1
- package/dist/cjs/components/table/grid-error-line.cjs +1 -1
- package/dist/cjs/components/token-icon/index.cjs +1 -1
- package/dist/cjs/components/token-icon/token-icon.cjs +1 -10
- package/dist/cjs/components/typed-intl/index.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/utils/format-number.cjs +1 -1
- package/dist/esm/components/block-sync/block-sync.js +61 -54
- package/dist/esm/components/buttons/copy-button/copy-button.js +60 -27
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +60 -37
- package/dist/esm/components/graph/graph.js +260 -301
- package/dist/esm/components/index.js +55 -54
- package/dist/esm/components/layout/app-logo/app-logo.js +4 -4
- package/dist/esm/components/layout/legal-disclaimer/legal-disclaimer.js +4 -1
- package/dist/esm/components/liquidation/liquidation-assets-table/liquidation-assets-table.js +24 -18
- package/dist/esm/components/liquidation/liquidation-graph/liquidation-graph.js +114 -100
- package/dist/esm/components/next/index.js +10 -8
- package/dist/esm/components/next/token-icon.js +4 -5
- package/dist/esm/components/page-title/page-title.js +1 -1
- package/dist/esm/components/select/select.js +7 -7
- package/dist/esm/components/tab-control/tab-control.js +24 -24
- package/dist/esm/components/table/grid-error-line.js +1 -1
- package/dist/esm/components/token-icon/index.js +3 -2
- package/dist/esm/components/token-icon/token-icon.js +42 -75
- package/dist/esm/components/typed-intl/index.js +13 -11
- package/dist/esm/components/with-copy/with-copy.js +52 -29
- package/dist/esm/index.js +169 -168
- package/dist/esm/utils/format-number.js +24 -21
- package/dist/globals.css +1 -1
- package/dist/types/components/buttons/copy-button/copy-button.d.ts +3 -2
- package/dist/types/components/detailed-page-title/detailed-page-title.d.ts +0 -1
- package/dist/types/components/layout/legal-disclaimer/legal-disclaimer.d.ts +1 -1
- package/dist/types/components/liquidation/liquidation-assets-table/liquidation-assets-table.d.ts +1 -1
- package/dist/types/components/next/index.d.ts +1 -0
- package/dist/types/components/next/token-icon.d.ts +2 -2
- package/dist/types/components/token-icon/index.d.ts +1 -1
- package/dist/types/components/token-icon/token-icon.d.ts +15 -3
- package/dist/types/components/typed-intl/index.d.ts +2 -1
- package/dist/types/components/with-copy/with-copy.d.ts +3 -3
- package/dist/types/utils/format-number.d.ts +0 -11
- package/package.json +1 -1
|
@@ -1,158 +1,172 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsx as e, jsxs as Y } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as F } from "react";
|
|
3
|
+
import { FormattedMessageTyped as Q } from "../../typed-intl/index.js";
|
|
4
|
+
import { VSpace as H } from "../../vspace/vspace.js";
|
|
5
|
+
import { useHF as Z } from "../../../hooks/use-hf.js";
|
|
6
|
+
import { useLiquidationHeatmap as ee } from "../../../hooks/use-liquidation/index.js";
|
|
7
|
+
import { XYPlot as ie, XAxis as te, YAxis as ae, ColorHeatmap as oe, XLine as ne, YLine as re } from "../../../utils/reactochart-compat.js";
|
|
8
|
+
import { LiquidationGraphLegend as se } from "../liquidation-graph-legend/liquidation-graph-legend.js";
|
|
9
|
+
import { LiquidationGraphTip as le } from "../liquidation-graph-tip/liquidation-graph-tip.js";
|
|
10
|
+
import { DEFAULT_AXIS_MIN as O, DEFAULT_AXIS_MAX as S, useLiquidationGraphCurrentActiveValue as ce, useWithLiquidationGraphActivePrices as me, useIsAxisInRelativeUnits as T, useLiquidationGraphActivePrice as D, formatAxisLabel as E, formatAxisTipLabel as G, getCellClass as de } from "../../../hooks/use-liquidation/utils.js";
|
|
11
|
+
const ue = 300, xe = 300, he = "rct-crosshair-x", pe = "rct-crosshair-y";
|
|
12
|
+
function Xe({
|
|
13
|
+
graphParams: R,
|
|
14
|
+
assets: f,
|
|
15
|
+
liquidationThresholds: L,
|
|
16
|
+
quotas: A,
|
|
17
|
+
quotasInfo: y,
|
|
18
|
+
underlyingToken: s,
|
|
19
|
+
debt: g,
|
|
19
20
|
prices: c,
|
|
20
21
|
tokensList: m,
|
|
21
|
-
width:
|
|
22
|
-
height:
|
|
23
|
-
maxLabelLength:
|
|
22
|
+
width: d = ue,
|
|
23
|
+
height: M = xe,
|
|
24
|
+
maxLabelLength: q
|
|
24
25
|
}) {
|
|
25
|
-
const { xAxis:
|
|
26
|
-
min:
|
|
27
|
-
max:
|
|
26
|
+
const { xAxis: u, yAxis: x, currentPoint: h } = R, {
|
|
27
|
+
min: b = O,
|
|
28
|
+
max: P = S,
|
|
28
29
|
label: t,
|
|
29
|
-
order:
|
|
30
|
-
nextOrder:
|
|
31
|
-
} =
|
|
30
|
+
order: p = "straight",
|
|
31
|
+
nextOrder: _
|
|
32
|
+
} = u || {}, {
|
|
32
33
|
min: C = O,
|
|
33
|
-
max: X =
|
|
34
|
+
max: X = S,
|
|
34
35
|
label: a,
|
|
35
|
-
order:
|
|
36
|
-
nextOrder:
|
|
37
|
-
} =
|
|
38
|
-
xMin:
|
|
39
|
-
xMax:
|
|
36
|
+
order: v = "straight",
|
|
37
|
+
nextOrder: k
|
|
38
|
+
} = x || {}, W = ee({
|
|
39
|
+
xMin: b,
|
|
40
|
+
xMax: P,
|
|
40
41
|
yMin: C,
|
|
41
42
|
yMax: X,
|
|
42
43
|
xLabel: t,
|
|
43
44
|
yLabel: a,
|
|
44
|
-
assets:
|
|
45
|
-
quotas:
|
|
45
|
+
assets: f,
|
|
46
|
+
quotas: A,
|
|
46
47
|
prices: c,
|
|
47
|
-
liquidationThresholds:
|
|
48
|
-
underlyingTokenAddress:
|
|
49
|
-
debt:
|
|
50
|
-
quotasInfo:
|
|
48
|
+
liquidationThresholds: L,
|
|
49
|
+
underlyingTokenAddress: s,
|
|
50
|
+
debt: g,
|
|
51
|
+
quotasInfo: y,
|
|
51
52
|
tokensList: m
|
|
52
|
-
}), { activePoint:
|
|
53
|
+
}), { activePoint: w, handleMouseLeave: j, handleMouseMove: U } = ce(), [o, n] = w || [], $ = me({
|
|
53
54
|
prices: c,
|
|
54
|
-
activePoint:
|
|
55
|
+
activePoint: w,
|
|
55
56
|
xLabel: t,
|
|
56
57
|
yLabel: a
|
|
57
|
-
}),
|
|
58
|
-
quotas:
|
|
59
|
-
quotasInfo:
|
|
60
|
-
assets:
|
|
61
|
-
prices:
|
|
62
|
-
liquidationThresholds:
|
|
63
|
-
underlyingToken:
|
|
64
|
-
debt:
|
|
58
|
+
}), V = Z({
|
|
59
|
+
quotas: A,
|
|
60
|
+
quotasInfo: y,
|
|
61
|
+
assets: f,
|
|
62
|
+
prices: $,
|
|
63
|
+
liquidationThresholds: L,
|
|
64
|
+
underlyingToken: s,
|
|
65
|
+
debt: g,
|
|
65
66
|
tokensList: m
|
|
66
|
-
}),
|
|
67
|
-
o ||
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
), B =
|
|
72
|
-
n ||
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
), J =
|
|
77
|
-
|
|
67
|
+
}), l = c[s] || 1n, r = m[s], N = T(t, r), I = T(a, r), z = D(
|
|
68
|
+
o || h[0],
|
|
69
|
+
l,
|
|
70
|
+
N,
|
|
71
|
+
p
|
|
72
|
+
), B = D(
|
|
73
|
+
n || h[1],
|
|
74
|
+
l,
|
|
75
|
+
I,
|
|
76
|
+
v
|
|
77
|
+
), J = F(
|
|
78
|
+
E(l, N, p),
|
|
78
79
|
[]
|
|
79
|
-
), K =
|
|
80
|
-
|
|
80
|
+
), K = F(
|
|
81
|
+
E(l, I, v),
|
|
81
82
|
[]
|
|
82
83
|
);
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
return !u?.label && !x?.label ? /* @__PURE__ */ e(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: "mx-auto flex items-center justify-center text-sm text-muted-foreground",
|
|
88
|
+
style: { width: `${d}px`, maxWidth: "100%", height: `${M}px` },
|
|
89
|
+
children: /* @__PURE__ */ e(
|
|
90
|
+
Q,
|
|
91
|
+
{
|
|
92
|
+
messageId: "components.creditSessionDetailedLiquidation.graph.noData",
|
|
93
|
+
defaultMessage: "No data"
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
) : /* @__PURE__ */ Y("div", { className: "mx-auto", style: { width: `${d}px`, maxWidth: "100%" }, children: [
|
|
98
|
+
/* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ e(
|
|
99
|
+
le,
|
|
86
100
|
{
|
|
87
101
|
underlyingToken: r,
|
|
88
|
-
hf:
|
|
89
|
-
xAxis:
|
|
90
|
-
yAxis:
|
|
102
|
+
hf: V.hf,
|
|
103
|
+
xAxis: u,
|
|
104
|
+
yAxis: x,
|
|
91
105
|
activePointX: z,
|
|
92
106
|
activePointY: B,
|
|
93
|
-
maxLabelLength:
|
|
107
|
+
maxLabelLength: q
|
|
94
108
|
}
|
|
95
109
|
) }),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
110
|
+
/* @__PURE__ */ e(H, { height: 16 }),
|
|
111
|
+
/* @__PURE__ */ e("div", { className: "w-full liquidation-graph-container overflow-hidden", children: /* @__PURE__ */ Y(
|
|
112
|
+
ie,
|
|
99
113
|
{
|
|
100
|
-
width:
|
|
101
|
-
height:
|
|
102
|
-
xDomain: [
|
|
114
|
+
width: d,
|
|
115
|
+
height: M,
|
|
116
|
+
xDomain: [b, P],
|
|
103
117
|
yDomain: [C, X],
|
|
104
|
-
onMouseMove:
|
|
105
|
-
onMouseLeave:
|
|
118
|
+
onMouseMove: U,
|
|
119
|
+
onMouseLeave: j,
|
|
106
120
|
children: [
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
121
|
+
/* @__PURE__ */ e(
|
|
122
|
+
te,
|
|
109
123
|
{
|
|
110
124
|
showLine: !1,
|
|
111
|
-
title:
|
|
125
|
+
title: G(t, r, p),
|
|
112
126
|
titleAlign: "right",
|
|
113
127
|
tickCount: 5,
|
|
114
128
|
labelFormat: J,
|
|
115
129
|
showLabels: !!t,
|
|
116
130
|
showTicks: !!t,
|
|
117
|
-
onMouseClickAxis:
|
|
131
|
+
onMouseClickAxis: _,
|
|
118
132
|
nice: !1
|
|
119
133
|
}
|
|
120
134
|
),
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
|
|
135
|
+
/* @__PURE__ */ e(
|
|
136
|
+
ae,
|
|
123
137
|
{
|
|
124
138
|
showLine: !1,
|
|
125
|
-
title:
|
|
139
|
+
title: G(a, r, v),
|
|
126
140
|
titleAlign: "top",
|
|
127
141
|
tickCount: 5,
|
|
128
142
|
labelFormat: K,
|
|
129
143
|
showLabels: !!a,
|
|
130
144
|
showTicks: !!a,
|
|
131
|
-
onMouseClickAxis:
|
|
145
|
+
onMouseClickAxis: k,
|
|
132
146
|
nice: !1
|
|
133
147
|
}
|
|
134
148
|
),
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
149
|
+
/* @__PURE__ */ e(
|
|
150
|
+
oe,
|
|
137
151
|
{
|
|
138
|
-
data:
|
|
139
|
-
value: (
|
|
140
|
-
x: (
|
|
141
|
-
xEnd: (
|
|
142
|
-
y: (
|
|
143
|
-
yEnd: (
|
|
144
|
-
rectClassName: (
|
|
152
|
+
data: W,
|
|
153
|
+
value: (i) => i.value,
|
|
154
|
+
x: (i) => i.x,
|
|
155
|
+
xEnd: (i) => i.xEnd,
|
|
156
|
+
y: (i) => i.y,
|
|
157
|
+
yEnd: (i) => i.yEnd,
|
|
158
|
+
rectClassName: (i) => de(i, h, o, n)
|
|
145
159
|
}
|
|
146
160
|
),
|
|
147
|
-
o != null && /* @__PURE__ */
|
|
148
|
-
n != null && /* @__PURE__ */
|
|
161
|
+
o != null && /* @__PURE__ */ e(ne, { value: o, className: he }),
|
|
162
|
+
n != null && /* @__PURE__ */ e(re, { value: n, className: pe })
|
|
149
163
|
]
|
|
150
164
|
}
|
|
151
165
|
) }),
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ e(H, { height: 12 }),
|
|
167
|
+
/* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ e(se, {}) })
|
|
154
168
|
] });
|
|
155
169
|
}
|
|
156
170
|
export {
|
|
157
|
-
|
|
171
|
+
Xe as LiquidationGraph
|
|
158
172
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { SignInRequired as e } from "../auth/signin-required.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { preloadTokenIcons as n } from "../token-icon/token-icon.js";
|
|
3
|
+
import { BackButton as x } from "./back-button.js";
|
|
4
|
+
import { NextMarkdownViewer as m } from "./next-markdown-viewer.js";
|
|
5
|
+
import { SIWEClientProvider as d } from "./siwe-provider.js";
|
|
6
|
+
import { TokenIcon as I } from "./token-icon.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
x as BackButton,
|
|
9
|
+
m as NextMarkdownViewer,
|
|
10
|
+
d as SIWEClientProvider,
|
|
10
11
|
e as SignInRequired,
|
|
11
|
-
|
|
12
|
+
I as TokenIcon,
|
|
13
|
+
n as preloadTokenIcons
|
|
12
14
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return /* @__PURE__ */ n(m, { ...o, ImageComponent: e });
|
|
2
|
+
import { TokenIcon as r } from "../token-icon/token-icon.js";
|
|
3
|
+
function c(o) {
|
|
4
|
+
return /* @__PURE__ */ n(r, { ...o });
|
|
6
5
|
}
|
|
7
6
|
export {
|
|
8
|
-
|
|
7
|
+
c as TokenIcon
|
|
9
8
|
};
|
|
@@ -69,7 +69,7 @@ const h = s(
|
|
|
69
69
|
m && /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground mt-1", children: m })
|
|
70
70
|
] })
|
|
71
71
|
] }),
|
|
72
|
-
i && /* @__PURE__ */ e("div", { className: "shrink-0 flex items-center gap-2
|
|
72
|
+
i && /* @__PURE__ */ e("div", { className: "shrink-0 flex items-center gap-2 md:ml-auto", children: i })
|
|
73
73
|
] }) })
|
|
74
74
|
] })
|
|
75
75
|
);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as e from "@radix-ui/react-select";
|
|
3
3
|
import { cva as u } from "class-variance-authority";
|
|
4
|
-
import { ChevronDown as c, ChevronUp as h, Check as
|
|
4
|
+
import { ChevronDown as c, ChevronUp as h, Check as g } from "lucide-react";
|
|
5
5
|
import * as l from "react";
|
|
6
6
|
import { cn as s } from "../../utils/cn.js";
|
|
7
7
|
import "sonner";
|
|
8
8
|
import "@gearbox-protocol/sdk";
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const b = (a) => /* @__PURE__ */ t(e.Root, { ...a });
|
|
10
|
+
b.displayName = "Select";
|
|
11
11
|
const T = e.Group, V = e.Value, y = u(
|
|
12
|
-
"flex w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 bg-[rgb(40,40,40)] text-foreground cursor-pointer",
|
|
12
|
+
"group flex w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 bg-[rgb(40,40,40)] text-foreground cursor-pointer",
|
|
13
13
|
{
|
|
14
14
|
variants: {
|
|
15
15
|
size: {
|
|
@@ -36,7 +36,7 @@ const T = e.Group, V = e.Value, y = u(
|
|
|
36
36
|
...n,
|
|
37
37
|
children: [
|
|
38
38
|
o,
|
|
39
|
-
/* @__PURE__ */ t(e.Icon, { asChild: !0, children: /* @__PURE__ */ t(c, { className: "h-4 w-4 opacity-50" }) })
|
|
39
|
+
/* @__PURE__ */ t(e.Icon, { asChild: !0, children: /* @__PURE__ */ t(c, { className: "h-4 w-4 opacity-50 transition-transform duration-200 group-data-[state=open]:rotate-180" }) })
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
));
|
|
@@ -114,7 +114,7 @@ const S = l.forwardRef(({ className: a, children: o, ...r }, d) => /* @__PURE__
|
|
|
114
114
|
),
|
|
115
115
|
...r,
|
|
116
116
|
children: [
|
|
117
|
-
/* @__PURE__ */ t("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t(e.ItemIndicator, { children: /* @__PURE__ */ t(
|
|
117
|
+
/* @__PURE__ */ t("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t(e.ItemIndicator, { children: /* @__PURE__ */ t(g, { className: "h-4 w-4" }) }) }),
|
|
118
118
|
/* @__PURE__ */ t(e.ItemText, { children: o })
|
|
119
119
|
]
|
|
120
120
|
}
|
|
@@ -130,7 +130,7 @@ const v = l.forwardRef(({ className: a, ...o }, r) => /* @__PURE__ */ t(
|
|
|
130
130
|
));
|
|
131
131
|
v.displayName = e.Separator.displayName;
|
|
132
132
|
export {
|
|
133
|
-
|
|
133
|
+
b as Select,
|
|
134
134
|
x as SelectContent,
|
|
135
135
|
T as SelectGroup,
|
|
136
136
|
S as SelectItem,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as f, jsxs as C, Fragment as S } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as h, useState as v, useCallback as m, useMemo as w, useEffect as T } from "react";
|
|
3
3
|
import { useLocation as U, useNavigate as N } from "react-router-dom";
|
|
4
4
|
import { cn as b } from "../../utils/cn.js";
|
|
@@ -44,27 +44,27 @@ function q({
|
|
|
44
44
|
c.current,
|
|
45
45
|
d
|
|
46
46
|
), e = (n, a) => () => t.handleTabChange(n, a);
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
47
|
+
return /* @__PURE__ */ f("div", { className: "relative w-full flex flex-col border-b border-border", children: /* @__PURE__ */ C(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
ref: c,
|
|
51
|
+
className: b(
|
|
52
|
+
"relative bottom-[-1px] flex items-stretch gap-3 overflow-x-auto overflow-y-hidden w-full",
|
|
53
|
+
"navbar-scrollbar",
|
|
54
|
+
i && "border-b border-border"
|
|
55
|
+
),
|
|
56
|
+
children: [
|
|
57
|
+
l && /* @__PURE__ */ f(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: "absolute bottom-[-1px] left-0 h-[3px] bg-primary transition-transform duration-200 ease-in-out pointer-events-none",
|
|
61
|
+
style: {
|
|
62
|
+
width: `${l.width}px`,
|
|
63
|
+
transform: `translate(${l.left}px)`
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
66
|
),
|
|
67
|
-
|
|
67
|
+
r.map((n, a, u) => {
|
|
68
68
|
const p = n.id === t.id, x = a === u.length - 1;
|
|
69
69
|
return /* @__PURE__ */ f(
|
|
70
70
|
"button",
|
|
@@ -88,9 +88,9 @@ function q({
|
|
|
88
88
|
`tab-item-${n.id}`
|
|
89
89
|
);
|
|
90
90
|
})
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
) });
|
|
94
94
|
}
|
|
95
95
|
function B({
|
|
96
96
|
icon: r,
|
|
@@ -1,80 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
e
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
height: t,
|
|
31
|
-
borderRadius: "50%",
|
|
32
|
-
backgroundColor: "#9ca3af",
|
|
33
|
-
position: "absolute",
|
|
34
|
-
top: 0,
|
|
35
|
-
left: 0,
|
|
36
|
-
animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
/* @__PURE__ */ o(
|
|
41
|
-
"div",
|
|
42
|
-
{
|
|
43
|
-
style: {
|
|
44
|
-
width: t,
|
|
45
|
-
height: t,
|
|
46
|
-
position: "relative",
|
|
47
|
-
opacity: e ? 0 : 1,
|
|
48
|
-
transition: "opacity 0.3s ease-in-out"
|
|
49
|
-
},
|
|
50
|
-
children: /* @__PURE__ */ o(
|
|
51
|
-
n,
|
|
52
|
-
{
|
|
53
|
-
src: l,
|
|
54
|
-
alt: "",
|
|
55
|
-
width: t,
|
|
56
|
-
height: t,
|
|
57
|
-
className: u("w-full h-full object-contain block", r),
|
|
58
|
-
onError: () => p(c),
|
|
59
|
-
onLoad: () => d(!1)
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
}
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as s, useRef as h } from "react";
|
|
3
|
+
import { cn as m } from "../../utils/cn.js";
|
|
4
|
+
const a = "https://static.gearbox.fi/tokens/default.svg", i = /* @__PURE__ */ new Set();
|
|
5
|
+
function w(t) {
|
|
6
|
+
const e = t.replace("/", "").replace(" ", "").replace("-f", "").replace("-", "_").toLowerCase();
|
|
7
|
+
if (!e) return a;
|
|
8
|
+
const r = `https://static.gearbox.fi/tokens/${e}.svg`;
|
|
9
|
+
return i.has(r) ? a : r;
|
|
10
|
+
}
|
|
11
|
+
function I({ symbol: t, size: e = 48, className: r }) {
|
|
12
|
+
const n = w(t), [o, l] = s(n), [f, d] = s(!1), c = h(!1), u = () => {
|
|
13
|
+
c.current || (c.current = !0, i.add(o), l(a));
|
|
14
|
+
}, g = () => {
|
|
15
|
+
d(!0);
|
|
16
|
+
};
|
|
17
|
+
return (
|
|
18
|
+
// biome-ignore lint/performance/noImgElement: Simple img for CDN icons with browser caching
|
|
19
|
+
/* @__PURE__ */ p(
|
|
20
|
+
"img",
|
|
21
|
+
{
|
|
22
|
+
src: o,
|
|
23
|
+
alt: "",
|
|
24
|
+
width: e,
|
|
25
|
+
height: e,
|
|
26
|
+
className: m(
|
|
27
|
+
"object-contain rounded-full",
|
|
28
|
+
!f && "bg-gray-200 dark:bg-gray-700",
|
|
29
|
+
r
|
|
63
30
|
),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
50% {
|
|
70
|
-
opacity: 0.5;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
` })
|
|
74
|
-
]
|
|
75
|
-
}
|
|
31
|
+
style: { width: e, height: e },
|
|
32
|
+
onError: u,
|
|
33
|
+
onLoad: g
|
|
34
|
+
}
|
|
35
|
+
)
|
|
76
36
|
);
|
|
77
37
|
}
|
|
38
|
+
function x(t) {
|
|
39
|
+
t.forEach((e) => {
|
|
40
|
+
const n = `https://static.gearbox.fi/tokens/${e.replace("/", "").replace(" ", "").replace("-f", "").replace("-", "_").toLowerCase()}.svg`, o = new window.Image();
|
|
41
|
+
o.src = n;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
78
44
|
export {
|
|
79
|
-
|
|
45
|
+
I as TokenIcon,
|
|
46
|
+
x as preloadTokenIcons
|
|
80
47
|
};
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { FormattedMessage as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as a, useMemo as i } from "react";
|
|
3
|
+
import { FormattedMessage as m, useIntl as d } from "react-intl";
|
|
4
|
+
const l = (e) => /* @__PURE__ */ r("strong", { children: e });
|
|
5
5
|
function f({
|
|
6
6
|
messageId: e,
|
|
7
|
-
values: t
|
|
7
|
+
values: t,
|
|
8
|
+
defaultMessage: o
|
|
8
9
|
}) {
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
|
|
10
|
+
return /* @__PURE__ */ r(
|
|
11
|
+
m,
|
|
11
12
|
{
|
|
12
13
|
id: e,
|
|
13
|
-
|
|
14
|
+
defaultMessage: o,
|
|
15
|
+
values: { strong: l, ...t }
|
|
14
16
|
}
|
|
15
17
|
);
|
|
16
18
|
}
|
|
17
19
|
function g() {
|
|
18
|
-
const e =
|
|
19
|
-
({ messageId:
|
|
20
|
+
const e = d(), t = a(
|
|
21
|
+
({ messageId: n }, s) => e.formatMessage({ id: n }, s),
|
|
20
22
|
[e]
|
|
21
23
|
);
|
|
22
|
-
return
|
|
24
|
+
return i(
|
|
23
25
|
() => ({ formatMessage: t, intl: e }),
|
|
24
26
|
[e, t]
|
|
25
27
|
);
|