@gearbox-protocol/permissionless-ui 1.0.7 → 1.1.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/index.js +2 -0
- package/dist/cjs/components/signatures/confirmation-item.js +48 -0
- package/dist/cjs/components/signatures/identicon.js +41 -0
- package/dist/cjs/components/signatures/index.js +26 -0
- package/dist/cjs/components/signatures/vertical-timeline.js +79 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/signatures/confirmation-item.js +24 -0
- package/dist/esm/components/signatures/identicon.js +17 -0
- package/dist/esm/components/signatures/index.js +3 -0
- package/dist/esm/components/signatures/vertical-timeline.js +55 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/signatures/confirmation-item.d.ts +8 -0
- package/dist/types/components/signatures/identicon.d.ts +4 -0
- package/dist/types/components/signatures/index.d.ts +3 -0
- package/dist/types/components/signatures/vertical-timeline.d.ts +17 -0
- package/package.json +1 -1
|
@@ -30,6 +30,7 @@ __reExport(components_exports, require('./label.js'), module.exports);
|
|
|
30
30
|
__reExport(components_exports, require('./page-layout.js'), module.exports);
|
|
31
31
|
__reExport(components_exports, require('./search-bar.js'), module.exports);
|
|
32
32
|
__reExport(components_exports, require('./select.js'), module.exports);
|
|
33
|
+
__reExport(components_exports, require('./signatures/index.js'), module.exports);
|
|
33
34
|
__reExport(components_exports, require('./skeleton.js'), module.exports);
|
|
34
35
|
__reExport(components_exports, require('./table.js'), module.exports);
|
|
35
36
|
__reExport(components_exports, require('./tabs.js'), module.exports);
|
|
@@ -53,6 +54,7 @@ __reExport(components_exports, require('./tooltip.js'), module.exports);
|
|
|
53
54
|
...require('./page-layout.js'),
|
|
54
55
|
...require('./search-bar.js'),
|
|
55
56
|
...require('./select.js'),
|
|
57
|
+
...require('./signatures/index.js'),
|
|
56
58
|
...require('./skeleton.js'),
|
|
57
59
|
...require('./table.js'),
|
|
58
60
|
...require('./tabs.js'),
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var confirmation_item_exports = {};
|
|
20
|
+
__export(confirmation_item_exports, {
|
|
21
|
+
ConfirmationItem: () => ConfirmationItem
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(confirmation_item_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_utils = require('../../utils/index.js');
|
|
26
|
+
var import_buttons = require('../buttons/index.js');
|
|
27
|
+
var import_copy_button = require('../buttons/copy-button.js');
|
|
28
|
+
var import_identicon = require('./identicon.js');
|
|
29
|
+
function ConfirmationItem({
|
|
30
|
+
confirmation,
|
|
31
|
+
note,
|
|
32
|
+
explorerUrl
|
|
33
|
+
}) {
|
|
34
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "group relative flex items-center", children: [
|
|
35
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute left-[8px] h-2 w-2 rounded-full bg-green-500" }),
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "ml-10 flex items-center gap-2", children: [
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_identicon.Identicon, { address: confirmation, size: 32 }),
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-white", children: (0, import_utils.shortenHash)(confirmation) }),
|
|
39
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-gray-500 text-xs", children: note }),
|
|
40
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_copy_button.CopyButton, { text: confirmation }),
|
|
41
|
+
explorerUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_buttons.ExternalButton, { url: explorerUrl })
|
|
42
|
+
] })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
ConfirmationItem
|
|
48
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var identicon_exports = {};
|
|
20
|
+
__export(identicon_exports, {
|
|
21
|
+
Identicon: () => Identicon
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(identicon_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
function Identicon({
|
|
26
|
+
address,
|
|
27
|
+
size = 32
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: "rounded-full bg-gray-700 flex items-center justify-center text-white text-xs",
|
|
33
|
+
style: { width: size, height: size },
|
|
34
|
+
children: address.slice(2, 4)
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
Identicon
|
|
41
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var signatures_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(signatures_exports);
|
|
18
|
+
__reExport(signatures_exports, require('./confirmation-item.js'), module.exports);
|
|
19
|
+
__reExport(signatures_exports, require('./identicon.js'), module.exports);
|
|
20
|
+
__reExport(signatures_exports, require('./vertical-timeline.js'), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require('./confirmation-item.js'),
|
|
24
|
+
...require('./identicon.js'),
|
|
25
|
+
...require('./vertical-timeline.js')
|
|
26
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var vertical_timeline_exports = {};
|
|
20
|
+
__export(vertical_timeline_exports, {
|
|
21
|
+
VerticalTimeline: () => VerticalTimeline
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(vertical_timeline_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_lucide_react = require("lucide-react");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
function VerticalTimeline({
|
|
28
|
+
steps,
|
|
29
|
+
minWidth = 300
|
|
30
|
+
}) {
|
|
31
|
+
const [showAll, setShowAll] = (0, import_react.useState)(steps.map(() => false));
|
|
32
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `relative min-w-[${minWidth}px]`, children: [
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute left-[11px] top-[2px] bottom-[20px] w-[2px] h-[calc(100% - 20px)] bg-gray-800" }),
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-4", children: steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
children: [
|
|
38
|
+
step.type === "default" && step.status !== "not-started" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative flex items-center", children: [
|
|
39
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: `absolute left-[2px] flex h-5 w-5 items-center justify-center rounded-full ${step.status === "success" ? "bg-green-500" : step.status === "error" ? "bg-red-500" : "border-2 border-gray-600 bg-transparent"}`,
|
|
43
|
+
children: [
|
|
44
|
+
step.status === "success" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-3 w-3 text-black" }),
|
|
45
|
+
step.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-3 w-3 text-black" })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ml-10 text-white", children: step.title })
|
|
50
|
+
] }),
|
|
51
|
+
step.type === "extention" && step.status !== "not-started" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative flex items-center", children: [
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute left-[8px] h-2 w-2 rounded-full bg-green-500" }),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
+
"button",
|
|
56
|
+
{
|
|
57
|
+
type: "button",
|
|
58
|
+
onClick: () => setShowAll([
|
|
59
|
+
...showAll.slice(0, index),
|
|
60
|
+
!showAll[index],
|
|
61
|
+
...showAll.slice(index + 1)
|
|
62
|
+
]),
|
|
63
|
+
className: "ml-10 text-green-500 hover:underline",
|
|
64
|
+
children: showAll ? "Hide all" : "Show all"
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
] }),
|
|
68
|
+
showAll[index] && step.children
|
|
69
|
+
] })
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
`step-${index}`
|
|
73
|
+
)) })
|
|
74
|
+
] });
|
|
75
|
+
}
|
|
76
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
+
0 && (module.exports = {
|
|
78
|
+
VerticalTimeline
|
|
79
|
+
});
|
|
@@ -13,6 +13,7 @@ export * from "./label.js";
|
|
|
13
13
|
export * from "./page-layout.js";
|
|
14
14
|
export * from "./search-bar.js";
|
|
15
15
|
export * from "./select.js";
|
|
16
|
+
export * from "./signatures/index.js";
|
|
16
17
|
export * from "./skeleton.js";
|
|
17
18
|
export * from "./table.js";
|
|
18
19
|
export * from "./tabs.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { shortenHash } from "../../utils/index.js";
|
|
3
|
+
import { ExternalButton } from "../buttons/index.js";
|
|
4
|
+
import { CopyButton } from "../buttons/copy-button.js";
|
|
5
|
+
import { Identicon } from "./identicon.js";
|
|
6
|
+
function ConfirmationItem({
|
|
7
|
+
confirmation,
|
|
8
|
+
note,
|
|
9
|
+
explorerUrl
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", { className: "group relative flex items-center", children: [
|
|
12
|
+
/* @__PURE__ */ jsx("div", { className: "absolute left-[8px] h-2 w-2 rounded-full bg-green-500" }),
|
|
13
|
+
/* @__PURE__ */ jsxs("div", { className: "ml-10 flex items-center gap-2", children: [
|
|
14
|
+
/* @__PURE__ */ jsx(Identicon, { address: confirmation, size: 32 }),
|
|
15
|
+
/* @__PURE__ */ jsx("span", { className: "text-white", children: shortenHash(confirmation) }),
|
|
16
|
+
note && /* @__PURE__ */ jsx("span", { className: "text-gray-500 text-xs", children: note }),
|
|
17
|
+
/* @__PURE__ */ jsx(CopyButton, { text: confirmation }),
|
|
18
|
+
explorerUrl && /* @__PURE__ */ jsx(ExternalButton, { url: explorerUrl })
|
|
19
|
+
] })
|
|
20
|
+
] });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
ConfirmationItem
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
function Identicon({
|
|
3
|
+
address,
|
|
4
|
+
size = 32
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
className: "rounded-full bg-gray-700 flex items-center justify-center text-white text-xs",
|
|
10
|
+
style: { width: size, height: size },
|
|
11
|
+
children: address.slice(2, 4)
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
Identicon
|
|
17
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check, X } from "lucide-react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
function VerticalTimeline({
|
|
5
|
+
steps,
|
|
6
|
+
minWidth = 300
|
|
7
|
+
}) {
|
|
8
|
+
const [showAll, setShowAll] = useState(steps.map(() => false));
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", { className: `relative min-w-[${minWidth}px]`, children: [
|
|
10
|
+
/* @__PURE__ */ jsx("div", { className: "absolute left-[11px] top-[2px] bottom-[20px] w-[2px] h-[calc(100% - 20px)] bg-gray-800" }),
|
|
11
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4", children: steps.map((step, index) => /* @__PURE__ */ jsxs(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
children: [
|
|
15
|
+
step.type === "default" && step.status !== "not-started" && /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
|
|
16
|
+
/* @__PURE__ */ jsxs(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: `absolute left-[2px] flex h-5 w-5 items-center justify-center rounded-full ${step.status === "success" ? "bg-green-500" : step.status === "error" ? "bg-red-500" : "border-2 border-gray-600 bg-transparent"}`,
|
|
20
|
+
children: [
|
|
21
|
+
step.status === "success" && /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 text-black" }),
|
|
22
|
+
step.status === "error" && /* @__PURE__ */ jsx(X, { className: "h-3 w-3 text-black" })
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx("span", { className: "ml-10 text-white", children: step.title })
|
|
27
|
+
] }),
|
|
28
|
+
step.type === "extention" && step.status !== "not-started" && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
29
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
|
|
30
|
+
/* @__PURE__ */ jsx("div", { className: "absolute left-[8px] h-2 w-2 rounded-full bg-green-500" }),
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
32
|
+
"button",
|
|
33
|
+
{
|
|
34
|
+
type: "button",
|
|
35
|
+
onClick: () => setShowAll([
|
|
36
|
+
...showAll.slice(0, index),
|
|
37
|
+
!showAll[index],
|
|
38
|
+
...showAll.slice(index + 1)
|
|
39
|
+
]),
|
|
40
|
+
className: "ml-10 text-green-500 hover:underline",
|
|
41
|
+
children: showAll ? "Hide all" : "Show all"
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] }),
|
|
45
|
+
showAll[index] && step.children
|
|
46
|
+
] })
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
`step-${index}`
|
|
50
|
+
)) })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
VerticalTimeline
|
|
55
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Address, Hex } from "viem";
|
|
2
|
+
interface ConfirmationItemProps {
|
|
3
|
+
confirmation: Address | Hex;
|
|
4
|
+
note?: string;
|
|
5
|
+
explorerUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function ConfirmationItem({ confirmation, note, explorerUrl, }: ConfirmationItemProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface StepCommon {
|
|
2
|
+
status: "success" | "pending" | "not-started" | "error";
|
|
3
|
+
}
|
|
4
|
+
interface Step extends StepCommon {
|
|
5
|
+
type: "default";
|
|
6
|
+
title: string;
|
|
7
|
+
}
|
|
8
|
+
interface ExtentionStep extends StepCommon {
|
|
9
|
+
type: "extention";
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
interface VerticalTimelineProps {
|
|
13
|
+
steps: (Step | ExtentionStep)[];
|
|
14
|
+
minWidth?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function VerticalTimeline({ steps, minWidth, }: VerticalTimelineProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|