hd-wallet-ui 2.0.12 → 2.0.14

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.14",
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.14",
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="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>
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,32 @@ 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: flex-start;
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
+ min-height: 118px;
1198
1200
  padding-right: 56px;
1199
1201
  }
1200
1202
 
1201
1203
  .account-wallet-row {
1202
1204
  display: flex;
1203
1205
  align-items: center;
1204
- gap: 10px;
1205
- width: 100%;
1206
+ justify-content: flex-start;
1207
+ gap: 8px;
1208
+ width: auto;
1206
1209
  min-width: 0;
1207
1210
  }
1208
1211
 
1209
1212
  .account-wallet-select.glass-input.compact {
1210
- flex: 1 1 auto;
1211
- min-width: 180px;
1212
- width: 100%;
1213
+ flex: 0 0 auto;
1214
+ min-width: 0;
1215
+ width: auto;
1216
+ max-width: min(260px, calc(100vw - 112px));
1213
1217
  height: 32px;
1214
1218
  font-size: 13px;
1215
1219
  padding: 4px 34px 4px 10px;
@@ -1222,6 +1226,26 @@ body:has(.modal.active) .nav-bar {
1222
1226
  background-position: right 11px center;
1223
1227
  }
1224
1228
 
1229
+ .account-wallet-summary {
1230
+ text-align: left;
1231
+ }
1232
+
1233
+ .account-wallet-balance-line {
1234
+ display: flex;
1235
+ align-items: baseline;
1236
+ gap: 10px;
1237
+ }
1238
+
1239
+ .account-wallet-summary .ph-portfolio-value {
1240
+ color: #4ade80;
1241
+ }
1242
+
1243
+ .account-wallet-summary .ph-portfolio-label {
1244
+ font-size: 26px;
1245
+ color: var(--white-80);
1246
+ margin-top: 0;
1247
+ }
1248
+
1225
1249
  @media (max-width: 600px) {
1226
1250
  .account-wallet-row {
1227
1251
  gap: 8px;
@@ -1229,6 +1253,7 @@ body:has(.modal.active) .nav-bar {
1229
1253
 
1230
1254
  .account-wallet-select.glass-input.compact {
1231
1255
  min-width: 0;
1256
+ max-width: calc(100vw - 96px);
1232
1257
  }
1233
1258
  }
1234
1259
 
package/styles/widget.css CHANGED
@@ -1190,28 +1190,32 @@ 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: flex-start;
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
+ min-height: 118px;
1200
1202
  padding-right: 56px;
1201
1203
  }
1202
1204
 
1203
1205
  #hd-wallet-ui-container .account-wallet-row {
1204
1206
  display: flex;
1205
1207
  align-items: center;
1206
- gap: 10px;
1207
- width: 100%;
1208
+ justify-content: flex-start;
1209
+ gap: 8px;
1210
+ width: auto;
1208
1211
  min-width: 0;
1209
1212
  }
1210
1213
 
1211
1214
  #hd-wallet-ui-container .account-wallet-select.glass-input.compact {
1212
- flex: 1 1 auto;
1213
- min-width: 180px;
1214
- width: 100%;
1215
+ flex: 0 0 auto;
1216
+ min-width: 0;
1217
+ width: auto;
1218
+ max-width: min(260px, calc(100vw - 112px));
1215
1219
  height: 32px;
1216
1220
  font-size: 13px;
1217
1221
  padding: 4px 34px 4px 10px;
@@ -1224,6 +1228,26 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
1224
1228
  background-position: right 11px center;
1225
1229
  }
1226
1230
 
1231
+ #hd-wallet-ui-container .account-wallet-summary {
1232
+ text-align: left;
1233
+ }
1234
+
1235
+ #hd-wallet-ui-container .account-wallet-balance-line {
1236
+ display: flex;
1237
+ align-items: baseline;
1238
+ gap: 10px;
1239
+ }
1240
+
1241
+ #hd-wallet-ui-container .account-wallet-summary .ph-portfolio-value {
1242
+ color: #4ade80;
1243
+ }
1244
+
1245
+ #hd-wallet-ui-container .account-wallet-summary .ph-portfolio-label {
1246
+ font-size: 26px;
1247
+ color: var(--white-80);
1248
+ margin-top: 0;
1249
+ }
1250
+
1227
1251
  @media (max-width: 600px) {
1228
1252
  #hd-wallet-ui-container .account-wallet-row {
1229
1253
  gap: 8px;
@@ -1231,6 +1255,7 @@ body:has(#hd-wallet-ui-container .modal.active) #hd-wallet-ui-container .nav-bar
1231
1255
 
1232
1256
  #hd-wallet-ui-container .account-wallet-select.glass-input.compact {
1233
1257
  min-width: 0;
1258
+ max-width: calc(100vw - 96px);
1234
1259
  }
1235
1260
  }
1236
1261