@gearbox-protocol/ui-kit 3.12.2 → 3.13.0
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/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/rounded-image/rounded-image.cjs +1 -1
- package/dist/cjs/components/token-icon/token-icon.cjs +1 -1
- package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
- package/dist/cjs/types/common.cjs +1 -1
- package/dist/esm/components/compound-apy/compound-apy.js +71 -68
- package/dist/esm/components/rounded-image/rounded-image.js +16 -16
- package/dist/esm/components/token-icon/token-icon.js +134 -44
- package/dist/esm/components/token-symbol/token-symbol.js +55 -46
- package/dist/esm/types/common.js +6 -1
- package/dist/globals.css +1 -1
- package/dist/types/components/compound-apy/compound-apy.d.ts +1 -3
- package/dist/types/components/help-tip/help-tip.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 +8 -3
- package/dist/types/types/common.d.ts +11 -1
- package/package.json +2 -2
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { jsxs as t, jsx as
|
|
2
|
-
import { cva as
|
|
3
|
-
import
|
|
4
|
-
import { RoundedImage as
|
|
1
|
+
import { jsxs as t, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { cva as y } from "class-variance-authority";
|
|
3
|
+
import N from "react";
|
|
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 l } from "../token-icon/token-icon.js";
|
|
7
|
+
import { SimpleTooltip as I } from "../tooltip/simple-tooltip.js";
|
|
8
8
|
import "../tooltip/tooltip.js";
|
|
9
|
+
import { isIconComposite as b } from "../../types/common.js";
|
|
9
10
|
import "@gearbox-protocol/sdk";
|
|
10
|
-
import { cn as
|
|
11
|
+
import { cn as T } from "../../utils/cn.js";
|
|
11
12
|
import "sonner";
|
|
12
13
|
import "@gearbox-protocol/sdk/common-utils";
|
|
13
|
-
import { getNetworkIcon as
|
|
14
|
+
import { getNetworkIcon as R } from "../../utils/network-icons.js";
|
|
14
15
|
import "luxon";
|
|
15
16
|
import "../../utils/z-index.js";
|
|
16
|
-
const
|
|
17
|
+
const _ = y("", {
|
|
17
18
|
variants: {
|
|
18
19
|
marginSize: {
|
|
19
20
|
sm: "gap-1",
|
|
@@ -25,52 +26,60 @@ const R = N("", {
|
|
|
25
26
|
marginSize: "md"
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
|
-
function _(r) {
|
|
29
|
-
if (r)
|
|
30
|
-
return typeof r == "string" ? r : r.icon ? { icon: r.icon } : r.symbol;
|
|
31
|
-
}
|
|
32
29
|
function j(r) {
|
|
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) {
|
|
33
42
|
if (r)
|
|
34
43
|
return typeof r == "string" ? r : r.title;
|
|
35
44
|
}
|
|
36
|
-
const
|
|
45
|
+
const V = N.forwardRef(
|
|
37
46
|
({
|
|
38
47
|
className: r,
|
|
39
48
|
marginSize: d = "lg",
|
|
40
|
-
token:
|
|
41
|
-
title:
|
|
42
|
-
size:
|
|
49
|
+
token: n,
|
|
50
|
+
title: m,
|
|
51
|
+
size: s = 24,
|
|
43
52
|
showSymbol: f = !1,
|
|
44
53
|
showIcon: p = !0,
|
|
45
|
-
maxLength:
|
|
46
|
-
chainId:
|
|
47
|
-
comment:
|
|
48
|
-
network:
|
|
49
|
-
...
|
|
54
|
+
maxLength: u,
|
|
55
|
+
chainId: C,
|
|
56
|
+
comment: c,
|
|
57
|
+
network: e,
|
|
58
|
+
...g
|
|
50
59
|
}, h) => {
|
|
51
|
-
const o =
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
60
|
+
const o = j(n), v = m || z(n), a = () => e ? /* @__PURE__ */ t("div", { className: "relative", children: [
|
|
61
|
+
/* @__PURE__ */ i(
|
|
62
|
+
l,
|
|
54
63
|
{
|
|
55
64
|
symbol: o,
|
|
56
|
-
size:
|
|
65
|
+
size: s,
|
|
57
66
|
className: "shrink-0 self-center"
|
|
58
67
|
}
|
|
59
68
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
69
|
+
/* @__PURE__ */ i("div", { className: "absolute -top-[10px] -right-[7px]", children: /* @__PURE__ */ i(
|
|
70
|
+
x,
|
|
62
71
|
{
|
|
63
|
-
src:
|
|
64
|
-
alt:
|
|
72
|
+
src: R(e),
|
|
73
|
+
alt: e,
|
|
65
74
|
size: 14,
|
|
66
75
|
rounded: !0
|
|
67
76
|
}
|
|
68
77
|
) })
|
|
69
|
-
] }) : /* @__PURE__ */
|
|
70
|
-
|
|
78
|
+
] }) : /* @__PURE__ */ i(
|
|
79
|
+
l,
|
|
71
80
|
{
|
|
72
81
|
symbol: o,
|
|
73
|
-
size:
|
|
82
|
+
size: s,
|
|
74
83
|
className: "shrink-0 self-center"
|
|
75
84
|
}
|
|
76
85
|
);
|
|
@@ -78,22 +87,22 @@ const z = x.forwardRef(
|
|
|
78
87
|
"div",
|
|
79
88
|
{
|
|
80
89
|
ref: h,
|
|
81
|
-
className:
|
|
90
|
+
className: T(
|
|
82
91
|
"flex items-center",
|
|
83
|
-
|
|
92
|
+
_({ marginSize: d }),
|
|
84
93
|
r
|
|
85
94
|
),
|
|
86
|
-
...
|
|
95
|
+
...g,
|
|
87
96
|
children: [
|
|
88
|
-
p && o && (
|
|
97
|
+
p && o && (e !== void 0 ? /* @__PURE__ */ t(I, { title: a(), children: [
|
|
89
98
|
"Network: ",
|
|
90
|
-
|
|
91
|
-
] }) :
|
|
92
|
-
(
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
99
|
+
e
|
|
100
|
+
] }) : a()),
|
|
101
|
+
(m || f) && /* @__PURE__ */ t("div", { className: "flex items-center gap-1 self-center", children: [
|
|
102
|
+
/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(S, { maxLength: u, children: v }) }),
|
|
103
|
+
c && /* @__PURE__ */ t("div", { className: "text-md text-muted-foreground leading-tight", children: [
|
|
95
104
|
"(",
|
|
96
|
-
|
|
105
|
+
c,
|
|
97
106
|
")"
|
|
98
107
|
] })
|
|
99
108
|
] })
|
|
@@ -102,8 +111,8 @@ const z = x.forwardRef(
|
|
|
102
111
|
);
|
|
103
112
|
}
|
|
104
113
|
);
|
|
105
|
-
|
|
114
|
+
V.displayName = "TokenSymbol";
|
|
106
115
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
116
|
+
V as TokenSymbol,
|
|
117
|
+
j as getSymbolOrIcon
|
|
109
118
|
};
|