@gearbox-protocol/permissionless-ui 1.0.1 → 1.0.2
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/alert-dialog.js +3 -3
- package/dist/cjs/components/auth/index.js +24 -0
- package/dist/cjs/components/auth/signin-required.js +69 -0
- package/dist/cjs/components/auth/signin-wrapper.js +45 -0
- package/dist/cjs/components/auth/siwe-provider.js +101 -0
- package/dist/cjs/components/buttons/index.js +28 -0
- package/dist/cjs/components/editable-table/edit-button.js +2 -2
- package/dist/cjs/components/editable-table/editable-table.js +8 -6
- package/dist/cjs/components/editable-table/index.js +26 -0
- package/dist/cjs/components/index.js +6 -14
- package/dist/cjs/utils/format.js +72 -0
- package/dist/cjs/utils/index.js +3 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/auth/index.js +2 -0
- package/dist/esm/components/auth/signin-required.js +49 -0
- package/dist/esm/components/auth/signin-wrapper.js +11 -0
- package/dist/esm/components/auth/siwe-provider.js +77 -0
- package/dist/esm/components/buttons/index.js +4 -0
- package/dist/esm/components/editable-table/edit-button.js +1 -1
- package/dist/esm/components/editable-table/editable-table.js +6 -4
- package/dist/esm/components/editable-table/index.js +3 -0
- package/dist/esm/components/index.js +3 -7
- package/dist/esm/utils/format.js +43 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/types/components/auth/index.d.ts +2 -0
- package/dist/types/components/auth/signin-required.d.ts +9 -0
- package/dist/types/components/auth/signin-wrapper.d.ts +2 -0
- package/dist/types/components/auth/siwe-provider.d.ts +7 -0
- package/dist/types/components/buttons/index.d.ts +4 -0
- package/dist/types/components/editable-table/editable-table.d.ts +2 -1
- package/dist/types/components/editable-table/index.d.ts +3 -0
- package/dist/types/components/index.d.ts +3 -7
- package/dist/types/utils/format.d.ts +6 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +5 -2
|
@@ -45,7 +45,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
45
45
|
var AlertDialogPrimitive = __toESM(require("@radix-ui/react-alert-dialog"));
|
|
46
46
|
var React = __toESM(require("react"));
|
|
47
47
|
var import_utils = __toESM(require('../utils/index.js'));
|
|
48
|
-
var
|
|
48
|
+
var import_buttons = require('./buttons/index.js');
|
|
49
49
|
const AlertDialog = AlertDialogPrimitive.Root;
|
|
50
50
|
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
51
51
|
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
@@ -126,7 +126,7 @@ const AlertDialogAction = React.forwardRef(({ className, ...props }, ref) => /*
|
|
|
126
126
|
AlertDialogPrimitive.Action,
|
|
127
127
|
{
|
|
128
128
|
ref,
|
|
129
|
-
className: (0, import_utils.default)((0,
|
|
129
|
+
className: (0, import_utils.default)((0, import_buttons.buttonVariants)(), className),
|
|
130
130
|
...props
|
|
131
131
|
}
|
|
132
132
|
));
|
|
@@ -136,7 +136,7 @@ const AlertDialogCancel = React.forwardRef(({ className, ...props }, ref) => /*
|
|
|
136
136
|
{
|
|
137
137
|
ref,
|
|
138
138
|
className: (0, import_utils.default)(
|
|
139
|
-
(0,
|
|
139
|
+
(0, import_buttons.buttonVariants)({ variant: "outline" }),
|
|
140
140
|
"mt-2 sm:mt-0",
|
|
141
141
|
className
|
|
142
142
|
),
|
|
@@ -0,0 +1,24 @@
|
|
|
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 auth_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(auth_exports);
|
|
18
|
+
__reExport(auth_exports, require('./signin-wrapper.js'), module.exports);
|
|
19
|
+
__reExport(auth_exports, require('./siwe-provider.js'), module.exports);
|
|
20
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
21
|
+
0 && (module.exports = {
|
|
22
|
+
...require('./signin-wrapper.js'),
|
|
23
|
+
...require('./siwe-provider.js')
|
|
24
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var signin_required_exports = {};
|
|
21
|
+
__export(signin_required_exports, {
|
|
22
|
+
default: () => SignInRequired
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(signin_required_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_connectkit = require("connectkit");
|
|
27
|
+
var import_wagmi = require("wagmi");
|
|
28
|
+
var import_utils = require('../../utils/index.js');
|
|
29
|
+
var import_buttons = require('../buttons/index.js');
|
|
30
|
+
function SignInRequired({
|
|
31
|
+
children,
|
|
32
|
+
owner,
|
|
33
|
+
skipSignIn,
|
|
34
|
+
...customProps
|
|
35
|
+
}) {
|
|
36
|
+
const { setOpen, openSIWE } = (0, import_connectkit.useModal)();
|
|
37
|
+
const { isConnected, address } = (0, import_wagmi.useAccount)();
|
|
38
|
+
const { isRejected, isLoading, isSignedIn, data } = (0, import_connectkit.useSIWE)();
|
|
39
|
+
const ButtonComponent = Object.keys(customProps).length > 0 ? import_buttons.Button : import_buttons.TabButton;
|
|
40
|
+
if (isSignedIn || skipSignIn) {
|
|
41
|
+
if (owner && data?.address?.toLowerCase() !== owner.toLowerCase()) {
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ButtonComponent, { ...customProps, disabled: true, children: "You are not the author" });
|
|
43
|
+
}
|
|
44
|
+
return children;
|
|
45
|
+
}
|
|
46
|
+
if (isConnected && address) {
|
|
47
|
+
if (isRejected) {
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
+
ButtonComponent,
|
|
50
|
+
{
|
|
51
|
+
...customProps,
|
|
52
|
+
onClick: () => setOpen(true),
|
|
53
|
+
disabled: isLoading,
|
|
54
|
+
children: "Try Again"
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
ButtonComponent,
|
|
60
|
+
{
|
|
61
|
+
...customProps,
|
|
62
|
+
onClick: () => openSIWE(),
|
|
63
|
+
disabled: isLoading,
|
|
64
|
+
children: isLoading ? "Awaiting request..." : `Sign In as ${(0, import_utils.shortenHash)(address)}`
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ButtonComponent, { ...customProps, onClick: () => setOpen(true), children: "Connect Wallet" });
|
|
69
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 signin_wrapper_exports = {};
|
|
31
|
+
__export(signin_wrapper_exports, {
|
|
32
|
+
SignInRequired: () => SignInRequired
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(signin_wrapper_exports);
|
|
35
|
+
var import_dynamic = __toESM(require("next/dynamic"));
|
|
36
|
+
const SignInRequired = (0, import_dynamic.default)(
|
|
37
|
+
() => import("./signin-required"),
|
|
38
|
+
{
|
|
39
|
+
ssr: false
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
SignInRequired
|
|
45
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
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 siwe_provider_exports = {};
|
|
20
|
+
__export(siwe_provider_exports, {
|
|
21
|
+
SIWEClientProvider: () => SIWEClientProvider
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(siwe_provider_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_connectkit = require("connectkit");
|
|
26
|
+
var import_navigation = require("next/navigation");
|
|
27
|
+
var import_siwe = require("viem/siwe");
|
|
28
|
+
function SIWEClientProvider({
|
|
29
|
+
apiRoutePrefix,
|
|
30
|
+
statement,
|
|
31
|
+
children,
|
|
32
|
+
...props
|
|
33
|
+
}) {
|
|
34
|
+
const router = (0, import_navigation.useRouter)();
|
|
35
|
+
const getNonce = async () => {
|
|
36
|
+
const res = await fetch(`${apiRoutePrefix}/nonce`);
|
|
37
|
+
if (!res.ok) {
|
|
38
|
+
throw new Error("Failed to fetch SIWE nonce");
|
|
39
|
+
}
|
|
40
|
+
const nonce = await res.text();
|
|
41
|
+
return nonce;
|
|
42
|
+
};
|
|
43
|
+
const createMessage = ({
|
|
44
|
+
nonce,
|
|
45
|
+
address,
|
|
46
|
+
chainId
|
|
47
|
+
}) => (0, import_siwe.createSiweMessage)({
|
|
48
|
+
version: "1",
|
|
49
|
+
domain: window.location.host,
|
|
50
|
+
uri: window.location.origin,
|
|
51
|
+
address,
|
|
52
|
+
chainId,
|
|
53
|
+
nonce,
|
|
54
|
+
statement: statement || "Sign In With Ethereum."
|
|
55
|
+
});
|
|
56
|
+
const verifyMessage = async ({
|
|
57
|
+
message,
|
|
58
|
+
signature
|
|
59
|
+
}) => {
|
|
60
|
+
const res = await fetch(`${apiRoutePrefix}/signin`, {
|
|
61
|
+
method: "POST",
|
|
62
|
+
body: JSON.stringify({ message, signature })
|
|
63
|
+
});
|
|
64
|
+
if (!res.ok) {
|
|
65
|
+
throw new Error("Failed to verify SIWE message");
|
|
66
|
+
}
|
|
67
|
+
return true;
|
|
68
|
+
};
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
+
import_connectkit.SIWEProvider,
|
|
71
|
+
{
|
|
72
|
+
getNonce,
|
|
73
|
+
createMessage,
|
|
74
|
+
verifyMessage: async (args) => verifyMessage(args),
|
|
75
|
+
getSession: async () => {
|
|
76
|
+
const res = await fetch(`${apiRoutePrefix}/session`);
|
|
77
|
+
if (!res.ok) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return res.json();
|
|
81
|
+
},
|
|
82
|
+
onSignIn: async (session) => {
|
|
83
|
+
router.refresh();
|
|
84
|
+
return session;
|
|
85
|
+
},
|
|
86
|
+
signOut: async () => {
|
|
87
|
+
await fetch(`${apiRoutePrefix}/logout`, {
|
|
88
|
+
method: "POST"
|
|
89
|
+
});
|
|
90
|
+
router.refresh();
|
|
91
|
+
return true;
|
|
92
|
+
},
|
|
93
|
+
...props,
|
|
94
|
+
children
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
+
0 && (module.exports = {
|
|
100
|
+
SIWEClientProvider
|
|
101
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
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 buttons_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(buttons_exports);
|
|
18
|
+
__reExport(buttons_exports, require('./button.js'), module.exports);
|
|
19
|
+
__reExport(buttons_exports, require('./copy-button.js'), module.exports);
|
|
20
|
+
__reExport(buttons_exports, require('./external-button.js'), module.exports);
|
|
21
|
+
__reExport(buttons_exports, require('./tab-button.js'), module.exports);
|
|
22
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
+
0 && (module.exports = {
|
|
24
|
+
...require('./button.js'),
|
|
25
|
+
...require('./copy-button.js'),
|
|
26
|
+
...require('./external-button.js'),
|
|
27
|
+
...require('./tab-button.js')
|
|
28
|
+
});
|
|
@@ -23,14 +23,14 @@ __export(edit_button_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(edit_button_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_lucide_react = require("lucide-react");
|
|
26
|
-
var
|
|
26
|
+
var import_buttons = require('../buttons/index.js');
|
|
27
27
|
function EditButton({
|
|
28
28
|
onClick,
|
|
29
29
|
customButton,
|
|
30
30
|
disabled
|
|
31
31
|
}) {
|
|
32
32
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: customButton ? "px-4 py-2" : "px-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
33
|
-
|
|
33
|
+
import_buttons.Button,
|
|
34
34
|
{
|
|
35
35
|
className: customButton ? "p-0 h-fit hover:bg-accent/0" : "p-2 h-fit",
|
|
36
36
|
variant: "ghost",
|
|
@@ -23,7 +23,8 @@ __export(editable_table_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(editable_table_exports);
|
|
25
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
-
var
|
|
26
|
+
var import_auth = require('../auth/index.js');
|
|
27
|
+
var import_buttons = require('../buttons/index.js');
|
|
27
28
|
var import_table = require('../table.js');
|
|
28
29
|
var import_updated_value = require('./updated-value.js');
|
|
29
30
|
function TableCellUpdatable({
|
|
@@ -65,15 +66,16 @@ function TableEditable({
|
|
|
65
66
|
isLoading,
|
|
66
67
|
actions,
|
|
67
68
|
children,
|
|
68
|
-
disabled = false
|
|
69
|
+
disabled = false,
|
|
70
|
+
skipSignIn = true
|
|
69
71
|
}) {
|
|
70
72
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
|
|
71
73
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex justify-between items-center", children: [
|
|
72
74
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-2xl font-bold", children: title }),
|
|
73
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
74
|
-
onNew && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_auth.SignInRequired, { skipSignIn, variant: "pink", size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
76
|
+
onNew && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_buttons.TabButton, { onClick: onNew, disabled: isLoading || disabled, children: isLoading ? buttonLoadingText : newButtonText }),
|
|
75
77
|
actions?.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
-
|
|
78
|
+
import_buttons.TabButton,
|
|
77
79
|
{
|
|
78
80
|
onClick: action.onClick,
|
|
79
81
|
disabled: action.isLoading || disabled,
|
|
@@ -81,7 +83,7 @@ function TableEditable({
|
|
|
81
83
|
},
|
|
82
84
|
index
|
|
83
85
|
))
|
|
84
|
-
] })
|
|
86
|
+
] }) })
|
|
85
87
|
] }),
|
|
86
88
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "rounded-lg border", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_table.Table, { children }) })
|
|
87
89
|
] });
|
|
@@ -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 editable_table_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(editable_table_exports);
|
|
18
|
+
__reExport(editable_table_exports, require('./edit-button.js'), module.exports);
|
|
19
|
+
__reExport(editable_table_exports, require('./editable-table.js'), module.exports);
|
|
20
|
+
__reExport(editable_table_exports, require('./updated-value.js'), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require('./edit-button.js'),
|
|
24
|
+
...require('./editable-table.js'),
|
|
25
|
+
...require('./updated-value.js')
|
|
26
|
+
});
|
|
@@ -16,20 +16,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
16
16
|
var components_exports = {};
|
|
17
17
|
module.exports = __toCommonJS(components_exports);
|
|
18
18
|
__reExport(components_exports, require('./alert-dialog.js'), module.exports);
|
|
19
|
+
__reExport(components_exports, require('./auth/index.js'), module.exports);
|
|
19
20
|
__reExport(components_exports, require('./back-button.js'), module.exports);
|
|
20
21
|
__reExport(components_exports, require('./badge.js'), module.exports);
|
|
21
|
-
__reExport(components_exports, require('./buttons/
|
|
22
|
-
__reExport(components_exports, require('./buttons/copy-button.js'), module.exports);
|
|
23
|
-
__reExport(components_exports, require('./buttons/external-button.js'), module.exports);
|
|
24
|
-
__reExport(components_exports, require('./buttons/tab-button.js'), module.exports);
|
|
22
|
+
__reExport(components_exports, require('./buttons/index.js'), module.exports);
|
|
25
23
|
__reExport(components_exports, require('./card.js'), module.exports);
|
|
26
24
|
__reExport(components_exports, require('./checkbox.js'), module.exports);
|
|
27
25
|
__reExport(components_exports, require('./danger-zone.js'), module.exports);
|
|
28
26
|
__reExport(components_exports, require('./dialog.js'), module.exports);
|
|
29
27
|
__reExport(components_exports, require('./dropdown-menu.js'), module.exports);
|
|
30
|
-
__reExport(components_exports, require('./editable-table/
|
|
31
|
-
__reExport(components_exports, require('./editable-table/editable-table.js'), module.exports);
|
|
32
|
-
__reExport(components_exports, require('./editable-table/updated-value.js'), module.exports);
|
|
28
|
+
__reExport(components_exports, require('./editable-table/index.js'), module.exports);
|
|
33
29
|
__reExport(components_exports, require('./input.js'), module.exports);
|
|
34
30
|
__reExport(components_exports, require('./label.js'), module.exports);
|
|
35
31
|
__reExport(components_exports, require('./page-layout.js'), module.exports);
|
|
@@ -44,20 +40,16 @@ __reExport(components_exports, require('./tooltip.js'), module.exports);
|
|
|
44
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45
41
|
0 && (module.exports = {
|
|
46
42
|
...require('./alert-dialog.js'),
|
|
43
|
+
...require('./auth/index.js'),
|
|
47
44
|
...require('./back-button.js'),
|
|
48
45
|
...require('./badge.js'),
|
|
49
|
-
...require('./buttons/
|
|
50
|
-
...require('./buttons/copy-button.js'),
|
|
51
|
-
...require('./buttons/external-button.js'),
|
|
52
|
-
...require('./buttons/tab-button.js'),
|
|
46
|
+
...require('./buttons/index.js'),
|
|
53
47
|
...require('./card.js'),
|
|
54
48
|
...require('./checkbox.js'),
|
|
55
49
|
...require('./danger-zone.js'),
|
|
56
50
|
...require('./dialog.js'),
|
|
57
51
|
...require('./dropdown-menu.js'),
|
|
58
|
-
...require('./editable-table/
|
|
59
|
-
...require('./editable-table/editable-table.js'),
|
|
60
|
-
...require('./editable-table/updated-value.js'),
|
|
52
|
+
...require('./editable-table/index.js'),
|
|
61
53
|
...require('./input.js'),
|
|
62
54
|
...require('./label.js'),
|
|
63
55
|
...require('./page-layout.js'),
|
|
@@ -0,0 +1,72 @@
|
|
|
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 format_exports = {};
|
|
20
|
+
__export(format_exports, {
|
|
21
|
+
convertPercent: () => convertPercent,
|
|
22
|
+
formatBytecodeSize: () => formatBytecodeSize,
|
|
23
|
+
formatBytecodeVersion: () => formatBytecodeVersion,
|
|
24
|
+
formatTimestamp: () => formatTimestamp,
|
|
25
|
+
shortenHash: () => shortenHash,
|
|
26
|
+
significantTrunc: () => significantTrunc
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(format_exports);
|
|
29
|
+
function formatBytecodeSize(size) {
|
|
30
|
+
return `${(size / 1024).toFixed(2)} KB`;
|
|
31
|
+
}
|
|
32
|
+
function formatBytecodeVersion(version) {
|
|
33
|
+
if (version === 0) return "-";
|
|
34
|
+
const major = Math.floor(version / 100);
|
|
35
|
+
const minor = Math.floor(version % 100 / 10);
|
|
36
|
+
const patch = version % 10;
|
|
37
|
+
return `v${major}.${minor}.${patch}`;
|
|
38
|
+
}
|
|
39
|
+
function formatTimestamp(timestamp) {
|
|
40
|
+
return new Date(timestamp * 1e3).toLocaleString("en-GB", {
|
|
41
|
+
dateStyle: "short",
|
|
42
|
+
timeStyle: "short"
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function shortenHash(hash, chars = 4) {
|
|
46
|
+
if (!hash) return "";
|
|
47
|
+
const start = hash.slice(0, chars + 2);
|
|
48
|
+
const end = hash.slice(-chars);
|
|
49
|
+
return `${start}...${end}`;
|
|
50
|
+
}
|
|
51
|
+
function convertPercent(percent) {
|
|
52
|
+
return Math.floor(percent * 100);
|
|
53
|
+
}
|
|
54
|
+
function significantTrunc(x) {
|
|
55
|
+
if (x === 0) return "0";
|
|
56
|
+
if (x >= 1) return x.toFixed(0);
|
|
57
|
+
const str = x.toPrecision(2);
|
|
58
|
+
if (str.includes("e")) {
|
|
59
|
+
const value = Number(str);
|
|
60
|
+
return value.toFixed(20).replace(/\.?0+$/, "");
|
|
61
|
+
}
|
|
62
|
+
return str.replace(/\.?0+$/, "");
|
|
63
|
+
}
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
convertPercent,
|
|
67
|
+
formatBytecodeSize,
|
|
68
|
+
formatBytecodeVersion,
|
|
69
|
+
formatTimestamp,
|
|
70
|
+
shortenHash,
|
|
71
|
+
significantTrunc
|
|
72
|
+
});
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -25,8 +25,10 @@ module.exports = __toCommonJS(utils_exports);
|
|
|
25
25
|
__reExport(utils_exports, require('./cn.js'), module.exports);
|
|
26
26
|
var import_cn = require('./cn.js');
|
|
27
27
|
__reExport(utils_exports, require('./copy.js'), module.exports);
|
|
28
|
+
__reExport(utils_exports, require('./format.js'), module.exports);
|
|
28
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
30
|
0 && (module.exports = {
|
|
30
31
|
...require('./cn.js'),
|
|
31
|
-
...require('./copy.js')
|
|
32
|
+
...require('./copy.js'),
|
|
33
|
+
...require('./format.js')
|
|
32
34
|
});
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import cn from "../utils/index.js";
|
|
5
|
-
import { buttonVariants } from "./buttons/
|
|
5
|
+
import { buttonVariants } from "./buttons/index.js";
|
|
6
6
|
const AlertDialog = AlertDialogPrimitive.Root;
|
|
7
7
|
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
8
8
|
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useModal, useSIWE } from "connectkit";
|
|
4
|
+
import { useAccount } from "wagmi";
|
|
5
|
+
import { shortenHash } from "../../utils/index.js";
|
|
6
|
+
import { Button, TabButton } from "../buttons/index.js";
|
|
7
|
+
function SignInRequired({
|
|
8
|
+
children,
|
|
9
|
+
owner,
|
|
10
|
+
skipSignIn,
|
|
11
|
+
...customProps
|
|
12
|
+
}) {
|
|
13
|
+
const { setOpen, openSIWE } = useModal();
|
|
14
|
+
const { isConnected, address } = useAccount();
|
|
15
|
+
const { isRejected, isLoading, isSignedIn, data } = useSIWE();
|
|
16
|
+
const ButtonComponent = Object.keys(customProps).length > 0 ? Button : TabButton;
|
|
17
|
+
if (isSignedIn || skipSignIn) {
|
|
18
|
+
if (owner && data?.address?.toLowerCase() !== owner.toLowerCase()) {
|
|
19
|
+
return /* @__PURE__ */ jsx(ButtonComponent, { ...customProps, disabled: true, children: "You are not the author" });
|
|
20
|
+
}
|
|
21
|
+
return children;
|
|
22
|
+
}
|
|
23
|
+
if (isConnected && address) {
|
|
24
|
+
if (isRejected) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
ButtonComponent,
|
|
27
|
+
{
|
|
28
|
+
...customProps,
|
|
29
|
+
onClick: () => setOpen(true),
|
|
30
|
+
disabled: isLoading,
|
|
31
|
+
children: "Try Again"
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
ButtonComponent,
|
|
37
|
+
{
|
|
38
|
+
...customProps,
|
|
39
|
+
onClick: () => openSIWE(),
|
|
40
|
+
disabled: isLoading,
|
|
41
|
+
children: isLoading ? "Awaiting request..." : `Sign In as ${shortenHash(address)}`
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
return /* @__PURE__ */ jsx(ButtonComponent, { ...customProps, onClick: () => setOpen(true), children: "Connect Wallet" });
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
SignInRequired as default
|
|
49
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SIWEProvider } from "connectkit";
|
|
3
|
+
import { useRouter } from "next/navigation";
|
|
4
|
+
import { createSiweMessage } from "viem/siwe";
|
|
5
|
+
function SIWEClientProvider({
|
|
6
|
+
apiRoutePrefix,
|
|
7
|
+
statement,
|
|
8
|
+
children,
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
11
|
+
const router = useRouter();
|
|
12
|
+
const getNonce = async () => {
|
|
13
|
+
const res = await fetch(`${apiRoutePrefix}/nonce`);
|
|
14
|
+
if (!res.ok) {
|
|
15
|
+
throw new Error("Failed to fetch SIWE nonce");
|
|
16
|
+
}
|
|
17
|
+
const nonce = await res.text();
|
|
18
|
+
return nonce;
|
|
19
|
+
};
|
|
20
|
+
const createMessage = ({
|
|
21
|
+
nonce,
|
|
22
|
+
address,
|
|
23
|
+
chainId
|
|
24
|
+
}) => createSiweMessage({
|
|
25
|
+
version: "1",
|
|
26
|
+
domain: window.location.host,
|
|
27
|
+
uri: window.location.origin,
|
|
28
|
+
address,
|
|
29
|
+
chainId,
|
|
30
|
+
nonce,
|
|
31
|
+
statement: statement || "Sign In With Ethereum."
|
|
32
|
+
});
|
|
33
|
+
const verifyMessage = async ({
|
|
34
|
+
message,
|
|
35
|
+
signature
|
|
36
|
+
}) => {
|
|
37
|
+
const res = await fetch(`${apiRoutePrefix}/signin`, {
|
|
38
|
+
method: "POST",
|
|
39
|
+
body: JSON.stringify({ message, signature })
|
|
40
|
+
});
|
|
41
|
+
if (!res.ok) {
|
|
42
|
+
throw new Error("Failed to verify SIWE message");
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
SIWEProvider,
|
|
48
|
+
{
|
|
49
|
+
getNonce,
|
|
50
|
+
createMessage,
|
|
51
|
+
verifyMessage: async (args) => verifyMessage(args),
|
|
52
|
+
getSession: async () => {
|
|
53
|
+
const res = await fetch(`${apiRoutePrefix}/session`);
|
|
54
|
+
if (!res.ok) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return res.json();
|
|
58
|
+
},
|
|
59
|
+
onSignIn: async (session) => {
|
|
60
|
+
router.refresh();
|
|
61
|
+
return session;
|
|
62
|
+
},
|
|
63
|
+
signOut: async () => {
|
|
64
|
+
await fetch(`${apiRoutePrefix}/logout`, {
|
|
65
|
+
method: "POST"
|
|
66
|
+
});
|
|
67
|
+
router.refresh();
|
|
68
|
+
return true;
|
|
69
|
+
},
|
|
70
|
+
...props,
|
|
71
|
+
children
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
SIWEClientProvider
|
|
77
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { SignInRequired } from "../auth/index.js";
|
|
3
|
+
import { TabButton } from "../buttons/index.js";
|
|
3
4
|
import { Table, TableCell } from "../table.js";
|
|
4
5
|
import { UpdatedValue } from "./updated-value.js";
|
|
5
6
|
function TableCellUpdatable({
|
|
@@ -41,12 +42,13 @@ function TableEditable({
|
|
|
41
42
|
isLoading,
|
|
42
43
|
actions,
|
|
43
44
|
children,
|
|
44
|
-
disabled = false
|
|
45
|
+
disabled = false,
|
|
46
|
+
skipSignIn = true
|
|
45
47
|
}) {
|
|
46
48
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
47
49
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
|
|
48
50
|
/* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold", children: title }),
|
|
49
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
51
|
+
/* @__PURE__ */ jsx(SignInRequired, { skipSignIn, variant: "pink", size: "sm", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
50
52
|
onNew && /* @__PURE__ */ jsx(TabButton, { onClick: onNew, disabled: isLoading || disabled, children: isLoading ? buttonLoadingText : newButtonText }),
|
|
51
53
|
actions?.map((action, index) => /* @__PURE__ */ jsx(
|
|
52
54
|
TabButton,
|
|
@@ -57,7 +59,7 @@ function TableEditable({
|
|
|
57
59
|
},
|
|
58
60
|
index
|
|
59
61
|
))
|
|
60
|
-
] })
|
|
62
|
+
] }) })
|
|
61
63
|
] }),
|
|
62
64
|
/* @__PURE__ */ jsx("div", { className: "rounded-lg border", children: /* @__PURE__ */ jsx(Table, { children }) })
|
|
63
65
|
] });
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
export * from "./alert-dialog.js";
|
|
2
|
+
export * from "./auth/index.js";
|
|
2
3
|
export * from "./back-button.js";
|
|
3
4
|
export * from "./badge.js";
|
|
4
|
-
export * from "./buttons/
|
|
5
|
-
export * from "./buttons/copy-button.js";
|
|
6
|
-
export * from "./buttons/external-button.js";
|
|
7
|
-
export * from "./buttons/tab-button.js";
|
|
5
|
+
export * from "./buttons/index.js";
|
|
8
6
|
export * from "./card.js";
|
|
9
7
|
export * from "./checkbox.js";
|
|
10
8
|
export * from "./danger-zone.js";
|
|
11
9
|
export * from "./dialog.js";
|
|
12
10
|
export * from "./dropdown-menu.js";
|
|
13
|
-
export * from "./editable-table/
|
|
14
|
-
export * from "./editable-table/editable-table.js";
|
|
15
|
-
export * from "./editable-table/updated-value.js";
|
|
11
|
+
export * from "./editable-table/index.js";
|
|
16
12
|
export * from "./input.js";
|
|
17
13
|
export * from "./label.js";
|
|
18
14
|
export * from "./page-layout.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function formatBytecodeSize(size) {
|
|
2
|
+
return `${(size / 1024).toFixed(2)} KB`;
|
|
3
|
+
}
|
|
4
|
+
function formatBytecodeVersion(version) {
|
|
5
|
+
if (version === 0) return "-";
|
|
6
|
+
const major = Math.floor(version / 100);
|
|
7
|
+
const minor = Math.floor(version % 100 / 10);
|
|
8
|
+
const patch = version % 10;
|
|
9
|
+
return `v${major}.${minor}.${patch}`;
|
|
10
|
+
}
|
|
11
|
+
function formatTimestamp(timestamp) {
|
|
12
|
+
return new Date(timestamp * 1e3).toLocaleString("en-GB", {
|
|
13
|
+
dateStyle: "short",
|
|
14
|
+
timeStyle: "short"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function shortenHash(hash, chars = 4) {
|
|
18
|
+
if (!hash) return "";
|
|
19
|
+
const start = hash.slice(0, chars + 2);
|
|
20
|
+
const end = hash.slice(-chars);
|
|
21
|
+
return `${start}...${end}`;
|
|
22
|
+
}
|
|
23
|
+
function convertPercent(percent) {
|
|
24
|
+
return Math.floor(percent * 100);
|
|
25
|
+
}
|
|
26
|
+
function significantTrunc(x) {
|
|
27
|
+
if (x === 0) return "0";
|
|
28
|
+
if (x >= 1) return x.toFixed(0);
|
|
29
|
+
const str = x.toPrecision(2);
|
|
30
|
+
if (str.includes("e")) {
|
|
31
|
+
const value = Number(str);
|
|
32
|
+
return value.toFixed(20).replace(/\.?0+$/, "");
|
|
33
|
+
}
|
|
34
|
+
return str.replace(/\.?0+$/, "");
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
convertPercent,
|
|
38
|
+
formatBytecodeSize,
|
|
39
|
+
formatBytecodeVersion,
|
|
40
|
+
formatTimestamp,
|
|
41
|
+
shortenHash,
|
|
42
|
+
significantTrunc
|
|
43
|
+
};
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import { type TabButtonProps } from "../buttons";
|
|
4
|
+
export interface SignInRequiredProps extends TabButtonProps {
|
|
5
|
+
owner?: Address;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
skipSignIn?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default function SignInRequired({ children, owner, skipSignIn, ...customProps }: SignInRequiredProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<import("react").AwaitedReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface SIWEProviderProps {
|
|
2
|
+
apiRoutePrefix: string;
|
|
3
|
+
statement?: string;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare function SIWEClientProvider({ apiRoutePrefix, statement, children, ...props }: SIWEProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -26,6 +26,7 @@ interface TableEditableProps {
|
|
|
26
26
|
actions?: TableEditableAction[];
|
|
27
27
|
children: React.ReactNode;
|
|
28
28
|
disabled?: boolean;
|
|
29
|
+
skipSignIn?: boolean;
|
|
29
30
|
}
|
|
30
|
-
export declare function TableEditable({ title, onNew, newButtonText, buttonLoadingText, isLoading, actions, children, disabled, }: TableEditableProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function TableEditable({ title, onNew, newButtonText, buttonLoadingText, isLoading, actions, children, disabled, skipSignIn, }: TableEditableProps): import("react/jsx-runtime").JSX.Element;
|
|
31
32
|
export {};
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
export * from "./alert-dialog";
|
|
2
|
+
export * from "./auth";
|
|
2
3
|
export * from "./back-button";
|
|
3
4
|
export * from "./badge";
|
|
4
|
-
export * from "./buttons
|
|
5
|
-
export * from "./buttons/copy-button";
|
|
6
|
-
export * from "./buttons/external-button";
|
|
7
|
-
export * from "./buttons/tab-button";
|
|
5
|
+
export * from "./buttons";
|
|
8
6
|
export * from "./card";
|
|
9
7
|
export * from "./checkbox";
|
|
10
8
|
export * from "./danger-zone";
|
|
11
9
|
export * from "./dialog";
|
|
12
10
|
export * from "./dropdown-menu";
|
|
13
|
-
export * from "./editable-table
|
|
14
|
-
export * from "./editable-table/editable-table";
|
|
15
|
-
export * from "./editable-table/updated-value";
|
|
11
|
+
export * from "./editable-table";
|
|
16
12
|
export * from "./input";
|
|
17
13
|
export * from "./label";
|
|
18
14
|
export * from "./page-layout";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function formatBytecodeSize(size: number): string;
|
|
2
|
+
export declare function formatBytecodeVersion(version: number): string;
|
|
3
|
+
export declare function formatTimestamp(timestamp: number): string;
|
|
4
|
+
export declare function shortenHash(hash: string, chars?: number): string;
|
|
5
|
+
export declare function convertPercent(percent: number): number;
|
|
6
|
+
export declare function significantTrunc(x: number): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/permissionless-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Internal UI components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@radix-ui/react-tooltip": "^1.1.6",
|
|
43
43
|
"class-variance-authority": "^0.7.1",
|
|
44
44
|
"clsx": "^2.1.1",
|
|
45
|
+
"connectkit": "^1.8.2",
|
|
45
46
|
"lucide-react": "^0.471.1",
|
|
46
47
|
"next": "15.5.3",
|
|
47
48
|
"react": "^18",
|
|
@@ -49,7 +50,9 @@
|
|
|
49
50
|
"sonner": "^1.7.2",
|
|
50
51
|
"styled-jsx": "^5.1.6",
|
|
51
52
|
"tailwind-merge": "^2.6.0",
|
|
52
|
-
"tailwindcss-animate": "^1.0.7"
|
|
53
|
+
"tailwindcss-animate": "^1.0.7",
|
|
54
|
+
"viem": "^2.36",
|
|
55
|
+
"wagmi": "^2.14.8"
|
|
53
56
|
},
|
|
54
57
|
"devDependencies": {
|
|
55
58
|
"@biomejs/biome": "^2.2.4",
|