@varity-labs/ui-kit 2.0.0-alpha.1

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 (495) hide show
  1. package/LICENSE +31 -0
  2. package/README.md +248 -0
  3. package/dist/components/AI/ChatbotWidget.d.ts +53 -0
  4. package/dist/components/AI/ChatbotWidget.d.ts.map +1 -0
  5. package/dist/components/AI/ChatbotWidget.js +126 -0
  6. package/dist/components/AI/ChatbotWidget.js.map +1 -0
  7. package/dist/components/AI/InputBar.d.ts +25 -0
  8. package/dist/components/AI/InputBar.d.ts.map +1 -0
  9. package/dist/components/AI/InputBar.js +126 -0
  10. package/dist/components/AI/InputBar.js.map +1 -0
  11. package/dist/components/AI/MessageBubble.d.ts +37 -0
  12. package/dist/components/AI/MessageBubble.d.ts.map +1 -0
  13. package/dist/components/AI/MessageBubble.js +124 -0
  14. package/dist/components/AI/MessageBubble.js.map +1 -0
  15. package/dist/components/AI/index.d.ts +12 -0
  16. package/dist/components/AI/index.d.ts.map +1 -0
  17. package/dist/components/AI/index.js +9 -0
  18. package/dist/components/AI/index.js.map +1 -0
  19. package/dist/components/Analytics/AnalyticsCard.d.ts +48 -0
  20. package/dist/components/Analytics/AnalyticsCard.d.ts.map +1 -0
  21. package/dist/components/Analytics/AnalyticsCard.js +156 -0
  22. package/dist/components/Analytics/AnalyticsCard.js.map +1 -0
  23. package/dist/components/Analytics/ChartContainer.d.ts +53 -0
  24. package/dist/components/Analytics/ChartContainer.d.ts.map +1 -0
  25. package/dist/components/Analytics/ChartContainer.js +128 -0
  26. package/dist/components/Analytics/ChartContainer.js.map +1 -0
  27. package/dist/components/Analytics/DataTable.d.ts +62 -0
  28. package/dist/components/Analytics/DataTable.d.ts.map +1 -0
  29. package/dist/components/Analytics/DataTable.js +165 -0
  30. package/dist/components/Analytics/DataTable.js.map +1 -0
  31. package/dist/components/Analytics/MetricDisplay.d.ts +42 -0
  32. package/dist/components/Analytics/MetricDisplay.d.ts.map +1 -0
  33. package/dist/components/Analytics/MetricDisplay.js +110 -0
  34. package/dist/components/Analytics/MetricDisplay.js.map +1 -0
  35. package/dist/components/Analytics/index.d.ts +14 -0
  36. package/dist/components/Analytics/index.d.ts.map +1 -0
  37. package/dist/components/Analytics/index.js +10 -0
  38. package/dist/components/Analytics/index.js.map +1 -0
  39. package/dist/components/Branding/Attribution.d.ts +39 -0
  40. package/dist/components/Branding/Attribution.d.ts.map +1 -0
  41. package/dist/components/Branding/Attribution.js +124 -0
  42. package/dist/components/Branding/Attribution.js.map +1 -0
  43. package/dist/components/Branding/Logo.d.ts +39 -0
  44. package/dist/components/Branding/Logo.d.ts.map +1 -0
  45. package/dist/components/Branding/Logo.js +67 -0
  46. package/dist/components/Branding/Logo.js.map +1 -0
  47. package/dist/components/Branding/ThemeProvider.d.ts +85 -0
  48. package/dist/components/Branding/ThemeProvider.d.ts.map +1 -0
  49. package/dist/components/Branding/ThemeProvider.js +186 -0
  50. package/dist/components/Branding/ThemeProvider.js.map +1 -0
  51. package/dist/components/Branding/index.d.ts +12 -0
  52. package/dist/components/Branding/index.d.ts.map +1 -0
  53. package/dist/components/Branding/index.js +9 -0
  54. package/dist/components/Branding/index.js.map +1 -0
  55. package/dist/components/Dashboard/DashboardFooter.d.ts +30 -0
  56. package/dist/components/Dashboard/DashboardFooter.d.ts.map +1 -0
  57. package/dist/components/Dashboard/DashboardFooter.js +68 -0
  58. package/dist/components/Dashboard/DashboardFooter.js.map +1 -0
  59. package/dist/components/Dashboard/DashboardHeader.d.ts +24 -0
  60. package/dist/components/Dashboard/DashboardHeader.d.ts.map +1 -0
  61. package/dist/components/Dashboard/DashboardHeader.js +87 -0
  62. package/dist/components/Dashboard/DashboardHeader.js.map +1 -0
  63. package/dist/components/Dashboard/DashboardLayout.d.ts +71 -0
  64. package/dist/components/Dashboard/DashboardLayout.d.ts.map +1 -0
  65. package/dist/components/Dashboard/DashboardLayout.js +52 -0
  66. package/dist/components/Dashboard/DashboardLayout.js.map +1 -0
  67. package/dist/components/Dashboard/DashboardSidebar.d.ts +26 -0
  68. package/dist/components/Dashboard/DashboardSidebar.d.ts.map +1 -0
  69. package/dist/components/Dashboard/DashboardSidebar.js +146 -0
  70. package/dist/components/Dashboard/DashboardSidebar.js.map +1 -0
  71. package/dist/components/Dashboard/EmptyState.d.ts +84 -0
  72. package/dist/components/Dashboard/EmptyState.d.ts.map +1 -0
  73. package/dist/components/Dashboard/EmptyState.js +99 -0
  74. package/dist/components/Dashboard/EmptyState.js.map +1 -0
  75. package/dist/components/Dashboard/KPICard.d.ts +58 -0
  76. package/dist/components/Dashboard/KPICard.d.ts.map +1 -0
  77. package/dist/components/Dashboard/KPICard.js +82 -0
  78. package/dist/components/Dashboard/KPICard.js.map +1 -0
  79. package/dist/components/Dashboard/LoadingSkeleton.d.ts +58 -0
  80. package/dist/components/Dashboard/LoadingSkeleton.d.ts.map +1 -0
  81. package/dist/components/Dashboard/LoadingSkeleton.js +105 -0
  82. package/dist/components/Dashboard/LoadingSkeleton.js.map +1 -0
  83. package/dist/components/Dashboard/StatusBadge.d.ts +57 -0
  84. package/dist/components/Dashboard/StatusBadge.d.ts.map +1 -0
  85. package/dist/components/Dashboard/StatusBadge.js +149 -0
  86. package/dist/components/Dashboard/StatusBadge.js.map +1 -0
  87. package/dist/components/Dashboard/index.d.ts +19 -0
  88. package/dist/components/Dashboard/index.d.ts.map +1 -0
  89. package/dist/components/Dashboard/index.js +18 -0
  90. package/dist/components/Dashboard/index.js.map +1 -0
  91. package/dist/components/InAppWallet/EmailLoginButton.d.ts +27 -0
  92. package/dist/components/InAppWallet/EmailLoginButton.d.ts.map +1 -0
  93. package/dist/components/InAppWallet/EmailLoginButton.js +84 -0
  94. package/dist/components/InAppWallet/EmailLoginButton.js.map +1 -0
  95. package/dist/components/InAppWallet/InAppWalletProvider.d.ts +54 -0
  96. package/dist/components/InAppWallet/InAppWalletProvider.d.ts.map +1 -0
  97. package/dist/components/InAppWallet/InAppWalletProvider.js +238 -0
  98. package/dist/components/InAppWallet/InAppWalletProvider.js.map +1 -0
  99. package/dist/components/InAppWallet/OnboardingFlow.d.ts +25 -0
  100. package/dist/components/InAppWallet/OnboardingFlow.d.ts.map +1 -0
  101. package/dist/components/InAppWallet/OnboardingFlow.js +159 -0
  102. package/dist/components/InAppWallet/OnboardingFlow.js.map +1 -0
  103. package/dist/components/InAppWallet/SocialLoginButtons.d.ts +28 -0
  104. package/dist/components/InAppWallet/SocialLoginButtons.d.ts.map +1 -0
  105. package/dist/components/InAppWallet/SocialLoginButtons.js +128 -0
  106. package/dist/components/InAppWallet/SocialLoginButtons.js.map +1 -0
  107. package/dist/components/InAppWallet/index.d.ts +15 -0
  108. package/dist/components/InAppWallet/index.d.ts.map +1 -0
  109. package/dist/components/InAppWallet/index.js +14 -0
  110. package/dist/components/InAppWallet/index.js.map +1 -0
  111. package/dist/components/Onramp/BuyUSDCButton.d.ts +27 -0
  112. package/dist/components/Onramp/BuyUSDCButton.d.ts.map +1 -0
  113. package/dist/components/Onramp/BuyUSDCButton.js +70 -0
  114. package/dist/components/Onramp/BuyUSDCButton.js.map +1 -0
  115. package/dist/components/Onramp/OnrampWidget.d.ts +38 -0
  116. package/dist/components/Onramp/OnrampWidget.d.ts.map +1 -0
  117. package/dist/components/Onramp/OnrampWidget.js +105 -0
  118. package/dist/components/Onramp/OnrampWidget.js.map +1 -0
  119. package/dist/components/Onramp/index.d.ts +14 -0
  120. package/dist/components/Onramp/index.d.ts.map +1 -0
  121. package/dist/components/Onramp/index.js +12 -0
  122. package/dist/components/Onramp/index.js.map +1 -0
  123. package/dist/components/Payments/CheckoutModal.d.ts +19 -0
  124. package/dist/components/Payments/CheckoutModal.d.ts.map +1 -0
  125. package/dist/components/Payments/CheckoutModal.js +183 -0
  126. package/dist/components/Payments/CheckoutModal.js.map +1 -0
  127. package/dist/components/Payments/SubscriptionWidget.d.ts +17 -0
  128. package/dist/components/Payments/SubscriptionWidget.d.ts.map +1 -0
  129. package/dist/components/Payments/SubscriptionWidget.js +89 -0
  130. package/dist/components/Payments/SubscriptionWidget.js.map +1 -0
  131. package/dist/components/Payments/constants.d.ts +59 -0
  132. package/dist/components/Payments/constants.d.ts.map +1 -0
  133. package/dist/components/Payments/constants.js +145 -0
  134. package/dist/components/Payments/constants.js.map +1 -0
  135. package/dist/components/Payments/index.d.ts +10 -0
  136. package/dist/components/Payments/index.d.ts.map +1 -0
  137. package/dist/components/Payments/index.js +12 -0
  138. package/dist/components/Payments/index.js.map +1 -0
  139. package/dist/components/Payments/types.d.ts +119 -0
  140. package/dist/components/Payments/types.d.ts.map +1 -0
  141. package/dist/components/Payments/types.js +27 -0
  142. package/dist/components/Payments/types.js.map +1 -0
  143. package/dist/components/Payments/usePayments.d.ts +33 -0
  144. package/dist/components/Payments/usePayments.d.ts.map +1 -0
  145. package/dist/components/Payments/usePayments.js +249 -0
  146. package/dist/components/Payments/usePayments.js.map +1 -0
  147. package/dist/components/Privy/InitTimeoutScreen.d.ts +62 -0
  148. package/dist/components/Privy/InitTimeoutScreen.d.ts.map +1 -0
  149. package/dist/components/Privy/InitTimeoutScreen.js +64 -0
  150. package/dist/components/Privy/InitTimeoutScreen.js.map +1 -0
  151. package/dist/components/Privy/InitializingScreen.d.ts +56 -0
  152. package/dist/components/Privy/InitializingScreen.d.ts.map +1 -0
  153. package/dist/components/Privy/InitializingScreen.js +60 -0
  154. package/dist/components/Privy/InitializingScreen.js.map +1 -0
  155. package/dist/components/Privy/PrivyLoginButton.d.ts +27 -0
  156. package/dist/components/Privy/PrivyLoginButton.d.ts.map +1 -0
  157. package/dist/components/Privy/PrivyLoginButton.js +48 -0
  158. package/dist/components/Privy/PrivyLoginButton.js.map +1 -0
  159. package/dist/components/Privy/PrivyProtectedRoute.d.ts +22 -0
  160. package/dist/components/Privy/PrivyProtectedRoute.d.ts.map +1 -0
  161. package/dist/components/Privy/PrivyProtectedRoute.js +46 -0
  162. package/dist/components/Privy/PrivyProtectedRoute.js.map +1 -0
  163. package/dist/components/Privy/PrivyReadyGate.d.ts +69 -0
  164. package/dist/components/Privy/PrivyReadyGate.d.ts.map +1 -0
  165. package/dist/components/Privy/PrivyReadyGate.js +83 -0
  166. package/dist/components/Privy/PrivyReadyGate.js.map +1 -0
  167. package/dist/components/Privy/PrivyUserProfile.d.ts +25 -0
  168. package/dist/components/Privy/PrivyUserProfile.d.ts.map +1 -0
  169. package/dist/components/Privy/PrivyUserProfile.js +98 -0
  170. package/dist/components/Privy/PrivyUserProfile.js.map +1 -0
  171. package/dist/components/Privy/index.d.ts +21 -0
  172. package/dist/components/Privy/index.d.ts.map +1 -0
  173. package/dist/components/Privy/index.js +16 -0
  174. package/dist/components/Privy/index.js.map +1 -0
  175. package/dist/components/SIWE/AuthStatus.d.ts +15 -0
  176. package/dist/components/SIWE/AuthStatus.d.ts.map +1 -0
  177. package/dist/components/SIWE/AuthStatus.js +47 -0
  178. package/dist/components/SIWE/AuthStatus.js.map +1 -0
  179. package/dist/components/SIWE/ProtectedRoute.d.ts +17 -0
  180. package/dist/components/SIWE/ProtectedRoute.d.ts.map +1 -0
  181. package/dist/components/SIWE/ProtectedRoute.js +52 -0
  182. package/dist/components/SIWE/ProtectedRoute.js.map +1 -0
  183. package/dist/components/SIWE/SIWEButton.d.ts +22 -0
  184. package/dist/components/SIWE/SIWEButton.d.ts.map +1 -0
  185. package/dist/components/SIWE/SIWEButton.js +106 -0
  186. package/dist/components/SIWE/SIWEButton.js.map +1 -0
  187. package/dist/components/SIWE/SIWEModal.d.ts +19 -0
  188. package/dist/components/SIWE/SIWEModal.d.ts.map +1 -0
  189. package/dist/components/SIWE/SIWEModal.js +75 -0
  190. package/dist/components/SIWE/SIWEModal.js.map +1 -0
  191. package/dist/components/SIWE/SIWEProvider.d.ts +38 -0
  192. package/dist/components/SIWE/SIWEProvider.d.ts.map +1 -0
  193. package/dist/components/SIWE/SIWEProvider.js +227 -0
  194. package/dist/components/SIWE/SIWEProvider.js.map +1 -0
  195. package/dist/components/SIWE/index.d.ts +15 -0
  196. package/dist/components/SIWE/index.d.ts.map +1 -0
  197. package/dist/components/SIWE/index.js +10 -0
  198. package/dist/components/SIWE/index.js.map +1 -0
  199. package/dist/components/index.d.ts +11 -0
  200. package/dist/components/index.d.ts.map +1 -0
  201. package/dist/components/index.js +16 -0
  202. package/dist/components/index.js.map +1 -0
  203. package/dist/components/templates/Finance/FinanceDashboard.d.ts +15 -0
  204. package/dist/components/templates/Finance/FinanceDashboard.d.ts.map +1 -0
  205. package/dist/components/templates/Finance/FinanceDashboard.js +112 -0
  206. package/dist/components/templates/Finance/FinanceDashboard.js.map +1 -0
  207. package/dist/components/templates/Healthcare/HealthcareDashboard.d.ts +15 -0
  208. package/dist/components/templates/Healthcare/HealthcareDashboard.d.ts.map +1 -0
  209. package/dist/components/templates/Healthcare/HealthcareDashboard.js +121 -0
  210. package/dist/components/templates/Healthcare/HealthcareDashboard.js.map +1 -0
  211. package/dist/components/templates/ISO/ISODashboard.d.ts +15 -0
  212. package/dist/components/templates/ISO/ISODashboard.d.ts.map +1 -0
  213. package/dist/components/templates/ISO/ISODashboard.js +184 -0
  214. package/dist/components/templates/ISO/ISODashboard.js.map +1 -0
  215. package/dist/components/templates/Retail/RetailDashboard.d.ts +15 -0
  216. package/dist/components/templates/Retail/RetailDashboard.d.ts.map +1 -0
  217. package/dist/components/templates/Retail/RetailDashboard.js +151 -0
  218. package/dist/components/templates/Retail/RetailDashboard.js.map +1 -0
  219. package/dist/components/templates/index.d.ts +14 -0
  220. package/dist/components/templates/index.d.ts.map +1 -0
  221. package/dist/components/templates/index.js +14 -0
  222. package/dist/components/templates/index.js.map +1 -0
  223. package/dist/config/chains.d.ts +23 -0
  224. package/dist/config/chains.d.ts.map +1 -0
  225. package/dist/config/chains.js +55 -0
  226. package/dist/config/chains.js.map +1 -0
  227. package/dist/core/VarityClient.d.ts +76 -0
  228. package/dist/core/VarityClient.d.ts.map +1 -0
  229. package/dist/core/VarityClient.js +99 -0
  230. package/dist/core/VarityClient.js.map +1 -0
  231. package/dist/core/config.d.ts +136 -0
  232. package/dist/core/config.d.ts.map +1 -0
  233. package/dist/core/config.js +156 -0
  234. package/dist/core/config.js.map +1 -0
  235. package/dist/hooks/index.d.ts +17 -0
  236. package/dist/hooks/index.d.ts.map +1 -0
  237. package/dist/hooks/index.js +18 -0
  238. package/dist/hooks/index.js.map +1 -0
  239. package/dist/hooks/useAnalytics.d.ts +94 -0
  240. package/dist/hooks/useAnalytics.d.ts.map +1 -0
  241. package/dist/hooks/useAnalytics.js +116 -0
  242. package/dist/hooks/useAnalytics.js.map +1 -0
  243. package/dist/hooks/useAuth.d.ts +71 -0
  244. package/dist/hooks/useAuth.d.ts.map +1 -0
  245. package/dist/hooks/useAuth.js +198 -0
  246. package/dist/hooks/useAuth.js.map +1 -0
  247. package/dist/hooks/useDashboard.d.ts +110 -0
  248. package/dist/hooks/useDashboard.d.ts.map +1 -0
  249. package/dist/hooks/useDashboard.js +201 -0
  250. package/dist/hooks/useDashboard.js.map +1 -0
  251. package/dist/hooks/useVarityAPI.d.ts +88 -0
  252. package/dist/hooks/useVarityAPI.d.ts.map +1 -0
  253. package/dist/hooks/useVarityAPI.js +138 -0
  254. package/dist/hooks/useVarityAPI.js.map +1 -0
  255. package/dist/hooks/useWalletAuth.d.ts +108 -0
  256. package/dist/hooks/useWalletAuth.d.ts.map +1 -0
  257. package/dist/hooks/useWalletAuth.js +415 -0
  258. package/dist/hooks/useWalletAuth.js.map +1 -0
  259. package/dist/hooks/web3/index.d.ts +5 -0
  260. package/dist/hooks/web3/index.d.ts.map +1 -0
  261. package/dist/hooks/web3/index.js +6 -0
  262. package/dist/hooks/web3/index.js.map +1 -0
  263. package/dist/hooks/web3/useAddressValidation.d.ts +37 -0
  264. package/dist/hooks/web3/useAddressValidation.d.ts.map +1 -0
  265. package/dist/hooks/web3/useAddressValidation.js +59 -0
  266. package/dist/hooks/web3/useAddressValidation.js.map +1 -0
  267. package/dist/hooks/web3/useBlockExplorer.d.ts +37 -0
  268. package/dist/hooks/web3/useBlockExplorer.d.ts.map +1 -0
  269. package/dist/hooks/web3/useBlockExplorer.js +59 -0
  270. package/dist/hooks/web3/useBlockExplorer.js.map +1 -0
  271. package/dist/hooks/web3/useUSDCFormat.d.ts +34 -0
  272. package/dist/hooks/web3/useUSDCFormat.d.ts.map +1 -0
  273. package/dist/hooks/web3/useUSDCFormat.js +43 -0
  274. package/dist/hooks/web3/useUSDCFormat.js.map +1 -0
  275. package/dist/hooks/web3/useVarityWallet.d.ts +48 -0
  276. package/dist/hooks/web3/useVarityWallet.d.ts.map +1 -0
  277. package/dist/hooks/web3/useVarityWallet.js +70 -0
  278. package/dist/hooks/web3/useVarityWallet.js.map +1 -0
  279. package/dist/index.d.ts +55 -0
  280. package/dist/index.d.ts.map +1 -0
  281. package/dist/index.js +68 -0
  282. package/dist/index.js.map +1 -0
  283. package/dist/modules/analytics/AnalyticsClient.d.ts +72 -0
  284. package/dist/modules/analytics/AnalyticsClient.d.ts.map +1 -0
  285. package/dist/modules/analytics/AnalyticsClient.js +56 -0
  286. package/dist/modules/analytics/AnalyticsClient.js.map +1 -0
  287. package/dist/modules/analytics/index.d.ts +2 -0
  288. package/dist/modules/analytics/index.d.ts.map +1 -0
  289. package/dist/modules/analytics/index.js +2 -0
  290. package/dist/modules/analytics/index.js.map +1 -0
  291. package/dist/modules/auth/AuthClient.d.ts +41 -0
  292. package/dist/modules/auth/AuthClient.d.ts.map +1 -0
  293. package/dist/modules/auth/AuthClient.js +36 -0
  294. package/dist/modules/auth/AuthClient.js.map +1 -0
  295. package/dist/modules/auth/index.d.ts +2 -0
  296. package/dist/modules/auth/index.d.ts.map +1 -0
  297. package/dist/modules/auth/index.js +2 -0
  298. package/dist/modules/auth/index.js.map +1 -0
  299. package/dist/modules/cache/CacheClient.d.ts +48 -0
  300. package/dist/modules/cache/CacheClient.d.ts.map +1 -0
  301. package/dist/modules/cache/CacheClient.js +59 -0
  302. package/dist/modules/cache/CacheClient.js.map +1 -0
  303. package/dist/modules/cache/index.d.ts +2 -0
  304. package/dist/modules/cache/index.d.ts.map +1 -0
  305. package/dist/modules/cache/index.js +2 -0
  306. package/dist/modules/cache/index.js.map +1 -0
  307. package/dist/modules/compute/ComputeClient.d.ts +54 -0
  308. package/dist/modules/compute/ComputeClient.d.ts.map +1 -0
  309. package/dist/modules/compute/ComputeClient.js +39 -0
  310. package/dist/modules/compute/ComputeClient.js.map +1 -0
  311. package/dist/modules/compute/index.d.ts +2 -0
  312. package/dist/modules/compute/index.d.ts.map +1 -0
  313. package/dist/modules/compute/index.js +2 -0
  314. package/dist/modules/compute/index.js.map +1 -0
  315. package/dist/modules/export/ExportClient.d.ts +56 -0
  316. package/dist/modules/export/ExportClient.d.ts.map +1 -0
  317. package/dist/modules/export/ExportClient.js +42 -0
  318. package/dist/modules/export/ExportClient.js.map +1 -0
  319. package/dist/modules/export/index.d.ts +2 -0
  320. package/dist/modules/export/index.d.ts.map +1 -0
  321. package/dist/modules/export/index.js +2 -0
  322. package/dist/modules/export/index.js.map +1 -0
  323. package/dist/modules/forecasting/ForecastingClient.d.ts +112 -0
  324. package/dist/modules/forecasting/ForecastingClient.d.ts.map +1 -0
  325. package/dist/modules/forecasting/ForecastingClient.js +48 -0
  326. package/dist/modules/forecasting/ForecastingClient.js.map +1 -0
  327. package/dist/modules/forecasting/index.d.ts +2 -0
  328. package/dist/modules/forecasting/index.d.ts.map +1 -0
  329. package/dist/modules/forecasting/index.js +2 -0
  330. package/dist/modules/forecasting/index.js.map +1 -0
  331. package/dist/modules/monitoring/MonitoringClient.d.ts +67 -0
  332. package/dist/modules/monitoring/MonitoringClient.d.ts.map +1 -0
  333. package/dist/modules/monitoring/MonitoringClient.js +48 -0
  334. package/dist/modules/monitoring/MonitoringClient.js.map +1 -0
  335. package/dist/modules/monitoring/index.d.ts +2 -0
  336. package/dist/modules/monitoring/index.d.ts.map +1 -0
  337. package/dist/modules/monitoring/index.js +2 -0
  338. package/dist/modules/monitoring/index.js.map +1 -0
  339. package/dist/modules/notifications/NotificationsClient.d.ts +68 -0
  340. package/dist/modules/notifications/NotificationsClient.d.ts.map +1 -0
  341. package/dist/modules/notifications/NotificationsClient.js +50 -0
  342. package/dist/modules/notifications/NotificationsClient.js.map +1 -0
  343. package/dist/modules/notifications/index.d.ts +2 -0
  344. package/dist/modules/notifications/index.d.ts.map +1 -0
  345. package/dist/modules/notifications/index.js +2 -0
  346. package/dist/modules/notifications/index.js.map +1 -0
  347. package/dist/modules/oracle/OracleClient.d.ts +48 -0
  348. package/dist/modules/oracle/OracleClient.d.ts.map +1 -0
  349. package/dist/modules/oracle/OracleClient.js +34 -0
  350. package/dist/modules/oracle/OracleClient.js.map +1 -0
  351. package/dist/modules/oracle/index.d.ts +2 -0
  352. package/dist/modules/oracle/index.d.ts.map +1 -0
  353. package/dist/modules/oracle/index.js +2 -0
  354. package/dist/modules/oracle/index.js.map +1 -0
  355. package/dist/modules/storage/StorageClient.d.ts +44 -0
  356. package/dist/modules/storage/StorageClient.d.ts.map +1 -0
  357. package/dist/modules/storage/StorageClient.js +43 -0
  358. package/dist/modules/storage/StorageClient.js.map +1 -0
  359. package/dist/modules/storage/index.d.ts +2 -0
  360. package/dist/modules/storage/index.d.ts.map +1 -0
  361. package/dist/modules/storage/index.js +2 -0
  362. package/dist/modules/storage/index.js.map +1 -0
  363. package/dist/modules/templates/TemplateDeploymentClient.d.ts +208 -0
  364. package/dist/modules/templates/TemplateDeploymentClient.d.ts.map +1 -0
  365. package/dist/modules/templates/TemplateDeploymentClient.js +101 -0
  366. package/dist/modules/templates/TemplateDeploymentClient.js.map +1 -0
  367. package/dist/modules/templates/index.d.ts +8 -0
  368. package/dist/modules/templates/index.d.ts.map +1 -0
  369. package/dist/modules/templates/index.js +7 -0
  370. package/dist/modules/templates/index.js.map +1 -0
  371. package/dist/modules/webhooks/WebhooksClient.d.ts +85 -0
  372. package/dist/modules/webhooks/WebhooksClient.d.ts.map +1 -0
  373. package/dist/modules/webhooks/WebhooksClient.js +68 -0
  374. package/dist/modules/webhooks/WebhooksClient.js.map +1 -0
  375. package/dist/modules/webhooks/index.d.ts +2 -0
  376. package/dist/modules/webhooks/index.d.ts.map +1 -0
  377. package/dist/modules/webhooks/index.js +2 -0
  378. package/dist/modules/webhooks/index.js.map +1 -0
  379. package/dist/modules/zk/ZKClient.d.ts +67 -0
  380. package/dist/modules/zk/ZKClient.d.ts.map +1 -0
  381. package/dist/modules/zk/ZKClient.js +36 -0
  382. package/dist/modules/zk/ZKClient.js.map +1 -0
  383. package/dist/modules/zk/index.d.ts +2 -0
  384. package/dist/modules/zk/index.d.ts.map +1 -0
  385. package/dist/modules/zk/index.js +2 -0
  386. package/dist/modules/zk/index.js.map +1 -0
  387. package/dist/providers/ChainContext.d.ts +65 -0
  388. package/dist/providers/ChainContext.d.ts.map +1 -0
  389. package/dist/providers/ChainContext.js +92 -0
  390. package/dist/providers/ChainContext.js.map +1 -0
  391. package/dist/providers/PrivyProvider.d.ts +42 -0
  392. package/dist/providers/PrivyProvider.d.ts.map +1 -0
  393. package/dist/providers/PrivyProvider.js +131 -0
  394. package/dist/providers/PrivyProvider.js.map +1 -0
  395. package/dist/providers/PrivyStack.d.ts +165 -0
  396. package/dist/providers/PrivyStack.d.ts.map +1 -0
  397. package/dist/providers/PrivyStack.js +295 -0
  398. package/dist/providers/PrivyStack.js.map +1 -0
  399. package/dist/providers/VarityDashboardProvider.d.ts +90 -0
  400. package/dist/providers/VarityDashboardProvider.d.ts.map +1 -0
  401. package/dist/providers/VarityDashboardProvider.js +242 -0
  402. package/dist/providers/VarityDashboardProvider.js.map +1 -0
  403. package/dist/providers/VarityProvider.d.ts +32 -0
  404. package/dist/providers/VarityProvider.d.ts.map +1 -0
  405. package/dist/providers/VarityProvider.js +56 -0
  406. package/dist/providers/VarityProvider.js.map +1 -0
  407. package/dist/providers/WalletContext.d.ts +68 -0
  408. package/dist/providers/WalletContext.d.ts.map +1 -0
  409. package/dist/providers/WalletContext.js +98 -0
  410. package/dist/providers/WalletContext.js.map +1 -0
  411. package/dist/providers/WalletSyncProvider.d.ts +84 -0
  412. package/dist/providers/WalletSyncProvider.d.ts.map +1 -0
  413. package/dist/providers/WalletSyncProvider.js +132 -0
  414. package/dist/providers/WalletSyncProvider.js.map +1 -0
  415. package/dist/providers/index.d.ts +47 -0
  416. package/dist/providers/index.d.ts.map +1 -0
  417. package/dist/providers/index.js +51 -0
  418. package/dist/providers/index.js.map +1 -0
  419. package/dist/tests/mocks/httpClient.mock.d.ts +62 -0
  420. package/dist/tests/mocks/httpClient.mock.d.ts.map +1 -0
  421. package/dist/tests/mocks/httpClient.mock.js +108 -0
  422. package/dist/tests/mocks/httpClient.mock.js.map +1 -0
  423. package/dist/tests/setup.d.ts +6 -0
  424. package/dist/tests/setup.d.ts.map +1 -0
  425. package/dist/tests/setup.js +51 -0
  426. package/dist/tests/setup.js.map +1 -0
  427. package/dist/types/api-extensions.d.ts +92 -0
  428. package/dist/types/api-extensions.d.ts.map +1 -0
  429. package/dist/types/api-extensions.js +7 -0
  430. package/dist/types/api-extensions.js.map +1 -0
  431. package/dist/utils/http.d.ts +51 -0
  432. package/dist/utils/http.d.ts.map +1 -0
  433. package/dist/utils/http.js +104 -0
  434. package/dist/utils/http.js.map +1 -0
  435. package/dist/wallets/SimpleSmartWallet.d.ts +68 -0
  436. package/dist/wallets/SimpleSmartWallet.d.ts.map +1 -0
  437. package/dist/wallets/SimpleSmartWallet.js +74 -0
  438. package/dist/wallets/SimpleSmartWallet.js.map +1 -0
  439. package/dist/wallets/SmartWalletProvider.d.ts +217 -0
  440. package/dist/wallets/SmartWalletProvider.d.ts.map +1 -0
  441. package/dist/wallets/SmartWalletProvider.js +366 -0
  442. package/dist/wallets/SmartWalletProvider.js.map +1 -0
  443. package/dist/wallets/config.d.ts +199 -0
  444. package/dist/wallets/config.d.ts.map +1 -0
  445. package/dist/wallets/config.js +183 -0
  446. package/dist/wallets/config.js.map +1 -0
  447. package/dist/wallets/index.d.ts +9 -0
  448. package/dist/wallets/index.d.ts.map +1 -0
  449. package/dist/wallets/index.js +9 -0
  450. package/dist/wallets/index.js.map +1 -0
  451. package/dist/web3/AddressDisplay/AddressDisplay.d.ts +33 -0
  452. package/dist/web3/AddressDisplay/AddressDisplay.d.ts.map +1 -0
  453. package/dist/web3/AddressDisplay/AddressDisplay.js +42 -0
  454. package/dist/web3/AddressDisplay/AddressDisplay.js.map +1 -0
  455. package/dist/web3/AddressInput/AddressInput.d.ts +36 -0
  456. package/dist/web3/AddressInput/AddressInput.d.ts.map +1 -0
  457. package/dist/web3/AddressInput/AddressInput.js +54 -0
  458. package/dist/web3/AddressInput/AddressInput.js.map +1 -0
  459. package/dist/web3/AmountInput/AmountInput.d.ts +41 -0
  460. package/dist/web3/AmountInput/AmountInput.d.ts.map +1 -0
  461. package/dist/web3/AmountInput/AmountInput.js +74 -0
  462. package/dist/web3/AmountInput/AmountInput.js.map +1 -0
  463. package/dist/web3/BalanceDisplay/BalanceDisplay.d.ts +30 -0
  464. package/dist/web3/BalanceDisplay/BalanceDisplay.d.ts.map +1 -0
  465. package/dist/web3/BalanceDisplay/BalanceDisplay.js +35 -0
  466. package/dist/web3/BalanceDisplay/BalanceDisplay.js.map +1 -0
  467. package/dist/web3/BlockExplorerLink/BlockExplorerLink.d.ts +41 -0
  468. package/dist/web3/BlockExplorerLink/BlockExplorerLink.d.ts.map +1 -0
  469. package/dist/web3/BlockExplorerLink/BlockExplorerLink.js +46 -0
  470. package/dist/web3/BlockExplorerLink/BlockExplorerLink.js.map +1 -0
  471. package/dist/web3/ConnectWallet/ConnectWallet.d.ts +35 -0
  472. package/dist/web3/ConnectWallet/ConnectWallet.d.ts.map +1 -0
  473. package/dist/web3/ConnectWallet/ConnectWallet.js +58 -0
  474. package/dist/web3/ConnectWallet/ConnectWallet.js.map +1 -0
  475. package/dist/web3/DisconnectButton/DisconnectButton.d.ts +30 -0
  476. package/dist/web3/DisconnectButton/DisconnectButton.d.ts.map +1 -0
  477. package/dist/web3/DisconnectButton/DisconnectButton.js +48 -0
  478. package/dist/web3/DisconnectButton/DisconnectButton.js.map +1 -0
  479. package/dist/web3/WalletBalance/WalletBalance.d.ts +27 -0
  480. package/dist/web3/WalletBalance/WalletBalance.d.ts.map +1 -0
  481. package/dist/web3/WalletBalance/WalletBalance.js +49 -0
  482. package/dist/web3/WalletBalance/WalletBalance.js.map +1 -0
  483. package/dist/web3/WalletDropdown/WalletDropdown.d.ts +29 -0
  484. package/dist/web3/WalletDropdown/WalletDropdown.d.ts.map +1 -0
  485. package/dist/web3/WalletDropdown/WalletDropdown.js +93 -0
  486. package/dist/web3/WalletDropdown/WalletDropdown.js.map +1 -0
  487. package/dist/web3/WalletInfo/WalletInfo.d.ts +31 -0
  488. package/dist/web3/WalletInfo/WalletInfo.d.ts.map +1 -0
  489. package/dist/web3/WalletInfo/WalletInfo.js +41 -0
  490. package/dist/web3/WalletInfo/WalletInfo.js.map +1 -0
  491. package/dist/web3/index.d.ts +11 -0
  492. package/dist/web3/index.d.ts.map +1 -0
  493. package/dist/web3/index.js +14 -0
  494. package/dist/web3/index.js.map +1 -0
  495. package/package.json +105 -0
@@ -0,0 +1,249 @@
1
+ import { useState, useEffect, useCallback } from 'react';
2
+ import axios from 'axios';
3
+ import { useSIWE } from '../SIWE/SIWEProvider';
4
+ import { PAYMENT_ENDPOINTS } from './constants';
5
+ export const usePayments = ({ apiUrl }) => {
6
+ const { isAuthenticated, accessToken, user } = useSIWE();
7
+ // State
8
+ const [subscription, setSubscription] = useState(null);
9
+ const [isLoadingSubscription, setIsLoadingSubscription] = useState(false);
10
+ const [subscriptionError, setSubscriptionError] = useState(null);
11
+ const [payments, setPayments] = useState([]);
12
+ const [isLoadingPayments, setIsLoadingPayments] = useState(false);
13
+ const [paymentsError, setPaymentsError] = useState(null);
14
+ const [invoices, setInvoices] = useState([]);
15
+ const [isLoadingInvoices, setIsLoadingInvoices] = useState(false);
16
+ const [invoicesError, setInvoicesError] = useState(null);
17
+ const [usage, setUsage] = useState(null);
18
+ const [isLoadingUsage, setIsLoadingUsage] = useState(false);
19
+ const [usageError, setUsageError] = useState(null);
20
+ // API client
21
+ const apiClient = axios.create({
22
+ baseURL: apiUrl,
23
+ headers: accessToken ? { Authorization: `Bearer ${accessToken}` } : {},
24
+ });
25
+ /**
26
+ * Fetch current subscription
27
+ */
28
+ const fetchSubscription = useCallback(async () => {
29
+ if (!isAuthenticated || !user)
30
+ return;
31
+ try {
32
+ setIsLoadingSubscription(true);
33
+ setSubscriptionError(null);
34
+ const response = await apiClient.get(PAYMENT_ENDPOINTS.GET_SUBSCRIPTION);
35
+ setSubscription(response.data.data);
36
+ }
37
+ catch (error) {
38
+ const axiosError = error;
39
+ const errorMessage = axiosError.response?.data?.message || 'Failed to fetch subscription';
40
+ setSubscriptionError(errorMessage);
41
+ console.error('Fetch subscription error:', error);
42
+ }
43
+ finally {
44
+ setIsLoadingSubscription(false);
45
+ }
46
+ }, [isAuthenticated, user, apiClient]);
47
+ /**
48
+ * Fetch payment history
49
+ */
50
+ const fetchPayments = useCallback(async () => {
51
+ if (!isAuthenticated || !user)
52
+ return;
53
+ try {
54
+ setIsLoadingPayments(true);
55
+ setPaymentsError(null);
56
+ const response = await apiClient.get('/api/v1/payments/history');
57
+ setPayments(response.data.data);
58
+ }
59
+ catch (error) {
60
+ const axiosError = error;
61
+ const errorMessage = axiosError.response?.data?.message || 'Failed to fetch payments';
62
+ setPaymentsError(errorMessage);
63
+ console.error('Fetch payments error:', error);
64
+ }
65
+ finally {
66
+ setIsLoadingPayments(false);
67
+ }
68
+ }, [isAuthenticated, user, apiClient]);
69
+ /**
70
+ * Fetch invoices
71
+ */
72
+ const fetchInvoices = useCallback(async () => {
73
+ if (!isAuthenticated || !user)
74
+ return;
75
+ try {
76
+ setIsLoadingInvoices(true);
77
+ setInvoicesError(null);
78
+ const response = await apiClient.get(PAYMENT_ENDPOINTS.GET_INVOICES);
79
+ setInvoices(response.data.data);
80
+ }
81
+ catch (error) {
82
+ const axiosError = error;
83
+ const errorMessage = axiosError.response?.data?.message || 'Failed to fetch invoices';
84
+ setInvoicesError(errorMessage);
85
+ console.error('Fetch invoices error:', error);
86
+ }
87
+ finally {
88
+ setIsLoadingInvoices(false);
89
+ }
90
+ }, [isAuthenticated, user, apiClient]);
91
+ /**
92
+ * Fetch usage metrics
93
+ */
94
+ const fetchUsage = useCallback(async () => {
95
+ if (!isAuthenticated || !user)
96
+ return;
97
+ try {
98
+ setIsLoadingUsage(true);
99
+ setUsageError(null);
100
+ const response = await apiClient.get(PAYMENT_ENDPOINTS.GET_USAGE);
101
+ setUsage(response.data.data);
102
+ }
103
+ catch (error) {
104
+ const axiosError = error;
105
+ const errorMessage = axiosError.response?.data?.message || 'Failed to fetch usage';
106
+ setUsageError(errorMessage);
107
+ console.error('Fetch usage error:', error);
108
+ }
109
+ finally {
110
+ setIsLoadingUsage(false);
111
+ }
112
+ }, [isAuthenticated, user, apiClient]);
113
+ /**
114
+ * Cancel subscription
115
+ */
116
+ const cancelSubscription = useCallback(async () => {
117
+ if (!isAuthenticated || !subscription)
118
+ return;
119
+ try {
120
+ setIsLoadingSubscription(true);
121
+ setSubscriptionError(null);
122
+ await apiClient.post(PAYMENT_ENDPOINTS.CANCEL_SUBSCRIPTION);
123
+ // Refresh subscription data
124
+ await fetchSubscription();
125
+ }
126
+ catch (error) {
127
+ const axiosError = error;
128
+ const errorMessage = axiosError.response?.data?.message || 'Failed to cancel subscription';
129
+ setSubscriptionError(errorMessage);
130
+ console.error('Cancel subscription error:', error);
131
+ throw error;
132
+ }
133
+ finally {
134
+ setIsLoadingSubscription(false);
135
+ }
136
+ }, [isAuthenticated, subscription, apiClient, fetchSubscription]);
137
+ /**
138
+ * Resume subscription
139
+ */
140
+ const resumeSubscription = useCallback(async () => {
141
+ if (!isAuthenticated || !subscription)
142
+ return;
143
+ try {
144
+ setIsLoadingSubscription(true);
145
+ setSubscriptionError(null);
146
+ await apiClient.post(PAYMENT_ENDPOINTS.RESUME_SUBSCRIPTION);
147
+ // Refresh subscription data
148
+ await fetchSubscription();
149
+ }
150
+ catch (error) {
151
+ const axiosError = error;
152
+ const errorMessage = axiosError.response?.data?.message || 'Failed to resume subscription';
153
+ setSubscriptionError(errorMessage);
154
+ console.error('Resume subscription error:', error);
155
+ throw error;
156
+ }
157
+ finally {
158
+ setIsLoadingSubscription(false);
159
+ }
160
+ }, [isAuthenticated, subscription, apiClient, fetchSubscription]);
161
+ /**
162
+ * Upgrade subscription
163
+ */
164
+ const upgradeSubscription = useCallback(async (newTier) => {
165
+ if (!isAuthenticated || !subscription)
166
+ return;
167
+ try {
168
+ setIsLoadingSubscription(true);
169
+ setSubscriptionError(null);
170
+ await apiClient.post(PAYMENT_ENDPOINTS.UPGRADE_SUBSCRIPTION, {
171
+ newTier,
172
+ });
173
+ // Refresh subscription data
174
+ await fetchSubscription();
175
+ }
176
+ catch (error) {
177
+ const axiosError = error;
178
+ const errorMessage = axiosError.response?.data?.message || 'Failed to upgrade subscription';
179
+ setSubscriptionError(errorMessage);
180
+ console.error('Upgrade subscription error:', error);
181
+ throw error;
182
+ }
183
+ finally {
184
+ setIsLoadingSubscription(false);
185
+ }
186
+ }, [isAuthenticated, subscription, apiClient, fetchSubscription]);
187
+ /**
188
+ * Downgrade subscription
189
+ */
190
+ const downgradeSubscription = useCallback(async (newTier) => {
191
+ if (!isAuthenticated || !subscription)
192
+ return;
193
+ try {
194
+ setIsLoadingSubscription(true);
195
+ setSubscriptionError(null);
196
+ await apiClient.post(PAYMENT_ENDPOINTS.DOWNGRADE_SUBSCRIPTION, {
197
+ newTier,
198
+ });
199
+ // Refresh subscription data
200
+ await fetchSubscription();
201
+ }
202
+ catch (error) {
203
+ const axiosError = error;
204
+ const errorMessage = axiosError.response?.data?.message || 'Failed to downgrade subscription';
205
+ setSubscriptionError(errorMessage);
206
+ console.error('Downgrade subscription error:', error);
207
+ throw error;
208
+ }
209
+ finally {
210
+ setIsLoadingSubscription(false);
211
+ }
212
+ }, [isAuthenticated, subscription, apiClient, fetchSubscription]);
213
+ // Auto-fetch subscription on mount
214
+ useEffect(() => {
215
+ if (isAuthenticated && user) {
216
+ fetchSubscription();
217
+ fetchUsage();
218
+ }
219
+ }, [isAuthenticated, user, fetchSubscription, fetchUsage]);
220
+ return {
221
+ // Subscription state
222
+ subscription,
223
+ isLoadingSubscription,
224
+ subscriptionError,
225
+ // Payment history
226
+ payments,
227
+ isLoadingPayments,
228
+ paymentsError,
229
+ // Invoices
230
+ invoices,
231
+ isLoadingInvoices,
232
+ invoicesError,
233
+ // Usage metrics
234
+ usage,
235
+ isLoadingUsage,
236
+ usageError,
237
+ // Actions
238
+ fetchSubscription,
239
+ fetchPayments,
240
+ fetchInvoices,
241
+ fetchUsage,
242
+ cancelSubscription,
243
+ resumeSubscription,
244
+ upgradeSubscription,
245
+ downgradeSubscription,
246
+ };
247
+ };
248
+ export default usePayments;
249
+ //# sourceMappingURL=usePayments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePayments.js","sourceRoot":"","sources":["../../../src/components/Payments/usePayments.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAS/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AA2ChD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,MAAM,EAAoB,EAAqB,EAAE;IAC7E,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC;IAEzD,QAAQ;IACR,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAA0B,IAAI,CAAC,CAAC;IAChF,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1E,MAAM,CAAC,iBAAi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,CAAC;IAElE,mCAAmC;IACnC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,eAAe,IAAI,IAAI,EAAE,CAAC;YAC5B,iBAAiB,EAAE,CAAC;YACpB,UAAU,EAAE,CAAC;QACf,CAAC;IACH,CAAC,EAAE,CAAC,eAAe,EAAE,IAAI,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAE3D,OAAO;QACL,qBAAqB;QACrB,YAAY;QACZ,qBAAqB;QACrB,iBAAiB;QAEjB,kBAAkB;QAClB,QAAQ;QACR,iBAAiB;QACjB,aAAa;QAEb,WAAW;QACX,QAAQ;QACR,iBAAiB;QACjB,aAAa;QAEb,gBAAgB;QAChB,KAAK;QACL,cAAc;QACd,UAAU;QAEV,UAAU;QACV,iBAAiB;QACjB,aAAa;QACb,aAAa;QACb,UAAU;QACV,kBAAkB;QAClB,kBAAkB;QAClB,mBAAmB;QACnB,qBAAqB;KACtB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,62 @@
1
+ export interface InitTimeoutScreenProps {
2
+ /**
3
+ * Callback when the retry button is clicked
4
+ */
5
+ onRetry: () => void;
6
+ /**
7
+ * Custom title for the timeout screen
8
+ * @default "Initialization Taking Longer Than Expected"
9
+ */
10
+ title?: string;
11
+ /**
12
+ * Custom description text
13
+ */
14
+ description?: string;
15
+ /**
16
+ * Custom troubleshooting tips
17
+ */
18
+ tips?: string[];
19
+ }
20
+ /**
21
+ * InitTimeoutScreen - Shows if initialization takes longer than 10 seconds
22
+ *
23
+ * This component provides a user-friendly message when Privy initialization
24
+ * takes longer than expected, with troubleshooting tips and retry options.
25
+ *
26
+ * **Production Pattern**: Extracted from generic-template-dashboard production deployment
27
+ *
28
+ * **UX Considerations**:
29
+ * - Non-alarming design (warning color, not error)
30
+ * - Clear troubleshooting steps
31
+ * - Two action options: Retry or Continue Waiting
32
+ * - Professional tone for business users
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * import { InitTimeoutScreen } from '@varity-labs/ui-kit';
37
+ *
38
+ * function MyTimeoutHandler() {
39
+ * return (
40
+ * <InitTimeoutScreen
41
+ * onRetry={() => window.location.reload()}
42
+ * />
43
+ * );
44
+ * }
45
+ * ```
46
+ *
47
+ * @example With custom content
48
+ * ```tsx
49
+ * <InitTimeoutScreen
50
+ * onRetry={handleRetry}
51
+ * title="Still loading..."
52
+ * description="This is taking longer than usual."
53
+ * tips={[
54
+ * "Check your connection",
55
+ * "Try a different browser",
56
+ * ]}
57
+ * />
58
+ * ```
59
+ */
60
+ export declare function InitTimeoutScreen({ onRetry, title, description, tips, }: InitTimeoutScreenProps): JSX.Element;
61
+ export default InitTimeoutScreen;
62
+ //# sourceMappingURL=InitTimeoutScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitTimeoutScreen.d.ts","sourceRoot":"","sources":["../../../src/components/Privy/InitTimeoutScreen.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,KAAoD,EACpD,WAAuH,EACvH,IAIC,GACF,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CA0DtC;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+ /**
3
+ * InitTimeoutScreen - Shows if initialization takes longer than 10 seconds
4
+ *
5
+ * This component provides a user-friendly message when Privy initialization
6
+ * takes longer than expected, with troubleshooting tips and retry options.
7
+ *
8
+ * **Production Pattern**: Extracted from generic-template-dashboard production deployment
9
+ *
10
+ * **UX Considerations**:
11
+ * - Non-alarming design (warning color, not error)
12
+ * - Clear troubleshooting steps
13
+ * - Two action options: Retry or Continue Waiting
14
+ * - Professional tone for business users
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * import { InitTimeoutScreen } from '@varity-labs/ui-kit';
19
+ *
20
+ * function MyTimeoutHandler() {
21
+ * return (
22
+ * <InitTimeoutScreen
23
+ * onRetry={() => window.location.reload()}
24
+ * />
25
+ * );
26
+ * }
27
+ * ```
28
+ *
29
+ * @example With custom content
30
+ * ```tsx
31
+ * <InitTimeoutScreen
32
+ * onRetry={handleRetry}
33
+ * title="Still loading..."
34
+ * description="This is taking longer than usual."
35
+ * tips={[
36
+ * "Check your connection",
37
+ * "Try a different browser",
38
+ * ]}
39
+ * />
40
+ * ```
41
+ */
42
+ export function InitTimeoutScreen({ onRetry, title = 'Initialization Taking Longer Than Expected', description = 'The Web3 providers are taking longer than usual to initialize. This might be due to network conditions.', tips = [
43
+ 'Check your internet connection',
44
+ 'Privy services may be experiencing delays',
45
+ 'You can wait or try refreshing the page',
46
+ ], }) {
47
+ return (React.createElement("div", { className: "min-h-screen bg-gray-50 flex items-center justify-center p-4" },
48
+ React.createElement("div", { className: "bg-white rounded-lg shadow-lg p-8 max-w-md" },
49
+ React.createElement("div", { className: "w-16 h-16 bg-yellow-100 rounded-full flex items-center justify-center mx-auto mb-4" },
50
+ React.createElement("svg", { className: "w-8 h-8 text-yellow-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
51
+ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }))),
52
+ React.createElement("h1", { className: "text-2xl font-bold text-gray-900 mb-2" }, title),
53
+ React.createElement("p", { className: "text-gray-600 mb-4" }, description),
54
+ React.createElement("ul", { className: "text-sm text-gray-700 space-y-2 mb-4" }, tips.map((tip, index) => (React.createElement("li", { key: index, className: "flex items-start gap-2" },
55
+ React.createElement("span", { className: "text-yellow-600 mt-0.5" }, "\u2022"),
56
+ React.createElement("span", null, tip))))),
57
+ React.createElement("div", { className: "flex gap-2" },
58
+ React.createElement("button", { onClick: onRetry, className: "flex-1 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 hover:shadow-md hover:scale-[1.02] active:scale-[0.98] transition-all duration-200" }, "Retry"),
59
+ React.createElement("button", { onClick: () => {
60
+ /* User chose to continue waiting - do nothing */
61
+ }, className: "flex-1 bg-gray-200 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-300 hover:shadow-sm hover:scale-[1.01] active:scale-[0.99] transition-all duration-200" }, "Continue Waiting")))));
62
+ }
63
+ export default InitTimeoutScreen;
64
+ //# sourceMappingURL=InitTimeoutScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitTimeoutScreen.js","sourceRoot":"","sources":["../../../src/components/Privy/InitTimeoutScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAsB1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,OAAO,EACP,KAAK,GAAG,4CAA4C,EACpD,WAAW,GAAG,yGAAyG,EACvH,IAAI,GAAG;IACL,gCAAgC;IAChC,2CAA2C;IAC3C,yCAAyC;CAC1C,GACsB;IACvB,OAAO,CACL,6BAAK,SAAS,EAAC,8DAA8D;QAC3E,6BAAK,SAAS,EAAC,4CAA4C;YAEzD,6BAAK,SAAS,EAAC,oFAAoF;gBACjG,6BACE,SAAS,EAAC,yBAAyB,EACnC,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B;oBAElC,8BACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAE,CAAC,EACd,CAAC,EAAC,6CAA6C,GAC/C,CACE,CACF;YAGN,4BAAI,SAAS,EAAC,uCAAuC,IAAE,KAAK,CAAM;YAGlE,2BAAG,SAAS,EAAC,oBAAoB,IAAE,WAAW,CAAK;YAGnD,4BAAI,SAAS,EAAC,sCAAsC,IACjD,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CACxB,4BAAI,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,wBAAwB;gBAChD,8BAAM,SAAS,EAAC,wBAAwB,aAAS;gBACjD,kCAAO,GAAG,CAAQ,CACf,CACN,CAAC,CACC;YAGL,6BAAK,SAAS,EAAC,YAAY;gBACzB,gCACE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,yJAAyJ,YAG5J;gBACT,gCACE,OAAO,EAAE,GAAG,EAAE;wBACZ,iDAAiD;oBACnD,CAAC,EACD,SAAS,EAAC,4JAA4J,uBAG/J,CACL,CACF,CACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,56 @@
1
+ export interface InitializingScreenProps {
2
+ /**
3
+ * Custom title for the initializing screen
4
+ * @default "Initializing Dashboard..."
5
+ */
6
+ title?: string;
7
+ /**
8
+ * Custom description text
9
+ * @default "Setting up Web3 providers and authentication. This should take just a few seconds."
10
+ */
11
+ description?: string;
12
+ /**
13
+ * Custom steps to show during initialization
14
+ */
15
+ steps?: string[];
16
+ }
17
+ /**
18
+ * InitializingScreen - Shows while Privy and thirdweb providers initialize
19
+ *
20
+ * This component provides visual feedback during the Privy initialization process,
21
+ * preventing the blank screen issue that occurs without proper loading states.
22
+ *
23
+ * **Production Pattern**: Extracted from generic-template-dashboard production deployment
24
+ *
25
+ * **Design Considerations**:
26
+ * - Professional gradient background (blue to indigo)
27
+ * - Animated spinner with icon for visual interest
28
+ * - Clear messaging about what's happening
29
+ * - Shows expected steps to set user expectations
30
+ * - Optimized for business users (30-60 years old)
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * import { InitializingScreen } from '@varity-labs/ui-kit';
35
+ *
36
+ * function MyLoadingState() {
37
+ * return <InitializingScreen />;
38
+ * }
39
+ * ```
40
+ *
41
+ * @example With custom content
42
+ * ```tsx
43
+ * <InitializingScreen
44
+ * title="Setting up your workspace..."
45
+ * description="Connecting to blockchain and loading your data."
46
+ * steps={[
47
+ * "Connecting to Varity L3",
48
+ * "Loading your profile",
49
+ * "Preparing dashboard"
50
+ * ]}
51
+ * />
52
+ * ```
53
+ */
54
+ export declare function InitializingScreen({ title, description, steps, }: InitializingScreenProps): JSX.Element;
55
+ export default InitializingScreen;
56
+ //# sourceMappingURL=InitializingScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitializingScreen.d.ts","sourceRoot":"","sources":["../../../src/components/Privy/InitializingScreen.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAmC,EACnC,WAAkG,EAClG,KAIC,GACF,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CA4DvC;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ /**
3
+ * InitializingScreen - Shows while Privy and thirdweb providers initialize
4
+ *
5
+ * This component provides visual feedback during the Privy initialization process,
6
+ * preventing the blank screen issue that occurs without proper loading states.
7
+ *
8
+ * **Production Pattern**: Extracted from generic-template-dashboard production deployment
9
+ *
10
+ * **Design Considerations**:
11
+ * - Professional gradient background (blue to indigo)
12
+ * - Animated spinner with icon for visual interest
13
+ * - Clear messaging about what's happening
14
+ * - Shows expected steps to set user expectations
15
+ * - Optimized for business users (30-60 years old)
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * import { InitializingScreen } from '@varity-labs/ui-kit';
20
+ *
21
+ * function MyLoadingState() {
22
+ * return <InitializingScreen />;
23
+ * }
24
+ * ```
25
+ *
26
+ * @example With custom content
27
+ * ```tsx
28
+ * <InitializingScreen
29
+ * title="Setting up your workspace..."
30
+ * description="Connecting to blockchain and loading your data."
31
+ * steps={[
32
+ * "Connecting to Varity L3",
33
+ * "Loading your profile",
34
+ * "Preparing dashboard"
35
+ * ]}
36
+ * />
37
+ * ```
38
+ */
39
+ export function InitializingScreen({ title = 'Initializing Dashboard...', description = 'Setting up Web3 providers and authentication. This should take just a few seconds.', steps = [
40
+ 'Loading Privy authentication',
41
+ 'Connecting to Varity L3',
42
+ 'Preparing wallet connection',
43
+ ], }) {
44
+ return (React.createElement("div", { className: "min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 flex items-center justify-center p-4" },
45
+ React.createElement("div", { className: "bg-white rounded-lg shadow-xl p-8 max-w-md text-center" },
46
+ React.createElement("div", { className: "flex justify-center mb-4" },
47
+ React.createElement("div", { className: "relative" },
48
+ React.createElement("div", { className: "animate-spin rounded-full h-16 w-16 border-b-4 border-blue-600" }),
49
+ React.createElement("div", { className: "absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2" },
50
+ React.createElement("svg", { className: "w-6 h-6 text-blue-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
51
+ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }))))),
52
+ React.createElement("h1", { className: "text-2xl font-bold text-gray-900 mb-2" }, title),
53
+ React.createElement("p", { className: "text-gray-600 mb-4" }, description),
54
+ React.createElement("div", { className: "text-sm text-gray-500 space-y-1" }, steps.map((step, index) => (React.createElement("p", { key: index, className: "flex items-center gap-2 justify-center" },
55
+ React.createElement("svg", { className: "w-4 h-4 text-green-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
56
+ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" })),
57
+ step)))))));
58
+ }
59
+ export default InitializingScreen;
60
+ //# sourceMappingURL=InitializingScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitializingScreen.js","sourceRoot":"","sources":["../../../src/components/Privy/InitializingScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,KAAK,GAAG,2BAA2B,EACnC,WAAW,GAAG,oFAAoF,EAClG,KAAK,GAAG;IACN,8BAA8B;IAC9B,yBAAyB;IACzB,6BAA6B;CAC9B,GACuB;IACxB,OAAO,CACL,6BAAK,SAAS,EAAC,gGAAgG;QAC7G,6BAAK,SAAS,EAAC,wDAAwD;YAErE,6BAAK,SAAS,EAAC,0BAA0B;gBACvC,6BAAK,SAAS,EAAC,UAAU;oBACvB,6BAAK,SAAS,EAAC,gEAAgE,GAAO;oBACtF,6BAAK,SAAS,EAAC,uEAAuE;wBAEpF,6BACE,SAAS,EAAC,uBAAuB,EACjC,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B;4BAElC,8BACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAE,CAAC,EACd,CAAC,EAAC,4BAA4B,GAC9B,CACE,CACF,CACF,CACF;YAGN,4BAAI,SAAS,EAAC,uCAAuC,IAAE,KAAK,CAAM;YAGlE,2BAAG,SAAS,EAAC,oBAAoB,IAAE,WAAW,CAAK;YAGnD,6BAAK,SAAS,EAAC,iCAAiC,IAC7C,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,2BAAG,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,wCAAwC;gBAE/D,6BACE,SAAS,EAAC,wBAAwB,EAClC,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B;oBAElC,8BACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAE,CAAC,EACd,CAAC,EAAC,gBAAgB,GAClB,CACE;gBACL,IAAI,CACH,CACL,CAAC,CACE,CACF,CACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { User } from '@privy-io/react-auth';
3
+ export interface PrivyLoginButtonProps {
4
+ onSuccess?: (user: User) => void;
5
+ onError?: (error: Error) => void;
6
+ className?: string;
7
+ children?: React.ReactNode;
8
+ }
9
+ /**
10
+ * Privy Login Button Component
11
+ *
12
+ * Simple button to trigger Privy authentication modal.
13
+ * Supports email, social logins, and wallet connections.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <PrivyLoginButton
18
+ * onSuccess={(user) => console.log('Logged in:', user)}
19
+ * onError={(error) => console.error('Login failed:', error)}
20
+ * >
21
+ * Sign In
22
+ * </PrivyLoginButton>
23
+ * ```
24
+ */
25
+ export declare function PrivyLoginButton({ onSuccess, onError, className, children, }: PrivyLoginButtonProps): JSX.Element;
26
+ export default PrivyLoginButton;
27
+ //# sourceMappingURL=PrivyLoginButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrivyLoginButton.d.ts","sourceRoot":"","sources":["../../../src/components/Privy/PrivyLoginButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAY,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAItD,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,OAAO,EACP,SAAoI,EACpI,QAAyC,GAC1C,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAyCrC;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import { usePrivy } from '@privy-io/react-auth';
3
+ import toast from 'react-hot-toast';
4
+ import { getErrorMessage } from '@varity-labs/types';
5
+ /**
6
+ * Privy Login Button Component
7
+ *
8
+ * Simple button to trigger Privy authentication modal.
9
+ * Supports email, social logins, and wallet connections.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <PrivyLoginButton
14
+ * onSuccess={(user) => console.log('Logged in:', user)}
15
+ * onError={(error) => console.error('Login failed:', error)}
16
+ * >
17
+ * Sign In
18
+ * </PrivyLoginButton>
19
+ * ```
20
+ */
21
+ export function PrivyLoginButton({ onSuccess, onError, className = 'px-6 py-3 bg-indigo-600 hover:bg-indigo-700 text-white font-medium rounded-lg transition-all shadow-lg hover:shadow-xl', children = 'Sign In with Email or Social', }) {
22
+ const { ready, authenticated, login, user } = usePrivy();
23
+ const handleLogin = async () => {
24
+ try {
25
+ await login();
26
+ if (user) {
27
+ toast.success('Successfully logged in!');
28
+ onSuccess?.(user);
29
+ }
30
+ }
31
+ catch (error) {
32
+ const errorMessage = getErrorMessage(error);
33
+ console.error('Privy login error:', errorMessage);
34
+ toast.error(errorMessage || 'Login failed');
35
+ const errorObj = error instanceof Error ? error : new Error(errorMessage);
36
+ onError?.(errorObj);
37
+ }
38
+ };
39
+ if (!ready) {
40
+ return (React.createElement("button", { disabled: true, className: `${className} opacity-50 cursor-not-allowed` }, "Loading..."));
41
+ }
42
+ if (authenticated) {
43
+ return (React.createElement("button", { disabled: true, className: `${className} opacity-50 cursor-not-allowed` }, "Already Authenticated"));
44
+ }
45
+ return (React.createElement("button", { onClick: handleLogin, className: className }, children));
46
+ }
47
+ export default PrivyLoginButton;
48
+ //# sourceMappingURL=PrivyLoginButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrivyLoginButton.js","sourceRoot":"","sources":["../../../src/components/Privy/PrivyLoginButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAQ,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AASrD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,SAAS,EACT,OAAO,EACP,SAAS,GAAG,wHAAwH,EACpI,QAAQ,GAAG,8BAA8B,GACnB;IACtB,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,QAAQ,EAAE,CAAC;IAEzD,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE;QAC7B,IAAI,CAAC;YACH,MAAM,KAAK,EAAE,CAAC;YAEd,IAAI,IAAI,EAAE,CAAC;gBACT,KAAK,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;gBACzC,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;YAC5C,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;YAClD,KAAK,CAAC,KAAK,CAAC,YAAY,IAAI,cAAc,CAAC,CAAC;YAC5C,MAAM,QAAQ,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;YAC1E,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;IAEF,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,CACL,gCAAQ,QAAQ,QAAC,SAAS,EAAE,GAAG,SAAS,gCAAgC,iBAE/D,CACV,CAAC;IACJ,CAAC;IAED,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CACL,gCAAQ,QAAQ,QAAC,SAAS,EAAE,GAAG,SAAS,gCAAgC,4BAE/D,CACV,CAAC;IACJ,CAAC;IAED,OAAO,CACL,gCAAQ,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,IAC/C,QAAQ,CACF,CACV,CAAC;AACJ,CAAC;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from 'react';
2
+ export interface PrivyProtectedRouteProps {
3
+ children: ReactNode;
4
+ fallback?: ReactNode;
5
+ loadingComponent?: ReactNode;
6
+ }
7
+ /**
8
+ * Privy Protected Route Component
9
+ *
10
+ * Wraps content that requires authentication.
11
+ * Shows login prompt if user is not authenticated.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * <PrivyProtectedRoute>
16
+ * <DashboardContent />
17
+ * </PrivyProtectedRoute>
18
+ * ```
19
+ */
20
+ export declare function PrivyProtectedRoute({ children, fallback, loadingComponent, }: PrivyProtectedRouteProps): JSX.Element;
21
+ export default PrivyProtectedRoute;
22
+ //# sourceMappingURL=PrivyProtectedRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrivyProtectedRoute.d.ts","sourceRoot":"","sources":["../../../src/components/Privy/PrivyProtectedRoute.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gBAAgB,CAAC,EAAE,SAAS,CAAC;CAC9B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,gBAAgB,GACjB,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAgExC;AAED,eAAe,mBAAmB,CAAC"}