@whop/elements-react-native 0.1.0

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 (339) hide show
  1. package/README.md +179 -0
  2. package/android/build.gradle +64 -0
  3. package/android/consumer-rules.pro +3 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/java/com/whop/elements/WhopAddressSuggestionsModule.kt +102 -0
  6. package/android/src/main/java/com/whop/elements/WhopAuthSessionModule.kt +126 -0
  7. package/android/src/main/java/com/whop/elements/WhopElementsPackage.kt +39 -0
  8. package/android/src/main/java/com/whop/elements/WhopPayButtonManager.kt +74 -0
  9. package/android/src/main/java/com/whop/elements/WhopPayButtonPressEvent.kt +17 -0
  10. package/android/src/main/java/com/whop/elements/WhopPayButtonView.kt +178 -0
  11. package/android/src/main/java/com/whop/elements/WhopPlatformPayModule.kt +212 -0
  12. package/assets/whop-wordmark-dark.png +0 -0
  13. package/assets/whop-wordmark-dark@2x.png +0 -0
  14. package/assets/whop-wordmark-dark@3x.png +0 -0
  15. package/assets/whop-wordmark-light.png +0 -0
  16. package/assets/whop-wordmark-light@2x.png +0 -0
  17. package/assets/whop-wordmark-light@3x.png +0 -0
  18. package/ios/Package.swift +59 -0
  19. package/ios/Sources/ElementsReactNative/WhopAddressSuggestionsImpl.swift +189 -0
  20. package/ios/Sources/ElementsReactNative/WhopAuthSessionImpl.swift +106 -0
  21. package/ios/Sources/ElementsReactNative/WhopPayButtonImpl.swift +89 -0
  22. package/ios/Sources/ElementsReactNative/WhopPlatformPayImpl.swift +181 -0
  23. package/ios/generated/WhopAddressSuggestionsModule.h +11 -0
  24. package/ios/generated/WhopAddressSuggestionsModule.mm +46 -0
  25. package/ios/generated/WhopAuthSessionModule.h +11 -0
  26. package/ios/generated/WhopAuthSessionModule.mm +45 -0
  27. package/ios/generated/WhopElementsShims.h +35 -0
  28. package/ios/generated/WhopPayButtonComponentView.h +12 -0
  29. package/ios/generated/WhopPayButtonComponentView.mm +82 -0
  30. package/ios/generated/WhopPlatformPayModule.h +11 -0
  31. package/ios/generated/WhopPlatformPayModule.mm +51 -0
  32. package/lib/module/api/client.js +139 -0
  33. package/lib/module/api/client.js.map +1 -0
  34. package/lib/module/api/client.test.js +137 -0
  35. package/lib/module/api/client.test.js.map +1 -0
  36. package/lib/module/api/types.js +2 -0
  37. package/lib/module/api/types.js.map +1 -0
  38. package/lib/module/controller/actions.js +148 -0
  39. package/lib/module/controller/actions.js.map +1 -0
  40. package/lib/module/controller/actions.test.js +102 -0
  41. package/lib/module/controller/actions.test.js.map +1 -0
  42. package/lib/module/controller/store.js +158 -0
  43. package/lib/module/controller/store.js.map +1 -0
  44. package/lib/module/core/address/country-data.js +1370 -0
  45. package/lib/module/core/address/country-data.js.map +1 -0
  46. package/lib/module/core/address/country-name.js +38 -0
  47. package/lib/module/core/address/country-name.js.map +1 -0
  48. package/lib/module/core/address/country-names.generated.js +249 -0
  49. package/lib/module/core/address/country-names.generated.js.map +1 -0
  50. package/lib/module/core/address/engine.js +245 -0
  51. package/lib/module/core/address/engine.js.map +1 -0
  52. package/lib/module/core/address/engine.test.js +216 -0
  53. package/lib/module/core/address/engine.test.js.map +1 -0
  54. package/lib/module/core/address/form-state.js +409 -0
  55. package/lib/module/core/address/form-state.js.map +1 -0
  56. package/lib/module/core/address/form-state.test.js +516 -0
  57. package/lib/module/core/address/form-state.test.js.map +1 -0
  58. package/lib/module/core/address/places.js +36 -0
  59. package/lib/module/core/address/places.js.map +1 -0
  60. package/lib/module/core/address/required-coverage.test.js +57 -0
  61. package/lib/module/core/address/required-coverage.test.js.map +1 -0
  62. package/lib/module/core/address/suggest.js +102 -0
  63. package/lib/module/core/address/suggest.js.map +1 -0
  64. package/lib/module/core/address/suggest.test.js +156 -0
  65. package/lib/module/core/address/suggest.test.js.map +1 -0
  66. package/lib/module/core/address/use-suggestions.js +33 -0
  67. package/lib/module/core/address/use-suggestions.js.map +1 -0
  68. package/lib/module/core/payments/address-change.js +91 -0
  69. package/lib/module/core/payments/address-change.js.map +1 -0
  70. package/lib/module/core/payments/billing-merge.js +62 -0
  71. package/lib/module/core/payments/billing-merge.js.map +1 -0
  72. package/lib/module/core/payments/browser-info.js +42 -0
  73. package/lib/module/core/payments/browser-info.js.map +1 -0
  74. package/lib/module/core/payments/bt.js +151 -0
  75. package/lib/module/core/payments/bt.js.map +1 -0
  76. package/lib/module/core/payments/bt.test.js +23 -0
  77. package/lib/module/core/payments/bt.test.js.map +1 -0
  78. package/lib/module/core/payments/currency.js +37 -0
  79. package/lib/module/core/payments/currency.js.map +1 -0
  80. package/lib/module/core/payments/detail.js +159 -0
  81. package/lib/module/core/payments/detail.js.map +1 -0
  82. package/lib/module/core/payments/detail.test.js +225 -0
  83. package/lib/module/core/payments/detail.test.js.map +1 -0
  84. package/lib/module/core/payments/errors.js +115 -0
  85. package/lib/module/core/payments/errors.js.map +1 -0
  86. package/lib/module/core/payments/mint.js +89 -0
  87. package/lib/module/core/payments/mint.js.map +1 -0
  88. package/lib/module/core/payments/plan.js +131 -0
  89. package/lib/module/core/payments/plan.js.map +1 -0
  90. package/lib/module/core/payments/refusals.js +17 -0
  91. package/lib/module/core/payments/refusals.js.map +1 -0
  92. package/lib/module/core/payments/secure-fields.js +87 -0
  93. package/lib/module/core/payments/secure-fields.js.map +1 -0
  94. package/lib/module/core/payments/tax-id-catalog.js +616 -0
  95. package/lib/module/core/payments/tax-id-catalog.js.map +1 -0
  96. package/lib/module/core/payments/wallet-contact.js +42 -0
  97. package/lib/module/core/payments/wallet-contact.js.map +1 -0
  98. package/lib/module/core/payments/wallet-contact.test.js +77 -0
  99. package/lib/module/core/payments/wallet-contact.test.js.map +1 -0
  100. package/lib/module/elements/address.js +467 -0
  101. package/lib/module/elements/address.js.map +1 -0
  102. package/lib/module/elements/branding.js +114 -0
  103. package/lib/module/elements/branding.js.map +1 -0
  104. package/lib/module/elements/card-fields/context.js +254 -0
  105. package/lib/module/elements/card-fields/context.js.map +1 -0
  106. package/lib/module/elements/card-fields/fields.js +309 -0
  107. package/lib/module/elements/card-fields/fields.js.map +1 -0
  108. package/lib/module/elements/card-fields/index.js +30 -0
  109. package/lib/module/elements/card-fields/index.js.map +1 -0
  110. package/lib/module/elements/card.js +107 -0
  111. package/lib/module/elements/card.js.map +1 -0
  112. package/lib/module/elements/email.js +84 -0
  113. package/lib/module/elements/email.js.map +1 -0
  114. package/lib/module/elements/payment/declared-fields.js +186 -0
  115. package/lib/module/elements/payment/declared-fields.js.map +1 -0
  116. package/lib/module/elements/payment/index.js +448 -0
  117. package/lib/module/elements/payment/index.js.map +1 -0
  118. package/lib/module/elements/payment/wallet.js +132 -0
  119. package/lib/module/elements/payment/wallet.js.map +1 -0
  120. package/lib/module/elements/tax-id.js +100 -0
  121. package/lib/module/elements/tax-id.js.map +1 -0
  122. package/lib/module/i18n/catalogs.js +103 -0
  123. package/lib/module/i18n/catalogs.js.map +1 -0
  124. package/lib/module/i18n/index.js +45 -0
  125. package/lib/module/i18n/index.js.map +1 -0
  126. package/lib/module/index.js +27 -0
  127. package/lib/module/index.js.map +1 -0
  128. package/lib/module/namespace.js +174 -0
  129. package/lib/module/namespace.js.map +1 -0
  130. package/lib/module/native/index.js +128 -0
  131. package/lib/module/native/index.js.map +1 -0
  132. package/lib/module/package.json +1 -0
  133. package/lib/module/provider.js +56 -0
  134. package/lib/module/provider.js.map +1 -0
  135. package/lib/module/specs/NativeWhopAddressSuggestions.js +6 -0
  136. package/lib/module/specs/NativeWhopAddressSuggestions.js.map +1 -0
  137. package/lib/module/specs/NativeWhopAuthSession.js +10 -0
  138. package/lib/module/specs/NativeWhopAuthSession.js.map +1 -0
  139. package/lib/module/specs/NativeWhopPlatformPay.js +10 -0
  140. package/lib/module/specs/NativeWhopPlatformPay.js.map +1 -0
  141. package/lib/module/specs/WhopPayButtonNativeComponent.ts +22 -0
  142. package/lib/module/theme/appearance.js +85 -0
  143. package/lib/module/theme/appearance.js.map +1 -0
  144. package/lib/module/theme/appearance.test.js +124 -0
  145. package/lib/module/theme/appearance.test.js.map +1 -0
  146. package/lib/module/theme/provider.js +25 -0
  147. package/lib/module/theme/provider.js.map +1 -0
  148. package/lib/module/theme/resolve.js +69 -0
  149. package/lib/module/theme/resolve.js.map +1 -0
  150. package/lib/module/theme/scales.generated.js +419 -0
  151. package/lib/module/theme/scales.generated.js.map +1 -0
  152. package/lib/module/ui/element-frame.js +83 -0
  153. package/lib/module/ui/element-frame.js.map +1 -0
  154. package/lib/module/ui/payment-method-icon.js +69 -0
  155. package/lib/module/ui/payment-method-icon.js.map +1 -0
  156. package/lib/module/ui/primitives.js +266 -0
  157. package/lib/module/ui/primitives.js.map +1 -0
  158. package/lib/module/ui/select.js +281 -0
  159. package/lib/module/ui/select.js.map +1 -0
  160. package/lib/module/ui/suggestions.js +71 -0
  161. package/lib/module/ui/suggestions.js.map +1 -0
  162. package/lib/module/ui/whop-logo.js +42 -0
  163. package/lib/module/ui/whop-logo.js.map +1 -0
  164. package/lib/typescript/package.json +1 -0
  165. package/lib/typescript/src/api/client.d.ts +87 -0
  166. package/lib/typescript/src/api/client.d.ts.map +1 -0
  167. package/lib/typescript/src/api/types.d.ts +175 -0
  168. package/lib/typescript/src/api/types.d.ts.map +1 -0
  169. package/lib/typescript/src/controller/actions.d.ts +42 -0
  170. package/lib/typescript/src/controller/actions.d.ts.map +1 -0
  171. package/lib/typescript/src/controller/store.d.ts +90 -0
  172. package/lib/typescript/src/controller/store.d.ts.map +1 -0
  173. package/lib/typescript/src/core/address/country-data.d.ts +4 -0
  174. package/lib/typescript/src/core/address/country-data.d.ts.map +1 -0
  175. package/lib/typescript/src/core/address/country-name.d.ts +2 -0
  176. package/lib/typescript/src/core/address/country-name.d.ts.map +1 -0
  177. package/lib/typescript/src/core/address/country-names.generated.d.ts +2 -0
  178. package/lib/typescript/src/core/address/country-names.generated.d.ts.map +1 -0
  179. package/lib/typescript/src/core/address/engine.d.ts +97 -0
  180. package/lib/typescript/src/core/address/engine.d.ts.map +1 -0
  181. package/lib/typescript/src/core/address/form-state.d.ts +144 -0
  182. package/lib/typescript/src/core/address/form-state.d.ts.map +1 -0
  183. package/lib/typescript/src/core/address/places.d.ts +23 -0
  184. package/lib/typescript/src/core/address/places.d.ts.map +1 -0
  185. package/lib/typescript/src/core/address/suggest.d.ts +47 -0
  186. package/lib/typescript/src/core/address/suggest.d.ts.map +1 -0
  187. package/lib/typescript/src/core/address/use-suggestions.d.ts +3 -0
  188. package/lib/typescript/src/core/address/use-suggestions.d.ts.map +1 -0
  189. package/lib/typescript/src/core/payments/address-change.d.ts +52 -0
  190. package/lib/typescript/src/core/payments/address-change.d.ts.map +1 -0
  191. package/lib/typescript/src/core/payments/billing-merge.d.ts +39 -0
  192. package/lib/typescript/src/core/payments/billing-merge.d.ts.map +1 -0
  193. package/lib/typescript/src/core/payments/browser-info.d.ts +12 -0
  194. package/lib/typescript/src/core/payments/browser-info.d.ts.map +1 -0
  195. package/lib/typescript/src/core/payments/bt.d.ts +55 -0
  196. package/lib/typescript/src/core/payments/bt.d.ts.map +1 -0
  197. package/lib/typescript/src/core/payments/currency.d.ts +7 -0
  198. package/lib/typescript/src/core/payments/currency.d.ts.map +1 -0
  199. package/lib/typescript/src/core/payments/detail.d.ts +53 -0
  200. package/lib/typescript/src/core/payments/detail.d.ts.map +1 -0
  201. package/lib/typescript/src/core/payments/errors.d.ts +62 -0
  202. package/lib/typescript/src/core/payments/errors.d.ts.map +1 -0
  203. package/lib/typescript/src/core/payments/mint.d.ts +74 -0
  204. package/lib/typescript/src/core/payments/mint.d.ts.map +1 -0
  205. package/lib/typescript/src/core/payments/plan.d.ts +69 -0
  206. package/lib/typescript/src/core/payments/plan.d.ts.map +1 -0
  207. package/lib/typescript/src/core/payments/refusals.d.ts +12 -0
  208. package/lib/typescript/src/core/payments/refusals.d.ts.map +1 -0
  209. package/lib/typescript/src/core/payments/secure-fields.d.ts +33 -0
  210. package/lib/typescript/src/core/payments/secure-fields.d.ts.map +1 -0
  211. package/lib/typescript/src/core/payments/tax-id-catalog.d.ts +481 -0
  212. package/lib/typescript/src/core/payments/tax-id-catalog.d.ts.map +1 -0
  213. package/lib/typescript/src/core/payments/wallet-contact.d.ts +40 -0
  214. package/lib/typescript/src/core/payments/wallet-contact.d.ts.map +1 -0
  215. package/lib/typescript/src/elements/address.d.ts +55 -0
  216. package/lib/typescript/src/elements/address.d.ts.map +1 -0
  217. package/lib/typescript/src/elements/branding.d.ts +18 -0
  218. package/lib/typescript/src/elements/branding.d.ts.map +1 -0
  219. package/lib/typescript/src/elements/card-fields/context.d.ts +67 -0
  220. package/lib/typescript/src/elements/card-fields/context.d.ts.map +1 -0
  221. package/lib/typescript/src/elements/card-fields/fields.d.ts +15 -0
  222. package/lib/typescript/src/elements/card-fields/fields.d.ts.map +1 -0
  223. package/lib/typescript/src/elements/card-fields/index.d.ts +21 -0
  224. package/lib/typescript/src/elements/card-fields/index.d.ts.map +1 -0
  225. package/lib/typescript/src/elements/card.d.ts +21 -0
  226. package/lib/typescript/src/elements/card.d.ts.map +1 -0
  227. package/lib/typescript/src/elements/email.d.ts +31 -0
  228. package/lib/typescript/src/elements/email.d.ts.map +1 -0
  229. package/lib/typescript/src/elements/payment/declared-fields.d.ts +43 -0
  230. package/lib/typescript/src/elements/payment/declared-fields.d.ts.map +1 -0
  231. package/lib/typescript/src/elements/payment/index.d.ts +37 -0
  232. package/lib/typescript/src/elements/payment/index.d.ts.map +1 -0
  233. package/lib/typescript/src/elements/payment/wallet.d.ts +39 -0
  234. package/lib/typescript/src/elements/payment/wallet.d.ts.map +1 -0
  235. package/lib/typescript/src/elements/tax-id.d.ts +41 -0
  236. package/lib/typescript/src/elements/tax-id.d.ts.map +1 -0
  237. package/lib/typescript/src/i18n/catalogs.d.ts +7 -0
  238. package/lib/typescript/src/i18n/catalogs.d.ts.map +1 -0
  239. package/lib/typescript/src/i18n/index.d.ts +17 -0
  240. package/lib/typescript/src/i18n/index.d.ts.map +1 -0
  241. package/lib/typescript/src/index.d.ts +42 -0
  242. package/lib/typescript/src/index.d.ts.map +1 -0
  243. package/lib/typescript/src/namespace.d.ts +36 -0
  244. package/lib/typescript/src/namespace.d.ts.map +1 -0
  245. package/lib/typescript/src/native/index.d.ts +62 -0
  246. package/lib/typescript/src/native/index.d.ts.map +1 -0
  247. package/lib/typescript/src/provider.d.ts +37 -0
  248. package/lib/typescript/src/provider.d.ts.map +1 -0
  249. package/lib/typescript/src/specs/NativeWhopAddressSuggestions.d.ts +13 -0
  250. package/lib/typescript/src/specs/NativeWhopAddressSuggestions.d.ts.map +1 -0
  251. package/lib/typescript/src/specs/NativeWhopAuthSession.d.ts +20 -0
  252. package/lib/typescript/src/specs/NativeWhopAuthSession.d.ts.map +1 -0
  253. package/lib/typescript/src/specs/NativeWhopPlatformPay.d.ts +24 -0
  254. package/lib/typescript/src/specs/NativeWhopPlatformPay.d.ts.map +1 -0
  255. package/lib/typescript/src/specs/WhopPayButtonNativeComponent.d.ts +21 -0
  256. package/lib/typescript/src/specs/WhopPayButtonNativeComponent.d.ts.map +1 -0
  257. package/lib/typescript/src/theme/appearance.d.ts +71 -0
  258. package/lib/typescript/src/theme/appearance.d.ts.map +1 -0
  259. package/lib/typescript/src/theme/provider.d.ts +11 -0
  260. package/lib/typescript/src/theme/provider.d.ts.map +1 -0
  261. package/lib/typescript/src/theme/resolve.d.ts +19 -0
  262. package/lib/typescript/src/theme/resolve.d.ts.map +1 -0
  263. package/lib/typescript/src/theme/scales.generated.d.ts +18 -0
  264. package/lib/typescript/src/theme/scales.generated.d.ts.map +1 -0
  265. package/lib/typescript/src/ui/element-frame.d.ts +32 -0
  266. package/lib/typescript/src/ui/element-frame.d.ts.map +1 -0
  267. package/lib/typescript/src/ui/payment-method-icon.d.ts +21 -0
  268. package/lib/typescript/src/ui/payment-method-icon.d.ts.map +1 -0
  269. package/lib/typescript/src/ui/primitives.d.ts +94 -0
  270. package/lib/typescript/src/ui/primitives.d.ts.map +1 -0
  271. package/lib/typescript/src/ui/select.d.ts +25 -0
  272. package/lib/typescript/src/ui/select.d.ts.map +1 -0
  273. package/lib/typescript/src/ui/suggestions.d.ts +15 -0
  274. package/lib/typescript/src/ui/suggestions.d.ts.map +1 -0
  275. package/lib/typescript/src/ui/whop-logo.d.ts +4 -0
  276. package/lib/typescript/src/ui/whop-logo.d.ts.map +1 -0
  277. package/package.json +121 -0
  278. package/scripts/check-swift.sh +27 -0
  279. package/scripts/codegen-shims.mjs +409 -0
  280. package/scripts/gen-country-names.mjs +58 -0
  281. package/scripts/gen-theme.mjs +124 -0
  282. package/scripts/gen-wordmark.mjs +68 -0
  283. package/scripts/mirror.mjs +112 -0
  284. package/src/api/client.ts +202 -0
  285. package/src/api/types.ts +166 -0
  286. package/src/controller/actions.ts +197 -0
  287. package/src/controller/store.ts +201 -0
  288. package/src/core/address/country-data.ts +927 -0
  289. package/src/core/address/country-name.ts +36 -0
  290. package/src/core/address/country-names.generated.ts +246 -0
  291. package/src/core/address/engine.ts +349 -0
  292. package/src/core/address/form-state.ts +479 -0
  293. package/src/core/address/places.ts +39 -0
  294. package/src/core/address/suggest.ts +153 -0
  295. package/src/core/address/use-suggestions.ts +37 -0
  296. package/src/core/payments/address-change.ts +121 -0
  297. package/src/core/payments/billing-merge.ts +91 -0
  298. package/src/core/payments/browser-info.ts +43 -0
  299. package/src/core/payments/bt.ts +176 -0
  300. package/src/core/payments/currency.ts +54 -0
  301. package/src/core/payments/detail.ts +204 -0
  302. package/src/core/payments/errors.ts +171 -0
  303. package/src/core/payments/mint.ts +130 -0
  304. package/src/core/payments/plan.ts +198 -0
  305. package/src/core/payments/refusals.ts +24 -0
  306. package/src/core/payments/secure-fields.ts +85 -0
  307. package/src/core/payments/tax-id-catalog.ts +320 -0
  308. package/src/core/payments/wallet-contact.ts +56 -0
  309. package/src/elements/address.tsx +570 -0
  310. package/src/elements/branding.tsx +87 -0
  311. package/src/elements/card-fields/context.tsx +310 -0
  312. package/src/elements/card-fields/fields.tsx +281 -0
  313. package/src/elements/card-fields/index.tsx +37 -0
  314. package/src/elements/card.tsx +101 -0
  315. package/src/elements/email.tsx +100 -0
  316. package/src/elements/payment/declared-fields.tsx +238 -0
  317. package/src/elements/payment/index.tsx +497 -0
  318. package/src/elements/payment/wallet.tsx +155 -0
  319. package/src/elements/tax-id.tsx +143 -0
  320. package/src/i18n/catalogs.ts +100 -0
  321. package/src/i18n/index.tsx +46 -0
  322. package/src/index.ts +68 -0
  323. package/src/namespace.tsx +231 -0
  324. package/src/native/index.ts +173 -0
  325. package/src/provider.tsx +76 -0
  326. package/src/specs/NativeWhopAddressSuggestions.ts +14 -0
  327. package/src/specs/NativeWhopAuthSession.ts +21 -0
  328. package/src/specs/NativeWhopPlatformPay.ts +25 -0
  329. package/src/specs/WhopPayButtonNativeComponent.ts +22 -0
  330. package/src/theme/appearance.ts +150 -0
  331. package/src/theme/provider.tsx +28 -0
  332. package/src/theme/resolve.ts +68 -0
  333. package/src/theme/scales.generated.ts +427 -0
  334. package/src/ui/element-frame.tsx +94 -0
  335. package/src/ui/payment-method-icon.tsx +55 -0
  336. package/src/ui/primitives.tsx +269 -0
  337. package/src/ui/select.tsx +255 -0
  338. package/src/ui/suggestions.tsx +69 -0
  339. package/src/ui/whop-logo.tsx +37 -0
@@ -0,0 +1,71 @@
1
+ import type { TextStyle, ViewStyle } from 'react-native';
2
+ import { ACCENT_NAMES, GRAY_NAMES } from './scales.generated.js';
3
+ /**
4
+ * Copied from frontend/packages/elements-framework/src/builder/appearance/types.ts so an appearance
5
+ * object written for the web elements types identically here.
6
+ */
7
+ export type AccentColor = (typeof ACCENT_NAMES)[number];
8
+ export type GrayColor = (typeof GRAY_NAMES)[number] | 'auto';
9
+ export type Theme = {
10
+ appearance?: 'light' | 'dark';
11
+ accentColor?: AccentColor;
12
+ grayColor?: GrayColor;
13
+ dangerColor?: 'ruby' | 'red' | 'tomato';
14
+ warningColor?: 'yellow' | 'amber';
15
+ successColor?: 'green' | 'teal' | 'jade' | 'grass';
16
+ infoColor?: 'sky' | 'blue';
17
+ };
18
+ /**
19
+ * The web's `variables` are CSS custom properties, which React Native has no analogue for. `tokens`
20
+ * is the closed, typed replacement: numbers rather than `"8px"` strings, because there are no units
21
+ * here.
22
+ */
23
+ export interface Tokens {
24
+ radius: number;
25
+ spacing: number;
26
+ fontSize: number;
27
+ labelFontSize: number;
28
+ borderWidth: number;
29
+ controlHeight: number;
30
+ fontFamily: string | undefined;
31
+ }
32
+ /**
33
+ * The web's `classes` are CSS declarations keyed by `whop-*` part names. `parts` is the same idea
34
+ * with React Native style objects instead: flat per-part overrides applied after the theme, with no
35
+ * cascade, no pseudo-classes and no combinators.
36
+ *
37
+ * Names follow the web's wherever the two surfaces mean the same thing — `whop-PaymentMethodTile`,
38
+ * `whop-PaymentMethodDetail`, `whop-PaymentMethodRowSelected`, `whop-CardFieldGroup`. They diverge
39
+ * only where the surfaces genuinely differ, in three ways:
40
+ *
41
+ * - This surface is MORE granular in places: `whop-CardNumberField`, `whop-CardExpiryField` and
42
+ * `whop-CardCvcField` are separately themeable where the web has one `whop-CardFieldInput`.
43
+ * - It is generic where the web is per-element: one `whop-Input` / `whop-Label` / `whop-ErrorText`
44
+ * serves every field, where the web publishes `whop-PaymentFieldInput`, `whop-EmailInput`,
45
+ * `whop-TaxIdInput` and so on. Matching that would mean adding parts, not renaming them.
46
+ * - Some parts have no web counterpart at all: `whop-Sheet` and `whop-SheetRow` (the web uses a
47
+ * dropdown, not a bottom sheet) and `whop-AddressSuggestions`.
48
+ *
49
+ * So a web appearance object does not port across wholesale, and the parts that do not match are
50
+ * the ones where the web has nothing to match.
51
+ */
52
+ export type Parts = Partial<Record<PartName, ViewStyle & TextStyle>>;
53
+ export type PartName = 'whop-Root' | 'whop-Label' | 'whop-Input' | 'whop-InputFocused' | 'whop-InputInvalid' | 'whop-ErrorText' | 'whop-HelperText' | 'whop-Select' | 'whop-SelectValue' | 'whop-Sheet' | 'whop-SheetRow' | 'whop-CardNumberField' | 'whop-CardExpiryField' | 'whop-CardCvcField' | 'whop-CardFieldGroup' | 'whop-AddressCountrySelect' | 'whop-AddressSuggestions' | 'whop-AddressSuggestion' | 'whop-AddressRow' | 'whop-PaymentMethodTile' | 'whop-PaymentMethodRowSelected' | 'whop-MethodTileLabel' | 'whop-PaymentMethodDetail' | 'whop-Branding' | 'whop-BrandingLink' | 'whop-Skeleton';
54
+ export type Appearance = {
55
+ theme?: Theme | null;
56
+ tokens?: Partial<Tokens> | null;
57
+ parts?: Parts | null;
58
+ /** @deprecated CSS custom properties do not exist on React Native. Use `tokens`. */
59
+ variables?: never;
60
+ /** @deprecated CSS declarations do not exist on React Native. Use `parts`. */
61
+ classes?: never;
62
+ };
63
+ /** An unknown value falls back rather than throwing, matching `parse-theme.ts`. */
64
+ export declare function parseTheme(theme?: Theme | null): Theme;
65
+ /**
66
+ * A silently-ignored style object is the worst failure available here, so a web appearance passed
67
+ * unchanged is refused by name rather than dropped.
68
+ */
69
+ export declare function assertNativeAppearance(appearance: Appearance | undefined): void;
70
+ export declare const DEFAULT_TOKENS: Tokens;
71
+ //# sourceMappingURL=appearance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../../../src/theme/appearance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAoB,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AACxD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAE7D,MAAM,MAAM,KAAK,GAAG;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IACxC,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACnD,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC3B,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;AAErE,MAAM,MAAM,QAAQ,GACjB,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,mBAAmB,GACnB,mBAAmB,GACnB,gBAAgB,GAChB,iBAAiB,GACjB,aAAa,GACb,kBAAkB,GAClB,YAAY,GACZ,eAAe,GACf,sBAAsB,GACtB,sBAAsB,GACtB,mBAAmB,GACnB,qBAAqB,GACrB,2BAA2B,GAC3B,yBAAyB,GACzB,wBAAwB,GACxB,iBAAiB,GACjB,wBAAwB,GACxB,+BAA+B,GAC/B,sBAAsB,GACtB,0BAA0B,GAC1B,eAAe,GACf,mBAAmB,GACnB,eAAe,CAAC;AAEnB,MAAM,MAAM,UAAU,GAAG;IACxB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,oFAAoF;IACpF,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,KAAK,CAAC;CAChB,CAAC;AAYF,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,KAAK,CAatD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,IAAI,CAa/E;AAED,eAAO,MAAM,cAAc,EAAE,MAQ5B,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { Appearance } from './appearance.js';
3
+ import { type ResolvedTheme } from './resolve.js';
4
+ export declare function ThemeProvider({ appearance, children, }: {
5
+ appearance?: Appearance | null;
6
+ children: ReactNode;
7
+ }): ReactNode;
8
+ export declare function useTheme(): ResolvedTheme;
9
+ export { alphaStep, resolveTheme, step } from './resolve.js';
10
+ export type { ResolvedTheme } from './resolve.js';
11
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/theme/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAG3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAc,CAAC;AAC/C,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,cAAW,CAAC;AAI7D,wBAAgB,aAAa,CAAC,EAC7B,UAAU,EACV,QAAQ,GACR,EAAE;IACF,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACpB,GAAG,SAAS,CAIZ;AAED,wBAAgB,QAAQ,IAAI,aAAa,CAIxC;AAED,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,cAAW,CAAC;AAC1D,YAAY,EAAE,aAAa,EAAE,MAAM,cAAW,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type Appearance, type Parts, type Tokens } from './appearance.js';
2
+ import { type ColorScales } from './scales.generated.js';
3
+ export interface ResolvedTheme {
4
+ mode: 'light' | 'dark';
5
+ accent: ColorScales;
6
+ gray: ColorScales;
7
+ danger: ColorScales;
8
+ warning: ColorScales;
9
+ success: ColorScales;
10
+ info: ColorScales;
11
+ tokens: Tokens;
12
+ parts: Parts;
13
+ }
14
+ export declare function resolveTheme(appearance: Appearance | undefined, system: 'light' | 'dark'): ResolvedTheme;
15
+ /** Radix scales are 1-indexed in their own docs; keeping that here makes call sites read like the
16
+ * design tokens they mirror. */
17
+ export declare function step(scale: ColorScales, n: number): string;
18
+ export declare function alphaStep(scale: ColorScales, n: number): string;
19
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../src/theme/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,EAEf,KAAK,KAAK,EAGV,KAAK,MAAM,EACX,MAAM,iBAAc,CAAC;AACtB,OAAO,EAAiB,KAAK,WAAW,EAAe,MAAM,uBAAoB,CAAC;AAElF,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;CACb;AAWD,wBAAgB,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,aAAa,CAsBxG;AAMD;iCACiC;AACjC,wBAAgB,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/D"}
@@ -0,0 +1,18 @@
1
+ export type Scale = readonly [string, string, string, string, string, string, string, string, string, string, string, string];
2
+ export interface ColorScales {
3
+ solid: Scale;
4
+ alpha: Scale;
5
+ /** Text that sits on step 9. */
6
+ contrast: string;
7
+ }
8
+ export declare const ACCENT_SCALES: Record<string, {
9
+ light: ColorScales;
10
+ dark: ColorScales;
11
+ }>;
12
+ export declare const GRAY_SCALES: Record<string, {
13
+ light: ColorScales;
14
+ dark: ColorScales;
15
+ }>;
16
+ export declare const ACCENT_NAMES: readonly ["ruby", "blue", "red", "yellow", "green", "gray", "tomato", "crimson", "pink", "plum", "purple", "violet", "iris", "cyan", "teal", "jade", "grass", "brown", "orange", "indigo", "sky", "mint", "amber", "lime", "lemon", "magenta", "gold", "bronze"];
17
+ export declare const GRAY_NAMES: readonly ["gray", "mauve", "slate", "sage", "olive", "sand"];
18
+ //# sourceMappingURL=scales.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scales.generated.d.ts","sourceRoot":"","sources":["../../../../src/theme/scales.generated.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9H,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,CAiVnF,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,CAyEjF,CAAC;AAEF,eAAO,MAAM,YAAY,kQAAmQ,CAAC;AAC7R,eAAO,MAAM,UAAU,8DAA+D,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type StyleProp, type ViewStyle } from 'react-native';
3
+ export interface ElementFrameProps {
4
+ style?: StyleProp<ViewStyle>;
5
+ fallback?: ReactNode;
6
+ /** The element's own skeleton, shown when no `fallback` was given. */
7
+ skeleton: ReactNode;
8
+ /** True once the element's live content has committed. */
9
+ ready: boolean;
10
+ error?: {
11
+ message: string;
12
+ code?: string;
13
+ } | null;
14
+ onReady?: () => void;
15
+ onError?: (error: {
16
+ message: string;
17
+ code?: string;
18
+ }) => void;
19
+ children: ReactNode;
20
+ }
21
+ /**
22
+ * The mount shell every element shares: skeleton, grouped-loading latch, fallback swap, error face.
23
+ *
24
+ * A held element stays mounted and laid out at zero opacity rather than being unmounted or
25
+ * `display: none`d, because the Basis Theory fields measure themselves on mount — a collapsed field
26
+ * initializes at 0x0 and pops when it is revealed.
27
+ *
28
+ * A terminal error settles the ready state too: the element is showing its error face, and a
29
+ * fallback that kept hiding it would bury the failure forever.
30
+ */
31
+ export declare function ElementFrame({ style, fallback, skeleton, ready, error, onReady, onError, children, }: ElementFrameProps): import("react/jsx-runtime").JSX.Element;
32
+ //# sourceMappingURL=element-frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-frame.d.ts","sourceRoot":"","sources":["../../../../src/ui/element-frame.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,KAAK,SAAS,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKhF,MAAM,WAAW,iBAAiB;IACjC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,sEAAsE;IACtE,QAAQ,EAAE,SAAS,CAAC;IACpB,0DAA0D;IAC1D,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC9D,QAAQ,EAAE,SAAS,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,QAAQ,GACR,EAAE,iBAAiB,2CAmDnB"}
@@ -0,0 +1,21 @@
1
+ import { type ImageStyle, type StyleProp } from 'react-native';
2
+ import type { PaymentMethodIcons } from '../api/types.js';
3
+ /**
4
+ * A method's brand art.
5
+ *
6
+ * The API serves each shape as an SVG plus a 1x/2x/4x raster set, and this draws the RASTERS: the
7
+ * SVG would need a native peer, and every candidate ships CocoaPods-only, which is the one thing
8
+ * this package cannot take on. Handing `Image` all three densities lets it pick the sharpest file
9
+ * for the box it is drawn in.
10
+ *
11
+ * Each entry carries `width` and `height`, not `scale`: those are what the multi-source picker
12
+ * measures against, and Android's `RCTImageView` throws `null width` on an entry without them.
13
+ */
14
+ export declare function PaymentMethodIcon({ icons, shape, size, style, }: {
15
+ icons: PaymentMethodIcons | null | undefined;
16
+ shape?: 'square' | 'card';
17
+ /** Rendered height; width follows the shape's ratio. */
18
+ size?: number;
19
+ style?: StyleProp<ImageStyle>;
20
+ }): import("react/jsx-runtime").JSX.Element | null;
21
+ //# sourceMappingURL=payment-method-icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-method-icon.d.ts","sourceRoot":"","sources":["../../../../src/ui/payment-method-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAc,CAAC;AAOvD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,EACjC,KAAK,EACL,KAAgB,EAChB,IAAS,EACT,KAAK,GACL,EAAE;IACF,KAAK,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7C,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC1B,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;CAC9B,kDAuBA"}
@@ -0,0 +1,94 @@
1
+ import { type ComponentRef, type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from 'react';
2
+ import { TextInput, type TextInputProps, type TextStyle, type ViewStyle } from 'react-native';
3
+ import type { PartName } from '../theme/appearance.js';
4
+ import { type ResolvedTheme } from '../theme/provider.js';
5
+ /** Merge the theme's per-part override in last, so a consumer's `parts` entry always wins. */
6
+ export declare function part(theme: ResolvedTheme, name: PartName): ViewStyle & TextStyle;
7
+ export declare function useFieldStyles(): {
8
+ theme: ResolvedTheme;
9
+ container: {
10
+ gap: number;
11
+ };
12
+ label: {
13
+ fontSize: number;
14
+ fontFamily: string | undefined;
15
+ color: string;
16
+ fontWeight: "500";
17
+ };
18
+ box: (state: {
19
+ focused: boolean;
20
+ invalid: boolean;
21
+ disabled: boolean;
22
+ }) => ViewStyle;
23
+ input: {
24
+ fontSize: number;
25
+ fontFamily: string | undefined;
26
+ color: string;
27
+ paddingVertical: number;
28
+ paddingHorizontal: number;
29
+ };
30
+ error: {
31
+ fontSize: number;
32
+ fontFamily: string | undefined;
33
+ color: string;
34
+ };
35
+ placeholder: string;
36
+ };
37
+ export interface FieldProps extends Omit<TextInputProps, 'style'> {
38
+ label?: string;
39
+ error?: string;
40
+ disabled?: boolean;
41
+ trailing?: ReactNode;
42
+ containerStyle?: ViewStyle;
43
+ partName?: PartName;
44
+ }
45
+ /** React Native's own TextInput instance type is not nameable from a declaration file, so the
46
+ * alias is declared here and the component is annotated with it. */
47
+ export type FieldRef = ComponentRef<typeof TextInput>;
48
+ export declare const Field: ForwardRefExoticComponent<FieldProps & RefAttributes<FieldRef>>;
49
+ export interface FieldShellProps {
50
+ label?: string;
51
+ error?: string;
52
+ focused?: boolean;
53
+ disabled?: boolean;
54
+ trailing?: ReactNode;
55
+ partName?: PartName;
56
+ boxStyle?: ViewStyle;
57
+ containerStyle?: ViewStyle;
58
+ children: ReactNode;
59
+ }
60
+ /**
61
+ * The label, box, and error row around an input this package does not own — a Basis Theory hosted
62
+ * field. Shares its chrome with `Field` so an isolated field is visually indistinguishable from a
63
+ * plain one.
64
+ */
65
+ export declare function FieldShell({ label, error, focused, disabled, trailing, partName, boxStyle, containerStyle, children, }: FieldShellProps): import("react/jsx-runtime").JSX.Element;
66
+ /** The shell every element paints before its first content commit. */
67
+ export declare function Skeleton({ height, width, style }: {
68
+ height: number;
69
+ width?: number | string;
70
+ style?: ViewStyle;
71
+ }): import("react/jsx-runtime").JSX.Element;
72
+ export declare function FieldSkeleton({ label }: {
73
+ label?: boolean;
74
+ }): import("react/jsx-runtime").JSX.Element;
75
+ /** Form fields sit top-aligned: one field carrying an error message must not vertically re-centre
76
+ * the field beside it. */
77
+ export declare function Row({ children, style }: {
78
+ children: ReactNode;
79
+ style?: ViewStyle;
80
+ }): import("react/jsx-runtime").JSX.Element;
81
+ export declare function Stack({ children, style, gap }: {
82
+ children: ReactNode;
83
+ style?: ViewStyle;
84
+ gap?: number;
85
+ }): import("react/jsx-runtime").JSX.Element;
86
+ export declare function ErrorFace({ message }: {
87
+ message: string;
88
+ }): import("react/jsx-runtime").JSX.Element;
89
+ export declare function TextButton({ label, onPress, disabled }: {
90
+ label: string;
91
+ onPress: () => void;
92
+ disabled?: boolean;
93
+ }): import("react/jsx-runtime").JSX.Element;
94
+ //# sourceMappingURL=primitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../src/ui/primitives.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,25 @@
1
+ import type { PartName } from '../theme/appearance.js';
2
+ export interface SelectOption {
3
+ value: string;
4
+ label: string;
5
+ }
6
+ export interface SelectProps {
7
+ label?: string;
8
+ value: string | undefined;
9
+ options: SelectOption[];
10
+ onChange: (value: string) => void;
11
+ placeholder?: string;
12
+ error?: string;
13
+ disabled?: boolean;
14
+ /** Long lists (241 countries, 200-odd tax registrations) get a filter row. */
15
+ searchable?: boolean;
16
+ partName?: PartName;
17
+ accessibilityLabel?: string;
18
+ }
19
+ /**
20
+ * A picker sheet rather than a platform picker: `@react-native-picker/picker` renders as a spinner
21
+ * on iOS and a dropdown on Android, which makes the same element look like two different products
22
+ * and gives the theme nothing to style. One sheet, both platforms.
23
+ */
24
+ export declare function Select({ label, value, options, onChange, placeholder, error, disabled, searchable, partName, accessibilityLabel, }: SelectProps): import("react/jsx-runtime").JSX.Element;
25
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/ui/select.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAqB,CAAC;AAOpD,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACtB,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,WAAW,EACX,KAAK,EACL,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,kBAAkB,GAClB,EAAE,WAAW,2CAiKb"}
@@ -0,0 +1,15 @@
1
+ import type { AddressSuggestion } from '../core/address/suggest.js';
2
+ /**
3
+ * The street suggestion list, rendered IN FLOW directly beneath the field rather than floating over
4
+ * the form.
5
+ *
6
+ * An anchored overlay would need the package's first measurement code, its first keyboard
7
+ * avoidance, and an escape from a ScrollView the consumer owns and this SDK cannot configure — and
8
+ * Android clips absolutely-positioned children that leave their parent's bounds regardless of
9
+ * elevation. Pushing the fields below it down costs a little polish and removes all of that.
10
+ */
11
+ export declare function SuggestionList({ suggestions, onPick, }: {
12
+ suggestions: AddressSuggestion[];
13
+ onPick: (suggestion: AddressSuggestion) => void;
14
+ }): import("react/jsx-runtime").JSX.Element | null;
15
+ //# sourceMappingURL=suggestions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions.d.ts","sourceRoot":"","sources":["../../../../src/ui/suggestions.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAAyB,CAAC;AAIjE;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC9B,WAAW,EACX,MAAM,GACN,EAAE;IACF,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,MAAM,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAChD,kDAyCA"}
@@ -0,0 +1,4 @@
1
+ export declare function WhopLogo({ height }: {
2
+ height?: number;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=whop-logo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whop-logo.d.ts","sourceRoot":"","sources":["../../../../src/ui/whop-logo.tsx"],"names":[],"mappings":"AAyBA,wBAAgB,QAAQ,CAAC,EAAE,MAAW,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,2CAW5D"}
package/package.json ADDED
@@ -0,0 +1,121 @@
1
+ {
2
+ "name": "@whop/elements-react-native",
3
+ "version": "0.1.0",
4
+ "description": "Whop Elements — native React Native components for collecting payments.",
5
+ "keywords": [
6
+ "checkout",
7
+ "elements",
8
+ "payments",
9
+ "react-native",
10
+ "whop"
11
+ ],
12
+ "homepage": "https://docs.whop.com/elements/latest",
13
+ "bugs": "https://github.com/whopio/elements/issues",
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/whopio/elements.git",
18
+ "directory": "frontend/packages/elements-react-native"
19
+ },
20
+ "main": "./lib/module/index.js",
21
+ "module": "./lib/module/index.js",
22
+ "react-native": "./src/index.ts",
23
+ "types": "./lib/typescript/src/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./lib/typescript/src/index.d.ts",
27
+ "react-native": "./src/index.ts",
28
+ "default": "./lib/module/index.js"
29
+ },
30
+ "./package.json": "./package.json"
31
+ },
32
+ "files": [
33
+ "lib",
34
+ "src",
35
+ "assets",
36
+ "ios",
37
+ "android",
38
+ "scripts",
39
+ "!android/build",
40
+ "!**/__tests__",
41
+ "!**/*.test.ts",
42
+ "!**/*.test.tsx"
43
+ ],
44
+ "scripts": {
45
+ "build": "bob build",
46
+ "check-swift": "bash scripts/check-swift.sh",
47
+ "check-types": "tsc --noEmit",
48
+ "ci:lint": "node scripts/mirror.mjs --validate && oxlint -f github .",
49
+ "ci:typecheck": "tsc --noEmit",
50
+ "clean": "rm -rf lib ios/generated android/build",
51
+ "country-names": "node scripts/gen-country-names.mjs",
52
+ "example:android": "cd example && pnpm run android",
53
+ "example:install": "cd example && pnpm install",
54
+ "example:ios": "cd example && pnpm run ios",
55
+ "format": "oxfmt",
56
+ "lint": "oxlint .",
57
+ "lint:fix": "oxlint --fix --fix-suggestions && oxfmt",
58
+ "mirror": "node scripts/mirror.mjs",
59
+ "mirror:validate": "node scripts/mirror.mjs --validate",
60
+ "prepare": "node scripts/codegen-shims.mjs && bob build",
61
+ "shims": "node scripts/codegen-shims.mjs",
62
+ "test": "vitest run",
63
+ "test:watch": "vitest",
64
+ "theme": "node scripts/gen-theme.mjs",
65
+ "wordmark": "node scripts/gen-wordmark.mjs"
66
+ },
67
+ "dependencies": {
68
+ "@basis-theory/react-native-elements": "4.0.3",
69
+ "@noble/hashes": "^1.8.0"
70
+ },
71
+ "peerDependencies": {
72
+ "react": ">=19.2.3",
73
+ "react-native": ">=0.87.0"
74
+ },
75
+ "devDependencies": {
76
+ "@react-native/typescript-config": "0.87.0",
77
+ "@types/react": "19.1.5",
78
+ "frosted-ui": "0.0.1-canary.158",
79
+ "oxlint": "^1.0.0",
80
+ "react": "19.2.3",
81
+ "react-native": "0.87.0",
82
+ "react-native-builder-bob": "0.43.0",
83
+ "typescript": "^6.0.0",
84
+ "vitest": "^3.0.0"
85
+ },
86
+ "codegenConfig": {
87
+ "name": "WhopElementsSpec",
88
+ "type": "all",
89
+ "jsSrcsDir": "src/specs",
90
+ "android": {
91
+ "javaPackageName": "com.whop.elements"
92
+ },
93
+ "ios": {
94
+ "componentProvider": {
95
+ "WhopPayButton": "WhopPayButtonComponentView"
96
+ }
97
+ }
98
+ },
99
+ "react-native-builder-bob": {
100
+ "source": "src",
101
+ "output": "lib",
102
+ "targets": [
103
+ [
104
+ "module",
105
+ {
106
+ "esm": true
107
+ }
108
+ ],
109
+ [
110
+ "typescript",
111
+ {
112
+ "project": "tsconfig.build.json"
113
+ }
114
+ ]
115
+ ]
116
+ },
117
+ "publishConfig": {
118
+ "access": "public"
119
+ },
120
+ "packageManager": "pnpm@10.12.4"
121
+ }
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env bash
2
+ # Typechecks the Swift against the real iOS SDK without building an app.
3
+ #
4
+ # A FAST PRE-FILTER, not a substitute for the build: SwiftPM compiles these targets with settings
5
+ # this invocation does not fully reproduce, and it has already let a strict-concurrency error
6
+ # through. Run the example app before trusting a native change.
7
+ #
8
+ # Nothing in ios/Sources imports React, so the whole implementation typechecks standalone — which
9
+ # means a wrong PassKit or AuthenticationServices symbol surfaces here in seconds instead of
10
+ # one-error-at-a-time inside an Xcode build.
11
+ set -euo pipefail
12
+
13
+ sdk=$(xcrun --sdk iphonesimulator --show-sdk-path)
14
+ root=$(cd "$(dirname "$0")/.." && pwd)
15
+
16
+ # -swift-version 6 is not optional: Package.swift declares swift-tools-version 6.0, which puts
17
+ # these targets in the Swift 6 language mode with strict concurrency. Checking without it passes
18
+ # code that the real build rejects.
19
+ xcrun --sdk iphonesimulator swiftc -typecheck \
20
+ -target arm64-apple-ios15.0-simulator \
21
+ -sdk "$sdk" \
22
+ -swift-version 6 \
23
+ -strict-concurrency=complete \
24
+ -warnings-as-errors \
25
+ "$root"/ios/Sources/ElementsReactNative/*.swift
26
+
27
+ echo "whop elements: Swift 6 typechecks against $(basename "$sdk")"