@b3dotfun/sdk 0.1.2 → 0.1.5

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 (235) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +7 -1
  2. package/dist/cjs/anyspend/react/components/AnySpend.js +66 -15
  3. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -2
  4. package/dist/cjs/anyspend/react/components/AnySpendCollectorClubPurchase.js +4 -4
  5. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
  6. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +185 -50
  7. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +6 -1
  8. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +19 -4
  9. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  10. package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  11. package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +4 -1
  12. package/dist/cjs/anyspend/react/components/QRDeposit.js +12 -4
  13. package/dist/cjs/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
  14. package/dist/cjs/anyspend/react/components/common/CryptoPaySection.js +7 -5
  15. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
  16. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
  17. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  18. package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
  19. package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
  20. package/dist/cjs/anyspend/react/components/common/FeeDetailPanel.js +15 -6
  21. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
  22. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
  23. package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +3 -0
  24. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +11 -10
  25. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  26. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +9 -9
  27. package/dist/cjs/anyspend/react/components/common/OrderHistory.js +2 -1
  28. package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
  29. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +2 -2
  30. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
  31. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
  32. package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
  33. package/dist/cjs/anyspend/react/components/common/PointsDetailPanel.js +3 -2
  34. package/dist/cjs/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
  35. package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +5 -2
  36. package/dist/cjs/anyspend/react/components/common/TabSection.d.ts +3 -1
  37. package/dist/cjs/anyspend/react/components/common/TabSection.js +16 -7
  38. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
  39. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
  40. package/dist/cjs/anyspend/react/components/common/WarningText.d.ts +8 -7
  41. package/dist/cjs/anyspend/react/components/common/WarningText.js +5 -6
  42. package/dist/cjs/anyspend/react/components/index.d.ts +1 -0
  43. package/dist/cjs/anyspend/react/components/types/classes.d.ts +390 -0
  44. package/dist/cjs/anyspend/react/components/types/classes.js +6 -0
  45. package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
  46. package/dist/cjs/anyspend/react/hooks/index.js +1 -0
  47. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.d.ts +22 -2
  48. package/dist/cjs/anyspend/react/hooks/useAnyspendFlow.js +119 -15
  49. package/dist/cjs/anyspend/react/hooks/useDirectTransfer.d.ts +17 -0
  50. package/dist/cjs/anyspend/react/hooks/useDirectTransfer.js +46 -0
  51. package/dist/cjs/anyspend/react/hooks/useRecipientAddressState.js +1 -1
  52. package/dist/cjs/anyspend/utils/format.js +12 -2
  53. package/dist/cjs/global-account/react/components/B3DynamicModal.js +1 -5
  54. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -3
  55. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
  56. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +1 -4
  57. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +2 -2
  58. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -1
  59. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +1 -1
  60. package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +1 -4
  61. package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.js +1 -3
  62. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
  63. package/dist/cjs/global-account/react/components/ManageAccount/SettingsContent.js +17 -3
  64. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +19 -152
  65. package/dist/cjs/global-account/react/components/index.d.ts +0 -1
  66. package/dist/cjs/global-account/react/components/index.js +3 -6
  67. package/dist/cjs/global-account/react/hooks/index.d.ts +0 -1
  68. package/dist/cjs/global-account/react/hooks/index.js +2 -4
  69. package/dist/cjs/global-account/react/hooks/useAuth.d.ts +2 -3
  70. package/dist/cjs/global-account/react/hooks/useAuth.js +14 -31
  71. package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +1 -1
  72. package/dist/cjs/global-account/react/hooks/useTWAuth.js +3 -3
  73. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +8 -19
  74. package/dist/esm/anyspend/react/components/AnySpend.d.ts +7 -1
  75. package/dist/esm/anyspend/react/components/AnySpend.js +68 -17
  76. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -2
  77. package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +4 -4
  78. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
  79. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +189 -54
  80. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +6 -1
  81. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +19 -4
  82. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  83. package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
  84. package/dist/esm/anyspend/react/components/QRDeposit.d.ts +4 -1
  85. package/dist/esm/anyspend/react/components/QRDeposit.js +12 -4
  86. package/dist/esm/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
  87. package/dist/esm/anyspend/react/components/common/CryptoPaySection.js +7 -5
  88. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
  89. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +4 -3
  90. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  91. package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +7 -6
  92. package/dist/esm/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
  93. package/dist/esm/anyspend/react/components/common/FeeDetailPanel.js +15 -6
  94. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
  95. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +10 -6
  96. package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +3 -0
  97. package/dist/esm/anyspend/react/components/common/OrderDetails.js +11 -10
  98. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  99. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +9 -9
  100. package/dist/esm/anyspend/react/components/common/OrderHistory.js +2 -1
  101. package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
  102. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +2 -2
  103. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
  104. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +20 -7
  105. package/dist/esm/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
  106. package/dist/esm/anyspend/react/components/common/PointsDetailPanel.js +3 -2
  107. package/dist/esm/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
  108. package/dist/esm/anyspend/react/components/common/RecipientSelection.js +5 -2
  109. package/dist/esm/anyspend/react/components/common/TabSection.d.ts +3 -1
  110. package/dist/esm/anyspend/react/components/common/TabSection.js +16 -7
  111. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
  112. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +3 -2
  113. package/dist/esm/anyspend/react/components/common/WarningText.d.ts +8 -7
  114. package/dist/esm/anyspend/react/components/common/WarningText.js +5 -6
  115. package/dist/esm/anyspend/react/components/index.d.ts +1 -0
  116. package/dist/esm/anyspend/react/components/types/classes.d.ts +390 -0
  117. package/dist/esm/anyspend/react/components/types/classes.js +5 -0
  118. package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
  119. package/dist/esm/anyspend/react/hooks/index.js +1 -0
  120. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.d.ts +22 -2
  121. package/dist/esm/anyspend/react/hooks/useAnyspendFlow.js +119 -16
  122. package/dist/esm/anyspend/react/hooks/useDirectTransfer.d.ts +17 -0
  123. package/dist/esm/anyspend/react/hooks/useDirectTransfer.js +43 -0
  124. package/dist/esm/anyspend/react/hooks/useRecipientAddressState.js +1 -1
  125. package/dist/esm/anyspend/utils/format.js +12 -2
  126. package/dist/esm/global-account/react/components/B3DynamicModal.js +1 -5
  127. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -3
  128. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
  129. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +1 -4
  130. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +2 -2
  131. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -1
  132. package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +1 -1
  133. package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +1 -4
  134. package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.js +1 -3
  135. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +1 -3
  136. package/dist/esm/global-account/react/components/ManageAccount/SettingsContent.js +16 -2
  137. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +20 -153
  138. package/dist/esm/global-account/react/components/index.d.ts +0 -1
  139. package/dist/esm/global-account/react/components/index.js +0 -2
  140. package/dist/esm/global-account/react/hooks/index.d.ts +0 -1
  141. package/dist/esm/global-account/react/hooks/index.js +0 -1
  142. package/dist/esm/global-account/react/hooks/useAuth.d.ts +2 -3
  143. package/dist/esm/global-account/react/hooks/useAuth.js +14 -31
  144. package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +1 -1
  145. package/dist/esm/global-account/react/hooks/useTWAuth.js +3 -3
  146. package/dist/esm/global-account/react/stores/useModalStore.d.ts +8 -19
  147. package/dist/styles/index.css +1 -1
  148. package/dist/types/anyspend/react/components/AnySpend.d.ts +7 -1
  149. package/dist/types/anyspend/react/components/AnySpendCollectorClubPurchase.d.ts +6 -2
  150. package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +6 -0
  151. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +6 -1
  152. package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
  153. package/dist/types/anyspend/react/components/QRDeposit.d.ts +4 -1
  154. package/dist/types/anyspend/react/components/common/CryptoPaySection.d.ts +3 -1
  155. package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +3 -1
  156. package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
  157. package/dist/types/anyspend/react/components/common/FeeDetailPanel.d.ts +3 -1
  158. package/dist/types/anyspend/react/components/common/FiatPaymentMethod.d.ts +3 -1
  159. package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +3 -0
  160. package/dist/types/anyspend/react/components/common/OrderDetailsCollapsible.d.ts +2 -0
  161. package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +3 -1
  162. package/dist/types/anyspend/react/components/common/PanelOnrampPayment.d.ts +2 -0
  163. package/dist/types/anyspend/react/components/common/PointsDetailPanel.d.ts +3 -1
  164. package/dist/types/anyspend/react/components/common/RecipientSelection.d.ts +6 -1
  165. package/dist/types/anyspend/react/components/common/TabSection.d.ts +3 -1
  166. package/dist/types/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
  167. package/dist/types/anyspend/react/components/common/WarningText.d.ts +8 -7
  168. package/dist/types/anyspend/react/components/index.d.ts +1 -0
  169. package/dist/types/anyspend/react/components/types/classes.d.ts +390 -0
  170. package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
  171. package/dist/types/anyspend/react/hooks/useAnyspendFlow.d.ts +22 -2
  172. package/dist/types/anyspend/react/hooks/useDirectTransfer.d.ts +17 -0
  173. package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -3
  174. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +1 -4
  175. package/dist/types/global-account/react/components/B3Provider/B3Provider.native.d.ts +1 -1
  176. package/dist/types/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +1 -4
  177. package/dist/types/global-account/react/components/index.d.ts +0 -1
  178. package/dist/types/global-account/react/hooks/index.d.ts +0 -1
  179. package/dist/types/global-account/react/hooks/useAuth.d.ts +2 -3
  180. package/dist/types/global-account/react/hooks/useTWAuth.d.ts +1 -1
  181. package/dist/types/global-account/react/stores/useModalStore.d.ts +8 -19
  182. package/package.json +1 -1
  183. package/src/anyspend/react/components/AnySpend.tsx +164 -36
  184. package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +11 -6
  185. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +278 -69
  186. package/src/anyspend/react/components/AnySpendDeposit.tsx +176 -52
  187. package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +3 -0
  188. package/src/anyspend/react/components/QRDeposit.tsx +91 -35
  189. package/src/anyspend/react/components/common/CryptoPaySection.tsx +31 -19
  190. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +14 -4
  191. package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +43 -23
  192. package/src/anyspend/react/components/common/FeeDetailPanel.tsx +53 -32
  193. package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +26 -13
  194. package/src/anyspend/react/components/common/OrderDetails.tsx +20 -9
  195. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +12 -7
  196. package/src/anyspend/react/components/common/OrderHistory.tsx +2 -1
  197. package/src/anyspend/react/components/common/PanelOnramp.tsx +4 -1
  198. package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +118 -40
  199. package/src/anyspend/react/components/common/PointsDetailPanel.tsx +28 -14
  200. package/src/anyspend/react/components/common/RecipientSelection.tsx +20 -5
  201. package/src/anyspend/react/components/common/TabSection.tsx +21 -12
  202. package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +12 -4
  203. package/src/anyspend/react/components/common/WarningText.tsx +10 -10
  204. package/src/anyspend/react/components/index.ts +16 -0
  205. package/src/anyspend/react/components/types/classes.ts +476 -0
  206. package/src/anyspend/react/hooks/index.ts +1 -0
  207. package/src/anyspend/react/hooks/useAnyspendFlow.ts +141 -17
  208. package/src/anyspend/react/hooks/useDirectTransfer.ts +67 -0
  209. package/src/anyspend/react/hooks/useRecipientAddressState.ts +1 -1
  210. package/src/anyspend/utils/format.ts +13 -2
  211. package/src/global-account/react/components/B3DynamicModal.tsx +0 -5
  212. package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +0 -4
  213. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +1 -1
  214. package/src/global-account/react/components/B3Provider/B3Provider.tsx +1 -11
  215. package/src/global-account/react/components/B3Provider/LocalSDKProvider.tsx +0 -6
  216. package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +1 -4
  217. package/src/global-account/react/components/ManageAccount/SettingsContent.tsx +33 -1
  218. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +27 -184
  219. package/src/global-account/react/components/index.ts +0 -3
  220. package/src/global-account/react/hooks/index.ts +0 -1
  221. package/src/global-account/react/hooks/useAuth.ts +14 -31
  222. package/src/global-account/react/hooks/useTWAuth.tsx +3 -5
  223. package/src/global-account/react/stores/useModalStore.ts +7 -20
  224. package/dist/cjs/global-account/react/components/TurnkeyAuthModal.d.ts +0 -8
  225. package/dist/cjs/global-account/react/components/TurnkeyAuthModal.js +0 -86
  226. package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.d.ts +0 -20
  227. package/dist/cjs/global-account/react/hooks/useTurnkeyAuth.js +0 -142
  228. package/dist/esm/global-account/react/components/TurnkeyAuthModal.d.ts +0 -8
  229. package/dist/esm/global-account/react/components/TurnkeyAuthModal.js +0 -83
  230. package/dist/esm/global-account/react/hooks/useTurnkeyAuth.d.ts +0 -20
  231. package/dist/esm/global-account/react/hooks/useTurnkeyAuth.js +0 -136
  232. package/dist/types/global-account/react/components/TurnkeyAuthModal.d.ts +0 -8
  233. package/dist/types/global-account/react/hooks/useTurnkeyAuth.d.ts +0 -20
  234. package/src/global-account/react/components/TurnkeyAuthModal.tsx +0 -243
  235. package/src/global-account/react/hooks/useTurnkeyAuth.ts +0 -171
@@ -5,6 +5,7 @@ import { motion } from "motion/react";
5
5
  import { useEffect, useRef } from "react";
6
6
  import { components } from "../../../types/api";
7
7
  import { useConnectedWalletDisplay } from "../../hooks/useConnectedWalletDisplay";
8
+ import type { CryptoPaySectionClasses } from "../types/classes";
8
9
  import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
9
10
  import { CryptoPaymentMethodDisplay } from "./CryptoPaymentMethodDisplay";
10
11
  import { OrderTokenAmount } from "./OrderTokenAmount";
@@ -29,6 +30,8 @@ interface CryptoPaySectionProps {
29
30
  onTokenSelect?: (token: components["schemas"]["Token"], event: { preventDefault: () => void }) => void;
30
31
  // Fee detail callback
31
32
  onShowFeeDetail?: () => void;
33
+ // Custom classes for styling
34
+ classes?: CryptoPaySectionClasses;
32
35
  }
33
36
 
34
37
  export function CryptoPaySection({
@@ -45,6 +48,7 @@ export function CryptoPaySection({
45
48
  anyspendQuote,
46
49
  onTokenSelect,
47
50
  onShowFeeDetail,
51
+ classes,
48
52
  }: CryptoPaySectionProps) {
49
53
  const { data: srcTokenMetadata } = useTokenData(selectedSrcToken?.chainId, selectedSrcToken?.address);
50
54
 
@@ -87,10 +91,13 @@ export function CryptoPaySection({
87
91
  initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
88
92
  animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
89
93
  transition={{ duration: 0.3, delay: 0, ease: "easeInOut" }}
90
- className="pay-section bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6"
94
+ className={
95
+ classes?.container ||
96
+ "pay-section bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6"
97
+ }
91
98
  >
92
99
  <div className="flex items-center justify-between">
93
- <div className="text-as-primary/50 flex h-7 items-center gap-1.5 text-sm">
100
+ <div className={classes?.label || "text-as-primary/50 flex h-7 items-center gap-1.5 text-sm"}>
94
101
  Pay
95
102
  {!isSrcInputDirty && anyspendQuote?.data?.fee && onShowFeeDetail && (
96
103
  <button onClick={onShowFeeDetail} className="text-as-primary/40 hover:text-as-primary/60 transition-colors">
@@ -99,7 +106,10 @@ export function CryptoPaySection({
99
106
  )}
100
107
  </div>
101
108
  <button
102
- className="text-as-tertiarry flex h-7 items-center gap-2 text-sm transition-colors focus:!outline-none"
109
+ className={
110
+ classes?.paymentMethodButton ||
111
+ "text-as-tertiarry flex h-7 items-center gap-2 text-sm transition-colors focus:!outline-none"
112
+ }
103
113
  onClick={onSelectCryptoPaymentMethod}
104
114
  >
105
115
  <CryptoPaymentMethodDisplay
@@ -109,22 +119,24 @@ export function CryptoPaySection({
109
119
  />
110
120
  </button>
111
121
  </div>
112
- <OrderTokenAmount
113
- address={walletAddress}
114
- walletAddress={walletAddress}
115
- context="from"
116
- inputValue={srcAmount}
117
- onChangeInput={value => {
118
- setIsSrcInputDirty(true);
119
- setSrcAmount(value);
120
- }}
121
- chainId={selectedSrcChainId}
122
- setChainId={setSelectedSrcChainId}
123
- token={selectedSrcToken}
124
- setToken={setSelectedSrcToken}
125
- onTokenSelect={onTokenSelect}
126
- />
127
- <div className="flex items-center justify-between">
122
+ <div className={classes?.inputContainer}>
123
+ <OrderTokenAmount
124
+ address={walletAddress}
125
+ walletAddress={walletAddress}
126
+ context="from"
127
+ inputValue={srcAmount}
128
+ onChangeInput={value => {
129
+ setIsSrcInputDirty(true);
130
+ setSrcAmount(value);
131
+ }}
132
+ chainId={selectedSrcChainId}
133
+ setChainId={setSelectedSrcChainId}
134
+ token={selectedSrcToken}
135
+ setToken={setSelectedSrcToken}
136
+ onTokenSelect={onTokenSelect}
137
+ />
138
+ </div>
139
+ <div className={classes?.balanceRow || "flex items-center justify-between"}>
128
140
  <div className="text-as-primary/50 flex h-5 items-center text-sm">
129
141
  {formatDisplayNumber(anyspendQuote?.data?.currencyIn?.amountUsd, {
130
142
  style: "currency",
@@ -8,6 +8,7 @@ import { ChevronLeft, ChevronRightCircle, Wallet, X, ZapIcon } from "lucide-reac
8
8
  import { useConnectModal, useDisconnect, useWalletInfo } from "thirdweb/react";
9
9
  import { createWallet } from "thirdweb/wallets";
10
10
  import { useConnectedWalletDisplay } from "../../hooks/useConnectedWalletDisplay";
11
+ import type { CryptoPaymentMethodClasses } from "../types/classes";
11
12
 
12
13
  export enum CryptoPaymentMethodType {
13
14
  NONE = "none",
@@ -29,6 +30,7 @@ interface CryptoPaymentMethodProps {
29
30
  isCreatingOrder: boolean;
30
31
  onBack: () => void;
31
32
  onSelectPaymentMethod: (method: CryptoPaymentMethodType) => void;
33
+ classes?: CryptoPaymentMethodClasses;
32
34
  }
33
35
 
34
36
  export function CryptoPaymentMethod({
@@ -37,6 +39,7 @@ export function CryptoPaymentMethod({
37
39
  isCreatingOrder,
38
40
  onBack,
39
41
  onSelectPaymentMethod,
42
+ classes,
40
43
  }: CryptoPaymentMethodProps) {
41
44
  const { connectedEOAWallet, connectedSmartWallet } = useAccountWallet();
42
45
  const { disconnect } = useDisconnect();
@@ -96,16 +99,23 @@ export function CryptoPaymentMethod({
96
99
  };
97
100
 
98
101
  return (
99
- <div className="crypto-payment-method mx-auto h-fit w-[460px] max-w-full px-5 pb-5 pt-5 sm:px-0 sm:pt-5">
102
+ <div
103
+ className={
104
+ classes?.container || "crypto-payment-method mx-auto h-fit w-[460px] max-w-full px-5 pb-5 pt-5 sm:px-0 sm:pt-5"
105
+ }
106
+ >
100
107
  <div className={cn("relative flex flex-col gap-10")}>
101
108
  {/* Header */}
102
109
  <button
103
110
  onClick={onBack}
104
- className="text-as-quaternary hover:text-as-primary absolute flex h-8 w-8 items-center justify-center rounded-lg transition-colors"
111
+ className={
112
+ classes?.backButton ||
113
+ "text-as-quaternary hover:text-as-primary absolute flex h-8 w-8 items-center justify-center rounded-lg transition-colors"
114
+ }
105
115
  >
106
116
  <ChevronLeft className="h-6 w-6" />
107
117
  </button>
108
- <div className="flex items-center justify-around gap-4">
118
+ <div className={classes?.header || "flex items-center justify-around gap-4"}>
109
119
  <div className="flex-1 text-center">
110
120
  <h2 className="text-as-primary text-lg font-semibold">Select a payment method</h2>
111
121
  </div>
@@ -155,7 +165,7 @@ export function CryptoPaymentMethod({
155
165
  )}
156
166
 
157
167
  {/* Payment Methods */}
158
- <div className="crypto-payment-methods flex flex-col gap-4">
168
+ <div className={classes?.optionsList || "crypto-payment-methods flex flex-col gap-4"}>
159
169
  {/* Installed Wallets Section */}
160
170
  {(shouldShowConnectedEOA || globalAddress) && (
161
171
  <div className="installed-wallets">
@@ -1,11 +1,11 @@
1
1
  import { ALL_CHAINS } from "@b3dotfun/sdk/anyspend";
2
2
  import { formatUsername } from "@b3dotfun/sdk/shared/utils";
3
- import { cn } from "@b3dotfun/sdk/shared/utils/cn";
4
3
  import { shortenAddress } from "@b3dotfun/sdk/shared/utils/formatAddress";
5
4
  import { formatDisplayNumber } from "@b3dotfun/sdk/shared/utils/number";
6
5
  import { ChevronRight, Info } from "lucide-react";
7
6
  import { motion } from "motion/react";
8
7
  import { components } from "../../../types/api";
8
+ import type { CryptoReceiveSectionClasses } from "../types/classes";
9
9
  import { OrderTokenAmount } from "./OrderTokenAmount";
10
10
  import { PointsBadge } from "./PointsBadge";
11
11
 
@@ -36,6 +36,8 @@ interface CryptoReceiveSectionProps {
36
36
  onShowPointsDetail?: () => void;
37
37
  // Fee detail navigation
38
38
  onShowFeeDetail?: () => void;
39
+ // Custom classes for styling
40
+ classes?: CryptoReceiveSectionClasses;
39
41
  }
40
42
 
41
43
  export function CryptoReceiveSection({
@@ -57,16 +59,20 @@ export function CryptoReceiveSection({
57
59
  dstTokenLogoURI,
58
60
  onShowPointsDetail,
59
61
  onShowFeeDetail,
62
+ classes,
60
63
  }: CryptoReceiveSectionProps) {
61
64
  return (
62
65
  <motion.div
63
66
  initial={{ opacity: 0, y: 20, filter: "blur(10px)" }}
64
67
  animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
65
68
  transition={{ duration: 0.3, delay: 0.1, ease: "easeInOut" }}
66
- className="receive-section bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6"
69
+ className={
70
+ classes?.container ||
71
+ "receive-section bg-as-surface-secondary border-as-border-secondary relative flex w-full flex-col gap-2 rounded-2xl border p-4 sm:p-6"
72
+ }
67
73
  >
68
74
  <div className="flex w-full items-center justify-between">
69
- <div className="text-as-primary/50 flex h-7 items-center gap-1.5 text-sm">
75
+ <div className={classes?.label || "text-as-primary/50 flex h-7 items-center gap-1.5 text-sm"}>
70
76
  {isDepositMode ? "Deposit" : "Receive"}
71
77
  {isSrcInputDirty && anyspendQuote?.data?.fee && onShowFeeDetail && (
72
78
  <button onClick={onShowFeeDetail} className="text-as-primary/40 hover:text-as-primary/60 transition-colors">
@@ -76,11 +82,11 @@ export function CryptoReceiveSection({
76
82
  </div>
77
83
  {effectiveRecipientAddress ? (
78
84
  <button
79
- className={cn("text-as-tertiarry flex h-7 items-center gap-2 rounded-lg")}
85
+ className={classes?.recipientButton || "text-as-tertiarry flex h-7 items-center gap-2 rounded-lg"}
80
86
  onClick={onSelectRecipient}
81
87
  >
82
88
  <>
83
- <span className="text-as-tertiarry flex items-center gap-1 text-sm">
89
+ <span className={classes?.recipientValue || "text-as-tertiarry flex items-center gap-1 text-sm"}>
84
90
  {customRecipientLabel ||
85
91
  (recipientName ? formatUsername(recipientName) : shortenAddress(effectiveRecipientAddress || ""))}
86
92
  </span>
@@ -88,50 +94,64 @@ export function CryptoReceiveSection({
88
94
  </>
89
95
  </button>
90
96
  ) : (
91
- <button className="text-as-primary/70 flex items-center gap-1 rounded-lg" onClick={onSelectRecipient}>
97
+ <button
98
+ className={classes?.recipientButton || "text-as-primary/70 flex items-center gap-1 rounded-lg"}
99
+ onClick={onSelectRecipient}
100
+ >
92
101
  <div className="text-sm font-medium">Select recipient</div>
93
102
  </button>
94
103
  )}
95
104
  </div>
96
105
  {isBuyMode || isDepositMode ? (
97
106
  // Fixed destination token display for buy mode and deposit mode
98
- <div className="flex items-center justify-between">
99
- <div className="text-as-primary text-2xl font-bold">{dstAmount || "0"}</div>
100
- <div className="bg-as-brand/10 border-as-brand/30 flex items-center gap-3 rounded-xl border px-4 py-3">
107
+ <div className={classes?.inputContainer || "flex items-center justify-between"}>
108
+ <div className={classes?.input || "text-as-primary text-2xl font-bold"}>{dstAmount || "0"}</div>
109
+ <div
110
+ className={
111
+ classes?.tokenSelector ||
112
+ "bg-as-brand/10 border-as-brand/30 flex items-center gap-3 rounded-xl border px-4 py-3"
113
+ }
114
+ >
101
115
  {(dstTokenLogoURI || dstToken.metadata?.logoURI) && (
102
116
  <div className="relative">
103
117
  <img
104
118
  src={dstTokenLogoURI || dstToken.metadata?.logoURI}
105
119
  alt={dstTokenSymbol || dstToken.symbol}
106
- className="h-8 w-8 rounded-full"
120
+ className={classes?.tokenIcon || "h-8 w-8 rounded-full"}
107
121
  />
108
122
  {/* Chain logo overlay */}
109
123
  {ALL_CHAINS[dstToken.chainId]?.logoUrl && (
110
124
  <img
111
125
  src={ALL_CHAINS[dstToken.chainId].logoUrl}
112
126
  alt="Chain"
113
- className="absolute -bottom-1 -right-1 h-4 w-4 rounded-full border border-white"
127
+ className={
128
+ classes?.chainBadge || "absolute -bottom-1 -right-1 h-4 w-4 rounded-full border border-white"
129
+ }
114
130
  />
115
131
  )}
116
132
  </div>
117
133
  )}
118
- <span className="text-as-brand text-lg font-bold">{dstTokenSymbol || dstToken.symbol}</span>
134
+ <span className={classes?.tokenSymbol || "text-as-brand text-lg font-bold"}>
135
+ {dstTokenSymbol || dstToken.symbol}
136
+ </span>
119
137
  </div>
120
138
  </div>
121
139
  ) : (
122
140
  // Token selection for regular swap mode
123
- <OrderTokenAmount
124
- address={effectiveRecipientAddress}
125
- context="to"
126
- inputValue={dstAmount}
127
- onChangeInput={onChangeDstAmount || (() => {})}
128
- chainId={selectedDstChainId || dstToken.chainId}
129
- setChainId={setSelectedDstChainId || (() => {})}
130
- token={dstToken}
131
- setToken={setSelectedDstToken || (() => {})}
132
- />
141
+ <div className={classes?.inputContainer}>
142
+ <OrderTokenAmount
143
+ address={effectiveRecipientAddress}
144
+ context="to"
145
+ inputValue={dstAmount}
146
+ onChangeInput={onChangeDstAmount || (() => {})}
147
+ chainId={selectedDstChainId || dstToken.chainId}
148
+ setChainId={setSelectedDstChainId || (() => {})}
149
+ token={dstToken}
150
+ setToken={setSelectedDstToken || (() => {})}
151
+ />
152
+ </div>
133
153
  )}
134
- <div className="text-as-primary/50 flex h-5 items-center justify-start gap-2 text-sm">
154
+ <div className={classes?.feeRow || "text-as-primary/50 flex h-5 items-center justify-start gap-2 text-sm"}>
135
155
  <div className="flex items-center gap-2">
136
156
  {formatDisplayNumber(anyspendQuote?.data?.currencyOut?.amountUsd, {
137
157
  style: "currency",
@@ -3,11 +3,13 @@ import { cn } from "@b3dotfun/sdk/shared/utils/cn";
3
3
  import { ChevronDown } from "lucide-react";
4
4
  import { useState } from "react";
5
5
  import { components } from "../../../types/api";
6
+ import type { FeeDetailPanelClasses } from "../types/classes";
6
7
 
7
8
  interface FeeDetailPanelProps {
8
9
  fee: components["schemas"]["Fee"];
9
10
  transactionAmountUsd?: number;
10
11
  onBack: () => void;
12
+ classes?: FeeDetailPanelClasses;
11
13
  }
12
14
 
13
15
  // Fee tier definitions
@@ -32,7 +34,7 @@ const WHALE_DISCOUNT_TIERS = [
32
34
  { minAny: 1000000, discountPercent: 100, label: "Tier 3: 1M+ $ANY" },
33
35
  ];
34
36
 
35
- export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailPanelProps) {
37
+ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack, classes }: FeeDetailPanelProps) {
36
38
  // Detect if this is a fiat onramp order (Stripe) vs regular crypto swap
37
39
  // stripeweb2_fee = Stripe/fiat onramp (uses FIAT_FEE_TIERS)
38
40
  // standard_fee = Regular crypto swap (uses CRYPTO_FEE_TIERS)
@@ -83,15 +85,17 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
83
85
  const [showAllDiscountTiers, setShowAllDiscountTiers] = useState(false);
84
86
 
85
87
  return (
86
- <div className="mx-auto flex w-[460px] max-w-full flex-col items-center gap-3 px-5">
88
+ <div className={classes?.container || "mx-auto flex w-[460px] max-w-full flex-col items-center gap-3 px-5"}>
87
89
  <div className="flex w-full flex-col gap-3">
88
90
  <div className="text-center">
89
- <h3 className="text-as-primary text-lg font-bold">Fee Breakdown</h3>
91
+ <h3 className={classes?.title || "text-as-primary text-lg font-bold"}>Fee Breakdown</h3>
90
92
  </div>
91
93
 
92
94
  {/* Base Fee Schedule Section */}
93
- <div className="bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-4">
94
- <h4 className="text-as-primary mb-3 text-sm font-semibold">
95
+ <div
96
+ className={classes?.tierCard || "bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-4"}
97
+ >
98
+ <h4 className={classes?.tierCardTitle || "text-as-primary mb-3 text-sm font-semibold"}>
95
99
  {isStripeFee ? "Fiat Fee Schedule" : "Base Fee Schedule"}
96
100
  </h4>
97
101
  <div className="space-y-1.5">
@@ -109,12 +113,15 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
109
113
  <div
110
114
  key={idx}
111
115
  className={cn(
112
- "flex items-center justify-between rounded-lg px-3 py-2.5 text-sm transition-colors",
113
- isCurrentTier ? "bg-as-brand/10 text-as-brand font-semibold" : "text-as-primary/60",
116
+ isCurrentTier
117
+ ? classes?.tierRowActive ||
118
+ "bg-as-brand/10 text-as-brand flex items-center justify-between rounded-lg px-3 py-2.5 text-sm font-semibold transition-colors"
119
+ : classes?.tierRow ||
120
+ "text-as-primary/60 flex items-center justify-between rounded-lg px-3 py-2.5 text-sm transition-colors",
114
121
  )}
115
122
  >
116
- <span>{tier.label}</span>
117
- <span>Credit Card Fee + {tier.fee}</span>
123
+ <span className={classes?.tierLabel}>{tier.label}</span>
124
+ <span className={classes?.tierValue}>Credit Card Fee + {tier.fee}</span>
118
125
  </div>
119
126
  );
120
127
  })
@@ -131,12 +138,15 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
131
138
  <div
132
139
  key={idx}
133
140
  className={cn(
134
- "flex items-center justify-between rounded-lg px-3 py-2.5 text-sm transition-colors",
135
- isCurrentTier ? "bg-as-brand/10 text-as-brand font-semibold" : "text-as-primary/60",
141
+ isCurrentTier
142
+ ? classes?.tierRowActive ||
143
+ "bg-as-brand/10 text-as-brand flex items-center justify-between rounded-lg px-3 py-2.5 text-sm font-semibold transition-colors"
144
+ : classes?.tierRow ||
145
+ "text-as-primary/60 flex items-center justify-between rounded-lg px-3 py-2.5 text-sm transition-colors",
136
146
  )}
137
147
  >
138
- <span>{tier.label}</span>
139
- <span>{bpsToPercent(tier.bps)}%</span>
148
+ <span className={classes?.tierLabel}>{tier.label}</span>
149
+ <span className={classes?.tierValue}>{bpsToPercent(tier.bps)}%</span>
140
150
  </div>
141
151
  );
142
152
  })}
@@ -154,7 +164,10 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
154
164
  return (
155
165
  <button
156
166
  onClick={() => setShowAllFeeTiers(!showAllFeeTiers)}
157
- className="text-as-primary/60 hover:text-as-primary mt-2 flex w-full items-center justify-center gap-1 text-xs transition-colors"
167
+ className={
168
+ classes?.expandButton ||
169
+ "text-as-primary/60 hover:text-as-primary mt-2 flex w-full items-center justify-center gap-1 text-xs transition-colors"
170
+ }
158
171
  >
159
172
  <span>{showAllFeeTiers ? "Show less" : "Show higher tiers"}</span>
160
173
  <ChevronDown className={cn("h-3.5 w-3.5 transition-transform", showAllFeeTiers && "rotate-180")} />
@@ -237,11 +250,17 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
237
250
 
238
251
  {/* Transaction Summary */}
239
252
  {transactionAmountUsd && (
240
- <div className="bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-4">
253
+ <div
254
+ className={
255
+ classes?.summaryCard || "bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-4"
256
+ }
257
+ >
241
258
  <div className="space-y-2 text-sm">
242
- <div className="flex items-center justify-between">
243
- <span className="text-as-secondary">Transaction</span>
244
- <span className="text-as-primary font-semibold">${transactionAmountUsd.toFixed(2)}</span>
259
+ <div className={classes?.summaryRow || "flex items-center justify-between"}>
260
+ <span className={classes?.summaryLabel || "text-as-secondary"}>Transaction</span>
261
+ <span className={classes?.summaryValue || "text-as-primary font-semibold"}>
262
+ ${transactionAmountUsd.toFixed(2)}
263
+ </span>
245
264
  </div>
246
265
 
247
266
  {isStripeFee && (
@@ -267,10 +286,10 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
267
286
  )}
268
287
  </span>
269
288
  </div>
270
- <div className="border-as-border-secondary border-t pt-2">
271
- <div className="flex items-center justify-between">
272
- <span className="text-as-primary font-semibold">Total Fee</span>
273
- <span className="text-as-brand font-semibold">
289
+ <div className={classes?.summaryDivider || "border-as-border-secondary border-t pt-2"}>
290
+ <div className={classes?.totalRow || "flex items-center justify-between"}>
291
+ <span className={classes?.totalLabel || "text-as-primary font-semibold"}>Total Fee</span>
292
+ <span className={classes?.totalValue || "text-as-brand font-semibold"}>
274
293
  ${((transactionAmountUsd * (fee.finalFeeBps || 0)) / 10000 + (fee.finalFeeUsd || 0)).toFixed(2)}
275
294
  </span>
276
295
  </div>
@@ -280,15 +299,17 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
280
299
 
281
300
  {!isStripeFee && currentCryptoTier && (
282
301
  <>
283
- <div className="flex items-center justify-between">
284
- <span className="text-as-secondary">Base Fee ({bpsToPercent(currentCryptoTier.bps)}%)</span>
285
- <span className="text-as-primary font-medium">
302
+ <div className={classes?.summaryRow || "flex items-center justify-between"}>
303
+ <span className={classes?.summaryLabel || "text-as-secondary"}>
304
+ Base Fee ({bpsToPercent(currentCryptoTier.bps)}%)
305
+ </span>
306
+ <span className={classes?.summaryValue || "text-as-primary font-medium"}>
286
307
  ${((transactionAmountUsd * currentCryptoTier.bps) / 10000).toFixed(2)}
287
308
  </span>
288
309
  </div>
289
310
 
290
311
  {hasWhaleDiscount && currentWhaleTier && (
291
- <div className="flex items-center justify-between">
312
+ <div className={classes?.summaryRow || "flex items-center justify-between"}>
292
313
  <span className="text-green-600">Discount ({currentWhaleTier.discountPercent}% off)</span>
293
314
  <span className="font-medium text-green-600">
294
315
  -$
@@ -298,7 +319,7 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
298
319
  )}
299
320
 
300
321
  {hasPartnerDiscount && (
301
- <div className="flex items-center justify-between">
322
+ <div className={classes?.summaryRow || "flex items-center justify-between"}>
302
323
  <span className="text-green-600">Partner Discount ({partnerDiscountPercent}% off)</span>
303
324
  <span className="font-medium text-green-600">
304
325
  -${((transactionAmountUsd * baseFee * partnerDiscountPercent) / 100 / 10000).toFixed(2)}
@@ -306,10 +327,10 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
306
327
  </div>
307
328
  )}
308
329
 
309
- <div className="border-as-border-secondary border-t pt-2">
310
- <div className="flex items-center justify-between">
311
- <span className="text-as-primary font-semibold">Total Fee</span>
312
- <span className="text-as-brand font-semibold">
330
+ <div className={classes?.summaryDivider || "border-as-border-secondary border-t pt-2"}>
331
+ <div className={classes?.totalRow || "flex items-center justify-between"}>
332
+ <span className={classes?.totalLabel || "text-as-primary font-semibold"}>Total Fee</span>
333
+ <span className={classes?.totalValue || "text-as-brand font-semibold"}>
313
334
  ${((transactionAmountUsd * fee.finalFeeBps) / 10000).toFixed(2)}
314
335
  </span>
315
336
  </div>
@@ -323,7 +344,7 @@ export function FeeDetailPanel({ fee, transactionAmountUsd, onBack }: FeeDetailP
323
344
  <ShinyButton
324
345
  accentColor={"hsl(var(--as-brand))"}
325
346
  onClick={onBack}
326
- className={cn("as-main-button !bg-as-brand relative w-full")}
347
+ className={classes?.backButton || cn("as-main-button !bg-as-brand relative w-full")}
327
348
  textClassName={cn("text-white")}
328
349
  >
329
350
  Back to {isStripeFee ? "Payment" : "Swap"}
@@ -3,6 +3,7 @@
3
3
  import { useGeoOnrampOptions } from "@b3dotfun/sdk/anyspend/react";
4
4
  import { cn } from "@b3dotfun/sdk/shared/utils/cn";
5
5
  import { ChevronLeft, ChevronRight, Loader2 } from "lucide-react";
6
+ import type { FiatPaymentMethodClasses } from "../types/classes";
6
7
 
7
8
  export enum FiatPaymentMethod {
8
9
  NONE = "none",
@@ -25,6 +26,7 @@ interface FiatPaymentMethodProps {
25
26
  onBack: () => void;
26
27
  onSelectPaymentMethod: (method: FiatPaymentMethod) => void;
27
28
  srcAmountOnRamp: string;
29
+ classes?: FiatPaymentMethodClasses;
28
30
  }
29
31
 
30
32
  export function FiatPaymentMethodComponent({
@@ -33,6 +35,7 @@ export function FiatPaymentMethodComponent({
33
35
  onBack,
34
36
  onSelectPaymentMethod,
35
37
  srcAmountOnRamp,
38
+ classes,
36
39
  }: FiatPaymentMethodProps) {
37
40
  // Load geo-based onramp options like in PanelOnramp
38
41
  const {
@@ -107,12 +110,15 @@ export function FiatPaymentMethodComponent({
107
110
  // Show loading state while checking geo availability
108
111
  if (isLoadingGeoOnramp) {
109
112
  return (
110
- <div className="fiat-payment-method mx-auto w-[460px] max-w-full p-5">
113
+ <div className={classes?.container || "fiat-payment-method mx-auto w-[460px] max-w-full p-5"}>
111
114
  <div className="flex flex-col gap-6">
112
- <div className="flex items-center gap-4">
115
+ <div className={classes?.header || "flex items-center gap-4"}>
113
116
  <button
114
117
  onClick={onBack}
115
- className="text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors"
118
+ className={
119
+ classes?.backButton ||
120
+ "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors"
121
+ }
116
122
  >
117
123
  <ChevronLeft className="h-6 w-6" />
118
124
  </button>
@@ -130,13 +136,16 @@ export function FiatPaymentMethodComponent({
130
136
  }
131
137
 
132
138
  return (
133
- <div className="fiat-payment-method mx-auto w-[460px] max-w-full p-5">
139
+ <div className={classes?.container || "fiat-payment-method mx-auto w-[460px] max-w-full p-5"}>
134
140
  <div className="flex flex-col gap-6">
135
141
  {/* Header */}
136
- <div className="flex items-center gap-4">
142
+ <div className={classes?.header || "flex items-center gap-4"}>
137
143
  <button
138
144
  onClick={onBack}
139
- className="text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors"
145
+ className={
146
+ classes?.backButton ||
147
+ "text-as-quaternary hover:text-as-primary flex h-8 w-8 items-center justify-center rounded-lg transition-colors"
148
+ }
140
149
  >
141
150
  <ChevronLeft className="h-6 w-6" />
142
151
  </button>
@@ -146,7 +155,7 @@ export function FiatPaymentMethodComponent({
146
155
  </div>
147
156
 
148
157
  {/* Payment Methods */}
149
- <div className="flex flex-col gap-3">
158
+ <div className={classes?.optionsList || "flex flex-col gap-3"}>
150
159
  {availablePaymentMethods.length === 0 ? (
151
160
  <div className="fiat-payment-method-no-methods bg-as-surface-secondary border-as-border-secondary rounded-2xl border p-6 text-center">
152
161
  <p className="text-as-secondary text-sm">
@@ -161,12 +170,16 @@ export function FiatPaymentMethodComponent({
161
170
  setSelectedPaymentMethod(method.id);
162
171
  onSelectPaymentMethod(method.id);
163
172
  }}
164
- className={cn(
165
- "fiat-payment-method-item bg-as-surface-secondary border-as-border-secondary flex w-full items-center gap-4 rounded-2xl border p-4 transition-all duration-200",
166
- selectedPaymentMethod === method.id
167
- ? "border-as-brand bg-as-brand/10"
168
- : "hover:border-as-brand/50 hover:bg-as-brand/5",
169
- )}
173
+ className={
174
+ (selectedPaymentMethod === method.id && classes?.optionItemActive) ||
175
+ classes?.optionItem ||
176
+ cn(
177
+ "fiat-payment-method-item bg-as-surface-secondary border-as-border-secondary flex w-full items-center gap-4 rounded-2xl border p-4 transition-all duration-200",
178
+ selectedPaymentMethod === method.id
179
+ ? "border-as-brand bg-as-brand/10"
180
+ : "hover:border-as-brand/50 hover:bg-as-brand/5",
181
+ )
182
+ }
170
183
  >
171
184
  {/* Icon - matching PanelOnramp style */}
172
185
  <div className="flex h-12 w-12 items-center justify-center rounded-full bg-blue-600 text-2xl text-white">
@@ -43,6 +43,7 @@ import { encodeFunctionData, erc20Abi } from "viem";
43
43
  import { b3 } from "viem/chains";
44
44
  import { useWaitForTransactionReceipt, useWalletClient } from "wagmi";
45
45
  import { usePhantomTransfer } from "../../hooks/usePhantomTransfer";
46
+ import type { OrderDetailsClasses } from "../types/classes";
46
47
  import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./Accordion";
47
48
  import ConnectWalletPayment from "./ConnectWalletPayment";
48
49
  import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
@@ -69,6 +70,8 @@ interface OrderDetailsProps {
69
70
  returnToHomeUrl?: string;
70
71
  /** Custom label for the return home button (overrides "Return to Home" / "Close") */
71
72
  returnHomeLabel?: string;
73
+ /** Custom class names for styling specific elements */
74
+ classes?: OrderDetailsClasses;
72
75
  }
73
76
 
74
77
  // Add this helper function near the top or just above the component
@@ -223,6 +226,7 @@ export const OrderDetails = memo(function OrderDetails({
223
226
  points,
224
227
  returnToHomeUrl,
225
228
  returnHomeLabel,
229
+ classes,
226
230
  }: OrderDetailsProps) {
227
231
  const router = useRouter();
228
232
  const searchParams = useSearchParams();
@@ -411,7 +415,10 @@ export const OrderDetails = memo(function OrderDetails({
411
415
  // Reusable "Return to Home" / "Close" button
412
416
  const returnHomeOrCloseButton = (
413
417
  <button
414
- className="order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white"
418
+ className={
419
+ classes?.returnButton ||
420
+ "order-close-button order-details-close-btn bg-as-brand flex w-full items-center justify-center gap-2 rounded-lg p-2 font-semibold text-white"
421
+ }
415
422
  onClick={returnToHomeUrl ? handleReturnToHome : mode === "page" ? handleBack : handleCloseModal}
416
423
  >
417
424
  {returnHomeLabel ? (
@@ -491,13 +498,11 @@ export const OrderDetails = memo(function OrderDetails({
491
498
  }
492
499
 
493
500
  const expectedDstAmount =
494
- order.type === "mint_nft" ||
495
- order.type === "join_tournament" ||
496
- order.type === "fund_tournament" ||
497
- order.type === "custom" ||
498
- order.type === "deposit_first"
501
+ order.type === "mint_nft" || order.type === "join_tournament" || order.type === "fund_tournament"
499
502
  ? "0"
500
- : order.payload.expectedDstAmount.toString();
503
+ : order.type === "custom" || order.type === "deposit_first"
504
+ ? order.payload.amount?.toString() || "0"
505
+ : order.payload.expectedDstAmount.toString();
501
506
  const formattedExpectedDstAmount = formatTokenAmount(BigInt(expectedDstAmount), dstToken.decimals);
502
507
 
503
508
  const actualDstAmount = order.settlement?.actualDstAmount;
@@ -918,7 +923,10 @@ export const OrderDetails = memo(function OrderDetails({
918
923
 
919
924
  {/* <DelayedSupportMessage /> */}
920
925
  <button
921
- className="text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline"
926
+ className={
927
+ classes?.backButton ||
928
+ "text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline"
929
+ }
922
930
  onClick={handleBack}
923
931
  >
924
932
  <RefreshCcw className="ml-2 h-4 w-4" /> Cancel and start over
@@ -1125,7 +1133,10 @@ export const OrderDetails = memo(function OrderDetails({
1125
1133
  )}
1126
1134
 
1127
1135
  <button
1128
- className="text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline"
1136
+ className={
1137
+ classes?.backButton ||
1138
+ "text-b3-primary-blue hover:text-b3-primary-blue/50 order-details-cancel-btn flex w-full items-center justify-center gap-2 underline"
1139
+ }
1129
1140
  onClick={handleBack}
1130
1141
  >
1131
1142
  <RefreshCcw className="ml-2 h-4 w-4" /> Cancel and start over