@gearbox-protocol/permissionless-ui 1.1.8 → 1.2.1
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/buttons/index.js +2 -0
- package/dist/cjs/components/buttons/navigation-button.js +57 -0
- package/dist/cjs/components/index.js +4 -2
- package/dist/cjs/components/layout/app-logo.js +67 -0
- package/dist/cjs/components/layout/footer.js +116 -0
- package/dist/cjs/components/layout/header.js +41 -0
- package/dist/cjs/components/layout/index.js +30 -0
- package/dist/cjs/components/layout/legal-disclaimer.js +75 -0
- package/dist/cjs/components/{page-layout.js → layout/page-layout.js} +2 -2
- package/dist/cjs/components/markdown-viewer.js +235 -0
- package/dist/esm/components/buttons/index.js +1 -0
- package/dist/esm/components/buttons/navigation-button.js +23 -0
- package/dist/esm/components/index.js +2 -1
- package/dist/esm/components/layout/app-logo.js +33 -0
- package/dist/esm/components/layout/footer.js +82 -0
- package/dist/esm/components/layout/header.js +17 -0
- package/dist/esm/components/layout/index.js +5 -0
- package/dist/esm/components/layout/legal-disclaimer.js +41 -0
- package/dist/esm/components/{page-layout.js → layout/page-layout.js} +2 -2
- package/dist/esm/components/markdown-viewer.js +201 -0
- package/dist/types/components/buttons/index.d.ts +1 -0
- package/dist/types/components/buttons/navigation-button.d.ts +8 -0
- package/dist/types/components/index.d.ts +2 -1
- package/dist/types/components/layout/app-logo.d.ts +4 -0
- package/dist/types/components/layout/footer.d.ts +5 -0
- package/dist/types/components/layout/header.d.ts +6 -0
- package/dist/types/components/layout/index.d.ts +5 -0
- package/dist/types/components/layout/legal-disclaimer.d.ts +8 -0
- package/dist/types/components/markdown-viewer.d.ts +6 -0
- package/package.json +4 -1
- /package/dist/types/components/{page-layout.d.ts → layout/page-layout.d.ts} +0 -0
|
@@ -19,6 +19,7 @@ __reExport(buttons_exports, require('./back-button.js'), module.exports);
|
|
|
19
19
|
__reExport(buttons_exports, require('./button.js'), module.exports);
|
|
20
20
|
__reExport(buttons_exports, require('./copy-button.js'), module.exports);
|
|
21
21
|
__reExport(buttons_exports, require('./external-button.js'), module.exports);
|
|
22
|
+
__reExport(buttons_exports, require('./navigation-button.js'), module.exports);
|
|
22
23
|
__reExport(buttons_exports, require('./tab-button.js'), module.exports);
|
|
23
24
|
// Annotate the CommonJS export names for ESM import in node:
|
|
24
25
|
0 && (module.exports = {
|
|
@@ -26,5 +27,6 @@ __reExport(buttons_exports, require('./tab-button.js'), module.exports);
|
|
|
26
27
|
...require('./button.js'),
|
|
27
28
|
...require('./copy-button.js'),
|
|
28
29
|
...require('./external-button.js'),
|
|
30
|
+
...require('./navigation-button.js'),
|
|
29
31
|
...require('./tab-button.js')
|
|
30
32
|
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var navigation_button_exports = {};
|
|
30
|
+
__export(navigation_button_exports, {
|
|
31
|
+
NavigationButton: () => NavigationButton
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(navigation_button_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_link = __toESM(require("next/link"));
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_utils = __toESM(require('../../utils/index.js'));
|
|
38
|
+
const NavigationButton = import_react.default.forwardRef(({ href, text, isActive, ...props }, ref) => {
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
|
+
import_link.default,
|
|
41
|
+
{
|
|
42
|
+
href,
|
|
43
|
+
ref,
|
|
44
|
+
className: (0, import_utils.default)(
|
|
45
|
+
"text-foreground px-2 py-1 rounded transition-colors duration-200 ease-in-out ",
|
|
46
|
+
isActive ? "bg-muted" : "hover:bg-muted"
|
|
47
|
+
),
|
|
48
|
+
...props,
|
|
49
|
+
children: text
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
NavigationButton.displayName = "NavButton";
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
NavigationButton
|
|
57
|
+
});
|
|
@@ -27,7 +27,8 @@ __reExport(components_exports, require('./dropdown-menu.js'), module.exports);
|
|
|
27
27
|
__reExport(components_exports, require('./editable-table/index.js'), module.exports);
|
|
28
28
|
__reExport(components_exports, require('./input.js'), module.exports);
|
|
29
29
|
__reExport(components_exports, require('./label.js'), module.exports);
|
|
30
|
-
__reExport(components_exports, require('./
|
|
30
|
+
__reExport(components_exports, require('./layout/index.js'), module.exports);
|
|
31
|
+
__reExport(components_exports, require('./markdown-viewer.js'), module.exports);
|
|
31
32
|
__reExport(components_exports, require('./search-bar.js'), module.exports);
|
|
32
33
|
__reExport(components_exports, require('./select.js'), module.exports);
|
|
33
34
|
__reExport(components_exports, require('./signatures/index.js'), module.exports);
|
|
@@ -51,7 +52,8 @@ __reExport(components_exports, require('./tooltip.js'), module.exports);
|
|
|
51
52
|
...require('./editable-table/index.js'),
|
|
52
53
|
...require('./input.js'),
|
|
53
54
|
...require('./label.js'),
|
|
54
|
-
...require('./
|
|
55
|
+
...require('./layout/index.js'),
|
|
56
|
+
...require('./markdown-viewer.js'),
|
|
55
57
|
...require('./search-bar.js'),
|
|
56
58
|
...require('./select.js'),
|
|
57
59
|
...require('./signatures/index.js'),
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var app_logo_exports = {};
|
|
30
|
+
__export(app_logo_exports, {
|
|
31
|
+
AppLogo: () => AppLogo
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(app_logo_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_image = __toESM(require("next/image"));
|
|
36
|
+
var import_utils = __toESM(require('../../utils/index.js'));
|
|
37
|
+
function AppLogo({
|
|
38
|
+
appName,
|
|
39
|
+
size = "default"
|
|
40
|
+
}) {
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: (0, import_utils.default)(
|
|
45
|
+
"font-bold text-foreground flex items-center gap-2",
|
|
46
|
+
size === "default" ? "text-xl" : "text-md"
|
|
47
|
+
),
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
import_image.default,
|
|
51
|
+
{
|
|
52
|
+
src: "https://static.gearbox.fi/logo/logo_monochrome_white@2x.png",
|
|
53
|
+
alt: "Gearbox Protocol",
|
|
54
|
+
width: size === "default" ? 120 : 100,
|
|
55
|
+
height: size === "default" ? 24 : 20,
|
|
56
|
+
priority: true
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-bold italic", children: appName })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
AppLogo
|
|
67
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var footer_exports = {};
|
|
30
|
+
__export(footer_exports, {
|
|
31
|
+
Footer: () => Footer
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(footer_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_app_logo = require('./app-logo.js');
|
|
37
|
+
var import_legal_disclaimer = require('./legal-disclaimer.js');
|
|
38
|
+
function FooterLink({ href, text }) {
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
|
+
"a",
|
|
41
|
+
{
|
|
42
|
+
href,
|
|
43
|
+
className: "text-muted-foreground hover:text-foreground transition-colors duration-200 text-sm",
|
|
44
|
+
children: text
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
function FooterLinkSection({
|
|
49
|
+
title,
|
|
50
|
+
links
|
|
51
|
+
}) {
|
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-1 md:items-end", children: [
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "font-semibold text-foreground", children: title }),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-4", children: links.map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, { children: [
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FooterLink, { href: link.href, text: link.text }),
|
|
56
|
+
index < links.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm", children: "\u2022" })
|
|
57
|
+
] }, link.href)) })
|
|
58
|
+
] });
|
|
59
|
+
}
|
|
60
|
+
function Footer({
|
|
61
|
+
appName,
|
|
62
|
+
legalReferences
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("footer", { className: "border-t border-gray-800 bg-background px-4 py-8 mt-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "max-w-7xl mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-8 items-top", children: [
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-8 h-full justify-between", children: [
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_logo.AppLogo, { appName, size: "small" }),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_legal_disclaimer.LegalDisclaimer, { hrefs: legalReferences })
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-8 h-full justify-between", children: [
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
FooterLinkSection,
|
|
72
|
+
{
|
|
73
|
+
title: "Legal",
|
|
74
|
+
links: [
|
|
75
|
+
{
|
|
76
|
+
href: legalReferences.termsOfService,
|
|
77
|
+
text: "Terms of Service"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
href: legalReferences.privacyNotice,
|
|
81
|
+
text: "Privacy Notice"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
href: legalReferences.riskDisclosure,
|
|
85
|
+
text: "Risk Disclosure"
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
FooterLinkSection,
|
|
92
|
+
{
|
|
93
|
+
title: "Developers",
|
|
94
|
+
links: [
|
|
95
|
+
{
|
|
96
|
+
href: "https://docs.gearbox.fi/gearbox-permissionless-doc",
|
|
97
|
+
text: "Documentation"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
href: "https://docs.gearbox.finance/risk-and-security/audits-bug-bounty",
|
|
101
|
+
text: "Audits"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
href: "https://github.com/Gearbox-protocol",
|
|
105
|
+
text: "GitHub"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] })
|
|
111
|
+
] }) }) });
|
|
112
|
+
}
|
|
113
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
114
|
+
0 && (module.exports = {
|
|
115
|
+
Footer
|
|
116
|
+
});
|
|
@@ -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 header_exports = {};
|
|
20
|
+
__export(header_exports, {
|
|
21
|
+
Header: () => Header
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(header_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_buttons = require('../buttons/index.js');
|
|
26
|
+
var import_app_logo = require('./app-logo.js');
|
|
27
|
+
function Header({
|
|
28
|
+
appName,
|
|
29
|
+
navigation,
|
|
30
|
+
connectKitButton
|
|
31
|
+
}) {
|
|
32
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("header", { className: "sticky top-0 z-50 border-b border-gray-800 bg-background px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_logo.AppLogo, { appName }),
|
|
34
|
+
navigation.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { className: "hidden md:flex space-x-4", children: navigation.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_buttons.NavigationButton, { ...item }, item.href)) }),
|
|
35
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center gap-4", children: connectKitButton })
|
|
36
|
+
] }) });
|
|
37
|
+
}
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
Header
|
|
41
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
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 layout_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(layout_exports);
|
|
18
|
+
__reExport(layout_exports, require('./app-logo.js'), module.exports);
|
|
19
|
+
__reExport(layout_exports, require('./footer.js'), module.exports);
|
|
20
|
+
__reExport(layout_exports, require('./header.js'), module.exports);
|
|
21
|
+
__reExport(layout_exports, require('./legal-disclaimer.js'), module.exports);
|
|
22
|
+
__reExport(layout_exports, require('./page-layout.js'), module.exports);
|
|
23
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
24
|
+
0 && (module.exports = {
|
|
25
|
+
...require('./app-logo.js'),
|
|
26
|
+
...require('./footer.js'),
|
|
27
|
+
...require('./header.js'),
|
|
28
|
+
...require('./legal-disclaimer.js'),
|
|
29
|
+
...require('./page-layout.js')
|
|
30
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var legal_disclaimer_exports = {};
|
|
30
|
+
__export(legal_disclaimer_exports, {
|
|
31
|
+
LegalDisclaimer: () => LegalDisclaimer
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(legal_disclaimer_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_link = __toESM(require("next/link"));
|
|
36
|
+
function LegalDisclaimer({ hrefs }) {
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm text-muted-foreground max-w-md", children: [
|
|
38
|
+
"Any use of and/or interaction with the Permissionless Interface is subject to the",
|
|
39
|
+
" ",
|
|
40
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_link.default,
|
|
42
|
+
{
|
|
43
|
+
href: hrefs.termsOfService,
|
|
44
|
+
className: "underline hover:text-foreground transition-colors",
|
|
45
|
+
children: "Terms of Service"
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
" ",
|
|
49
|
+
"and",
|
|
50
|
+
" ",
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
import_link.default,
|
|
53
|
+
{
|
|
54
|
+
href: hrefs.privacyNotice,
|
|
55
|
+
className: "underline hover:text-foreground transition-colors",
|
|
56
|
+
children: "Privacy Notice"
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
", and acceptance of risks described in the",
|
|
60
|
+
" ",
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
|
+
import_link.default,
|
|
63
|
+
{
|
|
64
|
+
href: hrefs.riskDisclosure,
|
|
65
|
+
className: "underline hover:text-foreground transition-colors",
|
|
66
|
+
children: "Risk Disclosure Statement"
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
"."
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
+
0 && (module.exports = {
|
|
74
|
+
LegalDisclaimer
|
|
75
|
+
});
|
|
@@ -22,8 +22,8 @@ __export(page_layout_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(page_layout_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
-
var import_back_button = require('
|
|
26
|
-
var import_card = require('
|
|
25
|
+
var import_back_button = require('../buttons/back-button.js');
|
|
26
|
+
var import_card = require('../card.js');
|
|
27
27
|
function PageLayout({
|
|
28
28
|
children,
|
|
29
29
|
title,
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var markdown_viewer_exports = {};
|
|
31
|
+
__export(markdown_viewer_exports, {
|
|
32
|
+
MarkdownViewer: () => MarkdownViewer
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(markdown_viewer_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_navigation = require("next/navigation");
|
|
37
|
+
var import_react = require("react");
|
|
38
|
+
var import_react_markdown = __toESM(require("react-markdown"));
|
|
39
|
+
var import_remark_gfm = __toESM(require("remark-gfm"));
|
|
40
|
+
var import_layout = require('./layout/index.js');
|
|
41
|
+
function slugify(text) {
|
|
42
|
+
return text.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-");
|
|
43
|
+
}
|
|
44
|
+
function getTextContent(children) {
|
|
45
|
+
if (typeof children === "string") {
|
|
46
|
+
return children;
|
|
47
|
+
}
|
|
48
|
+
if (typeof children === "number") {
|
|
49
|
+
return String(children);
|
|
50
|
+
}
|
|
51
|
+
if (Array.isArray(children)) {
|
|
52
|
+
return children.map(getTextContent).join("");
|
|
53
|
+
}
|
|
54
|
+
if (children && typeof children === "object" && "props" in children) {
|
|
55
|
+
return getTextContent(children.props.children);
|
|
56
|
+
}
|
|
57
|
+
return "";
|
|
58
|
+
}
|
|
59
|
+
function extractCustomId(children) {
|
|
60
|
+
const text = getTextContent(children);
|
|
61
|
+
const customIdMatch = text.match(/\{#([a-z0-9-]+)\}\s*$/i);
|
|
62
|
+
if (customIdMatch) {
|
|
63
|
+
const id = customIdMatch[1];
|
|
64
|
+
if (typeof children === "string") {
|
|
65
|
+
const displayText = text.replace(/\s*\{#[a-z0-9-]+\}\s*$/i, "").trim();
|
|
66
|
+
return { id, displayText };
|
|
67
|
+
}
|
|
68
|
+
return { id, displayText: children };
|
|
69
|
+
}
|
|
70
|
+
return { id: slugify(text), displayText: children };
|
|
71
|
+
}
|
|
72
|
+
function MarkdownViewer({ content, title }) {
|
|
73
|
+
const router = (0, import_navigation.useRouter)();
|
|
74
|
+
(0, import_react.useEffect)(() => {
|
|
75
|
+
const hash = window.location.hash;
|
|
76
|
+
if (hash) {
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
const element = document.getElementById(hash.slice(1));
|
|
79
|
+
if (element) {
|
|
80
|
+
element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
81
|
+
}
|
|
82
|
+
}, 100);
|
|
83
|
+
}
|
|
84
|
+
}, []);
|
|
85
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
86
|
+
import_layout.PageLayout,
|
|
87
|
+
{
|
|
88
|
+
title: title || "",
|
|
89
|
+
backButton: { href: "/", text: "Back", onClick: () => router.back() },
|
|
90
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("article", { className: "prose prose-invert prose-lg max-w-none", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
import_react_markdown.default,
|
|
92
|
+
{
|
|
93
|
+
remarkPlugins: [import_remark_gfm.default],
|
|
94
|
+
components: {
|
|
95
|
+
h1: ({ children, ...props }) => {
|
|
96
|
+
const { id, displayText } = extractCustomId(children);
|
|
97
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
98
|
+
"h1",
|
|
99
|
+
{
|
|
100
|
+
id,
|
|
101
|
+
className: "text-3xl font-bold text-foreground mt-8 mb-4 scroll-mt-24",
|
|
102
|
+
...props,
|
|
103
|
+
children: displayText
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
},
|
|
107
|
+
h2: ({ children, ...props }) => {
|
|
108
|
+
const { id, displayText } = extractCustomId(children);
|
|
109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
"h2",
|
|
111
|
+
{
|
|
112
|
+
id,
|
|
113
|
+
className: "text-2xl font-semibold text-foreground mt-6 mb-3 scroll-mt-24",
|
|
114
|
+
...props,
|
|
115
|
+
children: displayText
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
h3: ({ children, ...props }) => {
|
|
120
|
+
const { id, displayText } = extractCustomId(children);
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
122
|
+
"h3",
|
|
123
|
+
{
|
|
124
|
+
id,
|
|
125
|
+
className: "text-xl font-semibold text-foreground mt-5 mb-2 scroll-mt-24",
|
|
126
|
+
...props,
|
|
127
|
+
children: displayText
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
},
|
|
131
|
+
h4: ({ children, ...props }) => {
|
|
132
|
+
const { id, displayText } = extractCustomId(children);
|
|
133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
134
|
+
"h4",
|
|
135
|
+
{
|
|
136
|
+
id,
|
|
137
|
+
className: "text-lg font-semibold text-foreground mt-4 mb-2 scroll-mt-24",
|
|
138
|
+
...props,
|
|
139
|
+
children: displayText
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
},
|
|
143
|
+
p: ({ ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
144
|
+
"p",
|
|
145
|
+
{
|
|
146
|
+
className: "text-muted-foreground mb-4 leading-relaxed",
|
|
147
|
+
...props
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
a: ({ href, ...props }) => {
|
|
151
|
+
const isAnchorLink = href?.startsWith("#");
|
|
152
|
+
if (isAnchorLink && href) {
|
|
153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
154
|
+
"a",
|
|
155
|
+
{
|
|
156
|
+
href,
|
|
157
|
+
className: "text-blue-400 hover:text-blue-300 underline transition-colors duration-200",
|
|
158
|
+
onClick: (e) => {
|
|
159
|
+
e.preventDefault();
|
|
160
|
+
const targetId = href.slice(1);
|
|
161
|
+
const element = document.getElementById(targetId);
|
|
162
|
+
if (element) {
|
|
163
|
+
element.scrollIntoView({
|
|
164
|
+
behavior: "smooth",
|
|
165
|
+
block: "start"
|
|
166
|
+
});
|
|
167
|
+
window.history.pushState(null, "", href);
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
...props
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
175
|
+
"a",
|
|
176
|
+
{
|
|
177
|
+
href,
|
|
178
|
+
className: "text-blue-400 hover:text-blue-300 underline transition-colors duration-200",
|
|
179
|
+
target: "_blank",
|
|
180
|
+
rel: "noopener noreferrer",
|
|
181
|
+
...props
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
},
|
|
185
|
+
ul: ({ ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
186
|
+
"ul",
|
|
187
|
+
{
|
|
188
|
+
className: "list-disc list-inside mb-4 text-muted-foreground space-y-2",
|
|
189
|
+
...props
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
ol: ({ ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
193
|
+
"ol",
|
|
194
|
+
{
|
|
195
|
+
className: "list-decimal list-inside mb-4 text-muted-foreground space-y-2",
|
|
196
|
+
...props
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
li: ({ ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: "ml-4 text-muted-foreground", ...props }),
|
|
200
|
+
blockquote: ({ ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
201
|
+
"blockquote",
|
|
202
|
+
{
|
|
203
|
+
className: "border-l-4 border-gray-700 pl-4 my-4 italic text-muted-foreground",
|
|
204
|
+
...props
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
code: ({ className, ...props }) => {
|
|
208
|
+
const isInline = !className?.includes("language-");
|
|
209
|
+
return isInline ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
210
|
+
"code",
|
|
211
|
+
{
|
|
212
|
+
className: "bg-gray-800 text-gray-200 px-1.5 py-0.5 rounded text-sm font-mono",
|
|
213
|
+
...props
|
|
214
|
+
}
|
|
215
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
216
|
+
"code",
|
|
217
|
+
{
|
|
218
|
+
className: "block bg-gray-800 text-gray-200 p-4 rounded-lg my-4 font-mono text-sm overflow-x-auto",
|
|
219
|
+
...props
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
},
|
|
223
|
+
strong: ({ ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { className: "font-bold text-foreground", ...props }),
|
|
224
|
+
em: ({ ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("em", { className: "italic text-foreground", ...props })
|
|
225
|
+
},
|
|
226
|
+
children: content
|
|
227
|
+
}
|
|
228
|
+
) })
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
233
|
+
0 && (module.exports = {
|
|
234
|
+
MarkdownViewer
|
|
235
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import cn from "../../utils/index.js";
|
|
5
|
+
const NavigationButton = React.forwardRef(({ href, text, isActive, ...props }, ref) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
Link,
|
|
8
|
+
{
|
|
9
|
+
href,
|
|
10
|
+
ref,
|
|
11
|
+
className: cn(
|
|
12
|
+
"text-foreground px-2 py-1 rounded transition-colors duration-200 ease-in-out ",
|
|
13
|
+
isActive ? "bg-muted" : "hover:bg-muted"
|
|
14
|
+
),
|
|
15
|
+
...props,
|
|
16
|
+
children: text
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
NavigationButton.displayName = "NavButton";
|
|
21
|
+
export {
|
|
22
|
+
NavigationButton
|
|
23
|
+
};
|
|
@@ -10,7 +10,8 @@ export * from "./dropdown-menu.js";
|
|
|
10
10
|
export * from "./editable-table/index.js";
|
|
11
11
|
export * from "./input.js";
|
|
12
12
|
export * from "./label.js";
|
|
13
|
-
export * from "./
|
|
13
|
+
export * from "./layout/index.js";
|
|
14
|
+
export * from "./markdown-viewer.js";
|
|
14
15
|
export * from "./search-bar.js";
|
|
15
16
|
export * from "./select.js";
|
|
16
17
|
export * from "./signatures/index.js";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image from "next/image";
|
|
3
|
+
import cn from "../../utils/index.js";
|
|
4
|
+
function AppLogo({
|
|
5
|
+
appName,
|
|
6
|
+
size = "default"
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsxs(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: cn(
|
|
12
|
+
"font-bold text-foreground flex items-center gap-2",
|
|
13
|
+
size === "default" ? "text-xl" : "text-md"
|
|
14
|
+
),
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
Image,
|
|
18
|
+
{
|
|
19
|
+
src: "https://static.gearbox.fi/logo/logo_monochrome_white@2x.png",
|
|
20
|
+
alt: "Gearbox Protocol",
|
|
21
|
+
width: size === "default" ? 120 : 100,
|
|
22
|
+
height: size === "default" ? 24 : 20,
|
|
23
|
+
priority: true
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx("span", { className: "font-bold italic", children: appName })
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
AppLogo
|
|
33
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { AppLogo } from "./app-logo.js";
|
|
4
|
+
import { LegalDisclaimer } from "./legal-disclaimer.js";
|
|
5
|
+
function FooterLink({ href, text }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"a",
|
|
8
|
+
{
|
|
9
|
+
href,
|
|
10
|
+
className: "text-muted-foreground hover:text-foreground transition-colors duration-200 text-sm",
|
|
11
|
+
children: text
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
function FooterLinkSection({
|
|
16
|
+
title,
|
|
17
|
+
links
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 md:items-end", children: [
|
|
20
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-foreground", children: title }),
|
|
21
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-4", children: links.map((link, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
22
|
+
/* @__PURE__ */ jsx(FooterLink, { href: link.href, text: link.text }),
|
|
23
|
+
index < links.length - 1 && /* @__PURE__ */ jsx("span", { className: "text-sm", children: "\u2022" })
|
|
24
|
+
] }, link.href)) })
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
function Footer({
|
|
28
|
+
appName,
|
|
29
|
+
legalReferences
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ jsx("footer", { className: "border-t border-gray-800 bg-background px-4 py-8 mt-auto", children: /* @__PURE__ */ jsx("div", { className: "max-w-7xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-8 items-top", children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8 h-full justify-between", children: [
|
|
33
|
+
/* @__PURE__ */ jsx(AppLogo, { appName, size: "small" }),
|
|
34
|
+
/* @__PURE__ */ jsx(LegalDisclaimer, { hrefs: legalReferences })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8 h-full justify-between", children: [
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
FooterLinkSection,
|
|
39
|
+
{
|
|
40
|
+
title: "Legal",
|
|
41
|
+
links: [
|
|
42
|
+
{
|
|
43
|
+
href: legalReferences.termsOfService,
|
|
44
|
+
text: "Terms of Service"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
href: legalReferences.privacyNotice,
|
|
48
|
+
text: "Privacy Notice"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
href: legalReferences.riskDisclosure,
|
|
52
|
+
text: "Risk Disclosure"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
FooterLinkSection,
|
|
59
|
+
{
|
|
60
|
+
title: "Developers",
|
|
61
|
+
links: [
|
|
62
|
+
{
|
|
63
|
+
href: "https://docs.gearbox.fi/gearbox-permissionless-doc",
|
|
64
|
+
text: "Documentation"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
href: "https://docs.gearbox.finance/risk-and-security/audits-bug-bounty",
|
|
68
|
+
text: "Audits"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
href: "https://github.com/Gearbox-protocol",
|
|
72
|
+
text: "GitHub"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] })
|
|
78
|
+
] }) }) });
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
Footer
|
|
82
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { NavigationButton } from "../buttons/index.js";
|
|
3
|
+
import { AppLogo } from "./app-logo.js";
|
|
4
|
+
function Header({
|
|
5
|
+
appName,
|
|
6
|
+
navigation,
|
|
7
|
+
connectKitButton
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsx("header", { className: "sticky top-0 z-50 border-b border-gray-800 bg-background px-4 py-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
10
|
+
/* @__PURE__ */ jsx(AppLogo, { appName }),
|
|
11
|
+
navigation.length > 0 && /* @__PURE__ */ jsx("nav", { className: "hidden md:flex space-x-4", children: navigation.map((item) => /* @__PURE__ */ jsx(NavigationButton, { ...item }, item.href)) }),
|
|
12
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-4", children: connectKitButton })
|
|
13
|
+
] }) });
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
Header
|
|
17
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
function LegalDisclaimer({ hrefs }) {
|
|
4
|
+
return /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground max-w-md", children: [
|
|
5
|
+
"Any use of and/or interaction with the Permissionless Interface is subject to the",
|
|
6
|
+
" ",
|
|
7
|
+
/* @__PURE__ */ jsx(
|
|
8
|
+
Link,
|
|
9
|
+
{
|
|
10
|
+
href: hrefs.termsOfService,
|
|
11
|
+
className: "underline hover:text-foreground transition-colors",
|
|
12
|
+
children: "Terms of Service"
|
|
13
|
+
}
|
|
14
|
+
),
|
|
15
|
+
" ",
|
|
16
|
+
"and",
|
|
17
|
+
" ",
|
|
18
|
+
/* @__PURE__ */ jsx(
|
|
19
|
+
Link,
|
|
20
|
+
{
|
|
21
|
+
href: hrefs.privacyNotice,
|
|
22
|
+
className: "underline hover:text-foreground transition-colors",
|
|
23
|
+
children: "Privacy Notice"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
", and acceptance of risks described in the",
|
|
27
|
+
" ",
|
|
28
|
+
/* @__PURE__ */ jsx(
|
|
29
|
+
Link,
|
|
30
|
+
{
|
|
31
|
+
href: hrefs.riskDisclosure,
|
|
32
|
+
className: "underline hover:text-foreground transition-colors",
|
|
33
|
+
children: "Risk Disclosure Statement"
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
"."
|
|
37
|
+
] });
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
LegalDisclaimer
|
|
41
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { BackButton } from "
|
|
3
|
-
import { Card } from "
|
|
2
|
+
import { BackButton } from "../buttons/back-button.js";
|
|
3
|
+
import { Card } from "../card.js";
|
|
4
4
|
function PageLayout({
|
|
5
5
|
children,
|
|
6
6
|
title,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRouter } from "next/navigation";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import ReactMarkdown from "react-markdown";
|
|
6
|
+
import remarkGfm from "remark-gfm";
|
|
7
|
+
import { PageLayout } from "./layout/index.js";
|
|
8
|
+
function slugify(text) {
|
|
9
|
+
return text.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-");
|
|
10
|
+
}
|
|
11
|
+
function getTextContent(children) {
|
|
12
|
+
if (typeof children === "string") {
|
|
13
|
+
return children;
|
|
14
|
+
}
|
|
15
|
+
if (typeof children === "number") {
|
|
16
|
+
return String(children);
|
|
17
|
+
}
|
|
18
|
+
if (Array.isArray(children)) {
|
|
19
|
+
return children.map(getTextContent).join("");
|
|
20
|
+
}
|
|
21
|
+
if (children && typeof children === "object" && "props" in children) {
|
|
22
|
+
return getTextContent(children.props.children);
|
|
23
|
+
}
|
|
24
|
+
return "";
|
|
25
|
+
}
|
|
26
|
+
function extractCustomId(children) {
|
|
27
|
+
const text = getTextContent(children);
|
|
28
|
+
const customIdMatch = text.match(/\{#([a-z0-9-]+)\}\s*$/i);
|
|
29
|
+
if (customIdMatch) {
|
|
30
|
+
const id = customIdMatch[1];
|
|
31
|
+
if (typeof children === "string") {
|
|
32
|
+
const displayText = text.replace(/\s*\{#[a-z0-9-]+\}\s*$/i, "").trim();
|
|
33
|
+
return { id, displayText };
|
|
34
|
+
}
|
|
35
|
+
return { id, displayText: children };
|
|
36
|
+
}
|
|
37
|
+
return { id: slugify(text), displayText: children };
|
|
38
|
+
}
|
|
39
|
+
function MarkdownViewer({ content, title }) {
|
|
40
|
+
const router = useRouter();
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const hash = window.location.hash;
|
|
43
|
+
if (hash) {
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
const element = document.getElementById(hash.slice(1));
|
|
46
|
+
if (element) {
|
|
47
|
+
element.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
48
|
+
}
|
|
49
|
+
}, 100);
|
|
50
|
+
}
|
|
51
|
+
}, []);
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
PageLayout,
|
|
54
|
+
{
|
|
55
|
+
title: title || "",
|
|
56
|
+
backButton: { href: "/", text: "Back", onClick: () => router.back() },
|
|
57
|
+
children: /* @__PURE__ */ jsx("article", { className: "prose prose-invert prose-lg max-w-none", children: /* @__PURE__ */ jsx(
|
|
58
|
+
ReactMarkdown,
|
|
59
|
+
{
|
|
60
|
+
remarkPlugins: [remarkGfm],
|
|
61
|
+
components: {
|
|
62
|
+
h1: ({ children, ...props }) => {
|
|
63
|
+
const { id, displayText } = extractCustomId(children);
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
"h1",
|
|
66
|
+
{
|
|
67
|
+
id,
|
|
68
|
+
className: "text-3xl font-bold text-foreground mt-8 mb-4 scroll-mt-24",
|
|
69
|
+
...props,
|
|
70
|
+
children: displayText
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
},
|
|
74
|
+
h2: ({ children, ...props }) => {
|
|
75
|
+
const { id, displayText } = extractCustomId(children);
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
"h2",
|
|
78
|
+
{
|
|
79
|
+
id,
|
|
80
|
+
className: "text-2xl font-semibold text-foreground mt-6 mb-3 scroll-mt-24",
|
|
81
|
+
...props,
|
|
82
|
+
children: displayText
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
},
|
|
86
|
+
h3: ({ children, ...props }) => {
|
|
87
|
+
const { id, displayText } = extractCustomId(children);
|
|
88
|
+
return /* @__PURE__ */ jsx(
|
|
89
|
+
"h3",
|
|
90
|
+
{
|
|
91
|
+
id,
|
|
92
|
+
className: "text-xl font-semibold text-foreground mt-5 mb-2 scroll-mt-24",
|
|
93
|
+
...props,
|
|
94
|
+
children: displayText
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
},
|
|
98
|
+
h4: ({ children, ...props }) => {
|
|
99
|
+
const { id, displayText } = extractCustomId(children);
|
|
100
|
+
return /* @__PURE__ */ jsx(
|
|
101
|
+
"h4",
|
|
102
|
+
{
|
|
103
|
+
id,
|
|
104
|
+
className: "text-lg font-semibold text-foreground mt-4 mb-2 scroll-mt-24",
|
|
105
|
+
...props,
|
|
106
|
+
children: displayText
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
},
|
|
110
|
+
p: ({ ...props }) => /* @__PURE__ */ jsx(
|
|
111
|
+
"p",
|
|
112
|
+
{
|
|
113
|
+
className: "text-muted-foreground mb-4 leading-relaxed",
|
|
114
|
+
...props
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
a: ({ href, ...props }) => {
|
|
118
|
+
const isAnchorLink = href?.startsWith("#");
|
|
119
|
+
if (isAnchorLink && href) {
|
|
120
|
+
return /* @__PURE__ */ jsx(
|
|
121
|
+
"a",
|
|
122
|
+
{
|
|
123
|
+
href,
|
|
124
|
+
className: "text-blue-400 hover:text-blue-300 underline transition-colors duration-200",
|
|
125
|
+
onClick: (e) => {
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
const targetId = href.slice(1);
|
|
128
|
+
const element = document.getElementById(targetId);
|
|
129
|
+
if (element) {
|
|
130
|
+
element.scrollIntoView({
|
|
131
|
+
behavior: "smooth",
|
|
132
|
+
block: "start"
|
|
133
|
+
});
|
|
134
|
+
window.history.pushState(null, "", href);
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
...props
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
return /* @__PURE__ */ jsx(
|
|
142
|
+
"a",
|
|
143
|
+
{
|
|
144
|
+
href,
|
|
145
|
+
className: "text-blue-400 hover:text-blue-300 underline transition-colors duration-200",
|
|
146
|
+
target: "_blank",
|
|
147
|
+
rel: "noopener noreferrer",
|
|
148
|
+
...props
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
},
|
|
152
|
+
ul: ({ ...props }) => /* @__PURE__ */ jsx(
|
|
153
|
+
"ul",
|
|
154
|
+
{
|
|
155
|
+
className: "list-disc list-inside mb-4 text-muted-foreground space-y-2",
|
|
156
|
+
...props
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
ol: ({ ...props }) => /* @__PURE__ */ jsx(
|
|
160
|
+
"ol",
|
|
161
|
+
{
|
|
162
|
+
className: "list-decimal list-inside mb-4 text-muted-foreground space-y-2",
|
|
163
|
+
...props
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
li: ({ ...props }) => /* @__PURE__ */ jsx("li", { className: "ml-4 text-muted-foreground", ...props }),
|
|
167
|
+
blockquote: ({ ...props }) => /* @__PURE__ */ jsx(
|
|
168
|
+
"blockquote",
|
|
169
|
+
{
|
|
170
|
+
className: "border-l-4 border-gray-700 pl-4 my-4 italic text-muted-foreground",
|
|
171
|
+
...props
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
code: ({ className, ...props }) => {
|
|
175
|
+
const isInline = !className?.includes("language-");
|
|
176
|
+
return isInline ? /* @__PURE__ */ jsx(
|
|
177
|
+
"code",
|
|
178
|
+
{
|
|
179
|
+
className: "bg-gray-800 text-gray-200 px-1.5 py-0.5 rounded text-sm font-mono",
|
|
180
|
+
...props
|
|
181
|
+
}
|
|
182
|
+
) : /* @__PURE__ */ jsx(
|
|
183
|
+
"code",
|
|
184
|
+
{
|
|
185
|
+
className: "block bg-gray-800 text-gray-200 p-4 rounded-lg my-4 font-mono text-sm overflow-x-auto",
|
|
186
|
+
...props
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
},
|
|
190
|
+
strong: ({ ...props }) => /* @__PURE__ */ jsx("strong", { className: "font-bold text-foreground", ...props }),
|
|
191
|
+
em: ({ ...props }) => /* @__PURE__ */ jsx("em", { className: "italic text-foreground", ...props })
|
|
192
|
+
},
|
|
193
|
+
children: content
|
|
194
|
+
}
|
|
195
|
+
) })
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
MarkdownViewer
|
|
201
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface NavigationButtonProps {
|
|
3
|
+
href: string;
|
|
4
|
+
text: string;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const NavigationButton: React.ForwardRefExoticComponent<NavigationButtonProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
8
|
+
export { NavigationButton };
|
|
@@ -10,7 +10,8 @@ export * from "./dropdown-menu";
|
|
|
10
10
|
export * from "./editable-table";
|
|
11
11
|
export * from "./input";
|
|
12
12
|
export * from "./label";
|
|
13
|
-
export * from "./
|
|
13
|
+
export * from "./layout";
|
|
14
|
+
export * from "./markdown-viewer";
|
|
14
15
|
export * from "./search-bar";
|
|
15
16
|
export * from "./select";
|
|
16
17
|
export * from "./signatures";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type NavigationButtonProps } from "../buttons";
|
|
2
|
+
export declare function Header({ appName, navigation, connectKitButton, }: {
|
|
3
|
+
appName: string;
|
|
4
|
+
navigation: NavigationButtonProps[];
|
|
5
|
+
connectKitButton: React.ReactNode;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/permissionless-ui",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Internal UI components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -52,6 +52,9 @@
|
|
|
52
52
|
"next": "15.5.3",
|
|
53
53
|
"react": "^18",
|
|
54
54
|
"react-dom": "^18",
|
|
55
|
+
"react-markdown": "^9.0.3",
|
|
56
|
+
"react-markdown-math": "^1.0.2",
|
|
57
|
+
"remark-gfm": "^4.0.0",
|
|
55
58
|
"sonner": "^1.7.2",
|
|
56
59
|
"styled-jsx": "^5.1.6",
|
|
57
60
|
"tailwind-merge": "^2.6.0",
|
|
File without changes
|