hd-wallet-ui 2.0.15 → 2.0.16

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": "hd-wallet-ui",
3
- "version": "2.0.15",
3
+ "version": "2.0.16",
4
4
  "description": "HD Wallet modal UI — login, keys, identity, trust map, and security bond. Attach to any button in your app.",
5
5
  "type": "module",
6
6
  "main": "src/app.js",
@@ -40,7 +40,7 @@
40
40
  "buffer": "^6.0.3",
41
41
  "flatbuffers": "^25.9.23",
42
42
  "flatc-wasm": "^26.1.32",
43
- "hd-wallet-wasm": "^2.0.15",
43
+ "hd-wallet-wasm": "^2.0.16",
44
44
  "qrcode": "^1.5.3",
45
45
  "spacedatastandards.org": "^1.93.3",
46
46
  "vcard-cryptoperson": "^1.1.11"
package/src/app.js CHANGED
@@ -4272,6 +4272,7 @@ function setupMainAppHandlers() {
4272
4272
  $('login-modal')?.classList.add('active');
4273
4273
  });
4274
4274
  $('nav-logout')?.addEventListener('click', logout);
4275
+ $('account-logout')?.addEventListener('click', logout);
4275
4276
  $('nav-keys')?.addEventListener('click', async () => {
4276
4277
  $('keys-modal')?.classList.add('active');
4277
4278
  if (state.loggedIn) {
@@ -6024,8 +6025,17 @@ export async function createWalletUI(rootElement, options = {}) {
6024
6025
  return {
6025
6026
  /** Open the login modal */
6026
6027
  openLogin() {
6027
- const modal = document.getElementById('login-modal');
6028
- if (modal) modal.classList.add('active');
6028
+ if (state.loggedIn) {
6029
+ const accountModal = document.getElementById('keys-modal');
6030
+ if (accountModal) accountModal.classList.add('active');
6031
+ return;
6032
+ }
6033
+ const loginModal = document.getElementById('login-modal');
6034
+ if (loginModal) {
6035
+ loginModal.classList.add('active');
6036
+ const storedTab = loginModal.querySelector('[data-method="stored"]');
6037
+ if (storedTab && storedTab.style.display !== 'none') storedTab.click();
6038
+ }
6029
6039
  },
6030
6040
  /** Open the account / keys modal (requires login first) */
6031
6041
  openAccount() {
package/src/template.js CHANGED
@@ -3,7 +3,7 @@ export function getModalHTML() {
3
3
  <!-- Keys Modal -->
4
4
  <div id="keys-modal" class="modal">
5
5
  <div class="modal-glass modal-wide">
6
- <div class="modal-header account-modal-header"><div class="account-header-info"><div class="account-wallet-row"><select id="account-wallet-select" class="glass-input compact account-wallet-select" aria-label="Select wallet"></select></div><div class="account-wallet-summary"><div class="account-wallet-balance-line"><div class="ph-portfolio-value" id="wallet-bond-value">$0.00</div><div class="ph-portfolio-label">Bond</div></div></div></div><button class="modal-close account-modal-close" type="button" aria-label="Close"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>
6
+ <div class="modal-header account-modal-header"><div class="account-header-info"><div class="account-wallet-row"><select id="account-wallet-select" class="glass-input compact account-wallet-select" aria-label="Select wallet"></select></div><div class="account-wallet-summary"><div class="account-wallet-balance-line"><div class="ph-portfolio-value" id="wallet-bond-value">$0.00</div><div class="ph-portfolio-label">Bond</div></div></div></div><div class="account-header-actions"><button id="account-logout" class="account-logout-btn" type="button" aria-label="Logout" title="Logout"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg></button><button class="modal-close account-modal-close" type="button" aria-label="Close"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div></div>
7
7
  <div class="modal-tabs">
8
8
  <button class="modal-tab active" data-modal-tab="vcard-tab-content">Identity</button>
9
9
  <button class="modal-tab" data-modal-tab="trust-tab-content">Trust Map</button>
package/styles/main.css CHANGED
@@ -977,9 +977,10 @@ body:has(.modal.active) .nav-bar {
977
977
 
978
978
  .wallet-info-expanded {
979
979
  display: flex;
980
- align-items: flex-start;
980
+ align-items: center;
981
981
  gap: 8px;
982
- padding: 12px 24px;
982
+ min-height: 30px;
983
+ padding: 6px 24px;
983
984
  background: rgba(59, 130, 246, 0.1);
984
985
  font-size: 13px;
985
986
  line-height: 1.5;
@@ -995,12 +996,17 @@ body:has(.modal.active) .nav-bar {
995
996
  }
996
997
 
997
998
  .wallet-info-close {
999
+ display: inline-flex;
1000
+ align-items: center;
1001
+ justify-content: center;
998
1002
  background: none;
999
1003
  border: none;
1000
1004
  color: rgba(255, 255, 255, 0.5);
1001
1005
  font-size: 18px;
1002
1006
  cursor: pointer;
1003
- padding: 0 2px;
1007
+ padding: 0;
1008
+ width: 22px;
1009
+ height: 22px;
1004
1010
  line-height: 1;
1005
1011
  flex-shrink: 0;
1006
1012
  }
@@ -1199,7 +1205,35 @@ body:has(.modal.active) .nav-bar {
1199
1205
  position: relative;
1200
1206
  align-items: center;
1201
1207
  min-height: 118px;
1202
- padding-right: 56px;
1208
+ padding-right: 92px;
1209
+ }
1210
+
1211
+ .account-header-actions {
1212
+ position: absolute;
1213
+ top: 12px;
1214
+ right: 14px;
1215
+ display: flex;
1216
+ align-items: center;
1217
+ gap: 4px;
1218
+ }
1219
+
1220
+ .account-logout-btn {
1221
+ width: 32px;
1222
+ height: 32px;
1223
+ display: inline-flex;
1224
+ align-items: center;
1225
+ justify-content: center;
1226
+ background: transparent;
1227
+ border: none;
1228
+ color: var(--white);
1229
+ cursor: pointer;
1230
+ padding: 0;
1231
+ transition: color 0.2s, opacity 0.2s;
1232
+ }
1233
+
1234
+ .account-logout-btn:hover {
1235
+ color: var(--white-80);
1236
+ opacity: 0.9;
1203
1237
  }
1204
1238
 
1205
1239
  .account-wallet-row {
@@ -1286,9 +1320,7 @@ body:has(.modal.active) .nav-bar {
1286
1320
  }
1287
1321
 
1288
1322
  .account-modal-close {
1289
- position: absolute;
1290
- top: 12px;
1291
- right: 14px;
1323
+ position: static;
1292
1324
  }
1293
1325
 
1294
1326
  .modal-body {
package/styles/widget.css CHANGED
@@ -979,9 +979,10 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
979
979
 
980
980
  #hd-wallet-ui-container .wallet-info-expanded {
981
981
  display: flex;
982
- align-items: flex-start;
982
+ align-items: center;
983
983
  gap: 8px;
984
- padding: 12px 24px;
984
+ min-height: 30px;
985
+ padding: 6px 24px;
985
986
  background: rgba(59, 130, 246, 0.1);
986
987
  font-size: 13px;
987
988
  line-height: 1.5;
@@ -997,12 +998,17 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
997
998
  }
998
999
 
999
1000
  #hd-wallet-ui-container .wallet-info-close {
1001
+ display: inline-flex;
1002
+ align-items: center;
1003
+ justify-content: center;
1000
1004
  background: none;
1001
1005
  border: none;
1002
1006
  color: rgba(255, 255, 255, 0.5);
1003
1007
  font-size: 18px;
1004
1008
  cursor: pointer;
1005
- padding: 0 2px;
1009
+ padding: 0;
1010
+ width: 22px;
1011
+ height: 22px;
1006
1012
  line-height: 1;
1007
1013
  flex-shrink: 0;
1008
1014
  }
@@ -1201,7 +1207,35 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
1201
1207
  position: relative;
1202
1208
  align-items: center;
1203
1209
  min-height: 118px;
1204
- padding-right: 56px;
1210
+ padding-right: 92px;
1211
+ }
1212
+
1213
+ #hd-wallet-ui-container .account-header-actions {
1214
+ position: absolute;
1215
+ top: 12px;
1216
+ right: 14px;
1217
+ display: flex;
1218
+ align-items: center;
1219
+ gap: 4px;
1220
+ }
1221
+
1222
+ #hd-wallet-ui-container .account-logout-btn {
1223
+ width: 32px;
1224
+ height: 32px;
1225
+ display: inline-flex;
1226
+ align-items: center;
1227
+ justify-content: center;
1228
+ background: transparent;
1229
+ border: none;
1230
+ color: var(--white);
1231
+ cursor: pointer;
1232
+ padding: 0;
1233
+ transition: color 0.2s, opacity 0.2s;
1234
+ }
1235
+
1236
+ #hd-wallet-ui-container .account-logout-btn:hover {
1237
+ color: var(--white-80);
1238
+ opacity: 0.9;
1205
1239
  }
1206
1240
 
1207
1241
  #hd-wallet-ui-container .account-wallet-row {
@@ -1288,9 +1322,7 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
1288
1322
  }
1289
1323
 
1290
1324
  #hd-wallet-ui-container .account-modal-close {
1291
- position: absolute;
1292
- top: 12px;
1293
- right: 14px;
1325
+ position: static;
1294
1326
  }
1295
1327
 
1296
1328
  #hd-wallet-ui-container .modal-body {