@provablehq/aleo-wallet-adaptor-react-ui 0.3.0-alpha.2 → 0.3.0-alpha.4

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/dist/index.js CHANGED
@@ -87,7 +87,7 @@ var WalletIcon = ({ wallet, ...props }) => {
87
87
  return wallet && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
88
88
  "img",
89
89
  {
90
- style: { borderRadius: "50%" },
90
+ style: { borderRadius: "22%" },
91
91
  src: wallet.adapter.icon,
92
92
  alt: `${wallet.adapter.name} icon`,
93
93
  ...props
@@ -216,62 +216,15 @@ var WalletListItem = ({ handleClick, tabIndex, wallet }) => {
216
216
  ] }) });
217
217
  };
218
218
 
219
- // src/AleoIcon.tsx
220
- var import_jsx_runtime6 = require("react/jsx-runtime");
221
- var AleoIcon = () => {
222
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
223
- "svg",
224
- {
225
- xmlns: "http://www.w3.org/2000/svg",
226
- width: "216",
227
- height: "80",
228
- viewBox: "0 0 216 80",
229
- fill: "none",
230
- children: [
231
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M73.426 0V8.93824H81.6842V78.8961H90.6045V0H73.426Z", fill: "#F5F5F5" }),
232
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
233
- "path",
234
- {
235
- d: "M154.145 51.4216C154.145 32.5518 143.683 21.297 127.604 21.297C111.526 21.297 100.954 32.0007 100.954 50.8687C100.954 69.7367 111.415 80 127.604 80C140.378 80 149.96 72.6061 152.603 62.3447H142.692C140.488 67.0902 135.975 71.2829 127.604 71.2829C116.812 71.2829 111.307 64.4419 110.205 54.6209H154.145V51.4216ZM110.316 46.125C111.636 36.6357 117.364 29.9035 127.604 29.9035C137.845 29.9035 143.242 36.5251 144.564 46.125H110.316Z",
236
- fill: "#F5F5F5"
237
- }
238
- ),
239
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
240
- "path",
241
- {
242
- d: "M189.272 21.297C173.083 21.297 162.622 32.0007 162.622 50.8687C162.622 69.7367 173.083 80 189.272 80C205.461 80 215.812 70.0684 215.812 50.8687C215.812 31.669 205.351 21.297 189.272 21.297ZM189.272 71.5041C177.709 71.5041 171.432 62.4553 171.432 50.76C171.432 39.0647 177.709 29.6842 189.272 29.6842C200.836 29.6842 207.003 38.8436 207.003 50.76C207.003 62.6764 200.946 71.5041 189.272 71.5041Z",
243
- fill: "#F5F5F5"
244
- }
245
- ),
246
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
247
- "path",
248
- {
249
- d: "M46.5565 0H28.3849L12.6134 46.125H22.2179L34.9933 8.49593H39.6189L52.3925 46.125H22.2179L19.2457 54.6209H55.2561L63.5143 78.8961H73.426L46.5565 0Z",
250
- fill: "#F5F5F5"
251
- }
252
- ),
253
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
254
- "path",
255
- {
256
- d: "M1.40508 78.8961H10.9857L19.2457 54.6209L9.7074 54.6209L1.40508 78.8961Z",
257
- fill: "#F5F5F5"
258
- }
259
- ),
260
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M3.0935 46.125L0.1875 54.6209H9.7074L12.6134 46.125H3.0935Z", fill: "#F5F5F5" })
261
- ]
262
- }
263
- );
264
- };
265
-
266
219
  // src/WalletModal.tsx
267
220
  var import_aleo_wallet_adaptor_react2 = require("@provablehq/aleo-wallet-adaptor-react");
268
221
  var import_aleo_wallet_standard2 = require("@provablehq/aleo-wallet-standard");
269
222
  var import_aleo_types2 = require("@provablehq/aleo-types");
270
223
 
271
224
  // src/ProvableLogo.tsx
272
- var import_jsx_runtime7 = require("react/jsx-runtime");
225
+ var import_jsx_runtime6 = require("react/jsx-runtime");
273
226
  var ProvableLogo = () => {
274
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
227
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
275
228
  "svg",
276
229
  {
277
230
  width: "115",
@@ -279,69 +232,69 @@ var ProvableLogo = () => {
279
232
  viewBox: "0 0 115 18",
280
233
  fill: "none",
281
234
  xmlns: "http://www.w3.org/2000/svg",
282
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("g", { opacity: "0.88", children: [
283
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
235
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("g", { opacity: "0.88", children: [
236
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
284
237
  "path",
285
238
  {
286
239
  d: "M0 3.89265C0 2.29508 1.29508 1 2.89265 1H13.1073C14.7048 1 15.9999 2.29508 15.9999 3.89265V14.1074C15.9999 15.7049 14.7049 17 13.1073 17H10.4926C10.0937 17 9.7702 16.6766 9.7702 16.2776V8.67463C9.7702 7.87665 9.12331 7.22976 8.32533 7.22976H0.722439C0.323447 7.22976 0 6.90631 0 6.50732L0 3.89265Z",
287
- fill: "#0B0605"
240
+ fill: "currentColor"
288
241
  }
289
242
  ),
290
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
243
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
291
244
  "path",
292
245
  {
293
246
  d: "M6.22973 12.2151C6.22973 11.4171 5.58284 10.7702 4.78485 10.7702H0.722439C0.323447 10.7702 0 11.0937 0 11.4927L0 14.1074C0 15.7049 1.29508 17 2.89265 17H5.50729C5.90628 17 6.22973 16.6766 6.22973 16.2776V12.2151Z",
294
- fill: "#0B0605"
247
+ fill: "currentColor"
295
248
  }
296
249
  ),
297
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
250
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
298
251
  "path",
299
252
  {
300
253
  d: "M108.725 17.272C105.098 17.272 102.695 14.7107 102.695 10.88C102.695 7.04935 105.098 4.48802 108.725 4.48802C112.85 4.48802 115.275 7.52535 114.686 11.968H106.118C106.39 13.6453 107.319 14.5973 108.793 14.5973C110.039 14.5973 110.901 14.0533 111.263 13.056H114.663C114.006 15.7533 111.898 17.272 108.725 17.272ZM106.118 9.70135H111.467C111.195 8.04668 110.266 7.16268 108.793 7.16268C107.342 7.16268 106.413 8.06935 106.118 9.70135Z",
301
- fill: "#0B0605"
254
+ fill: "currentColor"
302
255
  }
303
256
  ),
304
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M98.3672 17V0.317363L101.699 0.0453644V17H98.3672Z", fill: "#0B0605" }),
305
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
257
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M98.3672 17V0.317363L101.699 0.0453644V17H98.3672Z", fill: "currentColor" }),
258
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
306
259
  "path",
307
260
  {
308
261
  d: "M84.9072 17V0.317363L88.2392 0.0453644V6.50535H88.3752C89.1232 5.21336 90.3246 4.55602 92.0245 4.55602C95.2432 4.55602 97.3512 7.07202 97.3512 10.88C97.3512 14.688 95.2432 17.2267 92.0245 17.2267C90.3246 17.2267 89.1232 16.5693 88.3752 15.2547H88.2392V17H84.9072ZM91.0952 7.32135C89.3726 7.32135 88.2392 8.72668 88.2392 10.88C88.2392 13.056 89.3726 14.4613 91.0952 14.4613C92.8405 14.4613 93.9512 13.056 93.9512 10.88C93.9512 8.72668 92.8405 7.32135 91.0952 7.32135Z",
309
- fill: "#0B0605"
262
+ fill: "currentColor"
310
263
  }
311
264
  ),
312
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
265
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
313
266
  "path",
314
267
  {
315
268
  d: "M76.3143 17.1813C73.9117 17.1813 72.3477 15.6853 72.3477 13.3733C72.3477 11.4013 73.685 10.1093 76.0423 9.83735L79.2836 9.47468C79.8956 9.38401 80.1903 9.11201 80.1903 8.61335C80.1903 7.68402 79.4876 7.11735 78.3543 7.11735C77.221 7.11735 76.4503 7.68402 76.3143 8.61335H72.8917C73.141 6.05202 75.249 4.48802 78.3996 4.48802C81.641 4.48802 83.5223 6.09735 83.5223 8.88535V17H80.1903V15.4133H80.0543C79.4423 16.456 77.9236 17.1813 76.3143 17.1813ZM77.4023 14.5973C78.8303 14.5973 80.1903 13.3507 80.1903 11.9V11.4693C80.0316 11.5827 79.8503 11.628 79.6236 11.6507L77.1983 11.9227C76.3143 12.0133 75.8157 12.4893 75.8157 13.2373C75.8157 14.076 76.4276 14.5973 77.4023 14.5973Z",
316
- fill: "#0B0605"
269
+ fill: "currentColor"
317
270
  }
318
271
  ),
319
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
272
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
320
273
  "path",
321
274
  {
322
275
  d: "M64.509 17L60.1797 4.76003H63.5117L66.549 13.94H66.685L69.6997 4.76003H72.873L68.5437 17H64.509Z",
323
- fill: "#0B0605"
276
+ fill: "currentColor"
324
277
  }
325
278
  ),
326
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
279
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
327
280
  "path",
328
281
  {
329
282
  d: "M54.3613 17.272C50.6666 17.272 48.1279 14.6653 48.1279 10.88C48.1279 7.09468 50.6666 4.48802 54.3613 4.48802C58.0559 4.48802 60.5946 7.09468 60.5946 10.88C60.5946 14.6653 58.0559 17.272 54.3613 17.272ZM54.3613 14.5067C56.1519 14.5067 57.2399 13.1467 57.2399 10.88C57.2399 8.61335 56.1519 7.25335 54.3613 7.25335C52.5706 7.25335 51.4826 8.61335 51.4826 10.88C51.4826 13.1467 52.5706 14.5067 54.3613 14.5067Z",
330
- fill: "#0B0605"
283
+ fill: "currentColor"
331
284
  }
332
285
  ),
333
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
286
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
334
287
  "path",
335
288
  {
336
289
  d: "M40.0801 17V4.76002H43.4121V6.23335H43.5481C43.9561 5.10002 44.8401 4.48802 46.1094 4.48802H47.8094L48.0814 7.93335H45.6561C44.2054 7.93335 43.4121 8.56802 43.4121 9.74668V17H40.0801Z",
337
- fill: "#0B0605"
290
+ fill: "currentColor"
338
291
  }
339
292
  ),
340
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
293
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
341
294
  "path",
342
295
  {
343
296
  d: "M26.3848 17V0.99736H33.0261C36.6981 0.99736 39.0554 3.08269 39.0554 6.34668C39.0554 9.63334 36.6981 11.764 33.0261 11.764H29.8754V17H26.3848ZM33.0261 8.72668C34.5674 8.72668 35.5647 7.82002 35.5647 6.41468C35.5647 5.00935 34.5674 4.10269 33.0261 4.10269H29.8754V8.72668H33.0261Z",
344
- fill: "#0B0605"
297
+ fill: "currentColor"
345
298
  }
346
299
  )
347
300
  ] })
@@ -350,7 +303,9 @@ var ProvableLogo = () => {
350
303
  };
351
304
 
352
305
  // src/WalletModal.tsx
353
- var import_jsx_runtime8 = require("react/jsx-runtime");
306
+ var import_jsx_runtime7 = require("react/jsx-runtime");
307
+ var INSTALL_REDIRECT_MAX_AGE_MS = 10 * 60 * 1e3;
308
+ var WALLET_INSTALL_REDIRECT_KEY = "aleo-wallet-adaptor-install-redirect-timestamp";
354
309
  var WalletModal = ({
355
310
  className = "",
356
311
  container = "body",
@@ -382,13 +337,28 @@ var WalletModal = ({
382
337
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
383
338
  installedWallets[0]
384
339
  ) : wallets.find(
385
- (wallet2) => wallet2.adapter.name === "Puzzle Wallet"
386
- // TODO: Add Provable Wallet
340
+ (wallet2) => wallet2.adapter.name.toLowerCase().includes("shield")
387
341
  ) || wallets.find(
388
342
  (wallet2) => wallet2.readyState === import_aleo_wallet_standard2.WalletReadyState.LOADABLE
389
343
  ) || // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
390
344
  otherWallets[0];
391
345
  }, [installedWallets, wallets, otherWallets]);
346
+ (0, import_react4.useEffect)(() => {
347
+ function handleVisibilityChange() {
348
+ if (document.visibilityState !== "visible") return;
349
+ try {
350
+ const raw = sessionStorage.getItem(WALLET_INSTALL_REDIRECT_KEY);
351
+ if (!raw) return;
352
+ const timestamp = Number(raw);
353
+ if (Number.isNaN(timestamp) || Date.now() - timestamp > INSTALL_REDIRECT_MAX_AGE_MS) return;
354
+ sessionStorage.removeItem(WALLET_INSTALL_REDIRECT_KEY);
355
+ window.location.reload();
356
+ } catch {
357
+ }
358
+ }
359
+ document.addEventListener("visibilitychange", handleVisibilityChange);
360
+ return () => document.removeEventListener("visibilitychange", handleVisibilityChange);
361
+ }, []);
392
362
  const hideModal = (0, import_react4.useCallback)(() => {
393
363
  setFadeIn(false);
394
364
  setTimeout(() => setVisible(false), 150);
@@ -407,6 +377,22 @@ var WalletModal = ({
407
377
  },
408
378
  [selectWallet, handleClose]
409
379
  );
380
+ const handleNotInstalledWalletClick = (0, import_react4.useCallback)(
381
+ (event, walletName) => {
382
+ event.preventDefault();
383
+ const wallet2 = wallets.find(
384
+ (wallet3) => wallet3.adapter.name === walletName
385
+ );
386
+ if (wallet2) {
387
+ try {
388
+ sessionStorage.setItem(WALLET_INSTALL_REDIRECT_KEY, String(Date.now()));
389
+ } catch {
390
+ }
391
+ window.open(wallet2.adapter.url, "_blank");
392
+ }
393
+ },
394
+ [wallets]
395
+ );
410
396
  const handleCollapseClick = (0, import_react4.useCallback)(() => setExpanded(!expanded), [expanded]);
411
397
  const handleTabKey = (0, import_react4.useCallback)(
412
398
  (event) => {
@@ -455,7 +441,7 @@ var WalletModal = ({
455
441
  }
456
442
  }, [wallet]);
457
443
  return portal && (0, import_react_dom.createPortal)(
458
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
444
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
459
445
  "div",
460
446
  {
461
447
  "aria-labelledby": "wallet-adapter-modal-title",
@@ -464,12 +450,12 @@ var WalletModal = ({
464
450
  ref,
465
451
  role: "dialog",
466
452
  children: [
467
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "wallet-adapter-modal-container", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "wallet-adapter-modal-wrapper", children: [
468
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { onClick: handleClose, className: "wallet-adapter-modal-button-close", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { width: "14", height: "14", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M14 12.461 8.3 6.772l5.234-5.233L12.006 0 6.772 5.234 1.54 0 0 1.539l5.234 5.233L0 12.006l1.539 1.528L6.772 8.3l5.69 5.7L14 12.461z" }) }) }),
469
- installedWallets.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
470
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h1", { className: "wallet-adapter-modal-title", children: "Connect an Aleo wallet" }),
471
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("ul", { className: "wallet-adapter-modal-list", children: [
472
- installedWallets.map((wallet2) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
453
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "wallet-adapter-modal-container", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "wallet-adapter-modal-wrapper", children: [
454
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { onClick: handleClose, className: "wallet-adapter-modal-button-close", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { width: "14", height: "14", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M14 12.461 8.3 6.772l5.234-5.233L12.006 0 6.772 5.234 1.54 0 0 1.539l5.234 5.233L0 12.006l1.539 1.528L6.772 8.3l5.69 5.7L14 12.461z" }) }) }),
455
+ installedWallets.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
456
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { className: "wallet-adapter-modal-title", children: "Connect an Aleo wallet" }),
457
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("ul", { className: "wallet-adapter-modal-list", children: [
458
+ installedWallets.map((wallet2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
473
459
  WalletListItem,
474
460
  {
475
461
  handleClick: (event) => handleWalletClick(event, wallet2.adapter.name),
@@ -477,7 +463,7 @@ var WalletModal = ({
477
463
  },
478
464
  wallet2.adapter.name
479
465
  )),
480
- otherWallets.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Collapse, { expanded, id: "wallet-adapter-modal-collapse", children: otherWallets.map((wallet2) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
466
+ otherWallets.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Collapse, { expanded, id: "wallet-adapter-modal-collapse", children: otherWallets.map((wallet2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
481
467
  WalletListItem,
482
468
  {
483
469
  handleClick: (event) => handleWalletClick(event, wallet2.adapter.name),
@@ -487,18 +473,18 @@ var WalletModal = ({
487
473
  wallet2.adapter.name
488
474
  )) }) : null
489
475
  ] }),
490
- otherWallets.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
476
+ otherWallets.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
491
477
  "button",
492
478
  {
493
479
  className: "wallet-adapter-modal-list-more",
494
480
  onClick: handleCollapseClick,
495
481
  tabIndex: 0,
496
482
  children: [
497
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { children: [
483
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
498
484
  expanded ? "Less " : "More ",
499
485
  "options"
500
486
  ] }),
501
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
487
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
502
488
  "svg",
503
489
  {
504
490
  width: "13",
@@ -506,39 +492,36 @@ var WalletModal = ({
506
492
  viewBox: "0 0 13 7",
507
493
  xmlns: "http://www.w3.org/2000/svg",
508
494
  className: `${expanded ? "wallet-adapter-modal-list-more-icon-rotate" : ""}`,
509
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M0.71418 1.626L5.83323 6.26188C5.91574 6.33657 6.0181 6.39652 6.13327 6.43762C6.24844 6.47872 6.37371 6.5 6.50048 6.5C6.62725 6.5 6.75252 6.47872 6.8677 6.43762C6.98287 6.39652 7.08523 6.33657 7.16774 6.26188L12.2868 1.626C12.7753 1.1835 12.3703 0.5 11.6195 0.5H1.37997C0.629216 0.5 0.224175 1.1835 0.71418 1.626Z" })
495
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M0.71418 1.626L5.83323 6.26188C5.91574 6.33657 6.0181 6.39652 6.13327 6.43762C6.24844 6.47872 6.37371 6.5 6.50048 6.5C6.62725 6.5 6.75252 6.47872 6.8677 6.43762C6.98287 6.39652 7.08523 6.33657 7.16774 6.26188L12.2868 1.626C12.7753 1.1835 12.3703 0.5 11.6195 0.5H1.37997C0.629216 0.5 0.224175 1.1835 0.71418 1.626Z" })
510
496
  }
511
497
  )
512
498
  ]
513
499
  }
514
500
  ) : null
515
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
516
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h1", { className: "wallet-adapter-modal-title", children: "Get an Aleo wallet to continue" }),
517
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "wallet-adapter-modal-middle", children: [
518
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AleoIcon, {}),
519
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
520
- "button",
521
- {
522
- type: "button",
523
- className: "wallet-adapter-modal-middle-button",
524
- onClick: (event) => handleWalletClick(event, getStartedWallet.adapter.name),
525
- children: "Get started"
526
- }
527
- )
528
- ] }),
529
- otherWallets.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
530
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
501
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
502
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { className: "wallet-adapter-modal-title", children: "Get an Aleo wallet to continue" }),
503
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "wallet-adapter-modal-middle", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
504
+ "button",
505
+ {
506
+ type: "button",
507
+ className: "wallet-adapter-modal-middle-button",
508
+ onClick: (event) => handleNotInstalledWalletClick(event, getStartedWallet?.adapter.name),
509
+ children: "Get started"
510
+ }
511
+ ) }),
512
+ otherWallets.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
513
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
531
514
  "button",
532
515
  {
533
516
  className: "wallet-adapter-modal-list-more",
534
517
  onClick: handleCollapseClick,
535
518
  tabIndex: 0,
536
519
  children: [
537
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { children: [
520
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
538
521
  expanded ? "Hide " : "View other ",
539
522
  "options"
540
523
  ] }),
541
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
524
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
542
525
  "svg",
543
526
  {
544
527
  width: "13",
@@ -546,16 +529,16 @@ var WalletModal = ({
546
529
  viewBox: "0 0 13 7",
547
530
  xmlns: "http://www.w3.org/2000/svg",
548
531
  className: `${expanded ? "wallet-adapter-modal-list-more-icon-rotate" : ""}`,
549
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M0.71418 1.626L5.83323 6.26188C5.91574 6.33657 6.0181 6.39652 6.13327 6.43762C6.24844 6.47872 6.37371 6.5 6.50048 6.5C6.62725 6.5 6.75252 6.47872 6.8677 6.43762C6.98287 6.39652 7.08523 6.33657 7.16774 6.26188L12.2868 1.626C12.7753 1.1835 12.3703 0.5 11.6195 0.5H1.37997C0.629216 0.5 0.224175 1.1835 0.71418 1.626Z" })
532
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M0.71418 1.626L5.83323 6.26188C5.91574 6.33657 6.0181 6.39652 6.13327 6.43762C6.24844 6.47872 6.37371 6.5 6.50048 6.5C6.62725 6.5 6.75252 6.47872 6.8677 6.43762C6.98287 6.39652 7.08523 6.33657 7.16774 6.26188L12.2868 1.626C12.7753 1.1835 12.3703 0.5 11.6195 0.5H1.37997C0.629216 0.5 0.224175 1.1835 0.71418 1.626Z" })
550
533
  }
551
534
  )
552
535
  ]
553
536
  }
554
537
  ),
555
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Collapse, { expanded, id: "wallet-adapter-modal-collapse", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { className: "wallet-adapter-modal-list", children: otherWallets.map((wallet2) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
538
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Collapse, { expanded, id: "wallet-adapter-modal-collapse", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "wallet-adapter-modal-list", children: otherWallets.map((wallet2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
556
539
  WalletListItem,
557
540
  {
558
- handleClick: (event) => handleWalletClick(event, wallet2.adapter.name),
541
+ handleClick: (event) => handleNotInstalledWalletClick(event, wallet2.adapter.name),
559
542
  tabIndex: expanded ? 0 : -1,
560
543
  wallet: wallet2
561
544
  },
@@ -563,18 +546,18 @@ var WalletModal = ({
563
546
  )) }) })
564
547
  ] }) : null
565
548
  ] }),
566
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
549
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
567
550
  "a",
568
551
  {
569
552
  className: "wallet-adapter-modal-footer",
570
553
  href: "https://provable.com/",
571
554
  target: "_blank",
572
555
  rel: "noopener noreferrer",
573
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ProvableLogo, {})
556
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ProvableLogo, {})
574
557
  }
575
558
  )
576
559
  ] }) }),
577
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "wallet-adapter-modal-overlay", onMouseDown: handleClose })
560
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "wallet-adapter-modal-overlay", onMouseDown: handleClose })
578
561
  ]
579
562
  }
580
563
  ),
@@ -584,7 +567,7 @@ var WalletModal = ({
584
567
 
585
568
  // src/WalletModalButton.tsx
586
569
  var import_react5 = require("react");
587
- var import_jsx_runtime9 = require("react/jsx-runtime");
570
+ var import_jsx_runtime8 = require("react/jsx-runtime");
588
571
  var WalletModalButton = ({
589
572
  children = "Connect Wallet",
590
573
  onClick,
@@ -598,15 +581,15 @@ var WalletModalButton = ({
598
581
  },
599
582
  [onClick, setVisible, visible]
600
583
  );
601
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { className: "wallet-adapter-button-trigger", onClick: handleClick, ...props, children });
584
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { className: "wallet-adapter-button-trigger", onClick: handleClick, ...props, children });
602
585
  };
603
586
 
604
587
  // src/WalletModalProvider.tsx
605
588
  var import_react6 = require("react");
606
- var import_jsx_runtime10 = require("react/jsx-runtime");
589
+ var import_jsx_runtime9 = require("react/jsx-runtime");
607
590
  var WalletModalProvider = ({ children, ...props }) => {
608
591
  const [visible, setVisible] = (0, import_react6.useState)(false);
609
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
592
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
610
593
  WalletModalContext.Provider,
611
594
  {
612
595
  value: {
@@ -615,7 +598,7 @@ var WalletModalProvider = ({ children, ...props }) => {
615
598
  },
616
599
  children: [
617
600
  children,
618
- visible && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WalletModal, { ...props })
601
+ visible && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(WalletModal, { ...props })
619
602
  ]
620
603
  }
621
604
  );
@@ -624,7 +607,7 @@ var WalletModalProvider = ({ children, ...props }) => {
624
607
  // src/WalletDisconnectButton.tsx
625
608
  var import_react7 = require("react");
626
609
  var import_aleo_wallet_adaptor_react3 = require("@provablehq/aleo-wallet-adaptor-react");
627
- var import_jsx_runtime11 = require("react/jsx-runtime");
610
+ var import_jsx_runtime10 = require("react/jsx-runtime");
628
611
  var WalletDisconnectButton = ({
629
612
  children,
630
613
  disabled,
@@ -646,12 +629,12 @@ var WalletDisconnectButton = ({
646
629
  if (wallet) return "Disconnect";
647
630
  return "Disconnect Wallet";
648
631
  }, [children, disconnecting, wallet]);
649
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
632
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
650
633
  Button,
651
634
  {
652
635
  className: "wallet-adapter-button-trigger",
653
636
  disabled: disabled || !wallet,
654
- startIcon: wallet ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WalletIcon, { wallet }) : void 0,
637
+ startIcon: wallet ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WalletIcon, { wallet }) : void 0,
655
638
  onClick: handleClick,
656
639
  ...props,
657
640
  children: content
@@ -664,8 +647,8 @@ var import_react8 = require("react");
664
647
  var import_aleo_wallet_adaptor_react4 = require("@provablehq/aleo-wallet-adaptor-react");
665
648
 
666
649
  // src/icons.tsx
667
- var import_jsx_runtime12 = require("react/jsx-runtime");
668
- var CopyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
650
+ var import_jsx_runtime11 = require("react/jsx-runtime");
651
+ var CopyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
669
652
  "svg",
670
653
  {
671
654
  xmlns: "http://www.w3.org/2000/svg",
@@ -678,12 +661,12 @@ var CopyIcon = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
678
661
  strokeLinecap: "round",
679
662
  strokeLinejoin: "round",
680
663
  children: [
681
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
682
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
664
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
665
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
683
666
  ]
684
667
  }
685
668
  );
686
- var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
669
+ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
687
670
  "svg",
688
671
  {
689
672
  xmlns: "http://www.w3.org/2000/svg",
@@ -695,10 +678,10 @@ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
695
678
  strokeWidth: "2",
696
679
  strokeLinecap: "round",
697
680
  strokeLinejoin: "round",
698
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M20 6 9 17l-5-5" })
681
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M20 6 9 17l-5-5" })
699
682
  }
700
683
  );
701
- var GenericWalletIcon = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
684
+ var GenericWalletIcon = () => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
702
685
  "svg",
703
686
  {
704
687
  xmlns: "http://www.w3.org/2000/svg",
@@ -711,14 +694,14 @@ var GenericWalletIcon = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
711
694
  strokeLinecap: "round",
712
695
  strokeLinejoin: "round",
713
696
  children: [
714
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1" }),
715
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4" })
697
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1" }),
698
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4" })
716
699
  ]
717
700
  }
718
701
  );
719
702
 
720
703
  // src/WalletMultiButton.tsx
721
- var import_jsx_runtime13 = require("react/jsx-runtime");
704
+ var import_jsx_runtime12 = require("react/jsx-runtime");
722
705
  var WalletMultiButton = ({ children, ...props }) => {
723
706
  const { address, wallet, disconnect } = (0, import_aleo_wallet_adaptor_react4.useWallet)();
724
707
  const { setVisible } = useWalletModal();
@@ -765,22 +748,22 @@ var WalletMultiButton = ({ children, ...props }) => {
765
748
  document.removeEventListener("touchstart", listener);
766
749
  };
767
750
  }, [ref, closeDropdown]);
768
- if (!wallet) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WalletModalButton, { ...props, children });
769
- if (!base58) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WalletConnectButton, { ...props, children });
770
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "wallet-adapter-dropdown", children: [
771
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
751
+ if (!wallet) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WalletModalButton, { ...props, children });
752
+ if (!base58) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WalletConnectButton, { ...props, children });
753
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "wallet-adapter-dropdown", children: [
754
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
772
755
  Button,
773
756
  {
774
757
  "aria-expanded": active,
775
758
  className: "wallet-adapter-button-trigger",
776
759
  style: { pointerEvents: active ? "none" : "auto", ...props.style },
777
760
  onClick: openDropdown,
778
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WalletIcon, { wallet }),
761
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WalletIcon, { wallet }),
779
762
  ...props,
780
763
  children: content
781
764
  }
782
765
  ),
783
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
766
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
784
767
  "ul",
785
768
  {
786
769
  "aria-label": "dropdown-list",
@@ -788,18 +771,18 @@ var WalletMultiButton = ({ children, ...props }) => {
788
771
  ref,
789
772
  role: "menu",
790
773
  children: [
791
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { onClick: copyAddress, className: "wallet-adapter-dropdown-list-item", role: "menuitem", children: copied ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
774
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { onClick: copyAddress, className: "wallet-adapter-dropdown-list-item", role: "menuitem", children: copied ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
792
775
  "Copied",
793
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CheckIcon, {})
794
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
776
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CheckIcon, {})
777
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
795
778
  "Copy address ",
796
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CopyIcon, {})
779
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CopyIcon, {})
797
780
  ] }) }),
798
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("li", { onClick: openModal, className: "wallet-adapter-dropdown-list-item", role: "menuitem", children: [
781
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("li", { onClick: openModal, className: "wallet-adapter-dropdown-list-item", role: "menuitem", children: [
799
782
  "Change wallet ",
800
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GenericWalletIcon, {})
783
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GenericWalletIcon, {})
801
784
  ] }),
802
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { onClick: onDisconnect, className: "wallet-adapter-dropdown-list-item", role: "menuitem", children: "Disconnect" })
785
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { onClick: onDisconnect, className: "wallet-adapter-dropdown-list-item", role: "menuitem", children: "Disconnect" })
803
786
  ]
804
787
  }
805
788
  )