@bufinance/web3-signin 0.1.3 → 0.1.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bufinance/web3-signin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Headless cross-app Web3 wallet sign-in for BUFI: EIP-6963 wallet discovery + Supabase signInWithWeb3 (EIP-4361) + Turnstile captcha. Shared by desk-v1 and defi-web-app. Source of truth lives here; both apps consume it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -21,6 +21,7 @@ export interface WalletDropdownClassNames {
|
|
|
21
21
|
tabActive?: string;
|
|
22
22
|
accountRow?: string;
|
|
23
23
|
balanceRow?: string;
|
|
24
|
+
signOut?: string;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export interface WalletDropdownProps {
|
|
@@ -58,6 +59,14 @@ export interface WalletDropdownProps {
|
|
|
58
59
|
/** Shown when authed but no accounts yet (provisioning). */
|
|
59
60
|
emptyState?: ReactNode;
|
|
60
61
|
onSelectAccount?: (account: WalletAccount) => void;
|
|
62
|
+
/**
|
|
63
|
+
* When provided, a "Log out" button renders at the BOTTOM of the open panel
|
|
64
|
+
* (below children). Both apps wire their own session sign-out — desk via
|
|
65
|
+
* Supabase, defi-web via the BUFI session — so the control lives in one place.
|
|
66
|
+
*/
|
|
67
|
+
onSignOut?: () => void;
|
|
68
|
+
/** Label for the sign-out button (default "Log out"). */
|
|
69
|
+
signOutLabel?: string;
|
|
61
70
|
classNames?: WalletDropdownClassNames;
|
|
62
71
|
}
|
|
63
72
|
|
|
@@ -79,6 +88,8 @@ export function WalletDropdown(props: WalletDropdownProps): ReactNode {
|
|
|
79
88
|
renderBalances = true,
|
|
80
89
|
emptyState,
|
|
81
90
|
onSelectAccount,
|
|
91
|
+
onSignOut,
|
|
92
|
+
signOutLabel = "Log out",
|
|
82
93
|
classNames = {},
|
|
83
94
|
} = props;
|
|
84
95
|
|
|
@@ -188,6 +199,18 @@ export function WalletDropdown(props: WalletDropdownProps): ReactNode {
|
|
|
188
199
|
{children}
|
|
189
200
|
</>
|
|
190
201
|
)}
|
|
202
|
+
|
|
203
|
+
{/* Sign out — always the last thing in the panel. */}
|
|
204
|
+
{onSignOut && (
|
|
205
|
+
<button
|
|
206
|
+
type="button"
|
|
207
|
+
className={classNames.signOut}
|
|
208
|
+
onClick={onSignOut}
|
|
209
|
+
data-bufi-signout
|
|
210
|
+
>
|
|
211
|
+
{signOutLabel}
|
|
212
|
+
</button>
|
|
213
|
+
)}
|
|
191
214
|
</div>
|
|
192
215
|
)}
|
|
193
216
|
</div>
|