@web3auth/modal 10.0.0-beta.0 → 10.0.0-beta.2

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.
Files changed (257) hide show
  1. package/dist/lib.cjs/node_modules/style-inject/dist/style-inject.es.js +1 -1
  2. package/dist/lib.cjs/packages/modal/src/modalManager.js +195 -140
  3. package/dist/lib.cjs/packages/modal/src/react/Web3AuthProvider.js +2 -2
  4. package/dist/lib.cjs/packages/modal/src/react/context/Web3AuthInnerContext.js +26 -26
  5. package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3Auth.js +2 -2
  6. package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +60 -0
  7. package/dist/lib.cjs/packages/modal/src/ui/components/Button/Button.js +47 -22
  8. package/dist/lib.cjs/packages/modal/src/ui/components/Button/Button.type.js +8 -0
  9. package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +53 -0
  10. package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +68 -0
  11. package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWallet.js +202 -0
  12. package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +65 -0
  13. package/dist/lib.cjs/packages/modal/src/ui/components/{ExternalWallet/ExternalWalletChainNamespace.js → ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js} +29 -30
  14. package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +49 -0
  15. package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.js +140 -0
  16. package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +93 -0
  17. package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +55 -0
  18. package/dist/lib.cjs/packages/modal/src/ui/components/Embed/Embed.js +70 -0
  19. package/dist/lib.cjs/packages/modal/src/ui/components/Footer/Footer.js +53 -0
  20. package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +89 -0
  21. package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +151 -0
  22. package/dist/lib.cjs/packages/modal/src/ui/components/Login/Login.js +489 -0
  23. package/dist/lib.cjs/packages/modal/src/ui/components/Login/LoginOtp/LoginOtp.js +116 -0
  24. package/dist/lib.cjs/packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.js +117 -0
  25. package/dist/lib.cjs/packages/modal/src/ui/components/LoginHint/LoginHint.js +52 -0
  26. package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +87 -0
  27. package/dist/lib.cjs/packages/modal/src/ui/components/Otp/Otp.js +190 -0
  28. package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +18 -0
  29. package/dist/lib.cjs/packages/modal/src/ui/components/Root/Root.js +448 -0
  30. package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +156 -0
  31. package/dist/lib.cjs/packages/modal/src/ui/components/Toast/Toast.js +70 -0
  32. package/dist/lib.cjs/packages/modal/src/ui/components/Widget/Widget.js +231 -0
  33. package/dist/lib.cjs/packages/modal/src/ui/config.js +12 -1
  34. package/dist/lib.cjs/packages/modal/src/ui/constants.js +18 -0
  35. package/dist/lib.cjs/packages/modal/src/ui/context/RootContext.js +20 -0
  36. package/dist/lib.cjs/packages/modal/src/ui/context/ThemeContext.js +2 -2
  37. package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +8 -0
  38. package/dist/lib.cjs/packages/modal/src/ui/handlers/AbstractHandler.js +117 -0
  39. package/dist/lib.cjs/packages/modal/src/ui/handlers/EmailPasswordlessHandler.js +54 -0
  40. package/dist/lib.cjs/packages/modal/src/ui/handlers/SmsPasswordlessHandler.js +57 -0
  41. package/dist/lib.cjs/packages/modal/src/ui/handlers/factory.js +19 -0
  42. package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +37 -2
  43. package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +37 -2
  44. package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +37 -2
  45. package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +37 -2
  46. package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +37 -2
  47. package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +37 -2
  48. package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +37 -2
  49. package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +37 -2
  50. package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +37 -2
  51. package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +37 -2
  52. package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +7 -10
  53. package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +69 -44
  54. package/dist/lib.cjs/packages/modal/src/ui/utils.js +107 -1
  55. package/dist/lib.cjs/types/interface.d.ts +1 -1
  56. package/dist/lib.cjs/types/modalManager.d.ts +5 -1
  57. package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.d.ts +7 -0
  58. package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.type.d.ts +7 -0
  59. package/dist/lib.cjs/types/ui/components/BottomSheet/index.d.ts +2 -0
  60. package/dist/lib.cjs/types/ui/components/Button/Button.d.ts +2 -15
  61. package/dist/lib.cjs/types/ui/components/Button/Button.type.d.ts +12 -0
  62. package/dist/lib.cjs/types/ui/components/Button/ButtonSocial/ButtonSocial.d.ts +3 -0
  63. package/dist/lib.cjs/types/ui/components/Button/ButtonSocial/ButtonSocial.type.d.ts +14 -0
  64. package/dist/lib.cjs/types/ui/components/Button/ButtonSocial/index.d.ts +2 -0
  65. package/dist/lib.cjs/types/ui/components/Button/ButtonWallet/ButtonWallet.d.ts +3 -0
  66. package/dist/lib.cjs/types/ui/components/Button/ButtonWallet/ButtonWallet.type.d.ts +13 -0
  67. package/dist/lib.cjs/types/ui/components/Button/ButtonWallet/index.d.ts +2 -0
  68. package/dist/lib.cjs/types/ui/components/Button/index.d.ts +1 -0
  69. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWallet.d.ts +3 -0
  70. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWallet.type.d.ts +24 -0
  71. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.d.ts +3 -0
  72. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.type.d.ts +13 -0
  73. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainFilter/index.d.ts +2 -0
  74. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.d.ts +3 -0
  75. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.type.d.ts +10 -0
  76. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/index.d.ts +2 -0
  77. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.d.ts +3 -0
  78. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.type.d.ts +6 -0
  79. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletHeader/index.d.ts +2 -0
  80. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.d.ts +3 -0
  81. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.type.d.ts +19 -0
  82. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletList/index.d.ts +2 -0
  83. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.d.ts +3 -0
  84. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.type.d.ts +9 -0
  85. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletQrCode/index.d.ts +2 -0
  86. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.d.ts +3 -0
  87. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.type.d.ts +9 -0
  88. package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletSearch/index.d.ts +2 -0
  89. package/dist/lib.cjs/types/ui/components/ConnectWallet/index.d.ts +2 -0
  90. package/dist/lib.cjs/types/ui/components/Embed/Embed.d.ts +8 -0
  91. package/dist/lib.cjs/types/ui/components/Embed/Embed.type.d.ts +12 -0
  92. package/dist/lib.cjs/types/ui/components/Embed/index.d.ts +2 -0
  93. package/dist/lib.cjs/types/ui/components/Footer/Footer.d.ts +7 -0
  94. package/dist/lib.cjs/types/ui/components/Footer/Footer.type.d.ts +4 -0
  95. package/dist/lib.cjs/types/ui/components/Footer/index.d.ts +2 -0
  96. package/dist/lib.cjs/types/ui/components/Image/Image.d.ts +7 -0
  97. package/dist/lib.cjs/types/ui/components/{Image.d.ts → Image/Image.type.d.ts} +2 -1
  98. package/dist/lib.cjs/types/ui/components/Image/index.d.ts +2 -0
  99. package/dist/lib.cjs/types/ui/components/Loader/Loader.d.ts +8 -0
  100. package/dist/lib.cjs/types/ui/components/Loader/Loader.type.d.ts +12 -0
  101. package/dist/lib.cjs/types/ui/components/Loader/index.d.ts +2 -0
  102. package/dist/lib.cjs/types/ui/components/Login/Login.d.ts +3 -0
  103. package/dist/lib.cjs/types/ui/components/Login/Login.type.d.ts +29 -0
  104. package/dist/lib.cjs/types/ui/components/Login/LoginOtp/LoginOtp.d.ts +8 -0
  105. package/dist/lib.cjs/types/ui/components/Login/LoginOtp/LoginOtp.type.d.ts +10 -0
  106. package/dist/lib.cjs/types/ui/components/Login/LoginOtp/index.d.ts +2 -0
  107. package/dist/lib.cjs/types/ui/components/Login/LoginPasswordLess/LoginPasswordLess.d.ts +3 -0
  108. package/dist/lib.cjs/types/ui/components/Login/LoginPasswordLess/LoginPasswordLess.type.d.ts +13 -0
  109. package/dist/lib.cjs/types/ui/components/Login/LoginPasswordLess/index.d.ts +2 -0
  110. package/dist/lib.cjs/types/ui/components/Login/index.d.ts +2 -0
  111. package/dist/lib.cjs/types/ui/components/LoginHint/LoginHint.d.ts +3 -0
  112. package/dist/lib.cjs/types/ui/components/LoginHint/LoginHint.type.d.ts +6 -0
  113. package/dist/lib.cjs/types/ui/components/LoginHint/index.d.ts +2 -0
  114. package/dist/lib.cjs/types/ui/components/Modal/Modal.d.ts +8 -0
  115. package/dist/lib.cjs/types/ui/components/Modal/Modal.type.d.ts +14 -0
  116. package/dist/lib.cjs/types/ui/components/Modal/index.d.ts +2 -0
  117. package/dist/lib.cjs/types/ui/components/Otp/Otp.d.ts +3 -0
  118. package/dist/lib.cjs/types/ui/components/Otp/Otp.type.d.ts +22 -0
  119. package/dist/lib.cjs/types/ui/components/Otp/index.d.ts +2 -0
  120. package/dist/lib.cjs/types/ui/components/PulseLoader/PulseLoader.d.ts +2 -0
  121. package/dist/lib.cjs/types/ui/components/PulseLoader/index.d.ts +1 -0
  122. package/dist/lib.cjs/types/ui/components/Root/Root.d.ts +3 -0
  123. package/dist/lib.cjs/types/ui/components/Root/Root.type.d.ts +27 -0
  124. package/dist/lib.cjs/types/ui/components/Root/index.d.ts +2 -0
  125. package/dist/lib.cjs/types/ui/components/SocialLoginList/SocialLoginList.d.ts +3 -0
  126. package/dist/lib.cjs/types/ui/components/SocialLoginList/SocialLoginList.type.d.ts +11 -0
  127. package/dist/lib.cjs/types/ui/components/SocialLoginList/index.d.ts +2 -0
  128. package/dist/lib.cjs/types/ui/components/Toast/Toast.d.ts +2 -0
  129. package/dist/lib.cjs/types/ui/components/Toast/index.d.ts +1 -0
  130. package/dist/lib.cjs/types/ui/components/Widget/Widget.d.ts +3 -0
  131. package/dist/lib.cjs/types/ui/components/{Modal.d.ts → Widget/Widget.type.d.ts} +4 -5
  132. package/dist/lib.cjs/types/ui/components/Widget/index.d.ts +1 -0
  133. package/dist/lib.cjs/types/ui/config.d.ts +4 -1
  134. package/dist/lib.cjs/types/ui/constants.d.ts +13 -0
  135. package/dist/lib.cjs/types/ui/context/RootContext.d.ts +18 -0
  136. package/dist/lib.cjs/types/ui/handlers/AbstractHandler.d.ts +20 -0
  137. package/dist/lib.cjs/types/ui/handlers/EmailPasswordlessHandler.d.ts +8 -0
  138. package/dist/lib.cjs/types/ui/handlers/SmsPasswordlessHandler.d.ts +9 -0
  139. package/dist/lib.cjs/types/ui/handlers/factory.d.ts +5 -0
  140. package/dist/lib.cjs/types/ui/interfaces.d.ts +115 -14
  141. package/dist/lib.cjs/types/ui/loginModal.d.ts +9 -7
  142. package/dist/lib.cjs/types/ui/utils.d.ts +17 -2
  143. package/dist/lib.esm/node_modules/style-inject/dist/style-inject.es.js +1 -1
  144. package/dist/lib.esm/packages/modal/src/modalManager.js +203 -145
  145. package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +58 -0
  146. package/dist/lib.esm/packages/modal/src/ui/components/Button/Button.js +48 -24
  147. package/dist/lib.esm/packages/modal/src/ui/components/Button/Button.type.js +6 -0
  148. package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +51 -0
  149. package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +66 -0
  150. package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWallet.js +200 -0
  151. package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +63 -0
  152. package/dist/lib.esm/packages/modal/src/ui/components/{ExternalWallet/ExternalWalletChainNamespace.js → ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js} +29 -31
  153. package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +47 -0
  154. package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.js +138 -0
  155. package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +91 -0
  156. package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +56 -0
  157. package/dist/lib.esm/packages/modal/src/ui/components/Embed/Embed.js +68 -0
  158. package/dist/lib.esm/packages/modal/src/ui/components/Footer/Footer.js +51 -0
  159. package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +87 -0
  160. package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +152 -0
  161. package/dist/lib.esm/packages/modal/src/ui/components/Login/Login.js +489 -0
  162. package/dist/lib.esm/packages/modal/src/ui/components/Login/LoginOtp/LoginOtp.js +115 -0
  163. package/dist/lib.esm/packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.js +115 -0
  164. package/dist/lib.esm/packages/modal/src/ui/components/LoginHint/LoginHint.js +50 -0
  165. package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +85 -0
  166. package/dist/lib.esm/packages/modal/src/ui/components/Otp/Otp.js +188 -0
  167. package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +16 -0
  168. package/dist/lib.esm/packages/modal/src/ui/components/Root/Root.js +458 -0
  169. package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +154 -0
  170. package/dist/lib.esm/packages/modal/src/ui/components/Toast/Toast.js +68 -0
  171. package/dist/lib.esm/packages/modal/src/ui/components/Widget/Widget.js +233 -0
  172. package/dist/lib.esm/packages/modal/src/ui/config.js +10 -3
  173. package/dist/lib.esm/packages/modal/src/ui/constants.js +13 -0
  174. package/dist/lib.esm/packages/modal/src/ui/context/RootContext.js +18 -0
  175. package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +6 -0
  176. package/dist/lib.esm/packages/modal/src/ui/handlers/AbstractHandler.js +115 -0
  177. package/dist/lib.esm/packages/modal/src/ui/handlers/EmailPasswordlessHandler.js +52 -0
  178. package/dist/lib.esm/packages/modal/src/ui/handlers/SmsPasswordlessHandler.js +55 -0
  179. package/dist/lib.esm/packages/modal/src/ui/handlers/factory.js +17 -0
  180. package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +37 -3
  181. package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +37 -3
  182. package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +37 -3
  183. package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +37 -3
  184. package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +37 -3
  185. package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +37 -3
  186. package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +37 -3
  187. package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +37 -3
  188. package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +37 -3
  189. package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +37 -3
  190. package/dist/lib.esm/packages/modal/src/ui/interfaces.js +8 -9
  191. package/dist/lib.esm/packages/modal/src/ui/loginModal.js +70 -45
  192. package/dist/lib.esm/packages/modal/src/ui/utils.js +105 -3
  193. package/dist/modal.umd.min.js +1 -1
  194. package/dist/modal.umd.min.js.LICENSE.txt +8 -8
  195. package/package.json +16 -11
  196. package/dist/lib.cjs/packages/modal/src/ui/assets/arrow-left-dark.svg.js +0 -7
  197. package/dist/lib.cjs/packages/modal/src/ui/assets/arrow-left-light.svg.js +0 -7
  198. package/dist/lib.cjs/packages/modal/src/ui/assets/x-dark.svg.js +0 -7
  199. package/dist/lib.cjs/packages/modal/src/ui/assets/x-light.svg.js +0 -7
  200. package/dist/lib.cjs/packages/modal/src/ui/components/AdapterLoader.js +0 -108
  201. package/dist/lib.cjs/packages/modal/src/ui/components/Button/styles.css.js +0 -8
  202. package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletButton.js +0 -44
  203. package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletConnect.js +0 -67
  204. package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletDetails.js +0 -43
  205. package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletHeader.js +0 -46
  206. package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletInstall.js +0 -167
  207. package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallets.js +0 -279
  208. package/dist/lib.cjs/packages/modal/src/ui/components/Footer.js +0 -20
  209. package/dist/lib.cjs/packages/modal/src/ui/components/Header.js +0 -81
  210. package/dist/lib.cjs/packages/modal/src/ui/components/Icon.js +0 -73
  211. package/dist/lib.cjs/packages/modal/src/ui/components/Image.js +0 -51
  212. package/dist/lib.cjs/packages/modal/src/ui/components/Loader.js +0 -59
  213. package/dist/lib.cjs/packages/modal/src/ui/components/Modal.js +0 -278
  214. package/dist/lib.cjs/packages/modal/src/ui/components/SelfCustodyViaWeb3Auth.js +0 -30
  215. package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginPasswordless.js +0 -150
  216. package/dist/lib.cjs/packages/modal/src/ui/components/SocialLogins.js +0 -153
  217. package/dist/lib.cjs/packages/modal/src/ui/components/WalletConnect.js +0 -84
  218. package/dist/lib.cjs/packages/modal/src/ui/css/web3auth.css.js +0 -8
  219. package/dist/lib.cjs/types/ui/components/AdapterLoader.d.ts +0 -11
  220. package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletButton.d.ts +0 -7
  221. package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletChainNamespace.d.ts +0 -9
  222. package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletConnect.d.ts +0 -9
  223. package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletDetails.d.ts +0 -10
  224. package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletHeader.d.ts +0 -8
  225. package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletInstall.d.ts +0 -8
  226. package/dist/lib.cjs/types/ui/components/ExternalWallets.d.ts +0 -15
  227. package/dist/lib.cjs/types/ui/components/Footer.d.ts +0 -1
  228. package/dist/lib.cjs/types/ui/components/Header.d.ts +0 -8
  229. package/dist/lib.cjs/types/ui/components/Icon.d.ts +0 -9
  230. package/dist/lib.cjs/types/ui/components/Loader.d.ts +0 -10
  231. package/dist/lib.cjs/types/ui/components/SelfCustodyViaWeb3Auth.d.ts +0 -1
  232. package/dist/lib.cjs/types/ui/components/SocialLoginPasswordless.d.ts +0 -14
  233. package/dist/lib.cjs/types/ui/components/SocialLogins.d.ts +0 -10
  234. package/dist/lib.cjs/types/ui/components/WalletConnect.d.ts +0 -8
  235. package/dist/lib.esm/packages/modal/src/ui/assets/arrow-left-dark.svg.js +0 -5
  236. package/dist/lib.esm/packages/modal/src/ui/assets/arrow-left-light.svg.js +0 -5
  237. package/dist/lib.esm/packages/modal/src/ui/assets/x-dark.svg.js +0 -5
  238. package/dist/lib.esm/packages/modal/src/ui/assets/x-light.svg.js +0 -5
  239. package/dist/lib.esm/packages/modal/src/ui/components/AdapterLoader.js +0 -106
  240. package/dist/lib.esm/packages/modal/src/ui/components/Button/styles.css.js +0 -6
  241. package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletButton.js +0 -42
  242. package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletConnect.js +0 -65
  243. package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletDetails.js +0 -44
  244. package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletHeader.js +0 -44
  245. package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletInstall.js +0 -165
  246. package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallets.js +0 -281
  247. package/dist/lib.esm/packages/modal/src/ui/components/Footer.js +0 -18
  248. package/dist/lib.esm/packages/modal/src/ui/components/Header.js +0 -79
  249. package/dist/lib.esm/packages/modal/src/ui/components/Icon.js +0 -71
  250. package/dist/lib.esm/packages/modal/src/ui/components/Image.js +0 -49
  251. package/dist/lib.esm/packages/modal/src/ui/components/Loader.js +0 -57
  252. package/dist/lib.esm/packages/modal/src/ui/components/Modal.js +0 -277
  253. package/dist/lib.esm/packages/modal/src/ui/components/SelfCustodyViaWeb3Auth.js +0 -28
  254. package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginPasswordless.js +0 -148
  255. package/dist/lib.esm/packages/modal/src/ui/components/SocialLogins.js +0 -152
  256. package/dist/lib.esm/packages/modal/src/ui/components/WalletConnect.js +0 -82
  257. package/dist/lib.esm/packages/modal/src/ui/css/web3auth.css.js +0 -6
@@ -1,32 +1,56 @@
1
- import './styles.css.js';
2
- import { memo } from 'react';
3
- import { jsx } from 'react/jsx-runtime';
1
+ import { BUTTON_TYPE } from './Button.type.js';
2
+ import SocialLoginButton from './ButtonSocial/ButtonSocial.js';
3
+ import ButtonWallet from './ButtonWallet/ButtonWallet.js';
4
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
4
5
 
5
6
  function Button(props) {
6
7
  const {
7
- variant = "primary",
8
+ type,
9
+ props: buttonProps
10
+ } = props;
11
+ const SocialButtonProps = buttonProps;
12
+ const WalletButtonProps = buttonProps;
13
+ const {
14
+ text,
15
+ showIcon,
16
+ showText,
17
+ method,
18
+ isDark,
19
+ isPrimaryBtn,
8
20
  onClick,
9
21
  children,
10
- title,
11
- className,
12
- style,
13
- size = "md",
14
- disabled,
15
- type = "button"
16
- } = props;
17
- const sizeClass = `size-${size}`;
18
- return /*#__PURE__*/jsx("button", {
19
- disabled: disabled
20
- // eslint-disable-next-line react/button-has-type
21
- ,
22
- type: type,
23
- className: `t-btn t-btn-${variant} w3a--rounded-full ${sizeClass} ${className}`,
24
- onClick: onClick,
25
- title: title,
26
- style: style,
27
- children: children
22
+ btnStyle,
23
+ buttonRadius
24
+ } = SocialButtonProps;
25
+ const {
26
+ label,
27
+ onClick: walletOnClick,
28
+ button,
29
+ deviceDetails,
30
+ walletConnectUri,
31
+ buttonRadius: walletButtonRadius
32
+ } = WalletButtonProps;
33
+ return /*#__PURE__*/jsxs(Fragment, {
34
+ children: [type === BUTTON_TYPE.SOCIAL && /*#__PURE__*/jsx(SocialLoginButton, {
35
+ text: text,
36
+ showIcon: showIcon,
37
+ showText: showText,
38
+ method: method,
39
+ isDark: isDark,
40
+ isPrimaryBtn: isPrimaryBtn,
41
+ onClick: onClick,
42
+ btnStyle: btnStyle,
43
+ buttonRadius: buttonRadius,
44
+ children: children
45
+ }), type === BUTTON_TYPE.WALLET && /*#__PURE__*/jsx(ButtonWallet, {
46
+ label: label,
47
+ walletConnectUri: walletConnectUri,
48
+ onClick: walletOnClick,
49
+ button: button,
50
+ deviceDetails: deviceDetails,
51
+ buttonRadius: walletButtonRadius
52
+ })]
28
53
  });
29
54
  }
30
- var Button$1 = /*#__PURE__*/memo(Button);
31
55
 
32
- export { Button$1 as default };
56
+ export { Button as default };
@@ -0,0 +1,6 @@
1
+ const BUTTON_TYPE = {
2
+ SOCIAL: "social",
3
+ WALLET: "wallet"
4
+ };
5
+
6
+ export { BUTTON_TYPE };
@@ -0,0 +1,51 @@
1
+ import { AUTH_CONNECTION } from '@web3auth/auth';
2
+ import { cn } from '../../../utils.js';
3
+ import Image from '../../Image/Image.js';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+
6
+ function getProviderIcon(method, isDark, isPrimaryBtn) {
7
+ const imageId = method === AUTH_CONNECTION.TWITTER ? `login-twitter-x${isDark ? "-light" : "-dark"}` : `login-${method}${isDark ? "-light" : "-dark"}`;
8
+ const hoverId = method === AUTH_CONNECTION.APPLE || method === AUTH_CONNECTION.GITHUB || method === AUTH_CONNECTION.TWITTER ? imageId : `login-${method}-active`;
9
+ if (isPrimaryBtn) {
10
+ return /*#__PURE__*/jsx(Image, {
11
+ width: "20",
12
+ imageId: hoverId,
13
+ hoverImageId: hoverId,
14
+ isButton: true
15
+ });
16
+ }
17
+ return /*#__PURE__*/jsx(Image, {
18
+ width: "20",
19
+ imageId: imageId,
20
+ hoverImageId: hoverId
21
+ });
22
+ }
23
+ function SocialLoginButton(props) {
24
+ const {
25
+ text,
26
+ showIcon,
27
+ showText,
28
+ method,
29
+ isDark,
30
+ isPrimaryBtn,
31
+ onClick,
32
+ children,
33
+ btnStyle,
34
+ buttonRadius = "pill"
35
+ } = props;
36
+ return /*#__PURE__*/jsxs("button", {
37
+ type: "button",
38
+ onClick: e => onClick && onClick(e),
39
+ className: cn("w3a--btn", btnStyle, {
40
+ "w3a--rounded-full": buttonRadius === "pill",
41
+ "w3a--rounded-lg": buttonRadius === "rounded",
42
+ "w3a--rounded-none": buttonRadius === "square"
43
+ }),
44
+ children: [showIcon && getProviderIcon(method, isDark, isPrimaryBtn), showText && /*#__PURE__*/jsx("p", {
45
+ className: "w3a--text-sm w3a--font-normal w3a--text-app-gray-900 dark:w3a--text-app-white",
46
+ children: text
47
+ }), children]
48
+ });
49
+ }
50
+
51
+ export { SocialLoginButton as default };
@@ -0,0 +1,66 @@
1
+ import cn from 'classnames';
2
+ import { useMemo } from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import i18nInstance from '../../../localeImport.js';
5
+ import { formatIOSMobile } from '../../../utils.js';
6
+ import Image from '../../Image/Image.js';
7
+ import { jsxs, jsx } from 'react/jsx-runtime';
8
+
9
+ function ButtonWallet(props) {
10
+ const [t] = useTranslation(undefined, {
11
+ i18n: i18nInstance
12
+ });
13
+ const {
14
+ deviceDetails,
15
+ button,
16
+ walletConnectUri,
17
+ onClick,
18
+ label,
19
+ buttonRadius
20
+ } = props;
21
+ const isLink = useMemo(() => deviceDetails.platform !== "desktop" && button.href && button.hasWalletConnect && !button.hasInjectedWallet, [deviceDetails, button]);
22
+ const href = useMemo(() => button.href ? formatIOSMobile({
23
+ uri: walletConnectUri,
24
+ link: button.href
25
+ }) : walletConnectUri, [button, walletConnectUri]);
26
+ const handleBtnClick = () => {
27
+ if (href && isLink) {
28
+ window.open(href, "_blank");
29
+ } else if (onClick) {
30
+ onClick();
31
+ }
32
+ };
33
+ return /*#__PURE__*/jsxs("button", {
34
+ type: "button",
35
+ className: cn(`w3a--flex w3a--w-full w3a--items-center w3a--justify-between w3a--bg-app-gray-50 w3a--p-3 hover:w3a--bg-app-gray-200 hover:w3a--text-app-gray-900 dark:w3a--bg-app-gray-800 dark:hover:w3a--bg-app-gray-600`, {
36
+ "w3a--rounded-full": buttonRadius === "pill",
37
+ "w3a--rounded-lg": buttonRadius === "rounded",
38
+ "w3a--rounded-none": buttonRadius === "square"
39
+ }),
40
+ onClick: handleBtnClick,
41
+ children: [/*#__PURE__*/jsxs("div", {
42
+ className: "w3a--flex w3a--items-center w3a--gap-x-2",
43
+ children: [/*#__PURE__*/jsx("figure", {
44
+ className: button.icon ? "w3a--size-5" : "w3a--size-5 w3a--rounded-full w3a--bg-app-gray-300",
45
+ children: /*#__PURE__*/jsx(Image, {
46
+ imageData: button.icon,
47
+ imageId: `login-${button.name}`,
48
+ hoverImageId: `login-${button.name}`,
49
+ fallbackImageId: "wallet",
50
+ height: "24",
51
+ width: "24",
52
+ isButton: true,
53
+ extension: button.imgExtension || "webp"
54
+ })
55
+ }), /*#__PURE__*/jsx("p", {
56
+ className: "w3a--text-base w3a--font-normal w3a--text-app-gray-700 dark:w3a--text-app-white",
57
+ children: label
58
+ })]
59
+ }), button.hasInjectedWallet && /*#__PURE__*/jsx("span", {
60
+ className: "w3a--inline-flex w3a--items-center w3a--rounded-md w3a--bg-app-primary-100 w3a--px-2 w3a--py-1 w3a--text-xs w3a--font-medium w3a--text-app-primary-800 dark:w3a--border dark:w3a--border-app-primary-400 dark:w3a--bg-transparent dark:w3a--text-app-primary-400",
61
+ children: t("modal.external.installed")
62
+ })]
63
+ });
64
+ }
65
+
66
+ export { ButtonWallet as default };
@@ -0,0 +1,200 @@
1
+ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
+ import { WALLET_CONNECTORS } from '@web3auth/no-modal';
3
+ import { useContext, useState, useMemo } from 'react';
4
+ import { CONNECT_WALLET_PAGES } from '../../constants.js';
5
+ import { RootContext } from '../../context/RootContext.js';
6
+ import ConnectWalletChainFilter from './ConnectWalletChainFilter/ConnectWalletChainFilter.js';
7
+ import ConnectWalletHeader from './ConnectWalletHeader/ConnectWalletHeader.js';
8
+ import ConnectWalletList from './ConnectWalletList/ConnectWalletList.js';
9
+ import ConnectWalletQrCode from './ConnectWalletQrCode/ConnectWalletQrCode.js';
10
+ import ConnectWalletSearch from './ConnectWalletSearch/ConnectWalletSearch.js';
11
+ import { jsxs, jsx } from 'react/jsx-runtime';
12
+
13
+ function ConnectWallet(props) {
14
+ var _selectedButton$walle;
15
+ const {
16
+ isDark,
17
+ config,
18
+ walletConnectUri,
19
+ walletRegistry,
20
+ allExternalButtons,
21
+ customConnectorButtons,
22
+ connectorVisibilityMap,
23
+ deviceDetails,
24
+ buttonRadius = "pill",
25
+ chainNamespace,
26
+ onBackClick,
27
+ handleExternalWalletClick,
28
+ handleWalletDetailsHeight
29
+ } = props;
30
+ const {
31
+ bodyState,
32
+ setBodyState,
33
+ toast,
34
+ setToast
35
+ } = useContext(RootContext);
36
+ const [currentPage, setCurrentPage] = useState(CONNECT_WALLET_PAGES.CONNECT_WALLET);
37
+ const [selectedWallet, setSelectedWallet] = useState(false);
38
+ const [isLoading] = useState(false);
39
+ const [selectedButton, setSelectedButton] = useState(null);
40
+ const [walletSearch, setWalletSearch] = useState("");
41
+ const [selectedChain, setSelectedChain] = useState("all");
42
+ const [isShowAllWallets, setIsShowAllWallets] = useState(false);
43
+ const handleBack = () => {
44
+ if (!selectedWallet && currentPage === CONNECT_WALLET_PAGES.CONNECT_WALLET && onBackClick) {
45
+ onBackClick(false);
46
+ return;
47
+ }
48
+ if (selectedWallet) {
49
+ setCurrentPage(CONNECT_WALLET_PAGES.CONNECT_WALLET);
50
+ setSelectedWallet(false);
51
+ handleWalletDetailsHeight();
52
+ }
53
+ };
54
+ const walletDiscoverySupported = useMemo(() => {
55
+ const supported = walletRegistry && Object.keys(walletRegistry.default || {}).length > 0 && Object.keys(walletRegistry.others || {}).length > 0;
56
+ return supported;
57
+ }, [walletRegistry]);
58
+ const allUniqueButtons = useMemo(() => {
59
+ const uniqueButtonSet = new Set();
60
+ return allExternalButtons.concat(customConnectorButtons).filter(button => {
61
+ if (uniqueButtonSet.has(button.name)) return false;
62
+ uniqueButtonSet.add(button.name);
63
+ return true;
64
+ });
65
+ }, [allExternalButtons, customConnectorButtons]);
66
+ const defaultButtonKeys = useMemo(() => new Set(Object.keys(walletRegistry.default)), [walletRegistry]);
67
+ const defaultButtons = useMemo(() => {
68
+ // display order: default injected buttons > custom adapter buttons > default non-injected buttons
69
+ const buttons = [...allExternalButtons.filter(button => button.hasInjectedWallet && defaultButtonKeys.has(button.name)), ...customConnectorButtons, ...allExternalButtons.filter(button => !button.hasInjectedWallet && defaultButtonKeys.has(button.name))];
70
+ const buttonSet = new Set();
71
+ return buttons.filter(button => {
72
+ if (buttonSet.has(button.name)) return false;
73
+ buttonSet.add(button.name);
74
+ return true;
75
+ }).filter(button => {
76
+ var _button$chainNamespac;
77
+ return selectedChain === "all" || ((_button$chainNamespac = button.chainNamespaces) === null || _button$chainNamespac === void 0 ? void 0 : _button$chainNamespac.includes(selectedChain));
78
+ });
79
+ }, [allExternalButtons, customConnectorButtons, defaultButtonKeys, selectedChain]);
80
+ const installedWalletButtons = useMemo(() => {
81
+ const visibilityMap = connectorVisibilityMap;
82
+ return Object.keys(config).reduce((acc, adapter) => {
83
+ if (![WALLET_CONNECTORS.WALLET_CONNECT_V2].includes(adapter) && visibilityMap[adapter]) {
84
+ acc.push({
85
+ name: adapter,
86
+ displayName: config[adapter].label || adapter,
87
+ hasInjectedWallet: config[adapter].isInjected,
88
+ hasWalletConnect: false,
89
+ hasInstallLinks: false
90
+ });
91
+ }
92
+ return acc;
93
+ }, []);
94
+ }, [connectorVisibilityMap, config]);
95
+ const handleWalletSearch = e => {
96
+ const searchValue = e.target.value;
97
+ setWalletSearch(searchValue);
98
+ };
99
+ const handleChainFilterChange = chain => {
100
+ setSelectedChain(chain);
101
+ setIsShowAllWallets(false);
102
+ };
103
+ const filteredButtons = useMemo(() => {
104
+ if (walletDiscoverySupported) {
105
+ return allUniqueButtons.filter(button => selectedChain === "all" || button.chainNamespaces.includes(selectedChain)).filter(button => button.name.toLowerCase().includes(walletSearch.toLowerCase()));
106
+ }
107
+ return installedWalletButtons;
108
+ }, [walletDiscoverySupported, installedWalletButtons, walletSearch, allUniqueButtons, selectedChain]);
109
+ const externalButtons = useMemo(() => {
110
+ if (walletDiscoverySupported && !walletSearch && !isShowAllWallets) {
111
+ return defaultButtons;
112
+ }
113
+ return filteredButtons;
114
+ }, [walletDiscoverySupported, walletSearch, filteredButtons, defaultButtons, isShowAllWallets]);
115
+ const totalExternalWalletsCount = useMemo(() => filteredButtons.length, [filteredButtons]);
116
+ const initialWalletCount = useMemo(() => {
117
+ if (isShowAllWallets) return totalExternalWalletsCount;
118
+ return walletDiscoverySupported ? defaultButtons.length : installedWalletButtons.length;
119
+ }, [walletDiscoverySupported, defaultButtons, installedWalletButtons, isShowAllWallets, totalExternalWalletsCount]);
120
+ const handleWalletClick = button => {
121
+ var _button$chainNamespac2, _button$chainNamespac3;
122
+ // show chain namespace selector if the button is an injected connector with multiple chain namespaces
123
+ const isChainNamespaceSelectorRequired = button.hasInjectedWallet && ((_button$chainNamespac2 = button.chainNamespaces) === null || _button$chainNamespac2 === void 0 ? void 0 : _button$chainNamespac2.length) > 1;
124
+ if (isChainNamespaceSelectorRequired) {
125
+ setBodyState(_objectSpread(_objectSpread({}, bodyState), {}, {
126
+ showMultiChainSelector: true,
127
+ walletDetails: button
128
+ }));
129
+ return;
130
+ }
131
+ const isInjectedConnectorAndSingleChainNamespace = button.hasInjectedWallet && ((_button$chainNamespac3 = button.chainNamespaces) === null || _button$chainNamespac3 === void 0 ? void 0 : _button$chainNamespac3.length) === 1;
132
+ // if doesn't have wallet connect & doesn't have install links, must be a custom connector
133
+ const isCustomConnector = !button.hasInjectedWallet && !button.hasWalletConnect && !button.hasInstallLinks;
134
+ if (isInjectedConnectorAndSingleChainNamespace || isCustomConnector) {
135
+ return handleExternalWalletClick({
136
+ connector: button.name
137
+ });
138
+ }
139
+ if (button.hasWalletConnect || !isInjectedConnectorAndSingleChainNamespace) {
140
+ setSelectedButton(button);
141
+ setSelectedWallet(true);
142
+ setCurrentPage(CONNECT_WALLET_PAGES.SELECTED_WALLET);
143
+ handleWalletDetailsHeight();
144
+ } else {
145
+ setBodyState(_objectSpread(_objectSpread({}, bodyState), {}, {
146
+ showWalletDetails: true,
147
+ walletDetails: button
148
+ }));
149
+ }
150
+ };
151
+ const handleMoreWallets = () => {
152
+ setIsShowAllWallets(true);
153
+ };
154
+ return /*#__PURE__*/jsxs("div", {
155
+ className: "w3a--relative w3a--flex w3a--flex-1 w3a--flex-col w3a--gap-y-4",
156
+ children: [/*#__PURE__*/jsx(ConnectWalletHeader, {
157
+ onBackClick: handleBack,
158
+ currentPage: currentPage,
159
+ selectedButton: selectedButton
160
+ }), selectedWallet ? /*#__PURE__*/jsx(ConnectWalletQrCode, {
161
+ toast: toast,
162
+ setToast: setToast,
163
+ walletConnectUri: walletConnectUri,
164
+ isDark: isDark,
165
+ selectedButton: selectedButton,
166
+ bodyState: bodyState,
167
+ primaryColor: (_selectedButton$walle = selectedButton.walletRegistryItem) === null || _selectedButton$walle === void 0 ? void 0 : _selectedButton$walle.primaryColor,
168
+ logoImage: `https://images.web3auth.io/login-${selectedButton.name}.${selectedButton.imgExtension}`,
169
+ setBodyState: setBodyState
170
+ }) : /*#__PURE__*/jsxs("div", {
171
+ className: "w3a--flex w3a--flex-col w3a--gap-y-2",
172
+ children: [/*#__PURE__*/jsx(ConnectWalletChainFilter, {
173
+ isDark: isDark,
174
+ isLoading: isLoading,
175
+ selectedChain: selectedChain,
176
+ setSelectedChain: handleChainFilterChange,
177
+ chainNamespace: chainNamespace
178
+ }), /*#__PURE__*/jsx(ConnectWalletSearch, {
179
+ totalExternalWalletCount: totalExternalWalletsCount,
180
+ isLoading: isLoading,
181
+ walletSearch: walletSearch,
182
+ handleWalletSearch: handleWalletSearch,
183
+ buttonRadius: buttonRadius
184
+ }), /*#__PURE__*/jsx(ConnectWalletList, {
185
+ externalButtons: externalButtons,
186
+ isLoading: isLoading,
187
+ totalExternalWalletsCount: totalExternalWalletsCount,
188
+ initialWalletCount: initialWalletCount,
189
+ handleWalletClick: handleWalletClick,
190
+ handleMoreWallets: handleMoreWallets,
191
+ isDark: isDark,
192
+ deviceDetails: deviceDetails,
193
+ walletConnectUri: walletConnectUri,
194
+ buttonRadius: buttonRadius
195
+ })]
196
+ })]
197
+ });
198
+ }
199
+
200
+ export { ConnectWallet as default };
@@ -0,0 +1,63 @@
1
+ import { useMemo } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import i18nInstance from '../../../localeImport.js';
4
+ import { cn, getIcons } from '../../../utils.js';
5
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
+
7
+ function ConnectWalletChainFilter(props) {
8
+ const {
9
+ isDark,
10
+ isLoading,
11
+ selectedChain,
12
+ setSelectedChain,
13
+ chainNamespace
14
+ } = props;
15
+ const [t] = useTranslation(undefined, {
16
+ i18n: i18nInstance
17
+ });
18
+ const chains = useMemo(() => {
19
+ const chains = [{
20
+ id: "all",
21
+ name: "modal.allChains",
22
+ icon: ""
23
+ }];
24
+ for (const chain of chainNamespace) {
25
+ chains.push({
26
+ id: chain,
27
+ name: chain === "eip155" ? "EVM" : chain,
28
+ icon: chain === "eip155" ? "ethereum" : chain
29
+ });
30
+ }
31
+ return chains;
32
+ }, [chainNamespace]);
33
+ if (isLoading) {
34
+ return /*#__PURE__*/jsx("div", {
35
+ className: "w3a--flex w3a--items-center w3a--justify-between w3a--gap-x-2",
36
+ children: Array.from({
37
+ length: chains.length
38
+ }).map((_, index) => /*#__PURE__*/jsx("div", {
39
+ className: "w3a--h-12 w3a--w-[100px] w3a--animate-pulse w3a--rounded-2xl w3a--bg-app-gray-200 dark:w3a--bg-app-gray-700"
40
+ }, `chain-loader-${index}`))
41
+ });
42
+ }
43
+ return /*#__PURE__*/jsx("div", {
44
+ className: "w3a--flex w3a--items-center w3a--justify-items-start w3a--gap-x-2",
45
+ children: chains.map(chain => /*#__PURE__*/jsxs("button", {
46
+ type: "button",
47
+ className: cn("w3a--flex w3a--items-center w3a--justify-center w3a--gap-x-1 w3a--text-xs w3a--font-medium w3a--px-4 w3a--py-3 w3a--text-app-gray-500 dark:w3a--text-app-gray-300 hover:w3a--bg-app-gray-200 dark:hover:w3a--bg-app-gray-700 w3a--h-12 w3a--rounded-2xl", {
48
+ "w3a--bg-app-gray-100 dark:w3a--bg-app-gray-800 w3a--border w3a--border-app-gray-200 dark:w3a--border-app-gray-700 w3a--text-app-gray-900 dark:w3a--text-app-white": selectedChain === chain.id
49
+ }),
50
+ onClick: () => setSelectedChain(chain.id),
51
+ children: [chain.icon && /*#__PURE__*/jsx("img", {
52
+ src: getIcons(isDark ? `${chain.icon}-dark` : `${chain.icon}-light`),
53
+ alt: chain.name,
54
+ className: "w3a--size-5 w3a--object-contain"
55
+ }), /*#__PURE__*/jsx("span", {
56
+ className: "first-letter:w3a--capitalize",
57
+ children: t(chain.name)
58
+ })]
59
+ }, chain.id))
60
+ });
61
+ }
62
+
63
+ export { ConnectWalletChainFilter as default };
@@ -1,23 +1,19 @@
1
1
  import { useTranslation } from 'react-i18next';
2
- import i18nInstance from '../../localeImport.js';
3
- import Button from '../Button/Button.js';
4
- import Image from '../Image.js';
5
- import ExternalWalletHeader from './ExternalWalletHeader.js';
2
+ import i18nInstance from '../../../localeImport.js';
3
+ import { getIcons } from '../../../utils.js';
4
+ import Image from '../../Image/Image.js';
6
5
  import { jsxs, jsx } from 'react/jsx-runtime';
7
6
 
8
- function ExternalWalletChainNamespace(props) {
7
+ const ConnectWalletChainNamespaceSelect = props => {
9
8
  const {
10
- button,
11
- goBack,
12
- closeModal,
9
+ isDark,
10
+ wallet,
13
11
  handleExternalWalletClick
14
12
  } = props;
15
13
  const [t] = useTranslation(undefined, {
16
14
  i18n: i18nInstance
17
15
  });
18
-
19
- // chainNames should be available when selecting a chain namespace
20
- const chainNamespaces = button.chainNamespaces.map(chainNamespace => {
16
+ const chainNamespaces = wallet.chainNamespaces.map(chainNamespace => {
21
17
  const imageId = chainNamespace === "eip155" ? "evm" : chainNamespace;
22
18
  const displayName = chainNamespace === "eip155" ? "EVM" : chainNamespace;
23
19
  return {
@@ -27,25 +23,27 @@ function ExternalWalletChainNamespace(props) {
27
23
  };
28
24
  });
29
25
  return /*#__PURE__*/jsxs("div", {
30
- children: [/*#__PURE__*/jsx(ExternalWalletHeader, {
31
- title: `${t("modal.external.select-chain")}`,
32
- goBack: goBack,
33
- closeModal: closeModal
26
+ children: [/*#__PURE__*/jsx("div", {
27
+ className: "w3a--flex w3a--items-center w3a--justify-center",
28
+ children: /*#__PURE__*/jsx("p", {
29
+ className: "w3a--text-base w3a--font-medium w3a--text-app-gray-900 dark:w3a--text-app-white",
30
+ children: t("modal.external.select-chain")
31
+ })
34
32
  }), /*#__PURE__*/jsx("div", {
35
- className: "w3a--flex w3a--justify-center w3a--my-6",
33
+ className: "w3a--my-6 w3a--flex w3a--justify-center",
36
34
  children: /*#__PURE__*/jsx(Image, {
37
- imageId: `login-${button.name}`,
38
- hoverImageId: `login-${button.name}`,
35
+ imageId: `login-${wallet.name}`,
36
+ hoverImageId: `login-${wallet.name}`,
39
37
  fallbackImageId: "wallet",
40
38
  height: "100",
41
39
  width: "100",
42
40
  isButton: true,
43
- extension: button.imgExtension
41
+ extension: wallet.imgExtension
44
42
  })
45
43
  }), /*#__PURE__*/jsx("p", {
46
- className: "w3a--text-center w3a--text-sm w3a--text-app-gray-500 w3a--my-6",
44
+ className: "w3a--my-6 w3a--text-center w3a--text-sm w3a--text-app-gray-500",
47
45
  children: t("modal.external.select-chain-description", {
48
- wallet: button.displayName
46
+ wallet: wallet.displayName
49
47
  })
50
48
  }), /*#__PURE__*/jsx("ul", {
51
49
  className: "w3a--flex w3a--flex-col w3a--gap-3",
@@ -54,15 +52,13 @@ function ExternalWalletChainNamespace(props) {
54
52
  displayName,
55
53
  imageId
56
54
  }) => /*#__PURE__*/jsx("li", {
57
- children: /*#__PURE__*/jsxs(Button, {
58
- variant: "tertiary",
55
+ children: /*#__PURE__*/jsxs("button", {
59
56
  type: "button",
57
+ className: "w3a--btn w3a-external-wallet-btn w3a--h-12 w3a--w-full w3a--items-center !w3a--justify-between w3a--rounded-full",
60
58
  onClick: () => handleExternalWalletClick({
61
- connector: button.name,
59
+ connector: wallet.name,
62
60
  chainNamespace
63
61
  }),
64
- className: "w3a--w-full w3a--size-xl !w3a--justify-between w3a--items-center wallet-btn",
65
- title: displayName,
66
62
  children: [/*#__PURE__*/jsxs("div", {
67
63
  className: "w3a--flex w3a--items-center",
68
64
  children: [/*#__PURE__*/jsx(Image, {
@@ -77,14 +73,16 @@ function ExternalWalletChainNamespace(props) {
77
73
  className: "w3a--ml-2 w3a--text-left w3a--text-sm first-letter:w3a--capitalize",
78
74
  children: displayName
79
75
  })]
80
- }), /*#__PURE__*/jsx("span", {
81
- className: "w3a--inline-flex w3a--items-center w3a--rounded-lg w3a--px-2 w3a--py-1 w3a--text-xs w3a--font-medium w3a--bg-app-primary-100 w3a--text-app-primary-800",
82
- children: t("modal.external.installed")
76
+ }), /*#__PURE__*/jsx("img", {
77
+ id: "external-wallet-arrow",
78
+ className: "w3a--icon-animation",
79
+ src: getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
80
+ alt: "arrow"
83
81
  })]
84
82
  })
85
83
  }, chainNamespace))
86
84
  })]
87
85
  });
88
- }
86
+ };
89
87
 
90
- export { ExternalWalletChainNamespace as default };
88
+ export { ConnectWalletChainNamespaceSelect as default };
@@ -0,0 +1,47 @@
1
+ import { useTranslation } from 'react-i18next';
2
+ import { CONNECT_WALLET_PAGES } from '../../../constants.js';
3
+ import i18nInstance from '../../../localeImport.js';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+
6
+ function ConnectWalletHeader(props) {
7
+ const {
8
+ onBackClick,
9
+ currentPage,
10
+ selectedButton
11
+ } = props;
12
+ const [t] = useTranslation(undefined, {
13
+ i18n: i18nInstance
14
+ });
15
+ const handleBack = () => {
16
+ if (onBackClick) {
17
+ onBackClick();
18
+ }
19
+ };
20
+ return /*#__PURE__*/jsxs("div", {
21
+ className: "w3a--flex w3a--items-center w3a--justify-between",
22
+ children: [/*#__PURE__*/jsx("button", {
23
+ type: "button",
24
+ className: "w3a--z-20 w3a--flex w3a--size-5 w3a--cursor-pointer w3a--items-center w3a--justify-center w3a--rounded-full",
25
+ onClick: handleBack,
26
+ children: /*#__PURE__*/jsx("svg", {
27
+ xmlns: "http://www.w3.org/2000/svg",
28
+ fill: "none",
29
+ viewBox: "0 0 20 20",
30
+ className: "w3a--text-app-gray-900 dark:w3a--text-app-white",
31
+ children: /*#__PURE__*/jsx("path", {
32
+ fill: "currentColor",
33
+ fillRule: "evenodd",
34
+ d: "M9.707 16.707a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414l6-6a1 1 0 0 1 1.414 1.414L5.414 9H17a1 1 0 1 1 0 2H5.414l4.293 4.293a1 1 0 0 1 0 1.414",
35
+ clipRule: "evenodd"
36
+ })
37
+ })
38
+ }), /*#__PURE__*/jsx("p", {
39
+ className: "w3a--text-base w3a--font-medium w3a--text-app-gray-900 dark:w3a--text-app-white",
40
+ children: currentPage === CONNECT_WALLET_PAGES.SELECTED_WALLET ? selectedButton === null || selectedButton === void 0 ? void 0 : selectedButton.displayName : currentPage === CONNECT_WALLET_PAGES.CONNECT_WALLET ? t("modal.connectYourWallet") : currentPage
41
+ }), /*#__PURE__*/jsx("div", {
42
+ className: "w3a--z-[-1] w3a--size-5"
43
+ })]
44
+ });
45
+ }
46
+
47
+ export { ConnectWalletHeader as default };