hd-wallet-ui 2.0.12 → 2.0.13

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.12",
3
+ "version": "2.0.13",
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.12",
43
+ "hd-wallet-wasm": "^2.0.13",
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
@@ -821,6 +821,14 @@ function updateCustomPathDefault() {
821
821
  input.dataset.autogenerated = 'true';
822
822
  }
823
823
 
824
+ function fitWalletSelectorToSelectedLabel(select) {
825
+ if (!select) return;
826
+ const selected = select.options[select.selectedIndex];
827
+ const label = selected?.textContent || '';
828
+ const width = Math.max(72, Math.min(260, (label.length * 8) + 46));
829
+ select.style.width = `${width}px`;
830
+ }
831
+
824
832
  function renderWalletSelector() {
825
833
  const selects = [$('account-wallet-select'), $('wallet-active-select')].filter(Boolean);
826
834
  if (selects.length === 0) return;
@@ -847,6 +855,7 @@ function renderWalletSelector() {
847
855
  select.appendChild(option);
848
856
  });
849
857
  select.value = String(state.activeWalletId);
858
+ fitWalletSelectorToSelectedLabel(select);
850
859
  });
851
860
  updateCustomPathWalletLabel();
852
861
  updateIdentityWalletKeys();
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><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="ph-portfolio-value" id="wallet-bond-value">$0.00</div><div class="ph-portfolio-label">Bond</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>
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>
@@ -16,12 +16,6 @@ export function getModalHTML() {
16
16
  <div id="wallet-tab-content" class="modal-tab-content">
17
17
  <!-- Main Wallet View -->
18
18
  <div id="wallet-main-view">
19
- <!-- Portfolio Value (Phantom-style hero) -->
20
- <div class="ph-portfolio">
21
- <div class="ph-portfolio-value" id="wallet-bond-value">$0.00</div>
22
- <div class="ph-portfolio-label">Bond</div>
23
- </div>
24
-
25
19
  <!-- Action Buttons Row -->
26
20
  <div class="ph-actions">
27
21
  <button class="ph-action-btn" id="wallet-scan-btn">
@@ -197,7 +191,7 @@ export function getModalHTML() {
197
191
  <video id="vcard-camera-video" autoplay playsinline style="display:none;width:100%;height:100%;object-fit:contain;"></video>
198
192
  <div id="vcard-photo-actions" class="photo-actions">
199
193
  <label class="glass-btn small" for="vcard-photo-input">Upload</label>
200
- <button id="vcard-camera-btn" class="glass-btn small" style="display:none;">Take Photo</button>
194
+ <button id="vcard-camera-btn" class="glass-btn small" style="display:none;">Use Camera</button>
201
195
  <button id="vcard-camera-capture" class="glass-btn small primary" style="display:none;">Capture</button>
202
196
  <button id="vcard-camera-cancel" class="glass-btn small" style="display:none;">Cancel</button>
203
197
  <button id="vcard-photo-remove" class="glass-btn small" style="display:none;">Remove</button>
package/styles/main.css CHANGED
@@ -1188,28 +1188,33 @@ body:has(.modal.active) .nav-bar {
1188
1188
  .account-header-info {
1189
1189
  display: flex;
1190
1190
  flex-direction: column;
1191
- gap: 2px;
1191
+ align-items: center;
1192
+ gap: 8px;
1192
1193
  flex: 1 1 auto;
1193
1194
  min-width: 0;
1194
1195
  }
1195
1196
 
1196
1197
  .account-modal-header {
1197
1198
  position: relative;
1199
+ justify-content: center;
1200
+ min-height: 118px;
1198
1201
  padding-right: 56px;
1199
1202
  }
1200
1203
 
1201
1204
  .account-wallet-row {
1202
1205
  display: flex;
1203
1206
  align-items: center;
1204
- gap: 10px;
1205
- width: 100%;
1207
+ justify-content: center;
1208
+ gap: 8px;
1209
+ width: auto;
1206
1210
  min-width: 0;
1207
1211
  }
1208
1212
 
1209
1213
  .account-wallet-select.glass-input.compact {
1210
- flex: 1 1 auto;
1211
- min-width: 180px;
1212
- width: 100%;
1214
+ flex: 0 0 auto;
1215
+ min-width: 0;
1216
+ width: auto;
1217
+ max-width: min(260px, calc(100vw - 112px));
1213
1218
  height: 32px;
1214
1219
  font-size: 13px;
1215
1220
  padding: 4px 34px 4px 10px;
@@ -1222,6 +1227,10 @@ body:has(.modal.active) .nav-bar {
1222
1227
  background-position: right 11px center;
1223
1228
  }
1224
1229
 
1230
+ .account-wallet-summary {
1231
+ text-align: center;
1232
+ }
1233
+
1225
1234
  @media (max-width: 600px) {
1226
1235
  .account-wallet-row {
1227
1236
  gap: 8px;
@@ -1229,6 +1238,7 @@ body:has(.modal.active) .nav-bar {
1229
1238
 
1230
1239
  .account-wallet-select.glass-input.compact {
1231
1240
  min-width: 0;
1241
+ max-width: calc(100vw - 96px);
1232
1242
  }
1233
1243
  }
1234
1244
 
package/styles/widget.css CHANGED
@@ -1190,28 +1190,33 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
1190
1190
  #hd-wallet-ui-container .account-header-info {
1191
1191
  display: flex;
1192
1192
  flex-direction: column;
1193
- gap: 2px;
1193
+ align-items: center;
1194
+ gap: 8px;
1194
1195
  flex: 1 1 auto;
1195
1196
  min-width: 0;
1196
1197
  }
1197
1198
 
1198
1199
  #hd-wallet-ui-container .account-modal-header {
1199
1200
  position: relative;
1201
+ justify-content: center;
1202
+ min-height: 118px;
1200
1203
  padding-right: 56px;
1201
1204
  }
1202
1205
 
1203
1206
  #hd-wallet-ui-container .account-wallet-row {
1204
1207
  display: flex;
1205
1208
  align-items: center;
1206
- gap: 10px;
1207
- width: 100%;
1209
+ justify-content: center;
1210
+ gap: 8px;
1211
+ width: auto;
1208
1212
  min-width: 0;
1209
1213
  }
1210
1214
 
1211
1215
  #hd-wallet-ui-container .account-wallet-select.glass-input.compact {
1212
- flex: 1 1 auto;
1213
- min-width: 180px;
1214
- width: 100%;
1216
+ flex: 0 0 auto;
1217
+ min-width: 0;
1218
+ width: auto;
1219
+ max-width: min(260px, calc(100vw - 112px));
1215
1220
  height: 32px;
1216
1221
  font-size: 13px;
1217
1222
  padding: 4px 34px 4px 10px;
@@ -1224,6 +1229,10 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
1224
1229
  background-position: right 11px center;
1225
1230
  }
1226
1231
 
1232
+ #hd-wallet-ui-container .account-wallet-summary {
1233
+ text-align: center;
1234
+ }
1235
+
1227
1236
  @media (max-width: 600px) {
1228
1237
  #hd-wallet-ui-container .account-wallet-row {
1229
1238
  gap: 8px;
@@ -1231,6 +1240,7 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
1231
1240
 
1232
1241
  #hd-wallet-ui-container .account-wallet-select.glass-input.compact {
1233
1242
  min-width: 0;
1243
+ max-width: calc(100vw - 96px);
1234
1244
  }
1235
1245
  }
1236
1246