@n1xyz/wallet-widget 0.0.12 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Logic/sessionManager.d.ts +0 -36
- package/dist/Logic/sessionManager.js +1 -146
- package/dist/Logic/sessionManager.js.map +1 -1
- package/dist/Modal/LoadingFallback.js +1 -1
- package/dist/Modal/LoadingFallback.js.map +1 -1
- package/dist/Modal/N1WalletModal.js +6 -5
- package/dist/Modal/N1WalletModal.js.map +1 -1
- package/dist/Modal/NTSFlow/LoadingFallback.js +1 -1
- package/dist/Modal/NTSFlow/LoadingFallback.js.map +1 -1
- package/dist/Modal/NTSFlow/components/BackButton.js +1 -1
- package/dist/Modal/NTSFlow/components/BackButton.js.map +1 -1
- package/dist/Modal/NTSFlow/components/ModalHeader.js +1 -1
- package/dist/Modal/NTSFlow/components/ModalHeader.js.map +1 -1
- package/dist/Modal/NTSFlow/views/ConnectView.js +2 -2
- package/dist/Modal/NTSFlow/views/ConnectView.js.map +1 -1
- package/dist/Modal/NTSFlow/views/CreateSessionView.js +5 -5
- package/dist/Modal/NTSFlow/views/CreateSessionView.js.map +1 -1
- package/dist/Modal/NTSFlow/views/CreateUserView.js +1 -1
- package/dist/Modal/NTSFlow/views/CreateUserView.js.map +1 -1
- package/dist/Modal/NTSFlow/views/NoWhitelistView.js +3 -3
- package/dist/Modal/NTSFlow/views/NoWhitelistView.js.map +1 -1
- package/dist/Modal/NTSFlow/views/SigningView.js +1 -1
- package/dist/Modal/NTSFlow/views/SigningView.js.map +1 -1
- package/dist/Modal/NordFlow/NordFlow.js +2 -2
- package/dist/Modal/NordFlow/NordFlow.js.map +1 -1
- package/dist/Modal/NordFlow/components/ChainButton.js +5 -5
- package/dist/Modal/NordFlow/components/ChainButton.js.map +1 -1
- package/dist/Modal/NordFlow/components/EVMChainsButton.js +4 -4
- package/dist/Modal/NordFlow/components/EVMChainsButton.js.map +1 -1
- package/dist/Modal/NordFlow/components/Header.js +1 -1
- package/dist/Modal/NordFlow/components/Header.js.map +1 -1
- package/dist/Modal/NordFlow/components/ImageWithFallback.js +1 -1
- package/dist/Modal/NordFlow/components/ImageWithFallback.js.map +1 -1
- package/dist/Modal/NordFlow/components/LoadingSquares.js +1 -1
- package/dist/Modal/NordFlow/components/LoadingSquares.js.map +1 -1
- package/dist/Modal/NordFlow/components/MoreButton.js +4 -4
- package/dist/Modal/NordFlow/components/MoreButton.js.map +1 -1
- package/dist/Modal/NordFlow/components/TransactionTable.js +6 -6
- package/dist/Modal/NordFlow/components/TransactionTable.js.map +1 -1
- package/dist/Modal/NordFlow/components/WaitingMessage.js +1 -1
- package/dist/Modal/NordFlow/components/WaitingMessage.js.map +1 -1
- package/dist/Modal/NordFlow/context/DepositContext.js +1 -4
- package/dist/Modal/NordFlow/context/DepositContext.js.map +1 -1
- package/dist/Modal/NordFlow/context/WalletConnectContext.js +0 -2
- package/dist/Modal/NordFlow/context/WalletConnectContext.js.map +1 -1
- package/dist/Modal/NordFlow/screens/00-IdleScreen.js +1 -1
- package/dist/Modal/NordFlow/screens/00-IdleScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/01-ConnectWalletScreen.js +3 -3
- package/dist/Modal/NordFlow/screens/01-ConnectWalletScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/02-EvmWalletAuthScreen.js +4 -4
- package/dist/Modal/NordFlow/screens/02-EvmWalletAuthScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/03-ChainSelectionScreen.js +2 -2
- package/dist/Modal/NordFlow/screens/03-ChainSelectionScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/04-AmountInputScreen.js +4 -22
- package/dist/Modal/NordFlow/screens/04-AmountInputScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/05-DepositProgressScreen.js +1 -1
- package/dist/Modal/NordFlow/screens/05-DepositProgressScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/06-DepositSuccessScreen.js +4 -5
- package/dist/Modal/NordFlow/screens/06-DepositSuccessScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/07-AuthLoadingScreen.js +3 -3
- package/dist/Modal/NordFlow/screens/07-AuthLoadingScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/08-FinalSuccessScreen.js +2 -2
- package/dist/Modal/NordFlow/screens/08-FinalSuccessScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/09-ErrorScreen.js +2 -2
- package/dist/Modal/NordFlow/screens/09-ErrorScreen.js.map +1 -1
- package/dist/Modal/Sidebar/N1Sidebar.js +10 -10
- package/dist/Modal/Sidebar/N1Sidebar.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketSelector.js +5 -5
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketSelector.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketStats.js +3 -3
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketStats.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/NordTradingView.js +2 -2
- package/dist/Modal/Sidebar/NordTradingView/NordTradingView.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBook.js +2 -2
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBook.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookDepthVisualizer.js +1 -1
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookDepthVisualizer.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookHeader.js +4 -4
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookHeader.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookTable.js +6 -6
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookTable.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/AmountInput.js +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/AmountInput.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/BuySellTabs.js +3 -3
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/BuySellTabs.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/FillModeSelector.js +7 -7
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/FillModeSelector.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/OrderTypeSelector.js +13 -13
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/OrderTypeSelector.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/PriceInput.js +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/PriceInput.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/SubmitButton.js +2 -2
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/SubmitButton.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TotalCalculator.js +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TotalCalculator.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TradeForm.js +5 -5
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TradeForm.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/UserBalances/UserBalances.js +1 -1
- package/dist/Modal/Sidebar/NordTradingView/UserBalances/UserBalances.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/UserOrders/UserOrders.js +5 -5
- package/dist/Modal/Sidebar/NordTradingView/UserOrders/UserOrders.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/UserPositions/UserPositions.js +4 -4
- package/dist/Modal/Sidebar/NordTradingView/UserPositions/UserPositions.js.map +1 -1
- package/dist/Provider/LazyWalletProvider.js +3 -3
- package/dist/Provider/LazyWalletProvider.js.map +1 -1
- package/dist/Provider/N1WalletProvider.js +11 -21
- package/dist/Provider/N1WalletProvider.js.map +1 -1
- package/dist/Provider/hooks/useNordUserInitialization.d.ts +1 -20
- package/dist/Provider/hooks/useNordUserInitialization.js +5 -5
- package/dist/Provider/hooks/useNordUserInitialization.js.map +1 -1
- package/dist/WidgetButton/N1ConnectButton.js +1 -1
- package/dist/WidgetButton/N1ConnectButton.js.map +1 -1
- package/dist/components/Logo.js.map +1 -1
- package/dist/components/QRCodeLoader.js +1 -1
- package/dist/components/QRCodeLoader.js.map +1 -1
- package/dist/components/logos/EVMChainsGroup.js +1 -1
- package/dist/components/logos/EVMChainsGroup.js.map +1 -1
- package/dist/components/logos/MoreChainsGroup.js +1 -1
- package/dist/components/logos/MoreChainsGroup.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.css +2 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateSessionView.js","sourceRoot":"","sources":["../../../../src/Modal/NTSFlow/views/CreateSessionView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,OAAO,EACP,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE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AlB,CAAkB,EACrC,SAAS,EAAE,cAAM,OAAA,YAAY,CAAC,KAAK,CAAC,EAAnB,CAAmB,EACpC,QAAQ,EAAE,CAAC,aAAa,IAAI,CAAC,OAAO,EACpC,SAAS,EAAE,iLAEqB,cAAc,6BAE1C,CAAC,aAAa,IAAI,CAAC,OAAO;gCACxB,CAAC,CAAC,0EAA0E;gCAC5E,CAAC,CAAC,+GAA+G,mBAEtH,EACD,KAAK,EAAE;gCACL,SAAS,EACP,SAAS,IAAI,CAAC,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC;oCACvC,CAAC,CAAC,aAAa;oCACf,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC;wCACzC,CAAC,CAAC,aAAa;wCACf,CAAC,CAAC,UAAU;6BACnB,YAED,cAAK,SAAS,EAAC,+BAA+B,YAC5C,cAAK,SAAS,EAAC,iCAAiC,YAC9C,eACE,SAAS,EAAE,iGAC0D,cAAc,0IAEpF,6BAGM,GACH,GACF,GACC,EAET,KAAC,UAAU,IACT,OAAO,EAAE;gCACP,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;gCACnC,gBAAgB,CAAC,IAAI,CAAC,CAAC;gCACvB,UAAU,CAAC,EAAE,CAAC,CAAC;gCACf,mBAAmB,EAAE,CAAC;gCACtB,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;4BACvC,CAAC,GACD,IACE,GACF,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { ANIMATION_EASE } from '../../NordFlow/constants';\nimport { WalletError, WalletErrorCode } from '../../../errors/types';\nimport {\n createWebSession,\n generateSessionKeyPair,\n getUser,\n storeSessionKeysInLocalStorage,\n} from '../../../Logic/utils';\nimport {\n useN1WalletContext,\n useN1WalletInternalContext,\n} from '../../../Provider/hooks';\nimport { N1ModalViewMode } from '../../../Provider/types';\nimport { logger } from '../../../utils/logger';\nimport { BackButton } from '../components/BackButton';\nimport { ModalHeader } from '../components/ModalHeader';\nimport { signEd25519 } from '@n1xyz/nts-sdk';\n\nexport function CreateSessionView() {\n const [isHovered, setIsHovered] = useState(false);\n const [isPressed, setIsPressed] = useState(false);\n\n const [NTSComponents, setNTSComponents] = useState<any>(null);\n const [keyPair, setKeyPair] = useState<{\n publicKey: Uint8Array;\n privateKey: Uint8Array;\n } | null>(null);\n\n const {\n setViewMode,\n setUsername,\n setStartClosingLogin,\n setIsConnected,\n dynamicWallet,\n handleError,\n setSessionPubKey,\n setSignMessageWithSessionKey,\n dynamicHandleLogOut,\n setDynamicWallet,\n setAddress,\n setSignMessageWithWalletKey,\n } = useN1WalletInternalContext();\n\n const { ntsInterface, walletPubKey, address } = useN1WalletContext();\n\n // Initialize NTS SDK and generate key pair\n useEffect(() => {\n const loadNTSSDK = async () => {\n try {\n const { Transaction, AdminAction, CoreApps } = await import(\n '@n1xyz/nts-sdk'\n );\n setNTSComponents({ Transaction, AdminAction, CoreApps });\n const newKeyPair = await generateSessionKeyPair();\n setKeyPair(newKeyPair);\n } catch (error) {\n handleError(\n new WalletError(\n WalletErrorCode.CONNECTION_FAILED,\n 'Failed to initialize NTS SDK',\n { originalError: error }\n )\n );\n }\n };\n loadNTSSDK();\n }, [handleError]);\n\n const signWithWallet = async (msg: string): Promise<Uint8Array> => {\n try {\n if (!dynamicWallet) {\n throw new WalletError(\n WalletErrorCode.WALLET_NOT_FOUND,\n 'Wallet not found for signing'\n );\n }\n\n if (dynamicWallet.chain === 'SOL') {\n const signature = await dynamicWallet.signMessage(msg);\n const binaryString = atob(signature);\n const signatureUint8Array = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n signatureUint8Array[i] = binaryString.charCodeAt(i);\n }\n return signatureUint8Array;\n }\n\n const sig = (await dynamicWallet.signMessage(msg)) as string;\n logger.debug('Wallet signature received', { signature: sig });\n return Uint8Array.from(Buffer.from(sig.slice(2), 'hex'));\n } catch (error) {\n throw new WalletError(\n WalletErrorCode.USER_REJECTED,\n 'Failed to sign message with wallet',\n { originalError: error }\n );\n }\n };\n\n const handleSign = async () => {\n logger.debug('handleSign');\n\n if (!NTSComponents || !keyPair) {\n logger.warn('Required components not initialized');\n return;\n }\n\n setViewMode(N1ModalViewMode.Signing);\n\n try {\n const sessionKeyHex = Buffer.from(keyPair.publicKey).toString('hex');\n logger.debug('Generated session key', { sessionKey: sessionKeyHex });\n\n // Create and sign transaction that registers the session key with Core\n const transactionData = {\n appId: NTSComponents.CoreApps.Admin,\n action: NTSComponents.AdminAction.addSessionKey,\n framework: 'ts',\n data: [\n {\n sessionKey: sessionKeyHex,\n appId: 'hub',\n },\n ],\n };\n\n setSignMessageWithWalletKey(signWithWallet);\n const tx = new NTSComponents.Transaction(transactionData, walletPubKey!);\n await tx.signWithWalletFunction(signWithWallet);\n try {\n const txRes = await ntsInterface.sendTransaction(\n tx,\n tx.signature!,\n walletPubKey\n );\n if (txRes.success) {\n logger.debug('txRes', txRes);\n } else {\n logger.debug('txRes', txRes);\n throw new WalletError(\n WalletErrorCode.TRANSACTION_FAILED,\n 'Transaction failed'\n );\n }\n } catch (_) {\n throw new WalletError(\n WalletErrorCode.TRANSACTION_FAILED,\n 'Transaction did not succeed'\n );\n }\n\n // Create session signing function\n const signFn = async (message: Uint8Array) => {\n try {\n return await signEd25519(message, keyPair.privateKey as Uint8Array);\n } catch (_) {\n logger.error('Error signing with Ed25519:', _);\n throw _;\n }\n };\n\n // Store session keys\n logger.debug('Storing session keys');\n storeSessionKeysInLocalStorage({\n privKey: keyPair.privateKey as Uint8Array,\n walletPublicKey: address,\n chainName: dynamicWallet!.chain,\n });\n setSessionPubKey(keyPair.publicKey);\n setSignMessageWithSessionKey(() => signFn);\n\n // Initialize web session with Argus who verifies that the session is\n // registered with Core, and if so, grants you access to its user metadata db\n await createWebSession(signFn, keyPair.publicKey, walletPubKey);\n\n // Check for existing user\n // TODO: handle case for auth.users, currently user.name is a wallet_only_users namespacing\n const user = await getUser();\n if (user?.name) {\n logger.info('Existing user found, completing login');\n setUsername(user.name);\n localStorage.setItem(`n1_${address}_username`, user.name);\n setStartClosingLogin(true);\n setIsConnected(true);\n } else {\n logger.info('No user found, transitioning to user creation');\n setViewMode(N1ModalViewMode.CreatingUser);\n }\n } catch (error: any) {\n logger.error('Session creation failed:', error);\n if (error.name === 'WalletError') {\n handleError(error);\n } else {\n handleError(\n new WalletError(\n WalletErrorCode.CONNECTION_FAILED,\n 'Failed to create session',\n { originalError: JSON.stringify(error) }\n )\n );\n }\n\n setViewMode(N1ModalViewMode.CreateSession);\n }\n };\n\n return (\n <div className=\"bg-n1-gray-50 dark:bg-n1-gray-950 relative border border-n1-gray-200 dark:border-n1-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity]\">\n <div className=\"p-6 border-b border-n1-gray-200 dark:border-n1-gray-800\">\n <ModalHeader />\n </div>\n\n <div className=\"p-6 overflow-hidden relative\">\n <div className=\"space-y-4\">\n <div className=\"text-center\">\n <h3 className=\"text-xl font-medium text-n1-gray-900 dark:text-white mb-2\">\n Create Session\n </h3>\n <p className=\"text-n1-gray-500 dark:text-n1-gray-400\">\n Please authenticate to create a new session.\n </p>\n </div>\n\n <button\n onClick={handleSign}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => {\n setIsHovered(false);\n setIsPressed(false);\n }}\n onMouseDown={() => setIsPressed(true)}\n onMouseUp={() => setIsPressed(false)}\n disabled={!NTSComponents || !keyPair}\n className={`\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-gray-100 dark:bg-neutral-950 py-4 text-left\n transition-all duration-300 ${ANIMATION_EASE}\n ${\n !NTSComponents || !keyPair\n ? 'cursor-not-allowed border-n1-gray-200 dark:border-n1-gray-800 opacity-50'\n : 'cursor-pointer border-n1-gray-200 dark:border-n1-gray-800 hover:border-n1-gray-400 dark:hover:border-white/60'\n }\n `}\n style={{\n transform:\n isPressed && (!NTSComponents || !keyPair)\n ? 'scale(0.98)'\n : isHovered && (!NTSComponents || !keyPair)\n ? 'scale(0.99)'\n : 'scale(1)',\n }}\n >\n <div className=\"relative z-[200] pl-4 isolate\">\n <div className=\"flex items-center justify-start\">\n <span\n className={`\n text-base font-medium tracking-wide transition-colors duration-300 ${ANIMATION_EASE}\n text-n1-gray-500 dark:text-neutral-400 group-hover:text-n1-gray-900 dark:group-hover:text-white\n `}\n >\n Authenticate\n </span>\n </div>\n </div>\n </button>\n\n <BackButton\n onClick={() => {\n logger.debug('BackButton clicked');\n setDynamicWallet(null);\n setAddress('');\n dynamicHandleLogOut();\n setViewMode(N1ModalViewMode.Connect);\n }}\n />\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CreateSessionView.js","sourceRoot":"","sources":["../../../../src/Modal/NTSFlow/views/CreateSessionView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,OAAO,EACP,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE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EAAE,cAAM,OAAA,YAAY,CAAC,KAAK,CAAC,EAAnB,CAAmB,EACpC,QAAQ,EAAE,CAAC,aAAa,IAAI,CAAC,OAAO,EACpC,SAAS,EAAE,oLAEqB,cAAc,6BAE1C,CAAC,aAAa,IAAI,CAAC,OAAO;gCACxB,CAAC,CAAC,gFAAgF;gCAClF,CAAC,CAAC,wHAAwH,mBAE/H,EACD,KAAK,EAAE;gCACL,SAAS,EACP,SAAS,IAAI,CAAC,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC;oCACvC,CAAC,CAAC,aAAa;oCACf,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC;wCACzC,CAAC,CAAC,aAAa;wCACf,CAAC,CAAC,UAAU;6BACnB,YAED,cAAK,SAAS,EAAC,+BAA+B,YAC5C,cAAK,SAAS,EAAC,iCAAiC,YAC9C,eACE,SAAS,EAAE,iGAC0D,cAAc,gJAEpF,6BAGM,GACH,GACF,GACC,EAET,KAAC,UAAU,IACT,OAAO,EAAE;gCACP,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;gCACnC,gBAAgB,CAAC,IAAI,CAAC,CAAC;gCACvB,UAAU,CAAC,EAAE,CAAC,CAAC;gCACf,mBAAmB,EAAE,CAAC;gCACtB,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;4BACvC,CAAC,GACD,IACE,GACF,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { ANIMATION_EASE } from '../../NordFlow/constants';\nimport { WalletError, WalletErrorCode } from '../../../errors/types';\nimport {\n createWebSession,\n generateSessionKeyPair,\n getUser,\n storeSessionKeysInLocalStorage,\n} from '../../../Logic/utils';\nimport {\n useN1WalletContext,\n useN1WalletInternalContext,\n} from '../../../Provider/hooks';\nimport { N1ModalViewMode } from '../../../Provider/types';\nimport { logger } from '../../../utils/logger';\nimport { BackButton } from '../components/BackButton';\nimport { ModalHeader } from '../components/ModalHeader';\nimport { signEd25519 } from '@n1xyz/nts-sdk';\n\nexport function CreateSessionView() {\n const [isHovered, setIsHovered] = useState(false);\n const [isPressed, setIsPressed] = useState(false);\n\n const [NTSComponents, setNTSComponents] = useState<any>(null);\n const [keyPair, setKeyPair] = useState<{\n publicKey: Uint8Array;\n privateKey: Uint8Array;\n } | null>(null);\n\n const {\n setViewMode,\n setUsername,\n setStartClosingLogin,\n setIsConnected,\n dynamicWallet,\n handleError,\n setSessionPubKey,\n setSignMessageWithSessionKey,\n dynamicHandleLogOut,\n setDynamicWallet,\n setAddress,\n setSignMessageWithWalletKey,\n } = useN1WalletInternalContext();\n\n const { ntsInterface, walletPubKey, address } = useN1WalletContext();\n\n // Initialize NTS SDK and generate key pair\n useEffect(() => {\n const loadNTSSDK = async () => {\n try {\n const { Transaction, AdminAction, CoreApps } = await import(\n '@n1xyz/nts-sdk'\n );\n setNTSComponents({ Transaction, AdminAction, CoreApps });\n const newKeyPair = await generateSessionKeyPair();\n setKeyPair(newKeyPair);\n } catch (error) {\n handleError(\n new WalletError(\n WalletErrorCode.CONNECTION_FAILED,\n 'Failed to initialize NTS SDK',\n { originalError: error }\n )\n );\n }\n };\n loadNTSSDK();\n }, [handleError]);\n\n const signWithWallet = async (msg: string): Promise<Uint8Array> => {\n try {\n if (!dynamicWallet) {\n throw new WalletError(\n WalletErrorCode.WALLET_NOT_FOUND,\n 'Wallet not found for signing'\n );\n }\n\n if (dynamicWallet.chain === 'SOL') {\n const signature = await dynamicWallet.signMessage(msg);\n const binaryString = atob(signature);\n const signatureUint8Array = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n signatureUint8Array[i] = binaryString.charCodeAt(i);\n }\n return signatureUint8Array;\n }\n\n const sig = (await dynamicWallet.signMessage(msg)) as string;\n logger.debug('Wallet signature received', { signature: sig });\n return Uint8Array.from(Buffer.from(sig.slice(2), 'hex'));\n } catch (error) {\n throw new WalletError(\n WalletErrorCode.USER_REJECTED,\n 'Failed to sign message with wallet',\n { originalError: error }\n );\n }\n };\n\n const handleSign = async () => {\n logger.debug('handleSign');\n\n if (!NTSComponents || !keyPair) {\n logger.warn('Required components not initialized');\n return;\n }\n\n setViewMode(N1ModalViewMode.Signing);\n\n try {\n const sessionKeyHex = Buffer.from(keyPair.publicKey).toString('hex');\n logger.debug('Generated session key', { sessionKey: sessionKeyHex });\n\n // Create and sign transaction that registers the session key with Core\n const transactionData = {\n appId: NTSComponents.CoreApps.Admin,\n action: NTSComponents.AdminAction.addSessionKey,\n framework: 'ts',\n data: [\n {\n sessionKey: sessionKeyHex,\n appId: 'hub',\n },\n ],\n };\n\n setSignMessageWithWalletKey(signWithWallet);\n const tx = new NTSComponents.Transaction(transactionData, walletPubKey!);\n await tx.signWithWalletFunction(signWithWallet);\n try {\n const txRes = await ntsInterface.sendTransaction(\n tx,\n tx.signature!,\n walletPubKey\n );\n if (txRes.success) {\n logger.debug('txRes', txRes);\n } else {\n logger.debug('txRes', txRes);\n throw new WalletError(\n WalletErrorCode.TRANSACTION_FAILED,\n 'Transaction failed'\n );\n }\n } catch (_) {\n throw new WalletError(\n WalletErrorCode.TRANSACTION_FAILED,\n 'Transaction did not succeed'\n );\n }\n\n // Create session signing function\n const signFn = async (message: Uint8Array) => {\n try {\n return await signEd25519(message, keyPair.privateKey as Uint8Array);\n } catch (_) {\n logger.error('Error signing with Ed25519:', _);\n throw _;\n }\n };\n\n // Store session keys\n logger.debug('Storing session keys');\n storeSessionKeysInLocalStorage({\n privKey: keyPair.privateKey as Uint8Array,\n walletPublicKey: address,\n chainName: dynamicWallet!.chain,\n });\n setSessionPubKey(keyPair.publicKey);\n setSignMessageWithSessionKey(() => signFn);\n\n // Initialize web session with Argus who verifies that the session is\n // registered with Core, and if so, grants you access to its user metadata db\n await createWebSession(signFn, keyPair.publicKey, walletPubKey);\n\n // Check for existing user\n // TODO: handle case for auth.users, currently user.name is a wallet_only_users namespacing\n const user = await getUser();\n if (user?.name) {\n logger.info('Existing user found, completing login');\n setUsername(user.name);\n localStorage.setItem(`n1_${address}_username`, user.name);\n setStartClosingLogin(true);\n setIsConnected(true);\n } else {\n logger.info('No user found, transitioning to user creation');\n setViewMode(N1ModalViewMode.CreatingUser);\n }\n } catch (error: any) {\n logger.error('Session creation failed:', error);\n if (error.name === 'WalletError') {\n handleError(error);\n } else {\n handleError(\n new WalletError(\n WalletErrorCode.CONNECTION_FAILED,\n 'Failed to create session',\n { originalError: JSON.stringify(error) }\n )\n );\n }\n\n setViewMode(N1ModalViewMode.CreateSession);\n }\n };\n\n return (\n <div className=\"bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 relative border border-n1-ww-gray-200 dark:border-n1-ww-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity]\">\n <div className=\"p-6 border-b border-n1-ww-gray-200 dark:border-n1-ww-gray-800\">\n <ModalHeader />\n </div>\n\n <div className=\"p-6 overflow-hidden relative\">\n <div className=\"space-y-4\">\n <div className=\"text-center\">\n <h3 className=\"text-xl font-medium text-n1-ww-gray-900 dark:text-white mb-2\">\n Create Session\n </h3>\n <p className=\"text-n1-ww-gray-500 dark:text-n1-ww-gray-400\">\n Please authenticate to create a new session.\n </p>\n </div>\n\n <button\n onClick={handleSign}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => {\n setIsHovered(false);\n setIsPressed(false);\n }}\n onMouseDown={() => setIsPressed(true)}\n onMouseUp={() => setIsPressed(false)}\n disabled={!NTSComponents || !keyPair}\n className={`\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-ww-gray-100 dark:bg-neutral-950 py-4 text-left\n transition-all duration-300 ${ANIMATION_EASE}\n ${\n !NTSComponents || !keyPair\n ? 'cursor-not-allowed border-n1-ww-gray-200 dark:border-n1-ww-gray-800 opacity-50'\n : 'cursor-pointer border-n1-ww-gray-200 dark:border-n1-ww-gray-800 hover:border-n1-ww-gray-400 dark:hover:border-white/60'\n }\n `}\n style={{\n transform:\n isPressed && (!NTSComponents || !keyPair)\n ? 'scale(0.98)'\n : isHovered && (!NTSComponents || !keyPair)\n ? 'scale(0.99)'\n : 'scale(1)',\n }}\n >\n <div className=\"relative z-[200] pl-4 isolate\">\n <div className=\"flex items-center justify-start\">\n <span\n className={`\n text-base font-medium tracking-wide transition-colors duration-300 ${ANIMATION_EASE}\n text-n1-ww-gray-500 dark:text-neutral-400 group-hover:text-n1-ww-gray-900 dark:group-hover:text-white\n `}\n >\n Authenticate\n </span>\n </div>\n </div>\n </button>\n\n <BackButton\n onClick={() => {\n logger.debug('BackButton clicked');\n setDynamicWallet(null);\n setAddress('');\n dynamicHandleLogOut();\n setViewMode(N1ModalViewMode.Connect);\n }}\n />\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -101,6 +101,6 @@ export function CreateUserView() {
|
|
|
101
101
|
});
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
return (_jsxs("div", { className: "rounded-[25px] shadow-lg p-5 m-4 bg-white dark:bg-neutral-900 text-neutral-900 dark:text-stone-200", children: [_jsx(ModalHeader, {}), _jsx("div", { className: "flex flex-col items-center justify-center", children: _jsxs("div", { className: "flex mb-2 justify-center sm:justify-between w-full flex-wrap max-w-screen", children: [_jsxs("div", { className: "flex flex-col", children: [_jsx("div", { className: "w-80 h-80 sm:w-48 sm:h-48 rounded-[25px] flex items-center justify-center relative bg-neutral-100 dark:bg-neutral-800", children: _jsx("div", { className: "overflow-hidden rounded-lg w-80 h-80 sm:w-48 sm:h-48 p-2", children: _jsx(BlockiesSvg, { address: address, className: "drop-shadow w-full h-full rounded-[20px]" }) }) }), _jsx("div", { className: "my-4 w-80 sm:w-48 p-2 border rounded-[15px] text-sm duration-300 bg-neutral-100 dark:bg-neutral-800 text-neutral-500 dark:text-neutral-400 border-neutral-200 dark:border-neutral-700", children: "You are creating an account that you can use across all N1." })] }), _jsxs("div", { className: "w-80 flex flex-col items-center sm:items-end justify-between h-full my-2", children: [_jsxs("div", { className: "flex flex-col relative bg-neutral-100 dark:bg-neutral-800 border-neutral-200 dark:border-neutral-700 rounded-[15px] border w-72", children: [_jsx("input", { type: "text", id: "username", placeholder: "Enter your username", value: usernameLocal, onChange: function (e) { return setUsernameLocalLocal(e.target.value); }, className: "p-3 py-4 outline-none focus:ring focus:ring-orange-200 bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-stone-200 rounded-[15px] border ".concat(error ? 'border-n1-main' : 'border-neutral-200 dark:border-neutral-700') }), _jsxs("div", { className: "p-2 flex w-full justify-between text-xs text-neutral-500 dark:text-neutral-400", children: [_jsx("span", { className: "font-bold", children: "Username:" }), " ", usernameLocal] }), _jsxs("div", { className: "px-2 pb-2 flex w-full justify-between text-xs text-neutral-500 dark:text-neutral-400", children: [_jsx("span", { className: "font-bold", children: "Wallet:" }), ' ', address.substring(0, 9) + '...' + address.slice(-3)] })] }), error && (_jsx("div", { className: "mt-2 w-72 p-2 text-n1-main bg-n1-main/5 dark:bg-n1-main/20 border border-n1-main/40 rounded-[15px] text-center", children: error })), _jsx("button", { className: "my-4 w-72 py-4 border rounded-[15px] text-white bg-neutral-900 dark:bg-white dark:text-black cursor-pointer duration-300 hover:opacity-80", onClick: handleCreate, children: "Create" }), _jsx("div", { className: "w-72", children: _jsx("button", { className: "w-full py-4 border rounded-[18px] cursor-pointer duration-300 hover:opacity-80 bg-neutral-100 dark:bg-neutral-800 text-neutral-500 dark:text-neutral-400 border-neutral-200 dark:border-neutral-700 hover:opacity-80", onClick: close, children: "Close" }) })] })] }) })] }));
|
|
104
|
+
return (_jsxs("div", { className: "rounded-[25px] shadow-lg p-5 m-4 bg-white dark:bg-neutral-900 text-neutral-900 dark:text-stone-200", children: [_jsx(ModalHeader, {}), _jsx("div", { className: "flex flex-col items-center justify-center", children: _jsxs("div", { className: "flex mb-2 justify-center sm:justify-between w-full flex-wrap max-w-screen", children: [_jsxs("div", { className: "flex flex-col", children: [_jsx("div", { className: "w-80 h-80 sm:w-48 sm:h-48 rounded-[25px] flex items-center justify-center relative bg-neutral-100 dark:bg-neutral-800", children: _jsx("div", { className: "overflow-hidden rounded-lg w-80 h-80 sm:w-48 sm:h-48 p-2", children: _jsx(BlockiesSvg, { address: address, className: "drop-shadow w-full h-full rounded-[20px]" }) }) }), _jsx("div", { className: "my-4 w-80 sm:w-48 p-2 border rounded-[15px] text-sm duration-300 bg-neutral-100 dark:bg-neutral-800 text-neutral-500 dark:text-neutral-400 border-neutral-200 dark:border-neutral-700", children: "You are creating an account that you can use across all N1." })] }), _jsxs("div", { className: "w-80 flex flex-col items-center sm:items-end justify-between h-full my-2", children: [_jsxs("div", { className: "flex flex-col relative bg-neutral-100 dark:bg-neutral-800 border-neutral-200 dark:border-neutral-700 rounded-[15px] border w-72", children: [_jsx("input", { type: "text", id: "username", placeholder: "Enter your username", value: usernameLocal, onChange: function (e) { return setUsernameLocalLocal(e.target.value); }, className: "p-3 py-4 outline-none focus:ring focus:ring-orange-200 bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-stone-200 rounded-[15px] border ".concat(error ? 'border-n1-main' : 'border-neutral-200 dark:border-neutral-700') }), _jsxs("div", { className: "p-2 flex w-full justify-between text-xs text-neutral-500 dark:text-neutral-400", children: [_jsx("span", { className: "font-bold", children: "Username:" }), " ", usernameLocal] }), _jsxs("div", { className: "px-2 pb-2 flex w-full justify-between text-xs text-neutral-500 dark:text-neutral-400", children: [_jsx("span", { className: "font-bold", children: "Wallet:" }), ' ', address.substring(0, 9) + '...' + address.slice(-3)] })] }), error && (_jsx("div", { className: "mt-2 w-72 p-2 text-n1-ww-main bg-n1-ww-main/5 dark:bg-n1-ww-main/20 border border-n1-ww-main/40 rounded-[15px] text-center", children: error })), _jsx("button", { className: "my-4 w-72 py-4 border rounded-[15px] text-white bg-neutral-900 dark:bg-white dark:text-black cursor-pointer duration-300 hover:opacity-80", onClick: handleCreate, children: "Create" }), _jsx("div", { className: "w-72", children: _jsx("button", { className: "w-full py-4 border rounded-[18px] cursor-pointer duration-300 hover:opacity-80 bg-neutral-100 dark:bg-neutral-800 text-neutral-500 dark:text-neutral-400 border-neutral-200 dark:border-neutral-700 hover:opacity-80", onClick: close, children: "Close" }) })] })] }) })] }));
|
|
105
105
|
}
|
|
106
106
|
//# sourceMappingURL=CreateUserView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateUserView.js","sourceRoot":"","sources":["../../../../src/Modal/NTSFlow/views/CreateUserView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,UAAU,cAAc;IACtB,IAAA,KAMF,0BAA0B,EAAE,EAL9B,WAAW,iBAAA,EACX,cAAc,oBAAA,EACd,WAAW,iBAAA,EACX,oBAAoB,0BAAA,EACpB,WAAW,iBACmB,CAAC;IACzB,IAAA,OAAO,GAAK,kBAAkB,EAAE,QAAzB,CAA0B;IAEzC,IAAM,KAAK,GAAG;QACZ,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEI,IAAA,KAAyC,QAAQ,CACrD,aAAa,CAAC,OAAO,CAAC,CACvB,EAF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,IAAK,OAAA,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAArC,CAAqC,EACtD,SAAS,EAAE,+JAAwJ,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,4CAA4C,CAAE,GAC5O,EACF,eAAK,SAAS,EAAC,gFAAgF,aAC7F,eAAM,SAAS,EAAC,WAAW,0BAAiB,OAAE,aAAa,IACvD,EACN,eAAK,SAAS,EAAC,sFAAsF,aACnG,eAAM,SAAS,EAAC,WAAW,wBAAe,EAAC,GAAG,EAC7C,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAChD,IACF,EACL,KAAK,IAAI,CACR,cAAK,SAAS,EAAC,4HAA4H,YACxI,KAAK,GACF,CACP,EAED,iBACE,SAAS,EAAC,2IAA2I,EACrJ,OAAO,EAAE,YAAY,uBAGd,EACT,cAAK,SAAS,EAAC,MAAM,YACnB,iBACE,SAAS,EAAC,sNAAsN,EAChO,OAAO,EAAE,KAAK,sBAGP,GACL,IACF,IACF,GACF,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import BlockiesSvg from 'blockies-react-svg';\nimport { useState } from 'react';\nimport { getPseudoName } from '../../../Logic/getPseudoName';\nimport { createUser } from '../../../Logic/utils';\nimport {\n useN1WalletContext,\n useN1WalletInternalContext,\n} from '../../../Provider/hooks';\nimport { N1ModalViewMode } from '../../../Provider/types';\nimport { WalletError, WalletErrorCode } from '../../../errors/types';\nimport { logger } from '../../../utils/logger';\nimport { ModalHeader } from '../components/ModalHeader';\n\nexport function CreateUserView() {\n const {\n setViewMode,\n setIsConnected,\n setUsername,\n setStartClosingLogin,\n handleError,\n } = useN1WalletInternalContext();\n const { address } = useN1WalletContext();\n\n const close = () => {\n setStartClosingLogin(true);\n };\n\n const [usernameLocal, setUsernameLocalLocal] = useState(\n getPseudoName(address)\n );\n const [error, setError] = useState('');\n\n function validateUsername() {\n if (!usernameLocal) {\n setError('Username cannot be blank.');\n return false;\n }\n if (!/^[a-zA-Z0-9-]+$/.test(usernameLocal)) {\n setError('Username must be alphanumeric.');\n return false;\n }\n setError('');\n return true;\n }\n\n async function handleCreate() {\n logger.debug('Creating User');\n\n try {\n if (!validateUsername()) {\n return;\n }\n\n await createUser(usernameLocal);\n setViewMode(N1ModalViewMode.Success);\n setIsConnected(true);\n setUsername(usernameLocal);\n localStorage.setItem('n1_' + address + '_username', usernameLocal);\n } catch (error) {\n if (error instanceof WalletError) {\n handleError(error);\n } else {\n handleError(\n new WalletError(WalletErrorCode.UNKNOWN, 'Failed to create user', {\n originalError: error,\n })\n );\n }\n }\n }\n\n return (\n <div className=\"rounded-[25px] shadow-lg p-5 m-4 bg-white dark:bg-neutral-900 text-neutral-900 dark:text-stone-200\">\n <ModalHeader />\n <div className=\"flex flex-col items-center justify-center\">\n <div className=\"flex mb-2 justify-center sm:justify-between w-full flex-wrap max-w-screen\">\n <div className=\"flex flex-col\">\n <div className=\"w-80 h-80 sm:w-48 sm:h-48 rounded-[25px] flex items-center justify-center relative bg-neutral-100 dark:bg-neutral-800\">\n <div className=\"overflow-hidden rounded-lg w-80 h-80 sm:w-48 sm:h-48 p-2\">\n <BlockiesSvg\n address={address}\n className=\"drop-shadow w-full h-full rounded-[20px]\"\n />\n </div>\n </div>\n <div className=\"my-4 w-80 sm:w-48 p-2 border rounded-[15px] text-sm duration-300 bg-neutral-100 dark:bg-neutral-800 text-neutral-500 dark:text-neutral-400 border-neutral-200 dark:border-neutral-700\">\n You are creating an account that you can use across all N1.\n </div>\n </div>\n\n {/* Username Input */}\n <div className=\"w-80 flex flex-col items-center sm:items-end justify-between h-full my-2\">\n <div className=\"flex flex-col relative bg-neutral-100 dark:bg-neutral-800 border-neutral-200 dark:border-neutral-700 rounded-[15px] border w-72\">\n <input\n type=\"text\"\n id=\"username\"\n placeholder=\"Enter your username\"\n value={usernameLocal}\n onChange={(e) => setUsernameLocalLocal(e.target.value)}\n className={`p-3 py-4 outline-none focus:ring focus:ring-orange-200 bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-stone-200 rounded-[15px] border ${error ? 'border-n1-main' : 'border-neutral-200 dark:border-neutral-700'}`}\n />\n <div className=\"p-2 flex w-full justify-between text-xs text-neutral-500 dark:text-neutral-400\">\n <span className=\"font-bold\">Username:</span> {usernameLocal}\n </div>\n <div className=\"px-2 pb-2 flex w-full justify-between text-xs text-neutral-500 dark:text-neutral-400\">\n <span className=\"font-bold\">Wallet:</span>{' '}\n {address.substring(0, 9) + '...' + address.slice(-3)}\n </div>\n </div>\n {error && (\n <div className=\"mt-2 w-72 p-2 text-n1-ww-main bg-n1-ww-main/5 dark:bg-n1-ww-main/20 border border-n1-ww-main/40 rounded-[15px] text-center\">\n {error}\n </div>\n )}\n\n <button\n className=\"my-4 w-72 py-4 border rounded-[15px] text-white bg-neutral-900 dark:bg-white dark:text-black cursor-pointer duration-300 hover:opacity-80\"\n onClick={handleCreate}\n >\n Create\n </button>\n <div className=\"w-72\">\n <button\n className=\"w-full py-4 border rounded-[18px] cursor-pointer duration-300 hover:opacity-80 bg-neutral-100 dark:bg-neutral-800 text-neutral-500 dark:text-neutral-400 border-neutral-200 dark:border-neutral-700 hover:opacity-80\"\n onClick={close}\n >\n Close\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -29,15 +29,15 @@ export function NoWhitelistView() {
|
|
|
29
29
|
var addressText = address
|
|
30
30
|
? "".concat(address.substring(0, 6), "...").concat(address.slice(-4))
|
|
31
31
|
: '';
|
|
32
|
-
return (_jsxs("div", { className: "bg-n1-gray-50 dark:bg-n1-gray-950 relative border border-n1-gray-200 dark:border-n1-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity]", children: [_jsx("div", { className: "p-6 border-b border-n1-gray-200 dark:border-n1-gray-800", children: _jsx(ModalHeader, {}) }), _jsx("div", { className: "p-6 overflow-hidden relative", children: _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "text-center", children: [_jsx("h3", { className: "text-xl font-medium text-n1-gray-900 dark:text-white mb-2", children: "Not Whitelisted" }), _jsxs("p", { className: "text-n1-gray-500 dark:text-n1-gray-400", children: ["The wallet address ", addressText, " is not whitelisted for access."] })] }), _jsx("button", { onClick: disconnect, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () {
|
|
32
|
+
return (_jsxs("div", { className: "bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 relative border border-n1-ww-gray-200 dark:border-n1-ww-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity]", children: [_jsx("div", { className: "p-6 border-b border-n1-ww-gray-200 dark:border-n1-ww-gray-800", children: _jsx(ModalHeader, {}) }), _jsx("div", { className: "p-6 overflow-hidden relative", children: _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "text-center", children: [_jsx("h3", { className: "text-xl font-medium text-n1-ww-gray-900 dark:text-white mb-2", children: "Not Whitelisted" }), _jsxs("p", { className: "text-n1-ww-gray-500 dark:text-n1-ww-gray-400", children: ["The wallet address ", addressText, " is not whitelisted for access."] })] }), _jsx("button", { onClick: disconnect, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () {
|
|
33
33
|
setIsHovered(false);
|
|
34
34
|
setIsPressed(false);
|
|
35
|
-
}, onMouseDown: function () { return setIsPressed(true); }, onMouseUp: function () { return setIsPressed(false); }, className: "\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n cursor-pointer border-n1-gray-200 dark:border-n1-gray-800 hover:border-n1-gray-400 dark:hover:border-white/60\n "), style: {
|
|
35
|
+
}, onMouseDown: function () { return setIsPressed(true); }, onMouseUp: function () { return setIsPressed(false); }, className: "\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-ww-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n cursor-pointer border-n1-ww-gray-200 dark:border-n1-ww-gray-800 hover:border-n1-ww-gray-400 dark:hover:border-white/60\n "), style: {
|
|
36
36
|
transform: isPressed
|
|
37
37
|
? 'scale(0.98)'
|
|
38
38
|
: isHovered
|
|
39
39
|
? 'scale(0.99)'
|
|
40
40
|
: 'scale(1)',
|
|
41
|
-
}, children: _jsx("div", { className: "relative z-[200] pl-4 isolate", children: _jsx("div", { className: "flex items-center justify-center", children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-n1-gray-500 dark:text-neutral-400 group-hover:text-n1-gray-900 dark:group-hover:text-white\n "), children: "Disconnect" }) }) }) })] }) })] }));
|
|
41
|
+
}, children: _jsx("div", { className: "relative z-[200] pl-4 isolate", children: _jsx("div", { className: "flex items-center justify-center", children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-n1-ww-gray-500 dark:text-neutral-400 group-hover:text-n1-ww-gray-900 dark:group-hover:text-white\n "), children: "Disconnect" }) }) }) })] }) })] }));
|
|
42
42
|
}
|
|
43
43
|
//# sourceMappingURL=NoWhitelistView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoWhitelistView.js","sourceRoot":"","sources":["../../../../src/Modal/NTSFlow/views/NoWhitelistView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,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["import { useState } from 'react';\nimport {\n useN1WalletContext,\n useN1WalletInternalContext,\n} from '../../../Provider/hooks';\nimport { N1ModalViewMode } from '../../../Provider/types';\nimport { ANIMATION_EASE } from '../../NordFlow/constants';\nimport { ModalHeader } from '../components/ModalHeader';\n\nexport function NoWhitelistView() {\n const { setViewMode, dynamicHandleLogOut, setIsConnected } =\n useN1WalletInternalContext();\n const { address } = useN1WalletContext();\n const [isHovered, setIsHovered] = useState(false);\n const [isPressed, setIsPressed] = useState(false);\n\n function disconnect() {\n // TODO: create a util function for disconnecting and clearing local storage\n dynamicHandleLogOut();\n if (typeof window !== 'undefined') {\n localStorage.clear();\n if ('caches' in window) {\n caches.keys().then(function (cacheNames) {\n cacheNames.forEach(function (cacheName) {\n caches.delete(cacheName);\n });\n });\n }\n window.location.reload();\n }\n\n setViewMode(N1ModalViewMode.Connect);\n setIsConnected(false);\n }\n\n const addressText = address\n ? `${address.substring(0, 6)}...${address.slice(-4)}`\n : '';\n\n return (\n <div className=\"bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 relative border border-n1-ww-gray-200 dark:border-n1-ww-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity]\">\n <div className=\"p-6 border-b border-n1-ww-gray-200 dark:border-n1-ww-gray-800\">\n <ModalHeader />\n </div>\n\n <div className=\"p-6 overflow-hidden relative\">\n <div className=\"space-y-6\">\n <div className=\"text-center\">\n <h3 className=\"text-xl font-medium text-n1-ww-gray-900 dark:text-white mb-2\">\n Not Whitelisted\n </h3>\n <p className=\"text-n1-ww-gray-500 dark:text-n1-ww-gray-400\">\n The wallet address {addressText} is not whitelisted for access.\n </p>\n </div>\n\n <button\n onClick={disconnect}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => {\n setIsHovered(false);\n setIsPressed(false);\n }}\n onMouseDown={() => setIsPressed(true)}\n onMouseUp={() => setIsPressed(false)}\n className={`\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-ww-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE}\n cursor-pointer border-n1-ww-gray-200 dark:border-n1-ww-gray-800 hover:border-n1-ww-gray-400 dark:hover:border-white/60\n `}\n style={{\n transform: isPressed\n ? 'scale(0.98)'\n : isHovered\n ? 'scale(0.99)'\n : 'scale(1)',\n }}\n >\n <div className=\"relative z-[200] pl-4 isolate\">\n <div className=\"flex items-center justify-center\">\n <span\n className={`\n text-base font-medium tracking-wide transition-colors duration-300 ${ANIMATION_EASE}\n text-n1-ww-gray-500 dark:text-neutral-400 group-hover:text-n1-ww-gray-900 dark:group-hover:text-white\n `}\n >\n Disconnect\n </span>\n </div>\n </div>\n </button>\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ModalHeader } from '../components/ModalHeader';
|
|
3
3
|
export function SigningView() {
|
|
4
|
-
return (_jsxs("div", { className: "bg-n1-gray-50 dark:bg-n1-gray-950 relative border border-n1-gray-200 dark:border-n1-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity]", children: [_jsx("div", { className: "p-6 border-b border-n1-gray-200 dark:border-n1-gray-800", children: _jsx(ModalHeader, {}) }), _jsx("div", { className: "p-6 overflow-hidden relative", children: _jsxs("div", { className: "flex flex-col items-center justify-center py-12 space-y-6", children: [_jsx("div", { className: "relative", children: _jsx("div", { className: "n1-animate-spin rounded-full h-16 w-16 border-2 border-n1-gray-200 dark:border-n1-gray-800", children: _jsx("div", { className: "absolute inset-0 rounded-full border-t-2 border-n1-main" }) }) }), _jsxs("div", { className: "space-y-2 text-center w-[300px]", children: [_jsxs("h3", { className: "text-xl text-n1-gray-900 dark:text-white transition-all duration-300 h-[32px] flex items-center justify-center relative font-semibold", children: [_jsx("span", { className: "opacity-0 absolute select-none", "aria-hidden": "true", children: "Waiting for signature" }), _jsx("div", { className: "absolute min-w-[280px]", children: "Waiting for signature" })] }), _jsxs("p", { className: "text-sm text-n1-gray-600 dark:text-neutral-400 h-[20px] flex items-center justify-center relative", children: [_jsx("span", { className: "opacity-0 absolute select-none", "aria-hidden": "true", children: "Please sign the message in your wallet" }), _jsx("div", { className: "absolute min-w-[280px]", children: "Please sign the message in your wallet" })] })] })] }) })] }));
|
|
4
|
+
return (_jsxs("div", { className: "bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 relative border border-n1-ww-gray-200 dark:border-n1-ww-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity]", children: [_jsx("div", { className: "p-6 border-b border-n1-ww-gray-200 dark:border-n1-ww-gray-800", children: _jsx(ModalHeader, {}) }), _jsx("div", { className: "p-6 overflow-hidden relative", children: _jsxs("div", { className: "flex flex-col items-center justify-center py-12 space-y-6", children: [_jsx("div", { className: "relative", children: _jsx("div", { className: "n1-animate-spin rounded-full h-16 w-16 border-2 border-n1-ww-gray-200 dark:border-n1-ww-gray-800", children: _jsx("div", { className: "absolute inset-0 rounded-full border-t-2 border-n1-ww-main" }) }) }), _jsxs("div", { className: "space-y-2 text-center w-[300px]", children: [_jsxs("h3", { className: "text-xl text-n1-ww-gray-900 dark:text-white transition-all duration-300 h-[32px] flex items-center justify-center relative font-semibold", children: [_jsx("span", { className: "opacity-0 absolute select-none", "aria-hidden": "true", children: "Waiting for signature" }), _jsx("div", { className: "absolute min-w-[280px]", children: "Waiting for signature" })] }), _jsxs("p", { className: "text-sm text-n1-ww-gray-600 dark:text-neutral-400 h-[20px] flex items-center justify-center relative", children: [_jsx("span", { className: "opacity-0 absolute select-none", "aria-hidden": "true", children: "Please sign the message in your wallet" }), _jsx("div", { className: "absolute min-w-[280px]", children: "Please sign the message in your wallet" })] })] })] }) })] }));
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=SigningView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SigningView.js","sourceRoot":"","sources":["../../../../src/Modal/NTSFlow/views/SigningView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,UAAU,WAAW;IACzB,OAAO,CACL,eAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"SigningView.js","sourceRoot":"","sources":["../../../../src/Modal/NTSFlow/views/SigningView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,UAAU,WAAW;IACzB,OAAO,CACL,eAAK,SAAS,EAAC,8RAA8R,aAC3S,cAAK,SAAS,EAAC,+DAA+D,YAC5E,KAAC,WAAW,KAAG,GACX,EAEN,cAAK,SAAS,EAAC,8BAA8B,YAC3C,eAAK,SAAS,EAAC,2DAA2D,aACxE,cAAK,SAAS,EAAC,UAAU,YACvB,cAAK,SAAS,EAAC,kGAAkG,YAC/G,cAAK,SAAS,EAAC,4DAA4D,GAAO,GAC9E,GACF,EACN,eAAK,SAAS,EAAC,iCAAiC,aAC9C,cAAI,SAAS,EAAC,0IAA0I,aACtJ,eACE,SAAS,EAAC,gCAAgC,iBAC9B,MAAM,sCAGb,EACP,cAAK,SAAS,EAAC,wBAAwB,sCAEjC,IACH,EACL,aAAG,SAAS,EAAC,sGAAsG,aACjH,eACE,SAAS,EAAC,gCAAgC,iBAC9B,MAAM,uDAGb,EACP,cAAK,SAAS,EAAC,wBAAwB,uDAEjC,IACJ,IACA,IACF,GACF,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { ModalHeader } from '../components/ModalHeader';\n\nexport function SigningView() {\n return (\n <div className=\"bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 relative border border-n1-ww-gray-200 dark:border-n1-ww-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity]\">\n <div className=\"p-6 border-b border-n1-ww-gray-200 dark:border-n1-ww-gray-800\">\n <ModalHeader />\n </div>\n\n <div className=\"p-6 overflow-hidden relative\">\n <div className=\"flex flex-col items-center justify-center py-12 space-y-6\">\n <div className=\"relative\">\n <div className=\"n1-animate-spin rounded-full h-16 w-16 border-2 border-n1-ww-gray-200 dark:border-n1-ww-gray-800\">\n <div className=\"absolute inset-0 rounded-full border-t-2 border-n1-ww-main\"></div>\n </div>\n </div>\n <div className=\"space-y-2 text-center w-[300px]\">\n <h3 className=\"text-xl text-n1-ww-gray-900 dark:text-white transition-all duration-300 h-[32px] flex items-center justify-center relative font-semibold\">\n <span\n className=\"opacity-0 absolute select-none\"\n aria-hidden=\"true\"\n >\n Waiting for signature\n </span>\n <div className=\"absolute min-w-[280px]\">\n Waiting for signature\n </div>\n </h3>\n <p className=\"text-sm text-n1-ww-gray-600 dark:text-neutral-400 h-[20px] flex items-center justify-center relative\">\n <span\n className=\"opacity-0 absolute select-none\"\n aria-hidden=\"true\"\n >\n Please sign the message in your wallet\n </span>\n <div className=\"absolute min-w-[280px]\">\n Please sign the message in your wallet\n </div>\n </p>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -20,7 +20,7 @@ var EnhancedIdleScreen = withImageFallback(IdleScreen);
|
|
|
20
20
|
*/
|
|
21
21
|
export var NordFlow = function (_a) {
|
|
22
22
|
var onClose = _a.onClose;
|
|
23
|
-
return (_jsx("div", { className: "z-50 flex items-center justify-center overflow-auto font-era", children: _jsxs("div", { className: "bg-n1-gray-50 dark:bg-n1-gray-950 relative border border-n1-gray-200 dark:border-n1-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity min-w-96", children: [_jsx(Header, { onClose: onClose }), _jsx("div", { className: "wallet-connection-flow-content p-6 overflow-hidden", children: _jsx(NordFlowScreenRenderer, { onClose: onClose }) })] }) }));
|
|
23
|
+
return (_jsx("div", { className: "z-50 flex items-center justify-center overflow-auto font-era", children: _jsxs("div", { className: "bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 relative border border-n1-ww-gray-200 dark:border-n1-ww-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity min-w-96", children: [_jsx(Header, { onClose: onClose }), _jsx("div", { className: "wallet-connection-flow-content p-6 overflow-hidden", children: _jsx(NordFlowScreenRenderer, { onClose: onClose }) })] }) }));
|
|
24
24
|
};
|
|
25
25
|
// Screen renderer component that uses the flow state context
|
|
26
26
|
var NordFlowScreenRenderer = function (_a) {
|
|
@@ -52,6 +52,6 @@ var NordFlowScreenRenderer = function (_a) {
|
|
|
52
52
|
return _jsx(EnhancedIdleScreen, {});
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
return (_jsx("div", { className: isClosing ? 'n1-animate-fade-out' : 'n1-animate-fade-in', children: renderScreen() }));
|
|
55
|
+
return (_jsx("div", { className: isClosing ? 'n1-ww-animate-fade-out' : 'n1-ww-animate-fade-in', children: renderScreen() }));
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=NordFlow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NordFlow.js","sourceRoot":"","sources":["../../../src/Modal/NordFlow/NordFlow.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EACL,iBAAiB,E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QAAT,OAAO,aAAA;IAC3E,6BAA6B;IACvB,IAAA,KAGF,mBAAmB,EAAE,EAFvB,KAAK,WAAA,EACL,SAAS,eACc,CAAC;IAE1B,2DAA2D;IAC3D,IAAM,YAAY,GAAG;QACnB,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,SAAS,CAAC,iBAAiB;gBAC9B,OAAO,KAAC,2BAA2B,KAAG,CAAC;YACzC,KAAK,SAAS,CAAC,eAAe;gBAC5B,OAAO,KAAC,4BAA4B,KAAG,CAAC;YAC1C,KAAK,SAAS,CAAC,eAAe;gBAC5B,OAAO,KAAC,2BAA2B,KAAG,CAAC;YACzC,KAAK,SAAS,CAAC,YAAY;gBACzB,OAAO,KAAC,yBAAyB,KAAG,CAAC;YACvC,KAAK,SAAS,CAAC,gBAAgB;gBAC7B,OAAO,KAAC,6BAA6B,KAAG,CAAC;YAC3C,KAAK,SAAS,CAAC,eAAe;gBAC5B,OAAO,KAAC,4BAA4B,KAAG,CAAC;YAC1C,KAAK,SAAS,CAAC,YAAY;gBACzB,OAAO,KAAC,yBAAyB,KAAG,CAAC;YACvC,KAAK,SAAS,CAAC,aAAa;gBAC1B,OAAO,KAAC,0BAA0B,IAAC,MAAM,EAAE,OAAO,IAAI,CAAC,cAAQ,CAAC,CAAC,GAAI,CAAC;YACxE,KAAK,SAAS,CAAC,KAAK;gBAClB,OAAO,KAAC,mBAAmB,KAAG,CAAC;YACjC;gBACE,OAAO,KAAC,kBAAkB,KAAG,CAAC;QAClC,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,cAAK,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,uBAAuB,YAC3E,YAAY,EAAE,GACX,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Header } from './components';\nimport { useFlowStateContext } from './context';\nimport { withImageFallback } from './hoc';\nimport {\n AmountInputScreen,\n AuthLoadingScreen,\n ChainSelectionScreen,\n ConnectWalletScreen,\n DepositProgressScreen,\n DepositSuccessScreen,\n ErrorScreen,\n EvmWalletAuthScreen,\n FinalSuccessScreen,\n IdleScreen,\n} from './screens';\nimport { FlowState } from './types';\n\ninterface NordFlowProps {\n onClose?: () => void;\n}\n\n// Apply the withImageFallback HOC to all screen components\nconst EnhancedConnectWalletScreen = withImageFallback(ConnectWalletScreen);\nconst EnhancedEvmWalletAuthScreen = withImageFallback(EvmWalletAuthScreen);\nconst EnhancedChainSelectionScreen = withImageFallback(ChainSelectionScreen);\nconst EnhancedAmountInputScreen = withImageFallback(AmountInputScreen);\nconst EnhancedDepositProgressScreen = withImageFallback(DepositProgressScreen);\nconst EnhancedDepositSuccessScreen = withImageFallback(DepositSuccessScreen);\nconst EnhancedAuthLoadingScreen = withImageFallback(AuthLoadingScreen);\nconst EnhancedFinalSuccessScreen = withImageFallback(FinalSuccessScreen);\nconst EnhancedErrorScreen = withImageFallback(ErrorScreen);\nconst EnhancedIdleScreen = withImageFallback(IdleScreen);\n\n/**\n * Main component for the wallet connection flow\n */\nexport const NordFlow: React.FC<NordFlowProps> = ({ onClose }) => {\n return (\n <div\n className={`z-50 flex items-center justify-center overflow-auto font-era`}\n >\n <div className=\"bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 relative border border-n1-ww-gray-200 dark:border-n1-ww-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full max-w-sm m-4 origin-center will-change-[max-width,transform,opacity min-w-96\">\n {/* Header */}\n <Header onClose={onClose} />\n\n {/* Content */}\n <div className=\"wallet-connection-flow-content p-6 overflow-hidden\">\n <NordFlowScreenRenderer onClose={onClose} />\n </div>\n </div>\n </div>\n );\n};\n\n// Screen renderer component that uses the flow state context\nconst NordFlowScreenRenderer: React.FC<{ onClose?: () => void }> = ({ onClose }) => {\n // Use the flow state context\n const {\n state,\n isClosing,\n } = useFlowStateContext();\n\n // Render the appropriate screen based on the current state\n const renderScreen = () => {\n switch (state) {\n case FlowState.CONNECTING_WALLET:\n return <EnhancedConnectWalletScreen />;\n case FlowState.CHAIN_SELECTION:\n return <EnhancedChainSelectionScreen />;\n case FlowState.ETH_TO_SOL_AUTH:\n return <EnhancedEvmWalletAuthScreen />;\n case FlowState.AMOUNT_INPUT:\n return <EnhancedAmountInputScreen />;\n case FlowState.DEPOSIT_PROGRESS:\n return <EnhancedDepositProgressScreen />;\n case FlowState.DEPOSIT_SUCCESS:\n return <EnhancedDepositSuccessScreen />;\n case FlowState.AUTH_LOADING:\n return <EnhancedAuthLoadingScreen />;\n case FlowState.FINAL_SUCCESS:\n return <EnhancedFinalSuccessScreen onDone={onClose || (() => { })} />;\n case FlowState.ERROR:\n return <EnhancedErrorScreen />;\n default:\n return <EnhancedIdleScreen />;\n }\n };\n\n return (\n <div className={isClosing ? 'n1-ww-animate-fade-out' : 'n1-ww-animate-fade-in'}>\n {renderScreen()}\n </div>\n );\n};\n"]}
|
|
@@ -7,16 +7,16 @@ export function ChainButton(_a) {
|
|
|
7
7
|
onClick(chain.id);
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
|
-
var baseClasses = 'flex flex-col items-center justify-center p-6 bg-n1-gray-50 dark:bg-n1-gray-950 border-2 border-n1-gray-100 dark:border-n1-gray-800 transition-all duration-200 group rounded-lg';
|
|
11
|
-
var enabledClasses = 'hover:border-red-500 dark:hover:border-red-500 hover:bg-red-50/50 dark:hover:bg-n1-gray-900';
|
|
10
|
+
var baseClasses = 'flex flex-col items-center justify-center p-6 bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 border-2 border-n1-ww-gray-100 dark:border-n1-ww-gray-800 transition-all duration-200 group rounded-lg';
|
|
11
|
+
var enabledClasses = 'hover:border-red-500 dark:hover:border-red-500 hover:bg-red-50/50 dark:hover:bg-n1-ww-gray-900';
|
|
12
12
|
var disabledClasses = 'opacity-50 cursor-not-allowed';
|
|
13
13
|
var buttonClasses = "".concat(baseClasses, " ").concat(disabled ? disabledClasses : enabledClasses);
|
|
14
14
|
var imageClasses = disabled
|
|
15
15
|
? 'opacity-50 grayscale'
|
|
16
16
|
: 'opacity-90 grayscale group-hover:grayscale-0 group-hover:scale-105 transition-all duration-200';
|
|
17
17
|
var textClasses = disabled
|
|
18
|
-
? 'mt-4 font-medium text-n1-gray-400 dark:text-n1-gray-500'
|
|
19
|
-
: 'mt-4 font-medium text-n1-gray-600 dark:text-n1-gray-400 group-hover:text-red-500 dark:group-hover:text-n1-gray-50 transition-colors duration-200';
|
|
20
|
-
return (_jsxs("button", { onClick: handleClick, className: buttonClasses, disabled: disabled, children: [typeof chain.logo === 'string' ? (_jsx(ImageWithFallback, { src: chain.logo, width: 48, height: 48, alt: chain.name, className: imageClasses, fallbackClassName: "w-12 h-12 rounded-full text-lg font-bold opacity-90 group-hover:scale-105 transition-all duration-200", fallbackBgColor: "bg-n1-main/10 dark:bg-n1-main/20", fallbackTextColor: "text-n1-main dark:text-n1-main" })) : (_jsx("div", { className: imageClasses, children: chain.logo })), _jsx("span", { className: textClasses, children: chain.name })] }));
|
|
18
|
+
? 'mt-4 font-medium text-n1-ww-gray-400 dark:text-n1-ww-gray-500'
|
|
19
|
+
: 'mt-4 font-medium text-n1-ww-gray-600 dark:text-n1-ww-gray-400 group-hover:text-red-500 dark:group-hover:text-n1-ww-gray-50 transition-colors duration-200';
|
|
20
|
+
return (_jsxs("button", { onClick: handleClick, className: buttonClasses, disabled: disabled, children: [typeof chain.logo === 'string' ? (_jsx(ImageWithFallback, { src: chain.logo, width: 48, height: 48, alt: chain.name, className: imageClasses, fallbackClassName: "w-12 h-12 rounded-full text-lg font-bold opacity-90 group-hover:scale-105 transition-all duration-200", fallbackBgColor: "bg-n1-ww-main/10 dark:bg-n1-ww-main/20", fallbackTextColor: "text-n1-ww-main dark:text-n1-ww-main" })) : (_jsx("div", { className: imageClasses, children: chain.logo })), _jsx("span", { className: textClasses, children: chain.name })] }));
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=ChainButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainButton.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/components/ChainButton.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQxD,MAAM,UAAU,WAAW,CAAC,EAIT;QAHjB,KAAK,WAAA,EACL,OAAO,aAAA,EACP,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA;IAEhB,IAAM,WAAW,GAAG;QAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,IAAM,WAAW,GACf,
|
|
1
|
+
{"version":3,"file":"ChainButton.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/components/ChainButton.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQxD,MAAM,UAAU,WAAW,CAAC,EAIT;QAHjB,KAAK,WAAA,EACL,OAAO,aAAA,EACP,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA;IAEhB,IAAM,WAAW,GAAG;QAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,IAAM,WAAW,GACf,8LAA8L,CAAC;IACjM,IAAM,cAAc,GAClB,gGAAgG,CAAC;IACnG,IAAM,eAAe,GAAG,+BAA+B,CAAC;IAExD,IAAM,aAAa,GAAG,UAAG,WAAW,cAAI,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,CAAE,CAAC;IAEtF,IAAM,YAAY,GAAG,QAAQ;QAC3B,CAAC,CAAC,sBAAsB;QACxB,CAAC,CAAC,gGAAgG,CAAC;IAErG,IAAM,WAAW,GAAG,QAAQ;QAC1B,CAAC,CAAC,+DAA+D;QACjE,CAAC,CAAC,2JAA2J,CAAC;IAEhK,OAAO,CACL,kBAAQ,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,aACvE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAChC,KAAC,iBAAiB,IAChB,GAAG,EAAE,KAAK,CAAC,IAAI,EACf,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,GAAG,EAAE,KAAK,CAAC,IAAI,EACf,SAAS,EAAE,YAAY,EACvB,iBAAiB,EAAC,uGAAuG,EACzH,eAAe,EAAC,wCAAwC,EACxD,iBAAiB,EAAC,sCAAsC,GACxD,CACH,CAAC,CAAC,CAAC,CACF,cAAK,SAAS,EAAE,YAAY,YAAG,KAAK,CAAC,IAAI,GAAO,CACjD,EACD,eAAM,SAAS,EAAE,WAAW,YAAG,KAAK,CAAC,IAAI,GAAQ,IAC1C,CACV,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Chain } from '../types';\nimport { ImageWithFallback } from './ImageWithFallback';\n\ninterface ChainButtonProps {\n chain: Chain;\n onClick: (chainId: string) => void;\n disabled?: boolean;\n}\n\nexport function ChainButton({\n chain,\n onClick,\n disabled = false,\n}: ChainButtonProps) {\n const handleClick = () => {\n if (!disabled) {\n onClick(chain.id);\n }\n };\n\n const baseClasses =\n 'flex flex-col items-center justify-center p-6 bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 border-2 border-n1-ww-gray-100 dark:border-n1-ww-gray-800 transition-all duration-200 group rounded-lg';\n const enabledClasses =\n 'hover:border-red-500 dark:hover:border-red-500 hover:bg-red-50/50 dark:hover:bg-n1-ww-gray-900';\n const disabledClasses = 'opacity-50 cursor-not-allowed';\n\n const buttonClasses = `${baseClasses} ${disabled ? disabledClasses : enabledClasses}`;\n\n const imageClasses = disabled\n ? 'opacity-50 grayscale'\n : 'opacity-90 grayscale group-hover:grayscale-0 group-hover:scale-105 transition-all duration-200';\n\n const textClasses = disabled\n ? 'mt-4 font-medium text-n1-ww-gray-400 dark:text-n1-ww-gray-500'\n : 'mt-4 font-medium text-n1-ww-gray-600 dark:text-n1-ww-gray-400 group-hover:text-red-500 dark:group-hover:text-n1-ww-gray-50 transition-colors duration-200';\n\n return (\n <button onClick={handleClick} className={buttonClasses} disabled={disabled}>\n {typeof chain.logo === 'string' ? (\n <ImageWithFallback\n src={chain.logo}\n width={48}\n height={48}\n alt={chain.name}\n className={imageClasses}\n fallbackClassName=\"w-12 h-12 rounded-full text-lg font-bold opacity-90 group-hover:scale-105 transition-all duration-200\"\n fallbackBgColor=\"bg-n1-ww-main/10 dark:bg-n1-ww-main/20\"\n fallbackTextColor=\"text-n1-ww-main dark:text-n1-ww-main\"\n />\n ) : (\n <div className={imageClasses}>{chain.logo}</div>\n )}\n <span className={textClasses}>{chain.name}</span>\n </button>\n );\n}\n"]}
|
|
@@ -7,13 +7,13 @@ export function EVMChainsButton(_a) {
|
|
|
7
7
|
onClick(chain.id);
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
|
-
var baseClasses = 'flex flex-col items-center justify-center p-6 bg-n1-gray-50 dark:bg-n1-gray-950 border-2 border-n1-gray-100 dark:border-n1-gray-800 transition-all duration-200 group rounded-lg';
|
|
11
|
-
var enabledClasses = 'hover:border-red-500 dark:hover:border-red-500 hover:bg-red-50/50 dark:hover:bg-n1-gray-900';
|
|
10
|
+
var baseClasses = 'flex flex-col items-center justify-center p-6 bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 border-2 border-n1-ww-gray-100 dark:border-n1-ww-gray-800 transition-all duration-200 group rounded-lg';
|
|
11
|
+
var enabledClasses = 'hover:border-red-500 dark:hover:border-red-500 hover:bg-red-50/50 dark:hover:bg-n1-ww-gray-900';
|
|
12
12
|
var disabledClasses = 'opacity-50 cursor-not-allowed';
|
|
13
13
|
var buttonClasses = "".concat(baseClasses, " ").concat(disabled ? disabledClasses : enabledClasses);
|
|
14
14
|
var textClasses = disabled
|
|
15
|
-
? 'mt-4 font-medium text-n1-gray-400 dark:text-n1-gray-500'
|
|
16
|
-
: 'mt-4 font-medium text-n1-gray-600 dark:text-n1-gray-400 group-hover:text-red-500 dark:group-hover:text-n1-gray-50 transition-colors duration-200';
|
|
15
|
+
? 'mt-4 font-medium text-n1-ww-gray-400 dark:text-n1-ww-gray-500'
|
|
16
|
+
: 'mt-4 font-medium text-n1-ww-gray-600 dark:text-n1-ww-gray-400 group-hover:text-red-500 dark:group-hover:text-n1-ww-gray-50 transition-colors duration-200';
|
|
17
17
|
return (_jsxs("button", { onClick: handleClick, className: buttonClasses, disabled: disabled, children: [_jsx(EVMChainsGroup, { size: 32, className: disabled ? 'opacity-50 grayscale' : 'opacity-90' }), _jsx("span", { className: textClasses, children: chain.name })] }));
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=EVMChainsButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EVMChainsButton.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/components/EVMChainsButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,MAAM,UAAU,eAAe,CAAC,EAIT;QAHrB,KAAK,WAAA,EACL,OAAO,aAAA,EACP,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA;IAEhB,IAAM,WAAW,GAAG;QAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,IAAM,WAAW,GACf,
|
|
1
|
+
{"version":3,"file":"EVMChainsButton.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/components/EVMChainsButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,MAAM,UAAU,eAAe,CAAC,EAIT;QAHrB,KAAK,WAAA,EACL,OAAO,aAAA,EACP,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA;IAEhB,IAAM,WAAW,GAAG;QAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,IAAM,WAAW,GACf,8LAA8L,CAAC;IACjM,IAAM,cAAc,GAClB,gGAAgG,CAAC;IACnG,IAAM,eAAe,GAAG,+BAA+B,CAAC;IAExD,IAAM,aAAa,GAAG,UAAG,WAAW,cAAI,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,CAAE,CAAC;IAEtF,IAAM,WAAW,GAAG,QAAQ;QAC1B,CAAC,CAAC,+DAA+D;QACjE,CAAC,CAAC,2JAA2J,CAAC;IAEhK,OAAO,CACL,kBAAQ,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,aACxE,KAAC,cAAc,IACb,IAAI,EAAE,EAAE,EACR,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,YAAY,GAC3D,EACF,eAAM,SAAS,EAAE,WAAW,YAAG,KAAK,CAAC,IAAI,GAAQ,IAC1C,CACV,CAAC;AACJ,CAAC","sourcesContent":["import { Chain } from '../types';\nimport { EVMChainsGroup } from '../../../components/logos';\n\ninterface EVMChainsButtonProps {\n chain: Chain;\n onClick: (chainId: string) => void;\n disabled?: boolean;\n}\n\nexport function EVMChainsButton({\n chain,\n onClick,\n disabled = false,\n}: EVMChainsButtonProps) {\n const handleClick = () => {\n if (!disabled) {\n onClick(chain.id);\n }\n };\n\n const baseClasses =\n 'flex flex-col items-center justify-center p-6 bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 border-2 border-n1-ww-gray-100 dark:border-n1-ww-gray-800 transition-all duration-200 group rounded-lg';\n const enabledClasses =\n 'hover:border-red-500 dark:hover:border-red-500 hover:bg-red-50/50 dark:hover:bg-n1-ww-gray-900';\n const disabledClasses = 'opacity-50 cursor-not-allowed';\n\n const buttonClasses = `${baseClasses} ${disabled ? disabledClasses : enabledClasses}`;\n\n const textClasses = disabled\n ? 'mt-4 font-medium text-n1-ww-gray-400 dark:text-n1-ww-gray-500'\n : 'mt-4 font-medium text-n1-ww-gray-600 dark:text-n1-ww-gray-400 group-hover:text-red-500 dark:group-hover:text-n1-ww-gray-50 transition-colors duration-200';\n\n return (\n <button onClick={handleClick} className={buttonClasses} disabled={disabled}>\n <EVMChainsGroup\n size={32}\n className={disabled ? 'opacity-50 grayscale' : 'opacity-90'}\n />\n <span className={textClasses}>{chain.name}</span>\n </button>\n );\n}\n"]}
|
|
@@ -6,6 +6,6 @@ import Logo from '../../../components/Logo';
|
|
|
6
6
|
*/
|
|
7
7
|
export var Header = function (_a) {
|
|
8
8
|
var onClose = _a.onClose;
|
|
9
|
-
return (_jsx("div", { className: "p-6 border-b border-n1-gray-200 dark:border-n1-gray-800 w-full max-w-2xl mx-auto", children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "flex items-center gap-3", children: _jsx("div", { className: "w-6 h-6 text-n1-gray-50", children: _jsx(Logo, { size: 24 }) }) }), _jsx("button", { onClick: function () { return onClose && onClose(); }, className: "\n text-neutral-400 hover:text-n1-gray-900 dark:hover:text-white \n transition-colors duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]\n h-10 w-10 rounded-full hover:bg-n1-gray-100 dark:hover:bg-n1-gray-800\n flex items-center justify-center\n ", children: _jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" }) }) })] }) }));
|
|
9
|
+
return (_jsx("div", { className: "p-6 border-b border-n1-ww-gray-200 dark:border-n1-ww-gray-800 w-full max-w-2xl mx-auto", children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "flex items-center gap-3", children: _jsx("div", { className: "w-6 h-6 text-n1-ww-gray-50", children: _jsx(Logo, { size: 24 }) }) }), _jsx("button", { onClick: function () { return onClose && onClose(); }, className: "\n text-neutral-400 hover:text-n1-ww-gray-900 dark:hover:text-white \n transition-colors duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]\n h-10 w-10 rounded-full hover:bg-n1-ww-gray-100 dark:hover:bg-n1-ww-gray-800\n flex items-center justify-center\n ", children: _jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" }) }) })] }) }));
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/components/Header.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,0BAA0B,CAAC;AAM5C;;;GAGG;AACH,MAAM,CAAC,IAAM,MAAM,GAA0B,UAAC,EAAW;QAAT,OAAO,aAAA;IACrD,OAAO,CACL,cAAK,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/components/Header.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,0BAA0B,CAAC;AAM5C;;;GAGG;AACH,MAAM,CAAC,IAAM,MAAM,GAA0B,UAAC,EAAW;QAAT,OAAO,aAAA;IACrD,OAAO,CACL,cAAK,SAAS,EAAC,wFAAwF,YACrG,eAAK,SAAS,EAAC,mCAAmC,aAChD,cAAK,SAAS,EAAC,yBAAyB,YACtC,cAAK,SAAS,EAAC,4BAA4B,YAEzC,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,GAAI,GACd,GACF,EACN,iBACE,OAAO,EAAE,cAAM,OAAA,OAAO,IAAI,OAAO,EAAE,EAApB,CAAoB,EACnC,SAAS,EAAE,kTAKV,YAED,cACE,SAAS,EAAC,SAAS,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B,YAElC,eACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,sBAAsB,GACxB,GACE,GACC,IACL,GACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport Logo from '../../../components/Logo';\n\ninterface HeaderProps {\n onClose?: () => void;\n}\n\n/**\n * Header component for the Nord Flow modal\n * Contains the logo and close button\n */\nexport const Header: React.FC<HeaderProps> = ({ onClose }) => {\n return (\n <div className=\"p-6 border-b border-n1-ww-gray-200 dark:border-n1-ww-gray-800 w-full max-w-2xl mx-auto\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"w-6 h-6 text-n1-ww-gray-50\">\n {/* Use Logo component with fallback */}\n <Logo size={24} />\n </div>\n </div>\n <button\n onClick={() => onClose && onClose()}\n className={`\n text-neutral-400 hover:text-n1-ww-gray-900 dark:hover:text-white \n transition-colors duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]\n h-10 w-10 rounded-full hover:bg-n1-ww-gray-100 dark:hover:bg-n1-ww-gray-800\n flex items-center justify-center\n `}\n >\n <svg\n className=\"w-5 h-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n </div>\n </div>\n );\n}; "]}
|
|
@@ -4,7 +4,7 @@ import { useState } from 'react';
|
|
|
4
4
|
* A component that renders an image with a fallback div when the image is not available
|
|
5
5
|
*/
|
|
6
6
|
export var ImageWithFallback = function (_a) {
|
|
7
|
-
var src = _a.src, alt = _a.alt, _b = _a.width, width = _b === void 0 ? 'auto' : _b, _c = _a.height, height = _c === void 0 ? 'auto' : _c, _d = _a.className, className = _d === void 0 ? '' : _d, _e = _a.fallbackClassName, fallbackClassName = _e === void 0 ? '' : _e, fallbackText = _a.fallbackText, _f = _a.fallbackBgColor, fallbackBgColor = _f === void 0 ? 'bg-n1-gray-200 dark:bg-n1-gray-800' : _f, _g = _a.fallbackTextColor, fallbackTextColor = _g === void 0 ? 'text-n1-gray-500 dark:text-n1-gray-400' : _g;
|
|
7
|
+
var src = _a.src, alt = _a.alt, _b = _a.width, width = _b === void 0 ? 'auto' : _b, _c = _a.height, height = _c === void 0 ? 'auto' : _c, _d = _a.className, className = _d === void 0 ? '' : _d, _e = _a.fallbackClassName, fallbackClassName = _e === void 0 ? '' : _e, fallbackText = _a.fallbackText, _f = _a.fallbackBgColor, fallbackBgColor = _f === void 0 ? 'bg-n1-ww-gray-200 dark:bg-n1-ww-gray-800' : _f, _g = _a.fallbackTextColor, fallbackTextColor = _g === void 0 ? 'text-n1-ww-gray-500 dark:text-n1-ww-gray-400' : _g;
|
|
8
8
|
var _h = useState(false), imageError = _h[0], setImageError = _h[1];
|
|
9
9
|
// Get initials from alt text for fallback
|
|
10
10
|
var getInitials = function (text) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageWithFallback.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/components/ImageWithFallback.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAcxC;;GAEG;AACH,MAAM,CAAC,IAAM,iBAAiB,GAAqC,UAAC,EAUnE;QATC,GAAG,SAAA,EACH,GAAG,SAAA,EACH,aAAc,EAAd,KAAK,mBAAG,MAAM,KAAA,EACd,cAAe,EAAf,MAAM,mBAAG,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AE,CAAC;QACvB,sBAAsB;QACtB,OAAO,CACL,cACE,SAAS,EAAE,2CAAoC,eAAe,cAAI,iBAAiB,cAAI,iBAAiB,CAAE,EAC1G,KAAK,EAAE;gBACL,KAAK,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAG,KAAK,OAAI,CAAC,CAAC,CAAC,KAAK;gBACvD,MAAM,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAG,MAAM,OAAI,CAAC,CAAC,CAAC,MAAM;aAC5D,gBACW,GAAG,YAEd,YAAY,IAAI,WAAW,CAAC,GAAG,CAAC,GAC7B,CACP,CAAC;IACJ,CAAC;IAED,eAAe;IACf,OAAO,CACL,cACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,WAAW,GACpB,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { useState } from 'react';\n\ninterface ImageWithFallbackProps {\n src: string;\n alt: string;\n width?: number | string;\n height?: number | string;\n className?: string;\n fallbackClassName?: string;\n fallbackText?: string;\n fallbackBgColor?: string;\n fallbackTextColor?: string;\n}\n\n/**\n * A component that renders an image with a fallback div when the image is not available\n */\nexport const ImageWithFallback: React.FC<ImageWithFallbackProps> = ({\n src,\n alt,\n width = 'auto',\n height = 'auto',\n className = '',\n fallbackClassName = '',\n fallbackText,\n fallbackBgColor = 'bg-n1-ww-gray-200 dark:bg-n1-ww-gray-800',\n fallbackTextColor = 'text-n1-ww-gray-500 dark:text-n1-ww-gray-400',\n}) => {\n const [imageError, setImageError] = useState(false);\n\n // Get initials from alt text for fallback\n const getInitials = (text: string) => {\n if (!text) return '';\n return text\n .split(' ')\n .map((word) => word[0])\n .join('')\n .toUpperCase()\n .substring(0, 2);\n };\n\n const handleError = () => {\n setImageError(true);\n };\n\n if (imageError || !src) {\n // Render fallback div\n return (\n <div\n className={`flex items-center justify-center ${fallbackBgColor} ${fallbackTextColor} ${fallbackClassName}`}\n style={{\n width: typeof width === 'number' ? `${width}px` : width,\n height: typeof height === 'number' ? `${height}px` : height,\n }}\n aria-label={alt}\n >\n {fallbackText || getInitials(alt)}\n </div>\n );\n }\n\n // Render image\n return (\n <img\n src={src}\n alt={alt}\n width={width}\n height={height}\n className={className}\n onError={handleError}\n />\n );\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
export function LoadingSquares() {
|
|
4
|
-
return (_jsx("div", { className: "relative w-32 h-32 n1-animate-fade-up", style: { animationDelay: '0.2s' }, children: _jsxs("div", { className: "absolute inset-0 grid grid-cols-2 gap-2", children: [_jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-n1-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-n1-main/40 dark:bg-n1-main/20 n1-animate-square-loader" }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-n1-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-n1-main/40 dark:bg-n1-main/20 n1-animate-square-loader", style: { animationDelay: '0.2s' } }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-n1-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-n1-main/40 dark:bg-n1-main/20 n1-animate-square-loader", style: { animationDelay: '0.4s' } }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-n1-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-n1-main/40 dark:bg-n1-main/20 n1-animate-square-loader", style: { animationDelay: '0.6s' } }) })] }) }));
|
|
4
|
+
return (_jsx("div", { className: "relative w-32 h-32 n1-ww-animate-fade-up", style: { animationDelay: '0.2s' }, children: _jsxs("div", { className: "absolute inset-0 grid grid-cols-2 gap-2", children: [_jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-n1-ww-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-n1-ww-main/40 dark:bg-n1-ww-main/20 n1-ww-animate-square-loader" }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-n1-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-n1-ww-main/40 dark:bg-n1-ww-main/20 n1-ww-animate-square-loader", style: { animationDelay: '0.2s' } }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-n1-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-n1-ww-main/40 dark:bg-n1-ww-main/20 n1-ww-animate-square-loader", style: { animationDelay: '0.4s' } }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-n1-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-n1-ww-main/40 dark:bg-n1-ww-main/20 n1-ww-animate-square-loader", style: { animationDelay: '0.6s' } }) })] }) }));
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=LoadingSquares.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingSquares.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/components/LoadingSquares.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,UAAU,cAAc;IAC5B,OAAO,CACL,cACE,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"LoadingSquares.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/components/LoadingSquares.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAM,UAAU,cAAc;IAC5B,OAAO,CACL,cACE,SAAS,EAAC,0CAA0C,EACpD,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,YAEjC,eAAK,SAAS,EAAC,yCAAyC,aACtD,cAAK,SAAS,EAAC,8GAA8G,YAC3H,cAAK,SAAS,EAAC,uGAAuG,GAAO,GACzH,EACN,cAAK,SAAS,EAAC,2GAA2G,YACxH,cACE,SAAS,EAAC,uGAAuG,EACjH,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,GAC5B,GACH,EACN,cAAK,SAAS,EAAC,2GAA2G,YACxH,cACE,SAAS,EAAC,uGAAuG,EACjH,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,GAC5B,GACH,EACN,cAAK,SAAS,EAAC,2GAA2G,YACxH,cACE,SAAS,EAAC,uGAAuG,EACjH,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,GAC5B,GACH,IACF,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nexport function LoadingSquares() {\n return (\n <div\n className=\"relative w-32 h-32 n1-ww-animate-fade-up\"\n style={{ animationDelay: '0.2s' }}\n >\n <div className=\"absolute inset-0 grid grid-cols-2 gap-2\">\n <div className=\"relative bg-white dark:bg-neutral-900 border-2 border-n1-ww-gray-100 dark:border-neutral-800 overflow-hidden\">\n <div className=\"absolute inset-x-0 bottom-0 h-full bg-n1-ww-main/40 dark:bg-n1-ww-main/20 n1-ww-animate-square-loader\"></div>\n </div>\n <div className=\"relative bg-white dark:bg-neutral-900 border-2 border-n1-gray-100 dark:border-neutral-800 overflow-hidden\">\n <div\n className=\"absolute inset-x-0 bottom-0 h-full bg-n1-ww-main/40 dark:bg-n1-ww-main/20 n1-ww-animate-square-loader\"\n style={{ animationDelay: '0.2s' }}\n ></div>\n </div>\n <div className=\"relative bg-white dark:bg-neutral-900 border-2 border-n1-gray-100 dark:border-neutral-800 overflow-hidden\">\n <div\n className=\"absolute inset-x-0 bottom-0 h-full bg-n1-ww-main/40 dark:bg-n1-ww-main/20 n1-ww-animate-square-loader\"\n style={{ animationDelay: '0.4s' }}\n ></div>\n </div>\n <div className=\"relative bg-white dark:bg-neutral-900 border-2 border-n1-gray-100 dark:border-neutral-800 overflow-hidden\">\n <div\n className=\"absolute inset-x-0 bottom-0 h-full bg-n1-ww-main/40 dark:bg-n1-ww-main/20 n1-ww-animate-square-loader\"\n style={{ animationDelay: '0.6s' }}\n ></div>\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -7,13 +7,13 @@ export function MoreButton(_a) {
|
|
|
7
7
|
onClick(chain.id);
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
|
-
var baseClasses = 'flex flex-col items-center justify-center p-6 bg-n1-gray-50 dark:bg-n1-gray-950 border-2 border-n1-gray-100 dark:border-n1-gray-800 transition-all duration-200 group rounded-lg';
|
|
11
|
-
var enabledClasses = 'hover:border-red-500 dark:hover:border-red-500 hover:bg-red-50/50 dark:hover:bg-n1-gray-900';
|
|
10
|
+
var baseClasses = 'flex flex-col items-center justify-center p-6 bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 border-2 border-n1-ww-gray-100 dark:border-n1-ww-gray-800 transition-all duration-200 group rounded-lg';
|
|
11
|
+
var enabledClasses = 'hover:border-red-500 dark:hover:border-red-500 hover:bg-red-50/50 dark:hover:bg-n1-ww-gray-900';
|
|
12
12
|
var disabledClasses = 'opacity-50 cursor-not-allowed';
|
|
13
13
|
var buttonClasses = "".concat(baseClasses, " ").concat(disabled ? disabledClasses : enabledClasses);
|
|
14
14
|
var textClasses = disabled
|
|
15
|
-
? 'mt-4 font-medium text-n1-gray-400 dark:text-n1-gray-500'
|
|
16
|
-
: 'mt-4 font-medium text-n1-gray-600 dark:text-n1-gray-400 group-hover:text-red-500 dark:group-hover:text-n1-gray-50 transition-colors duration-200';
|
|
15
|
+
? 'mt-4 font-medium text-n1-ww-gray-400 dark:text-n1-ww-gray-500'
|
|
16
|
+
: 'mt-4 font-medium text-n1-ww-gray-600 dark:text-n1-ww-gray-400 group-hover:text-red-500 dark:group-hover:text-n1-ww-gray-50 transition-colors duration-200';
|
|
17
17
|
return (_jsxs("button", { onClick: handleClick, className: buttonClasses, disabled: disabled, children: [_jsx(MoreChainsGroup, { size: 32, className: disabled ? 'opacity-50 grayscale' : 'opacity-90' }), _jsx("span", { className: textClasses, children: chain.name })] }));
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=MoreButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoreButton.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/components/MoreButton.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAQ5D,MAAM,UAAU,UAAU,CAAC,EAIT;QAHhB,KAAK,WAAA,EACL,OAAO,aAAA,EACP,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA;IAEhB,IAAM,WAAW,GAAG;QAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,IAAM,WAAW,GACf,
|
|
1
|
+
{"version":3,"file":"MoreButton.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/components/MoreButton.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAQ5D,MAAM,UAAU,UAAU,CAAC,EAIT;QAHhB,KAAK,WAAA,EACL,OAAO,aAAA,EACP,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA;IAEhB,IAAM,WAAW,GAAG;QAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,IAAM,WAAW,GACf,8LAA8L,CAAC;IACjM,IAAM,cAAc,GAClB,gGAAgG,CAAC;IACnG,IAAM,eAAe,GAAG,+BAA+B,CAAC;IAExD,IAAM,aAAa,GAAG,UAAG,WAAW,cAAI,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,CAAE,CAAC;IAEtF,IAAM,WAAW,GAAG,QAAQ;QAC1B,CAAC,CAAC,+DAA+D;QACjE,CAAC,CAAC,2JAA2J,CAAC;IAEhK,OAAO,CACL,kBAAQ,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,aACxE,KAAC,eAAe,IACd,IAAI,EAAE,EAAE,EACR,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,YAAY,GAC3D,EACF,eAAM,SAAS,EAAE,WAAW,YAAG,KAAK,CAAC,IAAI,GAAQ,IAC1C,CACV,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Chain } from '../types';\nimport { MoreChainsGroup } from '../../../components/logos';\n\ninterface MoreButtonProps {\n chain: Chain;\n onClick: (chainId: string) => void;\n disabled?: boolean;\n}\n\nexport function MoreButton({\n chain,\n onClick,\n disabled = false,\n}: MoreButtonProps) {\n const handleClick = () => {\n if (!disabled) {\n onClick(chain.id);\n }\n };\n\n const baseClasses =\n 'flex flex-col items-center justify-center p-6 bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 border-2 border-n1-ww-gray-100 dark:border-n1-ww-gray-800 transition-all duration-200 group rounded-lg';\n const enabledClasses =\n 'hover:border-red-500 dark:hover:border-red-500 hover:bg-red-50/50 dark:hover:bg-n1-ww-gray-900';\n const disabledClasses = 'opacity-50 cursor-not-allowed';\n\n const buttonClasses = `${baseClasses} ${disabled ? disabledClasses : enabledClasses}`;\n\n const textClasses = disabled\n ? 'mt-4 font-medium text-n1-ww-gray-400 dark:text-n1-ww-gray-500'\n : 'mt-4 font-medium text-n1-ww-gray-600 dark:text-n1-ww-gray-400 group-hover:text-red-500 dark:group-hover:text-n1-ww-gray-50 transition-colors duration-200';\n\n return (\n <button onClick={handleClick} className={buttonClasses} disabled={disabled}>\n <MoreChainsGroup\n size={32}\n className={disabled ? 'opacity-50 grayscale' : 'opacity-90'}\n />\n <span className={textClasses}>{chain.name}</span>\n </button>\n );\n}\n"]}
|
|
@@ -31,18 +31,18 @@ export function TransactionTable(_a) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
if (key === 'tx') {
|
|
34
|
-
return 'text-n1-
|
|
34
|
+
return 'text-n1-ww-gray-800 dark:text-n1-ww-gray-200 text-xs font-medium hover:text-n1-ww-main-600 dark:hover:text-n1-ww-main-400 transition-colors duration-200';
|
|
35
35
|
}
|
|
36
36
|
if (key === 'network') {
|
|
37
37
|
return 'text-purple-600 dark:text-purple-400 font-medium';
|
|
38
38
|
}
|
|
39
39
|
if (key === 'from' || key === 'to') {
|
|
40
|
-
return 'text-n1-gray-800 dark:text-n1-gray-200 text-xs font-medium hover:text-n1-main-600 dark:hover:text-n1-main-400 transition-colors duration-200';
|
|
40
|
+
return 'text-n1-ww-gray-800 dark:text-n1-ww-gray-200 text-xs font-medium hover:text-n1-ww-main-600 dark:hover:text-n1-ww-main-400 transition-colors duration-200';
|
|
41
41
|
}
|
|
42
42
|
if (key === 'amount') {
|
|
43
43
|
return 'text-green-600 dark:text-emerald-500 font-semibold';
|
|
44
44
|
}
|
|
45
|
-
return 'text-n1-gray-900 dark:text-n1-gray-50 font-medium';
|
|
45
|
+
return 'text-n1-ww-gray-900 dark:text-n1-ww-gray-50 font-medium';
|
|
46
46
|
};
|
|
47
47
|
// Format display value with ellipsis for long text
|
|
48
48
|
var getDisplayValue = function (key, value) {
|
|
@@ -74,10 +74,10 @@ export function TransactionTable(_a) {
|
|
|
74
74
|
var indexB = fieldOrder.indexOf(keyB);
|
|
75
75
|
return (indexA === -1 ? 999 : indexA) - (indexB === -1 ? 999 : indexB);
|
|
76
76
|
});
|
|
77
|
-
return (_jsxs("div", { className: "relative w-full h-full bg-n1-gray-100 dark:bg-n1-gray-950 border border-n1-gray-200 dark:border-n1-gray-800 p-5 rounded-sm flex flex-col justify-center", children: [onClose && (_jsx("button", { onClick: onClose, className: "absolute top-3 right-2 text-n1-gray-500 dark:text-n1-gray-600 hover:text-n1-gray-500 dark:hover:text-n1-gray-300 transition-colors duration-200 focus:outline-none", "aria-label": "Close details", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), _jsx("div", { className: "space-y-3 text-sm pt-5", children: sortedEntries.map(function (_a) {
|
|
77
|
+
return (_jsxs("div", { className: "relative w-full h-full bg-n1-ww-gray-100 dark:bg-n1-ww-gray-950 border border-n1-ww-gray-200 dark:border-n1-ww-gray-800 p-5 rounded-sm flex flex-col justify-center", children: [onClose && (_jsx("button", { onClick: onClose, className: "absolute top-3 right-2 text-n1-ww-gray-500 dark:text-n1-ww-gray-600 hover:text-n1-ww-gray-500 dark:hover:text-n1-ww-gray-300 transition-colors duration-200 focus:outline-none", "aria-label": "Close details", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), _jsx("div", { className: "space-y-3 text-sm pt-5", children: sortedEntries.map(function (_a) {
|
|
78
78
|
var key = _a[0], value = _a[1];
|
|
79
|
-
return (_jsxs("div", { className: "flex items-center justify-between py-2 ", children: [_jsx("span", { className: "text-n1-gray-500 dark:text-n1-gray-400 font-medium min-w-[120px]", children: getLabel(key) }), _jsxs("div", { className: "relative transition-all duration-300 ".concat(value.visible ? 'opacity-100' : 'opacity-0', " max-w-[65%] text-right flex-1"), children: [(key === 'tx' || key === 'from') &&
|
|
80
|
-
getExplorerLink(key, value.text) ? (_jsxs("a", { href: getExplorerLink(key, value.text), target: "_blank", rel: "noopener noreferrer", className: "".concat(getValueStyles(key, value.text), " break-all inline-block group"), title: value.text, children: [_jsx("span", { className: "underline hover:font-bold", children: getDisplayValue(key, value.text) }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-3 w-3 ml-1 inline-block opacity-50 group-hover:opacity-100 transition-opacity duration-200", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) })] })) : (_jsx("span", { className: "".concat(getValueStyles(key, value.text), " break-all inline-block"), title: value.text, children: value.text })), value.typing && (_jsx("span", { className: "inline-block ml-1 w-[2px] h-[14px] bg-n1-main-500 dark:bg-n1-main-400 n1-animate-pulse" }))] })] }, key));
|
|
79
|
+
return (_jsxs("div", { className: "flex items-center justify-between py-2 ", children: [_jsx("span", { className: "text-n1-ww-gray-500 dark:text-n1-ww-gray-400 font-medium min-w-[120px]", children: getLabel(key) }), _jsxs("div", { className: "relative transition-all duration-300 ".concat(value.visible ? 'opacity-100' : 'opacity-0', " max-w-[65%] text-right flex-1"), children: [(key === 'tx' || key === 'from') &&
|
|
80
|
+
getExplorerLink(key, value.text) ? (_jsxs("a", { href: getExplorerLink(key, value.text), target: "_blank", rel: "noopener noreferrer", className: "".concat(getValueStyles(key, value.text), " break-all inline-block group"), title: value.text, children: [_jsx("span", { className: "underline hover:font-bold", children: getDisplayValue(key, value.text) }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-3 w-3 ml-1 inline-block opacity-50 group-hover:opacity-100 transition-opacity duration-200", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) })] })) : (_jsx("span", { className: "".concat(getValueStyles(key, value.text), " break-all inline-block"), title: value.text, children: value.text })), value.typing && (_jsx("span", { className: "inline-block ml-1 w-[2px] h-[14px] bg-n1-ww-main-500 dark:bg-n1-ww-main-400 n1-ww-animate-pulse" }))] })] }, key));
|
|
81
81
|
}) })] }));
|
|
82
82
|
}
|
|
83
83
|
//# sourceMappingURL=TransactionTable.js.map
|