@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.js
CHANGED
|
@@ -7643,7 +7643,7 @@ function loadInitialConfigFromAppService() {
|
|
|
7643
7643
|
import { Loader2, Wallet } from "lucide-react";
|
|
7644
7644
|
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
7645
7645
|
import { Button as Button4 } from "@openzeppelin/ui-components";
|
|
7646
|
-
import { cn } from "@openzeppelin/ui-utils";
|
|
7646
|
+
import { cn, getWalletButtonSizeProps } from "@openzeppelin/ui-utils";
|
|
7647
7647
|
|
|
7648
7648
|
// src/wallet/components/connect/ConnectorDialog.tsx
|
|
7649
7649
|
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
@@ -7730,11 +7730,15 @@ var ConnectorDialog = ({ open, onOpenChange }) => {
|
|
|
7730
7730
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
7731
7731
|
var CustomConnectButton = ({
|
|
7732
7732
|
className,
|
|
7733
|
+
size,
|
|
7734
|
+
variant,
|
|
7735
|
+
fullWidth,
|
|
7733
7736
|
hideWhenConnected = true
|
|
7734
7737
|
}) => {
|
|
7735
7738
|
const [dialogOpen, setDialogOpen] = useState6(false);
|
|
7736
7739
|
const { isConnected, isConnecting } = useStellarAccount();
|
|
7737
7740
|
const [isManuallyInitiated, setIsManuallyInitiated] = useState6(false);
|
|
7741
|
+
const sizeProps = getWalletButtonSizeProps(size);
|
|
7738
7742
|
useEffect5(() => {
|
|
7739
7743
|
if (isConnected && hideWhenConnected) {
|
|
7740
7744
|
setDialogOpen(false);
|
|
@@ -7761,18 +7765,18 @@ var CustomConnectButton = ({
|
|
|
7761
7765
|
return null;
|
|
7762
7766
|
}
|
|
7763
7767
|
const showButtonLoading = isConnecting || isManuallyInitiated;
|
|
7764
|
-
return /* @__PURE__ */ jsxs6("div", { className: cn("flex items-center", className), children: [
|
|
7768
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn("flex items-center", fullWidth && "w-full", className), children: [
|
|
7765
7769
|
/* @__PURE__ */ jsxs6(
|
|
7766
7770
|
Button4,
|
|
7767
7771
|
{
|
|
7768
7772
|
onClick: handleConnectClick,
|
|
7769
7773
|
disabled: showButtonLoading || isConnected,
|
|
7770
|
-
variant: "outline",
|
|
7771
|
-
size:
|
|
7772
|
-
className:
|
|
7774
|
+
variant: variant || "outline",
|
|
7775
|
+
size: sizeProps.size,
|
|
7776
|
+
className: cn(sizeProps.className, fullWidth && "w-full"),
|
|
7773
7777
|
title: isConnected ? "Connected" : "Connect Wallet",
|
|
7774
7778
|
children: [
|
|
7775
|
-
showButtonLoading ? /* @__PURE__ */ jsx8(Loader2, { className:
|
|
7779
|
+
showButtonLoading ? /* @__PURE__ */ jsx8(Loader2, { className: cn(sizeProps.iconSize, "animate-spin mr-1") }) : /* @__PURE__ */ jsx8(Wallet, { className: cn(sizeProps.iconSize, "mr-1") }),
|
|
7776
7780
|
showButtonLoading ? "Connecting..." : "Connect Wallet"
|
|
7777
7781
|
]
|
|
7778
7782
|
}
|
|
@@ -7795,28 +7799,34 @@ var CustomConnectButton = ({
|
|
|
7795
7799
|
// src/wallet/components/account/AccountDisplay.tsx
|
|
7796
7800
|
import { LogOut } from "lucide-react";
|
|
7797
7801
|
import { Button as Button5 } from "@openzeppelin/ui-components";
|
|
7798
|
-
import { cn as cn2, truncateMiddle } from "@openzeppelin/ui-utils";
|
|
7802
|
+
import { cn as cn2, getWalletAccountDisplaySizeProps, truncateMiddle } from "@openzeppelin/ui-utils";
|
|
7799
7803
|
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
7800
|
-
var CustomAccountDisplay = ({
|
|
7804
|
+
var CustomAccountDisplay = ({
|
|
7805
|
+
className,
|
|
7806
|
+
size,
|
|
7807
|
+
variant,
|
|
7808
|
+
fullWidth
|
|
7809
|
+
}) => {
|
|
7801
7810
|
const { isConnected, address } = useStellarAccount();
|
|
7802
7811
|
const { disconnect } = useStellarDisconnect();
|
|
7812
|
+
const sizeProps = getWalletAccountDisplaySizeProps(size);
|
|
7803
7813
|
if (!isConnected || !address || !disconnect) {
|
|
7804
7814
|
return null;
|
|
7805
7815
|
}
|
|
7806
|
-
return /* @__PURE__ */ jsxs7("div", { className: cn2("flex items-center gap-2", className), children: [
|
|
7807
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col", children: [
|
|
7808
|
-
/* @__PURE__ */ jsx9("span", { className: "
|
|
7809
|
-
/* @__PURE__ */ jsx9("span", { className: "text-
|
|
7816
|
+
return /* @__PURE__ */ jsxs7("div", { className: cn2("flex items-center gap-2", fullWidth && "w-full", className), children: [
|
|
7817
|
+
/* @__PURE__ */ jsxs7("div", { className: cn2("flex flex-col", fullWidth && "flex-1"), children: [
|
|
7818
|
+
/* @__PURE__ */ jsx9("span", { className: cn2(sizeProps.textSize, "font-medium"), children: truncateMiddle(address, 4, 4) }),
|
|
7819
|
+
/* @__PURE__ */ jsx9("span", { className: cn2(sizeProps.subTextSize, "text-muted-foreground -mt-0.5"), children: "Stellar Account" })
|
|
7810
7820
|
] }),
|
|
7811
7821
|
/* @__PURE__ */ jsx9(
|
|
7812
7822
|
Button5,
|
|
7813
7823
|
{
|
|
7814
7824
|
onClick: () => disconnect(),
|
|
7815
|
-
variant: "ghost",
|
|
7825
|
+
variant: variant || "ghost",
|
|
7816
7826
|
size: "icon",
|
|
7817
|
-
className: "
|
|
7827
|
+
className: cn2(sizeProps.iconButtonSize, "p-0"),
|
|
7818
7828
|
title: "Disconnect wallet",
|
|
7819
|
-
children: /* @__PURE__ */ jsx9(LogOut, { className:
|
|
7829
|
+
children: /* @__PURE__ */ jsx9(LogOut, { className: sizeProps.iconSize })
|
|
7820
7830
|
}
|
|
7821
7831
|
)
|
|
7822
7832
|
] });
|