@gearbox-protocol/permissionless-ui 1.15.2 → 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/layout/footer/footer.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/footer/footer.js +45 -44
- 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/footer/footer.d.ts +2 -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,44 +1,67 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useState as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Check as h, Copy as x } from "lucide-react";
|
|
3
|
+
import { useState as C, useRef as b } from "react";
|
|
4
|
+
import { cn as r } from "../../utils/cn.js";
|
|
5
|
+
import "sonner";
|
|
6
6
|
import "@gearbox-protocol/sdk";
|
|
7
|
-
function
|
|
8
|
-
toCopy:
|
|
9
|
-
children:
|
|
10
|
-
onCopySuccess:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
function T({
|
|
8
|
+
toCopy: n,
|
|
9
|
+
children: c,
|
|
10
|
+
onCopySuccess: l,
|
|
11
|
+
iconSize: t = 14,
|
|
12
|
+
icon: p,
|
|
13
|
+
className: m,
|
|
14
|
+
buttonClassName: u,
|
|
15
|
+
successDuration: f = 1500
|
|
16
16
|
}) {
|
|
17
|
-
const [
|
|
17
|
+
const [i, o] = C(!1), s = b(null), y = async () => {
|
|
18
18
|
try {
|
|
19
|
-
await navigator.clipboard.writeText(
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
await navigator.clipboard.writeText(n), s.current && clearTimeout(s.current), o(!0), s.current = setTimeout(() => {
|
|
20
|
+
o(!1);
|
|
21
|
+
}, f), l?.();
|
|
22
|
+
} catch (d) {
|
|
23
|
+
console.error("Failed to copy:", d);
|
|
22
24
|
}
|
|
23
25
|
};
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
26
|
-
/* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ a("div", { className: r("flex items-center min-w-0", m), children: [
|
|
27
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: c }),
|
|
28
|
+
/* @__PURE__ */ a(
|
|
27
29
|
"button",
|
|
28
30
|
{
|
|
29
31
|
type: "button",
|
|
30
|
-
onClick:
|
|
31
|
-
className:
|
|
32
|
-
"ml-1
|
|
33
|
-
|
|
34
|
-
m
|
|
32
|
+
onClick: y,
|
|
33
|
+
className: r(
|
|
34
|
+
"ml-1 cursor-pointer relative flex-shrink-0",
|
|
35
|
+
u
|
|
35
36
|
),
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
style: { width: t, height: t },
|
|
38
|
+
title: i ? "Copied!" : "Copy to clipboard",
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ e(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
className: r(
|
|
44
|
+
"absolute inset-0 flex items-center justify-center transition-all duration-200",
|
|
45
|
+
i ? "opacity-100 scale-100 text-green-500" : "opacity-0 scale-50 text-green-500"
|
|
46
|
+
),
|
|
47
|
+
children: /* @__PURE__ */ e(h, { size: t })
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ e(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
className: r(
|
|
54
|
+
"absolute inset-0 flex items-center justify-center transition-all duration-200",
|
|
55
|
+
i ? "opacity-0 scale-50" : "opacity-100 scale-100 text-gray-400 hover:text-white"
|
|
56
|
+
),
|
|
57
|
+
children: p ?? /* @__PURE__ */ e(x, { size: t })
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
]
|
|
38
61
|
}
|
|
39
62
|
)
|
|
40
63
|
] });
|
|
41
64
|
}
|
|
42
65
|
export {
|
|
43
|
-
|
|
66
|
+
T as WithCopy
|
|
44
67
|
};
|