@dexterai/connect 0.22.2 → 0.23.1

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.
@@ -43,6 +43,13 @@ var BUTTON_CSS = `
43
43
  }
44
44
  .dx-btn--danger:focus-visible{ box-shadow:0 0 0 3px color-mix(in srgb,var(--dx-danger,#b3261e) 38%,transparent); }
45
45
  .dx-btn--block{ width:100%; }
46
+ .dx-btn--sm{
47
+ padding:7px 14px; gap:7px; font-size:.66rem; letter-spacing:.1em;
48
+ box-shadow:0 8px 16px color-mix(in srgb,var(--dx-ember,#f26c18) 18%,transparent);
49
+ }
50
+ .dx-btn--sm:hover{ box-shadow:0 12px 22px color-mix(in srgb,var(--dx-ember,#f26c18) 26%,transparent); }
51
+ .dx-btn--sm .dx-btn__mark{ width:14px; height:14px; }
52
+ .dx-btn--sm .dx-btn__spin{ width:12px; height:12px; }
46
53
  .dx-btn__mark{ flex-shrink:0; }
47
54
  .dx-btn__spin{ width:15px; height:15px; flex-shrink:0; border-radius:50%;
48
55
  border:2px solid color-mix(in srgb,currentColor 30%,transparent); border-top-color:currentColor;
@@ -93,6 +100,7 @@ function DexterButton(props) {
93
100
  loadingLabel = "Connecting\u2026",
94
101
  variant = "primary",
95
102
  block = false,
103
+ size = "md",
96
104
  withMark = true,
97
105
  onClick,
98
106
  disabled = false,
@@ -110,6 +118,7 @@ function DexterButton(props) {
110
118
  variant === "secondary" && "dx-btn--secondary",
111
119
  variant === "danger" && "dx-btn--danger",
112
120
  block && "dx-btn--block",
121
+ size === "sm" && "dx-btn--sm",
113
122
  className
114
123
  ),
115
124
  onClick,
@@ -350,7 +350,7 @@ async function passkeyLogin(config = {}, onPhase) {
350
350
  apiBase: config.apiBase
351
351
  });
352
352
  if (result2.vault) {
353
- setActiveHandle(result2.vault.userHandle, void 0, result2.vault.credentialId);
353
+ setActiveHandle(result2.vault.userHandle, result2.vault.walletLabel ?? void 0, result2.vault.credentialId);
354
354
  }
355
355
  return result2;
356
356
  }
@@ -370,7 +370,7 @@ async function passkeyLogin(config = {}, onPhase) {
370
370
  onPhase?.("verifying");
371
371
  const result = await submitLogin(apiBase, response);
372
372
  if (result.vault) {
373
- setActiveHandle(result.vault.userHandle, void 0, result.vault.credentialId);
373
+ setActiveHandle(result.vault.userHandle, result.vault.walletLabel ?? void 0, result.vault.credentialId);
374
374
  }
375
375
  return result;
376
376
  }
@@ -384,7 +384,7 @@ async function continueWithDexter(config = {}, onPhase) {
384
384
  if (result2.kind === "create") {
385
385
  setActiveHandle(result2.handle, config.name, result2.credentialId);
386
386
  } else if (result2.vault) {
387
- setActiveHandle(result2.vault.userHandle, void 0, result2.vault.credentialId);
387
+ setActiveHandle(result2.vault.userHandle, result2.vault.walletLabel ?? void 0, result2.vault.credentialId);
388
388
  }
389
389
  return result2;
390
390
  }
@@ -565,11 +565,12 @@ function presentOrNull(value) {
565
565
  function resolveIdentity(input) {
566
566
  const userHandle = presentOrNull(input.userHandle);
567
567
  const accountToken = presentOrNull(input.accountToken);
568
+ const walletLabel = userHandle ? presentOrNull(input.walletLabel ?? null) : null;
568
569
  const hasPasskeyVault = userHandle !== null;
569
570
  const hasAccount = accountToken !== null;
570
571
  const hasWallet = hasPasskeyVault || hasAccount;
571
572
  const kind = hasPasskeyVault ? "passkey-vault" : hasAccount ? "account" : "none";
572
- return { kind, userHandle, accountToken, hasPasskeyVault, hasAccount, hasWallet };
573
+ return { kind, userHandle, walletLabel, accountToken, hasPasskeyVault, hasAccount, hasWallet };
573
574
  }
574
575
 
575
576
  // src/recover.ts
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SignInResult, C as CreateWalletResult, a as CreateWalletConfig, b as CeremonyPhase, D as DexterConnectConfig, c as ConnectVault, R as RecoverWalletConfig, d as RecoverOutcome, I as IdentityKind } from './signals-pjh3z6N8.js';
2
- export { A as ACTIVE_WALLET_STORAGE_KEY, e as ConnectError, f as IdentityInput, P as PasskeyLoginTokens, g as PasskeySignalSupport, h as RecoverVault, i as ResolvedIdentity, j as SESSION_TTL_30D, k as SpendPolicy, l as StoredWallet, m as authoredPolicy, n as createWallet, o as ejectActiveWallet, p as forgetWallet, q as getActiveHandle, r as getCredentialId, s as listWallets, t as passkeySignalSupport, u as prunePasskey, v as renamePasskey, w as resolveIdentity, x as setActiveHandle, y as subscribeWallet, z as switchWallet, B as syncAcceptedPasskeys, E as usdToAtomic } from './signals-pjh3z6N8.js';
1
+ import { S as SignInResult, C as CreateWalletResult, a as CreateWalletConfig, b as CeremonyPhase, D as DexterConnectConfig, c as ConnectVault, R as RecoverWalletConfig, d as RecoverOutcome, I as IdentityKind } from './signals-CQ5AEzXY.js';
2
+ export { A as ACTIVE_WALLET_STORAGE_KEY, e as ConnectError, f as IdentityInput, P as PasskeyLoginTokens, g as PasskeySignalSupport, h as RecoverVault, i as ResolvedIdentity, j as SESSION_TTL_30D, k as SpendPolicy, l as StoredWallet, m as authoredPolicy, n as createWallet, o as ejectActiveWallet, p as forgetWallet, q as getActiveHandle, r as getCredentialId, s as listWallets, t as passkeySignalSupport, u as prunePasskey, v as renamePasskey, w as resolveIdentity, x as setActiveHandle, y as subscribeWallet, z as switchWallet, B as syncAcceptedPasskeys, E as usdToAtomic } from './signals-CQ5AEzXY.js';
3
3
  import { DexterApiBrowserPasskeySigner } from '@dexterai/vault/signers/browser';
4
4
 
5
5
  /**
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  switchWallet,
27
27
  syncAcceptedPasskeys,
28
28
  usdToAtomic
29
- } from "./chunk-MOC5AVY7.js";
29
+ } from "./chunk-XTYNX5LX.js";
30
30
 
31
31
  // src/agentSpend.ts
32
32
  import { PublicKey } from "@solana/web3.js";
package/dist/react.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DexterApiBrowserPasskeySigner } from '@dexterai/vault/signers/browser';
2
- import { b as CeremonyPhase, S as SignInResult, d as RecoverOutcome, P as PasskeyLoginTokens, c as ConnectVault, e as ConnectError, l as StoredWallet, g as PasskeySignalSupport, i as ResolvedIdentity, C as CreateWalletResult } from './signals-pjh3z6N8.js';
3
- export { h as RecoverVault } from './signals-pjh3z6N8.js';
2
+ import { b as CeremonyPhase, S as SignInResult, d as RecoverOutcome, P as PasskeyLoginTokens, c as ConnectVault, e as ConnectError, l as StoredWallet, g as PasskeySignalSupport, i as ResolvedIdentity, C as CreateWalletResult } from './signals-CQ5AEzXY.js';
3
+ export { h as RecoverVault } from './signals-CQ5AEzXY.js';
4
4
  import { ReactElement, ButtonHTMLAttributes, ReactNode } from 'react';
5
5
 
6
6
  type ConnectStatus = 'idle' | 'pending' | 'done' | 'error';
@@ -84,6 +84,8 @@ interface SignInWithDexterProps extends UseSignInWithDexterConfig {
84
84
  variant?: 'primary' | 'secondary';
85
85
  /** Full-width button. */
86
86
  block?: boolean;
87
+ /** 'md' (default) or 'sm' — the mini header variant of the button. */
88
+ size?: 'md' | 'sm';
87
89
  /** Extra className composed after the brand classes. Prefer overriding the
88
90
  * `--dx-*` CSS variables for theming. */
89
91
  className?: string;
@@ -113,6 +115,10 @@ interface DexterButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>
113
115
  variant?: 'primary' | 'secondary' | 'danger';
114
116
  /** Full-width (fills its container). */
115
117
  block?: boolean;
118
+ /** 'md' (default) = the standard CTA. 'sm' = the mini header/chip-row
119
+ * variant: tighter padding, smaller type and mark. Same states, same
120
+ * theming — never hand-shrink the md button with a className. */
121
+ size?: 'md' | 'sm';
116
122
  /** Render the Dexter mark before the children. Default true. */
117
123
  withMark?: boolean;
118
124
  onClick?: () => void;
@@ -127,6 +133,10 @@ declare function DexterButton(props: DexterButtonProps): ReactElement;
127
133
  interface UseDexterWallet {
128
134
  /** Active wallet handle, or null if this browser has no active wallet. */
129
135
  activeHandle: string | null;
136
+ /** The active wallet's roster entry (handle + label + credentialId), or
137
+ * null. `activeWallet.label` is the wallet's human name — identity is
138
+ * first-class, so display surfaces read it here instead of re-fetching. */
139
+ activeWallet: StoredWallet | null;
130
140
  /** Known wallets on this browser, most-recently-used first. */
131
141
  wallets: StoredWallet[];
132
142
  /** What the WebAuthn Signal API supports in THIS browser (rename / prune). */
package/dist/react.js CHANGED
@@ -17,13 +17,13 @@ import {
17
17
  setActiveHandle,
18
18
  subscribe,
19
19
  switchWallet
20
- } from "./chunk-MOC5AVY7.js";
20
+ } from "./chunk-XTYNX5LX.js";
21
21
  import {
22
22
  DexterButton,
23
23
  DexterMark,
24
24
  cx,
25
25
  ensureDexterButtonStyles
26
- } from "./chunk-EVDIZIHH.js";
26
+ } from "./chunk-PW33ZOCP.js";
27
27
 
28
28
  // src/useSignInWithDexter.ts
29
29
  import { useCallback, useEffect, useMemo, useState } from "react";
@@ -183,6 +183,7 @@ function SignInWithDexter(props) {
183
183
  label = "Sign in with Dexter",
184
184
  variant = "primary",
185
185
  block = false,
186
+ size = "md",
186
187
  className,
187
188
  showConnectedChip = true,
188
189
  ...config
@@ -205,7 +206,7 @@ function SignInWithDexter(props) {
205
206
  if (!showConnectedChip) return null;
206
207
  return /* @__PURE__ */ jsxs("span", { className: cx("dx-chip", className), children: [
207
208
  /* @__PURE__ */ jsx("span", { className: "dx-chip__dot", "aria-hidden": true }),
208
- /* @__PURE__ */ jsx("span", { children: c.vaultAddress ? shortAddress(c.vaultAddress) : "Connected" }),
209
+ /* @__PURE__ */ jsx("span", { children: c.vault?.walletLabel ?? (c.vaultAddress ? shortAddress(c.vaultAddress) : "Connected") }),
209
210
  c.usdcBalance !== null && /* @__PURE__ */ jsxs("span", { className: "dx-chip__bal", children: [
210
211
  formatUsd(c.usdcBalance),
211
212
  " available"
@@ -220,6 +221,7 @@ function SignInWithDexter(props) {
220
221
  loadingLabel: c.phase ? ceremonyPhaseLabel(c.phase) : "Connecting\u2026",
221
222
  variant,
222
223
  block,
224
+ size,
223
225
  className,
224
226
  onClick: handleClick,
225
227
  children: label
@@ -258,6 +260,7 @@ function useDexterWallet() {
258
260
  }, []);
259
261
  return {
260
262
  activeHandle,
263
+ activeWallet: activeHandle ? wallets.find((w) => w.handle === activeHandle) ?? null : null,
261
264
  wallets,
262
265
  support,
263
266
  eject,
@@ -411,13 +414,15 @@ function DexterWalletMenu(props) {
411
414
  // src/useIdentity.ts
412
415
  import { useMemo as useMemo2 } from "react";
413
416
  function useIdentity({ accountToken }) {
414
- const { activeHandle } = useDexterWallet();
417
+ const { activeHandle, activeWallet } = useDexterWallet();
418
+ const walletLabel = activeWallet?.label ?? null;
415
419
  return useMemo2(
416
420
  () => resolveIdentity({
417
421
  accountToken: accountToken ?? null,
418
- userHandle: activeHandle ?? null
422
+ userHandle: activeHandle ?? null,
423
+ walletLabel
419
424
  }),
420
- [accountToken, activeHandle]
425
+ [accountToken, activeHandle, walletLabel]
421
426
  );
422
427
  }
423
428
 
@@ -25,6 +25,11 @@ interface ConnectVault {
25
25
  publicKey: string;
26
26
  userHandle: string;
27
27
  credentialId: string;
28
+ /** The wallet's cross-device display name (user-authored via rename), or
29
+ * null when never named. Identity is first-class: every sign-in carries
30
+ * the human name so no consumer ever falls back to a synthetic email.
31
+ * Optional for wire-compat with servers/popup pages predating 0.23. */
32
+ walletLabel?: string | null;
28
33
  }
29
34
  /** Result of a completed "Sign in with Dexter" ceremony. */
30
35
  interface SignInResult {
@@ -156,12 +161,19 @@ interface IdentityInput {
156
161
  accountToken: string | null;
157
162
  /** The passkey-vault user handle (the connect wallet store), else null. */
158
163
  userHandle: string | null;
164
+ /** The active wallet's display name from the connect wallet store (persisted
165
+ * at sign-in/recover/rename), else null. Browser-only input like the handle. */
166
+ walletLabel?: string | null;
159
167
  }
160
168
  interface ResolvedIdentity {
161
169
  /** The primary identity axis, passkey-vault-first. */
162
170
  kind: IdentityKind;
163
171
  /** Passkey-vault identity (FIRST-CLASS): the wallet handle, or null. */
164
172
  userHandle: string | null;
173
+ /** The wallet's human display name, or null when the wallet was never named
174
+ * (or no wallet is active). Display surfaces prefer this over any synthetic
175
+ * account identifier — a user should never be shown a generated email. */
176
+ walletLabel: string | null;
165
177
  /** Account identity (secondary/legacy axis): bearer for account-scoped fetches, or null. */
166
178
  accountToken: string | null;
167
179
  /** A passkey vault is present on this device. */
package/dist/worldid.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DexterButton,
3
3
  ensureDexterButtonStyles
4
- } from "./chunk-EVDIZIHH.js";
4
+ } from "./chunk-PW33ZOCP.js";
5
5
 
6
6
  // src/worldid.tsx
7
7
  import { useEffect, useState } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dexterai/connect",
3
- "version": "0.22.2",
3
+ "version": "0.23.1",
4
4
  "description": "Sign in with Dexter — passkey connector. Composes @dexterai/vault.",
5
5
  "type": "module",
6
6
  "exports": {