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