@seams/wallet 0.10.1 → 0.11.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.
Files changed (173) hide show
  1. package/README.md +3 -3
  2. package/THIRD_PARTY_NOTICES.md +33 -1812
  3. package/dist/.build-inputs.sha256 +1 -1
  4. package/dist/esm/SeamsWeb/operations/recovery/walletRecoveryCodeBackup.js +100 -0
  5. package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.js +127 -71
  6. package/dist/esm/core/signingEngine/uiConfirm/ui/preact/RecoveryCodeBackupSurface.js +558 -0
  7. package/dist/esm/core/signingEngine/uiConfirm/ui/preact/mountRecoveryCodeBackupSurface.js +82 -0
  8. package/dist/esm/core/types/sdkSentEvents.js +9 -0
  9. package/dist/esm/react/components/AccountMenuButton/AccountMenuButtonMock.js +189 -0
  10. package/dist/esm/react/components/AccountMenuButton/AccountMenuButtonView.js +137 -0
  11. package/dist/esm/react/components/AccountMenuButton/AccountMenuDeviceDetails.js +39 -0
  12. package/dist/esm/react/components/AccountMenuButton/AccountMenuDialog.js +39 -13
  13. package/dist/esm/react/components/AccountMenuButton/AccountMenuMockScreens.js +247 -0
  14. package/dist/esm/react/components/AccountMenuButton/AccountMenuScreen.js +41 -0
  15. package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodRow.js +79 -0
  16. package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodsModal.js +168 -174
  17. package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodsView.js +19 -0
  18. package/dist/esm/react/components/AccountMenuButton/ExportKeysScreen.js +30 -0
  19. package/dist/esm/react/components/AccountMenuButton/LinkedDevicesModal.css +148 -87
  20. package/dist/esm/react/components/AccountMenuButton/LinkedDevicesModal.js +26 -5
  21. package/dist/esm/react/components/AccountMenuButton/MenuItem.js +28 -13
  22. package/dist/esm/react/components/AccountMenuButton/ProfileDropdown.css +73 -69
  23. package/dist/esm/react/components/AccountMenuButton/ProfileDropdown.js +56 -68
  24. package/dist/esm/react/components/AccountMenuButton/RecoveryCodeAcknowledgement.js +27 -0
  25. package/dist/esm/react/components/AccountMenuButton/RecoveryCodeActions.js +53 -0
  26. package/dist/esm/react/components/AccountMenuButton/TransactionSettingsSection.css +3 -1
  27. package/dist/esm/react/components/AccountMenuButton/TransactionSettingsSection.js +2 -8
  28. package/dist/esm/react/components/AccountMenuButton/UserAccountButton.css +1 -1
  29. package/dist/esm/react/components/AccountMenuButton/UserAccountButton.js +6 -3
  30. package/dist/esm/react/components/AccountMenuButton/WalletRegionSection.js +4 -4
  31. package/dist/esm/react/components/AccountMenuButton/Web3AuthProfileButton.css +443 -12
  32. package/dist/esm/react/components/AccountMenuButton/hooks/useProfileState.js +1 -1
  33. package/dist/esm/react/components/AccountMenuButton/icons/LayersIcon.js +8 -0
  34. package/dist/esm/react/components/AccountMenuButton/icons/LockKeyholeIcon.js +22 -0
  35. package/dist/esm/react/components/AccountMenuButton/icons/PlusIcon.js +8 -0
  36. package/dist/esm/react/components/AccountMenuButton/icons/SunIcon.js +2 -2
  37. package/dist/esm/react/components/AccountMenuButton/icons/TouchIcon.css +0 -8
  38. package/dist/esm/react/components/AccountMenuButton/index.js +135 -115
  39. package/dist/esm/react/components/QRCodeScanner.js +64 -40
  40. package/dist/esm/react/components/QRCodeScannerCamera.js +16 -0
  41. package/dist/esm/react/components/ShowQRCode.js +2 -2
  42. package/dist/esm/react/externalEvm.js +2 -2
  43. package/dist/esm/react/index.js +2 -1
  44. package/dist/esm/react/styles/styles.css +520 -91
  45. package/dist/esm/react/transactionReview/TransactionReviewHost.js +3 -3
  46. package/dist/esm/sdk/{adapters-DYPu0nK9.js → adapters-CGvNLOfZ.js} +1 -1
  47. package/dist/{public/sdk/display-DjoWrSgE.js → esm/sdk/display-DTbGoX4e.js} +1 -1
  48. package/dist/{public/sdk/exportKeypairOperation-DYCzCbqL.js → esm/sdk/exportKeypairOperation-BHXMSA3v.js} +1 -1
  49. package/dist/{public/sdk/host-CCwkhJHK.js → esm/sdk/host-Bqmmy8Ts.js} +1 -1
  50. package/dist/esm/sdk/{localOnly-KvZeKkH5.js → localOnly-CUVRoMy2.js} +1 -1
  51. package/dist/esm/sdk/{mountRecoveryCodeBackupSurface-BA2ttbTM.js → mountRecoveryCodeBackupSurface-D1G-iCPI.js} +2 -2
  52. package/dist/esm/sdk/{pendingWalletRecoveryCodeBackup-BkIrbd6Q.js → pendingWalletRecoveryCodeBackup-CMCOUuA-.js} +1 -1
  53. package/dist/esm/sdk/{recovery-entrypoint-DoXswV9I.js → recovery-entrypoint-QxTiyx-o.js} +1 -1
  54. package/dist/esm/sdk/{registration-BFHEYmgh.js → registration-Drtkzrlc.js} +1 -1
  55. package/dist/esm/sdk/registration-eyzHqLHi.js +1 -0
  56. package/dist/esm/sdk/{requireStepUpAuth-C67sluoC.js → requireStepUpAuth-FqZSU021.js} +1 -1
  57. package/dist/esm/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
  58. package/dist/esm/sdk/runtime-auth-CbveTM2_.js +1 -0
  59. package/dist/esm/sdk/{runtime-device-link-BCKuKNp1.js → runtime-device-link-CHsqrEQ9.js} +1 -1
  60. package/dist/esm/sdk/{runtime-ecdsa-tempo-Bpmv6fe0.js → runtime-ecdsa-tempo-MgmnU9g-.js} +1 -1
  61. package/dist/esm/sdk/{runtime-email-otp-Bp16EG2j.js → runtime-email-otp-Cj96n102.js} +1 -1
  62. package/dist/esm/sdk/{runtime-export-fONYqIZg.js → runtime-export-mcwZRxKk.js} +1 -1
  63. package/dist/esm/sdk/{runtime-near-s4rtAbA2.js → runtime-near-BMdTtu7D.js} +1 -1
  64. package/dist/esm/sdk/{runtime-preferences-1v5EHalc.js → runtime-preferences-CBlhE8bX.js} +1 -1
  65. package/dist/esm/sdk/{runtime-recovery-codes-Dn-NccpU.js → runtime-recovery-codes-B1gixZsp.js} +1 -1
  66. package/dist/esm/sdk/{runtime-recovery-mppuqUaS.js → runtime-recovery-mJp3MLeG.js} +1 -1
  67. package/dist/esm/sdk/sdkSentEvents-Dl8fOL50.js +1 -0
  68. package/dist/esm/sdk/shared-8Qe7Nxgg.js +6 -0
  69. package/dist/{public/sdk/signEvmFamily-DjD3tn8e.js → esm/sdk/signEvmFamily-M0trbeZe.js} +1 -1
  70. package/dist/esm/sdk/{signEvmFamilyWithUiConfirmForTempo-CwRFbaLM.js → signEvmFamilyWithUiConfirmForTempo-Bo25SwuV.js} +1 -1
  71. package/dist/esm/sdk/{signEvmWithUiConfirm-BHG0dwVG.js → signEvmWithUiConfirm-CFcqJRj3.js} +1 -1
  72. package/dist/{public/sdk/signNear-D0tlQXb9.js → esm/sdk/signNear-DGUQZ44s.js} +1 -1
  73. package/dist/esm/sdk/{signingFlow-Mym5j6aw.js → signingFlow-DZvV4AgG.js} +1 -1
  74. package/dist/esm/sdk/{transaction-activity-Cb2JyYKv.js → transaction-activity-xfeHKJoq.js} +1 -1
  75. package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
  76. package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
  77. package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
  78. package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
  79. package/dist/esm/sdk/wallet-ui.css +1 -1
  80. package/dist/{public/sdk/walletCustodyEcdsaContinuity-B8aO2NFb.js → esm/sdk/walletCustodyEcdsaContinuity-_IKoCUBO.js} +1 -1
  81. package/dist/{public/sdk/walletRecoveryCommit-C3EgMjo-.js → esm/sdk/walletRecoveryCommit-DDPa1rAJ.js} +1 -1
  82. package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
  83. package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client_bg.wasm +0 -0
  84. package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client_bg.wasm +0 -0
  85. package/dist/public/headers.manifest.json +1 -1
  86. package/dist/public/sdk/{adapters-DYPu0nK9.js → adapters-CGvNLOfZ.js} +1 -1
  87. package/dist/{esm/sdk/display-DjoWrSgE.js → public/sdk/display-DTbGoX4e.js} +1 -1
  88. package/dist/{esm/sdk/exportKeypairOperation-DYCzCbqL.js → public/sdk/exportKeypairOperation-BHXMSA3v.js} +1 -1
  89. package/dist/{esm/sdk/host-CCwkhJHK.js → public/sdk/host-Bqmmy8Ts.js} +1 -1
  90. package/dist/public/sdk/{localOnly-KvZeKkH5.js → localOnly-CUVRoMy2.js} +1 -1
  91. package/dist/public/sdk/{mountRecoveryCodeBackupSurface-BA2ttbTM.js → mountRecoveryCodeBackupSurface-D1G-iCPI.js} +2 -2
  92. package/dist/public/sdk/{pendingWalletRecoveryCodeBackup-BkIrbd6Q.js → pendingWalletRecoveryCodeBackup-CMCOUuA-.js} +1 -1
  93. package/dist/public/sdk/{recovery-entrypoint-DoXswV9I.js → recovery-entrypoint-QxTiyx-o.js} +1 -1
  94. package/dist/public/sdk/{registration-BFHEYmgh.js → registration-Drtkzrlc.js} +1 -1
  95. package/dist/public/sdk/registration-eyzHqLHi.js +1 -0
  96. package/dist/public/sdk/{requireStepUpAuth-C67sluoC.js → requireStepUpAuth-FqZSU021.js} +1 -1
  97. package/dist/public/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
  98. package/dist/public/sdk/runtime-auth-CbveTM2_.js +1 -0
  99. package/dist/public/sdk/{runtime-device-link-BCKuKNp1.js → runtime-device-link-CHsqrEQ9.js} +1 -1
  100. package/dist/public/sdk/{runtime-ecdsa-tempo-Bpmv6fe0.js → runtime-ecdsa-tempo-MgmnU9g-.js} +1 -1
  101. package/dist/public/sdk/{runtime-email-otp-Bp16EG2j.js → runtime-email-otp-Cj96n102.js} +1 -1
  102. package/dist/public/sdk/{runtime-export-fONYqIZg.js → runtime-export-mcwZRxKk.js} +1 -1
  103. package/dist/public/sdk/{runtime-near-s4rtAbA2.js → runtime-near-BMdTtu7D.js} +1 -1
  104. package/dist/public/sdk/{runtime-preferences-1v5EHalc.js → runtime-preferences-CBlhE8bX.js} +1 -1
  105. package/dist/public/sdk/{runtime-recovery-codes-Dn-NccpU.js → runtime-recovery-codes-B1gixZsp.js} +1 -1
  106. package/dist/public/sdk/{runtime-recovery-mppuqUaS.js → runtime-recovery-mJp3MLeG.js} +1 -1
  107. package/dist/public/sdk/sdkSentEvents-Dl8fOL50.js +1 -0
  108. package/dist/public/sdk/shared-8Qe7Nxgg.js +6 -0
  109. package/dist/{esm/sdk/signEvmFamily-DjD3tn8e.js → public/sdk/signEvmFamily-M0trbeZe.js} +1 -1
  110. package/dist/public/sdk/{signEvmFamilyWithUiConfirmForTempo-CwRFbaLM.js → signEvmFamilyWithUiConfirmForTempo-Bo25SwuV.js} +1 -1
  111. package/dist/public/sdk/{signEvmWithUiConfirm-BHG0dwVG.js → signEvmWithUiConfirm-CFcqJRj3.js} +1 -1
  112. package/dist/{esm/sdk/signNear-D0tlQXb9.js → public/sdk/signNear-DGUQZ44s.js} +1 -1
  113. package/dist/public/sdk/{signingFlow-Mym5j6aw.js → signingFlow-DZvV4AgG.js} +1 -1
  114. package/dist/public/sdk/{transaction-activity-Cb2JyYKv.js → transaction-activity-xfeHKJoq.js} +1 -1
  115. package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
  116. package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
  117. package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
  118. package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
  119. package/dist/public/sdk/wallet-ui.css +1 -1
  120. package/dist/{esm/sdk/walletCustodyEcdsaContinuity-B8aO2NFb.js → public/sdk/walletCustodyEcdsaContinuity-_IKoCUBO.js} +1 -1
  121. package/dist/{esm/sdk/walletRecoveryCommit-C3EgMjo-.js → public/sdk/walletRecoveryCommit-DDPa1rAJ.js} +1 -1
  122. package/dist/public/sdk/workers/email_otp_runtime_bg.wasm +0 -0
  123. package/dist/public/sdk/workers/evm_crypto_bg.wasm +0 -0
  124. package/dist/public/sdk/workers/router_ab_ecdsa_client_bg.wasm +0 -0
  125. package/dist/public/sdk/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
  126. package/dist/public/sdk/workers/shamir3pass_runtime_bg.wasm +0 -0
  127. package/dist/public/sdk/workers/tempo_signer_bg.wasm +0 -0
  128. package/dist/public/sdk/workers/wallet_custody_ceremony_bg.wasm +0 -0
  129. package/dist/public/sdk/workers/wasm_signer_worker_bg.wasm +0 -0
  130. package/dist/public/wallet-assets.manifest.json +62 -62
  131. package/dist/public/wallet-service/index.html +4 -4
  132. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/domain.d.ts +4 -0
  133. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/session.d.ts +4 -2
  134. package/dist/types/wallet/src/core/types/sdkSentEvents.d.ts +4 -0
  135. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuButtonMock.d.ts +17 -0
  136. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuButtonView.d.ts +17 -0
  137. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuDeviceDetails.d.ts +13 -0
  138. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuDialog.d.ts +1 -1
  139. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuMockScreens.d.ts +43 -0
  140. package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuScreen.d.ts +9 -0
  141. package/dist/types/wallet/src/react/components/AccountMenuButton/AuthenticationMethodRow.d.ts +14 -0
  142. package/dist/types/wallet/src/react/components/AccountMenuButton/AuthenticationMethodsModal.d.ts +1 -1
  143. package/dist/types/wallet/src/react/components/AccountMenuButton/AuthenticationMethodsView.d.ts +8 -0
  144. package/dist/types/wallet/src/react/components/AccountMenuButton/ExportKeysScreen.d.ts +7 -0
  145. package/dist/types/wallet/src/react/components/AccountMenuButton/LinkedDevicesModal.d.ts +1 -1
  146. package/dist/types/wallet/src/react/components/AccountMenuButton/ProfileDropdown.d.ts +2 -14
  147. package/dist/types/wallet/src/react/components/AccountMenuButton/RecoveryCodeAcknowledgement.d.ts +5 -0
  148. package/dist/types/wallet/src/react/components/AccountMenuButton/RecoveryCodeActions.d.ts +5 -0
  149. package/dist/types/wallet/src/react/components/AccountMenuButton/icons/LayersIcon.d.ts +2 -0
  150. package/dist/types/wallet/src/react/components/AccountMenuButton/icons/LockKeyholeIcon.d.ts +2 -0
  151. package/dist/types/wallet/src/react/components/AccountMenuButton/icons/PlusIcon.d.ts +2 -0
  152. package/dist/types/wallet/src/react/components/AccountMenuButton/index.d.ts +2 -0
  153. package/dist/types/wallet/src/react/components/AccountMenuButton/types.d.ts +1 -14
  154. package/dist/types/wallet/src/react/components/QRCodeScanner.d.ts +1 -0
  155. package/dist/types/wallet/src/react/components/QRCodeScannerCamera.d.ts +5 -0
  156. package/dist/types/wallet/src/react/index.d.ts +2 -1
  157. package/dist/workers/email_otp_runtime_bg.wasm +0 -0
  158. package/dist/workers/evm_crypto_bg.wasm +0 -0
  159. package/dist/workers/router_ab_ecdsa_client_bg.wasm +0 -0
  160. package/dist/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
  161. package/dist/workers/shamir3pass_runtime_bg.wasm +0 -0
  162. package/dist/workers/tempo_signer_bg.wasm +0 -0
  163. package/dist/workers/wallet_custody_ceremony_bg.wasm +0 -0
  164. package/dist/workers/wasm_signer_worker_bg.wasm +0 -0
  165. package/package.json +1 -1
  166. package/dist/esm/sdk/registration-Cx_f58rb.js +0 -1
  167. package/dist/esm/sdk/runtime-auth-Cjvf3UFB.js +0 -1
  168. package/dist/esm/sdk/sdkSentEvents-DiQ3YVlj.js +0 -1
  169. package/dist/esm/sdk/shared-Big0VQEK.js +0 -6
  170. package/dist/public/sdk/registration-Cx_f58rb.js +0 -1
  171. package/dist/public/sdk/runtime-auth-Cjvf3UFB.js +0 -1
  172. package/dist/public/sdk/sdkSentEvents-DiQ3YVlj.js +0 -1
  173. package/dist/public/sdk/shared-Big0VQEK.js +0 -6
@@ -1,7 +1,8 @@
1
1
  import { useSeams } from "../../context/index.js";
2
- import { KeyIcon } from "./icons/KeyIcon.js";
3
2
  import { AccountMenuDialogFrame, useAccountMenuDialogKeyboard } from "./AccountMenuDialog.js";
4
- import { MailIcon } from "./icons/MailIcon.js";
3
+ import { AuthenticationMethodRow } from "./AuthenticationMethodRow.js";
4
+ import { AuthenticationMethodsView } from "./AuthenticationMethodsView.js";
5
+ import { PlusIcon } from "./icons/PlusIcon.js";
5
6
  import React, { useEffect } from "react";
6
7
  import { jsx, jsxs } from "react/jsx-runtime";
7
8
  import "./LinkedDevicesModal.css";
@@ -104,6 +105,14 @@ function methodDescription(method) {
104
105
  case "email_otp": return method.presentation.emailAddress ?? "Email OTP on this device";
105
106
  }
106
107
  }
108
+ function inventoryStatus(state) {
109
+ switch (state.kind) {
110
+ case "idle":
111
+ case "loading": return "Checking methods…";
112
+ case "error": return "Unavailable";
113
+ case "loaded": return state.inventory.kind === "local_selection" ? "Unlock to manage" : "Active";
114
+ }
115
+ }
107
116
  const AuthenticationMethodsModal = ({ walletId, isOpen, onClose, presentation = "modal" }) => {
108
117
  const { seams, loginState, refreshSession } = useSeams();
109
118
  const [loadState, setLoadState] = React.useState({ kind: "idle" });
@@ -271,7 +280,7 @@ const AuthenticationMethodsModal = ({ walletId, isOpen, onClose, presentation =
271
280
  walletAuthMethodId: method.walletAuthMethodId
272
281
  });
273
282
  await refreshSessionRef.current(walletId);
274
- if (presentation === "page") {
283
+ if (presentation !== "modal") {
275
284
  setActionState({ kind: "idle" });
276
285
  await loadInventory();
277
286
  } else onClose();
@@ -295,7 +304,7 @@ const AuthenticationMethodsModal = ({ walletId, isOpen, onClose, presentation =
295
304
  const hasEmailOtp = methods.some((method) => method.kind === "email_otp");
296
305
  const canManageMethods = loadState.kind === "loaded" && loadState.inventory.kind !== "local_selection";
297
306
  const actionInProgress = actionState.kind === "unlocking" || actionState.kind === "adding" || actionState.kind === "revoking";
298
- return /* @__PURE__ */ jsxs(AccountMenuDialogFrame, {
307
+ return /* @__PURE__ */ jsx(AccountMenuDialogFrame, {
299
308
  presentation,
300
309
  onClose,
301
310
  dialogRef,
@@ -303,187 +312,172 @@ const AuthenticationMethodsModal = ({ walletId, isOpen, onClose, presentation =
303
312
  titleId: "seams-auth-methods-modal-title",
304
313
  title: "Authentication methods",
305
314
  closeLabel: "Close authentication methods",
306
- children: [/* @__PURE__ */ jsx("p", {
307
- className: "seams-auth-methods-modal-intro",
308
- children: "Manage how this device unlocks the wallet."
309
- }), /* @__PURE__ */ jsxs("div", {
310
- className: "seams-linked-devices-modal-body",
311
- "aria-busy": loadState.kind === "loading",
312
- children: [
313
- loadState.kind === "idle" ? /* @__PURE__ */ jsx("div", {
314
- className: "seams-linked-devices-modal-placeholder",
315
- role: "status",
316
- children: "Checking authentication methods…"
317
- }) : null,
318
- loadState.kind === "error" ? /* @__PURE__ */ jsxs("div", {
319
- className: "seams-linked-devices-modal-placeholder",
320
- role: "alert",
321
- children: [/* @__PURE__ */ jsxs("span", { children: ["Unable to load authentication methods: ", loadState.message] }), /* @__PURE__ */ jsx("button", {
322
- type: "button",
323
- className: "seams-linked-devices-modal-secondary",
324
- onClick: () => void loadInventory(),
325
- children: "Try again"
326
- })]
327
- }) : null,
328
- inventory ? /* @__PURE__ */ jsx("ul", {
329
- className: "seams-linked-devices-modal-list seams-linked-devices-modal-list--grouped",
330
- children: methods.map((method) => {
331
- const confirming = actionState.kind === "confirming_revoke" && actionState.method.walletAuthMethodId === method.walletAuthMethodId;
332
- const revoking = actionState.kind === "revoking" && actionState.method.walletAuthMethodId === method.walletAuthMethodId;
333
- return /* @__PURE__ */ jsxs("li", {
334
- className: "seams-linked-devices-modal-item seams-linked-devices-modal-item--row",
335
- children: [
336
- /* @__PURE__ */ jsx("span", {
337
- className: "seams-linked-devices-modal-item-icon",
338
- "aria-hidden": "true",
339
- children: method.kind === "passkey" ? /* @__PURE__ */ jsx(KeyIcon, {
340
- size: 20,
341
- strokeWidth: 1.75
342
- }) : /* @__PURE__ */ jsx(MailIcon, {
343
- size: 20,
344
- strokeWidth: 1.75
315
+ children: /* @__PURE__ */ jsx(AuthenticationMethodsView, {
316
+ walletLabel: walletId ?? "Wallet",
317
+ status: inventoryStatus(loadState),
318
+ children: /* @__PURE__ */ jsxs("div", {
319
+ className: "seams-linked-devices-modal-body",
320
+ "aria-busy": loadState.kind === "loading",
321
+ children: [
322
+ loadState.kind === "idle" ? /* @__PURE__ */ jsx("div", {
323
+ className: "seams-linked-devices-modal-placeholder",
324
+ role: "status",
325
+ children: "Checking authentication methods…"
326
+ }) : null,
327
+ loadState.kind === "error" ? /* @__PURE__ */ jsxs("div", {
328
+ className: "seams-linked-devices-modal-placeholder",
329
+ role: "alert",
330
+ children: [/* @__PURE__ */ jsxs("span", { children: ["Unable to load authentication methods: ", loadState.message] }), /* @__PURE__ */ jsx("button", {
331
+ type: "button",
332
+ className: "seams-linked-devices-modal-secondary",
333
+ onClick: () => void loadInventory(),
334
+ children: "Try again"
335
+ })]
336
+ }) : null,
337
+ inventory ? /* @__PURE__ */ jsx("section", {
338
+ className: "seams-account-menu-section",
339
+ "aria-label": "Active authentication methods",
340
+ children: /* @__PURE__ */ jsx("ul", {
341
+ className: "seams-account-method-tiles",
342
+ children: methods.map((method) => {
343
+ const confirming = actionState.kind === "confirming_revoke" && actionState.method.walletAuthMethodId === method.walletAuthMethodId;
344
+ const revoking = actionState.kind === "revoking" && actionState.method.walletAuthMethodId === method.walletAuthMethodId;
345
+ return /* @__PURE__ */ jsx(AuthenticationMethodRow, {
346
+ kind: method.kind,
347
+ title: methodTitle(method),
348
+ description: methodDescription(method),
349
+ action: !confirming && canManageMethods && methods.length > 1 ? /* @__PURE__ */ jsx("button", {
350
+ type: "button",
351
+ className: "seams-linked-devices-modal-secondary seams-linked-devices-modal-remove",
352
+ disabled: actionInProgress,
353
+ "aria-label": `Remove ${methodTitle(method)}`,
354
+ onClick: () => setActionState({
355
+ kind: "confirming_revoke",
356
+ method
357
+ }),
358
+ children: revoking ? "Removing…" : "Remove"
359
+ }) : null,
360
+ children: confirming ? /* @__PURE__ */ jsxs("div", {
361
+ className: "seams-linked-devices-modal-confirm",
362
+ children: [/* @__PURE__ */ jsxs("span", { children: [
363
+ "Remove ",
364
+ methodTitle(method),
365
+ " from this device? You will need the other active method to unlock it."
366
+ ] }), /* @__PURE__ */ jsxs("div", {
367
+ className: "seams-linked-devices-modal-confirm-actions",
368
+ children: [/* @__PURE__ */ jsx("button", {
369
+ type: "button",
370
+ className: "seams-linked-devices-modal-secondary",
371
+ onClick: () => setActionState({ kind: "idle" }),
372
+ children: "Keep it"
373
+ }), /* @__PURE__ */ jsx("button", {
374
+ type: "button",
375
+ className: "seams-linked-devices-modal-danger",
376
+ onClick: () => void revokeMethod(),
377
+ children: "Remove method"
378
+ })]
379
+ })]
380
+ }) : methods.length > 1 ? null : /* @__PURE__ */ jsx("span", {
381
+ className: "seams-linked-devices-modal-item-detail",
382
+ children: "Add another method before removing this one."
345
383
  })
346
- }),
347
- /* @__PURE__ */ jsxs("div", {
348
- className: "seams-linked-devices-modal-item-content",
384
+ }, method.walletAuthMethodId);
385
+ })
386
+ })
387
+ }) : null,
388
+ inventory && (!hasPasskey || !hasEmailOtp) ? /* @__PURE__ */ jsxs("section", {
389
+ className: "seams-account-menu-section",
390
+ "aria-labelledby": "seams-auth-methods-add",
391
+ children: [
392
+ /* @__PURE__ */ jsx("h3", {
393
+ id: "seams-auth-methods-add",
394
+ className: "seams-account-menu-section-label",
395
+ children: "Add a method"
396
+ }),
397
+ !hasPasskey ? /* @__PURE__ */ jsxs("div", {
398
+ className: "seams-linked-devices-modal-add-method",
399
+ children: [/* @__PURE__ */ jsxs("button", {
400
+ type: "button",
401
+ className: "seams-linked-devices-modal-secondary seams-account-menu-wide-button",
402
+ disabled: actionInProgress || !canManageMethods,
403
+ onClick: () => void addMethod("passkey"),
404
+ children: [/* @__PURE__ */ jsx(PlusIcon, {
405
+ size: 18,
406
+ strokeWidth: 1.75
407
+ }), actionState.kind === "adding" && actionState.method === "passkey" ? "Adding…" : "Add passkey"]
408
+ }), /* @__PURE__ */ jsx("p", {
409
+ className: "seams-linked-devices-modal-security-note",
410
+ children: "Use a passkey from this device to unlock the wallet."
411
+ })]
412
+ }) : null,
413
+ !hasEmailOtp ? /* @__PURE__ */ jsx("div", {
414
+ className: "seams-linked-devices-modal-add-method",
415
+ children: /* @__PURE__ */ jsxs("form", {
416
+ className: "seams-linked-devices-modal-otp-form",
417
+ onSubmit: (event) => {
418
+ event.preventDefault();
419
+ addMethod("email_otp");
420
+ },
349
421
  children: [
350
- /* @__PURE__ */ jsxs("div", {
351
- className: "seams-linked-devices-modal-item-main",
352
- children: [/* @__PURE__ */ jsx("span", {
353
- className: "seams-linked-devices-modal-item-name",
354
- children: methodTitle(method)
355
- }), /* @__PURE__ */ jsx("span", {
356
- className: "seams-linked-devices-modal-standing tone-active",
357
- children: "Active"
358
- })]
422
+ /* @__PURE__ */ jsx("label", {
423
+ htmlFor: emailInputId,
424
+ children: "Email address"
359
425
  }),
360
- /* @__PURE__ */ jsx("div", {
361
- className: "seams-linked-devices-modal-item-detail",
362
- children: methodDescription(method)
426
+ /* @__PURE__ */ jsx("input", {
427
+ id: emailInputId,
428
+ className: "seams-linked-devices-modal-otp-input",
429
+ type: "email",
430
+ autoComplete: "email",
431
+ required: true,
432
+ value: emailAddress,
433
+ disabled: actionInProgress || !canManageMethods,
434
+ onChange: (event) => {
435
+ setEmailAddress(event.currentTarget.value);
436
+ if (actionState.kind === "error") setActionState({ kind: "idle" });
437
+ }
363
438
  }),
364
- confirming ? /* @__PURE__ */ jsxs("div", {
365
- className: "seams-linked-devices-modal-confirm",
366
- children: [/* @__PURE__ */ jsxs("span", { children: [
367
- "Remove ",
368
- methodTitle(method),
369
- " from this device? You will need the other active method to unlock it."
370
- ] }), /* @__PURE__ */ jsxs("div", {
371
- className: "seams-linked-devices-modal-confirm-actions",
372
- children: [/* @__PURE__ */ jsx("button", {
373
- type: "button",
374
- className: "seams-linked-devices-modal-secondary",
375
- onClick: () => setActionState({ kind: "idle" }),
376
- children: "Keep it"
377
- }), /* @__PURE__ */ jsx("button", {
378
- type: "button",
379
- className: "seams-linked-devices-modal-danger",
380
- onClick: () => void revokeMethod(),
381
- children: "Remove method"
382
- })]
383
- })]
384
- }) : methods.length > 1 ? null : /* @__PURE__ */ jsx("span", {
385
- className: "seams-linked-devices-modal-item-detail",
386
- children: "Add another method before removing this one."
439
+ /* @__PURE__ */ jsx("button", {
440
+ type: "submit",
441
+ className: "seams-linked-devices-modal-secondary",
442
+ disabled: actionInProgress || !canManageMethods,
443
+ children: actionState.kind === "adding" && actionState.method === "email_otp" ? "Adding…" : "Add Email OTP"
387
444
  })
388
445
  ]
389
- }),
390
- !confirming && canManageMethods && methods.length > 1 ? /* @__PURE__ */ jsx("button", {
391
- type: "button",
392
- className: "seams-linked-devices-modal-secondary seams-linked-devices-modal-remove",
393
- disabled: actionInProgress,
394
- "aria-label": `Remove ${methodTitle(method)}`,
395
- onClick: () => setActionState({
396
- kind: "confirming_revoke",
397
- method
398
- }),
399
- children: revoking ? "Removing…" : "Remove"
400
- }) : null
401
- ]
402
- }, method.walletAuthMethodId);
403
- })
404
- }) : null,
405
- inventory && !hasPasskey ? /* @__PURE__ */ jsxs("section", {
406
- className: "seams-linked-devices-modal-add-method",
407
- children: [
408
- /* @__PURE__ */ jsx("h3", { children: "Add Passkey" }),
409
- /* @__PURE__ */ jsx("p", {
410
- className: "seams-linked-devices-modal-security-note",
411
- children: "Use a passkey from this device to unlock the wallet."
412
- }),
413
- /* @__PURE__ */ jsx("button", {
414
- type: "button",
415
- className: "seams-linked-devices-modal-secondary",
416
- disabled: actionInProgress || !canManageMethods,
417
- onClick: () => void addMethod("passkey"),
418
- children: actionState.kind === "adding" && actionState.method === "passkey" ? "Adding…" : "Add passkey"
419
- })
420
- ]
421
- }) : null,
422
- inventory && !hasEmailOtp ? /* @__PURE__ */ jsxs("section", {
423
- className: "seams-linked-devices-modal-add-method",
424
- children: [/* @__PURE__ */ jsx("h3", { children: "Add Email OTP" }), /* @__PURE__ */ jsxs("form", {
425
- className: "seams-linked-devices-modal-otp-form",
426
- onSubmit: (event) => {
427
- event.preventDefault();
428
- addMethod("email_otp");
429
- },
446
+ })
447
+ }) : null
448
+ ]
449
+ }) : null,
450
+ loadState.kind === "loaded" && inventory?.kind === "local_selection" ? /* @__PURE__ */ jsxs("section", {
451
+ className: "seams-linked-devices-modal-add-method",
430
452
  children: [
431
- /* @__PURE__ */ jsx("label", {
432
- htmlFor: emailInputId,
433
- children: "Email address"
434
- }),
435
- /* @__PURE__ */ jsx("input", {
436
- id: emailInputId,
437
- className: "seams-linked-devices-modal-otp-input",
438
- type: "email",
439
- autoComplete: "email",
440
- required: true,
441
- value: emailAddress,
442
- disabled: actionInProgress || !canManageMethods,
443
- onChange: (event) => {
444
- setEmailAddress(event.currentTarget.value);
445
- if (actionState.kind === "error") setActionState({ kind: "idle" });
446
- }
453
+ /* @__PURE__ */ jsx("h3", { children: "Unlock to manage methods" }),
454
+ /* @__PURE__ */ jsx("p", {
455
+ className: "seams-linked-devices-modal-security-note",
456
+ children: "Confirm your current authentication method to add or remove methods."
447
457
  }),
448
458
  /* @__PURE__ */ jsx("button", {
449
- type: "submit",
450
- className: "seams-linked-devices-modal-secondary",
451
- disabled: actionInProgress || !canManageMethods,
452
- children: actionState.kind === "adding" && actionState.method === "email_otp" ? "Adding…" : "Add Email OTP"
459
+ type: "button",
460
+ className: "seams-linked-devices-modal-secondary seams-account-menu-wide-button",
461
+ disabled: actionInProgress,
462
+ onClick: () => void unlockOwnerSession(),
463
+ children: actionState.kind === "unlocking" ? "Unlocking…" : "Unlock wallet"
453
464
  })
454
465
  ]
455
- })]
456
- }) : null,
457
- loadState.kind === "loaded" && inventory?.kind === "local_selection" ? /* @__PURE__ */ jsxs("section", {
458
- className: "seams-linked-devices-modal-add-method",
459
- children: [
460
- /* @__PURE__ */ jsx("h3", { children: "Unlock to manage methods" }),
461
- /* @__PURE__ */ jsx("p", {
462
- className: "seams-linked-devices-modal-security-note",
463
- children: "Confirm your current authentication method to add or remove methods."
464
- }),
465
- /* @__PURE__ */ jsx("button", {
466
- type: "button",
467
- className: "seams-linked-devices-modal-secondary",
468
- disabled: actionInProgress,
469
- onClick: () => void unlockOwnerSession(),
470
- children: actionState.kind === "unlocking" ? "Unlocking…" : "Unlock wallet"
471
- })
472
- ]
473
- }) : null,
474
- actionState.kind === "error" ? /* @__PURE__ */ jsx("div", {
475
- className: "seams-linked-devices-modal-error",
476
- role: "alert",
477
- children: actionState.message
478
- }) : null,
479
- /* @__PURE__ */ jsx("div", {
480
- className: "seams-linked-devices-modal-live",
481
- role: "status",
482
- "aria-live": "polite",
483
- children: announcement
484
- })
485
- ]
486
- })]
466
+ }) : null,
467
+ actionState.kind === "error" ? /* @__PURE__ */ jsx("div", {
468
+ className: "seams-linked-devices-modal-error",
469
+ role: "alert",
470
+ children: actionState.message
471
+ }) : null,
472
+ /* @__PURE__ */ jsx("div", {
473
+ className: "seams-linked-devices-modal-live",
474
+ role: "status",
475
+ "aria-live": "polite",
476
+ children: announcement
477
+ })
478
+ ]
479
+ })
480
+ })
487
481
  });
488
482
  };
489
483
  //#endregion
@@ -0,0 +1,19 @@
1
+ import { AccountMenuDeviceDetails } from "./AccountMenuDeviceDetails.js";
2
+ import "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/react/components/AccountMenuButton/AuthenticationMethodsView.tsx
5
+ /** Shared presentation; callers own enrollment data and authenticated actions. */
6
+ function AuthenticationMethodsView({ walletLabel, status, children }) {
7
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AccountMenuDeviceDetails, {
8
+ title: walletLabel,
9
+ description: "This wallet",
10
+ details: [{
11
+ label: "Status",
12
+ value: status
13
+ }]
14
+ }), children] });
15
+ }
16
+ //#endregion
17
+ export { AuthenticationMethodsView };
18
+
19
+ //# sourceMappingURL=AuthenticationMethodsView.js.map
@@ -0,0 +1,30 @@
1
+ import { AccountMenuScreen } from "./AccountMenuScreen.js";
2
+ import { ExportKeysSection } from "./ExportKeysSection.js";
3
+ import "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/react/components/AccountMenuButton/ExportKeysScreen.tsx
6
+ /** Shared key selection; the connected caller owns the authenticated export. */
7
+ function ExportKeysScreen({ onBack, ...selection }) {
8
+ return /* @__PURE__ */ jsxs(AccountMenuScreen, {
9
+ title: "Export keys",
10
+ onBack,
11
+ children: [
12
+ /* @__PURE__ */ jsx("p", {
13
+ className: "seams-account-description",
14
+ children: "Choose the signing key to export. Your wallet will ask you to authenticate."
15
+ }),
16
+ /* @__PURE__ */ jsx(ExportKeysSection, {
17
+ ...selection,
18
+ isOpen: true
19
+ }),
20
+ /* @__PURE__ */ jsx("p", {
21
+ className: "seams-account-note",
22
+ children: "Keep exported keys private. Anyone with a signing key can control its accounts."
23
+ })
24
+ ]
25
+ });
26
+ }
27
+ //#endregion
28
+ export { ExportKeysScreen };
29
+
30
+ //# sourceMappingURL=ExportKeysScreen.js.map