@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.
@@ -1,10 +1,11 @@
1
- import React19, { createContext, useContext, useEffect, useId, useMemo, useState, useCallback } from 'react';
1
+ import React19, { createContext, useContext, useEffect, useId, useMemo, useState } from 'react';
2
2
  import { useConnect, useDisconnect, useWallets, uiWalletAccountsAreSame, uiWalletAccountBelongsToUiWallet, getUiWalletAccountStorageKey } from '@wallet-standard/react';
3
3
  export * from '@wallet-standard/react';
4
4
  import { Portal, useMachine, normalizeProps } from '@zag-js/react';
5
5
  import * as menu from '@zag-js/menu';
6
6
  import * as dialog from '@zag-js/dialog';
7
- import { handleCopyText } from '@wallet-ui/core';
7
+ import { useStore } from '@nanostores/react';
8
+ import { createStorageAccount, createStorageCluster, handleCopyText } from '@wallet-ui/core';
8
9
  export * from '@wallet-ui/core';
9
10
  import { createSolanaClient } from 'gill';
10
11
  export * from '@solana/react';
@@ -343,13 +344,11 @@ function useWalletUiWallets() {
343
344
  [readonlyWallets]
344
345
  );
345
346
  }
346
- var STORAGE_KEY = "wallet-ui:selected-wallet-account";
347
347
  var wasSetterInvoked = false;
348
- function getSavedWalletAccount(wallets, storageKey) {
348
+ function getSavedWalletAccount(wallets, savedWalletNameAndAddress) {
349
349
  if (wasSetterInvoked) {
350
350
  return;
351
351
  }
352
- const savedWalletNameAndAddress = localStorage.getItem(storageKey);
353
352
  if (!savedWalletNameAndAddress || typeof savedWalletNameAndAddress !== "string") {
354
353
  return;
355
354
  }
@@ -357,44 +356,37 @@ function getSavedWalletAccount(wallets, storageKey) {
357
356
  if (!savedWalletName || !savedAccountAddress) {
358
357
  return;
359
358
  }
360
- for (const wallet of wallets) {
361
- if (wallet.name === savedWalletName) {
362
- for (const account of wallet.accounts) {
363
- if (account.address === savedAccountAddress) {
364
- return account;
365
- }
366
- }
367
- }
359
+ const wallet = wallets.find((w) => w.name === savedWalletName);
360
+ if (!wallet) {
361
+ return;
368
362
  }
363
+ return wallet.accounts.find((a) => a.address === savedAccountAddress);
369
364
  }
370
365
  function WalletUiAccountContextProvider({
371
366
  children,
372
- storageKey = STORAGE_KEY
367
+ storage = createStorageAccount()
373
368
  }) {
374
369
  const { cluster } = useWalletUiCluster();
375
370
  const wallets = useWallets();
371
+ const accountId = useStore(storage.value);
376
372
  const [account, setAccountInternal] = useState(
377
- () => getSavedWalletAccount(wallets, storageKey)
373
+ () => getSavedWalletAccount(wallets, accountId)
378
374
  );
379
375
  function setAccount(setStateAction) {
380
376
  setAccountInternal((prevAccount) => {
381
377
  wasSetterInvoked = true;
382
378
  const nextWalletAccount = typeof setStateAction === "function" ? setStateAction(prevAccount) : setStateAction;
383
379
  const accountKey = nextWalletAccount ? getUiWalletAccountStorageKey(nextWalletAccount) : void 0;
384
- if (accountKey) {
385
- localStorage.setItem(storageKey, accountKey);
386
- } else {
387
- localStorage.removeItem(storageKey);
388
- }
380
+ storage.set(accountKey ? accountKey : void 0);
389
381
  return nextWalletAccount;
390
382
  });
391
383
  }
392
384
  useEffect(() => {
393
- const savedWalletAccount = getSavedWalletAccount(wallets, storageKey);
385
+ const savedWalletAccount = getSavedWalletAccount(wallets, accountId);
394
386
  if (savedWalletAccount) {
395
387
  setAccountInternal(savedWalletAccount);
396
388
  }
397
- }, [wallets]);
389
+ }, [accountId, wallets]);
398
390
  const walletAccount = useMemo(() => {
399
391
  if (account) {
400
392
  for (const uiWallet of wallets) {
@@ -451,67 +443,31 @@ function WalletUiAccountContextProvider({
451
443
  children
452
444
  );
453
445
  }
454
- function useLocalStorage(key, initialValue) {
455
- const [storedValue, setStoredValue] = useState(() => {
456
- try {
457
- if (typeof window === "undefined") {
458
- return initialValue;
459
- }
460
- const item = window.localStorage.getItem(key);
461
- if (key.includes("wallet") || key.includes("account")) {
462
- return initialValue;
463
- }
464
- return item ? JSON.parse(item) : initialValue;
465
- } catch (error) {
466
- console.warn(`Error reading localStorage key "${key}":`, error);
467
- return initialValue;
468
- }
469
- });
470
- const setValue = useCallback(
471
- (value) => {
472
- try {
473
- const valueToStore = value instanceof Function ? value(storedValue) : value;
474
- setStoredValue(valueToStore);
475
- if (typeof window !== "undefined") {
476
- if (valueToStore === void 0 || valueToStore === null) {
477
- window.localStorage.removeItem(key);
478
- } else {
479
- window.localStorage.setItem(key, JSON.stringify(valueToStore));
480
- }
481
- }
482
- } catch (error) {
483
- console.warn(`Error setting localStorage key "${key}":`, error);
484
- }
485
- },
486
- [key, storedValue]
487
- );
488
- return [storedValue, setValue];
489
- }
490
-
491
- // src/wallet-ui-cluster-context-provider.tsx
492
446
  function WalletUiClusterContextProvider({
493
447
  clusters,
494
448
  render,
495
- storageKey = "__wallet-ui:selected-cluster"
449
+ storage = createStorageCluster()
496
450
  }) {
497
- const [clusterId, setClusterId] = useLocalStorage(storageKey, "solana:devnet");
451
+ const clusterId = useStore(storage.value);
452
+ if (!clusterId) {
453
+ throw new Error("Error reading cluster id from storage");
454
+ }
498
455
  if (!clusters.length) {
499
456
  throw new Error("No clusters provided");
500
457
  }
501
- const cluster = useMemo(() => {
502
- for (const cluster2 of clusters) {
503
- if (cluster2.id === clusterId) {
504
- return cluster2;
505
- }
506
- }
507
- return clusters[0];
508
- }, [clusterId, clusters]);
458
+ const cluster = clusters.find((c) => c.id === clusterId);
459
+ if (!cluster) {
460
+ throw new Error(`Cluster ${clusterId.toString()} not found`);
461
+ }
509
462
  const value = {
510
463
  cluster,
511
464
  clusters,
512
- setCluster: (cluster2) => {
513
- localStorage.setItem(storageKey, cluster2);
514
- setClusterId(cluster2);
465
+ setCluster: (clusterId2) => {
466
+ const cluster2 = clusters.find((c) => c.id === clusterId2);
467
+ if (!cluster2) {
468
+ throw new Error(`Cluster ${clusterId2} not found`);
469
+ }
470
+ storage.set(clusterId2);
515
471
  }
516
472
  };
517
473
  return /* @__PURE__ */ React19.createElement(WalletUiClusterContext.Provider, { value }, render(value));
@@ -564,17 +520,14 @@ function WalletUiSolanaClientContextProvider({
564
520
  function createWalletUiConfig(props) {
565
521
  return { ...props };
566
522
  }
567
- function WalletUi({
568
- children,
569
- config: { clusters, clusterStorageKey, selectedAccountStorageKey, ...config }
570
- }) {
523
+ function WalletUi({ children, config: { accountStorage, clusters, clusterStorage, ...config } }) {
571
524
  return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
572
525
  WalletUiClusterContextProvider,
573
526
  {
574
527
  clusters,
575
- storageKey: clusterStorageKey,
528
+ storage: clusterStorage,
576
529
  render: ({ cluster }) => {
577
- return /* @__PURE__ */ React19.createElement(WalletUiSolanaClientContextProvider, { urlOrMoniker: cluster.urlOrMoniker }, /* @__PURE__ */ React19.createElement(WalletUiAccountContextProvider, { storageKey: selectedAccountStorageKey }, /* @__PURE__ */ React19.createElement(WalletUiContextProvider, { ...config }, children)));
530
+ return /* @__PURE__ */ React19.createElement(WalletUiSolanaClientContextProvider, { urlOrMoniker: cluster.urlOrMoniker }, /* @__PURE__ */ React19.createElement(WalletUiAccountContextProvider, { storage: accountStorage }, /* @__PURE__ */ React19.createElement(WalletUiContextProvider, { ...config }, children)));
578
531
  }
579
532
  }
580
533
  ));
@@ -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","connect","BaseDropdownItemType","useMachine","useId","normalizeProps","createContext","useContext","useMemo","useWallets","useEffect","useState","cluster","account"],"mappings":";;;;;;;;;;;;;;AAaO,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,KAAO,EAAA,WAAA,EAAa,SAAS,YAAc,EAAA,IAAA,EAAM,GAAG,KAAA,EAA0B,EAAA;AAClH,EAAA,uBACKA,OAAA,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,OAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAK,SAAU,EAAA,oCAAA,EAAA,EAAsC,WAAY,CAAA,GAAU,IAC1F,EAAA,KAAA,EACA,YAAe,mBAAAA,OAAA,CAAA,aAAA,CAAC,MAAK,EAAA,EAAA,SAAA,EAAU,qCAAuC,EAAA,EAAA,YAAa,IAAU,IAClG,CAAA;AAER;ACQO,IAAM,eAAkBA,GAAAA,OAAAA,CAAM,aAAoC,CAAA,EAA0B;;;ACzB5F,SAAS,WAAc,GAAA;AAC1B,EAAOA,OAAAA,OAAAA,CAAM,WAAW,eAAe,CAAA;AAC3C;ACQa,IAAA,sBAAA,GAAyB,aAAoC,CAAA,EAA0B;;;ACV7F,SAAS,kBAAqB,GAAA;AACjC,EAAA,OAAO,WAAW,sBAAsB,C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 '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","connect","BaseDropdownItemType","useMachine","useId","normalizeProps","createContext","useContext","useMemo","useWallets","useEffect","useStore","clusterId","cluster","account"],"mappings":";;;;;;;;;;;;;;;AAaO,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,KAAO,EAAA,WAAA,EAAa,SAAS,YAAc,EAAA,IAAA,EAAM,GAAG,KAAA,EAA0B,EAAA;AAClH,EAAA,uBACKA,OAAA,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,OAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAK,SAAU,EAAA,oCAAA,EAAA,EAAsC,WAAY,CAAA,GAAU,IAC1F,EAAA,KAAA,EACA,YAAe,mBAAAA,OAAA,CAAA,aAAA,CAAC,MAAK,EAAA,EAAA,SAAA,EAAU,qCAAuC,EAAA,EAAA,YAAa,IAAU,IAClG,CAAA;AAER;ACQO,IAAM,eAAkBA,GAAAA,OAAAA,CAAM,aAAoC,CAAA,EAA0B;;;ACzB5F,SAAS,WAAc,GAAA;AAC1B,EAAOA,OAAAA,OAAAA,CAAM,WAAW,eAAe,CAAA;AAC3C;ACQa,IAAA,sBAAA,GAAyB,aAAoC,CAAA,EAA0B;;;ACV7F,SAAS,kBAAqB,GAAA;AACjC,EAAA,OAAO,WAAW,sBAAsB,CAAA;AAC5C;;;ACAO,SAAS,iBAAA,CAAkB,EAAE,MAAA,EAAgC,EAAA;AAChE,EAAA,MAAM,EAAE,OAAA,EAAS,cAAe,EAAA,GAAI,WAAY,EAAA;AAChD,EAAM,MAAA,EAAE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AAW,EAAA,MAAA,EAAQ,OAAO,IAAM,EAAA,OAAA,EAAS,GAAG,KAAA,EAA4B,EAAA;AACnG,EACI,uBAAAA,OAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,CAAkB,eAAA,EAAA,IAAI,CAAI,CAAA,EAAA,SAAA,IAAa,EAAE,CAAA,CAAA,EAAK,GAAG,KAAA,EAAA,EAC5D,OAAQ,CAAA,GAAA,CAAI,CACT,MAAA,qBAAAA,OAAA,CAAA,aAAA,CAAC,kBAAmB,EAAA,EAAA,GAAA,EAAK,MAAO,CAAA,IAAA,EAAM,MAAgB,EAAA,IAAA,EAAY,MAAgB,EAAA,CACrF,CACL,CAAA;AAER;ACRO,SAAS,aAAA,CAAc,EAAE,IAAO,GAAA,IAAA,EAAM,SAAS,MAAQ,EAAA,GAAG,OAA6B,EAAA;AAC1F,EAAA,uBACIA,OAAA,CAAA,aAAA,CAAC,SAAU,EAAA,EAAA,WAAA,EAAY,0CAAyC,IAAa,EAAA,GAAG,KAC5E,EAAA,kBAAAA,QAAA,aAAC,CAAA,YAAA,EAAA,EAAa,IAAY,EAAA,OAAA,EAAkB,QAAgB,CAChE,CAAA;AAER;ACTO,SAAS,qBAAqB,EAAE,KAAA,GAAQ,iBAAiB,KAAO,EAAA,GAAG,OAAoC,EAAA;AAC1G,EAAA,uBAAOA,OAAAA,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.mjs","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"]}
@@ -1,11 +1,12 @@
1
+ import { StorageAccount } from '@wallet-ui/core';
1
2
  import React from 'react';
2
3
  /**
3
4
  * Saves the selected wallet account's storage key to the browser's local storage. In future
4
5
  * sessions it will try to return that same wallet account, or at least one from the same brand of
5
6
  * wallet if the wallet from which it came is still in the Wallet Standard registry.
6
7
  */
7
- export declare function WalletUiAccountContextProvider({ children, storageKey, }: {
8
+ export declare function WalletUiAccountContextProvider({ children, storage, }: {
8
9
  children: React.ReactNode;
9
- storageKey?: string;
10
+ storage?: StorageAccount;
10
11
  }): React.JSX.Element;
11
12
  //# sourceMappingURL=wallet-ui-account-context-provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-ui-account-context-provider.d.ts","sourceRoot":"","sources":["../../src/wallet-ui-account-context-provider.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAkC5D;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,EAC3C,QAAQ,EACR,UAAwB,GAC3B,EAAE;IACC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,qBA4FA"}
1
+ {"version":3,"file":"wallet-ui-account-context-provider.d.ts","sourceRoot":"","sources":["../../src/wallet-ui-account-context-provider.tsx"],"names":[],"mappings":"AASA,OAAO,EAAwB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAuC,MAAM,OAAO,CAAC;AA8B5D;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,EAC3C,QAAQ,EACR,OAAgC,GACnC,EAAE;IACC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;CAC5B,qBAyFA"}
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { WalletUiClusterContextProviderProps } from './wallet-ui-cluster-context';
3
- export declare function WalletUiClusterContextProvider({ clusters, render, storageKey, }: WalletUiClusterContextProviderProps): React.JSX.Element;
3
+ export declare function WalletUiClusterContextProvider({ clusters, render, storage, }: WalletUiClusterContextProviderProps): React.JSX.Element;
4
4
  //# sourceMappingURL=wallet-ui-cluster-context-provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-ui-cluster-context-provider.d.ts","sourceRoot":"","sources":["../../src/wallet-ui-cluster-context-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,EAEH,mCAAmC,EAEtC,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,8BAA8B,CAAC,EAC3C,QAAQ,EACR,MAAM,EACN,UAA2C,GAC9C,EAAE,mCAAmC,qBAwBrC"}
1
+ {"version":3,"file":"wallet-ui-cluster-context-provider.d.ts","sourceRoot":"","sources":["../../src/wallet-ui-cluster-context-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEH,mCAAmC,EAEtC,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,8BAA8B,CAAC,EAC3C,QAAQ,EACR,MAAM,EACN,OAAgC,GACnC,EAAE,mCAAmC,qBA2BrC"}
@@ -1,9 +1,9 @@
1
- import { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';
1
+ import { SolanaCluster, SolanaClusterId, StorageCluster } from '@wallet-ui/core';
2
2
  import { ReactNode } from 'react';
3
3
  export interface WalletUiClusterContextProviderProps {
4
4
  clusters: SolanaCluster[];
5
5
  render: (props: WalletUiClusterContextValue) => ReactNode;
6
- storageKey?: string;
6
+ storage?: StorageCluster;
7
7
  }
8
8
  export interface WalletUiClusterContextValue {
9
9
  cluster: SolanaCluster;
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-ui-cluster-context.d.ts","sourceRoot":"","sources":["../../src/wallet-ui-cluster-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,mCAAmC;IAChD,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,SAAS,CAAC;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,2BAA2B;IACxC,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAE1B,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,sBAAsB,sDAAgF,CAAC"}
1
+ {"version":3,"file":"wallet-ui-cluster-context.d.ts","sourceRoot":"","sources":["../../src/wallet-ui-cluster-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,mCAAmC;IAChD,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,SAAS,CAAC;IAC1D,OAAO,CAAC,EAAE,cAAc,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B;IACxC,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAE1B,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,sBAAsB,sDAAgF,CAAC"}
@@ -1,15 +1,15 @@
1
- import { SolanaCluster } from '@wallet-ui/core';
1
+ import { SolanaCluster, StorageAccount, StorageCluster } from '@wallet-ui/core';
2
2
  import React from 'react';
3
3
  import { WalletUiContextProviderProps } from './wallet-ui-context';
4
4
  export interface WalletUiConfig extends Omit<WalletUiContextProviderProps, 'children'> {
5
- clusterStorageKey?: string;
5
+ accountStorage?: StorageAccount;
6
+ clusterStorage?: StorageCluster;
6
7
  clusters: SolanaCluster[];
7
- selectedAccountStorageKey?: string;
8
8
  }
9
9
  export declare function createWalletUiConfig(props: WalletUiConfig): WalletUiConfig;
10
10
  export interface WalletUiProps {
11
11
  children: React.ReactNode;
12
12
  config: WalletUiConfig;
13
13
  }
14
- export declare function WalletUi({ children, config: { clusters, clusterStorageKey, selectedAccountStorageKey, ...config }, }: WalletUiProps): React.JSX.Element;
14
+ export declare function WalletUi({ children, config: { accountStorage, clusters, clusterStorage, ...config } }: WalletUiProps): React.JSX.Element;
15
15
  //# sourceMappingURL=wallet-ui.d.ts.map