@gearbox-protocol/permissionless-ui 1.22.0-next.7 → 1.22.0-next.9
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/index.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/index.cjs +1 -0
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -0
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/layout/app-logo/app-logo.cjs +1 -1
- package/dist/cjs/components/points-icon/points-icon.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/index.cjs +1 -1
- package/dist/cjs/utils/search-in-token.cjs +1 -1
- package/dist/cjs/utils/static.cjs +1 -0
- package/dist/esm/components/checkbox/checkbox-labeled.js +2 -0
- package/dist/esm/components/client-adapters/index.js +4 -2
- package/dist/esm/components/client-adapters/styled-rounded-image/index.js +4 -0
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +132 -0
- package/dist/esm/components/index.js +466 -464
- package/dist/esm/components/layout/app-logo/app-logo.js +8 -7
- package/dist/esm/components/points-icon/points-icon.js +23 -22
- package/dist/esm/components/rounded-image/rounded-image.js +53 -27
- package/dist/esm/components/token-icon/token-icon.js +16 -15
- package/dist/esm/index.js +595 -593
- package/dist/esm/utils/search-in-token.js +8 -8
- package/dist/esm/utils/static.js +5 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/client-adapters/index.d.ts +1 -0
- package/dist/types/components/client-adapters/styled-rounded-image/index.d.ts +1 -0
- package/dist/types/components/client-adapters/styled-rounded-image/styled-rounded-image.d.ts +9 -0
- package/dist/types/components/rounded-image/rounded-image.d.ts +13 -4
- package/dist/types/utils/static.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Image as r } from "../../image/image.js";
|
|
3
3
|
import { cn as o } from "../../../utils/cn.js";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { getStatic as l } from "../../../utils/static.js";
|
|
5
|
+
function p({
|
|
6
|
+
appName: m,
|
|
6
7
|
size: t = "default"
|
|
7
8
|
}) {
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ a(
|
|
9
10
|
"div",
|
|
10
11
|
{
|
|
11
12
|
className: o(
|
|
@@ -16,7 +17,7 @@ function d({
|
|
|
16
17
|
/* @__PURE__ */ e(
|
|
17
18
|
r,
|
|
18
19
|
{
|
|
19
|
-
src: "
|
|
20
|
+
src: l("/logo/logo_monochrome_white@2x.png"),
|
|
20
21
|
alt: "Gearbox Protocol",
|
|
21
22
|
width: t === "default" ? 120 : 100,
|
|
22
23
|
height: t === "default" ? 24 : 20,
|
|
@@ -27,11 +28,11 @@ function d({
|
|
|
27
28
|
)
|
|
28
29
|
}
|
|
29
30
|
),
|
|
30
|
-
/* @__PURE__ */ e("span", { className: "text-muted-foreground whitespace-nowrap", children:
|
|
31
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground whitespace-nowrap", children: m })
|
|
31
32
|
]
|
|
32
33
|
}
|
|
33
34
|
);
|
|
34
35
|
}
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
p as AppLogo
|
|
37
38
|
};
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import * as p from "react";
|
|
3
3
|
import { cn as f } from "../../utils/cn.js";
|
|
4
4
|
import "sonner";
|
|
5
5
|
import "@gearbox-protocol/sdk";
|
|
6
|
-
|
|
6
|
+
import { STATIC_SERVER as l } from "../../utils/static.js";
|
|
7
|
+
const h = p.forwardRef(
|
|
7
8
|
({
|
|
8
|
-
reward:
|
|
9
|
-
size:
|
|
10
|
-
staticBaseUrl:
|
|
11
|
-
rounded:
|
|
12
|
-
className:
|
|
13
|
-
style:
|
|
14
|
-
...
|
|
15
|
-
},
|
|
16
|
-
const
|
|
9
|
+
reward: t,
|
|
10
|
+
size: o = 24,
|
|
11
|
+
staticBaseUrl: r = l,
|
|
12
|
+
rounded: i = !1,
|
|
13
|
+
className: m,
|
|
14
|
+
style: n,
|
|
15
|
+
...e
|
|
16
|
+
}, s) => {
|
|
17
|
+
const a = `${r}/points/${t.type.toLowerCase()}.svg`;
|
|
17
18
|
return (
|
|
18
19
|
// biome-ignore lint/performance/noImgElement: External SVG icons from CDN
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ c(
|
|
20
21
|
"img",
|
|
21
22
|
{
|
|
22
|
-
ref:
|
|
23
|
-
src:
|
|
24
|
-
alt:
|
|
25
|
-
width:
|
|
26
|
-
height:
|
|
27
|
-
className: f(
|
|
23
|
+
ref: s,
|
|
24
|
+
src: a,
|
|
25
|
+
alt: t.name,
|
|
26
|
+
width: o,
|
|
27
|
+
height: o,
|
|
28
|
+
className: f(i && "rounded-full", m),
|
|
28
29
|
style: {
|
|
29
|
-
width:
|
|
30
|
-
height:
|
|
30
|
+
width: o,
|
|
31
|
+
height: o,
|
|
31
32
|
objectFit: "contain",
|
|
32
|
-
...
|
|
33
|
+
...n
|
|
33
34
|
},
|
|
34
|
-
...
|
|
35
|
+
...e
|
|
35
36
|
}
|
|
36
37
|
)
|
|
37
38
|
);
|
|
@@ -1,32 +1,58 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import "react";
|
|
3
|
-
import { cn as
|
|
1
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
2
|
+
import L, { useState as o, useRef as b } from "react";
|
|
3
|
+
import { cn as k } from "../../utils/cn.js";
|
|
4
4
|
import "sonner";
|
|
5
5
|
import "@gearbox-protocol/sdk";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
...m
|
|
11
|
-
}) {
|
|
12
|
-
return (
|
|
13
|
-
// biome-ignore lint/performance/noImgElement: Universal component that works outside Next.js
|
|
14
|
-
/* @__PURE__ */ e(
|
|
15
|
-
"img",
|
|
16
|
-
{
|
|
17
|
-
alt: "",
|
|
18
|
-
className: i("rounded-full object-cover", t),
|
|
19
|
-
style: {
|
|
20
|
-
...o ? { width: o, height: o } : {},
|
|
21
|
-
...r
|
|
22
|
-
},
|
|
23
|
-
loading: "lazy",
|
|
24
|
-
decoding: "async",
|
|
25
|
-
...m
|
|
26
|
-
}
|
|
27
|
-
)
|
|
28
|
-
);
|
|
6
|
+
import { getStatic as v } from "../../utils/static.js";
|
|
7
|
+
const a = v("/tokens/default.svg"), n = /* @__PURE__ */ new Map();
|
|
8
|
+
function w(e) {
|
|
9
|
+
return n.get(e) ? a : e;
|
|
29
10
|
}
|
|
11
|
+
const E = L.forwardRef(
|
|
12
|
+
({
|
|
13
|
+
className: e,
|
|
14
|
+
size: r,
|
|
15
|
+
rounded: d,
|
|
16
|
+
style: s,
|
|
17
|
+
src: c,
|
|
18
|
+
defaultIcon: l = a,
|
|
19
|
+
...i
|
|
20
|
+
}, f) => {
|
|
21
|
+
const [u, g] = o(void 0), [m, p] = o(!1), t = b(!1), h = (R) => {
|
|
22
|
+
t.current || (t.current = !0, n.set(R.currentTarget.src, !0), g(l));
|
|
23
|
+
}, y = () => {
|
|
24
|
+
p(!0);
|
|
25
|
+
};
|
|
26
|
+
return (
|
|
27
|
+
// biome-ignore lint/performance/noImgElement: Universal component that works outside Next.js
|
|
28
|
+
/* @__PURE__ */ I(
|
|
29
|
+
"img",
|
|
30
|
+
{
|
|
31
|
+
ref: f,
|
|
32
|
+
src: u || w(c),
|
|
33
|
+
alt: "",
|
|
34
|
+
className: k(
|
|
35
|
+
"object-cover",
|
|
36
|
+
d && "rounded-full",
|
|
37
|
+
!m && "bg-gray-90 dark:bg-gray-110 rounded-full",
|
|
38
|
+
e
|
|
39
|
+
),
|
|
40
|
+
style: {
|
|
41
|
+
width: r,
|
|
42
|
+
height: r,
|
|
43
|
+
...s
|
|
44
|
+
},
|
|
45
|
+
loading: "lazy",
|
|
46
|
+
decoding: "async",
|
|
47
|
+
onError: h,
|
|
48
|
+
onLoad: y,
|
|
49
|
+
...i
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
E.displayName = "RoundedImage";
|
|
30
56
|
export {
|
|
31
|
-
|
|
57
|
+
E as RoundedImage
|
|
32
58
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { useState as s, useRef as
|
|
3
|
-
import { cn as
|
|
2
|
+
import { useState as s, useRef as m } from "react";
|
|
3
|
+
import { cn as h } from "../../utils/cn.js";
|
|
4
|
+
import { getStatic as w } from "../../utils/static.js";
|
|
4
5
|
const a = "https://static.gearbox.fi/tokens/default.svg", i = /* @__PURE__ */ new Set();
|
|
5
|
-
function
|
|
6
|
-
const e =
|
|
6
|
+
function k(r) {
|
|
7
|
+
const e = r.replace("/", "").replace(" ", "").replace("-f", "").replace("-", "_").toLowerCase();
|
|
7
8
|
if (!e) return a;
|
|
8
|
-
const
|
|
9
|
-
return i.has(
|
|
9
|
+
const t = `https://static.gearbox.fi/tokens/${e}.svg`;
|
|
10
|
+
return i.has(t) ? a : t;
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
const n =
|
|
12
|
+
function x({ symbol: r, size: e = 48, className: t }) {
|
|
13
|
+
const n = k(r), [o, l] = s(n), [f, d] = s(!1), c = m(!1), u = () => {
|
|
13
14
|
c.current || (c.current = !0, i.add(o), l(a));
|
|
14
15
|
}, g = () => {
|
|
15
16
|
d(!0);
|
|
@@ -23,10 +24,10 @@ function I({ symbol: t, size: e = 48, className: r }) {
|
|
|
23
24
|
alt: "",
|
|
24
25
|
width: e,
|
|
25
26
|
height: e,
|
|
26
|
-
className:
|
|
27
|
+
className: h(
|
|
27
28
|
"object-contain",
|
|
28
29
|
!f && "bg-gray-200 dark:bg-gray-700 rounded-full",
|
|
29
|
-
|
|
30
|
+
t
|
|
30
31
|
),
|
|
31
32
|
style: { width: e, height: e },
|
|
32
33
|
onError: u,
|
|
@@ -35,13 +36,13 @@ function I({ symbol: t, size: e = 48, className: r }) {
|
|
|
35
36
|
)
|
|
36
37
|
);
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
const
|
|
39
|
+
function C(r) {
|
|
40
|
+
r.forEach((e) => {
|
|
41
|
+
const t = e.replace("/", "").replace(" ", "").replace("-f", "").replace("-", "_").toLowerCase(), n = w(`/tokens/${t}.svg`), o = new window.Image();
|
|
41
42
|
o.src = n;
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
x as TokenIcon,
|
|
47
|
+
C as preloadTokenIcons
|
|
47
48
|
};
|