@varity-labs/ui-kit 2.0.0-beta.6 → 2.0.0-beta.8

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 (242) hide show
  1. package/README.md +14 -16
  2. package/dist/components/PaymentWidget/PaymentWidget.d.ts +7 -19
  3. package/dist/components/PaymentWidget/PaymentWidget.d.ts.map +1 -1
  4. package/dist/components/PaymentWidget/PaymentWidget.js +10 -176
  5. package/dist/components/PaymentWidget/PaymentWidget.js.map +1 -1
  6. package/dist/components/PaymentWidget/useSeamlessPayment.d.ts +8 -34
  7. package/dist/components/PaymentWidget/useSeamlessPayment.d.ts.map +1 -1
  8. package/dist/components/PaymentWidget/useSeamlessPayment.js +12 -158
  9. package/dist/components/PaymentWidget/useSeamlessPayment.js.map +1 -1
  10. package/dist/components/PaymentWidget/useVarityPayment.d.ts +5 -6
  11. package/dist/components/PaymentWidget/useVarityPayment.d.ts.map +1 -1
  12. package/dist/components/PaymentWidget/useVarityPayment.js +11 -147
  13. package/dist/components/PaymentWidget/useVarityPayment.js.map +1 -1
  14. package/dist/providers/PrivyStack.d.ts +14 -9
  15. package/dist/providers/PrivyStack.d.ts.map +1 -1
  16. package/dist/providers/PrivyStack.js +2 -4
  17. package/dist/providers/PrivyStack.js.map +1 -1
  18. package/dist/providers/VarityDashboardProvider.d.ts +2 -2
  19. package/dist/providers/VarityDashboardProvider.d.ts.map +1 -1
  20. package/dist/providers/VarityDashboardProvider.js +3 -26
  21. package/dist/providers/VarityDashboardProvider.js.map +1 -1
  22. package/dist/providers/WalletSyncProvider.d.ts +3 -7
  23. package/dist/providers/WalletSyncProvider.d.ts.map +1 -1
  24. package/dist/providers/WalletSyncProvider.js +6 -14
  25. package/dist/providers/WalletSyncProvider.js.map +1 -1
  26. package/package.json +5 -6
  27. package/dist/components/Analytics/__tests__/DataTable.test.d.ts +0 -2
  28. package/dist/components/Analytics/__tests__/DataTable.test.d.ts.map +0 -1
  29. package/dist/components/Analytics/__tests__/DataTable.test.js +0 -113
  30. package/dist/components/Analytics/__tests__/DataTable.test.js.map +0 -1
  31. package/dist/components/Dashboard/__tests__/EmptyState.test.d.ts +0 -2
  32. package/dist/components/Dashboard/__tests__/EmptyState.test.d.ts.map +0 -1
  33. package/dist/components/Dashboard/__tests__/EmptyState.test.js +0 -81
  34. package/dist/components/Dashboard/__tests__/EmptyState.test.js.map +0 -1
  35. package/dist/components/Dashboard/__tests__/KPICard.test.d.ts +0 -2
  36. package/dist/components/Dashboard/__tests__/KPICard.test.d.ts.map +0 -1
  37. package/dist/components/Dashboard/__tests__/KPICard.test.js +0 -78
  38. package/dist/components/Dashboard/__tests__/KPICard.test.js.map +0 -1
  39. package/dist/components/InAppWallet/EmailLoginButton.d.ts +0 -27
  40. package/dist/components/InAppWallet/EmailLoginButton.d.ts.map +0 -1
  41. package/dist/components/InAppWallet/EmailLoginButton.js +0 -84
  42. package/dist/components/InAppWallet/EmailLoginButton.js.map +0 -1
  43. package/dist/components/InAppWallet/InAppWalletProvider.d.ts +0 -54
  44. package/dist/components/InAppWallet/InAppWalletProvider.d.ts.map +0 -1
  45. package/dist/components/InAppWallet/InAppWalletProvider.js +0 -225
  46. package/dist/components/InAppWallet/InAppWalletProvider.js.map +0 -1
  47. package/dist/components/InAppWallet/OnboardingFlow.d.ts +0 -25
  48. package/dist/components/InAppWallet/OnboardingFlow.d.ts.map +0 -1
  49. package/dist/components/InAppWallet/OnboardingFlow.js +0 -159
  50. package/dist/components/InAppWallet/OnboardingFlow.js.map +0 -1
  51. package/dist/components/InAppWallet/SocialLoginButtons.d.ts +0 -28
  52. package/dist/components/InAppWallet/SocialLoginButtons.d.ts.map +0 -1
  53. package/dist/components/InAppWallet/SocialLoginButtons.js +0 -128
  54. package/dist/components/InAppWallet/SocialLoginButtons.js.map +0 -1
  55. package/dist/components/InAppWallet/index.d.ts +0 -15
  56. package/dist/components/InAppWallet/index.d.ts.map +0 -1
  57. package/dist/components/InAppWallet/index.js +0 -14
  58. package/dist/components/InAppWallet/index.js.map +0 -1
  59. package/dist/components/Payments/CheckoutModal.d.ts +0 -19
  60. package/dist/components/Payments/CheckoutModal.d.ts.map +0 -1
  61. package/dist/components/Payments/CheckoutModal.js +0 -194
  62. package/dist/components/Payments/CheckoutModal.js.map +0 -1
  63. package/dist/components/Payments/SubscriptionWidget.d.ts +0 -17
  64. package/dist/components/Payments/SubscriptionWidget.d.ts.map +0 -1
  65. package/dist/components/Payments/SubscriptionWidget.js +0 -89
  66. package/dist/components/Payments/SubscriptionWidget.js.map +0 -1
  67. package/dist/components/Payments/constants.d.ts +0 -59
  68. package/dist/components/Payments/constants.d.ts.map +0 -1
  69. package/dist/components/Payments/constants.js +0 -145
  70. package/dist/components/Payments/constants.js.map +0 -1
  71. package/dist/components/Payments/index.d.ts +0 -10
  72. package/dist/components/Payments/index.d.ts.map +0 -1
  73. package/dist/components/Payments/index.js +0 -12
  74. package/dist/components/Payments/index.js.map +0 -1
  75. package/dist/components/Payments/types.d.ts +0 -119
  76. package/dist/components/Payments/types.d.ts.map +0 -1
  77. package/dist/components/Payments/types.js +0 -27
  78. package/dist/components/Payments/types.js.map +0 -1
  79. package/dist/components/Payments/usePayments.d.ts +0 -33
  80. package/dist/components/Payments/usePayments.d.ts.map +0 -1
  81. package/dist/components/Payments/usePayments.js +0 -249
  82. package/dist/components/Payments/usePayments.js.map +0 -1
  83. package/dist/components/Privy/__tests__/InitScreens.test.d.ts +0 -2
  84. package/dist/components/Privy/__tests__/InitScreens.test.d.ts.map +0 -1
  85. package/dist/components/Privy/__tests__/InitScreens.test.js +0 -74
  86. package/dist/components/Privy/__tests__/InitScreens.test.js.map +0 -1
  87. package/dist/components/SIWE/AuthStatus.d.ts +0 -15
  88. package/dist/components/SIWE/AuthStatus.d.ts.map +0 -1
  89. package/dist/components/SIWE/AuthStatus.js +0 -47
  90. package/dist/components/SIWE/AuthStatus.js.map +0 -1
  91. package/dist/components/SIWE/ProtectedRoute.d.ts +0 -17
  92. package/dist/components/SIWE/ProtectedRoute.d.ts.map +0 -1
  93. package/dist/components/SIWE/ProtectedRoute.js +0 -52
  94. package/dist/components/SIWE/ProtectedRoute.js.map +0 -1
  95. package/dist/components/SIWE/SIWEButton.d.ts +0 -22
  96. package/dist/components/SIWE/SIWEButton.d.ts.map +0 -1
  97. package/dist/components/SIWE/SIWEButton.js +0 -106
  98. package/dist/components/SIWE/SIWEButton.js.map +0 -1
  99. package/dist/components/SIWE/SIWEModal.d.ts +0 -19
  100. package/dist/components/SIWE/SIWEModal.d.ts.map +0 -1
  101. package/dist/components/SIWE/SIWEModal.js +0 -75
  102. package/dist/components/SIWE/SIWEModal.js.map +0 -1
  103. package/dist/components/SIWE/SIWEProvider.d.ts +0 -38
  104. package/dist/components/SIWE/SIWEProvider.d.ts.map +0 -1
  105. package/dist/components/SIWE/SIWEProvider.js +0 -227
  106. package/dist/components/SIWE/SIWEProvider.js.map +0 -1
  107. package/dist/components/SIWE/index.d.ts +0 -15
  108. package/dist/components/SIWE/index.d.ts.map +0 -1
  109. package/dist/components/SIWE/index.js +0 -10
  110. package/dist/components/SIWE/index.js.map +0 -1
  111. package/dist/core/VarityClient.d.ts +0 -76
  112. package/dist/core/VarityClient.d.ts.map +0 -1
  113. package/dist/core/VarityClient.js +0 -99
  114. package/dist/core/VarityClient.js.map +0 -1
  115. package/dist/core/config.d.ts +0 -136
  116. package/dist/core/config.d.ts.map +0 -1
  117. package/dist/core/config.js +0 -156
  118. package/dist/core/config.js.map +0 -1
  119. package/dist/hooks/useAnalytics.d.ts +0 -94
  120. package/dist/hooks/useAnalytics.d.ts.map +0 -1
  121. package/dist/hooks/useAnalytics.js +0 -116
  122. package/dist/hooks/useAnalytics.js.map +0 -1
  123. package/dist/hooks/useAuth.d.ts +0 -71
  124. package/dist/hooks/useAuth.d.ts.map +0 -1
  125. package/dist/hooks/useAuth.js +0 -198
  126. package/dist/hooks/useAuth.js.map +0 -1
  127. package/dist/hooks/useDashboard.d.ts +0 -110
  128. package/dist/hooks/useDashboard.d.ts.map +0 -1
  129. package/dist/hooks/useDashboard.js +0 -201
  130. package/dist/hooks/useDashboard.js.map +0 -1
  131. package/dist/hooks/useVarityAPI.d.ts +0 -88
  132. package/dist/hooks/useVarityAPI.d.ts.map +0 -1
  133. package/dist/hooks/useVarityAPI.js +0 -138
  134. package/dist/hooks/useVarityAPI.js.map +0 -1
  135. package/dist/hooks/useWalletAuth.d.ts +0 -108
  136. package/dist/hooks/useWalletAuth.d.ts.map +0 -1
  137. package/dist/hooks/useWalletAuth.js +0 -415
  138. package/dist/hooks/useWalletAuth.js.map +0 -1
  139. package/dist/hooks/web3/index.d.ts +0 -5
  140. package/dist/hooks/web3/index.d.ts.map +0 -1
  141. package/dist/hooks/web3/index.js +0 -6
  142. package/dist/hooks/web3/index.js.map +0 -1
  143. package/dist/hooks/web3/useAddressValidation.d.ts +0 -37
  144. package/dist/hooks/web3/useAddressValidation.d.ts.map +0 -1
  145. package/dist/hooks/web3/useAddressValidation.js +0 -59
  146. package/dist/hooks/web3/useAddressValidation.js.map +0 -1
  147. package/dist/hooks/web3/useBlockExplorer.d.ts +0 -37
  148. package/dist/hooks/web3/useBlockExplorer.d.ts.map +0 -1
  149. package/dist/hooks/web3/useBlockExplorer.js +0 -59
  150. package/dist/hooks/web3/useBlockExplorer.js.map +0 -1
  151. package/dist/hooks/web3/useUSDCFormat.d.ts +0 -34
  152. package/dist/hooks/web3/useUSDCFormat.d.ts.map +0 -1
  153. package/dist/hooks/web3/useUSDCFormat.js +0 -43
  154. package/dist/hooks/web3/useUSDCFormat.js.map +0 -1
  155. package/dist/hooks/web3/useVarityWallet.d.ts +0 -48
  156. package/dist/hooks/web3/useVarityWallet.d.ts.map +0 -1
  157. package/dist/hooks/web3/useVarityWallet.js +0 -70
  158. package/dist/hooks/web3/useVarityWallet.js.map +0 -1
  159. package/dist/modules/cache/index.d.ts +0 -12
  160. package/dist/modules/cache/index.d.ts.map +0 -1
  161. package/dist/modules/cache/index.js +0 -13
  162. package/dist/modules/cache/index.js.map +0 -1
  163. package/dist/providers/ChainContext.d.ts +0 -65
  164. package/dist/providers/ChainContext.d.ts.map +0 -1
  165. package/dist/providers/ChainContext.js +0 -92
  166. package/dist/providers/ChainContext.js.map +0 -1
  167. package/dist/providers/VarityProvider.d.ts +0 -32
  168. package/dist/providers/VarityProvider.d.ts.map +0 -1
  169. package/dist/providers/VarityProvider.js +0 -56
  170. package/dist/providers/VarityProvider.js.map +0 -1
  171. package/dist/providers/WalletContext.d.ts +0 -68
  172. package/dist/providers/WalletContext.d.ts.map +0 -1
  173. package/dist/providers/WalletContext.js +0 -98
  174. package/dist/providers/WalletContext.js.map +0 -1
  175. package/dist/providers/index.d.ts +0 -48
  176. package/dist/providers/index.d.ts.map +0 -1
  177. package/dist/providers/index.js +0 -53
  178. package/dist/providers/index.js.map +0 -1
  179. package/dist/types/api-extensions.d.ts +0 -92
  180. package/dist/types/api-extensions.d.ts.map +0 -1
  181. package/dist/types/api-extensions.js +0 -7
  182. package/dist/types/api-extensions.js.map +0 -1
  183. package/dist/wallets/SimpleSmartWallet.d.ts +0 -68
  184. package/dist/wallets/SimpleSmartWallet.d.ts.map +0 -1
  185. package/dist/wallets/SimpleSmartWallet.js +0 -74
  186. package/dist/wallets/SimpleSmartWallet.js.map +0 -1
  187. package/dist/wallets/SmartWalletProvider.d.ts +0 -217
  188. package/dist/wallets/SmartWalletProvider.d.ts.map +0 -1
  189. package/dist/wallets/SmartWalletProvider.js +0 -366
  190. package/dist/wallets/SmartWalletProvider.js.map +0 -1
  191. package/dist/wallets/config.d.ts +0 -222
  192. package/dist/wallets/config.d.ts.map +0 -1
  193. package/dist/wallets/config.js +0 -206
  194. package/dist/wallets/config.js.map +0 -1
  195. package/dist/wallets/index.d.ts +0 -9
  196. package/dist/wallets/index.d.ts.map +0 -1
  197. package/dist/wallets/index.js +0 -9
  198. package/dist/wallets/index.js.map +0 -1
  199. package/dist/web3/AddressDisplay/AddressDisplay.d.ts +0 -33
  200. package/dist/web3/AddressDisplay/AddressDisplay.d.ts.map +0 -1
  201. package/dist/web3/AddressDisplay/AddressDisplay.js +0 -42
  202. package/dist/web3/AddressDisplay/AddressDisplay.js.map +0 -1
  203. package/dist/web3/AddressInput/AddressInput.d.ts +0 -36
  204. package/dist/web3/AddressInput/AddressInput.d.ts.map +0 -1
  205. package/dist/web3/AddressInput/AddressInput.js +0 -54
  206. package/dist/web3/AddressInput/AddressInput.js.map +0 -1
  207. package/dist/web3/AmountInput/AmountInput.d.ts +0 -41
  208. package/dist/web3/AmountInput/AmountInput.d.ts.map +0 -1
  209. package/dist/web3/AmountInput/AmountInput.js +0 -74
  210. package/dist/web3/AmountInput/AmountInput.js.map +0 -1
  211. package/dist/web3/BalanceDisplay/BalanceDisplay.d.ts +0 -30
  212. package/dist/web3/BalanceDisplay/BalanceDisplay.d.ts.map +0 -1
  213. package/dist/web3/BalanceDisplay/BalanceDisplay.js +0 -35
  214. package/dist/web3/BalanceDisplay/BalanceDisplay.js.map +0 -1
  215. package/dist/web3/BlockExplorerLink/BlockExplorerLink.d.ts +0 -41
  216. package/dist/web3/BlockExplorerLink/BlockExplorerLink.d.ts.map +0 -1
  217. package/dist/web3/BlockExplorerLink/BlockExplorerLink.js +0 -46
  218. package/dist/web3/BlockExplorerLink/BlockExplorerLink.js.map +0 -1
  219. package/dist/web3/ConnectWallet/ConnectWallet.d.ts +0 -35
  220. package/dist/web3/ConnectWallet/ConnectWallet.d.ts.map +0 -1
  221. package/dist/web3/ConnectWallet/ConnectWallet.js +0 -58
  222. package/dist/web3/ConnectWallet/ConnectWallet.js.map +0 -1
  223. package/dist/web3/DisconnectButton/DisconnectButton.d.ts +0 -30
  224. package/dist/web3/DisconnectButton/DisconnectButton.d.ts.map +0 -1
  225. package/dist/web3/DisconnectButton/DisconnectButton.js +0 -48
  226. package/dist/web3/DisconnectButton/DisconnectButton.js.map +0 -1
  227. package/dist/web3/WalletBalance/WalletBalance.d.ts +0 -27
  228. package/dist/web3/WalletBalance/WalletBalance.d.ts.map +0 -1
  229. package/dist/web3/WalletBalance/WalletBalance.js +0 -49
  230. package/dist/web3/WalletBalance/WalletBalance.js.map +0 -1
  231. package/dist/web3/WalletDropdown/WalletDropdown.d.ts +0 -29
  232. package/dist/web3/WalletDropdown/WalletDropdown.d.ts.map +0 -1
  233. package/dist/web3/WalletDropdown/WalletDropdown.js +0 -93
  234. package/dist/web3/WalletDropdown/WalletDropdown.js.map +0 -1
  235. package/dist/web3/WalletInfo/WalletInfo.d.ts +0 -31
  236. package/dist/web3/WalletInfo/WalletInfo.d.ts.map +0 -1
  237. package/dist/web3/WalletInfo/WalletInfo.js +0 -41
  238. package/dist/web3/WalletInfo/WalletInfo.js.map +0 -1
  239. package/dist/web3/index.d.ts +0 -11
  240. package/dist/web3/index.d.ts.map +0 -1
  241. package/dist/web3/index.js +0 -14
  242. package/dist/web3/index.js.map +0 -1
@@ -1,225 +0,0 @@
1
- /**
2
- * InAppWalletProvider - Thirdweb In-App Wallet Provider for Varity L3
3
- *
4
- * Provides email/social authentication with custodial wallet management
5
- * Supports: Email OTP, Google, Apple, Facebook, Discord, Twitter
6
- *
7
- * @example
8
- * ```tsx
9
- * <InAppWalletProvider clientId="your-client-id">
10
- * <YourApp />
11
- * </InAppWalletProvider>
12
- * ```
13
- */
14
- import React, { createContext, useContext, useState, useCallback, useEffect } from 'react';
15
- import { ThirdwebProvider } from 'thirdweb/react';
16
- import { useActiveAccount, useConnect } from 'thirdweb/react';
17
- import { inAppWallet, preAuthenticate } from 'thirdweb/wallets/in-app';
18
- import { createThirdwebClient } from 'thirdweb';
19
- import toast from 'react-hot-toast';
20
- import { getErrorMessage } from '@varity-labs/types';
21
- const InAppWalletContext = createContext(undefined);
22
- /**
23
- * Internal component that uses Thirdweb hooks
24
- */
25
- function InAppWalletManager({ children, onLoginSuccess, onLoginError, onLogout, client }) {
26
- const [user, setUser] = useState(null);
27
- const [wallet, setWallet] = useState(null);
28
- const [isLoading, setIsLoading] = useState(false);
29
- const { connect } = useConnect();
30
- const activeAccount = useActiveAccount();
31
- const isAuthenticated = !!activeAccount;
32
- // Update user when account changes
33
- useEffect(() => {
34
- if (activeAccount) {
35
- const walletAddress = activeAccount.address;
36
- const userData = {
37
- walletAddress,
38
- userId: walletAddress,
39
- authMethod: 'email', // Default, will be updated based on actual method
40
- };
41
- setUser(userData);
42
- onLoginSuccess?.(userData);
43
- }
44
- else {
45
- setUser(null);
46
- }
47
- }, [activeAccount, onLoginSuccess]);
48
- const loginWithEmail = useCallback(async (email) => {
49
- setIsLoading(true);
50
- try {
51
- // Step 1: Send OTP to email
52
- await preAuthenticate({
53
- client,
54
- strategy: 'email',
55
- email,
56
- });
57
- toast.success(`Check ${email} for your verification code.`);
58
- }
59
- catch (error) {
60
- const errorMessage = getErrorMessage(error);
61
- console.error('Email login error:', errorMessage);
62
- const errorObj = error instanceof Error ? error : new Error(errorMessage);
63
- onLoginError?.(errorObj);
64
- toast.error('Failed to send verification code');
65
- }
66
- finally {
67
- setIsLoading(false);
68
- }
69
- }, [client, onLoginError]);
70
- const verifyEmailCode = useCallback(async (email, verificationCode) => {
71
- setIsLoading(true);
72
- try {
73
- const w = inAppWallet();
74
- setWallet(w);
75
- // Step 2: Verify OTP and connect wallet
76
- await connect(async () => {
77
- await w.connect({
78
- client,
79
- strategy: 'email',
80
- email,
81
- verificationCode,
82
- });
83
- return w;
84
- });
85
- toast.success('Successfully logged in!');
86
- }
87
- catch (error) {
88
- const errorMessage = getErrorMessage(error);
89
- console.error('Email verification error:', errorMessage);
90
- const errorObj = error instanceof Error ? error : new Error(errorMessage);
91
- onLoginError?.(errorObj);
92
- toast.error('Invalid verification code');
93
- }
94
- finally {
95
- setIsLoading(false);
96
- }
97
- }, [connect, client, onLoginError]);
98
- const loginWithGoogle = useCallback(async () => {
99
- setIsLoading(true);
100
- try {
101
- const wallet = inAppWallet();
102
- setWallet(wallet);
103
- await connect(async () => {
104
- await wallet.connect({
105
- client,
106
- strategy: 'google',
107
- });
108
- return wallet;
109
- });
110
- toast.success('Successfully logged in with Google!');
111
- }
112
- catch (error) {
113
- const errorMessage = getErrorMessage(error);
114
- console.error('Google login error:', errorMessage);
115
- const errorObj = error instanceof Error ? error : new Error(errorMessage);
116
- onLoginError?.(errorObj);
117
- toast.error('Failed to login with Google');
118
- }
119
- finally {
120
- setIsLoading(false);
121
- }
122
- }, [connect, client, onLoginError]);
123
- const loginWithApple = useCallback(async () => {
124
- setIsLoading(true);
125
- try {
126
- const wallet = inAppWallet();
127
- setWallet(wallet);
128
- await connect(async () => {
129
- await wallet.connect({
130
- client,
131
- strategy: 'apple',
132
- });
133
- return wallet;
134
- });
135
- toast.success('Successfully logged in with Apple!');
136
- }
137
- catch (error) {
138
- const errorMessage = getErrorMessage(error);
139
- console.error('Apple login error:', errorMessage);
140
- const errorObj = error instanceof Error ? error : new Error(errorMessage);
141
- onLoginError?.(errorObj);
142
- toast.error('Failed to login with Apple');
143
- }
144
- finally {
145
- setIsLoading(false);
146
- }
147
- }, [connect, client, onLoginError]);
148
- const loginWithFacebook = useCallback(async () => {
149
- setIsLoading(true);
150
- try {
151
- const wallet = inAppWallet();
152
- setWallet(wallet);
153
- await connect(async () => {
154
- await wallet.connect({
155
- client,
156
- strategy: 'facebook',
157
- });
158
- return wallet;
159
- });
160
- toast.success('Successfully logged in with Facebook!');
161
- }
162
- catch (error) {
163
- const errorMessage = getErrorMessage(error);
164
- console.error('Facebook login error:', errorMessage);
165
- const errorObj = error instanceof Error ? error : new Error(errorMessage);
166
- onLoginError?.(errorObj);
167
- toast.error('Failed to login with Facebook');
168
- }
169
- finally {
170
- setIsLoading(false);
171
- }
172
- }, [connect, client, onLoginError]);
173
- const logout = useCallback(async () => {
174
- setIsLoading(true);
175
- try {
176
- if (wallet) {
177
- await wallet.disconnect();
178
- }
179
- setUser(null);
180
- setWallet(null);
181
- onLogout?.();
182
- toast.success('Logged out successfully');
183
- }
184
- catch (error) {
185
- const errorMessage = getErrorMessage(error);
186
- console.error('Logout error:', errorMessage);
187
- toast.error('Failed to logout');
188
- }
189
- finally {
190
- setIsLoading(false);
191
- }
192
- }, [wallet, onLogout]);
193
- const value = {
194
- user,
195
- isAuthenticated,
196
- isLoading,
197
- loginWithEmail,
198
- verifyEmailCode,
199
- loginWithGoogle,
200
- loginWithApple,
201
- loginWithFacebook,
202
- logout,
203
- wallet,
204
- };
205
- return (React.createElement(InAppWalletContext.Provider, { value: value }, children));
206
- }
207
- /**
208
- * Main provider component
209
- */
210
- export function InAppWalletProvider({ children, clientId, onLoginSuccess, onLoginError, onLogout }) {
211
- const client = React.useMemo(() => createThirdwebClient({ clientId }), [clientId]);
212
- return (React.createElement(ThirdwebProvider, null,
213
- React.createElement(InAppWalletManager, { client: client, onLoginSuccess: onLoginSuccess, onLoginError: onLoginError, onLogout: onLogout }, children)));
214
- }
215
- /**
216
- * Hook to use In-App Wallet context
217
- */
218
- export function useInAppWallet() {
219
- const context = useContext(InAppWalletContext);
220
- if (context === undefined) {
221
- throw new Error('useInAppWallet must be used within InAppWalletProvider');
222
- }
223
- return context;
224
- }
225
- //# sourceMappingURL=InAppWalletProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InAppWalletProvider.js","sourceRoot":"","sources":["../../../src/components/InAppWallet/InAppWalletProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,EAAE,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
3
- *
4
- * Multi-step wizard for onboarding users to Varity L3
5
- * Steps: Welcome -> Auth -> Wallet Created -> Buy USDC (optional) -> Dashboard
6
- *
7
- * @example
8
- * ```tsx
9
- * <OnboardingFlow
10
- * onComplete={(user) => router.push('/dashboard')}
11
- * skipBuyUSDC={false}
12
- * />
13
- * ```
14
- */
15
- import React from 'react';
16
- interface OnboardingFlowProps {
17
- onComplete?: (user: any) => void;
18
- onSkip?: () => void;
19
- skipBuyUSDC?: boolean;
20
- companyName?: string;
21
- companyLogo?: string;
22
- }
23
- export declare function OnboardingFlow({ onComplete, onSkip, skipBuyUSDC, companyName, companyLogo }: OnboardingFlowProps): React.JSX.Element;
24
- export {};
25
- //# sourceMappingURL=OnboardingFlow.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OnboardingFlow.d.ts","sourceRoot":"","sources":["../../../src/components/InAppWallet/OnboardingFlow.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,UAAU,mBAAmB;IAC3B,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,MAAM,EACN,WAAmB,EACnB,WAAsB,EACtB,WAAW,EACZ,EAAE,mBAAmB,qBAsRrB"}
@@ -1,159 +0,0 @@
1
- /**
2
- * OnboardingFlow - Complete User Onboarding Wizard
3
- *
4
- * Multi-step wizard for onboarding users to Varity L3
5
- * Steps: Welcome -> Auth -> Wallet Created -> Buy USDC (optional) -> Dashboard
6
- *
7
- * @example
8
- * ```tsx
9
- * <OnboardingFlow
10
- * onComplete={(user) => router.push('/dashboard')}
11
- * skipBuyUSDC={false}
12
- * />
13
- * ```
14
- */
15
- import React, { useState } from 'react';
16
- import { useInAppWallet } from './InAppWalletProvider';
17
- import { EmailLoginButton } from './EmailLoginButton';
18
- import { SocialLoginButtons } from './SocialLoginButtons';
19
- export function OnboardingFlow({ onComplete, onSkip, skipBuyUSDC = false, companyName = 'Varity', companyLogo }) {
20
- const { user, isAuthenticated } = useInAppWallet();
21
- const [currentStep, setCurrentStep] = useState('welcome');
22
- const showBuyUSDC = !skipBuyUSDC;
23
- const handleComplete = React.useCallback(() => {
24
- setCurrentStep('complete');
25
- onComplete?.(user);
26
- }, [user, onComplete]);
27
- // Auto-advance to wallet-created when authenticated
28
- React.useEffect(() => {
29
- if (isAuthenticated && user && currentStep === 'auth') {
30
- setCurrentStep('wallet-created');
31
- setTimeout(() => {
32
- if (showBuyUSDC) {
33
- setCurrentStep('buy-usdc');
34
- }
35
- else {
36
- handleComplete();
37
- }
38
- }, 3000); // Show success for 3 seconds
39
- }
40
- }, [isAuthenticated, user, currentStep, showBuyUSDC, handleComplete]);
41
- const handleSkipOnboarding = () => {
42
- onSkip?.();
43
- };
44
- const renderStep = () => {
45
- switch (currentStep) {
46
- case 'welcome':
47
- return (React.createElement("div", { className: "text-center space-y-6" },
48
- companyLogo && (React.createElement("img", { src: companyLogo, alt: companyName, className: "h-16 mx-auto" })),
49
- React.createElement("div", { className: "space-y-2" },
50
- React.createElement("h1", { className: "text-3xl font-bold text-gray-900" },
51
- "Welcome to ",
52
- companyName),
53
- React.createElement("p", { className: "text-lg text-gray-600" }, "Get started in 2 minutes - No crypto knowledge required")),
54
- React.createElement("div", { className: "bg-gradient-to-br from-indigo-50 to-purple-50 rounded-xl p-6 space-y-4" },
55
- React.createElement("h3", { className: "font-semibold text-gray-900" }, "What you'll get:"),
56
- React.createElement("ul", { className: "text-left space-y-3" },
57
- React.createElement("li", { className: "flex items-start gap-3" },
58
- React.createElement("svg", { className: "w-6 h-6 text-green-500 flex-shrink-0", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
59
- React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" })),
60
- React.createElement("span", { className: "text-gray-700" },
61
- React.createElement("strong", null, "Your own wallet"),
62
- " - Automatically created with email/social login")),
63
- React.createElement("li", { className: "flex items-start gap-3" },
64
- React.createElement("svg", { className: "w-6 h-6 text-green-500 flex-shrink-0", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
65
- React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" })),
66
- React.createElement("span", { className: "text-gray-700" },
67
- React.createElement("strong", null, "Free transactions"),
68
- " - USDC as gas token means low fees")),
69
- React.createElement("li", { className: "flex items-start gap-3" },
70
- React.createElement("svg", { className: "w-6 h-6 text-green-500 flex-shrink-0", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
71
- React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" })),
72
- React.createElement("span", { className: "text-gray-700" },
73
- React.createElement("strong", null, "Buy crypto with card"),
74
- " - Use credit card, Apple Pay, or Google Pay")))),
75
- React.createElement("button", { onClick: () => setCurrentStep('auth'), className: "w-full bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-700 hover:to-purple-700 text-white font-semibold py-4 px-6 rounded-xl transition-all shadow-lg hover:shadow-xl" }, "Get Started"),
76
- React.createElement("button", { onClick: handleSkipOnboarding, className: "text-sm text-gray-500 hover:text-gray-700" }, "Skip for now")));
77
- case 'auth':
78
- return (React.createElement("div", { className: "space-y-6" },
79
- React.createElement("div", { className: "text-center space-y-2" },
80
- React.createElement("h2", { className: "text-2xl font-bold text-gray-900" }, "Create Your Wallet"),
81
- React.createElement("p", { className: "text-gray-600" }, "Choose how you'd like to sign in - your wallet will be created automatically")),
82
- React.createElement("div", { className: "space-y-4" },
83
- React.createElement(SocialLoginButtons, { providers: ['google', 'apple', 'facebook'], layout: "vertical", showDivider: false }),
84
- React.createElement("div", { className: "relative my-6" },
85
- React.createElement("div", { className: "absolute inset-0 flex items-center" },
86
- React.createElement("div", { className: "w-full border-t border-gray-300" })),
87
- React.createElement("div", { className: "relative flex justify-center text-sm" },
88
- React.createElement("span", { className: "bg-white px-4 text-gray-500" }, "or use email"))),
89
- React.createElement(EmailLoginButton, null)),
90
- React.createElement("button", { onClick: () => setCurrentStep('welcome'), className: "w-full text-gray-600 hover:text-gray-900 font-medium" }, "\u2190 Back")));
91
- case 'wallet-created':
92
- return (React.createElement("div", { className: "text-center space-y-6" },
93
- React.createElement("div", { className: "flex justify-center" },
94
- React.createElement("div", { className: "relative" },
95
- React.createElement("div", { className: "w-24 h-24 bg-gradient-to-br from-green-400 to-green-600 rounded-full flex items-center justify-center animate-pulse" },
96
- React.createElement("svg", { className: "w-12 h-12 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
97
- React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }))),
98
- React.createElement("div", { className: "absolute -top-2 -right-2 w-8 h-8 bg-yellow-400 rounded-full flex items-center justify-center animate-bounce" },
99
- React.createElement("span", { className: "text-xl" }, "\uD83C\uDF89")))),
100
- React.createElement("div", { className: "space-y-2" },
101
- React.createElement("h2", { className: "text-2xl font-bold text-gray-900" }, "Wallet Created Successfully!"),
102
- React.createElement("p", { className: "text-gray-600" }, "Your wallet is ready to use")),
103
- React.createElement("div", { className: "bg-gray-50 rounded-xl p-4 space-y-2" },
104
- React.createElement("div", { className: "flex justify-between items-center" },
105
- React.createElement("span", { className: "text-sm text-gray-600" }, "Wallet Address:"),
106
- React.createElement("code", { className: "text-xs font-mono bg-white px-2 py-1 rounded" },
107
- user?.walletAddress?.slice(0, 6),
108
- "...",
109
- user?.walletAddress?.slice(-4))),
110
- user?.email && (React.createElement("div", { className: "flex justify-between items-center" },
111
- React.createElement("span", { className: "text-sm text-gray-600" }, "Email:"),
112
- React.createElement("span", { className: "text-sm font-medium" }, user.email)))),
113
- React.createElement("div", { className: "text-sm text-gray-500" }, "Redirecting to next step...")));
114
- case 'buy-usdc':
115
- return (React.createElement("div", { className: "space-y-6" },
116
- React.createElement("div", { className: "text-center space-y-2" },
117
- React.createElement("h2", { className: "text-2xl font-bold text-gray-900" }, "Add Funds to Your Wallet"),
118
- React.createElement("p", { className: "text-gray-600" }, "Buy USDC with your credit card to start using the platform")),
119
- React.createElement("div", { className: "bg-gradient-to-br from-blue-50 to-indigo-50 rounded-xl p-6 space-y-4" },
120
- React.createElement("div", { className: "flex items-center gap-3" },
121
- React.createElement("svg", { className: "w-8 h-8 text-blue-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
122
- React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" })),
123
- React.createElement("div", null,
124
- React.createElement("h3", { className: "font-semibold text-gray-900" }, "Payment Methods"),
125
- React.createElement("p", { className: "text-sm text-gray-600" }, "Credit card, Apple Pay, Google Pay")))),
126
- React.createElement("div", { className: "flex gap-3" },
127
- React.createElement("button", { onClick: handleComplete, className: "flex-1 border-2 border-gray-300 text-gray-700 font-medium py-3 px-6 rounded-xl hover:bg-gray-50 transition-all" }, "Skip for now"),
128
- React.createElement("button", { onClick: () => {
129
- // This will be replaced with actual Onramp widget
130
- console.log('Opening Onramp...');
131
- handleComplete();
132
- }, className: "flex-1 bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-700 hover:to-purple-700 text-white font-semibold py-3 px-6 rounded-xl transition-all shadow-lg hover:shadow-xl" }, "Buy USDC"))));
133
- case 'complete':
134
- return (React.createElement("div", { className: "text-center space-y-6" },
135
- React.createElement("div", { className: "flex justify-center" },
136
- React.createElement("div", { className: "w-24 h-24 bg-gradient-to-br from-purple-400 to-indigo-600 rounded-full flex items-center justify-center" },
137
- React.createElement("svg", { className: "w-12 h-12 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
138
- React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5" })))),
139
- React.createElement("div", { className: "space-y-2" },
140
- React.createElement("h2", { className: "text-2xl font-bold text-gray-900" }, "You're All Set!"),
141
- React.createElement("p", { className: "text-gray-600" },
142
- "Welcome to ",
143
- companyName,
144
- ". Let's get started!"))));
145
- default:
146
- return null;
147
- }
148
- };
149
- return (React.createElement("div", { className: "min-h-screen bg-gradient-to-br from-indigo-50 via-white to-purple-50 flex items-center justify-center p-4" },
150
- React.createElement("div", { className: "w-full max-w-md" },
151
- React.createElement("div", { className: "bg-white rounded-2xl shadow-2xl p-8" },
152
- React.createElement("div", { className: "mb-8" },
153
- React.createElement("div", { className: "flex justify-between mb-2" }, ['welcome', 'auth', 'wallet-created', ...(showBuyUSDC ? ['buy-usdc'] : []), 'complete'].map((step, index) => (React.createElement("div", { key: step, className: `h-2 flex-1 mx-1 rounded-full transition-all ${['welcome', 'auth', 'wallet-created', ...(showBuyUSDC ? ['buy-usdc'] : []), 'complete'].indexOf(currentStep) >= index
154
- ? 'bg-gradient-to-r from-indigo-600 to-purple-600'
155
- : 'bg-gray-200'}` }))))),
156
- renderStep()),
157
- React.createElement("p", { className: "text-center text-xs text-gray-500 mt-6" }, "Powered by Varity \u2022 Secure \u2022 Decentralized"))));
158
- }
159
- //# sourceMappingURL=OnboardingFlow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OnboardingFlow.js","sourceRoot":"","sources":["../../../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W;wBACxB,4BAAI,SAAS,EAAC,kCAAkC,sBAE3C;wBACL,2BAAG,SAAS,EAAC,eAAe;;4BACd,WAAW;mDACrB,CACA,CACF,CACP,CAAC;YAEJ;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,2GAA2G;QACxH,6BAAK,SAAS,EAAC,iBAAiB;YAC9B,6BAAK,SAAS,EAAC,qCAAqC;gBAElD,6BAAK,SAAS,EAAC,MAAM;oBACnB,6BAAK,SAAS,EAAC,2BAA2B,IACvC,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,UAAU,CAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACrH,6BACE,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,+CACT,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,UAAU,CAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,KAAK;4BAC5H,CAAC,CAAC,gDAAgD;4BAClD,CAAC,CAAC,aACN,EAAE,GACF,CACH,CAAC,CACE,CACF;gBAEL,UAAU,EAAE,CACT;YAEN,2BAAG,SAAS,EAAC,wCAAwC,2DAEjD,CACA,CACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,28 +0,0 @@
1
- /**
2
- * SocialLoginButtons - Social OAuth Authentication Buttons
3
- *
4
- * Provides one-click social login via Google, Apple, Facebook
5
- * Automatically creates custodial wallets for users
6
- *
7
- * @example
8
- * ```tsx
9
- * <SocialLoginButtons
10
- * providers={['google', 'apple', 'facebook']}
11
- * onSuccess={(user) => console.log('Logged in:', user)}
12
- * />
13
- * ```
14
- */
15
- import React from 'react';
16
- type SocialProvider = 'google' | 'apple' | 'facebook' | 'discord' | 'twitter';
17
- interface SocialLoginButtonsProps {
18
- providers?: SocialProvider[];
19
- onSuccess?: (provider: SocialProvider) => void;
20
- onError?: (error: Error) => void;
21
- layout?: 'horizontal' | 'vertical' | 'grid';
22
- showDivider?: boolean;
23
- dividerText?: string;
24
- size?: 'sm' | 'md' | 'lg';
25
- }
26
- export declare function SocialLoginButtons({ providers, onSuccess, onError, layout, showDivider, dividerText, size, }: SocialLoginButtonsProps): React.JSX.Element;
27
- export {};
28
- //# sourceMappingURL=SocialLoginButtons.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SocialLoginButtons.d.ts","sourceRoot":"","sources":["../../../src/components/InAppWallet/SocialLoginButtons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAE9E,UAAU,uBAAuB;IAC/B,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AA2ED,wBAAgB,kBAAkB,CAAC,EACjC,SAA2C,EAC3C,SAAS,EACT,OAAO,EACP,MAAmB,EACnB,WAAkB,EAClB,WAAgC,EAChC,IAAW,GACZ,EAAE,uBAAuB,qBAwGzB"}
@@ -1,128 +0,0 @@
1
- /**
2
- * SocialLoginButtons - Social OAuth Authentication Buttons
3
- *
4
- * Provides one-click social login via Google, Apple, Facebook
5
- * Automatically creates custodial wallets for users
6
- *
7
- * @example
8
- * ```tsx
9
- * <SocialLoginButtons
10
- * providers={['google', 'apple', 'facebook']}
11
- * onSuccess={(user) => console.log('Logged in:', user)}
12
- * />
13
- * ```
14
- */
15
- import React from 'react';
16
- import { useInAppWallet } from './InAppWalletProvider';
17
- import { getErrorMessage } from '@varity-labs/types';
18
- const providerConfig = {
19
- google: {
20
- name: 'Google',
21
- icon: (React.createElement("svg", { className: "w-5 h-5", viewBox: "0 0 24 24" },
22
- React.createElement("path", { fill: "currentColor", d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z" }),
23
- React.createElement("path", { fill: "currentColor", d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" }),
24
- React.createElement("path", { fill: "currentColor", d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" }),
25
- React.createElement("path", { fill: "currentColor", d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" }))),
26
- bgColor: 'bg-white hover:bg-gray-50',
27
- textColor: 'text-gray-700',
28
- borderColor: 'border-gray-300',
29
- },
30
- apple: {
31
- name: 'Apple',
32
- icon: (React.createElement("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 24 24" },
33
- React.createElement("path", { d: "M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z" }))),
34
- bgColor: 'bg-black hover:bg-gray-900',
35
- textColor: 'text-white',
36
- borderColor: 'border-black',
37
- },
38
- facebook: {
39
- name: 'Facebook',
40
- icon: (React.createElement("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 24 24" },
41
- React.createElement("path", { d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" }))),
42
- bgColor: 'bg-[#1877F2] hover:bg-[#166FE5]',
43
- textColor: 'text-white',
44
- borderColor: 'border-[#1877F2]',
45
- },
46
- discord: {
47
- name: 'Discord',
48
- icon: (React.createElement("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 24 24" },
49
- React.createElement("path", { d: "M20.317 4.492c-1.53-.69-3.17-1.2-4.885-1.49a.075.075 0 0 0-.079.036c-.21.369-.444.85-.608 1.23a18.566 18.566 0 0 0-5.487 0 12.36 12.36 0 0 0-.617-1.23A.077.077 0 0 0 8.562 3c-1.714.29-3.354.8-4.885 1.491a.07.07 0 0 0-.032.027C.533 9.093-.32 13.555.099 17.961a.08.08 0 0 0 .031.055 20.03 20.03 0 0 0 5.993 2.98.078.078 0 0 0 .084-.026 13.83 13.83 0 0 0 1.226-1.963.074.074 0 0 0-.041-.104 13.201 13.201 0 0 1-1.872-.878.075.075 0 0 1-.008-.125c.126-.093.252-.19.372-.287a.075.075 0 0 1 .078-.01c3.927 1.764 8.18 1.764 12.061 0a.075.075 0 0 1 .079.009c.12.098.245.195.372.288a.075.075 0 0 1-.006.125c-.598.344-1.22.635-1.873.877a.075.075 0 0 0-.041.105c.36.687.772 1.341 1.225 1.962a.077.077 0 0 0 .084.028 19.963 19.963 0 0 0 6.002-2.981.076.076 0 0 0 .032-.054c.5-5.094-.838-9.52-3.549-13.442a.06.06 0 0 0-.031-.028zM8.02 15.278c-1.182 0-2.157-1.069-2.157-2.38 0-1.312.956-2.38 2.157-2.38 1.21 0 2.176 1.077 2.157 2.38 0 1.312-.956 2.38-2.157 2.38zm7.975 0c-1.183 0-2.157-1.069-2.157-2.38 0-1.312.955-2.38 2.157-2.38 1.21 0 2.176 1.077 2.157 2.38 0 1.312-.946 2.38-2.157 2.38z" }))),
50
- bgColor: 'bg-[#5865F2] hover:bg-[#4752C4]',
51
- textColor: 'text-white',
52
- borderColor: 'border-[#5865F2]',
53
- },
54
- twitter: {
55
- name: 'Twitter',
56
- icon: (React.createElement("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 24 24" },
57
- React.createElement("path", { d: "M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z" }))),
58
- bgColor: 'bg-[#1DA1F2] hover:bg-[#1A8CD8]',
59
- textColor: 'text-white',
60
- borderColor: 'border-[#1DA1F2]',
61
- },
62
- };
63
- export function SocialLoginButtons({ providers = ['google', 'apple', 'facebook'], onSuccess, onError, layout = 'vertical', showDivider = true, dividerText = 'or continue with', size = 'md', }) {
64
- const { loginWithGoogle, loginWithApple, loginWithFacebook, isLoading } = useInAppWallet();
65
- const handleLogin = async (provider) => {
66
- try {
67
- switch (provider) {
68
- case 'google':
69
- await loginWithGoogle();
70
- break;
71
- case 'apple':
72
- await loginWithApple();
73
- break;
74
- case 'facebook':
75
- await loginWithFacebook();
76
- break;
77
- default:
78
- throw new Error(`Provider ${provider} not implemented`);
79
- }
80
- onSuccess?.(provider);
81
- }
82
- catch (error) {
83
- const errorMessage = getErrorMessage(error);
84
- console.error(`${provider} login error:`, errorMessage);
85
- const errorObj = error instanceof Error ? error : new Error(errorMessage);
86
- onError?.(errorObj);
87
- }
88
- };
89
- const sizeClasses = {
90
- sm: 'px-4 py-2 text-sm',
91
- md: 'px-6 py-3 text-base',
92
- lg: 'px-8 py-4 text-lg',
93
- };
94
- const layoutClasses = {
95
- horizontal: 'flex flex-row gap-3',
96
- vertical: 'flex flex-col gap-3',
97
- grid: 'grid grid-cols-2 gap-3',
98
- };
99
- return (React.createElement("div", { className: "w-full" },
100
- showDivider && (React.createElement("div", { className: "relative my-6" },
101
- React.createElement("div", { className: "absolute inset-0 flex items-center" },
102
- React.createElement("div", { className: "w-full border-t border-gray-300" })),
103
- React.createElement("div", { className: "relative flex justify-center text-sm" },
104
- React.createElement("span", { className: "bg-white px-4 text-gray-500" }, dividerText)))),
105
- React.createElement("div", { className: layoutClasses[layout] }, providers.map((provider) => {
106
- const config = providerConfig[provider];
107
- if (!config)
108
- return null;
109
- return (React.createElement("button", { key: provider, onClick: () => handleLogin(provider), disabled: isLoading, className: `
110
- ${config.bgColor}
111
- ${config.textColor}
112
- ${sizeClasses[size]}
113
- border ${config.borderColor}
114
- rounded-lg font-medium
115
- flex items-center justify-center gap-2
116
- transition-all duration-200
117
- disabled:opacity-50 disabled:cursor-not-allowed
118
- shadow-sm hover:shadow-md
119
- ` },
120
- isLoading ? (React.createElement("svg", { className: "animate-spin h-5 w-5", fill: "none", viewBox: "0 0 24 24" },
121
- React.createElement("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
122
- React.createElement("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" }))) : (config.icon),
123
- React.createElement("span", null,
124
- "Continue with ",
125
- config.name)));
126
- }))));
127
- }
128
- //# sourceMappingURL=SocialLoginButtons.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SocialLoginButtons.js","sourceRoot":"","sources":["../../../src/components/InAppWallet/SocialLoginButtons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAcrD,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,CACJ,6BAAK,SAAS,EAAC,SAAS,EAAC,OAAO,EAAC,WAAW;YAC1C,8BACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,yHAAyH,GAC3H;YACF,8BACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,uIAAuI,GACzI;YACF,8BACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,+HAA+H,GACjI;YACF,8BACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,qIAAqI,GACvI,CACE,CACP;QACD,OAAO,EAAE,2BAA2B;QACpC,SAAS,EAAE,eAAe;QAC1B,WAAW,EAAE,iBAAiB;KAC/B;IACD,KAAK,EAAE;QACL,IAAI,EAAE,O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- * In-App Wallet Components Export
3
- *
4
- * Thirdweb In-App Wallets for seamless Web2 user onboarding
5
- * - Email OTP authentication
6
- * - Social OAuth (Google, Apple, Facebook, Discord, Twitter)
7
- * - Automatic custodial wallet creation
8
- * - Complete onboarding flow
9
- */
10
- export { InAppWalletProvider, useInAppWallet } from './InAppWalletProvider';
11
- export { EmailLoginButton } from './EmailLoginButton';
12
- export { SocialLoginButtons } from './SocialLoginButtons';
13
- export { OnboardingFlow } from './OnboardingFlow';
14
- export type { InAppWalletContextType } from './InAppWalletProvider';
15
- //# sourceMappingURL=index.d.ts.map