@gearbox-protocol/permissionless-ui 1.0.3 → 1.0.4

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.
@@ -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 = __toESM(require('../utils/index.js'));
38
- function BackButton({ href, text, className }) {
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.default)(
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'),
@@ -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
- function PageLayout({ children, title, backButton }) {
27
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-h-screen bg-black text-white p-6", children: [
28
- backButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_back_button.BackButton, { href: backButton.href, text: backButton.text }),
29
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-3xl font-bold mb-2", children: title }) }),
30
- children
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 "../utils/index.js";
5
- function BackButton({ href, text, className }) {
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,3 +1,4 @@
1
+ export * from "./back-button.js";
1
2
  export * from "./button.js";
2
3
  export * from "./copy-button.js";
3
4
  export * from "./external-button.js";
@@ -1,6 +1,5 @@
1
1
  export * from "./alert-dialog.js";
2
2
  export * from "./auth/index.js";
3
- export * from "./back-button.js";
4
3
  export * from "./badge.js";
5
4
  export * from "./buttons/index.js";
6
5
  export * from "./card.js";
@@ -1,10 +1,34 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { BackButton } from "./back-button.js";
3
- function PageLayout({ children, title, backButton }) {
4
- return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-black text-white p-6", children: [
5
- backButton && /* @__PURE__ */ jsx(BackButton, { href: backButton.href, text: backButton.text }),
6
- /* @__PURE__ */ jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold mb-2", children: title }) }),
7
- children
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 {
@@ -0,0 +1,8 @@
1
+ interface BackButtonProps {
2
+ href: string;
3
+ text?: string;
4
+ onClick?: () => void;
5
+ className?: string;
6
+ }
7
+ export declare function BackButton({ href, text, onClick, className, }: BackButtonProps): import("react/jsx-runtime").JSX.Element;
8
+ 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" | "link" | "pink" | "pink-outline" | "blue" | "blue-outline" | null | undefined;
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,4 @@
1
+ export * from "./back-button";
1
2
  export * from "./button";
2
3
  export * from "./copy-button";
3
4
  export * from "./external-button";
@@ -1,6 +1,5 @@
1
1
  export * from "./alert-dialog";
2
2
  export * from "./auth";
3
- export * from "./back-button";
4
3
  export * from "./badge";
5
4
  export * from "./buttons";
6
5
  export * from "./card";
@@ -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: string;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/permissionless-ui",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Internal UI components",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/index.js",
@@ -1,7 +0,0 @@
1
- interface BackButtonProps {
2
- href: string;
3
- text?: string;
4
- className?: string;
5
- }
6
- export declare function BackButton({ href, text, className }: BackButtonProps): import("react/jsx-runtime").JSX.Element;
7
- export {};