@gearbox-protocol/permissionless-ui 1.0.3 → 1.0.5
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/{back-button.js → buttons/back-button.js} +9 -3
- package/dist/cjs/components/buttons/index.js +2 -0
- package/dist/cjs/components/editable-table/editable-table.js +33 -0
- package/dist/cjs/components/index.js +0 -2
- package/dist/cjs/components/page-layout.js +30 -6
- package/dist/esm/components/{back-button.js → buttons/back-button.js} +8 -2
- package/dist/esm/components/buttons/index.js +1 -0
- package/dist/esm/components/editable-table/editable-table.js +33 -1
- package/dist/esm/components/index.js +0 -1
- package/dist/esm/components/page-layout.js +30 -6
- package/dist/types/components/buttons/back-button.d.ts +8 -0
- package/dist/types/components/buttons/button.d.ts +1 -1
- package/dist/types/components/buttons/index.d.ts +1 -0
- package/dist/types/components/editable-table/editable-table.d.ts +9 -0
- package/dist/types/components/index.d.ts +0 -1
- package/dist/types/components/page-layout.d.ts +6 -2
- package/package.json +1 -1
- package/dist/types/components/back-button.d.ts +0 -7
|
@@ -34,16 +34,22 @@ module.exports = __toCommonJS(back_button_exports);
|
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_lucide_react = require("lucide-react");
|
|
36
36
|
var import_link = __toESM(require("next/link"));
|
|
37
|
-
var import_utils =
|
|
38
|
-
function BackButton({
|
|
37
|
+
var import_utils = require('../../utils/index.js');
|
|
38
|
+
function BackButton({
|
|
39
|
+
href,
|
|
40
|
+
text,
|
|
41
|
+
onClick,
|
|
42
|
+
className
|
|
43
|
+
}) {
|
|
39
44
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
40
45
|
import_link.default,
|
|
41
46
|
{
|
|
42
47
|
href,
|
|
43
|
-
className: (0, import_utils.
|
|
48
|
+
className: (0, import_utils.cn)(
|
|
44
49
|
"flex items-center text-sm text-muted-foreground hover:text-foreground mb-6",
|
|
45
50
|
className
|
|
46
51
|
),
|
|
52
|
+
onClick,
|
|
47
53
|
children: [
|
|
48
54
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowLeft, { className: "mr-2 h-4 w-4" }),
|
|
49
55
|
text || "Back"
|
|
@@ -15,12 +15,14 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
15
15
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
16
|
var buttons_exports = {};
|
|
17
17
|
module.exports = __toCommonJS(buttons_exports);
|
|
18
|
+
__reExport(buttons_exports, require('./back-button.js'), module.exports);
|
|
18
19
|
__reExport(buttons_exports, require('./button.js'), module.exports);
|
|
19
20
|
__reExport(buttons_exports, require('./copy-button.js'), module.exports);
|
|
20
21
|
__reExport(buttons_exports, require('./external-button.js'), module.exports);
|
|
21
22
|
__reExport(buttons_exports, require('./tab-button.js'), module.exports);
|
|
22
23
|
// Annotate the CommonJS export names for ESM import in node:
|
|
23
24
|
0 && (module.exports = {
|
|
25
|
+
...require('./back-button.js'),
|
|
24
26
|
...require('./button.js'),
|
|
25
27
|
...require('./copy-button.js'),
|
|
26
28
|
...require('./external-button.js'),
|
|
@@ -18,15 +18,47 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var editable_table_exports = {};
|
|
20
20
|
__export(editable_table_exports, {
|
|
21
|
+
TableCellAsset: () => TableCellAsset,
|
|
21
22
|
TableCellUpdatable: () => TableCellUpdatable,
|
|
22
23
|
TableEditable: () => TableEditable
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(editable_table_exports);
|
|
25
26
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
|
+
var import_lucide_react = require("lucide-react");
|
|
26
28
|
var import_auth = require('../auth/index.js');
|
|
27
29
|
var import_buttons = require('../buttons/index.js');
|
|
28
30
|
var import_table = require('../table.js');
|
|
31
|
+
var import_token_icon = require('../token-icon.js');
|
|
29
32
|
var import_updated_value = require('./updated-value.js');
|
|
33
|
+
function TableCellAsset({
|
|
34
|
+
assetAddress,
|
|
35
|
+
symbol,
|
|
36
|
+
iconSymbol,
|
|
37
|
+
comment,
|
|
38
|
+
explorerUrl
|
|
39
|
+
}) {
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_table.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_token_icon.TokenIcon, { symbol: iconSymbol ?? symbol, size: 24 }),
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "font-medium", children: symbol }),
|
|
44
|
+
comment && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-md text-muted-foreground", children: [
|
|
45
|
+
"(",
|
|
46
|
+
comment,
|
|
47
|
+
")"
|
|
48
|
+
] }),
|
|
49
|
+
explorerUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
import_buttons.Button,
|
|
51
|
+
{
|
|
52
|
+
variant: "ghost",
|
|
53
|
+
size: "sm",
|
|
54
|
+
className: "text-muted-foreground hover:text-white p-0 h-auto",
|
|
55
|
+
onClick: () => window.open(`${explorerUrl}/address/${assetAddress}`, "_blank"),
|
|
56
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ExternalLink, { className: "h-3 w-3" })
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
] })
|
|
60
|
+
] }) });
|
|
61
|
+
}
|
|
30
62
|
function TableCellUpdatable({
|
|
31
63
|
oldValue,
|
|
32
64
|
newValue,
|
|
@@ -90,6 +122,7 @@ function TableEditable({
|
|
|
90
122
|
}
|
|
91
123
|
// Annotate the CommonJS export names for ESM import in node:
|
|
92
124
|
0 && (module.exports = {
|
|
125
|
+
TableCellAsset,
|
|
93
126
|
TableCellUpdatable,
|
|
94
127
|
TableEditable
|
|
95
128
|
});
|
|
@@ -17,7 +17,6 @@ var components_exports = {};
|
|
|
17
17
|
module.exports = __toCommonJS(components_exports);
|
|
18
18
|
__reExport(components_exports, require('./alert-dialog.js'), module.exports);
|
|
19
19
|
__reExport(components_exports, require('./auth/index.js'), module.exports);
|
|
20
|
-
__reExport(components_exports, require('./back-button.js'), module.exports);
|
|
21
20
|
__reExport(components_exports, require('./badge.js'), module.exports);
|
|
22
21
|
__reExport(components_exports, require('./buttons/index.js'), module.exports);
|
|
23
22
|
__reExport(components_exports, require('./card.js'), module.exports);
|
|
@@ -41,7 +40,6 @@ __reExport(components_exports, require('./tooltip.js'), module.exports);
|
|
|
41
40
|
0 && (module.exports = {
|
|
42
41
|
...require('./alert-dialog.js'),
|
|
43
42
|
...require('./auth/index.js'),
|
|
44
|
-
...require('./back-button.js'),
|
|
45
43
|
...require('./badge.js'),
|
|
46
44
|
...require('./buttons/index.js'),
|
|
47
45
|
...require('./card.js'),
|
|
@@ -22,12 +22,36 @@ __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('./back-button.js');
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
var import_back_button = require('./buttons/back-button.js');
|
|
26
|
+
var import_card = require('./card.js');
|
|
27
|
+
function PageLayout({
|
|
28
|
+
children,
|
|
29
|
+
title,
|
|
30
|
+
description,
|
|
31
|
+
icon,
|
|
32
|
+
backButton,
|
|
33
|
+
actionButton
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-h-screen bg-black text-white p-6 overflow-y-auto", children: [
|
|
36
|
+
backButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
37
|
+
import_back_button.BackButton,
|
|
38
|
+
{
|
|
39
|
+
href: backButton.href,
|
|
40
|
+
text: backButton.text,
|
|
41
|
+
onClick: backButton.onClick
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center space-x-4 mb-6 w-full", children: [
|
|
45
|
+
icon,
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full", children: [
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex justify-between items-center w-full", children: [
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-3xl font-bold", children: title }),
|
|
49
|
+
actionButton
|
|
50
|
+
] }),
|
|
51
|
+
description
|
|
52
|
+
] })
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_card.Card, { className: "bg-black border-0 overflow-y-auto", children })
|
|
31
55
|
] });
|
|
32
56
|
}
|
|
33
57
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ArrowLeft } from "lucide-react";
|
|
3
3
|
import Link from "next/link";
|
|
4
|
-
import cn from "
|
|
5
|
-
function BackButton({
|
|
4
|
+
import { cn } from "../../utils/index.js";
|
|
5
|
+
function BackButton({
|
|
6
|
+
href,
|
|
7
|
+
text,
|
|
8
|
+
onClick,
|
|
9
|
+
className
|
|
10
|
+
}) {
|
|
6
11
|
return /* @__PURE__ */ jsxs(
|
|
7
12
|
Link,
|
|
8
13
|
{
|
|
@@ -11,6 +16,7 @@ function BackButton({ href, text, className }) {
|
|
|
11
16
|
"flex items-center text-sm text-muted-foreground hover:text-foreground mb-6",
|
|
12
17
|
className
|
|
13
18
|
),
|
|
19
|
+
onClick,
|
|
14
20
|
children: [
|
|
15
21
|
/* @__PURE__ */ jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }),
|
|
16
22
|
text || "Back"
|
|
@@ -1,8 +1,39 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ExternalLink } from "lucide-react";
|
|
2
3
|
import { SignInRequired } from "../auth/index.js";
|
|
3
|
-
import { TabButton } from "../buttons/index.js";
|
|
4
|
+
import { Button, TabButton } from "../buttons/index.js";
|
|
4
5
|
import { Table, TableCell } from "../table.js";
|
|
6
|
+
import { TokenIcon } from "../token-icon.js";
|
|
5
7
|
import { UpdatedValue } from "./updated-value.js";
|
|
8
|
+
function TableCellAsset({
|
|
9
|
+
assetAddress,
|
|
10
|
+
symbol,
|
|
11
|
+
iconSymbol,
|
|
12
|
+
comment,
|
|
13
|
+
explorerUrl
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
16
|
+
/* @__PURE__ */ jsx(TokenIcon, { symbol: iconSymbol ?? symbol, size: 24 }),
|
|
17
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium", children: symbol }),
|
|
19
|
+
comment && /* @__PURE__ */ jsxs("div", { className: "text-md text-muted-foreground", children: [
|
|
20
|
+
"(",
|
|
21
|
+
comment,
|
|
22
|
+
")"
|
|
23
|
+
] }),
|
|
24
|
+
explorerUrl && /* @__PURE__ */ jsx(
|
|
25
|
+
Button,
|
|
26
|
+
{
|
|
27
|
+
variant: "ghost",
|
|
28
|
+
size: "sm",
|
|
29
|
+
className: "text-muted-foreground hover:text-white p-0 h-auto",
|
|
30
|
+
onClick: () => window.open(`${explorerUrl}/address/${assetAddress}`, "_blank"),
|
|
31
|
+
children: /* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3" })
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] })
|
|
35
|
+
] }) });
|
|
36
|
+
}
|
|
6
37
|
function TableCellUpdatable({
|
|
7
38
|
oldValue,
|
|
8
39
|
newValue,
|
|
@@ -65,6 +96,7 @@ function TableEditable({
|
|
|
65
96
|
] });
|
|
66
97
|
}
|
|
67
98
|
export {
|
|
99
|
+
TableCellAsset,
|
|
68
100
|
TableCellUpdatable,
|
|
69
101
|
TableEditable
|
|
70
102
|
};
|
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { BackButton } from "./back-button.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { BackButton } from "./buttons/back-button.js";
|
|
3
|
+
import { Card } from "./card.js";
|
|
4
|
+
function PageLayout({
|
|
5
|
+
children,
|
|
6
|
+
title,
|
|
7
|
+
description,
|
|
8
|
+
icon,
|
|
9
|
+
backButton,
|
|
10
|
+
actionButton
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-black text-white p-6 overflow-y-auto", children: [
|
|
13
|
+
backButton && /* @__PURE__ */ jsx(
|
|
14
|
+
BackButton,
|
|
15
|
+
{
|
|
16
|
+
href: backButton.href,
|
|
17
|
+
text: backButton.text,
|
|
18
|
+
onClick: backButton.onClick
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-4 mb-6 w-full", children: [
|
|
22
|
+
icon,
|
|
23
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
24
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center w-full", children: [
|
|
25
|
+
/* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold", children: title }),
|
|
26
|
+
actionButton
|
|
27
|
+
] }),
|
|
28
|
+
description
|
|
29
|
+
] })
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ jsx(Card, { className: "bg-black border-0 overflow-y-auto", children })
|
|
8
32
|
] });
|
|
9
33
|
}
|
|
10
34
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "
|
|
4
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "pink" | "pink-outline" | "blue" | "blue-outline" | null | undefined;
|
|
5
5
|
size?: "default" | "xs" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
interface TableCellAssetProps {
|
|
3
|
+
assetAddress: Address;
|
|
4
|
+
symbol: string;
|
|
5
|
+
comment?: string;
|
|
6
|
+
explorerUrl?: string;
|
|
7
|
+
iconSymbol?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function TableCellAsset({ assetAddress, symbol, iconSymbol, comment, explorerUrl, }: TableCellAssetProps): import("react/jsx-runtime").JSX.Element;
|
|
1
10
|
export interface TableCellUpdatableProps {
|
|
2
11
|
oldValue?: string;
|
|
3
12
|
newValue: string;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
interface PageLayoutProps {
|
|
2
2
|
children: React.ReactNode;
|
|
3
3
|
title: string;
|
|
4
|
+
description?: JSX.Element;
|
|
5
|
+
icon?: JSX.Element;
|
|
4
6
|
backButton?: {
|
|
5
7
|
href: string;
|
|
6
|
-
text
|
|
8
|
+
text?: string;
|
|
9
|
+
onClick?: () => void;
|
|
7
10
|
};
|
|
11
|
+
actionButton?: JSX.Element;
|
|
8
12
|
}
|
|
9
|
-
export declare function PageLayout({ children, title, backButton }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function PageLayout({ children, title, description, icon, backButton, actionButton, }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
export {};
|
package/package.json
CHANGED