@openzeppelin/ui-builder-adapter-stellar 1.2.0 → 1.3.0
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/index.cjs
CHANGED
|
@@ -7728,11 +7728,15 @@ var ConnectorDialog = ({ open, onOpenChange }) => {
|
|
|
7728
7728
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
7729
7729
|
var CustomConnectButton = ({
|
|
7730
7730
|
className,
|
|
7731
|
+
size,
|
|
7732
|
+
variant,
|
|
7733
|
+
fullWidth,
|
|
7731
7734
|
hideWhenConnected = true
|
|
7732
7735
|
}) => {
|
|
7733
7736
|
const [dialogOpen, setDialogOpen] = (0, import_react10.useState)(false);
|
|
7734
7737
|
const { isConnected, isConnecting } = useStellarAccount();
|
|
7735
7738
|
const [isManuallyInitiated, setIsManuallyInitiated] = (0, import_react10.useState)(false);
|
|
7739
|
+
const sizeProps = (0, import_ui_utils39.getWalletButtonSizeProps)(size);
|
|
7736
7740
|
(0, import_react10.useEffect)(() => {
|
|
7737
7741
|
if (isConnected && hideWhenConnected) {
|
|
7738
7742
|
setDialogOpen(false);
|
|
@@ -7759,18 +7763,18 @@ var CustomConnectButton = ({
|
|
|
7759
7763
|
return null;
|
|
7760
7764
|
}
|
|
7761
7765
|
const showButtonLoading = isConnecting || isManuallyInitiated;
|
|
7762
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_ui_utils39.cn)("flex items-center", className), children: [
|
|
7766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_ui_utils39.cn)("flex items-center", fullWidth && "w-full", className), children: [
|
|
7763
7767
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
7764
7768
|
import_ui_components6.Button,
|
|
7765
7769
|
{
|
|
7766
7770
|
onClick: handleConnectClick,
|
|
7767
7771
|
disabled: showButtonLoading || isConnected,
|
|
7768
|
-
variant: "outline",
|
|
7769
|
-
size:
|
|
7770
|
-
className:
|
|
7772
|
+
variant: variant || "outline",
|
|
7773
|
+
size: sizeProps.size,
|
|
7774
|
+
className: (0, import_ui_utils39.cn)(sizeProps.className, fullWidth && "w-full"),
|
|
7771
7775
|
title: isConnected ? "Connected" : "Connect Wallet",
|
|
7772
7776
|
children: [
|
|
7773
|
-
showButtonLoading ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Loader2, { className:
|
|
7777
|
+
showButtonLoading ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Loader2, { className: (0, import_ui_utils39.cn)(sizeProps.iconSize, "animate-spin mr-1") }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Wallet, { className: (0, import_ui_utils39.cn)(sizeProps.iconSize, "mr-1") }),
|
|
7774
7778
|
showButtonLoading ? "Connecting..." : "Connect Wallet"
|
|
7775
7779
|
]
|
|
7776
7780
|
}
|
|
@@ -7795,26 +7799,32 @@ var import_lucide_react3 = require("lucide-react");
|
|
|
7795
7799
|
var import_ui_components7 = require("@openzeppelin/ui-components");
|
|
7796
7800
|
var import_ui_utils40 = require("@openzeppelin/ui-utils");
|
|
7797
7801
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
7798
|
-
var CustomAccountDisplay = ({
|
|
7802
|
+
var CustomAccountDisplay = ({
|
|
7803
|
+
className,
|
|
7804
|
+
size,
|
|
7805
|
+
variant,
|
|
7806
|
+
fullWidth
|
|
7807
|
+
}) => {
|
|
7799
7808
|
const { isConnected, address } = useStellarAccount();
|
|
7800
7809
|
const { disconnect } = useStellarDisconnect();
|
|
7810
|
+
const sizeProps = (0, import_ui_utils40.getWalletAccountDisplaySizeProps)(size);
|
|
7801
7811
|
if (!isConnected || !address || !disconnect) {
|
|
7802
7812
|
return null;
|
|
7803
7813
|
}
|
|
7804
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_ui_utils40.cn)("flex items-center gap-2", className), children: [
|
|
7805
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col", children: [
|
|
7806
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "
|
|
7807
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-
|
|
7814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_ui_utils40.cn)("flex items-center gap-2", fullWidth && "w-full", className), children: [
|
|
7815
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: (0, import_ui_utils40.cn)("flex flex-col", fullWidth && "flex-1"), children: [
|
|
7816
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: (0, import_ui_utils40.cn)(sizeProps.textSize, "font-medium"), children: (0, import_ui_utils40.truncateMiddle)(address, 4, 4) }),
|
|
7817
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: (0, import_ui_utils40.cn)(sizeProps.subTextSize, "text-muted-foreground -mt-0.5"), children: "Stellar Account" })
|
|
7808
7818
|
] }),
|
|
7809
7819
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
7810
7820
|
import_ui_components7.Button,
|
|
7811
7821
|
{
|
|
7812
7822
|
onClick: () => disconnect(),
|
|
7813
|
-
variant: "ghost",
|
|
7823
|
+
variant: variant || "ghost",
|
|
7814
7824
|
size: "icon",
|
|
7815
|
-
className: "
|
|
7825
|
+
className: (0, import_ui_utils40.cn)(sizeProps.iconButtonSize, "p-0"),
|
|
7816
7826
|
title: "Disconnect wallet",
|
|
7817
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.LogOut, { className:
|
|
7827
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.LogOut, { className: sizeProps.iconSize })
|
|
7818
7828
|
}
|
|
7819
7829
|
)
|
|
7820
7830
|
] });
|