@gearbox-protocol/permissionless-ui 1.2.28 → 1.2.30
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/cards/expandable-card.js +11 -4
- package/dist/cjs/components/editable-table/editable-table.js +1 -11
- package/dist/esm/components/cards/expandable-card.js +11 -4
- package/dist/esm/components/editable-table/editable-table.js +2 -12
- package/dist/types/components/cards/expandable-card.d.ts +2 -1
- package/package.json +1 -1
|
@@ -37,8 +37,12 @@ var import_lucide_react = require("lucide-react");
|
|
|
37
37
|
var React = __toESM(require("react"));
|
|
38
38
|
var import_utils = __toESM(require('../../utils/index.js'));
|
|
39
39
|
var import_card = require('./card.js');
|
|
40
|
-
function ExpandableCard({
|
|
41
|
-
|
|
40
|
+
function ExpandableCard({
|
|
41
|
+
header,
|
|
42
|
+
children,
|
|
43
|
+
alwaysExpanded = false
|
|
44
|
+
}) {
|
|
45
|
+
const [isExpanded, setIsExpanded] = React.useState(alwaysExpanded);
|
|
42
46
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.Card, { children: [
|
|
43
47
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
44
48
|
"div",
|
|
@@ -47,10 +51,13 @@ function ExpandableCard({ header, children }) {
|
|
|
47
51
|
"flex items-center justify-between gap-4 p-4 rounded-t-xl cursor-pointer hover:bg-accent/50",
|
|
48
52
|
isExpanded ? "" : "rounded-b-xl"
|
|
49
53
|
),
|
|
50
|
-
onClick: () =>
|
|
54
|
+
onClick: () => {
|
|
55
|
+
if (alwaysExpanded) return;
|
|
56
|
+
setIsExpanded(!isExpanded);
|
|
57
|
+
},
|
|
51
58
|
children: [
|
|
52
59
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex-1", children: header }),
|
|
53
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground transform transition-transform", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
!alwaysExpanded && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground transform transition-transform", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
61
|
import_lucide_react.ChevronDown,
|
|
55
62
|
{
|
|
56
63
|
className: (0, import_utils.default)(
|
|
@@ -24,7 +24,6 @@ __export(editable_table_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(editable_table_exports);
|
|
26
26
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
|
-
var import_lucide_react = require("lucide-react");
|
|
28
27
|
var import_auth = require('../auth/index.js');
|
|
29
28
|
var import_buttons = require('../buttons/index.js');
|
|
30
29
|
var import_table = require('../table.js');
|
|
@@ -46,16 +45,7 @@ function TableCellAsset({
|
|
|
46
45
|
comment,
|
|
47
46
|
")"
|
|
48
47
|
] }),
|
|
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, {})
|
|
57
|
-
}
|
|
58
|
-
)
|
|
48
|
+
explorerUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_buttons.ExternalButton, { url: `${explorerUrl}/address/${assetAddress}` })
|
|
59
49
|
] })
|
|
60
50
|
] }) });
|
|
61
51
|
}
|
|
@@ -4,8 +4,12 @@ import { ChevronDown } from "lucide-react";
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import cn from "../../utils/index.js";
|
|
6
6
|
import { Card, CardContent } from "./card.js";
|
|
7
|
-
function ExpandableCard({
|
|
8
|
-
|
|
7
|
+
function ExpandableCard({
|
|
8
|
+
header,
|
|
9
|
+
children,
|
|
10
|
+
alwaysExpanded = false
|
|
11
|
+
}) {
|
|
12
|
+
const [isExpanded, setIsExpanded] = React.useState(alwaysExpanded);
|
|
9
13
|
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
10
14
|
/* @__PURE__ */ jsxs(
|
|
11
15
|
"div",
|
|
@@ -14,10 +18,13 @@ function ExpandableCard({ header, children }) {
|
|
|
14
18
|
"flex items-center justify-between gap-4 p-4 rounded-t-xl cursor-pointer hover:bg-accent/50",
|
|
15
19
|
isExpanded ? "" : "rounded-b-xl"
|
|
16
20
|
),
|
|
17
|
-
onClick: () =>
|
|
21
|
+
onClick: () => {
|
|
22
|
+
if (alwaysExpanded) return;
|
|
23
|
+
setIsExpanded(!isExpanded);
|
|
24
|
+
},
|
|
18
25
|
children: [
|
|
19
26
|
/* @__PURE__ */ jsx("div", { className: "flex-1", children: header }),
|
|
20
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground transform transition-transform", children: /* @__PURE__ */ jsx(
|
|
27
|
+
!alwaysExpanded && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground transform transition-transform", children: /* @__PURE__ */ jsx(
|
|
21
28
|
ChevronDown,
|
|
22
29
|
{
|
|
23
30
|
className: cn(
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ExternalLink } from "lucide-react";
|
|
3
2
|
import { SignInRequired } from "../auth/index.js";
|
|
4
|
-
import {
|
|
3
|
+
import { ExternalButton, TabButton } from "../buttons/index.js";
|
|
5
4
|
import { Table, TableCell } from "../table.js";
|
|
6
5
|
import { TokenIcon } from "../token-icon.js";
|
|
7
6
|
import { UpdatedValue } from "./updated-value.js";
|
|
@@ -21,16 +20,7 @@ function TableCellAsset({
|
|
|
21
20
|
comment,
|
|
22
21
|
")"
|
|
23
22
|
] }),
|
|
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, {})
|
|
32
|
-
}
|
|
33
|
-
)
|
|
23
|
+
explorerUrl && /* @__PURE__ */ jsx(ExternalButton, { url: `${explorerUrl}/address/${assetAddress}` })
|
|
34
24
|
] })
|
|
35
25
|
] }) });
|
|
36
26
|
}
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
export interface ExpandableCardProps {
|
|
3
3
|
header: React.ReactNode;
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
+
alwaysExpanded?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare function ExpandableCard({ header, children }: ExpandableCardProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function ExpandableCard({ header, children, alwaysExpanded, }: ExpandableCardProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export { ExpandableCard };
|