@wallet-ui/react 1.1.0-canary-20250327120256 → 1.1.0-canary-20250327121732

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.
@@ -5,6 +5,7 @@ var react$1 = require('@wallet-standard/react');
5
5
  var react$2 = require('@zag-js/react');
6
6
  var menu = require('@zag-js/menu');
7
7
  var dialog = require('@zag-js/dialog');
8
+ var react$3 = require('@nanostores/react');
8
9
  var core$1 = require('@wallet-ui/core');
9
10
  var gill = require('gill');
10
11
  var react = require('@solana/react');
@@ -367,13 +368,11 @@ function useWalletUiWallets() {
367
368
  [readonlyWallets]
368
369
  );
369
370
  }
370
- var STORAGE_KEY = "wallet-ui:selected-wallet-account";
371
371
  var wasSetterInvoked = false;
372
- function getSavedWalletAccount(wallets, storageKey) {
372
+ function getSavedWalletAccount(wallets, savedWalletNameAndAddress) {
373
373
  if (wasSetterInvoked) {
374
374
  return;
375
375
  }
376
- const savedWalletNameAndAddress = localStorage.getItem(storageKey);
377
376
  if (!savedWalletNameAndAddress || typeof savedWalletNameAndAddress !== "string") {
378
377
  return;
379
378
  }
@@ -381,44 +380,37 @@ function getSavedWalletAccount(wallets, storageKey) {
381
380
  if (!savedWalletName || !savedAccountAddress) {
382
381
  return;
383
382
  }
384
- for (const wallet of wallets) {
385
- if (wallet.name === savedWalletName) {
386
- for (const account of wallet.accounts) {
387
- if (account.address === savedAccountAddress) {
388
- return account;
389
- }
390
- }
391
- }
383
+ const wallet = wallets.find((w) => w.name === savedWalletName);
384
+ if (!wallet) {
385
+ return;
392
386
  }
387
+ return wallet.accounts.find((a) => a.address === savedAccountAddress);
393
388
  }
394
389
  function WalletUiAccountContextProvider({
395
390
  children,
396
- storageKey = STORAGE_KEY
391
+ storage = core$1.createStorageAccount()
397
392
  }) {
398
393
  const { cluster } = useWalletUiCluster();
399
394
  const wallets = react$1.useWallets();
395
+ const accountId = react$3.useStore(storage.value);
400
396
  const [account, setAccountInternal] = React19.useState(
401
- () => getSavedWalletAccount(wallets, storageKey)
397
+ () => getSavedWalletAccount(wallets, accountId)
402
398
  );
403
399
  function setAccount(setStateAction) {
404
400
  setAccountInternal((prevAccount) => {
405
401
  wasSetterInvoked = true;
406
402
  const nextWalletAccount = typeof setStateAction === "function" ? setStateAction(prevAccount) : setStateAction;
407
403
  const accountKey = nextWalletAccount ? react$1.getUiWalletAccountStorageKey(nextWalletAccount) : void 0;
408
- if (accountKey) {
409
- localStorage.setItem(storageKey, accountKey);
410
- } else {
411
- localStorage.removeItem(storageKey);
412
- }
404
+ storage.set(accountKey ? accountKey : void 0);
413
405
  return nextWalletAccount;
414
406
  });
415
407
  }
416
408
  React19.useEffect(() => {
417
- const savedWalletAccount = getSavedWalletAccount(wallets, storageKey);
409
+ const savedWalletAccount = getSavedWalletAccount(wallets, accountId);
418
410
  if (savedWalletAccount) {
419
411
  setAccountInternal(savedWalletAccount);
420
412
  }
421
- }, [wallets]);
413
+ }, [accountId, wallets]);
422
414
  const walletAccount = React19.useMemo(() => {
423
415
  if (account) {
424
416
  for (const uiWallet of wallets) {
@@ -475,67 +467,31 @@ function WalletUiAccountContextProvider({
475
467
  children
476
468
  );
477
469
  }
478
- function useLocalStorage(key, initialValue) {
479
- const [storedValue, setStoredValue] = React19.useState(() => {
480
- try {
481
- if (typeof window === "undefined") {
482
- return initialValue;
483
- }
484
- const item = window.localStorage.getItem(key);
485
- if (key.includes("wallet") || key.includes("account")) {
486
- return initialValue;
487
- }
488
- return item ? JSON.parse(item) : initialValue;
489
- } catch (error) {
490
- console.warn(`Error reading localStorage key "${key}":`, error);
491
- return initialValue;
492
- }
493
- });
494
- const setValue = React19.useCallback(
495
- (value) => {
496
- try {
497
- const valueToStore = value instanceof Function ? value(storedValue) : value;
498
- setStoredValue(valueToStore);
499
- if (typeof window !== "undefined") {
500
- if (valueToStore === void 0 || valueToStore === null) {
501
- window.localStorage.removeItem(key);
502
- } else {
503
- window.localStorage.setItem(key, JSON.stringify(valueToStore));
504
- }
505
- }
506
- } catch (error) {
507
- console.warn(`Error setting localStorage key "${key}":`, error);
508
- }
509
- },
510
- [key, storedValue]
511
- );
512
- return [storedValue, setValue];
513
- }
514
-
515
- // src/wallet-ui-cluster-context-provider.tsx
516
470
  function WalletUiClusterContextProvider({
517
471
  clusters,
518
472
  render,
519
- storageKey = "__wallet-ui:selected-cluster"
473
+ storage = core$1.createStorageCluster()
520
474
  }) {
521
- const [clusterId, setClusterId] = useLocalStorage(storageKey, "solana:devnet");
475
+ const clusterId = react$3.useStore(storage.value);
476
+ if (!clusterId) {
477
+ throw new Error("Error reading cluster id from storage");
478
+ }
522
479
  if (!clusters.length) {
523
480
  throw new Error("No clusters provided");
524
481
  }
525
- const cluster = React19.useMemo(() => {
526
- for (const cluster2 of clusters) {
527
- if (cluster2.id === clusterId) {
528
- return cluster2;
529
- }
530
- }
531
- return clusters[0];
532
- }, [clusterId, clusters]);
482
+ const cluster = clusters.find((c) => c.id === clusterId);
483
+ if (!cluster) {
484
+ throw new Error(`Cluster ${clusterId.toString()} not found`);
485
+ }
533
486
  const value = {
534
487
  cluster,
535
488
  clusters,
536
- setCluster: (cluster2) => {
537
- localStorage.setItem(storageKey, cluster2);
538
- setClusterId(cluster2);
489
+ setCluster: (clusterId2) => {
490
+ const cluster2 = clusters.find((c) => c.id === clusterId2);
491
+ if (!cluster2) {
492
+ throw new Error(`Cluster ${clusterId2} not found`);
493
+ }
494
+ storage.set(clusterId2);
539
495
  }
540
496
  };
541
497
  return /* @__PURE__ */ React19__default.default.createElement(WalletUiClusterContext.Provider, { value }, render(value));
@@ -588,17 +544,14 @@ function WalletUiSolanaClientContextProvider({
588
544
  function createWalletUiConfig(props) {
589
545
  return { ...props };
590
546
  }
591
- function WalletUi({
592
- children,
593
- config: { clusters, clusterStorageKey, selectedAccountStorageKey, ...config }
594
- }) {
547
+ function WalletUi({ children, config: { accountStorage, clusters, clusterStorage, ...config } }) {
595
548
  return /* @__PURE__ */ React19__default.default.createElement(React19__default.default.Fragment, null, /* @__PURE__ */ React19__default.default.createElement(
596
549
  WalletUiClusterContextProvider,
597
550
  {
598
551
  clusters,
599
- storageKey: clusterStorageKey,
552
+ storage: clusterStorage,
600
553
  render: ({ cluster }) => {
601
- return /* @__PURE__ */ React19__default.default.createElement(WalletUiSolanaClientContextProvider, { urlOrMoniker: cluster.urlOrMoniker }, /* @__PURE__ */ React19__default.default.createElement(WalletUiAccountContextProvider, { storageKey: selectedAccountStorageKey }, /* @__PURE__ */ React19__default.default.createElement(WalletUiContextProvider, { ...config }, children)));
554
+ return /* @__PURE__ */ React19__default.default.createElement(WalletUiSolanaClientContextProvider, { urlOrMoniker: cluster.urlOrMoniker }, /* @__PURE__ */ React19__default.default.createElement(WalletUiAccountContextProvider, { storage: accountStorage }, /* @__PURE__ */ React19__default.default.createElement(WalletUiContextProvider, { ...config }, children)));
602
555
  }
603
556
  }
604
557
  ));
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/base-button.tsx","../src/wallet-ui-context.tsx","../src/use-wallet-ui.tsx","../src/wallet-ui-account-context.tsx","../src/use-wallet-ui-account.tsx","../src/use-wallet-ui-wallet.tsx","../src/base-dropdown.tsx","../src/base-svg.tsx","../src/wallet-ui-icon-close.tsx","../src/base-modal.tsx","../src/use-base-dropdown.tsx","../src/use-base-modal.tsx","../src/wallet-ui-cluster-context.tsx","../src/use-wallet-ui-cluster.tsx","../src/wallet-ui-icon.tsx","../src/use-wallet-ui-dropdown.tsx","../src/wallet-ui-solana-client-context.tsx","../src/use-wallet-ui-solana-client.tsx","../src/use-wallet-ui-wallets.tsx","../src/wallet-ui-account-context-provider.tsx","../src/use-local-storage.ts","../src/wallet-ui-cluster-context-provider.tsx","../src/wallet-ui-context-provider.tsx","../src/wallet-ui-solana-client-context-provider.tsx","../src/wallet-ui.tsx","../src/wallet-ui-button.tsx","../src/wallet-ui-cluster-dropdown.tsx","../src/wallet-ui-dropdown.tsx","../src/wallet-ui-icon-no-wallet.tsx","../src/wallet-ui-label.tsx","../src/wallet-ui-list-button.tsx","../src/wallet-ui-list.tsx","../src/wallet-ui-modal.tsx","../src/wallet-ui-modal-trigger.tsx"],"names":["React","createContext","useContext","connect","useConnect","useDisconnect","useEffect","BaseDropdownItemType","Portal","useMachine","menu","useId","normalizeProps","dialog","useMemo","useWallets","useState","getUiWalletAccountStorageKey","uiWalletAccountsAreSame","uiWalletAccountBelongsToUiWallet","useCallback","cluster","account","handleCopyText","createSolanaClient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,KAAO,EAAA,WAAA,EAAa,SAAS,YAAc,EAAA,IAAA,EAAM,GAAG,KAAA,EAA0B,EAAA;AAClH,EAAA,uBACKA,wBAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAO,SAAW,EAAA,CAAA,sBAAA,EAAyB,IAAQ,IAAA,IAAI,CAAI,CAAA,EAAA,SAAA,IAAa,EAAE,CAAA,CAAA,EAAI,OAAmB,EAAA,GAAG,KAChG,EAAA,EAAA,WAAA,mBAAeA,wBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAK,SAAU,EAAA,oCAAA,EAAA,EAAsC,WAAY,CAAA,GAAU,IAC1F,EAAA,KAAA,EACA,YAAe,mBAAAA,wBAAA,CAAA,aAAA,CAAC,MAAK,EAAA,EAAA,SAAA,EAAU,qCAAuC,EAAA,EAAA,YAAa,IAAU,IAClG,CAAA;AAER;ACQO,IAAM,eAAkBA,GAAAA,wBAAAA,CAAM,aAAoC,CAAA,EAA0B;;;ACzB5F,SAAS,WAAc,GAAA;AAC1B,EAAOA,OAAAA,wBAAAA,CAAM,WAAW,eAAe,CAAA;AAC3C;ACQa,IAAA,sBAAA,GAAyBC,qBAAoC,CAAA,EAA0B;;;ACV7F,SAAS,kBAAqB,GAAA;AACjC,EAAA,OAAOC,mBAAW,sBAAsB,CAAA;AAC5C;;;ACAO,SAAS,iBAAA,CAAkB,EAAE,MAAA,E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A,EAAW,KAAc,EAAA,OAAA,EAAS,MAAM,KAAK,KAAM,CAAA,IAAA,EAAS,EAAA,GAAG,KAAO,EAAA,CAAA;AAClF","file":"index.node.cjs","sourcesContent":["import React from 'react';\n\nimport { WalletUiButton } from './types/wallet-ui-button';\nimport { WalletUiSize } from './types/wallet-ui-size';\n\nexport interface BaseButtonProps extends Omit<WalletUiButton, 'children'> {\n label: React.ReactNode;\n leftSection?: React.ReactNode;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n rightSection?: React.ReactNode;\n size?: WalletUiSize;\n}\n\nexport function BaseButton({ className, label, leftSection, onClick, rightSection, size, ...props }: BaseButtonProps) {\n return (\n <button className={`wallet-ui-base-button ${size ?? 'md'} ${className ?? ''}`} onClick={onClick} {...props}>\n {leftSection ? <span className=\"wallet-ui-base-button-left-section\">{leftSection}</span> : null}\n {label}\n {rightSection ? <span className=\"wallet-ui-base-button-right-section\">{rightSection}</span> : null}\n </button>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport { SolanaClient } from 'gill';\nimport React, { ReactNode } from 'react';\n\nimport { WalletUiSize } from './types/wallet-ui-size';\n\nexport interface WalletUiContextProviderProps {\n children: ReactNode;\n size?: WalletUiSize;\n}\n\nexport interface WalletUiContextValue {\n account?: UiWalletAccount;\n accountKeys: string[];\n client: SolanaClient;\n connect: (wallet: UiWalletAccount) => void;\n connected: boolean;\n copy: () => void;\n disconnect: () => void;\n size: WalletUiSize;\n wallet?: UiWallet;\n wallets: UiWallet[];\n}\n\nexport interface WalletUiContextProviderProps {\n children: ReactNode;\n size?: WalletUiSize;\n}\n\nexport const WalletUiContext = React.createContext<WalletUiContextValue>({} as WalletUiContextValue);\n","import React from 'react';\n\nimport { WalletUiContext } from './wallet-ui-context';\n\nexport function useWalletUi() {\n return React.useContext(WalletUiContext);\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React, { createContext } from 'react';\n\nexport interface WalletUiAccountInfo {\n account: UiWalletAccount;\n accountKeys: string[];\n wallet: UiWallet | undefined;\n}\n\nexport interface WalletUiAccountState extends Omit<WalletUiAccountInfo, 'account'> {\n account: UiWalletAccount | undefined;\n setAccount: React.Dispatch<React.SetStateAction<UiWalletAccount | undefined>>;\n}\n\nexport const WalletUiAccountContext = createContext<WalletUiAccountState>({} as WalletUiAccountState);\n","import { useContext } from 'react';\n\nimport { WalletUiAccountContext } from './wallet-ui-account-context';\n\nexport function useWalletUiAccount() {\n return useContext(WalletUiAccountContext);\n}\n","import { UiWallet, useConnect, useDisconnect } from '@wallet-standard/react';\nimport { useEffect } from 'react';\n\nimport { useWalletUi } from './use-wallet-ui';\nimport { useWalletUiAccount } from './use-wallet-ui-account';\n\nexport function useWalletUiWallet({ wallet }: { wallet: UiWallet }) {\n const { connect: connectAccount } = useWalletUi();\n const { setAccount } = useWalletUiAccount();\n const [isConnecting, connect] = useConnect(wallet);\n const [isDisconnecting, disconnect] = useDisconnect(wallet);\n useEffect(() => {}, [isDisconnecting]);\n\n return {\n connect: async () => {\n const connectedAccount = await connect();\n console.log('connectedAccount', connectedAccount);\n if (!connectedAccount.length) {\n console.log('connect, no accounts');\n return connectedAccount;\n }\n const first = connectedAccount[0];\n console.log('connect, setting first account => ', first);\n setAccount(first);\n connectAccount(first);\n return connectedAccount;\n },\n disconnect,\n isConnecting,\n isDisconnecting,\n };\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React, { HTMLAttributes } from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { BaseDropdownControl } from './use-base-dropdown';\nimport { useWalletUiWallet } from './use-wallet-ui-wallet';\n\nexport enum BaseDropdownItemType {\n Item = 'Item',\n WalletConnect = 'WalletConnect',\n WalletCopy = 'WalletCopy',\n WalletDisconnect = 'WalletDisconnect',\n WalletNeeded = 'WalletNeeded',\n}\n\nexport interface BaseDropdownItem {\n closeMenu?: boolean;\n disabled?: boolean;\n handler: () => Promise<void>;\n label: string;\n leftSection?: React.ReactNode;\n rightSection?: React.ReactNode;\n type: BaseDropdownItemType;\n value: string;\n wallet?: UiWallet;\n}\n\nexport interface BaseDropdownProps {\n buttonProps: BaseButtonProps;\n dropdown: BaseDropdownControl;\n items: BaseDropdownItem[];\n showIndicator?: boolean;\n}\n\nexport function BaseDropdown({ buttonProps, dropdown, showIndicator, items }: BaseDropdownProps) {\n const api = dropdown.api;\n const trigger = (\n <BaseButton\n {...api.getTriggerProps()}\n className={`wallet-ui-base-dropdown-trigger`}\n data-part=\"trigger\"\n rightSection={\n showIndicator ? (\n <span className=\"wallet-actions\">\n <span {...api.getIndicatorProps()} className=\"indicator\">\n <BaseDropdownChevronDown size={12} />\n </span>\n </span>\n ) : null\n }\n {...buttonProps}\n />\n );\n\n return (\n <div className=\"wallet-ui-base-dropdown\">\n {trigger}\n <div {...api.getPositionerProps()} className=\"wallet-positioner\">\n <div {...api.getContentProps()} className=\"wallet-ui-base-dropdown-list\" data-part=\"content\">\n {items.map(item => {\n return (\n <BaseDropdownItem\n {...api.getItemProps({ value: item.value })}\n key={item.value}\n item={item}\n afterClick={() => {\n if (item.disabled) {\n return;\n }\n if (item.closeMenu !== false) {\n dropdown.close();\n }\n }}\n />\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n\nfunction BaseDropdownItem({ afterClick, item }: BaseDropdownItemRenderProps) {\n if (!item.wallet) {\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n }\n switch (item.type) {\n case BaseDropdownItemType.Item:\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n case BaseDropdownItemType.WalletConnect:\n return <BaseDropdownItemWalletConnect afterClick={afterClick} item={item} wallet={item.wallet} />;\n case BaseDropdownItemType.WalletCopy:\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n case BaseDropdownItemType.WalletDisconnect:\n return <BaseDropdownItemWalletDisconnect afterClick={afterClick} item={item} wallet={item.wallet} />;\n }\n}\n\nfunction BaseDropdownItemWalletConnect({\n afterClick,\n item,\n wallet,\n}: BaseDropdownItemRenderProps & {\n wallet: UiWallet;\n}) {\n const { connect } = useWalletUiWallet({ wallet });\n return (\n <BaseDropdownItemRender\n afterClick={afterClick}\n item={{\n ...item,\n handler: async () => {\n //\n await connect();\n return await item.handler();\n },\n }}\n />\n );\n}\n\nfunction BaseDropdownItemWalletDisconnect({\n afterClick,\n item,\n wallet,\n}: BaseDropdownItemRenderProps & {\n wallet: UiWallet;\n}) {\n const { disconnect } = useWalletUiWallet({ wallet });\n return (\n <BaseDropdownItemRender\n afterClick={afterClick}\n item={{\n ...item,\n handler: async () => {\n //\n await disconnect();\n return await item.handler();\n },\n }}\n />\n );\n}\n\ninterface BaseDropdownItemRenderProps {\n afterClick: () => void;\n item: BaseDropdownItem;\n}\n\nfunction BaseDropdownItemRender({ afterClick, item }: BaseDropdownItemRenderProps) {\n function onClick() {\n if (item.disabled) {\n return;\n }\n void item.handler().then(() => {\n afterClick();\n });\n }\n\n return (\n <div className=\"wallet-ui-base-dropdown-item\" data-part=\"item\" onClick={onClick}>\n {item.leftSection ? (\n <span className=\"wallet-ui-base-dropdown-item-left-section\">{item.leftSection}</span>\n ) : null}\n {item.label}\n {item.rightSection ? (\n <span className=\"wallet-ui-base-dropdown-item-right-section\">{item.rightSection}</span>\n ) : null}\n </div>\n );\n}\n\nexport function BaseDropdownChevronDown(props: HTMLAttributes<SVGElement> & { size?: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={props.size ?? 24}\n height={props.size ?? 24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n","import React from 'react';\n\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { WalletUiSvg } from './types/wallet-ui-svg';\n\nexport interface BaseSvgProps extends WalletUiSvg {\n size: WalletUiSize;\n sizes: { [key: string]: number };\n viewBox: string;\n}\n\nexport function BaseSvg({ sizes = {}, ...props }: BaseSvgProps) {\n const size = props.size ? sizes[props.size] : 12;\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={size} height={size} {...props}>\n {props.children}\n </svg>\n );\n}\n","import React from 'react';\n\nimport { BaseSvg, BaseSvgProps } from './base-svg';\n\nexport function WalletUiIconClose({ size = 'md', ...props }: Omit<BaseSvgProps, 'sizes' | 'viewBox'>) {\n return (\n <BaseSvg\n size={size}\n sizes={{ lg: 16, md: 12, sm: 8 }}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n viewBox=\"0 0 14 14\"\n {...props}\n >\n <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\"></path>\n </BaseSvg>\n );\n}\n","import { Portal } from '@zag-js/react';\nimport React from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { BaseModalControl } from './use-base-modal';\nimport { WalletUiIconClose } from './wallet-ui-icon-close';\n\nexport interface BaseModalProps {\n buttonLabel?: React.ReactNode;\n buttonProps?: Partial<BaseButtonProps>;\n children: React.ReactNode;\n description?: React.ReactNode;\n modal: BaseModalControl;\n size?: WalletUiSize;\n title?: React.ReactNode;\n}\n\nexport function BaseModal({ modal, buttonLabel, buttonProps = {}, size = 'md', ...props }: BaseModalProps) {\n const api = modal.api;\n return (\n <>\n {buttonLabel ? (\n <BaseButton label={buttonLabel} size={size} {...buttonProps} {...api.getTriggerProps()} />\n ) : null}\n {api.open && (\n <Portal>\n <div {...api.getBackdropProps()} />\n <div {...api.getPositionerProps()}>\n <div {...api.getContentProps()} className={size}>\n <header>\n <button {...api.getCloseTriggerProps()}>\n <WalletUiIconClose size={size} />\n </button>\n </header>\n {props.description ? <p {...api.getDescriptionProps()}>{props.description}</p> : null}\n <main>{props.children}</main>\n </div>\n </div>\n </Portal>\n )}\n </>\n );\n}\n","import * as menu from '@zag-js/menu';\nimport { normalizeProps, useMachine } from '@zag-js/react';\nimport { useId } from 'react';\n\nexport type BaseDropdownApi = ReturnType<typeof menu.connect>;\n\nexport interface BaseDropdownControl {\n api: BaseDropdownApi;\n close: () => void;\n open: () => void;\n}\n\nexport function useBaseDropdown(): BaseDropdownControl {\n const service = useMachine(menu.machine, { id: useId() });\n const api = menu.connect(service, normalizeProps);\n\n return {\n api,\n close: () => service.send({ type: 'CLOSE' }),\n open: () => service.send({ type: 'OPEN' }),\n };\n}\n","import * as dialog from '@zag-js/dialog';\nimport { normalizeProps, useMachine } from '@zag-js/react';\nimport { useId } from 'react';\n\nexport type BaseModalApi = ReturnType<typeof dialog.connect>;\n\nexport interface BaseModalControl {\n api: BaseModalApi;\n close: () => void;\n open: () => void;\n}\n\nexport function useBaseModal(): BaseModalControl {\n const service = useMachine(dialog.machine, { id: useId(), modal: true });\n const api = dialog.connect(service, normalizeProps);\n\n return {\n api,\n close: () => service.send({ type: 'CLOSE' }),\n open: () => service.send({ type: 'OPEN' }),\n };\n}\n","import { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';\nimport { createContext, ReactNode } from 'react';\n\nexport interface WalletUiClusterContextProviderProps {\n clusters: SolanaCluster[];\n render: (props: WalletUiClusterContextValue) => ReactNode;\n storageKey?: string;\n}\n\nexport interface WalletUiClusterContextValue {\n cluster: SolanaCluster;\n clusters: SolanaCluster[];\n\n setCluster(cluster: SolanaClusterId): void;\n}\n\nexport const WalletUiClusterContext = createContext<WalletUiClusterContextValue>({} as WalletUiClusterContextValue);\n","import { useContext } from 'react';\n\nimport { WalletUiClusterContext } from './wallet-ui-cluster-context';\n\nexport function useWalletUiCluster() {\n return useContext(WalletUiClusterContext);\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiImg } from './types/wallet-ui-img';\nimport { WalletUiSize } from './types/wallet-ui-size';\n\nexport interface WalletUiIconProps extends WalletUiImg {\n size?: WalletUiSize;\n wallet?: Pick<UiWallet, 'icon' | 'name'>;\n}\n\nexport function WalletUiIcon({ className, size, wallet, ...props }: WalletUiIconProps) {\n if (!wallet) {\n return null;\n }\n\n return (\n <img\n src={wallet.icon}\n alt={wallet.name}\n className={`wallet-ui-list-icon ${size ?? 'md'} ${className ?? ''}`}\n {...props}\n />\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React, { useMemo } from 'react';\n\nimport { BaseButtonProps } from './base-button';\nimport { BaseDropdownItem, BaseDropdownItemType } from './base-dropdown';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { BaseDropdownControl, useBaseDropdown } from './use-base-dropdown';\nimport { useWalletUi } from './use-wallet-ui';\nimport { WalletUiIcon } from './wallet-ui-icon';\n\nfunction getDropdownItemsWallets({\n wallets,\n connect,\n size,\n}: {\n connect: (wallet: UiWalletAccount) => void;\n size: WalletUiSize;\n wallets: UiWallet[];\n}): BaseDropdownItem[] {\n return wallets.length\n ? wallets.map(wallet => ({\n handler: async () => {\n // TODO: Add support for multiple accounts, properly handle no accounts\n const account = wallet.accounts.length > 0 ? wallet.accounts[0] : undefined;\n if (!account) {\n return;\n }\n connect(account);\n await Promise.resolve();\n },\n label: wallet.name,\n leftSection: <WalletUiIcon wallet={wallet} size={size} />,\n type: BaseDropdownItemType.WalletConnect,\n value: wallet.name,\n wallet,\n }))\n : [\n {\n handler: async () => {\n window.open('https://solana.com/solana-wallets', '_blank');\n await Promise.resolve();\n },\n label: \"You'll need a wallet on Solana to continue\",\n type: BaseDropdownItemType.WalletNeeded,\n value: 'no-wallets',\n },\n ];\n}\n\nexport function useWalletUiDropdown({ size = 'md' }: { size?: WalletUiSize } = {}): {\n buttonProps: BaseButtonProps;\n connected: boolean;\n dropdown: BaseDropdownControl;\n items: BaseDropdownItem[];\n} {\n const dropdown = useBaseDropdown();\n\n const { account, connect, copy, disconnect, connected, wallet, wallets } = useWalletUi();\n\n const itemsWallets = useMemo(() => {\n return getDropdownItemsWallets({ connect, size, wallets });\n }, [wallets, size, connect]);\n\n const itemsConnected: BaseDropdownItem[] = useMemo(\n () => [\n {\n handler: async () => {\n copy();\n void (await Promise.resolve());\n },\n label: 'Copy Address',\n type: BaseDropdownItemType.WalletCopy,\n value: 'copy',\n },\n {\n handler: async () => {\n disconnect();\n dropdown.close();\n await Promise.resolve();\n },\n label: 'Disconnect',\n type: BaseDropdownItemType.WalletDisconnect,\n value: 'disconnect',\n },\n ...itemsWallets,\n ],\n [connect, copy, disconnect, dropdown, size, wallets],\n );\n const items = useMemo(() => {\n return connected ? itemsConnected : itemsWallets;\n }, [connected, itemsConnected, itemsWallets]);\n\n const buttonProps: BaseButtonProps = useMemo(() => {\n return {\n label: connected ? ((account ? ellipsify(account.address) : wallet?.name) ?? 'Connected') : 'Select Wallet',\n leftSection: connected ? <WalletUiIcon size={size} wallet={wallet} /> : undefined,\n };\n }, [account, connected, size, wallet]);\n\n return {\n buttonProps,\n connected,\n dropdown,\n items,\n };\n}\n\nexport function ellipsify(str = '', len = 4, delimiter = '..') {\n const strLen = str.length;\n const limit = len * 2 + delimiter.length;\n\n return strLen >= limit ? str.substring(0, len) + delimiter + str.substring(strLen - len, strLen) : str;\n}\n","import { SolanaClient, SolanaClientUrlOrMoniker } from 'gill';\nimport { createContext, ReactNode } from 'react';\n\nexport interface WalletUiSolanaClientContextProviderProps {\n children: ReactNode;\n urlOrMoniker: SolanaClientUrlOrMoniker;\n}\n\nexport const WalletUiSolanaClientContext = createContext<SolanaClient>({} as SolanaClient);\n","import { useContext } from 'react';\n\nimport { WalletUiSolanaClientContext } from './wallet-ui-solana-client-context';\n\nexport function useWalletUiSolanaClient() {\n return useContext(WalletUiSolanaClientContext);\n}\n","import { useWallets } from '@wallet-standard/react';\nimport { useMemo } from 'react';\n\nexport function useWalletUiWallets() {\n const readonlyWallets = useWallets();\n return useMemo(\n () =>\n readonlyWallets\n .filter(wallet => wallet.chains.some(i => i.startsWith('solana:')))\n .sort((a, b) => a.name.localeCompare(b.name)),\n [readonlyWallets],\n );\n}\n","import {\n getUiWalletAccountStorageKey,\n UiWallet,\n UiWalletAccount,\n uiWalletAccountBelongsToUiWallet,\n uiWalletAccountsAreSame,\n useWallets,\n} from '@wallet-standard/react';\nimport React, { useEffect, useMemo, useState } from 'react';\n\nimport { useWalletUiCluster } from './use-wallet-ui-cluster';\nimport { WalletUiAccountContext } from './wallet-ui-account-context';\n\nconst STORAGE_KEY = 'wallet-ui:selected-wallet-account';\n\nlet wasSetterInvoked = false;\n\nfunction getSavedWalletAccount(wallets: readonly UiWallet[], storageKey: string): UiWalletAccount | undefined {\n if (wasSetterInvoked) {\n // After the user makes an explicit choice of wallet, stop trying to auto-select the\n // saved wallet, if and when it appears.\n return;\n }\n const savedWalletNameAndAddress = localStorage.getItem(storageKey);\n if (!savedWalletNameAndAddress || typeof savedWalletNameAndAddress !== 'string') {\n return;\n }\n const [savedWalletName, savedAccountAddress] = savedWalletNameAndAddress.split(':');\n if (!savedWalletName || !savedAccountAddress) {\n return;\n }\n for (const wallet of wallets) {\n if (wallet.name === savedWalletName) {\n for (const account of wallet.accounts) {\n if (account.address === savedAccountAddress) {\n return account;\n }\n }\n }\n }\n}\n\n/**\n * Saves the selected wallet account's storage key to the browser's local storage. In future\n * sessions it will try to return that same wallet account, or at least one from the same brand of\n * wallet if the wallet from which it came is still in the Wallet Standard registry.\n */\nexport function WalletUiAccountContextProvider({\n children,\n storageKey = STORAGE_KEY,\n}: {\n children: React.ReactNode;\n storageKey?: string;\n}) {\n const { cluster } = useWalletUiCluster();\n const wallets = useWallets();\n const [account, setAccountInternal] = useState<UiWalletAccount | undefined>(() =>\n getSavedWalletAccount(wallets, storageKey),\n );\n\n function setAccount(setStateAction: React.SetStateAction<UiWalletAccount | undefined>) {\n setAccountInternal(prevAccount => {\n wasSetterInvoked = true;\n const nextWalletAccount =\n typeof setStateAction === 'function' ? setStateAction(prevAccount) : setStateAction;\n const accountKey = nextWalletAccount ? getUiWalletAccountStorageKey(nextWalletAccount) : undefined;\n if (accountKey) {\n localStorage.setItem(storageKey, accountKey);\n } else {\n localStorage.removeItem(storageKey);\n }\n return nextWalletAccount;\n });\n }\n\n useEffect(() => {\n const savedWalletAccount = getSavedWalletAccount(wallets, storageKey);\n if (savedWalletAccount) {\n setAccountInternal(savedWalletAccount);\n }\n }, [wallets]);\n const walletAccount = useMemo(() => {\n if (account) {\n for (const uiWallet of wallets) {\n for (const uiWalletAccount of uiWallet.accounts) {\n if (uiWalletAccountsAreSame(account, uiWalletAccount)) {\n return uiWalletAccount;\n }\n }\n if (uiWalletAccountBelongsToUiWallet(account, uiWallet) && uiWallet.accounts[0]) {\n // If the selected account belongs to this connected wallet, at least, then\n // select one of its accounts.\n return uiWallet.accounts[0];\n }\n }\n }\n }, [account, wallets]);\n useEffect(() => {\n // If there is a selected wallet account but the wallet to which it belongs has since\n // disconnected, clear the selected wallet.\n if (account && !walletAccount) {\n setAccountInternal(undefined);\n }\n }, [account, walletAccount]);\n\n const wallet = useMemo(() => {\n if (!walletAccount) {\n return undefined;\n }\n for (const uiWallet of wallets) {\n for (const uiWalletAccount of uiWallet.accounts) {\n if (uiWalletAccountsAreSame(walletAccount, uiWalletAccount)) {\n return uiWallet;\n }\n }\n if (uiWalletAccountBelongsToUiWallet(walletAccount, uiWallet) && uiWallet.accounts[0]) {\n // If the selected account belongs to this connected wallet, at least, then\n // select one of its accounts.\n return uiWallet;\n }\n }\n }, [walletAccount, wallets]);\n\n // Expose the error boundary reset keys to the context\n const accountKeys = useMemo(() => {\n if (!account) {\n return [];\n }\n return [cluster.id, getUiWalletAccountStorageKey(account)].filter(Boolean);\n }, [account, cluster.id]);\n return (\n <WalletUiAccountContext.Provider\n value={useMemo(\n () => ({\n account: walletAccount,\n accountKeys,\n setAccount,\n wallet,\n }),\n [walletAccount, wallet, accountKeys],\n )}\n >\n {children}\n </WalletUiAccountContext.Provider>\n );\n}\n","import { useCallback, useState } from 'react';\n\nexport function useLocalStorage<T>(key: string, initialValue: T) {\n // State to store our value\n const [storedValue, setStoredValue] = useState<T>(() => {\n try {\n // Check if we're on the client side\n if (typeof window === 'undefined') {\n return initialValue;\n }\n\n const item = window.localStorage.getItem(key);\n // For wallet-related data, validate the stored value\n if (key.includes('wallet') || key.includes('account')) {\n // Return initial value if stored data might be stale\n return initialValue;\n }\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n console.warn(`Error reading localStorage key \"${key}\":`, error);\n return initialValue;\n }\n });\n\n // Return a wrapped version of useState's setter function that persists the new value to localStorage\n const setValue = useCallback(\n (value: T | ((val: T) => T)) => {\n try {\n // Allow value to be a function so we have same API as useState\n const valueToStore = value instanceof Function ? value(storedValue) : value;\n\n // Save state\n setStoredValue(valueToStore);\n\n // Save to localStorage\n if (typeof window !== 'undefined') {\n if (valueToStore === undefined || valueToStore === null) {\n window.localStorage.removeItem(key);\n } else {\n window.localStorage.setItem(key, JSON.stringify(valueToStore));\n }\n }\n } catch (error) {\n console.warn(`Error setting localStorage key \"${key}\":`, error);\n }\n },\n [key, storedValue],\n );\n\n return [storedValue, setValue] as const;\n}\n","import { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';\nimport React, { useMemo } from 'react';\n\nimport { useLocalStorage } from './use-local-storage';\nimport {\n WalletUiClusterContext,\n WalletUiClusterContextProviderProps,\n WalletUiClusterContextValue,\n} from './wallet-ui-cluster-context';\n\nexport function WalletUiClusterContextProvider({\n clusters,\n render,\n storageKey = '__wallet-ui:selected-cluster',\n}: WalletUiClusterContextProviderProps) {\n const [clusterId, setClusterId] = useLocalStorage(storageKey, 'solana:devnet');\n if (!clusters.length) {\n throw new Error('No clusters provided');\n }\n const cluster = useMemo<SolanaCluster>(() => {\n for (const cluster of clusters) {\n if (cluster.id === clusterId) {\n return cluster;\n }\n }\n return clusters[0];\n }, [clusterId, clusters]);\n\n const value: WalletUiClusterContextValue = {\n cluster,\n clusters,\n setCluster: (cluster: SolanaClusterId) => {\n localStorage.setItem(storageKey, cluster);\n setClusterId(cluster);\n },\n };\n\n return <WalletUiClusterContext.Provider value={value}>{render(value)}</WalletUiClusterContext.Provider>;\n}\n","import { UiWalletAccount } from '@wallet-standard/react';\nimport { handleCopyText } from '@wallet-ui/core';\nimport React from 'react';\n\nimport { useWalletUiAccount } from './use-wallet-ui-account';\nimport { useWalletUiSolanaClient } from './use-wallet-ui-solana-client';\nimport { useWalletUiWallets } from './use-wallet-ui-wallets';\nimport { WalletUiContext, WalletUiContextProviderProps, WalletUiContextValue } from './wallet-ui-context';\n\nexport function WalletUiContextProvider({ children, size = 'md' }: WalletUiContextProviderProps) {\n const { account, accountKeys, setAccount, wallet } = useWalletUiAccount();\n const wallets = useWalletUiWallets();\n const client = useWalletUiSolanaClient();\n const connected = Boolean(wallet && wallet?.accounts.length > 0);\n\n function connect(account: UiWalletAccount) {\n setAccount(account);\n }\n\n function disconnect() {\n setAccount(undefined);\n }\n\n function copy() {\n if (!account) {\n return;\n }\n handleCopyText(account.address);\n }\n\n const value: WalletUiContextValue = {\n account,\n accountKeys,\n client,\n connect,\n connected,\n copy,\n disconnect,\n size,\n wallet,\n wallets,\n };\n\n return <WalletUiContext.Provider value={value}>{children}</WalletUiContext.Provider>;\n}\n","import { createSolanaClient, SolanaClient } from 'gill';\nimport React, { useMemo } from 'react';\n\nimport {\n WalletUiSolanaClientContext,\n WalletUiSolanaClientContextProviderProps,\n} from './wallet-ui-solana-client-context';\n\nexport function WalletUiSolanaClientContextProvider({\n children,\n urlOrMoniker,\n}: WalletUiSolanaClientContextProviderProps) {\n return (\n <WalletUiSolanaClientContext.Provider\n value={useMemo(() => createSolanaClient({ urlOrMoniker }) as SolanaClient, [urlOrMoniker])}\n >\n {children}\n </WalletUiSolanaClientContext.Provider>\n );\n}\n","import { SolanaCluster } from '@wallet-ui/core';\nimport React from 'react';\n\nimport { WalletUiAccountContextProvider } from './wallet-ui-account-context-provider';\nimport { WalletUiClusterContextProvider } from './wallet-ui-cluster-context-provider';\nimport { WalletUiContextProviderProps } from './wallet-ui-context';\nimport { WalletUiContextProvider } from './wallet-ui-context-provider';\nimport { WalletUiSolanaClientContextProvider } from './wallet-ui-solana-client-context-provider';\n\nexport interface WalletUiConfig extends Omit<WalletUiContextProviderProps, 'children'> {\n clusterStorageKey?: string;\n clusters: SolanaCluster[];\n selectedAccountStorageKey?: string;\n}\n\nexport function createWalletUiConfig(props: WalletUiConfig): WalletUiConfig {\n return { ...props };\n}\n\nexport interface WalletUiProps {\n children: React.ReactNode;\n config: WalletUiConfig;\n}\n\nexport function WalletUi({\n children,\n config: { clusters, clusterStorageKey, selectedAccountStorageKey, ...config },\n}: WalletUiProps) {\n return (\n <React.Fragment>\n <WalletUiClusterContextProvider\n clusters={clusters}\n storageKey={clusterStorageKey}\n render={({ cluster }) => {\n return (\n <WalletUiSolanaClientContextProvider urlOrMoniker={cluster.urlOrMoniker}>\n <WalletUiAccountContextProvider storageKey={selectedAccountStorageKey}>\n <WalletUiContextProvider {...config}>{children}</WalletUiContextProvider>\n </WalletUiAccountContextProvider>\n </WalletUiSolanaClientContextProvider>\n );\n }}\n />\n </React.Fragment>\n );\n}\n","import React from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { WalletUiSize } from './types/wallet-ui-size';\n\nexport interface WalletUiButtonProps extends Omit<BaseButtonProps, 'label'> {\n size?: WalletUiSize;\n}\n\nexport function WalletUiButton({ ...props }: WalletUiButtonProps) {\n return <BaseButton {...props} label={'CLICK'} />;\n}\n","import React from 'react';\n\nimport { BaseDropdown, BaseDropdownItemType, BaseDropdownProps } from './base-dropdown';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { useBaseDropdown } from './use-base-dropdown';\nimport { useWalletUiCluster } from './use-wallet-ui-cluster';\n\nexport interface WalletUiClusterDropdownProps\n extends Omit<BaseDropdownProps, 'buttonProps' | 'dropdown' | 'items' | 'label'> {\n buttonProps?: Partial<BaseDropdownProps['buttonProps']>;\n size?: WalletUiSize;\n}\n\nexport function WalletUiClusterDropdown({ buttonProps, size = 'md', ...props }: WalletUiClusterDropdownProps) {\n const dropdown = useBaseDropdown();\n const { cluster, clusters, setCluster } = useWalletUiCluster();\n return (\n <BaseDropdown\n buttonProps={{ ...buttonProps, label: cluster.label, size: size }}\n items={clusters.map(cluster => ({\n handler: async () => {\n setCluster(cluster.id);\n await Promise.resolve();\n },\n label: cluster.label,\n type: BaseDropdownItemType.Item,\n value: cluster.id,\n }))}\n dropdown={dropdown}\n {...props}\n />\n );\n}\n","import React from 'react';\n\nimport { BaseDropdown } from './base-dropdown';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { useWalletUiDropdown } from './use-wallet-ui-dropdown';\n\nexport interface WalletUiDropdownProps {\n label?: string;\n size?: WalletUiSize;\n}\n\nexport function WalletUiDropdown({ size = 'md', ...props }: WalletUiDropdownProps) {\n const { buttonProps, items, dropdown } = useWalletUiDropdown({ size });\n return <BaseDropdown {...props} buttonProps={{ ...buttonProps, size }} items={items} dropdown={dropdown} />;\n}\n","import React from 'react';\n\nimport { BaseSvg, BaseSvgProps } from './base-svg';\n\nexport function WalletUiIconNoWallet({ size, ...props }: Omit<BaseSvgProps, 'sizes' | 'viewBox'>) {\n return (\n <BaseSvg size={size} sizes={{ lg: 125, md: 100, sm: 75 }} fill=\"none\" viewBox=\"0 0 97 96\" {...props}>\n <circle cx=\"48.5\" cy=\"48\" r=\"48\" fill=\"url(#paint0_linear_880_5115)\" fillOpacity=\"0.1\"></circle>\n <circle\n cx=\"48.5\"\n cy=\"48\"\n r=\"47\"\n stroke=\"url(#paint1_linear_880_5115)\"\n strokeOpacity=\"0.4\"\n strokeWidth=\"2\"\n ></circle>\n <g clipPath=\"url(#clip0_880_5115)\">\n <path\n d=\"M65.5769 28.1523H31.4231C27.6057 28.1523 24.5 31.258 24.5 35.0754V60.9215C24.5 64.7389 27.6057 67.8446 31.4231 67.8446H65.5769C69.3943 67.8446 72.5 64.7389 72.5 60.9215V35.0754C72.5 31.258 69.3943 28.1523 65.5769 28.1523ZM69.7308 52.1523H59.5769C57.2865 52.1523 55.4231 50.289 55.4231 47.9985C55.4231 45.708 57.2864 43.8446 59.5769 43.8446H69.7308V52.1523ZM69.7308 41.0754H59.5769C55.7595 41.0754 52.6539 44.1811 52.6539 47.9985C52.6539 51.8159 55.7595 54.9215 59.5769 54.9215H69.7308V60.9215C69.7308 63.2119 67.8674 65.0754 65.5769 65.0754H31.4231C29.1327 65.0754 27.2692 63.212 27.2692 60.9215V35.0754C27.2692 32.785 29.1326 30.9215 31.4231 30.9215H65.5769C67.8673 30.9215 69.7308 32.7849 69.7308 35.0754V41.0754Z\"\n fill=\"url(#paint2_linear_880_5115)\"\n ></path>\n <path\n d=\"M61.4231 46.6172H59.577C58.8123 46.6172 58.1924 47.2371 58.1924 48.0018C58.1924 48.7665 58.8123 49.3863 59.577 49.3863H61.4231C62.1878 49.3863 62.8077 48.7664 62.8077 48.0018C62.8077 47.2371 62.1878 46.6172 61.4231 46.6172Z\"\n fill=\"url(#paint3_linear_880_5115)\"\n ></path>\n </g>\n <defs>\n <linearGradient\n id=\"paint0_linear_880_5115\"\n x1=\"3.41664\"\n y1=\"98.0933\"\n x2=\"103.05\"\n y2=\"8.42498\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint1_linear_880_5115\"\n x1=\"3.41664\"\n y1=\"98.0933\"\n x2=\"103.05\"\n y2=\"8.42498\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint2_linear_880_5115\"\n x1=\"25.9583\"\n y1=\"68.7101\"\n x2=\"67.2337\"\n y2=\"23.7879\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint3_linear_880_5115\"\n x1=\"58.3326\"\n y1=\"49.4467\"\n x2=\"61.0002\"\n y2=\"45.4453\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <clipPath id=\"clip0_880_5115\">\n <rect width=\"48\" height=\"48\" fill=\"white\" transform=\"translate(24.5 24)\"></rect>\n </clipPath>\n </defs>\n </BaseSvg>\n );\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiSize } from './types/wallet-ui-size';\n\nexport interface WalletUiLabelProps\n extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> {\n size?: WalletUiSize;\n wallet?: Pick<UiWallet, 'name'>;\n}\n\nexport function WalletUiLabel({ className, size, wallet, ...props }: WalletUiLabelProps) {\n if (!wallet) {\n return null;\n }\n\n return (\n <span className={`wallet-ui-list-label ${size ?? 'md'} ${className ?? ''}`} {...props}>\n {wallet.name}\n </span>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiButton } from './types/wallet-ui-button';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { WalletUiIcon } from './wallet-ui-icon';\nimport { WalletUiLabel } from './wallet-ui-label';\n\nexport interface WalletUiListButtonProps extends Omit<WalletUiButton, 'onClick'> {\n select?: (wallet: UiWalletAccount) => Promise<void>;\n size?: WalletUiSize;\n wallet: UiWallet;\n}\n\nexport function WalletUiListButton({ className, select, size = 'md', wallet, ...props }: WalletUiListButtonProps) {\n const [pending, setPending] = React.useState(false);\n\n function handleSelect() {\n if (!select) {\n return;\n }\n setPending(true);\n // TODO: Add support for multiple accounts, properly handle no accounts\n const account = wallet.accounts.length > 0 ? wallet.accounts[0] : undefined;\n if (!account) {\n return;\n }\n void select(account).finally(() => setPending(false));\n }\n\n return (\n <button\n disabled={pending}\n className={`wallet-ui-list-button ${size} ${pending ? 'wallet-ui-list-button-pending' : ''} ${className ?? ''}`}\n onClick={handleSelect}\n {...props}\n >\n <WalletUiIcon className=\"wallet-ui-list-button-icon\" wallet={wallet} size={size} />\n <WalletUiLabel className=\"wallet-ui-list-button-label\" wallet={wallet} size={size} />\n </button>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiDiv } from './types/wallet-ui-div';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { WalletUiListButton } from './wallet-ui-list-button';\n\nexport interface WalletUiListProps extends WalletUiDiv {\n select?: (account: UiWalletAccount) => Promise<void>;\n size?: WalletUiSize;\n wallets: UiWallet[];\n}\n\nexport function WalletUiList({ className, select, size = 'md', wallets, ...props }: WalletUiListProps) {\n return (\n <div className={`wallet-ui-list ${size} ${className ?? ''}`} {...props}>\n {wallets.map(wallet => (\n <WalletUiListButton key={wallet.name} select={select} size={size} wallet={wallet} />\n ))}\n </div>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { BaseModal, BaseModalProps } from './base-modal';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { WalletUiList } from './wallet-ui-list';\n\nexport interface WalletUiModalProps extends Omit<BaseModalProps, 'children'> {\n select: (account: UiWalletAccount) => Promise<void>;\n size?: WalletUiSize;\n wallets: UiWallet[];\n}\n\nexport function WalletUiModal({ size = 'md', wallets, select, ...props }: WalletUiModalProps) {\n return (\n <BaseModal description=\"Connect a wallet on Solana to continue\" size={size} {...props}>\n <WalletUiList size={size} wallets={wallets} select={select} />\n </BaseModal>\n );\n}\n","import React from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { BaseModalControl } from './use-base-modal';\n\nexport interface WalletUiModalTriggerProps extends Omit<BaseButtonProps, 'label'> {\n label?: string;\n modal: BaseModalControl;\n}\n\nexport function WalletUiModalTrigger({ label = 'Select Wallet', modal, ...props }: WalletUiModalTriggerProps) {\n return <BaseButton label={label} onClick={() => void modal.open()} {...props} />;\n}\n"]}
1
+ {"version":3,"sources":["../src/base-button.tsx","../src/wallet-ui-context.tsx","../src/use-wallet-ui.tsx","../src/wallet-ui-account-context.tsx","../src/use-wallet-ui-account.tsx","../src/use-wallet-ui-wallet.tsx","../src/base-dropdown.tsx","../src/base-svg.tsx","../src/wallet-ui-icon-close.tsx","../src/base-modal.tsx","../src/use-base-dropdown.tsx","../src/use-base-modal.tsx","../src/wallet-ui-cluster-context.tsx","../src/use-wallet-ui-cluster.tsx","../src/wallet-ui-icon.tsx","../src/use-wallet-ui-dropdown.tsx","../src/wallet-ui-solana-client-context.tsx","../src/use-wallet-ui-solana-client.tsx","../src/use-wallet-ui-wallets.tsx","../src/wallet-ui-account-context-provider.tsx","../src/wallet-ui-cluster-context-provider.tsx","../src/wallet-ui-context-provider.tsx","../src/wallet-ui-solana-client-context-provider.tsx","../src/wallet-ui.tsx","../src/wallet-ui-button.tsx","../src/wallet-ui-cluster-dropdown.tsx","../src/wallet-ui-dropdown.tsx","../src/wallet-ui-icon-no-wallet.tsx","../src/wallet-ui-label.tsx","../src/wallet-ui-list-button.tsx","../src/wallet-ui-list.tsx","../src/wallet-ui-modal.tsx","../src/wallet-ui-modal-trigger.tsx"],"names":["React","createContext","useContext","connect","useConnect","useDisconnect","useEffect","BaseDropdownItemType","Portal","useMachine","menu","useId","normalizeProps","dialog","useMemo","useWallets","createStorageAccount","useStore","useState","getUiWalletAccountStorageKey","uiWalletAccountsAreSame","uiWalletAccountBelongsToUiWallet","createStorageCluster","clusterId","cluster","account","handleCopyText","createSolanaClient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,KAAO,EAAA,WAAA,EAAa,SAAS,YAAc,EAAA,IAAA,EAAM,GAAG,KAAA,EAA0B,EAAA;AAClH,EAAA,uBACKA,wBAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAO,SAAW,EAAA,CAAA,sBAAA,EAAyB,IAAQ,IAAA,IAAI,CAAI,CAAA,EAAA,SAAA,IAAa,EAAE,CAAA,CAAA,EAAI,OAAmB,EAAA,GAAG,KAChG,EAAA,EAAA,WAAA,mBAAeA,wBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAK,SAAU,EAAA,oCAAA,EAAA,EAAsC,WAAY,CAAA,GAAU,IAC1F,EAAA,KAAA,EACA,YAAe,mBAAAA,wBAAA,CAAA,aAAA,CAAC,MAAK,EAAA,EAAA,SAAA,EAAU,qCAAuC,EAAA,EAAA,YAAa,IAAU,IAClG,CAAA;AAER;ACQO,IAAM,eAAkBA,GAAAA,wBAAAA,CAAM,aAAoC,CAAA,EAA0B;;;ACzB5F,SAAS,WAAc,GAAA;AAC1B,EAAOA,OAAAA,wBAAAA,CAAM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ACTO,SAAS,qBAAqB,EAAE,KAAA,GAAQ,iBAAiB,KAAO,EAAA,GAAG,OAAoC,EAAA;AAC1G,EAAA,uBAAOA,wBAAAA,CAAA,aAAC,CAAA,UAAA,EAAA,EAAW,KAAc,EAAA,OAAA,EAAS,MAAM,KAAK,KAAM,CAAA,IAAA,EAAS,EAAA,GAAG,KAAO,EAAA,CAAA;AAClF","file":"index.node.cjs","sourcesContent":["import React from 'react';\n\nimport { WalletUiButton } from './types/wallet-ui-button';\nimport { WalletUiSize } from './types/wallet-ui-size';\n\nexport interface BaseButtonProps extends Omit<WalletUiButton, 'children'> {\n label: React.ReactNode;\n leftSection?: React.ReactNode;\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n rightSection?: React.ReactNode;\n size?: WalletUiSize;\n}\n\nexport function BaseButton({ className, label, leftSection, onClick, rightSection, size, ...props }: BaseButtonProps) {\n return (\n <button className={`wallet-ui-base-button ${size ?? 'md'} ${className ?? ''}`} onClick={onClick} {...props}>\n {leftSection ? <span className=\"wallet-ui-base-button-left-section\">{leftSection}</span> : null}\n {label}\n {rightSection ? <span className=\"wallet-ui-base-button-right-section\">{rightSection}</span> : null}\n </button>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport { SolanaClient } from 'gill';\nimport React, { ReactNode } from 'react';\n\nimport { WalletUiSize } from './types/wallet-ui-size';\n\nexport interface WalletUiContextProviderProps {\n children: ReactNode;\n size?: WalletUiSize;\n}\n\nexport interface WalletUiContextValue {\n account?: UiWalletAccount;\n accountKeys: string[];\n client: SolanaClient;\n connect: (wallet: UiWalletAccount) => void;\n connected: boolean;\n copy: () => void;\n disconnect: () => void;\n size: WalletUiSize;\n wallet?: UiWallet;\n wallets: UiWallet[];\n}\n\nexport interface WalletUiContextProviderProps {\n children: ReactNode;\n size?: WalletUiSize;\n}\n\nexport const WalletUiContext = React.createContext<WalletUiContextValue>({} as WalletUiContextValue);\n","import React from 'react';\n\nimport { WalletUiContext } from './wallet-ui-context';\n\nexport function useWalletUi() {\n return React.useContext(WalletUiContext);\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React, { createContext } from 'react';\n\nexport interface WalletUiAccountInfo {\n account: UiWalletAccount;\n accountKeys: string[];\n wallet: UiWallet | undefined;\n}\n\nexport interface WalletUiAccountState extends Omit<WalletUiAccountInfo, 'account'> {\n account: UiWalletAccount | undefined;\n setAccount: React.Dispatch<React.SetStateAction<UiWalletAccount | undefined>>;\n}\n\nexport const WalletUiAccountContext = createContext<WalletUiAccountState>({} as WalletUiAccountState);\n","import { useContext } from 'react';\n\nimport { WalletUiAccountContext } from './wallet-ui-account-context';\n\nexport function useWalletUiAccount() {\n return useContext(WalletUiAccountContext);\n}\n","import { UiWallet, useConnect, useDisconnect } from '@wallet-standard/react';\nimport { useEffect } from 'react';\n\nimport { useWalletUi } from './use-wallet-ui';\nimport { useWalletUiAccount } from './use-wallet-ui-account';\n\nexport function useWalletUiWallet({ wallet }: { wallet: UiWallet }) {\n const { connect: connectAccount } = useWalletUi();\n const { setAccount } = useWalletUiAccount();\n const [isConnecting, connect] = useConnect(wallet);\n const [isDisconnecting, disconnect] = useDisconnect(wallet);\n useEffect(() => {}, [isDisconnecting]);\n\n return {\n connect: async () => {\n const connectedAccount = await connect();\n console.log('connectedAccount', connectedAccount);\n if (!connectedAccount.length) {\n console.log('connect, no accounts');\n return connectedAccount;\n }\n const first = connectedAccount[0];\n console.log('connect, setting first account => ', first);\n setAccount(first);\n connectAccount(first);\n return connectedAccount;\n },\n disconnect,\n isConnecting,\n isDisconnecting,\n };\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React, { HTMLAttributes } from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { BaseDropdownControl } from './use-base-dropdown';\nimport { useWalletUiWallet } from './use-wallet-ui-wallet';\n\nexport enum BaseDropdownItemType {\n Item = 'Item',\n WalletConnect = 'WalletConnect',\n WalletCopy = 'WalletCopy',\n WalletDisconnect = 'WalletDisconnect',\n WalletNeeded = 'WalletNeeded',\n}\n\nexport interface BaseDropdownItem {\n closeMenu?: boolean;\n disabled?: boolean;\n handler: () => Promise<void>;\n label: string;\n leftSection?: React.ReactNode;\n rightSection?: React.ReactNode;\n type: BaseDropdownItemType;\n value: string;\n wallet?: UiWallet;\n}\n\nexport interface BaseDropdownProps {\n buttonProps: BaseButtonProps;\n dropdown: BaseDropdownControl;\n items: BaseDropdownItem[];\n showIndicator?: boolean;\n}\n\nexport function BaseDropdown({ buttonProps, dropdown, showIndicator, items }: BaseDropdownProps) {\n const api = dropdown.api;\n const trigger = (\n <BaseButton\n {...api.getTriggerProps()}\n className={`wallet-ui-base-dropdown-trigger`}\n data-part=\"trigger\"\n rightSection={\n showIndicator ? (\n <span className=\"wallet-actions\">\n <span {...api.getIndicatorProps()} className=\"indicator\">\n <BaseDropdownChevronDown size={12} />\n </span>\n </span>\n ) : null\n }\n {...buttonProps}\n />\n );\n\n return (\n <div className=\"wallet-ui-base-dropdown\">\n {trigger}\n <div {...api.getPositionerProps()} className=\"wallet-positioner\">\n <div {...api.getContentProps()} className=\"wallet-ui-base-dropdown-list\" data-part=\"content\">\n {items.map(item => {\n return (\n <BaseDropdownItem\n {...api.getItemProps({ value: item.value })}\n key={item.value}\n item={item}\n afterClick={() => {\n if (item.disabled) {\n return;\n }\n if (item.closeMenu !== false) {\n dropdown.close();\n }\n }}\n />\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n\nfunction BaseDropdownItem({ afterClick, item }: BaseDropdownItemRenderProps) {\n if (!item.wallet) {\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n }\n switch (item.type) {\n case BaseDropdownItemType.Item:\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n case BaseDropdownItemType.WalletConnect:\n return <BaseDropdownItemWalletConnect afterClick={afterClick} item={item} wallet={item.wallet} />;\n case BaseDropdownItemType.WalletCopy:\n return <BaseDropdownItemRender afterClick={afterClick} item={item} />;\n case BaseDropdownItemType.WalletDisconnect:\n return <BaseDropdownItemWalletDisconnect afterClick={afterClick} item={item} wallet={item.wallet} />;\n }\n}\n\nfunction BaseDropdownItemWalletConnect({\n afterClick,\n item,\n wallet,\n}: BaseDropdownItemRenderProps & {\n wallet: UiWallet;\n}) {\n const { connect } = useWalletUiWallet({ wallet });\n return (\n <BaseDropdownItemRender\n afterClick={afterClick}\n item={{\n ...item,\n handler: async () => {\n //\n await connect();\n return await item.handler();\n },\n }}\n />\n );\n}\n\nfunction BaseDropdownItemWalletDisconnect({\n afterClick,\n item,\n wallet,\n}: BaseDropdownItemRenderProps & {\n wallet: UiWallet;\n}) {\n const { disconnect } = useWalletUiWallet({ wallet });\n return (\n <BaseDropdownItemRender\n afterClick={afterClick}\n item={{\n ...item,\n handler: async () => {\n //\n await disconnect();\n return await item.handler();\n },\n }}\n />\n );\n}\n\ninterface BaseDropdownItemRenderProps {\n afterClick: () => void;\n item: BaseDropdownItem;\n}\n\nfunction BaseDropdownItemRender({ afterClick, item }: BaseDropdownItemRenderProps) {\n function onClick() {\n if (item.disabled) {\n return;\n }\n void item.handler().then(() => {\n afterClick();\n });\n }\n\n return (\n <div className=\"wallet-ui-base-dropdown-item\" data-part=\"item\" onClick={onClick}>\n {item.leftSection ? (\n <span className=\"wallet-ui-base-dropdown-item-left-section\">{item.leftSection}</span>\n ) : null}\n {item.label}\n {item.rightSection ? (\n <span className=\"wallet-ui-base-dropdown-item-right-section\">{item.rightSection}</span>\n ) : null}\n </div>\n );\n}\n\nexport function BaseDropdownChevronDown(props: HTMLAttributes<SVGElement> & { size?: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={props.size ?? 24}\n height={props.size ?? 24}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n","import React from 'react';\n\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { WalletUiSvg } from './types/wallet-ui-svg';\n\nexport interface BaseSvgProps extends WalletUiSvg {\n size: WalletUiSize;\n sizes: { [key: string]: number };\n viewBox: string;\n}\n\nexport function BaseSvg({ sizes = {}, ...props }: BaseSvgProps) {\n const size = props.size ? sizes[props.size] : 12;\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={size} height={size} {...props}>\n {props.children}\n </svg>\n );\n}\n","import React from 'react';\n\nimport { BaseSvg, BaseSvgProps } from './base-svg';\n\nexport function WalletUiIconClose({ size = 'md', ...props }: Omit<BaseSvgProps, 'sizes' | 'viewBox'>) {\n return (\n <BaseSvg\n size={size}\n sizes={{ lg: 16, md: 12, sm: 8 }}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n viewBox=\"0 0 14 14\"\n {...props}\n >\n <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\"></path>\n </BaseSvg>\n );\n}\n","import { Portal } from '@zag-js/react';\nimport React from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { BaseModalControl } from './use-base-modal';\nimport { WalletUiIconClose } from './wallet-ui-icon-close';\n\nexport interface BaseModalProps {\n buttonLabel?: React.ReactNode;\n buttonProps?: Partial<BaseButtonProps>;\n children: React.ReactNode;\n description?: React.ReactNode;\n modal: BaseModalControl;\n size?: WalletUiSize;\n title?: React.ReactNode;\n}\n\nexport function BaseModal({ modal, buttonLabel, buttonProps = {}, size = 'md', ...props }: BaseModalProps) {\n const api = modal.api;\n return (\n <>\n {buttonLabel ? (\n <BaseButton label={buttonLabel} size={size} {...buttonProps} {...api.getTriggerProps()} />\n ) : null}\n {api.open && (\n <Portal>\n <div {...api.getBackdropProps()} />\n <div {...api.getPositionerProps()}>\n <div {...api.getContentProps()} className={size}>\n <header>\n <button {...api.getCloseTriggerProps()}>\n <WalletUiIconClose size={size} />\n </button>\n </header>\n {props.description ? <p {...api.getDescriptionProps()}>{props.description}</p> : null}\n <main>{props.children}</main>\n </div>\n </div>\n </Portal>\n )}\n </>\n );\n}\n","import * as menu from '@zag-js/menu';\nimport { normalizeProps, useMachine } from '@zag-js/react';\nimport { useId } from 'react';\n\nexport type BaseDropdownApi = ReturnType<typeof menu.connect>;\n\nexport interface BaseDropdownControl {\n api: BaseDropdownApi;\n close: () => void;\n open: () => void;\n}\n\nexport function useBaseDropdown(): BaseDropdownControl {\n const service = useMachine(menu.machine, { id: useId() });\n const api = menu.connect(service, normalizeProps);\n\n return {\n api,\n close: () => service.send({ type: 'CLOSE' }),\n open: () => service.send({ type: 'OPEN' }),\n };\n}\n","import * as dialog from '@zag-js/dialog';\nimport { normalizeProps, useMachine } from '@zag-js/react';\nimport { useId } from 'react';\n\nexport type BaseModalApi = ReturnType<typeof dialog.connect>;\n\nexport interface BaseModalControl {\n api: BaseModalApi;\n close: () => void;\n open: () => void;\n}\n\nexport function useBaseModal(): BaseModalControl {\n const service = useMachine(dialog.machine, { id: useId(), modal: true });\n const api = dialog.connect(service, normalizeProps);\n\n return {\n api,\n close: () => service.send({ type: 'CLOSE' }),\n open: () => service.send({ type: 'OPEN' }),\n };\n}\n","import { SolanaCluster, SolanaClusterId, StorageCluster } from '@wallet-ui/core';\nimport { createContext, ReactNode } from 'react';\n\nexport interface WalletUiClusterContextProviderProps {\n clusters: SolanaCluster[];\n render: (props: WalletUiClusterContextValue) => ReactNode;\n storage?: StorageCluster;\n}\n\nexport interface WalletUiClusterContextValue {\n cluster: SolanaCluster;\n clusters: SolanaCluster[];\n\n setCluster(cluster: SolanaClusterId): void;\n}\n\nexport const WalletUiClusterContext = createContext<WalletUiClusterContextValue>({} as WalletUiClusterContextValue);\n","import { useContext } from 'react';\n\nimport { WalletUiClusterContext } from './wallet-ui-cluster-context';\n\nexport function useWalletUiCluster() {\n return useContext(WalletUiClusterContext);\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiImg } from './types/wallet-ui-img';\nimport { WalletUiSize } from './types/wallet-ui-size';\n\nexport interface WalletUiIconProps extends WalletUiImg {\n size?: WalletUiSize;\n wallet?: Pick<UiWallet, 'icon' | 'name'>;\n}\n\nexport function WalletUiIcon({ className, size, wallet, ...props }: WalletUiIconProps) {\n if (!wallet) {\n return null;\n }\n\n return (\n <img\n src={wallet.icon}\n alt={wallet.name}\n className={`wallet-ui-list-icon ${size ?? 'md'} ${className ?? ''}`}\n {...props}\n />\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React, { useMemo } from 'react';\n\nimport { BaseButtonProps } from './base-button';\nimport { BaseDropdownItem, BaseDropdownItemType } from './base-dropdown';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { BaseDropdownControl, useBaseDropdown } from './use-base-dropdown';\nimport { useWalletUi } from './use-wallet-ui';\nimport { WalletUiIcon } from './wallet-ui-icon';\n\nfunction getDropdownItemsWallets({\n wallets,\n connect,\n size,\n}: {\n connect: (wallet: UiWalletAccount) => void;\n size: WalletUiSize;\n wallets: UiWallet[];\n}): BaseDropdownItem[] {\n return wallets.length\n ? wallets.map(wallet => ({\n handler: async () => {\n // TODO: Add support for multiple accounts, properly handle no accounts\n const account = wallet.accounts.length > 0 ? wallet.accounts[0] : undefined;\n if (!account) {\n return;\n }\n connect(account);\n await Promise.resolve();\n },\n label: wallet.name,\n leftSection: <WalletUiIcon wallet={wallet} size={size} />,\n type: BaseDropdownItemType.WalletConnect,\n value: wallet.name,\n wallet,\n }))\n : [\n {\n handler: async () => {\n window.open('https://solana.com/solana-wallets', '_blank');\n await Promise.resolve();\n },\n label: \"You'll need a wallet on Solana to continue\",\n type: BaseDropdownItemType.WalletNeeded,\n value: 'no-wallets',\n },\n ];\n}\n\nexport function useWalletUiDropdown({ size = 'md' }: { size?: WalletUiSize } = {}): {\n buttonProps: BaseButtonProps;\n connected: boolean;\n dropdown: BaseDropdownControl;\n items: BaseDropdownItem[];\n} {\n const dropdown = useBaseDropdown();\n\n const { account, connect, copy, disconnect, connected, wallet, wallets } = useWalletUi();\n\n const itemsWallets = useMemo(() => {\n return getDropdownItemsWallets({ connect, size, wallets });\n }, [wallets, size, connect]);\n\n const itemsConnected: BaseDropdownItem[] = useMemo(\n () => [\n {\n handler: async () => {\n copy();\n void (await Promise.resolve());\n },\n label: 'Copy Address',\n type: BaseDropdownItemType.WalletCopy,\n value: 'copy',\n },\n {\n handler: async () => {\n disconnect();\n dropdown.close();\n await Promise.resolve();\n },\n label: 'Disconnect',\n type: BaseDropdownItemType.WalletDisconnect,\n value: 'disconnect',\n },\n ...itemsWallets,\n ],\n [connect, copy, disconnect, dropdown, size, wallets],\n );\n const items = useMemo(() => {\n return connected ? itemsConnected : itemsWallets;\n }, [connected, itemsConnected, itemsWallets]);\n\n const buttonProps: BaseButtonProps = useMemo(() => {\n return {\n label: connected ? ((account ? ellipsify(account.address) : wallet?.name) ?? 'Connected') : 'Select Wallet',\n leftSection: connected ? <WalletUiIcon size={size} wallet={wallet} /> : undefined,\n };\n }, [account, connected, size, wallet]);\n\n return {\n buttonProps,\n connected,\n dropdown,\n items,\n };\n}\n\nexport function ellipsify(str = '', len = 4, delimiter = '..') {\n const strLen = str.length;\n const limit = len * 2 + delimiter.length;\n\n return strLen >= limit ? str.substring(0, len) + delimiter + str.substring(strLen - len, strLen) : str;\n}\n","import { SolanaClient, SolanaClientUrlOrMoniker } from 'gill';\nimport { createContext, ReactNode } from 'react';\n\nexport interface WalletUiSolanaClientContextProviderProps {\n children: ReactNode;\n urlOrMoniker: SolanaClientUrlOrMoniker;\n}\n\nexport const WalletUiSolanaClientContext = createContext<SolanaClient>({} as SolanaClient);\n","import { useContext } from 'react';\n\nimport { WalletUiSolanaClientContext } from './wallet-ui-solana-client-context';\n\nexport function useWalletUiSolanaClient() {\n return useContext(WalletUiSolanaClientContext);\n}\n","import { useWallets } from '@wallet-standard/react';\nimport { useMemo } from 'react';\n\nexport function useWalletUiWallets() {\n const readonlyWallets = useWallets();\n return useMemo(\n () =>\n readonlyWallets\n .filter(wallet => wallet.chains.some(i => i.startsWith('solana:')))\n .sort((a, b) => a.name.localeCompare(b.name)),\n [readonlyWallets],\n );\n}\n","import { useStore } from '@nanostores/react';\nimport {\n getUiWalletAccountStorageKey,\n UiWallet,\n UiWalletAccount,\n uiWalletAccountBelongsToUiWallet,\n uiWalletAccountsAreSame,\n useWallets,\n} from '@wallet-standard/react';\nimport { createStorageAccount, StorageAccount } from '@wallet-ui/core';\nimport React, { useEffect, useMemo, useState } from 'react';\n\nimport { useWalletUiCluster } from './use-wallet-ui-cluster';\nimport { WalletUiAccountContext } from './wallet-ui-account-context';\n\nlet wasSetterInvoked = false;\n\nfunction getSavedWalletAccount(\n wallets: readonly UiWallet[],\n savedWalletNameAndAddress?: string,\n): UiWalletAccount | undefined {\n if (wasSetterInvoked) {\n // After the user makes an explicit choice of wallet, stop trying to auto-select the\n // saved wallet, if and when it appears.\n return;\n }\n if (!savedWalletNameAndAddress || typeof savedWalletNameAndAddress !== 'string') {\n return;\n }\n const [savedWalletName, savedAccountAddress] = savedWalletNameAndAddress.split(':');\n if (!savedWalletName || !savedAccountAddress) {\n return;\n }\n const wallet = wallets.find(w => w.name === savedWalletName);\n if (!wallet) {\n return;\n }\n return wallet.accounts.find(a => a.address === savedAccountAddress);\n}\n\n/**\n * Saves the selected wallet account's storage key to the browser's local storage. In future\n * sessions it will try to return that same wallet account, or at least one from the same brand of\n * wallet if the wallet from which it came is still in the Wallet Standard registry.\n */\nexport function WalletUiAccountContextProvider({\n children,\n storage = createStorageAccount(),\n}: {\n children: React.ReactNode;\n storage?: StorageAccount;\n}) {\n const { cluster } = useWalletUiCluster();\n const wallets = useWallets();\n const accountId = useStore(storage.value);\n const [account, setAccountInternal] = useState<UiWalletAccount | undefined>(() =>\n getSavedWalletAccount(wallets, accountId),\n );\n\n function setAccount(setStateAction: React.SetStateAction<UiWalletAccount | undefined>) {\n setAccountInternal(prevAccount => {\n wasSetterInvoked = true;\n const nextWalletAccount =\n typeof setStateAction === 'function' ? setStateAction(prevAccount) : setStateAction;\n const accountKey = nextWalletAccount ? getUiWalletAccountStorageKey(nextWalletAccount) : undefined;\n storage.set(accountKey ? accountKey : undefined);\n return nextWalletAccount;\n });\n }\n\n useEffect(() => {\n const savedWalletAccount = getSavedWalletAccount(wallets, accountId);\n if (savedWalletAccount) {\n setAccountInternal(savedWalletAccount);\n }\n }, [accountId, wallets]);\n const walletAccount = useMemo(() => {\n if (account) {\n for (const uiWallet of wallets) {\n for (const uiWalletAccount of uiWallet.accounts) {\n if (uiWalletAccountsAreSame(account, uiWalletAccount)) {\n return uiWalletAccount;\n }\n }\n if (uiWalletAccountBelongsToUiWallet(account, uiWallet) && uiWallet.accounts[0]) {\n // If the selected account belongs to this connected wallet, at least, then\n // select one of its accounts.\n return uiWallet.accounts[0];\n }\n }\n }\n }, [account, wallets]);\n useEffect(() => {\n // If there is a selected wallet account but the wallet to which it belongs has since\n // disconnected, clear the selected wallet.\n if (account && !walletAccount) {\n setAccountInternal(undefined);\n }\n }, [account, walletAccount]);\n\n const wallet = useMemo(() => {\n if (!walletAccount) {\n return undefined;\n }\n for (const uiWallet of wallets) {\n for (const uiWalletAccount of uiWallet.accounts) {\n if (uiWalletAccountsAreSame(walletAccount, uiWalletAccount)) {\n return uiWallet;\n }\n }\n if (uiWalletAccountBelongsToUiWallet(walletAccount, uiWallet) && uiWallet.accounts[0]) {\n // If the selected account belongs to this connected wallet, at least, then\n // select one of its accounts.\n return uiWallet;\n }\n }\n }, [walletAccount, wallets]);\n\n // Expose the error boundary reset keys to the context\n const accountKeys = useMemo(() => {\n if (!account) {\n return [];\n }\n return [cluster.id, getUiWalletAccountStorageKey(account)].filter(Boolean);\n }, [account, cluster.id]);\n return (\n <WalletUiAccountContext.Provider\n value={useMemo(\n () => ({\n account: walletAccount,\n accountKeys,\n setAccount,\n wallet,\n }),\n [walletAccount, wallet, accountKeys],\n )}\n >\n {children}\n </WalletUiAccountContext.Provider>\n );\n}\n","import { useStore } from '@nanostores/react';\nimport { createStorageCluster, SolanaClusterId } from '@wallet-ui/core';\nimport React from 'react';\n\nimport {\n WalletUiClusterContext,\n WalletUiClusterContextProviderProps,\n WalletUiClusterContextValue,\n} from './wallet-ui-cluster-context';\n\nexport function WalletUiClusterContextProvider({\n clusters,\n render,\n storage = createStorageCluster(),\n}: WalletUiClusterContextProviderProps) {\n const clusterId = useStore(storage.value);\n if (!clusterId) {\n throw new Error('Error reading cluster id from storage');\n }\n if (!clusters.length) {\n throw new Error('No clusters provided');\n }\n\n const cluster = clusters.find(c => c.id === clusterId);\n if (!cluster) {\n throw new Error(`Cluster ${clusterId.toString()} not found`);\n }\n\n const value: WalletUiClusterContextValue = {\n cluster,\n clusters,\n setCluster: (clusterId: SolanaClusterId) => {\n const cluster = clusters.find(c => c.id === clusterId);\n if (!cluster) {\n throw new Error(`Cluster ${clusterId} not found`);\n }\n storage.set(clusterId);\n },\n };\n\n return <WalletUiClusterContext.Provider value={value}>{render(value)}</WalletUiClusterContext.Provider>;\n}\n","import { UiWalletAccount } from '@wallet-standard/react';\nimport { handleCopyText } from '@wallet-ui/core';\nimport React from 'react';\n\nimport { useWalletUiAccount } from './use-wallet-ui-account';\nimport { useWalletUiSolanaClient } from './use-wallet-ui-solana-client';\nimport { useWalletUiWallets } from './use-wallet-ui-wallets';\nimport { WalletUiContext, WalletUiContextProviderProps, WalletUiContextValue } from './wallet-ui-context';\n\nexport function WalletUiContextProvider({ children, size = 'md' }: WalletUiContextProviderProps) {\n const { account, accountKeys, setAccount, wallet } = useWalletUiAccount();\n const wallets = useWalletUiWallets();\n const client = useWalletUiSolanaClient();\n const connected = Boolean(wallet && wallet?.accounts.length > 0);\n\n function connect(account: UiWalletAccount) {\n setAccount(account);\n }\n\n function disconnect() {\n setAccount(undefined);\n }\n\n function copy() {\n if (!account) {\n return;\n }\n handleCopyText(account.address);\n }\n\n const value: WalletUiContextValue = {\n account,\n accountKeys,\n client,\n connect,\n connected,\n copy,\n disconnect,\n size,\n wallet,\n wallets,\n };\n\n return <WalletUiContext.Provider value={value}>{children}</WalletUiContext.Provider>;\n}\n","import { createSolanaClient, SolanaClient } from 'gill';\nimport React, { useMemo } from 'react';\n\nimport {\n WalletUiSolanaClientContext,\n WalletUiSolanaClientContextProviderProps,\n} from './wallet-ui-solana-client-context';\n\nexport function WalletUiSolanaClientContextProvider({\n children,\n urlOrMoniker,\n}: WalletUiSolanaClientContextProviderProps) {\n return (\n <WalletUiSolanaClientContext.Provider\n value={useMemo(() => createSolanaClient({ urlOrMoniker }) as SolanaClient, [urlOrMoniker])}\n >\n {children}\n </WalletUiSolanaClientContext.Provider>\n );\n}\n","import { SolanaCluster, StorageAccount, StorageCluster } from '@wallet-ui/core';\nimport React from 'react';\n\nimport { WalletUiAccountContextProvider } from './wallet-ui-account-context-provider';\nimport { WalletUiClusterContextProvider } from './wallet-ui-cluster-context-provider';\nimport { WalletUiContextProviderProps } from './wallet-ui-context';\nimport { WalletUiContextProvider } from './wallet-ui-context-provider';\nimport { WalletUiSolanaClientContextProvider } from './wallet-ui-solana-client-context-provider';\n\nexport interface WalletUiConfig extends Omit<WalletUiContextProviderProps, 'children'> {\n accountStorage?: StorageAccount;\n clusterStorage?: StorageCluster;\n clusters: SolanaCluster[];\n}\n\nexport function createWalletUiConfig(props: WalletUiConfig): WalletUiConfig {\n return { ...props };\n}\n\nexport interface WalletUiProps {\n children: React.ReactNode;\n config: WalletUiConfig;\n}\n\nexport function WalletUi({ children, config: { accountStorage, clusters, clusterStorage, ...config } }: WalletUiProps) {\n return (\n <React.Fragment>\n <WalletUiClusterContextProvider\n clusters={clusters}\n storage={clusterStorage}\n render={({ cluster }) => {\n return (\n <WalletUiSolanaClientContextProvider urlOrMoniker={cluster.urlOrMoniker}>\n <WalletUiAccountContextProvider storage={accountStorage}>\n <WalletUiContextProvider {...config}>{children}</WalletUiContextProvider>\n </WalletUiAccountContextProvider>\n </WalletUiSolanaClientContextProvider>\n );\n }}\n />\n </React.Fragment>\n );\n}\n","import React from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { WalletUiSize } from './types/wallet-ui-size';\n\nexport interface WalletUiButtonProps extends Omit<BaseButtonProps, 'label'> {\n size?: WalletUiSize;\n}\n\nexport function WalletUiButton({ ...props }: WalletUiButtonProps) {\n return <BaseButton {...props} label={'CLICK'} />;\n}\n","import React from 'react';\n\nimport { BaseDropdown, BaseDropdownItemType, BaseDropdownProps } from './base-dropdown';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { useBaseDropdown } from './use-base-dropdown';\nimport { useWalletUiCluster } from './use-wallet-ui-cluster';\n\nexport interface WalletUiClusterDropdownProps\n extends Omit<BaseDropdownProps, 'buttonProps' | 'dropdown' | 'items' | 'label'> {\n buttonProps?: Partial<BaseDropdownProps['buttonProps']>;\n size?: WalletUiSize;\n}\n\nexport function WalletUiClusterDropdown({ buttonProps, size = 'md', ...props }: WalletUiClusterDropdownProps) {\n const dropdown = useBaseDropdown();\n const { cluster, clusters, setCluster } = useWalletUiCluster();\n return (\n <BaseDropdown\n buttonProps={{ ...buttonProps, label: cluster.label, size: size }}\n items={clusters.map(cluster => ({\n handler: async () => {\n setCluster(cluster.id);\n await Promise.resolve();\n },\n label: cluster.label,\n type: BaseDropdownItemType.Item,\n value: cluster.id,\n }))}\n dropdown={dropdown}\n {...props}\n />\n );\n}\n","import React from 'react';\n\nimport { BaseDropdown } from './base-dropdown';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { useWalletUiDropdown } from './use-wallet-ui-dropdown';\n\nexport interface WalletUiDropdownProps {\n label?: string;\n size?: WalletUiSize;\n}\n\nexport function WalletUiDropdown({ size = 'md', ...props }: WalletUiDropdownProps) {\n const { buttonProps, items, dropdown } = useWalletUiDropdown({ size });\n return <BaseDropdown {...props} buttonProps={{ ...buttonProps, size }} items={items} dropdown={dropdown} />;\n}\n","import React from 'react';\n\nimport { BaseSvg, BaseSvgProps } from './base-svg';\n\nexport function WalletUiIconNoWallet({ size, ...props }: Omit<BaseSvgProps, 'sizes' | 'viewBox'>) {\n return (\n <BaseSvg size={size} sizes={{ lg: 125, md: 100, sm: 75 }} fill=\"none\" viewBox=\"0 0 97 96\" {...props}>\n <circle cx=\"48.5\" cy=\"48\" r=\"48\" fill=\"url(#paint0_linear_880_5115)\" fillOpacity=\"0.1\"></circle>\n <circle\n cx=\"48.5\"\n cy=\"48\"\n r=\"47\"\n stroke=\"url(#paint1_linear_880_5115)\"\n strokeOpacity=\"0.4\"\n strokeWidth=\"2\"\n ></circle>\n <g clipPath=\"url(#clip0_880_5115)\">\n <path\n d=\"M65.5769 28.1523H31.4231C27.6057 28.1523 24.5 31.258 24.5 35.0754V60.9215C24.5 64.7389 27.6057 67.8446 31.4231 67.8446H65.5769C69.3943 67.8446 72.5 64.7389 72.5 60.9215V35.0754C72.5 31.258 69.3943 28.1523 65.5769 28.1523ZM69.7308 52.1523H59.5769C57.2865 52.1523 55.4231 50.289 55.4231 47.9985C55.4231 45.708 57.2864 43.8446 59.5769 43.8446H69.7308V52.1523ZM69.7308 41.0754H59.5769C55.7595 41.0754 52.6539 44.1811 52.6539 47.9985C52.6539 51.8159 55.7595 54.9215 59.5769 54.9215H69.7308V60.9215C69.7308 63.2119 67.8674 65.0754 65.5769 65.0754H31.4231C29.1327 65.0754 27.2692 63.212 27.2692 60.9215V35.0754C27.2692 32.785 29.1326 30.9215 31.4231 30.9215H65.5769C67.8673 30.9215 69.7308 32.7849 69.7308 35.0754V41.0754Z\"\n fill=\"url(#paint2_linear_880_5115)\"\n ></path>\n <path\n d=\"M61.4231 46.6172H59.577C58.8123 46.6172 58.1924 47.2371 58.1924 48.0018C58.1924 48.7665 58.8123 49.3863 59.577 49.3863H61.4231C62.1878 49.3863 62.8077 48.7664 62.8077 48.0018C62.8077 47.2371 62.1878 46.6172 61.4231 46.6172Z\"\n fill=\"url(#paint3_linear_880_5115)\"\n ></path>\n </g>\n <defs>\n <linearGradient\n id=\"paint0_linear_880_5115\"\n x1=\"3.41664\"\n y1=\"98.0933\"\n x2=\"103.05\"\n y2=\"8.42498\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint1_linear_880_5115\"\n x1=\"3.41664\"\n y1=\"98.0933\"\n x2=\"103.05\"\n y2=\"8.42498\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint2_linear_880_5115\"\n x1=\"25.9583\"\n y1=\"68.7101\"\n x2=\"67.2337\"\n y2=\"23.7879\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <linearGradient\n id=\"paint3_linear_880_5115\"\n x1=\"58.3326\"\n y1=\"49.4467\"\n x2=\"61.0002\"\n y2=\"45.4453\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#9945FF\"></stop>\n <stop offset=\"0.14\" stopColor=\"#8A53F4\"></stop>\n <stop offset=\"0.42\" stopColor=\"#6377D6\"></stop>\n <stop offset=\"0.79\" stopColor=\"#24B0A7\"></stop>\n <stop offset=\"0.99\" stopColor=\"#00D18C\"></stop>\n <stop offset=\"1\" stopColor=\"#00D18C\"></stop>\n </linearGradient>\n <clipPath id=\"clip0_880_5115\">\n <rect width=\"48\" height=\"48\" fill=\"white\" transform=\"translate(24.5 24)\"></rect>\n </clipPath>\n </defs>\n </BaseSvg>\n );\n}\n","import { UiWallet } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiSize } from './types/wallet-ui-size';\n\nexport interface WalletUiLabelProps\n extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> {\n size?: WalletUiSize;\n wallet?: Pick<UiWallet, 'name'>;\n}\n\nexport function WalletUiLabel({ className, size, wallet, ...props }: WalletUiLabelProps) {\n if (!wallet) {\n return null;\n }\n\n return (\n <span className={`wallet-ui-list-label ${size ?? 'md'} ${className ?? ''}`} {...props}>\n {wallet.name}\n </span>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiButton } from './types/wallet-ui-button';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { WalletUiIcon } from './wallet-ui-icon';\nimport { WalletUiLabel } from './wallet-ui-label';\n\nexport interface WalletUiListButtonProps extends Omit<WalletUiButton, 'onClick'> {\n select?: (wallet: UiWalletAccount) => Promise<void>;\n size?: WalletUiSize;\n wallet: UiWallet;\n}\n\nexport function WalletUiListButton({ className, select, size = 'md', wallet, ...props }: WalletUiListButtonProps) {\n const [pending, setPending] = React.useState(false);\n\n function handleSelect() {\n if (!select) {\n return;\n }\n setPending(true);\n // TODO: Add support for multiple accounts, properly handle no accounts\n const account = wallet.accounts.length > 0 ? wallet.accounts[0] : undefined;\n if (!account) {\n return;\n }\n void select(account).finally(() => setPending(false));\n }\n\n return (\n <button\n disabled={pending}\n className={`wallet-ui-list-button ${size} ${pending ? 'wallet-ui-list-button-pending' : ''} ${className ?? ''}`}\n onClick={handleSelect}\n {...props}\n >\n <WalletUiIcon className=\"wallet-ui-list-button-icon\" wallet={wallet} size={size} />\n <WalletUiLabel className=\"wallet-ui-list-button-label\" wallet={wallet} size={size} />\n </button>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { WalletUiDiv } from './types/wallet-ui-div';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { WalletUiListButton } from './wallet-ui-list-button';\n\nexport interface WalletUiListProps extends WalletUiDiv {\n select?: (account: UiWalletAccount) => Promise<void>;\n size?: WalletUiSize;\n wallets: UiWallet[];\n}\n\nexport function WalletUiList({ className, select, size = 'md', wallets, ...props }: WalletUiListProps) {\n return (\n <div className={`wallet-ui-list ${size} ${className ?? ''}`} {...props}>\n {wallets.map(wallet => (\n <WalletUiListButton key={wallet.name} select={select} size={size} wallet={wallet} />\n ))}\n </div>\n );\n}\n","import { UiWallet, UiWalletAccount } from '@wallet-standard/react';\nimport React from 'react';\n\nimport { BaseModal, BaseModalProps } from './base-modal';\nimport { WalletUiSize } from './types/wallet-ui-size';\nimport { WalletUiList } from './wallet-ui-list';\n\nexport interface WalletUiModalProps extends Omit<BaseModalProps, 'children'> {\n select: (account: UiWalletAccount) => Promise<void>;\n size?: WalletUiSize;\n wallets: UiWallet[];\n}\n\nexport function WalletUiModal({ size = 'md', wallets, select, ...props }: WalletUiModalProps) {\n return (\n <BaseModal description=\"Connect a wallet on Solana to continue\" size={size} {...props}>\n <WalletUiList size={size} wallets={wallets} select={select} />\n </BaseModal>\n );\n}\n","import React from 'react';\n\nimport { BaseButton, BaseButtonProps } from './base-button';\nimport { BaseModalControl } from './use-base-modal';\n\nexport interface WalletUiModalTriggerProps extends Omit<BaseButtonProps, 'label'> {\n label?: string;\n modal: BaseModalControl;\n}\n\nexport function WalletUiModalTrigger({ label = 'Select Wallet', modal, ...props }: WalletUiModalTriggerProps) {\n return <BaseButton label={label} onClick={() => void modal.open()} {...props} />;\n}\n"]}