@gearbox-protocol/permissionless-ui 1.5.0 → 1.6.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.
Files changed (33) hide show
  1. package/dist/cjs/components/auth/siwe-provider.js +0 -1
  2. package/dist/cjs/components/buttons/button.js +1 -1
  3. package/dist/cjs/components/buttons/tab-button.js +1 -5
  4. package/dist/cjs/components/cards/card.js +13 -10
  5. package/dist/cjs/components/cards/expandable-card.js +1 -1
  6. package/dist/cjs/components/detailed-page-title.js +1 -1
  7. package/dist/cjs/components/layout/footer.js +2 -2
  8. package/dist/cjs/components/layout/header.js +1 -1
  9. package/dist/cjs/components/layout/layout.js +12 -1
  10. package/dist/cjs/components/layout/page-layout.js +5 -2
  11. package/dist/cjs/components/next/index.js +2 -5
  12. package/dist/cjs/components/signatures/vertical-timeline.js +2 -2
  13. package/dist/cjs/components/tabs.js +1 -1
  14. package/dist/esm/components/auth/siwe-provider.js +0 -1
  15. package/dist/esm/components/buttons/button.js +1 -1
  16. package/dist/esm/components/buttons/tab-button.js +1 -5
  17. package/dist/esm/components/cards/card.js +13 -10
  18. package/dist/esm/components/cards/expandable-card.js +1 -1
  19. package/dist/esm/components/detailed-page-title.js +1 -1
  20. package/dist/esm/components/layout/footer.js +2 -2
  21. package/dist/esm/components/layout/header.js +1 -1
  22. package/dist/esm/components/layout/layout.js +12 -1
  23. package/dist/esm/components/layout/page-layout.js +5 -2
  24. package/dist/esm/components/next/index.js +1 -3
  25. package/dist/esm/components/signatures/vertical-timeline.js +2 -2
  26. package/dist/esm/components/tabs.js +1 -1
  27. package/dist/globals.css +5 -1
  28. package/dist/types/components/layout/page-layout.d.ts +3 -1
  29. package/dist/types/components/next/index.d.ts +0 -1
  30. package/package.json +2 -2
  31. package/dist/cjs/components/next/web3-providers.js +0 -116
  32. package/dist/esm/components/next/web3-providers.js +0 -92
  33. package/dist/types/components/next/web3-providers.d.ts +0 -29
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- "use client";
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -44,7 +44,7 @@ const buttonVariants = (0, import_class_variance_authority.cva)(
44
44
  variant: {
45
45
  default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
46
46
  destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
47
- outline: "border-border bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
47
+ outline: "border-border bg-background shadow-sm hover:bg-secondary hover:text-white text-white",
48
48
  secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
49
49
  ghost: "hover:bg-accent hover:text-accent-foreground",
50
50
  link: "text-primary underline-offset-4 hover:underline",
@@ -33,7 +33,6 @@ __export(tab_button_exports, {
33
33
  module.exports = __toCommonJS(tab_button_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var React = __toESM(require("react"));
36
- var import_utils = __toESM(require('../../utils/index.js'));
37
36
  var import_button = require('./button.js');
38
37
  const TabButton = React.forwardRef(
39
38
  ({ className, children, size = "sm", ...props }, ref) => {
@@ -43,10 +42,7 @@ const TabButton = React.forwardRef(
43
42
  ref,
44
43
  variant: "outline",
45
44
  size,
46
- className: (0, import_utils.default)(
47
- "bg-gray-900 text-gray-100 border-gray-700 hover:bg-gray-800 border-gray-300",
48
- className
49
- ),
45
+ className,
50
46
  ...props,
51
47
  children
52
48
  }
@@ -40,18 +40,21 @@ var import_jsx_runtime = require("react/jsx-runtime");
40
40
  var import_class_variance_authority = require("class-variance-authority");
41
41
  var React = __toESM(require("react"));
42
42
  var import_utils = __toESM(require('../../utils/index.js'));
43
- const cardVariants = (0, import_class_variance_authority.cva)("rounded-xl border bg-card text-card-foreground", {
44
- variants: {
45
- variant: {
46
- default: "",
47
- interactive: "hover:bg-accent/50 transition-colors cursor-pointer",
48
- transparent: "bg-card/0"
43
+ const cardVariants = (0, import_class_variance_authority.cva)(
44
+ "rounded-xl border border-border bg-card text-card-foreground hover:bg-secondary",
45
+ {
46
+ variants: {
47
+ variant: {
48
+ default: "",
49
+ interactive: "hover:bg-secondary transition-colors cursor-pointer",
50
+ transparent: "bg-card/0"
51
+ }
52
+ },
53
+ defaultVariants: {
54
+ variant: "default"
49
55
  }
50
- },
51
- defaultVariants: {
52
- variant: "default"
53
56
  }
54
- });
57
+ );
55
58
  const Card = React.forwardRef(
56
59
  ({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
57
60
  "div",
@@ -49,7 +49,7 @@ function ExpandableCard({
49
49
  {
50
50
  className: (0, import_utils.default)(
51
51
  "flex items-center justify-between gap-4 p-4 rounded-t-xl",
52
- alwaysExpanded ? "" : "cursor-pointer hover:bg-accent/50",
52
+ alwaysExpanded ? "" : "cursor-pointer hover:bg-secondary",
53
53
  isExpanded ? "" : "rounded-b-xl"
54
54
  ),
55
55
  onClick: () => {
@@ -48,7 +48,7 @@ function DetailedPageTitle({
48
48
  explorerLinks,
49
49
  className
50
50
  }) {
51
- const intl = (0, import_typed_intl.useIntlTyped)();
51
+ const _intl = (0, import_typed_intl.useIntlTyped)();
52
52
  const [isPressed, setIsPressed] = React.useState(false);
53
53
  const handleCopy = () => {
54
54
  if (toCopy) {
@@ -58,7 +58,7 @@ const Footer = import_react.default.forwardRef(
58
58
  {
59
59
  ref,
60
60
  className: (0, import_cn.cn)(
61
- "relative w-full border-t bg-card border-border mt-6 flex items-center justify-center",
61
+ "relative w-full border-t bg-card border-border flex items-center justify-center",
62
62
  className
63
63
  ),
64
64
  ...props,
@@ -138,7 +138,7 @@ function GearboxFooter({
138
138
  "footer",
139
139
  {
140
140
  className: (0, import_cn.cn)(
141
- "relative w-full border-t bg-card border-border mt-6 flex items-center justify-center",
141
+ "relative w-full border-t bg-card border-border flex items-center justify-center",
142
142
  className
143
143
  ),
144
144
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 items-top py-6 w-full px-4 max-w-[1440px]", children: [
@@ -65,7 +65,7 @@ const Header = import_react.default.forwardRef(
65
65
  {
66
66
  ref,
67
67
  className: (0, import_cn.cn)(
68
- "relative w-full bg-background h-18 mb-6 border-b flex flex-nowrap items-center border-border",
68
+ "relative w-full bg-background h-18 border-b flex flex-nowrap items-center border-border",
69
69
  fixed && "fixed top-0 left-0 right-0 z-50",
70
70
  sticky && "sticky top-0 z-50",
71
71
  className
@@ -51,7 +51,18 @@ const Layout = import_react.default.forwardRef(
51
51
  ...props,
52
52
  children: [
53
53
  header && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { gridArea: "header" }, children: header }),
54
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("main", { className: "overflow-x-hidden", style: { gridArea: "main" }, children }),
54
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
55
+ "main",
56
+ {
57
+ className: "overflow-x-hidden py-6",
58
+ style: {
59
+ gridArea: "main",
60
+ backgroundColor: "hsl(var(--main-background))",
61
+ color: "hsl(var(--main-foreground))"
62
+ },
63
+ children
64
+ }
65
+ ),
55
66
  footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { gridArea: "footer" }, children: footer })
56
67
  ]
57
68
  }
@@ -23,15 +23,18 @@ __export(page_layout_exports, {
23
23
  module.exports = __toCommonJS(page_layout_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_back_button = require('../buttons/back-button.js');
26
+ var import_container = require('./container.js');
26
27
  function PageLayout({
27
28
  children,
28
29
  title,
29
30
  description,
30
31
  icon,
31
32
  backButton,
32
- actionButton
33
+ actionButton,
34
+ maxContainerWidth = "xl",
35
+ containerClassName
33
36
  }) {
34
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-h-screen bg-black text-white p-6 overflow-y-auto", children: [
37
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_container.Container, { maxWidth: maxContainerWidth, className: containerClassName, children: [
35
38
  backButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
36
39
  import_back_button.BackButton,
37
40
  {
@@ -22,8 +22,7 @@ __export(next_exports, {
22
22
  MarkdownViewer: () => import_markdown_viewer.MarkdownViewer,
23
23
  SIWEClientProvider: () => import_siwe_provider.SIWEClientProvider,
24
24
  SignInRequired: () => import_signin_required.SignInRequired,
25
- TokenIcon: () => import_token_icon.TokenIcon,
26
- Web3Providers: () => import_web3_providers.Web3Providers
25
+ TokenIcon: () => import_token_icon.TokenIcon
27
26
  });
28
27
  module.exports = __toCommonJS(next_exports);
29
28
  var import_signin_required = require('../auth/signin-required.js');
@@ -31,13 +30,11 @@ var import_back_button = require('./back-button.js');
31
30
  var import_markdown_viewer = require('./markdown-viewer.js');
32
31
  var import_siwe_provider = require('./siwe-provider.js');
33
32
  var import_token_icon = require('./token-icon.js');
34
- var import_web3_providers = require('./web3-providers.js');
35
33
  // Annotate the CommonJS export names for ESM import in node:
36
34
  0 && (module.exports = {
37
35
  BackButton,
38
36
  MarkdownViewer,
39
37
  SIWEClientProvider,
40
38
  SignInRequired,
41
- TokenIcon,
42
- Web3Providers
39
+ TokenIcon
43
40
  });
@@ -61,8 +61,8 @@ function VerticalTimeline({
61
61
  !showAll[index],
62
62
  ...showAll.slice(index + 1)
63
63
  ]),
64
- className: "ml-10 text-green-500 hover:underline",
65
- children: showAll ? "Hide all" : "Show all"
64
+ className: "ml-10 text-green-500 hover:underline cursor-pointer",
65
+ children: showAll[index] ? "Hide all" : "Show all"
66
66
  }
67
67
  )
68
68
  ] }),
@@ -56,7 +56,7 @@ const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
56
56
  {
57
57
  ref,
58
58
  className: (0, import_utils.default)(
59
- "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow rounded-none border-b-2 border-transparent px-2 py-2 text-gray-400 hover:text-white data-[state=active]:border-white data-[state=active]:bg-transparent data-[state=active]:text-white focus:outline-none",
59
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow rounded-none border-b-2 border-transparent px-2 py-2 text-gray-400 hover:text-white data-[state=active]:border-white data-[state=active]:bg-transparent data-[state=active]:text-white focus:outline-none cursor-pointer",
60
60
  className
61
61
  ),
62
62
  ...props
@@ -1,4 +1,3 @@
1
- "use client";
2
1
  import { jsx } from "react/jsx-runtime";
3
2
  import { SIWEProvider } from "connectkit";
4
3
  import { createSiweMessage } from "viem/siwe";
@@ -10,7 +10,7 @@ const buttonVariants = cva(
10
10
  variant: {
11
11
  default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
12
12
  destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
13
- outline: "border-border bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
13
+ outline: "border-border bg-background shadow-sm hover:bg-secondary hover:text-white text-white",
14
14
  secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
15
15
  ghost: "hover:bg-accent hover:text-accent-foreground",
16
16
  link: "text-primary underline-offset-4 hover:underline",
@@ -1,6 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import cn from "../../utils/index.js";
4
3
  import { Button } from "./button.js";
5
4
  const TabButton = React.forwardRef(
6
5
  ({ className, children, size = "sm", ...props }, ref) => {
@@ -10,10 +9,7 @@ const TabButton = React.forwardRef(
10
9
  ref,
11
10
  variant: "outline",
12
11
  size,
13
- className: cn(
14
- "bg-gray-900 text-gray-100 border-gray-700 hover:bg-gray-800 border-gray-300",
15
- className
16
- ),
12
+ className,
17
13
  ...props,
18
14
  children
19
15
  }
@@ -2,18 +2,21 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { cva } from "class-variance-authority";
3
3
  import * as React from "react";
4
4
  import cn from "../../utils/index.js";
5
- const cardVariants = cva("rounded-xl border bg-card text-card-foreground", {
6
- variants: {
7
- variant: {
8
- default: "",
9
- interactive: "hover:bg-accent/50 transition-colors cursor-pointer",
10
- transparent: "bg-card/0"
5
+ const cardVariants = cva(
6
+ "rounded-xl border border-border bg-card text-card-foreground hover:bg-secondary",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default: "",
11
+ interactive: "hover:bg-secondary transition-colors cursor-pointer",
12
+ transparent: "bg-card/0"
13
+ }
14
+ },
15
+ defaultVariants: {
16
+ variant: "default"
11
17
  }
12
- },
13
- defaultVariants: {
14
- variant: "default"
15
18
  }
16
- });
19
+ );
17
20
  const Card = React.forwardRef(
18
21
  ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
19
22
  "div",
@@ -16,7 +16,7 @@ function ExpandableCard({
16
16
  {
17
17
  className: cn(
18
18
  "flex items-center justify-between gap-4 p-4 rounded-t-xl",
19
- alwaysExpanded ? "" : "cursor-pointer hover:bg-accent/50",
19
+ alwaysExpanded ? "" : "cursor-pointer hover:bg-secondary",
20
20
  isExpanded ? "" : "rounded-b-xl"
21
21
  ),
22
22
  onClick: () => {
@@ -20,7 +20,7 @@ function DetailedPageTitle({
20
20
  explorerLinks,
21
21
  className
22
22
  }) {
23
- const intl = useIntlTyped();
23
+ const _intl = useIntlTyped();
24
24
  const [isPressed, setIsPressed] = React.useState(false);
25
25
  const handleCopy = () => {
26
26
  if (toCopy) {
@@ -22,7 +22,7 @@ const Footer = React.forwardRef(
22
22
  {
23
23
  ref,
24
24
  className: cn(
25
- "relative w-full border-t bg-card border-border mt-6 flex items-center justify-center",
25
+ "relative w-full border-t bg-card border-border flex items-center justify-center",
26
26
  className
27
27
  ),
28
28
  ...props,
@@ -102,7 +102,7 @@ function GearboxFooter({
102
102
  "footer",
103
103
  {
104
104
  className: cn(
105
- "relative w-full border-t bg-card border-border mt-6 flex items-center justify-center",
105
+ "relative w-full border-t bg-card border-border flex items-center justify-center",
106
106
  className
107
107
  ),
108
108
  children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 items-top py-6 w-full px-4 max-w-[1440px]", children: [
@@ -31,7 +31,7 @@ const Header = React.forwardRef(
31
31
  {
32
32
  ref,
33
33
  className: cn(
34
- "relative w-full bg-background h-18 mb-6 border-b flex flex-nowrap items-center border-border",
34
+ "relative w-full bg-background h-18 border-b flex flex-nowrap items-center border-border",
35
35
  fixed && "fixed top-0 left-0 right-0 z-50",
36
36
  sticky && "sticky top-0 z-50",
37
37
  className
@@ -18,7 +18,18 @@ const Layout = React.forwardRef(
18
18
  ...props,
19
19
  children: [
20
20
  header && /* @__PURE__ */ jsx("div", { style: { gridArea: "header" }, children: header }),
21
- /* @__PURE__ */ jsx("main", { className: "overflow-x-hidden", style: { gridArea: "main" }, children }),
21
+ /* @__PURE__ */ jsx(
22
+ "main",
23
+ {
24
+ className: "overflow-x-hidden py-6",
25
+ style: {
26
+ gridArea: "main",
27
+ backgroundColor: "hsl(var(--main-background))",
28
+ color: "hsl(var(--main-foreground))"
29
+ },
30
+ children
31
+ }
32
+ ),
22
33
  footer && /* @__PURE__ */ jsx("div", { style: { gridArea: "footer" }, children: footer })
23
34
  ]
24
35
  }
@@ -1,14 +1,17 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { BackButton } from "../buttons/back-button.js";
3
+ import { Container } from "./container.js";
3
4
  function PageLayout({
4
5
  children,
5
6
  title,
6
7
  description,
7
8
  icon,
8
9
  backButton,
9
- actionButton
10
+ actionButton,
11
+ maxContainerWidth = "xl",
12
+ containerClassName
10
13
  }) {
11
- return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-black text-white p-6 overflow-y-auto", children: [
14
+ return /* @__PURE__ */ jsxs(Container, { maxWidth: maxContainerWidth, className: containerClassName, children: [
12
15
  backButton && /* @__PURE__ */ jsx(
13
16
  BackButton,
14
17
  {
@@ -3,12 +3,10 @@ import { BackButton } from "./back-button.js";
3
3
  import { MarkdownViewer } from "./markdown-viewer.js";
4
4
  import { SIWEClientProvider } from "./siwe-provider.js";
5
5
  import { TokenIcon } from "./token-icon.js";
6
- import { Web3Providers } from "./web3-providers.js";
7
6
  export {
8
7
  BackButton,
9
8
  MarkdownViewer,
10
9
  SIWEClientProvider,
11
10
  SignInRequired,
12
- TokenIcon,
13
- Web3Providers
11
+ TokenIcon
14
12
  };
@@ -38,8 +38,8 @@ function VerticalTimeline({
38
38
  !showAll[index],
39
39
  ...showAll.slice(index + 1)
40
40
  ]),
41
- className: "ml-10 text-green-500 hover:underline",
42
- children: showAll ? "Hide all" : "Show all"
41
+ className: "ml-10 text-green-500 hover:underline cursor-pointer",
42
+ children: showAll[index] ? "Hide all" : "Show all"
43
43
  }
44
44
  )
45
45
  ] }),
@@ -20,7 +20,7 @@ const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
20
20
  {
21
21
  ref,
22
22
  className: cn(
23
- "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow rounded-none border-b-2 border-transparent px-2 py-2 text-gray-400 hover:text-white data-[state=active]:border-white data-[state=active]:bg-transparent data-[state=active]:text-white focus:outline-none",
23
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow rounded-none border-b-2 border-transparent px-2 py-2 text-gray-400 hover:text-white data-[state=active]:border-white data-[state=active]:bg-transparent data-[state=active]:text-white focus:outline-none cursor-pointer",
24
24
  className
25
25
  ),
26
26
  ...props
package/dist/globals.css CHANGED
@@ -1,5 +1,5 @@
1
- @import "tailwindcss";
2
1
  @import url("https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap");
2
+ @import "tailwindcss";
3
3
  @import "./grid-safelist.css";
4
4
 
5
5
  @layer base {
@@ -32,6 +32,8 @@
32
32
  --white: 0 0% 100%;
33
33
  --black: 0 0% 0%;
34
34
  --border: 0 0% 89.8%;
35
+ --main-background: 240 10% 3.9%;
36
+ --main-foreground: 0 0% 98%;
35
37
  }
36
38
 
37
39
  .dark {
@@ -74,6 +76,8 @@
74
76
  --white: 0 0% 100%;
75
77
  --black: 0 0% 0%;
76
78
  --border: 225 7% 22%;
79
+ --main-background: 240 10% 3.9%;
80
+ --main-foreground: 0 0% 98%;
77
81
  }
78
82
  }
79
83
 
@@ -9,6 +9,8 @@ interface PageLayoutProps {
9
9
  onClick?: () => void;
10
10
  };
11
11
  actionButton?: JSX.Element;
12
+ maxContainerWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
13
+ containerClassName?: string;
12
14
  }
13
15
  /**
14
16
  * PageLayout — main layout component for application pages.
@@ -35,5 +37,5 @@ interface PageLayoutProps {
35
37
  * - for modal dialogs or overlays (use Dialog component instead).
36
38
  * - for nested page sections (use Card or other container components).
37
39
  */
38
- export declare function PageLayout({ children, title, description, icon, backButton, actionButton, }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
40
+ export declare function PageLayout({ children, title, description, icon, backButton, actionButton, maxContainerWidth, containerClassName, }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
39
41
  export {};
@@ -8,4 +8,3 @@ export { BackButton } from "./back-button";
8
8
  export { MarkdownViewer } from "./markdown-viewer";
9
9
  export { SIWEClientProvider } from "./siwe-provider";
10
10
  export { TokenIcon } from "./token-icon";
11
- export { Web3Providers } from "./web3-providers";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/permissionless-ui",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "Internal UI components",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/index.js",
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "peerDependencies": {
74
74
  "@gearbox-protocol/sdk": "*",
75
- "@tanstack/react-query": "^5.0.0",
75
+ "@tanstack/react-query": "^5.64.1",
76
76
  "@types/react": "^18 || ^19",
77
77
  "@types/react-dom": "^18 || ^19",
78
78
  "connectkit": "^1.8.0",
@@ -1,116 +0,0 @@
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 web3_providers_exports = {};
21
- __export(web3_providers_exports, {
22
- Web3Providers: () => Web3Providers
23
- });
24
- module.exports = __toCommonJS(web3_providers_exports);
25
- var import_jsx_runtime = require("react/jsx-runtime");
26
- var import_react_query = require("@tanstack/react-query");
27
- var import_connectkit = require("connectkit");
28
- var import_react = require("react");
29
- var import_siwe = require("viem/siwe");
30
- var import_wagmi = require("wagmi");
31
- function makeQueryClient() {
32
- return new import_react_query.QueryClient({
33
- defaultOptions: {
34
- queries: {
35
- staleTime: 60 * 1e3
36
- }
37
- }
38
- });
39
- }
40
- let browserQueryClient;
41
- function getQueryClient() {
42
- if (typeof window === "undefined") {
43
- return makeQueryClient();
44
- }
45
- if (!browserQueryClient) browserQueryClient = makeQueryClient();
46
- return browserQueryClient;
47
- }
48
- function Web3Providers({
49
- config,
50
- apiRoutePrefix,
51
- statement = "Sign In With Ethereum.",
52
- children
53
- }) {
54
- const [queryClient] = (0, import_react.useState)(() => getQueryClient());
55
- const getNonce = async () => {
56
- const res = await fetch(`${apiRoutePrefix}/nonce`);
57
- if (!res.ok) {
58
- throw new Error("Failed to fetch SIWE nonce");
59
- }
60
- return await res.text();
61
- };
62
- const createMessage = ({
63
- nonce,
64
- address,
65
- chainId
66
- }) => (0, import_siwe.createSiweMessage)({
67
- version: "1",
68
- domain: window.location.host,
69
- uri: window.location.origin,
70
- address,
71
- chainId,
72
- nonce,
73
- statement
74
- });
75
- const verifyMessage = async ({
76
- message,
77
- signature
78
- }) => {
79
- const res = await fetch(`${apiRoutePrefix}/signin`, {
80
- method: "POST",
81
- body: JSON.stringify({ message, signature })
82
- });
83
- if (!res.ok) {
84
- throw new Error("Failed to verify SIWE message");
85
- }
86
- return true;
87
- };
88
- const getSession = async () => {
89
- const res = await fetch(`${apiRoutePrefix}/session`);
90
- if (!res.ok) {
91
- return null;
92
- }
93
- return res.json();
94
- };
95
- const signOut = async () => {
96
- await fetch(`${apiRoutePrefix}/logout`, {
97
- method: "POST"
98
- });
99
- return true;
100
- };
101
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_wagmi.WagmiProvider, { config, reconnectOnMount: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
102
- import_connectkit.SIWEProvider,
103
- {
104
- getNonce,
105
- createMessage,
106
- verifyMessage,
107
- getSession,
108
- signOut,
109
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_connectkit.ConnectKitProvider, { children })
110
- }
111
- ) }) });
112
- }
113
- // Annotate the CommonJS export names for ESM import in node:
114
- 0 && (module.exports = {
115
- Web3Providers
116
- });
@@ -1,92 +0,0 @@
1
- "use client";
2
- import { jsx } from "react/jsx-runtime";
3
- import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4
- import { ConnectKitProvider, SIWEProvider } from "connectkit";
5
- import { useState } from "react";
6
- import { createSiweMessage } from "viem/siwe";
7
- import { WagmiProvider } from "wagmi";
8
- function makeQueryClient() {
9
- return new QueryClient({
10
- defaultOptions: {
11
- queries: {
12
- staleTime: 60 * 1e3
13
- }
14
- }
15
- });
16
- }
17
- let browserQueryClient;
18
- function getQueryClient() {
19
- if (typeof window === "undefined") {
20
- return makeQueryClient();
21
- }
22
- if (!browserQueryClient) browserQueryClient = makeQueryClient();
23
- return browserQueryClient;
24
- }
25
- function Web3Providers({
26
- config,
27
- apiRoutePrefix,
28
- statement = "Sign In With Ethereum.",
29
- children
30
- }) {
31
- const [queryClient] = useState(() => getQueryClient());
32
- const getNonce = async () => {
33
- const res = await fetch(`${apiRoutePrefix}/nonce`);
34
- if (!res.ok) {
35
- throw new Error("Failed to fetch SIWE nonce");
36
- }
37
- return await res.text();
38
- };
39
- const createMessage = ({
40
- nonce,
41
- address,
42
- chainId
43
- }) => createSiweMessage({
44
- version: "1",
45
- domain: window.location.host,
46
- uri: window.location.origin,
47
- address,
48
- chainId,
49
- nonce,
50
- statement
51
- });
52
- const verifyMessage = async ({
53
- message,
54
- signature
55
- }) => {
56
- const res = await fetch(`${apiRoutePrefix}/signin`, {
57
- method: "POST",
58
- body: JSON.stringify({ message, signature })
59
- });
60
- if (!res.ok) {
61
- throw new Error("Failed to verify SIWE message");
62
- }
63
- return true;
64
- };
65
- const getSession = async () => {
66
- const res = await fetch(`${apiRoutePrefix}/session`);
67
- if (!res.ok) {
68
- return null;
69
- }
70
- return res.json();
71
- };
72
- const signOut = async () => {
73
- await fetch(`${apiRoutePrefix}/logout`, {
74
- method: "POST"
75
- });
76
- return true;
77
- };
78
- return /* @__PURE__ */ jsx(WagmiProvider, { config, reconnectOnMount: true, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(
79
- SIWEProvider,
80
- {
81
- getNonce,
82
- createMessage,
83
- verifyMessage,
84
- getSession,
85
- signOut,
86
- children: /* @__PURE__ */ jsx(ConnectKitProvider, { children })
87
- }
88
- ) }) });
89
- }
90
- export {
91
- Web3Providers
92
- };
@@ -1,29 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import type { Config } from "wagmi";
3
- /**
4
- * Web3Providers — all-in-one provider component for Web3 apps with Wagmi, ConnectKit, SIWE, and React Query.
5
- *
6
- * @usage
7
- * Use Web3Providers to wrap your Next.js application and enable Web3 functionality:
8
- * app root, authentication context, wallet connection.
9
- *
10
- * Props:
11
- * - `config` — Wagmi config object (required).
12
- * - `apiRoutePrefix` — API route prefix for SIWE endpoints (required):
13
- * - `/api/nonce` — endpoint for fetching nonce.
14
- * - `/api/signin` — endpoint for verifying signature.
15
- * - `/api/session` — endpoint for getting current session.
16
- * - `/api/logout` — endpoint for signing out.
17
- * - `statement` — optional custom statement for SIWE message (defaults to "Sign In With Ethereum.").
18
- * - `children` — application content wrapped by provider (required).
19
- *
20
- * Note: Web3Providers wraps WagmiProvider, QueryClientProvider, ConnectKitProvider, and SIWEProvider with correct order and configuration.
21
- */
22
- interface Web3ProvidersProps {
23
- config: Config;
24
- apiRoutePrefix: string;
25
- statement?: string;
26
- children: ReactNode;
27
- }
28
- export declare function Web3Providers({ config, apiRoutePrefix, statement, children, }: Web3ProvidersProps): import("react/jsx-runtime").JSX.Element;
29
- export {};